Documentation
¶
Overview ¶
Package ui is the shared TUI theme for AgentBBS: one palette and a small set of structural widgets (cards, menu rows, status badges, key bars) so every screen — the hub and each plugin — looks like part of the same product.
Screens keep their own accent color for identity (the hub is green, the arcade amber, the newsreader purple) by constructing a Theme with that accent; the layout primitives are shared.
Index ¶
Constants ¶
const ( Green = lipgloss.Color("#4ade80") Cyan = lipgloss.Color("#38bdf8") Blue = lipgloss.Color("#60a5fa") Gold = lipgloss.Color("#fbbf24") Purple = lipgloss.Color("#c084fc") Red = lipgloss.Color("#f87171") )
Palette — the only colors any screen should reach for.
const ( BadgeOK = "ok" BadgeInfo = "info" BadgeGold = "gold" BadgeWarn = "warn" BadgeMuted = "muted" )
Badge variants.
Variables ¶
var ( // Frame is the outer padding every top-level View should wrap itself in. Frame = lipgloss.NewStyle().Padding(1, 2) // Dim is for secondary text (descriptions, metadata). Dim = lipgloss.NewStyle().Foreground(muted) // Body is primary readable text. Body = lipgloss.NewStyle().Foreground(text) // Danger is for errors and warnings. Danger = lipgloss.NewStyle().Foreground(Red) )
Structural styles shared by every screen.
Functions ¶
Types ¶
type Theme ¶
Theme carries one screen's accent color and renders the shared widgets in it.
func New ¶
New returns a theme that tints titles, sections, card borders, cursors, and selected rows with accent (use a palette color).
func (Theme) Card ¶
Card frames body in a rounded border tinted with the accent. A non-empty title is rendered as a section header at the top of the card.
func (Theme) MenuItem ¶
MenuItem renders one polished menu line shared by the hub and the plugin menus (PRD §4.1): an accent cursor and bold label when selected, an optional status badge after the label, and — to keep long menus uncluttered — the description shown only for the focused row. The result ends in a newline.
func (Theme) Row ¶
Row renders one selectable menu line: an accent cursor and bold label when selected, with a dimmed description on the next line. An empty desc yields a single-line row. The returned string ends in a newline.