ui

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Header    = lipgloss.NewStyle().Bold(true).SetString("#").Render
	Hint      = hint.Copy().Render
	Underline = lipgloss.NewStyle().Underline(true).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
	Emphasize  = lipgloss.NewStyle().Bold(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)
)

Functions

func Domains

func Domains(domains []string) string

func List

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

func NewDriverTUI

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

func Spinner

func Spinner() spinner.Model

Types

type Driver

type Driver struct {
	Program // TUI mode

	TTY termenv.File
	// contains filtered or unexported fields
}

func NewDriverTTY

func NewDriverTTY(ctx context.Context) *Driver

func (*Driver) Activate

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

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)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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