b4113de74a
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. -->
44 lines
1.0 KiB
TypeScript
44 lines
1.0 KiB
TypeScript
import { clsx } from 'clsx';
|
|
import { type MouseEvent } from 'react';
|
|
|
|
import { type IconComponent } from '@ui/icon';
|
|
import { InsideButton } from '@ui/input/InsideButton/InsideButton';
|
|
|
|
import styles from './IconButtonGroup.module.scss';
|
|
|
|
export type IconButtonGroupProps = {
|
|
disabled?: boolean;
|
|
iconButtons: {
|
|
Icon: IconComponent;
|
|
ariaLabel?: string;
|
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
onClick?: (event: MouseEvent<any>) => void;
|
|
}[];
|
|
className?: string;
|
|
};
|
|
|
|
export const IconButtonGroup = ({
|
|
iconButtons,
|
|
disabled,
|
|
className,
|
|
}: IconButtonGroupProps) => {
|
|
return (
|
|
<div
|
|
className={clsx(styles.container, className)}
|
|
data-disabled={disabled || undefined}
|
|
>
|
|
{iconButtons.map(({ Icon, onClick, ariaLabel }, index) => {
|
|
return (
|
|
<InsideButton
|
|
key={index}
|
|
Icon={Icon}
|
|
ariaLabel={ariaLabel}
|
|
onClick={onClick}
|
|
disabled={disabled}
|
|
/>
|
|
);
|
|
})}
|
|
</div>
|
|
);
|
|
};
|