{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "wall-builder",
  "type": "registry:ui",
  "title": "Wall builder",
  "description": "Layable brick wall with counter.",
  "dependencies": [],
  "registryDependencies": [
    "bricked-css",
    "pixel-icon"
  ],
  "files": [
    {
      "path": "registry/bricked-ui/wall-builder.tsx",
      "content": "import * as React from \"react\";\r\nimport { cva, type VariantProps } from \"class-variance-authority\";\r\nimport { cn } from \"@/lib/utils\";\r\nimport { PixelIcon, type PixelIconInput } from \"./pixel-icon\";\r\n\r\nconst s = cva(\"bk-wall\", {\r\n  variants: {\r\n    size: { sm: \"[--px:4px] [--cut:1.5px] [--icon:3px] text-[11px]\", md: \"[--px:6px] [--cut:2px] [--icon:4px] text-[14px]\", lg: \"[--px:8px] [--cut:3px] [--icon:5px] text-[18px]\" },\r\n    variant: { primary: \"bg-brick text-ink\", dark: \"bg-ink text-on-dark\" },\r\n  },\r\n  defaultVariants: { size: \"md\", variant: \"primary\" },\r\n});\r\nexport interface WallBuilderProps extends React.ComponentProps<\"div\">, VariantProps<typeof s> { icon?: PixelIconInput; rows?: number; cols?: number; }\r\nexport function WallBuilder({ className, size, variant, rows = 4, cols = 6, ...props }: WallBuilderProps) {\r\n  const [n, setN] = React.useState(0);\r\n  const total = rows * cols;\r\n  return (<div className={cn(s({ size, variant }), className)} {...props}><div className=\"bk-wall\" role=\"img\" aria-label={n + \" of \" + total + \" bricks laid\"}>{Array.from({ length: rows }, (_, r) => (<div key={r} className={r % 2 ? \"bk-wall__row is-odd\" : \"bk-wall__row\"}>{Array.from({ length: cols }, (_, c) => <span key={c} className={r * cols + c < n ? \"is-on\" : \"\"} />)}</div>))}</div><div className=\"bk-row\"><button type=\"button\" className=\"bricked-btn bricked-btn--sm\" disabled={n >= total} onClick={() => setN(n + 1)}>Lay brick</button><button type=\"button\" className=\"bricked-btn bricked-btn--sm\" onClick={() => setN(0)}>Reset</button><span>{n}/{total}</span></div></div>);\r\n}\r\n",
      "type": "registry:ui",
      "target": "components/ui/wall-builder.tsx"
    }
  ]
}