mirror of
https://github.com/phranck/TUIkit.git
synced 2026-06-20 09:54:37 +00:00
- Replace custom Observable protocol and @Published with Apple's @Observable macro - Add withObservationTracking in renderToBuffer for automatic per-property dependency tracking - Add type-based @Environment(Type.self) and .environment(object) for observable objects - Add ObjectEnvironmentModifier for injecting observable objects into the environment - Add needsCacheClear flag to AppState for thread-safe cache invalidation - Add cross-platform test script (scripts/test-linux.sh) for Docker-based Linux verification - Add DemoAppHeader with system info display (OS, version, architecture) - Consolidate Example App: extract ImageDemoHelpers, KeyboardHelpSection, ValueDisplayRow - Add pre-push verification rule to CLAUDE.md - Verified on both macOS and Linux (swift:6.0 container), 1155 tests passing
47 lines
1.5 KiB
Swift
47 lines
1.5 KiB
Swift
// 🖥️ TUIKit — Terminal UI Kit for Swift
|
|
// TextStylesPage.swift
|
|
//
|
|
// Created by LAYERED.work
|
|
// License: MIT
|
|
|
|
import TUIkit
|
|
|
|
/// Text styles demo page.
|
|
///
|
|
/// Shows various text styling options including:
|
|
/// - Basic styles (bold, italic, underline, etc.)
|
|
/// - Combined styles
|
|
/// - Special effects (blink, inverted)
|
|
struct TextStylesPage: View {
|
|
var body: some View {
|
|
VStack(alignment: .leading, spacing: 1) {
|
|
DemoSection("Basic Styles") {
|
|
Text("Normal text - no styling applied")
|
|
Text("Bold text").bold()
|
|
Text("Italic text").italic()
|
|
Text("Underlined text").underline()
|
|
Text("Strikethrough text").strikethrough()
|
|
Text("Dimmed text").dim()
|
|
}
|
|
|
|
DemoSection("Combined Styles") {
|
|
Text("Bold + Italic").bold().italic()
|
|
Text("Bold + Underline").bold().underline()
|
|
Text("Bold + Color").bold().foregroundStyle(.palette.accent)
|
|
Text("Italic + Dim").italic().dim()
|
|
Text("All combined").bold().italic().underline().foregroundStyle(.palette.accent)
|
|
}
|
|
|
|
DemoSection("Special Effects") {
|
|
Text("Blinking text (if terminal supports)").blink()
|
|
Text("Inverted colors").inverted()
|
|
}
|
|
|
|
Spacer()
|
|
}
|
|
.appHeader {
|
|
DemoAppHeader("Text Styles Demo")
|
|
}
|
|
}
|
|
}
|