ui

package
v0.0.0-...-bb1094a Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2025 License: MIT Imports: 24 Imported by: 0

Documentation

Overview

This module contains colors from github.com/charmbracelet/x/exp/charmtone

See: https://github.com/charmbracelet/x/blob/main/exp/charmtone/charmtone.go

See https://patorjk.com/software/taag/

Index

Constants

View Source
const (
	// U+25CF Black Circle
	StatusTodoSymbol = "●"
	// U+25D0 Circle with Left Half Black
	StatusInProgressSymbol = "◐"
	// U+25A0 Black Square
	StatusBlockedSymbol = "■"
	// U+2713 Check Mark
	StatusDoneSymbol = "✓"
	// U+26AB Medium Black Circle
	StatusAbandonedSymbol = "⚫"
	// U+25CB White Circle
	StatusPendingSymbol = "○"
	// U+2713 Check Mark
	StatusCompletedSymbol = "✓"
	// U+2717 Ballot X
	StatusDeletedSymbol = "✗"
	// U+2605 Black Star
	PriorityHighSymbol = "★"
	// U+2606 White Star
	PriorityMediumSymbol = "☆"
	// U+25E6 White Bullet
	PriorityLowSymbol = "◦"
	// U+25CB White Circle
	PriorityNoneSymbol = "○"
	// Three stars
	PriorityHighPattern = "★★★"
	// Two stars, one outline
	PriorityMediumPattern = "★★☆"
	// One star, two outline
	PriorityLowPattern = "★☆☆"
	// Three outline stars
	PriorityNonePattern = "☆☆☆"
)

Variables

View Source
var (
	Success = lipgloss.NewStyle().
			Foreground(lipgloss.Color(Julep.Hex())).
			Bold(true)

	Error = lipgloss.NewStyle().
			Foreground(lipgloss.Color(Cherry.Hex())).
			Bold(true)

	Info = lipgloss.NewStyle().
			Foreground(lipgloss.Color(Malibu.Hex()))

	Warning = lipgloss.NewStyle().
			Foreground(lipgloss.Color(Citron.Hex())).
			Bold(true)

	Path = lipgloss.NewStyle().
			Foreground(lipgloss.Color(Mustard.Hex())).
			Italic(true)
)
View Source
var (
	TaskTitle = lipgloss.NewStyle().
				Foreground(lipgloss.Color(Salt.Hex())).
				Bold(true)

	TaskID = lipgloss.NewStyle().
			Foreground(lipgloss.Color(Squid.Hex())).
			Width(8)
)
View Source
var (
	StatusPending = lipgloss.NewStyle().
					Foreground(lipgloss.Color(Citron.Hex()))

	StatusCompleted = lipgloss.NewStyle().
					Foreground(lipgloss.Color(Julep.Hex()))
)
View Source
var (
	PriorityHigh = lipgloss.NewStyle().
					Foreground(lipgloss.Color(Cherry.Hex())).
					Bold(true)

	PriorityMedium = lipgloss.NewStyle().
					Foreground(lipgloss.Color(Citron.Hex()))

	PriorityLow = lipgloss.NewStyle().
				Foreground(lipgloss.Color(Squid.Hex()))
)
View Source
var (
	MovieStyle = lipgloss.NewStyle().
				Foreground(lipgloss.Color(Coral.Hex())).
				Bold(true)

	TVStyle = lipgloss.NewStyle().
			Foreground(lipgloss.Color(Violet.Hex())).
			Bold(true)

	BookStyle = lipgloss.NewStyle().
				Foreground(lipgloss.Color(Guac.Hex())).
				Bold(true)

	MusicStyle = lipgloss.NewStyle().
				Foreground(lipgloss.Color(Lichen.Hex())).
				Bold(true)
)
View Source
var (
	TableStyle = lipgloss.NewStyle().
				BorderStyle(lipgloss.NormalBorder()).
				BorderForeground(lipgloss.Color(Smoke.Hex()))

	SelectedStyle = lipgloss.NewStyle().
					Foreground(lipgloss.Color(Salt.Hex())).
					Background(lipgloss.Color(Squid.Hex())).
					Bold(true)

	HeaderStyle = lipgloss.NewStyle().
				BorderStyle(lipgloss.NormalBorder()).
				BorderForeground(lipgloss.Color(Smoke.Hex())).
				BorderBottom(true).
				Bold(false)
)

