{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "zeno-progress-deploy-demo",
  "type": "registry:block",
  "title": "Zeno Progress: Deploy Log",
  "description": "Loading Progress Bar example, Deploy Log: A deploy streams its build log under a bar in the header, labelled with the current phase. Waiting for the health check hangs for seconds with nothing new in the log, and the ruler zooms the whole time until the 200 lands. A take on the progress bar (loading bar). Fits features and app UI sections.",
  "author": "KeyframeUI <https://keyframeui.com>",
  "categories": [
    "features",
    "app-ui",
    "progress-bar",
    "preloader",
    "ai-thinking-state",
    "progress",
    "loading",
    "ai",
    "canvas"
  ],
  "docs": "Live preview, examples and props: https://keyframeui.com/components/zeno-progress#zeno-progress-deploy-demo",
  "registryDependencies": [
    "https://keyframeui.com/r/zeno-progress.json"
  ],
  "files": [
    {
      "path": "components/zeno-progress-deploy-demo.tsx",
      "type": "registry:component",
      "content": "\"use client\";\n\nimport * as React from \"react\";\nimport { AnimatePresence, motion, useInView } from \"motion/react\";\n\nimport { ZenoProgress } from \"@/components/ui/zeno-progress\";\n\ntype Line = { at: number; text: string; phase: string; tone?: \"dim\" | \"ok\" | \"wait\" };\n\n// ms from the start of the run. The health check hangs on purpose: nothing\n// arrives for seconds, and the bar's ruler zooms the whole time.\nconst script: Line[] = [\n  { at: 300, text: \"Cloning acme/storefront@8f3c2a1\", phase: \"Cloning\" },\n  { at: 900, text: \"Restored build cache (412 MB)\", phase: \"Cloning\", tone: \"dim\" },\n  { at: 1500, text: \"$ npm ci\", phase: \"Installing\" },\n  { at: 2300, text: \"added 1284 packages in 2.7s\", phase: \"Installing\", tone: \"dim\" },\n  { at: 2900, text: \"$ next build\", phase: \"Building\" },\n  { at: 3700, text: \"✓ Compiled successfully in 2.9s\", phase: \"Building\", tone: \"ok\" },\n  { at: 4300, text: \"✓ Generating static pages (42/42)\", phase: \"Building\", tone: \"ok\" },\n  { at: 4900, text: \"Uploading build output (18.4 MB)\", phase: \"Uploading\" },\n  { at: 5600, text: \"Starting 3 instances in iad1\", phase: \"Starting\" },\n  { at: 6200, text: \"Waiting for health check…\", phase: \"Waiting for health check\", tone: \"wait\" },\n  { at: 13800, text: \"✓ GET /api/health 200 in 41ms\", phase: \"Waiting for health check\", tone: \"ok\" },\n];\nconst DONE_AT = 14300;\n\nconst toneClass = {\n  dim: \"text-zinc-500\",\n  ok: \"text-emerald-400\",\n  wait: \"text-amber-300\",\n} as const;\n\nexport function ZenoProgressDeployDemo() {\n  const ref = React.useRef<HTMLDivElement>(null);\n  const inView = useInView(ref, { once: true, amount: 0.4 });\n  const [run, setRun] = React.useState(0);\n  const [elapsed, setElapsed] = React.useState(0);\n\n  React.useEffect(() => {\n    if (!inView) return;\n    const start = performance.now();\n    const timer = window.setInterval(() => {\n      const t = performance.now() - start;\n      setElapsed(Math.min(t, DONE_AT));\n      if (t >= DONE_AT) window.clearInterval(timer);\n    }, 100);\n    return () => window.clearInterval(timer);\n  }, [inView, run]);\n\n  const lines = script.filter((line) => line.at <= elapsed);\n  const done = elapsed >= DONE_AT;\n  const phase = lines.at(-1)?.phase ?? \"Queued\";\n\n  const redeploy = () => {\n    setElapsed(0);\n    setRun((r) => r + 1);\n  };\n\n  return (\n    <div\n      ref={ref}\n      className=\"w-full max-w-xl overflow-hidden rounded-2xl border border-zinc-800 bg-zinc-950 font-mono text-[13px] text-zinc-300 shadow-sm\"\n    >\n      <div className=\"border-b border-zinc-800/80 px-4 pt-3.5 pb-3\">\n        <div className=\"mb-3 flex items-center justify-between gap-3 font-sans\">\n          <div className=\"flex min-w-0 items-center gap-2\">\n            <span className=\"size-2 shrink-0 rounded-full bg-emerald-400/90\" aria-hidden />\n            <span className=\"truncate text-sm font-medium text-zinc-100\">storefront</span>\n            <span className=\"shrink-0 rounded-full border border-zinc-800 px-2 py-0.5 text-xs text-zinc-400\">\n              production\n            </span>\n          </div>\n          <button\n            type=\"button\"\n            onClick={redeploy}\n            disabled={!done}\n            className=\"shrink-0 rounded-full border border-zinc-700 px-3 py-1 text-xs font-medium text-zinc-200 transition-[opacity,transform] hover:bg-zinc-900 active:scale-[0.97] disabled:opacity-40\"\n          >\n            Redeploy\n          </button>\n        </div>\n        <ZenoProgress\n          key={inView ? \"live\" : \"idle\"}\n          done={done}\n          label={phase}\n          doneLabel=\"Deployed to storefront.acme.app\"\n          interval={1500}\n          className=\"font-sans text-zinc-400\"\n          barClassName=\"text-zinc-100\"\n        />\n      </div>\n\n      <div className=\"flex h-64 flex-col justify-end overflow-hidden px-4 py-3 leading-6\">\n        <AnimatePresence initial={false}>\n          {lines.map((line) => (\n            <motion.div\n              key={`${run}-${line.at}`}\n              layout=\"position\"\n              initial={{ opacity: 0, y: 6 }}\n              animate={{ opacity: 1, y: 0 }}\n              transition={{ type: \"spring\", visualDuration: 0.3, bounce: 0 }}\n              className={`truncate ${line.tone ? toneClass[line.tone] : \"\"}`}\n            >\n              {line.text}\n            </motion.div>\n          ))}\n          {done ? (\n            <motion.div\n              key={`${run}-done`}\n              layout=\"position\"\n              initial={{ opacity: 0, y: 6 }}\n              animate={{ opacity: 1, y: 0 }}\n              transition={{ type: \"spring\", visualDuration: 0.3, bounce: 0 }}\n              className=\"truncate text-zinc-100\"\n            >\n              ▲ Deployed in 14.3s\n            </motion.div>\n          ) : null}\n        </AnimatePresence>\n      </div>\n    </div>\n  );\n}\n"
    }
  ]
}