Repository navigation
Open
Labels
feature: Design systemRelated to design patterns and componentsfeature: Form Validationmilestone: missingrole: Front Endsize: 3ptCan be done in 13-18 hours
Description
Trillium Firstmate 🤖
Overview
Create the shared text-entry components that replace MUI TextField, InputLabel, FormLabel, TextareaAutosize and the raw <input>/<textarea>/<label> elements, with the same look as today.
Dependencies
- Foundation: Tailwind theme tokens, fonts, breakpoints, and the temporary 'important' flag #2258
- Add a /design-system page that catalogues tokens and components #2260
Action Items
- Create
client/src/components/ui/label.tsx: a label in the form-label style (16 px, weight 600, as in the MUI themeMuiInputLabel). - Create
client/src/components/ui/input.tsx: a text input with the app's outlined style (1 px black border, 14 px/500 text, grey placeholder#757575), anerrorstate (error color border), and adisabledstate. Forward the ref and all native props soreact-hook-form'sregister()works on it unchanged. - Create
client/src/components/ui/textarea.tsxwith the same styling (replacesTextareaAutosizeinmanageProjects/editableField.jsx). Auto-grow can be done with a smalluseEffector CSSfield-sizing: contentwith a fallback. - Create
client/src/components/ui/field.tsx: a wrapper that connects aLabel, a control, helper text, and an error message with the rightid,htmlFor,aria-describedbyandaria-invalid. The old forms reserve one line of space for the message (helperText=' ') so layout does not jump; keep that behavior as an option. - Add an optional floating-label look to
Input(the check-in formnewUserForm.jsxuses MUI floating labels). Implement with the CSSpeerpattern, not JavaScript. - Colocated tests: label click focuses the input; typing works;
register()-style ref forwarding; error text is announced viaaria-describedby; disabled blocks typing; textarea grows. - Add catalogue entries for Label, Input, Textarea, and Field (default, focus, error, disabled, floating label).
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
- Current look:
client/src/theme/index.js(MuiTextField,MuiInputBase,MuiInputLabel). - Current uses of text fields:
returnUserForm.jsx,newUserForm.jsx,Auth.jsx,SecretPassword.jsx,eventForm.jsx,ProjectForm.jsx(throughValidatedTextField.jsx),editProjectMembers.jsx,UserManagement.jsx,UserPermissionSearch.jsx,Events.jsx. - react-hook-form
register: https://react-hook-form.com/docs/useform/register
Additional Notes
ValidatedTextField.jsxis not rewritten here. It is only used byProjectForm.jsxand moves in Migrate the project list and the project form to Tailwind #2280.- The MUI theme sets text field
inputPropswithpaddingLeft: '0.5em'andwidth: '100%'. Match the final look, not the exact classes.
Metadata
Metadata
Assignees
Labels
feature: Design systemRelated to design patterns and componentsfeature: Form Validationmilestone: missingrole: Front Endsize: 3ptCan be done in 13-18 hours
Type
Projects
- StatusShow more project fieldsNew Issue Approval
Activity