mirror of
https://github.com/phranck/TUIkit.git
synced 2026-05-21 09:50:35 +00:00
45e73faafb
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.
63 lines
1.8 KiB
Swift
63 lines
1.8 KiB
Swift
//
|
|
// ContainersPage.swift
|
|
// TUIKitExample
|
|
//
|
|
// Demonstrates container view capabilities.
|
|
//
|
|
|
|
import TUIKit
|
|
|
|
/// Container views demo page.
|
|
///
|
|
/// Shows various container views including:
|
|
/// - Card (bordered container with padding)
|
|
/// - Box (simple bordered container)
|
|
/// - Panel (container with title in border)
|
|
/// - All available border styles
|
|
struct ContainersPage: View {
|
|
var body: some View {
|
|
VStack(spacing: 1) {
|
|
HeaderView(title: "Container Views Demo")
|
|
|
|
HStack(spacing: 2) {
|
|
// Card example
|
|
VStack(alignment: .leading) {
|
|
Text("Card").bold().foregroundColor(.yellow)
|
|
Card(borderStyle: .rounded, borderColor: .cyan) {
|
|
Text("A Card view")
|
|
Text("with padding").dim()
|
|
}
|
|
}
|
|
|
|
// Box example
|
|
VStack(alignment: .leading) {
|
|
Text("Box").bold().foregroundColor(.yellow)
|
|
Box(.doubleLine, color: .green) {
|
|
Text("Simple Box")
|
|
}
|
|
}
|
|
|
|
// Panel example
|
|
VStack(alignment: .leading) {
|
|
Text("Panel").bold().foregroundColor(.yellow)
|
|
Panel("Info", borderStyle: .line, titleColor: .magenta) {
|
|
Text("Title in border")
|
|
}
|
|
}
|
|
}
|
|
|
|
DemoSection("Border Styles") {
|
|
HStack(spacing: 1) {
|
|
Box(.line) { Text("line") }
|
|
Box(.rounded) { Text("rounded") }
|
|
Box(.doubleLine) { Text("double") }
|
|
Box(.heavy) { Text("heavy") }
|
|
Box(.block) { Text("block") }
|
|
}
|
|
}
|
|
|
|
Spacer()
|
|
}
|
|
}
|
|
}
|