@forgedevstack/bear 1.2.0 → 1.2.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 (268) hide show
  1. package/dist/components/AnimatedCounter/AnimatedCounter.cjs +1 -0
  2. package/dist/components/AnimatedCounter/AnimatedCounter.const.cjs +1 -0
  3. package/dist/components/AnimatedCounter/AnimatedCounter.const.d.ts +5 -0
  4. package/dist/components/AnimatedCounter/AnimatedCounter.const.js +7 -0
  5. package/dist/components/AnimatedCounter/AnimatedCounter.d.ts +3 -0
  6. package/dist/components/AnimatedCounter/AnimatedCounter.js +59 -0
  7. package/dist/components/AnimatedCounter/AnimatedCounter.types.d.ts +26 -0
  8. package/dist/components/AnimatedCounter/AnimatedCounter.utils.cjs +1 -0
  9. package/dist/components/AnimatedCounter/AnimatedCounter.utils.d.ts +6 -0
  10. package/dist/components/AnimatedCounter/AnimatedCounter.utils.js +13 -0
  11. package/dist/components/AnimatedCounter/index.d.ts +2 -0
  12. package/dist/components/Autocomplete/Autocomplete.cjs +1 -1
  13. package/dist/components/Autocomplete/Autocomplete.const.cjs +1 -0
  14. package/dist/components/Autocomplete/Autocomplete.const.d.ts +1 -0
  15. package/dist/components/Autocomplete/Autocomplete.const.js +4 -0
  16. package/dist/components/Autocomplete/Autocomplete.js +110 -72
  17. package/dist/components/BottomSheet/BottomSheet.cjs +1 -1
  18. package/dist/components/BottomSheet/BottomSheet.js +74 -53
  19. package/dist/components/BottomSheet/BottomSheet.types.d.ts +2 -0
  20. package/dist/components/Breadcrumbs/Breadcrumbs.cjs +1 -1
  21. package/dist/components/Breadcrumbs/Breadcrumbs.js +126 -46
  22. package/dist/components/Breadcrumbs/Breadcrumbs.types.d.ts +11 -4
  23. package/dist/components/Breadcrumbs/index.d.ts +1 -1
  24. package/dist/components/Cascader/Cascader.cjs +1 -1
  25. package/dist/components/Cascader/Cascader.const.cjs +1 -1
  26. package/dist/components/Cascader/Cascader.const.d.ts +1 -1
  27. package/dist/components/Cascader/Cascader.const.js +1 -1
  28. package/dist/components/Cascader/Cascader.js +109 -146
  29. package/dist/components/Cascader/components/CascaderPanel/CascaderPanel.cjs +1 -0
  30. package/dist/components/Cascader/components/CascaderPanel/CascaderPanel.d.ts +3 -0
  31. package/dist/components/Cascader/components/CascaderPanel/CascaderPanel.js +50 -0
  32. package/dist/components/Cascader/components/CascaderPanel/index.d.ts +1 -0
  33. package/dist/components/Chart/BarChart.cjs +1 -0
  34. package/dist/components/Chart/BarChart.d.ts +3 -0
  35. package/dist/components/Chart/BarChart.js +65 -0
  36. package/dist/components/Chart/Chart.cjs +1 -1
  37. package/dist/components/Chart/Chart.const.cjs +1 -1
  38. package/dist/components/Chart/Chart.const.d.ts +7 -0
  39. package/dist/components/Chart/Chart.const.js +12 -2
  40. package/dist/components/Chart/Chart.d.ts +1 -13
  41. package/dist/components/Chart/Chart.js +18 -204
  42. package/dist/components/Chart/Chart.types.d.ts +7 -1
  43. package/dist/components/Chart/LineChart.cjs +1 -0
  44. package/dist/components/Chart/LineChart.d.ts +3 -0
  45. package/dist/components/Chart/LineChart.js +73 -0
  46. package/dist/components/Chart/PieChart.cjs +1 -0
  47. package/dist/components/Chart/PieChart.d.ts +3 -0
  48. package/dist/components/Chart/PieChart.js +110 -0
  49. package/dist/components/Chart/index.d.ts +4 -1
  50. package/dist/components/ColorPicker/ColorPicker.cjs +1 -1
  51. package/dist/components/ColorPicker/ColorPicker.const.cjs +1 -1
  52. package/dist/components/ColorPicker/ColorPicker.const.d.ts +4 -2
  53. package/dist/components/ColorPicker/ColorPicker.const.js +8 -6
  54. package/dist/components/ColorPicker/ColorPicker.js +135 -73
  55. package/dist/components/ColorPicker/ColorPicker.utils.cjs +1 -0
  56. package/dist/components/ColorPicker/ColorPicker.utils.d.ts +17 -0
  57. package/dist/components/ColorPicker/ColorPicker.utils.js +43 -0
  58. package/dist/components/CountdownTimer/CountdownTimer.cjs +1 -1
  59. package/dist/components/CountdownTimer/CountdownTimer.const.cjs +1 -1
  60. package/dist/components/CountdownTimer/CountdownTimer.const.d.ts +2 -0
  61. package/dist/components/CountdownTimer/CountdownTimer.const.js +29 -17
  62. package/dist/components/CountdownTimer/CountdownTimer.js +91 -61
  63. package/dist/components/CountdownTimer/CountdownTimer.types.d.ts +11 -2
  64. package/dist/components/CreditInput/CreditInput.cjs +1 -1
  65. package/dist/components/CreditInput/CreditInput.js +80 -78
  66. package/dist/components/CurrencyInput/CurrencyInput.cjs +1 -0
  67. package/dist/components/CurrencyInput/CurrencyInput.const.cjs +1 -0
  68. package/dist/components/CurrencyInput/CurrencyInput.const.d.ts +4 -0
  69. package/dist/components/CurrencyInput/CurrencyInput.const.js +19 -0
  70. package/dist/components/CurrencyInput/CurrencyInput.d.ts +3 -0
  71. package/dist/components/CurrencyInput/CurrencyInput.js +60 -0
  72. package/dist/components/CurrencyInput/CurrencyInput.types.d.ts +22 -0
  73. package/dist/components/CurrencyInput/CurrencyInput.utils.cjs +1 -0
  74. package/dist/components/CurrencyInput/CurrencyInput.utils.d.ts +2 -0
  75. package/dist/components/CurrencyInput/CurrencyInput.utils.js +14 -0
  76. package/dist/components/CurrencyInput/index.d.ts +2 -0
  77. package/dist/components/DateRangePicker/DateRangePicker.cjs +1 -1
  78. package/dist/components/DateRangePicker/DateRangePicker.js +89 -84
  79. package/dist/components/DiffSquares/DiffSquares.cjs +1 -0
  80. package/dist/components/DiffSquares/DiffSquares.const.cjs +1 -0
  81. package/dist/components/DiffSquares/DiffSquares.const.d.ts +3 -0
  82. package/dist/components/DiffSquares/DiffSquares.const.js +6 -0
  83. package/dist/components/DiffSquares/DiffSquares.d.ts +3 -0
  84. package/dist/components/DiffSquares/DiffSquares.js +70 -0
  85. package/dist/components/DiffSquares/DiffSquares.types.d.ts +23 -0
  86. package/dist/components/DiffSquares/DiffSquares.utils.cjs +1 -0
  87. package/dist/components/DiffSquares/DiffSquares.utils.d.ts +3 -0
  88. package/dist/components/DiffSquares/DiffSquares.utils.js +12 -0
  89. package/dist/components/DiffSquares/index.d.ts +2 -0
  90. package/dist/components/DiffViewer/DiffViewer.cjs +1 -1
  91. package/dist/components/DiffViewer/DiffViewer.const.cjs +1 -1
  92. package/dist/components/DiffViewer/DiffViewer.const.d.ts +6 -0
  93. package/dist/components/DiffViewer/DiffViewer.const.js +17 -4
  94. package/dist/components/DiffViewer/DiffViewer.d.ts +0 -14
  95. package/dist/components/DiffViewer/DiffViewer.js +97 -105
  96. package/dist/components/DiffViewer/DiffViewer.types.d.ts +5 -0
  97. package/dist/components/DiffViewer/index.d.ts +1 -1
  98. package/dist/components/Drawer/Drawer.cjs +1 -1
  99. package/dist/components/Drawer/Drawer.js +41 -41
  100. package/dist/components/Dropdown/Dropdown.cjs +1 -1
  101. package/dist/components/Dropdown/Dropdown.const.cjs +1 -0
  102. package/dist/components/Dropdown/Dropdown.const.d.ts +7 -0
  103. package/dist/components/Dropdown/Dropdown.const.js +10 -0
  104. package/dist/components/Dropdown/Dropdown.d.ts +0 -1
  105. package/dist/components/Dropdown/Dropdown.js +102 -92
  106. package/dist/components/Dropdown/Dropdown.types.d.ts +2 -0
  107. package/dist/components/Gauge/Gauge.cjs +1 -1
  108. package/dist/components/Gauge/Gauge.js +61 -50
  109. package/dist/components/Gauge/Gauge.types.d.ts +2 -0
  110. package/dist/components/GlowCard/GlowCard.cjs +1 -0
  111. package/dist/components/GlowCard/GlowCard.const.cjs +1 -0
  112. package/dist/components/GlowCard/GlowCard.const.d.ts +11 -0
  113. package/dist/components/GlowCard/GlowCard.const.js +13 -0
  114. package/dist/components/GlowCard/GlowCard.d.ts +3 -0
  115. package/dist/components/GlowCard/GlowCard.js +185 -0
  116. package/dist/components/GlowCard/GlowCard.types.d.ts +21 -0
  117. package/dist/components/GlowCard/index.d.ts +2 -0
  118. package/dist/components/Heatmap/Heatmap.cjs +1 -0
  119. package/dist/components/Heatmap/Heatmap.const.cjs +1 -0
  120. package/dist/components/Heatmap/Heatmap.const.d.ts +8 -0
  121. package/dist/components/Heatmap/Heatmap.const.js +11 -0
  122. package/dist/components/Heatmap/Heatmap.d.ts +3 -0
  123. package/dist/components/Heatmap/Heatmap.js +103 -0
  124. package/dist/components/Heatmap/Heatmap.types.d.ts +34 -0
  125. package/dist/components/Heatmap/Heatmap.utils.cjs +1 -0
  126. package/dist/components/Heatmap/Heatmap.utils.d.ts +2 -0
  127. package/dist/components/Heatmap/Heatmap.utils.js +18 -0
  128. package/dist/components/Heatmap/index.d.ts +2 -0
  129. package/dist/components/HoverCard/HoverCard.cjs +6 -6
  130. package/dist/components/HoverCard/HoverCard.js +72 -54
  131. package/dist/components/Icon/icons/status.js +1 -1
  132. package/dist/components/ImageAnnotation/ImageAnnotation.cjs +1 -0
  133. package/dist/components/ImageAnnotation/ImageAnnotation.const.cjs +1 -0
  134. package/dist/components/ImageAnnotation/ImageAnnotation.const.d.ts +3 -0
  135. package/dist/components/ImageAnnotation/ImageAnnotation.const.js +6 -0
  136. package/dist/components/ImageAnnotation/ImageAnnotation.d.ts +3 -0
  137. package/dist/components/ImageAnnotation/ImageAnnotation.js +113 -0
  138. package/dist/components/ImageAnnotation/ImageAnnotation.types.d.ts +28 -0
  139. package/dist/components/ImageAnnotation/index.d.ts +2 -0
  140. package/dist/components/MediaPlayer/MediaPlayer.cjs +1 -0
  141. package/dist/components/MediaPlayer/MediaPlayer.const.cjs +1 -0
  142. package/dist/components/MediaPlayer/MediaPlayer.const.d.ts +36 -0
  143. package/dist/components/MediaPlayer/MediaPlayer.const.js +11 -0
  144. package/dist/components/MediaPlayer/MediaPlayer.d.ts +3 -0
  145. package/dist/components/MediaPlayer/MediaPlayer.js +279 -0
  146. package/dist/components/MediaPlayer/MediaPlayer.types.d.ts +69 -0
  147. package/dist/components/MediaPlayer/MediaPlayer.utils.cjs +1 -0
  148. package/dist/components/MediaPlayer/MediaPlayer.utils.d.ts +1 -0
  149. package/dist/components/MediaPlayer/MediaPlayer.utils.js +7 -0
  150. package/dist/components/MediaPlayer/index.d.ts +2 -0
  151. package/dist/components/MentionsInput/MentionsInput.cjs +1 -1
  152. package/dist/components/MentionsInput/MentionsInput.js +106 -83
  153. package/dist/components/Menu/Menu.cjs +1 -1
  154. package/dist/components/Menu/Menu.js +91 -80
  155. package/dist/components/Modal/Modal.cjs +1 -1
  156. package/dist/components/Modal/Modal.const.cjs +1 -1
  157. package/dist/components/Modal/Modal.const.d.ts +1 -1
  158. package/dist/components/Modal/Modal.const.js +1 -1
  159. package/dist/components/Modal/Modal.js +50 -44
  160. package/dist/components/Modal/Modal.types.d.ts +6 -0
  161. package/dist/components/MultiSelect/MultiSelect.cjs +1 -1
  162. package/dist/components/MultiSelect/MultiSelect.js +123 -78
  163. package/dist/components/NavigableSelect/NavigableSelect.cjs +1 -1
  164. package/dist/components/NavigableSelect/NavigableSelect.const.cjs +1 -1
  165. package/dist/components/NavigableSelect/NavigableSelect.const.d.ts +1 -1
  166. package/dist/components/NavigableSelect/NavigableSelect.const.js +1 -1
  167. package/dist/components/NavigableSelect/NavigableSelect.js +167 -143
  168. package/dist/components/NotificationCenter/NotificationCenter.cjs +1 -1
  169. package/dist/components/NotificationCenter/NotificationCenter.const.cjs +1 -1
  170. package/dist/components/NotificationCenter/NotificationCenter.const.d.ts +1 -1
  171. package/dist/components/NotificationCenter/NotificationCenter.const.js +1 -1
  172. package/dist/components/NotificationCenter/NotificationCenter.js +87 -81
  173. package/dist/components/OTPInput/OTPInput.cjs +1 -1
  174. package/dist/components/OTPInput/OTPInput.const.cjs +1 -0
  175. package/dist/components/OTPInput/OTPInput.const.d.ts +6 -0
  176. package/dist/components/OTPInput/OTPInput.const.js +14 -0
  177. package/dist/components/OTPInput/OTPInput.js +99 -65
  178. package/dist/components/OTPInput/OTPInput.types.d.ts +7 -0
  179. package/dist/components/PhoneInput/PhoneInput.cjs +1 -1
  180. package/dist/components/PhoneInput/PhoneInput.const.cjs +1 -1
  181. package/dist/components/PhoneInput/PhoneInput.const.d.ts +1 -1
  182. package/dist/components/PhoneInput/PhoneInput.const.js +1 -1
  183. package/dist/components/PhoneInput/PhoneInput.js +88 -83
  184. package/dist/components/Popconfirm/Popconfirm.cjs +1 -1
  185. package/dist/components/Popconfirm/Popconfirm.const.cjs +1 -1
  186. package/dist/components/Popconfirm/Popconfirm.const.d.ts +1 -3
  187. package/dist/components/Popconfirm/Popconfirm.const.js +12 -18
  188. package/dist/components/Popconfirm/Popconfirm.js +71 -51
  189. package/dist/components/Popover/Popover.cjs +1 -1
  190. package/dist/components/Popover/Popover.js +36 -31
  191. package/dist/components/Portal/Portal.cjs +1 -1
  192. package/dist/components/Portal/Portal.d.ts +0 -3
  193. package/dist/components/Portal/Portal.js +4 -10
  194. package/dist/components/Select/Select.cjs +1 -1
  195. package/dist/components/Select/Select.js +71 -51
  196. package/dist/components/Stepper/Stepper.cjs +1 -1
  197. package/dist/components/Stepper/Stepper.const.cjs +1 -1
  198. package/dist/components/Stepper/Stepper.const.d.ts +26 -4
  199. package/dist/components/Stepper/Stepper.const.js +39 -20
  200. package/dist/components/Stepper/Stepper.d.ts +3 -10
  201. package/dist/components/Stepper/Stepper.js +189 -130
  202. package/dist/components/Stepper/Stepper.types.d.ts +14 -0
  203. package/dist/components/Stepper/Stepper.utils.cjs +1 -0
  204. package/dist/components/Stepper/Stepper.utils.d.ts +12 -0
  205. package/dist/components/Stepper/Stepper.utils.js +19 -0
  206. package/dist/components/Stepper/components/StepperControls.cjs +1 -0
  207. package/dist/components/Stepper/components/StepperControls.d.ts +2 -0
  208. package/dist/components/Stepper/components/StepperControls.js +32 -0
  209. package/dist/components/Stepper/index.d.ts +2 -1
  210. package/dist/components/Tabs/TabList.cjs +1 -1
  211. package/dist/components/Tabs/TabList.js +72 -57
  212. package/dist/components/Tabs/Tabs.types.d.ts +4 -2
  213. package/dist/components/Tabs/index.d.ts +2 -2
  214. package/dist/components/TagCloud/TagCloud.cjs +1 -0
  215. package/dist/components/TagCloud/TagCloud.const.cjs +1 -0
  216. package/dist/components/TagCloud/TagCloud.const.d.ts +5 -0
  217. package/dist/components/TagCloud/TagCloud.const.js +8 -0
  218. package/dist/components/TagCloud/TagCloud.d.ts +3 -0
  219. package/dist/components/TagCloud/TagCloud.js +76 -0
  220. package/dist/components/TagCloud/TagCloud.types.d.ts +26 -0
  221. package/dist/components/TagCloud/index.d.ts +2 -0
  222. package/dist/components/TimePicker/components/TimePickerDialDropdown/TimePickerDialDropdown.cjs +1 -1
  223. package/dist/components/TimePicker/components/TimePickerDialDropdown/TimePickerDialDropdown.js +26 -26
  224. package/dist/components/TimePicker/helpers/ClockFaceSvg.cjs +1 -1
  225. package/dist/components/TimePicker/helpers/ClockFaceSvg.js +17 -17
  226. package/dist/components/TimelineChart/TimelineChart.cjs +1 -0
  227. package/dist/components/TimelineChart/TimelineChart.const.cjs +1 -0
  228. package/dist/components/TimelineChart/TimelineChart.const.d.ts +6 -0
  229. package/dist/components/TimelineChart/TimelineChart.const.js +9 -0
  230. package/dist/components/TimelineChart/TimelineChart.d.ts +3 -0
  231. package/dist/components/TimelineChart/TimelineChart.js +65 -0
  232. package/dist/components/TimelineChart/TimelineChart.types.d.ts +31 -0
  233. package/dist/components/TimelineChart/index.d.ts +2 -0
  234. package/dist/components/Toast/Toast.cjs +1 -1
  235. package/dist/components/Toast/Toast.js +86 -82
  236. package/dist/components/Toast/Toast.types.d.ts +2 -0
  237. package/dist/components/Tooltip/Tooltip.cjs +1 -1
  238. package/dist/components/Tooltip/Tooltip.js +52 -44
  239. package/dist/components/TreeSelect/TreeSelect.cjs +1 -1
  240. package/dist/components/TreeSelect/TreeSelect.const.cjs +1 -1
  241. package/dist/components/TreeSelect/TreeSelect.const.d.ts +1 -1
  242. package/dist/components/TreeSelect/TreeSelect.const.js +3 -3
  243. package/dist/components/TreeSelect/TreeSelect.js +120 -88
  244. package/dist/components/Watermark/Watermark.cjs +1 -1
  245. package/dist/components/Watermark/Watermark.const.cjs +1 -1
  246. package/dist/components/Watermark/Watermark.const.d.ts +6 -3
  247. package/dist/components/Watermark/Watermark.const.js +13 -11
  248. package/dist/components/Watermark/Watermark.js +87 -61
  249. package/dist/components/Watermark/Watermark.types.d.ts +2 -0
  250. package/dist/components/index.cjs +1 -1
  251. package/dist/components/index.d.ts +22 -4
  252. package/dist/components/index.js +319 -296
  253. package/dist/hooks/index.cjs +1 -1
  254. package/dist/hooks/index.d.ts +1 -1
  255. package/dist/hooks/index.js +55 -54
  256. package/dist/hooks/useClickOutside.cjs +1 -1
  257. package/dist/hooks/useClickOutside.d.ts +4 -11
  258. package/dist/hooks/useClickOutside.js +26 -7
  259. package/dist/index.cjs +1 -1
  260. package/dist/index.js +412 -388
  261. package/dist/styles/_effects.css +32 -0
  262. package/dist/styles.css +1 -1
  263. package/dist/utils/maxVisible.utils.cjs +1 -0
  264. package/dist/utils/maxVisible.utils.d.ts +12 -0
  265. package/dist/utils/maxVisible.utils.js +15 -0
  266. package/package.json +1 -1
  267. package/dist/components/HoverCard/HoverCard.utils.cjs +0 -1
  268. package/dist/components/HoverCard/HoverCard.utils.js +0 -23
