@adamosuiteservices/ui 1.2.4 → 1.3.5

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/accordion-rounded.cjs +1 -1
  3. package/dist/accordion-rounded.js +1 -1
  4. package/dist/accordion.cjs +1 -1
  5. package/dist/accordion.js +1 -1
  6. package/dist/avatar.cjs +1 -1
  7. package/dist/avatar.js +1 -1
  8. package/dist/badge.cjs +1 -1
  9. package/dist/badge.js +1 -1
  10. package/dist/breadcrumb.cjs +1 -0
  11. package/dist/breadcrumb.js +105 -0
  12. package/dist/{button-C1n6snOY.js → button-2GdKenQI.js} +1 -1
  13. package/dist/{button-BV-_FVKZ.cjs → button-DEQVHMrX.cjs} +1 -1
  14. package/dist/button-group.cjs +1 -1
  15. package/dist/button-group.js +2 -2
  16. package/dist/button.cjs +1 -1
  17. package/dist/button.js +1 -1
  18. package/dist/calendar.cjs +1 -1
  19. package/dist/calendar.js +1 -1
  20. package/dist/{checkbox-BrmXPKTn.js → checkbox-Dr487kAg.js} +3 -3
  21. package/dist/{checkbox-Lq-HvSgc.cjs → checkbox-YWAnswaW.cjs} +1 -1
  22. package/dist/checkbox.cjs +1 -1
  23. package/dist/checkbox.js +1 -1
  24. package/dist/collapsible.cjs +1 -1
  25. package/dist/collapsible.js +1 -1
  26. package/dist/combobox.cjs +1 -1
  27. package/dist/combobox.js +6 -6
  28. package/dist/components/ui/breadcrumb/breadcrumb.d.ts +11 -0
  29. package/dist/components/ui/breadcrumb/breadcrumb.stories.d.ts +26 -0
  30. package/dist/components/ui/breadcrumb/index.d.ts +1 -0
  31. package/dist/components/ui/dialog/dialog.d.ts +2 -1
  32. package/dist/context-menu.cjs +1 -1
  33. package/dist/context-menu.js +2 -2
  34. package/dist/custom-layered-styles.css +1 -1
  35. package/dist/dialog.cjs +1 -1
  36. package/dist/dialog.js +33 -19
  37. package/dist/dropdown-menu.cjs +1 -1
  38. package/dist/dropdown-menu.js +3 -3
  39. package/dist/ellipsis-CryjZKZn.js +15 -0
  40. package/dist/ellipsis-Ct9VTDOG.cjs +6 -0
  41. package/dist/field.cjs +1 -1
  42. package/dist/field.js +2 -2
  43. package/dist/hover-card.cjs +1 -1
  44. package/dist/hover-card.js +6 -6
  45. package/dist/{index-CAOY367Y.js → index-B0M7VOwp.js} +2 -2
  46. package/dist/{index-B-ZRqW0J.js → index-BBoIAjAs.js} +3 -3
  47. package/dist/{index-gO_QEiaK.cjs → index-BDs8lUfq.cjs} +1 -1
  48. package/dist/index-BFyr34mw.cjs +5 -0
  49. package/dist/index-BMWt1NBG.js +79 -0
  50. package/dist/{index-yR-v1A4G.js → index-BX9hz-JD.js} +1 -1
  51. package/dist/{index-BGiGvaq8.cjs → index-BcGMAmWE.cjs} +1 -1
  52. package/dist/{index-IKJMQref.cjs → index-Bd0gQB0k.cjs} +1 -1
  53. package/dist/{index-VIUqZjyP.cjs → index-BeWgla7c.cjs} +1 -1
  54. package/dist/{index-EUea2gfp.js → index-BpWB3aFK.js} +1 -1
  55. package/dist/index-BvLQnI56.js +59 -0
  56. package/dist/{index-CwUFT-GQ.js → index-C0YiLSjW.js} +4 -4
  57. package/dist/{index-o0sNTcKe.js → index-CBjZooac.js} +2 -2
  58. package/dist/{index-DnS_sBBe.cjs → index-COuvjZLM.cjs} +1 -1
  59. package/dist/index-CTjlbbt9.cjs +1 -0
  60. package/dist/index-CUWMxxKG.js +97 -0
  61. package/dist/{index-C329e3yQ.js → index-CZZ3llmi.js} +2 -2
  62. package/dist/index-CjyiloO7.cjs +1 -0
  63. package/dist/{index-D3wSWKST.cjs → index-Cmx9M9cZ.cjs} +1 -1
  64. package/dist/index-CocSS1YK.cjs +1 -0
  65. package/dist/index-CzRiuk60.cjs +1 -0
  66. package/dist/index-DFPDUUq7.js +658 -0
  67. package/dist/{index-D3S7dBDI.cjs → index-DIwmXz1u.cjs} +1 -1
  68. package/dist/index-DLcqcWxM.js +29 -0
  69. package/dist/index-DMLQL2aG.js +286 -0
  70. package/dist/{index-DXQ-7kNJ.cjs → index-DMs8RL3E.cjs} +1 -1
  71. package/dist/{index-Ce3QBKyj.cjs → index-Dbj9vHNq.cjs} +1 -1
  72. package/dist/{index-BRLtxFFr.cjs → index-DmGzwG2z.cjs} +1 -1
  73. package/dist/{index-P1sVIHE3.js → index-PYkEXTqJ.js} +1 -1
  74. package/dist/{index-DulPG3F9.js → index-Se4vRnIO.js} +3 -3
  75. package/dist/index-_XxjJPRD.cjs +1 -0
  76. package/dist/{index-B-cHTKrs.js → index-yWvyIlmA.js} +4 -4
  77. package/dist/input-group.cjs +1 -1
  78. package/dist/input-group.js +1 -1
  79. package/dist/{label-Cne2J57f.cjs → label-BjXORCBM.cjs} +1 -1
  80. package/dist/{label-Ky8qBEC3.js → label-CmwGvhy1.js} +1 -1
  81. package/dist/label.cjs +1 -1
  82. package/dist/label.js +1 -1
  83. package/dist/pagination.cjs +1 -6
  84. package/dist/pagination.js +58 -69
  85. package/dist/popover-3rIoNCXs.js +306 -0
  86. package/dist/popover-FCKBtFo-.cjs +1 -0
  87. package/dist/popover.cjs +1 -1
  88. package/dist/popover.js +1 -1
  89. package/dist/progress.cjs +1 -1
  90. package/dist/progress.js +1 -1
  91. package/dist/radio-group.cjs +1 -1
  92. package/dist/radio-group.js +5 -5
  93. package/dist/select.cjs +2 -2
  94. package/dist/select.js +585 -542
  95. package/dist/{separator-CGnu_jIu.cjs → separator-BaZqZZ9R.cjs} +1 -1
  96. package/dist/{separator-BH73A90k.js → separator-DR7lQjv9.js} +1 -1
  97. package/dist/separator.cjs +1 -1
  98. package/dist/separator.js +1 -1
  99. package/dist/{sheet-CcxnJ6LH.cjs → sheet-CU-sFSaJ.cjs} +1 -1
  100. package/dist/{sheet-_DVpQIVF.js → sheet-UZWAbdXr.js} +1 -1
  101. package/dist/sheet.cjs +1 -1
  102. package/dist/sheet.js +1 -1
  103. package/dist/sidebar.cjs +1 -1
  104. package/dist/sidebar.js +4 -4
  105. package/dist/slider.cjs +1 -1
  106. package/dist/slider.js +3 -3
  107. package/dist/styles.css +1 -1
  108. package/dist/switch.cjs +1 -1
  109. package/dist/switch.js +2 -2
  110. package/dist/tabs-underline.cjs +1 -1
  111. package/dist/tabs-underline.js +1 -1
  112. package/dist/tabs.cjs +1 -1
  113. package/dist/tabs.js +1 -1
  114. package/dist/toaster.cjs +1 -1
  115. package/dist/toaster.js +1 -1
  116. package/dist/toggle.cjs +1 -1
  117. package/dist/toggle.js +1 -1
  118. package/dist/tooltip.cjs +1 -1
  119. package/dist/tooltip.js +114 -108
  120. package/dist/typography.cjs +1 -1
  121. package/dist/typography.js +16 -16
  122. package/docs/AI-GUIDE.md +321 -0
  123. package/docs/components/layout/sidebar.md +330 -0
  124. package/docs/components/layout/toaster.md +436 -0
  125. package/docs/components/ui/accordion-rounded.md +583 -0
  126. package/docs/components/ui/accordion.md +267 -0
  127. package/docs/components/ui/alert.md +671 -0
  128. package/docs/components/ui/avatar.md +588 -0
  129. package/docs/components/ui/badge.md +1024 -0
  130. package/docs/components/ui/breadcrumb.md +614 -0
  131. package/docs/components/ui/button-group.md +1002 -0
  132. package/docs/components/ui/button.md +1078 -0
  133. package/docs/components/ui/calendar.md +1159 -0
  134. package/docs/components/ui/card.md +1265 -0
  135. package/docs/components/ui/checkbox.md +292 -0
  136. package/docs/components/ui/collapsible.md +320 -0
  137. package/docs/components/ui/combobox.md +328 -0
  138. package/docs/components/ui/command.md +454 -0
  139. package/docs/components/ui/context-menu.md +540 -0
  140. package/docs/components/ui/dialog.md +628 -0
  141. package/docs/components/ui/dropdown-menu.md +731 -0
  142. package/docs/components/ui/field.md +706 -0
  143. package/docs/components/ui/hover-card.md +446 -0
  144. package/docs/components/ui/input-group.md +509 -0
  145. package/docs/components/ui/input.md +362 -0
  146. package/docs/components/ui/kbd.md +434 -0
  147. package/docs/components/ui/label.md +359 -0
  148. package/docs/components/ui/pagination.md +650 -0
  149. package/docs/components/ui/popover.md +536 -0
  150. package/docs/components/ui/progress.md +182 -0
  151. package/docs/components/ui/radio-group.md +311 -0
  152. package/docs/components/ui/select.md +352 -0
  153. package/docs/components/ui/separator.md +214 -0
  154. package/docs/components/ui/sheet.md +142 -0
  155. package/docs/components/ui/skeleton.md +140 -0
  156. package/docs/components/ui/slider.md +341 -0
  157. package/docs/components/ui/spinner.md +170 -0
  158. package/docs/components/ui/switch.md +402 -0
  159. package/docs/components/ui/table.md +183 -0
  160. package/docs/components/ui/tabs-underline.md +106 -0
  161. package/docs/components/ui/tabs.md +122 -0
  162. package/docs/components/ui/textarea.md +243 -0
  163. package/docs/components/ui/toggle.md +243 -0
  164. package/docs/components/ui/tooltip.md +320 -0
  165. package/docs/components/ui/typography.md +191 -0
  166. package/package.json +11 -5
  167. package/dist/index-6oTEokEx.js +0 -82
  168. package/dist/index-B-NyefE0.js +0 -243
  169. package/dist/index-BKbK2GzY.cjs +0 -1
  170. package/dist/index-BMitW9UR.cjs +0 -1
  171. package/dist/index-BpvjJ_T6.cjs +0 -5
  172. package/dist/index-C5wjudc-.js +0 -36
  173. package/dist/index-CezwiPd_.js +0 -615
  174. package/dist/index-D02K8KOB.js +0 -54
  175. package/dist/index-D7hQvndv.cjs +0 -1
  176. package/dist/index-DQvx1rG_.cjs +0 -1
  177. package/dist/popover-BjdTqaB8.cjs +0 -1
  178. package/dist/popover-EnVfE0YA.js +0 -263
package/dist/select.js CHANGED
@@ -1,24 +1,24 @@
1
- import { j as n } from "./jsx-runtime-BzflLqGi.js";
2
- import * as r from "react";
3
- import * as Ne from "react-dom";
1
+ import { j as s } from "./jsx-runtime-BzflLqGi.js";
2
+ import * as n from "react";
3
+ import * as Re from "react-dom";
4
4
  import { c as Te } from "./index-rKs9bXHr.js";
