{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "usage-panel-01",
  "type": "registry:block",
  "title": "Credits and Usage",
  "description": "A credits and usage summary that makes the remaining processing allowance easy to understand.",
  "author": "UIBlocks contributors",
  "registryDependencies": [],
  "dependencies": [
    "lucide-react@0.577.0"
  ],
  "files": [
    {
      "path": "licenses/usage-panel-01/LICENSE.txt",
      "type": "registry:file",
      "target": "@components/uiblocks/usage-panel-01/LICENSE.txt",
      "content": "UIBlocks original block: Copyright (c) 2026 UIBlocks contributors. Licensed under the MIT License below.\n\nIncludes source from Blocks.so and its bundled primitives.\nSource: https://github.com/ephraimduncan/blocks\nRevision: 3f759d5171c2391253ec4c772e9e5b3db2bc7c7f\n\nMIT License\n\nCopyright (c) 2025 Ephraim Duncan\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
    },
    {
      "path": "content/components/workspace/usage-panel-01.tsx",
      "type": "registry:component",
      "target": "@components/uiblocks/usage-panel-01/usage-panel-01.tsx",
      "content": "\"use client\";\n\nimport {\n  ArrowUpRight,\n  CheckCircle2,\n  CircleHelp,\n  Leaf,\n  Zap,\n} from \"lucide-react\";\nimport { useId, useState } from \"react\";\n\nexport type UsagePanel01Props = {\n  title?: string;\n  used?: number;\n  limit?: number;\n  planName?: string;\n  upgradeHref?: string;\n};\n\n/** A usage summary with bounded progress and a plain-language plan explanation. */\nexport default function UsagePanel01({\n  title = \"A little room to create.\",\n  used = 38,\n  limit = 100,\n  planName = \"Studio demo\",\n  upgradeHref = \"/preview/recipes/tool-landing#pricing\",\n}: UsagePanel01Props = {}) {\n  const [showInfo, setShowInfo] = useState(false);\n  const id = useId();\n  const percentage =\n    limit > 0 ? Math.max(0, Math.min(100, (used / limit) * 100)) : 0;\n  return (\n    <aside\n      aria-labelledby={id}\n      className=\"w-full rounded-2xl border border-zinc-200 bg-white p-5 text-zinc-950 shadow-sm shadow-zinc-950/[0.02] sm:p-6 dark:border-zinc-800 dark:bg-zinc-950 dark:text-zinc-50\"\n    >\n      <div className=\"flex items-start justify-between gap-3\">\n        <span className=\"grid size-9 place-items-center rounded-xl bg-zinc-100 text-zinc-600 dark:bg-zinc-800 dark:text-zinc-300\">\n          <Zap aria-hidden=\"true\" className=\"size-4\" />\n        </span>\n        <span className=\"rounded-md bg-violet-50 px-2 py-1 text-[10px] font-medium text-violet-600 dark:bg-violet-950/40 dark:text-violet-400\">\n          {planName}\n        </span>\n      </div>\n      <h2 className=\"mt-4 text-sm font-semibold\" id={id}>\n        {title}\n      </h2>\n      <p className=\"mt-2 text-xs leading-5 text-zinc-500 dark:text-zinc-400\">\n        Keep an eye on your workspace usage as your ideas take shape.\n      </p>\n      <div className=\"mt-5 flex items-baseline justify-between gap-3\">\n        <p className=\"text-xl font-semibold tabular-nums tracking-tight\">\n          {Math.max(0, used)}\n          <span className=\"ml-1 text-xs font-normal text-zinc-400\">\n            / {Math.max(0, limit)} credits\n          </span>\n        </p>\n        <button\n          aria-expanded={showInfo}\n          aria-label=\"About demo credits\"\n          className=\"grid size-7 place-items-center rounded-md text-zinc-400 hover:bg-zinc-100 dark:hover:bg-zinc-800\"\n          onClick={() => setShowInfo(!showInfo)}\n          type=\"button\"\n        >\n          <CircleHelp aria-hidden=\"true\" className=\"size-3.5\" />\n        </button>\n      </div>\n      <div\n        aria-label=\"Demo credit usage\"\n        aria-valuemax={100}\n        aria-valuemin={0}\n        aria-valuenow={Math.round(percentage)}\n        className=\"mt-3 h-1.5 overflow-hidden rounded-full bg-zinc-100 dark:bg-zinc-800\"\n        role=\"progressbar\"\n      >\n        <div\n          className=\"h-full rounded-full bg-violet-500 transition-all duration-500\"\n          style={{ width: `${percentage}%` }}\n        />\n      </div>\n      <p className=\"mt-2 text-[10px] text-zinc-400\">\n        Illustrative usage · No account or charges\n      </p>\n      {showInfo && (\n        <p className=\"mt-3 rounded-lg bg-zinc-50 p-3 text-[11px] leading-5 text-zinc-500 dark:bg-zinc-900 dark:text-zinc-400\">\n          These credits demonstrate a usage layout. Demo runs do not spend real\n          credits, and no subscription is created.\n        </p>\n      )}\n      <a\n        className=\"mt-5 flex min-h-9 items-center justify-center gap-1.5 rounded-lg border border-zinc-200 text-xs font-medium transition-colors hover:border-violet-300 hover:bg-violet-50 hover:text-violet-700 dark:border-zinc-700 dark:hover:bg-violet-950/30 dark:hover:text-violet-300\"\n        href={upgradeHref}\n      >\n        Explore example plans{\" \"}\n        <ArrowUpRight aria-hidden=\"true\" className=\"size-3\" />\n      </a>\n      <div className=\"mt-5 space-y-2 border-t border-zinc-100 pt-4 text-[10px] text-zinc-400 dark:border-zinc-800\">\n        <p className=\"flex items-center gap-1.5\">\n          <CheckCircle2\n            aria-hidden=\"true\"\n            className=\"size-3 text-emerald-500\"\n          />{\" \"}\n          Local files stay private\n        </p>\n        <p className=\"flex items-center gap-1.5\">\n          <Leaf aria-hidden=\"true\" className=\"size-3 text-emerald-500\" /> No\n          background uploads\n        </p>\n      </div>\n    </aside>\n  );\n}\n"
    }
  ],
  "categories": [
    "workspace",
    "application",
    "clean-saas"
  ],
  "docs": "Import the default component from @components/uiblocks/usage-panel-01/usage-panel-01.tsx. React 19, Tailwind CSS 4, and the standard shadcn CSS theme variables are required. This block is framework-independent React and works in TanStack Start, Vite, and Next.js projects. Connect links or navigation callbacks to your host application. Demo avatars use public image URLs; replace them with your own assets. Demo handlers must be connected to your product. See https://uiblocks.org/workspace/usage-panel-01 for content guidelines and source attribution.",
  "meta": {
    "kind": "block",
    "version": "0.1.0",
    "source": {
      "name": "UIBlocks",
      "url": "https://uiblocks.org",
      "license": "MIT",
      "author": "UIBlocks contributors",
      "revision": "uiblocks-v0.1.0"
    },
    "license": "MIT",
    "style": "clean-saas",
    "pageType": "application",
    "featured": true,
    "tags": [
      "usage",
      "credits",
      "quota",
      "billing",
      "allowance",
      "额度",
      "积分",
      "用量",
      "账单",
      "剩余"
    ],
    "contentGuidelines": [
      "Display the allowance period and unit alongside usage.",
      "Calculate authoritative usage and entitlements in your backend."
    ],
    "recommendedWith": [
      "workspace-header-01",
      "upload-workflow-01",
      "pricing-01"
    ],
    "entry": "@components/uiblocks/usage-panel-01/usage-panel-01.tsx",
    "exportName": "default",
    "frameworkIndependent": true,
    "frameworkDependencies": [],
    "compatibleHosts": [
      "react",
      "vite",
      "tanstack-start",
      "nextjs"
    ],
    "requirements": {
      "react": ">=19",
      "tailwind": ">=4"
    },
    "previewUrl": "https://uiblocks.org/preview/usage-panel-01"
  }
}
