@forgedevstack/bear 1.3.2 → 1.3.4

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 (404) hide show
  1. package/README.md +145 -288
  2. package/dist/components/AlertDialog/AlertDialog.cjs +1 -1
  3. package/dist/components/AlertDialog/AlertDialog.js +67 -84
  4. package/dist/components/ApprovalCard/ApprovalCard.cjs +1 -0
  5. package/dist/components/ApprovalCard/ApprovalCard.const.cjs +1 -0
  6. package/dist/components/ApprovalCard/ApprovalCard.const.d.ts +2 -0
  7. package/dist/components/ApprovalCard/ApprovalCard.const.js +8 -0
  8. package/dist/components/ApprovalCard/ApprovalCard.d.ts +2 -0
  9. package/dist/components/ApprovalCard/ApprovalCard.js +25 -0
  10. package/dist/components/ApprovalCard/ApprovalCard.types.d.ts +15 -0
  11. package/dist/components/ApprovalCard/index.d.ts +2 -0
  12. package/dist/components/ArtifactCard/ArtifactCard.cjs +1 -0
  13. package/dist/components/ArtifactCard/ArtifactCard.const.cjs +1 -0
  14. package/dist/components/ArtifactCard/ArtifactCard.const.d.ts +3 -0
  15. package/dist/components/ArtifactCard/ArtifactCard.const.js +8 -0
  16. package/dist/components/ArtifactCard/ArtifactCard.d.ts +2 -0
  17. package/dist/components/ArtifactCard/ArtifactCard.js +43 -0
  18. package/dist/components/ArtifactCard/ArtifactCard.types.d.ts +15 -0
  19. package/dist/components/ArtifactCard/index.d.ts +2 -0
  20. package/dist/components/Banner/Banner.const.cjs +1 -1
  21. package/dist/components/Banner/Banner.const.js +9 -8
  22. package/dist/components/BottomSheet/BottomSheet.cjs +1 -1
  23. package/dist/components/BottomSheet/BottomSheet.js +72 -64
  24. package/dist/components/Chart/BarChart.cjs +1 -1
  25. package/dist/components/Chart/BarChart.js +65 -72
  26. package/dist/components/Chart/Chart.cjs +1 -1
  27. package/dist/components/Chart/Chart.js +21 -18
  28. package/dist/components/Chart/Chart.types.d.ts +1 -1
  29. package/dist/components/Chart/FunnelChart.cjs +1 -1
  30. package/dist/components/Chart/FunnelChart.js +38 -36
  31. package/dist/components/Chart/LineChart.cjs +1 -1
  32. package/dist/components/Chart/LineChart.js +74 -60
  33. package/dist/components/Chart/PieChart.cjs +1 -1
  34. package/dist/components/Chart/PieChart.js +102 -82
  35. package/dist/components/Chart/RadarChart.cjs +1 -1
  36. package/dist/components/Chart/RadarChart.d.ts +1 -1
  37. package/dist/components/Chart/RadarChart.js +116 -93
  38. package/dist/components/Chat/Chat.cjs +1 -1
  39. package/dist/components/Chat/Chat.const.cjs +1 -1
  40. package/dist/components/Chat/Chat.const.d.ts +9 -22
  41. package/dist/components/Chat/Chat.const.js +18 -26
  42. package/dist/components/Chat/Chat.d.ts +1 -20
  43. package/dist/components/Chat/Chat.js +107 -162
  44. package/dist/components/Chat/Chat.types.d.ts +20 -27
  45. package/dist/components/Chat/Chat.utils.cjs +1 -0
  46. package/dist/components/Chat/Chat.utils.d.ts +2 -0
  47. package/dist/components/Chat/Chat.utils.js +10 -0
  48. package/dist/components/Chat/helpers/ChatTypingIndicator.cjs +1 -0
  49. package/dist/components/Chat/helpers/ChatTypingIndicator.d.ts +3 -0
  50. package/dist/components/Chat/helpers/ChatTypingIndicator.js +14 -0
  51. package/dist/components/Chat/index.d.ts +2 -1
  52. package/dist/components/ChatBubble/ChatBubble.cjs +1 -0
  53. package/dist/components/ChatBubble/ChatBubble.const.cjs +1 -0
  54. package/dist/components/ChatBubble/ChatBubble.const.d.ts +13 -0
  55. package/dist/components/ChatBubble/ChatBubble.const.js +17 -0
  56. package/dist/components/ChatBubble/ChatBubble.d.ts +2 -0
  57. package/dist/components/ChatBubble/ChatBubble.js +32 -0
  58. package/dist/components/ChatBubble/ChatBubble.types.d.ts +12 -0
  59. package/dist/components/ChatBubble/ChatBubble.utils.cjs +1 -0
  60. package/dist/components/ChatBubble/ChatBubble.utils.d.ts +6 -0
  61. package/dist/components/ChatBubble/ChatBubble.utils.js +15 -0
  62. package/dist/components/ChatBubble/helpers/ChatBubbleSystem.cjs +1 -0
  63. package/dist/components/ChatBubble/helpers/ChatBubbleSystem.d.ts +2 -0
  64. package/dist/components/ChatBubble/helpers/ChatBubbleSystem.js +21 -0
  65. package/dist/components/ChatBubble/helpers/ChatBubbleThread.cjs +1 -0
  66. package/dist/components/ChatBubble/helpers/ChatBubbleThread.d.ts +4 -0
  67. package/dist/components/ChatBubble/helpers/ChatBubbleThread.js +63 -0
  68. package/dist/components/ChatBubble/index.d.ts +2 -0
  69. package/dist/components/ChatError/ChatError.cjs +1 -0
  70. package/dist/components/ChatError/ChatError.const.cjs +1 -0
  71. package/dist/components/ChatError/ChatError.const.d.ts +2 -0
  72. package/dist/components/ChatError/ChatError.const.js +8 -0
  73. package/dist/components/ChatError/ChatError.d.ts +2 -0
  74. package/dist/components/ChatError/ChatError.js +32 -0
  75. package/dist/components/ChatError/ChatError.types.d.ts +14 -0
  76. package/dist/components/ChatError/index.d.ts +2 -0
  77. package/dist/components/ChipGroup/ChipGroup.cjs +1 -1
  78. package/dist/components/ChipGroup/ChipGroup.const.cjs +1 -1
  79. package/dist/components/ChipGroup/ChipGroup.const.d.ts +2 -0
  80. package/dist/components/ChipGroup/ChipGroup.const.js +6 -4
  81. package/dist/components/ChipGroup/ChipGroup.js +52 -48
  82. package/dist/components/CitationList/CitationList.cjs +1 -0
  83. package/dist/components/CitationList/CitationList.d.ts +2 -0
  84. package/dist/components/CitationList/CitationList.js +30 -0
  85. package/dist/components/CitationList/CitationList.types.d.ts +15 -0
  86. package/dist/components/CitationList/helpers/CitationListTitle.cjs +1 -0
  87. package/dist/components/CitationList/helpers/CitationListTitle.d.ts +2 -0
  88. package/dist/components/CitationList/helpers/CitationListTitle.js +10 -0
  89. package/dist/components/CitationList/helpers/index.d.ts +1 -0
  90. package/dist/components/CitationList/index.d.ts +2 -0
  91. package/dist/components/CommandPalette/CommandItem.cjs +1 -0
  92. package/dist/components/CommandPalette/CommandItem.d.ts +6 -0
  93. package/dist/components/CommandPalette/CommandItem.js +39 -0
  94. package/dist/components/CommandPalette/CommandPalette.cjs +1 -1
  95. package/dist/components/CommandPalette/CommandPalette.js +129 -144
  96. package/dist/components/ContextMeter/ContextMeter.cjs +1 -0
  97. package/dist/components/ContextMeter/ContextMeter.const.cjs +1 -0
  98. package/dist/components/ContextMeter/ContextMeter.const.d.ts +6 -0
  99. package/dist/components/ContextMeter/ContextMeter.const.js +11 -0
  100. package/dist/components/ContextMeter/ContextMeter.d.ts +2 -0
  101. package/dist/components/ContextMeter/ContextMeter.js +49 -0
  102. package/dist/components/ContextMeter/ContextMeter.types.d.ts +11 -0
  103. package/dist/components/ContextMeter/ContextMeter.utils.cjs +1 -0
  104. package/dist/components/ContextMeter/ContextMeter.utils.d.ts +2 -0
  105. package/dist/components/ContextMeter/ContextMeter.utils.js +12 -0
  106. package/dist/components/ContextMeter/index.d.ts +2 -0
  107. package/dist/components/Drawer/Drawer.cjs +1 -1
  108. package/dist/components/Drawer/Drawer.const.cjs +1 -1
  109. package/dist/components/Drawer/Drawer.const.d.ts +2 -1
  110. package/dist/components/Drawer/Drawer.const.js +7 -6
  111. package/dist/components/Drawer/Drawer.d.ts +1 -1
  112. package/dist/components/Drawer/Drawer.js +101 -85
  113. package/dist/components/Drawer/Drawer.types.d.ts +4 -1
  114. package/dist/components/Drawer/hooks/useDrawer.cjs +1 -1
  115. package/dist/components/Drawer/hooks/useDrawer.js +33 -34
  116. package/dist/components/Drawer/index.d.ts +1 -1
  117. package/dist/components/EmptyState/EmptyState.cjs +1 -1
  118. package/dist/components/EmptyState/EmptyState.const.cjs +1 -1
  119. package/dist/components/EmptyState/EmptyState.const.d.ts +13 -6
  120. package/dist/components/EmptyState/EmptyState.const.js +30 -8
  121. package/dist/components/EmptyState/EmptyState.d.ts +1 -2
  122. package/dist/components/EmptyState/EmptyState.js +37 -41
  123. package/dist/components/EmptyState/EmptyState.types.d.ts +3 -1
  124. package/dist/components/EmptyState/helpers/EmptyStateErrorSvg.cjs +1 -0
  125. package/dist/components/EmptyState/helpers/EmptyStateErrorSvg.d.ts +3 -0
  126. package/dist/components/EmptyState/helpers/EmptyStateErrorSvg.js +8 -0
  127. package/dist/components/EmptyState/helpers/EmptyStateInboxSvg.cjs +1 -0
  128. package/dist/components/EmptyState/helpers/EmptyStateInboxSvg.d.ts +3 -0
  129. package/dist/components/EmptyState/helpers/EmptyStateInboxSvg.js +8 -0
  130. package/dist/components/EmptyState/helpers/EmptyStateSearchSvg.cjs +1 -0
  131. package/dist/components/EmptyState/helpers/EmptyStateSearchSvg.d.ts +3 -0
  132. package/dist/components/EmptyState/helpers/EmptyStateSearchSvg.js +8 -0
  133. package/dist/components/EmptyState/helpers/index.d.ts +3 -0
  134. package/dist/components/EmptyState/index.d.ts +1 -1
  135. package/dist/components/FloatingChat/FloatingChat.cjs +1 -1
  136. package/dist/components/FloatingChat/FloatingChat.const.cjs +1 -1
  137. package/dist/components/FloatingChat/FloatingChat.const.d.ts +12 -1
  138. package/dist/components/FloatingChat/FloatingChat.const.js +25 -7
  139. package/dist/components/FloatingChat/FloatingChat.d.ts +1 -18
  140. package/dist/components/FloatingChat/FloatingChat.js +93 -124
  141. package/dist/components/FloatingChat/FloatingChat.types.d.ts +11 -22
  142. package/dist/components/FloatingChat/FloatingChat.utils.cjs +1 -0
  143. package/dist/components/FloatingChat/FloatingChat.utils.d.ts +2 -0
  144. package/dist/components/FloatingChat/FloatingChat.utils.js +12 -0
  145. package/dist/components/FloatingChat/helpers/FloatingChatHeader.cjs +1 -0
  146. package/dist/components/FloatingChat/helpers/FloatingChatHeader.d.ts +9 -0
  147. package/dist/components/FloatingChat/helpers/FloatingChatHeader.js +21 -0
  148. package/dist/components/FloatingChat/helpers/FloatingChatTrigger.cjs +1 -0
  149. package/dist/components/FloatingChat/helpers/FloatingChatTrigger.d.ts +9 -0
  150. package/dist/components/FloatingChat/helpers/FloatingChatTrigger.js +17 -0
  151. package/dist/components/FloatingChat/index.d.ts +1 -1
  152. package/dist/components/FormSkeleton/FormSkeleton.cjs +1 -1
  153. package/dist/components/FormSkeleton/FormSkeleton.d.ts +1 -1
  154. package/dist/components/FormSkeleton/FormSkeleton.js +35 -24
  155. package/dist/components/HoverCard/HoverCard.cjs +4 -3
  156. package/dist/components/HoverCard/HoverCard.const.cjs +1 -0
  157. package/dist/components/HoverCard/HoverCard.const.d.ts +1 -0
  158. package/dist/components/HoverCard/HoverCard.const.js +10 -0
  159. package/dist/components/HoverCard/HoverCard.js +62 -56
  160. package/dist/components/HoverCard/HoverCard.types.d.ts +7 -0
  161. package/dist/components/Icon/index.d.ts +1 -0
  162. package/dist/components/Icon/productIcons.cjs +1 -0
  163. package/dist/components/Icon/productIcons.d.ts +7 -0
  164. package/dist/components/Icon/productIcons.js +25 -0
  165. package/dist/components/Menu/Menu.cjs +1 -1
  166. package/dist/components/Menu/Menu.const.cjs +1 -0
  167. package/dist/components/Menu/Menu.const.d.ts +2 -0
  168. package/dist/components/Menu/Menu.const.js +12 -0
  169. package/dist/components/Menu/Menu.d.ts +3 -9
  170. package/dist/components/Menu/Menu.js +57 -89
  171. package/dist/components/Menu/Menu.types.d.ts +8 -1
  172. package/dist/components/Menu/MenuDivider.cjs +1 -0
  173. package/dist/components/Menu/MenuDivider.d.ts +6 -0
  174. package/dist/components/Menu/MenuDivider.js +7 -0
  175. package/dist/components/Menu/MenuItem.cjs +1 -0
  176. package/dist/components/Menu/MenuItem.d.ts +6 -0
  177. package/dist/components/Menu/MenuItem.js +46 -0
  178. package/dist/components/MessageActions/MessageActions.cjs +1 -0
  179. package/dist/components/MessageActions/MessageActions.const.cjs +1 -0
  180. package/dist/components/MessageActions/MessageActions.const.d.ts +2 -0
  181. package/dist/components/MessageActions/MessageActions.const.js +10 -0
  182. package/dist/components/MessageActions/MessageActions.d.ts +2 -0
  183. package/dist/components/MessageActions/MessageActions.js +31 -0
  184. package/dist/components/MessageActions/MessageActions.types.d.ts +16 -0
  185. package/dist/components/MessageActions/index.d.ts +2 -0
  186. package/dist/components/Modal/Modal.cjs +1 -1
  187. package/dist/components/Modal/Modal.const.cjs +1 -1
  188. package/dist/components/Modal/Modal.const.d.ts +1 -0
  189. package/dist/components/Modal/Modal.const.js +20 -12
  190. package/dist/components/Modal/Modal.js +62 -59
  191. package/dist/components/Modal/Modal.types.d.ts +7 -0
  192. package/dist/components/ModelSelect/ModelSelect.cjs +1 -0
  193. package/dist/components/ModelSelect/ModelSelect.const.cjs +1 -0
  194. package/dist/components/ModelSelect/ModelSelect.const.d.ts +1 -0
  195. package/dist/components/ModelSelect/ModelSelect.const.js +4 -0
  196. package/dist/components/ModelSelect/ModelSelect.d.ts +2 -0
  197. package/dist/components/ModelSelect/ModelSelect.js +41 -0
  198. package/dist/components/ModelSelect/ModelSelect.types.d.ts +16 -0
  199. package/dist/components/ModelSelect/index.d.ts +2 -0
  200. package/dist/components/OverlayPortal/OverlayPortal.const.cjs +1 -1
  201. package/dist/components/OverlayPortal/OverlayPortal.const.js +6 -5
  202. package/dist/components/PasswordInput/PasswordInput.cjs +1 -1
  203. package/dist/components/PasswordInput/PasswordInput.js +5 -5
  204. package/dist/components/Popover/Popover.cjs +1 -1
  205. package/dist/components/Popover/Popover.const.cjs +1 -0
  206. package/dist/components/Popover/Popover.const.d.ts +15 -1
  207. package/dist/components/Popover/Popover.const.js +29 -0
  208. package/dist/components/Popover/Popover.js +77 -73
  209. package/dist/components/Popover/Popover.types.d.ts +7 -0
  210. package/dist/components/PromptComposer/PromptComposer.cjs +1 -0
  211. package/dist/components/PromptComposer/PromptComposer.const.cjs +1 -0
  212. package/dist/components/PromptComposer/PromptComposer.const.d.ts +6 -0
  213. package/dist/components/PromptComposer/PromptComposer.const.js +14 -0
  214. package/dist/components/PromptComposer/PromptComposer.d.ts +2 -0
  215. package/dist/components/PromptComposer/PromptComposer.js +132 -0
  216. package/dist/components/PromptComposer/PromptComposer.types.d.ts +45 -0
  217. package/dist/components/PromptComposer/PromptComposer.utils.cjs +1 -0
  218. package/dist/components/PromptComposer/PromptComposer.utils.d.ts +5 -0
  219. package/dist/components/PromptComposer/PromptComposer.utils.js +16 -0
  220. package/dist/components/PromptComposer/helpers/PromptComposerAttachSvg.cjs +1 -0
  221. package/dist/components/PromptComposer/helpers/PromptComposerAttachSvg.d.ts +1 -0
  222. package/dist/components/PromptComposer/helpers/PromptComposerAttachSvg.js +6 -0
  223. package/dist/components/PromptComposer/helpers/PromptComposerFileChip.cjs +1 -0
  224. package/dist/components/PromptComposer/helpers/PromptComposerFileChip.d.ts +2 -0
  225. package/dist/components/PromptComposer/helpers/PromptComposerFileChip.js +18 -0
  226. package/dist/components/PromptComposer/helpers/PromptComposerSendSvg.cjs +1 -0
  227. package/dist/components/PromptComposer/helpers/PromptComposerSendSvg.d.ts +1 -0
  228. package/dist/components/PromptComposer/helpers/PromptComposerSendSvg.js +9 -0
  229. package/dist/components/PromptComposer/helpers/PromptComposerStopSvg.cjs +1 -0
  230. package/dist/components/PromptComposer/helpers/PromptComposerStopSvg.d.ts +1 -0
  231. package/dist/components/PromptComposer/helpers/PromptComposerStopSvg.js +6 -0
  232. package/dist/components/PromptComposer/helpers/index.d.ts +4 -0
  233. package/dist/components/PromptComposer/index.d.ts +2 -0
  234. package/dist/components/PromptSuggestions/PromptSuggestions.cjs +1 -0
  235. package/dist/components/PromptSuggestions/PromptSuggestions.d.ts +2 -0
  236. package/dist/components/PromptSuggestions/PromptSuggestions.js +39 -0
  237. package/dist/components/PromptSuggestions/PromptSuggestions.types.d.ts +13 -0
  238. package/dist/components/PromptSuggestions/index.d.ts +2 -0
  239. package/dist/components/RichEditor/helpers/IconRender.cjs +1 -1
  240. package/dist/components/RichEditor/helpers/IconRender.js +16 -16
  241. package/dist/components/RichEditor/helpers/toolbarItemRender.cjs +1 -1
  242. package/dist/components/RichEditor/helpers/toolbarItemRender.js +23 -23
  243. package/dist/components/Select/Select.cjs +1 -1
  244. package/dist/components/Select/Select.const.cjs +1 -1
  245. package/dist/components/Select/Select.const.d.ts +1 -0
  246. package/dist/components/Select/Select.const.js +7 -6
  247. package/dist/components/Select/Select.js +110 -105
  248. package/dist/components/Select/helpers/SelectCheckSvg.cjs +1 -0
  249. package/dist/components/Select/helpers/SelectCheckSvg.d.ts +3 -0
  250. package/dist/components/Select/helpers/SelectCheckSvg.js +8 -0
  251. package/dist/components/Select/helpers/SelectChevronDownSvg.cjs +1 -0
  252. package/dist/components/Select/helpers/SelectChevronDownSvg.d.ts +3 -0
  253. package/dist/components/Select/helpers/SelectChevronDownSvg.js +8 -0
  254. package/dist/components/Select/helpers/index.d.ts +2 -0
  255. package/dist/components/Skeleton/Skeleton.cjs +1 -1
  256. package/dist/components/Skeleton/Skeleton.const.cjs +2 -2
  257. package/dist/components/Skeleton/Skeleton.const.js +5 -6
  258. package/dist/components/Skeleton/Skeleton.js +59 -59
  259. package/dist/components/StatCard/StatCard.cjs +1 -1
  260. package/dist/components/StatCard/StatCard.const.cjs +1 -1
  261. package/dist/components/StatCard/StatCard.const.d.ts +0 -7
  262. package/dist/components/StatCard/StatCard.const.js +5 -12
  263. package/dist/components/StatCard/StatCard.d.ts +1 -2
  264. package/dist/components/StatCard/StatCard.js +48 -37
  265. package/dist/components/StatCard/StatCard.utils.cjs +1 -0
  266. package/dist/components/StatCard/StatCard.utils.d.ts +2 -0
  267. package/dist/components/StatCard/StatCard.utils.js +7 -0
  268. package/dist/components/StreamingMessage/StreamingMessage.cjs +1 -0
  269. package/dist/components/StreamingMessage/StreamingMessage.const.cjs +1 -0
  270. package/dist/components/StreamingMessage/StreamingMessage.const.d.ts +5 -0
  271. package/dist/components/StreamingMessage/StreamingMessage.const.js +10 -0
  272. package/dist/components/StreamingMessage/StreamingMessage.d.ts +2 -0
  273. package/dist/components/StreamingMessage/StreamingMessage.js +48 -0
  274. package/dist/components/StreamingMessage/StreamingMessage.types.d.ts +15 -0
  275. package/dist/components/StreamingMessage/index.d.ts +2 -0
  276. package/dist/components/ThemeSwitcher/ThemeSwitcher.cjs +1 -0
  277. package/dist/components/ThemeSwitcher/ThemeSwitcher.const.cjs +1 -0
  278. package/dist/components/ThemeSwitcher/ThemeSwitcher.const.d.ts +7 -0
  279. package/dist/components/ThemeSwitcher/ThemeSwitcher.const.js +14 -0
  280. package/dist/components/ThemeSwitcher/ThemeSwitcher.d.ts +2 -0
  281. package/dist/components/ThemeSwitcher/ThemeSwitcher.js +39 -0
  282. package/dist/components/ThemeSwitcher/ThemeSwitcher.types.d.ts +14 -0
  283. package/dist/components/ThemeSwitcher/index.d.ts +2 -0
  284. package/dist/components/ThinkingBlock/ThinkingBlock.cjs +1 -0
  285. package/dist/components/ThinkingBlock/ThinkingBlock.const.cjs +1 -0
  286. package/dist/components/ThinkingBlock/ThinkingBlock.const.d.ts +4 -0
  287. package/dist/components/ThinkingBlock/ThinkingBlock.const.js +9 -0
  288. package/dist/components/ThinkingBlock/ThinkingBlock.d.ts +2 -0
  289. package/dist/components/ThinkingBlock/ThinkingBlock.js +45 -0
  290. package/dist/components/ThinkingBlock/ThinkingBlock.types.d.ts +16 -0
  291. package/dist/components/ThinkingBlock/index.d.ts +2 -0
  292. package/dist/components/Toast/Toast.cjs +1 -1
  293. package/dist/components/Toast/Toast.const.cjs +1 -1
  294. package/dist/components/Toast/Toast.const.d.ts +2 -0
  295. package/dist/components/Toast/Toast.const.js +11 -8
  296. package/dist/components/Toast/Toast.context.cjs +1 -0
  297. package/dist/components/Toast/Toast.context.d.ts +3 -0
  298. package/dist/components/Toast/Toast.context.js +11 -0
  299. package/dist/components/Toast/Toast.d.ts +4 -3
  300. package/dist/components/Toast/Toast.icons.cjs +1 -0
  301. package/dist/components/Toast/Toast.icons.d.ts +4 -0
  302. package/dist/components/Toast/Toast.icons.js +29 -0
  303. package/dist/components/Toast/Toast.js +32 -160
  304. package/dist/components/Toast/ToastContainer.cjs +1 -0
  305. package/dist/components/Toast/ToastContainer.d.ts +3 -0
  306. package/dist/components/Toast/ToastContainer.js +39 -0
  307. package/dist/components/Toast/ToastItem.cjs +1 -0
  308. package/dist/components/Toast/ToastItem.d.ts +5 -0
  309. package/dist/components/Toast/ToastItem.js +86 -0
  310. package/dist/components/ToggleGroup/ToggleGroup.cjs +1 -0
  311. package/dist/components/ToggleGroup/ToggleGroup.const.cjs +1 -0
  312. package/dist/components/ToggleGroup/ToggleGroup.const.d.ts +15 -0
  313. package/dist/components/ToggleGroup/ToggleGroup.const.js +33 -0
  314. package/dist/components/ToggleGroup/ToggleGroup.context.cjs +1 -0
  315. package/dist/components/ToggleGroup/ToggleGroup.context.d.ts +2 -0
  316. package/dist/components/ToggleGroup/ToggleGroup.context.js +5 -0
  317. package/dist/components/ToggleGroup/ToggleGroup.d.ts +2 -0
  318. package/dist/components/ToggleGroup/ToggleGroup.js +86 -0
  319. package/dist/components/ToggleGroup/ToggleGroup.types.d.ts +48 -0
  320. package/dist/components/ToggleGroup/ToggleGroupItem.cjs +1 -0
  321. package/dist/components/ToggleGroup/ToggleGroupItem.d.ts +2 -0
  322. package/dist/components/ToggleGroup/ToggleGroupItem.js +50 -0
  323. package/dist/components/ToggleGroup/hooks/useToggleGroupContext.cjs +1 -0
  324. package/dist/components/ToggleGroup/hooks/useToggleGroupContext.d.ts +1 -0
  325. package/dist/components/ToggleGroup/hooks/useToggleGroupContext.js +6 -0
  326. package/dist/components/ToggleGroup/index.d.ts +4 -0
  327. package/dist/components/ToolCall/ToolCall.cjs +1 -0
  328. package/dist/components/ToolCall/ToolCall.const.cjs +1 -0
  329. package/dist/components/ToolCall/ToolCall.const.d.ts +5 -0
  330. package/dist/components/ToolCall/ToolCall.const.js +17 -0
  331. package/dist/components/ToolCall/ToolCall.d.ts +2 -0
  332. package/dist/components/ToolCall/ToolCall.js +43 -0
  333. package/dist/components/ToolCall/ToolCall.types.d.ts +20 -0
  334. package/dist/components/ToolCall/index.d.ts +2 -0
  335. package/dist/components/Tooltip/Tooltip.cjs +1 -1
  336. package/dist/components/Tooltip/Tooltip.const.cjs +1 -0
  337. package/dist/components/Tooltip/Tooltip.const.d.ts +8 -0
  338. package/dist/components/Tooltip/Tooltip.const.js +18 -0
  339. package/dist/components/Tooltip/Tooltip.js +59 -61
  340. package/dist/components/Tooltip/Tooltip.types.d.ts +7 -0
  341. package/dist/components/Transition/Transition.const.cjs +1 -1
  342. package/dist/components/Transition/Transition.const.js +12 -6
  343. package/dist/components/Transition/Transition.types.d.ts +1 -1
  344. package/dist/components/index.cjs +1 -1
  345. package/dist/components/index.d.ts +39 -9
  346. package/dist/components/index.js +335 -293
  347. package/dist/constants/generals.const.cjs +1 -1
  348. package/dist/constants/generals.const.d.ts +46 -0
  349. package/dist/constants/generals.const.js +158 -115
  350. package/dist/constants/keys.const.cjs +1 -1
  351. package/dist/constants/keys.const.js +2 -1
  352. package/dist/constants/numbers.const.cjs +1 -1
  353. package/dist/constants/numbers.const.d.ts +10 -0
  354. package/dist/constants/numbers.const.js +64 -53
  355. package/dist/context/BearProvider.cjs +1 -1
  356. package/dist/context/BearProvider.d.ts +19 -44
  357. package/dist/context/BearProvider.js +223 -208
  358. package/dist/context/bearProvider.types.d.ts +4 -0
  359. package/dist/context/index.d.ts +1 -1
  360. package/dist/hooks/index.cjs +1 -1
  361. package/dist/hooks/index.d.ts +2 -0
  362. package/dist/hooks/index.js +6 -4
  363. package/dist/hooks/useFixedAnchorPosition/index.d.ts +1 -1
  364. package/dist/hooks/useFixedAnchorPosition/useFixedAnchorPosition.const.cjs +1 -1
  365. package/dist/hooks/useFixedAnchorPosition/useFixedAnchorPosition.const.d.ts +2 -1
  366. package/dist/hooks/useFixedAnchorPosition/useFixedAnchorPosition.const.js +12 -11
  367. package/dist/hooks/useFixedAnchorPosition/useFixedAnchorPosition.types.d.ts +1 -1
  368. package/dist/hooks/useFocusTrap/index.d.ts +2 -0
  369. package/dist/hooks/useFocusTrap/useFocusTrap.cjs +1 -0
  370. package/dist/hooks/useFocusTrap/useFocusTrap.d.ts +3 -0
  371. package/dist/hooks/useFocusTrap/useFocusTrap.js +41 -0
  372. package/dist/hooks/useFocusTrap/useFocusTrap.types.d.ts +8 -0
  373. package/dist/hooks/useFocusTrap/useFocusTrap.utils.cjs +1 -0
  374. package/dist/hooks/useFocusTrap/useFocusTrap.utils.d.ts +1 -0
  375. package/dist/hooks/useFocusTrap/useFocusTrap.utils.js +23 -0
  376. package/dist/index.cjs +1 -1
  377. package/dist/index.js +483 -439
  378. package/dist/styles/_ai-chat.css +487 -0
  379. package/dist/styles/_base.css +2 -0
  380. package/dist/styles/_chart.css +144 -0
  381. package/dist/styles/_effects.css +8 -4
  382. package/dist/styles/_skeleton.css +90 -0
  383. package/dist/styles/main.css +3 -0
  384. package/dist/styles.css +953 -199
  385. package/package.json +1 -1
  386. package/dist/components/FormSkeleton/FormSkeleton.const.cjs +0 -1
  387. package/dist/components/FormSkeleton/FormSkeleton.const.d.ts +0 -5
  388. package/dist/components/FormSkeleton/FormSkeleton.const.js +0 -8
  389. package/dist/node_modules/@forgedevstack/bear-icons/dist/Icon.cjs +0 -1
  390. package/dist/node_modules/@forgedevstack/bear-icons/dist/Icon.const.cjs +0 -1
  391. package/dist/node_modules/@forgedevstack/bear-icons/dist/Icon.const.js +0 -14
  392. package/dist/node_modules/@forgedevstack/bear-icons/dist/Icon.js +0 -35
  393. package/dist/node_modules/@forgedevstack/bear-icons/dist/action.cjs +0 -1
  394. package/dist/node_modules/@forgedevstack/bear-icons/dist/action.js +0 -26
  395. package/dist/node_modules/@forgedevstack/bear-icons/dist/cn.utils.cjs +0 -1
  396. package/dist/node_modules/@forgedevstack/bear-icons/dist/cn.utils.js +0 -4
  397. package/dist/node_modules/@forgedevstack/bear-icons/dist/editor.cjs +0 -1
  398. package/dist/node_modules/@forgedevstack/bear-icons/dist/editor.js +0 -130
  399. package/dist/node_modules/@forgedevstack/bear-icons/dist/misc.cjs +0 -1
  400. package/dist/node_modules/@forgedevstack/bear-icons/dist/misc.js +0 -12
  401. package/dist/node_modules/@forgedevstack/bear-icons/dist/navigation.cjs +0 -1
  402. package/dist/node_modules/@forgedevstack/bear-icons/dist/navigation.js +0 -18
  403. package/dist/node_modules/@forgedevstack/bear-icons/dist/status.cjs +0 -1
  404. package/dist/node_modules/@forgedevstack/bear-icons/dist/status.js +0 -6
