diff --git a/CHANGELOG.md b/CHANGELOG.md index 69766cb7d5..b1ffff0024 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Removed +- [Library] Semantic tokens `elevationBlurFocus`, `elevationXFocus`, `elevationYFocus`, `elevationColorFocus` ([#209](https://github.com/Orange-OpenSource/ouds-ios/issues/209)) - [Library] Semantic token `fontWeightCode` ([#210](https://github.com/Orange-OpenSource/ouds-ios/issues/210)) ## [0.4.1](https://github.com/Orange-OpenSource/ouds-ios/compare/0.4.0...0.4.1) - 2024-10-21 diff --git a/OUDS/Core/OUDS/Sources/OUDSTheme/OUDSTheme+SemanticTokens/OUDSTheme+ElevationSemanticTokens.swift b/OUDS/Core/OUDS/Sources/OUDSTheme/OUDSTheme+SemanticTokens/OUDSTheme+ElevationSemanticTokens.swift index 4bd1a24408..a3be621bd0 100644 --- a/OUDS/Core/OUDS/Sources/OUDSTheme/OUDSTheme+SemanticTokens/OUDSTheme+ElevationSemanticTokens.swift +++ b/OUDS/Core/OUDS/Sources/OUDSTheme/OUDSTheme+SemanticTokens/OUDSTheme+ElevationSemanticTokens.swift @@ -18,8 +18,6 @@ import OUDSTokensSemantic // ଘ( ・ω・)_/゚・:*:・。☆ // [File to generate with the tokenator] -// swiftlint:disable line_length - /// Defines basic values common to all themes for `ElevationSemanticTokenss`. /// These values can be overriden inside `OUDSTheme` subclasses (in extensions or not, in the same module or not) thanks to the `@objc open` combination. /// The aim of this extensions is to make relationships between all semantic tokens for elevations and associated raw tokens. @@ -36,7 +34,6 @@ extension OUDSTheme: ElevationSemanticTokens { @objc open var elevationXStickyDefault: ElevationXSemanticToken { ElevationRawTokens.elevationX0 } @objc open var elevationXStickyEmphasized: ElevationXSemanticToken { ElevationRawTokens.elevationX0 } @objc open var elevationXStickyNavigationScrolled: ElevationXSemanticToken { ElevationRawTokens.elevationX0 } - @objc open var elevationXFocus: ElevationXSemanticToken { ElevationRawTokens.elevationX0 } // MARK: Semantic token - Elevation - Y @@ -48,7 +45,6 @@ extension OUDSTheme: ElevationSemanticTokens { @objc open var elevationYStickyDefault: ElevationYSemanticToken { ElevationRawTokens.elevationY300 } @objc open var elevationYStickyEmphasized: ElevationYSemanticToken { ElevationRawTokens.elevationY300 } @objc open var elevationYStickyNavigationScrolled: ElevationYSemanticToken { ElevationRawTokens.elevationY300 } - @objc open var elevationYFocus: ElevationYSemanticToken { ElevationRawTokens.elevationY0 } // MARK: Semantic token - Elevation - Blur @@ -60,7 +56,6 @@ extension OUDSTheme: ElevationSemanticTokens { @objc open var elevationBlurStickyDefault: ElevationBlurSemanticToken { ElevationRawTokens.elevationBlur400 } @objc open var elevationBlurStickyEmphasized: ElevationBlurSemanticToken { ElevationRawTokens.elevationBlur400 } @objc open var elevationBlurStickyNavigationScrolled: ElevationBlurSemanticToken { ElevationRawTokens.elevationBlur400 } - @objc open var elevationBlurFocus: ElevationBlurSemanticToken { ElevationRawTokens.elevationBlur0 } // MARK: Semantic token - Elevation - Color @@ -72,7 +67,6 @@ extension OUDSTheme: ElevationSemanticTokens { @objc open var elevationColorStickyDefault: ElevationColorSemanticToken { ElevationColorSemanticToken(ColorRawTokens.colorTransparentBlack300) } @objc open var elevationColorStickyEmphasized: ElevationColorSemanticToken { ElevationColorSemanticToken(ColorRawTokens.colorTransparentBlack300) } @objc open var elevationColorStickyNavigationScrolled: ElevationColorSemanticToken { ElevationColorSemanticToken(ColorRawTokens.colorTransparentBlack300) } - @objc open var elevationColorFocus: ElevationColorSemanticToken { ElevationColorSemanticToken(light: ColorRawTokens.colorFunctionalBlack, dark: ColorRawTokens.colorFunctionalLightGray160) } // MARK: Semantic token - Elevation - Box shadow @@ -84,7 +78,4 @@ extension OUDSTheme: ElevationSemanticTokens { @objc open var elevationStickyDefault: ElevationCompositeSemanticToken { ElevationCompositeSemanticToken(ElevationRawTokens.elevationBottom_3_300) } @objc open var elevationStickyEmphasized: ElevationCompositeSemanticToken { ElevationCompositeSemanticToken(ElevationRawTokens.elevationBottom_3_300) } @objc open var elevationStickyNavigationScrolled: ElevationCompositeSemanticToken { ElevationCompositeSemanticToken(ElevationRawTokens.elevationBottom_3_300) } - @objc open var elevationFocus: ElevationCompositeSemanticToken { ElevationCompositeSemanticToken(light: ElevationCompositeRawToken(x: 0, y: 0, blur: 0, color: ColorRawTokens.colorFunctionalBlack), dark: ElevationCompositeRawToken(x: 0, y: 0, blur: 0, color: ColorRawTokens.colorFunctionalLightGray160)) } } - -// swiftlint:enable line_length diff --git a/OUDS/Core/OUDS/Tests/OUDSTheme/MockThemes/MockTheme+ElevationSemanticTokens.swift b/OUDS/Core/OUDS/Tests/OUDSTheme/MockThemes/MockTheme+ElevationSemanticTokens.swift index c20e66a3fd..1a5e62d7ff 100644 --- a/OUDS/Core/OUDS/Tests/OUDSTheme/MockThemes/MockTheme+ElevationSemanticTokens.swift +++ b/OUDS/Core/OUDS/Tests/OUDSTheme/MockThemes/MockTheme+ElevationSemanticTokens.swift @@ -37,7 +37,6 @@ extension MockTheme { override open var elevationXStickyDefault: ElevationYSemanticToken { Self.mockThemeElevationXRawToken } override open var elevationXStickyEmphasized: ElevationYSemanticToken { Self.mockThemeElevationXRawToken } override open var elevationXStickyNavigationScrolled: ElevationYSemanticToken { Self.mockThemeElevationXRawToken } - override open var elevationXFocus: ElevationYSemanticToken { Self.mockThemeElevationXRawToken } // MARK: Semantic token - Elevation - Y @@ -49,7 +48,6 @@ extension MockTheme { override open var elevationYStickyDefault: ElevationYSemanticToken { Self.mockThemeElevationYRawToken } override open var elevationYStickyEmphasized: ElevationYSemanticToken { Self.mockThemeElevationYRawToken } override open var elevationYStickyNavigationScrolled: ElevationYSemanticToken { Self.mockThemeElevationYRawToken } - override open var elevationYFocus: ElevationYSemanticToken { Self.mockThemeElevationYRawToken } // MARK: Semantic token - Elevation - Blur @@ -61,7 +59,6 @@ extension MockTheme { override open var elevationBlurStickyDefault: ElevationBlurSemanticToken { Self.mockThemeElevationBlurRawToken } override open var elevationBlurStickyEmphasized: ElevationBlurSemanticToken { Self.mockThemeElevationBlurRawToken } override open var elevationBlurStickyNavigationScrolled: ElevationBlurSemanticToken { Self.mockThemeElevationBlurRawToken } - override open var elevationBlurFocus: ElevationBlurSemanticToken { Self.mockThemeElevationBlurRawToken } // MARK: Semantic token - Elevation - Color - None @@ -95,10 +92,6 @@ extension MockTheme { override open var elevationColorStickyNavigationScrolled: ElevationColorSemanticToken { Self.mockThemeElevationMultipleColorSemanticToken } - // MARK: Semantic token - Elevation - Color - Focus - - override open var elevationColorFocus: ElevationColorSemanticToken { Self.mockThemeElevationMultipleColorSemanticToken } - // MARK: Semantic token - Elevation - Box shadow override open var elevationRaised: ElevationCompositeSemanticToken { Self.mockThemeElevationCompositeSemanticToken } @@ -114,7 +107,5 @@ extension MockTheme { override open var elevationStickyEmphasized: ElevationCompositeSemanticToken { Self.mockThemeElevationCompositeSemanticToken } override open var elevationStickyNavigationScrolled: ElevationCompositeSemanticToken { Self.mockThemeElevationCompositeSemanticToken } - - override open var elevationFocus: ElevationCompositeSemanticToken { Self.mockThemeElevationCompositeSemanticToken } } // swiftlint:enable identifier_name diff --git a/OUDS/Core/OUDS/Tests/OUDSTheme/TestThemeOverrideOfElevationSemanticTokens.swift b/OUDS/Core/OUDS/Tests/OUDSTheme/TestThemeOverrideOfElevationSemanticTokens.swift index f14a67b4cd..5a2c264963 100644 --- a/OUDS/Core/OUDS/Tests/OUDSTheme/TestThemeOverrideOfElevationSemanticTokens.swift +++ b/OUDS/Core/OUDS/Tests/OUDSTheme/TestThemeOverrideOfElevationSemanticTokens.swift @@ -74,11 +74,6 @@ final class TestThemeOverrideOfElevationSemanticTokens: XCTestCase { XCTAssertTrue(inheritedTheme.elevationXStickyNavigationScrolled == MockTheme.mockThemeElevationXRawToken) } - func testInheritedThemeCanOverrideSemanticTokenElevationXFocus() throws { - XCTAssertNotEqual(inheritedTheme.elevationXFocus, abstractTheme.elevationXFocus) - XCTAssertTrue(inheritedTheme.elevationXFocus == MockTheme.mockThemeElevationXRawToken) - } - // MARK: - Semantic token - Elevation - Y func testInheritedThemeCanOverrideSemanticTokenElevationYNone() throws { @@ -121,11 +116,6 @@ final class TestThemeOverrideOfElevationSemanticTokens: XCTestCase { XCTAssertTrue(inheritedTheme.elevationYStickyNavigationScrolled == MockTheme.mockThemeElevationYRawToken) } - func testInheritedThemeCanOverrideSemanticTokenElevationYFocus() throws { - XCTAssertNotEqual(inheritedTheme.elevationYFocus, abstractTheme.elevationYFocus) - XCTAssertTrue(inheritedTheme.elevationYFocus == MockTheme.mockThemeElevationYRawToken) - } - // MARK: - Semantic token - Elevation - Blur func testInheritedThemeCanOverrideSemanticTokenElevationBlurNone() throws { @@ -168,11 +158,6 @@ final class TestThemeOverrideOfElevationSemanticTokens: XCTestCase { XCTAssertTrue(inheritedTheme.elevationBlurStickyNavigationScrolled == MockTheme.mockThemeElevationBlurRawToken) } - func testInheritedThemeCanOverrideSemanticTokenElevationBlurFocus() throws { - XCTAssertNotEqual(inheritedTheme.elevationBlurFocus, abstractTheme.elevationBlurFocus) - XCTAssertTrue(inheritedTheme.elevationBlurFocus == MockTheme.mockThemeElevationBlurRawToken) - } - // MARK: - Semantic token - Elevation - Color - None func testInheritedThemeCanOverrideSemanticTokenElevationColorNone() throws { @@ -215,11 +200,6 @@ final class TestThemeOverrideOfElevationSemanticTokens: XCTestCase { XCTAssertTrue(inheritedTheme.elevationColorStickyNavigationScrolled == MockTheme.mockThemeElevationMultipleColorSemanticToken) } - func testInheritedThemeCanOverrideSemanticTokenElevationColorFocus() throws { - XCTAssertNotEqual(inheritedTheme.elevationColorFocus, abstractTheme.elevationColorFocus) - XCTAssertTrue(inheritedTheme.elevationColorFocus == MockTheme.mockThemeElevationMultipleColorSemanticToken) - } - func testInheritedThemeCanOverrideSemanticTokenElevationCompositeRaised() throws { XCTAssertNotEqual(inheritedTheme.elevationRaised, abstractTheme.elevationRaised) XCTAssertTrue(inheritedTheme.elevationRaised == MockTheme.mockThemeElevationCompositeSemanticToken) @@ -254,11 +234,6 @@ final class TestThemeOverrideOfElevationSemanticTokens: XCTestCase { XCTAssertNotEqual(inheritedTheme.elevationStickyNavigationScrolled, abstractTheme.elevationStickyNavigationScrolled) XCTAssertTrue(inheritedTheme.elevationStickyNavigationScrolled == MockTheme.mockThemeElevationCompositeSemanticToken) } - - func testInheritedThemeCanOverrideSemanticTokenElevationCompositeFocus() throws { - XCTAssertNotEqual(inheritedTheme.elevationFocus, abstractTheme.elevationFocus) - XCTAssertTrue(inheritedTheme.elevationFocus == MockTheme.mockThemeElevationCompositeSemanticToken) - } } // swiftlint:enable required_deinit diff --git a/OUDS/Core/Themes/Inverse/Sources/InverseTheme+ElevationSemanticTokens.swift b/OUDS/Core/Themes/Inverse/Sources/InverseTheme+ElevationSemanticTokens.swift deleted file mode 100644 index 889f1ac8b8..0000000000 --- a/OUDS/Core/Themes/Inverse/Sources/InverseTheme+ElevationSemanticTokens.swift +++ /dev/null @@ -1,34 +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 - -// ଘ( ・ω・)_/゚・:*:・。☆ -// [File to generate with the tokenator] - -// swiftlint:disable line_length - -extension InverseTheme { - - // MARK: Semantic token - Elevation - Color - - override public var elevationColorFocus: ElevationColorSemanticToken { MultipleColorTokens( ColorRawTokens.colorFunctionalLightGray160) } - - // MARK: Semantic token - Elevation - Box shadow - - override public var elevationFocus: ElevationCompositeSemanticToken { ElevationCompositeSemanticToken(light: ElevationCompositeRawToken(x: 0, y: 0, blur: 0, color: ColorRawTokens.colorFunctionalLightGray160), dark: ElevationCompositeRawToken(x: 0, y: 0, blur: 0, color: ColorRawTokens.colorFunctionalLightGray160)) } -} - -// swiftlint:enable line_length diff --git a/OUDS/Core/Themes/Inverse/Tests/TestInverseThemeElevation.swift b/OUDS/Core/Themes/Inverse/Tests/TestInverseThemeElevation.swift index 6262cb9afb..42af10f72c 100644 --- a/OUDS/Core/Themes/Inverse/Tests/TestInverseThemeElevation.swift +++ b/OUDS/Core/Themes/Inverse/Tests/TestInverseThemeElevation.swift @@ -37,11 +37,6 @@ final class TestInverseThemeElevationColors: XCTestCase { XCTAssertEqual(inverseTheme.elevationColorStickyDefault.light, inverseTheme.elevationColorStickyDefault.dark) XCTAssertEqual(inverseTheme.elevationColorStickyEmphasized.light, inverseTheme.elevationColorStickyEmphasized.dark) XCTAssertEqual(inverseTheme.elevationColorStickyNavigationScrolled.light, inverseTheme.elevationColorStickyNavigationScrolled.dark) - XCTAssertEqual(inverseTheme.elevationColorFocus.light, inverseTheme.elevationColorFocus.dark) - } - - func testElevationEquality() throws { - XCTAssertEqual(inverseTheme.elevationFocus.light, inverseTheme.elevationFocus.dark) } } diff --git a/OUDS/Core/Tokens/SemanticTokens/Sources/Values/ElevationSemanticTokens.swift b/OUDS/Core/Tokens/SemanticTokens/Sources/Values/ElevationSemanticTokens.swift index 02c6fecff0..3a7da714a0 100644 --- a/OUDS/Core/Tokens/SemanticTokens/Sources/Values/ElevationSemanticTokens.swift +++ b/OUDS/Core/Tokens/SemanticTokens/Sources/Values/ElevationSemanticTokens.swift @@ -33,7 +33,6 @@ public protocol ElevationSemanticTokens { var elevationXStickyDefault: ElevationXSemanticToken { get } var elevationXStickyEmphasized: ElevationXSemanticToken { get } var elevationXStickyNavigationScrolled: ElevationXSemanticToken { get } - var elevationXFocus: ElevationXSemanticToken { get } // MARK: Semantic token - Elevation - Y @@ -45,7 +44,6 @@ public protocol ElevationSemanticTokens { var elevationYStickyDefault: ElevationYSemanticToken { get } var elevationYStickyEmphasized: ElevationYSemanticToken { get } var elevationYStickyNavigationScrolled: ElevationYSemanticToken { get } - var elevationYFocus: ElevationYSemanticToken { get } // MARK: Semantic token - Elevation - Blur @@ -57,7 +55,6 @@ public protocol ElevationSemanticTokens { var elevationBlurStickyDefault: ElevationBlurSemanticToken { get } var elevationBlurStickyEmphasized: ElevationBlurSemanticToken { get } var elevationBlurStickyNavigationScrolled: ElevationBlurSemanticToken { get } - var elevationBlurFocus: ElevationBlurSemanticToken { get } // MARK: Semantic token - Elevation - Color @@ -69,7 +66,6 @@ public protocol ElevationSemanticTokens { var elevationColorStickyDefault: ElevationColorSemanticToken { get } var elevationColorStickyEmphasized: ElevationColorSemanticToken { get } var elevationColorStickyNavigationScrolled: ElevationColorSemanticToken { get } - var elevationColorFocus: ElevationColorSemanticToken { get } // MARK: Semantic token - Elevation - Box shadow @@ -81,7 +77,6 @@ public protocol ElevationSemanticTokens { var elevationStickyDefault: ElevationCompositeSemanticToken { get } var elevationStickyEmphasized: ElevationCompositeSemanticToken { get } var elevationStickyNavigationScrolled: ElevationCompositeSemanticToken { get } - var elevationFocus: ElevationCompositeSemanticToken { get } } // swiftlint:enable missing_docs diff --git a/Showcase/Showcase/Pages/Tokens/Elevation/ElevationTokenPage.swift b/Showcase/Showcase/Pages/Tokens/Elevation/ElevationTokenPage.swift index f2f99f9427..72d0ad3953 100644 --- a/Showcase/Showcase/Pages/Tokens/Elevation/ElevationTokenPage.swift +++ b/Showcase/Showcase/Pages/Tokens/Elevation/ElevationTokenPage.swift @@ -56,7 +56,6 @@ struct ElevationTokenPage: View { private enum NamedElevation: String, CaseIterable { case elevationNone - case elevationFocus case elevationRaised case elevationStickyNavigationScrolled case elevationOverlayDefault @@ -69,8 +68,6 @@ private enum NamedElevation: String, CaseIterable { switch self { case .elevationNone: return theme.elevationNone - case .elevationFocus: - return theme.elevationFocus case .elevationRaised: return theme.elevationRaised case .elevationStickyNavigationScrolled: