ics-ui-kit 0.1.0-alpha.12 → 0.1.0-alpha.13

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 (227) hide show
  1. package/dist/Button-DQtBfU9y.js +57 -0
  2. package/dist/Button-DQtBfU9y.js.map +1 -0
  3. package/dist/{Button-DhfE69q0.js → ButtonBase-BEM8SNmT.js} +27 -56
  4. package/dist/ButtonBase-BEM8SNmT.js.map +1 -0
  5. package/dist/CarouselItem-pSHe0ufN.js +1500 -0
  6. package/dist/CarouselItem-pSHe0ufN.js.map +1 -0
  7. package/dist/CheckboxField-i_-dPpFM.js +370 -0
  8. package/dist/CheckboxField-i_-dPpFM.js.map +1 -0
  9. package/dist/Divider-C0Ss5GJT.js +47 -0
  10. package/dist/{Divider-D3NvaU8c.js.map → Divider-C0Ss5GJT.js.map} +1 -1
  11. package/dist/Field-3XJNFTql.js +78 -0
  12. package/dist/Field-3XJNFTql.js.map +1 -0
  13. package/dist/FieldLabel-CAbVan3E.js +97 -0
  14. package/dist/FieldLabel-CAbVan3E.js.map +1 -0
  15. package/dist/FormBody-4HptEjhb.js +103 -0
  16. package/dist/FormBody-4HptEjhb.js.map +1 -0
  17. package/dist/{IconButton-BUPs2kEo.js → IconButton-BkBsOIf5.js} +15 -15
  18. package/dist/{IconButton-BUPs2kEo.js.map → IconButton-BkBsOIf5.js.map} +1 -1
  19. package/dist/ImagePlaceholder-CNAKQWTh.js +45 -0
  20. package/dist/ImagePlaceholder-CNAKQWTh.js.map +1 -0
  21. package/dist/ImagePreview-DHi7A8md.js +156 -0
  22. package/dist/ImagePreview-DHi7A8md.js.map +1 -0
  23. package/dist/ImageUploader-46sxdmt5.js +123 -0
  24. package/dist/ImageUploader-46sxdmt5.js.map +1 -0
  25. package/dist/IsolatedStylesWrapper-WgaoHh7y.js +179 -0
  26. package/dist/IsolatedStylesWrapper-WgaoHh7y.js.map +1 -0
  27. package/dist/Modal-D33MSQot.js +125 -0
  28. package/dist/Modal-D33MSQot.js.map +1 -0
  29. package/dist/ScrollShadowContainer-ByNH68Kg.js +636 -0
  30. package/dist/ScrollShadowContainer-ByNH68Kg.js.map +1 -0
  31. package/dist/Toggle-7AlEmn8A.js +104 -0
  32. package/dist/Toggle-7AlEmn8A.js.map +1 -0
  33. package/dist/ToggleGroup-CT453MNp.js +200 -0
  34. package/dist/ToggleGroup-CT453MNp.js.map +1 -0
  35. package/dist/Tooltip-C4BbGF2_.js +372 -0
  36. package/dist/Tooltip-C4BbGF2_.js.map +1 -0
  37. package/dist/{bundle-mjs-D6wdQkGI.js → bundle-mjs-LhQum_e3.js} +676 -425
  38. package/dist/bundle-mjs-LhQum_e3.js.map +1 -0
  39. package/dist/check-C-TqZgvb.js.map +1 -1
  40. package/dist/chevron-right-CobOebzi.js.map +1 -1
  41. package/dist/components/badge.js +1 -1
  42. package/dist/components/button/icon-button/IconButton.stories.d.ts +330 -2
  43. package/dist/components/button/loading-button/LoadingButton.d.ts +249 -0
  44. package/dist/components/button/loading-button/LoadingButton.stories.d.ts +219 -0
  45. package/dist/components/button.js +6 -5
  46. package/dist/components/button.js.map +1 -1
  47. package/dist/components/carousel.js +65 -1532
  48. package/dist/components/carousel.js.map +1 -1
  49. package/dist/components/checkbox.js +1 -1
  50. package/dist/components/divider/content-divider/ContentDivider.d.ts +14 -0
  51. package/dist/components/divider/content-divider/ContentDivider.stories.d.ts +7 -0
  52. package/dist/components/divider/index.d.ts +1 -0
  53. package/dist/components/divider.js +45 -2
  54. package/dist/components/divider.js.map +1 -1
  55. package/dist/components/drawer/templates/drawer-footer-template/DrawerFooterTemplate.d.ts +3 -0
  56. package/dist/components/drawer.js +450 -447
  57. package/dist/components/drawer.js.map +1 -1
  58. package/dist/components/dropdown.js +37 -33
  59. package/dist/components/dropdown.js.map +1 -1
  60. package/dist/components/empty-state/EmptyState.d.ts +2 -2
  61. package/dist/components/empty-state.js +1 -1
  62. package/dist/components/empty-state.js.map +1 -1
  63. package/dist/components/field/Field.d.ts +35 -0
  64. package/dist/components/field.js +1 -1
  65. package/dist/components/form/components/form-header/FormHeader.d.ts +2 -2
  66. package/dist/components/form.js +289 -288
  67. package/dist/components/form.js.map +1 -1
  68. package/dist/components/gallery/Gallery.d.ts +21 -0
  69. package/dist/components/gallery/Gallery.stories.d.ts +26 -0
  70. package/dist/components/gallery/index.d.ts +1 -0
  71. package/dist/components/gallery.d.ts +2 -0
  72. package/dist/components/gallery.js +130 -0
  73. package/dist/components/gallery.js.map +1 -0
  74. package/dist/components/icon-tooltip/IconTooltip.d.ts +2 -1
  75. package/dist/components/image-placeholder.js +2 -42
  76. package/dist/components/image-placeholder.js.map +1 -1
  77. package/dist/components/image-preview/ImagePreview.d.ts +6 -6
  78. package/dist/components/image-preview.js +2 -136
  79. package/dist/components/image-preview.js.map +1 -1
  80. package/dist/components/image-uploader.js +2 -118
  81. package/dist/components/image-uploader.js.map +1 -1
  82. package/dist/components/input/file-input/FileInput.d.ts +3 -1
  83. package/dist/components/input-otp.js +1 -1
  84. package/dist/components/input-otp.js.map +1 -1
  85. package/dist/components/input.js +176 -195
  86. package/dist/components/input.js.map +1 -1
  87. package/dist/components/isolated-styles-wrapper/IsolatedStylesWrapper.d.ts +1 -1
  88. package/dist/components/label/Label.stories.d.ts +0 -2
  89. package/dist/components/label/field-label/FieldLabel.d.ts +11 -0
  90. package/dist/components/label/field-label/FieldLabel.stories.d.ts +1 -0
  91. package/dist/components/label/field-label/components/RequiredIcon.d.ts +5 -0
  92. package/dist/components/label.js +1 -1
  93. package/dist/components/loading/Loading.d.ts +4 -4
  94. package/dist/components/loading.js +2 -2
  95. package/dist/components/loading.js.map +1 -1
  96. package/dist/components/modal.js +12 -122
  97. package/dist/components/modal.js.map +1 -1
  98. package/dist/components/option-group.js +1 -1
  99. package/dist/components/popover.js +34 -31
  100. package/dist/components/popover.js.map +1 -1
  101. package/dist/components/scheduler.js +11 -11
  102. package/dist/components/scheduler.js.map +1 -1
  103. package/dist/components/scroll-shadow-container/ScrollShadowContainer.d.ts +1 -0
  104. package/dist/components/scroll-shadow-container.js +1 -1
  105. package/dist/components/select.js +487 -519
  106. package/dist/components/select.js.map +1 -1
  107. package/dist/components/shortcut/Shortcut.d.ts +14 -14
  108. package/dist/components/shortcut/Shortcut.stories.d.ts +7 -7
  109. package/dist/components/shortcut.js +16 -16
  110. package/dist/components/shortcut.js.map +1 -1
  111. package/dist/components/skeleton/Skeleton.d.ts +1 -0
  112. package/dist/components/skeleton/Skeleton.stories.d.ts +7 -0
  113. package/dist/components/skeleton/index.d.ts +1 -0
  114. package/dist/components/skeleton.d.ts +2 -0
  115. package/dist/components/skeleton.js +33 -0
  116. package/dist/components/skeleton.js.map +1 -0
  117. package/dist/components/switch.js +147 -126
  118. package/dist/components/switch.js.map +1 -1
  119. package/dist/components/tabs.js +9 -8
  120. package/dist/components/tabs.js.map +1 -1
  121. package/dist/components/tag.js +3 -3
  122. package/dist/components/toast.js +4 -4
  123. package/dist/components/toast.js.map +1 -1
  124. package/dist/components/toggle-group.js +1 -1
  125. package/dist/components/toggle.js +1 -1
  126. package/dist/components/tooltip/Tooltip.stories.d.ts +7 -0
  127. package/dist/components/tooltip/index.d.ts +1 -0
  128. package/dist/components/tooltip.d.ts +2 -0
  129. package/dist/components/tooltip.js +8 -0
  130. package/dist/components/tooltip.js.map +1 -0
  131. package/dist/createLucideIcon-DgrNxRV5.js.map +1 -1
  132. package/dist/design-tokens.source.json +1 -1
  133. package/dist/download-CVOGyQ0e.js.map +1 -1
  134. package/dist/downloadFile-yZV-aaO2.js +15 -0
  135. package/dist/downloadFile-yZV-aaO2.js.map +1 -0
  136. package/dist/index-B6K06mzp.js +67 -0
  137. package/dist/index-B6K06mzp.js.map +1 -0
  138. package/dist/index-BCZIl2rL.js +68 -0
  139. package/dist/index-BCZIl2rL.js.map +1 -0
  140. package/dist/index-BZPx6jYI.js.map +1 -1
  141. package/dist/index-Bj6ZBhqh.js +105 -0
  142. package/dist/index-Bj6ZBhqh.js.map +1 -0
  143. package/dist/index-ByaXH_ih.js.map +1 -1
  144. package/dist/index-CACw01gt.js +702 -0
  145. package/dist/index-CACw01gt.js.map +1 -0
  146. package/dist/index-COBL2CQB.js +14 -0
  147. package/dist/index-COBL2CQB.js.map +1 -0
  148. package/dist/index-CR-odn5-.js.map +1 -1
  149. package/dist/{index-BjbwEU_d.js → index-ClwWa5fz.js} +20 -20
  150. package/dist/index-ClwWa5fz.js.map +1 -0
  151. package/dist/{index-DwbC6luJ.js → index-Cx4x7Bv2.js} +52 -50
  152. package/dist/index-Cx4x7Bv2.js.map +1 -0
  153. package/dist/index-CzNelU6n.js +55 -0
  154. package/dist/index-CzNelU6n.js.map +1 -0
  155. package/dist/index-DBsc8nMF.js +43 -0
  156. package/dist/index-DBsc8nMF.js.map +1 -0
  157. package/dist/index-Mbnk_gHS.js +102 -0
  158. package/dist/index-Mbnk_gHS.js.map +1 -0
  159. package/dist/index-bhXb51Q1.js +215 -0
  160. package/dist/index-bhXb51Q1.js.map +1 -0
  161. package/dist/index-n71RB2rx.js +1592 -0
  162. package/dist/index-n71RB2rx.js.map +1 -0
  163. package/dist/index-rKs9bXHr.js +7 -0
  164. package/dist/index-rKs9bXHr.js.map +1 -0
  165. package/dist/lib/utils/file/downloadFile.d.ts +2 -0
  166. package/dist/lib/utils/image/imageConverter.d.ts +23 -0
  167. package/dist/styles-scoped.css +72 -18
  168. package/dist/styles.css +72 -18
  169. package/dist/{utils-DGzAmwok.js → utils-BK4mPzkB.js} +2 -2
  170. package/dist/utils-BK4mPzkB.js.map +1 -0
  171. package/dist/x-JgjNP5oH.js.map +1 -1
  172. package/package.json +1 -1
  173. package/dist/Button-DhfE69q0.js.map +0 -1
  174. package/dist/CheckboxField-CL1Tc7P4.js +0 -257
  175. package/dist/CheckboxField-CL1Tc7P4.js.map +0 -1
  176. package/dist/Divider-D3NvaU8c.js +0 -46
  177. package/dist/Field-COOo8o9f.js +0 -80
  178. package/dist/Field-COOo8o9f.js.map +0 -1
  179. package/dist/FieldLabel-BGxT_RaE.js +0 -64
  180. package/dist/FieldLabel-BGxT_RaE.js.map +0 -1
  181. package/dist/FormBody-DM52shm4.js +0 -101
  182. package/dist/FormBody-DM52shm4.js.map +0 -1
  183. package/dist/IsolatedStylesWrapper-B_Qu75eR.js +0 -555
  184. package/dist/IsolatedStylesWrapper-B_Qu75eR.js.map +0 -1
  185. package/dist/ScrollShadowContainer-DSKr3_fV.js +0 -690
  186. package/dist/ScrollShadowContainer-DSKr3_fV.js.map +0 -1
  187. package/dist/Toggle-BuYtICWv.js +0 -129
  188. package/dist/Toggle-BuYtICWv.js.map +0 -1
  189. package/dist/ToggleGroup-CMyUAz04.js +0 -467
  190. package/dist/ToggleGroup-CMyUAz04.js.map +0 -1
  191. package/dist/bundle-mjs-D6wdQkGI.js.map +0 -1
  192. package/dist/floating-ui.react-dom-CWfR7VfF.js +0 -1346
  193. package/dist/floating-ui.react-dom-CWfR7VfF.js.map +0 -1
  194. package/dist/index-0WznJ1QS.js +0 -276
  195. package/dist/index-0WznJ1QS.js.map +0 -1
  196. package/dist/index-BjbwEU_d.js.map +0 -1
  197. package/dist/index-BqriTm0o.js +0 -47
  198. package/dist/index-BqriTm0o.js.map +0 -1
  199. package/dist/index-C6bvrqL8.js +0 -563
  200. package/dist/index-C6bvrqL8.js.map +0 -1
  201. package/dist/index-C6t9z3on.js +0 -97
  202. package/dist/index-C6t9z3on.js.map +0 -1
  203. package/dist/index-CaQG3DzJ.js +0 -64
  204. package/dist/index-CaQG3DzJ.js.map +0 -1
  205. package/dist/index-ChTGHCkY.js +0 -255
  206. package/dist/index-ChTGHCkY.js.map +0 -1
  207. package/dist/index-D808y1pT.js +0 -178
  208. package/dist/index-D808y1pT.js.map +0 -1
  209. package/dist/index-DE3fiSzl.js +0 -28
  210. package/dist/index-DE3fiSzl.js.map +0 -1
  211. package/dist/index-DPws5oAn.js +0 -90
  212. package/dist/index-DPws5oAn.js.map +0 -1
  213. package/dist/index-DeUgDpdG.js +0 -80
  214. package/dist/index-DeUgDpdG.js.map +0 -1
  215. package/dist/index-DvquTpxI.js +0 -140
  216. package/dist/index-DvquTpxI.js.map +0 -1
  217. package/dist/index-DwbC6luJ.js.map +0 -1
  218. package/dist/index-Ncxt32Wo.js +0 -174
  219. package/dist/index-Ncxt32Wo.js.map +0 -1
  220. package/dist/index-U7y6nBZR.js +0 -179
  221. package/dist/index-U7y6nBZR.js.map +0 -1
  222. package/dist/index-pysSAa5G.js +0 -57
  223. package/dist/index-pysSAa5G.js.map +0 -1
  224. package/dist/tooltip-DI3_ZKNk.js +0 -365
  225. package/dist/tooltip-DI3_ZKNk.js.map +0 -1
  226. package/dist/utils-DGzAmwok.js.map +0 -1
  227. /package/dist/components/{ui/tooltip.d.ts → tooltip/Tooltip.d.ts} +0 -0
