Commit Graph
9 Commits
Author SHA1 Message Date
phranck da3a0a1922 refactor: Remove ascii Appearance (not needed)
Remaining appearances: line, rounded, doubleLine, heavy, block
2026-01-28 22:34:56 +01:00
phranck bb465c8839 refactor: Rename Appearance presets to match BorderStyle names
Changed from invented names to existing BorderStyle names:
- .sharp → .line
- .double → .doubleLine
- Added .block (was missing)

Appearance IDs now match BorderStyle names exactly:
- .line, .rounded, .doubleLine, .heavy, .block, .ascii

Cycling order: line → rounded → doubleLine → heavy → block → ascii
2026-01-28 22:33:18 +01:00
phranck 282585a68b feat: Add Appearance system for consistent UI styling
Appearance controls the visual structure (border style) of UI controls,
while Theme controls colors. Together they create a complete look.

New types:
- Appearance: Defines borderStyle for all controls
- Appearance.ID: Type-safe identifier (no magic strings)
- AppearanceManager: Environment-based cycling (no singleton)
- AppearanceRegistry: Available appearances

Predefined appearances:
- .rounded (default) - Curved corners
- .sharp - 90-degree corners
- .double - Double-line borders
- .heavy - Thick/bold borders
- .ascii - Maximum terminal compatibility (+, -, |)

Updated components to use appearance.borderStyle as default:
- Menu, Button, Panel, Card, Box, Alert, Dialog
- BorderModifier (.border() modifier)

Added 'a' key shortcut to cycle through appearances.

Also added BorderStyle.ascii for ASCII-only terminals.

All 189 tests passing.
2026-01-28 21:44:01 +01:00
phranck 982cfbc39e style: Add subtle theme tint to backgrounds
Each theme now has a darker background with a subtle color tint:
- Green: #0F1A0F (dark with green tint)
- Amber: #1A150F (dark with amber/orange tint)
- White: #121418 (dark with cool/blue tint)
- Red: #1A0F0F (dark with red tint)

This gives each theme a more distinctive character while keeping
the backgrounds dark and easy on the eyes.
2026-01-28 21:25:29 +01:00
phranck 3470cb8e24 refactor: Use theme colors throughout UI components
- Update all 4 phosphor themes (Green, Amber, White, Red) to use neutral
  dark background (#1E1E1E) matching Spotnik reference
- Simplify theme names (remove 'Phosphor' suffix)
- Menu: Use theme.foreground for items, theme.accent for selection
- Button: Use theme colors for default focused style and focus indicator
- Panel/Card: Use theme.border as default border color
- BorderModifier: Use theme.border as default

All 189 tests passing.
2026-01-28 21:08:25 +01:00
phranck 1d547a4f19 refactor: Simplify themes - Green as default, remove Light/Dark
- Remove DefaultTheme, DarkTheme, LightTheme
- GreenPhosphorTheme is now the default theme
- Theme cycling order: Green → Amber → White → Red → NCurses
- .default now maps to GreenPhosphorTheme
2026-01-28 20:55:46 +01:00
phranck 544152de02 refactor: Remove ThemeManager singleton, add Environment-based access
- ThemeManager is no longer a singleton
- Access via Environment: @Environment(\.themeManager)
- Type-safe setTheme() API: themeManager.setTheme(.amber)
- ThemeManager injected by AppRunner into environment
- Custom themes supported via init(themes:)
2026-01-28 20:48:00 +01:00
phranck 1d3c9b2a62 feat: Add QuitBehavior and ThemeManager
QuitBehavior:
- .always: Quit works from any screen (default)
- .rootOnly: Quit only works from main screen (no context pushed)
- Quit item hidden in status bar when not allowed

ThemeManager:
- Singleton for managing theme cycling
- cycleTheme() / cyclePreviousTheme() methods
- setTheme(at:) and setTheme(withId:) for direct access
- Automatically updates environment and triggers re-render
- 't' key now cycles themes in AppRunner
2026-01-28 20:44:00 +01:00
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