{"name":"progress","type":"registry:ui","files":[{"path":"progress.tsx","type":"registry:ui","content":"\"use client\"\n\nimport * as React from \"react\"\nimport { Progress as ProgressPrimitive } from \"@base-ui-components/react/progress\"\n\nimport { cn } from \"@/lib/utils\"\n\nfunction Progress({\n  className,\n  children,\n  max = 100,\n  min = 0,\n  style,\n  value,\n  variant = \"linear\",\n  ...props\n}: ProgressPrimitive.Root.Props & {\n  variant?: \"linear\" | \"circular\"\n}) {\n  const percentage =\n    value !== null && Number.isFinite(value) && max > min\n      ? Math.min(100, Math.max(0, ((value - min) / (max - min)) * 100))\n      : 0\n\n  return (\n    <ProgressPrimitive.Root\n      data-slot=\"progress\"\n      data-variant={variant}\n      className={cn(\n        \"group/progress flex w-full flex-col gap-[var(--hui-space-3)]\",\n        variant === \"circular\" && \"relative items-center justify-center\",\n        className\n      )}\n      max={max}\n      min={min}\n      style={(state) =>\n        ({\n          ...(typeof style === \"function\" ? style(state) : style),\n          \"--hui-progress-percentage\": percentage,\n        }) as React.CSSProperties & { \"--hui-progress-percentage\": number }\n      }\n      value={value}\n      {...props}\n    >\n      {children ? (\n        children\n      ) : variant === \"circular\" ? (\n        <>\n          <ProgressCircularTrack />\n          <ProgressValue />\n        </>\n      ) : (\n        <ProgressTrack>\n          <ProgressIndicator />\n        </ProgressTrack>\n      )}\n    </ProgressPrimitive.Root>\n  )\n}\n\nfunction ProgressLabel({ className, ...props }: ProgressPrimitive.Label.Props) {\n  return (\n    <ProgressPrimitive.Label\n      data-slot=\"progress-label\"\n      className={cn(\n        \"text-[var(--hui-color-foreground-base-primary)] [font-family:var(--hui-font-body)] [font-size:var(--hui-font-size-mini)] [font-weight:var(--hui-font-weight-medium)] [letter-spacing:var(--hui-letter-spacing-mini)] [line-height:var(--hui-line-height-mini)]\",\n        className\n      )}\n      {...props}\n    />\n  )\n}\n\nfunction ProgressTrack({ className, ...props }: ProgressPrimitive.Track.Props) {\n  return (\n    <ProgressPrimitive.Track\n      data-slot=\"progress-track\"\n      className={cn(\n        \"relative block h-[var(--hui-space-2)] w-full overflow-clip rounded-[1px] bg-[var(--hui-color-background-neutral-secondary)]\",\n        className\n      )}\n      {...props}\n    />\n  )\n}\n\nfunction ProgressIndicator({\n  className,\n  style,\n  ...props\n}: ProgressPrimitive.Indicator.Props) {\n  return (\n    <ProgressPrimitive.Indicator\n      data-slot=\"progress-indicator\"\n      className={cn(\n        \"h-full origin-left bg-[var(--hui-color-background-accent-emphasis)] [transform:scaleX(calc(var(--hui-progress-percentage,0)/100))] data-indeterminate:origin-center data-indeterminate:opacity-60 data-indeterminate:[transform:scaleX(0.4)] motion-safe:[transition:transform_var(--hui-duration-moderate)_linear] motion-safe:data-indeterminate:origin-left motion-safe:data-indeterminate:opacity-100 motion-safe:data-indeterminate:[animation:progress-indeterminate-sweep_1.2s_var(--hui-ease-in-out)_infinite] motion-safe:data-indeterminate:[transition:none]\",\n        className\n      )}\n      style={(state) => ({\n        ...(typeof style === \"function\" ? style(state) : style),\n        width: \"100%\",\n      })}\n      {...props}\n    />\n  )\n}\n\nfunction ProgressValue({ className, ...props }: ProgressPrimitive.Value.Props) {\n  return (\n    <ProgressPrimitive.Value\n      data-slot=\"progress-value\"\n      className={cn(\n        \"text-right text-[var(--hui-color-foreground-base-primary)] tabular-nums [font-family:var(--hui-font-body)] [font-size:var(--hui-font-size-mini)] [font-weight:var(--hui-font-weight-regular)] [letter-spacing:var(--hui-letter-spacing-mini)] [line-height:var(--hui-line-height-mini)] group-data-[variant=circular]/progress:absolute group-data-[variant=circular]/progress:top-1/2 group-data-[variant=circular]/progress:left-1/2 group-data-[variant=circular]/progress:-translate-x-1/2 group-data-[variant=circular]/progress:-translate-y-1/2 group-data-[variant=circular]/progress:whitespace-nowrap group-data-[variant=circular]/progress:text-center group-data-[variant=circular]/progress:[font-weight:var(--hui-font-weight-medium)]\",\n        className\n      )}\n      {...props}\n    />\n  )\n}\n\nfunction ProgressCircularTrack({\n  className,\n  ...props\n}: React.ComponentProps<\"svg\">) {\n  return (\n    <svg\n      aria-hidden=\"true\"\n      data-slot=\"progress-circular-track\"\n      viewBox=\"0 0 72 72\"\n      className={cn(\n        \"aspect-square h-[var(--hui-space-14)] w-[var(--hui-space-14)] -rotate-90 [--hui-progress-circumference:calc(2*3.14159265*var(--hui-progress-radius))] [--hui-progress-radius:calc((var(--hui-space-14)-var(--hui-progress-track-size)*2)/2)] [--hui-progress-track-size:var(--hui-space-2)] motion-safe:group-data-[indeterminate]/progress:[animation:progress-indeterminate-rotate_1.2s_linear_infinite]\",\n        className\n      )}\n      {...props}\n    >\n      <circle\n        data-slot=\"progress-circular-track-circle\"\n        className=\"fill-none stroke-[var(--hui-color-background-neutral-secondary)] [cx:50%] [cy:50%] [r:var(--hui-progress-radius)] [stroke-width:var(--hui-progress-track-size)]\"\n      />\n      <circle\n        data-slot=\"progress-circular-indicator-circle\"\n        className=\"fill-none stroke-[var(--hui-color-background-accent-emphasis)] [cx:50%] [cy:50%] [r:var(--hui-progress-radius)] [stroke-dasharray:var(--hui-progress-circumference)] [stroke-dashoffset:calc(var(--hui-progress-circumference)*(1-var(--hui-progress-percentage,0)/100))] [stroke-linecap:butt] [stroke-width:var(--hui-progress-track-size)] group-data-[indeterminate]/progress:opacity-60 group-data-[indeterminate]/progress:[stroke-dashoffset:calc(var(--hui-progress-circumference)*0.75)] motion-safe:[transition:stroke-dashoffset_var(--hui-duration-moderate)_linear] motion-safe:group-data-[indeterminate]/progress:opacity-100\"\n      />\n    </svg>\n  )\n}\n\nexport {\n  Progress,\n  ProgressLabel,\n  ProgressTrack,\n  ProgressIndicator,\n  ProgressValue,\n  ProgressCircularTrack,\n}\n","target":"components/ui/progress.tsx"}],"dependencies":["@base-ui-components/react"]}