Skip to content

Commit c457c5e

Browse files
authored
feat: add tab bar component (#1135) (#1202)
Add tab bar for iOS, iPadOS, visionOS and macOS platforms Closes #1135 Tested-by: Benoit Suzanne <benoit.suzanne@orange.com> Tested-by: Jérôme Régnier <jerome.regnier@orange.com> Tested-by: Maxime Tonnerre <maxime.tonnerre@orange.com> Reviewed-by: Ludovic Pinel <ludovic.pinel@orange.com> Signed-off-by: Pierre-Yves Lapersonne <pierreyves.lapersonne@orange.com>
1 parent 1d643d5 commit c457c5e

File tree

96 files changed

+1719
-532
lines changed

Some content is hidden

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

96 files changed

+1719
-532
lines changed

AGENTS.md

Lines changed: 57 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -681,4 +681,60 @@ OUDSLink(text: "Text", indicator: .back, size: .default) { /* the action to proc
681681
or with an image:
682682
```swift
683683
OUDSLink(text: "Text", icon: Image("image_name"), size: .default) { /* the action to process */ }
684-
```
684+
```
685+
686+
##### Tab bar
687+
688+
Tab bar is a navigation component, based a lot on the iOS native component, and displays tabs to the user which redirect to views and journeys.
689+
Its documentation is [available online](https://ios.unified-design-system.orange.com/documentation/oudscomponents/oudstabbar).
690+
691+
If iOS lower than 26 is managed, a selected tab indicator must be displayed, thus the component must know the number of items to display and get
692+
a selected item info associated to a tag:
693+
694+
```swift
695+
OUDSTabBar(selected: 0, count: 3) {
696+
697+
// Add the views with the SwiftUI tab item and labels
698+
// No need to define colors, everything is done inside OUDSTabBar
699+
// Image must be in 26 x 26
700+
// Tag value must be used in "selected" parameter
701+
SomeView()
702+
.tabItem {
703+
Label("Label 1", image: "image_1")
704+
}
705+
.tag(0)
706+
OtherView()
707+
.tabItem {
708+
Label("Label 2", image: "image_2")
709+
}
710+
.tag(1)
711+
LastView()
712+
.tabItem {
713+
Label("Label 3", image: "image_3")
714+
}
715+
.tag(2)
716+
}
717+
```
718+
719+
If the user targets iOS 26 and greater, prefer this definition of tab bar:
720+
```swift
721+
OUDSTabBar {
722+
723+
// Add the views with the SwiftUI tab item and labels
724+
// No need to define colors, everything is done inside OUDSTabBar
725+
// Image must be in 26 x 26
726+
SomeView()
727+
.tabItem {
728+
Label("Label 1", image: "image_1")
729+
}
730+
OtherView()
731+
.tabItem {
732+
Label("Label 2", image: "image_2")
733+
}
734+
LastView()
735+
.tabItem {
736+
Label("Label 3", image: "image_3")
737+
}
738+
}
739+
```
740+

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
### Added
1111

12+
- `tab bar` component (Orange-OpenSource/ouds-ios#1135)
1213
- `constrainedMaxWidth` parameter to control items and text input components (Orange-OpenSource/ouds-ios#1211)
1314

1415
### Changed
1516

17+
- Define timeout of 1 hour for all GitHub Actions workflows
1618
- Color semantic tokens (Orange-OpenSource/ouds-ios#1206)
1719
- Update wording keys and translations (Orange-OpenSource/ouds-ios#1200)
18-
- Define timeout of 2 hours for all GitHub Actions workflows
1920
- Update icons to v1.4.0 (Orange-OpenSource/ouds-ios#1193)
2021
- References to DSM documentation (Orange-OpenSource/ouds-ios#1210) (Orange-OpenSource/ouds-ios#1212)
2122
- Update `switch` components to v1.5.0 (Orange-OpenSource/ouds-ios#1138)

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,19 +102,19 @@ import SwiftUI
102102
///
103103
/// ### Orange
104104
///
105-
/// ![A button component in light and dark mode with Orange theme](component_button_Orange)
105+
/// ![A button component in light and dark modes with Orange theme](component_button_Orange)
106106
///
107107
/// ### Orange Business Tools
108108
///
109-
/// ![A button component in light and dark mode with Orange Business Tools theme](component_button_OrangeBusinessTools)
109+
/// ![A button component in light and dark modes with Orange Business Tools theme](component_button_OrangeBusinessTools)
110110
///
111111
/// ### Sosh
112112
///
113-
/// ![A button component in light and dark mode with Sosh theme](component_button_Sosh)
113+
/// ![A button component in light and dark modes with Sosh theme](component_button_Sosh)
114114
///
115115
/// ### Wireframe
116116
///
117-
/// ![A button component in light and dark mode with Wireframe theme](component_button_Wireframe)
117+
/// ![A button component in light and dark modes with Wireframe theme](component_button_Wireframe)
118118
///
119119
/// - Version: 3.2.0 (Figma component design version)
120120
/// - Since: 0.10.0

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,19 +73,19 @@ import SwiftUI
7373
///
7474
/// ### Orange
7575
///
76-
/// ![A checkbox component in light and dark mode with Orange theme](component_checkbox_Orange)
76+
/// ![A checkbox component in light and dark modes with Orange theme](component_checkbox_Orange)
7777
///
7878
/// ### Orange Business Tools
7979
///
80-
/// ![A checkbox component in light and dark mode with Orange Business Tools theme](component_checkbox_OrangeBusinessTools)
80+
/// ![A checkbox component in light and dark modes with Orange Business Tools theme](component_checkbox_OrangeBusinessTools)
8181
///
8282
/// ### Sosh
8383
///
84-
/// ![A checkbox component in light and dark mode with Sosh theme](component_checkbox_Sosh)
84+
/// ![A checkbox component in light and dark modes with Sosh theme](component_checkbox_Sosh)
8585
///
8686
/// ### Wireframe
8787
///
88-
/// ![A checkbox component in light and dark mode with Wireframe theme](component_checkbox_Wireframe)
88+
/// ![A checkbox component in light and dark modes with Wireframe theme](component_checkbox_Wireframe)
8989
///
9090
/// - Version: 2.4.0 (Figma component design version)
9191
/// - Since: 0.12.0

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,19 +74,19 @@ import SwiftUI
7474
///
7575
/// ### Orange
7676
///
77-
/// ![A checkbox component in light and dark mode with Orange theme](component_checkbox_Orange)
77+
/// ![A checkbox component in light and dark modes with Orange theme](component_checkbox_Orange)
7878
///
7979
/// ### Orange Business Tools
8080
///
81-
/// ![A checkbox component in light and dark mode with Orange Business Tools theme](component_checkbox_OrangeBusinessTools)
81+
/// ![A checkbox component in light and dark modes with Orange Business Tools theme](component_checkbox_OrangeBusinessTools)
8282
///
8383
/// ### Sosh
8484
///
85-
/// ![A checkbox component in light and dark mode with Sosh theme](component_checkbox_Sosh)
85+
/// ![A checkbox component in light and dark modes with Sosh theme](component_checkbox_Sosh)
8686
///
8787
/// ### Wireframe
8888
///
89-
/// ![A checkbox component in light and dark mode with Wireframe theme](component_checkbox_Wireframe)
89+
/// ![A checkbox component in light and dark modes with Wireframe theme](component_checkbox_Wireframe)
9090
///
9191
/// - Version: 2.4.0 (Figma component design version)
9292
/// - Since: 0.12.0

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,19 +128,19 @@ import SwiftUI
128128
///
129129
/// ### Orange
130130
///
131-
/// ![A checkbox item component in light and dark mode with Orange theme](component_checkboxItem_Orange)
131+
/// ![A checkbox item component in light and dark modes with Orange theme](component_checkboxItem_Orange)
132132
///
133133
/// ### Orange Business Tools
134134
///
135-
/// ![A checkbox item component in light and dark mode with Orange Business Tools theme](component_checkboxItem_OrangeBusinessTools)
135+
/// ![A checkbox item component in light and dark modes with Orange Business Tools theme](component_checkboxItem_OrangeBusinessTools)
136136
///
137137
/// ### Sosh
138138
///
139-
/// ![A checkbox item component in light and dark mode with Sosh theme](component_checkboxItem_Sosh)
139+
/// ![A checkbox item component in light and dark modes with Sosh theme](component_checkboxItem_Sosh)
140140
///
141141
/// ### Wireframe
142142
///
143-
/// ![A checkbox item component in light and dark mode with Wireframe theme](component_checkboxItem_Wireframe)
143+
/// ![A checkbox item component in light and dark modes with Wireframe theme](component_checkboxItem_Wireframe)
144144
///
145145
/// - Version: 2.4.0 (Figma component design version)
146146
/// - Since: 0.12.0

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,19 +134,19 @@ import SwiftUI
134134
///
135135
/// ### Orange
136136
///
137-
/// ![A checkbox item component in light and dark mode with Orange theme](component_checkboxItem_Orange)
137+
/// ![A checkbox item component in light and dark modes with Orange theme](component_checkboxItem_Orange)
138138
///
139139
/// ### Orange Business Tools
140140
///
141-
/// ![A checkbox item component in light and dark mode with Orange Business Tools theme](component_checkboxItem_OrangeBusinessTools)
141+
/// ![A checkbox item component in light and dark modes with Orange Business Tools theme](component_checkboxItem_OrangeBusinessTools)
142142
///
143143
/// ### Sosh
144144
///
145-
/// ![A checkbox item component in light and dark mode with Sosh theme](component_checkboxItem_Sosh)
145+
/// ![A checkbox item component in light and dark modes with Sosh theme](component_checkboxItem_Sosh)
146146
///
147147
/// ### Wireframe
148148
///
149-
/// ![A checkbox item component in light and dark mode with Wireframe theme](component_checkboxItem_Wireframe)
149+
/// ![A checkbox item component in light and dark modes with Wireframe theme](component_checkboxItem_Wireframe)
150150
///
151151
/// - Version: 2.4.0 (Figma component design version)
152152
/// - Since: 0.12.0

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ import SwiftUI
8989
///
9090
/// ### Orange
9191
///
92-
/// ![A checkbox picker component in light and dark mode with Orange theme](component_checkboxPicker_Orange)
92+
/// ![A checkbox picker component in light and dark modes with Orange theme](component_checkboxPicker_Orange)
9393
///
9494
/// - Since: 0.14.0
9595
@available(iOS 15, macOS 15, visionOS 1, *)

OUDS/Core/Components/Sources/Controls/Chip/OUDSFilterChip.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,19 +40,19 @@ import SwiftUI
4040
///
4141
/// ### Orange
4242
///
43-
/// ![A filter chip component in light and dark mode with Orange theme](component_filterChip_Orange)
43+
/// ![A filter chip component in light and dark modes with Orange theme](component_filterChip_Orange)
4444
///
4545
/// ### Orange Business Tools
4646
///
47-
/// ![A filter chip component in light and dark mode with Orange Business Tools theme](component_filterChip_OrangeBusinessTools)
47+
/// ![A filter chip component in light and dark modes with Orange Business Tools theme](component_filterChip_OrangeBusinessTools)
4848
///
4949
/// ### Sosh
5050
///
51-
/// ![A filter chip component in light and dark mode with Sosh theme](component_filterChip_Sosh)
51+
/// ![A filter chip component in light and dark modes with Sosh theme](component_filterChip_Sosh)
5252
///
5353
/// ### Wireframe
5454
///
55-
/// ![A filter chip component in light and dark mode with Wireframe theme](component_filterChip_Wireframe)
55+
/// ![A filter chip component in light and dark modes with Wireframe theme](component_filterChip_Wireframe)
5656
///
5757
/// - Version: 1.3.0
5858
/// - Since: 0.17.0

OUDS/Core/Components/Sources/Controls/Chip/OUDSSuggestionChip.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,19 +47,19 @@ import SwiftUI
4747
///
4848
/// ### Orange
4949
///
50-
/// ![A suggestion chip component in light and dark mode with Orange theme](component_suggestionChip_Orange)
50+
/// ![A suggestion chip component in light and dark modes with Orange theme](component_suggestionChip_Orange)
5151
///
5252
/// ### Orange Business Tools
5353
///
54-
/// ![A suggestion chip component in light and dark mode with Orange Business Tools theme](component_suggestionChip_OrangeBusinessTools)
54+
/// ![A suggestion chip component in light and dark modes with Orange Business Tools theme](component_suggestionChip_OrangeBusinessTools)
5555
///
5656
/// ### Sosh
5757
///
58-
/// ![A suggestion chip component in light and dark mode with Sosh theme](component_suggestionChip_Sosh)
58+
/// ![A suggestion chip component in light and dark modes with Sosh theme](component_suggestionChip_Sosh)
5959
///
6060
/// ### Wireframe
6161
///
62-
/// ![A suggestion chip component in light and dark mode with Wireframe theme](component_suggestionChip_Wireframe)
62+
/// ![A suggestion chip component in light and dark modes with Wireframe theme](component_suggestionChip_Wireframe)
6363
///
6464
/// - Version: 1.3.0
6565
/// - Since: 0.17.0

0 commit comments

Comments
 (0)