You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: OUDS/Core/Components/Sources/Checkbox/OUDSCheckbox.swift
+20-7Lines changed: 20 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -33,7 +33,13 @@ import SwiftUI
33
33
/// In addition, the ``OUDSCheckbox`` can be in read only mode, i.e. the user cannot interact with the component yet but this component must not be considered
34
34
/// as disabled.
35
35
///
36
-
/// ## Case forbidden by design
36
+
/// ## Accessibility considerations
37
+
///
38
+
/// Note also the component must be instanciated with a string parameter used as accessibility label.
39
+
/// It is a good pratice (a least) to define a label for a component without text for accessibility reasons. This label will be vocalized by *Voice Over*.
40
+
/// The vocalization tool will also use, after the label, a description of the component (if disabled, if error context), and a fake trait for checkbox.
41
+
///
42
+
/// ## Cases forbidden by design
37
43
///
38
44
/// **The design system does not allow to have both an error situation and a disabled component.**
39
45
///
@@ -44,14 +50,14 @@ import SwiftUI
44
50
/// @Published var state: OUDSCheckboxSelectorState = .undeterminate
45
51
///
46
52
/// // A simple checkbox, no error, not in read only mode
47
-
/// OUDSCheckbox(state: $state)
53
+
/// OUDSCheckbox(state: $state, accessibilityLabel: "The cake is a lie")
48
54
///
49
55
/// // A simple checkbox, but is an error context
50
-
/// OUDSCheckbox(state: $state, isError: true)
56
+
/// OUDSCheckbox(state: $state, accessibilityLabel: "The cake is a lie"), isError: true)
51
57
///
52
58
/// // Never disable an error-related checkbox as it will crash
Copy file name to clipboardExpand all lines: OUDS/Core/Components/Sources/Checkbox/OUDSCheckboxItem.swift
+4Lines changed: 4 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -40,6 +40,10 @@ import SwiftUI
40
40
/// In addition, the ``OUDSCheckboxItem`` can be in read only mode, i.e. the user cannot interact with the component yet but this component must not be considered
41
41
/// as disabled.
42
42
///
43
+
/// ## Accessibility considerations
44
+
///
45
+
/// *Voice Over* will use several elements to describe the component: if component disabled / read only, if error context, the label and helper texts and a custom checkbox trait.
46
+
///
43
47
/// ## Forbidden by design
44
48
///
45
49
/// **The design system does not allow to have both an error situation and a read only component.**
0 commit comments