{"name":"piece","entry":"component","title":"Piece","description":"Picks the button, input, or card illustration by kind and sizes it from one width.","category":"UI Bits","capabilities":[],"needsRemotion":false,"registryDependencies":["@jbm/paper","@jbm/ui-button","@jbm/ui-input","@jbm/ui-card"],"install":"npx shadcn@latest add @jbm/piece","installName":"piece","page":"https://jbm-ui.bns.studio/c/piece","registryItem":"https://jbm-ui.bns.studio/r/piece.json","sourcePath":"registry/jbm/ui/piece.tsx","files":[{"source":"registry/jbm/ui/piece.tsx","target":"src/jbm/ui/piece.tsx","import":"@/jbm/ui/piece","type":"registry:ui"}],"endpoints":{"markdown":"https://jbm-ui.bns.studio/catalog/piece.md","json":"https://jbm-ui.bns.studio/catalog/piece.json"},"snippet":"import { Piece } from \"@/jbm/ui/piece\"\n\n<Piece kind=\"button\" w={220} />","api":[{"export":"Piece","kind":"component","summary":"Renders UiButton, UiInput, or UiCard for `kind` at width `w`; height follows each piece's proportion (button and input 0.32 × w, card 0.78 × w). Lets a list of `{ kind }` entries render interface pieces without branching.","props":[{"name":"kind","type":"PieceKind","required":true,"default":null,"description":"Which piece to draw: button, input, or card."},{"name":"w","type":"number","required":true,"default":null,"description":"Width in stage pixels; height is derived from it per kind."},{"name":"tone","type":"PaperTone","required":false,"default":null,"description":"Button tone only (ink by default, accent, or paper); ignored by input and card."},{"name":"cursorOn","type":"boolean","required":false,"default":null,"description":"Input only: shows or hides the text cursor (UiInput default: shown); ignored by button and card."},{"name":"style","type":"React.CSSProperties","required":false,"default":null,"description":"Inline styles forwarded to the chosen piece."}],"passthrough":[]},{"export":"PieceKind","kind":"type","summary":"The piece names: \"button\" | \"input\" | \"card\"."}],"stage":{"mode":"declared","landscape":{"width":220,"height":70},"vertical":{"width":220,"height":70},"basis":"No defaults: `w` is required. At w = 220 a button or input is 220 × 70 (round(0.32 × w)); a card is 220 × 172 (round(0.78 × w))."},"examples":[{"title":"One button","code":"import { Piece } from \"@/jbm/ui/piece\"\n\n<Piece kind=\"button\" w={220} />"},{"title":"A row of every kind","code":"import { Piece, type PieceKind } from \"@/jbm/ui/piece\"\n\nconst kinds: PieceKind[] = [\"button\", \"input\", \"card\"]\n<div style={{ display: \"flex\", gap: 30, alignItems: \"center\" }}>\n  {kinds.map((kind) => <Piece key={kind} kind={kind} w={180} tone=\"accent\" cursorOn={false} />)}\n</div>"}],"qa":["Render all three kinds at the same w and check their heights (0.32, 0.32, 0.78 × w) and baseline alignment in a row.","Pass tone and cursorOn to each kind: tone changes only the button and cursorOn only the input."],"related":[{"name":"paper","relation":"installs"},{"name":"ui-button","relation":"installs"},{"name":"ui-input","relation":"installs"},{"name":"ui-card","relation":"installs"},{"name":"ui-bits","relation":"bundled-in"}],"family":"Interface bits","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"}}