@mcp-b/react-components 0.25.0 → 0.25.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  import { i as AgentMessageRenderPartContext } from "./AgentMessageParts-CyD2UB3V.js";
2
2
  import { n as AgentChatStartScreenProps } from "./AgentChatStartScreen-DDZ25aax.js";
3
- import { $ as PromptInputDictationProps, A as PromptInputCommandDefinition, X as PromptInputContextSelectorProps, gt as PromptInputReference, n as PermissionMode, ut as PromptInputMessage } from "./PromptInput-BjoPWaaG.js";
3
+ import { $ as PromptInputDictationProps, A as PromptInputCommandDefinition, X as PromptInputContextSelectorProps, gt as PromptInputReference, n as PermissionMode, ut as PromptInputMessage } from "./PromptInput-CF7ADZhv.js";
4
4
  import * as React from "react";
5
5
  import { ChatAddToolApproveResponseFunction, ChatStatus, UIMessage } from "ai";
6
6
  import { PendingApproval, Think } from "@cloudflare/think";
@@ -261,10 +261,6 @@ interface PromptInputDictationProps extends Omit<PromptInputButtonProps, "childr
261
261
  */
262
262
  beforeStart?: (voice: UseVoiceInputReturn) => void | Promise<void>;
263
263
  }
264
- /**
265
- * Voice-dictation control for PromptInput. Final upstream transcripts are
266
- * appended to the composer while interim text remains ephemeral.
267
- */
268
264
  declare function PromptInputDictation({
269
265
  voice,
270
266
  beforeStart,
@@ -1,5 +1,5 @@
1
1
  import { i as AgentMessageRenderPartContext } from "./AgentMessageParts-CyD2UB3V.js";
2
- import { r as AgentChatProps } from "./AgentChat-DHxdTjwF.js";
2
+ import { r as AgentChatProps } from "./AgentChat-CG57Lz8a.js";
3
3
  import { l as ThinkChatPart } from "./ThinkChatToolParts-CSzVwMXf.js";
4
4
  import { t as ThinkChatActivityDescription } from "./ThinkChatActivitySummary-kr5fE0wg.js";
5
5
  import * as React from "react";
@@ -1,2 +1,2 @@
1
- import { a as PermissionModeControl, i as AgentChatRenderMessageContext, n as AgentChatComposerDraft, r as AgentChatProps, t as AgentChat } from "../AgentChat-DHxdTjwF.js";
1
+ import { a as PermissionModeControl, i as AgentChatRenderMessageContext, n as AgentChatComposerDraft, r as AgentChatProps, t as AgentChat } from "../AgentChat-CG57Lz8a.js";
2
2
  export { AgentChat, AgentChatComposerDraft, AgentChatProps, AgentChatRenderMessageContext, PermissionModeControl };
@@ -1,2 +1,2 @@
1
- import { $ as PromptInputDictationProps, A as PromptInputCommandDefinition, At as PromptInputTabProps, B as PromptInputCommandItemProps, Bt as TextInputContext, C as PromptInputBodyProps, Ct as PromptInputTab, D as PromptInputCommand, Dt as PromptInputTabItemProps, E as PromptInputButtonTooltip, Et as PromptInputTabItem, F as PromptInputCommandGroupLabelProps, Ft as PromptInputTools, G as PromptInputCommandSeparatorProps, Gt as usePromptInputAttachments, H as PromptInputCommandListProps, Ht as getApprovalRequestId, I as PromptInputCommandGroupProps, It as PromptInputToolsProps, J as PromptInputContextItem, K as PromptInputCommandTrigger, Kt as usePromptInputController, L as PromptInputCommandInput, Lt as PromptInputTooltipConfig, M as PromptInputCommandEmptyProps, Mt as PromptInputTabsListProps, N as PromptInputCommandGroup, Nt as PromptInputTextarea, O as PromptInputCommandComposer, Ot as PromptInputTabLabel, P as PromptInputCommandGroupLabel, Pt as PromptInputTextareaProps, Q as PromptInputDictation, R as PromptInputCommandInputProps, Rt as PromptInputTray, S as PromptInputBody, St as PromptInputSubmitProps, T as PromptInputButtonProps, Tt as PromptInputTabBodyProps, U as PromptInputCommandProps, Ut as getApprovalStateKey, V as PromptInputCommandList, Vt as TooltipSide, W as PromptInputCommandSeparator, Wt as getPendingToolApprovals, X as PromptInputContextSelectorProps, Y as PromptInputContextSelector, Z as PromptInputControllerProps, _ as PromptInputApprovalProps, _t as PromptInputReferences, a as PromptInputActionAddAttachmentsProps, at as PromptInputHoverCardContent, b as PromptInputAttachments, bt as PromptInputSelectProps, c as PromptInputActionMenu, ct as PromptInputHoverCardTrigger, d as PromptInputActionMenuItem, dt as PromptInputPermissionSelector, et as PromptInputFooter, f as PromptInputActionMenuItemProps, ft as PromptInputPermissionSelectorProps, g as PromptInputApproval, gt as PromptInputReference, h as PromptInputActionMenuTriggerProps, ht as PromptInputProviderProps, i as PromptInputActionAddAttachments, it as PromptInputHoverCard, j as PromptInputCommandEmpty, jt as PromptInputTabsList, k as PromptInputCommandComposerProps, kt as PromptInputTabLabelProps, l as PromptInputActionMenuContent, lt as PromptInputHoverCardTriggerProps, m as PromptInputActionMenuTrigger, mt as PromptInputProvider, n as PermissionMode, nt as PromptInputHeader, o as PromptInputActionAddScreenshot, ot as PromptInputHoverCardContentProps, p as PromptInputActionMenuProps, pt as PromptInputProps, q as PromptInputContextAction, qt as useProviderAttachments, r as PromptInput, rt as PromptInputHeaderProps, s as PromptInputActionAddScreenshotProps, st as PromptInputHoverCardProps, t as AttachmentsContext, tt as PromptInputFooterProps, u as PromptInputActionMenuContentProps, ut as PromptInputMessage, v as PromptInputAttachment, vt as PromptInputReferencesProps, w as PromptInputButton, wt as PromptInputTabBody, x as PromptInputAttachmentsProps, xt as PromptInputSubmit, y as PromptInputAttachmentProps, yt as PromptInputSelect, z as PromptInputCommandItem, zt as PromptInputTrayProps } from "../PromptInput-BjoPWaaG.js";
1
+ import { $ as PromptInputDictationProps, A as PromptInputCommandDefinition, At as PromptInputTabProps, B as PromptInputCommandItemProps, Bt as TextInputContext, C as PromptInputBodyProps, Ct as PromptInputTab, D as PromptInputCommand, Dt as PromptInputTabItemProps, E as PromptInputButtonTooltip, Et as PromptInputTabItem, F as PromptInputCommandGroupLabelProps, Ft as PromptInputTools, G as PromptInputCommandSeparatorProps, Gt as usePromptInputAttachments, H as PromptInputCommandListProps, Ht as getApprovalRequestId, I as PromptInputCommandGroupProps, It as PromptInputToolsProps, J as PromptInputContextItem, K as PromptInputCommandTrigger, Kt as usePromptInputController, L as PromptInputCommandInput, Lt as PromptInputTooltipConfig, M as PromptInputCommandEmptyProps, Mt as PromptInputTabsListProps, N as PromptInputCommandGroup, Nt as PromptInputTextarea, O as PromptInputCommandComposer, Ot as PromptInputTabLabel, P as PromptInputCommandGroupLabel, Pt as PromptInputTextareaProps, Q as PromptInputDictation, R as PromptInputCommandInputProps, Rt as PromptInputTray, S as PromptInputBody, St as PromptInputSubmitProps, T as PromptInputButtonProps, Tt as PromptInputTabBodyProps, U as PromptInputCommandProps, Ut as getApprovalStateKey, V as PromptInputCommandList, Vt as TooltipSide, W as PromptInputCommandSeparator, Wt as getPendingToolApprovals, X as PromptInputContextSelectorProps, Y as PromptInputContextSelector, Z as PromptInputControllerProps, _ as PromptInputApprovalProps, _t as PromptInputReferences, a as PromptInputActionAddAttachmentsProps, at as PromptInputHoverCardContent, b as PromptInputAttachments, bt as PromptInputSelectProps, c as PromptInputActionMenu, ct as PromptInputHoverCardTrigger, d as PromptInputActionMenuItem, dt as PromptInputPermissionSelector, et as PromptInputFooter, f as PromptInputActionMenuItemProps, ft as PromptInputPermissionSelectorProps, g as PromptInputApproval, gt as PromptInputReference, h as PromptInputActionMenuTriggerProps, ht as PromptInputProviderProps, i as PromptInputActionAddAttachments, it as PromptInputHoverCard, j as PromptInputCommandEmpty, jt as PromptInputTabsList, k as PromptInputCommandComposerProps, kt as PromptInputTabLabelProps, l as PromptInputActionMenuContent, lt as PromptInputHoverCardTriggerProps, m as PromptInputActionMenuTrigger, mt as PromptInputProvider, n as PermissionMode, nt as PromptInputHeader, o as PromptInputActionAddScreenshot, ot as PromptInputHoverCardContentProps, p as PromptInputActionMenuProps, pt as PromptInputProps, q as PromptInputContextAction, qt as useProviderAttachments, r as PromptInput, rt as PromptInputHeaderProps, s as PromptInputActionAddScreenshotProps, st as PromptInputHoverCardProps, t as AttachmentsContext, tt as PromptInputFooterProps, u as PromptInputActionMenuContentProps, ut as PromptInputMessage, v as PromptInputAttachment, vt as PromptInputReferencesProps, w as PromptInputButton, wt as PromptInputTabBody, x as PromptInputAttachmentsProps, xt as PromptInputSubmit, y as PromptInputAttachmentProps, yt as PromptInputSelect, z as PromptInputCommandItem, zt as PromptInputTrayProps } from "../PromptInput-CF7ADZhv.js";
2
2
  export { AttachmentsContext, PermissionMode, PromptInput, PromptInputActionAddAttachments, PromptInputActionAddAttachmentsProps, PromptInputActionAddScreenshot, PromptInputActionAddScreenshotProps, PromptInputActionMenu, PromptInputActionMenuContent, PromptInputActionMenuContentProps, PromptInputActionMenuItem, PromptInputActionMenuItemProps, PromptInputActionMenuProps, PromptInputActionMenuTrigger, PromptInputActionMenuTriggerProps, PromptInputApproval, PromptInputApprovalProps, PromptInputAttachment, PromptInputAttachmentProps, PromptInputAttachments, PromptInputAttachmentsProps, PromptInputBody, PromptInputBodyProps, PromptInputButton, PromptInputButtonProps, PromptInputButtonTooltip, PromptInputCommand, PromptInputCommandComposer, PromptInputCommandComposerProps, PromptInputCommandDefinition, PromptInputCommandEmpty, PromptInputCommandEmptyProps, PromptInputCommandGroup, PromptInputCommandGroupLabel, PromptInputCommandGroupLabelProps, PromptInputCommandGroupProps, PromptInputCommandInput, PromptInputCommandInputProps, PromptInputCommandItem, PromptInputCommandItemProps, PromptInputCommandList, PromptInputCommandListProps, PromptInputCommandProps, PromptInputCommandSeparator, PromptInputCommandSeparatorProps, PromptInputCommandTrigger, PromptInputContextAction, PromptInputContextItem, PromptInputContextSelector, PromptInputContextSelectorProps, PromptInputControllerProps, PromptInputDictation, PromptInputDictationProps, PromptInputFooter, PromptInputFooterProps, PromptInputHeader, PromptInputHeaderProps, PromptInputHoverCard, PromptInputHoverCardContent, PromptInputHoverCardContentProps, PromptInputHoverCardProps, PromptInputHoverCardTrigger, PromptInputHoverCardTriggerProps, PromptInputMessage, PromptInputPermissionSelector, PromptInputPermissionSelectorProps, PromptInputProps, PromptInputProvider, PromptInputProviderProps, PromptInputReference, PromptInputReferences, PromptInputReferencesProps, PromptInputSelect, PromptInputSelectProps, PromptInputSubmit, PromptInputSubmitProps, PromptInputTab, PromptInputTabBody, PromptInputTabBodyProps, PromptInputTabItem, PromptInputTabItemProps, PromptInputTabLabel, PromptInputTabLabelProps, PromptInputTabProps, PromptInputTabsList, PromptInputTabsListProps, PromptInputTextarea, PromptInputTextareaProps, PromptInputTools, PromptInputToolsProps, PromptInputTooltipConfig, PromptInputTray, PromptInputTrayProps, TextInputContext, TooltipSide, getApprovalRequestId, getApprovalStateKey, getPendingToolApprovals, usePromptInputAttachments, usePromptInputController, useProviderAttachments };
@@ -507,6 +507,7 @@ function PromptInputButton({ className, tooltip, variant = "ghost", color = "neu
507
507
  * Voice-dictation control for PromptInput. Final upstream transcripts are
508
508
  * appended to the composer while interim text remains ephemeral.
509
509
  */
510
+ const DICTATION_METER_GAIN = 12;
510
511
  function PromptInputDictation({ voice, beforeStart, className, disabled, ref, ...props }) {
511
512
  const controller = useOptionalPromptInputController();
512
513
  const attachments = usePromptInputAttachments();
@@ -531,7 +532,7 @@ function PromptInputDictation({ voice, beforeStart, className, disabled, ref, ..
531
532
  }
532
533
  const textarea = buttonRef.current?.form?.querySelector("textarea[data-prompt-input-textarea=\"true\"]");
533
534
  if (!textarea) return;
534
- textarea.value = appendDictationTranscript(textarea.value, addition);
535
+ Object.getOwnPropertyDescriptor(HTMLTextAreaElement.prototype, "value")?.set?.call(textarea, appendDictationTranscript(textarea.value, addition));
535
536
  textarea.dispatchEvent(new Event("input", { bubbles: true }));
536
537
  }, [controller, voice.transcript]);
537
538
  React.useEffect(() => {
@@ -556,7 +557,7 @@ function PromptInputDictation({ voice, beforeStart, className, disabled, ref, ..
556
557
  const listening = voice.isListening;
557
558
  const label = listening ? "Stop dictation" : error ? "Retry dictation" : "Start dictation";
558
559
  const status = error ? `Dictation failed: ${error}` : listening ? voice.interimTranscript ? "Listening. Speech detected." : "Listening for speech." : isStarting ? "Starting dictation." : "";
559
- const level = clamp(voice.audioLevel, 0, 1);
560
+ const level = clamp(voice.audioLevel * DICTATION_METER_GAIN, 0, 1);
560
561
  const elapsed = formatClock(elapsedSeconds);
561
562
  return /* @__PURE__ */ jsxs(Fragment, { children: [
562
563
  /* @__PURE__ */ jsx(PromptInputButton, {
@@ -1,9 +1,9 @@
1
1
  import { i as AgentMessageRenderPartContext } from "../AgentMessageParts-CyD2UB3V.js";
2
- import { r as AgentChatProps } from "../AgentChat-DHxdTjwF.js";
2
+ import { r as AgentChatProps } from "../AgentChat-CG57Lz8a.js";
3
3
  import { i as useOptionalAgentToolRuns, n as AgentToolRunsProvider, r as AgentToolRunsProviderProps, t as AgentToolEventsValue } from "../AgentToolRunsContext-BVe4stgw.js";
4
4
  import { S as isThinkChatActivityPart } from "../ThinkChatToolParts-CSzVwMXf.js";
5
5
  import { u as describeThinkChatActivityPart } from "../ThinkChatActivitySummary-kr5fE0wg.js";
6
- import { a as ThinkChatToolRenderers, i as ThinkChatToolRenderer, n as ThinkChatActivityProps, o as createThinkChatActivityRenderer, r as ThinkChatActivityRendererOptions, s as renderThinkChatActivityPart, t as ThinkChatActivity } from "../ThinkChatActivity-DMTHKWrI.js";
6
+ import { a as ThinkChatToolRenderers, i as ThinkChatToolRenderer, n as ThinkChatActivityProps, o as createThinkChatActivityRenderer, r as ThinkChatActivityRendererOptions, s as renderThinkChatActivityPart, t as ThinkChatActivity } from "../ThinkChatActivity-fztcHGq5.js";
7
7
  import { i as ThinkChatValue } from "../ThinkChatContext-B-Nk84Wi.js";
8
8
  import { n as ThinkRecoveryNoticeProps, t as ThinkRecoveryNotice } from "../ThinkRecoveryNotice-D6gYcBbr.js";
9
9
  import { n as BrowserLiveViewProps, t as BrowserLiveView } from "../BrowserLiveView-BV5qgFgI.js";
@@ -1,4 +1,4 @@
1
1
  import { S as isThinkChatActivityPart } from "../ThinkChatToolParts-CSzVwMXf.js";
2
2
  import { u as describeThinkChatActivityPart } from "../ThinkChatActivitySummary-kr5fE0wg.js";
3
- import { a as ThinkChatToolRenderers, i as ThinkChatToolRenderer, n as ThinkChatActivityProps, o as createThinkChatActivityRenderer, r as ThinkChatActivityRendererOptions, s as renderThinkChatActivityPart, t as ThinkChatActivity } from "../ThinkChatActivity-DMTHKWrI.js";
3
+ import { a as ThinkChatToolRenderers, i as ThinkChatToolRenderer, n as ThinkChatActivityProps, o as createThinkChatActivityRenderer, r as ThinkChatActivityRendererOptions, s as renderThinkChatActivityPart, t as ThinkChatActivity } from "../ThinkChatActivity-fztcHGq5.js";
4
4
  export { ThinkChatActivity, ThinkChatActivityProps, ThinkChatActivityRendererOptions, ThinkChatToolRenderer, ThinkChatToolRenderers, createThinkChatActivityRenderer, describeThinkChatActivityPart, isThinkChatActivityPart, renderThinkChatActivityPart };
@@ -235,48 +235,45 @@ function ThinkFullApp({ agent, appBarActions, appBarLeading, appBarTitle, chat,
235
235
  ...props,
236
236
  children: [
237
237
  shouldRenderInlineAppBar ? renderAppTopBar() : null,
238
- /* @__PURE__ */ jsx(React.ViewTransition, {
239
- default: "sigvelo-layout-transition",
240
- children: /* @__PURE__ */ jsxs("div", {
241
- className: "think-full-app__view-scope",
242
- "data-recipe": "application-plane",
243
- "data-mobile-view": activeMobileView,
244
- children: [/* @__PURE__ */ jsx("section", {
245
- className: "think-full-app__chat-surface",
246
- "data-workspace-restoration-scope": "chat",
247
- "aria-label": "Chat",
238
+ /* @__PURE__ */ jsxs("div", {
239
+ className: "think-full-app__view-scope",
240
+ "data-recipe": "application-plane",
241
+ "data-mobile-view": activeMobileView,
242
+ children: [/* @__PURE__ */ jsx("section", {
243
+ className: "think-full-app__chat-surface",
244
+ "data-workspace-restoration-scope": "chat",
245
+ "aria-label": "Chat",
246
+ children: /* @__PURE__ */ jsx("div", {
247
+ className: "think-full-app__chat",
248
248
  children: /* @__PURE__ */ jsx("div", {
249
- className: "think-full-app__chat",
250
- children: /* @__PURE__ */ jsx("div", {
251
- className: "think-full-app__chat-inner",
252
- children: /* @__PURE__ */ jsx(ThinkChat.Provider, {
253
- chat,
254
- agentTools,
255
- children: /* @__PURE__ */ jsx(ThinkChat.Messages, {
256
- ...resolvedMessages,
257
- renderAgentToolRunLink: showAgentTools ? renderAgentToolRunLink : void 0
258
- })
249
+ className: "think-full-app__chat-inner",
250
+ children: /* @__PURE__ */ jsx(ThinkChat.Provider, {
251
+ chat,
252
+ agentTools,
253
+ children: /* @__PURE__ */ jsx(ThinkChat.Messages, {
254
+ ...resolvedMessages,
255
+ renderAgentToolRunLink: showAgentTools ? renderAgentToolRunLink : void 0
259
256
  })
260
257
  })
261
258
  })
262
- }), activePanel ? /* @__PURE__ */ jsx("aside", {
263
- className: "think-full-app__aside",
264
- "aria-label": "Workbench",
265
- children: /* @__PURE__ */ jsx("div", {
266
- className: "think-full-app__workbench-slot",
267
- children: /* @__PURE__ */ jsx(React.ViewTransition, {
268
- default: "sigvelo-layout-transition",
269
- children: /* @__PURE__ */ jsx("div", {
270
- ref: workbenchPanelRef,
271
- className: "think-full-app__workbench-panel",
272
- "data-view": activeWorkbenchView,
273
- tabIndex: -1,
274
- children: activePanel.render(panelContext)
275
- })
259
+ })
260
+ }), activePanel ? /* @__PURE__ */ jsx("aside", {
261
+ className: "think-full-app__aside",
262
+ "aria-label": "Workbench",
263
+ children: /* @__PURE__ */ jsx("div", {
264
+ className: "think-full-app__workbench-slot",
265
+ children: /* @__PURE__ */ jsx(React.ViewTransition, {
266
+ default: "sigvelo-layout-transition",
267
+ children: /* @__PURE__ */ jsx("div", {
268
+ ref: workbenchPanelRef,
269
+ className: "think-full-app__workbench-panel",
270
+ "data-view": activeWorkbenchView,
271
+ tabIndex: -1,
272
+ children: activePanel.render(panelContext)
276
273
  })
277
274
  })
278
- }) : null]
279
- })
275
+ })
276
+ }) : null]
280
277
  }),
281
278
  activePanel ? /* @__PURE__ */ jsx(ResizableSidePanel.Handle, { className: "think-full-app__resizer" }) : null
282
279
  ]
@@ -53,6 +53,7 @@
53
53
  bounds DOM cost, and translateY replaces flow layout. */
54
54
  .message-scroller__virtual-content {
55
55
  position: relative;
56
+ box-sizing: content-box;
56
57
  width: 100%;
57
58
  }
58
59
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mcp-b/react-components",
3
- "version": "0.25.0",
3
+ "version": "0.25.1",
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": {
@@ -58,7 +58,7 @@
58
58
  "streamdown": "^2.5.0",
59
59
  "unist-util-visit": "^5.1.0",
60
60
  "yet-another-react-lightbox": "^3.32.1",
61
- "@mcp-b/design-tokens": "0.25.0"
61
+ "@mcp-b/design-tokens": "0.25.1"
62
62
  },
63
63
  "devDependencies": {
64
64
  "@ai-sdk/react": "^3.0.222",