Repository navigation
Open
Labels
feature: Design systemRelated to design patterns and componentsmilestone: missingrole: Front Endsize: 2ptCan be done in 7-12 hours
Description
Trillium Firstmate 🤖
Overview
Create the shared text components that replace MUI Typography (used in 29 files) and Link, and the raw <h1>-<h6>, <p>, and <a> elements, so text sizes come from one scale.
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/heading.tsx:<Heading level={1-6} size?>where the tag (level) and the visual size are separate props, so the right tag can be used for structure. - Create
client/src/components/ui/text.tsx:<Text>for body copy with variants matching the MUI ones in use:body1,body2, caption, muted (grey), error, and amonooption. - Create
client/src/components/ui/link.tsx: styled link that works with React Router v5 (NavLink/LinkviaasChildor anhref/toprop) and plain external links (target/relset correctly). - Map the
Typographyvariants used today:h1x8,h3x8,h4x8,h6x6,body1x5,body2x2,h2x1. The MUI theme setsh1to 30 px bold Source Code Pro with a 1.5rem bottom margin,h3to 16 px/600 Source Sans Pro. MUI'sresponsiveFontSizesshrinks heading sizes on narrow screens; measure the real rendered sizes at 390 px and 1280 px in the running app and match them with responsive classes. - Tests: heading renders the requested tag with the requested size class;
Textvariants;Linkrenders an anchor with the righthrefand external-link attributes. - Add the type scale specimens to the Foundations section and entries for the three components in the catalogue.
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 theme:
client/src/theme/index.js. - The old global heading rules in
client/src/index.scss(for exampleh1 { font-size: 7em },h3 { font-size: 2.8em }) are unlayered; theimportantflag overrides them. They are removed in the final cleanup. - Link: https://reactrouter.com/web/api/NavLink (React Router v5).
Additional Notes
- The app's raw
<h*>tags rely on the globalindex.scsssizes and thealiseoregulardisplay font. Do not migrate those screens here; the screen tickets decide per heading whether it keeps the display font.
Metadata
Metadata
Assignees
Labels
feature: Design systemRelated to design patterns and componentsmilestone: missingrole: Front Endsize: 2ptCan be done in 7-12 hours
Type
Projects
- StatusShow more project fieldsNew Issue Approval
Activity