{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "date-picker",
  "type": "registry:ui",
  "title": "Date picker",
  "description": "Input opening a calendar.",
  "dependencies": [],
  "registryDependencies": [
    "bricked-css",
    "pixel-icon"
  ],
  "files": [
    {
      "path": "registry/bricked-ui/date-picker.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-cal bk-cut\", {\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 DatePickerProps extends Omit<React.ComponentProps<\"div\">, \"onChange\">, VariantProps<typeof s> { value: number; onChange: (d: number) => void; icon?: PixelIconInput; }\r\nexport function DatePicker({ className, size, variant, value, onChange, icon = \"down\", ...props }: DatePickerProps) {\r\n  const [open, setOpen] = React.useState(false);\r\n  return (<div className={cn(s({ size, variant }), className)} {...props}><button type=\"button\" className=\"bk-input bk-cut\" onClick={() => setOpen(!open)} aria-expanded={open}>Day {value} <PixelIcon icon={icon} /></button>{open && (<div className=\"bk-cal__grid\">{Array.from({ length: 31 }, (_, i) => i + 1).map(d => <button key={d} type=\"button\" className={d === value ? \"bk-day is-on\" : \"bk-day\"} onClick={() => { onChange(d); setOpen(false); }}>{d}</button>)}</div>)}</div>);\r\n}\r\n",
      "type": "registry:ui",
      "target": "components/ui/date-picker.tsx"
    }
  ]
}