Table and UI styles

View Source
var (
	// Gray
	TodoStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("8"))
	// Blue
	InProgressStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("12"))
	// Red
	BlockedStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("9"))
	// Green
	DoneStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("10"))
	// Dark Gray
	AbandonedStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("8"))
	// Light Gray
	PendingStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("7"))
	// Green
	CompletedStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("10"))
	// Dark Red
	DeletedStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("1"))
	// Bright Red - highest urgency
	PriorityHighStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("196"))
	// Yellow - medium urgency
	PriorityMediumStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("11"))
	// Cyan - low urgency
	PriorityLowStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("14"))
	// Gray - no priority
	PriorityNoneStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("8"))
	// For legacy A-Z and numeric priorities
	PriorityLegacyStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("13")) // Magenta
)
View Source
var (
	TitleColorStyle    = lipgloss.NewStyle().Foreground(lipgloss.Color(Guac.Hex())).Bold(true)
	SelectedColorStyle = lipgloss.NewStyle().Foreground(lipgloss.Color(Salt.Hex())).Bold(true)
	HeaderColorStyle   = lipgloss.NewStyle().Foreground(lipgloss.Color(Malibu.Hex())).Bold(true)
	StatusColorStyle   = lipgloss.NewStyle().Foreground(lipgloss.Color(Julep.Hex()))
)
View Source
var AdditionColors []Key = []Key{Pickle, Gator, Spinach}
View Source
var DeletionColors []Key = []Key{Pom, Steak, Toast}
View Source
var NoteleafColorScheme fang.ColorSchemeFunc = noteleafColorScheme
View Source
var PrimaryColors []Key = []Key{
	Guac,
	Julep,
	Bok,
	Pickle,
	NeueGuac,
}
View Source
var ProvisionalColors []Key = []Key{NeueGuac, NeueZinc}
View Source
var SecondaryColors []Key = []Key{
	Malibu,
	Sardine,
	Lichen,
}
View Source
var TertiaryColors []Key = []Key{
	Violet,
	Mauve,
	Plum,
	Orchid,
	Charple,
	Hazy,
}

Functions

func FormatPriorityIndicator

func FormatPriorityIndicator(priority string) string

FormatPriorityIndicator returns a styled priority pattern

func FormatPriorityWithText

func FormatPriorityWithText(priority string) string

FormatPriorityWithText returns a styled priority with text description

func FormatStatusIndicator

func FormatStatusIndicator(status string) string

FormatStatusIndicator returns a styled status symbol and text

func FormatStatusWithText

func FormatStatusWithText(status string) string

FormatStatusWithText returns a styled status symbol with status text

func FormatTaskPriority

func FormatTaskPriority(task *models.Task) string

FormatTaskPriority returns a complete priority display with pattern, priority, and description

func FormatTaskStatus

func FormatTaskStatus(task *models.Task) string

FormatTaskStatus returns a complete status display with symbol, status, and description

func GetAllPriorityPatterns

func GetAllPriorityPatterns() map[string]string

GetAllPriorityPatterns returns a map of all priority patterns for reference

func GetAllPrioritySymbols

func GetAllPrioritySymbols() map[string]string

GetAllPrioritySymbols returns a map of all priority symbols for reference

func GetAllStatusSymbols

func GetAllStatusSymbols() map[string]string

GetAllStatusSymbols returns a map of all status symbols for reference

func GetPriorityDescription

func GetPriorityDescription(priority string) string

GetPriorityDescription returns a human-friendly description of the priority

func GetPriorityDisplayType

func GetPriorityDisplayType(priority string) string

GetPriorityDisplayType returns the display type for a priority (text, numeric, or legacy)

func GetPriorityPattern

func GetPriorityPattern(priority string) string

GetPriorityPattern returns the star pattern for a given priority

func GetPriorityStyle

func GetPriorityStyle(priority string) lipgloss.Style

GetPriorityStyle returns the color style for a given priority

func GetPrioritySymbol

func GetPrioritySymbol(priority string) string

GetPrioritySymbol returns the unicode symbol for a given priority

func GetStatusDescription

func GetStatusDescription(status string) string

GetStatusDescription returns a human-friendly description of the status

func GetStatusStyle

func GetStatusStyle(status string) lipgloss.Style

GetStatusStyle returns the color style for a given status

