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 modal dialog to replace MUI Modal and Dialog (3 places), with focus trapping, Escape to close, and a screen-reader title.
Dependencies
Action Items
- Add
@radix-ui/react-dialog. - Create
client/src/components/ui/dialog.tsxexportingDialog,DialogTrigger,DialogContent,DialogHeader,DialogTitle,DialogDescription,DialogFooter,DialogClose. Style the overlay and panel like today's: see the MUIModalbox incomponents/ChangesModal.jsx(warning icon, text, two buttons) andDialogincomponents/manageProjects/editProject.jsx. - Support both a controlled (
open+onOpenChange) and an uncontrolled use, since the current code opens modals from state. - Tests: opens and closes, focus moves into the dialog and returns to the opener, Escape closes, clicking the overlay closes (unless disabled by prop), the title is the accessible name.
- Catalogue entry (with a confirm-style example: icon, message, cancel/confirm buttons).
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 Dialog: https://www.radix-ui.com/primitives/docs/components/dialog
- MUI uses to replace:
components/ChangesModal.jsx,components/manageProjects/editProject.jsx(Dialog),components/manageProjects/editPMs/projectMembersList.jsx(Modal).
Additional Notes
- Add an
AlertDialog-style confirm helper only if two or more screens need it; otherwise a screen can composeDialogplusButton.
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