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 dropdown select to replace MUI Select/MenuItem/InputLabel/FormControl (used in 4 files) and the raw <select> elements.
Dependencies
Action Items
- Add
@radix-ui/react-select. - Create
client/src/components/ui/select.tsxexportingSelect,SelectTrigger,SelectContent,SelectItem,SelectValue(shadcn-style compound parts) and a simple convenience form:<Select label="Project" value onValueChange options={[{value, label}]} />. Style the trigger to match the current outlined MUI select (same height, border, arrow). - Support an
errorstate and a placeholder, and keep a hidden native input when used in a<form>(Radix does this whennameis passed) so form posts andreact-hook-formControllerwork. - Tests: opens with click and with Enter/Space/ArrowDown, arrow keys move, Enter selects, Escape closes,
onValueChangefires, disabled does not open. (Radix needs the jsdom stubs from the foundation ticket.) - Catalogue entry (closed, open, selected, placeholder, error, disabled).
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 Select: https://www.radix-ui.com/primitives/docs/components/select
- Current uses to match:
pages/Home.jsx,pages/UserWelcome.jsx,components/user-admin/EditUsers.jsx,components/manageProjects/eventForm.jsx.
Additional Notes
- Decision needed: custom vs native select. Proposed default: Radix Select (consistent look and keyboard behavior across browsers). A native
<select>styled with Tailwind is simpler and good on phones; if the team prefers that, this ticket shrinks and the compound API is dropped. - Radix Select renders its list in a portal. With the
importantflag on this is fine, but check that the popup appears above the app shell box (overflow: hiddeninApp.jsx).
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