Skip to content

Commit 10fba99

Browse files
ludovic35pylapp
andcommitted
refactor: badge component to use internal icons for some status (#1136) (#1153)
Closes #1136 Co-authored-by: Ludovic Pinel <[email protected]> Co-authored-by: Pierre-Yves Lapersonne <[email protected]> Reviewed-by: Pierre-Yves Lapersonne <[email protected]> Signed-off-by: Pierre-Yves Lapersonne <[email protected]>
1 parent c43ac7d commit 10fba99

File tree

53 files changed

+442
-233
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+442
-233
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1515

1616
### Changed
1717

18+
- Update `badge` to use internal icons for some status (Orange-OpenSource/ouds-ios#1136)
1819
- `SwiftFormat` Swift package plugin from v0.58.5 to v0.58.6
1920
- `actions/dependency-review-action` action from v4.8.1 to v4.8.2 for `dependency-review` workflow
2021
- `color` semantic tokens (tokens libraries Core v1.9, System v2.2)

OUDS/Core/Components/Sources/Actions/Button/OUDSButton.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
import OUDSFoundations
1515
import SwiftUI
1616

17-
// MARK: - OUDSThemesContract Button
17+
// MARK: - OUDS Button
1818

1919
/// The ``OUDSButton`` proposes layout with text only, icon only or text with icon.
2020
///
@@ -137,7 +137,7 @@ public struct OUDSButton: View {
137137
case textAndIcon(text: String, icon: Image, flipIcon: Bool)
138138
}
139139

140-
/// Represents the appearance of an OUDSThemesContract button, i.e. a kind of type
140+
/// Represents the appearance of an OUDS button, i.e. a kind of type
141141
public enum Appearance {
142142
/// Default button is used for action
143143
case `default`

OUDS/Core/Components/Sources/Controls/Checkbox/Internal/CheckboxIndicator.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ struct CheckboxIndicator: View {
7272
case .pressed:
7373
theme.colors.actionNegativePressed
7474
case .disabled, .readOnly:
75-
OL.fatal("An OUDSThemesContract Checkbox with a disabled state / read only mode and an error situation has been detected, which is not allowed"
75+
OL.fatal("An OUDS Checkbox with a disabled state / read only mode and an error situation has been detected, which is not allowed"
7676
+ " Only non-error situation are allowed to have a disabled state / read only mode.")
7777
}
7878

OUDS/Core/Components/Sources/Controls/Checkbox/Internal/CheckboxIndicatorModifiers.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ private struct CheckboxIndicatorForegroundModifier: ViewModifier {
9898

9999
private var disabledColor: MultipleColorSemanticTokens {
100100
guard !isError else {
101-
OL.fatal("An OUDSThemesContract Checkbox with a disabled state and an error situation has been detected, which is not allowed."
101+
OL.fatal("An OUDS Checkbox with a disabled state and an error situation has been detected, which is not allowed."
102102
+ " Only non-error situation are allowed to have a disabled state.")
103103
}
104104
return theme.colors.actionDisabled
@@ -153,7 +153,7 @@ private struct CheckboxIndicatorBackgroundModifier: ViewModifier {
153153

154154
private var disabledColor: Color {
155155
guard !isError else {
156-
OL.fatal("An OUDSThemesContract Checkbox with a disabled state and an error situation has been detected, which is not allowed."
156+
OL.fatal("An OUDS Checkbox with a disabled state and an error situation has been detected, which is not allowed."
157157
+ " Only non-error situation are allowed to have a disabled state.")
158158
}
159159
return Color.clear
@@ -234,7 +234,7 @@ private struct CheckboxIndicatorBorderModifier: ViewModifier {
234234

235235
private var disabledColor: MultipleColorSemanticTokens {
236236
guard !isError else {
237-
OL.fatal("An OUDSThemesContract Checkbox with a disabled state and an error situation has been detected, which is not allowed"
237+
OL.fatal("An OUDS Checkbox with a disabled state and an error situation has been detected, which is not allowed"
238238
+ " Only non-error situation are allowed to have a disabled state.")
239239
}
240240
return theme.colors.actionDisabled

OUDS/Core/Components/Sources/Controls/Checkbox/OUDSCheckbox.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import OUDSFoundations
1515
import OUDSTokensComponent
1616
import SwiftUI
1717

18-
// MARK: - OUDSThemesContract Checkbox
18+
// MARK: - OUDS Checkbox
1919

2020
/// The ``OUDSCheckbox`` proposes layout to add in your views a lonely checkbox, without labels, texts nor icons components.
2121
/// If you want to use a checkbox with additional texts and icon, prefer instead ``OUDSCheckboxItem``.
@@ -38,7 +38,7 @@ import SwiftUI
3838
/// Note also the component must be instanciated with a string parameter used as accessibility label.
3939
/// It is a good pratice (at least) to define a label for a component without text for accessibility reasons. This label will be vocalized by *Voice Over*.
4040
/// 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-
/// No accessibility identifier is defined in OUDSThemesContract side as this value remains in the users hands.
41+
/// No accessibility identifier is defined in OUDS side as this value remains in the users hands.
4242
///
4343
/// ## Cases forbidden by design
4444
///

OUDS/Core/Components/Sources/Controls/Checkbox/OUDSCheckboxIndeterminate.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import OUDSFoundations
1515
import OUDSTokensComponent
1616
import SwiftUI
1717

18-
// MARK: - OUDSThemesContract Checkbox Indeterminate
18+
// MARK: - OUDS Checkbox Indeterminate
1919

2020
/// The ``OUDSCheckboxIndeterminate`` proposes layout to add in your views a lonely checkbox, without labels, texts nor icons components.
2121
/// If you want to use a checkbox with additional texts and icon, prefer instead ``OUDSCheckboxItem``.

OUDS/Core/Components/Sources/Controls/Checkbox/OUDSCheckboxItem.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
import OUDSFoundations
1515
import SwiftUI
1616

17-
// MARK: - OUDSThemesContract Checkbox Item
17+
// MARK: - OUDS Checkbox Item
1818

1919
/// The ``OUDSCheckboxItem`` proposes layouts to add in your views some checkboxes components with labels and icons.
2020
/// If you want to use a checkbox with only an indicator prefer instead ``OUDSCheckbox``.
@@ -52,7 +52,7 @@ import SwiftUI
5252
/// ## Accessibility considerations
5353
///
5454
/// *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.
55-
/// No accessibility identifier is defined in OUDSThemesContract side as this value remains in the users hands.
55+
/// No accessibility identifier is defined in OUDS side as this value remains in the users hands.
5656
///
5757
/// ## Forbidden by design
5858
///

OUDS/Core/Components/Sources/Controls/Checkbox/OUDSCheckboxItemIndeterminate.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
import OUDSFoundations
1515
import SwiftUI
1616

17-
// MARK: - OUDSThemesContract Checkbox Item Indeterminate
17+
// MARK: - OUDS Checkbox Item Indeterminate
1818

1919
/// The ``OUDSCheckboxItemIndeterminate`` proposes layouts to add in your views some checkboxes components.
2020
/// If you want to use a checkbox with only an indicator prefer instead ``OUDSCheckboxIndeterminate``.

OUDS/Core/Components/Sources/Controls/CheckboxPicker/OUDSCheckboxPicker.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ import SwiftUI
8383
///
8484
/// ## Design documentation
8585
///
86-
/// There is no online specification as this component is not an official OUDSThemesContract one
86+
/// There is no online specification as this component is not an official OUDS one
8787
///
8888
/// ## Themes rendering
8989
///

OUDS/Core/Components/Sources/Controls/Chip/Internal/ChipInteractionState.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ enum ChipInteractionState {
3838
case .disabled:
3939
self = .disabled
4040
case .readOnly:
41-
OL.fatal("An OUDSThemesContract chip is a component which cannot be in read-only mode")
41+
OL.fatal("An OUDS chip is a component which cannot be in read-only mode")
4242
}
4343
}
4444
}

0 commit comments

Comments
 (0)