20 Commits

Author SHA1 Message Date
phranck b3d563040a Feat: Add Image view with ASCII art rendering, bracketed paste, and input filtering
- Add Image view rendering local files and URLs as colored ASCII art
- Add CSTBImage C target wrapping stb_image for cross-platform image decoding
- Add ASCIIConverter with block, ASCII, and braille character sets
- Support trueColor, ANSI-256, grayscale, and mono color modes
- Add Floyd-Steinberg dithering for improved visual quality
- Add async image loading with URLImageCache for URL sources
- Add bracketed paste mode for bulk text insertion in text fields
- Add TextContentType modifier for input character filtering
- Add ContentMode enum and aspectRatio(_:contentMode:) View modifier
- Add text-input priority in key dispatch to prevent shortcut conflicts
- Add Image (File) and Image (URL) demo pages to example app
- Update DocC documentation with new symbols and layout table
2026-02-14 00:43:22 +01:00
phranck b3a8cb7e5a Feat: Add NavigationSplitView demo to example app 2026-02-10 12:00:29 +01:00
phranck 91aadd40a1 Feat: Add SecureField component for password input
- SecureField with masked display using ● (U+25CF) bullets
- Reuses TextFieldHandler for key input handling
- SwiftUI API parity: init(_:text:) and init(_:text:prompt:)
- Supports .onSubmit() and .disabled() modifiers
- Focus indicator with pulsing vertical bars
- 15 tests for masking behavior and rendering
- Example app page with password validation demo
2026-02-09 22:20:43 +01:00
phranck bc9841cdc9 Feat: Add Slider and Stepper components with TrackStyle refactor
- Slider: Interactive track control with keyboard navigation (arrow keys, +/-, Home/End)
- Stepper: Increment/decrement control with value or custom callbacks
- TrackStyle: Renamed from ProgressBarStyle, shared between ProgressView and Slider
- TrackRenderer: Extracted utility for track rendering
- 59 new tests (892 total), Example app demo pages for both components
2026-02-09 21:52:37 +01:00
phranck b877cb58ae Feat: Add TextField demo page to Example app 2026-02-09 19:05:30 +01:00
phranck 84fdb7ace2 Feat: Add Table component with column support
- TableColumn: Column definition with title, alignment, width modes
  - Key path and closure-based value extraction
  - Width modes: .fixed(Int), .flexible, .ratio(Double)
  - Alignment: .leading, .center, .trailing
  - Chainable modifiers: .alignment(), .width()

- Table: SwiftUI-compatible table with column headers
  - Single selection: Table(data, selection: Binding<ID?>)
  - Multi-selection: Table(data, selection: Binding<Set<ID>>)
  - Reuses ItemListHandler for navigation/selection
  - ANSI-aware column alignment
  - Header row with column titles
  - Space-only separators (no vertical lines)
  - Scroll indicators when content overflows
  - Empty state placeholder
  - .disabled() modifier support

- TableColumnBuilder: Result builder for column DSL
- TablePage: Example with file browser style demo
- 21 new tests for Table and TableColumn

Completes Phase 2 of List & Table plan.
2026-02-07 19:08:19 +01:00
phranck 9b8548bdbc Feat: Add List component with ItemListHandler
- ItemListHandler: Shared navigation/selection logic for List and Table
  - Keyboard navigation (Up/Down/Home/End/PageUp/PageDown)
  - Single and multi-selection modes via Binding
  - Scroll offset management with auto-scroll
  - Focus lifecycle hooks (onFocusLost/onFocusReceived)

- List: SwiftUI-compatible scrollable list component
  - Single selection: List(selection: Binding<ID?>)
  - Multi-selection: List(selection: Binding<Set<ID>>)
  - ForEach content via ListRowExtractor protocol
  - Multi-line row support
  - Visual states (focused/selected with pulsing accent)
  - Scroll indicators when content overflows
  - Empty state placeholder
  - .disabled() modifier support

- ListPage: Example with single and multi-selection demos
- 32 new tests (24 handler + 8 list rendering)
2026-02-07 18:57:51 +01:00
phranck b8634165fe Chore: Fix SwiftLint warnings and add code review agent
- Fix modifier order (nonisolated before static/public)
- Fix switch case alignment in ContentView.swift
- Fix empty string comparisons (use .isEmpty)
- Fix identical operands in KeyEventTests
- Remove vertical whitespace before closing braces
- Fix trailing whitespace and newlines
- Add swiftlint:disable comments for valid IUO patterns
- Add .claude/commands/review.md code review agent
2026-02-07 13:19:15 +01:00
phranck 5210868685 Revert: Remove premature List implementation
The List was implemented without following the shared architecture plan.
Reverted to allow proper implementation after:
1. ContainerView refactoring
2. Shared handlers (FocusableItemListHandler, SelectionStateManager)
3. List & Table with common architecture

Files removed:
- Sources/TUIkit/Views/List.swift
- Sources/TUIkit/Modifiers/TagModifier.swift
- Tests/TUIkitTests/ListTests.swift
- Sources/TUIkitExample/Pages/ListPage.swift

