Repository navigation
Open
Labels
feature: Design systemRelated to design patterns and componentsmilestone: missingrole: Front Endsize: 3ptCan be done in 13-18 hours
Description
Trillium Firstmate 🤖
Overview
Create the month/year picker that replaces the only MUI X DatePicker in the app, used for "how long have you been volunteering" in the new-volunteer check-in form. Decided: it is a popover with a month grid and year arrows (no typed entry).
Dependencies
Action Items
- Add
@radix-ui/react-popoverand adddate-fnsas a direct dependency (the app importsdate-fnsinpages/CheckInForm.jsxtoday but only gets it indirectly through@mui/x-date-pickers, which will be removed). - Create
client/src/components/ui/month-year-picker.tsx: an input-style button that shows the chosen month/year (for example "Mar 2019"), opens a popover with previous/next year arrows and a 12-month grid, and supportsvalue: Date,onChange(date),minDateandmaxDate(disabled months outside the range),label,error,disabled. - Today's usage for reference (
components/presentational/newUserForm.jsx):minDate = Jan 2013,maxDate = now, default value = now. Match these defaults in the screen ticket. - Keyboard: Tab to the button, Enter/Space opens, arrow keys move between months, Page Up/Down change year, Enter selects and closes, Escape closes and returns focus. Months out of range are not selectable.
- Tests: opens/closes, selecting calls
onChangewith the first day of that month, min/max disable months and block year navigation past the limits, keyboard flow above. - Catalogue entry (closed, open, disabled, error, min/max).
Acceptance Criteria
- The component lives in
client/src/components/ui/as a.tsxfile, with typed props that passyarn typecheck(strict mode). - Styling uses Tailwind classes only. Variants (if any) are declared with
cva, andclassNameis merged withcn()so callers can override. - The component does not import anything from
@mui/*or@emotion/*. - A test file next to the component (for example
button.test.tsx) covers: it renders, each variant/size, the disabled and error states where they apply, and keyboard use where it applies (Tab, Enter/Space, Escape, arrow keys).yarn testpasses. - The component has an entry on the
/design-systempage: description, props/variants, states, a short do/don't, a code example, and a live demo. - Visible focus: there is a clear focus ring when the control is reached by keyboard.
- The PR does not change any existing screen. Screens adopt the component in their own tickets.
Resources/Instructions
- Radix Popover: https://www.radix-ui.com/primitives/docs/components/popover
- Current picker:
client/src/components/presentational/newUserForm.jsx. date-fnsformat: https://date-fns.org/
Additional Notes
- Decided: month/year popover grid, no typed
MM/YYYYentry. The MUI picker opens a year list first; the grid with year arrows is the accepted simplification. - Replacing
react-datepickerin the admin reports page needs a day-level calendar and is a separate optional ticket (Optional: replace react-datepicker in the admin reports with a shared date picker #2289).
Metadata
Metadata
Assignees
Labels
feature: Design systemRelated to design patterns and componentsmilestone: missingrole: Front Endsize: 3ptCan be done in 13-18 hours
Type
Projects
- StatusShow more project fieldsNew Issue Approval
Activity