|
1 | 1 | import SwiftUI |
2 | 2 |
|
3 | | -struct SubSection<Title: View, Description: View, Content: View>: View { |
4 | | - let title: Title |
5 | | - let description: Description |
6 | | - @ViewBuilder let content: () -> Content |
| 3 | +public struct SubSection<Title: View, Description: View, Content: View>: View { |
| 4 | + public let title: Title |
| 5 | + public let description: Description |
| 6 | + @ViewBuilder public let content: () -> Content |
7 | 7 |
|
8 | | - init(title: Title, description: Description, @ViewBuilder content: @escaping () -> Content) { |
| 8 | + public init(title: Title, description: Description, @ViewBuilder content: @escaping () -> Content) { |
9 | 9 | self.title = title |
10 | 10 | self.description = description |
11 | 11 | self.content = content |
12 | 12 | } |
13 | 13 |
|
14 | | - var body: some View { |
| 14 | + public var body: some View { |
15 | 15 | VStack(alignment: .leading) { |
16 | 16 | if !(title is EmptyView && description is EmptyView) { |
17 | 17 | VStack(alignment: .leading, spacing: 8) { |
@@ -43,31 +43,31 @@ struct SubSection<Title: View, Description: View, Content: View>: View { |
43 | 43 | } |
44 | 44 | } |
45 | 45 |
|
46 | | -extension SubSection where Description == Text { |
| 46 | +public extension SubSection where Description == Text { |
47 | 47 | init(title: Title, description: String, @ViewBuilder content: @escaping () -> Content) { |
48 | 48 | self.init(title: title, description: Text(description), content: content) |
49 | 49 | } |
50 | 50 | } |
51 | 51 |
|
52 | | -extension SubSection where Description == EmptyView { |
| 52 | +public extension SubSection where Description == EmptyView { |
53 | 53 | init(title: Title, @ViewBuilder content: @escaping () -> Content) { |
54 | 54 | self.init(title: title, description: EmptyView(), content: content) |
55 | 55 | } |
56 | 56 | } |
57 | 57 |
|
58 | | -extension SubSection where Title == EmptyView { |
| 58 | +public extension SubSection where Title == EmptyView { |
59 | 59 | init(description: Description, @ViewBuilder content: @escaping () -> Content) { |
60 | 60 | self.init(title: EmptyView(), description: description, content: content) |
61 | 61 | } |
62 | 62 | } |
63 | 63 |
|
64 | | -extension SubSection where Title == EmptyView, Description == EmptyView { |
| 64 | +public extension SubSection where Title == EmptyView, Description == EmptyView { |
65 | 65 | init(@ViewBuilder content: @escaping () -> Content) { |
66 | 66 | self.init(title: EmptyView(), description: EmptyView(), content: content) |
67 | 67 | } |
68 | 68 | } |
69 | 69 |
|
70 | | -extension SubSection where Title == EmptyView, Description == Text { |
| 70 | +public extension SubSection where Title == EmptyView, Description == Text { |
71 | 71 | init(description: String, @ViewBuilder content: @escaping () -> Content) { |
72 | 72 | self.init(title: EmptyView(), description: description, content: content) |
73 | 73 | } |
|
0 commit comments