import "./date_calendar.css"; import type * as React from "react"; import { useRender } from "@base-ui/react/use-render"; import { type StyleProps } from "./style_props"; /** The month-navigation arrows' names, backing the `calendar` locale slice. The * month and weekday NAMES come from `Intl`, not from here. */ export interface CalendarLabels { previousMonth: string; nextMonth: string; } export type CalendarSingleValue = Date | null; export type CalendarRangeValue = { start: Date | null; end: Date | null; }; /** Day of week: 0 = Sunday, 1 = Monday, ..., 6 = Saturday */ export type DayOfWeek = 0 | 1 | 2 | 3 | 4 | 5 | 6; export type CalendarValue = TMode extends "single" ? CalendarSingleValue : CalendarRangeValue; /** The month a calendar SHOWS — the year and the 0-based month. */ export interface CalendarView { year: number; month: number; } interface CalendarBaseProps extends StyleProps { /** First day of the week (0 = Sunday, 1 = Monday, ..., 6 = Saturday). Default: 1 (Monday) */ firstDayOfWeek?: DayOfWeek; /** BCP-47 locale for weekday/month names. Defaults to the active * `LoticsLocaleProvider` locale. */ locale?: string; /** The month on screen. Uncontrolled by default; pass it WITH `onViewChange` to * drive it from outside, as a preset list does. */ view?: CalendarView; onViewChange?: (view: CalendarView) => void; ref?: React.Ref; testID?: string; render?: useRender.RenderProp; } export type CalendarProps = CalendarBaseProps & (TMode extends "single" ? { mode: "single"; value: CalendarSingleValue; onValueChange: (value: CalendarSingleValue) => void; } : TMode extends "range" ? { mode: "range"; value: CalendarRangeValue; onValueChange: (value: CalendarRangeValue) => void; } : { mode: "single" | "range"; value: CalendarSingleValue | CalendarRangeValue; onValueChange: (value: CalendarSingleValue | CalendarRangeValue) => void; }); export declare function Calendar(props: CalendarProps): React.ReactElement; export {};