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 shared radio group and on/off switch (built on Radix so keyboard and screen reader behavior is correct) to replace MUI Radio/RadioGroup/FormControlLabel and Switch.
Dependencies
Action Items
- Add
@radix-ui/react-radio-groupand@radix-ui/react-switch. - Create
client/src/components/ui/radio-group.tsxexportingRadioGroupandRadioGroupItem(item = radio plus its label, with alabelprop). Match today's look fromnewUserForm.jsxandProjectForm.jsx(MUIRadiocolors use the primary color). - Create
client/src/components/ui/switch.tsxexportingSwitch(with optional visible label). Match the look defined by the MUI style overrides incomponents/user-admin/EditUsers.jsxlines ~29-50 (switch base, thumb, and track colors when checked) and the plainSwitchinpages/OnboardOffboardVisibility.jsx. - Colocated tests: radio selection by click and by arrow keys, only one selected,
onValueChange; switch toggles by click and Space,aria-checked, disabled does nothing. - Catalogue entries for both.
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 RadioGroup: https://www.radix-ui.com/primitives/docs/components/radio-group
- Radix Switch: https://www.radix-ui.com/primitives/docs/components/switch
- MUI usage to replace:
newUserForm.jsx,ProjectForm.jsx(radios);EditUsers.jsx,OnboardOffboardVisibility.jsx(switches).
Additional Notes
- Decision needed: Radix package form. Proposed default: individual
@radix-ui/react-*packages (smaller, explicit). The singleradix-uipackage is an acceptable alternative; just stay consistent in later tickets. - No checkbox is needed: the app has none today.
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