Tests: 591 (was 618, -27 List tests)
2026-02-07 01:13:33 +01:00
phranck 924492f46b Feat: Integrate List component into example app menu
- Add .list case to DemoPage enum
- Add ListPage to menu with shortcut 9
- Shift Spinners to shortcut 0
- Update status bar menu range to include all shortcuts
- 617 tests passing
2026-02-06 21:02:14 +01:00
phranck b7de843009 Feat: Add RadioButtonPage to example app with menu integration
- RadioButtonPage shows vertical radio groups, horizontal radio groups, and disabled states
- Live state display for color, size, and layout choices
- Added to main menu as option 8
- Shortcut key '8' for quick navigation
- All 591 tests passing
2026-02-06 17:57:32 +01:00
phranck a0af77af15 Feat: Toggle component with toggle and checkbox styles
- Toggle struct with string initializer for SwiftUI API parity
- ToggleStyle enum: .toggle (slider ●○) and .checkbox ([x])
- ToggleHandler for Space/Enter keyboard events
- Focus indicator with pulsing accent dot (inherited from Button pattern)
- Disabled state with tertiary color
- .disabled() modifier for control
- Comprehensive tests (17 tests, 571 total passing)
- TogglePage example with both styles, disabled states, and live state demo
- Added to main menu with shortcut key 7
2026-02-06 17:34:00 +01:00
phranck d3f8ff60f3 Chore: Change license to MIT
- Add LICENSE file (MIT)
- Update 141 Swift file headers: CC BY-NC-SA 4.0 → License: MIT
2026-02-06 00:21:51 +01:00
phranck 0bde1d9f4d Refactor: remove block/flat appearances, ascii border style, and update documentation
Remove the block and flat appearance systems entirely, keeping only the
four standard border-based appearances (line, rounded, doubleLine, heavy).
Remove BorderStyle.ascii preset. Clean up all stale references in doc
comments, DocC articles, and README.

- Remove Appearance.flat/.block and BlockPalette protocol
- Remove surface color tokens (surfaceBackground, surfaceHeaderBackground, elevatedBackground)
- Remove BorderStyle.block, .ascii, and related statics
- Remove flat/block rendering paths from all views
- Simplify BorderRenderer, BorderModifier, ContainerView, Menu, Button, StatusBar, AppHeader
- Fix BorderStyle doc examples (add missing right padding)
- Update DocC: PaletteReference, ThemingGuide, AppearanceAndColors, RenderCycle, TUIkit.md
- Update README palette references to SystemPalette
- Delete FlatThemePage from example app
- Remove related tests (526 tests / 84 suites passing)
2026-02-05 22:08:53 +01:00
phranck f77cd8bdec Chore: Unified file headers across all Swift files
Update IDETemplateMacros.plist and replace headers in 136 Swift files with
new format: 🖥️ TUIKit — Terminal UI Kit for Swift. Remove sdsd.swift template draft.
2026-02-03 20:48:29 +01:00
phranck db03e4e41c Refactor: HSL-based color system for all palettes — lighter/darker preserve hue, unified baseHue architecture 2026-02-03 18:11:39 +01:00
phranck 186e444fcc Fix: ESC closes modal via StatusBar context switching
OverlaysPage now manages its own StatusBar items based on modal state:
- Modal open: ESC → close modal, Enter → dismiss
- Modal closed: ESC → back to menu, arrows → nav, Enter → show

Removes redundant ESC handlers from Modal/AlertPresentationModifier.
The correct approach is context-aware StatusBar items, not multiple
competing ESC handlers.
2026-02-03 12:35:07 +01:00
phranck dec8c7c29f Feat: Add Spinner view with dots, line, and bouncing styles
Auto-animating loading indicator with three visual styles:
- Dots (braille rotation), Line (ASCII rotation), Bouncing (Larson scanner
  with fade trail). Time-based frame calculation ensures each spinner runs
  at its own speed independent of render triggers.

Configurable: SpinnerSpeed (.slow/.regular/.fast), BouncingTrackWidth
(.minimum/.default/.maximum/.fixed(Int)), BouncingTrailLength
(.short/.regular/.long), custom color.

Run loop upgraded from 100ms to 40ms polling (~25 FPS) to support
smooth animations.
2026-02-02 19:57:58 +01:00
phranck 1877ae65e6 Refactor: Eliminate AppState singleton via RenderNotifier and constructor injection 2026-02-02 17:31:52 +01:00
phranck 95029184e7 Chore: Rename TUIKit to TUIkit
- Rename module, targets and products in Package.swift
- Rename directories: Sources/TUIkit, TUIkitExample, Tests/TUIkitTests
- Rename files: TUIkit.swift, TUIkit.docc/TUIkit.md
- Update all import statements, module-qualified calls, file headers
- Update doc comments, string literals and DocC articles
- Update CI workflow, README, .swiftlint.yml and markdown docs
- Merge platform badges into single combined badge in README
- Add "Example App auslagern" task to to-dos.md
2026-01-30 20:29:29 +01:00