fix(DatePicker): error handling & a11y polish#3395
Conversation
… button - Announce full weekday names in calendar headers instead of abbreviations - Associate the field label with the segment shell via aria-labelledby - Convert the presentational calendar icon to an IconButton with an openCalendarLabel translation Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
View your CI Pipeline Execution ↗ for commit 7f941b4 ☁️ Nx Cloud last updated this comment at |
|
View your CI Pipeline Execution ↗ for commit 81bac52 ☁️ Nx Cloud last updated this comment at |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3395 +/- ##
==========================================
- Coverage 90.55% 89.06% -1.50%
==========================================
Files 398 271 -127
Lines 6586 5761 -825
Branches 2131 1944 -187
==========================================
- Hits 5964 5131 -833
- Misses 613 621 +8
Partials 9 9
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Move error state to each DatePickerInput so start/end inputs in range mode surface independent messages. Render the error via FormError's `absolute` variant so it sits out of layout flow — the input never changes height, keeping the range-mode arrow aligned and reserving no space when there is no error. The calendar popover still shifts down (y=0) only when open and an error exists, via a boolean `hasError` context signal. Validate typed dates (incomplete, invalid month/day, rollover, disabled dates) through a shared validateSegments util and localizable translation keys. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
📬 Published Alpha Packages:
|
|
🚀 Styleguide deploy preview ready! Preview URL: https://6a555545e20f825c783e0feb--gamut-preview.netlify.app |
Overview
Adds per-input validation error messages to
DatePicker:DatePickerInputmanages its own error, so range mode shows independent messages for the start and end inputs. Typed dates are validated on change and blur; invalid input stays visible until corrected.FormError'sabsolutevariant so the input never changes height: the range-mode arrow stays aligned and no space is reserved when there's no error.hasErrorcontext flag); closed-state spacing is unchanged.DatePickerTranslationskeys for each error message, with English defaults.Also adds some calendar/input accessibility refinements:
openCalendarLabeltranslationPR Checklist
Testing Instructions
Single mode
2/30/2024and blur → shows "February does not have 30 days".2/28/2024→ error clears and the date commits.disableDateprop, type a disabled date → shows "This date is not available".Range mode
2/30/2024→ error appears under the start input only.Calendar + spacing
Accessibility
role="alert"region; start/end errors announce independently.aria-invalidtoggles on each input as its error state changes.PR Links and Envs