@forgedevstack/bear 1.3.2 → 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 (306) hide show
  1. package/README.md +4 -0
  2. package/dist/components/ApprovalCard/ApprovalCard.cjs +1 -0
  3. package/dist/components/ApprovalCard/ApprovalCard.const.cjs +1 -0
  4. package/dist/components/ApprovalCard/ApprovalCard.const.d.ts +2 -0
  5. package/dist/components/ApprovalCard/ApprovalCard.const.js +8 -0
  6. package/dist/components/ApprovalCard/ApprovalCard.d.ts +2 -0
  7. package/dist/components/ApprovalCard/ApprovalCard.js +25 -0
  8. package/dist/components/ApprovalCard/ApprovalCard.types.d.ts +15 -0
  9. package/dist/components/ApprovalCard/index.d.ts +2 -0
  10. package/dist/components/ArtifactCard/ArtifactCard.cjs +1 -0
  11. package/dist/components/ArtifactCard/ArtifactCard.const.cjs +1 -0
  12. package/dist/components/ArtifactCard/ArtifactCard.const.d.ts +3 -0
  13. package/dist/components/ArtifactCard/ArtifactCard.const.js +8 -0
  14. package/dist/components/ArtifactCard/ArtifactCard.d.ts +2 -0
  15. package/dist/components/ArtifactCard/ArtifactCard.js +43 -0
  16. package/dist/components/ArtifactCard/ArtifactCard.types.d.ts +15 -0
  17. package/dist/components/ArtifactCard/index.d.ts +2 -0
  18. package/dist/components/Banner/Banner.const.cjs +1 -1
  19. package/dist/components/Banner/Banner.const.js +9 -8
  20. package/dist/components/Chart/BarChart.cjs +1 -1
  21. package/dist/components/Chart/BarChart.js +65 -72
  22. package/dist/components/Chart/Chart.cjs +1 -1
  23. package/dist/components/Chart/Chart.js +21 -18
  24. package/dist/components/Chart/Chart.types.d.ts +1 -1
  25. package/dist/components/Chart/FunnelChart.cjs +1 -1
  26. package/dist/components/Chart/FunnelChart.js +38 -36
  27. package/dist/components/Chart/LineChart.cjs +1 -1
  28. package/dist/components/Chart/LineChart.js +74 -60
  29. package/dist/components/Chart/PieChart.cjs +1 -1
  30. package/dist/components/Chart/PieChart.js +102 -82
  31. package/dist/components/Chart/RadarChart.cjs +1 -1
  32. package/dist/components/Chart/RadarChart.d.ts +1 -1
  33. package/dist/components/Chart/RadarChart.js +116 -93
  34. package/dist/components/Chat/Chat.cjs +1 -1
  35. package/dist/components/Chat/Chat.const.cjs +1 -1
  36. package/dist/components/Chat/Chat.const.d.ts +9 -22
  37. package/dist/components/Chat/Chat.const.js +18 -26
  38. package/dist/components/Chat/Chat.d.ts +1 -20
  39. package/dist/components/Chat/Chat.js +107 -162
  40. package/dist/components/Chat/Chat.types.d.ts +20 -27
  41. package/dist/components/Chat/Chat.utils.cjs +1 -0
  42. package/dist/components/Chat/Chat.utils.d.ts +2 -0
  43. package/dist/components/Chat/Chat.utils.js +10 -0
  44. package/dist/components/Chat/helpers/ChatTypingIndicator.cjs +1 -0
  45. package/dist/components/Chat/helpers/ChatTypingIndicator.d.ts +3 -0
  46. package/dist/components/Chat/helpers/ChatTypingIndicator.js +14 -0
  47. package/dist/components/Chat/index.d.ts +2 -1
  48. package/dist/components/ChatBubble/ChatBubble.cjs +1 -0
  49. package/dist/components/ChatBubble/ChatBubble.const.cjs +1 -0
  50. package/dist/components/ChatBubble/ChatBubble.const.d.ts +13 -0
  51. package/dist/components/ChatBubble/ChatBubble.const.js +17 -0
  52. package/dist/components/ChatBubble/ChatBubble.d.ts +2 -0
  53. package/dist/components/ChatBubble/ChatBubble.js +32 -0
  54. package/dist/components/ChatBubble/ChatBubble.types.d.ts +12 -0
  55. package/dist/components/ChatBubble/ChatBubble.utils.cjs +1 -0
  56. package/dist/components/ChatBubble/ChatBubble.utils.d.ts +6 -0
  57. package/dist/components/ChatBubble/ChatBubble.utils.js +15 -0
  58. package/dist/components/ChatBubble/helpers/ChatBubbleSystem.cjs +1 -0
  59. package/dist/components/ChatBubble/helpers/ChatBubbleSystem.d.ts +2 -0
  60. package/dist/components/ChatBubble/helpers/ChatBubbleSystem.js +21 -0
  61. package/dist/components/ChatBubble/helpers/ChatBubbleThread.cjs +1 -0
  62. package/dist/components/ChatBubble/helpers/ChatBubbleThread.d.ts +4 -0
  63. package/dist/components/ChatBubble/helpers/ChatBubbleThread.js +63 -0
  64. package/dist/components/ChatBubble/index.d.ts +2 -0
  65. package/dist/components/ChatError/ChatError.cjs +1 -0
  66. package/dist/components/ChatError/ChatError.const.cjs +1 -0
  67. package/dist/components/ChatError/ChatError.const.d.ts +2 -0
  68. package/dist/components/ChatError/ChatError.const.js +8 -0
  69. package/dist/components/ChatError/ChatError.d.ts +2 -0
  70. package/dist/components/ChatError/ChatError.js +32 -0
  71. package/dist/components/ChatError/ChatError.types.d.ts +14 -0
  72. package/dist/components/ChatError/index.d.ts +2 -0
  73. package/dist/components/CitationList/CitationList.cjs +1 -0
  74. package/dist/components/CitationList/CitationList.d.ts +2 -0
  75. package/dist/components/CitationList/CitationList.js +30 -0
  76. package/dist/components/CitationList/CitationList.types.d.ts +15 -0
  77. package/dist/components/CitationList/helpers/CitationListTitle.cjs +1 -0
  78. package/dist/components/CitationList/helpers/CitationListTitle.d.ts +2 -0
  79. package/dist/components/CitationList/helpers/CitationListTitle.js +10 -0
  80. package/dist/components/CitationList/helpers/index.d.ts +1 -0
  81. package/dist/components/CitationList/index.d.ts +2 -0
  82. package/dist/components/ContextMeter/ContextMeter.cjs +1 -0
  83. package/dist/components/ContextMeter/ContextMeter.const.cjs +1 -0
  84. package/dist/components/ContextMeter/ContextMeter.const.d.ts +6 -0
  85. package/dist/components/ContextMeter/ContextMeter.const.js +11 -0
  86. package/dist/components/ContextMeter/ContextMeter.d.ts +2 -0
  87. package/dist/components/ContextMeter/ContextMeter.js +49 -0
  88. package/dist/components/ContextMeter/ContextMeter.types.d.ts +11 -0
  89. package/dist/components/ContextMeter/ContextMeter.utils.cjs +1 -0
  90. package/dist/components/ContextMeter/ContextMeter.utils.d.ts +2 -0
  91. package/dist/components/ContextMeter/ContextMeter.utils.js +12 -0
  92. package/dist/components/ContextMeter/index.d.ts +2 -0
  93. package/dist/components/Drawer/Drawer.cjs +1 -1
  94. package/dist/components/Drawer/Drawer.const.cjs +1 -1
  95. package/dist/components/Drawer/Drawer.const.d.ts +2 -1
  96. package/dist/components/Drawer/Drawer.const.js +7 -6
  97. package/dist/components/Drawer/Drawer.d.ts +1 -1
  98. package/dist/components/Drawer/Drawer.js +93 -83
  99. package/dist/components/Drawer/Drawer.types.d.ts +4 -1
  100. package/dist/components/Drawer/hooks/useDrawer.cjs +1 -1
  101. package/dist/components/Drawer/hooks/useDrawer.js +33 -34
  102. package/dist/components/Drawer/index.d.ts +1 -1
  103. package/dist/components/EmptyState/EmptyState.cjs +1 -1
  104. package/dist/components/EmptyState/EmptyState.const.cjs +1 -1
  105. package/dist/components/EmptyState/EmptyState.const.d.ts +8 -6
  106. package/dist/components/EmptyState/EmptyState.const.js +15 -8
  107. package/dist/components/EmptyState/EmptyState.d.ts +1 -2
  108. package/dist/components/EmptyState/EmptyState.js +39 -43
  109. package/dist/components/EmptyState/EmptyState.types.d.ts +2 -0
  110. package/dist/components/EmptyState/helpers/EmptyStateErrorSvg.cjs +1 -0
  111. package/dist/components/EmptyState/helpers/EmptyStateErrorSvg.d.ts +3 -0
  112. package/dist/components/EmptyState/helpers/EmptyStateErrorSvg.js +8 -0
  113. package/dist/components/EmptyState/helpers/EmptyStateInboxSvg.cjs +1 -0
  114. package/dist/components/EmptyState/helpers/EmptyStateInboxSvg.d.ts +3 -0
  115. package/dist/components/EmptyState/helpers/EmptyStateInboxSvg.js +8 -0
  116. package/dist/components/EmptyState/helpers/EmptyStateSearchSvg.cjs +1 -0
  117. package/dist/components/EmptyState/helpers/EmptyStateSearchSvg.d.ts +3 -0
  118. package/dist/components/EmptyState/helpers/EmptyStateSearchSvg.js +8 -0
  119. package/dist/components/EmptyState/helpers/index.d.ts +3 -0
  120. package/dist/components/EmptyState/index.d.ts +1 -1
  121. package/dist/components/FloatingChat/FloatingChat.cjs +1 -1
  122. package/dist/components/FloatingChat/FloatingChat.const.cjs +1 -1
  123. package/dist/components/FloatingChat/FloatingChat.const.d.ts +12 -1
  124. package/dist/components/FloatingChat/FloatingChat.const.js +25 -7
  125. package/dist/components/FloatingChat/FloatingChat.d.ts +1 -18
  126. package/dist/components/FloatingChat/FloatingChat.js +93 -124
  127. package/dist/components/FloatingChat/FloatingChat.types.d.ts +11 -22
  128. package/dist/components/FloatingChat/FloatingChat.utils.cjs +1 -0
  129. package/dist/components/FloatingChat/FloatingChat.utils.d.ts +2 -0
  130. package/dist/components/FloatingChat/FloatingChat.utils.js +12 -0
  131. package/dist/components/FloatingChat/helpers/FloatingChatHeader.cjs +1 -0
  132. package/dist/components/FloatingChat/helpers/FloatingChatHeader.d.ts +9 -0
  133. package/dist/components/FloatingChat/helpers/FloatingChatHeader.js +21 -0
  134. package/dist/components/FloatingChat/helpers/FloatingChatTrigger.cjs +1 -0
  135. package/dist/components/FloatingChat/helpers/FloatingChatTrigger.d.ts +9 -0
  136. package/dist/components/FloatingChat/helpers/FloatingChatTrigger.js +17 -0
  137. package/dist/components/FloatingChat/index.d.ts +1 -1
  138. package/dist/components/FormSkeleton/FormSkeleton.cjs +1 -1
  139. package/dist/components/FormSkeleton/FormSkeleton.d.ts +1 -1
  140. package/dist/components/FormSkeleton/FormSkeleton.js +35 -24
  141. package/dist/components/Icon/index.d.ts +1 -0
  142. package/dist/components/Icon/productIcons.cjs +1 -0
  143. package/dist/components/Icon/productIcons.d.ts +7 -0
  144. package/dist/components/Icon/productIcons.js +25 -0
  145. package/dist/components/MessageActions/MessageActions.cjs +1 -0
  146. package/dist/components/MessageActions/MessageActions.const.cjs +1 -0
  147. package/dist/components/MessageActions/MessageActions.const.d.ts +2 -0
  148. package/dist/components/MessageActions/MessageActions.const.js +10 -0
  149. package/dist/components/MessageActions/MessageActions.d.ts +2 -0
  150. package/dist/components/MessageActions/MessageActions.js +31 -0
  151. package/dist/components/MessageActions/MessageActions.types.d.ts +16 -0
  152. package/dist/components/MessageActions/index.d.ts +2 -0
  153. package/dist/components/Modal/Modal.cjs +1 -1
  154. package/dist/components/Modal/Modal.js +1 -1
  155. package/dist/components/ModelSelect/ModelSelect.cjs +1 -0
  156. package/dist/components/ModelSelect/ModelSelect.const.cjs +1 -0
  157. package/dist/components/ModelSelect/ModelSelect.const.d.ts +1 -0
  158. package/dist/components/ModelSelect/ModelSelect.const.js +4 -0
  159. package/dist/components/ModelSelect/ModelSelect.d.ts +2 -0
  160. package/dist/components/ModelSelect/ModelSelect.js +41 -0
  161. package/dist/components/ModelSelect/ModelSelect.types.d.ts +16 -0
  162. package/dist/components/ModelSelect/index.d.ts +2 -0
  163. package/dist/components/OverlayPortal/OverlayPortal.const.cjs +1 -1
  164. package/dist/components/OverlayPortal/OverlayPortal.const.js +6 -5
  165. package/dist/components/PasswordInput/PasswordInput.cjs +1 -1
  166. package/dist/components/PasswordInput/PasswordInput.js +5 -5
  167. package/dist/components/PromptComposer/PromptComposer.cjs +1 -0
  168. package/dist/components/PromptComposer/PromptComposer.const.cjs +1 -0
  169. package/dist/components/PromptComposer/PromptComposer.const.d.ts +6 -0
  170. package/dist/components/PromptComposer/PromptComposer.const.js +14 -0
  171. package/dist/components/PromptComposer/PromptComposer.d.ts +2 -0
  172. package/dist/components/PromptComposer/PromptComposer.js +132 -0
  173. package/dist/components/PromptComposer/PromptComposer.types.d.ts +45 -0
  174. package/dist/components/PromptComposer/PromptComposer.utils.cjs +1 -0
  175. package/dist/components/PromptComposer/PromptComposer.utils.d.ts +5 -0
  176. package/dist/components/PromptComposer/PromptComposer.utils.js +16 -0
  177. package/dist/components/PromptComposer/helpers/PromptComposerAttachSvg.cjs +1 -0
  178. package/dist/components/PromptComposer/helpers/PromptComposerAttachSvg.d.ts +1 -0
  179. package/dist/components/PromptComposer/helpers/PromptComposerAttachSvg.js +6 -0
  180. package/dist/components/PromptComposer/helpers/PromptComposerFileChip.cjs +1 -0
  181. package/dist/components/PromptComposer/helpers/PromptComposerFileChip.d.ts +2 -0
  182. package/dist/components/PromptComposer/helpers/PromptComposerFileChip.js +18 -0
  183. package/dist/components/PromptComposer/helpers/PromptComposerSendSvg.cjs +1 -0
  184. package/dist/components/PromptComposer/helpers/PromptComposerSendSvg.d.ts +1 -0
  185. package/dist/components/PromptComposer/helpers/PromptComposerSendSvg.js +9 -0
  186. package/dist/components/PromptComposer/helpers/PromptComposerStopSvg.cjs +1 -0
  187. package/dist/components/PromptComposer/helpers/PromptComposerStopSvg.d.ts +1 -0
  188. package/dist/components/PromptComposer/helpers/PromptComposerStopSvg.js +6 -0
  189. package/dist/components/PromptComposer/helpers/index.d.ts +4 -0
  190. package/dist/components/PromptComposer/index.d.ts +2 -0
  191. package/dist/components/PromptSuggestions/PromptSuggestions.cjs +1 -0
  192. package/dist/components/PromptSuggestions/PromptSuggestions.d.ts +2 -0
  193. package/dist/components/PromptSuggestions/PromptSuggestions.js +39 -0
  194. package/dist/components/PromptSuggestions/PromptSuggestions.types.d.ts +13 -0
  195. package/dist/components/PromptSuggestions/index.d.ts +2 -0
  196. package/dist/components/RichEditor/helpers/IconRender.cjs +1 -1
  197. package/dist/components/RichEditor/helpers/IconRender.js +16 -16
  198. package/dist/components/RichEditor/helpers/toolbarItemRender.cjs +1 -1
  199. package/dist/components/RichEditor/helpers/toolbarItemRender.js +23 -23
  200. package/dist/components/Select/Select.cjs +1 -1
  201. package/dist/components/Select/Select.js +23 -23
  202. package/dist/components/Select/helpers/SelectCheckSvg.cjs +1 -0
  203. package/dist/components/Select/helpers/SelectCheckSvg.d.ts +3 -0
  204. package/dist/components/Select/helpers/SelectCheckSvg.js +8 -0
  205. package/dist/components/Select/helpers/SelectChevronDownSvg.cjs +1 -0
  206. package/dist/components/Select/helpers/SelectChevronDownSvg.d.ts +3 -0
  207. package/dist/components/Select/helpers/SelectChevronDownSvg.js +8 -0
  208. package/dist/components/Select/helpers/index.d.ts +2 -0
  209. package/dist/components/Skeleton/Skeleton.cjs +1 -1
  210. package/dist/components/Skeleton/Skeleton.const.cjs +2 -2
  211. package/dist/components/Skeleton/Skeleton.const.js +5 -6
  212. package/dist/components/Skeleton/Skeleton.js +59 -59
  213. package/dist/components/StatCard/StatCard.cjs +1 -1
  214. package/dist/components/StatCard/StatCard.const.cjs +1 -1
  215. package/dist/components/StatCard/StatCard.const.d.ts +0 -7
  216. package/dist/components/StatCard/StatCard.const.js +5 -12
  217. package/dist/components/StatCard/StatCard.d.ts +1 -2
  218. package/dist/components/StatCard/StatCard.js +48 -37
  219. package/dist/components/StatCard/StatCard.utils.cjs +1 -0
  220. package/dist/components/StatCard/StatCard.utils.d.ts +2 -0
  221. package/dist/components/StatCard/StatCard.utils.js +7 -0
  222. package/dist/components/StreamingMessage/StreamingMessage.cjs +1 -0
  223. package/dist/components/StreamingMessage/StreamingMessage.const.cjs +1 -0
  224. package/dist/components/StreamingMessage/StreamingMessage.const.d.ts +5 -0
  225. package/dist/components/StreamingMessage/StreamingMessage.const.js +10 -0
  226. package/dist/components/StreamingMessage/StreamingMessage.d.ts +2 -0
  227. package/dist/components/StreamingMessage/StreamingMessage.js +48 -0
  228. package/dist/components/StreamingMessage/StreamingMessage.types.d.ts +15 -0
  229. package/dist/components/StreamingMessage/index.d.ts +2 -0
  230. package/dist/components/ThemeSwitcher/ThemeSwitcher.cjs +1 -0
  231. package/dist/components/ThemeSwitcher/ThemeSwitcher.const.cjs +1 -0
  232. package/dist/components/ThemeSwitcher/ThemeSwitcher.const.d.ts +7 -0
  233. package/dist/components/ThemeSwitcher/ThemeSwitcher.const.js +14 -0
  234. package/dist/components/ThemeSwitcher/ThemeSwitcher.d.ts +2 -0
  235. package/dist/components/ThemeSwitcher/ThemeSwitcher.js +39 -0
  236. package/dist/components/ThemeSwitcher/ThemeSwitcher.types.d.ts +14 -0
  237. package/dist/components/ThemeSwitcher/index.d.ts +2 -0
  238. package/dist/components/ThinkingBlock/ThinkingBlock.cjs +1 -0
  239. package/dist/components/ThinkingBlock/ThinkingBlock.const.cjs +1 -0
  240. package/dist/components/ThinkingBlock/ThinkingBlock.const.d.ts +4 -0
  241. package/dist/components/ThinkingBlock/ThinkingBlock.const.js +9 -0
  242. package/dist/components/ThinkingBlock/ThinkingBlock.d.ts +2 -0
  243. package/dist/components/ThinkingBlock/ThinkingBlock.js +45 -0
  244. package/dist/components/ThinkingBlock/ThinkingBlock.types.d.ts +16 -0
  245. package/dist/components/ThinkingBlock/index.d.ts +2 -0
  246. package/dist/components/ToolCall/ToolCall.cjs +1 -0
  247. package/dist/components/ToolCall/ToolCall.const.cjs +1 -0
  248. package/dist/components/ToolCall/ToolCall.const.d.ts +5 -0
  249. package/dist/components/ToolCall/ToolCall.const.js +17 -0
  250. package/dist/components/ToolCall/ToolCall.d.ts +2 -0
  251. package/dist/components/ToolCall/ToolCall.js +43 -0
  252. package/dist/components/ToolCall/ToolCall.types.d.ts +20 -0
  253. package/dist/components/ToolCall/index.d.ts +2 -0
  254. package/dist/components/Transition/Transition.const.cjs +1 -1
  255. package/dist/components/Transition/Transition.const.js +12 -6
  256. package/dist/components/Transition/Transition.types.d.ts +1 -1
  257. package/dist/components/index.cjs +1 -1
  258. package/dist/components/index.d.ts +37 -9
  259. package/dist/components/index.js +455 -423
  260. package/dist/constants/generals.const.cjs +1 -1
  261. package/dist/constants/generals.const.d.ts +46 -0
  262. package/dist/constants/generals.const.js +158 -115
  263. package/dist/constants/keys.const.cjs +1 -1
  264. package/dist/constants/keys.const.js +2 -1
  265. package/dist/constants/numbers.const.cjs +1 -1
  266. package/dist/constants/numbers.const.d.ts +7 -0
  267. package/dist/constants/numbers.const.js +60 -52
  268. package/dist/context/BearProvider.cjs +1 -1
  269. package/dist/context/BearProvider.d.ts +19 -44
  270. package/dist/context/BearProvider.js +223 -208
  271. package/dist/context/bearProvider.types.d.ts +4 -0
  272. package/dist/context/index.d.ts +1 -1
  273. package/dist/hooks/useFixedAnchorPosition/index.d.ts +1 -1
  274. package/dist/hooks/useFixedAnchorPosition/useFixedAnchorPosition.const.cjs +1 -1
  275. package/dist/hooks/useFixedAnchorPosition/useFixedAnchorPosition.const.d.ts +2 -1
  276. package/dist/hooks/useFixedAnchorPosition/useFixedAnchorPosition.const.js +12 -11
  277. package/dist/hooks/useFixedAnchorPosition/useFixedAnchorPosition.types.d.ts +1 -1
  278. package/dist/index.cjs +1 -1
  279. package/dist/index.js +595 -563
  280. package/dist/styles/_ai-chat.css +487 -0
  281. package/dist/styles/_base.css +2 -0
  282. package/dist/styles/_chart.css +144 -0
  283. package/dist/styles/_effects.css +8 -4
  284. package/dist/styles/_skeleton.css +90 -0
  285. package/dist/styles/main.css +3 -0
  286. package/dist/styles.css +734 -32
  287. package/package.json +1 -1
  288. package/dist/components/FormSkeleton/FormSkeleton.const.cjs +0 -1
  289. package/dist/components/FormSkeleton/FormSkeleton.const.d.ts +0 -5
  290. package/dist/components/FormSkeleton/FormSkeleton.const.js +0 -8
  291. package/dist/node_modules/@forgedevstack/bear-icons/dist/Icon.cjs +0 -1
  292. package/dist/node_modules/@forgedevstack/bear-icons/dist/Icon.const.cjs +0 -1
  293. package/dist/node_modules/@forgedevstack/bear-icons/dist/Icon.const.js +0 -14
  294. package/dist/node_modules/@forgedevstack/bear-icons/dist/Icon.js +0 -35
  295. package/dist/node_modules/@forgedevstack/bear-icons/dist/action.cjs +0 -1
  296. package/dist/node_modules/@forgedevstack/bear-icons/dist/action.js +0 -26
  297. package/dist/node_modules/@forgedevstack/bear-icons/dist/cn.utils.cjs +0 -1
  298. package/dist/node_modules/@forgedevstack/bear-icons/dist/cn.utils.js +0 -4
  299. package/dist/node_modules/@forgedevstack/bear-icons/dist/editor.cjs +0 -1
  300. package/dist/node_modules/@forgedevstack/bear-icons/dist/editor.js +0 -130
  301. package/dist/node_modules/@forgedevstack/bear-icons/dist/misc.cjs +0 -1
  302. package/dist/node_modules/@forgedevstack/bear-icons/dist/misc.js +0 -12
  303. package/dist/node_modules/@forgedevstack/bear-icons/dist/navigation.cjs +0 -1
  304. package/dist/node_modules/@forgedevstack/bear-icons/dist/navigation.js +0 -18
  305. package/dist/node_modules/@forgedevstack/bear-icons/dist/status.cjs +0 -1
  306. package/dist/node_modules/@forgedevstack/bear-icons/dist/status.js +0 -6
