UNPKG

react-calendar-kit

Version:

React Calendar Kit is a powerful and flexible library for building accessible and highly customizable calendar and date/time picker components in your React applications. React Calendar Kit provides a solid foundation for creating inclusive user experienc

64 lines (61 loc) 2.14 kB
import { a as CalendarRootProps } from '../calendar-CuLzw2l7.js'; import { Ref, ReactElement } from 'react'; import { DateValue, Calendar } from '@internationalized/date'; import { AriaCalendarGridProps } from '@react-aria/calendar'; import { AriaRangeCalendarProps } from '@react-types/calendar'; import { SupportedCalendars } from '../types/common.types.js'; import { CalendarClassNames, CalendarStyles } from './calendar-context.js'; import '@react-stately/calendar'; interface Props<T extends DateValue> extends AriaRangeCalendarProps<T>, Pick<CalendarRootProps, 'header' | 'footer'> { createCalendar?: (calendar: SupportedCalendars) => Calendar | null; /** * The style of the weekday labels. */ weekdayStyle?: AriaCalendarGridProps['weekdayStyle']; /** * The number of months grid to display. Max 3 and min 1 */ visibleMonths?: number; /** * Root className for calendar */ className?: string; /** * className for each components in the calendar */ classNames?: CalendarClassNames; /** * styles for each components in the calendar */ styles?: CalendarStyles; /** * Using month year picker instead on basic label */ withPicker?: boolean; /** * Lock the calendar height when the calendar picker is open. * Prefer choose minimum height when the calendar picker is not open */ pickerHeight?: number; /** * Number of empty item to display in the month picker to force list scrollable */ pickerEmptyItem?: number; /** * Open the calendar picker for default - uncontrolled style */ defaultPickerOpen?: boolean; /** * Open the calendar picker controlled style */ pickerOpen?: boolean; /** * Trigger when pickerOpen State Change */ onPickerOpenChange?: (open: boolean) => void; } type RangeCalendarProps<T extends DateValue = DateValue> = Props<T> & { ref?: Ref<HTMLElement>; }; declare const _default: <T extends DateValue>(props: RangeCalendarProps<T>) => ReactElement; export { type RangeCalendarProps, _default as default };