{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "shell",
  "title": "Shell",
  "author": "zyx1121 (https://github.com/zyx1121)",
  "description": "Pieces of a shell session: a command after a muted prompt, a blinking block cursor and the requested path for a 404.",
  "registryDependencies": [
    "https://ui.zyx.tw/r/utils.json"
  ],
  "files": [
    {
      "path": "registry/zyx/components/shell.tsx",
      "content": "\"use client\"\n\nimport { useSyncExternalStore } from \"react\"\n\nimport { cn } from \"../lib/utils\"\n\nconst noop = () => () => {}\n\n/** A shell command: a muted prompt, then the command. */\nexport function Command({\n  children,\n  className,\n}: {\n  children: React.ReactNode\n  className?: string\n}) {\n  return (\n    <p className={cn(\"text-muted-foreground\", className)}>\n      <span aria-hidden=\"true\">$ </span>\n      {children}\n    </p>\n  )\n}\n\n/**\n * The path the visitor asked for, for a 404. The 404 is prerendered once for\n * every path, so the server renders nothing and the client fills it in.\n */\nexport function RequestedPath() {\n  const path = useSyncExternalStore(\n    noop,\n    () => decodeURI(window.location.pathname),\n    () => \"\"\n  )\n  return <>{path}</>\n}\n\n/**\n * A block cursor that blinks, as at an idle prompt: on for half a second, off\n * for half, with no fade. It stays on under reduced motion.\n */\nexport function Cursor() {\n  return (\n    <span aria-hidden=\"true\" className=\"motion-safe:animate-cursor\">\n      {\"█\"}\n    </span>\n  )\n}\n",
      "type": "registry:component"
    }
  ],
  "cssVars": {
    "theme": {
      "animate-cursor": "terminal-cursor 1s step-end infinite"
    }
  },
  "css": {
    "@keyframes terminal-cursor": {
      "50%": {
        "opacity": "0"
      }
    }
  },
  "meta": {
    "useWhen": "Showing a command, a prompt cursor or a missing path, as a 404 or idle state.",
    "notFor": "Real terminal emulation or long logs.",
    "related": [
      "status-page",
      "empty-state"
    ]
  },
  "docs": "Use when: Showing a command, a prompt cursor or a missing path, as a 404 or idle state.\nNot for: Real terminal emulation or long logs.\nGuide: https://ui.zyx.tw/shell.md",
  "categories": [
    "layout",
    "terminal"
  ],
  "type": "registry:component"
}