ui

package
v0.10.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 6, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

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

func DefaultTableHeaderStyle() lipgloss.Style

Table header style configuration

func DefaultTableSelectedStyle

func DefaultTableSelectedStyle() lipgloss.Style

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

func IsTerminal(w io.Writer) bool

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL