@silvery/examples 0.17.3 → 0.17.5

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.
Files changed (111) hide show
  1. package/dist/UPNG-ShUlaTDh.mjs +5074 -0
  2. package/dist/__vite-browser-external-2447137e-Bopa5BFR.mjs +4 -0
  3. package/dist/_banner-A70_y2Vi.mjs +43 -0
  4. package/dist/ansi-0VXlUmNn.mjs +16397 -0
  5. package/dist/apng-B0gRaDVT.mjs +3 -0
  6. package/dist/apng-BTRDTfDW.mjs +68 -0
  7. package/dist/apps/aichat/index.mjs +1298 -0
  8. package/dist/apps/app-todo.mjs +138 -0
  9. package/dist/apps/async-data.mjs +203 -0
  10. package/dist/apps/cli-wizard.mjs +338 -0
  11. package/dist/apps/clipboard.mjs +197 -0
  12. package/dist/apps/components.mjs +863 -0
  13. package/dist/apps/data-explorer.mjs +482 -0
  14. package/dist/apps/dev-tools.mjs +396 -0
  15. package/dist/apps/explorer.mjs +697 -0
  16. package/dist/apps/gallery.mjs +765 -0
  17. package/dist/apps/inline-bench.mjs +115 -0
  18. package/dist/apps/kanban.mjs +279 -0
  19. package/dist/apps/layout-ref.mjs +186 -0
  20. package/dist/apps/outline.mjs +202 -0
  21. package/dist/apps/paste-demo.mjs +188 -0
  22. package/dist/apps/scroll.mjs +85 -0
  23. package/dist/apps/search-filter.mjs +286 -0
  24. package/dist/apps/selection.mjs +354 -0
  25. package/dist/apps/spatial-focus-demo.mjs +387 -0
  26. package/dist/apps/task-list.mjs +257 -0
  27. package/dist/apps/terminal-caps-demo.mjs +314 -0
  28. package/dist/apps/terminal.mjs +871 -0
  29. package/dist/apps/text-selection-demo.mjs +253 -0
  30. package/dist/apps/textarea.mjs +177 -0
  31. package/dist/apps/theme.mjs +660 -0
  32. package/dist/apps/transform.mjs +214 -0
  33. package/dist/apps/virtual-10k.mjs +421 -0
  34. package/dist/assets/resvgjs.darwin-arm64-BtufyGW1.node +0 -0
  35. package/dist/backends-Dj-11kZF.mjs +1179 -0
  36. package/dist/backends-U3QwStfO.mjs +3 -0
  37. package/dist/{cli.mjs → bin/cli.mjs} +15 -19
  38. package/dist/chunk-BSw8zbkd.mjs +37 -0
  39. package/dist/components/counter.mjs +47 -0
  40. package/dist/components/hello.mjs +30 -0
  41. package/dist/components/progress-bar.mjs +58 -0
  42. package/dist/components/select-list.mjs +84 -0
  43. package/dist/components/spinner.mjs +56 -0
  44. package/dist/components/text-input.mjs +61 -0
  45. package/dist/components/virtual-list.mjs +50 -0
  46. package/dist/flexily-zero-adapter-ByVzLTFP.mjs +3374 -0
  47. package/dist/gif-B6NGH5gs.mjs +3 -0
  48. package/dist/gif-CfkOF-iG.mjs +71 -0
  49. package/dist/gifenc-BI4ihP_T.mjs +728 -0
  50. package/dist/key-mapping-5oYQdAQE.mjs +3 -0
  51. package/dist/key-mapping-D4LR1go6.mjs +130 -0
  52. package/dist/layout/dashboard.mjs +1203 -0
  53. package/dist/layout/live-resize.mjs +302 -0
  54. package/dist/layout/overflow.mjs +69 -0
  55. package/dist/layout/text-layout.mjs +334 -0
  56. package/dist/node-nsrAOjH4.mjs +1083 -0
  57. package/dist/plugins-CT0DdV_E.mjs +3056 -0
  58. package/dist/resvg-js-Cnk2o49d.mjs +201 -0
  59. package/dist/src-9ZhfQyzD.mjs +814 -0
  60. package/dist/src-CUUOuRH6.mjs +5322 -0
  61. package/dist/src-jO3Zuzjj.mjs +23538 -0
  62. package/dist/usingCtx-CsEf0xO3.mjs +57 -0
  63. package/dist/yoga-adapter-BSQHuMV9.mjs +237 -0
  64. package/package.json +21 -14
  65. package/_banner.tsx +0 -60
  66. package/apps/aichat/components.tsx +0 -469
  67. package/apps/aichat/index.tsx +0 -220
  68. package/apps/aichat/script.ts +0 -460
  69. package/apps/aichat/state.ts +0 -325
  70. package/apps/aichat/types.ts +0 -19
  71. package/apps/app-todo.tsx +0 -201
  72. package/apps/async-data.tsx +0 -196
  73. package/apps/cli-wizard.tsx +0 -332
  74. package/apps/clipboard.tsx +0 -183
  75. package/apps/components.tsx +0 -658
  76. package/apps/data-explorer.tsx +0 -490
  77. package/apps/dev-tools.tsx +0 -395
  78. package/apps/explorer.tsx +0 -731
  79. package/apps/gallery.tsx +0 -653
  80. package/apps/inline-bench.tsx +0 -138
  81. package/apps/kanban.tsx +0 -265
  82. package/apps/layout-ref.tsx +0 -173
  83. package/apps/outline.tsx +0 -160
  84. package/apps/panes/index.tsx +0 -203
  85. package/apps/paste-demo.tsx +0 -185
  86. package/apps/scroll.tsx +0 -80
  87. package/apps/search-filter.tsx +0 -240
  88. package/apps/selection.tsx +0 -346
  89. package/apps/spatial-focus-demo.tsx +0 -372
  90. package/apps/task-list.tsx +0 -271
  91. package/apps/terminal-caps-demo.tsx +0 -317
  92. package/apps/terminal.tsx +0 -784
  93. package/apps/text-selection-demo.tsx +0 -193
  94. package/apps/textarea.tsx +0 -155
  95. package/apps/theme.tsx +0 -515
  96. package/apps/transform.tsx +0 -229
  97. package/apps/virtual-10k.tsx +0 -405
  98. package/apps/vterm-demo/index.tsx +0 -216
  99. package/components/counter.tsx +0 -49
  100. package/components/hello.tsx +0 -38
  101. package/components/progress-bar.tsx +0 -52
  102. package/components/select-list.tsx +0 -54
  103. package/components/spinner.tsx +0 -44
  104. package/components/text-input.tsx +0 -61
  105. package/components/virtual-list.tsx +0 -56
  106. package/dist/cli.d.mts +0 -1
  107. package/dist/cli.mjs.map +0 -1
  108. package/layout/dashboard.tsx +0 -953
  109. package/layout/live-resize.tsx +0 -282
  110. package/layout/overflow.tsx +0 -51
  111. package/layout/text-layout.tsx +0 -283
