Some checks failed
CI / test (push) Has been cancelled
Bring the SwiftUI app in line with the Apple-native mock and keep pending approvals actionable from Live Activities and watch complications.
40 lines
971 B
Swift
40 lines
971 B
Swift
import SwiftUI
|
|
|
|
public extension View {
|
|
@ViewBuilder
|
|
func idpGlassChrome() -> some View {
|
|
if #available(iOS 26, macOS 26, *) {
|
|
self.glassEffect(.regular)
|
|
} else {
|
|
self.background(.regularMaterial)
|
|
}
|
|
}
|
|
}
|
|
|
|
struct IdPGlassCapsule<Content: View>: View {
|
|
let padding: EdgeInsets
|
|
let content: Content
|
|
|
|
init(
|
|
padding: EdgeInsets = EdgeInsets(top: 12, leading: 16, bottom: 12, trailing: 16),
|
|
@ViewBuilder content: () -> Content
|
|
) {
|
|
self.padding = padding
|
|
self.content = content()
|
|
}
|
|
|
|
var body: some View {
|
|
content
|
|
.padding(padding)
|
|
.background(
|
|
Capsule(style: .continuous)
|
|
.fill(.clear)
|
|
.idpGlassChrome()
|
|
)
|
|
.overlay(
|
|
Capsule(style: .continuous)
|
|
.stroke(Color.white.opacity(0.16), lineWidth: 1)
|
|
)
|
|
}
|
|
}
|