feat: add Calendar component and replace mobile native date picker#139
feat: add Calendar component and replace mobile native date picker#139
Conversation
🟡 Heimdall Review Status
🟡
|
| Code Owner | Status | Calculation | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| ui-systems-eng-team |
🟡
0/1
|
Denominator calculation
|
bdb2848 to
d88e834
Compare
d88e834 to
158cf94
Compare
158cf94 to
4b25572
Compare
12c3396 to
c7cf5a9
Compare
c7cf5a9 to
09e03c7
Compare
09e03c7 to
4ed26a2
Compare
4ed26a2 to
100b03a
Compare
New Features: * [Mobile] Standalone Calendar component cloned from cds-web and updated for cds-mobile Enhancements: * [Mobile] Comprehensive accessibility with screen reader support for Calendar component * [Mobile] Replaced react-native-date-picker with Calendar component for DatePicker * [Mobile + Web] Added/replaced calendar style props to match the new "classnames/styles" APIs * [Mobile] Added custom a11y labels for Calendar navigation Dependencies: * [Mobile] Remove react-native-date-picker (no longer needed) Tests: * [Mobile] Add Storybook for Calendar, including DatePicker, standalone, and custom triggers * [Mobile] Add unit tests for Calendar and DatePicker * [Web] Add slot styling examples for Calendar storybook Documentation: * [Mobile] Added mobile docs for Calendar * [Mobile + Web] Updated Calendar and DatePicker documentation to reflect the updated style APIs
100b03a to
c4c11b1
Compare
| * @default 'Today' | ||
| */ | ||
| todayAccessibilityHint?: string; | ||
| }; |
There was a problem hiding this comment.
Sorry for any confusion on this, we don't want to include the base props in common. We will just have them both inside of Calendar.tsx and DatePicker.tsx on web and mobile but they should match.
| */ | ||
| reduceMotion?: boolean; | ||
| /** Callback fired when the open animation completes. */ | ||
| onOpenComplete?: () => void; |
There was a problem hiding this comment.
regarding DatePicker, yes
| * announce state (e.g. "dimmed" on iOS) and do not activate on double-tap; | ||
| * touch/press is unchanged. | ||
| */ | ||
| accessibilityState?: AccessibilityState; |
There was a problem hiding this comment.
Did we still plan on having tooltip changes? Thought those weren't needed.
| /** Custom class name for the date cell (CalendarPressable). */ | ||
| dayCellClassName?: string; | ||
| /** Custom style for the date cell (CalendarPressable). */ | ||
| dayCellStyle?: React.CSSProperties; |
There was a problem hiding this comment.
We shouldn't have style/className one offs, it should all be inside of styles/classNames
| <Calendar | ||
| ref={calendarRef} | ||
| className={calendarClassName} | ||
| classNames={classNames?.calendar} |
There was a problem hiding this comment.
Hmm I think we have been trying to flatten styles here but please check out Stepper, Select, and Carousel as those are newer components. Also not a big deal if someone can't customize the inner workings of calendar from a root, especially if we let them override it somehow. We could look at a "CalendarComponent" prop or something.
| disabled?: StyleProp<TextStyle>; | ||
| highlighted?: StyleProp<TextStyle>; | ||
| }; | ||
| }; |
There was a problem hiding this comment.
We probably don't need this level of detail with dayCell and text.
| )} | ||
| </HStack> | ||
|
|
||
| <VStack style={styles?.content}> |
There was a problem hiding this comment.
Do we need a separate VStack here? double check on web as well
What changed? Why?
New Features:
Enhancements:
accessibilityStateto Tooltip triggerDependencies:
Tests:
Documentation:
UI changes
Calendar
DatePicker
Accessibility
Using the Android Emulator with TalkBack
Screen_recording_20260309_130525.webm
Using a physical iPhone with VoiceOver
ScreenRecording_03-09-2026.14-34-23_1.MP4
Documentation
Testing
How has it been tested?
Testing instructions
For unit and interaction tests, use
yarn nx test mobile.Refer to the mobile-app docs for information on how to test via Expo.
View local Docusaurus changes with
yarn nx dev docs.Change management
type=routine
risk=low
impact=sev5
automerge=false