Skip to content

Commit cb3b078

Browse files
committed
replaced aria-label with title
1 parent 22195d5 commit cb3b078

File tree

4 files changed

+21
-24
lines changed

4 files changed

+21
-24
lines changed

packages/module/src/Ansible/Ansible.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ const Ansible: React.FunctionComponent<AnsibleProps> = ({ unsupported, className
7171
);
7272

7373
return (
74-
<i className={ansibleLogoClass} aria-label={unsupported ? "Ansible is not supported" : "Ansible supported" }{...props}>
74+
<i className={ansibleLogoClass} title={unsupported ? "Ansible is not supported" : "Ansible supported" }{...props}>
7575
<svg
7676
version="1.1"
7777
x="0px"

packages/module/src/Ansible/__snapshots__/Ansible.test.tsx.snap

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
exports[`Ansible component should render supported - boolean 1`] = `
44
<div>
55
<i
6-
aria-label="Ansible supported"
76
class="ansible-0-2-1 ansibleSupported-0-2-2"
7+
title="Ansible supported"
88
>
99
<svg
1010
style="enable-background: new 0 0 2032 2027.2;"
@@ -28,8 +28,8 @@ exports[`Ansible component should render supported - boolean 1`] = `
2828
exports[`Ansible component should render supported - number 1`] = `
2929
<div>
3030
<i
31-
aria-label="Ansible supported"
3231
class="ansible-0-2-1 ansibleSupported-0-2-2"
32+
title="Ansible supported"
3333
>
3434
<svg
3535
style="enable-background: new 0 0 2032 2027.2;"
@@ -53,8 +53,8 @@ exports[`Ansible component should render supported - number 1`] = `
5353
exports[`Ansible component should render unsupported - boolean 1`] = `
5454
<div>
5555
<i
56-
aria-label="Ansible is not supported"
5756
class="ansible-0-2-1 ansibleUnsupported-0-2-3"
57+
title="Ansible is not supported"
5858
>
5959
<svg
6060
style="enable-background: new 0 0 2032 2027.2;"
@@ -102,8 +102,8 @@ exports[`Ansible component should render unsupported - boolean 1`] = `
102102
exports[`Ansible component should render unsupported - number 1`] = `
103103
<div>
104104
<i
105-
aria-label="Ansible is not supported"
106105
class="ansible-0-2-1 ansibleUnsupported-0-2-3"
106+
title="Ansible is not supported"
107107
>
108108
<svg
109109
style="enable-background: new 0 0 2032 2027.2;"

packages/module/src/Battery/Battery.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ const batteryLevels = (severity: BatterySeverity, classMode?: boolean) => {
6262
case 'medium':
6363
case 'warn':
6464
case 2:
65-
return classMode ? 'batteryMedium' : <path role="img" d="M 99.168857,327.14542 H 351.33914 c 5.33437,0 9.69886,-5.04 9.69886,-11.19999 v -28 c 0,-6.16001 -4.36449,-11.2 -9.69886,-11.2 H 99.168857 c -5.334371,0 -9.698857,5.04 -9.698857,11.2 v 28 c 0,6.16 4.364486,11.19999 9.698857,11.19999 z M 99.168993,419.0375 H 351.33927 c 5.33437,0 9.69886,-5.04 9.69886,-11.2 v -28 c 0,-6.16 -4.36449,-11.2 -9.69886,-11.2 H 99.168993 c -5.334371,0 -9.698857,5.04 -9.698857,11.2 v 28 c 0,6.16 4.364486,11.2 9.698857,11.2 z" />;
65+
return classMode ? 'batteryMedium' : <path d="M 99.168857,327.14542 H 351.33914 c 5.33437,0 9.69886,-5.04 9.69886,-11.19999 v -28 c 0,-6.16001 -4.36449,-11.2 -9.69886,-11.2 H 99.168857 c -5.334371,0 -9.698857,5.04 -9.698857,11.2 v 28 c 0,6.16 4.364486,11.19999 9.698857,11.19999 z M 99.168993,419.0375 H 351.33927 c 5.33437,0 9.69886,-5.04 9.69886,-11.2 v -28 c 0,-6.16 -4.36449,-11.2 -9.69886,-11.2 H 99.168993 c -5.334371,0 -9.698857,5.04 -9.698857,11.2 v 28 c 0,6.16 4.364486,11.2 9.698857,11.2 z" />;
6666
case 'low':
6767
case 'info':
6868
case 1:
@@ -91,15 +91,15 @@ const Battery: React.FunctionComponent<BatteryProps> = ({ severity, label, label
9191
const classes = useStyles();
9292
const batteryClasses = clsx(classes.battery, classes[String(batteryLevels(severity, true))], className);
9393

94-
const ariaLabels = { ['aria-label']: `${severity} ${label}` };
94+
const title = { ['title']: `${severity} ${label}` };
9595

9696

9797
const batteryVariant = useMemo(() => batteryLevels(severity) , [ severity ])
9898

9999
return (
100100
<React.Fragment>
101101
{/* eslint-disable-next-line react/no-unknown-property */}
102-
<i className={batteryClasses} {...ariaLabels} {...props} widget-type="Battery" widget-id={label}>
102+
<i className={batteryClasses} {...title} {...props} widget-type="Battery" widget-id={label}>
103103
<svg
104104
version="1.1"
105105
x="0px"

packages/module/src/Battery/__snapshots__/Batery.test.tsx.snap

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
exports[`Battery component API should hide label 1`] = `
44
<div>
55
<i
6-
aria-label="high high"
76
class="battery-0-2-1 batteryHigh-0-2-5"
7+
title="high high"
88
widget-id="high"
99
widget-type="Battery"
1010
>
@@ -31,8 +31,8 @@ exports[`Battery component API should hide label 1`] = `
3131
exports[`Battery component should render correctly CriticalBattery - 4 1`] = `
3232
<div>
3333
<i
34-
aria-label="4 4"
3534
class="battery-0-2-1 batteryCritical-0-2-6"
35+
title="4 4"
3636
widget-id="4"
3737
widget-type="Battery"
3838
>
@@ -64,8 +64,8 @@ exports[`Battery component should render correctly CriticalBattery - 4 1`] = `
6464
exports[`Battery component should render correctly CriticalBattery - critical 1`] = `
6565
<div>
6666
<i
67-
aria-label="critical critical"
6867
class="battery-0-2-1 batteryCritical-0-2-6"
68+
title="critical critical"
6969
widget-id="critical"
7070
widget-type="Battery"
7171
>
@@ -97,8 +97,8 @@ exports[`Battery component should render correctly CriticalBattery - critical 1`
9797
exports[`Battery component should render correctly HighBattery - 3 1`] = `
9898
<div>
9999
<i
100-
aria-label="3 3"
101100
class="battery-0-2-1 batteryHigh-0-2-5"
101+
title="3 3"
102102
widget-id="3"
103103
widget-type="Battery"
104104
>
@@ -130,8 +130,8 @@ exports[`Battery component should render correctly HighBattery - 3 1`] = `
130130
exports[`Battery component should render correctly HighBattery - error 1`] = `
131131
<div>
132132
<i
133-
aria-label="error error"
134133
class="battery-0-2-1 batteryHigh-0-2-5"
134+
title="error error"
135135
widget-id="error"
136136
widget-type="Battery"
137137
>
@@ -163,8 +163,8 @@ exports[`Battery component should render correctly HighBattery - error 1`] = `
163163
exports[`Battery component should render correctly HighBattery - high 1`] = `
164164
<div>
165165
<i
166-
aria-label="high high"
167166
class="battery-0-2-1 batteryHigh-0-2-5"
167+
title="high high"
168168
widget-id="high"
169169
widget-type="Battery"
170170
>
@@ -196,8 +196,8 @@ exports[`Battery component should render correctly HighBattery - high 1`] = `
196196
exports[`Battery component should render correctly LowBattery - 1 1`] = `
197197
<div>
198198
<i
199-
aria-label="1 1"
200199
class="battery-0-2-1 batteryLow-0-2-3"
200+
title="1 1"
201201
widget-id="1"
202202
widget-type="Battery"
203203
>
@@ -229,8 +229,8 @@ exports[`Battery component should render correctly LowBattery - 1 1`] = `
229229
exports[`Battery component should render correctly LowBattery - info 1`] = `
230230
<div>
231231
<i
232-
aria-label="info info"
233232
class="battery-0-2-1 batteryLow-0-2-3"
233+
title="info info"
234234
widget-id="info"
235235
widget-type="Battery"
236236
>
@@ -262,8 +262,8 @@ exports[`Battery component should render correctly LowBattery - info 1`] = `
262262
exports[`Battery component should render correctly LowBattery - low 1`] = `
263263
<div>
264264
<i
265-
aria-label="low low"
266265
class="battery-0-2-1 batteryLow-0-2-3"
266+
title="low low"
267267
widget-id="low"
268268
widget-type="Battery"
269269
>
@@ -295,8 +295,8 @@ exports[`Battery component should render correctly LowBattery - low 1`] = `
295295
exports[`Battery component should render correctly MediumBattery - 2 1`] = `
296296
<div>
297297
<i
298-
aria-label="2 2"
299298
class="battery-0-2-1 batteryMedium-0-2-4"
299+
title="2 2"
300300
widget-id="2"
301301
widget-type="Battery"
302302
>
@@ -314,7 +314,6 @@ exports[`Battery component should render correctly MediumBattery - 2 1`] = `
314314
/>
315315
<path
316316
d="M 99.168857,327.14542 H 351.33914 c 5.33437,0 9.69886,-5.04 9.69886,-11.19999 v -28 c 0,-6.16001 -4.36449,-11.2 -9.69886,-11.2 H 99.168857 c -5.334371,0 -9.698857,5.04 -9.698857,11.2 v 28 c 0,6.16 4.364486,11.19999 9.698857,11.19999 z M 99.168993,419.0375 H 351.33927 c 5.33437,0 9.69886,-5.04 9.69886,-11.2 v -28 c 0,-6.16 -4.36449,-11.2 -9.69886,-11.2 H 99.168993 c -5.334371,0 -9.698857,5.04 -9.698857,11.2 v 28 c 0,6.16 4.364486,11.2 9.698857,11.2 z"
317-
role="img"
318317
/>
319318
</svg>
320319
</i>
@@ -329,8 +328,8 @@ exports[`Battery component should render correctly MediumBattery - 2 1`] = `
329328
exports[`Battery component should render correctly MediumBattery - medium 1`] = `
330329
<div>
331330
<i
332-
aria-label="medium medium"
333331
class="battery-0-2-1 batteryMedium-0-2-4"
332+
title="medium medium"
334333
widget-id="medium"
335334
widget-type="Battery"
336335
>
@@ -348,7 +347,6 @@ exports[`Battery component should render correctly MediumBattery - medium 1`] =
348347
/>
349348
<path
350349
d="M 99.168857,327.14542 H 351.33914 c 5.33437,0 9.69886,-5.04 9.69886,-11.19999 v -28 c 0,-6.16001 -4.36449,-11.2 -9.69886,-11.2 H 99.168857 c -5.334371,0 -9.698857,5.04 -9.698857,11.2 v 28 c 0,6.16 4.364486,11.19999 9.698857,11.19999 z M 99.168993,419.0375 H 351.33927 c 5.33437,0 9.69886,-5.04 9.69886,-11.2 v -28 c 0,-6.16 -4.36449,-11.2 -9.69886,-11.2 H 99.168993 c -5.334371,0 -9.698857,5.04 -9.698857,11.2 v 28 c 0,6.16 4.364486,11.2 9.698857,11.2 z"
351-
role="img"
352350
/>
353351
</svg>
354352
</i>
@@ -363,8 +361,8 @@ exports[`Battery component should render correctly MediumBattery - medium 1`] =
363361
exports[`Battery component should render correctly MediumBattery - warn 1`] = `
364362
<div>
365363
<i
366-
aria-label="warn warn"
367364
class="battery-0-2-1 batteryMedium-0-2-4"
365+
title="warn warn"
368366
widget-id="warn"
369367
widget-type="Battery"
370368
>
@@ -382,7 +380,6 @@ exports[`Battery component should render correctly MediumBattery - warn 1`] = `
382380
/>
383381
<path
384382
d="M 99.168857,327.14542 H 351.33914 c 5.33437,0 9.69886,-5.04 9.69886,-11.19999 v -28 c 0,-6.16001 -4.36449,-11.2 -9.69886,-11.2 H 99.168857 c -5.334371,0 -9.698857,5.04 -9.698857,11.2 v 28 c 0,6.16 4.364486,11.19999 9.698857,11.19999 z M 99.168993,419.0375 H 351.33927 c 5.33437,0 9.69886,-5.04 9.69886,-11.2 v -28 c 0,-6.16 -4.36449,-11.2 -9.69886,-11.2 H 99.168993 c -5.334371,0 -9.698857,5.04 -9.698857,11.2 v 28 c 0,6.16 4.364486,11.2 9.698857,11.2 z"
385-
role="img"
386383
/>
387384
</svg>
388385
</i>
@@ -397,8 +394,8 @@ exports[`Battery component should render correctly MediumBattery - warn 1`] = `
397394
exports[`Battery component should render correctly NullBatery, default 1`] = `
398395
<div>
399396
<i
400-
aria-label=" "
401397
class="battery-0-2-1 batteryDefault-0-2-2"
398+
title=" "
402399
widget-id=""
403400
widget-type="Battery"
404401
>

0 commit comments

Comments
 (0)