From b0ea3144e1a53fec8e2312340f86c096f6b41fa4 Mon Sep 17 00:00:00 2001 From: Richie Date: Wed, 25 Mar 2026 19:55:12 +1100 Subject: [PATCH] Fix P2 accessibility issues across atom components MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Input: Record → Theme type for boxShadow theme accessor - Button: Document aria-label requirement for icon-only usage - Badge: Document aria-label requirement for icon-only badges - Switch: Strengthen a11y docs — always wrap in FormControlLabel with example - Radio: Strengthen a11y docs — always use RadioGroup + FormControlLabel with example - Chip: Document aria-label requirement for icon-only deletable chips Co-Authored-By: Claude Opus 4.6 (1M context) --- src/components/atoms/Badge/Badge.tsx | 3 +++ src/components/atoms/Button/Button.tsx | 4 ++++ src/components/atoms/Chip/Chip.tsx | 4 ++++ src/components/atoms/Input/Input.tsx | 3 ++- src/components/atoms/Radio/Radio.tsx | 13 +++++++++++-- src/components/atoms/Switch/Switch.tsx | 8 +++++++- 6 files changed, 31 insertions(+), 4 deletions(-) diff --git a/src/components/atoms/Badge/Badge.tsx b/src/components/atoms/Badge/Badge.tsx index 7273a64..b385403 100644 --- a/src/components/atoms/Badge/Badge.tsx +++ b/src/components/atoms/Badge/Badge.tsx @@ -77,6 +77,9 @@ const softColors: Record { bg: string; text: string }> * Variant options: * - `soft` (default) — tonal background, coloured text. Calmer, preferred for FA. * - `filled` — solid background, white text. For high-priority emphasis. + * + * **Accessibility**: If a Badge contains only an icon (no text children), + * provide an `aria-label` prop so screen readers can announce the status. */ export const Badge = React.forwardRef( ( diff --git a/src/components/atoms/Button/Button.tsx b/src/components/atoms/Button/Button.tsx index a0e3418..6612963 100644 --- a/src/components/atoms/Button/Button.tsx +++ b/src/components/atoms/Button/Button.tsx @@ -29,6 +29,10 @@ export interface ButtonProps extends MuiButtonProps { * - `outlined` + `secondary` — Outlined grey (neutral border) * - `text` + `primary` — Ghost / text button (copper text) * - `text` + `secondary` — Ghost secondary (grey text) + * + * **Accessibility**: Icon-only buttons (no visible text) require an + * `aria-label` prop. Without it, screen readers announce nothing. + * Example: `