Skip to content

Scaleflex UI a11y improvement & support e2e #188

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ const Label = styled.span.attrs({

const Header = styled.div.attrs({
className: generateClassNames(baseClassName, 'root'),
role: 'button',
})<With<WithTheme, { $fullWidth?: boolean }>>(
({ theme, $fullWidth }) => css`
display: inline-flex;
Expand Down
9 changes: 9 additions & 0 deletions packages/ui/src/core/calendar/calendar.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ const leftDatePickerAnimation = css`

const Calendar = styled.div.attrs({
className: generateClassNames(baseClassName, 'root'),
role: 'application',
'aria-label': 'Calendar',
})<CalendarProps>(
({ theme: { palette } }: With<WithTheme, CalendarProps>) => css`
position: relative;
Expand Down Expand Up @@ -131,6 +133,7 @@ const MonthButtonsWrapper = styled.div.attrs({

const MonthButtons = styled.div.attrs({
className: generateClassNames(baseClassName, 'month-buttons'),
role: 'button',
})<With<WithTheme, { isYearChanged?: boolean; isMonthChanged?: boolean; isDisabled?: boolean }>>(
({ isYearChanged = false, isMonthChanged = false, isDisabled = false, theme: { palette } }) => css`
width: calc(100% / 3);
Expand Down Expand Up @@ -317,6 +320,7 @@ const HeaderBodyMonth = styled.div.attrs({

const HeaderLeftArrows = styled.span.attrs({
className: generateClassNames(baseClassName, 'header-left-arrow'),
role: 'button',
})<With<WithTheme, { isDisabled: boolean }>>(
({ theme: { palette }, isDisabled = false }) => css`
position: absolute;
Expand All @@ -330,6 +334,7 @@ const HeaderLeftArrows = styled.span.attrs({

const HeaderLeftArrow = styled.span.attrs({
className: generateClassNames(baseClassName, 'header-left-arrow'),
role: 'button',
})<With<WithTheme, { isDisabled: boolean }>>(
({ theme: { palette }, isDisabled = false }) => css`
position: absolute;
Expand All @@ -343,6 +348,7 @@ const HeaderLeftArrow = styled.span.attrs({

const MonthsHeaderLeftArrow = styled.span.attrs({
className: generateClassNames(baseClassName, 'month-header-left-arrow'),
role: 'button',
})<With<WithTheme, { isDisabled: boolean }>>(
({ theme: { palette }, isDisabled = false }) => css`
position: absolute;
Expand All @@ -357,6 +363,7 @@ const MonthsHeaderLeftArrow = styled.span.attrs({

const HeaderRightArrow = styled.span.attrs({
className: generateClassNames(baseClassName, 'header-right-arrow'),
role: 'button',
})<With<WithTheme, { isDisabled: boolean }>>(
({ theme: { palette }, isDisabled = false }) => css`
position: absolute;
Expand All @@ -370,6 +377,7 @@ const HeaderRightArrow = styled.span.attrs({

const MonthsHeaderRightArrow = styled.span.attrs({
className: generateClassNames(baseClassName, 'month-header-right-arrow'),
role: 'button',
})<With<WithTheme, { isDisabled: boolean }>>(
({ theme: { palette }, isDisabled = false }) => css`
position: absolute;
Expand All @@ -382,6 +390,7 @@ const MonthsHeaderRightArrow = styled.span.attrs({

const HeaderRightArrows = styled.span.attrs({
className: generateClassNames(baseClassName, 'header-right-arrows'),
role: 'button',
})<With<WithTheme, { isDisabled: boolean }>>(
({ theme: { palette }, isDisabled = false }) => css`
position: absolute;
Expand Down
1 change: 1 addition & 0 deletions packages/ui/src/core/menu-item/menu-item.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ const MenuItemWrapper = styled.div.attrs({

const MenuItem = styled.div.attrs({
className: generateClassNames(baseClassName, 'root'),
role: 'menuitem',
})<With<With<WithTheme, MenuItemProps>, { $active?: boolean; $isFocused: boolean }>>(
({ size = Size.Sm, $active, theme, disableHover = false, disabled, $isFocused }) => css`
display: flex;
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/core/menu/menu.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ const Menu = intrinsicComponent<MenuProps, HTMLDivElement>(
wrapperStyles={popperWrapperStyles}
onClick={handleClose}
>
<Styled.Menu ref={ref} $maxHeight={maxHeight} $rect={rect} {...containerProps} {...rest}>
<Styled.Menu ref={ref} $maxHeight={maxHeight} $rect={rect} role="menu" {...containerProps} {...rest}>
{children}
</Styled.Menu>
</Popper>
Expand Down