Skip to content

Commit

Permalink
style: line breaks and comments for doc (#279)
Browse files Browse the repository at this point in the history
Signed-off-by: Pierre-Yves Lapersonne <pierreyves.lapersonne@orange.com>
  • Loading branch information
pylapp committed Nov 21, 2024
1 parent 0518159 commit b204754
Show file tree
Hide file tree
Showing 32 changed files with 68 additions and 66 deletions.
2 changes: 1 addition & 1 deletion OUDS/Core/Themes/Inverse/Sources/InverseTheme.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

import OUDSThemesOrange

/// This is an override of the default basic ``OrangeTheme`` with some inverted colors.
/// This is an override of the default basic `OrangeTheme` with some inverted colors.
/// It can overrides any properties from its superclass, and can be derived too.
open class InverseTheme: OrangeTheme, @unchecked Sendable {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
/// Defined as the group of all **raw tokens** related to **colors**.
/// Values are defined in *ColorRawTokens+Values.swift* file and generated by the tokenator.
/// ``ColorRawTokens`` are tokens to use to define *colors* of components thants to ``ColorRawToken`` type. Some of these colors are "raw", and others have transparancy effects.
/// This enum contains also the shared colors, i.e. colors exposed to any theme. Some colors related to the Orange brand are defined elswhere in ``OrangeBrandColorRawTokens``.
/// This enum contains also the shared colors, i.e. colors exposed to any theme. Some colors related to the Orange brand are defined elswhere in `OrangeBrandColorRawTokens`.
///
/// Primitive types such as ``String` must be used to as to allow to use `@objc` keywords in extensions for overriding.
/// Such tokens are packed in a _Swift enum_ so as to gather them in one object with the suitable namespace and avoid to have just constants in nothing else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
/// Values are defined in *DimensionRawTokens+Values.swift* file and generated by the tokenator.
/// ``DimensionRawTokens`` are tokens to use to define *dimensions* , i.e. kind of values to use for sizes or spaces thanks to ``DimensionRawToken``.
///
/// Primitive types such as ``Double`` must be used to as to allow to use `@objc` keywords in extensions for overriding.
/// Primitive types such as `Double` must be used to as to allow to use `@objc` keywords in extensions for overriding.
/// Such tokens are packed in a _Swift enum_ so as to gather them in one object with the suitable namespace and avoid to have just constants in nothing else
/// (i.e. publicly accessible from everywhere). More optimized than _struct_.
public enum DimensionRawTokens {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
/// These tokens are used to define these effects thanks to several types: the *blur*, the *X offset* and the *Y offset*, all of them being ``ElevationRawToken`` type.
/// Combinations of these three values can be defined inside ``ElevationCompositeRawToken`` i.e. *composite tokens* defining a whil box shadow to use for elevation effect.
///
/// Primitive types such as ``CGFloat`` must be used to as to allow to use `@objc` keywords in extensions for overriding.
/// Primitive types such as `CGFloat` must be used to as to allow to use `@objc` keywords in extensions for overriding.
/// Such tokens are packed in a _Swift enum_ so as to gather them in one object with the suitable namespace and avoid to have just constants in nothing else
/// (i.e. publicly accessible from everywhere). More optimized than _struct_.
public enum ElevationRawTokens {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
/// Values are defined in *GridRawTokens+Values.swift* file updated by the tokenator.
/// ``GridRawTokens`` are tokens to use to define *grids* using ``GridRawToken` type.
///
/// Primitive types such as ``Int`` must be used to as to allow to use `@objc` keywords in extensions for overriding.
/// Primitive types such as `Int must be used to as to allow to use `@objc` keywords in extensions for overriding.
/// Such tokens are packed in a _Swift enum_ so as to gather them in one object with the suitable namespace and avoid to have just constants in nothing else
/// (i.e. publicly accessible from everywhere). More optimized than _struct_.
public enum GridRawTokens {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
/// Values are defined in *OpacityRawTokens+Values.swift* file and generated by the tokenator.
/// ``OpacityRawTokens`` are tokens to use to define *opacity* effects thanks to ``OpacityRawToken``.
///
/// Primitive types such as ``Double`` must be used to as to allow to use `@objc` keywords in extensions for overriding.
/// Primitive types such as `Double` must be used to as to allow to use `@objc` keywords in extensions for overriding.
/// Such tokens are packed in a _Swift enum_ so as to gather them in one object with the suitable namespace and avoid to have just constants in nothing else
/// (i.e. publicly accessible from everywhere). More optimized than _struct_.
public enum OpacityRawTokens {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
/// - and the *font letter spacing* (``TypographyFontLetterSpacingRawToken``).
/// Combinations of these raw tokens can be made inside ``TypographyCompositeRawToken``, which are composite tokens defining in the end a specific typography to apply.
///
/// Primitive types such as ``Int` and ``String``must be used to as to allow to use `@objc` keywords in extensions for overriding.
/// Primitive types such as `Int` and `String` must be used to as to allow to use `@objc` keywords in extensions for overriding.
/// Such tokens are packed in a _Swift enum_ so as to gather them in one object with the suitable namespace and avoid to have just constants in nothing else
/// (i.e. publicly accessible from everywhere). More optimized than _struct_.
public enum TypographyRawTokens {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@
// Software description: A SwiftUI components library with code examples for Orange Unified Design System
//

/// Type alias precising ``Double`` value are used (because of multiplier factors) for a **border width raw token**, to keep grammar clean and clear with design system grammar.
/// Type alias precising `Double` value are used (because of multiplier factors) for a **border width raw token**, to keep grammar clean and clear with design system grammar.
public typealias BorderWidthRawToken = Double

/// Type alias precising ``Double`` value are used (because of multiplier factors) for a **border radius raw token**, to keep grammar clean and clear with design system grammar.
/// Type alias precising `Double` value are used (because of multiplier factors) for a **border radius raw token**, to keep grammar clean and clear with design system grammar.
public typealias BorderRadiusRawToken = Double

/// Type alias for ``String`` so as to help users (developers) to see that raw tokens are needed and linked to ``String` for **border style raw token**.
/// ``String`` are used here to prevent to rely on _SwiftUI_ types which are not compatible with `@objc` and are heavier than primitive types.
/// Type alias for `String` so as to help users (developers) to see that raw tokens are needed and linked to `String` for **border style raw token**.
/// `String` are used here to prevent to rely on _SwiftUI_ types which are not compatible with `@objc` and are heavier than primitive types.
/// In addition, if new styles are defined in design team side (such as kind of composite styles) and need to be processed differently
/// (because not available with _SwiftUI_ because are composed of several styles),
/// such ``String`` values could be processed later without any API breaks.
/// such `String` values could be processed later without any API breaks.
/// Keeps grammar clean and clear with design system grammar.
public typealias BorderStyleRawToken = String
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@

import Foundation

/// In the global design system tool, *font family* raw tokens are basically ``String`` values, to keep grammar clean and clear with design system grammar.
/// In the global design system tool, *font family* raw tokens are basically `String` values, to keep grammar clean and clear with design system grammar.
public typealias TypographyFontFamilyRawToken = String

/// In the global design system tool, *font weight* raw tokens are basically ``Int`` values, to keep grammar clean and clear with design system grammar.
/// In the global design system tool, *font weight* raw tokens are basically `Int` values, to keep grammar clean and clear with design system grammar.
public typealias TypographyFontWeightRawToken = Int

/// In the global design system tool, *font size* raw tokens are basically ``CGFloat`` values, to keep grammar clean and clear with design system grammar.
/// In the global design system tool, *font size* raw tokens are basically `CGFloat` values, to keep grammar clean and clear with design system grammar.
public typealias TypographyFontSizeRawToken = CGFloat

/// In the global design system tool, *font line height* raw tokens are basically ``CGFloat`` values, to keep grammar clean and clear with design system grammar.
/// In the global design system tool, *font line height* raw tokens are basically `CGFloat` values, to keep grammar clean and clear with design system grammar.
public typealias TypographyFontLineHeightRawToken = CGFloat

/// In the global design system tool, *font letter spacing* raw tokens are basically ``CGFloat` values, to keep grammar clean and clear with design system grammar.
/// In the global design system tool, *font letter spacing* raw tokens are basically `CGFloat` values, to keep grammar clean and clear with design system grammar.
public typealias TypographyFontLetterSpacingRawToken = CGFloat
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import OUDSFoundations
import OUDSTokensRaw
import SwiftUI

/// Semantic tokens which will wrap a combination of ``ElevationCompositeRawToken`` depending to color scheme (i.e. light mode or dark mode)
/// Semantic tokens which will wrap a combination of `ElevationCompositeRawToken` depending to color scheme (i.e. light mode or dark mode)
/// Kind of composite token with multiple values, but not named "composite" because this word is already used in the design system.
/// Allows to gather the multiple-value tokens from *Figma* inside one object.
/// If an elevation token exists with its value depending to the color scheme, it must be packed in such ``MultipleElevationTokens`
Expand All @@ -30,10 +30,14 @@ import SwiftUI
/// // inside ElevationCompositeSemanticTokens protocol,
/// // and defined inside OUDSTheme+ElevationCompositeSemanticTokens extension
/// // ElevationCompositeSemanticToken is a typealias for MultipleElevationTokens to keep same grammar as dsign kit
/// var elevationNone: ElevationCompositeSemanticToken { ElevationCompositeSemanticToken(light: elevationBottom_0, dark: elevationBottom_1_100) }
/// var elevationNone: ElevationCompositeSemanticToken {
/// ElevationCompositeSemanticToken(light: elevationBottom_0, dark: elevationBottom_1_100)
/// }
///
/// // If the same color is used whatever the color scheme is
/// var elevationNone: ElevationCompositeSemanticToken { ElevationCompositeSemanticToken(elevationBottom_0) }
/// // If the same elevation is used whatever the color scheme is
/// var elevationNone: ElevationCompositeSemanticToken {
/// ElevationCompositeSemanticToken(elevationBottom_0)
/// }
///
/// // The theme exposes both generated elevation semantic tokens and "crafted" higher level elevation semantic tokens.
/// // It is recommended to use the higher level version as it is less error-prone.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import OUDSTokensRaw

/// Kind of semantic tokens which will wrap a combination of ``TypographyFontSizeSemanticToken`` depending to size classes.
/// Allows to gather the multiple-value tokens from Figma inside one object.
/// If a font size exists with its value depending to the size class, it must be packed in such ``MultipleFontSizeTokens``
/// If a font size exists with its value depending to the size class, it must be packed in such ``MultipleFontSizeTokens``.
///
/// ```swift
/// // Assuming in Figma with have a font size semantic token fontSizeBodySmall,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import SwiftUICore
/// Kind of semantic tokens which will wrap a combination of ``SizeSemanticToken`` depending to viewports / size classes.
/// Kind of composite token with multiple values, but not named "composite" because this word is already used in the design system.
/// Allows to gather the multiple-value tokens from Figma inside one object.
/// If a size token exists with its value depending to the size class, it must be packed in such ``MultipleSizeTokens`
/// If a size token exists with its value depending to the size class, it must be packed in such ``MultipleSizeTokens``.
///
/// ```swift
/// // Assuming in Figma with have a size semantic token sizeIconWithHeadingXLargeTall,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ import Foundation
import OUDSTokensRaw
import SwiftUICore

/// Kind of semantic tokens which will wrap a combination of ``DimensionRawToken`` depending to size classes.
/// Kind of semantic tokens which will wrap a combination of `DimensionRawToken` depending to size classes.
/// Kind of composite token with multiple values, but not named "composite" because this word is already used in the design system.
/// Allows to gather the multiple-value tokens from Figma inside one object.
/// If a space token exists with its value depending to the size class, it must be packed in such ``MultipleSpaceTokens``
/// If a space token exists with its value depending to the size class, it must be packed in such ``MultipleSpaceTokens``.
///
/// ```swift
/// // Assuming in Figma with have a space semantic token spaceScaledShortest,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
import OUDSTokensRaw
import SwiftUICore

/// Kind of semantic tokens which will wrap a combination of ``TypographyCompositeRawToken`` depending to size classes.
/// Kind of semantic tokens which will wrap a combination of `TypographyCompositeRawToken` depending to size classes.
/// Kind of composite token with multiple values, but not named "composite" because this word is already used in the design system.
/// Allows to gather the multiple-value tokens from *Figma* inside one object.
/// If a typography token exists with its value depending to the size class, it must be packed in such ``MultipleTypographyTokens``
/// If a typography token exists with its value depending to the size class, it must be packed in such ``MultipleTypographyTokens``.
///
/// ```swift
/// // Assuming in Figma with have a typography semantic token typeDisplayLarge,
Expand All @@ -37,7 +37,7 @@ import SwiftUICore
/// // It is recommended to use the higher level version as it is less error-prone.
/// ```
///
/// The case of this ``MultipleTypographyTokens`` is quite particular because in fact it contains ``TypographyCompositeRawToken`` (i.e. raw tokens) instead of semantic tokens.
/// The case of this ``MultipleTypographyTokens`` is quite particular because in fact it contains `TypographyCompositeRawToken` (i.e. raw tokens) instead of semantic tokens.
/// In fact there is not "typography composite semantic tokens" defined in the *Figma* kit.
///
public final class MultipleTypographyTokens: NSObject, Sendable {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@

import OUDSTokensRaw

/// Type alias precising ``BorderWidthRawToken`` is used as a value of this **border width semantic token**, to keep grammar clean and clear with design system grammar.
/// Type alias precising `BorderWidthRawToken` is used as a value of this **border width semantic token**, to keep grammar clean and clear with design system grammar.
public typealias BorderWidthSemanticToken = BorderWidthRawToken

/// Type alias precising ``BorderRadiusRawToken`` is used as a value of this **border raw semantic token**, to keep grammar clean and clear with design system grammar.
/// Type alias precising `BorderRadiusRawToken` is used as a value of this **border raw semantic token**, to keep grammar clean and clear with design system grammar.
public typealias BorderRadiusSemanticToken = BorderRadiusRawToken

/// Type alias precising ``BorderStyleRawToken` is used as a value of this **border style semantic token**, to keep grammar clean and clear with design system grammar.
/// Type alias precising `BorderStyleRawToken` is used as a value of this **border style semantic token**, to keep grammar clean and clear with design system grammar.
public typealias BorderStyleSemanticToken = BorderStyleRawToken
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ public typealias ElevationBlurSemanticToken = ElevationRawToken
public typealias ElevationColorSemanticToken = ColorSemanticToken

/// Basically an elevationcomposite semantic token, used mainly for box shadow, is a pair of elevation composite raw tokens used depending to the color scheme.
/// A ``MultipleElevationTokens`` contains ``ElevationCompositeRawToken`` objects for light and dark modes, which contains ``ElevationRawToken`` and ``ColorRawToken` values.
/// A ``MultipleElevationTokens`` contains `ElevationCompositeRawToken` objects for light and dark modes, which contains `ElevationRawToken` and `ColorRawToken` values.
public typealias ElevationCompositeSemanticToken = MultipleElevationTokens
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
// swiftlint:disable missing_docs

/// This is a group of semantic tokens for **borders**.
/// It defines all ``BorderWidthSemanticToken``, ``BorderRadiusSemanticToken`` and ``BorderStyleSemanticToken` a theme must have.
/// It defines all ``BorderWidthSemanticToken``, ``BorderRadiusSemanticToken`` and ``BorderStyleSemanticToken`` a theme must have.
///
/// In the future this file should be generated by a parser converting Figma JSON to Swift code.
/// In the future this file should be generated by a the tokenator.
public protocol BorderSemanticTokens {

// MARK: - Semantic token - Border - Width
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
/// This is a group of semantic tokens for **colors** but using ``MultipleColorTokens``.
///
/// In fact the ``MultipleColorTokens`` class will help users (i.e. developers) to handle one semantic token for color containing values for light and dark modes.
/// Because *Figma* is not able to manage pair of values for one token, and its produced JSON does not reflect this mecanism, the *tokenator* cannot provide such ``MultipleColorTokens``. Thus the "real" color semantic tokens are declared in ``ColorSemanticTokens`` protocol and defined inside ``OUDSTheme`` (to be overridable then by subthemes). These tokens are updated by the *tokenator*. Then they are gathered and wrapped so as to be used easily thanks to this ``ColorMultipleSemanticTokens` which must be updated manually.
/// Because *Figma* is not able to manage pair of values for one token, and its produced JSON does not reflect this mecanism, the *tokenator* cannot provide such ``MultipleColorTokens``. Thus the "real" color semantic tokens are declared in ``ColorSemanticTokens`` protocol and defined inside `OUDSTheme` (to be overridable then by subthemes). These tokens are updated by the *tokenator*. Then they are gathered and wrapped so as to be used easily thanks to this ``ColorMultipleSemanticTokens`` which must be updated manually.
///
/// In few words:
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@

/// This is a group of semantic tokens for **colors**.
/// It defines all ``ColorSemanticToken`` a theme must have.
/// These tokens are then gathered inside ``MultipleColorTokens`` defined in ``ColorMultipleSemanticTokens`
/// These tokens are then gathered inside ``MultipleColorTokens`` defined in ``ColorMultipleSemanticTokens``.
///
/// In the future this file should be generated by a parser converting Figma JSON to Swift code.
/// In the future this file should be generated by a the tokenator.
public protocol ColorSemanticTokens {

// MARK: - Light values
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
// swiftlint:disable missing_docs

/// This is a group of semantic tokens for **dimensions**.
/// It defines all ``DimensionSemanticToken` a theme must have.
/// It defines all ``DimensionSemanticToken`` a theme must have.
///
/// In the future this file should be generated by a parser converting Figma JSON to Swift code.
/// In the future this file should be generated by a the tokenator.
public protocol DimensionSemanticTokens {

var dimensionNone: DimensionSemanticToken { get }
Expand Down
Loading

0 comments on commit b204754

Please sign in to comment.