@sigx/terminal 0.3.2 → 0.4.1

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 CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2025 Andreas Ekdahl
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.
1
+ MIT License
2
+
3
+ Copyright (c) 2025-2026 Andreas Ekdahl
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,61 +1,61 @@
1
- # @sigx/terminal
2
-
3
- SignalX Terminal — a TUI framework with TSX support. Build interactive terminal applications using the same component model and reactive signals as SignalX.
4
-
5
- ## Install
6
-
7
- ```bash
8
- npm install @sigx/terminal
9
- ```
10
-
11
- ## Usage
12
-
13
- ```tsx
14
- /** @jsxImportSource @sigx/terminal */
15
- import { component, signal, defineApp, Input, Button } from '@sigx/terminal';
16
-
17
- const App = component(() => {
18
- const name = signal('');
19
-
20
- return () => (
21
- <box border="single" borderColor="cyan" label="Greeting">
22
- <Input model={() => name} label="Name" autofocus />
23
- <br />
24
- <text color="green">Hello, {name.value || 'world'}!</text>
25
- <br />
26
- <Button label="Exit" onClick={() => process.exit(0)} />
27
- </box>
28
- );
29
- });
30
-
31
- defineApp(<App />).mount({ clearConsole: true });
32
- ```
33
-
34
- ## Built-in Elements
35
-
36
- - `<box>` — Container with optional borders (`single`, `double`, `rounded`), colors, shadows, and labels
37
- - `<text>` — Text with ANSI color support
38
- - `<br>` — Line break
39
-
40
- ## Components
41
-
42
- | Component | Description |
43
- |---|---|
44
- | `Input` | Text input with model binding |
45
- | `Button` | Clickable button |
46
- | `Select` | Option list with keyboard navigation |
47
- | `Checkbox` | Toggle checkbox |
48
- | `ProgressBar` | Visual progress indicator |
49
-
50
- ## Utilities
51
-
52
- - `onKey(handler)` — Subscribe to keyboard events
53
- - `focusNext()` / `focusPrev()` — Programmatic focus management
54
-
55
- ## Documentation
56
-
57
- Full documentation and guides are available at the [SignalX repository](https://github.com/signalxjs/core).
58
-
59
- ## License
60
-
61
- [MIT](https://github.com/signalxjs/core/blob/main/LICENSE)
1
+ # @sigx/terminal
2
+
3
+ SignalX Terminal — a TUI framework with TSX support. Build interactive terminal applications using the same component model and reactive signals as SignalX.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm install @sigx/terminal
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```tsx
14
+ /** @jsxImportSource @sigx/terminal */
15
+ import { component, signal, defineApp, Input, Button } from '@sigx/terminal';
16
+
17
+ const App = component(() => {
18
+ const name = signal('');
19
+
20
+ return () => (
21
+ <box border="single" borderColor="cyan" label="Greeting">
22
+ <Input model={() => name} label="Name" autofocus />
23
+ <br />
24
+ <text color="green">Hello, {name.value || 'world'}!</text>
25
+ <br />
26
+ <Button label="Exit" onClick={() => process.exit(0)} />
27
+ </box>
28
+ );
29
+ });
30
+
31
+ defineApp(<App />).mount({ clearConsole: true });
32
+ ```
33
+
34
+ ## Built-in Elements
35
+
36
+ - `<box>` — Container with optional borders (`single`, `double`, `rounded`), colors, shadows, and labels
37
+ - `<text>` — Text with ANSI color support
38
+ - `<br>` — Line break
39
+
40
+ ## Components
41
+
42
+ | Component | Description |
43
+ |---|---|
44
+ | `Input` | Text input with model binding |
45
+ | `Button` | Clickable button |
46
+ | `Select` | Option list with keyboard navigation |
47
+ | `Checkbox` | Toggle checkbox |
48
+ | `ProgressBar` | Visual progress indicator |
49
+
50
+ ## Utilities
51
+
52
+ - `onKey(handler)` — Subscribe to keyboard events
53
+ - `focusNext()` / `focusPrev()` — Programmatic focus management
54
+
55
+ ## Documentation
56
+
57
+ Full documentation and guides are available at the [SignalX repository](https://github.com/signalxjs/core).
58
+
59
+ ## License
60
+
61
+ [MIT](https://github.com/signalxjs/core/blob/main/LICENSE)