From a334c18aee5700a40cecd0dedad74b220c2207fe Mon Sep 17 00:00:00 2001 From: Alexandr Romanov Date: Sat, 9 Nov 2024 21:57:47 +0300 Subject: [PATCH] Renamed colors --- .../OversizeUI/Controls/Avatar/Avatar.swift | 2 +- .../Controls/Button/BarButton.swift | 8 +- .../OversizeUI/Controls/Button/Button.swift | 14 +- .../Controls/Checkbox/Checkbox.swift | 8 +- .../Controls/GridSelect/GridSelect.swift | 4 +- Sources/OversizeUI/Controls/HUD/HUD.swift | 4 +- .../Controls/Label/MenuLabelStyle.swift | 6 +- .../Controls/Label/RowLabelStyle.swift | 6 +- .../Controls/Loader/LoaderOverlayView.swift | 4 +- .../Controls/Menu/BarButtonMenuStyle.swift | 4 +- .../Controls/Notice/NoticeView.swift | 4 +- .../OversizeUI/Controls/PageView/Page.swift | 16 +- .../Controls/Premium/PremiumLabel.swift | 6 +- Sources/OversizeUI/Controls/Radio/Radio.swift | 6 +- Sources/OversizeUI/Controls/Row/Row.swift | 8 +- .../OversizeUI/Controls/Row/RowButton.swift | 2 +- .../OversizeUI/Controls/Row/RowTitle.swift | 6 +- .../Controls/SectionView/SectionView.swift | 6 +- .../SegmentedControl/SegmentedControl.swift | 6 +- .../Support/SegmentedControlPreview.swift | 2 +- .../Controls/Select/MultiSelect.swift | 4 +- .../OversizeUI/Controls/Select/Select.swift | 6 +- .../Controls/Select/SelectPicker.swift | 2 +- .../OversizeUI/Controls/Surface/Surface.swift | 6 +- .../OversizeUI/Controls/Switch/Switch.swift | 6 +- .../OversizeUI/Controls/TextBox/TextBox.swift | 4 +- .../TextEditorPlaceholderViewModifier.swift | 8 +- .../TextField/FieldHelperViewModifier.swift | 2 +- .../TextField/FieldTitleViewModifier.swift | 2 +- .../TextField/LabeledTextFieldStyle.swift | 8 +- .../TextField/TextFieldExtended.swift | 6 +- .../OversizeUI/Controls/Toast/Snackbar.swift | 2 +- .../Controls/Toogle/CheckboxStyle.swift | 6 +- .../Controls/Toogle/RadioStyle.swift | 4 +- Sources/OversizeUI/Core/Colors.swift | 178 +++++++++--------- .../OversizeUI/Deprecated/ButtonLegacy.swift | 10 +- .../OversizeUI/Deprecated/HUDDeprecated.swift | 6 +- Sources/OversizeUI/Deprecated/Icon.swift | 6 +- Sources/OversizeUI/Deprecated/PageView.swift | 4 +- .../OversizeUI/Deprecated/RowDeprecated.swift | 8 +- .../OversizeUI/Deprecated/RowLeading.swift | 4 +- .../OversizeUI/Deprecated/RowTrailing.swift | 12 +- .../Extensions/Image/Image+Extensions.swift | 4 +- 43 files changed, 210 insertions(+), 210 deletions(-) diff --git a/Sources/OversizeUI/Controls/Avatar/Avatar.swift b/Sources/OversizeUI/Controls/Avatar/Avatar.swift index 80449be..f8f3400 100644 --- a/Sources/OversizeUI/Controls/Avatar/Avatar.swift +++ b/Sources/OversizeUI/Controls/Avatar/Avatar.swift @@ -48,7 +48,7 @@ public struct Avatar: View { var background: AvatarBackgroundType = .color(.surfaceSecondary) /// Sets a custom text and image color for the Avatar. - var onBackgroundColor: Color = .onSurfaceMediumEmphasis + var onBackgroundColor: Color = .onSurfaceSecondary /// Creates and initializes a Avatar /// - Parameters: diff --git a/Sources/OversizeUI/Controls/Button/BarButton.swift b/Sources/OversizeUI/Controls/Button/BarButton.swift index 488a089..542974d 100644 --- a/Sources/OversizeUI/Controls/Button/BarButton.swift +++ b/Sources/OversizeUI/Controls/Button/BarButton.swift @@ -133,17 +133,17 @@ public struct BarButton: View { case let .primary(text, _): Text(text) case .closeAction: - IconDeprecated(.xMini, color: .onSurfaceMediumEmphasis) + IconDeprecated(.xMini, color: .onSurfaceSecondary) case .backAction: - IconDeprecated(.arrowLeft, color: .onSurfaceMediumEmphasis) + IconDeprecated(.arrowLeft, color: .onSurfaceSecondary) case let .disabled(text): Text(text) case let .image(image, _): image .renderingMode(.template) - .onSurfaceHighEmphasisForegroundColor() + .onSurfacePrimaryForeground() case let .icon(icon, _): - IconDeprecated(icon, color: .onSurfaceMediumEmphasis) + IconDeprecated(icon, color: .onSurfaceSecondary) } } } diff --git a/Sources/OversizeUI/Controls/Button/Button.swift b/Sources/OversizeUI/Controls/Button/Button.swift index a8c64f6..0e4a645 100644 --- a/Sources/OversizeUI/Controls/Button/Button.swift +++ b/Sources/OversizeUI/Controls/Button/Button.swift @@ -56,7 +56,7 @@ public struct OversizeButtonStyle: ButtonStyle { .opacity(backgroundOpacity)) .overlay { Capsule() - .strokeBorder(Color.onSurfaceHighEmphasis.opacity(0.15), lineWidth: 2) + .strokeBorder(Color.onSurfacePrimary.opacity(0.15), lineWidth: 2) .opacity(isBordered || theme.borderButtons ? 1 : 0) } @@ -66,7 +66,7 @@ public struct OversizeButtonStyle: ButtonStyle { .opacity(backgroundOpacity)) .overlay { RoundedRectangle(cornerRadius: radius != .medium ? radius.rawValue : theme.radius, style: .continuous) - .strokeBorder(Color.onSurfaceHighEmphasis.opacity(0.15), lineWidth: 2) + .strokeBorder(Color.onSurfacePrimary.opacity(0.15), lineWidth: 2) .opacity(isBordered || theme.borderButtons ? 1 : 0) } } @@ -100,10 +100,10 @@ public struct OversizeButtonStyle: ButtonStyle { switch type { case .primary: switch role { - case .some(.destructive), .some(.cancel): Color.onPrimaryHighEmphasis + case .some(.destructive), .some(.cancel): Color.onPrimary default: if isAccent { - Color.onPrimaryHighEmphasis + Color.onPrimary } else { Color.backgroundPrimary } @@ -116,18 +116,18 @@ public struct OversizeButtonStyle: ButtonStyle { if isAccent { Color.accent } else { - Color.onSurfaceHighEmphasis + Color.onSurfacePrimary } } case .tertiary: switch role { case .some(.destructive): Color.error - case .some(.cancel): Color.onSurfaceHighEmphasis + case .some(.cancel): Color.onSurfacePrimary default: if isAccent { Color.accent } else { - Color.onSurfaceHighEmphasis + Color.onSurfacePrimary } } } diff --git a/Sources/OversizeUI/Controls/Checkbox/Checkbox.swift b/Sources/OversizeUI/Controls/Checkbox/Checkbox.swift index e72a2d8..2a77b9d 100644 --- a/Sources/OversizeUI/Controls/Checkbox/Checkbox.swift +++ b/Sources/OversizeUI/Controls/Checkbox/Checkbox.swift @@ -77,7 +77,7 @@ public struct Checkbox: View { private func checkboxImage(isEnabled: Bool, isOn: Bool) -> some View { ZStack { RoundedRectangle(cornerRadius: Radius.small, style: .continuous) - .strokeBorder(Color.onSurfaceDisabled.opacity(isEnabled ? 1 : 0.5), lineWidth: 2.5) + .strokeBorder(Color.onSurfaceTertiary.opacity(isEnabled ? 1 : 0.5), lineWidth: 2.5) .frame(width: 24, height: 24) .opacity(isOn ? 0 : 1) @@ -87,16 +87,16 @@ public struct Checkbox: View { Image(systemName: "checkmark") .font(.caption.weight(.black)) - .foregroundColor(.onPrimaryHighEmphasis.opacity(isEnabled ? 1 : 0.5)) + .foregroundColor(.onPrimary.opacity(isEnabled ? 1 : 0.5)) .opacity(isOn ? 1 : 0) } } private var foregroundColor: Color { if isEnabled { - Color.onSurfaceHighEmphasis + Color.onSurfacePrimary } else { - Color.onSurfaceDisabled + Color.onSurfaceTertiary } } } diff --git a/Sources/OversizeUI/Controls/GridSelect/GridSelect.swift b/Sources/OversizeUI/Controls/GridSelect/GridSelect.swift index 966af35..44a0d86 100644 --- a/Sources/OversizeUI/Controls/GridSelect/GridSelect.swift +++ b/Sources/OversizeUI/Controls/GridSelect/GridSelect.swift @@ -122,7 +122,7 @@ public struct GridSelect: View RoundedRectangle(cornerRadius: radius, style: .continuous) - .strokeBorder(Color.onSurfaceMediumEmphasis, lineWidth: 2) + .strokeBorder(Color.onSurfaceSecondary, lineWidth: 2) case .accentSurface: RoundedRectangle(cornerRadius: radius.rawValue, style: .continuous) @@ -163,7 +163,7 @@ public struct GridSelect: View Circle() .foregroundColor(Color.surfacePrimary) .shadowElevaton(.z2) - IconDeprecated(.checkMini, color: .onSurfaceHighEmphasis) + IconDeprecated(.checkMini, color: .onSurfacePrimary) }.frame(width: Space.large.rawValue, height: Space.large.rawValue) .padding(.small) } diff --git a/Sources/OversizeUI/Controls/HUD/HUD.swift b/Sources/OversizeUI/Controls/HUD/HUD.swift index c085fab..6366a2d 100644 --- a/Sources/OversizeUI/Controls/HUD/HUD.swift +++ b/Sources/OversizeUI/Controls/HUD/HUD.swift @@ -46,7 +46,7 @@ public struct HUD: View where Title: View, Icon: View { Text(text) .body(.medium) #if os(macOS) - .foregroundColor(Color.onPrimaryHighEmphasis) + .foregroundColor(Color.onPrimary) #else .foregroundColor(Color.onSurfaceHighEmphasis) @@ -62,7 +62,7 @@ public struct HUD: View where Title: View, Icon: View { #if os(macOS) .background( RoundedRectangle(cornerRadius: .small, style: .continuous) - .foregroundColor(Color.onBackgroundHighEmphasis) + .foregroundColor(Color.onBackgroundPrimary) .shadowElevaton(.z2) ) #else diff --git a/Sources/OversizeUI/Controls/Label/MenuLabelStyle.swift b/Sources/OversizeUI/Controls/Label/MenuLabelStyle.swift index 123b34b..1d10c74 100644 --- a/Sources/OversizeUI/Controls/Label/MenuLabelStyle.swift +++ b/Sources/OversizeUI/Controls/Label/MenuLabelStyle.swift @@ -19,17 +19,17 @@ public struct MenuLabelStyle: LabelStyle { HStack(spacing: .xSmall) { configuration.icon .headline() - .foregroundColor(.onSurfaceHighEmphasis) + .foregroundColor(.onSurfacePrimary) VStack(alignment: textAlignment, spacing: .xxxSmall) { configuration.title .headline(.semibold) - .foregroundColor(.onSurfaceHighEmphasis) + .foregroundColor(.onSurfacePrimary) if let subtitle, !subtitle.isEmpty { Text(subtitle) .subheadline() - .foregroundColor(.onSurfaceMediumEmphasis) + .foregroundColor(.onSurfaceSecondary) } } } diff --git a/Sources/OversizeUI/Controls/Label/RowLabelStyle.swift b/Sources/OversizeUI/Controls/Label/RowLabelStyle.swift index 03d808f..7f43f24 100644 --- a/Sources/OversizeUI/Controls/Label/RowLabelStyle.swift +++ b/Sources/OversizeUI/Controls/Label/RowLabelStyle.swift @@ -19,17 +19,17 @@ public struct RowLabelStyle: LabelStyle { HStack(spacing: .xSmall) { configuration.icon .headline() - .foregroundColor(.onSurfaceHighEmphasis) + .foregroundColor(.onSurfacePrimary) VStack(alignment: textAlignment, spacing: .xxxSmall) { configuration.title .headline(.semibold) - .foregroundColor(.onSurfaceHighEmphasis) + .foregroundColor(.onSurfacePrimary) if let subtitle, !subtitle.isEmpty { Text(subtitle) .subheadline() - .foregroundColor(.onSurfaceMediumEmphasis) + .foregroundColor(.onSurfaceSecondary) } } } diff --git a/Sources/OversizeUI/Controls/Loader/LoaderOverlayView.swift b/Sources/OversizeUI/Controls/Loader/LoaderOverlayView.swift index 2d09d66..155bc71 100644 --- a/Sources/OversizeUI/Controls/Loader/LoaderOverlayView.swift +++ b/Sources/OversizeUI/Controls/Loader/LoaderOverlayView.swift @@ -59,7 +59,7 @@ public struct LoaderOverlayView: View { if showText { Text(text.isEmpty ? "Loading" : text) .headline(.semibold) - .onSurfaceDisabledForegroundColor() + .onSurfaceTertiaryForeground() .offset(y: 8) } } @@ -74,7 +74,7 @@ public struct LoaderOverlayView: View { if showText { Text(text.isEmpty ? "Loading" : text) .headline(.semibold) - .onSurfaceDisabledForegroundColor() + .onSurfaceTertiaryForeground() .offset(y: 8) } } diff --git a/Sources/OversizeUI/Controls/Menu/BarButtonMenuStyle.swift b/Sources/OversizeUI/Controls/Menu/BarButtonMenuStyle.swift index d755346..1b6a4fe 100644 --- a/Sources/OversizeUI/Controls/Menu/BarButtonMenuStyle.swift +++ b/Sources/OversizeUI/Controls/Menu/BarButtonMenuStyle.swift @@ -17,7 +17,7 @@ public struct BarButtonMenuStyle: MenuStyle { public func makeBody(configuration: Configuration) -> some View { Menu(configuration) .body(true) - .foregroundColor(Color.onPrimaryHighEmphasis) + .foregroundColor(Color.onPrimary) .padding(.xxSmall) .background(background) .shadowElevaton(.z2) @@ -28,7 +28,7 @@ public struct BarButtonMenuStyle: MenuStyle { .fill(Color.surfacePrimary) .overlay { Capsule() - .strokeBorder(Color.onSurfaceHighEmphasis.opacity(0.15), lineWidth: 2) + .strokeBorder(Color.onSurfacePrimary.opacity(0.15), lineWidth: 2) .opacity(isBordered || theme.borderButtons ? 1 : 0) } } diff --git a/Sources/OversizeUI/Controls/Notice/NoticeView.swift b/Sources/OversizeUI/Controls/Notice/NoticeView.swift index 77bd0cb..18a2523 100644 --- a/Sources/OversizeUI/Controls/Notice/NoticeView.swift +++ b/Sources/OversizeUI/Controls/Notice/NoticeView.swift @@ -52,7 +52,7 @@ public struct NoticeView: View where A: View { Text(title) .headline(.semibold) - .onSurfaceHighEmphasisForegroundColor() + .onSurfacePrimaryForeground() .multilineTextAlignment(.leading) .padding(.trailing, closeAction != nil ? .medium : .zero) } @@ -60,7 +60,7 @@ public struct NoticeView: View where A: View { subtitle.map { text in Text(text) .body(.medium) - .onSurfaceMediumEmphasisForegroundColor() + .onSurfaceSecondaryForeground() .multilineTextAlignment(.leading) } diff --git a/Sources/OversizeUI/Controls/PageView/Page.swift b/Sources/OversizeUI/Controls/PageView/Page.swift index f5025e5..c86258d 100644 --- a/Sources/OversizeUI/Controls/PageView/Page.swift +++ b/Sources/OversizeUI/Controls/PageView/Page.swift @@ -273,7 +273,7 @@ public struct Page 20 ? opacity : 0)) + .foregroundColor(Color.onSurfaceTertiary.opacity(height > 20 ? opacity : 0)) configuration.label .frame(maxWidth: .infinity, alignment: .leading) - .foregroundColor(Color.onSurfaceDisabled.opacity(height > 20 ? opacity : 0)) + .foregroundColor(Color.onSurfaceTertiary.opacity(height > 20 ? opacity : 0)) } .callout(.semibold) @@ -1102,7 +1102,7 @@ struct SeartchTextFieldButtonStyle: ButtonStyle { cornerRadius: .medium, style: .continuous ) - .fill(Color.onSurfaceHighEmphasis.opacity(0.07)) + .fill(Color.onSurfacePrimary.opacity(0.07)) ) .submitLabel(.search) } diff --git a/Sources/OversizeUI/Controls/Premium/PremiumLabel.swift b/Sources/OversizeUI/Controls/Premium/PremiumLabel.swift index bb5a27f..1cde093 100644 --- a/Sources/OversizeUI/Controls/Premium/PremiumLabel.swift +++ b/Sources/OversizeUI/Controls/Premium/PremiumLabel.swift @@ -33,11 +33,11 @@ public struct PremiumLabel: View { if let image { image .renderingMode(.template) - .foregroundColor(isMonohrom ? Color(red: 0.718, green: 0.325, blue: 0.459) : .onPrimaryHighEmphasis) + .foregroundColor(isMonohrom ? Color(red: 0.718, green: 0.325, blue: 0.459) : .onPrimary) } Text(text) .font(.system(size: fontSize, weight: .heavy)) - .foregroundColor(isMonohrom ? Color(red: 0.718, green: 0.325, blue: 0.459) : .onPrimaryHighEmphasis) + .foregroundColor(isMonohrom ? Color(red: 0.718, green: 0.325, blue: 0.459) : .onPrimary) } .padding(.leading, leadingPadding) .padding(.trailing, trailingPadding) @@ -47,7 +47,7 @@ public struct PremiumLabel: View { Group { if isMonohrom { RoundedRectangle(cornerRadius: radius, style: .continuous) - .fill(Color.onPrimaryHighEmphasis) + .fill(Color.onPrimary) } else { RoundedRectangle(cornerRadius: radius, style: .continuous) .fill(LinearGradient(gradient: Gradient(colors: [ diff --git a/Sources/OversizeUI/Controls/Radio/Radio.swift b/Sources/OversizeUI/Controls/Radio/Radio.swift index caf8b8d..ccd7f4a 100644 --- a/Sources/OversizeUI/Controls/Radio/Radio.swift +++ b/Sources/OversizeUI/Controls/Radio/Radio.swift @@ -82,7 +82,7 @@ public struct Radio: View { private func radioImage(isEnabled: Bool, isOn: Bool) -> some View { ZStack { Circle() - .stroke(Color.onSurfaceDisabled.opacity(isEnabled ? 1 : 0.5), lineWidth: 4) + .stroke(Color.onSurfaceTertiary.opacity(isEnabled ? 1 : 0.5), lineWidth: 4) .frame(width: 24, height: 24) .cornerRadius(12) .opacity(isOn ? 0 : 1) @@ -100,9 +100,9 @@ public struct Radio: View { private var foregroundColor: Color { if isEnabled { - Color.onSurfaceHighEmphasis + Color.onSurfacePrimary } else { - Color.onSurfaceDisabled + Color.onSurfaceTertiary } } } diff --git a/Sources/OversizeUI/Controls/Row/Row.swift b/Sources/OversizeUI/Controls/Row/Row.swift index 95f0e65..9656ae8 100644 --- a/Sources/OversizeUI/Controls/Row/Row.swift +++ b/Sources/OversizeUI/Controls/Row/Row.swift @@ -132,7 +132,7 @@ public struct Row: View where LeadingLabel: View, T if isShowArrowIcon { Image.Base.chevronRight - .icon(.onSurfaceDisabled) + .icon(.onSurfaceTertiary) } } } @@ -160,7 +160,7 @@ public struct Row: View where LeadingLabel: View, T сlearAction?() } label: { ZStack { - IconDeprecated(.xMini, color: .onSurfaceDisabled) + IconDeprecated(.xMini, color: .onSurfaceTertiary) .background( RoundedRectangle(cornerRadius: .small, style: .continuous) .fillSurfaceSecondary() @@ -183,7 +183,7 @@ public struct Row: View where LeadingLabel: View, T if let textColor { textColor } else { - Color.onSurfaceHighEmphasis + Color.onSurfacePrimary } } @@ -191,7 +191,7 @@ public struct Row: View where LeadingLabel: View, T if let textColor { textColor } else { - Color.onSurfaceMediumEmphasis + Color.onSurfaceSecondary } } diff --git a/Sources/OversizeUI/Controls/Row/RowButton.swift b/Sources/OversizeUI/Controls/Row/RowButton.swift index 14cec4f..df27aef 100644 --- a/Sources/OversizeUI/Controls/Row/RowButton.swift +++ b/Sources/OversizeUI/Controls/Row/RowButton.swift @@ -68,6 +68,6 @@ public struct RowButton: View { ? Color.link : style == .delete ? Color.error - : Color.onSurfaceHighEmphasis + : Color.onSurfacePrimary } } diff --git a/Sources/OversizeUI/Controls/Row/RowTitle.swift b/Sources/OversizeUI/Controls/Row/RowTitle.swift index b5d641d..fd40d25 100644 --- a/Sources/OversizeUI/Controls/Row/RowTitle.swift +++ b/Sources/OversizeUI/Controls/Row/RowTitle.swift @@ -44,14 +44,14 @@ public struct RowTitle: View { } label: { Text(title) .font(.title2.bold()) - .foregroundColor(.onSurfaceHighEmphasis) + .foregroundColor(.onSurfacePrimary) } .buttonStyle(.scale) } } else { Text(title) .font(.title2.bold()) - .foregroundColor(.onSurfaceHighEmphasis) + .foregroundColor(.onSurfacePrimary) } } @@ -63,7 +63,7 @@ public struct RowTitle: View { action() } label: { IconDeprecated(.chevronRight) - .iconColor(.onSurfaceMediumEmphasis) + .iconColor(.onSurfaceSecondary) .offset(y: titleButtonPosition == .leading ? 1.5 : 0) } .buttonStyle(.scale) diff --git a/Sources/OversizeUI/Controls/SectionView/SectionView.swift b/Sources/OversizeUI/Controls/SectionView/SectionView.swift index b1fb071..fe86bbf 100644 --- a/Sources/OversizeUI/Controls/SectionView/SectionView.swift +++ b/Sources/OversizeUI/Controls/SectionView/SectionView.swift @@ -106,9 +106,9 @@ public struct SectionView: View { private var titleColor: Color { switch titlePosition { case .inside: - .onSurfaceHighEmphasis + .onSurfacePrimary case .outside: - .onBackgroundHighEmphasis + .onBackgroundPrimary } } @@ -141,7 +141,7 @@ public struct SectionView: View { action() } label: { IconDeprecated(.chevronRight) - .iconColor(.onSurfaceMediumEmphasis) + .iconColor(.onSurfaceSecondary) .offset(y: titleButtonPosition == .leading ? 1.5 : 0) } .buttonStyle(.scale) diff --git a/Sources/OversizeUI/Controls/SegmentedControl/SegmentedControl.swift b/Sources/OversizeUI/Controls/SegmentedControl/SegmentedControl.swift index ae428a1..6c32c51 100644 --- a/Sources/OversizeUI/Controls/SegmentedControl/SegmentedControl.swift +++ b/Sources/OversizeUI/Controls/SegmentedControl/SegmentedControl.swift @@ -105,7 +105,7 @@ public struct SegmentedPickerSelector: V content(data[index], selectedIndex == index) .body(.semibold) - .foregroundColor(style.seletionStyle == .accentSurface && selectedIndex == index ? Color.onPrimaryHighEmphasis : Color.onSurfaceHighEmphasis) + .foregroundColor(style.seletionStyle == .accentSurface && selectedIndex == index ? Color.onPrimary : Color.onSurfacePrimary) .multilineTextAlignment(.center) .contentShape(Rectangle()) .frame( @@ -173,7 +173,7 @@ public struct SegmentedPickerSelector: V }, label: { content(data[index], selectedIndex == index) .body(.semibold) - .foregroundColor(style.seletionStyle == .accentSurface && selectedIndex == index ? Color.onPrimaryHighEmphasis : Color.onSurfaceHighEmphasis) + .foregroundColor(style.seletionStyle == .accentSurface && selectedIndex == index ? Color.onPrimary : Color.onSurfacePrimary) .multilineTextAlignment(.center) .padding(.leading, controlPadding.leading) .padding(.trailing, controlPadding.trailing) @@ -244,7 +244,7 @@ public struct SegmentedPickerSelector: V ? controlRadius.rawValue - 4 : controlRadius.rawValue, style: .continuous) - .strokeBorder(Color.onSurfaceMediumEmphasis, lineWidth: 2) + .strokeBorder(Color.onSurfaceSecondary, lineWidth: 2) } case .accentSurface: RoundedRectangle( diff --git a/Sources/OversizeUI/Controls/SegmentedControl/Support/SegmentedControlPreview.swift b/Sources/OversizeUI/Controls/SegmentedControl/Support/SegmentedControlPreview.swift index fbff8d0..2e65ac9 100644 --- a/Sources/OversizeUI/Controls/SegmentedControl/Support/SegmentedControlPreview.swift +++ b/Sources/OversizeUI/Controls/SegmentedControl/Support/SegmentedControlPreview.swift @@ -71,7 +71,7 @@ struct SegmentedControlPreview: View { Text(item) Text("Subtitle") .subheadline() - .onSurfaceMediumEmphasisForegroundColor() + .onSurfaceSecondaryForeground() } } .segmentedControlStyle(SelectionOnlySegmentedControlStyle()) diff --git a/Sources/OversizeUI/Controls/Select/MultiSelect.swift b/Sources/OversizeUI/Controls/Select/MultiSelect.swift index 8588495..a63fd76 100644 --- a/Sources/OversizeUI/Controls/Select/MultiSelect.swift +++ b/Sources/OversizeUI/Controls/Select/MultiSelect.swift @@ -63,7 +63,7 @@ public struct MultiSelect: View { cornerRadius: surfaceRadius, style: .continuous ) - .fill(Color.onSurfaceDisabled.opacity(0.04)) + .fill(Color.onSurfaceTertiary.opacity(0.04)) } } #else @@ -291,7 +291,7 @@ struct Surface_Previews: PreviewProvider { Surface { Text("Text") .title3() - .onSurfaceHighEmphasisForegroundColor() + .onSurfacePrimaryForeground() } .surfaceStyle(.secondary) .previewLayout(.fixed(width: 414, height: 200)) @@ -299,7 +299,7 @@ struct Surface_Previews: PreviewProvider { Surface { Text("Text") .title3() - .onSurfaceHighEmphasisForegroundColor() + .onSurfacePrimaryForeground() } .surfaceStyle(.primary) .surfaceBorderColor(.surfaceSecondary) diff --git a/Sources/OversizeUI/Controls/Switch/Switch.swift b/Sources/OversizeUI/Controls/Switch/Switch.swift index da141b3..6bf280f 100644 --- a/Sources/OversizeUI/Controls/Switch/Switch.swift +++ b/Sources/OversizeUI/Controls/Switch/Switch.swift @@ -72,7 +72,7 @@ public struct Switch: View { if let subtitle, !subtitle.isEmpty { Text(subtitle) .subheadline() - .foregroundColor(.onSurfaceMediumEmphasis) + .foregroundColor(.onSurfaceSecondary) } } .padding(contentInset) @@ -88,9 +88,9 @@ public struct Switch: View { private var foregroundColor: Color { if isEnabled { - Color.onSurfaceHighEmphasis + Color.onSurfacePrimary } else { - Color.onSurfaceDisabled + Color.onSurfaceTertiary } } } diff --git a/Sources/OversizeUI/Controls/TextBox/TextBox.swift b/Sources/OversizeUI/Controls/TextBox/TextBox.swift index c975a18..9c9cb26 100644 --- a/Sources/OversizeUI/Controls/TextBox/TextBox.swift +++ b/Sources/OversizeUI/Controls/TextBox/TextBox.swift @@ -33,12 +33,12 @@ public struct TextBox: View { VStack(alignment: textStackAlignment, spacing: textSpacing) { Text(title) .font(titleFont) - .onSurfaceHighEmphasisForegroundColor() + .onSurfacePrimaryForeground() subtitle.map { Text($0) .font(subtitleFont) - .onSurfaceMediumEmphasisForegroundColor() + .onSurfaceSecondaryForeground() } } .multilineTextAlignment(multilineTextAlignment) diff --git a/Sources/OversizeUI/Controls/TextEditor/TextEditorPlaceholderViewModifier.swift b/Sources/OversizeUI/Controls/TextEditor/TextEditorPlaceholderViewModifier.swift index 92bbc53..36df967 100644 --- a/Sources/OversizeUI/Controls/TextEditor/TextEditorPlaceholderViewModifier.swift +++ b/Sources/OversizeUI/Controls/TextEditor/TextEditorPlaceholderViewModifier.swift @@ -25,7 +25,7 @@ public struct TextEditorPlaceholderViewModifier: ViewModifier { HStack { Text(placeholder) .subheadline(.medium) - .foregroundColor(.onSurfaceHighEmphasis) + .foregroundColor(.onSurfacePrimary) Spacer() } } @@ -33,7 +33,7 @@ public struct TextEditorPlaceholderViewModifier: ViewModifier { content .padding(padding) .headline(.medium) - .onSurfaceHighEmphasisForegroundColor() + .onSurfacePrimaryForeground() .background { ZStack { RoundedRectangle(cornerRadius: fieldRadius, style: .continuous) @@ -121,7 +121,7 @@ public struct TextEditorPlaceholderViewModifier: ViewModifier { if text.isEmpty { Text(placeholder) .subheadline() - .onSurfaceDisabledForegroundColor() + .onSurfaceTertiaryForeground() .opacity(0.7) .padding(labelPadding) } @@ -131,7 +131,7 @@ public struct TextEditorPlaceholderViewModifier: ViewModifier { Text(placeholder) .font(text.isEmpty ? .headline : .subheadline) .fontWeight(text.isEmpty ? .medium : .semibold) - .onSurfaceDisabledForegroundColor() + .onSurfaceTertiaryForeground() .opacity(0.7) .padding(labelPadding) .offset(y: text.isEmpty ? 0 : -6) diff --git a/Sources/OversizeUI/Controls/TextField/FieldHelperViewModifier.swift b/Sources/OversizeUI/Controls/TextField/FieldHelperViewModifier.swift index ce2e97e..25d640f 100644 --- a/Sources/OversizeUI/Controls/TextField/FieldHelperViewModifier.swift +++ b/Sources/OversizeUI/Controls/TextField/FieldHelperViewModifier.swift @@ -38,7 +38,7 @@ public struct FieldHelperViewModifier: ViewModifier { private var helperForegroundColor: Color { switch helperStyle { case .helperText: - Color.onSurfaceMediumEmphasis + Color.onSurfaceSecondary case .errorText: Color.error case .sussesText: diff --git a/Sources/OversizeUI/Controls/TextField/FieldTitleViewModifier.swift b/Sources/OversizeUI/Controls/TextField/FieldTitleViewModifier.swift index 123fe08..f9323fd 100644 --- a/Sources/OversizeUI/Controls/TextField/FieldTitleViewModifier.swift +++ b/Sources/OversizeUI/Controls/TextField/FieldTitleViewModifier.swift @@ -16,7 +16,7 @@ public struct FieldTitleViewModifier: ViewModifier { VStack(alignment: .leading, spacing: .xSmall) { Text(title) .subheadline(.medium) - .onSurfaceHighEmphasisForegroundColor() + .onSurfacePrimaryForeground() content } diff --git a/Sources/OversizeUI/Controls/TextField/LabeledTextFieldStyle.swift b/Sources/OversizeUI/Controls/TextField/LabeledTextFieldStyle.swift index 0190799..09444cf 100644 --- a/Sources/OversizeUI/Controls/TextField/LabeledTextFieldStyle.swift +++ b/Sources/OversizeUI/Controls/TextField/LabeledTextFieldStyle.swift @@ -26,7 +26,7 @@ public struct LabeledTextFieldStyle: TextFieldStyle { if fieldPlaceholderPosition == .adjacent { Text(placeholder) .subheadline(.medium) - .foregroundColor(platform == .macOS ? .onSurfaceMediumEmphasis : .onSurfaceHighEmphasis) + .foregroundColor(platform == .macOS ? .onSurfaceSecondary : .onSurfacePrimary) .frame(maxWidth: .infinity, alignment: .leading) .offset(x: platform == .macOS ? 4 : 0) } @@ -34,7 +34,7 @@ public struct LabeledTextFieldStyle: TextFieldStyle { labelTextView configuration .headline(.medium) - .foregroundColor(.onSurfaceHighEmphasis) + .foregroundColor(.onSurfacePrimary) .padding(padding) .offset(y: fieldOffset) .focused($isFocused) @@ -216,7 +216,7 @@ public struct LabeledTextFieldStyle: TextFieldStyle { if isFocused { Text(placeholder) .subheadline() - .onSurfaceDisabledForegroundColor() + .onSurfaceTertiaryForeground() .opacity(0.7) #if os(macOS) .padding(.xSmall) @@ -230,7 +230,7 @@ public struct LabeledTextFieldStyle: TextFieldStyle { Text(placeholder) .font(text.isEmpty ? .headline : .subheadline) .fontWeight(text.isEmpty ? .medium : .semibold) - .onSurfaceDisabledForegroundColor() + .onSurfaceTertiaryForeground() #if os(macOS) .padding(.xSmall) .offset(y: text.isEmpty ? 0 : -10) diff --git a/Sources/OversizeUI/Controls/TextField/TextFieldExtended.swift b/Sources/OversizeUI/Controls/TextField/TextFieldExtended.swift index 152b1e3..e28dc21 100644 --- a/Sources/OversizeUI/Controls/TextField/TextFieldExtended.swift +++ b/Sources/OversizeUI/Controls/TextField/TextFieldExtended.swift @@ -62,7 +62,7 @@ public struct TextFieldExtended: View { HStack { Text(placeholder) .subheadline() - .foregroundColor(.onSurfaceHighEmphasis) + .foregroundColor(.onSurfacePrimary) Spacer() } .padding(.bottom, Space.xxSmall) @@ -81,7 +81,7 @@ public struct TextFieldExtended: View { self.focused = focused }) .headline() - .foregroundColor(.onSurfaceHighEmphasis) + .foregroundColor(.onSurfacePrimary) } if trallingImage != .none { @@ -116,7 +116,7 @@ public struct TextFieldExtended: View { if helperStyle == .helperText { Text(helperText) .subheadline() - .foregroundColor(.onSurfaceMediumEmphasis) + .foregroundColor(.onSurfaceSecondary) } else if helperStyle == .errorText { Text(helperText) .subheadline() diff --git a/Sources/OversizeUI/Controls/Toast/Snackbar.swift b/Sources/OversizeUI/Controls/Toast/Snackbar.swift index 3e04082..d4df23c 100644 --- a/Sources/OversizeUI/Controls/Toast/Snackbar.swift +++ b/Sources/OversizeUI/Controls/Toast/Snackbar.swift @@ -36,7 +36,7 @@ public struct Snackbar: View where Label: View, Actions: View { if let text { Text(text) .body(.medium) - .foregroundColor(.onPrimaryHighEmphasis) + .foregroundColor(.onPrimary) } else if let label { label diff --git a/Sources/OversizeUI/Controls/Toogle/CheckboxStyle.swift b/Sources/OversizeUI/Controls/Toogle/CheckboxStyle.swift index 5b02752..03c8041 100644 --- a/Sources/OversizeUI/Controls/Toogle/CheckboxStyle.swift +++ b/Sources/OversizeUI/Controls/Toogle/CheckboxStyle.swift @@ -12,13 +12,13 @@ public struct CheckboxStyle: ToggleStyle { HStack { configuration.label .headline(.semibold) - .foregroundColor(.onSurfaceHighEmphasis) + .foregroundColor(.onSurfacePrimary) Spacer() ZStack { RoundedRectangle(cornerRadius: Radius.small, style: .continuous) - .strokeBorder(Color.onSurfaceDisabled, lineWidth: 2.5) + .strokeBorder(Color.onSurfaceTertiary, lineWidth: 2.5) .frame(width: 24, height: 24) .opacity(configuration.isOn ? 0 : 1) @@ -28,7 +28,7 @@ public struct CheckboxStyle: ToggleStyle { Image(systemName: "checkmark") .font(.caption.weight(.black)) - .foregroundColor(.onPrimaryHighEmphasis) + .foregroundColor(.onPrimary) .opacity(configuration.isOn ? 1 : 0) } } diff --git a/Sources/OversizeUI/Controls/Toogle/RadioStyle.swift b/Sources/OversizeUI/Controls/Toogle/RadioStyle.swift index 8d570d5..e602bb6 100644 --- a/Sources/OversizeUI/Controls/Toogle/RadioStyle.swift +++ b/Sources/OversizeUI/Controls/Toogle/RadioStyle.swift @@ -12,13 +12,13 @@ public struct RadioStyle: ToggleStyle { HStack { configuration.label .headline(.semibold) - .foregroundColor(.onSurfaceHighEmphasis) + .foregroundColor(.onSurfacePrimary) Spacer() ZStack { Circle() - .stroke(Color.onSurfaceDisabled, lineWidth: 4) + .stroke(Color.onSurfaceTertiary, lineWidth: 4) .frame(width: 24, height: 24) .cornerRadius(12) .opacity(configuration.isOn ? 0 : 1) diff --git a/Sources/OversizeUI/Core/Colors.swift b/Sources/OversizeUI/Core/Colors.swift index 6dd7271..86e24c5 100644 --- a/Sources/OversizeUI/Core/Colors.swift +++ b/Sources/OversizeUI/Core/Colors.swift @@ -15,17 +15,17 @@ public extension Color { // MARK: - On Primary /// On Primary High Emphasis - static var onPrimaryHighEmphasis: Color { + static var onPrimary: Color { Color("OnPrimaryHighEmphasis", bundle: .module) } /// On Primary Medium Emphasis - static var onPrimaryMediumEmphasis: Color { + static var onPrimarySecondary: Color { Color("OnPrimaryMediumEmphasis", bundle: .module) } /// On Primary Disabled - static var onPrimaryDisabled: Color { + static var onPrimaryTertiary: Color { Color("OnPrimaryDisabled", bundle: .module) } @@ -49,17 +49,17 @@ public extension Color { // MARK: - On Background /// On Background High Emphasis - static var onBackgroundHighEmphasis: Color { + static var onBackgroundPrimary: Color { Color("OnBackgroundHighEmphasis", bundle: .module) } /// On BackgroundMedium Emphasis - static var onBackgroundMediumEmphasis: Color { + static var onBackgroundSecondary: Color { Color("OnBackgroundMediumEmphasis", bundle: .module) } /// On Background Disabled - static var onBackgroundDisabled: Color { + static var onBackgroundTertiary: Color { Color("OnBackgroundDisabled", bundle: .module) } @@ -81,17 +81,17 @@ public extension Color { } /// On Surface High Emphasis - static var onSurfaceHighEmphasis: Color { + static var onSurfacePrimary: Color { Color("OnSurfaceHighEmphasis", bundle: .module) } /// On Surface Medium Emphasis - static var onSurfaceMediumEmphasis: Color { + static var onSurfaceSecondary: Color { Color("OnSurfaceMediumEmphasis", bundle: .module) } /// On Surface Disabled - static var onSurfaceDisabled: Color { + static var onSurfaceTertiary: Color { Color("OnSurfaceDisabled", bundle: .module) } @@ -126,87 +126,87 @@ public extension Color { // MARK: - Foreground Color Extension public extension View { - nonisolated func onPrimaryHighEmphasisForegroundColor() -> some View { - foregroundColor(Color.onPrimaryHighEmphasis) + nonisolated func onPrimaryForeground() -> some View { + foregroundColor(Color.onPrimary) } - nonisolated func onPrimaryMediumEmphasisForegroundColor() -> some View { - foregroundColor(Color.onPrimaryMediumEmphasis) + nonisolated func onPrimarySecondaryForeground() -> some View { + foregroundColor(Color.onPrimarySecondary) } - nonisolated func onPrimaryDisabledForegroundColor() -> some View { - foregroundColor(Color.onPrimaryDisabled) + nonisolated func onPrimaryTertiaryForeground() -> some View { + foregroundColor(Color.onPrimaryTertiary) } - nonisolated func backgroundPrimaryForegroundColor() -> some View { + nonisolated func backgroundPrimary() -> some View { foregroundColor(Color.backgroundPrimary) } - nonisolated func backgroundSecondaryForegroundColor() -> some View { + nonisolated func backgroundSecondaryForeground() -> some View { foregroundColor(Color.backgroundSecondary) } - nonisolated func backgroundTertiaryForegroundColor() -> some View { + nonisolated func backgroundTertiaryForeground() -> some View { foregroundColor(Color.backgroundTertiary) } - nonisolated func onBackgroundHighEmphasisForegroundColor() -> some View { - foregroundColor(Color.onBackgroundHighEmphasis) + nonisolated func onBackgroundPrimaryForeground() -> some View { + foregroundColor(Color.onBackgroundPrimary) } - nonisolated func onBackgroundMediumEmphasisForegroundColor() -> some View { - foregroundColor(Color.onBackgroundMediumEmphasis) + nonisolated func onBackgroundSecondaryForeground() -> some View { + foregroundColor(Color.onBackgroundSecondary) } - nonisolated func onBackgroundDisabledForegroundColor() -> some View { - foregroundColor(Color.onBackgroundDisabled) + nonisolated func onBackgroundTertiaryForeground() -> some View { + foregroundColor(Color.onBackgroundTertiary) } - nonisolated func surfacePrimaryForegroundColor() -> some View { + nonisolated func surfacePrimaryForeground() -> some View { foregroundColor(Color.surfacePrimary) } - nonisolated func surfaceSecondaryForegroundColor() -> some View { + nonisolated func surfaceSecondaryForeground() -> some View { foregroundColor(Color.surfaceSecondary) } - nonisolated func surfaceTertiaryForegroundColor() -> some View { + nonisolated func surfaceTertiaryForeground() -> some View { foregroundColor(Color.surfaceTertiary) } - nonisolated func onSurfaceHighEmphasisForegroundColor() -> some View { - foregroundColor(Color.onSurfaceHighEmphasis) + nonisolated func onSurfacePrimaryForeground() -> some View { + foregroundColor(Color.onSurfacePrimary) } - nonisolated func onSurfaceMediumEmphasisForegroundColor() -> some View { - foregroundColor(Color.onSurfaceMediumEmphasis) + nonisolated func onSurfaceSecondaryForeground() -> some View { + foregroundColor(Color.onSurfaceSecondary) } - nonisolated func onSurfaceDisabledForegroundColor() -> some View { - foregroundColor(Color.onSurfaceDisabled) + nonisolated func onSurfaceTertiaryForeground() -> some View { + foregroundColor(Color.onSurfaceTertiary) } - nonisolated func accentForegroundColor() -> some View { + nonisolated func accentForeground() -> some View { foregroundColor(Color.accentColor) } - nonisolated func errorForegroundColor() -> some View { + nonisolated func errorForeground() -> some View { foregroundColor(Color.error) } - nonisolated func successForegroundColor() -> some View { + nonisolated func successForeground() -> some View { foregroundColor(Color.success) } - nonisolated func warningForegroundColor() -> some View { + nonisolated func warningForeground() -> some View { foregroundColor(Color.warning) } - nonisolated func linkForegroundColor() -> some View { + nonisolated func linkForeground() -> some View { foregroundColor(Color.link) } - nonisolated func borderForegroundColor() -> some View { + nonisolated func borderForeground() -> some View { foregroundColor(Color.border) } } @@ -214,16 +214,16 @@ public extension View { // MARK: - Fill Color Extension public extension Shape { - nonisolated func fillOnPrimaryHighEmphasis() -> some View { - fill(Color.onPrimaryHighEmphasis) + nonisolated func fillOnPrimary() -> some View { + fill(Color.onPrimary) } - nonisolated func fillOnPrimaryMediumEmphasis() -> some View { - fill(Color.onPrimaryMediumEmphasis) + nonisolated func fillOnPrimarySecondary() -> some View { + fill(Color.onPrimarySecondary) } - nonisolated func fillOnPrimaryDisabled() -> some View { - fill(Color.onPrimaryDisabled) + nonisolated func fillOnPrimaryTertiary() -> some View { + fill(Color.onPrimaryTertiary) } nonisolated func fillAccent() -> some View { @@ -242,16 +242,16 @@ public extension Shape { fill(Color.backgroundTertiary) } - nonisolated func fillOnBackgroundHighEmphasis() -> some View { - fill(Color.onBackgroundHighEmphasis) + nonisolated func fillOnBackgroundPrimary() -> some View { + fill(Color.onBackgroundPrimary) } - nonisolated func fillOnBackgroundMediumEmphasis() -> some View { - fill(Color.onBackgroundMediumEmphasis) + nonisolated func fillOnBackgroundSecondary() -> some View { + fill(Color.onBackgroundSecondary) } - nonisolated func fillOnBackgroundDisabled() -> some View { - fill(Color.onBackgroundDisabled) + nonisolated func fillOnBackgroundTertiary() -> some View { + fill(Color.onBackgroundTertiary) } nonisolated func fillSurfacePrimary() -> some View { @@ -266,16 +266,16 @@ public extension Shape { fill(Color.surfaceTertiary) } - nonisolated func fillOnSurfaceHighEmphasis() -> some View { - fill(Color.onSurfaceHighEmphasis) + nonisolated func fillOnSurfacePrimary() -> some View { + fill(Color.onSurfacePrimary) } - nonisolated func fillOnSurfaceMediumEmphasis() -> some View { - fill(Color.onSurfaceMediumEmphasis) + nonisolated func fillOnSurfaceSecondary() -> some View { + fill(Color.onSurfaceSecondary) } - nonisolated func fillOnSurfaceDisabled() -> some View { - fill(Color.onSurfaceDisabled) + nonisolated func fillOnSurfaceTertiary() -> some View { + fill(Color.onSurfaceTertiary) } nonisolated func fillError() -> some View { @@ -300,62 +300,62 @@ public extension Shape { } public extension View { - @available(*, deprecated, renamed: "onPrimaryHighEmphasisForegroundColor") + @available(*, deprecated, renamed: "onPrimaryForeground") nonisolated func foregroundOnPrimaryHighEmphasis() -> some View { - foregroundColor(Color.onPrimaryHighEmphasis) + foregroundColor(Color.onPrimary) } - @available(*, deprecated, renamed: "onPrimaryMediumEmphasisForegroundColor") + @available(*, deprecated, renamed: "onPrimarySecondaryForeground") nonisolated func foregroundOnPrimaryMediumEmphasis() -> some View { - foregroundColor(Color.onPrimaryMediumEmphasis) + foregroundColor(Color.onPrimarySecondary) } - @available(*, deprecated, renamed: "onPrimaryDisabledForegroundColor") + @available(*, deprecated, renamed: "onPrimaryTertiaryForeground") nonisolated func foregroundOnPrimaryDisabled() -> some View { - foregroundColor(Color.onPrimaryDisabled) + foregroundColor(Color.onPrimaryTertiary) } - @available(*, deprecated, renamed: "accentForegroundColor") + @available(*, deprecated, renamed: "accentForeground") nonisolated func foregroundAccent() -> some View { foregroundColor(Color.accentColor) } - @available(*, deprecated, renamed: "backgroundPrimaryForegroundColor") + @available(*, deprecated, renamed: "backgroundPrimary") nonisolated func foregroundBackgroundPrimary() -> some View { foregroundColor(Color.backgroundPrimary) } - @available(*, deprecated, renamed: "backgroundSecondaryForegroundColor") + @available(*, deprecated, renamed: "backgroundSecondaryForeground") nonisolated func foregroundBackgroundSecondary() -> some View { foregroundColor(Color.backgroundSecondary) } - @available(*, deprecated, renamed: "backgroundTertiaryForegroundColor") + @available(*, deprecated, renamed: "backgroundTertiaryForeground") nonisolated func foregroundBackgroundTertiary() -> some View { foregroundColor(Color.backgroundTertiary) } - @available(*, deprecated, renamed: "onBackgroundHighEmphasisForegroundColor") + @available(*, deprecated, renamed: "onBackgroundPrimaryForeground") nonisolated func foregroundOnBackgroundHighEmphasis() -> some View { - foregroundColor(Color.onBackgroundHighEmphasis) + foregroundColor(Color.onBackgroundPrimary) } - @available(*, deprecated, renamed: "onBackgroundMediumEmphasisForegroundColor") + @available(*, deprecated, renamed: "onBackgroundSecondaryForeground") nonisolated func foregroundOnBackgroundMediumEmphasis() -> some View { - foregroundColor(Color.onBackgroundMediumEmphasis) + foregroundColor(Color.onBackgroundSecondary) } - @available(*, deprecated, renamed: "onBackgroundDisabledForegroundColor") + @available(*, deprecated, renamed: "onBackgroundTertiaryForeground") nonisolated func foregroundOnBackgroundDisabled() -> some View { - foregroundColor(Color.onBackgroundDisabled) + foregroundColor(Color.onBackgroundTertiary) } - @available(*, deprecated, renamed: "surfacePrimaryForegroundColor") + @available(*, deprecated, renamed: "surfacePrimaryForeground") nonisolated func foregroundSurfacePrimary() -> some View { foregroundColor(Color.surfacePrimary) } - @available(*, deprecated, renamed: "surfaceSecondaryForegroundColor") + @available(*, deprecated, renamed: "surfaceSecondaryForeground") nonisolated func foregroundSurfaceSecondary() -> some View { foregroundColor(Color.surfaceSecondary) } @@ -367,40 +367,40 @@ public extension View { @available(*, deprecated, renamed: "onSurfaceHighEmphasisForegroundColor") nonisolated func foregroundOnSurfaceHighEmphasis() -> some View { - foregroundColor(Color.onSurfaceHighEmphasis) + foregroundColor(Color.onSurfacePrimary) } - @available(*, deprecated, renamed: "onSurfaceMediumEmphasisForegroundColor") + @available(*, deprecated, renamed: "onSurfaceSecondaryForeground") nonisolated func foregroundOnSurfaceMediumEmphasis() -> some View { - foregroundColor(Color.onSurfaceMediumEmphasis) + foregroundColor(Color.onSurfaceSecondary) } - @available(*, deprecated, renamed: "onSurfaceDisabledForegroundColor") + @available(*, deprecated, renamed: "onSurfaceTertiaryForeground") nonisolated func foregroundOnSurfaceDisabled() -> some View { - foregroundColor(Color.onSurfaceDisabled) + foregroundColor(Color.onSurfaceTertiary) } - @available(*, deprecated, renamed: "errorForegroundColor") + @available(*, deprecated, renamed: "errorForeground") nonisolated func foregroundError() -> some View { foregroundColor(Color.error) } - @available(*, deprecated, renamed: "successForegroundColor") + @available(*, deprecated, renamed: "successForeground") nonisolated func foregroundSuccess() -> some View { foregroundColor(Color.success) } - @available(*, deprecated, renamed: "warningForegroundColor") + @available(*, deprecated, renamed: "warningForeground") nonisolated func foregroundWarning() -> some View { foregroundColor(Color.warning) } - @available(*, deprecated, renamed: "linkForegroundColor") + @available(*, deprecated, renamed: "linkForeground") nonisolated func foregroundLink() -> some View { foregroundColor(Color.link) } - @available(*, deprecated, renamed: "borderForegroundColor") + @available(*, deprecated, renamed: "borderForeground") nonisolated func foregroundBorder() -> some View { foregroundColor(Color.border) } @@ -410,16 +410,16 @@ struct Color_Previews: PreviewProvider { static var previews: some View { VStack(alignment: .leading, spacing: 10) { Text("Accent") - .foregroundColor(Color.onPrimaryMediumEmphasis) + .foregroundColor(Color.onPrimarySecondary) .padding() HStack { Rectangle().size(CGSize(width: 50, height: 50)) - .foregroundColor(Color.onPrimaryHighEmphasis) + .foregroundColor(Color.onPrimary) Rectangle().size(CGSize(width: 50, height: 50)) - .foregroundColor(Color.onPrimaryMediumEmphasis) + .foregroundColor(Color.onPrimarySecondary) Rectangle().size(CGSize(width: 50, height: 50)) - .foregroundColor(Color.onPrimaryDisabled) + .foregroundColor(Color.onPrimaryTertiary) Rectangle().size(CGSize(width: 50, height: 50)) } .padding(.horizontal) diff --git a/Sources/OversizeUI/Deprecated/ButtonLegacy.swift b/Sources/OversizeUI/Deprecated/ButtonLegacy.swift index 5e1cf5b..c4b97c0 100644 --- a/Sources/OversizeUI/Deprecated/ButtonLegacy.swift +++ b/Sources/OversizeUI/Deprecated/ButtonLegacy.swift @@ -86,7 +86,7 @@ public struct ButtonStyleExtended: ButtonStyle { configuration.label .body(true) .padding(.horizontal, Space.small) - .foregroundColor(isEnabled ? .onPrimaryHighEmphasis : .onPrimaryDisabled) + .foregroundColor(isEnabled ? .onPrimary : .onPrimaryTertiary) .frame(maxWidth: width == .full ? .infinity : width == .standart ? nil : size == .large ? Constants.heightL : Constants.heightM, minHeight: size == .large ? ButtonStyleExtended.Constants.heightL : ButtonStyleExtended.Constants.heightM) .background( @@ -123,7 +123,7 @@ public struct ButtonStyleExtended: ButtonStyle { configuration.label .body(true) .padding(.horizontal, Space.small) - .foregroundColor(isEnabled ? Color.backgroundPrimary : .onPrimaryDisabled) + .foregroundColor(isEnabled ? Color.backgroundPrimary : .onPrimaryTertiary) .frame(maxWidth: width == .full ? .infinity : width == .standart ? nil : size == .large ? Constants.heightL : Constants.heightM, minHeight: size == .large ? ButtonStyleExtended.Constants.heightL : ButtonStyleExtended.Constants.heightM) .background( @@ -159,7 +159,7 @@ public struct ButtonStyleExtended: ButtonStyle { configuration.label .body(true) .padding(.horizontal, Space.small) - .foregroundColor(isEnabled ? .onSurfaceHighEmphasis : .onSurfaceDisabled) + .foregroundColor(isEnabled ? .onSurfacePrimary : .onSurfaceTertiary) .frame(maxWidth: width == .full ? .infinity : width == .standart ? nil : size == .large ? Constants.heightL : Constants.heightM, minHeight: size == .large ? ButtonStyleExtended.Constants.heightL : ButtonStyleExtended.Constants.heightM) .background( @@ -195,7 +195,7 @@ public struct ButtonStyleExtended: ButtonStyle { configuration.label .body(true) .padding(.horizontal, Space.small) - .foregroundColor(isEnabled ? .onBackgroundHighEmphasis : .onBackgroundDisabled) + .foregroundColor(isEnabled ? .onBackgroundPrimary : .onBackgroundTertiary) .frame(maxWidth: width == .full ? .infinity : width == .standart ? nil : size == .large ? Constants.heightL : Constants.heightM, minHeight: size == .large ? ButtonStyleExtended.Constants.heightL : ButtonStyleExtended.Constants.heightM) .background( @@ -228,7 +228,7 @@ public struct ButtonStyleExtended: ButtonStyle { configuration.label .body(true) .padding(.horizontal, Space.small) - .foregroundColor(isEnabled ? .onSurfaceHighEmphasis : .onSurfaceDisabled) + .foregroundColor(isEnabled ? .onSurfacePrimary : .onSurfaceTertiary) .frame(maxWidth: width == .full ? .infinity : width == .standart ? nil : size == .large ? Constants.heightL : Constants.heightM, minHeight: size == .large ? ButtonStyleExtended.Constants.heightL : ButtonStyleExtended.Constants.heightM) .opacity(configuration.isPressed ? 0.9 : 1) diff --git a/Sources/OversizeUI/Deprecated/HUDDeprecated.swift b/Sources/OversizeUI/Deprecated/HUDDeprecated.swift index 28defe4..c6aab44 100644 --- a/Sources/OversizeUI/Deprecated/HUDDeprecated.swift +++ b/Sources/OversizeUI/Deprecated/HUDDeprecated.swift @@ -212,12 +212,12 @@ public struct HUDContent: View { case .hud: HStack { // if let icon = hudState.icon { -// IconDeprecated(icon, color: .onSurfaceHighEmphasis) +// IconDeprecated(icon, color: .onSurfacePrimary) // } Text(title) .body() - .onSurfaceHighEmphasisForegroundColor() + .onSurfacePrimaryForeground() } case .alert: VStack(spacing: .large) { @@ -227,7 +227,7 @@ public struct HUDContent: View { Text(title) .title3() - .onSurfaceHighEmphasisForegroundColor() + .onSurfacePrimaryForeground() } .frame(minWidth: 225) } diff --git a/Sources/OversizeUI/Deprecated/Icon.swift b/Sources/OversizeUI/Deprecated/Icon.swift index 6e150fe..6eb0e89 100644 --- a/Sources/OversizeUI/Deprecated/Icon.swift +++ b/Sources/OversizeUI/Deprecated/Icon.swift @@ -46,18 +46,18 @@ public struct IconDeprecated: View { public init(_ image: Image) { self.image = image size = .medium - color = Color.onBackgroundHighEmphasis + color = Color.onBackgroundPrimary name = nil } public init(_ name: IconsNames = .menu) { self.name = name size = .medium - color = Color.onBackgroundHighEmphasis + color = Color.onBackgroundPrimary image = nil } - public init(_ name: IconsNames = .menu, size: IconSizes = .medium, color: Color = .onBackgroundHighEmphasis) { + public init(_ name: IconsNames = .menu, size: IconSizes = .medium, color: Color = .onBackgroundPrimary) { self.name = name self.color = color self.size = size diff --git a/Sources/OversizeUI/Deprecated/PageView.swift b/Sources/OversizeUI/Deprecated/PageView.swift index d3ccc6a..1b9a899 100644 --- a/Sources/OversizeUI/Deprecated/PageView.swift +++ b/Sources/OversizeUI/Deprecated/PageView.swift @@ -126,7 +126,7 @@ public struct PageView case .none: EmptyView() case .icon: - IconDeprecated(.xMini, color: .onSurfaceMediumEmphasis) + IconDeprecated(.xMini, color: .onSurfaceSecondary) .background { Circle() .fill(Color.backgroundTertiary) @@ -135,7 +135,7 @@ public struct PageView case let .label(text): Text(text) .subheadline(.bold) - .foregroundColor(.onSurfaceHighEmphasis) + .foregroundColor(.onSurfacePrimary) .padding(.horizontal, .xSmall) .background { RoundedRectangle(cornerRadius: .small, style: .continuous) diff --git a/Sources/OversizeUI/Deprecated/RowDeprecated.swift b/Sources/OversizeUI/Deprecated/RowDeprecated.swift index a6bbcf2..564ecb0 100644 --- a/Sources/OversizeUI/Deprecated/RowDeprecated.swift +++ b/Sources/OversizeUI/Deprecated/RowDeprecated.swift @@ -108,7 +108,7 @@ public struct RowDeprecated: View { } if isShowArrowIcon { - IconDeprecated(.chevronRight, color: .onSurfaceDisabled) + IconDeprecated(.chevronRight, color: .onSurfaceTertiary) } } } @@ -124,11 +124,11 @@ public struct RowDeprecated: View { VStack(alignment: textAlignment, spacing: .xxxSmall) { Text(title) .headline(.semibold) - .foregroundColor(.onSurfaceHighEmphasis) + .foregroundColor(.onSurfacePrimary) if let subtitle, !subtitle.isEmpty { Text(subtitle) .subheadline() - .foregroundColor(.onSurfaceMediumEmphasis) + .foregroundColor(.onSurfaceSecondary) } } .multilineTextAlignment(multilineTextAlignment) @@ -141,7 +141,7 @@ public struct RowDeprecated: View { сlearAction?() } label: { ZStack { - IconDeprecated(.xMini, color: .onSurfaceDisabled) + IconDeprecated(.xMini, color: .onSurfaceTertiary) .background( RoundedRectangle(cornerRadius: .small, style: .continuous) .fillSurfaceSecondary() diff --git a/Sources/OversizeUI/Deprecated/RowLeading.swift b/Sources/OversizeUI/Deprecated/RowLeading.swift index c932d82..1fc1433 100644 --- a/Sources/OversizeUI/Deprecated/RowLeading.swift +++ b/Sources/OversizeUI/Deprecated/RowLeading.swift @@ -8,7 +8,7 @@ import SwiftUI public enum RowLeadingType { case icon(_ name: IconsNames) case iconOnSurface(_ name: IconsNames) - case image(_ image: Image, color: Color? = .onSurfaceHighEmphasis) + case image(_ image: Image, color: Color? = .onSurfacePrimary) case imageOnSurface(_ image: Image, color: Color? = nil) case systemImage(_ imageName: String) case avatar(_ avatar: Avatar) @@ -65,7 +65,7 @@ struct RowLeading: View { case let .systemImage(systemImage): Image(systemName: systemImage) - .foregroundColor(Color.onBackgroundHighEmphasis) + .foregroundColor(Color.onBackgroundPrimary) .font(.system(size: 24)) .frame(width: 24, height: 24, alignment: .center) diff --git a/Sources/OversizeUI/Deprecated/RowTrailing.swift b/Sources/OversizeUI/Deprecated/RowTrailing.swift index 8d1becf..dfc60dc 100644 --- a/Sources/OversizeUI/Deprecated/RowTrailing.swift +++ b/Sources/OversizeUI/Deprecated/RowTrailing.swift @@ -46,7 +46,7 @@ struct RowTrailing: View { case let .radio(isOn: isOn): ZStack { Circle() - .stroke(Color.onSurfaceDisabled, lineWidth: 4) + .stroke(Color.onSurfaceTertiary, lineWidth: 4) .frame(width: 24, height: 24) .cornerRadius(12) .opacity(isOn.wrappedValue ? 0 : 1) @@ -64,7 +64,7 @@ struct RowTrailing: View { case let .checkbox(isOn: isOn): ZStack { RoundedRectangle(cornerRadius: Radius.small, style: .continuous) - .strokeBorder(Color.onSurfaceDisabled, lineWidth: 2.5) + .strokeBorder(Color.onSurfaceTertiary, lineWidth: 2.5) .frame(width: 24, height: 24) .opacity(isOn.wrappedValue ? 0 : 1) @@ -74,7 +74,7 @@ struct RowTrailing: View { Image(systemName: "checkmark") .font(.caption.weight(.black)) - .foregroundColor(.onPrimaryHighEmphasis) + .foregroundColor(.onPrimary) .opacity(isOn.wrappedValue ? 1 : 0) } @@ -84,13 +84,13 @@ struct RowTrailing: View { .labelsHidden() Button(action: action ?? {}, label: { - IconDeprecated(.chevronRight, color: .onSurfaceDisabled) + IconDeprecated(.chevronRight, color: .onSurfaceTertiary) }) } .disabled(isPremiumOption && premiumStatus == false) case .arrowIcon: - IconDeprecated(.chevronRight, color: .onSurfaceDisabled) + IconDeprecated(.chevronRight, color: .onSurfaceTertiary) case let .timePicker(date: date): #if os(watchOS) @@ -102,7 +102,7 @@ struct RowTrailing: View { case let .text(text): Text(text) .subheadline() - .foregroundColor(.onSurfaceMediumEmphasis) + .foregroundColor(.onSurfaceSecondary) case let .button(text, action: action): #if os(tvOS) diff --git a/Sources/OversizeUI/Extensions/Image/Image+Extensions.swift b/Sources/OversizeUI/Extensions/Image/Image+Extensions.swift index f89ef12..524c3b9 100644 --- a/Sources/OversizeUI/Extensions/Image/Image+Extensions.swift +++ b/Sources/OversizeUI/Extensions/Image/Image+Extensions.swift @@ -14,7 +14,7 @@ public extension Image { } public extension Image { - func icon(_ color: Color = Color.onSurfaceHighEmphasis) -> some View { + func icon(_ color: Color = Color.onSurfacePrimary) -> some View { renderingMode(.template) #if os(macOS) .resizable() @@ -28,7 +28,7 @@ public extension Image { } public extension Image { - func icon(_ color: Color = Color.onSurfaceHighEmphasis, size: IconSizes) -> some View { + func icon(_ color: Color = Color.onSurfacePrimary, size: IconSizes) -> some View { renderingMode(.template) .resizable() .frame(