Documentation
¶
Index ¶
- Constants
- Variables
- func Center(content string, width, height int) string
- func FadeIn(content string, opacity float64) string
- func GetAdaptiveStyle(hasColor bool) lipgloss.Style
- func GetContentWidth(terminalWidth int) int
- func RenderBadge(text string, badgeType string) string
- func RenderBox(title, content string, boxType string) string
- func RenderColumns(left, right string, totalWidth int) string
- func RenderConfigReview(config map[string]string) string
- func RenderError(message string) string
- func RenderFormField(label, value, placeholder string, focused bool, required bool) string
- func RenderInfo(message string) string
- func RenderKeyHelp(shortcuts map[string]string) string
- func RenderLogo() string
- func RenderMenu(title, description string, items []string, cursor int) string
- func RenderProgress(current, total int) string
- func RenderSpinner(frame int, message string) string
- func RenderSuccess(message string) string
- func RenderWarning(message string) string
Constants ¶
View Source
const ( StyleSuccess = "success" StyleError = "error" StyleWarning = "warning" StyleInfo = "info" )
Variables ¶
View Source
var ( PrimaryColor = lipgloss.Color("#7C3AED") // Purple SecondaryColor = lipgloss.Color("#06B6D4") // Cyan AccentColor = lipgloss.Color("#10B981") // Green ErrorColor = lipgloss.Color("#EF4444") // Red WarningColor = lipgloss.Color("#F59E0B") // Yellow SuccessColor = lipgloss.Color("#10B981") // Green InfoColor = lipgloss.Color("#3B82F6") // Blue MutedColor = lipgloss.Color("#6B7280") // Gray BorderColor = lipgloss.Color("#374151") // Dark Gray BackgroundColor = lipgloss.Color("#1F2937") // Dark Background TextColor = lipgloss.Color("#F9FAFB") // Light Text HelpColor = lipgloss.Color("#9CA3AF") // Help Text )
Color palette
View Source
var ( // Title styles TitleStyle = lipgloss.NewStyle(). Foreground(PrimaryColor). Bold(true). Align(lipgloss.Center). MarginBottom(1) SubtitleStyle = lipgloss.NewStyle(). Foreground(SecondaryColor). Bold(true). Align(lipgloss.Center). MarginBottom(1) // Text styles DescriptionStyle = lipgloss.NewStyle(). Foreground(MutedColor). Align(lipgloss.Center). MarginBottom(1) InfoStyle = lipgloss.NewStyle(). Foreground(InfoColor) ErrorStyle = lipgloss.NewStyle(). Foreground(ErrorColor) ErrorTitleStyle = lipgloss.NewStyle(). Foreground(ErrorColor). Bold(true). Underline(true) SuccessStyle = lipgloss.NewStyle(). Foreground(SuccessColor). Bold(true) WarningStyle = lipgloss.NewStyle(). Foreground(WarningColor). Bold(true) MutedStyle = lipgloss.NewStyle(). Foreground(MutedColor). Faint(true) AccentStyle = lipgloss.NewStyle(). Foreground(AccentColor). Bold(true) // Menu and navigation styles ItemStyle = lipgloss.NewStyle(). Foreground(TextColor). PaddingLeft(2) SelectedItemStyle = lipgloss.NewStyle(). Foreground(AccentColor). Bold(true). PaddingLeft(2) CursorStyle = lipgloss.NewStyle(). Foreground(AccentColor). Bold(true) // Help and instruction styles HelpStyle = lipgloss.NewStyle(). Foreground(HelpColor). Italic(true). Align(lipgloss.Center). MarginTop(2) // Container styles BorderStyle = lipgloss.NewStyle(). Border(lipgloss.RoundedBorder()). BorderForeground(BorderColor). Padding(1, 2). MarginTop(1). MarginBottom(1) // Form styles InputStyle = lipgloss.NewStyle(). Foreground(TextColor). Background(BackgroundColor). Padding(0, 1). Border(lipgloss.NormalBorder()). BorderForeground(BorderColor) FocusedInputStyle = lipgloss.NewStyle(). Foreground(TextColor). Background(BackgroundColor). Padding(0, 1). Border(lipgloss.NormalBorder()). BorderForeground(AccentColor) LabelStyle = lipgloss.NewStyle(). Foreground(TextColor). Bold(true). MarginRight(1) // Progress styles ProgressBarStyle = lipgloss.NewStyle(). Foreground(AccentColor) ProgressBackgroundStyle = lipgloss.NewStyle(). Foreground(MutedColor). Faint(true) )
Base styles
View Source
var ( OptionStyle = lipgloss.NewStyle(). Foreground(TextColor) SelectedStyle = lipgloss.NewStyle(). Foreground(AccentColor). Bold(true) DisabledStyle = lipgloss.NewStyle(). Foreground(MutedColor). Faint(true) ContinueStyle = lipgloss.NewStyle(). Foreground(InfoColor). Bold(true) FieldLabelStyle = lipgloss.NewStyle(). Foreground(SecondaryColor). Bold(true) FieldValueStyle = lipgloss.NewStyle(). Foreground(TextColor) PlaceholderStyle = lipgloss.NewStyle(). Foreground(MutedColor). Italic(true) ConfirmStyle = lipgloss.NewStyle(). Foreground(WarningColor). Bold(true). MarginTop(1). MarginBottom(1) )
Configuration-specific styles
View Source
var SpinnerFrames = []string{"⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"}
Loading spinner frames
Functions ¶
func GetAdaptiveStyle ¶
Adaptive styles based on terminal capabilities
func RenderColumns ¶
Multi-column layout helper
func RenderConfigReview ¶
Configuration review styles
func RenderError ¶
func RenderFormField ¶
Form field renderer
func RenderInfo ¶
func RenderMenu ¶
Menu container style
func RenderSpinner ¶
func RenderWarning ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.