ui

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MinCellWidth = 12
	MaxCellWidth = 40
)

Variables

This section is empty.

Functions

func ColIndexToLetter

func ColIndexToLetter(index int) string

ColIndexToLetter converts a 0-indexed column number to Excel-style letter

func GetCellType

func GetCellType(cell models.Cell) string

GetCellType determines the type of a cell

func GetStatusColor

func GetStatusColor(statusType string) lipgloss.Color

GetStatusColor returns the color for a status type

func Max

func Max(a, b int) int

Max returns the maximum of two integers

func Min

func Min(a, b int) int

Min returns the minimum of two integers

func PadCenter

func PadCenter(s string, width int) string

PadCenter centers text in a field of given width

func RenderModal

func RenderModal(width, height int, modal string) string

RenderModal centers a modal in the viewport

func Truncate

func Truncate(s string, maxLen int) string

Truncate truncates a string to maxLen with ellipsis

func TruncateToWidth

func TruncateToWidth(s string, width int) string

TruncateToWidth ensures text fits exactly in the cell width

func WrapText

func WrapText(text string, width int) string

WrapText wraps text to fit within a specified width

Types

type Styles

type Styles struct {
	Title           lipgloss.Style
	Header          lipgloss.Style
	HeaderHighlight lipgloss.Style
	Cell            lipgloss.Style
	SelectedCell    lipgloss.Style
	RowHighlight    lipgloss.Style
	ColHighlight    lipgloss.Style
	SearchMatch     lipgloss.Style
	RowNum          lipgloss.Style
	SelectedRowNum  lipgloss.Style
	StatusBar       lipgloss.Style
	SearchBar       lipgloss.Style
	SearchPrompt    lipgloss.Style
	Modal           lipgloss.Style
	ModalTitle      lipgloss.Style
	ModalContent    lipgloss.Style
	ModalKey        lipgloss.Style
	ModalValue      lipgloss.Style
	Help            lipgloss.Style
	FormulaBar      lipgloss.Style
	Separator       lipgloss.Style
}

Styles holds all lipgloss styles for the UI

func InitStyles

func InitStyles() *Styles

InitStyles creates and returns styles based on current theme

Jump to

Keyboard shortcuts

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