Skip to content

Commit bd14c9c

Browse files
committed
chore: clean up
Signed-off-by: Pierre-Yves Lapersonne <[email protected]>
1 parent d9bf20b commit bd14c9c

24 files changed

+68
-94
lines changed

DesignToolbox/DesignToolbox.xcodeproj/project.pbxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3393,7 +3393,7 @@
33933393
isa = XCRemoteSwiftPackageReference;
33943394
repositoryURL = "https://github.com/Orange-OpenSource/ouds-ios";
33953395
requirement = {
3396-
branch = "1102-support-of-other-apple-os";
3396+
branch = develop;
33973397
kind = branch;
33983398
};
33993399
};

DesignToolbox/DesignToolbox.xcworkspace/xcshareddata/swiftpm/Package.resolved

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

DesignToolbox/DesignToolbox/Pages/Components/Controls/Radio/RadioElements.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ private struct RadioIllustration: View {
4545
VStack(spacing: theme.spaces.fixedNone) {
4646
// 🥜: dumb label, not vocalized, preventing warnings because of empty labels
4747
#if !os(visionOS)
48-
OUDSRadio(isOn: .constant(false), accessibilityLabel: "🥜")
48+
OUDSRadio(isOn: .constant(true), accessibilityLabel: "🥜")
4949
OUDSRadio(isOn: .constant(false), accessibilityLabel: "🥜")
5050
#else
5151
OUDSRadio(isOn: .constant(false), accessibilityLabel: "🥜")

DesignToolbox/DesignToolbox/Pages/Navigation Bar/ThemeSelection.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ struct ThemeSelectionButton: View {
213213
.pickerStyle(.inline)
214214
}
215215

216-
#if os(iOS)
216+
#if !os(macOS)
217217
// Sosh and Wireframe themes (which do not have tunings)
218218
Picker(selection: $themeProvider.currentTheme, label: EmptyView()) {
219219
ForEach(themeProvider.otherThemes, id: \.id) { theme in
@@ -223,8 +223,7 @@ struct ThemeSelectionButton: View {
223223
}
224224
.pickerStyle(.automatic)
225225
#else
226-
Divider()
227-
// Sur macOS, utiliser des Button directement
226+
Divider() // with macOS at least there are troubles with menus and pickers inside
228227
ForEach(themeProvider.otherThemes, id: \.id) { theme in
229228
Button(theme.description) {
230229
themeProvider.currentTheme = theme
@@ -245,6 +244,7 @@ struct ThemeSelectionButton: View {
245244
// MARK: - Hot Switch
246245

247246
final class HotSwitchWarning: ObservableObject {
247+
248248
@Published var showAlert: Bool = false
249249

250250
deinit {}

DesignToolbox/DesignToolbox/Pages/Navigation Bar/View+NavigationBar.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ extension View {
1717

1818
/// To add a `ThemeSelectionButton` in the toolbar and also a `ColorSchemeSelectionButton`
1919
func navigationBarMenus() -> some View {
20-
#if os(iOS)
20+
#if os(iOS) || os(visionOS)
2121
toolbar {
2222
ToolbarItemGroup(placement: .navigationBarTrailing) {
2323
ThemeSelectionButton()

DesignToolbox/DesignToolbox/Pages/Utils/Elements/DesignToolboxElementPage.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ struct DesignToolboxElementPage: View {
5050
#if os(iOS)
5151
elementPageBody
5252
.navigationBarMenus() // Otherwise does not appear
53-
#else // macOS
53+
#else // macOS, visionOS
5454
elementPageBody // Otherwise appears twice
5555
#endif
5656
}

DesignToolbox/DesignToolbox/Pages/Utils/Elements/DesignToolboxElementsPage.swift

Lines changed: 6 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,18 @@ import SwiftUI
1919
/// (enumerate tokens and components)
2020
struct DesignToolboxElementsPage: View {
2121

22+
// MARK: - Properties
23+
24+
let title: String
25+
let elements: [DesignToolboxElement]
26+
2227
#if !os(iOS)
2328
@State private var selectedElement: DesignToolboxElement?
2429
#endif
2530

2631
@AccessibilityFocusState private var requestFocus: AccessibilityFocusable?
2732
@Environment(\.theme) private var theme
2833

29-
// MARK: Stored properties
30-
31-
let title: String
32-
let elements: [DesignToolboxElement]
33-
3434
// MARK: Body
3535

3636
var body: some View {
@@ -41,7 +41,7 @@ struct DesignToolboxElementsPage: View {
4141
}
4242
.navigationViewStyle(.stack)
4343
#else // macOS
44-
// Trick to be sure the view refreshes because NavigationView not always refreshed
44+
// Trick to be sure the view refreshes because NavigationView not always refreshed with macOS
4545
NavigationSplitView {
4646
elementsPage
4747
} detail: {
@@ -129,7 +129,6 @@ struct DesignToolboxElementsPage: View {
129129
.hoverEffect(.highlight)
130130
.accessibilityFocused($requestFocus, equals: .some(id: element.id))
131131
.oudsRequestAccessibleFocus(_requestFocus, for: .some(id: elements[0].id))
132-
133132
#else
134133
Card(
135134
title: Text(LocalizedStringKey(element.name)),
@@ -138,75 +137,4 @@ struct DesignToolboxElementsPage: View {
138137
.oudsRequestAccessibleFocus(_requestFocus, for: .some(id: elements[0].id))
139138
#endif
140139
}
141-
142-
/*
143-
private var elementsPage: some View {
144-
ScrollView {
145-
LazyVGrid(columns: [GridItem(.flexible(), alignment: .topLeading)], spacing: theme.spaces.fixed2xsmall) {
146-
ForEach(elements, id: \.id) { element in
147-
#if os(iOS) || os(visionOS)
148-
NavigationLink {
149-
element.pageDescription
150-
} label: {
151-
cardView(for: element)
152-
}
153-
#else // macOS
154-
Button {
155-
selectedElement = element
156-
} label: {
157-
cardView(for: element)
158-
}
159-
#endif
160-
}
161-
}
162-
.padding(.all, theme.spaces.fixedMedium)
163-
.navigationBarMenus()
164-
}
165-
.oudsBackground(theme.colors.bgPrimary)
166-
.oudsNavigationTitle(title)
167-
}
168-
169-
private func cardView(for element: DesignToolboxElement) -> some View {
170-
#if os(visionOS)
171-
HStack(spacing: 16) {
172-
// Illustration
173-
element.illustration
174-
.frame(width: 44, height: 44)
175-
.scaleEffect(0.6) // Réduit à 60% de la taille
176-
.clipped()
177-
.clipShape(RoundedRectangle(cornerRadius: 10))
178-
179-
// Titre
180-
Text(LocalizedStringKey(element.name))
181-
.font(.headline)
182-
.foregroundStyle(.primary)
183-
.multilineTextAlignment(.leading)
184-
.lineLimit(2) // Limite à 2 lignes
185-
.fixedSize(horizontal: false, vertical: true) // Permet seulement le wrap vertical
186-
.frame(maxWidth: .infinity, alignment: .leading) // Prend l'espace disponible
187-
188-
Image(systemName: "chevron.right")
189-
.font(.subheadline)
190-
.foregroundStyle(.tertiary)
191-
}
192-
.frame(maxWidth: .infinity) // Force la largeur maximale
193-
.padding(.horizontal, 24)
194-
.padding(.vertical, 18)
195-
//.background(.regularMaterial, in: .capsule)
196-
.background(.pink, in: .capsule)
197-
.hoverEffect(.highlight)
198-
.accessibilityFocused($requestFocus, equals: .some(id: element.id))
199-
.oudsRequestAccessibleFocus(_requestFocus, for: .some(id: elements[0].id))
200-
201-
#else
202-
Card(
203-
title: Text(LocalizedStringKey(element.name)),
204-
illustration: element.illustration)
205-
.accessibilityFocused($requestFocus, equals: .some(id: element.id))
206-
.oudsRequestAccessibleFocus(_requestFocus, for: .some(id: elements[0].id))
207-
#endif
208-
}
209-
}
210-
211-
*/
212140
}

README.md

Lines changed: 53 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,16 @@
3535
[![Still maintained](https://img.shields.io/maintenance/yes/2025?style=for-the-badge)](https://github.com/Orange-OpenSource/ouds-ios-design-system-toolbox/issues?q=is%3Aissue+is%3Aclosed)
3636

3737
[![Xcode 26.0](https://img.shields.io/badge/Xcode-26.0-blue?style=for-the-badge)](https://developer.apple.com/documentation/xcode-release-notes/xcode-26-release-notes)
38-
Ack
39-
[![iOS 15.0](https://img.shields.io/badge/iOS-15.0-FF1AB2?style=for-the-badge)](https://developer.apple.com/support/app-store)
40-
[![iPadOS 15.0](https://img.shields.io/badge/iPadOS-15.0-FF1AB2?style=for-the-badge)](https://developer.apple.com/support/app-store")
38+
39+
![iOS 15.0](https://img.shields.io/badge/iOS-15.0-FF1AB2?style=for-the-badge)
40+
![iPadOS 15.0](https://img.shields.io/badge/iPadOS-15.0-FF1AB2?style=for-the-badge)
41+
![macOS 15.0](https://img.shields.io/badge/macOS-15.0-FF1AB2?style=for-the-badge)
42+
![visionOS 1.3](https://img.shields.io/badge/visionOS-1.3-FF1AB2?style=for-the-badge)
4143

4244
## Content
4345

46+
Source code of the app showcasing the design system for iOS, iPadOS, macOS and visionOS.
47+
4448
> [!NOTE]
4549
> This repository contains the design system toolbox app which contains the OUDS iOS Swift Package and displays its features.
4650
> You can find the [detailed technical documentation online](https://ios.unified-design-system.orange.com),
@@ -84,18 +88,60 @@ For images and other assets, please [refer to the NOTICE.txt](https://github.com
8488

8589
## Design System Toolbox
8690

91+
### iOS
92+
8793
<!-- Mockups designed thanks to https://mockuphone.com/model/iphone-15-pro-max/ -->
8894

8995
<p align="center">
90-
<img src="./images/Tokens list - en - light-portrait.png" alt="List of tokens on iPhone 15 Pro Max (engligh, light mode, portrait)" height="350" />
96+
<img src="./images/iOS/Tokens list - en - light - portrait.png" alt="List of tokens on iPhone 15 Pro Max (english, light mode, portrait)" height="350" />
97+
&nbsp;
98+
<img src="./images/iOS/Colors - en - light - portrait.png" alt="List of colors on iPhone 15 Pro Max (english, light mode, portrait)" height="350" />
99+
&nbsp;
100+
<img src="./images/iOS/Components list - en - light - portrait.png" alt="List of components on iPhone 15 Pro Max (english, light mode, portrait)" height="350" />
101+
&nbsp;
102+
<img src="./images/iOS/Button - en - light - portrait.png" alt="Button component on iPhone 15 Pro Max (english, light mode, portrait)" height="350" />
103+
</p>
104+
105+
### iPadOS
106+
107+
<!-- Mockups designed thanks to https://mockuphone.com/model/ipad-pro-13-inch/ -->
108+
109+
<p align="center">
110+
<img src="./images/iPadOS/Tokens list - en - light - portrait.png" alt="List of tokens on iPad (A16) (english, light mode, portrait)" height="350" />
111+
&nbsp;
112+
<img src="./images/iPadOS/Colors - en - light - portrait.png" alt="List of colors on iPad (A16) (english, light mode, portrait)" height="350" />
113+
&nbsp;
114+
<img src="./images/iPadOS/Components list - en - light - portrait.png" alt="List of components on iPad (A16) (english, light mode, portrait)" height="350" />
115+
&nbsp;
116+
<img src="./images/iPadOS/Button - en - light - portrait.png" alt="Button component on iPad (A16) (english, light mode, portrait)" height="350" />
117+
</p>
118+
119+
### macOS
120+
121+
<p align="center">
122+
<img src="./images/macOS/Tokens list - en - light.png" alt="List of tokens on MacBook Pro 16'' inch'' (english, light mode)" height="350" />
91123
&nbsp;
92-
<img src="./images/Colors - en - light-portrait.png" alt="List of colors on iPhone 15 Pro Max (engligh, light mode, portrait)" height="350" />
124+
<img src="./images/macOS/Colors - en - light.png" alt="List of colors on MacBook Pro 16'' (english, light mode)" height="350" />
93125
&nbsp;
94-
<img src="./images/Components list - en - light-portrait.png" alt="List of components on iPhone 15 Pro Max (engligh, light mode, portrait)" height="350" />
126+
<img src="./images/macOS/Components list - en - light.png" alt="List of components on MacBook Pro 16'' (english, light mode)" height="350" />
95127
&nbsp;
96-
<img src="./images/Button - en - light-portrait.png" alt="Button component on iPhone 15 Pro Max (engligh, light mode, portrait)" height="350" />
128+
<img src="./images/macOS/Button - en - light.png" alt="Button component on MacBook Pro 16'' (english, light mode)" height="350" />
97129
</p>
98130

131+
### visionOS
132+
133+
<p align="center">
134+
<img src="./images/visionOS/Tokens list - en - light.png" alt="List of tokens on Vision Pro (english, light mode)" height="350" />
135+
&nbsp;
136+
<img src="./images/visionOS/Colors - en - light.png" alt="List of colors on Vision Pro (english, light mode)" height="350" />
137+
&nbsp;
138+
<img src="./images/visionOS/Components list - en - light.png" alt="List of components on Vision Pro (english, light mode)" height="350" />
139+
&nbsp;
140+
<img src="./images/visionOS/Button - en - light.png" alt="Button component on Vision Pro (english, light mode)" height="350" />
141+
</p>
142+
143+
### Get the app
144+
99145
Flash the QrCode below or click on it to download the *Design System Toolbox* app.
100146

101147
<p align="center">

0 commit comments

Comments
 (0)