ui

package
v0.0.31 Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Header    = header.Copy().SetString("#").Render
	Skip      = header.Copy().Faint(true).SetString("# Skipped:").Render
	Hint      = hint.Copy().Render
	Underline = lipgloss.NewStyle().Underline(true).Render
	Warning   = header.Copy().SetString(bgBanana(fgMidnight("!")) + fgBanana(" Warning:")).Render

	StepAlert      = lipgloss.NewStyle().SetString("    " + Announce("!")).Render
	StepDone       = lipgloss.NewStyle().SetString("    -").Render
	StepHint       = hint.Copy().SetString("    |").Render
	StepInProgress = lipgloss.NewStyle().SetString("    *").Render
	StepPrompt     = lipgloss.NewStyle().SetString("    " + Prompt.Render("?")).Render

	Accentuate         = lipgloss.NewStyle().Italic(true).Render
	Action             = lipgloss.NewStyle().Bold(true).Foreground(colorBrandPrimary).Render
	Announce           = lipgloss.NewStyle().Background(colorBrandSecondary).Render
	Error              = lipgloss.NewStyle().Bold(true).Foreground(colorDanger).Render
	Emphasize          = lipgloss.NewStyle().Bold(true).Render
	EmphasizeUnderline = lipgloss.NewStyle().Bold(true).Underline(true).Render
	Titlize            = lipgloss.NewStyle().Bold(true).Render
	URL                = lipgloss.NewStyle().Faint(true).Underline(true).Render
	Whisper            = lipgloss.NewStyle().Faint(true).Render

	Prompt = lipgloss.NewStyle().Foreground(colorBrandPrimary)

	Waiting = spinner.MiniDot
)

Functions

func Domains

func Domains(domains []string) string

func Exit added in v0.0.11

func Exit() tea.Msg

func List

func List[T any](items []ListItem[T]) list.Model

func NewDriverTUI

func NewDriverTUI(ctx context.Context) (*Driver, Program)

func WaitingSpinner added in v0.0.10

func WaitingSpinner() spinner.Model

Types

type Driver

type Driver struct {
	Program // TUI mode

	TTY termenv.File

	Out io.Reader

	LastView string
	// contains filtered or unexported fields
}

func NewDriverTTY

func NewDriverTTY(ctx context.Context) *Driver

func NewDriverTest added in v0.0.14

func NewDriverTest(ctx context.Context) *Driver

func (*Driver) Activate

func (d *Driver) Activate(ctx context.Context, model tea.Model)

func (*Driver) FinalOut added in v0.0.20

func (d *Driver) FinalOut() []byte

func (*Driver) Init

func (d *Driver) Init() tea.Cmd

func (*Driver) Pause

func (d *Driver) Pause() chan<- struct{}

func (*Driver) Stop

func (d *Driver) Stop()

func (*Driver) Update

func (d *Driver) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (*Driver) View

func (d *Driver) View() string

type ListItem

type ListItem[T any] struct {
	Key   T
	Value string
}

func (ListItem[T]) FilterValue

func (li ListItem[T]) FilterValue() string

type Program

type Program interface {
	Quit()
	Run() (tea.Model, error)
	Send(tea.Msg)
	Wait()
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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