Skip to content

Commit 6ab96d0

Browse files
committed
foregroundColor -> foregroundStyle/fill
1 parent 0235919 commit 6ab96d0

23 files changed

+49
-50
lines changed

Diff for: Sources/SWDesignSystem/Internal/BadgeView.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ struct BadgeView: View {
55

66
var body: some View {
77
Image(systemName: "\(value).circle.fill")
8-
.foregroundColor(.swAccent)
8+
.foregroundStyle(Color.swAccent)
99
}
1010
}
1111

Diff for: Sources/SWDesignSystem/Internal/CardBackgroundModifier.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ struct CardBackgroundModifier: ViewModifier {
1111
.padding(padding)
1212
.background {
1313
RoundedRectangle(cornerRadius: 12, style: .continuous)
14-
.foregroundColor(.swCardBackground)
14+
.fill(Color.swCardBackground)
1515
.withShadow()
1616
}
1717
}

Diff for: Sources/SWDesignSystem/Internal/RoundedCornerShape.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ struct RoundedCornerShape: Shape {
1818
#if DEBUG
1919
#Preview {
2020
Rectangle()
21-
.foregroundColor(.blue)
21+
.fill(.blue)
2222
.clipShape(RoundedCornerShape(radius: 20, corners: .bottomLeft))
2323
}
2424
#endif

Diff for: Sources/SWDesignSystem/Internal/SectionHeaderView.swift

+5-4
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ struct SectionSupplementaryView: View {
1717
var body: some View {
1818
Text(text)
1919
.textCase(mode.textCase)
20-
.foregroundColor(.swSmallElements)
20+
.foregroundStyle(Color.swSmallElements)
2121
.font(.footnote)
2222
.frame(maxWidth: .infinity, alignment: .leading)
2323
.padding(.leading, mode.hasLeftPadding ? 12 : 0)
@@ -62,12 +62,13 @@ extension SectionSupplementaryView {
6262
ForEach(headers, id: \.self) { text in
6363
SectionSupplementaryView(.init(text), mode: .header(hasLeftPadding: true))
6464
RoundedRectangle(cornerRadius: 12)
65-
.foregroundColor(.gray.opacity(0.3))
65+
.fill(.gray.opacity(0.3))
6666
SectionSupplementaryView(.init(text), mode: .footer)
67+
Spacer().frame(height: 16)
6768
SectionSupplementaryView(.init(text), mode: .header(hasLeftPadding: false))
6869
RoundedRectangle(cornerRadius: 12)
69-
.foregroundColor(.black.opacity(0.3))
70-
Spacer().frame(height: 50)
70+
.fill(.black.opacity(0.3))
71+
Spacer().frame(height: 16)
7172
}
7273
}
7374
.padding()

Diff for: Sources/SWDesignSystem/Internal/ShadowIfNeededModifier.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ struct ShadowIfNeededModifier: ViewModifier {
2020
.padding()
2121
.background {
2222
RoundedRectangle(cornerRadius: 12)
23+
.fill(Color.swCardBackground)
2324
.frame(height: 50)
24-
.foregroundColor(.swCardBackground)
2525
.withShadow()
2626
}
2727
}

Diff for: Sources/SWDesignSystem/Public/ChevronView.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ public struct ChevronView: View {
88
Image(systemName: Icons.Regular.chevron.rawValue)
99
.resizable()
1010
.frame(width: 7, height: 12)
11-
.foregroundColor(.swSmallElements)
11+
.foregroundStyle(Color.swSmallElements)
1212
}
1313
}
1414

Diff for: Sources/SWDesignSystem/Public/Color+.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public extension Color {
5252
Circle()
5353
.environment(\.colorScheme, .dark)
5454
}
55-
.foregroundColor(color)
55+
.foregroundStyle(color)
5656
.frame(width: 50, height: 50)
5757
}
5858
}

