@forgedevstack/bear 1.3.1 → 1.3.3

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 (491) hide show
  1. package/README.md +30 -0
  2. package/dist/components/Accordion/components/AccordionItem/AccordionItem.cjs +1 -1
  3. package/dist/components/Accordion/components/AccordionItem/AccordionItem.js +1 -1
  4. package/dist/components/Alert/Alert.cjs +1 -1
  5. package/dist/components/Alert/Alert.js +1 -1
  6. package/dist/components/ApprovalCard/ApprovalCard.cjs +1 -0
  7. package/dist/components/ApprovalCard/ApprovalCard.const.cjs +1 -0
  8. package/dist/components/ApprovalCard/ApprovalCard.const.d.ts +2 -0
  9. package/dist/components/ApprovalCard/ApprovalCard.const.js +8 -0
  10. package/dist/components/ApprovalCard/ApprovalCard.d.ts +2 -0
  11. package/dist/components/ApprovalCard/ApprovalCard.js +25 -0
  12. package/dist/components/ApprovalCard/ApprovalCard.types.d.ts +15 -0
  13. package/dist/components/ApprovalCard/index.d.ts +2 -0
  14. package/dist/components/ArtifactCard/ArtifactCard.cjs +1 -0
  15. package/dist/components/ArtifactCard/ArtifactCard.const.cjs +1 -0
  16. package/dist/components/ArtifactCard/ArtifactCard.const.d.ts +3 -0
  17. package/dist/components/ArtifactCard/ArtifactCard.const.js +8 -0
  18. package/dist/components/ArtifactCard/ArtifactCard.d.ts +2 -0
  19. package/dist/components/ArtifactCard/ArtifactCard.js +43 -0
  20. package/dist/components/ArtifactCard/ArtifactCard.types.d.ts +15 -0
  21. package/dist/components/ArtifactCard/index.d.ts +2 -0
  22. package/dist/components/Avatar/Avatar.cjs +1 -1
  23. package/dist/components/Avatar/Avatar.js +1 -1
  24. package/dist/components/BackTop/BackTop.cjs +1 -1
  25. package/dist/components/BackTop/BackTop.js +1 -1
  26. package/dist/components/Banner/Banner.const.cjs +1 -1
  27. package/dist/components/Banner/Banner.const.js +10 -9
  28. package/dist/components/Blockquote/Blockquote.cjs +1 -1
  29. package/dist/components/Blockquote/Blockquote.js +1 -1
  30. package/dist/components/BottomSheet/BottomSheet.cjs +1 -1
  31. package/dist/components/BottomSheet/BottomSheet.js +1 -1
  32. package/dist/components/Breadcrumbs/Breadcrumbs.cjs +1 -1
  33. package/dist/components/Breadcrumbs/Breadcrumbs.js +1 -1
  34. package/dist/components/Calendar/Calendar.cjs +1 -1
  35. package/dist/components/Calendar/Calendar.js +1 -1
  36. package/dist/components/Chart/BarChart.cjs +1 -1
  37. package/dist/components/Chart/BarChart.d.ts +1 -2
  38. package/dist/components/Chart/BarChart.js +74 -61
  39. package/dist/components/Chart/Chart.cjs +1 -1
  40. package/dist/components/Chart/Chart.const.cjs +1 -1
  41. package/dist/components/Chart/Chart.const.d.ts +24 -3
  42. package/dist/components/Chart/Chart.const.js +39 -16
  43. package/dist/components/Chart/Chart.d.ts +1 -5
  44. package/dist/components/Chart/Chart.js +23 -24
  45. package/dist/components/Chart/Chart.types.d.ts +12 -20
  46. package/dist/components/Chart/Chart.utils.cjs +1 -1
  47. package/dist/components/Chart/Chart.utils.d.ts +8 -18
  48. package/dist/components/Chart/Chart.utils.js +39 -3
  49. package/dist/components/Chart/FunnelChart.cjs +1 -0
  50. package/dist/components/Chart/FunnelChart.d.ts +2 -0
  51. package/dist/components/Chart/FunnelChart.js +61 -0
  52. package/dist/components/Chart/LineChart.cjs +1 -1
  53. package/dist/components/Chart/LineChart.d.ts +1 -2
  54. package/dist/components/Chart/LineChart.js +80 -70
  55. package/dist/components/Chart/PieChart.cjs +1 -1
  56. package/dist/components/Chart/PieChart.d.ts +1 -2
  57. package/dist/components/Chart/PieChart.js +140 -105
  58. package/dist/components/Chart/PieChart.types.d.ts +8 -0
  59. package/dist/components/Chart/RadarChart.cjs +1 -0
  60. package/dist/components/Chart/RadarChart.d.ts +2 -0
  61. package/dist/components/Chart/RadarChart.js +123 -0
  62. package/dist/components/Chart/index.d.ts +3 -1
  63. package/dist/components/Chat/Chat.cjs +1 -1
  64. package/dist/components/Chat/Chat.const.cjs +1 -1
  65. package/dist/components/Chat/Chat.const.d.ts +9 -22
  66. package/dist/components/Chat/Chat.const.js +18 -26
  67. package/dist/components/Chat/Chat.d.ts +1 -20
  68. package/dist/components/Chat/Chat.js +107 -162
  69. package/dist/components/Chat/Chat.types.d.ts +20 -27
  70. package/dist/components/Chat/Chat.utils.cjs +1 -0
  71. package/dist/components/Chat/Chat.utils.d.ts +2 -0
  72. package/dist/components/Chat/Chat.utils.js +10 -0
  73. package/dist/components/Chat/helpers/ChatTypingIndicator.cjs +1 -0
  74. package/dist/components/Chat/helpers/ChatTypingIndicator.d.ts +3 -0
  75. package/dist/components/Chat/helpers/ChatTypingIndicator.js +14 -0
  76. package/dist/components/Chat/index.d.ts +2 -1
  77. package/dist/components/ChatBubble/ChatBubble.cjs +1 -0
  78. package/dist/components/ChatBubble/ChatBubble.const.cjs +1 -0
  79. package/dist/components/ChatBubble/ChatBubble.const.d.ts +13 -0
  80. package/dist/components/ChatBubble/ChatBubble.const.js +17 -0
  81. package/dist/components/ChatBubble/ChatBubble.d.ts +2 -0
  82. package/dist/components/ChatBubble/ChatBubble.js +32 -0
  83. package/dist/components/ChatBubble/ChatBubble.types.d.ts +12 -0
  84. package/dist/components/ChatBubble/ChatBubble.utils.cjs +1 -0
  85. package/dist/components/ChatBubble/ChatBubble.utils.d.ts +6 -0
  86. package/dist/components/ChatBubble/ChatBubble.utils.js +15 -0
  87. package/dist/components/ChatBubble/helpers/ChatBubbleSystem.cjs +1 -0
  88. package/dist/components/ChatBubble/helpers/ChatBubbleSystem.d.ts +2 -0
  89. package/dist/components/ChatBubble/helpers/ChatBubbleSystem.js +21 -0
  90. package/dist/components/ChatBubble/helpers/ChatBubbleThread.cjs +1 -0
  91. package/dist/components/ChatBubble/helpers/ChatBubbleThread.d.ts +4 -0
  92. package/dist/components/ChatBubble/helpers/ChatBubbleThread.js +63 -0
  93. package/dist/components/ChatBubble/index.d.ts +2 -0
  94. package/dist/components/ChatError/ChatError.cjs +1 -0
  95. package/dist/components/ChatError/ChatError.const.cjs +1 -0
  96. package/dist/components/ChatError/ChatError.const.d.ts +2 -0
  97. package/dist/components/ChatError/ChatError.const.js +8 -0
  98. package/dist/components/ChatError/ChatError.d.ts +2 -0
  99. package/dist/components/ChatError/ChatError.js +32 -0
  100. package/dist/components/ChatError/ChatError.types.d.ts +14 -0
  101. package/dist/components/ChatError/index.d.ts +2 -0
  102. package/dist/components/CitationList/CitationList.cjs +1 -0
  103. package/dist/components/CitationList/CitationList.d.ts +2 -0
  104. package/dist/components/CitationList/CitationList.js +30 -0
  105. package/dist/components/CitationList/CitationList.types.d.ts +15 -0
  106. package/dist/components/CitationList/helpers/CitationListTitle.cjs +1 -0
  107. package/dist/components/CitationList/helpers/CitationListTitle.d.ts +2 -0
  108. package/dist/components/CitationList/helpers/CitationListTitle.js +10 -0
  109. package/dist/components/CitationList/helpers/index.d.ts +1 -0
  110. package/dist/components/CitationList/index.d.ts +2 -0
  111. package/dist/components/ContextMeter/ContextMeter.cjs +1 -0
  112. package/dist/components/ContextMeter/ContextMeter.const.cjs +1 -0
  113. package/dist/components/ContextMeter/ContextMeter.const.d.ts +6 -0
  114. package/dist/components/ContextMeter/ContextMeter.const.js +11 -0
  115. package/dist/components/ContextMeter/ContextMeter.d.ts +2 -0
  116. package/dist/components/ContextMeter/ContextMeter.js +49 -0
  117. package/dist/components/ContextMeter/ContextMeter.types.d.ts +11 -0
  118. package/dist/components/ContextMeter/ContextMeter.utils.cjs +1 -0
  119. package/dist/components/ContextMeter/ContextMeter.utils.d.ts +2 -0
  120. package/dist/components/ContextMeter/ContextMeter.utils.js +12 -0
  121. package/dist/components/ContextMeter/index.d.ts +2 -0
  122. package/dist/components/CurrencyInput/CurrencyInput.cjs +1 -1
  123. package/dist/components/CurrencyInput/CurrencyInput.js +1 -1
  124. package/dist/components/DatePicker/DatePicker.cjs +1 -1
  125. package/dist/components/DatePicker/DatePicker.js +1 -1
  126. package/dist/components/DateRangePicker/DateRangePicker.cjs +1 -1
  127. package/dist/components/DateRangePicker/DateRangePicker.js +1 -1
  128. package/dist/components/Drawer/Drawer.cjs +1 -1
  129. package/dist/components/Drawer/Drawer.const.cjs +1 -1
  130. package/dist/components/Drawer/Drawer.const.d.ts +4 -12
  131. package/dist/components/Drawer/Drawer.const.js +7 -55
  132. package/dist/components/Drawer/Drawer.d.ts +1 -2
  133. package/dist/components/Drawer/Drawer.js +78 -112
  134. package/dist/components/Drawer/Drawer.types.d.ts +20 -4
  135. package/dist/components/Drawer/Drawer.utils.d.ts +0 -4
  136. package/dist/components/Drawer/components/DrawerHeader/DrawerHeader.cjs +1 -0
  137. package/dist/components/Drawer/components/DrawerHeader/DrawerHeader.d.ts +2 -0
  138. package/dist/components/Drawer/components/DrawerHeader/DrawerHeader.js +26 -0
  139. package/dist/components/Drawer/components/DrawerHeader/DrawerHeader.types.d.ts +20 -0
  140. package/dist/components/Drawer/components/DrawerHeader/DrawerHeaderClose.cjs +1 -0
  141. package/dist/components/Drawer/components/DrawerHeader/DrawerHeaderClose.d.ts +2 -0
  142. package/dist/components/Drawer/components/DrawerHeader/DrawerHeaderClose.js +17 -0
  143. package/dist/components/Drawer/components/DrawerHeader/DrawerHeaderTitle.cjs +1 -0
  144. package/dist/components/Drawer/components/DrawerHeader/DrawerHeaderTitle.d.ts +2 -0
  145. package/dist/components/Drawer/components/DrawerHeader/DrawerHeaderTitle.js +9 -0
  146. package/dist/components/Drawer/components/DrawerHeader/index.d.ts +2 -0
  147. package/dist/components/Drawer/components/index.d.ts +1 -0
  148. package/dist/components/Drawer/helpers/DrawerOptionalHeader.cjs +1 -0
  149. package/dist/components/Drawer/helpers/DrawerOptionalHeader.d.ts +2 -0
  150. package/dist/components/Drawer/helpers/DrawerOptionalHeader.js +9 -0
  151. package/dist/components/Drawer/helpers/index.d.ts +1 -0
  152. package/dist/components/Drawer/hooks/index.d.ts +1 -0
  153. package/dist/components/Drawer/hooks/useDrawer.cjs +1 -0
  154. package/dist/components/Drawer/hooks/useDrawer.d.ts +2 -0
  155. package/dist/components/Drawer/hooks/useDrawer.js +50 -0
  156. package/dist/components/Drawer/index.d.ts +1 -1
  157. package/dist/components/Editable/Editable.cjs +1 -1
  158. package/dist/components/Editable/Editable.js +1 -1
  159. package/dist/components/EmptyState/EmptyState.cjs +1 -1
  160. package/dist/components/EmptyState/EmptyState.const.cjs +1 -1
  161. package/dist/components/EmptyState/EmptyState.const.d.ts +8 -6
  162. package/dist/components/EmptyState/EmptyState.const.js +15 -8
  163. package/dist/components/EmptyState/EmptyState.d.ts +1 -2
  164. package/dist/components/EmptyState/EmptyState.js +39 -43
  165. package/dist/components/EmptyState/EmptyState.types.d.ts +2 -0
  166. package/dist/components/EmptyState/helpers/EmptyStateErrorSvg.cjs +1 -0
  167. package/dist/components/EmptyState/helpers/EmptyStateErrorSvg.d.ts +3 -0
  168. package/dist/components/EmptyState/helpers/EmptyStateErrorSvg.js +8 -0
  169. package/dist/components/EmptyState/helpers/EmptyStateInboxSvg.cjs +1 -0
  170. package/dist/components/EmptyState/helpers/EmptyStateInboxSvg.d.ts +3 -0
  171. package/dist/components/EmptyState/helpers/EmptyStateInboxSvg.js +8 -0
  172. package/dist/components/EmptyState/helpers/EmptyStateSearchSvg.cjs +1 -0
  173. package/dist/components/EmptyState/helpers/EmptyStateSearchSvg.d.ts +3 -0
  174. package/dist/components/EmptyState/helpers/EmptyStateSearchSvg.js +8 -0
  175. package/dist/components/EmptyState/helpers/index.d.ts +3 -0
  176. package/dist/components/EmptyState/index.d.ts +1 -1
  177. package/dist/components/FileTree/FileTree.cjs +1 -1
  178. package/dist/components/FileTree/FileTree.js +1 -1
  179. package/dist/components/FloatingChat/FloatingChat.cjs +1 -1
  180. package/dist/components/FloatingChat/FloatingChat.const.cjs +1 -1
  181. package/dist/components/FloatingChat/FloatingChat.const.d.ts +12 -1
  182. package/dist/components/FloatingChat/FloatingChat.const.js +25 -7
  183. package/dist/components/FloatingChat/FloatingChat.d.ts +1 -18
  184. package/dist/components/FloatingChat/FloatingChat.js +93 -124
  185. package/dist/components/FloatingChat/FloatingChat.types.d.ts +11 -22
  186. package/dist/components/FloatingChat/FloatingChat.utils.cjs +1 -0
  187. package/dist/components/FloatingChat/FloatingChat.utils.d.ts +2 -0
  188. package/dist/components/FloatingChat/FloatingChat.utils.js +12 -0
  189. package/dist/components/FloatingChat/helpers/FloatingChatHeader.cjs +1 -0
  190. package/dist/components/FloatingChat/helpers/FloatingChatHeader.d.ts +9 -0
  191. package/dist/components/FloatingChat/helpers/FloatingChatHeader.js +21 -0
  192. package/dist/components/FloatingChat/helpers/FloatingChatTrigger.cjs +1 -0
  193. package/dist/components/FloatingChat/helpers/FloatingChatTrigger.d.ts +9 -0
  194. package/dist/components/FloatingChat/helpers/FloatingChatTrigger.js +17 -0
  195. package/dist/components/FloatingChat/index.d.ts +1 -1
  196. package/dist/components/FormSkeleton/FormSkeleton.cjs +1 -1
  197. package/dist/components/FormSkeleton/FormSkeleton.d.ts +1 -1
  198. package/dist/components/FormSkeleton/FormSkeleton.js +35 -24
  199. package/dist/components/Gauge/Gauge.cjs +1 -1
  200. package/dist/components/Gauge/Gauge.const.cjs +1 -1
  201. package/dist/components/Gauge/Gauge.const.d.ts +5 -0
  202. package/dist/components/Gauge/Gauge.const.js +11 -6
  203. package/dist/components/Gauge/Gauge.d.ts +1 -2
  204. package/dist/components/Gauge/Gauge.js +69 -45
  205. package/dist/components/Gauge/Gauge.types.d.ts +11 -2
  206. package/dist/components/Gauge/helpers/GaugeLinearBar.cjs +1 -0
  207. package/dist/components/Gauge/helpers/GaugeLinearBar.d.ts +2 -0
  208. package/dist/components/Gauge/helpers/GaugeLinearBar.js +40 -0
  209. package/dist/components/Heatmap/Heatmap.cjs +1 -1
  210. package/dist/components/Heatmap/Heatmap.const.cjs +1 -1
  211. package/dist/components/Heatmap/Heatmap.const.d.ts +2 -0
  212. package/dist/components/Heatmap/Heatmap.const.js +8 -6
  213. package/dist/components/Heatmap/Heatmap.js +51 -47
  214. package/dist/components/Heatmap/Heatmap.types.d.ts +1 -1
  215. package/dist/components/Icon/Icon.d.ts +2 -39
  216. package/dist/components/Icon/Icon.types.d.ts +1 -17
  217. package/dist/components/Icon/icons/action.d.ts +1 -85
  218. package/dist/components/Icon/icons/bear.d.ts +1 -12
  219. package/dist/components/Icon/icons/charts.d.ts +1 -0
  220. package/dist/components/Icon/icons/commerce.d.ts +1 -25
  221. package/dist/components/Icon/icons/communication.d.ts +1 -48
  222. package/dist/components/Icon/icons/content.d.ts +1 -53
  223. package/dist/components/Icon/icons/device.d.ts +1 -27
  224. package/dist/components/Icon/icons/editor.d.ts +1 -54
  225. package/dist/components/Icon/icons/file.d.ts +1 -25
  226. package/dist/components/Icon/icons/index.d.ts +1 -9
  227. package/dist/components/Icon/icons/media.d.ts +1 -64
  228. package/dist/components/Icon/icons/misc.d.ts +1 -96
  229. package/dist/components/Icon/icons/navigation.d.ts +1 -56
  230. package/dist/components/Icon/icons/social.d.ts +1 -24
  231. package/dist/components/Icon/icons/status.d.ts +1 -61
  232. package/dist/components/Icon/index.d.ts +3 -605
  233. package/dist/components/Icon/productIcons.cjs +1 -0
  234. package/dist/components/Icon/productIcons.d.ts +7 -0
  235. package/dist/components/Icon/productIcons.js +25 -0
  236. package/dist/components/ImageAnnotation/ImageAnnotation.cjs +1 -1
  237. package/dist/components/ImageAnnotation/ImageAnnotation.js +1 -1
  238. package/dist/components/JsonViewer/JsonViewer.cjs +1 -1
  239. package/dist/components/JsonViewer/JsonViewer.js +1 -1
  240. package/dist/components/MediaPlayer/MediaPlayer.cjs +1 -1
  241. package/dist/components/MediaPlayer/MediaPlayer.js +1 -1
  242. package/dist/components/MessageActions/MessageActions.cjs +1 -0
  243. package/dist/components/MessageActions/MessageActions.const.cjs +1 -0
  244. package/dist/components/MessageActions/MessageActions.const.d.ts +2 -0
  245. package/dist/components/MessageActions/MessageActions.const.js +10 -0
  246. package/dist/components/MessageActions/MessageActions.d.ts +2 -0
  247. package/dist/components/MessageActions/MessageActions.js +31 -0
  248. package/dist/components/MessageActions/MessageActions.types.d.ts +16 -0
  249. package/dist/components/MessageActions/index.d.ts +2 -0
  250. package/dist/components/Modal/Modal.cjs +1 -1
  251. package/dist/components/Modal/Modal.js +1 -1
  252. package/dist/components/ModelSelect/ModelSelect.cjs +1 -0
  253. package/dist/components/ModelSelect/ModelSelect.const.cjs +1 -0
  254. package/dist/components/ModelSelect/ModelSelect.const.d.ts +1 -0
  255. package/dist/components/ModelSelect/ModelSelect.const.js +4 -0
  256. package/dist/components/ModelSelect/ModelSelect.d.ts +2 -0
  257. package/dist/components/ModelSelect/ModelSelect.js +41 -0
  258. package/dist/components/ModelSelect/ModelSelect.types.d.ts +16 -0
  259. package/dist/components/ModelSelect/index.d.ts +2 -0
  260. package/dist/components/OverlayPortal/OverlayPortal.const.cjs +1 -1
  261. package/dist/components/OverlayPortal/OverlayPortal.const.js +6 -5
  262. package/dist/components/PageNav/PageNav.cjs +1 -1
  263. package/dist/components/PageNav/PageNav.js +1 -1
  264. package/dist/components/PasswordInput/PasswordInput.cjs +1 -1
  265. package/dist/components/PasswordInput/PasswordInput.js +1 -1
  266. package/dist/components/PromptComposer/PromptComposer.cjs +1 -0
  267. package/dist/components/PromptComposer/PromptComposer.const.cjs +1 -0
  268. package/dist/components/PromptComposer/PromptComposer.const.d.ts +6 -0
  269. package/dist/components/PromptComposer/PromptComposer.const.js +14 -0
  270. package/dist/components/PromptComposer/PromptComposer.d.ts +2 -0
  271. package/dist/components/PromptComposer/PromptComposer.js +132 -0
  272. package/dist/components/PromptComposer/PromptComposer.types.d.ts +45 -0
  273. package/dist/components/PromptComposer/PromptComposer.utils.cjs +1 -0
  274. package/dist/components/PromptComposer/PromptComposer.utils.d.ts +5 -0
  275. package/dist/components/PromptComposer/PromptComposer.utils.js +16 -0
  276. package/dist/components/PromptComposer/helpers/PromptComposerAttachSvg.cjs +1 -0
  277. package/dist/components/PromptComposer/helpers/PromptComposerAttachSvg.d.ts +1 -0
  278. package/dist/components/PromptComposer/helpers/PromptComposerAttachSvg.js +6 -0
  279. package/dist/components/PromptComposer/helpers/PromptComposerFileChip.cjs +1 -0
  280. package/dist/components/PromptComposer/helpers/PromptComposerFileChip.d.ts +2 -0
  281. package/dist/components/PromptComposer/helpers/PromptComposerFileChip.js +18 -0
  282. package/dist/components/PromptComposer/helpers/PromptComposerSendSvg.cjs +1 -0
  283. package/dist/components/PromptComposer/helpers/PromptComposerSendSvg.d.ts +1 -0
  284. package/dist/components/PromptComposer/helpers/PromptComposerSendSvg.js +9 -0
  285. package/dist/components/PromptComposer/helpers/PromptComposerStopSvg.cjs +1 -0
  286. package/dist/components/PromptComposer/helpers/PromptComposerStopSvg.d.ts +1 -0
  287. package/dist/components/PromptComposer/helpers/PromptComposerStopSvg.js +6 -0
  288. package/dist/components/PromptComposer/helpers/index.d.ts +4 -0
  289. package/dist/components/PromptComposer/index.d.ts +2 -0
  290. package/dist/components/PromptSuggestions/PromptSuggestions.cjs +1 -0
  291. package/dist/components/PromptSuggestions/PromptSuggestions.d.ts +2 -0
  292. package/dist/components/PromptSuggestions/PromptSuggestions.js +39 -0
  293. package/dist/components/PromptSuggestions/PromptSuggestions.types.d.ts +13 -0
  294. package/dist/components/PromptSuggestions/index.d.ts +2 -0
  295. package/dist/components/PropsPlayground/PropsPlayground.cjs +1 -1
  296. package/dist/components/PropsPlayground/PropsPlayground.js +1 -1
  297. package/dist/components/Rating/components/StarIcon/StarIcon.cjs +1 -1
  298. package/dist/components/Rating/components/StarIcon/StarIcon.js +1 -1
  299. package/dist/components/Result/Result.utils.cjs +1 -1
  300. package/dist/components/Result/Result.utils.js +1 -1
  301. package/dist/components/RichEditor/components/ToolbarColorPicker/ToolbarColorPicker.cjs +1 -1
  302. package/dist/components/RichEditor/components/ToolbarColorPicker/ToolbarColorPicker.js +1 -1
  303. package/dist/components/RichEditor/components/ToolbarDropdown/ToolbarDropdown.cjs +1 -1
  304. package/dist/components/RichEditor/components/ToolbarDropdown/ToolbarDropdown.js +1 -1
  305. package/dist/components/RichEditor/components/ToolbarMore/ToolbarMore.cjs +1 -1
  306. package/dist/components/RichEditor/components/ToolbarMore/ToolbarMore.js +1 -1
  307. package/dist/components/RichEditor/components/ToolbarSignature/ToolbarSignature.cjs +1 -1
  308. package/dist/components/RichEditor/components/ToolbarSignature/ToolbarSignature.js +1 -1
  309. package/dist/components/RichEditor/helpers/IconRender.cjs +1 -1
  310. package/dist/components/RichEditor/helpers/IconRender.js +1 -1
  311. package/dist/components/RichEditor/helpers/toolbarItemRender.cjs +1 -1
  312. package/dist/components/RichEditor/helpers/toolbarItemRender.js +1 -1
  313. package/dist/components/RingProgress/RingProgress.cjs +1 -1
  314. package/dist/components/RingProgress/RingProgress.const.cjs +1 -1
  315. package/dist/components/RingProgress/RingProgress.const.d.ts +3 -0
  316. package/dist/components/RingProgress/RingProgress.const.js +7 -4
  317. package/dist/components/RingProgress/RingProgress.js +38 -37
  318. package/dist/components/RingProgress/RingProgress.types.d.ts +1 -0
  319. package/dist/components/Select/Select.cjs +1 -1
  320. package/dist/components/Select/Select.js +23 -23
  321. package/dist/components/Select/helpers/SelectCheckSvg.cjs +1 -0
  322. package/dist/components/Select/helpers/SelectCheckSvg.d.ts +3 -0
  323. package/dist/components/Select/helpers/SelectCheckSvg.js +8 -0
  324. package/dist/components/Select/helpers/SelectChevronDownSvg.cjs +1 -0
  325. package/dist/components/Select/helpers/SelectChevronDownSvg.d.ts +3 -0
  326. package/dist/components/Select/helpers/SelectChevronDownSvg.js +8 -0
  327. package/dist/components/Select/helpers/index.d.ts +2 -0
  328. package/dist/components/Sidebar/Sidebar.cjs +1 -1
  329. package/dist/components/Sidebar/Sidebar.js +16 -15
  330. package/dist/components/Sidebar/Sidebar.types.d.ts +1 -1
  331. package/dist/components/Sidebar/Sidebar.utils.cjs +1 -0
  332. package/dist/components/Sidebar/Sidebar.utils.d.ts +2 -0
  333. package/dist/components/Sidebar/Sidebar.utils.js +11 -0
  334. package/dist/components/Sidebar/components/SidebarGroup/SidebarGroup.cjs +1 -1
  335. package/dist/components/Sidebar/components/SidebarGroup/SidebarGroup.js +1 -1
  336. package/dist/components/Sidebar/components/SidebarItem/SidebarItem.cjs +1 -1
  337. package/dist/components/Sidebar/components/SidebarItem/SidebarItem.js +55 -51
  338. package/dist/components/Sidebar/index.d.ts +1 -0
  339. package/dist/components/Skeleton/Skeleton.cjs +1 -1
  340. package/dist/components/Skeleton/Skeleton.const.cjs +2 -2
  341. package/dist/components/Skeleton/Skeleton.const.js +5 -6
  342. package/dist/components/Skeleton/Skeleton.js +59 -59
  343. package/dist/components/SliderRange/SliderRange.cjs +1 -1
  344. package/dist/components/SliderRange/SliderRange.js +19 -19
  345. package/dist/components/Sparkline/Sparkline.cjs +1 -1
  346. package/dist/components/Sparkline/Sparkline.const.cjs +1 -1
  347. package/dist/components/Sparkline/Sparkline.const.d.ts +5 -0
  348. package/dist/components/Sparkline/Sparkline.const.js +9 -4
  349. package/dist/components/Sparkline/Sparkline.d.ts +1 -2
  350. package/dist/components/Sparkline/Sparkline.js +75 -53
  351. package/dist/components/Sparkline/Sparkline.types.d.ts +2 -0
  352. package/dist/components/Sparkline/Sparkline.utils.cjs +1 -1
  353. package/dist/components/Sparkline/Sparkline.utils.d.ts +7 -12
  354. package/dist/components/Sparkline/Sparkline.utils.js +33 -20
  355. package/dist/components/Sparkline/index.d.ts +2 -2
  356. package/dist/components/StatCard/StatCard.cjs +1 -1
  357. package/dist/components/StatCard/StatCard.const.cjs +1 -1
  358. package/dist/components/StatCard/StatCard.const.d.ts +0 -7
  359. package/dist/components/StatCard/StatCard.const.js +5 -12
  360. package/dist/components/StatCard/StatCard.d.ts +1 -2
  361. package/dist/components/StatCard/StatCard.js +48 -37
  362. package/dist/components/StatCard/StatCard.utils.cjs +1 -0
  363. package/dist/components/StatCard/StatCard.utils.d.ts +2 -0
  364. package/dist/components/StatCard/StatCard.utils.js +7 -0
  365. package/dist/components/Stepper/Stepper.cjs +1 -1
  366. package/dist/components/Stepper/Stepper.js +1 -1
  367. package/dist/components/StreamingMessage/StreamingMessage.cjs +1 -0
  368. package/dist/components/StreamingMessage/StreamingMessage.const.cjs +1 -0
  369. package/dist/components/StreamingMessage/StreamingMessage.const.d.ts +5 -0
  370. package/dist/components/StreamingMessage/StreamingMessage.const.js +10 -0
  371. package/dist/components/StreamingMessage/StreamingMessage.d.ts +2 -0
  372. package/dist/components/StreamingMessage/StreamingMessage.js +48 -0
  373. package/dist/components/StreamingMessage/StreamingMessage.types.d.ts +15 -0
  374. package/dist/components/StreamingMessage/index.d.ts +2 -0
  375. package/dist/components/Tabs/TabList.cjs +1 -1
  376. package/dist/components/Tabs/TabList.js +1 -1
  377. package/dist/components/ThemeSwitcher/ThemeSwitcher.cjs +1 -0
  378. package/dist/components/ThemeSwitcher/ThemeSwitcher.const.cjs +1 -0
  379. package/dist/components/ThemeSwitcher/ThemeSwitcher.const.d.ts +7 -0
  380. package/dist/components/ThemeSwitcher/ThemeSwitcher.const.js +14 -0
  381. package/dist/components/ThemeSwitcher/ThemeSwitcher.d.ts +2 -0
  382. package/dist/components/ThemeSwitcher/ThemeSwitcher.js +39 -0
  383. package/dist/components/ThemeSwitcher/ThemeSwitcher.types.d.ts +14 -0
  384. package/dist/components/ThemeSwitcher/index.d.ts +2 -0
  385. package/dist/components/ThinkingBlock/ThinkingBlock.cjs +1 -0
  386. package/dist/components/ThinkingBlock/ThinkingBlock.const.cjs +1 -0
  387. package/dist/components/ThinkingBlock/ThinkingBlock.const.d.ts +4 -0
  388. package/dist/components/ThinkingBlock/ThinkingBlock.const.js +9 -0
  389. package/dist/components/ThinkingBlock/ThinkingBlock.d.ts +2 -0
  390. package/dist/components/ThinkingBlock/ThinkingBlock.js +45 -0
  391. package/dist/components/ThinkingBlock/ThinkingBlock.types.d.ts +16 -0
  392. package/dist/components/ThinkingBlock/index.d.ts +2 -0
  393. package/dist/components/TimePicker/TimePicker.cjs +1 -1
  394. package/dist/components/TimePicker/TimePicker.js +1 -1
  395. package/dist/components/TimelineChart/TimelineChart.cjs +1 -1
  396. package/dist/components/TimelineChart/TimelineChart.const.cjs +1 -1
  397. package/dist/components/TimelineChart/TimelineChart.const.d.ts +3 -0
  398. package/dist/components/TimelineChart/TimelineChart.const.js +7 -4
  399. package/dist/components/TimelineChart/TimelineChart.js +56 -42
  400. package/dist/components/TimelineChart/TimelineChart.types.d.ts +1 -1
  401. package/dist/components/ToolCall/ToolCall.cjs +1 -0
  402. package/dist/components/ToolCall/ToolCall.const.cjs +1 -0
  403. package/dist/components/ToolCall/ToolCall.const.d.ts +5 -0
  404. package/dist/components/ToolCall/ToolCall.const.js +17 -0
  405. package/dist/components/ToolCall/ToolCall.d.ts +2 -0
  406. package/dist/components/ToolCall/ToolCall.js +43 -0
  407. package/dist/components/ToolCall/ToolCall.types.d.ts +20 -0
  408. package/dist/components/ToolCall/index.d.ts +2 -0
  409. package/dist/components/Transition/Transition.const.cjs +1 -1
  410. package/dist/components/Transition/Transition.const.js +12 -6
  411. package/dist/components/Transition/Transition.types.d.ts +1 -1
  412. package/dist/components/TreeSelect/TreeSelect.cjs +1 -1
  413. package/dist/components/TreeSelect/TreeSelect.js +1 -1
  414. package/dist/components/TreeSelect/components/TreeSelectExpandControl/TreeSelectExpandControl.cjs +1 -1
  415. package/dist/components/TreeSelect/components/TreeSelectExpandControl/TreeSelectExpandControl.js +1 -1
  416. package/dist/components/TreeView/TreeView.cjs +1 -1
  417. package/dist/components/TreeView/TreeView.js +3 -2
  418. package/dist/components/TreeView/components/TreeViewExpandControl/TreeViewExpandControl.cjs +1 -1
  419. package/dist/components/TreeView/components/TreeViewExpandControl/TreeViewExpandControl.js +1 -1
  420. package/dist/components/TreeView/components/TreeViewNodeIcon/TreeViewNodeIcon.cjs +1 -1
  421. package/dist/components/TreeView/components/TreeViewNodeIcon/TreeViewNodeIcon.js +1 -1
  422. package/dist/components/index.cjs +1 -1
  423. package/dist/components/index.d.ts +39 -11
  424. package/dist/components/index.js +455 -420
  425. package/dist/constants/generals.const.cjs +1 -1
  426. package/dist/constants/generals.const.d.ts +50 -0
  427. package/dist/constants/generals.const.js +154 -108
  428. package/dist/constants/keys.const.cjs +1 -1
  429. package/dist/constants/keys.const.js +2 -1
  430. package/dist/constants/numbers.const.cjs +1 -1
  431. package/dist/constants/numbers.const.d.ts +7 -0
  432. package/dist/constants/numbers.const.js +60 -52
  433. package/dist/context/BearProvider.cjs +1 -1
  434. package/dist/context/BearProvider.d.ts +19 -44
  435. package/dist/context/BearProvider.js +223 -208
  436. package/dist/context/bearProvider.types.d.ts +4 -0
  437. package/dist/context/index.d.ts +1 -1
  438. package/dist/hooks/useFixedAnchorPosition/index.d.ts +1 -1
  439. package/dist/hooks/useFixedAnchorPosition/useFixedAnchorPosition.const.cjs +1 -1
  440. package/dist/hooks/useFixedAnchorPosition/useFixedAnchorPosition.const.d.ts +2 -1
  441. package/dist/hooks/useFixedAnchorPosition/useFixedAnchorPosition.const.js +12 -11
  442. package/dist/hooks/useFixedAnchorPosition/useFixedAnchorPosition.types.d.ts +1 -1
  443. package/dist/icons.cjs +1 -1
  444. package/dist/icons.d.ts +2 -2
  445. package/dist/icons.js +1 -6
  446. package/dist/index.cjs +1 -1
  447. package/dist/index.js +597 -562
  448. package/dist/styles/_ai-chat.css +487 -0
  449. package/dist/styles/_base.css +2 -0
  450. package/dist/styles/_chart.css +144 -0
  451. package/dist/styles/_drawer.css +213 -0
  452. package/dist/styles/_effects.css +8 -4
  453. package/dist/styles/_overlays.css +0 -1
  454. package/dist/styles/_skeleton.css +90 -0
  455. package/dist/styles/main.css +4 -0
  456. package/dist/styles.css +1089 -186
  457. package/package.json +5 -1
  458. package/dist/components/FormSkeleton/FormSkeleton.const.cjs +0 -1
  459. package/dist/components/FormSkeleton/FormSkeleton.const.d.ts +0 -5
  460. package/dist/components/FormSkeleton/FormSkeleton.const.js +0 -8
  461. package/dist/components/Icon/Icon.cjs +0 -1
  462. package/dist/components/Icon/Icon.const.d.ts +0 -1
  463. package/dist/components/Icon/Icon.js +0 -45
  464. package/dist/components/Icon/icons/action.cjs +0 -1
  465. package/dist/components/Icon/icons/action.js +0 -351
  466. package/dist/components/Icon/icons/bear.cjs +0 -1
  467. package/dist/components/Icon/icons/bear.js +0 -47
  468. package/dist/components/Icon/icons/commerce.cjs +0 -1
  469. package/dist/components/Icon/icons/commerce.js +0 -124
  470. package/dist/components/Icon/icons/communication.cjs +0 -1
  471. package/dist/components/Icon/icons/communication.js +0 -184
  472. package/dist/components/Icon/icons/content.cjs +0 -1
  473. package/dist/components/Icon/icons/content.js +0 -231
  474. package/dist/components/Icon/icons/device.cjs +0 -1
  475. package/dist/components/Icon/icons/device.js +0 -122
  476. package/dist/components/Icon/icons/editor.cjs +0 -1
  477. package/dist/components/Icon/icons/editor.js +0 -285
  478. package/dist/components/Icon/icons/file.cjs +0 -1
  479. package/dist/components/Icon/icons/file.js +0 -120
  480. package/dist/components/Icon/icons/media.cjs +0 -1
  481. package/dist/components/Icon/icons/media.js +0 -306
  482. package/dist/components/Icon/icons/misc.cjs +0 -1
  483. package/dist/components/Icon/icons/misc.js +0 -450
  484. package/dist/components/Icon/icons/navigation.cjs +0 -1
  485. package/dist/components/Icon/icons/navigation.js +0 -215
  486. package/dist/components/Icon/icons/social.cjs +0 -1
  487. package/dist/components/Icon/icons/social.js +0 -89
  488. package/dist/components/Icon/icons/status.cjs +0 -1
  489. package/dist/components/Icon/icons/status.js +0 -271
  490. package/dist/components/Icon/index.cjs +0 -1
  491. package/dist/components/Icon/index.js +0 -79
