@mieweb/ui 0.7.1-dev.9 → 0.7.2-dev.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 (188) hide show
  1. package/dist/ag-grid.cjs +5 -5
  2. package/dist/ag-grid.js +1 -1
  3. package/dist/{chunk-XCVBCY7L.cjs → chunk-26DPQUSB.cjs} +4 -4
  4. package/dist/{chunk-XCVBCY7L.cjs.map → chunk-26DPQUSB.cjs.map} +1 -1
  5. package/dist/{chunk-YTLTI5Q2.js → chunk-3D4ITDLO.js} +3 -3
  6. package/dist/{chunk-YTLTI5Q2.js.map → chunk-3D4ITDLO.js.map} +1 -1
  7. package/dist/{chunk-KZ7QKUJS.cjs → chunk-3IAA3KCE.cjs} +13 -4
  8. package/dist/chunk-3IAA3KCE.cjs.map +1 -0
  9. package/dist/chunk-3PXOIAF6.js +3 -0
  10. package/dist/{chunk-DHKYGVP7.js.map → chunk-3PXOIAF6.js.map} +1 -1
  11. package/dist/{chunk-7OIUA7PW.js → chunk-3SRBIXQX.js} +9 -9
  12. package/dist/{chunk-7OIUA7PW.js.map → chunk-3SRBIXQX.js.map} +1 -1
  13. package/dist/{chunk-7V6SUOBV.js → chunk-3YSIZ2CK.js} +13 -4
  14. package/dist/chunk-3YSIZ2CK.js.map +1 -0
  15. package/dist/{chunk-3OME4UHL.cjs → chunk-54OW6ZPL.cjs} +99 -3
  16. package/dist/chunk-54OW6ZPL.cjs.map +1 -0
  17. package/dist/{chunk-IVDIT3TJ.js → chunk-5BDCQBYW.js} +3 -3
  18. package/dist/{chunk-IVDIT3TJ.js.map → chunk-5BDCQBYW.js.map} +1 -1
  19. package/dist/{chunk-5PHGIWDN.cjs → chunk-6ECKH4DJ.cjs} +3 -3
  20. package/dist/{chunk-5PHGIWDN.cjs.map → chunk-6ECKH4DJ.cjs.map} +1 -1
  21. package/dist/{chunk-2GQ7VPCS.cjs → chunk-6J7UGYT5.cjs} +6 -6
  22. package/dist/{chunk-2GQ7VPCS.cjs.map → chunk-6J7UGYT5.cjs.map} +1 -1
  23. package/dist/{chunk-HIAUNNOW.cjs → chunk-AIJAFPGJ.cjs} +3 -3
  24. package/dist/{chunk-HIAUNNOW.cjs.map → chunk-AIJAFPGJ.cjs.map} +1 -1
  25. package/dist/{chunk-BS5NOKZD.js → chunk-AQ564XO7.js} +5 -5
  26. package/dist/chunk-AQ564XO7.js.map +1 -0
  27. package/dist/{chunk-JJNCQMR5.js → chunk-BMRQ4VME.js} +3 -3
  28. package/dist/{chunk-JJNCQMR5.js.map → chunk-BMRQ4VME.js.map} +1 -1
  29. package/dist/{chunk-REPZI2YO.js → chunk-BMSG4NBH.js} +3 -3
  30. package/dist/{chunk-REPZI2YO.js.map → chunk-BMSG4NBH.js.map} +1 -1
  31. package/dist/{chunk-QA6ZDHFP.js → chunk-BOOJDRJO.js} +35 -11
  32. package/dist/chunk-BOOJDRJO.js.map +1 -0
  33. package/dist/{chunk-34LGPMO4.js → chunk-DLBV42JD.js} +3 -3
  34. package/dist/{chunk-34LGPMO4.js.map → chunk-DLBV42JD.js.map} +1 -1
  35. package/dist/{chunk-2YDKLURF.js → chunk-DWIF6VXZ.js} +99 -3
  36. package/dist/chunk-DWIF6VXZ.js.map +1 -0
  37. package/dist/{chunk-KQGGKE36.js → chunk-EGWWTIWS.js} +118 -74
  38. package/dist/chunk-EGWWTIWS.js.map +1 -0
  39. package/dist/{chunk-IXWRD4AP.js → chunk-EKRT7K2K.js} +3 -3
  40. package/dist/{chunk-IXWRD4AP.js.map → chunk-EKRT7K2K.js.map} +1 -1
  41. package/dist/{chunk-MHD5HZ4X.js → chunk-FDV7EQWH.js} +3 -3
  42. package/dist/{chunk-MHD5HZ4X.js.map → chunk-FDV7EQWH.js.map} +1 -1
  43. package/dist/{chunk-STCRP652.cjs → chunk-FKLUSYFP.cjs} +4 -4
  44. package/dist/{chunk-STCRP652.cjs.map → chunk-FKLUSYFP.cjs.map} +1 -1
  45. package/dist/{chunk-DKICBJTM.js → chunk-HIDV32ZX.js} +4 -4
  46. package/dist/{chunk-DKICBJTM.js.map → chunk-HIDV32ZX.js.map} +1 -1
  47. package/dist/{chunk-XPNKDFRL.js → chunk-I3WGZPI6.js} +3 -3
  48. package/dist/{chunk-XPNKDFRL.js.map → chunk-I3WGZPI6.js.map} +1 -1
  49. package/dist/{chunk-62TFTZWT.cjs → chunk-IJYTASQQ.cjs} +5 -5
  50. package/dist/{chunk-62TFTZWT.cjs.map → chunk-IJYTASQQ.cjs.map} +1 -1
  51. package/dist/{chunk-SAJSA4TS.js → chunk-LMBXJZLG.js} +8 -4
  52. package/dist/chunk-LMBXJZLG.js.map +1 -0
  53. package/dist/{chunk-CPUDOVWH.cjs → chunk-MJWFNV3L.cjs} +12 -8
  54. package/dist/chunk-MJWFNV3L.cjs.map +1 -0
  55. package/dist/{chunk-ZDEYV373.cjs → chunk-MYFZYUPR.cjs} +35 -11
  56. package/dist/chunk-MYFZYUPR.cjs.map +1 -0
  57. package/dist/{chunk-QNUPTRW7.js → chunk-NGLI2MSM.js} +24 -14
  58. package/dist/chunk-NGLI2MSM.js.map +1 -0
  59. package/dist/{chunk-PGETZ2FP.cjs → chunk-OAHORW4N.cjs} +120 -76
  60. package/dist/chunk-OAHORW4N.cjs.map +1 -0
  61. package/dist/{chunk-G45PAVQI.js → chunk-P6L74SKG.js} +4 -4
  62. package/dist/{chunk-G45PAVQI.js.map → chunk-P6L74SKG.js.map} +1 -1
  63. package/dist/chunk-PAM5UUBL.cjs +740 -0
  64. package/dist/{chunk-UTYUT5YY.cjs.map → chunk-PAM5UUBL.cjs.map} +1 -1
  65. package/dist/{chunk-JY4U2QWO.cjs → chunk-PLMXN23Q.cjs} +5 -5
  66. package/dist/chunk-PLMXN23Q.cjs.map +1 -0
  67. package/dist/{chunk-PNJAFZDC.cjs → chunk-Q5VBO3I5.cjs} +30 -20
  68. package/dist/chunk-Q5VBO3I5.cjs.map +1 -0
  69. package/dist/{chunk-XD6GRTH2.cjs → chunk-QI2SB6U3.cjs} +7 -7
  70. package/dist/{chunk-XD6GRTH2.cjs.map → chunk-QI2SB6U3.cjs.map} +1 -1
  71. package/dist/{chunk-6XGESZ4S.js → chunk-QYSUYB3S.js} +12 -8
  72. package/dist/chunk-QYSUYB3S.js.map +1 -0
  73. package/dist/{chunk-Y5F2OASC.cjs → chunk-RBS3GHDZ.cjs} +6 -6
  74. package/dist/{chunk-Y5F2OASC.cjs.map → chunk-RBS3GHDZ.cjs.map} +1 -1
  75. package/dist/{chunk-NGPEXCC7.cjs → chunk-RS5VA6QU.cjs} +8 -4
  76. package/dist/chunk-RS5VA6QU.cjs.map +1 -0
  77. package/dist/{chunk-YXHX2DAK.cjs → chunk-RYQ3S3KO.cjs} +5 -5
  78. package/dist/{chunk-YXHX2DAK.cjs.map → chunk-RYQ3S3KO.cjs.map} +1 -1
  79. package/dist/{chunk-QKKYMNR2.js → chunk-RZJXCI53.js} +189 -202
  80. package/dist/chunk-RZJXCI53.js.map +1 -0
  81. package/dist/{chunk-ET5JGGVL.js → chunk-TNUL4LGG.js} +5 -5
  82. package/dist/{chunk-ET5JGGVL.js.map → chunk-TNUL4LGG.js.map} +1 -1
  83. package/dist/{chunk-C2NNNOSU.cjs → chunk-VVI32P7L.cjs} +4 -4
  84. package/dist/{chunk-C2NNNOSU.cjs.map → chunk-VVI32P7L.cjs.map} +1 -1
  85. package/dist/{chunk-X732DPW4.cjs → chunk-VWCMOWGH.cjs} +77 -77
  86. package/dist/{chunk-X732DPW4.cjs.map → chunk-VWCMOWGH.cjs.map} +1 -1
  87. package/dist/{chunk-HEV52I7A.cjs → chunk-XS35KPBZ.cjs} +190 -202
  88. package/dist/chunk-XS35KPBZ.cjs.map +1 -0
  89. package/dist/{chunk-EFEKAPS2.cjs → chunk-YVL3XATO.cjs} +3 -3
  90. package/dist/{chunk-EFEKAPS2.cjs.map → chunk-YVL3XATO.cjs.map} +1 -1
  91. package/dist/{chunk-EJPV3QY3.js → chunk-YXCE2HSK.js} +3 -3
  92. package/dist/{chunk-EJPV3QY3.js.map → chunk-YXCE2HSK.js.map} +1 -1
  93. package/dist/{chunk-OJEXXH5D.cjs → chunk-ZBI52NP2.cjs} +4 -4
  94. package/dist/{chunk-OJEXXH5D.cjs.map → chunk-ZBI52NP2.cjs.map} +1 -1
  95. package/dist/components/Autocomplete/index.cjs +4 -4
  96. package/dist/components/Autocomplete/index.js +3 -3
  97. package/dist/components/Badge/index.cjs +3 -3
  98. package/dist/components/Badge/index.js +1 -1
  99. package/dist/components/Card/index.cjs +15 -15
  100. package/dist/components/Card/index.d.cts +8 -3
  101. package/dist/components/Card/index.d.ts +8 -3
  102. package/dist/components/Card/index.js +1 -1
  103. package/dist/components/CountryCodeDropdown/index.cjs +5 -5
  104. package/dist/components/CountryCodeDropdown/index.js +2 -2
  105. package/dist/components/DateInput/index.cjs +4 -4
  106. package/dist/components/DateInput/index.d.cts +3 -1
  107. package/dist/components/DateInput/index.d.ts +3 -1
  108. package/dist/components/DateInput/index.js +3 -3
  109. package/dist/components/Dropdown/index.cjs +9 -9
  110. package/dist/components/Dropdown/index.d.cts +1 -1
  111. package/dist/components/Dropdown/index.d.ts +1 -1
  112. package/dist/components/Dropdown/index.js +3 -3
  113. package/dist/components/Input/index.cjs +3 -3
  114. package/dist/components/Input/index.js +1 -1
  115. package/dist/components/Label/index.cjs +3 -3
  116. package/dist/components/Label/index.js +1 -1
  117. package/dist/components/MediaEditor/index.cjs +9 -9
  118. package/dist/components/MediaEditor/index.js +4 -4
  119. package/dist/components/PhoneInput/index.cjs +4 -4
  120. package/dist/components/PhoneInput/index.js +2 -2
  121. package/dist/components/RichTextEditor/index.cjs +7 -7
  122. package/dist/components/RichTextEditor/index.js +4 -4
  123. package/dist/components/Select/index.cjs +4 -4
  124. package/dist/components/Select/index.js +2 -2
  125. package/dist/components/Sheet/index.cjs +10 -10
  126. package/dist/components/Sheet/index.d.cts +1 -1
  127. package/dist/components/Sheet/index.d.ts +1 -1
  128. package/dist/components/Sheet/index.js +1 -1
  129. package/dist/components/SuperChat/index.cjs +17 -17
  130. package/dist/components/SuperChat/index.d.cts +4 -4
  131. package/dist/components/SuperChat/index.d.ts +4 -4
  132. package/dist/components/SuperChat/index.js +6 -6
  133. package/dist/components/SuperChat/plugins/index.cjs +4 -4
  134. package/dist/components/SuperChat/plugins/index.d.cts +3 -3
  135. package/dist/components/SuperChat/plugins/index.d.ts +3 -3
  136. package/dist/components/SuperChat/plugins/index.js +3 -3
  137. package/dist/components/Switch/index.cjs +4 -4
  138. package/dist/components/Switch/index.js +1 -1
  139. package/dist/components/Table/index.cjs +9 -9
  140. package/dist/components/Table/index.js +1 -1
  141. package/dist/components/Text/index.cjs +4 -4
  142. package/dist/components/Text/index.d.cts +1 -1
  143. package/dist/components/Text/index.d.ts +1 -1
  144. package/dist/components/Text/index.js +1 -1
  145. package/dist/datavis.cjs +2 -2
  146. package/dist/datavis.js +1 -1
  147. package/dist/esheet.cjs +12 -12
  148. package/dist/esheet.js +9 -9
  149. package/dist/hooks/index.cjs +2 -2
  150. package/dist/hooks/index.d.cts +1 -1
  151. package/dist/hooks/index.d.ts +1 -1
  152. package/dist/hooks/index.js +1 -1
  153. package/dist/index.cjs +2294 -776
  154. package/dist/index.cjs.map +1 -1
  155. package/dist/index.d.cts +104 -17
  156. package/dist/index.d.ts +104 -17
  157. package/dist/index.js +860 -67
  158. package/dist/index.js.map +1 -1
  159. package/dist/styles.css +1 -1
  160. package/dist/tailwind-preset.cjs +4 -4
  161. package/dist/tailwind-preset.js +1 -1
  162. package/dist/{types-BYnLjEFg.d.cts → types-B2RLmdVd.d.cts} +3 -1
  163. package/dist/{types-BYnLjEFg.d.ts → types-B2RLmdVd.d.ts} +3 -1
  164. package/dist/{types-CyCwYBlr.d.ts → types-BoTeTPdH.d.ts} +1 -1
  165. package/dist/{types-CBh8Zlje.d.cts → types-DyIB9HYT.d.cts} +1 -1
  166. package/dist/{useAnchoredPosition-nXdSFKHf.d.ts → useAnchoredPosition-C7PNglzD.d.cts} +6 -2
  167. package/dist/{useAnchoredPosition-nXdSFKHf.d.cts → useAnchoredPosition-C7PNglzD.d.ts} +6 -2
  168. package/package.json +6 -6
  169. package/dist/chunk-2YDKLURF.js.map +0 -1
  170. package/dist/chunk-3OME4UHL.cjs.map +0 -1
  171. package/dist/chunk-6XGESZ4S.js.map +0 -1
  172. package/dist/chunk-7V6SUOBV.js.map +0 -1
  173. package/dist/chunk-BS5NOKZD.js.map +0 -1
  174. package/dist/chunk-CPUDOVWH.cjs.map +0 -1
  175. package/dist/chunk-DHKYGVP7.js +0 -3
  176. package/dist/chunk-HEV52I7A.cjs.map +0 -1
  177. package/dist/chunk-JY4U2QWO.cjs.map +0 -1
  178. package/dist/chunk-KQGGKE36.js.map +0 -1
  179. package/dist/chunk-KZ7QKUJS.cjs.map +0 -1
  180. package/dist/chunk-NGPEXCC7.cjs.map +0 -1
  181. package/dist/chunk-PGETZ2FP.cjs.map +0 -1
  182. package/dist/chunk-PNJAFZDC.cjs.map +0 -1
  183. package/dist/chunk-QA6ZDHFP.js.map +0 -1
  184. package/dist/chunk-QKKYMNR2.js.map +0 -1
  185. package/dist/chunk-QNUPTRW7.js.map +0 -1
  186. package/dist/chunk-SAJSA4TS.js.map +0 -1
  187. package/dist/chunk-UTYUT5YY.cjs +0 -240
  188. package/dist/chunk-ZDEYV373.cjs.map +0 -1
