@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,216 +0,0 @@
1
- "use client";
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { Button } from "@chatsdk-dev/ui/components/button";
4
- import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from "@chatsdk-dev/ui/components/select";
5
- import { cn } from "@chatsdk-dev/ui/lib/utils";
6
- import { CheckIcon, CopyIcon } from "lucide-react";
7
- import { createContext, memo, useCallback, useContext, useEffect, useMemo, useRef, useState, } from "react";
8
- import { createHighlighter } from "shiki";
9
- // Shiki uses bitflags for font styles: 1=italic, 2=bold, 4=underline
10
- // oxlint-disable-next-line eslint(no-bitwise)
11
- const isItalic = (fontStyle) => fontStyle && fontStyle & 1;
12
- // oxlint-disable-next-line eslint(no-bitwise)
13
- const isBold = (fontStyle) => fontStyle && fontStyle & 2;
14
- const isUnderline = (fontStyle) =>
15
- // oxlint-disable-next-line eslint(no-bitwise)
16
- fontStyle && fontStyle & 4;
17
- const addKeysToTokens = (lines) => lines.map((line, lineIdx) => ({
18
- key: `line-${lineIdx}`,
19
- tokens: line.map((token, tokenIdx) => ({
20
- key: `line-${lineIdx}-${tokenIdx}`,
21
- token,
22
- })),
23
- }));
24
- // Token rendering component
25
- const TokenSpan = ({ token }) => (_jsx("span", { className: "dark:!bg-[var(--shiki-dark-bg)] dark:!text-[var(--shiki-dark)]", style: {
26
- backgroundColor: token.bgColor,
27
- color: token.color,
28
- fontStyle: isItalic(token.fontStyle) ? "italic" : undefined,
29
- fontWeight: isBold(token.fontStyle) ? "bold" : undefined,
30
- textDecoration: isUnderline(token.fontStyle) ? "underline" : undefined,
31
- ...token.htmlStyle,
32
- }, children: token.content }));
33
- // Line number styles using CSS counters
34
- const LINE_NUMBER_CLASSES = cn("block", "before:content-[counter(line)]", "before:inline-block", "before:[counter-increment:line]", "before:w-8", "before:mr-4", "before:text-right", "before:text-muted-foreground/50", "before:font-mono", "before:select-none");
35
- // Line rendering component
36
- const LineSpan = ({ keyedLine, showLineNumbers, }) => (_jsx("span", { className: showLineNumbers ? LINE_NUMBER_CLASSES : "block", children: keyedLine.tokens.length === 0
37
- ? "\n"
38
- : keyedLine.tokens.map(({ token, key }) => (_jsx(TokenSpan, { token: token }, key))) }));
39
- // Context
40
- const CodeBlockContext = createContext({
41
- code: "",
42
- });
43
- // Highlighter cache (singleton per language)
44
- const highlighterCache = new Map();
45
- // Token cache
46
- const tokensCache = new Map();
47
- // Subscribers for async token updates
48
- const subscribers = new Map();
49
- const getTokensCacheKey = (code, language) => {
50
- const start = code.slice(0, 100);
51
- const end = code.length > 100 ? code.slice(-100) : "";
52
- return `${language}:${code.length}:${start}:${end}`;
53
- };
54
- const getHighlighter = (language) => {
55
- const cached = highlighterCache.get(language);
56
- if (cached) {
57
- return cached;
58
- }
59
- const highlighterPromise = createHighlighter({
60
- langs: [language],
61
- themes: ["github-light", "github-dark"],
62
- });
63
- highlighterCache.set(language, highlighterPromise);
64
- return highlighterPromise;
65
- };
66
- // Create raw tokens for immediate display while highlighting loads
67
- const createRawTokens = (code) => ({
68
- bg: "transparent",
69
- fg: "inherit",
70
- tokens: code.split("\n").map((line) => line === ""
71
- ? []
72
- : [
73
- {
74
- color: "inherit",
75
- content: line,
76
- },
77
- ]),
78
- });
79
- // Synchronous highlight with callback for async results
80
- export const highlightCode = (code, language,
81
- // oxlint-disable-next-line eslint-plugin-promise(prefer-await-to-callbacks)
82
- callback) => {
83
- const tokensCacheKey = getTokensCacheKey(code, language);
84
- // Return cached result if available
85
- const cached = tokensCache.get(tokensCacheKey);
86
- if (cached) {
87
- return cached;
88
- }
89
- // Subscribe callback if provided
90
- if (callback) {
91
- if (!subscribers.has(tokensCacheKey)) {
92
- subscribers.set(tokensCacheKey, new Set());
93
- }
94
- subscribers.get(tokensCacheKey)?.add(callback);
95
- }
96
- // Start highlighting in background - fire-and-forget async pattern
97
- getHighlighter(language)
98
- // oxlint-disable-next-line eslint-plugin-promise(prefer-await-to-then)
99
- .then((highlighter) => {
100
- const availableLangs = highlighter.getLoadedLanguages();
101
- const langToUse = availableLangs.includes(language) ? language : "text";
102
- const result = highlighter.codeToTokens(code, {
103
- lang: langToUse,
104
- themes: {
105
- dark: "github-dark",
106
- light: "github-light",
107
- },
108
- });
109
- const tokenized = {
110
- bg: result.bg ?? "transparent",
111
- fg: result.fg ?? "inherit",
112
- tokens: result.tokens,
113
- };
114
- // Cache the result
115
- tokensCache.set(tokensCacheKey, tokenized);
116
- // Notify all subscribers
117
- const subs = subscribers.get(tokensCacheKey);
118
- if (subs) {
119
- for (const sub of subs) {
120
- sub(tokenized);
121
- }
122
- subscribers.delete(tokensCacheKey);
123
- }
124
- })
125
- // oxlint-disable-next-line eslint-plugin-promise(prefer-await-to-then), eslint-plugin-promise(prefer-await-to-callbacks)
126
- .catch((error) => {
127
- console.error("Failed to highlight code:", error);
128
- subscribers.delete(tokensCacheKey);
129
- });
130
- return null;
131
- };
132
- const CodeBlockBody = memo(({ tokenized, showLineNumbers, className, }) => {
133
- const preStyle = useMemo(() => ({
134
- backgroundColor: tokenized.bg,
135
- color: tokenized.fg,
136
- }), [tokenized.bg, tokenized.fg]);
137
- const keyedLines = useMemo(() => addKeysToTokens(tokenized.tokens), [tokenized.tokens]);
138
- return (_jsx("pre", { className: cn("dark:!bg-[var(--shiki-dark-bg)] dark:!text-[var(--shiki-dark)] m-0 p-4 text-sm", className), style: preStyle, children: _jsx("code", { className: cn("font-mono text-sm", showLineNumbers &&
139
- "[counter-increment:line_0] [counter-reset:line]"), children: keyedLines.map((keyedLine) => (_jsx(LineSpan, { keyedLine: keyedLine, showLineNumbers: showLineNumbers }, keyedLine.key))) }) }));
140
- }, (prevProps, nextProps) => prevProps.tokenized === nextProps.tokenized &&
141
- prevProps.showLineNumbers === nextProps.showLineNumbers &&
142
- prevProps.className === nextProps.className);
143
- CodeBlockBody.displayName = "CodeBlockBody";
144
- export const CodeBlockContainer = ({ className, language, style, ...props }) => (_jsx("div", { className: cn("group relative w-full overflow-hidden rounded-md border bg-background text-foreground", className), "data-language": language, style: {
145
- containIntrinsicSize: "auto 200px",
146
- contentVisibility: "auto",
147
- ...style,
148
- }, ...props }));
149
- export const CodeBlockHeader = ({ children, className, ...props }) => (_jsx("div", { className: cn("flex items-center justify-between border-b bg-muted/80 px-3 py-2 text-muted-foreground text-xs", className), ...props, children: children }));
150
- export const CodeBlockTitle = ({ children, className, ...props }) => (_jsx("div", { className: cn("flex items-center gap-2", className), ...props, children: children }));
151
- export const CodeBlockFilename = ({ children, className, ...props }) => (_jsx("span", { className: cn("font-mono", className), ...props, children: children }));
152
- export const CodeBlockActions = ({ children, className, ...props }) => (_jsx("div", { className: cn("-my-1 -mr-1 flex items-center gap-2", className), ...props, children: children }));
153
- export const CodeBlockContent = ({ code, language, showLineNumbers = false, }) => {
154
- // Memoized raw tokens for immediate display
155
- const rawTokens = useMemo(() => createRawTokens(code), [code]);
156
- // Synchronous cache lookup — avoids setState in effect for cached results
157
- const syncTokens = useMemo(() => highlightCode(code, language) ?? rawTokens, [code, language, rawTokens]);
158
- // Async highlighting result (populated after shiki loads)
159
- const [asyncTokens, setAsyncTokens] = useState(null);
160
- const asyncKeyRef = useRef({ code, language });
161
- // Invalidate stale async tokens synchronously during render
162
- if (asyncKeyRef.current.code !== code ||
163
- asyncKeyRef.current.language !== language) {
164
- asyncKeyRef.current = { code, language };
165
- setAsyncTokens(null);
166
- }
167
- useEffect(() => {
168
- let cancelled = false;
169
- highlightCode(code, language, (result) => {
170
- if (!cancelled) {
171
- setAsyncTokens(result);
172
- }
173
- });
174
- return () => {
175
- cancelled = true;
176
- };
177
- }, [code, language]);
178
- const tokenized = asyncTokens ?? syncTokens;
179
- return (_jsx("div", { className: "relative overflow-auto", children: _jsx(CodeBlockBody, { showLineNumbers: showLineNumbers, tokenized: tokenized }) }));
180
- };
181
- export const CodeBlock = ({ code, language, showLineNumbers = false, className, children, ...props }) => {
182
- const contextValue = useMemo(() => ({ code }), [code]);
183
- return (_jsx(CodeBlockContext.Provider, { value: contextValue, children: _jsxs(CodeBlockContainer, { className: className, language: language, ...props, children: [children, _jsx(CodeBlockContent, { code: code, language: language, showLineNumbers: showLineNumbers })] }) }));
184
- };
185
- export const CodeBlockCopyButton = ({ onCopy, onError, timeout = 2000, children, className, ...props }) => {
186
- const [isCopied, setIsCopied] = useState(false);
187
- const timeoutRef = useRef(0);
188
- const { code } = useContext(CodeBlockContext);
189
- const copyToClipboard = useCallback(async () => {
190
- if (typeof window === "undefined" || !navigator?.clipboard?.writeText) {
191
- onError?.(new Error("Clipboard API not available"));
192
- return;
193
- }
194
- try {
195
- if (!isCopied) {
196
- await navigator.clipboard.writeText(code);
197
- setIsCopied(true);
198
- onCopy?.();
199
- timeoutRef.current = window.setTimeout(() => setIsCopied(false), timeout);
200
- }
201
- }
202
- catch (error) {
203
- onError?.(error);
204
- }
205
- }, [code, onCopy, onError, timeout, isCopied]);
206
- useEffect(() => () => {
207
- window.clearTimeout(timeoutRef.current);
208
- }, []);
209
- const Icon = isCopied ? CheckIcon : CopyIcon;
210
- return (_jsx(Button, { className: cn("shrink-0", className), onClick: copyToClipboard, size: "icon", variant: "ghost", ...props, children: children ?? _jsx(Icon, { size: 14 }) }));
211
- };
212
- export const CodeBlockLanguageSelector = (props) => _jsx(Select, { ...props });
213
- export const CodeBlockLanguageSelectorTrigger = ({ className, ...props }) => (_jsx(SelectTrigger, { className: cn("h-7 border-none bg-transparent px-2 text-xs shadow-none", className), size: "sm", ...props }));
214
- export const CodeBlockLanguageSelectorValue = (props) => _jsx(SelectValue, { ...props });
215
- export const CodeBlockLanguageSelectorContent = ({ align = "end", ...props }) => (_jsx(SelectContent, { align: align, ...props }));
216
- export const CodeBlockLanguageSelectorItem = (props) => _jsx(SelectItem, { ...props });
@@ -1,65 +0,0 @@
1
- import { Avatar } from "@chatsdk-dev/ui/components/avatar";
2
- import { Button } from "@chatsdk-dev/ui/components/button";
3
- import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "@chatsdk-dev/ui/components/collapsible";
4
- import { FileIcon } from "lucide-react";
5
- import type { ComponentProps, HTMLAttributes } from "react";
6
- export type CommitProps = ComponentProps<typeof Collapsible>;
7
- export declare const Commit: ({ className, children, ...props }: CommitProps) => import("react/jsx-runtime").JSX.Element;
8
- export type CommitHeaderProps = ComponentProps<typeof CollapsibleTrigger>;
9
- export declare const CommitHeader: ({ className, children, ...props }: CommitHeaderProps) => import("react/jsx-runtime").JSX.Element;
10
- export type CommitHashProps = HTMLAttributes<HTMLSpanElement>;
11
- export declare const CommitHash: ({ className, children, ...props }: CommitHashProps) => import("react/jsx-runtime").JSX.Element;
12
- export type CommitMessageProps = HTMLAttributes<HTMLSpanElement>;
13
- export declare const CommitMessage: ({ className, children, ...props }: CommitMessageProps) => import("react/jsx-runtime").JSX.Element;
14
- export type CommitMetadataProps = HTMLAttributes<HTMLDivElement>;
15
- export declare const CommitMetadata: ({ className, children, ...props }: CommitMetadataProps) => import("react/jsx-runtime").JSX.Element;
16
- export type CommitSeparatorProps = HTMLAttributes<HTMLSpanElement>;
17
- export declare const CommitSeparator: ({ className, children, ...props }: CommitSeparatorProps) => import("react/jsx-runtime").JSX.Element;
18
- export type CommitInfoProps = HTMLAttributes<HTMLDivElement>;
19
- export declare const CommitInfo: ({ className, children, ...props }: CommitInfoProps) => import("react/jsx-runtime").JSX.Element;
20
- export type CommitAuthorProps = HTMLAttributes<HTMLDivElement>;
21
- export declare const CommitAuthor: ({ className, children, ...props }: CommitAuthorProps) => import("react/jsx-runtime").JSX.Element;
22
- export type CommitAuthorAvatarProps = ComponentProps<typeof Avatar> & {
23
- initials: string;
24
- };
25
- export declare const CommitAuthorAvatar: ({ initials, className, ...props }: CommitAuthorAvatarProps) => import("react/jsx-runtime").JSX.Element;
26
- export type CommitTimestampProps = HTMLAttributes<HTMLTimeElement> & {
27
- date: Date;
28
- };
29
- export declare const CommitTimestamp: ({ date, className, children, ...props }: CommitTimestampProps) => import("react/jsx-runtime").JSX.Element;
30
- export type CommitActionsProps = HTMLAttributes<HTMLDivElement>;
31
- export declare const CommitActions: ({ className, children, ...props }: CommitActionsProps) => import("react/jsx-runtime").JSX.Element;
32
- export type CommitCopyButtonProps = ComponentProps<typeof Button> & {
33
- hash: string;
34
- onCopy?: () => void;
35
- onError?: (error: Error) => void;
36
- timeout?: number;
37
- };
38
- export declare const CommitCopyButton: ({ hash, onCopy, onError, timeout, children, className, ...props }: CommitCopyButtonProps) => import("react/jsx-runtime").JSX.Element;
39
- export type CommitContentProps = ComponentProps<typeof CollapsibleContent>;
40
- export declare const CommitContent: ({ className, children, ...props }: CommitContentProps) => import("react/jsx-runtime").JSX.Element;
41
- export type CommitFilesProps = HTMLAttributes<HTMLDivElement>;
42
- export declare const CommitFiles: ({ className, children, ...props }: CommitFilesProps) => import("react/jsx-runtime").JSX.Element;
43
- export type CommitFileProps = HTMLAttributes<HTMLDivElement>;
44
- export declare const CommitFile: ({ className, children, ...props }: CommitFileProps) => import("react/jsx-runtime").JSX.Element;
45
- export type CommitFileInfoProps = HTMLAttributes<HTMLDivElement>;
46
- export declare const CommitFileInfo: ({ className, children, ...props }: CommitFileInfoProps) => import("react/jsx-runtime").JSX.Element;
47
- export type CommitFileStatusProps = HTMLAttributes<HTMLSpanElement> & {
48
- status: "added" | "modified" | "deleted" | "renamed";
49
- };
50
- export declare const CommitFileStatus: ({ status, className, children, ...props }: CommitFileStatusProps) => import("react/jsx-runtime").JSX.Element;
51
- export type CommitFileIconProps = ComponentProps<typeof FileIcon>;
52
- export declare const CommitFileIcon: ({ className, ...props }: CommitFileIconProps) => import("react/jsx-runtime").JSX.Element;
53
- export type CommitFilePathProps = HTMLAttributes<HTMLSpanElement>;
54
- export declare const CommitFilePath: ({ className, children, ...props }: CommitFilePathProps) => import("react/jsx-runtime").JSX.Element;
55
- export type CommitFileChangesProps = HTMLAttributes<HTMLDivElement>;
56
- export declare const CommitFileChanges: ({ className, children, ...props }: CommitFileChangesProps) => import("react/jsx-runtime").JSX.Element;
57
- export type CommitFileAdditionsProps = HTMLAttributes<HTMLSpanElement> & {
58
- count: number;
59
- };
60
- export declare const CommitFileAdditions: ({ count, className, children, ...props }: CommitFileAdditionsProps) => import("react/jsx-runtime").JSX.Element | null;
61
- export type CommitFileDeletionsProps = HTMLAttributes<HTMLSpanElement> & {
62
- count: number;
63
- };
64
- export declare const CommitFileDeletions: ({ count, className, children, ...props }: CommitFileDeletionsProps) => import("react/jsx-runtime").JSX.Element | null;
65
- //# sourceMappingURL=commit.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"commit.d.ts","sourceRoot":"","sources":["../../src/molecules/commit.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAkB,MAAM,mCAAmC,CAAC;AAC3E,OAAO,EAAE,MAAM,EAAE,MAAM,mCAAmC,CAAC;AAC3D,OAAO,EACL,WAAW,EACX,kBAAkB,EAClB,kBAAkB,EACnB,MAAM,wCAAwC,CAAC;AAEhD,OAAO,EAGL,QAAQ,EAIT,MAAM,cAAc,CAAC;AACtB,OAAO,KA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S,CAAC;CACtD,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,2CAK9B,qBAAqB,4CAWvB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,cAAc,CAAC,OAAO,QAAQ,CAAC,CAAC;AAElE,eAAO,MAAM,cAAc,GAAI,yBAG5B,mBAAmB,4CAKrB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,cAAc,CAAC,eAAe,CAAC,CAAC;AAElE,eAAO,MAAM,cAAc,GAAI,mCAI5B,mBAAmB,4CAIrB,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG,cAAc,CAAC,cAAc,CAAC,CAAC;AAEpE,eAAO,MAAM,iBAAiB,GAAI,mCAI/B,sBAAsB,4CAUxB,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG,cAAc,CAAC,eAAe,CAAC,GAAG;IACvE,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAAI,0CAKjC,wBAAwB,mDAkB1B,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG,cAAc,CAAC,eAAe,CAAC,GAAG;IACvE,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAAI,0CAKjC,wBAAwB,mDAkB1B,CAAC"}
@@ -1,95 +0,0 @@
1
- "use client";
2
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
- import { Avatar, AvatarFallback } from "@chatsdk-dev/ui/components/avatar";
4
- import { Button } from "@chatsdk-dev/ui/components/button";
5
- import { Collapsible, CollapsibleContent, CollapsibleTrigger, } from "@chatsdk-dev/ui/components/collapsible";
6
- import { cn } from "@chatsdk-dev/ui/lib/utils";
7
- import { CheckIcon, CopyIcon, FileIcon, GitCommitIcon, MinusIcon, PlusIcon, } from "lucide-react";
8
- import { useCallback, useEffect, useRef, useState } from "react";
9
- export const Commit = ({ className, children, ...props }) => (_jsx(Collapsible, { className: cn("rounded-lg border bg-background", className), ...props, children: children }));
10
- export const CommitHeader = ({ className, children, ...props }) => (_jsx(CollapsibleTrigger, { render: () => (_jsx("div", { className: cn("group flex cursor-pointer items-center justify-between gap-4 p-3 text-left transition-colors hover:opacity-80", className), children: children })) }));
11
- export const CommitHash = ({ className, children, ...props }) => (_jsxs("span", { className: cn("font-mono text-xs", className), ...props, children: [_jsx(GitCommitIcon, { className: "mr-1 inline-block size-3" }), children] }));
12
- export const CommitMessage = ({ className, children, ...props }) => (_jsx("span", { className: cn("font-medium text-sm", className), ...props, children: children }));
13
- export const CommitMetadata = ({ className, children, ...props }) => (_jsx("div", { className: cn("flex items-center gap-2 text-muted-foreground text-xs", className), ...props, children: children }));
14
- export const CommitSeparator = ({ className, children, ...props }) => (_jsx("span", { className: className, ...props, children: children ?? "•" }));
15
- export const CommitInfo = ({ className, children, ...props }) => (_jsx("div", { className: cn("flex flex-1 flex-col", className), ...props, children: children }));
16
- export const CommitAuthor = ({ className, children, ...props }) => (_jsx("div", { className: cn("flex items-center", className), ...props, children: children }));
17
- export const CommitAuthorAvatar = ({ initials, className, ...props }) => (_jsx(Avatar, { className: cn("size-8", className), ...props, children: _jsx(AvatarFallback, { className: "text-xs", children: initials }) }));
18
- const relativeTimeFormat = new Intl.RelativeTimeFormat("en", {
19
- numeric: "auto",
20
- });
21
- const formatRelativeDate = (date) => {
22
- const days = Math.round((date.getTime() - Date.now()) / (1000 * 60 * 60 * 24));
23
- return relativeTimeFormat.format(days, "day");
24
- };
25
- export const CommitTimestamp = ({ date, className, children, ...props }) => {
26
- const [formatted, setFormatted] = useState("");
27
- const updateFormatted = useCallback(() => {
28
- setFormatted(formatRelativeDate(date));
29
- }, [date]);
30
- useEffect(() => {
31
- updateFormatted();
32
- }, [updateFormatted]);
33
- return (_jsx("time", { className: cn("text-xs", className), dateTime: date.toISOString(), ...props, children: children ?? formatted }));
34
- };
35
- const handleActionsClick = (e) => e.stopPropagation();
36
- const handleActionsKeyDown = (e) => e.stopPropagation();
37
- export const CommitActions = ({ className, children, ...props }) => (_jsx("div", { className: cn("flex items-center gap-1", className), onClick: handleActionsClick, onKeyDown: handleActionsKeyDown, role: "group", ...props, children: children }));
38
- export const CommitCopyButton = ({ hash, onCopy, onError, timeout = 2000, children, className, ...props }) => {
39
- const [isCopied, setIsCopied] = useState(false);
40
- const timeoutRef = useRef(0);
41
- const copyToClipboard = useCallback(async () => {
42
- if (typeof window === "undefined" || !navigator?.clipboard?.writeText) {
43
- onError?.(new Error("Clipboard API not available"));
44
- return;
45
- }
46
- try {
47
- if (!isCopied) {
48
- await navigator.clipboard.writeText(hash);
49
- setIsCopied(true);
50
- onCopy?.();
51
- timeoutRef.current = window.setTimeout(() => setIsCopied(false), timeout);
52
- }
53
- }
54
- catch (error) {
55
- onError?.(error);
56
- }
57
- }, [hash, onCopy, onError, timeout, isCopied]);
58
- useEffect(() => () => {
59
- window.clearTimeout(timeoutRef.current);
60
- }, []);
61
- const Icon = isCopied ? CheckIcon : CopyIcon;
62
- return (_jsx(Button, { className: cn("size-7 shrink-0", className), onClick: copyToClipboard, size: "icon", variant: "ghost", ...props, children: children ?? _jsx(Icon, { size: 14 }) }));
63
- };
64
- export const CommitContent = ({ className, children, ...props }) => (_jsx(CollapsibleContent, { className: cn("border-t p-3", className), ...props, children: children }));
65
- export const CommitFiles = ({ className, children, ...props }) => (_jsx("div", { className: cn("space-y-1", className), ...props, children: children }));
66
- export const CommitFile = ({ className, children, ...props }) => (_jsx("div", { className: cn("flex items-center justify-between gap-2 rounded px-2 py-1 text-sm hover:bg-muted/50", className), ...props, children: children }));
67
- export const CommitFileInfo = ({ className, children, ...props }) => (_jsx("div", { className: cn("flex min-w-0 items-center gap-2", className), ...props, children: children }));
68
- const fileStatusStyles = {
69
- added: "text-green-600 dark:text-green-400",
70
- deleted: "text-red-600 dark:text-red-400",
71
- modified: "text-yellow-600 dark:text-yellow-400",
72
- renamed: "text-blue-600 dark:text-blue-400",
73
- };
74
- const fileStatusLabels = {
75
- added: "A",
76
- deleted: "D",
77
- modified: "M",
78
- renamed: "R",
79
- };
80
- export const CommitFileStatus = ({ status, className, children, ...props }) => (_jsx("span", { className: cn("font-medium font-mono text-xs", fileStatusStyles[status], className), ...props, children: children ?? fileStatusLabels[status] }));
81
- export const CommitFileIcon = ({ className, ...props }) => (_jsx(FileIcon, { className: cn("size-3.5 shrink-0 text-muted-foreground", className), ...props }));
82
- export const CommitFilePath = ({ className, children, ...props }) => (_jsx("span", { className: cn("truncate font-mono text-xs", className), ...props, children: children }));
83
- export const CommitFileChanges = ({ className, children, ...props }) => (_jsx("div", { className: cn("flex shrink-0 items-center gap-1 font-mono text-xs", className), ...props, children: children }));
84
- export const CommitFileAdditions = ({ count, className, children, ...props }) => {
85
- if (count <= 0) {
86
- return null;
87
- }
88
- return (_jsx("span", { className: cn("text-green-600 dark:text-green-400", className), ...props, children: children ?? (_jsxs(_Fragment, { children: [_jsx(PlusIcon, { className: "inline-block size-3" }), count] })) }));
89
- };
90
- export const CommitFileDeletions = ({ count, className, children, ...props }) => {
91
- if (count <= 0) {
92
- return null;
93
- }
94
- return (_jsx("span", { className: cn("text-red-600 dark:text-red-400", className), ...props, children: children ?? (_jsxs(_Fragment, { children: [_jsx(MinusIcon, { className: "inline-block size-3" }), count] })) }));
95
- };
@@ -1,50 +0,0 @@
1
- import { Alert, AlertDescription } from "@chatsdk-dev/ui/components/alert";
2
- import { Button } from "@chatsdk-dev/ui/components/button";
3
- import type { ToolUIPart } from "ai";
4
- import type { ComponentProps, ReactNode } from "react";
5
- type ToolUIPartApproval = {
6
- id: string;
7
- approved?: never;
8
- reason?: never;
9
- } | {
10
- id: string;
11
- approved: boolean;
12
- reason?: string;
13
- } | {
14
- id: string;
15
- approved: true;
16
- reason?: string;
17
- } | {
18
- id: string;
19
- approved: true;
20
- reason?: string;
21
- } | {
22
- id: string;
23
- approved: false;
24
- reason?: string;
25
- } | undefined;
26
- export type ConfirmationProps = ComponentProps<typeof Alert> & {
27
- approval?: ToolUIPartApproval;
28
- state: ToolUIPart["state"];
29
- };
30
- export declare const Confirmation: ({ className, approval, state, ...props }: ConfirmationProps) => import("react/jsx-runtime").JSX.Element | null;
31
- export type ConfirmationTitleProps = ComponentProps<typeof AlertDescription>;
32
- export declare const ConfirmationTitle: ({ className, ...props }: ConfirmationTitleProps) => import("react/jsx-runtime").JSX.Element;
33
- export interface ConfirmationRequestProps {
34
- children?: ReactNode;
35
- }
36
- export declare const ConfirmationRequest: ({ children }: ConfirmationRequestProps) => ReactNode;
37
- export interface ConfirmationAcceptedProps {
38
- children?: ReactNode;
39
- }
40
- export declare const ConfirmationAccepted: ({ children, }: ConfirmationAcceptedProps) => ReactNode;
41
- export interface ConfirmationRejectedProps {
42
- children?: ReactNode;
43
- }
44
- export declare const ConfirmationRejected: ({ children, }: ConfirmationRejectedProps) => ReactNode;
45
- export type ConfirmationActionsProps = ComponentProps<"div">;
46
- export declare const ConfirmationActions: ({ className, ...props }: ConfirmationActionsProps) => import("react/jsx-runtime").JSX.Element | null;
47
- export type ConfirmationActionProps = ComponentProps<typeof Button>;
48
- export declare const ConfirmationAction: (props: ConfirmationActionProps) => import("react/jsx-runtime").JSX.Element;
49
- export {};
50
- //# sourceMappingURL=confirmation.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"confirmation.d.ts","sourceRoot":"","sources":["../../src/molecules/confirmation.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAC3E,OAAO,EAAE,MAAM,EAAE,MAAM,mCAAmC,CAAC;AAE3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AACrC,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvD,KAAK,kBAAkB,GACnB;IACE,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,CAAC,EAAE,KAAK,CAAC;IACjB,MAAM,CAAC,EAAE,KAAK,CAAC;C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Ac,CAAC,KAAK,CAAC,CAAC;AAE7D,eAAO,MAAM,mBAAmB,GAAI,yBAGjC,wBAAwB,mDAc1B,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG,cAAc,CAAC,OAAO,MAAM,CAAC,CAAC;AAEpE,eAAO,MAAM,kBAAkB,GAAI,OAAO,uBAAuB,4CAEhE,CAAC"}
@@ -1,61 +0,0 @@
1
- "use client";
2
- import { jsx as _jsx } from "react/jsx-runtime";
3
- import { Alert, AlertDescription } from "@chatsdk-dev/ui/components/alert";
4
- import { Button } from "@chatsdk-dev/ui/components/button";
5
- import { cn } from "@chatsdk-dev/ui/lib/utils";
6
- import { createContext, useContext, useMemo } from "react";
7
- const ConfirmationContext = createContext(null);
8
- const useConfirmation = () => {
9
- const context = useContext(ConfirmationContext);
10
- if (!context) {
11
- throw new Error("Confirmation components must be used within Confirmation");
12
- }
13
- return context;
14
- };
15
- export const Confirmation = ({ className, approval, state, ...props }) => {
16
- const contextValue = useMemo(() => ({ approval, state }), [approval, state]);
17
- if (!approval || state === "input-streaming" || state === "input-available") {
18
- return null;
19
- }
20
- return (_jsx(ConfirmationContext.Provider, { value: contextValue, children: _jsx(Alert, { className: cn("flex flex-col gap-2", className), ...props }) }));
21
- };
22
- export const ConfirmationTitle = ({ className, ...props }) => (_jsx(AlertDescription, { className: cn("inline", className), ...props }));
23
- export const ConfirmationRequest = ({ children }) => {
24
- const { state } = useConfirmation();
25
- // Only show when approval is requested
26
- if (state !== "approval-requested") {
27
- return null;
28
- }
29
- return children;
30
- };
31
- export const ConfirmationAccepted = ({ children, }) => {
32
- const { approval, state } = useConfirmation();
33
- // Only show when approved and in response states
34
- if (!approval?.approved ||
35
- (state !== "approval-responded" &&
36
- state !== "output-denied" &&
37
- state !== "output-available")) {
38
- return null;
39
- }
40
- return children;
41
- };
42
- export const ConfirmationRejected = ({ children, }) => {
43
- const { approval, state } = useConfirmation();
44
- // Only show when rejected and in response states
45
- if (approval?.approved !== false ||
46
- (state !== "approval-responded" &&
47
- state !== "output-denied" &&
48
- state !== "output-available")) {
49
- return null;
50
- }
51
- return children;
52
- };
53
- export const ConfirmationActions = ({ className, ...props }) => {
54
- const { state } = useConfirmation();
55
- // Only show when approval is requested
56
- if (state !== "approval-requested") {
57
- return null;
58
- }
59
- return (_jsx("div", { className: cn("flex items-center justify-end gap-2 self-end", className), ...props }));
60
- };
61
- export const ConfirmationAction = (props) => (_jsx(Button, { className: "h-8 px-3 text-sm", type: "button", ...props }));
@@ -1,3 +0,0 @@
1
- import type { ConnectionLineComponent } from "@xyflow/react";
2
- export declare const Connection: ConnectionLineComponent;
3
- //# sourceMappingURL=connection.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"connection.d.ts","sourceRoot":"","sources":["../../src/molecules/connection.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAI7D,eAAO,MAAM,UAAU,EAAE,uBAuBxB,CAAC"}
@@ -1,3 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- const HALF = 0.5;
3
- export const Connection = ({ fromX, fromY, toX, toY, }) => (_jsxs("g", { children: [_jsx("path", { className: "animated", d: `M${fromX},${fromY} C ${fromX + (toX - fromX) * HALF},${fromY} ${fromX + (toX - fromX) * HALF},${toY} ${toX},${toY}`, fill: "none", stroke: "var(--color-ring)", strokeWidth: 1 }), _jsx("circle", { cx: toX, cy: toY, fill: "#fff", r: 3, stroke: "var(--color-ring)", strokeWidth: 1 })] }));
@@ -1,33 +0,0 @@
1
- import { Button } from "@chatsdk-dev/ui/components/button";
2
- import { HoverCard, HoverCardContent } from "@chatsdk-dev/ui/components/hover-card";
3
- import type { LanguageModelUsage } from "ai";
4
- import type { ComponentProps } from "react";
5
- type ModelId = string;
6
- interface ContextSchema {
7
- usedTokens: number;
8
- maxTokens: number;
9
- usage?: LanguageModelUsage;
10
- modelId?: ModelId;
11
- }
12
- export type ContextProps = ComponentProps<typeof HoverCard> & ContextSchema;
13
- export declare const Context: ({ usedTokens, maxTokens, usage, modelId, ...props }: ContextProps) => import("react/jsx-runtime").JSX.Element;
14
- export type ContextTriggerProps = ComponentProps<typeof Button>;
15
- export declare const ContextTrigger: ({ children, ...props }: ContextTriggerProps) => import("react/jsx-runtime").JSX.Element;
16
- export type ContextContentProps = ComponentProps<typeof HoverCardContent>;
17
- export declare const ContextContent: ({ className, ...props }: ContextContentProps) => import("react/jsx-runtime").JSX.Element;
18
- export type ContextContentHeaderProps = ComponentProps<"div">;
19
- export declare const ContextContentHeader: ({ children, className, ...props }: ContextContentHeaderProps) => import("react/jsx-runtime").JSX.Element;
20
- export type ContextContentBodyProps = ComponentProps<"div">;
21
- export declare const ContextContentBody: ({ children, className, ...props }: ContextContentBodyProps) => import("react/jsx-runtime").JSX.Element;
22
- export type ContextContentFooterProps = ComponentProps<"div">;
23
- export declare const ContextContentFooter: ({ children, className, ...props }: ContextContentFooterProps) => import("react/jsx-runtime").JSX.Element;
24
- export type ContextInputUsageProps = ComponentProps<"div">;
25
- export declare const ContextInputUsage: ({ className, children, ...props }: ContextInputUsageProps) => string | number | bigint | true | import("react/jsx-runtime").JSX.Element | Iterable<import("react").ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<import("react").ReactNode> | null | undefined> | null;
26
- export type ContextOutputUsageProps = ComponentProps<"div">;
27
- export declare const ContextOutputUsage: ({ className, children, ...props }: ContextOutputUsageProps) => string | number | bigint | true | import("react/jsx-runtime").JSX.Element | Iterable<import("react").ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<import("react").ReactNode> | null | undefined> | null;
28
- export type ContextReasoningUsageProps = ComponentProps<"div">;
29
- export declare const ContextReasoningUsage: ({ className, children, ...props }: ContextReasoningUsageProps) => string | number | bigint | true | import("react/jsx-runtime").JSX.Element | Iterable<import("react").ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<import("react").ReactNode> | null | undefined> | null;
30
- export type ContextCacheUsageProps = ComponentProps<"div">;
31
- export declare const ContextCacheUsage: ({ className, children, ...props }: ContextCacheUsageProps) => string | number | bigint | true | import("react/jsx-runtime").JSX.Element | Iterable<import("react").ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<import("react").ReactNode> | null | undefined> | null;
32
- export {};
33
- //# sourceMappingURL=context.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/molecules/context.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,mCAAmC,CAAC;AAC3D,OAAO,EACL,SAAS,EACT,gBAAgB,EAEjB,MAAM,uCAAuC,CAAC;AAG/C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,IAAI,CAAC;AAC7C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAU5C,KAAK,OAAO,GAAG,MAAM,CAAC;AAEtB,UAAU,aAAa;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,kBAAkB,CAAC;IAC3B,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAcD,MAAM,MAAM,YAAY,GAAG,cAAc,CAAC,OAAO,SAAS,CAAC,GAAG,aAAa,CAAC;AAE5E,eAAO,MAAM,OAAO,GAAI,qDAMrB,YAAY,4CAWd,CAAC;AA2CF,MAAM,MAAM,mBAAmB,GAAG,cAAc,CAAC,OAAO,MAAM,CAAC,CAAC;AAEhE,eAAO,MAAM,cAAc,GAAI,wBAAwB,mBAAmB,4CAwBzE,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,cAAc,C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