feat(textarea): add helpers for default light and dark styles

This commit is contained in:
Christian Rocha
2024-11-05 21:38:29 -05:00
parent 148439f15d
commit fc0fa7807e
+11 -1
View File
@@ -290,7 +290,7 @@ func New() Model {
vp.KeyMap = viewport.KeyMap{}
cur := cursor.New()
styles := DefaultStyles(true)
styles := DefaultDarkStyles()
m := Model{
CharLimit: defaultCharLimit,
@@ -348,6 +348,16 @@ func DefaultStyles(isDark bool) Styles {
return s
}
// DefaultLightStyles returns the default styles for a light background.
func DefaultLightStyles() Styles {
return DefaultStyles(false)
}
// DefaultDarkStyles returns the default styles for a dark background.
func DefaultDarkStyles() Styles {
return DefaultStyles(true)
}
// SetValue sets the value of the text input.
func (m *Model) SetValue(s string) {
m.Reset()