@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,57 +1,8 @@
1
- const e = 300, a = 11e3, r = 1, b = "Bear-Drawer bear-fixed bear-inset-0", l = {
2
- left: {
3
- sm: "bear-w-full sm:bear-w-64 bear-max-w-full sm:bear-max-w-none",
4
- md: "bear-w-full sm:bear-w-80 bear-max-w-full sm:bear-max-w-none",
5
- lg: "bear-w-full sm:bear-w-96 bear-max-w-full sm:bear-max-w-none",
6
- xl: "bear-w-full sm:bear-w-[32rem] bear-max-w-full sm:bear-max-w-none"
7
- },
8
- right: {
9
- sm: "bear-w-full sm:bear-w-64 bear-max-w-full sm:bear-max-w-none",
10
- md: "bear-w-full sm:bear-w-80 bear-max-w-full sm:bear-max-w-none",
11
- lg: "bear-w-full sm:bear-w-96 bear-max-w-full sm:bear-max-w-none",
12
- xl: "bear-w-full sm:bear-w-[32rem] bear-max-w-full sm:bear-max-w-none"
13
- },
14
- top: {
15
- sm: "bear-h-32",
16
- md: "bear-h-48",
17
- lg: "bear-h-64",
18
- xl: "bear-h-96"
19
- },
20
- bottom: {
21
- sm: "bear-h-32",
22
- md: "bear-h-48",
23
- lg: "bear-h-64",
24
- xl: "bear-h-96"
25
- }
26
- }, t = {
27
- left: "bear-left-0 bear-top-0 bear-h-full",
28
- right: "bear-right-0 bear-top-0 bear-h-full",
29
- top: "bear-top-0 bear-left-0 bear-w-full",
30
- bottom: "bear-bottom-0 bear-left-0 bear-w-full"
31
- }, m = {
32
- left: "bear-translate-x-0",
33
- right: "bear-translate-x-0",
34
- top: "bear-translate-y-0",
35
- bottom: "bear-translate-y-0"
36
- }, o = {
37
- left: "-bear-translate-x-full",
38
- right: "bear-translate-x-full",
39
- top: "-bear-translate-y-full",
40
- bottom: "bear-translate-y-full"
41
- }, s = {
42
- left: "bear-border-r",
43
- right: "bear-border-l",
44
- top: "bear-border-b",
45
- bottom: "bear-border-t"
46
- };
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;
47
4
  export {
48
- s as BORDER_SIDE_MAP,
49
- e as DRAWER_ANIMATION_MS,
50
- r as DRAWER_PANEL_Z_INDEX,
51
- b as DRAWER_ROOT_CLASSES,
52
- a as DRAWER_Z_INDEX,
53
- t as POSITION_CLASSES,
54
- l as SIZE_CLASSES,
55
- o as TRANSFORM_CLOSED,
56
- m as TRANSFORM_OPEN
5
+ I as DRAWER_ANIMATION_MS,
6
+ A as DRAWER_DEFAULT_SIDE,
7
+ t as DRAWER_DEFAULT_SIZE
57
8
  };
@@ -1,3 +1,2 @@
1
- import { FC } from 'react';
2
1
  import { DrawerProps } from './Drawer.types';