@@ -3,7 +3,7 @@
3
3
  var chunkZZJ4ZVYR_cjs = require('./chunk-ZZJ4ZVYR.cjs');
4
4
  var chunkS5RVSXDV_cjs = require('./chunk-S5RVSXDV.cjs');
5
5
  var jsxRuntime = require('react/jsx-runtime');
6
- var React = require('react');
6
+ var React2 = require('react');
7
7
  var classVarianceAuthority = require('class-variance-authority');
8
8
 
9
9
  function _interopNamespace(e) {
@@ -24,7 +24,7 @@ function _interopNamespace(e) {
24
24
  return Object.freeze(n);
25
25
  }
26
26
 
27
- var React__namespace = /*#__PURE__*/_interopNamespace(React);
27
+ var React2__namespace = /*#__PURE__*/_interopNamespace(React2);
28
28
 
29
29
  var sizeClasses = {
30
30
  sm: "h-4 w-4",
@@ -226,6 +226,68 @@ function SpinnerIcon({ className }) {
226
226
  }
227
227
  );
228
228
  }
229
+ function CollapsiblePill({
230
+ label,
231
+ leadingIcon,
232
+ density = "standard",
233
+ defaultOpen = false,
234
+ pillClassName,
235
+ className,
236
+ title,
237
+ children
238
+ }) {
239
+ const hasContent = Boolean(children);
240
+ const [isOpen, setIsOpen] = React2__namespace.useState(defaultOpen);
241
+ const contentId = React2__namespace.useId();
242
+ React2__namespace.useEffect(() => {
243
+ setIsOpen(defaultOpen);
244
+ }, [defaultOpen]);
245
+ const toggle = () => {
246
+ setIsOpen((open) => !open);
247
+ };
248
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-slot": "collapsible-pill", className, children: [
249
+ /* @__PURE__ */ jsxRuntime.jsxs(
250
+ "button",
251
+ {
252
+ type: "button",
253
+ onClick: hasContent ? toggle : void 0,
254
+ "aria-expanded": hasContent ? isOpen : void 0,
255
+ "aria-controls": hasContent ? contentId : void 0,
256
+ title,
257
+ disabled: !hasContent,
258
+ className: chunkS5RVSXDV_cjs.cn(
259
+ "focus-visible:ring-ring inline-flex items-center gap-1.5 border font-medium transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-1",
260
+ density === "condensed" ? "rounded-[8px] px-2 py-0.5 text-[10px]" : "rounded-[10px] px-[11px] py-1 text-[11px]",
261
+ pillClassName
262
+ ),
263
+ children: [
264
+ leadingIcon,
265
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: label }),
266
+ hasContent && /* @__PURE__ */ jsxRuntime.jsx(
267
+ ChevronIcon,
268
+ {
269
+ direction: isOpen ? "down" : "right",
270
+ className: density === "condensed" ? "h-2.5 w-2.5 opacity-60" : "h-3 w-3 opacity-60"
271
+ }
272
+ )
273
+ ]
274
+ }
275
+ ),
276
+ hasContent && /* @__PURE__ */ jsxRuntime.jsx(
277
+ "div",
278
+ {
279
+ id: contentId,
280
+ "aria-hidden": !isOpen,
281
+ inert: !isOpen || void 0,
282
+ className: chunkS5RVSXDV_cjs.cn(
283
+ "overflow-hidden transition-[max-height,opacity] duration-300 ease-in-out",
284
+ isOpen ? "max-h-[500px] overflow-y-auto opacity-100" : "max-h-0 opacity-0"
285
+ ),
286
+ children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-1.5", children })
287
+ }
288
+ )
289
+ ] });
290
+ }
229
291
  var statusIconVariants = classVarianceAuthority.cva(
230
292
  "flex h-5 w-5 items-center justify-center rounded-full",
231
293
  {
@@ -693,10 +755,8 @@ function ResourceLink({ link, onClick, className }) {
693
755
  function ToolResultDisplay({
694
756
  result,
695
757
  onLinkClick,
696
- showRawData = false,
697
758
  className
698
759
  }) {
699
- const [showJson, setShowJson] = React__namespace.useState(false);
700
760
  if (result.type === "error") {
701
761
  return /* @__PURE__ */ jsxRuntime.jsx(
702
762
  "div",
@@ -709,7 +769,6 @@ function ToolResultDisplay({
709
769
  }
710
770
  );
711
771
  }
712
- const hasRawData = result.type === "json" && result.data !== void 0 && result.data !== null;
713
772
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: chunkS5RVSXDV_cjs.cn("space-y-2", className), children: [
714
773
  result.summary && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-neutral-700 dark:text-neutral-300", children: result.summary }),
715
774
  result.link && /* @__PURE__ */ jsxRuntime.jsx(ResourceLink, { link: result.link, onClick: onLinkClick }),
@@ -724,67 +783,9 @@ function ToolResultDisplay({
724
783
  onClick: onLinkClick
725
784
  },
726
785
  resource.id
727
- )) }),
728
- hasRawData && showRawData && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mt-2", children: [
729
- /* @__PURE__ */ jsxRuntime.jsxs(
730
- "button",
731
- {
732
- onClick: () => setShowJson(!showJson),
733
- className: "flex items-center gap-1 text-xs text-neutral-600 hover:text-neutral-700 dark:text-neutral-400 dark:hover:text-neutral-300",
734
- children: [
735
- /* @__PURE__ */ jsxRuntime.jsx(
736
- "svg",
737
- {
738
- "aria-hidden": "true",
739
- className: chunkS5RVSXDV_cjs.cn(
740
- "h-3 w-3 transition-transform",
741
- showJson && "rotate-90"
742
- ),
743
- fill: "none",
744
- viewBox: "0 0 24 24",
745
- stroke: "currentColor",
746
- strokeWidth: "2",
747
- children: /* @__PURE__ */ jsxRuntime.jsx(
748
- "path",
749
- {
750
- strokeLinecap: "round",
751
- strokeLinejoin: "round",
752
- d: "M9 5l7 7-7 7"
753
- }
754
- )
755
- }
756
- ),
757
- showJson ? "Hide" : "Show",
758
- " raw data"
759
- ]
760
- }
761
- ),
762
- showJson && /* @__PURE__ */ jsxRuntime.jsx("pre", { className: "mt-2 max-h-40 overflow-auto rounded-md bg-neutral-100 p-2 text-xs dark:bg-neutral-800", children: JSON.stringify(result.data, null, 2) })
763
- ] })
786
+ )) })
764
787
  ] });
