Skip to content
SprecherEast
Issue 210

enhancement: Button and Link, the first shared components

Back to our plan
Done
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: variant primary, secondary, accent, ghost, inverse, inverse-outline; size sm, md, lg, icon; href, external, loading, fullWidth, iconStart, iconEnd.
  • Link: variant inline, nav, muted, action; current, external, icon, iconOnly.
  • resolveLink() in src/platform/payload/: one mapper from the CMS link field to href, label, external and 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.tsx is 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

See it on GitHub, opens in a new tab