@@ -0,0 +1,482 @@
1
+ import { t as _usingCtx } from "../usingCtx-CsEf0xO3.mjs";
2
+ import { t as ExampleBanner } from "../_banner-A70_y2Vi.mjs";
3
+ import { useCallback, useDeferredValue, useMemo, useState } from "react";
4
+ import { Box, Divider, Kbd, Lead, ListView, Muted, Text, TextInput, createTerm, render, useApp, useBoxRect, useInput } from "silvery";
5
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
6
+ //#region apps/data-explorer.tsx
7
+ /**
8
+ * Data Explorer — Process Table Example
9
+ *
10
+ * A process explorer with a searchable, scrollable table demonstrating:
11
+ * - Table-like display with responsive column widths via useBoxRect()
12
+ * - TextInput for live search/filter with useDeferredValue
13
+ * - ListView for smooth scrolling through 500+ rows
14
+ * - Keyboard navigation with j/k and vim-style jumps
15
+ * - Color-coded status indicators
16
+ *
17
+ * Usage: bun run examples/apps/data-explorer.tsx
18
+ *
19
+ * Controls:
20
+ * j/k or Up/Down - Navigate rows
21
+ * d/u - Half-page down/up
22
+ * g/G - Jump to first/last
23
+ * / - Toggle search mode
24
+ * Esc - Exit search / quit
25
+ * q - Quit (when not searching)
26
+ */
27
+ const meta = {
28
+ name: "Data Explorer",
29
+ description: "Process explorer table with search, ListView, and responsive column widths",
30
+ features: [
31
+ "useBoxRect()",
32
+ "TextInput",
33
+ "useInput()",
34
+ "responsive layout",
35
+ "useDeferredValue"
36
+ ]
37
+ };
38
+ const PROCESS_NAMES = [
39
+ "node",
40
+ "python3",
41
+ "nginx",
42
+ "redis-server",
43
+ "postgres",
44
+ "docker",
45
+ "sshd",
46
+ "systemd",
47
+ "cron",
48
+ "rsyslogd",
49
+ "webpack",
50
+ "vite",
51
+ "chrome",
52
+ "firefox",
53
+ "code",
54
+ "vim",
55
+ "tmux",
56
+ "bash",
57
+ "zsh",
58
+ "containerd",
59
+ "kubelet",
60
+ "etcd",
61
+ "coredns",
62
+ "flannel",
63
+ "prometheus",
64
+ "grafana",
65
+ "elasticsearch",
66
+ "kibana",
67
+ "logstash",
68
+ "rabbitmq",
69
+ "kafka",
70
+ "zookeeper",
71
+ "consul",
72
+ "vault",
73
+ "haproxy",
74
+ "traefik",
75
+ "envoy",
76
+ "istio-proxy",
77
+ "jaeger",
78
+ "mysql",
79
+ "mongo",
80
+ "cassandra",
81
+ "clickhouse",
82
+ "influxdb",
83
+ "jenkins",
84
+ "gitlab-runner",
85
+ "buildkitd",
86
+ "registry",
87
+ "cadvisor",
88
+ "node-exporter",
89
+ "alertmanager",
90
+ "telegraf",
91
+ "bun",
92
+ "deno",
93
+ "esbuild",
94
+ "swc",
95
+ "turbo",
96
+ "pnpm"
97
+ ];
98
+ const USERS = [
99
+ "root",
100
+ "www-data",
101
+ "postgres",
102
+ "redis",
103
+ "node",
104
+ "admin",
105
+ "deploy",
106
+ "monitor"
107
+ ];
108
+ const STATUSES = [
109
+ "running",
110
+ "sleeping",
111
+ "stopped",
112
+ "zombie"
113
+ ];
114
+ function seededRandom(seed) {
115
+ let s = seed;
116
+ return () => {
117
+ s = s * 1664525 + 1013904223 & 2147483647;
118
+ return s / 2147483647;
119
+ };
120
+ }
121
+ function formatUptime(seconds) {
122
+ if (seconds < 60) return `${seconds}s`;
123
+ if (seconds < 3600) return `${Math.floor(seconds / 60)}m`;
124
+ if (seconds < 86400) return `${Math.floor(seconds / 3600)}h${Math.floor(seconds % 3600 / 60)}m`;
125
+ return `${Math.floor(seconds / 86400)}d${Math.floor(seconds % 86400 / 3600)}h`;
126
+ }
127
+ function generateProcesses(count) {
128
+ const rng = seededRandom(42);
129
+ const processes = [];
130
+ for (let i = 0; i < count; i++) {
131
+ const nameBase = PROCESS_NAMES[Math.floor(rng() * PROCESS_NAMES.length)];
132
+ const name = rng() > .6 ? `${nameBase}:${Math.floor(rng() * 20)}` : nameBase;
133
+ const status = rng() < .7 ? "running" : STATUSES[Math.floor(rng() * STATUSES.length)];
134
+ processes.push({
135
+ pid: 1e3 + i,
136
+ name,
137
+ cpu: status === "running" ? Math.round(rng() * 1e3) / 10 : 0,
138
+ mem: Math.round(rng() * 500) / 10,
139
+ status,
140
+ user: USERS[Math.floor(rng() * USERS.length)],
141
+ threads: 1 + Math.floor(rng() * 64),
142
+ uptime: formatUptime(Math.floor(rng() * 864e3))
143
+ });
144
+ }
145
+ return processes.sort((a, b) => b.cpu - a.cpu);
146
+ }
147
+ const ALL_PROCESSES = generateProcesses(600);
148
+ const STATUS_COLORS = {
149
+ running: "$success",
150
+ sleeping: "$muted",
151
+ stopped: "$warning",
152
+ zombie: "$error"
153
+ };
154
+ const STATUS_ICONS = {
155
+ running: "▶",
156
+ sleeping: "◌",
157
+ stopped: "■",
158
+ zombie: "☠"
159
+ };
160
+ /** Column layout helper -- computes column widths based on available space */
161
+ function useColumns(totalWidth) {
162
+ return useMemo(() => {
163
+ const pidW = 6;
164
+ const cpuW = 7;
165
+ const memW = 7;
166
+ const statusW = 10;
167
+ const threadsW = 5;
168
+ const uptimeW = 8;
169
+ const userW = 10;
170
+ const fixed = pidW + cpuW + memW + statusW + threadsW + uptimeW + userW + 8;
171
+ return {
172
+ pidW,
173
+ nameW: Math.max(10, totalWidth - fixed),
174
+ cpuW,
175
+ memW,
176
+ statusW,
177
+ userW,
178
+ threadsW,
179
+ uptimeW
180
+ };
181
+ }, [totalWidth]);
182
+ }
183
+ function TableHeader({ width }) {
184
+ const cols = useColumns(width);
185
+ return /* @__PURE__ */ jsx(Box, {
186
+ paddingX: 1,
187
+ children: /* @__PURE__ */ jsxs(Text, {
188
+ bold: true,
189
+ color: "$muted",
190
+ children: [
191
+ "PID".padEnd(cols.pidW),
192
+ "NAME".padEnd(cols.nameW),
193
+ "CPU%".padStart(cols.cpuW),
194
+ "MEM%".padStart(cols.memW),
195
+ " ",
196
+ "STATUS".padEnd(cols.statusW),
197
+ "USER".padEnd(cols.userW),
198
+ "THR".padStart(cols.threadsW),
199
+ " ",
200
+ "UPTIME".padStart(cols.uptimeW)
201
+ ]
202
+ })
203
+ });
204
+ }
205
+ function ProcessRow({ proc, isSelected, width }) {
206
+ const cols = useColumns(width);
207
+ const cpuColor = proc.cpu > 80 ? "$error" : proc.cpu > 40 ? "$warning" : "$success";
208
+ const memColor = proc.mem > 40 ? "$warning" : "$muted";
209
+ const displayName = proc.name.length > cols.nameW - 1 ? proc.name.slice(0, cols.nameW - 2) + "…" : proc.name;
210
+ return /* @__PURE__ */ jsxs(Box, {
211
+ paddingX: 1,
212
+ backgroundColor: isSelected ? "$primary" : void 0,
213
+ children: [
214
+ /* @__PURE__ */ jsx(Text, {
215
+ color: isSelected ? "$primary-fg" : "$muted",
216
+ children: String(proc.pid).padEnd(cols.pidW)
217
+ }),
218
+ /* @__PURE__ */ jsx(Text, {
219
+ bold: isSelected,
220
+ color: isSelected ? "$primary-fg" : void 0,
221
+ children: displayName.padEnd(cols.nameW)
222
+ }),
223
+ /* @__PURE__ */ jsxs(Text, {
224
+ color: isSelected ? "$primary-fg" : cpuColor,
225
+ children: [proc.cpu.toFixed(1).padStart(cols.cpuW - 1), "%"]
226
+ }),
227
+ /* @__PURE__ */ jsxs(Text, {
228
+ color: isSelected ? "$primary-fg" : memColor,
229
+ children: [proc.mem.toFixed(1).padStart(cols.memW - 1), "%"]
230
+ }),
231
+ /* @__PURE__ */ jsx(Text, { children: " " }),
232
+ /* @__PURE__ */ jsxs(Text, {
233
+ color: isSelected ? "$primary-fg" : STATUS_COLORS[proc.status],
234
+ children: [
235
+ STATUS_ICONS[proc.status],
236
+ " ",
237
+ proc.status.padEnd(cols.statusW - 2)
238
+ ]
239
+ }),
240
+ /* @__PURE__ */ jsx(Text, {
241
+ color: isSelected ? "$primary-fg" : "$muted",
242
+ children: proc.user.padEnd(cols.userW)
243
+ }),
244
+ /* @__PURE__ */ jsx(Text, {
245
+ color: isSelected ? "$primary-fg" : "$muted",
246
+ children: String(proc.threads).padStart(cols.threadsW)
247
+ }),
248
+ /* @__PURE__ */ jsx(Text, { children: " " }),
249
+ /* @__PURE__ */ jsx(Text, {
250
+ color: isSelected ? "$primary-fg" : "$muted",
251
+ children: proc.uptime.padStart(cols.uptimeW)
252
+ })
253
+ ]
254
+ });
255
+ }
256
+ function SummaryBar({ processes, query }) {
257
+ const stats = useMemo(() => {
258
+ let running = 0;
259
+ let totalCpu = 0;
260
+ let totalMem = 0;
261
+ for (const p of processes) {
262
+ if (p.status === "running") running++;
263
+ totalCpu += p.cpu;
264
+ totalMem += p.mem;
265
+ }
266
+ return {
267
+ running,
268
+ totalCpu: totalCpu.toFixed(1),
269
+ totalMem: totalMem.toFixed(1)
270
+ };
271
+ }, [processes]);
272
+ return /* @__PURE__ */ jsxs(Box, {
273
+ paddingX: 1,
274
+ gap: 2,
275
+ children: [
276
+ /* @__PURE__ */ jsx(Text, {
277
+ bold: true,
278
+ children: processes.length
279
+ }),
280
+ /* @__PURE__ */ jsx(Muted, { children: "processes" }),
281
+ /* @__PURE__ */ jsx(Text, {
282
+ color: "$success",
283
+ bold: true,
284
+ children: stats.running
285
+ }),
286
+ /* @__PURE__ */ jsx(Muted, { children: "running" }),
287
+ /* @__PURE__ */ jsx(Muted, { children: "|" }),
288
+ /* @__PURE__ */ jsxs(Text, {
289
+ color: "$primary",
290
+ children: [
291
+ "CPU: ",
292
+ stats.totalCpu,
293
+ "%"
294
+ ]
295
+ }),
296
+ /* @__PURE__ */ jsxs(Text, {
297
+ color: "$warning",
298
+ children: [
299
+ "MEM: ",
300
+ stats.totalMem,
301
+ "%"
302
+ ]
303
+ }),
304
+ query && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Muted, { children: "|" }), /* @__PURE__ */ jsxs(Text, {
305
+ dim: true,
306
+ children: [
307
+ "filter: \"",
308
+ query,
309
+ "\""
310
+ ]
311
+ })] })
312
+ ]
313
+ });
314
+ }
315
+ /** Inner component that reads the flex container's height */
316
+ function ProcessListArea({ processes, cursor, width }) {
317
+ const { height } = useBoxRect();
318
+ return /* @__PURE__ */ jsx(ListView, {
319
+ items: processes,
320
+ height,
321
+ estimateHeight: 1,
322
+ scrollTo: cursor,
323
+ overscan: 5,
324
+ renderItem: (proc, index) => /* @__PURE__ */ jsx(ProcessRow, {
325
+ proc,
326
+ isSelected: index === cursor,
327
+ width
328
+ }, proc.pid)
329
+ });
330
+ }
331
+ function DataExplorer() {
332
+ const { exit } = useApp();
333
+ const { width } = useBoxRect();
334
+ const [cursor, setCursor] = useState(0);
335
+ const [searchMode, setSearchMode] = useState(false);
336
+ const [query, setQuery] = useState("");
337
+ const deferredQuery = useDeferredValue(query);
338
+ const filtered = useMemo(() => {
339
+ if (!deferredQuery) return ALL_PROCESSES;
340
+ const q = deferredQuery.toLowerCase();
341
+ return ALL_PROCESSES.filter((p) => p.name.toLowerCase().includes(q) || p.user.toLowerCase().includes(q) || p.status.includes(q) || String(p.pid).includes(q));
342
+ }, [deferredQuery]);
343
+ const listHeight = useMemo(() => Math.max(5, filtered.length), [filtered.length]);
344
+ const halfPage = Math.max(1, Math.floor(listHeight / 4));
345
+ const effectiveCursor = Math.min(cursor, Math.max(0, filtered.length - 1));
346
+ const handleSearchSubmit = useCallback(() => {
347
+ setSearchMode(false);
348
+ }, []);
349
+ useInput(useCallback((input, key) => {
350
+ if (searchMode) {
351
+ if (key.escape) {
352
+ setSearchMode(false);
353
+ return;
354
+ }
355
+ return;
356
+ }
357
+ if (input === "q" || key.escape) {
358
+ exit();
359
+ return;
360
+ }
361
+ if (input === "/") {
362
+ setSearchMode(true);
363
+ return;
364
+ }
365
+ if (input === "j" || key.downArrow) setCursor((c) => Math.min(filtered.length - 1, c + 1));
366
+ if (input === "k" || key.upArrow) setCursor((c) => Math.max(0, c - 1));
367
+ if (input === "d" || key.pageDown) setCursor((c) => Math.min(filtered.length - 1, c + halfPage));
368
+ if (input === "u" || key.pageUp) setCursor((c) => Math.max(0, c - halfPage));
369
+ if (input === "g" || key.home) setCursor(0);
370
+ if (input === "G" || key.end) setCursor(filtered.length - 1);
371
+ if (key.backspace && query) {
372
+ setQuery("");
373
+ setCursor(0);
374
+ }
375
+ }, [
376
+ searchMode,
377
+ exit,
378
+ filtered.length,
379
+ halfPage,
380
+ query
381
+ ]));
382
+ return /* @__PURE__ */ jsxs(Box, {
383
+ flexDirection: "column",
384
+ flexGrow: 1,
385
+ children: [
386
+ /* @__PURE__ */ jsx(SummaryBar, {
387
+ processes: filtered,
388
+ query: deferredQuery
389
+ }),
390
+ /* @__PURE__ */ jsx(Box, {
391
+ paddingX: 1,
392
+ children: searchMode ? /* @__PURE__ */ jsxs(Box, { children: [/* @__PURE__ */ jsxs(Text, {
393
+ color: "$primary",
394
+ bold: true,
395
+ children: ["/", " "]
396
+ }), /* @__PURE__ */ jsx(TextInput, {
397
+ value: query,
398
+ onChange: (v) => {
399
+ setQuery(v);
400
+ setCursor(0);
401
+ },
402
+ onSubmit: handleSearchSubmit,
403
+ prompt: "",
404
+ isActive: searchMode
405
+ })] }) : query ? /* @__PURE__ */ jsxs(Muted, { children: [
406
+ "filter: ",
407
+ /* @__PURE__ */ jsx(Text, {
408
+ bold: true,
409
+ children: query
410
+ }),
411
+ " (backspace to clear, / to edit)"
412
+ ] }) : /* @__PURE__ */ jsxs(Muted, { children: [
413
+ "Press ",
414
+ /* @__PURE__ */ jsx(Kbd, { children: "/" }),
415
+ " to search"
416
+ ] })
417
+ }),
418
+ /* @__PURE__ */ jsx(TableHeader, { width }),
419
+ /* @__PURE__ */ jsx(Box, {
420
+ paddingX: 1,
421
+ children: /* @__PURE__ */ jsx(Divider, {})
422
+ }),
423
+ /* @__PURE__ */ jsx(Box, {
424
+ flexGrow: 1,
425
+ flexDirection: "column",
426
+ children: filtered.length > 0 ? /* @__PURE__ */ jsx(ProcessListArea, {
427
+ processes: filtered,
428
+ cursor: effectiveCursor,
429
+ width
430
+ }) : /* @__PURE__ */ jsx(Box, {
431
+ paddingX: 1,
432
+ justifyContent: "center",
433
+ children: /* @__PURE__ */ jsxs(Lead, { children: [
434
+ "No processes match \"",
435
+ deferredQuery,
436
+ "\""
437
+ ] })
438
+ })
439
+ }),
440
+ /* @__PURE__ */ jsxs(Box, {
441
+ paddingX: 1,
442
+ justifyContent: "space-between",
443
+ children: [/* @__PURE__ */ jsxs(Muted, { children: [
444
+ /* @__PURE__ */ jsx(Kbd, { children: "j/k" }),
445
+ " navigate ",
446
+ /* @__PURE__ */ jsx(Kbd, { children: "d/u" }),
447
+ " half-page ",
448
+ /* @__PURE__ */ jsx(Kbd, { children: "g/G" }),
449
+ " start/end ",
450
+ /* @__PURE__ */ jsx(Kbd, { children: "/" }),
451
+ " search ",
452
+ /* @__PURE__ */ jsx(Kbd, { children: "Esc/q" }),
453
+ " ",
454
+ "quit"
455
+ ] }), /* @__PURE__ */ jsxs(Muted, { children: [
456
+ effectiveCursor + 1,
457
+ "/",
458
+ filtered.length
459
+ ] })]
460
+ })
461
+ ]
462
+ });
463
+ }
464
+ async function main() {
465
+ try {
466
+ var _usingCtx$1 = _usingCtx();
467
+ const term = _usingCtx$1.u(createTerm());
468
+ const { waitUntilExit } = await render(/* @__PURE__ */ jsx(ExampleBanner, {
469
+ meta,
470
+ controls: "j/k navigate d/u half-page g/G start/end / search Esc/q quit",
471
+ children: /* @__PURE__ */ jsx(DataExplorer, {})
472
+ }), term);
473
+ await waitUntilExit();
474
+ } catch (_) {
475
+ _usingCtx$1.e = _;
476
+ } finally {
477
+ _usingCtx$1.d();
478
+ }
479
+ }
480
+ if (import.meta.main) await main();
481
+ //#endregion
482
+ export { DataExplorer, main, meta };