765
788
  }
766
- var toolCallVariants = classVarianceAuthority.cva(
767
- ["rounded-lg border", "overflow-hidden", "transition-all duration-200"],
768
- {
769
- variants: {
770
- status: {
771
- pending: "border-neutral-200 bg-neutral-50 dark:border-neutral-700 dark:bg-neutral-800/50",
772
- running: "border-primary-200 bg-primary-50/50 dark:border-primary-800 dark:bg-primary-900/20",
773
- success: "border-green-200 bg-green-50/50 dark:border-green-800 dark:bg-green-900/20",
774
- error: "border-red-200 bg-red-50/50 dark:border-red-800 dark:bg-red-900/20",
775
- cancelled: "border-neutral-200 bg-neutral-50 dark:border-neutral-700 dark:bg-neutral-800/50 opacity-60"
776
- },
777
- compact: {
778
- true: "p-2",
779
- false: "p-3"
780
- }
781
- },
782
- defaultVariants: {
783
- status: "pending",
784
- compact: false
785
- }
786
- }
787
- );
788
789
  var TOOL_FRIENDLY_NAMES = {
789
790
  create_patient: "Creating patient",
790
791
  get_patient: "Looking up patient",
@@ -849,120 +850,113 @@ function getParameterSummary(toolName, params) {
849
850
  }
850
851
  return null;
851
852
  }
