@tetrascience-npm/tetrascience-react-ui 0.6.0 → 0.7.0-beta.103.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (184) hide show
  1. package/README.md +55 -0
  2. package/dist/components/ai/chain-of-thought.cjs +1 -1
  3. package/dist/components/ai/chain-of-thought.cjs.map +1 -1
  4. package/dist/components/ai/chain-of-thought.js +5 -5
  5. package/dist/components/ai/chain-of-thought.js.map +1 -1
  6. package/dist/components/ai/conversation.cjs +2 -2
  7. package/dist/components/ai/conversation.cjs.map +1 -1
  8. package/dist/components/ai/conversation.js +2 -2
  9. package/dist/components/ai/conversation.js.map +1 -1
  10. package/dist/components/ai/queue.cjs +1 -1
  11. package/dist/components/ai/queue.cjs.map +1 -1
  12. package/dist/components/ai/queue.js +9 -9
  13. package/dist/components/ai/queue.js.map +1 -1
  14. package/dist/components/charts/AreaGraph/AreaGraph.cjs +1 -1
  15. package/dist/components/charts/AreaGraph/AreaGraph.cjs.map +1 -1
  16. package/dist/components/charts/AreaGraph/AreaGraph.js +165 -103
  17. package/dist/components/charts/AreaGraph/AreaGraph.js.map +1 -1
  18. package/dist/components/charts/BarGraph/BarGraph.cjs +1 -1
  19. package/dist/components/charts/BarGraph/BarGraph.cjs.map +1 -1
  20. package/dist/components/charts/BarGraph/BarGraph.js +135 -90
  21. package/dist/components/charts/BarGraph/BarGraph.js.map +1 -1
  22. package/dist/components/charts/Boxplot/Boxplot.cjs +1 -1
  23. package/dist/components/charts/Boxplot/Boxplot.cjs.map +1 -1
  24. package/dist/components/charts/Boxplot/Boxplot.js +130 -92
  25. package/dist/components/charts/Boxplot/Boxplot.js.map +1 -1
  26. package/dist/components/charts/ChartTooltip/ChartTooltip.cjs +2 -0
  27. package/dist/components/charts/ChartTooltip/ChartTooltip.cjs.map +1 -0
  28. package/dist/components/charts/ChartTooltip/ChartTooltip.js +163 -0
  29. package/dist/components/charts/ChartTooltip/ChartTooltip.js.map +1 -0
  30. package/dist/components/charts/ChartTooltip/lines.cjs +2 -0
  31. package/dist/components/charts/ChartTooltip/lines.cjs.map +1 -0
  32. package/dist/components/charts/ChartTooltip/lines.js +29 -0
  33. package/dist/components/charts/ChartTooltip/lines.js.map +1 -0
  34. package/dist/components/charts/Chromatogram/Chromatogram.cjs +1 -1
  35. package/dist/components/charts/Chromatogram/Chromatogram.cjs.map +1 -1
  36. package/dist/components/charts/Chromatogram/Chromatogram.js +75 -61
  37. package/dist/components/charts/Chromatogram/Chromatogram.js.map +1 -1
  38. package/dist/components/charts/ChromatogramChart/ChromatogramChart.cjs +1 -1
  39. package/dist/components/charts/ChromatogramChart/ChromatogramChart.cjs.map +1 -1
  40. package/dist/components/charts/ChromatogramChart/ChromatogramChart.js +116 -108
  41. package/dist/components/charts/ChromatogramChart/ChromatogramChart.js.map +1 -1
  42. package/dist/components/charts/ChromatogramChart/annotations.cjs +1 -1
  43. package/dist/components/charts/ChromatogramChart/annotations.cjs.map +1 -1
  44. package/dist/components/charts/ChromatogramChart/annotations.js +32 -32
  45. package/dist/components/charts/ChromatogramChart/annotations.js.map +1 -1
  46. package/dist/components/charts/ChromatogramChart/boundaryMarkers.cjs +1 -1
  47. package/dist/components/charts/ChromatogramChart/boundaryMarkers.cjs.map +1 -1
  48. package/dist/components/charts/ChromatogramChart/boundaryMarkers.js +6 -6
  49. package/dist/components/charts/ChromatogramChart/boundaryMarkers.js.map +1 -1
  50. package/dist/components/charts/ChromatogramChart/constants.cjs +1 -1
  51. package/dist/components/charts/ChromatogramChart/constants.cjs.map +1 -1
  52. package/dist/components/charts/ChromatogramChart/constants.js +11 -5
  53. package/dist/components/charts/ChromatogramChart/constants.js.map +1 -1
  54. package/dist/components/charts/ChromatogramChart/dataProcessing.cjs +1 -1
  55. package/dist/components/charts/ChromatogramChart/dataProcessing.cjs.map +1 -1
  56. package/dist/components/charts/ChromatogramChart/dataProcessing.js +38 -49
  57. package/dist/components/charts/ChromatogramChart/dataProcessing.js.map +1 -1
  58. package/dist/components/charts/DotPlot/DotPlot.cjs +1 -1
  59. package/dist/components/charts/DotPlot/DotPlot.cjs.map +1 -1
  60. package/dist/components/charts/DotPlot/DotPlot.js +112 -88
  61. package/dist/components/charts/DotPlot/DotPlot.js.map +1 -1
  62. package/dist/components/charts/Histogram/Histogram.cjs +1 -1
  63. package/dist/components/charts/Histogram/Histogram.cjs.map +1 -1
  64. package/dist/components/charts/Histogram/Histogram.js +132 -115
  65. package/dist/components/charts/Histogram/Histogram.js.map +1 -1
  66. package/dist/components/charts/LineGraph/LineGraph.cjs +1 -1
  67. package/dist/components/charts/LineGraph/LineGraph.cjs.map +1 -1
  68. package/dist/components/charts/LineGraph/LineGraph.js +151 -111
  69. package/dist/components/charts/LineGraph/LineGraph.js.map +1 -1
  70. package/dist/components/charts/PieChart/PieChart.cjs +1 -1
  71. package/dist/components/charts/PieChart/PieChart.cjs.map +1 -1
  72. package/dist/components/charts/PieChart/PieChart.js +81 -70
  73. package/dist/components/charts/PieChart/PieChart.js.map +1 -1
  74. package/dist/components/charts/PlateMap/PlateMap.cjs +1 -1
  75. package/dist/components/charts/PlateMap/PlateMap.cjs.map +1 -1
  76. package/dist/components/charts/PlateMap/PlateMap.js +271 -256
  77. package/dist/components/charts/PlateMap/PlateMap.js.map +1 -1
  78. package/dist/components/charts/PlateMap/constants.cjs +1 -1
  79. package/dist/components/charts/PlateMap/constants.cjs.map +1 -1
  80. package/dist/components/charts/PlateMap/constants.js +20 -29
  81. package/dist/components/charts/PlateMap/constants.js.map +1 -1
  82. package/dist/components/charts/ScatterGraph/ScatterGraph.cjs +1 -1
  83. package/dist/components/charts/ScatterGraph/ScatterGraph.cjs.map +1 -1
  84. package/dist/components/charts/ScatterGraph/ScatterGraph.js +154 -106
  85. package/dist/components/charts/ScatterGraph/ScatterGraph.js.map +1 -1
  86. package/dist/components/composed/DataAppShell/DataAppShell.cjs +1 -1
  87. package/dist/components/composed/DataAppShell/DataAppShell.cjs.map +1 -1
  88. package/dist/components/composed/DataAppShell/DataAppShell.js +118 -111
  89. package/dist/components/composed/DataAppShell/DataAppShell.js.map +1 -1
  90. package/dist/components/composed/PlateMapEditor/PlateMapGrid.cjs +1 -1
  91. package/dist/components/composed/PlateMapEditor/PlateMapGrid.cjs.map +1 -1
  92. package/dist/components/composed/PlateMapEditor/PlateMapGrid.js +1 -1
  93. package/dist/components/composed/PlateMapEditor/PlateMapGrid.js.map +1 -1
  94. package/dist/components/composed/PlateMapEditor/WellLegend.cjs +1 -1
  95. package/dist/components/composed/PlateMapEditor/WellLegend.cjs.map +1 -1
  96. package/dist/components/composed/PlateMapEditor/WellLegend.js +8 -8
  97. package/dist/components/composed/PlateMapEditor/WellLegend.js.map +1 -1
  98. package/dist/components/composed/RichListItem/RichListItem.cjs +1 -1
  99. package/dist/components/composed/RichListItem/RichListItem.cjs.map +1 -1
  100. package/dist/components/composed/RichListItem/RichListItem.js +16 -16
  101. package/dist/components/composed/RichListItem/RichListItem.js.map +1 -1
  102. package/dist/components/ui/accordion.cjs +1 -1
  103. package/dist/components/ui/accordion.cjs.map +1 -1
  104. package/dist/components/ui/accordion.js +1 -1
  105. package/dist/components/ui/accordion.js.map +1 -1
  106. package/dist/components/ui/badge.cjs +1 -1
  107. package/dist/components/ui/badge.cjs.map +1 -1
  108. package/dist/components/ui/badge.js +8 -8
  109. package/dist/components/ui/badge.js.map +1 -1
  110. package/dist/components/ui/button.cjs +1 -1
  111. package/dist/components/ui/button.cjs.map +1 -1
  112. package/dist/components/ui/button.js +11 -11
  113. package/dist/components/ui/button.js.map +1 -1
  114. package/dist/components/ui/checkbox.cjs +1 -1
  115. package/dist/components/ui/checkbox.cjs.map +1 -1
  116. package/dist/components/ui/checkbox.js +1 -1
  117. package/dist/components/ui/checkbox.js.map +1 -1
  118. package/dist/components/ui/combobox.cjs +1 -1
  119. package/dist/components/ui/combobox.cjs.map +1 -1
  120. package/dist/components/ui/combobox.js +12 -12
  121. package/dist/components/ui/combobox.js.map +1 -1
  122. package/dist/components/ui/input-group.cjs +1 -1
  123. package/dist/components/ui/input-group.cjs.map +1 -1
  124. package/dist/components/ui/input-group.js +19 -19
  125. package/dist/components/ui/input-group.js.map +1 -1
  126. package/dist/components/ui/item.cjs +1 -1
  127. package/dist/components/ui/item.cjs.map +1 -1
  128. package/dist/components/ui/item.js +1 -1
  129. package/dist/components/ui/item.js.map +1 -1
  130. package/dist/components/ui/menubar.cjs +1 -1
  131. package/dist/components/ui/menubar.cjs.map +1 -1
  132. package/dist/components/ui/menubar.js +1 -1
  133. package/dist/components/ui/menubar.js.map +1 -1
  134. package/dist/components/ui/navigation-menu.cjs +1 -1
  135. package/dist/components/ui/navigation-menu.cjs.map +1 -1
  136. package/dist/components/ui/navigation-menu.js +54 -54
  137. package/dist/components/ui/navigation-menu.js.map +1 -1
  138. package/dist/components/ui/radio-group.cjs +1 -1
  139. package/dist/components/ui/radio-group.cjs.map +1 -1
  140. package/dist/components/ui/radio-group.js +1 -1
  141. package/dist/components/ui/radio-group.js.map +1 -1
  142. package/dist/components/ui/resizable.cjs +1 -1
  143. package/dist/components/ui/resizable.cjs.map +1 -1
  144. package/dist/components/ui/resizable.js +27 -15
  145. package/dist/components/ui/resizable.js.map +1 -1
  146. package/dist/components/ui/select.cjs +1 -1
  147. package/dist/components/ui/select.cjs.map +1 -1
  148. package/dist/components/ui/select.js +1 -1
  149. package/dist/components/ui/select.js.map +1 -1
  150. package/dist/components/ui/slider.cjs +1 -1
  151. package/dist/components/ui/slider.cjs.map +1 -1
  152. package/dist/components/ui/slider.js +9 -9
  153. package/dist/components/ui/slider.js.map +1 -1
  154. package/dist/components/ui/table.cjs +1 -1
  155. package/dist/components/ui/table.cjs.map +1 -1
  156. package/dist/components/ui/table.js +13 -13
  157. package/dist/components/ui/table.js.map +1 -1
  158. package/dist/components/ui/tabs.cjs +1 -1
  159. package/dist/components/ui/tabs.cjs.map +1 -1
  160. package/dist/components/ui/tabs.js +7 -7
  161. package/dist/components/ui/tabs.js.map +1 -1
  162. package/dist/components/ui/toggle.cjs +1 -1
  163. package/dist/components/ui/toggle.cjs.map +1 -1
  164. package/dist/components/ui/toggle.js +12 -12
  165. package/dist/components/ui/toggle.js.map +1 -1
  166. package/dist/hooks/use-element-size.cjs +2 -0
  167. package/dist/hooks/use-element-size.cjs.map +1 -0
  168. package/dist/hooks/use-element-size.js +21 -0
  169. package/dist/hooks/use-element-size.js.map +1 -0
  170. package/dist/hooks/use-plotly-theme.cjs +1 -1
  171. package/dist/hooks/use-plotly-theme.cjs.map +1 -1
  172. package/dist/hooks/use-plotly-theme.js +4 -2
  173. package/dist/hooks/use-plotly-theme.js.map +1 -1
  174. package/dist/index.cjs +1 -1
  175. package/dist/index.css +1 -1
  176. package/dist/index.d.ts +254 -77
  177. package/dist/index.js +587 -581
  178. package/dist/index.js.map +1 -1
  179. package/dist/index.tailwind.css +1 -1
  180. package/dist/utils/colors.cjs +1 -1
  181. package/dist/utils/colors.cjs.map +1 -1
  182. package/dist/utils/colors.js +38 -93
  183. package/dist/utils/colors.js.map +1 -1
  184. package/package.json +18 -12
package/README.md CHANGED
@@ -392,6 +392,61 @@ Visit <http://localhost:6006>.
392
392
  - [Theming Guide](./THEMING.md) - Customise the design system
