@@ -6,53 +6,63 @@ import SwiftUI
66///
77
88// MARK: Woo Styles
9- struct BodyStyle : ViewModifier {
9+ public struct BodyStyle : ViewModifier {
1010 /// Whether the View being modified is enabled
1111 ///
1212 var isEnabled : Bool
1313
14- func body( content: Content ) -> some View {
14+ public init ( isEnabled: Bool ) {
15+ self . isEnabled = isEnabled
16+ }
17+
18+ public func body( content: Content ) -> some View {
1519 content
1620 . font ( . body)
1721 . foregroundColor ( isEnabled ? Color ( . text) : Color ( . textTertiary) )
1822 }
1923}
2024
2125
22- struct LargeTitleStyle : ViewModifier {
23- func body( content: Content ) -> some View {
26+ public struct LargeTitleStyle : ViewModifier {
27+ public func body( content: Content ) -> some View {
2428 content
2529 . font ( . largeTitle)
2630 . foregroundColor ( Color ( . text) )
2731 }
2832}
2933
30- struct TitleStyle : ViewModifier {
31- func body( content: Content ) -> some View {
34+ public struct TitleStyle : ViewModifier {
35+ public func body( content: Content ) -> some View {
3236 content
3337 . font ( . title)
3438 . foregroundColor ( Color ( . text) )
3539 }
3640}
3741
38- struct SecondaryTitleStyle : ViewModifier {
39- func body( content: Content ) -> some View {
42+ public struct SecondaryTitleStyle : ViewModifier {
43+ public func body( content: Content ) -> some View {
4044 content
4145 . font ( . title2. weight ( . bold) )
4246 . foregroundColor ( Color ( . text) )
4347 }
4448}
4549
46- struct SecondaryBodyStyle : ViewModifier {
47- func body( content: Content ) -> some View {
50+ public struct SecondaryBodyStyle : ViewModifier {
51+
52+ public init ( ) { }
53+
54+ public func body( content: Content ) -> some View {
4855 content
4956 . font ( . body)
5057 . foregroundColor ( Color ( . textSubtle) )
5158 }
5259}
5360
54- struct HeadlineStyle : ViewModifier {
55- func body( content: Content ) -> some View {
61+ public struct HeadlineStyle : ViewModifier {
62+
63+ public init ( ) { }
64+
65+ public func body( content: Content ) -> some View {
5666 content
5767 . font ( . headline)
5868 . foregroundColor ( Color ( . text) )
@@ -67,7 +77,7 @@ struct SubheadlineStyle: ViewModifier {
6777 }
6878}
6979
70- struct FootnoteStyle : ViewModifier {
80+ public struct FootnoteStyle : ViewModifier {
7181 /// Whether the View being modified is enabled
7282 ///
7383 var isEnabled : Bool
@@ -76,7 +86,7 @@ struct FootnoteStyle: ViewModifier {
7686 ///
7787 var isError : Bool
7888
79- func body( content: Content ) -> some View {
89+ public func body( content: Content ) -> some View {
8090 content
8191 . font ( . footnote)
8292 . foregroundColor ( textColor)
@@ -94,47 +104,51 @@ struct FootnoteStyle: ViewModifier {
94104 }
95105}
96106
97- struct ErrorStyle : ViewModifier {
98- func body( content: Content ) -> some View {
107+ public struct ErrorStyle : ViewModifier {
108+ public func body( content: Content ) -> some View {
99109 content
100110 . font ( . body)
101111 . foregroundColor ( Color ( . error) )
102112 }
103113}
104114
105- struct WooNavigationBarStyle : ViewModifier {
106- func body( content: Content ) -> some View {
115+ public struct WooNavigationBarStyle : ViewModifier {
116+ public func body( content: Content ) -> some View {
107117 content
108118 . accentColor ( Color ( . accent) ) // The color of bar button items in the navigation bar
109119 }
110120}
111121
112- struct LinkStyle : ViewModifier {
122+ public struct LinkStyle : ViewModifier {
113123 /// Environment `enabled` state.
114124 ///
115125 @Environment ( \. isEnabled) var isEnabled
116126
117- func body( content: Content ) -> some View {
127+ public init ( ) { }
128+
129+ public func body( content: Content ) -> some View {
118130 content
119131 . font ( . body)
120132 . foregroundColor ( isEnabled ? Color ( . accent) : Color ( . textTertiary) )
121133 }
122134}
123135
124- struct HeadlineLinkStyle : ViewModifier {
136+ public struct HeadlineLinkStyle : ViewModifier {
125137 /// Environment `enabled` state.
126138 ///
127139 @Environment ( \. isEnabled) var isEnabled
128140
129- func body( content: Content ) -> some View {
141+ public init ( ) { }
142+
143+ public func body( content: Content ) -> some View {
130144 content
131145 . font ( . headline)
132146 . foregroundColor ( isEnabled ? Color ( . accent) : Color ( . textTertiary) )
133147 }
134148}
135149
136150// MARK: View extensions
137- extension View {
151+ public extension View {
138152 /// - Parameters:
139153 /// - isEnabled: Whether the view is enabled (to apply specific styles for disabled view)
140154 func bodyStyle( _ isEnabled: Bool = true ) -> some View {
0 commit comments