From 939d184e572b34fa7ef34a4bd8470cf718e9d6d0 Mon Sep 17 00:00:00 2001 From: Mridul Gogia Date: Sat, 28 Mar 2020 20:07:26 +0530 Subject: [PATCH 1/5] Added aria-label, aria-labelledby, aria-describedby and title to EuiToken. --- .../token/__snapshots__/token.test.tsx.snap | 2 +- src/components/token/token.tsx | 20 ++++++++++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/components/token/__snapshots__/token.test.tsx.snap b/src/components/token/__snapshots__/token.test.tsx.snap index a99768e2ea1..5f3ce044b65 100644 --- a/src/components/token/__snapshots__/token.test.tsx.snap +++ b/src/components/token/__snapshots__/token.test.tsx.snap @@ -2,11 +2,11 @@ exports[`EuiToken is rendered 1`] = `
diff --git a/src/components/token/token.tsx b/src/components/token/token.tsx index 8d7e0f726e5..41c352284a9 100644 --- a/src/components/token/token.tsx +++ b/src/components/token/token.tsx @@ -89,6 +89,13 @@ export interface TokenProps { * Size of the token */ size?: TokenSize; + /** + * What would typically be the icon's title. Required for accessibility. + */ + title?: string; + 'aria-label'?: string; + 'aria-labelledby'?: string; + 'aria-describedby'?: string; } export type EuiTokenProps = CommonProps & @@ -103,6 +110,10 @@ export const EuiToken: FunctionComponent = ({ size = 's', style = {}, className, + title, + 'aria-label': ariaLabel, + 'aria-labelledby': ariaLabelledby, + 'aria-describedby': ariaDescribedby, ...rest }) => { // Set the icon size to the same as the passed size @@ -171,7 +182,14 @@ export const EuiToken: FunctionComponent = ({ return ( - + ); }; From 49c370a83778910ac9efdce77e6120cc2f5d6646 Mon Sep 17 00:00:00 2001 From: Mridul Gogia Date: Mon, 30 Mar 2020 23:58:57 +0530 Subject: [PATCH 2/5] CL --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8ab803bb303..c77a9ca2f92 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ - Fixed EuiBasicTable proptypes of itemId ([#3133](https://github.com/elastic/eui/pull/3133)) - Updated `EuiSuperDatePicker` to inherit the selected value in quick select ([#3105](https://github.com/elastic/eui/pull/3105)) +- Pass title and aria attributes to `EuiToken`'s icon element ([#3195](https://github.com/elastic/eui/pull/3195)) ### Feature: EuiCollapsibleNav ([#3019](https://github.com/elastic/eui/pull/3019)) From 6e1cc72e340e061d94bb22bfdd06ca08516a52b1 Mon Sep 17 00:00:00 2001 From: Greg Thompson Date: Mon, 30 Mar 2020 13:40:36 -0500 Subject: [PATCH 3/5] move CL entry --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c77a9ca2f92..dba31f2fd86 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ ## [`master`](https://github.com/elastic/eui/tree/master) - Improved `htmlIdGenerator` when supplying both `prefix` and `suffix` ([#3076](https://github.com/elastic/eui/pull/3076)) +- Added title and aria attributes to `EuiToken`'s icon element ([#3195](https://github.com/elastic/eui/pull/3195)) ## [`22.2.0`](https://github.com/elastic/eui/tree/v22.2.0) @@ -10,7 +11,6 @@ - Fixed EuiBasicTable proptypes of itemId ([#3133](https://github.com/elastic/eui/pull/3133)) - Updated `EuiSuperDatePicker` to inherit the selected value in quick select ([#3105](https://github.com/elastic/eui/pull/3105)) -- Pass title and aria attributes to `EuiToken`'s icon element ([#3195](https://github.com/elastic/eui/pull/3195)) ### Feature: EuiCollapsibleNav ([#3019](https://github.com/elastic/eui/pull/3019)) From 23285a0d1fda44b7238f84ce98fe44545242ad9d Mon Sep 17 00:00:00 2001 From: Caroline Horn <549577+cchaos@users.noreply.github.com> Date: Mon, 30 Mar 2020 16:08:53 -0400 Subject: [PATCH 4/5] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8c9376930e6..823c43ccdab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ - Improved `htmlIdGenerator` when supplying both `prefix` and `suffix` ([#3076](https://github.com/elastic/eui/pull/3076)) - Updated pagination prop descriptions for `EuiInMemoryTable` ([#3142](https://github.com/elastic/eui/pull/3142)) -- Added title and aria attributes to `EuiToken`'s icon element ([#3195](https://github.com/elastic/eui/pull/3195)) +- Added `title` and `aria` attributes to `EuiToken`'s icon element ([#3195](https://github.com/elastic/eui/pull/3195)) ## [`22.2.0`](https://github.com/elastic/eui/tree/v22.2.0) From e5188da08ce7d38ab002415ef8ea67e39dd17439 Mon Sep 17 00:00:00 2001 From: Caroline Horn <549577+cchaos@users.noreply.github.com> Date: Mon, 30 Mar 2020 16:09:01 -0400 Subject: [PATCH 5/5] Update src/components/token/token.tsx --- src/components/token/token.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/token/token.tsx b/src/components/token/token.tsx index 41c352284a9..b34dbf60eb2 100644 --- a/src/components/token/token.tsx +++ b/src/components/token/token.tsx @@ -90,7 +90,7 @@ export interface TokenProps { */ size?: TokenSize; /** - * What would typically be the icon's title. Required for accessibility. + * The icon's title. Required for accessibility */ title?: string; 'aria-label'?: string;