{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "escritorio",
  "title": "Escritorio",
  "description": "An empty desk with separate finish and optional file cabinet.",
  "registryDependencies": [
    "@jbm/tokens",
    "@jbm/scene-geometry",
    "@jbm/cajon",
    "@jbm/file-cabinet"
  ],
  "files": [
    {
      "path": "registry/jbm/motion/escritorio.tsx",
      "content": "import { color } from \"../lib/tokens\"\nimport { type Box } from \"../lib/geometry\"\nimport { Cajon, type DrawerFolder, cajonLayout } from \"./cajon\"\nimport { FileCabinetBody, fileCabinetLayout } from \"../ui/file-cabinet\"\n\nexport type DeskSpec = {\n  finish?: \"paper\" | \"wood\"\n  drawerSide?: \"start\" | \"end\"\n}\nexport type EscritorioProps = {\n  box: Box\n  spec?: DeskSpec\n  cabinet?: boolean\n  folders?: readonly DrawerFolder[]\n  open?: number\n}\nexport function escritorioLayout({\n  box,\n  spec = {},\n  folders = [],\n  open = 0,\n}: EscritorioProps) {\n  const top = box.y + 20\n  // Legs, apron and cabinet share a front plane and a floor line.\n  const legWidth = 18\n  const legInset = 24\n  const clearance = 12\n  const innerLeft = box.x + legInset + legWidth\n  const innerRight = box.x + box.w - legInset - legWidth\n  const floor = box.y + box.h\n  const cabinetTop = top + 47 + clearance\n  const cabinetWidth = Math.min(250, innerRight - innerLeft - 2 * clearance)\n  const cabinet = {\n    x:\n      spec.drawerSide === \"end\"\n        ? innerRight - clearance - cabinetWidth\n        : innerLeft + clearance,\n    y: cabinetTop,\n    w: cabinetWidth,\n    h: floor - cabinetTop,\n    folders,\n    open,\n  }\n  const { drawer } = fileCabinetLayout(cabinet)\n  return {\n    box,\n    top,\n    cabinet,\n    drawer,\n    plane: { innerLeft, innerRight, floor, apronBottom: top + 47 },\n    anchors: { folders: cajonLayout(drawer).folders.map((f) => f.anchor) },\n  }\n}\nexport { escritorioLayout as layout }\n/** Empty desktop, with an optional independently reusable file cabinet. */\nexport function Escritorio(props: EscritorioProps) {\n  const l = escritorioLayout(props),\n    { x, y, w, h } = l.box\n  const wood = props.spec?.finish === \"wood\"\n  return (\n    <g role=\"img\" aria-label={`${wood ? \"Wood\" : \"Paper\"} desk`}>\n      {props.cabinet && (\n        <g role=\"img\" aria-label=\"File cabinet\">\n          <FileCabinetBody {...l.cabinet} />\n        </g>\n      )}\n      <g\n        fill={wood ? color.bg : color.card}\n        stroke={color.ink}\n        strokeWidth={2}\n        strokeLinejoin=\"round\"\n      >\n        <path\n          d={`M${x + 24} ${l.top + 20}V${y + h}h18V${l.top + 20}ZM${x + w - 42} ${l.top + 20}V${y + h}h18V${l.top + 20}Z`}\n        />\n        <rect x={x + 42} y={l.top + 22} width={w - 84} height={25} />\n        <path\n          d={`M${x + 18} ${l.top - 18}H${x + w - 18}L${x + w} ${l.top + 5}H${x}ZM${x} ${l.top + 5}H${x + w}v17H${x}Z`}\n        />\n        {wood && (\n          <path\n            d={`M${x + 35} ${l.top - 7}q90 -5 180 0t180 0M${x + 20} ${l.top + 13}h${w - 40}`}\n            fill=\"none\"\n            strokeWidth={1}\n          />\n        )}\n      </g>\n      {props.cabinet && <Cajon {...l.drawer} />}\n    </g>\n  )\n}\n",
      "type": "registry:component",
      "target": "src/jbm/motion/escritorio.tsx"
    }
  ],
  "type": "registry:component"
}