@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
@@ -0,0 +1,2 @@
1
+ export declare const resolveContextMeterPercent: (used: number, max: number) => number;
2
+ export declare const resolveContextMeterTone: (percent: number) => "danger" | "warn" | "ok";
@@ -0,0 +1,12 @@
1
+ import { ZERO as e } from "../../constants/numbers.const.js";
2
+ import { CONTEXT_METER_PERCENT_CAP as E, CONTEXT_METER_DANGER_PERCENT as o, CONTEXT_METER_WARN_PERCENT as T } from "./ContextMeter.const.js";
3
+ const _ = (r, n) => {
4
+ if (n <= e)
5
+ return e;
6
+ const t = r / n * E;
7
+ return t < e ? e : t > E ? E : t;
8
+ }, N = (r) => r >= o ? "danger" : r >= T ? "warn" : "ok";
9
+ export {
10
+ _ as resolveContextMeterPercent,
11
+ N as resolveContextMeterTone
12
+ };
@@ -0,0 +1,2 @@
1
+ export { ContextMeter } from './ContextMeter';
2
+ export type { ContextMeterProps, ContextMeterTranslations } from './ContextMeter.types';
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),L=require("react-dom"),P=require("../../context/BearProvider.cjs"),j=require("../../utils/cn.cjs");require("react");const C=require("../../utils/generateBearId.utils.cjs"),F=require("../../utils/useBearId.cjs"),r=require("../../constants/generals.const.cjs"),M=require("../../hooks/useFixedAnchorPosition/useFixedAnchorPosition.const.cjs"),U=require("../../hooks/useFixedAnchorPosition/useFixedAnchorPosition.utils.cjs"),g=require("../Backdrop/Backdrop.cjs"),t=require("../Box/Box.cjs"),s=require("./Drawer.const.cjs"),S=require("./helpers/DrawerOptionalHeader.cjs"),W=require("./hooks/useDrawer.cjs"),$=c=>{const{isOpen:E,onClose:o,title:a,children:D,side:O=s.DRAWER_DEFAULT_SIDE,anchor:p,variant:H="temporary",size:w=s.DRAWER_DEFAULT_SIZE,showCloseButton:i=r.BOOLEAN_TRUE,closeOnBackdrop:A=r.BOOLEAN_TRUE,closeOnEscape:q=r.BOOLEAN_TRUE,className:N,container:R,id:f,testId:m}=c,{openEffect:l,closeEffect:d}=U.resolveOverlayEffects(c,M.OVERLAY_OPEN_EFFECT_DEFAULT),x=F.useBearId(r.COMPONENT_NAME_DRAWER),u=C.resolveBearId(f,x),{direction:I}=P.useBearDirectionOptional(),_=p??O,{isMounted:v,isPanelOpen:n}=W.useDrawer({isOpen:E,onClose:o,closeOnEscape:q,openEffect:l,closeEffect:d}),T=n?l:d;if(!v)return null;const b=!!a||i,B=`${u}-title`,h=A?()=>o():void 0,k=a?B:void 0,y=e.jsxs(t.Box,{id:u,testId:m,className:"Bear-Drawer",children:[e.jsx(g.Backdrop,{open:n,keepMounted:!0,blur:!0,nested:!0,transitionDuration:s.DRAWER_ANIMATION_MS,className:"Bear-Drawer__backdrop",onClick:h}),e.jsxs(t.Box,{role:"dialog","aria-modal":r.BOOLEAN_TRUE,"aria-labelledby":k,className:j.cn("Bear-Drawer__panel",`Bear-Drawer__panel--${_}`,`Bear-Drawer__panel--${w}`,`Bear-Drawer__panel--effect-${T}`,n&&"Bear-Drawer__panel--open",N),children:[e.jsx(S.DrawerOptionalHeader,{showHeader:b,side:_,title:a,titleId:B,showCloseButton:i,onClose:o,direction:I}),e.jsx(t.Box,{className:"Bear-Drawer__body",children:D})]})]});return L.createPortal(y,R??document.body)};exports.Drawer=$;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),U=require("react-dom"),C=require("../../context/BearProvider.cjs"),R=require("../../utils/cn.cjs");require("react");const j=require("../../utils/generateBearId.utils.cjs"),W=require("../../utils/useBearId.cjs"),e=require("../../constants/generals.const.cjs"),g=require("../../hooks/useFixedAnchorPosition/useFixedAnchorPosition.const.cjs"),$=require("../../hooks/useFixedAnchorPosition/useFixedAnchorPosition.utils.cjs"),V=require("../Backdrop/Backdrop.cjs"),l=require("../Box/Box.cjs"),t=require("./Drawer.const.cjs"),H=require("./helpers/DrawerOptionalHeader.cjs"),Y=require("./hooks/useDrawer.cjs"),z=d=>{const{isOpen:p,onClose:a,title:s,children:N,side:w=t.DRAWER_DEFAULT_SIDE,anchor:T,variant:c=t.DRAWER_DEFAULT_VARIANT,size:L=t.DRAWER_DEFAULT_SIZE,showCloseButton:E=e.BOOLEAN_TRUE,closeOnBackdrop:m=e.BOOLEAN_TRUE,closeOnEscape:q=e.BOOLEAN_TRUE,className:I,container:f,id:x,testId:F}=d,r=c===e.DRAWER_VARIANT_PERMANENT,n=c===e.DRAWER_VARIANT_TEMPORARY,{openEffect:_,closeEffect:u}=$.resolveOverlayEffects(d,g.OVERLAY_OPEN_EFFECT_DEFAULT),P=W.useBearId(e.COMPONENT_NAME_DRAWER),A=j.resolveBearId(x,P),{direction:h}=C.useBearDirectionOptional(),B=T??w,{isMounted:v,isPanelOpen:i}=Y.useDrawer({isOpen:r?e.BOOLEAN_TRUE:p,onClose:a,closeOnEscape:r?e.BOOLEAN_FALSE:q,openEffect:_,closeEffect:u,lockScroll:n,alwaysMounted:r}),y=i?_:u;if(!v)return null;const M=!!s||E,O=`${A}-title`,S=m&&n?()=>a():void 0,b=s?O:void 0,k=r?"complementary":"dialog",D=o.jsxs(l.Box,{id:A,"data-testid":F,className:R.cn("Bear-Drawer",`Bear-Drawer--${c}`),children:[n&&o.jsx(V.Backdrop,{open:i,keepMounted:!0,blur:!0,nested:!0,transitionDuration:t.DRAWER_ANIMATION_MS,className:"Bear-Drawer__backdrop",onClick:S}),o.jsxs(l.Box,{role:k,"aria-modal":n?e.BOOLEAN_TRUE:e.BOOLEAN_FALSE,"aria-labelledby":b,className:R.cn("Bear-Drawer__panel",`Bear-Drawer__panel--${B}`,`Bear-Drawer__panel--${L}`,`Bear-Drawer__panel--effect-${y}`,i&&"Bear-Drawer__panel--open",I),children:[o.jsx(H.DrawerOptionalHeader,{showHeader:M,side:B,title:s,titleId:O,showCloseButton:r?e.BOOLEAN_FALSE:E,onClose:a,direction:h}),o.jsx(l.Box,{className:"Bear-Drawer__body",children:N})]})]});return r?D:U.createPortal(D,f??document.body)};exports.Drawer=z;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("../../constants/numbers.const.cjs"),E=require("../../constants/generals.const.cjs"),D=_.THREE_HUNDRED,R=E.POSITION_RIGHT,e=E.SIZE_MD;exports.DRAWER_ANIMATION_MS=D;exports.DRAWER_DEFAULT_SIDE=R;exports.DRAWER_DEFAULT_SIZE=e;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const R=require("../../constants/numbers.const.cjs"),A=require("../../constants/generals.const.cjs"),E=R.THREE_HUNDRED,_=A.POSITION_RIGHT,D=A.SIZE_MD,T=A.DRAWER_VARIANT_TEMPORARY;exports.DRAWER_ANIMATION_MS=E;exports.DRAWER_DEFAULT_SIDE=_;exports.DRAWER_DEFAULT_SIZE=D;exports.DRAWER_DEFAULT_VARIANT=T;
@@ -1,4 +1,5 @@
1
- import { DrawerProps } from './Drawer.types';
1
+ import { DrawerProps, DrawerVariant } from './Drawer.types';
2
2
  export declare const DRAWER_ANIMATION_MS = 300;