853
+ var statusPillClasses = {
854
+ pending: "bg-neutral-100 border-neutral-200 text-neutral-600 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-400",
855
+ running: "bg-primary-50 border-primary-200 text-primary-800 dark:bg-primary-900/20 dark:border-primary-800 dark:text-primary-300",
856
+ success: "bg-green-50 border-green-200 text-green-700 dark:bg-green-900/20 dark:border-green-800 dark:text-green-300",
857
+ error: "bg-red-50 border-red-200 text-red-700 dark:bg-red-900/20 dark:border-red-800 dark:text-red-300",
858
+ cancelled: "bg-neutral-100 border-neutral-200 text-neutral-400 opacity-60 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-400"
859
+ };
852
860
  function MCPToolCallDisplay({
853
861
  toolCall,
854
862
  showParameters = true,
855
863
  collapsible = true,
856
- defaultCollapsed = true,
864
+ defaultCollapsed,
857
865
  compact,
866
+ hidden = false,
858
867
  onLinkClick,
859
868
  className
860
869
  }) {
861
- const [showDetails, setShowDetails] = React__namespace.useState(!defaultCollapsed);
862
870
  const formatDuration = (ms) => {
863
871
  if (!ms) return null;
864
872
  if (ms < 1e3) return `${ms}ms`;
865
873
  return `${(ms / 1e3).toFixed(1)}s`;
866
874
  };
867
875
  const friendlyName = getToolFriendlyName(toolCall.toolName, toolCall.status);
876
+ const durationLabel = formatDuration(toolCall.duration);
868
877
  const paramSummary = getParameterSummary(
869
878
  toolCall.toolName,
870
879
  toolCall.parameters
871
880
  );
872
- return /* @__PURE__ */ jsxRuntime.jsx(
881
+ const detailBit = toolCall.status === "success" ? durationLabel : paramSummary ?? durationLabel;
882
+ const pillLabel = detailBit ? `${friendlyName} \xB7 ${detailBit}` : friendlyName;
883
+ const hasParams = showParameters && toolCall.parameters.length > 0;
884
+ const hasBoxContent = Boolean(toolCall.result || toolCall.error || hasParams);
885
+ const isCompleted = toolCall.status === "success" || toolCall.status === "error";
886
+ const effectiveDefaultCollapsed = defaultCollapsed ?? !isCompleted;
887
+ if (hidden) return null;
888
+ const box = /* @__PURE__ */ jsxRuntime.jsxs(
873
889
  "div",
874
890
  {
875
- "data-slot": "ai-tool-call",
876
891
  className: chunkS5RVSXDV_cjs.cn(
877
- toolCallVariants({ status: toolCall.status, compact }),
878
- className
892
+ "w-full max-w-md space-y-2 rounded-lg border border-neutral-200 bg-neutral-50 dark:border-neutral-700 dark:bg-neutral-800/50",
893
+ compact ? "p-2" : "p-3"
879
894
  ),
880
- children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-3", children: [
881
- /* @__PURE__ */ jsxRuntime.jsx(
895
+ children: [
896
+ toolCall.result && /* @__PURE__ */ jsxRuntime.jsx("div", { "data-slot": "ai-tool-result", children: /* @__PURE__ */ jsxRuntime.jsx(
897
+ ToolResultDisplay,
898
+ {
899
+ result: toolCall.result,
900
+ onLinkClick
901
+ }
902
+ ) }),
903
+ toolCall.error && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "rounded-md bg-red-100 p-2 dark:bg-red-900/30", children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-red-700 dark:text-red-300", children: toolCall.error }) }),
904
+ hasParams && /* @__PURE__ */ jsxRuntime.jsxs(
882
905
  "div",
883
906
  {
884
- "data-slot": "ai-tool-icon",
885
- className: "flex h-8 w-8 shrink-0 items-center justify-center rounded-md bg-white/50 text-neutral-600 dark:bg-neutral-700/50 dark:text-neutral-400",
886
- children: getToolIcon(toolCall.toolName)
907
+ "data-slot": "ai-tool-parameters",
908
+ className: "rounded-md bg-neutral-100 p-2 dark:bg-neutral-800",
909
+ children: [
910
+ /* @__PURE__ */ jsxRuntime.jsx("h4", { className: "mb-1.5 text-xs font-medium tracking-wide text-neutral-600 uppercase dark:text-neutral-400", children: "Parameters" }),
911
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-0.5", children: toolCall.parameters.map((param) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-2 text-xs", children: [
912
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "font-mono text-neutral-600 dark:text-neutral-400", children: [
913
+ param.name,
914
+ ":"
915
+ ] }),
916
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-mono text-neutral-700 dark:text-neutral-300", children: typeof param.value === "string" ? param.value : JSON.stringify(param.value) })
917
+ ] }, param.name)) })
918
+ ]
887
919
  }
