import type { CSSProperties } from "react"; import { UI, DayFlag, SelectionState } from "../UI.js"; import * as components from "../components/custom-components.js"; import { formatCaption, formatDay, formatMonthCaption, formatMonthDropdown, formatWeekdayName, formatWeekNumber, formatWeekNumberHeader, formatYearCaption, formatYearDropdown } from "../formatters/index.js"; import { labelDayButton, labelNav, labelGrid, labelGridcell, labelMonthDropdown, labelNext, labelPrevious, labelWeekday, labelWeekNumber, labelWeekNumberHeader, labelYearDropdown } from "../labels/index.js"; /** * Selection modes supported by DayPicker. * * - `single`: use DayPicker to select single days. * - `multiple`: allow selecting multiple days. * - `range`: use DayPicker to select a range of days. * * @see https://daypicker.dev/docs/selection-modes */ export type Mode = "single" | "multiple" | "range"; /** * The components that can be changed using the `components` prop. * * @see https://daypicker.dev/guides/custom-components */ export type CustomComponents = { /** * Render any button element in DayPicker. * * @deprecated Use {@link CustomComponents.NextMonthButton} or * {@link CustomComponents.PreviousMonthButton} instead. */ Button: typeof components.Button; /** Render the chevron icon used in the navigation buttons and dropdowns. */ Chevron: typeof components.Chevron; /** Render the caption label of the month grid. */ CaptionLabel: typeof components.CaptionLabel; /** Render the day cell in the month grid. */ Day: typeof components.Day; /** Render the button containing the day in the day cell. */ DayButton: typeof components.DayButton; /** Render the dropdown element to select years and months. */ Dropdown: typeof components.Dropdown; /** Render the container of the dropdowns. */ DropdownNav: typeof components.DropdownNav; /** Render the footer element announced by screen readers. */ Footer: typeof components.Footer; /** Render the container of the MonthGrid. */ Month: typeof components.Month; /** Render the caption of the month grid. */ MonthCaption: typeof components.MonthCaption; /** Render the grid of days in a month. */ MonthGrid: typeof components.MonthGrid; /** Wrapper of the month grids. */ Months: typeof components.Months; /** Render the navigation element with the next and previous buttons. */ Nav: typeof components.Nav; /** Render the `