3
3
  export declare const DRAWER_DEFAULT_SIDE: NonNullable<DrawerProps['side']>;
4
4
  export declare const DRAWER_DEFAULT_SIZE: NonNullable<DrawerProps['size']>;
5
+ export declare const DRAWER_DEFAULT_VARIANT: DrawerVariant;
@@ -1,8 +1,9 @@
1
- import { THREE_HUNDRED as E } from "../../constants/numbers.const.js";
2
- import { POSITION_RIGHT as D, SIZE_MD as R } from "../../constants/generals.const.js";
3
- const I = E, A = D, t = R;
1
+ import { THREE_HUNDRED as R } from "../../constants/numbers.const.js";
2
+ import { POSITION_RIGHT as A, DRAWER_VARIANT_TEMPORARY as E, SIZE_MD as _ } from "../../constants/generals.const.js";
3
+ const T = R, o = A, t = _, N = E;
4
4
  export {
5
- I as DRAWER_ANIMATION_MS,
6
- A as DRAWER_DEFAULT_SIDE,
7
- t as DRAWER_DEFAULT_SIZE
5
+ T as DRAWER_ANIMATION_MS,
6
+ o as DRAWER_DEFAULT_SIDE,
7
+ t as DRAWER_DEFAULT_SIZE,
8
+ N as DRAWER_DEFAULT_VARIANT
8
9
  };
@@ -1,2 +1,2 @@
1
1
  import { DrawerProps } from './Drawer.types';
2
- export declare const Drawer: (props: DrawerProps) => import('react').ReactPortal | null;
2
+ export declare const Drawer: (props: DrawerProps) => import("react/jsx-runtime").JSX.Element | null;
@@ -1,91 +1,101 @@
1
- import { jsxs as _, jsx as t } from "react/jsx-runtime";
2
- import { createPortal as T } from "react-dom";
3
- import { useBearDirectionOptional as M } from "../../context/BearProvider.js";
4
- import { cn as F } from "../../utils/cn.js";
1
+ import { jsxs as R, jsx as i } from "react/jsx-runtime";
2
+ import { createPortal as $ } from "react-dom";
3
+ import { useBearDirectionOptional as x } from "../../context/BearProvider.js";
4
+ import { cn as B } from "../../utils/cn.js";
5
5
  import "react";
