Skip to content
Merged
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
2 changes: 1 addition & 1 deletion packages/modals/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ import { Button } from '@zendeskgarden/react-buttons';
</Button>
</FooterItem>
</Footer>
<Close />
<Close aria-label="Close modal" />
</Modal>
</ThemeProvider>
```
2 changes: 1 addition & 1 deletion packages/modals/src/containers/ModalContainer.example.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const onModalClose = () => setState({ isModalVisible: false });
</Button>
</FooterItem>
</Footer>
<Close {...getCloseProps()} />
<Close {...getCloseProps({ 'aria-label': 'Close modal' })} />
</ModalView>
</Backdrop>
)}
Expand Down
6 changes: 3 additions & 3 deletions packages/modals/src/elements/Modal.example.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const onModalClose = () => setState({ isModalVisible: false });
</Button>
</FooterItem>
</Footer>
<Close />
<Close aria-label="Close modal" />
</Modal>
)}
</div>;
Expand Down Expand Up @@ -110,7 +110,7 @@ const onModalClose = () => setState({ isModalVisible: false });
</Button>
</FooterItem>
</Footer>
<Close />
<Close aria-label="Close modal" />
</Modal>
)}
</div>;
Expand Down Expand Up @@ -160,7 +160,7 @@ const onModalClose = () => setState({ isModalVisible: false });
passages, and more recently with desktop publishing software like Aldus PageMaker including
versions of Lorem Ipsum.
</Body>
<Close />
<Close aria-label="Close modal" />
</Modal>
)}
</div>;
Expand Down
2 changes: 1 addition & 1 deletion packages/modals/src/views/ModalView.example.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const ExampleModalContainer = styled.div`
<Button primary>Submit</Button>
</FooterItem>
</Footer>
<Close />
<Close aria-label="Close modal" />
</ModalView>
</Backdrop>
</ExampleModalContainer>;
Expand Down
9 changes: 6 additions & 3 deletions packages/notifications/src/Alert.example.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
**Accessibility Warning:** All usages of `<Close />` must contain an `aria-label`
or other assistive technique to have discernible text.

```jsx
<Grid>
<Row>
Expand All @@ -6,23 +9,23 @@
<Title>Success Alert</Title>
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut
labore et dolore magna aliqua.
<Close onClick={() => alert('closing alert')} />
<Close onClick={() => alert('closing alert')} aria-label="Close Alert" />
</Alert>
</Col>
<Col size={12}>
<Alert type="warning">
<Title>Warning Alert</Title>
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut
labore et dolore magna aliqua.
<Close onClick={() => alert('closing alert')} />
<Close onClick={() => alert('closing alert')} aria-label="Close Alert" />
</Alert>
</Col>
<Col size={12}>
<Alert type="error">
<Title>Error Alert</Title>
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut
labore et dolore magna aliqua.
<Close onClick={() => alert('closing alert')} />
<Close onClick={() => alert('closing alert')} aria-label="Close Alert" />
</Alert>
</Col>
</Row>
Expand Down
11 changes: 7 additions & 4 deletions packages/notifications/src/Notification.example.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
**Accessibility Warning:** All usages of `<Close />` must contain an `aria-label`
or other assistive technique to have discernible text.

```jsx
<Grid>
<Row>
Expand All @@ -10,31 +13,31 @@
ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in
reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
</Paragraph>
<Close onClick={() => alert('closing notification')} />
<Close onClick={() => alert('closing notification')} aria-label="Close Notification" />
</Notification>
</Col>
<Col size={12}>
<Notification type="success">
<Title>Success Notification</Title>
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut
labore et dolore magna aliqua.
<Close onClick={() => alert('closing notification')} />
<Close onClick={() => alert('closing notification')} aria-label="Close Notification" />
</Notification>
</Col>
<Col size={12}>
<Notification type="warning">
<Title>Warning Notification</Title>
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut
labore et dolore magna aliqua.
<Close onClick={() => alert('closing notification')} />
<Close onClick={() => alert('closing notification')} aria-label="Close Notification" />
</Notification>
</Col>
<Col size={12}>
<Notification type="error">
<Title>Error Notification</Title>
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut
labore et dolore magna aliqua.
<Close onClick={() => alert('closing notification')} />
<Close onClick={() => alert('closing notification')} aria-label="Close Notification" />
</Notification>
</Col>
</Row>
Expand Down
7 changes: 3 additions & 4 deletions packages/pagination/src/containers/PaginationContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,10 @@ export default class PaginationContainer extends ControlledComponent {
};
}

getContainerProps = ({ role = 'navigation', ...otherProps } = {}) => {
getContainerProps = (props = {}) => {
return {
role,
'aria-label': 'Pagination',
...otherProps
'aria-label': 'Pagination navigation',
...props
};
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ describe('PaginationContainer', () => {
it('applies correct accessibility attributes', () => {
const container = findContainer(wrapper);

expect(container).toHaveProp('role', 'navigation');
expect(container).toHaveProp('aria-label', 'Pagination');
expect(container).toHaveProp('role', 'listbox');
expect(container).toHaveProp('aria-label', 'Pagination navigation');
});
});

Expand Down
5 changes: 4 additions & 1 deletion packages/tables/src/examples/overflow-menu.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ package.
Based on `Table` positioning and other implementation specific details you may need
to apply manual positioning against the `Menu` to ensure a standard look and feel.

**Accessibility Warning:** All usages of `<OverflowButton />` must contain an `aria-label`
or other assistive technique to have discernible text.

```jsx
const {
zdFontSizeBeta,
Expand Down Expand Up @@ -42,7 +45,7 @@ const OverflowMenu = ({ isHeader = false }) => (
}
}}
trigger={({ ref, isOpen }) => {
const buttonProps = { innerRef: ref, active: isOpen };
const buttonProps = { innerRef: ref, active: isOpen, 'aria-label': 'Row Actions' };

if (isOpen) {
buttonProps.focused = false;
Expand Down
4 changes: 2 additions & 2 deletions packages/tables/src/examples/paginated-table.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const { Avatar } = require('@zendeskgarden/react-avatars/src');
const {
zdFontSizeBeta,
zdFontSizeEpsilon,
zdColorGrey500,
zdColorGrey600,
zdFontWeightSemibold,
zdSpacingSm
} = require('@zendeskgarden/css-variables');
Expand Down Expand Up @@ -33,7 +33,7 @@ initialState = {
};

const CurrentPages = styled.div`
color: ${zdColorGrey500};
color: ${zdColorGrey600};
font-size: ${zdFontSizeEpsilon};
`;

Expand Down