-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: use of multiple type for sizing semantic tokens (#279)
Signed-off-by: Pierre-Yves Lapersonne <[email protected]>
- Loading branch information
Showing
18 changed files
with
935 additions
and
172 deletions.
There are no files selected for viewing
74 changes: 74 additions & 0 deletions
74
...UDS/Sources/OUDSTheme/OUDSTheme+SemanticTokens/OUDSTheme+SizeMultipleSemanticTokens.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,74 @@ | ||
// | ||
// 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 line_length | ||
|
||
// [File not generated by the tokenator] | ||
// WARNING: Not synchronized 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 | ||
|
||
/// Defines wrapper objects for size semantic tokens (i.e. in the end `DimensionRawToken`). | ||
/// These values can be overriden inside `OUDSTheme` subclasses (in extensions or not, in the same module or not) thanks to the `@objc open` combination. | ||
extension OUDSTheme: SizeMultipleSemanticTokens { | ||
|
||
// MARK: - Semantic token - Sizing - Icon with typography | ||
|
||
@objc open var sizeIconWithHeadingXLargeShort: MultipleSizeTokens { MultipleSizeTokens(compact: sizeIconWithHeadingXLargeShortMobile, regular: sizeIconWithHeadingXLargeShortTablet) } | ||
@objc open var sizeIconWithHeadingXLargeMedium: MultipleSizeTokens { MultipleSizeTokens(compact: sizeIconWithHeadingXLargeMediumMobile, regular: sizeIconWithHeadingXLargeMediumTablet) } | ||
@objc open var sizeIconWithHeadingXLargeTall: MultipleSizeTokens { MultipleSizeTokens(compact: sizeIconWithHeadingXLargeTallMobile, regular: sizeIconWithHeadingXLargeTallTablet) } | ||
|
||
@objc open var sizeIconWithHeadingLargeShort: MultipleSizeTokens { MultipleSizeTokens(compact: sizeIconWithHeadingLargeShortMobile, regular: sizeIconWithHeadingLargeShortTablet) } | ||
@objc open var sizeIconWithHeadingLargeMedium: MultipleSizeTokens { MultipleSizeTokens(compact: sizeIconWithHeadingLargeMediumMobile, regular: sizeIconWithHeadingLargeMediumTablet) } | ||
@objc open var sizeIconWithHeadingLargeTall: MultipleSizeTokens { MultipleSizeTokens(compact: sizeIconWithHeadingLargeTallMobile, regular: sizeIconWithHeadingLargeTallTablet) } | ||
|
||
@objc open var sizeIconWithHeadingMediumShort: MultipleSizeTokens { MultipleSizeTokens(compact: sizeIconWithHeadingMediumShortMobile, regular: sizeIconWithHeadingMediumShortTablet) } | ||
@objc open var sizeIconWithHeadingMediumMedium: MultipleSizeTokens { MultipleSizeTokens(compact: sizeIconWithHeadingMediumMediumMobile, regular: sizeIconWithHeadingMediumMediumTablet) } | ||
@objc open var sizeIconWithHeadingMediumTall: MultipleSizeTokens { MultipleSizeTokens(compact: sizeIconWithHeadingMediumTallMobile, regular: sizeIconWithHeadingMediumTallTablet) } | ||
|
||
@objc open var sizeIconWithHeadingSmallShort: MultipleSizeTokens { MultipleSizeTokens(compact: sizeIconWithHeadingSmallShortMobile, regular: sizeIconWithHeadingSmallShortTablet) } | ||
@objc open var sizeIconWithHeadingSmallMedium: MultipleSizeTokens { MultipleSizeTokens(compact: sizeIconWithHeadingSmallMediumMobile, regular: sizeIconWithHeadingSmallMediumTablet) } | ||
@objc open var sizeIconWithHeadingSmallTall: MultipleSizeTokens { MultipleSizeTokens(compact: sizeIconWithHeadingSmallTallMobile, regular: sizeIconWithHeadingSmallTallTablet) } | ||
|
||
@objc open var sizeIconWithBodyLargeShort: MultipleSizeTokens { MultipleSizeTokens(compact: sizeIconWithBodyLargeShortMobile, regular: sizeIconWithBodyLargeShortTablet) } | ||
@objc open var sizeIconWithBodyLargeMedium: MultipleSizeTokens { MultipleSizeTokens(compact: sizeIconWithBodyLargeMediumMobile, regular: sizeIconWithBodyLargeMediumTablet) } | ||
@objc open var sizeIconWithBodyLargeTall: MultipleSizeTokens { MultipleSizeTokens(compact: sizeIconWithBodyLargeTallMobile, regular: sizeIconWithBodyLargeTallTablet) } | ||
|
||
@objc open var sizeIconWithBodyMediumShort: MultipleSizeTokens { MultipleSizeTokens(compact: sizeIconWithBodyMediumShortMobile, regular: sizeIconWithBodyMediumShortTablet) } | ||
@objc open var sizeIconWithBodyMediumMedium: MultipleSizeTokens { MultipleSizeTokens(compact: sizeIconWithBodyMediumMediumMobile, regular: sizeIconWithBodyMediumMediumTablet) } | ||
@objc open var sizeIconWithBodyMediumTall: MultipleSizeTokens { MultipleSizeTokens(compact: sizeIconWithBodyMediumTallMobile, regular: sizeIconWithBodyMediumTallTablet) } | ||
|
||
@objc open var sizeIconWithBodySmallShort: MultipleSizeTokens { MultipleSizeTokens(compact: sizeIconWithBodySmallShortMobile, regular: sizeIconWithBodySmallShortTablet) } | ||
@objc open var sizeIconWithBodySmallMedium: MultipleSizeTokens { MultipleSizeTokens(compact: sizeIconWithBodySmallMediumMobile, regular: sizeIconWithBodySmallMediumTablet) } | ||
@objc open var sizeIconWithBodySmallTall: MultipleSizeTokens { MultipleSizeTokens(compact: sizeIconWithBodySmallTallMobile, regular: sizeIconWithBodySmallTallTablet) } | ||
|
||
// MARK: - Semantic token - Sizing - Max width typography | ||
|
||
@objc open var sizeMaxWidthTypeDisplayLarge: MultipleSizeTokens { MultipleSizeTokens(compact: sizeMaxWidthTypeDisplayLargeMobile, regular: sizeMaxWidthTypeDisplayLargeTablet) } | ||
@objc open var sizeMaxWidthTypeDisplayMedium: MultipleSizeTokens { MultipleSizeTokens(compact: sizeMaxWidthTypeDisplayMediumMobile, regular: sizeMaxWidthTypeDisplayMediumTablet) } | ||
@objc open var sizeMaxWidthTypeDisplaySmall: MultipleSizeTokens { MultipleSizeTokens(compact: sizeMaxWidthTypeDisplaySmallMobile, regular: sizeMaxWidthTypeDisplaySmallTablet) } | ||
|
||
@objc open var sizeMaxWidthTypeHeadingXLarge: MultipleSizeTokens { MultipleSizeTokens(compact: sizeMaxWidthTypeHeadingXLargeMobile, regular: sizeMaxWidthTypeHeadingXLargeTablet) } | ||
@objc open var sizeMaxWidthTypeHeadingLarge: MultipleSizeTokens { MultipleSizeTokens(compact: sizeMaxWidthTypeHeadingLargeMobile, regular: sizeMaxWidthTypeHeadingLargeTablet) } | ||
@objc open var sizeMaxWidthTypeHeadingMedium: MultipleSizeTokens { MultipleSizeTokens(compact: sizeMaxWidthTypeHeadingMediumMobile, regular: sizeMaxWidthTypeHeadingMediumTablet) } | ||
@objc open var sizeMaxWidthTypeHeadingSmall: MultipleSizeTokens { MultipleSizeTokens(compact: sizeMaxWidthTypeHeadingSmallMobile, regular: sizeMaxWidthTypeHeadingSmallTablet) } | ||
|
||
@objc open var sizeMaxWidthTypeBodyLarge: MultipleSizeTokens { MultipleSizeTokens(compact: sizeMaxWidthTypeBodyLargeMobile, regular: sizeMaxWidthTypeBodyLargeTablet) } | ||
@objc open var sizeMaxWidthTypeBodyMedium: MultipleSizeTokens { MultipleSizeTokens(compact: sizeMaxWidthTypeBodyMediumMobile, regular: sizeMaxWidthTypeBodyMediumTablet) } | ||
@objc open var sizeMaxWidthTypeBodySmall: MultipleSizeTokens { MultipleSizeTokens(compact: sizeMaxWidthTypeBodySmallMobile, regular: sizeMaxWidthTypeBodySmallTablet) } | ||
} | ||
|
||
// swiftlint:enable line_length |
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
Oops, something went wrong.