@mcp-b/react-components 0.4.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.
- package/dist/{CodeBlock-C2Xjxu9M.js → CodeBlock-D-a84xBL.js} +1 -1
- package/dist/{FileTree-D0c9Yj9U.js → FileTree-D8rtTLgK.js} +1 -1
- package/dist/components/Activity.js +1 -1
- package/dist/components/AgentChat.d.ts +0 -7
- package/dist/components/AgentChat.js +99 -67
- package/dist/components/AgentConnection.js +2 -2
- package/dist/components/Artifact.js +1 -1
- package/dist/components/BrowserLiveView.js +1 -1
- package/dist/components/BrowserReplay.js +1 -1
- package/dist/components/ChainOfThought.d.ts +1 -1
- package/dist/components/ChainOfThought.js +1 -1
- package/dist/components/CodeBlock.js +1 -1
- package/dist/components/Commit.js +2 -2
- package/dist/components/ContextMenu.js +1 -1
- package/dist/components/Conversation.js +1 -1
- package/dist/components/Dialog.js +1 -1
- package/dist/components/EnvironmentVariables.js +1 -1
- package/dist/components/FileTree.js +1 -1
- package/dist/components/Menubar.js +1 -1
- package/dist/components/Message.js +4 -4
- package/dist/components/ModelSelector.js +1 -1
- package/dist/components/NavigationMenu.js +1 -1
- package/dist/components/PricingPage.js +1 -1
- package/dist/components/PromptInput.js +7 -7
- package/dist/components/Queue.js +1 -1
- package/dist/components/Reasoning.js +9 -17
- package/dist/components/Select.js +1 -1
- package/dist/components/Sources.js +1 -1
- package/dist/components/Stepper.js +1 -1
- package/dist/components/Task.js +1 -1
- package/dist/components/Terminal.js +2 -2
- package/dist/components/TestResults.js +1 -1
- package/dist/components/ThinkChat.d.ts +4 -6
- package/dist/components/ThinkChat.js +2 -2
- package/dist/components/WebPreview.js +1 -1
- package/dist/components/WorkspaceExplorer.js +3 -3
- package/dist/components/icons.d.ts +2 -2
- package/dist/components/icons.js +2 -2
- package/dist/{copy-button-Dd6DEhOm.js → copy-button-BmJEAKuP.js} +1 -1
- package/dist/{icons-DQC4Zw5R.js → icons-CZRH4FVH.js} +1 -15
- package/dist/{icons-ctdVxng0.d.ts → icons-CmO7-pNY.d.ts} +1 -2
- package/dist/styles/agent-chat.css +24 -10
- package/dist/styles/conversation.css +3 -3
- package/dist/styles/index.css +0 -2
- package/dist/styles/message.css +2 -2
- package/dist/styles/prompt-input.css +17 -6
- package/dist/styles/reasoning.css +0 -1
- package/package.json +2 -2
- package/dist/components/Suggestion.d.ts +0 -43
- package/dist/components/Suggestion.js +0 -39
- package/dist/components/Tool.d.ts +0 -123
- package/dist/components/Tool.js +0 -209
- package/dist/styles/suggestions.css +0 -21
- package/dist/styles/tool.css +0 -203
|
@@ -35,8 +35,6 @@ interface ThinkChatMessagesProps extends ThinkChatActivityRendererOptions {
|
|
|
35
35
|
placeholder?: string;
|
|
36
36
|
/** Rendered after each message (e.g. per-message actions). */
|
|
37
37
|
renderMessageAfter?: AgentChatProps["renderMessageAfter"];
|
|
38
|
-
/** Prompt suggestions shown above the composer; clicking one sends it. */
|
|
39
|
-
suggestions?: AgentChatProps["suggestions"];
|
|
40
38
|
/**
|
|
41
39
|
* Overrides the built-in connection notice (derived from the hook's
|
|
42
40
|
* `isRecovering`/`connectionError`) shown between transcript and composer.
|
|
@@ -71,9 +69,9 @@ type ThinkChatToolRenderers = Record<string, ThinkChatToolRenderer>;
|
|
|
71
69
|
interface ThinkChatActivityRendererOptions {
|
|
72
70
|
/**
|
|
73
71
|
* Tool names to keep out of activity folding entirely — the run splits
|
|
74
|
-
* around them and they fall through to your own renderPart /
|
|
75
|
-
*
|
|
76
|
-
* `toolRenderers` instead.
|
|
72
|
+
* around them and they fall through to your own renderPart / AgentChat's
|
|
73
|
+
* generic standalone activity row. For tools that should stay in the log
|
|
74
|
+
* with custom UI, use `toolRenderers` instead.
|
|
77
75
|
*/
|
|
78
76
|
excludeTools?: readonly string[];
|
|
79
77
|
/** Per-tool label/panel overrides inside the activity log, keyed by tool name. */
|
|
@@ -157,7 +155,7 @@ declare function ThinkChatActivity({
|
|
|
157
155
|
* parts (reasoning + tool calls) into one collapsed Activity box. Everything
|
|
158
156
|
* is derived from the UIMessage stream: part order, tool states, reasoning
|
|
159
157
|
* state. Excluded tools split the run and return undefined so your own
|
|
160
|
-
* renderPart (or
|
|
158
|
+
* renderPart (or AgentChat's generic activity row) takes over for them.
|
|
161
159
|
*/
|
|
162
160
|
declare function createThinkChatActivityRenderer({
|
|
163
161
|
excludeTools,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Activity, ActivityContent, ActivityItem, ActivityItemGroup, ActivityOutput, ActivityPanel, ActivityText, ActivityTrigger } from "./Activity.js";
|
|
2
2
|
import { Tab, TabPanel, Tabs, TabsList } from "./Tabs.js";
|
|
3
|
-
import { t as CodeBlock } from "../CodeBlock-C2Xjxu9M.js";
|
|
4
3
|
import { AgentChat } from "./AgentChat.js";
|
|
4
|
+
import { t as CodeBlock } from "../CodeBlock-D-a84xBL.js";
|
|
5
5
|
import { BrowserLiveView } from "./BrowserLiveView.js";
|
|
6
6
|
import { BrowserReplay } from "./BrowserReplay.js";
|
|
7
7
|
import { WorkspaceExplorer, inferWorkspaceLanguage, useWorkspace } from "./WorkspaceExplorer.js";
|
|
@@ -720,7 +720,7 @@ function ThinkChatActivityGroup({ message, parts, isTrailing, toolRenderers }) {
|
|
|
720
720
|
* parts (reasoning + tool calls) into one collapsed Activity box. Everything
|
|
721
721
|
* is derived from the UIMessage stream: part order, tool states, reasoning
|
|
722
722
|
* state. Excluded tools split the run and return undefined so your own
|
|
723
|
-
* renderPart (or
|
|
723
|
+
* renderPart (or AgentChat's generic activity row) takes over for them.
|
|
724
724
|
*/
|
|
725
725
|
function createThinkChatActivityRenderer({ excludeTools, toolRenderers } = {}) {
|
|
726
726
|
const excluded = excludeTools?.length ? new Set(excludeTools) : void 0;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as cx } from "../class-names-9UtZwb0J.js";
|
|
2
|
-
import {
|
|
2
|
+
import { D as RefreshIcon, n as ArrowLeftIcon, o as ChevronDownIcon, r as ArrowRightIcon } from "../icons-CZRH4FVH.js";
|
|
3
3
|
import { Button } from "./Button.js";
|
|
4
4
|
import { Tooltip, TooltipPopup, TooltipPortal, TooltipPositioner, TooltipTrigger } from "./Tooltip.js";
|
|
5
5
|
import { Badge } from "./Badge.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { t as cx } from "../class-names-9UtZwb0J.js";
|
|
2
|
-
import {
|
|
2
|
+
import { D as RefreshIcon, O as SearchIcon, m as FileIcon, n as ArrowLeftIcon } from "../icons-CZRH4FVH.js";
|
|
3
3
|
import { Button } from "./Button.js";
|
|
4
|
-
import { a as CodeBlockCopyButton, i as CodeBlockContent, n as CodeBlockActions, o as CodeBlockFilename, p as CodeBlockTitle, r as CodeBlockContainer, s as CodeBlockHeader, t as CodeBlock } from "../CodeBlock-
|
|
5
|
-
import { i as FileTreeFolder, r as FileTreeFile, t as FileTree } from "../FileTree-
|
|
4
|
+
import { a as CodeBlockCopyButton, i as CodeBlockContent, n as CodeBlockActions, o as CodeBlockFilename, p as CodeBlockTitle, r as CodeBlockContainer, s as CodeBlockHeader, t as CodeBlock } from "../CodeBlock-D-a84xBL.js";
|
|
5
|
+
import { i as FileTreeFolder, r as FileTreeFile, t as FileTree } from "../FileTree-D8rtTLgK.js";
|
|
6
6
|
import * as React from "react";
|
|
7
7
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
8
8
|
//#region src/components/WorkspaceExplorer.tsx
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
export { ArrowDownIcon, ArrowLeftIcon, ArrowRightIcon, ArrowUpIcon,
|
|
1
|
+
import { A as SpinnerIcon, C as MonitorIcon, D as PlusIcon, E as PlayIcon, F as XIcon, M as TerminalIcon, N as WarningIcon, O as RefreshIcon, P as WrenchIcon, S as MinusIcon, T as PencilIcon, _ as IconProps, a as CheckIcon, b as LinkIcon, c as ChevronRightIcon, d as DownloadIcon, f as EyeIcon, g as FolderOpenIcon, h as FolderIcon, i as ArrowUpIcon, j as SquareIcon, k as SearchIcon, l as CopyIcon, m as FileIcon, n as ArrowLeftIcon, o as ChevronDownIcon, p as EyeOffIcon, r as ArrowRightIcon, s as ChevronLeftIcon, t as ArrowDownIcon, u as DotIcon, v as ImageIcon, w as PauseIcon, x as MaximizeIcon, y as InfoIcon } from "../icons-CmO7-pNY.js";
|
|
2
|
+
export { ArrowDownIcon, ArrowLeftIcon, ArrowRightIcon, ArrowUpIcon, CheckIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, CopyIcon, DotIcon, DownloadIcon, EyeIcon, EyeOffIcon, FileIcon, FolderIcon, FolderOpenIcon, IconProps, ImageIcon, InfoIcon, LinkIcon, MaximizeIcon, MinusIcon, MonitorIcon, PauseIcon, PencilIcon, PlayIcon, PlusIcon, RefreshIcon, SearchIcon, SpinnerIcon, SquareIcon, TerminalIcon, WarningIcon, WrenchIcon, XIcon };
|
package/dist/components/icons.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
export { ArrowDownIcon, ArrowLeftIcon, ArrowRightIcon, ArrowUpIcon,
|
|
1
|
+
import { A as SquareIcon, C as PauseIcon, D as RefreshIcon, E as PlusIcon, M as WarningIcon, N as WrenchIcon, O as SearchIcon, P as XIcon, S as MonitorIcon, T as PlayIcon, _ as ImageIcon, a as CheckIcon, b as MaximizeIcon, c as ChevronRightIcon, d as DownloadIcon, f as EyeIcon, g as FolderOpenIcon, h as FolderIcon, i as ArrowUpIcon, j as TerminalIcon, k as SpinnerIcon, l as CopyIcon, m as FileIcon, n as ArrowLeftIcon, o as ChevronDownIcon, p as EyeOffIcon, r as ArrowRightIcon, s as ChevronLeftIcon, t as ArrowDownIcon, u as DotIcon, v as InfoIcon, w as PencilIcon, x as MinusIcon, y as LinkIcon } from "../icons-CZRH4FVH.js";
|
|
2
|
+
export { ArrowDownIcon, ArrowLeftIcon, ArrowRightIcon, ArrowUpIcon, CheckIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, CopyIcon, DotIcon, DownloadIcon, EyeIcon, EyeOffIcon, FileIcon, FolderIcon, FolderOpenIcon, ImageIcon, InfoIcon, LinkIcon, MaximizeIcon, MinusIcon, MonitorIcon, PauseIcon, PencilIcon, PlayIcon, PlusIcon, RefreshIcon, SearchIcon, SpinnerIcon, SquareIcon, TerminalIcon, WarningIcon, WrenchIcon, XIcon };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as CheckIcon, l as CopyIcon } from "./icons-CZRH4FVH.js";
|
|
2
2
|
import { Button } from "./components/Button.js";
|
|
3
3
|
import { Tooltip, TooltipPopup, TooltipPortal, TooltipPositioner, TooltipTrigger } from "./components/Tooltip.js";
|
|
4
4
|
import * as React from "react";
|
|
@@ -29,20 +29,6 @@ const ChevronLeftIcon = (props) => /* @__PURE__ */ jsx(Icon, {
|
|
|
29
29
|
...props,
|
|
30
30
|
children: /* @__PURE__ */ jsx("path", { d: "M10 3.5L5.5 8L10 12.5" })
|
|
31
31
|
});
|
|
32
|
-
const BrainIcon = (props) => /* @__PURE__ */ jsxs(Icon, {
|
|
33
|
-
viewBox: "0 0 24 24",
|
|
34
|
-
...props,
|
|
35
|
-
children: [
|
|
36
|
-
/* @__PURE__ */ jsx("path", { d: "M12 18V5" }),
|
|
37
|
-
/* @__PURE__ */ jsx("path", { d: "M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4" }),
|
|
38
|
-
/* @__PURE__ */ jsx("path", { d: "M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5" }),
|
|
39
|
-
/* @__PURE__ */ jsx("path", { d: "M17.997 5.125a4 4 0 0 1 2.526 5.77" }),
|
|
40
|
-
/* @__PURE__ */ jsx("path", { d: "M18 18a4 4 0 0 0 2-7.464" }),
|
|
41
|
-
/* @__PURE__ */ jsx("path", { d: "M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517" }),
|
|
42
|
-
/* @__PURE__ */ jsx("path", { d: "M6 18a4 4 0 0 1-2-7.464" }),
|
|
43
|
-
/* @__PURE__ */ jsx("path", { d: "M6.003 5.125a4 4 0 0 0-2.526 5.77" })
|
|
44
|
-
]
|
|
45
|
-
});
|
|
46
32
|
const CheckIcon = (props) => /* @__PURE__ */ jsx(Icon, {
|
|
47
33
|
...props,
|
|
48
34
|
children: /* @__PURE__ */ jsx("path", { d: "M3 8.5L6.5 12L13 4.5" })
|
|
@@ -262,4 +248,4 @@ const MaximizeIcon = (props) => /* @__PURE__ */ jsxs(Icon, {
|
|
|
262
248
|
]
|
|
263
249
|
});
|
|
264
250
|
//#endregion
|
|
265
|
-
export {
|
|
251
|
+
export { SquareIcon as A, PauseIcon as C, RefreshIcon as D, PlusIcon as E, WarningIcon as M, WrenchIcon as N, SearchIcon as O, XIcon as P, MonitorIcon as S, PlayIcon as T, ImageIcon as _, CheckIcon as a, MaximizeIcon as b, ChevronRightIcon as c, DownloadIcon as d, EyeIcon as f, FolderOpenIcon as g, FolderIcon as h, ArrowUpIcon as i, TerminalIcon as j, SpinnerIcon as k, CopyIcon as l, FileIcon as m, ArrowLeftIcon as n, ChevronDownIcon as o, EyeOffIcon as p, ArrowRightIcon as r, ChevronLeftIcon as s, ArrowDownIcon as t, DotIcon as u, InfoIcon as v, PencilIcon as w, MinusIcon as x, LinkIcon as y };
|
|
@@ -13,7 +13,6 @@ type IconProps = Omit<React.SVGAttributes<SVGSVGElement>, "width" | "height"> &
|
|
|
13
13
|
declare const ChevronRightIcon: (props: IconProps) => React.JSX.Element;
|
|
14
14
|
declare const ChevronDownIcon: (props: IconProps) => React.JSX.Element;
|
|
15
15
|
declare const ChevronLeftIcon: (props: IconProps) => React.JSX.Element;
|
|
16
|
-
declare const BrainIcon: (props: IconProps) => React.JSX.Element;
|
|
17
16
|
declare const CheckIcon: (props: IconProps) => React.JSX.Element;
|
|
18
17
|
declare const XIcon: (props: IconProps) => React.JSX.Element;
|
|
19
18
|
declare const PencilIcon: (props: IconProps) => React.JSX.Element;
|
|
@@ -46,4 +45,4 @@ declare const ImageIcon: (props: IconProps) => React.JSX.Element;
|
|
|
46
45
|
declare const MonitorIcon: (props: IconProps) => React.JSX.Element;
|
|
47
46
|
declare const MaximizeIcon: (props: IconProps) => React.JSX.Element;
|
|
48
47
|
//#endregion
|
|
49
|
-
export {
|
|
48
|
+
export { SpinnerIcon as A, MonitorIcon as C, PlusIcon as D, PlayIcon as E, XIcon as F, TerminalIcon as M, WarningIcon as N, RefreshIcon as O, WrenchIcon as P, MinusIcon as S, PencilIcon as T, IconProps as _, CheckIcon as a, LinkIcon as b, ChevronRightIcon as c, DownloadIcon as d, EyeIcon as f, FolderOpenIcon as g, FolderIcon as h, ArrowUpIcon as i, SquareIcon as j, SearchIcon as k, CopyIcon as l, FileIcon as m, ArrowLeftIcon as n, ChevronDownIcon as o, EyeOffIcon as p, ArrowRightIcon as r, ChevronLeftIcon as s, ArrowDownIcon as t, DotIcon as u, ImageIcon as v, PauseIcon as w, MaximizeIcon as x, InfoIcon as y };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
.agent-chat {
|
|
2
|
-
|
|
3
|
-
grid-template-rows: minmax(0, 1fr) auto;
|
|
2
|
+
position: relative;
|
|
4
3
|
width: 100%;
|
|
5
4
|
height: 100%;
|
|
6
5
|
min-height: 0;
|
|
@@ -10,14 +9,33 @@
|
|
|
10
9
|
}
|
|
11
10
|
|
|
12
11
|
.agent-chat__conversation {
|
|
12
|
+
height: 100%;
|
|
13
13
|
min-height: 0;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
+
/* Room for the last message to scroll clear of the floating composer.
|
|
17
|
+
--agent-chat-composer-size is set from a ResizeObserver in AgentChat. */
|
|
18
|
+
.agent-chat .conversation__content {
|
|
19
|
+
padding-block-end: calc(var(--agent-chat-composer-size, 5rem) + 0.5rem);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.agent-chat .conversation__scroll-button {
|
|
23
|
+
inset-block-end: calc(var(--agent-chat-composer-size, 5rem) + 0.5rem);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/* Floating over the transcript: solid behind the controls, fading out
|
|
27
|
+
through the top padding so content slides under instead of hitting a bar. */
|
|
16
28
|
.agent-chat__composer {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
29
|
+
position: absolute;
|
|
30
|
+
inset-inline: 0;
|
|
31
|
+
inset-block-end: 0;
|
|
32
|
+
padding: 0.625rem;
|
|
33
|
+
padding-block-start: 1.5rem;
|
|
34
|
+
background: linear-gradient(
|
|
35
|
+
to top,
|
|
36
|
+
var(--sigvelo-color-surface) calc(100% - 1.5rem),
|
|
37
|
+
transparent
|
|
38
|
+
);
|
|
21
39
|
}
|
|
22
40
|
|
|
23
41
|
/* Transient status pill between transcript and composer (recovery, errors). */
|
|
@@ -34,7 +52,3 @@
|
|
|
34
52
|
.agent-chat__notice [data-tone="danger"] {
|
|
35
53
|
color: var(--sigvelo-color-danger-text);
|
|
36
54
|
}
|
|
37
|
-
|
|
38
|
-
.agent-chat__suggestions {
|
|
39
|
-
margin-block-end: 0.5rem;
|
|
40
|
-
}
|
package/dist/styles/index.css
CHANGED
|
@@ -46,7 +46,6 @@
|
|
|
46
46
|
@import "./separator.css" layer(components);
|
|
47
47
|
@import "./slider.css" layer(components);
|
|
48
48
|
@import "./stepper.css" layer(components);
|
|
49
|
-
@import "./suggestions.css" layer(components);
|
|
50
49
|
@import "./switch.css" layer(components);
|
|
51
50
|
@import "./tabs.css" layer(components);
|
|
52
51
|
@import "./toast.css" layer(components);
|
|
@@ -75,7 +74,6 @@
|
|
|
75
74
|
@import "./task.css" layer(components);
|
|
76
75
|
@import "./terminal.css" layer(components);
|
|
77
76
|
@import "./test-results.css" layer(components);
|
|
78
|
-
@import "./tool.css" layer(components);
|
|
79
77
|
@import "./web-preview.css" layer(components);
|
|
80
78
|
@import "./workspace-explorer.css" layer(components);
|
|
81
79
|
|
package/dist/styles/message.css
CHANGED
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
.message__content {
|
|
21
21
|
display: inline-block;
|
|
22
22
|
max-width: min(42rem, 85%);
|
|
23
|
-
padding-block: 0.
|
|
24
|
-
padding-inline: 0.
|
|
23
|
+
padding-block: 0.5rem;
|
|
24
|
+
padding-inline: 0.75rem;
|
|
25
25
|
border-radius: var(--sigvelo-radius-lg);
|
|
26
26
|
font-size: var(--sigvelo-text-sm);
|
|
27
27
|
line-height: 1.55;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
.prompt-input {
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
|
-
gap: 0.
|
|
5
|
-
padding-block: 0.
|
|
6
|
-
padding-inline:
|
|
4
|
+
gap: 0.375rem;
|
|
5
|
+
padding-block: 0.625rem;
|
|
6
|
+
padding-inline: 0.75rem;
|
|
7
7
|
background-color: var(--sigvelo-color-surface);
|
|
8
8
|
/* Fields keep their border; hairline + soft shadow for the floating-composer look */
|
|
9
9
|
border: var(--sigvelo-border-style) var(--sigvelo-border-width)
|
|
@@ -134,7 +134,7 @@
|
|
|
134
134
|
background-color: transparent;
|
|
135
135
|
color: var(--sigvelo-color-text);
|
|
136
136
|
font-family: inherit;
|
|
137
|
-
font-size: 0.
|
|
137
|
+
font-size: 0.875rem;
|
|
138
138
|
line-height: 1.5;
|
|
139
139
|
resize: none;
|
|
140
140
|
overflow-y: hidden;
|
|
@@ -172,7 +172,7 @@
|
|
|
172
172
|
align-items: center;
|
|
173
173
|
gap: 0.25rem;
|
|
174
174
|
flex-wrap: wrap;
|
|
175
|
-
min-height:
|
|
175
|
+
min-height: 1.75rem;
|
|
176
176
|
}
|
|
177
177
|
|
|
178
178
|
.prompt-input__button {
|
|
@@ -354,7 +354,11 @@
|
|
|
354
354
|
display: flex;
|
|
355
355
|
flex-direction: column;
|
|
356
356
|
gap: 0.5rem;
|
|
357
|
-
font-size: 0.
|
|
357
|
+
font-size: 0.8125rem;
|
|
358
|
+
/* Zero intrinsic inline size: long tool names, paths, and one-line JSON in
|
|
359
|
+
the confirmation must never widen the composer or the chat column around
|
|
360
|
+
it — same containment trick as the conversation viewport. */
|
|
361
|
+
contain: inline-size;
|
|
358
362
|
}
|
|
359
363
|
|
|
360
364
|
.prompt-input__approval-question {
|
|
@@ -364,6 +368,11 @@
|
|
|
364
368
|
line-height: 1.4;
|
|
365
369
|
}
|
|
366
370
|
|
|
371
|
+
.prompt-input__approval-question > span:first-child {
|
|
372
|
+
min-width: 0;
|
|
373
|
+
overflow-wrap: anywhere;
|
|
374
|
+
}
|
|
375
|
+
|
|
367
376
|
.prompt-input__approval-question code {
|
|
368
377
|
font-family: var(--sigvelo-font-mono);
|
|
369
378
|
font-size: 0.8125em;
|
|
@@ -381,6 +390,8 @@
|
|
|
381
390
|
padding-block: 0.375rem;
|
|
382
391
|
padding-inline: 0.625rem;
|
|
383
392
|
overflow: auto;
|
|
393
|
+
/* Long values wrap and scroll vertically within the cap — never sideways. */
|
|
394
|
+
overflow-wrap: anywhere;
|
|
384
395
|
border: var(--sigvelo-border-style) var(--sigvelo-border-width)
|
|
385
396
|
var(--sigvelo-color-neutral-border-subtle);
|
|
386
397
|
border-radius: var(--sigvelo-radius-md);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mcp-b/react-components",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.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": {
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"anser": "^2.3.5",
|
|
50
50
|
"shiki": "^3.23.0",
|
|
51
51
|
"streamdown": "^2.5.0",
|
|
52
|
-
"@mcp-b/design-tokens": "0.
|
|
52
|
+
"@mcp-b/design-tokens": "0.5.0"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
55
|
"@ai-sdk/react": "^3.0.194",
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { r as ButtonProps } from "../Button-Ct5I6aTu.js";
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
|
|
4
|
-
//#region src/components/Suggestion.d.ts
|
|
5
|
-
interface SuggestionsProps extends React.HTMLAttributes<HTMLDivElement> {}
|
|
6
|
-
/**
|
|
7
|
-
* A horizontally scrollable row of prompt suggestions, typically shown above
|
|
8
|
-
* the composer or in the empty state. Children are {@link Suggestion} chips.
|
|
9
|
-
*
|
|
10
|
-
* Ported from AI Elements' Suggestions. Sigvelo changes: design-system Button
|
|
11
|
-
* chips and token-based styling; scrollbars hidden, scroll by wheel/touch.
|
|
12
|
-
*/
|
|
13
|
-
declare function Suggestions({
|
|
14
|
-
className,
|
|
15
|
-
children,
|
|
16
|
-
ref,
|
|
17
|
-
...props
|
|
18
|
-
}: SuggestionsProps & {
|
|
19
|
-
ref?: React.Ref<HTMLDivElement>;
|
|
20
|
-
}): React.JSX.Element;
|
|
21
|
-
interface SuggestionProps extends Omit<ButtonProps, "onClick" | "className"> {
|
|
22
|
-
className?: string;
|
|
23
|
-
/** The suggestion text — the chip label and the `onClick` payload. */
|
|
24
|
-
suggestion: string;
|
|
25
|
-
/** Called with the suggestion text; typically feeds `sendMessage`. */
|
|
26
|
-
onClick?: (suggestion: string) => void;
|
|
27
|
-
}
|
|
28
|
-
/** One pill-shaped suggestion chip. Renders `suggestion` unless children are given. */
|
|
29
|
-
declare function Suggestion({
|
|
30
|
-
className,
|
|
31
|
-
suggestion,
|
|
32
|
-
onClick,
|
|
33
|
-
variant,
|
|
34
|
-
color,
|
|
35
|
-
size,
|
|
36
|
-
children,
|
|
37
|
-
ref,
|
|
38
|
-
...props
|
|
39
|
-
}: SuggestionProps & {
|
|
40
|
-
ref?: React.Ref<HTMLButtonElement>;
|
|
41
|
-
}): React.JSX.Element;
|
|
42
|
-
//#endregion
|
|
43
|
-
export { Suggestion, SuggestionProps, Suggestions, SuggestionsProps };
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { t as cx } from "../class-names-9UtZwb0J.js";
|
|
2
|
-
import { Button } from "./Button.js";
|
|
3
|
-
import "react";
|
|
4
|
-
import { jsx } from "react/jsx-runtime";
|
|
5
|
-
//#region src/components/Suggestion.tsx
|
|
6
|
-
/**
|
|
7
|
-
* A horizontally scrollable row of prompt suggestions, typically shown above
|
|
8
|
-
* the composer or in the empty state. Children are {@link Suggestion} chips.
|
|
9
|
-
*
|
|
10
|
-
* Ported from AI Elements' Suggestions. Sigvelo changes: design-system Button
|
|
11
|
-
* chips and token-based styling; scrollbars hidden, scroll by wheel/touch.
|
|
12
|
-
*/
|
|
13
|
-
function Suggestions({ className, children, ref, ...props }) {
|
|
14
|
-
return /* @__PURE__ */ jsx("div", {
|
|
15
|
-
ref,
|
|
16
|
-
className: cx("suggestions", className),
|
|
17
|
-
...props,
|
|
18
|
-
children: /* @__PURE__ */ jsx("div", {
|
|
19
|
-
className: "suggestions__row",
|
|
20
|
-
children
|
|
21
|
-
})
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
/** One pill-shaped suggestion chip. Renders `suggestion` unless children are given. */
|
|
25
|
-
function Suggestion({ className, suggestion, onClick, variant = "outline", color = "neutral", size = "sm", children, ref, ...props }) {
|
|
26
|
-
return /* @__PURE__ */ jsx(Button, {
|
|
27
|
-
ref,
|
|
28
|
-
type: "button",
|
|
29
|
-
variant,
|
|
30
|
-
color,
|
|
31
|
-
size,
|
|
32
|
-
className: cx("suggestions__chip", className),
|
|
33
|
-
onClick: () => onClick?.(suggestion),
|
|
34
|
-
...props,
|
|
35
|
-
children: children ?? suggestion
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
//#endregion
|
|
39
|
-
export { Suggestion, Suggestions };
|
|
@@ -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 };
|