@@ -1,73 +1,83 @@
1
- import { jsxs as o, jsx as s } from "react/jsx-runtime";
2
- import { useMemo as f } from "react";
3
- import { cn as u } from "../../utils/cn.js";
4
- const b = ({
5
- data: n,
6
- height: y = 200,
7
- showLabels: d = !0,
8
- showDots: h = !0,
9
- smooth: p = !0,
10
- fill: $ = !1,
11
- strokeWidth: v = 2,
12
- color: i = "var(--bear-primary-500, #ec4899)",
13
- animated: x = !0,
14
- className: g,
15
- ...N
16
- }) => {
17
- const a = f(() => {
18
- const r = Math.max(...n.map((t) => t.value)), e = Math.min(...n.map((t) => t.value)), l = r - e || 1;
19
- return n.map((t, c) => ({
20
- x: c / (n.length - 1 || 1) * 100,
21
- y: 100 - (t.value - e) / l * 80 - 10,
22
- ...t
23
- }));
24
- }, [n]), m = f(() => a.length === 0 ? "" : p ? a.reduce((r, e, l, t) => {
25
- if (l === 0) return `M ${e.x},${e.y}`;
26
- const c = t[l - 1], k = c.x + (e.x - c.x) / 3, w = e.x - (e.x - c.x) / 3;
27
- return `${r} C ${k},${c.y} ${w},${e.y} ${e.x},${e.y}`;
28
- }, "") : a.reduce((r, e, l) => `${r} ${l === 0 ? "M" : "L"} ${e.x},${e.y}`, ""), [a, p]), L = f(() => a.length === 0 ? "" : `${m} L 100,100 L 0,100 Z`, [m, a]);
29
- return /* @__PURE__ */ o("div", { className: u("w-full", g), style: { height: y }, ...N, children: [
30
- /* @__PURE__ */ o("svg", { viewBox: "0 0 100 100", preserveAspectRatio: "none", className: "w-full h-full", children: [
31
- /* @__PURE__ */ s("defs", { children: /* @__PURE__ */ o("linearGradient", { id: "line-gradient", x1: "0%", y1: "0%", x2: "0%", y2: "100%", children: [
32
- /* @__PURE__ */ s("stop", { offset: "0%", stopColor: i, stopOpacity: "0.3" }),
33
- /* @__PURE__ */ s("stop", { offset: "100%", stopColor: i, stopOpacity: "0" })
34
- ] }) }),
35
- $ && /* @__PURE__ */ s(
36
- "path",
37
- {
38
- d: L,
39
- fill: "url(#line-gradient)",
40
- className: u(x && "animate-fade-in")
41
- }
42
- ),
43
- /* @__PURE__ */ s(
44
- "path",
45
- {
46
- d: m,
47
- fill: "none",
48
- stroke: i,
49
- strokeWidth: v / 10,
50
- strokeLinecap: "round",
51
- strokeLinejoin: "round",
52
- className: u(x && "animate-draw-line")
53
- }
54
- ),
55
- h && a.map((r, e) => /* @__PURE__ */ s(
56
- "circle",
57
- {
58
- cx: r.x,
59
- cy: r.y,
60
- r: 1.5,
61
- fill: i,
62
- className: u(x && "animate-scale-in"),
63
- style: { animationDelay: `${e * 50}ms` }
64
- },
65
- e
66
- ))
67
- ] }),
68
- d && /* @__PURE__ */ s("div", { className: "flex justify-between mt-2", children: n.map((r, e) => /* @__PURE__ */ s("span", { className: "text-xs text-gray-600 dark:text-slate-300", children: r.label }, e)) })
69
- ] });
1
+ import { jsxs as c, jsx as e } from "react/jsx-runtime";
2
+ import { ZERO as v, TEN as W, FIFTY as b } from "../../constants/numbers.const.js";
3
+ import { cn as s } from "../../utils/cn.js";
4
+ import "react";
5
+ import { resolveBearId as x } from "../../utils/generateBearId.utils.js";
6
+ import { useBearId as k } from "../../utils/useBearId.js";
7
+ import { CHART as a } from "./Chart.const.js";
8
+ import { calculateLinePoints as A, generateLinePath as R } from "./Chart.utils.js";
9
+ const G = (I) => {
10
+ const {
11
+ data: o,
12
+ height: B = a.DEFAULT_HEIGHT,
13
+ showLabels: y = !0,
14
+ showDots: C = !0,
15
+ smooth: E = !0,
16
+ fill: L = !1,
17
+ stepped: d = !1,
18
+ strokeWidth: u = a.DEFAULT_STROKE_WIDTH,
19
+ color: r = "var(--bear-primary-500, #ec4899)",
20
+ animated: i = !0,
21
+ className: O,
22
+ id: _,
23
+ testId: $,
24
+ ...g
25
+ } = I, D = k("LineChart"), m = x(_, D), p = `${m}-gradient`, l = A(o), h = R(l, E && !d, d), N = l.length === v ? "" : `${h} L ${a.VIEWBOX},${a.VIEWBOX} L 0,${a.VIEWBOX} Z`, T = { "--Bear-Chart-height": `${B}px` };
26
+ return /* @__PURE__ */ c(
27
+ "div",
28
+ {
29
+ id: m,
30
+ "data-testid": $,
31
+ className: s("Bear-Chart Bear-Chart--line", O),
32
+ style: T,
33
+ ...g,
34
+ children: [
35
+ /* @__PURE__ */ c("svg", { viewBox: `0 0 ${a.VIEWBOX} ${a.VIEWBOX}`, preserveAspectRatio: "none", className: "Bear-Chart__svg", children: [
36
+ /* @__PURE__ */ e("defs", { children: /* @__PURE__ */ c("linearGradient", { id: p, x1: "0%", y1: "0%", x2: "0%", y2: "100%", children: [
37
+ /* @__PURE__ */ e("stop", { offset: "0%", stopColor: r, stopOpacity: "0.3" }),
38
+ /* @__PURE__ */ e("stop", { offset: "100%", stopColor: r, stopOpacity: "0" })
39
+ ] }) }),
40
+ L && /* @__PURE__ */ e(
41
+ "path",
42
+ {
43
+ d: N,
44
+ fill: `url(#${p})`,
45
+ className: s(i && "animate-fade-in")
46
+ }
47
+ ),
48
+ /* @__PURE__ */ e(
49
+ "path",
50
+ {
51
+ d: h,
52
+ fill: "none",
53
+ stroke: r,
54
+ strokeWidth: u / W,
55
+ strokeLinecap: "round",
56
+ strokeLinejoin: "round",
57
+ className: s(i && "animate-draw-line")
58
+ }
59
+ ),
60
+ C && l.map((t, n) => {
61
+ var f;
62
+ return /* @__PURE__ */ e(
63
+ "circle",
64
+ {
65
+ cx: t.x,
66
+ cy: t.y,
67
+ r: a.DOT_RADIUS,
68
+ fill: r,
69
+ className: s(i && "animate-scale-in"),
70
+ style: { animationDelay: `${n * b}ms` }
71
+ },
72
+ ((f = o[n]) == null ? void 0 : f.label) ?? n
73
+ );
74
+ })
75
+ ] }),
76
+ y && /* @__PURE__ */ e("div", { className: "Bear-Chart__labels", children: o.map((t) => /* @__PURE__ */ e("span", { className: "Bear-Chart__label", children: t.label }, t.label)) })
77
+ ]
78
+ }
79
+ );
70
80
  };
71
81
  export {
72
- b as LineChart
82
+ G as LineChart
73
83
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),b=require("react"),A=require("../../utils/cn.cjs"),X=require("../Portal/Portal.cjs"),g=require("../Card/Card.cjs"),L=require("./Chart.utils.cjs"),c=45,Y=({data:s,height:N=200,showLabels:R=!0,innerRadius:w=0,startAngle:P=-90,padAngle:f=2,animated:_=!0,onSliceClick:d,onSliceHover:x,showSliceTooltip:j=!0,sliceTooltipTitle:y,sliceTooltipDescription:m,sliceTooltipContent:v,className:B,...C})=>{const h=s.reduce((r,e)=>r+e.value,0),[n,o]=b.useState(null),q=b.useCallback((r,e,a)=>{const u=s[a];if(x==null||x(u,a),!j)return;const l=Math.round(u.value/h*100);o({x:r,y:e,index:a,label:u.label,value:u.value,pct:l})},[s,x,j,h]),E=b.useCallback(()=>{o(null),x==null||x(null,null)},[x]),O=b.useMemo(()=>{let r=P;return s.map((e,a)=>{const u=e.value/h*360-f,l={startAngle:r,endAngle:r+u,color:L.getChartColor(a,e.color),...e};return r+=u+f,l})},[s,h,P,f]),$=(r,e)=>{const a=r*Math.PI/180;return{x:50+e*Math.cos(a),y:50+e*Math.sin(a)}},U=(r,e)=>{const a=w*c,u=$(r,c),l=$(e,c),I=$(r,a),p=$(e,a),M=e-r>180?1:0;return w>0?`M ${u.x},${u.y} A ${c},${c} 0 ${M},1 ${l.x},${l.y} L ${p.x},${p.y} A ${a},${a} 0 ${M},0 ${I.x},${I.y} Z`:`M 50,50 L ${u.x},${u.y} A ${c},${c} 0 ${M},1 ${l.x},${l.y} Z`};return t.jsxs("div",{className:A.cn("relative flex max-w-full flex-wrap items-center gap-4",B),...C,children:[t.jsx("div",{style:{width:N,height:N},className:"min-w-0 shrink-0",children:t.jsx("svg",{viewBox:"0 0 100 100",className:"h-full w-full",children:O.map((r,e)=>t.jsx("path",{d:U(r.startAngle,r.endAngle),fill:r.color,className:A.cn(d&&"cursor-pointer","transition-opacity hover:opacity-80",_&&"animate-scale-in"),style:{animationDelay:`${e*100}ms`},onClick:()=>d==null?void 0:d(s[e],e),tabIndex:0,role:"button","aria-label":`${s[e].label} ${Math.round(s[e].value/h*100)}%`,onKeyDown:a=>{(a.key==="Enter"||a.key===" ")&&(a.preventDefault(),d==null||d(s[e],e))},onMouseEnter:a=>q(a.clientX,a.clientY,e),onMouseMove:a=>q(a.clientX,a.clientY,e),onMouseLeave:E},e))})}),R&&t.jsx("div",{className:"flex flex-col gap-2",children:s.map((r,e)=>t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:L.getChartColor(e,r.color)}}),t.jsx("span",{className:"text-sm text-gray-600 dark:text-slate-300",children:r.label}),t.jsxs("span",{className:"text-sm text-gray-400 dark:text-slate-500",children:[Math.round(r.value/h*100),"%"]})]},e))}),n&&j&&t.jsx(X.Portal,{children:t.jsx("div",{className:"pointer-events-none fixed z-[11500] w-56 max-w-[calc(100vw-24px)]",style:{left:n.x+12,top:n.y+12},children:t.jsxs(g.Card,{variant:"elevated",padding:"none",children:[(y||m)&&t.jsx(g.CardHeader,{title:(y==null?void 0:y(s[n.index],n.index))??n.label,subtitle:m==null?void 0:m(s[n.index],n.index)}),t.jsx(g.CardBody,{className:"bear-text-xs bear-text-gray-500 dark:bear-text-slate-400",children:(v==null?void 0:v(s[n.index],n.index))??t.jsxs("span",{children:[n.value," (",n.pct,"%)"]})})]})})})]})};exports.PieChart=Y;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),J=require("react"),d=require("../../constants/numbers.const.cjs"),_=require("../../utils/cn.cjs"),Q=require("../../utils/generateBearId.utils.cjs"),ee=require("../../utils/useBearId.cjs"),te=require("../Portal/Portal.cjs"),T=require("../Card/Card.cjs"),p=require("../Flex/Flex.cjs"),w=require("../Box/Box.cjs"),D=require("../Typography/Typography.cjs"),t=require("./Chart.const.cjs"),R=require("./Chart.utils.cjs"),ae=S=>{const{data:s,height:y=t.CHART.DEFAULT_HEIGHT,showLabels:f=!0,innerRadius:q=d.ZERO,startAngle:M,padAngle:x=t.CHART.DEFAULT_PAD_ANGLE,animated:U=!0,pieView:I=t.PIE_VIEW_FULL,explodeIndex:V,legendPosition:B="right",onSliceClick:i,onSliceHover:u,showSliceTooltip:m=!0,sliceTooltipTitle:A,sliceTooltipDescription:E,sliceTooltipContent:C,className:O,id:W,testId:b,...H}=S,$=ee.useBearId("PieChart"),v=Q.resolveBearId(W,$),h=s.reduce((e,a)=>e+a.value,d.ZERO),[l,j]=J.useState(null),L=I===t.PIE_VIEW_HALF,N=I===t.PIE_VIEW_ROSE,P=L?t.CHART.HALF_SWEEP:t.CHART.FULL_SWEEP,X=M??(L?t.CHART.HALF_PIE_START:t.CHART.DEFAULT_START_ANGLE),Z=Math.max(...s.map(e=>e.value),d.ONE),G=B===t.CHART_LEGEND_NONE||!f,Y=B===t.CHART_LEGEND_BOTTOM,F=(e,a,c)=>{const o=s[c];if(u==null||u(o,c),!m)return;const n=Math.round(o.value/h*t.CHART.VIEWBOX);j({x:e,y:a,index:c,label:o.label,value:o.value,pct:n})},k=()=>{j(null),u==null||u(null,null)};if(s.length===d.ZERO||h===d.ZERO)return r.jsx(p.Flex,{id:v,"data-testid":b,align:"center",justify:"center",className:_.cn("Bear-Chart Bear-Chart--pie Bear-Chart--empty",O),style:{"--Bear-Chart-height":`${y}px`},...H});let g=X;const z=s.map((e,a)=>{const c=N?P/s.length-x:e.value/h*P-x,o=g,n=g+c;g+=c+x;const K=N?t.CHART.ROSE_MIN_RADIUS+e.value/Z*(t.CHART.OUTER_RADIUS-t.CHART.ROSE_MIN_RADIUS):t.CHART.OUTER_RADIUS;return{startAngle:o,endAngle:n,color:R.getChartColor(a,e.color),outerRadius:K,...e}});return r.jsxs(p.Flex,{id:v,"data-testid":b,direction:Y?"column":"row",align:"center",gap:4,wrap:"wrap",className:_.cn("Bear-Chart Bear-Chart--pie",O),style:{"--Bear-Chart-height":`${y}px`},...H,children:[r.jsx(w.Box,{className:"Bear-Chart__pie-canvas",children:r.jsx("svg",{viewBox:`0 0 ${t.CHART.VIEWBOX} ${t.CHART.VIEWBOX}`,className:"Bear-Chart__svg",children:z.map((e,a)=>{const c=(e.startAngle+e.endAngle)/2,o=V===a?R.polarOffset(c,t.CHART.EXPLODE_OFFSET):{x:d.ZERO,y:d.ZERO};return r.jsx("g",{transform:`translate(${o.x} ${o.y})`,children:r.jsx("path",{d:R.createArcPath(e.startAngle,e.endAngle,q,e.outerRadius),fill:e.color,className:_.cn(i&&"bear-cursor-pointer","bear-transition-opacity hover:bear-opacity-80",U&&"animate-scale-in"),style:{animationDelay:`${a*t.CHART.SLICE_DELAY_MS}ms`},onClick:()=>i==null?void 0:i(s[a],a),tabIndex:0,role:"button","aria-label":`${s[a].label} ${Math.round(s[a].value/h*t.CHART.VIEWBOX)}%`,onKeyDown:n=>{(n.key==="Enter"||n.key===" ")&&(n.preventDefault(),i==null||i(s[a],a))},onMouseEnter:n=>F(n.clientX,n.clientY,a),onMouseMove:n=>F(n.clientX,n.clientY,a),onMouseLeave:k})},e.label)})})}),!G&&r.jsx(p.Flex,{direction:"column",gap:2,children:s.map((e,a)=>r.jsxs(p.Flex,{align:"center",gap:2,children:[r.jsx(w.Box,{className:"Bear-Chart__swatch",style:{"--Bear-Chart-color":R.getChartColor(a,e.color)}}),r.jsx(D.Typography,{variant:"body2",color:"muted",children:e.label}),r.jsxs(D.Typography,{variant:"body2",color:"muted",children:[Math.round(e.value/h*t.CHART.VIEWBOX),"%"]})]},e.label))}),l&&m&&r.jsx(te.Portal,{children:r.jsx("div",{className:"pointer-events-none fixed z-[11500] w-56 max-w-[calc(100vw-24px)]",style:{left:l.x+12,top:l.y+12},children:r.jsxs(T.Card,{variant:"elevated",padding:"none",children:[(A||E)&&r.jsx(T.CardHeader,{title:(A==null?void 0:A(s[l.index],l.index))??l.label,subtitle:E==null?void 0:E(s[l.index],l.index)}),r.jsx(T.CardBody,{className:"bear-text-xs bear-text-gray-500 dark:bear-text-slate-400",children:(C==null?void 0:C(s[l.index],l.index))??r.jsxs("span",{children:[l.value," (",l.pct,"%)"]})})]})})})]})};exports.PieChart=ae;
@@ -1,3 +1,2 @@
1
- import { FC } from 'react';
2
1
  import { PieChartProps } from './Chart.types';
