Files
TUIkit/Sources/TUIKitExample/Pages/OverlaysPage.swift
T
phranck 6c816a1770 refactor(example): Update Example App to use appearance-based borderStyle
- MainMenuPage: Menu and featureBox now use appearance default
- LayoutPage: Boxes and borders now use appearance default
- OverlaysPage: Alert now uses appearance default borderStyle

This allows the 'a' key shortcut to change the appearance of all
components simultaneously.
2026-01-28 22:44:29 +01:00

58 lines
1.7 KiB
Swift

//
// OverlaysPage.swift
// TUIKitExample
//
// Demonstrates overlay and modal capabilities.
//
import TUIKit
/// Overlays and modals demo page.
///
/// Shows the overlay system including:
/// - `.overlay()` modifier
/// - `.dimmed()` modifier
/// - `.modal()` helper
/// - Note: The status bar is NOT dimmed by modals!
struct OverlaysPage: View {
var body: some View {
// Background content with modal overlay
backgroundContent
.modal {
Alert(
title: "Modal Alert",
message: "This alert overlays dimmed content!",
// borderStyle uses appearance default
borderColor: .yellow,
titleColor: .yellow
) {
HStack(spacing: 3) {
Text("[OK]").bold().foregroundColor(.green)
Text("[Cancel]").foregroundColor(.red)
}
}
}
}
var backgroundContent: some View {
VStack(spacing: 1) {
HeaderView(title: "Overlays & Modals Demo")
DemoSection("Overlay System Features") {
Text("• .overlay() modifier - layer content on top")
Text("• .dimmed() modifier - reduce visual emphasis")
Text("• .modal() helper - combines dimmed + centered overlay")
}
DemoSection("This page demonstrates a modal overlay") {
Text("The content behind is dimmed automatically")
Text("Note: The status bar is NOT dimmed!")
.bold()
.foregroundColor(.green)
}
Spacer()
}
}
}