@mcp-b/react-components 0.11.0 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (253) hide show
  1. package/dist/{AgentChat-B9LD_WF1.d.ts → AgentChat-Br6tKEl8.d.ts} +38 -10
  2. package/dist/{BrowserLiveView-ZktFZiMD.d.ts → BrowserLiveView-BV5qgFgI.d.ts} +11 -10
  3. package/dist/{BrowserReplay-6G-mnwcn.d.ts → BrowserReplay-xWvRjRAC.d.ts} +2 -1
  4. package/dist/{Button-Ct5I6aTu.d.ts → Button-FX_hpqxm.d.ts} +8 -11
  5. package/dist/{CodeBlock-XNQOupQ3.js → CodeBlock-BUFXG8HW.js} +22 -12
  6. package/dist/{CodeBlock-CxQXv3C4.d.ts → CodeBlock-DUh9WOGo.d.ts} +13 -7
  7. package/dist/{Combobox-D9anamNr.d.ts → Combobox-B9Fcd6q-.d.ts} +4 -14
  8. package/dist/{FileTree-wMyZhhHO.js → FileTree-mpEIcfzA.js} +1 -1
  9. package/dist/{Menu-B5vDqZe_.d.ts → Menu-Bgu-ufb5.d.ts} +29 -65
  10. package/dist/{ModelSelector-DXtpcRmT.js → ModelSelector-DVgVBdvw.js} +23 -20
  11. package/dist/{PromptInput-D6-G24p7.d.ts → PromptInput-p5KmOmt1.d.ts} +313 -89
  12. package/dist/Select-Dl_vF_Bt.d.ts +213 -0
  13. package/dist/{Tabs-D9EAq09D.d.ts → Tabs-3Zc4tb9D.d.ts} +9 -6
  14. package/dist/ThinkChat-7DQ2CogF.js +222 -0
  15. package/dist/{ThinkChatActivity-B2UD95My.d.ts → ThinkChatActivity-Cuk28Js_.d.ts} +4 -4
  16. package/dist/ThinkChatContext-C3Eb1Xpi.d.ts +16 -0
  17. package/dist/{ThinkChatToolParts-DnUiZgCC.d.ts → ThinkChatToolParts-Cv4o7j6F.d.ts} +13 -5
  18. package/dist/{attachment-preview-ChtC3HiU.js → attachment-preview-DIs50Q0h.js} +3 -3
  19. package/dist/components/Accordion.d.ts +17 -6
  20. package/dist/components/Accordion.js +23 -36
  21. package/dist/components/Activity.d.ts +5 -5
  22. package/dist/components/Activity.js +9 -9
  23. package/dist/components/AgentChat.d.ts +1 -1
  24. package/dist/components/AgentChat.js +354 -132
  25. package/dist/components/AgentConnection.js +6 -22
  26. package/dist/components/AlertDialog.d.ts +40 -32
  27. package/dist/components/AlertDialog.js +46 -39
  28. package/dist/components/Artifact.d.ts +1 -1
  29. package/dist/components/Artifact.js +5 -5
  30. package/dist/components/Autocomplete.js +10 -2
  31. package/dist/components/Avatar.d.ts +2 -2
  32. package/dist/components/Avatar.js +3 -3
  33. package/dist/components/Badge.d.ts +11 -14
  34. package/dist/components/Badge.js +11 -33
  35. package/dist/components/BrowserLiveView.d.ts +1 -1
  36. package/dist/components/BrowserLiveView.js +39 -45
  37. package/dist/components/BrowserReplay.d.ts +1 -1
  38. package/dist/components/BrowserReplay.js +4 -4
  39. package/dist/components/BrowserRunPanel.js +91 -55
  40. package/dist/components/Button.d.ts +2 -2
  41. package/dist/components/Button.js +7 -30
  42. package/dist/components/ChainOfThought.d.ts +5 -5
  43. package/dist/components/ChainOfThought.js +8 -5
  44. package/dist/components/ChatGptSignInScreen.js +3 -3
  45. package/dist/components/Checkbox.d.ts +10 -2
  46. package/dist/components/Checkbox.js +13 -6
  47. package/dist/components/CheckboxGroup.d.ts +6 -6
  48. package/dist/components/CheckboxGroup.js +6 -6
  49. package/dist/components/CodeBlock.d.ts +1 -1
  50. package/dist/components/CodeBlock.js +1 -1
  51. package/dist/components/CodexModelSelector.d.ts +58 -0
  52. package/dist/components/CodexModelSelector.js +170 -0
  53. package/dist/components/Collapsible.d.ts +2 -4
  54. package/dist/components/Collapsible.js +9 -7
  55. package/dist/components/Combobox.d.ts +2 -2
  56. package/dist/components/Combobox.js +20 -22
  57. package/dist/components/Commit.d.ts +6 -6
  58. package/dist/components/Commit.js +14 -26
  59. package/dist/components/Context.js +5 -1
  60. package/dist/components/ContextMenu.d.ts +20 -72
  61. package/dist/components/ContextMenu.js +46 -56
  62. package/dist/components/Conversation.d.ts +3 -7
  63. package/dist/components/Conversation.js +3 -4
  64. package/dist/components/Dialog.d.ts +38 -30
  65. package/dist/components/Dialog.js +46 -34
  66. package/dist/components/EnvironmentVariables.d.ts +2 -7
  67. package/dist/components/EnvironmentVariables.js +13 -36
  68. package/dist/components/Field.d.ts +3 -3
  69. package/dist/components/Field.js +7 -8
  70. package/dist/components/Fieldset.d.ts +2 -2
  71. package/dist/components/Fieldset.js +2 -2
  72. package/dist/components/FileTree.js +1 -1
  73. package/dist/components/Label.d.ts +1 -1
  74. package/dist/components/Label.js +1 -1
  75. package/dist/components/Marker.js +1 -15
  76. package/dist/components/McpServerPicker.d.ts +31 -6
  77. package/dist/components/McpServerPicker.js +136 -72
  78. package/dist/components/Menu.d.ts +2 -2
  79. package/dist/components/Menu.js +41 -51
  80. package/dist/components/Menubar.d.ts +16 -52
  81. package/dist/components/Menubar.js +44 -56
  82. package/dist/components/Message.d.ts +4 -3
  83. package/dist/components/Message.js +16 -9
  84. package/dist/components/MessageScroller.d.ts +1 -1
  85. package/dist/components/MessageScroller.js +1 -1
  86. package/dist/components/Meter.js +5 -0
  87. package/dist/components/ModelSelector.d.ts +12 -9
  88. package/dist/components/ModelSelector.js +1 -1
  89. package/dist/components/NavigationMenu.d.ts +3 -14
  90. package/dist/components/NavigationMenu.js +22 -38
  91. package/dist/components/NumberField.js +6 -0
  92. package/dist/components/Popover.d.ts +21 -44
  93. package/dist/components/Popover.js +33 -23
  94. package/dist/components/PreviewCard.d.ts +20 -18
  95. package/dist/components/PreviewCard.js +30 -20
  96. package/dist/components/PricingPage.js +30 -29
  97. package/dist/components/Progress.d.ts +7 -3
  98. package/dist/components/Progress.js +9 -4
  99. package/dist/components/PromptInput.d.ts +2 -2
  100. package/dist/components/PromptInput.js +184 -148
  101. package/dist/components/Queue.d.ts +8 -19
  102. package/dist/components/Queue.js +6 -6
  103. package/dist/components/RadioGroup.d.ts +10 -9
  104. package/dist/components/RadioGroup.js +8 -9
  105. package/dist/components/Reasoning.d.ts +4 -4
  106. package/dist/components/Reasoning.js +12 -21
  107. package/dist/components/ScrollArea.d.ts +2 -9
  108. package/dist/components/ScrollArea.js +5 -23
  109. package/dist/components/Select.d.ts +2 -2
  110. package/dist/components/Select.js +100 -134
  111. package/dist/components/Slider.d.ts +10 -7
  112. package/dist/components/Slider.js +12 -11
  113. package/dist/components/Sources.d.ts +4 -4
  114. package/dist/components/Sources.js +8 -5
  115. package/dist/components/Stepper.js +2 -8
  116. package/dist/components/Switch.d.ts +6 -3
  117. package/dist/components/Switch.js +7 -4
  118. package/dist/components/Tabs.d.ts +2 -2
  119. package/dist/components/Tabs.js +9 -4
  120. package/dist/components/Task.d.ts +4 -4
  121. package/dist/components/Task.js +10 -6
  122. package/dist/components/Terminal.d.ts +2 -2
  123. package/dist/components/Terminal.js +5 -5
  124. package/dist/components/TestResults.d.ts +4 -4
  125. package/dist/components/TestResults.js +5 -5
  126. package/dist/components/ThinkChat.d.ts +37 -30
  127. package/dist/components/ThinkChat.js +1 -152
  128. package/dist/components/ThinkChatActivity.d.ts +2 -2
  129. package/dist/components/ThinkChatActivity.js +4 -11
  130. package/dist/components/ThinkChatContext.d.ts +2 -2
  131. package/dist/components/ThinkChatContext.js +9 -2
  132. package/dist/components/ThinkChatToolPanels.d.ts +1 -1
  133. package/dist/components/ThinkChatToolPanels.js +27 -15
  134. package/dist/components/ThinkChatToolParts.d.ts +1 -1
  135. package/dist/components/ThinkExecutionWorkbench.d.ts +10 -7
  136. package/dist/components/ThinkExecutionWorkbench.js +382 -359
  137. package/dist/components/ThinkFullApp.d.ts +16 -13
  138. package/dist/components/ThinkFullApp.js +35 -25
  139. package/dist/components/ThinkThreadPicker.d.ts +1 -31
  140. package/dist/components/ThinkThreadPicker.js +32 -171
  141. package/dist/components/ThinkThreadShell.d.ts +35 -0
  142. package/dist/components/ThinkThreadShell.js +146 -0
  143. package/dist/components/Toast.js +7 -0
  144. package/dist/components/ToggleGroup.d.ts +6 -2
  145. package/dist/components/ToggleGroup.js +6 -2
  146. package/dist/components/Toolbar.js +6 -0
  147. package/dist/components/Tooltip.d.ts +36 -27
  148. package/dist/components/Tooltip.js +45 -29
  149. package/dist/components/WebPreview.d.ts +1 -1
  150. package/dist/components/WebPreview.js +3 -3
  151. package/dist/components/WorkspaceExplorer.d.ts +6 -8
  152. package/dist/components/WorkspaceExplorer.js +9 -7
  153. package/dist/components/icons.d.ts +2 -2
  154. package/dist/components/icons.js +2 -2
  155. package/dist/{copy-button-C6JSKtFE.js → copy-button-DUMLYdsk.js} +7 -6
  156. package/dist/{copy-button-BKXqGiNm.d.ts → copy-button-DtPMgN7e.d.ts} +3 -2
  157. package/dist/icons-Ba9THQKz.js +64 -0
  158. package/dist/icons-CUCz_Sft.d.ts +210 -0
  159. package/dist/merge-refs-DF_7w2x_.js +18 -0
  160. package/dist/styles/accessibility.css +14 -0
  161. package/dist/styles/accordion.css +21 -61
  162. package/dist/styles/activity.css +23 -58
  163. package/dist/styles/agent-chat.css +49 -5
  164. package/dist/styles/agent-connection.css +8 -10
  165. package/dist/styles/alert-dialog.css +20 -26
  166. package/dist/styles/artifact.css +6 -6
  167. package/dist/styles/attachment-preview.css +1 -1
  168. package/dist/styles/autocomplete.css +5 -170
  169. package/dist/styles/avatar.css +8 -8
  170. package/dist/styles/badge.css +8 -10
  171. package/dist/styles/base-ui-motion.css +176 -0
  172. package/dist/styles/base.css +19 -25
  173. package/dist/styles/browser-live-view.css +7 -7
  174. package/dist/styles/browser-replay.css +5 -5
  175. package/dist/styles/browser-run-panel.css +59 -112
  176. package/dist/styles/button.css +48 -43
  177. package/dist/styles/card.css +3 -5
  178. package/dist/styles/chain-of-thought.css +14 -70
  179. package/dist/styles/chatgpt-sign-in-screen.css +3 -3
  180. package/dist/styles/checkbox-group.css +1 -1
  181. package/dist/styles/checkbox.css +3 -7
  182. package/dist/styles/code-block.css +10 -10
  183. package/dist/styles/codex-model-selector.css +186 -0
  184. package/dist/styles/collapsible.css +11 -27
  185. package/dist/styles/combobox.css +3 -149
  186. package/dist/styles/commit.css +19 -35
  187. package/dist/styles/context-menu.css +1 -77
  188. package/dist/styles/context.css +12 -12
  189. package/dist/styles/conversation.css +7 -7
  190. package/dist/styles/dialog.css +34 -55
  191. package/dist/styles/environment-variables.css +10 -10
  192. package/dist/styles/field.css +16 -58
  193. package/dist/styles/fieldset.css +2 -2
  194. package/dist/styles/file-tree.css +7 -9
  195. package/dist/styles/index.css +12 -2
  196. package/dist/styles/input.css +1 -51
  197. package/dist/styles/label.css +2 -2
  198. package/dist/styles/marker.css +2 -4
  199. package/dist/styles/mcp-server-picker.css +66 -19
  200. package/dist/styles/menu.css +6 -153
  201. package/dist/styles/menubar.css +6 -105
  202. package/dist/styles/message-scroller.css +1 -1
  203. package/dist/styles/message.css +87 -9
  204. package/dist/styles/meter.css +4 -20
  205. package/dist/styles/model-selector.css +32 -20
  206. package/dist/styles/navigation-menu.css +14 -54
  207. package/dist/styles/number-field.css +8 -23
  208. package/dist/styles/popover.css +13 -68
  209. package/dist/styles/preview-card.css +5 -46
  210. package/dist/styles/pricing-page.css +43 -43
  211. package/dist/styles/progress.css +7 -16
  212. package/dist/styles/prompt-input.css +100 -44
  213. package/dist/styles/queue.css +12 -28
  214. package/dist/styles/radio.css +4 -8
  215. package/dist/styles/reasoning.css +3 -62
  216. package/dist/styles/recipes.css +475 -0
  217. package/dist/styles/select.css +7 -103
  218. package/dist/styles/shell.css +3 -3
  219. package/dist/styles/slider.css +5 -7
  220. package/dist/styles/sources.css +9 -66
  221. package/dist/styles/stepper.css +16 -14
  222. package/dist/styles/streamdown.css +11 -57
  223. package/dist/styles/switch.css +4 -7
  224. package/dist/styles/tabs.css +7 -8
  225. package/dist/styles/task.css +13 -42
  226. package/dist/styles/terminal.css +7 -7
  227. package/dist/styles/test-results.css +21 -37
  228. package/dist/styles/think-execution-workbench.css +337 -0
  229. package/dist/styles/think-full-app.css +27 -410
  230. package/dist/styles/think-resize-handle.css +33 -0
  231. package/dist/styles/think-thread-picker.css +18 -247
  232. package/dist/styles/think-thread-shell.css +219 -0
  233. package/dist/styles/toast.css +14 -25
  234. package/dist/styles/toggle-group.css +16 -14
  235. package/dist/styles/toggle.css +14 -15
  236. package/dist/styles/toolbar.css +13 -25
  237. package/dist/styles/tooltip.css +6 -16
  238. package/dist/styles/web-preview.css +15 -15
  239. package/dist/styles/workspace-explorer.css +21 -14
  240. package/dist/summarize-tool-input-BUJsENSn.js +12 -0
  241. package/dist/utils/codex-model-catalog.d.ts +142 -0
  242. package/dist/utils/codex-model-catalog.js +112 -0
  243. package/dist/utils/structured-code.d.ts +1 -1
  244. package/package.json +8 -2
  245. package/dist/Select-CRsKCJ9x.d.ts +0 -200
  246. package/dist/ThinkChatContext-BLAAb8J5.d.ts +0 -28
  247. package/dist/components/McpServerConnections.d.ts +0 -41
  248. package/dist/components/McpServerConnections.js +0 -188
  249. package/dist/components/useStickToBottom.d.ts +0 -33
  250. package/dist/components/useStickToBottom.js +0 -107
  251. package/dist/icons-CbjtbIJK.d.ts +0 -51
  252. package/dist/icons-D2Q5n5C1.js +0 -291
  253. package/dist/styles/mcp-server-connections.css +0 -145
