@mcp-b/react-components 0.37.0 → 0.39.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/{AgentActivity-SP1WfLDW.d.ts → AgentActivity-Cc_oDYum.d.ts} +1 -1
- package/dist/Message-DBsHHhcM.d.ts +228 -0
- package/dist/{ThinkChat-DQh59CeC.js → ThinkChat-BES_3Mb-.js} +9 -4
- package/dist/{ThinkChatActivity-Dkmm2pIj.d.ts → ThinkChatActivity-D6-_5Phw.d.ts} +1 -1
- package/dist/{ThinkChatActivitySummary-teRjrPxW.d.ts → ThinkChatActivitySummary-BtBQgMg6.d.ts} +1 -1
- package/dist/{ToggleGroup-_pQMyHGM.d.ts → ToggleGroup-BrQZOQn_.d.ts} +1 -1
- package/dist/{WorkspaceFileView-Cu_ZG6HJ.js → WorkspaceFileView-D0r7xnq5.js} +3 -3
- package/dist/{WorkspaceLink-DQogVe8E.d.ts → WorkspaceLink-Bh9-Jo1r.d.ts} +1 -1
- package/dist/{WorkspaceLink-DZeLe_jN.js → WorkspaceLink-DtH66bAY.js} +4 -3
- package/dist/{WorkspaceMessageResponse-BWbkIELl.js → WorkspaceMessageResponse-CJCmGvTx.js} +64 -7
- package/dist/WorkspaceMessageResponse-Cy28WGSz.d.ts +24 -0
- package/dist/components/agents-sdk/AgentActivity.d.ts +1 -1
- package/dist/components/agents-sdk/AgentActivityPreview.d.ts +2 -2
- package/dist/components/agents-sdk/AgentActivityPreview.js +1 -1
- package/dist/components/agents-sdk/AgentChat.js +5 -5
- package/dist/components/agents-sdk/BrowserLiveView.d.ts +73 -25
- package/dist/components/agents-sdk/BrowserLiveView.js +95 -65
- package/dist/components/agents-sdk/BrowserRunPanel.js +1 -1
- package/dist/components/agents-sdk/McpPluginCatalog.js +1 -1
- package/dist/components/agents-sdk/ModelSelector.js +1 -1
- package/dist/components/agents-sdk/ThinkChat.d.ts +5 -2
- package/dist/components/agents-sdk/ThinkChat.js +1 -1
- package/dist/components/agents-sdk/ThinkChatActivity.d.ts +1 -1
- package/dist/components/agents-sdk/ThinkChatActivity.js +1 -1
- package/dist/components/agents-sdk/ThinkChatActivitySummary.d.ts +1 -1
- package/dist/components/agents-sdk/ThinkExecutionWorkbench.js +2 -2
- package/dist/components/agents-sdk/ThinkFullApp.d.ts +1 -1
- package/dist/components/agents-sdk/ThinkFullApp.js +11 -10
- package/dist/components/agents-sdk/ThinkFullAppViewSwitch.d.ts +1 -1
- package/dist/components/agents-sdk/ThinkFullAppViewSwitch.js +1 -1
- package/dist/components/agents-sdk/ThinkRoutineBrowser.js +1 -1
- package/dist/components/agents-sdk/ThinkRoutineDetail.js +1 -1
- package/dist/components/agents-sdk/ThinkRoutineForm.js +1 -1
- package/dist/components/agents-sdk/ThinkRoutineLibrary.js +2 -2
- package/dist/components/agents-sdk/ThinkRoutineRuns.js +1 -1
- package/dist/components/agents-sdk/ThinkThreadPicker.js +2 -2
- package/dist/components/agents-sdk/WorkspaceExplorer.d.ts +1 -1
- package/dist/components/agents-sdk/WorkspaceExplorer.js +2 -2
- package/dist/components/agents-sdk/WorkspaceFileView.js +1 -1
- package/dist/components/agents-sdk/WorkspaceLink.d.ts +1 -1
- package/dist/components/agents-sdk/WorkspaceLink.js +1 -1
- package/dist/components/agents-sdk/WorkspaceMessageResponse.d.ts +2 -12
- package/dist/components/agents-sdk/WorkspaceMessageResponse.js +1 -1
- package/dist/components/ai-sdk/Artifact.d.ts +44 -1
- package/dist/components/ai-sdk/Artifact.js +79 -3
- package/dist/components/ai-sdk/Message.d.ts +1 -227
- package/dist/components/foundations/EmptyState.d.ts +10 -0
- package/dist/components/foundations/EmptyState.js +10 -0
- package/dist/components/foundations/ToggleGroup.d.ts +1 -1
- package/dist/components/foundations/ToggleGroup.js +1 -1
- package/dist/components/general-purpose/PricingBillingToggle.js +1 -1
- package/dist/components/general-purpose/PricingUsageCalculator.js +1 -1
- package/dist/components/nanites/AgentToolDetail.js +3 -3
- package/dist/styles/agent-chat.css +2 -2
- package/dist/styles/artifact.css +65 -0
- package/dist/styles/base.css +4 -0
- package/dist/styles/browser-live-view.css +45 -0
- package/dist/styles/think-full-app.css +6 -0
- package/package.json +2 -2
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { t as cx } from "../../class-names-BiMDVpUo.js";
|
|
2
|
-
import { rt as XIcon } from "../../icons-B4mGvCvc.js";
|
|
2
|
+
import { J as SpinnerIcon, rt as XIcon, tt as WarningIcon } from "../../icons-B4mGvCvc.js";
|
|
3
|
+
import { Button, buttonVariants } from "../foundations/Button.js";
|
|
3
4
|
import { IconButton } from "../foundations/IconButton.js";
|
|
5
|
+
import { t as NavigationLink } from "../../navigation-link-kqMa81v5.js";
|
|
4
6
|
import "react";
|
|
5
|
-
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
8
|
//#region src/components/ai-sdk/Artifact.tsx
|
|
7
9
|
/**
|
|
8
10
|
* A container for generated content (code, documents, outputs) with a header
|
|
@@ -107,5 +109,79 @@ function ArtifactContent({ className, children, ref, ...props }) {
|
|
|
107
109
|
children
|
|
108
110
|
});
|
|
109
111
|
}
|
|
112
|
+
/**
|
|
113
|
+
* Controlled inline preview for host-hydrated generated UI runtimes.
|
|
114
|
+
*
|
|
115
|
+
* The design system owns artifact chrome, status copy, disclosure, responsive
|
|
116
|
+
* layout, and accessible announcements. The host owns source reads, sandbox
|
|
117
|
+
* policy, runtime messaging, and the rendered content element.
|
|
118
|
+
*/
|
|
119
|
+
function ArtifactPreview({ className, label, sourceLink, state, ref, ...props }) {
|
|
120
|
+
const liveMessage = state.status === "loading" ? "Loading interactive UI." : state.status === "error" ? `Interactive UI failed to load: ${state.message}` : state.status === "runtime-error" ? `Interactive UI error: ${state.message}` : "Interactive UI loaded.";
|
|
121
|
+
return /* @__PURE__ */ jsxs(Artifact, {
|
|
122
|
+
ref,
|
|
123
|
+
...props,
|
|
124
|
+
"aria-busy": state.status === "loading" || void 0,
|
|
125
|
+
"aria-label": props["aria-label"] ?? label,
|
|
126
|
+
className: cx("artifact-preview", className),
|
|
127
|
+
"data-state": state.status,
|
|
128
|
+
role: props.role ?? "region",
|
|
129
|
+
children: [
|
|
130
|
+
/* @__PURE__ */ jsx("span", {
|
|
131
|
+
className: "sigvelo-visually-hidden",
|
|
132
|
+
role: "status",
|
|
133
|
+
"aria-atomic": "true",
|
|
134
|
+
children: liveMessage
|
|
135
|
+
}),
|
|
136
|
+
/* @__PURE__ */ jsx(ArtifactHeader, {
|
|
137
|
+
className: "artifact-preview__header",
|
|
138
|
+
children: /* @__PURE__ */ jsx(NavigationLink, {
|
|
139
|
+
render: sourceLink,
|
|
140
|
+
className: buttonVariants({
|
|
141
|
+
variant: "ghost",
|
|
142
|
+
color: "neutral",
|
|
143
|
+
size: "xs"
|
|
144
|
+
}),
|
|
145
|
+
children: "View source"
|
|
146
|
+
})
|
|
147
|
+
}),
|
|
148
|
+
state.status === "loading" ? /* @__PURE__ */ jsxs(ArtifactContent, {
|
|
149
|
+
className: "artifact-preview__status",
|
|
150
|
+
children: [/* @__PURE__ */ jsx(SpinnerIcon, {}), "Loading interactive UI…"]
|
|
151
|
+
}) : state.status === "error" ? /* @__PURE__ */ jsx(ArtifactPreviewError, {
|
|
152
|
+
message: state.message,
|
|
153
|
+
onRetry: state.onRetry
|
|
154
|
+
}) : /* @__PURE__ */ jsxs(ArtifactContent, {
|
|
155
|
+
className: "artifact-preview__frame-shell",
|
|
156
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
157
|
+
className: "artifact-preview__runtime",
|
|
158
|
+
inert: state.status === "runtime-error" || void 0,
|
|
159
|
+
children: state.content
|
|
160
|
+
}), state.status === "runtime-error" ? /* @__PURE__ */ jsx(ArtifactPreviewError, {
|
|
161
|
+
message: state.message,
|
|
162
|
+
onRetry: state.onRetry,
|
|
163
|
+
overlay: true
|
|
164
|
+
}) : null]
|
|
165
|
+
})
|
|
166
|
+
]
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
function ArtifactPreviewError({ message, onRetry, overlay = false }) {
|
|
170
|
+
return /* @__PURE__ */ jsxs(ArtifactContent, {
|
|
171
|
+
className: cx("artifact-preview__status", overlay && "artifact-preview__status--overlay"),
|
|
172
|
+
children: [
|
|
173
|
+
/* @__PURE__ */ jsx(WarningIcon, {}),
|
|
174
|
+
/* @__PURE__ */ jsx("span", { children: message }),
|
|
175
|
+
/* @__PURE__ */ jsx(Button, {
|
|
176
|
+
type: "button",
|
|
177
|
+
variant: "outline",
|
|
178
|
+
color: "neutral",
|
|
179
|
+
size: "sm",
|
|
180
|
+
onClick: onRetry,
|
|
181
|
+
children: "Retry"
|
|
182
|
+
})
|
|
183
|
+
]
|
|
184
|
+
});
|
|
185
|
+
}
|
|
110
186
|
//#endregion
|
|
111
|
-
export { Artifact, ArtifactAction, ArtifactActions, ArtifactClose, ArtifactContent, ArtifactDescription, ArtifactHeader, ArtifactTitle };
|
|
187
|
+
export { Artifact, ArtifactAction, ArtifactActions, ArtifactClose, ArtifactContent, ArtifactDescription, ArtifactHeader, ArtifactPreview, ArtifactTitle };
|
|
@@ -1,228 +1,2 @@
|
|
|
1
|
-
import { n as
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
import { FileUIPart, UIMessage } from "ai";
|
|
4
|
-
import { StreamdownProps } from "streamdown";
|
|
5
|
-
|
|
6
|
-
//#region src/components/ai-sdk/Message.d.ts
|
|
7
|
-
type MessageRole = UIMessage["role"];
|
|
8
|
-
interface MessageProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
9
|
-
/**
|
|
10
|
-
* The originating role of the message. Controls alignment and styling via
|
|
11
|
-
* the `data-from` attribute (e.g. user messages align end).
|
|
12
|
-
*/
|
|
13
|
-
from?: MessageRole;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* A chat message row. Aligns and styles itself based on {@link from}.
|
|
17
|
-
* Adapted from Vercel AI Elements and restyled with Sigvelo CSS tokens.
|
|
18
|
-
*
|
|
19
|
-
* Compose with {@link MessageContent} for the bubble, {@link MessageActions}
|
|
20
|
-
* for toolbar actions, and {@link MessageBranch} for multi-version responses.
|
|
21
|
-
*
|
|
22
|
-
* @example
|
|
23
|
-
* ```tsx
|
|
24
|
-
* <Message from="assistant">
|
|
25
|
-
* <MessageContent>Hello there!</MessageContent>
|
|
26
|
-
* <MessageActions>
|
|
27
|
-
* <MessageAction label="Copy" tooltip="Copy to clipboard">
|
|
28
|
-
* <CopyIcon />
|
|
29
|
-
* </MessageAction>
|
|
30
|
-
* </MessageActions>
|
|
31
|
-
* </Message>
|
|
32
|
-
* ```
|
|
33
|
-
*
|
|
34
|
-
* @see {@link https://elements.ai-sdk.dev/components/message | AI Elements Message}
|
|
35
|
-
*/
|
|
36
|
-
declare function Message({
|
|
37
|
-
className,
|
|
38
|
-
from,
|
|
39
|
-
children,
|
|
40
|
-
ref,
|
|
41
|
-
...props
|
|
42
|
-
}: MessageProps & {
|
|
43
|
-
ref?: React.Ref<HTMLDivElement>;
|
|
44
|
-
}): React.JSX.Element;
|
|
45
|
-
interface MessageContentProps extends React.HTMLAttributes<HTMLDivElement> {}
|
|
46
|
-
/**
|
|
47
|
-
* The visible bubble/body of a message. Styled differently based on the
|
|
48
|
-
* parent {@link Message}'s `from` attribute.
|
|
49
|
-
*/
|
|
50
|
-
declare function MessageContent({
|
|
51
|
-
className,
|
|
52
|
-
children,
|
|
53
|
-
ref,
|
|
54
|
-
...props
|
|
55
|
-
}: MessageContentProps & {
|
|
56
|
-
ref?: React.Ref<HTMLDivElement>;
|
|
57
|
-
}): React.JSX.Element;
|
|
58
|
-
type MessageResponseProps = StreamdownProps;
|
|
59
|
-
declare const MessageResponse: React.MemoExoticComponent<({
|
|
60
|
-
className,
|
|
61
|
-
components,
|
|
62
|
-
...props
|
|
63
|
-
}: MessageResponseProps) => React.JSX.Element>;
|
|
64
|
-
interface MessageAttachmentProps extends Omit<React.HTMLAttributes<HTMLElement>, "color" | "part"> {
|
|
65
|
-
/** The AI SDK `file` part, taken whole. */
|
|
66
|
-
part: FileUIPart;
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* A `file` part inside a message: images render inline (click to zoom),
|
|
70
|
-
* anything else becomes a download chip. Covers both directions — files the
|
|
71
|
-
* user attached and files the agent emitted.
|
|
72
|
-
*/
|
|
73
|
-
declare function MessageAttachment({
|
|
74
|
-
part,
|
|
75
|
-
className,
|
|
76
|
-
...props
|
|
77
|
-
}: MessageAttachmentProps): React.JSX.Element;
|
|
78
|
-
interface MessageActionsProps extends React.HTMLAttributes<HTMLDivElement> {}
|
|
79
|
-
/**
|
|
80
|
-
* Horizontal list of action buttons (copy, retry, thumbs-up, etc.) shown
|
|
81
|
-
* alongside or beneath a message.
|
|
82
|
-
*/
|
|
83
|
-
declare function MessageActions({
|
|
84
|
-
className,
|
|
85
|
-
children,
|
|
86
|
-
ref,
|
|
87
|
-
...props
|
|
88
|
-
}: MessageActionsProps & {
|
|
89
|
-
ref?: React.Ref<HTMLDivElement>;
|
|
90
|
-
}): React.JSX.Element;
|
|
91
|
-
interface MessageActionProps extends Omit<IconButtonProps, "children"> {
|
|
92
|
-
children?: React.ReactNode;
|
|
93
|
-
}
|
|
94
|
-
/**
|
|
95
|
-
* A single icon button inside {@link MessageActions}. Always has an accessible
|
|
96
|
-
* name; shows a tooltip on hover/focus when {@link tooltip} is set.
|
|
97
|
-
*/
|
|
98
|
-
declare function MessageAction({
|
|
99
|
-
className,
|
|
100
|
-
label,
|
|
101
|
-
tooltip,
|
|
102
|
-
variant,
|
|
103
|
-
color,
|
|
104
|
-
size,
|
|
105
|
-
children,
|
|
106
|
-
ref,
|
|
107
|
-
...props
|
|
108
|
-
}: MessageActionProps & {
|
|
109
|
-
ref?: React.Ref<HTMLButtonElement>;
|
|
110
|
-
}): React.JSX.Element;
|
|
111
|
-
interface MessageToolbarProps extends React.HTMLAttributes<HTMLDivElement> {}
|
|
112
|
-
/**
|
|
113
|
-
* Horizontal container that places children in a row with space between —
|
|
114
|
-
* typically a {@link MessageBranchSelector} on one side and
|
|
115
|
-
* {@link MessageActions} on the other.
|
|
116
|
-
*/
|
|
117
|
-
declare function MessageToolbar({
|
|
118
|
-
className,
|
|
119
|
-
children,
|
|
120
|
-
ref,
|
|
121
|
-
...props
|
|
122
|
-
}: MessageToolbarProps & {
|
|
123
|
-
ref?: React.Ref<HTMLDivElement>;
|
|
124
|
-
}): React.JSX.Element;
|
|
125
|
-
interface MessageBranchProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
126
|
-
/** Number of response branches rendered by MessageBranchContent. */
|
|
127
|
-
branchCount: number;
|
|
128
|
-
/** Zero-based index of the initially selected branch. */
|
|
129
|
-
defaultBranch?: number;
|
|
130
|
-
/** Controlled branch index. */
|
|
131
|
-
branch?: number;
|
|
132
|
-
/** Called when the selected branch changes. */
|
|
133
|
-
onBranchChange?: (branchIndex: number) => void;
|
|
134
|
-
}
|
|
135
|
-
/**
|
|
136
|
-
* Container for a message response with multiple versions. Tracks which
|
|
137
|
-
* branch is active and exposes navigation through {@link MessageBranchSelector},
|
|
138
|
-
* {@link MessageBranchPrevious}, {@link MessageBranchNext}, and {@link MessageBranchPage}.
|
|
139
|
-
*/
|
|
140
|
-
declare function MessageBranch({
|
|
141
|
-
className,
|
|
142
|
-
branchCount,
|
|
143
|
-
defaultBranch,
|
|
144
|
-
branch,
|
|
145
|
-
onBranchChange,
|
|
146
|
-
children,
|
|
147
|
-
ref,
|
|
148
|
-
...props
|
|
149
|
-
}: MessageBranchProps & {
|
|
150
|
-
ref?: React.Ref<HTMLDivElement>;
|
|
151
|
-
}): React.JSX.Element;
|
|
152
|
-
interface MessageBranchContentProps extends React.HTMLAttributes<HTMLDivElement> {}
|
|
153
|
-
/**
|
|
154
|
-
* Renders only the active branch's child. Expects siblings to represent
|
|
155
|
-
* alternative versions of the same response.
|
|
156
|
-
*/
|
|
157
|
-
declare function MessageBranchContent({
|
|
158
|
-
className,
|
|
159
|
-
children,
|
|
160
|
-
ref,
|
|
161
|
-
...props
|
|
162
|
-
}: MessageBranchContentProps & {
|
|
163
|
-
ref?: React.Ref<HTMLDivElement>;
|
|
164
|
-
}): React.JSX.Element;
|
|
165
|
-
interface MessageBranchSelectorProps extends React.HTMLAttributes<HTMLDivElement> {}
|
|
166
|
-
/**
|
|
167
|
-
* Inline group containing branch navigation controls (previous / page /
|
|
168
|
-
* next). Hidden automatically when there is only one branch.
|
|
169
|
-
*/
|
|
170
|
-
declare function MessageBranchSelector({
|
|
171
|
-
className,
|
|
172
|
-
children,
|
|
173
|
-
ref,
|
|
174
|
-
...props
|
|
175
|
-
}: MessageBranchSelectorProps & {
|
|
176
|
-
ref?: React.Ref<HTMLDivElement>;
|
|
177
|
-
}): React.JSX.Element | null;
|
|
178
|
-
interface MessageBranchPreviousProps extends Omit<IconButtonProps, "children" | "label"> {
|
|
179
|
-
label?: string;
|
|
180
|
-
children?: React.ReactNode;
|
|
181
|
-
}
|
|
182
|
-
/** Button that selects the previous branch. Disabled at the first branch. */
|
|
183
|
-
declare function MessageBranchPrevious({
|
|
184
|
-
className,
|
|
185
|
-
label,
|
|
186
|
-
variant,
|
|
187
|
-
color,
|
|
188
|
-
size,
|
|
189
|
-
children,
|
|
190
|
-
onClick,
|
|
191
|
-
ref,
|
|
192
|
-
...props
|
|
193
|
-
}: MessageBranchPreviousProps & {
|
|
194
|
-
ref?: React.Ref<HTMLButtonElement>;
|
|
195
|
-
}): React.JSX.Element;
|
|
196
|
-
interface MessageBranchNextProps extends Omit<IconButtonProps, "children" | "label"> {
|
|
197
|
-
label?: string;
|
|
198
|
-
children?: React.ReactNode;
|
|
199
|
-
}
|
|
200
|
-
/** Button that selects the next branch. Disabled at the last branch. */
|
|
201
|
-
declare function MessageBranchNext({
|
|
202
|
-
className,
|
|
203
|
-
label,
|
|
204
|
-
variant,
|
|
205
|
-
color,
|
|
206
|
-
size,
|
|
207
|
-
children,
|
|
208
|
-
onClick,
|
|
209
|
-
ref,
|
|
210
|
-
...props
|
|
211
|
-
}: MessageBranchNextProps & {
|
|
212
|
-
ref?: React.Ref<HTMLButtonElement>;
|
|
213
|
-
}): React.JSX.Element;
|
|
214
|
-
interface MessageBranchPageProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
215
|
-
/** Customize the displayed text. Defaults to `{index} / {count}`. */
|
|
216
|
-
format?: (currentIndex: number, total: number) => React.ReactNode;
|
|
217
|
-
}
|
|
218
|
-
/** Page indicator (e.g. "1 / 3") for the current branch selection. */
|
|
219
|
-
declare function MessageBranchPage({
|
|
220
|
-
className,
|
|
221
|
-
format,
|
|
222
|
-
ref,
|
|
223
|
-
...props
|
|
224
|
-
}: MessageBranchPageProps & {
|
|
225
|
-
ref?: React.Ref<HTMLSpanElement>;
|
|
226
|
-
}): React.JSX.Element;
|
|
227
|
-
//#endregion
|
|
1
|
+
import { C as MessageResponse, D as MessageToolbarProps, E as MessageToolbar, S as MessageProps, T as MessageRole, _ as MessageBranchProps, a as MessageActionsProps, b as MessageContent, c as MessageBranch, d as MessageBranchNext, f as MessageBranchNextProps, g as MessageBranchPreviousProps, h as MessageBranchPrevious, i as MessageActions, l as MessageBranchContent, m as MessageBranchPageProps, n as MessageAction, o as MessageAttachment, p as MessageBranchPage, r as MessageActionProps, s as MessageAttachmentProps, t as Message, u as MessageBranchContentProps, v as MessageBranchSelector, w as MessageResponseProps, x as MessageContentProps, y as MessageBranchSelectorProps } from "../../Message-DBsHHhcM.js";
|
|
228
2
|
export { Message, MessageAction, MessageActionProps, MessageActions, MessageActionsProps, MessageAttachment, MessageAttachmentProps, MessageBranch, MessageBranchContent, MessageBranchContentProps, MessageBranchNext, MessageBranchNextProps, MessageBranchPage, MessageBranchPageProps, MessageBranchPrevious, MessageBranchPreviousProps, MessageBranchProps, MessageBranchSelector, MessageBranchSelectorProps, MessageContent, MessageContentProps, MessageProps, MessageResponse, MessageResponseProps, MessageRole, MessageToolbar, MessageToolbarProps };
|
|
@@ -21,10 +21,20 @@ interface EmptyStateProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "ti
|
|
|
21
21
|
* `children` land under the description, for the action that makes the region
|
|
22
22
|
* non-empty.
|
|
23
23
|
*
|
|
24
|
+
* A region waiting on data is empty too, and this is the shape for it:
|
|
25
|
+
* `icon={<SpinnerIcon />}` with a description of what is being waited on, in a
|
|
26
|
+
* `role="status"` container. The description is not optional there —
|
|
27
|
+
* `prefers-reduced-motion` stops the spinner outright, so an icon on its own
|
|
28
|
+
* leaves a still circle and no way to tell loading from broken.
|
|
29
|
+
*
|
|
24
30
|
* @example
|
|
25
31
|
* ```tsx
|
|
26
32
|
* <EmptyState description="No runs yet." />
|
|
27
33
|
*
|
|
34
|
+
* <div role="status">
|
|
35
|
+
* <EmptyState icon={<SpinnerIcon />} description="Loading conversation" />
|
|
36
|
+
* </div>
|
|
37
|
+
*
|
|
28
38
|
* <EmptyState
|
|
29
39
|
* icon={<MessageIcon />}
|
|
30
40
|
* title="Start a conversation"
|
|
@@ -14,10 +14,20 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
14
14
|
* `children` land under the description, for the action that makes the region
|
|
15
15
|
* non-empty.
|
|
16
16
|
*
|
|
17
|
+
* A region waiting on data is empty too, and this is the shape for it:
|
|
18
|
+
* `icon={<SpinnerIcon />}` with a description of what is being waited on, in a
|
|
19
|
+
* `role="status"` container. The description is not optional there —
|
|
20
|
+
* `prefers-reduced-motion` stops the spinner outright, so an icon on its own
|
|
21
|
+
* leaves a still circle and no way to tell loading from broken.
|
|
22
|
+
*
|
|
17
23
|
* @example
|
|
18
24
|
* ```tsx
|
|
19
25
|
* <EmptyState description="No runs yet." />
|
|
20
26
|
*
|
|
27
|
+
* <div role="status">
|
|
28
|
+
* <EmptyState icon={<SpinnerIcon />} description="Loading conversation" />
|
|
29
|
+
* </div>
|
|
30
|
+
*
|
|
21
31
|
* <EmptyState
|
|
22
32
|
* icon={<MessageIcon />}
|
|
23
33
|
* title="Start a conversation"
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as ToggleGroupItemProps, r as ToggleGroupProps, t as ToggleGroup } from "../../ToggleGroup-
|
|
1
|
+
import { n as ToggleGroupItemProps, r as ToggleGroupProps, t as ToggleGroup } from "../../ToggleGroup-BrQZOQn_.js";
|
|
2
2
|
export { ToggleGroup, ToggleGroupItemProps, ToggleGroupProps };
|
|
@@ -3,8 +3,8 @@ import { n as mergeRefs } from "../../merge-refs-DF_7w2x_.js";
|
|
|
3
3
|
import { toggleVariants } from "./Toggle.js";
|
|
4
4
|
import * as React from "react";
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
-
import { Toggle } from "@base-ui/react/toggle";
|
|
7
6
|
import { ToggleGroup as ToggleGroup$1 } from "@base-ui/react/toggle-group";
|
|
7
|
+
import { Toggle } from "@base-ui/react/toggle";
|
|
8
8
|
//#region src/components/foundations/ToggleGroup.tsx
|
|
9
9
|
/**
|
|
10
10
|
* Tracks the pressed item's box so the segmented thumb can slide to it instead
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as cx } from "../../class-names-BiMDVpUo.js";
|
|
2
2
|
import { Badge } from "../foundations/Badge.js";
|
|
3
|
-
import { Switch } from "../foundations/Switch.js";
|
|
4
3
|
import { ToggleGroup } from "../foundations/ToggleGroup.js";
|
|
4
|
+
import { Switch } from "../foundations/Switch.js";
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
//#region src/components/general-purpose/PricingBillingToggle.tsx
|
|
7
7
|
/** Controlled billing-period selector composed from the shared Switch or ToggleGroup. */
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { t as cx } from "../../class-names-BiMDVpUo.js";
|
|
2
2
|
import { Separator } from "../foundations/Separator.js";
|
|
3
3
|
import { Card } from "../foundations/Card.js";
|
|
4
|
-
import { Progress } from "../foundations/Progress.js";
|
|
5
4
|
import { Slider } from "../foundations/Slider.js";
|
|
5
|
+
import { Progress } from "../foundations/Progress.js";
|
|
6
6
|
import { formatPricingUsage, getUsagePrice } from "./Pricing.js";
|
|
7
7
|
import * as React from "react";
|
|
8
8
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { t as cx } from "../../class-names-BiMDVpUo.js";
|
|
2
2
|
import { r as ArrowLeftIcon } from "../../icons-B4mGvCvc.js";
|
|
3
3
|
import { TransitionSurface } from "../foundations/TransitionSurface.js";
|
|
4
|
+
import { SubagentRunActions, SubagentRunMilestone, SubagentRunMilestones, SubagentRunProgress } from "../agents-sdk/SubagentRunDetails.js";
|
|
5
|
+
import { SubagentRunIndicator, getSubagentRunName } from "../agents-sdk/SubagentRunIndicator.js";
|
|
6
|
+
import { t as ThinkChat } from "../../ThinkChat-BES_3Mb-.js";
|
|
4
7
|
import { AppTopBar } from "../general-purpose/AppTopBar.js";
|
|
5
8
|
import { NaniteMark } from "./NaniteScene.js";
|
|
6
|
-
import { SubagentRunIndicator, getSubagentRunName } from "../agents-sdk/SubagentRunIndicator.js";
|
|
7
|
-
import { SubagentRunActions, SubagentRunMilestone, SubagentRunMilestones, SubagentRunProgress } from "../agents-sdk/SubagentRunDetails.js";
|
|
8
|
-
import { t as ThinkChat } from "../../ThinkChat-DQh59CeC.js";
|
|
9
9
|
import * as React from "react";
|
|
10
10
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
11
|
import { useAgentChat } from "@cloudflare/think/react";
|
|
@@ -59,14 +59,14 @@
|
|
|
59
59
|
|
|
60
60
|
/* Takes the whole transcript region, the way the scroller it stands in for
|
|
61
61
|
does, so nothing moves when the rows arrive. The composer floats over its
|
|
62
|
-
lower edge, so the
|
|
62
|
+
lower edge, so the state sits slightly high rather than under it. The
|
|
63
|
+
.empty-state inside brings its own type and colour. */
|
|
63
64
|
.agent-chat__transcript-loading {
|
|
64
65
|
display: grid;
|
|
65
66
|
block-size: 100%;
|
|
66
67
|
min-block-size: 0;
|
|
67
68
|
place-items: center;
|
|
68
69
|
padding-block-end: var(--agent-chat-composer-size, 5rem);
|
|
69
|
-
color: var(--sigvelo-color-text-muted);
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
.agent-chat[data-composer-hidden] .agent-chat__transcript-loading {
|
package/dist/styles/artifact.css
CHANGED
|
@@ -61,8 +61,73 @@
|
|
|
61
61
|
overflow-wrap: anywhere;
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
+
.artifact-preview {
|
|
65
|
+
container-type: inline-size;
|
|
66
|
+
min-inline-size: 0;
|
|
67
|
+
border: var(--sigvelo-border-style) var(--sigvelo-border-width)
|
|
68
|
+
var(--sigvelo-color-neutral-border-subtle);
|
|
69
|
+
background: var(--sigvelo-color-surface);
|
|
70
|
+
box-shadow: none;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.artifact-preview__header {
|
|
74
|
+
min-inline-size: 0;
|
|
75
|
+
justify-content: flex-end;
|
|
76
|
+
padding-block: var(--sigvelo-spacing-1);
|
|
77
|
+
padding-inline: var(--sigvelo-spacing-2);
|
|
78
|
+
border-block-end: var(--sigvelo-border-style) var(--sigvelo-border-width)
|
|
79
|
+
var(--sigvelo-color-neutral-border-subtle);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.artifact-preview__frame-shell {
|
|
83
|
+
position: relative;
|
|
84
|
+
min-inline-size: 0;
|
|
85
|
+
padding: 0;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.artifact-preview__runtime {
|
|
89
|
+
min-inline-size: 0;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.artifact-preview__runtime > iframe {
|
|
93
|
+
display: block;
|
|
94
|
+
inline-size: 100%;
|
|
95
|
+
min-block-size: 12rem;
|
|
96
|
+
border: 0;
|
|
97
|
+
background: transparent;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.artifact-preview__status {
|
|
101
|
+
display: flex;
|
|
102
|
+
min-block-size: 12rem;
|
|
103
|
+
align-items: center;
|
|
104
|
+
justify-content: center;
|
|
105
|
+
flex-wrap: wrap;
|
|
106
|
+
gap: var(--sigvelo-spacing-2);
|
|
107
|
+
padding: var(--sigvelo-spacing-4);
|
|
108
|
+
color: var(--sigvelo-color-text-muted);
|
|
109
|
+
text-align: center;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.artifact-preview__status--overlay {
|
|
113
|
+
position: absolute;
|
|
114
|
+
inset: 0;
|
|
115
|
+
color: var(--sigvelo-color-text);
|
|
116
|
+
background: color-mix(in srgb, var(--sigvelo-color-surface) 92%, transparent);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
@media (any-pointer: coarse) {
|
|
120
|
+
.artifact-preview .button {
|
|
121
|
+
min-block-size: var(--sigvelo-control-height-xl);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
64
125
|
@media (forced-colors: active) {
|
|
65
126
|
.artifact {
|
|
66
127
|
border: var(--sigvelo-border-style) var(--sigvelo-border-width) CanvasText;
|
|
67
128
|
}
|
|
129
|
+
|
|
130
|
+
.artifact-preview__header {
|
|
131
|
+
border-color: CanvasText;
|
|
132
|
+
}
|
|
68
133
|
}
|
package/dist/styles/base.css
CHANGED
|
@@ -135,6 +135,10 @@ body {
|
|
|
135
135
|
}
|
|
136
136
|
}
|
|
137
137
|
|
|
138
|
+
/* A spinner that cannot spin is a circle. Plenty of people — most of them on
|
|
139
|
+
phones — browse with this on, so nothing may rely on the rotation to say
|
|
140
|
+
"still working": pair the icon with text that reads the same either way.
|
|
141
|
+
`.empty-state` is that pairing for a whole region. */
|
|
138
142
|
@media (prefers-reduced-motion: reduce) {
|
|
139
143
|
.sigvelo-icon--spinner {
|
|
140
144
|
animation: none;
|
|
@@ -15,6 +15,18 @@
|
|
|
15
15
|
overflow: hidden;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
+
/* `fill`: the view is the surface, not a card on it. Nothing sits beside it to
|
|
19
|
+
be separated from, so the aspect box, the hairline and the corners go and the
|
|
20
|
+
frame takes whatever its container gives it. The picture still letterboxes
|
|
21
|
+
inside — `object-fit: contain` further down is what keeps the remote page's
|
|
22
|
+
own proportions honest at any shape. */
|
|
23
|
+
.browser-live-view[data-fill] {
|
|
24
|
+
block-size: 100%;
|
|
25
|
+
aspect-ratio: auto;
|
|
26
|
+
border: 0;
|
|
27
|
+
border-radius: 0;
|
|
28
|
+
}
|
|
29
|
+
|
|
18
30
|
.browser-live-view__frame {
|
|
19
31
|
inline-size: 100%;
|
|
20
32
|
block-size: 100%;
|
|
@@ -60,6 +72,20 @@
|
|
|
60
72
|
max-inline-size: 80%;
|
|
61
73
|
}
|
|
62
74
|
|
|
75
|
+
/* Host-drawn media. Styled by element rather than by class so a host that
|
|
76
|
+
renders its own picture into the frame inherits the shape without opting in:
|
|
77
|
+
`contain` keeps the remote viewport's proportions whatever the box is, and
|
|
78
|
+
the letterbox inherits the frame's fill, so a host that recolors the frame
|
|
79
|
+
recolors the bars with it. */
|
|
80
|
+
.browser-live-view video,
|
|
81
|
+
.browser-live-view canvas {
|
|
82
|
+
display: block;
|
|
83
|
+
inline-size: 100%;
|
|
84
|
+
block-size: 100%;
|
|
85
|
+
object-fit: contain;
|
|
86
|
+
background-color: inherit;
|
|
87
|
+
}
|
|
88
|
+
|
|
63
89
|
/* An expired view showing a screenshot fallback keeps the image flush */
|
|
64
90
|
.browser-live-view[data-expired] > img {
|
|
65
91
|
inline-size: 100%;
|
|
@@ -83,6 +109,25 @@
|
|
|
83
109
|
z-index: 1;
|
|
84
110
|
}
|
|
85
111
|
|
|
112
|
+
/* A fault that leaves the picture running: a caption on the frame, opposite
|
|
113
|
+
the expand control, rather than an overlay that would hide what still
|
|
114
|
+
arrives. */
|
|
115
|
+
.browser-live-view__notice {
|
|
116
|
+
position: absolute;
|
|
117
|
+
inset-block-end: var(--sigvelo-spacing-2);
|
|
118
|
+
inset-inline-start: var(--sigvelo-spacing-2);
|
|
119
|
+
z-index: 1;
|
|
120
|
+
max-inline-size: calc(100% - var(--sigvelo-spacing-12));
|
|
121
|
+
margin: 0;
|
|
122
|
+
padding: var(--sigvelo-spacing-1) var(--sigvelo-spacing-2);
|
|
123
|
+
border-radius: var(--sigvelo-radius-md);
|
|
124
|
+
background-color: var(--sigvelo-color-surface-raised);
|
|
125
|
+
box-shadow: var(--sigvelo-elevation-raised);
|
|
126
|
+
color: var(--sigvelo-color-text-muted);
|
|
127
|
+
font-size: var(--sigvelo-text-xs);
|
|
128
|
+
pointer-events: none;
|
|
129
|
+
}
|
|
130
|
+
|
|
86
131
|
/* Expand affordance, video-player style: quiet until the box is hovered or
|
|
87
132
|
the button is focused */
|
|
88
133
|
.browser-live-view__expand {
|
|
@@ -158,6 +158,12 @@ body.is-resizing-side-panel .think-full-app__view-scope {
|
|
|
158
158
|
);
|
|
159
159
|
}
|
|
160
160
|
|
|
161
|
+
/* The panel stands in for itself while its first read is in flight, so the
|
|
162
|
+
waiting state sits where the content will rather than in the top corner. */
|
|
163
|
+
.think-full-app__workbench--loading {
|
|
164
|
+
justify-content: center;
|
|
165
|
+
}
|
|
166
|
+
|
|
161
167
|
.think-full-app__workbench.workspace-explorer {
|
|
162
168
|
border: 0;
|
|
163
169
|
border-radius: 0;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mcp-b/react-components",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.39.0",
|
|
4
4
|
"description": "MCP-B React components built on Base UI and shared design tokens, including Cloudflare Think chat primitives.",
|
|
5
5
|
"homepage": "https://design-system.sigvelo.com",
|
|
6
6
|
"bugs": {
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"streamdown": "^2.5.0",
|
|
54
54
|
"unist-util-visit": "^5.1.0",
|
|
55
55
|
"yet-another-react-lightbox": "^3.32.1",
|
|
56
|
-
"@mcp-b/design-tokens": "0.
|
|
56
|
+
"@mcp-b/design-tokens": "0.39.0"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
59
|
"@ai-sdk/react": "^3.0.230",
|