diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/components/atoms/buttons/button.tsx | 12 | ||||
| -rw-r--r-- | src/components/molecules/buttons/help-button.tsx | 5 | ||||
| -rw-r--r-- | src/components/molecules/forms/fieldset.tsx | 1 |
3 files changed, 13 insertions, 5 deletions
diff --git a/src/components/atoms/buttons/button.tsx b/src/components/atoms/buttons/button.tsx index 9776687..fecbcfd 100644 --- a/src/components/atoms/buttons/button.tsx +++ b/src/components/atoms/buttons/button.tsx @@ -8,6 +8,14 @@ import styles from './buttons.module.scss'; export type ButtonProps = { /** + * Button accessible label. + */ + 'aria-label'?: string; + /** + * Indicates the current "pressed" state of a toggle button. + */ + 'aria-pressed'?: boolean | 'mixed'; + /** * The button body. */ children: ReactNode; @@ -16,10 +24,6 @@ export type ButtonProps = { */ className?: string; /** - * Button accessible label. - */ - 'aria-label'?: string; - /** * Button state. Default: false. */ disabled?: boolean; diff --git a/src/components/molecules/buttons/help-button.tsx b/src/components/molecules/buttons/help-button.tsx index ccf1ebd..ec89f4e 100644 --- a/src/components/molecules/buttons/help-button.tsx +++ b/src/components/molecules/buttons/help-button.tsx @@ -3,7 +3,10 @@ import { forwardRef, ForwardRefRenderFunction } from 'react'; import { useIntl } from 'react-intl'; import styles from './help-button.module.scss'; -export type HelpButtonProps = Pick<ButtonProps, 'className' | 'onClick'>; +export type HelpButtonProps = Pick< + ButtonProps, + 'aria-pressed' | 'className' | 'onClick' +>; /** * HelpButton component diff --git a/src/components/molecules/forms/fieldset.tsx b/src/components/molecules/forms/fieldset.tsx index 9f46247..670cfa1 100644 --- a/src/components/molecules/forms/fieldset.tsx +++ b/src/components/molecules/forms/fieldset.tsx @@ -100,6 +100,7 @@ const Fieldset: FC<FieldsetProps> = ({ {TooltipComponent && ( <> <HelpButton + aria-pressed={isTooltipOpened} className={`${styles.btn} ${buttonModifier}`} onClick={() => setIsTooltipOpened(!isTooltipOpened)} ref={buttonRef} |
