{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"timeline","type":"registry:ui","title":"Timeline","description":"","dependencies":["radix-ui"],"registryDependencies":[],"files":[{"path":"timeline.tsx","type":"registry:ui","content":"\"use client\"\n\nimport type { HTMLAttributes, TimeHTMLAttributes } from \"react\"\nimport { createContext, useCallback, useContext, useState } from \"react\"\nimport { Slot } from \"radix-ui\"\n\nimport { cn } from \"@/lib/utils\"\n\n// Types\ntype TimelineContextValue = {\n activeStep: number\n setActiveStep: (step: number) => void\n}\n\n// Context\nconst TimelineContext = createContext(\n undefined\n)\n\nconst useTimeline = () => {\n const context = useContext(TimelineContext)\n if (!context) {\n throw new Error(\"useTimeline must be used within a Timeline\")\n }\n return context\n}\n\n// Components\ninterface TimelineProps extends HTMLAttributes {\n defaultValue?: number\n value?: number\n onValueChange?: (value: number) => void\n orientation?: \"horizontal\" | \"vertical\"\n}\n\nfunction Timeline({\n defaultValue = 1,\n value,\n onValueChange,\n orientation = \"vertical\",\n className,\n children,\n ...props\n}: TimelineProps) {\n const [activeStep, setInternalStep] = useState(defaultValue)\n\n const setActiveStep = useCallback(\n (step: number) => {\n if (value === undefined) {\n setInternalStep(step)\n }\n onValueChange?.(step)\n },\n [value, onValueChange]\n )\n\n const currentStep = value ?? activeStep\n\n return (\n \n \n {children}\n \n \n )\n}\n\n// TimelineContent\nfunction TimelineContent({\n className,\n ...props\n}: HTMLAttributes) {\n return (\n \n )\n}\n\n// TimelineDate\n// TimeHTMLAttributes (not the generic HTMLAttributes) so the