Files
TUIkit/Sources/TUIKitExample/Pages/OverlaysPage.swift
T
phranck 45e73faafb refactor: Rename package from SwiftTUI to TUIKit
BREAKING CHANGE: Package name changed due to name collision with
existing rensbreur/SwiftTUI package.

Changes:
- Rename package from SwiftTUI to TUIKit in Package.swift
- Rename Sources/SwiftTUI to Sources/TUIKit
- Rename Sources/SwiftTUIExample to Sources/TUIKitExample
- Rename Tests/SwiftTUITests to Tests/TUIKitTests
- Rename SwiftTUI.swift to TUIKit.swift
- Update all imports: import SwiftTUI -> import TUIKit
- Update all code references: SwiftTUI.renderToBuffer -> TUIKit.renderToBuffer
- Update documentation comments
- Rename swiftTUIVersion to tuiKitVersion

All 181 tests passing.
2026-01-28 19:32:09 +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: .rounded,
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()
}
}
}