@mcp-b/react-components 0.58.1 → 0.59.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. package/dist/{EmployeeChrome-DsdIek0l.d.ts → EmployeeChrome-QSki0QT4.d.ts} +4 -4
  2. package/dist/{ResponsiveSidebarShell-DoZlSP30.d.ts → ResponsiveSidebarShell-DzBGlRJF.d.ts} +23 -8
  3. package/dist/{ThinkChatActivity-BkGjTY4r.d.ts → ThinkChatActivity-C4_hPEmb.d.ts} +20 -4
  4. package/dist/{ThinkChatActivitySummary-DZVy3uQV.d.ts → ThinkChatActivitySummary-ChJ8Iu2T.d.ts} +3 -3
  5. package/dist/{ThinkChatToolParts-BucHi63O.d.ts → ThinkChatToolParts-BrntWlpa.d.ts} +29 -3
  6. package/dist/{WorkspaceConceptPanel-97ZyVpZI.js → WorkspaceConceptPanel-D21iRsWm.js} +7 -4
  7. package/dist/{WorkspaceFileView-M2jC2P4p.js → WorkspaceFileView-CsWwQA1U.js} +80 -74
  8. package/dist/app-bar-outlet-CNfNzY4Y.js +6 -0
  9. package/dist/components/agents-sdk/AgentChat.js +1 -1
  10. package/dist/components/agents-sdk/BrowserLiveScreen.js +49 -11
  11. package/dist/components/agents-sdk/EmployeeApp.d.ts +2 -3
  12. package/dist/components/agents-sdk/EmployeeApp.js +5 -5
  13. package/dist/components/agents-sdk/EmployeeChat.js +1 -1
  14. package/dist/components/agents-sdk/EmployeeChrome.d.ts +1 -1
  15. package/dist/components/agents-sdk/EmployeeChrome.js +217 -205
  16. package/dist/components/agents-sdk/EmployeeSchedules.d.ts +1 -1
  17. package/dist/components/agents-sdk/EmployeeSchedules.js +8 -8
  18. package/dist/components/agents-sdk/EmployeeStartScreen.d.ts +1 -1
  19. package/dist/components/agents-sdk/EmployeeStartScreen.js +2 -2
  20. package/dist/components/agents-sdk/ManagerAccountActions.js +1 -1
  21. package/dist/components/agents-sdk/ManagerOffice.js +1 -1
  22. package/dist/components/agents-sdk/ManagerOfficeScreens.d.ts +1 -1
  23. package/dist/components/agents-sdk/ManagerOfficeScreens.js +6 -19
  24. package/dist/components/agents-sdk/McpPluginCatalog.js +1 -1
  25. package/dist/components/agents-sdk/ModelEndpointDialog.js +1 -1
  26. package/dist/components/agents-sdk/ModelSelector.js +1 -1
  27. package/dist/components/agents-sdk/SubagentRunPanel.d.ts +8 -9
  28. package/dist/components/agents-sdk/SubagentRunPanel.js +133 -122
  29. package/dist/components/agents-sdk/ThinkChat.d.ts +1 -1
  30. package/dist/components/agents-sdk/ThinkChat.js +26 -3
  31. package/dist/components/agents-sdk/ThinkChatActivity.d.ts +1 -1
  32. package/dist/components/agents-sdk/ThinkChatActivity.js +108 -108
  33. package/dist/components/agents-sdk/ThinkChatActivitySummary.d.ts +1 -1
  34. package/dist/components/agents-sdk/ThinkChatActivitySummary.js +183 -40
  35. package/dist/components/agents-sdk/ThinkChatToolPanels.d.ts +8 -4
  36. package/dist/components/agents-sdk/ThinkChatToolPanels.js +308 -62
  37. package/dist/components/agents-sdk/ThinkChatToolParts.d.ts +2 -2
  38. package/dist/components/agents-sdk/ThinkChatToolParts.js +71 -1
  39. package/dist/components/agents-sdk/ThinkExecutionWorkbench.d.ts +3 -4
  40. package/dist/components/agents-sdk/ThinkExecutionWorkbench.js +5 -5
  41. package/dist/components/agents-sdk/ThinkFullApp.d.ts +1 -1
  42. package/dist/components/agents-sdk/ThinkFullApp.js +6 -1
  43. package/dist/components/agents-sdk/ThinkRoutineActions.js +15 -23
  44. package/dist/components/agents-sdk/ThinkRoutineDetail.js +1 -1
  45. package/dist/components/agents-sdk/ThinkRoutineForm.js +5 -5
  46. package/dist/components/agents-sdk/ThinkThreadPicker.js +2 -2
  47. package/dist/components/agents-sdk/WorkspaceExecution.js +139 -132
  48. package/dist/components/agents-sdk/WorkspaceExecutionTable.js +2 -2
  49. package/dist/components/agents-sdk/WorkspaceExplorer.js +2 -2
  50. package/dist/components/agents-sdk/WorkspaceFileView.js +1 -1
  51. package/dist/components/agents-sdk/WorkspaceHeader.js +26 -28
  52. package/dist/components/agents-sdk/WorkspaceProject.js +1 -1
  53. package/dist/components/agents-sdk/WorkspaceUserScript.js +2 -2
  54. package/dist/components/ai-sdk/Activity.d.ts +1 -1
  55. package/dist/components/ai-sdk/Activity.js +84 -6
  56. package/dist/components/ai-sdk/AgentChatMessageEditor.js +1 -1
  57. package/dist/components/ai-sdk/Approval.js +2 -1
  58. package/dist/components/ai-sdk/ComposerLink.js +1 -1
  59. package/dist/components/ai-sdk/ConnectedAppCards.js +63 -45
  60. package/dist/components/ai-sdk/Conversation.js +1 -1
  61. package/dist/components/ai-sdk/ExpansionState.d.ts +16 -6
  62. package/dist/components/ai-sdk/ExpansionState.js +25 -7
  63. package/dist/components/ai-sdk/MediaPreviewCard.js +1 -1
  64. package/dist/components/ai-sdk/MessageScrollerVirtual.js +98 -11
  65. package/dist/components/ai-sdk/PromptInput.js +7 -3
  66. package/dist/components/ai-sdk/PromptInputComposerEditor.js +2 -2
  67. package/dist/components/ai-sdk/Queue.js +1 -1
  68. package/dist/components/ai-sdk/ToolInvocation.d.ts +8 -0
  69. package/dist/components/ai-sdk/ToolInvocation.js +45 -19
  70. package/dist/components/foundations/ToggleGroup.d.ts +1 -1
  71. package/dist/components/foundations/ToggleGroup.js +2 -2
  72. package/dist/components/general-purpose/PricingBillingToggle.js +1 -1
  73. package/dist/components/general-purpose/PricingUsageCalculator.js +1 -1
  74. package/dist/components/general-purpose/ResponsiveSidebarShell.d.ts +2 -2
  75. package/dist/components/general-purpose/ResponsiveSidebarShell.js +162 -87
  76. package/dist/components/general-purpose/Terminal.js +1 -1
  77. package/dist/components/general-purpose/ThemeModeControl.js +1 -1
  78. package/dist/components/general-purpose/WebPreview.js +1 -1
  79. package/dist/components/nanites/AgentToolDetail.d.ts +1 -3
  80. package/dist/components/nanites/AgentToolDetail.js +31 -40
  81. package/dist/merge-refs-DAh6reu8.js +26 -0
  82. package/dist/styles/activity.css +74 -0
  83. package/dist/styles/agent-chat.css +7 -0
  84. package/dist/styles/agent-tool-detail.css +2 -17
  85. package/dist/styles/app-top-bar.css +6 -7
  86. package/dist/styles/base.css +1 -1
  87. package/dist/styles/employee-chrome.css +0 -7
  88. package/dist/styles/message.css +1 -1
  89. package/dist/styles/responsive-sidebar-shell.css +10 -25
  90. package/dist/styles/scroll-area.css +16 -0
  91. package/dist/styles/scrollbars.css +55 -41
  92. package/dist/styles/search-field.css +0 -1
  93. package/dist/styles/subagent-run.css +36 -196
  94. package/dist/styles/think-chat-tool-panels.css +38 -5
  95. package/dist/styles/think-execution-workbench.css +4 -0
  96. package/dist/styles/think-full-app.css +1 -6
  97. package/dist/styles/workspace-concepts.css +6 -39
  98. package/dist/styles/workspace-explorer.css +4 -11
  99. package/package.json +2 -2
  100. package/dist/components/agents-sdk/SubagentRunDetails.d.ts +0 -40
  101. package/dist/components/agents-sdk/SubagentRunDetails.js +0 -98
  102. package/dist/merge-refs-DF_7w2x_.js +0 -18
  103. package/dist/{ManagerOffice-C8AQcaXs.js → ManagerOffice-DHcLRhFu.js} +2 -2
