{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "progress",
  "title": "Progress",
  "description": "Displays an indicator showing the completion progress of a task.",
  "dependencies": [
    "@base-ui/react@^1.6.0"
  ],
  "registryDependencies": [
    "@nx-ui/utils"
  ],
  "files": [
    {
      "path": "components/ui/progress.tsx",
      "content": "\"use client\"\n\nimport * as React from \"react\"\nimport { Progress as ProgressPrimitive } from \"@base-ui/react/progress\"\n\nimport { cn } from \"@/lib/utils\"\n\nfunction Progress({\n  className,\n  children,\n  value,\n  labelPosition,\n  ...props\n}: ProgressPrimitive.Root.Props & {\n  /**\n   * Where to show the numeric value relative to the bar. Omit for the bare\n   * bar (the original behaviour). `right` puts it inline after the track;\n   * `bottom` under it; the `*-floating` variants show a bubble that tracks the\n   * fill position. Ported from the UUI `ProgressBar` label positions.\n   */\n  labelPosition?: \"right\" | \"bottom\" | \"top-floating\" | \"bottom-floating\"\n}) {\n  const pct =\n    typeof value === \"number\"\n      ? Math.min(100, Math.max(0, value))\n      : undefined\n\n  // Original behaviour: no labelPosition → bare bar (+ any children).\n  if (!labelPosition) {\n    return (\n      <ProgressPrimitive.Root\n        value={value}\n        data-slot=\"progress\"\n        className={cn(\"flex flex-wrap gap-3\", className)}\n        {...props}\n      >\n        {children}\n        <ProgressTrack>\n          <ProgressIndicator />\n        </ProgressTrack>\n      </ProgressPrimitive.Root>\n    )\n  }\n\n  const floating = labelPosition.endsWith(\"floating\")\n\n  return (\n    <ProgressPrimitive.Root\n      value={value}\n      data-slot=\"progress\"\n      data-label-position={labelPosition}\n      className={cn(\n        \"flex w-full\",\n        labelPosition === \"right\" ? \"items-center gap-3\" : \"flex-col gap-2\",\n        className\n      )}\n      {...props}\n    >\n      {labelPosition === \"top-floating\" && pct != null && (\n        <FloatingBubble pct={pct} className=\"mb-1.5\" />\n      )}\n      <ProgressTrack className={floating ? \"flex-1\" : undefined}>\n        <ProgressIndicator />\n      </ProgressTrack>\n      {labelPosition === \"bottom-floating\" && pct != null && (\n        <FloatingBubble pct={pct} className=\"mt-1.5\" />\n      )}\n      {(labelPosition === \"right\" || labelPosition === \"bottom\") && (\n        <ProgressValue\n          className={cn(\n            \"text-sm font-medium text-secondary-foreground tabular-nums\",\n            labelPosition === \"right\" ? \"ml-0\" : \"ml-auto\"\n          )}\n        />\n      )}\n      {children}\n    </ProgressPrimitive.Root>\n  )\n}\n\nfunction FloatingBubble({\n  pct,\n  className,\n}: {\n  pct: number\n  className?: string\n}) {\n  return (\n    <div className={cn(\"relative h-8\", className)}>\n      <span\n        data-slot=\"progress-bubble\"\n        style={{ left: `${pct}%` }}\n        className=\"absolute top-0 -translate-x-1/2 rounded-lg bg-background px-3 py-2 text-xs font-semibold text-secondary-foreground shadow-lg ring-1 ring-border\"\n      >\n        {Math.round(pct)}%\n      </span>\n    </div>\n  )\n}\n\nfunction ProgressTrack({ className, ...props }: ProgressPrimitive.Track.Props) {\n  return (\n    <ProgressPrimitive.Track\n      className={cn(\n        \"relative flex h-2 w-full items-center overflow-x-hidden rounded-full bg-bg-quaternary\",\n        className\n      )}\n      data-slot=\"progress-track\"\n      {...props}\n    />\n  )\n}\n\nfunction ProgressIndicator({\n  className,\n  ...props\n}: ProgressPrimitive.Indicator.Props) {\n  return (\n    <ProgressPrimitive.Indicator\n      data-slot=\"progress-indicator\"\n      className={cn(\"h-full rounded-full bg-primary transition-all\", className)}\n      {...props}\n    />\n  )\n}\n\nfunction ProgressLabel({ className, ...props }: ProgressPrimitive.Label.Props) {\n  return (\n    <ProgressPrimitive.Label\n      className={cn(\"text-sm font-medium\", className)}\n      data-slot=\"progress-label\"\n      {...props}\n    />\n  )\n}\n\nfunction ProgressValue({ className, ...props }: ProgressPrimitive.Value.Props) {\n  return (\n    <ProgressPrimitive.Value\n      className={cn(\n        \"ml-auto text-sm text-muted-foreground tabular-nums\",\n        className\n      )}\n      data-slot=\"progress-value\"\n      {...props}\n    />\n  )\n}\n\nexport {\n  Progress,\n  ProgressTrack,\n  ProgressIndicator,\n  ProgressLabel,\n  ProgressValue,\n}\n",
      "type": "registry:ui"
    }
  ],
  "type": "registry:ui"
}