@runtypelabs/ink-components 0.3.12 → 0.3.14
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/index.d.ts +0 -12
- package/dist/index.js +5 -10
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import InkSpinner from "ink-spinner";
|
|
2
2
|
import { ComponentProps, ReactNode } from "react";
|
|
3
|
-
//#region src/components/Spinner.d.ts
|
|
4
3
|
type InkSpinnerType = ComponentProps<typeof InkSpinner>['type'];
|
|
5
4
|
interface SpinnerProps {
|
|
6
5
|
label?: string;
|
|
@@ -8,16 +7,12 @@ interface SpinnerProps {
|
|
|
8
7
|
type?: InkSpinnerType;
|
|
9
8
|
}
|
|
10
9
|
export declare function Spinner({ label, color, type }: SpinnerProps): import("react").JSX.Element;
|
|
11
|
-
//#endregion
|
|
12
|
-
//#region src/components/StatusBar.d.ts
|
|
13
10
|
interface StatusBarProps {
|
|
14
11
|
left?: ReactNode;
|
|
15
12
|
center?: string;
|
|
16
13
|
right?: string;
|
|
17
14
|
}
|
|
18
15
|
export declare function StatusBar({ left, center, right }: StatusBarProps): import("react").JSX.Element;
|
|
19
|
-
//#endregion
|
|
20
|
-
//#region src/components/StreamOutput.d.ts
|
|
21
16
|
interface StreamOutputProps {
|
|
22
17
|
content: string;
|
|
23
18
|
isStreaming: boolean;
|
|
@@ -32,15 +27,11 @@ interface StreamOutputProps {
|
|
|
32
27
|
*/
|
|
33
28
|
export declare function renderMarkdownToTerminal(content: string): string;
|
|
34
29
|
export declare const StreamOutput: import("react").MemoExoticComponent<({ content, isStreaming, enableMarkdown, maxVisibleLines, scrollOffset }: StreamOutputProps) => import("react").JSX.Element>;
|
|
35
|
-
//#endregion
|
|
36
|
-
//#region src/components/ErrorDisplay.d.ts
|
|
37
30
|
interface ErrorDisplayProps {
|
|
38
31
|
error: Error | string;
|
|
39
32
|
context?: string;
|
|
40
33
|
}
|
|
41
34
|
export declare function ErrorDisplay({ error, context }: ErrorDisplayProps): import("react").JSX.Element;
|
|
42
|
-
//#endregion
|
|
43
|
-
//#region src/theme.d.ts
|
|
44
35
|
export declare const theme: {
|
|
45
36
|
readonly backgroundDeep: '#000000';
|
|
46
37
|
readonly background: '#1b212b';
|
|
@@ -73,14 +64,11 @@ export declare const theme: {
|
|
|
73
64
|
readonly panelPaddingY: 0;
|
|
74
65
|
};
|
|
75
66
|
type Theme = typeof theme;
|
|
76
|
-
//#endregion
|
|
77
|
-
//#region src/types.d.ts
|
|
78
67
|
type StreamPhase = 'idle' | 'thinking' | 'streaming' | 'tool' | 'complete' | 'error';
|
|
79
68
|
interface ToolResult {
|
|
80
69
|
name: string;
|
|
81
70
|
status: 'running' | 'complete' | 'error';
|
|
82
71
|
duration?: number;
|
|
83
72
|
}
|
|
84
|
-
//#endregion
|
|
85
73
|
export type { ErrorDisplayProps, SpinnerProps, StatusBarProps, StreamOutputProps, StreamPhase, Theme, ToolResult };
|
|
86
74
|
export {}
|
package/dist/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import chalk from "chalk";
|
|
|
6
6
|
import { marked } from "marked";
|
|
7
7
|
import { markedTerminal } from "marked-terminal";
|
|
8
8
|
import stripAnsi from "strip-ansi";
|
|
9
|
-
|
|
9
|
+
// src/theme.ts
|
|
10
10
|
const theme = {
|
|
11
11
|
backgroundDeep: "#000000",
|
|
12
12
|
background: "#1b212b",
|
|
@@ -38,8 +38,7 @@ const theme = {
|
|
|
38
38
|
panelPaddingX: 1,
|
|
39
39
|
panelPaddingY: 0
|
|
40
40
|
};
|
|
41
|
-
|
|
42
|
-
//#region src/components/Spinner.tsx
|
|
41
|
+
// src/components/Spinner.tsx
|
|
43
42
|
function Spinner({ label = "Loading...", color = theme.spinner, type = "dots" }) {
|
|
44
43
|
return /* @__PURE__ */ jsxs(Box, { children: [/* @__PURE__ */ jsx(Text, {
|
|
45
44
|
color,
|
|
@@ -49,8 +48,7 @@ function Spinner({ label = "Loading...", color = theme.spinner, type = "dots" })
|
|
|
49
48
|
children: [" ", label]
|
|
50
49
|
})] });
|
|
51
50
|
}
|
|
52
|
-
|
|
53
|
-
//#region src/components/StatusBar.tsx
|
|
51
|
+
// src/components/StatusBar.tsx
|
|
54
52
|
function StatusBar({ left, center, right }) {
|
|
55
53
|
return /* @__PURE__ */ jsxs(Box, {
|
|
56
54
|
borderStyle: "single",
|
|
@@ -81,8 +79,7 @@ function StatusBar({ left, center, right }) {
|
|
|
81
79
|
]
|
|
82
80
|
});
|
|
83
81
|
}
|
|
84
|
-
|
|
85
|
-
//#region src/components/StreamOutput.tsx
|
|
82
|
+
// src/components/StreamOutput.tsx
|
|
86
83
|
const bodyText = chalk.hex(theme.text);
|
|
87
84
|
const mutedText = chalk.hex(theme.textMuted);
|
|
88
85
|
const subtleText = chalk.hex(theme.textSubtle);
|
|
@@ -190,8 +187,7 @@ const StreamOutput = memo(function StreamOutput({ content, isStreaming, enableMa
|
|
|
190
187
|
}) })]
|
|
191
188
|
});
|
|
192
189
|
});
|
|
193
|
-
|
|
194
|
-
//#region src/components/ErrorDisplay.tsx
|
|
190
|
+
// src/components/ErrorDisplay.tsx
|
|
195
191
|
function ErrorDisplay({ error, context }) {
|
|
196
192
|
const message = error instanceof Error ? error.message : error;
|
|
197
193
|
const cause = error instanceof Error && error.cause ? String(error.cause) : void 0;
|
|
@@ -213,6 +209,5 @@ function ErrorDisplay({ error, context }) {
|
|
|
213
209
|
})]
|
|
214
210
|
});
|
|
215
211
|
}
|
|
216
|
-
//#endregion
|
|
217
212
|
export { ErrorDisplay, Spinner, StatusBar, StreamOutput, renderMarkdownToTerminal, theme };
|
|
218
213
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@runtypelabs/ink-components",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.14",
|
|
4
4
|
"description": "Shared Ink (React for CLI) components for the Runtype CLI — spinners, status bars, streaming output, and error displays.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Runtype",
|
|
@@ -29,9 +29,9 @@
|
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@types/react": "^19.2.18",
|
|
31
31
|
"ink-testing-library": "4.0.0",
|
|
32
|
-
"tsdown": "^0.23.
|
|
32
|
+
"tsdown": "^0.23.2",
|
|
33
33
|
"typescript": "^6.0.3",
|
|
34
|
-
"vitest": "^5.0.
|
|
34
|
+
"vitest": "^5.0.5"
|
|
35
35
|
},
|
|
36
36
|
"keywords": [
|
|
37
37
|
"runtype",
|