@cognite/aura 0.3.4 → 1.0.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 (540) hide show
  1. package/CHANGELOG.md +274 -0
  2. package/DESIGN.md +664 -281
  3. package/LICENSE +21 -0
  4. package/README.md +48 -13
  5. package/dist/colors-deprecated.css +618 -0
  6. package/dist/colors.css +803 -830
  7. package/dist/components/index.d.ts +63 -57
  8. package/dist/components/index.js +62 -59
  9. package/dist/components/index.js.map +1 -0
  10. package/dist/components/ui/core/accordion/accordion.d.ts +19 -18
  11. package/dist/components/ui/core/accordion/accordion.js +99 -78
  12. package/dist/components/ui/core/accordion/accordion.js.map +1 -0
  13. package/dist/components/ui/core/action-toolbar/action-toolbar-motion.d.ts +8 -0
  14. package/dist/components/ui/core/action-toolbar/action-toolbar-motion.js +132 -0
  15. package/dist/components/ui/core/action-toolbar/action-toolbar-motion.js.map +1 -0
  16. package/dist/components/ui/core/action-toolbar/action-toolbar.d.ts +31 -31
  17. package/dist/components/ui/core/action-toolbar/action-toolbar.js +156 -106
  18. package/dist/components/ui/core/action-toolbar/action-toolbar.js.map +1 -0
  19. package/dist/components/ui/core/alert/alert.d.ts +25 -25
  20. package/dist/components/ui/core/alert/alert.gallery.d.ts +2 -0
  21. package/dist/components/ui/core/alert/alert.gallery.js +54 -0
  22. package/dist/components/ui/core/alert/alert.gallery.js.map +1 -0
  23. package/dist/components/ui/core/alert/alert.js +181 -152
  24. package/dist/components/ui/core/alert/alert.js.map +1 -0
  25. package/dist/components/ui/core/avatar/avatar.d.ts +10 -9
  26. package/dist/components/ui/core/avatar/avatar.gallery.d.ts +2 -0
  27. package/dist/components/ui/core/avatar/avatar.gallery.js +67 -0
  28. package/dist/components/ui/core/avatar/avatar.gallery.js.map +1 -0
  29. package/dist/components/ui/core/avatar/avatar.js +75 -65
  30. package/dist/components/ui/core/avatar/avatar.js.map +1 -0
  31. package/dist/components/ui/core/badge/badge.d.ts +13 -12
  32. package/dist/components/ui/core/badge/badge.gallery.d.ts +2 -0
  33. package/dist/components/ui/core/badge/badge.gallery.js +64 -0
  34. package/dist/components/ui/core/badge/badge.gallery.js.map +1 -0
  35. package/dist/components/ui/core/badge/badge.js +88 -72
  36. package/dist/components/ui/core/badge/badge.js.map +1 -0
  37. package/dist/components/ui/core/banner/banner.d.ts +18 -18
  38. package/dist/components/ui/core/banner/banner.gallery.d.ts +2 -0
  39. package/dist/components/ui/core/banner/banner.gallery.js +56 -0
  40. package/dist/components/ui/core/banner/banner.gallery.js.map +1 -0
  41. package/dist/components/ui/core/banner/banner.js +179 -142
  42. package/dist/components/ui/core/banner/banner.js.map +1 -0
  43. package/dist/components/ui/core/breadcrumb/breadcrumb.d.ts +12 -12
  44. package/dist/components/ui/core/breadcrumb/breadcrumb.gallery.d.ts +2 -0
  45. package/dist/components/ui/core/breadcrumb/breadcrumb.gallery.js +31 -0
  46. package/dist/components/ui/core/breadcrumb/breadcrumb.gallery.js.map +1 -0
  47. package/dist/components/ui/core/breadcrumb/breadcrumb.js +139 -104
  48. package/dist/components/ui/core/breadcrumb/breadcrumb.js.map +1 -0
  49. package/dist/components/ui/core/button/button.d.ts +7 -7
  50. package/dist/components/ui/core/button/button.gallery.d.ts +2 -0
  51. package/dist/components/ui/core/button/button.gallery.js +76 -0
  52. package/dist/components/ui/core/button/button.gallery.js.map +1 -0
  53. package/dist/components/ui/core/button/button.js +57 -47
  54. package/dist/components/ui/core/button/button.js.map +1 -0
  55. package/dist/components/ui/core/button-group/button-group.d.ts +9 -9
  56. package/dist/components/ui/core/button-group/button-group.gallery.d.ts +2 -0
  57. package/dist/components/ui/core/button-group/button-group.gallery.js +62 -0
  58. package/dist/components/ui/core/button-group/button-group.gallery.js.map +1 -0
  59. package/dist/components/ui/core/button-group/button-group.js +50 -40
  60. package/dist/components/ui/core/button-group/button-group.js.map +1 -0
  61. package/dist/components/ui/core/calendar/calendar-header.d.ts +7 -7
  62. package/dist/components/ui/core/calendar/calendar-header.js +102 -63
  63. package/dist/components/ui/core/calendar/calendar-header.js.map +1 -0
  64. package/dist/components/ui/core/calendar/calendar-utils.d.ts +30 -30
  65. package/dist/components/ui/core/calendar/calendar-utils.js +116 -39
  66. package/dist/components/ui/core/calendar/calendar-utils.js.map +1 -0
  67. package/dist/components/ui/core/calendar/calendar.d.ts +10 -10
  68. package/dist/components/ui/core/calendar/calendar.js +95 -66
  69. package/dist/components/ui/core/calendar/calendar.js.map +1 -0
  70. package/dist/components/ui/core/calendar/constants.js +3 -0
  71. package/dist/components/ui/core/calendar/constants.js.map +1 -0
  72. package/dist/components/ui/core/card/card.d.ts +20 -20
  73. package/dist/components/ui/core/card/card.js +133 -104
  74. package/dist/components/ui/core/card/card.js.map +1 -0
  75. package/dist/components/ui/core/chart/chart.d.ts +55 -53
  76. package/dist/components/ui/core/chart/chart.js +196 -116
  77. package/dist/components/ui/core/chart/chart.js.map +1 -0
  78. package/dist/components/ui/core/chart/index.d.ts +2 -2
  79. package/dist/components/ui/core/chart/index.js +3 -2
  80. package/dist/components/ui/core/chart/index.js.map +1 -0
  81. package/dist/components/ui/core/checkbox/checkbox.d.ts +9 -9
  82. package/dist/components/ui/core/checkbox/checkbox.gallery.d.ts +2 -0
  83. package/dist/components/ui/core/checkbox/checkbox.gallery.js +36 -0
  84. package/dist/components/ui/core/checkbox/checkbox.gallery.js.map +1 -0
  85. package/dist/components/ui/core/checkbox/checkbox.js +88 -68
  86. package/dist/components/ui/core/checkbox/checkbox.js.map +1 -0
  87. package/dist/components/ui/core/checkbox/checkbox.metadata.d.ts +1 -1
  88. package/dist/components/ui/core/checkbox/checkbox.metadata.js +6 -7
  89. package/dist/components/ui/core/checkbox/checkbox.metadata.js.map +1 -0
  90. package/dist/components/ui/core/code-block/code-block.d.ts +19 -19
  91. package/dist/components/ui/core/code-block/code-block.js +260 -175
  92. package/dist/components/ui/core/code-block/code-block.js.map +1 -0
  93. package/dist/components/ui/core/collapsible/collapsible.d.ts +5 -5
  94. package/dist/components/ui/core/collapsible/collapsible.gallery.d.ts +2 -0
  95. package/dist/components/ui/core/collapsible/collapsible.gallery.js +39 -0
  96. package/dist/components/ui/core/collapsible/collapsible.gallery.js.map +1 -0
  97. package/dist/components/ui/core/collapsible/collapsible.js +36 -30
  98. package/dist/components/ui/core/collapsible/collapsible.js.map +1 -0
  99. package/dist/components/ui/core/combobox/combobox.d.ts +13 -13
  100. package/dist/components/ui/core/combobox/combobox.js +89 -40
  101. package/dist/components/ui/core/combobox/combobox.js.map +1 -0
  102. package/dist/components/ui/core/command/command.d.ts +20 -18
  103. package/dist/components/ui/core/command/command.js +137 -85
  104. package/dist/components/ui/core/command/command.js.map +1 -0
  105. package/dist/components/ui/core/conversation/conversation.d.ts +14 -0
  106. package/dist/components/ui/core/conversation/conversation.js +51 -0
  107. package/dist/components/ui/core/conversation/conversation.js.map +1 -0
  108. package/dist/components/ui/core/count/count.d.ts +8 -6
  109. package/dist/components/ui/core/count/count.gallery.d.ts +2 -0
  110. package/dist/components/ui/core/count/count.gallery.js +55 -0
  111. package/dist/components/ui/core/count/count.gallery.js.map +1 -0
  112. package/dist/components/ui/core/count/count.js +51 -21
  113. package/dist/components/ui/core/count/count.js.map +1 -0
  114. package/dist/components/ui/core/data-grid/data-grid-cell.d.ts +5 -7
  115. package/dist/components/ui/core/data-grid/data-grid-cell.js +19 -0
  116. package/dist/components/ui/core/data-grid/data-grid-cell.js.map +1 -0
  117. package/dist/components/ui/core/data-grid/data-grid-column-filter.d.ts +4 -0
  118. package/dist/components/ui/core/data-grid/data-grid-column-filter.js +13 -0
  119. package/dist/components/ui/core/data-grid/data-grid-column-filter.js.map +1 -0
  120. package/dist/components/ui/core/data-grid/data-grid-column-resizer.d.ts +8 -0
  121. package/dist/components/ui/core/data-grid/data-grid-column-resizer.js +25 -0
  122. package/dist/components/ui/core/data-grid/data-grid-column-resizer.js.map +1 -0
  123. package/dist/components/ui/core/data-grid/data-grid-filter-clauses.d.ts +14 -0
  124. package/dist/components/ui/core/data-grid/data-grid-filter-clauses.js +36 -0
  125. package/dist/components/ui/core/data-grid/data-grid-filter-clauses.js.map +1 -0
  126. package/dist/components/ui/core/data-grid/data-grid-filter-panel.d.ts +43 -0
  127. package/dist/components/ui/core/data-grid/data-grid-filter-panel.js +287 -0
  128. package/dist/components/ui/core/data-grid/data-grid-filter-panel.js.map +1 -0
  129. package/dist/components/ui/core/data-grid/data-grid-footer.d.ts +6 -0
  130. package/dist/components/ui/core/data-grid/data-grid-footer.js +34 -0
  131. package/dist/components/ui/core/data-grid/data-grid-footer.js.map +1 -0
  132. package/dist/components/ui/core/data-grid/data-grid-header-row.d.ts +10 -10
  133. package/dist/components/ui/core/data-grid/data-grid-header-row.js +86 -0
  134. package/dist/components/ui/core/data-grid/data-grid-header-row.js.map +1 -0
  135. package/dist/components/ui/core/data-grid/data-grid-header.d.ts +11 -0
  136. package/dist/components/ui/core/data-grid/data-grid-header.js +67 -0
  137. package/dist/components/ui/core/data-grid/data-grid-header.js.map +1 -0
  138. package/dist/components/ui/core/data-grid/data-grid-row.d.ts +13 -15
  139. package/dist/components/ui/core/data-grid/data-grid-row.js +118 -0
  140. package/dist/components/ui/core/data-grid/data-grid-row.js.map +1 -0
  141. package/dist/components/ui/core/data-grid/data-grid-selection-state.d.ts +15 -0
  142. package/dist/components/ui/core/data-grid/data-grid-selection-state.js +32 -0
  143. package/dist/components/ui/core/data-grid/data-grid-selection-state.js.map +1 -0
  144. package/dist/components/ui/core/data-grid/data-grid-selection-toolbar.d.ts +11 -0
  145. package/dist/components/ui/core/data-grid/data-grid-selection-toolbar.js +129 -0
  146. package/dist/components/ui/core/data-grid/data-grid-selection-toolbar.js.map +1 -0
  147. package/dist/components/ui/core/data-grid/data-grid-selection.types.d.ts +24 -0
  148. package/dist/components/ui/core/data-grid/data-grid-selection.types.js +3 -0
  149. package/dist/components/ui/core/data-grid/data-grid-selection.types.js.map +1 -0
  150. package/dist/components/ui/core/data-grid/data-grid.d.ts +125 -35
  151. package/dist/components/ui/core/data-grid/data-grid.fixtures.d.ts +7 -7
  152. package/dist/components/ui/core/data-grid/data-grid.fixtures.js +139 -0
  153. package/dist/components/ui/core/data-grid/data-grid.fixtures.js.map +1 -0
  154. package/dist/components/ui/core/data-grid/data-grid.js +542 -0
  155. package/dist/components/ui/core/data-grid/data-grid.js.map +1 -0
  156. package/dist/components/ui/core/data-grid/data-grid.utils.d.ts +3 -4
  157. package/dist/components/ui/core/data-grid/data-grid.utils.js +53 -0
  158. package/dist/components/ui/core/data-grid/data-grid.utils.js.map +1 -0
  159. package/dist/components/ui/core/data-grid/index.d.ts +6 -0
  160. package/dist/components/ui/core/data-grid/index.js +6 -0
  161. package/dist/components/ui/core/data-grid/index.js.map +1 -0
  162. package/dist/components/ui/core/date-time-pickers/date-picker/date-picker.d.ts +11 -13
  163. package/dist/components/ui/core/date-time-pickers/date-picker/date-picker.js +85 -61
  164. package/dist/components/ui/core/date-time-pickers/date-picker/date-picker.js.map +1 -0
  165. package/dist/components/ui/core/date-time-pickers/date-picker/index.d.ts +3 -3
  166. package/dist/components/ui/core/date-time-pickers/date-picker/index.js +3 -0
  167. package/dist/components/ui/core/date-time-pickers/date-picker/index.js.map +1 -0
  168. package/dist/components/ui/core/date-time-pickers/date-picker/types.d.ts +14 -14
  169. package/dist/components/ui/core/date-time-pickers/date-picker/types.js +3 -0
  170. package/dist/components/ui/core/date-time-pickers/date-picker/types.js.map +1 -0
  171. package/dist/components/ui/core/date-time-pickers/date-picker/use-date-picker.d.ts +2 -2
  172. package/dist/components/ui/core/date-time-pickers/date-picker/use-date-picker.js +51 -36
  173. package/dist/components/ui/core/date-time-pickers/date-picker/use-date-picker.js.map +1 -0
  174. package/dist/components/ui/core/date-time-pickers/date-range-picker/date-range-picker.d.ts +11 -13
  175. package/dist/components/ui/core/date-time-pickers/date-range-picker/date-range-picker.js +89 -64
  176. package/dist/components/ui/core/date-time-pickers/date-range-picker/date-range-picker.js.map +1 -0
  177. package/dist/components/ui/core/date-time-pickers/date-range-picker/index.d.ts +3 -3
  178. package/dist/components/ui/core/date-time-pickers/date-range-picker/index.js +3 -0
  179. package/dist/components/ui/core/date-time-pickers/date-range-picker/index.js.map +1 -0
  180. package/dist/components/ui/core/date-time-pickers/date-range-picker/types.d.ts +20 -20
  181. package/dist/components/ui/core/date-time-pickers/date-range-picker/types.js +3 -0
  182. package/dist/components/ui/core/date-time-pickers/date-range-picker/types.js.map +1 -0
  183. package/dist/components/ui/core/date-time-pickers/date-range-picker/use-date-range-picker.d.ts +4 -4
  184. package/dist/components/ui/core/date-time-pickers/date-range-picker/use-date-range-picker.js +95 -60
  185. package/dist/components/ui/core/date-time-pickers/date-range-picker/use-date-range-picker.js.map +1 -0
  186. package/dist/components/ui/core/date-time-pickers/date-time-picker/date-time-picker.d.ts +15 -0
  187. package/dist/components/ui/core/date-time-pickers/date-time-picker/date-time-picker.js +120 -0
  188. package/dist/components/ui/core/date-time-pickers/date-time-picker/date-time-picker.js.map +1 -0
  189. package/dist/components/ui/core/date-time-pickers/date-time-picker/index.d.ts +3 -1
  190. package/dist/components/ui/core/date-time-pickers/date-time-picker/index.js +3 -0
  191. package/dist/components/ui/core/date-time-pickers/date-time-picker/index.js.map +1 -0
  192. package/dist/components/ui/core/date-time-pickers/date-time-picker/types.d.ts +25 -32
  193. package/dist/components/ui/core/date-time-pickers/date-time-picker/types.js +3 -0
  194. package/dist/components/ui/core/date-time-pickers/date-time-picker/types.js.map +1 -0
  195. package/dist/components/ui/core/date-time-pickers/date-time-picker/use-date-time-picker.d.ts +2 -2
  196. package/dist/components/ui/core/date-time-pickers/date-time-picker/use-date-time-picker.js +78 -0
  197. package/dist/components/ui/core/date-time-pickers/date-time-picker/use-date-time-picker.js.map +1 -0
  198. package/dist/components/ui/core/date-time-pickers/date-time-range-picker/date-time-range-picker.d.ts +13 -15
  199. package/dist/components/ui/core/date-time-pickers/date-time-range-picker/date-time-range-picker.js +165 -119
  200. package/dist/components/ui/core/date-time-pickers/date-time-range-picker/date-time-range-picker.js.map +1 -0
  201. package/dist/components/ui/core/date-time-pickers/date-time-range-picker/index.d.ts +3 -3
  202. package/dist/components/ui/core/date-time-pickers/date-time-range-picker/index.js +3 -0
  203. package/dist/components/ui/core/date-time-pickers/date-time-range-picker/index.js.map +1 -0
  204. package/dist/components/ui/core/date-time-pickers/date-time-range-picker/types.d.ts +37 -37
  205. package/dist/components/ui/core/date-time-pickers/date-time-range-picker/types.js +3 -0
  206. package/dist/components/ui/core/date-time-pickers/date-time-range-picker/types.js.map +1 -0
  207. package/dist/components/ui/core/date-time-pickers/date-time-range-picker/use-date-time-range-picker.d.ts +3 -3
  208. package/dist/components/ui/core/date-time-pickers/date-time-range-picker/use-date-time-range-picker.js +163 -104
  209. package/dist/components/ui/core/date-time-pickers/date-time-range-picker/use-date-time-range-picker.js.map +1 -0
  210. package/dist/components/ui/core/date-time-pickers/index.d.ts +17 -12
  211. package/dist/components/ui/core/date-time-pickers/index.js +10 -6
  212. package/dist/components/ui/core/date-time-pickers/index.js.map +1 -0
  213. package/dist/components/ui/core/date-time-pickers/shared/am-pm-scroll/am-pm-scroll.d.ts +5 -5
  214. package/dist/components/ui/core/date-time-pickers/shared/am-pm-scroll/am-pm-scroll.js +52 -42
  215. package/dist/components/ui/core/date-time-pickers/shared/am-pm-scroll/am-pm-scroll.js.map +1 -0
  216. package/dist/components/ui/core/date-time-pickers/shared/constants.d.ts +6 -1
  217. package/dist/components/ui/core/date-time-pickers/shared/constants.js +23 -0
  218. package/dist/components/ui/core/date-time-pickers/shared/constants.js.map +1 -0
  219. package/dist/components/ui/core/date-time-pickers/shared/date-time-input/date-time-input.d.ts +16 -15
  220. package/dist/components/ui/core/date-time-pickers/shared/date-time-input/date-time-input.js +87 -64
  221. package/dist/components/ui/core/date-time-pickers/shared/date-time-input/date-time-input.js.map +1 -0
  222. package/dist/components/ui/core/date-time-pickers/shared/date-time-input/range-input-display.d.ts +10 -9
  223. package/dist/components/ui/core/date-time-pickers/shared/date-time-input/range-input-display.js +89 -38
  224. package/dist/components/ui/core/date-time-pickers/shared/date-time-input/range-input-display.js.map +1 -0
  225. package/dist/components/ui/core/date-time-pickers/shared/hooks/use-popover-state.d.ts +5 -5
  226. package/dist/components/ui/core/date-time-pickers/shared/hooks/use-popover-state.js +34 -23
  227. package/dist/components/ui/core/date-time-pickers/shared/hooks/use-popover-state.js.map +1 -0
  228. package/dist/components/ui/core/date-time-pickers/shared/hooks/use-range-date-state.d.ts +23 -23
  229. package/dist/components/ui/core/date-time-pickers/shared/hooks/use-range-date-state.js +95 -52
  230. package/dist/components/ui/core/date-time-pickers/shared/hooks/use-range-date-state.js.map +1 -0
  231. package/dist/components/ui/core/date-time-pickers/shared/hooks/use-range-step-manager.d.ts +5 -5
  232. package/dist/components/ui/core/date-time-pickers/shared/hooks/use-range-step-manager.js +22 -18
  233. package/dist/components/ui/core/date-time-pickers/shared/hooks/use-range-step-manager.js.map +1 -0
  234. package/dist/components/ui/core/date-time-pickers/shared/hooks/use-single-date-state.d.ts +19 -19
  235. package/dist/components/ui/core/date-time-pickers/shared/hooks/use-single-date-state.js +41 -24
  236. package/dist/components/ui/core/date-time-pickers/shared/hooks/use-single-date-state.js.map +1 -0
  237. package/dist/components/ui/core/date-time-pickers/shared/hooks/use-time-state.d.ts +13 -13
  238. package/dist/components/ui/core/date-time-pickers/shared/hooks/use-time-state.js +33 -24
  239. package/dist/components/ui/core/date-time-pickers/shared/hooks/use-time-state.js.map +1 -0
  240. package/dist/components/ui/core/date-time-pickers/shared/scroll-cell-classes.d.ts +5 -5
  241. package/dist/components/ui/core/date-time-pickers/shared/scroll-cell-classes.js +9 -4
  242. package/dist/components/ui/core/date-time-pickers/shared/scroll-cell-classes.js.map +1 -0
  243. package/dist/components/ui/core/date-time-pickers/shared/shortcuts-panel/shortcuts-panel.d.ts +13 -9
  244. package/dist/components/ui/core/date-time-pickers/shared/shortcuts-panel/shortcuts-panel.js +22 -17
  245. package/dist/components/ui/core/date-time-pickers/shared/shortcuts-panel/shortcuts-panel.js.map +1 -0
  246. package/dist/components/ui/core/date-time-pickers/shared/time-picker-panel/index.d.ts +2 -2
  247. package/dist/components/ui/core/date-time-pickers/shared/time-picker-panel/index.js +3 -0
  248. package/dist/components/ui/core/date-time-pickers/shared/time-picker-panel/index.js.map +1 -0
  249. package/dist/components/ui/core/date-time-pickers/shared/time-picker-panel/time-picker-panel.d.ts +13 -13
  250. package/dist/components/ui/core/date-time-pickers/shared/time-picker-panel/time-picker-panel.js +49 -40
  251. package/dist/components/ui/core/date-time-pickers/shared/time-picker-panel/time-picker-panel.js.map +1 -0
  252. package/dist/components/ui/core/date-time-pickers/shared/time-picker-scroll/time-picker-scroll.d.ts +7 -7
  253. package/dist/components/ui/core/date-time-pickers/shared/time-picker-scroll/time-picker-scroll.js +41 -34
  254. package/dist/components/ui/core/date-time-pickers/shared/time-picker-scroll/time-picker-scroll.js.map +1 -0
  255. package/dist/components/ui/core/date-time-pickers/time-picker/index.d.ts +3 -3
  256. package/dist/components/ui/core/date-time-pickers/time-picker/index.js +3 -0
  257. package/dist/components/ui/core/date-time-pickers/time-picker/index.js.map +1 -0
  258. package/dist/components/ui/core/date-time-pickers/time-picker/time-picker.d.ts +12 -14
  259. package/dist/components/ui/core/date-time-pickers/time-picker/time-picker.js +99 -79
  260. package/dist/components/ui/core/date-time-pickers/time-picker/time-picker.js.map +1 -0
  261. package/dist/components/ui/core/date-time-pickers/time-picker/types.d.ts +20 -20
  262. package/dist/components/ui/core/date-time-pickers/time-picker/types.js +3 -0
  263. package/dist/components/ui/core/date-time-pickers/time-picker/types.js.map +1 -0
  264. package/dist/components/ui/core/date-time-pickers/time-picker/use-time-picker.d.ts +2 -2
  265. package/dist/components/ui/core/date-time-pickers/time-picker/use-time-picker.js +63 -41
  266. package/dist/components/ui/core/date-time-pickers/time-picker/use-time-picker.js.map +1 -0
  267. package/dist/components/ui/core/date-time-pickers/time-range-picker/index.d.ts +3 -1
  268. package/dist/components/ui/core/date-time-pickers/time-range-picker/index.js +3 -0
  269. package/dist/components/ui/core/date-time-pickers/time-range-picker/index.js.map +1 -0
  270. package/dist/components/ui/core/date-time-pickers/time-range-picker/time-range-picker.d.ts +14 -0
  271. package/dist/components/ui/core/date-time-pickers/time-range-picker/time-range-picker.js +115 -0
  272. package/dist/components/ui/core/date-time-pickers/time-range-picker/time-range-picker.js.map +1 -0
  273. package/dist/components/ui/core/date-time-pickers/time-range-picker/types.d.ts +30 -36
  274. package/dist/components/ui/core/date-time-pickers/time-range-picker/types.js +3 -0
  275. package/dist/components/ui/core/date-time-pickers/time-range-picker/types.js.map +1 -0
  276. package/dist/components/ui/core/date-time-pickers/time-range-picker/use-time-range-picker.d.ts +2 -2
  277. package/dist/components/ui/core/date-time-pickers/time-range-picker/use-time-range-picker.js +145 -0
  278. package/dist/components/ui/core/date-time-pickers/time-range-picker/use-time-range-picker.js.map +1 -0
  279. package/dist/components/ui/core/date-time-pickers/utils/date-input.d.ts +56 -0
  280. package/dist/components/ui/core/date-time-pickers/utils/date-input.js +67 -0
  281. package/dist/components/ui/core/date-time-pickers/utils/date-input.js.map +1 -0
  282. package/dist/components/ui/core/date-time-pickers/utils/date-range-utils.d.ts +18 -18
  283. package/dist/components/ui/core/date-time-pickers/utils/date-range-utils.js +42 -0
  284. package/dist/components/ui/core/date-time-pickers/utils/date-range-utils.js.map +1 -0
  285. package/dist/components/ui/core/date-time-pickers/utils/format-utils.d.ts +31 -29
  286. package/dist/components/ui/core/date-time-pickers/utils/format-utils.js +56 -0
  287. package/dist/components/ui/core/date-time-pickers/utils/format-utils.js.map +1 -0
  288. package/dist/components/ui/core/date-time-pickers/utils/segment-utils.d.ts +21 -21
  289. package/dist/components/ui/core/date-time-pickers/utils/segment-utils.js +170 -0
  290. package/dist/components/ui/core/date-time-pickers/utils/segment-utils.js.map +1 -0
  291. package/dist/components/ui/core/date-time-pickers/utils/time-utils.d.ts +28 -28
  292. package/dist/components/ui/core/date-time-pickers/utils/time-utils.js +88 -7
  293. package/dist/components/ui/core/date-time-pickers/utils/time-utils.js.map +1 -0
  294. package/dist/components/ui/core/date-time-pickers/utils/time-validation.d.ts +17 -17
  295. package/dist/components/ui/core/date-time-pickers/utils/time-validation.js +43 -0
  296. package/dist/components/ui/core/date-time-pickers/utils/time-validation.js.map +1 -0
  297. package/dist/components/ui/core/dialog/dialog.d.ts +12 -9
  298. package/dist/components/ui/core/dialog/dialog.js +90 -82
  299. package/dist/components/ui/core/dialog/dialog.js.map +1 -0
  300. package/dist/components/ui/core/dropdown-menu/dropdown-menu.d.ts +22 -19
  301. package/dist/components/ui/core/dropdown-menu/dropdown-menu.js +204 -149
  302. package/dist/components/ui/core/dropdown-menu/dropdown-menu.js.map +1 -0
  303. package/dist/components/ui/core/empty-state/empty-state.context.d.ts +4 -4
  304. package/dist/components/ui/core/empty-state/empty-state.context.js +8 -5
  305. package/dist/components/ui/core/empty-state/empty-state.context.js.map +1 -0
  306. package/dist/components/ui/core/empty-state/empty-state.d.ts +14 -14
  307. package/dist/components/ui/core/empty-state/empty-state.js +96 -82
  308. package/dist/components/ui/core/empty-state/empty-state.js.map +1 -0
  309. package/dist/components/ui/core/helper-text/helper-text.d.ts +7 -7
  310. package/dist/components/ui/core/helper-text/helper-text.js +55 -36
  311. package/dist/components/ui/core/helper-text/helper-text.js.map +1 -0
  312. package/dist/components/ui/core/hover-card/hover-card.d.ts +7 -6
  313. package/dist/components/ui/core/hover-card/hover-card.js +56 -52
  314. package/dist/components/ui/core/hover-card/hover-card.js.map +1 -0
  315. package/dist/components/ui/core/inline-citation/inline-citation.d.ts +26 -25
  316. package/dist/components/ui/core/inline-citation/inline-citation.js +121 -97
  317. package/dist/components/ui/core/inline-citation/inline-citation.js.map +1 -0
  318. package/dist/components/ui/core/input/input.d.ts +2 -2
  319. package/dist/components/ui/core/input/input.gallery.d.ts +2 -0
  320. package/dist/components/ui/core/input/input.gallery.js +89 -0
  321. package/dist/components/ui/core/input/input.gallery.js.map +1 -0
  322. package/dist/components/ui/core/input/input.js +15 -13
  323. package/dist/components/ui/core/input/input.js.map +1 -0
  324. package/dist/components/ui/core/input-group/input-group.d.ts +25 -14
  325. package/dist/components/ui/core/input-group/input-group.js +149 -76
  326. package/dist/components/ui/core/input-group/input-group.js.map +1 -0
  327. package/dist/components/ui/core/item/item.d.ts +20 -0
  328. package/dist/components/ui/core/item/item.js +93 -0
  329. package/dist/components/ui/core/item/item.js.map +1 -0
  330. package/dist/components/ui/core/kbd/kbd.d.ts +3 -3
  331. package/dist/components/ui/core/kbd/kbd.js +24 -20
  332. package/dist/components/ui/core/kbd/kbd.js.map +1 -0
  333. package/dist/components/ui/core/label/label.d.ts +3 -3
  334. package/dist/components/ui/core/label/label.gallery.d.ts +2 -0
  335. package/dist/components/ui/core/label/label.gallery.js +57 -0
  336. package/dist/components/ui/core/label/label.gallery.js.map +1 -0
  337. package/dist/components/ui/core/label/label.js +33 -26
  338. package/dist/components/ui/core/label/label.js.map +1 -0
  339. package/dist/components/ui/core/loader/loader.d.ts +6 -6
  340. package/dist/components/ui/core/loader/loader.js +97 -80
  341. package/dist/components/ui/core/loader/loader.js.map +1 -0
  342. package/dist/components/ui/core/message/message-response-default-streamdown-controls.d.ts +8 -9
  343. package/dist/components/ui/core/message/message-response-default-streamdown-controls.js +18 -12
  344. package/dist/components/ui/core/message/message-response-default-streamdown-controls.js.map +1 -0
  345. package/dist/components/ui/core/message/message-response-math-plugin.d.ts +3 -0
  346. package/dist/components/ui/core/message/message-response-math-plugin.js +6 -0
  347. package/dist/components/ui/core/message/message-response-math-plugin.js.map +1 -0
  348. package/dist/components/ui/core/message/message.d.ts +27 -23
  349. package/dist/components/ui/core/message/message.js +458 -316
  350. package/dist/components/ui/core/message/message.js.map +1 -0
  351. package/dist/components/ui/core/overflow-list/overflow-list.d.ts +21 -0
  352. package/dist/components/ui/core/overflow-list/overflow-list.js +197 -0
  353. package/dist/components/ui/core/overflow-list/overflow-list.js.map +1 -0
  354. package/dist/components/ui/core/overflow-list/overflow-list.utils.d.ts +37 -35
  355. package/dist/components/ui/core/overflow-list/overflow-list.utils.js +206 -0
  356. package/dist/components/ui/core/overflow-list/overflow-list.utils.js.map +1 -0
  357. package/dist/components/ui/core/pagination/pagination-size-context.d.ts +2 -2
  358. package/dist/components/ui/core/pagination/pagination-size-context.js +6 -5
  359. package/dist/components/ui/core/pagination/pagination-size-context.js.map +1 -0
  360. package/dist/components/ui/core/pagination/pagination-teleport.d.ts +9 -9
  361. package/dist/components/ui/core/pagination/pagination-teleport.js +127 -84
  362. package/dist/components/ui/core/pagination/pagination-teleport.js.map +1 -0
  363. package/dist/components/ui/core/pagination/pagination-teleport.utils.js +6 -6
  364. package/dist/components/ui/core/pagination/pagination-teleport.utils.js.map +1 -0
  365. package/dist/components/ui/core/pagination/pagination.d.ts +39 -39
  366. package/dist/components/ui/core/pagination/pagination.js +294 -234
  367. package/dist/components/ui/core/pagination/pagination.js.map +1 -0
  368. package/dist/components/ui/core/popover/popover.d.ts +12 -11
  369. package/dist/components/ui/core/popover/popover.js +104 -89
  370. package/dist/components/ui/core/popover/popover.js.map +1 -0
  371. package/dist/components/ui/core/progress/progress.d.ts +9 -8
  372. package/dist/components/ui/core/progress/progress.js +50 -35
  373. package/dist/components/ui/core/progress/progress.js.map +1 -0
  374. package/dist/components/ui/core/prompt-input/prompt-input.d.ts +27 -27
  375. package/dist/components/ui/core/prompt-input/prompt-input.js +342 -271
  376. package/dist/components/ui/core/prompt-input/prompt-input.js.map +1 -0
  377. package/dist/components/ui/core/radio-group/radio-group.d.ts +12 -12
  378. package/dist/components/ui/core/radio-group/radio-group.gallery.d.ts +2 -0
  379. package/dist/components/ui/core/radio-group/radio-group.gallery.js +44 -0
  380. package/dist/components/ui/core/radio-group/radio-group.gallery.js.map +1 -0
  381. package/dist/components/ui/core/radio-group/radio-group.js +88 -58
  382. package/dist/components/ui/core/radio-group/radio-group.js.map +1 -0
  383. package/dist/components/ui/core/reasoning/reasoning.d.ts +7 -7
  384. package/dist/components/ui/core/reasoning/reasoning.js +68 -56
  385. package/dist/components/ui/core/reasoning/reasoning.js.map +1 -0
  386. package/dist/components/ui/core/scroll-area/scroll-area.d.ts +4 -4
  387. package/dist/components/ui/core/scroll-area/scroll-area.js +50 -40
  388. package/dist/components/ui/core/scroll-area/scroll-area.js.map +1 -0
  389. package/dist/components/ui/core/search/search.d.ts +8 -8
  390. package/dist/components/ui/core/search/search.js +122 -76
  391. package/dist/components/ui/core/search/search.js.map +1 -0
  392. package/dist/components/ui/core/segmented-control/segmented-control.d.ts +17 -11
  393. package/dist/components/ui/core/segmented-control/segmented-control.js +204 -108
  394. package/dist/components/ui/core/segmented-control/segmented-control.js.map +1 -0
  395. package/dist/components/ui/core/select/select.d.ts +33 -26
  396. package/dist/components/ui/core/select/select.js +262 -168
  397. package/dist/components/ui/core/select/select.js.map +1 -0
  398. package/dist/components/ui/core/separator/separator.d.ts +2 -2
  399. package/dist/components/ui/core/separator/separator.gallery.d.ts +2 -0
  400. package/dist/components/ui/core/separator/separator.gallery.js +63 -0
  401. package/dist/components/ui/core/separator/separator.gallery.js.map +1 -0
  402. package/dist/components/ui/core/separator/separator.js +13 -13
  403. package/dist/components/ui/core/separator/separator.js.map +1 -0
  404. package/dist/components/ui/core/shimmer/shimmer.d.ts +8 -8
  405. package/dist/components/ui/core/shimmer/shimmer.js +64 -40
  406. package/dist/components/ui/core/shimmer/shimmer.js.map +1 -0
  407. package/dist/components/ui/core/skeleton/skeleton.d.ts +2 -2
  408. package/dist/components/ui/core/skeleton/skeleton.gallery.d.ts +2 -0
  409. package/dist/components/ui/core/skeleton/skeleton.gallery.js +22 -0
  410. package/dist/components/ui/core/skeleton/skeleton.gallery.js.map +1 -0
  411. package/dist/components/ui/core/skeleton/skeleton.js +13 -13
  412. package/dist/components/ui/core/skeleton/skeleton.js.map +1 -0
  413. package/dist/components/ui/core/slider/slider.d.ts +7 -7
  414. package/dist/components/ui/core/slider/slider.gallery.d.ts +2 -0
  415. package/dist/components/ui/core/slider/slider.gallery.js +62 -0
  416. package/dist/components/ui/core/slider/slider.gallery.js.map +1 -0
  417. package/dist/components/ui/core/slider/slider.js +51 -39
  418. package/dist/components/ui/core/slider/slider.js.map +1 -0
  419. package/dist/components/ui/core/sonner-toast/sonner-toast.d.ts +2 -2
  420. package/dist/components/ui/core/sonner-toast/sonner-toast.js +67 -54
  421. package/dist/components/ui/core/sonner-toast/sonner-toast.js.map +1 -0
  422. package/dist/components/ui/core/sources/sources.d.ts +12 -12
  423. package/dist/components/ui/core/sources/sources.js +87 -58
  424. package/dist/components/ui/core/sources/sources.js.map +1 -0
  425. package/dist/components/ui/core/status-text/status-text.d.ts +4 -0
  426. package/dist/components/ui/core/status-text/status-text.js +14 -0
  427. package/dist/components/ui/core/status-text/status-text.js.map +1 -0
  428. package/dist/components/ui/core/switch/switch.d.ts +9 -9
  429. package/dist/components/ui/core/switch/switch.gallery.d.ts +2 -0
  430. package/dist/components/ui/core/switch/switch.gallery.js +67 -0
  431. package/dist/components/ui/core/switch/switch.gallery.js.map +1 -0
  432. package/dist/components/ui/core/switch/switch.js +83 -61
  433. package/dist/components/ui/core/switch/switch.js.map +1 -0
  434. package/dist/components/ui/core/switch/switch.metadata.d.ts +1 -1
  435. package/dist/components/ui/core/switch/switch.metadata.js +8 -0
  436. package/dist/components/ui/core/switch/switch.metadata.js.map +1 -0
  437. package/dist/components/ui/core/tabs/tabs.d.ts +20 -18
  438. package/dist/components/ui/core/tabs/tabs.js +176 -147
  439. package/dist/components/ui/core/tabs/tabs.js.map +1 -0
  440. package/dist/components/ui/core/tabs/tabs.utils.d.ts +1 -1
  441. package/dist/components/ui/core/tabs/tabs.utils.js +10 -6
  442. package/dist/components/ui/core/tabs/tabs.utils.js.map +1 -0
  443. package/dist/components/ui/core/textarea/textarea.d.ts +2 -2
  444. package/dist/components/ui/core/textarea/textarea.gallery.d.ts +2 -0
  445. package/dist/components/ui/core/textarea/textarea.gallery.js +51 -0
  446. package/dist/components/ui/core/textarea/textarea.gallery.js.map +1 -0
  447. package/dist/components/ui/core/textarea/textarea.js +13 -13
  448. package/dist/components/ui/core/textarea/textarea.js.map +1 -0
  449. package/dist/components/ui/core/toggle/toggle.d.ts +9 -9
  450. package/dist/components/ui/core/toggle/toggle.gallery.d.ts +2 -0
  451. package/dist/components/ui/core/toggle/toggle.gallery.js +32 -0
  452. package/dist/components/ui/core/toggle/toggle.gallery.js.map +1 -0
  453. package/dist/components/ui/core/toggle/toggle.js +60 -54
  454. package/dist/components/ui/core/toggle/toggle.js.map +1 -0
  455. package/dist/components/ui/core/tool/tool.d.ts +18 -18
  456. package/dist/components/ui/core/tool/tool.js +167 -126
  457. package/dist/components/ui/core/tool/tool.js.map +1 -0
  458. package/dist/components/ui/core/toolbar/toolbar.d.ts +37 -0
  459. package/dist/components/ui/core/toolbar/toolbar.js +171 -0
  460. package/dist/components/ui/core/toolbar/toolbar.js.map +1 -0
  461. package/dist/components/ui/core/tooltip/tooltip.d.ts +8 -7
  462. package/dist/components/ui/core/tooltip/tooltip.gallery.d.ts +2 -0
  463. package/dist/components/ui/core/tooltip/tooltip.gallery.js +52 -0
  464. package/dist/components/ui/core/tooltip/tooltip.gallery.js.map +1 -0
  465. package/dist/components/ui/core/tooltip/tooltip.js +53 -46
  466. package/dist/components/ui/core/tooltip/tooltip.js.map +1 -0
  467. package/dist/components/ui/core/topbar/topbar.d.ts +26 -26
  468. package/dist/components/ui/core/topbar/topbar.js +160 -105
  469. package/dist/components/ui/core/topbar/topbar.js.map +1 -0
  470. package/dist/components/ui/core/tree/tree.d.ts +20 -0
  471. package/dist/components/ui/core/tree/tree.js +100 -0
  472. package/dist/components/ui/core/tree/tree.js.map +1 -0
  473. package/dist/eslint/index.d.ts +5 -5
  474. package/dist/eslint/index.js +9 -5
  475. package/dist/eslint/index.js.map +1 -0
  476. package/dist/eslint/no-overriding-styles.d.ts +1 -1
  477. package/dist/eslint/no-overriding-styles.js +341 -201
  478. package/dist/eslint/no-overriding-styles.js.map +1 -0
  479. package/dist/icons/index.d.ts +1 -1
  480. package/dist/icons/index.js +2 -0
  481. package/dist/icons/index.js.map +1 -0
  482. package/dist/index.d.ts +1 -1
  483. package/dist/index.js +3 -0
  484. package/dist/index.js.map +1 -0
  485. package/dist/lib/ai/types.d.ts +43 -43
  486. package/dist/lib/ai/types.js +3 -0
  487. package/dist/lib/ai/types.js.map +1 -0
  488. package/dist/lib/decorative-variant-classes.d.ts +53 -0
  489. package/dist/lib/decorative-variant-classes.js +58 -0
  490. package/dist/lib/decorative-variant-classes.js.map +1 -0
  491. package/dist/lib/highlight-code.d.ts +11 -8
  492. package/dist/lib/highlight-code.js +58 -40
  493. package/dist/lib/highlight-code.js.map +1 -0
  494. package/dist/lib/portal-container-context.d.ts +1 -1
  495. package/dist/lib/portal-container-context.js +8 -8
  496. package/dist/lib/portal-container-context.js.map +1 -0
  497. package/dist/lib/shared-theme-from-url.d.ts +13 -0
  498. package/dist/lib/shared-theme-from-url.js +61 -0
  499. package/dist/lib/shared-theme-from-url.js.map +1 -0
  500. package/dist/lib/style-scope.d.ts +2 -2
  501. package/dist/lib/style-scope.js +6 -6
  502. package/dist/lib/style-scope.js.map +1 -0
  503. package/dist/lib/theme-share-url.d.ts +31 -0
  504. package/dist/lib/theme-share-url.js +116 -0
  505. package/dist/lib/theme-share-url.js.map +1 -0
  506. package/dist/lib/types.d.ts +39 -39
  507. package/dist/lib/types.js +3 -0
  508. package/dist/lib/types.js.map +1 -0
  509. package/dist/lib/use-controllable-state.d.ts +4 -7
  510. package/dist/lib/use-controllable-state.js +34 -21
  511. package/dist/lib/use-controllable-state.js.map +1 -0
  512. package/dist/lib/utils.d.ts +63 -34
  513. package/dist/lib/utils.js +134 -32
  514. package/dist/lib/utils.js.map +1 -0
  515. package/dist/styles.css +2 -1
  516. package/dist/styles.source.css +46 -16
  517. package/dist/utils/assign-ref.d.ts +3 -0
  518. package/dist/utils/assign-ref.js +13 -0
  519. package/dist/utils/assign-ref.js.map +1 -0
  520. package/package.json +53 -14
  521. package/src/components/ui/core/alert/alert.md +46 -0
  522. package/src/components/ui/core/avatar/avatar.md +30 -0
  523. package/src/components/ui/core/badge/badge.md +32 -0
  524. package/src/components/ui/core/banner/banner.md +51 -0
  525. package/src/components/ui/core/breadcrumb/breadcrumb.md +45 -0
  526. package/src/components/ui/core/button/button.md +93 -0
  527. package/src/components/ui/core/button-group/button-group.md +38 -0
  528. package/src/components/ui/core/checkbox/checkbox.md +37 -0
  529. package/src/components/ui/core/collapsible/collapsible.md +42 -0
  530. package/src/components/ui/core/count/count.md +33 -0
  531. package/src/components/ui/core/input/input.md +48 -0
  532. package/src/components/ui/core/label/label.md +35 -0
  533. package/src/components/ui/core/radio-group/radio-group.md +38 -0
  534. package/src/components/ui/core/separator/separator.md +32 -0
  535. package/src/components/ui/core/skeleton/skeleton.md +33 -0
  536. package/src/components/ui/core/slider/slider.md +41 -0
  537. package/src/components/ui/core/switch/switch.md +26 -0
  538. package/src/components/ui/core/textarea/textarea.md +42 -0
  539. package/src/components/ui/core/toggle/toggle.md +39 -0
  540. package/src/components/ui/core/tooltip/tooltip.md +41 -0
