UNPKG

reablocks

Version:
88 lines (87 loc) 2.41 kB
import { MotionNodeAnimationOptions } from 'motion/react'; import { default as React, FC } from 'react'; import { CalendarTheme } from './CalendarTheme'; import { PresetOption } from './CalendarPresets'; export type CalendarViewType = 'days' | 'months' | 'years'; export interface CalendarProps { /** * The selected date(s) for the calendar. */ value?: Date | [Date, Date] | [Date, undefined] | [undefined, undefined] | undefined; /** * The minimum selectable date for the calendar. */ min?: Date; /** * The maximum selectable date for the calendar. * Can also be set to 'now' to use the current date. */ max?: Date | 'now'; /** * Whether the calendar is disabled. */ disabled?: boolean; /** * Whether the calendar is a range picker. */ isRange?: boolean; /** * The text or icon to use for next. * @default '›' */ nextArrow?: React.ReactNode | string; /** * The text or icon to use for previous. * @default '‹' */ previousArrow?: React.ReactNode | string; /** * Whether to display day of week labels */ showDayOfWeek?: boolean; /** * Whether to highlight the today. */ showToday?: boolean; /** * Whether to show the time picker. * @default false */ showTime?: boolean; /** * Whether to use 12-hour cycle for the time picker. * @default false */ is12HourCycle?: boolean; /** * @deprecated Use animation configuration instead. * Whether to animate the calendar. * @default true */ animated?: boolean; /** * Animation configuration for the calendar days. */ animation?: MotionNodeAnimationOptions; /** * Animation configuration for the calendar changing view. */ animationViewChange?: MotionNodeAnimationOptions; /** * Preset configuration for the calendar. */ preset?: PresetOption[]; /** * A callback function that is called when the selected date(s) change. */ onChange?: (value: Date | [Date, Date]) => void; /** * A callback function that is called when the calendar view changes. */ onViewChange?: (view: CalendarViewType) => void; /** * Theme for the Calendar. */ theme?: CalendarTheme; } export declare const Calendar: FC<CalendarProps>;