@arc-lo/ui 0.1.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/dist/index.cjs +2979 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +515 -0
- package/dist/index.d.ts +515 -0
- package/dist/index.js +2957 -0
- package/dist/index.js.map +1 -0
- package/package.json +47 -0
- package/src/styles/theme.css +54 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,515 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { HTMLAttributes, ReactNode, TextareaHTMLAttributes } from 'react';
|
|
3
|
+
|
|
4
|
+
type StreamingState = "pending" | "streaming" | "done" | "interrupted" | "error" | "ratelimit";
|
|
5
|
+
type ConfidenceLevel = "high" | "medium" | "low" | "unknown";
|
|
6
|
+
type ChunkSize = "char" | "word" | "line";
|
|
7
|
+
|
|
8
|
+
interface UseStreamingTextOptions {
|
|
9
|
+
/** ReadableStream of text chunks from an AI response */
|
|
10
|
+
stream?: ReadableStream<string> | null;
|
|
11
|
+
/** Plain text to stream (alternative to stream) */
|
|
12
|
+
text?: string;
|
|
13
|
+
/** Delay in ms between rendering chunks. Default: 30 */
|
|
14
|
+
speed?: number;
|
|
15
|
+
/** How to chunk the text for rendering. Default: "char" */
|
|
16
|
+
chunkSize?: ChunkSize;
|
|
17
|
+
/** Called when streaming completes */
|
|
18
|
+
onDone?: (text: string) => void;
|
|
19
|
+
/** Called on error */
|
|
20
|
+
onError?: (error: Error) => void;
|
|
21
|
+
/** Called when interrupted by user */
|
|
22
|
+
onInterrupt?: (partialText: string) => void;
|
|
23
|
+
}
|
|
24
|
+
interface UseStreamingTextReturn {
|
|
25
|
+
/** The text rendered so far */
|
|
26
|
+
displayedText: string;
|
|
27
|
+
/** The full text received (may be ahead of displayedText during animation) */
|
|
28
|
+
fullText: string;
|
|
29
|
+
/** Current state of the streaming component */
|
|
30
|
+
state: StreamingState;
|
|
31
|
+
/** Stop streaming and rendering */
|
|
32
|
+
interrupt: () => void;
|
|
33
|
+
/** Reset to pending state */
|
|
34
|
+
reset: () => void;
|
|
35
|
+
/** Jump to showing all received text immediately */
|
|
36
|
+
skipAnimation: () => void;
|
|
37
|
+
}
|
|
38
|
+
declare function useStreamingText({ stream, text, speed, chunkSize, onDone, onError, onInterrupt, }: UseStreamingTextOptions): UseStreamingTextReturn;
|
|
39
|
+
|
|
40
|
+
interface StreamingTextContextValue {
|
|
41
|
+
displayedText: string;
|
|
42
|
+
fullText: string;
|
|
43
|
+
state: StreamingState;
|
|
44
|
+
interrupt: () => void;
|
|
45
|
+
reset: () => void;
|
|
46
|
+
skipAnimation: () => void;
|
|
47
|
+
}
|
|
48
|
+
declare function useStreamingTextContext(): StreamingTextContextValue;
|
|
49
|
+
interface StreamingTextRootProps extends UseStreamingTextOptions, Omit<HTMLAttributes<HTMLDivElement>, "children" | "onError"> {
|
|
50
|
+
children?: ReactNode;
|
|
51
|
+
}
|
|
52
|
+
declare const Root$5: react.ForwardRefExoticComponent<StreamingTextRootProps & react.RefAttributes<HTMLDivElement>>;
|
|
53
|
+
interface StreamingTextContentProps extends HTMLAttributes<HTMLDivElement> {
|
|
54
|
+
/** Custom render function for the text */
|
|
55
|
+
render?: (text: string) => ReactNode;
|
|
56
|
+
}
|
|
57
|
+
declare const Content$1: react.ForwardRefExoticComponent<StreamingTextContentProps & react.RefAttributes<HTMLDivElement>>;
|
|
58
|
+
interface StreamingTextCursorProps extends HTMLAttributes<HTMLSpanElement> {
|
|
59
|
+
/** Character to use as cursor. Default: "▋" */
|
|
60
|
+
char?: string;
|
|
61
|
+
}
|
|
62
|
+
declare const Cursor: react.ForwardRefExoticComponent<StreamingTextCursorProps & react.RefAttributes<HTMLSpanElement>>;
|
|
63
|
+
interface StreamingTextSkeletonProps extends HTMLAttributes<HTMLDivElement> {
|
|
64
|
+
/** Number of skeleton lines. Default: 3 */
|
|
65
|
+
lines?: number;
|
|
66
|
+
}
|
|
67
|
+
declare const Skeleton: react.ForwardRefExoticComponent<StreamingTextSkeletonProps & react.RefAttributes<HTMLDivElement>>;
|
|
68
|
+
interface StreamingTextErrorProps extends HTMLAttributes<HTMLDivElement> {
|
|
69
|
+
/** Custom error message */
|
|
70
|
+
message?: string;
|
|
71
|
+
/** Show retry button */
|
|
72
|
+
onRetry?: () => void;
|
|
73
|
+
}
|
|
74
|
+
declare const ErrorFallback: react.ForwardRefExoticComponent<StreamingTextErrorProps & react.RefAttributes<HTMLDivElement>>;
|
|
75
|
+
interface StreamingTextRateLimitProps extends HTMLAttributes<HTMLDivElement> {
|
|
76
|
+
/** Retry delay in seconds */
|
|
77
|
+
retryAfter?: number;
|
|
78
|
+
message?: string;
|
|
79
|
+
}
|
|
80
|
+
declare const RateLimit: react.ForwardRefExoticComponent<StreamingTextRateLimitProps & react.RefAttributes<HTMLDivElement>>;
|
|
81
|
+
interface StreamingTextToolbarProps extends HTMLAttributes<HTMLDivElement> {
|
|
82
|
+
/** Only show toolbar in these states. Default: ["done", "interrupted"] */
|
|
83
|
+
showIn?: StreamingState[];
|
|
84
|
+
}
|
|
85
|
+
declare const Toolbar: react.ForwardRefExoticComponent<StreamingTextToolbarProps & react.RefAttributes<HTMLDivElement>>;
|
|
86
|
+
interface StreamingTextStopProps extends HTMLAttributes<HTMLButtonElement> {
|
|
87
|
+
}
|
|
88
|
+
declare const Stop: react.ForwardRefExoticComponent<StreamingTextStopProps & react.RefAttributes<HTMLButtonElement>>;
|
|
89
|
+
|
|
90
|
+
declare const index$5_Cursor: typeof Cursor;
|
|
91
|
+
declare const index$5_ErrorFallback: typeof ErrorFallback;
|
|
92
|
+
declare const index$5_RateLimit: typeof RateLimit;
|
|
93
|
+
declare const index$5_Skeleton: typeof Skeleton;
|
|
94
|
+
declare const index$5_Stop: typeof Stop;
|
|
95
|
+
type index$5_StreamingTextContentProps = StreamingTextContentProps;
|
|
96
|
+
type index$5_StreamingTextCursorProps = StreamingTextCursorProps;
|
|
97
|
+
type index$5_StreamingTextErrorProps = StreamingTextErrorProps;
|
|
98
|
+
type index$5_StreamingTextRateLimitProps = StreamingTextRateLimitProps;
|
|
99
|
+
type index$5_StreamingTextRootProps = StreamingTextRootProps;
|
|
100
|
+
type index$5_StreamingTextSkeletonProps = StreamingTextSkeletonProps;
|
|
101
|
+
type index$5_StreamingTextStopProps = StreamingTextStopProps;
|
|
102
|
+
type index$5_StreamingTextToolbarProps = StreamingTextToolbarProps;
|
|
103
|
+
declare const index$5_Toolbar: typeof Toolbar;
|
|
104
|
+
type index$5_UseStreamingTextOptions = UseStreamingTextOptions;
|
|
105
|
+
type index$5_UseStreamingTextReturn = UseStreamingTextReturn;
|
|
106
|
+
declare const index$5_useStreamingText: typeof useStreamingText;
|
|
107
|
+
declare const index$5_useStreamingTextContext: typeof useStreamingTextContext;
|
|
108
|
+
declare namespace index$5 {
|
|
109
|
+
export { Content$1 as Content, index$5_Cursor as Cursor, index$5_ErrorFallback as ErrorFallback, index$5_RateLimit as RateLimit, Root$5 as Root, index$5_Skeleton as Skeleton, index$5_Stop as Stop, type index$5_StreamingTextContentProps as StreamingTextContentProps, type index$5_StreamingTextCursorProps as StreamingTextCursorProps, type index$5_StreamingTextErrorProps as StreamingTextErrorProps, type index$5_StreamingTextRateLimitProps as StreamingTextRateLimitProps, type index$5_StreamingTextRootProps as StreamingTextRootProps, type index$5_StreamingTextSkeletonProps as StreamingTextSkeletonProps, type index$5_StreamingTextStopProps as StreamingTextStopProps, type index$5_StreamingTextToolbarProps as StreamingTextToolbarProps, index$5_Toolbar as Toolbar, type index$5_UseStreamingTextOptions as UseStreamingTextOptions, type index$5_UseStreamingTextReturn as UseStreamingTextReturn, index$5_useStreamingText as useStreamingText, index$5_useStreamingTextContext as useStreamingTextContext };
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
interface PromptBoxContextValue {
|
|
113
|
+
value: string;
|
|
114
|
+
setValue: (v: string) => void;
|
|
115
|
+
submit: () => void;
|
|
116
|
+
isSubmitting: boolean;
|
|
117
|
+
disabled: boolean;
|
|
118
|
+
}
|
|
119
|
+
declare function usePromptBoxContext(): PromptBoxContextValue;
|
|
120
|
+
interface PromptBoxRootProps extends Omit<HTMLAttributes<HTMLFormElement>, "onSubmit"> {
|
|
121
|
+
/** Controlled value */
|
|
122
|
+
value?: string;
|
|
123
|
+
/** Default uncontrolled value */
|
|
124
|
+
defaultValue?: string;
|
|
125
|
+
/** Called when the prompt is submitted */
|
|
126
|
+
onSubmit?: (value: string) => void;
|
|
127
|
+
/** Called when value changes */
|
|
128
|
+
onValueChange?: (value: string) => void;
|
|
129
|
+
/** Whether a submission is in progress */
|
|
130
|
+
isSubmitting?: boolean;
|
|
131
|
+
/** Disable the entire prompt box */
|
|
132
|
+
disabled?: boolean;
|
|
133
|
+
children?: ReactNode;
|
|
134
|
+
}
|
|
135
|
+
declare const Root$4: react.ForwardRefExoticComponent<PromptBoxRootProps & react.RefAttributes<HTMLFormElement>>;
|
|
136
|
+
interface PromptBoxChipsProps extends HTMLAttributes<HTMLDivElement> {
|
|
137
|
+
}
|
|
138
|
+
declare const Chips: react.ForwardRefExoticComponent<PromptBoxChipsProps & react.RefAttributes<HTMLDivElement>>;
|
|
139
|
+
interface PromptBoxChipProps extends HTMLAttributes<HTMLSpanElement> {
|
|
140
|
+
onRemove?: () => void;
|
|
141
|
+
}
|
|
142
|
+
declare const Chip: react.ForwardRefExoticComponent<PromptBoxChipProps & react.RefAttributes<HTMLSpanElement>>;
|
|
143
|
+
interface PromptBoxInputProps extends Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, "value" | "onChange"> {
|
|
144
|
+
/** Min rows. Default: 1 */
|
|
145
|
+
minRows?: number;
|
|
146
|
+
/** Max rows before scroll. Default: 8 */
|
|
147
|
+
maxRows?: number;
|
|
148
|
+
}
|
|
149
|
+
declare const Input$1: react.ForwardRefExoticComponent<PromptBoxInputProps & react.RefAttributes<HTMLTextAreaElement>>;
|
|
150
|
+
interface PromptBoxFooterProps extends HTMLAttributes<HTMLDivElement> {
|
|
151
|
+
}
|
|
152
|
+
declare const Footer: react.ForwardRefExoticComponent<PromptBoxFooterProps & react.RefAttributes<HTMLDivElement>>;
|
|
153
|
+
interface PromptBoxSubmitProps extends HTMLAttributes<HTMLButtonElement> {
|
|
154
|
+
}
|
|
155
|
+
declare const SubmitButton: react.ForwardRefExoticComponent<PromptBoxSubmitProps & react.RefAttributes<HTMLButtonElement>>;
|
|
156
|
+
interface PromptBoxSuggestionsProps extends Omit<HTMLAttributes<HTMLDivElement>, "onSelect"> {
|
|
157
|
+
suggestions: string[];
|
|
158
|
+
onSelect?: (suggestion: string) => void;
|
|
159
|
+
}
|
|
160
|
+
declare const Suggestions: react.ForwardRefExoticComponent<PromptBoxSuggestionsProps & react.RefAttributes<HTMLDivElement>>;
|
|
161
|
+
|
|
162
|
+
declare const index$4_Chip: typeof Chip;
|
|
163
|
+
declare const index$4_Chips: typeof Chips;
|
|
164
|
+
declare const index$4_Footer: typeof Footer;
|
|
165
|
+
type index$4_PromptBoxChipProps = PromptBoxChipProps;
|
|
166
|
+
type index$4_PromptBoxChipsProps = PromptBoxChipsProps;
|
|
167
|
+
type index$4_PromptBoxFooterProps = PromptBoxFooterProps;
|
|
168
|
+
type index$4_PromptBoxInputProps = PromptBoxInputProps;
|
|
169
|
+
type index$4_PromptBoxRootProps = PromptBoxRootProps;
|
|
170
|
+
type index$4_PromptBoxSubmitProps = PromptBoxSubmitProps;
|
|
171
|
+
type index$4_PromptBoxSuggestionsProps = PromptBoxSuggestionsProps;
|
|
172
|
+
declare const index$4_SubmitButton: typeof SubmitButton;
|
|
173
|
+
declare const index$4_Suggestions: typeof Suggestions;
|
|
174
|
+
declare const index$4_usePromptBoxContext: typeof usePromptBoxContext;
|
|
175
|
+
declare namespace index$4 {
|
|
176
|
+
export { index$4_Chip as Chip, index$4_Chips as Chips, index$4_Footer as Footer, Input$1 as Input, type index$4_PromptBoxChipProps as PromptBoxChipProps, type index$4_PromptBoxChipsProps as PromptBoxChipsProps, type index$4_PromptBoxFooterProps as PromptBoxFooterProps, type index$4_PromptBoxInputProps as PromptBoxInputProps, type index$4_PromptBoxRootProps as PromptBoxRootProps, type index$4_PromptBoxSubmitProps as PromptBoxSubmitProps, type index$4_PromptBoxSuggestionsProps as PromptBoxSuggestionsProps, Root$4 as Root, index$4_SubmitButton as SubmitButton, index$4_Suggestions as Suggestions, index$4_usePromptBoxContext as usePromptBoxContext };
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
type FeedbackValue = "up" | "down" | null;
|
|
180
|
+
interface FeedbackBarRootProps extends HTMLAttributes<HTMLDivElement> {
|
|
181
|
+
/** Called when thumbs feedback changes */
|
|
182
|
+
onFeedback?: (value: FeedbackValue) => void;
|
|
183
|
+
children?: ReactNode;
|
|
184
|
+
}
|
|
185
|
+
declare const Root$3: react.ForwardRefExoticComponent<FeedbackBarRootProps & react.RefAttributes<HTMLDivElement>>;
|
|
186
|
+
interface FeedbackBarThumbsUpProps extends HTMLAttributes<HTMLButtonElement> {
|
|
187
|
+
}
|
|
188
|
+
declare const ThumbsUp: react.ForwardRefExoticComponent<FeedbackBarThumbsUpProps & react.RefAttributes<HTMLButtonElement>>;
|
|
189
|
+
interface FeedbackBarThumbsDownProps extends HTMLAttributes<HTMLButtonElement> {
|
|
190
|
+
}
|
|
191
|
+
declare const ThumbsDown: react.ForwardRefExoticComponent<FeedbackBarThumbsDownProps & react.RefAttributes<HTMLButtonElement>>;
|
|
192
|
+
interface FeedbackBarCopyProps extends HTMLAttributes<HTMLButtonElement> {
|
|
193
|
+
/** Text to copy. If not provided, copies the closest [data-arclo-copyable] ancestor's textContent */
|
|
194
|
+
text?: string;
|
|
195
|
+
}
|
|
196
|
+
declare const Copy: react.ForwardRefExoticComponent<FeedbackBarCopyProps & react.RefAttributes<HTMLButtonElement>>;
|
|
197
|
+
interface FeedbackBarRegenerateProps extends HTMLAttributes<HTMLButtonElement> {
|
|
198
|
+
onRegenerate?: () => void;
|
|
199
|
+
}
|
|
200
|
+
declare const Regenerate: react.ForwardRefExoticComponent<FeedbackBarRegenerateProps & react.RefAttributes<HTMLButtonElement>>;
|
|
201
|
+
|
|
202
|
+
declare const index$3_Copy: typeof Copy;
|
|
203
|
+
type index$3_FeedbackBarCopyProps = FeedbackBarCopyProps;
|
|
204
|
+
type index$3_FeedbackBarRegenerateProps = FeedbackBarRegenerateProps;
|
|
205
|
+
type index$3_FeedbackBarRootProps = FeedbackBarRootProps;
|
|
206
|
+
type index$3_FeedbackBarThumbsDownProps = FeedbackBarThumbsDownProps;
|
|
207
|
+
type index$3_FeedbackBarThumbsUpProps = FeedbackBarThumbsUpProps;
|
|
208
|
+
declare const index$3_Regenerate: typeof Regenerate;
|
|
209
|
+
declare const index$3_ThumbsDown: typeof ThumbsDown;
|
|
210
|
+
declare const index$3_ThumbsUp: typeof ThumbsUp;
|
|
211
|
+
declare namespace index$3 {
|
|
212
|
+
export { index$3_Copy as Copy, type index$3_FeedbackBarCopyProps as FeedbackBarCopyProps, type index$3_FeedbackBarRegenerateProps as FeedbackBarRegenerateProps, type index$3_FeedbackBarRootProps as FeedbackBarRootProps, type index$3_FeedbackBarThumbsDownProps as FeedbackBarThumbsDownProps, type index$3_FeedbackBarThumbsUpProps as FeedbackBarThumbsUpProps, index$3_Regenerate as Regenerate, Root$3 as Root, index$3_ThumbsDown as ThumbsDown, index$3_ThumbsUp as ThumbsUp };
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
type ThinkingState = "thinking" | "done" | "error";
|
|
216
|
+
interface ThinkingBlockRootProps extends HTMLAttributes<HTMLDivElement> {
|
|
217
|
+
/** Current thinking state */
|
|
218
|
+
state?: ThinkingState;
|
|
219
|
+
/** Whether the block starts expanded. Default: true */
|
|
220
|
+
defaultOpen?: boolean;
|
|
221
|
+
/** Auto-collapse when state changes to "done". Default: true */
|
|
222
|
+
collapseOnDone?: boolean;
|
|
223
|
+
/** Thinking duration in seconds (shown in header) */
|
|
224
|
+
duration?: number | null;
|
|
225
|
+
children?: ReactNode;
|
|
226
|
+
}
|
|
227
|
+
declare const Root$2: react.ForwardRefExoticComponent<ThinkingBlockRootProps & react.RefAttributes<HTMLDivElement>>;
|
|
228
|
+
interface ThinkingBlockTriggerProps extends HTMLAttributes<HTMLButtonElement> {
|
|
229
|
+
/** Custom label. Default: auto from state */
|
|
230
|
+
label?: string;
|
|
231
|
+
}
|
|
232
|
+
declare const Trigger: react.ForwardRefExoticComponent<ThinkingBlockTriggerProps & react.RefAttributes<HTMLButtonElement>>;
|
|
233
|
+
interface ThinkingBlockContentProps extends HTMLAttributes<HTMLDivElement> {
|
|
234
|
+
}
|
|
235
|
+
declare const Content: react.ForwardRefExoticComponent<ThinkingBlockContentProps & react.RefAttributes<HTMLDivElement>>;
|
|
236
|
+
|
|
237
|
+
declare const index$2_Content: typeof Content;
|
|
238
|
+
type index$2_ThinkingBlockContentProps = ThinkingBlockContentProps;
|
|
239
|
+
type index$2_ThinkingBlockRootProps = ThinkingBlockRootProps;
|
|
240
|
+
type index$2_ThinkingBlockTriggerProps = ThinkingBlockTriggerProps;
|
|
241
|
+
type index$2_ThinkingState = ThinkingState;
|
|
242
|
+
declare const index$2_Trigger: typeof Trigger;
|
|
243
|
+
declare namespace index$2 {
|
|
244
|
+
export { index$2_Content as Content, Root$2 as Root, type index$2_ThinkingBlockContentProps as ThinkingBlockContentProps, type index$2_ThinkingBlockRootProps as ThinkingBlockRootProps, type index$2_ThinkingBlockTriggerProps as ThinkingBlockTriggerProps, type index$2_ThinkingState as ThinkingState, index$2_Trigger as Trigger };
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
type ToolCallStatus = "pending" | "running" | "success" | "error";
|
|
248
|
+
interface ToolCallRootProps extends HTMLAttributes<HTMLDivElement> {
|
|
249
|
+
/** Name of the tool being called */
|
|
250
|
+
toolName: string;
|
|
251
|
+
/** Current status */
|
|
252
|
+
status?: ToolCallStatus;
|
|
253
|
+
/** Whether result is expanded by default. Default: false */
|
|
254
|
+
defaultOpen?: boolean;
|
|
255
|
+
children?: ReactNode;
|
|
256
|
+
}
|
|
257
|
+
declare const Root$1: react.ForwardRefExoticComponent<ToolCallRootProps & react.RefAttributes<HTMLDivElement>>;
|
|
258
|
+
interface ToolCallHeaderProps extends HTMLAttributes<HTMLButtonElement> {
|
|
259
|
+
}
|
|
260
|
+
declare const Header: react.ForwardRefExoticComponent<ToolCallHeaderProps & react.RefAttributes<HTMLButtonElement>>;
|
|
261
|
+
interface ToolCallInputProps extends HTMLAttributes<HTMLDivElement> {
|
|
262
|
+
/** Label for the input section. Default: "Input" */
|
|
263
|
+
label?: string;
|
|
264
|
+
}
|
|
265
|
+
declare const Input: react.ForwardRefExoticComponent<ToolCallInputProps & react.RefAttributes<HTMLDivElement>>;
|
|
266
|
+
interface ToolCallOutputProps extends HTMLAttributes<HTMLDivElement> {
|
|
267
|
+
/** Label for the output section. Default: "Output" */
|
|
268
|
+
label?: string;
|
|
269
|
+
}
|
|
270
|
+
declare const Output: react.ForwardRefExoticComponent<ToolCallOutputProps & react.RefAttributes<HTMLDivElement>>;
|
|
271
|
+
|
|
272
|
+
declare const index$1_Header: typeof Header;
|
|
273
|
+
declare const index$1_Input: typeof Input;
|
|
274
|
+
declare const index$1_Output: typeof Output;
|
|
275
|
+
type index$1_ToolCallHeaderProps = ToolCallHeaderProps;
|
|
276
|
+
type index$1_ToolCallInputProps = ToolCallInputProps;
|
|
277
|
+
type index$1_ToolCallOutputProps = ToolCallOutputProps;
|
|
278
|
+
type index$1_ToolCallRootProps = ToolCallRootProps;
|
|
279
|
+
type index$1_ToolCallStatus = ToolCallStatus;
|
|
280
|
+
declare namespace index$1 {
|
|
281
|
+
export { index$1_Header as Header, index$1_Input as Input, index$1_Output as Output, Root$1 as Root, type index$1_ToolCallHeaderProps as ToolCallHeaderProps, type index$1_ToolCallInputProps as ToolCallInputProps, type index$1_ToolCallOutputProps as ToolCallOutputProps, type index$1_ToolCallRootProps as ToolCallRootProps, type index$1_ToolCallStatus as ToolCallStatus };
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
type MessageRole = "user" | "assistant" | "system";
|
|
285
|
+
interface ChatThreadRootProps extends HTMLAttributes<HTMLDivElement> {
|
|
286
|
+
children: ReactNode;
|
|
287
|
+
}
|
|
288
|
+
declare const Root: react.ForwardRefExoticComponent<ChatThreadRootProps & react.RefAttributes<HTMLDivElement>>;
|
|
289
|
+
interface ChatThreadMessagesProps extends HTMLAttributes<HTMLDivElement> {
|
|
290
|
+
children: ReactNode;
|
|
291
|
+
}
|
|
292
|
+
declare const Messages: react.ForwardRefExoticComponent<ChatThreadMessagesProps & react.RefAttributes<HTMLDivElement>>;
|
|
293
|
+
interface ChatThreadMessageProps extends HTMLAttributes<HTMLDivElement> {
|
|
294
|
+
/** The role determines visual styling and alignment */
|
|
295
|
+
role: MessageRole;
|
|
296
|
+
/** Optional avatar element (icon, image, etc.) */
|
|
297
|
+
avatar?: ReactNode;
|
|
298
|
+
/** Display name for the message author */
|
|
299
|
+
name?: string;
|
|
300
|
+
/** Timestamp string to display */
|
|
301
|
+
timestamp?: string;
|
|
302
|
+
children: ReactNode;
|
|
303
|
+
}
|
|
304
|
+
declare const Message: react.ForwardRefExoticComponent<ChatThreadMessageProps & react.RefAttributes<HTMLDivElement>>;
|
|
305
|
+
interface ChatThreadUserMessageProps extends Omit<ChatThreadMessageProps, "role"> {
|
|
306
|
+
}
|
|
307
|
+
declare const UserMessage: react.ForwardRefExoticComponent<ChatThreadUserMessageProps & react.RefAttributes<HTMLDivElement>>;
|
|
308
|
+
interface ChatThreadAssistantMessageProps extends Omit<ChatThreadMessageProps, "role"> {
|
|
309
|
+
}
|
|
310
|
+
declare const AssistantMessage: react.ForwardRefExoticComponent<ChatThreadAssistantMessageProps & react.RefAttributes<HTMLDivElement>>;
|
|
311
|
+
interface ChatThreadSystemMessageProps extends Omit<ChatThreadMessageProps, "role"> {
|
|
312
|
+
}
|
|
313
|
+
declare const SystemMessage: react.ForwardRefExoticComponent<ChatThreadSystemMessageProps & react.RefAttributes<HTMLDivElement>>;
|
|
314
|
+
interface ChatThreadScrollAnchorProps extends HTMLAttributes<HTMLDivElement> {
|
|
315
|
+
}
|
|
316
|
+
declare const ScrollAnchor: react.ForwardRefExoticComponent<ChatThreadScrollAnchorProps & react.RefAttributes<HTMLDivElement>>;
|
|
317
|
+
|
|
318
|
+
declare const index_AssistantMessage: typeof AssistantMessage;
|
|
319
|
+
type index_ChatThreadAssistantMessageProps = ChatThreadAssistantMessageProps;
|
|
320
|
+
type index_ChatThreadMessageProps = ChatThreadMessageProps;
|
|
321
|
+
type index_ChatThreadMessagesProps = ChatThreadMessagesProps;
|
|
322
|
+
type index_ChatThreadRootProps = ChatThreadRootProps;
|
|
323
|
+
type index_ChatThreadScrollAnchorProps = ChatThreadScrollAnchorProps;
|
|
324
|
+
type index_ChatThreadSystemMessageProps = ChatThreadSystemMessageProps;
|
|
325
|
+
type index_ChatThreadUserMessageProps = ChatThreadUserMessageProps;
|
|
326
|
+
declare const index_Message: typeof Message;
|
|
327
|
+
type index_MessageRole = MessageRole;
|
|
328
|
+
declare const index_Messages: typeof Messages;
|
|
329
|
+
declare const index_Root: typeof Root;
|
|
330
|
+
declare const index_ScrollAnchor: typeof ScrollAnchor;
|
|
331
|
+
declare const index_SystemMessage: typeof SystemMessage;
|
|
332
|
+
declare const index_UserMessage: typeof UserMessage;
|
|
333
|
+
declare namespace index {
|
|
334
|
+
export { index_AssistantMessage as AssistantMessage, type index_ChatThreadAssistantMessageProps as ChatThreadAssistantMessageProps, type index_ChatThreadMessageProps as ChatThreadMessageProps, type index_ChatThreadMessagesProps as ChatThreadMessagesProps, type index_ChatThreadRootProps as ChatThreadRootProps, type index_ChatThreadScrollAnchorProps as ChatThreadScrollAnchorProps, type index_ChatThreadSystemMessageProps as ChatThreadSystemMessageProps, type index_ChatThreadUserMessageProps as ChatThreadUserMessageProps, index_Message as Message, type index_MessageRole as MessageRole, index_Messages as Messages, index_Root as Root, index_ScrollAnchor as ScrollAnchor, index_SystemMessage as SystemMessage, index_UserMessage as UserMessage };
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
interface ConfidenceBadgeProps extends HTMLAttributes<HTMLSpanElement> {
|
|
338
|
+
/** Confidence level */
|
|
339
|
+
level: ConfidenceLevel;
|
|
340
|
+
/** Custom label override */
|
|
341
|
+
label?: string;
|
|
342
|
+
/** Show as a small dot indicator instead of full badge */
|
|
343
|
+
variant?: "badge" | "dot" | "inline";
|
|
344
|
+
}
|
|
345
|
+
declare const ConfidenceBadge: react.ForwardRefExoticComponent<ConfidenceBadgeProps & react.RefAttributes<HTMLSpanElement>>;
|
|
346
|
+
|
|
347
|
+
interface CitationInlineProps extends HTMLAttributes<HTMLSpanElement> {
|
|
348
|
+
/** Citation index number */
|
|
349
|
+
index: number;
|
|
350
|
+
/** Source URL */
|
|
351
|
+
href?: string;
|
|
352
|
+
/** Source title */
|
|
353
|
+
sourceTitle?: string;
|
|
354
|
+
/** Preview content shown on hover */
|
|
355
|
+
preview?: ReactNode;
|
|
356
|
+
/** Visual variant */
|
|
357
|
+
variant?: "superscript" | "bracket" | "pill";
|
|
358
|
+
}
|
|
359
|
+
declare const CitationInline: react.ForwardRefExoticComponent<CitationInlineProps & react.RefAttributes<HTMLSpanElement>>;
|
|
360
|
+
interface CitationGroupProps extends HTMLAttributes<HTMLSpanElement> {
|
|
361
|
+
children: ReactNode;
|
|
362
|
+
}
|
|
363
|
+
declare const CitationGroup: react.ForwardRefExoticComponent<CitationGroupProps & react.RefAttributes<HTMLSpanElement>>;
|
|
364
|
+
|
|
365
|
+
interface RefusalCardProps extends HTMLAttributes<HTMLDivElement> {
|
|
366
|
+
/** Why the request was refused */
|
|
367
|
+
reason?: string;
|
|
368
|
+
/** The type of refusal */
|
|
369
|
+
type?: "safety" | "capability" | "policy" | "context";
|
|
370
|
+
/** Suggested alternative prompts */
|
|
371
|
+
suggestions?: string[];
|
|
372
|
+
/** Called when user clicks a suggestion */
|
|
373
|
+
onSuggestionClick?: (suggestion: string) => void;
|
|
374
|
+
/** Custom icon */
|
|
375
|
+
icon?: ReactNode;
|
|
376
|
+
}
|
|
377
|
+
declare const RefusalCard: react.ForwardRefExoticComponent<RefusalCardProps & react.RefAttributes<HTMLDivElement>>;
|
|
378
|
+
|
|
379
|
+
interface MarkdownRendererProps extends HTMLAttributes<HTMLDivElement> {
|
|
380
|
+
/** Markdown text to render */
|
|
381
|
+
content: string;
|
|
382
|
+
/** Custom code block renderer */
|
|
383
|
+
renderCode?: (code: string, lang?: string) => ReactNode;
|
|
384
|
+
}
|
|
385
|
+
declare const MarkdownRenderer: react.ForwardRefExoticComponent<MarkdownRendererProps & react.RefAttributes<HTMLDivElement>>;
|
|
386
|
+
|
|
387
|
+
type StatusIndicatorState = "idle" | "thinking" | "streaming" | "tool-calling" | "error";
|
|
388
|
+
interface StatusIndicatorProps extends HTMLAttributes<HTMLSpanElement> {
|
|
389
|
+
/** Current state */
|
|
390
|
+
state?: StatusIndicatorState;
|
|
391
|
+
/** Custom label. Default: auto from state */
|
|
392
|
+
label?: string;
|
|
393
|
+
/** Custom icon element */
|
|
394
|
+
icon?: ReactNode;
|
|
395
|
+
/** Color scheme. Default: auto from state */
|
|
396
|
+
color?: "purple" | "amber" | "blue" | "red" | "gray";
|
|
397
|
+
/** Animation style. "pulse" = fade in/out, "sweep" = light moves letter by letter. Default: "sweep" */
|
|
398
|
+
animation?: "pulse" | "sweep";
|
|
399
|
+
}
|
|
400
|
+
declare const StatusIndicator: react.ForwardRefExoticComponent<StatusIndicatorProps & react.RefAttributes<HTMLSpanElement>>;
|
|
401
|
+
|
|
402
|
+
interface TokenUsageProps extends HTMLAttributes<HTMLDivElement> {
|
|
403
|
+
/** Number of input tokens used */
|
|
404
|
+
inputTokens: number;
|
|
405
|
+
/** Number of output tokens used */
|
|
406
|
+
outputTokens: number;
|
|
407
|
+
/** Maximum token budget */
|
|
408
|
+
maxTokens: number;
|
|
409
|
+
/** Cost in dollars (optional) */
|
|
410
|
+
cost?: number;
|
|
411
|
+
}
|
|
412
|
+
declare const TokenUsage: react.ForwardRefExoticComponent<TokenUsageProps & react.RefAttributes<HTMLDivElement>>;
|
|
413
|
+
|
|
414
|
+
interface ModelOption {
|
|
415
|
+
/** Unique model identifier */
|
|
416
|
+
id: string;
|
|
417
|
+
/** Display name */
|
|
418
|
+
name: string;
|
|
419
|
+
/** Optional description shown in dropdown */
|
|
420
|
+
description?: string;
|
|
421
|
+
/** Optional badge text (e.g. "New", "Fast") */
|
|
422
|
+
badge?: string;
|
|
423
|
+
}
|
|
424
|
+
interface ModelSelectorProps extends Omit<HTMLAttributes<HTMLDivElement>, "onChange"> {
|
|
425
|
+
/** Available models */
|
|
426
|
+
models: ModelOption[];
|
|
427
|
+
/** Currently selected model id */
|
|
428
|
+
value: string;
|
|
429
|
+
/** Called when user selects a model */
|
|
430
|
+
onChange: (modelId: string) => void;
|
|
431
|
+
}
|
|
432
|
+
declare const ModelSelector: react.ForwardRefExoticComponent<ModelSelectorProps & react.RefAttributes<HTMLDivElement>>;
|
|
433
|
+
|
|
434
|
+
interface SourceCardProps extends HTMLAttributes<HTMLDivElement> {
|
|
435
|
+
/** Source title */
|
|
436
|
+
title: string;
|
|
437
|
+
/** Source URL (optional) */
|
|
438
|
+
url?: string;
|
|
439
|
+
/** Preview text content */
|
|
440
|
+
content: string;
|
|
441
|
+
/** Relevance score from 0 to 1 */
|
|
442
|
+
relevance: number;
|
|
443
|
+
/** Display variant */
|
|
444
|
+
variant?: "compact" | "full";
|
|
445
|
+
}
|
|
446
|
+
declare const SourceCard: react.ForwardRefExoticComponent<SourceCardProps & react.RefAttributes<HTMLDivElement>>;
|
|
447
|
+
|
|
448
|
+
type FileAttachmentType = "image" | "pdf" | "code" | "text" | "csv" | "other";
|
|
449
|
+
interface FileAttachmentProps extends HTMLAttributes<HTMLDivElement> {
|
|
450
|
+
/** File name */
|
|
451
|
+
name: string;
|
|
452
|
+
/** Human-readable file size, e.g. "2.4 MB" */
|
|
453
|
+
size?: string;
|
|
454
|
+
/** File type — determines the icon */
|
|
455
|
+
type?: FileAttachmentType;
|
|
456
|
+
/** Image URL for thumbnail preview (card variant) */
|
|
457
|
+
preview?: string;
|
|
458
|
+
/** Upload progress 0-100 — shows progress bar when present */
|
|
459
|
+
progress?: number;
|
|
460
|
+
/** Called when remove button is clicked */
|
|
461
|
+
onRemove?: () => void;
|
|
462
|
+
/** Display variant */
|
|
463
|
+
variant?: "chip" | "card";
|
|
464
|
+
}
|
|
465
|
+
declare const FileAttachment: react.ForwardRefExoticComponent<FileAttachmentProps & react.RefAttributes<HTMLDivElement>>;
|
|
466
|
+
|
|
467
|
+
interface CodeBlockProps extends HTMLAttributes<HTMLDivElement> {
|
|
468
|
+
/** The code string to display */
|
|
469
|
+
code: string;
|
|
470
|
+
/** Language label shown in the header */
|
|
471
|
+
language?: string;
|
|
472
|
+
/** Show line numbers. Default: false */
|
|
473
|
+
showLineNumbers?: boolean;
|
|
474
|
+
/** Max height before scroll. Default: "400px" */
|
|
475
|
+
maxHeight?: string;
|
|
476
|
+
/** Called when the copy button is clicked */
|
|
477
|
+
onCopy?: () => void;
|
|
478
|
+
}
|
|
479
|
+
declare const CodeBlock: react.ForwardRefExoticComponent<CodeBlockProps & react.RefAttributes<HTMLDivElement>>;
|
|
480
|
+
|
|
481
|
+
interface ConversationBranchProps extends HTMLAttributes<HTMLDivElement> {
|
|
482
|
+
/** Current branch index (1-indexed) */
|
|
483
|
+
current: number;
|
|
484
|
+
/** Total number of branches */
|
|
485
|
+
total: number;
|
|
486
|
+
/** Called when navigating to the previous branch */
|
|
487
|
+
onPrevious?: () => void;
|
|
488
|
+
/** Called when navigating to the next branch */
|
|
489
|
+
onNext?: () => void;
|
|
490
|
+
}
|
|
491
|
+
declare const ConversationBranch: react.ForwardRefExoticComponent<ConversationBranchProps & react.RefAttributes<HTMLDivElement>>;
|
|
492
|
+
|
|
493
|
+
interface TopicCardProps extends Omit<HTMLAttributes<HTMLButtonElement>, "onSelect"> {
|
|
494
|
+
/** Card title / prompt summary */
|
|
495
|
+
title: string;
|
|
496
|
+
/** Optional description or subtitle (hidden in compact mode) */
|
|
497
|
+
description?: string;
|
|
498
|
+
/** Optional icon element */
|
|
499
|
+
icon?: ReactNode;
|
|
500
|
+
/** Called when the card is clicked */
|
|
501
|
+
onSelect?: (title: string) => void;
|
|
502
|
+
/** Visual variant — set automatically by SuggestTopics, but can be overridden */
|
|
503
|
+
variant?: "card" | "compact";
|
|
504
|
+
}
|
|
505
|
+
declare const TopicCard: react.ForwardRefExoticComponent<TopicCardProps & react.RefAttributes<HTMLButtonElement>>;
|
|
506
|
+
interface SuggestTopicsProps extends HTMLAttributes<HTMLDivElement> {
|
|
507
|
+
/** Layout variant. "grid" for cards, "compact" for horizontal scroll pills. Default: "grid" */
|
|
508
|
+
variant?: "grid" | "compact";
|
|
509
|
+
/** Number of columns (grid variant only). Default: 2 */
|
|
510
|
+
columns?: 1 | 2 | 3;
|
|
511
|
+
children: ReactNode;
|
|
512
|
+
}
|
|
513
|
+
declare const SuggestTopics: react.ForwardRefExoticComponent<SuggestTopicsProps & react.RefAttributes<HTMLDivElement>>;
|
|
514
|
+
|
|
515
|
+
export { index as ChatThread, type ChatThreadMessageProps, type ChatThreadRootProps, type ChunkSize, CitationGroup, type CitationGroupProps, CitationInline, type CitationInlineProps, CodeBlock, type CodeBlockProps, ConfidenceBadge, type ConfidenceBadgeProps, type ConfidenceLevel, ConversationBranch, type ConversationBranchProps, index$3 as FeedbackBar, FileAttachment, type FileAttachmentProps, type FileAttachmentType, MarkdownRenderer, type MarkdownRendererProps, type MessageRole, type ModelOption, ModelSelector, type ModelSelectorProps, index$4 as PromptBox, RefusalCard, type RefusalCardProps, SourceCard, type SourceCardProps, StatusIndicator, type StatusIndicatorProps, type StatusIndicatorState, type StreamingState, index$5 as StreamingText, SuggestTopics, type SuggestTopicsProps, index$2 as ThinkingBlock, type ThinkingBlockRootProps, type ThinkingState, TokenUsage, type TokenUsageProps, index$1 as ToolCall, type ToolCallRootProps, type ToolCallStatus, TopicCard, type TopicCardProps, type UseStreamingTextOptions, type UseStreamingTextReturn, useStreamingText };
|