import { ReactNode, Ref } from 'react'; import type { DateRange, PropsBase } from 'react-day-picker'; import { ButtonSize } from '../components/Button.js'; import { PopoverOffset, PopoverPosition } from '../components/Popover.js'; import { Color } from '../types.js'; import { CalendarSize } from './Calendar.js'; export type DatePickerSize = ButtonSize; interface DatePickerBaseProps { /** Trigger button size. Forwarded to `Button.size`. Default `'md'`. */ size?: ButtonSize; /** Calendar size inside the popover. Default `'lg'`. */ calendarSize?: CalendarSize; /** Accent color token. Drives the trigger and the calendar. Default: theme accent. */ color?: Color; /** Show the chevron indicator on the right of the trigger. Default `true`. */ dropdownIcon?: boolean; /** Shown in the trigger when nothing is selected. Default `'Select date'`. */ placeholder?: ReactNode; /** Dim the trigger and block opening. */ disabled?: boolean; /** Show the value but block opening the popover. */ readOnly?: boolean; /** Pill-style trigger. Forwarded to `Button.rounded`. */ rounded?: boolean; /** Trigger surface outline ring. Forwarded to `Button.outline`. */ outline?: boolean; /** Extra classes for the trigger button. */ className?: string; /** Extra classes for the trigger's inner content row. */ contentClassName?: string; /** Icon node in the trigger. Defaults to a calendar glyph; pass `null` to hide. */ icon?: ReactNode; /** Extra classes for the icon wrapper. */ iconClassName?: string; /** Extra props forwarded to the underlying `Calendar` (e.g. `numberOfMonths`, `disabled`, `startMonth`, `endMonth`). */ calendarProps?: Omit, 'mode' | 'required'> & { size?: CalendarSize; controlSize?: ButtonSize; color?: Color; showToday?: boolean; }; /** Popover anchor side + alignment. Default `'bottom-end'`. */ popoverPosition?: PopoverPosition; /** Popover spacing from the trigger. Default `['-50%', 4]`. */ popoverOffset?: PopoverOffset; /** Extra classes for the popover surface. Default `'w-auto'`. */ popoverClassName?: string; /** Accent color for the popover. Defaults to `color`. */ popoverColor?: Color; /** Surface level for the popover. */ popoverSurfaceLevel?: number | string; /** Controlled popover open state. Pair with `onOpenChange`. */ open?: boolean; /** Fires whenever the popover open state changes. */ onOpenChange?: (open: boolean) => void; /** Forwarded to the trigger button's root element. */ ref?: Ref; } type SingleDatePickerProps = DatePickerBaseProps & { /** Selection mode. Default `'single'`. */ mode?: 'single'; /** Selected date. */ value?: Date; /** Fires when the selected date changes. */ onChange?: (value: Date | undefined) => void; /** Format the selected date into the trigger label. Default `toLocaleDateString`. */ format?: (value: Date) => ReactNode; /** Close the popover after a pick. Default `true`. */ closeOnSelect?: boolean; }; type MultipleDatePickerProps = DatePickerBaseProps & { mode: 'multiple'; /** Selected dates. */ value?: Date[]; /** Fires when the selected dates change. */ onChange?: (value: Date[]) => void; /** Format the selected dates into the trigger label. */ format?: (value: Date[]) => ReactNode; }; type RangeDatePickerProps = DatePickerBaseProps & { mode: 'range'; /** Selected range. */ value?: DateRange; /** Fires when the selected range changes. */ onChange?: (value: DateRange | undefined) => void; /** Format the selected range into the trigger label. */ format?: (value: DateRange) => ReactNode; }; export type DatePickerProps = SingleDatePickerProps | MultipleDatePickerProps | RangeDatePickerProps; export declare function DatePicker(props: DatePickerProps): import("react/jsx-runtime").JSX.Element; export {}; //# sourceMappingURL=DatePicker.d.ts.map