3
- export declare const Drawer: FC<DrawerProps>;
2
+ export declare const Drawer: (props: DrawerProps) => import('react').ReactPortal | null;
@@ -1,135 +1,91 @@
1
- import { jsxs as c, jsx as t } from "react/jsx-runtime";
2
- import { useState as u, useEffect as S, useCallback as M } from "react";
3
- import { createPortal as B } from "react-dom";
4
- import { useBearDirectionOptional as C } from "../../context/BearProvider.js";
5
- import { cn as T } from "../../utils/cn.js";
6
- import { resolveBearId as P } from "../../utils/generateBearId.utils.js";
7
- import { useBearId as F } from "../../utils/useBearId.js";
8
- import { XIcon as W } from "../Icon/index.js";
9
- import { Backdrop as j } from "../Backdrop/Backdrop.js";
10
- import { DRAWER_ANIMATION_MS as m, DRAWER_Z_INDEX as X, DRAWER_ROOT_CLASSES as Z, DRAWER_PANEL_Z_INDEX as $, TRANSFORM_OPEN as z, TRANSFORM_CLOSED as q, SIZE_CLASSES as H, POSITION_CLASSES as G, BORDER_SIDE_MAP as J } from "./Drawer.const.js";
11
- import { lockBodyScroll as K } from "./Drawer.utils.js";
12
- const se = ({
13
- isOpen: s,
14
- onClose: o,
15
- title: n,
16
- children: _,
17
- side: w = "right",
18
- anchor: I,
19
- variant: Q = "temporary",
20
- size: N = "md",
21
- showCloseButton: f = !0,
22
- closeOnBackdrop: D = !0,
23
- closeOnEscape: p = !0,
24
- className: A,
25
- container: R,
26
- id: g,
27
- testId: y
28
- }) => {
29
- const O = F("Drawer"), d = P(g, O), { direction: h } = C(), i = I ?? w, r = h === "rtl" && (i === "left" || i === "right") ? i === "left" ? "right" : "left" : i, [a, v] = u(s), [k, b] = u(!1), [x, E] = u(!1);
30
- S(() => {
31
- if (s) {
32
- v(!0), b(!1);
33
- const e = requestAnimationFrame(() => E(!0));
34
- return () => cancelAnimationFrame(e);
35
- }
36
- if (a) {
37
- E(!1), b(!0);
38
- const e = setTimeout(() => {
39
- v(!1), b(!1);
40
- }, m);
41
- return () => clearTimeout(e);
42
- }
43
- }, [s, a]);
44
- const l = M(
45
- (e) => {
46
- p && e.key === "Escape" && o();
47
- },
48
- [p, o]
49
- );
50
- if (S(() => {
51
- if (a) {
52
- document.addEventListener("keydown", l);
53
- const e = K();
54
- return () => {
55
- document.removeEventListener("keydown", l), e();
56
- };
57
- }
58
- return () => {
59
- document.removeEventListener("keydown", l);
60
- };
61
- }, [a, l]), !a) return null;
62
- const L = /* @__PURE__ */ c(
63
- "div",
64
- {
65
- id: d,
66
- "data-testid": y,
67
- className: Z,
68
- style: { zIndex: X },
69
- children: [
70
- /* @__PURE__ */ t(
71
- j,
72
- {
73
- open: x && !k,
74
- keepMounted: !0,
75
- blur: !0,
76
- nested: !0,
77
- transitionDuration: m,
78
- className: "Bear-Drawer__backdrop",
79
- onClick: D ? () => o() : void 0
80
- }
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";
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) => {
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;
40
+ if (!b)
41
+ 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
81
68
  ),
82
- /* @__PURE__ */ c(
83
- "div",
84
- {
85
- role: "dialog",
86
- "aria-modal": "true",
87
- "aria-labelledby": n ? `${d}-title` : void 0,
88
- className: T(
89
- "Bear-Drawer__panel",
90
- "bear-absolute bear-bg-white dark:bear-bg-neutral-900 bear-shadow-2xl",
91
- "bear-border-neutral-200 dark:bear-border-neutral-700",
92
- "bear-flex bear-flex-col bear-overflow-hidden",
93
- "bear-transform bear-transition-transform",
94
- J[r],
95
- G[r],
96
- H[r][N],
97
- x && !k ? z[r] : q[r],
98
- A
99
- ),
100
- style: {
101
- transitionDuration: `${m}ms`,
102
- zIndex: $
103
- },
104
- children: [
105
- (n || f) && /* @__PURE__ */ c("div", { className: "bear-flex bear-items-center bear-justify-between bear-px-4 bear-py-3 bear-border-b bear-border-neutral-200 dark:bear-border-neutral-700 bear-shrink-0", dir: h, children: [
106
- n && /* @__PURE__ */ t(
107
- "h2",
108
- {
109
- id: `${d}-title`,
110
- className: "bear-text-lg bear-font-semibold bear-text-neutral-900 dark:bear-text-white",
111
- children: n
112
- }
113
- ),
114
- f && /* @__PURE__ */ t(
115
- "button",
116
- {
117
- onClick: o,
118
- className: "bear-p-1 bear-rounded-lg bear-text-neutral-500 dark:bear-text-neutral-400 hover:bear-text-neutral-900 dark:hover:bear-text-white hover:bear-bg-neutral-100 dark:hover:bear-bg-neutral-700 bear-transition-colors",
119
- "aria-label": "Close drawer",
120
- children: /* @__PURE__ */ t(W, { className: "bear-w-5 bear-h-5" })
121
- }
122
- )
123
- ] }),
124
- /* @__PURE__ */ t("div", { className: "bear-flex-1 bear-min-h-0 bear-overflow-y-auto bear-overscroll-contain bear-p-4 bear-text-neutral-700 dark:bear-text-neutral-300", children: _ })
125
- ]
126
- }
127
- )
128
- ]
129
- }
130
- );
131
- return B(L, R ?? document.body);
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);
132
88
  };
133
89
  export {
134
- se as Drawer
90
+ ce as Drawer
135
91
  };
@@ -1,11 +1,24 @@
1
1
  import { ReactNode } from 'react';
