Skip to content

Commit

Permalink
review remove unwanted code
Browse files Browse the repository at this point in the history
  • Loading branch information
ludovic35 committed Oct 7, 2024
1 parent bc34559 commit f42ce3b
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 120 deletions.
4 changes: 0 additions & 4 deletions OUDS/Core/Themes/Inverse/Tests/TestInverseThemeColors.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@
// Software description: A SwiftUI components library with code examples for Orange Unified Design System
//

<<<<<<< Updated upstream
=======
import XCTest
>>>>>>> Stashed changes
import OUDS
import OUDSThemesInverse
import OUDSTokensSemantic
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ public final class MultipleSpacingTokens: NSObject {
return self.compact == other.compact && self.regular == other.regular
}

/// Returns the right dimension according to the `horizontalSizeClass`.
/// - Parameter horizontalSizeClass: The horizontal size class
/// Returns the right dimension according to the `userInterfaceSizeClass`.
/// - Parameter userInterfaceSizeClass: The user interface size class (Could be horizontal or vertical)
/// - Returns: The right dimension raw token
public func dimension(for horizontalSizeClass: UserInterfaceSizeClass) -> DimensionRawToken {
horizontalSizeClass == .compact ? compact : regular
public func dimension(for userInterfaceSizeClass: UserInterfaceSizeClass) -> DimensionRawToken {
userInterfaceSizeClass == .compact ? compact : regular
}
}
3 changes: 1 addition & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,7 @@ let package = Package(
.target(
name: "OUDSComponents",
dependencies: ["OUDSTokensComponent", "OUDS"],
path: "OUDS/Core/Components/Sources",
resources: [Resource.copy("OUDS/Core/Components/Resources")]),
path: "OUDS/Core/Components/Sources"),
.target(
name: "OUDSThemesSosh",
dependencies: ["OUDS"],
Expand Down
110 changes: 0 additions & 110 deletions Showcase/Showcase/Pages/Tokens/Dimension/DimensionTokenPage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import SwiftUI
import OUDS
import OUDSTokensSemantic
import OUDSComponents // for BorderStyleModifier

struct DimensionTokenPage: View {

Expand Down Expand Up @@ -44,117 +43,8 @@ struct DimensionTokenPage: View {
.padding(.vertical, theme.spaceFixedShorter)
}
}
//
// NavigationLink {
// Text("Size here")
// } label: {
// Text("app_tokens_dimension_spacing_label")
// .typeHeadingMedium(theme)
// .padding(.vertical, theme.spaceFixedShorter)
// }
//
// NavigationLink{
// Text("Size here")
// } label: {
// Text("app_tokens_dimension_size_label")
// .typeHeadingMedium(theme)
// .padding(.vertical, theme.spaceFixedShorter)
// }
}

.padding(.horizontal, theme.spaceFixedMedium)
}

// MARK: Private helpers

@ViewBuilder
private func groupOfIllustrations<Illustration> (name: String, @ViewBuilder illustrations: () -> Illustration) -> some View where Illustration: View {
VStack(alignment: .leading, spacing: theme.spaceFixedShorter) {
Text(name).typeHeadingLarge(theme)

VStack(alignment: .leading, spacing: theme.spaceFixedNone) {
illustrations()
}
}
}

private func illustration(
width: BorderWidthSemanticToken,
radius: BorderRadiusSemanticToken,
style: BorderStyleSemanticToken,
name: String,
value: Double? = nil) -> some View {
HStack(alignment: .center, spacing: theme.spaceFixedMedium) {

Rectangle()
.fill(theme.colorBackgroundDefaultSecondary?.color(for: colorScheme) ?? Color(UIColor.systemGroupedBackground))
.frame(width: 64, height: 64)
.oudsBorder(style: style,
width: width,
radius: radius,
color: theme.colorBorderDefault!)

VStack(alignment: .leading, spacing: theme.spaceFixedNone) {
Text(name).bold()
if let value {
Text("\(value, specifier: "%.1f")")
}
}
.frame(maxWidth: .infinity, alignment: .leading)
}
.padding(.vertical, theme.spaceFixedShorter)
}
}

private enum Radius: String, CaseIterable {
case borderRadiusNone
case borderRadiusDefault
case borderRadiusShort
case borderRadiusMedium
case borderRadiusTall

func token(from theme: OUDSTheme) -> BorderRadiusSemanticToken {
switch self {
case .borderRadiusNone:
return theme.borderRadiusNone
case .borderRadiusDefault:
return theme.borderRadiusDefault
case .borderRadiusShort:
return theme.borderRadiusShort
case .borderRadiusMedium:
return theme.borderRadiusMedium
case .borderRadiusTall:
return theme.borderRadiusTall
}
}
}

private enum Width: String, CaseIterable {

case borderWidthNone
case borderWidthDefault
case borderWidthThin
case borderWidthMedium
case borderWidthThick
case borderWidthThicker
case borderWidthOutsideFocus

func token(from theme: OUDSTheme) -> BorderWidthSemanticToken {
switch self {
case .borderWidthNone:
return theme.borderWidthNone
case .borderWidthDefault:
return theme.borderWidthDefault
case .borderWidthThin:
return theme.borderWidthThin
case .borderWidthMedium:
return theme.borderWidthMedium
case .borderWidthThick:
return theme.borderWidthThick
case .borderWidthThicker:
return theme.borderWidthThicker
case .borderWidthOutsideFocus:
return theme.borderWidthOutsideFocus
}
}
}

0 comments on commit f42ce3b

Please sign in to comment.