{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "vertical-progress-steps",
  "title": "Vertical Progress Steps",
  "description": "A live status tracker for multi-step processes like deploys, imports and order tracking: each step is done, running, waiting or failed, the connector fills as steps finish, the running step spins and shows its log lines, and screen readers hear every change.",
  "dependencies": [
    "motion",
    "clsx",
    "tailwind-merge"
  ],
  "files": [
    {
      "path": "registry/new-york/vertical-progress-steps/vertical-progress-steps.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\nimport { motion, AnimatePresence, useReducedMotion } from \"motion/react\";\nimport { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nfunction cn(...inputs: ClassValue[]) {\n  return twMerge(clsx(inputs));\n}\n\nexport type StepStatus = \"done\" | \"active\" | \"pending\" | \"error\";\n\nexport interface ProgressStep {\n  id: string;\n  title: string;\n  /** A second line: what the step does, or what went wrong. */\n  description?: string;\n  status: StepStatus;\n  /** Shown on the right, e.g. \"12s\" or \"10:42\". */\n  meta?: string;\n  /** Extra detail (log lines, a link, a retry button) shown under the active or failed step. */\n  detail?: React.ReactNode;\n}\n\nexport interface VerticalProgressStepsProps {\n  steps: ProgressStep[];\n  size?: \"sm\" | \"md\";\n  /** Colour of finished steps and the filled connector. */\n  accentColor?: string;\n  label?: string;\n  theme?: \"dark\" | \"light\";\n  className?: string;\n}\n\nconst PALETTES = {\n  dark: { text: \"#F5F4F1\", muted: \"rgba(245,244,241,0.55)\", faint: \"rgba(245,244,241,0.35)\", line: \"rgba(255,255,255,0.12)\", pending: \"rgba(255,255,255,0.18)\", error: \"#FF7A6B\", onAccent: \"#0A0A0A\", bg: \"#0A0A0A\" },\n  light: { text: \"#0A0A0A\", muted: \"rgba(10,10,10,0.55)\", faint: \"rgba(10,10,10,0.38)\", line: \"rgba(10,10,10,0.12)\", pending: \"rgba(10,10,10,0.2)\", error: \"#E5484D\", onAccent: \"#FFFFFF\", bg: \"#FFFFFF\" },\n};\n\nfunction Marker({ status, n, accent, p, px, reduce }: { status: StepStatus; n: number; accent: string; p: (typeof PALETTES)[\"dark\"]; px: number; reduce: boolean }) {\n  return (\n    <span className=\"relative flex shrink-0 items-center justify-center rounded-full\" style={{ width: px, height: px }}>\n      <AnimatePresence initial={false} mode=\"popLayout\">\n        <motion.span\n          key={status}\n          className=\"absolute inset-0 flex items-center justify-center rounded-full\"\n          style={{\n            background: status === \"done\" ? accent : status === \"error\" ? p.error : p.bg,\n            border: `1.5px solid ${status === \"done\" ? accent : status === \"error\" ? p.error : status === \"active\" ? p.text : p.pending}`,\n            color: status === \"done\" ? p.onAccent : status === \"error\" ? \"#FFFFFF\" : p.faint,\n          }}\n          initial={reduce ? false : { scale: 0.4, opacity: 0 }}\n          animate={{ scale: 1, opacity: 1 }}\n          exit={reduce ? undefined : { scale: 0.4, opacity: 0 }}\n          transition={{ type: \"spring\", stiffness: 520, damping: 26 }}\n        >\n          {status === \"done\" && (\n            <svg width={px * 0.5} height={px * 0.5} viewBox=\"0 0 12 12\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\">\n              <motion.path d=\"M2.4 6.3 4.9 8.7 9.6 3.4\" initial={reduce ? false : { pathLength: 0 }} animate={{ pathLength: 1 }} transition={{ duration: 0.3, delay: 0.08 }} />\n            </svg>\n          )}\n          {status === \"error\" && (\n            <svg width={px * 0.45} height={px * 0.45} viewBox=\"0 0 12 12\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" aria-hidden=\"true\">\n              <path d=\"M6 2.5v4.5M6 9.4h.01\" />\n            </svg>\n          )}\n          {status === \"pending\" && <span className=\"text-[11px] font-semibold tabular-nums\">{n}</span>}\n        </motion.span>\n      </AnimatePresence>\n      {/* Active: a spinning arc around the marker and a soft pulse behind it. */}\n      {status === \"active\" && (\n        <>\n          <motion.svg className=\"absolute\" width={px + 8} height={px + 8} viewBox=\"0 0 32 32\" fill=\"none\" aria-hidden=\"true\" animate={reduce ? undefined : { rotate: 360 }} transition={{ duration: 1, repeat: Infinity, ease: \"linear\" }}>\n            <path d=\"M16 2a14 14 0 0 1 14 14\" stroke={p.text} strokeWidth=\"2\" strokeLinecap=\"round\" />\n          </motion.svg>\n          <span className=\"absolute size-1.5 rounded-full\" style={{ background: p.text }} />\n        </>\n      )}\n    </span>\n  );\n}\n\nexport function VerticalProgressSteps({ steps, size = \"md\", accentColor, label = \"Progress\", theme = \"dark\", className }: VerticalProgressStepsProps) {\n  const p = PALETTES[theme];\n  const accent = accentColor ?? p.text;\n  const reduce = Boolean(useReducedMotion());\n  const px = size === \"sm\" ? 22 : 26;\n  const done = steps.filter((s) => s.status === \"done\").length;\n\n  return (\n    <div className={cn(\"flex w-full flex-col\", className)} style={{ fontFamily: \"Inter, sans-serif\" }}>\n      <p className=\"sr-only\" aria-live=\"polite\">\n        {label}: {done} of {steps.length} steps done{steps.find((s) => s.status === \"active\") ? `, ${steps.find((s) => s.status === \"active\")!.title} in progress` : \"\"}\n        {steps.find((s) => s.status === \"error\") ? `, ${steps.find((s) => s.status === \"error\")!.title} failed` : \"\"}\n      </p>\n      <ol className=\"m-0 flex list-none flex-col p-0\" aria-label={label}>\n        {steps.map((s, i) => {\n          const last = i === steps.length - 1;\n          const filled = s.status === \"done\";\n          const current = s.status === \"active\" || s.status === \"error\";\n          return (\n            <li key={s.id} className=\"relative flex\" style={{ gap: 14 }} aria-current={s.status === \"active\" ? \"step\" : undefined}>\n              {/* Connector to the next step: a track that fills once this step is done. */}\n              {!last && (\n                <span aria-hidden=\"true\" className=\"absolute overflow-hidden rounded-full\" style={{ left: px / 2 - 1, top: px + 4, bottom: 4, width: 2, background: p.line }}>\n                  <motion.span className=\"absolute inset-x-0 top-0 block rounded-full\" style={{ background: accent }} initial={false} animate={{ height: filled ? \"100%\" : \"0%\" }} transition={{ duration: reduce ? 0 : 0.45, ease: \"easeInOut\" }} />\n                </span>\n              )}\n              <Marker status={s.status} n={i + 1} accent={accent} p={p} px={px} reduce={reduce} />\n              <div className=\"min-w-0 flex-1\" style={{ paddingBottom: last ? 0 : size === \"sm\" ? 16 : 22 }}>\n                <div className=\"flex items-baseline justify-between\" style={{ gap: 12, minHeight: px, paddingTop: (px - 20) / 2 }}>\n                  <span className=\"truncate text-[14px] font-medium\" style={{ color: s.status === \"pending\" ? p.muted : s.status === \"error\" ? p.error : p.text, transition: \"color 0.2s ease\" }}>\n                    {s.title}\n                  </span>\n                  {s.meta && (\n                    <span className=\"shrink-0 text-[12px] tabular-nums\" style={{ color: p.faint }}>\n                      {s.meta}\n                    </span>\n                  )}\n                </div>\n                {s.description && (\n                  <p className=\"mt-0.5 text-[12.5px] leading-relaxed\" style={{ color: s.status === \"error\" ? p.error : p.faint }}>\n                    {s.description}\n                  </p>\n                )}\n                <AnimatePresence initial={false}>\n                  {current && s.detail && (\n                    <motion.div key=\"detail\" className=\"overflow-hidden\" initial={reduce ? false : { height: 0, opacity: 0 }} animate={{ height: \"auto\", opacity: 1 }} exit={reduce ? undefined : { height: 0, opacity: 0 }} transition={{ duration: 0.25, ease: \"easeOut\" }}>\n                      <div style={{ paddingTop: 10 }}>{s.detail}</div>\n                    </motion.div>\n                  )}\n                </AnimatePresence>\n              </div>\n            </li>\n          );\n        })}\n      </ol>\n    </div>\n  );\n}\n\n// ——— Demo: a deploy pipeline that runs step by step ———\n\nconst PIPELINE = [\n  { id: \"clone\", title: \"Clone repository\", description: \"main @ 4f2a91c\", logs: [\"Cloning github.com/acme/web\", \"Resolved 1,284 objects\"] },\n  { id: \"install\", title: \"Install dependencies\", description: \"pnpm install --frozen-lockfile\", logs: [\"Lockfile is up to date\", \"Packages: +642\", \"Done in 6.2s\"] },\n  { id: \"build\", title: \"Build\", description: \"next build\", logs: [\"Compiling pages…\", \"Generating 38 static pages\", \"Build finished\"] },\n  { id: \"deploy\", title: \"Deploy to edge\", description: \"3 regions\", logs: [\"Uploading 212 files\", \"Propagating to fra1, iad1, sfo1\"] },\n  { id: \"ready\", title: \"Ready\", description: \"acme-web.vercel.app\" },\n];\nconst STEP_MS = 1300;\n\nexport function VerticalProgressStepsDemo({ theme = \"dark\" }: { theme?: \"dark\" | \"light\" }) {\n  // -1: idle. 0..n-1: running that step. n: finished.\n  const [at, setAt] = React.useState(-1);\n  const [logs, setLogs] = React.useState(0);\n  const t = theme === \"dark\" ? { bg: \"#0E0E0E\", border: \"rgba(255,255,255,0.1)\", text: \"#F5F4F1\", muted: \"rgba(245,244,241,0.55)\", btn: \"#F5F4F1\", onBtn: \"#0A0A0A\", log: \"rgba(255,255,255,0.04)\" } : { bg: \"#FFFFFF\", border: \"rgba(10,10,10,0.1)\", text: \"#0A0A0A\", muted: \"rgba(10,10,10,0.55)\", btn: \"#0A0A0A\", onBtn: \"#FFFFFF\", log: \"rgba(10,10,10,0.04)\" };\n\n  // Advance one step (and reveal its log lines) on a timer while running.\n  React.useEffect(() => {\n    if (at < 0 || at >= PIPELINE.length) return;\n    const lines = PIPELINE[at].logs?.length ?? 0;\n    const tick = setInterval(() => setLogs((l) => Math.min(lines, l + 1)), STEP_MS / (lines + 1));\n    const next = setTimeout(() => {\n      setAt((a) => a + 1);\n      setLogs(0);\n    }, STEP_MS);\n    return () => {\n      clearInterval(tick);\n      clearTimeout(next);\n    };\n  }, [at]);\n\n  const running = at >= 0 && at < PIPELINE.length;\n  const steps: ProgressStep[] = PIPELINE.map((s, i) => ({\n    id: s.id,\n    title: s.title,\n    description: s.description,\n    status: at > i || at === PIPELINE.length ? \"done\" : at === i ? \"active\" : \"pending\",\n    meta: at > i ? `${(1.3 + i * 0.4).toFixed(1)}s` : undefined,\n    detail: s.logs ? (\n      <div className=\"flex flex-col font-mono text-[11.5px]\" style={{ gap: 3, padding: \"8px 10px\", borderRadius: 10, background: t.log, color: t.muted }}>\n        {s.logs.slice(0, Math.max(1, logs)).map((l) => (\n          <span key={l}>{l}</span>\n        ))}\n      </div>\n    ) : undefined,\n  }));\n\n  return (\n    <div className=\"flex w-[360px] max-w-full flex-col\" style={{ gap: 18, padding: 22, borderRadius: 18, background: t.bg, border: `1px solid ${t.border}`, fontFamily: \"Inter, sans-serif\" }}>\n      <div className=\"flex items-center justify-between\">\n        <div>\n          <p className=\"text-[15px] font-semibold\" style={{ color: t.text }}>\n            Production deploy\n          </p>\n          <p className=\"mt-0.5 text-[12.5px]\" style={{ color: t.muted }}>\n            {at < 0 ? \"Waiting to start\" : running ? `Step ${at + 1} of ${PIPELINE.length}` : \"Deployed\"}\n          </p>\n        </div>\n        <button\n          type=\"button\"\n          disabled={running}\n          onClick={() => {\n            setAt(0);\n            setLogs(0);\n          }}\n          className=\"h-9 cursor-pointer rounded-xl text-[13px] font-semibold transition-opacity disabled:cursor-not-allowed disabled:opacity-40\"\n          style={{ padding: \"0 16px\", background: t.btn, color: t.onBtn }}\n        >\n          {at >= PIPELINE.length ? \"Run again\" : \"Deploy\"}\n        </button>\n      </div>\n      <VerticalProgressSteps theme={theme} steps={steps} label=\"Production deploy\" />\n    </div>\n  );\n}\n\nexport default VerticalProgressSteps;\n",
      "type": "registry:component"
    }
  ],
  "type": "registry:component"
}