@@ -1,69 +1,83 @@
1
1
  import { jsxs as c, jsx as e } from "react/jsx-runtime";
2
- import { ZERO as I, TEN as N, FIFTY as T } from "../../constants/numbers.const.js";
2
+ import { ZERO as v, TEN as W, FIFTY as b } from "../../constants/numbers.const.js";
3
3
  import { cn as s } from "../../utils/cn.js";
4
4
  import "react";
5
+ import { resolveBearId as x } from "../../utils/generateBearId.utils.js";
6
+ import { useBearId as k } from "../../utils/useBearId.js";
5
7
  import { CHART as a } from "./Chart.const.js";
6
- import { calculateLinePoints as B, generateLinePath as W } from "./Chart.utils.js";
7
- const A = (f) => {
8
+ import { calculateLinePoints as A, generateLinePath as R } from "./Chart.utils.js";
9
+ const G = (I) => {
8
10
  const {
9
- data: l,
10
- height: h = a.DEFAULT_HEIGHT,
11
- showLabels: b = !0,
12
- showDots: u = !0,
13
- smooth: y = !0,
14
- fill: x = !1,
15
- stepped: m = !1,
16
- strokeWidth: E = a.DEFAULT_STROKE_WIDTH,
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,
17
19
  color: r = "var(--bear-primary-500, #ec4899)",
18
- animated: o = !0,
19
- className: L,
20
- ...O
21
- } = f, i = B(l), p = W(i, y && !m, m), D = i.length === I ? "" : `${p} L ${a.VIEWBOX},${a.VIEWBOX} L 0,${a.VIEWBOX} Z`;
22
- return /* @__PURE__ */ c("div", { className: s("Bear-Chart Bear-Chart--line bear-w-full", L), style: { height: h }, ...O, children: [
23
- /* @__PURE__ */ c("svg", { viewBox: `0 0 ${a.VIEWBOX} ${a.VIEWBOX}`, preserveAspectRatio: "none", className: "bear-h-full bear-w-full", children: [
24
- /* @__PURE__ */ e("defs", { children: /* @__PURE__ */ c("linearGradient", { id: "line-gradient", x1: "0%", y1: "0%", x2: "0%", y2: "100%", children: [
25
- /* @__PURE__ */ e("stop", { offset: "0%", stopColor: r, stopOpacity: "0.3" }),
26
- /* @__PURE__ */ e("stop", { offset: "100%", stopColor: r, stopOpacity: "0" })
27
- ] }) }),
28
- x && /* @__PURE__ */ e(
29
- "path",
30
- {
31
- d: D,
32
- fill: "url(#line-gradient)",
33
- className: s(o && "animate-fade-in")
34
- }
35
- ),
36
- /* @__PURE__ */ e(
37
- "path",
38
- {
39
- d: p,
40
- fill: "none",
41
- stroke: r,
42
- strokeWidth: E / N,
43
- strokeLinecap: "round",
44
- strokeLinejoin: "round",
45
- className: s(o && "animate-draw-line")
46
- }
47
- ),
48
- u && i.map((t, n) => {
49
- var d;
50
- return /* @__PURE__ */ e(
51
- "circle",
52
- {
53
- cx: t.x,
54
- cy: t.y,
55
- r: a.DOT_RADIUS,
56
- fill: r,
57
- className: s(o && "animate-scale-in"),
58
- style: { animationDelay: `${n * T}ms` }
59
- },
60
- ((d = l[n]) == null ? void 0 : d.label) ?? n
61
- );
62
- })
63
- ] }),
64
- b && /* @__PURE__ */ e("div", { className: "bear-mt-2 bear-flex bear-justify-between", children: l.map((t) => /* @__PURE__ */ e("span", { className: "bear-text-xs bear-text-gray-600 dark:bear-text-slate-300", children: t.label }, t.label)) })
65
- ] });
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
+ );
66
80
  };
