@chatsdk-dev/ui 0.1.2 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (562) hide show
  1. package/dist/atoms/accordion.d.ts +4 -4
  2. package/dist/atoms/accordion.d.ts.map +1 -1
  3. package/dist/atoms/alert-dialog.d.ts +22 -14
  4. package/dist/atoms/alert-dialog.d.ts.map +1 -1
  5. package/dist/atoms/alert-dialog.js +13 -8
  6. package/dist/atoms/alert.d.ts +4 -4
  7. package/dist/atoms/alert.d.ts.map +1 -1
  8. package/dist/atoms/attachment.d.ts +24 -0
  9. package/dist/atoms/attachment.d.ts.map +1 -0
  10. package/dist/atoms/attachment.js +76 -0
  11. package/dist/atoms/avatar.d.ts +6 -6
  12. package/dist/atoms/avatar.d.ts.map +1 -1
  13. package/dist/atoms/badge.d.ts +1 -1
  14. package/dist/atoms/bubble.d.ts +17 -0
  15. package/dist/atoms/bubble.d.ts.map +1 -0
  16. package/dist/atoms/bubble.js +59 -0
  17. package/dist/atoms/button-group.d.ts +2 -2
  18. package/dist/atoms/button-group.d.ts.map +1 -1
  19. package/dist/atoms/button-loader.d.ts +2 -2
  20. package/dist/atoms/button-loader.d.ts.map +1 -1
  21. package/dist/atoms/button.d.ts +2 -2
  22. package/dist/atoms/button.d.ts.map +1 -1
  23. package/dist/atoms/button.js +2 -1
  24. package/dist/atoms/card.d.ts +7 -7
  25. package/dist/atoms/card.d.ts.map +1 -1
  26. package/dist/atoms/carousel.d.ts +5 -5
  27. package/dist/atoms/carousel.d.ts.map +1 -1
  28. package/dist/atoms/carousel.js +1 -0
  29. package/dist/atoms/collapsible.d.ts +3 -3
  30. package/dist/atoms/collapsible.d.ts.map +1 -1
  31. package/dist/atoms/command.d.ts +9 -9
  32. package/dist/atoms/command.d.ts.map +1 -1
  33. package/dist/atoms/container.d.ts +1 -1
  34. package/dist/atoms/container.d.ts.map +1 -1
  35. package/dist/atoms/dialog.d.ts +10 -10
  36. package/dist/atoms/dialog.d.ts.map +1 -1
  37. package/dist/atoms/dialog.js +4 -2
  38. package/dist/atoms/dots-loader.d.ts +1 -1
  39. package/dist/atoms/dots-loader.d.ts.map +1 -1
  40. package/dist/atoms/drawer.d.ts +10 -10
  41. package/dist/atoms/drawer.d.ts.map +1 -1
  42. package/dist/atoms/drawer.js +6 -4
  43. package/dist/atoms/dropdown-menu.d.ts +15 -15
  44. package/dist/atoms/dropdown-menu.d.ts.map +1 -1
  45. package/dist/atoms/dropdown-menu.js +8 -5
  46. package/dist/atoms/empty.d.ts +6 -6
  47. package/dist/atoms/empty.d.ts.map +1 -1
  48. package/dist/atoms/field.d.ts +10 -10
  49. package/dist/atoms/field.d.ts.map +1 -1
  50. package/dist/atoms/form.d.ts +6 -6
  51. package/dist/atoms/form.d.ts.map +1 -1
  52. package/dist/atoms/form.js +4 -2
  53. package/dist/atoms/header.d.ts +1 -1
  54. package/dist/atoms/header.d.ts.map +1 -1
  55. package/dist/atoms/hover-card.d.ts +3 -3
  56. package/dist/atoms/hover-card.d.ts.map +1 -1
  57. package/dist/atoms/hover-card.js +3 -1
  58. package/dist/atoms/input-group.d.ts +7 -7
  59. package/dist/atoms/input-group.d.ts.map +1 -1
  60. package/dist/atoms/input.d.ts +1 -1
  61. package/dist/atoms/input.d.ts.map +1 -1
  62. package/dist/atoms/input.js +1 -1
  63. package/dist/atoms/label.d.ts +1 -1
  64. package/dist/atoms/label.d.ts.map +1 -1
  65. package/dist/atoms/logo.d.ts +1 -1
  66. package/dist/atoms/logo.d.ts.map +1 -1
  67. package/dist/atoms/marker.d.ts +11 -0
  68. package/dist/atoms/marker.d.ts.map +1 -0
  69. package/dist/atoms/marker.js +34 -0
  70. package/dist/atoms/message-scroller.d.ts +11 -0
  71. package/dist/atoms/message-scroller.d.ts.map +1 -0
  72. package/dist/atoms/message-scroller.js +25 -0
  73. package/dist/atoms/message.d.ts +11 -0
  74. package/dist/atoms/message.d.ts.map +1 -0
  75. package/dist/atoms/message.js +21 -0
  76. package/dist/atoms/number-flow.d.ts +1 -1
  77. package/dist/atoms/number-flow.d.ts.map +1 -1
  78. package/dist/atoms/popover.d.ts +6 -6
  79. package/dist/atoms/popover.d.ts.map +1 -1
  80. package/dist/atoms/popover.js +3 -1
  81. package/dist/atoms/progress.d.ts +5 -5
  82. package/dist/atoms/progress.d.ts.map +1 -1
  83. package/dist/atoms/radio-group.d.ts +2 -2
  84. package/dist/atoms/radio-group.d.ts.map +1 -1
  85. package/dist/atoms/scroll-area.d.ts +2 -2
  86. package/dist/atoms/scroll-area.d.ts.map +1 -1
  87. package/dist/atoms/select.d.ts +9 -9
  88. package/dist/atoms/select.d.ts.map +1 -1
  89. package/dist/atoms/select.js +5 -3
  90. package/dist/atoms/separator.d.ts +1 -1
  91. package/dist/atoms/separator.d.ts.map +1 -1
  92. package/dist/atoms/sheet.d.ts +8 -8
  93. package/dist/atoms/sheet.d.ts.map +1 -1
  94. package/dist/atoms/sheet.js +5 -3
  95. package/dist/atoms/sidebar.d.ts +19 -19
  96. package/dist/atoms/sidebar.d.ts.map +1 -1
  97. package/dist/atoms/sidebar.js +1 -1
  98. package/dist/atoms/skeleton.d.ts +1 -1
  99. package/dist/atoms/skeleton.d.ts.map +1 -1
  100. package/dist/atoms/spinner.d.ts +1 -1
  101. package/dist/atoms/spinner.d.ts.map +1 -1
  102. package/dist/atoms/switch.d.ts +1 -1
  103. package/dist/atoms/switch.d.ts.map +1 -1
  104. package/dist/atoms/table.d.ts +8 -8
  105. package/dist/atoms/table.d.ts.map +1 -1
  106. package/dist/atoms/table.js +1 -1
  107. package/dist/atoms/tabs.d.ts +8 -5
  108. package/dist/atoms/tabs.d.ts.map +1 -1
  109. package/dist/atoms/tabs.js +10 -6
  110. package/dist/atoms/textarea.d.ts +1 -1
  111. package/dist/atoms/textarea.d.ts.map +1 -1
  112. package/dist/atoms/toggle.d.ts +2 -2
  113. package/dist/atoms/toggle.d.ts.map +1 -1
  114. package/dist/atoms/toggle.js +1 -0
  115. package/dist/atoms/tooltip.d.ts +7 -5
  116. package/dist/atoms/tooltip.d.ts.map +1 -1
  117. package/dist/atoms/tooltip.js +6 -4
  118. package/dist/atoms/typography/h1.d.ts +1 -1
  119. package/dist/atoms/typography/h1.d.ts.map +1 -1
  120. package/dist/atoms/typography/paragraph.d.ts +1 -1
  121. package/dist/atoms/typography/paragraph.d.ts.map +1 -1
  122. package/dist/hooks/use-breakpoint.d.ts.map +1 -1
  123. package/dist/hooks/use-breakpoint.js +1 -0
  124. package/dist/hooks/use-controllable-state.js +1 -1
  125. package/dist/hooks/use-copy-to-clipboard.d.ts +9 -1
  126. package/dist/hooks/use-copy-to-clipboard.d.ts.map +1 -1
  127. package/dist/hooks/use-copy-to-clipboard.js +9 -6
  128. package/dist/index.css +1693 -996
  129. package/dist/lib/portal-container.d.ts +12 -0
  130. package/dist/lib/portal-container.d.ts.map +1 -0
  131. package/dist/lib/portal-container.js +15 -0
  132. package/dist/lib/utils.d.ts +8 -0
  133. package/dist/lib/utils.d.ts.map +1 -1
  134. package/dist/lib/utils.js +27 -0
  135. package/dist/molecules/ai/action.d.ts +7 -0
  136. package/dist/molecules/ai/action.d.ts.map +1 -0
  137. package/dist/molecules/ai/action.js +13 -0
  138. package/dist/molecules/ai/agent.d.ts +7 -7
  139. package/dist/molecules/ai/agent.d.ts.map +1 -1
  140. package/dist/molecules/ai/artifact.d.ts +8 -8
  141. package/dist/molecules/ai/artifact.d.ts.map +1 -1
  142. package/dist/molecules/ai/artifact.js +2 -2
  143. package/dist/molecules/ai/audio-player.d.ts +11 -11
  144. package/dist/molecules/ai/audio-player.d.ts.map +1 -1
  145. package/dist/molecules/ai/audio-player.js +1 -3
  146. package/dist/molecules/ai/canvas.d.ts +1 -2
  147. package/dist/molecules/ai/canvas.d.ts.map +1 -1
  148. package/dist/molecules/ai/canvas.js +0 -1
  149. package/dist/molecules/ai/chain-of-thought.d.ts +7 -7
  150. package/dist/molecules/ai/chain-of-thought.d.ts.map +1 -1
  151. package/dist/molecules/ai/checkpoint.d.ts +3 -3
  152. package/dist/molecules/ai/checkpoint.d.ts.map +1 -1
  153. package/dist/molecules/ai/code-block.d.ts +13 -13
  154. package/dist/molecules/ai/code-block.d.ts.map +1 -1
  155. package/dist/molecules/ai/commit.d.ts +22 -22
  156. package/dist/molecules/ai/commit.d.ts.map +1 -1
  157. package/dist/molecules/ai/confirmation.d.ts +4 -12
  158. package/dist/molecules/ai/confirmation.d.ts.map +1 -1
  159. package/dist/molecules/ai/context.d.ts +10 -10
  160. package/dist/molecules/ai/context.d.ts.map +1 -1
  161. package/dist/molecules/ai/controls.d.ts +1 -1
  162. package/dist/molecules/ai/controls.d.ts.map +1 -1
  163. package/dist/molecules/ai/edge.d.ts +2 -2
  164. package/dist/molecules/ai/environment-variables.d.ts +11 -11
  165. package/dist/molecules/ai/environment-variables.d.ts.map +1 -1
  166. package/dist/molecules/ai/file-tree.d.ts +6 -6
  167. package/dist/molecules/ai/file-tree.d.ts.map +1 -1
  168. package/dist/molecules/ai/image.d.ts +1 -1
  169. package/dist/molecules/ai/image.d.ts.map +1 -1
  170. package/dist/molecules/ai/inline-citation.d.ts +14 -14
  171. package/dist/molecules/ai/inline-citation.d.ts.map +1 -1
  172. package/dist/molecules/ai/jsx-preview.d.ts +3 -3
  173. package/dist/molecules/ai/jsx-preview.d.ts.map +1 -1
  174. package/dist/molecules/ai/loader.d.ts +1 -1
  175. package/dist/molecules/ai/loader.d.ts.map +1 -1
  176. package/dist/molecules/ai/mic-selector.d.ts +9 -9
  177. package/dist/molecules/ai/mic-selector.d.ts.map +1 -1
  178. package/dist/molecules/ai/model-selector.d.ts +14 -14
  179. package/dist/molecules/ai/model-selector.d.ts.map +1 -1
  180. package/dist/molecules/ai/node.d.ts +7 -7
  181. package/dist/molecules/ai/node.d.ts.map +1 -1
  182. package/dist/molecules/ai/open-in-chat.d.ts +12 -12
  183. package/dist/molecules/ai/open-in-chat.d.ts.map +1 -1
  184. package/dist/molecules/ai/package-info.d.ts +9 -9
  185. package/dist/molecules/ai/package-info.d.ts.map +1 -1
  186. package/dist/molecules/ai/panel.d.ts +1 -1
  187. package/dist/molecules/ai/panel.d.ts.map +1 -1
  188. package/dist/molecules/ai/persona.d.ts.map +1 -1
  189. package/dist/molecules/ai/plan.d.ts +8 -8
  190. package/dist/molecules/ai/plan.d.ts.map +1 -1
  191. package/dist/molecules/ai/plan.js +3 -4
  192. package/dist/molecules/ai/prompt-input.d.ts +35 -35
  193. package/dist/molecules/ai/prompt-input.d.ts.map +1 -1
  194. package/dist/molecules/ai/prompt-input.js +5 -15
  195. package/dist/molecules/ai/queue.d.ts +15 -15
  196. package/dist/molecules/ai/queue.d.ts.map +1 -1
  197. package/dist/molecules/ai/reasoning.d.ts +3 -3
  198. package/dist/molecules/ai/reasoning.d.ts.map +1 -1
  199. package/dist/molecules/ai/reasoning.js +7 -34
  200. package/dist/molecules/ai/response.d.ts +3 -4
  201. package/dist/molecules/ai/response.d.ts.map +1 -1
  202. package/dist/molecules/ai/response.js +10 -14
  203. package/dist/molecules/ai/sandbox.d.ts +8 -8
  204. package/dist/molecules/ai/sandbox.d.ts.map +1 -1
  205. package/dist/molecules/ai/sandbox.js +1 -1
  206. package/dist/molecules/ai/schema-display.d.ts +13 -13
  207. package/dist/molecules/ai/schema-display.d.ts.map +1 -1
  208. package/dist/molecules/ai/snippet.d.ts +5 -5
  209. package/dist/molecules/ai/snippet.d.ts.map +1 -1
  210. package/dist/molecules/ai/sources.d.ts +6 -5
  211. package/dist/molecules/ai/sources.d.ts.map +1 -1
  212. package/dist/molecules/ai/sources.js +2 -2
  213. package/dist/molecules/ai/speech-input.d.ts +1 -1
  214. package/dist/molecules/ai/speech-input.d.ts.map +1 -1
  215. package/dist/molecules/ai/stack-trace.d.ts +10 -10
  216. package/dist/molecules/ai/stack-trace.d.ts.map +1 -1
  217. package/dist/molecules/ai/stack-trace.js +1 -1
  218. package/dist/molecules/ai/suggestion.d.ts +2 -2
  219. package/dist/molecules/ai/suggestion.d.ts.map +1 -1
  220. package/dist/molecules/ai/task.d.ts +5 -5
  221. package/dist/molecules/ai/task.d.ts.map +1 -1
  222. package/dist/molecules/ai/terminal.d.ts +8 -8
  223. package/dist/molecules/ai/terminal.d.ts.map +1 -1
  224. package/dist/molecules/ai/test-results.d.ts +17 -17
  225. package/dist/molecules/ai/test-results.d.ts.map +1 -1
  226. package/dist/molecules/ai/tool.d.ts +21 -8
  227. package/dist/molecules/ai/tool.d.ts.map +1 -1
  228. package/dist/molecules/ai/tool.js +15 -11
  229. package/dist/molecules/ai/toolbar.d.ts +1 -1
  230. package/dist/molecules/ai/toolbar.d.ts.map +1 -1
  231. package/dist/molecules/ai/transcription.d.ts +2 -2
  232. package/dist/molecules/ai/transcription.d.ts.map +1 -1
  233. package/dist/molecules/ai/voice-selector.d.ts +19 -19
  234. package/dist/molecules/ai/voice-selector.d.ts.map +1 -1
  235. package/dist/molecules/ai/web-preview.d.ts +6 -6
  236. package/dist/molecules/ai/web-preview.d.ts.map +1 -1
  237. package/dist/molecules/ai/web-preview.js +2 -2
  238. package/package.json +27 -27
  239. package/dist/components/accordion.d.ts +0 -7
  240. package/dist/components/accordion.d.ts.map +0 -1
  241. package/dist/components/accordion.js +0 -18
  242. package/dist/components/alert-dialog.d.ts +0 -19
  243. package/dist/components/alert-dialog.d.ts.map +0 -1
  244. package/dist/components/alert-dialog.js +0 -42
  245. package/dist/components/alert.d.ts +0 -11
  246. package/dist/components/alert.d.ts.map +0 -1
  247. package/dist/components/alert.js +0 -27
  248. package/dist/components/avatar.d.ts +0 -12
  249. package/dist/components/avatar.d.ts.map +0 -1
  250. package/dist/components/avatar.js +0 -23
  251. package/dist/components/badge.d.ts +0 -8
  252. package/dist/components/badge.d.ts.map +0 -1
  253. package/dist/components/badge.js +0 -44
  254. package/dist/components/button-group.d.ts +0 -11
  255. package/dist/components/button-group.d.ts.map +0 -1
  256. package/dist/components/button-group.js +0 -36
  257. package/dist/components/button-loader.d.ts +0 -9
  258. package/dist/components/button-loader.d.ts.map +0 -1
  259. package/dist/components/button-loader.js +0 -10
  260. package/dist/components/button.d.ts +0 -9
  261. package/dist/components/button.d.ts.map +0 -1
  262. package/dist/components/button.js +0 -32
  263. package/dist/components/card.d.ts +0 -12
  264. package/dist/components/card.d.ts.map +0 -1
  265. package/dist/components/card.js +0 -25
  266. package/dist/components/carousel.d.ts +0 -29
  267. package/dist/components/carousel.d.ts.map +0 -1
  268. package/dist/components/carousel.js +0 -91
  269. package/dist/components/collapsible.d.ts +0 -6
  270. package/dist/components/collapsible.d.ts.map +0 -1
  271. package/dist/components/collapsible.js +0 -13
  272. package/dist/components/command.d.ts +0 -20
  273. package/dist/components/command.d.ts.map +0 -1
  274. package/dist/components/command.js +0 -35
  275. package/dist/components/container.d.ts +0 -8
  276. package/dist/components/container.d.ts.map +0 -1
  277. package/dist/components/container.js +0 -5
  278. package/dist/components/dialog.d.ts +0 -19
  279. package/dist/components/dialog.d.ts.map +0 -1
  280. package/dist/components/dialog.js +0 -38
  281. package/dist/components/dots-loader.d.ts +0 -15
  282. package/dist/components/dots-loader.d.ts.map +0 -1
  283. package/dist/components/dots-loader.js +0 -21
  284. package/dist/components/drawer.d.ts +0 -14
  285. package/dist/components/drawer.d.ts.map +0 -1
  286. package/dist/components/drawer.js +0 -35
  287. package/dist/components/dropdown-menu.d.ts +0 -26
  288. package/dist/components/dropdown-menu.d.ts.map +0 -1
  289. package/dist/components/dropdown-menu.js +0 -51
  290. package/dist/components/empty.d.ts +0 -12
  291. package/dist/components/empty.d.ts.map +0 -1
  292. package/dist/components/empty.js +0 -33
  293. package/dist/components/field.d.ts +0 -25
  294. package/dist/components/field.d.ts.map +0 -1
  295. package/dist/components/field.js +0 -68
  296. package/dist/components/form.d.ts +0 -23
  297. package/dist/components/form.d.ts.map +0 -1
  298. package/dist/components/form.js +0 -68
  299. package/dist/components/header.d.ts +0 -6
  300. package/dist/components/header.d.ts.map +0 -1
  301. package/dist/components/header.js +0 -6
  302. package/dist/components/hover-card.d.ts +0 -6
  303. package/dist/components/hover-card.d.ts.map +0 -1
  304. package/dist/components/hover-card.js +0 -14
  305. package/dist/components/index.d.ts +0 -5
  306. package/dist/components/index.d.ts.map +0 -1
  307. package/dist/components/index.js +0 -5
  308. package/dist/components/input-group.d.ts +0 -19
  309. package/dist/components/input-group.d.ts.map +0 -1
  310. package/dist/components/input-group.js +0 -57
  311. package/dist/components/input.d.ts +0 -7
  312. package/dist/components/input.d.ts.map +0 -1
  313. package/dist/components/input.js +0 -6
  314. package/dist/components/label.d.ts +0 -3
  315. package/dist/components/label.d.ts.map +0 -1
  316. package/dist/components/label.js +0 -7
  317. package/dist/components/logo.d.ts +0 -7
  318. package/dist/components/logo.d.ts.map +0 -1
  319. package/dist/components/logo.js +0 -6
  320. package/dist/components/number-flow.d.ts +0 -3
  321. package/dist/components/number-flow.d.ts.map +0 -1
  322. package/dist/components/number-flow.js +0 -6
  323. package/dist/components/popover.d.ts +0 -10
  324. package/dist/components/popover.d.ts.map +0 -1
  325. package/dist/components/popover.js +0 -23
  326. package/dist/components/progress.d.ts +0 -8
  327. package/dist/components/progress.d.ts.map +0 -1
  328. package/dist/components/progress.js +0 -20
  329. package/dist/components/radio-group.d.ts +0 -6
  330. package/dist/components/radio-group.d.ts.map +0 -1
  331. package/dist/components/radio-group.js +0 -13
  332. package/dist/components/responsive-alert-dialog.d.ts +0 -16
  333. package/dist/components/responsive-alert-dialog.d.ts.map +0 -1
  334. package/dist/components/responsive-alert-dialog.js +0 -20
  335. package/dist/components/responsive-dialog.d.ts +0 -11
  336. package/dist/components/responsive-dialog.d.ts.map +0 -1
  337. package/dist/components/responsive-dialog.js +0 -21
  338. package/dist/components/scroll-area.d.ts +0 -5
  339. package/dist/components/scroll-area.d.ts.map +0 -1
  340. package/dist/components/scroll-area.js +0 -11
  341. package/dist/components/select.d.ts +0 -17
  342. package/dist/components/select.d.ts.map +0 -1
  343. package/dist/components/select.js +0 -34
  344. package/dist/components/separator.d.ts +0 -3
  345. package/dist/components/separator.d.ts.map +0 -1
  346. package/dist/components/separator.js +0 -7
  347. package/dist/components/sheet.d.ts +0 -15
  348. package/dist/components/sheet.d.ts.map +0 -1
  349. package/dist/components/sheet.js +0 -37
  350. package/dist/components/sidebar.d.ts +0 -65
  351. package/dist/components/sidebar.d.ts.map +0 -1
  352. package/dist/components/sidebar.js +0 -258
  353. package/dist/components/skeleton.d.ts +0 -2
  354. package/dist/components/skeleton.d.ts.map +0 -1
  355. package/dist/components/skeleton.js +0 -5
  356. package/dist/components/spinner.d.ts +0 -3
  357. package/dist/components/spinner.d.ts.map +0 -1
  358. package/dist/components/spinner.js +0 -7
  359. package/dist/components/switch.d.ts +0 -5
  360. package/dist/components/switch.d.ts.map +0 -1
  361. package/dist/components/switch.js +0 -7
  362. package/dist/components/table.d.ts +0 -13
  363. package/dist/components/table.d.ts.map +0 -1
  364. package/dist/components/table.js +0 -28
  365. package/dist/components/tabs.d.ts +0 -12
  366. package/dist/components/tabs.d.ts.map +0 -1
  367. package/dist/components/tabs.js +0 -32
  368. package/dist/components/textarea.d.ts +0 -3
  369. package/dist/components/textarea.d.ts.map +0 -1
  370. package/dist/components/textarea.js +0 -5
  371. package/dist/components/toggle.d.ts +0 -9
  372. package/dist/components/toggle.d.ts.map +0 -1
  373. package/dist/components/toggle.js +0 -26
  374. package/dist/components/tooltip.d.ts +0 -7
  375. package/dist/components/tooltip.d.ts.map +0 -1
  376. package/dist/components/tooltip.js +0 -17
  377. package/dist/components/typography/h1.d.ts +0 -10
  378. package/dist/components/typography/h1.d.ts.map +0 -1
  379. package/dist/components/typography/h1.js +0 -6
  380. package/dist/components/typography/paragraph.d.ts +0 -6
  381. package/dist/components/typography/paragraph.d.ts.map +0 -1
  382. package/dist/components/typography/paragraph.js +0 -6
  383. package/dist/components/typography/text.d.ts +0 -14
  384. package/dist/components/typography/text.d.ts.map +0 -1
  385. package/dist/components/typography/text.js +0 -41
  386. package/dist/molecules/actions.d.ts +0 -10
  387. package/dist/molecules/actions.d.ts.map +0 -1
  388. package/dist/molecules/actions.js +0 -13
  389. package/dist/molecules/agent.d.ts +0 -27
  390. package/dist/molecules/agent.d.ts.map +0 -1
  391. package/dist/molecules/agent.js +0 -27
  392. package/dist/molecules/ai/actions.d.ts +0 -10
  393. package/dist/molecules/ai/actions.d.ts.map +0 -1
  394. package/dist/molecules/ai/actions.js +0 -13
  395. package/dist/molecules/ai/attachments.d.ts +0 -55
  396. package/dist/molecules/ai/attachments.d.ts.map +0 -1
  397. package/dist/molecules/ai/attachments.js +0 -125
  398. package/dist/molecules/ai/conversation.d.ts +0 -24
  399. package/dist/molecules/ai/conversation.d.ts.map +0 -1
  400. package/dist/molecules/ai/conversation.js +0 -41
  401. package/dist/molecules/ai/message.d.ts +0 -38
  402. package/dist/molecules/ai/message.d.ts.map +0 -1
  403. package/dist/molecules/ai/message.js +0 -92
  404. package/dist/molecules/ai/shimmer.d.ts +0 -10
  405. package/dist/molecules/ai/shimmer.d.ts.map +0 -1
  406. package/dist/molecules/ai/shimmer.js +0 -28
  407. package/dist/molecules/artifact.d.ts +0 -24
  408. package/dist/molecules/artifact.d.ts.map +0 -1
  409. package/dist/molecules/artifact.js +0 -20
  410. package/dist/molecules/attachments.d.ts +0 -55
  411. package/dist/molecules/attachments.d.ts.map +0 -1
  412. package/dist/molecules/attachments.js +0 -125
  413. package/dist/molecules/audio-player.d.ts +0 -30
  414. package/dist/molecules/audio-player.d.ts.map +0 -1
  415. package/dist/molecules/audio-player.js +0 -43
  416. package/dist/molecules/canvas.d.ts +0 -9
  417. package/dist/molecules/canvas.d.ts.map +0 -1
  418. package/dist/molecules/canvas.js +0 -5
  419. package/dist/molecules/chain-of-thought.d.ts +0 -30
  420. package/dist/molecules/chain-of-thought.d.ts.map +0 -1
  421. package/dist/molecules/chain-of-thought.js +0 -49
  422. package/dist/molecules/chat-message.d.ts +0 -10
  423. package/dist/molecules/chat-message.d.ts.map +0 -1
  424. package/dist/molecules/chat-message.js +0 -53
  425. package/dist/molecules/checkpoint.d.ts +0 -12
  426. package/dist/molecules/checkpoint.d.ts.map +0 -1
  427. package/dist/molecules/checkpoint.js +0 -10
  428. package/dist/molecules/code-block.d.ts +0 -46
  429. package/dist/molecules/code-block.d.ts.map +0 -1
  430. package/dist/molecules/code-block.js +0 -216
  431. package/dist/molecules/commit.d.ts +0 -65
  432. package/dist/molecules/commit.d.ts.map +0 -1
  433. package/dist/molecules/commit.js +0 -95
  434. package/dist/molecules/confirmation.d.ts +0 -50
  435. package/dist/molecules/confirmation.d.ts.map +0 -1
  436. package/dist/molecules/confirmation.js +0 -61
  437. package/dist/molecules/connection.d.ts +0 -3
  438. package/dist/molecules/connection.d.ts.map +0 -1
  439. package/dist/molecules/connection.js +0 -3
  440. package/dist/molecules/context.d.ts +0 -33
  441. package/dist/molecules/context.d.ts.map +0 -1
  442. package/dist/molecules/context.js +0 -164
  443. package/dist/molecules/controls.d.ts +0 -5
  444. package/dist/molecules/controls.d.ts.map +0 -1
  445. package/dist/molecules/controls.js +0 -5
  446. package/dist/molecules/conversation.d.ts +0 -24
  447. package/dist/molecules/conversation.d.ts.map +0 -1
  448. package/dist/molecules/conversation.js +0 -41
  449. package/dist/molecules/edge.d.ts +0 -6
  450. package/dist/molecules/edge.d.ts.map +0 -1
  451. package/dist/molecules/edge.js +0 -87
  452. package/dist/molecules/environment-variables.d.ts +0 -39
  453. package/dist/molecules/environment-variables.d.ts.map +0 -1
  454. package/dist/molecules/environment-variables.js +0 -87
  455. package/dist/molecules/file-tree.d.ts +0 -27
  456. package/dist/molecules/file-tree.d.ts.map +0 -1
  457. package/dist/molecules/file-tree.js +0 -71
  458. package/dist/molecules/image.d.ts +0 -7
  459. package/dist/molecules/image.d.ts.map +0 -1
  460. package/dist/molecules/image.js +0 -3
  461. package/dist/molecules/inline-citation.d.ts +0 -39
  462. package/dist/molecules/inline-citation.d.ts.map +0 -1
  463. package/dist/molecules/inline-citation.js +0 -68
  464. package/dist/molecules/jsx-preview.d.ts +0 -30
  465. package/dist/molecules/jsx-preview.d.ts.map +0 -1
  466. package/dist/molecules/jsx-preview.js +0 -167
  467. package/dist/molecules/loader.d.ts +0 -6
  468. package/dist/molecules/loader.d.ts.map +0 -1
  469. package/dist/molecules/loader.js +0 -4
  470. package/dist/molecules/message.d.ts +0 -38
  471. package/dist/molecules/message.d.ts.map +0 -1
  472. package/dist/molecules/message.js +0 -92
  473. package/dist/molecules/mic-selector.d.ts +0 -46
  474. package/dist/molecules/mic-selector.d.ts.map +0 -1
  475. package/dist/molecules/mic-selector.js +0 -184
  476. package/dist/molecules/model-selector.d.ts +0 -36
  477. package/dist/molecules/model-selector.d.ts.map +0 -1
  478. package/dist/molecules/model-selector.js +0 -18
  479. package/dist/molecules/node.d.ts +0 -22
  480. package/dist/molecules/node.d.ts.map +0 -1
  481. package/dist/molecules/node.js +0 -11
  482. package/dist/molecules/open-in-chat.d.ts +0 -29
  483. package/dist/molecules/open-in-chat.d.ts.map +0 -1
  484. package/dist/molecules/open-in-chat.js +0 -100
  485. package/dist/molecules/package-info.d.ts +0 -30
  486. package/dist/molecules/package-info.d.ts.map +0 -1
  487. package/dist/molecules/package-info.js +0 -50
  488. package/dist/molecules/panel.d.ts +0 -6
  489. package/dist/molecules/panel.d.ts.map +0 -1
  490. package/dist/molecules/panel.js +0 -4
  491. package/dist/molecules/persona.d.ts +0 -49
  492. package/dist/molecules/persona.d.ts.map +0 -1
  493. package/dist/molecules/persona.js +0 -189
  494. package/dist/molecules/plan.d.ts +0 -26
  495. package/dist/molecules/plan.d.ts.map +0 -1
  496. package/dist/molecules/plan.js +0 -34
  497. package/dist/molecules/prompt-input.d.ts +0 -149
  498. package/dist/molecules/prompt-input.d.ts.map +0 -1
  499. package/dist/molecules/prompt-input.js +0 -702
  500. package/dist/molecules/queue.d.ts +0 -62
  501. package/dist/molecules/queue.d.ts.map +0 -1
  502. package/dist/molecules/queue.js +0 -28
  503. package/dist/molecules/reasoning.d.ts +0 -27
  504. package/dist/molecules/reasoning.d.ts.map +0 -1
  505. package/dist/molecules/reasoning.js +0 -95
  506. package/dist/molecules/response.d.ts +0 -6
  507. package/dist/molecules/response.d.ts.map +0 -1
  508. package/dist/molecules/response.js +0 -18
  509. package/dist/molecules/responsive-alert-dialog.d.ts +0 -16
  510. package/dist/molecules/responsive-alert-dialog.d.ts.map +0 -1
  511. package/dist/molecules/responsive-alert-dialog.js +0 -20
  512. package/dist/molecules/responsive-dialog.d.ts +0 -11
  513. package/dist/molecules/responsive-dialog.d.ts.map +0 -1
  514. package/dist/molecules/responsive-dialog.js +0 -21
  515. package/dist/molecules/sandbox.d.ts +0 -25
  516. package/dist/molecules/sandbox.d.ts.map +0 -1
  517. package/dist/molecules/sandbox.js +0 -15
  518. package/dist/molecules/schema-display.d.ts +0 -56
  519. package/dist/molecules/schema-display.d.ts.map +0 -1
  520. package/dist/molecules/schema-display.js +0 -73
  521. package/dist/molecules/shimmer.d.ts +0 -10
  522. package/dist/molecules/shimmer.d.ts.map +0 -1
  523. package/dist/molecules/shimmer.js +0 -28
  524. package/dist/molecules/snippet.d.ts +0 -19
  525. package/dist/molecules/snippet.d.ts.map +0 -1
  526. package/dist/molecules/snippet.js +0 -46
  527. package/dist/molecules/sources.d.ts +0 -13
  528. package/dist/molecules/sources.d.ts.map +0 -1
  529. package/dist/molecules/sources.js +0 -9
  530. package/dist/molecules/speech-input.d.ts +0 -55
  531. package/dist/molecules/speech-input.d.ts.map +0 -1
  532. package/dist/molecules/speech-input.js +0 -187
  533. package/dist/molecules/stack-trace.d.ts +0 -38
  534. package/dist/molecules/stack-trace.d.ts.map +0 -1
  535. package/dist/molecules/stack-trace.js +0 -194
  536. package/dist/molecules/suggestion.d.ts +0 -11
  537. package/dist/molecules/suggestion.d.ts.map +0 -1
  538. package/dist/molecules/suggestion.js +0 -13
  539. package/dist/molecules/task.d.ts +0 -15
  540. package/dist/molecules/task.d.ts.map +0 -1
  541. package/dist/molecules/task.js +0 -10
  542. package/dist/molecules/terminal.d.ts +0 -28
  543. package/dist/molecules/terminal.d.ts.map +0 -1
  544. package/dist/molecules/terminal.js +0 -68
  545. package/dist/molecules/test-results.d.ts +0 -59
  546. package/dist/molecules/test-results.d.ts.map +0 -1
  547. package/dist/molecules/test-results.js +0 -97
  548. package/dist/molecules/tool.d.ts +0 -32
  549. package/dist/molecules/tool.d.ts.map +0 -1
  550. package/dist/molecules/tool.js +0 -49
  551. package/dist/molecules/toolbar.d.ts +0 -6
  552. package/dist/molecules/toolbar.d.ts.map +0 -1
  553. package/dist/molecules/toolbar.js +0 -4
  554. package/dist/molecules/transcription.d.ts +0 -17
  555. package/dist/molecules/transcription.d.ts.map +0 -1
  556. package/dist/molecules/transcription.js +0 -36
  557. package/dist/molecules/voice-selector.d.ts +0 -64
  558. package/dist/molecules/voice-selector.d.ts.map +0 -1
  559. package/dist/molecules/voice-selector.js +0 -224
  560. package/dist/molecules/web-preview.d.ts +0 -35
  561. package/dist/molecules/web-preview.d.ts.map +0 -1
  562. package/dist/molecules/web-preview.js +0 -65