3
- export declare const PieChart: FC<PieChartProps>;
2
+ export declare const PieChart: (props: PieChartProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,110 +1,145 @@
1
- import { jsxs as h, jsx as u } from "react/jsx-runtime";
2
- import { useState as K, useCallback as L, useMemo as O } from "react";
3
- import { cn as j } from "../../utils/cn.js";
4
- import { Portal as R } from "../Portal/Portal.js";
5
- import { Card as q, CardHeader as F, CardBody as G } from "../Card/Card.js";
6
- import { getChartColor as B } from "./Chart.utils.js";
7
- const l = 45, C = ({
8
- data: t,
9
- height: N = 200,
10
- showLabels: E = !0,
11
- innerRadius: g = 0,
12
- startAngle: w = -90,
13
- padAngle: b = 2,
14
- animated: U = !0,
15
- onSliceClick: d,
16
- onSliceHover: x,
17
- showSliceTooltip: v = !0,
18
- sliceTooltipTitle: y,
19
- sliceTooltipDescription: f,
20
- sliceTooltipContent: M,
21
- className: X,
22
- ...Y
23
- }) => {
24
- const $ = t.reduce((e, r) => e + r.value, 0), [n, o] = K(null), I = L(
25
- (e, r, a) => {
26
- const s = t[a];
27
- if (x == null || x(s, a), !v) return;
28
- const m = Math.round(s.value / $ * 100);
29
- o({ x: e, y: r, index: a, label: s.label, value: s.value, pct: m });
30
- },
31
- [t, x, v, $]
32
- ), Z = L(() => {
33
- o(null), x == null || x(null, null);
34
- }, [x]), _ = O(() => {
35
- let e = w;
36
- return t.map((r, a) => {
37
- const s = r.value / $ * 360 - b, m = {
38
- startAngle: e,
39
- endAngle: e + s,
40
- color: B(a, r.color),
41
- ...r
42
- };
43
- return e += s + b, m;
44
- });
45
- }, [t, $, w, b]), c = (e, r) => {
46
- const a = e * Math.PI / 180;
47
- return { x: 50 + r * Math.cos(a), y: 50 + r * Math.sin(a) };
48
- }, z = (e, r) => {
49
- const a = g * l, s = c(e, l), m = c(r, l), P = c(e, a), A = c(r, a), p = r - e > 180 ? 1 : 0;
50
- return g > 0 ? `M ${s.x},${s.y} A ${l},${l} 0 ${p},1 ${m.x},${m.y} L ${A.x},${A.y} A ${a},${a} 0 ${p},0 ${P.x},${P.y} Z` : `M 50,50 L ${s.x},${s.y} A ${l},${l} 0 ${p},1 ${m.x},${m.y} Z`;
1
+ import { jsx as l, jsxs as h } from "react/jsx-runtime";
2
+ import { useState as J } from "react";
3
+ import { ZERO as p, ONE as Q } from "../../constants/numbers.const.js";
4
+ import { cn as f } from "../../utils/cn.js";
5
+ import { resolveBearId as ee } from "../../utils/generateBearId.utils.js";
6
+ import { useBearId as ae } from "../../utils/useBearId.js";
7
+ import { Portal as te } from "../Portal/Portal.js";
8
+ import { Card as re, CardHeader as ne, CardBody as oe } from "../Card/Card.js";
9
+ import { Flex as g } from "../Flex/Flex.js";
10
+ import { Box as P } from "../Box/Box.js";
11
+ import { Typography as M } from "../Typography/Typography.js";
12
+ import { CHART as t, PIE_VIEW_FULL as le, PIE_VIEW_ROSE as se, CHART_LEGEND_NONE as ce, CHART_LEGEND_BOTTOM as ie, PIE_VIEW_HALF as de } from "./Chart.const.js";
13
+ import { getChartColor as S, createArcPath as pe, polarOffset as me } from "./Chart.utils.js";
14
+ const Le = (F) => {
15
+ const {
16
+ data: r,
17
+ height: y = t.DEFAULT_HEIGHT,
18
+ showLabels: U = !0,
19
+ innerRadius: V = p,
20
+ startAngle: W,
21
+ padAngle: _ = t.DEFAULT_PAD_ANGLE,
22
+ animated: $ = !0,
23
+ pieView: B = le,
24
+ explodeIndex: X,
25
+ legendPosition: b = "right",
26
+ onSliceClick: i,
27
+ onSliceHover: d,
28
+ showSliceTooltip: v = !0,
29
+ sliceTooltipTitle: u,
30
+ sliceTooltipDescription: E,
31
+ sliceTooltipContent: A,
32
+ className: x,
33
+ id: H,
34
+ testId: L,
35
+ ...C
36
+ } = F, G = ae("PieChart"), R = ee(H, G), m = r.reduce((e, a) => e + a.value, p), [o, N] = J(null), O = B === de, T = B === se, w = O ? t.HALF_SWEEP : t.FULL_SWEEP, j = W ?? (O ? t.HALF_PIE_START : t.DEFAULT_START_ANGLE), Y = Math.max(...r.map((e) => e.value), Q), k = b === ce || !U, z = b === ie, D = (e, a, c) => {
37
+ const s = r[c];
38
+ if (d == null || d(s, c), !v)
39
+ return;
40
+ const n = Math.round(s.value / m * t.VIEWBOX);
41
+ N({ x: e, y: a, index: c, label: s.label, value: s.value, pct: n });
42
+ }, K = () => {
43
+ N(null), d == null || d(null, null);
51
44
  };
52
- return /* @__PURE__ */ h("div", { className: j("relative flex max-w-full flex-wrap items-center gap-4", X), ...Y, children: [
53
- /* @__PURE__ */ u("div", { style: { width: N, height: N }, className: "min-w-0 shrink-0", children: /* @__PURE__ */ u("svg", { viewBox: "0 0 100 100", className: "h-full w-full", children: _.map((e, r) => /* @__PURE__ */ u(
54
- "path",
45
+ if (r.length === p || m === p)
46
+ return /* @__PURE__ */ l(
47
+ g,
55
48
  {
56
- d: z(e.startAngle, e.endAngle),
57
- fill: e.color,
58
- className: j(
59
- d && "cursor-pointer",
60
- "transition-opacity hover:opacity-80",
61
- U && "animate-scale-in"
62
- ),
63
- style: { animationDelay: `${r * 100}ms` },
64
- onClick: () => d == null ? void 0 : d(t[r], r),
65
- tabIndex: 0,
66
- role: "button",
67
- "aria-label": `${t[r].label} ${Math.round(t[r].value / $ * 100)}%`,
68
- onKeyDown: (a) => {
69
- (a.key === "Enter" || a.key === " ") && (a.preventDefault(), d == null || d(t[r], r));
70
- },
71
- onMouseEnter: (a) => I(a.clientX, a.clientY, r),
72
- onMouseMove: (a) => I(a.clientX, a.clientY, r),
73
- onMouseLeave: Z
74
- },
75
- r
76
- )) }) }),
77
- E && /* @__PURE__ */ u("div", { className: "flex flex-col gap-2", children: t.map((e, r) => /* @__PURE__ */ h("div", { className: "flex items-center gap-2", children: [
78
- /* @__PURE__ */ u(
79
- "div",
80
- {
81
- className: "w-3 h-3 rounded-full",
82
- style: { backgroundColor: B(r, e.color) }
83
- }
84
- ),
85
- /* @__PURE__ */ u("span", { className: "text-sm text-gray-600 dark:text-slate-300", children: e.label }),
86
- /* @__PURE__ */ h("span", { className: "text-sm text-gray-400 dark:text-slate-500", children: [
87
- Math.round(e.value / $ * 100),
88
- "%"
89
- ] })
90
- ] }, r)) }),
91
- n && v && /* @__PURE__ */ u(R, { children: /* @__PURE__ */ u("div", { className: "pointer-events-none fixed z-[11500] w-56 max-w-[calc(100vw-24px)]", style: { left: n.x + 12, top: n.y + 12 }, children: /* @__PURE__ */ h(q, { variant: "elevated", padding: "none", children: [
92
- (y || f) && /* @__PURE__ */ u(
93
- F,
94
- {
95
- title: (y == null ? void 0 : y(t[n.index], n.index)) ?? n.label,
96
- subtitle: f == null ? void 0 : f(t[n.index], n.index)
97
- }
98
- ),
99
- /* @__PURE__ */ u(G, { className: "bear-text-xs bear-text-gray-500 dark:bear-text-slate-400", children: (M == null ? void 0 : M(t[n.index], n.index)) ?? /* @__PURE__ */ h("span", { children: [
100
- n.value,
101
- " (",
102
- n.pct,
103
- "%)"
104
- ] }) })
105
- ] }) }) })
106
- ] });
49
+ id: R,
50
+ "data-testid": L,
51
+ align: "center",
52
+ justify: "center",
53
+ className: f("Bear-Chart Bear-Chart--pie Bear-Chart--empty", x),
54
+ style: { "--Bear-Chart-height": `${y}px` },
55
+ ...C
56
+ }
57
+ );
58
+ let I = j;
59
+ const Z = r.map((e, a) => {
60
+ const c = T ? w / r.length - _ : e.value / m * w - _, s = I, n = I + c;
61
+ I += c + _;
62
+ const q = T ? t.ROSE_MIN_RADIUS + e.value / Y * (t.OUTER_RADIUS - t.ROSE_MIN_RADIUS) : t.OUTER_RADIUS;
63
+ return {
64
+ startAngle: s,
65
+ endAngle: n,
66
+ color: S(a, e.color),
67
+ outerRadius: q,
68
+ ...e
69
+ };
70
+ });
71
+ return /* @__PURE__ */ h(
72
+ g,
73
+ {
74
+ id: R,
75
+ "data-testid": L,
76
+ direction: z ? "column" : "row",
77
+ align: "center",
78
+ gap: 4,
79
+ wrap: "wrap",
80
+ className: f("Bear-Chart Bear-Chart--pie", x),
81
+ style: { "--Bear-Chart-height": `${y}px` },
82
+ ...C,
83
+ children: [
84
+ /* @__PURE__ */ l(P, { className: "Bear-Chart__pie-canvas", children: /* @__PURE__ */ l("svg", { viewBox: `0 0 ${t.VIEWBOX} ${t.VIEWBOX}`, className: "Bear-Chart__svg", children: Z.map((e, a) => {
85
+ const c = (e.startAngle + e.endAngle) / 2, s = X === a ? me(c, t.EXPLODE_OFFSET) : { x: p, y: p };
86
+ return /* @__PURE__ */ l("g", { transform: `translate(${s.x} ${s.y})`, children: /* @__PURE__ */ l(
87
+ "path",
88
+ {
89
+ d: pe(e.startAngle, e.endAngle, V, e.outerRadius),
90
+ fill: e.color,
91
+ className: f(
92
+ i && "bear-cursor-pointer",
93
+ "bear-transition-opacity hover:bear-opacity-80",
94
+ $ && "animate-scale-in"
95
+ ),
96
+ style: { animationDelay: `${a * t.SLICE_DELAY_MS}ms` },
97
+ onClick: () => i == null ? void 0 : i(r[a], a),
98
+ tabIndex: 0,
99
+ role: "button",
100
+ "aria-label": `${r[a].label} ${Math.round(r[a].value / m * t.VIEWBOX)}%`,
101
+ onKeyDown: (n) => {
102
+ (n.key === "Enter" || n.key === " ") && (n.preventDefault(), i == null || i(r[a], a));
103
+ },
104
+ onMouseEnter: (n) => D(n.clientX, n.clientY, a),
105
+ onMouseMove: (n) => D(n.clientX, n.clientY, a),
106
+ onMouseLeave: K
107
+ }
108
+ ) }, e.label);
109
+ }) }) }),
110
+ !k && /* @__PURE__ */ l(g, { direction: "column", gap: 2, children: r.map((e, a) => /* @__PURE__ */ h(g, { align: "center", gap: 2, children: [
111
+ /* @__PURE__ */ l(
112
+ P,
113
+ {
114
+ className: "Bear-Chart__swatch",
115
+ style: { "--Bear-Chart-color": S(a, e.color) }
116
+ }
117
+ ),
118
+ /* @__PURE__ */ l(M, { variant: "body2", color: "muted", children: e.label }),
119
+ /* @__PURE__ */ h(M, { variant: "body2", color: "muted", children: [
120
+ Math.round(e.value / m * t.VIEWBOX),
121
+ "%"
122
+ ] })
123
+ ] }, e.label)) }),
124
+ o && v && /* @__PURE__ */ l(te, { children: /* @__PURE__ */ l("div", { className: "pointer-events-none fixed z-[11500] w-56 max-w-[calc(100vw-24px)]", style: { left: o.x + 12, top: o.y + 12 }, children: /* @__PURE__ */ h(re, { variant: "elevated", padding: "none", children: [
125
+ (u || E) && /* @__PURE__ */ l(
126
+ ne,
127
+ {
128
+ title: (u == null ? void 0 : u(r[o.index], o.index)) ?? o.label,
129
+ subtitle: E == null ? void 0 : E(r[o.index], o.index)
130
+ }
131
+ ),
132
+ /* @__PURE__ */ l(oe, { className: "bear-text-xs bear-text-gray-500 dark:bear-text-slate-400", children: (A == null ? void 0 : A(r[o.index], o.index)) ?? /* @__PURE__ */ h("span", { children: [
133
+ o.value,
134
+ " (",
135
+ o.pct,
136
+ "%)"
137
+ ] }) })
138
+ ] }) }) })
139
+ ]
140
+ }
141
+ );
107
142
  };
108
143
  export {
109
- C as PieChart
144
+ Le as PieChart
110
145
  };
@@ -0,0 +1,8 @@
1
+ export interface SliceTooltipState {
2
+ x: number;
3
+ y: number;
4
+ index: number;
5
+ label: string;
6
+ value: number;
7
+ pct: number;
8
+ }
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),c=require("../../constants/numbers.const.cjs"),T=require("../../utils/cn.cjs");require("react");const U=require("../../utils/generateBearId.utils.cjs"),D=require("../../utils/useBearId.cjs"),a=require("./Chart.const.cjs"),l=require("./Chart.utils.cjs"),L=m=>{const{data:n,height:g=a.CHART.DEFAULT_HEIGHT,showLabels:x=!0,showValues:y=!1,animated:p=!0,color:R,className:d,id:H,testId:C,...u}=m,S=D.useBearId("RadarChart"),h=U.resolveBearId(H,S),A=n.length,E={"--Bear-Chart-height":`${g}px`};if(A===c.ZERO)return o.jsx("div",{id:h,"data-testid":C,className:T.cn("Bear-Chart Bear-Chart--radar Bear-Chart--empty",d),style:E,...u});const I=Math.max(...n.map(e=>e.value),c.ONE),i=a.CHART.FULL_SWEEP/A,_=n.map((e,r)=>{const t=a.CHART.DEFAULT_START_ANGLE+r*i,s=e.value/I*a.CHART.OUTER_RADIUS;return l.polarToCartesian(t,s)}),b=_.map(e=>`${e.x},${e.y}`).join(" "),B=Array.from({length:a.CHART.RADAR_RINGS},(e,r)=>{const t=(r+c.ONE)/a.CHART.RADAR_RINGS*a.CHART.OUTER_RADIUS;return Array.from({length:A},(s,N)=>{const O=a.CHART.DEFAULT_START_ANGLE+N*i;return l.polarToCartesian(O,t)})});return o.jsx("div",{id:h,"data-testid":C,className:T.cn("Bear-Chart Bear-Chart--radar",d),style:E,...u,children:o.jsxs("svg",{viewBox:`0 0 ${a.CHART.VIEWBOX} ${a.CHART.VIEWBOX}`,className:"Bear-Chart__svg",children:[B.map((e,r)=>o.jsx("polygon",{points:e.map(t=>`${t.x},${t.y}`).join(" "),fill:"none",stroke:"var(--bear-border-default, #e5e5e5)",strokeWidth:.4},r)),n.map((e,r)=>{const t=a.CHART.DEFAULT_START_ANGLE+r*i,s=l.polarToCartesian(t,a.CHART.OUTER_RADIUS);return o.jsx("line",{x1:a.CHART.CENTER,y1:a.CHART.CENTER,x2:s.x,y2:s.y,stroke:"var(--bear-border-default, #e5e5e5)",strokeWidth:.4},e.label)}),o.jsx("polygon",{points:b,fill:l.getChartColor(c.ZERO,R),fillOpacity:.25,stroke:l.getChartColor(c.ZERO,R),strokeWidth:.8,className:T.cn(p&&"animate-scale-in")}),_.map((e,r)=>o.jsx("circle",{cx:e.x,cy:e.y,r:a.CHART.DOT_RADIUS,fill:l.getChartColor(r,n[r].color||R)},n[r].label)),x&&n.map((e,r)=>{const t=a.CHART.DEFAULT_START_ANGLE+r*i,s=l.polarToCartesian(t,a.CHART.OUTER_RADIUS+a.CHART.RADAR_LABEL_OFFSET);return o.jsxs("text",{x:s.x,y:s.y,textAnchor:"middle",dominantBaseline:"middle",className:"bear-fill-[var(--bear-text-secondary)]",fontSize:4,children:[e.label,y?` ${e.value}`:""]},`${e.label}-label`)})]})})};exports.RadarChart=L;
@@ -0,0 +1,2 @@
1
+ import { RadarChartProps } from './Chart.types';
2
+ export declare const RadarChart: (props: RadarChartProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,123 @@
1
+ import { jsx as s, jsxs as y } from "react/jsx-runtime";
2
+ import { ZERO as m, ONE as f } from "../../constants/numbers.const.js";
3
+ import { cn as A } from "../../utils/cn.js";
4
+ import "react";
5
+ import { resolveBearId as O } from "../../utils/generateBearId.utils.js";
6
+ import { useBearId as $ } from "../../utils/useBearId.js";
7
+ import { CHART as a } from "./Chart.const.js";
8
+ import { polarToCartesian as i, getChartColor as R } from "./Chart.utils.js";
9
+ const P = (g) => {
10
+ const {
11
+ data: l,
12
+ height: x = a.DEFAULT_HEIGHT,
13
+ showLabels: S = !0,
14
+ showValues: C = !1,
15
+ animated: I = !0,
16
+ color: c,
17
+ className: h,
18
+ id: N,
19
+ testId: E,
20
+ ...p
21
+ } = g, U = $("RadarChart"), T = O(N, U), d = l.length, _ = { "--Bear-Chart-height": `${x}px` };
22
+ if (d === m)
23
+ return /* @__PURE__ */ s(
24
+ "div",
25
+ {
26
+ id: T,
27
+ "data-testid": E,
28
+ className: A("Bear-Chart Bear-Chart--radar Bear-Chart--empty", h),
29
+ style: _,
30
+ ...p
31
+ }
32
+ );
33
+ const B = Math.max(...l.map((e) => e.value), f), n = a.FULL_SWEEP / d, u = l.map((e, r) => {
34
+ const t = a.DEFAULT_START_ANGLE + r * n, o = e.value / B * a.OUTER_RADIUS;
35
+ return i(t, o);
36
+ }), D = u.map((e) => `${e.x},${e.y}`).join(" "), L = Array.from({ length: a.RADAR_RINGS }, (e, r) => {
37
+ const t = (r + f) / a.RADAR_RINGS * a.OUTER_RADIUS;
38
+ return Array.from({ length: d }, (o, b) => {
39
+ const v = a.DEFAULT_START_ANGLE + b * n;
40
+ return i(v, t);
41
+ });
42
+ });
43
+ return /* @__PURE__ */ s(
44
+ "div",
45
+ {
46
+ id: T,
47
+ "data-testid": E,
48
+ className: A("Bear-Chart Bear-Chart--radar", h),
49
+ style: _,
50
+ ...p,
51
+ children: /* @__PURE__ */ y("svg", { viewBox: `0 0 ${a.VIEWBOX} ${a.VIEWBOX}`, className: "Bear-Chart__svg", children: [
52
+ L.map((e, r) => /* @__PURE__ */ s(
53
+ "polygon",
54
+ {
55
+ points: e.map((t) => `${t.x},${t.y}`).join(" "),
56
+ fill: "none",
57
+ stroke: "var(--bear-border-default, #e5e5e5)",
58
+ strokeWidth: 0.4
59
+ },
60
+ r
61
+ )),
62
+ l.map((e, r) => {
63
+ const t = a.DEFAULT_START_ANGLE + r * n, o = i(t, a.OUTER_RADIUS);
64
+ return /* @__PURE__ */ s(
65
+ "line",
66
+ {
67
+ x1: a.CENTER,
68
+ y1: a.CENTER,
69
+ x2: o.x,
70
+ y2: o.y,
71
+ stroke: "var(--bear-border-default, #e5e5e5)",
72
+ strokeWidth: 0.4
73
+ },
74
+ e.label
75
+ );
76
+ }),
77
+ /* @__PURE__ */ s(
78
+ "polygon",
79
+ {
80
+ points: D,
81
+ fill: R(m, c),
82
+ fillOpacity: 0.25,
83
+ stroke: R(m, c),
84
+ strokeWidth: 0.8,
85
+ className: A(I && "animate-scale-in")
86
+ }
87
+ ),
88
+ u.map((e, r) => /* @__PURE__ */ s(
89
+ "circle",
90
+ {
91
+ cx: e.x,
92
+ cy: e.y,
93
+ r: a.DOT_RADIUS,
94
+ fill: R(r, l[r].color || c)
95
+ },
96
+ l[r].label
97
+ )),
98
+ S && l.map((e, r) => {
99
+ const t = a.DEFAULT_START_ANGLE + r * n, o = i(t, a.OUTER_RADIUS + a.RADAR_LABEL_OFFSET);
100
+ return /* @__PURE__ */ y(
101
+ "text",
102
+ {
103
+ x: o.x,
104
+ y: o.y,
105
+ textAnchor: "middle",
106
+ dominantBaseline: "middle",
107
+ className: "bear-fill-[var(--bear-text-secondary)]",
108
+ fontSize: 4,
109
+ children: [
110
+ e.label,
111
+ C ? ` ${e.value}` : ""
112
+ ]
113
+ },
114
+ `${e.label}-label`
115
+ );
116
+ })
117
+ ] })
118
+ }
119
+ );
120
+ };
121
+ export {
122
+ P as RadarChart
123
+ };
@@ -2,4 +2,6 @@ export { Chart } from './Chart';
2
2
  export { BarChart } from './BarChart';
3
3
  export { LineChart } from './LineChart';
4
4
  export { PieChart } from './PieChart';
5
- export type { ChartProps, BarChartProps, LineChartProps, PieChartProps, ChartDataPoint, ChartType, } from './Chart.types';
5
+ export { RadarChart } from './RadarChart';
6
+ export { FunnelChart } from './FunnelChart';
7
+ export type { ChartProps, BarChartProps, LineChartProps, PieChartProps, RadarChartProps, FunnelChartProps, ChartDataPoint, ChartType, PieView, ChartLegendPosition, } from './Chart.types';