tui better
This commit is contained in:
+40
-8
@@ -1,36 +1,68 @@
|
||||
package tui
|
||||
|
||||
import (
|
||||
"charm.land/bubbles/v2/textarea"
|
||||
"charm.land/bubbles/v2/textinput"
|
||||
"charm.land/lipgloss/v2"
|
||||
)
|
||||
|
||||
var (
|
||||
appBorder = lipgloss.NewStyle().
|
||||
Border(lipgloss.RoundedBorder()).
|
||||
BorderForeground(lipgloss.Color("62")).
|
||||
Padding(1, 2)
|
||||
|
||||
titleStyle = lipgloss.NewStyle().
|
||||
Bold(true).
|
||||
Foreground(lipgloss.Color("117")).
|
||||
MarginBottom(1)
|
||||
|
||||
labelStyle = lipgloss.NewStyle().
|
||||
Foreground(lipgloss.Color("244")).
|
||||
Width(20)
|
||||
Foreground(lipgloss.Color("250"))
|
||||
|
||||
focusedStyle = lipgloss.NewStyle().
|
||||
Foreground(lipgloss.Color("39"))
|
||||
Bold(true).
|
||||
Foreground(lipgloss.Color("117"))
|
||||
|
||||
checkBoxChecked = "[x]"
|
||||
checkBoxUnchecked = "[ ]"
|
||||
checkedStyle = lipgloss.NewStyle().
|
||||
Foreground(lipgloss.Color("82"))
|
||||
|
||||
uncheckedStyle = lipgloss.NewStyle().
|
||||
Foreground(lipgloss.Color("250"))
|
||||
|
||||
footerStyle = lipgloss.NewStyle().
|
||||
MarginTop(1).
|
||||
Foreground(lipgloss.Color("241"))
|
||||
Foreground(lipgloss.Color("248"))
|
||||
|
||||
errorStyle = lipgloss.NewStyle().
|
||||
Foreground(lipgloss.Color("196")).
|
||||
Foreground(lipgloss.Color("203")).
|
||||
Bold(true)
|
||||
|
||||
successStyle = lipgloss.NewStyle().
|
||||
Foreground(lipgloss.Color("46"))
|
||||
Foreground(lipgloss.Color("82")).
|
||||
Bold(true)
|
||||
)
|
||||
|
||||
func getDefaultInputStyles(isDark bool) textinput.Styles {
|
||||
s := textinput.DefaultStyles(isDark)
|
||||
s.Focused.Prompt = lipgloss.NewStyle().Foreground(lipgloss.Color("117")).Bold(true)
|
||||
s.Focused.Text = lipgloss.NewStyle().Foreground(lipgloss.Color("255"))
|
||||
s.Focused.Placeholder = lipgloss.NewStyle().Foreground(lipgloss.Color("243"))
|
||||
s.Blurred.Prompt = lipgloss.NewStyle().Foreground(lipgloss.Color("245"))
|
||||
s.Blurred.Text = lipgloss.NewStyle().Foreground(lipgloss.Color("245"))
|
||||
s.Blurred.Placeholder = lipgloss.NewStyle().Foreground(lipgloss.Color("240"))
|
||||
return s
|
||||
}
|
||||
|
||||
func getDefaultTextareaStyles(isDark bool) textarea.Styles {
|
||||
s := textarea.DefaultStyles(isDark)
|
||||
s.Focused.Prompt = lipgloss.NewStyle().Foreground(lipgloss.Color("117")).Bold(true)
|
||||
s.Focused.Text = lipgloss.NewStyle().Foreground(lipgloss.Color("255"))
|
||||
s.Focused.Placeholder = lipgloss.NewStyle().Foreground(lipgloss.Color("243"))
|
||||
s.Focused.Base = lipgloss.NewStyle().Foreground(lipgloss.Color("255"))
|
||||
s.Blurred.Prompt = lipgloss.NewStyle().Foreground(lipgloss.Color("245"))
|
||||
s.Blurred.Text = lipgloss.NewStyle().Foreground(lipgloss.Color("245"))
|
||||
s.Blurred.Placeholder = lipgloss.NewStyle().Foreground(lipgloss.Color("240"))
|
||||
s.Blurred.Base = lipgloss.NewStyle().Foreground(lipgloss.Color("245"))
|
||||
return s
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user