@mcp-b/react-components 0.3.0 → 0.5.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.
Files changed (59) hide show
  1. package/dist/{CodeBlock-C2Xjxu9M.js → CodeBlock-D-a84xBL.js} +1 -1
  2. package/dist/{FileTree-D0c9Yj9U.js → FileTree-D8rtTLgK.js} +1 -1
  3. package/dist/attachment-preview-ChtC3HiU.js +25 -0
  4. package/dist/components/Activity.js +1 -1
  5. package/dist/components/AgentChat.d.ts +31 -1
  6. package/dist/components/AgentChat.js +166 -38
  7. package/dist/components/AgentConnection.js +3 -3
  8. package/dist/components/Artifact.js +1 -1
  9. package/dist/components/BrowserLiveView.js +2 -2
  10. package/dist/components/BrowserReplay.js +1 -1
  11. package/dist/components/ChainOfThought.d.ts +1 -1
  12. package/dist/components/ChainOfThought.js +1 -1
  13. package/dist/components/CodeBlock.js +1 -1
  14. package/dist/components/Commit.js +2 -2
  15. package/dist/components/Context.d.ts +28 -27
  16. package/dist/components/Context.js +48 -47
  17. package/dist/components/ContextMenu.js +1 -1
  18. package/dist/components/Conversation.js +1 -1
  19. package/dist/components/Dialog.js +1 -1
  20. package/dist/components/EnvironmentVariables.js +1 -1
  21. package/dist/components/FileTree.js +1 -1
  22. package/dist/components/Menubar.js +1 -1
  23. package/dist/components/Message.d.ts +16 -2
  24. package/dist/components/Message.js +39 -5
  25. package/dist/components/ModelSelector.js +1 -1
  26. package/dist/components/NavigationMenu.js +1 -1
  27. package/dist/components/PricingPage.js +2 -2
  28. package/dist/components/PromptInput.d.ts +532 -2
  29. package/dist/components/PromptInput.js +158 -20
  30. package/dist/components/Queue.js +1 -1
  31. package/dist/components/Reasoning.js +9 -17
  32. package/dist/components/Select.js +1 -1
  33. package/dist/components/Sources.js +1 -1
  34. package/dist/components/Stepper.js +1 -1
  35. package/dist/components/Task.js +1 -1
  36. package/dist/components/Terminal.js +2 -2
  37. package/dist/components/TestResults.js +1 -1
  38. package/dist/components/ThinkChat.d.ts +24 -5
  39. package/dist/components/ThinkChat.js +87 -19
  40. package/dist/components/WebPreview.js +1 -1
  41. package/dist/components/WorkspaceExplorer.js +3 -3
  42. package/dist/components/icons.d.ts +2 -2
  43. package/dist/components/icons.js +2 -2
  44. package/dist/{copy-button-Dd6DEhOm.js → copy-button-BmJEAKuP.js} +1 -1
  45. package/dist/{icons-DQC4Zw5R.js → icons-CZRH4FVH.js} +1 -15
  46. package/dist/{icons-ctdVxng0.d.ts → icons-CmO7-pNY.d.ts} +1 -2
  47. package/dist/styles/agent-chat.css +39 -6
  48. package/dist/styles/attachment-preview.css +21 -0
  49. package/dist/styles/context.css +9 -17
  50. package/dist/styles/conversation.css +3 -3
  51. package/dist/styles/index.css +1 -1
  52. package/dist/styles/message.css +50 -2
  53. package/dist/styles/prompt-input.css +189 -6
  54. package/dist/styles/reasoning.css +0 -1
  55. package/package.json +2 -2
  56. package/dist/PromptInput-Dzn-fOPc.d.ts +0 -444
  57. package/dist/components/Tool.d.ts +0 -123
  58. package/dist/components/Tool.js +0 -209
  59. package/dist/styles/tool.css +0 -203