Defaults to pending style

func GetStatusSymbol

func GetStatusSymbol(status string) string

GetStatusSymbol returns the unicode symbol for a given status

Default to pending

func IsValidStatusTransition

func IsValidStatusTransition(from, to string) bool

IsValidStatusTransition checks if a status transition is logically valid

From todo, can go to in-progress, blocked, done, or abandoned
From in-progress, can go to blocked, done, abandoned, or back to todo
From blocked, can go to todo, in-progress, done, or abandoned
From done, can only be reopened to todo or in-progress
From abandoned, can be reopened to todo or in-progress

func PriorityLegend

func PriorityLegend() string

PriorityLegend returns a formatted legend showing all priority patterns

func StatusLegend

func StatusLegend() string

StatusLegend returns a formatted legend showing all status symbols

Types

type BookList

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

BookList handles book search and selection UI

func NewBookList

func NewBookList(service services.APIService, repo *repo.BookRepository, opts BookListOptions) *BookList

NewBookList creates a new book list UI component

func (*BookList) InteractiveSearch

func (bl *BookList) InteractiveSearch(ctx context.Context) error

InteractiveSearch provides an interactive search interface

func (*BookList) SearchAndSelect

func (bl *BookList) SearchAndSelect(ctx context.Context, query string) error

SearchAndSelect searches for books with the given query and allows selection

type BookListOptions

type BookListOptions struct {
	// Output destination (stdout for interactive, buffer for testing)
	Output io.Writer
	// Input source (stdin for interactive, strings reader for testing)
	Input io.Reader
	// Enable static mode (no interactive components)
	Static bool
}

BookListOptions configures the book list UI behavior

type Key

type Key int

Key is a type for color keys.

const (
	Cumin Key = iota
	Tang
	Yam
	Paprika
	Bengal
	Uni
	Sriracha
	Coral
	Salmon
	Chili
	Cherry
	Tuna
	Macaron
	Pony
	Cheeky
	Flamingo
	Dolly
	Blush
	Urchin
	Mochi
	Lilac
	Prince
	Violet
	Mauve
	Grape
	Plum
	Orchid
	Jelly
	Charple
	Hazy
	Ox
	Sapphire
	Guppy
	Oceania
	Thunder
	Anchovy
	Damson
	Malibu
	Sardine
	Zinc
	Turtle
	Lichen
	Guac
	Julep
	Bok
	Mustard
	Citron
	Zest
	Pepper
	BBQ
	Charcoal
	Iron
	Oyster
	Squid
	Smoke
	Ash
	Salt
	Butter

	// Diffs: additions. The brightest color in this set is Julep, defined above.
	Pickle
	Gator
	Spinach

	// Diffs: deletions. The brightest color in this set is Cherry, defined above.
	Pom
	Steak
	Toast

	// Provisional.
	NeueGuac
	NeueZinc
)

func (Key) Hex

func (k Key) Hex() string

func (Key) IsPrimary

func (k Key) IsPrimary() bool

func (Key) IsSecondary

func (k Key) IsSecondary() bool

func (Key) IsTertiary

func (k Key) IsTertiary() bool

func (Key) RGBA

func (k Key) RGBA() (r, g, b, a uint32)

RGBA returns the red, green, blue, and alpha values of the color for interface color.Color

func (Key) String

func (k Key) String() string
type Logo int
const (
	Colossal Logo = iota
	Georgia
	Alligator
	ANSI
	ANSIShadow
)

func (Logo) Colored

func (l Logo) Colored() string

Colored returns a colored version of the logo using lipgloss with vertical spiral design

Creates a vertical spiral effect by coloring character by character:

Combine line position and character position & use modulo to build wave-like transitions

func (Logo) ColoredInViewport

func (l Logo) ColoredInViewport(renderer ...*lipgloss.Renderer) string

ColoredInViewport returns the colored logo rendered inside a viewport bubble

func (Logo) String

func (l Logo) String() string

type NoteList

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

NoteList handles note browsing and viewing UI

func NewNoteList

func NewNoteList(repo *repo.NoteRepository, opts NoteListOptions) *NoteList

NewNoteList creates a new note list UI component

func (*NoteList) Browse

func (nl *NoteList) Browse(ctx context.Context) error

Browse opens an interactive TUI for navigating and viewing notes

type NoteListOptions

