@@ -72,30 +72,60 @@ struct StepButtonStyle: ButtonStyle {
7272 horizontalSpacing: self . horizontalSpacing,
7373 verticalSpacing: self . verticalSpacing,
7474 lineSize: self . lineSize)
75+ . accessibilityElement ( children: . combine)
76+ }
77+
78+ var stateAccessibilityLabelValue : String {
79+ guard let state else {
80+ return " "
81+ }
82+ switch state {
83+ case . completed:
84+ return " complete " . localizedFioriString ( )
85+ case . error:
86+ return self . isSelected ? " error active " . localizedFioriString ( ) : " error " . localizedFioriString ( )
87+ case . disabled:
88+ return " read-only " . localizedFioriString ( )
89+ case . normal:
90+ return self . isSelected ? " active " . localizedFioriString ( ) : " "
91+ default :
92+ return " "
93+ }
7594 }
7695
7796 @ViewBuilder func generateNode( _ stepConfig: StepConfiguration ) -> some View {
78- if let s = stepStyle ( id) {
79- s. makeNode ( configuration: stepConfig) . typeErased
80- } else {
81- DefaultStepStyle ( ) . makeNode ( configuration: stepConfig) . typeErased
97+ Group {
98+ if let s = stepStyle ( id) {
99+ s. makeNode ( configuration: stepConfig) . typeErased
100+ } else {
101+ DefaultStepStyle ( ) . makeNode ( configuration: stepConfig) . typeErased
102+ }
82103 }
104+ . accessibilitySortPriority ( 1 )
83105 }
84106
85107 @ViewBuilder func generateTitle( _ stepConfig: StepConfiguration ) -> some View {
86- if let s = stepStyle ( id) {
87- s. makeTitle ( configuration: stepConfig) . typeErased
88- } else {
89- DefaultStepStyle ( ) . makeTitle ( configuration: stepConfig) . typeErased
108+ Group {
109+ if let s = stepStyle ( id) {
110+ s. makeTitle ( configuration: stepConfig) . typeErased
111+ } else {
112+ DefaultStepStyle ( ) . makeTitle ( configuration: stepConfig) . typeErased
113+ }
90114 }
115+ . accessibilitySortPriority ( 0.5 )
91116 }
92117
93118 @ViewBuilder func generateLine( _ stepConfig: StepConfiguration ) -> some View {
94- if let s = stepStyle ( id) {
95- s. makeLine ( configuration: stepConfig) . typeErased
96- } else {
97- DefaultStepStyle ( ) . makeLine ( configuration: stepConfig) . typeErased
119+ Group {
120+ if let s = stepStyle ( id) {
121+ s. makeLine ( configuration: stepConfig) . typeErased
122+ } else {
123+ DefaultStepStyle ( ) . makeLine ( configuration: stepConfig) . typeErased
124+ }
98125 }
126+ . accessibilityHidden ( false )
127+ . accessibilityLabel ( self . stateAccessibilityLabelValue)
128+ . accessibilitySortPriority ( 0 )
99129 }
100130}
101131
0 commit comments