@forgedevstack/bear 1.3.1 → 1.3.2

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 (269) hide show
  1. package/README.md +26 -0
  2. package/dist/components/Accordion/components/AccordionItem/AccordionItem.cjs +1 -1
  3. package/dist/components/Accordion/components/AccordionItem/AccordionItem.js +1 -1
  4. package/dist/components/Alert/Alert.cjs +1 -1
  5. package/dist/components/Alert/Alert.js +1 -1
  6. package/dist/components/Avatar/Avatar.cjs +1 -1
  7. package/dist/components/Avatar/Avatar.js +1 -1
  8. package/dist/components/BackTop/BackTop.cjs +1 -1
  9. package/dist/components/BackTop/BackTop.js +1 -1
  10. package/dist/components/Banner/Banner.const.cjs +1 -1
  11. package/dist/components/Banner/Banner.const.js +1 -1
  12. package/dist/components/Blockquote/Blockquote.cjs +1 -1
  13. package/dist/components/Blockquote/Blockquote.js +1 -1
  14. package/dist/components/BottomSheet/BottomSheet.cjs +1 -1
  15. package/dist/components/BottomSheet/BottomSheet.js +1 -1
  16. package/dist/components/Breadcrumbs/Breadcrumbs.cjs +1 -1
  17. package/dist/components/Breadcrumbs/Breadcrumbs.js +1 -1
  18. package/dist/components/Calendar/Calendar.cjs +1 -1
  19. package/dist/components/Calendar/Calendar.js +1 -1
  20. package/dist/components/Chart/BarChart.cjs +1 -1
  21. package/dist/components/Chart/BarChart.d.ts +1 -2
  22. package/dist/components/Chart/BarChart.js +81 -61
  23. package/dist/components/Chart/Chart.cjs +1 -1
  24. package/dist/components/Chart/Chart.const.cjs +1 -1
  25. package/dist/components/Chart/Chart.const.d.ts +24 -3
  26. package/dist/components/Chart/Chart.const.js +39 -16
  27. package/dist/components/Chart/Chart.d.ts +1 -5
  28. package/dist/components/Chart/Chart.js +19 -23
  29. package/dist/components/Chart/Chart.types.d.ts +11 -19
  30. package/dist/components/Chart/Chart.utils.cjs +1 -1
  31. package/dist/components/Chart/Chart.utils.d.ts +8 -18
  32. package/dist/components/Chart/Chart.utils.js +39 -3
  33. package/dist/components/Chart/FunnelChart.cjs +1 -0
  34. package/dist/components/Chart/FunnelChart.d.ts +2 -0
  35. package/dist/components/Chart/FunnelChart.js +59 -0
  36. package/dist/components/Chart/LineChart.cjs +1 -1
  37. package/dist/components/Chart/LineChart.d.ts +1 -2
  38. package/dist/components/Chart/LineChart.js +51 -55
  39. package/dist/components/Chart/PieChart.cjs +1 -1
  40. package/dist/components/Chart/PieChart.d.ts +1 -2
  41. package/dist/components/Chart/PieChart.js +121 -106
  42. package/dist/components/Chart/PieChart.types.d.ts +8 -0
  43. package/dist/components/Chart/RadarChart.cjs +1 -0
  44. package/dist/components/Chart/RadarChart.d.ts +2 -0
  45. package/dist/components/Chart/RadarChart.js +100 -0
  46. package/dist/components/Chart/index.d.ts +3 -1
  47. package/dist/components/Chat/Chat.cjs +1 -1
  48. package/dist/components/Chat/Chat.js +1 -1
  49. package/dist/components/CurrencyInput/CurrencyInput.cjs +1 -1
  50. package/dist/components/CurrencyInput/CurrencyInput.js +1 -1
  51. package/dist/components/DatePicker/DatePicker.cjs +1 -1
  52. package/dist/components/DatePicker/DatePicker.js +1 -1
  53. package/dist/components/DateRangePicker/DateRangePicker.cjs +1 -1
  54. package/dist/components/DateRangePicker/DateRangePicker.js +1 -1
  55. package/dist/components/Drawer/Drawer.cjs +1 -1
  56. package/dist/components/Drawer/Drawer.const.cjs +1 -1
  57. package/dist/components/Drawer/Drawer.const.d.ts +2 -11
  58. package/dist/components/Drawer/Drawer.const.js +6 -55
  59. package/dist/components/Drawer/Drawer.d.ts +1 -2
  60. package/dist/components/Drawer/Drawer.js +87 -131
  61. package/dist/components/Drawer/Drawer.types.d.ts +16 -3
  62. package/dist/components/Drawer/Drawer.utils.d.ts +0 -4
  63. package/dist/components/Drawer/components/DrawerHeader/DrawerHeader.cjs +1 -0
  64. package/dist/components/Drawer/components/DrawerHeader/DrawerHeader.d.ts +2 -0
  65. package/dist/components/Drawer/components/DrawerHeader/DrawerHeader.js +26 -0
  66. package/dist/components/Drawer/components/DrawerHeader/DrawerHeader.types.d.ts +20 -0
  67. package/dist/components/Drawer/components/DrawerHeader/DrawerHeaderClose.cjs +1 -0
  68. package/dist/components/Drawer/components/DrawerHeader/DrawerHeaderClose.d.ts +2 -0
  69. package/dist/components/Drawer/components/DrawerHeader/DrawerHeaderClose.js +17 -0
  70. package/dist/components/Drawer/components/DrawerHeader/DrawerHeaderTitle.cjs +1 -0
  71. package/dist/components/Drawer/components/DrawerHeader/DrawerHeaderTitle.d.ts +2 -0
  72. package/dist/components/Drawer/components/DrawerHeader/DrawerHeaderTitle.js +9 -0
  73. package/dist/components/Drawer/components/DrawerHeader/index.d.ts +2 -0
  74. package/dist/components/Drawer/components/index.d.ts +1 -0
  75. package/dist/components/Drawer/helpers/DrawerOptionalHeader.cjs +1 -0
  76. package/dist/components/Drawer/helpers/DrawerOptionalHeader.d.ts +2 -0
  77. package/dist/components/Drawer/helpers/DrawerOptionalHeader.js +9 -0
  78. package/dist/components/Drawer/helpers/index.d.ts +1 -0
  79. package/dist/components/Drawer/hooks/index.d.ts +1 -0
  80. package/dist/components/Drawer/hooks/useDrawer.cjs +1 -0
  81. package/dist/components/Drawer/hooks/useDrawer.d.ts +2 -0
  82. package/dist/components/Drawer/hooks/useDrawer.js +51 -0
  83. package/dist/components/Editable/Editable.cjs +1 -1
  84. package/dist/components/Editable/Editable.js +1 -1
  85. package/dist/components/FileTree/FileTree.cjs +1 -1
  86. package/dist/components/FileTree/FileTree.js +1 -1
  87. package/dist/components/FloatingChat/FloatingChat.cjs +1 -1
  88. package/dist/components/FloatingChat/FloatingChat.js +1 -1
  89. package/dist/components/Gauge/Gauge.cjs +1 -1
  90. package/dist/components/Gauge/Gauge.const.cjs +1 -1
  91. package/dist/components/Gauge/Gauge.const.d.ts +5 -0
  92. package/dist/components/Gauge/Gauge.const.js +11 -6
  93. package/dist/components/Gauge/Gauge.d.ts +1 -2
  94. package/dist/components/Gauge/Gauge.js +69 -45
  95. package/dist/components/Gauge/Gauge.types.d.ts +11 -2
  96. package/dist/components/Gauge/helpers/GaugeLinearBar.cjs +1 -0
  97. package/dist/components/Gauge/helpers/GaugeLinearBar.d.ts +2 -0
  98. package/dist/components/Gauge/helpers/GaugeLinearBar.js +40 -0
  99. package/dist/components/Heatmap/Heatmap.cjs +1 -1
  100. package/dist/components/Heatmap/Heatmap.const.cjs +1 -1
  101. package/dist/components/Heatmap/Heatmap.const.d.ts +2 -0
  102. package/dist/components/Heatmap/Heatmap.const.js +8 -6
  103. package/dist/components/Heatmap/Heatmap.js +51 -47
  104. package/dist/components/Heatmap/Heatmap.types.d.ts +1 -1
  105. package/dist/components/Icon/Icon.d.ts +2 -39
  106. package/dist/components/Icon/Icon.types.d.ts +1 -17
  107. package/dist/components/Icon/icons/action.d.ts +1 -85
  108. package/dist/components/Icon/icons/bear.d.ts +1 -12
  109. package/dist/components/Icon/icons/charts.d.ts +1 -0
  110. package/dist/components/Icon/icons/commerce.d.ts +1 -25
  111. package/dist/components/Icon/icons/communication.d.ts +1 -48
  112. package/dist/components/Icon/icons/content.d.ts +1 -53
  113. package/dist/components/Icon/icons/device.d.ts +1 -27
  114. package/dist/components/Icon/icons/editor.d.ts +1 -54
  115. package/dist/components/Icon/icons/file.d.ts +1 -25
  116. package/dist/components/Icon/icons/index.d.ts +1 -9
  117. package/dist/components/Icon/icons/media.d.ts +1 -64
  118. package/dist/components/Icon/icons/misc.d.ts +1 -96
  119. package/dist/components/Icon/icons/navigation.d.ts +1 -56
  120. package/dist/components/Icon/icons/social.d.ts +1 -24
  121. package/dist/components/Icon/icons/status.d.ts +1 -61
  122. package/dist/components/Icon/index.d.ts +2 -605
  123. package/dist/components/ImageAnnotation/ImageAnnotation.cjs +1 -1
  124. package/dist/components/ImageAnnotation/ImageAnnotation.js +1 -1
  125. package/dist/components/JsonViewer/JsonViewer.cjs +1 -1
  126. package/dist/components/JsonViewer/JsonViewer.js +1 -1
  127. package/dist/components/MediaPlayer/MediaPlayer.cjs +1 -1
  128. package/dist/components/MediaPlayer/MediaPlayer.js +1 -1
  129. package/dist/components/Modal/Modal.cjs +1 -1
  130. package/dist/components/Modal/Modal.js +1 -1
  131. package/dist/components/PageNav/PageNav.cjs +1 -1
  132. package/dist/components/PageNav/PageNav.js +1 -1
  133. package/dist/components/PasswordInput/PasswordInput.cjs +1 -1
  134. package/dist/components/PasswordInput/PasswordInput.js +5 -5
  135. package/dist/components/PropsPlayground/PropsPlayground.cjs +1 -1
  136. package/dist/components/PropsPlayground/PropsPlayground.js +1 -1
  137. package/dist/components/Rating/components/StarIcon/StarIcon.cjs +1 -1
  138. package/dist/components/Rating/components/StarIcon/StarIcon.js +1 -1
  139. package/dist/components/Result/Result.utils.cjs +1 -1
  140. package/dist/components/Result/Result.utils.js +1 -1
  141. package/dist/components/RichEditor/components/ToolbarColorPicker/ToolbarColorPicker.cjs +1 -1
  142. package/dist/components/RichEditor/components/ToolbarColorPicker/ToolbarColorPicker.js +1 -1
  143. package/dist/components/RichEditor/components/ToolbarDropdown/ToolbarDropdown.cjs +1 -1
  144. package/dist/components/RichEditor/components/ToolbarDropdown/ToolbarDropdown.js +1 -1
  145. package/dist/components/RichEditor/components/ToolbarMore/ToolbarMore.cjs +1 -1
  146. package/dist/components/RichEditor/components/ToolbarMore/ToolbarMore.js +1 -1
  147. package/dist/components/RichEditor/components/ToolbarSignature/ToolbarSignature.cjs +1 -1
  148. package/dist/components/RichEditor/components/ToolbarSignature/ToolbarSignature.js +1 -1
  149. package/dist/components/RichEditor/helpers/IconRender.cjs +1 -1
  150. package/dist/components/RichEditor/helpers/IconRender.js +16 -16
  151. package/dist/components/RichEditor/helpers/toolbarItemRender.cjs +1 -1
  152. package/dist/components/RichEditor/helpers/toolbarItemRender.js +23 -23
  153. package/dist/components/RingProgress/RingProgress.cjs +1 -1
  154. package/dist/components/RingProgress/RingProgress.const.cjs +1 -1
  155. package/dist/components/RingProgress/RingProgress.const.d.ts +3 -0
  156. package/dist/components/RingProgress/RingProgress.const.js +7 -4
  157. package/dist/components/RingProgress/RingProgress.js +38 -37
  158. package/dist/components/RingProgress/RingProgress.types.d.ts +1 -0
  159. package/dist/components/Select/Select.cjs +1 -1
  160. package/dist/components/Select/Select.js +1 -1
  161. package/dist/components/Sidebar/Sidebar.cjs +1 -1
  162. package/dist/components/Sidebar/Sidebar.js +16 -15
  163. package/dist/components/Sidebar/Sidebar.types.d.ts +1 -1
  164. package/dist/components/Sidebar/Sidebar.utils.cjs +1 -0
  165. package/dist/components/Sidebar/Sidebar.utils.d.ts +2 -0
  166. package/dist/components/Sidebar/Sidebar.utils.js +11 -0
  167. package/dist/components/Sidebar/components/SidebarGroup/SidebarGroup.cjs +1 -1
  168. package/dist/components/Sidebar/components/SidebarGroup/SidebarGroup.js +1 -1
  169. package/dist/components/Sidebar/components/SidebarItem/SidebarItem.cjs +1 -1
  170. package/dist/components/Sidebar/components/SidebarItem/SidebarItem.js +55 -51
  171. package/dist/components/Sidebar/index.d.ts +1 -0
  172. package/dist/components/SliderRange/SliderRange.cjs +1 -1
  173. package/dist/components/SliderRange/SliderRange.js +19 -19
  174. package/dist/components/Sparkline/Sparkline.cjs +1 -1
  175. package/dist/components/Sparkline/Sparkline.const.cjs +1 -1
  176. package/dist/components/Sparkline/Sparkline.const.d.ts +5 -0
  177. package/dist/components/Sparkline/Sparkline.const.js +9 -4
  178. package/dist/components/Sparkline/Sparkline.d.ts +1 -2
  179. package/dist/components/Sparkline/Sparkline.js +75 -53
  180. package/dist/components/Sparkline/Sparkline.types.d.ts +2 -0
  181. package/dist/components/Sparkline/Sparkline.utils.cjs +1 -1
  182. package/dist/components/Sparkline/Sparkline.utils.d.ts +7 -12
  183. package/dist/components/Sparkline/Sparkline.utils.js +33 -20
  184. package/dist/components/Sparkline/index.d.ts +2 -2
  185. package/dist/components/Stepper/Stepper.cjs +1 -1
  186. package/dist/components/Stepper/Stepper.js +1 -1
  187. package/dist/components/Tabs/TabList.cjs +1 -1
  188. package/dist/components/Tabs/TabList.js +1 -1
  189. package/dist/components/TimePicker/TimePicker.cjs +1 -1
  190. package/dist/components/TimePicker/TimePicker.js +1 -1
  191. package/dist/components/TimelineChart/TimelineChart.cjs +1 -1
  192. package/dist/components/TimelineChart/TimelineChart.const.cjs +1 -1
  193. package/dist/components/TimelineChart/TimelineChart.const.d.ts +3 -0
  194. package/dist/components/TimelineChart/TimelineChart.const.js +7 -4
  195. package/dist/components/TimelineChart/TimelineChart.js +56 -42
  196. package/dist/components/TimelineChart/TimelineChart.types.d.ts +1 -1
  197. package/dist/components/TreeSelect/TreeSelect.cjs +1 -1
  198. package/dist/components/TreeSelect/TreeSelect.js +1 -1
  199. package/dist/components/TreeSelect/components/TreeSelectExpandControl/TreeSelectExpandControl.cjs +1 -1
  200. package/dist/components/TreeSelect/components/TreeSelectExpandControl/TreeSelectExpandControl.js +1 -1
  201. package/dist/components/TreeView/TreeView.cjs +1 -1
  202. package/dist/components/TreeView/TreeView.js +3 -2
  203. package/dist/components/TreeView/components/TreeViewExpandControl/TreeViewExpandControl.cjs +1 -1
  204. package/dist/components/TreeView/components/TreeViewExpandControl/TreeViewExpandControl.js +1 -1
  205. package/dist/components/TreeView/components/TreeViewNodeIcon/TreeViewNodeIcon.cjs +1 -1
  206. package/dist/components/TreeView/components/TreeViewNodeIcon/TreeViewNodeIcon.js +1 -1
  207. package/dist/components/index.cjs +1 -1
  208. package/dist/components/index.d.ts +2 -2
  209. package/dist/components/index.js +409 -406
  210. package/dist/constants/generals.const.cjs +1 -1
  211. package/dist/constants/generals.const.d.ts +4 -0
  212. package/dist/constants/generals.const.js +50 -47
  213. package/dist/icons.cjs +1 -1
  214. package/dist/icons.d.ts +2 -2
  215. package/dist/icons.js +1 -6
  216. package/dist/index.cjs +1 -1
  217. package/dist/index.js +551 -548
  218. package/dist/node_modules/@forgedevstack/bear-icons/dist/Icon.cjs +1 -0
  219. package/dist/node_modules/@forgedevstack/bear-icons/dist/Icon.const.cjs +1 -0
  220. package/dist/node_modules/@forgedevstack/bear-icons/dist/Icon.const.js +14 -0
  221. package/dist/node_modules/@forgedevstack/bear-icons/dist/Icon.js +35 -0
  222. package/dist/node_modules/@forgedevstack/bear-icons/dist/action.cjs +1 -0
  223. package/dist/node_modules/@forgedevstack/bear-icons/dist/action.js +26 -0
  224. package/dist/node_modules/@forgedevstack/bear-icons/dist/cn.utils.cjs +1 -0
  225. package/dist/node_modules/@forgedevstack/bear-icons/dist/cn.utils.js +4 -0
  226. package/dist/node_modules/@forgedevstack/bear-icons/dist/editor.cjs +1 -0
  227. package/dist/node_modules/@forgedevstack/bear-icons/dist/editor.js +130 -0
  228. package/dist/node_modules/@forgedevstack/bear-icons/dist/misc.cjs +1 -0
  229. package/dist/node_modules/@forgedevstack/bear-icons/dist/misc.js +12 -0
  230. package/dist/node_modules/@forgedevstack/bear-icons/dist/navigation.cjs +1 -0
  231. package/dist/node_modules/@forgedevstack/bear-icons/dist/navigation.js +18 -0
  232. package/dist/node_modules/@forgedevstack/bear-icons/dist/status.cjs +1 -0
  233. package/dist/node_modules/@forgedevstack/bear-icons/dist/status.js +6 -0
  234. package/dist/styles/_drawer.css +213 -0
  235. package/dist/styles/_overlays.css +0 -1
  236. package/dist/styles/main.css +1 -0
  237. package/dist/styles.css +226 -25
  238. package/package.json +5 -1
  239. package/dist/components/Icon/Icon.cjs +0 -1
  240. package/dist/components/Icon/Icon.const.d.ts +0 -1
  241. package/dist/components/Icon/Icon.js +0 -45
  242. package/dist/components/Icon/icons/action.cjs +0 -1
  243. package/dist/components/Icon/icons/action.js +0 -351
  244. package/dist/components/Icon/icons/bear.cjs +0 -1
  245. package/dist/components/Icon/icons/bear.js +0 -47
  246. package/dist/components/Icon/icons/commerce.cjs +0 -1
  247. package/dist/components/Icon/icons/commerce.js +0 -124
  248. package/dist/components/Icon/icons/communication.cjs +0 -1
  249. package/dist/components/Icon/icons/communication.js +0 -184
  250. package/dist/components/Icon/icons/content.cjs +0 -1
  251. package/dist/components/Icon/icons/content.js +0 -231
  252. package/dist/components/Icon/icons/device.cjs +0 -1
  253. package/dist/components/Icon/icons/device.js +0 -122
  254. package/dist/components/Icon/icons/editor.cjs +0 -1
  255. package/dist/components/Icon/icons/editor.js +0 -285
  256. package/dist/components/Icon/icons/file.cjs +0 -1
  257. package/dist/components/Icon/icons/file.js +0 -120
  258. package/dist/components/Icon/icons/media.cjs +0 -1
  259. package/dist/components/Icon/icons/media.js +0 -306
  260. package/dist/components/Icon/icons/misc.cjs +0 -1
  261. package/dist/components/Icon/icons/misc.js +0 -450
  262. package/dist/components/Icon/icons/navigation.cjs +0 -1
  263. package/dist/components/Icon/icons/navigation.js +0 -215
  264. package/dist/components/Icon/icons/social.cjs +0 -1
  265. package/dist/components/Icon/icons/social.js +0 -89
  266. package/dist/components/Icon/icons/status.cjs +0 -1
  267. package/dist/components/Icon/icons/status.js +0 -271
  268. package/dist/components/Icon/index.cjs +0 -1
  269. package/dist/components/Icon/index.js +0 -79
