Skip to content

Commit f056445

Browse files
committed
feat: support a11y for activity button
1 parent 12e3acf commit f056445

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

packages/component/src/Attachment/Text/private/ActivityButton.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ import { ComponentIcon, componentIconPropsSchema } from '../../../Icon';
2020

2121
const activityButtonPropsSchema = pipe(
2222
object({
23+
'aria-controls': optional(string()),
24+
'aria-expanded': optional(boolean()),
25+
'aria-pressed': optional(boolean()),
2326
children: optional(reactNode()),
2427
className: optional(string()),
2528
'data-testid': optional(string()),
@@ -35,6 +38,9 @@ type ActivityButtonProps = InferInput<typeof activityButtonPropsSchema>;
3538

3639
const ActivityButton = forwardRef<HTMLButtonElement, ActivityButtonProps>((props, ref) => {
3740
const {
41+
'aria-controls': ariaControls,
42+
'aria-expanded': ariaExpanded,
43+
'aria-pressed': ariaPressed,
3844
children,
3945
className,
4046
'data-testid': dataTestId,
@@ -51,7 +57,10 @@ const ActivityButton = forwardRef<HTMLButtonElement, ActivityButtonProps>((props
5157

5258
return (
5359
<button
60+
aria-controls={ariaControls}
5461
aria-disabled={disabled ? 'true' : undefined}
62+
aria-expanded={ariaExpanded}
63+
aria-pressed={ariaPressed}
5564
className={classNames(activityButton, 'webchat__activity-button', className)}
5665
data-testid={dataTestId}
5766
onClick={disabled ? undefined : handleClick}

0 commit comments

Comments
 (0)