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

75 lines (71 loc) 2.62 kB
import React__default, { ReactNode, Ref, ReactElement } from 'react'; import { DateValue, Calendar } from '@internationalized/date'; import { CalendarAria, AriaCalendarGridProps } from '@react-aria/calendar'; import { AriaCalendarProps } from '@react-types/calendar'; import { SupportedCalendars } from './types/common.types.mjs'; import { CalendarClassNames, CalendarStyles } from './calendar/calendar-context.mjs'; interface CalendarRootProps extends CalendarAria { headerLayout?: CalendarHeaderLayout; className?: string; header?: ReactNode; footer?: ReactNode; } declare const _default$1: React__default.MemoExoticComponent<React__default.ForwardRefExoticComponent<CalendarRootProps & React__default.RefAttributes<HTMLDivElement>>>; type CalendarHeaderLayout = 'apart' | 'left' | 'right'; interface Props<T extends DateValue> extends AriaCalendarProps<T>, Pick<CalendarRootProps, 'header' | 'footer'> { createCalendar?: (calendar: SupportedCalendars) => Calendar | null; /** * The layout of the header */ headerLayout?: CalendarHeaderLayout; /** * 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 CalendarProps<T extends DateValue = DateValue> = Props<T> & { ref?: Ref<HTMLElement>; }; declare const _default: <T extends DateValue>(props: CalendarProps<T>) => ReactElement; export { type CalendarProps as C, _default as _, type CalendarRootProps as a, _default$1 as b, type CalendarHeaderLayout as c };