Commit Graph
16 Commits
Author SHA1 Message Date
phranck 2cf72c2b19 feat: Add comprehensive DocC documentation with tutorials
Add complete Apple-style DocC documentation for TUIKit framework:

## Documentation Structure
- Main landing page (TUIKit.md) with quick-start and topic navigation
- 8 guide articles: GettingStarted, ViewHierarchy, StateManagement, Theming, Appearance, Focus, Modifiers, Architecture
- 3 step-by-step tutorials: BuildYourFirstApp, BuildInteractiveMenu, BuildThemableUI
- Documentation catalog with proper Info.plist configuration

## Code Improvements
- Enhanced Box.swift documentation with clear container comparison
- Added comprehensive examples and usage patterns
- Explained appearance integration and sizing behavior

## Infrastructure
- GitHub Actions workflow (.github/workflows/docc.yml) for automatic DocC building
- Configured for deployment to GitHub Pages on push to main
- Uses xcrun docc build with proper artifact handling

## Documentation Includes
- API reference stubs for all major components
- Comprehensive guide articles with code examples
- Interactive tutorials following Apple's documentation style
- Cross-references using DocC syntax (``Type``)
- Best practices and design patterns explained

The documentation is ready for automated building and deployment to GitHub Pages.
2026-01-29 02:42:29 +01:00
phranck 2232fefc44 feat: Improve StatusBar, Buttons, and Theme styling for block appearance
- Add StatusBar.bordered style with theme colors and block appearance support
- Pass current environment to StatusBar rendering for dynamic theme updates
- Implement ButtonRow right-alignment with calculated left padding
- Add buttonBackground theme color for lighter buttons in block appearance
- Remove button borders and focus indicators for primary buttons in block appearance
- Add theme background colors to container body and button content
- Adjust theme colors: foregroundSecondary, statusBarForeground, buttonBackground
- Update Amber theme header/footer background to #1E110E
- Refactor Overlays demo to use real Button components with VStack layout
- Center alert modal with HStack and Spacer elements
2026-01-29 02:24:52 +01:00
phranck f1a9088779 Refactor: Clean up half-padding and improve demos
- Remove abandoned half-padding feature from BorderModifier
- Simplify block appearance rendering in BorderModifier, ContainerView, Menu
- Update theme colors for all 4 phosphor themes (container backgrounds)
- Fix VStack alignment (leading/center/trailing now work correctly)
- Improve ContainersPage demos (alignment, padding display)
- Replace hardcoded colors with theme colors in DemoSection
- Update documentation (memory.md, whats-next.md, to-dos.md)
2026-01-29 01:21:39 +01:00
phranck 9dda5961cc feat: Implement proper block appearance with half-block characters
Block appearance now uses:
- Top edge: ▄ (lower half block) colored with header background
- Bottom edge: ▀ (upper half block)
- Side borders: █ (full block)
- Header/Body separator: ▀ with FG=header BG, BG=transparent
- Body/Footer separator: ▄ with FG=footer BG, BG=transparent

This creates seamless visual transitions between sections.
Header and footer have darker backgrounds, body is transparent.
2026-01-28 23:35:03 +01:00
phranck 37cd4b88f5 feat: Add ContainerView with Header/Body/Footer architecture
- Add ContainerView as unified base for container views
- Add ContainerStyle for separator and border configuration
- Add containerBackground and containerHeaderBackground to Theme
- Standard appearances: Title in top border, Footer as separate section
- Block appearance: Separate Header section with darker background
- Migrate Panel, Card, Alert, Dialog to use ContainerView
- All views now support optional footer with separator
2026-01-28 23:24:35 +01:00
phranck 9b70dd0b46 feat(Menu): Use T-junction characters for title separator
- Add leftT and rightT characters to BorderStyle
- Update all preset styles with correct T-junction characters:
  - line: ├ ┤
  - doubleLine: ╠ ╣
  - rounded: ├ ┤
  - heavy: ┣ ┫
  - block: █ █
  - ascii: + +
- Menu title separator now connects to border with T-junctions
- Separator spans full width from left to right border
2026-01-28 23:07:19 +01:00
phranck 8f48b78de3 fix(Menu): Extend title separator to full content width 2026-01-28 23:04:32 +01:00
phranck 2c60a7ed8a feat(Menu): Improve selection bar styling
- Selection bar now uses full width (padded to content width)
- Selection background uses dimmed theme color (selectionBackground)
- Selection text is bold and highlighted with accent color
- Add selectionBackground to Theme protocol and all themes
- Remove arrow indicator, use pure background highlight for selection
2026-01-28 23:02:05 +01:00
phranck fb434fe77d feat(StatusBar): Add appearance system integration
- StatusBar bordered style now uses appearance-based borderStyle
- Replace help item (`?`) with appearance item (`a`) in system items
- Add `showAppearanceItem` flag to StatusBarState
- Add `StatusBarItemOrder.appearance` for proper ordering
- Update SystemStatusBarItem to include appearance cycling
- Pressing `a` now cycles through appearances (line, rounded, doubleLine, heavy, block)

The StatusBar bordered style adapts to the current appearance, showing the
same border style as all other controls in the app.
2026-01-28 22:47:33 +01:00
phranck f7df2fa2de feat(Menu): Add appearance-based selection highlighting
- Block appearance uses background highlight for selected items
- Other appearances use arrow indicator prefix
- Selected item in block appearance swaps foreground/background colors
2026-01-28 22:43:15 +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 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 b9a6cc29ab fix: Show all system items (quit, help, theme) and fix deduplication
- StatusBarState now initializes with all 3 system items
- Added deduplication logic to StatusBar.renderToBuffer
- User items with same shortcut override system items
- Updated Example App to not duplicate 'q quit'
- Updated tests for 3 system items instead of 1
2026-01-28 20:40:52 +01:00
phranck 61a51ef056 refactor: Two-container model for StatusBar (user left, system right)
- StatusBar now has separate userItems and systemItems properties
- User items are sorted by order, then system items (fixed order) appended
- Rendering combines both: [sorted user items] + [system items]
- User items override system items with same shortcut (deduplication)
- StatusBarState passes items separately to StatusBar
- Alignment applies to the combined items
- Updated tests to use userItems property
2026-01-28 20:32:39 +01:00
phranck 04cbf2db8b feat: Add system StatusBar items with stable ordering
- Add StatusBarItemOrder for consistent item positioning
- System items (quit, help, theme) appear on the right side
- User items appear on the left, can override system items
- Separate tracking of user vs system items in StatusBarState
- Add showSystemItems flag to disable system items in tests
- Items sorted by order value (lower = left, higher = right)
- User items override system items with the same shortcut
- Add comprehensive tests for system item behavior (189 total)
2026-01-28 20:23:27 +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