ui

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2026 License: Apache-2.0 Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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 Finfoln added in v0.0.2

func Finfoln(w io.Writer, format string, args ...any)

Finfoln is Infoln writing to w.

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 FprintMessages added in v0.0.2

func FprintMessages(w io.Writer, messages []string)

FprintMessages is PrintMessages writing to w.

func Fsuccessln added in v0.0.2

func Fsuccessln(w io.Writer, format string, args ...any)

Fsuccessln is Successln writing to w.

func Fwarnln added in v0.0.2

func Fwarnln(w io.Writer, format string, args ...any)

Fwarnln is Warnln writing to w.

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