888
- ),
889
- /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-slot": "ai-tool-content", className: "min-w-0 flex-1", children: [
890
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
891
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-medium text-neutral-900 dark:text-white", children: friendlyName }),
892
- /* @__PURE__ */ jsxRuntime.jsx(ToolStatusIcon, { status: toolCall.status }),
893
- toolCall.duration && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs text-neutral-600 dark:text-neutral-400", children: formatDuration(toolCall.duration) })
894
- ] }),
895
- paramSummary && toolCall.status !== "success" && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-muted-foreground mt-0.5 text-sm", children: paramSummary }),
896
- toolCall.result && /* @__PURE__ */ jsxRuntime.jsx("div", { "data-slot": "ai-tool-result", className: "mt-2", children: /* @__PURE__ */ jsxRuntime.jsx(
897
- ToolResultDisplay,
898
- {
899
- result: toolCall.result,
900
- onLinkClick,
901
- showRawData: showDetails
902
- }
903
- ) }),
904
- toolCall.error && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-2 rounded-md bg-red-100 p-2 dark:bg-red-900/30", children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-red-700 dark:text-red-300", children: toolCall.error }) }),
905
- collapsible && showParameters && toolCall.parameters.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(
906
- "button",
907
- {
908
- onClick: () => setShowDetails(!showDetails),
909
- className: "mt-2 flex items-center gap-1 text-xs text-neutral-600 hover:text-neutral-700 dark:text-neutral-400 dark:hover:text-neutral-300",
910
- children: [
911
- /* @__PURE__ */ jsxRuntime.jsx(
912
- "svg",
913
- {
914
- "aria-hidden": "true",
915
- className: chunkS5RVSXDV_cjs.cn(
916
- "h-3 w-3 transition-transform",
917
- showDetails && "rotate-90"
918
- ),
919
- fill: "none",
920
- viewBox: "0 0 24 24",
921
- stroke: "currentColor",
922
- strokeWidth: "2",
923
- children: /* @__PURE__ */ jsxRuntime.jsx(
924
- "path",
925
- {
926
- strokeLinecap: "round",
927
- strokeLinejoin: "round",
928
- d: "M9 5l7 7-7 7"
929
- }
930
- )
931
- }
932
- ),
933
- showDetails ? "Hide" : "Show",
934
- " details"
935
- ]
936
- }
937
- ),
938
- showDetails && showParameters && toolCall.parameters.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(
939
- "div",
940
- {
941
- "data-slot": "ai-tool-parameters",
942
- className: "mt-3 rounded-md bg-neutral-100 p-2 dark:bg-neutral-800",
943
- children: [
944
- /* @__PURE__ */ jsxRuntime.jsx("h4", { className: "mb-1.5 text-xs font-medium tracking-wide text-neutral-600 uppercase dark:text-neutral-400", children: "Parameters" }),
945
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-0.5", children: toolCall.parameters.map((param) => /* @__PURE__ */ jsxRuntime.jsxs(
946
- "div",
947
- {
948
- className: "flex items-start gap-2 text-xs",
949
- children: [
950
- /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "font-mono text-neutral-600 dark:text-neutral-400", children: [
951
- param.name,
952
- ":"
953
- ] }),
954
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-mono text-neutral-700 dark:text-neutral-300", children: typeof param.value === "string" ? param.value : JSON.stringify(param.value) })
955
- ]
956
- },
957
- param.name
958
- )) })
959
- ]
960
- }
961
- )
962
- ] })
963
- ] })
920
+ )
921
+ ]
922
+ }
923
+ );
924
+ const staticPill = /* @__PURE__ */ jsxRuntime.jsxs(
925
+ "span",
926
+ {
927
+ "data-slot": "ai-tool-pill",
928
+ className: chunkS5RVSXDV_cjs.cn(
929
+ "inline-flex items-center gap-1.5 border font-medium",
930
+ compact ? "rounded-[8px] px-2 py-0.5 text-[10px]" : "rounded-[10px] px-[11px] py-1 text-[11px]",
931
+ statusPillClasses[toolCall.status]
932
+ ),
933
+ children: [
934
+ /* @__PURE__ */ jsxRuntime.jsx(ToolStatusIcon, { status: toolCall.status }),
935
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: pillLabel })
936
+ ]
964
937
  }
