Note: Moved from #27. Not yet committed to doing this — preserved for future consideration.
Summary
The harness engine components use hardcoded hex colors and inline styles throughout instead of USWDS design tokens and utility classes. This creates accessibility risk (unverified contrast ratios) and inconsistency with the design system.
Files affected
packages/harness/src/engine/ComponentMapper.tsx — program annotation badges use hardcoded colors (#e1f3f8, #0d47a1, #fce4ec, #b71c1c); new "Modified" badge uses inline backgroundColor: '#005ea2' instead of bg-primary text-white
packages/harness/src/engine/FieldArrayRenderer.tsx — unstyled Remove button with only color: '#d83933' (no aria-label, loses USWDS focus ring); fieldset/row borders use hardcoded #dfe1e2, #e6e6e6
packages/harness/src/engine/FormRenderer.tsx — programs callout box is a plain <div> with #f0f0f0 background, no semantic role
packages/harness/src/engine/SplitPanelRenderer.tsx — inline CSS Grid instead of USWDS grid-row/grid-col-6; panel headers use hardcoded #005ea2 border and #1b1b1b text
What to fix
- Replace all hardcoded hex colors with USWDS utility classes (e.g.
bg-primary, text-white, border-base-lighter)
- Use USWDS grid system (
grid-row, grid-col-6) instead of inline CSS Grid
- Add
aria-label to FieldArrayRenderer Remove button (e.g. "Remove row 2")
- Give the programs callout box a semantic role (
role="region" with aria-label, or use USWDS Alert)
- Verify color contrast ratios meet WCAG 2.1 AA (4.5:1 for normal text)
Summary
The harness engine components use hardcoded hex colors and inline styles throughout instead of USWDS design tokens and utility classes. This creates accessibility risk (unverified contrast ratios) and inconsistency with the design system.
Files affected
packages/harness/src/engine/ComponentMapper.tsx— program annotation badges use hardcoded colors (#e1f3f8,#0d47a1,#fce4ec,#b71c1c); new "Modified" badge uses inlinebackgroundColor: '#005ea2'instead ofbg-primary text-whitepackages/harness/src/engine/FieldArrayRenderer.tsx—unstyledRemove button with onlycolor: '#d83933'(noaria-label, loses USWDS focus ring); fieldset/row borders use hardcoded#dfe1e2,#e6e6e6packages/harness/src/engine/FormRenderer.tsx— programs callout box is a plain<div>with#f0f0f0background, no semantic rolepackages/harness/src/engine/SplitPanelRenderer.tsx— inline CSS Grid instead of USWDSgrid-row/grid-col-6; panel headers use hardcoded#005ea2border and#1b1b1btextWhat to fix
bg-primary,text-white,border-base-lighter)grid-row,grid-col-6) instead of inline CSS Gridaria-labelto FieldArrayRenderer Remove button (e.g."Remove row 2")role="region"witharia-label, or use USWDS Alert)