@@ -1,159 +1,163 @@
1
- import { jsx as e, jsxs as c } from "react/jsx-runtime";
2
- import { createContext as I, useContext as y, useState as T, useCallback as i, useEffect as N } from "react";
3
- import { cn as k } from "../../utils/cn.js";
4
- import { generateId as E } from "./Toast.utils.js";
5
- const S = {
6
- success: /* @__PURE__ */ c("svg", { width: 20, height: 20, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, children: [
1
+ import { jsx as e, jsxs as l } from "react/jsx-runtime";
2
+ import { createContext as N, useContext as T, useState as k, useCallback as n, useRef as E, useEffect as y } from "react";
3
+ import { cn as I } from "../../utils/cn.js";
4
+ import { generateId as S } from "./Toast.utils.js";
5
+ const _ = {
6
+ success: /* @__PURE__ */ l("svg", { width: 20, height: 20, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, children: [
7
7
  /* @__PURE__ */ e("path", { d: "M22 11.08V12a10 10 0 1 1-5.93-9.14" }),
8
8
  /* @__PURE__ */ e("polyline", { points: "22 4 12 14.01 9 11.01" })
9
9
  ] }),
10
- info: /* @__PURE__ */ c("svg", { width: 20, height: 20, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, children: [
10
+ info: /* @__PURE__ */ l("svg", { width: 20, height: 20, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, children: [
11
11
  /* @__PURE__ */ e("circle", { cx: "12", cy: "12", r: "10" }),
12
12
  /* @__PURE__ */ e("line", { x1: "12", y1: "16", x2: "12", y2: "12" }),
13
13
  /* @__PURE__ */ e("line", { x1: "12", y1: "8", x2: "12.01", y2: "8" })
14
14
  ] }),
15
- warning: /* @__PURE__ */ c("svg", { width: 20, height: 20, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, children: [
15
+ warning: /* @__PURE__ */ l("svg", { width: 20, height: 20, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, children: [
16
16
  /* @__PURE__ */ e("path", { d: "M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z" }),
17
17
  /* @__PURE__ */ e("line", { x1: "12", y1: "9", x2: "12", y2: "13" }),
18
18
  /* @__PURE__ */ e("line", { x1: "12", y1: "17", x2: "12.01", y2: "17" })
19
19
  ] }),
20
- error: /* @__PURE__ */ c("svg", { width: 20, height: 20, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, children: [
20
+ error: /* @__PURE__ */ l("svg", { width: 20, height: 20, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, children: [
21
21
  /* @__PURE__ */ e("circle", { cx: "12", cy: "12", r: "10" }),
22
22
  /* @__PURE__ */ e("line", { x1: "15", y1: "9", x2: "9", y2: "15" }),
23
23
  /* @__PURE__ */ e("line", { x1: "9", y1: "9", x2: "15", y2: "15" })
24
24
  ] })
25
- }, _ = () => /* @__PURE__ */ c("svg", { width: 16, height: 16, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, children: [
25
+ }, B = () => /* @__PURE__ */ l("svg", { width: 16, height: 16, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, children: [
26
26
  /* @__PURE__ */ e("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
27
27
  /* @__PURE__ */ e("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
28
- ] }), B = {
28
+ ] }), W = {
29
29
  success: "bear-bg-green-500 bear-text-white",
30
30
  info: "bear-bg-blue-500 bear-text-white",
31
31
  warning: "bear-bg-amber-500 bear-text-white",
32
32
  error: "bear-bg-red-500 bear-text-white"
33
- }, W = {
33
+ }, C = {
34
34
  "top-left": "bear-top-4 bear-left-4",
35
35
  "top-center": "bear-top-4 bear-left-1/2 bear-transform bear--translate-x-1/2",
36
36
  "top-right": "bear-top-4 bear-right-4",
37
37
  "bottom-left": "bear-bottom-4 bear-left-4",
38
38
  "bottom-center": "bear-bottom-4 bear-left-1/2 bear-transform bear--translate-x-1/2",
39
39
  "bottom-right": "bear-bottom-4 bear-right-4"
40
- }, w = I(null), z = () => {
41
- const n = y(w);
42
- if (!n)
40
+ }, w = N(null), M = () => {
41
+ const i = T(w);
42
+ if (!i)
43
43
  throw new Error("useToast must be used within a ToastProvider");
44
- return n;
45
- }, C = ({
46
- message: n,
44
+ return i;
45
+ }, L = ({
46
+ message: i,
47
47
  title: b,
48
- severity: d = "info",
48
+ severity: h = "info",
49
49
  duration: o = 5e3,
50
- closable: l = !0,
50
+ closable: c = !0,
51
51
  icon: t,
52
- action: h,
53
- onClose: a,
52
+ action: d,
53
+ onClose: s,
54
54
  onRemove: x,
55
- className: f
55
+ className: p,
56
+ autoScroll: m = !1
56
57
  }) => {
57
- const [g, m] = T(!1);
58
- N(() => {
58
+ const [v, g] = k(!1), u = E(null);
59
+ y(() => {
60
+ m && u.current && u.current.scrollIntoView({ behavior: "smooth", block: "nearest", inline: "nearest" });
61
+ }, [m]), y(() => {
59
62
  if (o > 0) {
60
- const r = setTimeout(() => {
61
- m(!0), setTimeout(() => {
62
- x(), a == null || a();
63
+ const f = setTimeout(() => {
64
+ g(!0), setTimeout(() => {
65
+ x(), s == null || s();
63
66
  }, 200);
64
67
  }, o);
65
- return () => clearTimeout(r);
68
+ return () => clearTimeout(f);
66
69
  }
67
- }, [o, x, a]);
68
- const p = () => {
69
- m(!0), setTimeout(() => {
70
- x(), a == null || a();
70
+ }, [o, x, s]);
71
+ const r = () => {
72
+ g(!0), setTimeout(() => {
73
+ x(), s == null || s();
71
74
  }, 200);
72
- }, u = () => t === !1 ? null : t || S[d];
73
- return /* @__PURE__ */ c(
75
+ }, a = () => t === !1 ? null : t || _[h];
76
+ return /* @__PURE__ */ l(
74
77
  "div",
75
78
  {
79
+ ref: u,
76
80
  role: "alert",
77
- className: k(
81
+ className: I(
78
82
  "bear-flex bear-items-start bear-gap-3 bear-p-4 bear-rounded-lg bear-shadow-lg bear-min-w-[300px] bear-max-w-[400px]",
79
83
  "bear-transition-all bear-duration-200",
80
- g ? "bear-opacity-0 bear-translate-x-2" : "bear-opacity-100 bear-translate-x-0",
81
- B[d],
82
- f
84
+ v ? "bear-opacity-0 bear-translate-x-2" : "bear-opacity-100 bear-translate-x-0",
85
+ W[h],
86
+ p
83
87
  ),
84
88
  children: [
85
- u() && /* @__PURE__ */ e("span", { className: "bear-flex-shrink-0 bear-mt-0.5", children: u() }),
86
- /* @__PURE__ */ c("div", { className: "bear-flex-1 bear-min-w-0", children: [
89
+ a() && /* @__PURE__ */ e("span", { className: "bear-flex-shrink-0 bear-mt-0.5", children: a() }),
90
+ /* @__PURE__ */ l("div", { className: "bear-flex-1 bear-min-w-0", children: [
87
91
  b && /* @__PURE__ */ e("div", { className: "bear-font-semibold bear-mb-0.5", children: b }),
88
- /* @__PURE__ */ e("div", { className: "bear-text-sm bear-opacity-90", children: n })
92
+ /* @__PURE__ */ e("div", { className: "bear-text-sm bear-opacity-90", children: i })
89
93
  ] }),
90
- h && /* @__PURE__ */ e("div", { className: "bear-flex-shrink-0", children: h }),
91
- l && /* @__PURE__ */ e(
94
+ d && /* @__PURE__ */ e("div", { className: "bear-flex-shrink-0", children: d }),
95
+ c && /* @__PURE__ */ e(
92
96
  "button",
93
97
  {
94
98
  type: "button",
95
- onClick: p,
99
+ onClick: r,
96
100
  className: "bear-flex-shrink-0 bear-p-1 bear-rounded hover:bear-bg-white/20 bear-transition-colors bear-bg-transparent bear-border-none bear-cursor-pointer",
97
101
  "aria-label": "Close",
98
- children: /* @__PURE__ */ e(_, {})
102
+ children: /* @__PURE__ */ e(B, {})
99
103
  }
100
104
  )
101
105
  ]
102
106
  }
103
107
  );
104
- }, L = ({
105
- position: n = "top-right",
108
+ }, P = ({
109
+ position: i = "top-right",
106
110
  maxToasts: b = 5,
107
- className: d
111
+ className: h
108
112
  }) => {
109
- const o = y(w);
113
+ const o = T(w);
110
114
  if (!o) return null;
111
- const { _toasts: l, _removeToast: t } = o, h = l.slice(0, b);
115
+ const { _toasts: c, _removeToast: t } = o, d = c.slice(0, b);
112
116
  return /* @__PURE__ */ e(
113
117
  "div",
114
118
  {
115
- className: k(
116
- "bear-fixed bear-z-50 bear-flex bear-flex-col bear-gap-2",
117
- W[n],
118
- d
119
+ className: I(
120
+ "bear-fixed bear-z-[11000] bear-flex bear-flex-col bear-gap-2",
121
+ C[i],
122
+ h
119
123
  ),
120
- children: h.map((a) => /* @__PURE__ */ e(
121
- C,
124
+ children: d.map((s) => /* @__PURE__ */ e(
125
+ L,
122
126
  {
123
- ...a,
124
- onRemove: () => t(a.id)
127
+ ...s,
128
+ onRemove: () => t(s.id)
125
129
  },
126
- a.id
130
+ s.id
127
131
  ))
128
132
  }
129
133
  );
130
- }, M = ({
131
- children: n,
134
+ }, O = ({
135
+ children: i,
132
136
  position: b = "top-right"
133
137
  }) => {
134
- const [d, o] = T([]), l = i((r) => {
135
- o((s) => s.filter((v) => v.id !== r));
136
- }, []), t = i((r) => {
137
- const s = r.id || E();
138
- return o((v) => [...v, { ...r, id: s }]), s;
139
- }, []), h = i((r) => t(r), [t]), a = i((r, s) => t({ message: r, severity: "success", ...s }), [t]), x = i((r, s) => t({ message: r, severity: "info", ...s }), [t]), f = i((r, s) => t({ message: r, severity: "warning", ...s }), [t]), g = i((r, s) => t({ message: r, severity: "error", ...s }), [t]), m = i((r) => l(r), [l]), p = i(() => o([]), []), u = {
140
- toast: h,
141
- success: a,
138
+ const [h, o] = k([]), c = n((r) => {
139
+ o((a) => a.filter((f) => f.id !== r));
140
+ }, []), t = n((r) => {
141
+ const a = r.id || S();
142
+ return o((f) => [...f, { ...r, id: a }]), a;
143
+ }, []), d = n((r) => t(r), [t]), s = n((r, a) => t({ message: r, severity: "success", ...a }), [t]), x = n((r, a) => t({ message: r, severity: "info", ...a }), [t]), p = n((r, a) => t({ message: r, severity: "warning", ...a }), [t]), m = n((r, a) => t({ message: r, severity: "error", ...a }), [t]), v = n((r) => c(r), [c]), g = n(() => o([]), []), u = {
144
+ toast: d,
145
+ success: s,
142
146
  info: x,
143
- warning: f,
144
- error: g,
145
- dismiss: m,
146
- dismissAll: p,
147
- _toasts: d,
148
- _removeToast: l
147
+ warning: p,
148
+ error: m,
149
+ dismiss: v,
150
+ dismissAll: g,
151
+ _toasts: h,
152
+ _removeToast: c
149
153
  };
150
- return /* @__PURE__ */ c(w.Provider, { value: u, children: [
151
- n,
152
- /* @__PURE__ */ e(L, { position: b })
154
+ return /* @__PURE__ */ l(w.Provider, { value: u, children: [
155
+ i,
156
+ /* @__PURE__ */ e(P, { position: b })
153
157
  ] });
154
158
  };
155
159
  export {
156
- L as ToastContainer,
157
- M as ToastProvider,
158
- z as useToast
160
+ P as ToastContainer,
161
+ O as ToastProvider,
162
+ M as useToast
159
163
  };
@@ -22,6 +22,8 @@ export interface ToastProps {
22
22
  onClose?: () => void;
23
23
  /** Additional CSS class */
24
24
  className?: string;
25
+ /** Scroll the toast into view when it appears */
26
+ autoScroll?: boolean;
25
27
  }
26
28
  export interface ToastContainerProps {
27
29
  /** Position of toast container */
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),r=require("react"),j=require("react-dom"),k=require("../../utils/cn.cjs"),v=({content:m,children:x,position:w,placement:R,delay:y=200,className:T,disabled:M=!1})=>{const c=R||w||"top",[l,d]=r.useState(!1),[b,B]=r.useState({x:0,y:0}),u=r.useRef(null),h=r.useRef(null),n=r.useRef(),f=r.useCallback(()=>{if(!u.current||!h.current)return;const e=u.current.getBoundingClientRect(),t=h.current.getBoundingClientRect(),s=8;let o=0,i=0;switch(c){case"top":o=e.left+(e.width-t.width)/2,i=e.top-t.height-s;break;case"bottom":o=e.left+(e.width-t.width)/2,i=e.bottom+s;break;case"left":o=e.left-t.width-s,i=e.top+(e.height-t.height)/2;break;case"right":o=e.right+s,i=e.top+(e.height-t.height)/2;break}o=Math.max(8,Math.min(o,window.innerWidth-t.width-8)),i=Math.max(8,Math.min(i,window.innerHeight-t.height-8)),B({x:o,y:i})},[c]),g=()=>{M||(n.current=setTimeout(()=>{d(!0)},y))},p=()=>{n.current&&clearTimeout(n.current),d(!1)};return r.useEffect(()=>{l&&f()},[l,f]),r.useEffect(()=>()=>{n.current&&clearTimeout(n.current)},[]),a.jsxs(a.Fragment,{children:[a.jsx("div",{ref:u,onMouseEnter:g,onMouseLeave:p,onFocus:g,onBlur:p,className:"Bear-Tooltip__trigger bear-inline-block",children:x}),l&&j.createPortal(a.jsx("div",{ref:h,role:"tooltip",style:{left:b.x,top:b.y},className:k.cn("bear-fixed bear-z-[9999]","Bear-Tooltip",`Bear-Tooltip--${c}`,"bear-px-3 bear-py-2 bear-rounded-lg","bear-bg-gray-800 bear-text-white bear-text-sm","bear-border bear-border-gray-700","bear-shadow-lg","bear-animate-in bear-fade-in bear-duration-150",T),children:a.jsx("span",{className:"Bear-Tooltip__content",children:m})}),document.body)]})};exports.Tooltip=v;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),t=require("react"),M=require("react-dom"),B=require("../../utils/cn.cjs"),j=({content:p,children:w,position:x,placement:R,delay:v=200,className:y,disabled:T=!1})=>{const u=R||x||"top",[i,b]=t.useState(!1),[f,E]=t.useState({x:0,y:0}),d=t.useRef(null),h=t.useRef(null),s=t.useRef(),c=t.useCallback(()=>{if(!d.current||!h.current)return;const e=d.current.getBoundingClientRect(),r=h.current.getBoundingClientRect(),l=8;let o=0,n=0;switch(u){case"top":o=e.left+(e.width-r.width)/2,n=e.top-r.height-l;break;case"bottom":o=e.left+(e.width-r.width)/2,n=e.bottom+l;break;case"left":o=e.left-r.width-l,n=e.top+(e.height-r.height)/2;break;case"right":o=e.right+l,n=e.top+(e.height-r.height)/2;break}o=Math.max(8,Math.min(o,window.innerWidth-r.width-8)),n=Math.max(8,Math.min(n,window.innerHeight-r.height-8)),E({x:o,y:n})},[u]),g=()=>{T||(s.current=setTimeout(()=>{b(!0)},v))},m=()=>{s.current&&clearTimeout(s.current),b(!1)};return t.useEffect(()=>{i&&c()},[i,c]),t.useEffect(()=>{if(!i)return;const e=()=>{requestAnimationFrame(()=>c())};return e(),window.addEventListener("resize",e),window.addEventListener("scroll",e,!0),()=>{window.removeEventListener("resize",e),window.removeEventListener("scroll",e,!0)}},[i,c]),t.useEffect(()=>()=>{s.current&&clearTimeout(s.current)},[]),a.jsxs(a.Fragment,{children:[a.jsx("div",{ref:d,onMouseEnter:g,onMouseLeave:m,onFocus:g,onBlur:m,className:"Bear-Tooltip__trigger bear-inline-block",children:w}),i&&M.createPortal(a.jsx("div",{ref:h,role:"tooltip",style:{left:f.x,top:f.y},className:B.cn("bear-fixed bear-z-[11000]","Bear-Tooltip",`Bear-Tooltip--${u}`,"bear-px-3 bear-py-2 bear-rounded-lg","bear-bg-gray-800 bear-text-white bear-text-sm","bear-border bear-border-gray-700","bear-shadow-lg","bear-animate-in bear-fade-in bear-duration-150",y),children:a.jsx("span",{className:"Bear-Tooltip__content",children:p})}),document.body)]})};exports.Tooltip=j;
@@ -1,81 +1,89 @@
1
- import { jsxs as C, Fragment as _, jsx as u } from "react/jsx-runtime";
2
- import { useState as m, useRef as h, useCallback as E, useEffect as w } from "react";
3
- import { createPortal as N } from "react-dom";
4
- import { cn as j } from "../../utils/cn.js";
5
- const z = ({
1
+ import { jsxs as k, Fragment as L, jsx as d } from "react/jsx-runtime";
2
+ import { useState as w, useRef as h, useCallback as C, useEffect as b } from "react";
3
+ import { createPortal as _ } from "react-dom";
4
+ import { cn as z } from "../../utils/cn.js";
5
+ const V = ({
6
6
  content: x,
7
- children: y,
8
- position: M,
9
- placement: R,
10
- delay: T = 200,
11
- className: B,
12
- disabled: k = !1
7
+ children: v,
8
+ position: y,
9
+ placement: M,
10
+ delay: R = 200,
11
+ className: T,
12
+ disabled: B = !1
13
13
  }) => {
14
- const a = R || M || "top", [s, d] = m(!1), [b, v] = m({ x: 0, y: 0 }), c = h(null), l = h(null), i = h(), f = E(() => {
15
- if (!c.current || !l.current) return;
16
- const e = c.current.getBoundingClientRect(), t = l.current.getBoundingClientRect(), n = 8;
14
+ const c = M || y || "top", [i, m] = w(!1), [f, E] = w({ x: 0, y: 0 }), l = h(null), u = h(null), n = h(), a = C(() => {
15
+ if (!l.current || !u.current) return;
16
+ const e = l.current.getBoundingClientRect(), t = u.current.getBoundingClientRect(), s = 8;
17
17
  let r = 0, o = 0;
18
- switch (a) {
18
+ switch (c) {
19
19
  case "top":
20
- r = e.left + (e.width - t.width) / 2, o = e.top - t.height - n;
20
+ r = e.left + (e.width - t.width) / 2, o = e.top - t.height - s;
21
21
  break;
22
22
  case "bottom":
23
- r = e.left + (e.width - t.width) / 2, o = e.bottom + n;
23
+ r = e.left + (e.width - t.width) / 2, o = e.bottom + s;
24
24
  break;
25
25
  case "left":
26
- r = e.left - t.width - n, o = e.top + (e.height - t.height) / 2;
26
+ r = e.left - t.width - s, o = e.top + (e.height - t.height) / 2;
27
27
  break;
28
28
  case "right":
29
- r = e.right + n, o = e.top + (e.height - t.height) / 2;
29
+ r = e.right + s, o = e.top + (e.height - t.height) / 2;
30
30
  break;
31
31
  }
32
- r = Math.max(8, Math.min(r, window.innerWidth - t.width - 8)), o = Math.max(8, Math.min(o, window.innerHeight - t.height - 8)), v({ x: r, y: o });
33
- }, [a]), g = () => {
34
- k || (i.current = setTimeout(() => {
35
- d(!0);
36
- }, T));
32
+ r = Math.max(8, Math.min(r, window.innerWidth - t.width - 8)), o = Math.max(8, Math.min(o, window.innerHeight - t.height - 8)), E({ x: r, y: o });
33
+ }, [c]), g = () => {
34
+ B || (n.current = setTimeout(() => {
35
+ m(!0);
36
+ }, R));
37
37
  }, p = () => {
38
- i.current && clearTimeout(i.current), d(!1);
38
+ n.current && clearTimeout(n.current), m(!1);
39
39
  };
40
- return w(() => {
41
- s && f();
42
- }, [s, f]), w(() => () => {
43
- i.current && clearTimeout(i.current);
44
- }, []), /* @__PURE__ */ C(_, { children: [
45
- /* @__PURE__ */ u(
40
+ return b(() => {
41
+ i && a();
42
+ }, [i, a]), b(() => {
43
+ if (!i) return;
44
+ const e = () => {
45
+ requestAnimationFrame(() => a());
46
+ };
47
+ return e(), window.addEventListener("resize", e), window.addEventListener("scroll", e, !0), () => {
48
+ window.removeEventListener("resize", e), window.removeEventListener("scroll", e, !0);
49
+ };
50
+ }, [i, a]), b(() => () => {
51
+ n.current && clearTimeout(n.current);
52
+ }, []), /* @__PURE__ */ k(L, { children: [
53
+ /* @__PURE__ */ d(
46
54
  "div",
47
55
  {
48
- ref: c,
56
+ ref: l,
49
57
  onMouseEnter: g,
50
58
  onMouseLeave: p,
51
59
  onFocus: g,
52
60
  onBlur: p,
53
61
  className: "Bear-Tooltip__trigger bear-inline-block",
54
- children: y
62
+ children: v
55
63
  }
56
64
  ),
57
- s && N(
58
- /* @__PURE__ */ u(
65
+ i && _(
66
+ /* @__PURE__ */ d(
59
67
  "div",
60
68
  {
61
- ref: l,
69
+ ref: u,
62
70
  role: "tooltip",
63
71
  style: {
64
- left: b.x,
65
- top: b.y
72
+ left: f.x,
73
+ top: f.y
66
74
  },
67
- className: j(
68
- "bear-fixed bear-z-[9999]",
75
+ className: z(
76
+ "bear-fixed bear-z-[11000]",
69
77
  "Bear-Tooltip",
70
- `Bear-Tooltip--${a}`,
78
+ `Bear-Tooltip--${c}`,
71
79
  "bear-px-3 bear-py-2 bear-rounded-lg",
72
80
  "bear-bg-gray-800 bear-text-white bear-text-sm",
73
81
  "bear-border bear-border-gray-700",
74
82
  "bear-shadow-lg",
75
83
  "bear-animate-in bear-fade-in bear-duration-150",
76
- B
84
+ T
77
85
  ),
78
- children: /* @__PURE__ */ u("span", { className: "Bear-Tooltip__content", children: x })
86
+ children: /* @__PURE__ */ d("span", { className: "Bear-Tooltip__content", children: x })
79
87
  }
80
88
  ),
81
89
  document.body
@@ -83,5 +91,5 @@ const z = ({
83
91
  ] });
84
92
  };
85
93
  export {
86
- z as Tooltip
94
+ V as Tooltip
87
95
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),n=require("react"),m=require("../../utils/cn.cjs"),a=require("./TreeSelect.const.cjs"),E=require("./TreeSelect.utils.cjs"),_=({node:s,depth:c,selected:o,expanded:t,multiple:i,onToggleExpand:h,onSelect:p})=>{const d=s.children&&s.children.length>0,f=t.has(s.id),S=o.has(s.id);return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:m.cn(a.NODE_CLASSES,S&&a.NODE_SELECTED_CLASSES,s.disabled&&a.NODE_DISABLED_CLASSES),style:{paddingLeft:c*a.INDENT_PX+12},onClick:()=>!s.disabled&&p(s.id),role:"treeitem","aria-selected":S,"aria-expanded":d?f:void 0,children:[d?e.jsx("svg",{className:m.cn(a.CHEVRON_CLASSES,f&&"bear-rotate-90"),onClick:x=>{x.stopPropagation(),h(s.id)},fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})}):e.jsx("span",{className:"bear-w-4 bear-mr-1"}),i&&e.jsx("span",{className:m.cn("bear-w-4 bear-h-4 bear-mr-2 bear-border bear-rounded bear-flex bear-items-center bear-justify-center bear-text-xs",S?"bear-bg-pink-500 bear-border-pink-500 bear-text-white":"bear-border-gray-300 dark:bear-border-zinc-600"),children:S&&"✓"}),s.icon&&e.jsx("span",{className:"bear-mr-1.5",children:s.icon}),e.jsx("span",{className:"bear-truncate",children:s.label})]}),d&&f&&s.children.map(x=>e.jsx(_,{node:x,depth:c+1,selected:o,expanded:t,multiple:i,onToggleExpand:h,onSelect:p},x.id))]})},z=s=>{const{nodes:c,value:o,onChange:t,multiple:i=!1,label:h,placeholder:p="Select…",disabled:d=!1,clearable:f=!0,searchable:S=!0,expandAll:x=!1,size:g="md",error:N,helperText:v,maxHeight:w=a.DEFAULT_MAX_HEIGHT,className:R,testId:T,...O}=s,[j,A]=n.useState(!1),[L,C]=n.useState(""),y=n.useRef(null),I=n.useMemo(()=>E.collectAllIds(c),[c]),[D,B]=n.useState(()=>x?I:new Set),b=n.useMemo(()=>o?new Set(Array.isArray(o)?o:[o]):new Set,[o]);n.useEffect(()=>{const r=l=>{y.current&&!y.current.contains(l.target)&&(A(!1),C(""))};return document.addEventListener("mousedown",r),()=>document.removeEventListener("mousedown",r)},[]);const H=n.useCallback(r=>{B(l=>{const u=new Set(l);return u.has(r)?u.delete(r):u.add(r),u})},[]),M=n.useCallback(r=>{if(i){const l=new Set(b);l.has(r)?l.delete(r):l.add(r),t==null||t(Array.from(l))}else t==null||t(r),A(!1),C("")},[i,b,t]),P=n.useCallback(()=>{t==null||t(i?[]:"")},[i,t]),k=L?E.filterNodes(c,L):c,q=()=>{if(b.size===0)return e.jsx("span",{className:"bear-text-gray-400 dark:bear-text-zinc-500",children:p});if(i)return e.jsx("div",{className:"bear-flex bear-flex-wrap bear-gap-1",children:Array.from(b).map(l=>{const u=E.findNodeById(c,l);return u?e.jsx("span",{className:a.TAG_CLASSES,children:u.label},l):null})});const r=E.findNodeById(c,Array.from(b)[0]);return(r==null?void 0:r.label)??p};return e.jsxs("div",{ref:y,className:m.cn(a.ROOT_CLASSES,R),"data-testid":T,...O,children:[h&&e.jsx("label",{className:a.LABEL_CLASSES,children:h}),e.jsxs("button",{type:"button",disabled:d,onClick:()=>!d&&A(!j),className:m.cn(a.TRIGGER_CLASSES,a.SIZE_CLASSES[g],d&&"bear-opacity-50 bear-cursor-not-allowed"),children:[e.jsx("span",{className:"bear-flex-1 bear-text-left bear-truncate",children:q()}),e.jsxs("div",{className:"bear-flex bear-items-center bear-gap-1",children:[f&&b.size>0&&e.jsx("span",{className:"bear-text-gray-400 hover:bear-text-gray-600 bear-cursor-pointer",onClick:r=>{r.stopPropagation(),P()},children:"✕"}),e.jsx("svg",{className:m.cn("bear-w-4 bear-h-4 bear-text-gray-400 bear-transition-transform",j&&"bear-rotate-180"),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})]}),j&&e.jsxs("div",{className:a.DROPDOWN_CLASSES,children:[S&&e.jsx("input",{className:a.SEARCH_CLASSES,placeholder:"Search…",value:L,onChange:r=>C(r.target.value),autoFocus:!0}),e.jsx("div",{style:{maxHeight:w},className:"bear-overflow-y-auto",role:"tree",children:k.length>0?k.map(r=>e.jsx(_,{node:r,depth:0,selected:b,expanded:D,multiple:i,onToggleExpand:H,onSelect:M},r.id)):e.jsx("div",{className:"bear-py-6 bear-text-center bear-text-sm bear-text-gray-400",children:"No results"})})]}),N&&e.jsx("p",{className:a.ERROR_CLASSES,children:N}),!N&&v&&e.jsx("p",{className:a.HELPER_CLASSES,children:v})]})};exports.TreeSelect=z;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),l=require("react"),x=require("../../utils/cn.cjs"),Z=require("../Portal/Portal.cjs"),s=require("./TreeSelect.const.cjs"),N=require("./TreeSelect.utils.cjs"),U=1e4,I=({node:a,depth:i,selected:d,expanded:n,multiple:o,onToggleExpand:f,onSelect:p})=>{const u=a.children&&a.children.length>0,E=n.has(a.id),h=d.has(a.id);return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:x.cn(s.NODE_CLASSES,h&&s.NODE_SELECTED_CLASSES,a.disabled&&s.NODE_DISABLED_CLASSES),style:{paddingLeft:i*s.INDENT_PX+12},onClick:()=>!a.disabled&&p(a.id),role:"treeitem","aria-selected":h,"aria-expanded":u?E:void 0,children:[u?e.jsx("svg",{className:x.cn(s.CHEVRON_CLASSES,E&&"bear-rotate-90"),onClick:m=>{m.stopPropagation(),f(a.id)},fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})}):e.jsx("span",{className:"bear-w-4 bear-mr-1"}),o&&e.jsx("span",{className:x.cn("bear-w-4 bear-h-4 bear-mr-2 bear-border bear-rounded bear-flex bear-items-center bear-justify-center bear-text-xs",h?"bear-bg-pink-500 bear-border-pink-500 bear-text-white":"bear-border-gray-300 dark:bear-border-zinc-600"),children:h&&"✓"}),a.icon&&e.jsx("span",{className:"bear-mr-1.5",children:a.icon}),e.jsx("span",{className:"bear-truncate",children:a.label})]}),u&&E&&a.children.map(m=>e.jsx(I,{node:m,depth:i+1,selected:d,expanded:n,multiple:o,onToggleExpand:f,onSelect:p},m.id))]})},J=a=>{const{nodes:i,value:d,onChange:n,multiple:o=!1,label:f,placeholder:p="Select…",disabled:u=!1,clearable:E=!0,searchable:h=!0,expandAll:m=!1,size:O="md",error:w,helperText:C,maxHeight:P=s.DEFAULT_MAX_HEIGHT,className:D,testId:M,...z}=a,[b,j]=l.useState(!1),[L,v]=l.useState(""),y=l.useRef(null),_=l.useRef(null),g=l.useRef(null),[A,B]=l.useState({top:0,left:0,width:0}),q=l.useMemo(()=>N.collectAllIds(i),[i]),[H,G]=l.useState(()=>m?q:new Set),S=l.useMemo(()=>d?new Set(Array.isArray(d)?d:[d]):new Set,[d]);l.useEffect(()=>{if(!b)return;const r=()=>{var c;const t=(c=_.current)==null?void 0:c.getBoundingClientRect();t&&B({top:t.bottom+4,left:Math.max(8,Math.min(t.left,window.innerWidth-t.width-8)),width:t.width})};return r(),window.addEventListener("resize",r),window.addEventListener("scroll",r,!0),()=>{window.removeEventListener("resize",r),window.removeEventListener("scroll",r,!0)}},[b]),l.useEffect(()=>{if(!b)return;const r=t=>{var k,T;const c=t.target;(k=y.current)!=null&&k.contains(c)||(T=g.current)!=null&&T.contains(c)||(j(!1),v(""))};return document.addEventListener("mousedown",r),()=>document.removeEventListener("mousedown",r)},[b]);const W=l.useCallback(r=>{G(t=>{const c=new Set(t);return c.has(r)?c.delete(r):c.add(r),c})},[]),F=l.useCallback(r=>{if(o){const t=new Set(S);t.has(r)?t.delete(r):t.add(r),n==null||n(Array.from(t))}else n==null||n(r),j(!1),v("")},[o,S,n]),V=l.useCallback(()=>{n==null||n(o?[]:"")},[o,n]),R=L?N.filterNodes(i,L):i,X=()=>{if(S.size===0)return e.jsx("span",{className:"bear-text-gray-400 dark:bear-text-zinc-500",children:p});if(o)return e.jsx("div",{className:"bear-flex bear-flex-wrap bear-gap-1",children:Array.from(S).map(t=>{const c=N.findNodeById(i,t);return c?e.jsx("span",{className:s.TAG_CLASSES,children:c.label},t):null})});const r=N.findNodeById(i,Array.from(S)[0]);return(r==null?void 0:r.label)??p};return e.jsxs("div",{ref:y,className:x.cn(s.ROOT_CLASSES,D),"data-testid":M,...z,children:[f&&e.jsx("label",{className:s.LABEL_CLASSES,children:f}),e.jsxs("button",{ref:_,type:"button",disabled:u,onClick:()=>!u&&j(!b),className:x.cn(s.TRIGGER_CLASSES,s.SIZE_CLASSES[O],u&&"bear-opacity-50 bear-cursor-not-allowed"),children:[e.jsx("span",{className:"bear-flex-1 bear-text-left bear-truncate",children:X()}),e.jsxs("div",{className:"bear-flex bear-items-center bear-gap-1",children:[E&&S.size>0&&e.jsx("span",{className:"bear-text-gray-400 hover:bear-text-gray-600 bear-cursor-pointer",onClick:r=>{r.stopPropagation(),V()},children:"✕"}),e.jsx("svg",{className:x.cn("bear-w-4 bear-h-4 bear-text-gray-400 bear-transition-transform",b&&"bear-rotate-180"),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})]}),b&&e.jsx(Z.Portal,{children:e.jsxs("div",{ref:g,className:x.cn(s.DROPDOWN_CLASSES,"bear-fixed"),style:{top:A.top,left:A.left,width:A.width,zIndex:U},children:[h&&e.jsx("input",{className:s.SEARCH_CLASSES,placeholder:"Search…",value:L,onChange:r=>v(r.target.value),autoFocus:!0}),e.jsx("div",{style:{maxHeight:P},className:"bear-overflow-y-auto",role:"tree",children:R.length>0?R.map(r=>e.jsx(I,{node:r,depth:0,selected:S,expanded:H,multiple:o,onToggleExpand:W,onSelect:F},r.id)):e.jsx("div",{className:"bear-py-6 bear-text-center bear-text-sm bear-text-gray-400",children:"No results"})})]})}),w&&e.jsx("p",{className:s.ERROR_CLASSES,children:w}),!w&&C&&e.jsx("p",{className:s.HELPER_CLASSES,children:C})]})};exports.TreeSelect=J;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=280,r=20,a={sm:"bear-py-1.5 bear-px-3 bear-text-sm",md:"bear-py-2 bear-px-4 bear-text-base",lg:"bear-py-2.5 bear-px-5 bear-text-lg"},b="Bear-TreeSelect bear-relative bear-inline-block bear-w-full",t="bear-w-full bear-flex bear-items-center bear-justify-between bear-rounded-lg bear-border bear-border-gray-300 dark:bear-border-zinc-600 bear-bg-white dark:bear-bg-zinc-800 bear-text-gray-900 dark:bear-text-white bear-transition-colors focus:bear-ring-2 focus:bear-ring-pink-500 bear-outline-none",S="bear-absolute bear-z-[9999] bear-w-full bear-mt-1 bear-bg-white dark:bear-bg-zinc-800 bear-border bear-border-gray-200 dark:bear-border-zinc-700 bear-rounded-xl bear-shadow-xl bear-overflow-hidden",n="bear-w-full bear-px-3 bear-py-2 bear-text-sm bear-bg-transparent bear-border-b bear-border-gray-200 dark:bear-border-zinc-700 bear-outline-none bear-text-gray-900 dark:bear-text-white",o="bear-flex bear-items-center bear-py-1.5 bear-px-3 bear-cursor-pointer bear-transition-colors hover:bear-bg-gray-50 dark:hover:bear-bg-zinc-700 bear-text-sm bear-text-gray-700 dark:bear-text-zinc-300",E="bear-bg-pink-50 dark:bear-bg-pink-900/20 bear-text-pink-700 dark:bear-text-pink-300",i="bear-opacity-40 bear-cursor-not-allowed",s="bear-w-4 bear-h-4 bear-mr-1 bear-text-gray-400 dark:bear-text-zinc-500 bear-transition-transform bear-cursor-pointer",c="bear-inline-flex bear-items-center bear-gap-1 bear-bg-pink-100 dark:bear-bg-pink-900/30 bear-text-pink-700 dark:bear-text-pink-300 bear-rounded bear-px-1.5 bear-py-0.5 bear-text-xs",d="Bear-TreeSelect__label bear-block bear-text-sm bear-font-medium bear-text-gray-700 dark:bear-text-zinc-300 bear-mb-1.5",x="bear-mt-1 bear-text-xs bear-text-red-500",A="bear-mt-1 bear-text-xs bear-text-gray-500 dark:bear-text-zinc-500";exports.CHEVRON_CLASSES=s;exports.DEFAULT_MAX_HEIGHT=e;exports.DROPDOWN_CLASSES=S;exports.ERROR_CLASSES=x;exports.HELPER_CLASSES=A;exports.INDENT_PX=r;exports.LABEL_CLASSES=d;exports.NODE_CLASSES=o;exports.NODE_DISABLED_CLASSES=i;exports.NODE_SELECTED_CLASSES=E;exports.ROOT_CLASSES=b;exports.SEARCH_CLASSES=n;exports.SIZE_CLASSES=a;exports.TAG_CLASSES=c;exports.TRIGGER_CLASSES=t;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=280,r=20,a={sm:"bear-py-1.5 bear-px-3 bear-text-sm",md:"bear-py-2 bear-px-4 bear-text-base",lg:"bear-py-2.5 bear-px-5 bear-text-lg"},b="Bear-TreeSelect bear-relative bear-inline-block bear-w-full",t="bear-w-full bear-flex bear-items-center bear-justify-between bear-rounded-lg bear-border bear-border-gray-300 dark:bear-border-zinc-600 bear-bg-white dark:bear-bg-zinc-800 bear-text-gray-900 dark:bear-text-white bear-transition-colors focus:bear-ring-2 focus:bear-ring-pink-500 bear-outline-none",S="bear-bg-white dark:bear-bg-zinc-800 bear-border bear-border-gray-200 dark:bear-border-zinc-700 bear-rounded-xl bear-shadow-xl bear-overflow-hidden",n="bear-w-full bear-px-3 bear-py-2 bear-text-sm bear-bg-transparent bear-border-b bear-border-gray-200 dark:bear-border-zinc-700 bear-outline-none bear-text-gray-900 dark:bear-text-white",E="bear-flex bear-items-center bear-py-1.5 bear-px-3 bear-cursor-pointer bear-transition-colors hover:bear-bg-gray-50 dark:hover:bear-bg-zinc-700 bear-text-sm bear-text-gray-700 dark:bear-text-zinc-300",o="bear-bg-pink-50 dark:bear-bg-pink-900/20 bear-text-pink-700 dark:bear-text-pink-300",i="bear-opacity-40 bear-cursor-not-allowed",s="bear-w-4 bear-h-4 bear-mr-1 bear-text-gray-400 dark:bear-text-zinc-500 bear-transition-transform bear-cursor-pointer",c="bear-inline-flex bear-items-center bear-gap-1 bear-bg-pink-100 dark:bear-bg-pink-900/30 bear-text-pink-700 dark:bear-text-pink-300 bear-rounded bear-px-1.5 bear-py-0.5 bear-text-xs",d="Bear-TreeSelect__label bear-block bear-text-sm bear-font-medium bear-text-gray-700 dark:bear-text-zinc-300 bear-mb-1.5",x="bear-mt-1 bear-text-xs bear-text-red-500",A="bear-mt-1 bear-text-xs bear-text-gray-500 dark:bear-text-zinc-500";exports.CHEVRON_CLASSES=s;exports.DEFAULT_MAX_HEIGHT=e;exports.DROPDOWN_CLASSES=S;exports.ERROR_CLASSES=x;exports.HELPER_CLASSES=A;exports.INDENT_PX=r;exports.LABEL_CLASSES=d;exports.NODE_CLASSES=E;exports.NODE_DISABLED_CLASSES=i;exports.NODE_SELECTED_CLASSES=o;exports.ROOT_CLASSES=b;exports.SEARCH_CLASSES=n;exports.SIZE_CLASSES=a;exports.TAG_CLASSES=c;exports.TRIGGER_CLASSES=t;
@@ -7,7 +7,7 @@ export declare const SIZE_CLASSES: {
7
7
  };
8
8
  export declare const ROOT_CLASSES = "Bear-TreeSelect bear-relative bear-inline-block bear-w-full";
9
9
  export declare const TRIGGER_CLASSES = "bear-w-full bear-flex bear-items-center bear-justify-between bear-rounded-lg bear-border bear-border-gray-300 dark:bear-border-zinc-600 bear-bg-white dark:bear-bg-zinc-800 bear-text-gray-900 dark:bear-text-white bear-transition-colors focus:bear-ring-2 focus:bear-ring-pink-500 bear-outline-none";
10
- export declare const DROPDOWN_CLASSES = "bear-absolute bear-z-[9999] bear-w-full bear-mt-1 bear-bg-white dark:bear-bg-zinc-800 bear-border bear-border-gray-200 dark:bear-border-zinc-700 bear-rounded-xl bear-shadow-xl bear-overflow-hidden";
10
+ export declare const DROPDOWN_CLASSES = "bear-bg-white dark:bear-bg-zinc-800 bear-border bear-border-gray-200 dark:bear-border-zinc-700 bear-rounded-xl bear-shadow-xl bear-overflow-hidden";
11
11
  export declare const SEARCH_CLASSES = "bear-w-full bear-px-3 bear-py-2 bear-text-sm bear-bg-transparent bear-border-b bear-border-gray-200 dark:bear-border-zinc-700 bear-outline-none bear-text-gray-900 dark:bear-text-white";
12
12
  export declare const NODE_CLASSES = "bear-flex bear-items-center bear-py-1.5 bear-px-3 bear-cursor-pointer bear-transition-colors hover:bear-bg-gray-50 dark:hover:bear-bg-zinc-700 bear-text-sm bear-text-gray-700 dark:bear-text-zinc-300";
13
13
  export declare const NODE_SELECTED_CLASSES = "bear-bg-pink-50 dark:bear-bg-pink-900/20 bear-text-pink-700 dark:bear-text-pink-300";
@@ -2,13 +2,13 @@ const e = 280, r = 20, a = {
2
2
  sm: "bear-py-1.5 bear-px-3 bear-text-sm",
3
3
  md: "bear-py-2 bear-px-4 bear-text-base",
4
4
  lg: "bear-py-2.5 bear-px-5 bear-text-lg"
5
- }, b = "Bear-TreeSelect bear-relative bear-inline-block bear-w-full", t = "bear-w-full bear-flex bear-items-center bear-justify-between bear-rounded-lg bear-border bear-border-gray-300 dark:bear-border-zinc-600 bear-bg-white dark:bear-bg-zinc-800 bear-text-gray-900 dark:bear-text-white bear-transition-colors focus:bear-ring-2 focus:bear-ring-pink-500 bear-outline-none", n = "bear-absolute bear-z-[9999] bear-w-full bear-mt-1 bear-bg-white dark:bear-bg-zinc-800 bear-border bear-border-gray-200 dark:bear-border-zinc-700 bear-rounded-xl bear-shadow-xl bear-overflow-hidden", o = "bear-w-full bear-px-3 bear-py-2 bear-text-sm bear-bg-transparent bear-border-b bear-border-gray-200 dark:bear-border-zinc-700 bear-outline-none bear-text-gray-900 dark:bear-text-white", i = "bear-flex bear-items-center bear-py-1.5 bear-px-3 bear-cursor-pointer bear-transition-colors hover:bear-bg-gray-50 dark:hover:bear-bg-zinc-700 bear-text-sm bear-text-gray-700 dark:bear-text-zinc-300", S = "bear-bg-pink-50 dark:bear-bg-pink-900/20 bear-text-pink-700 dark:bear-text-pink-300", s = "bear-opacity-40 bear-cursor-not-allowed", x = "bear-w-4 bear-h-4 bear-mr-1 bear-text-gray-400 dark:bear-text-zinc-500 bear-transition-transform bear-cursor-pointer", c = "bear-inline-flex bear-items-center bear-gap-1 bear-bg-pink-100 dark:bear-bg-pink-900/30 bear-text-pink-700 dark:bear-text-pink-300 bear-rounded bear-px-1.5 bear-py-0.5 bear-text-xs", d = "Bear-TreeSelect__label bear-block bear-text-sm bear-font-medium bear-text-gray-700 dark:bear-text-zinc-300 bear-mb-1.5", l = "bear-mt-1 bear-text-xs bear-text-red-500", E = "bear-mt-1 bear-text-xs bear-text-gray-500 dark:bear-text-zinc-500";
5
+ }, b = "Bear-TreeSelect bear-relative bear-inline-block bear-w-full", t = "bear-w-full bear-flex bear-items-center bear-justify-between bear-rounded-lg bear-border bear-border-gray-300 dark:bear-border-zinc-600 bear-bg-white dark:bear-bg-zinc-800 bear-text-gray-900 dark:bear-text-white bear-transition-colors focus:bear-ring-2 focus:bear-ring-pink-500 bear-outline-none", n = "bear-bg-white dark:bear-bg-zinc-800 bear-border bear-border-gray-200 dark:bear-border-zinc-700 bear-rounded-xl bear-shadow-xl bear-overflow-hidden", o = "bear-w-full bear-px-3 bear-py-2 bear-text-sm bear-bg-transparent bear-border-b bear-border-gray-200 dark:bear-border-zinc-700 bear-outline-none bear-text-gray-900 dark:bear-text-white", i = "bear-flex bear-items-center bear-py-1.5 bear-px-3 bear-cursor-pointer bear-transition-colors hover:bear-bg-gray-50 dark:hover:bear-bg-zinc-700 bear-text-sm bear-text-gray-700 dark:bear-text-zinc-300", S = "bear-bg-pink-50 dark:bear-bg-pink-900/20 bear-text-pink-700 dark:bear-text-pink-300", s = "bear-opacity-40 bear-cursor-not-allowed", x = "bear-w-4 bear-h-4 bear-mr-1 bear-text-gray-400 dark:bear-text-zinc-500 bear-transition-transform bear-cursor-pointer", c = "bear-inline-flex bear-items-center bear-gap-1 bear-bg-pink-100 dark:bear-bg-pink-900/30 bear-text-pink-700 dark:bear-text-pink-300 bear-rounded bear-px-1.5 bear-py-0.5 bear-text-xs", d = "Bear-TreeSelect__label bear-block bear-text-sm bear-font-medium bear-text-gray-700 dark:bear-text-zinc-300 bear-mb-1.5", E = "bear-mt-1 bear-text-xs bear-text-red-500", l = "bear-mt-1 bear-text-xs bear-text-gray-500 dark:bear-text-zinc-500";
6
6
  export {
7
7
  x as CHEVRON_CLASSES,
8
8
  e as DEFAULT_MAX_HEIGHT,
9
9
  n as DROPDOWN_CLASSES,
10
- l as ERROR_CLASSES,
11
- E as HELPER_CLASSES,
10
+ E as ERROR_CLASSES,
11
+ l as HELPER_CLASSES,
12
12
  r as INDENT_PX,
13
13
  d as LABEL_CLASSES,
14
14
  i as NODE_CLASSES,