Skip to content
This repository was archived by the owner on May 24, 2024. It is now read-only.

Commit

Permalink
[terra-icon] accessibility upgrade (#3598)
Browse files Browse the repository at this point in the history
  • Loading branch information
sdadn authored and Saad Adnan committed May 11, 2022
1 parent b7b9abb commit 9bf69dc
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2030,8 +2030,7 @@ const IconAll = () => (
</td>
</tr>
<tr style={{ backgroundColor: '#EEEEEE' }}>
<<<<<<< HEAD
<td style={cellStyle}><IconVolumeSetDefault height='2em' width='2em' /></td>
<td style={cellStyle}><IconVolumeSetDefault a11yLabel="icon" height='2em' width='2em' /></td>
<td style={cellStyle}>volumeSet_default</td>
<td style={{ fontWeight: 'bold', padding: '0.5rem' }}>
<code>
Expand All @@ -2040,7 +2039,7 @@ const IconAll = () => (
</td>
</tr>
<tr style={{ backgroundColor: '#EEEEEE' }}>
<td style={cellStyle}><IconVolumeSetDecrease height='2em' width='2em' /></td>
<td style={cellStyle}><IconVolumeSetDecrease a11yLabel="icon" height='2em' width='2em' /></td>
<td style={cellStyle}>volumeSet_decrease</td>
<td style={{ fontWeight: 'bold', padding: '0.5rem' }}>
<code>
Expand All @@ -2058,7 +2057,7 @@ const IconAll = () => (
</td>
</tr>
<tr style={{ backgroundColor: '#EEEEEE' }}>
<td style={cellStyle}><IconVolumeSetMute height='2em' width='2em' /></td>
<td style={cellStyle}><IconVolumeSetMute a11yLabel="icon" height='2em' width='2em' /></td>
<td style={cellStyle}>volumeSet_mute</td>
<td style={{ fontWeight: 'bold', padding: '0.5rem' }}>
<code>
Expand All @@ -2067,7 +2066,7 @@ const IconAll = () => (
</td>
</tr>
<tr style={{ backgroundColor: '#EEEEEE' }}>
<td style={cellStyle}><IconPersonConnection height='2em' width='2em' /></td>
<td style={cellStyle}><IconPersonConnection a11yLabel="icon" height='2em' width='2em' /></td>
<td style={cellStyle}>personConnection</td>
<td style={{ fontWeight: 'bold', padding: '0.5rem' }}>
<code>
Expand All @@ -2076,7 +2075,7 @@ const IconAll = () => (
</td>
</tr>
<tr style={{ backgroundColor: '#EEEEEE' }}>
<td style={cellStyle}><IconTrendingUp height='2em' width='2em' /></td>
<td style={cellStyle}><IconTrendingUp a11yLabel="icon" height='2em' width='2em' /></td>
<td style={cellStyle}>trendingUp</td>
<td style={{ fontWeight: 'bold', padding: '0.5rem' }}>
<code>
Expand All @@ -2085,7 +2084,7 @@ const IconAll = () => (
</td>
</tr>
<tr style={{ backgroundColor: '#EEEEEE' }}>
<td style={cellStyle}><IconTrendingDown height='2em' width='2em' /></td>
<td style={cellStyle}><IconTrendingDown a11yLabel="icon" height='2em' width='2em' /></td>
<td style={cellStyle}>trendingDown</td>
<td style={{ fontWeight: 'bold', padding: '0.5rem' }}>
<code>
Expand All @@ -2094,10 +2093,7 @@ const IconAll = () => (
</td>
</tr>
<tr style={{ backgroundColor: '#EEEEEE' }}>
<td style={cellStyle}><IconCircleSymbol height='2em' width='2em' /></td>
=======
<td style={cellStyle}><IconCircleSymbol a11yLabel="icon" height='2em' width='2em' /></td>
>>>>>>> [terra-icon] accessibility upgrade (#3598)
<td style={cellStyle}>circle_symbol</td>
<td style={{ fontWeight: 'bold', padding: '0.5rem' }}>
<code>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
:local {
.icon {
height: 40px;
margin: 5px;
width: 40px;
margin: 5px;
}

.icon-inverse {
Expand Down
2 changes: 2 additions & 0 deletions packages/terra-icon/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Changelog

## Unreleased
* Breaking changes
* Updated terra-icon to meet accessibility standards.

* Breaking changes
* Updated terra-icon to meet accessibility standards.
Expand Down
2 changes: 1 addition & 1 deletion packages/terra-icon/scripts/src/generate-icons/parseSvg.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import Icon from './Icon';
const parseSvg = filepath => new Promise((resolve) => {
const source = fs.readFileSync(filepath, 'utf-8');
const { name } = path.parse(filepath);

const { document } = new JSDOM(source).window;
const icon = new Icon(name, document.querySelector('svg'));

Expand Down
2 changes: 1 addition & 1 deletion packages/terra-icon/src/IconBase.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ const IconBase = ({
attributes.height = height;
attributes.width = width;
attributes.focusable = focusable;

const svgA11yLabel = React.createElement('title', {}, a11yLabel);
const svgChildren = new Array(svgA11yLabel).concat(children);

Expand Down
1 change: 1 addition & 0 deletions packages/terra-icon/src/IconBaseDec.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ const IconBase = ({
children,
height,
width,
title,
focusable,
...customProps
}) => {
Expand Down

0 comments on commit 9bf69dc

Please sign in to comment.