@lantos1618/better-ui 0.3.1 → 0.4.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/README.md +217 -116
- package/dist/ThemeProvider-BYeqWMsn.d.mts +187 -0
- package/dist/ThemeProvider-BaVZaDBO.d.ts +187 -0
- package/dist/auth/index.d.mts +56 -0
- package/dist/auth/index.d.ts +56 -0
- package/dist/auth/index.js +104 -0
- package/dist/auth/index.mjs +67 -0
- package/dist/chunk-Y6FXYEAI.mjs +10 -0
- package/dist/components/index.d.mts +258 -0
- package/dist/components/index.d.ts +258 -0
- package/dist/components/index.js +1977 -0
- package/dist/components/index.mjs +1922 -0
- package/dist/index.d.mts +57 -296
- package/dist/index.d.ts +57 -296
- package/dist/index.js +243 -178
- package/dist/index.mjs +241 -175
- package/dist/persistence/index.d.mts +11 -0
- package/dist/persistence/index.d.ts +11 -0
- package/dist/persistence/index.js +66 -0
- package/dist/persistence/index.mjs +41 -0
- package/dist/react/index.d.mts +91 -0
- package/dist/react/index.d.ts +91 -0
- package/dist/react/index.js +284 -0
- package/dist/react/index.mjs +257 -0
- package/dist/tool-Ca2x-VNK.d.mts +361 -0
- package/dist/tool-Ca2x-VNK.d.ts +361 -0
- package/dist/types-CAOfGUPH.d.mts +31 -0
- package/dist/types-CAOfGUPH.d.ts +31 -0
- package/package.json +42 -20
- package/src/theme.css +101 -0
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
import { f as ToolStateStore, g as ToolStateEntry } from '../ThemeProvider-BYeqWMsn.mjs';
|
|
2
|
+
export { m as Chat, d as ChatProps, h as ChatProvider, C as ChatProviderProps, k as Composer, b as ComposerProps, j as Message, M as MessageProps, p as ThemeProvider, e as ThemeProviderProps, i as Thread, a as ThreadProps, T as ToolPartInfo, l as ToolResult, c as ToolResultProps, n as createToolStateStore, u as useChatContext, o as useToolState } from '../ThemeProvider-BYeqWMsn.mjs';
|
|
3
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
|
+
import { T as Tool } from '../tool-Ca2x-VNK.mjs';
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import 'ai';
|
|
7
|
+
import '../types-CAOfGUPH.mjs';
|
|
8
|
+
import 'zod';
|
|
9
|
+
|
|
10
|
+
interface MarkdownProps {
|
|
11
|
+
content: string;
|
|
12
|
+
className?: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Renders markdown content with GFM support, styled code blocks, and a copy button.
|
|
16
|
+
*/
|
|
17
|
+
declare function Markdown({ content, className }: MarkdownProps): react_jsx_runtime.JSX.Element;
|
|
18
|
+
|
|
19
|
+
interface PanelProps {
|
|
20
|
+
toolStateStore: ToolStateStore;
|
|
21
|
+
tools: Record<string, Tool>;
|
|
22
|
+
getOnAction: (toolCallId: string, toolName: string) => (input: Record<string, unknown>) => void;
|
|
23
|
+
className?: string;
|
|
24
|
+
/** When set, only show output from this specific tool name */
|
|
25
|
+
tool?: string;
|
|
26
|
+
/** Tool names to exclude from selection */
|
|
27
|
+
excludeTools?: string[];
|
|
28
|
+
/** Maximum number of items to display (default 5) */
|
|
29
|
+
maxItems?: number;
|
|
30
|
+
}
|
|
31
|
+
declare function Panel({ toolStateStore, tools, getOnAction, className, tool: filterTool, excludeTools, maxItems }: PanelProps): react_jsx_runtime.JSX.Element;
|
|
32
|
+
declare function ChatPanel({ className, tool, excludeTools, maxItems }: {
|
|
33
|
+
className?: string;
|
|
34
|
+
tool?: string;
|
|
35
|
+
excludeTools?: string[];
|
|
36
|
+
maxItems?: number;
|
|
37
|
+
}): react_jsx_runtime.JSX.Element;
|
|
38
|
+
|
|
39
|
+
type ToolEffectCallback = (entry: ToolStateEntry, toolCallId: string) => void;
|
|
40
|
+
/**
|
|
41
|
+
* Subscribe to tool state changes and fire a callback when a specific tool produces output.
|
|
42
|
+
* Only fires once per version to prevent duplicate callbacks.
|
|
43
|
+
*/
|
|
44
|
+
declare function useToolEffect(store: ToolStateStore, toolName: string, callback: ToolEffectCallback): void;
|
|
45
|
+
|
|
46
|
+
interface ToolOutputResult<T = unknown> {
|
|
47
|
+
data: T | null;
|
|
48
|
+
loading: boolean;
|
|
49
|
+
error: string | null;
|
|
50
|
+
toolCallId: string | null;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Subscribe to the latest output for a specific tool by name.
|
|
54
|
+
* Scans all store entries for matching `toolName`, picks the most recent.
|
|
55
|
+
*/
|
|
56
|
+
declare function useToolOutput<T = unknown>(store: ToolStateStore, toolName: string): ToolOutputResult<T>;
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Convenience wrapper that grabs the store from ChatProvider context.
|
|
60
|
+
* Must be used within a <ChatProvider>.
|
|
61
|
+
*/
|
|
62
|
+
declare function useChatToolOutput<T = unknown>(toolName: string): ToolOutputResult<T>;
|
|
63
|
+
|
|
64
|
+
interface QuestionOption {
|
|
65
|
+
label: string;
|
|
66
|
+
value: string;
|
|
67
|
+
description?: string;
|
|
68
|
+
}
|
|
69
|
+
interface QuestionViewProps {
|
|
70
|
+
/** The question text */
|
|
71
|
+
question: string;
|
|
72
|
+
/** Available options */
|
|
73
|
+
options: QuestionOption[];
|
|
74
|
+
/** Selection mode */
|
|
75
|
+
mode?: 'single' | 'multi';
|
|
76
|
+
/** Currently selected value(s) */
|
|
77
|
+
selected?: string | string[] | null;
|
|
78
|
+
/** Called when user selects an option */
|
|
79
|
+
onSelect?: (value: string | string[]) => void;
|
|
80
|
+
/** Allow freeform text input as an alternative to options */
|
|
81
|
+
allowFreeform?: boolean;
|
|
82
|
+
/** Loading state (e.g. after selection is submitted) */
|
|
83
|
+
loading?: boolean;
|
|
84
|
+
/** Additional CSS class for the root element */
|
|
85
|
+
className?: string;
|
|
86
|
+
}
|
|
87
|
+
declare function QuestionView({ question, options, mode, selected, onSelect, allowFreeform, loading, className, }: QuestionViewProps): react_jsx_runtime.JSX.Element;
|
|
88
|
+
|
|
89
|
+
interface FormField {
|
|
90
|
+
name: string;
|
|
91
|
+
label: string;
|
|
92
|
+
type?: 'text' | 'number' | 'email' | 'url' | 'textarea' | 'select' | 'toggle';
|
|
93
|
+
required?: boolean;
|
|
94
|
+
placeholder?: string;
|
|
95
|
+
/** Options for select fields */
|
|
96
|
+
options?: string[];
|
|
97
|
+
defaultValue?: string;
|
|
98
|
+
/** Hint text below the field */
|
|
99
|
+
hint?: string;
|
|
100
|
+
}
|
|
101
|
+
interface FormViewProps {
|
|
102
|
+
/** Form title */
|
|
103
|
+
title?: string;
|
|
104
|
+
/** Description text */
|
|
105
|
+
description?: string;
|
|
106
|
+
/** Field definitions */
|
|
107
|
+
fields: FormField[];
|
|
108
|
+
/** Pre-filled values */
|
|
109
|
+
values?: Record<string, string>;
|
|
110
|
+
/** Whether the form has been submitted */
|
|
111
|
+
submitted?: boolean;
|
|
112
|
+
/** Submit button label */
|
|
113
|
+
submitLabel?: string;
|
|
114
|
+
/** Called with validated form data */
|
|
115
|
+
onSubmit?: (values: Record<string, string>) => void;
|
|
116
|
+
/** Loading state */
|
|
117
|
+
loading?: boolean;
|
|
118
|
+
/** Additional CSS class for the root element */
|
|
119
|
+
className?: string;
|
|
120
|
+
}
|
|
121
|
+
declare function FormView({ title, description, fields, values: initialValues, submitted, submitLabel, onSubmit, loading, className, }: FormViewProps): react_jsx_runtime.JSX.Element;
|
|
122
|
+
|
|
123
|
+
interface DataTableColumn {
|
|
124
|
+
key: string;
|
|
125
|
+
label: string;
|
|
126
|
+
sortable?: boolean;
|
|
127
|
+
align?: 'left' | 'right' | 'center';
|
|
128
|
+
/** Format cell value for display */
|
|
129
|
+
format?: (value: unknown) => string;
|
|
130
|
+
}
|
|
131
|
+
interface DataTableViewProps {
|
|
132
|
+
/** Column definitions */
|
|
133
|
+
columns: DataTableColumn[];
|
|
134
|
+
/** Row data — each row is a key-value object */
|
|
135
|
+
rows: Array<Record<string, unknown>>;
|
|
136
|
+
/** Table title */
|
|
137
|
+
title?: string;
|
|
138
|
+
/** Caption below table */
|
|
139
|
+
caption?: string;
|
|
140
|
+
/** Max rows before pagination (0 = show all) */
|
|
141
|
+
pageSize?: number;
|
|
142
|
+
/** Loading state */
|
|
143
|
+
loading?: boolean;
|
|
144
|
+
/** Additional CSS class for the root element */
|
|
145
|
+
className?: string;
|
|
146
|
+
}
|
|
147
|
+
declare function DataTableView({ columns, rows, title, caption, pageSize, loading, className, }: DataTableViewProps): react_jsx_runtime.JSX.Element;
|
|
148
|
+
|
|
149
|
+
interface ProgressStep {
|
|
150
|
+
label: string;
|
|
151
|
+
status: 'pending' | 'active' | 'done' | 'error';
|
|
152
|
+
detail?: string;
|
|
153
|
+
}
|
|
154
|
+
interface ProgressViewProps {
|
|
155
|
+
/** Title above the progress indicator */
|
|
156
|
+
title?: string;
|
|
157
|
+
/** Step-based mode */
|
|
158
|
+
steps?: ProgressStep[];
|
|
159
|
+
/** Bar mode — percentage 0-100 */
|
|
160
|
+
percent?: number;
|
|
161
|
+
/** Label for bar mode */
|
|
162
|
+
label?: string;
|
|
163
|
+
/** Loading/animating state */
|
|
164
|
+
loading?: boolean;
|
|
165
|
+
/** Additional CSS class for the root element */
|
|
166
|
+
className?: string;
|
|
167
|
+
}
|
|
168
|
+
declare function ProgressView({ title, steps, percent, label, loading, className, }: ProgressViewProps): react_jsx_runtime.JSX.Element | null;
|
|
169
|
+
|
|
170
|
+
interface MediaItem {
|
|
171
|
+
url: string;
|
|
172
|
+
type: 'image' | 'video' | 'audio';
|
|
173
|
+
alt?: string;
|
|
174
|
+
caption?: string;
|
|
175
|
+
}
|
|
176
|
+
interface MediaDisplayViewProps {
|
|
177
|
+
/** Media items to display */
|
|
178
|
+
items: MediaItem[];
|
|
179
|
+
/** Layout mode */
|
|
180
|
+
layout?: 'grid' | 'stack';
|
|
181
|
+
/** Title */
|
|
182
|
+
title?: string;
|
|
183
|
+
/** Loading state */
|
|
184
|
+
loading?: boolean;
|
|
185
|
+
/** Additional CSS class for the root element */
|
|
186
|
+
className?: string;
|
|
187
|
+
}
|
|
188
|
+
declare function MediaDisplayView({ items, layout, title, loading, className, }: MediaDisplayViewProps): react_jsx_runtime.JSX.Element | null;
|
|
189
|
+
|
|
190
|
+
interface CodeBlockViewProps {
|
|
191
|
+
/** The code content */
|
|
192
|
+
code: string;
|
|
193
|
+
/** Programming language for display label */
|
|
194
|
+
language?: string;
|
|
195
|
+
/** Title above the code block */
|
|
196
|
+
title?: string;
|
|
197
|
+
/** Show line numbers */
|
|
198
|
+
showLineNumbers?: boolean;
|
|
199
|
+
/** Diff mode: show before/after */
|
|
200
|
+
diff?: {
|
|
201
|
+
before: string;
|
|
202
|
+
after: string;
|
|
203
|
+
};
|
|
204
|
+
/** Loading state */
|
|
205
|
+
loading?: boolean;
|
|
206
|
+
/** Additional CSS class for the root element */
|
|
207
|
+
className?: string;
|
|
208
|
+
}
|
|
209
|
+
declare function CodeBlockView({ code, language, title, showLineNumbers, diff, loading, className, }: CodeBlockViewProps): react_jsx_runtime.JSX.Element;
|
|
210
|
+
|
|
211
|
+
interface Toast {
|
|
212
|
+
id: string;
|
|
213
|
+
message: string;
|
|
214
|
+
type: 'success' | 'error' | 'info' | 'warning';
|
|
215
|
+
/** Auto-dismiss after ms (0 = manual dismiss) */
|
|
216
|
+
duration?: number;
|
|
217
|
+
}
|
|
218
|
+
interface ToastContextValue {
|
|
219
|
+
toast: (message: string, type?: Toast['type'], duration?: number) => void;
|
|
220
|
+
dismiss: (id: string) => void;
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* Hook to show toasts from any component.
|
|
224
|
+
* Must be used within a ToastProvider.
|
|
225
|
+
*/
|
|
226
|
+
declare function useToast(): ToastContextValue;
|
|
227
|
+
declare function ToastProvider({ children, className }: {
|
|
228
|
+
children: React.ReactNode;
|
|
229
|
+
className?: string;
|
|
230
|
+
}): react_jsx_runtime.JSX.Element;
|
|
231
|
+
|
|
232
|
+
interface UploadedFile {
|
|
233
|
+
name: string;
|
|
234
|
+
size: number;
|
|
235
|
+
type: string;
|
|
236
|
+
url?: string;
|
|
237
|
+
}
|
|
238
|
+
interface FileUploadViewProps {
|
|
239
|
+
/** Accepted file types (e.g. "image/*,.pdf") */
|
|
240
|
+
accept?: string;
|
|
241
|
+
/** Max file size in bytes */
|
|
242
|
+
maxSize?: number;
|
|
243
|
+
/** Allow multiple files */
|
|
244
|
+
multiple?: boolean;
|
|
245
|
+
/** Already-uploaded files to display */
|
|
246
|
+
files?: UploadedFile[];
|
|
247
|
+
/** Called when user selects files */
|
|
248
|
+
onUpload?: (files: File[]) => void;
|
|
249
|
+
/** Title */
|
|
250
|
+
title?: string;
|
|
251
|
+
/** Loading state */
|
|
252
|
+
loading?: boolean;
|
|
253
|
+
/** Additional CSS class for the root element */
|
|
254
|
+
className?: string;
|
|
255
|
+
}
|
|
256
|
+
declare function FileUploadView({ accept, maxSize, multiple, files, onUpload, title, loading, className, }: FileUploadViewProps): react_jsx_runtime.JSX.Element;
|
|
257
|
+
|
|
258
|
+
export { ChatPanel, CodeBlockView, type CodeBlockViewProps, type DataTableColumn, DataTableView, type DataTableViewProps, FileUploadView, type FileUploadViewProps, type FormField, FormView, type FormViewProps, Markdown, type MarkdownProps, MediaDisplayView, type MediaDisplayViewProps, type MediaItem, Panel, type PanelProps, type ProgressStep, ProgressView, type ProgressViewProps, type QuestionOption, QuestionView, type QuestionViewProps, type Toast, ToastProvider, type ToolEffectCallback, type ToolOutputResult, ToolStateEntry, ToolStateStore, type UploadedFile, useChatToolOutput, useToast, useToolEffect, useToolOutput };
|
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
import { f as ToolStateStore, g as ToolStateEntry } from '../ThemeProvider-BaVZaDBO.js';
|
|
2
|
+
export { m as Chat, d as ChatProps, h as ChatProvider, C as ChatProviderProps, k as Composer, b as ComposerProps, j as Message, M as MessageProps, p as ThemeProvider, e as ThemeProviderProps, i as Thread, a as ThreadProps, T as ToolPartInfo, l as ToolResult, c as ToolResultProps, n as createToolStateStore, u as useChatContext, o as useToolState } from '../ThemeProvider-BaVZaDBO.js';
|
|
3
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
|
+
import { T as Tool } from '../tool-Ca2x-VNK.js';
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import 'ai';
|
|
7
|
+
import '../types-CAOfGUPH.js';
|
|
8
|
+
import 'zod';
|
|
9
|
+
|
|
10
|
+
interface MarkdownProps {
|
|
11
|
+
content: string;
|
|
12
|
+
className?: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Renders markdown content with GFM support, styled code blocks, and a copy button.
|
|
16
|
+
*/
|
|
17
|
+
declare function Markdown({ content, className }: MarkdownProps): react_jsx_runtime.JSX.Element;
|
|
18
|
+
|
|
19
|
+
interface PanelProps {
|
|
20
|
+
toolStateStore: ToolStateStore;
|
|
21
|
+
tools: Record<string, Tool>;
|
|
22
|
+
getOnAction: (toolCallId: string, toolName: string) => (input: Record<string, unknown>) => void;
|
|
23
|
+
className?: string;
|
|
24
|
+
/** When set, only show output from this specific tool name */
|
|
25
|
+
tool?: string;
|
|
26
|
+
/** Tool names to exclude from selection */
|
|
27
|
+
excludeTools?: string[];
|
|
28
|
+
/** Maximum number of items to display (default 5) */
|
|
29
|
+
maxItems?: number;
|
|
30
|
+
}
|
|
31
|
+
declare function Panel({ toolStateStore, tools, getOnAction, className, tool: filterTool, excludeTools, maxItems }: PanelProps): react_jsx_runtime.JSX.Element;
|
|
32
|
+
declare function ChatPanel({ className, tool, excludeTools, maxItems }: {
|
|
33
|
+
className?: string;
|
|
34
|
+
tool?: string;
|
|
35
|
+
excludeTools?: string[];
|
|
36
|
+
maxItems?: number;
|
|
37
|
+
}): react_jsx_runtime.JSX.Element;
|
|
38
|
+
|
|
39
|
+
type ToolEffectCallback = (entry: ToolStateEntry, toolCallId: string) => void;
|
|
40
|
+
/**
|
|
41
|
+
* Subscribe to tool state changes and fire a callback when a specific tool produces output.
|
|
42
|
+
* Only fires once per version to prevent duplicate callbacks.
|
|
43
|
+
*/
|
|
44
|
+
declare function useToolEffect(store: ToolStateStore, toolName: string, callback: ToolEffectCallback): void;
|
|
45
|
+
|
|
46
|
+
interface ToolOutputResult<T = unknown> {
|
|
47
|
+
data: T | null;
|
|
48
|
+
loading: boolean;
|
|
49
|
+
error: string | null;
|
|
50
|
+
toolCallId: string | null;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Subscribe to the latest output for a specific tool by name.
|
|
54
|
+
* Scans all store entries for matching `toolName`, picks the most recent.
|
|
55
|
+
*/
|
|
56
|
+
declare function useToolOutput<T = unknown>(store: ToolStateStore, toolName: string): ToolOutputResult<T>;
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Convenience wrapper that grabs the store from ChatProvider context.
|
|
60
|
+
* Must be used within a <ChatProvider>.
|
|
61
|
+
*/
|
|
62
|
+
declare function useChatToolOutput<T = unknown>(toolName: string): ToolOutputResult<T>;
|
|
63
|
+
|
|
64
|
+
interface QuestionOption {
|
|
65
|
+
label: string;
|
|
66
|
+
value: string;
|
|
67
|
+
description?: string;
|
|
68
|
+
}
|
|
69
|
+
interface QuestionViewProps {
|
|
70
|
+
/** The question text */
|
|
71
|
+
question: string;
|
|
72
|
+
/** Available options */
|
|
73
|
+
options: QuestionOption[];
|
|
74
|
+
/** Selection mode */
|
|
75
|
+
mode?: 'single' | 'multi';
|
|
76
|
+
/** Currently selected value(s) */
|
|
77
|
+
selected?: string | string[] | null;
|
|
78
|
+
/** Called when user selects an option */
|
|
79
|
+
onSelect?: (value: string | string[]) => void;
|
|
80
|
+
/** Allow freeform text input as an alternative to options */
|
|
81
|
+
allowFreeform?: boolean;
|
|
82
|
+
/** Loading state (e.g. after selection is submitted) */
|
|
83
|
+
loading?: boolean;
|
|
84
|
+
/** Additional CSS class for the root element */
|
|
85
|
+
className?: string;
|
|
86
|
+
}
|
|
87
|
+
declare function QuestionView({ question, options, mode, selected, onSelect, allowFreeform, loading, className, }: QuestionViewProps): react_jsx_runtime.JSX.Element;
|
|
88
|
+
|
|
89
|
+
interface FormField {
|
|
90
|
+
name: string;
|
|
91
|
+
label: string;
|
|
92
|
+
type?: 'text' | 'number' | 'email' | 'url' | 'textarea' | 'select' | 'toggle';
|
|
93
|
+
required?: boolean;
|
|
94
|
+
placeholder?: string;
|
|
95
|
+
/** Options for select fields */
|
|
96
|
+
options?: string[];
|
|
97
|
+
defaultValue?: string;
|
|
98
|
+
/** Hint text below the field */
|
|
99
|
+
hint?: string;
|
|
100
|
+
}
|
|
101
|
+
interface FormViewProps {
|
|
102
|
+
/** Form title */
|
|
103
|
+
title?: string;
|
|
104
|
+
/** Description text */
|
|
105
|
+
description?: string;
|
|
106
|
+
/** Field definitions */
|
|
107
|
+
fields: FormField[];
|
|
108
|
+
/** Pre-filled values */
|
|
109
|
+
values?: Record<string, string>;
|
|
110
|
+
/** Whether the form has been submitted */
|
|
111
|
+
submitted?: boolean;
|
|
112
|
+
/** Submit button label */
|
|
113
|
+
submitLabel?: string;
|
|
114
|
+
/** Called with validated form data */
|
|
115
|
+
onSubmit?: (values: Record<string, string>) => void;
|
|
116
|
+
/** Loading state */
|
|
117
|
+
loading?: boolean;
|
|
118
|
+
/** Additional CSS class for the root element */
|
|
119
|
+
className?: string;
|
|
120
|
+
}
|
|
121
|
+
declare function FormView({ title, description, fields, values: initialValues, submitted, submitLabel, onSubmit, loading, className, }: FormViewProps): react_jsx_runtime.JSX.Element;
|
|
122
|
+
|
|
123
|
+
interface DataTableColumn {
|
|
124
|
+
key: string;
|
|
125
|
+
label: string;
|
|
126
|
+
sortable?: boolean;
|
|
127
|
+
align?: 'left' | 'right' | 'center';
|
|
128
|
+
/** Format cell value for display */
|
|
129
|
+
format?: (value: unknown) => string;
|
|
130
|
+
}
|
|
131
|
+
interface DataTableViewProps {
|
|
132
|
+
/** Column definitions */
|
|
133
|
+
columns: DataTableColumn[];
|
|
134
|
+
/** Row data — each row is a key-value object */
|
|
135
|
+
rows: Array<Record<string, unknown>>;
|
|
136
|
+
/** Table title */
|
|
137
|
+
title?: string;
|
|
138
|
+
/** Caption below table */
|
|
139
|
+
caption?: string;
|
|
140
|
+
/** Max rows before pagination (0 = show all) */
|
|
141
|
+
pageSize?: number;
|
|
142
|
+
/** Loading state */
|
|
143
|
+
loading?: boolean;
|
|
144
|
+
/** Additional CSS class for the root element */
|
|
145
|
+
className?: string;
|
|
146
|
+
}
|
|
147
|
+
declare function DataTableView({ columns, rows, title, caption, pageSize, loading, className, }: DataTableViewProps): react_jsx_runtime.JSX.Element;
|
|
148
|
+
|
|
149
|
+
interface ProgressStep {
|
|
150
|
+
label: string;
|
|
151
|
+
status: 'pending' | 'active' | 'done' | 'error';
|
|
152
|
+
detail?: string;
|
|
153
|
+
}
|
|
154
|
+
interface ProgressViewProps {
|
|
155
|
+
/** Title above the progress indicator */
|
|
156
|
+
title?: string;
|
|
157
|
+
/** Step-based mode */
|
|
158
|
+
steps?: ProgressStep[];
|
|
159
|
+
/** Bar mode — percentage 0-100 */
|
|
160
|
+
percent?: number;
|
|
161
|
+
/** Label for bar mode */
|
|
162
|
+
label?: string;
|
|
163
|
+
/** Loading/animating state */
|
|
164
|
+
loading?: boolean;
|
|
165
|
+
/** Additional CSS class for the root element */
|
|
166
|
+
className?: string;
|
|
167
|
+
}
|
|
168
|
+
declare function ProgressView({ title, steps, percent, label, loading, className, }: ProgressViewProps): react_jsx_runtime.JSX.Element | null;
|
|
169
|
+
|
|
170
|
+
interface MediaItem {
|
|
171
|
+
url: string;
|
|
172
|
+
type: 'image' | 'video' | 'audio';
|
|
173
|
+
alt?: string;
|
|
174
|
+
caption?: string;
|
|
175
|
+
}
|
|
176
|
+
interface MediaDisplayViewProps {
|
|
177
|
+
/** Media items to display */
|
|
178
|
+
items: MediaItem[];
|
|
179
|
+
/** Layout mode */
|
|
180
|
+
layout?: 'grid' | 'stack';
|
|
181
|
+
/** Title */
|
|
182
|
+
title?: string;
|
|
183
|
+
/** Loading state */
|
|
184
|
+
loading?: boolean;
|
|
185
|
+
/** Additional CSS class for the root element */
|
|
186
|
+
className?: string;
|
|
187
|
+
}
|
|
188
|
+
declare function MediaDisplayView({ items, layout, title, loading, className, }: MediaDisplayViewProps): react_jsx_runtime.JSX.Element | null;
|
|
189
|
+
|
|
190
|
+
interface CodeBlockViewProps {
|
|
191
|
+
/** The code content */
|
|
192
|
+
code: string;
|
|
193
|
+
/** Programming language for display label */
|
|
194
|
+
language?: string;
|
|
195
|
+
/** Title above the code block */
|
|
196
|
+
title?: string;
|
|
197
|
+
/** Show line numbers */
|
|
198
|
+
showLineNumbers?: boolean;
|
|
199
|
+
/** Diff mode: show before/after */
|
|
200
|
+
diff?: {
|
|
201
|
+
before: string;
|
|
202
|
+
after: string;
|
|
203
|
+
};
|
|
204
|
+
/** Loading state */
|
|
205
|
+
loading?: boolean;
|
|
206
|
+
/** Additional CSS class for the root element */
|
|
207
|
+
className?: string;
|
|
208
|
+
}
|
|
209
|
+
declare function CodeBlockView({ code, language, title, showLineNumbers, diff, loading, className, }: CodeBlockViewProps): react_jsx_runtime.JSX.Element;
|
|
210
|
+
|
|
211
|
+
interface Toast {
|
|
212
|
+
id: string;
|
|
213
|
+
message: string;
|
|
214
|
+
type: 'success' | 'error' | 'info' | 'warning';
|
|
215
|
+
/** Auto-dismiss after ms (0 = manual dismiss) */
|
|
216
|
+
duration?: number;
|
|
217
|
+
}
|
|
218
|
+
interface ToastContextValue {
|
|
219
|
+
toast: (message: string, type?: Toast['type'], duration?: number) => void;
|
|
220
|
+
dismiss: (id: string) => void;
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* Hook to show toasts from any component.
|
|
224
|
+
* Must be used within a ToastProvider.
|
|
225
|
+
*/
|
|
226
|
+
declare function useToast(): ToastContextValue;
|
|
227
|
+
declare function ToastProvider({ children, className }: {
|
|
228
|
+
children: React.ReactNode;
|
|
229
|
+
className?: string;
|
|
230
|
+
}): react_jsx_runtime.JSX.Element;
|
|
231
|
+
|
|
232
|
+
interface UploadedFile {
|
|
233
|
+
name: string;
|
|
234
|
+
size: number;
|
|
235
|
+
type: string;
|
|
236
|
+
url?: string;
|
|
237
|
+
}
|
|
238
|
+
interface FileUploadViewProps {
|
|
239
|
+
/** Accepted file types (e.g. "image/*,.pdf") */
|
|
240
|
+
accept?: string;
|
|
241
|
+
/** Max file size in bytes */
|
|
242
|
+
maxSize?: number;
|
|
243
|
+
/** Allow multiple files */
|
|
244
|
+
multiple?: boolean;
|
|
245
|
+
/** Already-uploaded files to display */
|
|
246
|
+
files?: UploadedFile[];
|
|
247
|
+
/** Called when user selects files */
|
|
248
|
+
onUpload?: (files: File[]) => void;
|
|
249
|
+
/** Title */
|
|
250
|
+
title?: string;
|
|
251
|
+
/** Loading state */
|
|
252
|
+
loading?: boolean;
|
|
253
|
+
/** Additional CSS class for the root element */
|
|
254
|
+
className?: string;
|
|
255
|
+
}
|
|
256
|
+
declare function FileUploadView({ accept, maxSize, multiple, files, onUpload, title, loading, className, }: FileUploadViewProps): react_jsx_runtime.JSX.Element;
|
|
257
|
+
|
|
258
|
+
export { ChatPanel, CodeBlockView, type CodeBlockViewProps, type DataTableColumn, DataTableView, type DataTableViewProps, FileUploadView, type FileUploadViewProps, type FormField, FormView, type FormViewProps, Markdown, type MarkdownProps, MediaDisplayView, type MediaDisplayViewProps, type MediaItem, Panel, type PanelProps, type ProgressStep, ProgressView, type ProgressViewProps, type QuestionOption, QuestionView, type QuestionViewProps, type Toast, ToastProvider, type ToolEffectCallback, type ToolOutputResult, ToolStateEntry, ToolStateStore, type UploadedFile, useChatToolOutput, useToast, useToolEffect, useToolOutput };
|