ui

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	NeonTheme = ThemePalette{
		Primary:    "#626262",
		Secondary:  "#00f6ff",
		Text:       "#FAFAFA",
		Gray:       "#626262",
		Tertiary:   "#FF2A6D",
		Quaternary: "#FF2A6D",
		Quinary:    "#FF2A6D",
		Senary:     "#FF2A6D",
		Septenary:  "#39FF14",
	}

	CyberpunkTheme = ThemePalette{
		Primary:    "#FCEE0A",
		Secondary:  "#00F0FF",
		Text:       "#FAFAFA",
		Gray:       "#626262",
		Tertiary:   "#FF2A6D",
		Quaternary: "#ffa600ff",
		Quinary:    "#FF2A6D",
		Senary:     "#00F0FF",
		Septenary:  "#39FF14",
	}
)

Définition des palettes de couleurs prédéfinies

View Source
var DefaultKeyMap = KeyMap{
	Up: key.NewBinding(
		key.WithKeys("up", "k"),
		key.WithHelp("↑/k", "haut"),
	),
	Down: key.NewBinding(
		key.WithKeys("down", "j"),
		key.WithHelp("↓/j", "bas"),
	),
	Left: key.NewBinding(
		key.WithKeys("left", "h"),
		key.WithHelp("←/h", "catégorie préc."),
	),
	Right: key.NewBinding(
		key.WithKeys("right", "l"),
		key.WithHelp("→/l", "catégorie suiv."),
	),
	Tab: key.NewBinding(
		key.WithKeys("tab"),
		key.WithHelp("tab", "changer section"),
	),
	ToggleTheme: key.NewBinding(
		key.WithKeys("t"),
		key.WithHelp("t", "changer thème"),
	),
	Enter: key.NewBinding(
		key.WithKeys("enter"),
		key.WithHelp("enter", "valider"),
	),
	Help: key.NewBinding(
		key.WithKeys("?", ","),
		key.WithHelp("?", "aide"),
	),
	Quit: key.NewBinding(
		key.WithKeys("q", "ctrl+c"),
		key.WithHelp("q", "quitter"),
	),
}

Configuration des touches par défaut (support navigation Vim et flèches)

Functions

This section is empty.

Types

type FocusState

type FocusState int

États possibles du focus clavier (Navigation onglets vs Liste outils)

const (
	FocusCategories FocusState = iota
	FocusTools
)

type KeyMap

type KeyMap struct {
	Up          key.Binding
	Down        key.Binding
	Left        key.Binding
	Right       key.Binding
	Tab         key.Binding
	Enter       key.Binding
	Help        key.Binding
	Quit        key.Binding
	ToggleTheme key.Binding
}

Définition de tous les raccourcis clavier disponibles dans l'application

func (KeyMap) FullHelp

func (k KeyMap) FullHelp() [][]key.Binding

func (KeyMap) ShortHelp

func (k KeyMap) ShortHelp() []key.Binding

Implémentation de l'interface d'aide

type Model

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

Modèle principal contenant l'état global de l'application et l'outil actif

func NewModel

func NewModel() Model

Initialisation du modèle avec chargement du thème et des catégories

func (Model) Init

func (m Model) Init() tea.Cmd

func (Model) Update

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

func (Model) View

func (m Model) View() string

type Styles

type Styles struct {
	Doc          lipgloss.Style
	Title        lipgloss.Style
	ActiveTab    lipgloss.Style
	InactiveTab  lipgloss.Style
	Window       lipgloss.Style
	SelectedTool lipgloss.Style
	Tool         lipgloss.Style
	ToolName     lipgloss.Style
	ToolDesc     lipgloss.Style
	Help         help.Styles
	Palette      ThemePalette
}

Regroupe l'ensemble des styles Lipgloss et Help basés sur la palette active

func MakeStyles

func MakeStyles(t ThemePalette) Styles

Génère l'ensemble des styles de l'interface à partir de la palette fournie

type ThemePalette

type ThemePalette struct {
	Primary    string
	Secondary  string
	Text       string
	Gray       string
	Tertiary   string
	Quaternary string
	Quinary    string
	Senary     string
	Septenary  string
}

Structure définissant la palette de couleurs utilisée pour le thème

Jump to

Keyboard shortcuts

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