67
81
  export {
68
- A as LineChart
82
+ G as LineChart
69
83
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),k=require("react"),d=require("../../constants/numbers.const.cjs"),j=require("../../utils/cn.cjs"),Y=require("../Portal/Portal.cjs"),g=require("../Card/Card.cjs"),b=require("../Flex/Flex.cjs"),w=require("../Box/Box.cjs"),N=require("../Typography/Typography.cjs"),a=require("./Chart.const.cjs"),R=require("./Chart.utils.cjs"),z=f=>{const{data:n,height:C=a.CHART.DEFAULT_HEIGHT,showLabels:P=!0,innerRadius:B=d.ZERO,startAngle:D,padAngle:x=a.CHART.DEFAULT_PAD_ANGLE,animated:F=!0,pieView:_=a.PIE_VIEW_FULL,explodeIndex:S,legendPosition:y="right",onSliceClick:u,onSliceHover:i,showSliceTooltip:m=!0,sliceTooltipTitle:A,sliceTooltipDescription:E,sliceTooltipContent:p,className:M,...q}=f,h=n.reduce((e,r)=>e+r.value,d.ZERO),[s,H]=k.useState(null),I=_===a.PIE_VIEW_HALF,O=_===a.PIE_VIEW_ROSE,L=I?a.CHART.HALF_SWEEP:a.CHART.FULL_SWEEP,U=D??(I?a.CHART.HALF_PIE_START:a.CHART.DEFAULT_START_ANGLE),V=Math.max(...n.map(e=>e.value),d.ONE),W=y===a.CHART_LEGEND_NONE||!P,X=y===a.CHART_LEGEND_BOTTOM,v=(e,r,c)=>{const o=n[c];if(i==null||i(o,c),!m)return;const l=Math.round(o.value/h*a.CHART.VIEWBOX);H({x:e,y:r,index:c,label:o.label,value:o.value,pct:l})},$=()=>{H(null),i==null||i(null,null)};let T=U;const G=n.map((e,r)=>{const c=O?L/n.length-x:e.value/h*L-x,o=T,l=T+c;T+=c+x;const Z=O?a.CHART.ROSE_MIN_RADIUS+e.value/V*(a.CHART.OUTER_RADIUS-a.CHART.ROSE_MIN_RADIUS):a.CHART.OUTER_RADIUS;return{startAngle:o,endAngle:l,color:R.getChartColor(r,e.color),outerRadius:Z,...e}});return t.jsxs(b.Flex,{direction:X?"column":"row",align:"center",gap:4,wrap:"wrap",className:j.cn("Bear-Chart Bear-Chart--pie bear-relative bear-max-w-full",M),...q,children:[t.jsx(w.Box,{style:{width:C,height:C},className:"bear-min-w-0 bear-shrink-0",children:t.jsx("svg",{viewBox:`0 0 ${a.CHART.VIEWBOX} ${a.CHART.VIEWBOX}`,className:"bear-h-full bear-w-full",children:G.map((e,r)=>{const c=(e.startAngle+e.endAngle)/2,o=S===r?R.polarOffset(c,a.CHART.EXPLODE_OFFSET):{x:d.ZERO,y:d.ZERO};return t.jsx("g",{transform:`translate(${o.x} ${o.y})`,children:t.jsx("path",{d:R.createArcPath(e.startAngle,e.endAngle,B,e.outerRadius),fill:e.color,className:j.cn(u&&"bear-cursor-pointer","bear-transition-opacity hover:bear-opacity-80",F&&"animate-scale-in"),style:{animationDelay:`${r*a.CHART.SLICE_DELAY_MS}ms`},onClick:()=>u==null?void 0:u(n[r],r),tabIndex:0,role:"button","aria-label":`${n[r].label} ${Math.round(n[r].value/h*a.CHART.VIEWBOX)}%`,onKeyDown:l=>{(l.key==="Enter"||l.key===" ")&&(l.preventDefault(),u==null||u(n[r],r))},onMouseEnter:l=>v(l.clientX,l.clientY,r),onMouseMove:l=>v(l.clientX,l.clientY,r),onMouseLeave:$})},e.label)})})}),!W&&t.jsx(b.Flex,{direction:"column",gap:2,children:n.map((e,r)=>t.jsxs(b.Flex,{align:"center",gap:2,children:[t.jsx(w.Box,{className:"bear-h-3 bear-w-3 bear-rounded-full",style:{backgroundColor:R.getChartColor(r,e.color)}}),t.jsx(N.Typography,{variant:"body2",color:"muted",children:e.label}),t.jsxs(N.Typography,{variant:"body2",color:"muted",children:[Math.round(e.value/h*a.CHART.VIEWBOX),"%"]})]},e.label))}),s&&m&&t.jsx(Y.Portal,{children:t.jsx("div",{className:"pointer-events-none fixed z-[11500] w-56 max-w-[calc(100vw-24px)]",style:{left:s.x+12,top:s.y+12},children:t.jsxs(g.Card,{variant:"elevated",padding:"none",children:[(A||E)&&t.jsx(g.CardHeader,{title:(A==null?void 0:A(n[s.index],s.index))??s.label,subtitle:E==null?void 0:E(n[s.index],s.index)}),t.jsx(g.CardBody,{className:"bear-text-xs bear-text-gray-500 dark:bear-text-slate-400",children:(p==null?void 0:p(n[s.index],s.index))??t.jsxs("span",{children:[s.value," (",s.pct,"%)"]})})]})})})]})};exports.PieChart=z;
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,118 +1,138 @@
1
- import { jsxs as u, jsx as o } from "react/jsx-runtime";
2
- import { useState as z } from "react";
3
- import { ZERO as h, ONE as K } from "../../constants/numbers.const.js";
4
- import { cn as N } from "../../utils/cn.js";
5
- import { Portal as Z } from "../Portal/Portal.js";
6
- import { Card as q, CardHeader as J, CardBody as Q } from "../Card/Card.js";
7
- import { Flex as _ } from "../Flex/Flex.js";
8
- import { Box as T } from "../Box/Box.js";
9
- import { Typography as D } from "../Typography/Typography.js";
10
- import { CHART as r, PIE_VIEW_FULL as ee, PIE_VIEW_ROSE as ae, CHART_LEGEND_NONE as re, CHART_LEGEND_BOTTOM as te, PIE_VIEW_HALF as le } from "./Chart.const.js";
11
- import { getChartColor as B, createArcPath as ne, polarOffset as oe } from "./Chart.utils.js";
12
- const ge = (M) => {
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) => {
13
15
  const {
14
- data: t,
15
- height: f = r.DEFAULT_HEIGHT,
16
- showLabels: P = !0,
17
- innerRadius: S = h,
18
- startAngle: F,
19
- padAngle: A = r.DEFAULT_PAD_ANGLE,
20
- animated: U = !0,
21
- pieView: I = ee,
22
- explodeIndex: C,
23
- legendPosition: y = "right",
24
- onSliceClick: d,
25
- onSliceHover: i,
26
- showSliceTooltip: L = !0,
27
- sliceTooltipTitle: m,
28
- sliceTooltipDescription: p,
29
- sliceTooltipContent: b,
30
- className: V,
31
- ...W
32
- } = M, E = t.reduce((e, a) => e + a.value, h), [n, x] = z(null), R = I === le, v = I === ae, w = R ? r.HALF_SWEEP : r.FULL_SWEEP, X = F ?? (R ? r.HALF_PIE_START : r.DEFAULT_START_ANGLE), H = Math.max(...t.map((e) => e.value), K), $ = y === re || !P, G = y === te, O = (e, a, c) => {
33
- const s = t[c];
34
- if (i == null || i(s, c), !L)
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)
35
39
  return;
36
- const l = Math.round(s.value / E * r.VIEWBOX);
37
- x({ x: e, y: a, index: c, label: s.label, value: s.value, pct: l });
38
- }, k = () => {
39
- x(null), i == null || i(null, null);
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);
40
44
  };
