ui

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package ui holds the lipgloss styles shared by every spoo command, so CLI output and future TUI views render with one visual language.

Index

Constants

This section is empty.

Variables

View Source
var (
	Accent  = lipgloss.Color("#A78BFA") // spoo violet
	Success = lipgloss.Color("#34D399")
	Danger  = lipgloss.Color("#F87171")
	Muted   = lipgloss.Color("#9CA3AF")

	// pastel chart palette (one hue per dashboard panel)
	Blue   = lipgloss.Color("#7DD3FC")
	Yellow = lipgloss.Color("#FDE68A")
	Pink   = lipgloss.Color("#F9A8D4")
	Teal   = lipgloss.Color("#5EEAD4")

	Title   = lipgloss.NewStyle().Bold(true).Foreground(Accent)
	OK      = lipgloss.NewStyle().Bold(true).Foreground(Success)
	Err     = lipgloss.NewStyle().Bold(true).Foreground(Danger)
	Dim     = lipgloss.NewStyle().Foreground(Muted)
	Box     = lipgloss.NewStyle().Border(lipgloss.RoundedBorder()).BorderForeground(Accent).Padding(0, 2)
	KeyHint = lipgloss.NewStyle().Foreground(Muted).Italic(true)
)
View Source
var SparkRunes = []rune("▁▂▃▄▅▆▇█")

SparkRunes are the eight block heights used for sparkline charts.

Functions

func Banner() string

Banner renders the gradient ghost beside the spoo wordmark.

func Bar

func Bar(style BarStyle, value, maxV float64, width int, c color.Color) string

Bar renders a horizontal bar scaled to value/maxV over width columns.

func CountryLabel

func CountryLabel(code string) string

CountryLabel normalizes country codes for display. The backend reports unknown geo as "XX"; everything else passes through as the plain ISO alpha-2 code (no emoji — flag glyph support is too uneven across terminal fonts).

func QR

func QR(text string, invert bool) string

QR renders text as a half-block QR code. The default draws light modules on the terminal's own background — the right contrast for dark terminals; invert flips it for light ones.

Types

type BarStyle

type BarStyle int

BarStyle selects how horizontal bars are drawn.

const (
	BarCapped     BarStyle = iota // ╺━━━╸ on ╌╌ track
	BarUpperHalf                  // ▀▀▀▀ on ·· track
	BarHalf                       // ▄▄▄▄ on ·· track
	BarSegmented                  // ▰▰▰▰ on ▱▱ track
	BarDoubleLine                 // ════ on ── track
	BarFade                       // ██▓▒░ on ·· track
)

Jump to

Keyboard shortcuts

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