import { ChangeEvent } from 'react'; import { TextFieldProps } from '../TextField'; import { CalendarProps } from '../Calendar/Calendar'; import { IanaZone, Locale } from '../../types'; /** * Common props shared between single and range date field modes */ interface DateFieldCommonProps { /** Date format for input and display */ format?: "MM/dd/yyyy" | "dd/MM/yyyy"; /** Locale for date formatting */ locale?: Locale; /** Default timezone for date operations */ defaultTimeZone?: IanaZone; /** Whether to open calendar on mount */ openCalendar?: boolean; /** Whether to disable the format hint */ disableHint?: boolean; } /** * Data structure for a single date selection */ export interface DateSelect { /** The formatted date string value */ value: string; /** The ISO date string or null if invalid */ date: string | null | undefined; /** Whether the date is valid according to constraints */ isValid: boolean; } /** * Data structure for a date range selection */ export interface DateRangeSelect { /** The start date selection */ start?: DateSelect; /** The end date selection */ end?: DateSelect; /** The combined formatted range string */ value: string; } /** * Props for single date selection mode */ interface DateFieldSingleProps { /** Callback when date selection changes */ onChange?: (event: ChangeEvent, data: DateSelect) => void; /** Controlled value for the date field */ value?: string; /** Default value for the date field */ defaultValue?: string; /** Must be false for single date mode */ range?: false; } /** * Props for date range selection mode */ interface DateFieldRangeProps { /** Callback when date range selection changes */ onChange?: (event: ChangeEvent, data: DateRangeSelect) => void; /** Controlled value for the date range field */ value?: { start?: string; end?: string; }; /** Default value for the date range field */ defaultValue?: { start?: string; end?: string; }; /** Must be true for range mode */ range: true; } /** * Props for the DateField component * @extends Omit * @extends Omit * @extends DateFieldCommonProps */ export type DateFieldProps = Omit & Omit & DateFieldCommonProps & (DateFieldSingleProps | DateFieldRangeProps); /** * DateField component for selecting dates with calendar popup and input validation * @deprecated Use DateFieldSingle or DateFieldRange instead * * Features: * - Single date and date range selection modes * - Calendar popup with keyboard navigation * - Input mask validation with format hints * - Configurable date formats (MM/dd/yyyy, dd/MM/yyyy) * - Min/max date constraints and unavailable dates * - Locale and timezone support * - Accessibility with ARIA attributes * - Keyboard navigation and focus management * - Popover and legacy fallback modes * * @param props - The component props * @param ref - Forwarded ref to the input element * @returns A date field component with calendar integration * * @example * console.log(data.date)} * /> * * @example * console.log(data.start?.date, data.end?.date)} * /> */ export declare const DateField: import('react').ForwardRefExoticComponent>; export {};