From d6f4268b9887f5ac8329ed072de84e697a336827 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Lapersonne Date: Mon, 23 Sep 2024 09:52:34 +0200 Subject: [PATCH] refactor: remove tokens `elevationZIndex` and add `elevationX200`(#119) (#121) Signed-off-by: Pierre-Yves Lapersonne --- CHANGELOG.md | 7 +++++++ .../Values/ElevationRawTokens+Values.swift | 19 +------------------ .../Tests/ElevationRawTokensTests.swift | 6 ++++++ .../ElevationSemanticTokens+Aliases.swift | 3 --- 4 files changed, 14 insertions(+), 21 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f34d77a2b..91fb51958 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased](https://github.com/Orange-OpenSource/ouds-ios/compare/0.2.0...develop) +### Added + +- [Library] Add `elevationX200` raw token ([#119](https://github.com/Orange-OpenSource/ouds-ios/issues/119)) + +### Removed + +- [Library] Remove raw tokens `elevationZIndex` ([#119](https://github.com/Orange-OpenSource/ouds-ios/issues/119)) ## [0.2.0](https://github.com/Orange-OpenSource/ouds-ios/compare/0.1.0...0.2.0) - 2024-09-19 diff --git a/OUDS/Core/Tokens/RawTokens/Sources/Values/ElevationRawTokens+Values.swift b/OUDS/Core/Tokens/RawTokens/Sources/Values/ElevationRawTokens+Values.swift index f7d80ff52..0703e94cd 100644 --- a/OUDS/Core/Tokens/RawTokens/Sources/Values/ElevationRawTokens+Values.swift +++ b/OUDS/Core/Tokens/RawTokens/Sources/Values/ElevationRawTokens+Values.swift @@ -15,27 +15,10 @@ /// Should be fully generated in the future. extension ElevationRawTokens { - // MARK: Primitive token - Elevation - Z Index - - public static let elevationZIndex0: ElevationRawToken = 0 - public static let elevationZIndexMinus9999: ElevationRawToken = -9999 - public static let elevationZIndex1000: ElevationRawToken = 1000 - public static let elevationZIndex1010: ElevationRawToken = 1010 - public static let elevationZIndex1020: ElevationRawToken = 1020 - public static let elevationZIndex1030: ElevationRawToken = 1030 - public static let elevationZIndex1035: ElevationRawToken = 1035 - public static let elevationZIndex1038: ElevationRawToken = 1038 - public static let elevationZIndex1040: ElevationRawToken = 1040 - public static let elevationZIndex1045: ElevationRawToken = 1045 - public static let elevationZIndex1050: ElevationRawToken = 1050 - public static let elevationZIndex1060: ElevationRawToken = 1060 - public static let elevationZIndex1070: ElevationRawToken = 1070 - public static let elevationZIndex1080: ElevationRawToken = 1080 - public static let elevationZIndex1090: ElevationRawToken = 1090 - // MARK: Primitive token - Elevation - X public static let elevationX0: ElevationRawToken = 0 + public static let elevationX200: ElevationRawToken = 2 // MARK: Primitive token - Elevation - Y diff --git a/OUDS/Core/Tokens/RawTokens/Tests/ElevationRawTokensTests.swift b/OUDS/Core/Tokens/RawTokens/Tests/ElevationRawTokensTests.swift index 75d4f5449..b1d6737d8 100644 --- a/OUDS/Core/Tokens/RawTokens/Tests/ElevationRawTokensTests.swift +++ b/OUDS/Core/Tokens/RawTokens/Tests/ElevationRawTokensTests.swift @@ -62,6 +62,12 @@ final class ElevationRawTokensTests: XCTestCase { XCTAssertTrue(radius == 6) } + // MARK: - Primitive token - Elevation - X + + func testElevationXRawToken0LessThanX200() throws { + XCTAssertLessThan(ElevationRawTokens.elevationX0, ElevationRawTokens.elevationX200) + } + // MARK: - Primitive token - Elevation - Y func testElevationYRawToken0LessThanY100() throws { diff --git a/OUDS/Core/Tokens/SemanticTokens/Sources/TypeAliases/ElevationSemanticTokens+Aliases.swift b/OUDS/Core/Tokens/SemanticTokens/Sources/TypeAliases/ElevationSemanticTokens+Aliases.swift index dfe4f183e..ed6685a04 100644 --- a/OUDS/Core/Tokens/SemanticTokens/Sources/TypeAliases/ElevationSemanticTokens+Aliases.swift +++ b/OUDS/Core/Tokens/SemanticTokens/Sources/TypeAliases/ElevationSemanticTokens+Aliases.swift @@ -13,9 +13,6 @@ import OUDSTokensRaw -/// Basically an elevation semantic token for Z Index is a raw token for elevation, with the same final type, to keep grammar clean and clear with design system grammar. -public typealias ElevationZIndexSemanticToken = ElevationRawToken - /// Basically an elevation semantic token for X offset is a raw token for elevation, with the same final type, to keep grammar clean and clear with design system grammar. public typealias ElevationXSemanticToken = ElevationRawToken