41
- let g = X;
42
- const Y = t.map((e, a) => {
43
- const c = v ? w / t.length - A : e.value / E * w - A, s = g, l = g + c;
44
- g += c + A;
45
- const j = v ? r.ROSE_MIN_RADIUS + e.value / H * (r.OUTER_RADIUS - r.ROSE_MIN_RADIUS) : r.OUTER_RADIUS;
45
+ if (r.length === p || m === p)
46
+ return /* @__PURE__ */ l(
47
+ g,
48
+ {
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;
46
63
  return {
47
64
  startAngle: s,
48
- endAngle: l,
49
- color: B(a, e.color),
50
- outerRadius: j,
65
+ endAngle: n,
66
+ color: S(a, e.color),
67
+ outerRadius: q,
51
68
  ...e
52
69
  };
53
70
  });
54
- return /* @__PURE__ */ u(
55
- _,
71
+ return /* @__PURE__ */ h(
72
+ g,
56
73
  {
57
- direction: G ? "column" : "row",
74
+ id: R,
75
+ "data-testid": L,
76
+ direction: z ? "column" : "row",
58
77
  align: "center",
59
78
  gap: 4,
60
79
  wrap: "wrap",
61
- className: N("Bear-Chart Bear-Chart--pie bear-relative bear-max-w-full", V),
62
- ...W,
80
+ className: f("Bear-Chart Bear-Chart--pie", x),
81
+ style: { "--Bear-Chart-height": `${y}px` },
82
+ ...C,
63
83
  children: [
64
- /* @__PURE__ */ o(T, { style: { width: f, height: f }, className: "bear-min-w-0 bear-shrink-0", children: /* @__PURE__ */ o("svg", { viewBox: `0 0 ${r.VIEWBOX} ${r.VIEWBOX}`, className: "bear-h-full bear-w-full", children: Y.map((e, a) => {
65
- const c = (e.startAngle + e.endAngle) / 2, s = C === a ? oe(c, r.EXPLODE_OFFSET) : { x: h, y: h };
66
- return /* @__PURE__ */ o("g", { transform: `translate(${s.x} ${s.y})`, children: /* @__PURE__ */ o(
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(
67
87
  "path",
68
88
  {
69
- d: ne(e.startAngle, e.endAngle, S, e.outerRadius),
89
+ d: pe(e.startAngle, e.endAngle, V, e.outerRadius),
70
90
  fill: e.color,
71
- className: N(
72
- d && "bear-cursor-pointer",
91
+ className: f(
92
+ i && "bear-cursor-pointer",
73
93
  "bear-transition-opacity hover:bear-opacity-80",
74
- U && "animate-scale-in"
94
+ $ && "animate-scale-in"
75
95
  ),
76
- style: { animationDelay: `${a * r.SLICE_DELAY_MS}ms` },
77
- onClick: () => d == null ? void 0 : d(t[a], a),
96
+ style: { animationDelay: `${a * t.SLICE_DELAY_MS}ms` },
97
+ onClick: () => i == null ? void 0 : i(r[a], a),
78
98
  tabIndex: 0,
79
99
  role: "button",
80
- "aria-label": `${t[a].label} ${Math.round(t[a].value / E * r.VIEWBOX)}%`,
81
- onKeyDown: (l) => {
82
- (l.key === "Enter" || l.key === " ") && (l.preventDefault(), d == null || d(t[a], a));
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));
83
103
  },
84
- onMouseEnter: (l) => O(l.clientX, l.clientY, a),
85
- onMouseMove: (l) => O(l.clientX, l.clientY, a),
86
- onMouseLeave: k
104
+ onMouseEnter: (n) => D(n.clientX, n.clientY, a),
105
+ onMouseMove: (n) => D(n.clientX, n.clientY, a),
106
+ onMouseLeave: K
87
107
  }
88
108
  ) }, e.label);
89
109
  }) }) }),
90
- !$ && /* @__PURE__ */ o(_, { direction: "column", gap: 2, children: t.map((e, a) => /* @__PURE__ */ u(_, { align: "center", gap: 2, children: [
91
- /* @__PURE__ */ o(
92
- T,
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,
93
113
  {
94
- className: "bear-h-3 bear-w-3 bear-rounded-full",
95
- style: { backgroundColor: B(a, e.color) }
114
+ className: "Bear-Chart__swatch",
115
+ style: { "--Bear-Chart-color": S(a, e.color) }
96
116
  }
97
117
  ),
98
- /* @__PURE__ */ o(D, { variant: "body2", color: "muted", children: e.label }),
99
- /* @__PURE__ */ u(D, { variant: "body2", color: "muted", children: [
100
- Math.round(e.value / E * r.VIEWBOX),
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),
101
121
  "%"
102
122
  ] })
103
123
  ] }, e.label)) }),
104
- n && L && /* @__PURE__ */ o(Z, { children: /* @__PURE__ */ o("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__ */ u(q, { variant: "elevated", padding: "none", children: [
105
- (m || p) && /* @__PURE__ */ o(
106
- J,
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,
107
127
  {
108
- title: (m == null ? void 0 : m(t[n.index], n.index)) ?? n.label,
109
- subtitle: p == null ? void 0 : p(t[n.index], n.index)
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)
110
130
  }
111
131
  ),
112
- /* @__PURE__ */ o(Q, { className: "bear-text-xs bear-text-gray-500 dark:bear-text-slate-400", children: (b == null ? void 0 : b(t[n.index], n.index)) ?? /* @__PURE__ */ u("span", { children: [
113
- n.value,
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,
114
134
  " (",
115
- n.pct,
135
+ o.pct,
116
136
  "%)"
117
137
  ] }) })
118
138
  ] }) }) })