@@ -1,180 +1,125 @@
1
- import { jsxs as a, jsx as r } from "react/jsx-runtime";
2
- import { useState as B, useRef as R, useEffect as _, useCallback as k } from "react";
3
- import { cn as d } from "../../utils/cn.js";
4
- import { useBear as H } from "../../context/BearProvider.js";
5
- import { Button as O } from "../Button/Button.js";
6
- import { Input as U } from "../Input/Input.js";
7
- import { Avatar as j } from "../Avatar/Avatar.js";
8
- import "../Box/Box.js";
9
- import { Typography as m } from "../Typography/Typography.js";
10
- import { BearIcons as G } from "@forgedevstack/bear-icons";
11
- import { CHAT_DEFAULTS as g, SENDER_COLORS as K, MESSAGE_STATUS_ICONS as V } from "./Chat.const.js";
12
- const z = ({
13
- message: e,
14
- showTimestamp: o = !0,
15
- showStatus: l = !0,
16
- showAvatar: b = !0,
17
- userAvatar: u,
18
- botAvatar: p
19
- }) => {
20
- var s;
21
- const n = e.sender === "user", h = e.sender === "system", i = K[e.sender];
22
- if (h)
23
- return /* @__PURE__ */ r("div", { className: "flex justify-center my-2", children: /* @__PURE__ */ r(
24
- m,
25
- {
26
- variant: "caption",
27
- className: "px-3 py-1 rounded-full bg-gray-100 dark:bg-gray-800",
28
- style: { color: i.text },
29
- children: e.content
1
+ import { jsxs as A, jsx as r } from "react/jsx-runtime";
2
+ import { useRef as T, useState as Z, useEffect as $ } from "react";
3
+ import { BOOLEAN_FALSE as o, COMPONENT_NAME_CHAT as tt, BOOLEAN_TRUE as u } from "../../constants/generals.const.js";
4
+ import { cn as et } from "../../utils/cn.js";
5
+ import { resolveBearId as rt } from "../../utils/generateBearId.utils.js";
6
+ import { useBearId as ot } from "../../utils/useBearId.js";
7
+ import { getBearLiveRegionProps as st } from "../../utils/liveRegion.utils.js";
8
+ import { Box as s } from "../Box/Box.js";
9
+ import { Button as nt } from "../Button/Button.js";
10
+ import { ChatBubble as at } from "../ChatBubble/ChatBubble.js";
11
+ import { ChatError as it } from "../ChatError/ChatError.js";
12
+ import { PromptComposer as lt } from "../PromptComposer/PromptComposer.js";
13
+ import { PromptSuggestions as ct } from "../PromptSuggestions/PromptSuggestions.js";
14
+ import { CHAT_DEFAULT_SHOW_TIMESTAMPS as mt, CHAT_DEFAULT_SHOW_STATUS as ht, CHAT_DEFAULT_SHOW_AVATARS as pt, CHAT_DEFAULTS as dt, CHAT_DEFAULT_DISABLED as At, CHAT_DEFAULT_TRANSLATIONS as Tt } from "./Chat.const.js";
15
+ import { resolveChatHeightVar as ut, isChatScrollerAtBottom as ft } from "./Chat.utils.js";
16
+ import { ChatTypingIndicator as _t } from "./helpers/ChatTypingIndicator.js";
17
+ const Dt = (S) => {
18
+ const {
19
+ id: C,
20
+ testId: B,
21
+ messages: n,
22
+ onSend: E,
23
+ onStop: N,
24
+ onAttach: H,
25
+ isLoading: L = o,
26
+ isStreaming: v = o,
27
+ isTyping: I = o,
28
+ placeholder: w,
29
+ header: f,
30
+ footer: O,
31
+ showTimestamps: R = mt,
32
+ showStatus: y = ht,
33
+ showAvatars: b = pt,
34
+ userAvatar: x,
35
+ botAvatar: D,
36
+ typingText: F,
37
+ className: U,
38
+ height: P = dt.HEIGHT,
39
+ disabled: M = At,
40
+ allowAttach: W,
41
+ suggestions: i,
42
+ onSuggestionSelect: j,
43
+ errorTitle: V,
44
+ errorMessage: _,
45
+ onRetry: k,
46
+ translations: z
47
+ } = S, G = ot(tt), q = rt(C, G), l = T(null), c = T(u), m = T(null), [J, h] = Z(o), p = { ...Tt, ...z }, d = v || L, e = n[n.length - 1], K = d && typeof (e == null ? void 0 : e.content) == "string" ? e.content : void 0, Q = st("info"), g = () => {
48
+ const t = l.current;
49
+ t && (t.scrollTop = t.scrollHeight, c.current = u, h(o));
50
+ }, X = () => {
51
+ const t = l.current;
52
+ if (!t)
53
+ return;
54
+ const a = ft(t);
55
+ c.current = a, a && h(o);
56
+ };
57
+ return $(() => {
58
+ const t = (e == null ? void 0 : e.id) ?? null, a = m.current === null, Y = t !== null && t !== m.current;
59
+ if (m.current = t, !!Y) {
60
+ if (a || c.current) {
61
+ g();
62
+ return;
30
63
  }
31
- ) });
32
- const x = n ? u : p, f = e.status ? V[e.status] : null;
33
- return /* @__PURE__ */ a(
34
- "div",
35
- {
36
- className: d(
37
- "flex gap-2 mb-3",
38
- n ? "flex-row-reverse" : "flex-row"
39
- ),
40
- children: [
41
- b && /* @__PURE__ */ r(
42
- j,
43
- {
44
- src: x,
45
- initials: ((s = e.name) == null ? void 0 : s[0]) || (n ? "U" : "B"),
46
- size: "sm",
47
- className: "flex-shrink-0"
48
- }
49
- ),
50
- /* @__PURE__ */ a("div", { className: d("flex flex-col max-w-[70%]", n ? "items-end" : "items-start"), children: [
51
- e.name && /* @__PURE__ */ r(m, { variant: "caption", className: "mb-1 opacity-60", children: e.name }),
52
- /* @__PURE__ */ r(
53
- "div",
54
- {
55
- className: d(
56
- "px-4 py-2 rounded-2xl",
57
- n ? "rounded-br-sm" : "rounded-bl-sm"
58
- ),
59
- style: {
60
- backgroundColor: i.bg,
61
- color: i.text
62
- },
63
- children: typeof e.content == "string" ? /* @__PURE__ */ r(m, { variant: "body2", children: e.content }) : e.content
64
- }
65
- ),
66
- /* @__PURE__ */ a("div", { className: "flex items-center gap-1 mt-1", children: [
67
- o && e.timestamp && /* @__PURE__ */ r(m, { variant: "caption", className: "opacity-50 text-xs", children: e.timestamp.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" }) }),
68
- l && f && n && /* @__PURE__ */ r(
69
- "span",
70
- {
71
- className: d(
72
- "text-xs",
73
- e.status === "read" ? "text-blue-500" : "opacity-50",
74
- e.status === "error" && "text-red-500"
75
- ),
76
- children: f
77
- }
78
- )
79
- ] })
80
- ] })
81
- ]
64
+ h(u);
82
65
  }
83
- );
84
- }, L = ({ text: e = g.TYPING_TEXT }) => /* @__PURE__ */ a("div", { className: "flex items-center gap-2 mb-3", children: [
85
- /* @__PURE__ */ a("div", { className: "flex gap-1 px-4 py-3 bg-gray-100 dark:bg-gray-800 rounded-2xl rounded-bl-sm", children: [
86
- /* @__PURE__ */ r("span", { className: "w-2 h-2 bg-gray-400 rounded-full animate-bounce", style: { animationDelay: "0ms" } }),
87
- /* @__PURE__ */ r("span", { className: "w-2 h-2 bg-gray-400 rounded-full animate-bounce", style: { animationDelay: "150ms" } }),
88
- /* @__PURE__ */ r("span", { className: "w-2 h-2 bg-gray-400 rounded-full animate-bounce", style: { animationDelay: "300ms" } })
89
- ] }),
90
- /* @__PURE__ */ r(m, { variant: "caption", className: "opacity-50", children: e })
91
- ] }), ee = ({
92
- messages: e,
93
- onSend: o,
94
- isLoading: l = !1,
95
- placeholder: b = g.PLACEHOLDER,
96
- header: u,
97
- footer: p,
98
- showTimestamps: n = !0,
99
- showStatus: h = !0,
100
- showAvatars: i = !0,
101
- userAvatar: x,
102
- botAvatar: f,
103
- isTyping: s = !1,
104
- typingText: C,
105
- className: S,
106
- height: v = g.HEIGHT,
107
- testId: T,
108
- disabled: y = !1
109
- }) => {
110
- const { mode: D } = H(), I = D === "dark", [c, w] = B(""), E = R(null);
111
- _(() => {
112
- var t;
113
- (t = E.current) == null || t.scrollIntoView({ behavior: "smooth" });
114
- }, [e, s]);
115
- const N = k(() => {
116
- c.trim() && o && !y && !l && (o(c.trim()), w(""));
117
- }, [c, o, y, l]), A = k((t) => {
118
- t.key === "Enter" && !t.shiftKey && (t.preventDefault(), N());
119
- }, [N]);
120
- return /* @__PURE__ */ a(
121
- "div",
66
+ }, [n, e == null ? void 0 : e.id]), /* @__PURE__ */ A(
67
+ s,
122
68
  {
123
- className: d(
124
- "Bear-Chat",
125
- "flex flex-col rounded-xl overflow-hidden border",
126
- I ? "bg-gray-900 border-gray-700" : "bg-white border-gray-200",
127
- S
128
- ),
129
- style: { height: typeof v == "number" ? `${v}px` : v },
130
- "data-testid": T,
69
+ id: q,
70
+ "data-testid": B,
71
+ className: et("Bear-Chat", U),
72
+ style: ut(P),
131
73
  children: [
132
- u && /* @__PURE__ */ r("div", { className: "px-4 py-3 border-b border-gray-200 dark:border-gray-700", children: u }),
133
- /* @__PURE__ */ a("div", { className: "flex-1 overflow-y-auto p-4", children: [
134
- e.map((t) => /* @__PURE__ */ r(
135
- z,
74
+ f && /* @__PURE__ */ r(s, { className: "Bear-Chat__header", children: f }),
75
+ /* @__PURE__ */ A(s, { ref: l, className: "Bear-Chat__messages", onScroll: X, children: [
76
+ /* @__PURE__ */ r(s, { className: "Bear-Chat__live", ...Q, children: K }),
77
+ n.map((t) => /* @__PURE__ */ r(
78
+ at,
136
79
  {
137
80
  message: t,
138
- showTimestamp: n,
139
- showStatus: h,
140
- showAvatar: i,
81
+ showTimestamp: R,
82
+ showStatus: y,
83
+ showAvatar: b,
141
84
  userAvatar: x,
142
- botAvatar: f
85
+ botAvatar: D
143
86
  },
144
87
  t.id
145
88
  )),
146
- s && /* @__PURE__ */ r(L, { text: C }),
147
- /* @__PURE__ */ r("div", { ref: E })
89
+ I && !d && /* @__PURE__ */ r(_t, { text: F ?? p.typingText }),
90
+ _ && /* @__PURE__ */ r(it, { title: V, onRetry: k, children: _ }),
91
+ J && /* @__PURE__ */ r(
92
+ nt,
93
+ {
94
+ type: "button",
95
+ variant: "primary",
96
+ size: "sm",
97
+ className: "Bear-Chat__new-messages",
98
+ onClick: g,
99
+ children: p.newMessagesLabel
100
+ }
101
+ )
148
102
  ] }),
149
- /* @__PURE__ */ a("div", { className: "p-3 border-t border-gray-200 dark:border-gray-700", children: [
150
- /* @__PURE__ */ a("div", { className: "flex gap-2", children: [
151
- /* @__PURE__ */ r(
152
- U,
153
- {
154
- value: c,
155
- onChange: (t) => w(t.target.value),
156
- onKeyDown: A,
157
- placeholder: b,
158
- disabled: y || l,
159
- className: "flex-1"
160
- }
161
- ),
162
- /* @__PURE__ */ r(
163
- O,
164
- {
165
- variant: "primary",
166
- onClick: N,
167
- disabled: !c.trim() || y || l,
168
- children: /* @__PURE__ */ r(G.SendIcon, { size: 18 })
169
- }
170
- )
171
- ] }),
172
- p && /* @__PURE__ */ r("div", { className: "mt-2", children: p })
103
+ i && i.length > 0 && /* @__PURE__ */ r(s, { className: "Bear-Chat__suggestions", children: /* @__PURE__ */ r(ct, { suggestions: i, onSelect: j }) }),
104
+ /* @__PURE__ */ A(s, { className: "Bear-Chat__composer", children: [
105
+ /* @__PURE__ */ r(
106
+ lt,
107
+ {
108
+ onSubmit: E,
109
+ onStop: N,
110
+ onAttach: H,
111
+ isStreaming: d,
112
+ disabled: M,
113
+ allowAttach: W,
114
+ placeholder: w ?? p.placeholder
115
+ }
116
+ ),
117
+ O
173
118
  ] })
174
119
  ]
175
120
  }
176
121
  );
177
122
  };
178
123
  export {
179
- ee as Chat
124
+ Dt as Chat
180
125
  };
@@ -1,4 +1,6 @@
1
1
  import { ReactNode } from 'react';
2
+ import { ChatBubbleProps as ChatBubbleComponentProps } from '../ChatBubble/ChatBubble.types';
3
+ import { PromptSuggestionItem } from '../PromptSuggestions/PromptSuggestions.types';
2
4
  export interface ChatMessage {
3
5
  id: string;
4
6
  content: string | ReactNode;
@@ -9,48 +11,39 @@ export interface ChatMessage {
9
11
  status?: 'sending' | 'sent' | 'delivered' | 'read' | 'error';
10
12
  metadata?: Record<string, unknown>;
11
13
  }
14
+ export interface ChatTranslations {
15
+ placeholder: string;
16
+ typingText: string;
17
+ newMessagesLabel: string;
18
+ }
12
19
  export interface ChatProps {
13
20
  id?: string;
14
- /** Array of messages */
21
+ testId?: string;
15
22
  messages: ChatMessage[];
16
- /** Callback when user sends a message */
17
23
  onSend?: (message: string) => void;
18
- /** Loading state (e.g., waiting for bot response) */
24
+ onStop?: () => void;
25
+ onAttach?: (files: File[]) => void;
19
26
  isLoading?: boolean;
20
- /** Placeholder text for input */
27
+ isStreaming?: boolean;
28
+ isTyping?: boolean;
21
29
  placeholder?: string;
22
- /** Chat header content */
23
30
  header?: ReactNode;
24
- /** Chat footer content (below input) */
25
31
  footer?: ReactNode;
26
- /** Show timestamps */
27
32
  showTimestamps?: boolean;
28
- /** Show message status */
29
33
  showStatus?: boolean;
30
- /** Show avatars */
31
34
  showAvatars?: boolean;
32
- /** User avatar URL */
33
35
  userAvatar?: string;
34
- /** Bot avatar URL */
35
36
  botAvatar?: string;
36
- /** Typing indicator */
37
- isTyping?: boolean;
38
- /** Typing indicator text */
39
37
  typingText?: string;
40
- /** Custom class name */
41
38
  className?: string;
42
- /** Height of the chat container */
43
39
  height?: number | string;
44
- /** Test ID */
45
- testId?: string;
46
- /** Disable input */
47
40
  disabled?: boolean;
41
+ allowAttach?: boolean;
42
+ suggestions?: PromptSuggestionItem[];
43
+ onSuggestionSelect?: (id: string) => void;
44
+ errorTitle?: string;
45
+ errorMessage?: ReactNode;
46
+ onRetry?: () => void;
47
+ translations?: Partial<ChatTranslations>;
48
48
  }
49
- export interface ChatBubbleProps {
50
- message: ChatMessage;
51
- showTimestamp?: boolean;
52
- showStatus?: boolean;
53
- showAvatar?: boolean;
54
- userAvatar?: string;
55
- botAvatar?: string;
56
- }
49
+ export type ChatBubbleProps = ChatBubbleComponentProps;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../../constants/generals.const.cjs"),o=require("./Chat.const.cjs"),n=t=>{const e=typeof t=="number"?`${t}${r.UNIT_PX}`:t;return{[o.CHAT_HEIGHT_VAR]:e}},s=t=>t.scrollHeight-t.scrollTop-t.clientHeight<=o.CHAT_STICK_THRESHOLD;exports.isChatScrollerAtBottom=s;exports.resolveChatHeightVar=n;
@@ -0,0 +1,2 @@
1
+ export declare const resolveChatHeightVar: (height: number | string) => Record<string, string>;
2
+ export declare const isChatScrollerAtBottom: (scroller: HTMLElement) => boolean;
@@ -0,0 +1,10 @@
1
+ import { UNIT_PX as r } from "../../constants/generals.const.js";
2
+ import { CHAT_HEIGHT_VAR as e, CHAT_STICK_THRESHOLD as n } from "./Chat.const.js";
3
+ const s = (t) => {
4
+ const o = typeof t == "number" ? `${t}${r}` : t;
5
+ return { [e]: o };
6
+ }, i = (t) => t.scrollHeight - t.scrollTop - t.clientHeight <= n;
7
+ export {
8
+ i as isChatScrollerAtBottom,
9
+ s as resolveChatHeightVar
10
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),n=require("../../Flex/Flex.cjs"),r=require("../../Typography/Typography.cjs"),i=require("../../../constants/numbers.const.cjs"),p=a=>{const{text:o}=a,s=Array.from({length:i.TYPING_DOT_COUNT},(t,c)=>c);return e.jsxs(n.Flex,{className:"Bear-ChatTyping",align:"center",gap:2,children:[e.jsx(n.Flex,{className:"Bear-ChatTyping__dots",align:"center",children:s.map(t=>e.jsx(r.Typography,{component:"span",className:"Bear-ChatTyping__dot"},t))}),e.jsx(r.Typography,{variant:"caption",color:"muted",children:o})]})};exports.ChatTypingIndicator=p;
@@ -0,0 +1,3 @@
1
+ export declare const ChatTypingIndicator: (props: {
2
+ text: string;
3
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,14 @@
1
+ import { jsxs as c, jsx as r } from "react/jsx-runtime";
2
+ import { Flex as a } from "../../Flex/Flex.js";
3
+ import { Typography as o } from "../../Typography/Typography.js";
4
+ import { TYPING_DOT_COUNT as m } from "../../../constants/numbers.const.js";
5
+ const d = (n) => {
6
+ const { text: e } = n, i = Array.from({ length: m }, (t, p) => p);
7
+ return /* @__PURE__ */ c(a, { className: "Bear-ChatTyping", align: "center", gap: 2, children: [
8
+ /* @__PURE__ */ r(a, { className: "Bear-ChatTyping__dots", align: "center", children: i.map((t) => /* @__PURE__ */ r(o, { component: "span", className: "Bear-ChatTyping__dot" }, t)) }),
9
+ /* @__PURE__ */ r(o, { variant: "caption", color: "muted", children: e })
10
+ ] });
11
+ };
12
+ export {
13
+ d as ChatTypingIndicator
14
+ };
@@ -1,2 +1,3 @@
1
1
  export { Chat } from './Chat';
2
- export type { ChatProps, ChatMessage, ChatBubbleProps } from './Chat.types';
2
+ export type { ChatMessage, ChatProps, ChatTranslations } from './Chat.types';
3
+ export type { ChatBubbleProps } from '../ChatBubble/ChatBubble.types';
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),d=require("../../constants/generals.const.cjs");require("react");const _=require("../../utils/generateBearId.utils.cjs"),b=require("../../utils/useBearId.cjs"),t=require("./ChatBubble.const.cjs"),c=require("./ChatBubble.utils.cjs"),l=require("./helpers/ChatBubbleSystem.cjs"),T=require("./helpers/ChatBubbleThread.cjs"),h=a=>{const{id:u,showTimestamp:n=t.CHAT_BUBBLE_DEFAULT_SHOW_TIMESTAMP,showStatus:B=t.CHAT_BUBBLE_DEFAULT_SHOW_STATUS,showAvatar:o=t.CHAT_BUBBLE_DEFAULT_SHOW_AVATAR,...e}=a,i=b.useBearId(d.COMPONENT_NAME_CHAT_BUBBLE),s=_.resolveBearId(u,i);return c.isChatSystemSender(e.message.sender)?r.jsx(l.ChatBubbleSystem,{id:s,testId:e.testId,message:e.message,className:e.className}):r.jsx(T.ChatBubbleThread,{...e,id:s,domId:s,showTimestamp:n,showStatus:B,showAvatar:o})};exports.ChatBubble=h;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("../../constants/generals.const.cjs"),B=_.BOOLEAN_TRUE,T=_.BOOLEAN_TRUE,A=_.BOOLEAN_TRUE,E={sending:"○",sent:"✓",delivered:"✓✓",read:"✓✓",error:"!"},U="U",L="B",H="2-digit";exports.CHAT_BUBBLE_BOT_INITIAL=L;exports.CHAT_BUBBLE_DEFAULT_SHOW_AVATAR=A;exports.CHAT_BUBBLE_DEFAULT_SHOW_STATUS=T;exports.CHAT_BUBBLE_DEFAULT_SHOW_TIMESTAMP=B;exports.CHAT_BUBBLE_STATUS_MARK=E;exports.CHAT_BUBBLE_TIME_DIGIT=H;exports.CHAT_BUBBLE_USER_INITIAL=U;
@@ -0,0 +1,13 @@
1
+ export declare const CHAT_BUBBLE_DEFAULT_SHOW_TIMESTAMP = true;
2
+ export declare const CHAT_BUBBLE_DEFAULT_SHOW_STATUS = true;
3
+ export declare const CHAT_BUBBLE_DEFAULT_SHOW_AVATAR = true;
4
+ export declare const CHAT_BUBBLE_STATUS_MARK: {
5
+ readonly sending: "○";
6
+ readonly sent: "✓";
7
+ readonly delivered: "✓✓";
8
+ readonly read: "✓✓";
9
+ readonly error: "!";
10
+ };
11
+ export declare const CHAT_BUBBLE_USER_INITIAL = "U";
12
+ export declare const CHAT_BUBBLE_BOT_INITIAL = "B";
13
+ export declare const CHAT_BUBBLE_TIME_DIGIT = "2-digit";
@@ -0,0 +1,17 @@
1
+ import { BOOLEAN_TRUE as _ } from "../../constants/generals.const.js";
2
+ const T = _, A = _, E = _, U = {
3
+ sending: "○",
4
+ sent: "✓",
5
+ delivered: "✓✓",
6
+ read: "✓✓",
7
+ error: "!"
8
+ }, L = "U", o = "B", t = "2-digit";
9
+ export {
10
+ o as CHAT_BUBBLE_BOT_INITIAL,
11
+ E as CHAT_BUBBLE_DEFAULT_SHOW_AVATAR,
12
+ A as CHAT_BUBBLE_DEFAULT_SHOW_STATUS,
13
+ T as CHAT_BUBBLE_DEFAULT_SHOW_TIMESTAMP,
14
+ U as CHAT_BUBBLE_STATUS_MARK,
15
+ t as CHAT_BUBBLE_TIME_DIGIT,
16
+ L as CHAT_BUBBLE_USER_INITIAL
17
+ };
@@ -0,0 +1,2 @@
1
+ import { ChatBubbleProps } from './ChatBubble.types';
2
+ export declare const ChatBubble: (props: ChatBubbleProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,32 @@
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import { COMPONENT_NAME_CHAT_BUBBLE as T } from "../../constants/generals.const.js";
3
+ import "react";
4
+ import { resolveBearId as _ } from "../../utils/generateBearId.utils.js";
5
+ import { useBearId as d } from "../../utils/useBearId.js";
6
+ import { CHAT_BUBBLE_DEFAULT_SHOW_TIMESTAMP as A, CHAT_BUBBLE_DEFAULT_SHOW_STATUS as p, CHAT_BUBBLE_DEFAULT_SHOW_AVATAR as E } from "./ChatBubble.const.js";
7
+ import { isChatSystemSender as S } from "./ChatBubble.utils.js";
8
+ import { ChatBubbleSystem as f } from "./helpers/ChatBubbleSystem.js";
9
+ import { ChatBubbleThread as n } from "./helpers/ChatBubbleThread.js";
10
+ const l = (s) => {
11
+ const {
12
+ id: m,
13
+ showTimestamp: o = A,
14
+ showStatus: a = p,
15
+ showAvatar: B = E,
16
+ ...e
17
+ } = s, i = d(T), t = _(m, i);
18
+ return S(e.message.sender) ? /* @__PURE__ */ r(f, { id: t, testId: e.testId, message: e.message, className: e.className }) : /* @__PURE__ */ r(
19
+ n,
20
+ {
21
+ ...e,
22
+ id: t,
23
+ domId: t,
24
+ showTimestamp: o,
25
+ showStatus: a,
26
+ showAvatar: B
27
+ }
28
+ );
29
+ };
30
+ export {
31
+ l as ChatBubble
32
+ };
@@ -0,0 +1,12 @@
1
+ import { ChatMessage } from '../Chat/Chat.types';
2
+ export interface ChatBubbleProps {
3
+ id?: string;
4
+ testId?: string;
5
+ message: ChatMessage;
6
+ showTimestamp?: boolean;
7
+ showStatus?: boolean;
8
+ showAvatar?: boolean;
9
+ userAvatar?: string;
10
+ botAvatar?: string;
11
+ className?: string;
12
+ }
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./ChatBubble.const.cjs"),r=e=>e==="user",o=e=>e==="system",i=(e,n,a)=>e.avatar?e.avatar:r(e.sender)?n:a,u=e=>e.name?e.name[0]:r(e.sender)?t.CHAT_BUBBLE_USER_INITIAL:t.CHAT_BUBBLE_BOT_INITIAL,B=e=>{if(e)return e.toLocaleTimeString([],{hour:t.CHAT_BUBBLE_TIME_DIGIT,minute:t.CHAT_BUBBLE_TIME_DIGIT})};exports.formatChatBubbleTime=B;exports.isChatSystemSender=o;exports.isChatUserSender=r;exports.resolveChatBubbleAvatar=i;exports.resolveChatBubbleInitial=u;
@@ -0,0 +1,6 @@
1
+ import { ChatMessage } from '../Chat/Chat.types';
2
+ export declare const isChatUserSender: (sender: ChatMessage["sender"]) => sender is "user";
3
+ export declare const isChatSystemSender: (sender: ChatMessage["sender"]) => sender is "system";
4
+ export declare const resolveChatBubbleAvatar: (message: ChatMessage, userAvatar?: string, botAvatar?: string) => string | undefined;
5
+ export declare const resolveChatBubbleInitial: (message: ChatMessage) => string;
6
+ export declare const formatChatBubbleTime: (timestamp?: Date) => string | undefined;
@@ -0,0 +1,15 @@
1
+ import { CHAT_BUBBLE_TIME_DIGIT as t, CHAT_BUBBLE_USER_INITIAL as a, CHAT_BUBBLE_BOT_INITIAL as B } from "./ChatBubble.const.js";
2
+ const e = (r) => r === "user", u = (r) => r === "system", I = (r, n, o) => r.avatar ? r.avatar : e(r.sender) ? n : o, T = (r) => r.name ? r.name[0] : e(r.sender) ? a : B, _ = (r) => {
3
+ if (r)
4
+ return r.toLocaleTimeString([], {
5
+ hour: t,
6
+ minute: t
7
+ });
8
+ };
9
+ export {
10
+ _ as formatChatBubbleTime,
11
+ u as isChatSystemSender,
12
+ e as isChatUserSender,
13
+ I as resolveChatBubbleAvatar,
14
+ T as resolveChatBubbleInitial
15
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),c=require("../../Flex/Flex.cjs"),u=require("../../Typography/Typography.cjs"),l=require("../../../utils/cn.cjs");require("react");const b=t=>{const{id:r,testId:s,message:a,className:n}=t;return e.jsx(c.Flex,{id:r,testId:s,className:l.cn("Bear-ChatBubble","Bear-ChatBubble--system",n),justify:"center",children:e.jsx(u.Typography,{variant:"caption",className:"Bear-ChatBubble__bubble",children:a.content})})};exports.ChatBubbleSystem=b;
@@ -0,0 +1,2 @@
1
+ import { ChatBubbleProps } from '../ChatBubble.types';
2
+ export declare const ChatBubbleSystem: (props: Pick<ChatBubbleProps, "id" | "testId" | "message" | "className">) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,21 @@
1
+ import { jsx as e } from "react/jsx-runtime";
2
+ import { Flex as o } from "../../Flex/Flex.js";
3
+ import { Typography as b } from "../../Typography/Typography.js";
4
+ import { cn as c } from "../../../utils/cn.js";
5
+ import "react";
6
+ const u = (t) => {
7
+ const { id: r, testId: a, message: s, className: m } = t;
8
+ return /* @__PURE__ */ e(
9
+ o,
10
+ {
11
+ id: r,
12
+ testId: a,
13
+ className: c("Bear-ChatBubble", "Bear-ChatBubble--system", m),
14
+ justify: "center",
15
+ children: /* @__PURE__ */ e(b, { variant: "caption", className: "Bear-ChatBubble__bubble", children: s.content })
16
+ }
17
+ );
18
+ };
19
+ export {
20
+ u as ChatBubbleSystem
21
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),_=require("../../Avatar/Avatar.cjs"),l=require("../../../utils/cn.cjs");require("react");require("../../Box/Box.cjs");const r=require("../../Flex/Flex.cjs"),t=require("../../Typography/Typography.cjs"),v=require("../ChatBubble.const.cjs"),s=require("../ChatBubble.utils.cjs"),y=o=>{const{domId:u,testId:c,message:e,showTimestamp:b,showStatus:h,showAvatar:d,userAvatar:m,botAvatar:B,className:p}=o,C=s.isChatUserSender(e.sender),n=s.formatChatBubbleTime(e.timestamp),i=e.status?v.CHAT_BUBBLE_STATUS_MARK[e.status]:void 0;return a.jsxs(r.Flex,{id:u,testId:c,className:l.cn("Bear-ChatBubble",`Bear-ChatBubble--${e.sender}`,p),align:"start",gap:2,children:[d&&a.jsx(_.Avatar,{src:s.resolveChatBubbleAvatar(e,m,B),initials:s.resolveChatBubbleInitial(e),size:"sm"}),a.jsxs(r.Flex,{className:"Bear-ChatBubble__body",direction:"column",gap:1,children:[e.name&&a.jsx(t.Typography,{variant:"caption",color:"muted",children:e.name}),a.jsx(t.Typography,{variant:"body2",className:"Bear-ChatBubble__bubble",children:e.content}),a.jsxs(r.Flex,{className:"Bear-ChatBubble__meta",align:"center",gap:1,children:[b&&n&&a.jsx(t.Typography,{variant:"caption",color:"muted",children:n}),h&&i&&C&&a.jsx(t.Typography,{variant:"caption",className:l.cn("Bear-ChatBubble__status",e.status&&`Bear-ChatBubble__status--${e.status}`),children:i})]})]})]})};exports.ChatBubbleThread=y;
@@ -0,0 +1,4 @@
1
+ import { ChatBubbleProps } from '../ChatBubble.types';
2
+ export declare const ChatBubbleThread: (props: ChatBubbleProps & {
3
+ domId: string;
4
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,63 @@
1
+ import { jsxs as r, jsx as t } from "react/jsx-runtime";
2
+ import { Avatar as _ } from "../../Avatar/Avatar.js";
3
+ import { cn as m } from "../../../utils/cn.js";
4
+ import "react";
5
+ import "../../Box/Box.js";
6
+ import { Flex as s } from "../../Flex/Flex.js";
7
+ import { Typography as e } from "../../Typography/Typography.js";
8
+ import { CHAT_BUBBLE_STATUS_MARK as v } from "../ChatBubble.const.js";
9
+ import { isChatUserSender as f, formatChatBubbleTime as A, resolveChatBubbleInitial as g, resolveChatBubbleAvatar as T } from "../ChatBubble.utils.js";
10
+ const M = (l) => {
11
+ const {
12
+ domId: n,
13
+ testId: b,
14
+ message: a,
15
+ showTimestamp: c,
16
+ showStatus: u,
17
+ showAvatar: h,
18
+ userAvatar: d,
19
+ botAvatar: B,
20
+ className: p
21
+ } = l, C = f(a.sender), o = A(a.timestamp), i = a.status ? v[a.status] : void 0;
22
+ return /* @__PURE__ */ r(
23
+ s,
24
+ {
25
+ id: n,
26
+ testId: b,
27
+ className: m("Bear-ChatBubble", `Bear-ChatBubble--${a.sender}`, p),
28
+ align: "start",
29
+ gap: 2,
30
+ children: [
31
+ h && /* @__PURE__ */ t(
32
+ _,
33
+ {
34
+ src: T(a, d, B),
35
+ initials: g(a),
36
+ size: "sm"
37
+ }
38
+ ),
39
+ /* @__PURE__ */ r(s, { className: "Bear-ChatBubble__body", direction: "column", gap: 1, children: [
40
+ a.name && /* @__PURE__ */ t(e, { variant: "caption", color: "muted", children: a.name }),
41
+ /* @__PURE__ */ t(e, { variant: "body2", className: "Bear-ChatBubble__bubble", children: a.content }),
42
+ /* @__PURE__ */ r(s, { className: "Bear-ChatBubble__meta", align: "center", gap: 1, children: [
43
+ c && o && /* @__PURE__ */ t(e, { variant: "caption", color: "muted", children: o }),
44
+ u && i && C && /* @__PURE__ */ t(
45
+ e,
46
+ {
47
+ variant: "caption",
48
+ className: m(
49
+ "Bear-ChatBubble__status",
50
+ a.status && `Bear-ChatBubble__status--${a.status}`
51
+ ),
52
+ children: i
53
+ }
54
+ )
55
+ ] })
56
+ ] })
57
+ ]
58
+ }
59
+ );
60
+ };
61
+ export {
62
+ M as ChatBubbleThread
63
+ };
@@ -0,0 +1,2 @@
1
+ export { ChatBubble } from './ChatBubble';
2
+ export type { ChatBubbleProps } from './ChatBubble.types';