Skip to content

Fix accessibility issues#414

Open
jpmckinney wants to merge 4 commits into
CivicDataLab:mainfrom
jpmckinney:fix-acc
Open

Fix accessibility issues#414
jpmckinney wants to merge 4 commits into
CivicDataLab:mainfrom
jpmckinney:fix-acc

Conversation

@jpmckinney

@jpmckinney jpmckinney commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

@vercel

vercel Bot commented Jun 22, 2026

Copy link
Copy Markdown

@jpmckinney is attempting to deploy a commit to the civicdatalab-tech's projects Team on Vercel.

A member of the Team first needs to authorize it.

jpmckinney and others added 4 commits June 22, 2026 12:04
…SelectYearCalendar

Disabled (out-of-range) month cells were only greyed via the Disabled CSS
class and silently no-oped on click, leaving screen-reader and keyboard
users with no signal that the month is unavailable. Set `aria-disabled` on
the cell button; the existing handleClick early-return already blocks
activation.

We use `aria-disabled` rather than the native `disabled` attribute on
purpose: the year grid manages a roving focus that programmatically focuses
the cell matching focusedDate as the user arrows through the months. A
native `disabled` button cannot receive focus, which would desync the focus
ring from focusedDate while traversing disabled cells. aria-disabled keeps
the cells focusable while conveying the state, per the WAI-ARIA grid pattern.

The selected month also gets a ", selected" suffix in its aria-label. That
string is consumer-translatable via a new `labels` prop (YearCalendarLabels),
following the same convention as the Table footer's `labels`/TableLabels —
it falls back to the English default when unset.

Also expose minValue/maxValue on MultiSelectYearCalendarProps — the cell's
isDisabled logic already reads them from calendar state, but they were not
part of the typed API — and add Storybook coverage for both year-calendar
variants plus a localized-labels example (the package's unit tests cannot
run: @testing-library/dom is absent from the workspace).

Unblocks IDS-DRR-Frontend ACC-005. Refs CivicDataLab/IDS-DRR-Frontend#499.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
SelectProps exposed only `helpText`, which renders visible help. A consumer
had no way to associate the control with an existing description element
(e.g. a cross-field dependency hint such as "select a district first to
enable this field") via aria-describedby without rendering visible text.

Add an optional `describedBy` prop and merge it, space-separated, with the
ids already generated for `helpText` and `error` rather than overwriting
them. No visual change when the prop is unset. Adds a Storybook story.

Unblocks IDS-DRR-Frontend ACC-003.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
YearCalendar and MultiSelectYearCalendar hardcoded English month names in
monthsObj — both the visible abbreviation ("Jan") and the full name used in
the cell aria-label ("January"). These are CLDR data that Intl already knows
for every locale, so route them through react-aria's useDateFormatter
(month: 'short' for the visible text, month: 'long' for the aria-label)
keyed off the active locale from the nearest <I18nProvider>, matching the
MultiMonthPicker i18n approach. monthsObj now carries only month numbers for
the 3x4 grid layout; names are formatted at render time.

The day is fixed to the 1st in local time (new Date(year, month - 1, 1)) to
avoid the UTC-midnight off-by-one that bit MultiMonthPicker. Adds a Storybook
story rendering the months in French via <I18nProvider>.

This leaves the consumer-supplied `labels` prop for only the genuinely
app-authored strings (e.g. "selected"), which Intl does not provide.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@jpmckinney

Copy link
Copy Markdown
Contributor Author

@Abhishekfm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ACC-005] Disabled calendar months have no aria-disabled attribute

1 participant