@@ -1,41 +1,44 @@
1
1
  import { WorkspaceSource } from "./WorkspaceExplorer.js";
2
2
  import { ThinkChatMessagesProps } from "./ThinkChat.js";
3
- import { ThinkExecutionAgent, ThinkExecutionWorkbench, ThinkExecutionWorkbenchProps, ThinkExecutionWorkbenchSource } from "./ThinkExecutionWorkbench.js";
4
3
  import * as React from "react";
5
4
  import { useAgentChat } from "@cloudflare/think/react";
6
5
  import { UIMessage } from "ai";
7
6
  import { useAgent } from "agents/react";
8
7
  import { Think } from "@cloudflare/think";
9
8
 
9
+ //#region src/components/_internal/think-agent.d.ts
10
+ /** Shared complete Think specialization for stateful React agent hooks. */
11
+ type ThinkAgent<State = unknown> = Think<object, State>;
12
+ //#endregion
10
13
  //#region src/components/ThinkFullApp.d.ts
11
- type ThinkFullAppAgent<State = unknown> = Think<object, State>;
14
+ type ThinkFullAppAgent<State = unknown> = ThinkAgent<State>;
12
15
  type ThinkFullAppWorkbenchView = "files" | "execution" | (string & {});
13
- interface ThinkFullAppPanelContext<AgentT extends ThinkFullAppAgent<State>, State = unknown> {
16
+ interface ThinkFullAppPanelContext<AgentT extends ThinkFullAppAgent<State>, State = unknown, MessageT extends UIMessage = UIMessage> {
14
17
  agent: ReturnType<typeof useAgent<AgentT, State>>;
15
- chat: ReturnType<typeof useAgentChat<State, UIMessage>>;
18
+ chat: ReturnType<typeof useAgentChat<State, MessageT>>;
16
19
  workspace?: WorkspaceSource;
17
20
  workspaceRoot?: string;
18
21
  }
19
- interface ThinkFullAppPanel<AgentT extends ThinkFullAppAgent<State>, State = unknown> {
22
+ interface ThinkFullAppPanel<AgentT extends ThinkFullAppAgent<State>, State = unknown, MessageT extends UIMessage = UIMessage> {
20
23
  /** Unique panel id used by `workbenchView`; custom panels should not reuse built-in ids. */
21
24
  id: ThinkFullAppWorkbenchView;
22
25
  label: string;
23
26
  icon: React.ReactNode;
24
- render: (context: ThinkFullAppPanelContext<AgentT, State>) => React.ReactNode;
27
+ render: (context: ThinkFullAppPanelContext<AgentT, State, MessageT>) => React.ReactNode;
25
28
  }
26
- interface ThinkFullAppProps<AgentT extends ThinkFullAppAgent<State>, State = unknown> extends React.HTMLAttributes<HTMLDivElement> {
29
+ interface ThinkFullAppProps<AgentT extends ThinkFullAppAgent<State>, State = unknown, MessageT extends UIMessage = UIMessage> extends React.HTMLAttributes<HTMLDivElement> {
27
30
  /** The `useAgent` value from `agents/react`; its stub drives approvals and execution records. */
28
31
  agent: ReturnType<typeof useAgent<AgentT, State>>;
29
32
  /** The `useAgentChat` value from `@cloudflare/think/react` used by the chat surface. */
30
- chat: ReturnType<typeof useAgentChat<State, UIMessage>>;
33
+ chat: ReturnType<typeof useAgentChat<State, MessageT>>;
31
34
  /** Optional workspace source shown in the file explorer pane. */
32
35
  workspace?: WorkspaceSource;
33
36
  /** Root path passed to the workspace explorer. */
34
37
  workspaceRoot?: string;
35
38
  /** Message rendering labels and approval overrides for ThinkChat. */
36
- messages?: ThinkChatMessagesProps;
39
+ messages?: ThinkChatMessagesProps<MessageT>;
37
40
  /** Extra workbench panels appended after the built-in Files and Execution panels. */
38
- workbenchPanels?: readonly ThinkFullAppPanel<AgentT, State>[];
41
+ workbenchPanels?: readonly ThinkFullAppPanel<AgentT, State, MessageT>[];
39
42
  /** Optional parent-owned thread picker/sidebar rendered beside the selected child app. */
40
43
  threadSidebar?: React.ReactNode;
41
44
  /** Whether the thread sidebar is open. Omit for internal state. */
@@ -52,7 +55,7 @@ interface ThinkFullAppProps<AgentT extends ThinkFullAppAgent<State>, State = unk
52
55
  onWorkbenchViewChange?: (view: ThinkFullAppWorkbenchView) => void;
53
56
  }
54
57
  /** Combines ThinkChat with an optional resizable workbench shell. */
55
- declare function ThinkFullApp<AgentT extends ThinkFullAppAgent<State>, State = unknown>({
58
+ declare function ThinkFullApp<AgentT extends ThinkFullAppAgent<State>, State = unknown, MessageT extends UIMessage = UIMessage>({
56
59
  agent,
57
60
  chat,
58
61
  className,
@@ -70,8 +73,8 @@ declare function ThinkFullApp<AgentT extends ThinkFullAppAgent<State>, State = u
70
73
  workspace,
71
74
  workspaceRoot,
72
75
  ...props
73
- }: ThinkFullAppProps<AgentT, State> & {
76
+ }: ThinkFullAppProps<AgentT, State, MessageT> & {
74
77
  ref?: React.Ref<HTMLDivElement>;
75
78
  }): React.JSX.Element;
76
79
  //#endregion
77
- export { type ThinkExecutionAgent, ThinkExecutionWorkbench, type ThinkExecutionWorkbenchProps, type ThinkExecutionWorkbenchSource, ThinkFullApp, ThinkFullAppAgent, ThinkFullAppPanel, ThinkFullAppPanelContext, ThinkFullAppProps, ThinkFullAppWorkbenchView };
80
+ export { ThinkFullApp, ThinkFullAppAgent, ThinkFullAppPanel, ThinkFullAppPanelContext, ThinkFullAppProps, ThinkFullAppWorkbenchView };
@@ -1,12 +1,13 @@
1
1
  import { t as cx } from "../class-names-9UtZwb0J.js";
2
- import { P as TerminalIcon, h as FileIcon, n as ArrowLeftIcon } from "../icons-D2Q5n5C1.js";
2
+ import { I as TerminalIcon, h as FileIcon, n as ArrowLeftIcon } from "../icons-Ba9THQKz.js";
3
+ import { Separator } from "./Separator.js";
3
4
  import { Button } from "./Button.js";
4
- import { Tooltip, TooltipPopup, TooltipPortal, TooltipPositioner, TooltipTrigger } from "./Tooltip.js";
5
- import { ToggleGroup, ToggleGroupItem } from "./ToggleGroup.js";
5
+ import { Tooltip } from "./Tooltip.js";
6
+ import { ToggleGroup } from "./ToggleGroup.js";
7
+ import { o as useThinkPendingApprovals, s as resolveThinkApprovalProps, t as ThinkChat } from "../ThinkChat-7DQ2CogF.js";
6
8
  import { WorkspaceExplorer, useWorkspace } from "./WorkspaceExplorer.js";
7
- import { ThinkChat, useThinkPendingApprovals } from "./ThinkChat.js";
8
9
  import { ThinkExecutionWorkbench } from "./ThinkExecutionWorkbench.js";
9
- import { ThinkThreadShell } from "./ThinkThreadPicker.js";
10
+ import { ThinkThreadShell } from "./ThinkThreadShell.js";
10
11
  import * as React from "react";
11
12
  import { jsx, jsxs } from "react/jsx-runtime";
12
13
  //#region src/components/ThinkFullApp.tsx
@@ -27,9 +28,9 @@ function beginWorkbenchPanelResize(event, current, apply) {
27
28
  window.removeEventListener("pointermove", onMove);
28
29
  window.removeEventListener("pointerup", onUp);
29
30
  window.removeEventListener("pointercancel", onUp);
30
- document.body.classList.remove("is-resizing-columns");
31
+ document.body.classList.remove("is-resizing-think-full-app");
31
32
  };
32
- document.body.classList.add("is-resizing-columns");
33
+ document.body.classList.add("is-resizing-think-full-app");
33
34
  window.addEventListener("pointermove", onMove);
34
35
  window.addEventListener("pointerup", onUp);
35
36
  window.addEventListener("pointercancel", onUp);
@@ -56,20 +57,20 @@ function WorkspacePanel({ source, root }) {
56
57
  });
57
58
  }
58
59
  function WorkbenchViewItem({ children, label, value }) {
59
- return /* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsx(TooltipTrigger, { render: /* @__PURE__ */ jsx(ToggleGroupItem, {
60
+ return /* @__PURE__ */ jsxs(Tooltip.Root, { children: [/* @__PURE__ */ jsx(Tooltip.Trigger, { render: /* @__PURE__ */ jsx(ToggleGroup.Item, {
60
61
  type: "button",
61
62
  className: "think-full-app__workbench-view-item",
62
63
  value,
63
64
  "aria-label": label,
64
65
  children
65
- }) }), /* @__PURE__ */ jsx(TooltipPortal, { children: /* @__PURE__ */ jsx(TooltipPositioner, {
66
+ }) }), /* @__PURE__ */ jsx(Tooltip.Portal, { children: /* @__PURE__ */ jsx(Tooltip.Positioner, {
66
67
  side: "bottom",
67
68
  sideOffset: 6,
68
- children: /* @__PURE__ */ jsx(TooltipPopup, { children: label })
69
+ children: /* @__PURE__ */ jsx(Tooltip.Popup, { children: label })
69
70
  }) })] });
70
71
  }
71
72
  function WorkbenchViewSwitch({ panels, value, onValueChange }) {
72
- return /* @__PURE__ */ jsx(ToggleGroup, {
73
+ return /* @__PURE__ */ jsx(ToggleGroup.Root, {
73
74
  className: "think-full-app__workbench-view-switch",
74
75
  size: "sm",
75
76
  value: [value],
@@ -88,13 +89,24 @@ function WorkbenchViewSwitch({ panels, value, onValueChange }) {
88
89
  /** Combines ThinkChat with an optional resizable workbench shell. */
89
90
  function ThinkFullApp({ agent, chat, className, defaultWorkbenchView, defaultThreadSidebarOpen, messages, onThreadSidebarOpenChange, onWorkbenchViewChange, ref, style, threadSidebar, threadSidebarOpen, workbenchPanels, workbenchView, workspace, workspaceRoot, ...props }) {
90
91
  const approvals = useThinkPendingApprovals(agent.stub, `${chat.messages.length}:${chat.status}`);
91
- const resolvedMessages = React.useMemo(() => ({
92
- ...messages,
93
- executionApprovals: messages?.executionApprovals ?? approvals.executionApprovals,
94
- pendingApprovals: messages?.pendingApprovals ?? approvals.pendingApprovals
95
- }), [
96
- approvals.executionApprovals,
92
+ const resolvedMessages = React.useMemo(() => {
93
+ const approvalProps = resolveThinkApprovalProps({
94
+ thinkStub: messages?.thinkStub,
95
+ pendingApprovals: messages?.pendingApprovals,
96
+ onExecutionSettled: messages?.onExecutionSettled
97
+ }, {
98
+ thinkStub: agent.stub,
99
+ pendingApprovals: approvals.pendingApprovals,
100
+ onExecutionSettled: approvals.refreshPendingApprovals
101
+ });
102
+ return {
103
+ ...messages,
104
+ ...approvalProps
105
+ };
106
+ }, [
107
+ agent.stub,
97
108
  approvals.pendingApprovals,
109
+ approvals.refreshPendingApprovals,
98
110
  messages
99
111
  ]);
100
112
  const [mobileView, setMobileView] = React.useState("chat");
@@ -160,9 +172,7 @@ function ThinkFullApp({ agent, chat, className, defaultWorkbenchView, defaultThr
160
172
  const app = /* @__PURE__ */ jsxs("div", {
161
173
  ref,
162
174
  className: cx("think-full-app", className),
163
- "data-has-files": hasWorkspace ? "true" : "false",
164
175
  "data-has-thread-sidebar": threadSidebar ? "true" : "false",
165
- "data-has-workbench": "true",
166
176
  "data-has-workbench-topbar": showWorkbenchViewSwitch ? "true" : "false",
167
177
  "data-mobile-view": activeMobileView,
168
178
  style: rootStyle,
@@ -220,15 +230,15 @@ function ThinkFullApp({ agent, chat, className, defaultWorkbenchView, defaultThr
220
230
  })
221
231
  })
222
232
  }),
223
- /* @__PURE__ */ jsx("button", {
224
- type: "button",
225
- role: "separator",
233
+ /* @__PURE__ */ jsx(Separator, {
234
+ decorative: false,
235
+ orientation: "vertical",
236
+ tabIndex: 0,
226
237
  "aria-label": "Resize workbench panel",
227
- "aria-orientation": "vertical",
228
238
  "aria-valuemin": workbenchPanelMinWidth,
229
239
  "aria-valuemax": workbenchPanelMaxWidth,
230
240
  "aria-valuenow": workbenchPanelWidth,
231
- className: "think-full-app__resizer",
241
+ className: "think-resize-handle think-full-app__resizer",
232
242
  onPointerDown: (event) => beginWorkbenchPanelResize(event, workbenchPanelWidth, setWorkbenchPanelWidth),
233
243
  onKeyDown: (event) => {
234
244
  if (event.key === "ArrowLeft") {
@@ -270,4 +280,4 @@ function ThinkFullApp({ agent, chat, className, defaultWorkbenchView, defaultThr
270
280
  });
271
281
  }
272
282
  //#endregion
273
- export { ThinkExecutionWorkbench, ThinkFullApp };
283
+ export { ThinkFullApp };
@@ -33,16 +33,6 @@ interface ThinkThreadPickerProps extends Omit<React.HTMLAttributes<HTMLElement>,
33
33
  /** Accessible label for the list navigation. */
34
34
  "aria-label"?: string;
35
35
  }
36
- interface ThinkThreadShellProps extends React.HTMLAttributes<HTMLDivElement> {
37
- /** Thread picker or app-owned sidebar shown beside the selected child shell. */
38
- sidebar: React.ReactNode;
39
- /** Whether the thread drawer is open. Omit for internal state. */
40
- sidebarOpen?: boolean;
41
- /** Initial thread drawer state when `sidebarOpen` is uncontrolled. */
42
- defaultSidebarOpen?: boolean;
43
- /** Called when the thread drawer is opened or closed. */
44
- onSidebarOpenChange?: (open: boolean) => void;
45
- }
46
36
  /**
47
37
  * Thread roster UI for sub-agent chat apps.
48
38
  *
@@ -64,25 +54,5 @@ declare function ThinkThreadPicker({
64
54
  }: ThinkThreadPickerProps & {
65
55
  ref?: React.Ref<HTMLElement>;
66
56
  }): React.JSX.Element;
67
- /**
68
- * Layout wrapper for a thread picker beside one selected `ThinkFullApp`.
69
- *
70
- * Mobile keeps the drawer at about 80% width so the selected chat remains
71
- * visible as a preview. It only owns layout; callers still own the parent agent,
72
- * selected child agent, chat hook, and shared workspace.
73
- */
74
- declare function ThinkThreadShell({
75
- sidebar,
76
- sidebarOpen,
77
- defaultSidebarOpen,
78
- onSidebarOpenChange,
79
- className,
80
- children,
81
- ref,
82
- style,
83
- ...props
84
- }: ThinkThreadShellProps & {
85
- ref?: React.Ref<HTMLDivElement>;
86
- }): React.JSX.Element;
87
57
  //#endregion
88
- export { ThinkThreadItem, ThinkThreadPicker, ThinkThreadPickerProps, ThinkThreadShell, ThinkThreadShellProps };
58
+ export { ThinkThreadItem, ThinkThreadPicker, ThinkThreadPickerProps };
@@ -1,42 +1,10 @@
1
1
  import { t as cx } from "../class-names-9UtZwb0J.js";
2
- import { M as SpinnerIcon, O as PlusIcon, j as SidebarIcon, u as DotIcon } from "../icons-D2Q5n5C1.js";
2
+ import { N as SpinnerIcon, k as PlusIcon, u as DotIcon } from "../icons-Ba9THQKz.js";
3
3
  import { Button } from "./Button.js";
4
- import { Tooltip, TooltipPopup, TooltipPortal, TooltipPositioner, TooltipTrigger } from "./Tooltip.js";
5
4
  import { ScrollArea } from "./ScrollArea.js";
6
- import * as React from "react";
5
+ import "react";
7
6
  import { jsx, jsxs } from "react/jsx-runtime";
8
7
  //#region src/components/ThinkThreadPicker.tsx
9
- const threadSidebarDefaultWidth = 256;
10
- const threadSidebarMinWidth = 224;
11
- const threadSidebarMaxWidth = 384;
12
- const threadSidebarKeyboardStep = 24;
13
- function useControllableSidebar({ sidebarOpen, defaultSidebarOpen, onSidebarOpenChange }) {
14
- const [innerOpen, setInnerOpen] = React.useState(defaultSidebarOpen ?? true);
15
- return [sidebarOpen ?? innerOpen, React.useCallback((next) => {
16
- if (sidebarOpen === void 0) setInnerOpen(next);
17
- onSidebarOpenChange?.(next);
18
- }, [sidebarOpen, onSidebarOpenChange])];
19
- }
20
- function clampThreadSidebarWidth(width) {
21
- return Math.min(threadSidebarMaxWidth, Math.max(threadSidebarMinWidth, width));
22
- }
23
- function beginThreadSidebarResize(event, current, apply) {
24
- event.preventDefault();
25
- const startX = event.clientX;
26
- const onMove = (move) => {
27
- apply(clampThreadSidebarWidth(current + move.clientX - startX));
28
- };
29
- const onUp = () => {
30
- window.removeEventListener("pointermove", onMove);
31
- window.removeEventListener("pointerup", onUp);
32
- window.removeEventListener("pointercancel", onUp);
33
- document.body.classList.remove("is-resizing-columns");
34
- };
35
- document.body.classList.add("is-resizing-columns");
36
- window.addEventListener("pointermove", onMove);
37
- window.addEventListener("pointerup", onUp);
38
- window.addEventListener("pointercancel", onUp);
39
- }
40
8
  function toThreadDate(value) {
41
9
  if (value === void 0) return void 0;
42
10
  const date = value instanceof Date ? value : new Date(value);
@@ -116,38 +84,35 @@ function ThinkThreadPicker({ threads, selectedId, onSelect, onCreate, className,
116
84
  const timestamp = formatThreadTimestamp(thread);
117
85
  const statusLabel = formatThreadStatus(thread);
118
86
  const busy = isThreadBusy(thread.status);
119
- return /* @__PURE__ */ jsx("li", {
120
- className: "think-thread-picker__item",
121
- children: /* @__PURE__ */ jsxs(Button, {
122
- type: "button",
123
- variant: "ghost",
124
- color: "neutral",
125
- size: "sm",
126
- className: "think-thread-picker__thread",
127
- "data-selected": thread.id === selectedId ? "true" : "false",
128
- "data-status": thread.status,
129
- "aria-current": thread.id === selectedId ? "page" : void 0,
130
- onClick: () => onSelect(thread.id),
131
- children: [/* @__PURE__ */ jsx("span", {
132
- className: "think-thread-picker__thread-title",
133
- children: thread.title
134
- }), statusLabel ? /* @__PURE__ */ jsx("span", {
135
- className: "think-thread-picker__thread-status",
136
- role: "img",
137
- "aria-label": statusLabel,
138
- title: statusLabel,
139
- children: busy ? /* @__PURE__ */ jsx(SpinnerIcon, {}) : /* @__PURE__ */ jsx(DotIcon, {})
140
- }) : timestamp?.date ? /* @__PURE__ */ jsx("time", {
141
- className: "think-thread-picker__thread-time",
142
- dateTime: timestamp.date.toISOString(),
143
- title: timestamp.date.toLocaleString(),
144
- children: timestamp.label
145
- }) : timestamp ? /* @__PURE__ */ jsx("span", {
146
- className: "think-thread-picker__thread-time",
147
- children: timestamp.label
148
- }) : null]
149
- })
150
- }, thread.id);
87
+ return /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs(Button, {
88
+ type: "button",
89
+ variant: "ghost",
90
+ color: "neutral",
91
+ size: "sm",
92
+ className: "think-thread-picker__thread",
93
+ "data-selected": thread.id === selectedId ? "true" : "false",
94
+ "data-status": thread.status,
95
+ "aria-current": thread.id === selectedId ? "page" : void 0,
96
+ onClick: () => onSelect(thread.id),
97
+ children: [/* @__PURE__ */ jsx("span", {
98
+ className: "think-thread-picker__thread-title",
99
+ children: thread.title
100
+ }), statusLabel ? /* @__PURE__ */ jsx("span", {
101
+ className: "think-thread-picker__thread-status",
102
+ role: "img",
103
+ "aria-label": statusLabel,
104
+ title: statusLabel,
105
+ children: busy ? /* @__PURE__ */ jsx(SpinnerIcon, {}) : /* @__PURE__ */ jsx(DotIcon, {})
106
+ }) : timestamp?.date ? /* @__PURE__ */ jsx("time", {
107
+ className: "think-thread-picker__thread-time",
108
+ dateTime: timestamp.date.toISOString(),
109
+ title: timestamp.date.toLocaleString(),
110
+ children: timestamp.label
111
+ }) : timestamp ? /* @__PURE__ */ jsx("span", {
112
+ className: "think-thread-picker__thread-time",
113
+ children: timestamp.label
114
+ }) : null]
115
+ }) }, thread.id);
151
116
  })
152
117
  }) : /* @__PURE__ */ jsx("p", {
153
118
  className: "think-thread-picker__empty",
@@ -174,109 +139,5 @@ function ThinkThreadPicker({ threads, selectedId, onSelect, onCreate, className,
174
139
  ]
175
140
  });
176
141
  }
177
- /**
178
- * Layout wrapper for a thread picker beside one selected `ThinkFullApp`.
179
- *
180
- * Mobile keeps the drawer at about 80% width so the selected chat remains
181
- * visible as a preview. It only owns layout; callers still own the parent agent,
182
- * selected child agent, chat hook, and shared workspace.
183
- */
184
- function ThinkThreadShell({ sidebar, sidebarOpen, defaultSidebarOpen, onSidebarOpenChange, className, children, ref, style, ...props }) {
185
- const sidebarId = React.useId();
186
- const [isSidebarOpen, setSidebarOpen] = useControllableSidebar({
187
- sidebarOpen,
188
- defaultSidebarOpen,
189
- onSidebarOpenChange
190
- });
191
- const [sidebarWidth, setSidebarWidth] = React.useState(threadSidebarDefaultWidth);
192
- const toggleLabel = isSidebarOpen ? "Hide threads" : "Show threads";
193
- const rootStyle = {
194
- ...style,
195
- "--think-thread-sidebar-w": `${sidebarWidth}px`
196
- };
197
- const resizeThreadSidebarBy = (delta) => {
198
- setSidebarWidth((current) => clampThreadSidebarWidth(current + delta));
199
- };
200
- return /* @__PURE__ */ jsx("div", {
201
- ref,
202
- className: cx("think-thread-shell", className),
203
- style: rootStyle,
204
- ...props,
205
- children: /* @__PURE__ */ jsxs("div", {
206
- className: "think-thread-shell__frame",
207
- "data-sidebar-open": isSidebarOpen ? "true" : "false",
208
- children: [
209
- /* @__PURE__ */ jsx("div", {
210
- className: "think-thread-shell__toolbar",
211
- role: "toolbar",
212
- "aria-label": "Thread controls",
213
- children: /* @__PURE__ */ jsx("div", {
214
- className: "think-thread-shell__panel-toggle",
215
- children: /* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsx(TooltipTrigger, { render: /* @__PURE__ */ jsx(Button, {
216
- type: "button",
217
- variant: "ghost",
218
- color: "neutral",
219
- size: "icon",
220
- "aria-label": toggleLabel,
221
- "aria-controls": sidebarId,
222
- "aria-expanded": isSidebarOpen,
223
- "aria-pressed": isSidebarOpen,
224
- "data-selected": isSidebarOpen,
225
- onClick: () => setSidebarOpen(!isSidebarOpen),
226
- children: /* @__PURE__ */ jsx(SidebarIcon, {})
227
- }) }), /* @__PURE__ */ jsx(TooltipPortal, { children: /* @__PURE__ */ jsx(TooltipPositioner, {
228
- side: "bottom",
229
- sideOffset: 6,
230
- children: /* @__PURE__ */ jsx(TooltipPopup, { children: toggleLabel })
231
- }) })] })
232
- })
233
- }),
234
- isSidebarOpen ? /* @__PURE__ */ jsx("button", {
235
- type: "button",
236
- role: "separator",
237
- "aria-label": "Resize threads panel",
238
- "aria-orientation": "vertical",
239
- "aria-valuemin": threadSidebarMinWidth,
240
- "aria-valuemax": threadSidebarMaxWidth,
241
- "aria-valuenow": sidebarWidth,
242
- className: "think-thread-shell__resizer",
243
- onPointerDown: (event) => beginThreadSidebarResize(event, sidebarWidth, setSidebarWidth),
244
- onKeyDown: (event) => {
245
- if (event.key === "ArrowLeft") {
246
- event.preventDefault();
247
- resizeThreadSidebarBy(-24);
248
- } else if (event.key === "ArrowRight") {
249
- event.preventDefault();
250
- resizeThreadSidebarBy(threadSidebarKeyboardStep);
251
- } else if (event.key === "Home") {
252
- event.preventDefault();
253
- setSidebarWidth(threadSidebarMinWidth);
254
- } else if (event.key === "End") {
255
- event.preventDefault();
256
- setSidebarWidth(threadSidebarMaxWidth);
257
- }
258
- }
259
- }) : null,
260
- /* @__PURE__ */ jsx("div", {
261
- id: sidebarId,
262
- className: "think-thread-shell__sidebar",
263
- "aria-hidden": isSidebarOpen ? void 0 : true,
264
- inert: isSidebarOpen ? void 0 : true,
265
- children: sidebar
266
- }),
267
- /* @__PURE__ */ jsx("div", {
268
- className: "think-thread-shell__main",
269
- children
270
- }),
271
- isSidebarOpen ? /* @__PURE__ */ jsx("button", {
272
- type: "button",
273
- className: "think-thread-shell__peek",
274
- "aria-label": "Show selected thread",
275
- onClick: () => setSidebarOpen(false)
276
- }) : null
277
- ]
278
- })
279
- });
280
- }
281
142
  //#endregion
282
- export { ThinkThreadPicker, ThinkThreadShell };
143
+ export { ThinkThreadPicker };
@@ -0,0 +1,35 @@
1
+ import * as React from "react";
2
+
3
+ //#region src/components/ThinkThreadShell.d.ts
4
+ interface ThinkThreadShellProps extends React.HTMLAttributes<HTMLDivElement> {
5
+ /** Thread picker or app-owned sidebar shown beside the selected child shell. */
6
+ sidebar: React.ReactNode;
7
+ /** Whether the thread drawer is open. Omit for internal state. */
8
+ sidebarOpen?: boolean;
9
+ /** Initial thread drawer state when `sidebarOpen` is uncontrolled. */
10
+ defaultSidebarOpen?: boolean;
11
+ /** Called when the thread drawer is opened or closed. */
12
+ onSidebarOpenChange?: (open: boolean) => void;
13
+ }
14
+ /**
15
+ * Layout wrapper for a thread picker beside one selected `ThinkFullApp`.
16
+ *
17
+ * Mobile keeps the drawer at about 80% width so the selected chat remains
18
+ * visible as a preview. It only owns layout; callers still own the parent agent,
19
+ * selected child agent, chat hook, and shared workspace.
20
+ */
21
+ declare function ThinkThreadShell({
22
+ sidebar,
23
+ sidebarOpen,
24
+ defaultSidebarOpen,
25
+ onSidebarOpenChange,
26
+ className,
27
+ children,
28
+ ref,
29
+ style,
30
+ ...props
31
+ }: ThinkThreadShellProps & {
32
+ ref?: React.Ref<HTMLDivElement>;
33
+ }): React.JSX.Element;
34
+ //#endregion
35
+ export { ThinkThreadShell, ThinkThreadShellProps };
@@ -0,0 +1,146 @@
1
+ import { t as cx } from "../class-names-9UtZwb0J.js";
2
+ import { M as SidebarIcon } from "../icons-Ba9THQKz.js";
3
+ import { Separator } from "./Separator.js";
4
+ import { Button } from "./Button.js";
5
+ import { Tooltip } from "./Tooltip.js";
6
+ import * as React from "react";
7
+ import { jsx, jsxs } from "react/jsx-runtime";
8
+ //#region src/components/ThinkThreadShell.tsx
9
+ const threadSidebarDefaultWidth = 256;
10
+ const threadSidebarMinWidth = 224;
11
+ const threadSidebarMaxWidth = 384;
12
+ const threadSidebarKeyboardStep = 24;
13
+ function useControllableSidebar({ sidebarOpen, defaultSidebarOpen, onSidebarOpenChange }) {
14
+ const [innerOpen, setInnerOpen] = React.useState(defaultSidebarOpen ?? true);
15
+ return [sidebarOpen ?? innerOpen, React.useCallback((next) => {
16
+ if (sidebarOpen === void 0) setInnerOpen(next);
17
+ onSidebarOpenChange?.(next);
18
+ }, [sidebarOpen, onSidebarOpenChange])];
19
+ }
20
+ function clampThreadSidebarWidth(width) {
21
+ return Math.min(threadSidebarMaxWidth, Math.max(threadSidebarMinWidth, width));
22
+ }
23
+ function beginThreadSidebarResize(event, current, apply) {
24
+ event.preventDefault();
25
+ const startX = event.clientX;
26
+ const onMove = (move) => {
27
+ apply(clampThreadSidebarWidth(current + move.clientX - startX));
28
+ };
29
+ const onUp = () => {
30
+ window.removeEventListener("pointermove", onMove);
31
+ window.removeEventListener("pointerup", onUp);
32
+ window.removeEventListener("pointercancel", onUp);
33
+ document.body.classList.remove("is-resizing-think-thread-shell");
34
+ };
35
+ document.body.classList.add("is-resizing-think-thread-shell");
36
+ window.addEventListener("pointermove", onMove);
37
+ window.addEventListener("pointerup", onUp);
38
+ window.addEventListener("pointercancel", onUp);
39
+ }
40
+ /**
41
+ * Layout wrapper for a thread picker beside one selected `ThinkFullApp`.
42
+ *
43
+ * Mobile keeps the drawer at about 80% width so the selected chat remains
44
+ * visible as a preview. It only owns layout; callers still own the parent agent,
45
+ * selected child agent, chat hook, and shared workspace.
46
+ */
47
+ function ThinkThreadShell({ sidebar, sidebarOpen, defaultSidebarOpen, onSidebarOpenChange, className, children, ref, style, ...props }) {
48
+ const sidebarId = React.useId();
49
+ const [isSidebarOpen, setSidebarOpen] = useControllableSidebar({
50
+ sidebarOpen,
51
+ defaultSidebarOpen,
52
+ onSidebarOpenChange
53
+ });
54
+ const [sidebarWidth, setSidebarWidth] = React.useState(threadSidebarDefaultWidth);
55
+ const toggleLabel = isSidebarOpen ? "Hide threads" : "Show threads";
56
+ const rootStyle = {
57
+ ...style,
58
+ "--think-thread-sidebar-w": `${sidebarWidth}px`
59
+ };
60
+ const resizeThreadSidebarBy = (delta) => {
61
+ setSidebarWidth((current) => clampThreadSidebarWidth(current + delta));
62
+ };
63
+ return /* @__PURE__ */ jsx("div", {
64
+ ref,
65
+ className: cx("think-thread-shell", className),
66
+ style: rootStyle,
67
+ ...props,
68
+ children: /* @__PURE__ */ jsxs("div", {
69
+ className: "think-thread-shell__frame",
70
+ "data-sidebar-open": isSidebarOpen ? "true" : "false",
71
+ children: [
72
+ /* @__PURE__ */ jsx("div", {
73
+ className: "think-thread-shell__toolbar",
74
+ role: "toolbar",
75
+ "aria-label": "Thread controls",
76
+ children: /* @__PURE__ */ jsx("div", {
77
+ className: "think-thread-shell__panel-toggle",
78
+ children: /* @__PURE__ */ jsxs(Tooltip.Root, { children: [/* @__PURE__ */ jsx(Tooltip.Trigger, { render: /* @__PURE__ */ jsx(Button, {
79
+ type: "button",
80
+ variant: "ghost",
81
+ color: "neutral",
82
+ size: "icon",
83
+ "aria-label": toggleLabel,
84
+ "aria-controls": sidebarId,
85
+ "aria-expanded": isSidebarOpen,
86
+ "aria-pressed": isSidebarOpen,
87
+ "data-selected": isSidebarOpen,
88
+ onClick: () => setSidebarOpen(!isSidebarOpen),
89
+ children: /* @__PURE__ */ jsx(SidebarIcon, {})
90
+ }) }), /* @__PURE__ */ jsx(Tooltip.Portal, { children: /* @__PURE__ */ jsx(Tooltip.Positioner, {
91
+ side: "bottom",
92
+ sideOffset: 6,
93
+ children: /* @__PURE__ */ jsx(Tooltip.Popup, { children: toggleLabel })
94
+ }) })] })
95
+ })
96
+ }),
97
+ isSidebarOpen ? /* @__PURE__ */ jsx(Separator, {
98
+ decorative: false,
99
+ orientation: "vertical",
100
+ tabIndex: 0,
101
+ "aria-label": "Resize threads panel",
102
+ "aria-valuemin": threadSidebarMinWidth,
103
+ "aria-valuemax": threadSidebarMaxWidth,
104
+ "aria-valuenow": sidebarWidth,
105
+ className: "think-resize-handle think-thread-shell__resizer",
106
+ onPointerDown: (event) => beginThreadSidebarResize(event, sidebarWidth, setSidebarWidth),
107
+ onKeyDown: (event) => {
108
+ if (event.key === "ArrowLeft") {
109
+ event.preventDefault();
110
+ resizeThreadSidebarBy(-24);
111
+ } else if (event.key === "ArrowRight") {
112
+ event.preventDefault();
113
+ resizeThreadSidebarBy(threadSidebarKeyboardStep);
114
+ } else if (event.key === "Home") {
115
+ event.preventDefault();
116
+ setSidebarWidth(threadSidebarMinWidth);
117
+ } else if (event.key === "End") {
118
+ event.preventDefault();
119
+ setSidebarWidth(threadSidebarMaxWidth);
120
+ }
121
+ }
122
+ }) : null,
123
+ /* @__PURE__ */ jsx("div", {
124
+ id: sidebarId,
125
+ className: "think-thread-shell__sidebar",
126
+ "aria-hidden": isSidebarOpen ? void 0 : true,
127
+ inert: isSidebarOpen ? void 0 : true,
128
+ children: sidebar
129
+ }),
130
+ /* @__PURE__ */ jsx("div", {
131
+ className: "think-thread-shell__main",
132
+ children
133
+ }),
134
+ isSidebarOpen ? /* @__PURE__ */ jsx(Button, {
135
+ variant: "ghost",
136
+ color: "neutral",
137
+ className: "think-thread-shell__peek",
138
+ "aria-label": "Show selected thread",
139
+ onClick: () => setSidebarOpen(false)
140
+ }) : null
141
+ ]
142
+ })
143
+ });
144
+ }
145
+ //#endregion
146
+ export { ThinkThreadShell };