BusinessCard/BusinessCard/Views/Widgets/Components/WidgetSurfaceCard.swift

31 lines
987 B
Swift

import SwiftUI
import Bedrock
struct WidgetSurfaceCard<Content: View>: View {
let content: Content
init(@ViewBuilder content: () -> Content) {
self.content = content()
}
var body: some View {
VStack(alignment: .leading, spacing: Design.Spacing.medium) {
content
}
.padding(Design.Spacing.large)
.frame(maxWidth: .infinity, alignment: .leading)
.background(Color.AppBackground.secondary.opacity(Design.Opacity.almostFull))
.clipShape(.rect(cornerRadius: Design.CornerRadius.large))
.overlay {
RoundedRectangle(cornerRadius: Design.CornerRadius.large)
.strokeBorder(AppBorder.subtle, lineWidth: Design.LineWidth.thin)
}
.shadow(
color: Color.AppText.tertiary.opacity(Design.Opacity.subtle),
radius: Design.Shadow.radiusSmall,
x: Design.Shadow.offsetNone,
y: Design.Shadow.offsetSmall
)
}
}