@@ -1,37 +1,37 @@
1
1
  import { jsx as o } from "react/jsx-runtime";
2
2
  import { SIXTEEN as l } from "../../../constants/numbers.const.js";
3
- import { TOOLBAR_ITEM_MORE as a, TOOLBAR_ITEM_CLEAR_FORMAT as O, COMMAND_REMOVE_FORMAT as S, TOOLBAR_ITEM_OUTDENT as s, COMMAND_OUTDENT as G, TOOLBAR_ITEM_INDENT as L, COMMAND_INDENT as B, TOOLBAR_ITEM_ALIGN_JUSTIFY as d, COMMAND_JUSTIFY_FULL as H, TOOLBAR_ITEM_ALIGN_RIGHT as A, COMMAND_JUSTIFY_RIGHT as F, TOOLBAR_ITEM_ALIGN_CENTER as R, COMMAND_JUSTIFY_CENTER as f, TOOLBAR_ITEM_ALIGN_LEFT as C, COMMAND_JUSTIFY_LEFT as k, TOOLBAR_ITEM_SIGNATURE as M, TOOLBAR_ITEM_IMAGE as N, TOOLBAR_ITEM_LINK as c, TOOLBAR_ITEM_HIGHLIGHT_COLOR as g, TOOLBAR_ITEM_TEXT_COLOR as h, TOOLBAR_ITEM_HEADING_DROPDOWN as p, TOOLBAR_ITEM_DIVIDER as b } from "../../../constants/generals.const.js";
4
- import { FormatClearIcon as u, IndentDecreaseIcon as U, IndentIncreaseIcon as z, AlignJustifyIcon as y, AlignRightIcon as v, AlignCenterIcon as J, AlignLeftIcon as Y, InsertPhotoIcon as P, InsertLinkIcon as V, TextIcon as X } from "../../Icon/icons/editor.js";
3
+ import { TOOLBAR_ITEM_MORE as t, TOOLBAR_ITEM_CLEAR_FORMAT as s, COMMAND_REMOVE_FORMAT as S, TOOLBAR_ITEM_OUTDENT as O, COMMAND_OUTDENT as G, TOOLBAR_ITEM_INDENT as L, COMMAND_INDENT as B, TOOLBAR_ITEM_ALIGN_JUSTIFY as d, COMMAND_JUSTIFY_FULL as H, TOOLBAR_ITEM_ALIGN_RIGHT as A, COMMAND_JUSTIFY_RIGHT as F, TOOLBAR_ITEM_ALIGN_CENTER as R, COMMAND_JUSTIFY_CENTER as f, TOOLBAR_ITEM_ALIGN_LEFT as C, COMMAND_JUSTIFY_LEFT as k, TOOLBAR_ITEM_SIGNATURE as M, TOOLBAR_ITEM_IMAGE as N, TOOLBAR_ITEM_LINK as c, TOOLBAR_ITEM_HIGHLIGHT_COLOR as g, TOOLBAR_ITEM_TEXT_COLOR as h, TOOLBAR_ITEM_HEADING_DROPDOWN as p, TOOLBAR_ITEM_DIVIDER as m } from "../../../constants/generals.const.js";
4
+ import { FormatClearIcon as u, IndentDecreaseIcon as U, IndentIncreaseIcon as z, AlignJustifyIcon as y, AlignRightIcon as v, AlignCenterIcon as J, AlignLeftIcon as Y, InsertPhotoIcon as P, InsertLinkIcon as X, TextIcon as V } from "../../../node_modules/@forgedevstack/bear-icons/dist/editor.js";
5
5
  import { ToolbarButton as n } from "../components/ToolbarButton/ToolbarButton.js";
