micro-models-agent 0.2.87 → 0.2.88
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/dist/repl/commands.d.ts.map +1 -1
- package/dist/repl/commands.js +132 -74
- package/dist/repl/commands.js.map +1 -1
- package/dist/ui/ink/components/ActivityLog.d.ts +12 -0
- package/dist/ui/ink/components/ActivityLog.d.ts.map +1 -0
- package/dist/ui/ink/components/ActivityLog.js +11 -0
- package/dist/ui/ink/components/ActivityLog.js.map +1 -0
- package/dist/ui/ink/components/AgentStatus.d.ts +13 -0
- package/dist/ui/ink/components/AgentStatus.d.ts.map +1 -0
- package/dist/ui/ink/components/AgentStatus.js +20 -0
- package/dist/ui/ink/components/AgentStatus.js.map +1 -0
- package/dist/ui/ink/components/BottomBar.d.ts +12 -0
- package/dist/ui/ink/components/BottomBar.d.ts.map +1 -0
- package/dist/ui/ink/components/BottomBar.js +22 -0
- package/dist/ui/ink/components/BottomBar.js.map +1 -0
- package/dist/ui/ink/components/CheckboxInput.d.ts +21 -0
- package/dist/ui/ink/components/CheckboxInput.d.ts.map +1 -0
- package/dist/ui/ink/components/CheckboxInput.js +36 -0
- package/dist/ui/ink/components/CheckboxInput.js.map +1 -0
- package/dist/ui/ink/components/InputBox.d.ts +25 -0
- package/dist/ui/ink/components/InputBox.d.ts.map +1 -0
- package/dist/ui/ink/components/InputBox.js +91 -0
- package/dist/ui/ink/components/InputBox.js.map +1 -0
- package/dist/ui/ink/components/ModeSelector.d.ts +8 -0
- package/dist/ui/ink/components/ModeSelector.d.ts.map +1 -0
- package/dist/ui/ink/components/ModeSelector.js +13 -0
- package/dist/ui/ink/components/ModeSelector.js.map +1 -0
- package/dist/ui/ink/components/QuestionBox.d.ts +14 -0
- package/dist/ui/ink/components/QuestionBox.d.ts.map +1 -0
- package/dist/ui/ink/components/QuestionBox.js +35 -0
- package/dist/ui/ink/components/QuestionBox.js.map +1 -0
- package/dist/ui/ink/components/RadioInput.d.ts +17 -0
- package/dist/ui/ink/components/RadioInput.d.ts.map +1 -0
- package/dist/ui/ink/components/RadioInput.js +30 -0
- package/dist/ui/ink/components/RadioInput.js.map +1 -0
- package/dist/ui/ink/components/SliderInput.d.ts +20 -0
- package/dist/ui/ink/components/SliderInput.d.ts.map +1 -0
- package/dist/ui/ink/components/SliderInput.js +40 -0
- package/dist/ui/ink/components/SliderInput.js.map +1 -0
- package/dist/ui/ink/components/StartupScreen.d.ts +19 -0
- package/dist/ui/ink/components/StartupScreen.d.ts.map +1 -0
- package/dist/ui/ink/components/StartupScreen.js +9 -0
- package/dist/ui/ink/components/StartupScreen.js.map +1 -0
- package/dist/ui/ink/components/WelcomeScreen.d.ts +10 -0
- package/dist/ui/ink/components/WelcomeScreen.d.ts.map +1 -0
- package/dist/ui/ink/components/WelcomeScreen.js +8 -0
- package/dist/ui/ink/components/WelcomeScreen.js.map +1 -0
- package/dist/ui/ink/components/Window.d.ts +30 -0
- package/dist/ui/ink/components/Window.d.ts.map +1 -0
- package/dist/ui/ink/components/Window.js +9 -0
- package/dist/ui/ink/components/Window.js.map +1 -0
- package/dist/ui/ink/components/ui/_core.d.ts +113 -0
- package/dist/ui/ink/components/ui/_core.d.ts.map +1 -0
- package/dist/ui/ink/components/ui/_core.js +83 -0
- package/dist/ui/ink/components/ui/_core.js.map +1 -0
- package/dist/ui/ink/components/ui/autocomplete/Autocomplete.d.ts +23 -0
- package/dist/ui/ink/components/ui/autocomplete/Autocomplete.d.ts.map +1 -0
- package/dist/ui/ink/components/ui/autocomplete/Autocomplete.js +56 -0
- package/dist/ui/ink/components/ui/autocomplete/Autocomplete.js.map +1 -0
- package/dist/ui/ink/components/ui/autocomplete/index.d.ts +3 -0
- package/dist/ui/ink/components/ui/autocomplete/index.d.ts.map +1 -0
- package/dist/ui/ink/components/ui/autocomplete/index.js +2 -0
- package/dist/ui/ink/components/ui/autocomplete/index.js.map +1 -0
- package/dist/ui/ink/components/ui/badge/Badge.d.ts +13 -0
- package/dist/ui/ink/components/ui/badge/Badge.d.ts.map +1 -0
- package/dist/ui/ink/components/ui/badge/Badge.js +17 -0
- package/dist/ui/ink/components/ui/badge/Badge.js.map +1 -0
- package/dist/ui/ink/components/ui/badge/index.d.ts +3 -0
- package/dist/ui/ink/components/ui/badge/index.d.ts.map +1 -0
- package/dist/ui/ink/components/ui/badge/index.js +2 -0
- package/dist/ui/ink/components/ui/badge/index.js.map +1 -0
- package/dist/ui/ink/components/ui/divider/Divider.d.ts +12 -0
- package/dist/ui/ink/components/ui/divider/Divider.d.ts.map +1 -0
- package/dist/ui/ink/components/ui/divider/Divider.js +27 -0
- package/dist/ui/ink/components/ui/divider/Divider.js.map +1 -0
- package/dist/ui/ink/components/ui/divider/index.d.ts +3 -0
- package/dist/ui/ink/components/ui/divider/index.d.ts.map +1 -0
- package/dist/ui/ink/components/ui/divider/index.js +2 -0
- package/dist/ui/ink/components/ui/divider/index.js.map +1 -0
- package/dist/ui/ink/components/ui/header/Header.d.ts +13 -0
- package/dist/ui/ink/components/ui/header/Header.d.ts.map +1 -0
- package/dist/ui/ink/components/ui/header/Header.js +33 -0
- package/dist/ui/ink/components/ui/header/Header.js.map +1 -0
- package/dist/ui/ink/components/ui/header/index.d.ts +3 -0
- package/dist/ui/ink/components/ui/header/index.d.ts.map +1 -0
- package/dist/ui/ink/components/ui/header/index.js +2 -0
- package/dist/ui/ink/components/ui/header/index.js.map +1 -0
- package/dist/ui/ink/components/ui/json-viewer/JSONViewer.d.ts +14 -0
- package/dist/ui/ink/components/ui/json-viewer/JSONViewer.d.ts.map +1 -0
- package/dist/ui/ink/components/ui/json-viewer/JSONViewer.js +144 -0
- package/dist/ui/ink/components/ui/json-viewer/JSONViewer.js.map +1 -0
- package/dist/ui/ink/components/ui/json-viewer/index.d.ts +3 -0
- package/dist/ui/ink/components/ui/json-viewer/index.d.ts.map +1 -0
- package/dist/ui/ink/components/ui/json-viewer/index.js +2 -0
- package/dist/ui/ink/components/ui/json-viewer/index.js.map +1 -0
- package/dist/ui/ink/components/ui/key-hint/KeyHint.d.ts +14 -0
- package/dist/ui/ink/components/ui/key-hint/KeyHint.d.ts.map +1 -0
- package/dist/ui/ink/components/ui/key-hint/KeyHint.js +5 -0
- package/dist/ui/ink/components/ui/key-hint/KeyHint.js.map +1 -0
- package/dist/ui/ink/components/ui/key-hint/index.d.ts +3 -0
- package/dist/ui/ink/components/ui/key-hint/index.d.ts.map +1 -0
- package/dist/ui/ink/components/ui/key-hint/index.js +2 -0
- package/dist/ui/ink/components/ui/key-hint/index.js.map +1 -0
- package/dist/ui/ink/components/ui/markdown/Markdown.d.ts +11 -0
- package/dist/ui/ink/components/ui/markdown/Markdown.d.ts.map +1 -0
- package/dist/ui/ink/components/ui/markdown/Markdown.js +129 -0
- package/dist/ui/ink/components/ui/markdown/Markdown.js.map +1 -0
- package/dist/ui/ink/components/ui/markdown/index.d.ts +3 -0
- package/dist/ui/ink/components/ui/markdown/index.d.ts.map +1 -0
- package/dist/ui/ink/components/ui/markdown/index.js +2 -0
- package/dist/ui/ink/components/ui/markdown/index.js.map +1 -0
- package/dist/ui/ink/components/ui/scroll-area/ScrollArea.d.ts +21 -0
- package/dist/ui/ink/components/ui/scroll-area/ScrollArea.d.ts.map +1 -0
- package/dist/ui/ink/components/ui/scroll-area/ScrollArea.js +42 -0
- package/dist/ui/ink/components/ui/scroll-area/ScrollArea.js.map +1 -0
- package/dist/ui/ink/components/ui/scroll-area/index.d.ts +3 -0
- package/dist/ui/ink/components/ui/scroll-area/index.d.ts.map +1 -0
- package/dist/ui/ink/components/ui/scroll-area/index.js +2 -0
- package/dist/ui/ink/components/ui/scroll-area/index.js.map +1 -0
- package/dist/ui/ink/components/ui/select/Select.d.ts +19 -0
- package/dist/ui/ink/components/ui/select/Select.d.ts.map +1 -0
- package/dist/ui/ink/components/ui/select/Select.js +73 -0
- package/dist/ui/ink/components/ui/select/Select.js.map +1 -0
- package/dist/ui/ink/components/ui/select/index.d.ts +3 -0
- package/dist/ui/ink/components/ui/select/index.d.ts.map +1 -0
- package/dist/ui/ink/components/ui/select/index.js +2 -0
- package/dist/ui/ink/components/ui/select/index.js.map +1 -0
- package/dist/ui/ink/components/ui/spinner/Spinner.d.ts +14 -0
- package/dist/ui/ink/components/ui/spinner/Spinner.d.ts.map +1 -0
- package/dist/ui/ink/components/ui/spinner/Spinner.js +16 -0
- package/dist/ui/ink/components/ui/spinner/Spinner.js.map +1 -0
- package/dist/ui/ink/components/ui/spinner/index.d.ts +3 -0
- package/dist/ui/ink/components/ui/spinner/index.d.ts.map +1 -0
- package/dist/ui/ink/components/ui/spinner/index.js +2 -0
- package/dist/ui/ink/components/ui/spinner/index.js.map +1 -0
- package/dist/ui/ink/components/ui/status-indicator/StatusIndicator.d.ts +12 -0
- package/dist/ui/ink/components/ui/status-indicator/StatusIndicator.d.ts.map +1 -0
- package/dist/ui/ink/components/ui/status-indicator/StatusIndicator.js +39 -0
- package/dist/ui/ink/components/ui/status-indicator/StatusIndicator.js.map +1 -0
- package/dist/ui/ink/components/ui/status-indicator/index.d.ts +3 -0
- package/dist/ui/ink/components/ui/status-indicator/index.d.ts.map +1 -0
- package/dist/ui/ink/components/ui/status-indicator/index.js +2 -0
- package/dist/ui/ink/components/ui/status-indicator/index.js.map +1 -0
- package/dist/ui/ink/components/ui/streaming-text/StreamingText.d.ts +13 -0
- package/dist/ui/ink/components/ui/streaming-text/StreamingText.d.ts.map +1 -0
- package/dist/ui/ink/components/ui/streaming-text/StreamingText.js +22 -0
- package/dist/ui/ink/components/ui/streaming-text/StreamingText.js.map +1 -0
- package/dist/ui/ink/components/ui/streaming-text/index.d.ts +3 -0
- package/dist/ui/ink/components/ui/streaming-text/index.d.ts.map +1 -0
- package/dist/ui/ink/components/ui/streaming-text/index.js +2 -0
- package/dist/ui/ink/components/ui/streaming-text/index.js.map +1 -0
- package/dist/ui/ink/components/ui/tabs/Tabs.d.ts +20 -0
- package/dist/ui/ink/components/ui/tabs/Tabs.d.ts.map +1 -0
- package/dist/ui/ink/components/ui/tabs/Tabs.js +53 -0
- package/dist/ui/ink/components/ui/tabs/Tabs.js.map +1 -0
- package/dist/ui/ink/components/ui/tabs/index.d.ts +3 -0
- package/dist/ui/ink/components/ui/tabs/index.d.ts.map +1 -0
- package/dist/ui/ink/components/ui/tabs/index.js +2 -0
- package/dist/ui/ink/components/ui/tabs/index.js.map +1 -0
- package/dist/ui/ink/components/ui/text-input/TextInput.d.ts +22 -0
- package/dist/ui/ink/components/ui/text-input/TextInput.d.ts.map +1 -0
- package/dist/ui/ink/components/ui/text-input/TextInput.js +57 -0
- package/dist/ui/ink/components/ui/text-input/TextInput.js.map +1 -0
- package/dist/ui/ink/components/ui/text-input/index.d.ts +3 -0
- package/dist/ui/ink/components/ui/text-input/index.d.ts.map +1 -0
- package/dist/ui/ink/components/ui/text-input/index.js +2 -0
- package/dist/ui/ink/components/ui/text-input/index.js.map +1 -0
- package/dist/ui/ink/components/ui/token-counter/TokenCounter.d.ts +17 -0
- package/dist/ui/ink/components/ui/token-counter/TokenCounter.d.ts.map +1 -0
- package/dist/ui/ink/components/ui/token-counter/TokenCounter.js +38 -0
- package/dist/ui/ink/components/ui/token-counter/TokenCounter.js.map +1 -0
- package/dist/ui/ink/components/ui/token-counter/index.d.ts +3 -0
- package/dist/ui/ink/components/ui/token-counter/index.d.ts.map +1 -0
- package/dist/ui/ink/components/ui/token-counter/index.js +2 -0
- package/dist/ui/ink/components/ui/token-counter/index.js.map +1 -0
- package/dist/ui/ink/components/ui/typewriter/Typewriter.d.ts +14 -0
- package/dist/ui/ink/components/ui/typewriter/Typewriter.d.ts.map +1 -0
- package/dist/ui/ink/components/ui/typewriter/Typewriter.js +57 -0
- package/dist/ui/ink/components/ui/typewriter/Typewriter.js.map +1 -0
- package/dist/ui/ink/components/ui/typewriter/index.d.ts +3 -0
- package/dist/ui/ink/components/ui/typewriter/index.d.ts.map +1 -0
- package/dist/ui/ink/components/ui/typewriter/index.js +2 -0
- package/dist/ui/ink/components/ui/typewriter/index.js.map +1 -0
- package/dist/ui/md-formatter.d.ts +16 -0
- package/dist/ui/md-formatter.d.ts.map +1 -0
- package/dist/ui/md-formatter.js +448 -0
- package/dist/ui/md-formatter.js.map +1 -0
- package/dist/ui/readline-renderer.d.ts +1 -1
- package/dist/ui/readline-renderer.d.ts.map +1 -1
- package/dist/ui/readline-renderer.js +11 -14
- package/dist/ui/readline-renderer.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Базовое TUI окно с рамкой.
|
|
4
|
+
*
|
|
5
|
+
* Использует Ink borderStyle для отображения рамки.
|
|
6
|
+
* Поддерживает различные стили рамок: single, double, bold, round.
|
|
7
|
+
*
|
|
8
|
+
* @module ui/ink/components/Window
|
|
9
|
+
*/
|
|
10
|
+
type BorderStyle = 'single' | 'double' | 'round' | 'bold' | 'singleDouble' | 'doubleSingle' | 'classic';
|
|
11
|
+
interface WindowProps {
|
|
12
|
+
children: React.ReactNode;
|
|
13
|
+
borderStyle?: BorderStyle;
|
|
14
|
+
borderColor?: string;
|
|
15
|
+
width?: number | string;
|
|
16
|
+
height?: number | string;
|
|
17
|
+
padding?: number;
|
|
18
|
+
margin?: number;
|
|
19
|
+
}
|
|
20
|
+
export declare function Window({ children, borderStyle, borderColor, width, height, padding, margin, }: WindowProps): React.JSX.Element;
|
|
21
|
+
/**
|
|
22
|
+
* Окно с заголовком.
|
|
23
|
+
*/
|
|
24
|
+
interface TitledWindowProps extends WindowProps {
|
|
25
|
+
title: string;
|
|
26
|
+
titleColor?: string;
|
|
27
|
+
}
|
|
28
|
+
export declare function TitledWindow({ title, titleColor, children, borderStyle, borderColor, width, height, padding, margin, }: TitledWindowProps): React.JSX.Element;
|
|
29
|
+
export {};
|
|
30
|
+
//# sourceMappingURL=Window.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Window.d.ts","sourceRoot":"","sources":["../../../../src/ui/ink/components/Window.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B;;;;;;;GAOG;AAEH,KAAK,WAAW,GAAG,QAAQ,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,GAAG,cAAc,GAAG,cAAc,GAAG,SAAS,CAAC;AAExG,UAAU,WAAW;IACnB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,MAAM,CAAC,EACrB,QAAQ,EACR,WAAsB,EACtB,WAAmB,EACnB,KAAc,EACd,MAAM,EACN,OAAW,EACX,MAAU,GACX,EAAE,WAAW,qBAcb;AAED;;GAEG;AACH,UAAU,iBAAkB,SAAQ,WAAW;IAC7C,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,wBAAgB,YAAY,CAAC,EAC3B,KAAK,EACL,UAAkB,EAClB,QAAQ,EACR,WAAsB,EACtB,WAAmB,EACnB,KAAc,EACd,MAAM,EACN,OAAW,EACX,MAAU,GACX,EAAE,iBAAiB,qBAkBnB"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Text } from 'ink';
|
|
3
|
+
export function Window({ children, borderStyle = 'single', borderColor = 'dim', width = '100%', height, padding = 1, margin = 0, }) {
|
|
4
|
+
return (_jsx(Box, { borderStyle: borderStyle, borderColor: borderColor, width: width, height: height, padding: padding, margin: margin, flexDirection: "column", children: children }));
|
|
5
|
+
}
|
|
6
|
+
export function TitledWindow({ title, titleColor = 'dim', children, borderStyle = 'single', borderColor = 'dim', width = '100%', height, padding = 1, margin = 0, }) {
|
|
7
|
+
return (_jsxs(Box, { borderStyle: borderStyle, borderColor: borderColor, width: width, height: height, flexDirection: "column", margin: margin, children: [_jsx(Box, { paddingLeft: 1, children: _jsx(Text, { color: titleColor, children: title }) }), _jsx(Box, { padding: padding, flexDirection: "column", children: children })] }));
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=Window.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Window.js","sourceRoot":"","sources":["../../../../src/ui/ink/components/Window.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAuBhC,MAAM,UAAU,MAAM,CAAC,EACrB,QAAQ,EACR,WAAW,GAAG,QAAQ,EACtB,WAAW,GAAG,KAAK,EACnB,KAAK,GAAG,MAAM,EACd,MAAM,EACN,OAAO,GAAG,CAAC,EACX,MAAM,GAAG,CAAC,GACE;IACZ,OAAO,CACL,KAAC,GAAG,IACF,WAAW,EAAE,WAAW,EACxB,WAAW,EAAE,WAAW,EACxB,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,MAAM,EACd,aAAa,EAAC,QAAQ,YAErB,QAAQ,GACL,CACP,CAAC;AACJ,CAAC;AAUD,MAAM,UAAU,YAAY,CAAC,EAC3B,KAAK,EACL,UAAU,GAAG,KAAK,EAClB,QAAQ,EACR,WAAW,GAAG,QAAQ,EACtB,WAAW,GAAG,KAAK,EACnB,KAAK,GAAG,MAAM,EACd,MAAM,EACN,OAAO,GAAG,CAAC,EACX,MAAM,GAAG,CAAC,GACQ;IAClB,OAAO,CACL,MAAC,GAAG,IACF,WAAW,EAAE,WAAW,EACxB,WAAW,EAAE,WAAW,EACxB,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,EACd,aAAa,EAAC,QAAQ,EACtB,MAAM,EAAE,MAAM,aAEd,KAAC,GAAG,IAAC,WAAW,EAAE,CAAC,YACjB,KAAC,IAAI,IAAC,KAAK,EAAE,UAAU,YAAG,KAAK,GAAQ,GACnC,EACN,KAAC,GAAG,IAAC,OAAO,EAAE,OAAO,EAAE,aAAa,EAAC,QAAQ,YAC1C,QAAQ,GACL,IACF,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
export declare const spacing: {
|
|
2
|
+
readonly none: 0;
|
|
3
|
+
readonly xs: 1;
|
|
4
|
+
readonly sm: 1;
|
|
5
|
+
readonly md: 2;
|
|
6
|
+
readonly lg: 3;
|
|
7
|
+
readonly xl: 4;
|
|
8
|
+
};
|
|
9
|
+
export declare const borderStyles: {
|
|
10
|
+
readonly single: {
|
|
11
|
+
readonly topLeft: "┌";
|
|
12
|
+
readonly top: "─";
|
|
13
|
+
readonly topRight: "┐";
|
|
14
|
+
readonly left: "│";
|
|
15
|
+
readonly right: "│";
|
|
16
|
+
readonly bottomLeft: "└";
|
|
17
|
+
readonly bottom: "─";
|
|
18
|
+
readonly bottomRight: "┘";
|
|
19
|
+
readonly topT: "┬";
|
|
20
|
+
readonly bottomT: "┴";
|
|
21
|
+
readonly leftT: "├";
|
|
22
|
+
readonly rightT: "┤";
|
|
23
|
+
readonly cross: "┼";
|
|
24
|
+
};
|
|
25
|
+
readonly double: {
|
|
26
|
+
readonly topLeft: "╔";
|
|
27
|
+
readonly top: "═";
|
|
28
|
+
readonly topRight: "╗";
|
|
29
|
+
readonly left: "║";
|
|
30
|
+
readonly right: "║";
|
|
31
|
+
readonly bottomLeft: "╚";
|
|
32
|
+
readonly bottom: "═";
|
|
33
|
+
readonly bottomRight: "╝";
|
|
34
|
+
readonly topT: "╦";
|
|
35
|
+
readonly bottomT: "╩";
|
|
36
|
+
readonly leftT: "╠";
|
|
37
|
+
readonly rightT: "╣";
|
|
38
|
+
readonly cross: "╬";
|
|
39
|
+
};
|
|
40
|
+
readonly rounded: {
|
|
41
|
+
readonly topLeft: "╭";
|
|
42
|
+
readonly top: "─";
|
|
43
|
+
readonly topRight: "╮";
|
|
44
|
+
readonly left: "│";
|
|
45
|
+
readonly right: "│";
|
|
46
|
+
readonly bottomLeft: "╰";
|
|
47
|
+
readonly bottom: "─";
|
|
48
|
+
readonly bottomRight: "╯";
|
|
49
|
+
readonly topT: "┬";
|
|
50
|
+
readonly bottomT: "┴";
|
|
51
|
+
readonly leftT: "├";
|
|
52
|
+
readonly rightT: "┤";
|
|
53
|
+
readonly cross: "┼";
|
|
54
|
+
};
|
|
55
|
+
readonly bold: {
|
|
56
|
+
readonly topLeft: "┏";
|
|
57
|
+
readonly top: "━";
|
|
58
|
+
readonly topRight: "┓";
|
|
59
|
+
readonly left: "┃";
|
|
60
|
+
readonly right: "┃";
|
|
61
|
+
readonly bottomLeft: "┗";
|
|
62
|
+
readonly bottom: "━";
|
|
63
|
+
readonly bottomRight: "┛";
|
|
64
|
+
readonly topT: "┳";
|
|
65
|
+
readonly bottomT: "┻";
|
|
66
|
+
readonly leftT: "┣";
|
|
67
|
+
readonly rightT: "┫";
|
|
68
|
+
readonly cross: "╋";
|
|
69
|
+
};
|
|
70
|
+
readonly ascii: {
|
|
71
|
+
readonly topLeft: "+";
|
|
72
|
+
readonly top: "-";
|
|
73
|
+
readonly topRight: "+";
|
|
74
|
+
readonly left: "|";
|
|
75
|
+
readonly right: "|";
|
|
76
|
+
readonly bottomLeft: "+";
|
|
77
|
+
readonly bottom: "-";
|
|
78
|
+
readonly bottomRight: "+";
|
|
79
|
+
readonly topT: "+";
|
|
80
|
+
readonly bottomT: "+";
|
|
81
|
+
readonly leftT: "+";
|
|
82
|
+
readonly rightT: "+";
|
|
83
|
+
readonly cross: "+";
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
export type BorderStyle = keyof typeof borderStyles;
|
|
87
|
+
export declare const spinnerFrames: {
|
|
88
|
+
readonly dots: readonly ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"];
|
|
89
|
+
readonly line: readonly ["−", "\\", "|", "/"];
|
|
90
|
+
readonly arc: readonly ["◜", "◠", "◝", "◞", "◡", "◟"];
|
|
91
|
+
readonly bounce: readonly ["⣾", "⣽", "⣻", "⢿", "⡿", "⣟", "⣯", "⣷"];
|
|
92
|
+
};
|
|
93
|
+
export type SpinnerType = keyof typeof spinnerFrames;
|
|
94
|
+
export interface InkUITheme {
|
|
95
|
+
colors: {
|
|
96
|
+
primary: string;
|
|
97
|
+
secondary: string;
|
|
98
|
+
success: string;
|
|
99
|
+
warning: string;
|
|
100
|
+
error: string;
|
|
101
|
+
info: string;
|
|
102
|
+
muted: string;
|
|
103
|
+
text: string;
|
|
104
|
+
textInverse: string;
|
|
105
|
+
border: string;
|
|
106
|
+
focus: string;
|
|
107
|
+
selection: string;
|
|
108
|
+
};
|
|
109
|
+
border: 'single' | 'double' | 'rounded' | 'bold' | 'ascii';
|
|
110
|
+
}
|
|
111
|
+
export declare const darkTheme: InkUITheme;
|
|
112
|
+
export declare const lightTheme: InkUITheme;
|
|
113
|
+
//# sourceMappingURL=_core.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_core.d.ts","sourceRoot":"","sources":["../../../../../src/ui/ink/components/ui/_core.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,OAAO;;;;;;;CAOV,CAAC;AAEX,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+Bf,CAAC;AAEX,MAAM,MAAM,WAAW,GAAG,MAAM,OAAO,YAAY,CAAC;AAEpD,eAAO,MAAM,aAAa;;;;;CAKhB,CAAC;AAEX,MAAM,MAAM,WAAW,GAAG,MAAM,OAAO,aAAa,CAAC;AAGrD,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE;QACN,OAAO,EAAE,MAAM,CAAC;QAChB,SAAS,EAAE,MAAM,CAAC;QAClB,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE,MAAM,CAAC;QAChB,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,EAAE,MAAM,CAAC;QACpB,MAAM,EAAE,MAAM,CAAC;QACf,KAAK,EAAE,MAAM,CAAC;QACd,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;IACF,MAAM,EAAE,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,GAAG,OAAO,CAAC;CAC5D;AAED,eAAO,MAAM,SAAS,EAAE,UAgBvB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,UAgBxB,CAAC"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
// Auto-generated by sync-registry.ts
|
|
2
|
+
// Inlines @inkui-cli/core theme and tokens
|
|
3
|
+
export const spacing = {
|
|
4
|
+
none: 0,
|
|
5
|
+
xs: 1,
|
|
6
|
+
sm: 1,
|
|
7
|
+
md: 2,
|
|
8
|
+
lg: 3,
|
|
9
|
+
xl: 4,
|
|
10
|
+
};
|
|
11
|
+
export const borderStyles = {
|
|
12
|
+
single: {
|
|
13
|
+
topLeft: '┌', top: '─', topRight: '┐',
|
|
14
|
+
left: '│', right: '│',
|
|
15
|
+
bottomLeft: '└', bottom: '─', bottomRight: '┘',
|
|
16
|
+
topT: '┬', bottomT: '┴', leftT: '├', rightT: '┤', cross: '┼',
|
|
17
|
+
},
|
|
18
|
+
double: {
|
|
19
|
+
topLeft: '╔', top: '═', topRight: '╗',
|
|
20
|
+
left: '║', right: '║',
|
|
21
|
+
bottomLeft: '╚', bottom: '═', bottomRight: '╝',
|
|
22
|
+
topT: '╦', bottomT: '╩', leftT: '╠', rightT: '╣', cross: '╬',
|
|
23
|
+
},
|
|
24
|
+
rounded: {
|
|
25
|
+
topLeft: '╭', top: '─', topRight: '╮',
|
|
26
|
+
left: '│', right: '│',
|
|
27
|
+
bottomLeft: '╰', bottom: '─', bottomRight: '╯',
|
|
28
|
+
topT: '┬', bottomT: '┴', leftT: '├', rightT: '┤', cross: '┼',
|
|
29
|
+
},
|
|
30
|
+
bold: {
|
|
31
|
+
topLeft: '┏', top: '━', topRight: '┓',
|
|
32
|
+
left: '┃', right: '┃',
|
|
33
|
+
bottomLeft: '┗', bottom: '━', bottomRight: '┛',
|
|
34
|
+
topT: '┳', bottomT: '┻', leftT: '┣', rightT: '┫', cross: '╋',
|
|
35
|
+
},
|
|
36
|
+
ascii: {
|
|
37
|
+
topLeft: '+', top: '-', topRight: '+',
|
|
38
|
+
left: '|', right: '|',
|
|
39
|
+
bottomLeft: '+', bottom: '-', bottomRight: '+',
|
|
40
|
+
topT: '+', bottomT: '+', leftT: '+', rightT: '+', cross: '+',
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
export const spinnerFrames = {
|
|
44
|
+
dots: ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏'],
|
|
45
|
+
line: ['−', '\\', '|', '/'],
|
|
46
|
+
arc: ['◜', '◠', '◝', '◞', '◡', '◟'],
|
|
47
|
+
bounce: ['⣾', '⣽', '⣻', '⢿', '⡿', '⣟', '⣯', '⣷'],
|
|
48
|
+
};
|
|
49
|
+
export const darkTheme = {
|
|
50
|
+
colors: {
|
|
51
|
+
primary: 'cyan',
|
|
52
|
+
secondary: 'magenta',
|
|
53
|
+
success: 'green',
|
|
54
|
+
warning: 'yellow',
|
|
55
|
+
error: 'red',
|
|
56
|
+
info: 'blue',
|
|
57
|
+
muted: 'gray',
|
|
58
|
+
text: 'white',
|
|
59
|
+
textInverse: 'black',
|
|
60
|
+
border: 'gray',
|
|
61
|
+
focus: 'cyan',
|
|
62
|
+
selection: 'blue',
|
|
63
|
+
},
|
|
64
|
+
border: 'single',
|
|
65
|
+
};
|
|
66
|
+
export const lightTheme = {
|
|
67
|
+
colors: {
|
|
68
|
+
primary: 'blue',
|
|
69
|
+
secondary: 'magenta',
|
|
70
|
+
success: 'green',
|
|
71
|
+
warning: 'yellow',
|
|
72
|
+
error: 'red',
|
|
73
|
+
info: 'cyan',
|
|
74
|
+
muted: 'gray',
|
|
75
|
+
text: 'black',
|
|
76
|
+
textInverse: 'white',
|
|
77
|
+
border: 'gray',
|
|
78
|
+
focus: 'blue',
|
|
79
|
+
selection: 'cyan',
|
|
80
|
+
},
|
|
81
|
+
border: 'rounded',
|
|
82
|
+
};
|
|
83
|
+
//# sourceMappingURL=_core.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_core.js","sourceRoot":"","sources":["../../../../../src/ui/ink/components/ui/_core.ts"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,2CAA2C;AAE3C,MAAM,CAAC,MAAM,OAAO,GAAG;IACrB,IAAI,EAAE,CAAC;IACP,EAAE,EAAE,CAAC;IACL,EAAE,EAAE,CAAC;IACL,EAAE,EAAE,CAAC;IACL,EAAE,EAAE,CAAC;IACL,EAAE,EAAE,CAAC;CACG,CAAC;AAEX,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,MAAM,EAAE;QACN,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG;QACrC,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG;QACrB,UAAU,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,WAAW,EAAE,GAAG;QAC9C,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG;KAC7D;IACD,MAAM,EAAE;QACN,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG;QACrC,IAAI,EAAE,GAAG,EAAE,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EAAE,SAAS;CAClB,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { InkUITheme } from '../_core.js';
|
|
3
|
+
export interface AutocompleteItem<T = string> {
|
|
4
|
+
label: string;
|
|
5
|
+
value: T;
|
|
6
|
+
description?: string;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface AutocompleteProps<T = string> {
|
|
10
|
+
items: AutocompleteItem<T>[];
|
|
11
|
+
onSelect: (item: AutocompleteItem<T>) => void;
|
|
12
|
+
placeholder?: string;
|
|
13
|
+
label?: string;
|
|
14
|
+
maxVisible?: number;
|
|
15
|
+
filter?: (query: string, item: AutocompleteItem<T>) => boolean;
|
|
16
|
+
showDescriptions?: boolean;
|
|
17
|
+
emptyMessage?: string;
|
|
18
|
+
focus?: boolean;
|
|
19
|
+
theme?: InkUITheme;
|
|
20
|
+
defaultQuery?: string;
|
|
21
|
+
}
|
|
22
|
+
export declare function Autocomplete<T = string>({ items, onSelect, placeholder, label, maxVisible, filter, showDescriptions, emptyMessage, focus, theme, defaultQuery, }: AutocompleteProps<T>): React.ReactElement;
|
|
23
|
+
//# sourceMappingURL=Autocomplete.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Autocomplete.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/ink/components/ui/autocomplete/Autocomplete.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAGxC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C,MAAM,WAAW,gBAAgB,CAAC,CAAC,GAAG,MAAM;IAC1C,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,CAAC,CAAC;IACT,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,iBAAiB,CAAC,CAAC,GAAG,MAAM;IAC3C,KAAK,EAAE,gBAAgB,CAAC,CAAC,CAAC,EAAE,CAAC;IAC7B,QAAQ,EAAE,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC;IAC9C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAgB,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC;IAC/D,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,wBAAgB,YAAY,CAAC,CAAC,GAAG,MAAM,EAAE,EACvC,KAAK,EACL,QAAQ,EACR,WAAyB,EACzB,KAAK,EACL,UAAc,EACd,MAAM,EACN,gBAAuB,EACvB,YAA2B,EAC3B,KAAY,EACZ,KAAiB,EACjB,YAAiB,GAClB,EAAE,iBAAiB,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,YAAY,CAwF3C"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { Box, Text, useInput } from 'ink';
|
|
4
|
+
import { darkTheme } from '../_core.js';
|
|
5
|
+
export function Autocomplete({ items, onSelect, placeholder = 'Search...', label, maxVisible = 5, filter, showDescriptions = true, emptyMessage = 'No matches', focus = true, theme = darkTheme, defaultQuery = '', }) {
|
|
6
|
+
const [query, setQuery] = useState(defaultQuery);
|
|
7
|
+
const [highlightIndex, setHighlightIndex] = useState(0);
|
|
8
|
+
const defaultFilter = (q, item) => item.label.toLowerCase().includes(q.toLowerCase());
|
|
9
|
+
const filterFn = filter ?? defaultFilter;
|
|
10
|
+
const filtered = items.filter((item) => !item.disabled && (query === '' || filterFn(query, item)));
|
|
11
|
+
const visible = filtered.slice(0, maxVisible);
|
|
12
|
+
useInput((input, key) => {
|
|
13
|
+
if (key.escape) {
|
|
14
|
+
setQuery('');
|
|
15
|
+
setHighlightIndex(0);
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
if (key.upArrow) {
|
|
19
|
+
setHighlightIndex((i) => Math.max(0, i - 1));
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
if (key.downArrow) {
|
|
23
|
+
setHighlightIndex((i) => Math.min(visible.length - 1, i + 1));
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
if (key.return) {
|
|
27
|
+
const item = visible[highlightIndex];
|
|
28
|
+
if (item) {
|
|
29
|
+
onSelect(item);
|
|
30
|
+
setQuery('');
|
|
31
|
+
setHighlightIndex(0);
|
|
32
|
+
}
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
if (key.tab) {
|
|
36
|
+
const item = visible[highlightIndex];
|
|
37
|
+
if (item)
|
|
38
|
+
setQuery(item.label);
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
if (key.backspace || key.delete) {
|
|
42
|
+
setQuery((q) => q.slice(0, -1));
|
|
43
|
+
setHighlightIndex(0);
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
if (input && input.length === 1 && !key.ctrl && !key.meta) {
|
|
47
|
+
setQuery((q) => q + input);
|
|
48
|
+
setHighlightIndex(0);
|
|
49
|
+
}
|
|
50
|
+
}, { isActive: focus });
|
|
51
|
+
return (_jsxs(Box, { flexDirection: "column", children: [_jsxs(Box, { children: [label && _jsxs(Text, { color: theme.colors.muted, children: [label, " "] }), _jsx(Text, { color: theme.colors.primary, children: "\u276F " }), _jsx(Text, { color: theme.colors.text, children: query || _jsx(Text, { color: theme.colors.muted, children: placeholder }) }), focus && _jsx(Text, { color: theme.colors.primary, children: "\u2588" })] }), focus && (_jsx(Box, { flexDirection: "column", borderStyle: "single", borderColor: theme.colors.border, marginLeft: 2, children: visible.length === 0 ? (_jsx(Box, { paddingX: 1, children: _jsx(Text, { color: theme.colors.muted, children: emptyMessage }) })) : (visible.map((item, i) => {
|
|
52
|
+
const isHl = i === highlightIndex;
|
|
53
|
+
return (_jsxs(Box, { paddingX: 1, flexDirection: "row", gap: 1, children: [_jsx(Text, { color: isHl ? theme.colors.primary : theme.colors.muted, children: isHl ? '❯' : ' ' }), _jsx(Text, { bold: isHl, color: isHl ? theme.colors.primary : theme.colors.text, children: item.label }), showDescriptions && item.description && (_jsx(Text, { color: theme.colors.muted, children: item.description }))] }, String(item.value)));
|
|
54
|
+
})) }))] }));
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=Autocomplete.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Autocomplete.js","sourceRoot":"","sources":["../../../../../../src/ui/ink/components/ui/autocomplete/Autocomplete.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAwBxC,MAAM,UAAU,YAAY,CAAa,EACvC,KAAK,EACL,QAAQ,EACR,WAAW,GAAG,WAAW,EACzB,KAAK,EACL,UAAU,GAAG,CAAC,EACd,MAAM,EACN,gBAAgB,GAAG,IAAI,EACvB,YAAY,GAAG,YAAY,EAC3B,KAAK,GAAG,IAAI,EACZ,KAAK,GAAG,SAAS,EACjB,YAAY,GAAG,EAAE,GACI;IACrB,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAC,YAAY,CAAC,CAAC;IACjD,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAG,QAAQ,CA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,CAAC,MAAM,CAAC,KAAK,YAAG,IAAI,CAAC,WAAW,GAAQ,CAC3D,KAPO,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAQtB,CACP,CAAC;gBACJ,CAAC,CAAC,CACH,GACG,CACP,IACG,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/ink/components/ui/autocomplete/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,YAAY,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/ui/ink/components/ui/autocomplete/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { InkUITheme } from '../_core.js';
|
|
3
|
+
export type BadgeVariant = 'default' | 'success' | 'warning' | 'error' | 'info';
|
|
4
|
+
export interface BadgeProps {
|
|
5
|
+
/** Badge label text */
|
|
6
|
+
children: string;
|
|
7
|
+
/** Visual style — maps to theme colors */
|
|
8
|
+
variant?: BadgeVariant;
|
|
9
|
+
/** Theme override — defaults to darkTheme */
|
|
10
|
+
theme?: InkUITheme;
|
|
11
|
+
}
|
|
12
|
+
export declare const Badge: React.FC<BadgeProps>;
|
|
13
|
+
//# sourceMappingURL=Badge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Badge.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/ink/components/ui/badge/Badge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,CAAC;AAEhF,MAAM,WAAW,UAAU;IACzB,uBAAuB;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,0CAA0C;IAC1C,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,6CAA6C;IAC7C,KAAK,CAAC,EAAE,UAAU,CAAC;CACpB;AAYD,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,UAAU,CAWtC,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Text, Box } from 'ink';
|
|
3
|
+
import { darkTheme } from '../_core.js';
|
|
4
|
+
function variantColor(variant, theme) {
|
|
5
|
+
switch (variant) {
|
|
6
|
+
case 'success': return theme.colors.success;
|
|
7
|
+
case 'warning': return theme.colors.warning;
|
|
8
|
+
case 'error': return theme.colors.error;
|
|
9
|
+
case 'info': return theme.colors.info;
|
|
10
|
+
default: return theme.colors.muted;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
export const Badge = ({ children, variant = 'default', theme = darkTheme, }) => {
|
|
14
|
+
const color = variantColor(variant, theme);
|
|
15
|
+
return (_jsx(Box, { children: _jsx(Text, { color: color, bold: true, inverse: true, children: ` ${children} ` }) }));
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=Badge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Badge.js","sourceRoot":"","sources":["../../../../../../src/ui/ink/components/ui/badge/Badge.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAcxC,SAAS,YAAY,CAAC,OAAqB,EAAE,KAAiB;IAC5D,QAAQ,OAAO,EAAE,CAAC;QAChB,KAAK,SAAS,CAAC,CAAC,OAAO,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC;QAC5C,KAAK,SAAS,CAAC,CAAC,OAAO,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC;QAC5C,KAAK,OAAO,CAAC,CAAG,OAAO,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC;QAC1C,KAAK,MAAM,CAAC,CAAI,OAAO,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC;QACzC,OAAO,CAAC,CAAQ,OAAO,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC;IAC5C,CAAC;AACH,CAAC;AAED,MAAM,CAAC,MAAM,KAAK,GAAyB,CAAC,EAC1C,QAAQ,EACR,OAAO,GAAG,SAAS,EACnB,KAAK,GAAG,SAAS,GAClB,EAAE,EAAE;IACH,MAAM,KAAK,GAAG,YAAY,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IAC3C,OAAO,CACL,KAAC,GAAG,cACF,KAAC,IAAI,IAAC,KAAK,EAAE,KAAK,EAAE,IAAI,QAAC,OAAO,kBAAE,IAAI,QAAQ,GAAG,GAAQ,GACrD,CACP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/ink/components/ui/badge/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC3D,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/ui/ink/components/ui/badge/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { InkUITheme } from '../_core.js';
|
|
3
|
+
export type DividerStyle = 'single' | 'double' | 'dashed' | 'bold';
|
|
4
|
+
export interface DividerProps {
|
|
5
|
+
title?: string;
|
|
6
|
+
style?: DividerStyle;
|
|
7
|
+
/** Defaults to terminal width */
|
|
8
|
+
width?: number;
|
|
9
|
+
theme?: InkUITheme;
|
|
10
|
+
}
|
|
11
|
+
export declare const Divider: React.FC<DividerProps>;
|
|
12
|
+
//# sourceMappingURL=Divider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Divider.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/ink/components/ui/divider/Divider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,GAAG,MAAM,CAAC;AAEnE,MAAM,WAAW,YAAY;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB,iCAAiC;IACjC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,UAAU,CAAC;CACpB;AASD,eAAO,MAAM,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CA2B1C,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Text, Box, useStdout } from 'ink';
|
|
3
|
+
import { darkTheme } from '../_core.js';
|
|
4
|
+
const CHARS = {
|
|
5
|
+
single: '─',
|
|
6
|
+
double: '═',
|
|
7
|
+
dashed: '╌',
|
|
8
|
+
bold: '━',
|
|
9
|
+
};
|
|
10
|
+
export const Divider = ({ title, style = 'single', width, theme = darkTheme, }) => {
|
|
11
|
+
const { stdout } = useStdout();
|
|
12
|
+
const totalWidth = width ?? (stdout?.columns ?? 80);
|
|
13
|
+
const char = CHARS[style];
|
|
14
|
+
let line;
|
|
15
|
+
if (title) {
|
|
16
|
+
// ── Title ───────────────────────
|
|
17
|
+
const prefix = char + char + ' ';
|
|
18
|
+
const suffix = ' ';
|
|
19
|
+
const remaining = totalWidth - prefix.length - title.length - suffix.length;
|
|
20
|
+
line = prefix + title + suffix + char.repeat(Math.max(0, remaining));
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
line = char.repeat(totalWidth);
|
|
24
|
+
}
|
|
25
|
+
return (_jsx(Box, { children: _jsx(Text, { color: theme.colors.border, children: line }) }));
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=Divider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Divider.js","sourceRoot":"","sources":["../../../../../../src/ui/ink/components/ui/divider/Divider.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAaxC,MAAM,KAAK,GAAiC;IAC1C,MAAM,EAAE,GAAG;IACX,MAAM,EAAE,GAAG;IACX,MAAM,EAAE,GAAG;IACX,IAAI,EAAI,GAAG;CACZ,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAA2B,CAAC,EAC9C,KAAK,EACL,KAAK,GAAG,QAAQ,EAChB,KAAK,EACL,KAAK,GAAG,SAAS,GAClB,EAAE,EAAE;IACH,MAAM,EAAE,MAAM,EAAE,GAAG,SAAS,EAAE,CAAC;IAC/B,MAAM,UAAU,GAAG,KAAK,IAAI,CAAC,MAAM,EAAE,OAAO,IAAI,EAAE,CAAC,CAAC;IACpD,MAAM,IAAI,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC;IAE1B,IAAI,IAAY,CAAC;IAEjB,IAAI,KAAK,EAAE,CAAC;QACV,mCAAmC;QACnC,MAAM,MAAM,GAAG,IAAI,GAAG,IAAI,GAAG,GAAG,CAAC;QACjC,MAAM,MAAM,GAAG,GAAG,CAAC;QACnB,MAAM,SAAS,GAAG,UAAU,GAAG,MAAM,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;QAC5E,IAAI,GAAG,MAAM,GAAG,KAAK,GAAG,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC;IACvE,CAAC;SAAM,CAAC;QACN,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;IACjC,CAAC;IAED,OAAO,CACL,KAAC,GAAG,cACF,KAAC,IAAI,IAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,YAAG,IAAI,GAAQ,GAC3C,CACP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/ink/components/ui/divider/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC/D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/ui/ink/components/ui/divider/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { InkUITheme } from '../_core.js';
|
|
3
|
+
export type HeaderStyle = 'box' | 'line' | 'filled';
|
|
4
|
+
export interface HeaderProps {
|
|
5
|
+
title: string;
|
|
6
|
+
version?: string;
|
|
7
|
+
subtitle?: string;
|
|
8
|
+
style?: HeaderStyle;
|
|
9
|
+
align?: 'left' | 'center';
|
|
10
|
+
theme?: InkUITheme;
|
|
11
|
+
}
|
|
12
|
+
export declare const Header: React.FC<HeaderProps>;
|
|
13
|
+
//# sourceMappingURL=Header.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Header.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/ink/components/ui/header/Header.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C,MAAM,MAAM,WAAW,GAAG,KAAK,GAAG,MAAM,GAAG,QAAQ,CAAC;AAEpD,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAC;IAC1B,KAAK,CAAC,EAAE,UAAU,CAAC;CACpB;AAED,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CA6DxC,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Text, Box, useStdout } from 'ink';
|
|
3
|
+
import { darkTheme } from '../_core.js';
|
|
4
|
+
export const Header = ({ title, version, subtitle, style = 'box', align = 'left', theme = darkTheme, }) => {
|
|
5
|
+
const { stdout } = useStdout();
|
|
6
|
+
const w = stdout?.columns ?? 80;
|
|
7
|
+
const fullTitle = version ? `${title} v${version}` : title;
|
|
8
|
+
if (style === 'box') {
|
|
9
|
+
// ┌─── MyApp v1.0 ──────────────────┐
|
|
10
|
+
const inner = w - 2; // exclude ┌ and ┐
|
|
11
|
+
const label = ` ${fullTitle} `;
|
|
12
|
+
const left = 3; // ─── before label
|
|
13
|
+
const right = Math.max(0, inner - left - label.length);
|
|
14
|
+
const top = '┌' + '─'.repeat(left) + label + '─'.repeat(right) + '┐';
|
|
15
|
+
const bot = '└' + '─'.repeat(inner) + '┘';
|
|
16
|
+
return (_jsxs(Box, { flexDirection: "column", children: [_jsx(Text, { color: theme.colors.primary, children: top }), subtitle && (_jsxs(Text, { color: theme.colors.primary, children: ['│', " ", _jsx(Text, { color: theme.colors.muted, children: subtitle.padEnd(inner - 2) }), " ", '│'] })), _jsx(Text, { color: theme.colors.primary, children: bot })] }));
|
|
17
|
+
}
|
|
18
|
+
if (style === 'line') {
|
|
19
|
+
// ══ MyApp v1.0 ════════════════════
|
|
20
|
+
const label = ` ${fullTitle} `;
|
|
21
|
+
const pre = '══';
|
|
22
|
+
const remaining = Math.max(0, w - pre.length - label.length);
|
|
23
|
+
const line = pre + label + '═'.repeat(remaining);
|
|
24
|
+
return (_jsxs(Box, { flexDirection: "column", children: [_jsx(Text, { color: theme.colors.primary, children: line }), subtitle && _jsxs(Text, { color: theme.colors.muted, children: [" ", subtitle] })] }));
|
|
25
|
+
}
|
|
26
|
+
// filled: ███ MyApp v1.0 ████████████
|
|
27
|
+
const label = ` ${fullTitle} `;
|
|
28
|
+
const pre = '██ ';
|
|
29
|
+
const remaining = Math.max(0, w - pre.length - label.length);
|
|
30
|
+
const line = pre + label + '█'.repeat(remaining);
|
|
31
|
+
return (_jsxs(Box, { flexDirection: "column", children: [_jsx(Text, { color: theme.colors.primary, children: line }), subtitle && _jsxs(Text, { color: theme.colors.muted, children: [" ", subtitle] })] }));
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=Header.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Header.js","sourceRoot":"","sources":["../../../../../../src/ui/ink/components/ui/header/Header.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAcxC,MAAM,CAAC,MAAM,MAAM,GAA0B,CAAC,EAC5C,KA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AAM,CAAC,OAAO,YAAG,IAAI,GAAQ,EAC/C,QAAQ,IAAI,MAAC,IAAI,IAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,KAAK,qBAAO,QAAQ,IAAQ,IAC/D,CACP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/ink/components/ui/header/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/ui/ink/components/ui/header/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { InkUITheme } from '../_core.js';
|
|
3
|
+
export interface JSONViewerProps {
|
|
4
|
+
data: any;
|
|
5
|
+
initialDepth?: number;
|
|
6
|
+
maxHeight?: number;
|
|
7
|
+
showTypes?: boolean;
|
|
8
|
+
showIndices?: boolean;
|
|
9
|
+
rootLabel?: string;
|
|
10
|
+
focus?: boolean;
|
|
11
|
+
theme?: InkUITheme;
|
|
12
|
+
}
|
|
13
|
+
export declare const JSONViewer: React.FC<JSONViewerProps>;
|
|
14
|
+
//# sourceMappingURL=JSONViewer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"JSONViewer.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/ink/components/ui/json-viewer/JSONViewer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2C,MAAM,OAAO,CAAC;AAGhE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,GAAG,CAAC;IACV,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,KAAK,CAAC,EAAE,UAAU,CAAC;CACpB;AAkED,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAkHhD,CAAC"}
|