···1+// TODO: create variants of colored output without icons
2+// TODO: refactor existing (relevant) calls to old styles
3+// TODO: k v wrappers
4+package ui
5+6+import (
7+ "fmt"
8+9+ "github.com/charmbracelet/lipgloss"
10+)
11+12+func newStyle() lipgloss.Style { return lipgloss.NewStyle() }
13+func newPStyle(v, h int) lipgloss.Style { return lipgloss.NewStyle().Padding(v, h) }
14+func newBoldStyle() lipgloss.Style { return newStyle().Bold(true) }
15+func newPBoldStyle(v, h int) lipgloss.Style { return newPStyle(v, h).Bold(true) }
16+func newEmStyle() lipgloss.Style { return newStyle().Italic(true) }
17+18+func success(msg string) string { return SuccessStyle.Render("โ " + msg) }
19+func errorMsg(msg string) string { return ErrorStyle.Render("โ " + msg) }
20+func warning(msg string) string { return WarningStyle.Render("โ " + msg) }
21+func info(msg string) string { return InfoStyle.Render("โน " + msg) }
22+func title(msg string) string { return TitleStyle.Render(msg) }
23+func subtitle(msg string) string { return SubtitleStyle.Render(msg) }
24+func box(content string) string { return BoxStyle.Render(content) }
25+func errorBox(content string) string { return ErrorBoxStyle.Render(content) }
26+func text(content string) string { return TextStyle.Render(content) }
27+func header(content string) string { return HeaderStyle.Render(content) }
28+29+// Success prints a formatted success message
30+func Success(format string, a ...any) {
31+ fmt.Print(success(fmt.Sprintf(format, a...)))
32+}
33+34+// Successln prints a formatted success message with a newline
35+func Successln(format string, a ...any) {
36+ fmt.Println(success(fmt.Sprintf(format, a...)))
37+}
38+39+// Error prints a formatted error message
40+func Error(format string, a ...any) {
41+ fmt.Print(errorMsg(fmt.Sprintf(format, a...)))
42+}
43+44+// Errorln prints a formatted error message with a newline
45+func Errorln(format string, a ...any) {
46+ fmt.Println(errorMsg(fmt.Sprintf(format, a...)))
47+}
48+49+// Warning prints a formatted warning message
50+func Warning(format string, a ...any) {
51+ fmt.Print(warning(fmt.Sprintf(format, a...)))
52+}
53+54+// Warningln prints a formatted warning message with a newline
55+func Warningln(format string, a ...any) {
56+ fmt.Println(warning(fmt.Sprintf(format, a...)))
57+}
58+59+// Info prints a formatted info message
60+func Info(format string, a ...any) {
61+ fmt.Print(info(fmt.Sprintf(format, a...)))
62+}
63+64+// Infoln prints a formatted info message with a newline
65+func Infoln(format string, a ...any) {
66+ fmt.Println(info(fmt.Sprintf(format, a...)))
67+}
68+69+// Title prints a formatted title
70+func Title(format string, a ...any) {
71+ fmt.Print(title(fmt.Sprintf(format, a...)))
72+}
73+74+// Titleln prints a formatted title with a newline
75+func Titleln(format string, a ...any) {
76+ fmt.Println(title(fmt.Sprintf(format, a...)))
77+}
78+79+// Subtitle prints a formatted subtitle
80+func Subtitle(format string, a ...any) {
81+ fmt.Print(subtitle(fmt.Sprintf(format, a...)))
82+}
83+84+// Subtitleln prints a formatted subtitle with a newline
85+func Subtitleln(format string, a ...any) {
86+ fmt.Println(subtitle(fmt.Sprintf(format, a...)))
87+}
88+89+// Box prints content in a styled box
90+func Box(format string, a ...any) {
91+ fmt.Print(box(fmt.Sprintf(format, a...)))
92+}
93+94+// Boxln prints content in a styled box with a newline
95+func Boxln(format string, a ...any) {
96+ fmt.Println(box(fmt.Sprintf(format, a...)))
97+}
98+99+// ErrorBox prints error content in a styled error box
100+func ErrorBox(format string, a ...any) {
101+ fmt.Print(errorBox(fmt.Sprintf(format, a...)))
102+}
103+104+// ErrorBoxln prints error content in a styled error box with a newline
105+func ErrorBoxln(format string, a ...any) {
106+ fmt.Println(errorBox(fmt.Sprintf(format, a...)))
107+}
108+109+func Newline() { fmt.Println() }
110+func Plain(format string, a ...any) { fmt.Print(text(fmt.Sprintf(format, a...))) }
111+func Plainln(format string, a ...any) { fmt.Println(text(fmt.Sprintf(format, a...))) }
112+func Header(format string, a ...any) { fmt.Print(header(fmt.Sprintf(format, a...))) }
113+func Headerln(format string, a ...any) { fmt.Print(header(fmt.Sprintf(format, a...))) }
+2-1
internal/ui/logo.go
···1// See https://patorjk.com/software/taag/
002package ui
34import (
···78}
7980// Colored returns a colored version of the logo using lipgloss with vertical spiral design
81-//
82// Creates a vertical spiral effect by coloring character by character:
83//
84// Combine line position and character position & use modulo to build wave-like transitions
···1// See https://patorjk.com/software/taag/
2+//
3+// NOTE: these aren't used anymore but are left in because they're cool
4package ui
56import (
···80}
8182// Colored returns a colored version of the logo using lipgloss with vertical spiral design
083// Creates a vertical spiral effect by coloring character by character:
84//
85// Combine line position and character position & use modulo to build wave-like transitions