From 0860589fc2b9a8bca2fd28f443dbb2e633713ea4 Mon Sep 17 00:00:00 2001 From: Robin Lemaire Date: Wed, 26 Jul 2023 16:03:00 +0200 Subject: [PATCH] [Colors] Rename some colors --- core/Demo/Classes/ContentView.swift | 2 +- .../BadgeGetIntentColorsUseCase.swift | 8 +- .../BadgeGetIntentColorsUseCaseTests.swift | 8 +- .../Badge/View/UIKit/BadgeUIViewTests.swift | 4 +- .../Internal/Colors/ButtonColorsTests.swift | 14 +-- .../ButtonCurrentColorsTests.swift | 8 +- .../ButtonGetColorsUseCaseTests.swift | 2 +- .../ButtonGetVariantContrastUseCase.swift | 8 +- ...ButtonGetVariantContrastUseCaseTests.swift | 12 +- .../ButtonGetVariantFilledUseCase.swift | 12 +- .../ButtonGetVariantFilledUseCaseTests.swift | 16 +-- .../ButtonGetVariantGhostUseCase.swift | 8 +- .../ButtonGetVariantGhostUseCaseTests.swift | 12 +- .../ButtonGetVariantOutlinedUseCase.swift | 16 +-- ...ButtonGetVariantOutlinedUseCaseTests.swift | 20 ++-- .../ButtonGetVariantTintedUseCase.swift | 12 +- .../ButtonGetVariantTintedUseCaseTests.swift | 16 +-- .../ButtonGetVariantUseCaseTests.swift | 4 +- .../Button/View/UIKit/ButtonUIViewTests.swift | 6 +- .../CheckboxStateColorsUseCase.swift | 6 +- .../CheckboxStateColorsUseCaseTests.swift | 20 ++-- .../View/CheckboxViewModelTests.swift | 2 +- .../UseCase/GetChipIntentColorsUseCase.swift | 16 +-- .../GetChipIntentColorsUseCaseTests.swift | 28 ++--- .../Icon/UseCase/IconGetColorUseCase.swift | 4 +- .../UseCase/IconGetColorUseCaseTests.swift | 4 +- .../GetRadioButtonColorsUseCase.swift | 6 +- .../GetRadioButtonColorsUseCaseTests.swift | 44 ++++---- .../GetRadioButtonGroupColorUseCase.swift | 4 +- ...GetRadioButtonGroupColorUseCaseTests.swift | 12 +- .../GetSpinnerIntentColorUseCase.swift | 4 +- .../GetSpinnerIntentColorUseCaseTests.swift | 4 +- .../Internal/Colors/SwitchColorsTests.swift | 24 ++-- .../Colors/SwitchStatusColorsTests.swift | 4 +- .../GetColor/SwitchGetColorUseCase.swift | 4 +- .../GetColor/SwitchGetColorUseCaseTests.swift | 18 +-- .../Tag/Model/Colors/TagColorsTests.swift | 8 +- .../ContentColors/TagContentColorsTests.swift | 16 +-- .../TagGetContentColorsUseCase.swift | 16 +-- .../TagGetIntentColorsUseCaseTests.swift | 16 +-- .../Theming/Content/Colors/Colors.swift | 4 +- .../Content/Colors/ColorsDefault.swift | 12 +- .../ColorsGeneratedMock+ExtensionTests.swift | 4 +- .../Colors/Content/Main/ColorsMain.swift | 17 +++ .../Content/Main/ColorsMainDefault.swift | 35 ++++++ ...lorsMainGeneratedMock+ExtensionTests.swift | 29 +++++ .../Content/Primary/ColorsPrimary.swift | 17 --- .../Primary/ColorsPrimaryDefault.swift | 35 ------ ...sPrimaryGeneratedMock+ExtensionTests.swift | 29 ----- .../Content/Secondary/ColorsSecondary.swift | 17 --- .../Secondary/ColorsSecondaryDefault.swift | 35 ------ ...econdaryGeneratedMock+ExtensionTests.swift | 29 ----- .../Colors/Content/States/ColorsStates.swift | 16 +-- .../Content/States/ColorsStatesDefault.swift | 36 +++--- ...rsStatesGeneratedMock+ExtensionTests.swift | 12 +- .../Content/Support/ColorsSupport.swift | 17 +++ .../Support/ColorsSupportDefault.swift | 35 ++++++ ...sSupportGeneratedMock+ExtensionTests.swift | 29 +++++ core/Unit-tests/ColorTests.swift | 22 +++- spark/Demo/Classes/Main/MainView.swift | 2 +- .../RadioButtonGroupState-Extension.swift | 2 +- .../Switch/SwitchComponentItemsUIView.swift | 2 +- .../Sections/Enum/ColorSectionType.swift | 4 +- .../ViewModel/ColorSectionMainViewModel.swift | 32 ++++++ .../ColorSectionPrimaryViewModel.swift | 32 ------ .../ColorSectionSecondaryViewModel.swift | 32 ------ .../ColorSectionStatesViewModel.swift | 12 +- .../ColorSectionSupportViewModel.swift | 32 ++++++ .../{Primary => Main}/Contents.json | 0 .../main-container.colorset}/Contents.json | 0 .../main-variant.colorset}/Contents.json | 0 .../main.colorset}/Contents.json | 0 .../on-main-container.colorset}/Contents.json | 0 .../on-main-variant.colorset}/Contents.json | 0 .../on-main.colorset}/Contents.json | 0 .../Contents.json | 0 .../Contents.json | 0 .../Contents.json | 0 .../Contents.json | 0 .../Contents.json | 0 .../Contents.json | 0 .../{Secondary => Support}/Contents.json | 0 .../Contents.json | 0 .../Contents.json | 0 .../on-support.colorset}/Contents.json | 0 .../support-container.colorset}/Contents.json | 0 .../support-variant.colorset}/Contents.json | 0 .../support.colorset}/Contents.json | 0 .../Generated/Colors+Generated.swift | 106 ------------------ .../{Primary => Main}/Contents.json | 0 .../purple-main.colorset}/Contents.json | 0 .../Contents.json | 0 .../Contents.json | 0 .../purple-onMain.colorset}/Contents.json | 0 .../Contents.json | 0 .../Contents.json | 0 .../Contents.json | 0 .../Contents.json | 0 .../Contents.json | 0 .../Contents.json | 0 .../Contents.json | 0 .../Contents.json | 0 .../{Secondary => Support}/Contents.json | 0 .../purple-onSupport.colorset}/Contents.json | 0 .../Contents.json | 0 .../Contents.json | 0 .../purple-support.colorset}/Contents.json | 0 .../Contents.json | 0 .../Contents.json | 0 .../Sources/Theming/Content/SparkColors.swift | 40 +++---- .../Theming/PurpleContent/PurpleColors.swift | 40 +++---- 111 files changed, 559 insertions(+), 655 deletions(-) create mode 100644 core/Sources/Theming/Content/Colors/Content/Main/ColorsMain.swift create mode 100644 core/Sources/Theming/Content/Colors/Content/Main/ColorsMainDefault.swift create mode 100644 core/Sources/Theming/Content/Colors/Content/Main/ColorsMainGeneratedMock+ExtensionTests.swift delete mode 100644 core/Sources/Theming/Content/Colors/Content/Primary/ColorsPrimary.swift delete mode 100644 core/Sources/Theming/Content/Colors/Content/Primary/ColorsPrimaryDefault.swift delete mode 100644 core/Sources/Theming/Content/Colors/Content/Primary/ColorsPrimaryGeneratedMock+ExtensionTests.swift delete mode 100644 core/Sources/Theming/Content/Colors/Content/Secondary/ColorsSecondary.swift delete mode 100644 core/Sources/Theming/Content/Colors/Content/Secondary/ColorsSecondaryDefault.swift delete mode 100644 core/Sources/Theming/Content/Colors/Content/Secondary/ColorsSecondaryGeneratedMock+ExtensionTests.swift create mode 100644 core/Sources/Theming/Content/Colors/Content/Support/ColorsSupport.swift create mode 100644 core/Sources/Theming/Content/Colors/Content/Support/ColorsSupportDefault.swift create mode 100644 core/Sources/Theming/Content/Colors/Content/Support/ColorsSupportGeneratedMock+ExtensionTests.swift create mode 100644 spark/Demo/Classes/View/Theme/Color/Sections/ViewModel/ColorSectionMainViewModel.swift delete mode 100644 spark/Demo/Classes/View/Theme/Color/Sections/ViewModel/ColorSectionPrimaryViewModel.swift delete mode 100644 spark/Demo/Classes/View/Theme/Color/Sections/ViewModel/ColorSectionSecondaryViewModel.swift create mode 100644 spark/Demo/Classes/View/Theme/Color/Sections/ViewModel/ColorSectionSupportViewModel.swift rename spark/Sources/Resources/Colors.xcassets/{Primary => Main}/Contents.json (100%) rename spark/Sources/Resources/Colors.xcassets/{Primary/primary-container.colorset => Main/main-container.colorset}/Contents.json (100%) rename spark/Sources/Resources/Colors.xcassets/{Primary/on-primary-container.colorset => Main/main-variant.colorset}/Contents.json (100%) rename spark/Sources/Resources/Colors.xcassets/{Primary/primary.colorset => Main/main.colorset}/Contents.json (100%) rename spark/Sources/Resources/Colors.xcassets/{Primary/primary-variant.colorset => Main/on-main-container.colorset}/Contents.json (100%) rename spark/Sources/Resources/Colors.xcassets/{Primary/on-primary-variant.colorset => Main/on-main-variant.colorset}/Contents.json (100%) rename spark/Sources/Resources/Colors.xcassets/{Primary/on-primary.colorset => Main/on-main.colorset}/Contents.json (100%) rename spark/Sources/Resources/Colors.xcassets/States/{primary-container-pressed.colorset => main-container-pressed.colorset}/Contents.json (100%) rename spark/Sources/Resources/Colors.xcassets/States/{primary-pressed.colorset => main-pressed.colorset}/Contents.json (100%) rename spark/Sources/Resources/Colors.xcassets/States/{primary-variant-pressed.colorset => main-variant-pressed.colorset}/Contents.json (100%) rename spark/Sources/Resources/Colors.xcassets/States/{secondary-container-pressed.colorset => support-container-pressed.colorset}/Contents.json (100%) rename spark/Sources/Resources/Colors.xcassets/States/{secondary-pressed.colorset => support-pressed.colorset}/Contents.json (100%) rename spark/Sources/Resources/Colors.xcassets/States/{secondary-variant-pressed.colorset => support-variant-pressed.colorset}/Contents.json (100%) rename spark/Sources/Resources/Colors.xcassets/{Secondary => Support}/Contents.json (100%) rename spark/Sources/Resources/Colors.xcassets/{Secondary/on-secondary-container.colorset => Support/on-support-container.colorset}/Contents.json (100%) rename spark/Sources/Resources/Colors.xcassets/{Secondary/on-secondary-variant.colorset => Support/on-support-variant.colorset}/Contents.json (100%) rename spark/Sources/Resources/Colors.xcassets/{Secondary/on-secondary.colorset => Support/on-support.colorset}/Contents.json (100%) rename spark/Sources/Resources/Colors.xcassets/{Secondary/secondary-container.colorset => Support/support-container.colorset}/Contents.json (100%) rename spark/Sources/Resources/Colors.xcassets/{Secondary/secondary-variant.colorset => Support/support-variant.colorset}/Contents.json (100%) rename spark/Sources/Resources/Colors.xcassets/{Secondary/secondary.colorset => Support/support.colorset}/Contents.json (100%) delete mode 100644 spark/Sources/Resources/Generated/Colors+Generated.swift rename spark/Sources/Resources/PurpleColors.xcassets/{Primary => Main}/Contents.json (100%) rename spark/Sources/Resources/PurpleColors.xcassets/{Primary/purple-primary.colorset => Main/purple-main.colorset}/Contents.json (100%) rename spark/Sources/Resources/PurpleColors.xcassets/{Primary/purple-primaryContainer.colorset => Main/purple-mainContainer.colorset}/Contents.json (100%) rename spark/Sources/Resources/PurpleColors.xcassets/{Primary/purple-primaryVariant.colorset => Main/purple-mainVariant.colorset}/Contents.json (100%) rename spark/Sources/Resources/PurpleColors.xcassets/{Primary/purple-onPrimary.colorset => Main/purple-onMain.colorset}/Contents.json (100%) rename spark/Sources/Resources/PurpleColors.xcassets/{Primary/purple-onPrimaryContainer.colorset => Main/purple-onMainContainer.colorset}/Contents.json (100%) rename spark/Sources/Resources/PurpleColors.xcassets/{Primary/purple-onPrimaryVariant.colorset => Main/purple-onMainVariant.colorset}/Contents.json (100%) rename spark/Sources/Resources/PurpleColors.xcassets/States/{purple-primaryContainerPressed.colorset => purple-mainContainerPressed.colorset}/Contents.json (100%) rename spark/Sources/Resources/PurpleColors.xcassets/States/{purple-primaryPressed.colorset => purple-mainPressed.colorset}/Contents.json (100%) rename spark/Sources/Resources/PurpleColors.xcassets/States/{purple-primaryVariantPressed.colorset => purple-mainVariantPressed.colorset}/Contents.json (100%) rename spark/Sources/Resources/PurpleColors.xcassets/States/{purple-secondaryContainerPressed.colorset => purple-supportContainerPressed.colorset}/Contents.json (100%) rename spark/Sources/Resources/PurpleColors.xcassets/States/{purple-secondaryPressed.colorset => purple-supportPressed.colorset}/Contents.json (100%) rename spark/Sources/Resources/PurpleColors.xcassets/States/{purple-secondaryVariantPressed.colorset => purple-supportVariantPressed.colorset}/Contents.json (100%) rename spark/Sources/Resources/PurpleColors.xcassets/{Secondary => Support}/Contents.json (100%) rename spark/Sources/Resources/PurpleColors.xcassets/{Secondary/purple-onSecondary.colorset => Support/purple-onSupport.colorset}/Contents.json (100%) rename spark/Sources/Resources/PurpleColors.xcassets/{Secondary/purple-onSecondaryContainer.colorset => Support/purple-onSupportContainer.colorset}/Contents.json (100%) rename spark/Sources/Resources/PurpleColors.xcassets/{Secondary/purple-onSecondaryVariant.colorset => Support/purple-onSupportVariant.colorset}/Contents.json (100%) rename spark/Sources/Resources/PurpleColors.xcassets/{Secondary/purple-secondary.colorset => Support/purple-support.colorset}/Contents.json (100%) rename spark/Sources/Resources/PurpleColors.xcassets/{Secondary/purple-secondaryContainer.colorset => Support/purple-supportContainer.colorset}/Contents.json (100%) rename spark/Sources/Resources/PurpleColors.xcassets/{Secondary/purple-secondaryVariant.colorset => Support/purple-supportVariant.colorset}/Contents.json (100%) diff --git a/core/Demo/Classes/ContentView.swift b/core/Demo/Classes/ContentView.swift index e69e84e94..41418a147 100644 --- a/core/Demo/Classes/ContentView.swift +++ b/core/Demo/Classes/ContentView.swift @@ -17,7 +17,7 @@ struct ContentView: View { VStack { Image(systemName: "globe") .imageScale(.large) - .foregroundColor(theme.colors.secondary.secondary.color) + .foregroundColor(theme.colors.support.support.color) Text("Hello, Spark Core Demo!") .font(theme.typography.display1.font) } diff --git a/core/Sources/Components/Badge/UseCase/GetIntentColors/BadgeGetIntentColorsUseCase.swift b/core/Sources/Components/Badge/UseCase/GetIntentColors/BadgeGetIntentColorsUseCase.swift index d49b61896..d7436681d 100644 --- a/core/Sources/Components/Badge/UseCase/GetIntentColors/BadgeGetIntentColorsUseCase.swift +++ b/core/Sources/Components/Badge/UseCase/GetIntentColors/BadgeGetIntentColorsUseCase.swift @@ -49,15 +49,15 @@ final class BadgeGetIntentColorsUseCase: BadgeGetIntentColorsUseCaseable { ) case .primary: return BadgeColors( - backgroundColor: colors.primary.primary, + backgroundColor: colors.main.main, borderColor: surfaceColor, - foregroundColor: colors.primary.onPrimary + foregroundColor: colors.main.onMain ) case .secondary: return BadgeColors( - backgroundColor: colors.secondary.secondary, + backgroundColor: colors.support.support, borderColor: surfaceColor, - foregroundColor: colors.secondary.onSecondary + foregroundColor: colors.support.onSupport ) case .success: return BadgeColors( diff --git a/core/Sources/Components/Badge/UseCase/GetIntentColors/BadgeGetIntentColorsUseCaseTests.swift b/core/Sources/Components/Badge/UseCase/GetIntentColors/BadgeGetIntentColorsUseCaseTests.swift index 1096e588a..b468e6a4b 100644 --- a/core/Sources/Components/Badge/UseCase/GetIntentColors/BadgeGetIntentColorsUseCaseTests.swift +++ b/core/Sources/Components/Badge/UseCase/GetIntentColors/BadgeGetIntentColorsUseCaseTests.swift @@ -47,15 +47,15 @@ final class BadgeGetColorsUseCaseTests: XCTestCase { ), .init( givenIntent: .primary, - expectedBackgroundToken: mockedExpectedColors.primary.primary, + expectedBackgroundToken: mockedExpectedColors.main.main, expectedBorderToken: mockedExpectedSurfaceColor, - expectedTextToken: mockedExpectedColors.primary.onPrimary + expectedTextToken: mockedExpectedColors.main.onMain ), .init( givenIntent: .secondary, - expectedBackgroundToken: mockedExpectedColors.secondary.secondary, + expectedBackgroundToken: mockedExpectedColors.support.support, expectedBorderToken: mockedExpectedSurfaceColor, - expectedTextToken: mockedExpectedColors.secondary.onSecondary + expectedTextToken: mockedExpectedColors.support.onSupport ), .init( givenIntent: .success, diff --git a/core/Sources/Components/Badge/View/UIKit/BadgeUIViewTests.swift b/core/Sources/Components/Badge/View/UIKit/BadgeUIViewTests.swift index 3707b9acc..887931d86 100644 --- a/core/Sources/Components/Badge/View/UIKit/BadgeUIViewTests.swift +++ b/core/Sources/Components/Badge/View/UIKit/BadgeUIViewTests.swift @@ -124,9 +124,9 @@ final class BadgeUIViewTests: UIKitComponentTestCase { private func createAttachTestView(badge: BadgeUIView, position: BadgePosition) -> UIView { let containerView = UIView(frame: .init(x: 0, y: 0, width: 200, height: 200)) - containerView.backgroundColor = self.theme.colors.primary.primaryContainer.uiColor + containerView.backgroundColor = self.theme.colors.main.mainContainer.uiColor let view = UIView(frame: .init(x: 50, y: 50, width: 100, height: 100)) - view.backgroundColor = self.theme.colors.primary.primary.uiColor + view.backgroundColor = self.theme.colors.main.main.uiColor view.layer.cornerRadius = self.theme.border.radius.small containerView.addSubview(view) containerView.addSubview(badge) diff --git a/core/Sources/Components/Button/Properties/Internal/Colors/ButtonColorsTests.swift b/core/Sources/Components/Button/Properties/Internal/Colors/ButtonColorsTests.swift index 5a2601727..7184a4cc9 100644 --- a/core/Sources/Components/Button/Properties/Internal/Colors/ButtonColorsTests.swift +++ b/core/Sources/Components/Button/Properties/Internal/Colors/ButtonColorsTests.swift @@ -17,17 +17,17 @@ final class ButtonColorsTests: XCTestCase { func test_buttonColors_equal() { let colors = SparkTheme.shared.colors let given1 = ButtonColors( - foregroundColor: colors.primary.primary, + foregroundColor: colors.main.main, backgroundColor: colors.base.background, pressedBackgroundColor: colors.base.backgroundVariant, borderColor: colors.base.background, - pressedBorderColor: colors.states.primaryPressed) + pressedBorderColor: colors.states.mainPressed) let given2 = ButtonColors( - foregroundColor: colors.primary.primary, + foregroundColor: colors.main.main, backgroundColor: colors.base.background, pressedBackgroundColor: colors.base.backgroundVariant, borderColor: colors.base.background, - pressedBorderColor: colors.states.primaryPressed) + pressedBorderColor: colors.states.mainPressed) XCTAssertEqual(given1, given2) } @@ -35,13 +35,13 @@ final class ButtonColorsTests: XCTestCase { func test_buttonColors_not_equal() { let colors = SparkTheme.shared.colors let given1 = ButtonColors( - foregroundColor: colors.primary.primary, + foregroundColor: colors.main.main, backgroundColor: colors.base.background, pressedBackgroundColor: colors.base.backgroundVariant, borderColor: colors.base.background, - pressedBorderColor: colors.states.primaryPressed) + pressedBorderColor: colors.states.mainPressed) let given2 = ButtonColors( - foregroundColor: colors.primary.primary, + foregroundColor: colors.main.main, backgroundColor: colors.base.background, pressedBackgroundColor: colors.base.backgroundVariant, borderColor: colors.base.background, diff --git a/core/Sources/Components/Button/Properties/Internal/CurrentColors/ButtonCurrentColorsTests.swift b/core/Sources/Components/Button/Properties/Internal/CurrentColors/ButtonCurrentColorsTests.swift index 751b77e36..a3cbe3ffc 100644 --- a/core/Sources/Components/Button/Properties/Internal/CurrentColors/ButtonCurrentColorsTests.swift +++ b/core/Sources/Components/Button/Properties/Internal/CurrentColors/ButtonCurrentColorsTests.swift @@ -21,13 +21,13 @@ final class ButtonCurrentColorsTests: XCTestCase { iconTintColor: colors.base.onSurface, textColor: colors.base.onSurfaceInverse, backgroundColor: colors.base.backgroundVariant, - borderColor: colors.primary.primary) + borderColor: colors.main.main) let given2 = ButtonCurrentColors( iconTintColor: colors.base.onSurface, textColor: colors.base.onSurfaceInverse, backgroundColor: colors.base.backgroundVariant, - borderColor: colors.primary.primary) + borderColor: colors.main.main) XCTAssertEqual(given1, given2) } @@ -39,13 +39,13 @@ final class ButtonCurrentColorsTests: XCTestCase { iconTintColor: colors.base.surface, textColor: colors.base.surfaceInverse, backgroundColor: colors.base.backgroundVariant, - borderColor: colors.primary.primary) + borderColor: colors.main.main) let given2 = ButtonCurrentColors( iconTintColor: colors.base.onSurface, textColor: colors.base.onSurfaceInverse, backgroundColor: colors.base.backgroundVariant, - borderColor: colors.primary.onPrimary) + borderColor: colors.main.onMain) XCTAssertNotEqual(given1, given2) } diff --git a/core/Sources/Components/Button/UseCase/GetColors/ButtonGetColorsUseCaseTests.swift b/core/Sources/Components/Button/UseCase/GetColors/ButtonGetColorsUseCaseTests.swift index 653e99b49..8a0185601 100644 --- a/core/Sources/Components/Button/UseCase/GetColors/ButtonGetColorsUseCaseTests.swift +++ b/core/Sources/Components/Button/UseCase/GetColors/ButtonGetColorsUseCaseTests.swift @@ -34,7 +34,7 @@ final class ButtonGetColorsUseCaseTests: XCTestCase { for item in items { let themeColorsMock = ColorsGeneratedMock() - themeColorsMock.primary = ColorsPrimaryGeneratedMock.mocked() + themeColorsMock.main = ColorsMainGeneratedMock.mocked() themeColorsMock.states = ColorsStatesGeneratedMock.mocked() let dimsMock = DimsGeneratedMock.mocked() diff --git a/core/Sources/Components/Button/UseCase/GetVariants/ButtonGetVariantContrastUseCase.swift b/core/Sources/Components/Button/UseCase/GetVariants/ButtonGetVariantContrastUseCase.swift index 3e83d11b9..da7b4ccaa 100644 --- a/core/Sources/Components/Button/UseCase/GetVariants/ButtonGetVariantContrastUseCase.swift +++ b/core/Sources/Components/Button/UseCase/GetVariants/ButtonGetVariantContrastUseCase.swift @@ -24,17 +24,17 @@ struct ButtonVariantGetContrastUseCase: ButtonGetVariantUseCaseable { switch intent { case .primary: return .init( - foregroundColor: colors.primary.primary, + foregroundColor: colors.main.main, backgroundColor: backgroundColor, - pressedBackgroundColor: colors.states.primaryContainerPressed, + pressedBackgroundColor: colors.states.mainContainerPressed, borderColor: borderColor, pressedBorderColor: pressedBorderColor ) case .secondary: return .init( - foregroundColor: colors.secondary.secondary, + foregroundColor: colors.support.support, backgroundColor: backgroundColor, - pressedBackgroundColor: colors.states.secondaryContainerPressed, + pressedBackgroundColor: colors.states.supportContainerPressed, borderColor: borderColor, pressedBorderColor: pressedBorderColor ) diff --git a/core/Sources/Components/Button/UseCase/GetVariants/ButtonGetVariantContrastUseCaseTests.swift b/core/Sources/Components/Button/UseCase/GetVariants/ButtonGetVariantContrastUseCaseTests.swift index 16a0cac26..ab7273521 100644 --- a/core/Sources/Components/Button/UseCase/GetVariants/ButtonGetVariantContrastUseCaseTests.swift +++ b/core/Sources/Components/Button/UseCase/GetVariants/ButtonGetVariantContrastUseCaseTests.swift @@ -13,7 +13,7 @@ import SwiftUI final class ButtonVariantGetContrastUseCaseTests: ButtonVariantUseCaseTests { // MARK: - Tests - func test_primary_colors() throws { + func test_main_colors() throws { // Given let sut = self.sut() @@ -27,15 +27,15 @@ final class ButtonVariantGetContrastUseCaseTests: ButtonVariantUseCaseTests { colors.pressedBackgroundColor, colors.borderColor, colors.pressedBorderColor].map(\.color), - [self.theme.colors.primary.primary, + [self.theme.colors.main.main, self.theme.colors.base.surface, - self.theme.colors.states.primaryContainerPressed, + self.theme.colors.states.mainContainerPressed, ColorTokenDefault.clear, ColorTokenDefault.clear ].map(\.color)) } - func test_secondary_colors() throws { + func test_support_colors() throws { // Given let sut = self.sut() @@ -49,9 +49,9 @@ final class ButtonVariantGetContrastUseCaseTests: ButtonVariantUseCaseTests { colors.pressedBackgroundColor, colors.borderColor, colors.pressedBorderColor].map(\.color), - [self.theme.colors.secondary.secondary, + [self.theme.colors.support.support, self.theme.colors.base.surface, - self.theme.colors.states.secondaryContainerPressed, + self.theme.colors.states.supportContainerPressed, ColorTokenDefault.clear, ColorTokenDefault.clear ].map(\.color)) diff --git a/core/Sources/Components/Button/UseCase/GetVariants/ButtonGetVariantFilledUseCase.swift b/core/Sources/Components/Button/UseCase/GetVariants/ButtonGetVariantFilledUseCase.swift index dd37f7722..f68763c2a 100644 --- a/core/Sources/Components/Button/UseCase/GetVariants/ButtonGetVariantFilledUseCase.swift +++ b/core/Sources/Components/Button/UseCase/GetVariants/ButtonGetVariantFilledUseCase.swift @@ -23,17 +23,17 @@ struct ButtonGetVariantFilledUseCase: ButtonGetVariantUseCaseable { switch intent { case .primary: return .init( - foregroundColor: colors.primary.onPrimary, - backgroundColor: colors.primary.primary, - pressedBackgroundColor: colors.states.primaryPressed, + foregroundColor: colors.main.onMain, + backgroundColor: colors.main.main, + pressedBackgroundColor: colors.states.mainPressed, borderColor: borderColor, pressedBorderColor: pressedBorderColor ) case .secondary: return .init( - foregroundColor: colors.secondary.onSecondary, - backgroundColor: colors.secondary.secondary, - pressedBackgroundColor: colors.states.secondaryPressed, + foregroundColor: colors.support.onSupport, + backgroundColor: colors.support.support, + pressedBackgroundColor: colors.states.supportPressed, borderColor: borderColor, pressedBorderColor: pressedBorderColor ) diff --git a/core/Sources/Components/Button/UseCase/GetVariants/ButtonGetVariantFilledUseCaseTests.swift b/core/Sources/Components/Button/UseCase/GetVariants/ButtonGetVariantFilledUseCaseTests.swift index 0822626cc..a34c27205 100644 --- a/core/Sources/Components/Button/UseCase/GetVariants/ButtonGetVariantFilledUseCaseTests.swift +++ b/core/Sources/Components/Button/UseCase/GetVariants/ButtonGetVariantFilledUseCaseTests.swift @@ -13,7 +13,7 @@ import SwiftUI final class ButtonGetVariantFilledUseCaseTests: ButtonVariantUseCaseTests { // MARK: - Tests - func test_primary_colors() throws { + func test_main_colors() throws { // Given let sut = self.sut() @@ -27,15 +27,15 @@ final class ButtonGetVariantFilledUseCaseTests: ButtonVariantUseCaseTests { colors.pressedBackgroundColor, colors.borderColor, colors.pressedBorderColor].map(\.color), - [self.theme.colors.primary.onPrimary, - self.theme.colors.primary.primary, - self.theme.colors.states.primaryPressed, + [self.theme.colors.main.onMain, + self.theme.colors.main.main, + self.theme.colors.states.mainPressed, ColorTokenDefault.clear, ColorTokenDefault.clear ].map(\.color)) } - func test_secondary_colors() throws { + func test_support_colors() throws { // Given let sut = self.sut() @@ -49,9 +49,9 @@ final class ButtonGetVariantFilledUseCaseTests: ButtonVariantUseCaseTests { colors.pressedBackgroundColor, colors.borderColor, colors.pressedBorderColor].map(\.color), - [self.theme.colors.secondary.onSecondary, - self.theme.colors.secondary.secondary, - self.theme.colors.states.secondaryPressed, + [self.theme.colors.support.onSupport, + self.theme.colors.support.support, + self.theme.colors.states.supportPressed, ColorTokenDefault.clear, ColorTokenDefault.clear ].map(\.color)) diff --git a/core/Sources/Components/Button/UseCase/GetVariants/ButtonGetVariantGhostUseCase.swift b/core/Sources/Components/Button/UseCase/GetVariants/ButtonGetVariantGhostUseCase.swift index 87977ad85..bac2660f7 100644 --- a/core/Sources/Components/Button/UseCase/GetVariants/ButtonGetVariantGhostUseCase.swift +++ b/core/Sources/Components/Button/UseCase/GetVariants/ButtonGetVariantGhostUseCase.swift @@ -25,17 +25,17 @@ struct ButtonGetVariantGhostUseCase: ButtonGetVariantUseCaseable { switch intent { case .primary: return .init( - foregroundColor: colors.primary.primary, + foregroundColor: colors.main.main, backgroundColor: ColorTokenDefault.clear, - pressedBackgroundColor: colors.primary.primary.opacity(dim5), + pressedBackgroundColor: colors.main.main.opacity(dim5), borderColor: borderColor, pressedBorderColor: pressedBorderColor ) case .secondary: return .init( - foregroundColor: colors.secondary.secondary, + foregroundColor: colors.support.support, backgroundColor: ColorTokenDefault.clear, - pressedBackgroundColor: colors.secondary.secondary.opacity(dim5), + pressedBackgroundColor: colors.support.support.opacity(dim5), borderColor: borderColor, pressedBorderColor: pressedBorderColor ) diff --git a/core/Sources/Components/Button/UseCase/GetVariants/ButtonGetVariantGhostUseCaseTests.swift b/core/Sources/Components/Button/UseCase/GetVariants/ButtonGetVariantGhostUseCaseTests.swift index 09bde1556..9b5b70954 100644 --- a/core/Sources/Components/Button/UseCase/GetVariants/ButtonGetVariantGhostUseCaseTests.swift +++ b/core/Sources/Components/Button/UseCase/GetVariants/ButtonGetVariantGhostUseCaseTests.swift @@ -13,7 +13,7 @@ import SwiftUI final class ButtonGetVariantGhostUseCaseTests: ButtonVariantUseCaseTests { // MARK: - Tests - func test_primary_colors() throws { + func test_main_colors() throws { // Given let sut = self.sut() @@ -27,15 +27,15 @@ final class ButtonGetVariantGhostUseCaseTests: ButtonVariantUseCaseTests { colors.pressedBackgroundColor, colors.borderColor, colors.pressedBorderColor].map(\.color), - [self.theme.colors.primary.primary, + [self.theme.colors.main.main, ColorTokenDefault.clear, - self.theme.colors.primary.primary.opacity(self.theme.dims.dim5), + self.theme.colors.main.main.opacity(self.theme.dims.dim5), ColorTokenDefault.clear, ColorTokenDefault.clear ].map(\.color)) } - func test_secondary_colors() throws { + func test_support_colors() throws { // Given let sut = self.sut() @@ -49,9 +49,9 @@ final class ButtonGetVariantGhostUseCaseTests: ButtonVariantUseCaseTests { colors.pressedBackgroundColor, colors.borderColor, colors.pressedBorderColor].map(\.color), - [self.theme.colors.secondary.secondary, + [self.theme.colors.support.support, ColorTokenDefault.clear, - self.theme.colors.secondary.secondary.opacity(self.theme.dims.dim5), + self.theme.colors.support.support.opacity(self.theme.dims.dim5), ColorTokenDefault.clear, ColorTokenDefault.clear ].map(\.color)) diff --git a/core/Sources/Components/Button/UseCase/GetVariants/ButtonGetVariantOutlinedUseCase.swift b/core/Sources/Components/Button/UseCase/GetVariants/ButtonGetVariantOutlinedUseCase.swift index f66821bf5..35379dc20 100644 --- a/core/Sources/Components/Button/UseCase/GetVariants/ButtonGetVariantOutlinedUseCase.swift +++ b/core/Sources/Components/Button/UseCase/GetVariants/ButtonGetVariantOutlinedUseCase.swift @@ -24,19 +24,19 @@ struct ButtonGetVariantOutlinedUseCase: ButtonGetVariantUseCaseable { switch intent { case .primary: return .init( - foregroundColor: colors.primary.primary, + foregroundColor: colors.main.main, backgroundColor: backgroundColor, - pressedBackgroundColor: colors.primary.primary.opacity(dim5), - borderColor: colors.primary.primary, - pressedBorderColor: colors.primary.primary + pressedBackgroundColor: colors.main.main.opacity(dim5), + borderColor: colors.main.main, + pressedBorderColor: colors.main.main ) case .secondary: return .init( - foregroundColor: colors.secondary.secondary, + foregroundColor: colors.support.support, backgroundColor: backgroundColor, - pressedBackgroundColor: colors.secondary.secondary.opacity(dim5), - borderColor: colors.secondary.secondary, - pressedBorderColor: colors.secondary.secondary + pressedBackgroundColor: colors.support.support.opacity(dim5), + borderColor: colors.support.support, + pressedBorderColor: colors.support.support ) case .neutral: return .init( diff --git a/core/Sources/Components/Button/UseCase/GetVariants/ButtonGetVariantOutlinedUseCaseTests.swift b/core/Sources/Components/Button/UseCase/GetVariants/ButtonGetVariantOutlinedUseCaseTests.swift index 575b9409f..59c5654db 100644 --- a/core/Sources/Components/Button/UseCase/GetVariants/ButtonGetVariantOutlinedUseCaseTests.swift +++ b/core/Sources/Components/Button/UseCase/GetVariants/ButtonGetVariantOutlinedUseCaseTests.swift @@ -13,7 +13,7 @@ import SwiftUI final class ButtonGetVariantOutlinedUseCaseTests: ButtonVariantUseCaseTests { // MARK: - Tests - func test_primary_colors() throws { + func test_main_colors() throws { // Given let sut = self.sut() @@ -27,15 +27,15 @@ final class ButtonGetVariantOutlinedUseCaseTests: ButtonVariantUseCaseTests { colors.pressedBackgroundColor, colors.borderColor, colors.pressedBorderColor].map(\.color), - [self.theme.colors.primary.primary, + [self.theme.colors.main.main, self.theme.colors.base.surface, - self.theme.colors.primary.primary.opacity(self.theme.dims.dim5), - self.theme.colors.primary.primary, - self.theme.colors.primary.primary + self.theme.colors.main.main.opacity(self.theme.dims.dim5), + self.theme.colors.main.main, + self.theme.colors.main.main ].map(\.color)) } - func test_secondary_colors() throws { + func test_support_colors() throws { // Given let sut = self.sut() @@ -49,11 +49,11 @@ final class ButtonGetVariantOutlinedUseCaseTests: ButtonVariantUseCaseTests { colors.pressedBackgroundColor, colors.borderColor, colors.pressedBorderColor].map(\.color), - [self.theme.colors.secondary.secondary, + [self.theme.colors.support.support, self.theme.colors.base.surface, - self.theme.colors.secondary.secondary.opacity(self.theme.dims.dim5), - self.theme.colors.secondary.secondary, - self.theme.colors.secondary.secondary + self.theme.colors.support.support.opacity(self.theme.dims.dim5), + self.theme.colors.support.support, + self.theme.colors.support.support ].map(\.color)) } diff --git a/core/Sources/Components/Button/UseCase/GetVariants/ButtonGetVariantTintedUseCase.swift b/core/Sources/Components/Button/UseCase/GetVariants/ButtonGetVariantTintedUseCase.swift index 90e3af724..082677fc9 100644 --- a/core/Sources/Components/Button/UseCase/GetVariants/ButtonGetVariantTintedUseCase.swift +++ b/core/Sources/Components/Button/UseCase/GetVariants/ButtonGetVariantTintedUseCase.swift @@ -23,17 +23,17 @@ struct ButtonGetVariantTintedUseCase: ButtonGetVariantUseCaseable { switch intent { case .primary: return .init( - foregroundColor: colors.primary.onPrimaryContainer, - backgroundColor: colors.primary.primaryContainer, - pressedBackgroundColor: colors.states.primaryContainerPressed, + foregroundColor: colors.main.onMainContainer, + backgroundColor: colors.main.mainContainer, + pressedBackgroundColor: colors.states.mainContainerPressed, borderColor: borderColor, pressedBorderColor: pressedBorderColor ) case .secondary: return .init( - foregroundColor: colors.secondary.onSecondaryContainer, - backgroundColor: colors.secondary.secondaryContainer, - pressedBackgroundColor: colors.states.secondaryContainerPressed, + foregroundColor: colors.support.onSupportContainer, + backgroundColor: colors.support.supportContainer, + pressedBackgroundColor: colors.states.supportContainerPressed, borderColor: borderColor, pressedBorderColor: pressedBorderColor ) diff --git a/core/Sources/Components/Button/UseCase/GetVariants/ButtonGetVariantTintedUseCaseTests.swift b/core/Sources/Components/Button/UseCase/GetVariants/ButtonGetVariantTintedUseCaseTests.swift index a1f91cf2e..05652fcb6 100644 --- a/core/Sources/Components/Button/UseCase/GetVariants/ButtonGetVariantTintedUseCaseTests.swift +++ b/core/Sources/Components/Button/UseCase/GetVariants/ButtonGetVariantTintedUseCaseTests.swift @@ -13,7 +13,7 @@ import SwiftUI final class ButtonGetVariantTintedUseCaseTests: ButtonVariantUseCaseTests { // MARK: - Tests - func test_primary_colors() throws { + func test_main_colors() throws { // Given let sut = self.sut() @@ -27,15 +27,15 @@ final class ButtonGetVariantTintedUseCaseTests: ButtonVariantUseCaseTests { colors.pressedBackgroundColor, colors.borderColor, colors.pressedBorderColor].map(\.color), - [self.theme.colors.primary.onPrimaryContainer, - self.theme.colors.primary.primaryContainer, - self.theme.colors.states.primaryContainerPressed, + [self.theme.colors.main.onMainContainer, + self.theme.colors.main.mainContainer, + self.theme.colors.states.mainContainerPressed, ColorTokenDefault.clear, ColorTokenDefault.clear ].map(\.color)) } - func test_secondary_colors() throws { + func test_support_colors() throws { // Given let sut = self.sut() @@ -49,9 +49,9 @@ final class ButtonGetVariantTintedUseCaseTests: ButtonVariantUseCaseTests { colors.pressedBackgroundColor, colors.borderColor, colors.pressedBorderColor].map(\.color), - [self.theme.colors.secondary.onSecondaryContainer, - self.theme.colors.secondary.secondaryContainer, - self.theme.colors.states.secondaryContainerPressed, + [self.theme.colors.support.onSupportContainer, + self.theme.colors.support.supportContainer, + self.theme.colors.states.supportContainerPressed, ColorTokenDefault.clear, ColorTokenDefault.clear ].map(\.color)) diff --git a/core/Sources/Components/Button/UseCase/GetVariants/ButtonGetVariantUseCaseTests.swift b/core/Sources/Components/Button/UseCase/GetVariants/ButtonGetVariantUseCaseTests.swift index d14ae5bb1..3a39ea52b 100644 --- a/core/Sources/Components/Button/UseCase/GetVariants/ButtonGetVariantUseCaseTests.swift +++ b/core/Sources/Components/Button/UseCase/GetVariants/ButtonGetVariantUseCaseTests.swift @@ -37,8 +37,8 @@ private extension Colors where Self == ColorsGeneratedMock { static var mock: Self { let colors = ColorsGeneratedMock() colors.base = ColorsBaseGeneratedMock.mocked() - colors.primary = ColorsPrimaryGeneratedMock.mocked() - colors.secondary = ColorsSecondaryGeneratedMock.mocked() + colors.main = ColorsMainGeneratedMock.mocked() + colors.support = ColorsSupportGeneratedMock.mocked() colors.feedback = ColorsFeedbackGeneratedMock.mocked() colors.states = ColorsStatesGeneratedMock.mocked() diff --git a/core/Sources/Components/Button/View/UIKit/ButtonUIViewTests.swift b/core/Sources/Components/Button/View/UIKit/ButtonUIViewTests.swift index b98a528fd..b9cbd3632 100644 --- a/core/Sources/Components/Button/View/UIKit/ButtonUIViewTests.swift +++ b/core/Sources/Components/Button/View/UIKit/ButtonUIViewTests.swift @@ -20,17 +20,17 @@ final class ButtonUIViewTests: UIKitComponentTestCase { // MARK: - Tests - func test_uikit_switch_colors() { + func test_uikit_button_colors() { let suts = ButtonSutTests.allColorsCases() self.test(suts: suts) } - func test_uikit_switch_styles() { + func test_uikit_button_styles() { let suts = ButtonSutTests.allStylesCases() self.test(suts: suts) } - func test_uikit_switch_contents() { + func test_uikit_button_contents() { let suts = ButtonSutTests.allContentCases(isSwiftUIComponent: false) self.test(suts: suts) } diff --git a/core/Sources/Components/Checkbox/UseCase/IntentColors/CheckboxStateColorsUseCase.swift b/core/Sources/Components/Checkbox/UseCase/IntentColors/CheckboxStateColorsUseCase.swift index bc11f92c8..57649caf3 100644 --- a/core/Sources/Components/Checkbox/UseCase/IntentColors/CheckboxStateColorsUseCase.swift +++ b/core/Sources/Components/Checkbox/UseCase/IntentColors/CheckboxStateColorsUseCase.swift @@ -18,10 +18,10 @@ struct CheckboxStateColorsUseCase: CheckboxStateColorsUseCaseable { func execute(for intentColor: SelectButtonState, on colors: Colors) -> CheckboxStateColorables { - let surfaceColor = colors.primary.primary + let surfaceColor = colors.main.main let textColor = colors.base.onSurface - let iconColor = colors.primary.onPrimary - let pressedBorderColor = colors.primary.primaryContainer + let iconColor = colors.main.onMain + let pressedBorderColor = colors.main.mainContainer switch intentColor { case .enabled: diff --git a/core/Sources/Components/Checkbox/UseCase/IntentColors/CheckboxStateColorsUseCaseTests.swift b/core/Sources/Components/Checkbox/UseCase/IntentColors/CheckboxStateColorsUseCaseTests.swift index cdb4a1df2..e7be5b658 100644 --- a/core/Sources/Components/Checkbox/UseCase/IntentColors/CheckboxStateColorsUseCaseTests.swift +++ b/core/Sources/Components/Checkbox/UseCase/IntentColors/CheckboxStateColorsUseCaseTests.swift @@ -36,10 +36,10 @@ final class CheckboxStateColorsUseCaseTests: XCTestCase { colors.checkboxIconColor, colors.textColor, colors.checkboxColor].map(\.color), - [self.theme.colors.primary.primaryContainer, - self.theme.colors.primary.onPrimary, + [self.theme.colors.main.mainContainer, + self.theme.colors.main.onMain, self.theme.colors.base.onSurface, - self.theme.colors.primary.primary + self.theme.colors.main.main ].map(\.color)) } @@ -56,10 +56,10 @@ final class CheckboxStateColorsUseCaseTests: XCTestCase { colors.checkboxIconColor, colors.textColor, colors.checkboxColor].map(\.color), - [self.theme.colors.primary.primaryContainer, - self.theme.colors.primary.onPrimary, + [self.theme.colors.main.mainContainer, + self.theme.colors.main.onMain, self.theme.colors.base.onSurface, - self.theme.colors.primary.primary + self.theme.colors.main.main ].map(\.color)) } @@ -77,7 +77,7 @@ final class CheckboxStateColorsUseCaseTests: XCTestCase { colors.textColor, colors.checkboxColor].map(\.color), [self.theme.colors.feedback.successContainer, - self.theme.colors.primary.onPrimary, + self.theme.colors.main.onMain, self.theme.colors.base.onSurface, self.theme.colors.feedback.success ].map(\.color)) @@ -97,7 +97,7 @@ final class CheckboxStateColorsUseCaseTests: XCTestCase { colors.textColor, colors.checkboxColor].map(\.color), [self.theme.colors.feedback.alertContainer, - self.theme.colors.primary.onPrimary, + self.theme.colors.main.onMain, self.theme.colors.base.onSurface, self.theme.colors.feedback.alert ].map(\.color)) @@ -117,7 +117,7 @@ final class CheckboxStateColorsUseCaseTests: XCTestCase { colors.textColor, colors.checkboxColor].map(\.color), [self.theme.colors.feedback.errorContainer, - self.theme.colors.primary.onPrimary, + self.theme.colors.main.onMain, self.theme.colors.base.onSurface, self.theme.colors.feedback.error ].map(\.color)) @@ -142,7 +142,7 @@ private extension Colors where Self == ColorsGeneratedMock { static var mock: Self { let colors = ColorsGeneratedMock() colors.base = ColorsBaseGeneratedMock.mocked() - colors.primary = ColorsPrimaryGeneratedMock.mocked() + colors.main = ColorsMainGeneratedMock.mocked() colors.feedback = ColorsFeedbackGeneratedMock.mocked() return colors diff --git a/core/Sources/Components/Checkbox/View/CheckboxViewModelTests.swift b/core/Sources/Components/Checkbox/View/CheckboxViewModelTests.swift index 8d20092d9..46d3ae4d5 100644 --- a/core/Sources/Components/Checkbox/View/CheckboxViewModelTests.swift +++ b/core/Sources/Components/Checkbox/View/CheckboxViewModelTests.swift @@ -98,7 +98,7 @@ private extension Theme where Self == ThemeGeneratedMock { let colors = ColorsGeneratedMock() colors.base = ColorsBaseGeneratedMock.mocked() - colors.primary = ColorsPrimaryGeneratedMock.mocked() + colors.main = ColorsMainGeneratedMock.mocked() colors.feedback = ColorsFeedbackGeneratedMock.mocked() theme.colors = colors theme.dims = DimsGeneratedMock.mocked() diff --git a/core/Sources/Components/Chip/UseCase/GetChipIntentColorsUseCase.swift b/core/Sources/Components/Chip/UseCase/GetChipIntentColorsUseCase.swift index 9c02775e7..86c7a6c44 100644 --- a/core/Sources/Components/Chip/UseCase/GetChipIntentColorsUseCase.swift +++ b/core/Sources/Components/Chip/UseCase/GetChipIntentColorsUseCase.swift @@ -26,15 +26,15 @@ struct GetChipIntentColorsUseCase: GetChipIntentColorsUseCasable { func execute(colors: Colors, intentColor: ChipIntent) -> ChipIntentColors { switch intentColor { case .primary: - return .init(principal: colors.primary.primary, - subordinate: colors.primary.onPrimary, - tintedPrincipal: colors.primary.primaryContainer, - tintedSubordinate: colors.primary.onPrimaryContainer) + return .init(principal: colors.main.main, + subordinate: colors.main.onMain, + tintedPrincipal: colors.main.mainContainer, + tintedSubordinate: colors.main.onMainContainer) case .secondary: - return .init(principal: colors.secondary.secondary, - subordinate: colors.secondary.onSecondary, - tintedPrincipal: colors.secondary.secondaryContainer, - tintedSubordinate: colors.secondary.onSecondaryContainer) + return .init(principal: colors.support.support, + subordinate: colors.support.onSupport, + tintedPrincipal: colors.support.supportContainer, + tintedSubordinate: colors.support.onSupportContainer) case .surface: return .init(principal: colors.base.surface, subordinate: colors.base.onSurface, diff --git a/core/Sources/Components/Chip/UseCase/GetChipIntentColorsUseCaseTests.swift b/core/Sources/Components/Chip/UseCase/GetChipIntentColorsUseCaseTests.swift index ff08dc78b..66a0dae36 100644 --- a/core/Sources/Components/Chip/UseCase/GetChipIntentColorsUseCaseTests.swift +++ b/core/Sources/Components/Chip/UseCase/GetChipIntentColorsUseCaseTests.swift @@ -25,15 +25,15 @@ final class GetChipIntentColorsUseCaseTests: XCTestCase { } // MARK: - Tests - func test_primary_color() { + func test_main_color() { // Given - let primary = ColorsPrimaryGeneratedMock() - primary.primary = ColorTokenGeneratedMock(uiColor: .blue) - primary.onPrimary = ColorTokenGeneratedMock(uiColor: .gray) - primary.primaryContainer = ColorTokenGeneratedMock(uiColor: .yellow) - primary.onPrimaryContainer = ColorTokenGeneratedMock(uiColor: .red) + let main = ColorsMainGeneratedMock() + main.main = ColorTokenGeneratedMock(uiColor: .blue) + main.onMain = ColorTokenGeneratedMock(uiColor: .gray) + main.mainContainer = ColorTokenGeneratedMock(uiColor: .yellow) + main.onMainContainer = ColorTokenGeneratedMock(uiColor: .red) - self.colors.primary = primary + self.colors.main = main // When let chipIntentColors = self.sut.execute(colors: self.colors, intentColor: .primary) @@ -46,15 +46,15 @@ final class GetChipIntentColorsUseCaseTests: XCTestCase { [UIColor.blue, .gray, .yellow, .red]) } - func test_secondary_color() { + func test_support_color() { // Given - let secondary = ColorsSecondaryGeneratedMock() - secondary.secondary = ColorTokenGeneratedMock(uiColor: .blue) - secondary.onSecondary = ColorTokenGeneratedMock(uiColor: .gray) - secondary.secondaryContainer = ColorTokenGeneratedMock(uiColor: .yellow) - secondary.onSecondaryContainer = ColorTokenGeneratedMock(uiColor: .red) + let support = ColorsSupportGeneratedMock() + support.support = ColorTokenGeneratedMock(uiColor: .blue) + support.onSupport = ColorTokenGeneratedMock(uiColor: .gray) + support.supportContainer = ColorTokenGeneratedMock(uiColor: .yellow) + support.onSupportContainer = ColorTokenGeneratedMock(uiColor: .red) - self.colors.secondary = secondary + self.colors.support = support // When let chipIntentColors = self.sut.execute(colors: self.colors, intentColor: .secondary) diff --git a/core/Sources/Components/Icon/UseCase/IconGetColorUseCase.swift b/core/Sources/Components/Icon/UseCase/IconGetColorUseCase.swift index dcc650ee8..4d7a8b6e4 100644 --- a/core/Sources/Components/Icon/UseCase/IconGetColorUseCase.swift +++ b/core/Sources/Components/Icon/UseCase/IconGetColorUseCase.swift @@ -26,9 +26,9 @@ struct IconGetColorUseCase: IconGetColorUseCaseable { case .neutral: return colors.feedback.neutral case .primary: - return colors.primary.primary + return colors.main.main case .secondary: - return colors.secondary.secondary + return colors.support.support case .success: return colors.feedback.success } diff --git a/core/Sources/Components/Icon/UseCase/IconGetColorUseCaseTests.swift b/core/Sources/Components/Icon/UseCase/IconGetColorUseCaseTests.swift index 39b38af96..89355988d 100644 --- a/core/Sources/Components/Icon/UseCase/IconGetColorUseCaseTests.swift +++ b/core/Sources/Components/Icon/UseCase/IconGetColorUseCaseTests.swift @@ -32,11 +32,11 @@ final class IconGetColorUseCaseTests: XCTestCase { } func test_execute_when_icon_is_primary_case() { - testExecute(givenIntent: .primary, expectedColorToken: self.colorsMock.primary.primary) + testExecute(givenIntent: .primary, expectedColorToken: self.colorsMock.main.main) } func test_execute_when_icon_is_secondary_case() { - testExecute(givenIntent: .secondary, expectedColorToken: self.colorsMock.secondary.secondary) + testExecute(givenIntent: .secondary, expectedColorToken: self.colorsMock.support.support) } func test_execute_when_icon_is_success_case() { diff --git a/core/Sources/Components/RadioButton/UseCases/GetRadioButtonColorsUseCase.swift b/core/Sources/Components/RadioButton/UseCases/GetRadioButtonColorsUseCase.swift index c33a9a6a0..ad8429e28 100644 --- a/core/Sources/Components/RadioButton/UseCases/GetRadioButtonColorsUseCase.swift +++ b/core/Sources/Components/RadioButton/UseCases/GetRadioButtonColorsUseCase.swift @@ -51,7 +51,7 @@ private extension Theme { case .warning: return self.colors.feedback.alert case .error: return self.colors.feedback.error case .success: return self.colors.feedback.success - case .enabled, .disabled: return isSelected ? self.colors.primary.primary : self.colors.base.outline + case .enabled, .disabled: return isSelected ? self.colors.main.main : self.colors.base.outline } } @@ -60,8 +60,8 @@ private extension Theme { case .warning: return self.colors.feedback.alertContainer case .error: return self.colors.feedback.errorContainer case .success: return self.colors.feedback.successContainer - case .disabled: return self.colors.primary.primaryContainer - case .enabled: return self.colors.primary.primaryContainer + case .disabled: return self.colors.main.mainContainer + case .enabled: return self.colors.main.mainContainer } } } diff --git a/core/Sources/Components/RadioButton/UseCases/GetRadioButtonColorsUseCaseTests.swift b/core/Sources/Components/RadioButton/UseCases/GetRadioButtonColorsUseCaseTests.swift index 1d3404bd4..bdb05130e 100644 --- a/core/Sources/Components/RadioButton/UseCases/GetRadioButtonColorsUseCaseTests.swift +++ b/core/Sources/Components/RadioButton/UseCases/GetRadioButtonColorsUseCaseTests.swift @@ -16,7 +16,7 @@ final class GetRadioButtonColorsUseCaseTests: XCTestCase { var sut: GetRadioButtonColorsUseCase! var feedback: ColorsFeedbackGeneratedMock! - var primary: ColorsPrimaryGeneratedMock! + var main: ColorsMainGeneratedMock! var base: ColorsBaseGeneratedMock! var theme: ThemeGeneratedMock! @@ -30,18 +30,18 @@ final class GetRadioButtonColorsUseCaseTests: XCTestCase { let colors = ColorsGeneratedMock() let base = ColorsBaseGeneratedMock() - let primary = ColorsPrimaryGeneratedMock() + let main = ColorsMainGeneratedMock() let feedback = ColorsFeedbackGeneratedMock() colors.base = base colors.feedback = feedback - colors.primary = primary + colors.main = main theme.colors = colors self.theme = theme self.base = base - self.primary = primary + self.main = main self.feedback = feedback self.sut = GetRadioButtonColorsUseCase() } @@ -49,15 +49,15 @@ final class GetRadioButtonColorsUseCaseTests: XCTestCase { // MARK: - Tests func test_enabled_colors_when_button_is_not_selected() throws { // Given - let primaryContainer = ColorTokenGeneratedMock() + let mainContainer = ColorTokenGeneratedMock() let onSurface = ColorTokenGeneratedMock() let outline = ColorTokenGeneratedMock() - primaryContainer.color = .red + mainContainer.color = .red onSurface.color = .green outline.color = .blue - self.primary.primaryContainer = primaryContainer + self.main.mainContainer = mainContainer self.base.onSurface = onSurface self.base.outline = outline @@ -80,15 +80,15 @@ final class GetRadioButtonColorsUseCaseTests: XCTestCase { func test_disabled_colors_when_button_is_not_selected() throws { // Given - let primaryContainer = ColorTokenGeneratedMock() + let mainContainer = ColorTokenGeneratedMock() let onSurface = ColorTokenGeneratedMock() let outline = ColorTokenGeneratedMock() - primaryContainer.color = .yellow + mainContainer.color = .yellow onSurface.color = .gray outline.color = .purple - self.primary.primaryContainer = primaryContainer + self.main.mainContainer = mainContainer self.base.onSurface = onSurface self.base.outline = outline @@ -206,16 +206,16 @@ final class GetRadioButtonColorsUseCaseTests: XCTestCase { func test_enabled_colors_when_button_is_selected() throws { // Given - let primary = ColorTokenGeneratedMock() - let primaryContainer = ColorTokenGeneratedMock() + let main = ColorTokenGeneratedMock() + let mainContainer = ColorTokenGeneratedMock() let onSurface = ColorTokenGeneratedMock() - primary.color = .blue + main.color = .blue onSurface.color = .green - primaryContainer.color = .gray + mainContainer.color = .gray - self.primary.primary = primary - self.primary.primaryContainer = primaryContainer + self.main.main = main + self.main.mainContainer = mainContainer self.base.onSurface = onSurface // When @@ -237,16 +237,16 @@ final class GetRadioButtonColorsUseCaseTests: XCTestCase { func test_disabled_colors_when_button_is_selected() throws { // Given - let primary = ColorTokenGeneratedMock() - let primaryContainer = ColorTokenGeneratedMock() + let main = ColorTokenGeneratedMock() + let mainContainer = ColorTokenGeneratedMock() let onSurface = ColorTokenGeneratedMock() - primary.color = .blue - primaryContainer.color = .black + main.color = .blue + mainContainer.color = .black onSurface.color = .white - self.primary.primary = primary - self.primary.primaryContainer = primaryContainer + self.main.main = main + self.main.mainContainer = mainContainer self.base.onSurface = onSurface // When diff --git a/core/Sources/Components/RadioButton/UseCases/GetRadioButtonGroupColorUseCase.swift b/core/Sources/Components/RadioButton/UseCases/GetRadioButtonGroupColorUseCase.swift index 9118fe404..5228cbac5 100644 --- a/core/Sources/Components/RadioButton/UseCases/GetRadioButtonGroupColorUseCase.swift +++ b/core/Sources/Components/RadioButton/UseCases/GetRadioButtonGroupColorUseCase.swift @@ -26,8 +26,8 @@ struct GetRadioButtonGroupColorUseCase: GetRadioButtonGroupColorUseCaseable { case .warning: return colors.feedback.onAlertContainer case .error: return colors.feedback.error case .success: return colors.feedback.success - case .enabled: return colors.primary.primaryContainer - case .disabled: return colors.primary.primaryContainer + case .enabled: return colors.main.mainContainer + case .disabled: return colors.main.mainContainer } } } diff --git a/core/Sources/Components/RadioButton/UseCases/GetRadioButtonGroupColorUseCaseTests.swift b/core/Sources/Components/RadioButton/UseCases/GetRadioButtonGroupColorUseCaseTests.swift index 60779f914..642b966ce 100644 --- a/core/Sources/Components/RadioButton/UseCases/GetRadioButtonGroupColorUseCaseTests.swift +++ b/core/Sources/Components/RadioButton/UseCases/GetRadioButtonGroupColorUseCaseTests.swift @@ -59,27 +59,27 @@ final class GetRadioButtonGroupColorUseCaseTests: XCTestCase { // Given let sut = GetRadioButtonGroupColorUseCase() let colors = ColorsGeneratedMock() - colors.primary = ColorsPrimaryGeneratedMock.mocked() + colors.main = ColorsMainGeneratedMock.mocked() // When let colorToken = sut.execute(colors: colors, state: .enabled) // Then - XCTAssertEqual(colorToken.uiColor, colors.primary.primaryContainer.uiColor) - XCTAssertEqual(colorToken.color, colors.primary.primaryContainer.color) + XCTAssertEqual(colorToken.uiColor, colors.main.mainContainer.uiColor) + XCTAssertEqual(colorToken.color, colors.main.mainContainer.color) } func test_disabled() { // Given let sut = GetRadioButtonGroupColorUseCase() let colors = ColorsGeneratedMock() - colors.primary = ColorsPrimaryGeneratedMock.mocked() + colors.main = ColorsMainGeneratedMock.mocked() // When let colorToken = sut.execute(colors: colors, state: .disabled) // Then - XCTAssertEqual(colorToken.uiColor, colors.primary.primaryContainer.uiColor) - XCTAssertEqual(colorToken.color, colors.primary.primaryContainer.color) + XCTAssertEqual(colorToken.uiColor, colors.main.mainContainer.uiColor) + XCTAssertEqual(colorToken.color, colors.main.mainContainer.color) } } diff --git a/core/Sources/Components/Spinner/UseCases/GetSpinnerIntentColorUseCase.swift b/core/Sources/Components/Spinner/UseCases/GetSpinnerIntentColorUseCase.swift index db8edbdf8..27dce5186 100644 --- a/core/Sources/Components/Spinner/UseCases/GetSpinnerIntentColorUseCase.swift +++ b/core/Sources/Components/Spinner/UseCases/GetSpinnerIntentColorUseCase.swift @@ -30,8 +30,8 @@ struct GetSpinnerIntentColorUseCase: GetSpinnerIntentColorUseCasable { /// - Returns: ``RadioButtonColors`` which contains the various colors of the radio button. func execute(colors: any Colors, intent: SpinnerIntent) -> any ColorToken { switch intent { - case .primary: return colors.primary.primary - case .secondary: return colors.secondary.secondary + case .primary: return colors.main.main + case .secondary: return colors.support.support case .alert: return colors.feedback.alert case .error: return colors.feedback.error case .info: return colors.feedback.info diff --git a/core/Sources/Components/Spinner/UseCases/GetSpinnerIntentColorUseCaseTests.swift b/core/Sources/Components/Spinner/UseCases/GetSpinnerIntentColorUseCaseTests.swift index fd581626e..b487dce5e 100644 --- a/core/Sources/Components/Spinner/UseCases/GetSpinnerIntentColorUseCaseTests.swift +++ b/core/Sources/Components/Spinner/UseCases/GetSpinnerIntentColorUseCaseTests.swift @@ -24,11 +24,11 @@ final class GetSpinnerIntentColorUseCaseTests: TestCase { // MARK: - Tests func test_execute_primary() { - XCTAssertEqual(self.sut.execute(colors: self.colors, intent: .primary).color, self.colors.primary.primary.color) + XCTAssertEqual(self.sut.execute(colors: self.colors, intent: .primary).color, self.colors.main.main.color) } func test_execute_secondary() { - XCTAssertEqual(self.sut.execute(colors: self.colors, intent: .secondary).color, self.colors.secondary.secondary.color) + XCTAssertEqual(self.sut.execute(colors: self.colors, intent: .secondary).color, self.colors.support.support.color) } func test_execute_alert() { diff --git a/core/Sources/Components/Switch/Model/Internal/Colors/SwitchColorsTests.swift b/core/Sources/Components/Switch/Model/Internal/Colors/SwitchColorsTests.swift index 86c57f6c4..4042761c9 100644 --- a/core/Sources/Components/Switch/Model/Internal/Colors/SwitchColorsTests.swift +++ b/core/Sources/Components/Switch/Model/Internal/Colors/SwitchColorsTests.swift @@ -20,20 +20,20 @@ final class SwitchColorsTests: XCTestCase { onColorToken: colors.feedback.info, offColorToken: colors.feedback.alert), toggleDotForegroundColors: SwitchStatusColors( - onColorToken: colors.primary.primary, - offColorToken: colors.secondary.secondary), + onColorToken: colors.main.main, + offColorToken: colors.support.support), toggleDotBackgroundColor: colors.base.background, - textForegroundColor: colors.primary.onPrimary) + textForegroundColor: colors.main.onMain) let colors2 = SwitchColors( toggleBackgroundColors: SwitchStatusColors( onColorToken: colors.feedback.info, offColorToken: colors.feedback.alert), toggleDotForegroundColors: SwitchStatusColors( - onColorToken: colors.primary.primary, - offColorToken: colors.secondary.secondary), + onColorToken: colors.main.main, + offColorToken: colors.support.support), toggleDotBackgroundColor: colors.base.background, - textForegroundColor: colors.primary.onPrimary) + textForegroundColor: colors.main.onMain) XCTAssertEqual(colors1, colors2) } @@ -46,20 +46,20 @@ final class SwitchColorsTests: XCTestCase { onColorToken: colors.feedback.info, offColorToken: colors.feedback.alert), toggleDotForegroundColors: SwitchStatusColors( - onColorToken: colors.primary.primary, - offColorToken: colors.secondary.secondary), + onColorToken: colors.main.main, + offColorToken: colors.support.support), toggleDotBackgroundColor: colors.base.background, - textForegroundColor: colors.primary.onPrimary) + textForegroundColor: colors.main.onMain) let colors2 = SwitchColors( toggleBackgroundColors: SwitchStatusColors( onColorToken: colors.feedback.error, offColorToken: colors.feedback.alert), toggleDotForegroundColors: SwitchStatusColors( - onColorToken: colors.primary.primary, - offColorToken: colors.secondary.secondary), + onColorToken: colors.main.main, + offColorToken: colors.support.support), toggleDotBackgroundColor: colors.base.background, - textForegroundColor: colors.primary.onPrimary) + textForegroundColor: colors.main.onMain) XCTAssertNotEqual(colors1, colors2) } diff --git a/core/Sources/Components/Switch/Model/Internal/Colors/SwitchStatusColorsTests.swift b/core/Sources/Components/Switch/Model/Internal/Colors/SwitchStatusColorsTests.swift index 58b4755fe..fb37642b9 100644 --- a/core/Sources/Components/Switch/Model/Internal/Colors/SwitchStatusColorsTests.swift +++ b/core/Sources/Components/Switch/Model/Internal/Colors/SwitchStatusColorsTests.swift @@ -34,8 +34,8 @@ final class SwitchStatusColorsTests: XCTestCase { offColorToken: colors.feedback.alert) let colors2 = SwitchStatusColors( - onColorToken: colors.primary.primary, - offColorToken: colors.secondary.secondary) + onColorToken: colors.main.main, + offColorToken: colors.support.support) XCTAssertNotEqual(colors1, colors2) } diff --git a/core/Sources/Components/Switch/UseCase/GetColor/SwitchGetColorUseCase.swift b/core/Sources/Components/Switch/UseCase/GetColor/SwitchGetColorUseCase.swift index 668ac1c8b..98aaf2f71 100644 --- a/core/Sources/Components/Switch/UseCase/GetColor/SwitchGetColorUseCase.swift +++ b/core/Sources/Components/Switch/UseCase/GetColor/SwitchGetColorUseCase.swift @@ -32,10 +32,10 @@ struct SwitchGetColorUseCase: SwitchGetColorUseCaseable { return colors.feedback.neutral case .primary: - return colors.primary.primary + return colors.main.main case .secondary: - return colors.secondary.secondary + return colors.support.support case .success: return colors.feedback.success diff --git a/core/Sources/Components/Switch/UseCase/GetColor/SwitchGetColorUseCaseTests.swift b/core/Sources/Components/Switch/UseCase/GetColor/SwitchGetColorUseCaseTests.swift index 6a750c7a5..c0440ca7b 100644 --- a/core/Sources/Components/Switch/UseCase/GetColor/SwitchGetColorUseCaseTests.swift +++ b/core/Sources/Components/Switch/UseCase/GetColor/SwitchGetColorUseCaseTests.swift @@ -18,49 +18,49 @@ final class SwitchGetColorUseCaseTests: XCTestCase { // MARK: - Tests - func test_execute_when_switchColor_is_alert_case() throws { + func test_execute_when_intent_is_alert_case() throws { try self.testExecute( givenIntent: .alert, expectedColorToken: self.colorsMock.feedback.alert ) } - func test_execute_when_switchColor_is_error_case() throws { + func test_execute_when_intent_is_error_case() throws { try self.testExecute( givenIntent: .error, expectedColorToken: self.colorsMock.feedback.error ) } - func test_execute_when_switchColor_is_info_case() throws { + func test_execute_when_intent_is_info_case() throws { try self.testExecute( givenIntent: .info, expectedColorToken: self.colorsMock.feedback.info ) } - func test_execute_when_switchColor_is_neutral_case() throws { + func test_execute_when_intent_is_neutral_case() throws { try self.testExecute( givenIntent: .neutral, expectedColorToken: self.colorsMock.feedback.neutral ) } - func test_execute_when_switchColor_is_primary_case() throws { + func test_execute_when_intent_is_primary_case() throws { try self.testExecute( givenIntent: .primary, - expectedColorToken: self.colorsMock.primary.primary + expectedColorToken: self.colorsMock.main.main ) } - func test_execute_when_switchColor_is_secondary_case() throws { + func test_execute_when_intent_is_secondary_case() throws { try self.testExecute( givenIntent: .secondary, - expectedColorToken: self.colorsMock.secondary.secondary + expectedColorToken: self.colorsMock.support.support ) } - func test_execute_when_switchColor_is_success_case() throws { + func test_execute_when_intent_is_success_case() throws { try self.testExecute( givenIntent: .success, expectedColorToken: self.colorsMock.feedback.success diff --git a/core/Sources/Components/Tag/Model/Colors/TagColorsTests.swift b/core/Sources/Components/Tag/Model/Colors/TagColorsTests.swift index b2029393e..f0253943e 100644 --- a/core/Sources/Components/Tag/Model/Colors/TagColorsTests.swift +++ b/core/Sources/Components/Tag/Model/Colors/TagColorsTests.swift @@ -18,12 +18,12 @@ final class TagColorsTests: XCTestCase { let colors1 = TagColors( backgroundColor: colors.base.background, - borderColor: colors.primary.primary, + borderColor: colors.main.main, foregroundColor: colors.feedback.info) let colors2 = TagColors( backgroundColor: colors.base.background, - borderColor: colors.primary.primary, + borderColor: colors.main.main, foregroundColor: colors.feedback.info) XCTAssertEqual(colors1, colors2) @@ -34,12 +34,12 @@ final class TagColorsTests: XCTestCase { let colors1 = TagColors( backgroundColor: colors.base.background, - borderColor: colors.primary.primary, + borderColor: colors.main.main, foregroundColor: colors.feedback.info) let colors2 = TagColors( backgroundColor: colors.base.background, - borderColor: colors.primary.primary, + borderColor: colors.main.main, foregroundColor: colors.feedback.alert) XCTAssertNotEqual(colors1, colors2) diff --git a/core/Sources/Components/Tag/Model/ContentColors/TagContentColorsTests.swift b/core/Sources/Components/Tag/Model/ContentColors/TagContentColorsTests.swift index b95b47382..255c4749e 100644 --- a/core/Sources/Components/Tag/Model/ContentColors/TagContentColorsTests.swift +++ b/core/Sources/Components/Tag/Model/ContentColors/TagContentColorsTests.swift @@ -19,15 +19,15 @@ final class TagContentColorsTests: XCTestCase { let colors = SparkTheme.shared.colors let colors1 = TagContentColors( - color: colors.primary.primary, - onColor: colors.primary.onPrimary, + color: colors.main.main, + onColor: colors.main.onMain, containerColor: colors.base.background, onContainerColor: colors.base.onBackground, surfaceColor: colors.base.surface) let colors2 = TagContentColors( - color: colors.primary.primary, - onColor: colors.primary.onPrimary, + color: colors.main.main, + onColor: colors.main.onMain, containerColor: colors.base.background, onContainerColor: colors.base.onBackground, surfaceColor: colors.base.surface) @@ -39,15 +39,15 @@ final class TagContentColorsTests: XCTestCase { let colors = SparkTheme.shared.colors let colors1 = TagContentColors( - color: colors.primary.primary, - onColor: colors.primary.onPrimary, + color: colors.main.main, + onColor: colors.main.onMain, containerColor: colors.base.background, onContainerColor: colors.base.onBackground, surfaceColor: colors.base.surface) let colors2 = TagContentColors( - color: colors.secondary.secondary, - onColor: colors.secondary.onSecondary, + color: colors.support.support, + onColor: colors.support.onSupport, containerColor: colors.base.background, onContainerColor: colors.base.onBackground, surfaceColor: colors.base.surface) diff --git a/core/Sources/Components/Tag/UseCase/GetContentColors/TagGetContentColorsUseCase.swift b/core/Sources/Components/Tag/UseCase/GetContentColors/TagGetContentColorsUseCase.swift index fce6906a7..04d3809df 100644 --- a/core/Sources/Components/Tag/UseCase/GetContentColors/TagGetContentColorsUseCase.swift +++ b/core/Sources/Components/Tag/UseCase/GetContentColors/TagGetContentColorsUseCase.swift @@ -59,19 +59,19 @@ struct TagGetContentColorsUseCase: TagGetContentColorsUseCaseable { case .primary: return .init( - color: colors.primary.primary, - onColor: colors.primary.onPrimary, - containerColor: colors.primary.primaryContainer, - onContainerColor: colors.primary.onPrimaryContainer, + color: colors.main.main, + onColor: colors.main.onMain, + containerColor: colors.main.mainContainer, + onContainerColor: colors.main.onMainContainer, surfaceColor: surfaceColor ) case .secondary: return .init( - color: colors.secondary.secondary, - onColor: colors.secondary.onSecondary, - containerColor: colors.secondary.secondaryContainer, - onContainerColor: colors.secondary.onSecondaryContainer, + color: colors.support.support, + onColor: colors.support.onSupport, + containerColor: colors.support.supportContainer, + onContainerColor: colors.support.onSupportContainer, surfaceColor: surfaceColor ) diff --git a/core/Sources/Components/Tag/UseCase/GetContentColors/TagGetIntentColorsUseCaseTests.swift b/core/Sources/Components/Tag/UseCase/GetContentColors/TagGetIntentColorsUseCaseTests.swift index 2e6358efb..b5c532c12 100644 --- a/core/Sources/Components/Tag/UseCase/GetContentColors/TagGetIntentColorsUseCaseTests.swift +++ b/core/Sources/Components/Tag/UseCase/GetContentColors/TagGetIntentColorsUseCaseTests.swift @@ -53,18 +53,18 @@ final class TagGetContentColorsUseCaseTests: XCTestCase { ), .init( givenIntent: .primary, - expectedColor: colorsMock.primary.primary, - expectedOnColor: colorsMock.primary.onPrimary, - expectedContainerColor: colorsMock.primary.primaryContainer, - expectedOnContainerColor: colorsMock.primary.onPrimaryContainer, + expectedColor: colorsMock.main.main, + expectedOnColor: colorsMock.main.onMain, + expectedContainerColor: colorsMock.main.mainContainer, + expectedOnContainerColor: colorsMock.main.onMainContainer, expectedSurfaceColor: colorsMock.base.surface ), .init( givenIntent: .secondary, - expectedColor: colorsMock.secondary.secondary, - expectedOnColor: colorsMock.secondary.onSecondary, - expectedContainerColor: colorsMock.secondary.secondaryContainer, - expectedOnContainerColor: colorsMock.secondary.onSecondaryContainer, + expectedColor: colorsMock.support.support, + expectedOnColor: colorsMock.support.onSupport, + expectedContainerColor: colorsMock.support.supportContainer, + expectedOnContainerColor: colorsMock.support.onSupportContainer, expectedSurfaceColor: colorsMock.base.surface ), .init( diff --git a/core/Sources/Theming/Content/Colors/Colors.swift b/core/Sources/Theming/Content/Colors/Colors.swift index fadcb3c4b..988ba3b8a 100644 --- a/core/Sources/Theming/Content/Colors/Colors.swift +++ b/core/Sources/Theming/Content/Colors/Colors.swift @@ -13,8 +13,8 @@ import SwiftUI // sourcery: AutoMockable public protocol Colors { - var primary: ColorsPrimary { get } - var secondary: ColorsSecondary { get } + var main: ColorsMain { get } + var support: ColorsSupport { get } var base: ColorsBase { get } var feedback: ColorsFeedback { get } var states: ColorsStates { get } diff --git a/core/Sources/Theming/Content/Colors/ColorsDefault.swift b/core/Sources/Theming/Content/Colors/ColorsDefault.swift index ba0dc2279..7a5fe9da8 100644 --- a/core/Sources/Theming/Content/Colors/ColorsDefault.swift +++ b/core/Sources/Theming/Content/Colors/ColorsDefault.swift @@ -13,21 +13,21 @@ public struct ColorsDefault: Colors { // MARK: - Properties - public let primary: ColorsPrimary - public let secondary: ColorsSecondary + public let main: ColorsMain + public let support: ColorsSupport public let base: ColorsBase public let feedback: ColorsFeedback public let states: ColorsStates // MARK: - Initialization - public init(primary: ColorsPrimary, - secondary: ColorsSecondary, + public init(main: ColorsMain, + support: ColorsSupport, base: ColorsBase, feedback: ColorsFeedback, states: ColorsStates) { - self.primary = primary - self.secondary = secondary + self.main = main + self.support = support self.base = base self.feedback = feedback self.states = states diff --git a/core/Sources/Theming/Content/Colors/ColorsGeneratedMock+ExtensionTests.swift b/core/Sources/Theming/Content/Colors/ColorsGeneratedMock+ExtensionTests.swift index ee2459151..58c549813 100644 --- a/core/Sources/Theming/Content/Colors/ColorsGeneratedMock+ExtensionTests.swift +++ b/core/Sources/Theming/Content/Colors/ColorsGeneratedMock+ExtensionTests.swift @@ -15,8 +15,8 @@ extension ColorsGeneratedMock { static func mocked() -> ColorsGeneratedMock { let mock = ColorsGeneratedMock() - mock.primary = ColorsPrimaryGeneratedMock.mocked() - mock.secondary = ColorsSecondaryGeneratedMock.mocked() + mock.main = ColorsMainGeneratedMock.mocked() + mock.support = ColorsSupportGeneratedMock.mocked() mock.base = ColorsBaseGeneratedMock.mocked() mock.feedback = ColorsFeedbackGeneratedMock.mocked() mock.states = ColorsStatesGeneratedMock.mocked() diff --git a/core/Sources/Theming/Content/Colors/Content/Main/ColorsMain.swift b/core/Sources/Theming/Content/Colors/Content/Main/ColorsMain.swift new file mode 100644 index 000000000..20ee864c1 --- /dev/null +++ b/core/Sources/Theming/Content/Colors/Content/Main/ColorsMain.swift @@ -0,0 +1,17 @@ +// +// ColorsMain.swift +// SparkCore +// +// Created by louis.borlee on 23/03/2023. +// Copyright © 2023 Adevinta. All rights reserved. +// + +// sourcery: AutoMockable +public protocol ColorsMain { + var main: any ColorToken { get } + var onMain: any ColorToken { get } + var mainVariant: any ColorToken { get } + var onMainVariant: any ColorToken { get } + var mainContainer: any ColorToken { get } + var onMainContainer: any ColorToken { get } +} diff --git a/core/Sources/Theming/Content/Colors/Content/Main/ColorsMainDefault.swift b/core/Sources/Theming/Content/Colors/Content/Main/ColorsMainDefault.swift new file mode 100644 index 000000000..d05e0c431 --- /dev/null +++ b/core/Sources/Theming/Content/Colors/Content/Main/ColorsMainDefault.swift @@ -0,0 +1,35 @@ +// +// ColorsMainDefault.swift +// SparkCore +// +// Created by louis.borlee on 23/03/2023. +// Copyright © 2023 Adevinta. All rights reserved. +// + +public struct ColorsMainDefault: ColorsMain { + + // MARK: - Properties + + public let main: any ColorToken + public let onMain: any ColorToken + public let mainVariant: any ColorToken + public let onMainVariant: any ColorToken + public let mainContainer: any ColorToken + public let onMainContainer: any ColorToken + + // MARK: - Init + + public init(main: any ColorToken, + onMain: any ColorToken, + mainVariant: any ColorToken, + onMainVariant: any ColorToken, + mainContainer: any ColorToken, + onMainContainer: any ColorToken) { + self.main = main + self.onMain = onMain + self.mainVariant = mainVariant + self.onMainVariant = onMainVariant + self.mainContainer = mainContainer + self.onMainContainer = onMainContainer + } +} diff --git a/core/Sources/Theming/Content/Colors/Content/Main/ColorsMainGeneratedMock+ExtensionTests.swift b/core/Sources/Theming/Content/Colors/Content/Main/ColorsMainGeneratedMock+ExtensionTests.swift new file mode 100644 index 000000000..63abe9665 --- /dev/null +++ b/core/Sources/Theming/Content/Colors/Content/Main/ColorsMainGeneratedMock+ExtensionTests.swift @@ -0,0 +1,29 @@ +// +// ColorsMainGeneratedMock+ExtensionTests.swift +// SparkCore +// +// Created by robin.lemaire on 11/04/2023. +// Copyright © 2023 Adevinta. All rights reserved. +// + +@testable import SparkCore + +extension ColorsMainGeneratedMock { + + // MARK: - Methods + + static func mocked() -> ColorsMainGeneratedMock { + let mock = ColorsMainGeneratedMock() + + mock.underlyingMain = ColorTokenGeneratedMock.random() + mock.underlyingOnMain = ColorTokenGeneratedMock.random() + + mock.underlyingMainVariant = ColorTokenGeneratedMock.random() + mock.underlyingOnMainVariant = ColorTokenGeneratedMock.random() + + mock.underlyingMainContainer = ColorTokenGeneratedMock.random() + mock.underlyingOnMainContainer = ColorTokenGeneratedMock.random() + + return mock + } +} diff --git a/core/Sources/Theming/Content/Colors/Content/Primary/ColorsPrimary.swift b/core/Sources/Theming/Content/Colors/Content/Primary/ColorsPrimary.swift deleted file mode 100644 index 052537644..000000000 --- a/core/Sources/Theming/Content/Colors/Content/Primary/ColorsPrimary.swift +++ /dev/null @@ -1,17 +0,0 @@ -// -// ColorsPrimary.swift -// SparkCore -// -// Created by louis.borlee on 23/03/2023. -// Copyright © 2023 Adevinta. All rights reserved. -// - -// sourcery: AutoMockable -public protocol ColorsPrimary { - var primary: any ColorToken { get } - var onPrimary: any ColorToken { get } - var primaryVariant: any ColorToken { get } - var onPrimaryVariant: any ColorToken { get } - var primaryContainer: any ColorToken { get } - var onPrimaryContainer: any ColorToken { get } -} diff --git a/core/Sources/Theming/Content/Colors/Content/Primary/ColorsPrimaryDefault.swift b/core/Sources/Theming/Content/Colors/Content/Primary/ColorsPrimaryDefault.swift deleted file mode 100644 index fc61cf31a..000000000 --- a/core/Sources/Theming/Content/Colors/Content/Primary/ColorsPrimaryDefault.swift +++ /dev/null @@ -1,35 +0,0 @@ -// -// ColorsPrimaryDefault.swift -// SparkCore -// -// Created by louis.borlee on 23/03/2023. -// Copyright © 2023 Adevinta. All rights reserved. -// - -public struct ColorsPrimaryDefault: ColorsPrimary { - - // MARK: - Properties - - public let primary: any ColorToken - public let onPrimary: any ColorToken - public let primaryVariant: any ColorToken - public let onPrimaryVariant: any ColorToken - public let primaryContainer: any ColorToken - public let onPrimaryContainer: any ColorToken - - // MARK: - Init - - public init(primary: any ColorToken, - onPrimary: any ColorToken, - primaryVariant: any ColorToken, - onPrimaryVariant: any ColorToken, - primaryContainer: any ColorToken, - onPrimaryContainer: any ColorToken) { - self.primary = primary - self.onPrimary = onPrimary - self.primaryVariant = primaryVariant - self.onPrimaryVariant = onPrimaryVariant - self.primaryContainer = primaryContainer - self.onPrimaryContainer = onPrimaryContainer - } -} diff --git a/core/Sources/Theming/Content/Colors/Content/Primary/ColorsPrimaryGeneratedMock+ExtensionTests.swift b/core/Sources/Theming/Content/Colors/Content/Primary/ColorsPrimaryGeneratedMock+ExtensionTests.swift deleted file mode 100644 index 737928f33..000000000 --- a/core/Sources/Theming/Content/Colors/Content/Primary/ColorsPrimaryGeneratedMock+ExtensionTests.swift +++ /dev/null @@ -1,29 +0,0 @@ -// -// ColorsPrimaryGeneratedMock+ExtensionTests.swift -// SparkCore -// -// Created by robin.lemaire on 11/04/2023. -// Copyright © 2023 Adevinta. All rights reserved. -// - -@testable import SparkCore - -extension ColorsPrimaryGeneratedMock { - - // MARK: - Methods - - static func mocked() -> ColorsPrimaryGeneratedMock { - let mock = ColorsPrimaryGeneratedMock() - - mock.underlyingPrimary = ColorTokenGeneratedMock.random() - mock.underlyingOnPrimary = ColorTokenGeneratedMock.random() - - mock.underlyingPrimaryVariant = ColorTokenGeneratedMock.random() - mock.underlyingOnPrimaryVariant = ColorTokenGeneratedMock.random() - - mock.underlyingPrimaryContainer = ColorTokenGeneratedMock.random() - mock.underlyingOnPrimaryContainer = ColorTokenGeneratedMock.random() - - return mock - } -} diff --git a/core/Sources/Theming/Content/Colors/Content/Secondary/ColorsSecondary.swift b/core/Sources/Theming/Content/Colors/Content/Secondary/ColorsSecondary.swift deleted file mode 100644 index 622497c0f..000000000 --- a/core/Sources/Theming/Content/Colors/Content/Secondary/ColorsSecondary.swift +++ /dev/null @@ -1,17 +0,0 @@ -// -// ColorsSecondary.swift -// SparkCore -// -// Created by louis.borlee on 23/03/2023. -// Copyright © 2023 Adevinta. All rights reserved. -// - -// sourcery: AutoMockable -public protocol ColorsSecondary { - var secondary: any ColorToken { get } - var onSecondary: any ColorToken { get } - var secondaryVariant: any ColorToken { get } - var onSecondaryVariant: any ColorToken { get } - var secondaryContainer: any ColorToken { get } - var onSecondaryContainer: any ColorToken { get } -} diff --git a/core/Sources/Theming/Content/Colors/Content/Secondary/ColorsSecondaryDefault.swift b/core/Sources/Theming/Content/Colors/Content/Secondary/ColorsSecondaryDefault.swift deleted file mode 100644 index 174b556e1..000000000 --- a/core/Sources/Theming/Content/Colors/Content/Secondary/ColorsSecondaryDefault.swift +++ /dev/null @@ -1,35 +0,0 @@ -// -// ColorsSecondaryDefault.swift -// SparkCore -// -// Created by louis.borlee on 23/03/2023. -// Copyright © 2023 Adevinta. All rights reserved. -// - -public struct ColorsSecondaryDefault: ColorsSecondary { - - // MARK: - Properties - - public let secondary: any ColorToken - public let onSecondary: any ColorToken - public let secondaryVariant: any ColorToken - public let onSecondaryVariant: any ColorToken - public let secondaryContainer: any ColorToken - public let onSecondaryContainer: any ColorToken - - // MARK: - Init - - public init(secondary: any ColorToken, - onSecondary: any ColorToken, - secondaryVariant: any ColorToken, - onSecondaryVariant: any ColorToken, - secondaryContainer: any ColorToken, - onSecondaryContainer: any ColorToken) { - self.secondary = secondary - self.onSecondary = onSecondary - self.secondaryVariant = secondaryVariant - self.onSecondaryVariant = onSecondaryVariant - self.secondaryContainer = secondaryContainer - self.onSecondaryContainer = onSecondaryContainer - } -} diff --git a/core/Sources/Theming/Content/Colors/Content/Secondary/ColorsSecondaryGeneratedMock+ExtensionTests.swift b/core/Sources/Theming/Content/Colors/Content/Secondary/ColorsSecondaryGeneratedMock+ExtensionTests.swift deleted file mode 100644 index 384895ee7..000000000 --- a/core/Sources/Theming/Content/Colors/Content/Secondary/ColorsSecondaryGeneratedMock+ExtensionTests.swift +++ /dev/null @@ -1,29 +0,0 @@ -// -// ColorsSecondaryGeneratedMock+ExtensionTests.swift -// SparkCore -// -// Created by robin.lemaire on 11/04/2023. -// Copyright © 2023 Adevinta. All rights reserved. -// - -@testable import SparkCore - -extension ColorsSecondaryGeneratedMock { - - // MARK: - Methods - - static func mocked() -> ColorsSecondaryGeneratedMock { - let mock = ColorsSecondaryGeneratedMock() - - mock.underlyingSecondary = ColorTokenGeneratedMock.random() - mock.underlyingOnSecondary = ColorTokenGeneratedMock.random() - - mock.underlyingSecondaryVariant = ColorTokenGeneratedMock.random() - mock.underlyingOnSecondaryVariant = ColorTokenGeneratedMock.random() - - mock.underlyingSecondaryContainer = ColorTokenGeneratedMock.random() - mock.underlyingOnSecondaryContainer = ColorTokenGeneratedMock.random() - - return mock - } -} diff --git a/core/Sources/Theming/Content/Colors/Content/States/ColorsStates.swift b/core/Sources/Theming/Content/Colors/Content/States/ColorsStates.swift index 27716857b..fb28611dd 100644 --- a/core/Sources/Theming/Content/Colors/Content/States/ColorsStates.swift +++ b/core/Sources/Theming/Content/Colors/Content/States/ColorsStates.swift @@ -9,17 +9,17 @@ // sourcery: AutoMockable public protocol ColorsStates { - // MARK: - Primary + // MARK: - Main - var primaryPressed: any ColorToken { get } - var primaryVariantPressed: any ColorToken { get } - var primaryContainerPressed: any ColorToken { get } + var mainPressed: any ColorToken { get } + var mainVariantPressed: any ColorToken { get } + var mainContainerPressed: any ColorToken { get } - // MARK: - Secondary + // MARK: - Support - var secondaryPressed: any ColorToken { get } - var secondaryVariantPressed: any ColorToken { get } - var secondaryContainerPressed: any ColorToken { get } + var supportPressed: any ColorToken { get } + var supportVariantPressed: any ColorToken { get } + var supportContainerPressed: any ColorToken { get } // MARK: - Base diff --git a/core/Sources/Theming/Content/Colors/Content/States/ColorsStatesDefault.swift b/core/Sources/Theming/Content/Colors/Content/States/ColorsStatesDefault.swift index 3a60aab81..6b960515f 100644 --- a/core/Sources/Theming/Content/Colors/Content/States/ColorsStatesDefault.swift +++ b/core/Sources/Theming/Content/Colors/Content/States/ColorsStatesDefault.swift @@ -10,12 +10,12 @@ public struct ColorsStatesDefault: ColorsStates { // MARK: - Properties - public let primaryPressed: any ColorToken - public let primaryVariantPressed: any ColorToken - public let primaryContainerPressed: any ColorToken - public let secondaryPressed: any ColorToken - public let secondaryVariantPressed: any ColorToken - public let secondaryContainerPressed: any ColorToken + public let mainPressed: any ColorToken + public let mainVariantPressed: any ColorToken + public let mainContainerPressed: any ColorToken + public let supportPressed: any ColorToken + public let supportVariantPressed: any ColorToken + public let supportContainerPressed: any ColorToken public let surfacePressed: any ColorToken public let surfaceInversePressed: any ColorToken public let outlinePressed: any ColorToken @@ -32,12 +32,12 @@ public struct ColorsStatesDefault: ColorsStates { // MARK: - Init - public init(primaryPressed: any ColorToken, - primaryVariantPressed: any ColorToken, - primaryContainerPressed: any ColorToken, - secondaryPressed: any ColorToken, - secondaryVariantPressed: any ColorToken, - secondaryContainerPressed: any ColorToken, + public init(mainPressed: any ColorToken, + mainVariantPressed: any ColorToken, + mainContainerPressed: any ColorToken, + supportPressed: any ColorToken, + supportVariantPressed: any ColorToken, + supportContainerPressed: any ColorToken, surfacePressed: any ColorToken, surfaceInversePressed: any ColorToken, outlinePressed: any ColorToken, @@ -51,12 +51,12 @@ public struct ColorsStatesDefault: ColorsStates { infoContainerPressed: any ColorToken, neutralPressed: any ColorToken, neutralContainerPressed: any ColorToken) { - self.primaryPressed = primaryPressed - self.primaryVariantPressed = primaryVariantPressed - self.primaryContainerPressed = primaryContainerPressed - self.secondaryPressed = secondaryPressed - self.secondaryVariantPressed = secondaryVariantPressed - self.secondaryContainerPressed = secondaryContainerPressed + self.mainPressed = mainPressed + self.mainVariantPressed = mainVariantPressed + self.mainContainerPressed = mainContainerPressed + self.supportPressed = supportPressed + self.supportVariantPressed = supportVariantPressed + self.supportContainerPressed = supportContainerPressed self.surfacePressed = surfacePressed self.surfaceInversePressed = surfaceInversePressed self.outlinePressed = outlinePressed diff --git a/core/Sources/Theming/Content/Colors/Content/States/ColorsStatesGeneratedMock+ExtensionTests.swift b/core/Sources/Theming/Content/Colors/Content/States/ColorsStatesGeneratedMock+ExtensionTests.swift index 1c048b591..a954dfea0 100644 --- a/core/Sources/Theming/Content/Colors/Content/States/ColorsStatesGeneratedMock+ExtensionTests.swift +++ b/core/Sources/Theming/Content/Colors/Content/States/ColorsStatesGeneratedMock+ExtensionTests.swift @@ -15,13 +15,13 @@ extension ColorsStatesGeneratedMock { static func mocked() -> ColorsStatesGeneratedMock { let mock = ColorsStatesGeneratedMock() - mock.underlyingPrimaryPressed = ColorTokenGeneratedMock.random() - mock.underlyingPrimaryVariantPressed = ColorTokenGeneratedMock.random() - mock.underlyingPrimaryContainerPressed = ColorTokenGeneratedMock.random() + mock.underlyingMainPressed = ColorTokenGeneratedMock.random() + mock.underlyingMainVariantPressed = ColorTokenGeneratedMock.random() + mock.underlyingMainContainerPressed = ColorTokenGeneratedMock.random() - mock.underlyingSecondaryPressed = ColorTokenGeneratedMock.random() - mock.underlyingSecondaryVariantPressed = ColorTokenGeneratedMock.random() - mock.underlyingSecondaryContainerPressed = ColorTokenGeneratedMock.random() + mock.underlyingSupportPressed = ColorTokenGeneratedMock.random() + mock.underlyingSupportVariantPressed = ColorTokenGeneratedMock.random() + mock.underlyingSupportContainerPressed = ColorTokenGeneratedMock.random() mock.underlyingSurfacePressed = ColorTokenGeneratedMock.random() mock.underlyingSurfaceInversePressed = ColorTokenGeneratedMock.random() diff --git a/core/Sources/Theming/Content/Colors/Content/Support/ColorsSupport.swift b/core/Sources/Theming/Content/Colors/Content/Support/ColorsSupport.swift new file mode 100644 index 000000000..64e064ee3 --- /dev/null +++ b/core/Sources/Theming/Content/Colors/Content/Support/ColorsSupport.swift @@ -0,0 +1,17 @@ +// +// ColorsSupport.swift +// SparkCore +// +// Created by louis.borlee on 23/03/2023. +// Copyright © 2023 Adevinta. All rights reserved. +// + +// sourcery: AutoMockable +public protocol ColorsSupport { + var support: any ColorToken { get } + var onSupport: any ColorToken { get } + var supportVariant: any ColorToken { get } + var onSupportVariant: any ColorToken { get } + var supportContainer: any ColorToken { get } + var onSupportContainer: any ColorToken { get } +} diff --git a/core/Sources/Theming/Content/Colors/Content/Support/ColorsSupportDefault.swift b/core/Sources/Theming/Content/Colors/Content/Support/ColorsSupportDefault.swift new file mode 100644 index 000000000..bdac76dec --- /dev/null +++ b/core/Sources/Theming/Content/Colors/Content/Support/ColorsSupportDefault.swift @@ -0,0 +1,35 @@ +// +// ColorsSupportDefault.swift +// SparkCore +// +// Created by louis.borlee on 23/03/2023. +// Copyright © 2023 Adevinta. All rights reserved. +// + +public struct ColorsSupportDefault: ColorsSupport { + + // MARK: - Properties + + public let support: any ColorToken + public let onSupport: any ColorToken + public let supportVariant: any ColorToken + public let onSupportVariant: any ColorToken + public let supportContainer: any ColorToken + public let onSupportContainer: any ColorToken + + // MARK: - Init + + public init(support: any ColorToken, + onSupport: any ColorToken, + supportVariant: any ColorToken, + onSupportVariant: any ColorToken, + supportContainer: any ColorToken, + onSupportContainer: any ColorToken) { + self.support = support + self.onSupport = onSupport + self.supportVariant = supportVariant + self.onSupportVariant = onSupportVariant + self.supportContainer = supportContainer + self.onSupportContainer = onSupportContainer + } +} diff --git a/core/Sources/Theming/Content/Colors/Content/Support/ColorsSupportGeneratedMock+ExtensionTests.swift b/core/Sources/Theming/Content/Colors/Content/Support/ColorsSupportGeneratedMock+ExtensionTests.swift new file mode 100644 index 000000000..64203b0f1 --- /dev/null +++ b/core/Sources/Theming/Content/Colors/Content/Support/ColorsSupportGeneratedMock+ExtensionTests.swift @@ -0,0 +1,29 @@ +// +// ColorsSupportGeneratedMock+ExtensionTests.swift +// SparkCore +// +// Created by robin.lemaire on 11/04/2023. +// Copyright © 2023 Adevinta. All rights reserved. +// + +@testable import SparkCore + +extension ColorsSupportGeneratedMock { + + // MARK: - Methods + + static func mocked() -> ColorsSupportGeneratedMock { + let mock = ColorsSupportGeneratedMock() + + mock.underlyingSupport = ColorTokenGeneratedMock.random() + mock.underlyingOnSupport = ColorTokenGeneratedMock.random() + + mock.underlyingSupportVariant = ColorTokenGeneratedMock.random() + mock.underlyingOnSupportVariant = ColorTokenGeneratedMock.random() + + mock.underlyingSupportContainer = ColorTokenGeneratedMock.random() + mock.underlyingOnSupportContainer = ColorTokenGeneratedMock.random() + + return mock + } +} diff --git a/core/Unit-tests/ColorTests.swift b/core/Unit-tests/ColorTests.swift index 5fc3490f0..2a6ecef1a 100644 --- a/core/Unit-tests/ColorTests.swift +++ b/core/Unit-tests/ColorTests.swift @@ -26,13 +26,13 @@ final class ColorTests: TestCase { self.testAllColors(colors: self.getColors(for: mirror)) } - func test_primary_colors() throws { - let mirror = Mirror(reflecting: self.colors.primary) + func test_main_colors() throws { + let mirror = Mirror(reflecting: self.colors.main) self.testAllColors(colors: self.getColors(for: mirror)) } - func test_secondary_colors() throws { - let mirror = Mirror(reflecting: self.colors.secondary) + func test_support_colors() throws { + let mirror = Mirror(reflecting: self.colors.support) self.testAllColors(colors: self.getColors(for: mirror)) } @@ -47,10 +47,20 @@ final class ColorTests: TestCase { let vc = UIHostingController(rootView: view) vc.view.frame = CGRect(x: 0, y: 0, width: 10, height: 10) vc.overrideUserInterfaceStyle = .light - sparktAssertSnapshot(matching: vc.view, as: .image, named: value.key, testName: testName) + sparktAssertSnapshot( + matching: vc.view, + as: .image, + named: value.key, + testName: testName + ) vc.overrideUserInterfaceStyle = .dark - sparktAssertSnapshot(matching: vc.view, as: .image, named: value.key + "-dark", testName: testName) + sparktAssertSnapshot( + matching: vc.view, + as: .image, + named: value.key + "-dark", + testName: testName + ) } } diff --git a/spark/Demo/Classes/Main/MainView.swift b/spark/Demo/Classes/Main/MainView.swift index efe0ea06c..3afc7fbc8 100644 --- a/spark/Demo/Classes/Main/MainView.swift +++ b/spark/Demo/Classes/Main/MainView.swift @@ -61,7 +61,7 @@ struct MainView: View { } } } - .accentColor(self.theme.colors.primary.primary.color) + .accentColor(self.theme.colors.main.main.color) } } diff --git a/spark/Demo/Classes/View/Components/RadioButton/RadioButtonGroupState-Extension.swift b/spark/Demo/Classes/View/Components/RadioButton/RadioButtonGroupState-Extension.swift index 6acf298de..466eb6f73 100644 --- a/spark/Demo/Classes/View/Components/RadioButton/RadioButtonGroupState-Extension.swift +++ b/spark/Demo/Classes/View/Components/RadioButton/RadioButtonGroupState-Extension.swift @@ -35,7 +35,7 @@ extension RadioButtonGroupState { case .warning: return theme.colors.feedback.alert.color case .error: return theme.colors.feedback.error.color case .success: return theme.colors.feedback.success.color - case .enabled: return theme.colors.primary.primary.color + case .enabled: return theme.colors.main.main.color case .disabled: return theme.colors.base.outline.color } } diff --git a/spark/Demo/Classes/View/Components/Switch/SwitchComponentItemsUIView.swift b/spark/Demo/Classes/View/Components/Switch/SwitchComponentItemsUIView.swift index 07eca13e2..71be1f563 100644 --- a/spark/Demo/Classes/View/Components/Switch/SwitchComponentItemsUIView.swift +++ b/spark/Demo/Classes/View/Components/Switch/SwitchComponentItemsUIView.swift @@ -45,7 +45,7 @@ struct SwitchComponentItemsUIView: UIViewRepresentable { self.attributedText = .init( string: viewModel.text, attributes: [ - .foregroundColor: SparkTheme.shared.colors.primary.primary.uiColor, + .foregroundColor: SparkTheme.shared.colors.main.main.uiColor, .font: SparkTheme.shared.typography.body2Highlight.uiFont ] ) diff --git a/spark/Demo/Classes/View/Theme/Color/Sections/Enum/ColorSectionType.swift b/spark/Demo/Classes/View/Theme/Color/Sections/Enum/ColorSectionType.swift index f219f294b..4f190f177 100644 --- a/spark/Demo/Classes/View/Theme/Color/Sections/Enum/ColorSectionType.swift +++ b/spark/Demo/Classes/View/Theme/Color/Sections/Enum/ColorSectionType.swift @@ -21,9 +21,9 @@ enum ColorSectionType: CaseIterable { let colors = theme.colors switch self { case .primary: - return ColorSectionPrimaryViewModel(color: colors.primary) + return ColorSectionMainViewModel(color: colors.main) case .secondary: - return ColorSectionSecondaryViewModel(color: colors.secondary) + return ColorSectionSupportViewModel(color: colors.support) case .base: return ColorSectionBaseViewModel(color: colors.base) case .feedback: diff --git a/spark/Demo/Classes/View/Theme/Color/Sections/ViewModel/ColorSectionMainViewModel.swift b/spark/Demo/Classes/View/Theme/Color/Sections/ViewModel/ColorSectionMainViewModel.swift new file mode 100644 index 000000000..ddefe4119 --- /dev/null +++ b/spark/Demo/Classes/View/Theme/Color/Sections/ViewModel/ColorSectionMainViewModel.swift @@ -0,0 +1,32 @@ +// +// ColorSectionMainViewModel.swift +// SparkDemo +// +// Created by robin.lemaire on 01/03/2023. +// + +import SparkCore + +struct ColorSectionMainViewModel: ColorSectionViewModelable { + + // MARK: - Properties + + let name: String + let itemViewModels: [[ColorItemViewModel]] + + // MARK: - Initialization + + init(color: ColorsMain) { + self.name = "main" + self.itemViewModels = [ + [ + .init(name: "main", colorToken: color.main), + .init(name: "onMain", colorToken: color.onMain), + .init(name: "mainVariant", colorToken: color.mainVariant), + .init(name: "onMainVariant", colorToken: color.onMainVariant), + .init(name: "mainContainer", colorToken: color.mainContainer), + .init(name: "onMainContainer", colorToken: color.onMainContainer) + ] + ] + } +} diff --git a/spark/Demo/Classes/View/Theme/Color/Sections/ViewModel/ColorSectionPrimaryViewModel.swift b/spark/Demo/Classes/View/Theme/Color/Sections/ViewModel/ColorSectionPrimaryViewModel.swift deleted file mode 100644 index b117fc249..000000000 --- a/spark/Demo/Classes/View/Theme/Color/Sections/ViewModel/ColorSectionPrimaryViewModel.swift +++ /dev/null @@ -1,32 +0,0 @@ -// -// ColorSectionPrimaryViewModel.swift -// SparkDemo -// -// Created by robin.lemaire on 01/03/2023. -// - -import SparkCore - -struct ColorSectionPrimaryViewModel: ColorSectionViewModelable { - - // MARK: - Properties - - let name: String - let itemViewModels: [[ColorItemViewModel]] - - // MARK: - Initialization - - init(color: ColorsPrimary) { - self.name = "primary" - self.itemViewModels = [ - [ - .init(name: "primary", colorToken: color.primary), - .init(name: "onPrimary", colorToken: color.onPrimary), - .init(name: "primaryVariant", colorToken: color.primaryVariant), - .init(name: "onPrimaryVariant", colorToken: color.onPrimaryVariant), - .init(name: "primaryContainer", colorToken: color.primaryContainer), - .init(name: "onPrimaryContainer", colorToken: color.onPrimaryContainer) - ] - ] - } -} diff --git a/spark/Demo/Classes/View/Theme/Color/Sections/ViewModel/ColorSectionSecondaryViewModel.swift b/spark/Demo/Classes/View/Theme/Color/Sections/ViewModel/ColorSectionSecondaryViewModel.swift deleted file mode 100644 index 2d861c3e4..000000000 --- a/spark/Demo/Classes/View/Theme/Color/Sections/ViewModel/ColorSectionSecondaryViewModel.swift +++ /dev/null @@ -1,32 +0,0 @@ -// -// ColorSectionSecondaryViewModel.swift -// SparkDemo -// -// Created by robin.lemaire on 01/03/2023. -// - -import SparkCore - -struct ColorSectionSecondaryViewModel: ColorSectionViewModelable { - - // MARK: - Properties - - let name: String - let itemViewModels: [[ColorItemViewModel]] - - // MARK: - Initialization - - init(color: ColorsSecondary) { - self.name = "secondary" - self.itemViewModels = [ - [ - .init(name: "secondary", colorToken: color.secondary), - .init(name: "onSecondary", colorToken: color.onSecondary), - .init(name: "secondaryVariant", colorToken: color.secondaryVariant), - .init(name: "onSecondaryVariant", colorToken: color.onSecondaryVariant), - .init(name: "secondaryContainer", colorToken: color.secondaryContainer), - .init(name: "onSecondaryContainer", colorToken: color.onSecondaryContainer) - ] - ] - } -} diff --git a/spark/Demo/Classes/View/Theme/Color/Sections/ViewModel/ColorSectionStatesViewModel.swift b/spark/Demo/Classes/View/Theme/Color/Sections/ViewModel/ColorSectionStatesViewModel.swift index 08ee57f31..8a2ca8d1a 100644 --- a/spark/Demo/Classes/View/Theme/Color/Sections/ViewModel/ColorSectionStatesViewModel.swift +++ b/spark/Demo/Classes/View/Theme/Color/Sections/ViewModel/ColorSectionStatesViewModel.swift @@ -20,12 +20,12 @@ struct ColorSectionStatesViewModel: ColorSectionViewModelable { self.name = "states" self.itemViewModels = [ [ - .init(name: "primaryPressed", colorToken: color.primaryPressed), - .init(name: "primaryVariantPressed", colorToken: color.primaryVariantPressed), - .init(name: "primaryContainerPressed", colorToken: color.primaryContainerPressed), - .init(name: "secondaryPressed", colorToken: color.secondaryPressed), - .init(name: "secondaryVariantPressed", colorToken: color.secondaryVariantPressed), - .init(name: "secondaryContainerPressed", colorToken: color.secondaryContainerPressed), + .init(name: "mainPressed", colorToken: color.mainPressed), + .init(name: "mainVariantPressed", colorToken: color.mainVariantPressed), + .init(name: "mainContainerPressed", colorToken: color.mainContainerPressed), + .init(name: "supportPressed", colorToken: color.supportPressed), + .init(name: "supportVariantPressed", colorToken: color.supportVariantPressed), + .init(name: "supportContainerPressed", colorToken: color.supportContainerPressed), .init(name: "surfacePressed", colorToken: color.surfacePressed), .init(name: "surfaceInversePressed", colorToken: color.surfaceInversePressed), .init(name: "outlinePressed", colorToken: color.outlinePressed), diff --git a/spark/Demo/Classes/View/Theme/Color/Sections/ViewModel/ColorSectionSupportViewModel.swift b/spark/Demo/Classes/View/Theme/Color/Sections/ViewModel/ColorSectionSupportViewModel.swift new file mode 100644 index 000000000..c30e1f520 --- /dev/null +++ b/spark/Demo/Classes/View/Theme/Color/Sections/ViewModel/ColorSectionSupportViewModel.swift @@ -0,0 +1,32 @@ +// +// ColorSectionSupportViewModel.swift +// SparkDemo +// +// Created by robin.lemaire on 01/03/2023. +// + +import SparkCore + +struct ColorSectionSupportViewModel: ColorSectionViewModelable { + + // MARK: - Properties + + let name: String + let itemViewModels: [[ColorItemViewModel]] + + // MARK: - Initialization + + init(color: ColorsSupport) { + self.name = "support" + self.itemViewModels = [ + [ + .init(name: "support", colorToken: color.support), + .init(name: "onSupport", colorToken: color.onSupport), + .init(name: "supportVariant", colorToken: color.supportVariant), + .init(name: "onSupportVariant", colorToken: color.onSupportVariant), + .init(name: "supportContainer", colorToken: color.supportContainer), + .init(name: "onSupportContainer", colorToken: color.onSupportContainer) + ] + ] + } +} diff --git a/spark/Sources/Resources/Colors.xcassets/Primary/Contents.json b/spark/Sources/Resources/Colors.xcassets/Main/Contents.json similarity index 100% rename from spark/Sources/Resources/Colors.xcassets/Primary/Contents.json rename to spark/Sources/Resources/Colors.xcassets/Main/Contents.json diff --git a/spark/Sources/Resources/Colors.xcassets/Primary/primary-container.colorset/Contents.json b/spark/Sources/Resources/Colors.xcassets/Main/main-container.colorset/Contents.json similarity index 100% rename from spark/Sources/Resources/Colors.xcassets/Primary/primary-container.colorset/Contents.json rename to spark/Sources/Resources/Colors.xcassets/Main/main-container.colorset/Contents.json diff --git a/spark/Sources/Resources/Colors.xcassets/Primary/on-primary-container.colorset/Contents.json b/spark/Sources/Resources/Colors.xcassets/Main/main-variant.colorset/Contents.json similarity index 100% rename from spark/Sources/Resources/Colors.xcassets/Primary/on-primary-container.colorset/Contents.json rename to spark/Sources/Resources/Colors.xcassets/Main/main-variant.colorset/Contents.json diff --git a/spark/Sources/Resources/Colors.xcassets/Primary/primary.colorset/Contents.json b/spark/Sources/Resources/Colors.xcassets/Main/main.colorset/Contents.json similarity index 100% rename from spark/Sources/Resources/Colors.xcassets/Primary/primary.colorset/Contents.json rename to spark/Sources/Resources/Colors.xcassets/Main/main.colorset/Contents.json diff --git a/spark/Sources/Resources/Colors.xcassets/Primary/primary-variant.colorset/Contents.json b/spark/Sources/Resources/Colors.xcassets/Main/on-main-container.colorset/Contents.json similarity index 100% rename from spark/Sources/Resources/Colors.xcassets/Primary/primary-variant.colorset/Contents.json rename to spark/Sources/Resources/Colors.xcassets/Main/on-main-container.colorset/Contents.json diff --git a/spark/Sources/Resources/Colors.xcassets/Primary/on-primary-variant.colorset/Contents.json b/spark/Sources/Resources/Colors.xcassets/Main/on-main-variant.colorset/Contents.json similarity index 100% rename from spark/Sources/Resources/Colors.xcassets/Primary/on-primary-variant.colorset/Contents.json rename to spark/Sources/Resources/Colors.xcassets/Main/on-main-variant.colorset/Contents.json diff --git a/spark/Sources/Resources/Colors.xcassets/Primary/on-primary.colorset/Contents.json b/spark/Sources/Resources/Colors.xcassets/Main/on-main.colorset/Contents.json similarity index 100% rename from spark/Sources/Resources/Colors.xcassets/Primary/on-primary.colorset/Contents.json rename to spark/Sources/Resources/Colors.xcassets/Main/on-main.colorset/Contents.json diff --git a/spark/Sources/Resources/Colors.xcassets/States/primary-container-pressed.colorset/Contents.json b/spark/Sources/Resources/Colors.xcassets/States/main-container-pressed.colorset/Contents.json similarity index 100% rename from spark/Sources/Resources/Colors.xcassets/States/primary-container-pressed.colorset/Contents.json rename to spark/Sources/Resources/Colors.xcassets/States/main-container-pressed.colorset/Contents.json diff --git a/spark/Sources/Resources/Colors.xcassets/States/primary-pressed.colorset/Contents.json b/spark/Sources/Resources/Colors.xcassets/States/main-pressed.colorset/Contents.json similarity index 100% rename from spark/Sources/Resources/Colors.xcassets/States/primary-pressed.colorset/Contents.json rename to spark/Sources/Resources/Colors.xcassets/States/main-pressed.colorset/Contents.json diff --git a/spark/Sources/Resources/Colors.xcassets/States/primary-variant-pressed.colorset/Contents.json b/spark/Sources/Resources/Colors.xcassets/States/main-variant-pressed.colorset/Contents.json similarity index 100% rename from spark/Sources/Resources/Colors.xcassets/States/primary-variant-pressed.colorset/Contents.json rename to spark/Sources/Resources/Colors.xcassets/States/main-variant-pressed.colorset/Contents.json diff --git a/spark/Sources/Resources/Colors.xcassets/States/secondary-container-pressed.colorset/Contents.json b/spark/Sources/Resources/Colors.xcassets/States/support-container-pressed.colorset/Contents.json similarity index 100% rename from spark/Sources/Resources/Colors.xcassets/States/secondary-container-pressed.colorset/Contents.json rename to spark/Sources/Resources/Colors.xcassets/States/support-container-pressed.colorset/Contents.json diff --git a/spark/Sources/Resources/Colors.xcassets/States/secondary-pressed.colorset/Contents.json b/spark/Sources/Resources/Colors.xcassets/States/support-pressed.colorset/Contents.json similarity index 100% rename from spark/Sources/Resources/Colors.xcassets/States/secondary-pressed.colorset/Contents.json rename to spark/Sources/Resources/Colors.xcassets/States/support-pressed.colorset/Contents.json diff --git a/spark/Sources/Resources/Colors.xcassets/States/secondary-variant-pressed.colorset/Contents.json b/spark/Sources/Resources/Colors.xcassets/States/support-variant-pressed.colorset/Contents.json similarity index 100% rename from spark/Sources/Resources/Colors.xcassets/States/secondary-variant-pressed.colorset/Contents.json rename to spark/Sources/Resources/Colors.xcassets/States/support-variant-pressed.colorset/Contents.json diff --git a/spark/Sources/Resources/Colors.xcassets/Secondary/Contents.json b/spark/Sources/Resources/Colors.xcassets/Support/Contents.json similarity index 100% rename from spark/Sources/Resources/Colors.xcassets/Secondary/Contents.json rename to spark/Sources/Resources/Colors.xcassets/Support/Contents.json diff --git a/spark/Sources/Resources/Colors.xcassets/Secondary/on-secondary-container.colorset/Contents.json b/spark/Sources/Resources/Colors.xcassets/Support/on-support-container.colorset/Contents.json similarity index 100% rename from spark/Sources/Resources/Colors.xcassets/Secondary/on-secondary-container.colorset/Contents.json rename to spark/Sources/Resources/Colors.xcassets/Support/on-support-container.colorset/Contents.json diff --git a/spark/Sources/Resources/Colors.xcassets/Secondary/on-secondary-variant.colorset/Contents.json b/spark/Sources/Resources/Colors.xcassets/Support/on-support-variant.colorset/Contents.json similarity index 100% rename from spark/Sources/Resources/Colors.xcassets/Secondary/on-secondary-variant.colorset/Contents.json rename to spark/Sources/Resources/Colors.xcassets/Support/on-support-variant.colorset/Contents.json diff --git a/spark/Sources/Resources/Colors.xcassets/Secondary/on-secondary.colorset/Contents.json b/spark/Sources/Resources/Colors.xcassets/Support/on-support.colorset/Contents.json similarity index 100% rename from spark/Sources/Resources/Colors.xcassets/Secondary/on-secondary.colorset/Contents.json rename to spark/Sources/Resources/Colors.xcassets/Support/on-support.colorset/Contents.json diff --git a/spark/Sources/Resources/Colors.xcassets/Secondary/secondary-container.colorset/Contents.json b/spark/Sources/Resources/Colors.xcassets/Support/support-container.colorset/Contents.json similarity index 100% rename from spark/Sources/Resources/Colors.xcassets/Secondary/secondary-container.colorset/Contents.json rename to spark/Sources/Resources/Colors.xcassets/Support/support-container.colorset/Contents.json diff --git a/spark/Sources/Resources/Colors.xcassets/Secondary/secondary-variant.colorset/Contents.json b/spark/Sources/Resources/Colors.xcassets/Support/support-variant.colorset/Contents.json similarity index 100% rename from spark/Sources/Resources/Colors.xcassets/Secondary/secondary-variant.colorset/Contents.json rename to spark/Sources/Resources/Colors.xcassets/Support/support-variant.colorset/Contents.json diff --git a/spark/Sources/Resources/Colors.xcassets/Secondary/secondary.colorset/Contents.json b/spark/Sources/Resources/Colors.xcassets/Support/support.colorset/Contents.json similarity index 100% rename from spark/Sources/Resources/Colors.xcassets/Secondary/secondary.colorset/Contents.json rename to spark/Sources/Resources/Colors.xcassets/Support/support.colorset/Contents.json diff --git a/spark/Sources/Resources/Generated/Colors+Generated.swift b/spark/Sources/Resources/Generated/Colors+Generated.swift deleted file mode 100644 index 82768dbf8..000000000 --- a/spark/Sources/Resources/Generated/Colors+Generated.swift +++ /dev/null @@ -1,106 +0,0 @@ -// swiftlint:disable all -// Generated using SwiftGen — https://github.com/SwiftGen/SwiftGen - -#if os(macOS) - import AppKit -#elseif os(iOS) - import UIKit -#elseif os(tvOS) || os(watchOS) - import UIKit -#endif -#if canImport(SwiftUI) - import SwiftUI -#endif - -// Deprecated typealiases -@available(*, deprecated, renamed: "ColorAsset.Color", message: "This typealias will be removed in SwiftGen 7.0") -public typealias AssetColorTypeAlias = ColorAsset.Color - -// swiftlint:disable superfluous_disable_command file_length implicit_return - -// MARK: - Asset Catalogs - -// swiftlint:disable identifier_name line_length nesting type_body_length type_name -public enum SparkColorAsset { - public static let primary = ColorAsset(name: "Primary") - public static let secondary = ColorAsset(name: "Secondary") -} -// swiftlint:enable identifier_name line_length nesting type_body_length type_name - -// MARK: - Implementation Details - -public final class ColorAsset { - public fileprivate(set) var name: String - - #if os(macOS) - public typealias Color = NSColor - #elseif os(iOS) || os(tvOS) || os(watchOS) - public typealias Color = UIColor - #endif - - @available(iOS 11.0, tvOS 11.0, watchOS 4.0, macOS 10.13, *) - public private(set) lazy var color: Color = { - guard let color = Color(asset: self) else { - fatalError("Unable to load color asset named \(name).") - } - return color - }() - - #if os(iOS) || os(tvOS) - @available(iOS 11.0, tvOS 11.0, *) - public func color(compatibleWith traitCollection: UITraitCollection) -> Color { - let bundle = BundleToken.bundle - guard let color = Color(named: name, in: bundle, compatibleWith: traitCollection) else { - fatalError("Unable to load color asset named \(name).") - } - return color - } - #endif - - #if canImport(SwiftUI) - @available(iOS 13.0, tvOS 13.0, watchOS 6.0, macOS 10.15, *) - public private(set) lazy var swiftUIColor: SwiftUI.Color = { - SwiftUI.Color(asset: self) - }() - #endif - - fileprivate init(name: String) { - self.name = name - } -} - -public extension ColorAsset.Color { - @available(iOS 11.0, tvOS 11.0, watchOS 4.0, macOS 10.13, *) - convenience init?(asset: ColorAsset) { - let bundle = BundleToken.bundle - #if os(iOS) || os(tvOS) - self.init(named: asset.name, in: bundle, compatibleWith: nil) - #elseif os(macOS) - self.init(named: NSColor.Name(asset.name), bundle: bundle) - #elseif os(watchOS) - self.init(named: asset.name) - #endif - } -} - -#if canImport(SwiftUI) -@available(iOS 13.0, tvOS 13.0, watchOS 6.0, macOS 10.15, *) -public extension SwiftUI.Color { - init(asset: ColorAsset) { - let bundle = BundleToken.bundle - self.init(asset.name, bundle: bundle) - } -} -#endif - -// swiftlint:disable convenience_type -private final class BundleToken { - static let bundle: Bundle = { - #if SWIFT_PACKAGE - return Bundle.module - #else - return Bundle(for: BundleToken.self) - #endif - }() -} -// swiftlint:enable convenience_type diff --git a/spark/Sources/Resources/PurpleColors.xcassets/Primary/Contents.json b/spark/Sources/Resources/PurpleColors.xcassets/Main/Contents.json similarity index 100% rename from spark/Sources/Resources/PurpleColors.xcassets/Primary/Contents.json rename to spark/Sources/Resources/PurpleColors.xcassets/Main/Contents.json diff --git a/spark/Sources/Resources/PurpleColors.xcassets/Primary/purple-primary.colorset/Contents.json b/spark/Sources/Resources/PurpleColors.xcassets/Main/purple-main.colorset/Contents.json similarity index 100% rename from spark/Sources/Resources/PurpleColors.xcassets/Primary/purple-primary.colorset/Contents.json rename to spark/Sources/Resources/PurpleColors.xcassets/Main/purple-main.colorset/Contents.json diff --git a/spark/Sources/Resources/PurpleColors.xcassets/Primary/purple-primaryContainer.colorset/Contents.json b/spark/Sources/Resources/PurpleColors.xcassets/Main/purple-mainContainer.colorset/Contents.json similarity index 100% rename from spark/Sources/Resources/PurpleColors.xcassets/Primary/purple-primaryContainer.colorset/Contents.json rename to spark/Sources/Resources/PurpleColors.xcassets/Main/purple-mainContainer.colorset/Contents.json diff --git a/spark/Sources/Resources/PurpleColors.xcassets/Primary/purple-primaryVariant.colorset/Contents.json b/spark/Sources/Resources/PurpleColors.xcassets/Main/purple-mainVariant.colorset/Contents.json similarity index 100% rename from spark/Sources/Resources/PurpleColors.xcassets/Primary/purple-primaryVariant.colorset/Contents.json rename to spark/Sources/Resources/PurpleColors.xcassets/Main/purple-mainVariant.colorset/Contents.json diff --git a/spark/Sources/Resources/PurpleColors.xcassets/Primary/purple-onPrimary.colorset/Contents.json b/spark/Sources/Resources/PurpleColors.xcassets/Main/purple-onMain.colorset/Contents.json similarity index 100% rename from spark/Sources/Resources/PurpleColors.xcassets/Primary/purple-onPrimary.colorset/Contents.json rename to spark/Sources/Resources/PurpleColors.xcassets/Main/purple-onMain.colorset/Contents.json diff --git a/spark/Sources/Resources/PurpleColors.xcassets/Primary/purple-onPrimaryContainer.colorset/Contents.json b/spark/Sources/Resources/PurpleColors.xcassets/Main/purple-onMainContainer.colorset/Contents.json similarity index 100% rename from spark/Sources/Resources/PurpleColors.xcassets/Primary/purple-onPrimaryContainer.colorset/Contents.json rename to spark/Sources/Resources/PurpleColors.xcassets/Main/purple-onMainContainer.colorset/Contents.json diff --git a/spark/Sources/Resources/PurpleColors.xcassets/Primary/purple-onPrimaryVariant.colorset/Contents.json b/spark/Sources/Resources/PurpleColors.xcassets/Main/purple-onMainVariant.colorset/Contents.json similarity index 100% rename from spark/Sources/Resources/PurpleColors.xcassets/Primary/purple-onPrimaryVariant.colorset/Contents.json rename to spark/Sources/Resources/PurpleColors.xcassets/Main/purple-onMainVariant.colorset/Contents.json diff --git a/spark/Sources/Resources/PurpleColors.xcassets/States/purple-primaryContainerPressed.colorset/Contents.json b/spark/Sources/Resources/PurpleColors.xcassets/States/purple-mainContainerPressed.colorset/Contents.json similarity index 100% rename from spark/Sources/Resources/PurpleColors.xcassets/States/purple-primaryContainerPressed.colorset/Contents.json rename to spark/Sources/Resources/PurpleColors.xcassets/States/purple-mainContainerPressed.colorset/Contents.json diff --git a/spark/Sources/Resources/PurpleColors.xcassets/States/purple-primaryPressed.colorset/Contents.json b/spark/Sources/Resources/PurpleColors.xcassets/States/purple-mainPressed.colorset/Contents.json similarity index 100% rename from spark/Sources/Resources/PurpleColors.xcassets/States/purple-primaryPressed.colorset/Contents.json rename to spark/Sources/Resources/PurpleColors.xcassets/States/purple-mainPressed.colorset/Contents.json diff --git a/spark/Sources/Resources/PurpleColors.xcassets/States/purple-primaryVariantPressed.colorset/Contents.json b/spark/Sources/Resources/PurpleColors.xcassets/States/purple-mainVariantPressed.colorset/Contents.json similarity index 100% rename from spark/Sources/Resources/PurpleColors.xcassets/States/purple-primaryVariantPressed.colorset/Contents.json rename to spark/Sources/Resources/PurpleColors.xcassets/States/purple-mainVariantPressed.colorset/Contents.json diff --git a/spark/Sources/Resources/PurpleColors.xcassets/States/purple-secondaryContainerPressed.colorset/Contents.json b/spark/Sources/Resources/PurpleColors.xcassets/States/purple-supportContainerPressed.colorset/Contents.json similarity index 100% rename from spark/Sources/Resources/PurpleColors.xcassets/States/purple-secondaryContainerPressed.colorset/Contents.json rename to spark/Sources/Resources/PurpleColors.xcassets/States/purple-supportContainerPressed.colorset/Contents.json diff --git a/spark/Sources/Resources/PurpleColors.xcassets/States/purple-secondaryPressed.colorset/Contents.json b/spark/Sources/Resources/PurpleColors.xcassets/States/purple-supportPressed.colorset/Contents.json similarity index 100% rename from spark/Sources/Resources/PurpleColors.xcassets/States/purple-secondaryPressed.colorset/Contents.json rename to spark/Sources/Resources/PurpleColors.xcassets/States/purple-supportPressed.colorset/Contents.json diff --git a/spark/Sources/Resources/PurpleColors.xcassets/States/purple-secondaryVariantPressed.colorset/Contents.json b/spark/Sources/Resources/PurpleColors.xcassets/States/purple-supportVariantPressed.colorset/Contents.json similarity index 100% rename from spark/Sources/Resources/PurpleColors.xcassets/States/purple-secondaryVariantPressed.colorset/Contents.json rename to spark/Sources/Resources/PurpleColors.xcassets/States/purple-supportVariantPressed.colorset/Contents.json diff --git a/spark/Sources/Resources/PurpleColors.xcassets/Secondary/Contents.json b/spark/Sources/Resources/PurpleColors.xcassets/Support/Contents.json similarity index 100% rename from spark/Sources/Resources/PurpleColors.xcassets/Secondary/Contents.json rename to spark/Sources/Resources/PurpleColors.xcassets/Support/Contents.json diff --git a/spark/Sources/Resources/PurpleColors.xcassets/Secondary/purple-onSecondary.colorset/Contents.json b/spark/Sources/Resources/PurpleColors.xcassets/Support/purple-onSupport.colorset/Contents.json similarity index 100% rename from spark/Sources/Resources/PurpleColors.xcassets/Secondary/purple-onSecondary.colorset/Contents.json rename to spark/Sources/Resources/PurpleColors.xcassets/Support/purple-onSupport.colorset/Contents.json diff --git a/spark/Sources/Resources/PurpleColors.xcassets/Secondary/purple-onSecondaryContainer.colorset/Contents.json b/spark/Sources/Resources/PurpleColors.xcassets/Support/purple-onSupportContainer.colorset/Contents.json similarity index 100% rename from spark/Sources/Resources/PurpleColors.xcassets/Secondary/purple-onSecondaryContainer.colorset/Contents.json rename to spark/Sources/Resources/PurpleColors.xcassets/Support/purple-onSupportContainer.colorset/Contents.json diff --git a/spark/Sources/Resources/PurpleColors.xcassets/Secondary/purple-onSecondaryVariant.colorset/Contents.json b/spark/Sources/Resources/PurpleColors.xcassets/Support/purple-onSupportVariant.colorset/Contents.json similarity index 100% rename from spark/Sources/Resources/PurpleColors.xcassets/Secondary/purple-onSecondaryVariant.colorset/Contents.json rename to spark/Sources/Resources/PurpleColors.xcassets/Support/purple-onSupportVariant.colorset/Contents.json diff --git a/spark/Sources/Resources/PurpleColors.xcassets/Secondary/purple-secondary.colorset/Contents.json b/spark/Sources/Resources/PurpleColors.xcassets/Support/purple-support.colorset/Contents.json similarity index 100% rename from spark/Sources/Resources/PurpleColors.xcassets/Secondary/purple-secondary.colorset/Contents.json rename to spark/Sources/Resources/PurpleColors.xcassets/Support/purple-support.colorset/Contents.json diff --git a/spark/Sources/Resources/PurpleColors.xcassets/Secondary/purple-secondaryContainer.colorset/Contents.json b/spark/Sources/Resources/PurpleColors.xcassets/Support/purple-supportContainer.colorset/Contents.json similarity index 100% rename from spark/Sources/Resources/PurpleColors.xcassets/Secondary/purple-secondaryContainer.colorset/Contents.json rename to spark/Sources/Resources/PurpleColors.xcassets/Support/purple-supportContainer.colorset/Contents.json diff --git a/spark/Sources/Resources/PurpleColors.xcassets/Secondary/purple-secondaryVariant.colorset/Contents.json b/spark/Sources/Resources/PurpleColors.xcassets/Support/purple-supportVariant.colorset/Contents.json similarity index 100% rename from spark/Sources/Resources/PurpleColors.xcassets/Secondary/purple-secondaryVariant.colorset/Contents.json rename to spark/Sources/Resources/PurpleColors.xcassets/Support/purple-supportVariant.colorset/Contents.json diff --git a/spark/Sources/Theming/Content/SparkColors.swift b/spark/Sources/Theming/Content/SparkColors.swift index d9eb7c83c..6d8d3c5f4 100644 --- a/spark/Sources/Theming/Content/SparkColors.swift +++ b/spark/Sources/Theming/Content/SparkColors.swift @@ -14,21 +14,21 @@ struct SparkColors: Colors { private class ClassForBundle {} - let primary: ColorsPrimary = ColorsPrimaryDefault( - primary: ColorTokenDefault(named: "primary", in: Bundle(for: ClassForBundle.self)), - onPrimary: ColorTokenDefault(named: "on-primary", in: Bundle(for: ClassForBundle.self)), - primaryVariant: ColorTokenDefault(named: "primary-variant", in: Bundle(for: ClassForBundle.self)), - onPrimaryVariant: ColorTokenDefault(named: "on-primary-variant", in: Bundle(for: ClassForBundle.self)), - primaryContainer: ColorTokenDefault(named: "primary-container", in: Bundle(for: ClassForBundle.self)), - onPrimaryContainer: ColorTokenDefault(named: "on-primary-container", in: Bundle(for: ClassForBundle.self))) + let main: ColorsMain = ColorsMainDefault( + main: ColorTokenDefault(named: "main", in: Bundle(for: ClassForBundle.self)), + onMain: ColorTokenDefault(named: "on-main", in: Bundle(for: ClassForBundle.self)), + mainVariant: ColorTokenDefault(named: "main-variant", in: Bundle(for: ClassForBundle.self)), + onMainVariant: ColorTokenDefault(named: "on-main-variant", in: Bundle(for: ClassForBundle.self)), + mainContainer: ColorTokenDefault(named: "main-container", in: Bundle(for: ClassForBundle.self)), + onMainContainer: ColorTokenDefault(named: "on-main-container", in: Bundle(for: ClassForBundle.self))) - let secondary: ColorsSecondary = ColorsSecondaryDefault( - secondary: ColorTokenDefault(named: "secondary", in: Bundle(for: ClassForBundle.self)), - onSecondary: ColorTokenDefault(named: "on-secondary", in: Bundle(for: ClassForBundle.self)), - secondaryVariant: ColorTokenDefault(named: "secondary-variant", in: Bundle(for: ClassForBundle.self)), - onSecondaryVariant: ColorTokenDefault(named: "on-secondary-variant", in: Bundle(for: ClassForBundle.self)), - secondaryContainer: ColorTokenDefault(named: "secondary-container", in: Bundle(for: ClassForBundle.self)), - onSecondaryContainer: ColorTokenDefault(named: "on-secondary-container", in: Bundle(for: ClassForBundle.self))) + let support: ColorsSupport = ColorsSupportDefault( + support: ColorTokenDefault(named: "support", in: Bundle(for: ClassForBundle.self)), + onSupport: ColorTokenDefault(named: "on-support", in: Bundle(for: ClassForBundle.self)), + supportVariant: ColorTokenDefault(named: "support-variant", in: Bundle(for: ClassForBundle.self)), + onSupportVariant: ColorTokenDefault(named: "on-support-variant", in: Bundle(for: ClassForBundle.self)), + supportContainer: ColorTokenDefault(named: "support-container", in: Bundle(for: ClassForBundle.self)), + onSupportContainer: ColorTokenDefault(named: "on-support-container", in: Bundle(for: ClassForBundle.self))) let base: ColorsBase = ColorsBaseDefault( background: ColorTokenDefault(named: "background", in: Bundle(for: ClassForBundle.self)), @@ -68,12 +68,12 @@ struct SparkColors: Colors { ) let states: ColorsStates = ColorsStatesDefault( - primaryPressed: ColorTokenDefault(named: "primary-pressed", in: Bundle(for: ClassForBundle.self)), - primaryVariantPressed: ColorTokenDefault(named: "primary-variant-pressed", in: Bundle(for: ClassForBundle.self)), - primaryContainerPressed: ColorTokenDefault(named: "primary-container-pressed", in: Bundle(for: ClassForBundle.self)), - secondaryPressed: ColorTokenDefault(named: "secondary-pressed", in: Bundle(for: ClassForBundle.self)), - secondaryVariantPressed: ColorTokenDefault(named: "secondary-variant-pressed", in: Bundle(for: ClassForBundle.self)), - secondaryContainerPressed: ColorTokenDefault(named: "secondary-container-pressed", in: Bundle(for: ClassForBundle.self)), + mainPressed: ColorTokenDefault(named: "main-pressed", in: Bundle(for: ClassForBundle.self)), + mainVariantPressed: ColorTokenDefault(named: "main-variant-pressed", in: Bundle(for: ClassForBundle.self)), + mainContainerPressed: ColorTokenDefault(named: "main-container-pressed", in: Bundle(for: ClassForBundle.self)), + supportPressed: ColorTokenDefault(named: "support-pressed", in: Bundle(for: ClassForBundle.self)), + supportVariantPressed: ColorTokenDefault(named: "support-variant-pressed", in: Bundle(for: ClassForBundle.self)), + supportContainerPressed: ColorTokenDefault(named: "support-container-pressed", in: Bundle(for: ClassForBundle.self)), surfacePressed: ColorTokenDefault(named: "surface-pressed", in: Bundle(for: ClassForBundle.self)), surfaceInversePressed: ColorTokenDefault(named: "surface-inverse-pressed", in: Bundle(for: ClassForBundle.self)), outlinePressed: ColorTokenDefault(named: "outline-pressed", in: Bundle(for: ClassForBundle.self)), diff --git a/spark/Sources/Theming/PurpleContent/PurpleColors.swift b/spark/Sources/Theming/PurpleContent/PurpleColors.swift index 4cd45e3c7..6ad81a14f 100644 --- a/spark/Sources/Theming/PurpleContent/PurpleColors.swift +++ b/spark/Sources/Theming/PurpleContent/PurpleColors.swift @@ -14,21 +14,21 @@ struct PurpleColors: Colors { private class ClassForBundle {} - var primary: ColorsPrimary = ColorsPrimaryDefault( - primary: ColorTokenDefault(named: "purple-primary", in: Bundle(for: ClassForBundle.self)), - onPrimary: ColorTokenDefault(named: "purple-onPrimary", in: Bundle(for: ClassForBundle.self)), - primaryVariant: ColorTokenDefault(named: "purple-primaryVariant", in: Bundle(for: ClassForBundle.self)), - onPrimaryVariant: ColorTokenDefault(named: "purple-onPrimaryVariant", in: Bundle(for: ClassForBundle.self)), - primaryContainer: ColorTokenDefault(named: "purple-primaryContainer", in: Bundle(for: ClassForBundle.self)), - onPrimaryContainer: ColorTokenDefault(named: "purple-onPrimaryContainer", in: Bundle(for: ClassForBundle.self))) + var main: ColorsMain = ColorsMainDefault( + main: ColorTokenDefault(named: "purple-main", in: Bundle(for: ClassForBundle.self)), + onMain: ColorTokenDefault(named: "purple-onMain", in: Bundle(for: ClassForBundle.self)), + mainVariant: ColorTokenDefault(named: "purple-mainVariant", in: Bundle(for: ClassForBundle.self)), + onMainVariant: ColorTokenDefault(named: "purple-onMainVariant", in: Bundle(for: ClassForBundle.self)), + mainContainer: ColorTokenDefault(named: "purple-mainContainer", in: Bundle(for: ClassForBundle.self)), + onMainContainer: ColorTokenDefault(named: "purple-onMainContainer", in: Bundle(for: ClassForBundle.self))) - let secondary: ColorsSecondary = ColorsSecondaryDefault( - secondary: ColorTokenDefault(named: "purple-secondary", in: Bundle(for: ClassForBundle.self)), - onSecondary: ColorTokenDefault(named: "purple-onSecondary", in: Bundle(for: ClassForBundle.self)), - secondaryVariant: ColorTokenDefault(named: "purple-secondaryVariant", in: Bundle(for: ClassForBundle.self)), - onSecondaryVariant: ColorTokenDefault(named: "purple-onSecondaryVariant", in: Bundle(for: ClassForBundle.self)), - secondaryContainer: ColorTokenDefault(named: "purple-secondaryContainer", in: Bundle(for: ClassForBundle.self)), - onSecondaryContainer: ColorTokenDefault(named: "purple-onSecondaryContainer", in: Bundle(for: ClassForBundle.self))) + let support: ColorsSupport = ColorsSupportDefault( + support: ColorTokenDefault(named: "purple-support", in: Bundle(for: ClassForBundle.self)), + onSupport: ColorTokenDefault(named: "purple-onSupport", in: Bundle(for: ClassForBundle.self)), + supportVariant: ColorTokenDefault(named: "purple-supportVariant", in: Bundle(for: ClassForBundle.self)), + onSupportVariant: ColorTokenDefault(named: "purple-onSupportVariant", in: Bundle(for: ClassForBundle.self)), + supportContainer: ColorTokenDefault(named: "purple-supportContainer", in: Bundle(for: ClassForBundle.self)), + onSupportContainer: ColorTokenDefault(named: "purple-onSupportContainer", in: Bundle(for: ClassForBundle.self))) let base: ColorsBase = ColorsBaseDefault( background: ColorTokenDefault(named: "purple-background", in: Bundle(for: ClassForBundle.self)), @@ -68,12 +68,12 @@ struct PurpleColors: Colors { ) let states: ColorsStates = ColorsStatesDefault( - primaryPressed: ColorTokenDefault(named: "purple-primaryPressed", in: Bundle(for: ClassForBundle.self)), - primaryVariantPressed: ColorTokenDefault(named: "purple-primaryVariantPressed", in: Bundle(for: ClassForBundle.self)), - primaryContainerPressed: ColorTokenDefault(named: "purple-primaryContainerPressed", in: Bundle(for: ClassForBundle.self)), - secondaryPressed: ColorTokenDefault(named: "purple-secondaryPressed", in: Bundle(for: ClassForBundle.self)), - secondaryVariantPressed: ColorTokenDefault(named: "purple-secondaryVariantPressed", in: Bundle(for: ClassForBundle.self)), - secondaryContainerPressed: ColorTokenDefault(named: "purple-secondaryContainerPressed", in: Bundle(for: ClassForBundle.self)), + mainPressed: ColorTokenDefault(named: "purple-mainPressed", in: Bundle(for: ClassForBundle.self)), + mainVariantPressed: ColorTokenDefault(named: "purple-mainVariantPressed", in: Bundle(for: ClassForBundle.self)), + mainContainerPressed: ColorTokenDefault(named: "purple-mainContainerPressed", in: Bundle(for: ClassForBundle.self)), + supportPressed: ColorTokenDefault(named: "purple-supportPressed", in: Bundle(for: ClassForBundle.self)), + supportVariantPressed: ColorTokenDefault(named: "purple-supportVariantPressed", in: Bundle(for: ClassForBundle.self)), + supportContainerPressed: ColorTokenDefault(named: "purple-supportContainerPressed", in: Bundle(for: ClassForBundle.self)), surfacePressed: ColorTokenDefault(named: "purple-surfacePressed", in: Bundle(for: ClassForBundle.self)), surfaceInversePressed: ColorTokenDefault(named: "purple-surfaceInversePressed", in: Bundle(for: ClassForBundle.self)), outlinePressed: ColorTokenDefault(named: "purple-outlinePressed", in: Bundle(for: ClassForBundle.self)),