{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "counter",
  "type": "registry:ui",
  "title": "Counter",
  "description": "Minus/plus stepper around a value box.",
  "dependencies": [],
  "registryDependencies": [
    "bricked-css",
    "pixel-icon"
  ],
  "files": [
    {
      "path": "registry/bricked-ui/counter.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-count\", {\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 CounterProps extends Omit<React.ComponentProps<\"div\">, \"onChange\">, VariantProps<typeof s> { value: number; onChange: (v: number) => void; min?: number; max?: number; icon?: PixelIconInput; }\r\nexport function Counter({ className, size, variant, value, onChange, min = 0, max = 9, ...props }: CounterProps) {\r\n  return (<div className={cn(s({ size, variant }), className)} {...props}><button type=\"button\" aria-label=\"Less\" className=\"bk-page bk-cut\" disabled={value <= min} onClick={() => onChange(value - 1)}><PixelIcon name=\"minus\" /></button><span className=\"bk-count__val bk-cut\" aria-live=\"polite\">{value}</span><button type=\"button\" aria-label=\"More\" className=\"bk-page bk-cut\" disabled={value >= max} onClick={() => onChange(value + 1)}><PixelIcon name=\"plus\" /></button></div>);\r\n}\r\n",
      "type": "registry:ui",
      "target": "components/ui/counter.tsx"
    }
  ]
}