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