Skip to content

Commit 48d7682

Browse files
committed
Fix: A11y improvements
1 parent 56d4461 commit 48d7682

File tree

5 files changed

+39
-41
lines changed

5 files changed

+39
-41
lines changed

packages/components/src/components/hds/stepper/list/index.hbs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Copyright (c) HashiCorp, Inc.
33
SPDX-License-Identifier: MPL-2.0
44
}}
5-
<ul class={{this.classNames}} ...attributes>
5+
<ol class={{this.classNames}} ...attributes>
66
{{yield
77
(hash
88
Step=(component
@@ -15,4 +15,4 @@
1515
)
1616
to="steps"
1717
}}
18-
</ul>
18+
</ol>

packages/components/src/components/hds/stepper/list/step.hbs

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@
1212
/>
1313
</div>
1414
<div class="hds-stepper-list__step__text">
15-
<span class="sr-only">{{this.statusSrOnlyText}}</span>
1615
<Hds::Text::Display
1716
class="hds-stepper-list__step__title"
1817
@tag={{this.titleTag}}
1918
@size="300"
2019
@weight="medium"
2120
@color="primary"
2221
>
22+
<span class="sr-only">{{this.statusSrOnlyText}}</span>
2323
{{yield to="title"}}
2424
</Hds::Text::Display>
2525
<Hds::Text::Body

packages/components/src/components/hds/stepper/navigation/index.hbs

+33-35
Original file line numberDiff line numberDiff line change
@@ -2,40 +2,38 @@
22
Copyright (c) HashiCorp, Inc.
33
SPDX-License-Identifier: MPL-2.0
44
}}
5-
<div class={{this.classNames}} ...attributes>
6-
<ul class="hds-stepper-navigation__step-list">
7-
{{#if @steps}}
8-
{{#each @steps as |step|}}
9-
<Hds::Stepper::Navigation::Step
10-
@currentStep={{this.currentStep}}
11-
@isComplete={{step.isComplete}}
12-
@isInteractive={{step.isInteractive}}
13-
@titleTag={{this.titleTag}}
14-
@didInsertNode={{this.didInsertStep}}
15-
@stepIds={{this._stepIds}}
16-
@onStepChange={{@onStepChange}}
17-
@onKeyUp={{this.onKeyUp}}
18-
>
19-
<:title>{{step.title}}</:title>
20-
<:description>{{step.description}}</:description>
21-
</Hds::Stepper::Navigation::Step>
22-
{{/each}}
23-
{{else}}
24-
{{yield
25-
(hash
26-
Step=(component
27-
"hds/stepper/navigation/step"
28-
currentStep=this.currentStep
29-
titleTag=this.titleTag
30-
didInsertNode=this.didInsertStep
31-
stepIds=this._stepIds
32-
onStepChange=@onStepChange
33-
onKeyUp=this.onKeyUp
34-
)
5+
<ol class={{this.classNames}} ...attributes>
6+
{{#if @steps}}
7+
{{#each @steps as |step|}}
8+
<Hds::Stepper::Navigation::Step
9+
@currentStep={{this.currentStep}}
10+
@isComplete={{step.isComplete}}
11+
@isInteractive={{step.isInteractive}}
12+
@titleTag={{this.titleTag}}
13+
@didInsertNode={{this.didInsertStep}}
14+
@stepIds={{this._stepIds}}
15+
@onStepChange={{@onStepChange}}
16+
@onKeyUp={{this.onKeyUp}}
17+
>
18+
<:title>{{step.title}}</:title>
19+
<:description>{{step.description}}</:description>
20+
</Hds::Stepper::Navigation::Step>
21+
{{/each}}
22+
{{else}}
23+
{{yield
24+
(hash
25+
Step=(component
26+
"hds/stepper/navigation/step"
27+
currentStep=this.currentStep
28+
titleTag=this.titleTag
29+
didInsertNode=this.didInsertStep
30+
stepIds=this._stepIds
31+
onStepChange=@onStepChange
32+
onKeyUp=this.onKeyUp
3533
)
36-
to="steps"
37-
}}
38-
{{/if}}
39-
</ul>
40-
</div>
34+
)
35+
to="steps"
36+
}}
37+
{{/if}}
38+
</ol>
4139
{{yield to="body"}}

packages/components/src/components/hds/stepper/navigation/step.hbs

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@
2222
/>
2323
</div>
2424
<div class="hds-stepper-navigation__step__text">
25-
<span class="sr-only">{{this.statusSrOnlyText}}</span>
2625
<Hds::Text::Display
2726
class="hds-stepper-navigation__step__title"
2827
@tag={{this.titleTag}}
2928
@size="300"
3029
@weight="medium"
3130
@color="primary"
3231
>
32+
<span class="sr-only">{{this.statusSrOnlyText}}</span>
3333
{{yield to="title"}}
3434
</Hds::Text::Display>
3535
<Hds::Text::Body

packages/components/src/styles/components/stepper/navigation.scss

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99

1010
@use "../../mixins/focus-ring" as *;
1111

12-
.hds-stepper-navigation__step-list,
12+
.hds-stepper-navigation,
1313
.hds-stepper-navigation__step {
1414
margin: 0;
1515
padding: 0;
1616
list-style: none;
1717
}
1818

19-
.hds-stepper-navigation__step-list {
19+
.hds-stepper-navigation {
2020
display: flex;
2121
}
2222

0 commit comments

Comments
 (0)