diff --git a/modules/UI/Sources/Theme/Colors/ColorPalette.swift b/modules/UI/Sources/Theme/Colors/ColorPalette.swift new file mode 100644 index 0000000..da4fb0c --- /dev/null +++ b/modules/UI/Sources/Theme/Colors/ColorPalette.swift @@ -0,0 +1,51 @@ +// +// ColorPalette.swift +// UI +// +// Copyright 2022 Thoughtworks, Inc. All rights reserved. +// + +import Foundation +import SwiftUI + +public enum ColorPalette: String { + // black + case black + // white + case white + // gray + case gray50 + case gray100 + case gray200 + case gray300 + case gray400 + case gray500 + case gray600 + case gray700 + case gray800 + case gray900 + // blue + case blue + // light blue + case lightBlue50 + case lightBlue300 + // light green + case lightGreen200 + case lightGreen700 + // purple + case purple200 + case purple500 + case purple700 + // teal + case teal200 + case teal700 + // red + case red700 + case red900 +} + +public extension ColorPalette { + var color: Color { + Color(self.rawValue, bundle: Bundle.uiBundle) + } +} diff --git a/modules/UI/Sources/Image/Icons.xcassets/Contents.json b/modules/UI/Sources/Theme/Colors/ColorPalette.xcassets/Contents.json similarity index 100% rename from modules/UI/Sources/Image/Icons.xcassets/Contents.json rename to modules/UI/Sources/Theme/Colors/ColorPalette.xcassets/Contents.json diff --git a/modules/UI/Sources/Theme/Colors/Colors.xcassets/black/Contents.json b/modules/UI/Sources/Theme/Colors/ColorPalette.xcassets/black/Contents.json similarity index 100% rename from modules/UI/Sources/Theme/Colors/Colors.xcassets/black/Contents.json rename to modules/UI/Sources/Theme/Colors/ColorPalette.xcassets/black/Contents.json diff --git a/modules/UI/Sources/Theme/Colors/Colors.xcassets/black/black.colorset/Contents.json b/modules/UI/Sources/Theme/Colors/ColorPalette.xcassets/black/black.colorset/Contents.json similarity index 100% rename from modules/UI/Sources/Theme/Colors/Colors.xcassets/black/black.colorset/Contents.json rename to modules/UI/Sources/Theme/Colors/ColorPalette.xcassets/black/black.colorset/Contents.json diff --git a/modules/UI/Sources/Theme/Colors/Colors.xcassets/blue/Contents.json b/modules/UI/Sources/Theme/Colors/ColorPalette.xcassets/blue/Contents.json similarity index 100% rename from modules/UI/Sources/Theme/Colors/Colors.xcassets/blue/Contents.json rename to modules/UI/Sources/Theme/Colors/ColorPalette.xcassets/blue/Contents.json diff --git a/modules/UI/Sources/Theme/Colors/Colors.xcassets/blue/blue.colorset/Contents.json b/modules/UI/Sources/Theme/Colors/ColorPalette.xcassets/blue/blue.colorset/Contents.json similarity index 100% rename from modules/UI/Sources/Theme/Colors/Colors.xcassets/blue/blue.colorset/Contents.json rename to modules/UI/Sources/Theme/Colors/ColorPalette.xcassets/blue/blue.colorset/Contents.json diff --git a/modules/UI/Sources/Theme/Colors/Colors.xcassets/gray/Contents.json b/modules/UI/Sources/Theme/Colors/ColorPalette.xcassets/gray/Contents.json similarity index 100% rename from modules/UI/Sources/Theme/Colors/Colors.xcassets/gray/Contents.json rename to modules/UI/Sources/Theme/Colors/ColorPalette.xcassets/gray/Contents.json diff --git a/modules/UI/Sources/Theme/Colors/Colors.xcassets/gray/gray100.colorset/Contents.json b/modules/UI/Sources/Theme/Colors/ColorPalette.xcassets/gray/gray100.colorset/Contents.json similarity index 100% rename from modules/UI/Sources/Theme/Colors/Colors.xcassets/gray/gray100.colorset/Contents.json rename to modules/UI/Sources/Theme/Colors/ColorPalette.xcassets/gray/gray100.colorset/Contents.json diff --git a/modules/UI/Sources/Theme/Colors/Colors.xcassets/gray/gray200.colorset/Contents.json b/modules/UI/Sources/Theme/Colors/ColorPalette.xcassets/gray/gray200.colorset/Contents.json similarity index 100% rename from modules/UI/Sources/Theme/Colors/Colors.xcassets/gray/gray200.colorset/Contents.json rename to modules/UI/Sources/Theme/Colors/ColorPalette.xcassets/gray/gray200.colorset/Contents.json diff --git a/modules/UI/Sources/Theme/Colors/Colors.xcassets/gray/gray300.colorset/Contents.json b/modules/UI/Sources/Theme/Colors/ColorPalette.xcassets/gray/gray300.colorset/Contents.json similarity index 100% rename from modules/UI/Sources/Theme/Colors/Colors.xcassets/gray/gray300.colorset/Contents.json rename to modules/UI/Sources/Theme/Colors/ColorPalette.xcassets/gray/gray300.colorset/Contents.json diff --git a/modules/UI/Sources/Theme/Colors/Colors.xcassets/gray/gray400.colorset/Contents.json b/modules/UI/Sources/Theme/Colors/ColorPalette.xcassets/gray/gray400.colorset/Contents.json similarity index 100% rename from modules/UI/Sources/Theme/Colors/Colors.xcassets/gray/gray400.colorset/Contents.json rename to modules/UI/Sources/Theme/Colors/ColorPalette.xcassets/gray/gray400.colorset/Contents.json diff --git a/modules/UI/Sources/Theme/Colors/Colors.xcassets/gray/gray50.colorset/Contents.json b/modules/UI/Sources/Theme/Colors/ColorPalette.xcassets/gray/gray50.colorset/Contents.json similarity index 100% rename from modules/UI/Sources/Theme/Colors/Colors.xcassets/gray/gray50.colorset/Contents.json rename to modules/UI/Sources/Theme/Colors/ColorPalette.xcassets/gray/gray50.colorset/Contents.json diff --git a/modules/UI/Sources/Theme/Colors/Colors.xcassets/gray/gray500.colorset/Contents.json b/modules/UI/Sources/Theme/Colors/ColorPalette.xcassets/gray/gray500.colorset/Contents.json similarity index 100% rename from modules/UI/Sources/Theme/Colors/Colors.xcassets/gray/gray500.colorset/Contents.json rename to modules/UI/Sources/Theme/Colors/ColorPalette.xcassets/gray/gray500.colorset/Contents.json diff --git a/modules/UI/Sources/Theme/Colors/Colors.xcassets/gray/gray600.colorset/Contents.json b/modules/UI/Sources/Theme/Colors/ColorPalette.xcassets/gray/gray600.colorset/Contents.json similarity index 100% rename from modules/UI/Sources/Theme/Colors/Colors.xcassets/gray/gray600.colorset/Contents.json rename to modules/UI/Sources/Theme/Colors/ColorPalette.xcassets/gray/gray600.colorset/Contents.json diff --git a/modules/UI/Sources/Theme/Colors/Colors.xcassets/gray/gray700.colorset/Contents.json b/modules/UI/Sources/Theme/Colors/ColorPalette.xcassets/gray/gray700.colorset/Contents.json similarity index 100% rename from modules/UI/Sources/Theme/Colors/Colors.xcassets/gray/gray700.colorset/Contents.json rename to modules/UI/Sources/Theme/Colors/ColorPalette.xcassets/gray/gray700.colorset/Contents.json diff --git a/modules/UI/Sources/Theme/Colors/Colors.xcassets/gray/gray800.colorset/Contents.json b/modules/UI/Sources/Theme/Colors/ColorPalette.xcassets/gray/gray800.colorset/Contents.json similarity index 100% rename from modules/UI/Sources/Theme/Colors/Colors.xcassets/gray/gray800.colorset/Contents.json rename to modules/UI/Sources/Theme/Colors/ColorPalette.xcassets/gray/gray800.colorset/Contents.json diff --git a/modules/UI/Sources/Theme/Colors/Colors.xcassets/gray/gray900.colorset/Contents.json b/modules/UI/Sources/Theme/Colors/ColorPalette.xcassets/gray/gray900.colorset/Contents.json similarity index 100% rename from modules/UI/Sources/Theme/Colors/Colors.xcassets/gray/gray900.colorset/Contents.json rename to modules/UI/Sources/Theme/Colors/ColorPalette.xcassets/gray/gray900.colorset/Contents.json diff --git a/modules/UI/Sources/Theme/Colors/Colors.xcassets/lightBlue/Contents.json b/modules/UI/Sources/Theme/Colors/ColorPalette.xcassets/lightBlue/Contents.json similarity index 100% rename from modules/UI/Sources/Theme/Colors/Colors.xcassets/lightBlue/Contents.json rename to modules/UI/Sources/Theme/Colors/ColorPalette.xcassets/lightBlue/Contents.json diff --git a/modules/UI/Sources/Theme/Colors/Colors.xcassets/lightBlue/lightBlue300.colorset/Contents.json b/modules/UI/Sources/Theme/Colors/ColorPalette.xcassets/lightBlue/lightBlue300.colorset/Contents.json similarity index 100% rename from modules/UI/Sources/Theme/Colors/Colors.xcassets/lightBlue/lightBlue300.colorset/Contents.json rename to modules/UI/Sources/Theme/Colors/ColorPalette.xcassets/lightBlue/lightBlue300.colorset/Contents.json diff --git a/modules/UI/Sources/Theme/Colors/Colors.xcassets/lightBlue/lightBlue50.colorset/Contents.json b/modules/UI/Sources/Theme/Colors/ColorPalette.xcassets/lightBlue/lightBlue50.colorset/Contents.json similarity index 100% rename from modules/UI/Sources/Theme/Colors/Colors.xcassets/lightBlue/lightBlue50.colorset/Contents.json rename to modules/UI/Sources/Theme/Colors/ColorPalette.xcassets/lightBlue/lightBlue50.colorset/Contents.json diff --git a/modules/UI/Sources/Theme/Colors/Colors.xcassets/lightGreen/Contents.json b/modules/UI/Sources/Theme/Colors/ColorPalette.xcassets/lightGreen/Contents.json similarity index 100% rename from modules/UI/Sources/Theme/Colors/Colors.xcassets/lightGreen/Contents.json rename to modules/UI/Sources/Theme/Colors/ColorPalette.xcassets/lightGreen/Contents.json diff --git a/modules/UI/Sources/Theme/Colors/Colors.xcassets/lightGreen/lightGreen200.colorset/Contents.json b/modules/UI/Sources/Theme/Colors/ColorPalette.xcassets/lightGreen/lightGreen200.colorset/Contents.json similarity index 100% rename from modules/UI/Sources/Theme/Colors/Colors.xcassets/lightGreen/lightGreen200.colorset/Contents.json rename to modules/UI/Sources/Theme/Colors/ColorPalette.xcassets/lightGreen/lightGreen200.colorset/Contents.json diff --git a/modules/UI/Sources/Theme/Colors/Colors.xcassets/lightGreen/lightGreen700.colorset/Contents.json b/modules/UI/Sources/Theme/Colors/ColorPalette.xcassets/lightGreen/lightGreen700.colorset/Contents.json similarity index 100% rename from modules/UI/Sources/Theme/Colors/Colors.xcassets/lightGreen/lightGreen700.colorset/Contents.json rename to modules/UI/Sources/Theme/Colors/ColorPalette.xcassets/lightGreen/lightGreen700.colorset/Contents.json diff --git a/modules/UI/Sources/Theme/Colors/Colors.xcassets/purple/Contents.json b/modules/UI/Sources/Theme/Colors/ColorPalette.xcassets/purple/Contents.json similarity index 100% rename from modules/UI/Sources/Theme/Colors/Colors.xcassets/purple/Contents.json rename to modules/UI/Sources/Theme/Colors/ColorPalette.xcassets/purple/Contents.json diff --git a/modules/UI/Sources/Theme/Colors/Colors.xcassets/purple/purple200.colorset/Contents.json b/modules/UI/Sources/Theme/Colors/ColorPalette.xcassets/purple/purple200.colorset/Contents.json similarity index 100% rename from modules/UI/Sources/Theme/Colors/Colors.xcassets/purple/purple200.colorset/Contents.json rename to modules/UI/Sources/Theme/Colors/ColorPalette.xcassets/purple/purple200.colorset/Contents.json diff --git a/modules/UI/Sources/Theme/Colors/Colors.xcassets/purple/purple500.colorset/Contents.json b/modules/UI/Sources/Theme/Colors/ColorPalette.xcassets/purple/purple500.colorset/Contents.json similarity index 100% rename from modules/UI/Sources/Theme/Colors/Colors.xcassets/purple/purple500.colorset/Contents.json rename to modules/UI/Sources/Theme/Colors/ColorPalette.xcassets/purple/purple500.colorset/Contents.json diff --git a/modules/UI/Sources/Theme/Colors/Colors.xcassets/purple/purple700.colorset/Contents.json b/modules/UI/Sources/Theme/Colors/ColorPalette.xcassets/purple/purple700.colorset/Contents.json similarity index 100% rename from modules/UI/Sources/Theme/Colors/Colors.xcassets/purple/purple700.colorset/Contents.json rename to modules/UI/Sources/Theme/Colors/ColorPalette.xcassets/purple/purple700.colorset/Contents.json diff --git a/modules/UI/Sources/Theme/Colors/Colors.xcassets/red/Contents.json b/modules/UI/Sources/Theme/Colors/ColorPalette.xcassets/red/Contents.json similarity index 100% rename from modules/UI/Sources/Theme/Colors/Colors.xcassets/red/Contents.json rename to modules/UI/Sources/Theme/Colors/ColorPalette.xcassets/red/Contents.json diff --git a/modules/UI/Sources/Theme/Colors/Colors.xcassets/red/red700.colorset/Contents.json b/modules/UI/Sources/Theme/Colors/ColorPalette.xcassets/red/red700.colorset/Contents.json similarity index 100% rename from modules/UI/Sources/Theme/Colors/Colors.xcassets/red/red700.colorset/Contents.json rename to modules/UI/Sources/Theme/Colors/ColorPalette.xcassets/red/red700.colorset/Contents.json diff --git a/modules/UI/Sources/Theme/Colors/Colors.xcassets/red/red900.colorset/Contents.json b/modules/UI/Sources/Theme/Colors/ColorPalette.xcassets/red/red900.colorset/Contents.json similarity index 100% rename from modules/UI/Sources/Theme/Colors/Colors.xcassets/red/red900.colorset/Contents.json rename to modules/UI/Sources/Theme/Colors/ColorPalette.xcassets/red/red900.colorset/Contents.json diff --git a/modules/UI/Sources/Theme/Colors/Colors.xcassets/teal/Contents.json b/modules/UI/Sources/Theme/Colors/ColorPalette.xcassets/teal/Contents.json similarity index 100% rename from modules/UI/Sources/Theme/Colors/Colors.xcassets/teal/Contents.json rename to modules/UI/Sources/Theme/Colors/ColorPalette.xcassets/teal/Contents.json diff --git a/modules/UI/Sources/Theme/Colors/Colors.xcassets/teal/teal200.colorset/Contents.json b/modules/UI/Sources/Theme/Colors/ColorPalette.xcassets/teal/teal200.colorset/Contents.json similarity index 100% rename from modules/UI/Sources/Theme/Colors/Colors.xcassets/teal/teal200.colorset/Contents.json rename to modules/UI/Sources/Theme/Colors/ColorPalette.xcassets/teal/teal200.colorset/Contents.json diff --git a/modules/UI/Sources/Theme/Colors/Colors.xcassets/teal/teal700.colorset/Contents.json b/modules/UI/Sources/Theme/Colors/ColorPalette.xcassets/teal/teal700.colorset/Contents.json similarity index 100% rename from modules/UI/Sources/Theme/Colors/Colors.xcassets/teal/teal700.colorset/Contents.json rename to modules/UI/Sources/Theme/Colors/ColorPalette.xcassets/teal/teal700.colorset/Contents.json diff --git a/modules/UI/Sources/Theme/Colors/Colors.xcassets/white/Contents.json b/modules/UI/Sources/Theme/Colors/ColorPalette.xcassets/white/Contents.json similarity index 100% rename from modules/UI/Sources/Theme/Colors/Colors.xcassets/white/Contents.json rename to modules/UI/Sources/Theme/Colors/ColorPalette.xcassets/white/Contents.json diff --git a/modules/UI/Sources/Theme/Colors/Colors.xcassets/white/white.colorset/Contents.json b/modules/UI/Sources/Theme/Colors/ColorPalette.xcassets/white/white.colorset/Contents.json similarity index 100% rename from modules/UI/Sources/Theme/Colors/Colors.xcassets/white/white.colorset/Contents.json rename to modules/UI/Sources/Theme/Colors/ColorPalette.xcassets/white/white.colorset/Contents.json diff --git a/modules/UI/Sources/Theme/Colors/Colors.swift b/modules/UI/Sources/Theme/Colors/Colors.swift index a2f8d74..2fdf9cf 100644 --- a/modules/UI/Sources/Theme/Colors/Colors.swift +++ b/modules/UI/Sources/Theme/Colors/Colors.swift @@ -1,5 +1,5 @@ // -// ColorName.swift +// Colors.swift // UI // // Copyright 2022 Thoughtworks, Inc. All rights reserved. @@ -9,43 +9,31 @@ import Foundation import SwiftUI public enum Colors: String { - // black - case black - // white - case white - // gray - case gray50 - case gray100 - case gray200 - case gray300 - case gray400 - case gray500 - case gray600 - case gray700 - case gray800 - case gray900 - // blue - case blue - // light blue - case lightBlue50 - case lightBlue300 - // light green - case lightGreen200 - case lightGreen700 - // purple - case purple200 - case purple500 - case purple700 - // teal - case teal200 - case teal700 - // red - case red700 - case red900 + case primary + case primaryVariant + case secondary + case secondaryVariant + case background + case surface + case error + case onPrimary + case onSecondary + case onBackground + case onSurface + case onError + case statusBarColor } public extension Colors { var color: Color { - Color(self.rawValue, bundle: Bundle.uiBundle) + switch self { + case .statusBarColor: + // Colors枚举相当于颜色值仓库,其他所有使用颜色值的地方都可以从这里取值。 + // 然后ThemeColors,是基于UI Guide设计的一个应用主题色集合,它可以自定义颜色值,也可以使用Colors里面定义好的色值。 + // 所以,这里的statusBarColor就是使用了Colors里面定义好的blue。 + return ColorPalette.blue.color + default: + return Color(self.rawValue, bundle: .uiBundle) + } } } diff --git a/modules/UI/Sources/Theme/Colors/ThemeColors.xcassets/background.colorset/Contents.json b/modules/UI/Sources/Theme/Colors/Colors.xcassets/background.colorset/Contents.json similarity index 100% rename from modules/UI/Sources/Theme/Colors/ThemeColors.xcassets/background.colorset/Contents.json rename to modules/UI/Sources/Theme/Colors/Colors.xcassets/background.colorset/Contents.json diff --git a/modules/UI/Sources/Theme/Colors/ThemeColors.xcassets/error.colorset/Contents.json b/modules/UI/Sources/Theme/Colors/Colors.xcassets/error.colorset/Contents.json similarity index 100% rename from modules/UI/Sources/Theme/Colors/ThemeColors.xcassets/error.colorset/Contents.json rename to modules/UI/Sources/Theme/Colors/Colors.xcassets/error.colorset/Contents.json diff --git a/modules/UI/Sources/Theme/Colors/ThemeColors.xcassets/onBackground.colorset/Contents.json b/modules/UI/Sources/Theme/Colors/Colors.xcassets/onBackground.colorset/Contents.json similarity index 100% rename from modules/UI/Sources/Theme/Colors/ThemeColors.xcassets/onBackground.colorset/Contents.json rename to modules/UI/Sources/Theme/Colors/Colors.xcassets/onBackground.colorset/Contents.json diff --git a/modules/UI/Sources/Theme/Colors/ThemeColors.xcassets/onError.colorset/Contents.json b/modules/UI/Sources/Theme/Colors/Colors.xcassets/onError.colorset/Contents.json similarity index 100% rename from modules/UI/Sources/Theme/Colors/ThemeColors.xcassets/onError.colorset/Contents.json rename to modules/UI/Sources/Theme/Colors/Colors.xcassets/onError.colorset/Contents.json diff --git a/modules/UI/Sources/Theme/Colors/ThemeColors.xcassets/onPrimary.colorset/Contents.json b/modules/UI/Sources/Theme/Colors/Colors.xcassets/onPrimary.colorset/Contents.json similarity index 100% rename from modules/UI/Sources/Theme/Colors/ThemeColors.xcassets/onPrimary.colorset/Contents.json rename to modules/UI/Sources/Theme/Colors/Colors.xcassets/onPrimary.colorset/Contents.json diff --git a/modules/UI/Sources/Theme/Colors/ThemeColors.xcassets/onSecondary.colorset/Contents.json b/modules/UI/Sources/Theme/Colors/Colors.xcassets/onSecondary.colorset/Contents.json similarity index 100% rename from modules/UI/Sources/Theme/Colors/ThemeColors.xcassets/onSecondary.colorset/Contents.json rename to modules/UI/Sources/Theme/Colors/Colors.xcassets/onSecondary.colorset/Contents.json diff --git a/modules/UI/Sources/Theme/Colors/ThemeColors.xcassets/onSurface.colorset/Contents.json b/modules/UI/Sources/Theme/Colors/Colors.xcassets/onSurface.colorset/Contents.json similarity index 100% rename from modules/UI/Sources/Theme/Colors/ThemeColors.xcassets/onSurface.colorset/Contents.json rename to modules/UI/Sources/Theme/Colors/Colors.xcassets/onSurface.colorset/Contents.json diff --git a/modules/UI/Sources/Theme/Colors/ThemeColors.xcassets/primary.colorset/Contents.json b/modules/UI/Sources/Theme/Colors/Colors.xcassets/primary.colorset/Contents.json similarity index 100% rename from modules/UI/Sources/Theme/Colors/ThemeColors.xcassets/primary.colorset/Contents.json rename to modules/UI/Sources/Theme/Colors/Colors.xcassets/primary.colorset/Contents.json diff --git a/modules/UI/Sources/Theme/Colors/ThemeColors.xcassets/primaryVariant.colorset/Contents.json b/modules/UI/Sources/Theme/Colors/Colors.xcassets/primaryVariant.colorset/Contents.json similarity index 100% rename from modules/UI/Sources/Theme/Colors/ThemeColors.xcassets/primaryVariant.colorset/Contents.json rename to modules/UI/Sources/Theme/Colors/Colors.xcassets/primaryVariant.colorset/Contents.json diff --git a/modules/UI/Sources/Theme/Colors/ThemeColors.xcassets/secondary.colorset/Contents.json b/modules/UI/Sources/Theme/Colors/Colors.xcassets/secondary.colorset/Contents.json similarity index 100% rename from modules/UI/Sources/Theme/Colors/ThemeColors.xcassets/secondary.colorset/Contents.json rename to modules/UI/Sources/Theme/Colors/Colors.xcassets/secondary.colorset/Contents.json diff --git a/modules/UI/Sources/Theme/Colors/ThemeColors.xcassets/secondaryVariant.colorset/Contents.json b/modules/UI/Sources/Theme/Colors/Colors.xcassets/secondaryVariant.colorset/Contents.json similarity index 100% rename from modules/UI/Sources/Theme/Colors/ThemeColors.xcassets/secondaryVariant.colorset/Contents.json rename to modules/UI/Sources/Theme/Colors/Colors.xcassets/secondaryVariant.colorset/Contents.json diff --git a/modules/UI/Sources/Theme/Colors/ThemeColors.xcassets/surface.colorset/Contents.json b/modules/UI/Sources/Theme/Colors/Colors.xcassets/surface.colorset/Contents.json similarity index 100% rename from modules/UI/Sources/Theme/Colors/ThemeColors.xcassets/surface.colorset/Contents.json rename to modules/UI/Sources/Theme/Colors/Colors.xcassets/surface.colorset/Contents.json diff --git a/modules/UI/Sources/Theme/Colors/ThemeColors.swift b/modules/UI/Sources/Theme/Colors/ThemeColors.swift deleted file mode 100644 index 4ae417e..0000000 --- a/modules/UI/Sources/Theme/Colors/ThemeColors.swift +++ /dev/null @@ -1,39 +0,0 @@ -// -// ThemeColors.swift -// UI -// -// Copyright 2022 Thoughtworks, Inc. All rights reserved. -// - -import Foundation -import SwiftUI - -public enum ThemeColors: String { - case primary - case primaryVariant - case secondary - case secondaryVariant - case background - case surface - case error - case onPrimary - case onSecondary - case onBackground - case onSurface - case onError - case statusBarColor -} - -public extension ThemeColors { - var color: Color { - switch self { - case .statusBarColor: - // Colors枚举相当于颜色值仓库,其他所有使用颜色值的地方都可以从这里取值。 - // 然后ThemeColors,是基于UI Guide设计的一个应用主题色集合,它可以自定义颜色值,也可以使用Colors里面定义好的色值。 - // 所以,这里的statusBarColor就是使用了Colors里面定义好的blue。 - return Colors.blue.color - default: - return Color(self.rawValue, bundle: .uiBundle) - } - } -} diff --git a/modules/UI/Sources/Dimension/Dimensions.swift b/modules/UI/Sources/Theme/Dimension/Dimensions.swift similarity index 100% rename from modules/UI/Sources/Dimension/Dimensions.swift rename to modules/UI/Sources/Theme/Dimension/Dimensions.swift diff --git a/modules/UI/Sources/Image/IconName.swift b/modules/UI/Sources/Theme/Image/IconName.swift similarity index 100% rename from modules/UI/Sources/Image/IconName.swift rename to modules/UI/Sources/Theme/Image/IconName.swift diff --git a/modules/UI/Sources/Theme/Colors/ThemeColors.xcassets/Contents.json b/modules/UI/Sources/Theme/Image/Icons.xcassets/Contents.json similarity index 100% rename from modules/UI/Sources/Theme/Colors/ThemeColors.xcassets/Contents.json rename to modules/UI/Sources/Theme/Image/Icons.xcassets/Contents.json diff --git a/modules/UI/Sources/Image/Icons.xcassets/common_btn_collected.imageset/Contents.json b/modules/UI/Sources/Theme/Image/Icons.xcassets/common_btn_collected.imageset/Contents.json similarity index 100% rename from modules/UI/Sources/Image/Icons.xcassets/common_btn_collected.imageset/Contents.json rename to modules/UI/Sources/Theme/Image/Icons.xcassets/common_btn_collected.imageset/Contents.json diff --git a/modules/UI/Sources/Image/Icons.xcassets/common_btn_collected.imageset/common_btn_collected@2x.png b/modules/UI/Sources/Theme/Image/Icons.xcassets/common_btn_collected.imageset/common_btn_collected@2x.png similarity index 100% rename from modules/UI/Sources/Image/Icons.xcassets/common_btn_collected.imageset/common_btn_collected@2x.png rename to modules/UI/Sources/Theme/Image/Icons.xcassets/common_btn_collected.imageset/common_btn_collected@2x.png diff --git a/modules/UI/Sources/Image/Icons.xcassets/common_btn_collected.imageset/common_btn_collected@3x.png b/modules/UI/Sources/Theme/Image/Icons.xcassets/common_btn_collected.imageset/common_btn_collected@3x.png similarity index 100% rename from modules/UI/Sources/Image/Icons.xcassets/common_btn_collected.imageset/common_btn_collected@3x.png rename to modules/UI/Sources/Theme/Image/Icons.xcassets/common_btn_collected.imageset/common_btn_collected@3x.png diff --git a/modules/UI/Sources/Image/Icons.xcassets/common_btn_uncollected.imageset/Contents.json b/modules/UI/Sources/Theme/Image/Icons.xcassets/common_btn_uncollected.imageset/Contents.json similarity index 100% rename from modules/UI/Sources/Image/Icons.xcassets/common_btn_uncollected.imageset/Contents.json rename to modules/UI/Sources/Theme/Image/Icons.xcassets/common_btn_uncollected.imageset/Contents.json diff --git a/modules/UI/Sources/Image/Icons.xcassets/common_btn_uncollected.imageset/common_btn_uncollected@2x.png b/modules/UI/Sources/Theme/Image/Icons.xcassets/common_btn_uncollected.imageset/common_btn_uncollected@2x.png similarity index 100% rename from modules/UI/Sources/Image/Icons.xcassets/common_btn_uncollected.imageset/common_btn_uncollected@2x.png rename to modules/UI/Sources/Theme/Image/Icons.xcassets/common_btn_uncollected.imageset/common_btn_uncollected@2x.png diff --git a/modules/UI/Sources/Image/Icons.xcassets/common_btn_uncollected.imageset/common_btn_uncollected@3x.png b/modules/UI/Sources/Theme/Image/Icons.xcassets/common_btn_uncollected.imageset/common_btn_uncollected@3x.png similarity index 100% rename from modules/UI/Sources/Image/Icons.xcassets/common_btn_uncollected.imageset/common_btn_uncollected@3x.png rename to modules/UI/Sources/Theme/Image/Icons.xcassets/common_btn_uncollected.imageset/common_btn_uncollected@3x.png diff --git a/modules/UI/Sources/Image/Icons.xcassets/common_icon_setting.imageset/Contents.json b/modules/UI/Sources/Theme/Image/Icons.xcassets/common_icon_setting.imageset/Contents.json similarity index 100% rename from modules/UI/Sources/Image/Icons.xcassets/common_icon_setting.imageset/Contents.json rename to modules/UI/Sources/Theme/Image/Icons.xcassets/common_icon_setting.imageset/Contents.json diff --git a/modules/UI/Sources/Image/Icons.xcassets/common_icon_setting.imageset/common_icon_night_setting@2x.png b/modules/UI/Sources/Theme/Image/Icons.xcassets/common_icon_setting.imageset/common_icon_night_setting@2x.png similarity index 100% rename from modules/UI/Sources/Image/Icons.xcassets/common_icon_setting.imageset/common_icon_night_setting@2x.png rename to modules/UI/Sources/Theme/Image/Icons.xcassets/common_icon_setting.imageset/common_icon_night_setting@2x.png diff --git a/modules/UI/Sources/Image/Icons.xcassets/common_icon_setting.imageset/common_icon_night_setting@3x.png b/modules/UI/Sources/Theme/Image/Icons.xcassets/common_icon_setting.imageset/common_icon_night_setting@3x.png similarity index 100% rename from modules/UI/Sources/Image/Icons.xcassets/common_icon_setting.imageset/common_icon_night_setting@3x.png rename to modules/UI/Sources/Theme/Image/Icons.xcassets/common_icon_setting.imageset/common_icon_night_setting@3x.png diff --git a/modules/UI/Sources/Image/Icons.xcassets/common_icon_setting.imageset/common_icon_setting@2x.png b/modules/UI/Sources/Theme/Image/Icons.xcassets/common_icon_setting.imageset/common_icon_setting@2x.png similarity index 100% rename from modules/UI/Sources/Image/Icons.xcassets/common_icon_setting.imageset/common_icon_setting@2x.png rename to modules/UI/Sources/Theme/Image/Icons.xcassets/common_icon_setting.imageset/common_icon_setting@2x.png diff --git a/modules/UI/Sources/Image/Icons.xcassets/common_icon_setting.imageset/common_icon_setting@3x.png b/modules/UI/Sources/Theme/Image/Icons.xcassets/common_icon_setting.imageset/common_icon_setting@3x.png similarity index 100% rename from modules/UI/Sources/Image/Icons.xcassets/common_icon_setting.imageset/common_icon_setting@3x.png rename to modules/UI/Sources/Theme/Image/Icons.xcassets/common_icon_setting.imageset/common_icon_setting@3x.png diff --git a/modules/UI/Sources/Typography/CustomFont.swift b/modules/UI/Sources/Theme/Typography/CustomFont.swift similarity index 100% rename from modules/UI/Sources/Typography/CustomFont.swift rename to modules/UI/Sources/Theme/Typography/CustomFont.swift diff --git a/modules/UI/Sources/Typography/FontWeight.swift b/modules/UI/Sources/Theme/Typography/FontWeight.swift similarity index 100% rename from modules/UI/Sources/Typography/FontWeight.swift rename to modules/UI/Sources/Theme/Typography/FontWeight.swift diff --git a/modules/UI/Sources/Typography/Roboto/LICENSE.txt b/modules/UI/Sources/Theme/Typography/Roboto/LICENSE.txt similarity index 98% rename from modules/UI/Sources/Typography/Roboto/LICENSE.txt rename to modules/UI/Sources/Theme/Typography/Roboto/LICENSE.txt index 75b5248..d645695 100644 --- a/modules/UI/Sources/Typography/Roboto/LICENSE.txt +++ b/modules/UI/Sources/Theme/Typography/Roboto/LICENSE.txt @@ -1,202 +1,202 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/modules/UI/Sources/Typography/Roboto/Roboto-Black.ttf b/modules/UI/Sources/Theme/Typography/Roboto/Roboto-Black.ttf similarity index 100% rename from modules/UI/Sources/Typography/Roboto/Roboto-Black.ttf rename to modules/UI/Sources/Theme/Typography/Roboto/Roboto-Black.ttf diff --git a/modules/UI/Sources/Typography/Roboto/Roboto-BlackItalic.ttf b/modules/UI/Sources/Theme/Typography/Roboto/Roboto-BlackItalic.ttf similarity index 100% rename from modules/UI/Sources/Typography/Roboto/Roboto-BlackItalic.ttf rename to modules/UI/Sources/Theme/Typography/Roboto/Roboto-BlackItalic.ttf diff --git a/modules/UI/Sources/Typography/Roboto/Roboto-Bold.ttf b/modules/UI/Sources/Theme/Typography/Roboto/Roboto-Bold.ttf similarity index 100% rename from modules/UI/Sources/Typography/Roboto/Roboto-Bold.ttf rename to modules/UI/Sources/Theme/Typography/Roboto/Roboto-Bold.ttf diff --git a/modules/UI/Sources/Typography/Roboto/Roboto-BoldItalic.ttf b/modules/UI/Sources/Theme/Typography/Roboto/Roboto-BoldItalic.ttf similarity index 100% rename from modules/UI/Sources/Typography/Roboto/Roboto-BoldItalic.ttf rename to modules/UI/Sources/Theme/Typography/Roboto/Roboto-BoldItalic.ttf diff --git a/modules/UI/Sources/Typography/Roboto/Roboto-Italic.ttf b/modules/UI/Sources/Theme/Typography/Roboto/Roboto-Italic.ttf similarity index 100% rename from modules/UI/Sources/Typography/Roboto/Roboto-Italic.ttf rename to modules/UI/Sources/Theme/Typography/Roboto/Roboto-Italic.ttf diff --git a/modules/UI/Sources/Typography/Roboto/Roboto-Light.ttf b/modules/UI/Sources/Theme/Typography/Roboto/Roboto-Light.ttf similarity index 100% rename from modules/UI/Sources/Typography/Roboto/Roboto-Light.ttf rename to modules/UI/Sources/Theme/Typography/Roboto/Roboto-Light.ttf diff --git a/modules/UI/Sources/Typography/Roboto/Roboto-LightItalic.ttf b/modules/UI/Sources/Theme/Typography/Roboto/Roboto-LightItalic.ttf similarity index 100% rename from modules/UI/Sources/Typography/Roboto/Roboto-LightItalic.ttf rename to modules/UI/Sources/Theme/Typography/Roboto/Roboto-LightItalic.ttf diff --git a/modules/UI/Sources/Typography/Roboto/Roboto-Medium.ttf b/modules/UI/Sources/Theme/Typography/Roboto/Roboto-Medium.ttf similarity index 100% rename from modules/UI/Sources/Typography/Roboto/Roboto-Medium.ttf rename to modules/UI/Sources/Theme/Typography/Roboto/Roboto-Medium.ttf diff --git a/modules/UI/Sources/Typography/Roboto/Roboto-MediumItalic.ttf b/modules/UI/Sources/Theme/Typography/Roboto/Roboto-MediumItalic.ttf similarity index 100% rename from modules/UI/Sources/Typography/Roboto/Roboto-MediumItalic.ttf rename to modules/UI/Sources/Theme/Typography/Roboto/Roboto-MediumItalic.ttf diff --git a/modules/UI/Sources/Typography/Roboto/Roboto-Regular.ttf b/modules/UI/Sources/Theme/Typography/Roboto/Roboto-Regular.ttf similarity index 100% rename from modules/UI/Sources/Typography/Roboto/Roboto-Regular.ttf rename to modules/UI/Sources/Theme/Typography/Roboto/Roboto-Regular.ttf diff --git a/modules/UI/Sources/Typography/Roboto/Roboto-Thin.ttf b/modules/UI/Sources/Theme/Typography/Roboto/Roboto-Thin.ttf similarity index 100% rename from modules/UI/Sources/Typography/Roboto/Roboto-Thin.ttf rename to modules/UI/Sources/Theme/Typography/Roboto/Roboto-Thin.ttf diff --git a/modules/UI/Sources/Typography/Roboto/Roboto-ThinItalic.ttf b/modules/UI/Sources/Theme/Typography/Roboto/Roboto-ThinItalic.ttf similarity index 100% rename from modules/UI/Sources/Typography/Roboto/Roboto-ThinItalic.ttf rename to modules/UI/Sources/Theme/Typography/Roboto/Roboto-ThinItalic.ttf diff --git a/modules/UI/Sources/Typography/ScaledFontModifier.swift b/modules/UI/Sources/Theme/Typography/ScaledFontModifier.swift similarity index 100% rename from modules/UI/Sources/Typography/ScaledFontModifier.swift rename to modules/UI/Sources/Theme/Typography/ScaledFontModifier.swift diff --git a/modules/UI/Sources/Typography/TextStyleable.swift b/modules/UI/Sources/Theme/Typography/TextStyleable.swift similarity index 100% rename from modules/UI/Sources/Typography/TextStyleable.swift rename to modules/UI/Sources/Theme/Typography/TextStyleable.swift diff --git a/modules/UI/Sources/Typography/TypographyStyle.swift b/modules/UI/Sources/Theme/Typography/TypographyStyle.swift similarity index 100% rename from modules/UI/Sources/Typography/TypographyStyle.swift rename to modules/UI/Sources/Theme/Typography/TypographyStyle.swift diff --git a/modules/UI/UI.xcodeproj/project.pbxproj b/modules/UI/UI.xcodeproj/project.pbxproj index 3c3d28c..3c456c0 100644 --- a/modules/UI/UI.xcodeproj/project.pbxproj +++ b/modules/UI/UI.xcodeproj/project.pbxproj @@ -17,10 +17,10 @@ B28795C328FD002E00614653 /* IconName.swift in Sources */ = {isa = PBXBuildFile; fileRef = B28795C228FD002E00614653 /* IconName.swift */; }; B28795C528FD012D00614653 /* Icons.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B28795C428FD012D00614653 /* Icons.xcassets */; }; B28795C828FD0D0900614653 /* IconSampleView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B28795C728FD0D0900614653 /* IconSampleView.swift */; }; - B2A5EFF128BF52C500F3E391 /* Colors.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B2A5EFF028BF52C500F3E391 /* Colors.xcassets */; }; - B2A5EFF328BF534D00F3E391 /* Colors.swift in Sources */ = {isa = PBXBuildFile; fileRef = B2A5EFF228BF534D00F3E391 /* Colors.swift */; }; - B2FCC69C28CB2FCA0091A202 /* ThemeColors.swift in Sources */ = {isa = PBXBuildFile; fileRef = B2FCC69B28CB2FCA0091A202 /* ThemeColors.swift */; }; - B2FCC69E28CB2FD90091A202 /* ThemeColors.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B2FCC69D28CB2FD90091A202 /* ThemeColors.xcassets */; }; + B2A5EFF128BF52C500F3E391 /* ColorPalette.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B2A5EFF028BF52C500F3E391 /* ColorPalette.xcassets */; }; + B2A5EFF328BF534D00F3E391 /* ColorPalette.swift in Sources */ = {isa = PBXBuildFile; fileRef = B2A5EFF228BF534D00F3E391 /* ColorPalette.swift */; }; + B2FCC69C28CB2FCA0091A202 /* Colors.swift in Sources */ = {isa = PBXBuildFile; fileRef = B2FCC69B28CB2FCA0091A202 /* Colors.swift */; }; + B2FCC69E28CB2FD90091A202 /* Colors.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B2FCC69D28CB2FD90091A202 /* Colors.xcassets */; }; B2FCC6DA28CB3B420091A202 /* UISampleApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = B2FCC6D928CB3B420091A202 /* UISampleApp.swift */; }; B2FCC6DC28CB3B420091A202 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B2FCC6DB28CB3B420091A202 /* ContentView.swift */; }; B2FCC6DE28CB3B440091A202 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B2FCC6DD28CB3B440091A202 /* Assets.xcassets */; }; @@ -114,10 +114,10 @@ B28795C228FD002E00614653 /* IconName.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IconName.swift; sourceTree = ""; }; B28795C428FD012D00614653 /* Icons.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Icons.xcassets; sourceTree = ""; }; B28795C728FD0D0900614653 /* IconSampleView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IconSampleView.swift; sourceTree = ""; }; - B2A5EFF028BF52C500F3E391 /* Colors.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Colors.xcassets; sourceTree = ""; }; - B2A5EFF228BF534D00F3E391 /* Colors.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Colors.swift; sourceTree = ""; }; - B2FCC69B28CB2FCA0091A202 /* ThemeColors.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ThemeColors.swift; sourceTree = ""; }; - B2FCC69D28CB2FD90091A202 /* ThemeColors.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = ThemeColors.xcassets; sourceTree = ""; }; + B2A5EFF028BF52C500F3E391 /* ColorPalette.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = ColorPalette.xcassets; sourceTree = ""; }; + B2A5EFF228BF534D00F3E391 /* ColorPalette.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ColorPalette.swift; sourceTree = ""; }; + B2FCC69B28CB2FCA0091A202 /* Colors.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Colors.swift; sourceTree = ""; }; + B2FCC69D28CB2FD90091A202 /* Colors.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Colors.xcassets; sourceTree = ""; }; B2FCC6D728CB3B420091A202 /* UISample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = UISample.app; sourceTree = BUILT_PRODUCTS_DIR; }; B2FCC6D928CB3B420091A202 /* UISampleApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UISampleApp.swift; sourceTree = ""; }; B2FCC6DB28CB3B420091A202 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; @@ -261,6 +261,9 @@ isa = PBXGroup; children = ( B2A5EFEF28BF52A300F3E391 /* Colors */, + B2FCC70628CB41470091A202 /* Dimension */, + B28795C128FD001A00614653 /* Image */, + B2FCC70928D45CDC0091A202 /* Typography */, ); path = Theme; sourceTree = ""; @@ -268,10 +271,10 @@ B2A5EFEF28BF52A300F3E391 /* Colors */ = { isa = PBXGroup; children = ( - B2A5EFF028BF52C500F3E391 /* Colors.xcassets */, - B2FCC69D28CB2FD90091A202 /* ThemeColors.xcassets */, - B2A5EFF228BF534D00F3E391 /* Colors.swift */, - B2FCC69B28CB2FCA0091A202 /* ThemeColors.swift */, + B2A5EFF028BF52C500F3E391 /* ColorPalette.xcassets */, + B2FCC69D28CB2FD90091A202 /* Colors.xcassets */, + B2A5EFF228BF534D00F3E391 /* ColorPalette.swift */, + B2FCC69B28CB2FCA0091A202 /* Colors.swift */, ); path = Colors; sourceTree = ""; @@ -387,9 +390,6 @@ E604932228A22E60005C737A /* Sources */ = { isa = PBXGroup; children = ( - B28795C128FD001A00614653 /* Image */, - B2FCC70928D45CDC0091A202 /* Typography */, - B2FCC70628CB41470091A202 /* Dimension */, B2A5EFEE28BF529D00F3E391 /* Theme */, E604932328A22E60005C737A /* UI.h */, E674B1F528B74EE500C689A2 /* UI.swift */, @@ -597,8 +597,8 @@ B2FCC72228D4643B0091A202 /* LICENSE.txt in Resources */, B2FCC72628D4643B0091A202 /* Roboto-Black.ttf in Resources */, B2FCC72428D4643B0091A202 /* Roboto-Bold.ttf in Resources */, - B2A5EFF128BF52C500F3E391 /* Colors.xcassets in Resources */, - B2FCC69E28CB2FD90091A202 /* ThemeColors.xcassets in Resources */, + B2A5EFF128BF52C500F3E391 /* ColorPalette.xcassets in Resources */, + B2FCC69E28CB2FD90091A202 /* Colors.xcassets in Resources */, B2FCC71F28D4643B0091A202 /* Roboto-BoldItalic.ttf in Resources */, B2FCC71C28D4643B0091A202 /* Roboto-Regular.ttf in Resources */, B2FCC71E28D4643B0091A202 /* Roboto-ThinItalic.ttf in Resources */, @@ -704,7 +704,7 @@ buildActionMask = 2147483647; files = ( B2FCC70B28D45D220091A202 /* TypographyStyle.swift in Sources */, - B2A5EFF328BF534D00F3E391 /* Colors.swift in Sources */, + B2A5EFF328BF534D00F3E391 /* ColorPalette.swift in Sources */, B205719A28E152110076EC9E /* FontWeight.swift in Sources */, B205719828E151B50076EC9E /* ScaledFontModifier.swift in Sources */, B2FCC70828CB41570091A202 /* Dimensions.swift in Sources */, @@ -712,7 +712,7 @@ B28795C328FD002E00614653 /* IconName.swift in Sources */, B205719C28E1524B0076EC9E /* TextStyleable.swift in Sources */, E674B1F628B74EE500C689A2 /* UI.swift in Sources */, - B2FCC69C28CB2FCA0091A202 /* ThemeColors.swift in Sources */, + B2FCC69C28CB2FCA0091A202 /* Colors.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/modules/UI/UISample/Color/ColorSampleView.swift b/modules/UI/UISample/Color/ColorSampleView.swift index 09b824e..b81ecb2 100644 --- a/modules/UI/UISample/Color/ColorSampleView.swift +++ b/modules/UI/UISample/Color/ColorSampleView.swift @@ -12,13 +12,13 @@ struct ColorSampleView: View { var body: some View { VStack { Text("Test ColorName with dynamic color") - .foregroundColor(Colors.blue.color) + .foregroundColor(ColorPalette.blue.color) Text("Test ColorName with solid color") - .foregroundColor(Colors.teal200.color) + .foregroundColor(ColorPalette.teal200.color) Text("Test ThemeColors") - .foregroundColor(ThemeColors.primary.color) + .foregroundColor(Colors.primary.color) } } } diff --git a/modules/UI/UISample/Dimension/DimensionSampleView.swift b/modules/UI/UISample/Dimension/DimensionSampleView.swift index 4fbd823..8e0a3f0 100644 --- a/modules/UI/UISample/Dimension/DimensionSampleView.swift +++ b/modules/UI/UISample/Dimension/DimensionSampleView.swift @@ -13,15 +13,15 @@ struct DimensionSampleView: View { VStack(spacing: .smallSpacing) { Text("Test ColorName with dynamic color") .padding(.bottom, .smallPadding) - .foregroundColor(Colors.blue.color) + .foregroundColor(ColorPalette.blue.color) Text("Test ColorName with solid color") .padding(.bottom, .standardPadding) - .foregroundColor(Colors.teal200.color) + .foregroundColor(ColorPalette.teal200.color) Text("Test ThemeColors") .padding() - .foregroundColor(ThemeColors.primary.color) + .foregroundColor(Colors.primary.color) } } } diff --git a/modules/UI/UISample/Icon/IconSampleView.swift b/modules/UI/UISample/Icon/IconSampleView.swift index 392a3af..1dbdff5 100644 --- a/modules/UI/UISample/Icon/IconSampleView.swift +++ b/modules/UI/UISample/Icon/IconSampleView.swift @@ -16,7 +16,7 @@ struct IconSampleView: View { Label { Text("Settings icon") } icon: { - Image(IconName.commonIconSetting) + Image(.commonIconSetting) } HStack { Button { diff --git a/modules/UI/UISample/Typography/TypographySampleView.swift b/modules/UI/UISample/Typography/TypographySampleView.swift index c718c82..730ead6 100644 --- a/modules/UI/UISample/Typography/TypographySampleView.swift +++ b/modules/UI/UISample/Typography/TypographySampleView.swift @@ -14,18 +14,19 @@ struct TypographySampleView: View { VStack(alignment: .leading) { Text("Header Content") .typographyStyle(as: .h5) + .foregroundColor(Colors.onBackground.color) Text("Subtitle Content") .typographyStyle(as: .subtitle1) - .foregroundColor(Colors.gray900.color) + .foregroundColor(Colors.onBackground.color) } Spacer() Text("Custom Font") .scaledFont(fontWeight: .thinItalic, size: 20) - .foregroundColor(Colors.gray600.color) - }.padding(.standardPadding) + .foregroundColor(Colors.onBackground.color) + }.foregroundColor(Colors.background.color).padding(.standardPadding) } }