/** * The month and year views, projected once for every renderer that draws them. * * Two renderers grew these views separately, with the same seven class names and no role between * them: a keyboard user met a grid of days in one view and a run of bare buttons in the next, with * nothing saying which month was chosen. Since a calendar is already a `grid`, so are the views that * replace it — the structure a user meets does not change with the view. */ import type { MdyPartContract } from "../contract.js"; import type { MdyCalendarViewMode } from "./calendar-view.js"; export interface MdyCalendarViewA11yOptions { /** The kind whose catalogue entry names the classes — `datepicker` or `daterange`. */ readonly kind: "datepicker" | "daterange"; readonly widgetId: string; /** * What names the view. * * Not optional: a `grid` without an accessible name is a grid a screen-reader user meets as an * unlabelled table of numbers, and the conformance kit rejects it — which is how this was caught * rather than shipped. Defaults to the field's own label, which every renderer already has. */ readonly labelledBy?: string; } /** One choosable period — a month of a year, or a year of a run. */ export interface MdyCalendarPeriodCell { /** 1–12 for a month, the year itself for a year. */ readonly value: number; readonly label: string; readonly selected: boolean; readonly disabled: boolean; readonly focused?: boolean; } /** The container of whichever view is showing, or null while the day grid is. */ export declare function projectCalendarViewA11y(mode: MdyCalendarViewMode, options: MdyCalendarViewA11yOptions): MdyPartContract | null; /** * One cell of the month or year view. * * `aria-selected` rather than a class alone: which month is chosen was carried by * `--selected` and nothing else, so it was visible and unannounced. */ export declare function projectCalendarPeriodCellA11y(mode: Exclude, cell: MdyCalendarPeriodCell, options: MdyCalendarViewA11yOptions): MdyPartContract; /** * One day of the month view. * * The sibling above covers a month and a year cell; the day had no projection at all, so three * renderers wrote its semantics by hand and answered differently. One of them said which day is * today and two said nothing — while `today` has been a declared state on this part the whole time, * so the contract named it and no renderer could be checked against it. * * **`aria-current="date"` is what says "today" to a reader.** A class marks it for the eye; a person * hearing the grid gets thirty-one numbers and no anchor without this, and today is the one date a * calendar is always asked about. * * `selected` and `disabled` come with it because they are the same cell's answers and were three * hand-written pairs before — the shape that produced a cell announced as selected in one renderer * and merely painted in another. */ export declare function projectCalendarDayCellA11y(cell: { readonly selected: boolean; readonly disabled: boolean; readonly today: boolean; readonly focused: boolean; /** Whether the day belongs to the month on screen; the neighbours either side are drawn too. */ readonly outside: boolean; }, options: MdyCalendarViewA11yOptions): MdyPartContract;