Documentation
¶
Overview ¶
Package styles provides consistent styling and theming for the Kion CLI. It defines brand colors, interactive prompt themes, and output formatting styles used throughout the application.
Index ¶
- Variables
- type OutputStyles
- func (s *OutputStyles) RenderCheck(label string, passed bool) string
- func (s *OutputStyles) RenderDetail(text string) string
- func (s *OutputStyles) RenderError(text string) string
- func (s *OutputStyles) RenderFix(text string) string
- func (s *OutputStyles) RenderMainHeader(text string) string
- func (s *OutputStyles) RenderNote(text string) string
- func (s *OutputStyles) RenderSectionHeader(text string) string
- func (s *OutputStyles) RenderSeparator() string
- func (s *OutputStyles) RenderWarning(text string) string
Constants ¶
This section is empty.
Variables ¶
var ( // Black is the primary dark color used for backgrounds and contrast Black = lipgloss.AdaptiveColor{Light: "#101C21", Dark: "#101C21"} // Green is the primary accent color used for highlights and selections Green = lipgloss.AdaptiveColor{Light: "#0D9668", Dark: "#61D7AC"} // Mint is used for primary text - light on dark terminals, dark on light terminals Mint = lipgloss.AdaptiveColor{Light: "#1A202C", Dark: "#F3F7F4"} )
Kion brand colors - primary palette These use AdaptiveColor to work on both light and dark terminal backgrounds
var ( // MutedMint is a softer color for descriptions and secondary text MutedMint = lipgloss.AdaptiveColor{Light: "#4A5568", Dark: "#A8B2A5"} // MutedGray is used for placeholders and disabled elements MutedGray = lipgloss.AdaptiveColor{Light: "#718096", Dark: "#6B7B70"} // SelectionBg is used for selected item backgrounds SelectionBg = lipgloss.AdaptiveColor{Light: "#E2E8F0", Dark: "#4A5568"} )
Muted colors - secondary palette for less prominent elements
var ( // Success indicates successful operations Success = lipgloss.AdaptiveColor{Light: "#0D9668", Dark: "#61D7AC"} // Error indicates errors and failures Error = lipgloss.AdaptiveColor{Light: "#C53030", Dark: "#FF6B6B"} // Warning indicates warnings and cautions Warning = lipgloss.AdaptiveColor{Light: "#B7791F", Dark: "#FFCC66"} // Info indicates informational messages Info = lipgloss.AdaptiveColor{Light: "#2B6CB0", Dark: "#66B2FF"} )
Status colors - semantic colors for feedback Slightly adjusted between light/dark for optimal visibility
var ( // ANSIGreen is ANSI color 10 (bright green) ANSIGreen = lipgloss.Color("10") // ANSIRed is ANSI color 9 (bright red) ANSIRed = lipgloss.Color("9") // ANSIYellow is ANSI color 11 (bright yellow) ANSIYellow = lipgloss.Color("11") // ANSIBlue is ANSI color 12 (bright blue) ANSIBlue = lipgloss.Color("12") // ANSICyan is ANSI color 14 (bright cyan) ANSICyan = lipgloss.Color("14") // ANSIGray is ANSI color 245 (medium gray) ANSIGray = lipgloss.Color("245") // ANSIDarkGray is ANSI color 240 (dark gray) ANSIDarkGray = lipgloss.Color("240") )
ANSI fallback colors - for terminals with limited color support These are used by OutputStyles for CLI output formatting
var FormTheme = newFormTheme()
FormTheme is the cached huh theme for interactive prompts. It is initialized once at package load time for efficiency.
var RequiredValidator = huh.ValidateNotEmpty()
RequiredValidator is a reusable validator that ensures input is not empty.
Functions ¶
This section is empty.
Types ¶
type OutputStyles ¶
type OutputStyles struct {
// Status indicators
CheckMark lipgloss.Style
XMark lipgloss.Style
// Text styles
CheckLabel lipgloss.Style
ErrorText lipgloss.Style
WarningText lipgloss.Style
InfoText lipgloss.Style
DetailText lipgloss.Style
SuccessText lipgloss.Style
// Headers and sections
MainHeader lipgloss.Style
SectionHeader lipgloss.Style
Separator lipgloss.Style
// Boxes and containers
DetailsBox lipgloss.Style
SummaryBox lipgloss.Style
// Layout dimensions
TerminalWidth int
CheckLabelWidth int
}
OutputStyles holds all lipgloss styles for CLI output formatting. Use NewOutputStyles() to create an instance with terminal-aware dimensions.
func NewOutputStyles ¶
func NewOutputStyles() *OutputStyles
NewOutputStyles creates a new set of output styles with terminal-aware dimensions.
func (*OutputStyles) RenderCheck ¶
func (s *OutputStyles) RenderCheck(label string, passed bool) string
RenderCheck renders a check result with label and status indicator.
func (*OutputStyles) RenderDetail ¶
func (s *OutputStyles) RenderDetail(text string) string
RenderDetail renders a detail line (indented gray text).
func (*OutputStyles) RenderError ¶
func (s *OutputStyles) RenderError(text string) string
RenderError renders an error message.
func (*OutputStyles) RenderFix ¶
func (s *OutputStyles) RenderFix(text string) string
RenderFix renders a fix suggestion.
func (*OutputStyles) RenderMainHeader ¶
func (s *OutputStyles) RenderMainHeader(text string) string
RenderMainHeader renders the main header text.
func (*OutputStyles) RenderNote ¶
func (s *OutputStyles) RenderNote(text string) string
RenderNote renders an informational note.
func (*OutputStyles) RenderSectionHeader ¶
func (s *OutputStyles) RenderSectionHeader(text string) string
RenderSectionHeader renders a section header.
func (*OutputStyles) RenderSeparator ¶
func (s *OutputStyles) RenderSeparator() string
RenderSeparator renders a horizontal separator line.
func (*OutputStyles) RenderWarning ¶
func (s *OutputStyles) RenderWarning(text string) string
RenderWarning renders a warning message.