From 9e81121df3f1514d4dd6117d8039823c74395b70 Mon Sep 17 00:00:00 2001 From: Christian Rocha Date: Wed, 21 Aug 2024 17:18:16 -0400 Subject: [PATCH] docs(examples): update tree examples to (mostly) match readme --- examples/tree/makeup/main.go | 17 +++++++++++------ examples/tree/simple/main.go | 16 ++++++++-------- examples/tree/toggle/main.go | 2 +- 3 files changed, 20 insertions(+), 15 deletions(-) diff --git a/examples/tree/makeup/main.go b/examples/tree/makeup/main.go index 2619cf81..b6dca57d 100644 --- a/examples/tree/makeup/main.go +++ b/examples/tree/makeup/main.go @@ -8,22 +8,27 @@ import ( ) func main() { - enumeratorStyle := lipgloss.NewStyle().Foreground(lipgloss.Color("99")).MarginRight(1) - itemStyle := lipgloss.NewStyle().Foreground(lipgloss.Color("212")).MarginRight(1) + enumeratorStyle := lipgloss.NewStyle().Foreground(lipgloss.Color("63")).MarginRight(1) + rootStyle := lipgloss.NewStyle().Foreground(lipgloss.Color("35")) + itemStyle := lipgloss.NewStyle().Foreground(lipgloss.Color("212")) t := tree. - Root("Makeup"). + Root("⁜ Makeup"). Child( "Glossier", - "Claire’s Boutique", + "Fenty Beauty", + tree.New().Child( + "Gloss Bomb Universal Lip Luminizer", + "Hot Cheeks Velour Blushlighter", + ), "Nyx", "Mac", "Milk", ). Enumerator(tree.RoundedEnumerator). EnumeratorStyle(enumeratorStyle). - ItemStyle(itemStyle). - RootStyle(lipgloss.NewStyle().Foreground(lipgloss.Color("#04B575"))) + RootStyle(rootStyle). + ItemStyle(itemStyle) fmt.Println(t) } diff --git a/examples/tree/simple/main.go b/examples/tree/simple/main.go index 718022ed..3969f156 100644 --- a/examples/tree/simple/main.go +++ b/examples/tree/simple/main.go @@ -8,19 +8,19 @@ import ( func main() { t := tree.Root("."). - Child("Item 1"). + Child("macOS"). Child( tree.New(). - Root("Item 2"). - Child("Item 2.1"). - Child("Item 2.2"). - Child("Item 2.3"), + Root("Linux"). + Child("NixOS"). + Child("Arch Linux (btw)"). + Child("Void Linux"), ). Child( tree.New(). - Root("Item 3"). - Child("Item 3.1"). - Child("Item 3.2"), + Root("BSD"). + Child("FreeBSD"). + Child("OpenBSD"), ) fmt.Println(t) diff --git a/examples/tree/toggle/main.go b/examples/tree/toggle/main.go index 0d1a752c..0664e98f 100644 --- a/examples/tree/toggle/main.go +++ b/examples/tree/toggle/main.go @@ -64,7 +64,7 @@ func (s file) String() string { func main() { s := defaultStyles() - t := tree.Root(dir{"~", true, s}). + t := tree.Root(dir{"~/charm", true, s}). Enumerator(tree.RoundedEnumerator). EnumeratorStyle(s.enumerator). Child(