@forgedevstack/bear 1.2.0 → 1.2.1

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 (178) hide show
  1. package/README.md +4 -0
  2. package/dist/components/Autocomplete/Autocomplete.cjs +1 -1
  3. package/dist/components/Autocomplete/Autocomplete.const.cjs +1 -0
  4. package/dist/components/Autocomplete/Autocomplete.const.d.ts +1 -0
  5. package/dist/components/Autocomplete/Autocomplete.const.js +4 -0
  6. package/dist/components/Autocomplete/Autocomplete.js +110 -72
  7. package/dist/components/BottomSheet/BottomSheet.cjs +1 -1
  8. package/dist/components/BottomSheet/BottomSheet.js +74 -53
  9. package/dist/components/BottomSheet/BottomSheet.types.d.ts +2 -0
  10. package/dist/components/Breadcrumbs/Breadcrumbs.cjs +1 -1
  11. package/dist/components/Breadcrumbs/Breadcrumbs.js +126 -46
  12. package/dist/components/Breadcrumbs/Breadcrumbs.types.d.ts +11 -4
  13. package/dist/components/Breadcrumbs/index.d.ts +1 -1
  14. package/dist/components/Cascader/Cascader.cjs +1 -1
  15. package/dist/components/Cascader/Cascader.const.cjs +1 -1
  16. package/dist/components/Cascader/Cascader.const.d.ts +1 -1
  17. package/dist/components/Cascader/Cascader.const.js +1 -1
  18. package/dist/components/Cascader/Cascader.js +109 -146
  19. package/dist/components/Cascader/components/CascaderPanel/CascaderPanel.cjs +1 -0
  20. package/dist/components/Cascader/components/CascaderPanel/CascaderPanel.d.ts +3 -0
  21. package/dist/components/Cascader/components/CascaderPanel/CascaderPanel.js +50 -0
  22. package/dist/components/Cascader/components/CascaderPanel/index.d.ts +1 -0
  23. package/dist/components/Chart/BarChart.cjs +1 -0
  24. package/dist/components/Chart/BarChart.d.ts +3 -0
  25. package/dist/components/Chart/BarChart.js +65 -0
  26. package/dist/components/Chart/Chart.cjs +1 -1
  27. package/dist/components/Chart/Chart.const.cjs +1 -1
  28. package/dist/components/Chart/Chart.const.d.ts +7 -0
  29. package/dist/components/Chart/Chart.const.js +12 -2
  30. package/dist/components/Chart/Chart.d.ts +1 -13
  31. package/dist/components/Chart/Chart.js +18 -204
  32. package/dist/components/Chart/Chart.types.d.ts +7 -1
  33. package/dist/components/Chart/LineChart.cjs +1 -0
  34. package/dist/components/Chart/LineChart.d.ts +3 -0
  35. package/dist/components/Chart/LineChart.js +73 -0
  36. package/dist/components/Chart/PieChart.cjs +1 -0
  37. package/dist/components/Chart/PieChart.d.ts +3 -0
  38. package/dist/components/Chart/PieChart.js +110 -0
  39. package/dist/components/Chart/index.d.ts +4 -1
  40. package/dist/components/ColorPicker/ColorPicker.cjs +1 -1
  41. package/dist/components/ColorPicker/ColorPicker.const.cjs +1 -1
  42. package/dist/components/ColorPicker/ColorPicker.const.d.ts +4 -2
  43. package/dist/components/ColorPicker/ColorPicker.const.js +8 -6
  44. package/dist/components/ColorPicker/ColorPicker.js +135 -73
  45. package/dist/components/ColorPicker/ColorPicker.utils.cjs +1 -0
  46. package/dist/components/ColorPicker/ColorPicker.utils.d.ts +17 -0
  47. package/dist/components/ColorPicker/ColorPicker.utils.js +43 -0
  48. package/dist/components/CountdownTimer/CountdownTimer.cjs +1 -1
  49. package/dist/components/CountdownTimer/CountdownTimer.const.cjs +1 -1
  50. package/dist/components/CountdownTimer/CountdownTimer.const.d.ts +2 -0
  51. package/dist/components/CountdownTimer/CountdownTimer.const.js +29 -17
  52. package/dist/components/CountdownTimer/CountdownTimer.js +91 -61
  53. package/dist/components/CountdownTimer/CountdownTimer.types.d.ts +11 -2
  54. package/dist/components/CreditInput/CreditInput.cjs +1 -1
  55. package/dist/components/CreditInput/CreditInput.js +80 -78
  56. package/dist/components/DateRangePicker/DateRangePicker.cjs +1 -1
  57. package/dist/components/DateRangePicker/DateRangePicker.js +89 -84
  58. package/dist/components/DiffSquares/DiffSquares.cjs +1 -0
  59. package/dist/components/DiffSquares/DiffSquares.const.cjs +1 -0
  60. package/dist/components/DiffSquares/DiffSquares.const.d.ts +3 -0
  61. package/dist/components/DiffSquares/DiffSquares.const.js +6 -0
  62. package/dist/components/DiffSquares/DiffSquares.d.ts +3 -0
  63. package/dist/components/DiffSquares/DiffSquares.js +70 -0
  64. package/dist/components/DiffSquares/DiffSquares.types.d.ts +23 -0
  65. package/dist/components/DiffSquares/DiffSquares.utils.cjs +1 -0
  66. package/dist/components/DiffSquares/DiffSquares.utils.d.ts +3 -0
  67. package/dist/components/DiffSquares/DiffSquares.utils.js +12 -0
  68. package/dist/components/DiffSquares/index.d.ts +2 -0
  69. package/dist/components/Drawer/Drawer.cjs +1 -1
  70. package/dist/components/Drawer/Drawer.js +41 -41
  71. package/dist/components/Dropdown/Dropdown.cjs +1 -1
  72. package/dist/components/Dropdown/Dropdown.const.cjs +1 -0
  73. package/dist/components/Dropdown/Dropdown.const.d.ts +7 -0
  74. package/dist/components/Dropdown/Dropdown.const.js +10 -0
  75. package/dist/components/Dropdown/Dropdown.d.ts +0 -1
  76. package/dist/components/Dropdown/Dropdown.js +102 -92
  77. package/dist/components/Dropdown/Dropdown.types.d.ts +2 -0
  78. package/dist/components/Gauge/Gauge.cjs +1 -1
  79. package/dist/components/Gauge/Gauge.js +61 -50
  80. package/dist/components/Gauge/Gauge.types.d.ts +2 -0
  81. package/dist/components/HoverCard/HoverCard.cjs +6 -6
  82. package/dist/components/HoverCard/HoverCard.js +72 -54
  83. package/dist/components/Icon/icons/status.js +1 -1
  84. package/dist/components/MentionsInput/MentionsInput.cjs +1 -1
  85. package/dist/components/MentionsInput/MentionsInput.js +106 -83
  86. package/dist/components/Menu/Menu.cjs +1 -1
  87. package/dist/components/Menu/Menu.js +91 -80
  88. package/dist/components/Modal/Modal.cjs +1 -1
  89. package/dist/components/Modal/Modal.const.cjs +1 -1
  90. package/dist/components/Modal/Modal.const.d.ts +1 -1
  91. package/dist/components/Modal/Modal.const.js +1 -1
  92. package/dist/components/Modal/Modal.js +50 -44
  93. package/dist/components/Modal/Modal.types.d.ts +6 -0
  94. package/dist/components/MultiSelect/MultiSelect.cjs +1 -1
  95. package/dist/components/MultiSelect/MultiSelect.js +123 -78
  96. package/dist/components/NavigableSelect/NavigableSelect.cjs +1 -1
  97. package/dist/components/NavigableSelect/NavigableSelect.const.cjs +1 -1
  98. package/dist/components/NavigableSelect/NavigableSelect.const.d.ts +1 -1
  99. package/dist/components/NavigableSelect/NavigableSelect.const.js +1 -1
  100. package/dist/components/NavigableSelect/NavigableSelect.js +167 -143
  101. package/dist/components/NotificationCenter/NotificationCenter.cjs +1 -1
  102. package/dist/components/NotificationCenter/NotificationCenter.const.cjs +1 -1
  103. package/dist/components/NotificationCenter/NotificationCenter.const.d.ts +1 -1
  104. package/dist/components/NotificationCenter/NotificationCenter.const.js +1 -1
  105. package/dist/components/NotificationCenter/NotificationCenter.js +87 -81
  106. package/dist/components/OTPInput/OTPInput.cjs +1 -1
  107. package/dist/components/OTPInput/OTPInput.const.cjs +1 -0
  108. package/dist/components/OTPInput/OTPInput.const.d.ts +6 -0
  109. package/dist/components/OTPInput/OTPInput.const.js +14 -0
  110. package/dist/components/OTPInput/OTPInput.js +99 -65
  111. package/dist/components/OTPInput/OTPInput.types.d.ts +7 -0
  112. package/dist/components/PhoneInput/PhoneInput.cjs +1 -1
  113. package/dist/components/PhoneInput/PhoneInput.const.cjs +1 -1
  114. package/dist/components/PhoneInput/PhoneInput.const.d.ts +1 -1
  115. package/dist/components/PhoneInput/PhoneInput.const.js +1 -1
  116. package/dist/components/PhoneInput/PhoneInput.js +88 -83
  117. package/dist/components/Popconfirm/Popconfirm.cjs +1 -1
  118. package/dist/components/Popconfirm/Popconfirm.const.cjs +1 -1
  119. package/dist/components/Popconfirm/Popconfirm.const.d.ts +1 -3
  120. package/dist/components/Popconfirm/Popconfirm.const.js +12 -18
  121. package/dist/components/Popconfirm/Popconfirm.js +71 -51
  122. package/dist/components/Popover/Popover.cjs +1 -1
  123. package/dist/components/Popover/Popover.js +36 -31
  124. package/dist/components/Portal/Portal.cjs +1 -1
  125. package/dist/components/Portal/Portal.d.ts +0 -3
  126. package/dist/components/Portal/Portal.js +4 -10
  127. package/dist/components/Select/Select.cjs +1 -1
  128. package/dist/components/Select/Select.js +71 -51
  129. package/dist/components/Stepper/Stepper.cjs +1 -1
  130. package/dist/components/Stepper/Stepper.const.cjs +1 -1
  131. package/dist/components/Stepper/Stepper.const.d.ts +3 -2
  132. package/dist/components/Stepper/Stepper.const.js +15 -14
  133. package/dist/components/Stepper/Stepper.d.ts +0 -7
  134. package/dist/components/Stepper/Stepper.js +164 -117
  135. package/dist/components/Stepper/Stepper.types.d.ts +3 -0
  136. package/dist/components/Tabs/TabList.cjs +1 -1
  137. package/dist/components/Tabs/TabList.js +72 -57
  138. package/dist/components/Tabs/Tabs.types.d.ts +4 -2
  139. package/dist/components/Tabs/index.d.ts +2 -2
  140. package/dist/components/TimePicker/components/TimePickerDialDropdown/TimePickerDialDropdown.cjs +1 -1
  141. package/dist/components/TimePicker/components/TimePickerDialDropdown/TimePickerDialDropdown.js +26 -26
  142. package/dist/components/TimePicker/helpers/ClockFaceSvg.cjs +1 -1
  143. package/dist/components/TimePicker/helpers/ClockFaceSvg.js +17 -17
  144. package/dist/components/Toast/Toast.cjs +1 -1
  145. package/dist/components/Toast/Toast.js +86 -82
  146. package/dist/components/Toast/Toast.types.d.ts +2 -0
  147. package/dist/components/Tooltip/Tooltip.cjs +1 -1
  148. package/dist/components/Tooltip/Tooltip.js +52 -44
  149. package/dist/components/TreeSelect/TreeSelect.cjs +1 -1
  150. package/dist/components/TreeSelect/TreeSelect.const.cjs +1 -1
  151. package/dist/components/TreeSelect/TreeSelect.const.d.ts +1 -1
  152. package/dist/components/TreeSelect/TreeSelect.const.js +3 -3
  153. package/dist/components/TreeSelect/TreeSelect.js +120 -88
  154. package/dist/components/Watermark/Watermark.cjs +1 -1
  155. package/dist/components/Watermark/Watermark.const.cjs +1 -1
  156. package/dist/components/Watermark/Watermark.const.d.ts +6 -3
  157. package/dist/components/Watermark/Watermark.const.js +13 -11
  158. package/dist/components/Watermark/Watermark.js +87 -61
  159. package/dist/components/Watermark/Watermark.types.d.ts +2 -0
  160. package/dist/components/index.cjs +1 -1
  161. package/dist/components/index.d.ts +5 -3
  162. package/dist/components/index.js +292 -286
  163. package/dist/hooks/index.cjs +1 -1
  164. package/dist/hooks/index.d.ts +1 -1
  165. package/dist/hooks/index.js +55 -54
  166. package/dist/hooks/useClickOutside.cjs +1 -1
  167. package/dist/hooks/useClickOutside.d.ts +4 -11
  168. package/dist/hooks/useClickOutside.js +26 -7
  169. package/dist/index.cjs +1 -1
  170. package/dist/index.js +386 -379
  171. package/dist/styles/_effects.css +17 -0
  172. package/dist/styles.css +1 -1
  173. package/dist/utils/maxVisible.utils.cjs +1 -0
  174. package/dist/utils/maxVisible.utils.d.ts +12 -0
  175. package/dist/utils/maxVisible.utils.js +15 -0
  176. package/package.json +1 -1
  177. package/dist/components/HoverCard/HoverCard.utils.cjs +0 -1
  178. package/dist/components/HoverCard/HoverCard.utils.js +0 -23
