Documentation
¶
Index ¶
- Variables
- func DefaultTableHeaderStyle() lipgloss.Style
- func DefaultTableSelectedStyle() lipgloss.Style
- func GetTerminalHeight() int
- func GetTerminalWidth() int
- func IsTerminal(w io.Writer) bool
- func SortByName[T SortableByName](items []T)
- func SortStrings(items []string)
- type OutputFormat
- type SortableByName
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Table styles BaseTableStyle = lipgloss.NewStyle(). BorderStyle(lipgloss.NormalBorder()). BorderForeground(lipgloss.Color("240")) // Title styles TitleStyle = lipgloss.NewStyle(). Bold(true). Foreground(lipgloss.Color("99")) // Label/Value styles for detail views LabelStyle = lipgloss.NewStyle(). Bold(true). Foreground(lipgloss.Color("240")) ValueStyle = lipgloss.NewStyle(). Foreground(lipgloss.Color("252")) // Help text HelpStyle = lipgloss.NewStyle(). Foreground(lipgloss.Color("241")) // Success/Error styles SuccessStyle = lipgloss.NewStyle(). Foreground(lipgloss.Color("42")) ErrorStyle = lipgloss.NewStyle(). Foreground(lipgloss.Color("196")) // Selection styles SelectedItemStyle = lipgloss.NewStyle(). Foreground(lipgloss.Color("170")). Bold(true) NormalItemStyle = lipgloss.NewStyle(). Foreground(lipgloss.Color("252")) // Default indicator style (subtle) DefaultIndicatorStyle = lipgloss.NewStyle(). Foreground(lipgloss.Color("42")) // Green color for checkmark // Default row highlight style DefaultRowStyle = lipgloss.NewStyle(). Background(lipgloss.Color("228")) // Subtle yellow background )
Common styles used across the application
Functions ¶
func DefaultTableHeaderStyle ¶
Table header style configuration
func DefaultTableSelectedStyle ¶
Table selected row style configuration
func GetTerminalHeight ¶
func GetTerminalHeight() int
GetTerminalHeight returns the current terminal height with a fallback
func GetTerminalWidth ¶
func GetTerminalWidth() int
GetTerminalWidth returns the current terminal width with a fallback
func IsTerminal ¶
IsTerminal returns true if the given writer is a terminal
func SortByName ¶
func SortByName[T SortableByName](items []T)
SortByName sorts a slice of items alphabetically by name (case-insensitive)
func SortStrings ¶
func SortStrings(items []string)
SortStrings sorts a slice of strings alphabetically (case-insensitive)
Types ¶
type OutputFormat ¶
type OutputFormat string
OutputFormat represents the desired output format
const ( // OutputFormatTable renders as a human-readable table OutputFormatTable OutputFormat = "table" // OutputFormatJSON renders as JSON OutputFormatJSON OutputFormat = "json" // OutputFormatCSV renders as comma-separated values OutputFormatCSV OutputFormat = "csv" )
func ParseOutputFormat ¶
func ParseOutputFormat(s string) (OutputFormat, error)
ParseOutputFormat parses a string into an OutputFormat
type SortableByName ¶
type SortableByName interface {
GetName() string
}
SortableByName is an interface for items that can be sorted by name
Click to show internal directories.
Click to hide internal directories.