1package ui23import (4 "charm.land/lipgloss/v2"5 "github.com/FelineStateMachine/puzzletea/theme"6)78// MenuAccent returns the primary accent color from the active theme.9func MenuAccent() lipgloss.Style { return lipgloss.NewStyle().Foreground(theme.Current().Accent) }1011// DebugStyle returns the style for the debug overlay border.12func DebugStyle() lipgloss.Style {13 return lipgloss.NewStyle().14 Border(lipgloss.RoundedBorder(), true).15 BorderForeground(theme.Current().Error)16}1718// ErrorNoticeStyle returns the style for user-visible error notices.19func ErrorNoticeStyle() lipgloss.Style {20 return lipgloss.NewStyle().21 Border(lipgloss.RoundedBorder()).22 BorderForeground(theme.Current().Error).23 Foreground(theme.Current().Error).24 Padding(0, 1)25}2627// SuccessNoticeStyle returns the style for user-visible success notices.28func SuccessNoticeStyle() lipgloss.Style {29 return lipgloss.NewStyle().30 Border(lipgloss.RoundedBorder()).31 BorderForeground(theme.Current().SuccessBorder).32 Foreground(theme.Current().Success).33 Padding(0, 1)34}3536// LogoStyle returns the style for the ASCII art brand logo.37func LogoStyle() lipgloss.Style {38 p := theme.Current()39 return lipgloss.NewStyle().40 Bold(true).41 Foreground(theme.TextOnBG(p.Accent)).42 Background(p.Accent).43 Padding(0, 1).44 Margin(1, 0)45}4647// MainMenuFrame returns the frame for the main menu.48func MainMenuFrame() lipgloss.Style {49 return lipgloss.NewStyle().50 Border(lipgloss.RoundedBorder()).51 BorderForeground(theme.Current().Accent).52 Padding(2, 4)53}5455// PanelFrame returns the rounded-border frame for sub-menus.56func PanelFrame() lipgloss.Style {57 return lipgloss.NewStyle().58 Border(lipgloss.RoundedBorder()).59 BorderForeground(theme.Current().Border).60 Padding(2, 4)61}6263// PanelTitle returns the style for panel title text.64func PanelTitle() lipgloss.Style {65 return lipgloss.NewStyle().66 Bold(true).67 Foreground(theme.Current().Accent)68}6970// FooterHint returns the style for navigation hint text.71func FooterHint() lipgloss.Style {72 return lipgloss.NewStyle().73 Foreground(theme.Current().TextDim)74}7576// CursorStyle returns the style for the active cursor indicator in menus.77func CursorStyle() lipgloss.Style {78 return lipgloss.NewStyle().79 Foreground(theme.Current().Accent).80 Bold(true)81}8283// SelectedItemStyle returns the style for the highlighted menu item title.84func SelectedItemStyle() lipgloss.Style {85 return lipgloss.NewStyle().86 Foreground(theme.Current().Accent).87 Bold(true)88}8990// NormalItemStyle returns the style for non-selected menu item titles.91func NormalItemStyle() lipgloss.Style {92 return lipgloss.NewStyle().93 Foreground(theme.Current().FG)94}9596// DimItemStyle returns the style for descriptions and secondary text.97func DimItemStyle() lipgloss.Style {98 return lipgloss.NewStyle().99 Foreground(theme.Current().TextDim)100}101102// GeneratingFrame returns the frame style for the generating spinner box.103func GeneratingFrame() lipgloss.Style {104 return lipgloss.NewStyle().105 Border(lipgloss.RoundedBorder()).106 BorderForeground(theme.Current().Accent).107 Padding(1, 3)108}109110// CenterView wraps content in centered placement within the available area.111func CenterView(width, height int, content string) string {112 return lipgloss.Place(width, height, lipgloss.Center, lipgloss.Center, content)113}