393
393
  - [Contributing](./CONTRIBUTING.md#development-setup) - Clone the repo and run `yarn storybook`
394
394
 
395
+ ## MCP server (for AI coding agents)
396
+
397
+ This library exposes an [MCP](https://modelcontextprotocol.io/) server so AI
398
+ coding agents (Claude Code, Cursor, Claude Desktop) can query authoritative
399
+ component lists, prop/variant options, and usage examples instead of guessing —
400
+ reducing hallucinated component APIs when scaffolding a data app.
401
+
402
+ There are two endpoints. Pick whichever fits; you can add both.
403
+
404
+ | Endpoint | URL | Tools |
405
+ | --- | --- | --- |
406
+ | **Deployed** (no local checkout needed) | `https://ts-lib-ui-kit-storybook.vercel.app/api/mcp` | docs: `list_components`, `get_component`, `search_components` |
407
+ | **Local** (needs `yarn storybook` running) | `http://localhost:6006/mcp` | full set: docs **+** write/preview/test stories |
408
+
409
+ ### Add the connection
410
+
411
+ **Claude Code** — register the deployed server (HTTP transport):
412
+
413
+ ```bash
414
+ claude mcp add --transport http ts-ui-kit https://ts-lib-ui-kit-storybook.vercel.app/api/mcp
415
+ ```
416
+
417
+ Use `--scope project` to share it with your team via a checked-in `.mcp.json`, or
418
+ `--scope user` to make it available across all your projects. For the local
419
+ server, run `yarn storybook` first, then:
420
+
421
+ ```bash
422
+ claude mcp add --transport http ts-ui-kit-local http://localhost:6006/mcp
423
+ ```
424
+
425
+ **Cursor / Claude Desktop / other clients** — add an HTTP MCP server to the
426
+ client's MCP config (e.g. Cursor's `.cursor/mcp.json`, or Claude Desktop's
427
+ `claude_desktop_config.json`):
428
+
429
+ ```json
430
+ {
431
+ "mcpServers": {
432
+ "ts-ui-kit": {
433
+ "type": "http",
434
+ "url": "https://ts-lib-ui-kit-storybook.vercel.app/api/mcp"
435
+ }
436
+ }
437
+ }
438
+ ```
439
+
440
+ **Any client (generic helper):**
441
+
442
+ ```bash
443
+ npx mcp-add --type http --url "https://ts-lib-ui-kit-storybook.vercel.app/api/mcp"
444
+ ```
445
+
446
+ Then ask your agent something like *"using the ts-ui-kit MCP, list the available
447
+ components"* or *"build a form using ts-ui-kit primitives"* to confirm it's wired
448
+ up.
449
+
395
450
  ## Tech Stack
396
451
 
397
452
  - React 19
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),l=require("lucide-react"),i=require("../ui/collapsible.cjs"),s=require("../../lib/utils.cjs"),h=({className:t,defaultOpen:a=!0,...o})=>e.jsx(i.Collapsible,{className:s.cn("overflow-hidden rounded-lg text-sm",t),defaultOpen:a,...o}),u=({className:t,children:a,title:o="Chain of Thought",icon:r,isStreaming:n=!1,...p})=>e.jsx(i.CollapsibleTrigger,{className:s.cn("group flex w-full items-center gap-2 text-muted-foreground text-sm transition-colors hover:text-foreground",t),...p,children:a??e.jsxs(e.Fragment,{children:[r??e.jsx(l.Brain,{className:"size-4 text-muted-foreground"}),e.jsxs("span",{className:"flex-1 text-left items-center gap-2",children:[o,n&&e.jsx("span",{className:"size-1.5 animate-pulse rounded-full bg-primary"})]}),e.jsx(l.ChevronUpIcon,{className:"size-4 text-muted-foreground opacity-0 transition-all group-focus-visible:opacity-100 group-hover:opacity-100 group-data-[state=open]:opacity-100 group-data-[state=closed]:rotate-180","data-slot":"collapsible-chevron"})]})}),c=({className:t,...a})=>e.jsx(i.CollapsibleContent,{className:s.cn("flex flex-col gap-2.5 pb-4 pt-3","data-[state=closed]:animate-out data-[state=open]:animate-in","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:slide-out-to-top-1 data-[state=open]:slide-in-from-top-1",t),...a}),x={bullet:e.jsx("span",{className:"mt-[7px] ml-1 size-1.5 shrink-0 rounded-full bg-muted-foreground/50"}),search:e.jsx(l.SearchIcon,{className:"mt-0.5 w-[18px] size-3.5 shrink-0 text-muted-foreground"}),image:e.jsx(l.ImageIcon,{className:"mt-0.5 size-3.5 shrink-0 text-muted-foreground"})},d=({variant:t="bullet",className:a,children:o,...r})=>{const n=typeof t=="string"?x[t]:t;return e.jsxs("div",{className:s.cn("flex items-start gap-2 text-muted-foreground",a),...r,children:[e.jsx("span",{className:"flex shrink-0",children:n}),e.jsx("span",{className:"min-w-0 flex-1 leading-relaxed",children:o})]})},g=({className:t,...a})=>e.jsx("div",{className:s.cn("ml-[6px] flex flex-wrap gap-1.5 border-l-2 border-muted-foreground/20 py-0.5 pl-3",t),...a}),m=({className:t,children:a,...o})=>e.jsx("a",{className:s.cn("inline-flex items-center rounded-full border border-border/60 bg-muted/50 px-2 py-0.5 text-xs text-muted-foreground transition-colors",o.href&&"cursor-pointer hover:bg-muted hover:text-foreground",t),rel:"noreferrer",target:"_blank",...o,children:a}),f=({src:t,alt:a="",caption:o,className:r,...n})=>e.jsxs("figure",{className:s.cn("ml-[22px] overflow-hidden rounded-lg border",r),...n,children:[e.jsx("img",{alt:a,className:"max-h-64 w-full object-cover",src:t}),o&&e.jsx("figcaption",{className:"border-t px-3 py-2 text-xs italic text-muted-foreground/70",children:o})]});h.displayName="ChainOfThought";u.displayName="ChainOfThoughtTrigger";c.displayName="ChainOfThoughtContent";d.displayName="ChainOfThoughtStep";g.displayName="ChainOfThoughtSources";m.displayName="ChainOfThoughtSource";f.displayName="ChainOfThoughtImage";exports.ChainOfThought=h;exports.ChainOfThoughtContent=c;exports.ChainOfThoughtImage=f;exports.ChainOfThoughtSource=m;exports.ChainOfThoughtSources=g;exports.ChainOfThoughtStep=d;exports.ChainOfThoughtTrigger=u;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),l=require("lucide-react"),i=require("../ui/collapsible.cjs"),s=require("../../lib/utils.cjs"),h=({className:t,defaultOpen:a=!0,...o})=>e.jsx(i.Collapsible,{className:s.cn("overflow-hidden rounded-lg text-sm",t),defaultOpen:a,...o}),c=({className:t,children:a,title:o="Chain of Thought",icon:r,isStreaming:n=!1,...p})=>e.jsx(i.CollapsibleTrigger,{className:s.cn("group flex w-full items-center gap-2 text-muted-foreground text-sm transition-colors hover:text-foreground",t),...p,children:a??e.jsxs(e.Fragment,{children:[r??e.jsx(l.Brain,{className:"size-4 text-muted-foreground"}),e.jsxs("span",{className:"flex-1 text-left items-center gap-2",children:[o,n&&e.jsx("span",{className:"size-1.5 animate-pulse rounded-full bg-primary"})]}),e.jsx(l.ChevronUpIcon,{className:"size-4 text-muted-foreground opacity-0 transition-all group-focus-visible:opacity-100 group-hover:opacity-100 group-data-[state=open]:opacity-100 group-data-[state=closed]:rotate-180","data-slot":"collapsible-chevron"})]})}),u=({className:t,...a})=>e.jsx(i.CollapsibleContent,{className:s.cn("flex flex-col gap-2.5 pb-4 pt-3","data-[state=closed]:animate-out data-[state=open]:animate-in","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:slide-out-to-top-1 data-[state=open]:slide-in-from-top-1",t),...a}),x={bullet:e.jsx("span",{className:"mt-[7px] ml-1 size-1.5 shrink-0 rounded-full bg-muted-foreground/50"}),search:e.jsx(l.SearchIcon,{className:"mt-0.5 w-[18px] size-3.5 shrink-0 text-muted-foreground"}),image:e.jsx(l.ImageIcon,{className:"mt-0.5 size-3.5 shrink-0 text-muted-foreground"})},d=({variant:t="bullet",className:a,children:o,...r})=>{const n=typeof t=="string"?x[t]:t;return e.jsxs("div",{className:s.cn("flex items-start gap-2 text-muted-foreground",a),...r,children:[e.jsx("span",{className:"flex shrink-0",children:n}),e.jsx("span",{className:"min-w-0 flex-1 leading-relaxed",children:o})]})},g=({className:t,...a})=>e.jsx("div",{className:s.cn("ml-[6px] flex flex-wrap gap-1.5 border-l-2 border-muted-foreground/20 py-0.5 pl-3",t),...a}),m=({className:t,children:a,...o})=>e.jsx("a",{className:s.cn("inline-flex items-center rounded-full border border-border/60 bg-muted/50 px-2 py-0.5 text-xs text-muted-foreground transition-colors",o.href&&"cursor-pointer hover:bg-accent hover:text-accent-foreground",t),rel:"noreferrer",target:"_blank",...o,children:a}),f=({src:t,alt:a="",caption:o,className:r,...n})=>e.jsxs("figure",{className:s.cn("ml-[22px] overflow-hidden rounded-lg border",r),...n,children:[e.jsx("img",{alt:a,className:"max-h-64 w-full object-cover",src:t}),o&&e.jsx("figcaption",{className:"border-t px-3 py-2 text-xs italic text-muted-foreground/70",children:o})]});h.displayName="ChainOfThought";c.displayName="ChainOfThoughtTrigger";u.displayName="ChainOfThoughtContent";d.displayName="ChainOfThoughtStep";g.displayName="ChainOfThoughtSources";m.displayName="ChainOfThoughtSource";f.displayName="ChainOfThoughtImage";exports.ChainOfThought=h;exports.ChainOfThoughtContent=u;exports.ChainOfThoughtImage=f;exports.ChainOfThoughtSource=m;exports.ChainOfThoughtSources=g;exports.ChainOfThoughtStep=d;exports.ChainOfThoughtTrigger=c;
2
2
  //# sourceMappingURL=chain-of-thought.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"chain-of-thought.cjs","sources":["../../../src/components/ai/chain-of-thought.tsx"],"sourcesContent":["import { Brain, ChevronUpIcon, ImageIcon, SearchIcon } from \"lucide-react\";\n\nimport type { ComponentProps, ReactNode } from \"react\";\n\nimport {\n Collapsible,\n CollapsibleContent,\n CollapsibleTrigger,\n} from \"@/components/ui/collapsible\";\nimport { cn } from \"@/lib/utils\";\n\n// ---------------------------------------------------------------------------\n// ChainOfThought (root)\n// ---------------------------------------------------------------------------\n\nexport type ChainOfThoughtProps = ComponentProps<typeof Collapsible>;\n\nexport const ChainOfThought = ({\n className,\n defaultOpen = true,\n ...props\n}: ChainOfThoughtProps) => (\n <Collapsible\n className={cn(\"overflow-hidden rounded-lg text-sm\", className)}\n defaultOpen={defaultOpen}\n {...props}\n />\n);\n\n// ---------------------------------------------------------------------------\n// ChainOfThoughtTrigger\n// ---------------------------------------------------------------------------\n\nexport type ChainOfThoughtTriggerProps = ComponentProps<typeof CollapsibleTrigger> & {\n title?: string;\n icon?: ReactNode;\n /** When true, renders a subtle animated dot next to the title. */\n isStreaming?: boolean;\n};\n\nexport const ChainOfThoughtTrigger = ({\n className,\n children,\n title = \"Chain of Thought\",\n icon,\n isStreaming = false,\n ...props\n}: ChainOfThoughtTriggerProps) => (\n <CollapsibleTrigger\n className={cn(\n \"group flex w-full items-center gap-2 text-muted-foreground text-sm transition-colors hover:text-foreground\",\n className\n )}\n {...props}\n >\n {children ?? (\n <>\n {icon ?? <Brain className=\"size-4 text-muted-foreground\" />}\n <span className=\"flex-1 text-left items-center gap-2\">\n {title}\n {isStreaming && (\n <span className=\"size-1.5 animate-pulse rounded-full bg-primary\" />\n )}\n </span>\n <ChevronUpIcon\n className=\"size-4 text-muted-foreground opacity-0 transition-all group-focus-visible:opacity-100 group-hover:opacity-100 group-data-[state=open]:opacity-100 group-data-[state=closed]:rotate-180\"\n data-slot=\"collapsible-chevron\"\n />\n </>\n )}\n </CollapsibleTrigger>\n);\n\n// ---------------------------------------------------------------------------\n// ChainOfThoughtContent\n// ---------------------------------------------------------------------------\n\nexport type ChainOfThoughtContentProps = ComponentProps<typeof CollapsibleContent>;\n\nexport const ChainOfThoughtContent = ({\n className,\n ...props\n}: ChainOfThoughtContentProps) => (\n <CollapsibleContent\n className={cn(\n \"flex flex-col gap-2.5 pb-4 pt-3\",\n \"data-[state=closed]:animate-out data-[state=open]:animate-in\",\n \"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0\",\n \"data-[state=closed]:slide-out-to-top-1 data-[state=open]:slide-in-from-top-1\",\n className\n )}\n {...props}\n />\n);\n\n// ---------------------------------------------------------------------------\n// ChainOfThoughtStep\n// ---------------------------------------------------------------------------\n\nexport type ChainOfThoughtStepVariant = \"bullet\" | \"search\" | \"image\";\n\nexport type ChainOfThoughtStepProps = ComponentProps<\"div\"> & {\n /**\n * Visual prefix for the step.\n * - `\"bullet\"` — small dot (default, plain reasoning text)\n * - `\"search\"` — magnifying-glass (web search / tool call)\n * - `\"image\"` — image icon (image fetch / vision step)\n * - ReactNode — custom icon\n */\n variant?: ChainOfThoughtStepVariant | ReactNode;\n};\n\nconst STEP_ICONS: Record<ChainOfThoughtStepVariant, ReactNode> = {\n bullet: (\n <span className=\"mt-[7px] ml-1 size-1.5 shrink-0 rounded-full bg-muted-foreground/50\" />\n ),\n search: <SearchIcon className=\"mt-0.5 w-[18px] size-3.5 shrink-0 text-muted-foreground\" />,\n image: <ImageIcon className=\"mt-0.5 size-3.5 shrink-0 text-muted-foreground\" />,\n};\n\nexport const ChainOfThoughtStep = ({\n variant = \"bullet\",\n className,\n children,\n ...props\n}: ChainOfThoughtStepProps) => {\n const icon =\n typeof variant === \"string\"\n ? STEP_ICONS[variant as ChainOfThoughtStepVariant]\n : variant;\n\n return (\n <div\n className={cn(\"flex items-start gap-2 text-muted-foreground\", className)}\n {...props}\n >\n <span className=\"flex shrink-0\">{icon}</span>\n <span className=\"min-w-0 flex-1 leading-relaxed\">{children}</span>\n </div>\n );\n};\n\n// ---------------------------------------------------------------------------\n// ChainOfThoughtSources — inline chip group with left bar\n// ---------------------------------------------------------------------------\n\nexport type ChainOfThoughtSourcesProps = ComponentProps<\"div\">;\n\nexport const ChainOfThoughtSources = ({\n className,\n ...props\n}: ChainOfThoughtSourcesProps) => (\n <div\n className={cn(\n \"ml-[6px] flex flex-wrap gap-1.5 border-l-2 border-muted-foreground/20 py-0.5 pl-3\",\n className\n )}\n {...props}\n />\n);\n\nexport type ChainOfThoughtSourceProps = ComponentProps<\"a\">;\n\nexport const ChainOfThoughtSource = ({\n className,\n children,\n ...props\n}: ChainOfThoughtSourceProps) => (\n <a\n className={cn(\n \"inline-flex items-center rounded-full border border-border/60 bg-muted/50 px-2 py-0.5 text-xs text-muted-foreground transition-colors\",\n props.href && \"cursor-pointer hover:bg-muted hover:text-foreground\",\n className\n )}\n rel=\"noreferrer\"\n target=\"_blank\"\n {...props}\n >\n {children}\n </a>\n);\n\n// ---------------------------------------------------------------------------\n// ChainOfThoughtImage — inline image with optional caption\n// ---------------------------------------------------------------------------\n\nexport type ChainOfThoughtImageProps = ComponentProps<\"figure\"> & {\n src: string;\n alt?: string;\n caption?: string;\n};\n\nexport const ChainOfThoughtImage = ({\n src,\n alt = \"\",\n caption,\n className,\n ...props\n}: ChainOfThoughtImageProps) => (\n <figure\n className={cn(\"ml-[22px] overflow-hidden rounded-lg border\", className)}\n {...props}\n >\n <img alt={alt} className=\"max-h-64 w-full object-cover\" src={src} />\n {caption && (\n <figcaption className=\"border-t px-3 py-2 text-xs italic text-muted-foreground/70\">\n {caption}\n </figcaption>\n )}\n </figure>\n);\n\nChainOfThought.displayName = \"ChainOfThought\";\nChainOfThoughtTrigger.displayName = \"ChainOfThoughtTrigger\";\nChainOfThoughtContent.displayName = \"ChainOfThoughtContent\";\nChainOfThoughtStep.displayName = \"ChainOfThoughtStep\";\nChainOfThoughtSources.displayName = \"ChainOfThoughtSources\";\nChainOfThoughtSource.displayName = \"ChainOfThoughtSource\";\nChainOfThoughtImage.displayName = \"ChainOfThoughtImage\";\n"],"names":["ChainOfThought","className","defaultOpen","props","jsx","Collapsible","cn","ChainOfThoughtTrigger","children","title","icon","isStreaming","CollapsibleTrigger","jsxs","Fragment","Brain","ChevronUpIcon","ChainOfThoughtContent","CollapsibleContent","STEP_ICONS","SearchIcon","ImageIcon","ChainOfThoughtStep","variant","ChainOfThoughtSources","ChainOfThoughtSource","ChainOfThoughtImage","src","alt","caption"],"mappings":"mNAiBaA,EAAiB,CAAC,CAC7B,UAAAC,EACA,YAAAC,EAAc,GACd,GAAGC,CACL,IACEC,EAAAA,IAACC,EAAAA,YAAA,CACC,UAAWC,EAAAA,GAAG,qCAAsCL,CAAS,EAC7D,YAAAC,EACC,GAAGC,CAAA,CACN,EAcWI,EAAwB,CAAC,CACpC,UAAAN,EACA,SAAAO,EACA,MAAAC,EAAQ,mBACR,KAAAC,EACA,YAAAC,EAAc,GACd,GAAGR,CACL,IACEC,EAAAA,IAACQ,EAAAA,mBAAA,CACC,UAAWN,EAAAA,GACT,6GACAL,CAAA,EAED,GAAGE,EAEH,YACCU,EAAAA,KAAAC,EAAAA,SAAA,CACG,SAAA,CAAAJ,GAAQN,EAAAA,IAACW,EAAAA,MAAA,CAAM,UAAU,8BAAA,CAA+B,EACzDF,EAAAA,KAAC,OAAA,CAAK,UAAU,sCACb,SAAA,CAAAJ,EACAE,GACCP,EAAAA,IAAC,OAAA,CAAK,UAAU,gDAAA,CAAiD,CAAA,EAErE,EACAA,EAAAA,IAACY,EAAAA,cAAA,CACC,UAAU,yLACV,YAAU,qBAAA,CAAA,CACZ,CAAA,CACF,CAAA,CAEJ,EASWC,EAAwB,CAAC,CACpC,UAAAhB,EACA,GAAGE,CACL,IACEC,EAAAA,IAACc,EAAAA,mBAAA,CACC,UAAWZ,EAAAA,GACT,kCACA,+DACA,6DACA,+EACAL,CAAA,EAED,GAAGE,CAAA,CACN,EAoBIgB,EAA2D,CAC/D,OACEf,EAAAA,IAAC,OAAA,CAAK,UAAU,qEAAA,CAAsE,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CAAA,CAEJ,EAGF7B,EAAe,YAAc,iBAC7BO,EAAsB,YAAc,wBACpCU,EAAsB,YAAc,wBACpCK,EAAmB,YAAc,qBACjCE,EAAsB,YAAc,wBACpCC,EAAqB,YAAc,uBACnCC,EAAoB,YAAc"}
