tui

package
v0.0.0-...-3447f05 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package tui provides the text user interface for the claro CLI tool.

Package tui provides the text user interface for the claro CLI tool.

Package tui provides the text user interface for the claro CLI tool.

Package tui provides the text user interface for the claro CLI tool.

Index

Constants

View Source
const (
	DefaultWidth = 80
)

Variables

View Source
var (
	CurrentRepositoryStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("211"))
	DoneStyle              = lipgloss.NewStyle().Margin(1, 2)
	TextStyle              = lipgloss.NewStyle().Margin(1, 2)
	ErrorStyle             = lipgloss.NewStyle().Margin(1, 2).Foreground(lipgloss.AdaptiveColor{Light: "#FF2D27", Dark: "#FF644E"})
	CheckMark              = lipgloss.NewStyle().Foreground(lipgloss.Color("42")).SetString("✓")
	BowtieMark             = lipgloss.NewStyle().Foreground(lipgloss.Color("#F8BA00")).SetString("⧖")
	ErrorMark              = lipgloss.NewStyle().Foreground(lipgloss.Color("#FF2D27")).SetString("𐄂")
)
View Source
var GitHubCliInstalled bool
View Source
var UserGitHubPAT string

Functions

func FormatList

func FormatList(l list.Model, title string) list.Model

FormatList formats a list using the claro default styles

func LongHelpMsg

func LongHelpMsg(shortHelpMsg string) string

func MakeAssignmentsList

func MakeAssignmentsList(listA AssignmentsList) []list.Item

MakeAssignmentsList creates a list of assignments

func MakeClassroomList

func MakeClassroomList(listC ClassroomList) []list.Item

MakeClassroomList creates a list of classrooms

func UseErrorMsg

func UseErrorMsg(cmdName string) string

Types

type AssignmentDirError

type AssignmentDirError string

type AssignmentsList

type AssignmentsList []classroom.Assignment

type ClaroStyles

type ClaroStyles struct {
	Title        lipgloss.Style
	Item         lipgloss.Style
	SelectedItem lipgloss.Style
	Pagination   lipgloss.Style
	Help         lipgloss.Style
	QuitText     lipgloss.Style
	ErrorText    lipgloss.Style
	NormalText   lipgloss.Style
}

ClaroStyles represents the styles used in the Claro TUI

func CreateDefaultStyles

func CreateDefaultStyles() (s ClaroStyles)

CreateDefaultStyles creates the default styles for the Claro TUI

type ClassroomList

type ClassroomList []classroom.Classroom

type ErrorMsg

type ErrorMsg string

type ErrorPullMsg

type ErrorPullMsg string

type Item

type Item struct {
	Id   string
	Name string
	Url  string
}

Item represents an item in the list

func (Item) FilterValue

func (i Item) FilterValue() string

type ItemDelegate

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

ItemDelegate represents the delegate for the list

func NewItemDelegate

func NewItemDelegate(styles *ClaroStyles, keys *KeyMap) *ItemDelegate

NewItemDelegate creates a new ItemDelegate

func (ItemDelegate) Height

func (d ItemDelegate) Height() int

func (ItemDelegate) Render

func (d ItemDelegate) Render(w legal.Writer, m list.Model, index int, listItem list.Item)

func (ItemDelegate) Spacing

func (d ItemDelegate) Spacing() int

func (ItemDelegate) Update

func (d ItemDelegate) Update(_ tea.Msg, _ *list.Model) tea.Cmd

type KeyMap

type KeyMap struct {
	Left  key.Binding
	Right key.Binding
}

func ClaroKeyMap

func ClaroKeyMap() *KeyMap

ClaroKeyMap returns the keybindings for the Claro TUI

func (KeyMap) ShortHelp

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

ShortHelp returns keybindings to be shown in the mini help view. It's part of the key.Map interface.

type NewCommits

type NewCommits string

type SuccessfullMsg

type SuccessfullMsg string

type SuccessfullPullMsg

type SuccessfullPullMsg string

Jump to

Keyboard shortcuts

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