@@ -1,444 +0,0 @@
1
- import { A as SelectTriggerProps, M as SelectValueProps, S as SelectProps, f as SelectOption, j as SelectValue, r as SelectContentProps, s as SelectItemProps, t as Select } from "./Select-CRsKCJ9x.js";
2
- import { c as ComboboxGroup, d as ComboboxLabel, f as ComboboxList, g as ComboboxTrigger, h as ComboboxSeparator, l as ComboboxInput, m as ComboboxPositioner, p as ComboboxPopup, s as ComboboxEmpty, t as Combobox, u as ComboboxItem } from "./Combobox-D9anamNr.js";
3
- import { h as MenuItemProps, w as MenuProps, y as MenuPopupProps } from "./Menu-B5vDqZe_.js";
4
- import { c as TabsList, n as TabPanel, t as Tab } from "./Tabs-D9EAq09D.js";
5
- import { r as ButtonProps } from "./Button-Ct5I6aTu.js";
6
- import * as React from "react";
7
- import { ChatAddToolApproveResponseFunction, ChatStatus, DynamicToolUIPart, ToolUIPart, UIMessage } from "ai";
8
-
9
- //#region src/components/PromptInput.d.ts
10
- interface PromptInputFilePart {
11
- type: "file";
12
- id?: string;
13
- filename?: string;
14
- mediaType?: string;
15
- url?: string;
16
- }
17
- interface PromptInputReferencedSource {
18
- id?: string;
19
- title?: string;
20
- url?: string;
21
- [key: string]: unknown;
22
- }
23
- /** The payload produced when the prompt input is submitted. */
24
- interface PromptInputMessage {
25
- text: string;
26
- files: PromptInputFilePart[];
27
- }
28
- /** Lifecycle status of an in-flight model request — the AI SDK's `ChatStatus`. */
29
- type PromptInputStatus = ChatStatus;
30
- interface AttachmentsContext {
31
- files: Array<PromptInputFilePart & {
32
- id: string;
33
- }>;
34
- add: (files: File[] | FileList) => void;
35
- remove: (id: string) => void;
36
- clear: () => void;
37
- openFileDialog: () => void;
38
- fileInputRef: React.RefObject<HTMLInputElement | null>;
39
- }
40
- interface TextInputContext {
41
- value: string;
42
- setInput: (value: string) => void;
43
- clear: () => void;
44
- }
45
- interface PromptInputControllerProps {
46
- textInput: TextInputContext;
47
- attachments: AttachmentsContext;
48
- __registerFileInput: (ref: React.RefObject<HTMLInputElement | null>, open: () => void) => void;
49
- }
50
- interface ReferencedSourcesContext {
51
- sources: Array<PromptInputReferencedSource & {
52
- id: string;
53
- }>;
54
- add: (sources: PromptInputReferencedSource[] | PromptInputReferencedSource) => void;
55
- remove: (id: string) => void;
56
- clear: () => void;
57
- }
58
- declare function usePromptInputController(): PromptInputControllerProps;
59
- declare function useProviderAttachments(): AttachmentsContext;
60
- declare function usePromptInputAttachments(): AttachmentsContext;
61
- declare function usePromptInputReferencedSources(): ReferencedSourcesContext;
62
- interface PromptInputProviderProps extends React.PropsWithChildren {
63
- initialInput?: string;
64
- }
65
- declare function PromptInputProvider({
66
- initialInput,
67
- children
68
- }: PromptInputProviderProps): React.JSX.Element;
69
- interface PromptInputProps extends Omit<React.FormHTMLAttributes<HTMLFormElement>, "onSubmit" | "onError"> {
70
- /** Accepted file MIME types/extensions, passed to the hidden file input. */
71
- accept?: string;
72
- /** Allows multiple files in a single file picker/drop action. */
73
- multiple?: boolean;
74
- /** Listen for file drops on the whole document instead of only the form. */
75
- globalDrop?: boolean;
76
- /** Clears the hidden file input when attachments are cleared. */
77
- syncHiddenInput?: boolean;
78
- /** Maximum number of attached files. */
79
- maxFiles?: number;
80
- /** Maximum accepted file size in bytes. */
81
- maxFileSize?: number;
82
- /** Called when file validation rejects an attachment. */
83
- onError?: (error: {
84
- code: "max_files" | "max_file_size" | "accept";
85
- message: string;
86
- }) => void;
87
- /** Called with the trimmed message text and files when the form is submitted. */
88
- onSubmit?: (message: PromptInputMessage, event: React.FormEvent<HTMLFormElement>) => void | Promise<void>;
89
- }
90
- /**
91
- * Chat-style composer form. Wraps a textarea and footer controls, with
92
- * Enter-to-submit semantics, auto-resizing behavior, and optional attachments.
93
- * Adapted from Vercel AI Elements and restyled with Sigvelo CSS tokens.
94
- *
95
- * Use for assistant/chat submit forms. Do not use it as a generic textarea or
96
- * non-chat form. Sigvelo changes: uses shared Menu, Select, Combobox, Tabs,
97
- * Button, and Tooltip components; maps styles to CSS tokens; adds local
98
- * attachment and referenced-source helpers.
99
- *
100
- * The form handles Enter-to-submit while multiline editing remains in the
101
- * textarea. Attachment controls need accessible labels through their buttons
102
- * and menus. Add new shared tools here when multiple apps need them.
103
- *
104
- * @example
105
- * ```tsx
106
- * <PromptInput onSubmit={({ text, files }) => sendMessage(text, files)}>
107
- * <PromptInputBody>
108
- * <PromptInputTextarea placeholder="Ask Sigvelo..." />
109
- * </PromptInputBody>
110
- * <PromptInputFooter>
111
- * <PromptInputTools>
112
- * <PromptInputActionAddAttachments />
113
- * </PromptInputTools>
114
- * <PromptInputSubmit status="ready" />
115
- * </PromptInputFooter>
116
- * </PromptInput>
117
- * ```
118
- *
119
- * @see {@link https://elements.ai-sdk.dev/components/prompt-input | AI Elements Prompt Input}
120
- */
121
- declare function PromptInput({
122
- className,
123
- accept,
124
- multiple,
125
- globalDrop,
126
- syncHiddenInput,
127
- maxFiles,
128
- maxFileSize,
129
- onError,
130
- onSubmit,
131
- children,
132
- id,
133
- ref,
134
- ...props
135
- }: PromptInputProps & {
136
- ref?: React.Ref<HTMLFormElement>;
137
- }): React.JSX.Element;
138
- interface PromptInputHeaderProps extends React.HTMLAttributes<HTMLDivElement> {}
139
- declare function PromptInputHeader({
140
- className,
141
- children,
142
- ref,
143
- ...props
144
- }: PromptInputHeaderProps & {
145
- ref?: React.Ref<HTMLDivElement>;
146
- }): React.JSX.Element;
147
- interface PromptInputBodyProps extends React.HTMLAttributes<HTMLDivElement> {}
148
- declare function PromptInputBody({
149
- className,
150
- children,
151
- ref,
152
- ...props
153
- }: PromptInputBodyProps & {
154
- ref?: React.Ref<HTMLDivElement>;
155
- }): React.JSX.Element;
156
- interface PromptInputFooterProps extends React.HTMLAttributes<HTMLDivElement> {}
157
- declare function PromptInputFooter({
158
- className,
159
- children,
160
- ref,
161
- ...props
162
- }: PromptInputFooterProps & {
163
- ref?: React.Ref<HTMLDivElement>;
164
- }): React.JSX.Element;
165
- interface PromptInputToolsProps extends React.HTMLAttributes<HTMLDivElement> {}
166
- declare function PromptInputTools({
167
- className,
168
- children,
169
- ref,
170
- ...props
171
- }: PromptInputToolsProps & {
172
- ref?: React.Ref<HTMLDivElement>;
173
- }): React.JSX.Element;
174
- interface PromptInputTextareaProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {
175
- minHeight?: number;
176
- maxHeight?: number;
177
- }
178
- declare function PromptInputTextarea({
179
- className,
180
- placeholder,
181
- rows,
182
- minHeight,
183
- maxHeight,
184
- onChange,
185
- onCompositionEnd,
186
- onCompositionStart,
187
- onKeyDown,
188
- onInput,
189
- onPaste,
190
- ref,
191
- ...props
192
- }: PromptInputTextareaProps & {
193
- ref?: React.Ref<HTMLTextAreaElement>;
194
- }): React.JSX.Element;
195
- type TooltipSide = "top" | "right" | "bottom" | "left";
196
- type PromptInputButtonTooltip = string | {
197
- content: React.ReactNode;
198
- shortcut?: string;
199
- side?: TooltipSide;
200
- };
201
- type PromptInputTooltipConfig = Exclude<PromptInputButtonTooltip, string>;
202
- interface PromptInputButtonProps extends Omit<ButtonProps, "children" | "className"> {
203
- className?: string;
204
- tooltip?: PromptInputButtonTooltip;
205
- children?: React.ReactNode;
206
- }
207
- declare function PromptInputButton({
208
- className,
209
- tooltip,
210
- variant,
211
- color,
212
- size,
213
- children,
214
- "aria-label": ariaLabel,
215
- ref,
216
- ...props
217
- }: PromptInputButtonProps & {
218
- ref?: React.Ref<HTMLButtonElement>;
219
- }): React.JSX.Element;
220
- type PromptInputActionMenuProps = MenuProps;
221
- declare function PromptInputActionMenu(props: PromptInputActionMenuProps): React.JSX.Element;
222
- type PromptInputActionMenuTriggerProps = PromptInputButtonProps;
223
- declare function PromptInputActionMenuTrigger({
224
- className,
225
- children,
226
- ...props
227
- }: PromptInputActionMenuTriggerProps): React.JSX.Element;
228
- type PromptInputActionMenuContentProps = MenuPopupProps;
229
- declare function PromptInputActionMenuContent({
230
- className,
231
- children,
232
- ...props
233
- }: PromptInputActionMenuContentProps): React.JSX.Element;
234
- type PromptInputActionMenuItemProps = MenuItemProps;
235
- declare function PromptInputActionMenuItem({
236
- className,
237
- ...props
238
- }: PromptInputActionMenuItemProps): React.JSX.Element;
239
- interface PromptInputActionAddAttachmentsProps extends PromptInputActionMenuItemProps {
240
- label?: string;
241
- }
242
- declare function PromptInputActionAddAttachments({
243
- label,
244
- onClick,
245
- children,
246
- ...props
247
- }: PromptInputActionAddAttachmentsProps): React.JSX.Element;
248
- interface PromptInputActionAddScreenshotProps extends PromptInputActionMenuItemProps {
249
- label?: string;
250
- }
251
- declare function PromptInputActionAddScreenshot({
252
- label,
253
- onClick,
254
- children,
255
- ...props
256
- }: PromptInputActionAddScreenshotProps): React.JSX.Element;
257
- interface PromptInputSubmitProps extends Omit<ButtonProps, "children" | "className" | "type"> {
258
- className?: string;
259
- status?: PromptInputStatus;
260
- onStop?: () => void;
261
- children?: React.ReactNode;
262
- label?: string;
263
- }
264
- declare function PromptInputSubmit({
265
- className,
266
- status,
267
- onStop,
268
- variant,
269
- color,
270
- size,
271
- onClick,
272
- children,
273
- label,
274
- ref,
275
- ...props
276
- }: PromptInputSubmitProps & {
277
- ref?: React.Ref<HTMLButtonElement>;
278
- }): React.JSX.Element;
279
- /** A tool part that may carry a pending approval request. Upstream AI SDK types, taken whole. */
280
- type ApprovalToolPart = ToolUIPart | DynamicToolUIPart;
281
- interface PendingToolApproval<MessageT extends UIMessage = UIMessage> {
282
- message: MessageT;
283
- messageIndex: number;
284
- part: ApprovalToolPart;
285
- partIndex: number;
286
- }
287
- /** Derives pending tool approvals straight from the messages — no app-owned shapes. */
288
- declare function getPendingToolApprovals<MessageT extends UIMessage>(messages: readonly MessageT[]): Array<PendingToolApproval<MessageT>>;
289
- interface PromptInputApprovalProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "part"> {
290
- /** The `approval-requested` tool part, passed whole. Renders nothing for other states. */
291
- part: ApprovalToolPart;
292
- /** Pass `addToolApprovalResponse` from `useAgentChat`/`useChat` directly. */
293
- onRespond: ChatAddToolApproveResponseFunction;
294
- /**
295
- * Renders a Skip action that dismisses the confirmation without responding —
296
- * the approval stays pending upstream.
297
- */
298
- onSkip?: () => void;
299
- /** Overrides the default "Do you want to allow…" question. */
300
- question?: React.ReactNode;
301
- /** Total pending approvals, for the "1 of N" hint. */
302
- count?: number;
303
- }
304
- /**
305
- * The composer's approval state: when a tool call awaits human approval the
306
- * prompt input area becomes the confirmation. "Yes" approves on click; typing
307
- * in the "No, and tell the agent what to do differently" row selects deny and
308
- * sends the text as the native approval `reason`. Submit (or Enter) sends the
309
- * current selection — approve by default.
310
- */
311
- declare function PromptInputApproval({
312
- part,
313
- onRespond,
314
- onSkip,
315
- question,
316
- count,
317
- className,
318
- ref,
319
- ...props
320
- }: PromptInputApprovalProps & {
321
- ref?: React.Ref<HTMLDivElement>;
322
- }): React.JSX.Element | null;
323
- type PromptInputSelectProps = SelectProps;
324
- declare const PromptInputSelect: typeof Select;
325
- type PromptInputSelectTriggerProps = SelectTriggerProps;
326
- declare function PromptInputSelectTrigger(props: PromptInputSelectTriggerProps): React.JSX.Element;
327
- type PromptInputSelectContentProps = SelectContentProps;
328
- declare function PromptInputSelectContent(props: PromptInputSelectContentProps): React.JSX.Element;
329
- type PromptInputSelectItemProps = SelectItemProps;
330
- declare const PromptInputSelectItem: typeof SelectOption;
331
- type PromptInputSelectValueProps = SelectValueProps;
332
- declare const PromptInputSelectValue: typeof SelectValue;
333
- interface PromptInputHoverCardProps extends React.HTMLAttributes<HTMLDivElement> {
334
- openDelay?: number;
335
- closeDelay?: number;
336
- }
337
- declare function PromptInputHoverCard({
338
- openDelay,
339
- closeDelay,
340
- className,
341
- children,
342
- ref,
343
- ...props
344
- }: PromptInputHoverCardProps & {
345
- ref?: React.Ref<HTMLDivElement>;
346
- }): React.JSX.Element;
347
- interface PromptInputHoverCardTriggerProps extends React.HTMLAttributes<HTMLSpanElement> {}
348
- declare function PromptInputHoverCardTrigger({
349
- className,
350
- ref,
351
- ...props
352
- }: PromptInputHoverCardTriggerProps & {
353
- ref?: React.Ref<HTMLSpanElement>;
354
- }): React.JSX.Element;
355
- interface PromptInputHoverCardContentProps extends React.HTMLAttributes<HTMLDivElement> {}
356
- declare function PromptInputHoverCardContent({
357
- className,
358
- ref,
359
- ...props
360
- }: PromptInputHoverCardContentProps & {
361
- ref?: React.Ref<HTMLDivElement>;
362
- }): React.JSX.Element | null;
363
- type PromptInputTabsListProps = React.ComponentPropsWithoutRef<typeof TabsList>;
364
- declare const PromptInputTabsList: typeof TabsList;
365
- type PromptInputTabProps = React.ComponentPropsWithoutRef<typeof Tab>;
366
- declare const PromptInputTab: typeof Tab;
367
- type PromptInputTabBodyProps = React.ComponentPropsWithoutRef<typeof TabPanel>;
368
- declare const PromptInputTabBody: typeof TabPanel;
369
- interface PromptInputTabLabelProps extends React.HTMLAttributes<HTMLHeadingElement> {}
370
- declare function PromptInputTabLabel({
371
- className,
372
- ref,
373
- ...props
374
- }: PromptInputTabLabelProps & {
375
- ref?: React.Ref<HTMLHeadingElement>;
376
- }): React.JSX.Element;
377
- interface PromptInputTabItemProps extends React.HTMLAttributes<HTMLDivElement> {}
378
- declare function PromptInputTabItem({
379
- className,
380
- ref,
381
- ...props
382
- }: PromptInputTabItemProps & {
383
- ref?: React.Ref<HTMLDivElement>;
384
- }): React.JSX.Element;
385
- type PromptInputCommandProps = React.ComponentPropsWithoutRef<typeof Combobox>;
386
- declare const PromptInputCommand: typeof import("@base-ui/react").ComboboxRoot & {
387
- Root: typeof import("@base-ui/react").ComboboxRoot;
388
- Input: typeof ComboboxInput;
389
- Trigger: typeof ComboboxTrigger;
390
- Clear: ({
391
- className,
392
- ref,
393
- ...props
394
- }: Omit<React.ComponentPropsWithRef<typeof import("@base-ui/react").ComboboxClear>, "className"> & {
395
- className?: string;
396
- } & {
397
- ref?: React.Ref<HTMLButtonElement>;
398
- }) => React.JSX.Element;
399
- Portal: React.ForwardRefExoticComponent<Omit<import("@base-ui/react").AutocompletePortalProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
400
- Positioner: typeof ComboboxPositioner;
401
- Popup: typeof ComboboxPopup;
402
- Content: typeof ComboboxPopup;
403
- List: typeof ComboboxList;
404
- Item: typeof ComboboxItem;
405
- ItemIndicator: ({
406
- className,
407
- ref,
408
- ...props
409
- }: Omit<React.ComponentPropsWithRef<typeof import("@base-ui/react").ComboboxItemIndicator>, "className"> & {
410
- className?: string;
411
- } & {
412
- ref?: React.Ref<HTMLSpanElement>;
413
- }) => React.JSX.Element;
414
- Empty: typeof ComboboxEmpty;
415
- Group: typeof ComboboxGroup;
416
- GroupLabel: typeof ComboboxLabel;
417
- Label: typeof ComboboxLabel;
418
- Value: typeof import("@base-ui/react").ComboboxValue;
419
- Chips: React.ForwardRefExoticComponent<Omit<import("@base-ui/react").ComboboxChipsProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
420
- Chip: React.ForwardRefExoticComponent<Omit<import("@base-ui/react").ComboboxChipProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
421
- ChipsInput: typeof ComboboxInput;
422
- Collection: typeof import("@base-ui/react").ComboboxCollection;
423
- Separator: React.ForwardRefExoticComponent<Omit<import("@base-ui/react").SeparatorProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
424
- };
425
- type PromptInputCommandInputProps = React.ComponentPropsWithoutRef<typeof ComboboxInput>;
426
- declare const PromptInputCommandInput: typeof ComboboxInput;
427
- interface PromptInputCommandListProps extends React.HTMLAttributes<HTMLDivElement> {}
428
- declare function PromptInputCommandList({
429
- className,
430
- ref,
431
- ...props
432
- }: PromptInputCommandListProps & {
433
- ref?: React.Ref<HTMLDivElement>;
434
- }): React.JSX.Element;
435
- type PromptInputCommandEmptyProps = React.ComponentPropsWithoutRef<typeof ComboboxEmpty>;
436
- declare const PromptInputCommandEmpty: typeof ComboboxEmpty;
437
- type PromptInputCommandGroupProps = React.ComponentPropsWithoutRef<typeof ComboboxGroup>;
438
- declare const PromptInputCommandGroup: typeof ComboboxGroup;
439
- type PromptInputCommandItemProps = React.ComponentPropsWithoutRef<typeof ComboboxItem>;
440
- declare const PromptInputCommandItem: typeof ComboboxItem;
441
- type PromptInputCommandSeparatorProps = React.ComponentPropsWithoutRef<typeof ComboboxSeparator>;
442
- declare const PromptInputCommandSeparator: React.ForwardRefExoticComponent<Omit<import("@base-ui/react").SeparatorProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
443
- //#endregion
444
- export { PromptInputProviderProps as $, PromptInputCommandInputProps as A, TextInputContext as At, PromptInputFooter as B, PromptInputButtonTooltip as C, PromptInputTabsListProps as Ct, PromptInputCommandGroup as D, PromptInputToolsProps as Dt, PromptInputCommandEmptyProps as E, PromptInputTools as Et, PromptInputCommandProps as F, usePromptInputReferencedSources as Ft, PromptInputHoverCardContent as G, PromptInputHeader as H, PromptInputCommandSeparator as I, useProviderAttachments as It, PromptInputHoverCardTrigger as J, PromptInputHoverCardContentProps as K, PromptInputCommandSeparatorProps as L, PromptInputCommandItemProps as M, getPendingToolApprovals as Mt, PromptInputCommandList as N, usePromptInputAttachments as Nt, PromptInputCommandGroupProps as O, PromptInputTooltipConfig as Ot, PromptInputCommandListProps as P, usePromptInputController as Pt, PromptInputProvider as Q, PromptInputControllerProps as R, PromptInputButtonProps as S, PromptInputTabsList as St, PromptInputCommandEmpty as T, PromptInputTextareaProps as Tt, PromptInputHeaderProps as U, PromptInputFooterProps as V, PromptInputHoverCard as W, PromptInputMessage as X, PromptInputHoverCardTriggerProps as Y, PromptInputProps as Z, PromptInputApproval as _, PromptInputTabItem as _t, PromptInputActionAddAttachments as a, PromptInputSelectItemProps as at, PromptInputBodyProps as b, PromptInputTabLabelProps as bt, PromptInputActionAddScreenshotProps as c, PromptInputSelectTriggerProps as ct, PromptInputActionMenuContentProps as d, PromptInputStatus as dt, PromptInputReferencedSource as et, PromptInputActionMenuItem as f, PromptInputSubmit as ft, PromptInputActionMenuTriggerProps as g, PromptInputTabBodyProps as gt, PromptInputActionMenuTrigger as h, PromptInputTabBody as ht, PromptInput as i, PromptInputSelectItem as it, PromptInputCommandItem as j, TooltipSide as jt, PromptInputCommandInput as k, ReferencedSourcesContext as kt, PromptInputActionMenu as l, PromptInputSelectValue as lt, PromptInputActionMenuProps as m, PromptInputTab as mt, AttachmentsContext as n, PromptInputSelectContent as nt, PromptInputActionAddAttachmentsProps as o, PromptInputSelectProps as ot, PromptInputActionMenuItemProps as p, PromptInputSubmitProps as pt, PromptInputHoverCardProps as q, PendingToolApproval as r, PromptInputSelectContentProps as rt, PromptInputActionAddScreenshot as s, PromptInputSelectTrigger as st, ApprovalToolPart as t, PromptInputSelect as tt, PromptInputActionMenuContent as u, PromptInputSelectValueProps as ut, PromptInputApprovalProps as v, PromptInputTabItemProps as vt, PromptInputCommand as w, PromptInputTextarea as wt, PromptInputButton as x, PromptInputTabProps as xt, PromptInputBody as y, PromptInputTabLabel as yt, PromptInputFilePart as z };
@@ -1,123 +0,0 @@
1
- import { CollapsiblePanelProps, CollapsibleRootProps, CollapsibleTriggerProps } from "./Collapsible.js";
2
- import * as React from "react";
3
- import { DynamicToolUIPart, ToolUIPart } from "ai";
4
-
5
- //#region src/components/Tool.d.ts
6
- /** An AI SDK tool part — static (`tool-*`) or dynamic. */
7
- type ToolPart = ToolUIPart | DynamicToolUIPart;
8
- type ToolState = ToolPart["state"];
9
- declare function getStatusBadge(status: ToolState): React.JSX.Element;
10
- interface ToolProps extends Omit<CollapsibleRootProps, "className" | "part" | "unstyled"> {
11
- className?: string;
12
- /**
13
- * The AI SDK tool part, taken whole — ToolHeader/ToolInput/ToolOutput
14
- * derive name, state, input, and output from it.
15
- */
16
- part?: ToolPart;
17
- /** Current state of the tool invocation. Defaults to `part.state`. */
18
- state?: ToolState;
19
- }
20
- /**
21
- * Displays a collapsible tool invocation (name, input, output, state).
22
- * The state drives the status badge color and default open behavior —
23
- * `output-available`, `output-error`, and `output-denied` auto-open.
24
- * Adapted from Vercel AI Elements and restyled with Sigvelo CSS tokens.
25
- *
26
- * @example
27
- * ```tsx
28
- * <Tool part={part}>
29
- * <ToolHeader />
30
- * <ToolContent>
31
- * <ToolInput />
32
- * <ToolOutput />
33
- * </ToolContent>
34
- * </Tool>
35
- * ```
36
- *
37
- * @see {@link https://elements.ai-sdk.dev/components/tool | AI Elements Tool}
38
- */
39
- declare function Tool({
40
- className,
41
- part,
42
- state: stateProp,
43
- defaultOpen,
44
- ref,
45
- ...props
46
- }: ToolProps & {
47
- ref?: React.Ref<HTMLDivElement>;
48
- }): React.JSX.Element;
49
- interface ToolHeaderProps extends Omit<CollapsibleTriggerProps, "className" | "type" | "unstyled"> {
50
- className?: string;
51
- /** The tool "type" (e.g. "function", "retrieval"). Derived from `<Tool part>` when omitted. */
52
- type?: string;
53
- /** The specific tool invoked (e.g. "search_web"). Derived from `<Tool part>` when omitted. */
54
- toolName?: string;
55
- /** Optional human-readable title shown alongside the tool name. */
56
- title?: string;
57
- /** Current state of the tool invocation. Matches Vercel AI Elements. */
58
- state?: ToolState;
59
- }
60
- /**
61
- * Clickable header that shows the tool type, name, and state badge.
62
- */
63
- declare function ToolHeader({
64
- className,
65
- type: typeProp,
66
- toolName,
67
- title: titleProp,
68
- state: stateProp,
69
- ref,
70
- ...props
71
- }: ToolHeaderProps & {
72
- ref?: React.Ref<HTMLButtonElement>;
73
- }): React.JSX.Element;
74
- interface ToolContentProps extends Omit<CollapsiblePanelProps, "className" | "unstyled"> {
75
- className?: string;
76
- }
77
- /**
78
- * Collapsible panel holding ToolInput and ToolOutput.
79
- */
80
- declare function ToolContent({
81
- className,
82
- children,
83
- ref,
84
- ...props
85
- }: ToolContentProps & {
86
- ref?: React.Ref<HTMLDivElement>;
87
- }): React.JSX.Element;
88
- interface ToolInputProps extends React.HTMLAttributes<HTMLDivElement> {
89
- /** The input passed to the tool (rendered as a JSON code block). Defaults to `part.input`. */
90
- input?: unknown;
91
- }
92
- /**
93
- * Displays the tool input as a JSON code block. Renders nothing while the
94
- * input is still undefined.
95
- */
96
- declare function ToolInput({
97
- className,
98
- input: inputProp,
99
- ref,
100
- ...props
101
- }: ToolInputProps & {
102
- ref?: React.Ref<HTMLDivElement>;
103
- }): React.JSX.Element | null;
104
- interface ToolOutputProps extends React.HTMLAttributes<HTMLDivElement> {
105
- /** The tool output (any React node). Defaults to `part.output`. Mutually exclusive with errorText. */
106
- output?: unknown;
107
- /** Error message, rendered with destructive styling. Defaults to `part.errorText`. */
108
- errorText?: string;
109
- }
110
- /**
111
- * Displays the tool output or error text.
112
- */
113
- declare function ToolOutput({
114
- className,
115
- output: outputProp,
116
- errorText: errorTextProp,
117
- ref,
118
- ...props
119
- }: ToolOutputProps & {
120
- ref?: React.Ref<HTMLDivElement>;
121
- }): React.JSX.Element | null;
122
- //#endregion
123
- export { Tool, ToolContent, ToolContentProps, ToolHeader, ToolHeaderProps, ToolInput, ToolInputProps, ToolOutput, ToolOutputProps, ToolPart, ToolProps, ToolState, getStatusBadge };