@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
@@ -0,0 +1,213 @@
1
+ import * as React from "react";
2
+ import { Select } from "@base-ui/react/select";
3
+
4
+ //#region src/components/Select.d.ts
5
+ type SelectProps<Value = unknown> = Select.Root.Props<Value>;
6
+ interface SelectTriggerProps extends Omit<Select.Trigger.Props, "className"> {
7
+ className?: string;
8
+ /**
9
+ * The size of the select trigger.
10
+ * @default 'default'
11
+ */
12
+ size?: "sm" | "md" | "default";
13
+ }
14
+ interface SelectValueProps extends Omit<Select.Value.Props, "children"> {
15
+ placeholder?: string;
16
+ children?: Select.Value.Props["children"];
17
+ }
18
+ interface SelectIconProps extends Omit<Select.Icon.Props, "className"> {
19
+ className?: string;
20
+ }
21
+ interface SelectPortalProps extends Select.Portal.Props {}
22
+ interface SelectBackdropProps extends Omit<Select.Backdrop.Props, "className"> {
23
+ className?: string;
24
+ }
25
+ interface SelectPositionerProps extends Select.Positioner.Props {}
26
+ interface SelectPopupProps extends Omit<Select.Popup.Props, "className"> {
27
+ className?: string;
28
+ }
29
+ interface SelectListProps extends Omit<Select.List.Props, "className"> {
30
+ className?: string;
31
+ }
32
+ interface SelectItemProps extends Omit<Select.Item.Props, "className"> {
33
+ className?: string;
34
+ }
35
+ interface SelectItemTextProps extends Omit<Select.ItemText.Props, "className"> {
36
+ className?: string;
37
+ }
38
+ interface SelectItemIndicatorProps extends Omit<Select.ItemIndicator.Props, "className"> {
39
+ className?: string;
40
+ }
41
+ interface SelectGroupProps extends Omit<Select.Group.Props, "className"> {
42
+ className?: string;
43
+ label?: string;
44
+ }
45
+ interface SelectGroupLabelProps extends Omit<Select.GroupLabel.Props, "className"> {
46
+ className?: string;
47
+ }
48
+ interface SelectSeparatorProps extends Omit<Select.Separator.Props, "className"> {
49
+ className?: string;
50
+ }
51
+ interface SelectScrollUpArrowProps extends Omit<Select.ScrollUpArrow.Props, "className"> {
52
+ className?: string;
53
+ }
54
+ interface SelectScrollDownArrowProps extends Omit<Select.ScrollDownArrow.Props, "className"> {
55
+ className?: string;
56
+ }
57
+ /**
58
+ * A select component for choosing from a list of options.
59
+ *
60
+ * @example
61
+ * ```tsx
62
+ * <Select.Root defaultValue="option1">
63
+ * <Select.Trigger>
64
+ * <Select.Value placeholder="Select..." />
65
+ * <Select.Icon />
66
+ * </Select.Trigger>
67
+ * <Select.Portal>
68
+ * <Select.Positioner>
69
+ * <Select.Popup>
70
+ * <Select.List>
71
+ * <Select.Item value="option1"><Select.ItemText>Option 1</Select.ItemText></Select.Item>
72
+ * <Select.Item value="option2"><Select.ItemText>Option 2</Select.ItemText></Select.Item>
73
+ * </Select.List>
74
+ * </Select.Popup>
75
+ * </Select.Positioner>
76
+ * </Select.Portal>
77
+ * </Select.Root>
78
+ * ```
79
+ *
80
+ * @see {@link https://base-ui.com/react/components/select | Base UI Select}
81
+ */
82
+ declare function SelectRoot<Value>(props: SelectProps<Value>): React.JSX.Element;
83
+ declare function SelectTrigger({
84
+ size,
85
+ className,
86
+ ref,
87
+ ...props
88
+ }: SelectTriggerProps & {
89
+ ref?: React.Ref<HTMLButtonElement>;
90
+ }): React.JSX.Element;
91
+ declare function SelectValue({
92
+ placeholder,
93
+ children,
94
+ ref,
95
+ ...props
96
+ }: SelectValueProps & {
97
+ ref?: React.Ref<HTMLSpanElement>;
98
+ }): React.JSX.Element;
99
+ declare function SelectIcon({
100
+ className,
101
+ children,
102
+ ref,
103
+ ...props
104
+ }: SelectIconProps): React.JSX.Element;
105
+ declare function SelectBackdrop({
106
+ className,
107
+ ref,
108
+ ...props
109
+ }: SelectBackdropProps): React.JSX.Element;
110
+ declare function SelectPositioner({
111
+ className,
112
+ ref,
113
+ ...props
114
+ }: SelectPositionerProps & {
115
+ className?: string;
116
+ } & {
117
+ ref?: React.Ref<HTMLDivElement>;
118
+ }): React.JSX.Element;
119
+ declare function SelectPopup({
120
+ className,
121
+ ref,
122
+ ...props
123
+ }: SelectPopupProps & {
124
+ ref?: React.Ref<HTMLDivElement>;
125
+ }): React.JSX.Element;
126
+ declare function SelectList({
127
+ className,
128
+ ref,
129
+ ...props
130
+ }: SelectListProps & {
131
+ ref?: React.Ref<HTMLDivElement>;
132
+ }): React.JSX.Element;
133
+ declare function SelectItem({
134
+ className,
135
+ value,
136
+ ref,
137
+ ...props
138
+ }: SelectItemProps & {
139
+ ref?: React.Ref<HTMLDivElement>;
140
+ }): React.JSX.Element;
141
+ declare function SelectItemText({
142
+ className,
143
+ ref,
144
+ ...props
145
+ }: SelectItemTextProps): React.JSX.Element;
146
+ declare function SelectItemIndicator({
147
+ className,
148
+ children,
149
+ ref,
150
+ ...props
151
+ }: SelectItemIndicatorProps): React.JSX.Element;
152
+ declare function SelectGroup({
153
+ label,
154
+ className,
155
+ children,
156
+ ref,
157
+ ...props
158
+ }: SelectGroupProps & {
159
+ ref?: React.Ref<HTMLDivElement>;
160
+ }): React.JSX.Element;
161
+ declare function SelectGroupLabel({
162
+ className,
163
+ ref,
164
+ ...props
165
+ }: SelectGroupLabelProps & {
166
+ ref?: React.Ref<HTMLDivElement>;
167
+ }): React.JSX.Element;
168
+ declare function SelectSeparator({
169
+ className,
170
+ ref,
171
+ ...props
172
+ }: SelectSeparatorProps & {
173
+ ref?: React.Ref<HTMLDivElement>;
174
+ }): React.JSX.Element;
175
+ declare function SelectScrollUpArrow({
176
+ className,
177
+ children,
178
+ ref,
179
+ ...props
180
+ }: SelectScrollUpArrowProps & {
181
+ ref?: React.Ref<HTMLDivElement>;
182
+ }): React.JSX.Element;
183
+ declare function SelectScrollDownArrow({
184
+ className,
185
+ children,
186
+ ref,
187
+ ...props
188
+ }: SelectScrollDownArrowProps & {
189
+ ref?: React.Ref<HTMLDivElement>;
190
+ }): React.JSX.Element;
191
+ declare const Select$1: {
192
+ Root: typeof SelectRoot;
193
+ Label: React.ForwardRefExoticComponent<Omit<import("@base-ui/react").SelectLabelProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
194
+ Trigger: typeof SelectTrigger;
195
+ Value: typeof SelectValue;
196
+ Icon: typeof SelectIcon;
197
+ Portal: React.ForwardRefExoticComponent<Omit<import("@base-ui/react").SelectPortalProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
198
+ Backdrop: typeof SelectBackdrop;
199
+ Positioner: typeof SelectPositioner;
200
+ Popup: typeof SelectPopup;
201
+ Arrow: React.ForwardRefExoticComponent<Omit<import("@base-ui/react").SelectArrowProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
202
+ List: typeof SelectList;
203
+ Item: typeof SelectItem;
204
+ ItemText: typeof SelectItemText;
205
+ ItemIndicator: typeof SelectItemIndicator;
206
+ Separator: typeof SelectSeparator;
207
+ Group: typeof SelectGroup;
208
+ GroupLabel: typeof SelectGroupLabel;
209
+ ScrollUpArrow: typeof SelectScrollUpArrow;
210
+ ScrollDownArrow: typeof SelectScrollDownArrow;
211
+ };
212
+ //#endregion
213
+ export { SelectTriggerProps as _, SelectIconProps as a, SelectItemTextProps as c, SelectPortalProps as d, SelectPositionerProps as f, SelectSeparatorProps as g, SelectScrollUpArrowProps as h, SelectGroupProps as i, SelectListProps as l, SelectScrollDownArrowProps as m, SelectBackdropProps as n, SelectItemIndicatorProps as o, SelectProps as p, SelectGroupLabelProps as r, SelectItemProps as s, Select$1 as t, SelectPopupProps as u, SelectValueProps as v };
@@ -20,8 +20,6 @@ interface TabProps extends Omit<Tabs.Tab.Props, "className"> {
20
20
  interface TabPanelProps extends Omit<Tabs.Panel.Props, "className"> {
21
21
  className?: string;
22
22
  }
23
- type TabsTriggerProps = TabProps;
24
- type TabsContentProps = TabPanelProps;
25
23
  interface TabsListVariantsOptions {
26
24
  variant?: "default" | "line" | null;
27
25
  className?: string;
@@ -47,7 +45,7 @@ declare function tabsListVariants({
47
45
  *
48
46
  * @see {@link https://base-ui.com/react/components/tabs | Base UI Tabs}
49
47
  */
50
- declare function Tabs$1({
48
+ declare function TabsRoot({
51
49
  orientation,
52
50
  variant,
53
51
  className,
@@ -78,7 +76,12 @@ declare function TabPanel({
78
76
  }: TabPanelProps & {
79
77
  ref?: React.Ref<HTMLDivElement>;
80
78
  }): React.JSX.Element;
81
- declare const TabsTrigger: typeof Tab;
82
- declare const TabsContent: typeof TabPanel;
79
+ declare const Tabs$1: {
80
+ Root: typeof TabsRoot;
81
+ List: typeof TabsList;
82
+ Tab: typeof Tab;
83
+ Indicator: React.ForwardRefExoticComponent<Omit<import("@base-ui/react").TabsIndicatorProps, "ref"> & React.RefAttributes<HTMLSpanElement>>;
84
+ Panel: typeof TabPanel;
85
+ };
83
86
  //#endregion
84
- export { Tabs$1 as a, TabsList as c, TabsProps as d, TabsTrigger as f, TabProps as i, TabsListProps as l, tabsListVariants as m, TabPanel as n, TabsContent as o, TabsTriggerProps as p, TabPanelProps as r, TabsContentProps as s, Tab as t, TabsListVariantsOptions as u };
87
+ export { TabsListVariantsOptions as a, TabsListProps as i, TabProps as n, TabsProps as o, Tabs$1 as r, tabsListVariants as s, TabPanelProps as t };
@@ -0,0 +1,222 @@
1
+ import { Button } from "./components/Button.js";
2
+ import { AgentChat } from "./components/AgentChat.js";
3
+ import { ThinkChatContext, useThinkChatContext } from "./components/ThinkChatContext.js";
4
+ import { ThinkChatActivity, createThinkChatActivityRenderer, renderThinkChatActivityPart } from "./components/ThinkChatActivity.js";
5
+ import * as React from "react";
6
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
7
+ import { useAgentChat } from "@cloudflare/think/react";
8
+ import { useAgent } from "agents/react";
9
+ //#region src/components/_internal/think-approvals.ts
10
+ /**
11
+ * Ambient approvals belong to their stub. An explicit different stub may only
12
+ * use approval state and settlement handlers supplied alongside that override.
13
+ */
14
+ function resolveThinkApprovalProps(overrides, ambient) {
15
+ const inheritsAmbient = overrides.thinkStub === void 0 || overrides.thinkStub === ambient?.thinkStub;
16
+ return {
17
+ thinkStub: overrides.thinkStub ?? ambient?.thinkStub,
18
+ pendingApprovals: overrides.pendingApprovals ?? (inheritsAmbient ? ambient?.pendingApprovals : void 0),
19
+ onExecutionSettled: overrides.onExecutionSettled ?? (inheritsAmbient ? ambient?.onExecutionSettled : void 0)
20
+ };
21
+ }
22
+ //#endregion
23
+ //#region src/components/ThinkChat.tsx
24
+ function toAgentChatStatus(chat) {
25
+ if (chat.status === "submitted") return "submitted";
26
+ if (chat.isStreaming || chat.isRecovering) return "streaming";
27
+ return chat.status ?? "ready";
28
+ }
29
+ function useThinkPendingApprovals(stub, refreshKey) {
30
+ const requestIdRef = React.useRef(0);
31
+ const [state, setState] = React.useState(() => ({
32
+ source: stub,
33
+ pendingApprovals: []
34
+ }));
35
+ const refresh = React.useCallback(async () => {
36
+ const requestId = ++requestIdRef.current;
37
+ try {
38
+ const pendingApprovals = await stub.pendingApprovals();
39
+ if (requestId !== requestIdRef.current) return;
40
+ setState({
41
+ source: stub,
42
+ pendingApprovals
43
+ });
44
+ } catch {
45
+ if (requestId !== requestIdRef.current) return;
46
+ setState({
47
+ source: stub,
48
+ pendingApprovals: []
49
+ });
50
+ }
51
+ }, [stub]);
52
+ React.useEffect(() => {
53
+ requestIdRef.current += 1;
54
+ setState((current) => current.source === stub ? current : {
55
+ source: stub,
56
+ pendingApprovals: []
57
+ });
58
+ refresh();
59
+ return () => {
60
+ requestIdRef.current += 1;
61
+ };
62
+ }, [
63
+ refresh,
64
+ refreshKey,
65
+ stub
66
+ ]);
67
+ const pendingApprovals = state.source === stub ? state.pendingApprovals : [];
68
+ return React.useMemo(() => ({
69
+ pendingApprovals,
70
+ refreshPendingApprovals: refresh
71
+ }), [pendingApprovals, refresh]);
72
+ }
73
+ /**
74
+ * Chat UI for Cloudflare Think agents. Provide a `useAgentChat` value (or let
75
+ * `ThinkChat.Root` create one) and `ThinkChat.Messages` renders the message
76
+ * stream with agent work folded into collapsed Activity blocks.
77
+ */
78
+ function ThinkChatProvider({ chat, children }) {
79
+ return /* @__PURE__ */ jsx(ThinkChatContext.Provider, {
80
+ value: chat,
81
+ children
82
+ });
83
+ }
84
+ /**
85
+ * Batteries-included root: connects to the named Think agent (upstream's
86
+ * `useAgent` + `useAgentChat`) and provides the live chat to everything
87
+ * inside. If the app already owns the chat hook, use `ThinkChat.Provider`.
88
+ *
89
+ * @example
90
+ * ```tsx
91
+ * <ThinkChat.Root agent="my-agent" name="session-1">
92
+ * <ThinkChat.Messages />
93
+ * </ThinkChat.Root>
94
+ * ```
95
+ */
96
+ function ThinkChatRoot({ agent: agentOption, name, children }) {
97
+ const agent = useAgent(typeof agentOption === "string" ? {
98
+ agent: agentOption,
99
+ name
100
+ } : {
101
+ ...agentOption,
102
+ name: name ?? agentOption.name
103
+ });
104
+ const chat = useAgentChat({ agent });
105
+ const approvals = useThinkPendingApprovals(agent.stub, `${chat.messages.length}:${chat.status}`);
106
+ return /* @__PURE__ */ jsx(ThinkChatContext.Provider, {
107
+ value: chat,
108
+ children: /* @__PURE__ */ jsx(ThinkChatApprovalsContext.Provider, {
109
+ value: {
110
+ ...approvals,
111
+ thinkStub: agent.stub
112
+ },
113
+ children
114
+ })
115
+ });
116
+ }
117
+ const ThinkChatApprovalsContext = React.createContext(null);
118
+ /**
119
+ * The full conversation surface — message list plus composer — with the
120
+ * activity renderer as the default `renderPart`: runs of reasoning/tool parts
121
+ * fold into one collapsed Activity block with derived labels and per-tool
122
+ * panels. Extend for app-specific tools with `toolRenderers` (label/panel
123
+ * inside the log) or `excludeTools` + your own `renderPart` (standalone
124
+ * card) — see README "App-specific tools" and the Custom Tool Panel story.
125
+ */
126
+ function ThinkChatMessages({ renderPart, excludeTools, toolRenderers, thinkStub, onExecutionSettled, pendingApprovals, notice, ...props }) {
127
+ const chat = useThinkChatContext("ThinkChat.Messages");
128
+ const approvals = React.useContext(ThinkChatApprovalsContext);
129
+ const status = toAgentChatStatus(chat);
130
+ const resolvedApprovals = resolveThinkApprovalProps({
131
+ thinkStub,
132
+ pendingApprovals,
133
+ onExecutionSettled
134
+ }, approvals && {
135
+ thinkStub: approvals.thinkStub,
136
+ pendingApprovals: approvals.pendingApprovals,
137
+ onExecutionSettled: approvals.refreshPendingApprovals
138
+ });
139
+ const defaultRenderPart = React.useMemo(() => createThinkChatActivityRenderer({
140
+ excludeTools,
141
+ toolRenderers
142
+ }), [excludeTools, toolRenderers]);
143
+ const retryMessageId = chat.error ? chat.messages.findLast((message) => message.role !== "system")?.id : void 0;
144
+ const defaultNotice = chat.isRecovering ? /* @__PURE__ */ jsx(Fragment, { children: "Reconnecting to the agent…" }) : chat.connectionError ? /* @__PURE__ */ jsxs("span", {
145
+ "data-tone": "danger",
146
+ children: ["Connection lost", chat.connectionError.reason ? ` — ${chat.connectionError.reason}` : ""]
147
+ }) : chat.error ? /* @__PURE__ */ jsxs("div", {
148
+ className: "agent-chat__turn-error",
149
+ "data-tone": "danger",
150
+ children: [/* @__PURE__ */ jsxs("p", {
151
+ className: "agent-chat__turn-error-message",
152
+ children: [
153
+ /* @__PURE__ */ jsx("strong", { children: "Response failed." }),
154
+ " ",
155
+ chat.error.message.trim() || "The response could not be completed."
156
+ ]
157
+ }), /* @__PURE__ */ jsxs("div", {
158
+ className: "agent-chat__turn-error-actions",
159
+ children: [/* @__PURE__ */ jsx(Button, {
160
+ type: "button",
161
+ variant: "ghost",
162
+ color: "neutral",
163
+ size: "lg",
164
+ onClick: chat.clearError,
165
+ children: "Dismiss"
166
+ }), retryMessageId ? /* @__PURE__ */ jsx(Button, {
167
+ type: "button",
168
+ color: "primary",
169
+ size: "lg",
170
+ onClick: () => {
171
+ chat.clearError();
172
+ chat.regenerate({ messageId: retryMessageId });
173
+ },
174
+ children: "Try again"
175
+ }) : null]
176
+ })]
177
+ }) : void 0;
178
+ return /* @__PURE__ */ jsx(AgentChat, {
179
+ ...props,
180
+ renderPart: renderPart ?? defaultRenderPart,
181
+ messages: chat.messages,
182
+ status,
183
+ onStop: chat.stop,
184
+ onApprovalResponse: chat.addToolApprovalResponse,
185
+ thinkStub: resolvedApprovals.thinkStub,
186
+ onExecutionSettled: resolvedApprovals.onExecutionSettled,
187
+ pendingApprovals: resolvedApprovals.pendingApprovals,
188
+ notice: notice ?? defaultNotice,
189
+ onRegenerate: (messageId) => void chat.regenerate({ messageId }),
190
+ onSubmit: ({ text, files }) => {
191
+ const trimmed = text.trim();
192
+ if (trimmed || files.length) chat.sendMessage({
193
+ text: trimmed,
194
+ files
195
+ });
196
+ }
197
+ });
198
+ }
199
+ /**
200
+ * The ambient chat value from `ThinkChat.Root`/`Provider` — for custom tool
201
+ * panels, cards, or composer actions that need `messages`, `status`, or
202
+ * `sendMessage`. Throws outside a provider.
203
+ */
204
+ function useThinkChat() {
205
+ return useThinkChatContext("useThinkChat");
206
+ }
207
+ /**
208
+ * Namespace entry point. `Root` + `Messages` is the standard surface;
209
+ * `Provider` + `useThinkChat` when the app owns the chat hook; `Activity`,
210
+ * `renderActivityPart`, and `createActivityRenderer` for custom layouts and
211
+ * app-specific tools.
212
+ */
213
+ const ThinkChat = {
214
+ Provider: ThinkChatProvider,
215
+ Root: ThinkChatRoot,
216
+ Messages: ThinkChatMessages,
217
+ Activity: ThinkChatActivity,
218
+ renderActivityPart: renderThinkChatActivityPart,
219
+ createActivityRenderer: createThinkChatActivityRenderer
220
+ };
221
+ //#endregion
222
+ export { useThinkChat as a, ThinkChatRoot as i, ThinkChatMessages as n, useThinkPendingApprovals as o, ThinkChatProvider as r, resolveThinkApprovalProps as s, ThinkChat as t };
@@ -1,5 +1,5 @@
1
- import { a as AgentChatRenderPartContext, r as AgentChatProps } from "./AgentChat-B9LD_WF1.js";
2
- import { s as ThinkChatPart } from "./ThinkChatToolParts-DnUiZgCC.js";
1
+ import { a as AgentChatRenderPartContext, r as AgentChatProps } from "./AgentChat-Br6tKEl8.js";
2
+ import { s as ThinkChatPart } from "./ThinkChatToolParts-Cv4o7j6F.js";
3
3
  import * as React from "react";
4
4
  import { DynamicToolUIPart, ToolUIPart, UIMessage } from "ai";
5
5
 
@@ -63,10 +63,10 @@ declare function ThinkChatActivity({
63
63
  * state. Excluded tools split the run and return undefined so your own
64
64
  * renderPart (or AgentChat's generic activity row) takes over for them.
65
65
  */
66
- declare function createThinkChatActivityRenderer({
66
+ declare function createThinkChatActivityRenderer<MessageT extends UIMessage = UIMessage>({
67
67
  excludeTools,
68
68
  toolRenderers
69
- }?: ThinkChatActivityRendererOptions): NonNullable<AgentChatProps["renderPart"]>;
69
+ }?: ThinkChatActivityRendererOptions): NonNullable<AgentChatProps<MessageT>["renderPart"]>;
70
70
  /** Default activity renderer — `createThinkChatActivityRenderer()` with no overrides. */
71
71
  declare const renderThinkChatActivityPart: (context: AgentChatRenderPartContext<UIMessage<unknown, import("ai").UIDataTypes, import("ai").UITools>>) => React.ReactNode | undefined;
72
72
  //#endregion
@@ -0,0 +1,16 @@
1
+ import * as React from "react";
2
+ import { useAgentChat } from "@cloudflare/think/react";
3
+ import { UIMessage } from "ai";
4
+
5
+ //#region src/components/ThinkChatContext.d.ts
6
+ /** The complete upstream Think chat hook value, preserving app state and message extensions. */
7
+ type ThinkChatValue<State = unknown, MessageT extends UIMessage = UIMessage> = ReturnType<typeof useAgentChat<State, MessageT>>;
8
+ /**
9
+ * React contexts cannot bind provider-specific generics. Keep the stored value
10
+ * opaque and restore the complete upstream hook type through the typed accessors.
11
+ */
12
+ declare const ThinkChatContext: React.Context<unknown>;
13
+ declare function useOptionalThinkChatContext<State = unknown, MessageT extends UIMessage = UIMessage>(): ThinkChatValue<State, MessageT> | null;
14
+ declare function useThinkChatContext<State = unknown, MessageT extends UIMessage = UIMessage>(component: string): ThinkChatValue<State, MessageT>;
15
+ //#endregion
16
+ export { useThinkChatContext as i, ThinkChatValue as n, useOptionalThinkChatContext as r, ThinkChatContext as t };
@@ -1,7 +1,7 @@
1
1
  import { InferUITools, ToolUIPart, UIMessage } from "ai";
2
2
  import { ProxyToolInput, ProxyToolOutput } from "@cloudflare/codemode";
3
3
  import { QuickActionExtractInput, QuickActionPage, QuickActionScrapeInput, QuickActionToolName } from "@cloudflare/think/tools/browser";
4
- import { FetchResult } from "@cloudflare/think/tools/fetch";
4
+ import { FetchResponseMode, FetchResult } from "@cloudflare/think/tools/fetch";
5
5
  import { WorkspaceTools } from "@cloudflare/think/tools/workspace";
6
6
 
7
7
  //#region src/components/ThinkChatToolParts.d.ts
@@ -39,11 +39,19 @@ type SkillUITools = {
39
39
  };
40
40
  type SkillToolPart = ToolUIPart<SkillUITools>;
41
41
  declare function isSkillToolPart(part: ThinkChatPart): part is SkillToolPart;
42
+ type FetchToolInput = {
43
+ url: string;
44
+ path?: never;
45
+ response?: FetchResponseMode;
46
+ headers?: Record<string, string>;
47
+ } | {
48
+ path: string;
49
+ url?: never;
50
+ response?: FetchResponseMode;
51
+ headers?: Record<string, string>;
52
+ };
42
53
  type FetchToolPart = ToolUIPart<Record<string, {
43
- input: {
44
- url?: string;
45
- path?: string;
46
- };
54
+ input: FetchToolInput;
47
55
  output: FetchResult;
48
56
  }>>;
49
57
  declare function isFetchToolPart(part: ThinkChatPart): part is FetchToolPart;
@@ -1,4 +1,4 @@
1
- import { Dialog, DialogContent, DialogTrigger } from "./components/Dialog.js";
1
+ import { Dialog } from "./components/Dialog.js";
2
2
  import "react";
3
3
  import { jsx, jsxs } from "react/jsx-runtime";
4
4
  //#region src/components/_internal/attachment-preview.tsx
@@ -8,7 +8,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
8
8
  * the composer chips and message-side attachments.
9
9
  */
10
10
  function AttachmentPreview({ url, filename, children }) {
11
- return /* @__PURE__ */ jsxs(Dialog, { children: [/* @__PURE__ */ jsx(DialogTrigger, { render: children }), /* @__PURE__ */ jsxs(DialogContent, {
11
+ return /* @__PURE__ */ jsxs(Dialog.Root, { children: [/* @__PURE__ */ jsx(Dialog.Trigger, { render: children }), /* @__PURE__ */ jsxs(Dialog.Portal, { children: [/* @__PURE__ */ jsx(Dialog.Backdrop, {}), /* @__PURE__ */ jsx(Dialog.Viewport, { children: /* @__PURE__ */ jsxs(Dialog.Popup, {
12
12
  className: "attachment-preview",
13
13
  "aria-label": filename ?? "Attachment preview",
14
14
  children: [/* @__PURE__ */ jsx("img", {
@@ -19,7 +19,7 @@ function AttachmentPreview({ url, filename, children }) {
19
19
  className: "attachment-preview__name",
20
20
  children: filename
21
21
  }) : null]
22
- })] });
22
+ }) })] })] });
23
23
  }
24
24
  //#endregion
25
25
  export { AttachmentPreview as t };
@@ -11,10 +11,12 @@ interface AccordionItemProps extends Omit<React.ComponentPropsWithRef<typeof Acc
11
11
  interface AccordionTriggerProps extends Omit<React.ComponentPropsWithRef<typeof Accordion$1.Trigger>, "className"> {
12
12
  className?: string;
13
13
  }
14
+ interface AccordionHeaderProps extends Omit<Accordion$1.Header.Props, "className"> {
15
+ className?: string;
16
+ }
14
17
  interface AccordionPanelProps extends Omit<React.ComponentPropsWithRef<typeof Accordion$1.Panel>, "className"> {
15
18
  className?: string;
16
19
  }
17
- type AccordionContentProps = AccordionPanelProps;
18
20
  /**
19
21
  * An accordion component for showing collapsible content sections.
20
22
  *
@@ -34,7 +36,7 @@ type AccordionContentProps = AccordionPanelProps;
34
36
  *
35
37
  * @see {@link https://base-ui.com/react/components/accordion | Base UI Accordion}
36
38
  */
37
- declare function Accordion({
39
+ declare function AccordionRoot({
38
40
  className,
39
41
  ref,
40
42
  ...props
@@ -51,16 +53,19 @@ declare function AccordionItem({
51
53
  }: AccordionItemProps & {
52
54
  ref?: React.Ref<HTMLDivElement>;
53
55
  }): React.JSX.Element;
56
+ declare function AccordionHeader({
57
+ className,
58
+ ref,
59
+ ...props
60
+ }: AccordionHeaderProps): React.JSX.Element;
54
61
  /**
55
62
  * The header/trigger that toggles an AccordionItem.
56
63
  */
57
- declare const AccordionHeader: React.ForwardRefExoticComponent<Omit<import("@base-ui/react").AccordionHeaderProps, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
58
64
  /**
59
65
  * The clickable trigger button within an AccordionItem.
60
66
  */
61
67
  declare function AccordionTrigger({
62
68
  className,
63
- children,
64
69
  ref,
65
70
  ...props
66
71
  }: AccordionTriggerProps & {
@@ -76,6 +81,12 @@ declare function AccordionPanel({
76
81
  }: AccordionPanelProps & {
77
82
  ref?: React.Ref<HTMLDivElement>;
78
83
  }): React.JSX.Element;
79
- declare const AccordionContent: typeof AccordionPanel;
84
+ declare const Accordion: {
85
+ Root: typeof AccordionRoot;
86
+ Item: typeof AccordionItem;
87
+ Header: typeof AccordionHeader;
88
+ Trigger: typeof AccordionTrigger;
89
+ Panel: typeof AccordionPanel;
90
+ };
80
91
  //#endregion
81
- export { Accordion, AccordionContent, AccordionContentProps, AccordionHeader, AccordionItem, AccordionItemProps, AccordionPanel, AccordionPanelProps, AccordionProps, AccordionTrigger, AccordionTriggerProps };
92
+ export { Accordion, AccordionHeaderProps, AccordionItemProps, AccordionPanelProps, AccordionProps, AccordionTriggerProps };