@mcp-b/react-components 0.12.0 → 0.13.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/{AgentChat-CRmsKg9B.d.ts → AgentChat-Br6tKEl8.d.ts} +29 -5
- package/dist/{Button-Ct5I6aTu.d.ts → Button-FX_hpqxm.d.ts} +8 -11
- package/dist/{CodeBlock-XNQOupQ3.js → CodeBlock-BUFXG8HW.js} +22 -12
- package/dist/{CodeBlock-CxQXv3C4.d.ts → CodeBlock-DUh9WOGo.d.ts} +13 -7
- package/dist/{Combobox-D9anamNr.d.ts → Combobox-B9Fcd6q-.d.ts} +4 -14
- package/dist/{FileTree-wMyZhhHO.js → FileTree-mpEIcfzA.js} +1 -1
- package/dist/{Menu-BLhnNnRK.d.ts → Menu-Bgu-ufb5.d.ts} +26 -65
- package/dist/{ModelSelector-BB-xB-Es.js → ModelSelector-DVgVBdvw.js} +7 -7
- package/dist/{PromptInput-IyM6ZETj.d.ts → PromptInput-p5KmOmt1.d.ts} +302 -46
- package/dist/Select-Dl_vF_Bt.d.ts +213 -0
- package/dist/{Tabs-D9EAq09D.d.ts → Tabs-3Zc4tb9D.d.ts} +9 -6
- package/dist/{ThinkChat-B3wYahor.js → ThinkChat-7DQ2CogF.js} +34 -2
- package/dist/{ThinkChatActivity-F4KFPcJA.d.ts → ThinkChatActivity-Cuk28Js_.d.ts} +1 -1
- package/dist/{attachment-preview-ChtC3HiU.js → attachment-preview-DIs50Q0h.js} +3 -3
- package/dist/components/Accordion.d.ts +17 -6
- package/dist/components/Accordion.js +23 -36
- package/dist/components/Activity.d.ts +5 -5
- package/dist/components/Activity.js +9 -9
- package/dist/components/AgentChat.d.ts +1 -1
- package/dist/components/AgentChat.js +304 -116
- package/dist/components/AgentConnection.js +2 -2
- package/dist/components/AlertDialog.d.ts +40 -32
- package/dist/components/AlertDialog.js +46 -39
- package/dist/components/Artifact.d.ts +1 -1
- package/dist/components/Artifact.js +5 -5
- package/dist/components/Autocomplete.js +10 -2
- package/dist/components/Avatar.d.ts +2 -2
- package/dist/components/Avatar.js +3 -3
- package/dist/components/Badge.d.ts +11 -14
- package/dist/components/Badge.js +10 -18
- package/dist/components/BrowserLiveView.js +26 -36
- package/dist/components/BrowserReplay.js +4 -4
- package/dist/components/BrowserRunPanel.js +1 -1
- package/dist/components/Button.d.ts +2 -2
- package/dist/components/Button.js +7 -30
- package/dist/components/ChainOfThought.d.ts +5 -5
- package/dist/components/ChainOfThought.js +8 -5
- package/dist/components/ChatGptSignInScreen.js +3 -3
- package/dist/components/Checkbox.d.ts +10 -2
- package/dist/components/Checkbox.js +13 -6
- package/dist/components/CheckboxGroup.d.ts +6 -6
- package/dist/components/CheckboxGroup.js +6 -6
- package/dist/components/CodeBlock.d.ts +1 -1
- package/dist/components/CodeBlock.js +1 -1
- package/dist/components/CodexModelSelector.d.ts +23 -28
- package/dist/components/CodexModelSelector.js +116 -94
- package/dist/components/Collapsible.d.ts +2 -4
- package/dist/components/Collapsible.js +9 -7
- package/dist/components/Combobox.d.ts +2 -2
- package/dist/components/Combobox.js +20 -22
- package/dist/components/Commit.d.ts +5 -5
- package/dist/components/Commit.js +6 -6
- package/dist/components/Context.js +5 -1
- package/dist/components/ContextMenu.d.ts +20 -72
- package/dist/components/ContextMenu.js +46 -56
- package/dist/components/Conversation.d.ts +1 -1
- package/dist/components/Conversation.js +1 -1
- package/dist/components/Dialog.d.ts +38 -30
- package/dist/components/Dialog.js +46 -34
- package/dist/components/EnvironmentVariables.d.ts +1 -1
- package/dist/components/EnvironmentVariables.js +5 -5
- package/dist/components/Field.d.ts +3 -3
- package/dist/components/Field.js +7 -8
- package/dist/components/Fieldset.d.ts +2 -2
- package/dist/components/Fieldset.js +2 -2
- package/dist/components/FileTree.js +1 -1
- package/dist/components/Label.d.ts +1 -1
- package/dist/components/Label.js +1 -1
- package/dist/components/McpServerPicker.js +21 -19
- package/dist/components/Menu.d.ts +2 -2
- package/dist/components/Menu.js +39 -49
- package/dist/components/Menubar.d.ts +16 -52
- package/dist/components/Menubar.js +44 -56
- package/dist/components/Message.d.ts +1 -1
- package/dist/components/Message.js +6 -6
- package/dist/components/MessageScroller.d.ts +1 -1
- package/dist/components/MessageScroller.js +1 -1
- package/dist/components/Meter.js +5 -0
- package/dist/components/ModelSelector.d.ts +1 -1
- package/dist/components/ModelSelector.js +1 -1
- package/dist/components/NavigationMenu.d.ts +3 -14
- package/dist/components/NavigationMenu.js +22 -38
- package/dist/components/NumberField.js +6 -0
- package/dist/components/Popover.d.ts +21 -44
- package/dist/components/Popover.js +33 -23
- package/dist/components/PreviewCard.d.ts +20 -18
- package/dist/components/PreviewCard.js +30 -20
- package/dist/components/PricingPage.js +30 -29
- package/dist/components/Progress.d.ts +7 -3
- package/dist/components/Progress.js +9 -4
- package/dist/components/PromptInput.d.ts +2 -2
- package/dist/components/PromptInput.js +139 -54
- package/dist/components/Queue.d.ts +7 -7
- package/dist/components/Queue.js +6 -6
- package/dist/components/RadioGroup.d.ts +10 -9
- package/dist/components/RadioGroup.js +8 -9
- package/dist/components/Reasoning.d.ts +4 -4
- package/dist/components/Reasoning.js +10 -6
- package/dist/components/ScrollArea.d.ts +2 -9
- package/dist/components/ScrollArea.js +5 -23
- package/dist/components/Select.d.ts +2 -2
- package/dist/components/Select.js +100 -134
- package/dist/components/Slider.d.ts +10 -7
- package/dist/components/Slider.js +12 -11
- package/dist/components/Sources.d.ts +4 -4
- package/dist/components/Sources.js +8 -5
- package/dist/components/Stepper.js +1 -1
- package/dist/components/Switch.d.ts +6 -3
- package/dist/components/Switch.js +7 -4
- package/dist/components/Tabs.d.ts +2 -2
- package/dist/components/Tabs.js +9 -4
- package/dist/components/Task.d.ts +4 -4
- package/dist/components/Task.js +10 -6
- package/dist/components/Terminal.d.ts +2 -2
- package/dist/components/Terminal.js +5 -5
- package/dist/components/TestResults.d.ts +4 -4
- package/dist/components/TestResults.js +5 -5
- package/dist/components/ThinkChat.d.ts +9 -2
- package/dist/components/ThinkChat.js +1 -1
- package/dist/components/ThinkChatActivity.d.ts +1 -1
- package/dist/components/ThinkChatActivity.js +1 -1
- package/dist/components/ThinkChatToolPanels.js +8 -8
- package/dist/components/ThinkExecutionWorkbench.js +28 -28
- package/dist/components/ThinkFullApp.js +8 -8
- package/dist/components/ThinkThreadPicker.js +1 -1
- package/dist/components/ThinkThreadShell.js +5 -5
- package/dist/components/Toast.js +7 -0
- package/dist/components/ToggleGroup.d.ts +6 -2
- package/dist/components/ToggleGroup.js +6 -2
- package/dist/components/Toolbar.js +6 -0
- package/dist/components/Tooltip.d.ts +36 -27
- package/dist/components/Tooltip.js +45 -29
- package/dist/components/WebPreview.d.ts +1 -1
- package/dist/components/WebPreview.js +3 -3
- package/dist/components/WorkspaceExplorer.d.ts +6 -8
- package/dist/components/WorkspaceExplorer.js +6 -6
- package/dist/components/icons.d.ts +2 -2
- package/dist/components/icons.js +2 -2
- package/dist/{copy-button-C6JSKtFE.js → copy-button-DUMLYdsk.js} +7 -6
- package/dist/{copy-button-BKXqGiNm.d.ts → copy-button-DtPMgN7e.d.ts} +3 -2
- package/dist/icons-Ba9THQKz.js +64 -0
- package/dist/icons-CUCz_Sft.d.ts +210 -0
- package/dist/styles/accessibility.css +14 -0
- package/dist/styles/accordion.css +21 -61
- package/dist/styles/activity.css +23 -58
- package/dist/styles/agent-chat.css +45 -4
- package/dist/styles/agent-connection.css +8 -10
- package/dist/styles/alert-dialog.css +20 -26
- package/dist/styles/artifact.css +6 -6
- package/dist/styles/attachment-preview.css +1 -1
- package/dist/styles/autocomplete.css +5 -170
- package/dist/styles/avatar.css +8 -8
- package/dist/styles/badge.css +8 -10
- package/dist/styles/base-ui-motion.css +176 -0
- package/dist/styles/base.css +19 -25
- package/dist/styles/browser-live-view.css +7 -7
- package/dist/styles/browser-replay.css +5 -5
- package/dist/styles/browser-run-panel.css +5 -5
- package/dist/styles/button.css +48 -43
- package/dist/styles/card.css +3 -5
- package/dist/styles/chain-of-thought.css +14 -70
- package/dist/styles/chatgpt-sign-in-screen.css +3 -3
- package/dist/styles/checkbox-group.css +1 -1
- package/dist/styles/checkbox.css +3 -7
- package/dist/styles/code-block.css +10 -10
- package/dist/styles/codex-model-selector.css +33 -44
- package/dist/styles/collapsible.css +11 -27
- package/dist/styles/combobox.css +3 -149
- package/dist/styles/commit.css +19 -35
- package/dist/styles/context-menu.css +1 -77
- package/dist/styles/context.css +12 -12
- package/dist/styles/conversation.css +7 -7
- package/dist/styles/dialog.css +34 -55
- package/dist/styles/environment-variables.css +10 -10
- package/dist/styles/field.css +16 -58
- package/dist/styles/fieldset.css +2 -2
- package/dist/styles/file-tree.css +7 -9
- package/dist/styles/index.css +8 -1
- package/dist/styles/input.css +1 -51
- package/dist/styles/label.css +2 -2
- package/dist/styles/marker.css +2 -4
- package/dist/styles/mcp-server-picker.css +5 -5
- package/dist/styles/menu.css +6 -153
- package/dist/styles/menubar.css +6 -105
- package/dist/styles/message-scroller.css +1 -1
- package/dist/styles/message.css +86 -8
- package/dist/styles/meter.css +4 -20
- package/dist/styles/model-selector.css +13 -13
- package/dist/styles/navigation-menu.css +14 -54
- package/dist/styles/number-field.css +8 -23
- package/dist/styles/popover.css +13 -68
- package/dist/styles/preview-card.css +5 -46
- package/dist/styles/pricing-page.css +43 -43
- package/dist/styles/progress.css +7 -16
- package/dist/styles/prompt-input.css +95 -44
- package/dist/styles/queue.css +12 -28
- package/dist/styles/radio.css +4 -8
- package/dist/styles/reasoning.css +3 -62
- package/dist/styles/recipes.css +475 -0
- package/dist/styles/select.css +7 -103
- package/dist/styles/shell.css +3 -3
- package/dist/styles/slider.css +5 -7
- package/dist/styles/sources.css +9 -66
- package/dist/styles/stepper.css +16 -14
- package/dist/styles/streamdown.css +9 -9
- package/dist/styles/switch.css +4 -7
- package/dist/styles/tabs.css +7 -8
- package/dist/styles/task.css +13 -42
- package/dist/styles/terminal.css +7 -7
- package/dist/styles/test-results.css +21 -37
- package/dist/styles/think-execution-workbench.css +23 -23
- package/dist/styles/think-full-app.css +12 -20
- package/dist/styles/think-resize-handle.css +2 -2
- package/dist/styles/think-thread-picker.css +19 -10
- package/dist/styles/think-thread-shell.css +7 -7
- package/dist/styles/toast.css +14 -25
- package/dist/styles/toggle-group.css +16 -14
- package/dist/styles/toggle.css +14 -15
- package/dist/styles/toolbar.css +13 -25
- package/dist/styles/tooltip.css +6 -16
- package/dist/styles/web-preview.css +15 -15
- package/dist/styles/workspace-explorer.css +14 -13
- package/dist/utils/codex-model-catalog.d.ts +142 -0
- package/dist/utils/codex-model-catalog.js +112 -0
- package/dist/utils/structured-code.d.ts +1 -1
- package/package.json +8 -2
- package/dist/Select-CRsKCJ9x.d.ts +0 -200
- package/dist/icons-CbjtbIJK.d.ts +0 -51
- package/dist/icons-D2Q5n5C1.js +0 -291
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import { t as cx } from "../class-names-9UtZwb0J.js";
|
|
2
|
-
import {
|
|
2
|
+
import { A as RefreshIcon, D as PencilIcon, k as PlusIcon } from "../icons-Ba9THQKz.js";
|
|
3
3
|
import { Activity, ActivityContent, ActivityPanel, ActivityTrigger } from "./Activity.js";
|
|
4
4
|
import { Context, ContextContent, ContextContentBody, ContextContentHeader, ContextTrigger, getContextUsage, getContextUsedTokens } from "./Context.js";
|
|
5
|
+
import { Button } from "./Button.js";
|
|
5
6
|
import { MessageScroller, MessageScrollerButton, MessageScrollerContent, MessageScrollerItem, MessageScrollerProvider, MessageScrollerViewport } from "./MessageScroller.js";
|
|
6
7
|
import { ConversationEmptyState } from "./Conversation.js";
|
|
7
8
|
import { Message, MessageAction, MessageActions, MessageAttachment, MessageContent, MessageResponse } from "./Message.js";
|
|
8
9
|
import { Marker, MarkerContent } from "./Marker.js";
|
|
9
|
-
import { PromptInput, PromptInputActionAddAttachments, PromptInputActionMenu, PromptInputActionMenuContent, PromptInputActionMenuTrigger, PromptInputApproval, PromptInputAttachments, PromptInputBody, PromptInputButton, PromptInputFooter, PromptInputPermissionSelector, PromptInputSubmit, PromptInputTextarea, PromptInputTools, getApprovalRequestId, getApprovalStateKey, getPendingToolApprovals, usePromptInputAttachments } from "./PromptInput.js";
|
|
10
|
+
import { PromptInput, PromptInputActionAddAttachments, PromptInputActionMenu, PromptInputActionMenuContent, PromptInputActionMenuTrigger, PromptInputApproval, PromptInputAttachments, PromptInputBody, PromptInputButton, PromptInputFooter, PromptInputHeader, PromptInputPermissionSelector, PromptInputSubmit, PromptInputTextarea, PromptInputTools, getApprovalRequestId, getApprovalStateKey, getPendingToolApprovals, usePromptInputAttachments } from "./PromptInput.js";
|
|
10
11
|
import { Reasoning, ReasoningContent, ReasoningTrigger } from "./Reasoning.js";
|
|
11
12
|
import { Source, Sources, SourcesContent, SourcesTrigger } from "./Sources.js";
|
|
13
|
+
import { t as CopyButton } from "../copy-button-DUMLYdsk.js";
|
|
12
14
|
import { t as summarizeToolInput } from "../summarize-tool-input-BUJsENSn.js";
|
|
13
15
|
import * as React from "react";
|
|
14
16
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -117,6 +119,123 @@ function isCompactionMessage$1(message) {
|
|
|
117
119
|
function getMessageText(message) {
|
|
118
120
|
return message.parts.filter((part) => isTextUIPart(part) || isReasoningUIPart(part)).map((part) => part.text).join("");
|
|
119
121
|
}
|
|
122
|
+
function getCopyableResponseText(message) {
|
|
123
|
+
return message.parts.filter(isTextUIPart).map((part) => part.text).join("\n\n").trim() || void 0;
|
|
124
|
+
}
|
|
125
|
+
function AgentChatAssistantActions({ message, responseNumber, showCopy, showRetry, onRegenerate, onCopyStatus }) {
|
|
126
|
+
const copyText = getCopyableResponseText(message);
|
|
127
|
+
if ((!showCopy || !copyText) && !showRetry) return null;
|
|
128
|
+
return /* @__PURE__ */ jsxs(MessageActions, {
|
|
129
|
+
"aria-label": `Actions for response ${responseNumber}`,
|
|
130
|
+
children: [showCopy && copyText ? /* @__PURE__ */ jsx(CopyButton, {
|
|
131
|
+
className: "message__action",
|
|
132
|
+
label: `Copy response ${responseNumber}`,
|
|
133
|
+
tooltip: "Copy response",
|
|
134
|
+
text: copyText,
|
|
135
|
+
size: "icon-lg",
|
|
136
|
+
onCopy: () => onCopyStatus(`Response ${responseNumber} copied.`),
|
|
137
|
+
onError: () => onCopyStatus(`Could not copy response ${responseNumber}. Try again.`)
|
|
138
|
+
}) : null, showRetry && onRegenerate ? /* @__PURE__ */ jsx(MessageAction, {
|
|
139
|
+
label: "Retry",
|
|
140
|
+
tooltip: "Regenerate response",
|
|
141
|
+
size: "icon-lg",
|
|
142
|
+
onClick: () => onRegenerate(message.id),
|
|
143
|
+
children: /* @__PURE__ */ jsx(RefreshIcon, { size: 14 })
|
|
144
|
+
}) : null]
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
function getEditableUserText(message) {
|
|
148
|
+
if (message.role !== "user" || message.parts.length !== 1) return void 0;
|
|
149
|
+
const part = message.parts[0];
|
|
150
|
+
return isTextUIPart(part) && part.text.trim() ? part.text : void 0;
|
|
151
|
+
}
|
|
152
|
+
function AgentChatMessageEditor({ message, originalText, onCancel, onEditAndResend, onSuccess }) {
|
|
153
|
+
const [draft, setDraft] = React.useState(originalText);
|
|
154
|
+
const [isSubmitting, setIsSubmitting] = React.useState(false);
|
|
155
|
+
const [error, setError] = React.useState();
|
|
156
|
+
const textareaRef = React.useRef(null);
|
|
157
|
+
const labelId = React.useId();
|
|
158
|
+
const errorId = React.useId();
|
|
159
|
+
const trimmedDraft = draft.trim();
|
|
160
|
+
const canSubmit = !isSubmitting && Boolean(trimmedDraft) && trimmedDraft !== originalText.trim();
|
|
161
|
+
React.useLayoutEffect(() => {
|
|
162
|
+
textareaRef.current?.focus();
|
|
163
|
+
const end = textareaRef.current?.value.length ?? 0;
|
|
164
|
+
textareaRef.current?.setSelectionRange(end, end);
|
|
165
|
+
}, []);
|
|
166
|
+
const handleSubmit = async (event) => {
|
|
167
|
+
event.preventDefault();
|
|
168
|
+
if (!canSubmit) return;
|
|
169
|
+
setError(void 0);
|
|
170
|
+
setIsSubmitting(true);
|
|
171
|
+
try {
|
|
172
|
+
await onEditAndResend({
|
|
173
|
+
message,
|
|
174
|
+
text: trimmedDraft
|
|
175
|
+
});
|
|
176
|
+
onSuccess();
|
|
177
|
+
} catch {
|
|
178
|
+
setError("Message wasn’t resent. Try again.");
|
|
179
|
+
setIsSubmitting(false);
|
|
180
|
+
}
|
|
181
|
+
};
|
|
182
|
+
return /* @__PURE__ */ jsxs("form", {
|
|
183
|
+
className: "message__edit-form",
|
|
184
|
+
"aria-busy": isSubmitting,
|
|
185
|
+
onSubmit: (event) => void handleSubmit(event),
|
|
186
|
+
children: [
|
|
187
|
+
/* @__PURE__ */ jsx("label", {
|
|
188
|
+
id: labelId,
|
|
189
|
+
className: "message__edit-label",
|
|
190
|
+
htmlFor: `${labelId}-textarea`,
|
|
191
|
+
children: "Edit message"
|
|
192
|
+
}),
|
|
193
|
+
/* @__PURE__ */ jsx("textarea", {
|
|
194
|
+
ref: textareaRef,
|
|
195
|
+
id: `${labelId}-textarea`,
|
|
196
|
+
className: "message__edit-textarea",
|
|
197
|
+
value: draft,
|
|
198
|
+
"aria-describedby": error ? errorId : void 0,
|
|
199
|
+
"aria-invalid": error ? true : void 0,
|
|
200
|
+
disabled: isSubmitting,
|
|
201
|
+
rows: 3,
|
|
202
|
+
onChange: (event) => {
|
|
203
|
+
setDraft(event.currentTarget.value);
|
|
204
|
+
if (error) setError(void 0);
|
|
205
|
+
},
|
|
206
|
+
onKeyDown: (event) => {
|
|
207
|
+
if (event.key !== "Escape" || isSubmitting) return;
|
|
208
|
+
event.preventDefault();
|
|
209
|
+
onCancel();
|
|
210
|
+
}
|
|
211
|
+
}),
|
|
212
|
+
error ? /* @__PURE__ */ jsx("p", {
|
|
213
|
+
id: errorId,
|
|
214
|
+
className: "message__edit-error",
|
|
215
|
+
role: "alert",
|
|
216
|
+
children: error
|
|
217
|
+
}) : null,
|
|
218
|
+
/* @__PURE__ */ jsxs("div", {
|
|
219
|
+
className: "message__edit-actions",
|
|
220
|
+
children: [/* @__PURE__ */ jsx(Button, {
|
|
221
|
+
type: "button",
|
|
222
|
+
variant: "outline",
|
|
223
|
+
color: "neutral",
|
|
224
|
+
size: "lg",
|
|
225
|
+
disabled: isSubmitting,
|
|
226
|
+
onClick: onCancel,
|
|
227
|
+
children: "Cancel"
|
|
228
|
+
}), /* @__PURE__ */ jsx(Button, {
|
|
229
|
+
type: "submit",
|
|
230
|
+
color: "primary",
|
|
231
|
+
size: "lg",
|
|
232
|
+
disabled: !canSubmit,
|
|
233
|
+
children: isSubmitting ? "Resending…" : "Send"
|
|
234
|
+
})]
|
|
235
|
+
})
|
|
236
|
+
]
|
|
237
|
+
});
|
|
238
|
+
}
|
|
120
239
|
function formatSourceTitle(part) {
|
|
121
240
|
if (part.title) return part.title;
|
|
122
241
|
if (part.type === "source-document") return part.filename ?? part.mediaType;
|
|
@@ -191,7 +310,20 @@ function renderDefaultPart(part) {
|
|
|
191
310
|
* transport. Product code that talks to a Cloudflare Think agent should render
|
|
192
311
|
* `ThinkChat`; use this directly only for plain AI SDK or read-only messages.
|
|
193
312
|
*/
|
|
194
|
-
function AgentChat({ className, messages, status = "ready", onSubmit, onStop, placeholder = "Ask anything...", disabled, emptyState, composerTools, composerAddMenuItems, notice, onRegenerate, onApprovalResponse, thinkStub, onExecutionSettled, pendingApprovals: durableApprovals = EMPTY_PENDING_APPROVALS, contextWindow, renderPart, renderMessageAfter, ref }) {
|
|
313
|
+
function AgentChat({ className, messages, status = "ready", onSubmit, onStop, placeholder = "Ask anything...", disabled, emptyState, composerHeader, composerTools, composerAddMenuItems, notice, onRegenerate, onEditAndResend, onApprovalResponse, thinkStub, onExecutionSettled, pendingApprovals: durableApprovals = EMPTY_PENDING_APPROVALS, contextWindow, renderPart, renderMessageAfter, ref }) {
|
|
314
|
+
const [copyAnnouncement, setCopyAnnouncement] = React.useState("");
|
|
315
|
+
const copyAnnouncementTimer = React.useRef(null);
|
|
316
|
+
const announceCopyStatus = React.useCallback((message) => {
|
|
317
|
+
if (copyAnnouncementTimer.current !== null) window.clearTimeout(copyAnnouncementTimer.current);
|
|
318
|
+
setCopyAnnouncement("");
|
|
319
|
+
copyAnnouncementTimer.current = window.setTimeout(() => {
|
|
320
|
+
setCopyAnnouncement(message);
|
|
321
|
+
copyAnnouncementTimer.current = null;
|
|
322
|
+
}, 50);
|
|
323
|
+
}, []);
|
|
324
|
+
React.useEffect(() => () => {
|
|
325
|
+
if (copyAnnouncementTimer.current !== null) window.clearTimeout(copyAnnouncementTimer.current);
|
|
326
|
+
}, []);
|
|
195
327
|
const handleSubmit = React.useCallback((message) => {
|
|
196
328
|
onSubmit?.(message);
|
|
197
329
|
}, [onSubmit]);
|
|
@@ -253,7 +385,23 @@ function AgentChat({ className, messages, status = "ready", onSubmit, onStop, pl
|
|
|
253
385
|
]);
|
|
254
386
|
const pendingApproval = permissionMode === "bypass" ? void 0 : pendingApprovalItems[0];
|
|
255
387
|
const contextUsage = contextWindow ? getContextUsage(messages) : void 0;
|
|
256
|
-
const
|
|
388
|
+
const newestAssistantIndex = messages.findLastIndex((message) => message.role === "assistant" && !isCompactionMessage$1(message));
|
|
389
|
+
const lastAssistantIndex = onRegenerate && status !== "streaming" && status !== "submitted" ? newestAssistantIndex : -1;
|
|
390
|
+
const lastUserIndex = onEditAndResend && !disabled && status !== "streaming" && status !== "submitted" ? messages.findLastIndex((message) => message.role === "user") : -1;
|
|
391
|
+
const [editingMessageId, setEditingMessageId] = React.useState();
|
|
392
|
+
const restoreEditFocus = React.useRef(false);
|
|
393
|
+
const editButtonRef = React.useRef(null);
|
|
394
|
+
let assistantResponseCount = 0;
|
|
395
|
+
const assistantResponseNumbers = messages.map((message) => {
|
|
396
|
+
if (message.role !== "assistant" || isCompactionMessage$1(message)) return 0;
|
|
397
|
+
assistantResponseCount += 1;
|
|
398
|
+
return assistantResponseCount;
|
|
399
|
+
});
|
|
400
|
+
React.useLayoutEffect(() => {
|
|
401
|
+
if (editingMessageId || !restoreEditFocus.current) return;
|
|
402
|
+
editButtonRef.current?.focus();
|
|
403
|
+
restoreEditFocus.current = false;
|
|
404
|
+
}, [editingMessageId]);
|
|
257
405
|
const composerRef = (el) => {
|
|
258
406
|
if (!el || typeof ResizeObserver === "undefined") return;
|
|
259
407
|
const root = el.parentElement;
|
|
@@ -266,121 +414,161 @@ function AgentChat({ className, messages, status = "ready", onSubmit, onStop, pl
|
|
|
266
414
|
return /* @__PURE__ */ jsxs("div", {
|
|
267
415
|
ref,
|
|
268
416
|
className: cx("agent-chat", className),
|
|
269
|
-
children: [
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
children:
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
});
|
|
300
|
-
if (isSourceUrlPart(part) || isSourceDocumentPart(part)) {
|
|
301
|
-
if (custom !== void 0) return custom ? /* @__PURE__ */ jsx(MessageContent, { children: custom }, getPartKey(part, partIndex)) : null;
|
|
302
|
-
const previous = message.parts[partIndex - 1];
|
|
303
|
-
if (isSourceUrlPart(previous) || isSourceDocumentPart(previous)) return null;
|
|
304
|
-
return /* @__PURE__ */ jsx(MessageContent, { children: renderSources(getSourceRun(message.parts, partIndex)) }, getPartKey(part, partIndex));
|
|
305
|
-
}
|
|
306
|
-
const rendered = custom === void 0 ? defaultRender() : custom;
|
|
307
|
-
return rendered ? /* @__PURE__ */ jsxs(MessageContent, { children: [rendered, isCompactedPart(message, part, partIndex) ? /* @__PURE__ */ jsx("div", {
|
|
308
|
-
className: "message__compacted",
|
|
309
|
-
children: "Output truncated for storage"
|
|
310
|
-
}) : null] }, getPartKey(part, partIndex)) : null;
|
|
311
|
-
}),
|
|
312
|
-
renderMessageAfter?.({
|
|
417
|
+
children: [
|
|
418
|
+
/* @__PURE__ */ jsx("span", {
|
|
419
|
+
className: "message__copy-status",
|
|
420
|
+
role: "status",
|
|
421
|
+
"aria-atomic": "true",
|
|
422
|
+
children: copyAnnouncement
|
|
423
|
+
}),
|
|
424
|
+
/* @__PURE__ */ jsx(MessageScrollerProvider, {
|
|
425
|
+
autoScroll: true,
|
|
426
|
+
defaultScrollPosition: "last-anchor",
|
|
427
|
+
children: /* @__PURE__ */ jsxs(MessageScroller, {
|
|
428
|
+
className: "agent-chat__conversation",
|
|
429
|
+
children: [/* @__PURE__ */ jsx(MessageScrollerViewport, { children: /* @__PURE__ */ jsxs(MessageScrollerContent, {
|
|
430
|
+
"aria-busy": status === "streaming" || status === "submitted",
|
|
431
|
+
className: "agent-chat__transcript-content",
|
|
432
|
+
children: [messages.length === 0 ? /* @__PURE__ */ jsx(MessageScrollerItem, {
|
|
433
|
+
className: "agent-chat__empty-row",
|
|
434
|
+
children: emptyState ?? /* @__PURE__ */ jsx(ConversationEmptyState, {
|
|
435
|
+
title: "Start a conversation",
|
|
436
|
+
description: "Ask the agent to inspect, plan, or build."
|
|
437
|
+
})
|
|
438
|
+
}) : null, messages.map((message, messageIndex) => /* @__PURE__ */ jsx(MessageScrollerItem, {
|
|
439
|
+
messageId: message.id,
|
|
440
|
+
scrollAnchor: message.role === "user",
|
|
441
|
+
children: isCompactionMessage$1(message) ? /* @__PURE__ */ jsx(Marker, {
|
|
442
|
+
variant: "separator",
|
|
443
|
+
children: /* @__PURE__ */ jsx(MarkerContent, { children: getMessageText(message) || "Conversation compacted" })
|
|
444
|
+
}) : /* @__PURE__ */ jsx(Message, {
|
|
445
|
+
from: message.role,
|
|
446
|
+
children: editingMessageId === message.id && onEditAndResend ? /* @__PURE__ */ jsx(AgentChatMessageEditor, {
|
|
313
447
|
message,
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
448
|
+
originalText: getEditableUserText(message) ?? "",
|
|
449
|
+
onEditAndResend,
|
|
450
|
+
onCancel: () => {
|
|
451
|
+
restoreEditFocus.current = true;
|
|
452
|
+
setEditingMessageId(void 0);
|
|
453
|
+
},
|
|
454
|
+
onSuccess: () => {
|
|
455
|
+
restoreEditFocus.current = false;
|
|
456
|
+
setEditingMessageId(void 0);
|
|
457
|
+
}
|
|
458
|
+
}, message.id) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
459
|
+
message.parts.map((part, partIndex) => {
|
|
460
|
+
const defaultRender = () => renderDefaultPart(part);
|
|
461
|
+
const custom = renderPart?.({
|
|
462
|
+
message,
|
|
463
|
+
part,
|
|
464
|
+
partIndex,
|
|
465
|
+
defaultRender
|
|
466
|
+
});
|
|
467
|
+
if (isSourceUrlPart(part) || isSourceDocumentPart(part)) {
|
|
468
|
+
if (custom !== void 0) return custom ? /* @__PURE__ */ jsx(MessageContent, { children: custom }, getPartKey(part, partIndex)) : null;
|
|
469
|
+
const previous = message.parts[partIndex - 1];
|
|
470
|
+
if (isSourceUrlPart(previous) || isSourceDocumentPart(previous)) return null;
|
|
471
|
+
return /* @__PURE__ */ jsx(MessageContent, { children: renderSources(getSourceRun(message.parts, partIndex)) }, getPartKey(part, partIndex));
|
|
472
|
+
}
|
|
473
|
+
const rendered = custom === void 0 ? defaultRender() : custom;
|
|
474
|
+
return rendered ? /* @__PURE__ */ jsxs(MessageContent, { children: [rendered, isCompactedPart(message, part, partIndex) ? /* @__PURE__ */ jsx("div", {
|
|
475
|
+
className: "message__compacted",
|
|
476
|
+
children: "Output truncated for storage"
|
|
477
|
+
}) : null] }, getPartKey(part, partIndex)) : null;
|
|
478
|
+
}),
|
|
479
|
+
renderMessageAfter?.({
|
|
480
|
+
message,
|
|
481
|
+
messageIndex
|
|
482
|
+
}),
|
|
483
|
+
onEditAndResend && messageIndex === lastUserIndex && getEditableUserText(message) !== void 0 ? /* @__PURE__ */ jsx(MessageActions, {
|
|
484
|
+
"aria-label": "Message actions",
|
|
485
|
+
children: /* @__PURE__ */ jsx(MessageAction, {
|
|
486
|
+
ref: editButtonRef,
|
|
487
|
+
label: "Edit message",
|
|
488
|
+
tooltip: "Edit and resend",
|
|
489
|
+
size: "icon-lg",
|
|
490
|
+
onClick: () => {
|
|
491
|
+
restoreEditFocus.current = false;
|
|
492
|
+
setEditingMessageId(message.id);
|
|
493
|
+
},
|
|
494
|
+
children: /* @__PURE__ */ jsx(PencilIcon, {})
|
|
495
|
+
})
|
|
496
|
+
}) : null,
|
|
497
|
+
message.role === "assistant" ? /* @__PURE__ */ jsx(AgentChatAssistantActions, {
|
|
498
|
+
message,
|
|
499
|
+
responseNumber: assistantResponseNumbers[messageIndex],
|
|
500
|
+
showCopy: messageIndex !== newestAssistantIndex || status !== "streaming" && status !== "submitted",
|
|
501
|
+
showRetry: messageIndex === lastAssistantIndex,
|
|
502
|
+
onRegenerate,
|
|
503
|
+
onCopyStatus: announceCopyStatus
|
|
504
|
+
}) : null
|
|
505
|
+
] })
|
|
506
|
+
})
|
|
507
|
+
}, message.id ?? messageIndex))]
|
|
508
|
+
}) }), /* @__PURE__ */ jsx(MessageScrollerButton, {
|
|
509
|
+
"aria-label": "Scroll to latest",
|
|
510
|
+
className: "agent-chat__scroll-button",
|
|
511
|
+
size: "icon"
|
|
512
|
+
})]
|
|
513
|
+
})
|
|
514
|
+
}),
|
|
515
|
+
/* @__PURE__ */ jsxs("div", {
|
|
516
|
+
ref: composerRef,
|
|
517
|
+
className: "agent-chat__composer",
|
|
518
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
519
|
+
className: "agent-chat__notice",
|
|
520
|
+
role: "status",
|
|
521
|
+
"aria-atomic": "true",
|
|
522
|
+
children: notice
|
|
523
|
+
}), /* @__PURE__ */ jsx(PromptInput, {
|
|
524
|
+
multiple: true,
|
|
525
|
+
onSubmit: handleSubmit,
|
|
526
|
+
children: pendingApproval ? /* @__PURE__ */ jsx(PromptInputApproval, {
|
|
527
|
+
part: "part" in pendingApproval ? pendingApproval.part : void 0,
|
|
528
|
+
approval: "approval" in pendingApproval ? pendingApproval.approval : void 0,
|
|
529
|
+
count: pendingApprovalItems.length,
|
|
530
|
+
onRespond: onApprovalResponse,
|
|
531
|
+
thinkStub,
|
|
532
|
+
onExecutionSettled,
|
|
533
|
+
onSkip: () => {
|
|
534
|
+
const id = "part" in pendingApproval ? getApprovalStateKey(pendingApproval.part) : pendingApproval.approval.executionId;
|
|
535
|
+
if (id) updateApprovalSession((current) => ({
|
|
536
|
+
...current,
|
|
537
|
+
skippedApprovalIds: [...current.skippedApprovalIds, id]
|
|
538
|
+
}));
|
|
539
|
+
}
|
|
540
|
+
}) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
541
|
+
composerHeader ? /* @__PURE__ */ jsx(PromptInputHeader, { children: composerHeader }) : null,
|
|
542
|
+
/* @__PURE__ */ jsx(PromptInputAttachments, {}),
|
|
543
|
+
/* @__PURE__ */ jsx(PromptInputBody, { children: /* @__PURE__ */ jsx(PromptInputTextarea, {
|
|
544
|
+
"aria-label": "Message",
|
|
545
|
+
placeholder,
|
|
546
|
+
disabled
|
|
547
|
+
}) }),
|
|
548
|
+
/* @__PURE__ */ jsxs(PromptInputFooter, { children: [/* @__PURE__ */ jsxs(PromptInputTools, { children: [
|
|
549
|
+
/* @__PURE__ */ jsx(AgentChatAddMenu, { children: composerAddMenuItems }),
|
|
550
|
+
approvalsWired ? /* @__PURE__ */ jsx(PromptInputPermissionSelector, {
|
|
551
|
+
value: permissionMode,
|
|
552
|
+
onValueChange: setPermissionMode
|
|
553
|
+
}) : null,
|
|
554
|
+
composerTools
|
|
555
|
+
] }), /* @__PURE__ */ jsxs("div", {
|
|
556
|
+
className: "prompt-input__footer-end",
|
|
557
|
+
children: [contextWindow ? /* @__PURE__ */ jsxs(Context, {
|
|
558
|
+
usedTokens: getContextUsedTokens(contextUsage),
|
|
559
|
+
maxTokens: contextWindow.maxTokens,
|
|
560
|
+
usage: contextUsage,
|
|
561
|
+
modelId: contextWindow.modelId,
|
|
562
|
+
children: [/* @__PURE__ */ jsx(ContextTrigger, {}), /* @__PURE__ */ jsxs(ContextContent, { children: [/* @__PURE__ */ jsx(ContextContentHeader, {}), /* @__PURE__ */ jsx(ContextContentBody, {})] })]
|
|
563
|
+
}) : null, /* @__PURE__ */ jsx(PromptInputSubmit, {
|
|
564
|
+
status,
|
|
565
|
+
onStop
|
|
566
|
+
})]
|
|
567
|
+
})] })
|
|
568
|
+
] })
|
|
329
569
|
})]
|
|
330
570
|
})
|
|
331
|
-
|
|
332
|
-
ref: composerRef,
|
|
333
|
-
className: "agent-chat__composer",
|
|
334
|
-
children: [notice ? /* @__PURE__ */ jsx("div", {
|
|
335
|
-
className: "agent-chat__notice",
|
|
336
|
-
children: notice
|
|
337
|
-
}) : null, /* @__PURE__ */ jsx(PromptInput, {
|
|
338
|
-
multiple: true,
|
|
339
|
-
onSubmit: handleSubmit,
|
|
340
|
-
children: pendingApproval ? /* @__PURE__ */ jsx(PromptInputApproval, {
|
|
341
|
-
part: "part" in pendingApproval ? pendingApproval.part : void 0,
|
|
342
|
-
approval: "approval" in pendingApproval ? pendingApproval.approval : void 0,
|
|
343
|
-
count: pendingApprovalItems.length,
|
|
344
|
-
onRespond: onApprovalResponse,
|
|
345
|
-
thinkStub,
|
|
346
|
-
onExecutionSettled,
|
|
347
|
-
onSkip: () => {
|
|
348
|
-
const id = "part" in pendingApproval ? getApprovalStateKey(pendingApproval.part) : pendingApproval.approval.executionId;
|
|
349
|
-
if (id) updateApprovalSession((current) => ({
|
|
350
|
-
...current,
|
|
351
|
-
skippedApprovalIds: [...current.skippedApprovalIds, id]
|
|
352
|
-
}));
|
|
353
|
-
}
|
|
354
|
-
}) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
355
|
-
/* @__PURE__ */ jsx(PromptInputAttachments, {}),
|
|
356
|
-
/* @__PURE__ */ jsx(PromptInputBody, { children: /* @__PURE__ */ jsx(PromptInputTextarea, {
|
|
357
|
-
"aria-label": "Message",
|
|
358
|
-
placeholder,
|
|
359
|
-
disabled
|
|
360
|
-
}) }),
|
|
361
|
-
/* @__PURE__ */ jsxs(PromptInputFooter, { children: [/* @__PURE__ */ jsxs(PromptInputTools, { children: [
|
|
362
|
-
/* @__PURE__ */ jsx(AgentChatAddMenu, { children: composerAddMenuItems }),
|
|
363
|
-
approvalsWired ? /* @__PURE__ */ jsx(PromptInputPermissionSelector, {
|
|
364
|
-
value: permissionMode,
|
|
365
|
-
onValueChange: setPermissionMode
|
|
366
|
-
}) : null,
|
|
367
|
-
composerTools
|
|
368
|
-
] }), /* @__PURE__ */ jsxs("div", {
|
|
369
|
-
className: "prompt-input__footer-end",
|
|
370
|
-
children: [contextWindow ? /* @__PURE__ */ jsxs(Context, {
|
|
371
|
-
usedTokens: getContextUsedTokens(contextUsage),
|
|
372
|
-
maxTokens: contextWindow.maxTokens,
|
|
373
|
-
usage: contextUsage,
|
|
374
|
-
modelId: contextWindow.modelId,
|
|
375
|
-
children: [/* @__PURE__ */ jsx(ContextTrigger, {}), /* @__PURE__ */ jsxs(ContextContent, { children: [/* @__PURE__ */ jsx(ContextContentHeader, {}), /* @__PURE__ */ jsx(ContextContentBody, {})] })]
|
|
376
|
-
}) : null, /* @__PURE__ */ jsx(PromptInputSubmit, {
|
|
377
|
-
status,
|
|
378
|
-
onStop
|
|
379
|
-
})]
|
|
380
|
-
})] })
|
|
381
|
-
] })
|
|
382
|
-
})]
|
|
383
|
-
})]
|
|
571
|
+
]
|
|
384
572
|
});
|
|
385
573
|
}
|
|
386
574
|
//#endregion
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { t as cx } from "../class-names-9UtZwb0J.js";
|
|
2
|
-
import { b as LinkIcon } from "../icons-
|
|
2
|
+
import { b as LinkIcon } from "../icons-Ba9THQKz.js";
|
|
3
3
|
import { Popover } from "./Popover.js";
|
|
4
4
|
import { Button } from "./Button.js";
|
|
5
|
-
import { a as CodeBlockCopyButton, i as CodeBlockContent, n as CodeBlockActions, p as CodeBlockTitle, r as CodeBlockContainer, s as CodeBlockHeader, t as CodeBlock } from "../CodeBlock-
|
|
5
|
+
import { a as CodeBlockCopyButton, i as CodeBlockContent, n as CodeBlockActions, p as CodeBlockTitle, r as CodeBlockContainer, s as CodeBlockHeader, t as CodeBlock } from "../CodeBlock-BUFXG8HW.js";
|
|
6
6
|
import { Field } from "./Field.js";
|
|
7
7
|
import { Form } from "./Form.js";
|
|
8
8
|
import * as React from "react";
|
|
@@ -9,6 +9,9 @@ interface AlertDialogTriggerProps extends Omit<React.ComponentPropsWithRef<typeo
|
|
|
9
9
|
interface AlertDialogBackdropProps extends Omit<React.ComponentPropsWithRef<typeof AlertDialog$1.Backdrop>, "className"> {
|
|
10
10
|
className?: string;
|
|
11
11
|
}
|
|
12
|
+
interface AlertDialogViewportProps extends Omit<React.ComponentPropsWithRef<typeof AlertDialog$1.Viewport>, "className"> {
|
|
13
|
+
className?: string;
|
|
14
|
+
}
|
|
12
15
|
interface AlertDialogPopupProps extends Omit<React.ComponentPropsWithRef<typeof AlertDialog$1.Popup>, "className"> {
|
|
13
16
|
className?: string;
|
|
14
17
|
/**
|
|
@@ -31,10 +34,6 @@ interface AlertDialogCloseProps extends Omit<React.ComponentPropsWithRef<typeof
|
|
|
31
34
|
*/
|
|
32
35
|
variant?: "primary" | "secondary" | "destructive" | "outline" | "ghost";
|
|
33
36
|
}
|
|
34
|
-
type AlertDialogOverlayProps = AlertDialogBackdropProps;
|
|
35
|
-
type AlertDialogContentProps = AlertDialogPopupProps;
|
|
36
|
-
type AlertDialogActionProps = AlertDialogCloseProps;
|
|
37
|
-
type AlertDialogCancelProps = AlertDialogCloseProps;
|
|
38
37
|
interface AlertDialogHeaderProps extends React.HTMLAttributes<HTMLDivElement> {}
|
|
39
38
|
interface AlertDialogFooterProps extends React.HTMLAttributes<HTMLDivElement> {}
|
|
40
39
|
interface AlertDialogMediaProps extends React.HTMLAttributes<HTMLDivElement> {}
|
|
@@ -44,27 +43,28 @@ interface AlertDialogMediaProps extends React.HTMLAttributes<HTMLDivElement> {}
|
|
|
44
43
|
*
|
|
45
44
|
* @example
|
|
46
45
|
* ```tsx
|
|
47
|
-
* <AlertDialog>
|
|
48
|
-
* <
|
|
49
|
-
* <
|
|
50
|
-
* <
|
|
51
|
-
* <
|
|
52
|
-
* <
|
|
53
|
-
* <
|
|
46
|
+
* <AlertDialog.Root>
|
|
47
|
+
* <AlertDialog.Trigger>Delete Account</AlertDialog.Trigger>
|
|
48
|
+
* <AlertDialog.Portal>
|
|
49
|
+
* <AlertDialog.Backdrop />
|
|
50
|
+
* <AlertDialog.Viewport>
|
|
51
|
+
* <AlertDialog.Popup>
|
|
52
|
+
* <AlertDialog.Title>Are you sure?</AlertDialog.Title>
|
|
53
|
+
* <AlertDialog.Description>
|
|
54
54
|
* This action cannot be undone.
|
|
55
|
-
* </
|
|
55
|
+
* </AlertDialog.Description>
|
|
56
56
|
* <div style={{ display: "flex", gap: "0.5rem", justifyContent: "flex-end" }}>
|
|
57
|
-
* <
|
|
58
|
-
* <
|
|
57
|
+
* <AlertDialog.Close>Cancel</AlertDialog.Close>
|
|
58
|
+
* <AlertDialog.Close variant="destructive">Delete</AlertDialog.Close>
|
|
59
59
|
* </div>
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
60
|
+
* </AlertDialog.Popup>
|
|
61
|
+
* </AlertDialog.Viewport>
|
|
62
|
+
* </AlertDialog.Portal>
|
|
63
|
+
* </AlertDialog.Root>
|
|
63
64
|
* ```
|
|
64
65
|
*
|
|
65
66
|
* @see {@link https://base-ui.com/react/components/alert-dialog | Base UI Alert Dialog}
|
|
66
67
|
*/
|
|
67
|
-
declare const AlertDialog: typeof AlertDialog$1.Root;
|
|
68
68
|
declare function AlertDialogTrigger({
|
|
69
69
|
className,
|
|
70
70
|
ref,
|
|
@@ -72,7 +72,6 @@ declare function AlertDialogTrigger({
|
|
|
72
72
|
}: AlertDialogTriggerProps & {
|
|
73
73
|
ref?: React.Ref<HTMLButtonElement>;
|
|
74
74
|
}): React.JSX.Element;
|
|
75
|
-
declare const AlertDialogPortal: React.ForwardRefExoticComponent<Omit<import("@base-ui/react").AlertDialogPortalProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
76
75
|
declare function AlertDialogBackdrop({
|
|
77
76
|
className,
|
|
78
77
|
ref,
|
|
@@ -80,19 +79,19 @@ declare function AlertDialogBackdrop({
|
|
|
80
79
|
}: AlertDialogBackdropProps & {
|
|
81
80
|
ref?: React.Ref<HTMLDivElement>;
|
|
82
81
|
}): React.JSX.Element;
|
|
83
|
-
declare
|
|
84
|
-
declare function AlertDialogPopup({
|
|
85
|
-
size,
|
|
82
|
+
declare function AlertDialogViewport({
|
|
86
83
|
className,
|
|
87
84
|
ref,
|
|
88
85
|
...props
|
|
89
|
-
}:
|
|
86
|
+
}: AlertDialogViewportProps & {
|
|
90
87
|
ref?: React.Ref<HTMLDivElement>;
|
|
91
88
|
}): React.JSX.Element;
|
|
92
|
-
declare function
|
|
89
|
+
declare function AlertDialogPopup({
|
|
90
|
+
size,
|
|
91
|
+
className,
|
|
93
92
|
ref,
|
|
94
93
|
...props
|
|
95
|
-
}:
|
|
94
|
+
}: AlertDialogPopupProps & {
|
|
96
95
|
ref?: React.Ref<HTMLDivElement>;
|
|
97
96
|
}): React.JSX.Element;
|
|
98
97
|
declare function AlertDialogHeader({
|
|
@@ -138,11 +137,20 @@ declare function AlertDialogClose({
|
|
|
138
137
|
}: AlertDialogCloseProps & {
|
|
139
138
|
ref?: React.Ref<HTMLButtonElement>;
|
|
140
139
|
}): React.JSX.Element;
|
|
141
|
-
declare
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
140
|
+
declare const AlertDialog: {
|
|
141
|
+
Root: typeof AlertDialog$1.Root;
|
|
142
|
+
Trigger: typeof AlertDialogTrigger;
|
|
143
|
+
Portal: React.ForwardRefExoticComponent<Omit<import("@base-ui/react").AlertDialogPortalProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
144
|
+
Backdrop: typeof AlertDialogBackdrop;
|
|
145
|
+
Viewport: typeof AlertDialogViewport;
|
|
146
|
+
Popup: typeof AlertDialogPopup;
|
|
147
|
+
Header: typeof AlertDialogHeader;
|
|
148
|
+
Footer: typeof AlertDialogFooter;
|
|
149
|
+
Media: typeof AlertDialogMedia;
|
|
150
|
+
Title: typeof AlertDialogTitle;
|
|
151
|
+
Description: typeof AlertDialogDescription;
|
|
152
|
+
Close: typeof AlertDialogClose;
|
|
153
|
+
createHandle: typeof AlertDialog$1.createHandle;
|
|
154
|
+
};
|
|
147
155
|
//#endregion
|
|
148
|
-
export { AlertDialog,
|
|
156
|
+
export { AlertDialog, AlertDialogBackdropProps, AlertDialogCloseProps, AlertDialogDescriptionProps, AlertDialogFooterProps, AlertDialogHeaderProps, AlertDialogMediaProps, AlertDialogPopupProps, AlertDialogProps, AlertDialogTitleProps, AlertDialogTriggerProps, AlertDialogViewportProps };
|