@sigx/terminal-ui 0.5.0
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/dist/Spinner-JpmBtbPo.js +25 -0
- package/dist/Spinner-JpmBtbPo.js.map +1 -0
- package/dist/buttons/Button.d.ts +8 -0
- package/dist/buttons/index.d.ts +1 -0
- package/dist/buttons/index.js +2 -0
- package/dist/buttons-D5iaiJ6G.js +38 -0
- package/dist/buttons-D5iaiJ6G.js.map +1 -0
- package/dist/data/QRCode.d.ts +17 -0
- package/dist/data/Table.d.ts +11 -0
- package/dist/data/index.d.ts +2 -0
- package/dist/data/index.js +2 -0
- package/dist/data-DKKLsE5K.js +43 -0
- package/dist/data-DKKLsE5K.js.map +1 -0
- package/dist/feedback/Badge.d.ts +14 -0
- package/dist/feedback/ProgressBar.d.ts +31 -0
- package/dist/feedback/Spinner.d.ts +21 -0
- package/dist/feedback/index.d.ts +3 -0
- package/dist/feedback/index.js +3 -0
- package/dist/feedback-1WqdARfx.js +62 -0
- package/dist/feedback-1WqdARfx.js.map +1 -0
- package/dist/forms/Checkbox.d.ts +15 -0
- package/dist/forms/Confirm.d.ts +21 -0
- package/dist/forms/Input.d.ts +15 -0
- package/dist/forms/MultiSelect.d.ts +36 -0
- package/dist/forms/Radio.d.ts +23 -0
- package/dist/forms/Select.d.ts +22 -0
- package/dist/forms/TextArea.d.ts +37 -0
- package/dist/forms/index.d.ts +7 -0
- package/dist/forms/index.js +2 -0
- package/dist/forms-MgpyoQI5.js +399 -0
- package/dist/forms-MgpyoQI5.js.map +1 -0
- package/dist/fx/Banner.d.ts +19 -0
- package/dist/fx/Gradient.d.ts +18 -0
- package/dist/fx/PixelArt.d.ts +16 -0
- package/dist/fx/Shimmer.d.ts +18 -0
- package/dist/fx/blockFont.d.ts +13 -0
- package/dist/fx/index.d.ts +6 -0
- package/dist/fx/index.js +3 -0
- package/dist/fx/paint.d.ts +15 -0
- package/dist/fx/presets.d.ts +14 -0
- package/dist/fx-igWaVCkB.js +452 -0
- package/dist/fx-igWaVCkB.js.map +1 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.js +13 -0
- package/dist/layout/Card.d.ts +11 -0
- package/dist/layout/index.d.ts +2 -0
- package/dist/layout/index.js +2 -0
- package/dist/layout-CJzMVMDf.js +18 -0
- package/dist/layout-CJzMVMDf.js.map +1 -0
- package/dist/navigation/KeyHints.d.ts +15 -0
- package/dist/navigation/StatusBar.d.ts +9 -0
- package/dist/navigation/SuggestionList.d.ts +22 -0
- package/dist/navigation/Tabs.d.ts +18 -0
- package/dist/navigation/index.d.ts +4 -0
- package/dist/navigation/index.js +2 -0
- package/dist/navigation-B-nI3g0k.js +133 -0
- package/dist/navigation-B-nI3g0k.js.map +1 -0
- package/dist/presets-uqseGRqO.js +31 -0
- package/dist/presets-uqseGRqO.js.map +1 -0
- package/dist/prompts/PromptShell.d.ts +11 -0
- package/dist/prompts/confirm.d.ts +14 -0
- package/dist/prompts/index.d.ts +35 -0
- package/dist/prompts/index.js +2 -0
- package/dist/prompts/multiselect.d.ts +14 -0
- package/dist/prompts/select.d.ts +20 -0
- package/dist/prompts/spinner.d.ts +22 -0
- package/dist/prompts/statics.d.ts +8 -0
- package/dist/prompts/text.d.ts +19 -0
- package/dist/prompts-BLtLCen_.js +381 -0
- package/dist/prompts-BLtLCen_.js.map +1 -0
- package/dist/tasks/LogPanel.d.ts +28 -0
- package/dist/tasks/LogView.d.ts +24 -0
- package/dist/tasks/TaskList.d.ts +26 -0
- package/dist/tasks/index.d.ts +4 -0
- package/dist/tasks/index.js +2 -0
- package/dist/tasks/logStore.d.ts +40 -0
- package/dist/tasks-CdVFFOFs.js +254 -0
- package/dist/tasks-CdVFFOFs.js.map +1 -0
- package/dist/theme/builtins.d.ts +7 -0
- package/dist/theme/index.d.ts +3 -0
- package/dist/theme/index.js +2 -0
- package/dist/theme-DASuxf6k.js +150 -0
- package/dist/theme-DASuxf6k.js.map +1 -0
- package/package.json +95 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
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.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { GLYPHS as e, SPINNERS as t, TICK_MS as n, getTick as r, resolveColor as i, subscribeTicker as a } from "@sigx/terminal-zero";
|
|
2
|
+
import { component as o, onMounted as s, onUnmounted as c } from "@sigx/runtime-core";
|
|
3
|
+
import { jsx as l, jsxs as u } from "@sigx/runtime-core/jsx-runtime";
|
|
4
|
+
//#region src/feedback/Spinner.tsx
|
|
5
|
+
var d = o(({ props: o }) => {
|
|
6
|
+
let d = null;
|
|
7
|
+
return s(() => {
|
|
8
|
+
d = a();
|
|
9
|
+
}), c(() => {
|
|
10
|
+
d?.();
|
|
11
|
+
}), () => {
|
|
12
|
+
let a = !!o.done, s = !a && !!o.failed, c = t[o.variant || "dots"] ?? t.dots, d = Math.max(1, Math.round((o.interval || n) / n)), f = a ? e.check : s ? e.cross : c[Math.floor(r() / d) % c.length];
|
|
13
|
+
return /* @__PURE__ */ u("box", { children: [/* @__PURE__ */ l("text", {
|
|
14
|
+
color: i(a ? "success" : s ? "danger" : o.color || "accent"),
|
|
15
|
+
children: f
|
|
16
|
+
}), o.label && /* @__PURE__ */ u("text", {
|
|
17
|
+
color: i(s ? "danger" : "fg"),
|
|
18
|
+
children: [" ", o.label]
|
|
19
|
+
})] });
|
|
20
|
+
};
|
|
21
|
+
}, { name: "Spinner" });
|
|
22
|
+
//#endregion
|
|
23
|
+
export { d as t };
|
|
24
|
+
|
|
25
|
+
//# sourceMappingURL=Spinner-JpmBtbPo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Spinner-JpmBtbPo.js","names":[],"sources":["../src/feedback/Spinner.tsx"],"sourcesContent":["/** @jsxImportSource @sigx/runtime-core */\r\nimport { component, onMounted, onUnmounted, type Define } from '@sigx/runtime-core';\r\nimport { resolveColor, GLYPHS, SPINNERS, getTick, subscribeTicker, TICK_MS, type SpinnerVariant } from '@sigx/terminal-zero';\r\n\r\n/**\r\n * Animated spinner that resolves to a success check when `done` (or a danger\r\n * cross when `failed`; `done` wins). `variant` selects a frame set from\r\n * SPINNERS ('dots' default; note 'moon' glyphs are 2 cells wide). Driven by\r\n * the shared ticker — one interval for every animated component, frozen on\r\n * non-TTY output.\r\n */\r\nexport const Spinner = component<\r\n Define.Prop<\"label\", string, false> &\r\n Define.Prop<\"done\", boolean, false> &\r\n Define.Prop<\"failed\", boolean, false> &\r\n Define.Prop<\"interval\", number, false> &\r\n Define.Prop<\"variant\", SpinnerVariant, false> &\r\n Define.Prop<\"color\", string, false>\r\n>(({ props }) => {\r\n let unsub: (() => void) | null = null;\r\n\r\n onMounted(() => { unsub = subscribeTicker(); });\r\n onUnmounted(() => { unsub?.(); });\r\n\r\n return () => {\r\n const done = !!props.done;\r\n const failed = !done && !!props.failed;\r\n const frames = SPINNERS[props.variant || 'dots'] ?? SPINNERS.dots;\r\n // `interval` is honored in multiples of the shared tick (80ms).\r\n const step = Math.max(1, Math.round((props.interval || TICK_MS) / TICK_MS));\r\n const glyph = done ? GLYPHS.check\r\n : failed ? GLYPHS.cross\r\n : frames[Math.floor(getTick() / step) % frames.length];\r\n const glyphColor = resolveColor(done ? 'success' : failed ? 'danger' : (props.color || 'accent'));\r\n return (\r\n <box>\r\n <text color={glyphColor}>{glyph}</text>\r\n {props.label && <text color={resolveColor(failed ? 'danger' : 'fg')}> {props.label}</text>}\r\n </box>\r\n );\r\n };\r\n}, { name: 'Spinner' });\r\n\r\nexport default Spinner;\r\n"],"mappings":";;;;AAWA,IAAa,IAAU,GAOpB,EAAE,eAAY;CACb,IAAI,IAA6B;CAKjC,OAHA,QAAgB;EAAE,IAAQ,GAAiB;GAAI,EAC/C,QAAkB;EAAE,KAAS;GAAI,QAEpB;EACT,IAAM,IAAO,CAAC,CAAC,EAAM,MACf,IAAS,CAAC,KAAQ,CAAC,CAAC,EAAM,QAC1B,IAAS,EAAS,EAAM,WAAW,WAAW,EAAS,MAEvD,IAAO,KAAK,IAAI,GAAG,KAAK,OAAO,EAAM,YAAY,KAAW,EAAQ,CAAC,EACrE,IAAQ,IAAO,EAAO,QACtB,IAAS,EAAO,QAChB,EAAO,KAAK,MAAM,GAAS,GAAG,EAAK,GAAG,EAAO;EAEnD,OACI,kBAAC,OAAD,EAAA,UAAA,CACI,kBAAC,QAAD;GAAM,OAHK,EAAa,IAAO,YAAY,IAAS,WAAY,EAAM,SAAS,SAGlE;aAAa;GAAa,CAAA,EACtC,EAAM,SAAS,kBAAC,QAAD;GAAM,OAAO,EAAa,IAAS,WAAW,KAAK;aAAnD,CAAqD,KAAE,EAAM,MAAa;KACxF,EAAA,CAAA;;GAGf,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** @jsxImportSource @sigx/runtime-core */
|
|
2
|
+
import { type Define } from '@sigx/runtime-core';
|
|
3
|
+
export declare const Button: import("@sigx/runtime-core").ComponentFactory<{
|
|
4
|
+
label?: string | undefined;
|
|
5
|
+
} & {
|
|
6
|
+
dropShadow?: boolean | undefined;
|
|
7
|
+
} & Define.Event<"click", void>, void, {}>;
|
|
8
|
+
export default Button;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Button } from './Button';
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { GLYPHS as e, PRESS_MS as t, READY_DELAY_MS as n, focusState as r, onKey as i, registerFocusable as a, resolveColor as o, unregisterFocusable as s } from "@sigx/terminal-zero";
|
|
2
|
+
import { component as c, onMounted as l, onUnmounted as u, signal as d } from "@sigx/runtime-core";
|
|
3
|
+
import { jsx as f, jsxs as p } from "@sigx/runtime-core/jsx-runtime";
|
|
4
|
+
//#region src/buttons/Button.tsx
|
|
5
|
+
var m = c(({ props: c, emit: m }) => {
|
|
6
|
+
let h = Math.random().toString(36).slice(2), g = !1, _ = () => r.activeId === h, v = d({ value: !1 }), y = null, b = null, x = (e) => {
|
|
7
|
+
!_() || !g || (e === "\r" || e === "\n" || e === " ") && (v.value = !0, y && clearTimeout(y), y = setTimeout(() => {
|
|
8
|
+
v.value = !1, y = null;
|
|
9
|
+
}, t), m("click"));
|
|
10
|
+
};
|
|
11
|
+
return l(() => {
|
|
12
|
+
a(h), b = i(x), setTimeout(() => {
|
|
13
|
+
g = !0;
|
|
14
|
+
}, n);
|
|
15
|
+
}), u(() => {
|
|
16
|
+
b && b(), s(h), y && clearTimeout(y);
|
|
17
|
+
}), () => {
|
|
18
|
+
let t = _(), n = c.label || "Button", r = v.value, i = o(t ? "accent" : "line"), a = r ? o("accent") : t ? o("accentSoft") : void 0, s = o(r ? "accentText" : t ? "accent" : "fg");
|
|
19
|
+
return /* @__PURE__ */ p("box", {
|
|
20
|
+
border: "rounded",
|
|
21
|
+
borderColor: i,
|
|
22
|
+
backgroundColor: a,
|
|
23
|
+
dropShadow: c.dropShadow,
|
|
24
|
+
shadowColor: o("shadow"),
|
|
25
|
+
children: [t && /* @__PURE__ */ p("text", {
|
|
26
|
+
color: o("accent"),
|
|
27
|
+
children: [e.focusBar, " "]
|
|
28
|
+
}), /* @__PURE__ */ f("text", {
|
|
29
|
+
color: s,
|
|
30
|
+
children: n
|
|
31
|
+
})]
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
}, { name: "Button" });
|
|
35
|
+
//#endregion
|
|
36
|
+
export { m as t };
|
|
37
|
+
|
|
38
|
+
//# sourceMappingURL=buttons-D5iaiJ6G.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buttons-D5iaiJ6G.js","names":[],"sources":["../src/buttons/Button.tsx"],"sourcesContent":["/** @jsxImportSource @sigx/runtime-core */\r\nimport { component, onMounted, onUnmounted, signal, type Define } from '@sigx/runtime-core';\r\nimport {\r\n onKey, registerFocusable, unregisterFocusable, focusState,\r\n resolveColor, GLYPHS, PRESS_MS, READY_DELAY_MS,\r\n} from '@sigx/terminal-zero';\r\n\r\nexport const Button = component<\r\n Define.Prop<\"label\", string, false> &\r\n Define.Prop<\"dropShadow\", boolean, false> &\r\n Define.Event<\"click\">\r\n>(({ props, emit }) => {\r\n const id = Math.random().toString(36).slice(2);\r\n let isReady = false; // Prevent immediate click after mount\r\n const isFocused = () => focusState.activeId === id;\r\n const pressed = signal({ value: false as boolean });\r\n let pressTimer: ReturnType<typeof setTimeout> | null = null;\r\n let keyCleanup: (() => void) | null = null;\r\n\r\n const handleKey = (key: string) => {\r\n if (!isFocused() || !isReady) return;\r\n if (key === '\\r' || key === '\\n' || key === ' ') {\r\n pressed.value = true;\r\n if (pressTimer) clearTimeout(pressTimer);\r\n pressTimer = setTimeout(() => { pressed.value = false; pressTimer = null; }, PRESS_MS);\r\n emit('click');\r\n }\r\n };\r\n\r\n onMounted(() => {\r\n registerFocusable(id);\r\n keyCleanup = onKey(handleKey);\r\n setTimeout(() => { isReady = true; }, READY_DELAY_MS);\r\n });\r\n\r\n onUnmounted(() => {\r\n if (keyCleanup) keyCleanup();\r\n unregisterFocusable(id);\r\n if (pressTimer) clearTimeout(pressTimer);\r\n });\r\n\r\n return () => {\r\n const focused = isFocused();\r\n const label = props.label || 'Button';\r\n const isPressed = pressed.value;\r\n const border = resolveColor(focused ? 'accent' : 'line');\r\n const bg = isPressed ? resolveColor('accent') : (focused ? resolveColor('accentSoft') : undefined);\r\n const textColor = isPressed ? resolveColor('accentText') : resolveColor(focused ? 'accent' : 'fg');\r\n\r\n return (\r\n <box\r\n border=\"rounded\"\r\n borderColor={border}\r\n backgroundColor={bg}\r\n dropShadow={props.dropShadow}\r\n shadowColor={resolveColor('shadow')}\r\n >\r\n {focused && <text color={resolveColor('accent')}>{GLYPHS.focusBar} </text>}\r\n <text color={textColor}>{label}</text>\r\n </box>\r\n );\r\n };\r\n}, { name: 'Button' });\r\n\r\nexport default Button;\r\n"],"mappings":";;;;AAOA,IAAa,IAAS,GAInB,EAAE,UAAO,cAAW;CACnB,IAAM,IAAK,KAAK,QAAQ,CAAC,SAAS,GAAG,CAAC,MAAM,EAAE,EAC1C,IAAU,IACR,UAAkB,EAAW,aAAa,GAC1C,IAAU,EAAO,EAAE,OAAO,IAAkB,CAAC,EAC/C,IAAmD,MACnD,IAAkC,MAEhC,KAAa,MAAgB;EAC3B,CAAC,GAAW,IAAI,CAAC,MACjB,MAAQ,QAAQ,MAAQ,QAAQ,MAAQ,SACxC,EAAQ,QAAQ,IACZ,KAAY,aAAa,EAAW,EACxC,IAAa,iBAAiB;GAAyB,AAAvB,EAAQ,QAAQ,IAAO,IAAa;KAAS,EAAS,EACtF,EAAK,QAAQ;;CAgBrB,OAZA,QAAgB;EAGZ,AAFA,EAAkB,EAAG,EACrB,IAAa,EAAM,EAAU,EAC7B,iBAAiB;GAAE,IAAU;KAAS,EAAe;GACvD,EAEF,QAAkB;EAGd,AAFI,KAAY,GAAY,EAC5B,EAAoB,EAAG,EACnB,KAAY,aAAa,EAAW;GAC1C,QAEW;EACT,IAAM,IAAU,GAAW,EACrB,IAAQ,EAAM,SAAS,UACvB,IAAY,EAAQ,OACpB,IAAS,EAAa,IAAU,WAAW,OAAO,EAClD,IAAK,IAAY,EAAa,SAAS,GAAI,IAAU,EAAa,aAAa,GAAG,KAAA,GAClF,IAAwB,EAAZ,IAAyB,eAA6B,IAAU,WAAW,KAAK;EAElG,OACI,kBAAC,OAAD;GACI,QAAO;GACP,aAAa;GACb,iBAAiB;GACjB,YAAY,EAAM;GAClB,aAAa,EAAa,SAAS;aALvC,CAOK,KAAW,kBAAC,QAAD;IAAM,OAAO,EAAa,SAAS;cAAnC,CAAsC,EAAO,UAAS,IAAQ;OAC1E,kBAAC,QAAD;IAAM,OAAO;cAAY;IAAa,CAAA,CACpC;;;GAGf,EAAE,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A scannable QR code rendered with half-block characters (two QR rows per
|
|
3
|
+
* terminal row). A typical URL fits in ~15 rows × ~29 columns.
|
|
4
|
+
*
|
|
5
|
+
* Deliberately NOT themed: a QR code needs maximum contrast for camera
|
|
6
|
+
* scanners, so it always renders in the terminal's default foreground on its
|
|
7
|
+
* default background. `invert` swaps dark/light for terminals or scanners
|
|
8
|
+
* that disagree about which is which; modern scanners decode both.
|
|
9
|
+
*/
|
|
10
|
+
export declare const QRCode: import("@sigx/runtime-core").ComponentFactory<{
|
|
11
|
+
text: string;
|
|
12
|
+
} & {
|
|
13
|
+
invert?: boolean | undefined;
|
|
14
|
+
} & {
|
|
15
|
+
quiet?: number | undefined;
|
|
16
|
+
}, void, {}>;
|
|
17
|
+
export default QRCode;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A simple text grid. Columns are auto-sized to their widest cell; the header
|
|
3
|
+
* is accent-colored and separated from the body by a rule. (Cell widths use
|
|
4
|
+
* `string.length` — adequate for the ASCII data tables usually shown in a TUI.)
|
|
5
|
+
*/
|
|
6
|
+
export declare const Table: import("@sigx/runtime-core").ComponentFactory<{
|
|
7
|
+
columns: string[];
|
|
8
|
+
} & {
|
|
9
|
+
rows?: string[][] | undefined;
|
|
10
|
+
}, void, {}>;
|
|
11
|
+
export default Table;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { generateQR as e, resolveColor as t } from "@sigx/terminal-zero";
|
|
2
|
+
import { component as n } from "@sigx/runtime-core";
|
|
3
|
+
import { jsx as r, jsxs as i } from "@sigx/runtime-core/jsx-runtime";
|
|
4
|
+
//#region src/data/Table.tsx
|
|
5
|
+
var a = n(({ props: e }) => () => {
|
|
6
|
+
let n = e.columns || [], a = e.rows || [], o = n.map((e, t) => Math.max(e.length, ...a.map((e) => (e[t] ?? "").length), 0)), s = (e, t) => e + " ".repeat(Math.max(0, t - e.length)), c = t("line"), l = () => /* @__PURE__ */ r("text", {
|
|
7
|
+
color: c,
|
|
8
|
+
children: "│"
|
|
9
|
+
}), u = [];
|
|
10
|
+
n.forEach((e, n) => {
|
|
11
|
+
n > 0 && u.push(l()), u.push(/* @__PURE__ */ r("text", {
|
|
12
|
+
color: t("accent"),
|
|
13
|
+
children: ` ${s(e, o[n])} `
|
|
14
|
+
}));
|
|
15
|
+
});
|
|
16
|
+
let d = o.reduce((e, t) => e + t + 2, 0) + Math.max(0, n.length - 1), f = a.map((e) => {
|
|
17
|
+
let i = [];
|
|
18
|
+
return n.forEach((n, a) => {
|
|
19
|
+
a > 0 && i.push(l()), i.push(/* @__PURE__ */ r("text", {
|
|
20
|
+
color: t("fg"),
|
|
21
|
+
children: ` ${s(e[a] ?? "", o[a])} `
|
|
22
|
+
}));
|
|
23
|
+
}), /* @__PURE__ */ r("box", { children: i });
|
|
24
|
+
});
|
|
25
|
+
return /* @__PURE__ */ i("box", { children: [
|
|
26
|
+
/* @__PURE__ */ r("box", { children: u }),
|
|
27
|
+
/* @__PURE__ */ r("box", { children: /* @__PURE__ */ r("text", {
|
|
28
|
+
color: c,
|
|
29
|
+
children: "─".repeat(d)
|
|
30
|
+
}) }),
|
|
31
|
+
f
|
|
32
|
+
] });
|
|
33
|
+
}, { name: "Table" }), o = n(({ props: t }) => () => /* @__PURE__ */ r("box", { children: e(t.text ?? "", {
|
|
34
|
+
invert: t.invert ?? !1,
|
|
35
|
+
quiet: t.quiet
|
|
36
|
+
}).split("\n").flatMap((e, t) => {
|
|
37
|
+
let n = /* @__PURE__ */ r("text", { children: e });
|
|
38
|
+
return t > 0 ? [/* @__PURE__ */ r("br", {}), n] : [n];
|
|
39
|
+
}) }), { name: "QRCode" });
|
|
40
|
+
//#endregion
|
|
41
|
+
export { a as n, o as t };
|
|
42
|
+
|
|
43
|
+
//# sourceMappingURL=data-DKKLsE5K.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-DKKLsE5K.js","names":[],"sources":["../src/data/Table.tsx","../src/data/QRCode.tsx"],"sourcesContent":["/** @jsxImportSource @sigx/runtime-core */\r\nimport { component, type Define } from '@sigx/runtime-core';\r\nimport { resolveColor } from '@sigx/terminal-zero';\r\n\r\n/**\r\n * A simple text grid. Columns are auto-sized to their widest cell; the header\r\n * is accent-colored and separated from the body by a rule. (Cell widths use\r\n * `string.length` — adequate for the ASCII data tables usually shown in a TUI.)\r\n */\r\nexport const Table = component<\r\n Define.Prop<\"columns\", string[], true> &\r\n Define.Prop<\"rows\", string[][], false>\r\n>(({ props }) => {\r\n return () => {\r\n const cols = props.columns || [];\r\n const rows = props.rows || [];\r\n\r\n const widths = cols.map((c, i) =>\r\n Math.max(c.length, ...rows.map(r => (r[i] ?? '').length), 0)\r\n );\r\n const pad = (s: string, w: number) => s + ' '.repeat(Math.max(0, w - s.length));\r\n\r\n const lineColor = resolveColor('line');\r\n const sep = () => <text color={lineColor}>│</text>;\r\n\r\n const headerCells: any[] = [];\r\n cols.forEach((c, i) => {\r\n if (i > 0) headerCells.push(sep());\r\n headerCells.push(<text color={resolveColor('accent')}>{` ${pad(c, widths[i])} `}</text>);\r\n });\r\n\r\n const ruleWidth = widths.reduce((a, w) => a + w + 2, 0) + Math.max(0, cols.length - 1);\r\n\r\n const bodyRows = rows.map((row) => {\r\n const cells: any[] = [];\r\n cols.forEach((_, i) => {\r\n if (i > 0) cells.push(sep());\r\n cells.push(<text color={resolveColor('fg')}>{` ${pad(row[i] ?? '', widths[i])} `}</text>);\r\n });\r\n return <box>{cells}</box>;\r\n });\r\n\r\n return (\r\n <box>\r\n <box>{headerCells}</box>\r\n <box><text color={lineColor}>{'─'.repeat(ruleWidth)}</text></box>\r\n {bodyRows}\r\n </box>\r\n );\r\n };\r\n}, { name: 'Table' });\r\n\r\nexport default Table;\r\n","/** @jsxImportSource @sigx/runtime-core */\r\nimport { component, type Define } from '@sigx/runtime-core';\r\nimport { generateQR } from '@sigx/terminal-zero';\r\n\r\n/**\r\n * A scannable QR code rendered with half-block characters (two QR rows per\r\n * terminal row). A typical URL fits in ~15 rows × ~29 columns.\r\n *\r\n * Deliberately NOT themed: a QR code needs maximum contrast for camera\r\n * scanners, so it always renders in the terminal's default foreground on its\r\n * default background. `invert` swaps dark/light for terminals or scanners\r\n * that disagree about which is which; modern scanners decode both.\r\n */\r\nexport const QRCode = component<\r\n Define.Prop<'text', string, true> &\r\n Define.Prop<'invert', boolean, false> &\r\n Define.Prop<'quiet', number, false>\r\n>(({ props }) => {\r\n return () => {\r\n const rows = generateQR(props.text ?? '', {\r\n invert: props.invert ?? false,\r\n quiet: props.quiet,\r\n }).split('\\n');\r\n return (\r\n <box>\r\n {rows.flatMap((line, i) => {\r\n const node = <text>{line}</text>;\r\n return i > 0 ? [<br />, node] : [node];\r\n })}\r\n </box>\r\n );\r\n };\r\n}, { name: 'QRCode' });\r\n\r\nexport default QRCode;\r\n"],"mappings":";;;;AASA,IAAa,IAAQ,GAGlB,EAAE,qBACY;CACT,IAAM,IAAO,EAAM,WAAW,EAAE,EAC1B,IAAO,EAAM,QAAQ,EAAE,EAEvB,IAAS,EAAK,KAAK,GAAG,MACxB,KAAK,IAAI,EAAE,QAAQ,GAAG,EAAK,KAAI,OAAM,EAAE,MAAM,IAAI,OAAO,EAAE,EAAE,CAC/D,EACK,KAAO,GAAW,MAAc,IAAI,IAAI,OAAO,KAAK,IAAI,GAAG,IAAI,EAAE,OAAO,CAAC,EAEzE,IAAY,EAAa,OAAO,EAChC,UAAY,kBAAC,QAAD;EAAM,OAAO;YAAW;EAAQ,CAAA,EAE5C,IAAqB,EAAE;CAC7B,EAAK,SAAS,GAAG,MAAM;EAEnB,AADI,IAAI,KAAG,EAAY,KAAK,GAAK,CAAC,EAClC,EAAY,KAAK,kBAAC,QAAD;GAAM,OAAO,EAAa,SAAS;aAAG,IAAI,EAAI,GAAG,EAAO,GAAG,CAAC;GAAU,CAAA,CAAC;GAC1F;CAEF,IAAM,IAAY,EAAO,QAAQ,GAAG,MAAM,IAAI,IAAI,GAAG,EAAE,GAAG,KAAK,IAAI,GAAG,EAAK,SAAS,EAAE,EAEhF,IAAW,EAAK,KAAK,MAAQ;EAC/B,IAAM,IAAe,EAAE;EAKvB,OAJA,EAAK,SAAS,GAAG,MAAM;GAEnB,AADI,IAAI,KAAG,EAAM,KAAK,GAAK,CAAC,EAC5B,EAAM,KAAK,kBAAC,QAAD;IAAM,OAAO,EAAa,KAAK;cAAG,IAAI,EAAI,EAAI,MAAM,IAAI,EAAO,GAAG,CAAC;IAAU,CAAA,CAAC;IAC3F,EACK,kBAAC,OAAD,EAAA,UAAM,GAAY,CAAA;GAC3B;CAEF,OACI,kBAAC,OAAD,EAAA,UAAA;EACI,kBAAC,OAAD,EAAA,UAAM,GAAkB,CAAA;EACxB,kBAAC,OAAD,EAAA,UAAK,kBAAC,QAAD;GAAM,OAAO;aAAY,IAAI,OAAO,EAAU;GAAQ,CAAA,EAAM,CAAA;EAChE;EACC,EAAA,CAAA;GAGf,EAAE,MAAM,SAAS,CAAC,ECrCR,IAAS,GAInB,EAAE,qBAOO,kBAAC,OAAD,EAAA,UALS,EAAW,EAAM,QAAQ,IAAI;CACtC,QAAQ,EAAM,UAAU;CACxB,OAAO,EAAM;CAChB,CAAC,CAAC,MAAM,KAGA,CAAK,SAAS,GAAM,MAAM;CACvB,IAAM,IAAO,kBAAC,QAAD,EAAA,UAAO,GAAY,CAAA;CAChC,OAAO,IAAI,IAAI,CAAC,kBAAC,MAAD,EAAM,CAAA,EAAE,EAAK,GAAG,CAAC,EAAK;EACxC,EACA,CAAA,EAGf,EAAE,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A small label indicator in one of three styles:
|
|
3
|
+
* - `solid` — color fill with `accentText` (uses inline background)
|
|
4
|
+
* - `accent` — colored text only (default)
|
|
5
|
+
* - `bracket` — `[ label ]` in color, no fill
|
|
6
|
+
*/
|
|
7
|
+
export declare const Badge: import("@sigx/runtime-core").ComponentFactory<{
|
|
8
|
+
label: string;
|
|
9
|
+
} & {
|
|
10
|
+
variant?: "accent" | "bracket" | "solid" | undefined;
|
|
11
|
+
} & {
|
|
12
|
+
color?: string | undefined;
|
|
13
|
+
}, void, {}>;
|
|
14
|
+
export default Badge;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Progress bar in three variants:
|
|
3
|
+
* - `solid` — single-color fill (default; the classic bar)
|
|
4
|
+
* - `gradient` — fill sampled per-cell across `colors` stops (default
|
|
5
|
+
* accent→info), revealed as the bar grows
|
|
6
|
+
* - `rainbow` — gradient with the rainbow preset
|
|
7
|
+
* `smooth` adds a sub-cell leading edge (eighth blocks). Gradient variants
|
|
8
|
+
* fall back to solid at ansi16/none depth.
|
|
9
|
+
*/
|
|
10
|
+
export declare const ProgressBar: import("@sigx/runtime-core").ComponentFactory<{
|
|
11
|
+
value?: number | undefined;
|
|
12
|
+
} & {
|
|
13
|
+
max?: number | undefined;
|
|
14
|
+
} & {
|
|
15
|
+
width?: number | undefined;
|
|
16
|
+
} & {
|
|
17
|
+
char?: string | undefined;
|
|
18
|
+
} & {
|
|
19
|
+
emptyChar?: string | undefined;
|
|
20
|
+
} & {
|
|
21
|
+
color?: string | undefined;
|
|
22
|
+
} & {
|
|
23
|
+
variant?: "gradient" | "rainbow" | "solid" | undefined;
|
|
24
|
+
} & {
|
|
25
|
+
colors?: string[] | undefined;
|
|
26
|
+
} & {
|
|
27
|
+
smooth?: boolean | undefined;
|
|
28
|
+
} & {
|
|
29
|
+
showPercent?: boolean | undefined;
|
|
30
|
+
}, void, {}>;
|
|
31
|
+
export default ProgressBar;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Animated spinner that resolves to a success check when `done` (or a danger
|
|
3
|
+
* cross when `failed`; `done` wins). `variant` selects a frame set from
|
|
4
|
+
* SPINNERS ('dots' default; note 'moon' glyphs are 2 cells wide). Driven by
|
|
5
|
+
* the shared ticker — one interval for every animated component, frozen on
|
|
6
|
+
* non-TTY output.
|
|
7
|
+
*/
|
|
8
|
+
export declare const Spinner: import("@sigx/runtime-core").ComponentFactory<{
|
|
9
|
+
label?: string | undefined;
|
|
10
|
+
} & {
|
|
11
|
+
done?: boolean | undefined;
|
|
12
|
+
} & {
|
|
13
|
+
failed?: boolean | undefined;
|
|
14
|
+
} & {
|
|
15
|
+
interval?: number | undefined;
|
|
16
|
+
} & {
|
|
17
|
+
variant?: "arc" | "bounce" | "circle" | "dots" | "line" | "moon" | undefined;
|
|
18
|
+
} & {
|
|
19
|
+
color?: string | undefined;
|
|
20
|
+
}, void, {}>;
|
|
21
|
+
export default Spinner;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { t as e } from "./presets-uqseGRqO.js";
|
|
2
|
+
import "./Spinner-JpmBtbPo.js";
|
|
3
|
+
import { GLYPHS as t, getColorDepth as n, gradient as r, hexToSGR as i, resolveColor as a } from "@sigx/terminal-zero";
|
|
4
|
+
import { component as o } from "@sigx/runtime-core";
|
|
5
|
+
import { jsx as s, jsxs as c } from "@sigx/runtime-core/jsx-runtime";
|
|
6
|
+
//#region src/feedback/ProgressBar.tsx
|
|
7
|
+
var l = o(({ props: o }) => () => {
|
|
8
|
+
let l = o.value || 0, u = o.max || 100, d = o.width || 20, f = o.char || t.barFull, p = o.emptyChar || t.barEmpty, m = o.showPercent !== !1, h = Math.min(Math.max(l / u, 0), 1), g = d * h, _ = o.smooth ? Math.floor(g) : Math.round(g), v = o.smooth ? Math.floor((g - _) * 8) : 0, y = v > 0 ? t.barEighths[v - 1] : "", b = d - _ - +!!y, x = n(), S = o.variant || "solid", C = S !== "solid" && x !== "ansi16" && x !== "none", w = m ? /* @__PURE__ */ s("text", {
|
|
9
|
+
color: a("dim"),
|
|
10
|
+
children: ` ${Math.round(h * 100)}%`
|
|
11
|
+
}) : void 0;
|
|
12
|
+
if (!C) return /* @__PURE__ */ c("box", { children: [
|
|
13
|
+
/* @__PURE__ */ s("text", {
|
|
14
|
+
color: a(o.color || "accent"),
|
|
15
|
+
children: f.repeat(_) + y
|
|
16
|
+
}),
|
|
17
|
+
/* @__PURE__ */ s("text", {
|
|
18
|
+
color: a("faint"),
|
|
19
|
+
children: p.repeat(b)
|
|
20
|
+
}),
|
|
21
|
+
w
|
|
22
|
+
] });
|
|
23
|
+
let T = r((S === "rainbow" ? [...e.rainbow] : o.colors?.length ? o.colors : ["accent", "info"]).map((e) => a(e)), Math.max(d, 2)), E = "", D = null;
|
|
24
|
+
for (let e = 0; e < _; e++) T[e] !== D && (E += i(T[e]), D = T[e]), E += f;
|
|
25
|
+
if (y) {
|
|
26
|
+
let e = T[Math.min(_, T.length - 1)];
|
|
27
|
+
e !== D && (E += i(e)), E += y, D = e;
|
|
28
|
+
}
|
|
29
|
+
return D !== null && (E += "\x1B[39m"), /* @__PURE__ */ c("box", { children: [
|
|
30
|
+
/* @__PURE__ */ s("text", { children: E }),
|
|
31
|
+
/* @__PURE__ */ s("text", {
|
|
32
|
+
color: a("faint"),
|
|
33
|
+
children: p.repeat(b)
|
|
34
|
+
}),
|
|
35
|
+
w
|
|
36
|
+
] });
|
|
37
|
+
}, { name: "ProgressBar" }), u = o(({ props: e }) => () => {
|
|
38
|
+
let t = e.label ?? "", n = e.variant || "accent", r = e.color || "accent";
|
|
39
|
+
return n === "solid" ? /* @__PURE__ */ s("box", { children: /* @__PURE__ */ c("text", {
|
|
40
|
+
backgroundColor: a(r),
|
|
41
|
+
color: a("accentText"),
|
|
42
|
+
children: [
|
|
43
|
+
" ",
|
|
44
|
+
t,
|
|
45
|
+
" "
|
|
46
|
+
]
|
|
47
|
+
}) }) : n === "bracket" ? /* @__PURE__ */ s("box", { children: /* @__PURE__ */ c("text", {
|
|
48
|
+
color: a(r),
|
|
49
|
+
children: [
|
|
50
|
+
"[ ",
|
|
51
|
+
t,
|
|
52
|
+
" ]"
|
|
53
|
+
]
|
|
54
|
+
}) }) : /* @__PURE__ */ s("box", { children: /* @__PURE__ */ s("text", {
|
|
55
|
+
color: a(r),
|
|
56
|
+
children: t
|
|
57
|
+
}) });
|
|
58
|
+
}, { name: "Badge" });
|
|
59
|
+
//#endregion
|
|
60
|
+
export { l as n, u as t };
|
|
61
|
+
|
|
62
|
+
//# sourceMappingURL=feedback-1WqdARfx.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feedback-1WqdARfx.js","names":[],"sources":["../src/feedback/ProgressBar.tsx","../src/feedback/Badge.tsx"],"sourcesContent":["/** @jsxImportSource @sigx/runtime-core */\r\nimport { component, type Define } from '@sigx/runtime-core';\r\nimport { resolveColor, getColorDepth, GLYPHS, gradient, hexToSGR } from '@sigx/terminal-zero';\r\nimport { GRADIENT_PRESETS } from '../fx/presets';\r\n\r\n/**\r\n * Progress bar in three variants:\r\n * - `solid` — single-color fill (default; the classic bar)\r\n * - `gradient` — fill sampled per-cell across `colors` stops (default\r\n * accent→info), revealed as the bar grows\r\n * - `rainbow` — gradient with the rainbow preset\r\n * `smooth` adds a sub-cell leading edge (eighth blocks). Gradient variants\r\n * fall back to solid at ansi16/none depth.\r\n */\r\nexport const ProgressBar = component<\r\n Define.Prop<\"value\", number, false> &\r\n Define.Prop<\"max\", number, false> &\r\n Define.Prop<\"width\", number, false> &\r\n Define.Prop<\"char\", string, false> &\r\n Define.Prop<\"emptyChar\", string, false> &\r\n Define.Prop<\"color\", string, false> &\r\n Define.Prop<\"variant\", 'solid' | 'gradient' | 'rainbow', false> &\r\n Define.Prop<\"colors\", string[], false> &\r\n Define.Prop<\"smooth\", boolean, false> &\r\n Define.Prop<\"showPercent\", boolean, false>\r\n>(({ props }) => {\r\n return () => {\r\n const value = props.value || 0;\r\n const max = props.max || 100;\r\n const width = props.width || 20;\r\n const barChar = props.char || GLYPHS.barFull;\r\n const emptyChar = props.emptyChar || GLYPHS.barEmpty;\r\n const showPercent = props.showPercent !== false;\r\n\r\n const percentage = Math.min(Math.max(value / max, 0), 1);\r\n const exact = width * percentage;\r\n const filledLen = props.smooth ? Math.floor(exact) : Math.round(exact);\r\n // Sub-cell leading edge: eighth blocks between filled and empty cells.\r\n const edgeIdx = props.smooth ? Math.floor((exact - filledLen) * 8) : 0;\r\n const edge = edgeIdx > 0 ? GLYPHS.barEighths[edgeIdx - 1] : '';\r\n const emptyLen = width - filledLen - (edge ? 1 : 0);\r\n\r\n const depth = getColorDepth();\r\n const variant = props.variant || 'solid';\r\n const useGradient = variant !== 'solid' && depth !== 'ansi16' && depth !== 'none';\r\n\r\n const percentText = showPercent\r\n ? <text color={resolveColor('dim')}>{` ${Math.round(percentage * 100)}%`}</text>\r\n : undefined;\r\n\r\n if (!useGradient) {\r\n const fill = resolveColor(props.color || 'accent');\r\n return (\r\n <box>\r\n <text color={fill}>{barChar.repeat(filledLen) + edge}</text>\r\n <text color={resolveColor('faint')}>{emptyChar.repeat(emptyLen)}</text>\r\n {percentText}\r\n </box>\r\n );\r\n }\r\n\r\n // Sample the gradient across the FULL width so the bar reveals a\r\n // stable gradient as it fills (not a compressed one per frame).\r\n const stops = (variant === 'rainbow'\r\n ? [...GRADIENT_PRESETS.rainbow]\r\n : (props.colors?.length ? props.colors : ['accent', 'info'])\r\n ).map((c) => resolveColor(c));\r\n const cells = gradient(stops, Math.max(width, 2));\r\n\r\n let painted = '';\r\n let lastHex: string | null = null;\r\n for (let i = 0; i < filledLen; i++) {\r\n if (cells[i] !== lastHex) {\r\n painted += hexToSGR(cells[i]);\r\n lastHex = cells[i];\r\n }\r\n painted += barChar;\r\n }\r\n if (edge) {\r\n const hex = cells[Math.min(filledLen, cells.length - 1)];\r\n if (hex !== lastHex) painted += hexToSGR(hex);\r\n painted += edge;\r\n lastHex = hex;\r\n }\r\n if (lastHex !== null) painted += '\\x1b[39m';\r\n\r\n return (\r\n <box>\r\n <text>{painted}</text>\r\n <text color={resolveColor('faint')}>{emptyChar.repeat(emptyLen)}</text>\r\n {percentText}\r\n </box>\r\n );\r\n };\r\n}, { name: 'ProgressBar' });\r\n\r\nexport default ProgressBar;\r\n","/** @jsxImportSource @sigx/runtime-core */\r\nimport { component, type Define } from '@sigx/runtime-core';\r\nimport { resolveColor } from '@sigx/terminal-zero';\r\n\r\n/**\r\n * A small label indicator in one of three styles:\r\n * - `solid` — color fill with `accentText` (uses inline background)\r\n * - `accent` — colored text only (default)\r\n * - `bracket` — `[ label ]` in color, no fill\r\n */\r\nexport const Badge = component<\r\n Define.Prop<\"label\", string, true> &\r\n Define.Prop<\"variant\", 'solid' | 'accent' | 'bracket', false> &\r\n Define.Prop<\"color\", string, false>\r\n>(({ props }) => {\r\n return () => {\r\n const label = props.label ?? '';\r\n const variant = props.variant || 'accent';\r\n const color = props.color || 'accent';\r\n\r\n if (variant === 'solid') {\r\n return (\r\n <box>\r\n <text backgroundColor={resolveColor(color)} color={resolveColor('accentText')}> {label} </text>\r\n </box>\r\n );\r\n }\r\n if (variant === 'bracket') {\r\n return <box><text color={resolveColor(color)}>[ {label} ]</text></box>;\r\n }\r\n return <box><text color={resolveColor(color)}>{label}</text></box>;\r\n };\r\n}, { name: 'Badge' });\r\n\r\nexport default Badge;\r\n"],"mappings":";;;;;;AAcA,IAAa,IAAc,GAWxB,EAAE,qBACY;CACT,IAAM,IAAQ,EAAM,SAAS,GACvB,IAAM,EAAM,OAAO,KACnB,IAAQ,EAAM,SAAS,IACvB,IAAU,EAAM,QAAQ,EAAO,SAC/B,IAAY,EAAM,aAAa,EAAO,UACtC,IAAc,EAAM,gBAAgB,IAEpC,IAAa,KAAK,IAAI,KAAK,IAAI,IAAQ,GAAK,EAAE,EAAE,EAAE,EAClD,IAAQ,IAAQ,GAChB,IAAY,EAAM,SAAS,KAAK,MAAM,EAAM,GAAG,KAAK,MAAM,EAAM,EAEhE,IAAU,EAAM,SAAS,KAAK,OAAO,IAAQ,KAAa,EAAE,GAAG,GAC/D,IAAO,IAAU,IAAI,EAAO,WAAW,IAAU,KAAK,IACtD,IAAW,IAAQ,IAAa,MAEhC,IAAQ,GAAe,EACvB,IAAU,EAAM,WAAW,SAC3B,IAAc,MAAY,WAAW,MAAU,YAAY,MAAU,QAErE,IAAc,IACd,kBAAC,QAAD;EAAM,OAAO,EAAa,MAAM;YAAG,IAAI,KAAK,MAAM,IAAa,IAAI,CAAC;EAAU,CAAA,GAC9E,KAAA;CAEN,IAAI,CAAC,GAED,OACI,kBAAC,OAAD,EAAA,UAAA;EACI,kBAAC,QAAD;GAAM,OAHD,EAAa,EAAM,SAAS,SAGpB;aAAO,EAAQ,OAAO,EAAU,GAAG;GAAY,CAAA;EAC5D,kBAAC,QAAD;GAAM,OAAO,EAAa,QAAQ;aAAG,EAAU,OAAO,EAAS;GAAQ,CAAA;EACtE;EACC,EAAA,CAAA;CAUd,IAAM,IAAQ,GAJC,MAAY,YACrB,CAAC,GAAG,EAAiB,QAAQ,GAC5B,EAAM,QAAQ,SAAS,EAAM,SAAS,CAAC,UAAU,OAAO,EAC7D,KAAK,MAAM,EAAa,EAAE,CACL,EAAO,KAAK,IAAI,GAAO,EAAE,CAAC,EAE7C,IAAU,IACV,IAAyB;CAC7B,KAAK,IAAI,IAAI,GAAG,IAAI,GAAW,KAK3B,AAJI,EAAM,OAAO,MACb,KAAW,EAAS,EAAM,GAAG,EAC7B,IAAU,EAAM,KAEpB,KAAW;CAEf,IAAI,GAAM;EACN,IAAM,IAAM,EAAM,KAAK,IAAI,GAAW,EAAM,SAAS,EAAE;EAGvD,AAFI,MAAQ,MAAS,KAAW,EAAS,EAAI,GAC7C,KAAW,GACX,IAAU;;CAId,OAFI,MAAY,SAAM,KAAW,aAG7B,kBAAC,OAAD,EAAA,UAAA;EACI,kBAAC,QAAD,EAAA,UAAO,GAAe,CAAA;EACtB,kBAAC,QAAD;GAAM,OAAO,EAAa,QAAQ;aAAG,EAAU,OAAO,EAAS;GAAQ,CAAA;EACtE;EACC,EAAA,CAAA;GAGf,EAAE,MAAM,eAAe,CAAC,ECpFd,IAAQ,GAIlB,EAAE,qBACY;CACT,IAAM,IAAQ,EAAM,SAAS,IACvB,IAAU,EAAM,WAAW,UAC3B,IAAQ,EAAM,SAAS;CAY7B,OAVI,MAAY,UAER,kBAAC,OAAD,EAAA,UACI,kBAAC,QAAD;EAAM,iBAAiB,EAAa,EAAM;EAAE,OAAO,EAAa,aAAa;YAA7E;GAA+E;GAAE;GAAM;GAAQ;KAC7F,CAAA,GAGV,MAAY,YACL,kBAAC,OAAD,EAAA,UAAK,kBAAC,QAAD;EAAM,OAAO,EAAa,EAAM;YAAhC;GAAkC;GAAG;GAAM;GAAS;KAAM,CAAA,GAEnE,kBAAC,OAAD,EAAA,UAAK,kBAAC,QAAD;EAAM,OAAO,EAAa,EAAM;YAAG;EAAa,CAAA,EAAM,CAAA;GAEvE,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** @jsxImportSource @sigx/runtime-core */
|
|
2
|
+
import { type Define } from '@sigx/runtime-core';
|
|
3
|
+
export declare const Checkbox: import("@sigx/runtime-core").ComponentFactory<{
|
|
4
|
+
model?: import("@sigx/runtime-core").Model<boolean> | undefined;
|
|
5
|
+
__modelBindings?: {
|
|
6
|
+
model: boolean;
|
|
7
|
+
} | undefined;
|
|
8
|
+
} & Define.Event<"update:modelValue", boolean> & {
|
|
9
|
+
label?: string | undefined;
|
|
10
|
+
} & {
|
|
11
|
+
autofocus?: boolean | undefined;
|
|
12
|
+
} & {
|
|
13
|
+
disabled?: boolean | undefined;
|
|
14
|
+
} & Define.Event<"change", boolean>, void, {}>;
|
|
15
|
+
export default Checkbox;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/** @jsxImportSource @sigx/runtime-core */
|
|
2
|
+
import { type Define } from '@sigx/runtime-core';
|
|
3
|
+
/**
|
|
4
|
+
* Yes/No toggle. Keys (while focused): y/Y and n/N answer immediately,
|
|
5
|
+
* ←/→ (or h/l) flip the selection, Enter submits the current value.
|
|
6
|
+
*/
|
|
7
|
+
export declare const Confirm: import("@sigx/runtime-core").ComponentFactory<{
|
|
8
|
+
model?: import("@sigx/runtime-core").Model<boolean> | undefined;
|
|
9
|
+
__modelBindings?: {
|
|
10
|
+
model: boolean;
|
|
11
|
+
} | undefined;
|
|
12
|
+
} & Define.Event<"update:modelValue", boolean> & {
|
|
13
|
+
label?: string | undefined;
|
|
14
|
+
} & {
|
|
15
|
+
activeLabel?: string | undefined;
|
|
16
|
+
} & {
|
|
17
|
+
inactiveLabel?: string | undefined;
|
|
18
|
+
} & {
|
|
19
|
+
autofocus?: boolean | undefined;
|
|
20
|
+
} & Define.Event<"change", boolean> & Define.Event<"submit", boolean>, void, {}>;
|
|
21
|
+
export default Confirm;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** @jsxImportSource @sigx/runtime-core */
|
|
2
|
+
import { type Define } from '@sigx/runtime-core';
|
|
3
|
+
export declare const Input: import("@sigx/runtime-core").ComponentFactory<{
|
|
4
|
+
model?: import("@sigx/runtime-core").Model<string> | undefined;
|
|
5
|
+
__modelBindings?: {
|
|
6
|
+
model: string;
|
|
7
|
+
} | undefined;
|
|
8
|
+
} & Define.Event<"update:modelValue", string> & {
|
|
9
|
+
placeholder?: string | undefined;
|
|
10
|
+
} & {
|
|
11
|
+
autofocus?: boolean | undefined;
|
|
12
|
+
} & {
|
|
13
|
+
label?: string | undefined;
|
|
14
|
+
} & Define.Event<"input", string> & Define.Event<"submit", string>, void, {}>;
|
|
15
|
+
export default Input;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/** @jsxImportSource @sigx/runtime-core */
|
|
2
|
+
import { type Define } from '@sigx/runtime-core';
|
|
3
|
+
export interface MultiSelectOption<T = string> {
|
|
4
|
+
label: string;
|
|
5
|
+
value: T;
|
|
6
|
+
description?: string;
|
|
7
|
+
/**
|
|
8
|
+
* Section header rendered above this option when it differs from the
|
|
9
|
+
* previous option's group (e.g. "connected devices" / "available to
|
|
10
|
+
* boot"). Purely visual — the cursor skips headers and indexes stay
|
|
11
|
+
* option-based. Pre-sort options by group.
|
|
12
|
+
*/
|
|
13
|
+
group?: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Checkbox list with a movable cursor. Model holds the checked values.
|
|
17
|
+
* Keys (while focused): ↑/k ↓/j move, Space toggles, `a` toggles all,
|
|
18
|
+
* Enter submits (blocked with a hint when `required` and nothing is checked).
|
|
19
|
+
*/
|
|
20
|
+
export declare const MultiSelect: import("@sigx/runtime-core").ComponentFactory<{
|
|
21
|
+
model?: import("@sigx/runtime-core").Model<string[]> | undefined;
|
|
22
|
+
__modelBindings?: {
|
|
23
|
+
model: string[];
|
|
24
|
+
} | undefined;
|
|
25
|
+
} & Define.Event<"update:modelValue", string[]> & {
|
|
26
|
+
options: MultiSelectOption<string>[];
|
|
27
|
+
} & {
|
|
28
|
+
label?: string | undefined;
|
|
29
|
+
} & {
|
|
30
|
+
autofocus?: boolean | undefined;
|
|
31
|
+
} & {
|
|
32
|
+
required?: boolean | undefined;
|
|
33
|
+
} & {
|
|
34
|
+
showHint?: boolean | undefined;
|
|
35
|
+
} & Define.Event<"change", string[]> & Define.Event<"submit", string[]>, void, {}>;
|
|
36
|
+
export default MultiSelect;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/** @jsxImportSource @sigx/runtime-core */
|
|
2
|
+
import { type Define } from '@sigx/runtime-core';
|
|
3
|
+
export interface RadioOption<T = string> {
|
|
4
|
+
label: string;
|
|
5
|
+
value: T;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Single-choice group. Like Select, but every option is always visible with a
|
|
9
|
+
* ● / ○ marker. Arrow keys (or j/k) move the selection.
|
|
10
|
+
*/
|
|
11
|
+
export declare const Radio: import("@sigx/runtime-core").ComponentFactory<{
|
|
12
|
+
model?: import("@sigx/runtime-core").Model<string> | undefined;
|
|
13
|
+
__modelBindings?: {
|
|
14
|
+
model: string;
|
|
15
|
+
} | undefined;
|
|
16
|
+
} & Define.Event<"update:modelValue", string> & {
|
|
17
|
+
options: RadioOption<string>[];
|
|
18
|
+
} & {
|
|
19
|
+
label?: string | undefined;
|
|
20
|
+
} & {
|
|
21
|
+
autofocus?: boolean | undefined;
|
|
22
|
+
} & Define.Event<"change", string>, void, {}>;
|
|
23
|
+
export default Radio;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/** @jsxImportSource @sigx/runtime-core */
|
|
2
|
+
import { type Define } from '@sigx/runtime-core';
|
|
3
|
+
export interface SelectOption<T = string> {
|
|
4
|
+
label: string;
|
|
5
|
+
value: T;
|
|
6
|
+
description?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const Select: import("@sigx/runtime-core").ComponentFactory<{
|
|
9
|
+
model?: import("@sigx/runtime-core").Model<string> | undefined;
|
|
10
|
+
__modelBindings?: {
|
|
11
|
+
model: string;
|
|
12
|
+
} | undefined;
|
|
13
|
+
} & Define.Event<"update:modelValue", string> & {
|
|
14
|
+
options: SelectOption<string>[];
|
|
15
|
+
} & {
|
|
16
|
+
label?: string | undefined;
|
|
17
|
+
} & {
|
|
18
|
+
autofocus?: boolean | undefined;
|
|
19
|
+
} & {
|
|
20
|
+
showDescription?: boolean | undefined;
|
|
21
|
+
} & Define.Event<"change", string> & Define.Event<"submit", string>, void, {}>;
|
|
22
|
+
export default Select;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/** @jsxImportSource @sigx/runtime-core */
|
|
2
|
+
import { type Define } from '@sigx/runtime-core';
|
|
3
|
+
/**
|
|
4
|
+
* Growing multi-line text input — the Claude-style prompt box. Soft-wraps to
|
|
5
|
+
* `width`, grows from one row up to `maxRows` (then scrolls internally,
|
|
6
|
+
* keeping the cursor visible), with a movable block cursor.
|
|
7
|
+
*
|
|
8
|
+
* Keys (while focused): printable characters and paste chunks insert at the
|
|
9
|
+
* cursor; ←/→/↑/↓ move (↑/↓ keep a sticky goal column); Home/End jump within
|
|
10
|
+
* the visual row; Backspace/Delete edit around the cursor. Enter (`\r`)
|
|
11
|
+
* submits — unless the text ends with `\`, which is stripped and replaced by
|
|
12
|
+
* a newline (continuation). Newlines: Ctrl+J always; ESC+`\r` and the CSI-u
|
|
13
|
+
* Shift/Ctrl+Enter encodings for terminals configured to send them (plain
|
|
14
|
+
* Shift+Enter is indistinguishable from Enter on unconfigured terminals).
|
|
15
|
+
* NOTE: this deliberately diverges from the prompt engine's `isEnter` (which
|
|
16
|
+
* treats `\r` and `\n` alike) — an editor needs the distinction.
|
|
17
|
+
*
|
|
18
|
+
* Paste chunks containing escape sequences keep only the printable prefix
|
|
19
|
+
* (bracketed-paste mode is not implemented).
|
|
20
|
+
*/
|
|
21
|
+
export declare const TextArea: import("@sigx/runtime-core").ComponentFactory<{
|
|
22
|
+
model?: import("@sigx/runtime-core").Model<string> | undefined;
|
|
23
|
+
__modelBindings?: {
|
|
24
|
+
model: string;
|
|
25
|
+
} | undefined;
|
|
26
|
+
} & Define.Event<"update:modelValue", string> & {
|
|
27
|
+
placeholder?: string | undefined;
|
|
28
|
+
} & {
|
|
29
|
+
promptGlyph?: string | undefined;
|
|
30
|
+
} & {
|
|
31
|
+
width?: number | undefined;
|
|
32
|
+
} & {
|
|
33
|
+
maxRows?: number | undefined;
|
|
34
|
+
} & {
|
|
35
|
+
autofocus?: boolean | undefined;
|
|
36
|
+
} & Define.Event<"input", string> & Define.Event<"submit", string>, void, {}>;
|
|
37
|
+
export default TextArea;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { Input } from './Input';
|
|
2
|
+
export { Checkbox } from './Checkbox';
|
|
3
|
+
export { Select, type SelectOption } from './Select';
|
|
4
|
+
export { Radio, type RadioOption } from './Radio';
|
|
5
|
+
export { MultiSelect, type MultiSelectOption } from './MultiSelect';
|
|
6
|
+
export { Confirm } from './Confirm';
|
|
7
|
+
export { TextArea } from './TextArea';
|