ui

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MenuAccent      = compat.AdaptiveColor{Light: lipgloss.Color("130"), Dark: lipgloss.Color("173")}
	MenuAccentLight = compat.AdaptiveColor{Light: lipgloss.Color("137"), Dark: lipgloss.Color("180")}
	MenuText        = compat.AdaptiveColor{Light: lipgloss.Color("235"), Dark: lipgloss.Color("252")}
	MenuTextDim     = compat.AdaptiveColor{Light: lipgloss.Color("243"), Dark: lipgloss.Color("243")}
	MenuDim         = compat.AdaptiveColor{Light: lipgloss.Color("250"), Dark: lipgloss.Color("238")}
	MenuTableHeader = compat.AdaptiveColor{Light: lipgloss.Color("130"), Dark: lipgloss.Color("180")}

	DebugStyle = lipgloss.NewStyle().
				Border(lipgloss.RoundedBorder(), true).
				BorderForeground(compat.AdaptiveColor{Light: lipgloss.Color("124"), Dark: lipgloss.Color("124")})
)

Earth-tone palette for menus — ANSI 256 colors with light/dark adaptivity.

Functions

func CenterView added in v1.4.0

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

CenterView wraps content in centered placement within the available area.

func FormatStatus

func FormatStatus(s store.GameStatus) string

FormatStatus converts a GameStatus enum to a human-readable display string.

func InitContinueTable

func InitContinueTable(s *store.Store, height int) (table.Model, []store.GameRecord)

InitContinueTable loads saved games from the store and builds the table widget. Returns the table, the loaded games, and the column definitions.

func InitList

func InitList(items []list.Item, title string) list.Model

InitList creates a styled list widget with the standard puzzletea theme.

func ListHeight added in v1.4.0

func ListHeight(l list.Model) int

ListHeight returns the minimum height needed to display all items in a single page, avoiding pagination. The bubbles list component has a circular dependency between pagination visibility and PerPage calculation that causes rendering glitches when pages change, so we size the list to prevent pagination entirely when the terminal is tall enough.

Types

type MenuItem struct {
	ItemTitle string
	Desc      string
}

MenuItem is a simple list.Item implementation for menu entries.

func (i MenuItem) Description() string
func (i MenuItem) FilterValue() string
func (i MenuItem) Title() string

Jump to

Keyboard shortcuts

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