{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "black-box-stack-demo",
  "type": "registry:block",
  "title": "Black Box: Stack",
  "description": "3D Product Explainer Box example, Stack: A backend platform's three parts as a list beside the box. Point at a row and its face opens; leave the list and the box walks it again. A take on the 3D (three dimensional) and flow diagram (flowchart). Fits hero, features and CTA sections.",
  "author": "KeyframeUI <https://keyframeui.com>",
  "categories": [
    "hero",
    "features",
    "cta",
    "3d",
    "flow-diagram",
    "ai",
    "diagram"
  ],
  "docs": "Live preview, examples and props: https://keyframeui.com/components/black-box#black-box-stack-demo",
  "registryDependencies": [
    "https://keyframeui.com/r/black-box.json"
  ],
  "files": [
    {
      "path": "components/black-box-stack-demo.tsx",
      "type": "registry:component",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nimport { cn } from \"@/lib/utils\";\nimport { BlackBox, type BlackBoxFace } from \"@/components/ui/black-box\";\n\n// A backend platform's three parts, as a list that opens the box and a box that walks the list.\nconst LAYERS: (BlackBoxFace & { stat: string })[] = [\n  {\n    id: \"functions\",\n    label: \"Functions\",\n    detail: \"TypeScript or Python, deployed on every push, warm in 38 ms.\",\n    stat: \"38 ms cold start\",\n    icon: (\n      <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth={1.6} strokeLinecap=\"round\" strokeLinejoin=\"round\">\n        <path d=\"M9 7 4 12l5 5M15 7l5 5-5 5\" />\n      </svg>\n    ),\n  },\n  {\n    id: \"queues\",\n    label: \"Queues\",\n    detail: \"Retries, delays and fan-out without a broker to babysit.\",\n    stat: \"1.2M jobs a day\",\n    icon: (\n      <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth={1.6} strokeLinecap=\"round\" strokeLinejoin=\"round\">\n        <path d=\"M4 7h16M4 12h11M4 17h6\" />\n      </svg>\n    ),\n  },\n  {\n    id: \"postgres\",\n    label: \"Postgres\",\n    detail: \"A branch of your database for every preview, merged with the code.\",\n    stat: \"Branch per preview\",\n    icon: (\n      <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth={1.6} strokeLinecap=\"round\" strokeLinejoin=\"round\">\n        <ellipse cx=\"12\" cy=\"6\" rx=\"7\" ry=\"2.5\" />\n        <path d=\"M5 6v6c0 1.4 3.1 2.5 7 2.5s7-1.1 7-2.5V6M5 12v6c0 1.4 3.1 2.5 7 2.5s7-1.1 7-2.5v-6\" />\n      </svg>\n    ),\n  },\n];\n\nexport function BlackBoxStackDemo() {\n  const [value, setValue] = React.useState<string | null>(null);\n  const [holding, setHolding] = React.useState(false);\n  const [picked, setPicked] = React.useState(false);\n\n  return (\n    <div className=\"w-full max-w-4xl @container [--black-box-light:#ff5a1f]\">\n      <div className=\"grid items-center gap-x-10 gap-y-2 @[40rem]:grid-cols-[minmax(0,0.9fr)_minmax(0,1.1fr)]\">\n        <div>\n          <p className=\"text-xs font-medium tracking-[0.08em] text-[#e2470f] uppercase dark:text-[#ff7a45]\">Lattice platform</p>\n          <h3 className=\"mt-3 text-3xl font-semibold tracking-[-0.03em] text-balance text-zinc-950 dark:text-white\">\n            Your whole backend, in one box.\n          </h3>\n          <ol\n            className=\"mt-7 border-t border-zinc-950/10 dark:border-white/10\"\n            onPointerLeave={() => setHolding(false)}\n            onFocus={() => setHolding(true)}\n            onBlur={(event) => {\n              if (!event.currentTarget.contains(event.relatedTarget as Node)) setHolding(false);\n            }}\n          >\n            {LAYERS.map((layer, i) => {\n              const on = value === layer.id;\n              return (\n                <li key={layer.id} className=\"border-b border-zinc-950/10 dark:border-white/10\">\n                  <button\n                    type=\"button\"\n                    aria-pressed={on}\n                    onPointerEnter={(event) => {\n                      if (event.pointerType !== \"mouse\") return;\n                      setHolding(true);\n                      setValue(layer.id);\n                    }}\n                    onFocus={() => setValue(layer.id)}\n                    onClick={() => {\n                      setPicked(true);\n                      setValue(layer.id);\n                    }}\n                    className=\"group relative flex w-full gap-4 py-4 text-left outline-none focus-visible:ring-2 focus-visible:ring-[#ff5a1f] focus-visible:ring-offset-2 focus-visible:ring-offset-white dark:focus-visible:ring-offset-zinc-950\"\n                  >\n                    <span\n                      aria-hidden\n                      className={cn(\n                        \"absolute top-4 bottom-4 -left-px w-0.5 origin-top rounded-full bg-[#ff5a1f] transition-[opacity,transform] duration-200 ease-[cubic-bezier(0.23,1,0.32,1)]\",\n                        on ? \"scale-y-100 opacity-100\" : \"scale-y-50 opacity-0\",\n                      )}\n                    />\n                    <span className=\"pl-4 font-mono text-xs leading-6 text-zinc-400 tabular-nums dark:text-zinc-500\">\n                      0{i + 1}\n                    </span>\n                    <span className=\"min-w-0 flex-1\">\n                      <span className=\"flex items-baseline justify-between gap-3\">\n                        <span\n                          className={cn(\n                            \"text-[15px] leading-6 font-medium tracking-[-0.01em] transition-colors duration-200\",\n                            on ? \"text-zinc-950 dark:text-white\" : \"text-zinc-500 dark:text-zinc-400\",\n                          )}\n                        >\n                          {layer.label}\n                        </span>\n                        <span className=\"shrink-0 font-mono text-[11px] text-zinc-400 tabular-nums dark:text-zinc-500\">\n                          {layer.stat}\n                        </span>\n                      </span>\n                      <span className=\"mt-1 block text-[13px] leading-5 text-pretty text-zinc-500 dark:text-zinc-400\">\n                        {layer.detail}\n                      </span>\n                    </span>\n                  </button>\n                </li>\n              );\n            })}\n          </ol>\n        </div>\n\n        <BlackBox\n          faces={LAYERS}\n          value={value}\n          onValueChange={(id) => setValue(id)}\n          autoplay={!holding && !picked}\n          labels={false}\n          aria-label=\"Lattice's three parts\"\n        />\n      </div>\n    </div>\n  );\n}\n"
    }
  ]
}