1
+ {"version":3,"file":"chain-of-thought.cjs","sources":["../../../src/components/ai/chain-of-thought.tsx"],"sourcesContent":["import { Brain, ChevronUpIcon, ImageIcon, SearchIcon } from \"lucide-react\";\n\nimport type { ComponentProps, ReactNode } from \"react\";\n\nimport {\n Collapsible,\n CollapsibleContent,\n CollapsibleTrigger,\n} from \"@/components/ui/collapsible\";\nimport { cn } from \"@/lib/utils\";\n\n// ---------------------------------------------------------------------------\n// ChainOfThought (root)\n// ---------------------------------------------------------------------------\n\nexport type ChainOfThoughtProps = ComponentProps<typeof Collapsible>;\n\nexport const ChainOfThought = ({\n className,\n defaultOpen = true,\n ...props\n}: ChainOfThoughtProps) => (\n <Collapsible\n className={cn(\"overflow-hidden rounded-lg text-sm\", className)}\n defaultOpen={defaultOpen}\n {...props}\n />\n);\n\n// ---------------------------------------------------------------------------\n// ChainOfThoughtTrigger\n// ---------------------------------------------------------------------------\n\nexport type ChainOfThoughtTriggerProps = ComponentProps<typeof CollapsibleTrigger> & {\n title?: string;\n icon?: ReactNode;\n /** When true, renders a subtle animated dot next to the title. */\n isStreaming?: boolean;\n};\n\nexport const ChainOfThoughtTrigger = ({\n className,\n children,\n title = \"Chain of Thought\",\n icon,\n isStreaming = false,\n ...props\n}: ChainOfThoughtTriggerProps) => (\n <CollapsibleTrigger\n className={cn(\n \"group flex w-full items-center gap-2 text-muted-foreground text-sm transition-colors hover:text-foreground\",\n className\n )}\n {...props}\n >\n {children ?? (\n <>\n {icon ?? <Brain className=\"size-4 text-muted-foreground\" />}\n <span className=\"flex-1 text-left items-center gap-2\">\n {title}\n {isStreaming && (\n <span className=\"size-1.5 animate-pulse rounded-full bg-primary\" />\n )}\n </span>\n <ChevronUpIcon\n className=\"size-4 text-muted-foreground opacity-0 transition-all group-focus-visible:opacity-100 group-hover:opacity-100 group-data-[state=open]:opacity-100 group-data-[state=closed]:rotate-180\"\n data-slot=\"collapsible-chevron\"\n />\n </>\n )}\n </CollapsibleTrigger>\n);\n\n// ---------------------------------------------------------------------------\n// ChainOfThoughtContent\n// ---------------------------------------------------------------------------\n\nexport type ChainOfThoughtContentProps = ComponentProps<typeof CollapsibleContent>;\n\nexport const ChainOfThoughtContent = ({\n className,\n ...props\n}: ChainOfThoughtContentProps) => (\n <CollapsibleContent\n className={cn(\n \"flex flex-col gap-2.5 pb-4 pt-3\",\n \"data-[state=closed]:animate-out data-[state=open]:animate-in\",\n \"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0\",\n \"data-[state=closed]:slide-out-to-top-1 data-[state=open]:slide-in-from-top-1\",\n className\n )}\n {...props}\n />\n);\n\n// ---------------------------------------------------------------------------\n// ChainOfThoughtStep\n// ---------------------------------------------------------------------------\n\nexport type ChainOfThoughtStepVariant = \"bullet\" | \"search\" | \"image\";\n\nexport type ChainOfThoughtStepProps = ComponentProps<\"div\"> & {\n /**\n * Visual prefix for the step.\n * - `\"bullet\"` — small dot (default, plain reasoning text)\n * - `\"search\"` — magnifying-glass (web search / tool call)\n * - `\"image\"` — image icon (image fetch / vision step)\n * - ReactNode — custom icon\n */\n variant?: ChainOfThoughtStepVariant | ReactNode;\n};\n\nconst STEP_ICONS: Record<ChainOfThoughtStepVariant, ReactNode> = {\n bullet: (\n <span className=\"mt-[7px] ml-1 size-1.5 shrink-0 rounded-full bg-muted-foreground/50\" />\n ),\n search: <SearchIcon className=\"mt-0.5 w-[18px] size-3.5 shrink-0 text-muted-foreground\" />,\n image: <ImageIcon className=\"mt-0.5 size-3.5 shrink-0 text-muted-foreground\" />,\n};\n\nexport const ChainOfThoughtStep = ({\n variant = \"bullet\",\n className,\n children,\n ...props\n}: ChainOfThoughtStepProps) => {\n const icon =\n typeof variant === \"string\"\n ? STEP_ICONS[variant as ChainOfThoughtStepVariant]\n : variant;\n\n return (\n <div\n className={cn(\"flex items-start gap-2 text-muted-foreground\", className)}\n {...props}\n >\n <span className=\"flex shrink-0\">{icon}</span>\n <span className=\"min-w-0 flex-1 leading-relaxed\">{children}</span>\n </div>\n );\n};\n\n// ---------------------------------------------------------------------------\n// ChainOfThoughtSources — inline chip group with left bar\n// ---------------------------------------------------------------------------\n\nexport type ChainOfThoughtSourcesProps = ComponentProps<\"div\">;\n\nexport const ChainOfThoughtSources = ({\n className,\n ...props\n}: ChainOfThoughtSourcesProps) => (\n <div\n className={cn(\n \"ml-[6px] flex flex-wrap gap-1.5 border-l-2 border-muted-foreground/20 py-0.5 pl-3\",\n className\n )}\n {...props}\n />\n);\n\nexport type ChainOfThoughtSourceProps = ComponentProps<\"a\">;\n\nexport const ChainOfThoughtSource = ({\n className,\n children,\n ...props\n}: ChainOfThoughtSourceProps) => (\n <a\n className={cn(\n \"inline-flex items-center rounded-full border border-border/60 bg-muted/50 px-2 py-0.5 text-xs text-muted-foreground transition-colors\",\n props.href && \"cursor-pointer hover:bg-accent hover:text-accent-foreground\",\n className\n )}\n rel=\"noreferrer\"\n target=\"_blank\"\n {...props}\n >\n {children}\n </a>\n);\n\n// ---------------------------------------------------------------------------\n// ChainOfThoughtImage — inline image with optional caption\n// ---------------------------------------------------------------------------\n\nexport type ChainOfThoughtImageProps = ComponentProps<\"figure\"> & {\n src: string;\n alt?: string;\n caption?: string;\n};\n\nexport const ChainOfThoughtImage = ({\n src,\n alt = \"\",\n caption,\n className,\n ...props\n}: ChainOfThoughtImageProps) => (\n <figure\n className={cn(\"ml-[22px] overflow-hidden rounded-lg border\", className)}\n {...props}\n >\n <img alt={alt} className=\"max-h-64 w-full object-cover\" src={src} />\n {caption && (\n <figcaption className=\"border-t px-3 py-2 text-xs italic text-muted-foreground/70\">\n {caption}\n </figcaption>\n )}\n </figure>\n);\n\nChainOfThought.displayName = \"ChainOfThought\";\nChainOfThoughtTrigger.displayName = \"ChainOfThoughtTrigger\";\nChainOfThoughtContent.displayName = \"ChainOfThoughtContent\";\nChainOfThoughtStep.displayName = \"ChainOfThoughtStep\";\nChainOfThoughtSources.displayName = \"ChainOfThoughtSources\";\nChainOfThoughtSource.displayName = \"ChainOfThoughtSource\";\nChainOfThoughtImage.displayName = \"ChainOfThoughtImage\";\n"],"names":["ChainOfThought","className","defaultOpen","props","jsx","Collapsible","cn","ChainOfThoughtTrigger","children","title","icon","isStreaming","CollapsibleTrigger","jsxs","Fragment","Brain","ChevronUpIcon","ChainOfThoughtContent","CollapsibleContent","STEP_ICONS","SearchIcon","ImageIcon","ChainOfThoughtStep","variant","ChainOfThoughtSources","ChainOfThoughtSource","ChainOfThoughtImage","src","alt","caption"],"mappings":"mNAiBaA,EAAiB,CAAC,CAC7B,UAAAC,EACA,YAAAC,EAAc,GACd,GAAGC,CACL,IACEC,EAAAA,IAACC,EAAAA,YAAA,CACC,UAAWC,EAAAA,GAAG,qCAAsCL,CAAS,EAC7D,YAAAC,EACC,GAAGC,CAAA,CACN,EAcWI,EAAwB,CAAC,CACpC,UAAAN,EACA,SAAAO,EACA,MAAAC,EAAQ,mBACR,KAAAC,EACA,YAAAC,EAAc,GACd,GAAGR,CACL,IACEC,EAAAA,IAACQ,EAAAA,mBAAA,CACC,UAAWN,EAAAA,GACT,6GACAL,CAAA,EAED,GAAGE,EAEH,YACCU,EAAAA,KAAAC,EAAAA,SAAA,CACG,SAAA,CAAAJ,GAAQN,EAAAA,IAACW,EAAAA,MAAA,CAAM,UAAU,8BAAA,CAA+B,EACzDF,EAAAA,KAAC,OAAA,CAAK,UAAU,sCACb,SAAA,CAAAJ,EACAE,GACCP,EAAAA,IAAC,OAAA,CAAK,UAAU,gDAAA,CAAiD,CAAA,EAErE,EACAA,EAAAA,IAACY,EAAAA,cAAA,CACC,UAAU,yLACV,YAAU,qBAAA,CAAA,CACZ,CAAA,CACF,CAAA,CAEJ,EASWC,EAAwB,CAAC,CACpC,UAAAhB,EACA,GAAGE,CACL,I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L,CAAS,EACrE,GAAGE,EAEJ,SAAA,CAAAC,EAAAA,IAAC,MAAA,CAAI,IAAAwB,EAAU,UAAU,+BAA+B,IAAAD,EAAU,EACjEE,GACCzB,EAAAA,IAAC,aAAA,CAAW,UAAU,6DACnB,SAAAyB,CAAA,CACH,CAAA,CAAA,CAEJ,EAGF7B,EAAe,YAAc,iBAC7BO,EAAsB,YAAc,wBACpCU,EAAsB,YAAc,wBACpCK,EAAmB,YAAc,qBACjCE,EAAsB,YAAc,wBACpCC,EAAqB,YAAc,uBACnCC,EAAoB,YAAc"}
@@ -1,5 +1,5 @@
1
1
  import { jsx as t, jsxs as l, Fragment as d } from "react/jsx-runtime";
2
- import { Brain as m, ChevronUpIcon as u, ImageIcon as h, SearchIcon as c } from "lucide-react";
2
+ import { Brain as c, ChevronUpIcon as m, ImageIcon as h, SearchIcon as u } from "lucide-react";
3
3
  import { Collapsible as g, CollapsibleContent as f, CollapsibleTrigger as p } from "../ui/collapsible.js";
4
4
  import { cn as r } from "../../lib/utils.js";
