import * as react from 'react'; import react__default, { ReactNode } from 'react'; import { ThemeOverrideProps } from '@xsolla/xui-core'; import * as locales from 'date-fns/locale'; type CalendarLocaleType = keyof typeof locales; interface CalendarChipOption { label: string; value: string; /** * Number of days the chip represents as a range from today. * 0 = today only, 7 = last 7 days, 30 = last 30 days, etc. */ days?: number; } interface CalendarChipsProps extends ThemeOverrideProps { /** * Array of chip options to display. */ chips: CalendarChipOption[]; /** * The currently active chip value. */ activeChip?: string | null; /** * Callback fired when a chip is selected. */ onChipSelect?: (value: string | null) => void; testID?: string; } interface CalendarGridProps extends ThemeOverrideProps { currentMonth: Date; locale?: CalendarLocaleType; firstDayOfWeek?: number; selectsRange?: boolean; minDate?: Date | null; maxDate?: Date | null; startDate?: Date | null; endDate?: Date | null; selectedDate?: Date | null; selectingRange?: Date | null; onDayPress?: (date: Date) => void; testID?: string; } interface CalendarHeaderProps extends ThemeOverrideProps { monthDate: Date; decreaseMonth: () => void; increaseMonth: () => void; changeYear: (year: number) => void; changeMonth: (month: number) => void; prevMonthButtonDisabled?: boolean; nextMonthButtonDisabled?: boolean; locale: CalendarLocaleType; minDate?: Date | null; maxDate?: Date | null; contextMenuMaxHeight?: number; testID?: string; } interface CalendarProps extends ThemeOverrideProps { locale?: CalendarLocaleType; /** * The day to use as first day of the week, starting from 0 (Sunday) to 6 (Saturday). */ firstDayOfWeek?: number; /** * The month to display in the calendar at first render. */ initialMonth?: Date; /** * The month to display in the calendar. */ month?: Date; /** * Select in range mode for calendar */ selectsRange?: boolean; /** * The minimum selectable date */ minDate?: Date | null; /** * The maximum selectable date */ maxDate?: Date | null; /** * For range mode. Start date in selected period */ startDate?: Date | null; /** * For range mode. End date in selected period */ endDate?: Date | null; /** * The selected date */ selectedDate?: Date | null; /** * Property sets the maximum height of a context menus for selecting month and year. */ contextMenuMaxHeight?: number; /** * Returns custom content to display above the calendar's date picker. */ topContent?: (datePicker: { close: () => void; }) => ReactNode; /** * Returns custom content to display beneath the calendar's date picker. */ bottomContent?: (datePicker: { close: () => void; }) => ReactNode; /** * Preset chip options displayed above the calendar header. */ chips?: CalendarChipOption[]; /** * The currently active chip value. */ activeChip?: string | null; /** * Callback fired when a chip is selected. */ onChipSelect?: (value: string | null) => void; testID?: string; /** * Callback fired when the date changes */ onChange?: (date: Date | [Date | null, Date | null]) => void; } interface DualCalendarProps extends ThemeOverrideProps { locale?: CalendarLocaleType; /** * The day to use as first day of the week, starting from 0 (Sunday) to 6 (Saturday). */ firstDayOfWeek?: number; /** * The month to display in the left calendar at first render. */ initialMonth?: Date; /** * The month to display in the left calendar (controlled). */ month?: Date; /** * The minimum selectable date */ minDate?: Date | null; /** * The maximum selectable date */ maxDate?: Date | null; /** * Start date of the selected range */ startDate?: Date | null; /** * End date of the selected range */ endDate?: Date | null; /** * Property sets the maximum height of a context menus for selecting month and year. */ contextMenuMaxHeight?: number; /** * Returns custom content to display above the calendars. */ topContent?: (datePicker: { close: () => void; }) => ReactNode; /** * Returns custom content to display beneath the calendars. */ bottomContent?: (datePicker: { close: () => void; }) => ReactNode; /** * Preset chip options displayed above the calendar headers. */ chips?: CalendarChipOption[]; /** * The currently active chip value. */ activeChip?: string | null; /** * Callback fired when a chip is selected. */ onChipSelect?: (value: string | null) => void; testID?: string; /** * Callback fired when the date range changes. */ onChange?: (dates: [Date | null, Date | null]) => void; } declare const Calendar: react.ForwardRefExoticComponent>; declare const DualCalendar: react.ForwardRefExoticComponent>; declare const CalendarHeader: react__default.FC; declare const CalendarGrid: react__default.FC; declare const CalendarChips: react__default.FC; declare function formatDate(date: Date, formatStr: string, locale?: CalendarLocaleType): string; declare function getMonthInLocale(month: number, locale?: CalendarLocaleType): string; export { Calendar, type CalendarChipOption, CalendarChips, type CalendarChipsProps, CalendarGrid, type CalendarGridProps, CalendarHeader, type CalendarHeaderProps, type CalendarLocaleType, type CalendarProps, DualCalendar, type DualCalendarProps, formatDate, getMonthInLocale };