{
  "name": "progress",
  "type": "registry:ui",
  "framework": "react",
  "title": "Progress Bar",
  "description": "A gradient progress bar for boosts, uploads and other long-running tasks.",
  "dependencies": [
    "class-variance-authority",
    "radix-ui"
  ],
  "files": [
    {
      "path": "ui/progress.tsx",
      "content": "\"use client\"\n\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport { Progress as ProgressPrimitive } from \"radix-ui\"\nimport * as React from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\nconst progressVariants = cva(\n  \"h-full rounded-full transition-[width] duration-base ease-newt\",\n  {\n    variants: {\n      variant: {\n        default: \"bg-[linear-gradient(90deg,var(--newt-brand),#8c54ff)]\",\n        success: \"bg-[linear-gradient(90deg,var(--newt-online),#45c178)]\",\n        danger: \"bg-[linear-gradient(90deg,var(--newt-dnd),#f4878a)]\",\n      },\n    },\n    defaultVariants: {\n      variant: \"default\",\n    },\n  }\n)\n\nexport interface ProgressProps\n  extends\n    Omit<\n      React.ComponentPropsWithoutRef<typeof ProgressPrimitive.Root>,\n      \"value\"\n    >,\n    VariantProps<typeof progressVariants> {\n  /** Current value, 0–max */\n  value?: number\n  indicatorClassName?: string\n}\n\n/*\n * Radix owns the semantics: `role=\"progressbar\"`, the `aria-value*`\n * attributes and `data-state` (`loading` or `complete`). Only the look is\n * newt/ui's.\n */\nconst Progress = React.forwardRef<\n  React.ComponentRef<typeof ProgressPrimitive.Root>,\n  ProgressProps\n>(\n  (\n    { className, indicatorClassName, value = 0, max = 100, variant, ...props },\n    ref\n  ) => {\n    /* Radix reads a value outside 0–max as indeterminate, so clamp it first. */\n    const limit = max > 0 ? max : 100\n    const clamped = Math.min(Math.max(value, 0), limit)\n    return (\n      <ProgressPrimitive.Root\n        ref={ref}\n        value={clamped}\n        max={limit}\n        className={cn(\n          \"h-2 w-full overflow-hidden rounded-full bg-newt-bg-base\",\n          className\n        )}\n        {...props}\n      >\n        <ProgressPrimitive.Indicator\n          className={cn(progressVariants({ variant }), indicatorClassName)}\n          style={{ width: `${(clamped / limit) * 100}%` }}\n        />\n      </ProgressPrimitive.Root>\n    )\n  }\n)\nProgress.displayName = \"Progress\"\n\nconst ProgressLabel = React.forwardRef<\n  HTMLDivElement,\n  React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n  <div\n    ref={ref}\n    className={cn(\n      \"mb-1.5 flex justify-between text-xs text-newt-text-muted\",\n      className\n    )}\n    {...props}\n  />\n))\nProgressLabel.displayName = \"ProgressLabel\"\n\nexport { Progress, ProgressLabel, progressVariants }\n",
      "type": "registry:ui"
    }
  ]
}