termcast 1.3.30 → 1.3.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/apis/cache.d.ts.map +1 -1
- package/dist/apis/cache.js +4 -39
- package/dist/apis/cache.js.map +1 -1
- package/dist/apis/hud.d.ts.map +1 -1
- package/dist/apis/hud.js +13 -31
- package/dist/apis/hud.js.map +1 -1
- package/dist/apis/localstorage.d.ts.map +1 -1
- package/dist/apis/localstorage.js +3 -27
- package/dist/apis/localstorage.js.map +1 -1
- package/dist/apis/toast.d.ts +16 -43
- package/dist/apis/toast.d.ts.map +1 -1
- package/dist/apis/toast.js +78 -177
- package/dist/apis/toast.js.map +1 -1
- package/dist/build.d.ts +3 -1
- package/dist/build.d.ts.map +1 -1
- package/dist/build.js +52 -2
- package/dist/build.js.map +1 -1
- package/dist/cli.d.ts +1 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +206 -25
- package/dist/cli.js.map +1 -1
- package/dist/colors.d.ts.map +1 -1
- package/dist/colors.js +1 -0
- package/dist/colors.js.map +1 -1
- package/dist/compile.d.ts +0 -1
- package/dist/compile.d.ts.map +1 -1
- package/dist/compile.js +18 -23
- package/dist/compile.js.map +1 -1
- package/dist/components/actions.d.ts.map +1 -1
- package/dist/components/actions.js +30 -15
- package/dist/components/actions.js.map +1 -1
- package/dist/components/animation-tick.d.ts +12 -0
- package/dist/components/animation-tick.d.ts.map +1 -0
- package/dist/components/animation-tick.js +63 -0
- package/dist/components/animation-tick.js.map +1 -0
- package/dist/components/detail.d.ts.map +1 -1
- package/dist/components/detail.js +10 -13
- package/dist/components/detail.js.map +1 -1
- package/dist/components/dropdown.d.ts +1 -0
- package/dist/components/dropdown.d.ts.map +1 -1
- package/dist/components/dropdown.js +27 -26
- package/dist/components/dropdown.js.map +1 -1
- package/dist/components/extension-preferences.d.ts.map +1 -1
- package/dist/components/extension-preferences.js +15 -10
- package/dist/components/extension-preferences.js.map +1 -1
- package/dist/components/footer.d.ts +13 -0
- package/dist/components/footer.d.ts.map +1 -0
- package/dist/components/footer.js +106 -0
- package/dist/components/footer.js.map +1 -0
- package/dist/components/form/file-autocomplete.d.ts +19 -4
- package/dist/components/form/file-autocomplete.d.ts.map +1 -1
- package/dist/components/form/file-autocomplete.js +56 -55
- package/dist/components/form/file-autocomplete.js.map +1 -1
- package/dist/components/form/file-picker.d.ts.map +1 -1
- package/dist/components/form/file-picker.js +26 -15
- package/dist/components/form/file-picker.js.map +1 -1
- package/dist/components/form/index.d.ts.map +1 -1
- package/dist/components/form/index.js +17 -15
- package/dist/components/form/index.js.map +1 -1
- package/dist/components/form/with-left-border.d.ts.map +1 -1
- package/dist/components/form/with-left-border.js +4 -12
- package/dist/components/form/with-left-border.js.map +1 -1
- package/dist/components/list.d.ts.map +1 -1
- package/dist/components/list.js +126 -86
- package/dist/components/list.js.map +1 -1
- package/dist/components/loading-bar.d.ts.map +1 -1
- package/dist/components/loading-bar.js +5 -22
- package/dist/components/loading-bar.js.map +1 -1
- package/dist/components/loading-text.d.ts.map +1 -1
- package/dist/components/loading-text.js +3 -22
- package/dist/components/loading-text.js.map +1 -1
- package/dist/components/theme-picker.d.ts +2 -0
- package/dist/components/theme-picker.d.ts.map +1 -0
- package/dist/components/theme-picker.js +37 -0
- package/dist/components/theme-picker.js.map +1 -0
- package/dist/descendants.d.ts +6 -0
- package/dist/descendants.d.ts.map +1 -1
- package/dist/descendants.js +74 -8
- package/dist/descendants.js.map +1 -1
- package/dist/examples/internal/descendants-rerender.d.ts +14 -0
- package/dist/examples/internal/descendants-rerender.d.ts.map +1 -0
- package/dist/examples/internal/descendants-rerender.js +145 -0
- package/dist/examples/internal/descendants-rerender.js.map +1 -0
- package/dist/examples/internal/simple-dialog.js +4 -1
- package/dist/examples/internal/simple-dialog.js.map +1 -1
- package/dist/examples/internal/simple-scrollbox.js +1 -1
- package/dist/examples/internal/simple-scrollbox.js.map +1 -1
- package/dist/examples/list-with-dropdown.js +1 -1
- package/dist/examples/list-with-dropdown.js.map +1 -1
- package/dist/examples/miscellaneous.js +1 -1
- package/dist/examples/miscellaneous.js.map +1 -1
- package/dist/examples/toast-action.d.ts +2 -0
- package/dist/examples/toast-action.d.ts.map +1 -0
- package/dist/examples/toast-action.js +76 -0
- package/dist/examples/toast-action.js.map +1 -0
- package/dist/examples/toast-variations.js +38 -36
- package/dist/examples/toast-variations.js.map +1 -1
- package/dist/extensions/dev.d.ts +1 -1
- package/dist/extensions/dev.d.ts.map +1 -1
- package/dist/extensions/dev.js +62 -30
- package/dist/extensions/dev.js.map +1 -1
- package/dist/extensions/home.d.ts.map +1 -1
- package/dist/extensions/home.js +4 -3
- package/dist/extensions/home.js.map +1 -1
- package/dist/extensions/react-refresh-init.d.ts +5 -0
- package/dist/extensions/react-refresh-init.d.ts.map +1 -0
- package/dist/extensions/react-refresh-init.js +52 -0
- package/dist/extensions/react-refresh-init.js.map +1 -0
- package/dist/internal/date-picker-widget.js +1 -1
- package/dist/internal/date-picker-widget.js.map +1 -1
- package/dist/internal/dialog.d.ts +8 -3
- package/dist/internal/dialog.d.ts.map +1 -1
- package/dist/internal/dialog.js +37 -53
- package/dist/internal/dialog.js.map +1 -1
- package/dist/internal/navigation.d.ts +1 -0
- package/dist/internal/navigation.d.ts.map +1 -1
- package/dist/internal/navigation.js +25 -1
- package/dist/internal/navigation.js.map +1 -1
- package/dist/internal/providers.d.ts.map +1 -1
- package/dist/internal/providers.js +9 -197
- package/dist/internal/providers.js.map +1 -1
- package/dist/internal/scrollbox.d.ts.map +1 -1
- package/dist/internal/scrollbox.js +1 -0
- package/dist/internal/scrollbox.js.map +1 -1
- package/dist/release.d.ts +1 -0
- package/dist/release.d.ts.map +1 -1
- package/dist/release.js +16 -9
- package/dist/release.js.map +1 -1
- package/dist/state.d.ts +27 -1
- package/dist/state.d.ts.map +1 -1
- package/dist/state.js +6 -0
- package/dist/state.js.map +1 -1
- package/dist/theme.d.ts +6 -19
- package/dist/theme.d.ts.map +1 -1
- package/dist/theme.js +76 -45
- package/dist/theme.js.map +1 -1
- package/dist/themes/aura.json +69 -0
- package/dist/themes/ayu.json +80 -0
- package/dist/themes/catppuccin-frappe.json +233 -0
- package/dist/themes/catppuccin-macchiato.json +233 -0
- package/dist/themes/catppuccin.json +112 -0
- package/dist/themes/cobalt2.json +228 -0
- package/dist/themes/cursor.json +249 -0
- package/dist/themes/dracula.json +219 -0
- package/dist/themes/everforest.json +241 -0
- package/dist/themes/flexoki.json +237 -0
- package/dist/themes/github-light.json +56 -0
- package/dist/themes/github.json +241 -0
- package/dist/themes/gruvbox.json +95 -0
- package/dist/themes/kanagawa.json +77 -0
- package/dist/themes/lucent-orng.json +227 -0
- package/dist/themes/material.json +235 -0
- package/dist/themes/matrix.json +77 -0
- package/dist/themes/mercury.json +245 -0
- package/dist/themes/monokai.json +221 -0
- package/dist/themes/nightowl.json +221 -0
- package/dist/themes/nord.json +223 -0
- package/dist/themes/one-dark.json +84 -0
- package/dist/themes/opencode-light.json +62 -0
- package/dist/themes/opencode.json +245 -0
- package/dist/themes/orng.json +245 -0
- package/dist/themes/palenight.json +222 -0
- package/dist/themes/rosepine.json +234 -0
- package/dist/themes/solarized.json +223 -0
- package/dist/themes/synthwave84.json +226 -0
- package/dist/themes/termcast.json +226 -0
- package/dist/themes/tokyonight.json +243 -0
- package/dist/themes/vercel.json +255 -0
- package/dist/themes/vesper.json +218 -0
- package/dist/themes/zenburn.json +223 -0
- package/dist/themes.d.ts +57 -0
- package/dist/themes.d.ts.map +1 -0
- package/dist/themes.js +181 -0
- package/dist/themes.js.map +1 -0
- package/dist/utils/run-command.d.ts +2 -1
- package/dist/utils/run-command.d.ts.map +1 -1
- package/dist/utils/run-command.js +20 -10
- package/dist/utils/run-command.js.map +1 -1
- package/dist/utils.d.ts +2 -1
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +90 -17
- package/dist/utils.js.map +1 -1
- package/dist/watcher.d.ts +3 -0
- package/dist/watcher.d.ts.map +1 -0
- package/dist/watcher.js +16 -0
- package/dist/watcher.js.map +1 -0
- package/package.json +16 -10
- package/src/apis/cache.tsx +5 -44
- package/src/apis/hud.tsx +17 -62
- package/src/apis/localstorage.tsx +3 -32
- package/src/apis/toast.tsx +91 -275
- package/src/build.test.tsx +10 -0
- package/src/build.tsx +61 -1
- package/src/cli.tsx +365 -103
- package/src/colors.tsx +1 -0
- package/src/compile.tsx +21 -29
- package/src/compile.vitest.tsx +300 -0
- package/src/components/actions.tsx +64 -45
- package/src/components/animation-tick.tsx +85 -0
- package/src/components/detail.tsx +31 -35
- package/src/components/dropdown.tsx +32 -21
- package/src/components/extension-preferences.tsx +14 -10
- package/src/components/footer.tsx +241 -0
- package/src/components/form/file-autocomplete.tsx +80 -60
- package/src/components/form/file-picker.tsx +37 -25
- package/src/components/form/index.tsx +45 -41
- package/src/components/form/with-left-border.tsx +4 -14
- package/src/components/list.tsx +181 -121
- package/src/components/loading-bar.tsx +5 -25
- package/src/components/loading-text.tsx +4 -23
- package/src/components/theme-picker.tsx +57 -0
- package/src/descendants.tsx +98 -9
- package/src/examples/actions-dialog-layout.vitest.tsx +112 -0
- package/src/examples/file-autocomplete.vitest.tsx +131 -122
- package/src/examples/form-basic.vitest.tsx +463 -644
- package/src/examples/form-dropdown.vitest.tsx +553 -571
- package/src/examples/form-scroll.vitest.tsx +112 -102
- package/src/examples/form-tagpicker.vitest.tsx +364 -338
- package/src/examples/internal/descendants-rerender.tsx +273 -0
- package/src/examples/internal/descendants-rerender.vitest.tsx +194 -0
- package/src/examples/internal/simple-dialog.tsx +4 -4
- package/src/examples/internal/simple-scrollbox.tsx +2 -2
- package/src/examples/internal/simple-scrollbox.vitest.tsx +43 -31
- package/src/examples/list-detail-metadata.vitest.tsx +34 -30
- package/src/examples/list-dropdown-default.vitest.tsx +84 -72
- package/src/examples/list-empty-view.vitest.tsx +93 -0
- package/src/examples/list-fetch-data.vitest.tsx +36 -30
- package/src/examples/list-scrollbox.vitest.tsx +59 -39
- package/src/examples/list-with-detail.vitest.tsx +339 -314
- package/src/examples/list-with-dropdown.tsx +1 -0
- package/src/examples/list-with-dropdown.vitest.tsx +176 -150
- package/src/examples/list-with-sections.vitest.tsx +289 -270
- package/src/examples/list-with-toast.vitest.tsx +44 -44
- package/src/examples/miscellaneous.tsx +10 -0
- package/src/examples/simple-file-picker.vitest.tsx +90 -86
- package/src/examples/simple-grid.vitest.tsx +275 -249
- package/src/examples/simple-navigation.vitest.tsx +192 -168
- package/src/examples/store.vitest.tsx +6 -4
- package/src/examples/swift-extension.vitest.tsx +31 -19
- package/src/examples/synonyms.vitest.tsx +93 -83
- package/src/examples/toast-action.tsx +160 -0
- package/src/examples/toast-action.vitest.tsx +404 -0
- package/src/examples/toast-variations.tsx +58 -57
- package/src/examples/toast-variations.vitest.tsx +186 -166
- package/src/extensions/dev.tsx +74 -33
- package/src/extensions/dev.vitest.tsx +162 -69
- package/src/extensions/home.tsx +5 -6
- package/src/extensions/react-refresh-init.tsx +59 -0
- package/src/internal/date-picker-widget.tsx +1 -1
- package/src/internal/dialog.tsx +59 -83
- package/src/internal/navigation.tsx +37 -4
- package/src/internal/providers.tsx +27 -315
- package/src/internal/scrollbox.tsx +1 -0
- package/src/release.tsx +16 -10
- package/src/state.tsx +36 -3
- package/src/theme.tsx +82 -51
- package/src/themes/aura.json +69 -0
- package/src/themes/ayu.json +80 -0
- package/src/themes/catppuccin-frappe.json +233 -0
- package/src/themes/catppuccin-macchiato.json +233 -0
- package/src/themes/catppuccin.json +112 -0
- package/src/themes/cobalt2.json +228 -0
- package/src/themes/cursor.json +249 -0
- package/src/themes/dracula.json +219 -0
- package/src/themes/everforest.json +241 -0
- package/src/themes/flexoki.json +237 -0
- package/src/themes/github-light.json +56 -0
- package/src/themes/github.json +241 -0
- package/src/themes/gruvbox.json +95 -0
- package/src/themes/kanagawa.json +77 -0
- package/src/themes/lucent-orng.json +227 -0
- package/src/themes/material.json +235 -0
- package/src/themes/matrix.json +77 -0
- package/src/themes/mercury.json +252 -0
- package/src/themes/monokai.json +221 -0
- package/src/themes/nightowl.json +221 -0
- package/src/themes/nord.json +223 -0
- package/src/themes/one-dark.json +84 -0
- package/src/themes/opencode-light.json +62 -0
- package/src/themes/opencode.json +245 -0
- package/src/themes/orng.json +245 -0
- package/src/themes/palenight.json +222 -0
- package/src/themes/rosepine.json +234 -0
- package/src/themes/solarized.json +223 -0
- package/src/themes/synthwave84.json +226 -0
- package/src/themes/termcast.json +227 -0
- package/src/themes/tokyonight.json +243 -0
- package/src/themes/vercel.json +255 -0
- package/src/themes/vesper.json +218 -0
- package/src/themes/zenburn.json +223 -0
- package/src/themes.ts +291 -0
- package/src/utils/run-command.tsx +23 -12
- package/src/utils.tsx +115 -18
- package/src/watcher.tsx +19 -0
|
@@ -32,22 +32,24 @@ test('list detail metadata label renders title and text in column layout', async
|
|
|
32
32
|
"
|
|
33
33
|
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
↑↓ navigate
|
|
35
|
+
Metadata Test ────────────────────────────────────────────────────────────
|
|
36
|
+
|
|
37
|
+
> Search...
|
|
38
|
+
|
|
39
|
+
›Item with Metadata
|
|
40
|
+
Another Item │ ▲
|
|
41
|
+
│ ───────────────────────────────── █
|
|
42
|
+
│ ▀
|
|
43
|
+
│ Name:
|
|
44
|
+
│ John Doe
|
|
45
|
+
│
|
|
46
|
+
│ Email:
|
|
47
|
+
│ john@example.com
|
|
48
|
+
│ ─────────────────
|
|
49
|
+
│
|
|
50
|
+
↑↓ navigate ^k actions │ Status: ▼
|
|
51
|
+
|
|
52
|
+
"
|
|
51
53
|
`)
|
|
52
54
|
}, 10000)
|
|
53
55
|
|
|
@@ -68,21 +70,23 @@ test('list detail metadata navigation shows different metadata', async () => {
|
|
|
68
70
|
"
|
|
69
71
|
|
|
70
72
|
|
|
71
|
-
|
|
73
|
+
Metadata Test ────────────────────────────────────────────────────────────
|
|
74
|
+
|
|
75
|
+
> Search...
|
|
76
|
+
|
|
77
|
+
Item with Metadata
|
|
78
|
+
›Another Item │ Info
|
|
79
|
+
│ ──────────────────────────────────
|
|
80
|
+
│
|
|
81
|
+
│ Count:
|
|
82
|
+
│ 42
|
|
83
|
+
│
|
|
84
|
+
│ Price:
|
|
85
|
+
↑↓ navigate ^k actions │ $99.99
|
|
72
86
|
|
|
73
|
-
Search...
|
|
74
87
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
│
|
|
79
|
-
│ Count:
|
|
80
|
-
│ 42
|
|
81
|
-
│
|
|
82
|
-
│ Price:
|
|
83
|
-
│ $99.99
|
|
84
|
-
│
|
|
85
|
-
│
|
|
86
|
-
↑↓ navigate ^k actions │"
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
"
|
|
87
91
|
`)
|
|
88
92
|
}, 10000)
|
|
@@ -31,18 +31,19 @@ test('dropdown defaults to first item when no value is provided', async () => {
|
|
|
31
31
|
"
|
|
32
32
|
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
Dropdown Default Value Example ───────────────────────────────────────────
|
|
35
35
|
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
> Search... Apple ▾
|
|
38
38
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
39
|
+
›First Item This list has a dropdown
|
|
40
|
+
Second Item The dropdown should default to first item
|
|
41
|
+
Vegetables
|
|
42
|
+
Carrot With another dropdown
|
|
43
43
|
|
|
44
44
|
|
|
45
45
|
|
|
46
|
+
↵ show selected fruit ↑↓ navigate ^k actions powered by termcast
|
|
46
47
|
|
|
47
48
|
|
|
48
49
|
|
|
@@ -56,7 +57,8 @@ test('dropdown defaults to first item when no value is provided', async () => {
|
|
|
56
57
|
|
|
57
58
|
|
|
58
59
|
|
|
59
|
-
|
|
60
|
+
|
|
61
|
+
"
|
|
60
62
|
`)
|
|
61
63
|
}, 10000)
|
|
62
64
|
|
|
@@ -74,23 +76,25 @@ test('dropdown opens and shows items', async () => {
|
|
|
74
76
|
"
|
|
75
77
|
|
|
76
78
|
|
|
77
|
-
|
|
79
|
+
Dropdown Default Value Example ───────────────────────────────────────────
|
|
80
|
+
╭──────────────────────────────────────────────────────────────────────────╮
|
|
81
|
+
│ │
|
|
82
|
+
│ Filter by category esc │
|
|
83
|
+
│ │
|
|
84
|
+
│ > Select category... │
|
|
85
|
+
│ │
|
|
86
|
+
│ ›Apple │
|
|
87
|
+
│ Banana │
|
|
88
|
+
│ Orange │
|
|
89
|
+
│ Grape │
|
|
90
|
+
│ │
|
|
91
|
+
│ │
|
|
92
|
+
│ ↵ select ↑↓ navigate powered by termcast │
|
|
93
|
+
│ │
|
|
94
|
+
╰──────────────────────────────────────────────────────────────────────────╯
|
|
95
|
+
|
|
96
|
+
|
|
78
97
|
|
|
79
|
-
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
|
|
80
|
-
S┃ ┃
|
|
81
|
-
┃ Filter by category esc ┃
|
|
82
|
-
›F┃ ┃
|
|
83
|
-
S┃ Select category... ┃
|
|
84
|
-
V┃ ┃
|
|
85
|
-
C┃ ›Apple ┃
|
|
86
|
-
┃ Banana ┃
|
|
87
|
-
┃ Orange ┃
|
|
88
|
-
┃ Grape ┃
|
|
89
|
-
┃ ┃
|
|
90
|
-
┃ ┃
|
|
91
|
-
┃ ↵ select ↑↓ navigate ┃
|
|
92
|
-
┃ ┃
|
|
93
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
94
98
|
|
|
95
99
|
|
|
96
100
|
|
|
@@ -99,7 +103,7 @@ test('dropdown opens and shows items', async () => {
|
|
|
99
103
|
|
|
100
104
|
|
|
101
105
|
|
|
102
|
-
|
|
106
|
+
"
|
|
103
107
|
`)
|
|
104
108
|
|
|
105
109
|
await session.press('down')
|
|
@@ -109,23 +113,24 @@ test('dropdown opens and shows items', async () => {
|
|
|
109
113
|
"
|
|
110
114
|
|
|
111
115
|
|
|
112
|
-
|
|
116
|
+
Dropdown Default Value Example ───────────────────────────────────────────
|
|
117
|
+
╭──────────────────────────────────────────────────────────────────────────╮
|
|
118
|
+
│ │
|
|
119
|
+
│ Filter by category esc │
|
|
120
|
+
│ │
|
|
121
|
+
│ > Select category... │
|
|
122
|
+
│ │
|
|
123
|
+
│ Apple │
|
|
124
|
+
│ ›Banana │
|
|
125
|
+
│ Orange │
|
|
126
|
+
│ Grape │
|
|
127
|
+
│ │
|
|
128
|
+
│ │
|
|
129
|
+
│ ↵ select ↑↓ navigate powered by termcast │
|
|
130
|
+
│ │
|
|
131
|
+
╰──────────────────────────────────────────────────────────────────────────╯
|
|
132
|
+
|
|
113
133
|
|
|
114
|
-
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
|
|
115
|
-
S┃ ┃
|
|
116
|
-
┃ Filter by category esc ┃
|
|
117
|
-
›F┃ ┃
|
|
118
|
-
S┃ Select category... ┃
|
|
119
|
-
V┃ ┃
|
|
120
|
-
C┃ Apple ┃
|
|
121
|
-
┃ ›Banana ┃
|
|
122
|
-
┃ Orange ┃
|
|
123
|
-
┃ Grape ┃
|
|
124
|
-
┃ ┃
|
|
125
|
-
┃ ┃
|
|
126
|
-
┃ ↵ select ↑↓ navigate ┃
|
|
127
|
-
┃ ┃
|
|
128
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
129
134
|
|
|
130
135
|
|
|
131
136
|
|
|
@@ -134,7 +139,8 @@ test('dropdown opens and shows items', async () => {
|
|
|
134
139
|
|
|
135
140
|
|
|
136
141
|
|
|
137
|
-
|
|
142
|
+
|
|
143
|
+
"
|
|
138
144
|
`)
|
|
139
145
|
|
|
140
146
|
await session.press('enter')
|
|
@@ -144,18 +150,19 @@ test('dropdown opens and shows items', async () => {
|
|
|
144
150
|
"
|
|
145
151
|
|
|
146
152
|
|
|
147
|
-
|
|
153
|
+
Dropdown Default Value Example ───────────────────────────────────────────
|
|
148
154
|
|
|
149
155
|
|
|
150
|
-
|
|
156
|
+
> Search... Banana ▾
|
|
151
157
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
158
|
+
›First Item This list has a dropdown
|
|
159
|
+
Second Item The dropdown should default to first item
|
|
160
|
+
Vegetables
|
|
161
|
+
Carrot With another dropdown
|
|
156
162
|
|
|
157
163
|
|
|
158
164
|
|
|
165
|
+
↵ show selected fruit ↑↓ navigate ^k actions powered by termcast
|
|
159
166
|
|
|
160
167
|
|
|
161
168
|
|
|
@@ -169,7 +176,8 @@ test('dropdown opens and shows items', async () => {
|
|
|
169
176
|
|
|
170
177
|
|
|
171
178
|
|
|
172
|
-
|
|
179
|
+
|
|
180
|
+
"
|
|
173
181
|
`)
|
|
174
182
|
}, 10000)
|
|
175
183
|
|
|
@@ -187,23 +195,25 @@ test('clicking dropdown opens it', async () => {
|
|
|
187
195
|
"
|
|
188
196
|
|
|
189
197
|
|
|
190
|
-
|
|
198
|
+
Dropdown Default Value Example ───────────────────────────────────────────
|
|
199
|
+
╭──────────────────────────────────────────────────────────────────────────╮
|
|
200
|
+
│ │
|
|
201
|
+
│ Filter by category esc │
|
|
202
|
+
│ │
|
|
203
|
+
│ > Select category... │
|
|
204
|
+
│ │
|
|
205
|
+
│ ›Apple │
|
|
206
|
+
│ Banana │
|
|
207
|
+
│ Orange │
|
|
208
|
+
│ Grape │
|
|
209
|
+
│ │
|
|
210
|
+
│ │
|
|
211
|
+
│ ↵ select ↑↓ navigate powered by termcast │
|
|
212
|
+
│ │
|
|
213
|
+
╰──────────────────────────────────────────────────────────────────────────╯
|
|
214
|
+
|
|
215
|
+
|
|
191
216
|
|
|
192
|
-
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
|
|
193
|
-
S┃ ┃
|
|
194
|
-
┃ Filter by category esc ┃
|
|
195
|
-
›F┃ ┃
|
|
196
|
-
S┃ Select category... ┃
|
|
197
|
-
V┃ ┃
|
|
198
|
-
C┃ ›Apple ┃
|
|
199
|
-
┃ Banana ┃
|
|
200
|
-
┃ Orange ┃
|
|
201
|
-
┃ Grape ┃
|
|
202
|
-
┃ ┃
|
|
203
|
-
┃ ┃
|
|
204
|
-
┃ ↵ select ↑↓ navigate ┃
|
|
205
|
-
┃ ┃
|
|
206
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
207
217
|
|
|
208
218
|
|
|
209
219
|
|
|
@@ -212,7 +222,7 @@ test('clicking dropdown opens it', async () => {
|
|
|
212
222
|
|
|
213
223
|
|
|
214
224
|
|
|
215
|
-
|
|
225
|
+
"
|
|
216
226
|
`)
|
|
217
227
|
|
|
218
228
|
await session.click('Orange', { first: true })
|
|
@@ -222,17 +232,19 @@ test('clicking dropdown opens it', async () => {
|
|
|
222
232
|
"
|
|
223
233
|
|
|
224
234
|
|
|
225
|
-
|
|
235
|
+
Dropdown Default Value Example ───────────────────────────────────────────
|
|
236
|
+
|
|
226
237
|
|
|
238
|
+
> Search... Orange ▾
|
|
227
239
|
|
|
228
|
-
|
|
240
|
+
›First Item This list has a dropdown
|
|
241
|
+
Second Item The dropdown should default to first item
|
|
242
|
+
Vegetables
|
|
243
|
+
Carrot With another dropdown
|
|
229
244
|
|
|
230
|
-
›First Item This list has a dropdown
|
|
231
|
-
Second Item The dropdown should default to first item
|
|
232
|
-
Vegetables
|
|
233
|
-
Carrot With another dropdown
|
|
234
245
|
|
|
235
246
|
|
|
247
|
+
↵ show selected fruit ↑↓ navigate ^k actions powered by termcast
|
|
236
248
|
|
|
237
249
|
|
|
238
250
|
|
|
@@ -247,6 +259,6 @@ test('clicking dropdown opens it', async () => {
|
|
|
247
259
|
|
|
248
260
|
|
|
249
261
|
|
|
250
|
-
|
|
262
|
+
"
|
|
251
263
|
`)
|
|
252
264
|
}, 10000)
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { test, expect, afterEach, beforeEach } from 'vitest'
|
|
2
|
+
|
|
3
|
+
import { launchTerminal, Session } from 'tuistory/src'
|
|
4
|
+
|
|
5
|
+
let session: Session
|
|
6
|
+
|
|
7
|
+
beforeEach(async () => {
|
|
8
|
+
session = await launchTerminal({
|
|
9
|
+
command: 'bun',
|
|
10
|
+
args: ['src/examples/simple-list.tsx'],
|
|
11
|
+
cols: 60,
|
|
12
|
+
rows: 15,
|
|
13
|
+
})
|
|
14
|
+
})
|
|
15
|
+
|
|
16
|
+
afterEach(() => {
|
|
17
|
+
session?.close()
|
|
18
|
+
})
|
|
19
|
+
|
|
20
|
+
test('default empty view should NOT show when items exist', async () => {
|
|
21
|
+
await session.text({
|
|
22
|
+
waitFor: (text) => {
|
|
23
|
+
return /First Item/.test(text)
|
|
24
|
+
},
|
|
25
|
+
})
|
|
26
|
+
|
|
27
|
+
const snapshot = await session.text()
|
|
28
|
+
|
|
29
|
+
// Should show items
|
|
30
|
+
expect(snapshot).toContain('First Item')
|
|
31
|
+
expect(snapshot).toContain('Second Item')
|
|
32
|
+
|
|
33
|
+
// Should NOT show "No items found" when items exist
|
|
34
|
+
expect(snapshot).not.toContain('No items found')
|
|
35
|
+
}, 10000)
|
|
36
|
+
|
|
37
|
+
test('default empty view should show when filtering leaves no items', async () => {
|
|
38
|
+
await session.text({
|
|
39
|
+
waitFor: (text) => {
|
|
40
|
+
return /First Item/.test(text)
|
|
41
|
+
},
|
|
42
|
+
})
|
|
43
|
+
|
|
44
|
+
// Search for something that doesn't exist
|
|
45
|
+
await session.type('xyznonexistent')
|
|
46
|
+
|
|
47
|
+
const snapshot = await session.text({
|
|
48
|
+
waitFor: (text) => {
|
|
49
|
+
return /xyznonexistent/.test(text)
|
|
50
|
+
},
|
|
51
|
+
})
|
|
52
|
+
|
|
53
|
+
// Should NOT show any items
|
|
54
|
+
expect(snapshot).not.toContain('First Item')
|
|
55
|
+
expect(snapshot).not.toContain('Second Item')
|
|
56
|
+
|
|
57
|
+
// Should show "No items found"
|
|
58
|
+
expect(snapshot).toContain('No items found')
|
|
59
|
+
}, 10000)
|
|
60
|
+
|
|
61
|
+
test('default empty view should hide when filter is cleared', async () => {
|
|
62
|
+
await session.text({
|
|
63
|
+
waitFor: (text) => {
|
|
64
|
+
return /First Item/.test(text)
|
|
65
|
+
},
|
|
66
|
+
})
|
|
67
|
+
|
|
68
|
+
// Search for something that doesn't exist
|
|
69
|
+
await session.type('xyz')
|
|
70
|
+
|
|
71
|
+
await session.text({
|
|
72
|
+
waitFor: (text) => {
|
|
73
|
+
return /xyz/.test(text)
|
|
74
|
+
},
|
|
75
|
+
})
|
|
76
|
+
|
|
77
|
+
// Clear the search
|
|
78
|
+
await session.press('backspace')
|
|
79
|
+
await session.press('backspace')
|
|
80
|
+
await session.press('backspace')
|
|
81
|
+
|
|
82
|
+
const snapshot = await session.text({
|
|
83
|
+
waitFor: (text) => {
|
|
84
|
+
return /First Item/.test(text)
|
|
85
|
+
},
|
|
86
|
+
})
|
|
87
|
+
|
|
88
|
+
// Should show items again
|
|
89
|
+
expect(snapshot).toContain('First Item')
|
|
90
|
+
|
|
91
|
+
// Should NOT show "No items found"
|
|
92
|
+
expect(snapshot).not.toContain('No items found')
|
|
93
|
+
}, 10000)
|
|
@@ -33,27 +33,29 @@ test('list shows initial items after fetch', async () => {
|
|
|
33
33
|
"
|
|
34
34
|
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
SVG Library ────────────────────────────────────────────────────
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
> Search...
|
|
39
39
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
40
|
+
Icons
|
|
41
|
+
›Home Icon Category: Icons
|
|
42
|
+
User Icon Category: Icons
|
|
43
|
+
Settings Icon Category: Icons
|
|
44
44
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
Illustrations
|
|
46
|
+
Welcome Banner Category: Illustrations
|
|
47
|
+
Hero Image Category: Illustrations
|
|
48
48
|
|
|
49
49
|
|
|
50
50
|
|
|
51
|
+
↑↓ navigate ^k actions
|
|
51
52
|
|
|
52
53
|
|
|
53
54
|
|
|
54
55
|
|
|
55
56
|
|
|
56
|
-
|
|
57
|
+
|
|
58
|
+
"
|
|
57
59
|
`)
|
|
58
60
|
|
|
59
61
|
|
|
@@ -64,27 +66,29 @@ test('list shows initial items after fetch', async () => {
|
|
|
64
66
|
"
|
|
65
67
|
|
|
66
68
|
|
|
67
|
-
|
|
69
|
+
SVG Library ────────────────────────────────────────────────────
|
|
70
|
+
|
|
71
|
+
> Search...
|
|
68
72
|
|
|
69
|
-
|
|
73
|
+
Icons
|
|
74
|
+
Home Icon Category: Icons
|
|
75
|
+
›User Icon Category: Icons
|
|
76
|
+
Settings Icon Category: Icons
|
|
70
77
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
Settings Icon Category: Icons
|
|
78
|
+
Illustrations
|
|
79
|
+
Welcome Banner Category: Illustrations
|
|
80
|
+
Hero Image Category: Illustrations
|
|
75
81
|
|
|
76
|
-
Illustrations
|
|
77
|
-
Welcome Banner Category: Illustrations
|
|
78
|
-
Hero Image Category: Illustrations
|
|
79
82
|
|
|
80
83
|
|
|
84
|
+
↑↓ navigate ^k actions
|
|
81
85
|
|
|
82
86
|
|
|
83
87
|
|
|
84
88
|
|
|
85
89
|
|
|
86
90
|
|
|
87
|
-
|
|
91
|
+
"
|
|
88
92
|
`)
|
|
89
93
|
|
|
90
94
|
await session.press('down')
|
|
@@ -94,26 +98,28 @@ test('list shows initial items after fetch', async () => {
|
|
|
94
98
|
"
|
|
95
99
|
|
|
96
100
|
|
|
97
|
-
|
|
101
|
+
SVG Library ────────────────────────────────────────────────────
|
|
102
|
+
|
|
103
|
+
> Search...
|
|
98
104
|
|
|
99
|
-
|
|
105
|
+
Icons
|
|
106
|
+
Home Icon Category: Icons
|
|
107
|
+
User Icon Category: Icons
|
|
108
|
+
Settings Icon Category: Icons
|
|
100
109
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
Settings Icon Category: Icons
|
|
110
|
+
Illustrations
|
|
111
|
+
›Welcome Banner Category: Illustrations
|
|
112
|
+
Hero Image Category: Illustrations
|
|
105
113
|
|
|
106
|
-
Illustrations
|
|
107
|
-
›Welcome Banner Category: Illustrations
|
|
108
|
-
Hero Image Category: Illustrations
|
|
109
114
|
|
|
110
115
|
|
|
116
|
+
↑↓ navigate ^k actions
|
|
111
117
|
|
|
112
118
|
|
|
113
119
|
|
|
114
120
|
|
|
115
121
|
|
|
116
122
|
|
|
117
|
-
|
|
123
|
+
"
|
|
118
124
|
`)
|
|
119
125
|
}, 10000)
|