forked from github/CopilotForXcode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCardGroupBoxStyle.swift
More file actions
30 lines (29 loc) · 1012 Bytes
/
CardGroupBoxStyle.swift
File metadata and controls
30 lines (29 loc) · 1012 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import SwiftUI
import SharedUIComponents
public struct CardGroupBoxStyle: GroupBoxStyle {
public var backgroundColor: Color
public var borderColor: Color
public init(
backgroundColor: Color = QuaternarySystemFillColor.opacity(0.75),
borderColor: Color = SecondarySystemFillColor
) {
self.backgroundColor = backgroundColor
self.borderColor = borderColor
}
public func makeBody(configuration: Configuration) -> some View {
VStack(alignment: .leading, spacing: 11) {
configuration.label.foregroundColor(.primary)
configuration.content.foregroundColor(.primary)
}
.padding(.vertical, 12)
.padding(.horizontal, 20)
.frame(maxWidth: .infinity, alignment: .topLeading)
.background(backgroundColor)
.cornerRadius(12)
.overlay(
RoundedRectangle(cornerRadius: 12)
.inset(by: 0.5)
.stroke(borderColor, lineWidth: 1)
)
}
}