Files
OSGKeyboard/OSGKeyboardShared/DesignSystem/UsageSurfaceCard.swift
T
Rocky d656bac8c3 feat: add streaming cloud ASR, polish routing, and settings card layout
Unify Bailian/Volcengine/OpenAI realtime streaming, ABE polish routing with
fun styles, and a shared card-page Settings hierarchy; bump to 1.1 (build 32).
2026-07-28 20:25:17 +08:00

38 lines
1.1 KiB
Swift

// UsageSurfaceCard.swift
// OSGKeyboard · Shared
//
// Flat semantic surface used by home / dashboard stats on every platform.
// Deliberately shadowless — hierarchy comes from fill + hairline border.
import SwiftUI
public struct UsageSurfaceCard<Content: View>: View {
@Environment(\.themePalette) private var palette
public var padding: CGFloat
public var cornerRadius: CGFloat
@ViewBuilder public var content: () -> Content
public init(
padding: CGFloat = Spacing.md,
cornerRadius: CGFloat = Radius.xl,
@ViewBuilder content: @escaping () -> Content
) {
self.padding = padding
self.cornerRadius = cornerRadius
self.content = content
}
public var body: some View {
let shape = RoundedRectangle(cornerRadius: cornerRadius, style: .continuous)
content()
.padding(padding)
.background(palette.surface, in: shape)
.clipShape(shape)
.overlay(
shape.stroke(palette.divider, lineWidth: 0.5)
)
}
}