style

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package style provides consistent terminal styling using Lipgloss.

Package style provides consistent terminal styling using Lipgloss.

Index

Constants

This section is empty.

Variables

View Source
var (
	// Success style for positive outcomes
	Success = lipgloss.NewStyle().
			Foreground(lipgloss.Color("10")).
			Bold(true)

	// Warning style for cautionary messages
	Warning = lipgloss.NewStyle().
			Foreground(lipgloss.Color("11")).
			Bold(true)

	// Error style for failures
	Error = lipgloss.NewStyle().
			Foreground(lipgloss.Color("9")).
			Bold(true)

	// Info style for informational messages
	Info = lipgloss.NewStyle().
			Foreground(lipgloss.Color("12")) // Blue

	// Dim style for secondary information
	Dim = lipgloss.NewStyle().
		Foreground(lipgloss.Color("8")) // Gray

	// Bold style for emphasis
	Bold = lipgloss.NewStyle().
			Bold(true)

	// SuccessPrefix is the checkmark prefix for success messages
	SuccessPrefix = Success.Render("[OK]")

	// WarningPrefix is the warning prefix
	WarningPrefix = Warning.Render("[!]")

	// ErrorPrefix is the error prefix
	ErrorPrefix = Error.Render("[X]")

	// ArrowPrefix for action indicators
	ArrowPrefix = Info.Render("→")
)

Functions

func DAGProgress

func DAGProgress(steps map[string]string, phases []string) string

DAGProgress renders a DAG progress visualization. steps is a map of step name to status (done, in_progress, ready, blocked).

func MoleculeLifecycleASCII

func MoleculeLifecycleASCII() string

MoleculeLifecycleASCII renders the molecule lifecycle diagram.

func PhaseTable

func PhaseTable() string

PhaseTable renders the molecule phase transition table.

func PrintWarning

func PrintWarning(format string, args ...interface{})

PrintWarning prints a warning message with consistent formatting. The format and args work like fmt.Printf.

func ProgressBar

func ProgressBar(percent int, width int) string

ProgressBar renders a simple progress bar.

func SuggestionBox

func SuggestionBox(message string, suggestions []string, hint string) string

SuggestionBox renders a "did you mean" suggestion box.

Types

type Alignment

type Alignment int

Alignment specifies column text alignment.

const (
	AlignLeft Alignment = iota
	AlignRight
	AlignCenter
)

type Column

type Column struct {
	Name  string
	Width int
	Align Alignment
	Style lipgloss.Style
}

Column defines a table column with name and width.

type Table

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

Table provides styled table rendering.

func NewTable

func NewTable(columns ...Column) *Table

NewTable creates a new table with the given columns.

func (*Table) AddRow

func (t *Table) AddRow(values ...string) *Table

AddRow adds a row of values to the table.

func (*Table) Render

func (t *Table) Render() string

Render returns the formatted table string.

func (*Table) SetHeaderSeparator

func (t *Table) SetHeaderSeparator(enabled bool) *Table

SetHeaderSeparator enables/disables the header separator line.

func (*Table) SetIndent

func (t *Table) SetIndent(indent string) *Table

SetIndent sets the left indent for the table.

Jump to

Keyboard shortcuts

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