6
6
  import { ToolbarDropdown as K } from "../components/ToolbarDropdown/ToolbarDropdown.js";
7
- import { ToolbarColorPicker as m } from "../components/ToolbarColorPicker/ToolbarColorPicker.js";
7
+ import { ToolbarColorPicker as D } from "../components/ToolbarColorPicker/ToolbarColorPicker.js";
8
8
  import { ToolbarMore as w } from "../components/ToolbarMore/ToolbarMore.js";
9
9
  import { ToolbarSignature as $ } from "../components/ToolbarSignature/ToolbarSignature.js";
10
- import { RICH_EDITOR_BUTTON_CONFIG as j, RICH_EDITOR_MOBILE_MORE_ITEMS as W, RICH_EDITOR_DESKTOP_MORE_ITEMS as q, TITLE_CLEAR_FORMATTING as Q, TITLE_DECREASE_INDENT as Z, TITLE_INCREASE_INDENT as x, TITLE_JUSTIFY as ee, TITLE_ALIGN_RIGHT as oe, TITLE_ALIGN_CENTER as Te, TITLE_ALIGN_LEFT as ie, TITLE_INSERT_SIGNATURE as le, TITLE_INSERT_IMAGE as ne, TITLE_INSERT_LINK as Ie, TITLE_HIGHLIGHT_COLOR as _e, TITLE_TEXT_COLOR as re, TITLE_TEXT_STYLE as Ee, RICH_EDITOR_HEADING_OPTIONS as te } from "../RichEditor.const.js";
11
- import { RICH_EDITOR_ICONS as ae } from "./IconRender.js";
10
+ import { RICH_EDITOR_BUTTON_CONFIG as j, RICH_EDITOR_MOBILE_MORE_ITEMS as W, RICH_EDITOR_DESKTOP_MORE_ITEMS as q, TITLE_CLEAR_FORMATTING as Q, TITLE_DECREASE_INDENT as Z, TITLE_INCREASE_INDENT as x, TITLE_JUSTIFY as ee, TITLE_ALIGN_RIGHT as oe, TITLE_ALIGN_CENTER as Te, TITLE_ALIGN_LEFT as ie, TITLE_INSERT_SIGNATURE as le, TITLE_INSERT_IMAGE as ne, TITLE_INSERT_LINK as Ie, TITLE_HIGHLIGHT_COLOR as _e, TITLE_TEXT_COLOR as re, TITLE_TEXT_STYLE as Ee, RICH_EDITOR_HEADING_OPTIONS as ae } from "../RichEditor.const.js";
11
+ import { RICH_EDITOR_ICONS as te } from "./IconRender.js";
12
12
  const he = (e) => {
13
- const T = e.disabled || e.readOnly, D = {
14
- [b]: (i) => /* @__PURE__ */ o(
13
+ const T = e.disabled || e.readOnly, b = {
14
+ [m]: (i) => /* @__PURE__ */ o(
15
15
  "div",
16
16
  {
17
17
  className: "Bear-RichEditor__divider w-px h-5 bg-gray-300 dark:bg-zinc-600 mx-1"
18
18
  },
19
- `${b}-${i}`
19
+ `${m}-${i}`
20
20
  ),
21
21
  [p]: () => /* @__PURE__ */ o(
22
22
  K,
23
23
  {
24
- options: te,
24
+ options: ae,
25
25
  value: e.currentBlock,
26
26
  onChange: e.handleHeadingChange,
27
27
  title: Ee,
28
28
  disabled: T,
29
- icon: /* @__PURE__ */ o(X, { size: l })
29
+ icon: /* @__PURE__ */ o(V, { size: l })
30
30
  },
31
31
  p
32
32
  ),
33
33
  [h]: () => /* @__PURE__ */ o(
34
- m,
34
+ D,
35
35
  {
36
36
  value: e.textColorValue,
37
37
  onChange: e.handleTextColor,
@@ -44,7 +44,7 @@ const he = (e) => {
44
44
  h
45
45
  ),
46
46
  [g]: () => /* @__PURE__ */ o(
47
- m,
47
+ D,
48
48
  {
49
49
  value: e.highlightColorValue,
50
50
  onChange: e.handleHighlightColor,
@@ -59,7 +59,7 @@ const he = (e) => {
59
59
  [c]: () => /* @__PURE__ */ o(
60
60
  n,
61
61
  {
62
- icon: /* @__PURE__ */ o(V, { size: l }),
62
+ icon: /* @__PURE__ */ o(X, { size: l }),
63
63
  title: Ie,
64
64
  onClick: e.handleLink,
65
65
  disabled: T
@@ -135,7 +135,7 @@ const he = (e) => {
135
135
  },
136
136
  L
137
137
  ),
138
- [s]: () => /* @__PURE__ */ o(
138
+ [O]: () => /* @__PURE__ */ o(
139
139
  n,
140
140
  {
141
141
  icon: /* @__PURE__ */ o(U, { size: l }),
@@ -143,9 +143,9 @@ const he = (e) => {
143
143
  onClick: () => e.execAlign(G),
144
144
  disabled: T
145
145
  },
146
- s
146
+ O
147
147
  ),
148
- [O]: () => /* @__PURE__ */ o(
148
+ [s]: () => /* @__PURE__ */ o(
149
149
  n,
150
150
  {
151
151
  icon: /* @__PURE__ */ o(u, { size: l }),
@@ -153,21 +153,21 @@ const he = (e) => {
153
153
  onClick: () => e.execAlign(S),
154
154
  disabled: T
155
155
  },
156
- O
156
+ s
157
157
  ),
158
- [a]: () => {
158
+ [t]: () => {
159
159
  const i = e.isMobile ? W : q;
160
- return /* @__PURE__ */ o(w, { disabled: T, isMobile: e.isMobile, children: i.map((_, I) => r(_, I)) }, a);
160
+ return /* @__PURE__ */ o(w, { disabled: T, isMobile: e.isMobile, children: i.map((_, I) => r(_, I)) }, t);
161
161
  }
162
162
  }, r = (i, _) => {
163
- const I = D[i];
163
+ const I = b[i];
164
164
  if (I)
165
165
  return I(_);
166
- const E = j[i], t = ae[i];
167
- return !E || !t ? null : /* @__PURE__ */ o(
166
+ const E = j[i], a = te[i];
167
+ return !E || !a ? null : /* @__PURE__ */ o(
168
168
  n,
169
169
  {
170
- icon: t,
170
+ icon: a,
171
171
  title: E.title,
172
172
  active: e.activeFormats.has(i),
173
173
  onClick: () => e.handleFormat(i),
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),O=require("../../utils/cn.cjs");require("react");const h=require("../../constants/numbers.const.cjs"),j=require("../../constants/generals.const.cjs"),R=require("./RingProgress.const.cjs"),e=require("./RingProgress.utils.cjs"),S=m=>{const{sections:o,size:i=R.DEFAULT_SIZE,thickness:n=R.DEFAULT_THICKNESS,roundCaps:E=j.BOOLEAN_FALSE,label:c,rootColor:a,className:L,testId:N,..._}=m,l=e.getRingTotal(o),{radius:g,circumference:d,center:s}=e.getRingMetrics(i,n);let u=h.ZERO;const x=E?e.STROKE_LINECAP_ROUND:e.STROKE_LINECAP_BUTT;return r.jsxs("div",{className:O.cn("Bear-RingProgress bear-relative bear-inline-flex",L),"data-testid":N,..._,children:[r.jsxs("svg",{width:i,height:i,className:"bear-rotate-[-90deg]",children:[r.jsx("circle",{cx:s,cy:s,r:g,fill:e.FILL_NONE,strokeWidth:n,className:a?void 0:"bear-stroke-gray-200 dark:bear-stroke-zinc-700",stroke:a}),l>h.ZERO&&o.map((t,f)=>{const b=e.getRingSegmentLength(t.value,l,d),k=-u;return u+=b,r.jsxs("g",{children:[r.jsx("circle",{cx:s,cy:s,r:g,fill:e.FILL_NONE,strokeWidth:n,stroke:t.color,strokeDasharray:`${b} ${d}`,strokeDashoffset:k,strokeLinecap:x}),t.tooltip&&r.jsx("title",{children:t.tooltip})]},f)})]}),c!==void 0&&r.jsx("div",{className:"bear-absolute bear-inset-0 bear-flex bear-items-center bear-justify-center",children:e.renderRingLabel(c)})]})};exports.RingProgress=S;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),f=require("../../utils/cn.cjs");require("react");const L=require("../../constants/numbers.const.cjs"),O=require("../../constants/generals.const.cjs"),t=require("./RingProgress.const.cjs"),e=require("./RingProgress.utils.cjs"),j=b=>{const{sections:c,size:i=t.DEFAULT_SIZE,thickness:a=t.DEFAULT_THICKNESS,roundCaps:h=O.BOOLEAN_FALSE,label:l,rootColor:g,variant:d=t.RING_VARIANT_FULL,className:E,testId:A,...m}=b,u=e.getRingTotal(c),{radius:R,circumference:o,center:s}=e.getRingMetrics(i,a),I=d===t.RING_VARIANT_HALF?o*t.RING_HALF_SWEEP:o;let N=L.ZERO;const k=h?e.STROKE_LINECAP_ROUND:e.STROKE_LINECAP_BUTT;return r.jsxs("div",{className:f.cn("Bear-RingProgress bear-relative bear-inline-flex",E),"data-testid":A,...m,children:[r.jsxs("svg",{width:i,height:i,className:d===t.RING_VARIANT_HALF?"bear-rotate-[-180deg]":"bear-rotate-[-90deg]",children:[r.jsx("circle",{cx:s,cy:s,r:R,fill:e.FILL_NONE,strokeWidth:a,className:g?void 0:"bear-stroke-gray-200 dark:bear-stroke-zinc-700",stroke:g}),u>L.ZERO&&c.map((n,x)=>{const _=e.getRingSegmentLength(n.value,u,I),T=-N;return N+=_,r.jsxs("g",{children:[r.jsx("circle",{cx:s,cy:s,r:R,fill:e.FILL_NONE,strokeWidth:a,stroke:n.color,strokeDasharray:`${_} ${o}`,strokeDashoffset:T,strokeLinecap:k}),n.tooltip&&r.jsx("title",{children:n.tooltip})]},x)})]}),l!==void 0&&r.jsx("div",{className:"bear-absolute bear-inset-0 bear-flex bear-items-center bear-justify-center",children:e.renderRingLabel(l)})]})};exports.RingProgress=j;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("../../constants/numbers.const.cjs"),e=E.ONE_HUNDRED_TWENTY,t=E.TWELVE;exports.DEFAULT_SIZE=e;exports.DEFAULT_THICKNESS=t;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("../../constants/numbers.const.cjs"),A=_.ONE_HUNDRED_TWENTY,E=_.TWELVE,N="full",I="half",L=_.HALF;exports.DEFAULT_SIZE=A;exports.DEFAULT_THICKNESS=E;exports.RING_HALF_SWEEP=L;exports.RING_VARIANT_FULL=N;exports.RING_VARIANT_HALF=I;
@@ -1,2 +1,5 @@
1
1
  export declare const DEFAULT_SIZE = 120;
2
2
  export declare const DEFAULT_THICKNESS = 12;
3
+ export declare const RING_VARIANT_FULL = "full";
4
+ export declare const RING_VARIANT_HALF = "half";
5
+ export declare const RING_HALF_SWEEP = 0.5;
@@ -1,6 +1,9 @@
1
- import { ONE_HUNDRED_TWENTY as E, TWELVE as T } from "../../constants/numbers.const.js";
2
- const t = E, D = T;
1
+ import { ONE_HUNDRED_TWENTY as E, TWELVE as _, HALF as A } from "../../constants/numbers.const.js";
2
+ const o = E, L = _, T = "full", t = "half", I = A;
3
3
  export {
4
- t as DEFAULT_SIZE,
5
- D as DEFAULT_THICKNESS
4
+ o as DEFAULT_SIZE,
5
+ L as DEFAULT_THICKNESS,
6
+ I as RING_HALF_SWEEP,
7
+ T as RING_VARIANT_FULL,
8
+ t as RING_VARIANT_HALF
6
9
  };
@@ -1,70 +1,71 @@
1
1
  import { jsxs as i, jsx as t } from "react/jsx-runtime";
2
- import { cn as T } from "../../utils/cn.js";
2
+ import { cn as v } from "../../utils/cn.js";
3
3
  import "react";
4
- import { ZERO as h } from "../../constants/numbers.const.js";
5
- import { BOOLEAN_FALSE as _ } from "../../constants/generals.const.js";
6
- import { DEFAULT_SIZE as v, DEFAULT_THICKNESS as x } from "./RingProgress.const.js";
7
- import { getRingTotal as S, FILL_NONE as p, getRingSegmentLength as A, STROKE_LINECAP_ROUND as C, STROKE_LINECAP_BUTT as I, renderRingLabel as y, getRingMetrics as D } from "./RingProgress.utils.js";
8
- const W = (b) => {
4
+ import { ZERO as N } from "../../constants/numbers.const.js";
5
+ import { BOOLEAN_FALSE as O } from "../../constants/generals.const.js";
6
+ import { DEFAULT_SIZE as S, DEFAULT_THICKNESS as x, RING_VARIANT_FULL as F, RING_VARIANT_HALF as f, RING_HALF_SWEEP as C } from "./RingProgress.const.js";
7
+ import { getRingTotal as y, FILL_NONE as R, getRingSegmentLength as D, STROKE_LINECAP_ROUND as P, STROKE_LINECAP_BUTT as U, renderRingLabel as j, getRingMetrics as B } from "./RingProgress.utils.js";
8
+ const $ = (b) => {
9
9
  const {
10
- sections: a,
11
- size: s = v,
12
- thickness: o = x,
13
- roundCaps: E = _,
14
- label: c,
15
- rootColor: n,
16
- className: L,
17
- testId: N,
10
+ sections: c,
11
+ size: s = S,
12
+ thickness: a = x,
13
+ roundCaps: p = O,
14
+ label: n,
15
+ rootColor: l,
16
+ variant: m = F,
17
+ className: E,
18
+ testId: _,
18
19
  ...k
19
- } = b, l = S(a), { radius: m, circumference: d, center: e } = D(s, o);
20
- let g = h;
21
- const u = E ? C : I;
20
+ } = b, d = y(c), { radius: g, circumference: o, center: e } = B(s, a), A = m === f ? o * C : o;
21
+ let h = N;
22
+ const I = p ? P : U;
22
23
  return /* @__PURE__ */ i(
23
24
  "div",
24
25
  {
25
- className: T("Bear-RingProgress bear-relative bear-inline-flex", L),
26
- "data-testid": N,
26
+ className: v("Bear-RingProgress bear-relative bear-inline-flex", E),
27
+ "data-testid": _,
27
28
  ...k,
28
29
  children: [
29
- /* @__PURE__ */ i("svg", { width: s, height: s, className: "bear-rotate-[-90deg]", children: [
30
+ /* @__PURE__ */ i("svg", { width: s, height: s, className: m === f ? "bear-rotate-[-180deg]" : "bear-rotate-[-90deg]", children: [
30
31
  /* @__PURE__ */ t(
31
32
  "circle",
32
33
  {
33
34
  cx: e,
34
35
  cy: e,
35
- r: m,
36
- fill: p,
37
- strokeWidth: o,
38
- className: n ? void 0 : "bear-stroke-gray-200 dark:bear-stroke-zinc-700",
39
- stroke: n
36
+ r: g,
37
+ fill: R,
38
+ strokeWidth: a,
39
+ className: l ? void 0 : "bear-stroke-gray-200 dark:bear-stroke-zinc-700",
40
+ stroke: l
40
41
  }
41
42
  ),
42
- l > h && a.map((r, R) => {
43
- const f = A(r.value, l, d), O = -g;
44
- return g += f, /* @__PURE__ */ i("g", { children: [
43
+ d > N && c.map((r, u) => {
44
+ const L = D(r.value, d, A), T = -h;
45
+ return h += L, /* @__PURE__ */ i("g", { children: [
45
46
  /* @__PURE__ */ t(
46
47
  "circle",
47
48
  {
48
49
  cx: e,
49
50
  cy: e,
50
- r: m,
51
- fill: p,
52
- strokeWidth: o,
51
+ r: g,
52
+ fill: R,
53
+ strokeWidth: a,
53
54
  stroke: r.color,
54
- strokeDasharray: `${f} ${d}`,
55
- strokeDashoffset: O,
56
- strokeLinecap: u
55
+ strokeDasharray: `${L} ${o}`,
56
+ strokeDashoffset: T,
57
+ strokeLinecap: I
57
58
  }
58
59
  ),
59
60
  r.tooltip && /* @__PURE__ */ t("title", { children: r.tooltip })
60
- ] }, R);
61
+ ] }, u);
61
62
  })
62
63
  ] }),
63
- c !== void 0 && /* @__PURE__ */ t("div", { className: "bear-absolute bear-inset-0 bear-flex bear-items-center bear-justify-center", children: y(c) })
64
+ n !== void 0 && /* @__PURE__ */ t("div", { className: "bear-absolute bear-inset-0 bear-flex bear-items-center bear-justify-center", children: j(n) })
64
65
  ]
65
66
  }
66
67
  );
67
68
  };
68
69
  export {
69
- W as RingProgress
70
+ $ as RingProgress
70
71
  };
@@ -12,5 +12,6 @@ export interface RingProgressProps extends HTMLAttributes<HTMLDivElement> {
12
12
  roundCaps?: boolean;
13
13
  label?: ReactNode;
14
14
  rootColor?: string;
15
+ variant?: 'full' | 'half';
15
16
  testId?: string;
16
17
  }
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),f=require("react"),s=require("./Select.const.cjs"),I=require("../Icon/index.cjs"),V=require("../OverlayPortal/OverlayPortal.cjs"),i=require("../../utils/cn.cjs"),W=require("../../utils/generateBearId.utils.cjs"),X=require("../../utils/useBearId.cjs"),H=require("../../hooks/useClickOutside.cjs");require("../../context/BearProvider.cjs");require("../../hooks/useBearComponent/useBearComponent.cjs");const G=require("../../hooks/useFixedAnchorPosition/useFixedAnchorPosition.cjs"),J=require("../../hooks/useFixedAnchorPosition/useFixedAnchorPosition.utils.cjs"),K=require("../../hooks/useFormControl/useFormControl.cjs"),Q=C=>{const{options:v,value:l,onChange:t,placeholder:x=s.SELECT_DEFAULT_PLACEHOLDER,label:n,error:S,disabled:k=!1,required:A=!1,size:O="md",fullWidth:L=!1,displayEmpty:y=!1,renderValue:T,native:c=!1,className:j,id:P,testId:q}=C,{openEffect:F,closeEffect:B}=J.resolveOverlayEffects(C),$=X.useBearId("Select"),u=W.resolveBearId(P,$),a=K.useFormControl(),[b,E]=f.useState(!1),m=f.useRef(null),w=f.useRef(null),{style:D,ready:M}=G.useFixedAnchorPosition({anchorRef:m,open:b&&!c,offsetPx:s.SELECT_MENU_OFFSET_PX,matchWidth:!0}),d=k||!!(a!=null&&a.disabled),h=A||!!(a!=null&&a.required),o=!!S||!!(a!=null&&a.error),_=typeof S=="string"?S:void 0,g=v.find(e=>e.value===l),p=l===void 0||l==="",N=p||y&&p,U=f.useCallback(()=>E(!1),[]);H.useClickOutsideMultiple([m,w],U,{enabled:b&&!c&&!d});const Z=e=>{t==null||t(e),E(!1)},z=T&&!p?T(l):N||!g?x:g.label,R={backgroundColor:"var(--bear-bg-primary)",borderColor:o?void 0:"var(--bear-border-default)",color:g&&!N?"var(--bear-text-primary)":"var(--bear-text-muted)"};return c?r.jsxs("div",{id:u,"data-testid":q,className:i.cn(s.S_E_L_E_C_T_ROOT_CLASS,"bear-relative bear-flex bear-flex-col bear-gap-1.5",L&&"bear-w-full"),children:[n&&r.jsx("label",{htmlFor:`${u}-native`,className:"bear-text-sm bear-font-medium",style:{color:"var(--bear-text-secondary)"},children:n}),r.jsxs("select",{id:`${u}-native`,disabled:d,required:h,value:l??"",onChange:e=>t==null?void 0:t(e.target.value),className:i.cn(`${s.S_E_L_E_C_T_ROOT_CLASS}__native`,"bear-w-full bear-rounded-lg bear-border bear-outline-none bear-transition-all bear-duration-200","focus:bear-ring-2 focus:bear-ring-offset-2 focus:bear-ring-offset-[var(--bear-bg-primary)]",o?"bear-border-red-500 focus:bear-ring-red-500":"focus:bear-border-bear-500 focus:bear-ring-bear-500",d&&"bear-opacity-50 bear-cursor-not-allowed",s.SELECT_SIZE_CLASSES[O],j),style:R,"aria-invalid":o||void 0,"aria-required":h||void 0,"aria-describedby":a==null?void 0:a.helperId,children:[(y||x)&&r.jsx("option",{value:"",disabled:!y,children:x}),v.map(e=>r.jsx("option",{value:e.value,disabled:e.disabled,children:e.label},e.value))]}),_&&r.jsx("p",{className:"bear-text-sm bear-text-red-500",children:_})]}):r.jsxs("div",{ref:m,id:u,"data-testid":q,className:i.cn(s.S_E_L_E_C_T_ROOT_CLASS,"bear-relative bear-flex bear-flex-col bear-gap-1.5",L&&"bear-w-full"),children:[n&&r.jsx("label",{className:"bear-text-sm bear-font-medium",style:{color:"var(--bear-text-secondary)"},children:n}),r.jsxs("button",{type:"button",disabled:d,onClick:()=>!d&&E(!b),className:i.cn(`${s.S_E_L_E_C_T_ROOT_CLASS}__trigger`,"bear-flex bear-items-center bear-justify-between bear-w-full","bear-rounded-lg bear-border bear-text-left bear-outline-none bear-transition-all bear-duration-200","focus:bear-ring-2 focus:bear-ring-offset-2 focus:bear-ring-offset-[var(--bear-bg-primary)]",o?"bear-border-red-500 focus:bear-ring-red-500":"focus:bear-border-bear-500 focus:bear-ring-bear-500 dark:focus:bear-border-bear-500 dark:focus:bear-ring-bear-500",d&&"bear-opacity-50 bear-cursor-not-allowed",s.SELECT_SIZE_CLASSES[O],j),style:R,"aria-haspopup":"listbox","aria-expanded":b,"aria-invalid":o||void 0,"aria-required":h||void 0,"aria-describedby":a==null?void 0:a.helperId,children:[r.jsx("span",{className:`${s.S_E_L_E_C_T_ROOT_CLASS}__value`,children:z}),r.jsx(I.ChevronDownIcon,{className:i.cn("bear-w-4 bear-h-4 bear-shrink-0 bear-transition-transform",b&&"bear-rotate-180"),style:{color:"var(--bear-text-muted)"}})]}),r.jsx(V.OverlayPortal,{open:b&&!c,ready:M,style:{...D,backgroundColor:"var(--bear-bg-primary)",borderColor:"var(--bear-border-default)"},zIndex:s.SELECT_MENU_Z_INDEX,openEffect:F,closeEffect:B,panelRef:w,className:`${s.S_E_L_E_C_T_ROOT_CLASS}__menu bear-rounded-lg bear-border bear-shadow-lg bear-overflow-hidden`,attributes:{role:"listbox"},children:r.jsx("div",{className:"bear-max-h-60 bear-overflow-y-auto",children:v.map(e=>r.jsxs("button",{type:"button",disabled:e.disabled,onClick:()=>!e.disabled&&Z(e.value),role:"option","aria-selected":e.value===l,className:i.cn(`${s.S_E_L_E_C_T_ROOT_CLASS}__option`,"bear-flex bear-items-center bear-justify-between bear-w-full bear-px-4 bear-py-2","bear-text-left bear-transition-colors",e.disabled&&"bear-cursor-not-allowed",e.value===l&&"bear-bg-bear-100 bear-text-bear-700 dark:bear-bg-bear-600/20 dark:bear-text-bear-300",!e.disabled&&e.value!==l&&"hover:bear-bg-[var(--bear-bg-tertiary)]"),style:e.disabled?{color:"var(--bear-text-muted)"}:e.value===l?void 0:{color:"var(--bear-text-secondary)"},children:[e.label,e.value===l&&r.jsx(I.CheckIcon,{className:"bear-w-4 bear-h-4 bear-shrink-0 bear-text-bear-600 dark:bear-text-bear-400"})]},e.value))})}),_&&r.jsx("p",{className:"bear-text-sm bear-text-red-500",children:_})]})};exports.Select=Q;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),f=require("react"),s=require("./Select.const.cjs"),R=require("@forgedevstack/bear-icons"),V=require("../OverlayPortal/OverlayPortal.cjs"),i=require("../../utils/cn.cjs"),W=require("../../utils/generateBearId.utils.cjs"),X=require("../../utils/useBearId.cjs"),H=require("../../hooks/useClickOutside.cjs");require("../../context/BearProvider.cjs");require("../../hooks/useBearComponent/useBearComponent.cjs");const G=require("../../hooks/useFixedAnchorPosition/useFixedAnchorPosition.cjs"),J=require("../../hooks/useFixedAnchorPosition/useFixedAnchorPosition.utils.cjs"),K=require("../../hooks/useFormControl/useFormControl.cjs"),Q=C=>{const{options:v,value:l,onChange:t,placeholder:x=s.SELECT_DEFAULT_PLACEHOLDER,label:n,error:S,disabled:k=!1,required:A=!1,size:O="md",fullWidth:L=!1,displayEmpty:y=!1,renderValue:T,native:c=!1,className:j,id:P,testId:q}=C,{openEffect:F,closeEffect:B}=J.resolveOverlayEffects(C),$=X.useBearId("Select"),u=W.resolveBearId(P,$),a=K.useFormControl(),[b,E]=f.useState(!1),m=f.useRef(null),w=f.useRef(null),{style:D,ready:M}=G.useFixedAnchorPosition({anchorRef:m,open:b&&!c,offsetPx:s.SELECT_MENU_OFFSET_PX,matchWidth:!0}),d=k||!!(a!=null&&a.disabled),h=A||!!(a!=null&&a.required),o=!!S||!!(a!=null&&a.error),_=typeof S=="string"?S:void 0,g=v.find(e=>e.value===l),p=l===void 0||l==="",N=p||y&&p,U=f.useCallback(()=>E(!1),[]);H.useClickOutsideMultiple([m,w],U,{enabled:b&&!c&&!d});const Z=e=>{t==null||t(e),E(!1)},z=T&&!p?T(l):N||!g?x:g.label,I={backgroundColor:"var(--bear-bg-primary)",borderColor:o?void 0:"var(--bear-border-default)",color:g&&!N?"var(--bear-text-primary)":"var(--bear-text-muted)"};return c?r.jsxs("div",{id:u,"data-testid":q,className:i.cn(s.S_E_L_E_C_T_ROOT_CLASS,"bear-relative bear-flex bear-flex-col bear-gap-1.5",L&&"bear-w-full"),children:[n&&r.jsx("label",{htmlFor:`${u}-native`,className:"bear-text-sm bear-font-medium",style:{color:"var(--bear-text-secondary)"},children:n}),r.jsxs("select",{id:`${u}-native`,disabled:d,required:h,value:l??"",onChange:e=>t==null?void 0:t(e.target.value),className:i.cn(`${s.S_E_L_E_C_T_ROOT_CLASS}__native`,"bear-w-full bear-rounded-lg bear-border bear-outline-none bear-transition-all bear-duration-200","focus:bear-ring-2 focus:bear-ring-offset-2 focus:bear-ring-offset-[var(--bear-bg-primary)]",o?"bear-border-red-500 focus:bear-ring-red-500":"focus:bear-border-bear-500 focus:bear-ring-bear-500",d&&"bear-opacity-50 bear-cursor-not-allowed",s.SELECT_SIZE_CLASSES[O],j),style:I,"aria-invalid":o||void 0,"aria-required":h||void 0,"aria-describedby":a==null?void 0:a.helperId,children:[(y||x)&&r.jsx("option",{value:"",disabled:!y,children:x}),v.map(e=>r.jsx("option",{value:e.value,disabled:e.disabled,children:e.label},e.value))]}),_&&r.jsx("p",{className:"bear-text-sm bear-text-red-500",children:_})]}):r.jsxs("div",{ref:m,id:u,"data-testid":q,className:i.cn(s.S_E_L_E_C_T_ROOT_CLASS,"bear-relative bear-flex bear-flex-col bear-gap-1.5",L&&"bear-w-full"),children:[n&&r.jsx("label",{className:"bear-text-sm bear-font-medium",style:{color:"var(--bear-text-secondary)"},children:n}),r.jsxs("button",{type:"button",disabled:d,onClick:()=>!d&&E(!b),className:i.cn(`${s.S_E_L_E_C_T_ROOT_CLASS}__trigger`,"bear-flex bear-items-center bear-justify-between bear-w-full","bear-rounded-lg bear-border bear-text-left bear-outline-none bear-transition-all bear-duration-200","focus:bear-ring-2 focus:bear-ring-offset-2 focus:bear-ring-offset-[var(--bear-bg-primary)]",o?"bear-border-red-500 focus:bear-ring-red-500":"focus:bear-border-bear-500 focus:bear-ring-bear-500 dark:focus:bear-border-bear-500 dark:focus:bear-ring-bear-500",d&&"bear-opacity-50 bear-cursor-not-allowed",s.SELECT_SIZE_CLASSES[O],j),style:I,"aria-haspopup":"listbox","aria-expanded":b,"aria-invalid":o||void 0,"aria-required":h||void 0,"aria-describedby":a==null?void 0:a.helperId,children:[r.jsx("span",{className:`${s.S_E_L_E_C_T_ROOT_CLASS}__value`,children:z}),r.jsx(R.ChevronDownIcon,{className:i.cn("bear-w-4 bear-h-4 bear-shrink-0 bear-transition-transform",b&&"bear-rotate-180"),style:{color:"var(--bear-text-muted)"}})]}),r.jsx(V.OverlayPortal,{open:b&&!c,ready:M,style:{...D,backgroundColor:"var(--bear-bg-primary)",borderColor:"var(--bear-border-default)"},zIndex:s.SELECT_MENU_Z_INDEX,openEffect:F,closeEffect:B,panelRef:w,className:`${s.S_E_L_E_C_T_ROOT_CLASS}__menu bear-rounded-lg bear-border bear-shadow-lg bear-overflow-hidden`,attributes:{role:"listbox"},children:r.jsx("div",{className:"bear-max-h-60 bear-overflow-y-auto",children:v.map(e=>r.jsxs("button",{type:"button",disabled:e.disabled,onClick:()=>!e.disabled&&Z(e.value),role:"option","aria-selected":e.value===l,className:i.cn(`${s.S_E_L_E_C_T_ROOT_CLASS}__option`,"bear-flex bear-items-center bear-justify-between bear-w-full bear-px-4 bear-py-2","bear-text-left bear-transition-colors",e.disabled&&"bear-cursor-not-allowed",e.value===l&&"bear-bg-bear-100 bear-text-bear-700 dark:bear-bg-bear-600/20 dark:bear-text-bear-300",!e.disabled&&e.value!==l&&"hover:bear-bg-[var(--bear-bg-tertiary)]"),style:e.disabled?{color:"var(--bear-text-muted)"}:e.value===l?void 0:{color:"var(--bear-text-secondary)"},children:[e.label,e.value===l&&r.jsx(R.CheckIcon,{className:"bear-w-4 bear-h-4 bear-shrink-0 bear-text-bear-600 dark:bear-text-bear-400"})]},e.value))})}),_&&r.jsx("p",{className:"bear-text-sm bear-text-red-500",children:_})]})};exports.Select=Q;
@@ -1,7 +1,7 @@
1
1
  import { jsxs as n, jsx as a } from "react/jsx-runtime";
2
2
  import { useState as X, useRef as $, useCallback as Z } from "react";
3
3
  import { SELECT_DEFAULT_PLACEHOLDER as H, SELECT_MENU_OFFSET_PX as G, SELECT_SIZE_CLASSES as q, S_E_L_E_C_T_ROOT_CLASS as t, SELECT_MENU_Z_INDEX as J } from "./Select.const.js";
4
- import { ChevronDownIcon as K, CheckIcon as Q } from "../Icon/index.js";
4
+ import { ChevronDownIcon as K, CheckIcon as Q } from "@forgedevstack/bear-icons";
5
5
  import { OverlayPortal as Y } from "../OverlayPortal/OverlayPortal.js";
6
6
  import { cn as d } from "../../utils/cn.js";
7
7
  import { resolveBearId as ee } from "../../utils/generateBearId.utils.js";
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),i=require("../../utils/cn.cjs");require("react");const t=require("../Icon/index.cjs"),D=require("./components/SidebarItem/SidebarItem.cjs"),a=require("./Sidebar.const.cjs"),p=S=>{const{items:b,collapsed:r=!1,onCollapsedChange:o,width:_=a.SIDEBAR_WIDTH,collapsedWidth:I=a.SIDEBAR_COLLAPSED_WIDTH,header:d,footer:c,showHeader:E=!0,activeItemId:h,onItemClick:u,activeVariant:f="fill",fullHeight:A=!1,variant:s="default",position:l="left",className:C,style:x,testId:B}=S,R=r?I:_,m=l==="left"?"bear-border-r":"bear-border-l",v=E&&d;return e.jsxs("aside",{"data-testid":B,className:i.cn("Bear-Sidebar",`Bear-Sidebar--${s}`,r&&"Bear-Sidebar--collapsed","bear-flex bear-flex-col bear-h-full bear-transition-all bear-duration-300",A&&"bear-min-h-full",s==="default"&&m,a.SIDEBAR_VARIANT_STYLES[s],C),style:{width:R,...x},children:[v&&e.jsxs("div",{className:i.cn("Bear-Sidebar__header",a.SIDEBAR_HEADER_CLASSES),children:[!r&&d,o&&e.jsx("button",{type:"button",onClick:()=>o(!r),className:i.cn("Bear-Sidebar__toggle",a.SIDEBAR_TOGGLE_CLASSES),"aria-label":r?"Expand sidebar":"Collapse sidebar",children:r?l==="left"?e.jsx(t.ChevronRightIcon,{size:a.SIDEBAR_TOGGLE_ICON_SIZE}):e.jsx(t.ChevronLeftIcon,{size:a.SIDEBAR_TOGGLE_ICON_SIZE}):l==="left"?e.jsx(t.ChevronLeftIcon,{size:a.SIDEBAR_TOGGLE_ICON_SIZE}):e.jsx(t.ChevronRightIcon,{size:a.SIDEBAR_TOGGLE_ICON_SIZE})})]}),e.jsx("nav",{className:"Bear-Sidebar__nav bear-flex-1 bear-overflow-y-auto bear-px-2 bear-py-3 bear-space-y-1 bear-min-h-0",children:b.map(n=>e.jsx(D.SidebarItem,{item:n,isActive:n.id===h,collapsed:r,onClick:u,activeVariant:f},n.id))}),c&&e.jsx("div",{className:i.cn("Bear-Sidebar__footer",a.SIDEBAR_FOOTER_CLASSES),children:r?null:c})]})};exports.Sidebar=p;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),i=require("../../utils/cn.cjs");require("react");const s=require("@forgedevstack/bear-icons"),D=require("./components/SidebarItem/SidebarItem.cjs"),a=require("./Sidebar.const.cjs"),p=b=>{const{items:I,collapsed:r=!1,onCollapsedChange:o,width:_=a.SIDEBAR_WIDTH,collapsedWidth:E=a.SIDEBAR_COLLAPSED_WIDTH,header:d,footer:c,showHeader:h=!0,activeItemId:S,onItemClick:u,activeVariant:f="fill",fullHeight:A=!1,variant:t="default",position:l="left",className:C,style:B,testId:x}=b,R=r?E:_,m=l==="left"?"bear-border-r":"bear-border-l",v=h&&d;return e.jsxs("aside",{"data-testid":x,className:i.cn("Bear-Sidebar",`Bear-Sidebar--${t}`,r&&"Bear-Sidebar--collapsed","bear-flex bear-flex-col bear-h-full bear-transition-all bear-duration-300",A&&"bear-min-h-full",t==="default"&&m,a.SIDEBAR_VARIANT_STYLES[t],C),style:{width:R,...B},children:[v&&e.jsxs("div",{className:i.cn("Bear-Sidebar__header",a.SIDEBAR_HEADER_CLASSES),children:[!r&&d,o&&e.jsx("button",{type:"button",onClick:()=>o(!r),className:i.cn("Bear-Sidebar__toggle",a.SIDEBAR_TOGGLE_CLASSES),"aria-label":r?"Expand sidebar":"Collapse sidebar",children:r?l==="left"?e.jsx(s.ChevronRightIcon,{size:a.SIDEBAR_TOGGLE_ICON_SIZE}):e.jsx(s.ChevronLeftIcon,{size:a.SIDEBAR_TOGGLE_ICON_SIZE}):l==="left"?e.jsx(s.ChevronLeftIcon,{size:a.SIDEBAR_TOGGLE_ICON_SIZE}):e.jsx(s.ChevronRightIcon,{size:a.SIDEBAR_TOGGLE_ICON_SIZE})})]}),e.jsx("nav",{className:"Bear-Sidebar__nav bear-flex-1 bear-overflow-y-auto bear-px-2 bear-py-3 bear-space-y-1 bear-min-h-0",children:I.map(n=>e.jsx(D.SidebarItem,{item:n,isActive:n.id===S,collapsed:r,onClick:u,activeVariant:f,activeItemId:S},n.id))}),c&&e.jsx("div",{className:i.cn("Bear-Sidebar__footer",a.SIDEBAR_FOOTER_CLASSES),children:r?null:c})]})};exports.Sidebar=p;
@@ -1,20 +1,20 @@
1
- import { jsxs as b, jsx as a } from "react/jsx-runtime";
1
+ import { jsxs as c, jsx as a } from "react/jsx-runtime";
2
2
  import { cn as r } from "../../utils/cn.js";
3
3
  import "react";
4
- import { ChevronRightIcon as c, ChevronLeftIcon as S } from "../Icon/index.js";
4
+ import { ChevronRightIcon as S, ChevronLeftIcon as f } from "@forgedevstack/bear-icons";
5
5
  import { SidebarItem as x } from "./components/SidebarItem/SidebarItem.js";
6
6
  import { SIDEBAR_WIDTH as N, SIDEBAR_COLLAPSED_WIDTH as T, SIDEBAR_TOGGLE_ICON_SIZE as i, SIDEBAR_TOGGLE_CLASSES as y, SIDEBAR_HEADER_CLASSES as H, SIDEBAR_FOOTER_CLASSES as O, SIDEBAR_VARIANT_STYLES as g } from "./Sidebar.const.js";
7
- const V = (f) => {
7
+ const V = (m) => {
8
8
  const {
9
- items: m,
9
+ items: _,
10
10
  collapsed: e = !1,
11
11
  onCollapsedChange: d,
12
- width: _ = N,
13
- collapsedWidth: h = T,
12
+ width: h = N,
13
+ collapsedWidth: p = T,
14
14
  header: s,
15
15
  footer: n,
16
- showHeader: p = !0,
17
- activeItemId: E,
16
+ showHeader: E = !0,
17
+ activeItemId: b,
18
18
  onItemClick: I,
19
19
  activeVariant: A = "fill",
20
20
  fullHeight: B = !1,
@@ -23,8 +23,8 @@ const V = (f) => {
23
23
  className: u,
24
24
  style: C,
25
25
  testId: v
26
- } = f, D = e ? h : _, R = t === "left" ? "bear-border-r" : "bear-border-l", L = p && s;
27
- return /* @__PURE__ */ b(
26
+ } = m, D = e ? p : h, R = t === "left" ? "bear-border-r" : "bear-border-l", L = E && s;
27
+ return /* @__PURE__ */ c(
28
28
  "aside",
29
29
  {
30
30
  "data-testid": v,
@@ -40,7 +40,7 @@ const V = (f) => {
40
40
  ),
41
41
  style: { width: D, ...C },
42
42
  children: [
43
- L && /* @__PURE__ */ b("div", { className: r("Bear-Sidebar__header", H), children: [
43
+ L && /* @__PURE__ */ c("div", { className: r("Bear-Sidebar__header", H), children: [
44
44
  !e && s,
45
45
  d && /* @__PURE__ */ a(
46
46
  "button",
@@ -49,18 +49,19 @@ const V = (f) => {
49
49
  onClick: () => d(!e),
50
50
  className: r("Bear-Sidebar__toggle", y),
51
51
  "aria-label": e ? "Expand sidebar" : "Collapse sidebar",
52
- children: e ? t === "left" ? /* @__PURE__ */ a(c, { size: i }) : /* @__PURE__ */ a(S, { size: i }) : t === "left" ? /* @__PURE__ */ a(S, { size: i }) : /* @__PURE__ */ a(c, { size: i })
52
+ children: e ? t === "left" ? /* @__PURE__ */ a(S, { size: i }) : /* @__PURE__ */ a(f, { size: i }) : t === "left" ? /* @__PURE__ */ a(f, { size: i }) : /* @__PURE__ */ a(S, { size: i })
53
53
  }
54
54
  )
55
55
  ] }),
56
- /* @__PURE__ */ a("nav", { className: "Bear-Sidebar__nav bear-flex-1 bear-overflow-y-auto bear-px-2 bear-py-3 bear-space-y-1 bear-min-h-0", children: m.map((o) => /* @__PURE__ */ a(
56
+ /* @__PURE__ */ a("nav", { className: "Bear-Sidebar__nav bear-flex-1 bear-overflow-y-auto bear-px-2 bear-py-3 bear-space-y-1 bear-min-h-0", children: _.map((o) => /* @__PURE__ */ a(
57
57
  x,
58
58
  {
59
59
  item: o,
60
- isActive: o.id === E,
60
+ isActive: o.id === b,
61
61
  collapsed: e,
62
62
  onClick: I,
63
- activeVariant: A
63
+ activeVariant: A,
64
+ activeItemId: b
64
65
  },
65
66
  o.id
66
67
  )) }),
@@ -48,6 +48,6 @@ export interface SidebarItemComponentProps {
48
48
  collapsed?: boolean;
49
49
  depth?: number;
50
50
  onClick?: (item: SidebarItem) => void;
51
- /** How active state is shown. Passed from Sidebar activeVariant. */
52
51
  activeVariant?: SidebarActiveVariant;
52
+ activeItemId?: string;
53
53
  }
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=(n,e)=>{if(!e)return!1;if(n.id===e)return!0;const r=n.children;return!r||r.length===0?!1:r.some(s=>t(s,e))};exports.sidebarItemContainsId=t;
@@ -0,0 +1,2 @@
1
+ import { SidebarItem } from './Sidebar.types';
2
+ export declare const sidebarItemContainsId: (item: SidebarItem, activeItemId?: string) => boolean;
@@ -0,0 +1,11 @@
1
+ const t = (e, r) => {
2
+ if (!r)
3
+ return !1;
4
+ if (e.id === r)
5
+ return !0;
6
+ const n = e.children;
7
+ return !n || n.length === 0 ? !1 : n.some((s) => t(s, r));
8
+ };
9
+ export {
10
+ t as sidebarItemContainsId
11
+ };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),b=require("react"),t=require("../../../../utils/cn.cjs"),d=require("../../../Icon/index.cjs"),o=require("../../Sidebar.const.cjs"),S=n=>{const{title:a,children:c,collapsible:r=!1,defaultCollapsed:i=!1,className:l}=n,[s,u]=b.useState(i);return e.jsxs("div",{className:t.cn("Bear-Sidebar__group bear-mb-4",l),children:[a&&e.jsxs("button",{type:"button",onClick:()=>r&&u(!s),className:t.cn("Bear-Sidebar__group-title",o.SIDEBAR_GROUP_TITLE_CLASSES,r&&"bear-cursor-pointer hover:bear-text-zinc-600 dark:hover:bear-text-zinc-300"),children:[r&&e.jsx(d.ChevronDownIcon,{size:o.SIDEBAR_ICON_SIZE-2,className:t.cn("bear-transition-transform",s&&"-bear-rotate-90")}),a]}),!s&&e.jsx("div",{className:"Bear-Sidebar__group-content bear-space-y-1",children:c})]})};exports.SidebarGroup=S;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),u=require("react"),a=require("../../../../utils/cn.cjs"),d=require("@forgedevstack/bear-icons"),o=require("../../Sidebar.const.cjs"),S=n=>{const{title:t,children:c,collapsible:r=!1,defaultCollapsed:i=!1,className:l}=n,[s,b]=u.useState(i);return e.jsxs("div",{className:a.cn("Bear-Sidebar__group bear-mb-4",l),children:[t&&e.jsxs("button",{type:"button",onClick:()=>r&&b(!s),className:a.cn("Bear-Sidebar__group-title",o.SIDEBAR_GROUP_TITLE_CLASSES,r&&"bear-cursor-pointer hover:bear-text-zinc-600 dark:hover:bear-text-zinc-300"),children:[r&&e.jsx(d.ChevronDownIcon,{size:o.SIDEBAR_ICON_SIZE-2,className:a.cn("bear-transition-transform",s&&"-bear-rotate-90")}),t]}),!s&&e.jsx("div",{className:"Bear-Sidebar__group-content bear-space-y-1",children:c})]})};exports.SidebarGroup=S;
@@ -1,7 +1,7 @@
1
1
  import { jsxs as t, jsx as s } from "react/jsx-runtime";
2
2
  import { useState as p } from "react";
3
3
  import { cn as a } from "../../../../utils/cn.js";
4
- import { ChevronDownIcon as b } from "../../../Icon/index.js";
4
+ import { ChevronDownIcon as b } from "@forgedevstack/bear-icons";
5
5
  import { SIDEBAR_ICON_SIZE as d, SIDEBAR_GROUP_TITLE_CLASSES as S } from "../../Sidebar.const.js";
6
6
  const h = (i) => {
7
7
  const {
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),d=require("react"),b=require("../../../../utils/cn.cjs"),f=require("../../../Icon/index.cjs"),r=require("../../Sidebar.const.cjs"),_=o=>{const{item:e,isActive:S,collapsed:i,depth:c=0,onClick:s,activeVariant:m="fill"}=o,[l,I]=d.useState(!1),t=e.children&&e.children.length>0,E=i?r.SIDEBAR_PADDING_BASE:r.SIDEBAR_PADDING_BASE+c*r.SIDEBAR_DEPTH_INDENT,h=d.useCallback(()=>{t&&I(n=>!n),e.onClick&&e.onClick(),s==null||s(e)},[t,e,s]),A=a.jsxs(a.Fragment,{children:[e.icon&&a.jsx("span",{className:"Bear-Sidebar__item-icon bear-shrink-0 bear-w-5 bear-h-5 bear-flex bear-items-center bear-justify-center",children:e.icon}),!i&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"Bear-Sidebar__item-label bear-flex-1 bear-truncate",children:e.label}),e.badge&&a.jsx("span",{className:"Bear-Sidebar__item-badge bear-ml-auto",children:e.badge}),t&&a.jsx(f.ChevronDownIcon,{size:r.SIDEBAR_ICON_SIZE,className:b.cn("Bear-Sidebar__item-chevron bear-ml-1 bear-transition-transform bear-duration-200",l&&"bear-rotate-180")})]})]}),B=r.SIDEBAR_ITEM_ACTIVE_BY_VARIANT[m],u=b.cn("Bear-Sidebar__item",r.SIDEBAR_ITEM_BASE_CLASSES,S?`Bear-Sidebar__item--active ${B}`:r.SIDEBAR_ITEM_INACTIVE_CLASSES,e.disabled&&`Bear-Sidebar__item--disabled ${r.SIDEBAR_ITEM_DISABLED_CLASSES}`,i&&"Bear-Sidebar__item--collapsed bear-justify-center"),D=e.href?"a":"button";return a.jsxs("div",{className:"Bear-Sidebar__item-wrapper",children:[a.jsx(D,{href:e.href,onClick:h,disabled:e.disabled,className:u,style:{paddingLeft:E},title:i?e.label:void 0,children:A}),t&&l&&!i&&a.jsx("div",{className:"Bear-Sidebar__children bear-mt-1",children:e.children.map(n=>a.jsx(_,{item:n,isActive:!1,collapsed:i,depth:c+1,onClick:s},n.id))})]})};exports.SidebarItem=_;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),f=require("react"),o=require("../../../../utils/cn.cjs"),p=require("@forgedevstack/bear-icons"),r=require("../../Sidebar.const.cjs"),C=require("../../Sidebar.utils.cjs"),S=m=>{const{item:e,isActive:I,collapsed:i,depth:d=0,onClick:t,activeVariant:l="fill",activeItemId:n}=m,b=e.children??[],c=b.length>0,[_,E]=f.useState(()=>C.sidebarItemContainsId(e,n)),B=i?r.SIDEBAR_PADDING_BASE:r.SIDEBAR_PADDING_BASE+d*r.SIDEBAR_DEPTH_INDENT,h=()=>{c&&E(s=>!s),e.onClick&&e.onClick(),t==null||t(e)},A=c&&_&&!i,u=r.SIDEBAR_ITEM_ACTIVE_BY_VARIANT[l],D=o.cn("Bear-Sidebar__item",r.SIDEBAR_ITEM_BASE_CLASSES,I?`Bear-Sidebar__item--active ${u}`:r.SIDEBAR_ITEM_INACTIVE_CLASSES,e.disabled&&`Bear-Sidebar__item--disabled ${r.SIDEBAR_ITEM_DISABLED_CLASSES}`,i&&"Bear-Sidebar__item--collapsed bear-justify-center"),N=e.href?"a":"button";return a.jsxs("div",{className:"Bear-Sidebar__item-wrapper",children:[a.jsxs(N,{href:e.href,onClick:h,disabled:e.disabled,className:D,style:{paddingLeft:B},title:i?e.label:void 0,children:[e.icon&&a.jsx("span",{className:"Bear-Sidebar__item-icon bear-shrink-0 bear-w-5 bear-h-5 bear-flex bear-items-center bear-justify-center",children:e.icon}),!i&&a.jsxs("span",{className:"Bear-Sidebar__item-row bear-flex bear-items-center bear-flex-1 bear-min-w-0",children:[a.jsx("span",{className:"Bear-Sidebar__item-label bear-flex-1 bear-truncate",children:e.label}),e.badge&&a.jsx("span",{className:"Bear-Sidebar__item-badge bear-ml-auto",children:e.badge}),c&&a.jsx(p.ChevronDownIcon,{size:r.SIDEBAR_ICON_SIZE,className:o.cn("Bear-Sidebar__item-chevron bear-ml-1 bear-transition-transform bear-duration-200",_&&"bear-rotate-180")})]})]}),A&&a.jsx("div",{className:"Bear-Sidebar__children bear-mt-1",children:b.map(s=>a.jsx(S,{item:s,isActive:s.id===n,collapsed:i,depth:d+1,onClick:t,activeVariant:l,activeItemId:n},s.id))})]})};exports.SidebarItem=S;
@@ -1,67 +1,71 @@
1
- import { jsxs as n, Fragment as d, jsx as a } from "react/jsx-runtime";
2
- import { useState as C, useCallback as D } from "react";
3
- import { cn as o } from "../../../../utils/cn.js";
4
- import { ChevronDownIcon as N } from "../../../Icon/index.js";
5
- import { SIDEBAR_ICON_SIZE as v, SIDEBAR_ITEM_DISABLED_CLASSES as u, SIDEBAR_ITEM_ACTIVE_BY_VARIANT as T, SIDEBAR_ITEM_INACTIVE_CLASSES as R, SIDEBAR_ITEM_BASE_CLASSES as g, SIDEBAR_PADDING_BASE as m, SIDEBAR_DEPTH_INDENT as k } from "../../Sidebar.const.js";
6
- const x = (_) => {
1
+ import { jsxs as l, jsx as r } from "react/jsx-runtime";
2
+ import { useState as N } from "react";
3
+ import { cn as b } from "../../../../utils/cn.js";
4
+ import { ChevronDownIcon as D } from "@forgedevstack/bear-icons";
5
+ import { SIDEBAR_ITEM_DISABLED_CLASSES as v, SIDEBAR_ITEM_ACTIVE_BY_VARIANT as T, SIDEBAR_ITEM_INACTIVE_CLASSES as u, SIDEBAR_ITEM_BASE_CLASSES as R, SIDEBAR_PADDING_BASE as _, SIDEBAR_ICON_SIZE as x, SIDEBAR_DEPTH_INDENT as w } from "../../Sidebar.const.js";
6
+ import { sidebarItemContainsId as g } from "../../Sidebar.utils.js";
7
+ const L = (S) => {
7
8
  const {
8
9
  item: e,
9
- isActive: b,
10
- collapsed: r,
11
- depth: l = 0,
12
- onClick: i,
13
- activeVariant: S = "fill"
14
- } = _, [c, h] = C(!1), t = e.children && e.children.length > 0, E = r ? m : m + l * k, I = D(() => {
15
- t && h((s) => !s), e.onClick && e.onClick(), i == null || i(e);
16
- }, [t, e, i]), B = /* @__PURE__ */ n(d, { children: [
17
- e.icon && /* @__PURE__ */ a("span", { className: "Bear-Sidebar__item-icon bear-shrink-0 bear-w-5 bear-h-5 bear-flex bear-items-center bear-justify-center", children: e.icon }),
18
- !r && /* @__PURE__ */ n(d, { children: [
19
- /* @__PURE__ */ a("span", { className: "Bear-Sidebar__item-label bear-flex-1 bear-truncate", children: e.label }),
20
- e.badge && /* @__PURE__ */ a("span", { className: "Bear-Sidebar__item-badge bear-ml-auto", children: e.badge }),
21
- t && /* @__PURE__ */ a(
22
- N,
23
- {
24
- size: v,
25
- className: o(
26
- "Bear-Sidebar__item-chevron bear-ml-1 bear-transition-transform bear-duration-200",
27
- c && "bear-rotate-180"
28
- )
29
- }
30
- )
31
- ] })
32
- ] }), A = T[S], f = o(
10
+ isActive: I,
11
+ collapsed: a,
12
+ depth: c = 0,
13
+ onClick: t,
14
+ activeVariant: d = "fill",
15
+ activeItemId: s
16
+ } = S, m = e.children ?? [], n = m.length > 0, [o, h] = N(() => g(e, s)), E = a ? _ : _ + c * w, B = () => {
17
+ n && h((i) => !i), e.onClick && e.onClick(), t == null || t(e);
18
+ }, p = n && o && !a, f = T[d], A = b(
33
19
  "Bear-Sidebar__item",
34
- g,
35
- b ? `Bear-Sidebar__item--active ${A}` : R,
36
- e.disabled && `Bear-Sidebar__item--disabled ${u}`,
37
- r && "Bear-Sidebar__item--collapsed bear-justify-center"
38
- ), p = e.href ? "a" : "button";
39
- return /* @__PURE__ */ n("div", { className: "Bear-Sidebar__item-wrapper", children: [
40
- /* @__PURE__ */ a(
41
- p,
20
+ R,
21
+ I ? `Bear-Sidebar__item--active ${f}` : u,
22
+ e.disabled && `Bear-Sidebar__item--disabled ${v}`,
23
+ a && "Bear-Sidebar__item--collapsed bear-justify-center"
24
+ ), C = e.href ? "a" : "button";
25
+ return /* @__PURE__ */ l("div", { className: "Bear-Sidebar__item-wrapper", children: [
26
+ /* @__PURE__ */ l(
27
+ C,
42
28
  {
43
29
  href: e.href,
44
- onClick: I,
30
+ onClick: B,
45
31
  disabled: e.disabled,
46
- className: f,
32
+ className: A,
47
33
  style: { paddingLeft: E },
48
- title: r ? e.label : void 0,
49
- children: B
34
+ title: a ? e.label : void 0,
35
+ children: [
36
+ e.icon && /* @__PURE__ */ r("span", { className: "Bear-Sidebar__item-icon bear-shrink-0 bear-w-5 bear-h-5 bear-flex bear-items-center bear-justify-center", children: e.icon }),
37
+ !a && /* @__PURE__ */ l("span", { className: "Bear-Sidebar__item-row bear-flex bear-items-center bear-flex-1 bear-min-w-0", children: [
38
+ /* @__PURE__ */ r("span", { className: "Bear-Sidebar__item-label bear-flex-1 bear-truncate", children: e.label }),
39
+ e.badge && /* @__PURE__ */ r("span", { className: "Bear-Sidebar__item-badge bear-ml-auto", children: e.badge }),
40
+ n && /* @__PURE__ */ r(
41
+ D,
42
+ {
43
+ size: x,
44
+ className: b(
45
+ "Bear-Sidebar__item-chevron bear-ml-1 bear-transition-transform bear-duration-200",
46
+ o && "bear-rotate-180"
47
+ )
48
+ }
49
+ )
50
+ ] })
51
+ ]
50
52
  }
51
53
  ),
52
- t && c && !r && /* @__PURE__ */ a("div", { className: "Bear-Sidebar__children bear-mt-1", children: e.children.map((s) => /* @__PURE__ */ a(
53
- x,
54
+ p && /* @__PURE__ */ r("div", { className: "Bear-Sidebar__children bear-mt-1", children: m.map((i) => /* @__PURE__ */ r(
55
+ L,
54
56
  {
55
- item: s,
56
- isActive: !1,
57
- collapsed: r,
58
- depth: l + 1,
59
- onClick: i
57
+ item: i,
58
+ isActive: i.id === s,
59
+ collapsed: a,
60
+ depth: c + 1,
61
+ onClick: t,
62
+ activeVariant: d,
63
+ activeItemId: s
60
64
  },
61
- s.id
65
+ i.id
62
66
  )) })
63
67
  ] });
64
68
  };
65
69
  export {
66
- x as SidebarItem
70
+ L as SidebarItem
67
71
  };
@@ -1,5 +1,6 @@
1
1
  export { Sidebar, default } from './Sidebar';
2
2
  export { SidebarGroup } from './components/SidebarGroup';
3
3
  export { SidebarItem } from './components/SidebarItem';
4
+ export { sidebarItemContainsId } from './Sidebar.utils';
4
5
  export * from './Sidebar.types';
5
6
  export * from './Sidebar.const';