ui

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

	StepAlert      = lipgloss.NewStyle().SetString("    " + Announce("!")).Render
	StepDone       = lipgloss.NewStyle().SetString("    -").Render
	StepHint       = hint.SetString("    |").Render
	StepNext       = hint.SetString("    -").Render
	StepInProgress = lipgloss.NewStyle().SetString("    *").Render
	StepPrompt     = lipgloss.NewStyle().SetString("    " + Prompt.Render("?")).Render
	StepWarning    = header.SetString("    " + bgBanana(fgMidnight("!")) + fgBanana(" Warning:")).Render

	Accentuate         = lipgloss.NewStyle().Italic(true).Render
	Action             = lipgloss.NewStyle().Bold(true).Foreground(colorBrandPrimary).Render
	Announce           = lipgloss.NewStyle().Background(colorBrandSecondary).Render
	Danger             = 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
	// 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) ErrorView added in v0.0.32

func (d *Driver) ErrorView() string

func (*Driver) Golden added in v0.0.33

func (d *Driver) Golden() string

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 Error added in v0.0.23

type Error struct {
	tea.Model

	Err error // reported error
}

func (Error) Error added in v0.0.38

func (e Error) Error() string

func (Error) Unwrap added in v0.0.38

func (e Error) Unwrap() error

type ListItem

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

func (ListItem[T]) FilterValue

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

type MessageFunc added in v0.0.35

type MessageFunc func(*strings.Builder)

func (MessageFunc) Init added in v0.0.35

func (MessageFunc) Init() tea.Cmd

func (MessageFunc) Update added in v0.0.35

func (m MessageFunc) Update(tea.Msg) (tea.Model, tea.Cmd)

func (MessageFunc) View added in v0.0.35

func (m MessageFunc) View() string

type MessageLines added in v0.0.35

type MessageLines []string

func (MessageLines) Init added in v0.0.35

func (MessageLines) Init() tea.Cmd

func (MessageLines) Update added in v0.0.35

func (m MessageLines) Update(tea.Msg) (tea.Model, tea.Cmd)

func (MessageLines) View added in v0.0.35

func (m MessageLines) View() string

type Program

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

type Section added in v0.0.35

type Section struct {
	Name string

	tea.Model
}

func (Section) Section added in v0.0.35

func (s Section) Section() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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