{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "quota-banner",
  "title": "Quota Banner",
  "description": "Usage remaining, reset timing, and an upgrade path without hiding the limit.",
  "dependencies": [
    "@solar-icons/react@^2.2.0",
    "cn@^0.3.0"
  ],
  "registryDependencies": [
    "button",
    "https://pastaui.com/r/pastaui-styles.json"
  ],
  "files": [
    {
      "path": "src/components/ai/quota-banner.tsx",
      "content": "import { ArrowRightUpIcon as ArrowUpRightIcon } from '@solar-icons/react/linear/arrow-right-up'\nimport { SpeedometerMiddleIcon as GaugeIcon } from '@solar-icons/react/linear/speedometer-middle'\nimport * as React from 'react'\n\nimport { Button } from '@/components/ui/button'\nimport { cn } from 'cn'\n\ninterface QuotaBannerProps extends React.ComponentProps<'aside'> {\n  label?: string\n  limit: number\n  onUpgrade?: () => void\n  resetsAt: string\n  unit?: string\n  used: number\n}\n\nfunction QuotaBanner({\n  className,\n  label = 'Monthly agent usage',\n  limit,\n  onUpgrade,\n  resetsAt,\n  unit = 'runs',\n  used,\n  ...props\n}: QuotaBannerProps) {\n  const remaining = Math.max(limit - used, 0)\n  const percentage = limit > 0 ? Math.min((used / limit) * 100, 100) : 0\n  const tone =\n    percentage > 95 ? 'bg-red-500' : percentage >= 80 ? 'bg-amber-500' : 'bg-foreground/85'\n\n  return (\n    <aside\n      data-slot=\"quota-banner\"\n      className={cn(\n        'rounded-[16px] bg-card p-4 font-sans text-sm font-[450] tracking-[-0.05px] text-muted-foreground shadow-card dark:shadow-none',\n        className,\n      )}\n      {...props}\n    >\n      <div className=\"flex items-start gap-3\">\n        <span className=\"flex size-9 shrink-0 items-center justify-center rounded-[10px] bg-foreground/6 text-muted-foreground\">\n          <GaugeIcon className=\"size-4\" />\n        </span>\n        <div className=\"min-w-0 flex-1\">\n          <h3 className=\"text-sm leading-5 font-medium text-muted-foreground\">{label}</h3>\n          <p className=\"mt-1 text-[22px] leading-7 font-medium tracking-[-0.02em] text-foreground tabular-nums\">\n            {used.toLocaleString()} / {limit.toLocaleString()} {unit}\n          </p>\n          <meter\n            aria-label={`${label}: ${used.toLocaleString()} of ${limit.toLocaleString()} ${unit} used`}\n            className=\"sr-only\"\n            max={limit}\n            min={0}\n            value={Math.min(used, limit)}\n          />\n          <div\n            aria-hidden=\"true\"\n            className=\"mt-3 h-1.5 overflow-hidden rounded-full bg-foreground/8\"\n          >\n            <div\n              className={cn('h-full rounded-full transition-colors duration-200 ease-out', tone)}\n              style={{ width: `${percentage}%` }}\n            />\n          </div>\n          <p className=\"mt-2 text-xs leading-5 text-muted-foreground tabular-nums\">\n            {remaining.toLocaleString()} left · Resets {resetsAt}\n          </p>\n        </div>\n        {onUpgrade && (\n          <Button\n            className=\"h-7 rounded-full border-0 bg-primary px-3 text-sm font-[450] text-primary-foreground shadow-none hover:bg-primary/90\"\n            onClick={onUpgrade}\n            size=\"sm\"\n            type=\"button\"\n          >\n            Upgrade{' '}\n            <ArrowUpRightIcon\n              data-icon=\"inline-end\"\n              className=\"transition-[translate] duration-150 ease-[cubic-bezier(0.23,1,0.32,1)] group-hover/button:translate-x-px group-hover/button:-translate-y-px motion-reduce:transition-none\"\n            />\n          </Button>\n        )}\n      </div>\n    </aside>\n  )\n}\n\nexport { QuotaBanner }\nexport type { QuotaBannerProps }\n",
      "type": "registry:component",
      "target": "@components/ai/quota-banner.tsx"
    }
  ],
  "type": "registry:component"
}