import React from 'react'; import { TextInputProps } from '../textInput'; import { LegendItem } from './components/datePicker'; export type DateInputProps = Omit & { /** * Close button label */ closeButtonLabel?: string; /** * Select the date from date picker without confirmation button. */ disableConfirmation?: boolean; /** * Show the input without the date picker. */ disableDatePicker?: boolean; /** * The initial month open in calendar. */ initialMonth?: Date; /** * Language * * @default "en" */ language?: 'en' | 'fi' | 'sv'; /** * Callback fired when text input value is changed */ onChange?: (value: string, valueAsDate: Date) => void; /** * Calendar button aria-label */ openButtonAriaLabel?: string; /** * Select button label */ selectButtonLabel?: string; /** * Minimum date to show in the datepicker calendar. Defaults to start of the month ten years before current date. */ minDate?: Date; /** * Maximum date to show in the datepicker calendar. Defaults to end of the month ten years from current date. */ maxDate?: Date; /** * The `ref` is forwarded to the native input element. */ ref?: React.Ref; /** * Disables date(s) based on conditional function. */ isDateDisabledBy?: (date: any) => boolean; /** * Set classNames for specific dates. */ setDateClassName?: (date: Date) => string | undefined; /** * Legend items for the date picker. * @example * ```ts * legend={[{ elementId: 'legend-item-1', label: 'Text label', relatedClassName: 'custom-day' }, { elementId: 'legend-item-2', label: 'Text label', color: '#d6d66d' }]} * ``` * */ legend?: LegendItem[]; /** * Function to set aria-describedby for dates. */ setDateAriaDescribedBy?: (date: Date) => string | undefined; /** * Date format for the input value. * Documentation: https://date-fns.org/v2.16.1/docs/format * @default "d.M.yyyy" * */ dateFormat?: string; /** * Error text for invalid date format, or if date does not exist. */ malformedDateErrorText?: string; /** * Error text for date outside the allowed range. */ dateOutsideRangeErrorText?: string; }; export declare const DateInput: ({ closeButtonLabel, disableConfirmation, disableDatePicker, initialMonth: _initialMonth, language, openButtonAriaLabel, selectButtonLabel, defaultValue, value: providedValue, minDate, maxDate, isDateDisabledBy, setDateClassName, legend, setDateAriaDescribedBy, dateFormat, malformedDateErrorText, dateOutsideRangeErrorText, ref, ...textInputProps }: DateInputProps) => React.JSX.Element;