tui

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: May 2, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ColorAccent  = lipgloss.AdaptiveColor{Light: "#7C3AED", Dark: "#A78BFA"}
	ColorMuted   = lipgloss.AdaptiveColor{Light: "#6B7280", Dark: "#9CA3AF"}
	ColorOK      = lipgloss.AdaptiveColor{Light: "#059669", Dark: "#34D399"}
	ColorWarn    = lipgloss.AdaptiveColor{Light: "#D97706", Dark: "#FBBF24"}
	ColorErr     = lipgloss.AdaptiveColor{Light: "#DC2626", Dark: "#F87171"}
	ColorBorder  = lipgloss.AdaptiveColor{Light: "#A78BFA", Dark: "#7C3AED"}
	ColorCommand = lipgloss.AdaptiveColor{Light: "#0369A1", Dark: "#38BDF8"}
)
View Source
var (
	Title = lipgloss.NewStyle().
			Bold(true).
			Foreground(ColorAccent).
			MarginRight(1)

	Subtle = lipgloss.NewStyle().
			Foreground(ColorMuted)

	OK = lipgloss.NewStyle().
		Foreground(ColorOK).
		Bold(true)

	Warn = lipgloss.NewStyle().
			Foreground(ColorWarn).
			Bold(true)

	Err = lipgloss.NewStyle().
		Foreground(ColorErr).
		Bold(true)

	Cmd = lipgloss.NewStyle().
		Foreground(ColorCommand).
		Bold(true)

	Card = lipgloss.NewStyle().
			Border(lipgloss.RoundedBorder()).
			BorderForeground(ColorBorder).
			Padding(0, 2).
			Width(64)

	CardTitle = lipgloss.NewStyle().
				Bold(true).
				Foreground(ColorAccent).
				MarginBottom(1)

	KV = lipgloss.NewStyle().
		Foreground(ColorMuted)

	KVValue = lipgloss.NewStyle().
			Bold(true)

	Hint = lipgloss.NewStyle().
			Foreground(ColorMuted).
			Italic(true)

	RiskLow    = lipgloss.NewStyle().Foreground(ColorOK).Bold(true)
	RiskMed    = lipgloss.NewStyle().Foreground(ColorWarn).Bold(true)
	RiskHigh   = lipgloss.NewStyle().Foreground(ColorErr).Bold(true)
	Highlight  = lipgloss.NewStyle().Reverse(true).Padding(0, 1)
	MenuItem   = lipgloss.NewStyle().Padding(0, 2)
	MenuActive = lipgloss.NewStyle().Padding(0, 2).Foreground(ColorAccent).Bold(true)
)

Functions

func IsTTY

func IsTTY() bool

func RenderApprovalCard

func RenderApprovalCard(v ApprovalView) string

func RenderApprovalPrompt

func RenderApprovalPrompt() string

func RiskColor

func RiskColor(level string) lipgloss.Style

func RunDashboard

func RunDashboard(data DashboardData) (string, error)

func Width

func Width() int

Types

type Action

type Action struct {
	Key     string
	Command string
	Title   string
	Desc    string
}

type ApprovalView

type ApprovalView struct {
	Action      string
	Risk        string
	Description string
	Input       string
	Preview     string
}

type DashboardData

type DashboardData struct {
	RepoRoot     string
	Branch       string
	Base         string
	Ahead        int
	Behind       int
	ChangedFiles int
	OverlapCount int
	RiskLevel    string
	HasAIKey     bool
	NotInRepo    bool
	Version      string
}

type Stream

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

func NewStream

func NewStream() *Stream

func (*Stream) Done

func (s *Stream) Done(label string)

func (*Stream) Fail

func (s *Stream) Fail(label string)

func (*Stream) Info

func (s *Stream) Info(label string)

func (*Stream) Println

func (s *Stream) Println(line string)

func (*Stream) Start

func (s *Stream) Start(label string)

func (*Stream) Update

func (s *Stream) Update(label string)

Jump to

Keyboard shortcuts

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