Documentation
¶
Overview ¶
Package ui provides shared terminal styling aligned with the ifc-web brand.
Index ¶
- Variables
- func Apply(style lipgloss.Style, s string) string
- func ApplyTextInput(ti *textinput.Model)
- func ColorEnabled() bool
- func ColorUnifiedDiff(diff string) string
- func Divider() string
- func Errorln(format string, args ...any)
- func Field(label, value string) string
- func FormatBreaking(breaking bool) string
- func FormatScore(score int) string
- func Infoln(format string, args ...any)
- func KeyHints(text string) string
- func ListRow(selected, checked bool, label string) string
- func PrintMessages(messages []string)
- func ScreenTitle(title string) string
- func Section(text string) string
- func StartSpinner(message string) (stop func())
- func StatusKind(kind string) string
- func Successln(format string, args ...any)
- func Warnln(format string, args ...any)
- func Wordmark() string
Constants ¶
This section is empty.
Variables ¶
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 ApplyTextInput ¶
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 ¶
ColorUnifiedDiff colors +/−/header lines of a unified diff.
func FormatBreaking ¶
FormatBreaking colors a compare breaking flag.
func PrintMessages ¶
func PrintMessages(messages []string)
PrintMessages styles a batch of command result lines by content heuristics.
func ScreenTitle ¶
ScreenTitle renders "ifc · <title>" with a divider, for TUI screens.
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 ¶
StatusKind styles a status label (clean/modified/new/missing/error) to width 10.
Types ¶
This section is empty.