{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "progress-dots", "title": "Progress Dots", "description": "A short run of marks with an emphasized terminal. Dots, rings, steps and numbered variants.", "dependencies": [ "class-variance-authority" ], "registryDependencies": [ "http://localhost:5173/r/liquid-theme.json" ], "files": [ { "path": "src/components/ui/progress-dots.tsx", "content": "import * as React from \"react\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"@/lib/utils\"\n\nconst dots = cva(\"inline-flex items-center\", {\n variants: {\n tone: {\n ink: \"text-ink dark:text-white\",\n current: \"text-current\",\n volt: \"text-volt\",\n flare: \"text-flare\",\n chalk: \"text-white\",\n },\n gap: { tight: \"gap-1\", normal: \"gap-1.5\", loose: \"gap-2.5\" },\n },\n defaultVariants: { tone: \"current\", gap: \"normal\" },\n})\n\nexport interface ProgressDotsProps\n extends React.ComponentProps<\"div\">,\n VariantProps {\n /** How many marks in the run. */\n total?: number\n /** How many are filled, counting from the left. */\n value?: number\n /**\n * `dots` is the Credit Card Use track — small filled marks with an\n * oversized terminal. `rings` is the Derogatory Marks row: hollow circles\n * that grow toward the end. `steps` adds a connecting rail. `numbered` is\n * the day-counter from the retreat hero: translucent discs carrying their\n * own index, with an open arc around the current one.\n */\n variant?: \"dots\" | \"rings\" | \"steps\" | \"numbered\"\n /** Enlarges the final mark, as both reference tiles do. */\n emphasizeLast?: boolean\n /** The base mark unit. `numbered` marks are 4× this, to fit a numeral. */\n size?: number\n /**\n * Pulls `numbered` discs into each other, in px. Overlapping them is what\n * makes six steps read as one run rather than six buttons.\n */\n overlap?: number\n label?: string\n}\n\nexport function ProgressDots({\n total = 5,\n value = 1,\n variant = \"dots\",\n emphasizeLast = true,\n size = 8,\n overlap = 6,\n tone,\n gap,\n label,\n className,\n ...props\n}: ProgressDotsProps) {\n const marks = Array.from({ length: total })\n\n if (variant === \"numbered\") {\n const d = size * 4\n return (\n \n {marks.map((_, i) => {\n const done = i < value\n const current = i === value - 1\n return (\n \n {/* A wash rather than a fill: the discs sit over photography in\n the reference and you can see the ground through them. */}\n \n {current ? (\n \n \n \n ) : null}\n \n {i + 1}\n \n \n )\n })}\n \n )\n }\n\n return (\n \n {variant === \"steps\" ? (\n \n ) : null}\n {marks.map((_, i) => {\n const last = i === total - 1\n const on = i < value\n const d = last && emphasizeLast ? size * 1.9 : size\n return (\n \n )\n })}\n \n )\n}\n", "type": "registry:ui" } ], "type": "registry:ui" }