2
- export interface DrawerProps {
2
+ import { OverlayEffectProps, OverlayMotionEffect } from '../../hooks/useFixedAnchorPosition';
3
+ export type DrawerSide = 'left' | 'right' | 'top' | 'bottom';
4
+ export interface UseDrawerParams {
5
+ isOpen: boolean;
6
+ onClose: () => void;
7
+ closeOnEscape: boolean;
8
+ openEffect: OverlayMotionEffect;
9
+ closeEffect: OverlayMotionEffect;
10
+ }
11
+ export interface UseDrawerResult {
12
+ isMounted: boolean;
13
+ isPanelOpen: boolean;
14
+ }
15
+ export interface DrawerProps extends OverlayEffectProps {
3
16
  isOpen: boolean;
4
17
  onClose: () => void;
5
18
  title?: string;
6
19
  children: ReactNode;
7
- side?: 'left' | 'right' | 'top' | 'bottom';
8
- anchor?: 'left' | 'right' | 'top' | 'bottom';
20
+ side?: DrawerSide;
21
+ anchor?: DrawerSide;
9
22
  variant?: 'temporary' | 'persistent' | 'permanent';
10
23
  size?: 'sm' | 'md' | 'lg' | 'xl';
11
24
  showCloseButton?: boolean;
@@ -1,5 +1 @@
1
- /**
2
- * Locks page scroll and returns a restore function.
3
- * Uses position:fixed to prevent iOS Safari body-scroll leaking.
4
- */
5
1
  export declare function lockBodyScroll(): () => void;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),l=require("../../../Flex/Flex.cjs"),d=require("../../../../constants/generals.const.cjs"),u=require("../../../../utils/cn.cjs");require("react");const w=require("./DrawerHeaderClose.cjs"),D=require("./DrawerHeaderTitle.cjs"),q=r=>{const{side:t,title:s,titleId:a,showCloseButton:n,onClose:o,direction:i}=r,c=t===d.POSITION_RIGHT;return e.jsxs(l.Flex,{className:u.cn("Bear-Drawer__header",c&&"Bear-Drawer__header--close-start"),align:"center",justify:"between",dir:i,children:[e.jsx(D.DrawerHeaderTitle,{title:s,titleId:a}),e.jsx(w.DrawerHeaderClose,{showCloseButton:n,onClose:o})]})};exports.DrawerHeader=q;
@@ -0,0 +1,2 @@
1
+ import { DrawerHeaderProps } from './DrawerHeader.types';
2
+ export declare const DrawerHeader: (props: DrawerHeaderProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,26 @@
1
+ import { jsxs as n, jsx as e } from "react/jsx-runtime";
2
+ import { Flex as l } from "../../../Flex/Flex.js";
3
+ import { POSITION_RIGHT as d } from "../../../../constants/generals.const.js";
4
+ import { cn as c } from "../../../../utils/cn.js";
5
+ import "react";
6
+ import { DrawerHeaderClose as p } from "./DrawerHeaderClose.js";
7
+ import { DrawerHeaderTitle as f } from "./DrawerHeaderTitle.js";
8
+ const j = (r) => {
9
+ const { side: o, title: t, titleId: i, showCloseButton: a, onClose: s, direction: m } = r;
10
+ return /* @__PURE__ */ n(
11
+ l,
12
+ {
13
+ className: c("Bear-Drawer__header", o === d && "Bear-Drawer__header--close-start"),
14
+ align: "center",
15
+ justify: "between",
16
+ dir: m,
17
+ children: [
18
+ /* @__PURE__ */ e(f, { title: t, titleId: i }),
19
+ /* @__PURE__ */ e(p, { showCloseButton: a, onClose: s })
20
+ ]
21
+ }
22
+ );
23
+ };
24
+ export {
25
+ j as DrawerHeader
26
+ };
@@ -0,0 +1,20 @@
1
+ import { DrawerSide } from '../../Drawer.types';
2
+ export interface DrawerHeaderTitleProps {
3
+ title?: string;
4
+ titleId: string;
5
+ }
6
+ export interface DrawerHeaderCloseProps {
7
+ showCloseButton: boolean;
8
+ onClose: () => void;
9
+ }
10
+ export interface DrawerHeaderProps {
11
+ side: DrawerSide;
12
+ title?: string;
13
+ titleId: string;
14
+ showCloseButton: boolean;
15
+ onClose: () => void;
16
+ direction?: string;
17
+ }
18
+ export interface DrawerOptionalHeaderProps extends DrawerHeaderProps {
19
+ showHeader: boolean;
20
+ }
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),t=require("../../../../constants/generals.const.cjs"),n=require("../../../CloseButton/CloseButton.cjs"),l=e=>{const{showCloseButton:r,onClose:o}=e;return r?s.jsx(n.CloseButton,{className:"Bear-Drawer__close","aria-label":t.LABEL_CLOSE_DRAWER,onClick:o}):null};exports.DrawerHeaderClose=l;
@@ -0,0 +1,2 @@
1
+ import { DrawerHeaderCloseProps } from './DrawerHeader.types';
2
+ export declare const DrawerHeaderClose: (props: DrawerHeaderCloseProps) => import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,17 @@
1
+ import { jsx as t } from "react/jsx-runtime";
2
+ import { LABEL_CLOSE_DRAWER as l } from "../../../../constants/generals.const.js";
3
+ import { CloseButton as s } from "../../../CloseButton/CloseButton.js";
4
+ const i = (o) => {
5
+ const { showCloseButton: r, onClose: e } = o;
6
+ return r ? /* @__PURE__ */ t(
7
+ s,
8
+ {
9
+ className: "Bear-Drawer__close",
10
+ "aria-label": l,
11
+ onClick: e
12
+ }
13
+ ) : null;
14
+ };
15
+ export {
16
+ i as DrawerHeaderClose
17
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),a=require("../../../Typography/Typography.cjs"),l=r=>{const{title:e,titleId:t}=r;return e?i.jsx(a.Typography,{id:t,variant:"h2",className:"Bear-Drawer__title",children:e}):null};exports.DrawerHeaderTitle=l;
@@ -0,0 +1,2 @@
1
+ import { DrawerHeaderTitleProps } from './DrawerHeader.types';
2
+ export declare const DrawerHeaderTitle: (props: DrawerHeaderTitleProps) => import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,9 @@
1
+ import { jsx as i } from "react/jsx-runtime";
2
+ import { Typography as a } from "../../../Typography/Typography.js";
3
+ const n = (t) => {
4
+ const { title: r, titleId: e } = t;
5
+ return r ? /* @__PURE__ */ i(a, { id: e, variant: "h2", className: "Bear-Drawer__title", children: r }) : null;
6
+ };
7
+ export {
8
+ n as DrawerHeaderTitle
9
+ };
@@ -0,0 +1,2 @@
1
+ export { DrawerHeader } from './DrawerHeader';
2
+ export type { DrawerHeaderProps } from './DrawerHeader.types';
@@ -0,0 +1 @@
1
+ export { DrawerHeader } from './DrawerHeader';
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),n=require("../components/DrawerHeader/DrawerHeader.cjs"),o=e=>{const{showHeader:r,...t}=e;return r?a.jsx(n.DrawerHeader,{...t}):null};exports.DrawerOptionalHeader=o;
@@ -0,0 +1,2 @@
1
+ import { DrawerOptionalHeaderProps } from '../components/DrawerHeader/DrawerHeader.types';
2
+ export declare const DrawerOptionalHeader: (props: DrawerOptionalHeaderProps) => import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,9 @@
1
+ import { jsx as t } from "react/jsx-runtime";
2
+ import { DrawerHeader as a } from "../components/DrawerHeader/DrawerHeader.js";
3
+ const s = (r) => {
4
+ const { showHeader: e, ...o } = r;
5
+ return e ? /* @__PURE__ */ t(a, { ...o }) : null;
6
+ };
7
+ export {
8
+ s as DrawerOptionalHeader
9
+ };
@@ -0,0 +1 @@
1
+ export { DrawerOptionalHeader } from './DrawerOptionalHeader';
@@ -0,0 +1 @@
1
+ export { useDrawer } from './useDrawer';
@@ -0,0 +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;
@@ -0,0 +1,2 @@
1
+ import { UseDrawerParams, UseDrawerResult } from '../Drawer.types';
2
+ export declare const useDrawer: (params: UseDrawerParams) => UseDrawerResult;
@@ -0,0 +1,51 @@
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(() => {
11
+ if (s) {
12
+ if (l(r), c(o), u === d) {
13
+ i(r);
14
+ return;
15
+ }
16
+ const e = requestAnimationFrame(() => i(r));
17
+ return () => cancelAnimationFrame(e);
18
+ }
19
+ 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);
25
+ }
26
+ }, [s, t, u, a]);
27
+ const n = L(
28
+ (e) => {
29
+ f && e.key === C && E();
30
+ },
31
+ [f, E]
32
+ );
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
+ }
41
+ return () => {
42
+ document.removeEventListener("keydown", n);
43
+ };
44
+ }, [t, n]), {
45
+ isMounted: t,
46
+ isPanelOpen: _ && !A
47
+ };
48
+ };
49
+ export {
50
+ B as useDrawer
51
+ };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),e=require("react"),y=require("../Button/Button.cjs"),E=require("../Icon/index.cjs"),w=e.createContext(null),d=()=>{const t=e.useContext(w);if(!t)throw new Error("Editable components must be used within Editable.Root");return t},j=e.forwardRef(({children:t,defaultValue:s="",value:a,onChange:i,onEditSubmit:r,onCancel:b,placeholder:u="Click to edit...",isDisabled:l=!1,startWithEditView:p=!1,className:c="",...f},m)=>{const[o,x]=e.useState(p),[I,T]=e.useState(s),[k,_]=e.useState(s),g=a!==void 0?a:I,v=e.useCallback(h=>{a===void 0&&T(h),i==null||i(h)},[a,i]),P=e.useCallback(()=>{l||(_(g),x(!0))},[l,g]),q=e.useCallback(()=>{x(!1)},[]),D=e.useCallback(()=>{r==null||r(g),x(!1)},[g,r]),K=e.useCallback(()=>{v(k),b==null||b(),x(!1)},[k,v,b]);return n.jsx(w.Provider,{value:{isEditing:o,value:g,startEditing:P,stopEditing:q,setValue:v,submit:D,cancel:K},children:n.jsx("div",{ref:m,className:`Bear-Editable bear-inline-block ${c}`.trim(),...f,children:t})})});j.displayName="Editable.Root";const N=e.forwardRef(({children:t,className:s="",...a},i)=>{const{isEditing:r,value:b,startEditing:u}=d();return r?null:n.jsx("span",{ref:i,className:`Bear-Editable__preview bear-cursor-pointer bear-px-2 bear-py-1 bear-rounded bear-transition-all bear-border bear-border-transparent hover:bear-border-gray-300 dark:hover:bear-border-zinc-600 hover:bear-bg-gray-50 dark:hover:bear-bg-zinc-800 bear-text-gray-900 dark:bear-text-white ${s}`.trim(),onClick:u,...a,children:t||b||n.jsx("span",{className:"bear-text-gray-400 dark:bear-text-zinc-500 bear-italic",children:"Click to edit..."})})});N.displayName="Editable.Preview";const C=e.forwardRef(({asTextarea:t=!1,className:s="",...a},i)=>{const{isEditing:r,value:b,setValue:u,submit:l,cancel:p}=d(),c=e.useRef(null);e.useEffect(()=>{r&&c.current&&(c.current.focus(),c.current.select())},[r]);const f=o=>{o.key==="Enter"&&!t&&(o.preventDefault(),l()),o.key==="Escape"&&p()};if(!r)return null;const m="Bear-Editable__input bear-w-full bear-px-2 bear-py-1 bear-border bear-border-gray-300 dark:bear-border-zinc-600 bear-rounded bear-bg-white dark:bear-bg-zinc-800 bear-text-gray-900 dark:bear-text-white focus:bear-outline-none focus:bear-ring-2 focus:bear-ring-primary-500";return t?n.jsx("textarea",{ref:i,value:b,onChange:o=>u(o.target.value),onKeyDown:f,onBlur:l,className:`${m} bear-min-h-[80px] bear-resize-y ${s}`.trim(),...a}):n.jsx("input",{ref:c,type:"text",value:b,onChange:o=>u(o.target.value),onKeyDown:f,onBlur:l,className:`${m} ${s}`.trim(),...a})});C.displayName="Editable.Input";const R=e.forwardRef(({children:t,className:s="",...a},i)=>{const{isEditing:r}=d();return r?n.jsx("div",{ref:i,className:`Bear-Editable__control bear-flex bear-items-center bear-gap-1 bear-mt-1 ${s}`.trim(),...a,children:t}):null});R.displayName="Editable.Control";const z=e.forwardRef(({children:t,className:s="",...a},i)=>{const{submit:r}=d();return n.jsx(y.Button,{ref:i,type:"button",onClick:r,variant:"ghost",size:"sm",className:`bear-editable-submit bear-text-green-600 dark:bear-text-green-400 hover:bear-bg-green-100 dark:hover:bear-bg-green-900/30 bear-p-1 bear-min-w-0 ${s}`.trim(),...a,children:t||n.jsx(E.CheckIcon,{size:16})})});z.displayName="Editable.SubmitTrigger";const B=e.forwardRef(({children:t,className:s="",...a},i)=>{const{cancel:r}=d();return n.jsx(y.Button,{ref:i,type:"button",onClick:r,variant:"ghost",size:"sm",className:`bear-editable-cancel bear-text-red-600 dark:bear-text-red-400 hover:bear-bg-red-100 dark:hover:bear-bg-red-900/30 bear-p-1 bear-min-w-0 ${s}`.trim(),...a,children:t||n.jsx(E.CloseIcon,{size:16})})});B.displayName="Editable.CancelTrigger";const $=e.forwardRef(({children:t,className:s="",...a},i)=>{const{isEditing:r,startEditing:b}=d();return r?null:n.jsx(y.Button,{ref:i,type:"button",onClick:b,variant:"ghost",size:"sm",className:`bear-editable-edit bear-text-gray-600 dark:bear-text-gray-400 hover:bear-bg-gray-100 dark:hover:bear-bg-gray-800 bear-p-1 bear-min-w-0 ${s}`.trim(),...a,children:t||n.jsx(E.EditIcon,{size:16})})});$.displayName="Editable.EditTrigger";const S={Root:j,Preview:N,Input:C,Control:R,SubmitTrigger:z,CancelTrigger:B,EditTrigger:$};exports.Editable=S;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),e=require("react"),y=require("../Button/Button.cjs"),E=require("@forgedevstack/bear-icons"),w=e.createContext(null),d=()=>{const t=e.useContext(w);if(!t)throw new Error("Editable components must be used within Editable.Root");return t},j=e.forwardRef(({children:t,defaultValue:s="",value:a,onChange:i,onEditSubmit:r,onCancel:b,placeholder:u="Click to edit...",isDisabled:l=!1,startWithEditView:x=!1,className:c="",...f},m)=>{const[o,p]=e.useState(x),[I,T]=e.useState(s),[k,_]=e.useState(s),g=a!==void 0?a:I,v=e.useCallback(h=>{a===void 0&&T(h),i==null||i(h)},[a,i]),P=e.useCallback(()=>{l||(_(g),p(!0))},[l,g]),q=e.useCallback(()=>{p(!1)},[]),D=e.useCallback(()=>{r==null||r(g),p(!1)},[g,r]),K=e.useCallback(()=>{v(k),b==null||b(),p(!1)},[k,v,b]);return n.jsx(w.Provider,{value:{isEditing:o,value:g,startEditing:P,stopEditing:q,setValue:v,submit:D,cancel:K},children:n.jsx("div",{ref:m,className:`Bear-Editable bear-inline-block ${c}`.trim(),...f,children:t})})});j.displayName="Editable.Root";const N=e.forwardRef(({children:t,className:s="",...a},i)=>{const{isEditing:r,value:b,startEditing:u}=d();return r?null:n.jsx("span",{ref:i,className:`Bear-Editable__preview bear-cursor-pointer bear-px-2 bear-py-1 bear-rounded bear-transition-all bear-border bear-border-transparent hover:bear-border-gray-300 dark:hover:bear-border-zinc-600 hover:bear-bg-gray-50 dark:hover:bear-bg-zinc-800 bear-text-gray-900 dark:bear-text-white ${s}`.trim(),onClick:u,...a,children:t||b||n.jsx("span",{className:"bear-text-gray-400 dark:bear-text-zinc-500 bear-italic",children:"Click to edit..."})})});N.displayName="Editable.Preview";const C=e.forwardRef(({asTextarea:t=!1,className:s="",...a},i)=>{const{isEditing:r,value:b,setValue:u,submit:l,cancel:x}=d(),c=e.useRef(null);e.useEffect(()=>{r&&c.current&&(c.current.focus(),c.current.select())},[r]);const f=o=>{o.key==="Enter"&&!t&&(o.preventDefault(),l()),o.key==="Escape"&&x()};if(!r)return null;const m="Bear-Editable__input bear-w-full bear-px-2 bear-py-1 bear-border bear-border-gray-300 dark:bear-border-zinc-600 bear-rounded bear-bg-white dark:bear-bg-zinc-800 bear-text-gray-900 dark:bear-text-white focus:bear-outline-none focus:bear-ring-2 focus:bear-ring-primary-500";return t?n.jsx("textarea",{ref:i,value:b,onChange:o=>u(o.target.value),onKeyDown:f,onBlur:l,className:`${m} bear-min-h-[80px] bear-resize-y ${s}`.trim(),...a}):n.jsx("input",{ref:c,type:"text",value:b,onChange:o=>u(o.target.value),onKeyDown:f,onBlur:l,className:`${m} ${s}`.trim(),...a})});C.displayName="Editable.Input";const R=e.forwardRef(({children:t,className:s="",...a},i)=>{const{isEditing:r}=d();return r?n.jsx("div",{ref:i,className:`Bear-Editable__control bear-flex bear-items-center bear-gap-1 bear-mt-1 ${s}`.trim(),...a,children:t}):null});R.displayName="Editable.Control";const z=e.forwardRef(({children:t,className:s="",...a},i)=>{const{submit:r}=d();return n.jsx(y.Button,{ref:i,type:"button",onClick:r,variant:"ghost",size:"sm",className:`bear-editable-submit bear-text-green-600 dark:bear-text-green-400 hover:bear-bg-green-100 dark:hover:bear-bg-green-900/30 bear-p-1 bear-min-w-0 ${s}`.trim(),...a,children:t||n.jsx(E.CheckIcon,{size:16})})});z.displayName="Editable.SubmitTrigger";const B=e.forwardRef(({children:t,className:s="",...a},i)=>{const{cancel:r}=d();return n.jsx(y.Button,{ref:i,type:"button",onClick:r,variant:"ghost",size:"sm",className:`bear-editable-cancel bear-text-red-600 dark:bear-text-red-400 hover:bear-bg-red-100 dark:hover:bear-bg-red-900/30 bear-p-1 bear-min-w-0 ${s}`.trim(),...a,children:t||n.jsx(E.CloseIcon,{size:16})})});B.displayName="Editable.CancelTrigger";const $=e.forwardRef(({children:t,className:s="",...a},i)=>{const{isEditing:r,startEditing:b}=d();return r?null:n.jsx(y.Button,{ref:i,type:"button",onClick:b,variant:"ghost",size:"sm",className:`bear-editable-edit bear-text-gray-600 dark:bear-text-gray-400 hover:bear-bg-gray-100 dark:hover:bear-bg-gray-800 bear-p-1 bear-min-w-0 ${s}`.trim(),...a,children:t||n.jsx(E.EditIcon,{size:16})})});$.displayName="Editable.EditTrigger";const S={Root:j,Preview:N,Input:C,Control:R,SubmitTrigger:z,CancelTrigger:B,EditTrigger:$};exports.Editable=S;
@@ -1,7 +1,7 @@
1
1
  import { jsx as n } from "react/jsx-runtime";
