{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "progress", "title": "Progress", "description": "A neumorphic progress bar component.", "dependencies": ["@base-ui/react", "class-variance-authority"], "registryDependencies": ["utils"], "files": [ { "path": "src/components/ui/progress.tsx", "content": "\"use client\";\n\nimport { Progress as BaseProgress } from \"@base-ui/react/progress\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport type { ComponentProps } from \"react\";\nimport { cn } from \"@/lib/utils\";\n\nconst progressTrackVariants = cva(\n \"relative w-full overflow-hidden rounded-full bg-surface shadow-neu-inset-sm\",\n {\n variants: {\n size: {\n sm: \"h-2 text-xs\",\n md: \"h-3 text-sm\",\n lg: \"h-4 text-base\",\n },\n },\n defaultVariants: {\n size: \"md\",\n },\n },\n);\n\nexport type ProgressProps = ComponentProps &\n VariantProps & {\n showValue?: boolean;\n };\n\nexport default function Progress({\n size,\n showValue = false,\n className,\n value,\n max = 100,\n ...props\n}: ProgressProps) {\n return (\n \n
\n {showValue && (\n \n {(curr) => {\n if (curr === null) return \"Loading...\";\n const val = Number(curr);\n const maxValue = Number(max) || 100;\n if (Number.isNaN(val) || Number.isNaN(maxValue)) return \"0%\";\n return `${Math.round((val / maxValue) * 100)}%`;\n }}\n \n )}\n
\n\n \n \n \n \n );\n}\n\nexport { progressTrackVariants };\n", "type": "registry:ui" } ], "type": "registry:ui" }