styles

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

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 Center

func Center(content string, width, height int) string

Center content utility

func FadeIn

func FadeIn(content string, opacity float64) string

Animation helper for transitions

func GetAdaptiveStyle

func GetAdaptiveStyle(hasColor bool) lipgloss.Style

Adaptive styles based on terminal capabilities

func GetContentWidth

func GetContentWidth(terminalWidth int) int

Responsive width calculation

func RenderBadge

func RenderBadge(text string, badgeType string) string

Status badge renderer

func RenderBox

func RenderBox(title, content string, boxType string) string

Box styles for different contexts

func RenderColumns

func RenderColumns(left, right string, totalWidth int) string

Multi-column layout helper

func RenderConfigReview

func RenderConfigReview(config map[string]string) string

Configuration review styles

func RenderError

func RenderError(message string) string

func RenderFormField

func RenderFormField(label, value, placeholder string, focused bool, required bool) string

Form field renderer

func RenderInfo

func RenderInfo(message string) string

func RenderKeyHelp

func RenderKeyHelp(shortcuts map[string]string) string

Key help renderer

func RenderLogo() string

RenderLogo for rendering

func RenderMenu

func RenderMenu(title, description string, items []string, cursor int) string

Menu container style

func RenderProgress

func RenderProgress(current, total int) string

Progress bar renderer

func RenderSpinner

func RenderSpinner(frame int, message string) string

func RenderSuccess

func RenderSuccess(message string) string

Status message styles

func RenderWarning

func RenderWarning(message string) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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