@rpcbase/ui 0.217.0 → 0.219.0

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 (246) hide show
  1. package/dist/components/AddressAutocompleteInput/index.d.ts.map +1 -1
  2. package/dist/components/HourPickerField/index.d.ts.map +1 -1
  3. package/dist/index10.js +544 -489
  4. package/dist/index10.js.map +1 -1
  5. package/dist/index107.js +1 -1
  6. package/dist/index11.js +2 -2
  7. package/dist/index12.js +3 -3
  8. package/dist/index13.js +2 -2
  9. package/dist/index14.js +2 -2
  10. package/dist/index15.js +2 -2
  11. package/dist/index150.js +1 -1
  12. package/dist/index151.js +46 -5
  13. package/dist/index151.js.map +1 -1
  14. package/dist/index152.js +223 -62
  15. package/dist/index152.js.map +1 -1
  16. package/dist/index153.js +22 -2
  17. package/dist/index153.js.map +1 -1
  18. package/dist/index154.js +24 -363
  19. package/dist/index154.js.map +1 -1
  20. package/dist/index155.js +382 -243
  21. package/dist/index155.js.map +1 -1
  22. package/dist/index156.js +5 -60
  23. package/dist/index156.js.map +1 -1
  24. package/dist/index157.js +62 -40
  25. package/dist/index157.js.map +1 -1
  26. package/dist/index158.js +2 -170
  27. package/dist/index158.js.map +1 -1
  28. package/dist/index159.js +356 -102
  29. package/dist/index159.js.map +1 -1
  30. package/dist/index16.js +2 -2
  31. package/dist/index160.js +261 -24
  32. package/dist/index160.js.map +1 -1
  33. package/dist/index161.js +61 -8
  34. package/dist/index161.js.map +1 -1
  35. package/dist/index162.js +46 -4
  36. package/dist/index162.js.map +1 -1
  37. package/dist/index163.js +169 -5
  38. package/dist/index163.js.map +1 -1
  39. package/dist/index164.js +109 -4
  40. package/dist/index164.js.map +1 -1
  41. package/dist/index165.js +24 -466
  42. package/dist/index165.js.map +1 -1
  43. package/dist/index166.js +8 -186
  44. package/dist/index166.js.map +1 -1
  45. package/dist/index167.js +4 -107
  46. package/dist/index167.js.map +1 -1
  47. package/dist/index168.js +5 -262
  48. package/dist/index168.js.map +1 -1
  49. package/dist/index169.js +4 -9
  50. package/dist/index169.js.map +1 -1
  51. package/dist/index17.js +1 -1
  52. package/dist/index170.js +462 -38
  53. package/dist/index170.js.map +1 -1
  54. package/dist/index171.js +185 -4
  55. package/dist/index171.js.map +1 -1
  56. package/dist/index172.js +103 -42
  57. package/dist/index172.js.map +1 -1
  58. package/dist/index173.js +253 -220
  59. package/dist/index173.js.map +1 -1
  60. package/dist/index174.js +10 -22
  61. package/dist/index174.js.map +1 -1
  62. package/dist/index175.js +42 -24
  63. package/dist/index175.js.map +1 -1
  64. package/dist/index176.js +4 -400
  65. package/dist/index176.js.map +1 -1
  66. package/dist/index18.js +7 -7
  67. package/dist/index19.js +3 -3
  68. package/dist/index21.js +1 -1
  69. package/dist/index22.js +2 -2
  70. package/dist/index229.js +1 -1
  71. package/dist/index23.js +1 -1
  72. package/dist/index235.js +1 -1
  73. package/dist/index237.js +23 -12
  74. package/dist/index237.js.map +1 -1
  75. package/dist/index238.js +29 -155
  76. package/dist/index238.js.map +1 -1
  77. package/dist/index239.js +5 -31
  78. package/dist/index239.js.map +1 -1
  79. package/dist/index24.js +1 -1
  80. package/dist/index240.js +13 -9
  81. package/dist/index240.js.map +1 -1
  82. package/dist/index241.js +147 -41
  83. package/dist/index241.js.map +1 -1
  84. package/dist/index242.js +29 -10
  85. package/dist/index242.js.map +1 -1
  86. package/dist/index243.js +9 -44
  87. package/dist/index243.js.map +1 -1
  88. package/dist/index244.js +41 -88
  89. package/dist/index244.js.map +1 -1
  90. package/dist/index245.js +10 -85
  91. package/dist/index245.js.map +1 -1
  92. package/dist/index246.js +41 -102
  93. package/dist/index246.js.map +1 -1
  94. package/dist/index247.js +88 -45
  95. package/dist/index247.js.map +1 -1
  96. package/dist/index248.js +85 -10
  97. package/dist/index248.js.map +1 -1
  98. package/dist/index249.js +96 -28
  99. package/dist/index249.js.map +1 -1
  100. package/dist/index25.js +1 -1
  101. package/dist/index250.js +52 -8
  102. package/dist/index250.js.map +1 -1
  103. package/dist/index251.js +10 -115
  104. package/dist/index251.js.map +1 -1
  105. package/dist/index252.js +36 -16
  106. package/dist/index252.js.map +1 -1
  107. package/dist/index253.js +8 -15
  108. package/dist/index253.js.map +1 -1
  109. package/dist/index254.js +116 -3
  110. package/dist/index254.js.map +1 -1
  111. package/dist/index255.js +16 -35
  112. package/dist/index255.js.map +1 -1
  113. package/dist/index256.js +14 -19
  114. package/dist/index256.js.map +1 -1
  115. package/dist/index257.js +3 -9
  116. package/dist/index257.js.map +1 -1
  117. package/dist/index258.js +36 -8
  118. package/dist/index258.js.map +1 -1
  119. package/dist/index259.js +19 -18
  120. package/dist/index259.js.map +1 -1
  121. package/dist/index260.js +9 -28
  122. package/dist/index260.js.map +1 -1
  123. package/dist/index261.js +7 -15
  124. package/dist/index261.js.map +1 -1
  125. package/dist/index262.js +19 -24
  126. package/dist/index262.js.map +1 -1
  127. package/dist/index263.js +29 -29
  128. package/dist/index263.js.map +1 -1
  129. package/dist/index264.js +17 -5
  130. package/dist/index264.js.map +1 -1
  131. package/dist/index268.js +5 -21
  132. package/dist/index268.js.map +1 -1
  133. package/dist/index269.js +3 -5
  134. package/dist/index269.js.map +1 -1
  135. package/dist/index270.js +24 -3
  136. package/dist/index270.js.map +1 -1
  137. package/dist/index271.js +111 -22
  138. package/dist/index271.js.map +1 -1
  139. package/dist/index272.js +14 -111
  140. package/dist/index272.js.map +1 -1
  141. package/dist/index273.js +528 -14
  142. package/dist/index273.js.map +1 -1
  143. package/dist/index274.js +111 -515
  144. package/dist/index274.js.map +1 -1
  145. package/dist/index275.js +117 -109
  146. package/dist/index275.js.map +1 -1
  147. package/dist/index276.js +20 -133
  148. package/dist/index276.js.map +1 -1
  149. package/dist/index28.js +2 -2
  150. package/dist/index29.js +3 -37
  151. package/dist/index29.js.map +1 -1
  152. package/dist/index294.js +69 -65
  153. package/dist/index294.js.map +1 -1
  154. package/dist/index295.js +8 -68
  155. package/dist/index295.js.map +1 -1
  156. package/dist/index296.js +14 -9
  157. package/dist/index296.js.map +1 -1
  158. package/dist/index297.js +66 -14
  159. package/dist/index297.js.map +1 -1
  160. package/dist/index298.js +64 -65
  161. package/dist/index298.js.map +1 -1
  162. package/dist/index3.js +92 -86
  163. package/dist/index3.js.map +1 -1
  164. package/dist/index30.js +125 -3
  165. package/dist/index30.js.map +1 -1
  166. package/dist/index31.js +227 -120
  167. package/dist/index31.js.map +1 -1
  168. package/dist/index32.js +21 -229
  169. package/dist/index32.js.map +1 -1
  170. package/dist/index33.js +50 -23
  171. package/dist/index33.js.map +1 -1
  172. package/dist/index34.js +21 -50
  173. package/dist/index34.js.map +1 -1
  174. package/dist/index35.js +126 -18
  175. package/dist/index35.js.map +1 -1
  176. package/dist/index36.js +205 -113
  177. package/dist/index36.js.map +1 -1
  178. package/dist/index37.js +74 -205
  179. package/dist/index37.js.map +1 -1
  180. package/dist/index38.js +115 -87
  181. package/dist/index38.js.map +1 -1
  182. package/dist/index39.js +5 -118
  183. package/dist/index39.js.map +1 -1
  184. package/dist/index4.js +2 -2
  185. package/dist/index40.js +819 -5
  186. package/dist/index40.js.map +1 -1
  187. package/dist/index41.js +56 -847
  188. package/dist/index41.js.map +1 -1
  189. package/dist/index42.js +37 -57
  190. package/dist/index42.js.map +1 -1
  191. package/dist/index45.js +1 -1
  192. package/dist/index46.js +1 -1
  193. package/dist/index49.js +1 -1
  194. package/dist/index5.js +2 -2
  195. package/dist/index50.js +1 -1
  196. package/dist/index52.js +1 -1
  197. package/dist/index56.js +2 -6
  198. package/dist/index56.js.map +1 -1
  199. package/dist/index57.js +2 -8
  200. package/dist/index57.js.map +1 -1
  201. package/dist/index58.js +3 -5
  202. package/dist/index58.js.map +1 -1
  203. package/dist/index59.js +47 -3
  204. package/dist/index59.js.map +1 -1
  205. package/dist/index6.js +5 -5
  206. package/dist/index60.js +48 -45
  207. package/dist/index60.js.map +1 -1
  208. package/dist/index61.js +7 -50
  209. package/dist/index61.js.map +1 -1
  210. package/dist/index62.js +14 -7
  211. package/dist/index62.js.map +1 -1
  212. package/dist/index63.js +133 -14
  213. package/dist/index63.js.map +1 -1
  214. package/dist/index64.js +10 -133
  215. package/dist/index64.js.map +1 -1
  216. package/dist/index65.js +216 -10
  217. package/dist/index65.js.map +1 -1
  218. package/dist/index66.js +12 -216
  219. package/dist/index66.js.map +1 -1
  220. package/dist/index67.js +47 -13
  221. package/dist/index67.js.map +1 -1
  222. package/dist/index68.js +47 -44
  223. package/dist/index68.js.map +1 -1
  224. package/dist/index69.js +4 -50
  225. package/dist/index69.js.map +1 -1
  226. package/dist/index7.js +2 -2
  227. package/dist/index70.js +6 -4
  228. package/dist/index70.js.map +1 -1
  229. package/dist/index71.js +28 -6
  230. package/dist/index71.js.map +1 -1
  231. package/dist/index72.js +50 -28
  232. package/dist/index72.js.map +1 -1
  233. package/dist/index73.js +9 -50
  234. package/dist/index73.js.map +1 -1
  235. package/dist/index74.js +2 -9
  236. package/dist/index74.js.map +1 -1
  237. package/dist/index75.js +2 -2
  238. package/dist/index76.js +6 -2
  239. package/dist/index76.js.map +1 -1
  240. package/dist/index77.js +8 -2
  241. package/dist/index77.js.map +1 -1
  242. package/dist/index78.js +6 -2
  243. package/dist/index78.js.map +1 -1
  244. package/dist/index8.js +3 -3
  245. package/dist/index9.js +1 -1
  246. package/package.json +3 -2