6
- import { resolveBearId as L } from "../../utils/generateBearId.utils.js";
7
- import { useBearId as x } from "../../utils/useBearId.js";
8
- import { BOOLEAN_TRUE as e, COMPONENT_NAME_DRAWER as P } from "../../constants/generals.const.js";
9
- import { OVERLAY_OPEN_EFFECT_DEFAULT as S } from "../../hooks/useFixedAnchorPosition/useFixedAnchorPosition.const.js";
10
- import { resolveOverlayEffects as U } from "../../hooks/useFixedAnchorPosition/useFixedAnchorPosition.utils.js";
11
- import { Backdrop as W } from "../Backdrop/Backdrop.js";
12
- import { Box as n } from "../Box/Box.js";
13
- import { DRAWER_DEFAULT_SIDE as $, DRAWER_DEFAULT_SIZE as g, DRAWER_ANIMATION_MS as j } from "./Drawer.const.js";
14
- import { DrawerOptionalHeader as H } from "./helpers/DrawerOptionalHeader.js";
15
- import { useDrawer as z } from "./hooks/useDrawer.js";
16
- const ce = (i) => {
6
+ import { resolveBearId as V } from "../../utils/generateBearId.utils.js";
7
+ import { useBearId as g } from "../../utils/useBearId.js";
8
+ import { BOOLEAN_TRUE as r, COMPONENT_NAME_DRAWER as j, BOOLEAN_FALSE as l, DRAWER_VARIANT_TEMPORARY as H, DRAWER_VARIANT_PERMANENT as Y } from "../../constants/generals.const.js";
9
+ import { OVERLAY_OPEN_EFFECT_DEFAULT as z } from "../../hooks/useFixedAnchorPosition/useFixedAnchorPosition.const.js";
10
+ import { resolveOverlayEffects as Z } from "../../hooks/useFixedAnchorPosition/useFixedAnchorPosition.utils.js";
11
+ import { Backdrop as q } from "../Backdrop/Backdrop.js";
12
+ import { Box as c } from "../Box/Box.js";
13
+ import { DRAWER_DEFAULT_SIDE as G, DRAWER_DEFAULT_VARIANT as J, DRAWER_DEFAULT_SIZE as K, DRAWER_ANIMATION_MS as Q } from "./Drawer.const.js";
14
+ import { DrawerOptionalHeader as X } from "./helpers/DrawerOptionalHeader.js";
15
+ import { useDrawer as ee } from "./hooks/useDrawer.js";
16
+ const Ae = (d) => {
17
17
  const {
18
- isOpen: f,
19
- onClose: r,
20
- title: o,
21
- children: E,
22
- side: B = $,
23
- anchor: D,
24
- variant: V = "temporary",
25
- size: u = g,
26
- showCloseButton: l = e,
27
- closeOnBackdrop: w = e,
28
- closeOnEscape: O = e,
29
- className: A,
30
- container: N,
31
- id: I,
32
- testId: R
33
- } = i, { openEffect: s, closeEffect: c } = U(i, S), k = x(P), d = L(I, k), { direction: v } = M(), m = D ?? B, { isMounted: b, isPanelOpen: a } = z({
34
- isOpen: f,
35
- onClose: r,
36
- closeOnEscape: O,
37
- openEffect: s,
38
- closeEffect: c
39
- }), h = a ? s : c;
18
+ isOpen: O,
19
+ onClose: t,
20
+ title: a,
21
+ children: u,
22
+ side: N = G,
23
+ anchor: w,
24
+ variant: n = J,
25
+ size: T = K,
26
+ showCloseButton: m = r,
27
+ closeOnBackdrop: I = r,
28
+ closeOnEscape: M = r,
29
+ className: h,
30
+ container: k,
31
+ id: v,
32
+ testId: y
33
+ } = d, e = n === Y, o = n === H, { openEffect: p, closeEffect: _ } = Z(d, z), C = g(j), E = V(v, C), { direction: L } = x(), f = w ?? N, { isMounted: b, isPanelOpen: s } = ee({
34
+ isOpen: e ? r : O,
35
+ onClose: t,
36
+ closeOnEscape: e ? l : M,
37
+ openEffect: p,
38
+ closeEffect: _,
39
+ lockScroll: o,
40
+ alwaysMounted: e
41
+ }), F = s ? p : _;
40
42
  if (!b)
41
43
  return null;
42
- const C = !!o || l, p = `${d}-title`, y = /* @__PURE__ */ _(n, { id: d, testId: R, className: "Bear-Drawer", children: [
43
- /* @__PURE__ */ t(
44
- W,
45
- {
46
- open: a,
47
- keepMounted: !0,
48
- blur: !0,
49
- nested: !0,
50
- transitionDuration: j,
51
- className: "Bear-Drawer__backdrop",
52
- onClick: w ? () => r() : void 0
53
- }
54
- ),
55
- /* @__PURE__ */ _(
56
- n,
57
- {
58
- role: "dialog",
59
- "aria-modal": e,
60
- "aria-labelledby": o ? p : void 0,
61
- className: F(
62
- "Bear-Drawer__panel",
63
- `Bear-Drawer__panel--${m}`,
64
- `Bear-Drawer__panel--${u}`,
65
- `Bear-Drawer__panel--effect-${h}`,
66
- a && "Bear-Drawer__panel--open",
67
- A
44
+ const P = !!a || m, A = `${E}-title`, W = I && o ? () => t() : void 0, S = a ? A : void 0, U = e ? "complementary" : "dialog", D = /* @__PURE__ */ R(
45
+ c,
46
+ {
47
+ id: E,
48
+ "data-testid": y,
49
+ className: B("Bear-Drawer", `Bear-Drawer--${n}`),
50
+ children: [
51
+ o && /* @__PURE__ */ i(
52
+ q,
53
+ {
54
+ open: s,
55
+ keepMounted: !0,
56
+ blur: !0,
57
+ nested: !0,
58
+ transitionDuration: Q,
59
+ className: "Bear-Drawer__backdrop",
60
+ onClick: W
61
+ }
68
62
  ),
69
- children: [
70
- /* @__PURE__ */ t(
71
- H,
72
- {
73
- showHeader: C,
74
- side: m,
75
- title: o,
76
- titleId: p,
77
- showCloseButton: l,
78
- onClose: r,
79
- direction: v
80
- }
81
- ),
82
- /* @__PURE__ */ t(n, { className: "Bear-Drawer__body", children: E })
83
- ]
84
- }
85
- )
86
- ] });
87
- return T(y, N ?? document.body);
63
+ /* @__PURE__ */ R(
64
+ c,
65
+ {
66
+ role: U,
67
+ "aria-modal": o ? r : l,
68
+ "aria-labelledby": S,
69
+ className: B(
70
+ "Bear-Drawer__panel",
71
+ `Bear-Drawer__panel--${f}`,
72
+ `Bear-Drawer__panel--${T}`,
73
+ `Bear-Drawer__panel--effect-${F}`,
74
+ s && "Bear-Drawer__panel--open",
75
+ h
76
+ ),
77
+ children: [
78
+ /* @__PURE__ */ i(
79
+ X,
80
+ {
81
+ showHeader: P,
82
+ side: f,
83
+ title: a,
84
+ titleId: A,
85
+ showCloseButton: e ? l : m,
86
+ onClose: t,
87
+ direction: L
88
+ }
89
+ ),
90
+ /* @__PURE__ */ i(c, { className: "Bear-Drawer__body", children: u })
91
+ ]
92
+ }
93
+ )
94
+ ]
95
+ }
96
+ );
97
+ return e ? D : $(D, k ?? document.body);
88
98
  };
89
99
  export {
90
- ce as Drawer
100
+ Ae as Drawer
91
101
  };
@@ -1,12 +1,15 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { OverlayEffectProps, OverlayMotionEffect } from '../../hooks/useFixedAnchorPosition';
3
3
  export type DrawerSide = 'left' | 'right' | 'top' | 'bottom';
4
+ export type DrawerVariant = 'temporary' | 'persistent' | 'permanent';
4
5
  export interface UseDrawerParams {
5
6
  isOpen: boolean;
6
7
  onClose: () => void;
7
8
  closeOnEscape: boolean;
8
9
  openEffect: OverlayMotionEffect;
9
10
  closeEffect: OverlayMotionEffect;
11
+ lockScroll: boolean;
12
+ alwaysMounted: boolean;
10
13
  }
11
14
  export interface UseDrawerResult {
12
15
  isMounted: boolean;
@@ -19,7 +22,7 @@ export interface DrawerProps extends OverlayEffectProps {
19
22
  children: ReactNode;
20
23
  side?: DrawerSide;
21
24
  anchor?: DrawerSide;
22
- variant?: 'temporary' | 'persistent' | 'permanent';
25
+ variant?: DrawerVariant;
23
26
  size?: 'sm' | 'md' | 'lg' | 'xl';
24
27
  showCloseButton?: boolean;
25
28
  closeOnBackdrop?: boolean;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react"),f=require("../../../constants/numbers.const.cjs"),e=require("../../../constants/generals.const.cjs"),m=require("../../../constants/keys.const.cjs"),_=require("../../../hooks/useFixedAnchorPosition/useFixedAnchorPosition.const.cjs"),S=require("../Drawer.const.cjs"),F=require("../Drawer.utils.cjs"),B=l=>{const{isOpen:r,onClose:u,closeOnEscape:i,openEffect:O,closeEffect:a}=l,[s,A]=n.useState(r),[L,c]=n.useState(e.BOOLEAN_FALSE),[N,E]=n.useState(e.BOOLEAN_FALSE);n.useEffect(()=>{if(r){if(A(e.BOOLEAN_TRUE),c(e.BOOLEAN_FALSE),O===_.OVERLAY_OPEN_EFFECT_NONE){E(e.BOOLEAN_TRUE);return}const t=requestAnimationFrame(()=>E(e.BOOLEAN_TRUE));return()=>cancelAnimationFrame(t)}if(s){E(e.BOOLEAN_FALSE),c(e.BOOLEAN_TRUE);const t=a===_.OVERLAY_OPEN_EFFECT_NONE?f.ZERO:S.DRAWER_ANIMATION_MS,d=setTimeout(()=>{A(e.BOOLEAN_FALSE),c(e.BOOLEAN_FALSE)},t);return()=>clearTimeout(d)}},[r,s,O,a]);const o=n.useCallback(t=>{i&&t.key===m.KEY_ESCAPE&&u()},[i,u]);return n.useEffect(()=>{if(s){document.addEventListener("keydown",o);const t=F.lockBodyScroll();return()=>{document.removeEventListener("keydown",o),t()}}return()=>{document.removeEventListener("keydown",o)}},[s,o]),{isMounted:s,isPanelOpen:N&&!L}};exports.useDrawer=B;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react"),B=require("../../../constants/numbers.const.cjs"),e=require("../../../constants/generals.const.cjs"),F=require("../../../constants/keys.const.cjs"),l=require("../../../hooks/useFixedAnchorPosition/useFixedAnchorPosition.const.cjs"),m=require("../Drawer.const.cjs"),R=require("../Drawer.utils.cjs"),T=N=>{const{isOpen:o,onClose:a,closeOnEscape:E,openEffect:A,closeEffect:_,lockScroll:L,alwaysMounted:r}=N,[s,i]=n.useState(o||r),[d,c]=n.useState(e.BOOLEAN_FALSE),[f,O]=n.useState(r?e.BOOLEAN_TRUE:e.BOOLEAN_FALSE);n.useEffect(()=>{if(r){i(e.BOOLEAN_TRUE),O(o),c(e.BOOLEAN_FALSE);return}if(o){if(i(e.BOOLEAN_TRUE),c(e.BOOLEAN_FALSE),A===l.OVERLAY_OPEN_EFFECT_NONE){O(e.BOOLEAN_TRUE);return}const t=requestAnimationFrame(()=>O(e.BOOLEAN_TRUE));return()=>cancelAnimationFrame(t)}if(s){O(e.BOOLEAN_FALSE),c(e.BOOLEAN_TRUE);const t=_===l.OVERLAY_OPEN_EFFECT_NONE?B.ZERO:m.DRAWER_ANIMATION_MS,S=setTimeout(()=>{i(e.BOOLEAN_FALSE),c(e.BOOLEAN_FALSE)},t);return()=>clearTimeout(S)}},[r,o,s,A,_]);const u=n.useCallback(t=>{E&&t.key===F.KEY_ESCAPE&&a()},[E,a]);return n.useEffect(()=>{s&&E&&document.addEventListener("keydown",u);const t=L&&s?R.lockBodyScroll():void 0;return()=>{document.removeEventListener("keydown",u),t==null||t()}},[s,u,E,L]),{isMounted:s,isPanelOpen:r?o:f&&!d}};exports.useDrawer=T;
@@ -1,51 +1,50 @@
1
- import { useState as m, useEffect as p, useCallback as L } from "react";
2
- import { ZERO as N } from "../../../constants/numbers.const.js";
3
- import { BOOLEAN_FALSE as o, BOOLEAN_TRUE as r } from "../../../constants/generals.const.js";
4
- import { KEY_ESCAPE as C } from "../../../constants/keys.const.js";
5
- import { OVERLAY_OPEN_EFFECT_NONE as d } from "../../../hooks/useFixedAnchorPosition/useFixedAnchorPosition.const.js";
6
- import { DRAWER_ANIMATION_MS as M } from "../Drawer.const.js";
7
- import { lockBodyScroll as v } from "../Drawer.utils.js";
8
- const B = (O) => {
9
- const { isOpen: s, onClose: E, closeOnEscape: f, openEffect: u, closeEffect: a } = O, [t, l] = m(s), [A, c] = m(o), [_, i] = m(o);
10
- p(() => {
1
+ import { useState as f, useEffect as O, useCallback as L } from "react";
2
+ import { ZERO as S } from "../../../constants/numbers.const.js";
3
+ import { BOOLEAN_FALSE as o, BOOLEAN_TRUE as n } from "../../../constants/generals.const.js";
4
+ import { KEY_ESCAPE as k } from "../../../constants/keys.const.js";
5
+ import { OVERLAY_OPEN_EFFECT_NONE as A } from "../../../hooks/useFixedAnchorPosition/useFixedAnchorPosition.const.js";
6
+ import { DRAWER_ANIMATION_MS as y } from "../Drawer.const.js";
7
+ import { lockBodyScroll as F } from "../Drawer.utils.js";
8
+ const g = (_) => {
9
+ const { isOpen: s, onClose: l, closeOnEscape: i, openEffect: u, closeEffect: p, lockScroll: d, alwaysMounted: r } = _, [t, E] = f(s || r), [M, c] = f(o), [N, m] = f(r ? n : o);
10
+ O(() => {
11
+ if (r) {
12
+ E(n), m(s), c(o);
13
+ return;
14
+ }
11
15
  if (s) {
12
- if (l(r), c(o), u === d) {
13
- i(r);
16
+ if (E(n), c(o), u === A) {
17
+ m(n);
14
18
  return;
15
19
  }
16
- const e = requestAnimationFrame(() => i(r));
20
+ const e = requestAnimationFrame(() => m(n));
17
21
  return () => cancelAnimationFrame(e);
18
22
  }
19
23
  if (t) {
20
- i(o), c(r);
21
- const k = setTimeout(() => {
22
- l(o), c(o);
23
- }, a === d ? N : M);
24
- return () => clearTimeout(k);
24
+ m(o), c(n);
25
+ const C = setTimeout(() => {
26
+ E(o), c(o);
27
+ }, p === A ? S : y);
28
+ return () => clearTimeout(C);
25
29
  }
26
- }, [s, t, u, a]);
27
- const n = L(
30
+ }, [r, s, t, u, p]);
31
+ const a = L(
28
32
  (e) => {
29
- f && e.key === C && E();
33
+ i && e.key === k && l();
30
34
  },
31
- [f, E]
35
+ [i, l]
32
36
  );
33
- return p(() => {
34
- if (t) {
35
- document.addEventListener("keydown", n);
36
- const e = v();
37
- return () => {
38
- document.removeEventListener("keydown", n), e();
39
- };
40
- }
37
+ return O(() => {
38
+ t && i && document.addEventListener("keydown", a);
39
+ const e = d && t ? F() : void 0;
41
40
  return () => {
42
- document.removeEventListener("keydown", n);
41
+ document.removeEventListener("keydown", a), e == null || e();
43
42
  };
44
- }, [t, n]), {
43
+ }, [t, a, i, d]), {
45
44
  isMounted: t,
46
- isPanelOpen: _ && !A
45
+ isPanelOpen: r ? s : N && !M
47
46
  };
48
47
  };
49
48
  export {
50
- B as useDrawer
49
+ g as useDrawer
51
50
  };
@@ -1,2 +1,2 @@
1
1
  export { Drawer } from './Drawer';
2
- export type { DrawerProps } from './Drawer.types';
2
+ export type { DrawerProps, DrawerVariant } from './Drawer.types';
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),e=require("./EmptyState.const.cjs"),a=require("../../utils/cn.cjs");require("react");const A=require("../../utils/generateBearId.utils.cjs"),m=require("../../utils/useBearId.cjs"),C=({className:r})=>s.jsx("svg",{className:r,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M20 13V6a2 2 0 00-2-2H6a2 2 0 00-2 2v7m16 0v5a2 2 0 01-2 2H6a2 2 0 01-2-2v-5m16 0h-2.586a1 1 0 00-.707.293l-2.414 2.414a1 1 0 01-.707.293h-3.172a1 1 0 01-.707-.293l-2.414-2.414A1 1 0 006.586 13H4"})}),h=({icon:r,title:l,description:S,action:n,secondaryAction:c,className:d,size:i="md",variant:E="default",id:T,testId:_})=>{const o=m.useBearId("EmptyState"),u=A.resolveBearId(T,o),t=e.EMPTY_STATE_SIZE_CLASSES[i];return s.jsxs("div",{id:u,"data-testid":_,className:a.cn(e.EMPTY_STATE_ROOT_CLASS,e.EMPTY_STATE_BASE_CLASSES,t.padding,E==="card"&&e.EMPTY_STATE_CARD_CLASSES,d),children:[s.jsx("div",{className:a.cn(e.EMPTY_STATE_ICON_CLASSES,t.icon),children:r||s.jsx(C,{className:"bear-w-full bear-h-full"})}),s.jsx("h3",{className:a.cn(e.EMPTY_STATE_TITLE_CLASSES,t.title),children:l}),S&&s.jsx("p",{className:a.cn(e.EMPTY_STATE_DESCRIPTION_CLASSES,t.desc),children:S}),(n||c)&&s.jsxs("div",{className:`${e.EMPTY_STATE_ROOT_CLASS}__actions bear-flex bear-items-center bear-gap-3`,children:[n,c]})]})};exports.EmptyState=h;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),o=require("../Box/Box.cjs"),I=require("../Flex/Flex.cjs"),E=require("../Typography/Typography.cjs"),a=require("../../utils/cn.cjs");require("react");const g=require("../../utils/generateBearId.utils.cjs"),N=require("../../utils/useBearId.cjs"),t=require("./EmptyState.const.cjs"),h=d=>{const{icon:l,title:S,description:r,action:c,secondaryAction:n,className:T,size:_=t.EMPTY_STATE_DEFAULT_SIZE,variant:p=t.EMPTY_STATE_DEFAULT_VARIANT,preset:i=t.EMPTY_STATE_DEFAULT_PRESET,id:m,testId:y}=d,u=N.useBearId("EmptyState"),B=g.resolveBearId(m,u),s=t.EMPTY_STATE_SIZE_CLASSES[_],x=t.EMPTY_STATE_PRESET_ICON[i],A=l??e.jsx(x,{className:"bear-w-full bear-h-full"});return e.jsxs(o.Box,{id:B,"data-testid":y,className:a.cn("Bear-EmptyState",p==="card"&&"Bear-EmptyState--card",`Bear-EmptyState--${i}`,s.padding,T),children:[e.jsx(o.Box,{className:a.cn("Bear-EmptyState__icon",s.icon),children:A}),e.jsx(E.Typography,{className:a.cn("Bear-EmptyState__title",s.title),children:S}),r&&e.jsx(E.Typography,{className:a.cn("Bear-EmptyState__description",s.desc),children:r}),(c||n)&&e.jsxs(I.Flex,{className:"Bear-EmptyState__actions",align:"center",gap:3,children:[c,n]})]})};exports.EmptyState=h;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="Bear-EmptyState",S="bear-flex bear-flex-col bear-items-center bear-text-center",r="bear-bg-[var(--bear-bg-secondary)] bear-rounded-xl bear-border bear-border-[var(--bear-border-default)]",a="bear-text-[var(--bear-text-muted)] bear-mb-4",t="bear-font-semibold bear-text-[var(--bear-text-primary)] bear-mb-2",b="bear-text-[var(--bear-text-secondary)] bear-max-w-md bear-mb-6",T={sm:{icon:"bear-w-12 bear-h-12",title:"bear-text-lg",desc:"bear-text-sm",padding:"bear-py-6 bear-px-4"},md:{icon:"bear-w-16 bear-h-16",title:"bear-text-xl",desc:"bear-text-base",padding:"bear-py-10 bear-px-6"},lg:{icon:"bear-w-20 bear-h-20",title:"bear-text-2xl",desc:"bear-text-lg",padding:"bear-py-14 bear-px-8"}};exports.EMPTY_STATE_BASE_CLASSES=S;exports.EMPTY_STATE_CARD_CLASSES=r;exports.EMPTY_STATE_DESCRIPTION_CLASSES=b;exports.EMPTY_STATE_ICON_CLASSES=a;exports.EMPTY_STATE_ROOT_CLASS=e;exports.EMPTY_STATE_SIZE_CLASSES=T;exports.EMPTY_STATE_TITLE_CLASSES=t;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("../../constants/generals.const.cjs"),e=require("./helpers/EmptyStateErrorSvg.cjs"),T=require("./helpers/EmptyStateInboxSvg.cjs"),t=require("./helpers/EmptyStateSearchSvg.cjs"),S=E.SIZE_MD,_=E.VARIANT_DEFAULT,r=E.EMPTY_STATE_PRESET_EMPTY,a={[E.EMPTY_STATE_PRESET_EMPTY]:T.EmptyStateInboxSvg,[E.EMPTY_STATE_PRESET_INBOX]:T.EmptyStateInboxSvg,[E.EMPTY_STATE_PRESET_SEARCH]:t.EmptyStateSearchSvg,[E.EMPTY_STATE_PRESET_ERROR]:e.EmptyStateErrorSvg},A={sm:{icon:"bear-w-12 bear-h-12",title:"bear-text-lg",desc:"bear-text-sm",padding:"bear-py-6 bear-px-4"},md:{icon:"bear-w-16 bear-h-16",title:"bear-text-xl",desc:"bear-text-base",padding:"bear-py-10 bear-px-6"},lg:{icon:"bear-w-20 bear-h-20",title:"bear-text-2xl",desc:"bear-text-lg",padding:"bear-py-14 bear-px-8"}};exports.EMPTY_STATE_DEFAULT_PRESET=r;exports.EMPTY_STATE_DEFAULT_SIZE=S;exports.EMPTY_STATE_DEFAULT_VARIANT=_;exports.EMPTY_STATE_PRESET_ICON=a;exports.EMPTY_STATE_SIZE_CLASSES=A;
@@ -1,9 +1,11 @@
1
- export declare const EMPTY_STATE_ROOT_CLASS = "Bear-EmptyState";
2
- export declare const EMPTY_STATE_BASE_CLASSES = "bear-flex bear-flex-col bear-items-center bear-text-center";
3
- export declare const EMPTY_STATE_CARD_CLASSES = "bear-bg-[var(--bear-bg-secondary)] bear-rounded-xl bear-border bear-border-[var(--bear-border-default)]";
4
- export declare const EMPTY_STATE_ICON_CLASSES = "bear-text-[var(--bear-text-muted)] bear-mb-4";
5
- export declare const EMPTY_STATE_TITLE_CLASSES = "bear-font-semibold bear-text-[var(--bear-text-primary)] bear-mb-2";
6
- export declare const EMPTY_STATE_DESCRIPTION_CLASSES = "bear-text-[var(--bear-text-secondary)] bear-max-w-md bear-mb-6";
1
+ import { ComponentType } from 'react';
2
+ import { EmptyStatePreset } from './EmptyState.types';
3
+ export declare const EMPTY_STATE_DEFAULT_SIZE: "md";
4
+ export declare const EMPTY_STATE_DEFAULT_VARIANT: "default";
5
+ export declare const EMPTY_STATE_DEFAULT_PRESET: EmptyStatePreset;
6
+ export declare const EMPTY_STATE_PRESET_ICON: Record<EmptyStatePreset, ComponentType<{
7
+ className?: string;
8
+ }>>;
7
9
  export declare const EMPTY_STATE_SIZE_CLASSES: {
8
10
  readonly sm: {
9
11
  readonly icon: "bear-w-12 bear-h-12";
@@ -1,4 +1,13 @@
1
- const e = "Bear-EmptyState", r = "bear-flex bear-flex-col bear-items-center bear-text-center", a = "bear-bg-[var(--bear-bg-secondary)] bear-rounded-xl bear-border bear-border-[var(--bear-border-default)]", b = "bear-text-[var(--bear-text-muted)] bear-mb-4", t = "bear-font-semibold bear-text-[var(--bear-text-primary)] bear-mb-2", S = "bear-text-[var(--bear-text-secondary)] bear-max-w-md bear-mb-6", E = {
1
+ import { SIZE_MD as t, VARIANT_DEFAULT as e, EMPTY_STATE_PRESET_EMPTY as T, EMPTY_STATE_PRESET_ERROR as r, EMPTY_STATE_PRESET_SEARCH as S, EMPTY_STATE_PRESET_INBOX as _ } from "../../constants/generals.const.js";
2
+ import { EmptyStateErrorSvg as a } from "./helpers/EmptyStateErrorSvg.js";
3
+ import { EmptyStateInboxSvg as E } from "./helpers/EmptyStateInboxSvg.js";
4
+ import { EmptyStateSearchSvg as b } from "./helpers/EmptyStateSearchSvg.js";
5
+ const m = t, i = e, x = T, c = {
6
+ [T]: E,
7
+ [_]: E,
8
+ [S]: b,
9
+ [r]: a
10
+ }, n = {
2
11
  sm: {
3
12
  icon: "bear-w-12 bear-h-12",
4
13
  title: "bear-text-lg",
@@ -19,11 +28,9 @@ const e = "Bear-EmptyState", r = "bear-flex bear-flex-col bear-items-center bear
19
28
  }
20
29
  };
21
30
  export {
22
- r as EMPTY_STATE_BASE_CLASSES,
23
- a as EMPTY_STATE_CARD_CLASSES,
24
- S as EMPTY_STATE_DESCRIPTION_CLASSES,
25
- b as EMPTY_STATE_ICON_CLASSES,
26
- e as EMPTY_STATE_ROOT_CLASS,
27
- E as EMPTY_STATE_SIZE_CLASSES,
28
- t as EMPTY_STATE_TITLE_CLASSES
31
+ x as EMPTY_STATE_DEFAULT_PRESET,
32
+ m as EMPTY_STATE_DEFAULT_SIZE,
33
+ i as EMPTY_STATE_DEFAULT_VARIANT,
34
+ c as EMPTY_STATE_PRESET_ICON,
35
+ n as EMPTY_STATE_SIZE_CLASSES
29
36
  };
@@ -1,3 +1,2 @@
1
- import { FC } from 'react';
2
1
  import { EmptyStateProps } from './EmptyState.types';
3
- export declare const EmptyState: FC<EmptyStateProps>;
2
+ export declare const EmptyState: (props: EmptyStateProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,54 +1,50 @@
1
- import { jsxs as l, jsx as e } from "react/jsx-runtime";
2
- import { EMPTY_STATE_SIZE_CLASSES as p, EMPTY_STATE_ICON_CLASSES as h, EMPTY_STATE_TITLE_CLASSES as C, EMPTY_STATE_DESCRIPTION_CLASSES as f, EMPTY_STATE_ROOT_CLASS as d, EMPTY_STATE_CARD_CLASSES as I, EMPTY_STATE_BASE_CLASSES as L } from "./EmptyState.const.js";
3
- import { cn as r } from "../../utils/cn.js";
1
+ import { jsxs as c, jsx as e } from "react/jsx-runtime";
2
+ import { Box as m } from "../Box/Box.js";
3
+ import { Flex as N } from "../Flex/Flex.js";
4
+ import { Typography as n } from "../Typography/Typography.js";
5
+ import { cn as a } from "../../utils/cn.js";
4
6
  import "react";
5
- import { resolveBearId as u } from "../../utils/generateBearId.utils.js";
6
- import { useBearId as v } from "../../utils/useBearId.js";
7
- const M = ({ className: t }) => /* @__PURE__ */ e("svg", { className: t, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ e(
8
- "path",
9
- {
10
- strokeLinecap: "round",
11
- strokeLinejoin: "round",
12
- strokeWidth: 1.5,
13
- d: "M20 13V6a2 2 0 00-2-2H6a2 2 0 00-2 2v7m16 0v5a2 2 0 01-2 2H6a2 2 0 01-2-2v-5m16 0h-2.586a1 1 0 00-.707.293l-2.414 2.414a1 1 0 01-.707.293h-3.172a1 1 0 01-.707-.293l-2.414-2.414A1 1 0 006.586 13H4"
14
- }
15
- ) }), k = ({
16
- icon: t,
17
- title: E,
18
- description: s,
19
- action: S,
20
- secondaryAction: o,
21
- className: i,
22
- size: T = "md",
23
- variant: m = "default",
24
- id: n,
25
- testId: _
26
- }) => {
27
- const c = v("EmptyState"), A = u(n, c), a = p[T];
28
- return /* @__PURE__ */ l(
29
- "div",
7
+ import { resolveBearId as P } from "../../utils/generateBearId.utils.js";
8
+ import { useBearId as h } from "../../utils/useBearId.js";
9
+ import { EMPTY_STATE_DEFAULT_SIZE as g, EMPTY_STATE_DEFAULT_VARIANT as x, EMPTY_STATE_DEFAULT_PRESET as M, EMPTY_STATE_SIZE_CLASSES as Y, EMPTY_STATE_PRESET_ICON as u } from "./EmptyState.const.js";
10
+ const z = (E) => {
11
+ const {
12
+ icon: p,
13
+ title: d,
14
+ description: r,
15
+ action: o,
16
+ secondaryAction: s,
17
+ className: l,
18
+ size: _ = g,
19
+ variant: T = x,
20
+ preset: i = M,
21
+ id: S,
22
+ testId: y
23
+ } = E, A = h("EmptyState"), f = P(S, A), t = Y[_], B = u[i], I = p ?? /* @__PURE__ */ e(B, { className: "bear-w-full bear-h-full" });
24
+ return /* @__PURE__ */ c(
25
+ m,
30
26
  {
31
- id: A,
32
- "data-testid": _,
33
- className: r(
34
- d,
35
- L,
36
- a.padding,
37
- m === "card" && I,
38
- i
27
+ id: f,
28
+ "data-testid": y,
29
+ className: a(
30
+ "Bear-EmptyState",
31
+ T === "card" && "Bear-EmptyState--card",
32
+ `Bear-EmptyState--${i}`,
33
+ t.padding,
34
+ l
39
35
  ),
40
36
  children: [
41
- /* @__PURE__ */ e("div", { className: r(h, a.icon), children: t || /* @__PURE__ */ e(M, { className: "bear-w-full bear-h-full" }) }),
42
- /* @__PURE__ */ e("h3", { className: r(C, a.title), children: E }),
43
- s && /* @__PURE__ */ e("p", { className: r(f, a.desc), children: s }),
44
- (S || o) && /* @__PURE__ */ l("div", { className: `${d}__actions bear-flex bear-items-center bear-gap-3`, children: [
45
- S,
46
- o
37
+ /* @__PURE__ */ e(m, { className: a("Bear-EmptyState__icon", t.icon), children: I }),
38
+ /* @__PURE__ */ e(n, { className: a("Bear-EmptyState__title", t.title), children: d }),
39
+ r && /* @__PURE__ */ e(n, { className: a("Bear-EmptyState__description", t.desc), children: r }),
40
+ (o || s) && /* @__PURE__ */ c(N, { className: "Bear-EmptyState__actions", align: "center", gap: 3, children: [
41
+ o,
42
+ s
47
43
  ] })
48
44
  ]
49
45
  }
50
46
  );
51
47
  };
52
48
  export {
53
- k as EmptyState
49
+ z as EmptyState
54
50
  };
@@ -1,4 +1,5 @@
1
1
  import { ReactNode } from 'react';
2
+ export type EmptyStatePreset = 'empty' | 'search' | 'inbox' | 'error';
2
3
  export interface EmptyStateProps {
3
4
  testId?: string;
4
5
  id?: string;
@@ -10,4 +11,5 @@ export interface EmptyStateProps {
10
11
  className?: string;
11
12
  size?: 'sm' | 'md' | 'lg';
12
13
  variant?: 'default' | 'card';
14
+ preset?: EmptyStatePreset;
13
15
  }
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),o=r=>{const{className:t}=r;return e.jsx("svg",{className:t,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","aria-hidden":"true",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M12 9v4m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z"})})};exports.EmptyStateErrorSvg=o;
@@ -0,0 +1,3 @@
1
+ export declare const EmptyStateErrorSvg: (props: {
2
+ className?: string;
3
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ const n = (o) => {
3
+ const { className: e } = o;
4
+ return /* @__PURE__ */ r("svg", { className: e, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", "aria-hidden": "true", children: /* @__PURE__ */ r("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 1.5, d: "M12 9v4m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z" }) });
5
+ };
6
+ export {
7
+ n as EmptyStateErrorSvg
8
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=t=>{const{className:o}=t;return e.jsx("svg",{className:o,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","aria-hidden":"true",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M20 13V6a2 2 0 00-2-2H6a2 2 0 00-2 2v7m16 0v5a2 2 0 01-2 2H6a2 2 0 01-2-2v-5m16 0h-2.586a1 1 0 00-.707.293l-2.414 2.414a1 1 0 01-.707.293h-3.172a1 1 0 01-.707-.293l-2.414-2.414A1 1 0 006.586 13H4"})})};exports.EmptyStateInboxSvg=r;
@@ -0,0 +1,3 @@
1
+ export declare const EmptyStateInboxSvg: (props: {
2
+ className?: string;
3
+ }) => import("react/jsx-runtime").JSX.Element;