Documentation
¶
Overview ¶
Package components provides reusable TUI building blocks.
Index ¶
- type Header
- type HeaderStyles
- type Modal
- type ModalKind
- type ModalStyles
- type StatusBar
- func (s *StatusBar) NextSpinner()
- func (s *StatusBar) SetBusy(active bool, label string)
- func (s *StatusBar) SetExitArmed(armed bool)
- func (s *StatusBar) SetPending(count int)
- func (s *StatusBar) SetRefresh(t time.Time)
- func (s *StatusBar) SetScroll(pos string)
- func (s *StatusBar) SetView(label string)
- func (s *StatusBar) SetWidth(w int)
- func (s StatusBar) View() string
- type StatusBarStyles
- type Tab
- type TabStrip
- type TabStripStyles
- type Toast
- type ToastKind
- type ToastStyles
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Header ¶
type Header struct {
// contains filtered or unexported fields
}
Header renders the top bar: greeting, role, cycle, breadcrumb.
func NewHeader ¶
func NewHeader(userName, role, cycle string, styles HeaderStyles) Header
NewHeader creates a new header component.
type HeaderStyles ¶
type HeaderStyles struct {
Bar lipgloss.Style
Greeting lipgloss.Style
Meta lipgloss.Style
Breadcrumb lipgloss.Style
}
HeaderStyles holds the styles for the header component.
type Modal ¶
type Modal struct {
Title string
Message string
Kind ModalKind
Input string
Visible bool
// contains filtered or unexported fields
}
Modal renders a centered overlay dialog for confirmations or short text input.
func (*Modal) AppendInput ¶
AppendInput adds a character to the input.
func (*Modal) BackspaceInput ¶
func (m *Modal) BackspaceInput()
BackspaceInput removes the last rune from the input. It deletes a whole UTF-8 rune (not a single byte) so backspacing over a multi-byte character never leaves invalid UTF-8 in the captured value.
func (*Modal) ShowConfirm ¶
ShowConfirm opens a confirmation modal.
type ModalKind ¶
type ModalKind int
ModalKind distinguishes between confirmation and text input modals.
type ModalStyles ¶
type ModalStyles struct {
Border lipgloss.Style
Title lipgloss.Style
Message lipgloss.Style
Input lipgloss.Style
Hint lipgloss.Style
}
ModalStyles holds the styles for the modal component.
type StatusBar ¶
type StatusBar struct {
// contains filtered or unexported fields
}
StatusBar renders the bottom bar: view name, pending count, help hint, time.
func NewStatusBar ¶
func NewStatusBar(styles StatusBarStyles) StatusBar
NewStatusBar creates a new status bar.
func (*StatusBar) NextSpinner ¶
func (s *StatusBar) NextSpinner()
NextSpinner advances the spinner animation frame.
func (*StatusBar) SetBusy ¶
SetBusy updates whether the status bar should show an inline busy indicator.
func (*StatusBar) SetExitArmed ¶ added in v0.9.0
SetExitArmed sets whether the status bar should show the double-esc-to-quit hint.
func (*StatusBar) SetPending ¶
SetPending updates the pending count.
func (*StatusBar) SetRefresh ¶
SetRefresh updates the last refresh time.
type StatusBarStyles ¶
type StatusBarStyles struct {
Bar lipgloss.Style
Label lipgloss.Style
Pending lipgloss.Style
Hint lipgloss.Style
Clock lipgloss.Style
Stale lipgloss.Style
}
StatusBarStyles holds the styles for the status bar.
type TabStrip ¶
type TabStrip struct {
// contains filtered or unexported fields
}
TabStrip renders a horizontal tab bar.
func NewTabStrip ¶
func NewTabStrip(tabs []Tab, styles TabStripStyles) TabStrip
NewTabStrip creates a new tab strip.
type TabStripStyles ¶
type TabStripStyles struct {
Active lipgloss.Style
Inactive lipgloss.Style
Bar lipgloss.Style
Separator lipgloss.Style
}
TabStripStyles holds the styles for the tab strip.
type Toast ¶
type Toast struct {
Message string
Kind ToastKind
ExpiresAt time.Time
// contains filtered or unexported fields
}
Toast renders an ephemeral notification.