@@ -1,164 +0,0 @@
1
- "use client";
2
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
- import { Button } from "@chatsdk-dev/ui/components/button";
4
- import { HoverCard, HoverCardContent, HoverCardTrigger, } from "@chatsdk-dev/ui/components/hover-card";
5
- import { Progress } from "@chatsdk-dev/ui/components/progress";
6
- import { cn } from "@chatsdk-dev/ui/lib/utils";
7
- import { createContext, useContext, useMemo } from "react";
8
- import { getUsage } from "tokenlens";
9
- const PERCENT_MAX = 100;
10
- const ICON_RADIUS = 10;
11
- const ICON_VIEWBOX = 24;
12
- const ICON_CENTER = 12;
13
- const ICON_STROKE_WIDTH = 2;
14
- const ContextContext = createContext(null);
15
- const useContextValue = () => {
16
- const context = useContext(ContextContext);
17
- if (!context) {
18
- throw new Error("Context components must be used within Context");
19
- }
20
- return context;
21
- };
22
- export const Context = ({ usedTokens, maxTokens, usage, modelId, ...props }) => {
23
- const contextValue = useMemo(() => ({ maxTokens, modelId, usage, usedTokens }), [maxTokens, modelId, usage, usedTokens]);
24
- return (_jsx(ContextContext.Provider, { value: contextValue, children: _jsx(HoverCard, { ...props }) }));
25
- };
26
- const ContextIcon = () => {
27
- const { usedTokens, maxTokens } = useContextValue();
28
- const circumference = 2 * Math.PI * ICON_RADIUS;
29
- const usedPercent = usedTokens / maxTokens;
30
- const dashOffset = circumference * (1 - usedPercent);
31
- return (_jsxs("svg", { "aria-label": "Model context usage", height: "20", role: "img", style: { color: "currentcolor" }, viewBox: `0 0 ${ICON_VIEWBOX} ${ICON_VIEWBOX}`, width: "20", children: [_jsx("circle", { cx: ICON_CENTER, cy: ICON_CENTER, fill: "none", opacity: "0.25", r: ICON_RADIUS, stroke: "currentColor", strokeWidth: ICON_STROKE_WIDTH }), _jsx("circle", { cx: ICON_CENTER, cy: ICON_CENTER, fill: "none", opacity: "0.7", r: ICON_RADIUS, stroke: "currentColor", strokeDasharray: `${circumference} ${circumference}`, strokeDashoffset: dashOffset, strokeLinecap: "round", strokeWidth: ICON_STROKE_WIDTH, style: { transform: "rotate(-90deg)", transformOrigin: "center" } })] }));
32
- };
33
- export const ContextTrigger = ({ children, ...props }) => {
34
- const { usedTokens, maxTokens } = useContextValue();
35
- const usedPercent = usedTokens / maxTokens;
36
- const renderedPercent = new Intl.NumberFormat("en-US", {
37
- maximumFractionDigits: 1,
38
- style: "percent",
39
- }).format(usedPercent);
40
- return (_jsx(HoverCardTrigger, { render: () => children ? (_jsx(_Fragment, { children: children })) : (_jsxs(Button, { type: "button", variant: "ghost", ...props, children: [_jsx("span", { className: "font-medium text-muted-foreground", children: renderedPercent }), _jsx(ContextIcon, {})] })) }));
41
- };
42
- export const ContextContent = ({ className, ...props }) => (_jsx(HoverCardContent, { className: cn("min-w-60 divide-y overflow-hidden p-0", className), ...props }));
43
- export const ContextContentHeader = ({ children, className, ...props }) => {
44
- const { usedTokens, maxTokens } = useContextValue();
45
- const usedPercent = usedTokens / maxTokens;
46
- const displayPct = new Intl.NumberFormat("en-US", {
47
- maximumFractionDigits: 1,
48
- style: "percent",
49
- }).format(usedPercent);
50
- const used = new Intl.NumberFormat("en-US", {
51
- notation: "compact",
52
- }).format(usedTokens);
53
- const total = new Intl.NumberFormat("en-US", {
54
- notation: "compact",
55
- }).format(maxTokens);
56
- return (_jsx("div", { className: cn("w-full space-y-2 p-3", className), ...props, children: children ?? (_jsxs(_Fragment, { children: [_jsxs("div", { className: "flex items-center justify-between gap-3 text-xs", children: [_jsx("p", { children: displayPct }), _jsxs("p", { className: "font-mono text-muted-foreground", children: [used, " / ", total] })] }), _jsx("div", { className: "space-y-2", children: _jsx(Progress, { className: "bg-muted", value: usedPercent * PERCENT_MAX }) })] })) }));
57
- };
58
- export const ContextContentBody = ({ children, className, ...props }) => (_jsx("div", { className: cn("w-full p-3", className), ...props, children: children }));
59
- export const ContextContentFooter = ({ children, className, ...props }) => {
60
- const { modelId, usage } = useContextValue();
61
- const costUSD = modelId
62
- ? getUsage({
63
- modelId,
64
- usage: {
65
- input: usage?.inputTokens ?? 0,
66
- output: usage?.outputTokens ?? 0,
67
- },
68
- }).costUSD?.totalUSD
69
- : undefined;
70
- const totalCost = new Intl.NumberFormat("en-US", {
71
- currency: "USD",
72
- style: "currency",
73
- }).format(costUSD ?? 0);
74
- return (_jsx("div", { className: cn("flex w-full items-center justify-between gap-3 bg-secondary p-3 text-xs", className), ...props, children: children ?? (_jsxs(_Fragment, { children: [_jsx("span", { className: "text-muted-foreground", children: "Total cost" }), _jsx("span", { children: totalCost })] })) }));
75
- };
76
- const TokensWithCost = ({ tokens, costText, }) => (_jsxs("span", { children: [tokens === undefined
77
- ? "—"
78
- : new Intl.NumberFormat("en-US", {
79
- notation: "compact",
80
- }).format(tokens), costText ? (_jsxs("span", { className: "ml-2 text-muted-foreground", children: ["\u2022 ", costText] })) : null] }));
81
- export const ContextInputUsage = ({ className, children, ...props }) => {
82
- const { usage, modelId } = useContextValue();
83
- const inputTokens = usage?.inputTokens ?? 0;
84
- if (children) {
85
- return children;
86
- }
87
- if (!inputTokens) {
88
- return null;
89
- }
90
- const inputCost = modelId
91
- ? getUsage({
92
- modelId,
93
- usage: { input: inputTokens, output: 0 },
94
- }).costUSD?.totalUSD
95
- : undefined;
96
- const inputCostText = new Intl.NumberFormat("en-US", {
97
- currency: "USD",
98
- style: "currency",
99
- }).format(inputCost ?? 0);
100
- return (_jsxs("div", { className: cn("flex items-center justify-between text-xs", className), ...props, children: [_jsx("span", { className: "text-muted-foreground", children: "Input" }), _jsx(TokensWithCost, { costText: inputCostText, tokens: inputTokens })] }));
101
- };
102
- export const ContextOutputUsage = ({ className, children, ...props }) => {
103
- const { usage, modelId } = useContextValue();
104
- const outputTokens = usage?.outputTokens ?? 0;
105
- if (children) {
106
- return children;
107
- }
108
- if (!outputTokens) {
109
- return null;
110
- }
111
- const outputCost = modelId
112
- ? getUsage({
113
- modelId,
114
- usage: { input: 0, output: outputTokens },
115
- }).costUSD?.totalUSD
116
- : undefined;
117
- const outputCostText = new Intl.NumberFormat("en-US", {
118
- currency: "USD",
119
- style: "currency",
120
- }).format(outputCost ?? 0);
121
- return (_jsxs("div", { className: cn("flex items-center justify-between text-xs", className), ...props, children: [_jsx("span", { className: "text-muted-foreground", children: "Output" }), _jsx(TokensWithCost, { costText: outputCostText, tokens: outputTokens })] }));
122
- };
123
- export const ContextReasoningUsage = ({ className, children, ...props }) => {
124
- const { usage, modelId } = useContextValue();
125
- const reasoningTokens = usage?.reasoningTokens ?? 0;
126
- if (children) {
127
- return children;
128
- }
129
- if (!reasoningTokens) {
130
- return null;
131
- }
132
- const reasoningCost = modelId
133
- ? getUsage({
134
- modelId,
135
- usage: { reasoningTokens },
136
- }).costUSD?.totalUSD
137
- : undefined;
138
- const reasoningCostText = new Intl.NumberFormat("en-US", {
139
- currency: "USD",
140
- style: "currency",
141
- }).format(reasoningCost ?? 0);
142
- return (_jsxs("div", { className: cn("flex items-center justify-between text-xs", className), ...props, children: [_jsx("span", { className: "text-muted-foreground", children: "Reasoning" }), _jsx(TokensWithCost, { costText: reasoningCostText, tokens: reasoningTokens })] }));
143
- };
144
- export const ContextCacheUsage = ({ className, children, ...props }) => {
145
- const { usage, modelId } = useContextValue();
146
- const cacheTokens = usage?.cachedInputTokens ?? 0;
147
- if (children) {
148
- return children;
149
- }
150
- if (!cacheTokens) {
151
- return null;
152
- }
153
- const cacheCost = modelId
154
- ? getUsage({
155
- modelId,
156
- usage: { cacheReads: cacheTokens, input: 0, output: 0 },
157
- }).costUSD?.totalUSD
158
- : undefined;
159
- const cacheCostText = new Intl.NumberFormat("en-US", {
160
- currency: "USD",
161
- style: "currency",
162
- }).format(cacheCost ?? 0);
163
- return (_jsxs("div", { className: cn("flex items-center justify-between text-xs", className), ...props, children: [_jsx("span", { className: "text-muted-foreground", children: "Cache" }), _jsx(TokensWithCost, { costText: cacheCostText, tokens: cacheTokens })] }));
164
- };
@@ -1,5 +0,0 @@
1
- import { Controls as ControlsPrimitive } from "@xyflow/react";
2
- import type { ComponentProps } from "react";
3
- export type ControlsProps = ComponentProps<typeof ControlsPrimitive>;
4
- export declare const Controls: ({ className, ...props }: ControlsProps) => import("react/jsx-runtime").JSX.Element;
5
- //# sourceMappingURL=controls.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"controls.d.ts","sourceRoot":"","sources":["../../src/molecules/controls.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,IAAI,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAC9D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAE5C,MAAM,MAAM,aAAa,GAAG,cAAc,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAErE,eAAO,MAAM,QAAQ,GAAI,yBAAyB,aAAa,4CAS9D,CAAC"}
@@ -1,5 +0,0 @@
1
- "use client";
2
- import { jsx as _jsx } from "react/jsx-runtime";
3
- import { cn } from "@chatsdk-dev/ui/lib/utils";
4
- import { Controls as ControlsPrimitive } from "@xyflow/react";
5
- export const Controls = ({ className, ...props }) => (_jsx(ControlsPrimitive, { className: cn("gap-px overflow-hidden rounded-md border bg-card p-1 shadow-none!", "[&>button]:rounded-md [&>button]:border-none! [&>button]:bg-transparent! [&>button]:hover:bg-secondary!", className), ...props }));
@@ -1,24 +0,0 @@
1
- import { Button } from "@chatsdk-dev/ui/components/button";
2
- import type { UIMessage } from "ai";
3
- import type { ComponentProps } from "react";
4
- import { StickToBottom } from "use-stick-to-bottom";
5
- export type ConversationProps = ComponentProps<typeof StickToBottom>;
6
- export declare const Conversation: ({ className, ...props }: ConversationProps) => import("react/jsx-runtime").JSX.Element;
7
- export type ConversationContentProps = ComponentProps<typeof StickToBottom.Content>;
8
- export declare const ConversationContent: ({ className, ...props }: ConversationContentProps) => import("react/jsx-runtime").JSX.Element;
9
- export type ConversationEmptyStateProps = ComponentProps<"div"> & {
10
- title?: string;
11
- description?: string;
12
- icon?: React.ReactNode;
13
- };
14
- export declare const ConversationEmptyState: ({ className, title, description, icon, children, ...props }: ConversationEmptyStateProps) => import("react/jsx-runtime").JSX.Element;
15
- export type ConversationScrollButtonProps = ComponentProps<typeof Button>;
16
- export declare const ConversationScrollButton: ({ className, ...props }: ConversationScrollButtonProps) => false | import("react/jsx-runtime").JSX.Element;
17
- export type ConversationDownloadProps = Omit<ComponentProps<typeof Button>, "onClick"> & {
18
- messages: UIMessage[];
19
- filename?: string;
20
- formatMessage?: (message: UIMessage, index: number) => string;
21
- };
22
- export declare const messagesToMarkdown: (messages: UIMessage[], formatMessage?: (message: UIMessage, index: number) => string) => string;
23
- export declare const ConversationDownload: ({ messages, filename, formatMessage, className, children, ...props }: ConversationDownloadProps) => import("react/jsx-runtime").JSX.Element;
24
- //# sourceMappingURL=conversation.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"conversation.d.ts","sourceRoot":"","sources":["../../src/molecules/conversation.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,mCAAmC,CAAC;AAE3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAEpC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAE5C,OAAO,EAAE,aAAa,EAA2B,MAAM,qBAAqB,CAAC;AAE7E,MAAM,MAAM,iBAAiB,GAAG,cAAc,CAAC,OAAO,aAAa,CAAC,CAAC;AAErE,eAAO,MAAM,YAAY,GAAI,yBAAyB,iBAAiB,4CAQtE,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG,cAAc,CACnD,OAAO,aAAa,CAAC,OAAO,CAC7B,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAAI,yBAGjC,wBAAwB,4CAK1B,CAAC;AAEF,MAAM,MAAM,2BAA2B,GAAG,cAAc,CAAC,KAAK,CAAC,GAAG;IAChE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CACxB,CAAC;AAEF,eAAO,MAAM,sBAAsB,GAAI,6DAOpC,2BAA2B,4CAoB7B,CAAC;AAEF,MAAM,MAAM,6BAA6B,GAAG,cAAc,CAAC,OAAO,MAAM,CAAC,CAAC;AAE1E,eAAO,MAAM,wBAAwB,GAAI,yBAGtC,6BAA6B,oDAwB/B,CAAC;AAQF,MAAM,MAAM,yBAAyB,GAAG,IAAI,CAC1C,cAAc,CAAC,OAAO,MAAM,CAAC,EAC7B,SAAS,CACV,GAAG;IACF,QAAQ,EAAE,SAAS,EAAE,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;CAC/D,CAAC;AAQF,eAAO,MAAM,kBAAkB,GAC7B,UAAU,SAAS,EAAE,EACrB,gBAAe,CACb,OAAO,EAAE,SAAS,EAClB,KAAK,EAAE,MAAM,KACV,MAA6B,KACjC,MAAsE,CAAC;AAE1E,eAAO,MAAM,oBAAoB,GAAI,sEAOlC,yBAAyB,4CA6B3B,CAAC"}
@@ -1,41 +0,0 @@
1
- "use client";
2
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
- import { Button } from "@chatsdk-dev/ui/components/button";
4
- import { cn } from "@chatsdk-dev/ui/lib/utils";
5
- import { ArrowDownIcon, DownloadIcon } from "lucide-react";
6
- import { useCallback } from "react";
7
- import { StickToBottom, useStickToBottomContext } from "use-stick-to-bottom";
8
- export const Conversation = ({ className, ...props }) => (_jsx(StickToBottom, { className: cn("relative flex-1 overflow-y-hidden", className), initial: "smooth", resize: "smooth", role: "log", ...props }));
9
- export const ConversationContent = ({ className, ...props }) => (_jsx(StickToBottom.Content, { className: cn("flex flex-col gap-8 p-4", className), ...props }));
10
- export const ConversationEmptyState = ({ className, title = "No messages yet", description = "Start a conversation to see messages here", icon, children, ...props }) => (_jsx("div", { className: cn("flex size-full flex-col items-center justify-center gap-3 p-8 text-center", className), ...props, children: children ?? (_jsxs(_Fragment, { children: [icon && _jsx("div", { className: "text-muted-foreground", children: icon }), _jsxs("div", { className: "space-y-1", children: [_jsx("h3", { className: "font-medium text-sm", children: title }), description && (_jsx("p", { className: "text-muted-foreground text-sm", children: description }))] })] })) }));
11
- export const ConversationScrollButton = ({ className, ...props }) => {
12
- const { isAtBottom, scrollToBottom } = useStickToBottomContext();
13
- const handleScrollToBottom = useCallback(() => {
14
- scrollToBottom();
15
- }, [scrollToBottom]);
16
- return (!isAtBottom && (_jsx(Button, { className: cn("absolute bottom-4 left-[50%] translate-x-[-50%] rounded-full dark:bg-background dark:hover:bg-muted", className), onClick: handleScrollToBottom, size: "icon", type: "button", variant: "outline", ...props, children: _jsx(ArrowDownIcon, { className: "size-4" }) })));
17
- };
18
- const getMessageText = (message) => message.parts
19
- .filter((part) => part.type === "text")
20
- .map((part) => part.text)
21
- .join("");
22
- const defaultFormatMessage = (message) => {
23
- const roleLabel = message.role.charAt(0).toUpperCase() + message.role.slice(1);
24
- return `**${roleLabel}:** ${getMessageText(message)}`;
25
- };
26
- export const messagesToMarkdown = (messages, formatMessage = defaultFormatMessage) => messages.map((msg, i) => formatMessage(msg, i)).join("\n\n");
27
- export const ConversationDownload = ({ messages, filename = "conversation.md", formatMessage = defaultFormatMessage, className, children, ...props }) => {
28
- const handleDownload = useCallback(() => {
29
- const markdown = messagesToMarkdown(messages, formatMessage);
30
- const blob = new Blob([markdown], { type: "text/markdown" });
31
- const url = URL.createObjectURL(blob);
32
- const link = document.createElement("a");
33
- link.href = url;
34
- link.download = filename;
35
- document.body.append(link);
36
- link.click();
37
- link.remove();
38
- URL.revokeObjectURL(url);
39
- }, [messages, filename, formatMessage]);
40
- return (_jsx(Button, { className: cn("absolute top-4 right-4 rounded-full dark:bg-background dark:hover:bg-muted", className), onClick: handleDownload, size: "icon", type: "button", variant: "outline", ...props, children: children ?? _jsx(DownloadIcon, { className: "size-4" }) }));
41
- };
@@ -1,6 +0,0 @@
1
- import type { EdgeProps } from "@xyflow/react";
2
- export declare const Edge: {
3
- Animated: ({ id, source, target, markerEnd, style }: EdgeProps) => import("react/jsx-runtime").JSX.Element | null;
4
- Temporary: ({ id, sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition, }: EdgeProps) => import("react/jsx-runtime").JSX.Element;
5
- };
6
- //# sourceMappingURL=edge.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"edge.d.ts","sourceRoot":"","sources":["../../src/molecules/edge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAsB,MAAM,eAAe,CAAC;AA2InE,eAAO,MAAM,IAAI;yDAhC2C,SAAS;6FA1FlE,SAAS;CA6HX,CAAC"}
@@ -1,87 +0,0 @@
1
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { BaseEdge, getBezierPath, getSimpleBezierPath, Position, useInternalNode, } from "@xyflow/react";
3
- const Temporary = ({ id, sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition, }) => {
4
- const [edgePath] = getSimpleBezierPath({
5
- sourcePosition,
6
- sourceX,
7
- sourceY,
8
- targetPosition,
9
- targetX,
10
- targetY,
11
- });
12
- return (_jsx(BaseEdge, { className: "stroke-1 stroke-ring", id: id, path: edgePath, style: {
13
- strokeDasharray: "5, 5",
14
- } }));
15
- };
16
- const getHandleCoordsByPosition = (node, handlePosition) => {
17
- // Choose the handle type based on position - Left is for target, Right is for source
18
- const handleType = handlePosition === Position.Left ? "target" : "source";
19
- const handle = node.internals.handleBounds?.[handleType]?.find((h) => h.position === handlePosition);
20
- if (!handle) {
21
- return [0, 0];
22
- }
23
- let offsetX = handle.width / 2;
24
- let offsetY = handle.height / 2;
25
- // this is a tiny detail to make the markerEnd of an edge visible.
26
- // The handle position that gets calculated has the origin top-left, so depending which side we are using, we add a little offset
27
- // when the handlePosition is Position.Right for example, we need to add an offset as big as the handle itself in order to get the correct position
28
- switch (handlePosition) {
29
- case Position.Left: {
30
- offsetX = 0;
31
- break;
32
- }
33
- case Position.Right: {
34
- offsetX = handle.width;
35
- break;
36
- }
37
- case Position.Top: {
38
- offsetY = 0;
39
- break;
40
- }
41
- case Position.Bottom: {
42
- offsetY = handle.height;
43
- break;
44
- }
45
- default: {
46
- throw new Error(`Invalid handle position: ${handlePosition}`);
47
- }
48
- }
49
- const x = node.internals.positionAbsolute.x + handle.x + offsetX;
50
- const y = node.internals.positionAbsolute.y + handle.y + offsetY;
51
- return [x, y];
52
- };
53
- const getEdgeParams = (source, target) => {
54
- const sourcePos = Position.Right;
55
- const [sx, sy] = getHandleCoordsByPosition(source, sourcePos);
56
- const targetPos = Position.Left;
57
- const [tx, ty] = getHandleCoordsByPosition(target, targetPos);
58
- return {
59
- sourcePos,
60
- sx,
61
- sy,
62
- targetPos,
63
- tx,
64
- ty,
65
- };
66
- };
67
- const Animated = ({ id, source, target, markerEnd, style }) => {
68
- const sourceNode = useInternalNode(source);
69
- const targetNode = useInternalNode(target);
70
- if (!(sourceNode && targetNode)) {
71
- return null;
72
- }
73
- const { sx, sy, tx, ty, sourcePos, targetPos } = getEdgeParams(sourceNode, targetNode);
74
- const [edgePath] = getBezierPath({
75
- sourcePosition: sourcePos,
76
- sourceX: sx,
77
- sourceY: sy,
78
- targetPosition: targetPos,
79
- targetX: tx,
80
- targetY: ty,
81
- });
82
- return (_jsxs(_Fragment, { children: [_jsx(BaseEdge, { id: id, markerEnd: markerEnd, path: edgePath, style: style }), _jsx("circle", { fill: "var(--primary)", r: "4", children: _jsx("animateMotion", { dur: "2s", path: edgePath, repeatCount: "indefinite" }) })] }));
83
- };
84
- export const Edge = {
85
- Animated,
86
- Temporary,
87
- };
@@ -1,39 +0,0 @@
1
- import { Badge } from "@chatsdk-dev/ui/components/badge";
2
- import { Button } from "@chatsdk-dev/ui/components/button";
3
- import { Switch } from "@chatsdk-dev/ui/components/switch";
4
- import type { ComponentProps, HTMLAttributes } from "react";
5
- export type EnvironmentVariablesProps = HTMLAttributes<HTMLDivElement> & {
6
- showValues?: boolean;
7
- defaultShowValues?: boolean;
8
- onShowValuesChange?: (show: boolean) => void;
9
- };
10
- export declare const EnvironmentVariables: ({ showValues: controlledShowValues, defaultShowValues, onShowValuesChange, className, children, ...props }: EnvironmentVariablesProps) => import("react/jsx-runtime").JSX.Element;
11
- export type EnvironmentVariablesHeaderProps = HTMLAttributes<HTMLDivElement>;
12
- export declare const EnvironmentVariablesHeader: ({ className, children, ...props }: EnvironmentVariablesHeaderProps) => import("react/jsx-runtime").JSX.Element;
13
- export type EnvironmentVariablesTitleProps = HTMLAttributes<HTMLHeadingElement>;
14
- export declare const EnvironmentVariablesTitle: ({ className, children, ...props }: EnvironmentVariablesTitleProps) => import("react/jsx-runtime").JSX.Element;
15
- export type EnvironmentVariablesToggleProps = ComponentProps<typeof Switch>;
16
- export declare const EnvironmentVariablesToggle: ({ className, ...props }: EnvironmentVariablesToggleProps) => import("react/jsx-runtime").JSX.Element;
17
- export type EnvironmentVariablesContentProps = HTMLAttributes<HTMLDivElement>;
18
- export declare const EnvironmentVariablesContent: ({ className, children, ...props }: EnvironmentVariablesContentProps) => import("react/jsx-runtime").JSX.Element;
19
- export type EnvironmentVariableGroupProps = HTMLAttributes<HTMLDivElement>;
20
- export declare const EnvironmentVariableGroup: ({ className, children, ...props }: EnvironmentVariableGroupProps) => import("react/jsx-runtime").JSX.Element;
21
- export type EnvironmentVariableNameProps = HTMLAttributes<HTMLSpanElement>;
22
- export declare const EnvironmentVariableName: ({ className, children, ...props }: EnvironmentVariableNameProps) => import("react/jsx-runtime").JSX.Element;
23
- export type EnvironmentVariableValueProps = HTMLAttributes<HTMLSpanElement>;
24
- export declare const EnvironmentVariableValue: ({ className, children, ...props }: EnvironmentVariableValueProps) => import("react/jsx-runtime").JSX.Element;
25
- export type EnvironmentVariableProps = HTMLAttributes<HTMLDivElement> & {
26
- name: string;
27
- value: string;
28
- };
29
- export declare const EnvironmentVariable: ({ name, value, className, children, ...props }: EnvironmentVariableProps) => import("react/jsx-runtime").JSX.Element;
30
- export type EnvironmentVariableCopyButtonProps = ComponentProps<typeof Button> & {
31
- onCopy?: () => void;
32
- onError?: (error: Error) => void;
33
- timeout?: number;
34
- copyFormat?: "name" | "value" | "export";
35
- };
36
- export declare const EnvironmentVariableCopyButton: ({ onCopy, onError, timeout, copyFormat, children, className, ...props }: EnvironmentVariableCopyButtonProps) => import("react/jsx-runtime").JSX.Element;
37
- export type EnvironmentVariableRequiredProps = ComponentProps<typeof Badge>;
38
- export declare const EnvironmentVariableRequired: ({ className, children, ...props }: EnvironmentVariableRequiredProps) => import("react/jsx-runtime").JSX.Element;
39
- //# sourceMappingURL=environment-variables.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"environment-variables.d.ts","sourceRoot":"","sources":["../../src/molecules/environment-variables.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,kCAAkC,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,MAAM,mCAAmC,CAAC;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,mCAAmC,CAAC;AAG3D,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AA0B5D,MAAM,MAAM,yBAAyB,GAAG,cAAc,CAAC,cAAc,CAAC,GAAG;IACvE,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,kBAAkB,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;CAC9C,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAI,4GAOlC,yBAAyB,4CA4B3B,CAAC;AAEF,MAAM,MAAM,+BAA+B,GAAG,cAAc,CAAC,cAAc,CAAC,CAAC;AAE7E,eAAO,MAAM,0BAA0B,GAAI,mCAIxC,+BAA+B,4CAUjC,CAAC;AAEF,MAAM,MAAM,8BAA8B,GAAG,cAAc,CAAC,kBAAkB,CAAC,CAAC;AAEhF,eAAO,MAAM,yBAAyB,GAAI,mCAIvC,8BAA8B,4CAIhC,CAAC;AAEF,MAAM,MAAM,+BAA+B,GAAG,cAAc,CAAC,OAAO,MAAM,CAAC,CAAC;AAE5E,eAAO,MAAM,0BAA0B,GAAI,yBAGxC,+BAA+B,4CAgBjC,CAAC;AAEF,MAAM,MAAM,gCAAgC,GAAG,cAAc,CAAC,cAAc,CAAC,CAAC;AAE9E,eAAO,MAAM,2BAA2B,GAAI,mCAIzC,gCAAgC,4CAIlC,CAAC;AAaF,MAAM,MAAM,6BAA6B,GAAG,cAAc,CAAC,cAAc,CAAC,CAAC;AAE3E,eAAO,MAAM,wBAAwB,GAAI,mCAItC,6BAA6B,4CAI/B,CAAC;AAEF,MAAM,MAAM,4BAA4B,GAAG,cAAc,CAAC,eAAe,CAAC,CAAC;AAE3E,eAAO,MAAM,uBAAuB,GAAI,mCAIrC,4BAA4B,4CAQ9B,CAAC;AAEF,MAAM,MAAM,6BAA6B,GAAG,cAAc,CAAC,eAAe,CAAC,CAAC;AAE5E,eAAO,MAAM,wBAAwB,GAAI,mCAItC,6BAA6B,4CAoB/B,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG,cAAc,CAAC,cAAc,CAAC,GAAG;IACtE,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAAI,gDAMjC,wBAAwB,4CAuB1B,CAAC;AAEF,MAAM,MAAM,kCAAkC,GAAG,cAAc,CAC7D,OAAO,MAAM,CACd,GAAG;IACF,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC;CAC1C,CAAC;AAEF,eAAO,MAAM,6BAA6B,GAAI,yEAQ3C,kCAAkC,4CAkDpC,CAAC;AAEF,MAAM,MAAM,gCAAgC,GAAG,cAAc,CAAC,OAAO,KAAK,CAAC,CAAC;AAE5E,eAAO,MAAM,2BAA2B,GAAI,mCAIzC,gCAAgC,4CAIlC,CAAC"}
@@ -1,87 +0,0 @@
1
- "use client";
2
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
- import { Badge } from "@chatsdk-dev/ui/components/badge";
4
- import { Button } from "@chatsdk-dev/ui/components/button";
5
- import { Switch } from "@chatsdk-dev/ui/components/switch";
6
- import { cn } from "@chatsdk-dev/ui/lib/utils";
7
- import { CheckIcon, CopyIcon, EyeIcon, EyeOffIcon } from "lucide-react";
8
- import { createContext, useCallback, useContext, useEffect, useMemo, useRef, useState, } from "react";
9
- // Default noop for context default value
10
- // oxlint-disable-next-line eslint(no-empty-function)
11
- const noop = () => { };
12
- const EnvironmentVariablesContext = createContext({
13
- setShowValues: noop,
14
- showValues: false,
15
- });
16
- export const EnvironmentVariables = ({ showValues: controlledShowValues, defaultShowValues = false, onShowValuesChange, className, children, ...props }) => {
17
- const [internalShowValues, setInternalShowValues] = useState(defaultShowValues);
18
- const showValues = controlledShowValues ?? internalShowValues;
19
- const setShowValues = useCallback((show) => {
20
- setInternalShowValues(show);
21
- onShowValuesChange?.(show);
22
- }, [onShowValuesChange]);
23
- const contextValue = useMemo(() => ({ setShowValues, showValues }), [setShowValues, showValues]);
24
- return (_jsx(EnvironmentVariablesContext.Provider, { value: contextValue, children: _jsx("div", { className: cn("rounded-lg border bg-background", className), ...props, children: children }) }));
25
- };
26
- export const EnvironmentVariablesHeader = ({ className, children, ...props }) => (_jsx("div", { className: cn("flex items-center justify-between border-b px-4 py-3", className), ...props, children: children }));
27
- export const EnvironmentVariablesTitle = ({ className, children, ...props }) => (_jsx("h3", { className: cn("font-medium text-sm", className), ...props, children: children ?? "Environment Variables" }));
28
- export const EnvironmentVariablesToggle = ({ className, ...props }) => {
29
- const { showValues, setShowValues } = useContext(EnvironmentVariablesContext);
30
- return (_jsxs("div", { className: cn("flex items-center gap-2", className), children: [_jsx("span", { className: "text-muted-foreground text-xs", children: showValues ? _jsx(EyeIcon, { size: 14 }) : _jsx(EyeOffIcon, { size: 14 }) }), _jsx(Switch, { "aria-label": "Toggle value visibility", checked: showValues, onCheckedChange: setShowValues, ...props })] }));
31
- };
32
- export const EnvironmentVariablesContent = ({ className, children, ...props }) => (_jsx("div", { className: cn("divide-y", className), ...props, children: children }));
33
- const EnvironmentVariableContext = createContext({
34
- name: "",
35
- value: "",
36
- });
37
- export const EnvironmentVariableGroup = ({ className, children, ...props }) => (_jsx("div", { className: cn("flex items-center gap-2", className), ...props, children: children }));
38
- export const EnvironmentVariableName = ({ className, children, ...props }) => {
39
- const { name } = useContext(EnvironmentVariableContext);
40
- return (_jsx("span", { className: cn("font-mono text-sm", className), ...props, children: children ?? name }));
41
- };
42
- export const EnvironmentVariableValue = ({ className, children, ...props }) => {
43
- const { value } = useContext(EnvironmentVariableContext);
44
- const { showValues } = useContext(EnvironmentVariablesContext);
45
- const displayValue = showValues
46
- ? value
47
- : "•".repeat(Math.min(value.length, 20));
48
- return (_jsx("span", { className: cn("font-mono text-muted-foreground text-sm", !showValues && "select-none", className), ...props, children: children ?? displayValue }));
49
- };
50
- export const EnvironmentVariable = ({ name, value, className, children, ...props }) => {
51
- const envVarContextValue = useMemo(() => ({ name, value }), [name, value]);
52
- return (_jsx(EnvironmentVariableContext.Provider, { value: envVarContextValue, children: _jsx("div", { className: cn("flex items-center justify-between gap-4 px-4 py-3", className), ...props, children: children ?? (_jsxs(_Fragment, { children: [_jsx("div", { className: "flex items-center gap-2", children: _jsx(EnvironmentVariableName, {}) }), _jsx(EnvironmentVariableValue, {})] })) }) }));
53
- };
54
- export const EnvironmentVariableCopyButton = ({ onCopy, onError, timeout = 2000, copyFormat = "value", children, className, ...props }) => {
55
- const [isCopied, setIsCopied] = useState(false);
56
- const timeoutRef = useRef(0);
57
- const { name, value } = useContext(EnvironmentVariableContext);
58
- const getTextToCopy = useCallback(() => {
59
- const formatMap = {
60
- export: () => `export ${name}="${value}"`,
61
- name: () => name,
62
- value: () => value,
63
- };
64
- return formatMap[copyFormat]();
65
- }, [name, value, copyFormat]);
66
- const copyToClipboard = useCallback(async () => {
67
- if (typeof window === "undefined" || !navigator?.clipboard?.writeText) {
68
- onError?.(new Error("Clipboard API not available"));
69
- return;
70
- }
71
- try {
72
- await navigator.clipboard.writeText(getTextToCopy());
73
- setIsCopied(true);
74
- onCopy?.();
75
- timeoutRef.current = window.setTimeout(() => setIsCopied(false), timeout);
76
- }
77
- catch (error) {
78
- onError?.(error);
79
- }
80
- }, [getTextToCopy, onCopy, onError, timeout]);
81
- useEffect(() => () => {
82
- window.clearTimeout(timeoutRef.current);
83
- }, []);
84
- const Icon = isCopied ? CheckIcon : CopyIcon;
85
- return (_jsx(Button, { className: cn("size-6 shrink-0", className), onClick: copyToClipboard, size: "icon", variant: "ghost", ...props, children: children ?? _jsx(Icon, { size: 12 }) }));
86
- };
87
- export const EnvironmentVariableRequired = ({ className, children, ...props }) => (_jsx(Badge, { className: cn("text-xs", className), variant: "secondary", ...props, children: children ?? "Required" }));
@@ -1,27 +0,0 @@
1
- import type { HTMLAttributes, ReactNode } from "react";
2
- export type FileTreeProps = Omit<HTMLAttributes<HTMLDivElement>, "onSelect"> & {
3
- expanded?: Set<string>;
4
- defaultExpanded?: Set<string>;
5
- selectedPath?: string;
6
- onSelect?: (path: string) => void;
7
- onExpandedChange?: (expanded: Set<string>) => void;
8
- };
9
- export declare const FileTree: ({ expanded: controlledExpanded, defaultExpanded, selectedPath, onSelect, onExpandedChange, className, children, ...props }: FileTreeProps) => import("react/jsx-runtime").JSX.Element;
10
- export type FileTreeIconProps = HTMLAttributes<HTMLSpanElement>;
11
- export declare const FileTreeIcon: ({ className, children, ...props }: FileTreeIconProps) => import("react/jsx-runtime").JSX.Element;
12
- export type FileTreeNameProps = HTMLAttributes<HTMLSpanElement>;
13
- export declare const FileTreeName: ({ className, children, ...props }: FileTreeNameProps) => import("react/jsx-runtime").JSX.Element;
14
- export type FileTreeFolderProps = HTMLAttributes<HTMLDivElement> & {
15
- path: string;
16
- name: string;
17
- };
18
- export declare const FileTreeFolder: ({ path, name, className, children, ...props }: FileTreeFolderProps) => import("react/jsx-runtime").JSX.Element;
19
- export type FileTreeFileProps = HTMLAttributes<HTMLDivElement> & {
20
- path: string;
21
- name: string;
22
- icon?: ReactNode;
23
- };
24
- export declare const FileTreeFile: ({ path, name, icon, className, children, ...props }: FileTreeFileProps) => import("react/jsx-runtime").JSX.Element;
25
- export type FileTreeActionsProps = HTMLAttributes<HTMLDivElement>;
26
- export declare const FileTreeActions: ({ className, children, ...props }: FileTreeActionsProps) => import("react/jsx-runtime").JSX.Element;
27
- //# sourceMappingURL=file-tree.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"file-tree.d.ts","sourceRoot":"","sources":["../../src/molecules/file-tree.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AA0BvD,MAAM,MAAM,aAAa,GAAG,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC,GAAG;IAC7E,QAAQ,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACvB,eAAe,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC9B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,gBAAgB,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAG,CAAC,MAAM,CAAC,KAAK,IAAI,CAAC;CACpD,CAAC;AAEF,eAAO,MAAM,QAAQ,GAAI,4HAStB,aAAa,4CAqCf,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,cAAc,CAAC,eAAe,CAAC,CAAC;AAEhE,eAAO,MAAM,YAAY,GAAI,mCAI1B,iBAAiB,4CAInB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,cAAc,CAAC,eAAe,CAAC,CAAC;AAEhE,eAAO,MAAM,YAAY,GAAI,mCAI1B,iBAAiB,4CAInB,CAAC;AAcF,MAAM,MAAM,mBAAmB,GAAG,cAAc,CAAC,cAAc,CAAC,GAAG;IACjE,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,+CAM5B,mBAAmB,4CAuErB,CAAC;AAYF,MAAM,MAAM,iBAAiB,GAAG,cAAc,CAAC,cAAc,CAAC,GAAG;IAC/D,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,SAAS,CAAC;CAClB,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,qDAO1B,iBAAiB,4CA8CnB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,cAAc,CAAC,cAAc,CAAC,CAAC;AAIlE,eAAO,MAAM,eAAe,GAAI,mCAI7B,oBAAoB,4CAUtB,CAAC"}
@@ -1,71 +0,0 @@
1
- "use client";
2
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
- import { Collapsible, CollapsibleContent, CollapsibleTrigger, } from "@chatsdk-dev/ui/components/collapsible";
4
- import { cn } from "@chatsdk-dev/ui/lib/utils";
5
- import { ChevronRightIcon, FileIcon, FolderIcon, FolderOpenIcon, } from "lucide-react";
6
- import { createContext, useCallback, useContext, useMemo, useState, } from "react";
7
- // Default noop for context default value
8
- // oxlint-disable-next-line eslint(no-empty-function)
9
- const noop = () => { };
10
- const FileTreeContext = createContext({
11
- // oxlint-disable-next-line eslint-plugin-unicorn(no-new-builtin)
12
- expandedPaths: new Set(),
13
- togglePath: noop,
14
- });
15
- export const FileTree = ({ expanded: controlledExpanded, defaultExpanded = new Set(), selectedPath, onSelect, onExpandedChange, className, children, ...props }) => {
16
- const [internalExpanded, setInternalExpanded] = useState(defaultExpanded);
17
- const expandedPaths = controlledExpanded ?? internalExpanded;
18
- const togglePath = useCallback((path) => {
19
- const newExpanded = new Set(expandedPaths);
20
- if (newExpanded.has(path)) {
21
- newExpanded.delete(path);
22
- }
23
- else {
24
- newExpanded.add(path);
25
- }
26
- setInternalExpanded(newExpanded);
27
- onExpandedChange?.(newExpanded);
28
- }, [expandedPaths, onExpandedChange]);
29
- const contextValue = useMemo(() => ({ expandedPaths, onSelect, selectedPath, togglePath }), [expandedPaths, onSelect, selectedPath, togglePath]);
30
- return (_jsx(FileTreeContext.Provider, { value: contextValue, children: _jsx("div", { className: cn("rounded-lg border bg-background font-mono text-sm", className), role: "tree", ...props, children: _jsx("div", { className: "p-2", children: children }) }) }));
31
- };
32
- export const FileTreeIcon = ({ className, children, ...props }) => (_jsx("span", { className: cn("shrink-0", className), ...props, children: children }));
33
- export const FileTreeName = ({ className, children, ...props }) => (_jsx("span", { className: cn("truncate", className), ...props, children: children }));
34
- const FileTreeFolderContext = createContext({
35
- isExpanded: false,
36
- name: "",
37
- path: "",
38
- });
39
- export const FileTreeFolder = ({ path, name, className, children, ...props }) => {
40
- const { expandedPaths, togglePath, selectedPath, onSelect } = useContext(FileTreeContext);
41
- const isExpanded = expandedPaths.has(path);
42
- const isSelected = selectedPath === path;
43
- const handleOpenChange = useCallback(() => {
44
- togglePath(path);
45
- }, [togglePath, path]);
46
- const handleSelect = useCallback(() => {
47
- onSelect?.(path);
48
- }, [onSelect, path]);
49
- const folderContextValue = useMemo(() => ({ isExpanded, name, path }), [isExpanded, name, path]);
50
- return (_jsx(FileTreeFolderContext.Provider, { value: folderContextValue, children: _jsx(Collapsible, { onOpenChange: handleOpenChange, open: isExpanded, children: _jsxs("div", { className: cn("", className), role: "treeitem", tabIndex: 0, ...props, children: [_jsxs("div", { className: cn("flex w-full items-center gap-1 rounded px-2 py-1 text-left transition-colors hover:bg-muted/50", isSelected && "bg-muted"), children: [_jsx(CollapsibleTrigger, { render: () => (_jsx("button", { className: "flex shrink-0 cursor-pointer items-center border-none bg-transparent p-0", type: "button", children: _jsx(ChevronRightIcon, { className: cn("size-4 shrink-0 text-muted-foreground transition-transform", isExpanded && "rotate-90") }) })) }), _jsxs("button", { className: "flex min-w-0 flex-1 cursor-pointer items-center gap-1 border-none bg-transparent p-0 text-left", onClick: handleSelect, type: "button", children: [_jsx(FileTreeIcon, { children: isExpanded ? (_jsx(FolderOpenIcon, { className: "size-4 text-blue-500" })) : (_jsx(FolderIcon, { className: "size-4 text-blue-500" })) }), _jsx(FileTreeName, { children: name })] })] }), _jsx(CollapsibleContent, { children: _jsx("div", { className: "ml-4 border-l pl-2", children: children }) })] }) }) }));
51
- };
52
- const FileTreeFileContext = createContext({
53
- name: "",
54
- path: "",
55
- });
56
- export const FileTreeFile = ({ path, name, icon, className, children, ...props }) => {
57
- const { selectedPath, onSelect } = useContext(FileTreeContext);
58
- const isSelected = selectedPath === path;
59
- const handleClick = useCallback(() => {
60
- onSelect?.(path);
61
- }, [onSelect, path]);
62
- const handleKeyDown = useCallback((e) => {
63
- if (e.key === "Enter" || e.key === " ") {
64
- onSelect?.(path);
65
- }
66
- }, [onSelect, path]);
67
- const fileContextValue = useMemo(() => ({ name, path }), [name, path]);
68
- return (_jsx(FileTreeFileContext.Provider, { value: fileContextValue, children: _jsx("div", { className: cn("flex cursor-pointer items-center gap-1 rounded px-2 py-1 transition-colors hover:bg-muted/50", isSelected && "bg-muted", className), onClick: handleClick, onKeyDown: handleKeyDown, role: "treeitem", tabIndex: 0, ...props, children: children ?? (_jsxs(_Fragment, { children: [_jsx("span", { className: "size-4 shrink-0" }), _jsx(FileTreeIcon, { children: icon ?? _jsx(FileIcon, { className: "size-4 text-muted-foreground" }) }), _jsx(FileTreeName, { children: name })] })) }) }));
69
- };
70
- const stopPropagation = (e) => e.stopPropagation();
71
- export const FileTreeActions = ({ className, children, ...props }) => (_jsx("div", { className: cn("ml-auto flex items-center gap-1", className), onClick: stopPropagation, onKeyDown: stopPropagation, role: "group", ...props, children: children }));
@@ -1,7 +0,0 @@
1
- import type { Experimental_GeneratedImage } from "ai";
2
- export type ImageProps = Experimental_GeneratedImage & {
3
- className?: string;
4
- alt?: string;
5
- };
6
- export declare const Image: ({ base64, uint8Array: _uint8Array, mediaType, ...props }: ImageProps) => import("react/jsx-runtime").JSX.Element;
7
- //# sourceMappingURL=image.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../../src/molecules/image.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,IAAI,CAAC;AAEtD,MAAM,MAAM,UAAU,GAAG,2BAA2B,GAAG;IACrD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,eAAO,MAAM,KAAK,GAAI,0DAKnB,UAAU,4CAUZ,CAAC"}
@@ -1,3 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { cn } from "@chatsdk-dev/ui/lib/utils";
3
- export const Image = ({ base64, uint8Array: _uint8Array, mediaType, ...props }) => (_jsx("img", { ...props, alt: props.alt, className: cn("h-auto max-w-full overflow-hidden rounded-md", props.className), src: `data:${mediaType};base64,${base64}` }));