Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update tokens #319

Merged
merged 2 commits into from
Nov 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

- [Library] Update `GridRawTokens` tokens (tokenator *20241128161629*)
- [DemoApp] Update color page
- [Library] Update `ColorSemanticTokens` tokens (tokenator *20241127112301*)
- [Library] Update `SpaceSemanticTokens` tokens (tokenator *20241127074206*)
Expand All @@ -24,6 +25,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Removed

- [Library] Grid raw tokens `gridMargin900`
- [Library] Color semantic tokens `colorContentOnBg*`, `colorBorderOnBg*`, `colorBorderStatus*`, some `colorAction*OnBg*`, `colorDecorative{Primary,Secondary,Tertiary}`, `colorAlwaysOnBg*`, `colorBgBrand{Secondary,Tertiary}`, `colorContentBrand{Secondary,Tertiary}`, `colorBorderBrand{Secondary,Tertiary}`, `colorContentStatusAccent`, ...
- [Library] Some space semantic tokens type aliases to help tokenator job (`SpacePaddingInlineSemanticToken`, `SpacePaddingBlockSemanticToken`, `SpaceGapInlineSemanticToken`, `SpaceGapStackSemanticToken`)
- [Library] All dimension semantic tokens ([#308](https://github.com/Orange-OpenSource/ouds-ios/issues/308))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,85 +11,41 @@
// Software description: A SwiftUI components library with code examples for Orange Unified Design System
//

// ଘ( ・ω・)_/゚・:*:・。☆
// [File to generate by the tokenator]
// WARNING: Not synchronized anymore with the Figjam / Figma by developers team
// Create an issue for update https://github.com/Orange-OpenSource/ouds-ios/issues/new?template=token_update.yml

// swiftlint:disable missing_docs
// swiftlint:disable number_separator

/// Extracted in a separated file to help the *Figma* JSON to Swift parser to generate files to include easily.
extension GridRawTokens {

/// Double type because used below for computations with Double values, output of the parser
public static let dimensionBase: Double = 4

// MARK: Primitive token - Grid - Min width

public static let gridMinWidthExtraCompact: GridRawToken = 320
public static let gridMinWidthCompact: GridRawToken = 390
public static let gridMinWidthRegular: GridRawToken = 736

// MARK: Primitive token - Grid - Max width

public static let gridMaxWidthExtraCompact: GridRawToken = 389
public static let gridMaxWidthCompact: GridRawToken = 852
public static let gridMaxWidthRegular: GridRawToken = 1_336

// MARK: Primitive token - Grid - Margin

public static let gridMargin100: GridRawToken = dimensionBase * 4
public static let gridMargin300: GridRawToken = dimensionBase * 6
public static let gridMargin400: GridRawToken = dimensionBase * 7
public static let gridMargin500: GridRawToken = dimensionBase * 8
public static let gridMargin600: GridRawToken = dimensionBase * 9
public static let gridMargin700: GridRawToken = dimensionBase * 10
public static let gridMargin900: GridRawToken = dimensionBase * 12
public static let gridMargin1000: GridRawToken = dimensionBase * 13
public static let gridMargin1100: GridRawToken = dimensionBase * 14
public static let gridMargin1700: GridRawToken = dimensionBase * 20
public static let gridMargin2500: GridRawToken = dimensionBase * 28

// MARK: Primitive token - Grid - Column gap

public static let gridColumnGap10: GridRawToken = dimensionBase * 0.25
public static let gridColumnGap100: GridRawToken = dimensionBase * 2
public static let gridColumnGap200: GridRawToken = dimensionBase * 4
public static let gridColumnGap300: GridRawToken = dimensionBase * 5
public static let gridColumnGap400: GridRawToken = dimensionBase * 6
public static let gridColumnGap600: GridRawToken = dimensionBase * 8
public static let gridColumnGap700: GridRawToken = dimensionBase * 10

// MARK: Primitive token - Grid - Column count

public static let gridColumnCount100: GridRawToken = 1
public static let gridColumnCount200: GridRawToken = 2
public static let gridColumnCount400: GridRawToken = 4
public static let gridColumnCount600: GridRawToken = 6
public static let gridColumnCount800: GridRawToken = 8
public static let gridColumnCount1000: GridRawToken = 10
public static let gridColumnCount1200: GridRawToken = 12

// MARK: Primitive token - Grid - Composite - iOS Extra Compact

public static let gridExtraCompactMinWidth: GridRawToken = gridMinWidthExtraCompact
public static let gridExtraCompactMaxWidth: GridRawToken = gridMaxWidthExtraCompact
public static let gridExtraCompactMargin: GridRawToken = gridMargin100
public static let gridExtraCompactColumnGap: GridRawToken = gridColumnGap100

// MARK: Primitive token - Grid - Composite - iOS Compact

public static let gridCompactMinWidth: GridRawToken = gridMinWidthCompact
public static let gridCompactMaxWidth: GridRawToken = gridMaxWidthCompact
public static let gridCompactMargin: GridRawToken = gridMargin300
public static let gridCompactColumnGap: GridRawToken = gridColumnGap100

// MARK: Primitive token - Grid - Composite - iOS Regular

public static let gridRegularMinWidth: GridRawToken = gridMinWidthCompact
public static let gridRegularMaxWidth: GridRawToken = gridMaxWidthCompact
public static let gridRegularMargin: GridRawToken = gridMargin500
public static let gridRegularColumnGap: GridRawToken = gridColumnGap300
public static let gridColumnGap10: GridRawToken = DimensionRawTokens.dimensionBase * 0.25 // 1
public static let gridColumnGap100: GridRawToken = DimensionRawTokens.dimensionBase * 2 // 8
public static let gridColumnGap200: GridRawToken = DimensionRawTokens.dimensionBase * 4 // 16
public static let gridColumnGap300: GridRawToken = DimensionRawTokens.dimensionBase * 5 // 20
public static let gridColumnGap400: GridRawToken = DimensionRawTokens.dimensionBase * 6 // 24
public static let gridColumnGap600: GridRawToken = DimensionRawTokens.dimensionBase * 8 // 32
public static let gridColumnGap800: GridRawToken = DimensionRawTokens.dimensionBase * 10 // 40
public static let gridMargin100: GridRawToken = DimensionRawTokens.dimensionBase * 4 // 16
public static let gridMargin300: GridRawToken = DimensionRawTokens.dimensionBase * 6 // 24
public static let gridMargin400: GridRawToken = DimensionRawTokens.dimensionBase * 7 // 28
public static let gridMargin500: GridRawToken = DimensionRawTokens.dimensionBase * 8 // 32
public static let gridMargin600: GridRawToken = DimensionRawTokens.dimensionBase * 9 // 36
public static let gridMargin700: GridRawToken = DimensionRawTokens.dimensionBase * 10 // 40
public static let gridMargin1000: GridRawToken = DimensionRawTokens.dimensionBase * 13 // 52
public static let gridMargin1100: GridRawToken = DimensionRawTokens.dimensionBase * 14 // 56
public static let gridMargin1700: GridRawToken = DimensionRawTokens.dimensionBase * 20 // 80
public static let gridMargin2500: GridRawToken = DimensionRawTokens.dimensionBase * 28 // 112
public static let gridMaxWidthCompact: GridRawToken = 852
public static let gridMaxWidthExtraCompact: GridRawToken = 389
public static let gridMaxWidthRegular: GridRawToken = 1336
public static let gridMinWidthCompact: GridRawToken = 390
public static let gridMinWidthExtraCompact: GridRawToken = 320
public static let gridMinWidthRegular: GridRawToken = 736
}

// swiftlint:enable missing_docs
// swiftlint:enable number_separator
68 changes: 38 additions & 30 deletions OUDS/Core/Tokens/RawTokens/Tests/GridRawTokensTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -58,79 +58,75 @@ final class GridRawTokensTests: XCTestCase {
}

func testGridRawTokenMargin100MultipleOfBase() throws {
XCTAssertMultipleOf(GridRawTokens.gridMargin100, factor: GridRawTokens.dimensionBase)
XCTAssertMultipleOf(GridRawTokens.gridMargin100, factor: DimensionRawTokens.dimensionBase)
}

func testGridRawTokenGridMargin300LessThanGridMargin400() throws {
XCTAssertLessThan(GridRawTokens.gridMargin300, GridRawTokens.gridMargin400)
}

func testGridRawTokenMargin300MultipleOfBase() throws {
XCTAssertMultipleOf(GridRawTokens.gridMargin300, factor: GridRawTokens.dimensionBase)
XCTAssertMultipleOf(GridRawTokens.gridMargin300, factor: DimensionRawTokens.dimensionBase)
}

func testGridRawTokenGridMargin400LessThanGridMargin500() throws {
XCTAssertLessThan(GridRawTokens.gridMargin400, GridRawTokens.gridMargin500)
}

func testGridRawTokenMargin400MultipleOfBase() throws {
XCTAssertMultipleOf(GridRawTokens.gridMargin400, factor: GridRawTokens.dimensionBase)
XCTAssertMultipleOf(GridRawTokens.gridMargin400, factor: DimensionRawTokens.dimensionBase)
}

func testGridRawTokenGridMargin500LessThanGridMargin600() throws {
XCTAssertLessThan(GridRawTokens.gridMargin500, GridRawTokens.gridMargin600)
}

func testGridRawTokenMargin500MultipleOfBase() throws {
XCTAssertMultipleOf(GridRawTokens.gridMargin500, factor: GridRawTokens.dimensionBase)
XCTAssertMultipleOf(GridRawTokens.gridMargin500, factor: DimensionRawTokens.dimensionBase)
}

func testGridRawTokenGridMargin600LessThanGridMargin700() throws {
XCTAssertLessThan(GridRawTokens.gridMargin600, GridRawTokens.gridMargin700)
}

func testGridRawTokenMargin600MultipleOfBase() throws {
XCTAssertMultipleOf(GridRawTokens.gridMargin600, factor: GridRawTokens.dimensionBase)
XCTAssertMultipleOf(GridRawTokens.gridMargin600, factor: DimensionRawTokens.dimensionBase)
}

func testGridRawTokenGridMargin700LessThanGridMargin900() throws {
XCTAssertLessThan(GridRawTokens.gridMargin700, GridRawTokens.gridMargin900)
func testGridRawTokenGridMargin700LessThanGridMargin1000() throws {
XCTAssertLessThan(GridRawTokens.gridMargin700, GridRawTokens.gridMargin1000)
}

func testGridRawTokenMargin700MultipleOfBase() throws {
XCTAssertMultipleOf(GridRawTokens.gridMargin700, factor: GridRawTokens.dimensionBase)
}

func testGridRawTokenGridMargin900LessThanGridMargin1000() throws {
XCTAssertLessThan(GridRawTokens.gridMargin900, GridRawTokens.gridMargin1000)
}

func testGridRawTokenMargin900MultipleOfBase() throws {
XCTAssertMultipleOf(GridRawTokens.gridMargin900, factor: GridRawTokens.dimensionBase)
XCTAssertMultipleOf(GridRawTokens.gridMargin700, factor: DimensionRawTokens.dimensionBase)
}

func testGridRawTokenGridMargin1000LessThanGridMargin1100() throws {
XCTAssertLessThan(GridRawTokens.gridMargin1000, GridRawTokens.gridMargin1100)
}

func testGridRawTokenMargin1000MultipleOfBase() throws {
XCTAssertMultipleOf(GridRawTokens.gridMargin1000, factor: GridRawTokens.dimensionBase)
XCTAssertMultipleOf(GridRawTokens.gridMargin1000, factor: DimensionRawTokens.dimensionBase)
}

func testGridRawTokenGridMargin1100LessThanGridMargin1700() throws {
XCTAssertLessThan(GridRawTokens.gridMargin1100, GridRawTokens.gridMargin1700)
}

func testGridRawTokenMargin1700MultipleOfBase() throws {
XCTAssertMultipleOf(GridRawTokens.gridMargin1700, factor: GridRawTokens.dimensionBase)
func testGridRawTokenMargin1100MultipleOfBase() throws {
XCTAssertMultipleOf(GridRawTokens.gridMargin1000, factor: DimensionRawTokens.dimensionBase)
}

func testGridRawTokenGridMargin1700LessThanGridMargin2500() throws {
XCTAssertLessThan(GridRawTokens.gridMargin1700, GridRawTokens.gridMargin2500)
}

func testGridRawTokenMargin1700MultipleOfBase() throws {
XCTAssertMultipleOf(GridRawTokens.gridMargin1700, factor: DimensionRawTokens.dimensionBase)
}

func testGridRawTokenMargin2500MultipleOfBase() throws {
XCTAssertMultipleOf(GridRawTokens.gridMargin2500, factor: GridRawTokens.dimensionBase)
XCTAssertMultipleOf(GridRawTokens.gridMargin2500, factor: DimensionRawTokens.dimensionBase)
}

// MARK: - Primitive token - Grid - Column gap
Expand All @@ -140,39 +136,51 @@ final class GridRawTokensTests: XCTestCase {
}

func testGridRawTokenColumnGap10MultipleOfBase() throws {
XCTAssertMultipleOf(GridRawTokens.gridColumnGap10, factor: GridRawTokens.dimensionBase)
XCTAssertMultipleOf(GridRawTokens.gridColumnGap10, factor: DimensionRawTokens.dimensionBase)
}

func testGridRawTokenGridColumnGap100LessThanGridColumnGap200() throws {
XCTAssertLessThan(GridRawTokens.gridColumnGap100, GridRawTokens.gridColumnGap200)
}

func testGridRawTokenColumnGap100MultipleOfBase() throws {
XCTAssertMultipleOf(GridRawTokens.gridColumnGap100, factor: GridRawTokens.dimensionBase)
XCTAssertMultipleOf(GridRawTokens.gridColumnGap100, factor: DimensionRawTokens.dimensionBase)
}

func testGridRawTokenGridColumnGap200LessThanGridColumnGap300() throws {
XCTAssertLessThan(GridRawTokens.gridColumnGap200, GridRawTokens.gridColumnGap300)
}

func testGridRawTokenColumnGap200MultipleOfBase() throws {
XCTAssertMultipleOf(GridRawTokens.gridColumnGap200, factor: GridRawTokens.dimensionBase)
XCTAssertMultipleOf(GridRawTokens.gridColumnGap200, factor: DimensionRawTokens.dimensionBase)
}

func testGridRawTokenGridColumnGap300LessThanGridColumnGap500() throws {
XCTAssertLessThan(GridRawTokens.gridColumnGap300, GridRawTokens.gridColumnGap600)
func testGridRawTokenGridColumnGap300LessThanGridColumnGap400() throws {
XCTAssertLessThan(GridRawTokens.gridColumnGap300, GridRawTokens.gridColumnGap400)
}

func testGridRawTokenColumnGap300MultipleOfBase() throws {
XCTAssertMultipleOf(GridRawTokens.gridColumnGap300, factor: GridRawTokens.dimensionBase)
XCTAssertMultipleOf(GridRawTokens.gridColumnGap300, factor: DimensionRawTokens.dimensionBase)
}

func testGridRawTokenGridColumnGap400LessThanGridColumnGap600() throws {
XCTAssertLessThan(GridRawTokens.gridColumnGap400, GridRawTokens.gridColumnGap600)
}

func testGridRawTokenColumnGap400MultipleOfBase() throws {
XCTAssertMultipleOf(GridRawTokens.gridColumnGap400, factor: DimensionRawTokens.dimensionBase)
}

func testGridRawTokenGridColumnGap600LessThanGridColumnGap800() throws {
XCTAssertLessThan(GridRawTokens.gridColumnGap600, GridRawTokens.gridColumnGap800)
}

func testGridRawTokenGridColumnGap600LessThanGridColumnGap700() throws {
XCTAssertLessThan(GridRawTokens.gridColumnGap600, GridRawTokens.gridColumnGap700)
func testGridRawTokenColumnGap600MultipleOfBase() throws {
XCTAssertMultipleOf(GridRawTokens.gridColumnGap600, factor: DimensionRawTokens.dimensionBase)
}

func testGridRawTokenColumnGap700MultipleOfBase() throws {
XCTAssertMultipleOf(GridRawTokens.gridColumnGap700, factor: GridRawTokens.dimensionBase)
func testGridRawTokenColumnGap800MultipleOfBase() throws {
XCTAssertMultipleOf(GridRawTokens.gridColumnGap800, factor: DimensionRawTokens.dimensionBase)
}

// MARK: - Primitive token - Grid - Column count
Expand Down
Loading