ui

package
v0.0.0-...-ac25f0a Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const Version = "v0.4.0"

Variables

View Source
var (
	// Colors
	ColorPrimary   = lipgloss.Color("39")  // blue
	ColorSuccess   = lipgloss.Color("82")  // green
	ColorWarning   = lipgloss.Color("214") // yellow
	ColorError     = lipgloss.Color("196") // red
	ColorSubtle    = lipgloss.Color("241") // gray
	ColorHighlight = lipgloss.Color("212") // pink

	// Text styles
	Bold    = lipgloss.NewStyle().Bold(true)
	Success = lipgloss.NewStyle().Foreground(ColorSuccess)
	Warning = lipgloss.NewStyle().Foreground(ColorWarning)
	Error   = lipgloss.NewStyle().Foreground(ColorError)
	Subtle  = lipgloss.NewStyle().Foreground(ColorSubtle)

	// Banner style
	BannerStyle = lipgloss.NewStyle().
				Border(lipgloss.RoundedBorder()).
				BorderForeground(ColorPrimary).
				Padding(0, 2)

	// Results box style
	ResultsStyle = lipgloss.NewStyle().
					Border(lipgloss.RoundedBorder()).
					BorderForeground(ColorSubtle).
					Padding(0, 1)

	// Menu item styles
	MenuSelected   = lipgloss.NewStyle().Foreground(ColorPrimary).Bold(true)
	MenuUnselected = lipgloss.NewStyle().Foreground(lipgloss.Color("252"))
	MenuCursor     = lipgloss.NewStyle().Foreground(ColorPrimary).SetString("> ")
	MenuNoCursor   = lipgloss.NewStyle().SetString("  ")
)

Functions

func Banner() string

Banner returns the styled welcome banner.

func FormatError

func FormatError(msg string) string

FormatError formats an error message.

func FormatFileCreated

func FormatFileCreated(path string) string

FormatFileCreated formats a file creation message.

func FormatFileSkipped

func FormatFileSkipped(name, reason string) string

FormatFileSkipped formats a file skip message.

func FormatFileUpdated

func FormatFileUpdated(path string) string

FormatFileUpdated formats a file update message.

func FormatResults

func FormatResults(info *analyzer.ProjectInfo) string

FormatResults formats detection results as a styled box.

func IsTTY

func IsTTY() bool

IsTTY returns true if stdout is a terminal.

func TermHeight

func TermHeight() int

TermHeight returns the terminal height, defaulting to 24 if detection fails.

func TermWidth

func TermWidth() int

TermWidth returns the terminal width, defaulting to 80 if detection fails.

Types

type FormatSelectModel

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

FormatSelectModel is a bubbletea model for selecting output format.

func NewFormatSelectModel

func NewFormatSelectModel() FormatSelectModel

NewFormatSelectModel creates a format selection prompt.

func (FormatSelectModel) Chosen

func (m FormatSelectModel) Chosen() bool

Chosen returns true if user made a selection.

func (FormatSelectModel) Init

func (m FormatSelectModel) Init() tea.Cmd

func (FormatSelectModel) SelectedFormat

func (m FormatSelectModel) SelectedFormat() string

SelectedFormat returns the chosen format string.

func (FormatSelectModel) Update

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

func (FormatSelectModel) View

func (m FormatSelectModel) View() string
type MenuItem struct {
	Title string
	Key   string
}

MenuItem represents an option in the menu.

type MenuModel struct {
	Title string
	Items []MenuItem
	// contains filtered or unexported fields
}

MenuModel is a bubbletea model for arrow-key menu navigation.

func NewMenuModel

func NewMenuModel(title string, items []MenuItem) MenuModel

NewMenuModel creates a new menu model.

func (m MenuModel) Chosen() bool

Chosen returns true if the user made a selection.

func (m MenuModel) Init() tea.Cmd
func (m MenuModel) Selected() int

Selected returns the index of the selected item, or -1 if quit.

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

type ScanDoneMsg

type ScanDoneMsg struct{}

ScanDoneMsg signals that scanning is complete.

type SpinnerModel

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

SpinnerModel wraps bubbles spinner for scanning animation.

func NewSpinnerModel

func NewSpinnerModel(message string) SpinnerModel

NewSpinnerModel creates a spinner with a scanning message.

func (SpinnerModel) Init

func (m SpinnerModel) Init() tea.Cmd

func (SpinnerModel) Update

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

func (SpinnerModel) View

func (m SpinnerModel) View() string

Jump to

Keyboard shortcuts

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