import{type TemplateResult}from'lit';import{LyraElement}from'../../../internal/lyra-element.js';import type{LyraDatePickerFirstDayOfWeek}from'../../forms/date-picker/date-picker.class.js';export interface CalendarEvent{readonly id?:string;readonly date:string|number|Date;readonly title:string;readonly color?:string;readonly data?:unknown;}export interface LyraCalendarEventMap{'lr-date-select':CustomEvent<{date:string;}>;'lr-event-select':CustomEvent<{event:CalendarEvent;}>;'lr-view-change':CustomEvent<{viewDate:string;}>;} /** The two display modes `view` accepts. */ export type CalendarView='month'|'agenda'; /** The shared closed weekday vocabulary `lr-date-picker`/`lr-date-input` already accept * (`'auto'`, then `'sun'` through `'sat'`) -- reusing {@link LyraDatePickerFirstDayOfWeek} * instead of a parallel string union. */ export type LyraCalendarFirstDayOfWeek=LyraDatePickerFirstDayOfWeek; /** `` — responsive month calendar with event markers and agenda mode. * * Month-view event markers are real buttons inside each focusable gridcell, so * keyboard users can activate individual events without switching views. * Agenda view renders the same events as full-width buttons. Early ISO dates retain their * authored local year in month rendering and navigation. Colored agenda actions keep their * foreground/background pairing during hover and press; callers remain responsible for choosing * accessible custom event colors. * * Public collection properties take bounded, detached readonly sequences. Calendar-only fields * are projected from own data descriptors once per assignment; `lr-event-select` retains the * caller's original event identity. Create a new collection and reassign it after changes; * mutating the assigned array does not update the view. * * `firstDayOfWeek` defaults to `'auto'`, deriving the week start from `effectiveLocale` (via the * shared `resolveFirstDayOfWeek()` contract also used by `lr-date-picker`/`lr-date-input`), and * also accepts one of the shared weekday-name tokens (`'sun'` through `'sat'`) for an explicit, * locale-independent week start. * * @customElement lr-calendar * @event lr-date-select - A calendar date was selected. * @event lr-event-select - An event was selected. * @event lr-view-change - The visible month changed. * @csspart header - Calendar header. * @csspart navigation - Wrapper around both month-navigation controls and the title. * @csspart nav - Either month-navigation button. * @csspart previous-button - Previous-month button. * @csspart next-button - Next-month button. * @csspart nav-glyph - The previous/next chevron glyph, mirrored under RTL. * @csspart title - The header's month/year title. * @csspart weekdays - Weekday header row. * @csspart weekday - One weekday header cell. * @csspart grid - Month grid. * @csspart week - One week row within the month grid. * @csspart day - Day cell. * @csspart date - The day-of-month number inside a day cell. * @csspart event - Event marker. * @csspart agenda - Agenda list. * @csspart agenda-event - One focusable event button in agenda view (`view="agenda"` only). * @cssprop [--lr-calendar-nav-hover-bg=var(--lr-color-brand-quiet)] - Month-navigation hover background. * @cssprop [--lr-calendar-nav-active-bg=color-mix(in oklab, var(--lr-calendar-nav-hover-bg, var(--lr-color-brand-quiet)), var(--lr-color-mix-partner) var(--lr-color-mix-active))] - Month-navigation pressed background. * @cssprop [--lr-calendar-day-hover-bg=var(--lr-color-brand-quiet)] - Day hover background. * @cssprop [--lr-calendar-day-active-bg=color-mix(in oklab, var(--lr-calendar-day-hover-bg, var(--lr-color-brand-quiet)), var(--lr-color-mix-partner) var(--lr-color-mix-active))] - Day pressed background. * @cssprop [--lr-calendar-agenda-event-hover-bg=var(--lr-color-brand-quiet)] - Agenda-event hover background override; without one, colored events retain their event fill. * @cssprop [--lr-calendar-agenda-event-active-bg=color-mix(in oklab, var(--lr-calendar-agenda-event-hover-bg, var(--lr-color-brand-quiet)), var(--lr-color-mix-partner) var(--lr-color-mix-active))] - Agenda-event pressed background override; without one, colored events retain their event fill. * @cssprop [--lr-calendar-day-min-block-size=var(--lr-size-6rem)] - Minimum block size of a day cell. * @cssprop [--lr-calendar-day-min-block-size-narrow=var(--lr-size-4rem)] - Minimum block size of a day cell once the host is narrower than 28rem. * @cssprop [--lr-calendar-day-selected-bg=var(--lr-color-brand-quiet)] - Background of a selected day cell, decoupled from the shared token also driving the nav-button/agenda-event hover background. * @cssprop [--lr-calendar-day-outside-color=var(--lr-color-text-quiet)] - Text color of an adjacent-month day cell. * @cssprop [--lr-calendar-day-outside-bg=var(--lr-color-surface)] - Background of an adjacent-month day cell. * @cssprop [--lr-calendar-day-today-outline-color=var(--lr-color-brand)] - Outline color of today's day cell. * @status stable * @since 4.0.0 */ export declare class LyraCalendar extends LyraElement{protected static readonly ownedCollectionProperties:readonly string[]; /** Each `CalendarEvent` is caller-owned data (often correlated back to a caller-side record via * `id`/`data`, or matched by reference in an imperative callback) -- only the sequence itself * is bounded/detached/frozen; the emitted `lr-event-select` detail must carry the exact object * the caller passed in `events`, not a structural clone. */ protected static readonly identityCollectionProperties:readonly string[];static styles:import("lit").CSSResultGroup[];events:readonly CalendarEvent[];value:string;viewDate:string;private _view;get view():CalendarView;set view(value:CalendarView);firstDayOfWeek:LyraCalendarFirstDayOfWeek;accessibleLabel:string;private focusedDate;private get viewStart(); /** `firstDayOfWeek` resolved into the 0–6 range `monthMatrix`/`weekdayLabels` expect -- * `'auto'`, a weekday-name token, or any other malformed token all go through the shared * `resolveFirstDayOfWeek()` contract, which derives `'auto'` from `effectiveLocale` and falls * back to Sunday (0) for anything else. */ private get normalizedFirstDayOfWeek();private changeMonth;private selectDate; /** Invalid rows are omitted; all later rendering uses the descriptor-safe projection. */ private get effectiveEvents(); /** `events` bucketed by ISO date, built once per render — the month grid reads events for each of its 42 day cells and re-renders on every roving-focus arrow-key move, so a per-cell linear scan of `events` would cost O(cells × events) per keystroke. */ private bucketEventsByDate;private weeks; /** The first and last date actually rendered by the current 6×7 grid — wider than the * visible month itself (leading/trailing days from adjacent months fill out the fixed * 42-cell layout), so both the roving-tabindex anchor and arrow-key navigation must bound * themselves against this, not just the shown month. */ private gridBounds; /** Arrow-key navigation that lands past the currently rendered 6-week grid (there is no * 7th row to step into) used to leave `focusedDate` pointing at a date with no matching * cell anywhere on screen — a keyboard dead end, since neither the roving tab stop nor the * post-move `.focus()` lookup could ever find it. Rolling the view to the target date's own * month, mirroring how `changeMonth()` already updates `viewDate`, guarantees the new grid * always contains it. */ private onDayKeyDown;private weekdays;protected updated(changed:import('lit').PropertyValues):void;render():TemplateResult;}declare global{interface HTMLElementTagNameMap{'lr-calendar':LyraCalendar;}}