@sigx/runtime-terminal 0.1.5 → 0.1.6

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 CHANGED
@@ -5,13 +5,13 @@ Terminal UI components for the Sigx runtime (demo/experimental).
5
5
  ## Components
6
6
 
7
7
  - `Button` - a focusable, clickable control.
8
- - `Input` - a focusable text input with two-way `sync` binding via `value`.
8
+ - `Input` - a focusable text input with two-way `model` binding.
9
9
  - `ProgressBar` - a read-only progress indicator.
10
- - `Checkbox` - a focusable checkbox with two-way `sync` binding via `value`.
10
+ - `Checkbox` - a focusable checkbox with two-way `model` binding.
11
11
 
12
12
  ## `Checkbox` Usage
13
13
 
14
- The `Checkbox` component uses two-way `sync` binding. That means you can write:
14
+ The `Checkbox` component uses two-way `model` binding. That means you can write:
15
15
 
16
16
  ```tsx
17
17
  /** @jsxImportSource @sigx/terminal */
@@ -20,21 +20,21 @@ import { signal, renderTerminal, Checkbox } from '@sigx/terminal';
20
20
  const state = signal({ enabled: true });
21
21
 
22
22
  renderTerminal(
23
- <Checkbox sync={() => state.enabled} label="Enabled" />,
23
+ <Checkbox model={() => state.enabled} label="Enabled" />,
24
24
  { clearConsole: true }
25
25
  );
26
26
  ```
27
27
 
28
- When the user presses Space or Enter while the `Checkbox` is focused, it will emit `update:value` and `change` events in addition to toggling the visual state.
28
+ When the user presses Space or Enter while the `Checkbox` is focused, it will emit `update:modelValue` and `change` events in addition to toggling the visual state.
29
29
 
30
30
  Props:
31
31
 
32
- - `value` (sync) - boolean - current value (two-way binding via `sync`).
32
+ - `modelValue` (model) - boolean - current value (two-way binding via `model`).
33
33
  - `label` - string - optional label to display.
34
34
  - `autofocus` - boolean - focus on mount.
35
35
  - `disabled` - boolean - disable interaction.
36
36
 
37
37
  Events:
38
38
 
39
- - `update:value` - emitted when the value changes (used by `sync`).
39
+ - `update:modelValue` - emitted when the value changes (used by `model`).
40
40
  - `change` - emitted with the new value when toggled.
@@ -1,8 +1,11 @@
1
1
  /** @jsxImportSource @sigx/runtime-core */
2
2
  import { type DefineEvent } from '@sigx/runtime-core';
3
3
  export declare const Checkbox: import("@sigx/runtime-core").ComponentFactory<{
4
- value?: boolean | undefined;
5
- } & DefineEvent<"update:value", boolean> & {
4
+ model?: import("@sigx/runtime-core").Model<boolean> | undefined;
5
+ __modelBindings?: {
6
+ model: boolean;
7
+ } | undefined;
8
+ } & DefineEvent<"update:modelValue", boolean> & {
6
9
  label?: string | undefined;
7
10
  } & {
8
11
  autofocus?: boolean | undefined;
@@ -1,8 +1,11 @@
1
1
  /** @jsxImportSource @sigx/runtime-core */
2
2
  import { type DefineEvent } from '@sigx/runtime-core';
3
3
  export declare const Input: import("@sigx/runtime-core").ComponentFactory<{
4
- value?: string | undefined;
5
- } & DefineEvent<"update:value", string> & {
4
+ model?: import("@sigx/runtime-core").Model<string> | undefined;
5
+ __modelBindings?: {
6
+ model: string;
7
+ } | undefined;
8
+ } & DefineEvent<"update:modelValue", string> & {
6
9
  placeholder?: string | undefined;
7
10
  } & {
8
11
  autofocus?: boolean | undefined;
@@ -6,12 +6,17 @@ export interface SelectOption<T = string> {
6
6
  description?: string;
7
7
  }
8
8
  export declare const Select: import("@sigx/runtime-core").ComponentFactory<{
9
- value?: string | undefined;
10
- } & DefineEvent<"update:value", string> & {
9
+ model?: import("@sigx/runtime-core").Model<string> | undefined;
10
+ __modelBindings?: {
11
+ model: string;
12
+ } | undefined;
13
+ } & DefineEvent<"update:modelValue", string> & {
11
14
  options: SelectOption<string>[];
12
15
  } & {
13
16
  label?: string | undefined;
14
17
  } & {
15
18
  autofocus?: boolean | undefined;
19
+ } & {
20
+ showDescription?: boolean | undefined;
16
21
  } & DefineEvent<"change", string> & DefineEvent<"submit", string>, void, {}>;
17
22
  export default Select;
package/dist/index.d.ts CHANGED
@@ -13,9 +13,7 @@ export interface TerminalNode {
13
13
  children: TerminalNode[];
14
14
  parentNode?: TerminalNode | null;
15
15
  }
16
- export declare const render: import("@sigx/runtime-core").RootRenderFunction<TerminalNode, TerminalNode>, createApp: (rootComponent: any) => {
17
- mount: (selectorOrContainer: string | TerminalNode) => void;
18
- };
16
+ export declare const render: import("@sigx/runtime-core").RootRenderFunction<TerminalNode, TerminalNode>;
19
17
  export declare function renderNodeToLines(node: TerminalNode): string[];
20
18
  type KeyHandler = (key: string) => void;
21
19
  export declare function onKey(handler: KeyHandler): () => boolean;