@@ -1,7 +1,7 @@
1
1
  import { parseComposerHref, sampleImageAccent, splitComposerDraft } from "../../utils/composer-link.js";
2
2
  import { t as cx } from "../../class-names-BiMDVpUo.js";
3
3
  import { n as clamp } from "../../format-CWaZEp5o.js";
4
- import { n as mergeRefs } from "../../merge-refs-DF_7w2x_.js";
4
+ import { n as mergeRefs } from "../../merge-refs-DAh6reu8.js";
5
5
  import { composerLinkAccent, composerLinkIconSrc, composerLinkUsesCube } from "./ComposerLink.js";
6
6
  import * as React from "react";
7
7
  import { jsx } from "react/jsx-runtime";
@@ -203,7 +203,7 @@ function PromptInputComposerEditor({ className, placeholder = "How can I help?",
203
203
  onKeyDown: (event) => {
204
204
  onKeyDown?.(event);
205
205
  if (event.defaultPrevented) return;
206
- if (event.key === "Enter" && !event.shiftKey && !isComposingRef.current && !event.nativeEvent.isComposing) {
206
+ if (event.key === "Enter" && !event.shiftKey && !isComposingRef.current && !event.nativeEvent.isComposing && event.nativeEvent.keyCode !== 229) {
207
207
  event.preventDefault();
208
208
  event.currentTarget.closest("form")?.requestSubmit();
209
209
  }
@@ -1,8 +1,8 @@
1
1
  import { t as cx } from "../../class-names-BiMDVpUo.js";
2
2
  import { Collapsible } from "../foundations/Collapsible.js";
3
+ import { ScrollArea } from "../foundations/ScrollArea.js";
3
4
  import { S as FileIcon, _ as DotIcon, d as CheckIcon, p as ChevronRightIcon } from "../../icons-DvlrWt54.js";
4
5
  import { Button } from "../foundations/Button.js";
5
- import { ScrollArea } from "../foundations/ScrollArea.js";
6
6
  import "react";
7
7
  import { jsx, jsxs } from "react/jsx-runtime";
8
8
  //#region src/components/ai-sdk/Queue.tsx
@@ -12,6 +12,12 @@ export interface ToolInvocationProps {
12
12
  */
13
13
  isStreaming?: boolean;
14
14
  }
15
+ export interface ToolInvocationDetailsProps {
16
+ /** The whole upstream AI SDK tool part whose detail is disclosed. */
17
+ part: AnyToolUIPart;
18
+ /** Caller-known domain error envelope; arbitrary output.error fields stay ordinary data. */
19
+ outputError?: boolean;
20
+ }
15
21
  /**
16
22
  * Read-only generic disclosure for one upstream AI SDK tool invocation.
17
23
  *
@@ -22,4 +28,6 @@ export interface ToolInvocationProps {
22
28
  * for known workspace, browser, fetch, session, skill, and execute tools.
23
29
  */
24
30
  export declare function ToolInvocation({ part, defaultOpen, isStreaming }: ToolInvocationProps): import("react").JSX.Element;
31
+ /** Output formatting stays inside ActivityContent so collapsed rows do no detail work. */
32
+ export declare function ToolInvocationDetails({ part, outputError }: ToolInvocationDetailsProps): import("react").JSX.Element;
25
33
  //#endregion
@@ -1,8 +1,8 @@
1
1
  import { Activity, ActivityContent, ActivityPanel, ActivityTrigger } from "./Activity.js";
2
2
  import { o as formatUnknownValue } from "../../format-CWaZEp5o.js";
3
- import { getToolDisplayName, isToolPartFailed, isToolPartWorking } from "./ToolPart.js";
3
+ import { getToolDisplayName, isToolPartWorking } from "./ToolPart.js";
4
4
  import { t as summarizeToolInput } from "../../summarize-tool-input-CqTcGRYy.js";
5
- import { jsx, jsxs } from "react/jsx-runtime";
5
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
6
6
  import { getToolName } from "ai";
7
7
  //#region src/components/ai-sdk/ToolInvocation.tsx
8
8
  function formatToolValue(value) {
@@ -43,27 +43,53 @@ function describeToolPart(part) {
43
43
  * for known workspace, browser, fetch, session, skill, and execute tools.
44
44
  */
45
45
  function ToolInvocation({ part, defaultOpen, isStreaming }) {
46
- const failed = isToolPartFailed(part);
47
- const deniedReason = part.state === "output-denied" ? part.approval.reason : void 0;
48
- const output = part.state === "output-error" ? part.errorText : part.state === "output-denied" ? deniedReason ?? "Denied" : part.state === "output-available" ? formatToolValue(part.output) : void 0;
49
- const inputStatus = part.state === "approval-requested" ? "awaiting approval" : part.state === "approval-responded" ? part.approval.approved ? "approved" : "denied" : void 0;
50
- const outputStatus = part.state === "output-denied" ? "denied" : failed ? "error" : part.state === "output-available" && part.preliminary ? "preliminary" : void 0;
51
46
  return /* @__PURE__ */ jsxs(Activity, {
52
47
  isStreaming: isStreaming ?? isToolPartWorking(part),
53
48
  defaultOpen,
54
49
  stateKey: part.toolCallId,
55
- children: [/* @__PURE__ */ jsx(ActivityTrigger, { action: describeToolPart(part) }), /* @__PURE__ */ jsxs(ActivityContent, { children: [/* @__PURE__ */ jsx(ActivityPanel, {
56
- label: part.title ?? getToolName(part),
57
- text: formatToolValue(part.input),
58
- status: inputStatus,
59
- error: inputStatus === "denied"
60
- }), output !== void 0 ? /* @__PURE__ */ jsx(ActivityPanel, {
61
- label: "output",
62
- text: output,
63
- status: outputStatus,
64
- error: failed
65
- }) : null] })]
50
+ children: [/* @__PURE__ */ jsx(ActivityTrigger, { action: describeToolPart(part) }), /* @__PURE__ */ jsx(ActivityContent, { children: /* @__PURE__ */ jsx(ToolInvocationDetails, { part }) })]
66
51
  });
67
52
  }
53
+ function toolInputStatus(part) {
54
+ if (part.state === "approval-requested") return "awaiting approval";
55
+ if (part.state === "approval-responded") return part.approval.approved ? "approved" : "denied";
56
+ }
57
+ /** The output row once the call settles: its denial, its error, or its result. */
58
+ function toolOutputRow(part, outputError) {
59
+ if (part.state === "output-denied" || part.state === "approval-responded" && !part.approval.approved) return {
60
+ text: part.approval.reason ?? "Denied",
61
+ status: "denied",
62
+ error: true
63
+ };
64
+ if (part.state === "output-error") return {
65
+ text: part.errorText,
66
+ status: "error",
67
+ error: true
68
+ };
69
+ if (part.state !== "output-available") return void 0;
70
+ const text = formatToolValue(part.output);
71
+ if (text === void 0) return void 0;
72
+ return {
73
+ text,
74
+ status: outputError ? "error" : part.preliminary ? "preliminary" : void 0,
75
+ error: outputError
76
+ };
77
+ }
78
+ /** Output formatting stays inside ActivityContent so collapsed rows do no detail work. */
79
+ function ToolInvocationDetails({ part, outputError = false }) {
80
+ const inputStatus = toolInputStatus(part);
81
+ const output = toolOutputRow(part, outputError);
82
+ return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(ActivityPanel, {
83
+ label: part.title ?? getToolName(part),
84
+ text: formatToolValue(part.input),
85
+ status: inputStatus,
86
+ error: inputStatus === "denied"
87
+ }), output ? /* @__PURE__ */ jsx(ActivityPanel, {
88
+ label: "output",
89
+ text: output.text,
90
+ status: output.status,
91
+ error: output.error
92
+ }) : null] });
93
+ }
68
94
  //#endregion
69
- export { ToolInvocation };
95
+ export { ToolInvocation, ToolInvocationDetails };
@@ -1,7 +1,7 @@
1
1
  import { ToggleVariantsOptions } from "./Toggle.js";
2
2
  import * as React from "react";
3
- import { ToggleGroup as ToggleGroup$1 } from "@base-ui/react/toggle-group";
4
3
  import { Toggle } from "@base-ui/react/toggle";
4
+ import { ToggleGroup as ToggleGroup$1 } from "@base-ui/react/toggle-group";
5
5
  //#region src/components/foundations/ToggleGroup.d.ts
6
6
  type ToggleGroupSize = ToggleVariantsOptions["size"];
7
7
  export type ToggleGroupProps<Value extends string = string> = ToggleGroup$1.Props<Value> & {
@@ -1,10 +1,10 @@
1
1
  import { n as mergeBaseClassName, t as cx } from "../../class-names-BiMDVpUo.js";
2
- import { n as mergeRefs } from "../../merge-refs-DF_7w2x_.js";
2
+ import { n as mergeRefs } from "../../merge-refs-DAh6reu8.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 { ToggleGroup as ToggleGroup$1 } from "@base-ui/react/toggle-group";
7
6
  import { Toggle } from "@base-ui/react/toggle";
7
+ import { ToggleGroup as ToggleGroup$1 } from "@base-ui/react/toggle-group";
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,6 +1,6 @@
1
1
  import { t as cx } from "../../class-names-BiMDVpUo.js";
2
- import { ToggleGroup } from "../foundations/ToggleGroup.js";
3
2
  import { Switch } from "../foundations/Switch.js";
3
+ import { ToggleGroup } from "../foundations/ToggleGroup.js";
4
4
  import { jsx, jsxs } from "react/jsx-runtime";
5
5
  //#region src/components/general-purpose/PricingBillingToggle.tsx
6
6
  /** 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 { Card } from "../foundations/Card.js";
3
3
  import { Separator } from "../foundations/Separator.js";
4
- import { Slider } from "../foundations/Slider.js";
5
4
  import { Progress } from "../foundations/Progress.js";
5
+ import { Slider } from "../foundations/Slider.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,2 +1,2 @@
1
- import { a as ResponsiveSidebarShellProps, i as ResponsiveSidebarShellControls, n as ResponsiveSidebarShell, o as useResponsiveSidebarShell, r as ResponsiveSidebarShellBar, t as AppBarSlots } from "../../ResponsiveSidebarShell-DoZlSP30.js";
2
- export { AppBarSlots, ResponsiveSidebarShell, ResponsiveSidebarShellBar, ResponsiveSidebarShellControls, ResponsiveSidebarShellProps, useResponsiveSidebarShell };
1
+ import { a as ResponsiveSidebarShellBar, c as useResponsiveSidebarShell, i as ResponsiveSidebarShell, n as ResponsiveSidebarAppBar, o as ResponsiveSidebarShellControls, r as ResponsiveSidebarAppBarProps, s as ResponsiveSidebarShellProps, t as AppBarSlots } from "../../ResponsiveSidebarShell-DzBGlRJF.js";
2
+ export { AppBarSlots, ResponsiveSidebarAppBar, ResponsiveSidebarAppBarProps, ResponsiveSidebarShell, ResponsiveSidebarShellBar, ResponsiveSidebarShellControls, ResponsiveSidebarShellProps, useResponsiveSidebarShell };
@@ -2,11 +2,13 @@ import { t as cx } from "../../class-names-BiMDVpUo.js";
2
2
  import { W as SidebarIcon, f as ChevronDownIcon, r as ArrowLeftIcon, tt as WarningIcon } from "../../icons-DvlrWt54.js";
3
3
  import { Button } from "../foundations/Button.js";
4
4
  import { t as capitalize } from "../../format-CWaZEp5o.js";
5
- import { n as mergeRefs } from "../../merge-refs-DF_7w2x_.js";
5
+ import { n as mergeRefs } from "../../merge-refs-DAh6reu8.js";
6
6
  import { AppTopBar } from "./AppTopBar.js";
7
7
  import { ResizableSidePanel } from "./ResizableSidePanel.js";
8
+ import { n as ShellAppBarOutletContext, t as ContentAppBarOutletContext } from "../../app-bar-outlet-CNfNzY4Y.js";
8
9
  import * as React from "react";
9
- import { jsx, jsxs } from "react/jsx-runtime";
10
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
11
+ import { createPortal } from "react-dom";
10
12
  //#region src/components/general-purpose/ResponsiveSidebarShell.tsx
11
13
  /** Matches --sigvelo-layout-sidebar (16rem). */
12
14
  const sidebarDefaultWidth = 256;
@@ -98,11 +100,25 @@ function useSidebarLayout({ rootRef, mainRef, isSidebarOpen, setSidebarOpen, pri
98
100
  * hook, and its container name `responsive-sidebar-shell` is public contract:
99
101
  * surfaces that compose the shell size themselves against it.
100
102
  */
101
- function ResponsiveSidebarShell({ sidebar, sidebarLabel = "sidebar", sidebarOpen, sidebarTogglePlacement = "main", defaultSidebarOpen, defaultSidebarWidth = sidebarDefaultWidth, onSidebarOpenChange, bar, error, showMainLabel = "Show main content", className, children, ref, style, ...props }) {
103
+ function ResponsiveSidebarShell({ sidebar, sidebarLabel = "sidebar", sidebarOpen, sidebarTogglePlacement = "main", defaultSidebarOpen, defaultSidebarWidth = sidebarDefaultWidth, onSidebarOpenChange, bar, contentBar = false, error, showMainLabel = "Show main content", className, children, ref, style, ...props }) {
102
104
  const sidebarId = React.useId();
103
105
  const rootRef = React.useRef(null);
104
106
  const mainRef = React.useRef(null);
105
107
  const openerRef = React.useRef(null);
108
+ const [barTarget, setBarTarget] = React.useState(null);
109
+ const lastBarFocus = React.useRef(null);
110
+ const restoreBarFocus = React.useCallback(() => {
111
+ const previous = lastBarFocus.current;
112
+ if (!previous || !barTarget?.isConnected) return;
113
+ if (previous.bar.isConnected && previous.bar.getClientRects().length) return;
114
+ const active = document.activeElement;
115
+ if (active instanceof HTMLElement && active !== document.body && active.getClientRects().length) return;
116
+ const bar = Array.from(barTarget.children).find((element) => element.getClientRects().length);
117
+ if (!bar) return;
118
+ const controls = Array.from(bar.querySelectorAll("button, a[href]"));
119
+ (controls.find((element) => previous.label && element.getAttribute("aria-label") === previous.label) ?? controls.find((element) => element.getAttribute("aria-haspopup") === "menu") ?? controls[0])?.focus({ preventScroll: true });
120
+ }, [barTarget]);
121
+ React.useLayoutEffect(restoreBarFocus);
106
122
  const [isSidebarOpen, setSidebarOpen, primeSidebarOpen] = useControllableSidebar({
107
123
  sidebarOpen,
108
124
  defaultSidebarOpen,
@@ -128,8 +144,8 @@ function ResponsiveSidebarShell({ sidebar, sidebarLabel = "sidebar", sidebarOpen
128
144
  updateSidebar(() => setSidebarOpen(false), () => mainRef.current?.focus({ preventScroll: true }));
129
145
  }, [setSidebarOpen, updateSidebar]);
130
146
  const closeSidebarOnCompact = React.useCallback(() => {
131
- if (rootRef.current && isCompactSidebar(rootRef.current)) closeSidebar();
132
- }, [closeSidebar]);
147
+ if (isSidebarOpen && rootRef.current && isCompactSidebar(rootRef.current)) closeSidebar();
148
+ }, [closeSidebar, isSidebarOpen]);
133
149
  const toggleSidebar = React.useCallback((trigger) => {
134
150
  if (trigger) openerRef.current = trigger;
135
151
  updateSidebar(() => setSidebarOpen(!isSidebarOpen));
@@ -145,12 +161,14 @@ function ResponsiveSidebarShell({ sidebar, sidebarLabel = "sidebar", sidebarOpen
145
161
  compact,
146
162
  contentCompact,
147
163
  closeSidebar,
148
- closeSidebarOnCompact
164
+ closeSidebarOnCompact,
165
+ restoreBarFocus
149
166
  }), [
150
167
  compact,
151
168
  contentCompact,
152
169
  closeSidebar,
153
- closeSidebarOnCompact
170
+ closeSidebarOnCompact,
171
+ restoreBarFocus
154
172
  ]);
155
173
  const sidebarContent = typeof sidebar === "function" ? sidebar(controls) : sidebar;
156
174
  const sidebarToggle = sidebarVisible && sidebarTogglePlacement === "sidebar" ? /* @__PURE__ */ jsx(Button, {
@@ -167,82 +185,147 @@ function ResponsiveSidebarShell({ sidebar, sidebarLabel = "sidebar", sidebarOpen
167
185
  onClick: (event) => toggleSidebar(event.currentTarget),
168
186
  children: /* @__PURE__ */ jsx(SidebarIcon, {})
169
187
  }) : null;
188
+ const renderBar = (slots, content = false) => /* @__PURE__ */ jsx(SidebarAppBar, {
189
+ bar: slots,
190
+ content,
191
+ hasSidebar,
192
+ sidebarTogglePlacement,
193
+ sidebarId,
194
+ isSidebarOpen,
195
+ toggleSidebar,
196
+ toggleLabel,
197
+ toggleTooltip
198
+ });
199
+ const outlet = contentBar && barTarget ? {
200
+ target: barTarget,
201
+ restoreFocus: restoreBarFocus,
202
+ render: (slots) => renderBar({
203
+ ...bar,
204
+ title: slots.title ?? bar?.title,
205
+ titleRender: bar?.titleRender ?? slots.titleRender,
206
+ leading: slots.leading ?? bar?.leading,
207
+ back: slots.leading != null ? void 0 : bar?.back,
208
+ compactLeading: slots.leading ?? bar?.compactLeading,
209
+ compactTitleTrigger: void 0,
210
+ actions: /* @__PURE__ */ jsxs(Fragment, { children: [slots.actions, bar?.actions] }),
211
+ primary: slots.primary ?? bar?.primary,
212
+ label: slots.label ?? bar?.label,
213
+ className: cx(bar?.className, slots.className)
214
+ }, true)
215
+ } : null;
170
216
  return /* @__PURE__ */ jsx(SidebarShellContext.Provider, {
171
217
  value: controls,
172
- children: /* @__PURE__ */ jsx("div", {
173
- ref: mergeRefs(rootRef, ref),
174
- className: cx("responsive-sidebar-shell", className),
175
- "data-recipe": "fill-host",
176
- style,
177
- ...props,
178
- "data-sidebar-open": sidebarVisible ? "true" : "false",
179
- "data-sidebar-toggle-placement": sidebarTogglePlacement,
180
- onKeyDown: (event) => {
181
- props.onKeyDown?.(event);
182
- if (!event.defaultPrevented && event.key === "Escape" && sidebarVisible && rootRef.current && isCompactSidebar(rootRef.current)) {
183
- event.preventDefault();
184
- dismissSidebar();
185
- }
186
- },
187
- children: /* @__PURE__ */ jsxs(ResizableSidePanel.Root, {
188
- className: "responsive-sidebar-shell__frame",
189
- label: sidebarLabel,
190
- side: "start",
191
- sizeVariable: "--responsive-sidebar-shell-sidebar-size",
192
- defaultSize: defaultSidebarWidth,
193
- minSize: sidebarMinWidth,
194
- maxSize: sidebarMaxWidth,
195
- keyboardStep: sidebarKeyboardStep,
196
- children: [
197
- sidebarVisible ? /* @__PURE__ */ jsx(ResizableSidePanel.Handle, { className: "responsive-sidebar-shell__resizer" }) : null,
198
- hasSidebar ? /* @__PURE__ */ jsx(SidebarPane, {
199
- id: sidebarId,
200
- open: isSidebarOpen,
201
- toggle: sidebarToggle,
202
- children: sidebarContent
203
- }) : null,
204
- /* @__PURE__ */ jsxs("div", {
205
- ref: mainRef,
206
- className: "responsive-sidebar-shell__main",
207
- "data-content-compact": String(contentCompact),
208
- tabIndex: -1,
209
- children: [
210
- /* @__PURE__ */ jsx(SidebarAppBar, {
211
- bar,
212
- hasSidebar,
213
- sidebarTogglePlacement,
214
- sidebarId,
215
- isSidebarOpen,
216
- toggleSidebar,
217
- toggleLabel,
218
- toggleTooltip
219
- }),
220
- error != null ? /* @__PURE__ */ jsxs("div", {
221
- className: "responsive-sidebar-shell__error",
222
- role: "alert",
223
- children: [/* @__PURE__ */ jsx(WarningIcon, { "aria-hidden": "true" }), /* @__PURE__ */ jsx("span", { children: error })]
224
- }) : null,
225
- children
226
- ]
227
- }),
228
- sidebarVisible ? /* @__PURE__ */ jsx(Button, {
229
- type: "button",
230
- variant: "ghost",
231
- color: "neutral",
232
- className: "responsive-sidebar-shell__peek",
233
- "aria-label": showMainLabel,
234
- onClick: closeSidebar
235
- }) : null
236
- ]
218
+ children: /* @__PURE__ */ jsx(ShellAppBarOutletContext.Provider, {
219
+ value: outlet,
220
+ children: /* @__PURE__ */ jsx("div", {
221
+ ref: mergeRefs(rootRef, ref),
222
+ className: cx("responsive-sidebar-shell", className),
223
+ "data-recipe": "fill-host",
224
+ style,
225
+ ...props,
226
+ "data-sidebar-open": sidebarVisible ? "true" : "false",
227
+ "data-sidebar-toggle-placement": sidebarTogglePlacement,
228
+ onKeyDown: (event) => {
229
+ props.onKeyDown?.(event);
230
+ if (!event.defaultPrevented && !event.nativeEvent.isComposing && event.nativeEvent.keyCode !== 229 && event.key === "Escape" && sidebarVisible && rootRef.current && isCompactSidebar(rootRef.current)) {
231
+ event.preventDefault();
232
+ dismissSidebar();
233
+ }
234
+ },
235
+ children: /* @__PURE__ */ jsxs(ResizableSidePanel.Root, {
236
+ className: "responsive-sidebar-shell__frame",
237
+ label: sidebarLabel,
238
+ side: "start",
239
+ sizeVariable: "--responsive-sidebar-shell-sidebar-size",
240
+ defaultSize: defaultSidebarWidth,
241
+ minSize: sidebarMinWidth,
242
+ maxSize: sidebarMaxWidth,
243
+ keyboardStep: sidebarKeyboardStep,
244
+ children: [
245
+ sidebarVisible ? /* @__PURE__ */ jsx(ResizableSidePanel.Handle, { className: "responsive-sidebar-shell__resizer" }) : null,
246
+ hasSidebar ? /* @__PURE__ */ jsx(SidebarPane, {
247
+ id: sidebarId,
248
+ open: isSidebarOpen,
249
+ toggle: sidebarToggle,
250
+ children: sidebarContent
251
+ }) : null,
252
+ /* @__PURE__ */ jsxs("div", {
253
+ ref: mainRef,
254
+ className: "responsive-sidebar-shell__main",
255
+ "data-content-compact": String(contentCompact),
256
+ tabIndex: -1,
257
+ onFocusCapture: (event) => {
258
+ const focusedBar = event.target.closest(".app-top-bar");
259
+ if (focusedBar && barTarget?.contains(focusedBar)) lastBarFocus.current = {
260
+ bar: focusedBar,
261
+ label: event.target.getAttribute("aria-label")
262
+ };
263
+ else if (!event.target.closest("[role=\"menu\"]")) lastBarFocus.current = null;
264
+ },
265
+ onPointerDownCapture: (event) => {
266
+ if (event.target instanceof Element && !barTarget?.contains(event.target) && !event.target.closest("[role=\"menu\"]")) lastBarFocus.current = null;
267
+ },
268
+ children: [
269
+ contentBar ? /* @__PURE__ */ jsx("div", {
270
+ className: "responsive-sidebar-shell__bar",
271
+ ref: setBarTarget,
272
+ children: renderBar(bar)
273
+ }) : renderBar(bar),
274
+ error != null ? /* @__PURE__ */ jsxs("div", {
275
+ className: "responsive-sidebar-shell__error",
276
+ role: "alert",
277
+ children: [/* @__PURE__ */ jsx(WarningIcon, { "aria-hidden": "true" }), /* @__PURE__ */ jsx("span", { children: error })]
278
+ }) : null,
279
+ children
280
+ ]
281
+ }),
282
+ sidebarVisible ? /* @__PURE__ */ jsx(Button, {
283
+ type: "button",
284
+ variant: "ghost",
285
+ color: "neutral",
286
+ className: "responsive-sidebar-shell__peek",
287
+ "aria-label": showMainLabel,
288
+ onClick: closeSidebar
289
+ }) : null
290
+ ]
291
+ })
237
292
  })
238
293
  })
239
294
  });
240
295
  }
241
- function SidebarAppBar({ bar, hasSidebar, sidebarTogglePlacement, sidebarId, isSidebarOpen, toggleSidebar, toggleLabel, toggleTooltip }) {
242
- const hasCustomLeading = bar?.leading != null;
296
+ /**
297
+ * A pane's title, Back control and actions share its enclosing shell's bar.
298
+ * Outside an opted-in workbench this renders a standalone application bar.
299
+ * A portal preserves the pane's state and providers without registering
300
+ * React nodes in ancestor state or rerendering the conversation on each action.
301
+ * Submit controls moved here must name their owning form with `form`.
302
+ */
303
+ function ResponsiveSidebarAppBar(props) {
304
+ const outlet = React.useContext(ContentAppBarOutletContext);
305
+ React.useLayoutEffect(() => {
306
+ if (!outlet) return;
307
+ outlet.restoreFocus();
308
+ return () => queueMicrotask(outlet.restoreFocus);
309
+ }, [outlet]);
310
+ if (outlet) return createPortal(outlet.render(props), outlet.target);
311
+ return /* @__PURE__ */ jsxs(AppTopBar.Root, {
312
+ "aria-label": props.label ?? "Application controls",
313
+ titleAlign: "start",
314
+ className: props.className,
315
+ children: [
316
+ props.leading != null ? /* @__PURE__ */ jsx(AppTopBar.Leading, { children: props.leading }) : null,
317
+ props.title != null ? /* @__PURE__ */ jsx(AppTopBar.Title, {
318
+ render: props.titleRender,
319
+ children: props.title
320
+ }) : null,
321
+ props.actions != null || props.primary != null ? /* @__PURE__ */ jsxs(AppTopBar.Trailing, { children: [props.actions, props.primary] }) : null
322
+ ]
323
+ });
324
+ }
325
+ function SidebarAppBar({ bar, content = false, hasSidebar, sidebarTogglePlacement, sidebarId, isSidebarOpen, toggleSidebar, toggleLabel, toggleTooltip }) {
243
326
  const hasTitleTrigger = hasSidebar && bar?.compactTitleTrigger != null && bar?.compactLeading == null;
244
- const mainSidebarToggle = hasSidebar && (sidebarTogglePlacement === "sidebar" || !hasCustomLeading || !isSidebarOpen) ? /* @__PURE__ */ jsx(AppTopBar.Button, {
245
- className: cx("responsive-sidebar-shell__toggle", sidebarToggleClassName(sidebarTogglePlacement, hasTitleTrigger, bar?.compactLeading != null)),
327
+ const mainSidebarToggle = hasSidebar ? /* @__PURE__ */ jsx(AppTopBar.Button, {
328
+ className: cx("responsive-sidebar-shell__toggle", sidebarTogglePlacement === "sidebar" && "responsive-sidebar-shell__toggle--sidebar-fallback"),
246
329
  label: toggleLabel,
247
330
  tooltip: toggleTooltip,
248
331
  type: "button",
@@ -257,6 +340,7 @@ function SidebarAppBar({ bar, hasSidebar, sidebarTogglePlacement, sidebarId, isS
257
340
  "aria-label": bar?.label ?? "Application controls",
258
341
  className: bar?.className,
259
342
  "data-compact-leading": compactLeadingMode,
343
+ "data-content-bar": content ? "" : void 0,
260
344
  children: [
261
345
  /* @__PURE__ */ jsx(SidebarAppBarLeading, {
262
346
  bar,
@@ -294,11 +378,6 @@ function SidebarAppBarTitle({ bar, hasTitleTrigger, sidebarId, isSidebarOpen, to
294
378
  }) : null]
295
379
  });
296
380
  }
297
- function sidebarToggleClassName(placement, hasTitleTrigger, hasCompactLeading) {
298
- if (placement === "sidebar") return "responsive-sidebar-shell__toggle--sidebar-fallback";
299
- if (hasTitleTrigger) return "responsive-sidebar-shell__toggle--replaced-by-title";
300
- if (hasCompactLeading) return "responsive-sidebar-shell__toggle--replaced-by-compact-leading";
301
- }
302
381
  function SidebarAppBarLeading({ bar, mainSidebarToggle, compactLeadingMode }) {
303
382
  const { contentCompact } = useResponsiveSidebarShell();
304
383
  const compactNavigationActive = contentCompact && compactLeadingMode === "custom";
@@ -310,11 +389,7 @@ function SidebarAppBarLeading({ bar, mainSidebarToggle, compactLeadingMode }) {
310
389
  render: bar.back.link,
311
390
  children: /* @__PURE__ */ jsx(ArrowLeftIcon, {})
312
391
  }) : null,
313
- compactNavigationActive ? null : bar?.leading,
314
- compactLeadingMode === "custom" ? /* @__PURE__ */ jsx("span", {
315
- className: "responsive-sidebar-shell__compact-leading",
316
- children: bar?.compactLeading
317
- }) : null
392
+ compactNavigationActive ? bar?.compactLeading : bar?.leading
318
393
  ] });
319
394
  }
320
395
  function hasSidebarAppBar(bar, hasSidebar) {
@@ -343,4 +418,4 @@ function SidebarPane({ id, open, toggle, children }) {
343
418
  });
344
419
  }
345
420
  //#endregion
346
- export { ResponsiveSidebarShell, useResponsiveSidebarShell };
421
+ export { ResponsiveSidebarAppBar, ResponsiveSidebarShell, useResponsiveSidebarShell };
@@ -1,8 +1,8 @@
1
1
  import { t as cx } from "../../class-names-BiMDVpUo.js";
2
+ import { ScrollArea } from "../foundations/ScrollArea.js";
2
3
  import { Q as TerminalIcon, rt as XIcon } from "../../icons-DvlrWt54.js";
3
4
  import { IconButton } from "../foundations/IconButton.js";
4
5
  import { t as CopyButton } from "../../copy-button-M4sAp9xS.js";
5
- import { ScrollArea } from "../foundations/ScrollArea.js";
6
6
  import * as React from "react";
7
7
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
8
8
  import Anser from "anser";
@@ -1,6 +1,6 @@
1
1
  import { F as MoonIcon, P as MonitorIcon, X as SunIcon } from "../../icons-DvlrWt54.js";
2
- import { useTheme } from "../foundations/ThemeProvider.js";
3
2
  import { Radio, RadioGroup } from "../foundations/RadioGroup.js";
3
+ import { useTheme } from "../foundations/ThemeProvider.js";
4
4
  import { jsx, jsxs } from "react/jsx-runtime";
5
5
  //#region src/components/general-purpose/ThemeModeControl.tsx
6
6
  const modes = [
@@ -1,9 +1,9 @@
1
1
  import { t as cx } from "../../class-names-BiMDVpUo.js";
2
2
  import { Collapsible } from "../foundations/Collapsible.js";
3
+ import { ScrollArea } from "../foundations/ScrollArea.js";
3
4
  import { H as RefreshIcon, f as ChevronDownIcon, i as ArrowRightIcon, r as ArrowLeftIcon } from "../../icons-DvlrWt54.js";
4
5
  import { IconButton } from "../foundations/IconButton.js";
5
6
  import { Input } from "../foundations/Input.js";
6
- import { ScrollArea } from "../foundations/ScrollArea.js";
7
7
  import * as React from "react";
8
8
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
9
9
  import { useRender } from "@base-ui/react/use-render";
@@ -1,6 +1,5 @@
1
1
  import { n as AgentToolRunValue } from "../../AgentToolRunsContext-DniwGn96.js";
2
2
  import { i as ThinkChatValue } from "../../ThinkChatContext-DQ6M2VlJ.js";
3
- import { SubagentRunMetadataProps } from "../agents-sdk/SubagentRunDetails.js";
4
3
  import * as React from "react";
5
4
  import { UIMessage } from "ai";
6
5
  import { UseAgentOptions, useAgent } from "agents/react";
@@ -27,14 +26,13 @@ export interface AgentToolDetailProps<State = unknown, MessageT extends UIMessag
27
26
  * rendered in the top bar's trailing slot after the status mark.
28
27
  */
29
28
  actions?: React.ReactNode;
30
- renderMilestone?: SubagentRunMetadataProps["renderMilestone"];
31
29
  }
32
30
  /**
33
31
  * Live retained-child detail composed from upstream connection and chat values.
34
32
  * The full child transcript comes from `chat.messages`; `run.parts` remains a
35
33
  * compact parent-side stream projection and is never promoted to fake history.
36
34
  */
37
- export declare function AgentToolDetail<State = unknown, MessageT extends UIMessage = UIMessage>({ actions, backLink, chat, className, ref, run, renderMilestone, ...props }: AgentToolDetailProps<State, MessageT> & {
35
+ export declare function AgentToolDetail<State = unknown, MessageT extends UIMessage = UIMessage>({ actions, backLink, chat, className, ref, run, ...props }: AgentToolDetailProps<State, MessageT> & {
38
36
  ref?: React.Ref<HTMLDivElement>;
39
37
  }): React.JSX.Element;
40
38
  export interface SelectedAgentToolChildProps<ParentAgentT extends ThinkAgent<ParentState>, ParentState = unknown, ChildState = unknown, MessageT extends UIMessage = UIMessage> {