@@ -22,48 +22,55 @@ export const ContactRequestStepper = () => {
22
22
const value = activeStep * ( 100 / maxStep ) ;
23
23
const stepAriaLabel = ( step : number ) => {
24
24
const phaseDescription = t ( ContactRequestFormStep [ step ] ) ;
25
- const phaseNumberPart = `${ step } /${ maxStep } ` ;
25
+ const phaseNumberPart = t ( 'phaseNumber' , {
26
+ current : step ,
27
+ total : maxStep ,
28
+ } ) ;
26
29
if ( step < activeStep ) {
27
30
return `${ phasePrefix } ${ phaseNumberPart } , ${ t (
28
31
'completed' ,
29
32
) } : ${ phaseDescription } `;
30
- } else if ( step == activeStep ) {
31
- return `${ phasePrefix } ${ phaseNumberPart } , ${ t (
32
- 'active' ,
33
- ) } : ${ phaseDescription } `;
34
33
} else {
35
34
return `${ phasePrefix } ${ phaseNumberPart } : ${ phaseDescription } ` ;
36
35
}
37
36
} ;
37
+
38
38
const text = `${ activeStep } /${ maxStep } ` ;
39
+ const ariaText = t ( 'phaseNumber' , {
40
+ current : activeStep ,
41
+ total : maxStep ,
42
+ } ) ;
39
43
40
- const ariaLabel = `${ translateCommon ( 'phase' ) } ${ text } : ${ t (
41
- ContactRequestFormStep [ activeStep ] ,
42
- ) } `;
44
+ const ariaLabel = `${ translateCommon ( 'phase' ) } ${ ariaText } ` ;
43
45
44
46
return isPhone ? (
45
- < CircularStepper
46
- value = { value }
47
- ariaLabel = { ariaLabel }
48
- phaseText = { text }
49
- size = { 90 }
50
- />
47
+ < div aria-label = { t ( 'ariaLabel' ) } role = "group" >
48
+ < CircularStepper
49
+ value = { value }
50
+ ariaLabel = { ariaLabel }
51
+ phaseText = { text }
52
+ size = { 90 }
53
+ />
54
+ </ div >
51
55
) : (
52
56
< Stepper
57
+ aria-label = { t ( 'ariaLabel' ) }
58
+ role = "group"
53
59
className = "contact-request-page__stepper"
54
60
activeStep = { activeStep - 1 }
55
61
>
56
62
{ stepNumbers . map ( ( v ) => (
57
63
< Step key = { v } >
58
64
< StepLabel
65
+ aria-current = { activeStep === v && 'step' }
59
66
aria-label = { stepAriaLabel ( v ) }
60
67
className = {
61
68
activeStep < v
62
69
? 'contact-request-page__stepper__step--disabled'
63
70
: undefined
64
71
}
65
72
>
66
- { t ( ContactRequestFormStep [ v ] ) }
73
+ < span aria-hidden = { true } > { t ( ContactRequestFormStep [ v ] ) } </ span >
67
74
</ StepLabel >
68
75
</ Step >
69
76
) ) }
0 commit comments