TUI Renderer Update

This commit is contained in:
2025-11-29 21:42:41 +00:00
parent 9c7d9c5406
commit 0bb3de2b35
7 changed files with 334 additions and 369 deletions

View File

@@ -364,6 +364,28 @@ Supported inline types: `button`, `link`, `tooltip`, `progress`, `output`, `info
}
```
### Group
Groups allow you to arrange multiple elements together with custom layout:
```typescript
{
type: 'group',
content: '',
groupDirection: 'row', // row | column (default: row)
groupAlign: 'start', // start | center | end
groupGap: '1rem', // CSS gap value
inline: true, // Render inline with other elements
children: [
{ type: 'output', content: 'Label:', inline: true },
{ type: 'button', content: 'Action', style: 'primary', inline: true },
{ type: 'link', content: 'More info', href: '/help', inline: true }
]
}
```
Groups support nested groups and all element types as children. Children are rendered using the same `TuiLine` component, ensuring consistent behavior.
## TUI Components
### TerminalTUI
@@ -411,15 +433,24 @@ src/lib/components/
├── terminal-typing.ts # Typing animation engine
├── terminal-keyboard.ts# Keyboard navigation handler
├── TuiHeader.svelte # Top status bar
├── TuiBody.svelte # Scrollable content area
├── TuiBody.svelte # Scrollable content area (uses TuiLine)
├── TuiFooter.svelte # Bottom status bar
├── TuiLine.svelte # Unified line renderer for all types
├── TuiGroup.svelte # Container for grouped elements
├── TuiButton.svelte # Full-width button
├── TuiLink.svelte # Inline clickable link
├── TuiCard.svelte # Card with header/body/footer
├── TuiCardGrid.svelte # Grid layout for cards
├── TuiProgress.svelte # Animated progress bar
├── TuiAccordion.svelte # Collapsible sections
├── TuiTable.svelte # Data table with headers
── TuiTooltip.svelte # Hover tooltip
── TuiTooltip.svelte # Hover tooltip
├── TuiInput.svelte # Text input field
├── TuiTextarea.svelte # Multi-line text input
├── TuiCheckbox.svelte # Checkbox input
├── TuiRadio.svelte # Radio button group
├── TuiSelect.svelte # Dropdown select
└── TuiToggle.svelte # Toggle switch
```
## Terminal API