Skip to content

Commit

Permalink
docs: add API version details (#374)
Browse files Browse the repository at this point in the history
Signed-off-by: Pierre-Yves Lapersonne <[email protected]>
  • Loading branch information
pylapp committed Jan 6, 2025
1 parent 16cb92a commit cb44fcb
Show file tree
Hide file tree
Showing 42 changed files with 93 additions and 12 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

- [Library] Add details about API versions in documentation ([#374](https://github.com/Orange-OpenSource/ouds-ios/issues/374))
- [DemoApp] Update show code text ([#361](https://github.com/Orange-OpenSource/ouds-ios/issues/361))

## [0.8.0](https://github.com/Orange-OpenSource/ouds-ios/compare/0.7.0...0.8.0) - 2024-12-18
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ struct RequestAccessibleFocusModifier: ViewModifier {
/// .oudsRequestAccessibleFocus(_requestFocus, for: .some(id: elements[0].id))
/// }
/// ```
///
/// - Since: 0.9.0
public enum AccessibilityFocusable: Hashable {
case none
case some(id: String)
Expand Down
2 changes: 2 additions & 0 deletions OUDS/Core/OUDS/Sources/OUDSTheme/OUDSTheme.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ import OUDSTokensSemantic
/// Because `OUDSTheme` is not a *final* class, its type cannot be seen as `Sendable`, that is the reason why this conformity is unchecked.
///
/// **Warning: You are not supposed to use this abstract default theme directly. Please prefer `OrangeTheme` instead**
///
/// - Since: 0.9.0
open class OUDSTheme: @unchecked Sendable {

// MARK: - Properties
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ extension EnvironmentValues {
/// YourRootView()
/// }
///
/// - Since: 0.9.0
public struct OUDSThemeableView<Content>: View where Content: View {

private let theme: OUDSTheme
Expand Down
2 changes: 2 additions & 0 deletions OUDS/Core/OUDS/Sources/OUDSUserInterfaceSizeClass.swift
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ extension EnvironmentValues {
/// @Environment(\.oudsHorizontalSizeClass) var horizontalSizeClass
/// @Environment(\.oudsVerticalSizeClass) var verticalSizeClass
/// ```
///
/// - Since: 0.9.0
public enum OUDSUserInterfaceSizeClass: String, Sendable {
case extraCompact = "Extra Compact"
case compact = "Compact"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
/// This enum helps to add new **color raw tokens** exclusive to this ``OrangeTheme``.
/// 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_.
///
/// - Since: 0.9.0
public enum OrangeBrandColorRawTokens {

// ଘ( ・ω・)_/゚・:*:・。☆
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
/// This enum helps to add new **font raw tokens** exclusive to this ``OrangeTheme``
/// 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_.
///
/// - Since: 0.9.0
public enum OrangeBrandFontRawTokens {

// ଘ( ・ω・)_/゚・:*:・。☆
Expand Down
2 changes: 2 additions & 0 deletions OUDS/Core/Themes/Orange/Sources/OrangeTheme.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ import OUDSTokensSemantic
///
/// @Environment(\.theme) var theme
/// ```
///
/// - Since: 0.9.0
open class OrangeTheme: OUDSTheme, @unchecked Sendable {

// MARK: - Initializers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ import OUDSFoundations
/// ```swift
/// OrangeTheme(borders: CustomBorderTokensProvider())
/// ```
///
/// - Since: 0.9.0
open class OrangeThemeBorderSemanticTokensProvider {

/// Intializes the provider
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ import OUDSFoundations
/// ```swift
/// OrangeTheme(colors: CustomColorTokensProvider())
/// ```
///
/// - Since: 0.9.0
open class OrangeThemeColorSemanticTokensProvider {

/// Intializes the provider
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ import OUDSFoundations
/// ```swift
/// OrangeTheme(elevations: CustomElevationTokensProvider())
/// ```
///
/// - Since: 0.9.0
open class OrangeThemeElevationSemanticTokensProvider {

/// Intializes the provider
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ import OUDSFoundations
/// ```swift
/// OrangeTheme(fonts: CustomFontTokensProvider())
/// ```
///
/// - Since: 0.9.0
open class OrangeThemeFontSemanticTokensProvider {

/// Intializes the provider
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ import OUDSFoundations
/// ```swift
/// OrangeTheme(grids: CustomGridTokensProvider())
/// ```
///
/// - Since: 0.9.0
open class OrangeThemeGridSemanticTokensProvider {

/// Intializes the provider
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ import OUDSFoundations
/// ```swift
/// OrangeTheme(opacities: CustomOpacityTokensProvider())
/// ```
///
/// - Since: 0.9.0
open class OrangeThemeOpacitySemanticTokensProvider {

/// Intializes the provider
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ import OUDSFoundations
/// ```swift
/// OrangeTheme(sizes: CustomSizeTokensProvider())
/// ```
///
/// - Since: 0.9.0
open class OrangeThemeSizeSemanticTokensProvider {

/// Intializes the provider
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ import OUDSFoundations
/// ```swift
/// OrangeTheme(spaces: CustomSpaceTokenProvider())
/// ```
///
/// - Since: 0.9.0
open class OrangeThemeSpaceSemanticTokensProvider {

/// Intializes the provider
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ import OUDSTokensSemantic

/// This is a component tokens list for buttons like `OUDSButton`.
/// **Warning: This is a draft component **
///
/// - Since: 0.9.0
public protocol ButtonsComponentTokens {

/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ infix operator <|
/// Composite tokens are tokens defined in *Figma* by other tokens.
/// Here a *font* thing is caracterized by a *font size*, a *line height*, a *font weight* and *letter spacing* values.
/// All these elements are *raw tokens*, and together define a *composite raw token* for *font* thing.
///
/// - Since: 0.9.0
public struct FontCompositeRawToken: Equatable, Sendable {

// Font family is not included here because this is the only thing which can vary
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
/// Primitive types such as `Double` and `String` must be used to as to allow to use `@objc` keywords in _Swift 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_.
///
/// - Since: 0.9.0
public enum BorderRawTokens {

// ଘ( ・ω・)_/゚・:*:・。☆
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@
/// ``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`.
///
/// Primitive types such as ``String` must be used to as to allow to use `@objc` keywords in extensions for overriding.
/// 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
/// (i.e. publicly accessible from everywhere). More optimized than _struct_.
///
/// - Since: 0.9.0
public enum ColorRawTokens {

// ଘ( ・ω・)_/゚・:*:・。☆
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
/// 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_.
///
/// - Since: 0.9.0
public enum DimensionRawTokens {

// ଘ( ・ω・)_/゚・:*:・。☆
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
/// 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_.
///
/// - Since: 0.9.0
public enum ElevationRawTokens {

// ଘ( ・ω・)_/゚・:*:・。☆
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
/// 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_.
///
/// - Since: 0.9.0
public enum FontRawTokens {

// ଘ( ・ω・)_/゚・:*:・。☆
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@

/// Defined as the group of all **raw tokens** related to **grid**.
/// Values are defined in *GridRawTokens+Values.swift* file updated by the tokenator.
/// ``GridRawTokens`` are tokens to use to define *grids* using ``GridRawToken` type.
/// ``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.
/// 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_.
///
/// - Since: 0.9.0
public enum GridRawTokens {

// ଘ( ・ω・)_/゚・:*:・。☆
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
/// 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_.
///
/// - Since: 0.9.0
public enum OpacityRawTokens {

// ଘ( ・ω・)_/゚・:*:・。☆
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
/// This is a group of semantic tokens for **borders**.
/// It defines all ``BorderWidthSemanticToken``, ``BorderRadiusSemanticToken`` and ``BorderStyleSemanticToken`` a theme must have.
/// Any border semantic token must be declared there as providers like `OUDSBorderSemanticTokensProvider` will then expose them through `OUDSTheme`.
///
/// - Since: 0.9.0
public protocol BorderSemanticTokens {

// MARK: - Semantic token - Border - Width
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@
/// // Thus users can in their components use colorBgPrimary as defined in their design system
/// // (even if they are still able to use 'lower level' semantic tokens but it is more error-prone)
/// ```
///
///
/// - Since: 0.9.0
public protocol ColorMultipleSemanticTokens {

// MARK: - Color - Opacity - Invisible
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
/// It defines all ``ColorSemanticToken`` a theme must have.
/// These tokens are then gathered inside ``MultipleColorSemanticTokens`` defined in ``ColorMultipleSemanticTokens``.
/// Any color semantic token must be declared there (except ``MultipleColorSemanticTokens``)
///
/// - Since: 0.9.0
public protocol ColorSemanticTokens {

// MARK: - Color - Opacity - Invisible
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
/// // Or use .light or .dark instead of elevation(for:)
/// }
/// ```
///
/// - Since: 0.9.0
public protocol ElevationCompositeSemanticTokens {

var elevationNone: ElevationCompositeSemanticToken { get }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
/// // (even if they are still able to use 'lower level' semantic tokens but it is more error-prone)
/// ```
///
/// - Since: 0.9.0
public protocol ElevationMultipleSemanticTokens {

var elevationColorDefault: MultipleColorSemanticTokens { get }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
/// However the composite tokens (here for box shadows) are defined in ``ElevationCompositeSemanticTokens`` because the *tokenator*
/// is not able to generate them yet, and they must be defined elsewhere to not be deleted.
/// Any elevation semantic token must be declared there (except ``ElevationCompositeSemanticTokens``)
///
/// - Since: 0.9.0
public protocol ElevationSemanticTokens {

// MARK: Semantic token - Elevation - X
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@
///
/// // Etc.
/// ```
///
/// - Since: 0.9.0
public protocol FontCompositeSemanticTokens {

// MARK: - Semantic tokens - Typography - Composites - Display
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
/// // (even if they are still able to use 'lower level' semantic tokens but it is more error-prone)
/// ```
///
/// - Since: 0.9.0
public protocol FontMultipleSemanticTokens {

// MARK: - Semantic token - Typography - Font - Size
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
/// However the composite tokens (here the ones gathering each type of semantic token here) are defined in ``FontCompositeSemanticTokens`` because the *tokenator*
/// is not able to generate them yet, and they must be defined elsewhere to not be deleted.
/// Any font semantic token must be declared there (except ``FontCompositeSemanticTokens``).
///
/// - Since: 0.9.0
public protocol FontSemanticTokens {

// MARK: - Semantic token - Typography - Font - Family
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
/// This is a group of semantic tokens for **grids**.
/// It defines all `GridSemanticToken` a theme must have.
/// Any grid semantic token must be declared there.
///
/// - Since: 0.9.0
public protocol GridSemanticTokens {

// MARK: Semantic token - Grid - iOS Extra compact
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
/// This is a group of semantic tokens for **opacity.**
/// It defines all ``OpacitySemanticToken`` a theme must have.
/// Any opacity semantic token must be declared there as providers like `OrangeThemeOpacitySemanticTokensProvider` will then expose them through `OUDSTheme`.
///
/// - Since: 0.9.0
public protocol OpacitySemanticTokens {

// MARK: Semantic token - Opacity
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@
/// // Thus users can in their components use sizeIconWithHeadingXlargeSizeSm as defined in their design system
/// // (even if they are still able to use 'lower level' semantic tokens but it is more error-prone)
/// ```
///
///
/// - Since: 0.9.0
public protocol SizeMultipleSemanticTokens {

// MARK: - Semantic token - Sizing - Icon with typography
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
/// This is a group of semantic tokens for **sizing**.
/// It defines all ``SizeSemanticToken`` a theme must have.
/// Any size semantic token must be declared there.
///
/// - Since: 0.9.0
public protocol SizeSemanticTokens {

// MARK: - Semantic token - Sizing - Icon with typography
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@
/// // Thus users can in their components use spaceScaledNone as defined in their design system
/// // (even if they are still able to use 'lower level' semantic tokens but it is more error-prone)
/// ```
///
///
/// - Since: 0.9.0
public protocol SpaceMultipleSemanticTokens {

// MARK: Semantic token - Spacing - Scaled
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
/// This is a group of semantic tokens for **spacing**.
/// It defines all ``SpaceSemanticToken`` a theme must have.
/// Any space semantic token must be declared there.
///
/// - Since: 0.9.0
public protocol SpaceSemanticTokens {

// MARK: Semantic token - Spacing - Scaled
Expand Down
4 changes: 3 additions & 1 deletion OUDS/Foundations/Sources/OUDSLogger.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
import Foundation
import os

/// The `os.Logger` wrapper used in the *OUDS iOS* library so as to logs things in standard output or elswhere.
/// The `os.Logger` wrapper used in the *OUDS iOS* library so as to logs things in standard output or elsewhere.
///
/// - Since: 0.9.0
public struct OUDSLogger {

private init() {}
Expand Down
Loading

0 comments on commit cb44fcb

Please sign in to comment.