Skip to content

Commit

Permalink
fix(icon): set aria-hidden (#1126)
Browse files Browse the repository at this point in the history
* fix(icon): set aria-hidden

* docs: set aria-hidden attribute of nx-icon in examples

* fix: set aria-hidden attribute of nx-icon in components

---------

Co-authored-by: Philipp Fahrenschon <[email protected]>
  • Loading branch information
2 people authored and GitHub Enterprise committed Feb 15, 2024
1 parent 8ae0652 commit d7f47de
Show file tree
Hide file tree
Showing 88 changed files with 423 additions and 198 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
(click)="onSelect(action)"
[selected]="action === selectedAction"
>
<nx-icon nxActionIcon [name]="action.icon"></nx-icon>
<nx-icon nxActionIcon [name]="action.icon" aria-hidden="true"></nx-icon>
<span class="label-content">
{{action.label}}
<nx-indicator
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
[queryParams]="action.query"
routerLinkActive="is-selected"
>
<nx-icon nxActionIcon [name]="action.icon"></nx-icon>
<nx-icon nxActionIcon [name]="action.icon" aria-hidden="true"></nx-icon>
{{action.label}}
</button>
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
(click)="onSelect(action)"
[selected]="action === selectedAction"
>
<nx-icon nxActionIcon [name]="action.icon"></nx-icon>
<nx-icon nxActionIcon [name]="action.icon" aria-hidden="true"></nx-icon>
{{action.label}}
</button>
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
</button>

<button nxAvatar aria-label="show user details" class="nx-margin-right-s">
<nx-icon name="user-o"></nx-icon>
<nx-icon name="user-o" aria-hidden="true"></nx-icon>
</button>

<button nxAvatar aria-label="show user details" class="nx-margin-right-s">
Expand All @@ -21,7 +21,7 @@
disabled
class="nx-margin-right-s"
>
<nx-icon name="user-o"></nx-icon>
<nx-icon name="user-o" aria-hidden="true"></nx-icon>
</button>

<button nxAvatar aria-label="show user details" disabled>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
<div nxAvatar class="color-1 nx-margin-right-s">MD</div>
<div nxAvatar class="color-2 nx-margin-right-s">MD</div>
<div nxAvatar aria-label="Logged in" class="color-3">
<nx-icon name="user-o"></nx-icon>
<nx-icon name="user-o" aria-hidden="true"></nx-icon>
</div>
</div>

<div class="container">
<div nxAvatar class="color-4 nx-margin-right-s">MD</div>
<div nxAvatar class="color-5 nx-margin-right-s">MD</div>
<div nxAvatar aria-label="Logged in" class="color-6">
<nx-icon name="user-o"></nx-icon>
<nx-icon name="user-o" aria-hidden="true"></nx-icon>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div nxAvatar class="nx-margin-right-s">MD</div>

<div nxAvatar aria-label="Logged in" class="nx-margin-right-s">
<nx-icon name="user-o"></nx-icon>
<nx-icon name="user-o" aria-hidden="true"></nx-icon>
</div>

<div nxAvatar aria-label="Logged in as Samantha Owl">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,14 @@
<a nxButton="primary small" href="#" disabled>Small</a>

<a nxButton="primary" href="#">
<nx-icon name="download" class="nx-margin-right-2xs"></nx-icon>Download
<nx-icon
name="download"
class="nx-margin-right-2xs"
aria-hidden="true"
></nx-icon
>Download
</a>

<a nxIconButton="primary" aria-label="send mail" href="#">
<nx-icon name="mail-o"></nx-icon>
<nx-icon name="mail-o" aria-hidden="true"></nx-icon>
</a>
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
type="button"
class="nx-margin-bottom-0 nx-margin-right-xs"
>
<nx-icon name="bell-o"></nx-icon>
<nx-icon name="bell-o" aria-hidden="true"></nx-icon>
<nx-indicator position="over-icon"></nx-indicator>
</button>

Expand All @@ -14,7 +14,7 @@
type="button"
class="nx-margin-bottom-0 nx-margin-right-xs"
>
<nx-icon name="bell-o"></nx-icon>
<nx-icon name="bell-o" aria-hidden="true"></nx-icon>
<nx-indicator position="over-icon">1</nx-indicator>
</button>

Expand All @@ -24,6 +24,6 @@
type="button"
class="nx-margin-bottom-0"
>
<nx-icon name="bell-o"></nx-icon>
<nx-icon name="bell-o" aria-hidden="true"></nx-icon>
<nx-indicator position="over-icon">99+</nx-indicator>
</button>
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<button nxIconButton="primary" aria-label="send mail" type="button">
<nx-icon name="mail-o"></nx-icon>
<nx-icon name="mail-o" aria-hidden="true"></nx-icon>
</button>
<button nxIconButton="secondary" aria-label="like on facebook" type="button">
<nx-icon name="facebook"></nx-icon>
<nx-icon name="facebook" aria-hidden="true"></nx-icon>
</button>
<button nxIconButton="tertiary" aria-label="tweet" type="button">
<nx-icon name="twitter"></nx-icon>
<nx-icon name="twitter" aria-hidden="true"></nx-icon>
</button>
<button nxIconButton="cta" aria-label="send mail" type="button">
<nx-icon name="mail"></nx-icon>
<nx-icon name="mail" aria-hidden="true"></nx-icon>
</button>
<button nxIconButton="emphasis" disabled aria-label="send mail" type="button">
<nx-icon name="mail-o"></nx-icon>
<nx-icon name="mail-o" aria-hidden="true"></nx-icon>
</button>
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@ <h4 nxHeadline="subsection-xsmall" class="nx-margin-bottom-s">
type="button"
class="nx-margin-right-m"
>
<nx-icon name="download" nxIconPositionStart></nx-icon>Download
<nx-icon name="download" nxIconPositionStart aria-hidden="true"></nx-icon
>Download
</button>
<button nxPlainButton variant="secondary" type="button" aria-label="add item">
<nx-icon name="plus"></nx-icon>
<nx-icon name="plus" aria-hidden="true"></nx-icon>
</button>

<h4 nxHeadline="subsection-xsmall" class="nx-margin-bottom-s nx-margin-top-l">
Expand All @@ -41,10 +42,11 @@ <h4 nxHeadline="subsection-xsmall" class="nx-margin-bottom-s nx-margin-top-l">
type="button"
class="nx-margin-right-m"
>
<nx-icon name="download" nxIconPositionStart></nx-icon>Secondary small
<nx-icon name="download" nxIconPositionStart aria-hidden="true"></nx-icon
>Secondary small
</button>
<button nxPlainButton size="small" type="button" aria-label="add item">
<nx-icon name="plus"></nx-icon>
<nx-icon name="plus" aria-hidden="true"></nx-icon>
</button>
<br />
<button nxPlainButton size="small" critical type="button">Danger</button>
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
Plain Button
</button>
<button nxPlainButton type="button" class="nx-margin-right-m">
<nx-icon name="download" nxIconPositionStart></nx-icon>Download
<nx-icon name="download" nxIconPositionStart aria-hidden="true"></nx-icon
>Download
</button>
<button nxPlainButton type="button" aria-label="add item">
<nx-icon name="plus"></nx-icon>
<nx-icon name="plus" aria-hidden="true"></nx-icon>
</button>
<br />
<button nxPlainButton="danger" type="button">Danger</button>
Original file line number Diff line number Diff line change
@@ -1,21 +1,25 @@
<button nxButton="primary" type="button">
<nx-icon name="download" nxIconPositionStart></nx-icon>Download
<nx-icon name="download" nxIconPositionStart aria-hidden="true"></nx-icon
>Download
</button>
<button nxButton="secondary" type="button">
<nx-icon name="arrow-right" nxIconPositionEnd></nx-icon>
<nx-icon name="arrow-right" nxIconPositionEnd aria-hidden="true"></nx-icon>
next
</button>
<button nxButton="tertiary" type="button">
<nx-icon name="arrow-right" nxIconPositionStart></nx-icon>Details
<nx-icon name="arrow-right" nxIconPositionStart aria-hidden="true"></nx-icon
>Details
</button>

<button nxButton="primary small" type="button">
<nx-icon name="download" nxIconPositionStart></nx-icon>Download
<nx-icon name="download" nxIconPositionStart aria-hidden="true"></nx-icon
>Download
</button>
<button nxButton="secondary small" type="button">
<nx-icon name="arrow-right" nxIconPositionEnd></nx-icon>
<nx-icon name="arrow-right" nxIconPositionEnd aria-hidden="true"></nx-icon>
next
</button>
<button nxButton="tertiary small" type="button">
<nx-icon name="arrow-right" nxIconPositionStart></nx-icon>Details
<nx-icon name="arrow-right" nxIconPositionStart aria-hidden="true"></nx-icon
>Details
</button>
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,13 @@
class="nx-margin-left-xs"
[nxPopoverTriggerFor]="popover"
nxPopoverTrigger="click"
aria-label="More information"
>
<nx-icon size="s" name="info-circle-o"></nx-icon>
<nx-icon
size="s"
name="info-circle-o"
aria-hidden="true"
></nx-icon>
</button>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,10 @@
nxPopoverTrigger="click"
type="button"
>
<nx-icon name="info-circle-o"></nx-icon>
<nx-icon
name="info-circle-o"
aria-hidden="true"
></nx-icon>
</button>
<nx-popover #popoverContent1>
<span>Summary of what all services include</span>
Expand Down Expand Up @@ -96,7 +99,10 @@
nxPopoverTrigger="click"
type="button"
>
<nx-icon name="info-circle-o"></nx-icon>
<nx-icon
name="info-circle-o"
aria-hidden="true"
></nx-icon>
</button>
<nx-popover #popoverContent2>
<span>Service headline popover content</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@
nxPopoverTrigger="click"
type="button"
>
<nx-icon name="info-circle-o"></nx-icon>
<nx-icon
name="info-circle-o"
aria-hidden="true"
></nx-icon>
</button>
<nx-popover #popoverContent>
<span>{{ element['description'] }}</span>
Expand Down Expand Up @@ -99,7 +102,10 @@
nxPopoverTrigger="click"
type="button"
>
<nx-icon name="info-circle-o"></nx-icon>
<nx-icon
name="info-circle-o"
aria-hidden="true"
></nx-icon>
</button>
<nx-popover #popoverContent>
<span>{{row['description']}}</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@
aria-label="More information"
type="button"
>
<nx-icon name="info-circle-o"></nx-icon>
<nx-icon
name="info-circle-o"
aria-hidden="true"
></nx-icon>
</button>
<nx-popover #popover>
<span
Expand Down Expand Up @@ -75,7 +78,10 @@
nxPopoverTrigger="click"
type="button"
>
<nx-icon name="info-circle-o"></nx-icon>
<nx-icon
name="info-circle-o"
aria-hidden="true"
></nx-icon>
</button>
<nx-popover #popoverContent1>
<span>Service headline popover content</span>
Expand All @@ -99,7 +105,10 @@
nxPopoverTrigger="click"
type="button"
>
<nx-icon name="info-circle-o"></nx-icon>
<nx-icon
name="info-circle-o"
aria-hidden="true"
></nx-icon>
</button>
<nx-popover #popoverContent2>
<span>Service headline popover content</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@
aria-label="More information"
type="button"
>
<nx-icon name="info-circle-o"></nx-icon>
<nx-icon
name="info-circle-o"
aria-hidden="true"
></nx-icon>
</button>
<nx-popover #popover>
<span
Expand Down Expand Up @@ -107,7 +110,10 @@
nxPopoverTrigger="click"
type="button"
>
<nx-icon name="info-circle-o"></nx-icon>
<nx-icon
name="info-circle-o"
aria-hidden="true"
></nx-icon>
</button>
<nx-popover #popoverContent1>
<span>Service headline popover content</span>
Expand Down Expand Up @@ -137,7 +143,10 @@
nxPopoverTrigger="click"
type="button"
>
<nx-icon name="info-circle-o"></nx-icon>
<nx-icon
name="info-circle-o"
aria-hidden="true"
></nx-icon>
</button>
<nx-popover #popoverContent2>
<span>Service headline popover content</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@
aria-label="More information"
type="button"
>
<nx-icon name="info-circle-o"></nx-icon>
<nx-icon
name="info-circle-o"
aria-hidden="true"
></nx-icon>
</button>
<nx-popover #popover>
<span
Expand Down Expand Up @@ -76,7 +79,10 @@
nxPopoverTrigger="click"
type="button"
>
<nx-icon name="info-circle-o"></nx-icon>
<nx-icon
name="info-circle-o"
aria-hidden="true"
></nx-icon>
</button>
<nx-popover #popoverContent1>
<span>Service headline popover content</span>
Expand Down Expand Up @@ -106,7 +112,10 @@
nxPopoverTrigger="click"
type="button"
>
<nx-icon name="info-circle-o"></nx-icon>
<nx-icon
name="info-circle-o"
aria-hidden="true"
></nx-icon>
</button>
<nx-popover #popoverContent2>
<span>Service headline popover content</span>
Expand Down
Loading

0 comments on commit d7f47de

Please sign in to comment.