5
5
  import { u as Pe, c as P } from "./index-C0UREtMP.js";
6
- import { u as at, c as st } from "./index-D02K8KOB.js";
7
- import { u as L, a as lt } from "./index-6oTEokEx.js";
8
- import { c as ct } from "./index-FxyLF8MY.js";
9
- import { D as it } from "./index-C329e3yQ.js";
10
- import { h as dt, u as ut, R as pt, F as mt } from "./index-o0sNTcKe.js";
6
+ import { u as at, c as st } from "./index-CUWMxxKG.js";
7
+ import { c as lt, u as L } from "./index-DLcqcWxM.js";
8
+ import { c as it } from "./index-FxyLF8MY.js";
9
+ import { D as ct } from "./index-CZZ3llmi.js";
10
+ import { h as dt, u as ut, R as pt, F as mt } from "./index-CBjZooac.js";
11
11
  import { u as Ie } from "./index-Cv867SGx.js";
12
- import { c as Re, R as ft, A as ht, C as vt, a as gt } from "./index-CAOY367Y.js";
13
- import { P as xt } from "./index-yR-v1A4G.js";
14
- import { P as j } from "./index-C5wjudc-.js";
12
+ import { c as Ee, R as ft, A as ht, C as gt, a as vt } from "./index-B0M7VOwp.js";
13
+ import { P as xt } from "./index-BX9hz-JD.js";
14
+ import { P as j } from "./index-BMWt1NBG.js";
15
15
  import { u as St } from "./index-0ioNhtNM.js";
16
16
  import { u as $ } from "./index-CCKe-Mpx.js";
17
17
  import { u as wt } from "./index-BZPx6jYI.js";
18
- import { a as Ct } from "./index-P1sVIHE3.js";
18
+ import { a as yt } from "./index-PYkEXTqJ.js";
19
19
  import { c as G } from "./index-CRiPKpXj.js";
20
- import { C as yt } from "./check-Ci0GjV-B.js";
21
- import { C as _e } from "./chevron-down-CpVS2Z7w.js";
20
+ import { C as Ct } from "./check-Ci0GjV-B.js";
21
+ import { C as Ne } from "./chevron-down-CpVS2Z7w.js";
22
22
  import { c as It } from "./createLucideIcon-B_8CJpcQ.js";
23
23
  /**
24
24
  * @license lucide-react v0.546.0 - ISC
@@ -27,86 +27,129 @@ import { c as It } from "./createLucideIcon-B_8CJpcQ.js";
27
27
  * See the LICENSE file in the root directory of this source tree.
28
28
  */
29
29
  const bt = [["path", { d: "m18 15-6-6-6 6", key: "153udz" }]], Tt = It("chevron-up", bt);
