{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"progress","title":"Progress","author":"brijr","description":"A bar that shows task completion, built on UI SDK.","dependencies":["@ui-sdk/react","@ui-sdk/core","cn"],"files":[{"path":"components/ui/progress.tsx","content":"import * as React from \"react\"\nimport {\n  Progress as ProgressPrimitive,\n  ProgressIndicator as ProgressIndicatorPrimitive,\n  ProgressLabel as ProgressLabelPrimitive,\n  ProgressTrack as ProgressTrackPrimitive,\n  ProgressValue as ProgressValuePrimitive,\n} from \"@ui-sdk/react/progress\"\nimport { cn } from \"cn\"\n\n/**\n * `track` is the bar. Left out, Progress adds a `ProgressTrack` after its\n * children unless one of its direct children already is one. Pass an element\n * to style the bar, or `null` to render none (a track placed deeper, inside\n * a wrapper or a fragment, needs `track={null}`).\n */\nfunction Progress({\n  className,\n  children,\n  track,\n  ...props\n}: Omit<\n  React.ComponentProps<typeof ProgressPrimitive>,\n  \"className\" | \"children\"\n> & {\n  className?: string\n  children?: React.ReactNode\n  track?: React.ReactElement | null\n}) {\n  const placed = React.Children.toArray(children).some(\n    (child) => React.isValidElement(child) && child.type === ProgressTrack\n  )\n  const bar = track === undefined && !placed ? <ProgressTrack /> : track\n\n  return (\n    <ProgressPrimitive\n      className={cn(\"relative flex w-full flex-wrap gap-3\", className)}\n      {...props}\n    >\n      {children}\n      {bar}\n    </ProgressPrimitive>\n  )\n}\n\nfunction ProgressTrack({\n  className,\n  children,\n  ...props\n}: Omit<React.ComponentProps<typeof ProgressTrackPrimitive>, \"className\"> & {\n  className?: string\n}) {\n  return (\n    <ProgressTrackPrimitive\n      className={cn(\n        \"relative h-2 w-full overflow-hidden rounded-full bg-foreground/10\",\n        className\n      )}\n      {...props}\n    >\n      {children ?? <ProgressIndicator />}\n    </ProgressTrackPrimitive>\n  )\n}\n\nfunction ProgressIndicator({\n  className,\n  ...props\n}: Omit<\n  React.ComponentProps<typeof ProgressIndicatorPrimitive>,\n  \"className\"\n> & {\n  className?: string\n}) {\n  return (\n    <ProgressIndicatorPrimitive\n      className={cn(\n        \"h-full rounded-full bg-primary transition-[width] duration-(--duration-layout) ease-(--easing-move) data-indeterminate:w-full data-indeterminate:animate-pulse motion-reduce:transition-none motion-reduce:data-indeterminate:animate-none\",\n        className\n      )}\n      {...props}\n    />\n  )\n}\n\nfunction ProgressLabel({\n  className,\n  ...props\n}: Omit<React.ComponentProps<typeof ProgressLabelPrimitive>, \"className\"> & {\n  className?: string\n}) {\n  return (\n    <ProgressLabelPrimitive\n      className={cn(\"text-sm font-medium\", className)}\n      {...props}\n    />\n  )\n}\n\nfunction ProgressValue({\n  className,\n  ...props\n}: Omit<React.ComponentProps<typeof ProgressValuePrimitive>, \"className\"> & {\n  className?: string\n}) {\n  return (\n    <ProgressValuePrimitive\n      className={cn(\n        \"ml-auto text-sm text-muted-foreground tabular-nums\",\n        className\n      )}\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"}