From 9f364cb3628a692ef688ca75ba7bcfdabc7aa21f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=B8=D0=BC=D0=B8=D1=82=D1=80=D0=B0=D0=BA=D0=B8=20?= =?UTF-8?q?=D0=92=D0=BB=D0=B0=D0=B4=D0=B8=D0=BC=D0=B8=D1=80?= <dimitraki666@gmail.com> Date: Fri, 27 Dec 2024 12:26:35 +0300 Subject: [PATCH] fix(sdds-segment-element): fixed shape style --- .../SDDSComponents.xcodeproj/project.pbxproj | 20 ++++----- .../SDDSSegmentElement.swift | 31 +++----------- .../SegmentElement+Exstensions.swift | 42 ------------------- .../SegmentElementAccessibility.swift | 40 ++++++++++++++++++ ...ntElementAppearance+ButtonAppearance.swift | 19 +++++++++ .../SegmentElementAppearance+Variation.swift | 2 +- .../SegmentElementAppearance.swift | 19 --------- .../SegmentElementColor.swift | 25 ----------- .../SegmentElementShapeStyle.swift | 5 --- .../SegmentElementView.swift | 2 +- .../SegmentElement+ColorVariations.swift | 16 +++---- 11 files changed, 82 insertions(+), 139 deletions(-) delete mode 100644 SDDSComponents/Sources/SDDSComponents/Components/SDDSSegmentElement/SegmentAppearance/SegmentElement+Exstensions.swift create mode 100644 SDDSComponents/Sources/SDDSComponents/Components/SDDSSegmentElement/SegmentAppearance/SegmentElementAccessibility.swift create mode 100644 SDDSComponents/Sources/SDDSComponents/Components/SDDSSegmentElement/SegmentAppearance/SegmentElementAppearance+ButtonAppearance.swift delete mode 100644 SDDSComponents/Sources/SDDSComponents/Components/SDDSSegmentElement/SegmentAppearance/SegmentElementColor.swift delete mode 100644 SDDSComponents/Sources/SDDSComponents/Components/SDDSSegmentElement/SegmentAppearance/SegmentElementShapeStyle.swift diff --git a/SDDSComponents/SDDSComponents.xcodeproj/project.pbxproj b/SDDSComponents/SDDSComponents.xcodeproj/project.pbxproj index 932a32f1..226c07b6 100644 --- a/SDDSComponents/SDDSComponents.xcodeproj/project.pbxproj +++ b/SDDSComponents/SDDSComponents.xcodeproj/project.pbxproj @@ -12,10 +12,9 @@ 69573D682D1D638600359D53 /* AppearanceConfiguration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 69573D672D1D637D00359D53 /* AppearanceConfiguration.swift */; }; 69573D6A2D1D756000359D53 /* SegmentElementAppearance+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 69573D692D1D754400359D53 /* SegmentElementAppearance+Extensions.swift */; }; 69573D6C2D1D7C5D00359D53 /* SegmentElementAppearance+Variation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 69573D6B2D1D7C4300359D53 /* SegmentElementAppearance+Variation.swift */; }; - 6968433D2D1D934F002F8C7A /* SegmentElement+Exstensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6968433C2D1D9338002F8C7A /* SegmentElement+Exstensions.swift */; }; - 6968433F2D1DC003002F8C7A /* SegmentElementShapeStyle.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6968433E2D1DBFF8002F8C7A /* SegmentElementShapeStyle.swift */; }; 696843412D1E720B002F8C7A /* SegmentElement+ShapeStyle.swift in Sources */ = {isa = PBXBuildFile; fileRef = 696843402D1E71FE002F8C7A /* SegmentElement+ShapeStyle.swift */; }; - 6969EADC2D1D5A74008536E5 /* SegmentElementColor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6969EADB2D1D5A6C008536E5 /* SegmentElementColor.swift */; }; + 696843432D1EA12E002F8C7A /* SegmentElementAppearance+ButtonAppearance.swift in Sources */ = {isa = PBXBuildFile; fileRef = 696843422D1EA11A002F8C7A /* SegmentElementAppearance+ButtonAppearance.swift */; }; + 696843452D1EA35B002F8C7A /* SegmentElementAccessibility.swift in Sources */ = {isa = PBXBuildFile; fileRef = 696843442D1EA348002F8C7A /* SegmentElementAccessibility.swift */; }; 6969EADE2D1D5B8E008536E5 /* SegmentElementAppearanceVariations.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6969EADD2D1D5B73008536E5 /* SegmentElementAppearanceVariations.swift */; }; 6987445F2D1C367700559ABA /* SDDSCounter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6987445D2D1C367700559ABA /* SDDSCounter.swift */; }; 698744602D1C367700559ABA /* CounterAppearance+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6987445A2D1C367700559ABA /* CounterAppearance+Extensions.swift */; }; @@ -168,10 +167,9 @@ 69573D672D1D637D00359D53 /* AppearanceConfiguration.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppearanceConfiguration.swift; sourceTree = "<group>"; }; 69573D692D1D754400359D53 /* SegmentElementAppearance+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "SegmentElementAppearance+Extensions.swift"; sourceTree = "<group>"; }; 69573D6B2D1D7C4300359D53 /* SegmentElementAppearance+Variation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "SegmentElementAppearance+Variation.swift"; sourceTree = "<group>"; }; - 6968433C2D1D9338002F8C7A /* SegmentElement+Exstensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "SegmentElement+Exstensions.swift"; sourceTree = "<group>"; }; - 6968433E2D1DBFF8002F8C7A /* SegmentElementShapeStyle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SegmentElementShapeStyle.swift; sourceTree = "<group>"; }; 696843402D1E71FE002F8C7A /* SegmentElement+ShapeStyle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "SegmentElement+ShapeStyle.swift"; sourceTree = "<group>"; }; - 6969EADB2D1D5A6C008536E5 /* SegmentElementColor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SegmentElementColor.swift; sourceTree = "<group>"; }; + 696843422D1EA11A002F8C7A /* SegmentElementAppearance+ButtonAppearance.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "SegmentElementAppearance+ButtonAppearance.swift"; sourceTree = "<group>"; }; + 696843442D1EA348002F8C7A /* SegmentElementAccessibility.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SegmentElementAccessibility.swift; sourceTree = "<group>"; }; 6969EADD2D1D5B73008536E5 /* SegmentElementAppearanceVariations.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SegmentElementAppearanceVariations.swift; sourceTree = "<group>"; }; 698744562D1C367700559ABA /* CounterAppearance.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CounterAppearance.swift; sourceTree = "<group>"; }; 698744572D1C367700559ABA /* CounterColor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CounterColor.swift; sourceTree = "<group>"; }; @@ -361,13 +359,12 @@ 6950A1262D1D4BE1001695C5 /* SegmentAppearance */ = { isa = PBXGroup; children = ( + 696843442D1EA348002F8C7A /* SegmentElementAccessibility.swift */, + 696843422D1EA11A002F8C7A /* SegmentElementAppearance+ButtonAppearance.swift */, 696843402D1E71FE002F8C7A /* SegmentElement+ShapeStyle.swift */, - 6968433E2D1DBFF8002F8C7A /* SegmentElementShapeStyle.swift */, - 6968433C2D1D9338002F8C7A /* SegmentElement+Exstensions.swift */, 69573D6B2D1D7C4300359D53 /* SegmentElementAppearance+Variation.swift */, 69573D692D1D754400359D53 /* SegmentElementAppearance+Extensions.swift */, 6969EADD2D1D5B73008536E5 /* SegmentElementAppearanceVariations.swift */, - 6969EADB2D1D5A6C008536E5 /* SegmentElementColor.swift */, 6950A1292D1D4D4E001695C5 /* SegmentElementSize.swift */, 6950A1272D1D4C28001695C5 /* SegmentElementAppearance.swift */, ); @@ -1266,9 +1263,7 @@ 81F753422CF505DE000156D9 /* IconButton+Extensions.swift in Sources */, 81F752E22CECD40A000156D9 /* BasicButton.swift in Sources */, 814E30412C99B090004601F7 /* Text+FillModifier.swift in Sources */, - 6969EADC2D1D5A74008536E5 /* SegmentElementColor.swift in Sources */, 817339E62D033E650092608A /* RadioboxData.swift in Sources */, - 6968433F2D1DC003002F8C7A /* SegmentElementShapeStyle.swift in Sources */, 816C62A22CB80EC400352891 /* Opacity.swift in Sources */, 814E30382C99AFB0004601F7 /* SDDSAvatarModifiers.swift in Sources */, 81D2B1992C32B3E400CAA7FD /* SDDSButton.swift in Sources */, @@ -1290,6 +1285,7 @@ 818C03C92C451424002C6D0A /* RadioboxAppearance.swift in Sources */, 8102BA312CBE9B3300C589D3 /* TextAreaAppearance.swift in Sources */, 8159F7302C5D1CFE00622836 /* FillStyle.swift in Sources */, + 696843432D1EA12E002F8C7A /* SegmentElementAppearance+ButtonAppearance.swift in Sources */, 81F753242CF467E5000156D9 /* ButtonContentAlignment.swift in Sources */, 6969EADE2D1D5B8E008536E5 /* SegmentElementAppearanceVariations.swift in Sources */, 816AA9B02C97424000C3347C /* TextFieldSizeConfiguration.swift in Sources */, @@ -1304,6 +1300,7 @@ 81F7532E2CF4689C000156D9 /* ButtonAccessibility.swift in Sources */, 81685C2B2CFF898D00278446 /* SwitchAppearance+Extensions.swift in Sources */, 818C03B92C43B99B002C6D0A /* ColorToken+Extensions.swift in Sources */, + 696843452D1EA35B002F8C7A /* SegmentElementAccessibility.swift in Sources */, 817339E92D033E8E0092608A /* AvatarAppearance.swift in Sources */, 6950A1282D1D4C47001695C5 /* SegmentElementAppearance.swift in Sources */, 811DE1712C5783B6000DD354 /* HierarchicalList.swift in Sources */, @@ -1320,7 +1317,6 @@ 81733A2B2D072FB70092608A /* AvatarAppearance+Extensions.swift in Sources */, 811DE15B2C5017FE000DD354 /* SDDSChipGroup.swift in Sources */, 81E9FA8F2C92B13E0041B5FF /* SDDSTextField.swift in Sources */, - 6968433D2D1D934F002F8C7A /* SegmentElement+Exstensions.swift in Sources */, 8102BA3A2CBEAFB800C589D3 /* PlaceholderTextEditor.swift in Sources */, 818C03C72C45140B002C6D0A /* CheckboxAppearance.swift in Sources */, 814E30372C99AFAE004601F7 /* SDDSAvatarData.swift in Sources */, diff --git a/SDDSComponents/Sources/SDDSComponents/Components/SDDSSegmentElement/SDDSSegmentElement.swift b/SDDSComponents/Sources/SDDSComponents/Components/SDDSSegmentElement/SDDSSegmentElement.swift index 445a2999..520fe7c6 100644 --- a/SDDSComponents/Sources/SDDSComponents/Components/SDDSSegmentElement/SDDSSegmentElement.swift +++ b/SDDSComponents/Sources/SDDSComponents/Components/SDDSSegmentElement/SDDSSegmentElement.swift @@ -1,26 +1,6 @@ import Foundation import SwiftUI -public struct SegmentElementSizeToButtonSizeConfigurationMapper: ButtonSizeConfiguration, SegmentElementSizeConfiguration { - public var height: CGFloat - - public var cornerRadius: CGFloat - - public var paddings: EdgeInsets - - public var iconSize: CGSize - - public var spinnerSize: CGSize = .zero - - public var iconHorizontalGap: CGFloat - - public var titleHorizontalGap: CGFloat - - public var debugDescription: String { - "SizeExample" - } -} - public enum SegmentElementContentRight { case icon(Image) case subtitle(String) @@ -38,8 +18,7 @@ public struct SDDSSegmentElement: View { public let contentType: SegmentElementContent public let isDisabled: Bool public let appearance: SegmentElementAppearance - public let content: SegmentElementContentRight = .subtitle("") - public let accessibility: ButtonAccessibility // сделать SegmentElementAccessibility + public let accessibility: SegmentElementAccessibility public var action: () -> Void public init( @@ -47,7 +26,7 @@ public struct SDDSSegmentElement: View { contentType: SegmentElementContent, isDisabled: Bool = false, appearance: SegmentElementAppearance, - accessibility: ButtonAccessibility = ButtonAccessibility(), + accessibility: SegmentElementAccessibility = SegmentElementAccessibility() , action: @escaping () -> Void ) { self.title = title @@ -104,7 +83,7 @@ public struct SDDSSegmentElement: View { spinnerImage: nil, buttonStyle: .basic, appearance: appearance.buttonAppearance, - accessibility: accessibility, + accessibility: accessibility.buttonAccessibility, counter: nil, action: action ) @@ -118,7 +97,7 @@ public struct SDDSSegmentElement: View { spinnerImage: nil, buttonStyle: .basic, appearance: appearance.buttonAppearance, - accessibility: accessibility, + accessibility: accessibility.buttonAccessibility, counter: ViewProvider(counterData), action: action ) @@ -132,7 +111,7 @@ public struct SDDSSegmentElement: View { spinnerImage: nil, buttonStyle: .basic, appearance: appearance.buttonAppearance, - accessibility: accessibility, + accessibility: accessibility.buttonAccessibility, counter: nil, action: action ) diff --git a/SDDSComponents/Sources/SDDSComponents/Components/SDDSSegmentElement/SegmentAppearance/SegmentElement+Exstensions.swift b/SDDSComponents/Sources/SDDSComponents/Components/SDDSSegmentElement/SegmentAppearance/SegmentElement+Exstensions.swift deleted file mode 100644 index c4576816..00000000 --- a/SDDSComponents/Sources/SDDSComponents/Components/SDDSSegmentElement/SegmentAppearance/SegmentElement+Exstensions.swift +++ /dev/null @@ -1,42 +0,0 @@ -import Foundation - -extension SDDSSegmentElement { - var size: ButtonSizeConfiguration { - SegmentElementSizeToButtonSizeConfigurationMapper( - height: appearance.size.height, - cornerRadius: appearance.size.cornerRadius, - paddings: appearance.size.paddings, - iconSize: appearance.size.iconSize, - iconHorizontalGap: appearance.size.iconHorizontalGap, - titleHorizontalGap: appearance.size.titleHorizontalGap) - as ButtonSizeConfiguration - } - var titleColor: ButtonColor { - return ButtonColor( - defaultColor: appearance.titleColor.defaultColor, - highlightedColor: appearance.titleColor.highlightedColor, - hoveredColor: appearance.titleColor.hoveredColor - ) - } - var subtitleColor: ButtonColor { - return ButtonColor( - defaultColor: appearance.subtitleColor.defaultColor, - highlightedColor: appearance.subtitleColor.highlightedColor, - hoveredColor: appearance.subtitleColor.hoveredColor - ) - } - var iconColor: ButtonColor { - return ButtonColor( - defaultColor: appearance.iconColor.defaultColor, - highlightedColor: appearance.iconColor.highlightedColor, - hoveredColor: appearance.iconColor.hoveredColor - ) - } - var backgroundColor: ButtonColor { - return ButtonColor( - defaultColor: appearance.backgroundColor.defaultColor, - highlightedColor: appearance.backgroundColor.highlightedColor, - hoveredColor: appearance.backgroundColor.hoveredColor - ) - } -} diff --git a/SDDSComponents/Sources/SDDSComponents/Components/SDDSSegmentElement/SegmentAppearance/SegmentElementAccessibility.swift b/SDDSComponents/Sources/SDDSComponents/Components/SDDSSegmentElement/SegmentAppearance/SegmentElementAccessibility.swift new file mode 100644 index 00000000..590c11ad --- /dev/null +++ b/SDDSComponents/Sources/SDDSComponents/Components/SDDSSegmentElement/SegmentAppearance/SegmentElementAccessibility.swift @@ -0,0 +1,40 @@ +import Foundation + +public struct SegmentElementAccessibility { + public var label: String + public var hint: String + public var value: String + + /** + Инициализатор для создания параметров доступности кнопки. + + - Parameters: + - label: Метка доступности для кнопки. + - hint: Подсказка доступности для кнопки. + - value: Значение доступности для кнопки. + */ + public init(label: String, hint: String, value: String) { + self.label = label + self.hint = hint + self.value = value + } + + /** + Инициализатор для создания параметров доступности кнопки с пустыми значениями. + */ + public init() { + self.label = "" + self.hint = "" + self.value = "" + } +} + +extension SegmentElementAccessibility { + var buttonAccessibility: ButtonAccessibility { + ButtonAccessibility( + label: label, + hint: hint, + value: value + ) + } +} diff --git a/SDDSComponents/Sources/SDDSComponents/Components/SDDSSegmentElement/SegmentAppearance/SegmentElementAppearance+ButtonAppearance.swift b/SDDSComponents/Sources/SDDSComponents/Components/SDDSSegmentElement/SegmentAppearance/SegmentElementAppearance+ButtonAppearance.swift new file mode 100644 index 00000000..c8e60d50 --- /dev/null +++ b/SDDSComponents/Sources/SDDSComponents/Components/SDDSSegmentElement/SegmentAppearance/SegmentElementAppearance+ButtonAppearance.swift @@ -0,0 +1,19 @@ +import Foundation + +extension SegmentElementAppearance { + var buttonAppearance: ButtonAppearance { + .init( + size: self.size, + shapeStyle: self.shapeStyle, + titleTypography: self.titleTypography, + titleColor: self.titleColor, + subtitleTypography: self.subtitleTypography, + subtitleColor: self.subtitleColor, + iconColor: self.iconColor, + spinnerColor: ButtonColor(), + backgroundColor: self.backgroundColor, + disabledAlpha: self.disabledAlpha, + loadingAlpha: 0 + ) + } +} diff --git a/SDDSComponents/Sources/SDDSComponents/Components/SDDSSegmentElement/SegmentAppearance/SegmentElementAppearance+Variation.swift b/SDDSComponents/Sources/SDDSComponents/Components/SDDSSegmentElement/SegmentAppearance/SegmentElementAppearance+Variation.swift index a66bea9a..78d894db 100644 --- a/SDDSComponents/Sources/SDDSComponents/Components/SDDSSegmentElement/SegmentAppearance/SegmentElementAppearance+Variation.swift +++ b/SDDSComponents/Sources/SDDSComponents/Components/SDDSSegmentElement/SegmentAppearance/SegmentElementAppearance+Variation.swift @@ -4,7 +4,7 @@ public extension SegmentElementAppearance { func applyColorVariation(variation: SegmentElementAppearance) -> SegmentElementAppearance { SegmentElementAppearance( size: size, -// shapeStyle: shapeStyle, + shapeStyle: shapeStyle, titleTypography: titleTypography, titleColor: variation.titleColor, subtitleTypography: subtitleTypography, diff --git a/SDDSComponents/Sources/SDDSComponents/Components/SDDSSegmentElement/SegmentAppearance/SegmentElementAppearance.swift b/SDDSComponents/Sources/SDDSComponents/Components/SDDSSegmentElement/SegmentAppearance/SegmentElementAppearance.swift index 02c99b54..4d3e8ea1 100644 --- a/SDDSComponents/Sources/SDDSComponents/Components/SDDSSegmentElement/SegmentAppearance/SegmentElementAppearance.swift +++ b/SDDSComponents/Sources/SDDSComponents/Components/SDDSSegmentElement/SegmentAppearance/SegmentElementAppearance.swift @@ -42,22 +42,3 @@ public struct SegmentElementAppearance { self.disabledAlpha = disabledAlpha } } - -// в отдельный файл -extension SegmentElementAppearance { - var buttonAppearance: ButtonAppearance { - .init( - size: size, - shapeStyle: .default, - titleTypography: .default, - titleColor: ButtonColor(), - subtitleTypography: .default, - subtitleColor: ButtonColor(), - iconColor: ButtonColor(), - spinnerColor: ButtonColor(), - backgroundColor: ButtonColor(), - disabledAlpha: 0, - loadingAlpha: 0 - ) - } -} diff --git a/SDDSComponents/Sources/SDDSComponents/Components/SDDSSegmentElement/SegmentAppearance/SegmentElementColor.swift b/SDDSComponents/Sources/SDDSComponents/Components/SDDSSegmentElement/SegmentAppearance/SegmentElementColor.swift deleted file mode 100644 index a116258d..00000000 --- a/SDDSComponents/Sources/SDDSComponents/Components/SDDSSegmentElement/SegmentAppearance/SegmentElementColor.swift +++ /dev/null @@ -1,25 +0,0 @@ -import Foundation -@_exported import SDDSThemeCore - -public struct SegmentElementColor { - /** - Цвет для стандартного состояния кнопки. - */ - public let defaultColor: ColorToken - - /** - Цвет для состояния, когда кнопка нажата. - */ - public let highlightedColor: ColorToken - - /** - Цвет для состояния, когда кнопка находится под курсором. - */ - public let hoveredColor: ColorToken - - public init(defaultColor: ColorToken = .clearColor, highlightedColor: ColorToken = .clearColor, hoveredColor: ColorToken = .clearColor) { - self.defaultColor = defaultColor - self.highlightedColor = highlightedColor - self.hoveredColor = hoveredColor - } -} diff --git a/SDDSComponents/Sources/SDDSComponents/Components/SDDSSegmentElement/SegmentAppearance/SegmentElementShapeStyle.swift b/SDDSComponents/Sources/SDDSComponents/Components/SDDSSegmentElement/SegmentAppearance/SegmentElementShapeStyle.swift deleted file mode 100644 index 00911e96..00000000 --- a/SDDSComponents/Sources/SDDSComponents/Components/SDDSSegmentElement/SegmentAppearance/SegmentElementShapeStyle.swift +++ /dev/null @@ -1,5 +0,0 @@ -import Foundation - -public enum SegmentElementShapeStyle { - case pilled -} diff --git a/SDDSDemoApp/SDDSDemoApp/Views/SegmentElementView/SegmentElementView.swift b/SDDSDemoApp/SDDSDemoApp/Views/SegmentElementView/SegmentElementView.swift index 9423a159..88768046 100644 --- a/SDDSDemoApp/SDDSDemoApp/Views/SegmentElementView/SegmentElementView.swift +++ b/SDDSDemoApp/SDDSDemoApp/Views/SegmentElementView/SegmentElementView.swift @@ -7,12 +7,12 @@ import SDDSServTheme final class SegmentElementViewModel: ObservableObject { @Published var title: String = "" + @Published var subtitle: String = "" @Published var size: SegmentElementSizeConfiguration = SegmentElementSize.medium @Published var contentType: SegmentElementContent = .none @Published var iconAttributes: ButtonIconAttributes? = nil @Published var isDisabled: Bool = false @Published var appearance: SegmentElementAppearance = SDDSSegmentElement.default.appearance -// @Published var layoutMode: ButtonLayoutMode = .wrapContent @Published var variationName: String = SDDSSegmentElement.clear.name var cancellables: Set<AnyCancellable> = [] diff --git a/Themes/SDDSservTheme/SDDSSegmentElement/SegmentElement+ColorVariations.swift b/Themes/SDDSservTheme/SDDSSegmentElement/SegmentElement+ColorVariations.swift index fe9fa84f..4df0f4d6 100644 --- a/Themes/SDDSservTheme/SDDSSegmentElement/SegmentElement+ColorVariations.swift +++ b/Themes/SDDSservTheme/SDDSSegmentElement/SegmentElement+ColorVariations.swift @@ -21,23 +21,23 @@ public extension SDDSSegmentElement { name: "clear", appearance: SegmentElementAppearance( titleTypography: SDDSSegmentElement.titleTypography, - titleColor: SegmentElementColor( + titleColor: ButtonColor( defaultColor: .textDefaultPrimary, highlightedColor: .textDefaultPrimaryActive, hoveredColor: .textDefaultPrimaryHover ), subtitleTypography: SDDSSegmentElement.subtitleTypography, - subtitleColor: SegmentElementColor( + subtitleColor: ButtonColor( defaultColor: .textDefaultSecondary, highlightedColor: .textDefaultSecondaryActive, hoveredColor: .textDefaultSecondaryHover ), - iconColor: SegmentElementColor( + iconColor: ButtonColor( defaultColor: .textDefaultPrimary, highlightedColor: .textDefaultPrimaryActive, hoveredColor: .textDefaultPrimaryHover ), - backgroundColor: SegmentElementColor( + backgroundColor: ButtonColor( defaultColor: .surfaceDefaultClear, highlightedColor: .surfaceDefaultClearActive, hoveredColor: .surfaceDefaultClearHover @@ -51,23 +51,23 @@ public extension SDDSSegmentElement { name: "default", appearance: SegmentElementAppearance( titleTypography: SDDSSegmentElement.titleTypography, - titleColor: SegmentElementColor( + titleColor: ButtonColor( defaultColor: .textInversePrimary, highlightedColor: .textInversePrimaryActive, hoveredColor: .textInversePrimaryHover ), subtitleTypography: SDDSSegmentElement.subtitleTypography, - subtitleColor: SegmentElementColor( + subtitleColor: ButtonColor( defaultColor: .textDefaultSecondary, highlightedColor: .textDefaultSecondaryActive, hoveredColor: .textDefaultSecondaryHover ), - iconColor: SegmentElementColor( + iconColor: ButtonColor( defaultColor: .textInversePrimary, highlightedColor: .textInversePrimaryActive, hoveredColor: .textInversePrimaryHover ), - backgroundColor: SegmentElementColor( + backgroundColor: ButtonColor( defaultColor: .surfaceDefaultSolidDefault, highlightedColor: .surfaceDefaultSolidDefaultActive, hoveredColor: .surfaceDefaultSolidDefaultHover