ui

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2025 License: MPL-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ColorIndigo       = lipgloss.AdaptiveColor{Dark: "#7571F9", Light: "#5A56E0"}
	ColorSubtleIndigo = lipgloss.AdaptiveColor{Dark: "#514DC1", Light: "#7D79F6"}
	ColorCream        = lipgloss.AdaptiveColor{Dark: "#FFFDF5", Light: "#FFFDF5"}
	ColorYellowGreen  = lipgloss.AdaptiveColor{Dark: "#ECFD65", Light: "#04B575"}
	ColorFuschia      = lipgloss.AdaptiveColor{Dark: "#EE6FF8", Light: "#EE6FF8"}
	ColorGreen        = lipgloss.AdaptiveColor{Dark: "#04B575", Light: "#04B575"}
	ColorRed          = lipgloss.AdaptiveColor{Dark: "#ED567A", Light: "#FF4672"}
	ColorFaintRed     = lipgloss.AdaptiveColor{Dark: "#C74665", Light: "#FF6F91"}
	ColorGrey         = lipgloss.AdaptiveColor{Light: "#B2B2B2", Dark: "#4A4A4A"}
	ColorNoColor      = lipgloss.AdaptiveColor{Dark: "", Light: ""}
)

Colors for dark and light backgrounds.

View Source
var (
	StyleTitle    = lipgloss.NewStyle().Foreground(ColorCream).Background(ColorIndigo)
	StyleSubtitle = lipgloss.NewStyle().Foreground(ColorCream).Background(ColorSubtleIndigo)
	StyleComment  = lipgloss.NewStyle().Foreground(ColorGrey)

	StyleTableFunc = func() table.Styles {
		s := table.DefaultStyles()
		s.Header = s.Header.
			BorderStyle(lipgloss.NormalBorder()).
			BorderForeground(lipgloss.Color("240")).
			BorderBottom(true).
			Bold(false)
		s.Selected = s.Selected.
			Foreground(lipgloss.Color("229")).
			Background(lipgloss.Color("57")).
			Bold(false)
		return s
	}
	StyleTableBase = lipgloss.NewStyle().
					BorderStyle(lipgloss.NormalBorder()).
					BorderForeground(lipgloss.Color("240"))

	StyleActiveDot   = lipgloss.NewStyle().Foreground(lipgloss.AdaptiveColor{Light: "235", Dark: "252"}).Render("•")
	StyleInactiveDot = lipgloss.NewStyle().Foreground(lipgloss.AdaptiveColor{Light: "250", Dark: "238"}).Render("•")

	StyleQuitMsg  = lipgloss.NewStyle().Foreground(lipgloss.AdaptiveColor{Light: "#DDDADA", Dark: "#3C3C3C"})
	StyleErrorMsg = lipgloss.NewStyle().Foreground(ColorRed)
)

Functions

This section is empty.

Types

type Diags

type Diags []json.Diagnostic

func (Diags) HasError

func (diags Diags) HasError() bool

type KeyMap

type KeyMap struct {
	TableKeyMap  table.KeyMap
	PaginatorMap paginator.KeyMap

	Follow key.Binding
	Quit   key.Binding
	Copy   key.Binding

	Help key.Binding
}

func NewKeyMap

func NewKeyMap(clipboardEnabled bool) KeyMap

func (*KeyMap) EnablePaginator

func (km *KeyMap) EnablePaginator()

func (KeyMap) FullHelp

func (k KeyMap) FullHelp() [][]key.Binding

FullHelp returns keybindings for the expanded help view. It's part of the key.Map interface.

func (KeyMap) ShortHelp

func (k KeyMap) ShortHelp() []key.Binding

ShortHelp returns keybindings to be shown in the mini help view. It's part of the key.Map interface.

type Size

type Size struct {
	Height int
	Width  int
}

type UIModel

type UIModel struct {
	// contains filtered or unexported fields
}

func NewRuntimeModel

func NewRuntimeModel(logger *log.Logger, reader reader.Reader, startTime time.Time) UIModel

func (UIModel) Diags

func (m UIModel) Diags() Diags

func (UIModel) Init

func (m UIModel) Init() tea.Cmd

func (UIModel) IsEOF

func (m UIModel) IsEOF() bool

func (UIModel) ToCsv

func (m UIModel) ToCsv() []byte

func (UIModel) Update

func (m UIModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (UIModel) View

func (m UIModel) View() string

type ViewState

type ViewState int
const (
	ViewStateUnknown ViewState = iota
	ViewStateIdle
	ViewStateRefresh
	ViewStatePlan
	ViewStateApply
	ViewStateSummary
)

func (ViewState) NextState

func (s ViewState) NextState(msg views.Message) (ViewState, bool)

func (ViewState) String

func (s ViewState) String() string

Jump to

Keyboard shortcuts

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