ui

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultWidth = 160

Variables

View Source
var (
	Red    = lipgloss.AdaptiveColor{Light: "#FE5F86", Dark: "#FE5F86"}
	Indigo = lipgloss.AdaptiveColor{Light: "#5A56E0", Dark: "#7571F9"}
	Green  = lipgloss.AdaptiveColor{Light: "#02BA84", Dark: "#02BF87"}
	Brand  = lipgloss.AdaptiveColor{Light: "#304FFE", Dark: "#304FFE"}
	Gray   = lipgloss.AdaptiveColor{Light: "#f0f0f0", Dark: "#333333"}
)
View Source
var (
	Keyword = lipgloss.NewStyle().
			Foreground(Brand)

	Underline = lipgloss.NewStyle().
				Underline(true)

	Paragraph = lipgloss.NewStyle().
				Width(DefaultWidth).
				Padding(0, 0, 0, 2)

	Title = lipgloss.NewStyle().
			Bold(true).
			Foreground(Brand)

	Box = lipgloss.NewStyle().
		Border(lipgloss.Border{
			Top:         "─",
			Bottom:      "─",
			Left:        "│",
			Right:       "│",
			TopLeft:     "╭",
			TopRight:    "╮",
			BottomRight: "┘",
			BottomLeft:  "└",
		}).
		BorderForeground(Gray).
		Padding(1, 2).
		Width(DefaultWidth).
		Align(lipgloss.Center)

	Base = lipgloss.NewStyle().
			Padding(1, 4, 0, 1)

	HeaderText = lipgloss.NewStyle().
				Foreground(Indigo).
				Bold(true).
				Padding(0, 1, 0, 2)

	Status = lipgloss.NewStyle().
			Border(lipgloss.RoundedBorder()).
			BorderForeground(Indigo).
			PaddingLeft(1).
			MarginTop(1)

	StatusHeader = lipgloss.NewStyle().
					Foreground(Green).
					Bold(true)

	Highlight = lipgloss.NewStyle().
				Foreground(lipgloss.Color("212"))

	ErrorHeaderText = HeaderText.
					Copy().
					Foreground(Red)

	Help = lipgloss.NewStyle().
			Foreground(lipgloss.Color("240"))
)

Functions

This section is empty.

Types

type Model

type Model struct {
	Status   ModelState
	Renderer *lipgloss.Renderer
	Form     *huh.Form
	Width    int
}

func NewModel

func NewModel(form *huh.Form) Model

func (Model) Init

func (m Model) Init() tea.Cmd

func (Model) Update

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

func (Model) View

func (m Model) View() string

type ModelState

type ModelState int
const (
	StatusNormal ModelState = iota
	StatusDone
)

Jump to

Keyboard shortcuts

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