import { BaseInputFieldProps } from '../../common/types/input'; import type { DatePickerProps as AntDatePickerProps } from 'antd/es/date-picker/index'; import { SyntheticEvent } from 'react'; type MultiPropsDateValue = [Date | undefined, Date | undefined]; type RangeValue = MultiPropsDateValue | undefined; type SingleValue = Date | undefined; interface BaseProps extends BaseInputFieldProps { allowClear?: AntDatePickerProps['allowClear']; 'aria-errormessage'?: string; cellRender?: AntDatePickerProps['cellRender']; disabled?: boolean; feHideIcon?: boolean; feHideLabel?: boolean; feHint?: string; feMaxDate?: Date; feMinDate?: Date; feRequiredText?: string; feSeverity?: 'error' | 'warning' | 'success' | 'info'; feSize?: 'sm' | 'md'; id?: string; locale?: AntDatePickerProps['locale']; required?: boolean; } export interface DatePickerSingleProps extends BaseProps { /** If false, allows for selection of one date. */ feRange?: false; /** Callback that will fire anytime you choose a new value in the Datepicker */ onChange: (date: SingleValue, event?: SyntheticEvent) => void; /** placeholder text */ placeholder?: string; /** A single date */ value: SingleValue; } export interface DatePickerMultiProps extends BaseProps { /** If true, allows for selection of two dates. */ feRange: true; /** Callback that will fire anytime you choose a new value in the Datepicker */ onChange: (date: RangeValue, event?: SyntheticEvent) => void; /** placeholder text */ placeholder?: [string, string]; /** Two dates in a array */ value: RangeValue; } export type DatePickerProps = DatePickerSingleProps | DatePickerMultiProps; /** * controlled * * The `` component is a date input with built in datepicker for selecting a range of dates or one single date.
* * See [InVision DSM](https://skf.invisionapp.com/dsm/ab-skf/4-web-applications/nav/5fa7caf78c01200018354495/asset/62a34fbab000e98c480b2124) for design principles.
* See [React Datepicker](https://reactdatepicker.com/) for more information on what props it can accept. * */ declare const DatePicker: { ({ allowClear, "aria-errormessage": ariaErrorMessage, cellRender, disabled, feHideIcon, feHideLabel, feHint, feMaxDate, feMinDate, feLabel, feRange, feRequiredText, feSeverity, feSize, id, locale, onChange, placeholder, required, value, }: DatePickerProps): import("react/jsx-runtime").JSX.Element; displayName: string; }; export default DatePicker;