965
938
  );
939
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-slot": "ai-tool-call", className, children: !hasBoxContent ? staticPill : collapsible ? (
940
+ // Pill click reveals the whole box (result + params) in one go.
941
+ /* @__PURE__ */ jsxRuntime.jsx(
942
+ CollapsiblePill,
943
+ {
944
+ label: pillLabel,
945
+ leadingIcon: /* @__PURE__ */ jsxRuntime.jsx(ToolStatusIcon, { status: toolCall.status }),
946
+ density: compact ? "condensed" : "standard",
947
+ defaultOpen: !effectiveDefaultCollapsed,
948
+ pillClassName: statusPillClasses[toolCall.status],
949
+ title: "Toggle details",
950
+ children: box
951
+ }
952
+ )
953
+ ) : (
954
+ // Non-collapsible: pill + box always visible.
955
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1.5", children: [
956
+ staticPill,
957
+ box
958
+ ] })
959
+ ) });
966
960
  }
967
961
  var avatarVariants = classVarianceAuthority.cva(
968
962
  "flex shrink-0 items-center justify-center rounded-full",
@@ -1097,6 +1091,39 @@ function AITypingIndicator({ className }) {
1097
1091
  }
1098
1092
  );
1099
1093
  }
1094
+ function ThinkingBlock({
1095
+ text,
1096
+ streaming,
1097
+ defaultCollapsed = false
1098
+ }) {
1099
+ const startedAt = React2__namespace.useRef(Date.now());
1100
+ const [elapsed, setElapsed] = React2__namespace.useState(null);
1101
+ const prevStreaming = React2__namespace.useRef(streaming);
1102
+ React2__namespace.useEffect(() => {
1103
+ if (prevStreaming.current && !streaming) {
1104
+ setElapsed(Math.round((Date.now() - startedAt.current) / 1e3));
1105
+ }
1106
+ prevStreaming.current = streaming;
1107
+ }, [streaming]);
1108
+ const label = streaming ? "Thinking" : elapsed !== null && elapsed > 0 ? `Thought for ${elapsed}s` : "Thought";
1109
+ const dot = streaming ? /* @__PURE__ */ jsxRuntime.jsx(
1110
+ "span",
1111
+ {
1112
+ "aria-hidden": "true",
1113
+ className: "inline-block h-1.5 w-1.5 animate-pulse rounded-full bg-violet-500 dark:bg-violet-400"
1114
+ }
1115
+ ) : null;
1116
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-slot": "ai-message-thinking", children: /* @__PURE__ */ jsxRuntime.jsx(
1117
+ CollapsiblePill,
1118
+ {
1119
+ label,
1120
+ leadingIcon: dot,
1121
+ defaultOpen: !defaultCollapsed,
1122
+ pillClassName: "bg-violet-50 border-violet-200 text-violet-600 hover:bg-violet-100 dark:bg-violet-950/30 dark:border-violet-800 dark:text-violet-400 dark:hover:bg-violet-950/50 focus-visible:ring-violet-500",
1123
+ children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "border-s-2 border-violet-200 ps-3 text-[13px] leading-relaxed text-neutral-600 italic dark:border-violet-700 dark:text-neutral-400", children: text })
1124
+ }
1125
+ ) });
1126
+ }
1100
1127
  function ContentBlock({
1101
1128
  content,
1102
1129
  onLinkClick,
@@ -1105,9 +1132,6 @@ function ContentBlock({
1105
1132
  role,
1106
1133
  renderTextContent
1107
1134
  }) {
1108
- const [isCollapsed, setIsCollapsed] = React__namespace.useState(
1109
- content.collapsed ?? false
1110
- );
1111
1135
  if (content.type === "text" && content.text) {
1112
1136
  if (renderTextContent) {
1113
1137
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "prose prose-sm dark:prose-invert max-w-none", children: renderTextContent(content.text, { messageId, streaming, role }) });
@@ -1125,52 +1149,12 @@ function ContentBlock({
1125
1149
  );
1126
1150
  }
1127
1151
  if (content.type === "thinking" && content.text) {
1128
- return /* @__PURE__ */ jsxRuntime.jsxs(
1129
- "div",
1152
+ return /* @__PURE__ */ jsxRuntime.jsx(
1153
+ ThinkingBlock,
1130
1154
  {
1131
- "data-slot": "ai-message-thinking",
1132
- className: "rounded-lg border border-neutral-200 bg-neutral-50 dark:border-neutral-700 dark:bg-neutral-800/50",
1133
- children: [
1134
- /* @__PURE__ */ jsxRuntime.jsxs(
1135
- "button",
1136
- {
1137
- onClick: () => setIsCollapsed(!isCollapsed),
1138
- className: "flex w-full items-center justify-between px-3 py-2 text-left",
1139
- children: [
1140
- /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-muted-foreground flex items-center gap-2 text-sm", children: [
1141
- /* @__PURE__ */ jsxRuntime.jsx(
1142
- "svg",
1143
- {
1144
- "aria-hidden": "true",
1145
- className: "h-4 w-4",
1146
- fill: "none",
1147
- viewBox: "0 0 24 24",
1148
- stroke: "currentColor",
1149
- strokeWidth: "1.5",
1150
- children: /* @__PURE__ */ jsxRuntime.jsx(
1151
- "path",
1152
- {
1153
- strokeLinecap: "round",
1154
- strokeLinejoin: "round",
1155
- d: "M9.813 15.904L9 18.75l-.813-2.846a4.5 4.5 0 00-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 003.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 003.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 00-3.09 3.09zM18.259 8.715L18 9.75l-.259-1.035a3.375 3.375 0 00-2.455-2.456L14.25 6l1.036-.259a3.375 3.375 0 002.455-2.456L18 2.25l.259 1.035a3.375 3.375 0 002.456 2.456L21.75 6l-1.035.259a3.375 3.375 0 00-2.456 2.456zM16.894 20.567L16.5 21.75l-.394-1.183a2.25 2.25 0 00-1.423-1.423L13.5 18.75l1.183-.394a2.25 2.25 0 001.423-1.423l.394-1.183.394 1.183a2.25 2.25 0 001.423 1.423l1.183.394-1.183.394a2.25 2.25 0 00-1.423 1.423z"
1156
- }
1157
- )
1158
- }
1159
- ),
1160
- "Thinking..."
1161
- ] }),
1162
- /* @__PURE__ */ jsxRuntime.jsx(
1163
- ChevronIcon,
1164
- {
1165
- direction: isCollapsed ? "right" : "down",
1166
- className: "text-neutral-400"
1167
- }
1168
- )
1169
- ]
1170
- }
1171
- ),
1172
- !isCollapsed && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "border-t border-neutral-200 px-3 py-2 dark:border-neutral-700", children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-neutral-600 italic dark:text-neutral-400", children: content.text }) })
1173
- ]
1155
+ text: content.text,
1156
+ streaming,
1157
+ defaultCollapsed: content.collapsed ?? false
1174
1158
  }
1175
1159
  );
1176
1160
  }
@@ -1319,7 +1303,7 @@ var bubbleVariants = classVarianceAuthority.cva("rounded-2xl px-4 py-2.5 w-fit m
1319
1303
  variant: "assistant"
1320
1304
  }
1321
1305
  });
