{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "deployment",
  "type": "registry:block",
  "title": "Deployment block",
  "description": "One deploy as a screen: its commit and who started it, the status, the facts and a progress rail, then the changed files in a tree beside the build log with a line to drag, and each file's diff a press away. On a phone the two take turns.",
  "registryDependencies": [
    "https://littmd.vercel.app/r/litt.json",
    "https://littmd.vercel.app/r/avatar.json",
    "https://littmd.vercel.app/r/breadcrumb.json",
    "https://littmd.vercel.app/r/button.json",
    "https://littmd.vercel.app/r/code-block.json",
    "https://littmd.vercel.app/r/framed.json",
    "https://littmd.vercel.app/r/hover-card.json",
    "https://littmd.vercel.app/r/icons.json",
    "https://littmd.vercel.app/r/log-view.json",
    "https://littmd.vercel.app/r/motion.json",
    "https://littmd.vercel.app/r/progress.json",
    "https://littmd.vercel.app/r/resizable.json",
    "https://littmd.vercel.app/r/segmented.json",
    "https://littmd.vercel.app/r/tag.json",
    "https://littmd.vercel.app/r/tree.json"
  ],
  "files": [
    {
      "path": "registry/litt/components/litt-blocks/deployment.tsx",
      "type": "registry:component",
      "content": "\"use client\";\n// @litt/deployment 2026.11.03. What changed: https://littmd.vercel.app/changelog.md\n\n/**\n * Deployment: one deploy as a screen, from the first line of its build to the site going live. A block: a whole\n * screen built from the litt parts, to copy and make your own. Swap the sample deploy, its files and `useBuild` (which\n * plays a script) for your build's stream; the layout stays.\n *\n * Where the deploy sits, then its name and a line in two inks, with who started it behind a hover card. The status in\n * words, the facts in a row, and a progress rail while it builds. Then the work: the files this deploy changed in a\n * tree beside the build log, with a line between them to drag. Pick a file and the right side shows its diff; the log\n * is one press away. On a phone the two take turns behind a segmented control. Visit site is the one accent fill, and\n * it waits until the site is live.\n */\nimport { useEffect, useMemo, useState } from \"react\";\nimport { Avatar } from \"../litt/avatar\";\nimport { Breadcrumb } from \"../litt/breadcrumb\";\nimport { Button } from \"../litt/button\";\nimport { CodeBlock } from \"../litt/code-block\";\nimport { HoverCard, HoverCardContent, HoverCardTrigger } from \"../litt/hover-card\";\nimport { ArrowUpRightIcon, RetryIcon } from \"../litt/icons\";\nimport { LogView, type LogLine } from \"../litt/log-view\";\nimport { Progress } from \"../litt/progress\";\nimport { ResizableHandle, ResizablePanel, ResizablePanelGroup } from \"../litt/resizable\";\nimport { Segmented } from \"../litt/segmented\";\nimport { Tag } from \"../litt/tag\";\nimport { Tree, type TreeNode } from \"../litt/tree\";\nimport { useDevice } from \"../../lib/litt/motion\";\nimport { Heading } from \"../litt/framed\";\n\n/* ----------------------------------------------------------------- data */\n\n/** The deploy. Point the links at your routes. */\nconst DEPLOY = {\n  id: \"8f2ka1c\",\n  project: \"Halo site\",\n  branch: \"main\",\n  commit: \"Swap Inter for Geist in the layout\",\n  domain: \"halo.studio\",\n  trail: [\n    { label: \"Projects\", href: \"/projects\" },\n    { label: \"Halo site\", href: \"/projects/halo\" },\n    { label: \"Deployments\", href: \"/projects/halo/deployments\" },\n    { label: \"8f2ka1c\", href: \"/projects/halo/deployments/8f2ka1c\" },\n  ],\n  author: { name: \"Ines Duarte\", role: \"Design lead, Halo Studio\", href: \"/people/ines\", note: \"Owns the studio site. 312 deploys since March 2024.\" },\n};\n\n/** The files this deploy changed, as a tree. The detail is the change: M for modified, + for added. */\nconst FILES: TreeNode[] = [\n  {\n    id: \"src\",\n    label: \"src\",\n    children: [\n      { id: \"src/app\", label: \"app\", children: [{ id: \"src/app/layout.tsx\", label: \"layout.tsx\", detail: \"M\" }] },\n      { id: \"src/fonts.ts\", label: \"fonts.ts\", detail: \"+\" },\n    ],\n  },\n  { id: \"package.json\", label: \"package.json\", detail: \"M\" },\n];\n\n/** Each changed file's diff. */\nconst DIFFS: Record<string, string> = {\n  \"src/app/layout.tsx\": `@@ -1,6 +1,6 @@\n-import \"@fontsource/inter/400.css\";\n-import \"@fontsource/inter/600.css\";\n+import { sans } from \"../fonts\";\n\n export default function Layout({ children }) {\n-  return <html lang=\"en\"><body>{children}</body></html>;\n+  return <html lang=\"en\" className={sans.className}><body>{children}</body></html>;\n }`,\n  \"src/fonts.ts\": `@@ -0,0 +1,3 @@\n+import { GeistSans } from \"geist/font/sans\";\n+\n+export const sans = GeistSans;`,\n  \"package.json\": `@@ -8,7 +8,7 @@\n   \"dependencies\": {\n-    \"@fontsource/inter\": \"5.2.5\",\n+    \"geist\": \"1.5.1\",\n     \"next\": \"16.3.6\",`,\n};\n\n/** The build's output, in order. useBuild plays it; replace it with your build's stream. */\nconst SCRIPT: LogLine[] = [\n  { text: \"Cloning github.com/halo-studio/site (branch main, commit 8f2ka1c)\" },\n  { text: \"Restored build cache from the last deploy\" },\n  { text: 'Running \"npm ci\"' },\n  { text: \"added 412 packages in 6s\", level: \"debug\" },\n  { text: 'Running \"npm run build\"' },\n  { text: \"▲ Next.js 16.3.6\" },\n  { text: \"Creating an optimized production build ...\" },\n  { text: \"Image /public/og.png is 2.4 MB; it will be served as is.\", level: \"warn\" },\n  { text: \"✓ Compiled successfully in 13.8s\" },\n  { text: \"Generating static pages (12/12)\" },\n  { text: \"Uploading build output: 38 files, 2.1 MB\" },\n  { text: \"Assigning domains: halo.studio, www.halo.studio\" },\n  { text: \"Build completed in 29s. halo.studio is live.\", level: \"success\" },\n];\n\n/* ----------------------------------------------------------------- the run */\n\n/** Plays the script a line at a time, unevenly, as a real build writes. Replace it with your build's stream. */\nfunction useBuild(run: number) {\n  const [lines, setLines] = useState<LogLine[]>([]);\n  useEffect(() => {\n    setLines([]);\n    let i = 0;\n    let at = 0;\n    let timer = 0;\n    const next = () => {\n      const line = SCRIPT[i];\n      if (!line) return;\n      at += 0.8 + (i % 3) * 1.4;\n      setLines((all) => [...all, { ...line, id: i, time: `+${at.toFixed(1)}s` }]);\n      i++;\n      timer = window.setTimeout(next, 260 + (i % 4) * 160);\n    };\n    timer = window.setTimeout(next, 500);\n    return () => window.clearTimeout(timer);\n  }, [run]);\n  return lines;\n}\n\n/* ----------------------------------------------------------------- the screen */\n\nconst link =\n  \"rounded-litt-control text-litt-fg underline decoration-litt-line-strong underline-offset-4 transition-colors duration-(--litt-dur-instant) ease-litt hover:decoration-litt-fg focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-litt-focus\";\n\nexport function Deployment() {\n  const { compact } = useDevice();\n  const [run, setRun] = useState(0);\n  const lines = useBuild(run);\n  const done = lines.length === SCRIPT.length;\n  const [file, setFile] = useState<string | null>(null);\n  const [pane, setPane] = useState<\"log\" | \"diff\" | \"files\">(\"log\");\n\n  const facts = useMemo(\n    () => [\n      { label: \"Branch\", value: DEPLOY.branch, mono: true },\n      { label: \"Commit\", value: DEPLOY.id, mono: true },\n      { label: \"Duration\", value: done ? \"29s\" : \"Building\", mono: false },\n      { label: \"Domain\", value: DEPLOY.domain, mono: false },\n    ],\n    [done],\n  );\n\n  const open = (id: string, node: TreeNode) => {\n    if (node.children) return;\n    setFile(id);\n    setPane(\"diff\");\n  };\n\n  const log = <LogView label=\"Build log\" lines={lines} height=\"fill\" className=\"h-full\" />;\n  const diff = file ? (\n    <CodeBlock code={DIFFS[file] ?? \"\"} lang=\"diff\" filename={file} lineNumbers />\n  ) : (\n    <p className=\"text-litt-small text-litt-fg-subtle\">Pick a file to see what changed.</p>\n  );\n  const tree = <Tree label=\"Changed files\" items={FILES} defaultExpanded={[\"src\", \"src/app\"]} selected={file} onSelect={open} />;\n\n  return (\n    <div className=\"@container grid w-full gap-8\">\n      <header className=\"grid gap-6\">\n        <Breadcrumb label=\"Where this deploy is\" items={DEPLOY.trail} />\n        <div className=\"flex flex-wrap items-start justify-between gap-4\">\n          <div className=\"grid gap-1\">\n            <Heading level={1} className=\"text-litt-h1 text-litt-fg\">{DEPLOY.commit}</Heading>\n            <p className=\"text-litt-body text-litt-fg-muted\">\n              Deploy {DEPLOY.id} of {DEPLOY.project}, started by{\" \"}\n              <HoverCard>\n                <HoverCardTrigger>\n                  <a href={DEPLOY.author.href} className={link}>\n                    {DEPLOY.author.name}\n                  </a>\n                </HoverCardTrigger>\n                <HoverCardContent>\n                  <div className=\"grid gap-3\">\n                    <div className=\"flex items-center gap-3\">\n                      <Avatar name={DEPLOY.author.name} size=\"lg\" decorative />\n                      <div className=\"grid gap-1\">\n                        <p className=\"text-litt-small font-litt-title text-litt-fg\">{DEPLOY.author.name}</p>\n                        <p className=\"text-litt-small text-litt-fg-subtle\">{DEPLOY.author.role}</p>\n                      </div>\n                    </div>\n                    <p className=\"text-litt-small text-litt-fg-muted\">{DEPLOY.author.note}</p>\n                  </div>\n                </HoverCardContent>\n              </HoverCard>\n              .\n            </p>\n          </div>\n          <div className=\"flex items-center gap-3\">\n            <Button size=\"sm\" icon={<RetryIcon />} disabled={!done} onClick={() => setRun((r) => r + 1)}>\n              Redeploy\n            </Button>\n            <Button size=\"sm\" variant=\"primary\" iconRight={<ArrowUpRightIcon />} disabled={!done}>\n              Visit site\n            </Button>\n          </div>\n        </div>\n      </header>\n\n      <dl className=\"grid grid-cols-2 gap-x-8 gap-y-6 border-y border-litt-line py-6 @min-[40rem]:grid-cols-5\">\n        <div className=\"grid content-start gap-1\">\n          <dt className=\"text-litt-caption text-litt-fg-subtle\">Status</dt>\n          <dd>\n            <Tag status={done ? \"success\" : \"warning\"}>{done ? \"Ready\" : \"Building\"}</Tag>\n          </dd>\n        </div>\n        {facts.map((f) => (\n          <div key={f.label} className=\"grid content-start gap-1\">\n            <dt className=\"text-litt-caption text-litt-fg-subtle\">{f.label}</dt>\n            <dd className={f.mono ? \"truncate font-litt-mono text-litt-small font-normal text-litt-fg\" : \"text-litt-small text-litt-fg\"}>{f.value}</dd>\n          </div>\n        ))}\n      </dl>\n\n      <Progress\n        label={done ? \"Built\" : \"Building\"}\n        value={lines.length}\n        max={SCRIPT.length}\n        valueText={`${lines.length} of ${SCRIPT.length} steps`}\n        status={done ? \"done\" : \"active\"}\n        message={done ? `${DEPLOY.domain} is live.` : \"Started a moment ago.\"}\n      />\n\n      {compact ? (\n        <section aria-label=\"Build\" className=\"grid gap-4\">\n          <Segmented\n            legend=\"Show\"\n            size=\"sm\"\n            block\n            value={pane === \"diff\" ? \"files\" : pane}\n            onValueChange={(v) => setPane(v)}\n            options={[\n              { value: \"log\", label: \"Build log\" },\n              { value: \"files\", label: \"Changed files\" },\n            ]}\n          />\n          {pane === \"log\" ? <div className=\"h-96\">{log}</div> : (\n            <div className=\"grid gap-4\">\n              {tree}\n              {file && diff}\n            </div>\n          )}\n        </section>\n      ) : (\n        <section aria-label=\"Build\" className=\"litt-raised h-112 overflow-hidden rounded-litt-surface\">\n          <ResizablePanelGroup direction=\"horizontal\" autoSaveId=\"litt-deployment\" className=\"h-full\">\n            <ResizablePanel defaultSize={28} minSize={20} maxSize={45} className=\"p-2\">\n              <Tree label=\"Changed files\" items={FILES} on=\"surface-1\" defaultExpanded={[\"src\", \"src/app\"]} selected={file} onSelect={open} />\n            </ResizablePanel>\n            <ResizableHandle label=\"Resize the changed files\" />\n            <ResizablePanel minSize={40} className=\"grid grid-rows-[auto_minmax(0,1fr)] gap-3 p-3\">\n              <Segmented\n                legend=\"Show\"\n                size=\"sm\"\n                value={pane === \"files\" ? \"log\" : pane}\n                onValueChange={(v) => setPane(v)}\n                options={[\n                  { value: \"log\", label: \"Build log\" },\n                  { value: \"diff\", label: file ? file.split(\"/\").pop()! : \"Diff\", disabled: !file },\n                ]}\n              />\n              <div className=\"min-h-0 overflow-auto\">{pane === \"diff\" && file ? diff : log}</div>\n            </ResizablePanel>\n          </ResizablePanelGroup>\n        </section>\n      )}\n    </div>\n  );\n}\n",
      "target": "components/litt-blocks/deployment.tsx"
    }
  ],
  "docs": "Import Deployment from components/litt-blocks/deployment and render it inside your app's shell. The deploy, its files and diffs and the build script sit at the top of the file; replace useBuild with your build's stream. See it live at https://littmd.vercel.app/#deployment.",
  "meta": {
    "version": "2026.11.03",
    "released": "2026-11-03",
    "changelog": "https://littmd.vercel.app/changelog.md"
  }
}
