{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "glass-date-picker",
  "title": "Glass Date Picker",
  "author": "Alex Chih (https://alexchih.com)",
  "description": "Date picker — glass field trigger, calendar in a strong-glass popover.",
  "dependencies": [
    "react-day-picker",
    "lucide-react"
  ],
  "registryDependencies": [
    "https://washiveil.alexchih.com/r/theme.json",
    "https://washiveil.alexchih.com/r/glass-popover.json",
    "https://washiveil.alexchih.com/r/glass-calendar.json",
    "https://washiveil.alexchih.com/r/glass-button.json"
  ],
  "files": [
    {
      "path": "registry/washiveil/ui/glass-date-picker.tsx",
      "content": "'use client'\n\nimport * as React from 'react'\nimport { CalendarIcon } from 'lucide-react'\n\nimport { cn } from '@/lib/utils'\nimport { GlassButton } from './glass-button'\nimport { GlassPopover, GlassPopoverContent, GlassPopoverTrigger } from './glass-popover'\nimport { GlassCalendar } from './glass-calendar'\n\nexport interface GlassDatePickerProps {\n  value?: Date\n  onValueChange?: (date: Date | undefined) => void\n  placeholder?: string\n  className?: string\n  /** Custom date formatter. Defaults to Intl.DateTimeFormat with long month. */\n  formatDate?: (date: Date) => string\n}\n\nconst defaultFormatDate = (date: Date) =>\n  new Intl.DateTimeFormat(undefined, {\n    year: 'numeric',\n    month: 'long',\n    day: 'numeric',\n  }).format(date)\n\nfunction GlassDatePicker({\n  value,\n  onValueChange,\n  placeholder = 'Pick a date',\n  className,\n  formatDate = defaultFormatDate,\n}: GlassDatePickerProps) {\n  const [open, setOpen] = React.useState(false)\n  const [mounted, setMounted] = React.useState(false)\n\n  React.useEffect(() => {\n    setMounted(true)\n  }, [])\n\n  let displayText: string | undefined\n  if (value) {\n    // Before mount, render a deterministic ISO-like fallback so server/client\n    // HTML is identical. After mount, swap to the locale-aware formatter.\n    displayText = mounted ? formatDate(value) : value.toISOString().slice(0, 10)\n  }\n\n  return (\n    <GlassPopover open={open} onOpenChange={setOpen}>\n      <GlassPopoverTrigger asChild>\n        <GlassButton\n          variant=\"secondary\"\n          className={cn(\n            'w-full justify-start rounded-xl font-normal',\n            !value && 'text-muted-foreground',\n            className,\n          )}\n        >\n          <CalendarIcon className=\"mr-2 size-4 text-muted-foreground\" />\n          {displayText ?? placeholder}\n        </GlassButton>\n      </GlassPopoverTrigger>\n      <GlassPopoverContent className=\"w-auto p-0\">\n        <GlassCalendar\n          mode=\"single\"\n          selected={value}\n          onSelect={(date) => {\n            onValueChange?.(date)\n            setOpen(false)\n          }}\n          autoFocus\n        />\n      </GlassPopoverContent>\n    </GlassPopover>\n  )\n}\nGlassDatePicker.displayName = 'GlassDatePicker'\n\nexport { GlassDatePicker }\n",
      "type": "registry:ui"
    }
  ],
  "type": "registry:ui"
}