import { type VariantProps } from 'class-variance-authority'; import { triggerVariants } from '../_shared'; /** Curated imperative handle exposed via `ref` — also consumed by the agent adapter. */ export interface DatePickerHandle { /** Get the current selected date, or undefined. */ getValue: () => Date | undefined; /** Set the selected date. */ setValue: (date: Date | undefined) => void; /** Clear the selected date. */ clear: () => void; /** Whether the popover is open. */ isOpen: () => boolean; /** Open the calendar popover. */ open: () => void; /** Close the calendar popover. */ close: () => void; } export interface DatePickerPreset { label: string; date: () => Date; } export interface DatePickerProps extends Pick, 'size'> { /** Current selected date — controlled. */ value?: Date; /** Default selected date — uncontrolled. */ defaultValue?: Date; /** Called when the selected date changes. */ onChange?: (date: Date | undefined) => void; /** Minimum selectable date. */ minDate?: Date; /** Maximum selectable date. */ maxDate?: Date; /** Disabled dates — array or predicate. */ disabledDates?: Date[] | ((date: Date) => boolean); /** Week starts on (0=Sunday). Derived from locale if not specified. */ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6; /** Quick-pick presets shown inline-start of the calendar. */ presets?: DatePickerPreset[]; /** Component size. */ size?: 'sm' | 'md' | 'lg'; /** * Trigger chrome. `'input'` (default) is the soft input look — fill + the * `--shadow-input` halo — that matches other form fields. `'button'` renders * the trigger as an outline Button (flat, `--radius-md`, no halo, `md` = 40px) * so the picker sits flush among Buttons in a toolbar. Use `'button'` only in * toolbars, not in forms: the input chrome's `--control-border` edge marks * the field at 3:1 (WCAG 1.4.11), whereas a button-chrome trigger relies on * its value/label like a Button does. Mirrors * `DateRangePicker`'s prop of the same name. */ chrome?: 'input' | 'button'; /** Disabled state. */ disabled?: boolean; /** Placeholder text. */ placeholder?: string; /** Additional class names. */ className?: string; /** id override. */ id?: string; /** Accessible name for the date input, when the picker is NOT wrapped in a * `FormField`. Without one — and without a FormField's `