mirror of
https://github.com/zoriya/bubbles.git
synced 2026-08-16 01:43:21 +00:00
chore(list): update for Lip Gloss v2
This commit is contained in:
+1
-1
@@ -197,7 +197,7 @@ type Model struct {
|
|||||||
|
|
||||||
// New returns a new model with sensible defaults.
|
// New returns a new model with sensible defaults.
|
||||||
func New(items []Item, delegate ItemDelegate, width, height int) Model {
|
func New(items []Item, delegate ItemDelegate, width, height int) Model {
|
||||||
styles := DefaultStyles()
|
styles := DarkStyles()
|
||||||
|
|
||||||
sp := spinner.New()
|
sp := spinner.New()
|
||||||
sp.Spinner = spinner.Line
|
sp.Spinner = spinner.Line
|
||||||
|
|||||||
+22
-10
@@ -39,11 +39,23 @@ type Styles struct {
|
|||||||
DividerDot lipgloss.Style
|
DividerDot lipgloss.Style
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// LightStyles returns a set of light style definitions for this list Bubble.
|
||||||
|
func LightStyles() Styles {
|
||||||
|
return newStyles(false)
|
||||||
|
}
|
||||||
|
|
||||||
|
// DarkStyles returns a set of dark style definitions for this list Bubble.
|
||||||
|
func DarkStyles() Styles {
|
||||||
|
return newStyles(true)
|
||||||
|
}
|
||||||
|
|
||||||
// DefaultStyles returns a set of default style definitions for this list
|
// DefaultStyles returns a set of default style definitions for this list
|
||||||
// component.
|
// component.
|
||||||
func DefaultStyles() (s Styles) {
|
func newStyles(isDark bool) (s Styles) {
|
||||||
verySubduedColor := lipgloss.AdaptiveColor{Light: "#DDDADA", Dark: "#3C3C3C"}
|
lightDark := lipgloss.LightDark(isDark)
|
||||||
subduedColor := lipgloss.AdaptiveColor{Light: "#9B9B9B", Dark: "#5C5C5C"}
|
|
||||||
|
verySubduedColor := lightDark("#DDDADA", "#3C3C3C")
|
||||||
|
subduedColor := lightDark("#9B9B9B", "#5C5C5C")
|
||||||
|
|
||||||
s.TitleBar = lipgloss.NewStyle().Padding(0, 0, 1, 2)
|
s.TitleBar = lipgloss.NewStyle().Padding(0, 0, 1, 2)
|
||||||
|
|
||||||
@@ -53,29 +65,29 @@ func DefaultStyles() (s Styles) {
|
|||||||
Padding(0, 1)
|
Padding(0, 1)
|
||||||
|
|
||||||
s.Spinner = lipgloss.NewStyle().
|
s.Spinner = lipgloss.NewStyle().
|
||||||
Foreground(lipgloss.AdaptiveColor{Light: "#8E8E8E", Dark: "#747373"})
|
Foreground(lightDark("#8E8E8E", "#747373"))
|
||||||
|
|
||||||
s.FilterPrompt = lipgloss.NewStyle().
|
s.FilterPrompt = lipgloss.NewStyle().
|
||||||
Foreground(lipgloss.AdaptiveColor{Light: "#04B575", Dark: "#ECFD65"})
|
Foreground(lightDark("#04B575", "#ECFD65"))
|
||||||
|
|
||||||
s.FilterCursor = lipgloss.NewStyle().
|
s.FilterCursor = lipgloss.NewStyle().
|
||||||
Foreground(lipgloss.AdaptiveColor{Light: "#EE6FF8", Dark: "#EE6FF8"})
|
Foreground(lightDark("#EE6FF8", "#EE6FF8"))
|
||||||
|
|
||||||
s.DefaultFilterCharacterMatch = lipgloss.NewStyle().Underline(true)
|
s.DefaultFilterCharacterMatch = lipgloss.NewStyle().Underline(true)
|
||||||
|
|
||||||
s.StatusBar = lipgloss.NewStyle().
|
s.StatusBar = lipgloss.NewStyle().
|
||||||
Foreground(lipgloss.AdaptiveColor{Light: "#A49FA5", Dark: "#777777"}).
|
Foreground(lightDark("#A49FA5", "#777777")).
|
||||||
Padding(0, 0, 1, 2)
|
Padding(0, 0, 1, 2)
|
||||||
|
|
||||||
s.StatusEmpty = lipgloss.NewStyle().Foreground(subduedColor)
|
s.StatusEmpty = lipgloss.NewStyle().Foreground(subduedColor)
|
||||||
|
|
||||||
s.StatusBarActiveFilter = lipgloss.NewStyle().
|
s.StatusBarActiveFilter = lipgloss.NewStyle().
|
||||||
Foreground(lipgloss.AdaptiveColor{Light: "#1a1a1a", Dark: "#dddddd"})
|
Foreground(lightDark("#1a1a1a", "#dddddd"))
|
||||||
|
|
||||||
s.StatusBarFilterCount = lipgloss.NewStyle().Foreground(verySubduedColor)
|
s.StatusBarFilterCount = lipgloss.NewStyle().Foreground(verySubduedColor)
|
||||||
|
|
||||||
s.NoItems = lipgloss.NewStyle().
|
s.NoItems = lipgloss.NewStyle().
|
||||||
Foreground(lipgloss.AdaptiveColor{Light: "#909090", Dark: "#626262"})
|
Foreground(lightDark("#909090", "#626262"))
|
||||||
|
|
||||||
s.ArabicPagination = lipgloss.NewStyle().Foreground(subduedColor)
|
s.ArabicPagination = lipgloss.NewStyle().Foreground(subduedColor)
|
||||||
|
|
||||||
@@ -84,7 +96,7 @@ func DefaultStyles() (s Styles) {
|
|||||||
s.HelpStyle = lipgloss.NewStyle().Padding(1, 0, 0, 2)
|
s.HelpStyle = lipgloss.NewStyle().Padding(1, 0, 0, 2)
|
||||||
|
|
||||||
s.ActivePaginationDot = lipgloss.NewStyle().
|
s.ActivePaginationDot = lipgloss.NewStyle().
|
||||||
Foreground(lipgloss.AdaptiveColor{Light: "#847A85", Dark: "#979797"}).
|
Foreground(lightDark("#847A85", "#979797")).
|
||||||
SetString(bullet)
|
SetString(bullet)
|
||||||
|
|
||||||
s.InactivePaginationDot = lipgloss.NewStyle().
|
s.InactivePaginationDot = lipgloss.NewStyle().
|
||||||
|
|||||||
Reference in New Issue
Block a user