2
2
  import { createContext as A, forwardRef as o, useState as h, useCallback as m, useRef as F, useEffect as G, useContext as H } from "react";
3
3
  import { Button as k } from "../Button/Button.js";
4
- import { CheckIcon as J, CloseIcon as L, EditIcon as M } from "../Icon/index.js";
4
+ import { CheckIcon as J, CloseIcon as L, EditIcon as M } from "@forgedevstack/bear-icons";
5
5
  const N = A(null), d = () => {
6
6
  const r = H(N);
7
7
  if (!r)
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),T=require("react"),x=require("../TreeView/TreeView.cjs"),j=require("../Icon/index.cjs"),m=require("./FileTree.utils.cjs"),q=r.jsx(j.BearIcons.ArticleIcon,{size:"xs",className:"bear-text-gray-400"}),F=({items:t,selectedId:s,defaultExpandedIds:o=[],onSelect:i,onExpand:a,size:c="md",showLines:n=!1,className:d,testId:l})=>{const u=T.useMemo(()=>t.map(e=>m.fileNodeToTreeNode(e,0,q)),[t]);return r.jsx("div",{"data-testid":l,children:r.jsx(x.TreeView,{data:u,selectedId:s,defaultExpandedIds:o,onSelect:i?e=>i(e.data):void 0,onExpand:a,size:c,showLines:n,className:d})})};exports.FileTree=F;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),T=require("react"),x=require("../TreeView/TreeView.cjs"),j=require("@forgedevstack/bear-icons"),m=require("./FileTree.utils.cjs"),q=r.jsx(j.BearIcons.ArticleIcon,{size:"xs",className:"bear-text-gray-400"}),b=({items:t,selectedId:i,defaultExpandedIds:o=[],onSelect:s,onExpand:a,size:c="md",showLines:n=!1,className:l,testId:d})=>{const u=T.useMemo(()=>t.map(e=>m.fileNodeToTreeNode(e,0,q)),[t]);return r.jsx("div",{"data-testid":d,children:r.jsx(x.TreeView,{data:u,selectedId:i,defaultExpandedIds:o,onSelect:s?e=>s(e.data):void 0,onExpand:a,size:c,showLines:n,className:l})})};exports.FileTree=b;
@@ -1,7 +1,7 @@
1
1
  import { jsx as o } from "react/jsx-runtime";