1322
- var ChatBubble = React__namespace.forwardRef(
1306
+ var ChatBubble = React2__namespace.forwardRef(
1323
1307
  ({ className, variant, hasError, accent, style, children, ...props }, ref) => {
1324
1308
  return /* @__PURE__ */ jsxRuntime.jsx(
1325
1309
  "div",
@@ -1346,10 +1330,12 @@ function AIMessageDisplay({
1346
1330
  showTimestamp = false,
1347
1331
  onLinkClick,
1348
1332
  renderTextContent,
1333
+ renderMessageFooter,
1349
1334
  className
1350
1335
  }) {
1351
1336
  const isStreaming = message.status === "streaming";
1352
1337
  const hasContent = message.content.length > 0;
1338
+ const messageFooter = renderMessageFooter?.(message);
1353
1339
  const formatTime = (timestamp) => {
1354
1340
  const date = new Date(timestamp);
1355
1341
  return date.toLocaleTimeString(void 0, {
@@ -1416,6 +1402,7 @@ function AIMessageDisplay({
1416
1402
  )) }) : isStreaming ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(AITypingIndicator, {}) }) : null
1417
1403
  }
1418
1404
  ),
1405
+ messageFooter != null && messageFooter !== false && /* @__PURE__ */ jsxRuntime.jsx("div", { "data-slot": "ai-message-footer", className: "w-fit max-w-[85%]", children: messageFooter }),
1419
1406
  showTimestamp && /* @__PURE__ */ jsxRuntime.jsx(
1420
1407
  "span",
1421
1408
  {
@@ -1439,6 +1426,7 @@ exports.AITypingIndicator = AITypingIndicator;
1439
1426
  exports.ChatBubble = ChatBubble;
1440
1427
  exports.ChevronIcon = ChevronIcon;
1441
1428
  exports.CloseIcon = CloseIcon;
1429
+ exports.CollapsiblePill = CollapsiblePill;
1442
1430
  exports.MCPToolCallDisplay = MCPToolCallDisplay;
1443
1431
  exports.MessageAvatar = MessageAvatar;
1444
1432
  exports.RefreshIcon = RefreshIcon;
@@ -1448,5 +1436,5 @@ exports.SparklesIcon = SparklesIcon;
1448
1436
  exports.SpinnerIcon = SpinnerIcon;
1449
1437
  exports.ToolStatusIcon = ToolStatusIcon;
1450
1438
  exports.getToolIcon = getToolIcon;
1451
- //# sourceMappingURL=chunk-HEV52I7A.cjs.map
1452
- //# sourceMappingURL=chunk-HEV52I7A.cjs.map
1439
+ //# sourceMappingURL=chunk-XS35KPBZ.cjs.map
1440
+ //# sourceMappingURL=chunk-XS35KPBZ.cjs.map