import type { ReactNode, SyntheticEvent } from 'react'; import type { SupportedWixLocales } from '@wix/design-systems-locale-utils'; import type { RenderOptionFn } from '../DropdownLayout'; type DateFnsLocale = { code?: string; }; export type CalendarPanelProps = { /** Applies a data-hook HTML attribute that can be used in the tests. */ dataHook?: string; /** Specifies a CSS class name to be appended to the component's root element. * @internal */ className?: string; /** Defines a callback function which is called whenever the user selects a day or a date range in the calendar. */ onChange?: (selectedDays: SelectedDaysType) => void; /** Defines a callback function which is called whenever user press `escape` or click outside of the element. */ onClose?: (e: SyntheticEvent) => void; /** Focuses the selected day automatically when the component mounts or updates. * @default true */ autoFocus?: boolean; /** Specifies whether past dates should be selectable or not. */ excludePastDates?: boolean; /** Specifies dates that are selectable. Only the dates that match defined criteria are available for a user to select. */ filterDate?: (date: Date) => boolean; /** Defines a selected date or date range. */ value?: SelectedDaysType; /** Defines a number of months to display inside of a panel. * @default 2 */ numOfMonths?: number; /** Specifies if user can select a single day or a date range. */ selectionMode?: SelectionModeType; /** Specifies whether to display a year selection dropdown inside of a calendar. */ showYearDropdown?: boolean; /** Specifies whether to display a month selection dropdown inside of a calendar. */ showMonthDropdown?: boolean; /** Specifies whether calendar should close on a day selection. */ shouldCloseOnSelect?: boolean; /** Specifies date picker instance locale. */ locale?: SupportedWixLocales | DateFnsLocale; /** Defines an array of predefined calendar presets that are displayed as select items on the left side of a panel. */ presets?: PresetType[] | { selectedDays?: SelectedDaysType; id?: string | number; }; /** Renders a panel footer. Pass `` in all common cases. `({selectedDays, submitDisabled}) => void` - `selectedDays` is the same as the CalendarPanel's `value` prop. `submitDisabled` is true when the current selectedDays isn't valid for submission. */ footer?: (selectedDays: SelectedDaysType, submitDisabled: boolean) => void; }; export type PresetType = OptionType | { value: '-'; }; export type OptionType = { id: string | number; /** Defines the preset's display content, rendered as a `DropdownLayout` option. The preset's date or date range is defined by `selectedDays`. */ value: ReactNode | RenderOptionFn; disabled?: boolean; overrideStyle?: boolean; selectedDays: SelectedDaysType; }; export type { LanguageType } from '../Calendar'; export type SelectedDaysType = string | Date | DateRangeType; export type DateRangeType = { from?: string | Date; to?: string | Date; }; export type SelectionModeType = 'day' | 'range'; export type CalendarPanelImperativeActions = { getSelectedPresetId: () => string | number; onSelectPreset: (preset?: OptionType) => void; isSubmitDisabled: () => boolean; }; export type CalendarPanelFooterRenderer = (args: { selectedDays?: SelectedDaysType; submitDisabled: boolean; }) => ReactNode; //# sourceMappingURL=CalendarPanel.types.d.ts.map