package/dist/index41.js CHANGED
@@ -1,851 +1,60 @@
1
- import * as t from "react";
2
- import * as Re from "react-dom";
3
- import { clamp as Te } from "./index59.js";
4
- import { composeEventHandlers as R } from "./index51.js";
5
- import { createCollection as tt } from "./index60.js";
6
- import { useComposedRefs as V } from "./index53.js";
7
- import { createContextScope as ot } from "./index61.js";
8
- import { useDirection as nt } from "./index62.js";
9
- import { DismissableLayer as rt } from "./index31.js";
10
- import { useFocusGuards as st } from "./index63.js";
11
- import { FocusScope as ct } from "./index64.js";
12
- import { useId as ye } from "./index65.js";
13
- import { Root as lt, createPopperScope as Ee, Anchor as it, Content as at, Arrow as dt } from "./index66.js";
14
- import { Portal as ut } from "./index67.js";
15
- import { Primitive as M } from "./index52.js";
16
- import { createSlot as pt } from "./index68.js";
17
- import { useCallbackRef as ft } from "./index54.js";
18
- import { useControllableState as Pe } from "./index69.js";
19
- import { useLayoutEffect as U } from "./index70.js";
20
- import { usePrevious as mt } from "./index71.js";
21
- import { VISUALLY_HIDDEN_STYLES as ht } from "./index72.js";
22
- import { hideOthers as vt } from "./index73.js";
23
- import gt from "./index74.js";
24
- import { j as d } from "./index30.js";
25
- var St = [" ", "Enter", "ArrowUp", "ArrowDown"], xt = [" ", "Enter"], J = "Select", [ie, ae, wt] = tt(J), [te] = ot(J, [
26
- wt,
27
- Ee
28
- ]), de = Ee(), [Ct, Y] = te(J), [yt, It] = te(J), be = (o) => {
29
- const {
30
- __scopeSelect: l,
31
- children: e,
32
- open: i,
33
- defaultOpen: s,
34
- onOpenChange: u,
35
- value: n,
36
- defaultValue: r,
37
- onValueChange: c,
38
- dir: f,
39
- name: g,
40
- autoComplete: w,
41
- disabled: E,
42
- required: T,
43
- form: y
44
- } = o, a = de(l), [h, S] = t.useState(null), [m, v] = t.useState(null), [W, A] = t.useState(!1), oe = nt(f), [b, j] = Pe({
45
- prop: i,
46
- defaultProp: s ?? !1,
47
- onChange: u,
48
- caller: J
49
- }), [K, X] = Pe({
50
- prop: n,
51
- defaultProp: r,
52
- onChange: c,
53
- caller: J
54
- }), B = t.useRef(null), H = h ? y || !!h.closest("form") : !0, [G, F] = t.useState(/* @__PURE__ */ new Set()), O = t.useRef(!1);
55
- U(() => () => {
56
- O.current = !0;
57
- }, []);
58
- const z = Array.from(G).map((_) => _.props.value).join(";");
59
- return /* @__PURE__ */ d.jsx(lt, { ...a, children: /* @__PURE__ */ d.jsxs(
60
- Ct,
61
- {
62
- required: T,
63
- scope: l,
64
- trigger: h,
65
- onTriggerChange: S,
66
- valueNode: m,
67
- onValueNodeChange: v,
68
- valueNodeHasChildren: W,
69
- onValueNodeHasChildrenChange: A,
70
- contentId: ye(),
71
- value: K,
72
- onValueChange: X,
73
- open: b,
74
- onOpenChange: j,
75
- dir: oe,
76
- triggerPointerDownPosRef: B,
77
- disabled: E,
78
- children: [
79
- /* @__PURE__ */ d.jsx(ie.Provider, { scope: l, children: /* @__PURE__ */ d.jsx(
80
- yt,
81
- {
82
- scope: o.__scopeSelect,
83
- onNativeOptionAdd: t.useCallback((_) => {
84
- O.current || F((k) => new Set(k).add(_));
85
- }, []),
86
- onNativeOptionRemove: t.useCallback((_) => {
87
- O.current || F((k) => {
88
- const D = new Set(k);
89
- return D.delete(_), D;
90
- });
91
- }, []),
92
- children: e
93
- }
94
- ) }),
95
- H ? /* @__PURE__ */ d.jsxs(
96
- $e,
97
- {
98
- "aria-hidden": !0,
99
- required: T,
100
- tabIndex: -1,
101
- name: g,
102
- autoComplete: w,
103
- value: K,
104
- onChange: (_) => X(_.target.value),
105
- disabled: E,
106
- form: y,
107
- children: [
108
- K === void 0 ? /* @__PURE__ */ d.jsx("option", { value: "" }) : null,
109
- Array.from(G)
110
- ]
111
- },
112
- z
113
- ) : null
114
- ]
115
- }
116
- ) });
1
+ import { j as r } from "./index28.js";
2
+ import { c as M } from "./index29.js";
3
+ import { clsx as R } from "./index26.js";
4
+ import { useState as S, useRef as j, useEffect as C } from "react";
5
+ import { Link as L } from "react-router";
6
+ const I = (y) => {
7
+ const e = M.c(18), {
8
+ href: p,
9
+ labelClassName: x,
10
+ labelActiveClassName: N,
11
+ labelElement: h,
12
+ isActive: _,
13
+ children: v
14
+ } = y, [i, a] = S(!1), o = j(null), g = j(null);
15
+ let n;
16
+ e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (n = () => {
17
+ o.current && clearTimeout(o.current), a(!0);
18
+ }, e[0] = n) : n = e[0];
19
+ const E = n;
20
+ let c;
21
+ e[1] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (c = () => {
22
+ o.current = setTimeout(() => {
23
+ a(!1);
24
+ }, 120);
25
+ }, e[1] = c) : c = e[1];
26
+ const w = c;
27
+ let m, f;
28
+ e[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (m = () => () => {
29
+ o.current && clearTimeout(o.current);
30
+ }, f = [], e[2] = m, e[3] = f) : (m = e[2], f = e[3]), C(m, f);
31
+ let u;
32
+ e[4] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (u = () => {
33
+ a(!1);
34
+ }, e[4] = u) : u = e[4];
35
+ const b = i || _ ? N : "border-transparent";
36
+ let t;
37
+ e[5] !== x || e[6] !== b ? (t = R("relative z-10 -mb-px flex items-center border-b-2 pt-px text-sm font-medium text-gray-700 cursor-pointer transition-colors duration-200 ease-out hover:text-gray-800", x, b), e[5] = x, e[6] = b, e[7] = t) : t = e[7];
38
+ let s;
39
+ e[8] !== p || e[9] !== h || e[10] !== t ? (s = /* @__PURE__ */ r.jsx("div", { className: "relative flex", children: /* @__PURE__ */ r.jsx(L, { to: p, onClick: u, className: t, children: h }) }), e[8] = p, e[9] = h, e[10] = t, e[11] = s) : s = e[11];
40
+ let l;
41
+ e[12] !== v || e[13] !== i ? (l = i && /* @__PURE__ */ r.jsxs("div", { className: "absolute left-0 right-0 top-full z-20 text-gray-500 sm:text-sm", style: {
42
+ width: "100vw",
43
+ left: "50%",
44
+ transform: "translateX(-50%)"
45
+ }, children: [
46
+ /* @__PURE__ */ r.jsx("div", { "aria-hidden": "true", className: "absolute inset-0 top-1/2 bg-white shadow-sm" }),
47
+ /* @__PURE__ */ r.jsx("div", { className: "relative bg-white", children: v({
48
+ setIsOpen: a
49
+ }) })
50
+ ] }), e[12] = v, e[13] = i, e[14] = l) : l = e[14];
51
+ let d;
52
+ return e[15] !== s || e[16] !== l ? (d = /* @__PURE__ */ r.jsxs("div", { className: "flex", ref: g, onMouseEnter: E, onMouseLeave: w, children: [
53
+ s,
54
+ l
55
+ ] }), e[15] = s, e[16] = l, e[17] = d) : d = e[17], d;
117
56
  };
118
- be.displayName = J;
119
- var _e = "SelectTrigger", Ne = t.forwardRef(
120
- (o, l) => {
121
- const { __scopeSelect: e, disabled: i = !1, ...s } = o, u = de(e), n = Y(_e, e), r = n.disabled || i, c = V(l, n.onTriggerChange), f = ae(e), g = t.useRef("touch"), [w, E, T] = Qe((a) => {
122
- const h = f().filter((v) => !v.disabled), S = h.find((v) => v.value === n.value), m = et(h, a, S);
123
- m !== void 0 && n.onValueChange(m.value);
124
- }), y = (a) => {
125
- r || (n.onOpenChange(!0), T()), a && (n.triggerPointerDownPosRef.current = {
126
- x: Math.round(a.pageX),
127
- y: Math.round(a.pageY)
128
- });
129
- };
130
- return /* @__PURE__ */ d.jsx(it, { asChild: !0, ...u, children: /* @__PURE__ */ d.jsx(
131
- M.button,
132
- {
133
- type: "button",
134
- role: "combobox",
135
- "aria-controls": n.contentId,
136
- "aria-expanded": n.open,
137
- "aria-required": n.required,
138
- "aria-autocomplete": "none",
139
- dir: n.dir,
140
- "data-state": n.open ? "open" : "closed",
141
- disabled: r,
142
- "data-disabled": r ? "" : void 0,
143
- "data-placeholder": Je(n.value) ? "" : void 0,
144
- ...s,
145
- ref: c,
146
- onClick: R(s.onClick, (a) => {
147
- a.currentTarget.focus(), g.current !== "mouse" && y(a);
148
- }),
149
- onPointerDown: R(s.onPointerDown, (a) => {
150
- g.current = a.pointerType;
151
- const h = a.target;
152
- h.hasPointerCapture(a.pointerId) && h.releasePointerCapture(a.pointerId), a.button === 0 && a.ctrlKey === !1 && a.pointerType === "mouse" && (y(a), a.preventDefault());
153
- }),
154
- onKeyDown: R(s.onKeyDown, (a) => {
155
- const h = w.current !== "";
156
- !(a.ctrlKey || a.altKey || a.metaKey) && a.key.length === 1 && E(a.key), !(h && a.key === " ") && St.includes(a.key) && (y(), a.preventDefault());
157
- })
158
- }
159
- ) });
160
- }
161
- );
162
- Ne.displayName = _e;
163
- var Me = "SelectValue", Ae = t.forwardRef(
164
- (o, l) => {
165
- const { __scopeSelect: e, className: i, style: s, children: u, placeholder: n = "", ...r } = o, c = Y(Me, e), { onValueNodeHasChildrenChange: f } = c, g = u !== void 0, w = V(l, c.onValueNodeChange);
166
- return U(() => {
167
- f(g);
168
- }, [f, g]), /* @__PURE__ */ d.jsx(
169
- M.span,
170
- {
171
- ...r,
172
- ref: w,
173
- style: { pointerEvents: "none" },
174
- children: Je(c.value) ? /* @__PURE__ */ d.jsx(d.Fragment, { children: n }) : u
175
- }
176
- );
177
- }
178
- );
179
- Ae.displayName = Me;
180
- var Tt = "SelectIcon", Oe = t.forwardRef(
181
- (o, l) => {
182
- const { __scopeSelect: e, children: i, ...s } = o;
183
- return /* @__PURE__ */ d.jsx(M.span, { "aria-hidden": !0, ...s, ref: l, children: i || "▼" });
184
- }
185
- );
186
- Oe.displayName = Tt;
187
- var Pt = "SelectPortal", De = (o) => /* @__PURE__ */ d.jsx(ut, { asChild: !0, ...o });
188
- De.displayName = Pt;
189
- var Q = "SelectContent", Le = t.forwardRef(
190
- (o, l) => {
191
- const e = Y(Q, o.__scopeSelect), [i, s] = t.useState();
192
- if (U(() => {
193
- s(new DocumentFragment());
194
- }, []), !e.open) {
195
- const u = i;
196
- return u ? Re.createPortal(
197
- /* @__PURE__ */ d.jsx(je, { scope: o.__scopeSelect, children: /* @__PURE__ */ d.jsx(ie.Slot, { scope: o.__scopeSelect, children: /* @__PURE__ */ d.jsx("div", { children: o.children }) }) }),
198
- u
199
- ) : null;
200
- }
201
- return /* @__PURE__ */ d.jsx(ke, { ...o, ref: l });
202
- }
203
- );
204
- Le.displayName = Q;
205
- var L = 10, [je, q] = te(Q), Rt = "SelectContentImpl", Et = pt("SelectContent.RemoveScroll"), ke = t.forwardRef(
206
- (o, l) => {
207
- const {
208
- __scopeSelect: e,
209
- position: i = "item-aligned",
210
- onCloseAutoFocus: s,
211
- onEscapeKeyDown: u,
212
- onPointerDownOutside: n,
213
- //
214
- // PopperContent props
215
- side: r,
216
- sideOffset: c,
217
- align: f,
218
- alignOffset: g,
219
- arrowPadding: w,
220
- collisionBoundary: E,
221
- collisionPadding: T,
222
- sticky: y,
223
- hideWhenDetached: a,
224
- avoidCollisions: h,
225
- //
226
- ...S
227
- } = o, m = Y(Q, e), [v, W] = t.useState(null), [A, oe] = t.useState(null), b = V(l, (p) => W(p)), [j, K] = t.useState(null), [X, B] = t.useState(
228
- null
229
- ), H = ae(e), [G, F] = t.useState(!1), O = t.useRef(!1);
230
- t.useEffect(() => {
231
- if (v) return vt(v);
232
- }, [v]), st();
233
- const z = t.useCallback(
234
- (p) => {
235
- const [I, ...N] = H().map((P) => P.ref.current), [x] = N.slice(-1), C = document.activeElement;
236
- for (const P of p)
237
- if (P === C || (P?.scrollIntoView({ block: "nearest" }), P === I && A && (A.scrollTop = 0), P === x && A && (A.scrollTop = A.scrollHeight), P?.focus(), document.activeElement !== C)) return;
238
- },
239
- [H, A]
240
- ), _ = t.useCallback(
241
- () => z([j, v]),
242
- [z, j, v]
243
- );
244
- t.useEffect(() => {
245
- G && _();
246
- }, [G, _]);
247
- const { onOpenChange: k, triggerPointerDownPosRef: D } = m;
248
- t.useEffect(() => {
249
- if (v) {
250
- let p = { x: 0, y: 0 };
251
- const I = (x) => {
252
- p = {
253
- x: Math.abs(Math.round(x.pageX) - (D.current?.x ?? 0)),
254
- y: Math.abs(Math.round(x.pageY) - (D.current?.y ?? 0))
255
- };
256
- }, N = (x) => {
257
- p.x <= 10 && p.y <= 10 ? x.preventDefault() : v.contains(x.target) || k(!1), document.removeEventListener("pointermove", I), D.current = null;
258
- };
259
- return D.current !== null && (document.addEventListener("pointermove", I), document.addEventListener("pointerup", N, { capture: !0, once: !0 })), () => {
260
- document.removeEventListener("pointermove", I), document.removeEventListener("pointerup", N, { capture: !0 });
261
- };
262
- }
263
- }, [v, k, D]), t.useEffect(() => {
264
- const p = () => k(!1);
265
- return window.addEventListener("blur", p), window.addEventListener("resize", p), () => {
266
- window.removeEventListener("blur", p), window.removeEventListener("resize", p);
267
- };
268
- }, [k]);
269
- const [ue, se] = Qe((p) => {
270
- const I = H().filter((C) => !C.disabled), N = I.find((C) => C.ref.current === document.activeElement), x = et(I, p, N);
271
- x && setTimeout(() => x.ref.current.focus());
272
- }), pe = t.useCallback(
273
- (p, I, N) => {
274
- const x = !O.current && !N;
275
- (m.value !== void 0 && m.value === I || x) && (K(p), x && (O.current = !0));
276
- },
277
- [m.value]
278
- ), fe = t.useCallback(() => v?.focus(), [v]), ee = t.useCallback(
279
- (p, I, N) => {
280
- const x = !O.current && !N;
281
- (m.value !== void 0 && m.value === I || x) && B(p);
282
- },
283
- [m.value]
284
- ), ce = i === "popper" ? ge : Ve, ne = ce === ge ? {
285
- side: r,
286
- sideOffset: c,
287
- align: f,
288
- alignOffset: g,
289
- arrowPadding: w,
290
- collisionBoundary: E,
291
- collisionPadding: T,
292
- sticky: y,
293
- hideWhenDetached: a,
294
- avoidCollisions: h
295
- } : {};
296
- return /* @__PURE__ */ d.jsx(
297
- je,
298
- {
299
- scope: e,
300
- content: v,
301
- viewport: A,
302
- onViewportChange: oe,
303
- itemRefCallback: pe,
304
- selectedItem: j,
305
- onItemLeave: fe,
306
- itemTextRefCallback: ee,
307
- focusSelectedItem: _,
308
- selectedItemText: X,
309
- position: i,
310
- isPositioned: G,
311
- searchRef: ue,
312
- children: /* @__PURE__ */ d.jsx(gt, { as: Et, allowPinchZoom: !0, children: /* @__PURE__ */ d.jsx(
313
- ct,
314
- {
315
- asChild: !0,
316
- trapped: m.open,
317
- onMountAutoFocus: (p) => {
318
- p.preventDefault();
319
- },
320
- onUnmountAutoFocus: R(s, (p) => {
321
- m.trigger?.focus({ preventScroll: !0 }), p.preventDefault();
322
- }),
323
- children: /* @__PURE__ */ d.jsx(
324
- rt,
325
- {
326
- asChild: !0,
327
- disableOutsidePointerEvents: !0,
328
- onEscapeKeyDown: u,
329
- onPointerDownOutside: n,
330
- onFocusOutside: (p) => p.preventDefault(),
331
- onDismiss: () => m.onOpenChange(!1),
332
- children: /* @__PURE__ */ d.jsx(
333
- ce,
334
- {
335
- role: "listbox",
336
- id: m.contentId,
337
- "data-state": m.open ? "open" : "closed",
338
- dir: m.dir,
339
- onContextMenu: (p) => p.preventDefault(),
340
- ...S,
341
- ...ne,
342
- onPlaced: () => F(!0),
343
- ref: b,
344
- style: {
345
- // flex layout so we can place the scroll buttons properly
346
- display: "flex",
347
- flexDirection: "column",
348
- // reset the outline by default as the content MAY get focused
349
- outline: "none",
350
- ...S.style
351
- },
352
- onKeyDown: R(S.onKeyDown, (p) => {
353
- const I = p.ctrlKey || p.altKey || p.metaKey;
354
- if (p.key === "Tab" && p.preventDefault(), !I && p.key.length === 1 && se(p.key), ["ArrowUp", "ArrowDown", "Home", "End"].includes(p.key)) {
355
- let x = H().filter((C) => !C.disabled).map((C) => C.ref.current);
356
- if (["ArrowUp", "End"].includes(p.key) && (x = x.slice().reverse()), ["ArrowUp", "ArrowDown"].includes(p.key)) {
357
- const C = p.target, P = x.indexOf(C);
358
- x = x.slice(P + 1);
359
- }
360
- setTimeout(() => z(x)), p.preventDefault();
361
- }
362
- })
363
- }
364
- )
365
- }
366
- )
367
- }
368
- ) })
369
- }
370
- );
371
- }
372
- );
373
- ke.displayName = Rt;
374
- var bt = "SelectItemAlignedPosition", Ve = t.forwardRef((o, l) => {
375
- const { __scopeSelect: e, onPlaced: i, ...s } = o, u = Y(Q, e), n = q(Q, e), [r, c] = t.useState(null), [f, g] = t.useState(null), w = V(l, (b) => g(b)), E = ae(e), T = t.useRef(!1), y = t.useRef(!0), { viewport: a, selectedItem: h, selectedItemText: S, focusSelectedItem: m } = n, v = t.useCallback(() => {
376
- if (u.trigger && u.valueNode && r && f && a && h && S) {
377
- const b = u.trigger.getBoundingClientRect(), j = f.getBoundingClientRect(), K = u.valueNode.getBoundingClientRect(), X = S.getBoundingClientRect();
378
- if (u.dir !== "rtl") {
379
- const C = X.left - j.left, P = K.left - C, Z = b.left - P, $ = b.width + Z, me = Math.max($, j.width), he = window.innerWidth - L, ve = Te(P, [
380
- L,
381
- // Prevents the content from going off the starting edge of the
382
- // viewport. It may still go off the ending edge, but this can be
383
- // controlled by the user since they may want to manage overflow in a
384
- // specific way.
385
- // https://github.com/radix-ui/primitives/issues/2049
386
- Math.max(L, he - me)
387
- ]);
388
- r.style.minWidth = $ + "px", r.style.left = ve + "px";
389
- } else {
390
- const C = j.right - X.right, P = window.innerWidth - K.right - C, Z = window.innerWidth - b.right - P, $ = b.width + Z, me = Math.max($, j.width), he = window.innerWidth - L, ve = Te(P, [
391
- L,
392
- Math.max(L, he - me)
393
- ]);
394
- r.style.minWidth = $ + "px", r.style.right = ve + "px";
395
- }
396
- const B = E(), H = window.innerHeight - L * 2, G = a.scrollHeight, F = window.getComputedStyle(f), O = parseInt(F.borderTopWidth, 10), z = parseInt(F.paddingTop, 10), _ = parseInt(F.borderBottomWidth, 10), k = parseInt(F.paddingBottom, 10), D = O + z + G + k + _, ue = Math.min(h.offsetHeight * 5, D), se = window.getComputedStyle(a), pe = parseInt(se.paddingTop, 10), fe = parseInt(se.paddingBottom, 10), ee = b.top + b.height / 2 - L, ce = H - ee, ne = h.offsetHeight / 2, p = h.offsetTop + ne, I = O + z + p, N = D - I;
397
- if (I <= ee) {
398
- const C = B.length > 0 && h === B[B.length - 1].ref.current;
399
- r.style.bottom = "0px";
400
- const P = f.clientHeight - a.offsetTop - a.offsetHeight, Z = Math.max(
401
- ce,
402
- ne + // viewport might have padding bottom, include it to avoid a scrollable viewport
403
- (C ? fe : 0) + P + _
404
- ), $ = I + Z;
405
- r.style.height = $ + "px";
406
- } else {
407
- const C = B.length > 0 && h === B[0].ref.current;
408
- r.style.top = "0px";
409
- const Z = Math.max(
410
- ee,
411
- O + a.offsetTop + // viewport might have padding top, include it to avoid a scrollable viewport
412
- (C ? pe : 0) + ne
413
- ) + N;
414
- r.style.height = Z + "px", a.scrollTop = I - ee + a.offsetTop;
415
- }
416
- r.style.margin = `${L}px 0`, r.style.minHeight = ue + "px", r.style.maxHeight = H + "px", i?.(), requestAnimationFrame(() => T.current = !0);
417
- }
418
- }, [
419
- E,
420
- u.trigger,
421
- u.valueNode,
422
- r,
423
- f,
424
- a,
425
- h,
426
- S,
427
- u.dir,
428
- i
429
- ]);
430
- U(() => v(), [v]);
431
- const [W, A] = t.useState();
432
- U(() => {
433
- f && A(window.getComputedStyle(f).zIndex);
434
- }, [f]);
435
- const oe = t.useCallback(
436
- (b) => {
437
- b && y.current === !0 && (v(), m?.(), y.current = !1);
438
- },
439
- [v, m]
440
- );
441
- return /* @__PURE__ */ d.jsx(
442
- Nt,
443
- {
444
- scope: e,
445
- contentWrapper: r,
446
- shouldExpandOnScrollRef: T,
447
- onScrollButtonChange: oe,
448
- children: /* @__PURE__ */ d.jsx(
449
- "div",
450
- {
451
- ref: c,
452
- style: {
453
- display: "flex",
454
- flexDirection: "column",
455
- position: "fixed",
456
- zIndex: W
457
- },
458
- children: /* @__PURE__ */ d.jsx(
459
- M.div,
460
- {
461
- ...s,
462
- ref: w,
463
- style: {
464
- // When we get the height of the content, it includes borders. If we were to set
465
- // the height without having `boxSizing: 'border-box'` it would be too big.
466
- boxSizing: "border-box",
467
- // We need to ensure the content doesn't get taller than the wrapper
468
- maxHeight: "100%",
469
- ...s.style
470
- }
471
- }
472
- )
473
- }
474
- )
475
- }
476
- );
477
- });
478
- Ve.displayName = bt;
479
- var _t = "SelectPopperPosition", ge = t.forwardRef((o, l) => {
480
- const {
481
- __scopeSelect: e,
482
- align: i = "start",
483
- collisionPadding: s = L,
484
- ...u
485
- } = o, n = de(e);
486
- return /* @__PURE__ */ d.jsx(
487
- at,
488
- {
489
- ...n,
490
- ...u,
491
- ref: l,
492
- align: i,
493
- collisionPadding: s,
494
- style: {
495
- // Ensure border-box for floating-ui calculations
496
- boxSizing: "border-box",
497
- ...u.style,
498
- "--radix-select-content-transform-origin": "var(--radix-popper-transform-origin)",
499
- "--radix-select-content-available-width": "var(--radix-popper-available-width)",
500
- "--radix-select-content-available-height": "var(--radix-popper-available-height)",
501
- "--radix-select-trigger-width": "var(--radix-popper-anchor-width)",
502
- "--radix-select-trigger-height": "var(--radix-popper-anchor-height)"
503
- }
504
- }
505
- );
506
- });
507
- ge.displayName = _t;
508
- var [Nt, Ie] = te(Q, {}), Se = "SelectViewport", Be = t.forwardRef(
509
- (o, l) => {
510
- const { __scopeSelect: e, nonce: i, ...s } = o, u = q(Se, e), n = Ie(Se, e), r = V(l, u.onViewportChange), c = t.useRef(0);
511
- return /* @__PURE__ */ d.jsxs(d.Fragment, { children: [
512
- /* @__PURE__ */ d.jsx(
513
- "style",
514
- {
515
- dangerouslySetInnerHTML: {
516
- __html: "[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"
517
- },
518
- nonce: i
519
- }
520
- ),
521
- /* @__PURE__ */ d.jsx(ie.Slot, { scope: e, children: /* @__PURE__ */ d.jsx(
522
- M.div,
523
- {
524
- "data-radix-select-viewport": "",
525
- role: "presentation",
526
- ...s,
527
- ref: r,
528
- style: {
529
- // we use position: 'relative' here on the `viewport` so that when we call
530
- // `selectedItem.offsetTop` in calculations, the offset is relative to the viewport
531
- // (independent of the scrollUpButton).
532
- position: "relative",
533
- flex: 1,
534
- // Viewport should only be scrollable in the vertical direction.
535
- // This won't work in vertical writing modes, so we'll need to
536
- // revisit this if/when that is supported
537
- // https://developer.chrome.com/blog/vertical-form-controls
538
- overflow: "hidden auto",
539
- ...s.style
540
- },
541
- onScroll: R(s.onScroll, (f) => {
542
- const g = f.currentTarget, { contentWrapper: w, shouldExpandOnScrollRef: E } = n;
543
- if (E?.current && w) {
544
- const T = Math.abs(c.current - g.scrollTop);
545
- if (T > 0) {
546
- const y = window.innerHeight - L * 2, a = parseFloat(w.style.minHeight), h = parseFloat(w.style.height), S = Math.max(a, h);
547
- if (S < y) {
548
- const m = S + T, v = Math.min(y, m), W = m - v;
549
- w.style.height = v + "px", w.style.bottom === "0px" && (g.scrollTop = W > 0 ? W : 0, w.style.justifyContent = "flex-end");
550
- }
551
- }
552
- }
553
- c.current = g.scrollTop;
554
- })
555
- }
556
- ) })
557
- ] });
558
- }
559
- );
560
- Be.displayName = Se;
561
- var He = "SelectGroup", [Mt, At] = te(He), Fe = t.forwardRef(
562
- (o, l) => {
563
- const { __scopeSelect: e, ...i } = o, s = ye();
564
- return /* @__PURE__ */ d.jsx(Mt, { scope: e, id: s, children: /* @__PURE__ */ d.jsx(M.div, { role: "group", "aria-labelledby": s, ...i, ref: l }) });
565
- }
566
- );
567
- Fe.displayName = He;
568
- var Ue = "SelectLabel", We = t.forwardRef(
569
- (o, l) => {
570
- const { __scopeSelect: e, ...i } = o, s = At(Ue, e);
571
- return /* @__PURE__ */ d.jsx(M.div, { id: s.id, ...i, ref: l });
572
- }
573
- );
574
- We.displayName = Ue;
575
- var le = "SelectItem", [Ot, Ke] = te(le), Ge = t.forwardRef(
576
- (o, l) => {
577
- const {
578
- __scopeSelect: e,
579
- value: i,
580
- disabled: s = !1,
581
- textValue: u,
582
- ...n
583
- } = o, r = Y(le, e), c = q(le, e), f = r.value === i, [g, w] = t.useState(u ?? ""), [E, T] = t.useState(!1), y = V(
584
- l,
585
- (m) => c.itemRefCallback?.(m, i, s)
586
- ), a = ye(), h = t.useRef("touch"), S = () => {
587
- s || (r.onValueChange(i), r.onOpenChange(!1));
588
- };
589
- if (i === "")
590
- throw new Error(
591
- "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."
592
- );
593
- return /* @__PURE__ */ d.jsx(
594
- Ot,
595
- {
596
- scope: e,
597
- value: i,
598
- disabled: s,
599
- textId: a,
600
- isSelected: f,
601
- onItemTextChange: t.useCallback((m) => {
602
- w((v) => v || (m?.textContent ?? "").trim());
603
- }, []),
604
- children: /* @__PURE__ */ d.jsx(
605
- ie.ItemSlot,
606
- {
607
- scope: e,
608
- value: i,
609
- disabled: s,
610
- textValue: g,
611
- children: /* @__PURE__ */ d.jsx(
612
- M.div,
613
- {
614
- role: "option",
615
- "aria-labelledby": a,
616
- "data-highlighted": E ? "" : void 0,
617
- "aria-selected": f && E,
618
- "data-state": f ? "checked" : "unchecked",
619
- "aria-disabled": s || void 0,
620
- "data-disabled": s ? "" : void 0,
621
- tabIndex: s ? void 0 : -1,
622
- ...n,
623
- ref: y,
624
- onFocus: R(n.onFocus, () => T(!0)),
625
- onBlur: R(n.onBlur, () => T(!1)),
626
- onClick: R(n.onClick, () => {
627
- h.current !== "mouse" && S();
628
- }),
629
- onPointerUp: R(n.onPointerUp, () => {
630
- h.current === "mouse" && S();
631
- }),
632
- onPointerDown: R(n.onPointerDown, (m) => {
633
- h.current = m.pointerType;
634
- }),
635
- onPointerMove: R(n.onPointerMove, (m) => {
636
- h.current = m.pointerType, s ? c.onItemLeave?.() : h.current === "mouse" && m.currentTarget.focus({ preventScroll: !0 });
637
- }),
638
- onPointerLeave: R(n.onPointerLeave, (m) => {
639
- m.currentTarget === document.activeElement && c.onItemLeave?.();
640
- }),
641
- onKeyDown: R(n.onKeyDown, (m) => {
642
- c.searchRef?.current !== "" && m.key === " " || (xt.includes(m.key) && S(), m.key === " " && m.preventDefault());
643
- })
644
- }
645
- )
646
- }
647
- )
648
- }
649
- );
650
- }
651
- );
652
- Ge.displayName = le;
653
- var re = "SelectItemText", ze = t.forwardRef(
654
- (o, l) => {
655
- const { __scopeSelect: e, className: i, style: s, ...u } = o, n = Y(re, e), r = q(re, e), c = Ke(re, e), f = It(re, e), [g, w] = t.useState(null), E = V(
656
- l,
657
- (S) => w(S),
658
- c.onItemTextChange,
659
- (S) => r.itemTextRefCallback?.(S, c.value, c.disabled)
660
- ), T = g?.textContent, y = t.useMemo(
661
- () => /* @__PURE__ */ d.jsx("option", { value: c.value, disabled: c.disabled, children: T }, c.value),
662
- [c.disabled, c.value, T]
663
- ), { onNativeOptionAdd: a, onNativeOptionRemove: h } = f;
664
- return U(() => (a(y), () => h(y)), [a, h, y]), /* @__PURE__ */ d.jsxs(d.Fragment, { children: [
665
- /* @__PURE__ */ d.jsx(M.span, { id: c.textId, ...u, ref: E }),
666
- c.isSelected && n.valueNode && !n.valueNodeHasChildren ? Re.createPortal(u.children, n.valueNode) : null
667
- ] });
668
- }
669
- );
670
- ze.displayName = re;
671
- var Ye = "SelectItemIndicator", qe = t.forwardRef(
672
- (o, l) => {
673
- const { __scopeSelect: e, ...i } = o;
674
- return Ke(Ye, e).isSelected ? /* @__PURE__ */ d.jsx(M.span, { "aria-hidden": !0, ...i, ref: l }) : null;
675
- }
676
- );
677
- qe.displayName = Ye;
678
- var xe = "SelectScrollUpButton", Dt = t.forwardRef((o, l) => {
679
- const e = q(xe, o.__scopeSelect), i = Ie(xe, o.__scopeSelect), [s, u] = t.useState(!1), n = V(l, i.onScrollButtonChange);
680
- return U(() => {
681
- if (e.viewport && e.isPositioned) {
682
- let r = function() {
683
- const f = c.scrollTop > 0;
684
- u(f);
685
- };
686
- const c = e.viewport;
687
- return r(), c.addEventListener("scroll", r), () => c.removeEventListener("scroll", r);
688
- }
689
- }, [e.viewport, e.isPositioned]), s ? /* @__PURE__ */ d.jsx(
690
- Xe,
691
- {
692
- ...o,
693
- ref: n,
694
- onAutoScroll: () => {
695
- const { viewport: r, selectedItem: c } = e;
696
- r && c && (r.scrollTop = r.scrollTop - c.offsetHeight);
697
- }
698
- }
699
- ) : null;
700
- });
701
- Dt.displayName = xe;
702
- var we = "SelectScrollDownButton", Lt = t.forwardRef((o, l) => {
703
- const e = q(we, o.__scopeSelect), i = Ie(we, o.__scopeSelect), [s, u] = t.useState(!1), n = V(l, i.onScrollButtonChange);
704
- return U(() => {
705
- if (e.viewport && e.isPositioned) {
706
- let r = function() {
707
- const f = c.scrollHeight - c.clientHeight, g = Math.ceil(c.scrollTop) < f;
708
- u(g);
709
- };
710
- const c = e.viewport;
711
- return r(), c.addEventListener("scroll", r), () => c.removeEventListener("scroll", r);
712
- }
713
- }, [e.viewport, e.isPositioned]), s ? /* @__PURE__ */ d.jsx(
714
- Xe,
715
- {
716
- ...o,
717
- ref: n,
718
- onAutoScroll: () => {
719
- const { viewport: r, selectedItem: c } = e;
720
- r && c && (r.scrollTop = r.scrollTop + c.offsetHeight);
721
- }
722
- }
723
- ) : null;
724
- });
725
- Lt.displayName = we;
726
- var Xe = t.forwardRef((o, l) => {
727
- const { __scopeSelect: e, onAutoScroll: i, ...s } = o, u = q("SelectScrollButton", e), n = t.useRef(null), r = ae(e), c = t.useCallback(() => {
728
- n.current !== null && (window.clearInterval(n.current), n.current = null);
729
- }, []);
730
- return t.useEffect(() => () => c(), [c]), U(() => {
731
- r().find((g) => g.ref.current === document.activeElement)?.ref.current?.scrollIntoView({ block: "nearest" });
732
- }, [r]), /* @__PURE__ */ d.jsx(
733
- M.div,
734
- {
735
- "aria-hidden": !0,
736
- ...s,
737
- ref: l,
738
- style: { flexShrink: 0, ...s.style },
739
- onPointerDown: R(s.onPointerDown, () => {
740
- n.current === null && (n.current = window.setInterval(i, 50));
741
- }),
742
- onPointerMove: R(s.onPointerMove, () => {
743
- u.onItemLeave?.(), n.current === null && (n.current = window.setInterval(i, 50));
744
- }),
745
- onPointerLeave: R(s.onPointerLeave, () => {
746
- c();
747
- })
748
- }
749
- );
750
- }), jt = "SelectSeparator", Ze = t.forwardRef(
751
- (o, l) => {
752
- const { __scopeSelect: e, ...i } = o;
753
- return /* @__PURE__ */ d.jsx(M.div, { "aria-hidden": !0, ...i, ref: l });
754
- }
755
- );
756
- Ze.displayName = jt;
757
- var Ce = "SelectArrow", kt = t.forwardRef(
758
- (o, l) => {
759
- const { __scopeSelect: e, ...i } = o, s = de(e), u = Y(Ce, e), n = q(Ce, e);
760
- return u.open && n.position === "popper" ? /* @__PURE__ */ d.jsx(dt, { ...s, ...i, ref: l }) : null;
761
- }
762
- );
763
- kt.displayName = Ce;
764
- var Vt = "SelectBubbleInput", $e = t.forwardRef(
765
- ({ __scopeSelect: o, value: l, ...e }, i) => {
766
- const s = t.useRef(null), u = V(i, s), n = mt(l);
767
- return t.useEffect(() => {
768
- const r = s.current;
769
- if (!r) return;
770
- const c = window.HTMLSelectElement.prototype, g = Object.getOwnPropertyDescriptor(
771
- c,
772
- "value"
773
- ).set;
774
- if (n !== l && g) {
775
- const w = new Event("change", { bubbles: !0 });
776
- g.call(r, l), r.dispatchEvent(w);
777
- }
778
- }, [n, l]), /* @__PURE__ */ d.jsx(
779
- M.select,
780
- {
781
- ...e,
782
- style: { ...ht, ...e.style },
783
- ref: u,
784
- defaultValue: l
785
- }
786
- );
787
- }
788
- );
789
- $e.displayName = Vt;
790
- function Je(o) {
791
- return o === "" || o === void 0;
792
- }
793
- function Qe(o) {
794
- const l = ft(o), e = t.useRef(""), i = t.useRef(0), s = t.useCallback(
795
- (n) => {
796
- const r = e.current + n;
797
- l(r), (function c(f) {
798
- e.current = f, window.clearTimeout(i.current), f !== "" && (i.current = window.setTimeout(() => c(""), 1e3));
799
- })(r);
800
- },
801
- [l]
802
- ), u = t.useCallback(() => {
803
- e.current = "", window.clearTimeout(i.current);
804
- }, []);
805
- return t.useEffect(() => () => window.clearTimeout(i.current), []), [e, s, u];
806
- }
807
- function et(o, l, e) {
808
- const s = l.length > 1 && Array.from(l).every((f) => f === l[0]) ? l[0] : l, u = e ? o.indexOf(e) : -1;
809
- let n = Bt(o, Math.max(u, 0));
810
- s.length === 1 && (n = n.filter((f) => f !== e));
811
- const c = n.find(
812
- (f) => f.textValue.toLowerCase().startsWith(s.toLowerCase())
813
- );
814
- return c !== e ? c : void 0;
815
- }
816
- function Bt(o, l) {
817
- return o.map((e, i) => o[(l + i) % o.length]);
818
- }
819
- var io = be, ao = Ne, uo = Ae, po = Oe, fo = De, mo = Le, ho = Be, vo = Fe, go = We, So = Ge, xo = ze, wo = qe, Co = Ze;
820
57
  export {
821
- mo as Content,
822
- vo as Group,
823
- po as Icon,
824
- So as Item,
825
- wo as ItemIndicator,
826
- xo as ItemText,
827
- go as Label,
828
- fo as Portal,
829
- io as Root,
830
- be as Select,
831
- kt as SelectArrow,
832
- Le as SelectContent,
833
- Fe as SelectGroup,
834
- Oe as SelectIcon,
835
- Ge as SelectItem,
836
- qe as SelectItemIndicator,
837
- ze as SelectItemText,
838
- We as SelectLabel,
839
- De as SelectPortal,
840
- Lt as SelectScrollDownButton,
841
- Dt as SelectScrollUpButton,
842
- Ze as SelectSeparator,
843
- Ne as SelectTrigger,
844
- Ae as SelectValue,
845
- Be as SelectViewport,
846
- Co as Separator,
847
- ao as Trigger,
848
- uo as Value,
849
- ho as Viewport
58
+ I as MenuPopover
850
59
  };
851
60
  //# sourceMappingURL=index41.js.map