{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "kinetic-step-indicator",
  "type": "registry:ui",
  "title": "Kinetic Step Indicator",
  "author": "Rishabh Bose <https://theb0se.vercel.app/>",
  "description": "Multi-step workflow progress bar with spring-filled liquid connector tubes, elastic checkmark badges, and direct step jumping.",
  "dependencies": [
    "framer-motion",
    "lucide-react",
    "clsx",
    "tailwind-merge"
  ],
  "files": [
    {
      "path": "components/ui/kinetic-step-indicator.tsx",
      "content": "\"use client\";\n\nimport React, { useState } from \"react\";\nimport { motion, useReducedMotion } from \"framer-motion\";\nimport { Check } from \"lucide-react\";\nimport { cn } from \"@/lib/utils\";\n\nexport interface StepSpec {\n  id: string;\n  label: string;\n  caption: string;\n}\n\nexport interface KineticStepIndicatorProps {\n  /** Array of workflow steps. */\n  steps?: StepSpec[];\n  /** Initial active 0-based step index. Default: 1 */\n  defaultStep?: number;\n  /** Spring stiffness coefficient for connector liquid fill. Default: 320 */\n  stiffness?: number;\n  /** Spring damping coefficient for connector liquid fill. Default: 25 */\n  damping?: number;\n  className?: string;\n}\n\nconst DEFAULT_STEPS: StepSpec[] = [\n  { id: \"scaffold\", label: \"Scaffold\", caption: \"Two-file .tsx + .meta.ts\" },\n  { id: \"physics\", label: \"Spring Solver\", caption: \"Hooke's Law tuning\" },\n  { id: \"registry\", label: \"Sync CLI\", caption: \"Shadcn v2 JSON\" },\n  { id: \"ship\", label: \"Verify\", caption: \"100/100 SEO audit\" },\n];\n\nexport function KineticStepIndicator({\n  steps = DEFAULT_STEPS,\n  defaultStep = 1,\n  stiffness = 320,\n  damping = 25,\n  className,\n}: KineticStepIndicatorProps) {\n  const shouldReduceMotion = useReducedMotion() ?? false;\n  const [currentStep, setCurrentStep] = useState<number>(defaultStep);\n\n  return (\n    <div\n      role=\"group\"\n      aria-label=\"Workflow progress steps\"\n      className={cn(\n        \"w-full max-w-md rounded-2xl border border-neutral-200 bg-white p-5 dark:border-[#222222] dark:bg-[#0A0A0A]\",\n        className\n      )}\n    >\n      {/* Nodes & Liquid Connector Tubes */}\n      <div className=\"flex items-center justify-between\">\n        {steps.map((step, idx) => {\n          const isCompleted = idx < currentStep;\n          const isCurrent = idx === currentStep;\n\n          return (\n            <React.Fragment key={step.id}>\n              <motion.button\n                type=\"button\"\n                aria-current={isCurrent ? \"step\" : undefined}\n                aria-label={`Step ${idx + 1}: ${step.label} — ${step.caption}`}\n                onClick={() => setCurrentStep(idx)}\n                animate={{\n                  scale: isCurrent && !shouldReduceMotion ? 1.12 : 1,\n                }}\n                transition={{ type: \"spring\", stiffness, damping }}\n                className={cn(\n                  \"relative z-10 flex h-9 w-9 shrink-0 items-center justify-center rounded-full border font-mono text-xs font-bold transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-black dark:focus-visible:ring-white\",\n                  isCompleted || isCurrent\n                    ? \"border-black bg-black text-white dark:border-white dark:bg-white dark:text-black\"\n                    : \"border-neutral-200 bg-neutral-50 text-neutral-400 hover:border-neutral-400 dark:border-[#262626] dark:bg-[#141414]\"\n                )}\n              >\n                {isCompleted ? <Check className=\"h-4 w-4\" /> : idx + 1}\n              </motion.button>\n\n              {idx < steps.length - 1 && (\n                <div className=\"relative mx-2 h-1 flex-1 overflow-hidden rounded-full bg-neutral-200 dark:bg-[#1F1F1F]\">\n                  <motion.div\n                    initial={false}\n                    animate={{\n                      scaleX: idx < currentStep ? 1 : 0,\n                    }}\n                    transition={\n                      shouldReduceMotion\n                        ? { duration: 0 }\n                        : { type: \"spring\", stiffness, damping }\n                    }\n                    className=\"h-full w-full origin-left bg-black dark:bg-white\"\n                  />\n                </div>\n              )}\n            </React.Fragment>\n          );\n        })}\n      </div>\n\n      {/* Active Step Telemetry Readout */}\n      <div className=\"mt-4 flex items-center justify-between border-t border-neutral-100 pt-3 text-xs dark:border-[#1B1B1B]\">\n        <div>\n          <span className=\"font-semibold text-black dark:text-white\">\n            {steps[currentStep]?.label}\n          </span>\n          <span className=\"ml-2 text-neutral-500 dark:text-neutral-400\">\n            {steps[currentStep]?.caption}\n          </span>\n        </div>\n\n        <div className=\"flex items-center gap-1.5\">\n          <button\n            type=\"button\"\n            disabled={currentStep === 0}\n            onClick={() => setCurrentStep((s) => Math.max(0, s - 1))}\n            className=\"rounded-lg border border-neutral-200 px-2 py-1 text-[11px] font-semibold text-black disabled:opacity-30 dark:border-[#262626] dark:text-white\"\n          >\n            Prev\n          </button>\n          <button\n            type=\"button\"\n            disabled={currentStep === steps.length - 1}\n            onClick={() =>\n              setCurrentStep((s) => Math.min(steps.length - 1, s + 1))\n            }\n            className=\"rounded-lg bg-black px-2.5 py-1 text-[11px] font-semibold text-white disabled:opacity-30 dark:bg-white dark:text-black\"\n          >\n            Next\n          </button>\n        </div>\n      </div>\n    </div>\n  );\n}\n\nexport default KineticStepIndicator;\n",
      "type": "registry:ui",
      "target": "components/ui/kinetic-step-indicator.tsx"
    },
    {
      "path": "lib/utils.ts",
      "content": "import { type ClassValue, clsx } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n  return twMerge(clsx(inputs));\n}\n\nexport async function copyToClipboard(text: string): Promise<boolean> {\n  if (typeof window === \"undefined\") return false;\n\n  try {\n    if (navigator.clipboard && window.isSecureContext) {\n      await navigator.clipboard.writeText(text);\n      return true;\n    }\n\n    const textArea = document.createElement(\"textarea\");\n    textArea.value = text;\n    textArea.style.position = \"fixed\";\n    textArea.style.left = \"-999999px\";\n    textArea.style.top = \"-999999px\";\n    document.body.appendChild(textArea);\n    textArea.focus();\n    textArea.select();\n    const succeeded = document.execCommand(\"copy\");\n    textArea.remove();\n    return succeeded;\n  } catch {\n    return false;\n  }\n}\n",
      "type": "registry:lib",
      "target": "lib/utils.ts"
    }
  ]
}
