import { RadiantElement } from '@ecopages/radiant'; import type { EventEmitter } from '@ecopages/radiant/tools/event-emitter'; import { type CalendarSelectionMode, type CalendarWeek } from '@/lib/intl-date'; export type RuiCalendarPageBehavior = 'visible' | 'single'; export type RuiCalendarProps = { value?: string; min?: string; max?: string; disabled?: boolean; /** BCP 47 locale tag, or comma-separated fallback list. */ locale?: string; /** @default 'single' */ selectionMode?: CalendarSelectionMode; /** Number of month grids shown side by side. @default 1 */ visibleMonths?: number; /** Whether paging moves by all visible months or one month. @default 'visible' */ pageBehavior?: RuiCalendarPageBehavior; }; export type RuiCalendarChangeDetail = { value: string; start?: string; end?: string; }; type MonthPanel = { year: number; month: number; label: string; weeks: CalendarWeek[]; }; /** * `` — locale-aware month grid(s) for picking dates. * * Supports single, multiple, and range selection. Value format: * - single: `YYYY-MM-DD` * - multiple: comma-separated ISO dates * - range: `YYYY-MM-DD/YYYY-MM-DD` * * @see https://react-aria.adobe.com/Calendar * * @element rui-calendar * * @attr {string} value - Selected date(s) in the mode-specific ISO format. Default: `''`. * @attr {string} min - Earliest selectable ISO date. Default: `''`. * @attr {string} max - Latest selectable ISO date. Default: `''`. * @attr {boolean} disabled - Disable all date selection. Default: `false`. * @attr {string} locale - BCP 47 locale tag, or comma-separated fallback list. Default: `''`. * @attr {('single'|'multiple'|'range')} selection-mode - Selection mode. Default: `single`. * @attr {number} visible-months - Month grids shown side by side. Default: `1`. * @attr {('visible'|'single')} page-behavior - Whether paging moves by all visible months or one month. Default: `visible`. * * @fires rui-change - Emitted when the selection changes; detail carries `value`, plus `start` / `end` for ranges. * * @cssclass rui-calendar - Root surface (`role="application"`). * @cssclass rui-calendar--multi - Multi-month root modifier. * @cssclass rui-calendar__months - Row of month panels. * @cssclass rui-calendar__month-panel - Single month grid column. * @cssclass rui-calendar__header - Month title row with paging controls. * @cssclass rui-calendar__nav - Prev / next month button. * @cssclass rui-calendar__nav-spacer - Placeholder where a nav button is absent. * @cssclass rui-calendar__month - Month title. * @cssclass rui-calendar__weekdays - Weekday header row. * @cssclass rui-calendar__weekday - Weekday label. * @cssclass rui-calendar__grid - Month grid (`role="grid"`). * @cssclass rui-calendar__week - Grid row. * @cssclass rui-calendar__day - Day cell button (`role="gridcell"`). * @cssclass rui-calendar__footer - Footer row with the today button. * @cssclass rui-calendar__today - "Today" jump button. * * @remarks * Arrow keys move the focused day, PageUp / PageDown page the months (Shift * adds ±12), and Enter / Space select the focused day. Disabled or out-of-range * days are skipped while navigating. */ export declare class RuiCalendar extends RadiantElement { value: string; min: string; max: string; disabled: boolean; locale: string; selectionMode: CalendarSelectionMode; visibleMonths: number; pageBehavior: RuiCalendarPageBehavior; changeEvent: EventEmitter; viewYear: number; viewMonth: number; focusedIso: string; weekdayLabels: string[]; monthPanels: MonthPanel[]; todayLabel: string; rangeAnchor: string | null; rangeHover: string | null; private get resolvedLocale(); private get pageDelta(); private get monthOptions(); private syncViewFromValue; private refreshGrid; private moveMonth; private getFlatDays; private moveFocusedDay; private isMonthVisible; /** Moves roving focus without rebuilding a grid that already contains the target day. */ private focusDayInCurrentGrid; /** Restores DOM focus after rebuilding the grid around a newly visible day. */ private focusFocusedDay; private moveFocusedMonth; private isIsoAllowed; private emitChange; private selectSingle; private selectMultiple; private selectRange; private selectIso; private previewRange; private clearRangePreview; private initialize; protected onConnected(): void; onPropsUpdated(): void; onPrevMonth(event: Event): void; onNextMonth(event: Event): void; onTodayClick(event: Event): void; onDayClick(event: Event): void; onDayPointerEnter(event: Event): void; onGridPointerLeave(): void; onDayKeydown(event: KeyboardEvent): void; private dayDataAttributes; render(): import("@ecopages/jsx").JsxRenderable; } export {};