@sigx/terminal 0.2.2 → 0.2.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/README.md +61 -0
- package/package.json +5 -5
package/README.md
ADDED
|
@@ -0,0 +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)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sigx/terminal",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3",
|
|
4
4
|
"description": "SignalX Terminal - TUI framework with TSX support",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -43,14 +43,14 @@
|
|
|
43
43
|
"url": "https://github.com/signalxjs/core/issues"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@sigx/
|
|
47
|
-
"@sigx/runtime-
|
|
48
|
-
"@sigx/
|
|
46
|
+
"@sigx/runtime-core": "^0.2.3",
|
|
47
|
+
"@sigx/runtime-terminal": "^0.2.3",
|
|
48
|
+
"@sigx/reactivity": "^0.2.3"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"typescript": "^5.9.3",
|
|
52
52
|
"vite": "^8.0.3",
|
|
53
|
-
"@sigx/vite": "^0.2.
|
|
53
|
+
"@sigx/vite": "^0.2.3"
|
|
54
54
|
},
|
|
55
55
|
"scripts": {
|
|
56
56
|
"build": "vite build && tsgo --emitDeclarationOnly",
|