@@ -1,48 +1,54 @@
1
- import { jsxs as d, jsx as a } from "react/jsx-runtime";
2
- import { useCallback as b, useEffect as f } from "react";
3
- import { createPortal as M } from "react-dom";
1
+ import { jsxs as t, jsx as o } from "react/jsx-runtime";
2
+ import { useCallback as h, useEffect as p } from "react";
3
+ import { createPortal as v } from "react-dom";
4
4
  import { cn as e } from "../../utils/cn.js";
5
- import { CloseIcon as O } from "../Icon/icons/navigation.js";
6
- import { MODAL_BACKDROP_CLASSES as h, MODAL_TITLE_CLASSES as p, MODAL_CLOSE_CLASSES as v, MODAL_HEADER_CLASSES as B, MODAL_BODY_CLASSES as N, MODAL_FOOTER_CLASSES as y, MODAL_SIZE_CLASSES as D, MODAL_CONTAINER_CLASSES as k } from "./Modal.const.js";
7
- const z = (c) => {
5
+ import { CloseIcon as k } from "../Icon/icons/navigation.js";
6
+ import { MODAL_BACKDROP_CLASSES as y, MODAL_TITLE_CLASSES as N, MODAL_CLOSE_CLASSES as D, MODAL_HEADER_CLASSES as w, MODAL_BODY_CLASSES as x, MODAL_FOOTER_CLASSES as I, MODAL_SIZE_CLASSES as R, MODAL_CONTAINER_CLASSES as T } from "./Modal.const.js";
7
+ const K = (_) => {
8
8
  const {
9
9
  isOpen: l,
10
- onClose: o,
10
+ onClose: a,
11
11
  title: r,
12
- children: m,
13
- size: _ = "md",
14
- showCloseButton: s = !0,
15
- closeOnBackdrop: S = !0,
16
- closeOnEscape: i = !0,
17
- className: E,
12
+ children: S,
13
+ size: u = "md",
14
+ showCloseButton: c = !0,
15
+ closeOnEscape: s = !0,
16
+ lockBodyScroll: C = !0,
17
+ cancelPreventScroll: E = !1,
18
+ closeOnBackdrop: L = !0,
19
+ isCancelBackgroundClick: i,
20
+ className: f,
18
21
  footer: n,
19
- testId: L,
20
- id: u
21
- } = c, t = b(
22
- (C) => {
23
- i && C.key === "Escape" && o();
22
+ testId: b,
23
+ id: A
24
+ } = _, m = C && !E, M = i !== void 0 ? i : L, d = h(
25
+ (B) => {
26
+ s && B.key === "Escape" && a();
24
27
  },
25
- [i, o]
28
+ [s, a]
26
29
  );
27
- if (f(() => (l && (document.addEventListener("keydown", t), document.body.style.overflow = "hidden"), () => {
28
- document.removeEventListener("keydown", t), document.body.style.overflow = "";
29
- }), [l, t]), !l) return null;
30
- const A = /* @__PURE__ */ d(
30
+ if (p(() => {
31
+ if (l)
32
+ return document.addEventListener("keydown", d), m && (document.body.style.overflow = "hidden"), () => {
33
+ document.removeEventListener("keydown", d), document.body.style.overflow = "";
34
+ };
35
+ }, [l, d, m]), !l) return null;
36
+ const O = /* @__PURE__ */ t(
31
37
  "div",
32
38
  {
33
- className: "Bear-Modal bear-fixed bear-inset-0 bear-z-50 bear-flex bear-items-center bear-justify-center",
34
- id: u,
35
- "data-testid": L,
39
+ className: "Bear-Modal bear-fixed bear-inset-0 bear-z-[11000] bear-flex bear-items-center bear-justify-center bear-p-4",
40
+ id: A,
41
+ "data-testid": b,
36
42
  children: [
37
- /* @__PURE__ */ a(
43
+ /* @__PURE__ */ o(
38
44
  "div",
39
45
  {
40
- className: e("Bear-Modal__backdrop", h),
41
- onClick: S ? o : void 0,
46
+ className: e("Bear-Modal__backdrop", y),
47
+ onClick: M ? a : void 0,
42
48
  "aria-hidden": "true"
43
49
  }
44
50
  ),
45
- /* @__PURE__ */ d(
51
+ /* @__PURE__ */ t(
46
52
  "div",
47
53
  {
48
54
  role: "dialog",
@@ -50,40 +56,40 @@ const z = (c) => {
50
56
  "aria-labelledby": r ? "modal-title" : void 0,
51
57
  className: e(
52
58
  "Bear-Modal__container",
53
- k,
54
- D[_],
55
- E
59
+ T,
60
+ R[u],
61
+ f
56
62
  ),
57
63
  children: [
58
- (r || s) && /* @__PURE__ */ d("div", { className: e("Bear-Modal__header", B), children: [
59
- r && /* @__PURE__ */ a(
64
+ (r || c) && /* @__PURE__ */ t("div", { className: e("Bear-Modal__header", w), children: [
65
+ r && /* @__PURE__ */ o(
60
66
  "h2",
61
67
  {
62
68
  id: "modal-title",
63
- className: e("Bear-Modal__title", p),
69
+ className: e("Bear-Modal__title", N),
64
70
  children: r
65
71
  }
66
72
  ),
67
- s && /* @__PURE__ */ a(
73
+ c && /* @__PURE__ */ o(
68
74
  "button",
69
75
  {
70
- onClick: o,
71
- className: e("Bear-Modal__close", v),
76
+ onClick: a,
77
+ className: e("Bear-Modal__close", D),
72
78
  "aria-label": "Close modal",
73
- children: /* @__PURE__ */ a(O, { className: "bear-w-5 bear-h-5" })
79
+ children: /* @__PURE__ */ o(k, { className: "bear-w-5 bear-h-5" })
74
80
  }
75
81
  )
76
82
  ] }),
77
- /* @__PURE__ */ a("div", { className: e("Bear-Modal__body", N), children: m }),
78
- n && /* @__PURE__ */ a("div", { className: e("Bear-Modal__footer", y), children: n })
83
+ /* @__PURE__ */ o("div", { className: e("Bear-Modal__body", x), children: S }),
84
+ n && /* @__PURE__ */ o("div", { className: e("Bear-Modal__footer", I), children: n })
79
85
  ]
80
86
  }
81
87
  )
82
88
  ]
83
89
  }
84
90
  );
85
- return M(A, document.body);
91
+ return v(O, document.body);
86
92
  };
87
93
  export {
88
- z as Modal
94
+ K as Modal
89
95
  };
@@ -17,6 +17,12 @@ export interface ModalProps {
17
17
  closeOnBackdrop?: boolean;
18
18
  /** Whether pressing Escape closes modal */
19
19
  closeOnEscape?: boolean;
20
+ /** When false, the document body scroll is not locked while open */
21
+ lockBodyScroll?: boolean;
22
+ /** When true, the page behind the modal stays scrollable (same as lockBodyScroll: false) */
23
+ cancelPreventScroll?: boolean;
24
+ /** When provided, sets whether clicking the backdrop closes the modal (overrides closeOnBackdrop) */
25
+ isCancelBackgroundClick?: boolean;
20
26
  /** Additional class names for content */
21
27
  className?: string;
22
28
  /** Footer content */
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),l=require("react"),i=require("../../utils/cn.cjs"),z=({options:p,value:w,defaultValue:R=[],onChange:s,placeholder:S="Select options...",label:k,helperText:v,error:u,disabled:b=!1,maxSelections:d,searchable:E=!0,className:O,testId:M})=>{const[f,o]=l.useState(!1),[m,g]=l.useState(""),[V,j]=l.useState(R),x=l.useRef(null),h=l.useRef(null),y=w!==void 0,a=y?w:V;l.useEffect(()=>{const e=r=>{x.current&&!x.current.contains(r.target)&&(o(!1),g(""))};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);const c=p.filter(e=>e.label.toLowerCase().includes(m.toLowerCase())&&!a.includes(e.value)),N=e=>{var n;if(b||d&&a.length>=d)return;const r=[...a,e];y||j(r),s==null||s(r),g(""),(n=h.current)==null||n.focus()},L=e=>{if(b)return;const r=a.filter(n=>n!==e);y||j(r),s==null||s(r)},q=e=>{e.key==="Backspace"&&m===""&&a.length>0&&L(a[a.length-1]),e.key==="Escape"&&(o(!1),g("")),e.key==="Enter"&&c.length>0&&(e.preventDefault(),N(c[0].value))},D=a.map(e=>{var r;return((r=p.find(n=>n.value===e))==null?void 0:r.label)||e});return t.jsxs("div",{className:i.cn("bear-w-full",O),ref:x,"data-testid":M,children:[k&&t.jsx("label",{className:"bear-block bear-text-sm bear-font-medium bear-text-gray-700 dark:bear-text-gray-200 bear-mb-1.5",children:k}),t.jsxs("div",{className:i.cn("bear-relative bear-flex bear-flex-wrap bear-items-center bear-gap-1.5 bear-min-h-[42px] bear-px-3 bear-py-2","bear-rounded-lg bear-border bear-bg-white dark:bear-bg-gray-900","bear-transition-colors bear-cursor-text",u?"bear-border-red-500 focus-within:bear-ring-2 focus-within:bear-ring-red-500/20":"bear-border-gray-300 dark:bear-border-gray-600 focus-within:bear-border-amber-500 focus-within:bear-ring-2 focus-within:bear-ring-amber-500/20",b&&"bear-opacity-50 bear-cursor-not-allowed bear-bg-gray-100 dark:bear-bg-gray-800"),onClick:()=>{var e;b||(o(!0),(e=h.current)==null||e.focus())},children:[D.map((e,r)=>t.jsxs("span",{className:"bear-inline-flex bear-items-center bear-gap-1 bear-px-2 bear-py-0.5 bear-text-sm bear-rounded-md bear-bg-amber-100 dark:bear-bg-amber-900/30 bear-text-amber-800 dark:bear-text-amber-200",children:[e,!b&&t.jsx("button",{type:"button",onClick:n=>{n.stopPropagation(),L(a[r])},className:"bear-ml-0.5 bear-text-amber-600 hover:bear-text-amber-800 dark:bear-text-amber-400 dark:hover:bear-text-amber-200",children:"×"})]},a[r])),E&&!b&&t.jsx("input",{ref:h,type:"text",value:m,onChange:e=>{g(e.target.value),o(!0)},onFocus:()=>o(!0),onKeyDown:q,placeholder:a.length===0?S:"",disabled:b||d!==void 0&&a.length>=d,className:"bear-flex-1 bear-min-w-[80px] bear-bg-transparent bear-outline-none bear-text-sm bear-text-gray-900 dark:bear-text-white placeholder:bear-text-gray-400"}),t.jsx("svg",{className:i.cn("bear-w-4 bear-h-4 bear-text-gray-400 bear-transition-transform bear-ml-auto",f&&"bear-rotate-180"),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),f&&!b&&c.length>0&&t.jsx("div",{className:"bear-absolute bear-z-50 bear-w-full bear-mt-1 bear-py-1 bear-bg-white dark:bear-bg-gray-800 bear-border bear-border-gray-200 dark:bear-border-gray-700 bear-rounded-lg bear-shadow-lg bear-max-h-60 bear-overflow-auto",children:c.map(e=>t.jsx("button",{type:"button",disabled:e.disabled,onClick:()=>N(e.value),className:i.cn("bear-w-full bear-px-3 bear-py-2 bear-text-left bear-text-sm","hover:bear-bg-amber-50 dark:hover:bear-bg-amber-900/20","bear-text-gray-900 dark:bear-text-white",e.disabled&&"bear-opacity-50 bear-cursor-not-allowed"),children:e.label},e.value))}),f&&!b&&c.length===0&&m&&t.jsx("div",{className:"bear-absolute bear-z-50 bear-w-full bear-mt-1 bear-py-3 bear-px-4 bear-bg-white dark:bear-bg-gray-800 bear-border bear-border-gray-200 dark:bear-border-gray-700 bear-rounded-lg bear-shadow-lg bear-text-sm bear-text-gray-500",children:"No options found"}),(v||u)&&t.jsx("p",{className:i.cn("bear-mt-1.5 bear-text-xs",u?"bear-text-red-500":"bear-text-gray-500 dark:bear-text-gray-400"),children:u||v})]})};exports.MultiSelect=z;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),s=require("react"),u=require("../../utils/cn.cjs"),q=require("../Portal/Portal.cjs"),z=1e4,F=({options:k,value:j,defaultValue:B=[],onChange:o,placeholder:V="Select options...",label:E,helperText:L,error:f,disabled:b=!1,maxSelections:m,searchable:D=!0,className:_,testId:C})=>{const[i,c]=s.useState(!1),[x,h]=s.useState(""),[K,N]=s.useState(B),R=s.useRef(null),P=s.useRef(null),g=s.useRef(null),w=s.useRef(null),[l,T]=s.useState({top:0,left:0,width:0}),p=j!==void 0,n=p?j:K,d=k.filter(e=>e.label.toLowerCase().includes(x.toLowerCase())&&!n.includes(e.value)),y=i&&!b&&d.length>0,v=i&&!b&&d.length===0&&!!x;s.useEffect(()=>{if(!y&&!v)return;const e=()=>{var t;const r=(t=P.current)==null?void 0:t.getBoundingClientRect();r&&T({top:r.bottom+4,left:Math.max(8,Math.min(r.left,window.innerWidth-r.width-8)),width:Math.max(r.width,160)})};return e(),window.addEventListener("resize",e),window.addEventListener("scroll",e,!0),()=>{window.removeEventListener("resize",e),window.removeEventListener("scroll",e,!0)}},[y,v]),s.useEffect(()=>{if(!i)return;const e=r=>{var O,I;const t=r.target;(O=R.current)!=null&&O.contains(t)||(I=g.current)!=null&&I.contains(t)||(c(!1),h(""))};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[i]);const M=e=>{var t;if(b||m&&n.length>=m)return;const r=[...n,e];p||N(r),o==null||o(r),h(""),(t=w.current)==null||t.focus()},S=e=>{if(b)return;const r=n.filter(t=>t!==e);p||N(r),o==null||o(r)},W=e=>{e.key==="Backspace"&&x===""&&n.length>0&&S(n[n.length-1]),e.key==="Escape"&&(c(!1),h("")),e.key==="Enter"&&d.length>0&&(e.preventDefault(),M(d[0].value))},A=n.map(e=>{var r;return((r=k.find(t=>t.value===e))==null?void 0:r.label)||e});return a.jsxs("div",{className:u.cn("bear-w-full",_),ref:R,"data-testid":C,children:[E&&a.jsx("label",{className:"bear-block bear-text-sm bear-font-medium bear-text-gray-700 dark:bear-text-gray-200 bear-mb-1.5",children:E}),a.jsxs("div",{ref:P,className:u.cn("bear-relative bear-flex bear-flex-wrap bear-items-center bear-gap-1.5 bear-min-h-[42px] bear-px-3 bear-py-2","bear-rounded-lg bear-border bear-bg-white dark:bear-bg-gray-900","bear-transition-colors bear-cursor-text",f?"bear-border-red-500 focus-within:bear-ring-2 focus-within:bear-ring-red-500/20":"bear-border-gray-300 dark:bear-border-gray-600 focus-within:bear-border-amber-500 focus-within:bear-ring-2 focus-within:bear-ring-amber-500/20",b&&"bear-opacity-50 bear-cursor-not-allowed bear-bg-gray-100 dark:bear-bg-gray-800"),onClick:()=>{var e;b||(c(!0),(e=w.current)==null||e.focus())},children:[A.map((e,r)=>a.jsxs("span",{className:"bear-inline-flex bear-items-center bear-gap-1 bear-px-2 bear-py-0.5 bear-text-sm bear-rounded-md bear-bg-amber-100 dark:bear-bg-amber-900/30 bear-text-amber-800 dark:bear-text-amber-200",children:[e,!b&&a.jsx("button",{type:"button",onClick:t=>{t.stopPropagation(),S(n[r])},className:"bear-ml-0.5 bear-text-amber-600 hover:bear-text-amber-800 dark:bear-text-amber-400 dark:hover:bear-text-amber-200",children:"×"})]},n[r])),D&&!b&&a.jsx("input",{ref:w,type:"text",value:x,onChange:e=>{h(e.target.value),c(!0)},onFocus:()=>c(!0),onKeyDown:W,placeholder:n.length===0?V:"",disabled:b||m!==void 0&&n.length>=m,className:"bear-flex-1 bear-min-w-[80px] bear-bg-transparent bear-outline-none bear-text-sm bear-text-gray-900 dark:bear-text-white placeholder:bear-text-gray-400"}),a.jsx("svg",{className:u.cn("bear-w-4 bear-h-4 bear-text-gray-400 bear-transition-transform bear-ml-auto",i&&"bear-rotate-180"),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),y&&a.jsx(q.Portal,{children:a.jsx("div",{ref:g,className:"bear-fixed bear-py-1 bear-bg-white dark:bear-bg-gray-800 bear-border bear-border-gray-200 dark:bear-border-gray-700 bear-rounded-lg bear-shadow-lg bear-max-h-60 bear-overflow-auto",style:{top:l.top,left:l.left,width:l.width,zIndex:z},children:d.map(e=>a.jsx("button",{type:"button",disabled:e.disabled,onClick:()=>M(e.value),className:u.cn("bear-w-full bear-px-3 bear-py-2 bear-text-left bear-text-sm","hover:bear-bg-amber-50 dark:hover:bear-bg-amber-900/20","bear-text-gray-900 dark:bear-text-white",e.disabled&&"bear-opacity-50 bear-cursor-not-allowed"),children:e.label},e.value))})}),v&&a.jsx(q.Portal,{children:a.jsx("div",{ref:g,className:"bear-fixed bear-py-3 bear-px-4 bear-bg-white dark:bear-bg-gray-800 bear-border bear-border-gray-200 dark:bear-border-gray-700 bear-rounded-lg bear-shadow-lg bear-text-sm bear-text-gray-500",style:{top:l.top,left:l.left,width:l.width,zIndex:z},children:"No options found"})}),(L||f)&&a.jsx("p",{className:u.cn("bear-mt-1.5 bear-text-xs",f?"bear-text-red-500":"bear-text-gray-500 dark:bear-text-gray-400"),children:f||L})]})};exports.MultiSelect=F;
@@ -1,76 +1,95 @@
1
- import { jsxs as x, jsx as b } from "react/jsx-runtime";
2
- import { useState as y, useRef as R, useEffect as S } from "react";
3
- import { cn as i } from "../../utils/cn.js";
4
- const q = ({
5
- options: w,
6
- value: k,
7
- defaultValue: V = [],
8
- onChange: l,
9
- placeholder: j = "Select options...",
10
- label: v,
11
- helperText: N,
12
- error: c,
13
- disabled: t = !1,
14
- maxSelections: d,
15
- searchable: D = !0,
16
- className: z,
17
- testId: B
1
+ import { jsxs as L, jsx as n } from "react/jsx-runtime";
2
+ import { useState as g, useRef as p, useEffect as D } from "react";
3
+ import { cn as c } from "../../utils/cn.js";
4
+ import { Portal as S } from "../Portal/Portal.js";
5
+ const _ = 1e4, X = ({
6
+ options: E,
7
+ value: N,
8
+ defaultValue: C = [],
9
+ onChange: b,
10
+ placeholder: K = "Select options...",
11
+ label: P,
12
+ helperText: M,
13
+ error: u,
14
+ disabled: o = !1,
15
+ maxSelections: f,
16
+ searchable: W = !0,
17
+ className: A,
18
+ testId: F
18
19
  }) => {
19
- const [f, o] = y(!1), [u, m] = y(""), [I, L] = y(V), g = R(null), h = R(null), p = k !== void 0, a = p ? k : I;
20
- S(() => {
20
+ const [s, i] = g(!1), [m, h] = g(""), [T, R] = g(C), I = p(null), O = p(null), w = p(null), x = p(null), [l, U] = g({ top: 0, left: 0, width: 0 }), y = N !== void 0, a = y ? N : T, d = E.filter(
21
+ (e) => e.label.toLowerCase().includes(m.toLowerCase()) && !a.includes(e.value)
22
+ ), v = s && !o && d.length > 0, k = s && !o && d.length === 0 && !!m;
23
+ D(() => {
24
+ if (!v && !k) return;
25
+ const e = () => {
26
+ var t;
27
+ const r = (t = O.current) == null ? void 0 : t.getBoundingClientRect();
28
+ r && U({
29
+ top: r.bottom + 4,
30
+ left: Math.max(8, Math.min(r.left, window.innerWidth - r.width - 8)),
31
+ width: Math.max(r.width, 160)
32
+ });
33
+ };
34
+ return e(), window.addEventListener("resize", e), window.addEventListener("scroll", e, !0), () => {
35
+ window.removeEventListener("resize", e), window.removeEventListener("scroll", e, !0);
36
+ };
37
+ }, [v, k]), D(() => {
38
+ if (!s) return;
21
39
  const e = (r) => {
22
- g.current && !g.current.contains(r.target) && (o(!1), m(""));
40
+ var V, j;
41
+ const t = r.target;
42
+ (V = I.current) != null && V.contains(t) || (j = w.current) != null && j.contains(t) || (i(!1), h(""));
23
43
  };
24
44
  return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
25
- }, []);
26
- const s = w.filter(
27
- (e) => e.label.toLowerCase().includes(u.toLowerCase()) && !a.includes(e.value)
28
- ), E = (e) => {
29
- var n;
30
- if (t || d && a.length >= d) return;
45
+ }, [s]);
46
+ const z = (e) => {
47
+ var t;
48
+ if (o || f && a.length >= f) return;
31
49
  const r = [...a, e];
32
- p || L(r), l == null || l(r), m(""), (n = h.current) == null || n.focus();
33
- }, O = (e) => {
34
- if (t) return;
35
- const r = a.filter((n) => n !== e);
36
- p || L(r), l == null || l(r);
37
- }, K = (e) => {
38
- e.key === "Backspace" && u === "" && a.length > 0 && O(a[a.length - 1]), e.key === "Escape" && (o(!1), m("")), e.key === "Enter" && s.length > 0 && (e.preventDefault(), E(s[0].value));
39
- }, M = a.map(
50
+ y || R(r), b == null || b(r), h(""), (t = x.current) == null || t.focus();
51
+ }, B = (e) => {
52
+ if (o) return;
53
+ const r = a.filter((t) => t !== e);
54
+ y || R(r), b == null || b(r);
55
+ }, Z = (e) => {
56
+ e.key === "Backspace" && m === "" && a.length > 0 && B(a[a.length - 1]), e.key === "Escape" && (i(!1), h("")), e.key === "Enter" && d.length > 0 && (e.preventDefault(), z(d[0].value));
57
+ }, q = a.map(
40
58
  (e) => {
41
59
  var r;
42
- return ((r = w.find((n) => n.value === e)) == null ? void 0 : r.label) || e;
60
+ return ((r = E.find((t) => t.value === e)) == null ? void 0 : r.label) || e;
43
61
  }
44
62
  );
45
- return /* @__PURE__ */ x("div", { className: i("bear-w-full", z), ref: g, "data-testid": B, children: [
46
- v && /* @__PURE__ */ b("label", { className: "bear-block bear-text-sm bear-font-medium bear-text-gray-700 dark:bear-text-gray-200 bear-mb-1.5", children: v }),
47
- /* @__PURE__ */ x(
63
+ return /* @__PURE__ */ L("div", { className: c("bear-w-full", A), ref: I, "data-testid": F, children: [
64
+ P && /* @__PURE__ */ n("label", { className: "bear-block bear-text-sm bear-font-medium bear-text-gray-700 dark:bear-text-gray-200 bear-mb-1.5", children: P }),
65
+ /* @__PURE__ */ L(
48
66
  "div",
49
67
  {
50
- className: i(
68
+ ref: O,
69
+ className: c(
51
70
  "bear-relative bear-flex bear-flex-wrap bear-items-center bear-gap-1.5 bear-min-h-[42px] bear-px-3 bear-py-2",
52
71
  "bear-rounded-lg bear-border bear-bg-white dark:bear-bg-gray-900",
53
72
  "bear-transition-colors bear-cursor-text",
54
- c ? "bear-border-red-500 focus-within:bear-ring-2 focus-within:bear-ring-red-500/20" : "bear-border-gray-300 dark:bear-border-gray-600 focus-within:bear-border-amber-500 focus-within:bear-ring-2 focus-within:bear-ring-amber-500/20",
55
- t && "bear-opacity-50 bear-cursor-not-allowed bear-bg-gray-100 dark:bear-bg-gray-800"
73
+ u ? "bear-border-red-500 focus-within:bear-ring-2 focus-within:bear-ring-red-500/20" : "bear-border-gray-300 dark:bear-border-gray-600 focus-within:bear-border-amber-500 focus-within:bear-ring-2 focus-within:bear-ring-amber-500/20",
74
+ o && "bear-opacity-50 bear-cursor-not-allowed bear-bg-gray-100 dark:bear-bg-gray-800"
56
75
  ),
57
76
  onClick: () => {
58
77
  var e;
59
- t || (o(!0), (e = h.current) == null || e.focus());
78
+ o || (i(!0), (e = x.current) == null || e.focus());
60
79
  },
61
80
  children: [
62
- M.map((e, r) => /* @__PURE__ */ x(
81
+ q.map((e, r) => /* @__PURE__ */ L(
63
82
  "span",
64
83
  {
65
84
  className: "bear-inline-flex bear-items-center bear-gap-1 bear-px-2 bear-py-0.5 bear-text-sm bear-rounded-md bear-bg-amber-100 dark:bear-bg-amber-900/30 bear-text-amber-800 dark:bear-text-amber-200",
66
85
  children: [
67
86
  e,
68
- !t && /* @__PURE__ */ b(
87
+ !o && /* @__PURE__ */ n(
69
88
  "button",
70
89
  {
71
90
  type: "button",
72
- onClick: (n) => {
73
- n.stopPropagation(), O(a[r]);
91
+ onClick: (t) => {
92
+ t.stopPropagation(), B(a[r]);
74
93
  },
75
94
  className: "bear-ml-0.5 bear-text-amber-600 hover:bear-text-amber-800 dark:bear-text-amber-400 dark:hover:bear-text-amber-200",
76
95
  children: "×"
@@ -80,61 +99,87 @@ const q = ({
80
99
  },
81
100
  a[r]
82
101
  )),
83
- D && !t && /* @__PURE__ */ b(
102
+ W && !o && /* @__PURE__ */ n(
84
103
  "input",
85
104
  {
86
- ref: h,
105
+ ref: x,
87
106
  type: "text",
88
- value: u,
107
+ value: m,
89
108
  onChange: (e) => {
90
- m(e.target.value), o(!0);
109
+ h(e.target.value), i(!0);
91
110
  },
92
- onFocus: () => o(!0),
93
- onKeyDown: K,
94
- placeholder: a.length === 0 ? j : "",
95
- disabled: t || d !== void 0 && a.length >= d,
111
+ onFocus: () => i(!0),
112
+ onKeyDown: Z,
113
+ placeholder: a.length === 0 ? K : "",
114
+ disabled: o || f !== void 0 && a.length >= f,
96
115
  className: "bear-flex-1 bear-min-w-[80px] bear-bg-transparent bear-outline-none bear-text-sm bear-text-gray-900 dark:bear-text-white placeholder:bear-text-gray-400"
97
116
  }
98
117
  ),
99
- /* @__PURE__ */ b(
118
+ /* @__PURE__ */ n(
100
119
  "svg",
101
120
  {
102
- className: i(
121
+ className: c(
103
122
  "bear-w-4 bear-h-4 bear-text-gray-400 bear-transition-transform bear-ml-auto",
104
- f && "bear-rotate-180"
123
+ s && "bear-rotate-180"
105
124
  ),
106
125
  fill: "none",
107
126
  viewBox: "0 0 24 24",
108
127
  stroke: "currentColor",
109
- children: /* @__PURE__ */ b("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M19 9l-7 7-7-7" })
128
+ children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M19 9l-7 7-7-7" })
110
129
  }
111
130
  )
112
131
  ]
113
132
  }
114
133
  ),
115
- f && !t && s.length > 0 && /* @__PURE__ */ b("div", { className: "bear-absolute bear-z-50 bear-w-full bear-mt-1 bear-py-1 bear-bg-white dark:bear-bg-gray-800 bear-border bear-border-gray-200 dark:bear-border-gray-700 bear-rounded-lg bear-shadow-lg bear-max-h-60 bear-overflow-auto", children: s.map((e) => /* @__PURE__ */ b(
116
- "button",
134
+ v && /* @__PURE__ */ n(S, { children: /* @__PURE__ */ n(
135
+ "div",
117
136
  {
118
- type: "button",
119
- disabled: e.disabled,
120
- onClick: () => E(e.value),
121
- className: i(
122
- "bear-w-full bear-px-3 bear-py-2 bear-text-left bear-text-sm",
123
- "hover:bear-bg-amber-50 dark:hover:bear-bg-amber-900/20",
124
- "bear-text-gray-900 dark:bear-text-white",
125
- e.disabled && "bear-opacity-50 bear-cursor-not-allowed"
126
- ),
127
- children: e.label
128
- },
129
- e.value
130
- )) }),
131
- f && !t && s.length === 0 && u && /* @__PURE__ */ b("div", { className: "bear-absolute bear-z-50 bear-w-full bear-mt-1 bear-py-3 bear-px-4 bear-bg-white dark:bear-bg-gray-800 bear-border bear-border-gray-200 dark:bear-border-gray-700 bear-rounded-lg bear-shadow-lg bear-text-sm bear-text-gray-500", children: "No options found" }),
132
- (N || c) && /* @__PURE__ */ b("p", { className: i(
137
+ ref: w,
138
+ className: "bear-fixed bear-py-1 bear-bg-white dark:bear-bg-gray-800 bear-border bear-border-gray-200 dark:bear-border-gray-700 bear-rounded-lg bear-shadow-lg bear-max-h-60 bear-overflow-auto",
139
+ style: {
140
+ top: l.top,
141
+ left: l.left,
142
+ width: l.width,
143
+ zIndex: _
144
+ },
145
+ children: d.map((e) => /* @__PURE__ */ n(
146
+ "button",
147
+ {
148
+ type: "button",
149
+ disabled: e.disabled,
150
+ onClick: () => z(e.value),
151
+ className: c(
152
+ "bear-w-full bear-px-3 bear-py-2 bear-text-left bear-text-sm",
153
+ "hover:bear-bg-amber-50 dark:hover:bear-bg-amber-900/20",
154
+ "bear-text-gray-900 dark:bear-text-white",
155
+ e.disabled && "bear-opacity-50 bear-cursor-not-allowed"
156
+ ),
157
+ children: e.label
158
+ },
159
+ e.value
160
+ ))
161
+ }
162
+ ) }),
163
+ k && /* @__PURE__ */ n(S, { children: /* @__PURE__ */ n(
164
+ "div",
165
+ {
166
+ ref: w,
167
+ className: "bear-fixed bear-py-3 bear-px-4 bear-bg-white dark:bear-bg-gray-800 bear-border bear-border-gray-200 dark:bear-border-gray-700 bear-rounded-lg bear-shadow-lg bear-text-sm bear-text-gray-500",
168
+ style: {
169
+ top: l.top,
170
+ left: l.left,
171
+ width: l.width,
172
+ zIndex: _
173
+ },
174
+ children: "No options found"
175
+ }
176
+ ) }),
177
+ (M || u) && /* @__PURE__ */ n("p", { className: c(
133
178
  "bear-mt-1.5 bear-text-xs",
134
- c ? "bear-text-red-500" : "bear-text-gray-500 dark:bear-text-gray-400"
135
- ), children: c || N })
179
+ u ? "bear-text-red-500" : "bear-text-gray-500 dark:bear-text-gray-400"
180
+ ), children: u || M })
136
181
  ] });
137
182
  };
138
183
  export {
139
- q as MultiSelect
184
+ X as MultiSelect
140
185
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),s=require("react"),n=require("../../utils/cn.cjs"),c=require("./NavigableSelect.const.cjs"),oe=Z=>{const{options:_,value:R,defaultValue:G,onChange:i,multiple:b=!1,searchable:K=!0,placeholder:z=c.DEFAULT_PLACEHOLDER,label:O,helperText:M,error:S,disabled:p=!1,size:m="md",fullWidth:X=!1,maxVisible:Y=c.DEFAULT_MAX_VISIBLE,maxSelections:j,emptyText:$=c.DEFAULT_EMPTY_TEXT,className:J,style:Q,testId:ee}=Z,y=R!==void 0,V=e=>e===void 0?[]:Array.isArray(e)?e:[e],[re,P]=s.useState(V(G)),[g,w]=s.useState(!1),[d,o]=s.useState(-1),[x,B]=s.useState(""),E=s.useRef(null),C=s.useRef(null),q=s.useRef(null),H=s.useRef(null),l=y?V(R):re,h=s.useMemo(()=>{if(!x)return _;const e=x.toLowerCase();return _.filter(a=>{var t;return a.label.toLowerCase().includes(e)||((t=a.description)==null?void 0:t.toLowerCase().includes(e))})},[_,x]),ae=s.useMemo(()=>{const e=new Map;return h.forEach(a=>{const t=a.group||"";e.has(t)||e.set(t,[]),e.get(t).push(a)}),e},[h]),v=s.useMemo(()=>h.filter(e=>!e.disabled),[h]);s.useEffect(()=>{const e=a=>{E.current&&!E.current.contains(a.target)&&(w(!1),B(""))};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]),s.useEffect(()=>{if(!C.current||d<0)return;const e=C.current.querySelector('[data-active="true"]');e==null||e.scrollIntoView({block:c.SCROLL_BLOCK})},[d]);const L=s.useCallback(()=>{p||(w(!0),o(0),setTimeout(()=>{var e;return(e=q.current)==null?void 0:e.focus()},0))},[p]),k=s.useCallback(()=>{var e;w(!1),B(""),o(-1),(e=H.current)==null||e.focus()},[]),I=s.useCallback(e=>{let a;if(b)if(l.includes(e))a=l.filter(t=>t!==e);else{if(j&&l.length>=j)return;a=[...l,e]}else a=[e],k();y||P(a),i==null||i(b?a:a[0]??"")},[l,b,y,j,i,k]),D=s.useCallback(e=>{const a=l.filter(t=>t!==e);y||P(a),i==null||i(b?a:a[0]??"")},[l,b,y,i]),W=s.useCallback(e=>{if(!g){(e.key==="ArrowDown"||e.key==="ArrowUp"||e.key==="Enter"||e.key===" ")&&(e.preventDefault(),L());return}switch(e.key){case"ArrowDown":e.preventDefault(),o(a=>Math.min(a+1,v.length-1));break;case"ArrowUp":e.preventDefault(),o(a=>Math.max(a-1,0));break;case"Enter":case" ":e.preventDefault(),d>=0&&v[d]&&I(v[d].value);break;case"Escape":e.preventDefault(),k();break;case"Backspace":x===""&&b&&l.length>0&&D(l[l.length-1]);break;case"Home":e.preventDefault(),o(0);break;case"End":e.preventDefault(),o(v.length-1);break}},[g,d,v,I,k,L,x,b,l,D]),te=s.useCallback(e=>l.includes(e),[l]),u=l.map(e=>_.find(a=>a.value===e)).filter(Boolean),se=!!S,le=c.TRIGGER_SIZE_CLASSES[m],be=c.OPTION_SIZE_CLASSES[m],ne=c.TAG_SIZE_CLASSES[m],F=c.ICON_SIZE[m],ce=Y*c.OPTION_HEIGHT[m];let A=-1;return r.jsxs("div",{ref:E,className:n.cn("Bear-NavigableSelect","bear-relative bear-flex bear-flex-col bear-gap-1.5",X&&"bear-w-full",J),style:Q,"data-testid":ee,children:[O&&r.jsx("label",{className:"Bear-NavigableSelect__label bear-text-sm bear-font-medium bear-text-gray-700 dark:bear-text-gray-300",children:O}),r.jsxs("button",{ref:H,type:"button",disabled:p,onClick:()=>g?k():L(),onKeyDown:W,className:n.cn("Bear-NavigableSelect__trigger","bear-flex bear-items-center bear-justify-between bear-w-full","bear-rounded-lg bear-border bear-text-left bear-outline-none","bear-transition-all bear-duration-200","bear-bg-white dark:bear-bg-gray-900","bear-text-gray-900 dark:bear-text-white",se?"bear-border-red-500 focus:bear-ring-2 focus:bear-ring-red-500/20":"bear-border-gray-300 dark:bear-border-gray-600 focus:bear-border-[var(--bear-primary-500)] focus:bear-ring-2 focus:bear-ring-[var(--bear-primary-500)]/20",p&&"bear-opacity-50 bear-cursor-not-allowed",le),"aria-haspopup":"listbox","aria-expanded":g,children:[r.jsxs("span",{className:"Bear-NavigableSelect__value bear-flex bear-items-center bear-gap-1.5 bear-flex-wrap bear-flex-1 bear-min-w-0 bear-overflow-hidden",children:[b&&u.length>0&&u.map(e=>r.jsxs("span",{className:n.cn("Bear-NavigableSelect__tag","bear-inline-flex bear-items-center bear-gap-1 bear-rounded-md","bear-bg-[var(--bear-primary-100,#fce7f3)] dark:bear-bg-[var(--bear-primary-900,#831843)]/30","bear-text-[var(--bear-primary-700,#be185d)] dark:bear-text-[var(--bear-primary-300,#f9a8d4)]",ne),children:[e.label,!p&&r.jsx("button",{type:"button",onClick:a=>{a.stopPropagation(),D(e.value)},className:"bear-ml-0.5 hover:bear-opacity-70","aria-label":`Remove ${e.label}`,children:"×"})]},e.value)),!b&&u.length>0&&r.jsxs("span",{className:"bear-truncate",children:[u[0].icon&&r.jsx("span",{className:"bear-mr-1.5",children:u[0].icon}),u[0].label]}),u.length===0&&r.jsx("span",{className:"bear-text-gray-400 dark:bear-text-gray-500",children:z})]}),r.jsx("svg",{className:n.cn(F,"bear-text-gray-400 dark:bear-text-gray-500 bear-transition-transform bear-shrink-0 bear-ml-2",g&&"bear-rotate-180"),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})]}),g&&r.jsxs("div",{className:n.cn("Bear-NavigableSelect__dropdown","bear-absolute bear-top-full bear-left-0 bear-w-full bear-mt-1","bear-bg-white dark:bear-bg-gray-900","bear-border bear-border-gray-200 dark:bear-border-gray-700","bear-rounded-lg bear-shadow-lg bear-overflow-hidden"),style:{zIndex:c.DROPDOWN_Z_INDEX},children:[K&&r.jsxs("div",{className:"Bear-NavigableSelect__search bear-flex bear-items-center bear-gap-2 bear-px-3 bear-py-2 bear-border-b bear-border-gray-200 dark:bear-border-gray-700",children:[r.jsxs("svg",{className:"bear-w-4 bear-h-4 bear-text-gray-400 dark:bear-text-gray-500 bear-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:[r.jsx("circle",{cx:"11",cy:"11",r:"8"}),r.jsx("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]}),r.jsx("input",{ref:q,type:"text",value:x,onChange:e=>{B(e.target.value),o(0)},onKeyDown:W,placeholder:"Type to search...",className:n.cn("Bear-NavigableSelect__input","bear-flex-1 bear-bg-transparent bear-outline-none bear-text-sm","bear-text-gray-900 dark:bear-text-white","placeholder:bear-text-gray-400 dark:placeholder:bear-text-gray-500"),autoComplete:"off",spellCheck:!1})]}),r.jsxs("div",{ref:C,className:"Bear-NavigableSelect__list bear-overflow-y-auto bear-py-1",style:{maxHeight:ce},role:"listbox","aria-multiselectable":b,children:[h.length===0&&r.jsx("div",{className:"Bear-NavigableSelect__empty bear-px-3 bear-py-4 bear-text-center bear-text-sm bear-text-gray-500 dark:bear-text-gray-400",children:$}),Array.from(ae.entries()).map(([e,a])=>r.jsxs("div",{className:"Bear-NavigableSelect__group",children:[e&&r.jsx("div",{className:"Bear-NavigableSelect__group-title bear-px-3 bear-py-1 bear-text-xs bear-font-semibold bear-uppercase bear-tracking-wider bear-text-gray-400 dark:bear-text-gray-500",children:e}),a.map(t=>{const N=t.disabled,U=!N;U&&A++;const T=A===d,f=te(t.value),ie=A;return r.jsxs("button",{type:"button",disabled:N,className:n.cn("Bear-NavigableSelect__option","bear-w-full bear-flex bear-items-center bear-gap-2.5 bear-text-left bear-cursor-pointer","bear-transition-colors bear-duration-100",be,T&&"bear-bg-gray-100 dark:bear-bg-gray-800",f&&!T&&"bear-bg-[var(--bear-primary-50,#fdf2f8)] dark:bear-bg-[var(--bear-primary-950,#500724)]/20",N&&"bear-opacity-40 bear-cursor-not-allowed"),"data-active":T,onMouseEnter:()=>{U&&o(ie)},onClick:()=>{N||I(t.value)},role:"option","aria-selected":f,"aria-disabled":N,children:[b&&r.jsx("span",{className:n.cn("Bear-NavigableSelect__checkbox","bear-flex bear-items-center bear-justify-center bear-w-4 bear-h-4 bear-rounded bear-border bear-shrink-0","bear-transition-colors",f?"bear-bg-[var(--bear-primary-500)] bear-border-[var(--bear-primary-500)] bear-text-white":"bear-border-gray-300 dark:bear-border-gray-600"),children:f&&r.jsx("svg",{className:"bear-w-3 bear-h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})}),t.icon&&r.jsx("span",{className:"Bear-NavigableSelect__option-icon bear-shrink-0 bear-text-gray-500 dark:bear-text-gray-400",children:t.icon}),r.jsxs("div",{className:"Bear-NavigableSelect__option-body bear-flex-1 bear-min-w-0",children:[r.jsx("div",{className:n.cn("Bear-NavigableSelect__option-label bear-truncate",f?"bear-text-[var(--bear-primary-700,#be185d)] dark:bear-text-[var(--bear-primary-300,#f9a8d4)] bear-font-medium":"bear-text-gray-900 dark:bear-text-white"),children:t.label}),t.description&&r.jsx("div",{className:"Bear-NavigableSelect__option-desc bear-text-xs bear-text-gray-500 dark:bear-text-gray-400 bear-truncate",children:t.description})]}),!b&&f&&r.jsx("svg",{className:n.cn(F,"bear-text-[var(--bear-primary-500)] bear-shrink-0"),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})]},t.value)})]},e))]}),r.jsxs("div",{className:"Bear-NavigableSelect__footer bear-flex bear-items-center bear-gap-3 bear-px-3 bear-py-1.5 bear-border-t bear-border-gray-200 dark:bear-border-gray-700 bear-text-[11px] bear-text-gray-400 dark:bear-text-gray-500",children:[r.jsxs("span",{className:"bear-flex bear-items-center bear-gap-1",children:[r.jsx("kbd",{className:"bear-px-1 bear-rounded bear-bg-gray-100 dark:bear-bg-gray-800 bear-border bear-border-gray-200 dark:bear-border-gray-700",children:"↑↓"}),"navigate"]}),r.jsxs("span",{className:"bear-flex bear-items-center bear-gap-1",children:[r.jsx("kbd",{className:"bear-px-1 bear-rounded bear-bg-gray-100 dark:bear-bg-gray-800 bear-border bear-border-gray-200 dark:bear-border-gray-700",children:"↵"}),"select"]}),r.jsxs("span",{className:"bear-flex bear-items-center bear-gap-1",children:[r.jsx("kbd",{className:"bear-px-1 bear-rounded bear-bg-gray-100 dark:bear-bg-gray-800 bear-border bear-border-gray-200 dark:bear-border-gray-700",children:"esc"}),"close"]})]})]}),(M||S)&&r.jsx("p",{className:n.cn("Bear-NavigableSelect__helper bear-text-xs",S?"bear-text-red-500":"bear-text-gray-500 dark:bear-text-gray-400"),children:S||M})]})};exports.NavigableSelect=oe;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),s=require("react"),b=require("../../utils/cn.cjs"),ge=require("../Portal/Portal.cjs"),o=require("./NavigableSelect.const.cjs"),xe=G=>{const{options:_,value:O,defaultValue:K,onChange:c,multiple:n=!1,searchable:X=!0,placeholder:Y=o.DEFAULT_PLACEHOLDER,label:P,helperText:V,error:S,disabled:m=!1,size:y="md",fullWidth:$=!1,maxVisible:J=o.DEFAULT_MAX_VISIBLE,maxSelections:j,emptyText:Q=o.DEFAULT_EMPTY_TEXT,className:ee,style:re,testId:ae}=G,h=O!==void 0,q=e=>e===void 0?[]:Array.isArray(e)?e:[e],[te,W]=s.useState(q(K)),[i,E]=s.useState(!1),[g,d]=s.useState(-1),[f,B]=s.useState(""),H=s.useRef(null),z=s.useRef(null),L=s.useRef(null),F=s.useRef(null),C=s.useRef(null),[I,se]=s.useState({top:0,left:0,width:0}),l=h?q(O):te,v=s.useMemo(()=>{if(!f)return _;const e=f.toLowerCase();return _.filter(a=>{var t;return a.label.toLowerCase().includes(e)||((t=a.description)==null?void 0:t.toLowerCase().includes(e))})},[_,f]),le=s.useMemo(()=>{const e=new Map;return v.forEach(a=>{const t=a.group||"";e.has(t)||e.set(t,[]),e.get(t).push(a)}),e},[v]),k=s.useMemo(()=>v.filter(e=>!e.disabled),[v]);s.useEffect(()=>{if(!i)return;const e=()=>{var t;const a=(t=C.current)==null?void 0:t.getBoundingClientRect();a&&se({top:a.bottom+4,left:Math.max(8,Math.min(a.left,window.innerWidth-a.width-8)),width:a.width})};return e(),window.addEventListener("resize",e),window.addEventListener("scroll",e,!0),()=>{window.removeEventListener("resize",e),window.removeEventListener("scroll",e,!0)}},[i]),s.useEffect(()=>{if(!i)return;const e=a=>{var u,w;const t=a.target;(u=H.current)!=null&&u.contains(t)||(w=z.current)!=null&&w.contains(t)||(E(!1),B(""))};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[i]),s.useEffect(()=>{if(!L.current||g<0)return;const e=L.current.querySelector('[data-active="true"]');e==null||e.scrollIntoView({block:o.SCROLL_BLOCK})},[g]);const D=s.useCallback(()=>{m||(E(!0),d(0),setTimeout(()=>{var e;return(e=F.current)==null?void 0:e.focus()},0))},[m]),N=s.useCallback(()=>{var e;E(!1),B(""),d(-1),(e=C.current)==null||e.focus()},[]),R=s.useCallback(e=>{let a;if(n)if(l.includes(e))a=l.filter(t=>t!==e);else{if(j&&l.length>=j)return;a=[...l,e]}else a=[e],N();h||W(a),c==null||c(n?a:a[0]??"")},[l,n,h,j,c,N]),A=s.useCallback(e=>{const a=l.filter(t=>t!==e);h||W(a),c==null||c(n?a:a[0]??"")},[l,n,h,c]),U=s.useCallback(e=>{if(!i){(e.key==="ArrowDown"||e.key==="ArrowUp"||e.key==="Enter"||e.key===" ")&&(e.preventDefault(),D());return}switch(e.key){case"ArrowDown":e.preventDefault(),d(a=>Math.min(a+1,k.length-1));break;case"ArrowUp":e.preventDefault(),d(a=>Math.max(a-1,0));break;case"Enter":case" ":e.preventDefault(),g>=0&&k[g]&&R(k[g].value);break;case"Escape":e.preventDefault(),N();break;case"Backspace":f===""&&n&&l.length>0&&A(l[l.length-1]);break;case"Home":e.preventDefault(),d(0);break;case"End":e.preventDefault(),d(k.length-1);break}},[i,g,k,R,N,D,f,n,l,A]),ne=s.useCallback(e=>l.includes(e),[l]),x=l.map(e=>_.find(a=>a.value===e)).filter(Boolean),be=!!S,ie=o.TRIGGER_SIZE_CLASSES[y],oe=o.OPTION_SIZE_CLASSES[y],ce=o.TAG_SIZE_CLASSES[y],Z=o.ICON_SIZE[y],de=J*o.OPTION_HEIGHT[y];let T=-1;return r.jsxs("div",{ref:H,className:b.cn("Bear-NavigableSelect","bear-relative bear-flex bear-flex-col bear-gap-1.5",$&&"bear-w-full",ee),style:re,"data-testid":ae,children:[P&&r.jsx("label",{className:"Bear-NavigableSelect__label bear-text-sm bear-font-medium bear-text-gray-700 dark:bear-text-gray-300",children:P}),r.jsxs("button",{ref:C,type:"button",disabled:m,onClick:()=>i?N():D(),onKeyDown:U,className:b.cn("Bear-NavigableSelect__trigger","bear-flex bear-items-center bear-justify-between bear-w-full","bear-rounded-lg bear-border bear-text-left bear-outline-none","bear-transition-all bear-duration-200","bear-bg-white dark:bear-bg-gray-900","bear-text-gray-900 dark:bear-text-white",be?"bear-border-red-500 focus:bear-ring-2 focus:bear-ring-red-500/20":"bear-border-gray-300 dark:bear-border-gray-600 focus:bear-border-[var(--bear-primary-500)] focus:bear-ring-2 focus:bear-ring-[var(--bear-primary-500)]/20",m&&"bear-opacity-50 bear-cursor-not-allowed",ie),"aria-haspopup":"listbox","aria-expanded":i,children:[r.jsxs("span",{className:"Bear-NavigableSelect__value bear-flex bear-items-center bear-gap-1.5 bear-flex-wrap bear-flex-1 bear-min-w-0 bear-overflow-hidden",children:[n&&x.length>0&&x.map(e=>r.jsxs("span",{className:b.cn("Bear-NavigableSelect__tag","bear-inline-flex bear-items-center bear-gap-1 bear-rounded-md","bear-bg-[var(--bear-primary-100,#fce7f3)] dark:bear-bg-[var(--bear-primary-900,#831843)]/30","bear-text-[var(--bear-primary-700,#be185d)] dark:bear-text-[var(--bear-primary-300,#f9a8d4)]",ce),children:[e.label,!m&&r.jsx("button",{type:"button",onClick:a=>{a.stopPropagation(),A(e.value)},className:"bear-ml-0.5 hover:bear-opacity-70","aria-label":`Remove ${e.label}`,children:"×"})]},e.value)),!n&&x.length>0&&r.jsxs("span",{className:"bear-truncate",children:[x[0].icon&&r.jsx("span",{className:"bear-mr-1.5",children:x[0].icon}),x[0].label]}),x.length===0&&r.jsx("span",{className:"bear-text-gray-400 dark:bear-text-gray-500",children:Y})]}),r.jsx("svg",{className:b.cn(Z,"bear-text-gray-400 dark:bear-text-gray-500 bear-transition-transform bear-shrink-0 bear-ml-2",i&&"bear-rotate-180"),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})]}),i&&r.jsx(ge.Portal,{children:r.jsxs("div",{ref:z,className:b.cn("Bear-NavigableSelect__dropdown","bear-fixed","bear-bg-white dark:bear-bg-gray-900","bear-border bear-border-gray-200 dark:bear-border-gray-700","bear-rounded-lg bear-shadow-lg bear-overflow-hidden"),style:{zIndex:o.DROPDOWN_Z_INDEX,top:I.top,left:I.left,width:I.width},children:[X&&r.jsxs("div",{className:"Bear-NavigableSelect__search bear-flex bear-items-center bear-gap-2 bear-px-3 bear-py-2 bear-border-b bear-border-gray-200 dark:bear-border-gray-700",children:[r.jsxs("svg",{className:"bear-w-4 bear-h-4 bear-text-gray-400 dark:bear-text-gray-500 bear-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:[r.jsx("circle",{cx:"11",cy:"11",r:"8"}),r.jsx("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]}),r.jsx("input",{ref:F,type:"text",value:f,onChange:e=>{B(e.target.value),d(0)},onKeyDown:U,placeholder:"Type to search...",className:b.cn("Bear-NavigableSelect__input","bear-flex-1 bear-bg-transparent bear-outline-none bear-text-sm","bear-text-gray-900 dark:bear-text-white","placeholder:bear-text-gray-400 dark:placeholder:bear-text-gray-500"),autoComplete:"off",spellCheck:!1})]}),r.jsxs("div",{ref:L,className:"Bear-NavigableSelect__list bear-overflow-y-auto bear-py-1",style:{maxHeight:de},role:"listbox","aria-multiselectable":n,children:[v.length===0&&r.jsx("div",{className:"Bear-NavigableSelect__empty bear-px-3 bear-py-4 bear-text-center bear-text-sm bear-text-gray-500 dark:bear-text-gray-400",children:Q}),Array.from(le.entries()).map(([e,a])=>r.jsxs("div",{className:"Bear-NavigableSelect__group",children:[e&&r.jsx("div",{className:"Bear-NavigableSelect__group-title bear-px-3 bear-py-1 bear-text-xs bear-font-semibold bear-uppercase bear-tracking-wider bear-text-gray-400 dark:bear-text-gray-500",children:e}),a.map(t=>{const u=t.disabled,w=!u;w&&T++;const M=T===g,p=ne(t.value),ue=T;return r.jsxs("button",{type:"button",disabled:u,className:b.cn("Bear-NavigableSelect__option","bear-w-full bear-flex bear-items-center bear-gap-2.5 bear-text-left bear-cursor-pointer","bear-transition-colors bear-duration-100",oe,M&&"bear-bg-gray-100 dark:bear-bg-gray-800",p&&!M&&"bear-bg-[var(--bear-primary-50,#fdf2f8)] dark:bear-bg-[var(--bear-primary-950,#500724)]/20",u&&"bear-opacity-40 bear-cursor-not-allowed"),"data-active":M,onMouseEnter:()=>{w&&d(ue)},onClick:()=>{u||R(t.value)},role:"option","aria-selected":p,"aria-disabled":u,children:[n&&r.jsx("span",{className:b.cn("Bear-NavigableSelect__checkbox","bear-flex bear-items-center bear-justify-center bear-w-4 bear-h-4 bear-rounded bear-border bear-shrink-0","bear-transition-colors",p?"bear-bg-[var(--bear-primary-500)] bear-border-[var(--bear-primary-500)] bear-text-white":"bear-border-gray-300 dark:bear-border-gray-600"),children:p&&r.jsx("svg",{className:"bear-w-3 bear-h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})}),t.icon&&r.jsx("span",{className:"Bear-NavigableSelect__option-icon bear-shrink-0 bear-text-gray-500 dark:bear-text-gray-400",children:t.icon}),r.jsxs("div",{className:"Bear-NavigableSelect__option-body bear-flex-1 bear-min-w-0",children:[r.jsx("div",{className:b.cn("Bear-NavigableSelect__option-label bear-truncate",p?"bear-text-[var(--bear-primary-700,#be185d)] dark:bear-text-[var(--bear-primary-300,#f9a8d4)] bear-font-medium":"bear-text-gray-900 dark:bear-text-white"),children:t.label}),t.description&&r.jsx("div",{className:"Bear-NavigableSelect__option-desc bear-text-xs bear-text-gray-500 dark:bear-text-gray-400 bear-truncate",children:t.description})]}),!n&&p&&r.jsx("svg",{className:b.cn(Z,"bear-text-[var(--bear-primary-500)] bear-shrink-0"),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})]},t.value)})]},e))]}),r.jsxs("div",{className:"Bear-NavigableSelect__footer bear-flex bear-items-center bear-gap-3 bear-px-3 bear-py-1.5 bear-border-t bear-border-gray-200 dark:bear-border-gray-700 bear-text-[11px] bear-text-gray-400 dark:bear-text-gray-500",children:[r.jsxs("span",{className:"bear-flex bear-items-center bear-gap-1",children:[r.jsx("kbd",{className:"bear-px-1 bear-rounded bear-bg-gray-100 dark:bear-bg-gray-800 bear-border bear-border-gray-200 dark:bear-border-gray-700",children:"↑↓"}),"navigate"]}),r.jsxs("span",{className:"bear-flex bear-items-center bear-gap-1",children:[r.jsx("kbd",{className:"bear-px-1 bear-rounded bear-bg-gray-100 dark:bear-bg-gray-800 bear-border bear-border-gray-200 dark:bear-border-gray-700",children:"↵"}),"select"]}),r.jsxs("span",{className:"bear-flex bear-items-center bear-gap-1",children:[r.jsx("kbd",{className:"bear-px-1 bear-rounded bear-bg-gray-100 dark:bear-bg-gray-800 bear-border bear-border-gray-200 dark:bear-border-gray-700",children:"esc"}),"close"]})]})]})}),(V||S)&&r.jsx("p",{className:b.cn("Bear-NavigableSelect__helper bear-text-xs",S?"bear-text-red-500":"bear-text-gray-500 dark:bear-text-gray-400"),children:S||V})]})};exports.NavigableSelect=xe;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="Select an option...",a="No options found",r=8,t={sm:32,md:40,lg:48},b={sm:"bear-h-8 bear-text-sm bear-px-2.5",md:"bear-h-10 bear-text-sm bear-px-3",lg:"bear-h-12 bear-text-base bear-px-4"},E={sm:"bear-px-2.5 bear-py-1.5 bear-text-sm",md:"bear-px-3 bear-py-2 bear-text-sm",lg:"bear-px-4 bear-py-2.5 bear-text-base"},S={sm:"bear-text-xs bear-px-1.5 bear-py-0.5",md:"bear-text-xs bear-px-2 bear-py-0.5",lg:"bear-text-sm bear-px-2 bear-py-1"},_=50,s="nearest",I={sm:"bear-w-3.5 bear-h-3.5",md:"bear-w-4 bear-h-4",lg:"bear-w-5 bear-h-5"};exports.DEFAULT_EMPTY_TEXT=a;exports.DEFAULT_MAX_VISIBLE=r;exports.DEFAULT_PLACEHOLDER=e;exports.DROPDOWN_Z_INDEX=_;exports.ICON_SIZE=I;exports.OPTION_HEIGHT=t;exports.OPTION_SIZE_CLASSES=E;exports.SCROLL_BLOCK=s;exports.TAG_SIZE_CLASSES=S;exports.TRIGGER_SIZE_CLASSES=b;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="Select an option...",a="No options found",r=8,t={sm:32,md:40,lg:48},b={sm:"bear-h-8 bear-text-sm bear-px-2.5",md:"bear-h-10 bear-text-sm bear-px-3",lg:"bear-h-12 bear-text-base bear-px-4"},E={sm:"bear-px-2.5 bear-py-1.5 bear-text-sm",md:"bear-px-3 bear-py-2 bear-text-sm",lg:"bear-px-4 bear-py-2.5 bear-text-base"},S={sm:"bear-text-xs bear-px-1.5 bear-py-0.5",md:"bear-text-xs bear-px-2 bear-py-0.5",lg:"bear-text-sm bear-px-2 bear-py-1"},_=1e4,s="nearest",I={sm:"bear-w-3.5 bear-h-3.5",md:"bear-w-4 bear-h-4",lg:"bear-w-5 bear-h-5"};exports.DEFAULT_EMPTY_TEXT=a;exports.DEFAULT_MAX_VISIBLE=r;exports.DEFAULT_PLACEHOLDER=e;exports.DROPDOWN_Z_INDEX=_;exports.ICON_SIZE=I;exports.OPTION_HEIGHT=t;exports.OPTION_SIZE_CLASSES=E;exports.SCROLL_BLOCK=s;exports.TAG_SIZE_CLASSES=S;exports.TRIGGER_SIZE_CLASSES=b;
@@ -14,7 +14,7 @@ export declare const OPTION_SIZE_CLASSES: Record<NavigableSelectSize, string>;
14
14
  /** Tag size classes (multi-select chips) */
15
15
  export declare const TAG_SIZE_CLASSES: Record<NavigableSelectSize, string>;
16
16
  /** Dropdown z-index */
17
- export declare const DROPDOWN_Z_INDEX = 50;
17
+ export declare const DROPDOWN_Z_INDEX = 10000;
18
18
  /** Search input debounce delay */
19
19
  export declare const SEARCH_DEBOUNCE = 0;
20
20
  /** Scroll into view block setting */
@@ -14,7 +14,7 @@ const e = "Select an option...", a = "No options found", b = 8, r = {
14
14
  sm: "bear-text-xs bear-px-1.5 bear-py-0.5",
15
15
  md: "bear-text-xs bear-px-2 bear-py-0.5",
16
16
  lg: "bear-text-sm bear-px-2 bear-py-1"
17
- }, p = 50, E = "nearest", o = {
17
+ }, p = 1e4, E = "nearest", o = {
18
18
  sm: "bear-w-3.5 bear-h-3.5",
19
19
  md: "bear-w-4 bear-h-4",
20
20
  lg: "bear-w-5 bear-h-5"