Issue 210
enhancement: Button and Link, the first shared components
Back to our planDone
enhancementfrontendstylinguxpriority: high
Type
enhancement
Problem
Buttons are drawn nineteen ways: the shadcn Button, CMSLink restyled with size="clear" and position-based classes, raw <button> and <a> elements, and hand-built primary links (inventory elements L1, N7–N9, H2, H3, C16, C18, B7, B12, B14, B15, F14, F15, F21, F24, S7, S10, S11 in docs/ui/). Text links are drawn twelve more ways (N1–N6, N11, N14, N17–N20). The approved component set (#208) makes Button the only thing that draws a button and Link the only text link.
Proposed fix
Build the first two components of the approved set in src/platform/ui/, then move every element above onto them:
Button:variantprimary,secondary,accent,ghost,inverse,inverse-outline;sizesm,md,lg,icon;href,external,loading,fullWidth,iconStart,iconEnd.Link:variantinline,nav,muted,action;current,external,icon,iconOnly.resolveLink()insrc/platform/payload/: one mapper from the CMS link field tohref,label,externaland the variant.- Component tests with Testing Library and axe, as epic #163 asks (first component, so this adds the test setup).
- Primary buttons get a fill that passes 4.5:1 in both themes, which fixes the button part of #121.
Two stacked PRs: Button first, then Link.
Acceptance criteria
- Not done:
src/components/ui/button.tsxis gone; no element above is drawn by hand. - Not done: Each component has interaction and axe tests.
- Not done: White text on every primary button measures at least 4.5:1 in light and dark.
- Not done: Screenshots at the six widths, light and dark, show no regressions.
Area
frontend, styling, ux
Priority
priority: high
Generated by Claude Code, opens in a new tab