{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "base-progress", "type": "registry:ui", "title": "Base Progress", "description": "Displays the status of a task that takes a long time.", "dependencies": [ "motion", "@base-ui-components/react" ], "registryDependencies": [ "https://animate-ui.com/r/counting-number" ], "files": [ { "path": "registry/base/progress/index.tsx", "content": "'use client';\n\nimport * as React from 'react';\nimport { Progress as ProgressPrimitives } from '@base-ui-components/react/progress';\nimport { motion, type Transition } from 'motion/react';\n\nimport { cn } from '@/lib/utils';\nimport {\n CountingNumber,\n type CountingNumberProps,\n} from '@/components/animate-ui/text/counting-number';\n\ntype ProgressContextType = {\n value: number | null;\n};\n\nconst ProgressContext = React.createContext(\n undefined,\n);\n\nconst useProgress = (): ProgressContextType => {\n const context = React.useContext(ProgressContext);\n if (!context) {\n throw new Error('useProgress must be used within a Progress');\n }\n return context;\n};\n\ntype ProgressProps = React.ComponentProps;\n\nconst Progress = ({ value, ...props }: ProgressProps) => {\n return (\n \n \n {props.children}\n \n \n );\n};\n\nconst MotionProgressIndicator = motion.create(ProgressPrimitives.Indicator);\n\ntype ProgressTrackProps = React.ComponentProps<\n typeof ProgressPrimitives.Track\n> & {\n transition?: Transition;\n};\n\nfunction ProgressTrack({\n className,\n transition = { type: 'spring', stiffness: 100, damping: 30 },\n ...props\n}: ProgressTrackProps) {\n const { value } = useProgress();\n\n return (\n \n \n \n );\n}\n\ntype ProgressLabelProps = React.ComponentProps;\n\nfunction ProgressLabel(props: ProgressLabelProps) {\n return ;\n}\n\ntype ProgressValueProps = Omit<\n React.ComponentProps,\n 'render'\n> & {\n countingNumberProps?: CountingNumberProps;\n};\n\nfunction ProgressValue({ countingNumberProps, ...props }: ProgressValueProps) {\n const { value } = useProgress();\n\n return (\n \n }\n {...props}\n />\n );\n}\n\nexport {\n Progress,\n ProgressTrack,\n ProgressLabel,\n ProgressValue,\n useProgress,\n type ProgressProps,\n type ProgressTrackProps,\n type ProgressLabelProps,\n type ProgressValueProps,\n};\n", "type": "registry:ui", "target": "components/animate-ui/base/progress.tsx" } ] }