Skip to content

Commit ddab46d

Browse files
authored
chore: bump tuikit version (#231)
1 parent 3deca94 commit ddab46d

File tree

13 files changed

+136
-110
lines changed

13 files changed

+136
-110
lines changed

go.mod

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ require (
1212
github.com/gen2brain/beeep v0.0.0-20240516210008-9c006672e7f4
1313
github.com/jahvon/glamour v0.8.1-patch3
1414
github.com/jahvon/open-golang v0.0.0-20240522004812-68511c3bc9ef
15-
github.com/jahvon/tuikit v0.0.27
15+
github.com/jahvon/tuikit v0.1.2
1616
github.com/mattn/go-runewidth v0.0.16
1717
github.com/onsi/ginkgo/v2 v2.23.4
1818
github.com/onsi/gomega v1.37.0
@@ -23,7 +23,7 @@ require (
2323
go.etcd.io/bbolt v1.4.0
2424
go.uber.org/mock v0.5.2
2525
golang.org/x/crypto v0.38.0
26-
golang.org/x/exp v0.0.0-20250215185904-eff6e970281f
26+
golang.org/x/exp v0.0.0-20250506013437-ce4c2cf36ca6
2727
golang.org/x/sync v0.14.0
2828
gopkg.in/yaml.v3 v3.0.1
2929
mvdan.cc/sh/v3 v3.11.0
@@ -37,11 +37,11 @@ require (
3737
github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect
3838
github.com/aymerick/douceur v0.2.0 // indirect
3939
github.com/catppuccin/go v0.3.0 // indirect
40-
github.com/charmbracelet/colorprofile v0.2.3-0.20250311203215-f60798e515dc // indirect
41-
github.com/charmbracelet/huh v0.6.0 // indirect
42-
github.com/charmbracelet/log v0.4.0 // indirect
40+
github.com/charmbracelet/colorprofile v0.3.1 // indirect
41+
github.com/charmbracelet/huh v0.7.0 // indirect
42+
github.com/charmbracelet/log v0.4.2 // indirect
4343
github.com/charmbracelet/x/ansi v0.8.0 // indirect
44-
github.com/charmbracelet/x/cellbuf v0.0.13-0.20250311204145-2c3ea96c31dd // indirect
44+
github.com/charmbracelet/x/cellbuf v0.0.14-0.20250501183327-ad3bc78c6a81 // indirect
4545
github.com/charmbracelet/x/exp/strings v0.0.0-20250213125511-a0c32e22e4fc // indirect
4646
github.com/charmbracelet/x/term v0.2.1 // indirect
4747
github.com/cpuguy83/go-md2man/v2 v2.0.6 // indirect
@@ -82,9 +82,9 @@ require (
8282
github.com/yuin/goldmark v1.7.8 // indirect
8383
github.com/yuin/goldmark-emoji v1.0.4 // indirect
8484
go.uber.org/automaxprocs v1.6.0 // indirect
85-
golang.org/x/net v0.38.0 // indirect
85+
golang.org/x/net v0.40.0 // indirect
8686
golang.org/x/sys v0.33.0 // indirect
8787
golang.org/x/term v0.32.0 // indirect
8888
golang.org/x/text v0.25.0 // indirect
89-
golang.org/x/tools v0.31.0 // indirect
89+
golang.org/x/tools v0.33.0 // indirect
9090
)

go.sum

Lines changed: 28 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -28,26 +28,34 @@ github.com/charmbracelet/bubbles v0.21.0 h1:9TdC97SdRVg/1aaXNVWfFH3nnLAwOXr8Fn6u
2828
github.com/charmbracelet/bubbles v0.21.0/go.mod h1:HF+v6QUR4HkEpz62dx7ym2xc71/KBHg+zKwJtMw+qtg=
2929
github.com/charmbracelet/bubbletea v1.3.5 h1:JAMNLTbqMOhSwoELIr0qyP4VidFq72/6E9j7HHmRKQc=
3030
github.com/charmbracelet/bubbletea v1.3.5/go.mod h1:TkCnmH+aBd4LrXhXcqrKiYwRs7qyQx5rBgH5fVY3v54=
31-
github.com/charmbracelet/colorprofile v0.2.3-0.20250311203215-f60798e515dc h1:4pZI35227imm7yK2bGPcfpFEmuY1gc2YSTShr4iJBfs=
32-
github.com/charmbracelet/colorprofile v0.2.3-0.20250311203215-f60798e515dc/go.mod h1:X4/0JoqgTIPSFcRA/P6INZzIuyqdFY5rm8tb41s9okk=
33-
github.com/charmbracelet/huh v0.6.0 h1:mZM8VvZGuE0hoDXq6XLxRtgfWyTI3b2jZNKh0xWmax8=
34-
github.com/charmbracelet/huh v0.6.0/go.mod h1:GGNKeWCeNzKpEOh/OJD8WBwTQjV3prFAtQPpLv+AVwU=
31+
github.com/charmbracelet/colorprofile v0.3.1 h1:k8dTHMd7fgw4bnFd7jXTLZrSU/CQrKnL3m+AxCzDz40=
32+
github.com/charmbracelet/colorprofile v0.3.1/go.mod h1:/GkGusxNs8VB/RSOh3fu0TJmQ4ICMMPApIIVn0KszZ0=
33+
github.com/charmbracelet/huh v0.7.0 h1:W8S1uyGETgj9Tuda3/JdVkc3x7DBLZYPZc4c+/rnRdc=
34+
github.com/charmbracelet/huh v0.7.0/go.mod h1:UGC3DZHlgOKHvHC07a5vHag41zzhpPFj34U92sOmyuk=
3535
github.com/charmbracelet/lipgloss v1.1.0 h1:vYXsiLHVkK7fp74RkV7b2kq9+zDLoEU4MZoFqR/noCY=
3636
github.com/charmbracelet/lipgloss v1.1.0/go.mod h1:/6Q8FR2o+kj8rz4Dq0zQc3vYf7X+B0binUUBwA0aL30=
37-
github.com/charmbracelet/log v0.4.0 h1:G9bQAcx8rWA2T3pWvx7YtPTPwgqpk7D68BX21IRW8ZM=
38-
github.com/charmbracelet/log v0.4.0/go.mod h1:63bXt/djrizTec0l11H20t8FDSvA4CRZJ1KH22MdptM=
37+
github.com/charmbracelet/log v0.4.2 h1:hYt8Qj6a8yLnvR+h7MwsJv/XvmBJXiueUcI3cIxsyig=
38+
github.com/charmbracelet/log v0.4.2/go.mod h1:qifHGX/tc7eluv2R6pWIpyHDDrrb/AG71Pf2ysQu5nw=
3939
github.com/charmbracelet/x/ansi v0.8.0 h1:9GTq3xq9caJW8ZrBTe0LIe2fvfLR/bYXKTx2llXn7xE=
4040
github.com/charmbracelet/x/ansi v0.8.0/go.mod h1:wdYl/ONOLHLIVmQaxbIYEC/cRKOQyjTkowiI4blgS9Q=
41-
github.com/charmbracelet/x/cellbuf v0.0.13-0.20250311204145-2c3ea96c31dd h1:vy0GVL4jeHEwG5YOXDmi86oYw2yuYUGqz6a8sLwg0X8=
42-
github.com/charmbracelet/x/cellbuf v0.0.13-0.20250311204145-2c3ea96c31dd/go.mod h1:xe0nKWGd3eJgtqZRaN9RjMtK7xUYchjzPr7q6kcvCCs=
43-
github.com/charmbracelet/x/exp/golden v0.0.0-20241011142426-46044092ad91 h1:payRxjMjKgx2PaCWLZ4p3ro9y97+TVLZNaRZgJwSVDQ=
44-
github.com/charmbracelet/x/exp/golden v0.0.0-20241011142426-46044092ad91/go.mod h1:wDlXFlCrmJ8J+swcL/MnGUuYnqgQdW9rhSD61oNMb6U=
41+
github.com/charmbracelet/x/cellbuf v0.0.14-0.20250501183327-ad3bc78c6a81 h1:iGrflaL5jQW6crML+pZx/ulWAVZQR3CQoRGvFsr2Tyg=
42+
github.com/charmbracelet/x/cellbuf v0.0.14-0.20250501183327-ad3bc78c6a81/go.mod h1:poPFOXFTsJsnLbkV3H2KxAAXT7pdjxxLujLocWjkyzM=
43+
github.com/charmbracelet/x/conpty v0.1.0 h1:4zc8KaIcbiL4mghEON8D72agYtSeIgq8FSThSPQIb+U=
44+
github.com/charmbracelet/x/conpty v0.1.0/go.mod h1:rMFsDJoDwVmiYM10aD4bH2XiRgwI7NYJtQgl5yskjEQ=
45+
github.com/charmbracelet/x/errors v0.0.0-20240508181413-e8d8b6e2de86 h1:JSt3B+U9iqk37QUU2Rvb6DSBYRLtWqFqfxf8l5hOZUA=
46+
github.com/charmbracelet/x/errors v0.0.0-20240508181413-e8d8b6e2de86/go.mod h1:2P0UgXMEa6TsToMSuFqKFQR+fZTO9CNGUNokkPatT/0=
47+
github.com/charmbracelet/x/exp/golden v0.0.0-20250207160936-21c02780d27a h1:FsHEJ52OC4VuTzU8t+n5frMjLvpYWEznSr/u8tnkCYw=
48+
github.com/charmbracelet/x/exp/golden v0.0.0-20250207160936-21c02780d27a/go.mod h1:wDlXFlCrmJ8J+swcL/MnGUuYnqgQdW9rhSD61oNMb6U=
4549
github.com/charmbracelet/x/exp/strings v0.0.0-20250213125511-a0c32e22e4fc h1:k2jFXp3mIsJ1lqGzpABadj9sGInRyk7kTxXfM/Lo1d0=
4650
github.com/charmbracelet/x/exp/strings v0.0.0-20250213125511-a0c32e22e4fc/go.mod h1:pBhA0ybfXv6hDjQUZ7hk1lVxBiUbupdw5R31yPUViVQ=
47-
github.com/charmbracelet/x/exp/teatest v0.0.0-20240919170804-a4978c8e603a h1:sS42HbmCab8rCehUwNO/bQEZQoJ6GavhZyO+245mBwA=
48-
github.com/charmbracelet/x/exp/teatest v0.0.0-20240919170804-a4978c8e603a/go.mod h1:NDRRSMP6bZbCs4jyc4i1/4UG4M+0PEiQdpivQgD0Mio=
51+
github.com/charmbracelet/x/exp/teatest v0.0.0-20250623112707-45752038d08d h1:b8GXylLbV6WaBxHjj4fyBqVzWW66vScY5bbJCwoMBOA=
52+
github.com/charmbracelet/x/exp/teatest v0.0.0-20250623112707-45752038d08d/go.mod h1:MhV4atqUTcHvdaA7Qbkgb0Tvvr+BrH6IW7/i2XW39R8=
4953
github.com/charmbracelet/x/term v0.2.1 h1:AQeHeLZ1OqSXhrAWpYUtZyX1T3zVxfpZuEQMIQaGIAQ=
5054
github.com/charmbracelet/x/term v0.2.1/go.mod h1:oQ4enTYFV7QN4m0i9mzHrViD7TQKvNEEkHUMCmsxdUg=
55+
github.com/charmbracelet/x/termios v0.1.1 h1:o3Q2bT8eqzGnGPOYheoYS8eEleT5ZVNYNy8JawjaNZY=
56+
github.com/charmbracelet/x/termios v0.1.1/go.mod h1:rB7fnv1TgOPOyyKRJ9o+AsTU/vK5WHJ2ivHeut/Pcwo=
57+
github.com/charmbracelet/x/xpty v0.1.2 h1:Pqmu4TEJ8KeA9uSkISKMU3f+C1F6OGBn8ABuGlqCbtI=
58+
github.com/charmbracelet/x/xpty v0.1.2/go.mod h1:XK2Z0id5rtLWcpeNiMYBccNNBrP2IJnzHI0Lq13Xzq4=
5159
github.com/cpuguy83/go-md2man/v2 v2.0.6 h1:XJtiaUW6dEEqVuZiMTn1ldk455QWwEIsMIJlo5vtkx0=
5260
github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g=
5361
github.com/creack/pty v1.1.24 h1:bJrF4RRfyJnbTJqzRLHzcGaZK1NeM5kTC9jGgovnR1s=
@@ -96,8 +104,8 @@ github.com/jahvon/glamour v0.8.1-patch3 h1:LfyMACZavV8yxK4UsPENNQQOqafWuq4ZdLuEA
96104
github.com/jahvon/glamour v0.8.1-patch3/go.mod h1:30MVJwG3rcEHrN277NrA4DKzndSL9lBtEmpcfOygwCQ=
97105
github.com/jahvon/open-golang v0.0.0-20240522004812-68511c3bc9ef h1:4PS/MNVT6Rsv15x5Rtwaw971e6kFvNUAf9nvUsZ5hcc=
98106
github.com/jahvon/open-golang v0.0.0-20240522004812-68511c3bc9ef/go.mod h1:dUmuT5CN6osIeLSRtTPJOf0Yz+qAbcyU6omnCzI+ZfQ=
99-
github.com/jahvon/tuikit v0.0.27 h1:NV+Zzput4twGch+KTwpAOFlR+R/MKtS9DYs3p1sONwg=
100-
github.com/jahvon/tuikit v0.0.27/go.mod h1:zUysbTPUE0tAEB5DfdWvL6AT3g8AZQ+fcwrfUhVXuwA=
107+
github.com/jahvon/tuikit v0.1.2 h1:BGN942W8S89d+hkKxMsUUB50+63T1VgkBamsKwzXpLc=
108+
github.com/jahvon/tuikit v0.1.2/go.mod h1:Bi6zph90IAONRweA/9eUKjVNaxCstxhwubnhFOthEFs=
101109
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
102110
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
103111
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
@@ -182,10 +190,10 @@ go.uber.org/mock v0.5.2 h1:LbtPTcP8A5k9WPXj54PPPbjcI4Y6lhyOZXn+VS7wNko=
182190
go.uber.org/mock v0.5.2/go.mod h1:wLlUxC2vVTPTaE3UD51E0BGOAElKrILxhVSDYQLld5o=
183191
golang.org/x/crypto v0.38.0 h1:jt+WWG8IZlBnVbomuhg2Mdq0+BBQaHbtqHEFEigjUV8=
184192
golang.org/x/crypto v0.38.0/go.mod h1:MvrbAqul58NNYPKnOra203SB9vpuZW0e+RRZV+Ggqjw=
185-
golang.org/x/exp v0.0.0-20250215185904-eff6e970281f h1:oFMYAjX0867ZD2jcNiLBrI9BdpmEkvPyi5YrBGXbamg=
186-
golang.org/x/exp v0.0.0-20250215185904-eff6e970281f/go.mod h1:BHOTPb3L19zxehTsLoJXVaTktb06DFgmdW6Wb9s8jqk=
187-
golang.org/x/net v0.38.0 h1:vRMAPTMaeGqVhG5QyLJHqNDwecKTomGeqbnfZyKlBI8=
188-
golang.org/x/net v0.38.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8=
193+
golang.org/x/exp v0.0.0-20250506013437-ce4c2cf36ca6 h1:y5zboxd6LQAqYIhHnB48p0ByQ/GnQx2BE33L8BOHQkI=
194+
golang.org/x/exp v0.0.0-20250506013437-ce4c2cf36ca6/go.mod h1:U6Lno4MTRCDY+Ba7aCcauB9T60gsv5s4ralQzP72ZoQ=
195+
golang.org/x/net v0.40.0 h1:79Xs7wF06Gbdcg4kdCCIQArK11Z1hr5POQ6+fIYHNuY=
196+
golang.org/x/net v0.40.0/go.mod h1:y0hY0exeL2Pku80/zKK7tpntoX23cqL3Oa6njdgRtds=
189197
golang.org/x/sync v0.14.0 h1:woo0S4Yywslg6hp4eUFjTVOyKt0RookbpAHG4c1HmhQ=
190198
golang.org/x/sync v0.14.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
191199
golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
@@ -196,8 +204,8 @@ golang.org/x/term v0.32.0 h1:DR4lr0TjUs3epypdhTOkMmuF5CDFJ/8pOnbzMZPQ7bg=
196204
golang.org/x/term v0.32.0/go.mod h1:uZG1FhGx848Sqfsq4/DlJr3xGGsYMu/L5GW4abiaEPQ=
197205
golang.org/x/text v0.25.0 h1:qVyWApTSYLk/drJRO5mDlNYskwQznZmkpV2c8q9zls4=
198206
golang.org/x/text v0.25.0/go.mod h1:WEdwpYrmk1qmdHvhkSTNPm3app7v4rsT8F2UD6+VHIA=
199-
golang.org/x/tools v0.31.0 h1:0EedkvKDbh+qistFTd0Bcwe/YLh4vHwWEkiI0toFIBU=
200-
golang.org/x/tools v0.31.0/go.mod h1:naFTU+Cev749tSJRXJlna0T3WxKvb1kWEx15xA4SdmQ=
207+
golang.org/x/tools v0.33.0 h1:4qz2S3zmRxbGIhDIAgjxvFutSvH5EfnsYrRBj0UI0bc=
208+
golang.org/x/tools v0.33.0/go.mod h1:CIJMaWEY88juyUfo7UbgPqbC8rU2OqfAV1h2Qp0oMYI=
201209
google.golang.org/protobuf v1.36.5 h1:tPhr+woSbjfYvY6/GPufUoYizxw1cF/yFoxJ2fmpwlM=
202210
google.golang.org/protobuf v1.36.5/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
203211
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=

internal/context/context.go

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,9 @@ import (
88
"runtime"
99
"strings"
1010

11-
"github.com/charmbracelet/lipgloss"
1211
"github.com/jahvon/tuikit"
1312
"github.com/jahvon/tuikit/io"
14-
"github.com/jahvon/tuikit/styles"
13+
"github.com/jahvon/tuikit/themes"
1514
"github.com/pkg/errors"
1615

1716
"github.com/jahvon/flow/internal/cache"
@@ -81,9 +80,14 @@ func NewContext(ctx context.Context, stdIn, stdOut *os.File) *Context {
8180
CurrentWorkspace: wsConfig,
8281
WorkspacesCache: workspaceCache,
8382
ExecutableCache: executableCache,
84-
Logger: io.NewLogger(stdOut, flowIO.Theme(cfg.Theme.String()), logMode, filesystem.LogsDir()),
85-
stdOut: stdOut,
86-
stdIn: stdIn,
83+
Logger: io.NewLogger(
84+
io.WithOutput(stdOut),
85+
io.WithTheme(flowIO.Theme(cfg.Theme.String())),
86+
io.WithMode(logMode),
87+
io.WithArchiveDirectory(filesystem.LogsDir()),
88+
),
89+
stdOut: stdOut,
90+
stdIn: stdIn,
8791
}
8892

8993
app := tuikit.NewApplication(
@@ -225,48 +229,48 @@ func currentWorkspace(cfg *config.Config) (*workspace.Workspace, error) {
225229
return filesystem.LoadWorkspaceConfig(ws, wsPath)
226230
}
227231

228-
func overrideThemeColor(theme styles.Theme, palette *config.ColorPalette) styles.Theme {
232+
func overrideThemeColor(theme themes.Theme, palette *config.ColorPalette) themes.Theme {
229233
if palette == nil {
230234
return theme
231235
}
232236
if palette.Primary != nil {
233-
theme.PrimaryColor = lipgloss.Color(*palette.Primary)
237+
theme.ColorPalette().Primary = *palette.Primary
234238
}
235239
if palette.Secondary != nil {
236-
theme.SecondaryColor = lipgloss.Color(*palette.Secondary)
240+
theme.ColorPalette().Secondary = *palette.Secondary
237241
}
238242
if palette.Tertiary != nil {
239-
theme.TertiaryColor = lipgloss.Color(*palette.Tertiary)
243+
theme.ColorPalette().Tertiary = *palette.Tertiary
240244
}
241245
if palette.Success != nil {
242-
theme.SuccessColor = lipgloss.Color(*palette.Success)
246+
theme.ColorPalette().Success = *palette.Success
243247
}
244248
if palette.Warning != nil {
245-
theme.WarningColor = lipgloss.Color(*palette.Warning)
249+
theme.ColorPalette().Warning = *palette.Warning
246250
}
247251
if palette.Error != nil {
248-
theme.ErrorColor = lipgloss.Color(*palette.Error)
252+
theme.ColorPalette().Error = *palette.Error
249253
}
250254
if palette.Info != nil {
251-
theme.InfoColor = lipgloss.Color(*palette.Info)
255+
theme.ColorPalette().Info = *palette.Info
252256
}
253257
if palette.Body != nil {
254-
theme.BodyColor = lipgloss.Color(*palette.Body)
258+
theme.ColorPalette().Body = *palette.Body
255259
}
256260
if palette.Emphasis != nil {
257-
theme.EmphasisColor = lipgloss.Color(*palette.Emphasis)
261+
theme.ColorPalette().Emphasis = *palette.Emphasis
258262
}
259263
if palette.White != nil {
260-
theme.White = lipgloss.Color(*palette.White)
264+
theme.ColorPalette().White = *palette.White
261265
}
262266
if palette.Black != nil {
263-
theme.Black = lipgloss.Color(*palette.Black)
267+
theme.ColorPalette().Black = *palette.Black
264268
}
265269
if palette.Gray != nil {
266-
theme.Gray = lipgloss.Color(*palette.Gray)
270+
theme.ColorPalette().Gray = *palette.Gray
267271
}
268272
if palette.CodeStyle != nil {
269-
theme.ChromaCodeStyle = *palette.CodeStyle
273+
theme.ColorPalette().ChromaCodeStyle = *palette.CodeStyle
270274
}
271275
return theme
272276
}

internal/context/context_test.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"testing"
88

99
"github.com/charmbracelet/lipgloss"
10-
"github.com/jahvon/tuikit/styles"
10+
"github.com/jahvon/tuikit/themes"
1111
"github.com/onsi/ginkgo/v2"
1212
. "github.com/onsi/gomega"
1313

@@ -69,14 +69,14 @@ var _ = ginkgo.Describe("Context", func() {
6969
})
7070

7171
ginkgo.Describe("overrideThemeColor", func() {
72-
var theme styles.Theme
72+
var theme themes.Theme
7373
var palette *config.ColorPalette
7474

7575
ginkgo.BeforeEach(func() {
76-
theme = styles.Theme{
77-
PrimaryColor: "#000000",
78-
SecondaryColor: "#FFFFFF",
79-
}
76+
theme = themes.NewTheme("theme", themes.ColorPalette{
77+
Primary: "#000000",
78+
Secondary: "#FFFFFF",
79+
})
8080
palette = &config.ColorPalette{
8181
Primary: strPtr("#FF0000"),
8282
Secondary: strPtr("#00FF00"),
@@ -85,8 +85,8 @@ var _ = ginkgo.Describe("Context", func() {
8585

8686
ginkgo.It("should override the theme colors with the palette colors", func() {
8787
newTheme := overrideThemeColor(theme, palette)
88-
Expect(newTheme.PrimaryColor).To(Equal(lipgloss.Color("#FF0000")))
89-
Expect(newTheme.SecondaryColor).To(Equal(lipgloss.Color("#00FF00")))
88+
Expect(newTheme.ColorPalette().PrimaryColor()).To(Equal(lipgloss.Color("#FF0000")))
89+
Expect(newTheme.ColorPalette().SecondaryColor()).To(Equal(lipgloss.Color("#00FF00")))
9090
})
9191

9292
ginkgo.It("should not change the theme if the palette is nil", func() {

internal/io/executable/views.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66

77
"github.com/atotto/clipboard"
88
"github.com/jahvon/tuikit"
9-
"github.com/jahvon/tuikit/styles"
9+
"github.com/jahvon/tuikit/themes"
1010
"github.com/jahvon/tuikit/types"
1111
"github.com/jahvon/tuikit/views"
1212

@@ -40,7 +40,7 @@ func NewExecutableView(
4040
if err := clipboard.WriteAll(exec.Ref().String()); err != nil {
4141
container.HandleError(fmt.Errorf("unable to copy reference to clipboard: %w", err))
4242
} else {
43-
container.SetNotice("copied reference to clipboard", styles.OutputLevelInfo)
43+
container.SetNotice("copied reference to clipboard", themes.OutputLevelInfo)
4444
}
4545
return nil
4646
},
@@ -109,7 +109,7 @@ func NewTemplateView(
109109
if err := clipboard.WriteAll(template.Location()); err != nil {
110110
container.HandleError(fmt.Errorf("unable to copy location to clipboard: %w", err))
111111
} else {
112-
container.SetNotice("copied location to clipboard", styles.OutputLevelInfo)
112+
container.SetNotice("copied location to clipboard", themes.OutputLevelInfo)
113113
}
114114
return nil
115115
},

internal/io/library/library.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55

66
"github.com/charmbracelet/bubbles/viewport"
77
"github.com/jahvon/tuikit"
8-
"github.com/jahvon/tuikit/styles"
8+
"github.com/jahvon/tuikit/themes"
99
"github.com/jahvon/tuikit/views"
1010

1111
"github.com/jahvon/flow/internal/context"
@@ -30,7 +30,7 @@ type Library struct {
3030
allWorkspaces workspace.WorkspaceList
3131
allExecutables executable.ExecutableList
3232
filter Filter
33-
theme styles.Theme
33+
theme themes.Theme
3434

3535
currentPane, currentWorkspace, currentNamespace, currentExecutable uint
3636
currentFormat, currentHelpPage uint
@@ -51,7 +51,7 @@ func NewLibrary(
5151
workspaces workspace.WorkspaceList,
5252
execs executable.ExecutableList,
5353
filter Filter,
54-
theme styles.Theme,
54+
theme themes.Theme,
5555
runFunc func(string) error,
5656
) *Library {
5757
p1 := viewport.New(0, 0)
@@ -78,7 +78,7 @@ func NewLibraryView(
7878
workspaces workspace.WorkspaceList,
7979
execs executable.ExecutableList,
8080
filter Filter,
81-
theme styles.Theme,
81+
theme themes.Theme,
8282
runFunc func(string) error,
8383
) tuikit.View {
8484
l := NewLibrary(ctx, workspaces, execs, filter, theme, runFunc)

internal/io/library/styles.go

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,51 +6,51 @@ import (
66
"strings"
77

88
"github.com/charmbracelet/lipgloss"
9-
"github.com/jahvon/tuikit/styles"
9+
"github.com/jahvon/tuikit/themes"
1010
"github.com/mattn/go-runewidth"
1111

1212
"github.com/jahvon/flow/types/executable"
1313
)
1414

15-
func renderSelection(s string, theme styles.Theme) string {
16-
style := lipgloss.NewStyle().Foreground(theme.PrimaryColor)
15+
func renderSelection(s string, theme themes.Theme) string {
16+
style := lipgloss.NewStyle().Foreground(theme.ColorPalette().PrimaryColor())
1717
return style.Render(s)
1818
}
1919

20-
func renderSecondarySelection(s string, theme styles.Theme) string {
21-
style := lipgloss.NewStyle().Foreground(theme.TertiaryColor)
20+
func renderSecondarySelection(s string, theme themes.Theme) string {
21+
style := lipgloss.NewStyle().Foreground(theme.ColorPalette().SecondaryColor())
2222
return style.Render(s)
2323
}
2424

25-
func renderInactive(s string, theme styles.Theme) string {
26-
style := lipgloss.NewStyle().Foreground(theme.Gray)
25+
func renderInactive(s string, theme themes.Theme) string {
26+
style := lipgloss.NewStyle().Foreground(theme.ColorPalette().GrayColor())
2727
return style.Render(s)
2828
}
2929

30-
func renderDescription(s string, theme styles.Theme) string {
31-
style := lipgloss.NewStyle().Foreground(theme.BodyColor)
30+
func renderDescription(s string, theme themes.Theme) string {
31+
style := lipgloss.NewStyle().Foreground(theme.ColorPalette().BodyColor())
3232
return style.Render(s)
3333
}
3434

35-
func renderPaneTitle(s string, count int, active bool, theme styles.Theme) string {
35+
func renderPaneTitle(s string, count int, active bool, theme themes.Theme) string {
3636
var title string
3737
if count == 0 {
3838
title = s
3939
} else {
4040
title = fmt.Sprintf("%s (%d)", s, count)
4141
}
42-
style := lipgloss.NewStyle().Foreground(theme.SecondaryColor).Padding(0, 1).Bold(true)
42+
style := lipgloss.NewStyle().Foreground(theme.ColorPalette().SecondaryColor()).Padding(0, 1).Bold(true)
4343
if active {
4444
style = style.Underline(true)
4545
}
4646
return style.Render(title) + "\n\n"
4747
}
4848

49-
func paneStyle(pos int, theme styles.Theme, splitView bool) lipgloss.Style {
49+
func paneStyle(pos int, theme themes.Theme, splitView bool) lipgloss.Style {
5050
style := lipgloss.NewStyle().Padding(0, 1)
5151
if pos == 2 && splitView {
5252
style = style.BorderStyle(lipgloss.OuterHalfBlockBorder()).
53-
BorderForeground(theme.BorderColor).BorderLeft(true)
53+
BorderForeground(theme.ColorPalette().BorderColor()).BorderLeft(true)
5454
}
5555

5656
return style

0 commit comments

Comments
 (0)