Skip to content

Commit

Permalink
Various A11y updates (#421)
Browse files Browse the repository at this point in the history
* Various A11y updates

* Responding to feedback
  • Loading branch information
gjones authored May 22, 2024
1 parent 6a79472 commit f91ce15
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 9 deletions.
1 change: 1 addition & 0 deletions src/components/Checkbox/Checkbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export const Checkbox = ({
id={id ?? defaultId}
data-testid="checkbox"
disabled={disabled}
aria-label={`${label}`}
{...delegated}
>
<CheckIconWrapper>
Expand Down
3 changes: 2 additions & 1 deletion src/components/FileTabs/FileTabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ export const FileTabs = ({
<TabsContainer
ref={ref}
onWheel={onWheel}
role="tablist"
onScroll={e => {
e.preventDefault();
e.stopPropagation();
Expand Down Expand Up @@ -180,7 +181,7 @@ export const FileTabs = ({
>
{Children.map(children, (child, index) => (
<div
tabIndex={index}
tabIndex={index + 1}
role="tab"
onClick={onSelect(index)}
key={`tab-element-${index}`}
Expand Down
1 change: 1 addition & 0 deletions src/components/Pagination/Pagination.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ export const Pagination = ({
value={currentPage}
loading={false}
onKeyDown={onKeyDown}
aria-label={currentPage.toString()}
min={1}
max={totalPages}
onFocus={onPageNumberFocus}
Expand Down
1 change: 1 addition & 0 deletions src/components/RadioGroup/RadioGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ const RadioGroupItem = ({
id={id ?? defaultId}
disabled={disabled}
required={required}
aria-label={`${label}`}
>
<RadioGroupIndicator />
</RadioInput>
Expand Down
1 change: 1 addition & 0 deletions src/components/Switch/Switch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export const Switch = forwardRef<HTMLButtonElement, SwitchProps>(
ref={ref}
id={id ?? defaultId}
disabled={disabled}
aria-label={`${label}`}
checked={checked}
{...props}
>
Expand Down
12 changes: 10 additions & 2 deletions src/components/Table/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,10 @@ const Thead = ({
<StyledThead>
<tr>
{isSelectable && (
<StyledHeader $size={size}>
<StyledHeader
$size={size}
aria-label="Select column"
>
<Checkbox
onCheckedChange={onSelectAll}
disabled={!hasRows}
Expand All @@ -138,7 +141,12 @@ const Thead = ({
{...headerProps}
/>
))}
{actionsList.length > 0 && <StyledHeader $size={size} />}
{actionsList.length > 0 && (
<StyledHeader
aria-label="Actions"
$size={size}
/>
)}
</tr>
</StyledThead>
</>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Tabs/FullWidthTabs.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const Playground: Story = {
ariaLabel: "a full width simple tab component",
children: (
<div style={{ width: "700px" }}>
<FullWidthTabs.TriggersList>
<FullWidthTabs.TriggersList role="tablist">
<FullWidthTabs.Trigger
value="tab1"
key="tab1"
Expand Down
10 changes: 5 additions & 5 deletions src/styles/variables.dark.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@
"avatar": {
"color": {
"background": {
"default": "#696e79",
"hover": "#53575f",
"active": "#53575f"
"default": "#808691",
"hover": "#b3b6bd",
"active": "#b3b6bd"
},
"text": {
"default": "#1F1F1C",
Expand Down Expand Up @@ -1111,8 +1111,8 @@
"color": {
"background": {
"default": "#1F1F1C",
"hover": "#1F1F1C",
"active": "lch(13.9 2.07 105)"
"hover": "lch(15.8 0 0)",
"active": "lch(17.9 0 0)"
},
"stroke": {
"default": "#323232"
Expand Down

0 comments on commit f91ce15

Please sign in to comment.