type NoteListOptions struct {
	// Output destination (stdout for interactive, buffer for testing)
	Output io.Writer
	// Input source (stdin for interactive, strings reader for testing)
	Input io.Reader
	// Enable static mode (no interactive components)
	Static bool
	// Show archived notes
	ShowArchived bool
	// Filter by tags
	Tags []string
}

NoteListOptions configures the note list UI behavior

type Palette

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

Palette provides semantic color access

func NewPalette

func NewPalette(isDark bool) *Palette

NewPalette creates a new palette instance

type ProjectList

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

ProjectList handles project browsing UI

func NewProjectList

func NewProjectList(repo ProjectRepository, opts ProjectListOptions) *ProjectList

NewProjectList creates a new project list UI component

func (*ProjectList) Browse

func (pl *ProjectList) Browse(ctx context.Context) error

Browse opens an interactive TUI for navigating projects

type ProjectListOptions

type ProjectListOptions struct {
	// Output destination (stdout for interactive, buffer for testing)
	Output io.Writer
	// Input source (stdin for interactive, strings reader for testing)
	Input io.Reader
	// Enable static mode (no interactive components)
	Static bool
}

ProjectListOptions configures the project list UI behavior

type ProjectRepository

type ProjectRepository interface {
	GetProjects(ctx context.Context) ([]repo.ProjectSummary, error)
}

ProjectRepository interface for dependency injection in tests

type TagList

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

TagList handles tag browsing UI

func NewTagList

func NewTagList(repo TagRepository, opts TagListOptions) *TagList

NewTagList creates a new tag list UI component

func (*TagList) Browse

func (tl *TagList) Browse(ctx context.Context) error

Browse opens an interactive TUI for navigating tags

type TagListOptions

type TagListOptions struct {
	// Output destination (stdout for interactive, buffer for testing)
	Output io.Writer
	// Input source (stdin for interactive, strings reader for testing)
	Input io.Reader
	// Enable static mode (no interactive components)
	Static bool
}

TagListOptions configures the tag list UI behavior

type TagRepository

type TagRepository interface {
	GetTags(ctx context.Context) ([]repo.TagSummary, error)
}

TagRepository interface for dependency injection in tests

type TaskEditOptions

type TaskEditOptions struct {
	Output io.Writer
	Input  io.Reader
	Width  int
	Height int
}

type TaskEditor

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

func NewTaskEditor

func NewTaskEditor(task *models.Task, repo TaskRepository, opts TaskEditOptions) *TaskEditor

func (*TaskEditor) Edit

func (te *TaskEditor) Edit(ctx context.Context) (*models.Task, error)

type TaskList

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

TaskList handles task browsing and viewing UI

func NewTaskList

func NewTaskList(repo TaskRepository, opts TaskListOptions) *TaskList

NewTaskList creates a new task list UI component

func (*TaskList) Browse

func (tl *TaskList) Browse(ctx context.Context) error

Browse opens an interactive TUI for navigating and viewing tasks

type TaskListOptions

type TaskListOptions struct {
	// Output destination (stdout for interactive, buffer for testing)
	Output io.Writer
	// Input source (stdin for interactive, strings reader for testing)
	Input io.Reader
	// Enable static mode (no interactive components)
	Static   bool
	Status   string
	Priority string
	Project  string
	ShowAll  bool
}

TaskListOptions configures the task list UI behavior

type TaskRepository

type TaskRepository interface {
	List(ctx context.Context, opts repo.TaskListOptions) ([]*models.Task, error)
	Update(ctx context.Context, task *models.Task) error
}

TaskRepository interface for dependency injection in tests

type TaskView

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

TaskView handles task detail viewing UI

func NewTaskView

func NewTaskView(task *models.Task, opts TaskViewOptions) *TaskView

NewTaskView creates a new task view UI component

func (*TaskView) Show

func (tv *TaskView) Show(ctx context.Context) error

Show displays the task in interactive mode

type TaskViewOptions

type TaskViewOptions struct {
	// Output destination (stdout for interactive, buffer for testing)
	Output io.Writer
	// Input source (stdin for interactive, strings reader for testing)
	Input io.Reader
	// Enable static mode (no interactive components)
	Static bool
	// Width and height for viewport sizing
	Width  int
	Height int
}

TaskViewOptions configures the task view UI behavior

Jump to

Keyboard shortcuts

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