Diff for: Sources/SWDesignSystem/Public/ContentInSheet.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ private extension ContentInSheet {
3131
Text(title)
3232
.lineLimit(1)
3333
.font(.headline)
34-
.foregroundColor(.swMainText)
34+
.foregroundStyle(Color.swMainText)
3535
.frame(maxWidth: .infinity)
3636
.padding(.horizontal, 50)
3737
.overlay(alignment: .trailing) {

Diff for: Sources/SWDesignSystem/Public/ProfileView.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public struct ProfileView: View {
3535
Text(login)
3636
.lineLimit(2)
3737
.multilineTextAlignment(.center)
38-
.foregroundColor(.swMainText)
38+
.foregroundStyle(Color.swMainText)
3939
.font(.system(size: 22, weight: .bold))
4040
VStack(alignment: .leading, spacing: 6) {
4141
HStack(spacing: 8) {
@@ -50,7 +50,7 @@ public struct ProfileView: View {
5050
.lineLimit(2)
5151
}
5252
}
53-
.foregroundColor(.swSmallElements)
53+
.foregroundStyle(Color.swSmallElements)
5454
}
5555
}
5656
}

Diff for: Sources/SWDesignSystem/Public/Rows/ChatBubbleRowView.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,17 @@ public struct ChatBubbleRowView: View {
2121
spacing: 6
2222
) {
2323
Text(message)
24-
.foregroundColor(messageType.messageColor)
24+
.foregroundStyle(messageType.messageColor)
2525
.padding(.vertical, 12)
2626
.padding(.horizontal, 18)
2727
.background {
2828
Rectangle()
29+
.fill(messageType.bubbleColor)
2930
.clipShape(RoundedCornerShape(radius: 20, corners: corners))
30-
.foregroundColor(messageType.bubbleColor)
3131
}
3232
Text(messageTime)
3333
.font(.caption2)
34-
.foregroundColor(.swSmallElements)
34+
.foregroundStyle(Color.swSmallElements)
3535
}
3636
.textSelection(.enabled)
3737
.padding(messageType == .sent ? .leading : .trailing, 50)

Diff for: Sources/SWDesignSystem/Public/Rows/CheckmarkRowView.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ public struct TextWithCheckmarkRowView: View {
1313
HStack(spacing: 10) {
1414
Text(.init(text))
1515
.lineLimit(1)
16-
.foregroundColor(.swMainText)
16+
.foregroundStyle(Color.swMainText)
1717
.frame(maxWidth: .infinity, alignment: .leading)
1818
if isChecked {
1919
Icons.Regular.checkmark.view
20-
.foregroundColor(.swAccent)
20+
.foregroundStyle(Color.swAccent)
2121
}
2222
}
2323
.padding(12)

Diff for: Sources/SWDesignSystem/Public/Rows/CommentRowView.swift

+4-4
Original file line numberDiff line numberDiff line change
@@ -78,27 +78,27 @@ private extension CommentRowView {
7878
} label: {
7979
Image(systemName: Icons.Regular.ellipsis.rawValue)
8080
.frame(width: 30, height: 30, alignment: .topTrailing)
81-
.foregroundColor(.swSmallElements)
81+
.foregroundStyle(Color.swSmallElements)
8282
}
8383
.onTapGesture { hapticFeedback(.rigid) }
8484
}
8585

8686
var userNameView: some View {
8787
Text(userName)
88-
.foregroundColor(.swMainText)
88+
.foregroundStyle(Color.swMainText)
8989
.font(.headline)
9090
}
9191

9292
var dateTextView: some View {
9393
Text(dateText)
94-
.foregroundColor(.swSmallElements)
94+
.foregroundStyle(Color.swSmallElements)
9595
.font(.caption2)
9696
}
9797

9898
var bodyTextView: some View {
9999
Text(.init(bodyText))
100100
.fixedSize(horizontal: false, vertical: true)
101-
.foregroundColor(.swMainText)
101+
.foregroundStyle(Color.swMainText)
102102
.tint(.swAccent)
103103
.textSelection(.enabled)
104104
.multilineTextAlignment(.leading)

Diff for: Sources/SWDesignSystem/Public/Rows/DialogRowView.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -63,21 +63,21 @@ private extension DialogRowView {
6363

6464
var authorNameView: some View {
6565
Text(model.authorName)
66-
.foregroundColor(.swMainText)
66+
.foregroundStyle(Color.swMainText)
6767
.font(.headline)
6868
.frame(maxWidth: .infinity, alignment: .leading)
6969
}
7070

7171
var dateTextView: some View {
7272
Text(model.dateText)
73-
.foregroundColor(.swSmallElements)
73+
.foregroundStyle(Color.swSmallElements)
7474
.font(.footnote.weight(.medium))
7575
}
7676

7777
var messageView: some View {
7878
Text(model.messageText)
7979
.font(.subheadline)
80-
.foregroundColor(.swSmallElements)
80+
.foregroundStyle(Color.swSmallElements)
8181
.frame(maxWidth: .infinity, alignment: .leading)
8282
}
8383
}

Diff for: Sources/SWDesignSystem/Public/Rows/EventRowView.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ private extension EventRowView {
4141

4242
var eventTitle: some View {
4343
Text(title)
44-
.foregroundColor(.swMainText)
44+
.foregroundStyle(Color.swMainText)
4545
.font(.headline)
4646
.lineLimit(2)
4747
.multilineTextAlignment(.leading)
@@ -64,7 +64,7 @@ private extension EventRowView {
6464
HStack(spacing: 6) {
6565
SystemImageWithFrame(Icons.Regular.location.rawValue)
6666
Text(locationText)
67-
.foregroundColor(.swSmallElements)
67+
.foregroundStyle(Color.swSmallElements)
6868
.font(.subheadline)
6969
.lineLimit(1)
7070
}

Diff for: Sources/SWDesignSystem/Public/Rows/FormRowView.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public struct FormRowView: View {
2222
HStack(spacing: 12) {
2323
Text(.init(title))
2424
.font(.headline)
25-
.foregroundColor(.swMainText)
25+
.foregroundStyle(Color.swMainText)
2626
.fixedSize()
2727
.frame(maxWidth: .infinity, alignment: .leading)
2828
trailingContent.makeView(isEnabled: isEnabled)
@@ -66,7 +66,7 @@ public extension FormRowView {
6666
private func trailingTextView(_ text: String) -> some View {
6767
Text(text)
6868
.font(.subheadline)
69-
.foregroundColor(.swSmallElements)
69+
.foregroundStyle(Color.swSmallElements)
7070
}
7171
}
7272
}

Diff for: Sources/SWDesignSystem/Public/Rows/JournalRowView.swift

+4-4
Original file line numberDiff line numberDiff line change
@@ -109,20 +109,20 @@ private extension JournalRowView {
109109

110110
var titleView: some View {
111111
Text(model.title)
112-
.foregroundColor(.swMainText)
112+
.foregroundStyle(Color.swMainText)
113113
.font(.headline)
114114
}
115115

116116
var dateTextView: some View {
117117
Text(model.dateText)
118-
.foregroundColor(.swSmallElements)
118+
.foregroundStyle(Color.swSmallElements)
119119
.font(.footnote.weight(.medium))
120120
}
121121

122122
var bodyTextView: some View {
123123
Text(.init(model.bodyText))
124124
.font(.subheadline)
125-
.foregroundColor(.swMainText)
125+
.foregroundStyle(Color.swMainText)
126126
.tint(.swAccent)
127127
.textSelection(.enabled)
128128
.multilineTextAlignment(.leading)
@@ -141,7 +141,7 @@ private extension JournalRowView {
141141
} label: {
142142
Image(systemName: Icons.Regular.ellipsis.rawValue)
143143
.frame(width: 30, height: 30, alignment: .topTrailing)
144-
.foregroundColor(.swSmallElements)
144+
.foregroundStyle(Color.swSmallElements)
145145
}
146146
.onTapGesture { hapticFeedback(.rigid) }
147147
}

Diff for: Sources/SWDesignSystem/Public/Rows/ListRowView.swift

+4-4
Original file line numberDiff line numberDiff line change
@@ -52,16 +52,16 @@ public extension ListRowView {
5252

5353
public static func makeIconView(with name: Icons.Regular) -> some View {
5454
RoundedRectangle(cornerRadius: 8, style: .continuous)
55+
.fill(Color.swTintedButton)
5556
.frame(width: 34, height: 34)
56-
.foregroundColor(.swTintedButton)
5757
.overlay {
5858
Image(systemName: name.rawValue)
59-
.foregroundColor(.swAccent)
59+
.foregroundStyle(Color.swAccent)
6060
}
6161
}
6262

6363
private func makeTextView(with text: LocalizedStringKey) -> some View {
64-
Text(text).foregroundColor(.swMainText)
64+
Text(text).foregroundStyle(Color.swMainText)
6565
}
6666
}
6767

@@ -94,7 +94,7 @@ public extension ListRowView {
9494
}
9595

9696
private func makeTextView(with text: LocalizedStringKey) -> some View {
97-
Text(text).foregroundColor(.swSmallElements)
97+
Text(text).foregroundStyle(Color.swSmallElements)
9898
}
9999
}
100100
}

Diff for: Sources/SWDesignSystem/Public/Rows/ParkRowView.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ private extension ParkRowView {
4242

4343
var parkTitle: some View {
4444
Text(title)
45-
.foregroundColor(.swMainText)
45+
.foregroundStyle(Color.swMainText)
4646
.font(.headline)
4747
.lineLimit(2)
4848
.multilineTextAlignment(.leading)
@@ -67,7 +67,7 @@ private extension ParkRowView {
6767

6868
func makeSubtitleView(with text: String) -> some View {
6969
Text(text)
70-
.foregroundColor(.swSmallElements)
70+
.foregroundStyle(Color.swSmallElements)
7171
.font(.subheadline)
7272
.lineLimit(2)
7373
.multilineTextAlignment(.leading)

Diff for: Sources/SWDesignSystem/Public/Rows/UserRowView.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ private extension UserRowView {
110110

111111
var userNameView: some View {
112112
Text(baseModel.name)
113-
.foregroundColor(.swMainText)
113+
.foregroundStyle(Color.swMainText)
114114
.font(.headline)
115115
}
116116

@@ -122,7 +122,7 @@ private extension UserRowView {
122122
var addressViewIfAvailable: some View {
123123
if !baseModel.address.isEmpty {
124124
Text(baseModel.address)
125-
.foregroundColor(.swSmallElements)
125+
.foregroundStyle(Color.swSmallElements)
126126
.font(.subheadline)
127127
}
128128
}

Diff for: Sources/SWDesignSystem/Public/SWButtonStyle.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ public struct SWButtonStyle: ButtonStyle {
3333
.lineLimit(1)
3434
.font(.headline)
3535
}
36-
.foregroundColor(foregroundColor)
36+
.foregroundStyle(foregroundColor)
3737
.padding(.vertical, size.verticalPadding)
3838
.padding(.horizontal, size.horizontalPadding)
3939
.frame(maxWidth: maxWidth)
4040
.background {
4141
RoundedRectangle(cornerRadius: 12, style: .continuous)
42-
.foregroundColor(backgroundColor(configuration.isPressed))
42+
.fill(backgroundColor(configuration.isPressed))
4343
}
4444
.scaleEffect(configuration.isPressed ? 0.98 : 1)
4545
.animation(.easeIn(duration: 0.1), value: configuration.isPressed)

Diff for: Sources/SWDesignSystem/Public/SWTextEditor.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public struct SWTextEditor: View {
4040
.overlay(alignment: .topLeading) {
4141
if let placeholder {
4242
Text(.init(placeholder))
43-
.foregroundColor(.swSeparators)
43+
.foregroundStyle(Color.swSeparators)
4444
.multilineTextAlignment(.leading)
4545
.opacity(text.isEmpty ? 1 : 0)
4646
.padding(.top, 10)

Diff for: Sources/SWDesignSystem/Public/SWTextField.swift

+3-5
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public struct SWTextField: View {
3232
public var body: some View {
3333
VStack(alignment: .leading, spacing: 6) {
3434
textFieldView
35-
.foregroundColor(.swMainText)
35+
.foregroundStyle(Color.swMainText)
3636
.padding(12)
3737
.background {
3838
RoundedRectangle(cornerRadius: 8)
@@ -85,14 +85,12 @@ private extension SWTextField {
8585
Text(.init(message))
8686
.font(.subheadline)
8787
.multilineTextAlignment(.leading)
88-
.foregroundColor(.swError)
88+
.foregroundStyle(Color.swError)
8989
}
9090
}
9191

9292
var borderColor: Color {
93-
guard errorState == nil else {
94-
return .swError
95-
}
93+
guard errorState == nil else { return .swError }
9694
return isFocused ? .swAccent : .swSeparators
9795
}
9896
}

Diff for: Sources/SWDesignSystem/Public/SendChatMessageButton.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ public struct SendChatMessageButton: View {
1212
public var body: some View {
1313
Button(action: action) {
1414
Circle()
15+
.fill(isEnabled ? Color.swAccent : Color.swDisabledButton)
1516
.frame(width: 39, height: 39)
16-
.foregroundColor(isEnabled ? .swAccent : .swDisabledButton)
1717
.overlay {
1818
Icons.Regular.arrowUp.view
1919
.foregroundStyle(Color.swBackground)

0 commit comments

Comments
 (0)