2
2
  import { useMemo as l } from "react";
3
3
  import { TreeView as p } from "../TreeView/TreeView.js";
4
- import { BearIcons as x } from "../Icon/index.js";
4
+ import { BearIcons as x } from "@forgedevstack/bear-icons";
5
5
  import { fileNodeToTreeNode as T } from "./FileTree.utils.js";
6
6
  const I = /* @__PURE__ */ o(x.ArticleIcon, { size: "xs", className: "bear-text-gray-400" }), g = ({
7
7
  items: r,
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),c=require("react"),G=require("react-dom"),r=require("../../utils/cn.cjs"),U=require("../../context/BearProvider.cjs"),g=require("../Button/Button.cjs"),P=require("../Avatar/Avatar.cjs");require("../Box/Box.cjs");const o=require("../Typography/Typography.cjs"),M=require("../Badge/Badge.cjs"),l=require("../Icon/index.cjs"),$=require("../Chat/Chat.cjs"),t=require("./FloatingChat.const.cjs"),Z=({messages:d,onSend:j,isLoading:b=!1,isTyping:S=!1,title:h=t.FLOATING_CHAT_DEFAULTS.TITLE,subtitle:_=t.FLOATING_CHAT_DEFAULTS.SUBTITLE,avatar:w,position:m=t.FLOATING_CHAT_DEFAULTS.POSITION,bottom:u=t.FLOATING_CHAT_DEFAULTS.BOTTOM,side:x=t.FLOATING_CHAT_DEFAULTS.SIDE,defaultOpen:E=!1,open:F,onOpenChange:s,trigger:T,badgeCount:i,header:y,welcomeMessage:p=t.FLOATING_CHAT_DEFAULTS.WELCOME_MESSAGE,poweredBy:A,className:L,testId:q})=>{const{mode:D}=U.useBear(),B=D==="dark",[C,v]=c.useState(E),[N,n]=c.useState(!1),a=F??C,I=c.useCallback(()=>{const f=!a;n(!0),v(f),s==null||s(f),setTimeout(()=>n(!1),300)},[a,s]),H=c.useCallback(()=>{n(!0),v(!1),s==null||s(!1),setTimeout(()=>n(!1),300)},[s]),k=d.length===0&&p?[{id:"welcome",content:p,sender:"bot",timestamp:new Date}]:d,z={bottom:`${u}px`,[m==="bottom-right"?"right":"left"]:`${x}px`},O={bottom:`${u+70}px`,[m==="bottom-right"?"right":"left"]:`${x}px`,width:t.CHAT_WINDOW_SIZE.width,height:t.CHAT_WINDOW_SIZE.height},W=e.jsxs("div",{className:r.cn("Bear-FloatingChat",L),"data-testid":q,children:[(a||N)&&e.jsxs("div",{className:r.cn("fixed z-50 rounded-2xl overflow-hidden shadow-2xl","transition-all duration-300 ease-out",a&&!N?"opacity-100 translate-y-0 scale-100":"opacity-0 translate-y-4 scale-95 pointer-events-none"),style:O,children:[y?e.jsx("div",{className:r.cn("px-4 py-3",B?"bg-gray-800":"bg-[var(--bear-primary-500)]"),children:y}):e.jsxs("div",{className:r.cn("px-4 py-3 flex items-center gap-3","bg-[var(--bear-primary-500)] text-white"),children:[e.jsx(P.Avatar,{src:w,initials:h[0],size:"sm",className:"ring-2 ring-white/20"}),e.jsxs("div",{className:"flex-1",children:[e.jsx(o.Typography,{variant:"subtitle2",className:"text-white font-semibold",children:h}),e.jsx(o.Typography,{variant:"caption",className:"text-white/70",children:_})]}),e.jsx(g.Button,{variant:"ghost",size:"sm",onClick:H,className:"!text-white hover:!bg-white/10",children:e.jsx(l.BearIcons.XIcon,{size:18})})]}),e.jsx($.Chat,{messages:k,onSend:j,isLoading:b,isTyping:S,showAvatars:!1,height:t.CHAT_WINDOW_SIZE.height-140,className:"!rounded-none !border-0"}),A&&e.jsx("div",{className:"px-3 py-2 text-center border-t border-gray-200 dark:border-gray-700",children:e.jsxs(o.Typography,{variant:"caption",className:"opacity-50",children:["Powered by ",A]})})]}),e.jsx("div",{className:"fixed z-50",style:z,children:T?e.jsx("div",{onClick:I,children:T}):e.jsxs("div",{className:"relative",children:[e.jsx(g.Button,{variant:"primary",onClick:I,className:r.cn("!w-14 !h-14 !rounded-full !p-0 shadow-lg","transition-transform duration-200",a&&"rotate-180"),children:a?e.jsx(l.BearIcons.XIcon,{size:24}):e.jsx(l.BearIcons.ChatIcon,{size:24})}),!a&&i&&i>0&&e.jsx(M.Badge,{variant:"danger",size:"sm",className:"absolute -top-1 -right-1 !min-w-[20px] !h-5",children:i>99?"99+":i})]})})]});return typeof document>"u"?null:G.createPortal(W,document.body)};exports.FloatingChat=Z;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),c=require("react"),G=require("react-dom"),r=require("../../utils/cn.cjs"),U=require("../../context/BearProvider.cjs"),g=require("../Button/Button.cjs"),P=require("../Avatar/Avatar.cjs");require("../Box/Box.cjs");const o=require("../Typography/Typography.cjs"),M=require("../Badge/Badge.cjs"),l=require("@forgedevstack/bear-icons"),$=require("../Chat/Chat.cjs"),t=require("./FloatingChat.const.cjs"),Z=({messages:d,onSend:j,isLoading:b=!1,isTyping:S=!1,title:h=t.FLOATING_CHAT_DEFAULTS.TITLE,subtitle:_=t.FLOATING_CHAT_DEFAULTS.SUBTITLE,avatar:w,position:m=t.FLOATING_CHAT_DEFAULTS.POSITION,bottom:u=t.FLOATING_CHAT_DEFAULTS.BOTTOM,side:x=t.FLOATING_CHAT_DEFAULTS.SIDE,defaultOpen:E=!1,open:F,onOpenChange:s,trigger:T,badgeCount:i,header:y,welcomeMessage:p=t.FLOATING_CHAT_DEFAULTS.WELCOME_MESSAGE,poweredBy:A,className:L,testId:q})=>{const{mode:D}=U.useBear(),B=D==="dark",[C,v]=c.useState(E),[I,n]=c.useState(!1),a=F??C,N=c.useCallback(()=>{const f=!a;n(!0),v(f),s==null||s(f),setTimeout(()=>n(!1),300)},[a,s]),H=c.useCallback(()=>{n(!0),v(!1),s==null||s(!1),setTimeout(()=>n(!1),300)},[s]),k=d.length===0&&p?[{id:"welcome",content:p,sender:"bot",timestamp:new Date}]:d,z={bottom:`${u}px`,[m==="bottom-right"?"right":"left"]:`${x}px`},O={bottom:`${u+70}px`,[m==="bottom-right"?"right":"left"]:`${x}px`,width:t.CHAT_WINDOW_SIZE.width,height:t.CHAT_WINDOW_SIZE.height},W=e.jsxs("div",{className:r.cn("Bear-FloatingChat",L),"data-testid":q,children:[(a||I)&&e.jsxs("div",{className:r.cn("fixed z-50 rounded-2xl overflow-hidden shadow-2xl","transition-all duration-300 ease-out",a&&!I?"opacity-100 translate-y-0 scale-100":"opacity-0 translate-y-4 scale-95 pointer-events-none"),style:O,children:[y?e.jsx("div",{className:r.cn("px-4 py-3",B?"bg-gray-800":"bg-[var(--bear-primary-500)]"),children:y}):e.jsxs("div",{className:r.cn("px-4 py-3 flex items-center gap-3","bg-[var(--bear-primary-500)] text-white"),children:[e.jsx(P.Avatar,{src:w,initials:h[0],size:"sm",className:"ring-2 ring-white/20"}),e.jsxs("div",{className:"flex-1",children:[e.jsx(o.Typography,{variant:"subtitle2",className:"text-white font-semibold",children:h}),e.jsx(o.Typography,{variant:"caption",className:"text-white/70",children:_})]}),e.jsx(g.Button,{variant:"ghost",size:"sm",onClick:H,className:"!text-white hover:!bg-white/10",children:e.jsx(l.BearIcons.XIcon,{size:18})})]}),e.jsx($.Chat,{messages:k,onSend:j,isLoading:b,isTyping:S,showAvatars:!1,height:t.CHAT_WINDOW_SIZE.height-140,className:"!rounded-none !border-0"}),A&&e.jsx("div",{className:"px-3 py-2 text-center border-t border-gray-200 dark:border-gray-700",children:e.jsxs(o.Typography,{variant:"caption",className:"opacity-50",children:["Powered by ",A]})})]}),e.jsx("div",{className:"fixed z-50",style:z,children:T?e.jsx("div",{onClick:N,children:T}):e.jsxs("div",{className:"relative",children:[e.jsx(g.Button,{variant:"primary",onClick:N,className:r.cn("!w-14 !h-14 !rounded-full !p-0 shadow-lg","transition-transform duration-200",a&&"rotate-180"),children:a?e.jsx(l.BearIcons.XIcon,{size:24}):e.jsx(l.BearIcons.ChatIcon,{size:24})}),!a&&i&&i>0&&e.jsx(M.Badge,{variant:"danger",size:"sm",className:"absolute -top-1 -right-1 !min-w-[20px] !h-5",children:i>99?"99+":i})]})})]});return typeof document>"u"?null:G.createPortal(W,document.body)};exports.FloatingChat=Z;
@@ -8,7 +8,7 @@ import { Avatar as J } from "../Avatar/Avatar.js";
8
8
  import "../Box/Box.js";
9
9
  import { Typography as c } from "../Typography/Typography.js";
10
10
  import { Badge as K } from "../Badge/Badge.js";
11
- import { BearIcons as n } from "../Icon/index.js";
11
+ import { BearIcons as n } from "@forgedevstack/bear-icons";
12
12
  import { Chat as O } from "../Chat/Chat.js";
13
13
  import { FLOATING_CHAT_DEFAULTS as a, CHAT_WINDOW_SIZE as m } from "./FloatingChat.const.js";
14
14
  const ct = ({