ui

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package ui provides shared terminal styling aligned with the ifc-web brand.

Index

Constants

This section is empty.

Variables

View Source
var (
	Primary  = lipgloss.NewStyle().Foreground(colorPrimary)
	Success  = lipgloss.NewStyle().Foreground(colorSuccess)
	Accent   = lipgloss.NewStyle().Foreground(colorAccent)
	Error    = lipgloss.NewStyle().Foreground(colorError)
	Warning  = lipgloss.NewStyle().Foreground(colorWarning)
	Muted    = lipgloss.NewStyle().Foreground(colorMuted)
	Emphasis = lipgloss.NewStyle().Bold(true)
	Title    = lipgloss.NewStyle().Foreground(colorPrimary).Bold(true)
	Label    = lipgloss.NewStyle().Foreground(colorMuted)
)

Exported styles for reuse across commands and TUI views.

Functions

func Apply

func Apply(style lipgloss.Style, s string) string

Apply renders s with style when color output is enabled.

func ApplyTextInput

func ApplyTextInput(ti *textinput.Model)

ApplyTextInput applies brand prompt/placeholder styles to a text input.

func ColorEnabled

func ColorEnabled() bool

ColorEnabled reports whether ANSI styling should be applied.

func ColorUnifiedDiff

func ColorUnifiedDiff(diff string) string

ColorUnifiedDiff colors +/−/header lines of a unified diff.

func Divider

func Divider() string

Divider is a faint horizontal rule.

func Errorln

func Errorln(format string, args ...any)

Errorln prints an error message with a red cross (to stdout).

func Field

func Field(label, value string) string

Field renders a "Label: value" confirmation row.

func FormatBreaking

func FormatBreaking(breaking bool) string

FormatBreaking colors a compare breaking flag.

func FormatScore

func FormatScore(score int) string

FormatScore colors a lint quality score.

func Infoln

func Infoln(format string, args ...any)

Infoln prints a muted informational message.

func KeyHints

func KeyHints(text string) string

KeyHints renders footer keybind help.

func ListRow

func ListRow(selected, checked bool, label string) string

ListRow renders a selectable checkbox row.

func PrintMessages

func PrintMessages(messages []string)

PrintMessages styles a batch of command result lines by content heuristics.

func ScreenTitle

func ScreenTitle(title string) string

ScreenTitle renders "ifc · <title>" with a divider, for TUI screens.

func Section

func Section(text string) string

Section renders a section heading inside a TUI step.

func StartSpinner

func StartSpinner(message string) (stop func())

StartSpinner shows an animated waiting indicator on stderr until stop is called. When stderr is not a TTY (or NO_COLOR is set), it prints a static message once.

func StatusKind

func StatusKind(kind string) string

StatusKind styles a status label (clean/modified/new/missing/error) to width 10.

func Successln

func Successln(format string, args ...any)

Successln prints a success message with a green checkmark.

func Warnln

func Warnln(format string, args ...any)

Warnln prints a warning message.

func Wordmark

func Wordmark() string

Wordmark returns a short branded mark for headers.

Types

This section is empty.

Jump to

Keyboard shortcuts

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