@@ -1,46 +1,50 @@
1
- var Pt = Object.defineProperty, Et = Object.defineProperties;
2
- var _t = Object.getOwnPropertyDescriptors;
3
- var fe = Object.getOwnPropertySymbols;
4
- var Le = Object.prototype.hasOwnProperty, ke = Object.prototype.propertyIsEnumerable;
5
- var De = (t, o, e) => o in t ? Pt(t, o, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[o] = e, v = (t, o) => {
1
+ var Tt = Object.defineProperty, Nt = Object.defineProperties;
2
+ var Rt = Object.getOwnPropertyDescriptors;
3
+ var pe = Object.getOwnPropertySymbols;
4
+ var De = Object.prototype.hasOwnProperty, Oe = Object.prototype.propertyIsEnumerable;
5
+ var Ae = (t, o, e) => o in t ? Tt(t, o, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[o] = e, h = (t, o) => {
6
6
  for (var e in o || (o = {}))
7
- Le.call(o, e) && De(t, e, o[e]);
8
- if (fe)
9
- for (var e of fe(o))
10
- ke.call(o, e) && De(t, e, o[e]);
7
+ De.call(o, e) && Ae(t, e, o[e]);
8
+ if (pe)
9
+ for (var e of pe(o))
10
+ Oe.call(o, e) && Ae(t, e, o[e]);
11
11
  return t;
12
- }, x = (t, o) => Et(t, _t(o));
13
- var E = (t, o) => {
12
+ }, w = (t, o) => Nt(t, Rt(o));
13
+ var T = (t, o) => {
14
14
  var e = {};
15
15
  for (var s in t)
16
- Le.call(t, s) && o.indexOf(s) < 0 && (e[s] = t[s]);
17
- if (t != null && fe)
18
- for (var s of fe(t))
19
- o.indexOf(s) < 0 && ke.call(t, s) && (e[s] = t[s]);
16
+ De.call(t, s) && o.indexOf(s) < 0 && (e[s] = t[s]);
17
+ if (t != null && pe)
18
+ for (var s of pe(t))
19
+ o.indexOf(s) < 0 && Oe.call(t, s) && (e[s] = t[s]);
20
20
  return e;
21
21
  };
22
- import { jsx as d, jsxs as ee, Fragment as Me } from "react/jsx-runtime";
22
+ import { jsx as d, jsxs as Q, Fragment as Ee } from "react/jsx-runtime";
23
23
  import * as n from "react";
24
- import Q from "react";
25
- import * as He from "react-dom";
26
- import { c as Ue, u as Be, d as j, a as A, e as Mt } from "../index-DvquTpxI.js";
27
- import { u as B, S as Te } from "../index-DPws5oAn.js";
28
- import { u as Ae, P as At, D as Ot } from "../index-U7y6nBZR.js";
29
- import { u as Dt, F as Lt } from "../index-D808y1pT.js";
30
- import { c as We, R as kt, V as Bt, A as Vt, C as Ht, b as Ut } from "../index-0WznJ1QS.js";
31
- import { P as V } from "../index-pysSAa5G.js";
32
- import { u as Wt } from "../index-BZPx6jYI.js";
33
- import { h as Ft, R as Kt, I as $t } from "../IsolatedStylesWrapper-B_Qu75eR.js";
24
+ import * as Be from "react-dom";
25
+ import { c as Le } from "../index-rKs9bXHr.js";
26
+ import { P as k, u as j, c as A } from "../index-B6K06mzp.js";
27
+ import { c as Pt } from "../index-BCZIl2rL.js";
28
+ import { u as G, c as Et } from "../index-Bj6ZBhqh.js";
29
+ import { c as _t, u as Mt } from "../index-Mbnk_gHS.js";
30
+ import { u as At } from "../index-ByaXH_ih.js";
31
+ import { P as Dt, D as Ot, I as Lt } from "../IsolatedStylesWrapper-WgaoHh7y.js";
32
+ import { h as kt, u as Bt, R as Vt, F as Ht } from "../index-CACw01gt.js";
33
+ import { u as _e } from "../index-COBL2CQB.js";
34
+ import { c as Ve, R as Ut, A as Wt, C as Ft, a as Kt } from "../index-n71RB2rx.js";
35
+ import { u as ke } from "../index-CzNelU6n.js";
36
+ import { u as $t } from "../index-BZPx6jYI.js";
37
+ import { V as Gt } from "../index-DBsc8nMF.js";
34
38
  import { c as oe } from "../index-CR-odn5-.js";
35
- import { c as Fe } from "../createLucideIcon-DgrNxRV5.js";
36
- import { C as Gt } from "../check-C-TqZgvb.js";
39
+ import { c as He } from "../createLucideIcon-DgrNxRV5.js";
40
+ import { C as zt } from "../check-C-TqZgvb.js";
37
41
  /**
38
42
  * @license lucide-react v0.460.0 - ISC
39
43
  *
40
44
  * This source code is licensed under the ISC license.
41
45
  * See the LICENSE file in the root directory of this source tree.
42
46
  */
43
- const Ke = Fe("ChevronDown", [
47
+ const Ue = He("ChevronDown", [
44
48
  ["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]
45
49
  ]);
46
50
  /**
@@ -49,247 +53,201 @@ const Ke = Fe("ChevronDown", [
49
53
  * This source code is licensed under the ISC license.
50
54
  * See the LICENSE file in the root directory of this source tree.
51
55
  */
52
- const zt = Fe("ChevronUp", [["path", { d: "m18 15-6-6-6 6", key: "153udz" }]]);
53
- function Ve(t, [o, e]) {
54
- return Math.min(e, Math.max(o, t));
55
- }
56
- function jt(t) {
57
- const o = t + "CollectionProvider", [e, s] = Ue(o), [r, a] = e(
58
- o,
59
- { collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }
60
- ), c = (I) => {
61
- const { scope: y, children: w } = I, u = Q.useRef(null), g = Q.useRef(/* @__PURE__ */ new Map()).current;
62
- return /* @__PURE__ */ d(r, { scope: y, itemMap: g, collectionRef: u, children: w });
63
- };
64
- c.displayName = o;
65
- const l = t + "CollectionSlot", i = Q.forwardRef(
66
- (I, y) => {
67
- const { scope: w, children: u } = I, g = a(l, w), m = B(y, g.collectionRef);
68
- return /* @__PURE__ */ d(Te, { ref: m, children: u });
69
- }
70
- );
71
- i.displayName = l;
72
- const f = t + "CollectionItemSlot", S = "data-radix-collection-item", T = Q.forwardRef(
73
- (I, y) => {
74
- const N = I, { scope: w, children: u } = N, g = E(N, ["scope", "children"]), m = Q.useRef(null), p = B(y, m), b = a(f, w);
75
- return Q.useEffect(() => (b.itemMap.set(m, v({ ref: m }, g)), () => void b.itemMap.delete(m))), /* @__PURE__ */ d(Te, { [S]: "", ref: p, children: u });
76
- }
77
- );
78
- T.displayName = f;
79
- function C(I) {
80
- const y = a(t + "CollectionConsumer", I);
81
- return Q.useCallback(() => {
82
- const u = y.collectionRef.current;
83
- if (!u) return [];
84
- const g = Array.from(u.querySelectorAll(`[${S}]`));
85
- return Array.from(y.itemMap.values()).sort(
86
- (b, N) => g.indexOf(b.ref.current) - g.indexOf(N.ref.current)
87
- );
88
- }, [y.collectionRef, y.itemMap]);
89
- }
90
- return [
91
- { Provider: c, Slot: i, ItemSlot: T },
92
- C,
93
- s
94
- ];
95
- }
96
- var qt = n.createContext(void 0);
97
- function Yt(t) {
98
- const o = n.useContext(qt);
99
- return t || o || "ltr";
100
- }
101
- var Xt = [" ", "Enter", "ArrowUp", "ArrowDown"], Zt = [" ", "Enter"], de = "Select", [he, ve, Jt] = jt(de), [le, Yo] = Ue(de, [
102
- Jt,
103
- We
104
- ]), ge = We(), [Qt, q] = le(de), [eo, to] = le(de), $e = (t) => {
56
+ const jt = He("ChevronUp", [["path", { d: "m18 15-6-6-6 6", key: "153udz" }]]);
57
+ var Yt = [" ", "Enter", "ArrowUp", "ArrowDown"], qt = [" ", "Enter"], ee = "Select", [me, he, Xt] = Pt(ee), [le, Qo] = _t(ee, [
58
+ Xt,
59
+ Ve
60
+ ]), ve = Ve(), [Zt, Y] = le(ee), [Jt, Qt] = le(ee), We = (t) => {
105
61
  const {
106
62
  __scopeSelect: o,
107
63
  children: e,
108
64
  open: s,
109
65
  defaultOpen: r,
110
66
  onOpenChange: a,
111
- value: c,
112
- defaultValue: l,
67
+ value: l,
68
+ defaultValue: c,
113
69
  onValueChange: i,
114
70
  dir: f,
115
- name: S,
116
- autoComplete: T,
117
- disabled: C,
118
- required: I,
119
- form: y
120
- } = t, w = ge(o), [u, g] = n.useState(null), [m, p] = n.useState(null), [b, N] = n.useState(!1), ce = Yt(f), [re = !1, O] = Be({
71
+ name: g,
72
+ autoComplete: P,
73
+ disabled: S,
74
+ required: E,
75
+ form: _
76
+ } = t, b = ve(o), [u, y] = n.useState(null), [v, p] = n.useState(null), [I, M] = n.useState(!1), ce = At(f), [re, D] = ke({
121
77
  prop: s,
122
- defaultProp: r,
123
- onChange: a
124
- }), [U, X] = Be({
125
- prop: c,
126
- defaultProp: l,
127
- onChange: i
128
- }), ne = n.useRef(null), k = u ? y || !!u.closest("form") : !0, [z, se] = n.useState(/* @__PURE__ */ new Set()), W = Array.from(z).map((D) => D.props.value).join(";");
129
- return /* @__PURE__ */ d(kt, x(v({}, w), { children: /* @__PURE__ */ ee(
130
- Qt,
78
+ defaultProp: r != null ? r : !1,
79
+ onChange: a,
80
+ caller: ee
81
+ }), [H, X] = ke({
82
+ prop: l,
83
+ defaultProp: c,
84
+ onChange: i,
85
+ caller: ee
86
+ }), ne = n.useRef(null), B = u ? _ || !!u.closest("form") : !0, [z, se] = n.useState(/* @__PURE__ */ new Set()), U = Array.from(z).map((O) => O.props.value).join(";");
87
+ return /* @__PURE__ */ d(Ut, w(h({}, b), { children: /* @__PURE__ */ Q(
88
+ Zt,
131
89
  {
132
- required: I,
90
+ required: E,
133
91
  scope: o,
134
92
  trigger: u,
135
- onTriggerChange: g,
136
- valueNode: m,
93
+ onTriggerChange: y,
94
+ valueNode: v,
137
95
  onValueNodeChange: p,
138
- valueNodeHasChildren: b,
139
- onValueNodeHasChildrenChange: N,
140
- contentId: Ae(),
141
- value: U,
96
+ valueNodeHasChildren: I,
97
+ onValueNodeHasChildrenChange: M,
98
+ contentId: _e(),
99
+ value: H,
142
100
  onValueChange: X,
143
101
  open: re,
144
- onOpenChange: O,
102
+ onOpenChange: D,
145
103
  dir: ce,
146
104
  triggerPointerDownPosRef: ne,
147
- disabled: C,
105
+ disabled: S,
148
106
  children: [
149
- /* @__PURE__ */ d(he.Provider, { scope: o, children: /* @__PURE__ */ d(
150
- eo,
107
+ /* @__PURE__ */ d(me.Provider, { scope: o, children: /* @__PURE__ */ d(
108
+ Jt,
151
109
  {
152
110
  scope: t.__scopeSelect,
153
- onNativeOptionAdd: n.useCallback((D) => {
154
- se((F) => new Set(F).add(D));
111
+ onNativeOptionAdd: n.useCallback((O) => {
112
+ se((W) => new Set(W).add(O));
155
113
  }, []),
156
- onNativeOptionRemove: n.useCallback((D) => {
157
- se((F) => {
158
- const K = new Set(F);
159
- return K.delete(D), K;
114
+ onNativeOptionRemove: n.useCallback((O) => {
115
+ se((W) => {
116
+ const F = new Set(W);
117
+ return F.delete(O), F;
160
118
  });
161
119
  }, []),
162
120
  children: e
163
121
  }
164
122
  ) }),
165
- k ? /* @__PURE__ */ ee(
166
- vt,
123
+ B ? /* @__PURE__ */ Q(
124
+ pt,
167
125
  {
168
126
  "aria-hidden": !0,
169
- required: I,
127
+ required: E,
170
128
  tabIndex: -1,
171
- name: S,
172
- autoComplete: T,
173
- value: U,
174
- onChange: (D) => X(D.target.value),
175
- disabled: C,
176
- form: y,
129
+ name: g,
130
+ autoComplete: P,
131
+ value: H,
132
+ onChange: (O) => X(O.target.value),
133
+ disabled: S,
134
+ form: _,
177
135
  children: [
178
- U === void 0 ? /* @__PURE__ */ d("option", { value: "" }) : null,
136
+ H === void 0 ? /* @__PURE__ */ d("option", { value: "" }) : null,
179
137
  Array.from(z)
180
138
  ]
181
139
  },
182
- W
140
+ U
183
141
  ) : null
184
142
  ]
185
143
  }
186
144
  ) }));
187
145
  };
188
- $e.displayName = de;
189
- var Ge = "SelectTrigger", ze = n.forwardRef(
146
+ We.displayName = ee;
147
+ var Fe = "SelectTrigger", Ke = n.forwardRef(
190
148
  (t, o) => {
191
- const w = t, { __scopeSelect: e, disabled: s = !1 } = w, r = E(w, ["__scopeSelect", "disabled"]), a = ge(e), c = q(Ge, e), l = c.disabled || s, i = B(o, c.onTriggerChange), f = ve(e), S = n.useRef("touch"), [T, C, I] = gt((u) => {
192
- const g = f().filter((b) => !b.disabled), m = g.find((b) => b.value === c.value), p = St(g, u, m);
193
- p !== void 0 && c.onValueChange(p.value);
194
- }), y = (u) => {
195
- l || (c.onOpenChange(!0), I()), u && (c.triggerPointerDownPosRef.current = {
149
+ const b = t, { __scopeSelect: e, disabled: s = !1 } = b, r = T(b, ["__scopeSelect", "disabled"]), a = ve(e), l = Y(Fe, e), c = l.disabled || s, i = G(o, l.onTriggerChange), f = he(e), g = n.useRef("touch"), [P, S, E] = mt((u) => {
150
+ const y = f().filter((I) => !I.disabled), v = y.find((I) => I.value === l.value), p = ht(y, u, v);
151
+ p !== void 0 && l.onValueChange(p.value);
152
+ }), _ = (u) => {
153
+ c || (l.onOpenChange(!0), E()), u && (l.triggerPointerDownPosRef.current = {
196
154
  x: Math.round(u.pageX),
197
155
  y: Math.round(u.pageY)
198
156
  });
199
157
  };
200
- return /* @__PURE__ */ d(Vt, x(v({ asChild: !0 }, a), { children: /* @__PURE__ */ d(
201
- V.button,
202
- x(v({
158
+ return /* @__PURE__ */ d(Wt, w(h({ asChild: !0 }, a), { children: /* @__PURE__ */ d(
159
+ k.button,
160
+ w(h({
203
161
  type: "button",
204
162
  role: "combobox",
205
- "aria-controls": c.contentId,
206
- "aria-expanded": c.open,
207
- "aria-required": c.required,
163
+ "aria-controls": l.contentId,
164
+ "aria-expanded": l.open,
165
+ "aria-required": l.required,
208
166
  "aria-autocomplete": "none",
209
- dir: c.dir,
210
- "data-state": c.open ? "open" : "closed",
211
- disabled: l,
212
- "data-disabled": l ? "" : void 0,
213
- "data-placeholder": ht(c.value) ? "" : void 0
167
+ dir: l.dir,
168
+ "data-state": l.open ? "open" : "closed",
169
+ disabled: c,
170
+ "data-disabled": c ? "" : void 0,
171
+ "data-placeholder": ft(l.value) ? "" : void 0
214
172
  }, r), {
215
173
  ref: i,
216
174
  onClick: A(r.onClick, (u) => {
217
- u.currentTarget.focus(), S.current !== "mouse" && y(u);
175
+ u.currentTarget.focus(), g.current !== "mouse" && _(u);
218
176
  }),
219
177
  onPointerDown: A(r.onPointerDown, (u) => {
220
- S.current = u.pointerType;
221
- const g = u.target;
222
- g.hasPointerCapture(u.pointerId) && g.releasePointerCapture(u.pointerId), u.button === 0 && u.ctrlKey === !1 && u.pointerType === "mouse" && (y(u), u.preventDefault());
178
+ g.current = u.pointerType;
179
+ const y = u.target;
180
+ y.hasPointerCapture(u.pointerId) && y.releasePointerCapture(u.pointerId), u.button === 0 && u.ctrlKey === !1 && u.pointerType === "mouse" && (_(u), u.preventDefault());
223
181
  }),
224
182
  onKeyDown: A(r.onKeyDown, (u) => {
225
- const g = T.current !== "";
226
- !(u.ctrlKey || u.altKey || u.metaKey) && u.key.length === 1 && C(u.key), !(g && u.key === " ") && Xt.includes(u.key) && (y(), u.preventDefault());
183
+ const y = P.current !== "";
184
+ !(u.ctrlKey || u.altKey || u.metaKey) && u.key.length === 1 && S(u.key), !(y && u.key === " ") && Yt.includes(u.key) && (_(), u.preventDefault());
227
185
  })
228
186
  })
229
187
  ) }));
230
188
  }
231
189
  );
232
- ze.displayName = Ge;
233
- var je = "SelectValue", qe = n.forwardRef(
190
+ Ke.displayName = Fe;
191
+ var $e = "SelectValue", Ge = n.forwardRef(
234
192
  (t, o) => {
235
- const C = t, { __scopeSelect: e, className: s, style: r, children: a, placeholder: c = "" } = C, l = E(C, ["__scopeSelect", "className", "style", "children", "placeholder"]), i = q(je, e), { onValueNodeHasChildrenChange: f } = i, S = a !== void 0, T = B(o, i.onValueNodeChange);
193
+ const S = t, { __scopeSelect: e, className: s, style: r, children: a, placeholder: l = "" } = S, c = T(S, ["__scopeSelect", "className", "style", "children", "placeholder"]), i = Y($e, e), { onValueNodeHasChildrenChange: f } = i, g = a !== void 0, P = G(o, i.onValueNodeChange);
236
194
  return j(() => {
237
- f(S);
238
- }, [f, S]), /* @__PURE__ */ d(
239
- V.span,
240
- x(v({}, l), {
241
- ref: T,
195
+ f(g);
196
+ }, [f, g]), /* @__PURE__ */ d(
197
+ k.span,
198
+ w(h({}, c), {
199
+ ref: P,
242
200
  style: { pointerEvents: "none" },
243
- children: ht(i.value) ? /* @__PURE__ */ d(Me, { children: c }) : a
201
+ children: ft(i.value) ? /* @__PURE__ */ d(Ee, { children: l }) : a
244
202
  })
245
203
  );
246
204
  }
247
205
  );
248
- qe.displayName = je;
249
- var oo = "SelectIcon", Ye = n.forwardRef(
206
+ Ge.displayName = $e;
207
+ var eo = "SelectIcon", ze = n.forwardRef(
250
208
  (t, o) => {
251
- const a = t, { __scopeSelect: e, children: s } = a, r = E(a, ["__scopeSelect", "children"]);
252
- return /* @__PURE__ */ d(V.span, x(v({ "aria-hidden": !0 }, r), { ref: o, children: s || "▼" }));
209
+ const a = t, { __scopeSelect: e, children: s } = a, r = T(a, ["__scopeSelect", "children"]);
210
+ return /* @__PURE__ */ d(k.span, w(h({ "aria-hidden": !0 }, r), { ref: o, children: s || "▼" }));
253
211
  }
254
212
  );
255
- Ye.displayName = oo;
256
- var ro = "SelectPortal", Xe = (t) => /* @__PURE__ */ d(At, v({ asChild: !0 }, t));
257
- Xe.displayName = ro;
258
- var te = "SelectContent", Ze = n.forwardRef(
213
+ ze.displayName = eo;
214
+ var to = "SelectPortal", je = (t) => /* @__PURE__ */ d(Dt, h({ asChild: !0 }, t));
215
+ je.displayName = to;
216
+ var te = "SelectContent", Ye = n.forwardRef(
259
217
  (t, o) => {
260
- const e = q(te, t.__scopeSelect), [s, r] = n.useState();
218
+ const e = Y(te, t.__scopeSelect), [s, r] = n.useState();
261
219
  if (j(() => {
262
220
  r(new DocumentFragment());
263
221
  }, []), !e.open) {
264
222
  const a = s;
265
- return a ? He.createPortal(
266
- /* @__PURE__ */ d(Je, { scope: t.__scopeSelect, children: /* @__PURE__ */ d(he.Slot, { scope: t.__scopeSelect, children: /* @__PURE__ */ d("div", { children: t.children }) }) }),
223
+ return a ? Be.createPortal(
224
+ /* @__PURE__ */ d(qe, { scope: t.__scopeSelect, children: /* @__PURE__ */ d(me.Slot, { scope: t.__scopeSelect, children: /* @__PURE__ */ d("div", { children: t.children }) }) }),
267
225
  a
268
226
  ) : null;
269
227
  }
270
- return /* @__PURE__ */ d(Qe, x(v({}, t), { ref: o }));
228
+ return /* @__PURE__ */ d(Xe, w(h({}, t), { ref: o }));
271
229
  }
272
230
  );
273
- Ze.displayName = te;
274
- var H = 10, [Je, Y] = le(te), no = "SelectContentImpl", Qe = n.forwardRef(
231
+ Ye.displayName = te;
232
+ var V = 10, [qe, q] = le(te), oo = "SelectContentImpl", ro = Et("SelectContent.RemoveScroll"), Xe = n.forwardRef(
275
233
  (t, o) => {
276
234
  const ae = t, {
277
235
  __scopeSelect: e,
278
236
  position: s = "item-aligned",
279
237
  onCloseAutoFocus: r,
280
238
  onEscapeKeyDown: a,
281
- onPointerDownOutside: c,
282
- side: l,
239
+ onPointerDownOutside: l,
240
+ side: c,
283
241
  sideOffset: i,
284
242
  align: f,
285
- alignOffset: S,
286
- arrowPadding: T,
287
- collisionBoundary: C,
288
- collisionPadding: I,
289
- sticky: y,
290
- hideWhenDetached: w,
243
+ alignOffset: g,
244
+ arrowPadding: P,
245
+ collisionBoundary: S,
246
+ collisionPadding: E,
247
+ sticky: _,
248
+ hideWhenDetached: b,
291
249
  avoidCollisions: u
292
- } = ae, g = E(ae, [
250
+ } = ae, y = T(ae, [
293
251
  "__scopeSelect",
294
252
  "position",
295
253
  "onCloseAutoFocus",
@@ -307,103 +265,103 @@ var H = 10, [Je, Y] = le(te), no = "SelectContentImpl", Qe = n.forwardRef(
307
265
  "sticky",
308
266
  "hideWhenDetached",
309
267
  "avoidCollisions"
310
- ]), m = q(te, e), [p, b] = n.useState(null), [N, ce] = n.useState(null), re = B(o, (h) => b(h)), [O, U] = n.useState(null), [X, ne] = n.useState(
268
+ ]), v = Y(te, e), [p, I] = n.useState(null), [M, ce] = n.useState(null), re = G(o, (m) => I(m)), [D, H] = n.useState(null), [X, ne] = n.useState(
311
269
  null
312
- ), k = ve(e), [z, se] = n.useState(!1), W = n.useRef(!1);
270
+ ), B = he(e), [z, se] = n.useState(!1), U = n.useRef(!1);
313
271
  n.useEffect(() => {
314
- if (p) return Ft(p);
315
- }, [p]), Dt();
316
- const D = n.useCallback(
317
- (h) => {
318
- const [M, ...L] = k().map((P) => P.ref.current), [_] = L.slice(-1), R = document.activeElement;
319
- for (const P of h)
320
- if (P === R || (P == null || P.scrollIntoView({ block: "nearest" }), P === M && N && (N.scrollTop = 0), P === _ && N && (N.scrollTop = N.scrollHeight), P == null || P.focus(), document.activeElement !== R)) return;
272
+ if (p) return kt(p);
273
+ }, [p]), Bt();
274
+ const O = n.useCallback(
275
+ (m) => {
276
+ const [R, ...L] = B().map((C) => C.ref.current), [N] = L.slice(-1), x = document.activeElement;
277
+ for (const C of m)
278
+ if (C === x || (C == null || C.scrollIntoView({ block: "nearest" }), C === R && M && (M.scrollTop = 0), C === N && M && (M.scrollTop = M.scrollHeight), C == null || C.focus(), document.activeElement !== x)) return;
321
279
  },
322
- [k, N]
323
- ), F = n.useCallback(
324
- () => D([O, p]),
325
- [D, O, p]
280
+ [B, M]
281
+ ), W = n.useCallback(
282
+ () => O([D, p]),
283
+ [O, D, p]
326
284
  );
327
285
  n.useEffect(() => {
328
- z && F();
329
- }, [z, F]);
330
- const { onOpenChange: K, triggerPointerDownPosRef: Z } = m;
286
+ z && W();
287
+ }, [z, W]);
288
+ const { onOpenChange: F, triggerPointerDownPosRef: Z } = v;
331
289
  n.useEffect(() => {
332
290
  if (p) {
333
- let h = { x: 0, y: 0 };
334
- const M = (_) => {
335
- var R, P, $, G;
336
- h = {
337
- x: Math.abs(Math.round(_.pageX) - ((P = (R = Z.current) == null ? void 0 : R.x) != null ? P : 0)),
338
- y: Math.abs(Math.round(_.pageY) - ((G = ($ = Z.current) == null ? void 0 : $.y) != null ? G : 0))
291
+ let m = { x: 0, y: 0 };
292
+ const R = (N) => {
293
+ var x, C, K, $;
294
+ m = {
295
+ x: Math.abs(Math.round(N.pageX) - ((C = (x = Z.current) == null ? void 0 : x.x) != null ? C : 0)),
296
+ y: Math.abs(Math.round(N.pageY) - (($ = (K = Z.current) == null ? void 0 : K.y) != null ? $ : 0))
339
297
  };
340
- }, L = (_) => {
341
- h.x <= 10 && h.y <= 10 ? _.preventDefault() : p.contains(_.target) || K(!1), document.removeEventListener("pointermove", M), Z.current = null;
298
+ }, L = (N) => {
299
+ m.x <= 10 && m.y <= 10 ? N.preventDefault() : p.contains(N.target) || F(!1), document.removeEventListener("pointermove", R), Z.current = null;
342
300
  };
343
- return Z.current !== null && (document.addEventListener("pointermove", M), document.addEventListener("pointerup", L, { capture: !0, once: !0 })), () => {
344
- document.removeEventListener("pointermove", M), document.removeEventListener("pointerup", L, { capture: !0 });
301
+ return Z.current !== null && (document.addEventListener("pointermove", R), document.addEventListener("pointerup", L, { capture: !0, once: !0 })), () => {
302
+ document.removeEventListener("pointermove", R), document.removeEventListener("pointerup", L, { capture: !0 });
345
303
  };
346
304
  }
347
- }, [p, K, Z]), n.useEffect(() => {
348
- const h = () => K(!1);
349
- return window.addEventListener("blur", h), window.addEventListener("resize", h), () => {
350
- window.removeEventListener("blur", h), window.removeEventListener("resize", h);
305
+ }, [p, F, Z]), n.useEffect(() => {
306
+ const m = () => F(!1);
307
+ return window.addEventListener("blur", m), window.addEventListener("resize", m), () => {
308
+ window.removeEventListener("blur", m), window.removeEventListener("resize", m);
351
309
  };
352
- }, [K]);
353
- const [ue, Se] = gt((h) => {
354
- const M = k().filter((R) => !R.disabled), L = M.find((R) => R.ref.current === document.activeElement), _ = St(M, h, L);
355
- _ && setTimeout(() => _.ref.current.focus());
356
- }), pe = n.useCallback(
357
- (h, M, L) => {
358
- const _ = !W.current && !L;
359
- (m.value !== void 0 && m.value === M || _) && (U(h), _ && (W.current = !0));
310
+ }, [F]);
311
+ const [de, ge] = mt((m) => {
312
+ const R = B().filter((x) => !x.disabled), L = R.find((x) => x.ref.current === document.activeElement), N = ht(R, m, L);
313
+ N && setTimeout(() => N.ref.current.focus());
314
+ }), ue = n.useCallback(
315
+ (m, R, L) => {
316
+ const N = !U.current && !L;
317
+ (v.value !== void 0 && v.value === R || N) && (H(m), N && (U.current = !0));
360
318
  },
361
- [m.value]
362
- ), we = n.useCallback(() => p == null ? void 0 : p.focus(), [p]), ye = n.useCallback(
363
- (h, M, L) => {
364
- const _ = !W.current && !L;
365
- (m.value !== void 0 && m.value === M || _) && ne(h);
319
+ [v.value]
320
+ ), Se = n.useCallback(() => p == null ? void 0 : p.focus(), [p]), we = n.useCallback(
321
+ (m, R, L) => {
322
+ const N = !U.current && !L;
323
+ (v.value !== void 0 && v.value === R || N) && ne(m);
366
324
  },
367
- [m.value]
368
- ), J = s === "popper" ? Ne : et, Ce = J === Ne ? {
369
- side: l,
325
+ [v.value]
326
+ ), J = s === "popper" ? Ie : Ze, ye = J === Ie ? {
327
+ side: c,
370
328
  sideOffset: i,
371
329
  align: f,
372
- alignOffset: S,
373
- arrowPadding: T,
374
- collisionBoundary: C,
375
- collisionPadding: I,
376
- sticky: y,
377
- hideWhenDetached: w,
330
+ alignOffset: g,
331
+ arrowPadding: P,
332
+ collisionBoundary: S,
333
+ collisionPadding: E,
334
+ sticky: _,
335
+ hideWhenDetached: b,
378
336
  avoidCollisions: u
379
337
  } : {};
380
338
  return /* @__PURE__ */ d(
381
- Je,
339
+ qe,
382
340
  {
383
341
  scope: e,
384
342
  content: p,
385
- viewport: N,
343
+ viewport: M,
386
344
  onViewportChange: ce,
387
- itemRefCallback: pe,
388
- selectedItem: O,
389
- onItemLeave: we,
390
- itemTextRefCallback: ye,
391
- focusSelectedItem: F,
345
+ itemRefCallback: ue,
346
+ selectedItem: D,
347
+ onItemLeave: Se,
348
+ itemTextRefCallback: we,
349
+ focusSelectedItem: W,
392
350
  selectedItemText: X,
393
351
  position: s,
394
352
  isPositioned: z,
395
- searchRef: ue,
396
- children: /* @__PURE__ */ d(Kt, { as: Te, allowPinchZoom: !0, children: /* @__PURE__ */ d(
397
- Lt,
353
+ searchRef: de,
354
+ children: /* @__PURE__ */ d(Vt, { as: ro, allowPinchZoom: !0, children: /* @__PURE__ */ d(
355
+ Ht,
398
356
  {
399
357
  asChild: !0,
400
- trapped: m.open,
401
- onMountAutoFocus: (h) => {
402
- h.preventDefault();
358
+ trapped: v.open,
359
+ onMountAutoFocus: (m) => {
360
+ m.preventDefault();
403
361
  },
404
- onUnmountAutoFocus: A(r, (h) => {
405
- var M;
406
- (M = m.trigger) == null || M.focus({ preventScroll: !0 }), h.preventDefault();
362
+ onUnmountAutoFocus: A(r, (m) => {
363
+ var R;
364
+ (R = v.trigger) == null || R.focus({ preventScroll: !0 }), m.preventDefault();
407
365
  }),
408
366
  children: /* @__PURE__ */ d(
409
367
  Ot,
@@ -411,36 +369,36 @@ var H = 10, [Je, Y] = le(te), no = "SelectContentImpl", Qe = n.forwardRef(
411
369
  asChild: !0,
412
370
  disableOutsidePointerEvents: !0,
413
371
  onEscapeKeyDown: a,
414
- onPointerDownOutside: c,
415
- onFocusOutside: (h) => h.preventDefault(),
416
- onDismiss: () => m.onOpenChange(!1),
372
+ onPointerDownOutside: l,
373
+ onFocusOutside: (m) => m.preventDefault(),
374
+ onDismiss: () => v.onOpenChange(!1),
417
375
  children: /* @__PURE__ */ d(
418
376
  J,
419
- x(v(v({
377
+ w(h(h({
420
378
  role: "listbox",
421
- id: m.contentId,
422
- "data-state": m.open ? "open" : "closed",
423
- dir: m.dir,
424
- onContextMenu: (h) => h.preventDefault()
425
- }, g), Ce), {
379
+ id: v.contentId,
380
+ "data-state": v.open ? "open" : "closed",
381
+ dir: v.dir,
382
+ onContextMenu: (m) => m.preventDefault()
383
+ }, y), ye), {
426
384
  onPlaced: () => se(!0),
427
385
  ref: re,
428
- style: v({
386
+ style: h({
429
387
  // flex layout so we can place the scroll buttons properly
430
388
  display: "flex",
431
389
  flexDirection: "column",
432
390
  // reset the outline by default as the content MAY get focused
433
391
  outline: "none"
434
- }, g.style),
435
- onKeyDown: A(g.onKeyDown, (h) => {
436
- const M = h.ctrlKey || h.altKey || h.metaKey;
437
- if (h.key === "Tab" && h.preventDefault(), !M && h.key.length === 1 && Se(h.key), ["ArrowUp", "ArrowDown", "Home", "End"].includes(h.key)) {
438
- let _ = k().filter((R) => !R.disabled).map((R) => R.ref.current);
439
- if (["ArrowUp", "End"].includes(h.key) && (_ = _.slice().reverse()), ["ArrowUp", "ArrowDown"].includes(h.key)) {
440
- const R = h.target, P = _.indexOf(R);
441
- _ = _.slice(P + 1);
392
+ }, y.style),
393
+ onKeyDown: A(y.onKeyDown, (m) => {
394
+ const R = m.ctrlKey || m.altKey || m.metaKey;
395
+ if (m.key === "Tab" && m.preventDefault(), !R && m.key.length === 1 && ge(m.key), ["ArrowUp", "ArrowDown", "Home", "End"].includes(m.key)) {
396
+ let N = B().filter((x) => !x.disabled).map((x) => x.ref.current);
397
+ if (["ArrowUp", "End"].includes(m.key) && (N = N.slice().reverse()), ["ArrowUp", "ArrowDown"].includes(m.key)) {
398
+ const x = m.target, C = N.indexOf(x);
399
+ N = N.slice(C + 1);
442
400
  }
443
- setTimeout(() => D(_)), h.preventDefault();
401
+ setTimeout(() => O(N)), m.preventDefault();
444
402
  }
445
403
  })
446
404
  })
@@ -453,80 +411,80 @@ var H = 10, [Je, Y] = le(te), no = "SelectContentImpl", Qe = n.forwardRef(
453
411
  );
454
412
  }
455
413
  );
456
- Qe.displayName = no;
457
- var so = "SelectItemAlignedPosition", et = n.forwardRef((t, o) => {
458
- const re = t, { __scopeSelect: e, onPlaced: s } = re, r = E(re, ["__scopeSelect", "onPlaced"]), a = q(te, e), c = Y(te, e), [l, i] = n.useState(null), [f, S] = n.useState(null), T = B(o, (O) => S(O)), C = ve(e), I = n.useRef(!1), y = n.useRef(!0), { viewport: w, selectedItem: u, selectedItemText: g, focusSelectedItem: m } = c, p = n.useCallback(() => {
459
- if (a.trigger && a.valueNode && l && f && w && u && g) {
460
- const O = a.trigger.getBoundingClientRect(), U = f.getBoundingClientRect(), X = a.valueNode.getBoundingClientRect(), ne = g.getBoundingClientRect();
414
+ Xe.displayName = oo;
415
+ var no = "SelectItemAlignedPosition", Ze = n.forwardRef((t, o) => {
416
+ const re = t, { __scopeSelect: e, onPlaced: s } = re, r = T(re, ["__scopeSelect", "onPlaced"]), a = Y(te, e), l = q(te, e), [c, i] = n.useState(null), [f, g] = n.useState(null), P = G(o, (D) => g(D)), S = he(e), E = n.useRef(!1), _ = n.useRef(!0), { viewport: b, selectedItem: u, selectedItemText: y, focusSelectedItem: v } = l, p = n.useCallback(() => {
417
+ if (a.trigger && a.valueNode && c && f && b && u && y) {
418
+ const D = a.trigger.getBoundingClientRect(), H = f.getBoundingClientRect(), X = a.valueNode.getBoundingClientRect(), ne = y.getBoundingClientRect();
461
419
  if (a.dir !== "rtl") {
462
- const R = ne.left - U.left, P = X.left - R, $ = O.left - P, G = O.width + $, be = Math.max(G, U.width), xe = window.innerWidth - H, Ie = Ve(P, [
463
- H,
420
+ const x = ne.left - H.left, C = X.left - x, K = D.left - C, $ = D.width + K, be = Math.max($, H.width), xe = window.innerWidth - V, Ce = Le(C, [
421
+ V,
464
422
  // Prevents the content from going off the starting edge of the
465
423
  // viewport. It may still go off the ending edge, but this can be
466
424
  // controlled by the user since they may want to manage overflow in a
467
425
  // specific way.
468
426
  // https://github.com/radix-ui/primitives/issues/2049
469
- Math.max(H, xe - be)
427
+ Math.max(V, xe - be)
470
428
  ]);
471
- l.style.minWidth = G + "px", l.style.left = Ie + "px";
429
+ c.style.minWidth = $ + "px", c.style.left = Ce + "px";
472
430
  } else {
473
- const R = U.right - ne.right, P = window.innerWidth - X.right - R, $ = window.innerWidth - O.right - P, G = O.width + $, be = Math.max(G, U.width), xe = window.innerWidth - H, Ie = Ve(P, [
474
- H,
475
- Math.max(H, xe - be)
431
+ const x = H.right - ne.right, C = window.innerWidth - X.right - x, K = window.innerWidth - D.right - C, $ = D.width + K, be = Math.max($, H.width), xe = window.innerWidth - V, Ce = Le(C, [
432
+ V,
433
+ Math.max(V, xe - be)
476
434
  ]);
477
- l.style.minWidth = G + "px", l.style.right = Ie + "px";
435
+ c.style.minWidth = $ + "px", c.style.right = Ce + "px";
478
436
  }
479
- const k = C(), z = window.innerHeight - H * 2, se = w.scrollHeight, W = window.getComputedStyle(f), D = parseInt(W.borderTopWidth, 10), F = parseInt(W.paddingTop, 10), K = parseInt(W.borderBottomWidth, 10), Z = parseInt(W.paddingBottom, 10), ue = D + F + se + Z + K, Se = Math.min(u.offsetHeight * 5, ue), pe = window.getComputedStyle(w), we = parseInt(pe.paddingTop, 10), ye = parseInt(pe.paddingBottom, 10), J = O.top + O.height / 2 - H, Ce = z - J, ae = u.offsetHeight / 2, h = u.offsetTop + ae, M = D + F + h, L = ue - M;
480
- if (M <= J) {
481
- const R = k.length > 0 && u === k[k.length - 1].ref.current;
482
- l.style.bottom = "0px";
483
- const P = f.clientHeight - w.offsetTop - w.offsetHeight, $ = Math.max(
484
- Ce,
437
+ const B = S(), z = window.innerHeight - V * 2, se = b.scrollHeight, U = window.getComputedStyle(f), O = parseInt(U.borderTopWidth, 10), W = parseInt(U.paddingTop, 10), F = parseInt(U.borderBottomWidth, 10), Z = parseInt(U.paddingBottom, 10), de = O + W + se + Z + F, ge = Math.min(u.offsetHeight * 5, de), ue = window.getComputedStyle(b), Se = parseInt(ue.paddingTop, 10), we = parseInt(ue.paddingBottom, 10), J = D.top + D.height / 2 - V, ye = z - J, ae = u.offsetHeight / 2, m = u.offsetTop + ae, R = O + W + m, L = de - R;
438
+ if (R <= J) {
439
+ const x = B.length > 0 && u === B[B.length - 1].ref.current;
440
+ c.style.bottom = "0px";
441
+ const C = f.clientHeight - b.offsetTop - b.offsetHeight, K = Math.max(
442
+ ye,
485
443
  ae + // viewport might have padding bottom, include it to avoid a scrollable viewport
486
- (R ? ye : 0) + P + K
487
- ), G = M + $;
488
- l.style.height = G + "px";
444
+ (x ? we : 0) + C + F
445
+ ), $ = R + K;
446
+ c.style.height = $ + "px";
489
447
  } else {
490
- const R = k.length > 0 && u === k[0].ref.current;
491
- l.style.top = "0px";
492
- const $ = Math.max(
448
+ const x = B.length > 0 && u === B[0].ref.current;
449
+ c.style.top = "0px";
450
+ const K = Math.max(
493
451
  J,
494
- D + w.offsetTop + // viewport might have padding top, include it to avoid a scrollable viewport
495
- (R ? we : 0) + ae
452
+ O + b.offsetTop + // viewport might have padding top, include it to avoid a scrollable viewport
453
+ (x ? Se : 0) + ae
496
454
  ) + L;
497
- l.style.height = $ + "px", w.scrollTop = M - J + w.offsetTop;
455
+ c.style.height = K + "px", b.scrollTop = R - J + b.offsetTop;
498
456
  }
499
- l.style.margin = `${H}px 0`, l.style.minHeight = Se + "px", l.style.maxHeight = z + "px", s == null || s(), requestAnimationFrame(() => I.current = !0);
457
+ c.style.margin = `${V}px 0`, c.style.minHeight = ge + "px", c.style.maxHeight = z + "px", s == null || s(), requestAnimationFrame(() => E.current = !0);
500
458
  }
501
459
  }, [
502
- C,
460
+ S,
503
461
  a.trigger,
504
462
  a.valueNode,
505
- l,
463
+ c,
506
464
  f,
507
- w,
465
+ b,
508
466
  u,
509
- g,
467
+ y,
510
468
  a.dir,
511
469
  s
512
470
  ]);
513
471
  j(() => p(), [p]);
514
- const [b, N] = n.useState();
472
+ const [I, M] = n.useState();
515
473
  j(() => {
516
- f && N(window.getComputedStyle(f).zIndex);
474
+ f && M(window.getComputedStyle(f).zIndex);
517
475
  }, [f]);
518
476
  const ce = n.useCallback(
519
- (O) => {
520
- O && y.current === !0 && (p(), m == null || m(), y.current = !1);
477
+ (D) => {
478
+ D && _.current === !0 && (p(), v == null || v(), _.current = !1);
521
479
  },
522
- [p, m]
480
+ [p, v]
523
481
  );
524
482
  return /* @__PURE__ */ d(
525
- lo,
483
+ ao,
526
484
  {
527
485
  scope: e,
528
- contentWrapper: l,
529
- shouldExpandOnScrollRef: I,
486
+ contentWrapper: c,
487
+ shouldExpandOnScrollRef: E,
530
488
  onScrollButtonChange: ce,
531
489
  children: /* @__PURE__ */ d(
532
490
  "div",
@@ -536,13 +494,13 @@ var so = "SelectItemAlignedPosition", et = n.forwardRef((t, o) => {
536
494
  display: "flex",
537
495
  flexDirection: "column",
538
496
  position: "fixed",
539
- zIndex: b
497
+ zIndex: I
540
498
  },
541
499
  children: /* @__PURE__ */ d(
542
- V.div,
543
- x(v({}, r), {
544
- ref: T,
545
- style: v({
500
+ k.div,
501
+ w(h({}, r), {
502
+ ref: P,
503
+ style: h({
546
504
  // When we get the height of the content, it includes borders. If we were to set
547
505
  // the height without having `boxSizing: 'border-box'` it would be too big.
548
506
  boxSizing: "border-box",
@@ -556,24 +514,24 @@ var so = "SelectItemAlignedPosition", et = n.forwardRef((t, o) => {
556
514
  }
557
515
  );
558
516
  });
559
- et.displayName = so;
560
- var ao = "SelectPopperPosition", Ne = n.forwardRef((t, o) => {
561
- const l = t, {
517
+ Ze.displayName = no;
518
+ var so = "SelectPopperPosition", Ie = n.forwardRef((t, o) => {
519
+ const c = t, {
562
520
  __scopeSelect: e,
563
521
  align: s = "start",
564
- collisionPadding: r = H
565
- } = l, a = E(l, [
522
+ collisionPadding: r = V
523
+ } = c, a = T(c, [
566
524
  "__scopeSelect",
567
525
  "align",
568
526
  "collisionPadding"
569
- ]), c = ge(e);
527
+ ]), l = ve(e);
570
528
  return /* @__PURE__ */ d(
571
- Ht,
572
- x(v(v({}, c), a), {
529
+ Ft,
530
+ w(h(h({}, l), a), {
573
531
  ref: o,
574
532
  align: s,
575
533
  collisionPadding: r,
576
- style: x(v({
534
+ style: w(h({
577
535
  // Ensure border-box for floating-ui calculations
578
536
  boxSizing: "border-box"
579
537
  }, a.style), {
@@ -586,11 +544,11 @@ var ao = "SelectPopperPosition", Ne = n.forwardRef((t, o) => {
586
544
  })
587
545
  );
588
546
  });
589
- Ne.displayName = ao;
590
- var [lo, Oe] = le(te, {}), Re = "SelectViewport", tt = n.forwardRef(
547
+ Ie.displayName = so;
548
+ var [ao, Me] = le(te, {}), Te = "SelectViewport", Je = n.forwardRef(
591
549
  (t, o) => {
592
- const f = t, { __scopeSelect: e, nonce: s } = f, r = E(f, ["__scopeSelect", "nonce"]), a = Y(Re, e), c = Oe(Re, e), l = B(o, a.onViewportChange), i = n.useRef(0);
593
- return /* @__PURE__ */ ee(Me, { children: [
550
+ const f = t, { __scopeSelect: e, nonce: s } = f, r = T(f, ["__scopeSelect", "nonce"]), a = q(Te, e), l = Me(Te, e), c = G(o, a.onViewportChange), i = n.useRef(0);
551
+ return /* @__PURE__ */ Q(Ee, { children: [
594
552
  /* @__PURE__ */ d(
595
553
  "style",
596
554
  {
@@ -600,14 +558,14 @@ var [lo, Oe] = le(te, {}), Re = "SelectViewport", tt = n.forwardRef(
600
558
  nonce: s
601
559
  }
602
560
  ),
603
- /* @__PURE__ */ d(he.Slot, { scope: e, children: /* @__PURE__ */ d(
604
- V.div,
605
- x(v({
561
+ /* @__PURE__ */ d(me.Slot, { scope: e, children: /* @__PURE__ */ d(
562
+ k.div,
563
+ w(h({
606
564
  "data-radix-select-viewport": "",
607
565
  role: "presentation"
608
566
  }, r), {
609
- ref: l,
610
- style: v({
567
+ ref: c,
568
+ style: h({
611
569
  // we use position: 'relative' here on the `viewport` so that when we call
612
570
  // `selectedItem.offsetTop` in calculations, the offset is relative to the viewport
613
571
  // (independent of the scrollUpButton).
@@ -619,121 +577,121 @@ var [lo, Oe] = le(te, {}), Re = "SelectViewport", tt = n.forwardRef(
619
577
  // https://developer.chrome.com/blog/vertical-form-controls
620
578
  overflow: "hidden auto"
621
579
  }, r.style),
622
- onScroll: A(r.onScroll, (S) => {
623
- const T = S.currentTarget, { contentWrapper: C, shouldExpandOnScrollRef: I } = c;
624
- if (I != null && I.current && C) {
625
- const y = Math.abs(i.current - T.scrollTop);
626
- if (y > 0) {
627
- const w = window.innerHeight - H * 2, u = parseFloat(C.style.minHeight), g = parseFloat(C.style.height), m = Math.max(u, g);
628
- if (m < w) {
629
- const p = m + y, b = Math.min(w, p), N = p - b;
630
- C.style.height = b + "px", C.style.bottom === "0px" && (T.scrollTop = N > 0 ? N : 0, C.style.justifyContent = "flex-end");
580
+ onScroll: A(r.onScroll, (g) => {
581
+ const P = g.currentTarget, { contentWrapper: S, shouldExpandOnScrollRef: E } = l;
582
+ if (E != null && E.current && S) {
583
+ const _ = Math.abs(i.current - P.scrollTop);
584
+ if (_ > 0) {
585
+ const b = window.innerHeight - V * 2, u = parseFloat(S.style.minHeight), y = parseFloat(S.style.height), v = Math.max(u, y);
586
+ if (v < b) {
587
+ const p = v + _, I = Math.min(b, p), M = p - I;
588
+ S.style.height = I + "px", S.style.bottom === "0px" && (P.scrollTop = M > 0 ? M : 0, S.style.justifyContent = "flex-end");
631
589
  }
632
590
  }
633
591
  }
634
- i.current = T.scrollTop;
592
+ i.current = P.scrollTop;
635
593
  })
636
594
  })
637
595
  ) })
638
596
  ] });
639
597
  }
640
598
  );
641
- tt.displayName = Re;
642
- var ot = "SelectGroup", [co, io] = le(ot), rt = n.forwardRef(
599
+ Je.displayName = Te;
600
+ var Qe = "SelectGroup", [lo, co] = le(Qe), et = n.forwardRef(
643
601
  (t, o) => {
644
- const a = t, { __scopeSelect: e } = a, s = E(a, ["__scopeSelect"]), r = Ae();
645
- return /* @__PURE__ */ d(co, { scope: e, id: r, children: /* @__PURE__ */ d(V.div, x(v({ role: "group", "aria-labelledby": r }, s), { ref: o })) });
602
+ const a = t, { __scopeSelect: e } = a, s = T(a, ["__scopeSelect"]), r = _e();
603
+ return /* @__PURE__ */ d(lo, { scope: e, id: r, children: /* @__PURE__ */ d(k.div, w(h({ role: "group", "aria-labelledby": r }, s), { ref: o })) });
646
604
  }
647
605
  );
648
- rt.displayName = ot;
649
- var nt = "SelectLabel", st = n.forwardRef(
606
+ et.displayName = Qe;
607
+ var tt = "SelectLabel", ot = n.forwardRef(
650
608
  (t, o) => {
651
- const a = t, { __scopeSelect: e } = a, s = E(a, ["__scopeSelect"]), r = io(nt, e);
652
- return /* @__PURE__ */ d(V.div, x(v({ id: r.id }, s), { ref: o }));
609
+ const a = t, { __scopeSelect: e } = a, s = T(a, ["__scopeSelect"]), r = co(tt, e);
610
+ return /* @__PURE__ */ d(k.div, w(h({ id: r.id }, s), { ref: o }));
653
611
  }
654
612
  );
655
- st.displayName = nt;
656
- var me = "SelectItem", [uo, at] = le(me), lt = n.forwardRef(
613
+ ot.displayName = tt;
614
+ var fe = "SelectItem", [io, rt] = le(fe), nt = n.forwardRef(
657
615
  (t, o) => {
658
- const m = t, {
616
+ const v = t, {
659
617
  __scopeSelect: e,
660
618
  value: s,
661
619
  disabled: r = !1,
662
620
  textValue: a
663
- } = m, c = E(m, [
621
+ } = v, l = T(v, [
664
622
  "__scopeSelect",
665
623
  "value",
666
624
  "disabled",
667
625
  "textValue"
668
- ]), l = q(me, e), i = Y(me, e), f = l.value === s, [S, T] = n.useState(a != null ? a : ""), [C, I] = n.useState(!1), y = B(
626
+ ]), c = Y(fe, e), i = q(fe, e), f = c.value === s, [g, P] = n.useState(a != null ? a : ""), [S, E] = n.useState(!1), _ = G(
669
627
  o,
670
628
  (p) => {
671
- var b;
672
- return (b = i.itemRefCallback) == null ? void 0 : b.call(i, p, s, r);
629
+ var I;
630
+ return (I = i.itemRefCallback) == null ? void 0 : I.call(i, p, s, r);
673
631
  }
674
- ), w = Ae(), u = n.useRef("touch"), g = () => {
675
- r || (l.onValueChange(s), l.onOpenChange(!1));
632
+ ), b = _e(), u = n.useRef("touch"), y = () => {
633
+ r || (c.onValueChange(s), c.onOpenChange(!1));
676
634
  };
677
635
  if (s === "")
678
636
  throw new Error(
679
637
  "A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder."
680
638
  );
681
639
  return /* @__PURE__ */ d(
682
- uo,
640
+ io,
683
641
  {
684
642
  scope: e,
685
643
  value: s,
686
644
  disabled: r,
687
- textId: w,
645
+ textId: b,
688
646
  isSelected: f,
689
647
  onItemTextChange: n.useCallback((p) => {
690
- T((b) => {
691
- var N;
692
- return b || ((N = p == null ? void 0 : p.textContent) != null ? N : "").trim();
648
+ P((I) => {
649
+ var M;
650
+ return I || ((M = p == null ? void 0 : p.textContent) != null ? M : "").trim();
693
651
  });
694
652
  }, []),
695
653
  children: /* @__PURE__ */ d(
696
- he.ItemSlot,
654
+ me.ItemSlot,
697
655
  {
698
656
  scope: e,
699
657
  value: s,
700
658
  disabled: r,
701
- textValue: S,
659
+ textValue: g,
702
660
  children: /* @__PURE__ */ d(
703
- V.div,
704
- x(v({
661
+ k.div,
662
+ w(h({
705
663
  role: "option",
706
- "aria-labelledby": w,
707
- "data-highlighted": C ? "" : void 0,
708
- "aria-selected": f && C,
664
+ "aria-labelledby": b,
665
+ "data-highlighted": S ? "" : void 0,
666
+ "aria-selected": f && S,
709
667
  "data-state": f ? "checked" : "unchecked",
710
668
  "aria-disabled": r || void 0,
711
669
  "data-disabled": r ? "" : void 0,
712
670
  tabIndex: r ? void 0 : -1
713
- }, c), {
714
- ref: y,
715
- onFocus: A(c.onFocus, () => I(!0)),
716
- onBlur: A(c.onBlur, () => I(!1)),
717
- onClick: A(c.onClick, () => {
718
- u.current !== "mouse" && g();
671
+ }, l), {
672
+ ref: _,
673
+ onFocus: A(l.onFocus, () => E(!0)),
674
+ onBlur: A(l.onBlur, () => E(!1)),
675
+ onClick: A(l.onClick, () => {
676
+ console.log("test"), u.current !== "mouse" && y();
719
677
  }),
720
- onPointerUp: A(c.onPointerUp, () => {
721
- u.current === "mouse" && g();
678
+ onPointerUp: A(l.onPointerUp, () => {
679
+ u.current === "mouse" && y();
722
680
  }),
723
- onPointerDown: A(c.onPointerDown, (p) => {
681
+ onPointerDown: A(l.onPointerDown, (p) => {
724
682
  u.current = p.pointerType;
725
683
  }),
726
- onPointerMove: A(c.onPointerMove, (p) => {
727
- var b;
728
- u.current = p.pointerType, r ? (b = i.onItemLeave) == null || b.call(i) : u.current === "mouse" && p.currentTarget.focus({ preventScroll: !0 });
684
+ onPointerMove: A(l.onPointerMove, (p) => {
685
+ var I;
686
+ u.current = p.pointerType, r ? (I = i.onItemLeave) == null || I.call(i) : u.current === "mouse" && p.currentTarget.focus({ preventScroll: !0 });
729
687
  }),
730
- onPointerLeave: A(c.onPointerLeave, (p) => {
731
- var b;
732
- p.currentTarget === document.activeElement && ((b = i.onItemLeave) == null || b.call(i));
688
+ onPointerLeave: A(l.onPointerLeave, (p) => {
689
+ var I;
690
+ p.currentTarget === document.activeElement && ((I = i.onItemLeave) == null || I.call(i));
733
691
  }),
734
- onKeyDown: A(c.onKeyDown, (p) => {
735
- var N;
736
- ((N = i.searchRef) == null ? void 0 : N.current) !== "" && p.key === " " || (Zt.includes(p.key) && g(), p.key === " " && p.preventDefault());
692
+ onKeyDown: A(l.onKeyDown, (p) => {
693
+ var M;
694
+ ((M = i.searchRef) == null ? void 0 : M.current) !== "" && p.key === " " || (qt.includes(p.key) && y(), p.key === " " && p.preventDefault());
737
695
  })
738
696
  })
739
697
  )
@@ -743,148 +701,158 @@ var me = "SelectItem", [uo, at] = le(me), lt = n.forwardRef(
743
701
  );
744
702
  }
745
703
  );
746
- lt.displayName = me;
747
- var ie = "SelectItemText", ct = n.forwardRef(
704
+ nt.displayName = fe;
705
+ var ie = "SelectItemText", st = n.forwardRef(
748
706
  (t, o) => {
749
- const g = t, { __scopeSelect: e, className: s, style: r } = g, a = E(g, ["__scopeSelect", "className", "style"]), c = q(ie, e), l = Y(ie, e), i = at(ie, e), f = to(ie, e), [S, T] = n.useState(null), C = B(
707
+ const y = t, { __scopeSelect: e, className: s, style: r } = y, a = T(y, ["__scopeSelect", "className", "style"]), l = Y(ie, e), c = q(ie, e), i = rt(ie, e), f = Qt(ie, e), [g, P] = n.useState(null), S = G(
750
708
  o,
751
- (m) => T(m),
709
+ (v) => P(v),
752
710
  i.onItemTextChange,
753
- (m) => {
711
+ (v) => {
754
712
  var p;
755
- return (p = l.itemTextRefCallback) == null ? void 0 : p.call(l, m, i.value, i.disabled);
713
+ return (p = c.itemTextRefCallback) == null ? void 0 : p.call(c, v, i.value, i.disabled);
756
714
  }
757
- ), I = S == null ? void 0 : S.textContent, y = n.useMemo(
758
- () => /* @__PURE__ */ d("option", { value: i.value, disabled: i.disabled, children: I }, i.value),
759
- [i.disabled, i.value, I]
760
- ), { onNativeOptionAdd: w, onNativeOptionRemove: u } = f;
761
- return j(() => (w(y), () => u(y)), [w, u, y]), /* @__PURE__ */ ee(Me, { children: [
762
- /* @__PURE__ */ d(V.span, x(v({ id: i.textId }, a), { ref: C })),
763
- i.isSelected && c.valueNode && !c.valueNodeHasChildren ? He.createPortal(a.children, c.valueNode) : null
715
+ ), E = g == null ? void 0 : g.textContent, _ = n.useMemo(
716
+ () => /* @__PURE__ */ d("option", { value: i.value, disabled: i.disabled, children: E }, i.value),
717
+ [i.disabled, i.value, E]
718
+ ), { onNativeOptionAdd: b, onNativeOptionRemove: u } = f;
719
+ return j(() => (b(_), () => u(_)), [b, u, _]), /* @__PURE__ */ Q(Ee, { children: [
720
+ /* @__PURE__ */ d(k.span, w(h({ id: i.textId }, a), { ref: S })),
721
+ i.isSelected && l.valueNode && !l.valueNodeHasChildren ? Be.createPortal(a.children, l.valueNode) : null
764
722
  ] });
765
723
  }
766
724
  );
767
- ct.displayName = ie;
768
- var it = "SelectItemIndicator", dt = n.forwardRef(
725
+ st.displayName = ie;
726
+ var at = "SelectItemIndicator", lt = n.forwardRef(
769
727
  (t, o) => {
770
- const a = t, { __scopeSelect: e } = a, s = E(a, ["__scopeSelect"]);
771
- return at(it, e).isSelected ? /* @__PURE__ */ d(V.span, x(v({ "aria-hidden": !0 }, s), { ref: o })) : null;
728
+ const a = t, { __scopeSelect: e } = a, s = T(a, ["__scopeSelect"]);
729
+ return rt(at, e).isSelected ? /* @__PURE__ */ d(k.span, w(h({ "aria-hidden": !0 }, s), { ref: o })) : null;
772
730
  }
773
731
  );
774
- dt.displayName = it;
775
- var Pe = "SelectScrollUpButton", ut = n.forwardRef((t, o) => {
776
- const e = Y(Pe, t.__scopeSelect), s = Oe(Pe, t.__scopeSelect), [r, a] = n.useState(!1), c = B(o, s.onScrollButtonChange);
732
+ lt.displayName = at;
733
+ var Ne = "SelectScrollUpButton", ct = n.forwardRef((t, o) => {
734
+ const e = q(Ne, t.__scopeSelect), s = Me(Ne, t.__scopeSelect), [r, a] = n.useState(!1), l = G(o, s.onScrollButtonChange);
777
735
  return j(() => {
778
736
  if (e.viewport && e.isPositioned) {
779
- let l = function() {
737
+ let c = function() {
780
738
  const f = i.scrollTop > 0;
781
739
  a(f);
782
740
  };
783
741
  const i = e.viewport;
784
- return l(), i.addEventListener("scroll", l), () => i.removeEventListener("scroll", l);
742
+ return c(), i.addEventListener("scroll", c), () => i.removeEventListener("scroll", c);
785
743
  }
786
744
  }, [e.viewport, e.isPositioned]), r ? /* @__PURE__ */ d(
787
- ft,
788
- x(v({}, t), {
789
- ref: c,
745
+ dt,
746
+ w(h({}, t), {
747
+ ref: l,
790
748
  onAutoScroll: () => {
791
- const { viewport: l, selectedItem: i } = e;
792
- l && i && (l.scrollTop = l.scrollTop - i.offsetHeight);
749
+ const { viewport: c, selectedItem: i } = e;
750
+ c && i && (c.scrollTop = c.scrollTop - i.offsetHeight);
793
751
  }
794
752
  })
795
753
  ) : null;
796
754
  });
797
- ut.displayName = Pe;
798
- var Ee = "SelectScrollDownButton", pt = n.forwardRef((t, o) => {
799
- const e = Y(Ee, t.__scopeSelect), s = Oe(Ee, t.__scopeSelect), [r, a] = n.useState(!1), c = B(o, s.onScrollButtonChange);
755
+ ct.displayName = Ne;
756
+ var Re = "SelectScrollDownButton", it = n.forwardRef((t, o) => {
757
+ const e = q(Re, t.__scopeSelect), s = Me(Re, t.__scopeSelect), [r, a] = n.useState(!1), l = G(o, s.onScrollButtonChange);
800
758
  return j(() => {
801
759
  if (e.viewport && e.isPositioned) {
802
- let l = function() {
803
- const f = i.scrollHeight - i.clientHeight, S = Math.ceil(i.scrollTop) < f;
804
- a(S);
760
+ let c = function() {
761
+ const f = i.scrollHeight - i.clientHeight, g = Math.ceil(i.scrollTop) < f;
762
+ a(g);
805
763
  };
806
764
  const i = e.viewport;
807
- return l(), i.addEventListener("scroll", l), () => i.removeEventListener("scroll", l);
765
+ return c(), i.addEventListener("scroll", c), () => i.removeEventListener("scroll", c);
808
766
  }
809
767
  }, [e.viewport, e.isPositioned]), r ? /* @__PURE__ */ d(
810
- ft,
811
- x(v({}, t), {
812
- ref: c,
768
+ dt,
769
+ w(h({}, t), {
770
+ ref: l,
813
771
  onAutoScroll: () => {
814
- const { viewport: l, selectedItem: i } = e;
815
- l && i && (l.scrollTop = l.scrollTop + i.offsetHeight);
772
+ const { viewport: c, selectedItem: i } = e;
773
+ c && i && (c.scrollTop = c.scrollTop + i.offsetHeight);
816
774
  }
817
775
  })
818
776
  ) : null;
819
777
  });
820
- pt.displayName = Ee;
821
- var ft = n.forwardRef((t, o) => {
822
- const f = t, { __scopeSelect: e, onAutoScroll: s } = f, r = E(f, ["__scopeSelect", "onAutoScroll"]), a = Y("SelectScrollButton", e), c = n.useRef(null), l = ve(e), i = n.useCallback(() => {
823
- c.current !== null && (window.clearInterval(c.current), c.current = null);
778
+ it.displayName = Re;
779
+ var dt = n.forwardRef((t, o) => {
780
+ const f = t, { __scopeSelect: e, onAutoScroll: s } = f, r = T(f, ["__scopeSelect", "onAutoScroll"]), a = q("SelectScrollButton", e), l = n.useRef(null), c = he(e), i = n.useCallback(() => {
781
+ l.current !== null && (window.clearInterval(l.current), l.current = null);
824
782
  }, []);
825
783
  return n.useEffect(() => () => i(), [i]), j(() => {
826
- var T;
827
- const S = l().find((C) => C.ref.current === document.activeElement);
828
- (T = S == null ? void 0 : S.ref.current) == null || T.scrollIntoView({ block: "nearest" });
829
- }, [l]), /* @__PURE__ */ d(
830
- V.div,
831
- x(v({
784
+ var P;
785
+ const g = c().find((S) => S.ref.current === document.activeElement);
786
+ (P = g == null ? void 0 : g.ref.current) == null || P.scrollIntoView({ block: "nearest" });
787
+ }, [c]), /* @__PURE__ */ d(
788
+ k.div,
789
+ w(h({
832
790
  "aria-hidden": !0
833
791
  }, r), {
834
792
  ref: o,
835
- style: v({ flexShrink: 0 }, r.style),
793
+ style: h({ flexShrink: 0 }, r.style),
836
794
  onPointerDown: A(r.onPointerDown, () => {
837
- c.current === null && (c.current = window.setInterval(s, 50));
795
+ l.current === null && (l.current = window.setInterval(s, 50));
838
796
  }),
839
797
  onPointerMove: A(r.onPointerMove, () => {
840
- var S;
841
- (S = a.onItemLeave) == null || S.call(a), c.current === null && (c.current = window.setInterval(s, 50));
798
+ var g;
799
+ (g = a.onItemLeave) == null || g.call(a), l.current === null && (l.current = window.setInterval(s, 50));
842
800
  }),
843
801
  onPointerLeave: A(r.onPointerLeave, () => {
844
802
  i();
845
803
  })
846
804
  })
847
805
  );
848
- }), po = "SelectSeparator", mt = n.forwardRef(
806
+ }), uo = "SelectSeparator", ut = n.forwardRef(
849
807
  (t, o) => {
850
- const r = t, { __scopeSelect: e } = r, s = E(r, ["__scopeSelect"]);
851
- return /* @__PURE__ */ d(V.div, x(v({ "aria-hidden": !0 }, s), { ref: o }));
808
+ const r = t, { __scopeSelect: e } = r, s = T(r, ["__scopeSelect"]);
809
+ return /* @__PURE__ */ d(k.div, w(h({ "aria-hidden": !0 }, s), { ref: o }));
852
810
  }
853
811
  );
854
- mt.displayName = po;
855
- var _e = "SelectArrow", fo = n.forwardRef(
812
+ ut.displayName = uo;
813
+ var Pe = "SelectArrow", po = n.forwardRef(
856
814
  (t, o) => {
857
- const l = t, { __scopeSelect: e } = l, s = E(l, ["__scopeSelect"]), r = ge(e), a = q(_e, e), c = Y(_e, e);
858
- return a.open && c.position === "popper" ? /* @__PURE__ */ d(Ut, x(v(v({}, r), s), { ref: o })) : null;
815
+ const c = t, { __scopeSelect: e } = c, s = T(c, ["__scopeSelect"]), r = ve(e), a = Y(Pe, e), l = q(Pe, e);
816
+ return a.open && l.position === "popper" ? /* @__PURE__ */ d(Kt, w(h(h({}, r), s), { ref: o })) : null;
859
817
  }
860
818
  );
861
- fo.displayName = _e;
862
- function ht(t) {
863
- return t === "" || t === void 0;
864
- }
865
- var vt = n.forwardRef(
866
- (t, o) => {
867
- const l = t, { value: e } = l, s = E(l, ["value"]), r = n.useRef(null), a = B(o, r), c = Wt(e);
819
+ po.displayName = Pe;
820
+ var fo = "SelectBubbleInput", pt = n.forwardRef(
821
+ (r, s) => {
822
+ var a = r, { __scopeSelect: t, value: o } = a, e = T(a, ["__scopeSelect", "value"]);
823
+ const l = n.useRef(null), c = G(s, l), i = $t(o);
868
824
  return n.useEffect(() => {
869
- const i = r.current, f = window.HTMLSelectElement.prototype, T = Object.getOwnPropertyDescriptor(
870
- f,
825
+ const f = l.current;
826
+ if (!f) return;
827
+ const g = window.HTMLSelectElement.prototype, S = Object.getOwnPropertyDescriptor(
828
+ g,
871
829
  "value"
872
830
  ).set;
873
- if (c !== e && T) {
874
- const C = new Event("change", { bubbles: !0 });
875
- T.call(i, e), i.dispatchEvent(C);
831
+ if (i !== o && S) {
832
+ const E = new Event("change", { bubbles: !0 });
833
+ S.call(f, o), f.dispatchEvent(E);
876
834
  }
877
- }, [c, e]), /* @__PURE__ */ d(Bt, { asChild: !0, children: /* @__PURE__ */ d("select", x(v({}, s), { ref: a, defaultValue: e })) });
835
+ }, [i, o]), /* @__PURE__ */ d(
836
+ k.select,
837
+ w(h({}, e), {
838
+ style: h(h({}, Gt), e.style),
839
+ ref: c,
840
+ defaultValue: o
841
+ })
842
+ );
878
843
  }
879
844
  );
880
- vt.displayName = "BubbleSelect";
881
- function gt(t) {
845
+ pt.displayName = fo;
846
+ function ft(t) {
847
+ return t === "" || t === void 0;
848
+ }
849
+ function mt(t) {
882
850
  const o = Mt(t), e = n.useRef(""), s = n.useRef(0), r = n.useCallback(
883
- (c) => {
884
- const l = e.current + c;
885
- o(l), function i(f) {
851
+ (l) => {
852
+ const c = e.current + l;
853
+ o(c), function i(f) {
886
854
  e.current = f, window.clearTimeout(s.current), f !== "" && (s.current = window.setTimeout(() => i(""), 1e3));
887
- }(l);
855
+ }(c);
888
856
  },
889
857
  [o]
890
858
  ), a = n.useCallback(() => {
@@ -892,11 +860,11 @@ function gt(t) {
892
860
  }, []);
893
861
  return n.useEffect(() => () => window.clearTimeout(s.current), []), [e, r, a];
894
862
  }
895
- function St(t, o, e) {
863
+ function ht(t, o, e) {
896
864
  const r = o.length > 1 && Array.from(o).every((f) => f === o[0]) ? o[0] : o, a = e ? t.indexOf(e) : -1;
897
- let c = mo(t, Math.max(a, 0));
898
- r.length === 1 && (c = c.filter((f) => f !== e));
899
- const i = c.find(
865
+ let l = mo(t, Math.max(a, 0));
866
+ r.length === 1 && (l = l.filter((f) => f !== e));
867
+ const i = l.find(
900
868
  (f) => f.textValue.toLowerCase().startsWith(r.toLowerCase())
901
869
  );
902
870
  return i !== e ? i : void 0;
@@ -904,8 +872,8 @@ function St(t, o, e) {
904
872
  function mo(t, o) {
905
873
  return t.map((e, s) => t[(o + s) % t.length]);
906
874
  }
907
- var ho = $e, wt = ze, vo = qe, go = Ye, So = Xe, yt = Ze, wo = tt, yo = rt, Ct = st, bt = lt, Co = ct, bo = dt, xt = ut, It = pt, Tt = mt;
908
- const Xo = ho, Zo = yo, Jo = vo, xo = oe({
875
+ var ho = We, vt = Ke, vo = Ge, go = ze, So = je, gt = Ye, wo = Je, yo = et, St = ot, wt = nt, bo = st, xo = lt, yt = ct, bt = it, xt = ut;
876
+ const er = ho, tr = yo, or = vo, Co = oe({
909
877
  base: [
910
878
  "flex h-10 w-full items-center justify-between whitespace-nowrap rounded-lg border border-secondary-border bg-secondary-bg px-3 py-2.5 shadow-sm outline-none lg:h-9 lg:py-2",
911
879
  "text-sm text-primary-fg",
@@ -930,36 +898,36 @@ const Xo = ho, Zo = yo, Jo = vo, xo = oe({
930
898
  icon: "h-4 w-4 text-muted group-disabled:hidden"
931
899
  }
932
900
  }), Io = n.forwardRef((a, r) => {
933
- var c = a, { className: t, children: o, invalid: e } = c, s = E(c, ["className", "children", "invalid"]);
934
- const l = xo({ invalid: e });
935
- return /* @__PURE__ */ ee(wt, x(v({ ref: r, className: l.base({ className: t }) }, s), { children: [
901
+ var l = a, { className: t, children: o, invalid: e } = l, s = T(l, ["className", "children", "invalid"]);
902
+ const c = Co({ invalid: e });
903
+ return /* @__PURE__ */ Q(vt, w(h({ ref: r, className: c.base({ className: t }) }, s), { children: [
936
904
  o,
937
- /* @__PURE__ */ d(go, { asChild: !0, children: /* @__PURE__ */ d(Ke, { className: l.icon() }) })
905
+ /* @__PURE__ */ d(go, { asChild: !0, children: /* @__PURE__ */ d(Ue, { className: c.icon() }) })
938
906
  ] }));
939
907
  });
940
- Io.displayName = wt.displayName;
908
+ Io.displayName = vt.displayName;
941
909
  const To = oe({
942
910
  base: ["flex cursor-default items-center justify-center py-1"],
943
911
  slots: {
944
912
  icon: "h-4 w-4"
945
913
  }
946
- }), Nt = n.forwardRef((s, e) => {
947
- var r = s, { className: t } = r, o = E(r, ["className"]);
914
+ }), Ct = n.forwardRef((s, e) => {
915
+ var r = s, { className: t } = r, o = T(r, ["className"]);
948
916
  const a = To();
949
- return /* @__PURE__ */ d(xt, x(v({ ref: e, className: a.base({ className: t }) }, o), { children: /* @__PURE__ */ d(zt, { className: a.icon() }) }));
917
+ return /* @__PURE__ */ d(yt, w(h({ ref: e, className: a.base({ className: t }) }, o), { children: /* @__PURE__ */ d(jt, { className: a.icon() }) }));
950
918
  });
951
- Nt.displayName = xt.displayName;
919
+ Ct.displayName = yt.displayName;
952
920
  const No = oe({
953
921
  base: ["flex cursor-default items-center justify-center py-1"],
954
922
  slots: {
955
923
  icon: "h-4 w-4"
956
924
  }
957
- }), Rt = n.forwardRef((s, e) => {
958
- var r = s, { className: t } = r, o = E(r, ["className"]);
925
+ }), It = n.forwardRef((s, e) => {
926
+ var r = s, { className: t } = r, o = T(r, ["className"]);
959
927
  const a = No();
960
- return /* @__PURE__ */ d(It, x(v({ ref: e, className: a.base({ className: t }) }, o), { children: /* @__PURE__ */ d(Ke, { className: a.icon() }) }));
928
+ return /* @__PURE__ */ d(bt, w(h({ ref: e, className: a.base({ className: t }) }, o), { children: /* @__PURE__ */ d(Ue, { className: a.icon() }) }));
961
929
  });
962
- Rt.displayName = It.displayName;
930
+ It.displayName = bt.displayName;
963
931
  const Ro = oe({
964
932
  base: [
965
933
  "relative z-50 max-h-[--radix-select-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-lg",
@@ -980,31 +948,31 @@ const Ro = oe({
980
948
  }
981
949
  }
982
950
  }), Po = n.forwardRef((a, r) => {
983
- var c = a, { className: t, children: o, position: e = "popper" } = c, s = E(c, ["className", "children", "position"]);
984
- const l = Ro({ position: e });
985
- return /* @__PURE__ */ d(So, { children: /* @__PURE__ */ d($t, { children: /* @__PURE__ */ ee(
986
- yt,
987
- x(v({
951
+ var l = a, { className: t, children: o, position: e = "popper" } = l, s = T(l, ["className", "children", "position"]);
952
+ const c = Ro({ position: e });
953
+ return /* @__PURE__ */ d(So, { children: /* @__PURE__ */ d(Lt, { children: /* @__PURE__ */ Q(
954
+ gt,
955
+ w(h({
988
956
  ref: r,
989
- className: l.base({ className: t }),
957
+ className: c.base({ className: t }),
990
958
  position: e
991
959
  }, s), {
992
960
  children: [
993
- /* @__PURE__ */ d(Nt, {}),
994
- /* @__PURE__ */ d(wo, { className: l.viewport(), children: o }),
995
- /* @__PURE__ */ d(Rt, {})
961
+ /* @__PURE__ */ d(Ct, {}),
962
+ /* @__PURE__ */ d(wo, { className: c.viewport(), children: o }),
963
+ /* @__PURE__ */ d(It, {})
996
964
  ]
997
965
  })
998
966
  ) }) });
999
967
  });
1000
- Po.displayName = yt.displayName;
968
+ Po.displayName = gt.displayName;
1001
969
  const Eo = oe({
1002
970
  base: ["overflow-hidden overflow-ellipsis px-2 py-1.5 text-xs font-medium text-muted"]
1003
971
  }), _o = n.forwardRef((s, e) => {
1004
- var r = s, { className: t } = r, o = E(r, ["className"]);
1005
- return /* @__PURE__ */ d(Ct, v({ ref: e, className: Eo({ className: t }) }, o));
972
+ var r = s, { className: t } = r, o = T(r, ["className"]);
973
+ return /* @__PURE__ */ d(St, h({ ref: e, className: Eo({ className: t }) }, o));
1006
974
  });
1007
- _o.displayName = Ct.displayName;
975
+ _o.displayName = St.displayName;
1008
976
  const Mo = oe({
1009
977
  base: [
1010
978
  "relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8",
@@ -1015,31 +983,31 @@ const Mo = oe({
1015
983
  indicatorIcon: "h-4 w-4"
1016
984
  }
1017
985
  }), Ao = n.forwardRef((r, s) => {
1018
- var a = r, { className: t, children: o } = a, e = E(a, ["className", "children"]);
1019
- const c = Mo();
1020
- return /* @__PURE__ */ ee(bt, x(v({ ref: s, className: c.base({ className: t }) }, e), { children: [
1021
- /* @__PURE__ */ d("span", { className: c.indicator(), children: /* @__PURE__ */ d(bo, { children: /* @__PURE__ */ d(Gt, { className: c.indicatorIcon() }) }) }),
1022
- /* @__PURE__ */ d(Co, { children: o })
986
+ var a = r, { className: t, children: o } = a, e = T(a, ["className", "children"]);
987
+ const l = Mo();
988
+ return /* @__PURE__ */ Q(wt, w(h({ ref: s, className: l.base({ className: t }) }, e), { children: [
989
+ /* @__PURE__ */ d("span", { className: l.indicator(), children: /* @__PURE__ */ d(xo, { children: /* @__PURE__ */ d(zt, { className: l.indicatorIcon() }) }) }),
990
+ /* @__PURE__ */ d(bo, { children: o })
1023
991
  ] }));
1024
992
  });
1025
- Ao.displayName = bt.displayName;
1026
- const Oo = oe({
993
+ Ao.displayName = wt.displayName;
994
+ const Do = oe({
1027
995
  base: ["-mx-1 my-1 h-px bg-muted"]
1028
- }), Do = n.forwardRef((s, e) => {
1029
- var r = s, { className: t } = r, o = E(r, ["className"]);
1030
- return /* @__PURE__ */ d(Tt, v({ ref: e, className: Oo({ className: t }) }, o));
996
+ }), Oo = n.forwardRef((s, e) => {
997
+ var r = s, { className: t } = r, o = T(r, ["className"]);
998
+ return /* @__PURE__ */ d(xt, h({ ref: e, className: Do({ className: t }) }, o));
1031
999
  });
1032
- Do.displayName = Tt.displayName;
1000
+ Oo.displayName = xt.displayName;
1033
1001
  export {
1034
- Xo as Select,
1002
+ er as Select,
1035
1003
  Po as SelectContent,
1036
- Zo as SelectGroup,
1004
+ tr as SelectGroup,
1037
1005
  Ao as SelectItem,
1038
1006
  _o as SelectLabel,
1039
- Rt as SelectScrollDownButton,
1040
- Nt as SelectScrollUpButton,
1041
- Do as SelectSeparator,
1007
+ It as SelectScrollDownButton,
1008
+ Ct as SelectScrollUpButton,
1009
+ Oo as SelectSeparator,
1042
1010
  Io as SelectTrigger,
1043
- Jo as SelectValue
1011
+ or as SelectValue
1044
1012
  };
1045
1013
  //# sourceMappingURL=select.js.map