import { IconType } from '@autoguru/icons'; import React from 'react'; import type { AriaPopoverProps } from 'react-aria'; import type { TestIdProp } from '../../types'; import { type CalendarProps } from '../Calendar'; type SizeScale = 'small' | 'medium' | 'large'; declare const defaultEnglish: { readonly openCalendar: "open calendar"; }; type LanguageEntries = Partial>; export interface DatePickerProps extends TestIdProp { /** * Options to customise the calendar: `allowPastDate`, `lang`, etc. */ calendarOptions?: Omit; className?: string; /** * Default selected date as an ISO string YYYY-MM-DD (uncontrolled) */ defaultValue?: string; /** * Whether the picker is disabled and non-interactive */ disabled?: boolean; /** * Icon to render inside the picker (defaults to calendar icon) */ icon?: IconType; /** * Form field id */ id?: string; /** * Show a loading state spinner instead of the icon */ isLoading?: boolean; /** * Maximum selectable date YYYY-MM-DD */ max?: string; /** * Minimum selectable date YYYY-MM-DD */ min?: string; /** * Input field name recommended for form usage */ name?: string; onChange(date: string): void; /** * Calendar popover placement relative to the trigger ('bottom left', 'top', etc.) */ placement?: AriaPopoverProps['placement']; /** * Visual size of the picker control (small, medium, large) */ size?: SizeScale; /** * The selected date as an ISO string (YYYY-MM-DD). Use `undefined` for an empty value * (controlled) */ value?: string; /** * Fallback label to display when no date value is selected. */ valueLabel?: string; /** * Use native browser date picker instead of Calendar popover */ useNativePicker?: boolean; /** * Language content override for DatePicker */ lang?: LanguageEntries; } /** * The DatePicker has been updated to render the Calendar component with a Popover while * maintaining backwards compatability. * * ## Props * - Visual size controlled by `size` (small | medium | large) * - Icon can be customized via the `icon` prop * * ## Event handling * - `onChange` is always invoked with the raw ISO date string (or empty string when cleared) * * ## Compatibility mode * - Setting `useNativePicker={true}` preserves the original browser-specific experience. * * ## Internationalization * - Override text values via `lang={{ openCalendar: 'open calendar' }}` * - Calendar options including `lang` can be passed via `calendarOptions` prop * - Date formatting helper available in `...utils/dateFormat.ts` or use `@internationalized/date` utils * - Advanced i18n and localization handled by [React Aria I18Provider](https://react-spectrum.adobe.com/react-aria/I18nProvider.html) * - Read more about [International calendars](https://react-spectrum.adobe.com/react-aria/useDatePicker.html#international-calendars) * * @example * // Uncontrolled component with default value * console.log('Selected date:', isoDate)} * /> * * @example * // Controlled component * { * setSelectedDate(isoDate); * if (isToday(isoDate)) { * setValueLabel('Today'); * } else { * setValueLabel(displayFormattedDate(iseDate)); * } * }} * calendarOptions={{ * allowPastDate: false, * }} * /> * * @example * // Native date picker usage * console.log('Date input:', isoDate)} * /> */ export declare const DatePicker: React.ForwardRefExoticComponent>; export {}; //# sourceMappingURL=DatePicker.d.ts.map