{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "progress",
  "type": "registry:ui",
  "title": "Progress",
  "description": "A bar that fills as a task completes, or slides back and forth when the amount done is not known.",
  "categories": [
    "ui"
  ],
  "dependencies": [
    "class-variance-authority",
    "radix-ui"
  ],
  "registryDependencies": [
    "@rivier-ui/theme",
    "@rivier-ui/cn"
  ],
  "files": [
    {
      "path": "registry/ui/progress.tsx",
      "type": "registry:ui",
      "target": "components/ui/progress.tsx",
      "content": "\"use client\";\n/**\n * @name progress\n * @category ui\n * @description A bar that fills as a task completes, or slides back and forth when the amount done is not known.\n * @when A wait that can be measured: an upload, a multi-step job. Leave `value` out (or pass null) for the indeterminate state. For a short unknown wait use spinner. Always label it.\n * @example\n * <Progress value={64} aria-label=\"Uploading\" />\n * <Progress value={3} max={8} size=\"sm\" aria-label=\"Step 3 of 8\" />\n * <Progress aria-label=\"Connecting\" />\n */\nimport { Progress as ProgressPrimitive } from \"radix-ui\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport type { ComponentProps } from \"react\";\nimport { cn } from \"@/lib/cn\";\n\nexport const progressVariants = cva(\"relative w-full overflow-hidden rounded-control bg-muted\", {\n  variants: {\n    size: {\n      sm: \"h-1\",\n      md: \"h-2\",\n      lg: \"h-3\",\n    },\n  },\n  defaultVariants: { size: \"md\" },\n});\n\nexport type ProgressProps = ComponentProps<typeof ProgressPrimitive.Root> & VariantProps<typeof progressVariants>;\n\n/**\n * The bar is full width and scaled on the x axis, so filling never causes layout. Needs the `rui-progress`\n * keyframe from the theme for the indeterminate state.\n */\nexport function Progress({ className, size, value, max = 100, ...props }: ProgressProps) {\n  const known = typeof value === \"number\" && max > 0;\n  const ratio = known ? Math.min(1, Math.max(0, value / max)) : 0;\n  return (\n    <ProgressPrimitive.Root data-slot=\"progress\" value={known ? value : null} max={max} className={cn(progressVariants({ size }), className)} {...props}>\n      {known ? (\n        <ProgressPrimitive.Indicator\n          data-slot=\"progress-indicator\"\n          className=\"block size-full origin-left bg-primary transition-transform duration-slow ease-out motion-reduce:transition-none rtl:origin-right\"\n          style={{ transform: `scaleX(${ratio})` }}\n        />\n      ) : (\n        <ProgressPrimitive.Indicator\n          data-slot=\"progress-indicator\"\n          className=\"absolute inset-y-0 left-0 block w-2/5 animate-[rui-progress_1.4s_ease-in-out_infinite] bg-primary motion-reduce:left-[30%] motion-reduce:animate-none\"\n        />\n      )}\n    </ProgressPrimitive.Root>\n  );\n}\n"
    }
  ],
  "meta": {
    "category": "ui",
    "when": "A wait that can be measured: an upload, a multi-step job. Leave `value` out (or pass null) for the indeterminate state. For a short unknown wait use spinner. Always label it.",
    "example": "<Progress value={64} aria-label=\"Uploading\" />\n<Progress value={3} max={8} size=\"sm\" aria-label=\"Step 3 of 8\" />\n<Progress aria-label=\"Connecting\" />",
    "client": true
  }
}
