ui

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DraculaBackground = lipgloss.AdaptiveColor{Light: "0", Dark: "0"}
	DraculaForeground = lipgloss.AdaptiveColor{Light: "255", Dark: "255"}
	DraculaPurple     = lipgloss.AdaptiveColor{Light: "5", Dark: "5"}
	DraculaPink       = lipgloss.AdaptiveColor{Light: "13", Dark: "13"}
	DraculaCyan       = lipgloss.AdaptiveColor{Light: "14", Dark: "14"}
	DraculaGreen      = lipgloss.AdaptiveColor{Light: "10", Dark: "10"}
	DraculaComment    = lipgloss.AdaptiveColor{Light: "7", Dark: "7"}
	DraculaOrange     = lipgloss.AdaptiveColor{Light: "3", Dark: "3"}
	DraculaRed        = lipgloss.AdaptiveColor{Light: "1", Dark: "1"}

	// Tab bar styles
	ActiveTabStyle = lipgloss.NewStyle().
					Foreground(DraculaPink).
					Bold(true).
					Padding(0, 1)
	InactiveTabStyle = lipgloss.NewStyle().
						Foreground(DraculaComment).
						Padding(0, 1)

	// List styles
	TitleStyle = lipgloss.NewStyle().
				Foreground(DraculaPink).
				Bold(true).
				Padding(0, 1)

	// Detail view styles
	DetailTitleStyle = lipgloss.NewStyle().
						Foreground(DraculaPink).
						Bold(true)
	DetailTaglineStyle = lipgloss.NewStyle().
						Foreground(DraculaCyan).
						Italic(true)

	// Status bar
	StatusBarStyle = lipgloss.NewStyle().
					Foreground(DraculaComment)
	ErrorStyle = lipgloss.NewStyle().
				Foreground(DraculaRed)

	// Help
	HelpKeyStyle = lipgloss.NewStyle().
					Foreground(DraculaPink).
					Bold(true)
	HelpDescStyle = lipgloss.NewStyle().
					Foreground(DraculaForeground)

	SelectedItemStyle = lipgloss.NewStyle().
						BorderLeft(true).
						BorderStyle(lipgloss.NormalBorder()).
						BorderForeground(DraculaPink).
						PaddingLeft(1)

	// Date bar styles
	DateArrowStyle = lipgloss.NewStyle().
					Foreground(DraculaComment)
	DateItemStyle = lipgloss.NewStyle().
					Foreground(DraculaCyan)
	DateItemActiveStyle = lipgloss.NewStyle().
						Foreground(DraculaPink).
						Bold(true)
	DateItemDimStyle = lipgloss.NewStyle().
						Foreground(DraculaComment)
)

16-color ANSI Dracula palette (identical to lazyadmin)

Functions

This section is empty.

Types

type Model

type Model struct {
	// contains filtered or unexported fields
}

Model is the main TUI model

func NewModel

func NewModel(source types.ProductSource) Model

NewModel creates a new Model with the given ProductSource

func (Model) Init

func (m Model) Init() tea.Cmd

Init starts the initial leaderboard fetch

func (Model) Update

func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd)

Update handles all messages

func (Model) View

func (m Model) View() string

View renders the UI

type ProductDelegate

type ProductDelegate struct {
	// contains filtered or unexported fields
}

func NewProductDelegate

func NewProductDelegate() ProductDelegate

func (ProductDelegate) Height

func (d ProductDelegate) Height() int

Height returns the height of a list item (3 lines)

func (ProductDelegate) Render

func (d ProductDelegate) Render(w io.Writer, m list.Model, index int, item list.Item)

Render renders a single product item using the shared renderProductItem.

func (ProductDelegate) Spacing

func (d ProductDelegate) Spacing() int

Spacing returns the spacing between list items

func (ProductDelegate) Update

func (d ProductDelegate) Update(msg tea.Msg, m *list.Model) tea.Cmd

Update handles updates for the delegate (no-op for products)

type ViewState

type ViewState int

ViewState represents the current view mode

const (
	ListView ViewState = iota
	DetailView
)

Jump to

Keyboard shortcuts

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