{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "resource-progress",
  "type": "registry:component",
  "title": "Resource progress",
  "description": "Labeled progress for delivery milestones, storage quotas, and resource usage.",
  "categories": [
    "metrics"
  ],
  "dependencies": [],
  "registryDependencies": [],
  "files": [
    {
      "path": "src/registry/overtrue/resource-progress.tsx",
      "type": "registry:component",
      "target": "components/overtrue/resource-progress.tsx",
      "content": "\"use client\";\nimport { useId, type ComponentProps, type ReactNode } from \"react\";\nimport { cn } from \"@/lib/utils\";\n\n/** Non-finite values become zero; all progress is constrained to its capacity. */\nexport function ResourceProgress({\n  value,\n  max = 100,\n  label,\n  valueLabel,\n  color = \"var(--color-primary)\",\n  className,\n  style,\n  ...props\n}: Omit<ComponentProps<\"div\">, \"children\" | \"color\"> & {\n  value: number;\n  max?: number;\n  label: string;\n  valueLabel?: ReactNode;\n  /** Any CSS color for the filled bar. Defaults to the theme primary. */\n  color?: string;\n}) {\n  const id = useId();\n  const capacity = Number.isFinite(max) && max > 0 ? max : 100;\n  const current = Math.min(\n    capacity,\n    Math.max(0, Number.isFinite(value) ? value : 0),\n  );\n  const percent = (current / capacity) * 100;\n  return (\n    <div\n      data-slot=\"resource-progress\"\n      className={cn(\"min-w-0 space-y-2\", className)}\n      style={{ ...style, [\"--progress-color\" as string]: color }}\n      {...props}\n    >\n      <div className=\"flex items-baseline justify-between gap-3 text-xs\">\n        <span id={id} className=\"min-w-0 text-muted-foreground\">\n          {label}\n        </span>\n        <span className=\"shrink-0 font-semibold tracking-[-0.01em] text-foreground tabular-nums\">\n          {valueLabel ?? `${Math.round(percent)}%`}\n        </span>\n      </div>\n      <div\n        role=\"progressbar\"\n        aria-labelledby={id}\n        aria-valuenow={current}\n        aria-valuemin={0}\n        aria-valuemax={capacity}\n        data-slot=\"resource-progress-track\"\n        className=\"h-1.5 rounded-full bg-[color-mix(in_oklab,var(--color-foreground)_8%,transparent)]\"\n      >\n        <div\n          data-slot=\"resource-progress-indicator\"\n          className=\"h-full origin-left rounded-full bg-[linear-gradient(90deg,color-mix(in_oklab,var(--progress-color)_72%,transparent),var(--progress-color))] transition-[width,scale] duration-700 ease-[cubic-bezier(0.22,1,0.36,1)] starting:scale-x-0 motion-reduce:transition-none dark:shadow-[0_0_10px_-1px_color-mix(in_oklab,var(--progress-color)_65%,transparent)]\"\n          style={{ width: `${percent}%` }}\n        />\n      </div>\n    </div>\n  );\n}\n"
    }
  ],
  "docs": "Documentation: https://ui.overtrue.xyz/components/resource-progress. Requires an initialized shadcn/ui project with Tailwind CSS v4."
}
