Skip to content

Commit cbc3aae

Browse files
authored
refactor(progress): replaced output by label due to a11y testing (#165)
refactor(progress): replaced output by label due to a11y testing feedback
1 parent a908ba4 commit cbc3aae

8 files changed

+24
-10
lines changed
Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
<div class="elm-progress">
2-
<progress {{#if value}}value="{{ value }}" {{#if maximalvalue }} max="{{ maximalvalue }}" {{/if}}{{#if conic}}
3-
style="--progress-conic: {{ value }}" {{/if}}{{/if}} id="{{ id }}"{{#if type}} data-type="{{type}}"{{/if }}></progress>
4-
{{#if_eq type 'loader'}}{{#if value}}<output for="{{ id }}">{{ value }}{{ unit }}</output>{{/if}}{{/if_eq}}
2+
<progress
3+
{{#if value}}
4+
value="{{ value }}"
5+
{{#if maximalvalue }} max="{{ maximalvalue }}"{{/if}}
6+
{{#if conic}} style="--progress-conic: {{ value }}"{{/if}}
7+
{{/if}}
8+
id="{{ id }}"
9+
{{#if type}} data-type="{{type}}"{{/if }}
10+
aria-describedby="{{ id }}-label"></progress>
11+
{{#if_eq type 'loader'}}
12+
{{#if value}}<label
13+
for="{{ id }}"
14+
id="{{ id }}-label"
15+
aria-hidden="true">{{ value }}{{ unit }}</label>
16+
{{/if}}
17+
{{/if_eq}}
518
</div>

source/_patterns/01-elements/progress/progress.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
"value": "68",
33
"maximalvalue": "100",
44
"unit": "%",
5-
"id": "progress-label-01",
5+
"id": "progress-01",
66
"type": "loader"
77
}

source/_patterns/01-elements/progress/progress.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@
9696
background: none;
9797
}
9898

99-
& + output {
99+
& + output, // legacy; TODO: remove with the next major release
100+
& + label {
100101
align-items: center;
101102
background: $progress-conic-inner-backgroundColor; // * TODO: possibly rework variable naming
102103
border-radius: 50%;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"id": "progress-label-06",
2+
"id": "progress-06",
33
"conic": true
44
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"id": "progress-label-04",
2+
"id": "progress-04",
33
"conic": true
44
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"id": "progress-label-03"
2+
"id": "progress-03"
33
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"value": "",
3-
"id": "progress-label-08",
3+
"id": "progress-08",
44
"type": "spinner"
55
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"value": "68",
3-
"id": "progress-label-07",
3+
"id": "progress-07",
44
"type": "spinner"
55
}

0 commit comments

Comments
 (0)