{"name":"file-cabinet","entry":"component","title":"FileCabinet","description":"SVG cabinet enclosure around a controlled filing drawer whose folders slide out and lift.","category":"UI Bits","capabilities":["controls"],"needsRemotion":false,"registryDependencies":["@jbm/tokens","@jbm/cajon","@jbm/scene-geometry"],"install":"npx shadcn@latest add @jbm/file-cabinet","installName":"file-cabinet","page":"https://jbm-ui.bns.studio/c/file-cabinet","registryItem":"https://jbm-ui.bns.studio/r/file-cabinet.json","sourcePath":"registry/jbm/ui/file-cabinet.tsx","files":[{"source":"registry/jbm/ui/file-cabinet.tsx","target":"src/jbm/ui/file-cabinet.tsx","import":"@/jbm/ui/file-cabinet","type":"registry:component"}],"endpoints":{"markdown":"https://jbm-ui.bns.studio/catalog/file-cabinet.md","json":"https://jbm-ui.bns.studio/catalog/file-cabinet.json"},"snippet":"import { FileCabinet } from \"@/jbm/ui/file-cabinet\"\n\n<svg viewBox=\"0 -260 500 650\">\n  <FileCabinet x={80} folders={[{ name: \"datos\" }]} open={1} />\n</svg>","api":[{"export":"FileCabinet","kind":"component","summary":"An SVG <g> for use inside your own <svg>: a fixed card enclosure with a chamfered top, and a Cajon drawer inset 10px at the sides and 32px from the top. `open` and per-folder `pulled` are controlled 0–1; the enclosure never moves or resizes.","props":[{"name":"x","type":"number","required":false,"default":null,"description":"Left edge of the enclosure in the parent SVG's units."},{"name":"y","type":"number","required":false,"default":null,"description":"Top edge of the enclosure."},{"name":"w","type":"number","required":false,"default":null,"description":"Enclosure width; the drawer is w − 20."},{"name":"h","type":"number","required":false,"default":null,"description":"Enclosure height; the drawer is h − 44."},{"name":"folders","type":"readonly DrawerFolder[]","required":true,"default":null,"description":"Folders in the drawer, index 0 nearest the front. Each is a Cajon DrawerFolder: `name` (tab label, drawn whole; long names compress), optional `accent` fill, `pulled` 0–1 lift, light `k`, flap `open`, name `reveal`, and `sublabel`. Count never changes the drawer size; the folders pack within the same 48-unit rise."},{"name":"open","type":"number","required":false,"default":null,"description":"Drawer opening from 0 (closed) to 1 (open). Clamped."},{"name":"depthSpacing","type":"number","required":false,"default":null,"description":"Rise between folders. Defaults to the packed 48 / max(5, n − 1), so the drawer stays under the enclosure top; pass a larger value to fan the tabs (they then rise above the cabinet)."},{"name":"tabLayout","type":"\"stair\" | \"stagger3\"","required":false,"default":null,"description":"Tab placement; defaults to \"stagger3\" (left, center, right) in a cabinet so packed tabs stay readable. \"stair\" puts every tab at the left edge."},{"name":"labelSize","type":"number","required":false,"default":null,"description":"Tab name size in SVG units (default 13)."}],"passthrough":["Partial<Box>"]},{"export":"FileCabinetBody","kind":"component","summary":"The enclosure alone, so composites (such as Escritorio) can draw foreground furniture between it and the moving drawer.","props":[{"name":"x","type":"number","required":true,"default":null,"description":"Left edge in the parent SVG's units."},{"name":"y","type":"number","required":true,"default":null,"description":"Top edge."},{"name":"w","type":"number","required":true,"default":null,"description":"Width."},{"name":"h","type":"number","required":true,"default":null,"description":"Height."}],"passthrough":[]},{"export":"fileCabinetLayout","kind":"function","summary":"Computes the enclosure box and the drawer props FileCabinet renders, for composites that draw the parts separately.","params":[{"name":"x","type":"number","required":false,"default":"0","description":"Left edge of the enclosure."},{"name":"y","type":"number","required":false,"default":"0","description":"Top edge of the enclosure."},{"name":"w","type":"number","required":false,"default":"300","description":"Enclosure width."},{"name":"h","type":"number","required":false,"default":"360","description":"Enclosure height."},{"name":"folders","type":"readonly DrawerFolder[]","required":true,"default":null,"description":"Drawer folders, passed through to the drawer."},{"name":"open","type":"number","required":false,"default":null,"description":"Drawer opening 0–1, passed through to the drawer."},{"name":"depthSpacing","type":"number","required":false,"default":null,"description":"Rise, in parent SVG units, from one folder to the next one back. Defaults to tab height plus a band of back panel (the tab and band stay visible up to six folders; more folders pack into the same rise, so the stack never grows past six folders' height)."},{"name":"tabLayout","type":"\"stair\" | \"stagger3\"","required":false,"default":null,"description":"stair: every tab at its folder's left edge, so the tabs climb as folders narrow toward the back. stagger3: tabs cycle left, center, right."},{"name":"labelSize","type":"number","required":false,"default":null,"description":"Tab name size in parent SVG units; the tab height and sublabel size follow it."}],"returns":"`{ body: Box, drawer: CajonProps }`: the enclosure box and the inset drawer props (x + 10, y + 32, w − 20, h − 44)."}],"stage":{"mode":"declared","landscape":{"width":300,"height":360},"vertical":{"width":300,"height":360},"basis":"Default w 300 by h 360 in the parent SVG's units, placed at x, y. The drawer stays inside the enclosure at every opening, but lifted folders rise above the top by up to about their height plus 24 (roughly 190 units at the default width), so the parent viewBox needs headroom: the gallery uses \"0 -260 500 700\"."},"examples":[{"title":"Open cabinet with one folder","code":"import { FileCabinet } from \"@/jbm/ui/file-cabinet\"\n\n<svg viewBox=\"0 -260 500 650\">\n  <FileCabinet x={80} folders={[{ name: \"datos\" }]} open={1} />\n</svg>"},{"title":"Lift the front folder","code":"import { FileCabinet } from \"@/jbm/ui/file-cabinet\"\n\n<svg viewBox=\"0 -260 500 700\">\n  <FileCabinet x={85} y={-20} w={330} h={350} open={0.8}\n    folders={[{ name: \"análisis\", accent: true, pulled: 0.6 }, { name: \"diseño\" }]} />\n</svg>"}],"qa":["Drag Open through 0, 0.5, and 1: the enclosure never moves or resizes and only the drawer travels toward the viewer.","Try folder counts 0, 1, 3, 6, and 12: the drawer size is unchanged and extra folders pack toward the back.","Drag Lift front folder to 1: the folder body is complete behind the drawer front, keeps its size, and stays within the viewBox headroom.","Check the preview at narrow widths; the SVG scales with its viewBox."],"related":[{"name":"tokens","relation":"installs"},{"name":"cajon","relation":"installs"},{"name":"scene-geometry","relation":"installs"},{"name":"escritorio","relation":"installed-by"}],"family":"Folders & drawers","docs":[{"title":"Desk illustrations guide","url":"https://jbm-ui.bns.studio/docs/desk-components.md"}],"setup":{"namespace":"@jbm","componentsJson":{"registries":{"@jbm":"https://jbm-ui.bns.studio/r/{name}.json"}},"command":"npx shadcn@latest add @jbm/<name>","target":"src/jbm/","importAlias":"@/jbm/…","tsconfigPaths":{"@/*":["./src/*"]}},"rules":["Install through the @jbm namespace: each registry item JSON (/r/<name>.json) carries its files' contents and each guide is served at /docs/<slug>.md, so agents never need the source repository (it is public on GitHub for people browsing the code).","Files install to src/jbm/ and import as @/jbm/…, which needs the @/* → ./src/* path alias in tsconfig.json.","Items marked needsRemotion require the remotion package and must render inside a Remotion composition or Player; every other item works in any React page.","Use one vermilion accent per composition; accent2 is for annotations only and soft is for dark surfaces only.","Stages are 1920×1080 landscape and 1080×1920 vertical with declared safe areas; each item's stage field declares its size in stage pixels, and scenes compose from YAML-shaped specs with @jbm/scene-spec."],"links":{"catalog":"https://jbm-ui.bns.studio/catalog.json","llms":"https://jbm-ui.bns.studio/llms.txt"}}