import { Dispatch, SetStateAction } from 'react'; import { ThemingProps } from '@chakra-ui/react'; import { Props as DayzedProps, RenderProps } from 'dayzed'; import type { WithSsr } from '../../types/WithSsr'; import type { CalendarProps } from '../Calendar'; import type { DateRangeValue } from './types'; type PassthroughProps = { /** * Function to be passed to CalendarPanel to determine range styling. * Used for multi-calendar variant. */ isDateInRange?: (d: Date) => boolean; /** * Function to be passed to CalendarPanel to determine range styling. * Called when a date is selected and a mouseover is detected over a date. * Used for multi-calendar variant. */ onMouseEnterHighlight?: (date: Date) => void; /** * Function to be passed to CalendarPanel to determine range styling. * Called when mouse leaves the calendar. * Used for multi-calendar variant. */ onMouseLeaveCalendar?: () => void; /** * The dates that are selected. */ selectedDates?: Date | DateRangeValue; /** * Handler for when date is selected. */ onSelectDate: (d: Date) => void; /** * Function to determine whether a date should be made * unavailable. */ isDateUnavailable?: (d: Date) => boolean; /** * Date currently being hovered, if any. */ hoveredDate?: Date; /** * Color scheme of date input */ colorScheme?: ThemingProps<'Calendar'>['colorScheme']; /** Size of the component */ size?: ThemingProps<'Calendar'>['size']; /** * Whether to set the calendar to always be a fixed height. * This is useful for ensuring that the calendar does not jump around when the user switches between months * if the months have different numbers of weeks and the calendar is positioned from the bottom. * @default false */ isCalendarFixedHeight?: boolean; /** * Whether clicking the Today button should set the date on the input to today. * @default false */ shouldSetDateOnTodayButtonClick?: boolean; }; export interface UseProvideCalendarProps extends Pick, PassthroughProps, WithSsr { /** The date to focus when calendar first renders. */ defaultFocusedDate?: Date; /** * Callback fired when the currently viewed month changes. * @param {number} currMonth The new month being viewed. */ onMonthChange?: (currMonth: number) => void; /** * Callback fired when the currently viewed year changes. * @param {number} currYear The new year being viewed. */ onYearChange?: (currYear: number) => void; /** Whether to render in a loading state */ isLoading?: boolean; } interface CalendarContextProps extends CalendarProps, PassthroughProps { classNameId: string; currMonth: number; currYear: number; setCurrMonth: Dispatch>; setCurrYear: Dispatch>; renderProps: RenderProps; yearOptions: number[]; isDateFocusable: (d: Date) => boolean; handleTodayClick: () => void; dateToFocus: Date; selectedDates?: Date | DateRangeValue; monthsToDisplay: Required['monthsToDisplay']; isMobile: boolean; isLoading: boolean; } interface CalendarProviderProps extends UseProvideCalendarProps { children: React.ReactNode; } export declare const CalendarProvider: ({ children, ...props }: CalendarProviderProps) => import("react/jsx-runtime").JSX.Element; export declare const useCalendar: () => CalendarContextProps; export {};