@@ -121,5 +141,5 @@ const ge = (M) => {
121
141
  );
122
142
  };
123
143
  export {
124
- ge as PieChart
144
+ Le as PieChart
125
145
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),c=require("../../constants/numbers.const.cjs"),C=require("../../utils/cn.cjs");require("react");const r=require("./Chart.const.cjs"),o=require("./Chart.utils.cjs"),f=u=>{const{data:s,height:E=r.CHART.DEFAULT_HEIGHT,showLabels:d=!0,showValues:h=!1,animated:_=!0,color:A,className:m,...x}=u,i=s.length;if(i===c.ZERO)return null;const b=Math.max(...s.map(e=>e.value),c.ONE),R=r.CHART.FULL_SWEEP/i,T=s.map((e,a)=>{const t=r.CHART.DEFAULT_START_ANGLE+a*R,l=e.value/b*r.CHART.OUTER_RADIUS;return o.polarToCartesian(t,l)}),g=T.map(e=>`${e.x},${e.y}`).join(" "),H=Array.from({length:r.CHART.RADAR_RINGS},(e,a)=>{const t=(a+c.ONE)/r.CHART.RADAR_RINGS*r.CHART.OUTER_RADIUS;return Array.from({length:i},(l,y)=>{const p=r.CHART.DEFAULT_START_ANGLE+y*R;return o.polarToCartesian(p,t)})});return n.jsx("div",{className:C.cn("Bear-Chart Bear-Chart--radar bear-flex bear-flex-col bear-items-center",m),style:{height:E},...x,children:n.jsxs("svg",{viewBox:`0 0 ${r.CHART.VIEWBOX} ${r.CHART.VIEWBOX}`,className:"bear-h-full bear-w-full",children:[H.map((e,a)=>n.jsx("polygon",{points:e.map(t=>`${t.x},${t.y}`).join(" "),fill:"none",stroke:"var(--bear-border-default, #e5e5e5)",strokeWidth:.4},a)),s.map((e,a)=>{const t=r.CHART.DEFAULT_START_ANGLE+a*R,l=o.polarToCartesian(t,r.CHART.OUTER_RADIUS);return n.jsx("line",{x1:r.CHART.CENTER,y1:r.CHART.CENTER,x2:l.x,y2:l.y,stroke:"var(--bear-border-default, #e5e5e5)",strokeWidth:.4},e.label)}),n.jsx("polygon",{points:g,fill:o.getChartColor(c.ZERO,A),fillOpacity:.25,stroke:o.getChartColor(c.ZERO,A),strokeWidth:.8,className:C.cn(_&&"animate-scale-in")}),T.map((e,a)=>n.jsx("circle",{cx:e.x,cy:e.y,r:r.CHART.DOT_RADIUS,fill:o.getChartColor(a,s[a].color||A)},s[a].label)),d&&s.map((e,a)=>{const t=r.CHART.DEFAULT_START_ANGLE+a*R,l=o.polarToCartesian(t,r.CHART.OUTER_RADIUS+r.CHART.RADAR_LABEL_OFFSET);return n.jsxs("text",{x:l.x,y:l.y,textAnchor:"middle",dominantBaseline:"middle",className:"bear-fill-[var(--bear-text-secondary)]",fontSize:4,children:[e.label,h?` ${e.value}`:""]},`${e.label}-label`)})]})})};exports.RadarChart=f;
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;
@@ -1,2 +1,2 @@
1
1
  import { RadarChartProps } from './Chart.types';
2
- export declare const RadarChart: (props: RadarChartProps) => import("react/jsx-runtime").JSX.Element | null;
2
+ export declare const RadarChart: (props: RadarChartProps) => import("react/jsx-runtime").JSX.Element;