@sarchauhan/chat 0.0.0-stage → 0.0.1
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 +130 -2
- package/dist/blocks.css +291 -0
- package/dist/chat.css +959 -0
- package/dist/chat.select.css +345 -0
- package/dist/chips.css +248 -0
- package/dist/chunk-5SNRYULC.mjs +2201 -0
- package/dist/chunk-5SNRYULC.mjs.map +1 -0
- package/dist/index-DabpPX_p.d.mts +177 -0
- package/dist/index-DabpPX_p.d.ts +177 -0
- package/dist/index.d.mts +382 -0
- package/dist/index.d.ts +382 -0
- package/dist/index.js +4386 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +2247 -0
- package/dist/index.mjs.map +1 -0
- package/dist/markdown.css +247 -0
- package/dist/motion/error-state-shake.css +57 -0
- package/dist/motion/icon-swap.css +30 -0
- package/dist/motion/index.css +6 -0
- package/dist/motion/menu-dropdown.css +35 -0
- package/dist/motion/success-check.css +51 -0
- package/dist/motion/text-states-swap.css +28 -0
- package/dist/motion/tokens.css +96 -0
- package/dist/styles.css +11 -0
- package/dist/theme/tokens.css +253 -0
- package/dist/theme/typography.css +115 -0
- package/dist/widgets.css +570 -0
- package/dist/widgets.d.mts +4 -0
- package/dist/widgets.d.ts +4 -0
- package/dist/widgets.js +1996 -0
- package/dist/widgets.js.map +1 -0
- package/dist/widgets.mjs +48 -0
- package/dist/widgets.mjs.map +1 -0
- package/package.json +76 -4
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,382 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ReactNode, CSSProperties, Dispatch, HTMLAttributes, RefObject } from 'react';
|
|
3
|
+
import * as _sarchauhan_adapter from '@sarchauhan/adapter';
|
|
4
|
+
import { ChatAdapter, ChatMessage, ChatStatus, ChatThread } from '@sarchauhan/adapter';
|
|
5
|
+
export { ChatAdapter, ChatMessage, ChatMessagePart, ChatRole, ChatStatus, ChatThread, EditMessageInput, SendMessageInput, defineAdapter } from '@sarchauhan/adapter';
|
|
6
|
+
import { C as ChatWidgetInput } from './index-DabpPX_p.js';
|
|
7
|
+
export { A as ArtifactWidget, a as ArtifactWidgetProps, b as ArtifactsWidget, c as ArtifactsWidgetProps, d as ChatWidgetComponent, e as ChatWidgetDefinition, f as ChatWidgetEntry, g as ChatWidgetProps, h as ChatWidgetRegistry, D as DefineWidgetOptions, i as DiffLine, P as PatchWidget, j as PatchWidgetProps, Q as QuestionAnswer, k as QuestionOption, l as QuestionWidget, m as QuestionWidgetProps, R as ReadFileWidget, n as ReadFileWidgetProps, o as ResponsiveDetail, p as ResponsiveDetailProps, S as SearchResult, q as SearchWidget, r as SearchWidgetProps, s as SubagentWidget, t as SubagentWidgetProps, T as ToolWidgetProps, W as WidgetComponentProps, u as WidgetControls, v as WidgetProvider, w as WidgetResponse, x as WidgetState, y as computeDiff, z as computeTextDiff, B as computeToolState, E as computeToolWidget, F as createWidgetRegistry, G as defineWidget, H as formatArtifactSize, I as normalizeSearchResults, J as prebuiltWidgets, K as safeArtifactUrl, L as safeResultUrl, M as useWidgets } from './index-DabpPX_p.js';
|
|
8
|
+
import { AgentDataPart, AgentWidgetPart } from '@sarchauhan/protocol';
|
|
9
|
+
export { AgentArtifact, AgentEvent, AgentMessage, AgentPart, AgentSubagent, AgentSubagentState, AgentToolPart, AgentWidgetPart, applyAgentEvent, createAgentMessageState, createArtifactData, createSubagentData, createWidgetData, normalizeAgentMessage, normalizeAgentParts, parseArtifact, parseSubagent, reduceAgentEvents } from '@sarchauhan/protocol';
|
|
10
|
+
|
|
11
|
+
type ChatTheme = "light" | "dark" | "system";
|
|
12
|
+
type ThemeContextValue = {
|
|
13
|
+
theme: ChatTheme;
|
|
14
|
+
resolvedTheme: "light" | "dark";
|
|
15
|
+
setTheme: (theme: ChatTheme) => void;
|
|
16
|
+
toggleTheme: () => void;
|
|
17
|
+
};
|
|
18
|
+
type ThemeProviderProps = {
|
|
19
|
+
children: ReactNode;
|
|
20
|
+
defaultTheme?: ChatTheme;
|
|
21
|
+
theme?: ChatTheme;
|
|
22
|
+
onThemeChange?: (theme: ChatTheme) => void;
|
|
23
|
+
storageKey?: string;
|
|
24
|
+
};
|
|
25
|
+
declare function ThemeProvider({ children, defaultTheme, theme: controlledTheme, onThemeChange, storageKey, }: ThemeProviderProps): react_jsx_runtime.JSX.Element;
|
|
26
|
+
declare function useTheme(): ThemeContextValue;
|
|
27
|
+
|
|
28
|
+
type ComposerCollapsedVariant = "pill" | "circle";
|
|
29
|
+
declare const ChatComposer: ({ showModelSelector, collapsedVariant, defaultExpanded, }: {
|
|
30
|
+
showModelSelector?: boolean;
|
|
31
|
+
/** Resting shape when the composer is empty and blurred. Default is the wide pill. */
|
|
32
|
+
collapsedVariant?: ComposerCollapsedVariant;
|
|
33
|
+
/** Open on the large composer. Used so a story can show the model picker without a click. */
|
|
34
|
+
defaultExpanded?: boolean;
|
|
35
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
36
|
+
|
|
37
|
+
type BaseWidgetProps = {
|
|
38
|
+
label: string;
|
|
39
|
+
title: ReactNode;
|
|
40
|
+
status?: ReactNode;
|
|
41
|
+
meta?: ReactNode;
|
|
42
|
+
className?: string;
|
|
43
|
+
children?: ReactNode;
|
|
44
|
+
};
|
|
45
|
+
declare function BaseWidget({ label, title, status, meta, className, children, }: BaseWidgetProps): react_jsx_runtime.JSX.Element;
|
|
46
|
+
|
|
47
|
+
type ChatProps = {
|
|
48
|
+
adapter: ChatAdapter;
|
|
49
|
+
className?: string;
|
|
50
|
+
defaultThreadId?: string;
|
|
51
|
+
defaultProvider?: string;
|
|
52
|
+
registryUrl?: string;
|
|
53
|
+
style?: CSSProperties;
|
|
54
|
+
/** Widget map or defineWidget(...) array. */
|
|
55
|
+
widgets?: ChatWidgetInput;
|
|
56
|
+
/** Controlled theme. Omit to manage theme internally. */
|
|
57
|
+
theme?: ChatTheme;
|
|
58
|
+
defaultTheme?: ChatTheme;
|
|
59
|
+
onThemeChange?: (theme: ChatTheme) => void;
|
|
60
|
+
showThemeToggle?: boolean;
|
|
61
|
+
showModelSelector?: boolean;
|
|
62
|
+
collapsedVariant?: ComposerCollapsedVariant;
|
|
63
|
+
defaultExpanded?: boolean;
|
|
64
|
+
};
|
|
65
|
+
declare function Chat({ adapter, className, defaultThreadId, defaultProvider, registryUrl, style, widgets, theme, defaultTheme, onThemeChange, showThemeToggle, showModelSelector, collapsedVariant, defaultExpanded, }: ChatProps): react_jsx_runtime.JSX.Element;
|
|
66
|
+
|
|
67
|
+
declare enum ProviderId {
|
|
68
|
+
SYMPHONY = "symphony",
|
|
69
|
+
MOCK = "mock",
|
|
70
|
+
OPENAI = "openai",
|
|
71
|
+
GOOGLE = "google",
|
|
72
|
+
GEMINI = "gemini",
|
|
73
|
+
CLAUDE = "anthropic",
|
|
74
|
+
GROK = "grok",
|
|
75
|
+
OLLAMA = "ollama",
|
|
76
|
+
LOCAL = "local"
|
|
77
|
+
}
|
|
78
|
+
type RegistryModel = {
|
|
79
|
+
id: string;
|
|
80
|
+
label: string;
|
|
81
|
+
description?: string;
|
|
82
|
+
thinkingLevels?: string[];
|
|
83
|
+
};
|
|
84
|
+
type RegistryProvider = {
|
|
85
|
+
/** Known `ProviderId` values or a Symphony / custom registry id. */
|
|
86
|
+
id: string;
|
|
87
|
+
name?: string;
|
|
88
|
+
label: string;
|
|
89
|
+
logo?: string;
|
|
90
|
+
defaultModel: string;
|
|
91
|
+
models: RegistryModel[];
|
|
92
|
+
};
|
|
93
|
+
type RegistryConfig = {
|
|
94
|
+
defaultProviderId: string;
|
|
95
|
+
providers: RegistryProvider[];
|
|
96
|
+
};
|
|
97
|
+
declare const isProviderId: (value: unknown) => value is ProviderId;
|
|
98
|
+
declare const parseRegistryConfig: (value: unknown) => RegistryConfig | undefined;
|
|
99
|
+
type ChatReference = {
|
|
100
|
+
id: string;
|
|
101
|
+
text: string;
|
|
102
|
+
};
|
|
103
|
+
/** File part carried on the existing send payload. `url` is a data URL. */
|
|
104
|
+
type ComposerFile = {
|
|
105
|
+
mediaType: string;
|
|
106
|
+
url: string;
|
|
107
|
+
filename?: string;
|
|
108
|
+
};
|
|
109
|
+
type ComposerAttachment = ComposerFile & {
|
|
110
|
+
id: string;
|
|
111
|
+
filename: string;
|
|
112
|
+
};
|
|
113
|
+
type SendMessage = (message: {
|
|
114
|
+
text: string;
|
|
115
|
+
files?: ComposerFile[];
|
|
116
|
+
}, options?: {
|
|
117
|
+
body?: {
|
|
118
|
+
provider?: string;
|
|
119
|
+
model?: string;
|
|
120
|
+
};
|
|
121
|
+
}) => Promise<void>;
|
|
122
|
+
|
|
123
|
+
type ChatContextProviderProps = {
|
|
124
|
+
adapter: ChatAdapter;
|
|
125
|
+
children: ReactNode;
|
|
126
|
+
defaultProvider?: string;
|
|
127
|
+
defaultThreadId?: string;
|
|
128
|
+
registryUrl?: string;
|
|
129
|
+
};
|
|
130
|
+
declare function ChatContextProvider({ adapter, children, defaultProvider, defaultThreadId, registryUrl, }: ChatContextProviderProps): react_jsx_runtime.JSX.Element;
|
|
131
|
+
|
|
132
|
+
type ComposerContextValue = {
|
|
133
|
+
input: string;
|
|
134
|
+
setInput: (value: string) => void;
|
|
135
|
+
references: ChatReference[];
|
|
136
|
+
addReference: (text: string) => void;
|
|
137
|
+
removeReference: (id: string) => void;
|
|
138
|
+
clearReferences: () => void;
|
|
139
|
+
attachments: ComposerAttachment[];
|
|
140
|
+
addFiles: (files: FileList | readonly File[]) => Promise<void>;
|
|
141
|
+
removeAttachment: (id: string) => void;
|
|
142
|
+
disabled: boolean;
|
|
143
|
+
canSend: boolean;
|
|
144
|
+
submitInput: () => Promise<void>;
|
|
145
|
+
};
|
|
146
|
+
declare function useComposer(): ComposerContextValue;
|
|
147
|
+
|
|
148
|
+
type MessagesContextValue = {
|
|
149
|
+
messages: ChatMessage[];
|
|
150
|
+
status: ChatStatus;
|
|
151
|
+
isSending: boolean;
|
|
152
|
+
isWaitingForResponse: boolean;
|
|
153
|
+
sendMessage: SendMessage;
|
|
154
|
+
editAndResendMessage: (messageId: string, text: string) => Promise<void>;
|
|
155
|
+
stopResponse: () => void;
|
|
156
|
+
};
|
|
157
|
+
declare function useMessages(): MessagesContextValue;
|
|
158
|
+
|
|
159
|
+
type ModelContextValue = {
|
|
160
|
+
registry: RegistryConfig;
|
|
161
|
+
provider: string;
|
|
162
|
+
model: string;
|
|
163
|
+
thinkingLevels: Record<string, string>;
|
|
164
|
+
getThinkingLevel: (providerId: string, modelId: string) => string | undefined;
|
|
165
|
+
setThinkingLevel: (providerId: string, modelId: string, level: string) => void;
|
|
166
|
+
setProvider: (provider: string, model?: string) => void;
|
|
167
|
+
setModel: (model: string) => void;
|
|
168
|
+
providerRef: React.MutableRefObject<string>;
|
|
169
|
+
modelRef: React.MutableRefObject<string>;
|
|
170
|
+
thinkingLevelsRef: React.MutableRefObject<Record<string, string>>;
|
|
171
|
+
};
|
|
172
|
+
declare function useModel(): ModelContextValue;
|
|
173
|
+
|
|
174
|
+
type ThreadContextValue = {
|
|
175
|
+
threads: ChatThread[];
|
|
176
|
+
activeThreadId: string | null;
|
|
177
|
+
isLoadingThread: boolean;
|
|
178
|
+
activeThreadIdRef: React.MutableRefObject<string | null>;
|
|
179
|
+
setThreads: React.Dispatch<React.SetStateAction<ChatThread[]>>;
|
|
180
|
+
setIsLoadingThread: React.Dispatch<React.SetStateAction<boolean>>;
|
|
181
|
+
selectThread: (threadId: string) => Promise<void>;
|
|
182
|
+
createThread: () => Promise<void>;
|
|
183
|
+
deleteThread: (threadId: string) => Promise<void>;
|
|
184
|
+
};
|
|
185
|
+
declare function useThread(): ThreadContextValue;
|
|
186
|
+
|
|
187
|
+
type CompatAction = {
|
|
188
|
+
type: "setInput";
|
|
189
|
+
data: {
|
|
190
|
+
input: string;
|
|
191
|
+
};
|
|
192
|
+
} | {
|
|
193
|
+
type: "setProvider";
|
|
194
|
+
data: {
|
|
195
|
+
provider: string;
|
|
196
|
+
model?: string;
|
|
197
|
+
};
|
|
198
|
+
} | {
|
|
199
|
+
type: "setModel";
|
|
200
|
+
data: {
|
|
201
|
+
model: string;
|
|
202
|
+
};
|
|
203
|
+
} | {
|
|
204
|
+
type: "addReference";
|
|
205
|
+
data: {
|
|
206
|
+
text: string;
|
|
207
|
+
};
|
|
208
|
+
} | {
|
|
209
|
+
type: "removeReference";
|
|
210
|
+
data: {
|
|
211
|
+
id: string;
|
|
212
|
+
};
|
|
213
|
+
} | {
|
|
214
|
+
type: "clearReferences";
|
|
215
|
+
};
|
|
216
|
+
/**
|
|
217
|
+
* Compatibility facade over split contexts.
|
|
218
|
+
* Prefer useComposer / useMessages / useModel / useThread in UI components
|
|
219
|
+
* so typing and streaming do not share one render subscription.
|
|
220
|
+
*/
|
|
221
|
+
declare function useChat(): {
|
|
222
|
+
state: {
|
|
223
|
+
input: string;
|
|
224
|
+
provider: string;
|
|
225
|
+
model: string;
|
|
226
|
+
references: ChatReference[];
|
|
227
|
+
disabled: boolean;
|
|
228
|
+
sendDisabled: boolean;
|
|
229
|
+
};
|
|
230
|
+
dispatch: Dispatch<CompatAction>;
|
|
231
|
+
messages: _sarchauhan_adapter.ChatMessage[];
|
|
232
|
+
status: _sarchauhan_adapter.ChatStatus;
|
|
233
|
+
activeThreadId: string | null;
|
|
234
|
+
threads: _sarchauhan_adapter.ChatThread[];
|
|
235
|
+
isLoadingThread: boolean;
|
|
236
|
+
registry: RegistryConfig;
|
|
237
|
+
sendMessage: SendMessage;
|
|
238
|
+
submitInput: () => Promise<void>;
|
|
239
|
+
editAndResendMessage: (messageId: string, text: string) => Promise<void>;
|
|
240
|
+
stopResponse: () => void;
|
|
241
|
+
selectThread: (threadId: string) => Promise<void>;
|
|
242
|
+
createThread: () => Promise<void>;
|
|
243
|
+
deleteThread: (threadId: string) => Promise<void>;
|
|
244
|
+
};
|
|
245
|
+
|
|
246
|
+
declare const Message: () => react_jsx_runtime.JSX.Element;
|
|
247
|
+
|
|
248
|
+
type MessageFeedbackProps = {
|
|
249
|
+
responseText: string;
|
|
250
|
+
onRegenerate: () => void;
|
|
251
|
+
canRegenerate: boolean;
|
|
252
|
+
disabled?: boolean;
|
|
253
|
+
};
|
|
254
|
+
declare const MessageFeedback: ({ responseText, onRegenerate, canRegenerate, disabled, }: MessageFeedbackProps) => react_jsx_runtime.JSX.Element | null;
|
|
255
|
+
|
|
256
|
+
declare const MessageUsage: ({ parts }: {
|
|
257
|
+
parts: AgentDataPart[];
|
|
258
|
+
}) => react_jsx_runtime.JSX.Element | null;
|
|
259
|
+
|
|
260
|
+
declare const formatElapsed: (milliseconds: number, showTenths?: boolean) => string;
|
|
261
|
+
declare const formatElapsedWords: (milliseconds: number) => string;
|
|
262
|
+
type LoadingStateProps = {
|
|
263
|
+
label?: string;
|
|
264
|
+
compact?: boolean;
|
|
265
|
+
};
|
|
266
|
+
declare const LoadingState: ({ label, compact }: LoadingStateProps) => react_jsx_runtime.JSX.Element;
|
|
267
|
+
|
|
268
|
+
type ThinkingBlockProps = {
|
|
269
|
+
isComplete: boolean;
|
|
270
|
+
elapsedMs?: number;
|
|
271
|
+
children?: ReactNode;
|
|
272
|
+
};
|
|
273
|
+
declare const ThinkingBlock: ({ isComplete, elapsedMs, children }: ThinkingBlockProps) => react_jsx_runtime.JSX.Element;
|
|
274
|
+
|
|
275
|
+
type MessageContentProps = {
|
|
276
|
+
parts: Array<{
|
|
277
|
+
type: string;
|
|
278
|
+
[key: string]: unknown;
|
|
279
|
+
}>;
|
|
280
|
+
isUser?: boolean;
|
|
281
|
+
};
|
|
282
|
+
declare const MessageContent: ({ parts, isUser }: MessageContentProps) => react_jsx_runtime.JSX.Element;
|
|
283
|
+
|
|
284
|
+
declare function ThemeToggle({ className }: {
|
|
285
|
+
className?: string;
|
|
286
|
+
}): react_jsx_runtime.JSX.Element;
|
|
287
|
+
|
|
288
|
+
declare function WidgetRenderer({ part, pending, }: {
|
|
289
|
+
part: AgentWidgetPart;
|
|
290
|
+
pending?: boolean;
|
|
291
|
+
}): react_jsx_runtime.JSX.Element;
|
|
292
|
+
|
|
293
|
+
/**
|
|
294
|
+
* Public motion class names and data-attribute hooks from the
|
|
295
|
+
* transitions.dev recipes packaged with `@sarchauhan/chat`.
|
|
296
|
+
*
|
|
297
|
+
* Consumers should import these constants instead of hard-coding
|
|
298
|
+
* `t-*` strings so class names stay autocomplete-safe and typechecked.
|
|
299
|
+
*/
|
|
300
|
+
declare const motion: {
|
|
301
|
+
readonly textSwap: "t-text-swap";
|
|
302
|
+
readonly isExit: "is-exit";
|
|
303
|
+
readonly isEnterStart: "is-enter-start";
|
|
304
|
+
readonly iconSwap: "t-icon-swap";
|
|
305
|
+
readonly icon: "t-icon";
|
|
306
|
+
readonly successCheck: "t-success-check";
|
|
307
|
+
readonly dropdown: "t-dropdown";
|
|
308
|
+
readonly isOpen: "is-open";
|
|
309
|
+
readonly isClosing: "is-closing";
|
|
310
|
+
readonly inputWrap: "t-input-wrap";
|
|
311
|
+
readonly input: "t-input";
|
|
312
|
+
readonly errorMsg: "t-error-msg";
|
|
313
|
+
readonly isError: "is-error";
|
|
314
|
+
readonly isShaking: "is-shaking";
|
|
315
|
+
};
|
|
316
|
+
type MotionClass = (typeof motion)[keyof typeof motion];
|
|
317
|
+
declare const iconSwapStates: readonly ["a", "b"];
|
|
318
|
+
type IconSwapState = (typeof iconSwapStates)[number];
|
|
319
|
+
declare const successCheckStates: readonly ["out", "in"];
|
|
320
|
+
type SuccessCheckState = (typeof successCheckStates)[number];
|
|
321
|
+
declare const dropdownOrigins: readonly ["top-left", "top-center", "top-right", "bottom-left", "bottom-center", "bottom-right"];
|
|
322
|
+
type DropdownOrigin = (typeof dropdownOrigins)[number];
|
|
323
|
+
declare const motionData: {
|
|
324
|
+
readonly state: "data-state";
|
|
325
|
+
readonly icon: "data-icon";
|
|
326
|
+
readonly origin: "data-origin";
|
|
327
|
+
readonly open: "data-open";
|
|
328
|
+
};
|
|
329
|
+
declare const dropdownPhases: readonly ["rest", "open", "closing"];
|
|
330
|
+
type DropdownPhase = (typeof dropdownPhases)[number];
|
|
331
|
+
|
|
332
|
+
declare const prefersReducedMotion: () => boolean;
|
|
333
|
+
declare const motionRoot: (node?: Element | null) => Element | null;
|
|
334
|
+
/** Read a duration custom property (ms) from `.chat-root`, with a numeric fallback. */
|
|
335
|
+
declare const readDurationMs: (name: string, fallback: number, node?: Element | null) => number;
|
|
336
|
+
type SwapTextOptions = {
|
|
337
|
+
onSwap?: () => void;
|
|
338
|
+
};
|
|
339
|
+
/**
|
|
340
|
+
* Three-phase text swap from transitions.dev (04-text-states-swap):
|
|
341
|
+
* exit → swap content → enter-start (no transition) → rest.
|
|
342
|
+
*/
|
|
343
|
+
declare const swapText: (el: HTMLElement, next: string, options?: SwapTextOptions) => number | undefined;
|
|
344
|
+
declare const openDropdown: (el: HTMLElement) => void;
|
|
345
|
+
declare const closeDropdown: (el: HTMLElement, onClosed?: () => void) => number;
|
|
346
|
+
type TriggerErrorShakeOptions = {
|
|
347
|
+
/** Keep `.is-error` after the shake (persistent tool errors). Default: auto-revert. */
|
|
348
|
+
revert?: boolean;
|
|
349
|
+
};
|
|
350
|
+
/**
|
|
351
|
+
* Replay the error shake from a clean baseline (12-error-state-shake).
|
|
352
|
+
* `.is-error` and `.is-shaking` stay orthogonal so the shake can restart
|
|
353
|
+
* without flickering the error treatment.
|
|
354
|
+
*/
|
|
355
|
+
declare const triggerErrorShake: (wrap: HTMLElement, options?: TriggerErrorShakeOptions) => void;
|
|
356
|
+
declare const clearErrorShake: (wrap: HTMLElement) => void;
|
|
357
|
+
/** Measure an SVG path and set stroke-dasharray for the success-check draw. */
|
|
358
|
+
declare const calibrateCheckPath: (path: SVGPathElement) => void;
|
|
359
|
+
|
|
360
|
+
type TextSwapProps = {
|
|
361
|
+
text: string;
|
|
362
|
+
} & Omit<HTMLAttributes<HTMLSpanElement>, "children">;
|
|
363
|
+
/**
|
|
364
|
+
* Status-line text that swaps in place (transitions.dev text-states-swap).
|
|
365
|
+
* React keeps the outgoing string painted until the exit phase finishes.
|
|
366
|
+
*/
|
|
367
|
+
declare function TextSwap({ text, className, ...props }: TextSwapProps): react_jsx_runtime.JSX.Element;
|
|
368
|
+
|
|
369
|
+
/**
|
|
370
|
+
* Keep a dropdown mounted through the close tween and apply the
|
|
371
|
+
* documented `.is-open` / `.is-closing` hooks (05-menu-dropdown).
|
|
372
|
+
*
|
|
373
|
+
* Mounts at rest (pre-scale, opacity 0), then adds `.is-open` on the
|
|
374
|
+
* next frame so the open transition actually plays.
|
|
375
|
+
*/
|
|
376
|
+
declare function useDropdownPresence(open: boolean, root?: Element | RefObject<Element | null> | null): {
|
|
377
|
+
readonly mounted: boolean;
|
|
378
|
+
readonly phase: "open" | "rest" | "closing";
|
|
379
|
+
readonly className: "is-open" | "is-closing" | undefined;
|
|
380
|
+
};
|
|
381
|
+
|
|
382
|
+
export { BaseWidget, type BaseWidgetProps, Chat, ChatComposer, ChatContextProvider, type ChatReference, type ChatTheme, ChatWidgetInput, type ComposerAttachment, type ComposerCollapsedVariant, type ComposerFile, type DropdownOrigin, type DropdownPhase, type IconSwapState, LoadingState, Message, MessageContent, MessageFeedback, MessageUsage, type MotionClass, ProviderId, type RegistryConfig, type RegistryModel, type RegistryProvider, type SendMessage, type SuccessCheckState, TextSwap, ThemeProvider, ThemeToggle, ThinkingBlock, WidgetRenderer, calibrateCheckPath, clearErrorShake, closeDropdown, dropdownOrigins, formatElapsed, formatElapsedWords, iconSwapStates, isProviderId, motion, motionData, motionRoot, openDropdown, parseRegistryConfig, prefersReducedMotion, readDurationMs, successCheckStates, swapText, triggerErrorShake, useChat, useComposer, useDropdownPresence, useMessages, useModel, useTheme, useThread };
|