Calendar component contract¶
Contract at a glance¶
| Area | Contract |
|---|---|
| Public contract | Calendar and CalendarProps are exported from @astryxdesign/core/Calendar; mode selects a single date or a range, with value/defaultValue/onChange, bounds, constraints, span limits, focus date, display options, and an optional calendar (CalendarSystem). Every value stays a Gregorian ISO date. The public useCalendarDays and useCalendarNavigation hooks take an optional calendar too (FR11). |
| Behavior | One or two months of the resolved calendar system render as day grids under weekday headers (DD1); a day is picked by pointer or keyboard; each month grid holds at most one roving Tab stop, which arrow, Home/End, and Page keys move, following the reading direction. Page keys step calendar months, and with Shift calendar years. |
| End-user impact | A keyboard or screen-reader user meets a named month grid, moves through it by day, week, and month (and year with Shift and a Page key), and hears each day's name, selection, today marker, and disabled state, in the calendar the application chose. |
| Builder impact | Optional: set calendar on the Calendar or its provider; for a calendar that needs Temporal, load a polyfill where the runtime lacks it. |
| Compatibility/readiness | The calendar prop is additive and the default stays Gregorian. A provider locale with a -u-ca- keyword keeps Gregorian dates (spec:AST-111 DEC-2); set calendar to choose one. Calendars that need Temporal fall back to Gregorian where it is missing (the spec:AST-013 FR12 exception). The month buttons use native disabled at a bound and scale under reduced motion, a key-moved Tab stop can go stale, and the Calendar grows wider than a phone screen at the largest text sizes; all are listed under Current-state impact. |
| Review checks | Reject a day grid without role="grid" or a name, two days in one month holding a Tab stop, an arrow key that stops following the reading direction, a selection or today state carried only by colour, a weekday header cut to a fixed number of characters, or a header row mixing abbreviated and short names. |
| Governing rules | DD1 for the weekday headers; architecture:public-component-api/INV1,INV5–INV8; architecture:component-theming-surface/INV3–INV7; spec:AST-020/FR15; spec:AST-085/FR1, FR4; spec:AST-102 FR4; spec:AST-111 FR1–FR8, FR20, AR1; spec:AST-013 FR12; design:bidirectionality DR6; design:reduced-motion DR1; architecture:internationalization INV8. |
This table is a review projection; the body below is authoritative.
Intent¶
Calendar lets a person pick a date or a date range by looking at whole months. It owns the month grid, its navigation, selection and range semantics, and the keyboard model that moves through days; date fields compose it.
Compatibility and migration¶
- Released default preserved:
yes— without acalendarprop or a provider calendar, the grid shows Gregorian months — except DD1:no, since Calendars in locales whose abbreviated names fit (English among them) show those names, with no prop to keep the short names - Compatibility class: additive optional
calendarprop and hook option; no default, export, or DOM structure change; the weekday header text follows DD1. A provider locale with a-u-ca-keyword keeps Gregorian dates (spec:AST-111DEC-2); setcalendarto choose one - Controlled/uncontrolled behavior:
valuewithonChangeis controlled;defaultValuestarts internal state - Migration decision: none
Consumer migration instructions belong in consumer docs and release notes.
Ownership boundary¶
Owns
- The month grid: its weekday column headers, week rows, day cells, outside days, week numbers, and variable row count.
- Month navigation, the focused day, and the keyboard model that moves it.
- The calendar months it lays out, their labels, and month and year steps in the resolved calendar system.
- Single and range selection semantics, bounds, constraints, and span limits.
Does not own / non-goals
- The text field, popover, and bottom sheet that present a Calendar — owned by DateInput and its siblings.
- Time of day — owned by DateTimeInput.
- Calendar resolution and the
Temporalboundary — owned byspec:AST-111FR1, FR2, and FR5; calendar arithmetic — owned byTemporal. handleRef,onFocusDateChange, the opening month inside themin/maxwindow,weekStartsOn, andnumberOfMonthsclamping — shipped and covered by the consumer docs and tests, uncontracted here beyond FR1–FR7.
Public concepts¶
| Concept | Closed values or states | Meaning | Availability by variant/orientation/state | Default | Owner | Stability | Invalid-value behavior |
|---|---|---|---|---|---|---|---|
mode |
single, range |
Whether one date or a start–end pair is picked. | Always | single |
component:Calendar |
stable | Type-rejected |
| Focused day | one visible day | The day whose button holds the grid's Tab stop. | Always | selected day (single) or today when it is in that month and enabled, else the month's first enabled day (AR1) |
component:Calendar |
stable | Clamped to the visible range |
| Day state | selected, in range, today, disabled, outside | What a day cell exposes and paints. | Per cell | none | component:Calendar |
stable | Not applicable |
calendar |
a CalendarSystem (spec:AST-111 FR1) |
The calendar system whose months the grid shows. | Always | the provider's resolved calendar, else gregory (spec:AST-111 FR2) |
spec:AST-111 |
stable | Resolves to gregory and warns once in development |
Behavioral and layout contract¶
| ID | Invariant | Basis |
|---|---|---|
| FR1 | Each rendered month is one role="grid" named for its month and year, with a columnheader per weekday (and, with week numbers, a named columnheader above the rowheader column) and one row per week. Month and year labels and weekday names (DD1) come from the provider locale. A month label that stands alone (the header, each grid's name, and useCalendarNavigation's monthYearLabel) starts with a capital where CLDR's stand-alone context transform titlecases the month (titlecase-firstword); in a two-month view each month's label does. Day and week numbers MUST use the locale's digits (architecture:internationalization INV8). |
shipped source and focused tests; architecture:internationalization INV8 |
| FR2 | At most one day button in each month's grid holds tabIndex={0}; every other day button in that grid is -1. Each day button is the shared sm element size (inside an md-sized cell) as a minimum that grows with a set text size (spec:AST-102 FR4). |
shipped useGridFocus behavior; Calendar.test.tsx single-Tab-stop assertion; spec:AST-102 FR4 |
| FR3 | A disabled day (outside bounds or rejected by a constraint) stays in the grid, stays focusable with aria-disabled and no native disabled, never holds the grid's Tab stop, and cannot be picked. Implementation gap: once a key move (arrow, Home, End, or Page key) has placed the Tab stop, it stays on that day when every day of the month becomes disabled (for example a range span cap in a two-month view). |
spec:AST-085 FR1, FR2; shipped source and focused tests |
| FR4 | In range mode the first pick starts the range and the second ends it, a second pick before the start swapping the two so the end never precedes the start; minRangeSpan/maxRangeSpan bound it. Escape, or picking the start day again when minRangeSpan is above 1, clears an in-progress range. |
shipped source and focused tests |
| FR5 | Moving the focused day across a month boundary navigates the visible month so the focused day stays visible, in one month or two; a borrowed adjacent-month day is exposed aria-disabled and cannot be picked; arrow keys, Home and End skip it, and a page never lands on it. |
shipped source and focused tests |
| FR6 | The month header shows the month and year between Previous and Next month buttons (ghost, icon-only Buttons whose chevrons mirror under RTL), which carry calendar-nav with data-nav and data-disabled. A button whose direction would leave min or max MUST stay focusable with aria-disabled, change nothing, and keep focus (spec:AST-085 FR1, FR4). Implementation gap: it is natively disabled, so a focused button that reaches the bound drops focus. The month buttons are component:Buttons, so their press scale MUST NOT apply under reduced motion (design:reduced-motion DR1). Implementation gap: it still applies under reduced motion. |
spec:AST-085; shipped source and focused tests; design:reduced-motion DR1 |
| FR8 | The grid shows the months of the resolved calendar system (spec:AST-111 FR2). Each grid lays out one calendar month: its first day sits in its weekday column and outside days fill the other cells. The default grid has six rows for every month, including the five- or six-day thirteenth month of the Coptic and Ethiopic calendars; hasVariableRowCount gives each month only the rows it needs. A leap month is a distinct month with its own name. The month heading, each grid's name, day-button names, and announcements use the calendar, and day numbers are the calendar's days in the locale's digits. Every name gives the month and day that the grid shows, and iso8601 uses the Gregorian month names. value, min, max, focusDate, and every callback stay Gregorian ISO dates in every calendar. |
spec:AST-111 FR3, FR4, FR6; Temporal month structure |
| FR9 | Previous and Next move one calendar month. PageUp and PageDown move the focused day one calendar month, keep its day of the month, and clamp it to the target month's length. Shift+PageUp and Shift+PageDown move the focused day one calendar year, to the same month of that year; a leap month that the target year does not have becomes its common counterpart (Adar I becomes Adar). In the Gregorian calendar a year step lands on the same day one year away, clamped. min and max bound navigation by day in every calendar, and a year step meets them and constraints as a month step does (AR1). |
spec:AST-111 FR7; APG date picker dialog keyboard model |
| FR10 | hasWeekNumbers shows ISO 8601 week numbers in every calendar. Each row shows the ISO 8601 week number of its Thursday, the ISO week that holds most of its days. |
spec:AST-111 FR8 |
| FR11 | The public useCalendarDays and useCalendarNavigation hooks take an optional calendar that defaults to gregory, and they never read the provider's calendar. With a calendar, useCalendarDays reads year and month as the calendar's year and the month's position in that year, as Temporal.PlainDate numbers them (1 through 13 in a Hebrew leap year); each day keeps its Gregorian date, and dayNumber is its day of the calendar month. useCalendarNavigation steps calendar months, writes monthYearLabel as the month header writes it, and reports each visible month in the calendar's numbers as visibleCalendarMonths, which useCalendarDays reads with the same calendar. baseMonth and visibleMonths stay the Gregorian first day of each month. Without calendar, both hooks show Gregorian months, exactly as with calendar: 'gregory'. |
spec:AST-111 FR4, FR5, FR20 |
| FR7 | When the visible month changes, by the month buttons, a Page key, an arrow across a month edge, or the handle, the new month (both months in a two-month view) is announced politely; the first render and a pick that leaves the month in place announce nothing. In range mode the first pick announces the start and prompts for an end, the second announces the completed range in chronological order, and picking the start again when minRangeSpan is above 1 announces the cleared start; Escape clears an in-progress range without an announcement. Every announcement uses the provider locale. |
shipped source and focused tests |
| FR12 | Today is the browser's local date. During server render and the render that hydrates server markup, today is unknown (spec:AST-013 FR9): no day is marked today or seeds the Tab stop, and without a focusDate or a value the month grid's space is reserved but empty (exactly, with the default six-row grid), with an empty month label and both month buttons unavailable. The next render shows today and, without them, its month, with no month announcement. |
Allowed variation¶
- AV1 — Month layout. Row count, outside days, and week numbers may vary by props without changing FR1–FR5.
- AV2 — Internal state. The focused-day and selection state may be stored in any private shape.
Representative states¶
| State | Required invariant | Allowed variation |
|---|---|---|
| single, nothing picked | Today holds its month's Tab stop when it is enabled, otherwise the month's first enabled day does; no day is selected. | Month shown. |
| single, picked | The selected day is exposed as selected and holds the Tab stop. Implementation gap: after a key move places the stop, a later pointer pick can leave it there, always when the picked day comes later in the grid. | Month shown. |
| range, in progress | The start is selected; hovered days preview the range. | Pointer position. |
| two months | Both grids are named; at most one Tab stop in each. | Which month is first. |
| bounded | Days outside min/max are disabled. |
Which days. |
Transformation and precedence order¶
- ORD1 — Pick. Disabled check → mode-specific selection update →
onChange. - ORD2 — Focus movement. Key → reading-direction mapping → target day → month navigation if needed → focus.
Performance and resources¶
- PR1 — Render-owned grid. Day cells render from props and state; focus movement reads the grid's cells on demand; day buttons share the press controller's window and document listeners; Calendar owns no observer.
Accessibility contract¶
- AR1 — The day grid adopts the APG Grid pattern (
spec:AST-020/FR15), as one composite control: each month isrole="grid"with an accessible name, weekdaycolumnheadercells, weekrows, and daygridcells that carryaria-selectedwhen selected or in range and hold onebuttonnamed by the full date plus its selection or range role (selected, range start, range end, or in range), which exposesaria-current="date"for today andaria-disabledwhen disabled; one day button holds the Tab stop — the selected day insinglemode when it is in that month and enabled, else today when it is in that month and enabled, else the month's first enabled day; a month with no enabled day has no Tab stop. Implementation gap: once a key move (arrow, Home, End, or Page key) has placed the stop, a later pointer pick can leave it there (always when the picked day comes later in the grid), and when every day of that month becomes disabled it stays on a disabled day. ArrowLeft and ArrowRight move by a day following the reading direction (design:bidirectionalityDR6), ArrowUp and ArrowDown by a week, Home and End to the first and last enabled day of the week, PageUp and PageDown by a calendar month, Shift+PageUp and Shift+PageDown by a calendar year (a named exception, as in the APG date picker dialog; a day the target month lacks clamps to its last day; FR9), and Enter or Space picks the focused day; an arrow skips a day disabled by a constraint and continues in the same direction, crossing the month edge when it must; an arrow or Page key whose target lies pastminormaxchanges nothing and keeps focus where it is, and so does an arrow whose direction has no enabled day within a year; a page onto a day disabled by a constraint focuses that month's first enabled day instead, and changes nothing when that month has no enabled day. Spoken dates (day-button names, grid names, and announcements) use the calendar that the grid shows (spec:AST-111AR1).
Design relationships¶
design:bidirectionality DR6 governs the arrow-key direction (AR1), and
design:reduced-motion governs the month buttons' press scale (FR6).
| Anatomy or state | Design requirement | Representation authority | Hierarchy role | Component contract |
|---|---|---|---|---|
| Calendar root | Holds the header and the grid; carries the component's theming target. | Current source and public docs | Supporting | FR1 |
| Month header | Names the month and offers previous/next navigation. | Current source and public docs | Supporting | FR1, FR5, FR6 |
| Day button | The control a date is picked with; carries the day target. | Current source and public docs | Prominent | FR2, FR3, AR1 |
| Day grid | Presents the weeks and days as a named grid under weekday headers. | Current source and public docs; weekday header form: owner choice (DD1) | Prominent | FR1, FR2, AR1, DD1 |
| Selected day | Marks the chosen day or range without relying on colour alone. | Current source and public docs | Prominent | FR4, AR1 |
| Today marker | Marks today distinctly from selection. | Current source and public docs | Supporting | AR1 |
Design decisions¶
| ID | Decision | Intent or reason | Applies to | Allowed variation |
|---|---|---|---|---|
| DD1 | A locale's weekday column headers show its stand-alone abbreviated weekday names (the CLDR abbreviated width) when every one of the seven is at most four characters, and its stand-alone short names (the CLDR short width) otherwise; names are shown whole. English shows Sun to Sat; for example pt-PT, ar, he, pl, da, and vi keep their short names. A locale with no shipped weekday data shows the abbreviated names its platform formats when all seven are at most four characters, and its platform's narrow names otherwise. |
Three letters read at a glance; two-letter names make Tu and Th, or Sa and Su, easy to confuse. Longer abbreviated names crowd, overlap, or wrap in the md-sized header column, so those locales keep the short form. Rejected: cutting a longer name to three characters, which misnames days in locales whose abbreviations differ. |
Weekday headers of every month grid, in one- and two-month views, with or without week numbers, for every locale and weekStartsOn |
Header typography and colour. The choice is per locale, so one header row never mixes abbreviated and short names; characters are user-perceived characters. |
Theming anatomy¶
{
"Calendar root": {"target": "calendar"},
"Month header": {"target": "calendar-nav"},
"Day grid": {
"none": {
"reason": "reachability-gap: No current public target reaches the grid element itself; `calendar` paints the root and `calendar-day` the day buttons."
}
},
"Day button": {"target": "calendar-day"},
"Selected day": {"inherits": "calendar-day"},
"Today marker": {"inherits": "calendar-day"}
}
calendar is carried by the root element, calendar-nav by the previous and
next month buttons inside the Month header, and calendar-day by each day
button.
Family and system relationships¶
spec:AST-020/FR15decides which APG parts a component adopts; the day grid adopts the Grid pattern because it already acts as one composite control.spec:AST-085owns disabled focusability; days meet it and the month buttons do not (FR6).component:Buttonrenders the month buttons.spec:AST-111owns calendar selection, the supported calendars, Gregorian ISO values, and theTemporalboundary; FR8–FR10 and AR1 project its FR4, FR6–FR8, and AR1 onto the grid.component:DateInput,component:DateRangeInput, andcomponent:DateTimeInputpass their popover Calendar the calendar their field text uses (component:DateInputFR20,component:DateRangeInputFR6).
spec:AST-013 FR12 exception — calendars that need Temporal¶
- Capability: calendars other than the Gregorian, Buddhist, Minguo, and
Japanese calendars, which need the runtime's
Temporal. - Reduction: where
Temporalis missing or does not support the calendar, as in Safari on macOS and iOS, such a calendar resolves togregorybefore the first render and warns once in development, on the server and in the browser, namingtemporal-polyfill/full/global(spec:AST-111FR5). An application that loads aTemporalpolyfill gets the full calendar. A server withoutTemporalrenders Gregorian markup, which a browser withTemporaldoes not match, so a server-rendered application loadsTemporalon the server too. Month starts in the Chinese and Dangi calendars follow the runtime'sTemporal; a server and a browser whose implementations disagree on a month start render that month differently, and React renders it again on the client during hydration (spec:AST-111FR19). Day and month names follow the month and day that the grid shows in every case. - Preserved obligations:
spec:AST-013FR7 and FR8, and FR9 whenever the server and the browser resolve the calendar the same way, outside the case of the Chinese and Dangi calendars. The Gregorian grid keeps the primary task, accessibility, Gregorian ISO values and callbacks, and repeated use; nothing throws; a server and a browser that both haveTemporal, or both lack it, render the same markup. - Evidence: real Chromium and Firefox with native
Temporal, withTemporalremoved and a polyfill loaded, and withTemporalremoved and no polyfill; server render and hydration withTemporalon both sides, on neither side, and on the browser only. - Owner:
nynexman4464. - Review condition: Safari ships
Temporal.
Verification map¶
| Contract | Verification | Representative states | Mutation or failure expectation | Audit section |
|---|---|---|---|---|
| FR1–FR5 | Calendar.test.tsx structure ("renders a valid APG grid: one grid, header row of columnheaders inside it, week rows of gridcells", "with week numbers, the header row's corner cell is a named columnheader, so every row child is a grid cell"), locale digits ("shows day and week numbers in the locale digits in %s" for fa-IR, ar-EG, and en), selection ("handles reverse range selection (end before start)", "caps the range highlight next to a disabled mid-range day (#2715)", "Escape cancels range selection in progress", "clears the in-progress start when the anchor is clicked again"), bounds ("prev button is disabled when focusDate month contains min", "next button is disabled when focusDate month contains max"), and navigation ("navigates to next month", "calls onFocusDateChange when navigating") suites |
single, range, two months, bounded | A missing header row, a reverse pick that does not swap, a range highlight that reaches a disabled day, or a Previous/Next button enabled past min/max fails. Day or week numbers in Latin digits under fa-IR or ar-EG fail. |
audit:Calendar/behavior |
| AR1 | Calendar.test.tsx ("has accessible grid structure", "sets aria-multiselectable on both grids in a two-month range view", "does not set aria-multiselectable in single mode", "announces the new month politely when clicking next", "displays day names") and useGridFocus.test.tsx ("ArrowDown moves the tab stop one row down", "flips ArrowLeft/ArrowRight under RTL"); Calendar.test.tsx "ArrowUp skips a disabled cell in the same column to the next enabled row (complex-2)" for the disabled-day skip; Calendar.test.tsx Page-key cases ("moves the focused day by a month with PageDown and PageUp, into the month now shown", "pages from a borrowed adjacent-month day onto the real day in the month already shown", "an arrow past max changes nothing and leaves no pending target behind", "a page into a month with no enabled day changes nothing and keeps focus", "a page onto a day disabled by a constraint moves the month and focuses its first enabled day", "a page whose target lies past max changes nothing and keeps focus", "in a two-month view a boundary blocks only out-of-range targets, not month movement", "in a two-month view PageDown from the second month moves both months and a later Next click selects no stale day", "moves the focused day by a year with Shift+PageDown and Shift+PageUp", "a year from February 29 lands on February 28", "a year step whose target lies past max changes nothing and keeps focus", "a year step onto a day disabled by a constraint focuses that month's first enabled day", "in a two-month view a year step forward makes the target month the second one shown"); borrowed-day cases ("skips borrowed adjacent-month days and crosses into their month instead", "in a two-month view an arrow from the first month lands on the real day, never a borrowed one", "an arrow toward a direction where every remaining day is disabled changes nothing", "an arrow resolves the next enabled day in its direction first: weekdays-only ArrowRight from Friday January 30 reaches Monday February 2", "an arrow whose next day in range does not exist changes nothing: max January 25, ArrowDown from January 21"); the single-Tab-stop assertion in the AST-085 range-cap case (FR2). Calendar.test.tsx selection-state accessible-name cases ("appends 'selected' to the selected day's button name in single mode", "marks range start, end, and in-range days in their accessible names"). Evidence gap: no Calendar-level test of Home, End, Enter, or Space; no test covers the Tab stop after a key move followed by a pointer pick or a fully disabled month |
LTR and RTL; month boundary; selected, today, disabled days | A day loses its role, name or state, two days in one month hold a Tab stop, or an arrow, Home/End, Page or activation key stops moving or picking. | audit:Calendar/accessibility |
| FR6 | Calendar.test.tsx navigation, bound, theming-target ("renders the astryx-calendar-nav target on both month-nav buttons", "reflects the disabled nav state as a data attribute at the range edges", "keeps the default nav rendering unchanged (still a ghost icon button)"), and RTL month-navigation cases |
Previous and Next; at min and max; dir="rtl" |
A button enabled past a bound, a missing calendar-nav target or state attribute, or a lost shared chevron wrapper fails. Evidence gap: no test asserts focus kept at a bound (the FR6 gap), the mirrored chevron pixels, or the press under reduced motion. |
audit:Calendar/behavior |
| FR7 | Calendar.test.tsx month-change announcement cases ("does not announce on initial render", "announces the new month politely when clicking next", "announces the next month when paging the grid with PageDown", "announces both months in a two-month view", "does not announce when selecting a date leaves the visible month unchanged") and range announcement cases ("announces the start pick and prompts for an end date", "announces the completed range in chronological order for a reverse pick") |
Month buttons, Page keys, handle; single and two months; range start, complete, cleared | A missing, extra, or out-of-order announcement fails. Evidence gap: no test reaches the cleared-start announcement (the cleared-range case sets no minRangeSpan). |
audit:Calendar/accessibility |
| FR1 (labels) | Calendar.test.tsx ("starts each stand-alone month label with a capital in %s", "leaves the month label as Intl gives it where CLDR does not capitalize in %s"), plainDate.test.ts plainDateFormatStandaloneMonthYear |
es, fr, pl, ru two-month view; vi, de, en | A lower-case stand-alone month where CLDR titlecases it, a capital where it does not, or a second month left lower case fails. | audit:Calendar/behavior |
| FR8–FR10, AR1 (calendars) | Calendar.calendarSystems.test.tsx ("lays out Aban 1405 with its calendar day numbers and labels", "keeps the fixed six-row grid", "reports a pick as a Gregorian ISO date", "steps one calendar month with Previous and Next", "pages one calendar month and clamps the day of the month", "bounds the month buttons by day", "shows ISO 8601 week numbers", "numbers Sunday-start rows like the same Gregorian rows", "writes day numbers and labels in the locale", "shows Adar I and Adar II as distinct months of a leap year", "steps a year from Adar I to Adar with Shift+PageDown, clamped", "keeps six rows for the five-day thirteenth month", "gives the thirteenth month only its rows with hasVariableRowCount", "steps a year to the same month with Shift+PageUp", "names the era of each month", "names each day by the month and day the grid shows when Intl disagrees", Gregorian year-paging cases); Calendar.test.tsx ("numbers each row by the ISO week of its Thursday" for Sunday, Monday, and Saturday starts and across a year end); Calendar.ssr.test.tsx server render and hydration with Temporal on both sides, neither side, and the browser only; calendarSystem.test.ts month structure at known dates, labels of every Gregorian-aligned calendar, and contiguity, length, and months-per-year invariants for every calendar from 1900 through 2100; i18n/__tests__/calendarSystem.test.tsx resolution order and the fallback without Temporal; real Chromium and Firefox runs with native Temporal, with a polyfill, and without Temporal |
Persian, Hebrew leap year, Ethiopic thirteenth month, Japanese era change, Chinese leap month; fa-IR digits; Sunday and Saturday week starts; no Temporal |
A month start, length, label, or step that differs from Temporal, a vanished leap month, a non-ISO value, a row not numbered by its Thursday's ISO week, or a crash or missing warning without Temporal fails. Evidence gap: no Safari or WebKit run. |
audit:Calendar/behavior |
| FR11 (hooks) | calendarHooks.calendarSystems.test.tsx ("matches the released output for %s" against a fixed copy of the Gregorian grid algorithm, "gives the same output with calendar gregory", "lays out Aban 1405 in the Persian calendar", "reads Hebrew leap-year months as Temporal numbers them", "reads the year numbers of the Buddhist and Minguo calendars", "ignores the provider calendar" for both hooks, "matches the released months and label in %s", "steps Persian months and labels them in the calendar", "steps through Adar I, Adar II, and the thirteenth month", "labels %s months as Calendar heads them", "feeds visibleCalendarMonths into useCalendarDays in %s", "fall back to Gregorian months and warn once"); the unchanged useCalendarDays.test.ts and useCalendarNavigation.test.ts |
|||
| FR12 (server) | CalendarToday.ssr.test.tsx (server markup with no today marker, a hidden grid, an empty month label and unavailable month buttons; no mismatch; the browser's month and today after hydration with no announcement; a two-month pick that keeps both months), getInitialFocusDate.test.ts ("waits for today when there is no focus date or value"), and the real-browser CalendarTodayHydration.interaction.browser.spec.ts over the Calendar Today Hydration fixture stories (server render on one date, hydration on the next) |
|||
| FR2 (size) | CalendarTextSize.interaction.browser.spec.ts (an enlarged day number stays inside its day button; the default size keeps the element sizes) |
— | — | audit:Calendar/layout |
| DD1 | Calendar.test.tsx ("displays day names", "uses the provider locale for weekday header names", "rotates localized day names by numeric weekday index", "shows abbreviated weekday names in a locale where all seven fit in four characters", "keeps short weekday names in %s, where an abbreviated name runs past four characters" for pt-PT and pl-PL, "shows the platform abbreviated names for a locale with no shipped weekday data" for id-ID, "shows the platform narrow names for an unshipped locale whose abbreviated names run past four characters" for sw-KE); getWeekdayHeaderNames.test.ts; scripts/generate-cldr-weekdays.test.mjs ("matches every generated locale to its pinned raw CLDR source", "picks abbreviated names only where all seven fit in four characters") |
English; a locale whose abbreviated names are all within four characters, such as fr; a locale above it, such as pt-PT or pl; weekStartsOn rotation; with week numbers |
A locale within the limit showing short names, a locale above it showing abbreviated names, a row mixing the two, or a name cut short fails. | audit:Calendar/layout |
| AR1 (browser) | Calendar.a11y.test.tsx and Calendar.a11y.chromium.spec.ts over the shared grid states |
Every representative state | A lost grid name, role, or start neighbourhood fails; browser-owned outcomes are reported. | audit:Calendar/accessibility |
| ORD1, ORD2, PR1 | ORD1 and ORD2 are covered by the FR3–FR5 and AR1 rows. Evidence gap: no test asserts the absence of per-cell listeners | — | — | audit:Calendar/behavior |
Current-state impact¶
- Width at the largest text sizes (FR2). At text sizes near 275% and 310% of the theme's sizes, such as a larger browser default font size (iOS AX4 and AX5 once text follows Dynamic Type), the Calendar grows wider than a phone screen, so the last weekday column is reached only after a sideways scroll. Each day still owns its own taps.
- Stale Tab stop (FR3, AR1). After a key move places the Tab stop, a later pointer pick can leave it there (always when the picked day comes later in the grid), and when every day of that month becomes disabled it stays on a disabled day, so Tab can land on an unselected or disabled day.
- Month buttons under reduced motion (FR6). The Previous and Next buttons
scale on a press when the person prefers reduced motion, as
component:ButtonFR15 records, againstdesign:reduced-motionDR1. - Month buttons at a bound (FR6). Previous and Next become natively
disabled at
minandmax, so a keyboard user on the button that reaches the bound loses focus, againstspec:AST-085FR1 and FR4.
Decision log¶
No component-local decision beyond DD1. The Grid adoption follows
spec:AST-020/FR15.
Open questions¶
None.
Content boundary¶
This file does not duplicate consumer prop tables or examples (Calendar.doc.mjs),
the date-field composition records, or shared theming rules. It links to their
owners.
本页原文 Markdown:在 AtomGit 查看·内容源自开源项目 as/astryx