Skip to content

Commit 4ac6be4

Browse files
Merge branch 'main' into main
2 parents 1ca4bd9 + 0c326c7 commit 4ac6be4

File tree

2 files changed

+53
-12
lines changed

2 files changed

+53
-12
lines changed

Sources/FioriSwiftUICore/Views/StepProgressIndicator/StepsStyles.swift

Lines changed: 42 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Sources/FioriSwiftUICore/_localization/en.lproj/FioriSwiftUICore.strings

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -593,6 +593,17 @@
593593
/* XBUT: Close button title */
594594
"Close" = "Close";
595595

596+
/* XMSG: Accessibility label for completed state in step progress indicator */
597+
"complete" = "complete";
598+
599+
/* XMSG: Accessibility label for active state in step progress indicator */
600+
"active" = "active";
601+
602+
/* XMSG: Accessibility label for error active state in step progress indicator */
603+
"error active" = "error active";
604+
605+
/* XMSG: Accessibility label for read-only state in step progress indicator */
606+
"read-only" = "read-only";
596607
/* XACT: The accessibility value for Stepper decrement*/
597608
"Decrease the value by %f" = "Decrease the value by %f";
598609

0 commit comments

Comments
 (0)