@@ -1,318 +1,460 @@
1
- import { cn as e, getInitials as t } from "../../../../lib/utils.js";
2
- import { Button as n } from "../button/button.js";
3
- import { Tooltip as r, TooltipContent as i, TooltipTrigger as a } from "../tooltip/tooltip.js";
4
- import { ButtonGroup as o, ButtonGroupText as s } from "../button-group/button-group.js";
5
- import { Avatar as c, AvatarFallback as l, AvatarIcon as u, AvatarImage as d } from "../avatar/avatar.js";
6
- import { MESSAGE_RESPONSE_DEFAULT_STREAMDOWN_CONTROLS as f } from "./message-response-default-streamdown-controls.js";
7
- import { createContext as p, useCallback as m, useContext as h, useEffect as g, useMemo as _, useState as v } from "react";
8
- import { IconChevronLeft as y, IconChevronRight as b, IconPaperclip as x, IconX as S } from "@tabler/icons-react";
9
- import { Fragment as C, jsx as w, jsxs as T } from "react/jsx-runtime";
10
- import { mermaid as E } from "@streamdown/mermaid";
11
- import { Streamdown as D } from "streamdown";
12
- //#region libs/aura/src/components/ui/core/message/message.tsx
13
- var O = ({ className: t, isResponse: n = !1, ...r }) => /* @__PURE__ */ w("div", {
14
- "data-slot": "message",
15
- className: e("group flex w-full items-start justify-start gap-3 mb-0 py-3", n ? "is-assistant items-start" : "is-user flex-row-reverse", t),
16
- ...r
17
- }), k = ({ children: t, className: n, ...r }) => /* @__PURE__ */ w("div", {
18
- "data-slot": "message-content",
19
- className: e("is-user:dark flex flex-col gap-4 rounded-md text-base leading-tight tracking-tightest", "max-w-4/5", "group-[.is-user]:overflow-hidden group-[.is-user]:bg-accent-background group-[.is-user]:p-2 group-[.is-user]:text-foreground", "group-[.is-assistant]:text-foreground group-[.is-assistant]:pt-1", n),
20
- ...r,
21
- children: t
22
- }), A = ({ avatarUrl: n, name: r, className: i, children: a, variant: o, sizes: s, ...u }) => {
23
- let f = r ? t(r) : "ME";
24
- return /* @__PURE__ */ w(c, {
25
- "data-slot": "message-avatar",
26
- className: e("size-7 group-[.is-user]:mt-1", i),
27
- variant: o,
28
- sizes: s,
29
- ...u,
30
- children: a || /* @__PURE__ */ T(C, { children: [n && /* @__PURE__ */ w(d, {
31
- alt: r || "",
32
- className: "mt-0 mb-0",
33
- src: n
34
- }), /* @__PURE__ */ w(l, { children: f })] })
35
- });
36
- }, j = (e) => /* @__PURE__ */ w(u, {
37
- "data-slot": "message-avatar-icon",
38
- ...e
39
- }), M = ({ className: t, children: n, ...r }) => /* @__PURE__ */ w("div", {
40
- "data-slot": "message-actions",
41
- className: e("flex items-center gap-2 pt-2", t),
42
- ...r,
43
- children: n
44
- }), N = ({ tooltip: t, children: o, label: s, className: c, variant: l = "ghost", size: u = "sm", ...d }) => {
45
- let f = /* @__PURE__ */ T(n, {
46
- "data-slot": "message-action",
47
- className: e("relative icon-sm text-muted-foreground hover:text-foreground", c),
48
- size: u,
49
- type: "button",
50
- variant: l,
51
- ...d,
52
- children: [o, /* @__PURE__ */ w("span", {
53
- className: "sr-only",
54
- children: s || t
55
- })]
56
- });
57
- return t ? /* @__PURE__ */ T(r, { children: [/* @__PURE__ */ w(a, { render: f }), /* @__PURE__ */ w(i, { children: /* @__PURE__ */ w("p", { children: t }) })] }) : f;
58
- }, P = p(null), F = () => {
59
- let e = h(P);
60
- if (!e) throw Error("MessageBranch components must be used within MessageBranch");
61
- return e;
62
- }, I = ({ defaultBranch: t = 0, onBranchChange: n, className: r, ...i }) => {
63
- let [a, o] = v(t), [s, c] = v([]), l = m(() => {
64
- o((e) => {
65
- let t = e > 0 ? e - 1 : s.length - 1;
66
- return n?.(t), t;
67
- });
68
- }, [s.length, n]), u = m(() => {
69
- o((e) => {
70
- let t = e < s.length - 1 ? e + 1 : 0;
71
- return n?.(t), t;
72
- });
73
- }, [s.length, n]), d = _(() => ({
74
- currentBranch: a,
75
- totalBranches: s.length,
76
- goToPrevious: l,
77
- goToNext: u,
78
- branches: s,
79
- setBranches: c
80
- }), [
81
- a,
82
- s,
83
- l,
84
- u,
85
- c
86
- ]);
87
- return /* @__PURE__ */ w(P.Provider, {
88
- value: d,
89
- children: /* @__PURE__ */ w("div", {
90
- "data-slot": "message-branch",
91
- className: e("grid w-full gap-2 [&>div]:pb-0", r),
92
- ...i
93
- })
94
- });
95
- }, L = ({ children: t, ...n }) => {
96
- let { currentBranch: r, setBranches: i, branches: a } = F(), o = _(() => Array.isArray(t) ? t : [t], [t]);
97
- return g(() => {
98
- a.length !== o.length && i(o);
99
- }, [
100
- o,
101
- a,
102
- i
103
- ]), o.map((t, i) => /* @__PURE__ */ w("div", {
104
- "data-slot": "message-branch-content",
105
- className: e("grid gap-2 overflow-hidden [&>div]:pb-0", i === r ? "block" : "hidden"),
106
- ...n,
107
- children: t
108
- }, t.key));
109
- }, R = ({ ...e }) => {
110
- let { totalBranches: t } = F();
111
- return t <= 1 ? null : /* @__PURE__ */ w(o, {
112
- "data-slot": "message-branch-selector",
113
- className: "[&>*:not(:first-child)]:rounded-l-md [&>*:not(:last-child)]:rounded-r-md",
114
- orientation: "horizontal",
115
- ...e
116
- });
117
- }, z = ({ children: e, ...t }) => {
118
- let { goToPrevious: r, totalBranches: i } = F();
119
- return /* @__PURE__ */ w(n, {
120
- "data-slot": "message-branch-previous",
121
- "aria-label": "Previous branch",
122
- disabled: i <= 1,
123
- onClick: r,
124
- size: "icon-sm",
125
- type: "button",
126
- variant: "ghost",
127
- ...t,
128
- children: e ?? /* @__PURE__ */ w(y, { size: 14 })
129
- });
130
- }, B = ({ children: e, ...t }) => {
131
- let { goToNext: r, totalBranches: i } = F();
132
- return /* @__PURE__ */ w(n, {
133
- "data-slot": "message-branch-next",
134
- "aria-label": "Next branch",
135
- disabled: i <= 1,
136
- onClick: r,
137
- size: "icon-sm",
138
- type: "button",
139
- variant: "ghost",
140
- ...t,
141
- children: e ?? /* @__PURE__ */ w(b, { size: 14 })
142
- });
143
- }, V = ({ className: t, ...n }) => {
144
- let { currentBranch: r, totalBranches: i } = F();
145
- return /* @__PURE__ */ T(s, {
146
- "data-slot": "message-branch-page",
147
- className: e("border-none bg-transparent text-muted-foreground shadow-none px-2", t),
148
- ...n,
149
- children: [
150
- r + 1,
151
- "/",
152
- i
153
- ]
154
- });
155
- }, H = {
156
- h1: ({ children: e }) => /* @__PURE__ */ w("h1", {
157
- className: "mt-0 mb-2 scroll-m-20 text-xl font-medium tracking-tightest",
158
- children: e
159
- }),
160
- h2: ({ children: e }) => /* @__PURE__ */ w("h2", {
161
- className: "mt-4 mb-1 scroll-m-20 text-lg font-medium tracking-tightest",
162
- children: e
163
- }),
164
- h3: ({ children: e }) => /* @__PURE__ */ w("h3", {
165
- className: "mt-4 mb-1 scroll-m-20 text-base font-medium tracking-tighter",
166
- children: e
167
- }),
168
- h4: ({ children: e }) => /* @__PURE__ */ w("h4", {
169
- className: "mt-2 mb-0 scroll-m-20 text-sm font-medium tracking-normal",
170
- children: e
171
- }),
172
- h5: ({ children: e }) => /* @__PURE__ */ w("h5", {
173
- className: "mt-0 mb-0 scroll-m-20 text-xs font-medium tracking-tighter",
174
- children: e
175
- }),
176
- h6: ({ children: e }) => /* @__PURE__ */ w("h6", {
177
- className: "mt-0 mb-0 scroll-m-20 text-2xs font-medium tracking-tighter",
178
- children: e
179
- }),
180
- p: ({ children: e }) => /* @__PURE__ */ w("p", {
181
- className: "mt-2 mb-3 text-base font-normal leading-5 tracking-tightest",
182
- children: e
183
- }),
184
- strong: ({ children: e }) => /* @__PURE__ */ w("strong", {
185
- className: "font-medium",
186
- children: e
187
- }),
188
- em: ({ children: e }) => /* @__PURE__ */ w("em", {
189
- className: "italic",
190
- children: e
191
- }),
192
- b: ({ children: e }) => /* @__PURE__ */ w("b", {
193
- className: "font-medium",
194
- children: e
195
- }),
196
- i: ({ children: e }) => /* @__PURE__ */ w("i", {
197
- className: "italic",
198
- children: e
199
- }),
200
- ul: ({ children: e }) => /* @__PURE__ */ w("ul", {
201
- className: "ml-8.25 mb-3 pt-2 pl-0 pb-0 list-disc text-base font-normal tracking-tightest",
202
- children: e
203
- }),
204
- ol: ({ children: e }) => /* @__PURE__ */ w("ol", {
205
- className: "ml-8.25 mb-3 pt-2 pl-0 pb-0 list-decimal text-base font-normal tracking-tightest",
206
- children: e
207
- }),
208
- li: ({ children: e }) => /* @__PURE__ */ w("li", {
209
- className: "py-0",
210
- children: e
211
- }),
212
- blockquote: ({ children: e }) => /* @__PURE__ */ w("blockquote", {
213
- className: "my-3 pr-2 pl-2 border-l border-l-border text-sm text-muted-foreground font-normal tracking-tight not-italic",
214
- children: e
215
- }),
216
- hr: () => /* @__PURE__ */ w("hr", { className: "my-4 border-border" }),
217
- a: ({ children: e, href: t, ...n }) => /* @__PURE__ */ w("a", {
218
- className: "text-link-foreground no-underline hover:underline underline-offset-4",
219
- href: t,
220
- ...n,
221
- children: e
222
- }),
223
- table: ({ children: e }) => /* @__PURE__ */ w("div", {
224
- className: "my-6 overflow-x-auto",
225
- tabIndex: 0,
226
- role: "group",
227
- "aria-label": "Atlas AI Chat Table",
228
- children: /* @__PURE__ */ w("table", {
229
- className: "w-full",
230
- children: e
231
- })
232
- }),
233
- thead: ({ children: e }) => /* @__PURE__ */ w("thead", { children: e }),
234
- tbody: ({ children: e }) => /* @__PURE__ */ w("tbody", { children: e }),
235
- tr: ({ children: e }) => /* @__PURE__ */ w("tr", {
236
- className: "m-0 border-t p-0 even:bg-muted-background",
237
- children: e
238
- }),
239
- th: ({ children: e }) => /* @__PURE__ */ w("th", {
240
- className: "border px-4 py-2 text-left font-bold",
241
- children: e
242
- }),
243
- td: ({ children: e }) => /* @__PURE__ */ w("td", {
244
- className: "border px-4 py-2 text-left",
245
- children: e
246
- })
247
- }, U = ({ className: t, components: n, plugins: r, controls: i, ...a }) => /* @__PURE__ */ w(D, {
248
- "data-slot": "message-response",
249
- className: e("size-full", "[&_blockquote_p]:text-sm", "[&_blockquote_p]:tracking-tight", "[&_code]:relative", "[&_code]:rounded", "[&_code]:bg-muted-background", "[&_code]:px-[0.3rem]", "[&_code]:py-[0.2rem]", "[&_code]:font-mono", "[&_code]:text-sm", "[&_code]:font-semibold", "[&_div[data-streamdown=\"code-block\"]]:my-4", "[&_div[data-streamdown=\"code-block\"]]:w-full", "[&_div[data-streamdown=\"code-block\"]]:overflow-hidden", "[&_div[data-streamdown=\"code-block\"]]:rounded-xl", "[&_div[data-streamdown=\"code-block\"]]:border", "[&_div[data-streamdown=\"code-block\"]]:border-border", "[&_div[data-streamdown=\"code-block-header\"]]:flex", "[&_div[data-streamdown=\"code-block-header\"]]:items-center", "[&_div[data-streamdown=\"code-block-header\"]]:justify-between", "[&_div[data-streamdown=\"code-block-header\"]]:bg-muted-background/80", "[&_div[data-streamdown=\"code-block-header\"]]:px-4", "[&_div[data-streamdown=\"code-block-header\"]]:py-3", "[&_div[data-streamdown=\"code-block-header\"]]:text-xs", "[&_div[data-streamdown=\"code-block-header\"]]:text-muted-foreground", "[&_div[data-streamdown=\"code-block\"]_pre]:m-0", "[&_div[data-streamdown=\"code-block\"]_pre]:overflow-x-auto", "[&_div[data-streamdown=\"code-block\"]_pre]:border-t", "[&_div[data-streamdown=\"code-block\"]_pre]:border-border", "[&_div[data-streamdown=\"code-block\"]_pre]:bg-background!", "[&_div[data-streamdown=\"code-block\"]_pre]:p-4", "[&_div[data-streamdown=\"code-block\"]_pre]:text-sm", "[&_div[data-streamdown=\"code-block\"]_pre]:text-foreground!", "[&_div[data-streamdown=\"code-block\"]_pre_code]:static", "[&_div[data-streamdown=\"code-block\"]_pre_code]:rounded-none", "[&_div[data-streamdown=\"code-block\"]_pre_code]:bg-transparent", "[&_div[data-streamdown=\"code-block\"]_pre_code]:p-0", "[&_div[data-streamdown=\"code-block\"]_pre_code]:font-mono", "[&_div[data-streamdown=\"code-block\"]_pre_code]:text-sm", "[&_div[data-streamdown=\"code-block\"]_pre_code]:font-normal", "[&_button[data-streamdown=\"code-block-copy-button\"]]:cursor-pointer", "[&_button[data-streamdown=\"code-block-copy-button\"]]:p-1", "[&_button[data-streamdown=\"code-block-copy-button\"]]:text-muted-foreground", "[&_button[data-streamdown=\"code-block-copy-button\"]]:transition-all", "[&_button[data-streamdown=\"code-block-copy-button\"]]:hover:text-foreground", "[&_button[data-streamdown=\"code-block-download-button\"]]:cursor-pointer", "[&_button[data-streamdown=\"code-block-download-button\"]]:p-1", "[&_button[data-streamdown=\"code-block-download-button\"]]:text-muted-foreground", "[&_button[data-streamdown=\"code-block-download-button\"]]:transition-all", "[&_button[data-streamdown=\"code-block-download-button\"]]:hover:text-foreground", "[&_pre:not([data-streamdown])]:my-3", "[&_pre:not([data-streamdown])]:mx-0", "[&_pre:not([data-streamdown])]:overflow-x-auto", "[&_pre:not([data-streamdown])]:rounded-md", "[&_pre:not([data-streamdown])]:border", "[&_pre:not([data-streamdown])]:bg-card-background", "[&_pre:not([data-streamdown])]:p-4", "[&_pre:not([data-streamdown])]:text-foreground", "[&_pre:not([data-streamdown])]:text-sm", "[&_pre:not([data-streamdown])_code]:static", "[&_pre:not([data-streamdown])_code]:rounded-none", "[&_pre:not([data-streamdown])_code]:bg-transparent", "[&_pre:not([data-streamdown])_code]:px-0", "[&_pre:not([data-streamdown])_code]:py-0", "[&_pre:not([data-streamdown])_code]:font-mono", "[&_pre:not([data-streamdown])_code]:text-sm", "[&_pre:not([data-streamdown])_code]:font-normal", "[&_div[data-streamdown=\"mermaid-block\"]]:bg-card-background", "[&_div[data-streamdown=\"mermaid-block\"]]:text-foreground", "[&_div[data-streamdown=\"mermaid-block\"]]:flex", "[&_div[data-streamdown=\"mermaid-block\"]]:flex-col", "[&_div[data-streamdown=\"mermaid-block\"]]:rounded-lg", "[&_div[data-streamdown=\"mermaid-block\"]]:hover:bg-accent-background", "[&_div[data-streamdown=\"mermaid-block\"]]:border-0", "[&_div[data-streamdown=\"mermaid-block\"]]:relative", "[&_div[data-streamdown=\"mermaid-block\"]>div:has([data-streamdown=\"mermaid-block-actions\"])]:!absolute", "[&_div[data-streamdown=\"mermaid-block\"]>div:has([data-streamdown=\"mermaid-block-actions\"])]:!top-2", "[&_div[data-streamdown=\"mermaid-block\"]>div:has([data-streamdown=\"mermaid-block-actions\"])]:!right-2", "[&_div[data-streamdown=\"mermaid-block\"]>div:has([data-streamdown=\"mermaid-block-actions\"])]:!z-10", "[&_div[data-streamdown=\"mermaid-block\"]>div:has([data-streamdown=\"mermaid-block-actions\"])]:!mt-0", "[&_div[data-streamdown=\"mermaid-block\"]>div:has([data-streamdown=\"mermaid-block-actions\"])]:!pointer-events-auto", "[&_div[data-streamdown=\"mermaid-block\"]_.relative.w-full]:!min-h-28", "[&>*:first-child]:mt-0", "[&>*:last-child]:mb-0", t),
250
- components: {
251
- ...H,
252
- ...n
253
- },
254
- controls: i ?? f,
255
- plugins: {
256
- ...r,
257
- mermaid: E
258
- },
259
- ...a
260
- });
261
- function W({ data: t, className: o, onRemove: s, ...c }) {
262
- let l = t.filename || "", u = (t.mediaType?.startsWith("image/") && t.url ? "image" : "file") == "image", d = l || (u ? "Image" : "Attachment");
263
- return /* @__PURE__ */ w("div", {
264
- "data-slot": "message-attachment",
265
- className: e("group relative size-24 overflow-hidden rounded-lg", o),
266
- ...c,
267
- children: u ? /* @__PURE__ */ T(C, { children: [/* @__PURE__ */ w("img", {
268
- alt: l || "attachment",
269
- className: "size-full object-cover",
270
- height: 100,
271
- src: t.url,
272
- width: 100
273
- }), s && /* @__PURE__ */ T(n, {
274
- "aria-label": "Remove attachment",
275
- className: "absolute top-2 right-2 size-6 rounded-full bg-background/80 p-0 opacity-0 backdrop-blur-sm transition-opacity hover:bg-background group-hover:opacity-100 [&>svg]:size-3",
276
- onClick: (e) => {
277
- e.stopPropagation(), s();
278
- },
279
- type: "button",
280
- variant: "ghost",
281
- children: [/* @__PURE__ */ w(S, {}), /* @__PURE__ */ w("span", {
282
- className: "sr-only",
283
- children: "Remove"
284
- })]
285
- })] }) : /* @__PURE__ */ T(C, { children: [/* @__PURE__ */ T(r, { children: [/* @__PURE__ */ w(a, { render: /* @__PURE__ */ w("div", {
286
- className: "flex size-full shrink-0 items-center justify-center rounded-lg bg-muted-background text-muted-foreground",
287
- children: /* @__PURE__ */ w(x, { className: "size-4" })
288
- }) }), /* @__PURE__ */ w(i, { children: /* @__PURE__ */ w("p", { children: d }) })] }), s && /* @__PURE__ */ T(n, {
289
- "aria-label": "Remove attachment",
290
- className: "size-6 shrink-0 rounded-full p-0 opacity-0 transition-opacity hover:bg-accent-background group-hover:opacity-100 [&>svg]:size-3",
291
- onClick: (e) => {
292
- e.stopPropagation(), s();
293
- },
294
- type: "button",
295
- variant: "ghost",
296
- children: [/* @__PURE__ */ w(S, {}), /* @__PURE__ */ w("span", {
297
- className: "sr-only",
298
- children: "Remove"
299
- })]
300
- })] })
301
- });
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { createContext, useCallback, useContext, useEffect, useMemo, useState } from "react";
3
+ import { mermaid as mermaidPlugin } from "@streamdown/mermaid";
4
+ import { IconChevronLeft, IconChevronRight, IconPaperclip, IconX } from "@tabler/icons-react";
5
+ import { Streamdown } from "streamdown";
6
+ import { usePortalContainer } from "../../../../lib/portal-container-context.js";
7
+ import { cn, getInitials } from "../../../../lib/utils.js";
8
+ import { Avatar, AvatarFallback, AvatarIcon, AvatarImage } from "../avatar/avatar.js";
9
+ import { Button } from "../button/button.js";
10
+ import { ButtonGroup, ButtonGroupText } from "../button-group/button-group.js";
11
+ import { Tooltip, TooltipContent, TooltipTrigger } from "../tooltip/tooltip.js";
12
+ import { MESSAGE_RESPONSE_DEFAULT_STREAMDOWN_CONTROLS } from "./message-response-default-streamdown-controls.js";
13
+ const Message = ({ className, isResponse = false, ...props })=>/*#__PURE__*/ _jsx("div", {
14
+ "data-slot": "message",
15
+ className: cn('group flex w-full items-start justify-start gap-3 mb-0 py-3', isResponse ? 'is-assistant items-start' : 'is-user flex-row-reverse', className),
16
+ ...props
17
+ });
18
+ const MessageContent = ({ children, className, ...props })=>/*#__PURE__*/ _jsx("div", {
19
+ "data-slot": "message-content",
20
+ className: cn('is-user:dark flex flex-col gap-4 rounded-md text-base leading-tight tracking-tightest', 'max-w-4/5', 'group-[.is-user]:overflow-hidden group-[.is-user]:bg-medium-background group-[.is-user]:p-2 group-[.is-user]:text-base-foreground', 'group-[.is-assistant]:text-base-foreground group-[.is-assistant]:pt-1', className),
21
+ ...props,
22
+ children: children
23
+ });
24
+ const MessageAvatar = ({ avatarUrl, name, className, children, variant, sizes, ...props })=>{
25
+ const fallbackText = name ? getInitials(name) : 'ME';
26
+ return /*#__PURE__*/ _jsx(Avatar, {
27
+ "data-slot": "message-avatar",
28
+ className: cn('size-7 group-[.is-user]:mt-1', className),
29
+ variant: variant,
30
+ sizes: sizes,
31
+ ...props,
32
+ children: children || /*#__PURE__*/ _jsxs(_Fragment, {
33
+ children: [
34
+ avatarUrl && /*#__PURE__*/ _jsx(AvatarImage, {
35
+ alt: name || '',
36
+ className: "mt-0 mb-0",
37
+ src: avatarUrl
38
+ }),
39
+ /*#__PURE__*/ _jsx(AvatarFallback, {
40
+ children: fallbackText
41
+ })
42
+ ]
43
+ })
44
+ });
45
+ };
46
+ const MessageAvatarIcon = (props)=>/*#__PURE__*/ _jsx(AvatarIcon, {
47
+ "data-slot": "message-avatar-icon",
48
+ ...props
49
+ });
50
+ const MessageActions = ({ className, children, ...props })=>/*#__PURE__*/ _jsx("div", {
51
+ "data-slot": "message-actions",
52
+ className: cn('flex items-center gap-2 pt-2', className),
53
+ ...props,
54
+ children: children
55
+ });
56
+ const MessageAction = ({ tooltip, children, label, className, variant = 'ghost', size = 'sm', ...props })=>{
57
+ const button = /*#__PURE__*/ _jsxs(Button, {
58
+ "data-slot": "message-action",
59
+ className: cn('relative icon-sm text-muted-foreground hover:text-base-foreground', className),
60
+ size: size,
61
+ type: "button",
62
+ variant: variant,
63
+ ...props,
64
+ children: [
65
+ children,
66
+ /*#__PURE__*/ _jsx("span", {
67
+ className: "sr-only",
68
+ children: label || tooltip
69
+ })
70
+ ]
71
+ });
72
+ if (tooltip) {
73
+ return /*#__PURE__*/ _jsxs(Tooltip, {
74
+ children: [
75
+ /*#__PURE__*/ _jsx(TooltipTrigger, {
76
+ render: button
77
+ }),
78
+ /*#__PURE__*/ _jsx(TooltipContent, {
79
+ children: /*#__PURE__*/ _jsx("p", {
80
+ children: tooltip
81
+ })
82
+ })
83
+ ]
84
+ });
85
+ }
86
+ return button;
87
+ };
88
+ const MessageBranchContext = /*#__PURE__*/ createContext(null);
89
+ const useMessageBranch = ()=>{
90
+ const context = useContext(MessageBranchContext);
91
+ if (!context) {
92
+ throw new Error('MessageBranch components must be used within MessageBranch');
93
+ }
94
+ return context;
95
+ };
96
+ const MessageBranch = ({ defaultBranch = 0, onBranchChange, className, ...props })=>{
97
+ const [currentBranch, setCurrentBranch] = useState(defaultBranch);
98
+ const [branches, setBranches] = useState([]);
99
+ const goToPrevious = useCallback(()=>{
100
+ setCurrentBranch((prev)=>{
101
+ const newBranch = prev > 0 ? prev - 1 : branches.length - 1;
102
+ onBranchChange?.(newBranch);
103
+ return newBranch;
104
+ });
105
+ }, [
106
+ branches.length,
107
+ onBranchChange
108
+ ]);
109
+ const goToNext = useCallback(()=>{
110
+ setCurrentBranch((prev)=>{
111
+ const newBranch = prev < branches.length - 1 ? prev + 1 : 0;
112
+ onBranchChange?.(newBranch);
113
+ return newBranch;
114
+ });
115
+ }, [
116
+ branches.length,
117
+ onBranchChange
118
+ ]);
119
+ const contextValue = useMemo(()=>({
120
+ currentBranch,
121
+ totalBranches: branches.length,
122
+ goToPrevious,
123
+ goToNext,
124
+ branches,
125
+ setBranches
126
+ }), [
127
+ currentBranch,
128
+ branches,
129
+ goToPrevious,
130
+ goToNext,
131
+ setBranches
132
+ ]);
133
+ return /*#__PURE__*/ _jsx(MessageBranchContext.Provider, {
134
+ value: contextValue,
135
+ children: /*#__PURE__*/ _jsx("div", {
136
+ "data-slot": "message-branch",
137
+ className: cn('grid w-full gap-2 [&>div]:pb-0', className),
138
+ ...props
139
+ })
140
+ });
141
+ };
142
+ const MessageBranchContent = ({ children, ...props })=>{
143
+ const { currentBranch, setBranches, branches } = useMessageBranch();
144
+ const childrenArray = useMemo(()=>Array.isArray(children) ? children : [
145
+ children
146
+ ], [
147
+ children
148
+ ]);
149
+ useEffect(()=>{
150
+ if (branches.length !== childrenArray.length) {
151
+ setBranches(childrenArray);
152
+ }
153
+ }, [
154
+ childrenArray,
155
+ branches,
156
+ setBranches
157
+ ]);
158
+ return childrenArray.map((branch, index)=>/*#__PURE__*/ _jsx("div", {
159
+ "data-slot": "message-branch-content",
160
+ className: cn('grid gap-2 overflow-hidden [&>div]:pb-0', index === currentBranch ? 'block' : 'hidden'),
161
+ ...props,
162
+ children: branch
163
+ }, branch.key));
164
+ };
165
+ const MessageBranchSelector = ({ ...props })=>{
166
+ const { totalBranches } = useMessageBranch();
167
+ if (totalBranches <= 1) {
168
+ return null;
169
+ }
170
+ return /*#__PURE__*/ _jsx(ButtonGroup, {
171
+ "data-slot": "message-branch-selector",
172
+ className: "[&>*:not(:first-child)]:rounded-l-md [&>*:not(:last-child)]:rounded-r-md",
173
+ orientation: "horizontal",
174
+ ...props
175
+ });
176
+ };
177
+ const MessageBranchPrevious = ({ children, ...props })=>{
178
+ const { goToPrevious, totalBranches } = useMessageBranch();
179
+ return /*#__PURE__*/ _jsx(Button, {
180
+ "data-slot": "message-branch-previous",
181
+ "aria-label": "Previous branch",
182
+ disabled: totalBranches <= 1,
183
+ onClick: goToPrevious,
184
+ size: "icon-sm",
185
+ type: "button",
186
+ variant: "ghost",
187
+ ...props,
188
+ children: children ?? /*#__PURE__*/ _jsx(IconChevronLeft, {
189
+ size: 14
190
+ })
191
+ });
192
+ };
193
+ const MessageBranchNext = ({ children, ...props })=>{
194
+ const { goToNext, totalBranches } = useMessageBranch();
195
+ return /*#__PURE__*/ _jsx(Button, {
196
+ "data-slot": "message-branch-next",
197
+ "aria-label": "Next branch",
198
+ disabled: totalBranches <= 1,
199
+ onClick: goToNext,
200
+ size: "icon-sm",
201
+ type: "button",
202
+ variant: "ghost",
203
+ ...props,
204
+ children: children ?? /*#__PURE__*/ _jsx(IconChevronRight, {
205
+ size: 14
206
+ })
207
+ });
208
+ };
209
+ const MessageBranchPage = ({ className, ...props })=>{
210
+ const { currentBranch, totalBranches } = useMessageBranch();
211
+ return /*#__PURE__*/ _jsxs(ButtonGroupText, {
212
+ "data-slot": "message-branch-page",
213
+ className: cn('border-none bg-transparent text-muted-foreground shadow-none px-2', className),
214
+ ...props,
215
+ children: [
216
+ currentBranch + 1,
217
+ "/",
218
+ totalBranches
219
+ ]
220
+ });
221
+ };
222
+ const messageResponseComponents = {
223
+ h1: ({ children })=>/*#__PURE__*/ _jsx("h1", {
224
+ className: "mt-0 mb-2 scroll-m-20 text-xl font-medium tracking-tightest",
225
+ children: children
226
+ }),
227
+ h2: ({ children })=>/*#__PURE__*/ _jsx("h2", {
228
+ className: "mt-4 mb-1 scroll-m-20 text-lg font-medium tracking-tightest",
229
+ children: children
230
+ }),
231
+ h3: ({ children })=>/*#__PURE__*/ _jsx("h3", {
232
+ className: "mt-4 mb-1 scroll-m-20 text-base font-medium tracking-tighter",
233
+ children: children
234
+ }),
235
+ h4: ({ children })=>/*#__PURE__*/ _jsx("h4", {
236
+ className: "mt-2 mb-0 scroll-m-20 text-sm font-medium tracking-normal",
237
+ children: children
238
+ }),
239
+ h5: ({ children })=>/*#__PURE__*/ _jsx("h5", {
240
+ className: "mt-0 mb-0 scroll-m-20 text-xs font-medium tracking-tighter",
241
+ children: children
242
+ }),
243
+ h6: ({ children })=>/*#__PURE__*/ _jsx("h6", {
244
+ className: "mt-0 mb-0 scroll-m-20 text-2xs font-medium tracking-tighter",
245
+ children: children
246
+ }),
247
+ p: ({ children })=>/*#__PURE__*/ _jsx("p", {
248
+ className: "mt-2 mb-3 text-base font-normal leading-5 tracking-tightest",
249
+ children: children
250
+ }),
251
+ strong: ({ children })=>/*#__PURE__*/ _jsx("strong", {
252
+ className: "font-medium",
253
+ children: children
254
+ }),
255
+ em: ({ children })=>/*#__PURE__*/ _jsx("em", {
256
+ className: "italic",
257
+ children: children
258
+ }),
259
+ b: ({ children })=>/*#__PURE__*/ _jsx("b", {
260
+ className: "font-medium",
261
+ children: children
262
+ }),
263
+ i: ({ children })=>/*#__PURE__*/ _jsx("i", {
264
+ className: "italic",
265
+ children: children
266
+ }),
267
+ ul: ({ children })=>/*#__PURE__*/ _jsx("ul", {
268
+ className: "ml-8.25 mb-3 pt-2 pl-0 pb-0 list-disc text-base font-normal tracking-tightest",
269
+ children: children
270
+ }),
271
+ ol: ({ children })=>/*#__PURE__*/ _jsx("ol", {
272
+ className: "ml-8.25 mb-3 pt-2 pl-0 pb-0 list-decimal text-base font-normal tracking-tightest",
273
+ children: children
274
+ }),
275
+ li: ({ children })=>/*#__PURE__*/ _jsx("li", {
276
+ className: "py-0",
277
+ children: children
278
+ }),
279
+ blockquote: ({ children })=>/*#__PURE__*/ _jsx("blockquote", {
280
+ className: "my-3 pr-2 pl-2 border-l border-l-default text-sm text-muted-foreground font-normal tracking-tight not-italic",
281
+ children: children
282
+ }),
283
+ hr: ()=>/*#__PURE__*/ _jsx("hr", {
284
+ className: "my-4 border-default"
285
+ }),
286
+ a: ({ children, href, ...props })=>/*#__PURE__*/ _jsx("a", {
287
+ className: "text-link-foreground no-underline hover:underline underline-offset-4",
288
+ href: href,
289
+ ...props,
290
+ children: children
291
+ }),
292
+ table: ({ children })=>/*#__PURE__*/ _jsx("div", {
293
+ className: "my-6 overflow-x-auto",
294
+ tabIndex: 0,
295
+ role: "group",
296
+ "aria-label": "Atlas AI Chat Table",
297
+ children: /*#__PURE__*/ _jsx("table", {
298
+ className: "w-full",
299
+ children: children
300
+ })
301
+ }),
302
+ thead: ({ children })=>/*#__PURE__*/ _jsx("thead", {
303
+ children: children
304
+ }),
305
+ tbody: ({ children })=>/*#__PURE__*/ _jsx("tbody", {
306
+ children: children
307
+ }),
308
+ tr: ({ children })=>/*#__PURE__*/ _jsx("tr", {
309
+ className: "m-0 border-t p-0 even:bg-muted-background",
310
+ children: children
311
+ }),
312
+ th: ({ children })=>/*#__PURE__*/ _jsx("th", {
313
+ className: "border px-4 py-2 text-left font-bold",
314
+ children: children
315
+ }),
316
+ td: ({ children })=>/*#__PURE__*/ _jsx("td", {
317
+ className: "border px-4 py-2 text-left",
318
+ children: children
319
+ })
320
+ };
321
+ const MessageResponseMarkdown = ({ className, components, plugins, controls, portal, ...props })=>{
322
+ const portalContainer = usePortalContainer();
323
+ return /*#__PURE__*/ _jsx(Streamdown, {
324
+ className: cn('size-full', // Blockquote paragraph overrides
325
+ '[&_blockquote_p]:text-sm', '[&_blockquote_p]:tracking-tight', // Inline code
326
+ '[&_code]:relative', '[&_code]:rounded', '[&_code]:bg-muted-background', '[&_code]:px-[0.3rem]', '[&_code]:py-[0.2rem]', '[&_code]:font-mono', '[&_code]:text-sm', '[&_code]:font-semibold', // Code blocks (Streamdown container)
327
+ '[&_div[data-streamdown="code-block"]]:my-4', '[&_div[data-streamdown="code-block"]]:w-full', '[&_div[data-streamdown="code-block"]]:overflow-hidden', '[&_div[data-streamdown="code-block"]]:rounded-xl', '[&_div[data-streamdown="code-block"]]:border', '[&_div[data-streamdown="code-block"]]:border-default', // Code block header
328
+ '[&_div[data-streamdown="code-block-header"]]:flex', '[&_div[data-streamdown="code-block-header"]]:items-center', '[&_div[data-streamdown="code-block-header"]]:justify-between', '[&_div[data-streamdown="code-block-header"]]:bg-muted-background/80', '[&_div[data-streamdown="code-block-header"]]:px-4', '[&_div[data-streamdown="code-block-header"]]:py-3', '[&_div[data-streamdown="code-block-header"]]:text-xs', '[&_div[data-streamdown="code-block-header"]]:text-muted-foreground', // Pre element inside code block
329
+ '[&_div[data-streamdown="code-block"]_pre]:m-0', '[&_div[data-streamdown="code-block"]_pre]:overflow-x-auto', '[&_div[data-streamdown="code-block"]_pre]:border-t', '[&_div[data-streamdown="code-block"]_pre]:border-default', '[&_div[data-streamdown="code-block"]_pre]:bg-card-background!', '[&_div[data-streamdown="code-block"]_pre]:p-4', '[&_div[data-streamdown="code-block"]_pre]:text-sm', '[&_div[data-streamdown="code-block"]_pre]:text-medium-foreground!', // Code element inside pre
330
+ '[&_div[data-streamdown="code-block"]_pre_code]:static', '[&_div[data-streamdown="code-block"]_pre_code]:rounded-none', '[&_div[data-streamdown="code-block"]_pre_code]:bg-transparent', '[&_div[data-streamdown="code-block"]_pre_code]:p-0', '[&_div[data-streamdown="code-block"]_pre_code]:font-mono', '[&_div[data-streamdown="code-block"]_pre_code]:text-sm', '[&_div[data-streamdown="code-block"]_pre_code]:font-normal', // Code block buttons
331
+ '[&_button[data-streamdown="code-block-copy-button"]]:cursor-pointer', '[&_button[data-streamdown="code-block-copy-button"]]:p-1', '[&_button[data-streamdown="code-block-copy-button"]]:text-muted-foreground', '[&_button[data-streamdown="code-block-copy-button"]]:transition-all', '[&_button[data-streamdown="code-block-copy-button"]]:hover:text-base-foreground', '[&_button[data-streamdown="code-block-download-button"]]:cursor-pointer', '[&_button[data-streamdown="code-block-download-button"]]:p-1', '[&_button[data-streamdown="code-block-download-button"]]:text-muted-foreground', '[&_button[data-streamdown="code-block-download-button"]]:transition-all', '[&_button[data-streamdown="code-block-download-button"]]:hover:text-base-foreground', // Regular pre blocks (not in Streamdown code blocks)
332
+ '[&_pre:not([data-streamdown])]:my-3', '[&_pre:not([data-streamdown])]:mx-0', '[&_pre:not([data-streamdown])]:overflow-x-auto', '[&_pre:not([data-streamdown])]:rounded-md', '[&_pre:not([data-streamdown])]:border', '[&_pre:not([data-streamdown])]:bg-card-background', '[&_pre:not([data-streamdown])]:p-4', '[&_pre:not([data-streamdown])]:text-medium-foreground', '[&_pre:not([data-streamdown])]:text-sm', '[&_pre:not([data-streamdown])_code]:static', '[&_pre:not([data-streamdown])_code]:rounded-none', '[&_pre:not([data-streamdown])_code]:bg-transparent', '[&_pre:not([data-streamdown])_code]:px-0', '[&_pre:not([data-streamdown])_code]:py-0', '[&_pre:not([data-streamdown])_code]:font-mono', '[&_pre:not([data-streamdown])_code]:text-sm', '[&_pre:not([data-streamdown])_code]:font-normal', // Mermaid diagram blocks
333
+ '[&_div[data-streamdown="mermaid-block"]]:bg-card-background', '[&_div[data-streamdown="mermaid-block"]]:text-base-foreground', '[&_div[data-streamdown="mermaid-block"]]:flex', '[&_div[data-streamdown="mermaid-block"]]:flex-col', '[&_div[data-streamdown="mermaid-block"]]:rounded-lg', '[&_div[data-streamdown="mermaid-block"]]:hover:bg-base-background-hover', '[&_div[data-streamdown="mermaid-block"]]:border-0', // Positioning context for the action strip (see below)
334
+ '[&_div[data-streamdown="mermaid-block"]]:relative', // Nested scroll + sticky + pointer-events breaks hit-testing on Mermaid Copy/Download
335
+ // (same class of issue as github.com/vercel/streamdown/issues/494). Force absolute strip.
336
+ '[&_div[data-streamdown="mermaid-block"]>div:has([data-streamdown="mermaid-block-actions"])]:!absolute', '[&_div[data-streamdown="mermaid-block"]>div:has([data-streamdown="mermaid-block-actions"])]:!top-2', '[&_div[data-streamdown="mermaid-block"]>div:has([data-streamdown="mermaid-block-actions"])]:!right-2', '[&_div[data-streamdown="mermaid-block"]>div:has([data-streamdown="mermaid-block-actions"])]:!z-10', '[&_div[data-streamdown="mermaid-block"]>div:has([data-streamdown="mermaid-block-actions"])]:!mt-0', '[&_div[data-streamdown="mermaid-block"]>div:has([data-streamdown="mermaid-block-actions"])]:!pointer-events-auto', // Ensure mermaid container is tall enough for the toolbar (pan/zoom + actions)
337
+ '[&_div[data-streamdown="mermaid-block"]_.relative.w-full]:!min-h-28', // KaTeX sizing (overflow rules live in styles.source.css)
338
+ '[&_.katex-display]:my-3', '[&_.katex]:text-[1em]', // First and last child margin resets
339
+ '[&>*:first-child]:mt-0', '[&>*:last-child]:mb-0', className),
340
+ components: {
341
+ ...messageResponseComponents,
342
+ ...components
343
+ },
344
+ controls: controls ?? MESSAGE_RESPONSE_DEFAULT_STREAMDOWN_CONTROLS,
345
+ plugins: {
346
+ ...plugins,
347
+ mermaid: mermaidPlugin
348
+ },
349
+ portal: portal ?? portalContainer,
350
+ ...props
351
+ });
352
+ };
353
+ const MessageResponse = ({ id, role, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, 'aria-describedby': ariaDescribedBy, 'data-testid': dataTestId, ...props })=>/*#__PURE__*/ _jsx("div", {
354
+ "data-slot": "message-response",
355
+ id: id,
356
+ role: role,
357
+ "aria-label": ariaLabel,
358
+ "aria-labelledby": ariaLabelledBy,
359
+ "aria-describedby": ariaDescribedBy,
360
+ "data-testid": dataTestId,
361
+ children: /*#__PURE__*/ _jsx(MessageResponseMarkdown, {
362
+ ...props
363
+ })
364
+ });
365
+ function MessageAttachment({ data, className, onRemove, ...props }) {
366
+ const filename = data.filename || '';
367
+ const mediaType = data.mediaType?.startsWith('image/') && data.url ? 'image' : 'file';
368
+ const isImage = mediaType === 'image';
369
+ const attachmentLabel = filename || (isImage ? 'Image' : 'Attachment');
370
+ return /*#__PURE__*/ _jsx("div", {
371
+ "data-slot": "message-attachment",
372
+ className: cn('group relative size-24 overflow-hidden rounded-lg', className),
373
+ ...props,
374
+ children: isImage ? /*#__PURE__*/ _jsxs(_Fragment, {
375
+ children: [
376
+ /*#__PURE__*/ _jsx("img", {
377
+ alt: filename || 'attachment',
378
+ className: "size-full object-cover",
379
+ height: 100,
380
+ src: data.url,
381
+ width: 100
382
+ }),
383
+ onRemove && /*#__PURE__*/ _jsxs(Button, {
384
+ "aria-label": "Remove attachment",
385
+ className: "absolute top-2 right-2 size-6 rounded-full bg-card-background/80 p-0 opacity-0 backdrop-blur-sm transition-opacity hover:bg-card-background group-hover:opacity-100 [&>svg]:size-3",
386
+ onClick: (e)=>{
387
+ e.stopPropagation();
388
+ onRemove();
389
+ },
390
+ type: "button",
391
+ variant: "ghost",
392
+ children: [
393
+ /*#__PURE__*/ _jsx(IconX, {}),
394
+ /*#__PURE__*/ _jsx("span", {
395
+ className: "sr-only",
396
+ children: "Remove"
397
+ })
398
+ ]
399
+ })
400
+ ]
401
+ }) : /*#__PURE__*/ _jsxs(_Fragment, {
402
+ children: [
403
+ /*#__PURE__*/ _jsxs(Tooltip, {
404
+ children: [
405
+ /*#__PURE__*/ _jsx(TooltipTrigger, {
406
+ render: /*#__PURE__*/ _jsx("div", {
407
+ className: "flex size-full shrink-0 items-center justify-center rounded-lg bg-muted-background text-muted-foreground",
408
+ children: /*#__PURE__*/ _jsx(IconPaperclip, {
409
+ className: "size-4"
410
+ })
411
+ })
412
+ }),
413
+ /*#__PURE__*/ _jsx(TooltipContent, {
414
+ children: /*#__PURE__*/ _jsx("p", {
415
+ children: attachmentLabel
416
+ })
417
+ })
418
+ ]
419
+ }),
420
+ onRemove && /*#__PURE__*/ _jsxs(Button, {
421
+ "aria-label": "Remove attachment",
422
+ className: "size-6 shrink-0 rounded-full p-0 opacity-0 transition-opacity hover:bg-base-background-hover group-hover:opacity-100 [&>svg]:size-3",
423
+ onClick: (e)=>{
424
+ e.stopPropagation();
425
+ onRemove();
426
+ },
427
+ type: "button",
428
+ variant: "ghost",
429
+ children: [
430
+ /*#__PURE__*/ _jsx(IconX, {}),
431
+ /*#__PURE__*/ _jsx("span", {
432
+ className: "sr-only",
433
+ children: "Remove"
434
+ })
435
+ ]
436
+ })
437
+ ]
438
+ })
439
+ });
302
440
  }
303
- function G({ children: t, className: n, ...r }) {
304
- return t ? /* @__PURE__ */ w("div", {
305
- "data-slot": "message-attachments",
306
- className: e("ml-auto flex w-fit flex-wrap items-start gap-2", n),
307
- ...r,
308
- children: t
309
- }) : null;
441
+ function MessageAttachments({ children, className, ...props }) {
442
+ if (!children) {
443
+ return null;
444
+ }
445
+ return /*#__PURE__*/ _jsx("div", {
446
+ "data-slot": "message-attachments",
447
+ className: cn('ml-auto flex w-fit flex-wrap items-start gap-2', className),
448
+ ...props,
449
+ children: children
450
+ });
310
451
  }
311
- var K = ({ className: t, children: n, ...r }) => /* @__PURE__ */ w("div", {
312
- "data-slot": "message-toolbar",
313
- className: e("mt-4 flex w-full items-center justify-between gap-4", t),
314
- ...r,
315
- children: n
316
- });
317
- //#endregion
318
- export { O as Message, N as MessageAction, M as MessageActions, W as MessageAttachment, G as MessageAttachments, A as MessageAvatar, j as MessageAvatarIcon, I as MessageBranch, L as MessageBranchContent, B as MessageBranchNext, V as MessageBranchPage, z as MessageBranchPrevious, R as MessageBranchSelector, k as MessageContent, U as MessageResponse, K as MessageToolbar };
452
+ const MessageToolbar = ({ className, children, ...props })=>/*#__PURE__*/ _jsx("div", {
453
+ "data-slot": "message-toolbar",
454
+ className: cn('mt-4 flex w-full items-center justify-between gap-4', className),
455
+ ...props,
456
+ children: children
457
+ });
458
+ export { Message, MessageAction, MessageActions, MessageAttachment, MessageAttachments, MessageAvatar, MessageAvatarIcon, MessageBranch, MessageBranchContent, MessageBranchNext, MessageBranchPage, MessageBranchPrevious, MessageBranchSelector, MessageContent, MessageResponse, MessageToolbar };
459
+
460
+ //# sourceMappingURL=message.js.map