feat: added aria label support to buttons

pull/3083/head
William Grant 11 months ago
parent 0a56653f19
commit 2e2f526405

@ -114,6 +114,7 @@ const StyledButton = styled.button<{
export type SessionButtonProps = { export type SessionButtonProps = {
text?: string; text?: string;
ariaLabel?: string;
disabled?: boolean; disabled?: boolean;
buttonType?: SessionButtonType; buttonType?: SessionButtonType;
buttonShape?: SessionButtonShape; buttonShape?: SessionButtonShape;
@ -137,6 +138,7 @@ export const SessionButton = (props: SessionButtonProps) => {
dataTestId, dataTestId,
buttonColor, buttonColor,
text, text,
ariaLabel,
disabled = false, disabled = false,
onClick = null, onClick = null,
margin, margin,
@ -152,6 +154,7 @@ export const SessionButton = (props: SessionButtonProps) => {
return ( return (
<StyledButton <StyledButton
aria-label={ariaLabel}
color={buttonColor} color={buttonColor}
buttonShape={buttonShape} buttonShape={buttonShape}
buttonType={buttonType} buttonType={buttonType}

@ -13,6 +13,7 @@ export type SessionIconButtonProps = SessionIconProps & {
dataTestIdIcon?: string; dataTestIdIcon?: string;
id?: string; id?: string;
title?: string; title?: string;
ariaLabel?: string;
tabIndex?: number; tabIndex?: number;
className?: string; className?: string;
children?: ReactNode; children?: ReactNode;
@ -60,6 +61,7 @@ const SessionIconButtonInner = forwardRef<HTMLButtonElement, SessionIconButtonPr
margin, margin,
padding, padding,
id, id,
ariaLabel,
title, title,
dataTestId, dataTestId,
dataTestIdIcon, dataTestIdIcon,
@ -90,6 +92,7 @@ const SessionIconButtonInner = forwardRef<HTMLButtonElement, SessionIconButtonPr
ref={ref} ref={ref}
id={id} id={id}
title={title} title={title}
aria-label={ariaLabel}
onClick={clickHandler} onClick={clickHandler}
style={{ style={{
...style, ...style,

Loading…
Cancel
Save