File tree 23 files changed +49
-50
lines changed
23 files changed +49
-50
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ struct BadgeView: View {
5
5
6
6
var body : some View {
7
7
Image ( systemName: " \( value) .circle.fill " )
8
- . foregroundColor ( . swAccent)
8
+ . foregroundStyle ( Color . swAccent)
9
9
}
10
10
}
11
11
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ struct CardBackgroundModifier: ViewModifier {
11
11
. padding ( padding)
12
12
. background {
13
13
RoundedRectangle ( cornerRadius: 12 , style: . continuous)
14
- . foregroundColor ( . swCardBackground)
14
+ . fill ( Color . swCardBackground)
15
15
. withShadow ( )
16
16
}
17
17
}
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ struct RoundedCornerShape: Shape {
18
18
#if DEBUG
19
19
#Preview {
20
20
Rectangle ( )
21
- . foregroundColor ( . blue)
21
+ . fill ( . blue)
22
22
. clipShape ( RoundedCornerShape ( radius: 20 , corners: . bottomLeft) )
23
23
}
24
24
#endif
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ struct SectionSupplementaryView: View {
17
17
var body : some View {
18
18
Text ( text)
19
19
. textCase ( mode. textCase)
20
- . foregroundColor ( . swSmallElements)
20
+ . foregroundStyle ( Color . swSmallElements)
21
21
. font ( . footnote)
22
22
. frame ( maxWidth: . infinity, alignment: . leading)
23
23
. padding ( . leading, mode. hasLeftPadding ? 12 : 0 )
@@ -62,12 +62,13 @@ extension SectionSupplementaryView {
62
62
ForEach ( headers, id: \. self) { text in
63
63
SectionSupplementaryView ( . init( text) , mode: . header( hasLeftPadding: true ) )
64
64
RoundedRectangle ( cornerRadius: 12 )
65
- . foregroundColor ( . gray. opacity ( 0.3 ) )
65
+ . fill ( . gray. opacity ( 0.3 ) )
66
66
SectionSupplementaryView ( . init( text) , mode: . footer)
67
+ Spacer ( ) . frame ( height: 16 )
67
68
SectionSupplementaryView ( . init( text) , mode: . header( hasLeftPadding: false ) )
68
69
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 )
71
72
}
72
73
}
73
74
. padding ( )
Original file line number Diff line number Diff line change @@ -20,8 +20,8 @@ struct ShadowIfNeededModifier: ViewModifier {
20
20
. padding ( )
21
21
. background {
22
22
RoundedRectangle ( cornerRadius: 12 )
23
+ . fill ( Color . swCardBackground)
23
24
. frame ( height: 50 )
24
- . foregroundColor ( . swCardBackground)
25
25
. withShadow ( )
26
26
}
27
27
}
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ public struct ChevronView: View {
8
8
Image ( systemName: Icons . Regular. chevron. rawValue)
9
9
. resizable ( )
10
10
. frame ( width: 7 , height: 12 )
11
- . foregroundColor ( . swSmallElements)
11
+ . foregroundStyle ( Color . swSmallElements)
12
12
}
13
13
}
14
14
Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ public extension Color {
52
52
Circle ( )
53
53
. environment ( \. colorScheme, . dark)
54
54
}
55
- . foregroundColor ( color)
55
+ . foregroundStyle ( color)
56
56
. frame ( width: 50 , height: 50 )
57
57
}
58
58
}
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ private extension ContentInSheet {
31
31
Text ( title)
32
32
. lineLimit ( 1 )
33
33
. font ( . headline)
34
- . foregroundColor ( . swMainText)
34
+ . foregroundStyle ( Color . swMainText)
35
35
. frame ( maxWidth: . infinity)
36
36
. padding ( . horizontal, 50 )
37
37
. overlay ( alignment: . trailing) {
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ public struct ProfileView: View {
35
35
Text ( login)
36
36
. lineLimit ( 2 )
37
37
. multilineTextAlignment ( . center)
38
- . foregroundColor ( . swMainText)
38
+ . foregroundStyle ( Color . swMainText)
39
39
. font ( . system( size: 22 , weight: . bold) )
40
40
VStack ( alignment: . leading, spacing: 6 ) {
41
41
HStack ( spacing: 8 ) {
@@ -50,7 +50,7 @@ public struct ProfileView: View {
50
50
. lineLimit ( 2 )
51
51
}
52
52
}
53
- . foregroundColor ( . swSmallElements)
53
+ . foregroundStyle ( Color . swSmallElements)
54
54
}
55
55
}
56
56
}
Original file line number Diff line number Diff line change @@ -21,17 +21,17 @@ public struct ChatBubbleRowView: View {
21
21
spacing: 6
22
22
) {
23
23
Text ( message)
24
- . foregroundColor ( messageType. messageColor)
24
+ . foregroundStyle ( messageType. messageColor)
25
25
. padding ( . vertical, 12 )
26
26
. padding ( . horizontal, 18 )
27
27
. background {
28
28
Rectangle ( )
29
+ . fill ( messageType. bubbleColor)
29
30
. clipShape ( RoundedCornerShape ( radius: 20 , corners: corners) )
30
- . foregroundColor ( messageType. bubbleColor)
31
31
}
32
32
Text ( messageTime)
33
33
. font ( . caption2)
34
- . foregroundColor ( . swSmallElements)
34
+ . foregroundStyle ( Color . swSmallElements)
35
35
}
36
36
. textSelection ( . enabled)
37
37
. padding ( messageType == . sent ? . leading : . trailing, 50 )
Original file line number Diff line number Diff line change @@ -13,11 +13,11 @@ public struct TextWithCheckmarkRowView: View {
13
13
HStack ( spacing: 10 ) {
14
14
Text ( . init( text) )
15
15
. lineLimit ( 1 )
16
- . foregroundColor ( . swMainText)
16
+ . foregroundStyle ( Color . swMainText)
17
17
. frame ( maxWidth: . infinity, alignment: . leading)
18
18
if isChecked {
19
19
Icons . Regular. checkmark. view
20
- . foregroundColor ( . swAccent)
20
+ . foregroundStyle ( Color . swAccent)
21
21
}
22
22
}
23
23
. padding ( 12 )
Original file line number Diff line number Diff line change @@ -78,27 +78,27 @@ private extension CommentRowView {
78
78
} label: {
79
79
Image ( systemName: Icons . Regular. ellipsis. rawValue)
80
80
. frame ( width: 30 , height: 30 , alignment: . topTrailing)
81
- . foregroundColor ( . swSmallElements)
81
+ . foregroundStyle ( Color . swSmallElements)
82
82
}
83
83
. onTapGesture { hapticFeedback ( . rigid) }
84
84
}
85
85
86
86
var userNameView : some View {
87
87
Text ( userName)
88
- . foregroundColor ( . swMainText)
88
+ . foregroundStyle ( Color . swMainText)
89
89
. font ( . headline)
90
90
}
91
91
92
92
var dateTextView : some View {
93
93
Text ( dateText)
94
- . foregroundColor ( . swSmallElements)
94
+ . foregroundStyle ( Color . swSmallElements)
95
95
. font ( . caption2)
96
96
}
97
97
98
98
var bodyTextView : some View {
99
99
Text ( . init( bodyText) )
100
100
. fixedSize ( horizontal: false , vertical: true )
101
- . foregroundColor ( . swMainText)
101
+ . foregroundStyle ( Color . swMainText)
102
102
. tint ( . swAccent)
103
103
. textSelection ( . enabled)
104
104
. multilineTextAlignment ( . leading)
Original file line number Diff line number Diff line change @@ -63,21 +63,21 @@ private extension DialogRowView {
63
63
64
64
var authorNameView : some View {
65
65
Text ( model. authorName)
66
- . foregroundColor ( . swMainText)
66
+ . foregroundStyle ( Color . swMainText)
67
67
. font ( . headline)
68
68
. frame ( maxWidth: . infinity, alignment: . leading)
69
69
}
70
70
71
71
var dateTextView : some View {
72
72
Text ( model. dateText)
73
- . foregroundColor ( . swSmallElements)
73
+ . foregroundStyle ( Color . swSmallElements)
74
74
. font ( . footnote. weight ( . medium) )
75
75
}
76
76
77
77
var messageView : some View {
78
78
Text ( model. messageText)
79
79
. font ( . subheadline)
80
- . foregroundColor ( . swSmallElements)
80
+ . foregroundStyle ( Color . swSmallElements)
81
81
. frame ( maxWidth: . infinity, alignment: . leading)
82
82
}
83
83
}
Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ private extension EventRowView {
41
41
42
42
var eventTitle : some View {
43
43
Text ( title)
44
- . foregroundColor ( . swMainText)
44
+ . foregroundStyle ( Color . swMainText)
45
45
. font ( . headline)
46
46
. lineLimit ( 2 )
47
47
. multilineTextAlignment ( . leading)
@@ -64,7 +64,7 @@ private extension EventRowView {
64
64
HStack ( spacing: 6 ) {
65
65
SystemImageWithFrame ( Icons . Regular. location. rawValue)
66
66
Text ( locationText)
67
- . foregroundColor ( . swSmallElements)
67
+ . foregroundStyle ( Color . swSmallElements)
68
68
. font ( . subheadline)
69
69
. lineLimit ( 1 )
70
70
}
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ public struct FormRowView: View {
22
22
HStack ( spacing: 12 ) {
23
23
Text ( . init( title) )
24
24
. font ( . headline)
25
- . foregroundColor ( . swMainText)
25
+ . foregroundStyle ( Color . swMainText)
26
26
. fixedSize ( )
27
27
. frame ( maxWidth: . infinity, alignment: . leading)
28
28
trailingContent. makeView ( isEnabled: isEnabled)
@@ -66,7 +66,7 @@ public extension FormRowView {
66
66
private func trailingTextView( _ text: String ) -> some View {
67
67
Text ( text)
68
68
. font ( . subheadline)
69
- . foregroundColor ( . swSmallElements)
69
+ . foregroundStyle ( Color . swSmallElements)
70
70
}
71
71
}
72
72
}
Original file line number Diff line number Diff line change @@ -109,20 +109,20 @@ private extension JournalRowView {
109
109
110
110
var titleView : some View {
111
111
Text ( model. title)
112
- . foregroundColor ( . swMainText)
112
+ . foregroundStyle ( Color . swMainText)
113
113
. font ( . headline)
114
114
}
115
115
116
116
var dateTextView : some View {
117
117
Text ( model. dateText)
118
- . foregroundColor ( . swSmallElements)
118
+ . foregroundStyle ( Color . swSmallElements)
119
119
. font ( . footnote. weight ( . medium) )
120
120
}
121
121
122
122
var bodyTextView : some View {
123
123
Text ( . init( model. bodyText) )
124
124
. font ( . subheadline)
125
- . foregroundColor ( . swMainText)
125
+ . foregroundStyle ( Color . swMainText)
126
126
. tint ( . swAccent)
127
127
. textSelection ( . enabled)
128
128
. multilineTextAlignment ( . leading)
@@ -141,7 +141,7 @@ private extension JournalRowView {
141
141
} label: {
142
142
Image ( systemName: Icons . Regular. ellipsis. rawValue)
143
143
. frame ( width: 30 , height: 30 , alignment: . topTrailing)
144
- . foregroundColor ( . swSmallElements)
144
+ . foregroundStyle ( Color . swSmallElements)
145
145
}
146
146
. onTapGesture { hapticFeedback ( . rigid) }
147
147
}
Original file line number Diff line number Diff line change @@ -52,16 +52,16 @@ public extension ListRowView {
52
52
53
53
public static func makeIconView( with name: Icons . Regular ) -> some View {
54
54
RoundedRectangle ( cornerRadius: 8 , style: . continuous)
55
+ . fill ( Color . swTintedButton)
55
56
. frame ( width: 34 , height: 34 )
56
- . foregroundColor ( . swTintedButton)
57
57
. overlay {
58
58
Image ( systemName: name. rawValue)
59
- . foregroundColor ( . swAccent)
59
+ . foregroundStyle ( Color . swAccent)
60
60
}
61
61
}
62
62
63
63
private func makeTextView( with text: LocalizedStringKey ) -> some View {
64
- Text ( text) . foregroundColor ( . swMainText)
64
+ Text ( text) . foregroundStyle ( Color . swMainText)
65
65
}
66
66
}
67
67
@@ -94,7 +94,7 @@ public extension ListRowView {
94
94
}
95
95
96
96
private func makeTextView( with text: LocalizedStringKey ) -> some View {
97
- Text ( text) . foregroundColor ( . swSmallElements)
97
+ Text ( text) . foregroundStyle ( Color . swSmallElements)
98
98
}
99
99
}
100
100
}
Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ private extension ParkRowView {
42
42
43
43
var parkTitle : some View {
44
44
Text ( title)
45
- . foregroundColor ( . swMainText)
45
+ . foregroundStyle ( Color . swMainText)
46
46
. font ( . headline)
47
47
. lineLimit ( 2 )
48
48
. multilineTextAlignment ( . leading)
@@ -67,7 +67,7 @@ private extension ParkRowView {
67
67
68
68
func makeSubtitleView( with text: String ) -> some View {
69
69
Text ( text)
70
- . foregroundColor ( . swSmallElements)
70
+ . foregroundStyle ( Color . swSmallElements)
71
71
. font ( . subheadline)
72
72
. lineLimit ( 2 )
73
73
. multilineTextAlignment ( . leading)
Original file line number Diff line number Diff line change @@ -110,7 +110,7 @@ private extension UserRowView {
110
110
111
111
var userNameView : some View {
112
112
Text ( baseModel. name)
113
- . foregroundColor ( . swMainText)
113
+ . foregroundStyle ( Color . swMainText)
114
114
. font ( . headline)
115
115
}
116
116
@@ -122,7 +122,7 @@ private extension UserRowView {
122
122
var addressViewIfAvailable : some View {
123
123
if !baseModel. address. isEmpty {
124
124
Text ( baseModel. address)
125
- . foregroundColor ( . swSmallElements)
125
+ . foregroundStyle ( Color . swSmallElements)
126
126
. font ( . subheadline)
127
127
}
128
128
}
Original file line number Diff line number Diff line change @@ -33,13 +33,13 @@ public struct SWButtonStyle: ButtonStyle {
33
33
. lineLimit ( 1 )
34
34
. font ( . headline)
35
35
}
36
- . foregroundColor ( foregroundColor)
36
+ . foregroundStyle ( foregroundColor)
37
37
. padding ( . vertical, size. verticalPadding)
38
38
. padding ( . horizontal, size. horizontalPadding)
39
39
. frame ( maxWidth: maxWidth)
40
40
. background {
41
41
RoundedRectangle ( cornerRadius: 12 , style: . continuous)
42
- . foregroundColor ( backgroundColor ( configuration. isPressed) )
42
+ . fill ( backgroundColor ( configuration. isPressed) )
43
43
}
44
44
. scaleEffect ( configuration. isPressed ? 0.98 : 1 )
45
45
. animation ( . easeIn( duration: 0.1 ) , value: configuration. isPressed)
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ public struct SWTextEditor: View {
40
40
. overlay ( alignment: . topLeading) {
41
41
if let placeholder {
42
42
Text ( . init( placeholder) )
43
- . foregroundColor ( . swSeparators)
43
+ . foregroundStyle ( Color . swSeparators)
44
44
. multilineTextAlignment ( . leading)
45
45
. opacity ( text. isEmpty ? 1 : 0 )
46
46
. padding ( . top, 10 )
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ public struct SWTextField: View {
32
32
public var body : some View {
33
33
VStack ( alignment: . leading, spacing: 6 ) {
34
34
textFieldView
35
- . foregroundColor ( . swMainText)
35
+ . foregroundStyle ( Color . swMainText)
36
36
. padding ( 12 )
37
37
. background {
38
38
RoundedRectangle ( cornerRadius: 8 )
@@ -85,14 +85,12 @@ private extension SWTextField {
85
85
Text ( . init( message) )
86
86
. font ( . subheadline)
87
87
. multilineTextAlignment ( . leading)
88
- . foregroundColor ( . swError)
88
+ . foregroundStyle ( Color . swError)
89
89
}
90
90
}
91
91
92
92
var borderColor : Color {
93
- guard errorState == nil else {
94
- return . swError
95
- }
93
+ guard errorState == nil else { return . swError }
96
94
return isFocused ? . swAccent : . swSeparators
97
95
}
98
96
}
Original file line number Diff line number Diff line change @@ -12,8 +12,8 @@ public struct SendChatMessageButton: View {
12
12
public var body : some View {
13
13
Button ( action: action) {
14
14
Circle ( )
15
+ . fill ( isEnabled ? Color . swAccent : Color . swDisabledButton)
15
16
. frame ( width: 39 , height: 39 )
16
- . foregroundColor ( isEnabled ? . swAccent : . swDisabledButton)
17
17
. overlay {
18
18
Icons . Regular. arrowUp. view
19
19
. foregroundStyle ( Color . swBackground)
You can’t perform that action at this time.
0 commit comments