5
5
  const x = ({
@@ -29,13 +29,13 @@ const x = ({
29
29
  ),
30
30
  ...i,
31
31
  children: a ?? /* @__PURE__ */ l(d, { children: [
32
- s ?? /* @__PURE__ */ t(m, { className: "size-4 text-muted-foreground" }),
32
+ s ?? /* @__PURE__ */ t(c, { className: "size-4 text-muted-foreground" }),
33
33
  /* @__PURE__ */ l("span", { className: "flex-1 text-left items-center gap-2", children: [
34
34
  o,
35
35
  n && /* @__PURE__ */ t("span", { className: "size-1.5 animate-pulse rounded-full bg-primary" })
36
36
  ] }),
37
37
  /* @__PURE__ */ t(
38
- u,
38
+ m,
39
39
  {
40
40
  className: "size-4 text-muted-foreground opacity-0 transition-all group-focus-visible:opacity-100 group-hover:opacity-100 group-data-[state=open]:opacity-100 group-data-[state=closed]:rotate-180",
41
41
  "data-slot": "collapsible-chevron"
@@ -60,7 +60,7 @@ const x = ({
60
60
  }
61
61
  ), b = {
62
62
  bullet: /* @__PURE__ */ t("span", { className: "mt-[7px] ml-1 size-1.5 shrink-0 rounded-full bg-muted-foreground/50" }),
63
- search: /* @__PURE__ */ t(c, { className: "mt-0.5 w-[18px] size-3.5 shrink-0 text-muted-foreground" }),
63
+ search: /* @__PURE__ */ t(u, { className: "mt-0.5 w-[18px] size-3.5 shrink-0 text-muted-foreground" }),
64
64
  image: /* @__PURE__ */ t(h, { className: "mt-0.5 size-3.5 shrink-0 text-muted-foreground" })
65
65
  }, T = ({
66
66
  variant: e = "bullet",
@@ -101,7 +101,7 @@ const x = ({
101
101
  {
102
102
  className: r(
103
103
  "inline-flex items-center rounded-full border border-border/60 bg-muted/50 px-2 py-0.5 text-xs text-muted-foreground transition-colors",
104
- o.href && "cursor-pointer hover:bg-muted hover:text-foreground",
104
+ o.href && "cursor-pointer hover:bg-accent hover:text-accent-foreground",
105
105
  e
106
106
  ),
107
107
  rel: "noreferrer",
@@ -1 +1 @@
1
- {"version":3,"file":"chain-of-thought.js","sources":["../../../src/components/ai/chain-of-thought.tsx"],"sourcesContent":["import { Brain, ChevronUpIcon, ImageIcon, SearchIcon } from \"lucide-react\";\n\nimport type { ComponentProps, ReactNode } from \"react\";\n\nimport {\n Collapsible,\n CollapsibleContent,\n CollapsibleTrigger,\n} from \"@/components/ui/collapsible\";\nimport { cn } from \"@/lib/utils\";\n\n// ---------------------------------------------------------------------------\n// ChainOfThought (root)\n// ---------------------------------------------------------------------------\n\nexport type ChainOfThoughtProps = ComponentProps<typeof Collapsible>;\n\nexport const ChainOfThought = ({\n className,\n defaultOpen = true,\n ...props\n}: ChainOfThoughtProps) => (\n <Collapsible\n className={cn(\"overflow-hidden rounded-lg text-sm\", className)}\n defaultOpen={defaultOpen}\n {...props}\n />\n);\n\n// ---------------------------------------------------------------------------\n// ChainOfThoughtTrigger\n// ---------------------------------------------------------------------------\n\nexport type ChainOfThoughtTriggerProps = ComponentProps<typeof CollapsibleTrigger> & {\n title?: string;\n icon?: ReactNode;\n /** When true, renders a subtle animated dot next to the title. */\n isStreaming?: boolean;\n};\n\nexport const ChainOfThoughtTrigger = ({\n className,\n children,\n title = \"Chain of Thought\",\n icon,\n isStreaming = false,\n ...props\n}: ChainOfThoughtTriggerProps) => (\n <CollapsibleTrigger\n className={cn(\n \"group flex w-full items-center gap-2 text-muted-foreground text-sm transition-colors hover:text-foreground\",\n className\n )}\n {...props}\n >\n {children ?? (\n <>\n {icon ?? <Brain className=\"size-4 text-muted-foreground\" />}\n <span className=\"flex-1 text-left items-center gap-2\">\n {title}\n {isStreaming && (\n <span className=\"size-1.5 animate-pulse rounded-full bg-primary\" />\n )}\n </span>\n <ChevronUpIcon\n className=\"size-4 text-muted-foreground opacity-0 transition-all group-focus-visible:opacity-100 group-hover:opacity-100 group-data-[state=open]:opacity-100 group-data-[state=closed]:rotate-180\"\n data-slot=\"collapsible-chevron\"\n />\n </>\n )}\n </CollapsibleTrigger>\n);\n\n// ---------------------------------------------------------------------------\n// ChainOfThoughtContent\n// ---------------------------------------------------------------------------\n\nexport type ChainOfThoughtContentProps = ComponentProps<typeof CollapsibleContent>;\n\nexport const ChainOfThoughtContent = ({\n className,\n ...props\n}: ChainOfThoughtContentProps) => (\n <CollapsibleContent\n className={cn(\n \"flex flex-col gap-2.5 pb-4 pt-3\",\n \"data-[state=closed]:animate-out data-[state=open]:animate-in\",\n \"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0\",\n \"data-[state=closed]:slide-out-to-top-1 data-[state=open]:slide-in-from-top-1\",\n className\n )}\n {...props}\n />\n);\n\n// ---------------------------------------------------------------------------\n// ChainOfThoughtStep\n// ---------------------------------------------------------------------------\n\nexport type ChainOfThoughtStepVariant = \"bullet\" | \"search\" | \"image\";\n\nexport type ChainOfThoughtStepProps = ComponentProps<\"div\"> & {\n /**\n * Visual prefix for the step.\n * - `\"bullet\"` — small dot (default, plain reasoning text)\n * - `\"search\"` — magnifying-glass (web search / tool call)\n * - `\"image\"` — image icon (image fetch / vision step)\n * - ReactNode — custom icon\n */\n variant?: ChainOfThoughtStepVariant | ReactNode;\n};\n\nconst STEP_ICONS: Record<ChainOfThoughtStepVariant, ReactNode> = {\n bullet: (\n <span className=\"mt-[7px] ml-1 size-1.5 shrink-0 rounded-full bg-muted-foreground/50\" />\n ),\n search: <SearchIcon className=\"mt-0.5 w-[18px] size-3.5 shrink-0 text-muted-foreground\" />,\n image: <ImageIcon className=\"mt-0.5 size-3.5 shrink-0 text-muted-foreground\" />,\n};\n\nexport const ChainOfThoughtStep = ({\n variant = \"bullet\",\n className,\n children,\n ...props\n}: ChainOfThoughtStepProps) => {\n const icon =\n typeof variant === \"string\"\n ? STEP_ICONS[variant as ChainOfThoughtStepVariant]\n : variant;\n\n return (\n <div\n className={cn(\"flex items-start gap-2 text-muted-foreground\", className)}\n {...props}\n >\n <span className=\"flex shrink-0\">{icon}</span>\n <span className=\"min-w-0 flex-1 leading-relaxed\">{children}</span>\n </div>\n );\n};\n\n// ---------------------------------------------------------------------------\n// ChainOfThoughtSources — inline chip group with left bar\n// ---------------------------------------------------------------------------\n\nexport type ChainOfThoughtSourcesProps = ComponentProps<\"div\">;\n\nexport const ChainOfThoughtSources = ({\n className,\n ...props\n}: ChainOfThoughtSourcesProps) => (\n <div\n className={cn(\n \"ml-[6px] flex flex-wrap gap-1.5 border-l-2 border-muted-foreground/20 py-0.5 pl-3\",\n className\n )}\n {...props}\n />\n);\n\nexport type ChainOfThoughtSourceProps = ComponentProps<\"a\">;\n\nexport const ChainOfThoughtSource = ({\n className,\n children,\n ...props\n}: ChainOfThoughtSourceProps) => (\n <a\n className={cn(\n \"inline-flex items-center rounded-full border border-border/60 bg-muted/50 px-2 py-0.5 text-xs text-muted-foreground transition-colors\",\n props.href && \"cursor-pointer hover:bg-muted hover:text-foreground\",\n className\n )}\n rel=\"noreferrer\"\n target=\"_blank\"\n {...props}\n >\n {children}\n </a>\n);\n\n// ---------------------------------------------------------------------------\n// ChainOfThoughtImage — inline image with optional caption\n// ---------------------------------------------------------------------------\n\nexport type ChainOfThoughtImageProps = ComponentProps<\"figure\"> & {\n src: string;\n alt?: string;\n caption?: string;\n};\n\nexport const ChainOfThoughtImage = ({\n src,\n alt = \"\",\n caption,\n className,\n ...props\n}: ChainOfThoughtImageProps) => (\n <figure\n className={cn(\"ml-[22px] overflow-hidden rounded-lg border\", className)}\n {...props}\n >\n <img alt={alt} className=\"max-h-64 w-full object-cover\" src={src} />\n {caption && (\n <figcaption className=\"border-t px-3 py-2 text-xs italic text-muted-foreground/70\">\n {caption}\n </figcaption>\n )}\n </figure>\n);\n\nChainOfThought.displayName = \"ChainOfThought\";\nChainOfThoughtTrigger.displayName = \"ChainOfThoughtTrigger\";\nChainOfThoughtContent.displayName = \"ChainOfThoughtContent\";\nChainOfThoughtStep.displayName = \"ChainOfThoughtStep\";\nChainOfThoughtSources.displayName = \"ChainOfThoughtSources\";\nChainOfThoughtSource.displayName = \"ChainOfThoughtSource\";\nChainOfThoughtImage.displayName = \"ChainOfThoughtImage\";\n"],"names":["ChainOfThought","className","defaultOpen","props","jsx","Collapsible","cn","ChainOfThoughtTrigger","children","title","icon","isStreaming","CollapsibleTrigger","jsxs","Fragment","Brain","ChevronUpIcon","ChainOfThoughtContent","CollapsibleContent","STEP_ICONS","SearchIcon","ImageIcon","ChainOfThoughtStep","variant","ChainOfThoughtSources","ChainOfThoughtSource","ChainOfThoughtImage","src","alt","caption"],"mappings":";;;;AAiBO,MAAMA,IAAiB,CAAC;AAAA,EAC7B,WAAAC;AAAA,EACA,aAAAC,IAAc;AAAA,EACd,GAAGC;AACL,MACE,gBAAAC;AAAA,EAACC;AAAA,EAAA;AAAA,IACC,WAAWC,EAAG,sCAAsCL,CAAS;AAAA,IAC7D,aAAAC;AAAA,IACC,GAAGC;AAAA,EAAA;AACN,GAcWI,IAAwB,CAAC;AAAA,EACpC,WAAAN;AAAA,EACA,UAAAO;AAAA,EACA,OAAAC,IAAQ;AAAA,EACR,MAAAC;AAAA,EACA,aAAAC,IAAc;AAAA,EACd,GAAGR;AACL,MACE,gBA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B,cAAc;AACnCC,EAAoB,cAAc;"}
1
+ {"version":3,"file":"chain-of-thought.js","sources":["../../../src/components/ai/chain-of-thought.tsx"],"sourcesContent":["import { Brain, ChevronUpIcon, ImageIcon, SearchIcon } from \"lucide-react\";\n\nimport type { ComponentProps, ReactNode } from \"react\";\n\nimport {\n Collapsible,\n CollapsibleContent,\n CollapsibleTrigger,\n} from \"@/components/ui/collapsible\";\nimport { cn } from \"@/lib/utils\";\n\n// ---------------------------------------------------------------------------\n// ChainOfThought (root)\n// ---------------------------------------------------------------------------\n\nexport type ChainOfThoughtProps = ComponentProps<typeof Collapsible>;\n\nexport const ChainOfThought = ({\n className,\n defaultOpen = true,\n ...props\n}: ChainOfThoughtProps) => (\n <Collapsible\n className={cn(\"overflow-hidden rounded-lg text-sm\", className)}\n defaultOpen={defaultOpen}\n {...props}\n />\n);\n\n// ---------------------------------------------------------------------------\n// ChainOfThoughtTrigger\n// ---------------------------------------------------------------------------\n\nexport type ChainOfThoughtTriggerProps = ComponentProps<typeof CollapsibleTrigger> & {\n title?: string;\n icon?: ReactNode;\n /** When true, renders a subtle animated dot next to the title. */\n isStreaming?: boolean;\n};\n\nexport const ChainOfThoughtTrigger = ({\n className,\n children,\n title = \"Chain of Thought\",\n icon,\n isStreaming = false,\n ...props\n}: ChainOfThoughtTriggerProps) => (\n <CollapsibleTrigger\n className={cn(\n \"group flex w-full items-center gap-2 text-muted-foreground text-sm transition-colors hover:text-foreground\",\n className\n )}\n {...props}\n >\n {children ?? (\n <>\n {icon ?? <Brain className=\"size-4 text-muted-foreground\" />}\n <span className=\"flex-1 text-left items-center gap-2\">\n {title}\n {isStreaming && (\n <span className=\"size-1.5 animate-pulse rounded-full bg-primary\" />\n )}\n </span>\n <ChevronUpIcon\n className=\"size-4 text-muted-foreground opacity-0 transition-all group-focus-visible:opacity-100 group-hover:opacity-100 group-data-[state=open]:opacity-100 group-data-[state=closed]:rotate-180\"\n data-slot=\"collapsible-chevron\"\n />\n </>\n )}\n </CollapsibleTrigger>\n);\n\n// ---------------------------------------------------------------------------\n// ChainOfThoughtContent\n// ---------------------------------------------------------------------------\n\nexport type ChainOfThoughtContentProps = ComponentProps<typeof CollapsibleContent>;\n\nexport const ChainOfThoughtContent = ({\n className,\n ...props\n}: ChainOfThoughtContentProps) => (\n <CollapsibleContent\n className={cn(\n \"flex flex-col gap-2.5 pb-4 pt-3\",\n \"data-[state=closed]:animate-out data-[state=open]:animate-in\",\n \"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0\",\n \"data-[state=closed]:slide-out-to-top-1 data-[state=open]:slide-in-from-top-1\",\n className\n )}\n {...props}\n />\n);\n\n// ---------------------------------------------------------------------------\n// ChainOfThoughtStep\n// ---------------------------------------------------------------------------\n\nexport type ChainOfThoughtStepVariant = \"bullet\" | \"search\" | \"image\";\n\nexport type ChainOfThoughtStepProps = ComponentProps<\"div\"> & {\n /**\n * Visual prefix for the step.\n * - `\"bullet\"` — small dot (default, plain reasoning text)\n * - `\"search\"` — magnifying-glass (web search / tool call)\n * - `\"image\"` — image icon (image fetch / vision step)\n * - ReactNode — custom icon\n */\n variant?: ChainOfThoughtStepVariant | ReactNode;\n};\n\nconst STEP_ICONS: Record<ChainOfThoughtStepVariant, ReactNode> = {\n bullet: (\n <span className=\"mt-[7px] ml-1 size-1.5 shrink-0 rounded-full bg-muted-foreground/50\" />\n ),\n search: <SearchIcon className=\"mt-0.5 w-[18px] size-3.5 shrink-0 text-muted-foreground\" />,\n image: <ImageIcon className=\"mt-0.5 size-3.5 shrink-0 text-muted-foreground\" />,\n};\n\nexport const ChainOfThoughtStep = ({\n variant = \"bullet\",\n className,\n children,\n ...props\n}: ChainOfThoughtStepProps) => {\n const icon =\n typeof variant === \"string\"\n ? STEP_ICONS[variant as ChainOfThoughtStepVariant]\n : variant;\n\n return (\n <div\n className={cn(\"flex items-start gap-2 text-muted-foreground\", className)}\n {...props}\n >\n <span className=\"flex shrink-0\">{icon}</span>\n <span className=\"min-w-0 flex-1 leading-relaxed\">{children}</span>\n </div>\n );\n};\n\n// ---------------------------------------------------------------------------\n// ChainOfThoughtSources — inline chip group with left bar\n// ---------------------------------------------------------------------------\n\nexport type ChainOfThoughtSourcesProps = ComponentProps<\"div\">;\n\nexport const ChainOfThoughtSources = ({\n className,\n ...props\n}: ChainOfThoughtSourcesProps) => (\n <div\n className={cn(\n \"ml-[6px] flex flex-wrap gap-1.5 border-l-2 border-muted-foreground/20 py-0.5 pl-3\",\n className\n )}\n {...props}\n />\n);\n\nexport type ChainOfThoughtSourceProps = ComponentProps<\"a\">;\n\nexport const ChainOfThoughtSource = ({\n className,\n children,\n ...props\n}: ChainOfThoughtSourceProps) => (\n <a\n className={cn(\n \"inline-flex items-center rounded-full border border-border/60 bg-muted/50 px-2 py-0.5 text-xs text-muted-foreground transition-colors\",\n props.href && \"cursor-pointer hover:bg-accent hover:text-accent-foreground\",\n className\n )}\n rel=\"noreferrer\"\n target=\"_blank\"\n {...props}\n >\n {children}\n </a>\n);\n\n// ---------------------------------------------------------------------------\n// ChainOfThoughtImage — inline image with optional caption\n// ---------------------------------------------------------------------------\n\nexport type ChainOfThoughtImageProps = ComponentProps<\"figure\"> & {\n src: string;\n alt?: string;\n caption?: string;\n};\n\nexport const ChainOfThoughtImage = ({\n src,\n alt = \"\",\n caption,\n className,\n ...props\n}: ChainOfThoughtImageProps) => (\n <figure\n className={cn(\"ml-[22px] overflow-hidden rounded-lg border\", className)}\n {...props}\n >\n <img alt={alt} className=\"max-h-64 w-full object-cover\" src={src} />\n {caption && (\n <figcaption className=\"border-t px-3 py-2 text-xs italic text-muted-foreground/70\">\n {caption}\n </figcaption>\n )}\n </figure>\n);\n\nChainOfThought.displayName = \"ChainOfThought\";\nChainOfThoughtTrigger.displayName = \"ChainOfThoughtTrigger\";\nChainOfThoughtContent.displayName = \"ChainOfThoughtContent\";\nChainOfThoughtStep.displayName = \"ChainOfThoughtStep\";\nChainOfThoughtSources.displayName = \"ChainOfThoughtSources\";\nChainOfThoughtSource.displayName = \"ChainOfThoughtSource\";\nChainOfThoughtImage.displayName = \"ChainOfThoughtImage\";\n"],"names":["ChainOfThought","className","defaultOpen","props","jsx","Collapsible","cn","ChainOfThoughtTrigger","children","title","icon","isStreaming","CollapsibleTrigger","jsxs","Fragment","Brain","ChevronUpIcon","ChainOfThoughtContent","CollapsibleContent","STEP_ICONS","SearchIcon","ImageIcon","ChainOfThoughtStep","variant","ChainOfThoughtSources","ChainOfThoughtSource","ChainOfThoughtImage","src","alt","caption"],"mappings":";;;;AAiBO,MAAMA,IAAiB,CAAC;AAAA,EAC7B,WAAAC;AAAA,EACA,aAAAC,IAAc;AAAA,EACd,GAAGC;AACL,MACE,gBAAAC;AAAA,EAACC;AAAA,EAAA;AAAA,IACC,WAAWC,EAAG,sCAAsCL,CAAS;AAAA,IAC7D,aAAAC;AAAA,IACC,GAAGC;AAAA,EAAA;AACN,GAcWI,IAAwB,CAAC;AAAA,EACpC,WAAAN;AAAA,EACA,UAAAO;AAAA,EACA,OAAAC,IAAQ;AAAA,EACR,MAAAC;AAAA,EACA,aAAAC,IAAc;AAAA,EACd,GAAGR;AACL,MACE,gBAAAC;AAAA,EAACQ;AAAA,EAAA;AAAA,IACC,WAAWN;AAAA,MACT;AAAA,MACAL;AAAA,IAAA;AAAA,IAED,GAAGE;AAAA,IAEH,eACC,gBAAAU,EAAAC,GAAA,EACG,UAAA;AAAA,MAAAJ,KAAQ,gBAAAN,EAACW,GAAA,EAAM,WAAU,+BAAA,CAA+B;AAAA,MACzD,gBAAAF,EAAC,QAAA,EAAK,WAAU,uCACb,UAAA;AAAA,QAAAJ;AAAA,QACAE,KACC,gBAAAP,EAAC,QAAA,EAAK,WAAU,iDAAA,CAAiD;AAAA,MAAA,GAErE;AAAA,MACA,gBAAAA;AAAA,QAACY;AAAA,QAAA;AAAA,UACC,WAAU;AAAA,UACV,aAAU;AAAA,QAAA;AAAA,MAAA;AAAA,IACZ,EAAA,CACF;AAAA,EAAA;AAEJ,GASWC,IAAwB,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WAAWE;AAAA,MACT;AAAA,MACAH,EAAM,QAAQ;AAAA,MACdF;AAAA,IAAA;AAAA,IAEF,KAAI;AAAA,IACJ,QAAO;AAAA,IACN,GAAGE;AAAA,IAEH,UAAAK;AAAA,EAAA;AACH,GAaWkB,IAAsB,CAAC;AAAA,EAClC,KAAAC;AAAA,EACA,KAAAC,IAAM;AAAA,EACN,SAAAC;AAAA,EACA,WAAA5B;AAAA,EACA,GAAGE;AACL,MACE,gBAAAU;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,WAAWP,EAAG,+CAA+CL,CAAS;AAAA,IACrE,GAAGE;AAAA,IAEJ,UAAA;AAAA,MAAA,gBAAAC,EAAC,OAAA,EAAI,KAAAwB,GAAU,WAAU,gCAA+B,KAAAD,GAAU;AAAA,MACjEE,KACC,gBAAAzB,EAAC,cAAA,EAAW,WAAU,8DACnB,UAAAyB,EAAA,CACH;AAAA,IAAA;AAAA,EAAA;AAEJ;AAGF7B,EAAe,cAAc;AAC7BO,EAAsB,cAAc;AACpCU,EAAsB,cAAc;AACpCK,EAAmB,cAAc;AACjCE,EAAsB,cAAc;AACpCC,EAAqB,cAAc;AACnCC,EAAoB,cAAc;"}
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),u=require("lucide-react"),m=require("react"),i=require("use-stick-to-bottom"),x=require("../ui/button.cjs"),c=require("../../lib/utils.cjs"),j=({className:e,...t})=>o.jsx(i.StickToBottom,{className:c.cn("relative flex-1 overflow-y-hidden",e),initial:"smooth",resize:"smooth",role:"log",...t}),C=({className:e,...t})=>o.jsx(i.StickToBottom.Content,{className:c.cn("flex flex-col gap-8 p-4",e),...t}),g=({className:e,title:t="No messages yet",description:n="Start a conversation to see messages here",icon:s,children:r,...l})=>o.jsx("div",{className:c.cn("flex size-full flex-col items-center justify-center gap-3 p-8 text-center",e),...l,children:r??o.jsxs(o.Fragment,{children:[s&&o.jsx("div",{className:"text-muted-foreground",children:s}),o.jsxs("div",{className:"space-y-1",children:[o.jsx("h3",{className:"font-medium text-sm",children:t}),n&&o.jsx("p",{className:"text-muted-foreground text-sm",children:n})]})]})}),f=({className:e,...t})=>{const{isAtBottom:n,scrollToBottom:s}=i.useStickToBottomContext(),r=m.useCallback(()=>{s()},[s]);return!n&&o.jsx(x.Button,{className:c.cn("absolute bottom-4 left-[50%] translate-x-[-50%] rounded-full dark:bg-background dark:hover:bg-muted",e),onClick:r,size:"icon",type:"button",variant:"outline",...t,children:o.jsx(u.ArrowDownIcon,{className:"size-4"})})},w=e=>e.parts.filter(t=>t.type==="text").map(t=>t.text).join(""),b=e=>`**${e.role.charAt(0).toUpperCase()+e.role.slice(1)}:** ${w(e)}`,v=(e,t=b)=>e.map((n,s)=>t(n,s)).join(`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),u=require("lucide-react"),m=require("react"),i=require("use-stick-to-bottom"),x=require("../ui/button.cjs"),c=require("../../lib/utils.cjs"),j=({className:e,...t})=>o.jsx(i.StickToBottom,{className:c.cn("relative flex-1 overflow-y-hidden",e),initial:"smooth",resize:"smooth",role:"log",...t}),C=({className:e,...t})=>o.jsx(i.StickToBottom.Content,{className:c.cn("flex flex-col gap-8 p-4",e),...t}),g=({className:e,title:t="No messages yet",description:n="Start a conversation to see messages here",icon:s,children:r,...l})=>o.jsx("div",{className:c.cn("flex size-full flex-col items-center justify-center gap-3 p-8 text-center",e),...l,children:r??o.jsxs(o.Fragment,{children:[s&&o.jsx("div",{className:"text-muted-foreground",children:s}),o.jsxs("div",{className:"space-y-1",children:[o.jsx("h3",{className:"font-medium text-sm",children:t}),n&&o.jsx("p",{className:"text-muted-foreground text-sm",children:n})]})]})}),f=({className:e,...t})=>{const{isAtBottom:n,scrollToBottom:s}=i.useStickToBottomContext(),r=m.useCallback(()=>{s()},[s]);return!n&&o.jsx(x.Button,{className:c.cn("absolute bottom-4 left-[50%] translate-x-[-50%] rounded-full dark:bg-background dark:hover:bg-accent",e),onClick:r,size:"icon",type:"button",variant:"outline",...t,children:o.jsx(u.ArrowDownIcon,{className:"size-4"})})},w=e=>e.parts.filter(t=>t.type==="text").map(t=>t.text).join(""),b=e=>`**${e.role.charAt(0).toUpperCase()+e.role.slice(1)}:** ${w(e)}`,v=(e,t=b)=>e.map((n,s)=>t(n,s)).join(`
2
2
 
3
- `),y=({messages:e,filename:t="conversation.md",formatMessage:n=b,className:s,children:r,...l})=>{const k=m.useCallback(()=>{const h=v(e,n),p=new Blob([h],{type:"text/markdown"}),d=URL.createObjectURL(p),a=document.createElement("a");a.href=d,a.download=t,document.body.append(a),a.click(),a.remove(),URL.revokeObjectURL(d)},[e,t,n]);return o.jsx(x.Button,{className:c.cn("absolute top-4 right-4 rounded-full dark:bg-background dark:hover:bg-muted",s),onClick:k,size:"icon",type:"button",variant:"outline",...l,children:r??o.jsx(u.DownloadIcon,{className:"size-4"})})};exports.Conversation=j;exports.ConversationContent=C;exports.ConversationDownload=y;exports.ConversationEmptyState=g;exports.ConversationScrollButton=f;exports.messagesToMarkdown=v;
3
+ `),y=({messages:e,filename:t="conversation.md",formatMessage:n=b,className:s,children:r,...l})=>{const k=m.useCallback(()=>{const h=v(e,n),p=new Blob([h],{type:"text/markdown"}),d=URL.createObjectURL(p),a=document.createElement("a");a.href=d,a.download=t,document.body.append(a),a.click(),a.remove(),URL.revokeObjectURL(d)},[e,t,n]);return o.jsx(x.Button,{className:c.cn("absolute top-4 right-4 rounded-full dark:bg-background dark:hover:bg-accent",s),onClick:k,size:"icon",type:"button",variant:"outline",...l,children:r??o.jsx(u.DownloadIcon,{className:"size-4"})})};exports.Conversation=j;exports.ConversationContent=C;exports.ConversationDownload=y;exports.ConversationEmptyState=g;exports.ConversationScrollButton=f;exports.messagesToMarkdown=v;
4
4
  //# sourceMappingURL=conversation.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"conversation.cjs","sources":["../../../src/components/ai/conversation.tsx"],"sourcesContent":["import { ArrowDownIcon, DownloadIcon } from \"lucide-react\";\nimport { useCallback } from \"react\";\nimport { StickToBottom, useStickToBottomContext } from \"use-stick-to-bottom\";\n\nimport type { UIMessage } from \"ai\";\nimport type { ComponentProps } from \"react\";\n\nimport { Button } from \"@/components/ui/button\";\nimport { cn } from \"@/lib/utils\";\n\nexport type ConversationProps = ComponentProps<typeof StickToBottom>;\n\nexport const Conversation = ({ className, ...props }: ConversationProps) => (\n <StickToBottom\n className={cn(\"relative flex-1 overflow-y-hidden\", className)}\n initial=\"smooth\"\n resize=\"smooth\"\n role=\"log\"\n {...props}\n />\n);\n\nexport type ConversationContentProps = ComponentProps<\n typeof StickToBottom.Content\n>;\n\nexport const ConversationContent = ({\n className,\n ...props\n}: ConversationContentProps) => (\n <StickToBottom.Content\n className={cn(\"flex flex-col gap-8 p-4\", className)}\n {...props}\n />\n);\n\nexport type ConversationEmptyStateProps = ComponentProps<\"div\"> & {\n title?: string;\n description?: string;\n icon?: React.ReactNode;\n};\n\nexport const ConversationEmptyState = ({\n className,\n title = \"No messages yet\",\n description = \"Start a conversation to see messages here\",\n icon,\n children,\n ...props\n}: ConversationEmptyStateProps) => (\n <div\n className={cn(\n \"flex size-full flex-col items-center justify-center gap-3 p-8 text-center\",\n className\n )}\n {...props}\n >\n {children ?? (\n <>\n {icon && <div className=\"text-muted-foreground\">{icon}</div>}\n <div className=\"space-y-1\">\n <h3 className=\"font-medium text-sm\">{title}</h3>\n {description && (\n <p className=\"text-muted-foreground text-sm\">{description}</p>\n )}\n </div>\n </>\n )}\n </div>\n);\n\nexport type ConversationScrollButtonProps = ComponentProps<typeof Button>;\n\nexport const ConversationScrollButton = ({\n className,\n ...props\n}: ConversationScrollButtonProps) => {\n const { isAtBottom, scrollToBottom } = useStickToBottomContext();\n\n const handleScrollToBottom = useCallback(() => {\n scrollToBottom();\n }, [scrollToBottom]);\n\n return (\n !isAtBottom && (\n <Button\n className={cn(\n \"absolute bottom-4 left-[50%] translate-x-[-50%] rounded-full dark:bg-background dark:hover:bg-muted\",\n className\n )}\n onClick={handleScrollToBottom}\n size=\"icon\"\n type=\"button\"\n variant=\"outline\"\n {...props}\n >\n <ArrowDownIcon className=\"size-4\" />\n </Button>\n )\n );\n};\n\nconst getMessageText = (message: UIMessage): string =>\n message.parts\n .filter((part) => part.type === \"text\")\n .map((part) => part.text)\n .join(\"\");\n\nexport type ConversationDownloadProps = Omit<\n ComponentProps<typeof Button>,\n \"onClick\"\n> & {\n messages: UIMessage[];\n filename?: string;\n formatMessage?: (message: UIMessage, index: number) => string;\n};\n\nconst defaultFormatMessage = (message: UIMessage): string => {\n const roleLabel =\n message.role.charAt(0).toUpperCase() + message.role.slice(1);\n return `**${roleLabel}:** ${getMessageText(message)}`;\n};\n\nexport const messagesToMarkdown = (\n messages: UIMessage[],\n formatMessage: (\n message: UIMessage,\n index: number\n ) => string = defaultFormatMessage\n): string => messages.map((msg, i) => formatMessage(msg, i)).join(\"\\n\\n\");\n\nexport const ConversationDownload = ({\n messages,\n filename = \"conversation.md\",\n formatMessage = defaultFormatMessage,\n className,\n children,\n ...props\n}: ConversationDownloadProps) => {\n const handleDownload = useCallback(() => {\n const markdown = messagesToMarkdown(messages, formatMessage);\n const blob = new Blob([markdown], { type: \"text/markdown\" });\n const url = URL.createObjectURL(blob);\n const link = document.createElement(\"a\");\n link.href = url;\n link.download = filename;\n document.body.append(link);\n link.click();\n link.remove();\n URL.revokeObjectURL(url);\n }, [messages, filename, formatMessage]);\n\n return (\n <Button\n className={cn(\n \"absolute top-4 right-4 rounded-full dark:bg-background dark:hover:bg-muted\",\n className\n )}\n onClick={handleDownload}\n size=\"icon\"\n type=\"button\"\n variant=\"outline\"\n {...props}\n >\n {children ?? <DownloadIcon className=\"size-4\" />}\n </Button>\n );\n};\n"],"names":["Conversation","className","props","jsx","StickToBottom","cn","ConversationContent","ConversationEmptyState","title","description","icon","children","jsxs","Fragment","ConversationScrollButton","isAtBottom","scrollToBottom","useStickToBottomContext","handleScrollToBottom","useCallback","Button","ArrowDownIcon","getMessageText","message","part","defaultFormatMessage","messagesToMarkdown","messages","formatMessage","msg","i","ConversationDownload","filename","handleDownload","markdown","blob","url","link","DownloadIcon"],"mappings":"kQAYaA,EAAe,CAAC,CAAE,UAAAC,EAAW,GAAGC,KAC3CC,EAAAA,IAACC,EAAAA,cAAA,CACC,UAAWC,EAAAA,GAAG,oCAAqCJ,CAAS,EAC5D,QAAQ,SACR,OAAO,SACP,KAAK,MACJ,GAAGC,CAAA,CACN,EAOWI,EAAsB,CAAC,CAClC,UAAAL,EACA,GAAGC,CACL,IACEC,EAAAA,IAACC,EAAAA,cAAc,QAAd,CACC,UAAWC,EAAAA,GAAG,0BAA2BJ,CAAS,EACjD,GAAGC,CAAA,CACN,EASWK,EAAyB,CAAC,CACrC,UAAAN,EACA,MAAAO,EAAQ,kBACR,YAAAC,EAAc,4CACd,KAAAC,EACA,SAAAC,EACA,GAAGT,CACL,IACEC,EAAAA,IAAC,MAAA,CACC,UAAWE,EAAAA,GACT,4EACAJ,CAAA,EAED,GAAGC,EAEH,YACCU,EAAAA,KAAAC,EAAAA,SAAA,CACG,SAAA,CAAAH,GAAQP,EAAAA,IAAC,MAAA,CAAI,UAAU,wBAAyB,SAAAO,EAAK,EACtDE,EAAAA,KAAC,MAAA,CAAI,UAAU,YACb,SAAA,CAAAT,EAAAA,IAAC,KAAA,CAAG,UAAU,sBAAuB,SAAAK,EAAM,EAC1CC,GACCN,EAAAA,IAAC,IAAA,CAAE,UAAU,gCAAiC,SAAAM,CAAA,CAAY,CAAA,CAAA,CAE9D,CAAA,CAAA,CACF,CAAA,CAEJ,EAKWK,EAA2B,CAAC,CACvC,UAAAb,EACA,GAAGC,CACL,IAAqC,CACnC,KAAM,CAAE,WAAAa,EAAY,eAAAC,CAAA,EAAmBC,0BAAA,EAEjCC,EAAuBC,EAAAA,YAAY,IAAM,CAC7CH,EAAA,CACF,EAAG,CAACA,CAAc,CAAC,EAEnB,MACE,CAACD,GACC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AK,SACL,QAAQ,UACP,GAAG/B,EAEH,SAAAS,GAAYR,EAAAA,IAACmC,EAAAA,aAAA,CAAa,UAAU,QAAA,CAAS,CAAA,CAAA,CAGpD"}
1
+ {"version":3,"file":"conversation.cjs","sources":["../../../src/components/ai/conversation.tsx"],"sourcesContent":["import { ArrowDownIcon, DownloadIcon } from \"lucide-react\";\nimport { useCallback } from \"react\";\nimport { StickToBottom, useStickToBottomContext } from \"use-stick-to-bottom\";\n\nimport type { UIMessage } from \"ai\";\nimport type { ComponentProps } from \"react\";\n\nimport { Button } from \"@/components/ui/button\";\nimport { cn } from \"@/lib/utils\";\n\nexport type ConversationProps = ComponentProps<typeof StickToBottom>;\n\nexport const Conversation = ({ className, ...props }: ConversationProps) => (\n <StickToBottom\n className={cn(\"relative flex-1 overflow-y-hidden\", className)}\n initial=\"smooth\"\n resize=\"smooth\"\n role=\"log\"\n {...props}\n />\n);\n\nexport type ConversationContentProps = ComponentProps<\n typeof StickToBottom.Content\n>;\n\nexport const ConversationContent = ({\n className,\n ...props\n}: ConversationContentProps) => (\n <StickToBottom.Content\n className={cn(\"flex flex-col gap-8 p-4\", className)}\n {...props}\n />\n);\n\nexport type ConversationEmptyStateProps = ComponentProps<\"div\"> & {\n title?: string;\n description?: string;\n icon?: React.ReactNode;\n};\n\nexport const ConversationEmptyState = ({\n className,\n title = \"No messages yet\",\n description = \"Start a conversation to see messages here\",\n icon,\n children,\n ...props\n}: ConversationEmptyStateProps) => (\n <div\n className={cn(\n \"flex size-full flex-col items-center justify-center gap-3 p-8 text-center\",\n className\n )}\n {...props}\n >\n {children ?? (\n <>\n {icon && <div className=\"text-muted-foreground\">{icon}</div>}\n <div className=\"space-y-1\">\n <h3 className=\"font-medium text-sm\">{title}</h3>\n {description && (\n <p className=\"text-muted-foreground text-sm\">{description}</p>\n )}\n </div>\n </>\n )}\n </div>\n);\n\nexport type ConversationScrollButtonProps = ComponentProps<typeof Button>;\n\nexport const ConversationScrollButton = ({\n className,\n ...props\n}: ConversationScrollButtonProps) => {\n const { isAtBottom, scrollToBottom } = useStickToBottomContext();\n\n const handleScrollToBottom = useCallback(() => {\n scrollToBottom();\n }, [scrollToBottom]);\n\n return (\n !isAtBottom && (\n <Button\n className={cn(\n \"absolute bottom-4 left-[50%] translate-x-[-50%] rounded-full dark:bg-background dark:hover:bg-accent\",\n className\n )}\n onClick={handleScrollToBottom}\n size=\"icon\"\n type=\"button\"\n variant=\"outline\"\n {...props}\n >\n <ArrowDownIcon className=\"size-4\" />\n </Button>\n )\n );\n};\n\nconst getMessageText = (message: UIMessage): string =>\n message.parts\n .filter((part) => part.type === \"text\")\n .map((part) => part.text)\n .join(\"\");\n\nexport type ConversationDownloadProps = Omit<\n ComponentProps<typeof Button>,\n \"onClick\"\n> & {\n messages: UIMessage[];\n filename?: string;\n formatMessage?: (message: UIMessage, index: number) => string;\n};\n\nconst defaultFormatMessage = (message: UIMessage): string => {\n const roleLabel =\n message.role.charAt(0).toUpperCase() + message.role.slice(1);\n return `**${roleLabel}:** ${getMessageText(message)}`;\n};\n\nexport const messagesToMarkdown = (\n messages: UIMessage[],\n formatMessage: (\n message: UIMessage,\n index: number\n ) => string = defaultFormatMessage\n): string => messages.map((msg, i) => formatMessage(msg, i)).join(\"\\n\\n\");\n\nexport const ConversationDownload = ({\n messages,\n filename = \"conversation.md\",\n formatMessage = defaultFormatMessage,\n className,\n children,\n ...props\n}: ConversationDownloadProps) => {\n const handleDownload = useCallback(() => {\n const markdown = messagesToMarkdown(messages, formatMessage);\n const blob = new Blob([markdown], { type: \"text/markdown\" });\n const url = URL.createObjectURL(blob);\n const link = document.createElement(\"a\");\n link.href = url;\n link.download = filename;\n document.body.append(link);\n link.click();\n link.remove();\n URL.revokeObjectURL(url);\n }, [messages, filename, formatMessage]);\n\n return (\n <Button\n className={cn(\n \"absolute top-4 right-4 rounded-full dark:bg-background dark:hover:bg-accent\",\n className\n )}\n onClick={handleDownload}\n size=\"icon\"\n type=\"button\"\n variant=\"outline\"\n {...props}\n >\n {children ?? <DownloadIcon className=\"size-4\" />}\n </Button>\n );\n};\n"],"names":["Conversation","className","props","jsx","StickToBottom","cn","ConversationContent","ConversationEmptyState","title","description","icon","children","jsxs","Fragment","ConversationScrollButton","isAtBottom","scrollToBottom","useStickToBottomContext","handleScrollToBottom","useCallback","Button","ArrowDownIcon","getMessageText","message","part","defaultFormatMessage","messagesToMarkdown","messages","formatMessage","msg","i","ConversationDownload","filename","handleDownload","markdown","blob","url","link","DownloadIcon"],"mappings":"kQAYaA,EAAe,CAAC,CAAE,UAAAC,EAAW,GAAGC,KAC3CC,EAAAA,IAACC,EAAAA,cAAA,CACC,UAAWC,EAAAA,GAAG,oCAAqCJ,CAAS,EAC5D,QAAQ,SACR,OAAO,SACP,KAAK,MACJ,GAAGC,CAAA,CACN,EAOWI,EAAsB,CAAC,CAClC,UAAAL,EACA,GAAGC,CACL,IACEC,EAAAA,IAACC,EAAAA,cAAc,QAAd,CACC,UAAWC,EAAAA,GAAG,0BAA2BJ,CAAS,EACjD,GAAGC,CAAA,CACN,EASWK,EAAyB,CAAC,CACrC,UAAAN,EACA,MAAAO,EAAQ,kBACR,YAAAC,EAAc,4CACd,KAAAC,EACA,SAAAC,EACA,GAAGT,CACL,IACEC,EAAAA,IAAC,MAAA,CACC,UAAWE,EAAAA,GACT,4EACAJ,CAAA,EAED,GAAGC,EAEH,YACCU,EAAAA,KAAAC,EAAAA,SAAA,CACG,SAAA,CAAAH,GAAQP,EAAAA,IAAC,MAAA,CAAI,UAAU,wBAAyB,SAAAO,EAAK,EACtDE,EAAAA,KAAC,MAAA,CAAI,UAAU,YACb,SAAA,CAAAT,EAAAA,IAAC,KAAA,CAAG,UAAU,sBAAuB,SAAAK,EAAM,EAC1CC,GACCN,EAAAA,IAAC,IAAA,CAAE,UAAU,gCAAiC,SAAAM,CAAA,CAAY,CAAA,CAAA,CAE9D,CAAA,CAAA,CACF,CAAA,CAEJ,EAKWK,EAA2B,CAAC,CACvC,UAAAb,EACA,G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IAAI,gBAAgBD,CAAG,CACzB,EAAG,CAACT,EAAUK,EAAUJ,CAAa,CAAC,EAEtC,OACEzB,EAAAA,IAACiB,EAAAA,OAAA,CACC,UAAWf,EAAAA,GACT,8EACAJ,CAAA,EAEF,QAASgC,EACT,KAAK,OACL,KAAK,SACL,QAAQ,UACP,GAAG/B,EAEH,SAAAS,GAAYR,EAAAA,IAACmC,EAAAA,aAAA,CAAa,UAAU,QAAA,CAAS,CAAA,CAAA,CAGpD"}
@@ -56,7 +56,7 @@ const T = ({ className: o, ...t }) => /* @__PURE__ */ e(
56
56
  p,
57
57
  {
58
58
  className: l(
59
- "absolute bottom-4 left-[50%] translate-x-[-50%] rounded-full dark:bg-background dark:hover:bg-muted",
59
+ "absolute bottom-4 left-[50%] translate-x-[-50%] rounded-full dark:bg-background dark:hover:bg-accent",
60
60
  o
61
61
  ),
62
62
  onClick: a,
@@ -85,7 +85,7 @@ const T = ({ className: o, ...t }) => /* @__PURE__ */ e(
85
85
  p,
86
86
  {
87
87
  className: l(
88
- "absolute top-4 right-4 rounded-full dark:bg-background dark:hover:bg-muted",
88
+ "absolute top-4 right-4 rounded-full dark:bg-background dark:hover:bg-accent",
89
89
  r
90
90
  ),
91
91
  onClick: b,
@@ -1 +1 @@
1
- {"version":3,"file":"conversation.js","sources":["../../../src/components/ai/conversation.tsx"],"sourcesContent":["import { ArrowDownIcon, DownloadIcon } from \"lucide-react\";\nimport { useCallback } from \"react\";\nimport { StickToBottom, useStickToBottomContext } from \"use-stick-to-bottom\";\n\nimport type { UIMessage } from \"ai\";\nimport type { ComponentProps } from \"react\";\n\nimport { Button } from \"@/components/ui/button\";\nimport { cn } from \"@/lib/utils\";\n\nexport type ConversationProps = ComponentProps<typeof StickToBottom>;\n\nexport const Conversation = ({ className, ...props }: ConversationProps) => (\n <StickToBottom\n className={cn(\"relative flex-1 overflow-y-hidden\", className)}\n initial=\"smooth\"\n resize=\"smooth\"\n role=\"log\"\n {...props}\n />\n);\n\nexport type ConversationContentProps = ComponentProps<\n typeof StickToBottom.Content\n>;\n\nexport const ConversationContent = ({\n className,\n ...props\n}: ConversationContentProps) => (\n <StickToBottom.Content\n className={cn(\"flex flex-col gap-8 p-4\", className)}\n {...props}\n />\n);\n\nexport type ConversationEmptyStateProps = ComponentProps<\"div\"> & {\n title?: string;\n description?: string;\n icon?: React.ReactNode;\n};\n\nexport const ConversationEmptyState = ({\n className,\n title = \"No messages yet\",\n description = \"Start a conversation to see messages here\",\n icon,\n children,\n ...props\n}: ConversationEmptyStateProps) => (\n <div\n className={cn(\n \"flex size-full flex-col items-center justify-center gap-3 p-8 text-center\",\n className\n )}\n {...props}\n >\n {children ?? (\n <>\n {icon && <div className=\"text-muted-foreground\">{icon}</div>}\n <div className=\"space-y-1\">\n <h3 className=\"font-medium text-sm\">{title}</h3>\n {description && (\n <p className=\"text-muted-foreground text-sm\">{description}</p>\n )}\n </div>\n </>\n )}\n </div>\n);\n\nexport type ConversationScrollButtonProps = ComponentProps<typeof Button>;\n\nexport const ConversationScrollButton = ({\n className,\n ...props\n}: ConversationScrollButtonProps) => {\n const { isAtBottom, scrollToBottom } = useStickToBottomContext();\n\n const handleScrollToBottom = useCallback(() => {\n scrollToBottom();\n }, [scrollToBottom]);\n\n return (\n !isAtBottom && (\n <Button\n className={cn(\n \"absolute bottom-4 left-[50%] translate-x-[-50%] rounded-full dark:bg-background dark:hover:bg-muted\",\n className\n )}\n onClick={handleScrollToBottom}\n size=\"icon\"\n type=\"button\"\n variant=\"outline\"\n {...props}\n >\n <ArrowDownIcon className=\"size-4\" />\n </Button>\n )\n );\n};\n\nconst getMessageText = (message: UIMessage): string =>\n message.parts\n .filter((part) => part.type === \"text\")\n .map((part) => part.text)\n .join(\"\");\n\nexport type ConversationDownloadProps = Omit<\n ComponentProps<typeof Button>,\n \"onClick\"\n> & {\n messages: UIMessage[];\n filename?: string;\n formatMessage?: (message: UIMessage, index: number) => string;\n};\n\nconst defaultFormatMessage = (message: UIMessage): string => {\n const roleLabel =\n message.role.charAt(0).toUpperCase() + message.role.slice(1);\n return `**${roleLabel}:** ${getMessageText(message)}`;\n};\n\nexport const messagesToMarkdown = (\n messages: UIMessage[],\n formatMessage: (\n message: UIMessage,\n index: number\n ) => string = defaultFormatMessage\n): string => messages.map((msg, i) => formatMessage(msg, i)).join(\"\\n\\n\");\n\nexport const ConversationDownload = ({\n messages,\n filename = \"conversation.md\",\n formatMessage = defaultFormatMessage,\n className,\n children,\n ...props\n}: ConversationDownloadProps) => {\n const handleDownload = useCallback(() => {\n const markdown = messagesToMarkdown(messages, formatMessage);\n const blob = new Blob([markdown], { type: \"text/markdown\" });\n const url = URL.createObjectURL(blob);\n const link = document.createElement(\"a\");\n link.href = url;\n link.download = filename;\n document.body.append(link);\n link.click();\n link.remove();\n URL.revokeObjectURL(url);\n }, [messages, filename, formatMessage]);\n\n return (\n <Button\n className={cn(\n \"absolute top-4 right-4 rounded-full dark:bg-background dark:hover:bg-muted\",\n className\n )}\n onClick={handleDownload}\n size=\"icon\"\n type=\"button\"\n variant=\"outline\"\n {...props}\n >\n {children ?? <DownloadIcon className=\"size-4\" />}\n </Button>\n );\n};\n"],"names":["Conversation","className","props","jsx","StickToBottom","cn","ConversationContent","ConversationEmptyState","title","description","icon","children","jsxs","Fragment","ConversationScrollButton","isAtBottom","scrollToBottom","useStickToBottomContext","handleScrollToBottom","useCallback","Button","ArrowDownIcon","getMessageText","message","part","defaultFormatMessage","messagesToMarkdown","messages","formatMessage","msg","i","ConversationDownload","filename","handleDownload","markdown","blob","url","link","DownloadIcon"],"mappings":";;;;;;AAYO,MAAMA,IAAe,CAAC,EAAE,WAAAC,GAAW,GAAGC,QAC3C,gBAAAC;AAAA,EAACC;AAAA,EAAA;AAAA,IACC,WAAWC,EAAG,qCAAqCJ,CAAS;AAAA,IAC5D,SAAQ;AAAA,IACR,QAAO;AAAA,IACP,MAAK;AAAA,IACJ,GAAGC;AAAA,EAAA;AACN,GAOWI,IAAsB,CAAC;AAAA,EAClC,WA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AAAA,MAEH,UAAAS,KAAY,gBAAAR,EAACmC,GAAA,EAAa,WAAU,SAAA,CAAS;AAAA,IAAA;AAAA,EAAA;AAGpD;"}
1
+ {"version":3,"file":"conversation.js","sources":["../../../src/components/ai/conversation.tsx"],"sourcesContent":["import { ArrowDownIcon, DownloadIcon } from \"lucide-react\";\nimport { useCallback } from \"react\";\nimport { StickToBottom, useStickToBottomContext } from \"use-stick-to-bottom\";\n\nimport type { UIMessage } from \"ai\";\nimport type { ComponentProps } from \"react\";\n\nimport { Button } from \"@/components/ui/button\";\nimport { cn } from \"@/lib/utils\";\n\nexport type ConversationProps = ComponentProps<typeof StickToBottom>;\n\nexport const Conversation = ({ className, ...props }: ConversationProps) => (\n <StickToBottom\n className={cn(\"relative flex-1 overflow-y-hidden\", className)}\n initial=\"smooth\"\n resize=\"smooth\"\n role=\"log\"\n {...props}\n />\n);\n\nexport type ConversationContentProps = ComponentProps<\n typeof StickToBottom.Content\n>;\n\nexport const ConversationContent = ({\n className,\n ...props\n}: ConversationContentProps) => (\n <StickToBottom.Content\n className={cn(\"flex flex-col gap-8 p-4\", className)}\n {...props}\n />\n);\n\nexport type ConversationEmptyStateProps = ComponentProps<\"div\"> & {\n title?: string;\n description?: string;\n icon?: React.ReactNode;\n};\n\nexport const ConversationEmptyState = ({\n className,\n title = \"No messages yet\",\n description = \"Start a conversation to see messages here\",\n icon,\n children,\n ...props\n}: ConversationEmptyStateProps) => (\n <div\n className={cn(\n \"flex size-full flex-col items-center justify-center gap-3 p-8 text-center\",\n className\n )}\n {...props}\n >\n {children ?? (\n <>\n {icon && <div className=\"text-muted-foreground\">{icon}</div>}\n <div className=\"space-y-1\">\n <h3 className=\"font-medium text-sm\">{title}</h3>\n {description && (\n <p className=\"text-muted-foreground text-sm\">{description}</p>\n )}\n </div>\n </>\n )}\n </div>\n);\n\nexport type ConversationScrollButtonProps = ComponentProps<typeof Button>;\n\nexport const ConversationScrollButton = ({\n className,\n ...props\n}: ConversationScrollButtonProps) => {\n const { isAtBottom, scrollToBottom } = useStickToBottomContext();\n\n const handleScrollToBottom = useCallback(() => {\n scrollToBottom();\n }, [scrollToBottom]);\n\n return (\n !isAtBottom && (\n <Button\n className={cn(\n \"absolute bottom-4 left-[50%] translate-x-[-50%] rounded-full dark:bg-background dark:hover:bg-accent\",\n className\n )}\n onClick={handleScrollToBottom}\n size=\"icon\"\n type=\"button\"\n variant=\"outline\"\n {...props}\n >\n <ArrowDownIcon className=\"size-4\" />\n </Button>\n )\n );\n};\n\nconst getMessageText = (message: UIMessage): string =>\n message.parts\n .filter((part) => part.type === \"text\")\n .map((part) => part.text)\n .join(\"\");\n\nexport type ConversationDownloadProps = Omit<\n ComponentProps<typeof Button>,\n \"onClick\"\n> & {\n messages: UIMessage[];\n filename?: string;\n formatMessage?: (message: UIMessage, index: number) => string;\n};\n\nconst defaultFormatMessage = (message: UIMessage): string => {\n const roleLabel =\n message.role.charAt(0).toUpperCase() + message.role.slice(1);\n return `**${roleLabel}:** ${getMessageText(message)}`;\n};\n\nexport const messagesToMarkdown = (\n messages: UIMessage[],\n formatMessage: (\n message: UIMessage,\n index: number\n ) => string = defaultFormatMessage\n): string => messages.map((msg, i) => formatMessage(msg, i)).join(\"\\n\\n\");\n\nexport const ConversationDownload = ({\n messages,\n filename = \"conversation.md\",\n formatMessage = defaultFormatMessage,\n className,\n children,\n ...props\n}: ConversationDownloadProps) => {\n const handleDownload = useCallback(() => {\n const markdown = messagesToMarkdown(messages, formatMessage);\n const blob = new Blob([markdown], { type: \"text/markdown\" });\n const url = URL.createObjectURL(blob);\n const link = document.createElement(\"a\");\n link.href = url;\n link.download = filename;\n document.body.append(link);\n link.click();\n link.remove();\n URL.revokeObjectURL(url);\n }, [messages, filename, formatMessage]);\n\n return (\n <Button\n className={cn(\n \"absolute top-4 right-4 rounded-full dark:bg-background dark:hover:bg-accent\",\n className\n )}\n onClick={handleDownload}\n size=\"icon\"\n type=\"button\"\n variant=\"outline\"\n {...props}\n >\n {children ?? <DownloadIcon className=\"size-4\" />}\n </Button>\n );\n};\n"],"names":["Conversation","className","props","jsx","StickToBottom","cn","ConversationContent","ConversationEmptyState","title","description","icon","children","jsxs","Fragment","ConversationScrollButton","isAtBottom","scrollToBottom","useStickToBottomContext","handleScrollToBottom","useCallback","Button","ArrowDownIcon","getMessageText","message","part","defaultFormatMessage","messagesToMarkdown","messages","formatMessage","msg","i","ConversationDownload","filename","handleDownload","markdown","blob","url","link","DownloadIcon"],"mappings":";;;;;;AAYO,MAAMA,IAAe,CAAC,EAAE,WAAAC,GAAW,GAAGC,QAC3C,gBAAAC;AAAA,EAACC;AAAA,EAAA;AAAA,IACC,WAAWC,EAAG,qCAAqCJ,CAAS;AAAA,IAC5D,SAAQ;AAAA,IACR,QAAO;AAAA,IACP,MAAK;AAAA,IACJ,GAAGC;AAAA,EAAA;AACN,GAOWI,IAAsB,CAAC;AAAA,EAClC,WAAAL;AAAA,EACA,GAAGC;AACL,MACE,gBAAAC;AAAA,EAACC,EAAc;AAAA,EAAd;AAAA,IACC,WAAWC,EAAG,2BAA2BJ,CAAS;AAAA,IACjD,GAAGC;AAAA,EAAA;AACN,GASWK,IAAyB,CAAC;AAAA,EACrC,WAAAN;AAAA,EACA,OAAAO,IAAQ;AAAA,EACR,aAAAC,IAAc;AAAA,EACd,MAAAC;AAAA,EACA,UAAAC;AAAA,EACA,GAAGT;AACL,MACE,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,WAAWE;AAAA,MACT;AAAA,MACAJ;AAAA,IAAA;AAAA,IAED,GAAGC;AAAA,IAEH,eACC,gBAAAU,EAAAC,GAAA,EACG,UAAA;AAAA,MAAAH,KAAQ,gBAAAP,EAAC,OAAA,EAAI,WAAU,yBAAyB,UAAAO,GAAK;AAAA,MACtD,gBAAAE,EAAC,OAAA,EAAI,WAAU,aACb,UAAA;AAAA,QAAA,gBAAAT,EAAC,MAAA,EAAG,WAAU,uBAAuB,UAAAK,GAAM;AAAA,QAC1CC,KACC,gBAA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AACvC,UAAMe,IAAWR,EAAmBC,GAAUC,CAAa,GACrDO,IAAO,IAAI,KAAK,CAACD,CAAQ,GAAG,EAAE,MAAM,iBAAiB,GACrDE,IAAM,IAAI,gBAAgBD,CAAI,GAC9BE,IAAO,SAAS,cAAc,GAAG;AACvC,IAAAA,EAAK,OAAOD,GACZC,EAAK,WAAWL,GAChB,SAAS,KAAK,OAAOK,CAAI,GACzBA,EAAK,MAAA,GACLA,EAAK,OAAA,GACL,IAAI,gBAAgBD,CAAG;AAAA,EACzB,GAAG,CAACT,GAAUK,GAAUJ,CAAa,CAAC;AAEtC,SACE,gBAAAzB;AAAA,IAACiB;AAAA,IAAA;AAAA,MACC,WAAWf;AAAA,QACT;AAAA,QACAJ;AAAA,MAAA;AAAA,MAEF,SAASgC;AAAA,MACT,MAAK;AAAA,MACL,MAAK;AAAA,MACL,SAAQ;AAAA,MACP,GAAG/B;AAAA,MAEH,UAAAS,KAAY,gBAAAR,EAACmC,GAAA,EAAa,WAAU,SAAA,CAAS;AAAA,IAAA;AAAA,EAAA;AAGpD;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),x=require("lucide-react"),p=require("motion/react"),c=require("react"),Q=require("../ui/button.cjs"),d=require("../ui/collapsible.cjs"),j=require("../ui/scroll-area.cjs"),r=require("../../lib/utils.cjs"),I=({className:t,...e})=>o.jsx("li",{className:r.cn("group flex flex-row items-center gap-2 rounded-md px-3 py-1 text-sm transition-colors hover:bg-muted",t),...e}),v={pending:"border border-muted-foreground/40",loading:"border-2 border-muted-foreground/20 border-t-primary animate-spin",done:"border border-muted-foreground/20 bg-muted-foreground/30",error:"border border-destructive/30 bg-destructive/70"},N=({status:t,completed:e=!1,className:s,...n})=>{const u=t??(e?"done":"pending");return o.jsx("span",{className:r.cn("inline-block size-2.5 shrink-0 rounded-full",v[u],s),...n})},y=({completed:t=!1,className:e,...s})=>o.jsx("span",{className:r.cn("min-w-0 flex-1 truncate",t?"text-muted-foreground/50 line-through":"text-muted-foreground",e),...s}),A=({completed:t=!1,className:e,...s})=>o.jsx("div",{className:r.cn("text-xs",t?"text-muted-foreground/40 line-through":"text-muted-foreground/70",e),...s}),S=({className:t,...e})=>o.jsx("div",{className:r.cn("ml-auto flex shrink-0 gap-1",t),...e}),T=({className:t,...e})=>o.jsx(Q.Button,{className:r.cn("size-auto rounded p-1 text-muted-foreground opacity-0 transition-opacity hover:bg-muted-foreground/10 hover:text-foreground group-hover:opacity-100",t),size:"icon",type:"button",variant:"ghost",...e}),C=({className:t,...e})=>o.jsx("div",{className:r.cn("flex flex-wrap gap-2",t),...e}),w=({className:t,...e})=>o.jsx("img",{alt:"",className:r.cn("size-8 rounded border object-cover",t),height:32,width:32,...e}),q=({children:t,className:e,...s})=>o.jsxs("span",{className:r.cn("flex items-center gap-1 rounded border bg-muted px-2 py-1 text-xs",e),...s,children:[o.jsx(x.PaperclipIcon,{size:12}),o.jsx("span",{className:"max-w-[100px] truncate",children:t})]}),z=({children:t,className:e,...s})=>o.jsx(j.ScrollArea,{className:r.cn("-mb-1 mt-2",e),...s,children:o.jsx("div",{className:"max-h-40 pr-4",children:o.jsx("ul",{className:"flex flex-col gap-0.5",children:t})})}),D=({className:t,defaultOpen:e=!0,...s})=>o.jsx(d.Collapsible,{className:r.cn(t),defaultOpen:e,...s}),E=({children:t,className:e,...s})=>o.jsx(d.CollapsibleTrigger,{asChild:!0,children:o.jsx("button",{className:r.cn("group flex w-full items-center justify-between rounded-md bg-muted/40 px-3 py-2 text-left font-medium text-muted-foreground text-sm transition-colors hover:bg-muted",e),type:"button",...s,children:t})}),O=({count:t,icon:e,className:s,children:n,...u})=>o.jsxs("span",{className:r.cn("flex items-center gap-2",s),...u,children:[o.jsx(x.ChevronDownIcon,{className:"size-4 opacity-0 transition-all group-focus-visible:opacity-100 group-hover:opacity-100 group-data-[state=open]:opacity-100 group-data-[state=closed]:-rotate-90","data-slot":"collapsible-chevron"}),e,o.jsxs("span",{children:[t===void 0?"":`${t} `,n]})]}),R=({className:t,...e})=>o.jsx(d.CollapsibleContent,{className:r.cn(t),...e}),L=1e3,H=({className:t,isStreaming:e=!1,children:s,style:n,id:u,...g})=>{const[i,f]=c.useState(!0),l=c.useRef(e),[m,b]=c.useState(!1);c.useEffect(()=>{e&&(l.current=!0)},[e]),c.useEffect(()=>{if(l.current&&!e&&i&&!m){const a=setTimeout(()=>{f(!1),b(!0)},L);return()=>clearTimeout(a)}},[e,i,m]);const h=Object.fromEntries(Object.entries(g).filter(([a])=>a.startsWith("data-")||a.startsWith("aria-")));return o.jsx(p.AnimatePresence,{children:i&&o.jsx(p.motion.div,{...h,className:r.cn("flex flex-col gap-2 rounded-xl border border-border bg-background px-2 pb-2 pt-2 shadow-xs",t),exit:{opacity:0,height:0,marginTop:0,marginBottom:0,paddingTop:0,paddingBottom:0,overflow:"hidden"},id:u,style:n,transition:{duration:.35,ease:"easeOut"},children:s})})};exports.Queue=H;exports.QueueItem=I;exports.QueueItemAction=T;exports.QueueItemActions=S;exports.QueueItemAttachment=C;exports.QueueItemContent=y;exports.QueueItemDescription=A;exports.QueueItemFile=q;exports.QueueItemImage=w;exports.QueueItemIndicator=N;exports.QueueList=z;exports.QueueSection=D;exports.QueueSectionContent=R;exports.QueueSectionLabel=O;exports.QueueSectionTrigger=E;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),x=require("lucide-react"),p=require("motion/react"),c=require("react"),Q=require("../ui/button.cjs"),l=require("../ui/collapsible.cjs"),j=require("../ui/scroll-area.cjs"),r=require("../../lib/utils.cjs"),I=({className:t,...e})=>o.jsx("li",{className:r.cn("group flex flex-row items-center gap-2 rounded-md px-3 py-1 text-sm transition-colors hover:bg-accent",t),...e}),v={pending:"border border-muted-foreground/40",loading:"border-2 border-muted-foreground/20 border-t-primary animate-spin",done:"border border-muted-foreground/20 bg-muted-foreground/30",error:"border border-destructive/30 bg-destructive/70"},N=({status:t,completed:e=!1,className:s,...n})=>{const u=t??(e?"done":"pending");return o.jsx("span",{className:r.cn("inline-block size-2.5 shrink-0 rounded-full",v[u],s),...n})},y=({completed:t=!1,className:e,...s})=>o.jsx("span",{className:r.cn("min-w-0 flex-1 truncate",t?"text-muted-foreground/50 line-through":"text-muted-foreground",e),...s}),A=({completed:t=!1,className:e,...s})=>o.jsx("div",{className:r.cn("text-xs",t?"text-muted-foreground/40 line-through":"text-muted-foreground/70",e),...s}),S=({className:t,...e})=>o.jsx("div",{className:r.cn("ml-auto flex shrink-0 gap-1",t),...e}),T=({className:t,...e})=>o.jsx(Q.Button,{className:r.cn("size-auto rounded p-1 text-muted-foreground opacity-0 transition-opacity hover:bg-muted-foreground/10 hover:text-foreground group-hover:opacity-100",t),size:"icon",type:"button",variant:"ghost",...e}),C=({className:t,...e})=>o.jsx("div",{className:r.cn("flex flex-wrap gap-2",t),...e}),w=({className:t,...e})=>o.jsx("img",{alt:"",className:r.cn("size-8 rounded border object-cover",t),height:32,width:32,...e}),q=({children:t,className:e,...s})=>o.jsxs("span",{className:r.cn("flex items-center gap-1 rounded border bg-muted px-2 py-1 text-xs",e),...s,children:[o.jsx(x.PaperclipIcon,{size:12}),o.jsx("span",{className:"max-w-[100px] truncate",children:t})]}),z=({children:t,className:e,...s})=>o.jsx(j.ScrollArea,{className:r.cn("-mb-1 mt-2",e),...s,children:o.jsx("div",{className:"max-h-40 pr-4",children:o.jsx("ul",{className:"flex flex-col gap-0.5",children:t})})}),D=({className:t,defaultOpen:e=!0,...s})=>o.jsx(l.Collapsible,{className:r.cn(t),defaultOpen:e,...s}),E=({children:t,className:e,...s})=>o.jsx(l.CollapsibleTrigger,{asChild:!0,children:o.jsx("button",{className:r.cn("group flex w-full items-center justify-between rounded-md bg-muted/40 px-3 py-2 text-left font-medium text-muted-foreground text-sm transition-colors hover:bg-accent",e),type:"button",...s,children:t})}),O=({count:t,icon:e,className:s,children:n,...u})=>o.jsxs("span",{className:r.cn("flex items-center gap-2",s),...u,children:[o.jsx(x.ChevronDownIcon,{className:"size-4 opacity-0 transition-all group-focus-visible:opacity-100 group-hover:opacity-100 group-data-[state=open]:opacity-100 group-data-[state=closed]:-rotate-90","data-slot":"collapsible-chevron"}),e,o.jsxs("span",{children:[t===void 0?"":`${t} `,n]})]}),R=({className:t,...e})=>o.jsx(l.CollapsibleContent,{className:r.cn(t),...e}),L=1e3,H=({className:t,isStreaming:e=!1,children:s,style:n,id:u,...g})=>{const[i,f]=c.useState(!0),d=c.useRef(e),[m,b]=c.useState(!1);c.useEffect(()=>{e&&(d.current=!0)},[e]),c.useEffect(()=>{if(d.current&&!e&&i&&!m){const a=setTimeout(()=>{f(!1),b(!0)},L);return()=>clearTimeout(a)}},[e,i,m]);const h=Object.fromEntries(Object.entries(g).filter(([a])=>a.startsWith("data-")||a.startsWith("aria-")));return o.jsx(p.AnimatePresence,{children:i&&o.jsx(p.motion.div,{...h,className:r.cn("flex flex-col gap-2 rounded-xl border border-border bg-background px-2 pb-2 pt-2 shadow-xs",t),exit:{opacity:0,height:0,marginTop:0,marginBottom:0,paddingTop:0,paddingBottom:0,overflow:"hidden"},id:u,style:n,transition:{duration:.35,ease:"easeOut"},children:s})})};exports.Queue=H;exports.QueueItem=I;exports.QueueItemAction=T;exports.QueueItemActions=S;exports.QueueItemAttachment=C;exports.QueueItemContent=y;exports.QueueItemDescription=A;exports.QueueItemFile=q;exports.QueueItemImage=w;exports.QueueItemIndicator=N;exports.QueueList=z;exports.QueueSection=D;exports.QueueSectionContent=R;exports.QueueSectionLabel=O;exports.QueueSectionTrigger=E;
2
2
  //# sourceMappingURL=queue.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"queue.cjs","sources":["../../../src/components/ai/queue.tsx"],"sourcesContent":["import { ChevronDownIcon, PaperclipIcon } from \"lucide-react\";\nimport { AnimatePresence, motion } from \"motion/react\";\nimport { useEffect, useRef, useState } from \"react\";\n\nimport type { ComponentProps } from \"react\";\n\nimport { Button } from \"@/components/ui/button\";\nimport {\n Collapsible,\n CollapsibleContent,\n CollapsibleTrigger,\n} from \"@/components/ui/collapsible\";\nimport { ScrollArea } from \"@/components/ui/scroll-area\";\nimport { cn } from \"@/lib/utils\";\n\nexport interface QueueMessagePart {\n type: string;\n text?: string;\n url?: string;\n filename?: string;\n mediaType?: string;\n}\n\nexport interface QueueMessage {\n id: string;\n parts: QueueMessagePart[];\n}\n\nexport interface QueueTodo {\n id: string;\n title: string;\n description?: string;\n status?: \"pending\" | \"completed\";\n}\n\n// ---------------------------------------------------------------------------\n// QueueItem\n// ---------------------------------------------------------------------------\n\nexport type QueueItemProps = ComponentProps<\"li\">;\n\nexport const QueueItem = ({ className, ...props }: QueueItemProps) => (\n <li\n className={cn(\n \"group flex flex-row items-center gap-2 rounded-md px-3 py-1 text-sm transition-colors hover:bg-muted\",\n className\n )}\n {...props}\n />\n);\n\n// ---------------------------------------------------------------------------\n// QueueItemIndicator\n// ---------------------------------------------------------------------------\n\nexport type QueueItemStatus = \"pending\" | \"loading\" | \"done\" | \"error\";\n\nexport type QueueItemIndicatorProps = ComponentProps<\"span\"> & {\n /**\n * Visual state of the indicator dot.\n * - `pending` — unfilled muted ring\n * - `loading` — spinning ring (primary accent)\n * - `done` — filled muted dot (task complete)\n * - `error` — filled destructive dot\n */\n status?: QueueItemStatus;\n /** @deprecated Use `status=\"done\"` instead. */\n completed?: boolean;\n};\n\nconst INDICATOR_STATUS: Record<QueueItemStatus, string> = {\n pending: \"border border-muted-foreground/40\",\n loading:\n \"border-2 border-muted-foreground/20 border-t-primary animate-spin\",\n done: \"border border-muted-foreground/20 bg-muted-foreground/30\",\n error: \"border border-destructive/30 bg-destructive/70\",\n};\n\nexport const QueueItemIndicator = ({\n status,\n completed = false,\n className,\n ...props\n}: QueueItemIndicatorProps) => {\n const resolvedStatus: QueueItemStatus =\n status ?? (completed ? \"done\" : \"pending\");\n\n return (\n <span\n className={cn(\n \"inline-block size-2.5 shrink-0 rounded-full\",\n INDICATOR_STATUS[resolvedStatus],\n className\n )}\n {...props}\n />\n );\n};\n\n// ---------------------------------------------------------------------------\n// QueueItemContent\n// ---------------------------------------------------------------------------\n\nexport type QueueItemContentProps = ComponentProps<\"span\"> & {\n completed?: boolean;\n};\n\nexport const QueueItemContent = ({\n completed = false,\n className,\n ...props\n}: QueueItemContentProps) => (\n <span\n className={cn(\n \"min-w-0 flex-1 truncate\",\n completed\n ? \"text-muted-foreground/50 line-through\"\n : \"text-muted-foreground\",\n className\n )}\n {...props}\n />\n);\n\n// ---------------------------------------------------------------------------\n// QueueItemDescription\n// For items with a description, wrap QueueItemContent + QueueItemDescription\n// in a <div className=\"flex flex-col gap-0.5 min-w-0 flex-1\">\n// ---------------------------------------------------------------------------\n\nexport type QueueItemDescriptionProps = ComponentProps<\"div\"> & {\n completed?: boolean;\n};\n\nexport const QueueItemDescription = ({\n completed = false,\n className,\n ...props\n}: QueueItemDescriptionProps) => (\n <div\n className={cn(\n \"text-xs\",\n completed\n ? \"text-muted-foreground/40 line-through\"\n : \"text-muted-foreground/70\",\n className\n )}\n {...props}\n />\n);\n\n// ---------------------------------------------------------------------------\n// QueueItemActions / QueueItemAction\n// ---------------------------------------------------------------------------\n\nexport type QueueItemActionsProps = ComponentProps<\"div\">;\n\nexport const QueueItemActions = ({\n className,\n ...props\n}: QueueItemActionsProps) => (\n <div className={cn(\"ml-auto flex shrink-0 gap-1\", className)} {...props} />\n);\n\nexport type QueueItemActionProps = Omit<\n ComponentProps<typeof Button>,\n \"variant\" | \"size\"\n>;\n\nexport const QueueItemAction = ({\n className,\n ...props\n}: QueueItemActionProps) => (\n <Button\n className={cn(\n \"size-auto rounded p-1 text-muted-foreground opacity-0 transition-opacity hover:bg-muted-foreground/10 hover:text-foreground group-hover:opacity-100\",\n className\n )}\n size=\"icon\"\n type=\"button\"\n variant=\"ghost\"\n {...props}\n />\n);\n\n// ---------------------------------------------------------------------------\n// QueueItemAttachment / QueueItemImage / QueueItemFile\n// ---------------------------------------------------------------------------\n\nexport type QueueItemAttachmentProps = ComponentProps<\"div\">;\n\nexport const QueueItemAttachment = ({\n className,\n ...props\n}: QueueItemAttachmentProps) => (\n <div className={cn(\"flex flex-wrap gap-2\", className)} {...props} />\n);\n\nexport type QueueItemImageProps = ComponentProps<\"img\">;\n\nexport const QueueItemImage = ({\n className,\n ...props\n}: QueueItemImageProps) => (\n <img\n alt=\"\"\n className={cn(\"size-8 rounded border object-cover\", className)}\n height={32}\n width={32}\n {...props}\n />\n);\n\nexport type QueueItemFileProps = ComponentProps<\"span\">;\n\nexport const QueueItemFile = ({\n children,\n className,\n ...props\n}: QueueItemFileProps) => (\n <span\n className={cn(\n \"flex items-center gap-1 rounded border bg-muted px-2 py-1 text-xs\",\n className\n )}\n {...props}\n >\n <PaperclipIcon size={12} />\n <span className=\"max-w-[100px] truncate\">{children}</span>\n </span>\n);\n\n// ---------------------------------------------------------------------------\n// QueueList\n// ---------------------------------------------------------------------------\n\nexport type QueueListProps = ComponentProps<typeof ScrollArea>;\n\nexport const QueueList = ({\n children,\n className,\n ...props\n}: QueueListProps) => (\n <ScrollArea className={cn(\"-mb-1 mt-2\", className)} {...props}>\n <div className=\"max-h-40 pr-4\">\n <ul className=\"flex flex-col gap-0.5\">{children}</ul>\n </div>\n </ScrollArea>\n);\n\n// ---------------------------------------------------------------------------\n// QueueSection / QueueSectionTrigger / QueueSectionLabel / QueueSectionContent\n// ---------------------------------------------------------------------------\n\nexport type QueueSectionProps = ComponentProps<typeof Collapsible>;\n\nexport const QueueSection = ({\n className,\n defaultOpen = true,\n ...props\n}: QueueSectionProps) => (\n <Collapsible className={cn(className)} defaultOpen={defaultOpen} {...props} />\n);\n\nexport type QueueSectionTriggerProps = ComponentProps<\"button\">;\n\nexport const QueueSectionTrigger = ({\n children,\n className,\n ...props\n}: QueueSectionTriggerProps) => (\n <CollapsibleTrigger asChild>\n <button\n className={cn(\n \"group flex w-full items-center justify-between rounded-md bg-muted/40 px-3 py-2 text-left font-medium text-muted-foreground text-sm transition-colors hover:bg-muted\",\n className\n )}\n type=\"button\"\n {...props}\n >\n {children}\n </button>\n </CollapsibleTrigger>\n);\n\nexport type QueueSectionLabelProps = ComponentProps<\"span\"> & {\n count?: number;\n icon?: React.ReactNode;\n};\n\nexport const QueueSectionLabel = ({\n count,\n icon,\n className,\n children,\n ...props\n}: QueueSectionLabelProps) => (\n <span className={cn(\"flex items-center gap-2\", className)} {...props}>\n <ChevronDownIcon\n className=\"size-4 opacity-0 transition-all group-focus-visible:opacity-100 group-hover:opacity-100 group-data-[state=open]:opacity-100 group-data-[state=closed]:-rotate-90\"\n data-slot=\"collapsible-chevron\"\n />\n {icon}\n <span>\n {count === undefined ? \"\" : `${count} `}\n {children}\n </span>\n </span>\n);\n\nexport type QueueSectionContentProps = ComponentProps<typeof CollapsibleContent>;\n\nexport const QueueSectionContent = ({\n className,\n ...props\n}: QueueSectionContentProps) => (\n <CollapsibleContent className={cn(className)} {...props} />\n);\n\n// ---------------------------------------------------------------------------\n// Queue (root)\n// ---------------------------------------------------------------------------\n\nconst AUTO_HIDE_DELAY = 1000;\n\nexport type QueueProps = ComponentProps<\"div\"> & {\n isStreaming?: boolean;\n};\n\nexport const Queue = ({ className, isStreaming = false, children, style, id, ...props }: QueueProps) => {\n const [visible, setVisible] = useState(true);\n const hasEverStreamedRef = useRef(isStreaming);\n const [hasAutoHidden, setHasAutoHidden] = useState(false);\n\n useEffect(() => {\n if (isStreaming) hasEverStreamedRef.current = true;\n }, [isStreaming]);\n\n useEffect(() => {\n if (hasEverStreamedRef.current && !isStreaming && visible && !hasAutoHidden) {\n const timer = setTimeout(() => {\n setVisible(false);\n setHasAutoHidden(true);\n }, AUTO_HIDE_DELAY);\n return () => clearTimeout(timer);\n }\n }, [isStreaming, visible, hasAutoHidden]);\n\n // Spread data-* and aria-* attributes through; drop event handlers to avoid\n // onDrag type conflict between React and framer-motion.\n const passthroughProps = Object.fromEntries(\n Object.entries(props).filter(([k]) => k.startsWith(\"data-\") || k.startsWith(\"aria-\"))\n );\n\n return (\n <AnimatePresence>\n {visible && (\n <motion.div\n {...passthroughProps}\n className={cn(\n \"flex flex-col gap-2 rounded-xl border border-border bg-background px-2 pb-2 pt-2 shadow-xs\",\n className\n )}\n exit={{ opacity: 0, height: 0, marginTop: 0, marginBottom: 0, paddingTop: 0, paddingBottom: 0, overflow: \"hidden\" }}\n id={id}\n style={style}\n transition={{ duration: 0.35, ease: \"easeOut\" }}\n >\n {children}\n </motion.div>\n )}\n </AnimatePresence>\n );\n};\n"],"names":["QueueItem","className","props","jsx","cn","INDICATOR_STATUS","QueueItemIndicator","status","completed","resolvedStatus","QueueItemContent","QueueItemDescription","QueueItemActions","QueueItemAction","Button","QueueItemAttachment","QueueItemImage","QueueItemFile","children","jsxs","PaperclipIcon","QueueList","ScrollArea","QueueSection","defaultOpen","Collapsible","QueueSectionTrigger","CollapsibleTrigger","QueueSectionLabel","count","icon","ChevronDownIcon","QueueSectionContent","CollapsibleContent","AUTO_HIDE_DELAY","Queue","isStreaming","style","id","visible","setVisible","useState","hasEverStreamedRef","useRef","hasAutoHidden","setHasAutoHidden","useEffect","timer","passthroughProps","k","AnimatePresence","motion"],"mappings":"iUAyCaA,EAAY,CAAC,CAAE,UAAAC,EAAW,GAAGC,KACxCC,EAAAA,IAAC,KAAA,CACC,UAAWC,EAAAA,GACT,uGACAH,CAAA,EAED,GAAGC,CAAA,CACN,EAsBIG,EAAoD,CACxD,QAAS,oCACT,QACE,oEACF,KAAM,2DACN,MAAO,gDACT,EAEaC,EAAqB,CAAC,CACjC,OAAAC,EACA,UAAAC,EAAY,GACZ,UAAAP,EACA,GAAGC,CACL,IAA+B,CAC7B,MAAMO,EACJF,IAAWC,EAAY,OAAS,WAElC,OACEL,EAAAA,IAAC,OAAA,CACC,UAAWC,EAAAA,GACT,8CACAC,EAAiBI,CAAc,EAC/BR,CAAA,EAED,GAAGC,CAAA,CAAA,CAGV,EAUaQ,EAAmB,CAAC,CAC/B,UAAAF,EAAY,GAC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AmC,EAAc,GAAO,SAAAlB,EAAU,MAAAmB,EAAO,GAAAC,EAAI,GAAGpC,KAAwB,CACtG,KAAM,CAACqC,EAASC,CAAU,EAAIC,EAAAA,SAAS,EAAI,EACrCC,EAAqBC,EAAAA,OAAOP,CAAW,EACvC,CAACQ,EAAeC,CAAgB,EAAIJ,EAAAA,SAAS,EAAK,EAExDK,EAAAA,UAAU,IAAM,CACVV,MAAgC,QAAU,GAChD,EAAG,CAACA,CAAW,CAAC,EAEhBU,EAAAA,UAAU,IAAM,CACd,GAAIJ,EAAmB,SAAW,CAACN,GAAeG,GAAW,CAACK,EAAe,CAC3E,MAAMG,EAAQ,WAAW,IAAM,CAC7BP,EAAW,EAAK,EAChBK,EAAiB,EAAI,CACvB,EAAGX,CAAe,EAClB,MAAO,IAAM,aAAaa,CAAK,CACjC,CACF,EAAG,CAACX,EAAaG,EAASK,CAAa,CAAC,EAIxC,MAAMI,EAAmB,OAAO,YAC9B,OAAO,QAAQ9C,CAAK,EAAE,OAAO,CAAC,CAAC+C,CAAC,IAAMA,EAAE,WAAW,OAAO,GAAKA,EAAE,WAAW,OAAO,CAAC,CAAA,EAGtF,OACE9C,EAAAA,IAAC+C,EAAAA,iBACE,SAAAX,GACCpC,EAAAA,IAACgD,EAAAA,OAAO,IAAP,CACE,GAAGH,EACJ,UAAW5C,EAAAA,GACT,6FACAH,CAAA,EAEF,KAAM,CAAE,QAAS,EAAG,OAAQ,EAAG,UAAW,EAAG,aAAc,EAAG,WAAY,EAAG,cAAe,EAAG,SAAU,QAAA,EACzG,GAAAqC,EACA,MAAAD,EACA,WAAY,CAAE,SAAU,IAAM,KAAM,SAAA,EAEnC,SAAAnB,CAAA,CAAA,EAGP,CAEJ"}
1
+ {"version":3,"file":"queue.cjs","sources":["../../../src/components/ai/queue.tsx"],"sourcesContent":["import { ChevronDownIcon, PaperclipIcon } from \"lucide-react\";\nimport { AnimatePresence, motion } from \"motion/react\";\nimport { useEffect, useRef, useState } from \"react\";\n\nimport type { ComponentProps } from \"react\";\n\nimport { Button } from \"@/components/ui/button\";\nimport {\n Collapsible,\n CollapsibleContent,\n CollapsibleTrigger,\n} from \"@/components/ui/collapsible\";\nimport { ScrollArea } from \"@/components/ui/scroll-area\";\nimport { cn } from \"@/lib/utils\";\n\nexport interface QueueMessagePart {\n type: string;\n text?: string;\n url?: string;\n filename?: string;\n mediaType?: string;\n}\n\nexport interface QueueMessage {\n id: string;\n parts: QueueMessagePart[];\n}\n\nexport interface QueueTodo {\n id: string;\n title: string;\n description?: string;\n status?: \"pending\" | \"completed\";\n}\n\n// ---------------------------------------------------------------------------\n// QueueItem\n// ---------------------------------------------------------------------------\n\nexport type QueueItemProps = ComponentProps<\"li\">;\n\nexport const QueueItem = ({ className, ...props }: QueueItemProps) => (\n <li\n className={cn(\n \"group flex flex-row items-center gap-2 rounded-md px-3 py-1 text-sm transition-colors hover:bg-accent\",\n className\n )}\n {...props}\n />\n);\n\n// ---------------------------------------------------------------------------\n// QueueItemIndicator\n// ---------------------------------------------------------------------------\n\nexport type QueueItemStatus = \"pending\" | \"loading\" | \"done\" | \"error\";\n\nexport type QueueItemIndicatorProps = ComponentProps<\"span\"> & {\n /**\n * Visual state of the indicator dot.\n * - `pending` — unfilled muted ring\n * - `loading` — spinning ring (primary accent)\n * - `done` — filled muted dot (task complete)\n * - `error` — filled destructive dot\n */\n status?: QueueItemStatus;\n /** @deprecated Use `status=\"done\"` instead. */\n completed?: boolean;\n};\n\nconst INDICATOR_STATUS: Record<QueueItemStatus, string> = {\n pending: \"border border-muted-foreground/40\",\n loading:\n \"border-2 border-muted-foreground/20 border-t-primary animate-spin\",\n done: \"border border-muted-foreground/20 bg-muted-foreground/30\",\n error: \"border border-destructive/30 bg-destructive/70\",\n};\n\nexport const QueueItemIndicator = ({\n status,\n completed = false,\n className,\n ...props\n}: QueueItemIndicatorProps) => {\n const resolvedStatus: QueueItemStatus =\n status ?? (completed ? \"done\" : \"pending\");\n\n return (\n <span\n className={cn(\n \"inline-block size-2.5 shrink-0 rounded-full\",\n INDICATOR_STATUS[resolvedStatus],\n className\n )}\n {...props}\n />\n );\n};\n\n// ---------------------------------------------------------------------------\n// QueueItemContent\n// ---------------------------------------------------------------------------\n\nexport type QueueItemContentProps = ComponentProps<\"span\"> & {\n completed?: boolean;\n};\n\nexport const QueueItemContent = ({\n completed = false,\n className,\n ...props\n}: QueueItemContentProps) => (\n <span\n className={cn(\n \"min-w-0 flex-1 truncate\",\n completed\n ? \"text-muted-foreground/50 line-through\"\n : \"text-muted-foreground\",\n className\n )}\n {...props}\n />\n);\n\n// ---------------------------------------------------------------------------\n// QueueItemDescription\n// For items with a description, wrap QueueItemContent + QueueItemDescription\n// in a <div className=\"flex flex-col gap-0.5 min-w-0 flex-1\">\n// ---------------------------------------------------------------------------\n\nexport type QueueItemDescriptionProps = ComponentProps<\"div\"> & {\n completed?: boolean;\n};\n\nexport const QueueItemDescription = ({\n completed = false,\n className,\n ...props\n}: QueueItemDescriptionProps) => (\n <div\n className={cn(\n \"text-xs\",\n completed\n ? \"text-muted-foreground/40 line-through\"\n : \"text-muted-foreground/70\",\n className\n )}\n {...props}\n />\n);\n\n// ---------------------------------------------------------------------------\n// QueueItemActions / QueueItemAction\n// ---------------------------------------------------------------------------\n\nexport type QueueItemActionsProps = ComponentProps<\"div\">;\n\nexport const QueueItemActions = ({\n className,\n ...props\n}: QueueItemActionsProps) => (\n <div className={cn(\"ml-auto flex shrink-0 gap-1\", className)} {...props} />\n);\n\nexport type QueueItemActionProps = Omit<\n ComponentProps<typeof Button>,\n \"variant\" | \"size\"\n>;\n\nexport const QueueItemAction = ({\n className,\n ...props\n}: QueueItemActionProps) => (\n <Button\n className={cn(\n \"size-auto rounded p-1 text-muted-foreground opacity-0 transition-opacity hover:bg-muted-foreground/10 hover:text-foreground group-hover:opacity-100\",\n className\n )}\n size=\"icon\"\n type=\"button\"\n variant=\"ghost\"\n {...props}\n />\n);\n\n// ---------------------------------------------------------------------------\n// QueueItemAttachment / QueueItemImage / QueueItemFile\n// ---------------------------------------------------------------------------\n\nexport type QueueItemAttachmentProps = ComponentProps<\"div\">;\n\nexport const QueueItemAttachment = ({\n className,\n ...props\n}: QueueItemAttachmentProps) => (\n <div className={cn(\"flex flex-wrap gap-2\", className)} {...props} />\n);\n\nexport type QueueItemImageProps = ComponentProps<\"img\">;\n\nexport const QueueItemImage = ({\n className,\n ...props\n}: QueueItemImageProps) => (\n <img\n alt=\"\"\n className={cn(\"size-8 rounded border object-cover\", className)}\n height={32}\n width={32}\n {...props}\n />\n);\n\nexport type QueueItemFileProps = ComponentProps<\"span\">;\n\nexport const QueueItemFile = ({\n children,\n className,\n ...props\n}: QueueItemFileProps) => (\n <span\n className={cn(\n \"flex items-center gap-1 rounded border bg-muted px-2 py-1 text-xs\",\n className\n )}\n {...props}\n >\n <PaperclipIcon size={12} />\n <span className=\"max-w-[100px] truncate\">{children}</span>\n </span>\n);\n\n// ---------------------------------------------------------------------------\n// QueueList\n// ---------------------------------------------------------------------------\n\nexport type QueueListProps = ComponentProps<typeof ScrollArea>;\n\nexport const QueueList = ({\n children,\n className,\n ...props\n}: QueueListProps) => (\n <ScrollArea className={cn(\"-mb-1 mt-2\", className)} {...props}>\n <div className=\"max-h-40 pr-4\">\n <ul className=\"flex flex-col gap-0.5\">{children}</ul>\n </div>\n </ScrollArea>\n);\n\n// ---------------------------------------------------------------------------\n// QueueSection / QueueSectionTrigger / QueueSectionLabel / QueueSectionContent\n// ---------------------------------------------------------------------------\n\nexport type QueueSectionProps = ComponentProps<typeof Collapsible>;\n\nexport const QueueSection = ({\n className,\n defaultOpen = true,\n ...props\n}: QueueSectionProps) => (\n <Collapsible className={cn(className)} defaultOpen={defaultOpen} {...props} />\n);\n\nexport type QueueSectionTriggerProps = ComponentProps<\"button\">;\n\nexport const QueueSectionTrigger = ({\n children,\n className,\n ...props\n}: QueueSectionTriggerProps) => (\n <CollapsibleTrigger asChild>\n <button\n className={cn(\n \"group flex w-full items-center justify-between rounded-md bg-muted/40 px-3 py-2 text-left font-medium text-muted-foreground text-sm transition-colors hover:bg-accent\",\n className\n )}\n type=\"button\"\n {...props}\n >\n {children}\n </button>\n </CollapsibleTrigger>\n);\n\nexport type QueueSectionLabelProps = ComponentProps<\"span\"> & {\n count?: number;\n icon?: React.ReactNode;\n};\n\nexport const QueueSectionLabel = ({\n count,\n icon,\n className,\n children,\n ...props\n}: QueueSectionLabelProps) => (\n <span className={cn(\"flex items-center gap-2\", className)} {...props}>\n <ChevronDownIcon\n className=\"size-4 opacity-0 transition-all group-focus-visible:opacity-100 group-hover:opacity-100 group-data-[state=open]:opacity-100 group-data-[state=closed]:-rotate-90\"\n data-slot=\"collapsible-chevron\"\n />\n {icon}\n <span>\n {count === undefined ? \"\" : `${count} `}\n {children}\n </span>\n </span>\n);\n\nexport type QueueSectionContentProps = ComponentProps<typeof CollapsibleContent>;\n\nexport const QueueSectionContent = ({\n className,\n ...props\n}: QueueSectionContentProps) => (\n <CollapsibleContent className={cn(className)} {...props} />\n);\n\n// ---------------------------------------------------------------------------\n// Queue (root)\n// ---------------------------------------------------------------------------\n\nconst AUTO_HIDE_DELAY = 1000;\n\nexport type QueueProps = ComponentProps<\"div\"> & {\n isStreaming?: boolean;\n};\n\nexport const Queue = ({ className, isStreaming = false, children, style, id, ...props }: QueueProps) => {\n const [visible, setVisible] = useState(true);\n const hasEverStreamedRef = useRef(isStreaming);\n const [hasAutoHidden, setHasAutoHidden] = useState(false);\n\n useEffect(() => {\n if (isStreaming) hasEverStreamedRef.current = true;\n }, [isStreaming]);\n\n useEffect(() => {\n if (hasEverStreamedRef.current && !isStreaming && visible && !hasAutoHidden) {\n const timer = setTimeout(() => {\n setVisible(false);\n setHasAutoHidden(true);\n }, AUTO_HIDE_DELAY);\n return () => clearTimeout(timer);\n }\n }, [isStreaming, visible, hasAutoHidden]);\n\n // Spread data-* and aria-* attributes through; drop event handlers to avoid\n // onDrag type conflict between React and framer-motion.\n const passthroughProps = Object.fromEntries(\n Object.entries(props).filter(([k]) => k.startsWith(\"data-\") || k.startsWith(\"aria-\"))\n );\n\n return (\n <AnimatePresence>\n {visible && (\n <motion.div\n {...passthroughProps}\n className={cn(\n \"flex flex-col gap-2 rounded-xl border border-border bg-background px-2 pb-2 pt-2 shadow-xs\",\n className\n )}\n exit={{ opacity: 0, height: 0, marginTop: 0, marginBottom: 0, paddingTop: 0, paddingBottom: 0, overflow: \"hidden\" }}\n id={id}\n style={style}\n transition={{ duration: 0.35, ease: \"easeOut\" }}\n >\n {children}\n </motion.div>\n )}\n </AnimatePresence>\n );\n};\n"],"names":["QueueItem","className","props","jsx","cn","INDICATOR_STATUS","QueueItemIndicator","status","completed","resolvedStatus","QueueItemContent","QueueItemDescription","QueueItemActions","QueueItemAction","Button","QueueItemAttachment","QueueItemImage","QueueItemFile","children","jsxs","PaperclipIcon","QueueList","ScrollArea","QueueSection","defaultOpen","Collapsible","QueueSectionTrigger","CollapsibleTrigger","QueueSectionLabel","count","icon","ChevronDownIcon","QueueSectionContent","CollapsibleContent","AUTO_HIDE_DELAY","Queue","isStreaming","style","id","visible","setVisible","useState","hasEverStreamedRef","useRef","hasAutoHidden","setHasAutoHidden","useEffect","timer","passthroughProps","k","AnimatePresence","motion"],"mappings":"iUAyCaA,EAAY,CAAC,CAAE,UAAAC,EAAW,GAAGC,KACxCC,EAAAA,IAAC,KAAA,CACC,UAAWC,EAAAA,GACT,wGACAH,CAAA,EAED,GAAGC,CAAA,CACN,EAsBIG,EAAoD,CACxD,QAAS,oCACT,QACE,oEACF,KAAM,2DACN,MAAO,gDACT,EAEaC,EAAqB,CAAC,CACjC,OAAAC,EACA,UAAAC,EAAY,GACZ,UAAAP,EACA,GAAGC,CACL,IAA+B,CAC7B,MAAMO,EACJF,IAAWC,EAAY,OAAS,WAElC,OACEL,EAAAA,IAAC,OAAA,CACC,UAAWC,EAAAA,GACT,8CACAC,EAAiBI,CAAc,EAC/BR,CAAA,EAED,GAAGC,CAAA,CAAA,CAGV,EAUaQ,EAAmB,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AAC,CAAE,UAAAlC,EAAW,YAAAmC,EAAc,GAAO,SAAAlB,EAAU,MAAAmB,EAAO,GAAAC,EAAI,GAAGpC,KAAwB,CACtG,KAAM,CAACqC,EAASC,CAAU,EAAIC,EAAAA,SAAS,EAAI,EACrCC,EAAqBC,EAAAA,OAAOP,CAAW,EACvC,CAACQ,EAAeC,CAAgB,EAAIJ,EAAAA,SAAS,EAAK,EAExDK,EAAAA,UAAU,IAAM,CACVV,MAAgC,QAAU,GAChD,EAAG,CAACA,CAAW,CAAC,EAEhBU,EAAAA,UAAU,IAAM,CACd,GAAIJ,EAAmB,SAAW,CAACN,GAAeG,GAAW,CAACK,EAAe,CAC3E,MAAMG,EAAQ,WAAW,IAAM,CAC7BP,EAAW,EAAK,EAChBK,EAAiB,EAAI,CACvB,EAAGX,CAAe,EAClB,MAAO,IAAM,aAAaa,CAAK,CACjC,CACF,EAAG,CAACX,EAAaG,EAASK,CAAa,CAAC,EAIxC,MAAMI,EAAmB,OAAO,YAC9B,OAAO,QAAQ9C,CAAK,EAAE,OAAO,CAAC,CAAC+C,CAAC,IAAMA,EAAE,WAAW,OAAO,GAAKA,EAAE,WAAW,OAAO,CAAC,CAAA,EAGtF,OACE9C,EAAAA,IAAC+C,EAAAA,iBACE,SAAAX,GACCpC,EAAAA,IAACgD,EAAAA,OAAO,IAAP,CACE,GAAGH,EACJ,UAAW5C,EAAAA,GACT,6FACAH,CAAA,EAEF,KAAM,CAAE,QAAS,EAAG,OAAQ,EAAG,UAAW,EAAG,aAAc,EAAG,WAAY,EAAG,cAAe,EAAG,SAAU,QAAA,EACzG,GAAAqC,EACA,MAAAD,EACA,WAAY,CAAE,SAAU,IAAM,KAAM,SAAA,EAEnC,SAAAnB,CAAA,CAAA,EAGP,CAEJ"}
@@ -1,4 +1,4 @@
1
- import { jsx as o, jsxs as d } from "react/jsx-runtime";
1
+ import { jsx as o, jsxs as c } from "react/jsx-runtime";
2
2
  import { PaperclipIcon as h, ChevronDownIcon as v } from "lucide-react";
3
3
  import { AnimatePresence as N, motion as I } from "motion/react";
4
4
  import { useState as m, useRef as y, useEffect as p } from "react";
@@ -10,7 +10,7 @@ const P = ({ className: t, ...e }) => /* @__PURE__ */ o(
10
10
  "li",
11
11
  {
12
12
  className: s(
13
- "group flex flex-row items-center gap-2 rounded-md px-3 py-1 text-sm transition-colors hover:bg-muted",
13
+ "group flex flex-row items-center gap-2 rounded-md px-3 py-1 text-sm transition-colors hover:bg-accent",
14
14
  t
15
15
  ),
16
16
  ...e
@@ -100,7 +100,7 @@ const P = ({ className: t, ...e }) => /* @__PURE__ */ o(
100
100
  children: t,
101
101
  className: e,
102
102
  ...r
103
- }) => /* @__PURE__ */ d(
103
+ }) => /* @__PURE__ */ c(
104
104
  "span",
105
105
  {
106
106
  className: s(
@@ -129,7 +129,7 @@ const P = ({ className: t, ...e }) => /* @__PURE__ */ o(
129
129
  "button",
130
130
  {
131
131
  className: s(
132
- "group flex w-full items-center justify-between rounded-md bg-muted/40 px-3 py-2 text-left font-medium text-muted-foreground text-sm transition-colors hover:bg-muted",
132
+ "group flex w-full items-center justify-between rounded-md bg-muted/40 px-3 py-2 text-left font-medium text-muted-foreground text-sm transition-colors hover:bg-accent",
133
133
  e
134
134
  ),
135
135
  type: "button",
@@ -142,7 +142,7 @@ const P = ({ className: t, ...e }) => /* @__PURE__ */ o(
142
142
  className: r,
143
143
  children: n,
144
144
  ...a
145
- }) => /* @__PURE__ */ d("span", { className: s("flex items-center gap-2", r), ...a, children: [
145
+ }) => /* @__PURE__ */ c("span", { className: s("flex items-center gap-2", r), ...a, children: [
146
146
  /* @__PURE__ */ o(
147
147
  v,
148
148
  {
@@ -151,7 +151,7 @@ const P = ({ className: t, ...e }) => /* @__PURE__ */ o(
151
151
  }
152
152
  ),
153
153
  e,
154
- /* @__PURE__ */ d("span", { children: [
154
+ /* @__PURE__ */ c("span", { children: [
155
155
  t === void 0 ? "" : `${t} `,
156
156
  n
157
157
  ] })
@@ -159,11 +159,11 @@ const P = ({ className: t, ...e }) => /* @__PURE__ */ o(
159
159
  className: t,
160
160
  ...e
161
161
  }) => /* @__PURE__ */ o(w, { className: s(t), ...e }), j = 1e3, X = ({ className: t, isStreaming: e = !1, children: r, style: n, id: a, ...f }) => {
162
- const [u, g] = m(!0), c = y(e), [l, b] = m(!1);
162
+ const [u, g] = m(!0), d = y(e), [l, b] = m(!1);
163
163
  p(() => {
164
- e && (c.current = !0);
164
+ e && (d.current = !0);
165
165
  }, [e]), p(() => {
166
- if (c.current && !e && u && !l) {
166
+ if (d.current && !e && u && !l) {
167
167
  const i = setTimeout(() => {
168
168
  g(!1), b(!0);
169
169
  }, j);