@termuijs/ui 0.1.1 → 0.1.3
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/LICENSE +21 -0
- package/README.md +29 -15
- package/dist/index.cjs +67 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +67 -10
- package/dist/index.js.map +1 -1
- package/package.json +9 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Karanjot Singh
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @termuijs/ui
|
|
2
2
|
|
|
3
|
-
High-level interactive components
|
|
3
|
+
High-level interactive components built on top of `@termuijs/widgets`. Modals, selects, tabs, toasts, forms, a command palette, and a few more.
|
|
4
4
|
|
|
5
5
|
## Install
|
|
6
6
|
|
|
@@ -14,39 +14,53 @@ Requires `@termuijs/core` and `@termuijs/widgets`.
|
|
|
14
14
|
|
|
15
15
|
| Component | What it does |
|
|
16
16
|
|-----------|-------------|
|
|
17
|
-
| `Select` | Dropdown
|
|
17
|
+
| `Select` | Dropdown with arrow key navigation and filtering |
|
|
18
18
|
| `MultiSelect` | Multiple selection with checkboxes |
|
|
19
|
-
| `Modal` | Overlay dialog
|
|
20
|
-
| `Tabs` | Tab container with keyboard switching |
|
|
21
|
-
| `Toast` | Timed notification
|
|
22
|
-
| `Form` | Groups inputs with validation and submit
|
|
23
|
-
| `Tree` | Collapsible tree view |
|
|
24
|
-
| `ConfirmDialog` | Yes/No
|
|
25
|
-
| `CommandPalette` | Fuzzy-search command launcher |
|
|
19
|
+
| `Modal` | Overlay dialog. Traps focus so Tab stays inside |
|
|
20
|
+
| `Tabs` | Tab container with keyboard switching (left/right arrows) |
|
|
21
|
+
| `Toast` | Timed notification that auto-dismisses |
|
|
22
|
+
| `Form` | Groups inputs together with validation and a submit handler |
|
|
23
|
+
| `Tree` | Collapsible tree view for hierarchical data |
|
|
24
|
+
| `ConfirmDialog` | Simple Yes/No dialog |
|
|
25
|
+
| `CommandPalette` | Fuzzy-search command launcher (Ctrl+P style) |
|
|
26
26
|
| `Divider` | Horizontal or vertical separator line |
|
|
27
|
-
| `Spacer` | Flexible whitespace |
|
|
27
|
+
| `Spacer` | Flexible whitespace between elements |
|
|
28
28
|
|
|
29
29
|
## Usage
|
|
30
30
|
|
|
31
31
|
```typescript
|
|
32
|
-
import { Select, Modal, Toast } from '@termuijs/ui'
|
|
32
|
+
import { Select, Modal, Toast, CommandPalette } from '@termuijs/ui'
|
|
33
33
|
|
|
34
34
|
const select = new Select({
|
|
35
35
|
label: 'Choose a color',
|
|
36
36
|
options: ['Red', 'Green', 'Blue'],
|
|
37
37
|
onSelect: (value) => console.log(value),
|
|
38
|
-
})
|
|
38
|
+
})
|
|
39
39
|
|
|
40
40
|
const modal = new Modal({
|
|
41
41
|
title: 'Confirm',
|
|
42
42
|
content: 'Delete this file?',
|
|
43
43
|
onClose: () => {},
|
|
44
|
-
})
|
|
44
|
+
})
|
|
45
45
|
|
|
46
|
-
// Toasts auto-dismiss
|
|
47
|
-
Toast.show('File saved', { duration: 2000 })
|
|
46
|
+
// Toasts auto-dismiss
|
|
47
|
+
Toast.show('File saved', { duration: 2000 })
|
|
48
|
+
|
|
49
|
+
// Command palette with fuzzy search
|
|
50
|
+
const palette = new CommandPalette({
|
|
51
|
+
commands: [
|
|
52
|
+
{ label: 'Open file', action: () => openFile() },
|
|
53
|
+
{ label: 'Save', action: () => save() },
|
|
54
|
+
{ label: 'Quit', action: () => app.exit() },
|
|
55
|
+
],
|
|
56
|
+
})
|
|
48
57
|
```
|
|
49
58
|
|
|
59
|
+
|
|
60
|
+
## Documentation
|
|
61
|
+
|
|
62
|
+
Full docs at [www.termui.io/docs/ui/overview](https://www.termui.io/docs/ui/overview).
|
|
63
|
+
|
|
50
64
|
## License
|
|
51
65
|
|
|
52
66
|
MIT
|
package/dist/index.cjs
CHANGED
|
@@ -108,13 +108,18 @@ var Tabs = class extends import_widgets3.Widget {
|
|
|
108
108
|
return this._activeIndex;
|
|
109
109
|
}
|
|
110
110
|
selectTab(i) {
|
|
111
|
-
if (i >= 0 && i < this._tabs.length)
|
|
111
|
+
if (i >= 0 && i < this._tabs.length) {
|
|
112
|
+
this._activeIndex = i;
|
|
113
|
+
this.markDirty();
|
|
114
|
+
}
|
|
112
115
|
}
|
|
113
116
|
nextTab() {
|
|
114
117
|
this._activeIndex = (this._activeIndex + 1) % this._tabs.length;
|
|
118
|
+
this.markDirty();
|
|
115
119
|
}
|
|
116
120
|
prevTab() {
|
|
117
121
|
this._activeIndex = (this._activeIndex - 1 + this._tabs.length) % this._tabs.length;
|
|
122
|
+
this.markDirty();
|
|
118
123
|
}
|
|
119
124
|
get activeContent() {
|
|
120
125
|
return this._tabs[this._activeIndex]?.content;
|
|
@@ -168,15 +173,19 @@ var Modal = class extends import_widgets4.Widget {
|
|
|
168
173
|
}
|
|
169
174
|
show() {
|
|
170
175
|
this._visible = true;
|
|
176
|
+
this.markDirty();
|
|
171
177
|
}
|
|
172
178
|
hide() {
|
|
173
179
|
this._visible = false;
|
|
180
|
+
this.markDirty();
|
|
174
181
|
}
|
|
175
182
|
toggle() {
|
|
176
183
|
this._visible = !this._visible;
|
|
184
|
+
this.markDirty();
|
|
177
185
|
}
|
|
178
186
|
setContent(content) {
|
|
179
187
|
this._content = content;
|
|
188
|
+
this.markDirty();
|
|
180
189
|
}
|
|
181
190
|
_renderSelf(screen) {
|
|
182
191
|
if (!this._visible) return;
|
|
@@ -241,28 +250,38 @@ var Select = class extends import_widgets5.Widget {
|
|
|
241
250
|
}
|
|
242
251
|
open() {
|
|
243
252
|
this._isOpen = true;
|
|
253
|
+
this.markDirty();
|
|
244
254
|
}
|
|
245
255
|
close() {
|
|
246
256
|
this._isOpen = false;
|
|
257
|
+
this.markDirty();
|
|
247
258
|
}
|
|
248
259
|
toggle() {
|
|
249
260
|
this._isOpen = !this._isOpen;
|
|
261
|
+
this.markDirty();
|
|
250
262
|
}
|
|
251
263
|
selectNext() {
|
|
252
264
|
let n = this._selectedIndex + 1;
|
|
253
265
|
while (n < this._options.length && this._options[n].disabled) n++;
|
|
254
|
-
if (n < this._options.length)
|
|
266
|
+
if (n < this._options.length) {
|
|
267
|
+
this._selectedIndex = n;
|
|
268
|
+
this.markDirty();
|
|
269
|
+
}
|
|
255
270
|
}
|
|
256
271
|
selectPrev() {
|
|
257
272
|
let n = this._selectedIndex - 1;
|
|
258
273
|
while (n >= 0 && this._options[n].disabled) n--;
|
|
259
|
-
if (n >= 0)
|
|
274
|
+
if (n >= 0) {
|
|
275
|
+
this._selectedIndex = n;
|
|
276
|
+
this.markDirty();
|
|
277
|
+
}
|
|
260
278
|
}
|
|
261
279
|
confirm() {
|
|
262
280
|
const opt = this._options[this._selectedIndex];
|
|
263
281
|
if (opt && !opt.disabled) {
|
|
264
282
|
this._onSelect?.(opt, this._selectedIndex);
|
|
265
283
|
this._isOpen = false;
|
|
284
|
+
this.markDirty();
|
|
266
285
|
}
|
|
267
286
|
}
|
|
268
287
|
_renderSelf(screen) {
|
|
@@ -315,17 +334,24 @@ var MultiSelect = class extends import_widgets6.Widget {
|
|
|
315
334
|
selectNext() {
|
|
316
335
|
let n = this._cursorIndex + 1;
|
|
317
336
|
while (n < this._options.length && this._options[n].disabled) n++;
|
|
318
|
-
if (n < this._options.length)
|
|
337
|
+
if (n < this._options.length) {
|
|
338
|
+
this._cursorIndex = n;
|
|
339
|
+
this.markDirty();
|
|
340
|
+
}
|
|
319
341
|
}
|
|
320
342
|
selectPrev() {
|
|
321
343
|
let n = this._cursorIndex - 1;
|
|
322
344
|
while (n >= 0 && this._options[n].disabled) n--;
|
|
323
|
-
if (n >= 0)
|
|
345
|
+
if (n >= 0) {
|
|
346
|
+
this._cursorIndex = n;
|
|
347
|
+
this.markDirty();
|
|
348
|
+
}
|
|
324
349
|
}
|
|
325
350
|
toggleCurrent() {
|
|
326
351
|
const o = this._options[this._cursorIndex];
|
|
327
352
|
if (o && !o.disabled) {
|
|
328
353
|
this._checked.has(this._cursorIndex) ? this._checked.delete(this._cursorIndex) : this._checked.add(this._cursorIndex);
|
|
354
|
+
this.markDirty();
|
|
329
355
|
}
|
|
330
356
|
}
|
|
331
357
|
submit() {
|
|
@@ -380,15 +406,24 @@ var Tree = class extends import_widgets7.Widget {
|
|
|
380
406
|
}
|
|
381
407
|
selectNext() {
|
|
382
408
|
const f = this._flatten();
|
|
383
|
-
if (this._cursorIndex < f.length - 1)
|
|
409
|
+
if (this._cursorIndex < f.length - 1) {
|
|
410
|
+
this._cursorIndex++;
|
|
411
|
+
this.markDirty();
|
|
412
|
+
}
|
|
384
413
|
}
|
|
385
414
|
selectPrev() {
|
|
386
|
-
if (this._cursorIndex > 0)
|
|
415
|
+
if (this._cursorIndex > 0) {
|
|
416
|
+
this._cursorIndex--;
|
|
417
|
+
this.markDirty();
|
|
418
|
+
}
|
|
387
419
|
}
|
|
388
420
|
toggleExpand() {
|
|
389
421
|
const f = this._flatten();
|
|
390
422
|
const it = f[this._cursorIndex];
|
|
391
|
-
if (it?.hasChildren)
|
|
423
|
+
if (it?.hasChildren) {
|
|
424
|
+
it.node.expanded = !it.node.expanded;
|
|
425
|
+
this.markDirty();
|
|
426
|
+
}
|
|
392
427
|
}
|
|
393
428
|
confirm() {
|
|
394
429
|
const f = this._flatten();
|
|
@@ -432,6 +467,7 @@ var Toast = class extends import_widgets8.Widget {
|
|
|
432
467
|
}
|
|
433
468
|
push(text, type = "info") {
|
|
434
469
|
this._messages.push({ text, type, expireAt: Date.now() + this._durationMs });
|
|
470
|
+
this.markDirty();
|
|
435
471
|
}
|
|
436
472
|
info(text) {
|
|
437
473
|
this.push(text, "info");
|
|
@@ -493,22 +529,28 @@ var ConfirmDialog = class extends import_widgets9.Widget {
|
|
|
493
529
|
show() {
|
|
494
530
|
this._visible = true;
|
|
495
531
|
this._selected = "confirm";
|
|
532
|
+
this.markDirty();
|
|
496
533
|
}
|
|
497
534
|
hide() {
|
|
498
535
|
this._visible = false;
|
|
536
|
+
this.markDirty();
|
|
499
537
|
}
|
|
500
538
|
selectConfirm() {
|
|
501
539
|
this._selected = "confirm";
|
|
540
|
+
this.markDirty();
|
|
502
541
|
}
|
|
503
542
|
selectCancel() {
|
|
504
543
|
this._selected = "cancel";
|
|
544
|
+
this.markDirty();
|
|
505
545
|
}
|
|
506
546
|
toggleSelection() {
|
|
507
547
|
this._selected = this._selected === "confirm" ? "cancel" : "confirm";
|
|
548
|
+
this.markDirty();
|
|
508
549
|
}
|
|
509
550
|
confirm() {
|
|
510
551
|
(this._selected === "confirm" ? this._onConfirm : this._onCancel)?.();
|
|
511
552
|
this._visible = false;
|
|
553
|
+
this.markDirty();
|
|
512
554
|
}
|
|
513
555
|
_renderSelf(screen) {
|
|
514
556
|
if (!this._visible) return;
|
|
@@ -569,12 +611,14 @@ var Form = class extends import_widgets10.Widget {
|
|
|
569
611
|
if (this._activeField < this._fields.length) {
|
|
570
612
|
this._activeField++;
|
|
571
613
|
this._cursorPos = 0;
|
|
614
|
+
this.markDirty();
|
|
572
615
|
}
|
|
573
616
|
}
|
|
574
617
|
prevField() {
|
|
575
618
|
if (this._activeField > 0) {
|
|
576
619
|
this._activeField--;
|
|
577
620
|
this._cursorPos = (this._values.get(this._fields[this._activeField].name) ?? "").length;
|
|
621
|
+
this.markDirty();
|
|
578
622
|
}
|
|
579
623
|
}
|
|
580
624
|
insertChar(ch) {
|
|
@@ -584,6 +628,7 @@ var Form = class extends import_widgets10.Widget {
|
|
|
584
628
|
this._values.set(f.name, cur.slice(0, this._cursorPos) + ch + cur.slice(this._cursorPos));
|
|
585
629
|
this._cursorPos++;
|
|
586
630
|
this._errors.delete(f.name);
|
|
631
|
+
this.markDirty();
|
|
587
632
|
}
|
|
588
633
|
deleteBack() {
|
|
589
634
|
if (this._activeField >= this._fields.length) return;
|
|
@@ -592,6 +637,7 @@ var Form = class extends import_widgets10.Widget {
|
|
|
592
637
|
if (this._cursorPos > 0) {
|
|
593
638
|
this._values.set(f.name, cur.slice(0, this._cursorPos - 1) + cur.slice(this._cursorPos));
|
|
594
639
|
this._cursorPos--;
|
|
640
|
+
this.markDirty();
|
|
595
641
|
}
|
|
596
642
|
}
|
|
597
643
|
submit() {
|
|
@@ -612,6 +658,7 @@ var Form = class extends import_widgets10.Widget {
|
|
|
612
658
|
}
|
|
613
659
|
}
|
|
614
660
|
if (!hasErr) this._onSubmit?.(this.values);
|
|
661
|
+
this.markDirty();
|
|
615
662
|
}
|
|
616
663
|
_renderSelf(screen) {
|
|
617
664
|
const { x, y, width, height } = this._rect;
|
|
@@ -670,9 +717,11 @@ var CommandPalette = class extends import_widgets11.Widget {
|
|
|
670
717
|
this._cursorPos = 0;
|
|
671
718
|
this._selectedIndex = 0;
|
|
672
719
|
this._filtered = [...this._commands];
|
|
720
|
+
this.markDirty();
|
|
673
721
|
}
|
|
674
722
|
hide() {
|
|
675
723
|
this._visible = false;
|
|
724
|
+
this.markDirty();
|
|
676
725
|
}
|
|
677
726
|
toggle() {
|
|
678
727
|
this._visible ? this.hide() : this.show();
|
|
@@ -681,19 +730,27 @@ var CommandPalette = class extends import_widgets11.Widget {
|
|
|
681
730
|
this._query = this._query.slice(0, this._cursorPos) + ch + this._query.slice(this._cursorPos);
|
|
682
731
|
this._cursorPos++;
|
|
683
732
|
this._filter();
|
|
733
|
+
this.markDirty();
|
|
684
734
|
}
|
|
685
735
|
deleteBack() {
|
|
686
736
|
if (this._cursorPos > 0) {
|
|
687
737
|
this._query = this._query.slice(0, this._cursorPos - 1) + this._query.slice(this._cursorPos);
|
|
688
738
|
this._cursorPos--;
|
|
689
739
|
this._filter();
|
|
740
|
+
this.markDirty();
|
|
690
741
|
}
|
|
691
742
|
}
|
|
692
743
|
selectNext() {
|
|
693
|
-
if (this._selectedIndex < this._filtered.length - 1)
|
|
744
|
+
if (this._selectedIndex < this._filtered.length - 1) {
|
|
745
|
+
this._selectedIndex++;
|
|
746
|
+
this.markDirty();
|
|
747
|
+
}
|
|
694
748
|
}
|
|
695
749
|
selectPrev() {
|
|
696
|
-
if (this._selectedIndex > 0)
|
|
750
|
+
if (this._selectedIndex > 0) {
|
|
751
|
+
this._selectedIndex--;
|
|
752
|
+
this.markDirty();
|
|
753
|
+
}
|
|
697
754
|
}
|
|
698
755
|
confirm() {
|
|
699
756
|
const c = this._filtered[this._selectedIndex];
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/Divider.ts","../src/Spacer.ts","../src/Tabs.ts","../src/Modal.ts","../src/Select.ts","../src/MultiSelect.ts","../src/Tree.ts","../src/Toast.ts","../src/ConfirmDialog.ts","../src/Form.ts","../src/CommandPalette.ts"],"sourcesContent":["// ─────────────────────────────────────────────────────\n// @termuijs/ui — Rich Component Library\n//\n// The shadcn/ui for terminals — 16+ production-ready\n// components for building beautiful CLI apps.\n// ─────────────────────────────────────────────────────\n\n// ── Re-exports from @termuijs/widgets (base components) ──\nexport {\n Box,\n Text,\n Table,\n List,\n TextInput,\n Gauge,\n Sparkline,\n StatusIndicator,\n LogView,\n ProgressBar,\n Spinner,\n Widget,\n} from '@termuijs/widgets';\n\n// ── New components ──\nexport { Divider } from './Divider.js';\nexport type { DividerOptions } from './Divider.js';\n\nexport { Spacer } from './Spacer.js';\n\nexport { Tabs } from './Tabs.js';\nexport type { Tab, TabsOptions } from './Tabs.js';\n\nexport { Modal } from './Modal.js';\nexport type { ModalOptions } from './Modal.js';\n\nexport { Select } from './Select.js';\nexport type { SelectOption, SelectOptions } from './Select.js';\n\nexport { MultiSelect } from './MultiSelect.js';\nexport type { MultiSelectOption, MultiSelectOptions } from './MultiSelect.js';\n\nexport { Tree } from './Tree.js';\nexport type { TreeNode, TreeOptions } from './Tree.js';\n\nexport { Toast } from './Toast.js';\nexport type { ToastType, ToastMessage, ToastOptions } from './Toast.js';\n\nexport { ConfirmDialog } from './ConfirmDialog.js';\nexport type { ConfirmDialogOptions } from './ConfirmDialog.js';\n\nexport { Form } from './Form.js';\nexport type { FormField, FormOptions } from './Form.js';\n\nexport { CommandPalette } from './CommandPalette.js';\nexport type { Command, CommandPaletteOptions } from './CommandPalette.js';\n","// Divider — horizontal separator line\nimport { Widget } from '@termuijs/widgets';\nimport { type Style, type Screen, mergeStyles, defaultStyle, styleToCellAttrs } from '@termuijs/core';\n\nexport interface DividerOptions {\n char?: string;\n color?: Style['fg'];\n title?: string;\n}\n\nexport class Divider extends Widget {\n private _char: string;\n private _color: Style['fg'];\n private _title: string;\n\n constructor(options: DividerOptions = {}) {\n super(mergeStyles(defaultStyle(), { height: 1 }));\n this._char = options.char ?? '─';\n this._color = options.color;\n this._title = options.title ?? '';\n }\n\n protected _renderSelf(screen: Screen): void {\n const { x, y, width } = this._rect;\n if (width <= 0) return;\n const attrs = styleToCellAttrs(this.style);\n if (this._color) attrs.fg = this._color;\n attrs.dim = true;\n if (this._title) {\n const titleStr = ` ${this._title} `;\n const padLeft = Math.max(0, Math.floor((width - titleStr.length) / 2));\n const padRight = Math.max(0, width - padLeft - titleStr.length);\n const line = this._char.repeat(padLeft) + titleStr + this._char.repeat(padRight);\n screen.writeString(x, y, line.slice(0, width), attrs);\n } else {\n screen.writeString(x, y, this._char.repeat(width), attrs);\n }\n }\n}\n","// Spacer — flexible empty space\nimport { Widget } from '@termuijs/widgets';\nimport { type Screen, mergeStyles, defaultStyle } from '@termuijs/core';\n\nexport class Spacer extends Widget {\n constructor(grow: number = 1) {\n super(mergeStyles(defaultStyle(), { flexGrow: grow }));\n }\n protected _renderSelf(_screen: Screen): void { /* empty */ }\n}\n","// Tabs — tabbed container with keyboard switching\nimport { Widget } from '@termuijs/widgets';\nimport { type Style, type Screen, mergeStyles, defaultStyle, styleToCellAttrs } from '@termuijs/core';\n\nexport interface Tab { label: string; content: Widget; }\nexport interface TabsOptions {\n activeColor?: Style['fg'];\n inactiveColor?: Style['fg'];\n border?: Style['border'];\n}\n\nexport class Tabs extends Widget {\n private _tabs: Tab[] = [];\n private _activeIndex = 0;\n private _activeColor: Style['fg'];\n private _inactiveColor: Style['fg'];\n focusable = true;\n\n constructor(tabs: Tab[], options: TabsOptions = {}) {\n super(mergeStyles(defaultStyle(), { flexGrow: 1, border: options.border ?? 'single' }));\n this._tabs = tabs;\n this._activeColor = options.activeColor ?? { type: 'named', name: 'cyan' };\n this._inactiveColor = options.inactiveColor ?? { type: 'named', name: 'brightBlack' };\n }\n\n get activeIndex(): number { return this._activeIndex; }\n selectTab(i: number): void { if (i >= 0 && i < this._tabs.length) this._activeIndex = i; }\n nextTab(): void { this._activeIndex = (this._activeIndex + 1) % this._tabs.length; }\n prevTab(): void { this._activeIndex = (this._activeIndex - 1 + this._tabs.length) % this._tabs.length; }\n get activeContent(): Widget | undefined { return this._tabs[this._activeIndex]?.content; }\n\n protected _renderSelf(screen: Screen): void {\n const { x, y, width, height } = this._rect;\n if (width <= 0 || height <= 0) return;\n const attrs = styleToCellAttrs(this.style);\n let col = x;\n for (let i = 0; i < this._tabs.length; i++) {\n const tab = this._tabs[i];\n const isActive = i === this._activeIndex;\n const label = isActive ? ` ● ${tab.label} ` : ` ${tab.label} `;\n screen.writeString(col, y, label, {\n ...attrs,\n fg: isActive ? this._activeColor : this._inactiveColor,\n bold: isActive, dim: !isActive,\n });\n col += label.length;\n if (i < this._tabs.length - 1) { screen.writeString(col, y, '│', { ...attrs, dim: true }); col++; }\n }\n if (height > 1) screen.writeString(x, y + 1, '─'.repeat(width), { ...attrs, dim: true });\n }\n}\n","// Modal — overlay dialog with backdrop\nimport { Widget } from '@termuijs/widgets';\nimport { type Style, type Screen, mergeStyles, defaultStyle, styleToCellAttrs, getBorderChars } from '@termuijs/core';\n\nexport interface ModalOptions {\n title?: string;\n width?: number;\n height?: number;\n borderColor?: Style['fg'];\n backdropChar?: string;\n}\n\nexport class Modal extends Widget {\n private _title: string;\n private _modalWidth: number;\n private _modalHeight: number;\n private _borderColor: Style['fg'];\n private _backdropChar: string;\n private _visible = false;\n private _content: Widget | null = null;\n\n constructor(options: ModalOptions = {}) {\n super(mergeStyles(defaultStyle(), {}));\n this._title = options.title ?? '';\n this._modalWidth = options.width ?? 50;\n this._modalHeight = options.height ?? 15;\n this._borderColor = options.borderColor ?? { type: 'named', name: 'cyan' };\n this._backdropChar = options.backdropChar ?? '░';\n }\n\n get visible(): boolean { return this._visible; }\n show(): void { this._visible = true; }\n hide(): void { this._visible = false; }\n toggle(): void { this._visible = !this._visible; }\n setContent(content: Widget): void { this._content = content; }\n\n protected _renderSelf(screen: Screen): void {\n if (!this._visible) return;\n const { x, y, width, height } = this._rect;\n const attrs = styleToCellAttrs(this.style);\n // Backdrop\n for (let r = 0; r < height; r++) {\n screen.writeString(x, y + r, this._backdropChar.repeat(width), { ...attrs, dim: true });\n }\n // Centered modal\n const mw = Math.min(this._modalWidth, width - 4);\n const mh = Math.min(this._modalHeight, height - 2);\n const mx = x + Math.floor((width - mw) / 2);\n const my = y + Math.floor((height - mh) / 2);\n const border = getBorderChars('single');\n if (!border) return;\n const bAttrs = { ...attrs, fg: this._borderColor };\n // Title bar\n const titleStr = this._title ? ` ${this._title} ` : '';\n const topFill = mw - 2 - titleStr.length;\n const tl = Math.floor(topFill / 2);\n const tr = topFill - tl;\n screen.writeString(mx, my, border.topLeft + border.top.repeat(tl) + titleStr + border.top.repeat(Math.max(0, tr)) + border.topRight, bAttrs);\n // Sides\n const clr = styleToCellAttrs(this.style);\n for (let r = 1; r < mh - 1; r++) {\n screen.writeString(mx, my + r, border.left, bAttrs);\n screen.writeString(mx + 1, my + r, ' '.repeat(mw - 2), clr);\n screen.writeString(mx + mw - 1, my + r, border.right, bAttrs);\n }\n // Bottom\n screen.writeString(mx, my + mh - 1, border.bottomLeft + border.bottom.repeat(mw - 2) + border.bottomRight, bAttrs);\n // Content\n if (this._content) {\n const cr = { x: mx + 2, y: my + 1, width: mw - 4, height: mh - 2 };\n (this._content as any)._rect = cr;\n (this._content as any)._renderSelf(screen);\n }\n }\n}\n","// Select — single-item dropdown selector\nimport { Widget } from '@termuijs/widgets';\nimport { type Style, type Screen, mergeStyles, defaultStyle, styleToCellAttrs } from '@termuijs/core';\n\nexport interface SelectOption { label: string; value: string; disabled?: boolean; }\nexport interface SelectOptions {\n placeholder?: string;\n activeColor?: Style['fg'];\n onSelect?: (option: SelectOption, index: number) => void;\n}\n\nexport class Select extends Widget {\n private _options: SelectOption[];\n private _selectedIndex = 0;\n private _isOpen = false;\n private _placeholder: string;\n private _activeColor: Style['fg'];\n private _onSelect?: (option: SelectOption, index: number) => void;\n focusable = true;\n\n constructor(options: SelectOption[], config: SelectOptions = {}) {\n super(mergeStyles(defaultStyle(), { height: 1 }));\n this._options = options;\n this._placeholder = config.placeholder ?? 'Select...';\n this._activeColor = config.activeColor ?? { type: 'named', name: 'cyan' };\n this._onSelect = config.onSelect;\n }\n\n get selectedOption(): SelectOption | undefined { return this._options[this._selectedIndex]; }\n get selectedIndex(): number { return this._selectedIndex; }\n get isOpen(): boolean { return this._isOpen; }\n open(): void { this._isOpen = true; }\n close(): void { this._isOpen = false; }\n toggle(): void { this._isOpen = !this._isOpen; }\n\n selectNext(): void {\n let n = this._selectedIndex + 1;\n while (n < this._options.length && this._options[n].disabled) n++;\n if (n < this._options.length) this._selectedIndex = n;\n }\n selectPrev(): void {\n let n = this._selectedIndex - 1;\n while (n >= 0 && this._options[n].disabled) n--;\n if (n >= 0) this._selectedIndex = n;\n }\n confirm(): void {\n const opt = this._options[this._selectedIndex];\n if (opt && !opt.disabled) { this._onSelect?.(opt, this._selectedIndex); this._isOpen = false; }\n }\n\n protected _renderSelf(screen: Screen): void {\n const { x, y, width } = this._rect;\n if (width <= 0) return;\n const attrs = styleToCellAttrs(this.style);\n const sel = this._options[this._selectedIndex];\n const label = sel ? sel.label : this._placeholder;\n const prefix = this._isOpen ? '▼ ' : '▶ ';\n screen.writeString(x, y, prefix + label.slice(0, width - 2), { ...attrs, fg: this._activeColor });\n if (this._isOpen) {\n for (let i = 0; i < this._options.length; i++) {\n const o = this._options[i];\n const isSel = i === this._selectedIndex;\n const m = isSel ? '● ' : ' ';\n screen.writeString(x, y + 1 + i, m + o.label.slice(0, width - 2), {\n ...attrs,\n fg: o.disabled ? { type: 'named' as const, name: 'brightBlack' as const } : isSel ? this._activeColor : attrs.fg,\n bold: isSel, dim: o.disabled,\n });\n }\n }\n }\n}\n","// MultiSelect — checkbox-style multi-item selector\nimport { Widget } from '@termuijs/widgets';\nimport { type Style, type Screen, mergeStyles, defaultStyle, styleToCellAttrs } from '@termuijs/core';\n\nexport interface MultiSelectOption { label: string; value: string; disabled?: boolean; }\nexport interface MultiSelectOptions {\n activeColor?: Style['fg'];\n checkChar?: string;\n uncheckChar?: string;\n onSubmit?: (selected: MultiSelectOption[]) => void;\n}\n\nexport class MultiSelect extends Widget {\n private _options: MultiSelectOption[];\n private _cursorIndex = 0;\n private _checked: Set<number> = new Set();\n private _activeColor: Style['fg'];\n private _checkChar: string;\n private _uncheckChar: string;\n private _onSubmit?: (selected: MultiSelectOption[]) => void;\n focusable = true;\n\n constructor(options: MultiSelectOption[], config: MultiSelectOptions = {}) {\n super(mergeStyles(defaultStyle(), { height: Math.max(options.length, 1) }));\n this._options = options;\n this._activeColor = config.activeColor ?? { type: 'named', name: 'cyan' };\n this._checkChar = config.checkChar ?? '◼';\n this._uncheckChar = config.uncheckChar ?? '◻';\n this._onSubmit = config.onSubmit;\n }\n\n get selectedOptions(): MultiSelectOption[] {\n return [...this._checked].sort().map(i => this._options[i]);\n }\n selectNext(): void { let n = this._cursorIndex + 1; while (n < this._options.length && this._options[n].disabled) n++; if (n < this._options.length) this._cursorIndex = n; }\n selectPrev(): void { let n = this._cursorIndex - 1; while (n >= 0 && this._options[n].disabled) n--; if (n >= 0) this._cursorIndex = n; }\n toggleCurrent(): void {\n const o = this._options[this._cursorIndex];\n if (o && !o.disabled) { this._checked.has(this._cursorIndex) ? this._checked.delete(this._cursorIndex) : this._checked.add(this._cursorIndex); }\n }\n submit(): void { this._onSubmit?.(this.selectedOptions); }\n\n protected _renderSelf(screen: Screen): void {\n const { x, y, width, height } = this._rect;\n if (width <= 0 || height <= 0) return;\n const attrs = styleToCellAttrs(this.style);\n for (let i = 0; i < this._options.length && i < height; i++) {\n const o = this._options[i];\n const active = i === this._cursorIndex;\n const checked = this._checked.has(i);\n const label = `${active ? '❯ ' : ' '}${checked ? this._checkChar : this._uncheckChar} ${o.label}`;\n screen.writeString(x, y + i, label.slice(0, width), {\n ...attrs,\n fg: o.disabled ? { type: 'named' as const, name: 'brightBlack' as const } : active ? this._activeColor : attrs.fg,\n bold: active, dim: o.disabled,\n });\n }\n }\n}\n","// Tree — expandable/collapsible tree view\nimport { Widget } from '@termuijs/widgets';\nimport { type Style, type Screen, mergeStyles, defaultStyle, styleToCellAttrs } from '@termuijs/core';\n\nexport interface TreeNode { label: string; children?: TreeNode[]; expanded?: boolean; icon?: string; }\nexport interface TreeOptions { activeColor?: Style['fg']; onSelect?: (node: TreeNode, path: number[]) => void; }\n\nexport class Tree extends Widget {\n private _roots: TreeNode[];\n private _cursorIndex = 0;\n private _activeColor: Style['fg'];\n private _onSelect?: (node: TreeNode, path: number[]) => void;\n focusable = true;\n\n constructor(roots: TreeNode[], options: TreeOptions = {}) {\n super(mergeStyles(defaultStyle(), { flexGrow: 1 }));\n this._roots = roots;\n this._activeColor = options.activeColor ?? { type: 'named', name: 'cyan' };\n this._onSelect = options.onSelect;\n }\n\n private _flatten(): { node: TreeNode; depth: number; path: number[]; hasChildren: boolean }[] {\n const result: { node: TreeNode; depth: number; path: number[]; hasChildren: boolean }[] = [];\n const walk = (nodes: TreeNode[], depth: number, path: number[]) => {\n for (let i = 0; i < nodes.length; i++) {\n const node = nodes[i];\n const hasChildren = (node.children?.length ?? 0) > 0;\n result.push({ node, depth, path: [...path, i], hasChildren });\n if (hasChildren && node.expanded) walk(node.children!, depth + 1, [...path, i]);\n }\n };\n walk(this._roots, 0, []);\n return result;\n }\n\n selectNext(): void { const f = this._flatten(); if (this._cursorIndex < f.length - 1) this._cursorIndex++; }\n selectPrev(): void { if (this._cursorIndex > 0) this._cursorIndex--; }\n toggleExpand(): void { const f = this._flatten(); const it = f[this._cursorIndex]; if (it?.hasChildren) it.node.expanded = !it.node.expanded; }\n confirm(): void {\n const f = this._flatten(); const it = f[this._cursorIndex];\n if (it) { it.hasChildren ? this.toggleExpand() : this._onSelect?.(it.node, it.path); }\n }\n\n protected _renderSelf(screen: Screen): void {\n const { x, y, width, height } = this._rect;\n if (width <= 0 || height <= 0) return;\n const attrs = styleToCellAttrs(this.style);\n const flat = this._flatten();\n for (let i = 0; i < flat.length && i < height; i++) {\n const it = flat[i];\n const active = i === this._cursorIndex;\n const indent = ' '.repeat(it.depth);\n const icon = it.hasChildren ? (it.node.expanded ? '▼ ' : '▶ ') : ' ';\n const nodeIcon = it.node.icon ? `${it.node.icon} ` : '';\n const line = `${indent}${icon}${nodeIcon}${it.node.label}`;\n screen.writeString(x, y + i, line.slice(0, width), { ...attrs, fg: active ? this._activeColor : attrs.fg, bold: active });\n }\n }\n}\n","// Toast — auto-dismiss notification\nimport { Widget } from '@termuijs/widgets';\nimport { type Screen, mergeStyles, defaultStyle, styleToCellAttrs } from '@termuijs/core';\n\nexport type ToastType = 'info' | 'success' | 'warning' | 'error';\nexport interface ToastMessage { text: string; type: ToastType; expireAt: number; }\nexport interface ToastOptions { position?: 'top-right' | 'bottom-right' | 'top-left' | 'bottom-left'; durationMs?: number; maxVisible?: number; }\n\nconst ICONS: Record<ToastType, string> = { info: 'ℹ', success: '✓', warning: '⚠', error: '✗' };\nconst COLORS: Record<ToastType, string> = { info: 'cyan', success: 'green', warning: 'yellow', error: 'red' };\n\nexport class Toast extends Widget {\n private _messages: ToastMessage[] = [];\n private _position: string;\n private _durationMs: number;\n private _maxVisible: number;\n\n constructor(options: ToastOptions = {}) {\n super(mergeStyles(defaultStyle(), {}));\n this._position = options.position ?? 'top-right';\n this._durationMs = options.durationMs ?? 3000;\n this._maxVisible = options.maxVisible ?? 5;\n }\n\n push(text: string, type: ToastType = 'info'): void { this._messages.push({ text, type, expireAt: Date.now() + this._durationMs }); }\n info(text: string): void { this.push(text, 'info'); }\n success(text: string): void { this.push(text, 'success'); }\n warning(text: string): void { this.push(text, 'warning'); }\n error(text: string): void { this.push(text, 'error'); }\n\n protected _renderSelf(screen: Screen): void {\n const now = Date.now();\n this._messages = this._messages.filter(m => m.expireAt > now);\n if (this._messages.length === 0) return;\n const { x, y, width, height } = this._rect;\n const visible = this._messages.slice(-this._maxVisible);\n const tw = Math.min(40, width - 2);\n const isRight = this._position.includes('right');\n const isBottom = this._position.includes('bottom');\n const sx = isRight ? x + width - tw - 1 : x + 1;\n const sy = isBottom ? y + height - visible.length - 1 : y + 1;\n const attrs = styleToCellAttrs(this.style);\n for (let i = 0; i < visible.length; i++) {\n const m = visible[i];\n const label = ` ${ICONS[m.type]} ${m.text} `.slice(0, tw).padEnd(tw);\n screen.writeString(sx, sy + i, label, { ...attrs, fg: { type: 'named', name: COLORS[m.type] as any }, bold: true });\n }\n }\n}\n","// ConfirmDialog — yes/no prompt overlay\nimport { Widget } from '@termuijs/widgets';\nimport { type Style, type Screen, mergeStyles, defaultStyle, styleToCellAttrs, getBorderChars } from '@termuijs/core';\n\nexport interface ConfirmDialogOptions {\n message: string;\n confirmLabel?: string;\n cancelLabel?: string;\n borderColor?: Style['fg'];\n onConfirm?: () => void;\n onCancel?: () => void;\n}\n\nexport class ConfirmDialog extends Widget {\n private _message: string;\n private _confirmLabel: string;\n private _cancelLabel: string;\n private _borderColor: Style['fg'];\n private _selected: 'confirm' | 'cancel' = 'confirm';\n private _visible = false;\n private _onConfirm?: () => void;\n private _onCancel?: () => void;\n focusable = true;\n\n constructor(options: ConfirmDialogOptions) {\n super(mergeStyles(defaultStyle(), {}));\n this._message = options.message;\n this._confirmLabel = options.confirmLabel ?? 'Yes';\n this._cancelLabel = options.cancelLabel ?? 'No';\n this._borderColor = options.borderColor ?? { type: 'named', name: 'yellow' };\n this._onConfirm = options.onConfirm;\n this._onCancel = options.onCancel;\n }\n\n get visible(): boolean { return this._visible; }\n show(): void { this._visible = true; this._selected = 'confirm'; }\n hide(): void { this._visible = false; }\n selectConfirm(): void { this._selected = 'confirm'; }\n selectCancel(): void { this._selected = 'cancel'; }\n toggleSelection(): void { this._selected = this._selected === 'confirm' ? 'cancel' : 'confirm'; }\n confirm(): void {\n (this._selected === 'confirm' ? this._onConfirm : this._onCancel)?.();\n this._visible = false;\n }\n\n protected _renderSelf(screen: Screen): void {\n if (!this._visible) return;\n const { x, y, width, height } = this._rect;\n const attrs = styleToCellAttrs(this.style);\n for (let r = 0; r < height; r++) screen.writeString(x, y + r, '░'.repeat(width), { ...attrs, dim: true });\n const bw = Math.min(40, width - 4);\n const bh = 5;\n const bx = x + Math.floor((width - bw) / 2);\n const by = y + Math.floor((height - bh) / 2);\n const border = getBorderChars('single');\n if (!border) return;\n const ba = { ...attrs, fg: this._borderColor };\n screen.writeString(bx, by, border.topLeft + border.top.repeat(bw - 2) + border.topRight, ba);\n for (let r = 1; r < bh - 1; r++) {\n screen.writeString(bx, by + r, border.left, ba);\n screen.writeString(bx + 1, by + r, ' '.repeat(bw - 2), attrs);\n screen.writeString(bx + bw - 1, by + r, border.right, ba);\n }\n screen.writeString(bx, by + bh - 1, border.bottomLeft + border.bottom.repeat(bw - 2) + border.bottomRight, ba);\n screen.writeString(bx + 2, by + 1, this._message.slice(0, bw - 4), { ...attrs, bold: true });\n const yesStr = this._selected === 'confirm' ? ` [${this._confirmLabel}] ` : ` ${this._confirmLabel} `;\n const noStr = this._selected === 'cancel' ? ` [${this._cancelLabel}] ` : ` ${this._cancelLabel} `;\n screen.writeString(bx + 2, by + 3, yesStr, { ...attrs, fg: this._selected === 'confirm' ? { type: 'named', name: 'green' } : attrs.fg, bold: this._selected === 'confirm' });\n screen.writeString(bx + 2 + yesStr.length + 2, by + 3, noStr, { ...attrs, fg: this._selected === 'cancel' ? { type: 'named', name: 'red' } : attrs.fg, bold: this._selected === 'cancel' });\n }\n}\n","// Form — compound input container with validation\nimport { Widget } from '@termuijs/widgets';\nimport { type Style, type Screen, mergeStyles, defaultStyle, styleToCellAttrs } from '@termuijs/core';\n\nexport interface FormField {\n name: string; label: string; type: 'text' | 'select' | 'checkbox';\n placeholder?: string; required?: boolean; options?: string[];\n validate?: (value: string) => string | null;\n}\nexport interface FormOptions {\n labelColor?: Style['fg']; errorColor?: Style['fg']; activeColor?: Style['fg'];\n onSubmit?: (values: Record<string, string>) => void;\n}\n\nexport class Form extends Widget {\n private _fields: FormField[];\n private _values: Map<string, string> = new Map();\n private _errors: Map<string, string> = new Map();\n private _activeField = 0;\n private _cursorPos = 0;\n private _labelColor: Style['fg'];\n private _errorColor: Style['fg'];\n private _activeColor: Style['fg'];\n private _onSubmit?: (values: Record<string, string>) => void;\n focusable = true;\n\n constructor(fields: FormField[], options: FormOptions = {}) {\n super(mergeStyles(defaultStyle(), { height: fields.length * 2 + 1, flexGrow: 1 }));\n this._fields = fields;\n this._labelColor = options.labelColor ?? { type: 'named', name: 'cyan' };\n this._errorColor = options.errorColor ?? { type: 'named', name: 'red' };\n this._activeColor = options.activeColor ?? { type: 'named', name: 'cyan' };\n this._onSubmit = options.onSubmit;\n for (const f of fields) this._values.set(f.name, '');\n }\n\n get values(): Record<string, string> { const r: Record<string, string> = {}; for (const [k, v] of this._values) r[k] = v; return r; }\n nextField(): void { if (this._activeField < this._fields.length) { this._activeField++; this._cursorPos = 0; } }\n prevField(): void { if (this._activeField > 0) { this._activeField--; this._cursorPos = (this._values.get(this._fields[this._activeField].name) ?? '').length; } }\n insertChar(ch: string): void {\n if (this._activeField >= this._fields.length) return;\n const f = this._fields[this._activeField]; const cur = this._values.get(f.name) ?? '';\n this._values.set(f.name, cur.slice(0, this._cursorPos) + ch + cur.slice(this._cursorPos));\n this._cursorPos++; this._errors.delete(f.name);\n }\n deleteBack(): void {\n if (this._activeField >= this._fields.length) return;\n const f = this._fields[this._activeField]; const cur = this._values.get(f.name) ?? '';\n if (this._cursorPos > 0) { this._values.set(f.name, cur.slice(0, this._cursorPos - 1) + cur.slice(this._cursorPos)); this._cursorPos--; }\n }\n submit(): void {\n this._errors.clear(); let hasErr = false;\n for (const f of this._fields) {\n const v = this._values.get(f.name) ?? '';\n if (f.required && !v.trim()) { this._errors.set(f.name, `${f.label} is required`); hasErr = true; }\n if (f.validate) { const e = f.validate(v); if (e) { this._errors.set(f.name, e); hasErr = true; } }\n }\n if (!hasErr) this._onSubmit?.(this.values);\n }\n\n protected _renderSelf(screen: Screen): void {\n const { x, y, width, height } = this._rect;\n if (width <= 0 || height <= 0) return;\n const attrs = styleToCellAttrs(this.style);\n let row = 0;\n for (let i = 0; i < this._fields.length && row < height - 1; i++) {\n const f = this._fields[i]; const active = i === this._activeField;\n const val = this._values.get(f.name) ?? ''; const err = this._errors.get(f.name);\n screen.writeString(x, y + row, `${f.label}${f.required ? ' *' : ''}:`.slice(0, width), { ...attrs, fg: err ? this._errorColor : this._labelColor, bold: active }); row++;\n if (row >= height) break;\n const display = val || (f.placeholder ?? '');\n screen.writeString(x, y + row, `${active ? '❯ ' : ' '}${display}`.slice(0, width), { ...attrs, fg: active ? this._activeColor : attrs.fg, dim: !val && !!f.placeholder }); row++;\n }\n if (row < height) {\n const isSub = this._activeField >= this._fields.length;\n screen.writeString(x, y + row, isSub ? ' [ Submit ]' : ' Submit ', { ...attrs, fg: isSub ? { type: 'named', name: 'green' } : attrs.fg, bold: isSub });\n }\n }\n}\n","// CommandPalette — fuzzy-search command launcher\nimport { Widget } from '@termuijs/widgets';\nimport { type Style, type Screen, mergeStyles, defaultStyle, styleToCellAttrs, getBorderChars } from '@termuijs/core';\n\nexport interface Command { id: string; label: string; shortcut?: string; action: () => void; category?: string; }\nexport interface CommandPaletteOptions { placeholder?: string; borderColor?: Style['fg']; activeColor?: Style['fg']; maxVisible?: number; }\n\nexport class CommandPalette extends Widget {\n private _commands: Command[];\n private _filtered: Command[] = [];\n private _query = '';\n private _cursorPos = 0;\n private _selectedIndex = 0;\n private _visible = false;\n private _placeholder: string;\n private _borderColor: Style['fg'];\n private _activeColor: Style['fg'];\n private _maxVisible: number;\n focusable = true;\n\n constructor(commands: Command[], options: CommandPaletteOptions = {}) {\n super(mergeStyles(defaultStyle(), {}));\n this._commands = commands;\n this._filtered = [...commands];\n this._placeholder = options.placeholder ?? 'Type a command...';\n this._borderColor = options.borderColor ?? { type: 'named', name: 'cyan' };\n this._activeColor = options.activeColor ?? { type: 'named', name: 'cyan' };\n this._maxVisible = options.maxVisible ?? 10;\n }\n\n get visible(): boolean { return this._visible; }\n show(): void { this._visible = true; this._query = ''; this._cursorPos = 0; this._selectedIndex = 0; this._filtered = [...this._commands]; }\n hide(): void { this._visible = false; }\n toggle(): void { this._visible ? this.hide() : this.show(); }\n insertChar(ch: string): void { this._query = this._query.slice(0, this._cursorPos) + ch + this._query.slice(this._cursorPos); this._cursorPos++; this._filter(); }\n deleteBack(): void { if (this._cursorPos > 0) { this._query = this._query.slice(0, this._cursorPos - 1) + this._query.slice(this._cursorPos); this._cursorPos--; this._filter(); } }\n selectNext(): void { if (this._selectedIndex < this._filtered.length - 1) this._selectedIndex++; }\n selectPrev(): void { if (this._selectedIndex > 0) this._selectedIndex--; }\n confirm(): void { const c = this._filtered[this._selectedIndex]; if (c) { this.hide(); c.action(); } }\n\n private _filter(): void {\n const q = this._query.toLowerCase();\n if (!q) { this._filtered = [...this._commands]; } else {\n this._filtered = this._commands.filter(c => { const l = c.label.toLowerCase(); let qi = 0; for (let i = 0; i < l.length && qi < q.length; i++) { if (l[i] === q[qi]) qi++; } return qi === q.length; });\n }\n this._selectedIndex = 0;\n }\n\n protected _renderSelf(screen: Screen): void {\n if (!this._visible) return;\n const { x, y, width, height } = this._rect;\n const attrs = styleToCellAttrs(this.style);\n // Backdrop\n for (let r = 0; r < height; r++) screen.writeString(x, y + r, '░'.repeat(width), { ...attrs, dim: true });\n // Box\n const vis = this._filtered.slice(0, this._maxVisible);\n const bw = Math.min(60, width - 4);\n const bh = Math.min(vis.length + 3, height - 2);\n const bx = x + Math.floor((width - bw) / 2);\n const by = y + 2;\n const border = getBorderChars('single');\n if (!border) return;\n const ba = { ...attrs, fg: this._borderColor };\n // Top\n screen.writeString(bx, by, border.topLeft + border.top.repeat(bw - 2) + border.topRight, ba);\n // Input row\n screen.writeString(bx, by + 1, border.left, ba);\n const input = this._query || this._placeholder;\n screen.writeString(bx + 1, by + 1, (' 🔍 ' + input).slice(0, bw - 2).padEnd(bw - 2), { ...attrs, dim: !this._query });\n screen.writeString(bx + bw - 1, by + 1, border.right, ba);\n // Separator\n screen.writeString(bx, by + 2, border.left + '─'.repeat(bw - 2) + border.right, ba);\n // Items\n for (let i = 0; i < vis.length && i + 3 < bh - 1; i++) {\n const c = vis[i]; const active = i === this._selectedIndex;\n const label = (active ? '❯ ' : ' ') + c.label;\n const sc = c.shortcut ?? '';\n screen.writeString(bx, by + 3 + i, border.left, ba);\n screen.writeString(bx + 1, by + 3 + i, (' ' + label).slice(0, bw - sc.length - 3).padEnd(bw - sc.length - 3), { ...attrs, fg: active ? this._activeColor : attrs.fg, bold: active });\n if (sc) screen.writeString(bx + bw - sc.length - 2, by + 3 + i, sc, { ...attrs, dim: true });\n screen.writeString(bx + bw - 1, by + 3 + i, border.right, ba);\n }\n // Bottom\n const last = Math.min(by + 3 + vis.length, by + bh - 1);\n screen.writeString(bx, last, border.bottomLeft + border.bottom.repeat(bw - 2) + border.bottomRight, ba);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQA,IAAAA,mBAaO;;;ACpBP,qBAAuB;AACvB,kBAAqF;AAQ9E,IAAM,UAAN,cAAsB,sBAAO;AAAA,EACxB;AAAA,EACA;AAAA,EACA;AAAA,EAER,YAAY,UAA0B,CAAC,GAAG;AACtC,cAAM,6BAAY,0BAAa,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC;AAChD,SAAK,QAAQ,QAAQ,QAAQ;AAC7B,SAAK,SAAS,QAAQ;AACtB,SAAK,SAAS,QAAQ,SAAS;AAAA,EACnC;AAAA,EAEU,YAAY,QAAsB;AACxC,UAAM,EAAE,GAAG,GAAG,MAAM,IAAI,KAAK;AAC7B,QAAI,SAAS,EAAG;AAChB,UAAM,YAAQ,8BAAiB,KAAK,KAAK;AACzC,QAAI,KAAK,OAAQ,OAAM,KAAK,KAAK;AACjC,UAAM,MAAM;AACZ,QAAI,KAAK,QAA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G,YAAM,SAAS,MAAM,KAAK;AAC5C,YAAM,SAAS,SAAS,YAAO,QAAQ,EAAE;AACzC,YAAM,KAAK,EAAE,YAAY;AACzB,aAAO,YAAY,IAAI,KAAK,IAAI,GAAG,OAAO,MAAM,EAAE;AAClD,aAAO,YAAY,KAAK,GAAG,KAAK,IAAI,IAAI,MAAM,OAAO,MAAM,GAAG,KAAK,GAAG,SAAS,CAAC,EAAE,OAAO,KAAK,GAAG,SAAS,CAAC,GAAG,EAAE,GAAG,OAAO,IAAI,SAAS,KAAK,eAAe,MAAM,IAAI,MAAM,OAAO,CAAC;AACnL,UAAI,GAAI,QAAO,YAAY,KAAK,KAAK,GAAG,SAAS,GAAG,KAAK,IAAI,GAAG,IAAI,EAAE,GAAG,OAAO,KAAK,KAAK,CAAC;AAC3F,aAAO,YAAY,KAAK,KAAK,GAAG,KAAK,IAAI,GAAG,OAAO,OAAO,EAAE;AAAA,IAChE;AAEA,UAAM,OAAO,KAAK,IAAI,KAAK,IAAI,IAAI,QAAQ,KAAK,KAAK,CAAC;AACtD,WAAO,YAAY,IAAI,MAAM,OAAO,aAAa,OAAO,OAAO,OAAO,KAAK,CAAC,IAAI,OAAO,aAAa,EAAE;AAAA,EAC1G;AACJ;","names":["import_widgets","import_widgets","import_core","import_widgets","import_core","import_widgets","import_core","import_widgets","import_core","import_widgets","import_core","import_widgets","import_core","import_widgets","import_core","import_widgets","import_core","import_widgets","import_core","import_widgets","import_core"]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/Divider.ts","../src/Spacer.ts","../src/Tabs.ts","../src/Modal.ts","../src/Select.ts","../src/MultiSelect.ts","../src/Tree.ts","../src/Toast.ts","../src/ConfirmDialog.ts","../src/Form.ts","../src/CommandPalette.ts"],"sourcesContent":["// ─────────────────────────────────────────────────────\n// @termuijs/ui — Rich Component Library\n//\n// The shadcn/ui for terminals — 16+ production-ready\n// components for building beautiful CLI apps.\n// ─────────────────────────────────────────────────────\n\n// ── Re-exports from @termuijs/widgets (base components) ──\nexport {\n Box,\n Text,\n Table,\n List,\n TextInput,\n Gauge,\n Sparkline,\n StatusIndicator,\n LogView,\n ProgressBar,\n Spinner,\n Widget,\n} from '@termuijs/widgets';\n\n// ── New components ──\nexport { Divider } from './Divider.js';\nexport type { DividerOptions } from './Divider.js';\n\nexport { Spacer } from './Spacer.js';\n\nexport { Tabs } from './Tabs.js';\nexport type { Tab, TabsOptions } from './Tabs.js';\n\nexport { Modal } from './Modal.js';\nexport type { ModalOptions } from './Modal.js';\n\nexport { Select } from './Select.js';\nexport type { SelectOption, SelectOptions } from './Select.js';\n\nexport { MultiSelect } from './MultiSelect.js';\nexport type { MultiSelectOption, MultiSelectOptions } from './MultiSelect.js';\n\nexport { Tree } from './Tree.js';\nexport type { TreeNode, TreeOptions } from './Tree.js';\n\nexport { Toast } from './Toast.js';\nexport type { ToastType, ToastMessage, ToastOptions } from './Toast.js';\n\nexport { ConfirmDialog } from './ConfirmDialog.js';\nexport type { ConfirmDialogOptions } from './ConfirmDialog.js';\n\nexport { Form } from './Form.js';\nexport type { FormField, FormOptions } from './Form.js';\n\nexport { CommandPalette } from './CommandPalette.js';\nexport type { Command, CommandPaletteOptions } from './CommandPalette.js';\n","// Divider — horizontal separator line\nimport { Widget } from '@termuijs/widgets';\nimport { type Style, type Screen, mergeStyles, defaultStyle, styleToCellAttrs } from '@termuijs/core';\n\nexport interface DividerOptions {\n char?: string;\n color?: Style['fg'];\n title?: string;\n}\n\nexport class Divider extends Widget {\n private _char: string;\n private _color: Style['fg'];\n private _title: string;\n\n constructor(options: DividerOptions = {}) {\n super(mergeStyles(defaultStyle(), { height: 1 }));\n this._char = options.char ?? '─';\n this._color = options.color;\n this._title = options.title ?? '';\n }\n\n protected _renderSelf(screen: Screen): void {\n const { x, y, width } = this._rect;\n if (width <= 0) return;\n const attrs = styleToCellAttrs(this.style);\n if (this._color) attrs.fg = this._color;\n attrs.dim = true;\n if (this._title) {\n const titleStr = ` ${this._title} `;\n const padLeft = Math.max(0, Math.floor((width - titleStr.length) / 2));\n const padRight = Math.max(0, width - padLeft - titleStr.length);\n const line = this._char.repeat(padLeft) + titleStr + this._char.repeat(padRight);\n screen.writeString(x, y, line.slice(0, width), attrs);\n } else {\n screen.writeString(x, y, this._char.repeat(width), attrs);\n }\n }\n}\n","// Spacer — flexible empty space\nimport { Widget } from '@termuijs/widgets';\nimport { type Screen, mergeStyles, defaultStyle } from '@termuijs/core';\n\nexport class Spacer extends Widget {\n constructor(grow: number = 1) {\n super(mergeStyles(defaultStyle(), { flexGrow: grow }));\n }\n protected _renderSelf(_screen: Screen): void { /* empty */ }\n}\n","// Tabs — tabbed container with keyboard switching\nimport { Widget } from '@termuijs/widgets';\nimport { type Style, type Screen, mergeStyles, defaultStyle, styleToCellAttrs } from '@termuijs/core';\n\nexport interface Tab { label: string; content: Widget; }\nexport interface TabsOptions {\n activeColor?: Style['fg'];\n inactiveColor?: Style['fg'];\n border?: Style['border'];\n}\n\nexport class Tabs extends Widget {\n private _tabs: Tab[] = [];\n private _activeIndex = 0;\n private _activeColor: Style['fg'];\n private _inactiveColor: Style['fg'];\n focusable = true;\n\n constructor(tabs: Tab[], options: TabsOptions = {}) {\n super(mergeStyles(defaultStyle(), { flexGrow: 1, border: options.border ?? 'single' }));\n this._tabs = tabs;\n this._activeColor = options.activeColor ?? { type: 'named', name: 'cyan' };\n this._inactiveColor = options.inactiveColor ?? { type: 'named', name: 'brightBlack' };\n }\n\n get activeIndex(): number { return this._activeIndex; }\n selectTab(i: number): void { if (i >= 0 && i < this._tabs.length) { this._activeIndex = i; this.markDirty(); } }\n nextTab(): void { this._activeIndex = (this._activeIndex + 1) % this._tabs.length; this.markDirty(); }\n prevTab(): void { this._activeIndex = (this._activeIndex - 1 + this._tabs.length) % this._tabs.length; this.markDirty(); }\n get activeContent(): Widget | undefined { return this._tabs[this._activeIndex]?.content; }\n\n protected _renderSelf(screen: Screen): void {\n const { x, y, width, height } = this._rect;\n if (width <= 0 || height <= 0) return;\n const attrs = styleToCellAttrs(this.style);\n let col = x;\n for (let i = 0; i < this._tabs.length; i++) {\n const tab = this._tabs[i];\n const isActive = i === this._activeIndex;\n const label = isActive ? ` ● ${tab.label} ` : ` ${tab.label} `;\n screen.writeString(col, y, label, {\n ...attrs,\n fg: isActive ? this._activeColor : this._inactiveColor,\n bold: isActive, dim: !isActive,\n });\n col += label.length;\n if (i < this._tabs.length - 1) { screen.writeString(col, y, '│', { ...attrs, dim: true }); col++; }\n }\n if (height > 1) screen.writeString(x, y + 1, '─'.repeat(width), { ...attrs, dim: true });\n }\n}\n","// Modal — overlay dialog with backdrop\nimport { Widget } from '@termuijs/widgets';\nimport { type Style, type Screen, mergeStyles, defaultStyle, styleToCellAttrs, getBorderChars } from '@termuijs/core';\n\nexport interface ModalOptions {\n title?: string;\n width?: number;\n height?: number;\n borderColor?: Style['fg'];\n backdropChar?: string;\n}\n\nexport class Modal extends Widget {\n private _title: string;\n private _modalWidth: number;\n private _modalHeight: number;\n private _borderColor: Style['fg'];\n private _backdropChar: string;\n private _visible = false;\n private _content: Widget | null = null;\n\n constructor(options: ModalOptions = {}) {\n super(mergeStyles(defaultStyle(), {}));\n this._title = options.title ?? '';\n this._modalWidth = options.width ?? 50;\n this._modalHeight = options.height ?? 15;\n this._borderColor = options.borderColor ?? { type: 'named', name: 'cyan' };\n this._backdropChar = options.backdropChar ?? '░';\n }\n\n get visible(): boolean { return this._visible; }\n show(): void { this._visible = true; this.markDirty(); }\n hide(): void { this._visible = false; this.markDirty(); }\n toggle(): void { this._visible = !this._visible; this.markDirty(); }\n setContent(content: Widget): void { this._content = content; this.markDirty(); }\n\n protected _renderSelf(screen: Screen): void {\n if (!this._visible) return;\n const { x, y, width, height } = this._rect;\n const attrs = styleToCellAttrs(this.style);\n // Backdrop\n for (let r = 0; r < height; r++) {\n screen.writeString(x, y + r, this._backdropChar.repeat(width), { ...attrs, dim: true });\n }\n // Centered modal\n const mw = Math.min(this._modalWidth, width - 4);\n const mh = Math.min(this._modalHeight, height - 2);\n const mx = x + Math.floor((width - mw) / 2);\n const my = y + Math.floor((height - mh) / 2);\n const border = getBorderChars('single');\n if (!border) return;\n const bAttrs = { ...attrs, fg: this._borderColor };\n // Title bar\n const titleStr = this._title ? ` ${this._title} ` : '';\n const topFill = mw - 2 - titleStr.length;\n const tl = Math.floor(topFill / 2);\n const tr = topFill - tl;\n screen.writeString(mx, my, border.topLeft + border.top.repeat(tl) + titleStr + border.top.repeat(Math.max(0, tr)) + border.topRight, bAttrs);\n // Sides\n const clr = styleToCellAttrs(this.style);\n for (let r = 1; r < mh - 1; r++) {\n screen.writeString(mx, my + r, border.left, bAttrs);\n screen.writeString(mx + 1, my + r, ' '.repeat(mw - 2), clr);\n screen.writeString(mx + mw - 1, my + r, border.right, bAttrs);\n }\n // Bottom\n screen.writeString(mx, my + mh - 1, border.bottomLeft + border.bottom.repeat(mw - 2) + border.bottomRight, bAttrs);\n // Content\n if (this._content) {\n const cr = { x: mx + 2, y: my + 1, width: mw - 4, height: mh - 2 };\n (this._content as any)._rect = cr;\n (this._content as any)._renderSelf(screen);\n }\n }\n}\n","// Select — single-item dropdown selector\nimport { Widget } from '@termuijs/widgets';\nimport { type Style, type Screen, mergeStyles, defaultStyle, styleToCellAttrs } from '@termuijs/core';\n\nexport interface SelectOption { label: string; value: string; disabled?: boolean; }\nexport interface SelectOptions {\n placeholder?: string;\n activeColor?: Style['fg'];\n onSelect?: (option: SelectOption, index: number) => void;\n}\n\nexport class Select extends Widget {\n private _options: SelectOption[];\n private _selectedIndex = 0;\n private _isOpen = false;\n private _placeholder: string;\n private _activeColor: Style['fg'];\n private _onSelect?: (option: SelectOption, index: number) => void;\n focusable = true;\n\n constructor(options: SelectOption[], config: SelectOptions = {}) {\n super(mergeStyles(defaultStyle(), { height: 1 }));\n this._options = options;\n this._placeholder = config.placeholder ?? 'Select...';\n this._activeColor = config.activeColor ?? { type: 'named', name: 'cyan' };\n this._onSelect = config.onSelect;\n }\n\n get selectedOption(): SelectOption | undefined { return this._options[this._selectedIndex]; }\n get selectedIndex(): number { return this._selectedIndex; }\n get isOpen(): boolean { return this._isOpen; }\n open(): void { this._isOpen = true; this.markDirty(); }\n close(): void { this._isOpen = false; this.markDirty(); }\n toggle(): void { this._isOpen = !this._isOpen; this.markDirty(); }\n\n selectNext(): void {\n let n = this._selectedIndex + 1;\n while (n < this._options.length && this._options[n].disabled) n++;\n if (n < this._options.length) { this._selectedIndex = n; this.markDirty(); }\n }\n selectPrev(): void {\n let n = this._selectedIndex - 1;\n while (n >= 0 && this._options[n].disabled) n--;\n if (n >= 0) { this._selectedIndex = n; this.markDirty(); }\n }\n confirm(): void {\n const opt = this._options[this._selectedIndex];\n if (opt && !opt.disabled) { this._onSelect?.(opt, this._selectedIndex); this._isOpen = false; this.markDirty(); }\n }\n\n protected _renderSelf(screen: Screen): void {\n const { x, y, width } = this._rect;\n if (width <= 0) return;\n const attrs = styleToCellAttrs(this.style);\n const sel = this._options[this._selectedIndex];\n const label = sel ? sel.label : this._placeholder;\n const prefix = this._isOpen ? '▼ ' : '▶ ';\n screen.writeString(x, y, prefix + label.slice(0, width - 2), { ...attrs, fg: this._activeColor });\n if (this._isOpen) {\n for (let i = 0; i < this._options.length; i++) {\n const o = this._options[i];\n const isSel = i === this._selectedIndex;\n const m = isSel ? '● ' : ' ';\n screen.writeString(x, y + 1 + i, m + o.label.slice(0, width - 2), {\n ...attrs,\n fg: o.disabled ? { type: 'named' as const, name: 'brightBlack' as const } : isSel ? this._activeColor : attrs.fg,\n bold: isSel, dim: o.disabled,\n });\n }\n }\n }\n}\n","// MultiSelect — checkbox-style multi-item selector\nimport { Widget } from '@termuijs/widgets';\nimport { type Style, type Screen, mergeStyles, defaultStyle, styleToCellAttrs } from '@termuijs/core';\n\nexport interface MultiSelectOption { label: string; value: string; disabled?: boolean; }\nexport interface MultiSelectOptions {\n activeColor?: Style['fg'];\n checkChar?: string;\n uncheckChar?: string;\n onSubmit?: (selected: MultiSelectOption[]) => void;\n}\n\nexport class MultiSelect extends Widget {\n private _options: MultiSelectOption[];\n private _cursorIndex = 0;\n private _checked: Set<number> = new Set();\n private _activeColor: Style['fg'];\n private _checkChar: string;\n private _uncheckChar: string;\n private _onSubmit?: (selected: MultiSelectOption[]) => void;\n focusable = true;\n\n constructor(options: MultiSelectOption[], config: MultiSelectOptions = {}) {\n super(mergeStyles(defaultStyle(), { height: Math.max(options.length, 1) }));\n this._options = options;\n this._activeColor = config.activeColor ?? { type: 'named', name: 'cyan' };\n this._checkChar = config.checkChar ?? '◼';\n this._uncheckChar = config.uncheckChar ?? '◻';\n this._onSubmit = config.onSubmit;\n }\n\n get selectedOptions(): MultiSelectOption[] {\n return [...this._checked].sort().map(i => this._options[i]);\n }\n selectNext(): void { let n = this._cursorIndex + 1; while (n < this._options.length && this._options[n].disabled) n++; if (n < this._options.length) { this._cursorIndex = n; this.markDirty(); } }\n selectPrev(): void { let n = this._cursorIndex - 1; while (n >= 0 && this._options[n].disabled) n--; if (n >= 0) { this._cursorIndex = n; this.markDirty(); } }\n toggleCurrent(): void {\n const o = this._options[this._cursorIndex];\n if (o && !o.disabled) { this._checked.has(this._cursorIndex) ? this._checked.delete(this._cursorIndex) : this._checked.add(this._cursorIndex); this.markDirty(); }\n }\n submit(): void { this._onSubmit?.(this.selectedOptions); }\n\n protected _renderSelf(screen: Screen): void {\n const { x, y, width, height } = this._rect;\n if (width <= 0 || height <= 0) return;\n const attrs = styleToCellAttrs(this.style);\n for (let i = 0; i < this._options.length && i < height; i++) {\n const o = this._options[i];\n const active = i === this._cursorIndex;\n const checked = this._checked.has(i);\n const label = `${active ? '❯ ' : ' '}${checked ? this._checkChar : this._uncheckChar} ${o.label}`;\n screen.writeString(x, y + i, label.slice(0, width), {\n ...attrs,\n fg: o.disabled ? { type: 'named' as const, name: 'brightBlack' as const } : active ? this._activeColor : attrs.fg,\n bold: active, dim: o.disabled,\n });\n }\n }\n}\n","// Tree — expandable/collapsible tree view\nimport { Widget } from '@termuijs/widgets';\nimport { type Style, type Screen, mergeStyles, defaultStyle, styleToCellAttrs } from '@termuijs/core';\n\nexport interface TreeNode { label: string; children?: TreeNode[]; expanded?: boolean; icon?: string; }\nexport interface TreeOptions { activeColor?: Style['fg']; onSelect?: (node: TreeNode, path: number[]) => void; }\n\nexport class Tree extends Widget {\n private _roots: TreeNode[];\n private _cursorIndex = 0;\n private _activeColor: Style['fg'];\n private _onSelect?: (node: TreeNode, path: number[]) => void;\n focusable = true;\n\n constructor(roots: TreeNode[], options: TreeOptions = {}) {\n super(mergeStyles(defaultStyle(), { flexGrow: 1 }));\n this._roots = roots;\n this._activeColor = options.activeColor ?? { type: 'named', name: 'cyan' };\n this._onSelect = options.onSelect;\n }\n\n private _flatten(): { node: TreeNode; depth: number; path: number[]; hasChildren: boolean }[] {\n const result: { node: TreeNode; depth: number; path: number[]; hasChildren: boolean }[] = [];\n const walk = (nodes: TreeNode[], depth: number, path: number[]) => {\n for (let i = 0; i < nodes.length; i++) {\n const node = nodes[i];\n const hasChildren = (node.children?.length ?? 0) > 0;\n result.push({ node, depth, path: [...path, i], hasChildren });\n if (hasChildren && node.expanded) walk(node.children!, depth + 1, [...path, i]);\n }\n };\n walk(this._roots, 0, []);\n return result;\n }\n\n selectNext(): void { const f = this._flatten(); if (this._cursorIndex < f.length - 1) { this._cursorIndex++; this.markDirty(); } }\n selectPrev(): void { if (this._cursorIndex > 0) { this._cursorIndex--; this.markDirty(); } }\n toggleExpand(): void { const f = this._flatten(); const it = f[this._cursorIndex]; if (it?.hasChildren) { it.node.expanded = !it.node.expanded; this.markDirty(); } }\n confirm(): void {\n const f = this._flatten(); const it = f[this._cursorIndex];\n if (it) { it.hasChildren ? this.toggleExpand() : this._onSelect?.(it.node, it.path); }\n }\n\n protected _renderSelf(screen: Screen): void {\n const { x, y, width, height } = this._rect;\n if (width <= 0 || height <= 0) return;\n const attrs = styleToCellAttrs(this.style);\n const flat = this._flatten();\n for (let i = 0; i < flat.length && i < height; i++) {\n const it = flat[i];\n const active = i === this._cursorIndex;\n const indent = ' '.repeat(it.depth);\n const icon = it.hasChildren ? (it.node.expanded ? '▼ ' : '▶ ') : ' ';\n const nodeIcon = it.node.icon ? `${it.node.icon} ` : '';\n const line = `${indent}${icon}${nodeIcon}${it.node.label}`;\n screen.writeString(x, y + i, line.slice(0, width), { ...attrs, fg: active ? this._activeColor : attrs.fg, bold: active });\n }\n }\n}\n","// Toast — auto-dismiss notification\nimport { Widget } from '@termuijs/widgets';\nimport { type Screen, mergeStyles, defaultStyle, styleToCellAttrs } from '@termuijs/core';\n\nexport type ToastType = 'info' | 'success' | 'warning' | 'error';\nexport interface ToastMessage { text: string; type: ToastType; expireAt: number; }\nexport interface ToastOptions { position?: 'top-right' | 'bottom-right' | 'top-left' | 'bottom-left'; durationMs?: number; maxVisible?: number; }\n\nconst ICONS: Record<ToastType, string> = { info: 'ℹ', success: '✓', warning: '⚠', error: '✗' };\nconst COLORS: Record<ToastType, string> = { info: 'cyan', success: 'green', warning: 'yellow', error: 'red' };\n\nexport class Toast extends Widget {\n private _messages: ToastMessage[] = [];\n private _position: string;\n private _durationMs: number;\n private _maxVisible: number;\n\n constructor(options: ToastOptions = {}) {\n super(mergeStyles(defaultStyle(), {}));\n this._position = options.position ?? 'top-right';\n this._durationMs = options.durationMs ?? 3000;\n this._maxVisible = options.maxVisible ?? 5;\n }\n\n push(text: string, type: ToastType = 'info'): void { this._messages.push({ text, type, expireAt: Date.now() + this._durationMs }); this.markDirty(); }\n info(text: string): void { this.push(text, 'info'); }\n success(text: string): void { this.push(text, 'success'); }\n warning(text: string): void { this.push(text, 'warning'); }\n error(text: string): void { this.push(text, 'error'); }\n\n protected _renderSelf(screen: Screen): void {\n const now = Date.now();\n this._messages = this._messages.filter(m => m.expireAt > now);\n if (this._messages.length === 0) return;\n const { x, y, width, height } = this._rect;\n const visible = this._messages.slice(-this._maxVisible);\n const tw = Math.min(40, width - 2);\n const isRight = this._position.includes('right');\n const isBottom = this._position.includes('bottom');\n const sx = isRight ? x + width - tw - 1 : x + 1;\n const sy = isBottom ? y + height - visible.length - 1 : y + 1;\n const attrs = styleToCellAttrs(this.style);\n for (let i = 0; i < visible.length; i++) {\n const m = visible[i];\n const label = ` ${ICONS[m.type]} ${m.text} `.slice(0, tw).padEnd(tw);\n screen.writeString(sx, sy + i, label, { ...attrs, fg: { type: 'named', name: COLORS[m.type] as any }, bold: true });\n }\n }\n}\n","// ConfirmDialog — yes/no prompt overlay\nimport { Widget } from '@termuijs/widgets';\nimport { type Style, type Screen, mergeStyles, defaultStyle, styleToCellAttrs, getBorderChars } from '@termuijs/core';\n\nexport interface ConfirmDialogOptions {\n message: string;\n confirmLabel?: string;\n cancelLabel?: string;\n borderColor?: Style['fg'];\n onConfirm?: () => void;\n onCancel?: () => void;\n}\n\nexport class ConfirmDialog extends Widget {\n private _message: string;\n private _confirmLabel: string;\n private _cancelLabel: string;\n private _borderColor: Style['fg'];\n private _selected: 'confirm' | 'cancel' = 'confirm';\n private _visible = false;\n private _onConfirm?: () => void;\n private _onCancel?: () => void;\n focusable = true;\n\n constructor(options: ConfirmDialogOptions) {\n super(mergeStyles(defaultStyle(), {}));\n this._message = options.message;\n this._confirmLabel = options.confirmLabel ?? 'Yes';\n this._cancelLabel = options.cancelLabel ?? 'No';\n this._borderColor = options.borderColor ?? { type: 'named', name: 'yellow' };\n this._onConfirm = options.onConfirm;\n this._onCancel = options.onCancel;\n }\n\n get visible(): boolean { return this._visible; }\n show(): void { this._visible = true; this._selected = 'confirm'; this.markDirty(); }\n hide(): void { this._visible = false; this.markDirty(); }\n selectConfirm(): void { this._selected = 'confirm'; this.markDirty(); }\n selectCancel(): void { this._selected = 'cancel'; this.markDirty(); }\n toggleSelection(): void { this._selected = this._selected === 'confirm' ? 'cancel' : 'confirm'; this.markDirty(); }\n confirm(): void {\n (this._selected === 'confirm' ? this._onConfirm : this._onCancel)?.();\n this._visible = false;\n this.markDirty();\n }\n\n protected _renderSelf(screen: Screen): void {\n if (!this._visible) return;\n const { x, y, width, height } = this._rect;\n const attrs = styleToCellAttrs(this.style);\n for (let r = 0; r < height; r++) screen.writeString(x, y + r, '░'.repeat(width), { ...attrs, dim: true });\n const bw = Math.min(40, width - 4);\n const bh = 5;\n const bx = x + Math.floor((width - bw) / 2);\n const by = y + Math.floor((height - bh) / 2);\n const border = getBorderChars('single');\n if (!border) return;\n const ba = { ...attrs, fg: this._borderColor };\n screen.writeString(bx, by, border.topLeft + border.top.repeat(bw - 2) + border.topRight, ba);\n for (let r = 1; r < bh - 1; r++) {\n screen.writeString(bx, by + r, border.left, ba);\n screen.writeString(bx + 1, by + r, ' '.repeat(bw - 2), attrs);\n screen.writeString(bx + bw - 1, by + r, border.right, ba);\n }\n screen.writeString(bx, by + bh - 1, border.bottomLeft + border.bottom.repeat(bw - 2) + border.bottomRight, ba);\n screen.writeString(bx + 2, by + 1, this._message.slice(0, bw - 4), { ...attrs, bold: true });\n const yesStr = this._selected === 'confirm' ? ` [${this._confirmLabel}] ` : ` ${this._confirmLabel} `;\n const noStr = this._selected === 'cancel' ? ` [${this._cancelLabel}] ` : ` ${this._cancelLabel} `;\n screen.writeString(bx + 2, by + 3, yesStr, { ...attrs, fg: this._selected === 'confirm' ? { type: 'named', name: 'green' } : attrs.fg, bold: this._selected === 'confirm' });\n screen.writeString(bx + 2 + yesStr.length + 2, by + 3, noStr, { ...attrs, fg: this._selected === 'cancel' ? { type: 'named', name: 'red' } : attrs.fg, bold: this._selected === 'cancel' });\n }\n}\n","// Form — compound input container with validation\nimport { Widget } from '@termuijs/widgets';\nimport { type Style, type Screen, mergeStyles, defaultStyle, styleToCellAttrs } from '@termuijs/core';\n\nexport interface FormField {\n name: string; label: string; type: 'text' | 'select' | 'checkbox';\n placeholder?: string; required?: boolean; options?: string[];\n validate?: (value: string) => string | null;\n}\nexport interface FormOptions {\n labelColor?: Style['fg']; errorColor?: Style['fg']; activeColor?: Style['fg'];\n onSubmit?: (values: Record<string, string>) => void;\n}\n\nexport class Form extends Widget {\n private _fields: FormField[];\n private _values: Map<string, string> = new Map();\n private _errors: Map<string, string> = new Map();\n private _activeField = 0;\n private _cursorPos = 0;\n private _labelColor: Style['fg'];\n private _errorColor: Style['fg'];\n private _activeColor: Style['fg'];\n private _onSubmit?: (values: Record<string, string>) => void;\n focusable = true;\n\n constructor(fields: FormField[], options: FormOptions = {}) {\n super(mergeStyles(defaultStyle(), { height: fields.length * 2 + 1, flexGrow: 1 }));\n this._fields = fields;\n this._labelColor = options.labelColor ?? { type: 'named', name: 'cyan' };\n this._errorColor = options.errorColor ?? { type: 'named', name: 'red' };\n this._activeColor = options.activeColor ?? { type: 'named', name: 'cyan' };\n this._onSubmit = options.onSubmit;\n for (const f of fields) this._values.set(f.name, '');\n }\n\n get values(): Record<string, string> { const r: Record<string, string> = {}; for (const [k, v] of this._values) r[k] = v; return r; }\n nextField(): void { if (this._activeField < this._fields.length) { this._activeField++; this._cursorPos = 0; this.markDirty(); } }\n prevField(): void { if (this._activeField > 0) { this._activeField--; this._cursorPos = (this._values.get(this._fields[this._activeField].name) ?? '').length; this.markDirty(); } }\n insertChar(ch: string): void {\n if (this._activeField >= this._fields.length) return;\n const f = this._fields[this._activeField]; const cur = this._values.get(f.name) ?? '';\n this._values.set(f.name, cur.slice(0, this._cursorPos) + ch + cur.slice(this._cursorPos));\n this._cursorPos++; this._errors.delete(f.name); this.markDirty();\n }\n deleteBack(): void {\n if (this._activeField >= this._fields.length) return;\n const f = this._fields[this._activeField]; const cur = this._values.get(f.name) ?? '';\n if (this._cursorPos > 0) { this._values.set(f.name, cur.slice(0, this._cursorPos - 1) + cur.slice(this._cursorPos)); this._cursorPos--; this.markDirty(); }\n }\n submit(): void {\n this._errors.clear(); let hasErr = false;\n for (const f of this._fields) {\n const v = this._values.get(f.name) ?? '';\n if (f.required && !v.trim()) { this._errors.set(f.name, `${f.label} is required`); hasErr = true; }\n if (f.validate) { const e = f.validate(v); if (e) { this._errors.set(f.name, e); hasErr = true; } }\n }\n if (!hasErr) this._onSubmit?.(this.values);\n this.markDirty();\n }\n\n protected _renderSelf(screen: Screen): void {\n const { x, y, width, height } = this._rect;\n if (width <= 0 || height <= 0) return;\n const attrs = styleToCellAttrs(this.style);\n let row = 0;\n for (let i = 0; i < this._fields.length && row < height - 1; i++) {\n const f = this._fields[i]; const active = i === this._activeField;\n const val = this._values.get(f.name) ?? ''; const err = this._errors.get(f.name);\n screen.writeString(x, y + row, `${f.label}${f.required ? ' *' : ''}:`.slice(0, width), { ...attrs, fg: err ? this._errorColor : this._labelColor, bold: active }); row++;\n if (row >= height) break;\n const display = val || (f.placeholder ?? '');\n screen.writeString(x, y + row, `${active ? '❯ ' : ' '}${display}`.slice(0, width), { ...attrs, fg: active ? this._activeColor : attrs.fg, dim: !val && !!f.placeholder }); row++;\n }\n if (row < height) {\n const isSub = this._activeField >= this._fields.length;\n screen.writeString(x, y + row, isSub ? ' [ Submit ]' : ' Submit ', { ...attrs, fg: isSub ? { type: 'named', name: 'green' } : attrs.fg, bold: isSub });\n }\n }\n}\n","// CommandPalette — fuzzy-search command launcher\nimport { Widget } from '@termuijs/widgets';\nimport { type Style, type Screen, mergeStyles, defaultStyle, styleToCellAttrs, getBorderChars } from '@termuijs/core';\n\nexport interface Command { id: string; label: string; shortcut?: string; action: () => void; category?: string; }\nexport interface CommandPaletteOptions { placeholder?: string; borderColor?: Style['fg']; activeColor?: Style['fg']; maxVisible?: number; }\n\nexport class CommandPalette extends Widget {\n private _commands: Command[];\n private _filtered: Command[] = [];\n private _query = '';\n private _cursorPos = 0;\n private _selectedIndex = 0;\n private _visible = false;\n private _placeholder: string;\n private _borderColor: Style['fg'];\n private _activeColor: Style['fg'];\n private _maxVisible: number;\n focusable = true;\n\n constructor(commands: Command[], options: CommandPaletteOptions = {}) {\n super(mergeStyles(defaultStyle(), {}));\n this._commands = commands;\n this._filtered = [...commands];\n this._placeholder = options.placeholder ?? 'Type a command...';\n this._borderColor = options.borderColor ?? { type: 'named', name: 'cyan' };\n this._activeColor = options.activeColor ?? { type: 'named', name: 'cyan' };\n this._maxVisible = options.maxVisible ?? 10;\n }\n\n get visible(): boolean { return this._visible; }\n show(): void { this._visible = true; this._query = ''; this._cursorPos = 0; this._selectedIndex = 0; this._filtered = [...this._commands]; this.markDirty(); }\n hide(): void { this._visible = false; this.markDirty(); }\n toggle(): void { this._visible ? this.hide() : this.show(); }\n insertChar(ch: string): void { this._query = this._query.slice(0, this._cursorPos) + ch + this._query.slice(this._cursorPos); this._cursorPos++; this._filter(); this.markDirty(); }\n deleteBack(): void { if (this._cursorPos > 0) { this._query = this._query.slice(0, this._cursorPos - 1) + this._query.slice(this._cursorPos); this._cursorPos--; this._filter(); this.markDirty(); } }\n selectNext(): void { if (this._selectedIndex < this._filtered.length - 1) { this._selectedIndex++; this.markDirty(); } }\n selectPrev(): void { if (this._selectedIndex > 0) { this._selectedIndex--; this.markDirty(); } }\n confirm(): void { const c = this._filtered[this._selectedIndex]; if (c) { this.hide(); c.action(); } }\n\n private _filter(): void {\n const q = this._query.toLowerCase();\n if (!q) { this._filtered = [...this._commands]; } else {\n this._filtered = this._commands.filter(c => { const l = c.label.toLowerCase(); let qi = 0; for (let i = 0; i < l.length && qi < q.length; i++) { if (l[i] === q[qi]) qi++; } return qi === q.length; });\n }\n this._selectedIndex = 0;\n }\n\n protected _renderSelf(screen: Screen): void {\n if (!this._visible) return;\n const { x, y, width, height } = this._rect;\n const attrs = styleToCellAttrs(this.style);\n // Backdrop\n for (let r = 0; r < height; r++) screen.writeString(x, y + r, '░'.repeat(width), { ...attrs, dim: true });\n // Box\n const vis = this._filtered.slice(0, this._maxVisible);\n const bw = Math.min(60, width - 4);\n const bh = Math.min(vis.length + 3, height - 2);\n const bx = x + Math.floor((width - bw) / 2);\n const by = y + 2;\n const border = getBorderChars('single');\n if (!border) return;\n const ba = { ...attrs, fg: this._borderColor };\n // Top\n screen.writeString(bx, by, border.topLeft + border.top.repeat(bw - 2) + border.topRight, ba);\n // Input row\n screen.writeString(bx, by + 1, border.left, ba);\n const input = this._query || this._placeholder;\n screen.writeString(bx + 1, by + 1, (' 🔍 ' + input).slice(0, bw - 2).padEnd(bw - 2), { ...attrs, dim: !this._query });\n screen.writeString(bx + bw - 1, by + 1, border.right, ba);\n // Separator\n screen.writeString(bx, by + 2, border.left + '─'.repeat(bw - 2) + border.right, ba);\n // Items\n for (let i = 0; i < vis.length && i + 3 < bh - 1; i++) {\n const c = vis[i]; const active = i === this._selectedIndex;\n const label = (active ? '❯ ' : ' ') + c.label;\n const sc = c.shortcut ?? '';\n screen.writeString(bx, by + 3 + i, border.left, ba);\n screen.writeString(bx + 1, by + 3 + i, (' ' + label).slice(0, bw - sc.length - 3).padEnd(bw - sc.length - 3), { ...attrs, fg: active ? this._activeColor : attrs.fg, bold: active });\n if (sc) screen.writeString(bx + bw - sc.length - 2, by + 3 + i, sc, { ...attrs, dim: true });\n screen.writeString(bx + bw - 1, by + 3 + i, border.right, ba);\n }\n // Bottom\n const last = Math.min(by + 3 + vis.length, by + bh - 1);\n screen.writeString(bx, last, border.bottomLeft + border.bottom.repeat(bw - 2) + border.bottomRight, ba);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQA,IAAAA,mBAaO;;;ACpBP,qBAAuB;AACvB,kBAAqF;AAQ9E,IAAM,UAAN,cAAsB,sBAAO;AAAA,EACxB;AAAA,EACA;AAAA,EACA;AAAA,EAER,YAAY,UAA0B,CAAC,GAAG;AACtC,cAAM,6BAAY,0BAAa,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC;AAChD,SAAK,QAAQ,QAAQ,QAAQ;AAC7B,SAAK,SAAS,QAAQ;AACtB,SAAK,SAAS,QAAQ,SAAS;AAAA,EACnC;AAAA,EAEU,YAAY,QAAsB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AAG,KAAK,IAAI,IAAI,MAAM,OAAO,MAAM,GAAG,KAAK,GAAG,SAAS,CAAC,EAAE,OAAO,KAAK,GAAG,SAAS,CAAC,GAAG,EAAE,GAAG,OAAO,IAAI,SAAS,KAAK,eAAe,MAAM,IAAI,MAAM,OAAO,CAAC;AACnL,UAAI,GAAI,QAAO,YAAY,KAAK,KAAK,GAAG,SAAS,GAAG,KAAK,IAAI,GAAG,IAAI,EAAE,GAAG,OAAO,KAAK,KAAK,CAAC;AAC3F,aAAO,YAAY,KAAK,KAAK,GAAG,KAAK,IAAI,GAAG,OAAO,OAAO,EAAE;AAAA,IAChE;AAEA,UAAM,OAAO,KAAK,IAAI,KAAK,IAAI,IAAI,QAAQ,KAAK,KAAK,CAAC;AACtD,WAAO,YAAY,IAAI,MAAM,OAAO,aAAa,OAAO,OAAO,OAAO,KAAK,CAAC,IAAI,OAAO,aAAa,EAAE;AAAA,EAC1G;AACJ;","names":["import_widgets","import_widgets","import_core","import_widgets","import_core","import_widgets","import_core","import_widgets","import_core","import_widgets","import_core","import_widgets","import_core","import_widgets","import_core","import_widgets","import_core","import_widgets","import_core","import_widgets","import_core"]}
|
package/dist/index.js
CHANGED
|
@@ -75,13 +75,18 @@ var Tabs = class extends Widget3 {
|
|
|
75
75
|
return this._activeIndex;
|
|
76
76
|
}
|
|
77
77
|
selectTab(i) {
|
|
78
|
-
if (i >= 0 && i < this._tabs.length)
|
|
78
|
+
if (i >= 0 && i < this._tabs.length) {
|
|
79
|
+
this._activeIndex = i;
|
|
80
|
+
this.markDirty();
|
|
81
|
+
}
|
|
79
82
|
}
|
|
80
83
|
nextTab() {
|
|
81
84
|
this._activeIndex = (this._activeIndex + 1) % this._tabs.length;
|
|
85
|
+
this.markDirty();
|
|
82
86
|
}
|
|
83
87
|
prevTab() {
|
|
84
88
|
this._activeIndex = (this._activeIndex - 1 + this._tabs.length) % this._tabs.length;
|
|
89
|
+
this.markDirty();
|
|
85
90
|
}
|
|
86
91
|
get activeContent() {
|
|
87
92
|
return this._tabs[this._activeIndex]?.content;
|
|
@@ -135,15 +140,19 @@ var Modal = class extends Widget4 {
|
|
|
135
140
|
}
|
|
136
141
|
show() {
|
|
137
142
|
this._visible = true;
|
|
143
|
+
this.markDirty();
|
|
138
144
|
}
|
|
139
145
|
hide() {
|
|
140
146
|
this._visible = false;
|
|
147
|
+
this.markDirty();
|
|
141
148
|
}
|
|
142
149
|
toggle() {
|
|
143
150
|
this._visible = !this._visible;
|
|
151
|
+
this.markDirty();
|
|
144
152
|
}
|
|
145
153
|
setContent(content) {
|
|
146
154
|
this._content = content;
|
|
155
|
+
this.markDirty();
|
|
147
156
|
}
|
|
148
157
|
_renderSelf(screen) {
|
|
149
158
|
if (!this._visible) return;
|
|
@@ -208,28 +217,38 @@ var Select = class extends Widget5 {
|
|
|
208
217
|
}
|
|
209
218
|
open() {
|
|
210
219
|
this._isOpen = true;
|
|
220
|
+
this.markDirty();
|
|
211
221
|
}
|
|
212
222
|
close() {
|
|
213
223
|
this._isOpen = false;
|
|
224
|
+
this.markDirty();
|
|
214
225
|
}
|
|
215
226
|
toggle() {
|
|
216
227
|
this._isOpen = !this._isOpen;
|
|
228
|
+
this.markDirty();
|
|
217
229
|
}
|
|
218
230
|
selectNext() {
|
|
219
231
|
let n = this._selectedIndex + 1;
|
|
220
232
|
while (n < this._options.length && this._options[n].disabled) n++;
|
|
221
|
-
if (n < this._options.length)
|
|
233
|
+
if (n < this._options.length) {
|
|
234
|
+
this._selectedIndex = n;
|
|
235
|
+
this.markDirty();
|
|
236
|
+
}
|
|
222
237
|
}
|
|
223
238
|
selectPrev() {
|
|
224
239
|
let n = this._selectedIndex - 1;
|
|
225
240
|
while (n >= 0 && this._options[n].disabled) n--;
|
|
226
|
-
if (n >= 0)
|
|
241
|
+
if (n >= 0) {
|
|
242
|
+
this._selectedIndex = n;
|
|
243
|
+
this.markDirty();
|
|
244
|
+
}
|
|
227
245
|
}
|
|
228
246
|
confirm() {
|
|
229
247
|
const opt = this._options[this._selectedIndex];
|
|
230
248
|
if (opt && !opt.disabled) {
|
|
231
249
|
this._onSelect?.(opt, this._selectedIndex);
|
|
232
250
|
this._isOpen = false;
|
|
251
|
+
this.markDirty();
|
|
233
252
|
}
|
|
234
253
|
}
|
|
235
254
|
_renderSelf(screen) {
|
|
@@ -282,17 +301,24 @@ var MultiSelect = class extends Widget6 {
|
|
|
282
301
|
selectNext() {
|
|
283
302
|
let n = this._cursorIndex + 1;
|
|
284
303
|
while (n < this._options.length && this._options[n].disabled) n++;
|
|
285
|
-
if (n < this._options.length)
|
|
304
|
+
if (n < this._options.length) {
|
|
305
|
+
this._cursorIndex = n;
|
|
306
|
+
this.markDirty();
|
|
307
|
+
}
|
|
286
308
|
}
|
|
287
309
|
selectPrev() {
|
|
288
310
|
let n = this._cursorIndex - 1;
|
|
289
311
|
while (n >= 0 && this._options[n].disabled) n--;
|
|
290
|
-
if (n >= 0)
|
|
312
|
+
if (n >= 0) {
|
|
313
|
+
this._cursorIndex = n;
|
|
314
|
+
this.markDirty();
|
|
315
|
+
}
|
|
291
316
|
}
|
|
292
317
|
toggleCurrent() {
|
|
293
318
|
const o = this._options[this._cursorIndex];
|
|
294
319
|
if (o && !o.disabled) {
|
|
295
320
|
this._checked.has(this._cursorIndex) ? this._checked.delete(this._cursorIndex) : this._checked.add(this._cursorIndex);
|
|
321
|
+
this.markDirty();
|
|
296
322
|
}
|
|
297
323
|
}
|
|
298
324
|
submit() {
|
|
@@ -347,15 +373,24 @@ var Tree = class extends Widget7 {
|
|
|
347
373
|
}
|
|
348
374
|
selectNext() {
|
|
349
375
|
const f = this._flatten();
|
|
350
|
-
if (this._cursorIndex < f.length - 1)
|
|
376
|
+
if (this._cursorIndex < f.length - 1) {
|
|
377
|
+
this._cursorIndex++;
|
|
378
|
+
this.markDirty();
|
|
379
|
+
}
|
|
351
380
|
}
|
|
352
381
|
selectPrev() {
|
|
353
|
-
if (this._cursorIndex > 0)
|
|
382
|
+
if (this._cursorIndex > 0) {
|
|
383
|
+
this._cursorIndex--;
|
|
384
|
+
this.markDirty();
|
|
385
|
+
}
|
|
354
386
|
}
|
|
355
387
|
toggleExpand() {
|
|
356
388
|
const f = this._flatten();
|
|
357
389
|
const it = f[this._cursorIndex];
|
|
358
|
-
if (it?.hasChildren)
|
|
390
|
+
if (it?.hasChildren) {
|
|
391
|
+
it.node.expanded = !it.node.expanded;
|
|
392
|
+
this.markDirty();
|
|
393
|
+
}
|
|
359
394
|
}
|
|
360
395
|
confirm() {
|
|
361
396
|
const f = this._flatten();
|
|
@@ -399,6 +434,7 @@ var Toast = class extends Widget8 {
|
|
|
399
434
|
}
|
|
400
435
|
push(text, type = "info") {
|
|
401
436
|
this._messages.push({ text, type, expireAt: Date.now() + this._durationMs });
|
|
437
|
+
this.markDirty();
|
|
402
438
|
}
|
|
403
439
|
info(text) {
|
|
404
440
|
this.push(text, "info");
|
|
@@ -460,22 +496,28 @@ var ConfirmDialog = class extends Widget9 {
|
|
|
460
496
|
show() {
|
|
461
497
|
this._visible = true;
|
|
462
498
|
this._selected = "confirm";
|
|
499
|
+
this.markDirty();
|
|
463
500
|
}
|
|
464
501
|
hide() {
|
|
465
502
|
this._visible = false;
|
|
503
|
+
this.markDirty();
|
|
466
504
|
}
|
|
467
505
|
selectConfirm() {
|
|
468
506
|
this._selected = "confirm";
|
|
507
|
+
this.markDirty();
|
|
469
508
|
}
|
|
470
509
|
selectCancel() {
|
|
471
510
|
this._selected = "cancel";
|
|
511
|
+
this.markDirty();
|
|
472
512
|
}
|
|
473
513
|
toggleSelection() {
|
|
474
514
|
this._selected = this._selected === "confirm" ? "cancel" : "confirm";
|
|
515
|
+
this.markDirty();
|
|
475
516
|
}
|
|
476
517
|
confirm() {
|
|
477
518
|
(this._selected === "confirm" ? this._onConfirm : this._onCancel)?.();
|
|
478
519
|
this._visible = false;
|
|
520
|
+
this.markDirty();
|
|
479
521
|
}
|
|
480
522
|
_renderSelf(screen) {
|
|
481
523
|
if (!this._visible) return;
|
|
@@ -536,12 +578,14 @@ var Form = class extends Widget10 {
|
|
|
536
578
|
if (this._activeField < this._fields.length) {
|
|
537
579
|
this._activeField++;
|
|
538
580
|
this._cursorPos = 0;
|
|
581
|
+
this.markDirty();
|
|
539
582
|
}
|
|
540
583
|
}
|
|
541
584
|
prevField() {
|
|
542
585
|
if (this._activeField > 0) {
|
|
543
586
|
this._activeField--;
|
|
544
587
|
this._cursorPos = (this._values.get(this._fields[this._activeField].name) ?? "").length;
|
|
588
|
+
this.markDirty();
|
|
545
589
|
}
|
|
546
590
|
}
|
|
547
591
|
insertChar(ch) {
|
|
@@ -551,6 +595,7 @@ var Form = class extends Widget10 {
|
|
|
551
595
|
this._values.set(f.name, cur.slice(0, this._cursorPos) + ch + cur.slice(this._cursorPos));
|
|
552
596
|
this._cursorPos++;
|
|
553
597
|
this._errors.delete(f.name);
|
|
598
|
+
this.markDirty();
|
|
554
599
|
}
|
|
555
600
|
deleteBack() {
|
|
556
601
|
if (this._activeField >= this._fields.length) return;
|
|
@@ -559,6 +604,7 @@ var Form = class extends Widget10 {
|
|
|
559
604
|
if (this._cursorPos > 0) {
|
|
560
605
|
this._values.set(f.name, cur.slice(0, this._cursorPos - 1) + cur.slice(this._cursorPos));
|
|
561
606
|
this._cursorPos--;
|
|
607
|
+
this.markDirty();
|
|
562
608
|
}
|
|
563
609
|
}
|
|
564
610
|
submit() {
|
|
@@ -579,6 +625,7 @@ var Form = class extends Widget10 {
|
|
|
579
625
|
}
|
|
580
626
|
}
|
|
581
627
|
if (!hasErr) this._onSubmit?.(this.values);
|
|
628
|
+
this.markDirty();
|
|
582
629
|
}
|
|
583
630
|
_renderSelf(screen) {
|
|
584
631
|
const { x, y, width, height } = this._rect;
|
|
@@ -637,9 +684,11 @@ var CommandPalette = class extends Widget11 {
|
|
|
637
684
|
this._cursorPos = 0;
|
|
638
685
|
this._selectedIndex = 0;
|
|
639
686
|
this._filtered = [...this._commands];
|
|
687
|
+
this.markDirty();
|
|
640
688
|
}
|
|
641
689
|
hide() {
|
|
642
690
|
this._visible = false;
|
|
691
|
+
this.markDirty();
|
|
643
692
|
}
|
|
644
693
|
toggle() {
|
|
645
694
|
this._visible ? this.hide() : this.show();
|
|
@@ -648,19 +697,27 @@ var CommandPalette = class extends Widget11 {
|
|
|
648
697
|
this._query = this._query.slice(0, this._cursorPos) + ch + this._query.slice(this._cursorPos);
|
|
649
698
|
this._cursorPos++;
|
|
650
699
|
this._filter();
|
|
700
|
+
this.markDirty();
|
|
651
701
|
}
|
|
652
702
|
deleteBack() {
|
|
653
703
|
if (this._cursorPos > 0) {
|
|
654
704
|
this._query = this._query.slice(0, this._cursorPos - 1) + this._query.slice(this._cursorPos);
|
|
655
705
|
this._cursorPos--;
|
|
656
706
|
this._filter();
|
|
707
|
+
this.markDirty();
|
|
657
708
|
}
|
|
658
709
|
}
|
|
659
710
|
selectNext() {
|
|
660
|
-
if (this._selectedIndex < this._filtered.length - 1)
|
|
711
|
+
if (this._selectedIndex < this._filtered.length - 1) {
|
|
712
|
+
this._selectedIndex++;
|
|
713
|
+
this.markDirty();
|
|
714
|
+
}
|
|
661
715
|
}
|
|
662
716
|
selectPrev() {
|
|
663
|
-
if (this._selectedIndex > 0)
|
|
717
|
+
if (this._selectedIndex > 0) {
|
|
718
|
+
this._selectedIndex--;
|
|
719
|
+
this.markDirty();
|
|
720
|
+
}
|
|
664
721
|
}
|
|
665
722
|
confirm() {
|
|
666
723
|
const c = this._filtered[this._selectedIndex];
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/Divider.ts","../src/Spacer.ts","../src/Tabs.ts","../src/Modal.ts","../src/Select.ts","../src/MultiSelect.ts","../src/Tree.ts","../src/Toast.ts","../src/ConfirmDialog.ts","../src/Form.ts","../src/CommandPalette.ts"],"sourcesContent":["// ─────────────────────────────────────────────────────\n// @termuijs/ui — Rich Component Library\n//\n// The shadcn/ui for terminals — 16+ production-ready\n// components for building beautiful CLI apps.\n// ─────────────────────────────────────────────────────\n\n// ── Re-exports from @termuijs/widgets (base components) ──\nexport {\n Box,\n Text,\n Table,\n List,\n TextInput,\n Gauge,\n Sparkline,\n StatusIndicator,\n LogView,\n ProgressBar,\n Spinner,\n Widget,\n} from '@termuijs/widgets';\n\n// ── New components ──\nexport { Divider } from './Divider.js';\nexport type { DividerOptions } from './Divider.js';\n\nexport { Spacer } from './Spacer.js';\n\nexport { Tabs } from './Tabs.js';\nexport type { Tab, TabsOptions } from './Tabs.js';\n\nexport { Modal } from './Modal.js';\nexport type { ModalOptions } from './Modal.js';\n\nexport { Select } from './Select.js';\nexport type { SelectOption, SelectOptions } from './Select.js';\n\nexport { MultiSelect } from './MultiSelect.js';\nexport type { MultiSelectOption, MultiSelectOptions } from './MultiSelect.js';\n\nexport { Tree } from './Tree.js';\nexport type { TreeNode, TreeOptions } from './Tree.js';\n\nexport { Toast } from './Toast.js';\nexport type { ToastType, ToastMessage, ToastOptions } from './Toast.js';\n\nexport { ConfirmDialog } from './ConfirmDialog.js';\nexport type { ConfirmDialogOptions } from './ConfirmDialog.js';\n\nexport { Form } from './Form.js';\nexport type { FormField, FormOptions } from './Form.js';\n\nexport { CommandPalette } from './CommandPalette.js';\nexport type { Command, CommandPaletteOptions } from './CommandPalette.js';\n","// Divider — horizontal separator line\nimport { Widget } from '@termuijs/widgets';\nimport { type Style, type Screen, mergeStyles, defaultStyle, styleToCellAttrs } from '@termuijs/core';\n\nexport interface DividerOptions {\n char?: string;\n color?: Style['fg'];\n title?: string;\n}\n\nexport class Divider extends Widget {\n private _char: string;\n private _color: Style['fg'];\n private _title: string;\n\n constructor(options: DividerOptions = {}) {\n super(mergeStyles(defaultStyle(), { height: 1 }));\n this._char = options.char ?? '─';\n this._color = options.color;\n this._title = options.title ?? '';\n }\n\n protected _renderSelf(screen: Screen): void {\n const { x, y, width } = this._rect;\n if (width <= 0) return;\n const attrs = styleToCellAttrs(this.style);\n if (this._color) attrs.fg = this._color;\n attrs.dim = true;\n if (this._title) {\n const titleStr = ` ${this._title} `;\n const padLeft = Math.max(0, Math.floor((width - titleStr.length) / 2));\n const padRight = Math.max(0, width - padLeft - titleStr.length);\n const line = this._char.repeat(padLeft) + titleStr + this._char.repeat(padRight);\n screen.writeString(x, y, line.slice(0, width), attrs);\n } else {\n screen.writeString(x, y, this._char.repeat(width), attrs);\n }\n }\n}\n","// Spacer — flexible empty space\nimport { Widget } from '@termuijs/widgets';\nimport { type Screen, mergeStyles, defaultStyle } from '@termuijs/core';\n\nexport class Spacer extends Widget {\n constructor(grow: number = 1) {\n super(mergeStyles(defaultStyle(), { flexGrow: grow }));\n }\n protected _renderSelf(_screen: Screen): void { /* empty */ }\n}\n","// Tabs — tabbed container with keyboard switching\nimport { Widget } from '@termuijs/widgets';\nimport { type Style, type Screen, mergeStyles, defaultStyle, styleToCellAttrs } from '@termuijs/core';\n\nexport interface Tab { label: string; content: Widget; }\nexport interface TabsOptions {\n activeColor?: Style['fg'];\n inactiveColor?: Style['fg'];\n border?: Style['border'];\n}\n\nexport class Tabs extends Widget {\n private _tabs: Tab[] = [];\n private _activeIndex = 0;\n private _activeColor: Style['fg'];\n private _inactiveColor: Style['fg'];\n focusable = true;\n\n constructor(tabs: Tab[], options: TabsOptions = {}) {\n super(mergeStyles(defaultStyle(), { flexGrow: 1, border: options.border ?? 'single' }));\n this._tabs = tabs;\n this._activeColor = options.activeColor ?? { type: 'named', name: 'cyan' };\n this._inactiveColor = options.inactiveColor ?? { type: 'named', name: 'brightBlack' };\n }\n\n get activeIndex(): number { return this._activeIndex; }\n selectTab(i: number): void { if (i >= 0 && i < this._tabs.length) this._activeIndex = i; }\n nextTab(): void { this._activeIndex = (this._activeIndex + 1) % this._tabs.length; }\n prevTab(): void { this._activeIndex = (this._activeIndex - 1 + this._tabs.length) % this._tabs.length; }\n get activeContent(): Widget | undefined { return this._tabs[this._activeIndex]?.content; }\n\n protected _renderSelf(screen: Screen): void {\n const { x, y, width, height } = this._rect;\n if (width <= 0 || height <= 0) return;\n const attrs = styleToCellAttrs(this.style);\n let col = x;\n for (let i = 0; i < this._tabs.length; i++) {\n const tab = this._tabs[i];\n const isActive = i === this._activeIndex;\n const label = isActive ? ` ● ${tab.label} ` : ` ${tab.label} `;\n screen.writeString(col, y, label, {\n ...attrs,\n fg: isActive ? this._activeColor : this._inactiveColor,\n bold: isActive, dim: !isActive,\n });\n col += label.length;\n if (i < this._tabs.length - 1) { screen.writeString(col, y, '│', { ...attrs, dim: true }); col++; }\n }\n if (height > 1) screen.writeString(x, y + 1, '─'.repeat(width), { ...attrs, dim: true });\n }\n}\n","// Modal — overlay dialog with backdrop\nimport { Widget } from '@termuijs/widgets';\nimport { type Style, type Screen, mergeStyles, defaultStyle, styleToCellAttrs, getBorderChars } from '@termuijs/core';\n\nexport interface ModalOptions {\n title?: string;\n width?: number;\n height?: number;\n borderColor?: Style['fg'];\n backdropChar?: string;\n}\n\nexport class Modal extends Widget {\n private _title: string;\n private _modalWidth: number;\n private _modalHeight: number;\n private _borderColor: Style['fg'];\n private _backdropChar: string;\n private _visible = false;\n private _content: Widget | null = null;\n\n constructor(options: ModalOptions = {}) {\n super(mergeStyles(defaultStyle(), {}));\n this._title = options.title ?? '';\n this._modalWidth = options.width ?? 50;\n this._modalHeight = options.height ?? 15;\n this._borderColor = options.borderColor ?? { type: 'named', name: 'cyan' };\n this._backdropChar = options.backdropChar ?? '░';\n }\n\n get visible(): boolean { return this._visible; }\n show(): void { this._visible = true; }\n hide(): void { this._visible = false; }\n toggle(): void { this._visible = !this._visible; }\n setContent(content: Widget): void { this._content = content; }\n\n protected _renderSelf(screen: Screen): void {\n if (!this._visible) return;\n const { x, y, width, height } = this._rect;\n const attrs = styleToCellAttrs(this.style);\n // Backdrop\n for (let r = 0; r < height; r++) {\n screen.writeString(x, y + r, this._backdropChar.repeat(width), { ...attrs, dim: true });\n }\n // Centered modal\n const mw = Math.min(this._modalWidth, width - 4);\n const mh = Math.min(this._modalHeight, height - 2);\n const mx = x + Math.floor((width - mw) / 2);\n const my = y + Math.floor((height - mh) / 2);\n const border = getBorderChars('single');\n if (!border) return;\n const bAttrs = { ...attrs, fg: this._borderColor };\n // Title bar\n const titleStr = this._title ? ` ${this._title} ` : '';\n const topFill = mw - 2 - titleStr.length;\n const tl = Math.floor(topFill / 2);\n const tr = topFill - tl;\n screen.writeString(mx, my, border.topLeft + border.top.repeat(tl) + titleStr + border.top.repeat(Math.max(0, tr)) + border.topRight, bAttrs);\n // Sides\n const clr = styleToCellAttrs(this.style);\n for (let r = 1; r < mh - 1; r++) {\n screen.writeString(mx, my + r, border.left, bAttrs);\n screen.writeString(mx + 1, my + r, ' '.repeat(mw - 2), clr);\n screen.writeString(mx + mw - 1, my + r, border.right, bAttrs);\n }\n // Bottom\n screen.writeString(mx, my + mh - 1, border.bottomLeft + border.bottom.repeat(mw - 2) + border.bottomRight, bAttrs);\n // Content\n if (this._content) {\n const cr = { x: mx + 2, y: my + 1, width: mw - 4, height: mh - 2 };\n (this._content as any)._rect = cr;\n (this._content as any)._renderSelf(screen);\n }\n }\n}\n","// Select — single-item dropdown selector\nimport { Widget } from '@termuijs/widgets';\nimport { type Style, type Screen, mergeStyles, defaultStyle, styleToCellAttrs } from '@termuijs/core';\n\nexport interface SelectOption { label: string; value: string; disabled?: boolean; }\nexport interface SelectOptions {\n placeholder?: string;\n activeColor?: Style['fg'];\n onSelect?: (option: SelectOption, index: number) => void;\n}\n\nexport class Select extends Widget {\n private _options: SelectOption[];\n private _selectedIndex = 0;\n private _isOpen = false;\n private _placeholder: string;\n private _activeColor: Style['fg'];\n private _onSelect?: (option: SelectOption, index: number) => void;\n focusable = true;\n\n constructor(options: SelectOption[], config: SelectOptions = {}) {\n super(mergeStyles(defaultStyle(), { height: 1 }));\n this._options = options;\n this._placeholder = config.placeholder ?? 'Select...';\n this._activeColor = config.activeColor ?? { type: 'named', name: 'cyan' };\n this._onSelect = config.onSelect;\n }\n\n get selectedOption(): SelectOption | undefined { return this._options[this._selectedIndex]; }\n get selectedIndex(): number { return this._selectedIndex; }\n get isOpen(): boolean { return this._isOpen; }\n open(): void { this._isOpen = true; }\n close(): void { this._isOpen = false; }\n toggle(): void { this._isOpen = !this._isOpen; }\n\n selectNext(): void {\n let n = this._selectedIndex + 1;\n while (n < this._options.length && this._options[n].disabled) n++;\n if (n < this._options.length) this._selectedIndex = n;\n }\n selectPrev(): void {\n let n = this._selectedIndex - 1;\n while (n >= 0 && this._options[n].disabled) n--;\n if (n >= 0) this._selectedIndex = n;\n }\n confirm(): void {\n const opt = this._options[this._selectedIndex];\n if (opt && !opt.disabled) { this._onSelect?.(opt, this._selectedIndex); this._isOpen = false; }\n }\n\n protected _renderSelf(screen: Screen): void {\n const { x, y, width } = this._rect;\n if (width <= 0) return;\n const attrs = styleToCellAttrs(this.style);\n const sel = this._options[this._selectedIndex];\n const label = sel ? sel.label : this._placeholder;\n const prefix = this._isOpen ? '▼ ' : '▶ ';\n screen.writeString(x, y, prefix + label.slice(0, width - 2), { ...attrs, fg: this._activeColor });\n if (this._isOpen) {\n for (let i = 0; i < this._options.length; i++) {\n const o = this._options[i];\n const isSel = i === this._selectedIndex;\n const m = isSel ? '● ' : ' ';\n screen.writeString(x, y + 1 + i, m + o.label.slice(0, width - 2), {\n ...attrs,\n fg: o.disabled ? { type: 'named' as const, name: 'brightBlack' as const } : isSel ? this._activeColor : attrs.fg,\n bold: isSel, dim: o.disabled,\n });\n }\n }\n }\n}\n","// MultiSelect — checkbox-style multi-item selector\nimport { Widget } from '@termuijs/widgets';\nimport { type Style, type Screen, mergeStyles, defaultStyle, styleToCellAttrs } from '@termuijs/core';\n\nexport interface MultiSelectOption { label: string; value: string; disabled?: boolean; }\nexport interface MultiSelectOptions {\n activeColor?: Style['fg'];\n checkChar?: string;\n uncheckChar?: string;\n onSubmit?: (selected: MultiSelectOption[]) => void;\n}\n\nexport class MultiSelect extends Widget {\n private _options: MultiSelectOption[];\n private _cursorIndex = 0;\n private _checked: Set<number> = new Set();\n private _activeColor: Style['fg'];\n private _checkChar: string;\n private _uncheckChar: string;\n private _onSubmit?: (selected: MultiSelectOption[]) => void;\n focusable = true;\n\n constructor(options: MultiSelectOption[], config: MultiSelectOptions = {}) {\n super(mergeStyles(defaultStyle(), { height: Math.max(options.length, 1) }));\n this._options = options;\n this._activeColor = config.activeColor ?? { type: 'named', name: 'cyan' };\n this._checkChar = config.checkChar ?? '◼';\n this._uncheckChar = config.uncheckChar ?? '◻';\n this._onSubmit = config.onSubmit;\n }\n\n get selectedOptions(): MultiSelectOption[] {\n return [...this._checked].sort().map(i => this._options[i]);\n }\n selectNext(): void { let n = this._cursorIndex + 1; while (n < this._options.length && this._options[n].disabled) n++; if (n < this._options.length) this._cursorIndex = n; }\n selectPrev(): void { let n = this._cursorIndex - 1; while (n >= 0 && this._options[n].disabled) n--; if (n >= 0) this._cursorIndex = n; }\n toggleCurrent(): void {\n const o = this._options[this._cursorIndex];\n if (o && !o.disabled) { this._checked.has(this._cursorIndex) ? this._checked.delete(this._cursorIndex) : this._checked.add(this._cursorIndex); }\n }\n submit(): void { this._onSubmit?.(this.selectedOptions); }\n\n protected _renderSelf(screen: Screen): void {\n const { x, y, width, height } = this._rect;\n if (width <= 0 || height <= 0) return;\n const attrs = styleToCellAttrs(this.style);\n for (let i = 0; i < this._options.length && i < height; i++) {\n const o = this._options[i];\n const active = i === this._cursorIndex;\n const checked = this._checked.has(i);\n const label = `${active ? '❯ ' : ' '}${checked ? this._checkChar : this._uncheckChar} ${o.label}`;\n screen.writeString(x, y + i, label.slice(0, width), {\n ...attrs,\n fg: o.disabled ? { type: 'named' as const, name: 'brightBlack' as const } : active ? this._activeColor : attrs.fg,\n bold: active, dim: o.disabled,\n });\n }\n }\n}\n","// Tree — expandable/collapsible tree view\nimport { Widget } from '@termuijs/widgets';\nimport { type Style, type Screen, mergeStyles, defaultStyle, styleToCellAttrs } from '@termuijs/core';\n\nexport interface TreeNode { label: string; children?: TreeNode[]; expanded?: boolean; icon?: string; }\nexport interface TreeOptions { activeColor?: Style['fg']; onSelect?: (node: TreeNode, path: number[]) => void; }\n\nexport class Tree extends Widget {\n private _roots: TreeNode[];\n private _cursorIndex = 0;\n private _activeColor: Style['fg'];\n private _onSelect?: (node: TreeNode, path: number[]) => void;\n focusable = true;\n\n constructor(roots: TreeNode[], options: TreeOptions = {}) {\n super(mergeStyles(defaultStyle(), { flexGrow: 1 }));\n this._roots = roots;\n this._activeColor = options.activeColor ?? { type: 'named', name: 'cyan' };\n this._onSelect = options.onSelect;\n }\n\n private _flatten(): { node: TreeNode; depth: number; path: number[]; hasChildren: boolean }[] {\n const result: { node: TreeNode; depth: number; path: number[]; hasChildren: boolean }[] = [];\n const walk = (nodes: TreeNode[], depth: number, path: number[]) => {\n for (let i = 0; i < nodes.length; i++) {\n const node = nodes[i];\n const hasChildren = (node.children?.length ?? 0) > 0;\n result.push({ node, depth, path: [...path, i], hasChildren });\n if (hasChildren && node.expanded) walk(node.children!, depth + 1, [...path, i]);\n }\n };\n walk(this._roots, 0, []);\n return result;\n }\n\n selectNext(): void { const f = this._flatten(); if (this._cursorIndex < f.length - 1) this._cursorIndex++; }\n selectPrev(): void { if (this._cursorIndex > 0) this._cursorIndex--; }\n toggleExpand(): void { const f = this._flatten(); const it = f[this._cursorIndex]; if (it?.hasChildren) it.node.expanded = !it.node.expanded; }\n confirm(): void {\n const f = this._flatten(); const it = f[this._cursorIndex];\n if (it) { it.hasChildren ? this.toggleExpand() : this._onSelect?.(it.node, it.path); }\n }\n\n protected _renderSelf(screen: Screen): void {\n const { x, y, width, height } = this._rect;\n if (width <= 0 || height <= 0) return;\n const attrs = styleToCellAttrs(this.style);\n const flat = this._flatten();\n for (let i = 0; i < flat.length && i < height; i++) {\n const it = flat[i];\n const active = i === this._cursorIndex;\n const indent = ' '.repeat(it.depth);\n const icon = it.hasChildren ? (it.node.expanded ? '▼ ' : '▶ ') : ' ';\n const nodeIcon = it.node.icon ? `${it.node.icon} ` : '';\n const line = `${indent}${icon}${nodeIcon}${it.node.label}`;\n screen.writeString(x, y + i, line.slice(0, width), { ...attrs, fg: active ? this._activeColor : attrs.fg, bold: active });\n }\n }\n}\n","// Toast — auto-dismiss notification\nimport { Widget } from '@termuijs/widgets';\nimport { type Screen, mergeStyles, defaultStyle, styleToCellAttrs } from '@termuijs/core';\n\nexport type ToastType = 'info' | 'success' | 'warning' | 'error';\nexport interface ToastMessage { text: string; type: ToastType; expireAt: number; }\nexport interface ToastOptions { position?: 'top-right' | 'bottom-right' | 'top-left' | 'bottom-left'; durationMs?: number; maxVisible?: number; }\n\nconst ICONS: Record<ToastType, string> = { info: 'ℹ', success: '✓', warning: '⚠', error: '✗' };\nconst COLORS: Record<ToastType, string> = { info: 'cyan', success: 'green', warning: 'yellow', error: 'red' };\n\nexport class Toast extends Widget {\n private _messages: ToastMessage[] = [];\n private _position: string;\n private _durationMs: number;\n private _maxVisible: number;\n\n constructor(options: ToastOptions = {}) {\n super(mergeStyles(defaultStyle(), {}));\n this._position = options.position ?? 'top-right';\n this._durationMs = options.durationMs ?? 3000;\n this._maxVisible = options.maxVisible ?? 5;\n }\n\n push(text: string, type: ToastType = 'info'): void { this._messages.push({ text, type, expireAt: Date.now() + this._durationMs }); }\n info(text: string): void { this.push(text, 'info'); }\n success(text: string): void { this.push(text, 'success'); }\n warning(text: string): void { this.push(text, 'warning'); }\n error(text: string): void { this.push(text, 'error'); }\n\n protected _renderSelf(screen: Screen): void {\n const now = Date.now();\n this._messages = this._messages.filter(m => m.expireAt > now);\n if (this._messages.length === 0) return;\n const { x, y, width, height } = this._rect;\n const visible = this._messages.slice(-this._maxVisible);\n const tw = Math.min(40, width - 2);\n const isRight = this._position.includes('right');\n const isBottom = this._position.includes('bottom');\n const sx = isRight ? x + width - tw - 1 : x + 1;\n const sy = isBottom ? y + height - visible.length - 1 : y + 1;\n const attrs = styleToCellAttrs(this.style);\n for (let i = 0; i < visible.length; i++) {\n const m = visible[i];\n const label = ` ${ICONS[m.type]} ${m.text} `.slice(0, tw).padEnd(tw);\n screen.writeString(sx, sy + i, label, { ...attrs, fg: { type: 'named', name: COLORS[m.type] as any }, bold: true });\n }\n }\n}\n","// ConfirmDialog — yes/no prompt overlay\nimport { Widget } from '@termuijs/widgets';\nimport { type Style, type Screen, mergeStyles, defaultStyle, styleToCellAttrs, getBorderChars } from '@termuijs/core';\n\nexport interface ConfirmDialogOptions {\n message: string;\n confirmLabel?: string;\n cancelLabel?: string;\n borderColor?: Style['fg'];\n onConfirm?: () => void;\n onCancel?: () => void;\n}\n\nexport class ConfirmDialog extends Widget {\n private _message: string;\n private _confirmLabel: string;\n private _cancelLabel: string;\n private _borderColor: Style['fg'];\n private _selected: 'confirm' | 'cancel' = 'confirm';\n private _visible = false;\n private _onConfirm?: () => void;\n private _onCancel?: () => void;\n focusable = true;\n\n constructor(options: ConfirmDialogOptions) {\n super(mergeStyles(defaultStyle(), {}));\n this._message = options.message;\n this._confirmLabel = options.confirmLabel ?? 'Yes';\n this._cancelLabel = options.cancelLabel ?? 'No';\n this._borderColor = options.borderColor ?? { type: 'named', name: 'yellow' };\n this._onConfirm = options.onConfirm;\n this._onCancel = options.onCancel;\n }\n\n get visible(): boolean { return this._visible; }\n show(): void { this._visible = true; this._selected = 'confirm'; }\n hide(): void { this._visible = false; }\n selectConfirm(): void { this._selected = 'confirm'; }\n selectCancel(): void { this._selected = 'cancel'; }\n toggleSelection(): void { this._selected = this._selected === 'confirm' ? 'cancel' : 'confirm'; }\n confirm(): void {\n (this._selected === 'confirm' ? this._onConfirm : this._onCancel)?.();\n this._visible = false;\n }\n\n protected _renderSelf(screen: Screen): void {\n if (!this._visible) return;\n const { x, y, width, height } = this._rect;\n const attrs = styleToCellAttrs(this.style);\n for (let r = 0; r < height; r++) screen.writeString(x, y + r, '░'.repeat(width), { ...attrs, dim: true });\n const bw = Math.min(40, width - 4);\n const bh = 5;\n const bx = x + Math.floor((width - bw) / 2);\n const by = y + Math.floor((height - bh) / 2);\n const border = getBorderChars('single');\n if (!border) return;\n const ba = { ...attrs, fg: this._borderColor };\n screen.writeString(bx, by, border.topLeft + border.top.repeat(bw - 2) + border.topRight, ba);\n for (let r = 1; r < bh - 1; r++) {\n screen.writeString(bx, by + r, border.left, ba);\n screen.writeString(bx + 1, by + r, ' '.repeat(bw - 2), attrs);\n screen.writeString(bx + bw - 1, by + r, border.right, ba);\n }\n screen.writeString(bx, by + bh - 1, border.bottomLeft + border.bottom.repeat(bw - 2) + border.bottomRight, ba);\n screen.writeString(bx + 2, by + 1, this._message.slice(0, bw - 4), { ...attrs, bold: true });\n const yesStr = this._selected === 'confirm' ? ` [${this._confirmLabel}] ` : ` ${this._confirmLabel} `;\n const noStr = this._selected === 'cancel' ? ` [${this._cancelLabel}] ` : ` ${this._cancelLabel} `;\n screen.writeString(bx + 2, by + 3, yesStr, { ...attrs, fg: this._selected === 'confirm' ? { type: 'named', name: 'green' } : attrs.fg, bold: this._selected === 'confirm' });\n screen.writeString(bx + 2 + yesStr.length + 2, by + 3, noStr, { ...attrs, fg: this._selected === 'cancel' ? { type: 'named', name: 'red' } : attrs.fg, bold: this._selected === 'cancel' });\n }\n}\n","// Form — compound input container with validation\nimport { Widget } from '@termuijs/widgets';\nimport { type Style, type Screen, mergeStyles, defaultStyle, styleToCellAttrs } from '@termuijs/core';\n\nexport interface FormField {\n name: string; label: string; type: 'text' | 'select' | 'checkbox';\n placeholder?: string; required?: boolean; options?: string[];\n validate?: (value: string) => string | null;\n}\nexport interface FormOptions {\n labelColor?: Style['fg']; errorColor?: Style['fg']; activeColor?: Style['fg'];\n onSubmit?: (values: Record<string, string>) => void;\n}\n\nexport class Form extends Widget {\n private _fields: FormField[];\n private _values: Map<string, string> = new Map();\n private _errors: Map<string, string> = new Map();\n private _activeField = 0;\n private _cursorPos = 0;\n private _labelColor: Style['fg'];\n private _errorColor: Style['fg'];\n private _activeColor: Style['fg'];\n private _onSubmit?: (values: Record<string, string>) => void;\n focusable = true;\n\n constructor(fields: FormField[], options: FormOptions = {}) {\n super(mergeStyles(defaultStyle(), { height: fields.length * 2 + 1, flexGrow: 1 }));\n this._fields = fields;\n this._labelColor = options.labelColor ?? { type: 'named', name: 'cyan' };\n this._errorColor = options.errorColor ?? { type: 'named', name: 'red' };\n this._activeColor = options.activeColor ?? { type: 'named', name: 'cyan' };\n this._onSubmit = options.onSubmit;\n for (const f of fields) this._values.set(f.name, '');\n }\n\n get values(): Record<string, string> { const r: Record<string, string> = {}; for (const [k, v] of this._values) r[k] = v; return r; }\n nextField(): void { if (this._activeField < this._fields.length) { this._activeField++; this._cursorPos = 0; } }\n prevField(): void { if (this._activeField > 0) { this._activeField--; this._cursorPos = (this._values.get(this._fields[this._activeField].name) ?? '').length; } }\n insertChar(ch: string): void {\n if (this._activeField >= this._fields.length) return;\n const f = this._fields[this._activeField]; const cur = this._values.get(f.name) ?? '';\n this._values.set(f.name, cur.slice(0, this._cursorPos) + ch + cur.slice(this._cursorPos));\n this._cursorPos++; this._errors.delete(f.name);\n }\n deleteBack(): void {\n if (this._activeField >= this._fields.length) return;\n const f = this._fields[this._activeField]; const cur = this._values.get(f.name) ?? '';\n if (this._cursorPos > 0) { this._values.set(f.name, cur.slice(0, this._cursorPos - 1) + cur.slice(this._cursorPos)); this._cursorPos--; }\n }\n submit(): void {\n this._errors.clear(); let hasErr = false;\n for (const f of this._fields) {\n const v = this._values.get(f.name) ?? '';\n if (f.required && !v.trim()) { this._errors.set(f.name, `${f.label} is required`); hasErr = true; }\n if (f.validate) { const e = f.validate(v); if (e) { this._errors.set(f.name, e); hasErr = true; } }\n }\n if (!hasErr) this._onSubmit?.(this.values);\n }\n\n protected _renderSelf(screen: Screen): void {\n const { x, y, width, height } = this._rect;\n if (width <= 0 || height <= 0) return;\n const attrs = styleToCellAttrs(this.style);\n let row = 0;\n for (let i = 0; i < this._fields.length && row < height - 1; i++) {\n const f = this._fields[i]; const active = i === this._activeField;\n const val = this._values.get(f.name) ?? ''; const err = this._errors.get(f.name);\n screen.writeString(x, y + row, `${f.label}${f.required ? ' *' : ''}:`.slice(0, width), { ...attrs, fg: err ? this._errorColor : this._labelColor, bold: active }); row++;\n if (row >= height) break;\n const display = val || (f.placeholder ?? '');\n screen.writeString(x, y + row, `${active ? '❯ ' : ' '}${display}`.slice(0, width), { ...attrs, fg: active ? this._activeColor : attrs.fg, dim: !val && !!f.placeholder }); row++;\n }\n if (row < height) {\n const isSub = this._activeField >= this._fields.length;\n screen.writeString(x, y + row, isSub ? ' [ Submit ]' : ' Submit ', { ...attrs, fg: isSub ? { type: 'named', name: 'green' } : attrs.fg, bold: isSub });\n }\n }\n}\n","// CommandPalette — fuzzy-search command launcher\nimport { Widget } from '@termuijs/widgets';\nimport { type Style, type Screen, mergeStyles, defaultStyle, styleToCellAttrs, getBorderChars } from '@termuijs/core';\n\nexport interface Command { id: string; label: string; shortcut?: string; action: () => void; category?: string; }\nexport interface CommandPaletteOptions { placeholder?: string; borderColor?: Style['fg']; activeColor?: Style['fg']; maxVisible?: number; }\n\nexport class CommandPalette extends Widget {\n private _commands: Command[];\n private _filtered: Command[] = [];\n private _query = '';\n private _cursorPos = 0;\n private _selectedIndex = 0;\n private _visible = false;\n private _placeholder: string;\n private _borderColor: Style['fg'];\n private _activeColor: Style['fg'];\n private _maxVisible: number;\n focusable = true;\n\n constructor(commands: Command[], options: CommandPaletteOptions = {}) {\n super(mergeStyles(defaultStyle(), {}));\n this._commands = commands;\n this._filtered = [...commands];\n this._placeholder = options.placeholder ?? 'Type a command...';\n this._borderColor = options.borderColor ?? { type: 'named', name: 'cyan' };\n this._activeColor = options.activeColor ?? { type: 'named', name: 'cyan' };\n this._maxVisible = options.maxVisible ?? 10;\n }\n\n get visible(): boolean { return this._visible; }\n show(): void { this._visible = true; this._query = ''; this._cursorPos = 0; this._selectedIndex = 0; this._filtered = [...this._commands]; }\n hide(): void { this._visible = false; }\n toggle(): void { this._visible ? this.hide() : this.show(); }\n insertChar(ch: string): void { this._query = this._query.slice(0, this._cursorPos) + ch + this._query.slice(this._cursorPos); this._cursorPos++; this._filter(); }\n deleteBack(): void { if (this._cursorPos > 0) { this._query = this._query.slice(0, this._cursorPos - 1) + this._query.slice(this._cursorPos); this._cursorPos--; this._filter(); } }\n selectNext(): void { if (this._selectedIndex < this._filtered.length - 1) this._selectedIndex++; }\n selectPrev(): void { if (this._selectedIndex > 0) this._selectedIndex--; }\n confirm(): void { const c = this._filtered[this._selectedIndex]; if (c) { this.hide(); c.action(); } }\n\n private _filter(): void {\n const q = this._query.toLowerCase();\n if (!q) { this._filtered = [...this._commands]; } else {\n this._filtered = this._commands.filter(c => { const l = c.label.toLowerCase(); let qi = 0; for (let i = 0; i < l.length && qi < q.length; i++) { if (l[i] === q[qi]) qi++; } return qi === q.length; });\n }\n this._selectedIndex = 0;\n }\n\n protected _renderSelf(screen: Screen): void {\n if (!this._visible) return;\n const { x, y, width, height } = this._rect;\n const attrs = styleToCellAttrs(this.style);\n // Backdrop\n for (let r = 0; r < height; r++) screen.writeString(x, y + r, '░'.repeat(width), { ...attrs, dim: true });\n // Box\n const vis = this._filtered.slice(0, this._maxVisible);\n const bw = Math.min(60, width - 4);\n const bh = Math.min(vis.length + 3, height - 2);\n const bx = x + Math.floor((width - bw) / 2);\n const by = y + 2;\n const border = getBorderChars('single');\n if (!border) return;\n const ba = { ...attrs, fg: this._borderColor };\n // Top\n screen.writeString(bx, by, border.topLeft + border.top.repeat(bw - 2) + border.topRight, ba);\n // Input row\n screen.writeString(bx, by + 1, border.left, ba);\n const input = this._query || this._placeholder;\n screen.writeString(bx + 1, by + 1, (' 🔍 ' + input).slice(0, bw - 2).padEnd(bw - 2), { ...attrs, dim: !this._query });\n screen.writeString(bx + bw - 1, by + 1, border.right, ba);\n // Separator\n screen.writeString(bx, by + 2, border.left + '─'.repeat(bw - 2) + border.right, ba);\n // Items\n for (let i = 0; i < vis.length && i + 3 < bh - 1; i++) {\n const c = vis[i]; const active = i === this._selectedIndex;\n const label = (active ? '❯ ' : ' ') + c.label;\n const sc = c.shortcut ?? '';\n screen.writeString(bx, by + 3 + i, border.left, ba);\n screen.writeString(bx + 1, by + 3 + i, (' ' + label).slice(0, bw - sc.length - 3).padEnd(bw - sc.length - 3), { ...attrs, fg: active ? this._activeColor : attrs.fg, bold: active });\n if (sc) screen.writeString(bx + bw - sc.length - 2, by + 3 + i, sc, { ...attrs, dim: true });\n screen.writeString(bx + bw - 1, by + 3 + i, border.right, ba);\n }\n // Bottom\n const last = Math.min(by + 3 + vis.length, by + bh - 1);\n screen.writeString(bx, last, border.bottomLeft + border.bottom.repeat(bw - 2) + border.bottomRight, ba);\n }\n}\n"],"mappings":";AAQA;AAAA,EACI;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,UAAAA;AAAA,OACG;;;ACpBP,SAAS,cAAc;AACvB,SAAkC,aAAa,cAAc,wBAAwB;AAQ9E,IAAM,UAAN,cAAsB,OAAO;AAAA,EACxB;AAAA,EACA;AAAA,EACA;AAAA,EAER,YAAY,UAA0B,CAAC,GAAG;AACtC,UAAM,YAAY,aAAa,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC;AAChD,SAAK,QAAQ,QAAQ,QAAQ;AAC7B,SAAK,SAAS,QAAQ;AACtB,SAAK,SAAS,QAAQ,SAAS;AAAA,EACnC;AAAA,EAEU,YAAY,QAAsB;AACxC,UAAM,EAAE,GAAG,GAAG,MAAM,IAAI,KAAK;AAC7B,QAAI,SAAS,EAAG;AAChB,UAAM,QAAQ,iBAAiB,KAAK,KAAK;AACzC,QAAI,KAAK,OAAQ,OAAM,KAAK,KAAK;AACjC,UAAM,MAAM;AACZ,QAAI,KAAK,QAAQ;AACb,YAAM,WAAW,IAAI,KAAK,MAAM;AAChC,YAAM,UAAU,KAAK,IAAI,GAAG,KAAK,OAAO,QAAQ,SAAS,UAAU,CAAC,CAAC;AACrE,YAAM,WAAW,KAAK,IAAI,GAAG,QAAQ,UAAU,S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AAC;AACpH,WAAO,YAAY,KAAK,KAAK,GAAG,KAAK,GAAG,OAAO,OAAO,EAAE;AAExD,WAAO,YAAY,IAAI,KAAK,GAAG,OAAO,OAAO,SAAI,OAAO,KAAK,CAAC,IAAI,OAAO,OAAO,EAAE;AAElF,aAAS,IAAI,GAAG,IAAI,IAAI,UAAU,IAAI,IAAI,KAAK,GAAG,KAAK;AACnD,YAAM,IAAI,IAAI,CAAC;AAAG,YAAM,SAAS,MAAM,KAAK;AAC5C,YAAM,SAAS,SAAS,YAAO,QAAQ,EAAE;AACzC,YAAM,KAAK,EAAE,YAAY;AACzB,aAAO,YAAY,IAAI,KAAK,IAAI,GAAG,OAAO,MAAM,EAAE;AAClD,aAAO,YAAY,KAAK,GAAG,KAAK,IAAI,IAAI,MAAM,OAAO,MAAM,GAAG,KAAK,GAAG,SAAS,CAAC,EAAE,OAAO,KAAK,GAAG,SAAS,CAAC,GAAG,EAAE,GAAG,OAAO,IAAI,SAAS,KAAK,eAAe,MAAM,IAAI,MAAM,OAAO,CAAC;AACnL,UAAI,GAAI,QAAO,YAAY,KAAK,KAAK,GAAG,SAAS,GAAG,KAAK,IAAI,GAAG,IAAI,EAAE,GAAG,OAAO,KAAK,KAAK,CAAC;AAC3F,aAAO,YAAY,KAAK,KAAK,GAAG,KAAK,IAAI,GAAG,OAAO,OAAO,EAAE;AAAA,IAChE;AAEA,UAAM,OAAO,KAAK,IAAI,KAAK,IAAI,IAAI,QAAQ,KAAK,KAAK,CAAC;AACtD,WAAO,YAAY,IAAI,MAAM,OAAO,aAAa,OAAO,OAAO,OAAO,KAAK,CAAC,IAAI,OAAO,aAAa,EAAE;AAAA,EAC1G;AACJ;","names":["Widget","Widget","mergeStyles","defaultStyle","Widget","mergeStyles","defaultStyle","styleToCellAttrs","Widget","mergeStyles","defaultStyle","styleToCellAttrs","Widget","mergeStyles","defaultStyle","styleToCellAttrs","Widget","mergeStyles","defaultStyle","styleToCellAttrs","Widget","mergeStyles","defaultStyle","styleToCellAttrs","Widget","mergeStyles","defaultStyle","styleToCellAttrs","Widget","mergeStyles","defaultStyle","styleToCellAttrs","getBorderChars","Widget","mergeStyles","defaultStyle","styleToCellAttrs","Widget","mergeStyles","defaultStyle","styleToCellAttrs","getBorderChars"]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/Divider.ts","../src/Spacer.ts","../src/Tabs.ts","../src/Modal.ts","../src/Select.ts","../src/MultiSelect.ts","../src/Tree.ts","../src/Toast.ts","../src/ConfirmDialog.ts","../src/Form.ts","../src/CommandPalette.ts"],"sourcesContent":["// ─────────────────────────────────────────────────────\n// @termuijs/ui — Rich Component Library\n//\n// The shadcn/ui for terminals — 16+ production-ready\n// components for building beautiful CLI apps.\n// ─────────────────────────────────────────────────────\n\n// ── Re-exports from @termuijs/widgets (base components) ──\nexport {\n Box,\n Text,\n Table,\n List,\n TextInput,\n Gauge,\n Sparkline,\n StatusIndicator,\n LogView,\n ProgressBar,\n Spinner,\n Widget,\n} from '@termuijs/widgets';\n\n// ── New components ──\nexport { Divider } from './Divider.js';\nexport type { DividerOptions } from './Divider.js';\n\nexport { Spacer } from './Spacer.js';\n\nexport { Tabs } from './Tabs.js';\nexport type { Tab, TabsOptions } from './Tabs.js';\n\nexport { Modal } from './Modal.js';\nexport type { ModalOptions } from './Modal.js';\n\nexport { Select } from './Select.js';\nexport type { SelectOption, SelectOptions } from './Select.js';\n\nexport { MultiSelect } from './MultiSelect.js';\nexport type { MultiSelectOption, MultiSelectOptions } from './MultiSelect.js';\n\nexport { Tree } from './Tree.js';\nexport type { TreeNode, TreeOptions } from './Tree.js';\n\nexport { Toast } from './Toast.js';\nexport type { ToastType, ToastMessage, ToastOptions } from './Toast.js';\n\nexport { ConfirmDialog } from './ConfirmDialog.js';\nexport type { ConfirmDialogOptions } from './ConfirmDialog.js';\n\nexport { Form } from './Form.js';\nexport type { FormField, FormOptions } from './Form.js';\n\nexport { CommandPalette } from './CommandPalette.js';\nexport type { Command, CommandPaletteOptions } from './CommandPalette.js';\n","// Divider — horizontal separator line\nimport { Widget } from '@termuijs/widgets';\nimport { type Style, type Screen, mergeStyles, defaultStyle, styleToCellAttrs } from '@termuijs/core';\n\nexport interface DividerOptions {\n char?: string;\n color?: Style['fg'];\n title?: string;\n}\n\nexport class Divider extends Widget {\n private _char: string;\n private _color: Style['fg'];\n private _title: string;\n\n constructor(options: DividerOptions = {}) {\n super(mergeStyles(defaultStyle(), { height: 1 }));\n this._char = options.char ?? '─';\n this._color = options.color;\n this._title = options.title ?? '';\n }\n\n protected _renderSelf(screen: Screen): void {\n const { x, y, width } = this._rect;\n if (width <= 0) return;\n const attrs = styleToCellAttrs(this.style);\n if (this._color) attrs.fg = this._color;\n attrs.dim = true;\n if (this._title) {\n const titleStr = ` ${this._title} `;\n const padLeft = Math.max(0, Math.floor((width - titleStr.length) / 2));\n const padRight = Math.max(0, width - padLeft - titleStr.length);\n const line = this._char.repeat(padLeft) + titleStr + this._char.repeat(padRight);\n screen.writeString(x, y, line.slice(0, width), attrs);\n } else {\n screen.writeString(x, y, this._char.repeat(width), attrs);\n }\n }\n}\n","// Spacer — flexible empty space\nimport { Widget } from '@termuijs/widgets';\nimport { type Screen, mergeStyles, defaultStyle } from '@termuijs/core';\n\nexport class Spacer extends Widget {\n constructor(grow: number = 1) {\n super(mergeStyles(defaultStyle(), { flexGrow: grow }));\n }\n protected _renderSelf(_screen: Screen): void { /* empty */ }\n}\n","// Tabs — tabbed container with keyboard switching\nimport { Widget } from '@termuijs/widgets';\nimport { type Style, type Screen, mergeStyles, defaultStyle, styleToCellAttrs } from '@termuijs/core';\n\nexport interface Tab { label: string; content: Widget; }\nexport interface TabsOptions {\n activeColor?: Style['fg'];\n inactiveColor?: Style['fg'];\n border?: Style['border'];\n}\n\nexport class Tabs extends Widget {\n private _tabs: Tab[] = [];\n private _activeIndex = 0;\n private _activeColor: Style['fg'];\n private _inactiveColor: Style['fg'];\n focusable = true;\n\n constructor(tabs: Tab[], options: TabsOptions = {}) {\n super(mergeStyles(defaultStyle(), { flexGrow: 1, border: options.border ?? 'single' }));\n this._tabs = tabs;\n this._activeColor = options.activeColor ?? { type: 'named', name: 'cyan' };\n this._inactiveColor = options.inactiveColor ?? { type: 'named', name: 'brightBlack' };\n }\n\n get activeIndex(): number { return this._activeIndex; }\n selectTab(i: number): void { if (i >= 0 && i < this._tabs.length) { this._activeIndex = i; this.markDirty(); } }\n nextTab(): void { this._activeIndex = (this._activeIndex + 1) % this._tabs.length; this.markDirty(); }\n prevTab(): void { this._activeIndex = (this._activeIndex - 1 + this._tabs.length) % this._tabs.length; this.markDirty(); }\n get activeContent(): Widget | undefined { return this._tabs[this._activeIndex]?.content; }\n\n protected _renderSelf(screen: Screen): void {\n const { x, y, width, height } = this._rect;\n if (width <= 0 || height <= 0) return;\n const attrs = styleToCellAttrs(this.style);\n let col = x;\n for (let i = 0; i < this._tabs.length; i++) {\n const tab = this._tabs[i];\n const isActive = i === this._activeIndex;\n const label = isActive ? ` ● ${tab.label} ` : ` ${tab.label} `;\n screen.writeString(col, y, label, {\n ...attrs,\n fg: isActive ? this._activeColor : this._inactiveColor,\n bold: isActive, dim: !isActive,\n });\n col += label.length;\n if (i < this._tabs.length - 1) { screen.writeString(col, y, '│', { ...attrs, dim: true }); col++; }\n }\n if (height > 1) screen.writeString(x, y + 1, '─'.repeat(width), { ...attrs, dim: true });\n }\n}\n","// Modal — overlay dialog with backdrop\nimport { Widget } from '@termuijs/widgets';\nimport { type Style, type Screen, mergeStyles, defaultStyle, styleToCellAttrs, getBorderChars } from '@termuijs/core';\n\nexport interface ModalOptions {\n title?: string;\n width?: number;\n height?: number;\n borderColor?: Style['fg'];\n backdropChar?: string;\n}\n\nexport class Modal extends Widget {\n private _title: string;\n private _modalWidth: number;\n private _modalHeight: number;\n private _borderColor: Style['fg'];\n private _backdropChar: string;\n private _visible = false;\n private _content: Widget | null = null;\n\n constructor(options: ModalOptions = {}) {\n super(mergeStyles(defaultStyle(), {}));\n this._title = options.title ?? '';\n this._modalWidth = options.width ?? 50;\n this._modalHeight = options.height ?? 15;\n this._borderColor = options.borderColor ?? { type: 'named', name: 'cyan' };\n this._backdropChar = options.backdropChar ?? '░';\n }\n\n get visible(): boolean { return this._visible; }\n show(): void { this._visible = true; this.markDirty(); }\n hide(): void { this._visible = false; this.markDirty(); }\n toggle(): void { this._visible = !this._visible; this.markDirty(); }\n setContent(content: Widget): void { this._content = content; this.markDirty(); }\n\n protected _renderSelf(screen: Screen): void {\n if (!this._visible) return;\n const { x, y, width, height } = this._rect;\n const attrs = styleToCellAttrs(this.style);\n // Backdrop\n for (let r = 0; r < height; r++) {\n screen.writeString(x, y + r, this._backdropChar.repeat(width), { ...attrs, dim: true });\n }\n // Centered modal\n const mw = Math.min(this._modalWidth, width - 4);\n const mh = Math.min(this._modalHeight, height - 2);\n const mx = x + Math.floor((width - mw) / 2);\n const my = y + Math.floor((height - mh) / 2);\n const border = getBorderChars('single');\n if (!border) return;\n const bAttrs = { ...attrs, fg: this._borderColor };\n // Title bar\n const titleStr = this._title ? ` ${this._title} ` : '';\n const topFill = mw - 2 - titleStr.length;\n const tl = Math.floor(topFill / 2);\n const tr = topFill - tl;\n screen.writeString(mx, my, border.topLeft + border.top.repeat(tl) + titleStr + border.top.repeat(Math.max(0, tr)) + border.topRight, bAttrs);\n // Sides\n const clr = styleToCellAttrs(this.style);\n for (let r = 1; r < mh - 1; r++) {\n screen.writeString(mx, my + r, border.left, bAttrs);\n screen.writeString(mx + 1, my + r, ' '.repeat(mw - 2), clr);\n screen.writeString(mx + mw - 1, my + r, border.right, bAttrs);\n }\n // Bottom\n screen.writeString(mx, my + mh - 1, border.bottomLeft + border.bottom.repeat(mw - 2) + border.bottomRight, bAttrs);\n // Content\n if (this._content) {\n const cr = { x: mx + 2, y: my + 1, width: mw - 4, height: mh - 2 };\n (this._content as any)._rect = cr;\n (this._content as any)._renderSelf(screen);\n }\n }\n}\n","// Select — single-item dropdown selector\nimport { Widget } from '@termuijs/widgets';\nimport { type Style, type Screen, mergeStyles, defaultStyle, styleToCellAttrs } from '@termuijs/core';\n\nexport interface SelectOption { label: string; value: string; disabled?: boolean; }\nexport interface SelectOptions {\n placeholder?: string;\n activeColor?: Style['fg'];\n onSelect?: (option: SelectOption, index: number) => void;\n}\n\nexport class Select extends Widget {\n private _options: SelectOption[];\n private _selectedIndex = 0;\n private _isOpen = false;\n private _placeholder: string;\n private _activeColor: Style['fg'];\n private _onSelect?: (option: SelectOption, index: number) => void;\n focusable = true;\n\n constructor(options: SelectOption[], config: SelectOptions = {}) {\n super(mergeStyles(defaultStyle(), { height: 1 }));\n this._options = options;\n this._placeholder = config.placeholder ?? 'Select...';\n this._activeColor = config.activeColor ?? { type: 'named', name: 'cyan' };\n this._onSelect = config.onSelect;\n }\n\n get selectedOption(): SelectOption | undefined { return this._options[this._selectedIndex]; }\n get selectedIndex(): number { return this._selectedIndex; }\n get isOpen(): boolean { return this._isOpen; }\n open(): void { this._isOpen = true; this.markDirty(); }\n close(): void { this._isOpen = false; this.markDirty(); }\n toggle(): void { this._isOpen = !this._isOpen; this.markDirty(); }\n\n selectNext(): void {\n let n = this._selectedIndex + 1;\n while (n < this._options.length && this._options[n].disabled) n++;\n if (n < this._options.length) { this._selectedIndex = n; this.markDirty(); }\n }\n selectPrev(): void {\n let n = this._selectedIndex - 1;\n while (n >= 0 && this._options[n].disabled) n--;\n if (n >= 0) { this._selectedIndex = n; this.markDirty(); }\n }\n confirm(): void {\n const opt = this._options[this._selectedIndex];\n if (opt && !opt.disabled) { this._onSelect?.(opt, this._selectedIndex); this._isOpen = false; this.markDirty(); }\n }\n\n protected _renderSelf(screen: Screen): void {\n const { x, y, width } = this._rect;\n if (width <= 0) return;\n const attrs = styleToCellAttrs(this.style);\n const sel = this._options[this._selectedIndex];\n const label = sel ? sel.label : this._placeholder;\n const prefix = this._isOpen ? '▼ ' : '▶ ';\n screen.writeString(x, y, prefix + label.slice(0, width - 2), { ...attrs, fg: this._activeColor });\n if (this._isOpen) {\n for (let i = 0; i < this._options.length; i++) {\n const o = this._options[i];\n const isSel = i === this._selectedIndex;\n const m = isSel ? '● ' : ' ';\n screen.writeString(x, y + 1 + i, m + o.label.slice(0, width - 2), {\n ...attrs,\n fg: o.disabled ? { type: 'named' as const, name: 'brightBlack' as const } : isSel ? this._activeColor : attrs.fg,\n bold: isSel, dim: o.disabled,\n });\n }\n }\n }\n}\n","// MultiSelect — checkbox-style multi-item selector\nimport { Widget } from '@termuijs/widgets';\nimport { type Style, type Screen, mergeStyles, defaultStyle, styleToCellAttrs } from '@termuijs/core';\n\nexport interface MultiSelectOption { label: string; value: string; disabled?: boolean; }\nexport interface MultiSelectOptions {\n activeColor?: Style['fg'];\n checkChar?: string;\n uncheckChar?: string;\n onSubmit?: (selected: MultiSelectOption[]) => void;\n}\n\nexport class MultiSelect extends Widget {\n private _options: MultiSelectOption[];\n private _cursorIndex = 0;\n private _checked: Set<number> = new Set();\n private _activeColor: Style['fg'];\n private _checkChar: string;\n private _uncheckChar: string;\n private _onSubmit?: (selected: MultiSelectOption[]) => void;\n focusable = true;\n\n constructor(options: MultiSelectOption[], config: MultiSelectOptions = {}) {\n super(mergeStyles(defaultStyle(), { height: Math.max(options.length, 1) }));\n this._options = options;\n this._activeColor = config.activeColor ?? { type: 'named', name: 'cyan' };\n this._checkChar = config.checkChar ?? '◼';\n this._uncheckChar = config.uncheckChar ?? '◻';\n this._onSubmit = config.onSubmit;\n }\n\n get selectedOptions(): MultiSelectOption[] {\n return [...this._checked].sort().map(i => this._options[i]);\n }\n selectNext(): void { let n = this._cursorIndex + 1; while (n < this._options.length && this._options[n].disabled) n++; if (n < this._options.length) { this._cursorIndex = n; this.markDirty(); } }\n selectPrev(): void { let n = this._cursorIndex - 1; while (n >= 0 && this._options[n].disabled) n--; if (n >= 0) { this._cursorIndex = n; this.markDirty(); } }\n toggleCurrent(): void {\n const o = this._options[this._cursorIndex];\n if (o && !o.disabled) { this._checked.has(this._cursorIndex) ? this._checked.delete(this._cursorIndex) : this._checked.add(this._cursorIndex); this.markDirty(); }\n }\n submit(): void { this._onSubmit?.(this.selectedOptions); }\n\n protected _renderSelf(screen: Screen): void {\n const { x, y, width, height } = this._rect;\n if (width <= 0 || height <= 0) return;\n const attrs = styleToCellAttrs(this.style);\n for (let i = 0; i < this._options.length && i < height; i++) {\n const o = this._options[i];\n const active = i === this._cursorIndex;\n const checked = this._checked.has(i);\n const label = `${active ? '❯ ' : ' '}${checked ? this._checkChar : this._uncheckChar} ${o.label}`;\n screen.writeString(x, y + i, label.slice(0, width), {\n ...attrs,\n fg: o.disabled ? { type: 'named' as const, name: 'brightBlack' as const } : active ? this._activeColor : attrs.fg,\n bold: active, dim: o.disabled,\n });\n }\n }\n}\n","// Tree — expandable/collapsible tree view\nimport { Widget } from '@termuijs/widgets';\nimport { type Style, type Screen, mergeStyles, defaultStyle, styleToCellAttrs } from '@termuijs/core';\n\nexport interface TreeNode { label: string; children?: TreeNode[]; expanded?: boolean; icon?: string; }\nexport interface TreeOptions { activeColor?: Style['fg']; onSelect?: (node: TreeNode, path: number[]) => void; }\n\nexport class Tree extends Widget {\n private _roots: TreeNode[];\n private _cursorIndex = 0;\n private _activeColor: Style['fg'];\n private _onSelect?: (node: TreeNode, path: number[]) => void;\n focusable = true;\n\n constructor(roots: TreeNode[], options: TreeOptions = {}) {\n super(mergeStyles(defaultStyle(), { flexGrow: 1 }));\n this._roots = roots;\n this._activeColor = options.activeColor ?? { type: 'named', name: 'cyan' };\n this._onSelect = options.onSelect;\n }\n\n private _flatten(): { node: TreeNode; depth: number; path: number[]; hasChildren: boolean }[] {\n const result: { node: TreeNode; depth: number; path: number[]; hasChildren: boolean }[] = [];\n const walk = (nodes: TreeNode[], depth: number, path: number[]) => {\n for (let i = 0; i < nodes.length; i++) {\n const node = nodes[i];\n const hasChildren = (node.children?.length ?? 0) > 0;\n result.push({ node, depth, path: [...path, i], hasChildren });\n if (hasChildren && node.expanded) walk(node.children!, depth + 1, [...path, i]);\n }\n };\n walk(this._roots, 0, []);\n return result;\n }\n\n selectNext(): void { const f = this._flatten(); if (this._cursorIndex < f.length - 1) { this._cursorIndex++; this.markDirty(); } }\n selectPrev(): void { if (this._cursorIndex > 0) { this._cursorIndex--; this.markDirty(); } }\n toggleExpand(): void { const f = this._flatten(); const it = f[this._cursorIndex]; if (it?.hasChildren) { it.node.expanded = !it.node.expanded; this.markDirty(); } }\n confirm(): void {\n const f = this._flatten(); const it = f[this._cursorIndex];\n if (it) { it.hasChildren ? this.toggleExpand() : this._onSelect?.(it.node, it.path); }\n }\n\n protected _renderSelf(screen: Screen): void {\n const { x, y, width, height } = this._rect;\n if (width <= 0 || height <= 0) return;\n const attrs = styleToCellAttrs(this.style);\n const flat = this._flatten();\n for (let i = 0; i < flat.length && i < height; i++) {\n const it = flat[i];\n const active = i === this._cursorIndex;\n const indent = ' '.repeat(it.depth);\n const icon = it.hasChildren ? (it.node.expanded ? '▼ ' : '▶ ') : ' ';\n const nodeIcon = it.node.icon ? `${it.node.icon} ` : '';\n const line = `${indent}${icon}${nodeIcon}${it.node.label}`;\n screen.writeString(x, y + i, line.slice(0, width), { ...attrs, fg: active ? this._activeColor : attrs.fg, bold: active });\n }\n }\n}\n","// Toast — auto-dismiss notification\nimport { Widget } from '@termuijs/widgets';\nimport { type Screen, mergeStyles, defaultStyle, styleToCellAttrs } from '@termuijs/core';\n\nexport type ToastType = 'info' | 'success' | 'warning' | 'error';\nexport interface ToastMessage { text: string; type: ToastType; expireAt: number; }\nexport interface ToastOptions { position?: 'top-right' | 'bottom-right' | 'top-left' | 'bottom-left'; durationMs?: number; maxVisible?: number; }\n\nconst ICONS: Record<ToastType, string> = { info: 'ℹ', success: '✓', warning: '⚠', error: '✗' };\nconst COLORS: Record<ToastType, string> = { info: 'cyan', success: 'green', warning: 'yellow', error: 'red' };\n\nexport class Toast extends Widget {\n private _messages: ToastMessage[] = [];\n private _position: string;\n private _durationMs: number;\n private _maxVisible: number;\n\n constructor(options: ToastOptions = {}) {\n super(mergeStyles(defaultStyle(), {}));\n this._position = options.position ?? 'top-right';\n this._durationMs = options.durationMs ?? 3000;\n this._maxVisible = options.maxVisible ?? 5;\n }\n\n push(text: string, type: ToastType = 'info'): void { this._messages.push({ text, type, expireAt: Date.now() + this._durationMs }); this.markDirty(); }\n info(text: string): void { this.push(text, 'info'); }\n success(text: string): void { this.push(text, 'success'); }\n warning(text: string): void { this.push(text, 'warning'); }\n error(text: string): void { this.push(text, 'error'); }\n\n protected _renderSelf(screen: Screen): void {\n const now = Date.now();\n this._messages = this._messages.filter(m => m.expireAt > now);\n if (this._messages.length === 0) return;\n const { x, y, width, height } = this._rect;\n const visible = this._messages.slice(-this._maxVisible);\n const tw = Math.min(40, width - 2);\n const isRight = this._position.includes('right');\n const isBottom = this._position.includes('bottom');\n const sx = isRight ? x + width - tw - 1 : x + 1;\n const sy = isBottom ? y + height - visible.length - 1 : y + 1;\n const attrs = styleToCellAttrs(this.style);\n for (let i = 0; i < visible.length; i++) {\n const m = visible[i];\n const label = ` ${ICONS[m.type]} ${m.text} `.slice(0, tw).padEnd(tw);\n screen.writeString(sx, sy + i, label, { ...attrs, fg: { type: 'named', name: COLORS[m.type] as any }, bold: true });\n }\n }\n}\n","// ConfirmDialog — yes/no prompt overlay\nimport { Widget } from '@termuijs/widgets';\nimport { type Style, type Screen, mergeStyles, defaultStyle, styleToCellAttrs, getBorderChars } from '@termuijs/core';\n\nexport interface ConfirmDialogOptions {\n message: string;\n confirmLabel?: string;\n cancelLabel?: string;\n borderColor?: Style['fg'];\n onConfirm?: () => void;\n onCancel?: () => void;\n}\n\nexport class ConfirmDialog extends Widget {\n private _message: string;\n private _confirmLabel: string;\n private _cancelLabel: string;\n private _borderColor: Style['fg'];\n private _selected: 'confirm' | 'cancel' = 'confirm';\n private _visible = false;\n private _onConfirm?: () => void;\n private _onCancel?: () => void;\n focusable = true;\n\n constructor(options: ConfirmDialogOptions) {\n super(mergeStyles(defaultStyle(), {}));\n this._message = options.message;\n this._confirmLabel = options.confirmLabel ?? 'Yes';\n this._cancelLabel = options.cancelLabel ?? 'No';\n this._borderColor = options.borderColor ?? { type: 'named', name: 'yellow' };\n this._onConfirm = options.onConfirm;\n this._onCancel = options.onCancel;\n }\n\n get visible(): boolean { return this._visible; }\n show(): void { this._visible = true; this._selected = 'confirm'; this.markDirty(); }\n hide(): void { this._visible = false; this.markDirty(); }\n selectConfirm(): void { this._selected = 'confirm'; this.markDirty(); }\n selectCancel(): void { this._selected = 'cancel'; this.markDirty(); }\n toggleSelection(): void { this._selected = this._selected === 'confirm' ? 'cancel' : 'confirm'; this.markDirty(); }\n confirm(): void {\n (this._selected === 'confirm' ? this._onConfirm : this._onCancel)?.();\n this._visible = false;\n this.markDirty();\n }\n\n protected _renderSelf(screen: Screen): void {\n if (!this._visible) return;\n const { x, y, width, height } = this._rect;\n const attrs = styleToCellAttrs(this.style);\n for (let r = 0; r < height; r++) screen.writeString(x, y + r, '░'.repeat(width), { ...attrs, dim: true });\n const bw = Math.min(40, width - 4);\n const bh = 5;\n const bx = x + Math.floor((width - bw) / 2);\n const by = y + Math.floor((height - bh) / 2);\n const border = getBorderChars('single');\n if (!border) return;\n const ba = { ...attrs, fg: this._borderColor };\n screen.writeString(bx, by, border.topLeft + border.top.repeat(bw - 2) + border.topRight, ba);\n for (let r = 1; r < bh - 1; r++) {\n screen.writeString(bx, by + r, border.left, ba);\n screen.writeString(bx + 1, by + r, ' '.repeat(bw - 2), attrs);\n screen.writeString(bx + bw - 1, by + r, border.right, ba);\n }\n screen.writeString(bx, by + bh - 1, border.bottomLeft + border.bottom.repeat(bw - 2) + border.bottomRight, ba);\n screen.writeString(bx + 2, by + 1, this._message.slice(0, bw - 4), { ...attrs, bold: true });\n const yesStr = this._selected === 'confirm' ? ` [${this._confirmLabel}] ` : ` ${this._confirmLabel} `;\n const noStr = this._selected === 'cancel' ? ` [${this._cancelLabel}] ` : ` ${this._cancelLabel} `;\n screen.writeString(bx + 2, by + 3, yesStr, { ...attrs, fg: this._selected === 'confirm' ? { type: 'named', name: 'green' } : attrs.fg, bold: this._selected === 'confirm' });\n screen.writeString(bx + 2 + yesStr.length + 2, by + 3, noStr, { ...attrs, fg: this._selected === 'cancel' ? { type: 'named', name: 'red' } : attrs.fg, bold: this._selected === 'cancel' });\n }\n}\n","// Form — compound input container with validation\nimport { Widget } from '@termuijs/widgets';\nimport { type Style, type Screen, mergeStyles, defaultStyle, styleToCellAttrs } from '@termuijs/core';\n\nexport interface FormField {\n name: string; label: string; type: 'text' | 'select' | 'checkbox';\n placeholder?: string; required?: boolean; options?: string[];\n validate?: (value: string) => string | null;\n}\nexport interface FormOptions {\n labelColor?: Style['fg']; errorColor?: Style['fg']; activeColor?: Style['fg'];\n onSubmit?: (values: Record<string, string>) => void;\n}\n\nexport class Form extends Widget {\n private _fields: FormField[];\n private _values: Map<string, string> = new Map();\n private _errors: Map<string, string> = new Map();\n private _activeField = 0;\n private _cursorPos = 0;\n private _labelColor: Style['fg'];\n private _errorColor: Style['fg'];\n private _activeColor: Style['fg'];\n private _onSubmit?: (values: Record<string, string>) => void;\n focusable = true;\n\n constructor(fields: FormField[], options: FormOptions = {}) {\n super(mergeStyles(defaultStyle(), { height: fields.length * 2 + 1, flexGrow: 1 }));\n this._fields = fields;\n this._labelColor = options.labelColor ?? { type: 'named', name: 'cyan' };\n this._errorColor = options.errorColor ?? { type: 'named', name: 'red' };\n this._activeColor = options.activeColor ?? { type: 'named', name: 'cyan' };\n this._onSubmit = options.onSubmit;\n for (const f of fields) this._values.set(f.name, '');\n }\n\n get values(): Record<string, string> { const r: Record<string, string> = {}; for (const [k, v] of this._values) r[k] = v; return r; }\n nextField(): void { if (this._activeField < this._fields.length) { this._activeField++; this._cursorPos = 0; this.markDirty(); } }\n prevField(): void { if (this._activeField > 0) { this._activeField--; this._cursorPos = (this._values.get(this._fields[this._activeField].name) ?? '').length; this.markDirty(); } }\n insertChar(ch: string): void {\n if (this._activeField >= this._fields.length) return;\n const f = this._fields[this._activeField]; const cur = this._values.get(f.name) ?? '';\n this._values.set(f.name, cur.slice(0, this._cursorPos) + ch + cur.slice(this._cursorPos));\n this._cursorPos++; this._errors.delete(f.name); this.markDirty();\n }\n deleteBack(): void {\n if (this._activeField >= this._fields.length) return;\n const f = this._fields[this._activeField]; const cur = this._values.get(f.name) ?? '';\n if (this._cursorPos > 0) { this._values.set(f.name, cur.slice(0, this._cursorPos - 1) + cur.slice(this._cursorPos)); this._cursorPos--; this.markDirty(); }\n }\n submit(): void {\n this._errors.clear(); let hasErr = false;\n for (const f of this._fields) {\n const v = this._values.get(f.name) ?? '';\n if (f.required && !v.trim()) { this._errors.set(f.name, `${f.label} is required`); hasErr = true; }\n if (f.validate) { const e = f.validate(v); if (e) { this._errors.set(f.name, e); hasErr = true; } }\n }\n if (!hasErr) this._onSubmit?.(this.values);\n this.markDirty();\n }\n\n protected _renderSelf(screen: Screen): void {\n const { x, y, width, height } = this._rect;\n if (width <= 0 || height <= 0) return;\n const attrs = styleToCellAttrs(this.style);\n let row = 0;\n for (let i = 0; i < this._fields.length && row < height - 1; i++) {\n const f = this._fields[i]; const active = i === this._activeField;\n const val = this._values.get(f.name) ?? ''; const err = this._errors.get(f.name);\n screen.writeString(x, y + row, `${f.label}${f.required ? ' *' : ''}:`.slice(0, width), { ...attrs, fg: err ? this._errorColor : this._labelColor, bold: active }); row++;\n if (row >= height) break;\n const display = val || (f.placeholder ?? '');\n screen.writeString(x, y + row, `${active ? '❯ ' : ' '}${display}`.slice(0, width), { ...attrs, fg: active ? this._activeColor : attrs.fg, dim: !val && !!f.placeholder }); row++;\n }\n if (row < height) {\n const isSub = this._activeField >= this._fields.length;\n screen.writeString(x, y + row, isSub ? ' [ Submit ]' : ' Submit ', { ...attrs, fg: isSub ? { type: 'named', name: 'green' } : attrs.fg, bold: isSub });\n }\n }\n}\n","// CommandPalette — fuzzy-search command launcher\nimport { Widget } from '@termuijs/widgets';\nimport { type Style, type Screen, mergeStyles, defaultStyle, styleToCellAttrs, getBorderChars } from '@termuijs/core';\n\nexport interface Command { id: string; label: string; shortcut?: string; action: () => void; category?: string; }\nexport interface CommandPaletteOptions { placeholder?: string; borderColor?: Style['fg']; activeColor?: Style['fg']; maxVisible?: number; }\n\nexport class CommandPalette extends Widget {\n private _commands: Command[];\n private _filtered: Command[] = [];\n private _query = '';\n private _cursorPos = 0;\n private _selectedIndex = 0;\n private _visible = false;\n private _placeholder: string;\n private _borderColor: Style['fg'];\n private _activeColor: Style['fg'];\n private _maxVisible: number;\n focusable = true;\n\n constructor(commands: Command[], options: CommandPaletteOptions = {}) {\n super(mergeStyles(defaultStyle(), {}));\n this._commands = commands;\n this._filtered = [...commands];\n this._placeholder = options.placeholder ?? 'Type a command...';\n this._borderColor = options.borderColor ?? { type: 'named', name: 'cyan' };\n this._activeColor = options.activeColor ?? { type: 'named', name: 'cyan' };\n this._maxVisible = options.maxVisible ?? 10;\n }\n\n get visible(): boolean { return this._visible; }\n show(): void { this._visible = true; this._query = ''; this._cursorPos = 0; this._selectedIndex = 0; this._filtered = [...this._commands]; this.markDirty(); }\n hide(): void { this._visible = false; this.markDirty(); }\n toggle(): void { this._visible ? this.hide() : this.show(); }\n insertChar(ch: string): void { this._query = this._query.slice(0, this._cursorPos) + ch + this._query.slice(this._cursorPos); this._cursorPos++; this._filter(); this.markDirty(); }\n deleteBack(): void { if (this._cursorPos > 0) { this._query = this._query.slice(0, this._cursorPos - 1) + this._query.slice(this._cursorPos); this._cursorPos--; this._filter(); this.markDirty(); } }\n selectNext(): void { if (this._selectedIndex < this._filtered.length - 1) { this._selectedIndex++; this.markDirty(); } }\n selectPrev(): void { if (this._selectedIndex > 0) { this._selectedIndex--; this.markDirty(); } }\n confirm(): void { const c = this._filtered[this._selectedIndex]; if (c) { this.hide(); c.action(); } }\n\n private _filter(): void {\n const q = this._query.toLowerCase();\n if (!q) { this._filtered = [...this._commands]; } else {\n this._filtered = this._commands.filter(c => { const l = c.label.toLowerCase(); let qi = 0; for (let i = 0; i < l.length && qi < q.length; i++) { if (l[i] === q[qi]) qi++; } return qi === q.length; });\n }\n this._selectedIndex = 0;\n }\n\n protected _renderSelf(screen: Screen): void {\n if (!this._visible) return;\n const { x, y, width, height } = this._rect;\n const attrs = styleToCellAttrs(this.style);\n // Backdrop\n for (let r = 0; r < height; r++) screen.writeString(x, y + r, '░'.repeat(width), { ...attrs, dim: true });\n // Box\n const vis = this._filtered.slice(0, this._maxVisible);\n const bw = Math.min(60, width - 4);\n const bh = Math.min(vis.length + 3, height - 2);\n const bx = x + Math.floor((width - bw) / 2);\n const by = y + 2;\n const border = getBorderChars('single');\n if (!border) return;\n const ba = { ...attrs, fg: this._borderColor };\n // Top\n screen.writeString(bx, by, border.topLeft + border.top.repeat(bw - 2) + border.topRight, ba);\n // Input row\n screen.writeString(bx, by + 1, border.left, ba);\n const input = this._query || this._placeholder;\n screen.writeString(bx + 1, by + 1, (' 🔍 ' + input).slice(0, bw - 2).padEnd(bw - 2), { ...attrs, dim: !this._query });\n screen.writeString(bx + bw - 1, by + 1, border.right, ba);\n // Separator\n screen.writeString(bx, by + 2, border.left + '─'.repeat(bw - 2) + border.right, ba);\n // Items\n for (let i = 0; i < vis.length && i + 3 < bh - 1; i++) {\n const c = vis[i]; const active = i === this._selectedIndex;\n const label = (active ? '❯ ' : ' ') + c.label;\n const sc = c.shortcut ?? '';\n screen.writeString(bx, by + 3 + i, border.left, ba);\n screen.writeString(bx + 1, by + 3 + i, (' ' + label).slice(0, bw - sc.length - 3).padEnd(bw - sc.length - 3), { ...attrs, fg: active ? this._activeColor : attrs.fg, bold: active });\n if (sc) screen.writeString(bx + bw - sc.length - 2, by + 3 + i, sc, { ...attrs, dim: true });\n screen.writeString(bx + bw - 1, by + 3 + i, border.right, ba);\n }\n // Bottom\n const last = Math.min(by + 3 + vis.length, by + bh - 1);\n screen.writeString(bx, last, border.bottomLeft + border.bottom.repeat(bw - 2) + border.bottomRight, ba);\n }\n}\n"],"mappings":";AAQA;AAAA,EACI;AAAA,EACA;AAAA,EACA;AAA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KAAK,GAAG,KAAK,IAAI,GAAG,OAAO,OAAO,EAAE;AAAA,IAChE;AAEA,UAAM,OAAO,KAAK,IAAI,KAAK,IAAI,IAAI,QAAQ,KAAK,KAAK,CAAC;AACtD,WAAO,YAAY,IAAI,MAAM,OAAO,aAAa,OAAO,OAAO,OAAO,KAAK,CAAC,IAAI,OAAO,aAAa,EAAE;AAAA,EAC1G;AACJ;","names":["Widget","Widget","mergeStyles","defaultStyle","Widget","mergeStyles","defaultStyle","styleToCellAttrs","Widget","mergeStyles","defaultStyle","styleToCellAttrs","Widget","mergeStyles","defaultStyle","styleToCellAttrs","Widget","mergeStyles","defaultStyle","styleToCellAttrs","Widget","mergeStyles","defaultStyle","styleToCellAttrs","Widget","mergeStyles","defaultStyle","styleToCellAttrs","Widget","mergeStyles","defaultStyle","styleToCellAttrs","getBorderChars","Widget","mergeStyles","defaultStyle","styleToCellAttrs","Widget","mergeStyles","defaultStyle","styleToCellAttrs","getBorderChars"]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@termuijs/ui",
|
|
3
|
-
"
|
|
4
|
-
"
|
|
3
|
+
"homepage": "https://www.termui.io/docs/ui/overview",
|
|
4
|
+
"repository": {
|
|
5
|
+
"type": "git",
|
|
6
|
+
"url": "https://github.com/Karanjot786/TermUI"
|
|
7
|
+
},
|
|
8
|
+
"version": "0.1.3",
|
|
9
|
+
"description": "Modal, Select, Tabs, Toast, Form, Tree, and CommandPalette for TermUI",
|
|
5
10
|
"type": "module",
|
|
6
11
|
"main": "./dist/index.cjs",
|
|
7
12
|
"module": "./dist/index.js",
|
|
@@ -20,8 +25,8 @@
|
|
|
20
25
|
"access": "public"
|
|
21
26
|
},
|
|
22
27
|
"dependencies": {
|
|
23
|
-
"@termuijs/
|
|
24
|
-
"@termuijs/
|
|
28
|
+
"@termuijs/core": "0.1.3",
|
|
29
|
+
"@termuijs/widgets": "0.1.3"
|
|
25
30
|
},
|
|
26
31
|
"devDependencies": {
|
|
27
32
|
"tsup": "^8.0.0",
|