{/* ui-audit-disable-next-line no-hand-rolled-surface no-utility-layout no-utility-spacing — a swatch showing the token itself; the fill IS the subject */}
{text ? (
/* `tone="inherit"` — the specimen's whole job is to show the token's PAIRED foreground,
and every other tone is an absolute colour. Without it `Text` repainted itself in
`--foreground` over `--primary` and measured 2.45:1 on this very page (gh#643). */
Aa 亜
) : null}
{swatch.token}
{swatch.role}
);
}
/**
* A token group rendered TWICE · light theme then a `.dark`-scoped copy · so a
* single static screenshot proves both renditions defined in foundation.css.
* Themed groups (`dark`) re-paint under the `.dark` wrapper; decorative groups
* (wa-iro, chart) are theme-invariant and render once.
*/
function SwatchGroup({ items, text, dark }: { items: Swatch[]; text?: boolean; dark?: boolean }) {
const grid = (