@@ -56,7 +56,7 @@ class StepVertical extends React.Component {
56
56
/**
57
57
* stepIcon represents the icon used for each step.
58
58
*/
59
- stepIcon = ( renderIcon ) => {
59
+ stepIcon = ( renderIcon , status , props ) => {
60
60
const data = {
61
61
isSelected : this . props . isSelected ,
62
62
isError : this . props . isError ,
@@ -87,6 +87,15 @@ class StepVertical extends React.Component {
87
87
onClick = { handleClick }
88
88
>
89
89
{ icon }
90
+ < span className = "slds-assistive-text" >
91
+ { this . props . step . assistiveText || (
92
+ < React . Fragment >
93
+ { `${ this . props . assistiveText . step } ${ this . props . index + 1 } : ` }
94
+ { this . props . step . label }
95
+ { status ? ` - ${ status } ` : '' }
96
+ </ React . Fragment >
97
+ ) }
98
+ </ span >
90
99
</ button >
91
100
) : (
92
101
< span
@@ -99,6 +108,15 @@ class StepVertical extends React.Component {
99
108
} ) }
100
109
>
101
110
{ icon }
111
+ < span className = "slds-assistive-text" >
112
+ { this . props . step . assistiveText || (
113
+ < React . Fragment >
114
+ { `${ props . assistiveText . step } ${ props . index + 1 } : ` }
115
+ { props . step . label }
116
+ { status ? ` - ${ status } ` : '' }
117
+ </ React . Fragment >
118
+ ) }
119
+ </ span >
102
120
</ span >
103
121
) ;
104
122
} ;
@@ -143,6 +161,14 @@ class StepVertical extends React.Component {
143
161
144
162
render ( ) {
145
163
const renderIcon = this . props . isCompleted || this . props . isError ;
164
+ let status = '' ;
165
+ if ( this . props . isError ) {
166
+ status = this . props . assistiveText . errorStep ;
167
+ } else if ( this . props . isCompleted ) {
168
+ status = this . props . assistiveText . completedStep ;
169
+ } else if ( this . props . isDisabled ) {
170
+ status = this . props . assistiveText . disabledStep ;
171
+ }
146
172
147
173
return (
148
174
< li
@@ -152,7 +178,7 @@ class StepVertical extends React.Component {
152
178
'slds-has-error' : this . props . isError ,
153
179
} ) }
154
180
>
155
- { this . stepIcon ( renderIcon ) }
181
+ { this . stepIcon ( renderIcon , status , this . props ) }
156
182
{ this . renderStepContent ( ) }
157
183
</ li >
158
184
) ;
0 commit comments