export interface DatePickerProps { /** * Earliest date that is selectable in the calendar. */ minDate?: Date; /** * Latest date that is selectable in the calendar. */ maxDate?: Date; /** * An array of ISO-8601 (YYYY-MM-DD) date strings, representing not-available dates. */ disabledDates?: string[]; /** * Show/hide the weekend. * * By default this is enabled/shown. */ displayWeekend?: boolean; /** * Show/hide year navigation buttons. * * By default this is enabled/shown. */ displayYearNavigation?: boolean; } /** * Which widget to render for the field. Either an input group (for known dates) or * a calendar to pick an available date. */ export type WidgetProps = { widget: 'inputGroup'; } | { widget: 'datePicker'; widgetProps?: DatePickerProps; }; interface DateFieldCommonProps { /** * The name of the form field/input, used to set/track the field value in the form state. */ name: string; /** * The (accessible) label for the field - anything that can be rendered. * * You must always provide a label to ensure the field is accessible to users of * assistive technologies. */ label: React.ReactNode; /** * Required fields get additional markup/styling to indicate this validation requirement. */ isRequired?: boolean; /** * Readonly fields get marked as such in an accessible manner. */ isReadOnly?: boolean; /** * Additional description displayed close to the field - use this to document any * validation requirements that are crucial to successfully submit the form. More * information that is contextual/background typically belongs in a tooltip. */ description?: React.ReactNode; /** * Optional tooltip to provide additional information that is not crucial but may * assist users in filling out the field correctly. */ tooltip?: React.ReactNode; /** * How to autocomplete the field from the browser. */ autoComplete?: string; /** * Marker to signal this field is used in a multi-value field parent, which requires * some special attention w/r to validation errors. */ isMultiValue?: boolean; } export type DateFieldProps = DateFieldCommonProps & WidgetProps; /** * Implements a form field to enter and/or select dates. * * The field has two variants: * 1. Input groups - consists of separate inputs for day, month, and year. Suitable for known * dates such as birthdays. * 2. Datepicker - text input with a calendar where a date can be selected, that toggles when * focussing the field. Suitable for nearby dates such as appointments. * The variant to use can be selected using the `widget` prop. */ declare const DateField: React.FC; export default DateField;