Accessibility fix pass for twenty-ui input components (#21776)
Re-enables the live Storybook axe gate across the twenty-ui `input`
domain (17 story files) by removing the inherited `a11y: { test: 'todo'
}` overrides. Pilot for the wider a11y fix pass; other domains follow
the same playbook.
**What changed**
- Accessible names added to icon-only buttons, `Toggle`, `Checkbox`, and
the button groups via small additive `aria-label`/`ariaLabel` props on 8
components. Where this fully fixes the story, the override is dropped so
the full gate applies.
- Color-contrast (design-token level) is deferred — not changed — via a
new shared `A11Y_DEFER_COLOR_CONTRAST` parameter (`@ui/testing`) that
disables only the `color-contrast` rule while every other axe rule stays
enforced. Grep the constant to find all deferrals when tokens are
darkened later.
- `CatalogDecorator`: unique cell ids (clears `duplicate-id-aria`) and
dimension titles switched from empty `h1/h2/h3` to `div` (clears
`empty-heading`). Both help every domain's catalogs.
**Reviewer notes**
- No visual change: edits are aria / id / story-args / axe-config only,
so Argos parity holds.
- Input axe gate goes from 12 failing to 60/60 passing; typecheck and
lint green.
<!-- This is an auto-generated description by cubic. -->
<a
href="https://cubic.dev/pr/twentyhq/twenty/pull/21776?utm_source=github"
target="_blank" rel="noopener noreferrer"
data-no-image-dialog="true"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img
alt="Review in cubic"
src="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"></picture></a>
<!-- End of auto-generated description by cubic. -->
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
import { type Parameters } from '@storybook/react-vite';
|
||||
|
||||
export const A11Y_DEFER_COLOR_CONTRAST = {
|
||||
test: 'error',
|
||||
config: { rules: [{ id: 'color-contrast', enabled: false }] },
|
||||
} satisfies Parameters['a11y'];
|
||||
@@ -54,28 +54,32 @@ export const CatalogDecorator: Decorator = (Story, context) => {
|
||||
<div className={styles.container}>
|
||||
{dimension4.values.map((value4: any, index4: number) => (
|
||||
<div className={styles.columnContainer} key={`d4-${index4}`}>
|
||||
<h1 className={styles.columnTitle}>
|
||||
<div className={styles.columnTitle}>
|
||||
{dimension4.labels?.(value4) ??
|
||||
(isStringOrNumber(value4) ? value4 : '')}
|
||||
</h1>
|
||||
</div>
|
||||
{dimension3.values.map((value3: any, index3: number) => (
|
||||
<div className={styles.rowsContainer} key={`d3-${index3}`}>
|
||||
<h2 className={styles.rowsTitle}>
|
||||
<div className={styles.rowsTitle}>
|
||||
{dimension3.labels?.(value3) ??
|
||||
(isStringOrNumber(value3) ? value3 : '')}
|
||||
</h2>
|
||||
</div>
|
||||
{dimension2.values.map((value2: any, index2: number) => (
|
||||
<div className={styles.rowContainer} key={`d2-${index2}`}>
|
||||
<h3 className={styles.rowTitle}>
|
||||
<div className={styles.rowTitle}>
|
||||
{dimension2.labels?.(value2) ??
|
||||
(isStringOrNumber(value2) ? value2 : '')}
|
||||
</h3>
|
||||
</div>
|
||||
{dimension1.values.map((value1: any, index1: number) => {
|
||||
return (
|
||||
<div
|
||||
className={styles.cellContainer}
|
||||
key={`d1-${index1}`}
|
||||
id={value1}
|
||||
id={
|
||||
dimensions.length > 1
|
||||
? `catalog-cell-${index4}-${index3}-${index2}-${index1}`
|
||||
: value1
|
||||
}
|
||||
>
|
||||
<span className={styles.elementTitle}>
|
||||
{dimension1.labels?.(value1) ??
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
* |___/
|
||||
*/
|
||||
|
||||
export { A11Y_DEFER_COLOR_CONTRAST } from './a11yParameters';
|
||||
export { ComponentStorybookLayout } from './ComponentStorybookLayout';
|
||||
export type {
|
||||
CatalogDimension,
|
||||
|
||||
Reference in New Issue
Block a user