mirror of
https://github.com/cosscom/coss.git
synced 2026-09-14 20:06:50 +08:00
14 lines
2.1 KiB
JSON
14 lines
2.1 KiB
JSON
{
|
|
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
|
|
"name": "progress",
|
|
"type": "registry:ui",
|
|
"dependencies": ["@base-ui-components/react"],
|
|
"files": [
|
|
{
|
|
"path": "registry/default/ui/progress.tsx",
|
|
"content": "\"use client\"\n\nimport { Progress as ProgressPrimitive } from \"@base-ui-components/react/progress\"\n\nimport { cn } from \"@/lib/utils\"\n\nfunction Progress({\n className,\n children,\n ...props\n}: ProgressPrimitive.Root.Props) {\n return (\n <ProgressPrimitive.Root\n data-slot=\"progress\"\n className={cn(\"flex w-full flex-col gap-2\", className)}\n {...props}\n >\n {children ? (\n children\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(\"text-sm font-medium\", className)}\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 \"block h-1.5 w-full overflow-hidden rounded-full bg-input\",\n className\n )}\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(\"bg-primary transition-all duration-500\", className)}\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(\"text-sm tabular-nums\", className)}\n {...props}\n />\n )\n}\n\nexport {\n Progress,\n ProgressLabel,\n ProgressTrack,\n ProgressIndicator,\n ProgressValue,\n}\n",
|
|
"type": "registry:ui"
|
|
}
|
|
]
|
|
}
|