{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "combo-box",
  "type": "registry:ui",
  "title": "Combobox",
  "description": "Searchable select with list.",
  "dependencies": [
    "class-variance-authority"
  ],
  "registryDependencies": [
    "bricked-css",
    "pixel-icon"
  ],
  "files": [
    {
      "path": "registry/bricked-ui/combo-box.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-menu\", {\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 ComboBoxProps extends Omit<React.ComponentProps<\"div\">, \"onChange\">, VariantProps<typeof s> { options: string[]; value: string; onChange: (v: string) => void; icon?: PixelIconInput; }\r\nexport function ComboBox({ className, size, variant, options, value, onChange, icon = \"search\", ...props }: ComboBoxProps) {\r\n  const [q, setQ] = React.useState(\"\");\r\n  const list = options.filter(o => o.toLowerCase().includes(q.toLowerCase()));\r\n  return (<div className={cn(s({ size, variant }), className)} {...props}><div className=\"bk-search\"><input className=\"bk-input bk-cut\" value={q} placeholder={value || \"Pick one\"} onChange={e => setQ(e.target.value)} aria-label=\"Search options\" /><PixelIcon icon={icon} /></div><div className=\"bk-list\">{list.map(o => <button key={o} type=\"button\" className=\"bk-list__btn bk-cut\" aria-pressed={o === value} onClick={() => onChange(o)}>{o}</button>)}</div></div>);\r\n}\r\n",
      "type": "registry:ui",
      "target": "components/ui/combo-box.tsx"
    }
  ]
}