diff --git a/OUDS/Core/OUDS/Sources/OUDSTheme/OUDSTheme+SemanticTokens/OUDSTheme+GridSemanticTokens.swift b/OUDS/Core/OUDS/Sources/OUDSTheme/OUDSTheme+SemanticTokens/OUDSTheme+GridSemanticTokens.swift index e89c2ee524a..85b0e5809b3 100644 --- a/OUDS/Core/OUDS/Sources/OUDSTheme/OUDSTheme+SemanticTokens/OUDSTheme+GridSemanticTokens.swift +++ b/OUDS/Core/OUDS/Sources/OUDSTheme/OUDSTheme+SemanticTokens/OUDSTheme+GridSemanticTokens.swift @@ -15,7 +15,7 @@ import Foundation import OUDSTokensRaw import OUDSTokensSemantic -extension OUDSTheme: GridSemanticTokens { +extension OUDSGridSemanticTokensWrapper: GridSemanticTokens { @objc open var gridCompactColumnGap: GridSemanticToken { GridRawTokens.gridColumnGap100 } @objc open var gridCompactMargin: GridSemanticToken { GridRawTokens.gridMargin300 } @objc open var gridCompactMaxWidth: GridSemanticToken { GridRawTokens.gridMaxWidthCompact } diff --git a/OUDS/Core/OUDS/Sources/OUDSTheme/OUDSTheme+SemanticTokens/OUDSTheme+GridSemanticTokensHelper.swift b/OUDS/Core/OUDS/Sources/OUDSTheme/OUDSTheme+SemanticTokens/OUDSTheme+GridSemanticTokensHelper.swift index 207a8d60119..da6f788ab28 100644 --- a/OUDS/Core/OUDS/Sources/OUDSTheme/OUDSTheme+SemanticTokens/OUDSTheme+GridSemanticTokensHelper.swift +++ b/OUDS/Core/OUDS/Sources/OUDSTheme/OUDSTheme+SemanticTokens/OUDSTheme+GridSemanticTokensHelper.swift @@ -24,11 +24,11 @@ extension OUDSTheme { public final func gridMinWidth(for sizeClass: OUDSUserInterfaceSizeClass) -> GridRawToken { switch sizeClass { case .extraCompact: - return gridExtraCompactMinWidth + return grids.gridExtraCompactMinWidth case .compact: - return gridCompactMinWidth + return grids.gridCompactMinWidth case .regular: - return gridRegularMinWidth + return grids.gridRegularMinWidth @unknown default: fatalError("🤖 Raw token unavailable for \(sizeClass)!") } @@ -40,11 +40,11 @@ extension OUDSTheme { public final func gridMaxWidth(for sizeClass: OUDSUserInterfaceSizeClass) -> GridRawToken { switch sizeClass { case .extraCompact: - return gridExtraCompactMaxWidth + return grids.gridExtraCompactMaxWidth case .compact: - return gridCompactMaxWidth + return grids.gridCompactMaxWidth case .regular: - return gridRegularMaxWidth + return grids.gridRegularMaxWidth @unknown default: fatalError("🤖 Raw token unavailable for \(sizeClass)!") } @@ -56,11 +56,11 @@ extension OUDSTheme { public final func gridMargin(for sizeClass: OUDSUserInterfaceSizeClass) -> GridRawToken { switch sizeClass { case .extraCompact: - return gridExtraCompactMargin + return grids.gridExtraCompactMargin case .compact: - return gridCompactMargin + return grids.gridCompactMargin case .regular: - return gridRegularMargin + return grids.gridRegularMargin @unknown default: fatalError("🤖 Raw token unavailable for \(sizeClass)!") } @@ -72,11 +72,11 @@ extension OUDSTheme { public final func gridColumnGap(for sizeClass: OUDSUserInterfaceSizeClass) -> GridRawToken { switch sizeClass { case .extraCompact: - return gridExtraCompactColumnGap + return grids.gridExtraCompactColumnGap case .compact: - return gridCompactColumnGap + return grids.gridCompactColumnGap case .regular: - return gridRegularColumnGap + return grids.gridRegularColumnGap @unknown default: fatalError("🤖 Raw token unavailable for \(sizeClass)!") } diff --git a/OUDS/Core/OUDS/Sources/OUDSTheme/OUDSTheme.swift b/OUDS/Core/OUDS/Sources/OUDSTheme/OUDSTheme.swift index 2ad08e0862e..bccdd7069a6 100644 --- a/OUDS/Core/OUDS/Sources/OUDSTheme/OUDSTheme.swift +++ b/OUDS/Core/OUDS/Sources/OUDSTheme/OUDSTheme.swift @@ -44,6 +44,9 @@ open class OUDSTheme: @unchecked Sendable { /// All font semantic tokens exposed in one object public let fonts: AllFontSemanticTokens + /// All grid semantic tokens exposed in one object + public let grids: AllGridSemanticTokens + /// A theme can have a custom font which is not the system font public let customFontFamily: FontFamilySemanticToken? @@ -57,16 +60,19 @@ open class OUDSTheme: @unchecked Sendable { /// - colors: An object providing all the color semantic tokens, by default `OUDSColorSemanticTokensWrapper` /// - elevations: An object providing all the elevation semantic tokens, by default `OUDSElevationSemanticTokensWrapper` /// - fonts: An object providing all the font semantic tokens, by default `OUDSFontSemanticTokensWrapper` + /// - grids: An object providing all the grid semantic tokens, by default `OUDSGridSemanticTokensWrapper` public init(borders: AllBorderSemanticTokens = OUDSBorderSemanticTokensWrapper(), opacities: AllOpacitySemanticTokens = OUDSOpacitySemanticTokensWrapper(), colors: AllColorSemanticTokens = OUDSColorSemanticTokensWrapper(), elevations: AllElevationSemanticTokens = OUDSElevationSemanticTokensWrapper(), - fonts: AllFontSemanticTokens = OUDSFontSemanticTokensWrapper()) { + fonts: AllFontSemanticTokens = OUDSFontSemanticTokensWrapper(), + grids: AllGridSemanticTokens = OUDSGridSemanticTokensWrapper()) { self.borders = borders self.opacities = opacities self.colors = colors self.elevations = elevations self.fonts = fonts + self.grids = grids customFontFamily = nil } @@ -77,18 +83,21 @@ open class OUDSTheme: @unchecked Sendable { /// - colors: An object providing all the color semantic tokens, as `AllColorSemanticTokens` implementation /// - elevations: An object providing all the elevation semantic tokens, by default `AllElevationSemanticTokens` /// - fonts: An object providing all the font semantic tokens, by default `AllFontemanticTokens` + /// - grids: An object providing all the grid semantic tokens, by default `AllGridSemanticTokens` /// - customFontFamily: Set `nil` if system font to use, otherwise use the `FontFamilySemanticToken` you want to apply public init(borders: AllBorderSemanticTokens, opacities: AllOpacitySemanticTokens, colors: AllColorSemanticTokens, elevations: AllElevationSemanticTokens, fonts: AllFontSemanticTokens, + grids: AllGridSemanticTokens, customFontFamily: FontFamilySemanticToken?) { self.borders = borders self.opacities = opacities self.colors = colors self.elevations = elevations self.fonts = fonts + self.grids = grids self.customFontFamily = customFontFamily } diff --git a/OUDS/Core/OUDS/Tests/OUDSTheme/MockThemes/MockTheme+AllGridSemanticTokens.swift b/OUDS/Core/OUDS/Tests/OUDSTheme/MockThemes/MockTheme+AllGridSemanticTokens.swift new file mode 100644 index 00000000000..5aea2c9be34 --- /dev/null +++ b/OUDS/Core/OUDS/Tests/OUDSTheme/MockThemes/MockTheme+AllGridSemanticTokens.swift @@ -0,0 +1,42 @@ +// +// 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 OUDSTokensRaw +import OUDSTokensSemantic + +// swiftlint:disable required_deinit + +/// Overrides **all** the grid semantic tokens (from its super class, i.e. `OUDSGridSemanticTokensWrapper` so as to test overriding of them (unit tests) +/// and to act like smoke tests with crashing tests if some tokens disappeared. +final class MockThemeGridSemanticTokensWrapper: OUDSGridSemanticTokensWrapper { + + static let mockThemeGridRawToken: GridRawToken = 3_630 + + override public var gridExtraCompactMinWidth: GridSemanticToken { Self.mockThemeGridRawToken } + override public var gridExtraCompactMaxWidth: GridSemanticToken { Self.mockThemeGridRawToken } + override public var gridExtraCompactMargin: GridSemanticToken { Self.mockThemeGridRawToken } + override public var gridExtraCompactColumnGap: GridSemanticToken { Self.mockThemeGridRawToken } + + override public var gridCompactMinWidth: GridSemanticToken { Self.mockThemeGridRawToken } + override public var gridCompactMaxWidth: GridSemanticToken { Self.mockThemeGridRawToken } + override public var gridCompactMargin: GridSemanticToken { Self.mockThemeGridRawToken } + override public var gridCompactColumnGap: GridSemanticToken { Self.mockThemeGridRawToken } + + override public var gridRegularMinWidth: GridSemanticToken { Self.mockThemeGridRawToken } + override public var gridRegularMaxWidth: GridSemanticToken { Self.mockThemeGridRawToken } + override public var gridRegularMargin: GridSemanticToken { Self.mockThemeGridRawToken } + override public var gridRegularColumnGap: GridSemanticToken { Self.mockThemeGridRawToken } +} + +// swiftlint:enable required_deinit diff --git a/OUDS/Core/OUDS/Tests/OUDSTheme/MockThemes/MockTheme+OpacitySemanticTokens.swift b/OUDS/Core/OUDS/Tests/OUDSTheme/MockThemes/MockTheme+AllOpacitySemanticTokens.swift similarity index 100% rename from OUDS/Core/OUDS/Tests/OUDSTheme/MockThemes/MockTheme+OpacitySemanticTokens.swift rename to OUDS/Core/OUDS/Tests/OUDSTheme/MockThemes/MockTheme+AllOpacitySemanticTokens.swift diff --git a/OUDS/Core/OUDS/Tests/OUDSTheme/MockThemes/MockTheme+GridSemanticTokens.swift b/OUDS/Core/OUDS/Tests/OUDSTheme/MockThemes/MockTheme+GridSemanticTokens.swift deleted file mode 100644 index 514ec8e6670..00000000000 --- a/OUDS/Core/OUDS/Tests/OUDSTheme/MockThemes/MockTheme+GridSemanticTokens.swift +++ /dev/null @@ -1,38 +0,0 @@ -// -// 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 OUDSTokensRaw -import OUDSTokensSemantic - -/// Overrides **all** the grid semantic tokens (from its super class, i.e. `OUDSTheme` so as to test overriding of them (unit tests) -/// and to act like smoke tests with crashing tests if some tokens disappeared. -extension MockTheme { - - static let mockThemeGridRawToken: GridRawToken = 3_630 - - override open var gridExtraCompactMinWidth: GridSemanticToken { Self.mockThemeGridRawToken } - override open var gridExtraCompactMaxWidth: GridSemanticToken { Self.mockThemeGridRawToken } - override open var gridExtraCompactMargin: GridSemanticToken { Self.mockThemeGridRawToken } - override open var gridExtraCompactColumnGap: GridSemanticToken { Self.mockThemeGridRawToken } - - override open var gridCompactMinWidth: GridSemanticToken { Self.mockThemeGridRawToken } - override open var gridCompactMaxWidth: GridSemanticToken { Self.mockThemeGridRawToken } - override open var gridCompactMargin: GridSemanticToken { Self.mockThemeGridRawToken } - override open var gridCompactColumnGap: GridSemanticToken { Self.mockThemeGridRawToken } - - override open var gridRegularMinWidth: GridSemanticToken { Self.mockThemeGridRawToken } - override open var gridRegularMaxWidth: GridSemanticToken { Self.mockThemeGridRawToken } - override open var gridRegularMargin: GridSemanticToken { Self.mockThemeGridRawToken } - override open var gridRegularColumnGap: GridSemanticToken { Self.mockThemeGridRawToken } -} diff --git a/OUDS/Core/OUDS/Tests/OUDSTheme/MockThemes/MockTheme.swift b/OUDS/Core/OUDS/Tests/OUDSTheme/MockThemes/MockTheme.swift index f6c50335de4..262907211b1 100644 --- a/OUDS/Core/OUDS/Tests/OUDSTheme/MockThemes/MockTheme.swift +++ b/OUDS/Core/OUDS/Tests/OUDSTheme/MockThemes/MockTheme.swift @@ -23,6 +23,8 @@ import OUDSTokensSemantic /// - ``MockThemeOpacitySemanticTokensWrapper`` for opacities /// - ``MockThemeColorSemanticTokensWrapper`` for colors /// - ``MockThemeElevationSemanticTokensWrapper`` for elevations +/// - ``MockThemeFontSemanticTokensWrapper`` for fonts +/// - ``MockThemeGridSemanticTokensWrapper`` for grids open class MockTheme: OUDSTheme, @unchecked Sendable { convenience init() { @@ -36,6 +38,7 @@ open class MockTheme: OUDSTheme, @unchecked Sendable { colors: colors, elevations: MockThemeElevationSemanticTokensWrapper(), fonts: MockThemeFontSemanticTokensWrapper(), + grids: MockThemeGridSemanticTokensWrapper(), customFontFamily: nil) } @@ -45,6 +48,7 @@ open class MockTheme: OUDSTheme, @unchecked Sendable { colors: MockThemeColorSemanticTokensWrapper(), elevations: MockThemeElevationSemanticTokensWrapper(), fonts: MockThemeFontSemanticTokensWrapper(), + grids: MockThemeGridSemanticTokensWrapper(), customFontFamily: customFont) } diff --git a/OUDS/Core/OUDS/Tests/OUDSTheme/TestThemeOverrideOfGridSemanticTokens.swift b/OUDS/Core/OUDS/Tests/OUDSTheme/TestThemeOverrideOfGridSemanticTokens.swift index 67fd56ad769..a3694805fd5 100644 --- a/OUDS/Core/OUDS/Tests/OUDSTheme/TestThemeOverrideOfGridSemanticTokens.swift +++ b/OUDS/Core/OUDS/Tests/OUDSTheme/TestThemeOverrideOfGridSemanticTokens.swift @@ -34,63 +34,63 @@ final class TestThemeOverrideOfGridSemanticTokens: XCTestCase { } func testInheritedThemeCanOverrideSemanticTokenGridIOSExtraCompactMinWidth() throws { - XCTAssertNotEqual(inheritedTheme.gridExtraCompactMinWidth, abstractTheme.gridExtraCompactMinWidth) - XCTAssertTrue(inheritedTheme.gridExtraCompactMinWidth == MockTheme.mockThemeGridRawToken) + XCTAssertNotEqual(inheritedTheme.grids.gridExtraCompactMinWidth, abstractTheme.grids.gridExtraCompactMinWidth) + XCTAssertTrue(inheritedTheme.grids.gridExtraCompactMinWidth == MockThemeGridSemanticTokensWrapper.mockThemeGridRawToken) } func testInheritedThemeCanOverrideSemanticTokenGridIOSExtraCompactMaxWidth() throws { - XCTAssertNotEqual(inheritedTheme.gridExtraCompactMaxWidth, abstractTheme.gridExtraCompactMaxWidth) - XCTAssertTrue(inheritedTheme.gridExtraCompactMaxWidth == MockTheme.mockThemeGridRawToken) + XCTAssertNotEqual(inheritedTheme.grids.gridExtraCompactMaxWidth, abstractTheme.grids.gridExtraCompactMaxWidth) + XCTAssertTrue(inheritedTheme.grids.gridExtraCompactMaxWidth == MockThemeGridSemanticTokensWrapper.mockThemeGridRawToken) } func testInheritedThemeCanOverrideSemanticTokenGridIOSExtraCompactMargin() throws { - XCTAssertNotEqual(inheritedTheme.gridExtraCompactMargin, abstractTheme.gridExtraCompactMargin) - XCTAssertTrue(inheritedTheme.gridExtraCompactMargin == MockTheme.mockThemeGridRawToken) + XCTAssertNotEqual(inheritedTheme.grids.gridExtraCompactMargin, abstractTheme.grids.gridExtraCompactMargin) + XCTAssertTrue(inheritedTheme.grids.gridExtraCompactMargin == MockThemeGridSemanticTokensWrapper.mockThemeGridRawToken) } func testInheritedThemeCanOverrideSemanticTokenGridIOSExtraCompactColumnGap() throws { - XCTAssertNotEqual(inheritedTheme.gridExtraCompactColumnGap, abstractTheme.gridExtraCompactColumnGap) - XCTAssertTrue(inheritedTheme.gridExtraCompactColumnGap == MockTheme.mockThemeGridRawToken) + XCTAssertNotEqual(inheritedTheme.grids.gridExtraCompactColumnGap, abstractTheme.grids.gridExtraCompactColumnGap) + XCTAssertTrue(inheritedTheme.grids.gridExtraCompactColumnGap == MockThemeGridSemanticTokensWrapper.mockThemeGridRawToken) } func testInheritedThemeCanOverrideSemanticTokenGridIOSCompactMinWidth() throws { - XCTAssertNotEqual(inheritedTheme.gridCompactMinWidth, abstractTheme.gridCompactMinWidth) - XCTAssertTrue(inheritedTheme.gridCompactMinWidth == MockTheme.mockThemeGridRawToken) + XCTAssertNotEqual(inheritedTheme.grids.gridCompactMinWidth, abstractTheme.grids.gridCompactMinWidth) + XCTAssertTrue(inheritedTheme.grids.gridCompactMinWidth == MockThemeGridSemanticTokensWrapper.mockThemeGridRawToken) } func testInheritedThemeCanOverrideSemanticTokenGridIOSCompactMaxWidth() throws { - XCTAssertNotEqual(inheritedTheme.gridCompactMaxWidth, abstractTheme.gridCompactMaxWidth) - XCTAssertTrue(inheritedTheme.gridCompactMaxWidth == MockTheme.mockThemeGridRawToken) + XCTAssertNotEqual(inheritedTheme.grids.gridCompactMaxWidth, abstractTheme.grids.gridCompactMaxWidth) + XCTAssertTrue(inheritedTheme.grids.gridCompactMaxWidth == MockThemeGridSemanticTokensWrapper.mockThemeGridRawToken) } func testInheritedThemeCanOverrideSemanticTokenGridIOSCompactMargin() throws { - XCTAssertNotEqual(inheritedTheme.gridCompactMargin, abstractTheme.gridCompactMargin) - XCTAssertTrue(inheritedTheme.gridCompactMargin == MockTheme.mockThemeGridRawToken) + XCTAssertNotEqual(inheritedTheme.grids.gridCompactMargin, abstractTheme.grids.gridCompactMargin) + XCTAssertTrue(inheritedTheme.grids.gridCompactMargin == MockThemeGridSemanticTokensWrapper.mockThemeGridRawToken) } func testInheritedThemeCanOverrideSemanticTokenGridIOSCompactColumnGap() throws { - XCTAssertNotEqual(inheritedTheme.gridCompactColumnGap, abstractTheme.gridCompactColumnGap) - XCTAssertTrue(inheritedTheme.gridCompactColumnGap == MockTheme.mockThemeGridRawToken) + XCTAssertNotEqual(inheritedTheme.grids.gridCompactColumnGap, abstractTheme.grids.gridCompactColumnGap) + XCTAssertTrue(inheritedTheme.grids.gridCompactColumnGap == MockThemeGridSemanticTokensWrapper.mockThemeGridRawToken) } func testInheritedThemeCanOverrideSemanticTokenGridIOSRegularMinWidth() throws { - XCTAssertNotEqual(inheritedTheme.gridRegularMinWidth, abstractTheme.gridRegularMinWidth) - XCTAssertTrue(inheritedTheme.gridRegularMinWidth == MockTheme.mockThemeGridRawToken) + XCTAssertNotEqual(inheritedTheme.grids.gridRegularMinWidth, abstractTheme.grids.gridRegularMinWidth) + XCTAssertTrue(inheritedTheme.grids.gridRegularMinWidth == MockThemeGridSemanticTokensWrapper.mockThemeGridRawToken) } func testInheritedThemeCanOverrideSemanticTokenGridIOSRegularMaxWidth() throws { - XCTAssertNotEqual(inheritedTheme.gridRegularMaxWidth, abstractTheme.gridRegularMaxWidth) - XCTAssertTrue(inheritedTheme.gridRegularMaxWidth == MockTheme.mockThemeGridRawToken) + XCTAssertNotEqual(inheritedTheme.grids.gridRegularMaxWidth, abstractTheme.grids.gridRegularMaxWidth) + XCTAssertTrue(inheritedTheme.grids.gridRegularMaxWidth == MockThemeGridSemanticTokensWrapper.mockThemeGridRawToken) } func testInheritedThemeCanOverrideSemanticTokenGridIOSRegularMargin() throws { - XCTAssertNotEqual(inheritedTheme.gridRegularMargin, abstractTheme.gridRegularMargin) - XCTAssertTrue(inheritedTheme.gridRegularMargin == MockTheme.mockThemeGridRawToken) + XCTAssertNotEqual(inheritedTheme.grids.gridRegularMargin, abstractTheme.grids.gridRegularMargin) + XCTAssertTrue(inheritedTheme.grids.gridRegularMargin == MockThemeGridSemanticTokensWrapper.mockThemeGridRawToken) } func testInheritedThemeCanOverrideSemanticTokenGridIOSRegularColumnGap() throws { - XCTAssertNotEqual(inheritedTheme.gridRegularColumnGap, abstractTheme.gridRegularColumnGap) - XCTAssertTrue(inheritedTheme.gridRegularColumnGap == MockTheme.mockThemeGridRawToken) + XCTAssertNotEqual(inheritedTheme.grids.gridRegularColumnGap, abstractTheme.grids.gridRegularColumnGap) + XCTAssertTrue(inheritedTheme.grids.gridRegularColumnGap == MockThemeGridSemanticTokensWrapper.mockThemeGridRawToken) } } diff --git a/OUDS/Core/Themes/Orange/Sources/OrangeTheme.swift b/OUDS/Core/Themes/Orange/Sources/OrangeTheme.swift index 9ea6c49c0ff..f819d728b10 100644 --- a/OUDS/Core/Themes/Orange/Sources/OrangeTheme.swift +++ b/OUDS/Core/Themes/Orange/Sources/OrangeTheme.swift @@ -41,16 +41,19 @@ open class OrangeTheme: OUDSTheme, @unchecked Sendable { /// - colors: An object providing all the color semantic tokens, as `AllColorSemanticTokens` implementation /// - elevations: An object providing all the elevation semantic tokens, by default `AllElevationSemanticTokens` /// - fonts: An object providing all the font semantic tokens, by default `AllFontemanticTokens` + /// - grids: An object providing all the grid semantic tokens, by default `AllGridSemanticTokens` override public init(borders: AllBorderSemanticTokens, opacities: AllOpacitySemanticTokens, colors: AllColorSemanticTokens, elevations: AllElevationSemanticTokens, - fonts: AllFontSemanticTokens) { + fonts: AllFontSemanticTokens, + grids: AllGridSemanticTokens) { super.init(borders: borders, opacities: opacities, colors: colors, elevations: elevations, - fonts: fonts) + fonts: fonts, + grids: grids) } deinit { } diff --git a/OUDS/Core/Tokens/SemanticTokens/Sources/Wrappers/OUDSBorderSemanticTokensWrapper.swift b/OUDS/Core/Tokens/SemanticTokens/Sources/Wrappers/OUDSBorderSemanticTokensWrapper.swift index f2135327131..c9aed029d63 100644 --- a/OUDS/Core/Tokens/SemanticTokens/Sources/Wrappers/OUDSBorderSemanticTokensWrapper.swift +++ b/OUDS/Core/Tokens/SemanticTokens/Sources/Wrappers/OUDSBorderSemanticTokensWrapper.swift @@ -12,7 +12,7 @@ // /// A class which wraps all **border semantic tokens** and expose them. -/// This wrapper should be integrated as a ``BorderSemanticTokens`` implementation inside `OUDSTheme` so as to provide +/// This wrapper should be integrated as a ``AllBorderSemanticTokens`` implementation inside `OUDSTheme` so as to provide /// all tokens to the users. open class OUDSBorderSemanticTokensWrapper { diff --git a/OUDS/Core/Tokens/SemanticTokens/Sources/Wrappers/OUDSGridSemanticTokensWrapper.swift b/OUDS/Core/Tokens/SemanticTokens/Sources/Wrappers/OUDSGridSemanticTokensWrapper.swift new file mode 100644 index 00000000000..9cb9e9e7c04 --- /dev/null +++ b/OUDS/Core/Tokens/SemanticTokens/Sources/Wrappers/OUDSGridSemanticTokensWrapper.swift @@ -0,0 +1,28 @@ +// +// 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 +// + +/// A class which wraps all **grid semantic tokens** and expose them. +/// This wrapper should be integrated as a ``AllGridSemanticTokens`` implementation inside `OUDSTheme` so as to provide +/// all tokens to the users. +open class OUDSGridSemanticTokensWrapper { + + /// Intializes the wrapper + public init() { } + + deinit{ } + + // ଘ( ・ω・)_/゚・:*:・。☆ + // Note: So as to help the integration of generated code produced by the tokenator + // the implemention of GridSemanticTokens is not here but in OUDS/OUDSTheme/OUDSTheme+SemanticTokens/OUDSTheme+GridSemanticTokens.swift + // This declaration of OUDSGridSemanticTokensWrapper is here to allow to write documentation. +} diff --git a/OUDS/Core/Tokens/SemanticTokens/Sources/Wrappers/OUDSOpacitySemanticTokensWrapper.swift b/OUDS/Core/Tokens/SemanticTokens/Sources/Wrappers/OUDSOpacitySemanticTokensWrapper.swift index 41ecc33d071..07c6d87d63d 100644 --- a/OUDS/Core/Tokens/SemanticTokens/Sources/Wrappers/OUDSOpacitySemanticTokensWrapper.swift +++ b/OUDS/Core/Tokens/SemanticTokens/Sources/Wrappers/OUDSOpacitySemanticTokensWrapper.swift @@ -12,7 +12,7 @@ // /// A class which wraps all **opacity semantic tokens** and expose them. -/// This wrapper should be integrated as a ``OpacitySemanticTokens`` implementation inside `OUDSTheme` so as to provide +/// This wrapper should be integrated as a ``AllOpacitySemanticTokens`` implementation inside `OUDSTheme` so as to provide /// all tokens to the users. open class OUDSOpacitySemanticTokensWrapper { diff --git a/OUDS/Core/Tokens/SemanticTokens/Sources/Wrappers/SemanticTokensWrappers+TypeAliases.swift b/OUDS/Core/Tokens/SemanticTokens/Sources/Wrappers/SemanticTokensWrappers+TypeAliases.swift index 66b6066f2aa..6839c3b363f 100644 --- a/OUDS/Core/Tokens/SemanticTokens/Sources/Wrappers/SemanticTokensWrappers+TypeAliases.swift +++ b/OUDS/Core/Tokens/SemanticTokens/Sources/Wrappers/SemanticTokensWrappers+TypeAliases.swift @@ -13,23 +13,30 @@ /// A type alias only for ``BorderSemanticTokens`` so as to keep consistency with other type aliases /// merging several protocols +/// For example ``OUDSBorderSemanticTokensWrapper`` matches this type alias. public typealias AllBorderSemanticTokens = BorderSemanticTokens /// A type alias only for ``OpacitySemanticTokens`` so as to keep consistency with other type aliases -/// merging several protocols +/// merging several protocols. +/// For example ``OUDSOpacitySemanticTokensWrapper`` matches this type alias. public typealias AllOpacitySemanticTokens = OpacitySemanticTokens +/// A type alias only for ``GridSemanticTokens`` so as to keep consistency with other type aliases +/// merging several protocols. +/// For example ``OUDGridSemanticTokensWrapper`` matches this type alias. +public typealias AllGridSemanticTokens = GridSemanticTokens + /// A type alias which merges ``ColorSemanticTokens`` and ``ColorMultipleSemanticTokens``. /// It helps in the end to define a wrapper for all the semantic tokens of colors, multiple or not, generated or not. -/// For example ``OUDSColorSemanticTokensWrapper`` uses this type alias. +/// For example ``OUDSColorSemanticTokensWrapper`` matches this type alias. public typealias AllColorSemanticTokens = ColorSemanticTokens & ColorMultipleSemanticTokens /// A type alias which merges ``ElevationSemanticTokens``, ``ElevationCompositeSemanticTokens`` and ``ElevationMultipleSemanticTokens``. /// It helps in the end to define a wrapper for all the semantic tokens of elevations, multiple or not, generated or not. -/// For example ``OUDSElevationSemanticTokensWrapper`` uses this type alias. +/// For example ``OUDSElevationSemanticTokensWrapper`` matches this type alias. public typealias AllElevationSemanticTokens = ElevationSemanticTokens & ElevationCompositeSemanticTokens & ElevationMultipleSemanticTokens /// A type alias which merges ``FontSemanticTokens``, ``FontCompositeSemanticTokens`` and ``FontMultipleSemanticTokens``. /// It helps in the end to define a wrapper for all the semantic tokens of fonts, multiple, composite, or not, generated or not. -/// For example ``OUDSFontSemanticTokensWrapper`` uses this type alias. +/// For example ``OUDSFontSemanticTokensWrapper`` matches this type alias. public typealias AllFontSemanticTokens = FontSemanticTokens & FontCompositeSemanticTokens & FontMultipleSemanticTokens