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
docs: improve documentation for newcomers (#982) (#1005)
Improve README with details about how to use the product.
Improve DocC documentation for web builds to have things clearer.
Closes#982Closes#1005
Suggested-by: Thomas Martin <thomas2.martin@orange.com>
Acked-by: Ludovic Pinel <ludovic.pinel@orange.com>
Signed-off-by: Pierre-Yves Lapersonne <pierreyves.lapersonne@orange.com>
Design tokens represent the small, repeated design decisions that make up a design system's visual style. Tokens wrap hard-coded static values, such as hexadecimal codes for color, with self-explanatory names.
8
+
Design tokens represent the small, repeated design decisions that make up a design system's visual style. Tokens wrap hard-coded static values, such as hexadecimal codes for color, with self-explanatory names. They are used to define the look and feel and the style of everything. They are exposed through the themes and can be used as they are.
Copy file name to clipboardExpand all lines: OUDS/Core/OUDS/Sources/_OUDS.docc/_OUDS.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ Do not add @PageImage(purpose: card) because not managed for landing page of onl
10
10
See https://github.com/swiftlang/swift-docc/issues/1283
11
11
-->
12
12
13
-
The iOS library of *Orange Unified Design System*, the new design system unified and cohesive across all platforms to build Orange mobile applications for everyone everywhere.
13
+
The Apple OS Swift Package of *Orange Unified Design System*, the new design system unified and cohesive across all platforms to build Orange mobile applications for everyone everywhere.
14
14
15
15
## Overview
16
16
@@ -35,6 +35,8 @@ You can get details about the this design system in [the official website unifie
35
35
36
36
> Important: Orange Unified Design System framework focuses on iOS / iPadOS, other platforms like visionOS, watchOS, macOS and tvOS are not scoped yet.
37
37
38
+
> Tip: Feel free to submit pull requests if you can improve the support of macOS, visionOS, tvOS and watchOS!
Copy file name to clipboardExpand all lines: README.md
+61Lines changed: 61 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -61,6 +61,67 @@ The project is open source (except some assets) and topics like accessibility an
61
61
62
62
It replaces internal frameworks and also [ODS](https://github.com/Orange-OpenSource/ods-ios) as the only one design system for Orange group and affiliates.
63
63
64
+
> Important: It brings components and API for *SwiftUI*.
65
+
66
+
## Quick start
67
+
68
+
### Add the dependency
69
+
70
+
First, you must add as _package dependency_ of your _project_ the URL of this _Swift Package_ GitHub repository:
71
+
72
+
```text
73
+
https://github.com/Orange-OpenSource/ouds-ios
74
+
```
75
+
76
+
You can choose the _dependency rule_ you want. Keep in mind OUDS iOS releases are frozen and are based on semantic versioning.
77
+
78
+
### Add the librairies
79
+
80
+
In your Xcode _targets_, add the librairies you need. Everything is splitted so as to let users choose the content to embed they want.
81
+
In most of cases, the `OUDS` library at least must be imported, it brings abstraction layer.
82
+
Components are available with `OUDSComponents`. Themes are available through their librairies too (`OUDSThemeOrange`, `OUDSThemeSosh`, `OUDSThemeWireframe`, etc.).
83
+
84
+
You can have more details [in the wiki](https://github.com/Orange-OpenSource/ouds-ios/wiki/30-%E2%80%90-About-the-architecture#the-ouds-ios-swift-package).
85
+
86
+
### Instanciate and inject theme
87
+
88
+
In the root view of your app, add the `OUDSThemeableView` with inside the _theme_ object you want to apply.
89
+
You can instanciate the theme object on the fly, but only once.
90
+
91
+
```swift
92
+
importOUDS
93
+
importSwiftUI
94
+
95
+
@main
96
+
structYourApp: App {
97
+
98
+
var body: some Scene {
99
+
WindowGroup {
100
+
OUDSThemeableView(theme: theTheme) { // theTheme can be: OrangeTheme(), SoshTheme(), WirefameTheme(), etc.
101
+
AppRootView() // Add your app root view here
102
+
}
103
+
}
104
+
}
105
+
}
106
+
```
107
+
108
+
Feel free to read the [online documentation](https://ios.unified-design-system.orange.com/documentation/ouds/gettingstarted).
109
+
You can find also [more details about theme instanciations online](https://ios.unified-design-system.orange.com/documentation/ouds/themes).
110
+
111
+
### Get the theme
112
+
113
+
If you need to get configuration details from the theme (colors, dimensions, etc.), get the theme through _environment object_:
114
+
115
+
```swift
116
+
@Environment(\.theme) var theme
117
+
```
118
+
119
+
### Use the components
120
+
121
+
Import the `OUDSComponents` library and instanciate the component you need. All of them are described [in the online documentation (and grouped by categories)](https://ios.unified-design-system.orange.com/documentation/oudscomponents).
122
+
123
+
The wiki lists also [the components and their availability](https://github.com/Orange-OpenSource/ouds-ios/wiki/01-%E2%80%90-Available-API).
0 commit comments