30
- var Pt = [" ", "Enter", "ArrowUp", "ArrowDown"], Nt = [" ", "Enter"], Q = "Select", [ie, de, Rt] = st(Q), [oe] = ct(Q, [
31
- Rt,
32
- Re
33
- ]), ue = Re(), [_t, Y] = oe(Q), [Et, jt] = oe(Q), Ee = (t) => {
30
+ // @__NO_SIDE_EFFECTS__
31
+ function Pt(e) {
32
+ const o = /* @__PURE__ */ Rt(e), t = n.forwardRef((a, r) => {
33
+ const { children: d, ...l } = a, i = n.Children.toArray(d), c = i.find(Nt);
34
+ if (c) {
35
+ const p = c.props.children, g = i.map((x) => x === c ? n.Children.count(p) > 1 ? n.Children.only(null) : n.isValidElement(p) ? p.props.children : null : x);
36
+ return /* @__PURE__ */ s.jsx(o, { ...l, ref: r, children: n.isValidElement(p) ? n.cloneElement(p, void 0, g) : null });
37
+ }
38
+ return /* @__PURE__ */ s.jsx(o, { ...l, ref: r, children: d });
39
+ });
40
+ return t.displayName = `${e}.Slot`, t;
41
+ }
42
+ // @__NO_SIDE_EFFECTS__
43
+ function Rt(e) {
44
+ const o = n.forwardRef((t, a) => {
45
+ const { children: r, ...d } = t;
46
+ if (n.isValidElement(r)) {
47
+ const l = jt(r), i = _t(d, r.props);
48
+ return r.type !== n.Fragment && (i.ref = a ? lt(a, l) : l), n.cloneElement(r, i);
49
+ }
50
+ return n.Children.count(r) > 1 ? n.Children.only(null) : null;
51
+ });
52
+ return o.displayName = `${e}.SlotClone`, o;
53
+ }
54
+ var Et = Symbol("radix.slottable");
55
+ function Nt(e) {
56
+ return n.isValidElement(e) && typeof e.type == "function" && "__radixId" in e.type && e.type.__radixId === Et;
57
+ }
58
+ function _t(e, o) {
59
+ const t = { ...o };
60
+ for (const a in o) {
61
+ const r = e[a], d = o[a];
62
+ /^on[A-Z]/.test(a) ? r && d ? t[a] = (...i) => {
63
+ const c = d(...i);
64
+ return r(...i), c;
65
+ } : r && (t[a] = r) : a === "style" ? t[a] = { ...r, ...d } : a === "className" && (t[a] = [r, d].filter(Boolean).join(" "));
66
+ }
67
+ return { ...e, ...t };
68
+ }
69
+ function jt(e) {
70
+ let o = Object.getOwnPropertyDescriptor(e.props, "ref")?.get, t = o && "isReactWarning" in o && o.isReactWarning;
71
+ return t ? e.ref : (o = Object.getOwnPropertyDescriptor(e, "ref")?.get, t = o && "isReactWarning" in o && o.isReactWarning, t ? e.props.ref : e.props.ref || e.ref);
72
+ }
73
+ var Mt = [" ", "Enter", "ArrowUp", "ArrowDown"], At = [" ", "Enter"], Q = "Select", [ce, de, Ot] = st(Q), [oe] = it(Q, [
74
+ Ot,
75
+ Ee
76
+ ]), ue = Ee(), [Dt, Y] = oe(Q), [Lt, kt] = oe(Q), _e = (e) => {
34
77
  const {
35
78
  __scopeSelect: o,
36
- children: e,
37
- open: c,
38
- defaultOpen: s,
39
- onOpenChange: u,
40
- value: a,
41
- defaultValue: l,
42
- onValueChange: i,
43
- dir: m,
79
+ children: t,
80
+ open: a,
81
+ defaultOpen: r,
82
+ onOpenChange: d,
83
+ value: l,
84
+ defaultValue: i,
85
+ onValueChange: c,
86
+ dir: p,
44
87
  name: g,
45
- autoComplete: w,
46
- disabled: N,
88
+ autoComplete: x,
89
+ disabled: R,
47
90
  required: b,
48
- form: y
49
- } = t, d = ue(o), [h, x] = r.useState(null), [f, v] = r.useState(null), [U, M] = r.useState(!1), ne = at(m), [R, O] = Pe({
50
- prop: c,
51
- defaultProp: s ?? !1,
52
- onChange: u,
53
- caller: Q
54
- }), [W, X] = Pe({
91
+ form: C
92
+ } = e, u = ue(o), [h, S] = n.useState(null), [f, v] = n.useState(null), [F, M] = n.useState(!1), ne = at(p), [E, O] = Pe({
55
93
  prop: a,
56
- defaultProp: l,
57
- onChange: i,
94
+ defaultProp: r ?? !1,
95
+ onChange: d,
58
96
  caller: Q
59
- }), k = r.useRef(null), B = h ? y || !!h.closest("form") : !0, [z, V] = r.useState(/* @__PURE__ */ new Set()), H = Array.from(z).map((_) => _.props.value).join(";");
60
- return /* @__PURE__ */ n.jsx(ft, { ...d, children: /* @__PURE__ */ n.jsxs(
61
- _t,
97
+ }), [U, Z] = Pe({
98
+ prop: l,
99
+ defaultProp: i,
100
+ onChange: c,
101
+ caller: Q
102
+ }), k = n.useRef(null), V = h ? C || !!h.closest("form") : !0, [z, B] = n.useState(/* @__PURE__ */ new Set()), H = Array.from(z).map((N) => N.props.value).join(";");
103
+ return /* @__PURE__ */ s.jsx(ft, { ...u, children: /* @__PURE__ */ s.jsxs(
104
+ Dt,
62
105
  {
63
106
  required: b,
64
107
  scope: o,
65
108
  trigger: h,
66
- onTriggerChange: x,
109
+ onTriggerChange: S,
67
110
  valueNode: f,
68
111
  onValueNodeChange: v,
69
- valueNodeHasChildren: U,
112
+ valueNodeHasChildren: F,
70
113
  onValueNodeHasChildrenChange: M,
71
114
  contentId: Ie(),
72
- value: W,
73
- onValueChange: X,
74
- open: R,
115
+ value: U,
116
+ onValueChange: Z,
117
+ open: E,
75
118
  onOpenChange: O,
76
119
  dir: ne,
77
120
  triggerPointerDownPosRef: k,
78
- disabled: N,
121
+ disabled: R,
79
122
  children: [
80
- /* @__PURE__ */ n.jsx(ie.Provider, { scope: o, children: /* @__PURE__ */ n.jsx(
81
- Et,
123
+ /* @__PURE__ */ s.jsx(ce.Provider, { scope: o, children: /* @__PURE__ */ s.jsx(
124
+ Lt,
82
125
  {
83
- scope: t.__scopeSelect,
84
- onNativeOptionAdd: r.useCallback((_) => {
85
- V((D) => new Set(D).add(_));
126
+ scope: e.__scopeSelect,
127
+ onNativeOptionAdd: n.useCallback((N) => {
128
+ B((D) => new Set(D).add(N));
86
129
  }, []),
87
- onNativeOptionRemove: r.useCallback((_) => {
88
- V((D) => {
89
- const F = new Set(D);
90
- return F.delete(_), F;
130
+ onNativeOptionRemove: n.useCallback((N) => {
131
+ B((D) => {
132
+ const W = new Set(D);
133
+ return W.delete(N), W;
91
134
  });
92
135
  }, []),
93
- children: e
136
+ children: t
94
137
  }
95
138
  ) }),
96
- B ? /* @__PURE__ */ n.jsxs(
139
+ V ? /* @__PURE__ */ s.jsxs(
97
140
  tt,
98
141
  {
99
142
  "aria-hidden": !0,
100
143
  required: b,
101
144
  tabIndex: -1,
102
145
  name: g,
103
- autoComplete: w,
104
- value: W,
105
- onChange: (_) => X(_.target.value),
106
- disabled: N,
107
- form: y,
146
+ autoComplete: x,
147
+ value: U,
148
+ onChange: (N) => Z(N.target.value),
149
+ disabled: R,
150
+ form: C,
108
151
  children: [
109
- W === void 0 ? /* @__PURE__ */ n.jsx("option", { value: "" }) : null,
152
+ U === void 0 ? /* @__PURE__ */ s.jsx("option", { value: "" }) : null,
110
153
  Array.from(z)
111
154
  ]
112
155
  },
@@ -116,188 +159,188 @@ var Pt = [" ", "Enter", "ArrowUp", "ArrowDown"], Nt = [" ", "Enter"], Q = "Selec
116
159
  }
117
160
  ) });
118
161
  };
119
- Ee.displayName = Q;
120
- var je = "SelectTrigger", Me = r.forwardRef(
121
- (t, o) => {
122
- const { __scopeSelect: e, disabled: c = !1, ...s } = t, u = ue(e), a = Y(je, e), l = a.disabled || c, i = L(o, a.onTriggerChange), m = de(e), g = r.useRef("touch"), [w, N, b] = nt((d) => {
123
- const h = m().filter((v) => !v.disabled), x = h.find((v) => v.value === a.value), f = rt(h, d, x);
124
- f !== void 0 && a.onValueChange(f.value);
125
- }), y = (d) => {
126
- l || (a.onOpenChange(!0), b()), d && (a.triggerPointerDownPosRef.current = {
127
- x: Math.round(d.pageX),
128
- y: Math.round(d.pageY)
162
+ _e.displayName = Q;
163
+ var je = "SelectTrigger", Me = n.forwardRef(
164
+ (e, o) => {
165
+ const { __scopeSelect: t, disabled: a = !1, ...r } = e, d = ue(t), l = Y(je, t), i = l.disabled || a, c = L(o, l.onTriggerChange), p = de(t), g = n.useRef("touch"), [x, R, b] = nt((u) => {
166
+ const h = p().filter((v) => !v.disabled), S = h.find((v) => v.value === l.value), f = rt(h, u, S);
167
+ f !== void 0 && l.onValueChange(f.value);
168
+ }), C = (u) => {
169
+ i || (l.onOpenChange(!0), b()), u && (l.triggerPointerDownPosRef.current = {
170
+ x: Math.round(u.pageX),
171
+ y: Math.round(u.pageY)
129
172
  });
130
173
  };
131
- return /* @__PURE__ */ n.jsx(ht, { asChild: !0, ...u, children: /* @__PURE__ */ n.jsx(
174
+ return /* @__PURE__ */ s.jsx(ht, { asChild: !0, ...d, children: /* @__PURE__ */ s.jsx(
132
175
  j.button,
133
176
  {
134
177
  type: "button",
135
178
  role: "combobox",
136
- "aria-controls": a.contentId,
137
- "aria-expanded": a.open,
138
- "aria-required": a.required,
179
+ "aria-controls": l.contentId,
180
+ "aria-expanded": l.open,
181
+ "aria-required": l.required,
139
182
  "aria-autocomplete": "none",
140
- dir: a.dir,
141
- "data-state": a.open ? "open" : "closed",
142
- disabled: l,
143
- "data-disabled": l ? "" : void 0,
144
- "data-placeholder": ot(a.value) ? "" : void 0,
145
- ...s,
146
- ref: i,
147
- onClick: P(s.onClick, (d) => {
148
- d.currentTarget.focus(), g.current !== "mouse" && y(d);
183
+ dir: l.dir,
184
+ "data-state": l.open ? "open" : "closed",
185
+ disabled: i,
186
+ "data-disabled": i ? "" : void 0,
187
+ "data-placeholder": ot(l.value) ? "" : void 0,
188
+ ...r,
189
+ ref: c,
190
+ onClick: P(r.onClick, (u) => {
191
+ u.currentTarget.focus(), g.current !== "mouse" && C(u);
149
192
  }),
150
- onPointerDown: P(s.onPointerDown, (d) => {
151
- g.current = d.pointerType;
152
- const h = d.target;
153
- h.hasPointerCapture(d.pointerId) && h.releasePointerCapture(d.pointerId), d.button === 0 && d.ctrlKey === !1 && d.pointerType === "mouse" && (y(d), d.preventDefault());
193
+ onPointerDown: P(r.onPointerDown, (u) => {
194
+ g.current = u.pointerType;
195
+ const h = u.target;
196
+ h.hasPointerCapture(u.pointerId) && h.releasePointerCapture(u.pointerId), u.button === 0 && u.ctrlKey === !1 && u.pointerType === "mouse" && (C(u), u.preventDefault());
154
197
  }),
155
- onKeyDown: P(s.onKeyDown, (d) => {
156
- const h = w.current !== "";
157
- !(d.ctrlKey || d.altKey || d.metaKey) && d.key.length === 1 && N(d.key), !(h && d.key === " ") && Pt.includes(d.key) && (y(), d.preventDefault());
198
+ onKeyDown: P(r.onKeyDown, (u) => {
199
+ const h = x.current !== "";
200
+ !(u.ctrlKey || u.altKey || u.metaKey) && u.key.length === 1 && R(u.key), !(h && u.key === " ") && Mt.includes(u.key) && (C(), u.preventDefault());
158
201
  })
159
202
  }
160
203
  ) });
161
204
  }
162
205
  );
163
206
  Me.displayName = je;
164
- var Ae = "SelectValue", Oe = r.forwardRef(
165
- (t, o) => {
166
- const { __scopeSelect: e, className: c, style: s, children: u, placeholder: a = "", ...l } = t, i = Y(Ae, e), { onValueNodeHasChildrenChange: m } = i, g = u !== void 0, w = L(o, i.onValueNodeChange);
207
+ var Ae = "SelectValue", Oe = n.forwardRef(
208
+ (e, o) => {
209
+ const { __scopeSelect: t, className: a, style: r, children: d, placeholder: l = "", ...i } = e, c = Y(Ae, t), { onValueNodeHasChildrenChange: p } = c, g = d !== void 0, x = L(o, c.onValueNodeChange);
167
210
  return $(() => {
168
- m(g);
169
- }, [m, g]), /* @__PURE__ */ n.jsx(
211
+ p(g);
212
+ }, [p, g]), /* @__PURE__ */ s.jsx(
170
213
  j.span,
171
214
  {
172
- ...l,
173
- ref: w,
215
+ ...i,
216
+ ref: x,
174
217
  style: { pointerEvents: "none" },
175
- children: ot(i.value) ? /* @__PURE__ */ n.jsx(n.Fragment, { children: a }) : u
218
+ children: ot(c.value) ? /* @__PURE__ */ s.jsx(s.Fragment, { children: l }) : d
176
219
  }
177
220
  );
178
221
  }
179
222
  );
180
223
  Oe.displayName = Ae;
181
- var Mt = "SelectIcon", De = r.forwardRef(
182
- (t, o) => {
183
- const { __scopeSelect: e, children: c, ...s } = t;
184
- return /* @__PURE__ */ n.jsx(j.span, { "aria-hidden": !0, ...s, ref: o, children: c || "▼" });
224
+ var Vt = "SelectIcon", De = n.forwardRef(
225
+ (e, o) => {
226
+ const { __scopeSelect: t, children: a, ...r } = e;
227
+ return /* @__PURE__ */ s.jsx(j.span, { "aria-hidden": !0, ...r, ref: o, children: a || "▼" });
185
228
  }
186
229
  );
187
- De.displayName = Mt;
188
- var At = "SelectPortal", Le = (t) => /* @__PURE__ */ n.jsx(xt, { asChild: !0, ...t });
189
- Le.displayName = At;
190
- var ee = "SelectContent", ke = r.forwardRef(
191
- (t, o) => {
192
- const e = Y(ee, t.__scopeSelect), [c, s] = r.useState();
230
+ De.displayName = Vt;
231
+ var Bt = "SelectPortal", Le = (e) => /* @__PURE__ */ s.jsx(xt, { asChild: !0, ...e });
232
+ Le.displayName = Bt;
233
+ var ee = "SelectContent", ke = n.forwardRef(
234
+ (e, o) => {
235
+ const t = Y(ee, e.__scopeSelect), [a, r] = n.useState();
193
236
  if ($(() => {
194
- s(new DocumentFragment());
195
- }, []), !e.open) {
196
- const u = c;
197
- return u ? Ne.createPortal(
198
- /* @__PURE__ */ n.jsx(Be, { scope: t.__scopeSelect, children: /* @__PURE__ */ n.jsx(ie.Slot, { scope: t.__scopeSelect, children: /* @__PURE__ */ n.jsx("div", { children: t.children }) }) }),
199
- u
237
+ r(new DocumentFragment());
238
+ }, []), !t.open) {
239
+ const d = a;
240
+ return d ? Re.createPortal(
241
+ /* @__PURE__ */ s.jsx(Ve, { scope: e.__scopeSelect, children: /* @__PURE__ */ s.jsx(ce.Slot, { scope: e.__scopeSelect, children: /* @__PURE__ */ s.jsx("div", { children: e.children }) }) }),
242
+ d
200
243
  ) : null;
201
244
  }
202
- return /* @__PURE__ */ n.jsx(Ve, { ...t, ref: o });
245
+ return /* @__PURE__ */ s.jsx(Be, { ...e, ref: o });
203
246
  }
204
247
  );
205
248
  ke.displayName = ee;
206
- var A = 10, [Be, q] = oe(ee), Ot = "SelectContentImpl", Dt = lt("SelectContent.RemoveScroll"), Ve = r.forwardRef(
207
- (t, o) => {
249
+ var A = 10, [Ve, q] = oe(ee), Ht = "SelectContentImpl", Wt = /* @__PURE__ */ Pt("SelectContent.RemoveScroll"), Be = n.forwardRef(
250
+ (e, o) => {
208
251
  const {
209
- __scopeSelect: e,
210
- position: c = "item-aligned",
211
- onCloseAutoFocus: s,
212
- onEscapeKeyDown: u,
213
- onPointerDownOutside: a,
252
+ __scopeSelect: t,
253
+ position: a = "item-aligned",
254
+ onCloseAutoFocus: r,
255
+ onEscapeKeyDown: d,
256
+ onPointerDownOutside: l,
214
257
  //
215
258
  // PopperContent props
216
- side: l,
217
- sideOffset: i,
218
- align: m,
259
+ side: i,
260
+ sideOffset: c,
261
+ align: p,
219
262
  alignOffset: g,
220
- arrowPadding: w,
221
- collisionBoundary: N,
263
+ arrowPadding: x,
264
+ collisionBoundary: R,
222
265
  collisionPadding: b,
223
- sticky: y,
224
- hideWhenDetached: d,
266
+ sticky: C,
267
+ hideWhenDetached: u,
225
268
  avoidCollisions: h,
226
269
  //
227
- ...x
228
- } = t, f = Y(ee, e), [v, U] = r.useState(null), [M, ne] = r.useState(null), R = L(o, (p) => U(p)), [O, W] = r.useState(null), [X, k] = r.useState(
270
+ ...S
271
+ } = e, f = Y(ee, t), [v, F] = n.useState(null), [M, ne] = n.useState(null), E = L(o, (m) => F(m)), [O, U] = n.useState(null), [Z, k] = n.useState(
229
272
  null
230
- ), B = de(e), [z, V] = r.useState(!1), H = r.useRef(!1);
231
- r.useEffect(() => {
273
+ ), V = de(t), [z, B] = n.useState(!1), H = n.useRef(!1);
274
+ n.useEffect(() => {
232
275
  if (v) return dt(v);
233
276
  }, [v]), ut();
234
- const _ = r.useCallback(
235
- (p) => {
236
- const [I, ...E] = B().map((T) => T.ref.current), [S] = E.slice(-1), C = document.activeElement;
237
- for (const T of p)
238
- if (T === C || (T?.scrollIntoView({ block: "nearest" }), T === I && M && (M.scrollTop = 0), T === S && M && (M.scrollTop = M.scrollHeight), T?.focus(), document.activeElement !== C)) return;
277
+ const N = n.useCallback(
278
+ (m) => {
279
+ const [I, ..._] = V().map((T) => T.ref.current), [w] = _.slice(-1), y = document.activeElement;
280
+ for (const T of m)
281
+ if (T === y || (T?.scrollIntoView({ block: "nearest" }), T === I && M && (M.scrollTop = 0), T === w && M && (M.scrollTop = M.scrollHeight), T?.focus(), document.activeElement !== y)) return;
239
282
  },
240
- [B, M]
241
- ), D = r.useCallback(
242
- () => _([O, v]),
243
- [_, O, v]
283
+ [V, M]
284
+ ), D = n.useCallback(
285
+ () => N([O, v]),
286
+ [N, O, v]
244
287
  );
245
- r.useEffect(() => {
288
+ n.useEffect(() => {
246
289
  z && D();
247
290
  }, [z, D]);
248
- const { onOpenChange: F, triggerPointerDownPosRef: K } = f;
249
- r.useEffect(() => {
291
+ const { onOpenChange: W, triggerPointerDownPosRef: K } = f;
292
+ n.useEffect(() => {
250
293
  if (v) {
251
- let p = { x: 0, y: 0 };
252
- const I = (S) => {
253
- p = {
254
- x: Math.abs(Math.round(S.pageX) - (K.current?.x ?? 0)),
255
- y: Math.abs(Math.round(S.pageY) - (K.current?.y ?? 0))
294
+ let m = { x: 0, y: 0 };
295
+ const I = (w) => {
296
+ m = {
297
+ x: Math.abs(Math.round(w.pageX) - (K.current?.x ?? 0)),
298
+ y: Math.abs(Math.round(w.pageY) - (K.current?.y ?? 0))
256
299
  };
257
- }, E = (S) => {
258
- p.x <= 10 && p.y <= 10 ? S.preventDefault() : v.contains(S.target) || F(!1), document.removeEventListener("pointermove", I), K.current = null;
300
+ }, _ = (w) => {
301
+ m.x <= 10 && m.y <= 10 ? w.preventDefault() : v.contains(w.target) || W(!1), document.removeEventListener("pointermove", I), K.current = null;
259
302
  };
260
- return K.current !== null && (document.addEventListener("pointermove", I), document.addEventListener("pointerup", E, { capture: !0, once: !0 })), () => {
261
- document.removeEventListener("pointermove", I), document.removeEventListener("pointerup", E, { capture: !0 });
303
+ return K.current !== null && (document.addEventListener("pointermove", I), document.addEventListener("pointerup", _, { capture: !0, once: !0 })), () => {
304
+ document.removeEventListener("pointermove", I), document.removeEventListener("pointerup", _, { capture: !0 });
262
305
  };
263
306
  }
264
- }, [v, F, K]), r.useEffect(() => {
265
- const p = () => F(!1);
266
- return window.addEventListener("blur", p), window.addEventListener("resize", p), () => {
267
- window.removeEventListener("blur", p), window.removeEventListener("resize", p);
307
+ }, [v, W, K]), n.useEffect(() => {
308
+ const m = () => W(!1);
309
+ return window.addEventListener("blur", m), window.addEventListener("resize", m), () => {
310
+ window.removeEventListener("blur", m), window.removeEventListener("resize", m);
268
311
  };
269
- }, [F]);
270
- const [pe, se] = nt((p) => {
271
- const I = B().filter((C) => !C.disabled), E = I.find((C) => C.ref.current === document.activeElement), S = rt(I, p, E);
272
- S && setTimeout(() => S.ref.current.focus());
273
- }), me = r.useCallback(
274
- (p, I, E) => {
275
- const S = !H.current && !E;
276
- (f.value !== void 0 && f.value === I || S) && (W(p), S && (H.current = !0));
312
+ }, [W]);
313
+ const [pe, se] = nt((m) => {
314
+ const I = V().filter((y) => !y.disabled), _ = I.find((y) => y.ref.current === document.activeElement), w = rt(I, m, _);
315
+ w && setTimeout(() => w.ref.current.focus());
316
+ }), me = n.useCallback(
317
+ (m, I, _) => {
318
+ const w = !H.current && !_;
319
+ (f.value !== void 0 && f.value === I || w) && (U(m), w && (H.current = !0));
277
320
  },
278
321
  [f.value]
279
- ), fe = r.useCallback(() => v?.focus(), [v]), te = r.useCallback(
280
- (p, I, E) => {
281
- const S = !H.current && !E;
282
- (f.value !== void 0 && f.value === I || S) && k(p);
322
+ ), fe = n.useCallback(() => v?.focus(), [v]), te = n.useCallback(
323
+ (m, I, _) => {
324
+ const w = !H.current && !_;
325
+ (f.value !== void 0 && f.value === I || w) && k(m);
283
326
  },
284
327
  [f.value]
285
- ), le = c === "popper" ? xe : He, re = le === xe ? {
286
- side: l,
287
- sideOffset: i,
288
- align: m,
328
+ ), le = a === "popper" ? xe : He, re = le === xe ? {
329
+ side: i,
330
+ sideOffset: c,
331
+ align: p,
289
332
  alignOffset: g,
290
- arrowPadding: w,
291
- collisionBoundary: N,
333
+ arrowPadding: x,
334
+ collisionBoundary: R,
292
335
  collisionPadding: b,
293
- sticky: y,
294
- hideWhenDetached: d,
336
+ sticky: C,
337
+ hideWhenDetached: u,
295
338
  avoidCollisions: h
296
339
  } : {};
297
- return /* @__PURE__ */ n.jsx(
298
- Be,
340
+ return /* @__PURE__ */ s.jsx(
341
+ Ve,
299
342
  {
300
- scope: e,
343
+ scope: t,
301
344
  content: v,
302
345
  viewport: M,
303
346
  onViewportChange: ne,
@@ -306,59 +349,59 @@ var A = 10, [Be, q] = oe(ee), Ot = "SelectContentImpl", Dt = lt("SelectContent.R
306
349
  onItemLeave: fe,
307
350
  itemTextRefCallback: te,
308
351
  focusSelectedItem: D,
309
- selectedItemText: X,
310
- position: c,
352
+ selectedItemText: Z,
353
+ position: a,
311
354
  isPositioned: z,
312
355
  searchRef: pe,
313
- children: /* @__PURE__ */ n.jsx(pt, { as: Dt, allowPinchZoom: !0, children: /* @__PURE__ */ n.jsx(
356
+ children: /* @__PURE__ */ s.jsx(pt, { as: Wt, allowPinchZoom: !0, children: /* @__PURE__ */ s.jsx(
314
357
  mt,
315
358
  {
316
359
  asChild: !0,
317
360
  trapped: f.open,
318
- onMountAutoFocus: (p) => {
319
- p.preventDefault();
361
+ onMountAutoFocus: (m) => {
362
+ m.preventDefault();
320
363
  },
321
- onUnmountAutoFocus: P(s, (p) => {
322
- f.trigger?.focus({ preventScroll: !0 }), p.preventDefault();
364
+ onUnmountAutoFocus: P(r, (m) => {
365
+ f.trigger?.focus({ preventScroll: !0 }), m.preventDefault();
323
366
  }),
324
- children: /* @__PURE__ */ n.jsx(
325
- it,
367
+ children: /* @__PURE__ */ s.jsx(
368
+ ct,
326
369
  {
327
370
  asChild: !0,
328
371
  disableOutsidePointerEvents: !0,
329
- onEscapeKeyDown: u,
330
- onPointerDownOutside: a,
331
- onFocusOutside: (p) => p.preventDefault(),
372
+ onEscapeKeyDown: d,
373
+ onPointerDownOutside: l,
374
+ onFocusOutside: (m) => m.preventDefault(),
332
375
  onDismiss: () => f.onOpenChange(!1),
333
- children: /* @__PURE__ */ n.jsx(
376
+ children: /* @__PURE__ */ s.jsx(
334
377
  le,
335
378
  {
336
379
  role: "listbox",
337
380
  id: f.contentId,
338
381
  "data-state": f.open ? "open" : "closed",
339
382
  dir: f.dir,
340
- onContextMenu: (p) => p.preventDefault(),
341
- ...x,
383
+ onContextMenu: (m) => m.preventDefault(),
384
+ ...S,
342
385
  ...re,
343
- onPlaced: () => V(!0),
344
- ref: R,
386
+ onPlaced: () => B(!0),
387
+ ref: E,
345
388
  style: {
346
389
  // flex layout so we can place the scroll buttons properly
347
390
  display: "flex",
348
391
  flexDirection: "column",
349
392
  // reset the outline by default as the content MAY get focused
350
393
  outline: "none",
351
- ...x.style
394
+ ...S.style
352
395
  },
353
- onKeyDown: P(x.onKeyDown, (p) => {
354
- const I = p.ctrlKey || p.altKey || p.metaKey;
355
- if (p.key === "Tab" && p.preventDefault(), !I && p.key.length === 1 && se(p.key), ["ArrowUp", "ArrowDown", "Home", "End"].includes(p.key)) {
356
- let S = B().filter((C) => !C.disabled).map((C) => C.ref.current);
357
- if (["ArrowUp", "End"].includes(p.key) && (S = S.slice().reverse()), ["ArrowUp", "ArrowDown"].includes(p.key)) {
358
- const C = p.target, T = S.indexOf(C);
359
- S = S.slice(T + 1);
396
+ onKeyDown: P(S.onKeyDown, (m) => {
397
+ const I = m.ctrlKey || m.altKey || m.metaKey;
398
+ if (m.key === "Tab" && m.preventDefault(), !I && m.key.length === 1 && se(m.key), ["ArrowUp", "ArrowDown", "Home", "End"].includes(m.key)) {
399
+ let w = V().filter((y) => !y.disabled).map((y) => y.ref.current);
400
+ if (["ArrowUp", "End"].includes(m.key) && (w = w.slice().reverse()), ["ArrowUp", "ArrowDown"].includes(m.key)) {
401
+ const y = m.target, T = w.indexOf(y);
402
+ w = w.slice(T + 1);
360
403
  }
361
- setTimeout(() => _(S)), p.preventDefault();
404
+ setTimeout(() => N(w)), m.preventDefault();
362
405
  }
363
406
  })
364
407
  }
@@ -371,103 +414,103 @@ var A = 10, [Be, q] = oe(ee), Ot = "SelectContentImpl", Dt = lt("SelectContent.R
371
414
  );
372
415
  }
373
416
  );
374
- Ve.displayName = Ot;
375
- var Lt = "SelectItemAlignedPosition", He = r.forwardRef((t, o) => {
376
- const { __scopeSelect: e, onPlaced: c, ...s } = t, u = Y(ee, e), a = q(ee, e), [l, i] = r.useState(null), [m, g] = r.useState(null), w = L(o, (R) => g(R)), N = de(e), b = r.useRef(!1), y = r.useRef(!0), { viewport: d, selectedItem: h, selectedItemText: x, focusSelectedItem: f } = a, v = r.useCallback(() => {
377
- if (u.trigger && u.valueNode && l && m && d && h && x) {
378
- const R = u.trigger.getBoundingClientRect(), O = m.getBoundingClientRect(), W = u.valueNode.getBoundingClientRect(), X = x.getBoundingClientRect();
379
- if (u.dir !== "rtl") {
380
- const C = X.left - O.left, T = W.left - C, Z = R.left - T, J = R.width + Z, he = Math.max(J, O.width), ve = window.innerWidth - A, ge = Te(T, [
417
+ Be.displayName = Ht;
418
+ var Ft = "SelectItemAlignedPosition", He = n.forwardRef((e, o) => {
419
+ const { __scopeSelect: t, onPlaced: a, ...r } = e, d = Y(ee, t), l = q(ee, t), [i, c] = n.useState(null), [p, g] = n.useState(null), x = L(o, (E) => g(E)), R = de(t), b = n.useRef(!1), C = n.useRef(!0), { viewport: u, selectedItem: h, selectedItemText: S, focusSelectedItem: f } = l, v = n.useCallback(() => {
420
+ if (d.trigger && d.valueNode && i && p && u && h && S) {
421
+ const E = d.trigger.getBoundingClientRect(), O = p.getBoundingClientRect(), U = d.valueNode.getBoundingClientRect(), Z = S.getBoundingClientRect();
422
+ if (d.dir !== "rtl") {
423
+ const y = Z.left - O.left, T = U.left - y, X = E.left - T, J = E.width + X, he = Math.max(J, O.width), ge = window.innerWidth - A, ve = Te(T, [
381
424
  A,
382
425
  // Prevents the content from going off the starting edge of the
383
426
  // viewport. It may still go off the ending edge, but this can be
384
427
  // controlled by the user since they may want to manage overflow in a
385
428
  // specific way.
386
429
  // https://github.com/radix-ui/primitives/issues/2049
387
- Math.max(A, ve - he)
430
+ Math.max(A, ge - he)
388
431
  ]);
389
- l.style.minWidth = J + "px", l.style.left = ge + "px";
432
+ i.style.minWidth = J + "px", i.style.left = ve + "px";
390
433
  } else {
391
- const C = O.right - X.right, T = window.innerWidth - W.right - C, Z = window.innerWidth - R.right - T, J = R.width + Z, he = Math.max(J, O.width), ve = window.innerWidth - A, ge = Te(T, [
434
+ const y = O.right - Z.right, T = window.innerWidth - U.right - y, X = window.innerWidth - E.right - T, J = E.width + X, he = Math.max(J, O.width), ge = window.innerWidth - A, ve = Te(T, [
392
435
  A,
393
- Math.max(A, ve - he)
436
+ Math.max(A, ge - he)
394
437
  ]);
395
- l.style.minWidth = J + "px", l.style.right = ge + "px";
438
+ i.style.minWidth = J + "px", i.style.right = ve + "px";
396
439
  }
397
- const k = N(), B = window.innerHeight - A * 2, z = d.scrollHeight, V = window.getComputedStyle(m), H = parseInt(V.borderTopWidth, 10), _ = parseInt(V.paddingTop, 10), D = parseInt(V.borderBottomWidth, 10), F = parseInt(V.paddingBottom, 10), K = H + _ + z + F + D, pe = Math.min(h.offsetHeight * 5, K), se = window.getComputedStyle(d), me = parseInt(se.paddingTop, 10), fe = parseInt(se.paddingBottom, 10), te = R.top + R.height / 2 - A, le = B - te, re = h.offsetHeight / 2, p = h.offsetTop + re, I = H + _ + p, E = K - I;
440
+ const k = R(), V = window.innerHeight - A * 2, z = u.scrollHeight, B = window.getComputedStyle(p), H = parseInt(B.borderTopWidth, 10), N = parseInt(B.paddingTop, 10), D = parseInt(B.borderBottomWidth, 10), W = parseInt(B.paddingBottom, 10), K = H + N + z + W + D, pe = Math.min(h.offsetHeight * 5, K), se = window.getComputedStyle(u), me = parseInt(se.paddingTop, 10), fe = parseInt(se.paddingBottom, 10), te = E.top + E.height / 2 - A, le = V - te, re = h.offsetHeight / 2, m = h.offsetTop + re, I = H + N + m, _ = K - I;
398
441
  if (I <= te) {
399
- const C = k.length > 0 && h === k[k.length - 1].ref.current;
400
- l.style.bottom = "0px";
401
- const T = m.clientHeight - d.offsetTop - d.offsetHeight, Z = Math.max(
442
+ const y = k.length > 0 && h === k[k.length - 1].ref.current;
443
+ i.style.bottom = "0px";
444
+ const T = p.clientHeight - u.offsetTop - u.offsetHeight, X = Math.max(
402
445
  le,
403
446
  re + // viewport might have padding bottom, include it to avoid a scrollable viewport
404
- (C ? fe : 0) + T + D
405
- ), J = I + Z;
406
- l.style.height = J + "px";
447
+ (y ? fe : 0) + T + D
448
+ ), J = I + X;
449
+ i.style.height = J + "px";
407
450
  } else {
408
- const C = k.length > 0 && h === k[0].ref.current;
409
- l.style.top = "0px";
410
- const Z = Math.max(
451
+ const y = k.length > 0 && h === k[0].ref.current;
452
+ i.style.top = "0px";
453
+ const X = Math.max(
411
454
  te,
412
- H + d.offsetTop + // viewport might have padding top, include it to avoid a scrollable viewport
413
- (C ? me : 0) + re
414
- ) + E;
415
- l.style.height = Z + "px", d.scrollTop = I - te + d.offsetTop;
455
+ H + u.offsetTop + // viewport might have padding top, include it to avoid a scrollable viewport
456
+ (y ? me : 0) + re
457
+ ) + _;
458
+ i.style.height = X + "px", u.scrollTop = I - te + u.offsetTop;
416
459
  }
417
- l.style.margin = `${A}px 0`, l.style.minHeight = pe + "px", l.style.maxHeight = B + "px", c?.(), requestAnimationFrame(() => b.current = !0);
460
+ i.style.margin = `${A}px 0`, i.style.minHeight = pe + "px", i.style.maxHeight = V + "px", a?.(), requestAnimationFrame(() => b.current = !0);
418
461
  }
419
462
  }, [
420
- N,
421
- u.trigger,
422
- u.valueNode,
423
- l,
424
- m,
425
- d,
463
+ R,
464
+ d.trigger,
465
+ d.valueNode,
466
+ i,
467
+ p,
468
+ u,
426
469
  h,
427
- x,
428
- u.dir,
429
- c
470
+ S,
471
+ d.dir,
472
+ a
430
473
  ]);
431
474
  $(() => v(), [v]);
432
- const [U, M] = r.useState();
475
+ const [F, M] = n.useState();
433
476
  $(() => {
434
- m && M(window.getComputedStyle(m).zIndex);
435
- }, [m]);
436
- const ne = r.useCallback(
437
- (R) => {
438
- R && y.current === !0 && (v(), f?.(), y.current = !1);
477
+ p && M(window.getComputedStyle(p).zIndex);
478
+ }, [p]);
479
+ const ne = n.useCallback(
480
+ (E) => {
481
+ E && C.current === !0 && (v(), f?.(), C.current = !1);
439
482
  },
440
483
  [v, f]
441
484
  );
442
- return /* @__PURE__ */ n.jsx(
443
- Bt,
485
+ return /* @__PURE__ */ s.jsx(
486
+ zt,
444
487
  {
445
- scope: e,
446
- contentWrapper: l,
488
+ scope: t,
489
+ contentWrapper: i,
447
490
  shouldExpandOnScrollRef: b,
448
491
  onScrollButtonChange: ne,
449
- children: /* @__PURE__ */ n.jsx(
492
+ children: /* @__PURE__ */ s.jsx(
450
493
  "div",
451
494
  {
452
- ref: i,
495
+ ref: c,
453
496
  style: {
454
497
  display: "flex",
455
498
  flexDirection: "column",
456
499
  position: "fixed",
457
- zIndex: U
500
+ zIndex: F
458
501
  },
459
- children: /* @__PURE__ */ n.jsx(
502
+ children: /* @__PURE__ */ s.jsx(
460
503
  j.div,
461
504
  {
462
- ...s,
463
- ref: w,
505
+ ...r,
506
+ ref: x,
464
507
  style: {
465
508
  // When we get the height of the content, it includes borders. If we were to set
466
509
  // the height without having `boxSizing: 'border-box'` it would be too big.
467
510
  boxSizing: "border-box",
468
511
  // We need to ensure the content doesn't get taller than the wrapper
469
512
  maxHeight: "100%",
470
- ...s.style
513
+ ...r.style
471
514
  }
472
515
  }
473
516
  )
@@ -476,26 +519,26 @@ var Lt = "SelectItemAlignedPosition", He = r.forwardRef((t, o) => {
476
519
  }
477
520
  );
478
521
  });
479
- He.displayName = Lt;
480
- var kt = "SelectPopperPosition", xe = r.forwardRef((t, o) => {
522
+ He.displayName = Ft;
523
+ var Ut = "SelectPopperPosition", xe = n.forwardRef((e, o) => {
481
524
  const {
482
- __scopeSelect: e,
483
- align: c = "start",
484
- collisionPadding: s = A,
485
- ...u
486
- } = t, a = ue(e);
487
- return /* @__PURE__ */ n.jsx(
488
- vt,
525
+ __scopeSelect: t,
526
+ align: a = "start",
527
+ collisionPadding: r = A,
528
+ ...d
529
+ } = e, l = ue(t);
530
+ return /* @__PURE__ */ s.jsx(
531
+ gt,
489
532
  {
490
- ...a,
491
- ...u,
533
+ ...l,
534
+ ...d,
492
535
  ref: o,
493
- align: c,
494
- collisionPadding: s,
536
+ align: a,
537
+ collisionPadding: r,
495
538
  style: {
496
539
  // Ensure border-box for floating-ui calculations
497
540
  boxSizing: "border-box",
498
- ...u.style,
541
+ ...d.style,
499
542
  "--radix-select-content-transform-origin": "var(--radix-popper-transform-origin)",
500
543
  "--radix-select-content-available-width": "var(--radix-popper-available-width)",
501
544
  "--radix-select-content-available-height": "var(--radix-popper-available-height)",
@@ -505,27 +548,27 @@ var kt = "SelectPopperPosition", xe = r.forwardRef((t, o) => {
505
548
  }
506
549
  );
507
550
  });
508
- xe.displayName = kt;
509
- var [Bt, be] = oe(ee, {}), Se = "SelectViewport", Fe = r.forwardRef(
510
- (t, o) => {
511
- const { __scopeSelect: e, nonce: c, ...s } = t, u = q(Se, e), a = be(Se, e), l = L(o, u.onViewportChange), i = r.useRef(0);
512
- return /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
513
- /* @__PURE__ */ n.jsx(
551
+ xe.displayName = Ut;
552
+ var [zt, be] = oe(ee, {}), Se = "SelectViewport", We = n.forwardRef(
553
+ (e, o) => {
554
+ const { __scopeSelect: t, nonce: a, ...r } = e, d = q(Se, t), l = be(Se, t), i = L(o, d.onViewportChange), c = n.useRef(0);
555
+ return /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
556
+ /* @__PURE__ */ s.jsx(
514
557
  "style",
515
558
  {
516
559
  dangerouslySetInnerHTML: {
517
560
  __html: "[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"
518
561
  },
519
- nonce: c
562
+ nonce: a
520
563
  }
521
564
  ),
522
- /* @__PURE__ */ n.jsx(ie.Slot, { scope: e, children: /* @__PURE__ */ n.jsx(
565
+ /* @__PURE__ */ s.jsx(ce.Slot, { scope: t, children: /* @__PURE__ */ s.jsx(
523
566
  j.div,
524
567
  {
525
568
  "data-radix-select-viewport": "",
526
569
  role: "presentation",
527
- ...s,
528
- ref: l,
570
+ ...r,
571
+ ref: i,
529
572
  style: {
530
573
  // we use position: 'relative' here on the `viewport` so that when we call
531
574
  // `selectedItem.offsetTop` in calculations, the offset is relative to the viewport
@@ -537,110 +580,110 @@ var [Bt, be] = oe(ee, {}), Se = "SelectViewport", Fe = r.forwardRef(
537
580
  // revisit this if/when that is supported
538
581
  // https://developer.chrome.com/blog/vertical-form-controls
539
582
  overflow: "hidden auto",
540
- ...s.style
583
+ ...r.style
541
584
  },
542
- onScroll: P(s.onScroll, (m) => {
543
- const g = m.currentTarget, { contentWrapper: w, shouldExpandOnScrollRef: N } = a;
544
- if (N?.current && w) {
545
- const b = Math.abs(i.current - g.scrollTop);
585
+ onScroll: P(r.onScroll, (p) => {
586
+ const g = p.currentTarget, { contentWrapper: x, shouldExpandOnScrollRef: R } = l;
587
+ if (R?.current && x) {
588
+ const b = Math.abs(c.current - g.scrollTop);
546
589
  if (b > 0) {
547
- const y = window.innerHeight - A * 2, d = parseFloat(w.style.minHeight), h = parseFloat(w.style.height), x = Math.max(d, h);
548
- if (x < y) {
549
- const f = x + b, v = Math.min(y, f), U = f - v;
550
- w.style.height = v + "px", w.style.bottom === "0px" && (g.scrollTop = U > 0 ? U : 0, w.style.justifyContent = "flex-end");
590
+ const C = window.innerHeight - A * 2, u = parseFloat(x.style.minHeight), h = parseFloat(x.style.height), S = Math.max(u, h);
591
+ if (S < C) {
592
+ const f = S + b, v = Math.min(C, f), F = f - v;
593
+ x.style.height = v + "px", x.style.bottom === "0px" && (g.scrollTop = F > 0 ? F : 0, x.style.justifyContent = "flex-end");
551
594
  }
552
595
  }
553
596
  }
554
- i.current = g.scrollTop;
597
+ c.current = g.scrollTop;
555
598
  })
556
599
  }
557
600
  ) })
558
601
  ] });
559
602
  }
560
603
  );
561
- Fe.displayName = Se;
562
- var Ue = "SelectGroup", [Vt, Ht] = oe(Ue), We = r.forwardRef(
563
- (t, o) => {
564
- const { __scopeSelect: e, ...c } = t, s = Ie();
565
- return /* @__PURE__ */ n.jsx(Vt, { scope: e, id: s, children: /* @__PURE__ */ n.jsx(j.div, { role: "group", "aria-labelledby": s, ...c, ref: o }) });
604
+ We.displayName = Se;
605
+ var Fe = "SelectGroup", [Kt, $t] = oe(Fe), Ue = n.forwardRef(
606
+ (e, o) => {
607
+ const { __scopeSelect: t, ...a } = e, r = Ie();
608
+ return /* @__PURE__ */ s.jsx(Kt, { scope: t, id: r, children: /* @__PURE__ */ s.jsx(j.div, { role: "group", "aria-labelledby": r, ...a, ref: o }) });
566
609
  }
567
610
  );
568
- We.displayName = Ue;
569
- var ze = "SelectLabel", Ke = r.forwardRef(
570
- (t, o) => {
571
- const { __scopeSelect: e, ...c } = t, s = Ht(ze, e);
572
- return /* @__PURE__ */ n.jsx(j.div, { id: s.id, ...c, ref: o });
611
+ Ue.displayName = Fe;
612
+ var ze = "SelectLabel", Ke = n.forwardRef(
613
+ (e, o) => {
614
+ const { __scopeSelect: t, ...a } = e, r = $t(ze, t);
615
+ return /* @__PURE__ */ s.jsx(j.div, { id: r.id, ...a, ref: o });
573
616
  }
574
617
  );
575
618
  Ke.displayName = ze;
576
- var ce = "SelectItem", [Ft, $e] = oe(ce), Ge = r.forwardRef(
577
- (t, o) => {
619
+ var ie = "SelectItem", [Gt, $e] = oe(ie), Ge = n.forwardRef(
620
+ (e, o) => {
578
621
  const {
579
- __scopeSelect: e,
580
- value: c,
581
- disabled: s = !1,
582
- textValue: u,
583
- ...a
584
- } = t, l = Y(ce, e), i = q(ce, e), m = l.value === c, [g, w] = r.useState(u ?? ""), [N, b] = r.useState(!1), y = L(
622
+ __scopeSelect: t,
623
+ value: a,
624
+ disabled: r = !1,
625
+ textValue: d,
626
+ ...l
627
+ } = e, i = Y(ie, t), c = q(ie, t), p = i.value === a, [g, x] = n.useState(d ?? ""), [R, b] = n.useState(!1), C = L(
585
628
  o,
586
- (f) => i.itemRefCallback?.(f, c, s)
587
- ), d = Ie(), h = r.useRef("touch"), x = () => {
588
- s || (l.onValueChange(c), l.onOpenChange(!1));
629
+ (f) => c.itemRefCallback?.(f, a, r)
630
+ ), u = Ie(), h = n.useRef("touch"), S = () => {
631
+ r || (i.onValueChange(a), i.onOpenChange(!1));
589
632
  };
590
- if (c === "")
633
+ if (a === "")
591
634
  throw new Error(
592
635
  "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."
593
636
  );
594
- return /* @__PURE__ */ n.jsx(
595
- Ft,
637
+ return /* @__PURE__ */ s.jsx(
638
+ Gt,
596
639
  {
597
- scope: e,
598
- value: c,
599
- disabled: s,
600
- textId: d,
601
- isSelected: m,
602
- onItemTextChange: r.useCallback((f) => {
603
- w((v) => v || (f?.textContent ?? "").trim());
640
+ scope: t,
641
+ value: a,
642
+ disabled: r,
643
+ textId: u,
644
+ isSelected: p,
645
+ onItemTextChange: n.useCallback((f) => {
646
+ x((v) => v || (f?.textContent ?? "").trim());
604
647
  }, []),
605
- children: /* @__PURE__ */ n.jsx(
606
- ie.ItemSlot,
648
+ children: /* @__PURE__ */ s.jsx(
649
+ ce.ItemSlot,
607
650
  {
608
- scope: e,
609
- value: c,
610
- disabled: s,
651
+ scope: t,
652
+ value: a,
653
+ disabled: r,
611
654
  textValue: g,
612
- children: /* @__PURE__ */ n.jsx(
655
+ children: /* @__PURE__ */ s.jsx(
613
656
  j.div,
614
657
  {
615
658
  role: "option",
616
- "aria-labelledby": d,
617
- "data-highlighted": N ? "" : void 0,
618
- "aria-selected": m && N,
619
- "data-state": m ? "checked" : "unchecked",
620
- "aria-disabled": s || void 0,
621
- "data-disabled": s ? "" : void 0,
622
- tabIndex: s ? void 0 : -1,
623
- ...a,
624
- ref: y,
625
- onFocus: P(a.onFocus, () => b(!0)),
626
- onBlur: P(a.onBlur, () => b(!1)),
627
- onClick: P(a.onClick, () => {
628
- h.current !== "mouse" && x();
659
+ "aria-labelledby": u,
660
+ "data-highlighted": R ? "" : void 0,
661
+ "aria-selected": p && R,
662
+ "data-state": p ? "checked" : "unchecked",
663
+ "aria-disabled": r || void 0,
664
+ "data-disabled": r ? "" : void 0,
665
+ tabIndex: r ? void 0 : -1,
666
+ ...l,
667
+ ref: C,
668
+ onFocus: P(l.onFocus, () => b(!0)),
669
+ onBlur: P(l.onBlur, () => b(!1)),
670
+ onClick: P(l.onClick, () => {
671
+ h.current !== "mouse" && S();
629
672
  }),
630
- onPointerUp: P(a.onPointerUp, () => {
631
- h.current === "mouse" && x();
673
+ onPointerUp: P(l.onPointerUp, () => {
674
+ h.current === "mouse" && S();
632
675
  }),
633
- onPointerDown: P(a.onPointerDown, (f) => {
676
+ onPointerDown: P(l.onPointerDown, (f) => {
634
677
  h.current = f.pointerType;
635
678
  }),
636
- onPointerMove: P(a.onPointerMove, (f) => {
637
- h.current = f.pointerType, s ? i.onItemLeave?.() : h.current === "mouse" && f.currentTarget.focus({ preventScroll: !0 });
679
+ onPointerMove: P(l.onPointerMove, (f) => {
680
+ h.current = f.pointerType, r ? c.onItemLeave?.() : h.current === "mouse" && f.currentTarget.focus({ preventScroll: !0 });
638
681
  }),
639
- onPointerLeave: P(a.onPointerLeave, (f) => {
640
- f.currentTarget === document.activeElement && i.onItemLeave?.();
682
+ onPointerLeave: P(l.onPointerLeave, (f) => {
683
+ f.currentTarget === document.activeElement && c.onItemLeave?.();
641
684
  }),
642
- onKeyDown: P(a.onKeyDown, (f) => {
643
- i.searchRef?.current !== "" && f.key === " " || (Nt.includes(f.key) && x(), f.key === " " && f.preventDefault());
685
+ onKeyDown: P(l.onKeyDown, (f) => {
686
+ c.searchRef?.current !== "" && f.key === " " || (At.includes(f.key) && S(), f.key === " " && f.preventDefault());
644
687
  })
645
688
  }
646
689
  )
@@ -650,338 +693,338 @@ var ce = "SelectItem", [Ft, $e] = oe(ce), Ge = r.forwardRef(
650
693
  );
651
694
  }
652
695
  );
653
- Ge.displayName = ce;
654
- var ae = "SelectItemText", Ye = r.forwardRef(
655
- (t, o) => {
656
- const { __scopeSelect: e, className: c, style: s, ...u } = t, a = Y(ae, e), l = q(ae, e), i = $e(ae, e), m = jt(ae, e), [g, w] = r.useState(null), N = L(
696
+ Ge.displayName = ie;
697
+ var ae = "SelectItemText", Ye = n.forwardRef(
698
+ (e, o) => {
699
+ const { __scopeSelect: t, className: a, style: r, ...d } = e, l = Y(ae, t), i = q(ae, t), c = $e(ae, t), p = kt(ae, t), [g, x] = n.useState(null), R = L(
657
700
  o,
658
- (x) => w(x),
659
- i.onItemTextChange,
660
- (x) => l.itemTextRefCallback?.(x, i.value, i.disabled)
661
- ), b = g?.textContent, y = r.useMemo(
662
- () => /* @__PURE__ */ n.jsx("option", { value: i.value, disabled: i.disabled, children: b }, i.value),
663
- [i.disabled, i.value, b]
664
- ), { onNativeOptionAdd: d, onNativeOptionRemove: h } = m;
665
- return $(() => (d(y), () => h(y)), [d, h, y]), /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
666
- /* @__PURE__ */ n.jsx(j.span, { id: i.textId, ...u, ref: N }),
667
- i.isSelected && a.valueNode && !a.valueNodeHasChildren ? Ne.createPortal(u.children, a.valueNode) : null
701
+ (S) => x(S),
702
+ c.onItemTextChange,
703
+ (S) => i.itemTextRefCallback?.(S, c.value, c.disabled)
704
+ ), b = g?.textContent, C = n.useMemo(
705
+ () => /* @__PURE__ */ s.jsx("option", { value: c.value, disabled: c.disabled, children: b }, c.value),
706
+ [c.disabled, c.value, b]
707
+ ), { onNativeOptionAdd: u, onNativeOptionRemove: h } = p;
708
+ return $(() => (u(C), () => h(C)), [u, h, C]), /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
709
+ /* @__PURE__ */ s.jsx(j.span, { id: c.textId, ...d, ref: R }),
710
+ c.isSelected && l.valueNode && !l.valueNodeHasChildren ? Re.createPortal(d.children, l.valueNode) : null
668
711
  ] });
669
712
  }
670
713
  );
671
714
  Ye.displayName = ae;
672
- var qe = "SelectItemIndicator", Xe = r.forwardRef(
673
- (t, o) => {
674
- const { __scopeSelect: e, ...c } = t;
675
- return $e(qe, e).isSelected ? /* @__PURE__ */ n.jsx(j.span, { "aria-hidden": !0, ...c, ref: o }) : null;
715
+ var qe = "SelectItemIndicator", Ze = n.forwardRef(
716
+ (e, o) => {
717
+ const { __scopeSelect: t, ...a } = e;
718
+ return $e(qe, t).isSelected ? /* @__PURE__ */ s.jsx(j.span, { "aria-hidden": !0, ...a, ref: o }) : null;
676
719
  }
677
720
  );
678
- Xe.displayName = qe;
679
- var we = "SelectScrollUpButton", Ze = r.forwardRef((t, o) => {
680
- const e = q(we, t.__scopeSelect), c = be(we, t.__scopeSelect), [s, u] = r.useState(!1), a = L(o, c.onScrollButtonChange);
721
+ Ze.displayName = qe;
722
+ var we = "SelectScrollUpButton", Xe = n.forwardRef((e, o) => {
723
+ const t = q(we, e.__scopeSelect), a = be(we, e.__scopeSelect), [r, d] = n.useState(!1), l = L(o, a.onScrollButtonChange);
681
724
  return $(() => {
682
- if (e.viewport && e.isPositioned) {
683
- let l = function() {
684
- const m = i.scrollTop > 0;
685
- u(m);
725
+ if (t.viewport && t.isPositioned) {
726
+ let i = function() {
727
+ const p = c.scrollTop > 0;
728
+ d(p);
686
729
  };
687
- const i = e.viewport;
688
- return l(), i.addEventListener("scroll", l), () => i.removeEventListener("scroll", l);
730
+ const c = t.viewport;
731
+ return i(), c.addEventListener("scroll", i), () => c.removeEventListener("scroll", i);
689
732
  }
690
- }, [e.viewport, e.isPositioned]), s ? /* @__PURE__ */ n.jsx(
733
+ }, [t.viewport, t.isPositioned]), r ? /* @__PURE__ */ s.jsx(
691
734
  Qe,
692
735
  {
693
- ...t,
694
- ref: a,
736
+ ...e,
737
+ ref: l,
695
738
  onAutoScroll: () => {
696
- const { viewport: l, selectedItem: i } = e;
697
- l && i && (l.scrollTop = l.scrollTop - i.offsetHeight);
739
+ const { viewport: i, selectedItem: c } = t;
740
+ i && c && (i.scrollTop = i.scrollTop - c.offsetHeight);
698
741
  }
699
742
  }
700
743
  ) : null;
701
744
  });
702
- Ze.displayName = we;
703
- var Ce = "SelectScrollDownButton", Je = r.forwardRef((t, o) => {
704
- const e = q(Ce, t.__scopeSelect), c = be(Ce, t.__scopeSelect), [s, u] = r.useState(!1), a = L(o, c.onScrollButtonChange);
745
+ Xe.displayName = we;
746
+ var ye = "SelectScrollDownButton", Je = n.forwardRef((e, o) => {
747
+ const t = q(ye, e.__scopeSelect), a = be(ye, e.__scopeSelect), [r, d] = n.useState(!1), l = L(o, a.onScrollButtonChange);
705
748
  return $(() => {
706
- if (e.viewport && e.isPositioned) {
707
- let l = function() {
708
- const m = i.scrollHeight - i.clientHeight, g = Math.ceil(i.scrollTop) < m;
709
- u(g);
749
+ if (t.viewport && t.isPositioned) {
750
+ let i = function() {
751
+ const p = c.scrollHeight - c.clientHeight, g = Math.ceil(c.scrollTop) < p;
752
+ d(g);
710
753
  };
711
- const i = e.viewport;
712
- return l(), i.addEventListener("scroll", l), () => i.removeEventListener("scroll", l);
754
+ const c = t.viewport;
755
+ return i(), c.addEventListener("scroll", i), () => c.removeEventListener("scroll", i);
713
756
  }
714
- }, [e.viewport, e.isPositioned]), s ? /* @__PURE__ */ n.jsx(
757
+ }, [t.viewport, t.isPositioned]), r ? /* @__PURE__ */ s.jsx(
715
758
  Qe,
716
759
  {
717
- ...t,
718
- ref: a,
760
+ ...e,
761
+ ref: l,
719
762
  onAutoScroll: () => {
720
- const { viewport: l, selectedItem: i } = e;
721
- l && i && (l.scrollTop = l.scrollTop + i.offsetHeight);
763
+ const { viewport: i, selectedItem: c } = t;
764
+ i && c && (i.scrollTop = i.scrollTop + c.offsetHeight);
722
765
  }
723
766
  }
724
767
  ) : null;
725
768
  });
726
- Je.displayName = Ce;
727
- var Qe = r.forwardRef((t, o) => {
728
- const { __scopeSelect: e, onAutoScroll: c, ...s } = t, u = q("SelectScrollButton", e), a = r.useRef(null), l = de(e), i = r.useCallback(() => {
729
- a.current !== null && (window.clearInterval(a.current), a.current = null);
769
+ Je.displayName = ye;
770
+ var Qe = n.forwardRef((e, o) => {
771
+ const { __scopeSelect: t, onAutoScroll: a, ...r } = e, d = q("SelectScrollButton", t), l = n.useRef(null), i = de(t), c = n.useCallback(() => {
772
+ l.current !== null && (window.clearInterval(l.current), l.current = null);
730
773
  }, []);
731
- return r.useEffect(() => () => i(), [i]), $(() => {
732
- l().find((g) => g.ref.current === document.activeElement)?.ref.current?.scrollIntoView({ block: "nearest" });
733
- }, [l]), /* @__PURE__ */ n.jsx(
774
+ return n.useEffect(() => () => c(), [c]), $(() => {
775
+ i().find((g) => g.ref.current === document.activeElement)?.ref.current?.scrollIntoView({ block: "nearest" });
776
+ }, [i]), /* @__PURE__ */ s.jsx(
734
777
  j.div,
735
778
  {
736
779
  "aria-hidden": !0,
737
- ...s,
780
+ ...r,
738
781
  ref: o,
739
- style: { flexShrink: 0, ...s.style },
740
- onPointerDown: P(s.onPointerDown, () => {
741
- a.current === null && (a.current = window.setInterval(c, 50));
782
+ style: { flexShrink: 0, ...r.style },
783
+ onPointerDown: P(r.onPointerDown, () => {
784
+ l.current === null && (l.current = window.setInterval(a, 50));
742
785
  }),
743
- onPointerMove: P(s.onPointerMove, () => {
744
- u.onItemLeave?.(), a.current === null && (a.current = window.setInterval(c, 50));
786
+ onPointerMove: P(r.onPointerMove, () => {
787
+ d.onItemLeave?.(), l.current === null && (l.current = window.setInterval(a, 50));
745
788
  }),
746
- onPointerLeave: P(s.onPointerLeave, () => {
747
- i();
789
+ onPointerLeave: P(r.onPointerLeave, () => {
790
+ c();
748
791
  })
749
792
  }
750
793
  );
751
- }), Ut = "SelectSeparator", et = r.forwardRef(
752
- (t, o) => {
753
- const { __scopeSelect: e, ...c } = t;
754
- return /* @__PURE__ */ n.jsx(j.div, { "aria-hidden": !0, ...c, ref: o });
794
+ }), Yt = "SelectSeparator", et = n.forwardRef(
795
+ (e, o) => {
796
+ const { __scopeSelect: t, ...a } = e;
797
+ return /* @__PURE__ */ s.jsx(j.div, { "aria-hidden": !0, ...a, ref: o });
755
798
  }
756
799
  );
757
- et.displayName = Ut;
758
- var ye = "SelectArrow", Wt = r.forwardRef(
759
- (t, o) => {
760
- const { __scopeSelect: e, ...c } = t, s = ue(e), u = Y(ye, e), a = q(ye, e);
761
- return u.open && a.position === "popper" ? /* @__PURE__ */ n.jsx(gt, { ...s, ...c, ref: o }) : null;
800
+ et.displayName = Yt;
801
+ var Ce = "SelectArrow", qt = n.forwardRef(
802
+ (e, o) => {
803
+ const { __scopeSelect: t, ...a } = e, r = ue(t), d = Y(Ce, t), l = q(Ce, t);
804
+ return d.open && l.position === "popper" ? /* @__PURE__ */ s.jsx(vt, { ...r, ...a, ref: o }) : null;
762
805
  }
763
806
  );
764
- Wt.displayName = ye;
765
- var zt = "SelectBubbleInput", tt = r.forwardRef(
766
- ({ __scopeSelect: t, value: o, ...e }, c) => {
767
- const s = r.useRef(null), u = L(c, s), a = wt(o);
768
- return r.useEffect(() => {
769
- const l = s.current;
770
- if (!l) return;
771
- const i = window.HTMLSelectElement.prototype, g = Object.getOwnPropertyDescriptor(
772
- i,
807
+ qt.displayName = Ce;
808
+ var Zt = "SelectBubbleInput", tt = n.forwardRef(
809
+ ({ __scopeSelect: e, value: o, ...t }, a) => {
810
+ const r = n.useRef(null), d = L(a, r), l = wt(o);
811
+ return n.useEffect(() => {
812
+ const i = r.current;
813
+ if (!i) return;
814
+ const c = window.HTMLSelectElement.prototype, g = Object.getOwnPropertyDescriptor(
815
+ c,
773
816
  "value"
774
817
  ).set;
775
- if (a !== o && g) {
776
- const w = new Event("change", { bubbles: !0 });
777
- g.call(l, o), l.dispatchEvent(w);
818
+ if (l !== o && g) {
819
+ const x = new Event("change", { bubbles: !0 });
820
+ g.call(i, o), i.dispatchEvent(x);
778
821
  }
779
- }, [a, o]), /* @__PURE__ */ n.jsx(
822
+ }, [l, o]), /* @__PURE__ */ s.jsx(
780
823
  j.select,
781
824
  {
782
- ...e,
783
- style: { ...Ct, ...e.style },
784
- ref: u,
825
+ ...t,
826
+ style: { ...yt, ...t.style },
827
+ ref: d,
785
828
  defaultValue: o
786
829
  }
787
830
  );
788
831
  }
789
832
  );
790
- tt.displayName = zt;
791
- function ot(t) {
792
- return t === "" || t === void 0;
833
+ tt.displayName = Zt;
834
+ function ot(e) {
835
+ return e === "" || e === void 0;
793
836
  }
794
- function nt(t) {
795
- const o = St(t), e = r.useRef(""), c = r.useRef(0), s = r.useCallback(
796
- (a) => {
797
- const l = e.current + a;
798
- o(l), (function i(m) {
799
- e.current = m, window.clearTimeout(c.current), m !== "" && (c.current = window.setTimeout(() => i(""), 1e3));
800
- })(l);
837
+ function nt(e) {
838
+ const o = St(e), t = n.useRef(""), a = n.useRef(0), r = n.useCallback(
839
+ (l) => {
840
+ const i = t.current + l;
841
+ o(i), (function c(p) {
842
+ t.current = p, window.clearTimeout(a.current), p !== "" && (a.current = window.setTimeout(() => c(""), 1e3));
843
+ })(i);
801
844
  },
802
845
  [o]
803
- ), u = r.useCallback(() => {
804
- e.current = "", window.clearTimeout(c.current);
846
+ ), d = n.useCallback(() => {
847
+ t.current = "", window.clearTimeout(a.current);
805
848
  }, []);
806
- return r.useEffect(() => () => window.clearTimeout(c.current), []), [e, s, u];
849
+ return n.useEffect(() => () => window.clearTimeout(a.current), []), [t, r, d];
807
850
  }
808
- function rt(t, o, e) {
809
- const s = o.length > 1 && Array.from(o).every((m) => m === o[0]) ? o[0] : o, u = e ? t.indexOf(e) : -1;
810
- let a = Kt(t, Math.max(u, 0));
811
- s.length === 1 && (a = a.filter((m) => m !== e));
812
- const i = a.find(
813
- (m) => m.textValue.toLowerCase().startsWith(s.toLowerCase())
851
+ function rt(e, o, t) {
852
+ const r = o.length > 1 && Array.from(o).every((p) => p === o[0]) ? o[0] : o, d = t ? e.indexOf(t) : -1;
853
+ let l = Xt(e, Math.max(d, 0));
854
+ r.length === 1 && (l = l.filter((p) => p !== t));
855
+ const c = l.find(
856
+ (p) => p.textValue.toLowerCase().startsWith(r.toLowerCase())
814
857
  );
815
- return i !== e ? i : void 0;
858
+ return c !== t ? c : void 0;
816
859
  }
817
- function Kt(t, o) {
818
- return t.map((e, c) => t[(o + c) % t.length]);
860
+ function Xt(e, o) {
861
+ return e.map((t, a) => e[(o + a) % e.length]);
819
862
  }
820
- var $t = Ee, Gt = Me, Yt = Oe, qt = De, Xt = Le, Zt = ke, Jt = Fe, Qt = We, eo = Ke, to = Ge, oo = Ye, no = Xe, ro = Ze, ao = Je, so = et;
821
- function Eo({
822
- ...t
863
+ var Jt = _e, Qt = Me, eo = Oe, to = De, oo = Le, no = ke, ro = We, ao = Ue, so = Ke, lo = Ge, io = Ye, co = Ze, uo = Xe, po = Je, mo = et;
864
+ function Lo({
865
+ ...e
823
866
  }) {
824
- return /* @__PURE__ */ n.jsx($t, { "data-slot": "select", ...t });
867
+ return /* @__PURE__ */ s.jsx(Jt, { "data-slot": "select", ...e });
825
868
  }
826
- function jo({
827
- ...t
869
+ function ko({
870
+ ...e
828
871
  }) {
829
- return /* @__PURE__ */ n.jsx(Qt, { "data-slot": "select-group", ...t });
872
+ return /* @__PURE__ */ s.jsx(ao, { "data-slot": "select-group", ...e });
830
873
  }
831
- function Mo({
832
- ...t
874
+ function Vo({
875
+ ...e
833
876
  }) {
834
- return /* @__PURE__ */ n.jsx(Yt, { "data-slot": "select-value", ...t });
877
+ return /* @__PURE__ */ s.jsx(eo, { "data-slot": "select-value", ...e });
835
878
  }
836
- function Ao({
837
- className: t,
879
+ function Bo({
880
+ className: e,
838
881
  size: o = "default",
839
- children: e,
840
- ...c
882
+ children: t,
883
+ ...a
841
884
  }) {
842
- return /* @__PURE__ */ n.jsxs(
843
- Gt,
885
+ return /* @__PURE__ */ s.jsxs(
886
+ Qt,
844
887
  {
845
888
  "data-slot": "select-trigger",
846
889
  "data-size": o,
847
890
  className: G(
848
891
  "adm:border-input adm:data-[placeholder]:text-muted-foreground adm:[&_svg:not([class*=text-])]:text-muted-foreground adm:focus-visible:border-ring adm:focus-visible:ring-ring/50 adm:aria-invalid:ring-destructive/20 adm:dark:aria-invalid:ring-destructive/40 adm:aria-invalid:border-destructive adm:dark:bg-input/30 adm:dark:hover:bg-input/50 adm:flex adm:w-fit adm:items-center adm:justify-between adm:gap-2 adm:rounded-md adm:border adm:bg-transparent adm:px-3 adm:py-2 adm:text-sm adm:whitespace-nowrap adm:shadow-xs adm:transition-[color,box-shadow] adm:outline-none adm:focus-visible:ring-[3px] adm:disabled:cursor-not-allowed adm:disabled:opacity-50 adm:data-[size=default]:h-9 adm:data-[size=sm]:h-8 adm:*:data-[slot=select-value]:line-clamp-1 adm:*:data-[slot=select-value]:flex adm:*:data-[slot=select-value]:items-center adm:*:data-[slot=select-value]:gap-2 adm:[&_svg]:pointer-events-none adm:[&_svg]:shrink-0 adm:[&_svg:not([class*=size-])]:size-4",
849
- t
892
+ e
850
893
  ),
851
- ...c,
894
+ ...a,
852
895
  children: [
853
- e,
854
- /* @__PURE__ */ n.jsx(qt, { asChild: !0, children: /* @__PURE__ */ n.jsx(_e, { className: "adm:size-4 adm:opacity-50" }) })
896
+ t,
897
+ /* @__PURE__ */ s.jsx(to, { asChild: !0, children: /* @__PURE__ */ s.jsx(Ne, { className: "adm:size-4 adm:opacity-50" }) })
855
898
  ]
856
899
  }
857
900
  );
858
901
  }
859
- function Oo({
860
- className: t,
902
+ function Ho({
903
+ className: e,
861
904
  children: o,
862
- position: e = "popper",
863
- align: c = "center",
864
- ...s
905
+ position: t = "popper",
906
+ align: a = "center",
907
+ ...r
865
908
  }) {
866
- return /* @__PURE__ */ n.jsx(Xt, { children: /* @__PURE__ */ n.jsxs(
867
- Zt,
909
+ return /* @__PURE__ */ s.jsx(oo, { children: /* @__PURE__ */ s.jsxs(
910
+ no,
868
911
  {
869
912
  "data-slot": "select-content",
870
913
  className: G(
871
914
  "adm:bg-popover adm:text-popover-foreground adm:data-[state=open]:animate-in adm:data-[state=closed]:animate-out adm:data-[state=closed]:fade-out-0 adm:data-[state=open]:fade-in-0 adm:data-[state=closed]:zoom-out-95 adm:data-[state=open]:zoom-in-95 adm:data-[side=bottom]:slide-in-from-top-2 adm:data-[side=left]:slide-in-from-right-2 adm:data-[side=right]:slide-in-from-left-2 adm:data-[side=top]:slide-in-from-bottom-2 adm:relative adm:z-50 adm:max-h-(--radix-select-content-available-height) adm:min-w-[8rem] adm:origin-(--radix-select-content-transform-origin) adm:overflow-x-hidden adm:overflow-y-auto adm:rounded-md adm:border adm:shadow-xs",
872
- e === "popper" && "adm:data-[side=bottom]:translate-y-1 adm:data-[side=left]:-translate-x-1 adm:data-[side=right]:translate-x-1 adm:data-[side=top]:-translate-y-1",
873
- t
915
+ t === "popper" && "adm:data-[side=bottom]:translate-y-1 adm:data-[side=left]:-translate-x-1 adm:data-[side=right]:translate-x-1 adm:data-[side=top]:-translate-y-1",
916
+ e
874
917
  ),
875
- position: e,
876
- align: c,
877
- ...s,
918
+ position: t,
919
+ align: a,
920
+ ...r,
878
921
  children: [
879
- /* @__PURE__ */ n.jsx(lo, {}),
880
- /* @__PURE__ */ n.jsx(
881
- Jt,
922
+ /* @__PURE__ */ s.jsx(fo, {}),
923
+ /* @__PURE__ */ s.jsx(
924
+ ro,
882
925
  {
883
926
  className: G(
884
927
  "adm:p-1",
885
- e === "popper" && "adm:h-[var(--radix-select-trigger-height)] adm:w-full adm:min-w-[var(--radix-select-trigger-width)] adm:scroll-my-1"
928
+ t === "popper" && "adm:h-[var(--radix-select-trigger-height)] adm:w-full adm:min-w-[var(--radix-select-trigger-width)] adm:scroll-my-1"
886
929
  ),
887
930
  children: o
888
931
  }
889
932
  ),
890
- /* @__PURE__ */ n.jsx(co, {})
933
+ /* @__PURE__ */ s.jsx(ho, {})
891
934
  ]
892
935
  }
893
936
  ) });
894
937
  }
895
- function Do({
896
- className: t,
938
+ function Wo({
939
+ className: e,
897
940
  ...o
898
941
  }) {
899
- return /* @__PURE__ */ n.jsx(
900
- eo,
942
+ return /* @__PURE__ */ s.jsx(
943
+ so,
901
944
  {
902
945
  "data-slot": "select-label",
903
- className: G("adm:text-muted-foreground adm:px-2 adm:py-1.5 adm:text-xs", t),
946
+ className: G("adm:text-muted-foreground adm:px-2 adm:py-1.5 adm:text-xs", e),
904
947
  ...o
905
948
  }
906
949
  );
907
950
  }
908
- function Lo({
909
- className: t,
951
+ function Fo({
952
+ className: e,
910
953
  children: o,
911
- ...e
954
+ ...t
912
955
  }) {
913
- return /* @__PURE__ */ n.jsxs(
914
- to,
956
+ return /* @__PURE__ */ s.jsxs(
957
+ lo,
915
958
  {
916
959
  "data-slot": "select-item",
917
960
  className: G(
918
961
  "adm:focus:bg-accent adm:focus:text-accent-foreground adm:[&_svg:not([class*=text-])]:text-muted-foreground adm:relative adm:flex adm:w-full adm:cursor-default adm:items-center adm:gap-2 adm:rounded-sm adm:py-1.5 adm:pr-8 adm:pl-2 adm:text-sm adm:outline-hidden adm:select-none adm:data-[disabled]:pointer-events-none adm:data-[disabled]:opacity-50 adm:[&_svg]:pointer-events-none adm:[&_svg]:shrink-0 adm:[&_svg:not([class*=size-])]:size-4 adm:*:[span]:last:flex adm:*:[span]:last:items-center adm:*:[span]:last:gap-2",
919
- t
962
+ e
920
963
  ),
921
- ...e,
964
+ ...t,
922
965
  children: [
923
- /* @__PURE__ */ n.jsx("span", { className: "adm:absolute adm:right-2 adm:flex adm:size-3.5 adm:items-center adm:justify-center", children: /* @__PURE__ */ n.jsx(no, { children: /* @__PURE__ */ n.jsx(yt, { className: "adm:size-4" }) }) }),
924
- /* @__PURE__ */ n.jsx(oo, { children: o })
966
+ /* @__PURE__ */ s.jsx("span", { className: "adm:absolute adm:right-2 adm:flex adm:size-3.5 adm:items-center adm:justify-center", children: /* @__PURE__ */ s.jsx(co, { children: /* @__PURE__ */ s.jsx(Ct, { className: "adm:size-4" }) }) }),
967
+ /* @__PURE__ */ s.jsx(io, { children: o })
925
968
  ]
926
969
  }
927
970
  );
928
971
  }
929
- function ko({
930
- className: t,
972
+ function Uo({
973
+ className: e,
931
974
  ...o
932
975
  }) {
933
- return /* @__PURE__ */ n.jsx(
934
- so,
976
+ return /* @__PURE__ */ s.jsx(
977
+ mo,
935
978
  {
936
979
  "data-slot": "select-separator",
937
- className: G("adm:bg-border adm:pointer-events-none adm:-mx-1 adm:my-1 adm:h-px", t),
980
+ className: G("adm:bg-border adm:pointer-events-none adm:-mx-1 adm:my-1 adm:h-px", e),
938
981
  ...o
939
982
  }
940
983
  );
941
984
  }
942
- function lo({
943
- className: t,
985
+ function fo({
986
+ className: e,
944
987
  ...o
945
988
  }) {
946
- return /* @__PURE__ */ n.jsx(
947
- ro,
989
+ return /* @__PURE__ */ s.jsx(
990
+ uo,
948
991
  {
949
992
  "data-slot": "select-scroll-up-button",
950
993
  className: G(
951
994
  "adm:flex adm:cursor-default adm:items-center adm:justify-center adm:py-1",
952
- t
995
+ e
953
996
  ),
954
997
  ...o,
955
- children: /* @__PURE__ */ n.jsx(Tt, { className: "adm:size-4" })
998
+ children: /* @__PURE__ */ s.jsx(Tt, { className: "adm:size-4" })
956
999
  }
957
1000
  );
958
1001
  }
959
- function co({
960
- className: t,
1002
+ function ho({
1003
+ className: e,
961
1004
  ...o
962
1005
  }) {
963
- return /* @__PURE__ */ n.jsx(
964
- ao,
1006
+ return /* @__PURE__ */ s.jsx(
1007
+ po,
965
1008
  {
966
1009
  "data-slot": "select-scroll-down-button",
967
1010
  className: G(
968
1011
  "adm:flex adm:cursor-default adm:items-center adm:justify-center adm:py-1",
969
- t
1012
+ e
970
1013
  ),
971
1014
  ...o,
972
- children: /* @__PURE__ */ n.jsx(_e, { className: "adm:size-4" })
1015
+ children: /* @__PURE__ */ s.jsx(Ne, { className: "adm:size-4" })
973
1016
  }
974
1017
  );
975
1018
  }
976
1019
  export {
977
- Eo as Select,
978
- Oo as SelectContent,
979
- jo as SelectGroup,
980
- Lo as SelectItem,
981
- Do as SelectLabel,
982
- co as SelectScrollDownButton,
983
- lo as SelectScrollUpButton,
984
- ko as SelectSeparator,
985
- Ao as SelectTrigger,
986
- Mo as SelectValue
1020
+ Lo as Select,
1021
+ Ho as SelectContent,
1022
+ ko as SelectGroup,
1023
+ Fo as SelectItem,
1024
+ Wo as SelectLabel,
1025
+ ho as SelectScrollDownButton,
1026
+ fo as SelectScrollUpButton,
1027
+ Uo as SelectSeparator,
1028
+ Bo as SelectTrigger,
1029
+ Vo as SelectValue
987
1030
  };