import type { ComponentProps } from '@fluentui/react-utilities'; import type { ComponentState } from '@fluentui/react-utilities'; import type { DistributiveOmit } from '@fluentui/react-utilities'; import type { EventData } from '@fluentui/react-utilities'; import type { EventHandler } from '@fluentui/react-utilities'; import type { ForwardRefComponent } from '@fluentui/react-utilities'; import type { JSXElement } from '@fluentui/react-utilities'; import * as React_2 from 'react'; import type { Slot } from '@fluentui/react-utilities'; /** * Calendar shows a date grid and lets the user pick a date, a week, a work week or a month. */ export declare const Calendar: ForwardRefComponent; /** * Configuration shared by the Calendar root, every picker below it, and every grid row and cell. * Pickers and their descendants read shared configuration directly from this context. */ export declare type CalendarContextValue = { /** * Allows all dates and buttons to be focused, including disabled ones. */ allFocusable: boolean; /** Number of columns in the month picker. */ calendarMonthColumns: 3 | 4; /** Number of columns in the year picker. */ calendarYearColumns: 3 | 4; /** * The range selected when a date is chosen. */ dateRangeType: DateRangeType; /** * The first day of the displayed week. */ firstDayOfWeek: DayOfWeek; /** * The rule used to determine the first week of a year. */ firstWeekOfYear: FirstWeekOfYear; /** * Formats dates and accessibility labels displayed by the calendar. */ formatters: CalendarFormatters; /** * The latest selectable or navigable date. */ maxDate?: Date; /** * The earliest selectable or navigable date. */ minDate?: Date; /** * Dates that cannot be selected. */ restrictedDates?: Date[]; /** * Selects a date. Fired by the day grid once the date range has been resolved. */ setValue?: EventHandler; /** * Whether week numbers appear before each week row. */ showWeekNumbers: boolean; /** * Value of today. Pass explicitly while server rendering to keep server and client output consistent. */ today?: Date; /** * The currently selected date. */ value?: Date | null; /** * Days included in a work-week selection. */ workWeekDays?: DayOfWeek[]; }; /** * Context values provided by Calendar. */ export declare type CalendarContextValues = { /** * Shared Calendar configuration. */ calendar: CalendarContextValue; }; /** * A date and its formatted display value. */ export declare type CalendarDateLabelData = { /** * The actual date object. */ date: Date; /** * The formatted display value of the date. */ formattedDate: string; }; /** * Supported date and time display formats. */ export declare type CalendarDateTimeFormat = 'day' | 'month' | 'shortMonth' | 'year' | 'monthDayYear' | 'monthYear' | 'weekday' | 'shortWeekday'; /** * CalendarDay shows a month header with navigation, above the grid of that month's days. */ export declare const CalendarDay: ForwardRefComponent; /** * Semantic day data passed to cell getters, without DOM props. */ export declare type CalendarDayCellData = DayInfo & { /** * The formatted day number, or the civil date label when `originalDate` is `null`. */ label: string; /** * Whether this day is the grid's initial focus target. */ isNavigated: boolean; }; /** * Overrides for the existing elements of a visible day cell. These are prop bags, not slots. * Use label.children for day content or button.children to replace both the label and marker. */ export declare type CalendarDayCellProps = { /** * Overrides for the ``. Its children remain controlled by the renderer. */ root?: Omit, 'children'>; /** * Overrides for the day button. Set `children` to replace both the label and marker. */ button?: React_2.ComponentProps<'button'>; /** * Overrides for the day-number span. Set `children` to customize content while preserving the marker. */ label?: React_2.ComponentProps<'span'>; /** * Overrides for the marker element. Applied only when the day is marked. */ marker?: React_2.ComponentProps<'span'>; }; /** * Data describing activation of the day picker's close button. */ export declare type CalendarDayDismissData = EventData<'click' | 'keydown', React_2.SyntheticEvent>; /** * The imperative API exposed through CalendarDay's `imperativeRef` prop. */ export declare type CalendarDayHandle = { /** * Moves focus to the day the grid is currently navigated to. */ focus(options?: FocusOptions): void; }; /** * Data describing activation of the day picker's month/year heading. */ export declare type CalendarDayHeaderSelectData = EventData<'click' | 'keydown', React_2.SyntheticEvent>; /** * Data describing a request to navigate the day picker. */ export declare type CalendarDayNavigateData = EventData<'click' | 'keydown', React_2.SyntheticEvent> & { /** * The date to navigate to. */ date: Date; /** * Whether focus should move into the day grid after navigation. */ focusOnNavigatedDay: boolean; }; /** * Props for the day picker. Shared selection, boundaries, and formatting come from CalendarProvider. */ export declare type CalendarDayProps = ComponentProps> & Pick, 'daysToSelectInDayView'> & { /** * Provides access to the picker's focus handle. */ imperativeRef?: React_2.Ref; /** * The currently navigated date */ navigatedDate?: Date; /** * Called when navigation is requested. The event data includes the destination date and whether * focus should move into the day grid. */ onNavigateDate?: EventHandler; /** * Callback issued when calendar day is closed */ onDismiss?: EventHandler; /** * Callback function when the header is selected */ onHeaderSelect?: EventHandler; /** * How many weeks to show. If not provided, shows enough weeks to display the navigated month, * between 4 and 6 depending. * @default undefined */ weeksToShow?: number; /** * Optional callback function to mark specific days with a small symbol. Fires when the date range changes, * gives the starting and ending displayed dates and expects the list of which days in between should be * marked. */ getMarkedDays?: (startingDate: Date, endingDate: Date) => Date[]; /** * Overrides the existing elements of each visible cell, including placeholder dates. * Receives semantic day data and a formatted label, not DOM props. * Refs are composed, class names appended and styles merged. * Defined consumer props override defaults, including roles, focus, disabled/selection state and data attributes. * Consumers are responsible for preserving accessibility and interaction semantics when overriding these props. * Handlers run before the delegated grid behavior; preventDefault cancels selection and navigation. * Marker overrides apply only to marked days. * Called when the renderer resolves the cell's props, not while the hook builds its data. */ getCellProps?: (day: CalendarDayCellData) => CalendarDayCellProps; /** * Overrides each visible week row and the weekday header row. Use row.type to identify the row. * Week-number overrides apply only when week numbers are shown. * Called when the renderer resolves the row's props. */ getRowProps?: (row: CalendarDayRowData) => CalendarDayRowProps; /** * Overrides each weekday header cell, including its default role and scope. * Receives semantic weekday data and formatted labels. Called when the renderer resolves the cell's props. */ getWeekdayCellProps?: (weekday: CalendarDayWeekdayCellData) => CalendarDayWeekdayCellProps; }; /** * A visible week or weekday-header row, without DOM props on the row or its items. */ export declare type CalendarDayRowData = { /** * Identifies a row of day cells. */ type: 'week'; /** * Zero-based index of the visible week row. */ key: number; /** * Semantic day data in display order, including placeholder dates. */ days: CalendarDayCellData[]; /** * The numeric week number, present only when week numbers are shown and the row has a representable date. */ weekNumber?: number; } | { /** * Identifies the weekday header row. */ type: 'weekday'; /** * Semantic header-cell data ordered from the configured first day of the week. */ cells: CalendarDayWeekdayCellData[]; }; /** Overrides for a week row or weekday-header row. */ export declare type CalendarDayRowProps = { /** * Overrides for the ``. Its cells remain controlled by the renderer. */ root?: Omit, 'children'>; /** * Overrides for the week-number ``, or the header row's spacer. * Applied only when the corresponding element is rendered. */ weekNumber?: React_2.ComponentProps<'th'>; }; /** * Data describing a day selection and its bounded, unrestricted date range. */ export declare type CalendarDaySelectData = EventData<'click' | 'keydown', React_2.SyntheticEvent> & { /** * The selected day. */ date: Date; /** * The dates selected for the configured range, excluding restricted and out-of-bounds dates. */ selectedDateRange: Date[]; }; /** * Slots rendered by the day picker. */ export declare type CalendarDaySlots = { /** * The outer container of the day picker. */ root: NonNullable>; /** * Holds the month/year title and the navigation buttons. */ header: NonNullable>; /** * The month and year label. Renders as a `button` when `onHeaderSelect` is set, otherwise as a * plain `div`. */ heading: NonNullable>; /** * Wraps the previous/next month and close buttons. */ navigation: NonNullable>; /** * The button to navigate to the previous month. */ previousMonthButton: NonNullable>; /** * The button to navigate to the next month. */ nextMonthButton: NonNullable>; /** * The close button. */ closeButton?: Slot<'button'>; /** * The `` holding the days of the navigated month, with a single roving tab stop. Arrows, Home * and End move focus between available days; Calendar owns selection, range hover and navigation beyond visible * dates. */ grid: NonNullable>; /** * The `` wrapping every week row. */ body: NonNullable>; }; /** * Resolved slots, semantic grid data and on-demand prop getters used to render the day picker. */ export declare type CalendarDayState = ComponentState & { /** * The weekday header row. */ weekdayRow: Extract; /** * Visible week rows, containing semantic day data only. */ weeks: Extract[]; /** * Resolves built-in HTML props and consumer overrides for a day without modifying its data. * Calls the consumer's `getCellProps` callback. * @param day - A day from a visible week in `weeks`. * @returns Root, button and label props, plus marker props only when the day is marked. */ getDayCellProps: (day: CalendarDayCellData) => Required> & Pick; /** * Resolves built-in HTML props and consumer overrides for a row without modifying its data. * Calls the consumer's `getRowProps` callback. * @param row - A visible week from `weeks`, or `weekdayRow`. * @returns Root props and optional week-number or header-spacer props. */ getDayRowProps: (row: CalendarDayRowData) => Required> & Pick; /** * Resolves built-in HTML props and consumer overrides for a weekday header without modifying its data. * Calls the consumer's `getWeekdayCellProps` callback. * @param weekday - A header cell from `weekdayRow.cells`. * @returns Props for the column-header element. */ getWeekdayCellProps: (weekday: CalendarDayWeekdayCellData) => Required; }; /** * Semantic weekday data passed to header-cell getters. */ export declare type CalendarDayWeekdayCellData = { /** * Stable key of the weekday header cell. */ key: string; /** * The weekday represented by the header cell. */ dayOfWeek: DayOfWeek; /** * The visible short weekday label, or a short month label at a month boundary in single-week view. */ label: string; /** * The full weekday or month label used as the cell's default accessible name and title. */ accessibleLabel: string; }; /** Overrides for a weekday header cell. */ export declare type CalendarDayWeekdayCellProps = { /** * Overrides for the `
`, including its visible content and accessible name. */ root?: React_2.ComponentProps<'th'>; }; /** * Event data for dismissing the Calendar. */ export declare type CalendarDismissData = EventData<'click' | 'keydown', React_2.SyntheticEvent>; /** * Formatters used for calendar display values and accessibility labels. */ export declare type CalendarFormatters = { /** * Label for the button that navigates to today. */ goToTodayLabel: () => string; /** * Label for the button that closes the calendar. */ closeLabel: () => string; /** * Formats a date according to the specified format. */ dateTime: (data: { date: Date; format: CalendarDateTimeFormat; }) => string; /** * Formats the label for the previous month button. */ previousMonthLabel: (data: CalendarDateLabelData) => string; /** * Formats the label for the next month button. */ nextMonthLabel: (data: CalendarDateLabelData) => string; /** * Formats the label for the previous year button. */ previousYearLabel: (data: CalendarDateLabelData) => string; /** * Formats the label for the next year button. */ nextYearLabel: (data: CalendarDateLabelData) => string; /** * Formats the label for the previous year range button. */ previousYearRangeLabel: (data: CalendarYearRangeLabelData) => string; /** * Formats the label for the next year range button. */ nextYearRangeLabel: (data: CalendarYearRangeLabelData) => string; /** * Formats the label for the month picker header. */ monthPickerHeaderLabel: (data: CalendarDateLabelData) => string; /** * Formats the label for the day picker header. */ dayPickerHeaderLabel: (data: CalendarDateLabelData) => string; /** * Formats the label for the year range picker header. */ yearRangePickerHeaderLabel: (data: CalendarYearRangeLabelData) => string; /** * Formats the label for the week number column header. */ weekNumberLabel: (data: { weekNumber: number; }) => string; /** * Formats the label for the selected date. */ selectedDateLabel: (data: CalendarDateLabelData) => string; /** * Formats the label for today's date. */ todayDateLabel: (data: CalendarDateLabelData) => string; /** * Formats the label for a marked day. */ dayMarkedLabel: (data: CalendarDateLabelData) => string; }; /** * Default calendar formatters. */ export declare const calendarFormatters: CalendarFormatters; /** * One row of the month or year grid. */ export declare type CalendarGridRow = { /** Stable key of the row. */ key: number; /** Semantic cells in display order. */ cells: TCell[]; }; /** Controls how the day and month pickers are arranged. */ export declare type CalendarLayout = 'sideBySide' | 'overlay'; /** * CalendarMonth shows the months of the navigated year, and opens the year picker from its header. */ export declare const CalendarMonth: ForwardRefComponent; /** * Semantic month data stored in the grid and passed to cell getters, without DOM props. */ export declare type CalendarMonthCellData = { /** * Index of the month within the year, matching `Date.prototype.getMonth()`. */ index: number; /** * The formatted short month name displayed in the cell. */ label: string; /** * Whether this month is the grid's initial focus target, falling back to an available month when needed. */ isNavigated: boolean; /** * Whether this month matches today's month and year, independently of consumer styling. */ isCurrent: boolean; /** * Whether this is the selected month. */ isSelected: boolean; /** * Whether this month can be selected. */ isInBounds: boolean; }; /** Overrides for a month gridcell and its nested button. */ export declare type CalendarMonthCellProps = { /** * Overrides for the `
`. */ root?: Omit, 'children'>; /** * Overrides for the nested month button. Set `children` to customize the month content. */ button?: React_2.ComponentProps<'button'>; }; /** * The imperative API exposed through CalendarMonth's `imperativeRef` prop. */ export declare type CalendarMonthHandle = { /** * Moves focus to the navigated month (or the first available month if it is disabled), * or to the year picker while it is open. */ focus(options?: FocusOptions): void; /** * Replaces the month grid with the year picker and moves focus into it. Does nothing when `yearPickerHidden` is set. */ showYearPicker(): void; }; /** * Data describing activation of the month picker's heading or a month selection that returns to the day view. */ export declare type CalendarMonthHeaderSelectData = EventData<'click' | 'keydown', React_2.SyntheticEvent>; /** * Data describing a request to navigate the month picker. */ export declare type CalendarMonthNavigateData = EventData<'click' | 'keydown', React_2.SyntheticEvent> & { /** * The date to navigate to. */ date: Date; /** * Whether focus should move into the day grid after navigation. */ focusOnNavigatedDay: boolean; }; /** * Props for the month picker. Shared selection, boundaries, and formatting come from CalendarProvider. */ export declare type CalendarMonthProps = ComponentProps> & { /** * Provides access to the picker's focus handle. The regular `ref` points to the root element. */ imperativeRef?: React_2.Ref; /** * The currently navigated date */ navigatedDate?: Date; /** * The date whose month is selected and whose year is selected in the year picker. * Defaults to the Calendar's selected value, or today when that value is undefined. * Set to null for an empty selection. */ selectedDate?: Date | null; /** * Overrides each month gridcell and its nested button. Use button.children to customize its content. * Receives semantic month data and a formatted label, not DOM props. * Refs are composed, class names appended and styles merged. * Defined consumer props override defaults, including roles, focus, disabled/selection state and data attributes. * Consumers are responsible for preserving accessibility and interaction semantics when overriding these props. * Handlers run before the delegated grid behavior; preventDefault cancels selection. * Called when the renderer resolves the cell's props, not while the hook builds its data. */ getCellProps?: (month: CalendarMonthCellData) => CalendarMonthCellProps; /** * Overrides each row's default props, including its role and focus attributes, without replacing its cells. * Receives semantic row and month data. Called when the renderer resolves the row's props. */ getRowProps?: (row: CalendarMonthRowData) => CalendarMonthRowProps; /** * Called when a month is selected. The date is an available day in that month and the range * follows the CalendarProvider configuration. Year navigation does not select a month. */ onSelectDate?: EventHandler; /** * Called when month or year navigation is requested. The event data includes the destination date * and whether focus should move into the day grid. */ onNavigateDate?: EventHandler; /** * Called when the heading is activated while the year picker is hidden, or when a month is selected * to return to the day view. */ onHeaderSelect?: EventHandler; /** * Whether the year picker is hidden * @default false */ yearPickerHidden?: boolean; }; /** Semantic month row passed to getters, without DOM props on the row or its cells. */ export declare type CalendarMonthRowData = CalendarGridRow; /** Overrides for a month row. */ export declare type CalendarMonthRowProps = { /** * Overrides for the row's `
`. Its month cells remain controlled by the renderer. */ root?: React_2.ComponentProps<'div'>; }; /** * Data describing a month selection and its bounded, unrestricted date range. */ export declare type CalendarMonthSelectData = EventData<'click' | 'keydown', React_2.SyntheticEvent> & { /** * An available day in the selected month, preserving the navigated day of the month when possible. */ date: Date; /** * The dates selected for the configured range, excluding restricted and out-of-bounds dates. */ selectedDateRange: Date[]; }; /** * Slots rendered by the month picker. */ export declare type CalendarMonthSlots = { /** * The outer container of the month picker. */ root: NonNullable>; /** * Holds the year title and the navigation buttons. */ header: NonNullable>; /** * The year label, which opens the year picker when it is not hidden. */ heading: NonNullable>; /** * Wraps the previous and next year buttons. */ navigation: NonNullable>; /** * The button to navigate to the previous year. */ previousYearButton: NonNullable>; /** * The button to navigate to the next year. */ nextYearButton: NonNullable>; /** * The grid holding the month rows, with a roving tab stop and arrow, Home and End navigation. */ grid: NonNullable>; /** * The year picker, which replaces the whole month picker while it is open. Only rendered while * `isYearPickerVisible` is set. */ yearPicker: NonNullable>; }; /** * Resolved slots, semantic grid data and on-demand prop getters used to render the month picker. */ export declare type CalendarMonthState = ComponentState & { /** * When the year picker is open, CalendarMonth renders CalendarYear instead of its own grid. */ isYearPickerVisible: boolean; /** * Semantic month data grouped into rows of three, without HTML prop bags. */ monthRows: CalendarMonthRowData[]; /** * Resolves built-in HTML props and consumer overrides for a month without modifying its data. * Calls the consumer's `getCellProps` callback. * @param month - A month from a row in `monthRows`. * @returns Props for the month gridcell and its nested button. */ getMonthCellProps: (month: CalendarMonthCellData) => Required; /** * Resolves built-in HTML props and consumer overrides for a row without modifying its data. * Calls the consumer's `getRowProps` callback. * @param row - A row from `monthRows`. * @returns Props for the row element. */ getMonthRowProps: (row: CalendarMonthRowData) => Required; }; /** Event data reported when the displayed date changes through user interaction. */ export declare type CalendarNavigateData = EventData<'click' | 'keydown', React_2.SyntheticEvent> & { /** The date displayed by the calendar. */ displayedDate: Date; }; /** * Props for the Calendar component. */ export declare type CalendarProps = DistributiveOmit>, 'defaultValue'> & { /** * Callback for when a date is selected * @param date - The date the user selected * @param selectedDateRange - The resultant list of dates that are selected based on the date range type set * for the component. */ onSelectDate?: EventHandler; /** * Callback for when calendar is closed */ onDismiss?: EventHandler; /** * The selected date. `null` represents an explicitly empty controlled selection. * A value outside `minDate`/`maxDate` renders as an empty selection and warns in development. */ value?: Date | null; /** The initial selected date when uncontrolled. `null` starts with no selection. */ defaultValue?: Date | null; /** The displayed date, controlled independently of value. When omitted, external value changes navigate automatically. */ displayedDate?: Date; /** The initial displayed date when uncontrolled. */ defaultDisplayedDate?: Date; /** Called once per user navigation or selection action. External prop changes do not fire this callback. */ onDisplayedDateChange?: EventHandler; /** The active picker in an overlay layout. */ view?: CalendarView; /** The initial active picker when uncontrolled. */ defaultView?: CalendarView; /** Called when user interaction changes the active picker. */ onViewChange?: EventHandler; /** * How the day and month pickers are arranged. Consumers control responsive layout changes. * @default 'sideBySide' */ layout?: CalendarLayout; /** * Value of today. If unspecified, the current time on the client machine is used. Pass this explicitly * while server rendering to keep the server and client calendars consistent. */ today?: Date; /** * The date range type indicating how many days should be selected as the user * selects days * @default 'day' */ dateRangeType?: DateRangeType; /** * The first day of the week for your locale. * @default 'sunday' */ firstDayOfWeek?: DayOfWeek; /** * Defines when the first week of the year should start. * @default 'firstDay' */ firstWeekOfYear?: FirstWeekOfYear; /** * Whether the calendar should show the week-of-year number before each week row. * @default false */ showWeekNumbers?: boolean; /** * Overrides date and accessibility label formatters. Omitted formatters use the defaults. */ formatters?: Partial; /** * If set the Calendar will not allow navigation to or selection of a date earlier than this value. */ minDate?: Date; /** * If set the Calendar will not allow navigation to or selection of a date later than this value. */ maxDate?: Date; /** * If set the Calendar will not allow selection of dates in this array. */ restrictedDates?: Date[]; /** * The days that are selectable when `dateRangeType` is `workWeek`. * If `dateRangeType` is not `workWeek` this property does nothing. * @default ['monday', 'tuesday', 'wednesday', 'thursday', 'friday'] */ workWeekDays?: DayOfWeek[]; /** * Allows all dates and buttons to be focused, including disabled ones * @default false */ allFocusable?: boolean; /** * Number of columns in the month picker. * @default 4 */ calendarMonthColumns?: 3 | 4; /** * Number of columns in the year picker. * @default 4 */ calendarYearColumns?: 3 | 4; }; /** Provides shared configuration to standalone Calendar pickers and grids. */ export declare const CalendarProvider: React_2.Provider; /** * Event data for a date selection. */ export declare type CalendarSelectDateData = EventData<'click' | 'keydown', React_2.SyntheticEvent> & { /** * The date selected by the user. */ date: Date; /** * Dates selected according to the configured range type. */ selectedDateRange: Date[]; }; /** * Slots available to the Calendar component. */ export declare type CalendarSlots = { /** * Root container. */ root: NonNullable>; /** * Announces the selected date to assistive technology. */ liveRegion: NonNullable>; /** * The day picker. Set to `null` to select months without showing the day picker. */ dayPicker?: Slot; /** * Separates the day picker from the month picker when both are visible. */ divider: NonNullable>; /** * Wraps the month picker. */ monthPickerWrapper: NonNullable>; /** * The month picker. Set to `null` to show only the day picker. */ monthPicker?: Slot; /** * The "go to today" button, rendered as the root's last child. * Use CSS to position it below either picker or across the full width. Set to `null` to hide it. */ goToTodayButton?: Slot<'button'>; }; /** * State used to render the Calendar component. */ export declare type CalendarState = ComponentState & CalendarContextValue & { /** * Whether the day picker is rendered. */ isDayPickerVisible: boolean; /** * Whether the month picker is rendered. */ isMonthPickerVisible: boolean; }; /** Picker views available when Calendar uses an overlay layout. */ export declare type CalendarView = 'day' | 'month'; /** Event data reported when user interaction changes the active overlay view. */ export declare type CalendarViewChangeData = EventData<'click' | 'keydown', React_2.SyntheticEvent> & { /** The active picker when the calendar uses an overlay layout. */ view: CalendarView; }; /** * CalendarYear shows a range of years and lets the user pick one. */ export declare const CalendarYear: ForwardRefComponent; /** * Semantic year data stored in the grid and passed to cell getters, without DOM props. */ export declare type CalendarYearCellData = { /** * The numeric year represented by the cell. */ year: number; /** * Formatted year label. */ label: string; /** * Whether this is the current year. */ isCurrent: boolean; /** * Whether this is the selected year. */ isSelected: boolean; /** * Whether this is the focus target in the displayed range. */ isNavigated: boolean; /** * Whether this year cannot be selected. */ isDisabled: boolean; }; /** Overrides for a year gridcell and its nested button. */ export declare type CalendarYearCellProps = { /** * Overrides for the `
`. */ root?: Omit, 'children'>; /** * Overrides for the nested year button. Set `children` to customize the year content. */ button?: React_2.ComponentProps<'button'>; }; /** * The imperative API exposed through CalendarYear's `imperativeRef` prop. */ export declare type CalendarYearHandle = { /** * Focuses the navigated year, or the selected/current year when navigation is unspecified, * within the focusable visible range. */ focus(options?: FocusOptions): void; }; /** * Data describing activation of the year-range heading. */ export declare type CalendarYearHeaderSelectData = EventData<'click' | 'keydown', React_2.SyntheticEvent> & { /** * Whether focus should move to the parent picker when returning from the year view. */ focus: boolean; }; /** * Data describing navigation to another visible year range. */ export declare type CalendarYearNavigateData = EventData<'click' | 'keydown', React_2.SyntheticEvent> & { /** * The first year of the destination range. */ year: number; }; /** * Props for the year picker. Shared selection, boundaries, and formatting come from CalendarProvider. */ export declare type CalendarYearProps = ComponentProps> & { /** * Provides access to the picker's focus handle. The regular `ref` points to the root element. */ imperativeRef?: React_2.Ref; /** * The currently navigated year. Takes precedence over selectedYear for the displayed range and focus. */ navigatedYear?: number; /** * The highlighted year. Initializes the displayed range and focus only when navigatedYear is omitted. * Defaults to the year of the Calendar's selected value. Set to null for an empty selection. */ selectedYear?: number | null; /** * Overrides each year gridcell and its nested button. Use button.children to customize its content. * Receives semantic year data and a formatted label, not DOM props. * Refs are composed, class names appended and styles merged. * Defined consumer props override defaults, including roles, focus, disabled/selection state and data attributes. * Consumers are responsible for preserving accessibility and interaction semantics when overriding these props. * Handlers run before the delegated grid behavior; preventDefault cancels selection. * Called when the renderer resolves the cell's props, not while the hook builds its data. */ getCellProps?: (year: CalendarYearCellData) => CalendarYearCellProps; /** * Overrides each row's default props, including its role and focus attributes, without replacing its cells. * Receives semantic row and year data. Called when the renderer resolves the row's props. */ getRowProps?: (row: CalendarYearRowData) => CalendarYearRowProps; /** * Called when a year is selected. The event data includes the selected year. */ onSelectYear?: EventHandler; /** * Called when navigation changes the visible twelve-year range. * The event data includes the first year of the destination range. */ onNavigateDate?: EventHandler; /** * Called when the year-range heading is activated to return to the parent picker. */ onHeaderSelect?: EventHandler; }; /** * A range of years, inclusive. */ export declare interface CalendarYearRange { /** * The first year in the range. */ fromYear: number; /** * The last year in the range. */ toYear: number; } /** * A year range and its formatted display value. */ export declare type CalendarYearRangeLabelData = { /** * The starting year of the range. */ fromYear: number; /** * The ending year of the range. */ toYear: number; /** * The formatted display value of the year range. */ formattedRange: string; }; /** Semantic year row passed to getters, without DOM props on the row or its cells. */ export declare type CalendarYearRowData = CalendarGridRow; /** Overrides for a year row. */ export declare type CalendarYearRowProps = { /** * Overrides for the row's `
`. Its year cells remain controlled by the renderer. */ root?: Omit, 'children'>; }; /** * Data describing a year selection. */ export declare type CalendarYearSelectData = EventData<'click' | 'keydown', React_2.SyntheticEvent> & { /** * The selected year. */ year: number; }; /** * Slots rendered by the year picker. */ export declare type CalendarYearSlots = { /** * The outer container of the year picker. */ root: NonNullable>; /** * Holds the year range title and the navigation buttons. */ header: NonNullable>; /** * The year range label. Renders as a `button` when `onHeaderSelect` is set, otherwise as a * plain `div`. */ heading: NonNullable>; /** * Wraps the previous and next range buttons. */ navigation: NonNullable>; /** * The button to navigate to the previous year range. */ previousRangeButton: NonNullable>; /** * The button to navigate to the next year range. */ nextRangeButton: NonNullable>; /** * The grid holding the year rows, with a roving tab stop and arrow, Home and End navigation. */ grid: NonNullable>; }; /** * Resolved slots, semantic grid data and on-demand prop getters used to render the year picker. */ export declare type CalendarYearState = ComponentState & { /** * Semantic year data grouped into rows of three, without HTML prop bags. */ yearRows: CalendarYearRowData[]; /** * Resolves built-in HTML props and consumer overrides for a year without modifying its data. * Calls the consumer's `getCellProps` callback. * @param year - A year from a row in `yearRows`. * @returns Props for the year gridcell and its nested button. */ getYearCellProps: (year: CalendarYearCellData) => Required; /** * Resolves built-in HTML props and consumer overrides for a row without modifying its data. * Calls the consumer's `getRowProps` callback. * @param row - A row from `yearRows`. * @returns Props for the row element. */ getYearRowProps: (row: CalendarYearRowData) => Required; }; /** * Creates reusable Intl formatters for every calendar date format. The defaults use en-US; pass the * desired locale to localize date labels. */ export declare function createCalendarDateTimeFormatter(locales?: string | string[]): CalendarFormatters['dateTime']; /** * The supported date range types, describing how many days are selected when the user picks a date. */ export declare type DateRangeType = 'day' | 'week' | 'month' | 'workWeek'; declare interface DayGridOptions extends RestrictedDatesOptions { /** * The first day of the week for your locale. */ firstDayOfWeek: DayOfWeek; /** * The date range type indicating how many days should be selected as the user * selects days */ dateRangeType: DateRangeType; /** * The number of days to select while `dateRangeType` is `day`. Used in order to have multi-day * views. */ daysToSelectInDayView?: number; /** * Value of today. If unspecified, current time in client machine will be used. */ today?: Date; /** * The days that are selectable when `dateRangeType` is `workWeek`. * If `dateRangeType` is not `workWeek` this property does nothing. */ workWeekDays?: DayOfWeek[]; /** * Which days in the generated grid should be marked. */ markedDays?: Date[]; /** * The currently selected date */ selectedDate?: Date | null; /** * The currently navigated date */ navigatedDate: Date; /** * How many weeks to show by default. If not provided, will show enough weeks to display the current * month, between 4 and 6 depending */ weeksToShow?: number; } export declare interface DayInfo { /** * Local year, zero-based month, and day joined with hyphens (`year-month-day`) */ key: string; /** * `Date.getDate()` value of current date */ date: string; /** * `Date` object of current date */ originalDate: Date | null; /** * Whether this cell represents a civil date that does not exist in the local timezone. */ isPlaceholder: boolean; /** * Whether the current date is in the same month as the navigated date */ isInMonth: boolean; /** * Is current date is "today" date */ isToday: boolean; /** * Whether the current date is selected in a range */ isSelected: boolean; /** * Whether the current date is selected without a range */ isSingleSelected: boolean; /** * Is current date within restriction boundaries */ isInBounds: boolean; /** * Is current date marked */ isMarked: boolean; } /** * The days of the week. */ export declare type DayOfWeek = 'sunday' | 'monday' | 'tuesday' | 'wednesday' | 'thursday' | 'friday' | 'saturday'; /** * Determines which week counts as the first week of the year. * - `firstDay` - the week containing January 1st. * - `firstFullWeek` - the first week entirely within the new year. * - `firstFourDayWeek` - the first week with at least four days in the new year. */ export declare type FirstWeekOfYear = 'firstDay' | 'firstFullWeek' | 'firstFourDayWeek'; /** * The months of the year. */ export declare type MonthOfYear = 'january' | 'february' | 'march' | 'april' | 'may' | 'june' | 'july' | 'august' | 'september' | 'october' | 'november' | 'december'; /** * Render the final JSX of Calendar. */ export declare const renderCalendar: (state: CalendarState, contextValues: CalendarContextValues) => JSXElement; /** * Render the final JSX of CalendarDay. */ export declare const renderCalendarDay: (state: CalendarDayState) => JSXElement; /** * Render the final JSX of CalendarMonth. */ export declare const renderCalendarMonth: (state: CalendarMonthState) => JSXElement; /** * Render the final JSX of CalendarYear. */ export declare const renderCalendarYear: (state: CalendarYearState) => JSXElement; declare interface RestrictedDatesOptions { /** * If set the Calendar will not allow navigation to or selection of a date earlier than this value. */ minDate?: Date; /** * If set the Calendar will not allow navigation to or selection of a date later than this value. */ maxDate?: Date; /** * If set the Calendar will not allow selection of dates in this array. */ restrictedDates?: Date[]; } /** * Creates Calendar state and resolves its headless picker slots. * @param props - Props from this instance of Calendar. * @param ref - Reference to Calendar's root element. */ export declare const useCalendar: (props: CalendarProps, ref: React_2.Ref) => CalendarState; /** Reads shared Calendar configuration from the nearest CalendarProvider, or standalone defaults. */ export declare const useCalendarContext: () => CalendarContextValue; /** * Creates state for the CalendarContextValues component. */ export declare function useCalendarContextValues(state: CalendarState): CalendarContextValues; /** * Create the state required to render CalendarDay. * Calendar owns selection, range hover, directional navigation and roving focus. */ export declare const useCalendarDay: (props: CalendarDayProps, ref: React_2.Ref) => CalendarDayState; /** * Create the state required to render CalendarMonth. * Calendar owns selection, directional navigation and roving focus. * @param props - props from this instance of CalendarMonth * @param ref - reference to the root element of CalendarMonth */ export declare const useCalendarMonth: (props: CalendarMonthProps, ref: React_2.Ref) => CalendarMonthState; /** * Create the state required to render CalendarYear. * Calendar owns selection, directional navigation and roving focus. */ export declare const useCalendarYear: (props: CalendarYearProps, ref: React_2.Ref) => CalendarYearState; export { }