Documentation
¶
Index ¶
- Constants
- Variables
- func AlertSourceIcon(source string) string
- func AlertSourceName(source string) string
- func RenderAlertSource(source string) string
- func RenderEmail(email string) string
- func RenderHelpItem(key, desc string) string
- func RenderLink(url, text string) string
- func RenderMarkdown(text string, width int) string
- func RenderNameWithEmail(name, email string) string
- func RenderSeverity(severity string) string
- func RenderSeveritySignal(severity string) string
- func RenderStatus(status string) string
- func RenderStatusDot(status string) string
- func RenderURL(url string) string
Constants ¶
const ( SpacingNone = 0 SpacingSmall = 1 SpacingMedium = 2 SpacingLarge = 3 )
Spacing constants (padding and margin)
Variables ¶
var ( ColorPrimary = lipgloss.Color("#7C3AED") // Purple ColorSecondary = lipgloss.Color("#6366F1") // Indigo ColorSuccess = lipgloss.Color("#10B981") // Green ColorWarning = lipgloss.Color("#F59E0B") // Amber ColorDanger = lipgloss.Color("#EF4444") // Red ColorInfo = lipgloss.Color("#4D96FF") // Blue ColorMuted = lipgloss.Color("#6B7280") // Gray ColorText = lipgloss.Color("#F9FAFB") // Light ColorTextDim = lipgloss.Color("#9CA3AF") // Dimmed ColorBackground = lipgloss.Color("#1F2937") // Dark ColorBorder = lipgloss.Color("#374151") // Border gray ColorHighlight = lipgloss.Color("#8B5CF6") // Lighter purple )
Color palette (Rootly brand colors)
var ( ColorPastelRed = lipgloss.Color("#F87171") // Soft red ColorPastelYellow = lipgloss.Color("#FBBF24") // Soft amber ColorPastelGreen = lipgloss.Color("#34D399") // Soft green ColorPastelGray = lipgloss.Color("#9CA3AF") // Soft gray )
Pastel colors for status text
var ( ColorCritical = lipgloss.Color("#DC2626") // Dark red ColorHigh = lipgloss.Color("#EA580C") // Orange ColorMedium = lipgloss.Color("#CA8A04") // Yellow ColorLow = lipgloss.Color("#2563EB") // Blue )
Severity colors
var ( Primary = lipgloss.NewStyle().Foreground(ColorPrimary) Secondary = lipgloss.NewStyle().Foreground(ColorSecondary) Success = lipgloss.NewStyle().Foreground(ColorSuccess) Warning = lipgloss.NewStyle().Foreground(ColorWarning) Danger = lipgloss.NewStyle().Foreground(ColorDanger) Info = lipgloss.NewStyle().Foreground(ColorInfo) Muted = lipgloss.NewStyle().Foreground(ColorMuted) Text = lipgloss.NewStyle().Foreground(ColorText) TextDim = lipgloss.NewStyle().Foreground(ColorTextDim) TextBold = lipgloss.NewStyle().Foreground(ColorText).Bold(true) )
Text styles
var ( App = lipgloss.NewStyle(). Padding(SpacingSmall, SpacingMedium) Header = lipgloss.NewStyle(). Bold(true). Foreground(ColorText). Padding(SpacingNone, SpacingMedium). MarginBottom(SpacingSmall) Title = lipgloss.NewStyle(). Bold(true). Foreground(ColorText) // Tab styles TabActive = lipgloss.NewStyle(). Bold(true). Foreground(ColorPrimary). Underline(true). Padding(SpacingNone, SpacingMedium) TabInactive = lipgloss.NewStyle(). Foreground(ColorTextDim). Padding(SpacingNone, SpacingMedium) // List styles ListContainer = lipgloss.NewStyle(). Border(lipgloss.RoundedBorder()). BorderForeground(ColorBorder). Padding(SpacingNone, SpacingSmall) ListItem = lipgloss.NewStyle(). Foreground(ColorText). Padding(SpacingNone, SpacingSmall) ListItemSelected = lipgloss.NewStyle(). Foreground(ColorHighlight). Bold(true). Padding(SpacingNone, SpacingSmall) // Detail pane styles DetailContainer = lipgloss.NewStyle(). Border(lipgloss.RoundedBorder()). BorderForeground(ColorBorder). Padding(SpacingSmall, SpacingMedium) DetailContainerFocused = lipgloss.NewStyle(). Border(lipgloss.RoundedBorder()). BorderForeground(ColorPrimary). Padding(SpacingSmall, SpacingMedium) DetailTitle = lipgloss.NewStyle(). Bold(true). Foreground(ColorPrimary). MarginBottom(SpacingSmall) DetailLabel = lipgloss.NewStyle(). Foreground(ColorTextDim). Width(15) DetailValue = lipgloss.NewStyle(). Foreground(ColorText) // Status styles (pastel text colors, no background) StatusActive = lipgloss.NewStyle(). Foreground(ColorPastelRed) StatusInProgress = lipgloss.NewStyle(). Foreground(ColorPastelYellow) StatusResolved = lipgloss.NewStyle(). Foreground(ColorPastelGreen) StatusMuted = lipgloss.NewStyle(). Foreground(ColorPastelGray) // Severity badges SeverityCritical = lipgloss.NewStyle(). Foreground(ColorText). Background(ColorCritical). Padding(SpacingNone, SpacingSmall). Bold(true) SeverityHigh = lipgloss.NewStyle(). Foreground(ColorText). Background(ColorHigh). Padding(SpacingNone, SpacingSmall). Bold(true) SeverityMedium = lipgloss.NewStyle(). Foreground(lipgloss.Color("#000000")). Background(ColorMedium). Padding(SpacingNone, SpacingSmall). Bold(true) SeverityLow = lipgloss.NewStyle(). Foreground(ColorText). Background(ColorLow). Padding(SpacingNone, SpacingSmall). Bold(true) // Input styles InputLabel = lipgloss.NewStyle(). Foreground(ColorText). Bold(true). MarginBottom(SpacingSmall) InputField = lipgloss.NewStyle(). Border(lipgloss.RoundedBorder()). BorderForeground(ColorBorder). Padding(SpacingNone, SpacingSmall). Width(50) InputFieldFocused = lipgloss.NewStyle(). Border(lipgloss.RoundedBorder()). BorderForeground(ColorPrimary). Padding(SpacingNone, SpacingSmall). Width(50) // Button styles Button = lipgloss.NewStyle(). Foreground(ColorText). Background(ColorMuted). Padding(SpacingNone, SpacingMedium). MarginRight(SpacingSmall) ButtonFocused = lipgloss.NewStyle(). Foreground(ColorText). Background(ColorPrimary). Padding(SpacingNone, SpacingMedium). MarginRight(SpacingSmall) // Dialog styles Dialog = lipgloss.NewStyle(). Border(lipgloss.RoundedBorder()). BorderForeground(ColorPrimary). Padding(SpacingMedium, SpacingLarge+SpacingSmall). Width(60) DialogTitle = lipgloss.NewStyle(). Bold(true). Foreground(ColorPrimary). MarginBottom(SpacingSmall) // Help bar HelpBar = lipgloss.NewStyle(). Foreground(ColorTextDim). MarginTop(SpacingSmall) HelpKey = lipgloss.NewStyle(). Foreground(ColorPrimary). Bold(true) HelpDesc = lipgloss.NewStyle(). Foreground(ColorTextDim) // Status bar StatusBar = lipgloss.NewStyle(). Foreground(ColorTextDim). MarginTop(SpacingSmall) // Error/Success messages Error = lipgloss.NewStyle(). Foreground(ColorDanger). Bold(true) SuccessMsg = lipgloss.NewStyle(). Foreground(ColorSuccess). Bold(true) // Spinner Spinner = lipgloss.NewStyle(). Foreground(ColorPrimary) // Status indicators DotActive = lipgloss.NewStyle(). Foreground(ColorSuccess). SetString("●") DotWarning = lipgloss.NewStyle(). Foreground(ColorWarning). SetString("●") DotDanger = lipgloss.NewStyle(). Foreground(ColorDanger). SetString("●") DotMuted = lipgloss.NewStyle(). Foreground(ColorMuted). SetString("○") )
Layout styles
var ( SignalCritical = lipgloss.NewStyle().Foreground(ColorCritical).Bold(true) SignalHigh = lipgloss.NewStyle().Foreground(ColorHigh).Bold(true) SignalMedium = lipgloss.NewStyle().Foreground(ColorMedium).Bold(true) SignalLow = lipgloss.NewStyle().Foreground(ColorLow).Bold(true) )
Signal bar severity indicators
Functions ¶
func AlertSourceIcon ¶
AlertSourceIcon returns just the emoji icon for an alert source
func AlertSourceName ¶
AlertSourceName returns the human-readable name for an alert source
func RenderAlertSource ¶
func RenderEmail ¶
RenderEmail renders an email as a clickable mailto link
func RenderHelpItem ¶
func RenderLink ¶
RenderLink renders a clickable hyperlink using OSC 8 escape sequences Most modern terminals support this (iTerm2, Kitty, Windows Terminal, etc.)
func RenderMarkdown ¶
RenderMarkdown renders markdown text for terminal display using glamour Falls back to plain text if rendering fails
func RenderNameWithEmail ¶
RenderNameWithEmail renders a name with email in format "Name [email]" where email is clickable
func RenderSeverity ¶
func RenderSeveritySignal ¶
RenderSeveritySignal renders severity as signal bars (▁▃▅▇)
func RenderStatus ¶
func RenderStatusDot ¶
Types ¶
This section is empty.