/** * @license EUPL-1.2+ * Copyright Gemeente Amsterdam */ import type { HTMLAttributes } from 'react'; import type { IconProps } from '../Icon'; /** A start and end date. Either side may be `null` while the range is being chosen. */ export type DateRange = { /** The start of the range, or `null` when nothing is selected. */ readonly start: Date | null; /** The end of the range, or `null` while it is being chosen. */ readonly end: Date | null; }; type DatePickerBaseProps = { /** The month shown on first render. Defaults to the current month. */ readonly defaultMonth?: Date; /** Prevents selection of individual dates, e.g. dates that are unavailable. They remain reachable by keyboard. */ readonly isDateDisabled?: (date: Date) => boolean; /** BCP 47 language tag for the weekday names, month caption, and accessible date labels. Defaults to `'nl-NL'`. */ readonly locale?: string; /** The latest selectable date. Also bounds month navigation. */ readonly maxDate?: Date; /** The earliest selectable date. Also bounds month navigation. */ readonly minDate?: Date; /** * The icon for the button that navigates to the next month. * Websites for the City of Amsterdam must use the default icon. * @default ChevronForwardIcon */ readonly nextMonthButtonIcon?: IconProps['svg']; /** * The accessible label for the button that navigates to the next month. * @default Volgende maand */ readonly nextMonthButtonLabel?: string; /** * The icon for the button that navigates to the next year. * Websites for the City of Amsterdam must use the default icon. * @default ChevronDoubleForwardIcon */ readonly nextYearButtonIcon?: IconProps['svg']; /** * The accessible label for the button that navigates to the next year. * @default Volgend jaar */ readonly nextYearButtonLabel?: string; /** * The icon for the button that navigates to the previous month. * Websites for the City of Amsterdam must use the default icon. * @default ChevronBackwardIcon */ readonly previousMonthButtonIcon?: IconProps['svg']; /** * The accessible label for the button that navigates to the previous month. * @default Vorige maand */ readonly previousMonthButtonLabel?: string; /** * The icon for the button that navigates to the previous year. * Websites for the City of Amsterdam must use the default icon. * @default ChevronDoubleBackwardIcon */ readonly previousYearButtonIcon?: IconProps['svg']; /** * The accessible label for the button that navigates to the previous year. * @default Vorig jaar */ readonly previousYearButtonLabel?: string; /** * Appended to the accessible name of the date that ends the range. * @default einddatum */ readonly rangeEndAccessibleName?: string; /** * Appended to the accessible name of the date that starts the range. * @default startdatum */ readonly rangeStartAccessibleName?: string; } & Readonly, 'onChange'>>; type DatePickerSingleProps = { /** Selects a single date. This is the default mode. */ readonly mode?: 'single'; /** Called when the user selects a date. */ readonly onChange: (value: Date) => void; /** The currently selected date, or `null`. */ readonly value: Date | null; }; type DatePickerRangeProps = { /** Selects a start and end date. */ readonly mode: 'range'; /** Called when the user updates the range. */ readonly onChange: (value: DateRange) => void; /** The currently selected range. */ readonly value: DateRange; }; export type DatePickerProps = DatePickerBaseProps & (DatePickerRangeProps | DatePickerSingleProps); /** * A calendar grid for selecting a single date or a date range. * * @see {@link https://designsystem.amsterdam/?path=/docs/components-forms-date-picker--docs Date Picker docs at Amsterdam Design System} */ export declare const DatePicker: import("react").ForwardRefExoticComponent>; export {};