-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Released of version 0.2.0 See below the full CHANGELOG details. Added: - [Tests] Add UI regression tests using snapshot comparisons with *swift-snapshot-testing* tool ([#78](#78)) - [DemoApp] Display fake components for elevation rendering tests - [Library] A theme can now override the custom font family - [Tests] Add more unit tests for theme overriding and raw tokens controls - [Library] Add and update raw and semantic grid tokens ([#40](#40)) - [Library] Manage regular and compact layouts for sizing and spacing tokens - [Library] "Box shadow 0" has been defined and "elevation drag" changed - [Doc] Create the basics of a documentation ([#9](#9)) - [Library] Add more semanttic and raw tokens for typography - [Library] Add more semantic and raw tokens for typography, and SwiftUI API to apply them - [Library] Computation of SwiftUI radius from Figma blur and spread values for elevation tokens - [Library] Add elevation tokens ([#32](#32)) Changed: - [Library] Split raws, semantics and components tokens definitions and also values, composites and type aliases - [Showcase] Improve Fastlane alpha build notifications - [Library] Do not store blur value in elevation semantic tokens - [Library] Change type aliases for X and Y offsets of elevations tokens - [Library] Update border semantic tokens values ([#106](#106)) - [Showcase] Add fake components for demo and tokens tests - [Library] Remove spread value for elevation tokens - [Library] Remove paragraph spacing tokens for typography - [Library] Term "fluid" has been replaced by "adaptable" in spacing semantic tokens - [Doc] Improve DocC documentation about tokens and views extensions - [Doc] Add more details in release documentation - [Library] Rename semantic token "opacityEmphasized" to "opacityStrong" ([#94](#94)) - [Library] Update value of opacity raw token "opacity800" from 0.88 to 0.80 ([#87](#87)) - [Tests] Add missing unit tests for opacity raw tokens - [Library] "OUDSThemesCommons" product has been renamed to "OUDS" Removed: - [Library] Remove Z Index tokens for elevations ([#109](#109)) - [Library] Remove token "borderRadiusPill" and "borderRadiusCircle" ([#58](#58)) - [Library] "Emphasis" words have been replaced by "emphasized" - [Library] "Box shadow" words have been removed in elevation semantic and raw tokens Fixed: - [Library] Fix some typos in documentation ([#89](#89)) Acked-by: Ludovic Pinel <ludovic.pinel@orange.com> Co-authored-by: Ludovic Pinel <ludovic.pinel@orange.com> Co-authored-by: Pierre-Yves Lapersonne <pierreyves.lapersonne@orange.com> Co-authored-by: Julien Déramond <julien.deramond@orange.com>
- Loading branch information
Showing
171 changed files
with
6,361 additions
and
3,038 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -322,4 +322,4 @@ DEPENDENCIES | |
xcode-install (= 2.8.1) | ||
|
||
BUNDLED WITH | ||
2.5.11 | ||
2.5.17 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
// | ||
// Software Name: OUDS iOS | ||
// SPDX-FileCopyrightText: Copyright (c) Orange SA | ||
// SPDX-License-Identifier: MIT | ||
// | ||
// This software is distributed under the MIT license, | ||
// the text of which is available at https://opensource.org/license/MIT/ | ||
// or see the "LICENSE" file for more details. | ||
// | ||
// Authors: See CONTRIBUTORS.txt | ||
// Software description: A SwiftUI components library with code examples for Orange Unified Design System | ||
// | ||
|
||
import Foundation | ||
import OUDSFoundations | ||
import OUDSTokensSemantic | ||
import SwiftUI | ||
|
||
/// An OUDS component for buttons. | ||
/// __Warning: This is a draft component__. | ||
/// | ||
/// This component is created to illustrate the mecanism of theme and tokens and for tests. | ||
public struct OUDSButton: View { | ||
|
||
// MARK: - Properties | ||
|
||
/// The text to display inside the button | ||
private let text: String | ||
|
||
/// The action to process when the button is activated by a user interaction like a tap | ||
private let action: () -> Void | ||
|
||
/// To get tokens to customize the component | ||
@Environment(\.theme) private var theme | ||
|
||
/// To choose if ight or dark color must be used | ||
@Environment(\.colorScheme) private var colorScheme | ||
|
||
/// To get programatically and on the fly the horizontal layout size | ||
@Environment(\.horizontalSizeClass) private var sizeClass | ||
|
||
// MARK: - Init | ||
|
||
/// Initializes the button. | ||
/// | ||
/// - Parameters: | ||
/// - text: Text displayed in the button. | ||
/// - action: Will be called when the user clicks the button. | ||
public init(text: String, action: @escaping () -> Void) { | ||
self.text = text | ||
self.action = action | ||
} | ||
|
||
// MARK: - Body | ||
|
||
public var body: some View { | ||
Button { | ||
action() | ||
} label: { | ||
Text(text) | ||
.systemFont(typography: theme.buttonTypography) | ||
.padding(theme.buttonInternalSpacing) | ||
.foregroundColor(colorScheme == .light | ||
? theme.buttonForegroundColorLight.color | ||
: theme.buttonForegroundColorDark.color) | ||
.modifier(BorderStyleModifier(theme.buttonBorderStyle, | ||
theme.buttonBorderWidth, | ||
theme.buttonBorderRadius, | ||
theme.buttonBorderColorLight, | ||
theme.buttonBorderColorDark)) | ||
}.frame(width: theme.buttonWidth, height: theme.buttonHeight) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// | ||
// Software Name: OUDS iOS | ||
// SPDX-FileCopyrightText: Copyright (c) Orange SA | ||
// SPDX-License-Identifier: MIT | ||
// | ||
// This software is distributed under the MIT license, | ||
// the text of which is available at https://opensource.org/license/MIT/ | ||
// or see the "LICENSE" file for more details. | ||
// | ||
// Authors: See CONTRIBUTORS.txt | ||
// Software description: A SwiftUI components library with code examples for Orange Unified Design System | ||
// | ||
|
||
import Foundation | ||
import OUDSTokensSemantic | ||
import SwiftUI | ||
|
||
extension View { | ||
|
||
/// Applies a `CustomFontModifier` on the current `View` so as to add a specific `Font`. | ||
/// - Parameters: | ||
/// - familyName: The font family name to load later (e.g. "Luciole") | ||
/// - token: The typography token to use to get useful values for `compact` or `regular` mode | ||
/// - Returns: The `View` with the custom font applied | ||
func customFont(familyName: String, typography token: TypographyCompositeSemanticToken) -> some View { | ||
self.modifier(CustomFontModifier(token: token, fontFamilyName: familyName)) | ||
} | ||
|
||
/// Applies a `FontModifier` to use the system font on the current `View` with a specific token | ||
/// - Parameter token: The typography token to use to get useful values for `compact` or `regular` mode | ||
/// - Returns: The `View` with the custom font applied | ||
func systemFont(typography token: TypographyCompositeSemanticToken) -> some View { | ||
self.modifier(FontModifier(token: token)) | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
OUDS/Core/Components/Sources/Extensions/View+Shadows.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// | ||
// Software Name: OUDS iOS | ||
// SPDX-FileCopyrightText: Copyright (c) Orange SA | ||
// SPDX-License-Identifier: MIT | ||
// | ||
// This software is distributed under the MIT license, | ||
// the text of which is available at https://opensource.org/license/MIT/ | ||
// or see the "LICENSE" file for more details. | ||
// | ||
// Authors: See CONTRIBUTORS.txt | ||
// Software description: A SwiftUI components library with code examples for Orange Unified Design System | ||
// | ||
|
||
import Foundation | ||
import OUDSTokensSemantic | ||
import SwiftUI | ||
|
||
extension View { | ||
|
||
/// Wraps the *SwiftUI* `shadow(color:radius:x:y)` method so as to use as `radius` value | ||
/// the computed `radius` value of the given `ElevationCompositeSemanticToken`. | ||
/// - Parameter elevation: The token to give for the shadow / elevation effect | ||
/// - Returns `View`: The current `View` with the shadow / elevation effect | ||
public func shadow(elevation: ElevationCompositeSemanticToken) -> some View { | ||
return self | ||
.shadow(color: elevation.color.color, | ||
radius: elevation.radius, | ||
x: CGFloat(elevation.x), | ||
y: CGFloat(elevation.y)) | ||
} | ||
} |
Oops, something went wrong.