@cfx-dev/ui-components 4.0.1 → 4.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Combination-BRUj3CHE.js → Combination-Cbiw1XRb.js} +1 -1
- package/dist/assets/css/DropdownSelect.css +1 -1
- package/dist/assets/css/Flex.css +1 -1
- package/dist/assets/css/Input.css +1 -1
- package/dist/assets/css/RichInput.css +1 -1
- package/dist/assets/css/Select.css +1 -1
- package/dist/assets/general/global.css +1 -1
- package/dist/components/Accordion/Accordion.js +18 -17
- package/dist/components/Accordion/AccordionShowcase.js +3 -2
- package/dist/components/Avatar/AvatarShowcase.js +3 -2
- package/dist/components/Badge/BadgeShowcase.js +5 -4
- package/dist/components/Button/ButtonShowcase.js +3 -2
- package/dist/components/Checkbox/Checkbox.js +6 -5
- package/dist/components/DropdownSelect/DropdownSelect.d.ts +4 -1
- package/dist/components/DropdownSelect/DropdownSelect.js +783 -755
- package/dist/components/DropdownSelect/DropdownSelectShowcase.js +11 -10
- package/dist/components/Flyout/Flyout.js +1 -1
- package/dist/components/Icon/Icon.d.ts +4 -3
- package/dist/components/Icon/Icon.js +27 -25
- package/dist/components/IconBig/IconBig.js +3 -2
- package/dist/components/InfoPanel/InfoPanelShowcase.js +11 -10
- package/dist/components/Input/Input.d.ts +2 -1
- package/dist/components/Input/Input.js +96 -75
- package/dist/components/Input/InputShowcase.js +6 -5
- package/dist/components/Input/RichInput.d.ts +2 -1
- package/dist/components/Input/RichInput.js +60 -43
- package/dist/components/Layout/Box/Box.d.ts +4 -11
- package/dist/components/Layout/Box/Box.js +58 -96
- package/dist/components/Layout/Flex/Flex.d.ts +7 -3
- package/dist/components/Layout/Flex/Flex.js +70 -62
- package/dist/components/Layout/Flex/Flex.types.d.ts +42 -0
- package/dist/components/Layout/Flex/Flex.types.js +7 -0
- package/dist/components/Layout/Scrollable/ScrollableShowcase.js +1 -0
- package/dist/components/Link/LinkShowcase.js +1 -0
- package/dist/components/Logos/LogosShowcase.js +3 -2
- package/dist/components/Modal/Modal.js +1 -0
- package/dist/components/Overlay/Overlay.js +1 -1
- package/dist/components/Select/Select.d.ts +2 -3
- package/dist/components/Select/Select.js +1922 -7
- package/dist/components/Select/SelectShowcase.js +4 -3
- package/dist/components/Select/index.d.ts +1 -1
- package/dist/components/Select/index.js +2 -3
- package/dist/components/Separator/Separator.d.ts +2 -2
- package/dist/components/Separator/Separator.js +35 -25
- package/dist/components/Skeleton/Skeleton.d.ts +7 -6
- package/dist/components/Skeleton/Skeleton.js +35 -22
- package/dist/components/Skeleton/SkeletonShowcase.js +14 -13
- package/dist/components/Slider/Slider.js +11 -9
- package/dist/components/Slider/SliderShowcase.js +10 -9
- package/dist/components/Spacer/Spacer.d.ts +1 -1
- package/dist/components/Switch/Switch.js +6 -5
- package/dist/components/Table/Table.js +3 -2
- package/dist/components/Table/TableShowcase.js +7 -6
- package/dist/components/Tabular/TabularShowcase.js +3 -2
- package/dist/components/Text/Text.d.ts +3 -1
- package/dist/components/Text/Text.js +61 -52
- package/dist/components/Text/Text.types.d.ts +4 -13
- package/dist/components/Text/Text.types.js +1 -4
- package/dist/components/Text/index.d.ts +3 -2
- package/dist/components/Text/index.js +9 -6
- package/dist/components/Title/TitleShowcase.js +4 -3
- package/dist/components/ui.d.ts +45 -12
- package/dist/components/ui.js +64 -55
- package/dist/index-BZPx6jYI.js +8 -0
- package/dist/index-ByaXH_ih.js +10 -0
- package/dist/index-Cf5Yu9oD.js +67 -0
- package/dist/index-DBus3GoO.js +1342 -0
- package/dist/index-rKs9bXHr.js +6 -0
- package/dist/main.d.ts +1 -1
- package/dist/main.js +14 -14
- package/dist/{medium-JVtzoF2c.js → medium-BA3EQDZW.js} +2 -2
- package/dist/styles-scss/_ui.scss +10 -1
- package/dist/styles-scss/global.scss +39 -25
- package/dist/styles-scss/themes/theme_cfx.scss +2 -0
- package/dist/styles-scss/themes/theme_fivem.scss +2 -0
- package/dist/styles-scss/themes/theme_redm.scss +2 -0
- package/dist/styles-scss/themes/theme_wireframe.scss +2 -0
- package/dist/styles-scss/themes.scss +4 -4
- package/dist/styles-scss/tokens.scss +28 -15
- package/package.json +1 -1
- package/dist/Select-Ds-fm4CN.js +0 -3245
- package/dist/index-BCnz73Lm.js +0 -72
- package/dist/index-BW3WdIgK.js +0 -14
- package/dist/types/Offset.d.ts +0 -1
- package/dist/types/Offset.js +0 -1
|
@@ -1,9 +1,1924 @@
|
|
|
1
|
-
import "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import "react";
|
|
4
|
-
import "
|
|
5
|
-
import "../../
|
|
1
|
+
import { jsx as v, Fragment as Xe, jsxs as ne } from "react/jsx-runtime";
|
|
2
|
+
import * as s from "react";
|
|
3
|
+
import D from "react";
|
|
4
|
+
import { R as Cn, r as mt } from "../../index-2hJuj4UN.js";
|
|
5
|
+
import { c as Je } from "../../index-rKs9bXHr.js";
|
|
6
|
+
import { S as ze, P as O, d as bn } from "../../index-BlbvKsmN.js";
|
|
7
|
+
import { u as xn } from "../../index-ByaXH_ih.js";
|
|
8
|
+
import { c as pe, a as _n, b as X, u as et } from "../../index-Cf5Yu9oD.js";
|
|
9
|
+
import { u as En, a as Pn, b as Rn, o as Tn, s as Nn, f as In, c as An, d as On, h as Mn, l as Ln, g as Dn, e as kn, i as Ge } from "../../index-DBus3GoO.js";
|
|
10
|
+
import { u as Bn } from "../../index-BZPx6jYI.js";
|
|
11
|
+
import { f as ht, _ as ce, c as Fn } from "../../tslib.es6-CBKHJX9H.js";
|
|
12
|
+
import { c as Wn, u as zn } from "../../medium-BA3EQDZW.js";
|
|
13
|
+
import { Icon as Vn } from "../Icon/Icon.js";
|
|
14
|
+
import { ui as Hn } from "../ui.js";
|
|
15
|
+
import { clsx as Me } from "../../utils/clsx.js";
|
|
16
|
+
var vt = function(e) {
|
|
17
|
+
var t = e.sideCar, n = ht(e, ["sideCar"]);
|
|
18
|
+
if (!t)
|
|
19
|
+
throw new Error("Sidecar: please provide `sideCar` property to import the right car");
|
|
20
|
+
var r = t.read();
|
|
21
|
+
if (!r)
|
|
22
|
+
throw new Error("Sidecar medium not found");
|
|
23
|
+
return s.createElement(r, ce({}, n));
|
|
24
|
+
};
|
|
25
|
+
vt.isSideCarExport = !0;
|
|
26
|
+
function $n(e, t) {
|
|
27
|
+
return e.useMedium(t), vt;
|
|
28
|
+
}
|
|
29
|
+
function B(e, t, { checkForDefaultPrevented: n = !0 } = {}) {
|
|
30
|
+
return function(a) {
|
|
31
|
+
if (e == null || e(a), n === !1 || !a.defaultPrevented)
|
|
32
|
+
return t == null ? void 0 : t(a);
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
function gt(e, t = []) {
|
|
36
|
+
let n = [];
|
|
37
|
+
function r(i, c) {
|
|
38
|
+
const o = s.createContext(c), u = n.length;
|
|
39
|
+
n = [...n, c];
|
|
40
|
+
function d(S) {
|
|
41
|
+
const { scope: w, children: y, ...f } = S, l = (w == null ? void 0 : w[e][u]) || o, h = s.useMemo(() => f, Object.values(f));
|
|
42
|
+
return /* @__PURE__ */ v(l.Provider, { value: h, children: y });
|
|
43
|
+
}
|
|
44
|
+
function g(S, w) {
|
|
45
|
+
const y = (w == null ? void 0 : w[e][u]) || o, f = s.useContext(y);
|
|
46
|
+
if (f) return f;
|
|
47
|
+
if (c !== void 0) return c;
|
|
48
|
+
throw new Error(`\`${S}\` must be used within \`${i}\``);
|
|
49
|
+
}
|
|
50
|
+
return d.displayName = i + "Provider", [d, g];
|
|
51
|
+
}
|
|
52
|
+
const a = () => {
|
|
53
|
+
const i = n.map((c) => s.createContext(c));
|
|
54
|
+
return function(o) {
|
|
55
|
+
const u = (o == null ? void 0 : o[e]) || i;
|
|
56
|
+
return s.useMemo(
|
|
57
|
+
() => ({ [`__scope${e}`]: { ...o, [e]: u } }),
|
|
58
|
+
[o, u]
|
|
59
|
+
);
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
return a.scopeName = e, [r, Un(a, ...t)];
|
|
63
|
+
}
|
|
64
|
+
function Un(...e) {
|
|
65
|
+
const t = e[0];
|
|
66
|
+
if (e.length === 1) return t;
|
|
67
|
+
const n = () => {
|
|
68
|
+
const r = e.map((a) => ({
|
|
69
|
+
useScope: a(),
|
|
70
|
+
scopeName: a.scopeName
|
|
71
|
+
}));
|
|
72
|
+
return function(i) {
|
|
73
|
+
const c = r.reduce((o, { useScope: u, scopeName: d }) => {
|
|
74
|
+
const S = u(i)[`__scope${d}`];
|
|
75
|
+
return { ...o, ...S };
|
|
76
|
+
}, {});
|
|
77
|
+
return s.useMemo(() => ({ [`__scope${t.scopeName}`]: c }), [c]);
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
return n.scopeName = t.scopeName, n;
|
|
81
|
+
}
|
|
82
|
+
function Kn(e, t) {
|
|
83
|
+
typeof e == "function" ? e(t) : e != null && (e.current = t);
|
|
84
|
+
}
|
|
85
|
+
function Yn(...e) {
|
|
86
|
+
return (t) => e.forEach((n) => Kn(n, t));
|
|
87
|
+
}
|
|
88
|
+
function K(...e) {
|
|
89
|
+
return s.useCallback(Yn(...e), e);
|
|
90
|
+
}
|
|
91
|
+
function jn(e) {
|
|
92
|
+
const t = e + "CollectionProvider", [n, r] = gt(t), [a, i] = n(
|
|
93
|
+
t,
|
|
94
|
+
{ collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }
|
|
95
|
+
), c = (y) => {
|
|
96
|
+
const { scope: f, children: l } = y, h = D.useRef(null), p = D.useRef(/* @__PURE__ */ new Map()).current;
|
|
97
|
+
return /* @__PURE__ */ v(a, { scope: f, itemMap: p, collectionRef: h, children: l });
|
|
98
|
+
};
|
|
99
|
+
c.displayName = t;
|
|
100
|
+
const o = e + "CollectionSlot", u = D.forwardRef(
|
|
101
|
+
(y, f) => {
|
|
102
|
+
const { scope: l, children: h } = y, p = i(o, l), m = K(f, p.collectionRef);
|
|
103
|
+
return /* @__PURE__ */ v(ze, { ref: m, children: h });
|
|
104
|
+
}
|
|
105
|
+
);
|
|
106
|
+
u.displayName = o;
|
|
107
|
+
const d = e + "CollectionItemSlot", g = "data-radix-collection-item", S = D.forwardRef(
|
|
108
|
+
(y, f) => {
|
|
109
|
+
const { scope: l, children: h, ...p } = y, m = D.useRef(null), C = K(f, m), x = i(d, l);
|
|
110
|
+
return D.useEffect(() => (x.itemMap.set(m, { ref: m, ...p }), () => void x.itemMap.delete(m))), /* @__PURE__ */ v(ze, { [g]: "", ref: C, children: h });
|
|
111
|
+
}
|
|
112
|
+
);
|
|
113
|
+
S.displayName = d;
|
|
114
|
+
function w(y) {
|
|
115
|
+
const f = i(e + "CollectionConsumer", y);
|
|
116
|
+
return D.useCallback(() => {
|
|
117
|
+
const h = f.collectionRef.current;
|
|
118
|
+
if (!h) return [];
|
|
119
|
+
const p = Array.from(h.querySelectorAll(`[${g}]`));
|
|
120
|
+
return Array.from(f.itemMap.values()).sort(
|
|
121
|
+
(x, E) => p.indexOf(x.ref.current) - p.indexOf(E.ref.current)
|
|
122
|
+
);
|
|
123
|
+
}, [f.collectionRef, f.itemMap]);
|
|
124
|
+
}
|
|
125
|
+
return [
|
|
126
|
+
{ Provider: c, Slot: u, ItemSlot: S },
|
|
127
|
+
w,
|
|
128
|
+
r
|
|
129
|
+
];
|
|
130
|
+
}
|
|
131
|
+
function Le(e, t, { checkForDefaultPrevented: n = !0 } = {}) {
|
|
132
|
+
return function(a) {
|
|
133
|
+
if (e == null || e(a), n === !1 || !a.defaultPrevented)
|
|
134
|
+
return t == null ? void 0 : t(a);
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
function Xn(e, t) {
|
|
138
|
+
typeof e == "function" ? e(t) : e != null && (e.current = t);
|
|
139
|
+
}
|
|
140
|
+
function Gn(...e) {
|
|
141
|
+
return (t) => e.forEach((n) => Xn(n, t));
|
|
142
|
+
}
|
|
143
|
+
function St(...e) {
|
|
144
|
+
return s.useCallback(Gn(...e), e);
|
|
145
|
+
}
|
|
146
|
+
var Zn = "DismissableLayer", Ve = "dismissableLayer.update", qn = "dismissableLayer.pointerDownOutside", Qn = "dismissableLayer.focusOutside", tt, wt = s.createContext({
|
|
147
|
+
layers: /* @__PURE__ */ new Set(),
|
|
148
|
+
layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
|
|
149
|
+
branches: /* @__PURE__ */ new Set()
|
|
150
|
+
}), yt = s.forwardRef(
|
|
151
|
+
(e, t) => {
|
|
152
|
+
const {
|
|
153
|
+
disableOutsidePointerEvents: n = !1,
|
|
154
|
+
onEscapeKeyDown: r,
|
|
155
|
+
onPointerDownOutside: a,
|
|
156
|
+
onFocusOutside: i,
|
|
157
|
+
onInteractOutside: c,
|
|
158
|
+
onDismiss: o,
|
|
159
|
+
...u
|
|
160
|
+
} = e, d = s.useContext(wt), [g, S] = s.useState(null), w = (g == null ? void 0 : g.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document), [, y] = s.useState({}), f = St(t, (_) => S(_)), l = Array.from(d.layers), [h] = [...d.layersWithOutsidePointerEventsDisabled].slice(-1), p = l.indexOf(h), m = g ? l.indexOf(g) : -1, C = d.layersWithOutsidePointerEventsDisabled.size > 0, x = m >= p, E = tr((_) => {
|
|
161
|
+
const N = _.target, k = [...d.branches].some((H) => H.contains(N));
|
|
162
|
+
!x || k || (a == null || a(_), c == null || c(_), _.defaultPrevented || o == null || o());
|
|
163
|
+
}, w), A = nr((_) => {
|
|
164
|
+
const N = _.target;
|
|
165
|
+
[...d.branches].some((H) => H.contains(N)) || (i == null || i(_), c == null || c(_), _.defaultPrevented || o == null || o());
|
|
166
|
+
}, w);
|
|
167
|
+
return En((_) => {
|
|
168
|
+
m === d.layers.size - 1 && (r == null || r(_), !_.defaultPrevented && o && (_.preventDefault(), o()));
|
|
169
|
+
}, w), s.useEffect(() => {
|
|
170
|
+
if (g)
|
|
171
|
+
return n && (d.layersWithOutsidePointerEventsDisabled.size === 0 && (tt = w.body.style.pointerEvents, w.body.style.pointerEvents = "none"), d.layersWithOutsidePointerEventsDisabled.add(g)), d.layers.add(g), nt(), () => {
|
|
172
|
+
n && d.layersWithOutsidePointerEventsDisabled.size === 1 && (w.body.style.pointerEvents = tt);
|
|
173
|
+
};
|
|
174
|
+
}, [g, w, n, d]), s.useEffect(() => () => {
|
|
175
|
+
g && (d.layers.delete(g), d.layersWithOutsidePointerEventsDisabled.delete(g), nt());
|
|
176
|
+
}, [g, d]), s.useEffect(() => {
|
|
177
|
+
const _ = () => y({});
|
|
178
|
+
return document.addEventListener(Ve, _), () => document.removeEventListener(Ve, _);
|
|
179
|
+
}, []), /* @__PURE__ */ v(
|
|
180
|
+
O.div,
|
|
181
|
+
{
|
|
182
|
+
...u,
|
|
183
|
+
ref: f,
|
|
184
|
+
style: {
|
|
185
|
+
pointerEvents: C ? x ? "auto" : "none" : void 0,
|
|
186
|
+
...e.style
|
|
187
|
+
},
|
|
188
|
+
onFocusCapture: Le(e.onFocusCapture, A.onFocusCapture),
|
|
189
|
+
onBlurCapture: Le(e.onBlurCapture, A.onBlurCapture),
|
|
190
|
+
onPointerDownCapture: Le(
|
|
191
|
+
e.onPointerDownCapture,
|
|
192
|
+
E.onPointerDownCapture
|
|
193
|
+
)
|
|
194
|
+
}
|
|
195
|
+
);
|
|
196
|
+
}
|
|
197
|
+
);
|
|
198
|
+
yt.displayName = Zn;
|
|
199
|
+
var Jn = "DismissableLayerBranch", er = s.forwardRef((e, t) => {
|
|
200
|
+
const n = s.useContext(wt), r = s.useRef(null), a = St(t, r);
|
|
201
|
+
return s.useEffect(() => {
|
|
202
|
+
const i = r.current;
|
|
203
|
+
if (i)
|
|
204
|
+
return n.branches.add(i), () => {
|
|
205
|
+
n.branches.delete(i);
|
|
206
|
+
};
|
|
207
|
+
}, [n.branches]), /* @__PURE__ */ v(O.div, { ...e, ref: a });
|
|
208
|
+
});
|
|
209
|
+
er.displayName = Jn;
|
|
210
|
+
function tr(e, t = globalThis == null ? void 0 : globalThis.document) {
|
|
211
|
+
const n = pe(e), r = s.useRef(!1), a = s.useRef(() => {
|
|
212
|
+
});
|
|
213
|
+
return s.useEffect(() => {
|
|
214
|
+
const i = (o) => {
|
|
215
|
+
if (o.target && !r.current) {
|
|
216
|
+
let u = function() {
|
|
217
|
+
Ct(
|
|
218
|
+
qn,
|
|
219
|
+
n,
|
|
220
|
+
d,
|
|
221
|
+
{ discrete: !0 }
|
|
222
|
+
);
|
|
223
|
+
};
|
|
224
|
+
const d = { originalEvent: o };
|
|
225
|
+
o.pointerType === "touch" ? (t.removeEventListener("click", a.current), a.current = u, t.addEventListener("click", a.current, { once: !0 })) : u();
|
|
226
|
+
} else
|
|
227
|
+
t.removeEventListener("click", a.current);
|
|
228
|
+
r.current = !1;
|
|
229
|
+
}, c = window.setTimeout(() => {
|
|
230
|
+
t.addEventListener("pointerdown", i);
|
|
231
|
+
}, 0);
|
|
232
|
+
return () => {
|
|
233
|
+
window.clearTimeout(c), t.removeEventListener("pointerdown", i), t.removeEventListener("click", a.current);
|
|
234
|
+
};
|
|
235
|
+
}, [t, n]), {
|
|
236
|
+
// ensures we check React component tree (not just DOM tree)
|
|
237
|
+
onPointerDownCapture: () => r.current = !0
|
|
238
|
+
};
|
|
239
|
+
}
|
|
240
|
+
function nr(e, t = globalThis == null ? void 0 : globalThis.document) {
|
|
241
|
+
const n = pe(e), r = s.useRef(!1);
|
|
242
|
+
return s.useEffect(() => {
|
|
243
|
+
const a = (i) => {
|
|
244
|
+
i.target && !r.current && Ct(Qn, n, { originalEvent: i }, {
|
|
245
|
+
discrete: !1
|
|
246
|
+
});
|
|
247
|
+
};
|
|
248
|
+
return t.addEventListener("focusin", a), () => t.removeEventListener("focusin", a);
|
|
249
|
+
}, [t, n]), {
|
|
250
|
+
onFocusCapture: () => r.current = !0,
|
|
251
|
+
onBlurCapture: () => r.current = !1
|
|
252
|
+
};
|
|
253
|
+
}
|
|
254
|
+
function nt() {
|
|
255
|
+
const e = new CustomEvent(Ve);
|
|
256
|
+
document.dispatchEvent(e);
|
|
257
|
+
}
|
|
258
|
+
function Ct(e, t, n, { discrete: r }) {
|
|
259
|
+
const a = n.originalEvent.target, i = new CustomEvent(e, { bubbles: !1, cancelable: !0, detail: n });
|
|
260
|
+
t && a.addEventListener(e, t, { once: !0 }), r ? bn(a, i) : a.dispatchEvent(i);
|
|
261
|
+
}
|
|
262
|
+
var De = 0;
|
|
263
|
+
function rr() {
|
|
264
|
+
s.useEffect(() => {
|
|
265
|
+
const e = document.querySelectorAll("[data-radix-focus-guard]");
|
|
266
|
+
return document.body.insertAdjacentElement("afterbegin", e[0] ?? rt()), document.body.insertAdjacentElement("beforeend", e[1] ?? rt()), De++, () => {
|
|
267
|
+
De === 1 && document.querySelectorAll("[data-radix-focus-guard]").forEach((t) => t.remove()), De--;
|
|
268
|
+
};
|
|
269
|
+
}, []);
|
|
270
|
+
}
|
|
271
|
+
function rt() {
|
|
272
|
+
const e = document.createElement("span");
|
|
273
|
+
return e.setAttribute("data-radix-focus-guard", ""), e.tabIndex = 0, e.style.cssText = "outline: none; opacity: 0; position: fixed; pointer-events: none", e;
|
|
274
|
+
}
|
|
275
|
+
function or(e, t) {
|
|
276
|
+
typeof e == "function" ? e(t) : e != null && (e.current = t);
|
|
277
|
+
}
|
|
278
|
+
function ar(...e) {
|
|
279
|
+
return (t) => e.forEach((n) => or(n, t));
|
|
280
|
+
}
|
|
281
|
+
function sr(...e) {
|
|
282
|
+
return s.useCallback(ar(...e), e);
|
|
283
|
+
}
|
|
284
|
+
var ke = "focusScope.autoFocusOnMount", Be = "focusScope.autoFocusOnUnmount", ot = { bubbles: !1, cancelable: !0 }, cr = "FocusScope", bt = s.forwardRef((e, t) => {
|
|
285
|
+
const {
|
|
286
|
+
loop: n = !1,
|
|
287
|
+
trapped: r = !1,
|
|
288
|
+
onMountAutoFocus: a,
|
|
289
|
+
onUnmountAutoFocus: i,
|
|
290
|
+
...c
|
|
291
|
+
} = e, [o, u] = s.useState(null), d = pe(a), g = pe(i), S = s.useRef(null), w = sr(t, (l) => u(l)), y = s.useRef({
|
|
292
|
+
paused: !1,
|
|
293
|
+
pause() {
|
|
294
|
+
this.paused = !0;
|
|
295
|
+
},
|
|
296
|
+
resume() {
|
|
297
|
+
this.paused = !1;
|
|
298
|
+
}
|
|
299
|
+
}).current;
|
|
300
|
+
s.useEffect(() => {
|
|
301
|
+
if (r) {
|
|
302
|
+
let l = function(C) {
|
|
303
|
+
if (y.paused || !o) return;
|
|
304
|
+
const x = C.target;
|
|
305
|
+
o.contains(x) ? S.current = x : te(S.current, { select: !0 });
|
|
306
|
+
}, h = function(C) {
|
|
307
|
+
if (y.paused || !o) return;
|
|
308
|
+
const x = C.relatedTarget;
|
|
309
|
+
x !== null && (o.contains(x) || te(S.current, { select: !0 }));
|
|
310
|
+
}, p = function(C) {
|
|
311
|
+
if (document.activeElement === document.body)
|
|
312
|
+
for (const E of C)
|
|
313
|
+
E.removedNodes.length > 0 && te(o);
|
|
314
|
+
};
|
|
315
|
+
document.addEventListener("focusin", l), document.addEventListener("focusout", h);
|
|
316
|
+
const m = new MutationObserver(p);
|
|
317
|
+
return o && m.observe(o, { childList: !0, subtree: !0 }), () => {
|
|
318
|
+
document.removeEventListener("focusin", l), document.removeEventListener("focusout", h), m.disconnect();
|
|
319
|
+
};
|
|
320
|
+
}
|
|
321
|
+
}, [r, o, y.paused]), s.useEffect(() => {
|
|
322
|
+
if (o) {
|
|
323
|
+
st.add(y);
|
|
324
|
+
const l = document.activeElement;
|
|
325
|
+
if (!o.contains(l)) {
|
|
326
|
+
const p = new CustomEvent(ke, ot);
|
|
327
|
+
o.addEventListener(ke, d), o.dispatchEvent(p), p.defaultPrevented || (ir(pr(xt(o)), { select: !0 }), document.activeElement === l && te(o));
|
|
328
|
+
}
|
|
329
|
+
return () => {
|
|
330
|
+
o.removeEventListener(ke, d), setTimeout(() => {
|
|
331
|
+
const p = new CustomEvent(Be, ot);
|
|
332
|
+
o.addEventListener(Be, g), o.dispatchEvent(p), p.defaultPrevented || te(l ?? document.body, { select: !0 }), o.removeEventListener(Be, g), st.remove(y);
|
|
333
|
+
}, 0);
|
|
334
|
+
};
|
|
335
|
+
}
|
|
336
|
+
}, [o, d, g, y]);
|
|
337
|
+
const f = s.useCallback(
|
|
338
|
+
(l) => {
|
|
339
|
+
if (!n && !r || y.paused) return;
|
|
340
|
+
const h = l.key === "Tab" && !l.altKey && !l.ctrlKey && !l.metaKey, p = document.activeElement;
|
|
341
|
+
if (h && p) {
|
|
342
|
+
const m = l.currentTarget, [C, x] = lr(m);
|
|
343
|
+
C && x ? !l.shiftKey && p === x ? (l.preventDefault(), n && te(C, { select: !0 })) : l.shiftKey && p === C && (l.preventDefault(), n && te(x, { select: !0 })) : p === m && l.preventDefault();
|
|
344
|
+
}
|
|
345
|
+
},
|
|
346
|
+
[n, r, y.paused]
|
|
347
|
+
);
|
|
348
|
+
return /* @__PURE__ */ v(O.div, { tabIndex: -1, ...c, ref: w, onKeyDown: f });
|
|
349
|
+
});
|
|
350
|
+
bt.displayName = cr;
|
|
351
|
+
function ir(e, { select: t = !1 } = {}) {
|
|
352
|
+
const n = document.activeElement;
|
|
353
|
+
for (const r of e)
|
|
354
|
+
if (te(r, { select: t }), document.activeElement !== n) return;
|
|
355
|
+
}
|
|
356
|
+
function lr(e) {
|
|
357
|
+
const t = xt(e), n = at(t, e), r = at(t.reverse(), e);
|
|
358
|
+
return [n, r];
|
|
359
|
+
}
|
|
360
|
+
function xt(e) {
|
|
361
|
+
const t = [], n = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, {
|
|
362
|
+
acceptNode: (r) => {
|
|
363
|
+
const a = r.tagName === "INPUT" && r.type === "hidden";
|
|
364
|
+
return r.disabled || r.hidden || a ? NodeFilter.FILTER_SKIP : r.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
|
|
365
|
+
}
|
|
366
|
+
});
|
|
367
|
+
for (; n.nextNode(); ) t.push(n.currentNode);
|
|
368
|
+
return t;
|
|
369
|
+
}
|
|
370
|
+
function at(e, t) {
|
|
371
|
+
for (const n of e)
|
|
372
|
+
if (!ur(n, { upTo: t })) return n;
|
|
373
|
+
}
|
|
374
|
+
function ur(e, { upTo: t }) {
|
|
375
|
+
if (getComputedStyle(e).visibility === "hidden") return !0;
|
|
376
|
+
for (; e; ) {
|
|
377
|
+
if (t !== void 0 && e === t) return !1;
|
|
378
|
+
if (getComputedStyle(e).display === "none") return !0;
|
|
379
|
+
e = e.parentElement;
|
|
380
|
+
}
|
|
381
|
+
return !1;
|
|
382
|
+
}
|
|
383
|
+
function dr(e) {
|
|
384
|
+
return e instanceof HTMLInputElement && "select" in e;
|
|
385
|
+
}
|
|
386
|
+
function te(e, { select: t = !1 } = {}) {
|
|
387
|
+
if (e && e.focus) {
|
|
388
|
+
const n = document.activeElement;
|
|
389
|
+
e.focus({ preventScroll: !0 }), e !== n && dr(e) && t && e.select();
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
var st = fr();
|
|
393
|
+
function fr() {
|
|
394
|
+
let e = [];
|
|
395
|
+
return {
|
|
396
|
+
add(t) {
|
|
397
|
+
const n = e[0];
|
|
398
|
+
t !== n && (n == null || n.pause()), e = ct(e, t), e.unshift(t);
|
|
399
|
+
},
|
|
400
|
+
remove(t) {
|
|
401
|
+
var n;
|
|
402
|
+
e = ct(e, t), (n = e[0]) == null || n.resume();
|
|
403
|
+
}
|
|
404
|
+
};
|
|
405
|
+
}
|
|
406
|
+
function ct(e, t) {
|
|
407
|
+
const n = [...e], r = n.indexOf(t);
|
|
408
|
+
return r !== -1 && n.splice(r, 1), n;
|
|
409
|
+
}
|
|
410
|
+
function pr(e) {
|
|
411
|
+
return e.filter((t) => t.tagName !== "A");
|
|
412
|
+
}
|
|
413
|
+
var mr = "Arrow", _t = s.forwardRef((e, t) => {
|
|
414
|
+
const { children: n, width: r = 10, height: a = 5, ...i } = e;
|
|
415
|
+
return /* @__PURE__ */ v(
|
|
416
|
+
O.svg,
|
|
417
|
+
{
|
|
418
|
+
...i,
|
|
419
|
+
ref: t,
|
|
420
|
+
width: r,
|
|
421
|
+
height: a,
|
|
422
|
+
viewBox: "0 0 30 10",
|
|
423
|
+
preserveAspectRatio: "none",
|
|
424
|
+
children: e.asChild ? n : /* @__PURE__ */ v("polygon", { points: "0,0 30,0 15,10" })
|
|
425
|
+
}
|
|
426
|
+
);
|
|
427
|
+
});
|
|
428
|
+
_t.displayName = mr;
|
|
429
|
+
var hr = _t;
|
|
430
|
+
function vr(e, t) {
|
|
431
|
+
typeof e == "function" ? e(t) : e != null && (e.current = t);
|
|
432
|
+
}
|
|
433
|
+
function gr(...e) {
|
|
434
|
+
return (t) => e.forEach((n) => vr(n, t));
|
|
435
|
+
}
|
|
436
|
+
function Et(...e) {
|
|
437
|
+
return s.useCallback(gr(...e), e);
|
|
438
|
+
}
|
|
439
|
+
function Sr(e, t = []) {
|
|
440
|
+
let n = [];
|
|
441
|
+
function r(i, c) {
|
|
442
|
+
const o = s.createContext(c), u = n.length;
|
|
443
|
+
n = [...n, c];
|
|
444
|
+
function d(S) {
|
|
445
|
+
const { scope: w, children: y, ...f } = S, l = (w == null ? void 0 : w[e][u]) || o, h = s.useMemo(() => f, Object.values(f));
|
|
446
|
+
return /* @__PURE__ */ v(l.Provider, { value: h, children: y });
|
|
447
|
+
}
|
|
448
|
+
function g(S, w) {
|
|
449
|
+
const y = (w == null ? void 0 : w[e][u]) || o, f = s.useContext(y);
|
|
450
|
+
if (f) return f;
|
|
451
|
+
if (c !== void 0) return c;
|
|
452
|
+
throw new Error(`\`${S}\` must be used within \`${i}\``);
|
|
453
|
+
}
|
|
454
|
+
return d.displayName = i + "Provider", [d, g];
|
|
455
|
+
}
|
|
456
|
+
const a = () => {
|
|
457
|
+
const i = n.map((c) => s.createContext(c));
|
|
458
|
+
return function(o) {
|
|
459
|
+
const u = (o == null ? void 0 : o[e]) || i;
|
|
460
|
+
return s.useMemo(
|
|
461
|
+
() => ({ [`__scope${e}`]: { ...o, [e]: u } }),
|
|
462
|
+
[o, u]
|
|
463
|
+
);
|
|
464
|
+
};
|
|
465
|
+
};
|
|
466
|
+
return a.scopeName = e, [r, wr(a, ...t)];
|
|
467
|
+
}
|
|
468
|
+
function wr(...e) {
|
|
469
|
+
const t = e[0];
|
|
470
|
+
if (e.length === 1) return t;
|
|
471
|
+
const n = () => {
|
|
472
|
+
const r = e.map((a) => ({
|
|
473
|
+
useScope: a(),
|
|
474
|
+
scopeName: a.scopeName
|
|
475
|
+
}));
|
|
476
|
+
return function(i) {
|
|
477
|
+
const c = r.reduce((o, { useScope: u, scopeName: d }) => {
|
|
478
|
+
const S = u(i)[`__scope${d}`];
|
|
479
|
+
return { ...o, ...S };
|
|
480
|
+
}, {});
|
|
481
|
+
return s.useMemo(() => ({ [`__scope${t.scopeName}`]: c }), [c]);
|
|
482
|
+
};
|
|
483
|
+
};
|
|
484
|
+
return n.scopeName = t.scopeName, n;
|
|
485
|
+
}
|
|
486
|
+
var Ze = "Popper", [Pt, Rt] = Sr(Ze), [yr, Tt] = Pt(Ze), Nt = (e) => {
|
|
487
|
+
const { __scopePopper: t, children: n } = e, [r, a] = s.useState(null);
|
|
488
|
+
return /* @__PURE__ */ v(yr, { scope: t, anchor: r, onAnchorChange: a, children: n });
|
|
489
|
+
};
|
|
490
|
+
Nt.displayName = Ze;
|
|
491
|
+
var It = "PopperAnchor", At = s.forwardRef(
|
|
492
|
+
(e, t) => {
|
|
493
|
+
const { __scopePopper: n, virtualRef: r, ...a } = e, i = Tt(It, n), c = s.useRef(null), o = Et(t, c);
|
|
494
|
+
return s.useEffect(() => {
|
|
495
|
+
i.onAnchorChange((r == null ? void 0 : r.current) || c.current);
|
|
496
|
+
}), r ? null : /* @__PURE__ */ v(O.div, { ...a, ref: o });
|
|
497
|
+
}
|
|
498
|
+
);
|
|
499
|
+
At.displayName = It;
|
|
500
|
+
var qe = "PopperContent", [Cr, br] = Pt(qe), Ot = s.forwardRef(
|
|
501
|
+
(e, t) => {
|
|
502
|
+
var b, I, L, T, P, R;
|
|
503
|
+
const {
|
|
504
|
+
__scopePopper: n,
|
|
505
|
+
side: r = "bottom",
|
|
506
|
+
sideOffset: a = 0,
|
|
507
|
+
align: i = "center",
|
|
508
|
+
alignOffset: c = 0,
|
|
509
|
+
arrowPadding: o = 0,
|
|
510
|
+
avoidCollisions: u = !0,
|
|
511
|
+
collisionBoundary: d = [],
|
|
512
|
+
collisionPadding: g = 0,
|
|
513
|
+
sticky: S = "partial",
|
|
514
|
+
hideWhenDetached: w = !1,
|
|
515
|
+
updatePositionStrategy: y = "optimized",
|
|
516
|
+
onPlaced: f,
|
|
517
|
+
...l
|
|
518
|
+
} = e, h = Tt(qe, n), [p, m] = s.useState(null), C = Et(t, (V) => m(V)), [x, E] = s.useState(null), A = _n(x), _ = (A == null ? void 0 : A.width) ?? 0, N = (A == null ? void 0 : A.height) ?? 0, k = r + (i !== "center" ? "-" + i : ""), H = typeof g == "number" ? g : { top: 0, right: 0, bottom: 0, left: 0, ...g }, G = Array.isArray(d) ? d : [d], $ = G.length > 0, W = {
|
|
519
|
+
padding: H,
|
|
520
|
+
boundary: G.filter(_r),
|
|
521
|
+
// with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
|
|
522
|
+
altBoundary: $
|
|
523
|
+
}, { refs: Z, floatingStyles: M, placement: U, isPositioned: F, middlewareData: z } = Pn({
|
|
524
|
+
// default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
|
|
525
|
+
strategy: "fixed",
|
|
526
|
+
placement: k,
|
|
527
|
+
whileElementsMounted: (...V) => Rn(...V, {
|
|
528
|
+
animationFrame: y === "always"
|
|
529
|
+
}),
|
|
530
|
+
elements: {
|
|
531
|
+
reference: h.anchor
|
|
532
|
+
},
|
|
533
|
+
middleware: [
|
|
534
|
+
Tn({ mainAxis: a + N, alignmentAxis: c }),
|
|
535
|
+
u && Nn({
|
|
536
|
+
mainAxis: !0,
|
|
537
|
+
crossAxis: !1,
|
|
538
|
+
limiter: S === "partial" ? Ln() : void 0,
|
|
539
|
+
...W
|
|
540
|
+
}),
|
|
541
|
+
u && In({ ...W }),
|
|
542
|
+
An({
|
|
543
|
+
...W,
|
|
544
|
+
apply: ({ elements: V, rects: q, availableWidth: Se, availableHeight: we }) => {
|
|
545
|
+
const { width: ye, height: yn } = q.reference, xe = V.floating.style;
|
|
546
|
+
xe.setProperty("--radix-popper-available-width", `${Se}px`), xe.setProperty("--radix-popper-available-height", `${we}px`), xe.setProperty("--radix-popper-anchor-width", `${ye}px`), xe.setProperty("--radix-popper-anchor-height", `${yn}px`);
|
|
547
|
+
}
|
|
548
|
+
}),
|
|
549
|
+
x && On({ element: x, padding: o }),
|
|
550
|
+
Er({ arrowWidth: _, arrowHeight: N }),
|
|
551
|
+
w && Mn({ strategy: "referenceHidden", ...W })
|
|
552
|
+
]
|
|
553
|
+
}), [Y, he] = Dt(U), Q = pe(f);
|
|
554
|
+
X(() => {
|
|
555
|
+
F && (Q == null || Q());
|
|
556
|
+
}, [F, Q]);
|
|
557
|
+
const ve = (b = z.arrow) == null ? void 0 : b.x, ge = (I = z.arrow) == null ? void 0 : I.y, ee = ((L = z.arrow) == null ? void 0 : L.centerOffset) !== 0, [le, se] = s.useState();
|
|
558
|
+
return X(() => {
|
|
559
|
+
p && se(window.getComputedStyle(p).zIndex);
|
|
560
|
+
}, [p]), /* @__PURE__ */ v(
|
|
561
|
+
"div",
|
|
562
|
+
{
|
|
563
|
+
ref: Z.setFloating,
|
|
564
|
+
"data-radix-popper-content-wrapper": "",
|
|
565
|
+
style: {
|
|
566
|
+
...M,
|
|
567
|
+
transform: F ? M.transform : "translate(0, -200%)",
|
|
568
|
+
// keep off the page when measuring
|
|
569
|
+
minWidth: "max-content",
|
|
570
|
+
zIndex: le,
|
|
571
|
+
"--radix-popper-transform-origin": [
|
|
572
|
+
(T = z.transformOrigin) == null ? void 0 : T.x,
|
|
573
|
+
(P = z.transformOrigin) == null ? void 0 : P.y
|
|
574
|
+
].join(" "),
|
|
575
|
+
// hide the content if using the hide middleware and should be hidden
|
|
576
|
+
// set visibility to hidden and disable pointer events so the UI behaves
|
|
577
|
+
// as if the PopperContent isn't there at all
|
|
578
|
+
...((R = z.hide) == null ? void 0 : R.referenceHidden) && {
|
|
579
|
+
visibility: "hidden",
|
|
580
|
+
pointerEvents: "none"
|
|
581
|
+
}
|
|
582
|
+
},
|
|
583
|
+
dir: e.dir,
|
|
584
|
+
children: /* @__PURE__ */ v(
|
|
585
|
+
Cr,
|
|
586
|
+
{
|
|
587
|
+
scope: n,
|
|
588
|
+
placedSide: Y,
|
|
589
|
+
onArrowChange: E,
|
|
590
|
+
arrowX: ve,
|
|
591
|
+
arrowY: ge,
|
|
592
|
+
shouldHideArrow: ee,
|
|
593
|
+
children: /* @__PURE__ */ v(
|
|
594
|
+
O.div,
|
|
595
|
+
{
|
|
596
|
+
"data-side": Y,
|
|
597
|
+
"data-align": he,
|
|
598
|
+
...l,
|
|
599
|
+
ref: C,
|
|
600
|
+
style: {
|
|
601
|
+
...l.style,
|
|
602
|
+
// if the PopperContent hasn't been placed yet (not all measurements done)
|
|
603
|
+
// we prevent animations so that users's animation don't kick in too early referring wrong sides
|
|
604
|
+
animation: F ? void 0 : "none"
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
)
|
|
608
|
+
}
|
|
609
|
+
)
|
|
610
|
+
}
|
|
611
|
+
);
|
|
612
|
+
}
|
|
613
|
+
);
|
|
614
|
+
Ot.displayName = qe;
|
|
615
|
+
var Mt = "PopperArrow", xr = {
|
|
616
|
+
top: "bottom",
|
|
617
|
+
right: "left",
|
|
618
|
+
bottom: "top",
|
|
619
|
+
left: "right"
|
|
620
|
+
}, Lt = s.forwardRef(function(t, n) {
|
|
621
|
+
const { __scopePopper: r, ...a } = t, i = br(Mt, r), c = xr[i.placedSide];
|
|
622
|
+
return (
|
|
623
|
+
// we have to use an extra wrapper because `ResizeObserver` (used by `useSize`)
|
|
624
|
+
// doesn't report size as we'd expect on SVG elements.
|
|
625
|
+
// it reports their bounding box which is effectively the largest path inside the SVG.
|
|
626
|
+
/* @__PURE__ */ v(
|
|
627
|
+
"span",
|
|
628
|
+
{
|
|
629
|
+
ref: i.onArrowChange,
|
|
630
|
+
style: {
|
|
631
|
+
position: "absolute",
|
|
632
|
+
left: i.arrowX,
|
|
633
|
+
top: i.arrowY,
|
|
634
|
+
[c]: 0,
|
|
635
|
+
transformOrigin: {
|
|
636
|
+
top: "",
|
|
637
|
+
right: "0 0",
|
|
638
|
+
bottom: "center 0",
|
|
639
|
+
left: "100% 0"
|
|
640
|
+
}[i.placedSide],
|
|
641
|
+
transform: {
|
|
642
|
+
top: "translateY(100%)",
|
|
643
|
+
right: "translateY(50%) rotate(90deg) translateX(-50%)",
|
|
644
|
+
bottom: "rotate(180deg)",
|
|
645
|
+
left: "translateY(50%) rotate(-90deg) translateX(50%)"
|
|
646
|
+
}[i.placedSide],
|
|
647
|
+
visibility: i.shouldHideArrow ? "hidden" : void 0
|
|
648
|
+
},
|
|
649
|
+
children: /* @__PURE__ */ v(
|
|
650
|
+
hr,
|
|
651
|
+
{
|
|
652
|
+
...a,
|
|
653
|
+
ref: n,
|
|
654
|
+
style: {
|
|
655
|
+
...a.style,
|
|
656
|
+
// ensures the element can be measured correctly (mostly for if SVG)
|
|
657
|
+
display: "block"
|
|
658
|
+
}
|
|
659
|
+
}
|
|
660
|
+
)
|
|
661
|
+
}
|
|
662
|
+
)
|
|
663
|
+
);
|
|
664
|
+
});
|
|
665
|
+
Lt.displayName = Mt;
|
|
666
|
+
function _r(e) {
|
|
667
|
+
return e !== null;
|
|
668
|
+
}
|
|
669
|
+
var Er = (e) => ({
|
|
670
|
+
name: "transformOrigin",
|
|
671
|
+
options: e,
|
|
672
|
+
fn(t) {
|
|
673
|
+
var h, p, m;
|
|
674
|
+
const { placement: n, rects: r, middlewareData: a } = t, c = ((h = a.arrow) == null ? void 0 : h.centerOffset) !== 0, o = c ? 0 : e.arrowWidth, u = c ? 0 : e.arrowHeight, [d, g] = Dt(n), S = { start: "0%", center: "50%", end: "100%" }[g], w = (((p = a.arrow) == null ? void 0 : p.x) ?? 0) + o / 2, y = (((m = a.arrow) == null ? void 0 : m.y) ?? 0) + u / 2;
|
|
675
|
+
let f = "", l = "";
|
|
676
|
+
return d === "bottom" ? (f = c ? S : `${w}px`, l = `${-u}px`) : d === "top" ? (f = c ? S : `${w}px`, l = `${r.floating.height + u}px`) : d === "right" ? (f = `${-u}px`, l = c ? S : `${y}px`) : d === "left" && (f = `${r.floating.width + u}px`, l = c ? S : `${y}px`), { data: { x: f, y: l } };
|
|
677
|
+
}
|
|
678
|
+
});
|
|
679
|
+
function Dt(e) {
|
|
680
|
+
const [t, n = "center"] = e.split("-");
|
|
681
|
+
return [t, n];
|
|
682
|
+
}
|
|
683
|
+
var Pr = Nt, Rr = At, Tr = Ot, Nr = Lt, Ir = "Portal", kt = s.forwardRef((e, t) => {
|
|
684
|
+
var o;
|
|
685
|
+
const { container: n, ...r } = e, [a, i] = s.useState(!1);
|
|
686
|
+
X(() => i(!0), []);
|
|
687
|
+
const c = n || a && ((o = globalThis == null ? void 0 : globalThis.document) == null ? void 0 : o.body);
|
|
688
|
+
return c ? Cn.createPortal(/* @__PURE__ */ v(O.div, { ...r, ref: t }), c) : null;
|
|
689
|
+
});
|
|
690
|
+
kt.displayName = Ir;
|
|
691
|
+
var Ar = "VisuallyHidden", Bt = s.forwardRef(
|
|
692
|
+
(e, t) => /* @__PURE__ */ v(
|
|
693
|
+
O.span,
|
|
694
|
+
{
|
|
695
|
+
...e,
|
|
696
|
+
ref: t,
|
|
697
|
+
style: {
|
|
698
|
+
// See: https://github.com/twbs/bootstrap/blob/master/scss/mixins/_screen-reader.scss
|
|
699
|
+
position: "absolute",
|
|
700
|
+
border: 0,
|
|
701
|
+
width: 1,
|
|
702
|
+
height: 1,
|
|
703
|
+
padding: 0,
|
|
704
|
+
margin: -1,
|
|
705
|
+
overflow: "hidden",
|
|
706
|
+
clip: "rect(0, 0, 0, 0)",
|
|
707
|
+
whiteSpace: "nowrap",
|
|
708
|
+
wordWrap: "normal",
|
|
709
|
+
...e.style
|
|
710
|
+
}
|
|
711
|
+
}
|
|
712
|
+
)
|
|
713
|
+
);
|
|
714
|
+
Bt.displayName = Ar;
|
|
715
|
+
var Pe = "right-scroll-bar-position", Re = "width-before-scroll-bar", Or = "with-scroll-bars-hidden", Mr = "--removed-body-scroll-bar-size", Ft = Wn(), Fe = function() {
|
|
716
|
+
}, Ne = s.forwardRef(function(e, t) {
|
|
717
|
+
var n = s.useRef(null), r = s.useState({
|
|
718
|
+
onScrollCapture: Fe,
|
|
719
|
+
onWheelCapture: Fe,
|
|
720
|
+
onTouchMoveCapture: Fe
|
|
721
|
+
}), a = r[0], i = r[1], c = e.forwardProps, o = e.children, u = e.className, d = e.removeScrollBar, g = e.enabled, S = e.shards, w = e.sideCar, y = e.noIsolation, f = e.inert, l = e.allowPinchZoom, h = e.as, p = h === void 0 ? "div" : h, m = e.gapMode, C = ht(e, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]), x = w, E = zn([n, t]), A = ce(ce({}, C), a);
|
|
722
|
+
return s.createElement(
|
|
723
|
+
s.Fragment,
|
|
724
|
+
null,
|
|
725
|
+
g && s.createElement(x, { sideCar: Ft, removeScrollBar: d, shards: S, noIsolation: y, inert: f, setCallbacks: i, allowPinchZoom: !!l, lockRef: n, gapMode: m }),
|
|
726
|
+
c ? s.cloneElement(s.Children.only(o), ce(ce({}, A), { ref: E })) : s.createElement(p, ce({}, A, { className: u, ref: E }), o)
|
|
727
|
+
);
|
|
728
|
+
});
|
|
729
|
+
Ne.defaultProps = {
|
|
730
|
+
enabled: !0,
|
|
731
|
+
removeScrollBar: !0,
|
|
732
|
+
inert: !1
|
|
733
|
+
};
|
|
734
|
+
Ne.classNames = {
|
|
735
|
+
fullWidth: Re,
|
|
736
|
+
zeroRight: Pe
|
|
737
|
+
};
|
|
738
|
+
function Lr() {
|
|
739
|
+
if (!document)
|
|
740
|
+
return null;
|
|
741
|
+
var e = document.createElement("style");
|
|
742
|
+
e.type = "text/css";
|
|
743
|
+
var t = Dn();
|
|
744
|
+
return t && e.setAttribute("nonce", t), e;
|
|
745
|
+
}
|
|
746
|
+
function Dr(e, t) {
|
|
747
|
+
e.styleSheet ? e.styleSheet.cssText = t : e.appendChild(document.createTextNode(t));
|
|
748
|
+
}
|
|
749
|
+
function kr(e) {
|
|
750
|
+
var t = document.head || document.getElementsByTagName("head")[0];
|
|
751
|
+
t.appendChild(e);
|
|
752
|
+
}
|
|
753
|
+
var Br = function() {
|
|
754
|
+
var e = 0, t = null;
|
|
755
|
+
return {
|
|
756
|
+
add: function(n) {
|
|
757
|
+
e == 0 && (t = Lr()) && (Dr(t, n), kr(t)), e++;
|
|
758
|
+
},
|
|
759
|
+
remove: function() {
|
|
760
|
+
e--, !e && t && (t.parentNode && t.parentNode.removeChild(t), t = null);
|
|
761
|
+
}
|
|
762
|
+
};
|
|
763
|
+
}, Fr = function() {
|
|
764
|
+
var e = Br();
|
|
765
|
+
return function(t, n) {
|
|
766
|
+
s.useEffect(function() {
|
|
767
|
+
return e.add(t), function() {
|
|
768
|
+
e.remove();
|
|
769
|
+
};
|
|
770
|
+
}, [t && n]);
|
|
771
|
+
};
|
|
772
|
+
}, Wt = function() {
|
|
773
|
+
var e = Fr(), t = function(n) {
|
|
774
|
+
var r = n.styles, a = n.dynamic;
|
|
775
|
+
return e(r, a), null;
|
|
776
|
+
};
|
|
777
|
+
return t;
|
|
778
|
+
}, Wr = {
|
|
779
|
+
left: 0,
|
|
780
|
+
top: 0,
|
|
781
|
+
right: 0,
|
|
782
|
+
gap: 0
|
|
783
|
+
}, We = function(e) {
|
|
784
|
+
return parseInt(e || "", 10) || 0;
|
|
785
|
+
}, zr = function(e) {
|
|
786
|
+
var t = window.getComputedStyle(document.body), n = t[e === "padding" ? "paddingLeft" : "marginLeft"], r = t[e === "padding" ? "paddingTop" : "marginTop"], a = t[e === "padding" ? "paddingRight" : "marginRight"];
|
|
787
|
+
return [We(n), We(r), We(a)];
|
|
788
|
+
}, Vr = function(e) {
|
|
789
|
+
if (e === void 0 && (e = "margin"), typeof window > "u")
|
|
790
|
+
return Wr;
|
|
791
|
+
var t = zr(e), n = document.documentElement.clientWidth, r = window.innerWidth;
|
|
792
|
+
return {
|
|
793
|
+
left: t[0],
|
|
794
|
+
top: t[1],
|
|
795
|
+
right: t[2],
|
|
796
|
+
gap: Math.max(0, r - n + t[2] - t[0])
|
|
797
|
+
};
|
|
798
|
+
}, Hr = Wt(), fe = "data-scroll-locked", $r = function(e, t, n, r) {
|
|
799
|
+
var a = e.left, i = e.top, c = e.right, o = e.gap;
|
|
800
|
+
return n === void 0 && (n = "margin"), `
|
|
801
|
+
.`.concat(Or, ` {
|
|
802
|
+
overflow: hidden `).concat(r, `;
|
|
803
|
+
padding-right: `).concat(o, "px ").concat(r, `;
|
|
804
|
+
}
|
|
805
|
+
body[`).concat(fe, `] {
|
|
806
|
+
overflow: hidden `).concat(r, `;
|
|
807
|
+
overscroll-behavior: contain;
|
|
808
|
+
`).concat([
|
|
809
|
+
t && "position: relative ".concat(r, ";"),
|
|
810
|
+
n === "margin" && `
|
|
811
|
+
padding-left: `.concat(a, `px;
|
|
812
|
+
padding-top: `).concat(i, `px;
|
|
813
|
+
padding-right: `).concat(c, `px;
|
|
814
|
+
margin-left:0;
|
|
815
|
+
margin-top:0;
|
|
816
|
+
margin-right: `).concat(o, "px ").concat(r, `;
|
|
817
|
+
`),
|
|
818
|
+
n === "padding" && "padding-right: ".concat(o, "px ").concat(r, ";")
|
|
819
|
+
].filter(Boolean).join(""), `
|
|
820
|
+
}
|
|
821
|
+
|
|
822
|
+
.`).concat(Pe, ` {
|
|
823
|
+
right: `).concat(o, "px ").concat(r, `;
|
|
824
|
+
}
|
|
825
|
+
|
|
826
|
+
.`).concat(Re, ` {
|
|
827
|
+
margin-right: `).concat(o, "px ").concat(r, `;
|
|
828
|
+
}
|
|
829
|
+
|
|
830
|
+
.`).concat(Pe, " .").concat(Pe, ` {
|
|
831
|
+
right: 0 `).concat(r, `;
|
|
832
|
+
}
|
|
833
|
+
|
|
834
|
+
.`).concat(Re, " .").concat(Re, ` {
|
|
835
|
+
margin-right: 0 `).concat(r, `;
|
|
836
|
+
}
|
|
837
|
+
|
|
838
|
+
body[`).concat(fe, `] {
|
|
839
|
+
`).concat(Mr, ": ").concat(o, `px;
|
|
840
|
+
}
|
|
841
|
+
`);
|
|
842
|
+
}, it = function() {
|
|
843
|
+
var e = parseInt(document.body.getAttribute(fe) || "0", 10);
|
|
844
|
+
return isFinite(e) ? e : 0;
|
|
845
|
+
}, Ur = function() {
|
|
846
|
+
s.useEffect(function() {
|
|
847
|
+
return document.body.setAttribute(fe, (it() + 1).toString()), function() {
|
|
848
|
+
var e = it() - 1;
|
|
849
|
+
e <= 0 ? document.body.removeAttribute(fe) : document.body.setAttribute(fe, e.toString());
|
|
850
|
+
};
|
|
851
|
+
}, []);
|
|
852
|
+
}, Kr = function(e) {
|
|
853
|
+
var t = e.noRelative, n = e.noImportant, r = e.gapMode, a = r === void 0 ? "margin" : r;
|
|
854
|
+
Ur();
|
|
855
|
+
var i = s.useMemo(function() {
|
|
856
|
+
return Vr(a);
|
|
857
|
+
}, [a]);
|
|
858
|
+
return s.createElement(Hr, { styles: $r(i, !t, a, n ? "" : "!important") });
|
|
859
|
+
}, He = !1;
|
|
860
|
+
if (typeof window < "u")
|
|
861
|
+
try {
|
|
862
|
+
var _e = Object.defineProperty({}, "passive", {
|
|
863
|
+
get: function() {
|
|
864
|
+
return He = !0, !0;
|
|
865
|
+
}
|
|
866
|
+
});
|
|
867
|
+
window.addEventListener("test", _e, _e), window.removeEventListener("test", _e, _e);
|
|
868
|
+
} catch {
|
|
869
|
+
He = !1;
|
|
870
|
+
}
|
|
871
|
+
var ue = He ? { passive: !1 } : !1, Yr = function(e) {
|
|
872
|
+
return e.tagName === "TEXTAREA";
|
|
873
|
+
}, zt = function(e, t) {
|
|
874
|
+
var n = window.getComputedStyle(e);
|
|
875
|
+
return (
|
|
876
|
+
// not-not-scrollable
|
|
877
|
+
n[t] !== "hidden" && // contains scroll inside self
|
|
878
|
+
!(n.overflowY === n.overflowX && !Yr(e) && n[t] === "visible")
|
|
879
|
+
);
|
|
880
|
+
}, jr = function(e) {
|
|
881
|
+
return zt(e, "overflowY");
|
|
882
|
+
}, Xr = function(e) {
|
|
883
|
+
return zt(e, "overflowX");
|
|
884
|
+
}, lt = function(e, t) {
|
|
885
|
+
var n = t.ownerDocument, r = t;
|
|
886
|
+
do {
|
|
887
|
+
typeof ShadowRoot < "u" && r instanceof ShadowRoot && (r = r.host);
|
|
888
|
+
var a = Vt(e, r);
|
|
889
|
+
if (a) {
|
|
890
|
+
var i = Ht(e, r), c = i[1], o = i[2];
|
|
891
|
+
if (c > o)
|
|
892
|
+
return !0;
|
|
893
|
+
}
|
|
894
|
+
r = r.parentNode;
|
|
895
|
+
} while (r && r !== n.body);
|
|
896
|
+
return !1;
|
|
897
|
+
}, Gr = function(e) {
|
|
898
|
+
var t = e.scrollTop, n = e.scrollHeight, r = e.clientHeight;
|
|
899
|
+
return [
|
|
900
|
+
t,
|
|
901
|
+
n,
|
|
902
|
+
r
|
|
903
|
+
];
|
|
904
|
+
}, Zr = function(e) {
|
|
905
|
+
var t = e.scrollLeft, n = e.scrollWidth, r = e.clientWidth;
|
|
906
|
+
return [
|
|
907
|
+
t,
|
|
908
|
+
n,
|
|
909
|
+
r
|
|
910
|
+
];
|
|
911
|
+
}, Vt = function(e, t) {
|
|
912
|
+
return e === "v" ? jr(t) : Xr(t);
|
|
913
|
+
}, Ht = function(e, t) {
|
|
914
|
+
return e === "v" ? Gr(t) : Zr(t);
|
|
915
|
+
}, qr = function(e, t) {
|
|
916
|
+
return e === "h" && t === "rtl" ? -1 : 1;
|
|
917
|
+
}, Qr = function(e, t, n, r, a) {
|
|
918
|
+
var i = qr(e, window.getComputedStyle(t).direction), c = i * r, o = n.target, u = t.contains(o), d = !1, g = c > 0, S = 0, w = 0;
|
|
919
|
+
do {
|
|
920
|
+
var y = Ht(e, o), f = y[0], l = y[1], h = y[2], p = l - h - i * f;
|
|
921
|
+
(f || p) && Vt(e, o) && (S += p, w += f), o instanceof ShadowRoot ? o = o.host : o = o.parentNode;
|
|
922
|
+
} while (
|
|
923
|
+
// portaled content
|
|
924
|
+
!u && o !== document.body || // self content
|
|
925
|
+
u && (t.contains(o) || t === o)
|
|
926
|
+
);
|
|
927
|
+
return (g && (Math.abs(S) < 1 || !a) || !g && (Math.abs(w) < 1 || !a)) && (d = !0), d;
|
|
928
|
+
}, Ee = function(e) {
|
|
929
|
+
return "changedTouches" in e ? [e.changedTouches[0].clientX, e.changedTouches[0].clientY] : [0, 0];
|
|
930
|
+
}, ut = function(e) {
|
|
931
|
+
return [e.deltaX, e.deltaY];
|
|
932
|
+
}, dt = function(e) {
|
|
933
|
+
return e && "current" in e ? e.current : e;
|
|
934
|
+
}, Jr = function(e, t) {
|
|
935
|
+
return e[0] === t[0] && e[1] === t[1];
|
|
936
|
+
}, eo = function(e) {
|
|
937
|
+
return `
|
|
938
|
+
.block-interactivity-`.concat(e, ` {pointer-events: none;}
|
|
939
|
+
.allow-interactivity-`).concat(e, ` {pointer-events: all;}
|
|
940
|
+
`);
|
|
941
|
+
}, to = 0, de = [];
|
|
942
|
+
function no(e) {
|
|
943
|
+
var t = s.useRef([]), n = s.useRef([0, 0]), r = s.useRef(), a = s.useState(to++)[0], i = s.useState(Wt)[0], c = s.useRef(e);
|
|
944
|
+
s.useEffect(function() {
|
|
945
|
+
c.current = e;
|
|
946
|
+
}, [e]), s.useEffect(function() {
|
|
947
|
+
if (e.inert) {
|
|
948
|
+
document.body.classList.add("block-interactivity-".concat(a));
|
|
949
|
+
var l = Fn([e.lockRef.current], (e.shards || []).map(dt), !0).filter(Boolean);
|
|
950
|
+
return l.forEach(function(h) {
|
|
951
|
+
return h.classList.add("allow-interactivity-".concat(a));
|
|
952
|
+
}), function() {
|
|
953
|
+
document.body.classList.remove("block-interactivity-".concat(a)), l.forEach(function(h) {
|
|
954
|
+
return h.classList.remove("allow-interactivity-".concat(a));
|
|
955
|
+
});
|
|
956
|
+
};
|
|
957
|
+
}
|
|
958
|
+
}, [e.inert, e.lockRef.current, e.shards]);
|
|
959
|
+
var o = s.useCallback(function(l, h) {
|
|
960
|
+
if ("touches" in l && l.touches.length === 2)
|
|
961
|
+
return !c.current.allowPinchZoom;
|
|
962
|
+
var p = Ee(l), m = n.current, C = "deltaX" in l ? l.deltaX : m[0] - p[0], x = "deltaY" in l ? l.deltaY : m[1] - p[1], E, A = l.target, _ = Math.abs(C) > Math.abs(x) ? "h" : "v";
|
|
963
|
+
if ("touches" in l && _ === "h" && A.type === "range")
|
|
964
|
+
return !1;
|
|
965
|
+
var N = lt(_, A);
|
|
966
|
+
if (!N)
|
|
967
|
+
return !0;
|
|
968
|
+
if (N ? E = _ : (E = _ === "v" ? "h" : "v", N = lt(_, A)), !N)
|
|
969
|
+
return !1;
|
|
970
|
+
if (!r.current && "changedTouches" in l && (C || x) && (r.current = E), !E)
|
|
971
|
+
return !0;
|
|
972
|
+
var k = r.current || E;
|
|
973
|
+
return Qr(k, h, l, k === "h" ? C : x, !0);
|
|
974
|
+
}, []), u = s.useCallback(function(l) {
|
|
975
|
+
var h = l;
|
|
976
|
+
if (!(!de.length || de[de.length - 1] !== i)) {
|
|
977
|
+
var p = "deltaY" in h ? ut(h) : Ee(h), m = t.current.filter(function(E) {
|
|
978
|
+
return E.name === h.type && (E.target === h.target || h.target === E.shadowParent) && Jr(E.delta, p);
|
|
979
|
+
})[0];
|
|
980
|
+
if (m && m.should) {
|
|
981
|
+
h.cancelable && h.preventDefault();
|
|
982
|
+
return;
|
|
983
|
+
}
|
|
984
|
+
if (!m) {
|
|
985
|
+
var C = (c.current.shards || []).map(dt).filter(Boolean).filter(function(E) {
|
|
986
|
+
return E.contains(h.target);
|
|
987
|
+
}), x = C.length > 0 ? o(h, C[0]) : !c.current.noIsolation;
|
|
988
|
+
x && h.cancelable && h.preventDefault();
|
|
989
|
+
}
|
|
990
|
+
}
|
|
991
|
+
}, []), d = s.useCallback(function(l, h, p, m) {
|
|
992
|
+
var C = { name: l, delta: h, target: p, should: m, shadowParent: ro(p) };
|
|
993
|
+
t.current.push(C), setTimeout(function() {
|
|
994
|
+
t.current = t.current.filter(function(x) {
|
|
995
|
+
return x !== C;
|
|
996
|
+
});
|
|
997
|
+
}, 1);
|
|
998
|
+
}, []), g = s.useCallback(function(l) {
|
|
999
|
+
n.current = Ee(l), r.current = void 0;
|
|
1000
|
+
}, []), S = s.useCallback(function(l) {
|
|
1001
|
+
d(l.type, ut(l), l.target, o(l, e.lockRef.current));
|
|
1002
|
+
}, []), w = s.useCallback(function(l) {
|
|
1003
|
+
d(l.type, Ee(l), l.target, o(l, e.lockRef.current));
|
|
1004
|
+
}, []);
|
|
1005
|
+
s.useEffect(function() {
|
|
1006
|
+
return de.push(i), e.setCallbacks({
|
|
1007
|
+
onScrollCapture: S,
|
|
1008
|
+
onWheelCapture: S,
|
|
1009
|
+
onTouchMoveCapture: w
|
|
1010
|
+
}), document.addEventListener("wheel", u, ue), document.addEventListener("touchmove", u, ue), document.addEventListener("touchstart", g, ue), function() {
|
|
1011
|
+
de = de.filter(function(l) {
|
|
1012
|
+
return l !== i;
|
|
1013
|
+
}), document.removeEventListener("wheel", u, ue), document.removeEventListener("touchmove", u, ue), document.removeEventListener("touchstart", g, ue);
|
|
1014
|
+
};
|
|
1015
|
+
}, []);
|
|
1016
|
+
var y = e.removeScrollBar, f = e.inert;
|
|
1017
|
+
return s.createElement(
|
|
1018
|
+
s.Fragment,
|
|
1019
|
+
null,
|
|
1020
|
+
f ? s.createElement(i, { styles: eo(a) }) : null,
|
|
1021
|
+
y ? s.createElement(Kr, { gapMode: e.gapMode }) : null
|
|
1022
|
+
);
|
|
1023
|
+
}
|
|
1024
|
+
function ro(e) {
|
|
1025
|
+
for (var t = null; e !== null; )
|
|
1026
|
+
e instanceof ShadowRoot && (t = e.host, e = e.host), e = e.parentNode;
|
|
1027
|
+
return t;
|
|
1028
|
+
}
|
|
1029
|
+
const oo = $n(Ft, no);
|
|
1030
|
+
var $t = s.forwardRef(function(e, t) {
|
|
1031
|
+
return s.createElement(Ne, ce({}, e, { ref: t, sideCar: oo }));
|
|
1032
|
+
});
|
|
1033
|
+
$t.classNames = Ne.classNames;
|
|
1034
|
+
var ao = [" ", "Enter", "ArrowUp", "ArrowDown"], so = [" ", "Enter"], be = "Select", [Ie, Ae, co] = jn(be), [me, ua] = gt(be, [
|
|
1035
|
+
co,
|
|
1036
|
+
Rt
|
|
1037
|
+
]), Oe = Rt(), [io, oe] = me(be), [lo, uo] = me(be), Ut = (e) => {
|
|
1038
|
+
const {
|
|
1039
|
+
__scopeSelect: t,
|
|
1040
|
+
children: n,
|
|
1041
|
+
open: r,
|
|
1042
|
+
defaultOpen: a,
|
|
1043
|
+
onOpenChange: i,
|
|
1044
|
+
value: c,
|
|
1045
|
+
defaultValue: o,
|
|
1046
|
+
onValueChange: u,
|
|
1047
|
+
dir: d,
|
|
1048
|
+
name: g,
|
|
1049
|
+
autoComplete: S,
|
|
1050
|
+
disabled: w,
|
|
1051
|
+
required: y
|
|
1052
|
+
} = e, f = Oe(t), [l, h] = s.useState(null), [p, m] = s.useState(null), [C, x] = s.useState(!1), E = xn(d), [A = !1, _] = et({
|
|
1053
|
+
prop: r,
|
|
1054
|
+
defaultProp: a,
|
|
1055
|
+
onChange: i
|
|
1056
|
+
}), [N, k] = et({
|
|
1057
|
+
prop: c,
|
|
1058
|
+
defaultProp: o,
|
|
1059
|
+
onChange: u
|
|
1060
|
+
}), H = s.useRef(null), G = l ? !!l.closest("form") : !0, [$, W] = s.useState(/* @__PURE__ */ new Set()), Z = Array.from($).map((M) => M.props.value).join(";");
|
|
1061
|
+
return /* @__PURE__ */ v(Pr, { ...f, children: /* @__PURE__ */ ne(
|
|
1062
|
+
io,
|
|
1063
|
+
{
|
|
1064
|
+
required: y,
|
|
1065
|
+
scope: t,
|
|
1066
|
+
trigger: l,
|
|
1067
|
+
onTriggerChange: h,
|
|
1068
|
+
valueNode: p,
|
|
1069
|
+
onValueNodeChange: m,
|
|
1070
|
+
valueNodeHasChildren: C,
|
|
1071
|
+
onValueNodeHasChildrenChange: x,
|
|
1072
|
+
contentId: Ge(),
|
|
1073
|
+
value: N,
|
|
1074
|
+
onValueChange: k,
|
|
1075
|
+
open: A,
|
|
1076
|
+
onOpenChange: _,
|
|
1077
|
+
dir: E,
|
|
1078
|
+
triggerPointerDownPosRef: H,
|
|
1079
|
+
disabled: w,
|
|
1080
|
+
children: [
|
|
1081
|
+
/* @__PURE__ */ v(Ie.Provider, { scope: t, children: /* @__PURE__ */ v(
|
|
1082
|
+
lo,
|
|
1083
|
+
{
|
|
1084
|
+
scope: e.__scopeSelect,
|
|
1085
|
+
onNativeOptionAdd: s.useCallback((M) => {
|
|
1086
|
+
W((U) => new Set(U).add(M));
|
|
1087
|
+
}, []),
|
|
1088
|
+
onNativeOptionRemove: s.useCallback((M) => {
|
|
1089
|
+
W((U) => {
|
|
1090
|
+
const F = new Set(U);
|
|
1091
|
+
return F.delete(M), F;
|
|
1092
|
+
});
|
|
1093
|
+
}, []),
|
|
1094
|
+
children: n
|
|
1095
|
+
}
|
|
1096
|
+
) }),
|
|
1097
|
+
G ? /* @__PURE__ */ ne(
|
|
1098
|
+
mn,
|
|
1099
|
+
{
|
|
1100
|
+
"aria-hidden": !0,
|
|
1101
|
+
required: y,
|
|
1102
|
+
tabIndex: -1,
|
|
1103
|
+
name: g,
|
|
1104
|
+
autoComplete: S,
|
|
1105
|
+
value: N,
|
|
1106
|
+
onChange: (M) => k(M.target.value),
|
|
1107
|
+
disabled: w,
|
|
1108
|
+
children: [
|
|
1109
|
+
N === void 0 ? /* @__PURE__ */ v("option", { value: "" }) : null,
|
|
1110
|
+
Array.from($)
|
|
1111
|
+
]
|
|
1112
|
+
},
|
|
1113
|
+
Z
|
|
1114
|
+
) : null
|
|
1115
|
+
]
|
|
1116
|
+
}
|
|
1117
|
+
) });
|
|
1118
|
+
};
|
|
1119
|
+
Ut.displayName = be;
|
|
1120
|
+
var Kt = "SelectTrigger", Yt = s.forwardRef(
|
|
1121
|
+
(e, t) => {
|
|
1122
|
+
const { __scopeSelect: n, disabled: r = !1, ...a } = e, i = Oe(n), c = oe(Kt, n), o = c.disabled || r, u = K(t, c.onTriggerChange), d = Ae(n), [g, S, w] = hn((f) => {
|
|
1123
|
+
const l = d().filter((m) => !m.disabled), h = l.find((m) => m.value === c.value), p = vn(l, f, h);
|
|
1124
|
+
p !== void 0 && c.onValueChange(p.value);
|
|
1125
|
+
}), y = () => {
|
|
1126
|
+
o || (c.onOpenChange(!0), w());
|
|
1127
|
+
};
|
|
1128
|
+
return /* @__PURE__ */ v(Rr, { asChild: !0, ...i, children: /* @__PURE__ */ v(
|
|
1129
|
+
O.button,
|
|
1130
|
+
{
|
|
1131
|
+
type: "button",
|
|
1132
|
+
role: "combobox",
|
|
1133
|
+
"aria-controls": c.contentId,
|
|
1134
|
+
"aria-expanded": c.open,
|
|
1135
|
+
"aria-required": c.required,
|
|
1136
|
+
"aria-autocomplete": "none",
|
|
1137
|
+
dir: c.dir,
|
|
1138
|
+
"data-state": c.open ? "open" : "closed",
|
|
1139
|
+
disabled: o,
|
|
1140
|
+
"data-disabled": o ? "" : void 0,
|
|
1141
|
+
"data-placeholder": pn(c.value) ? "" : void 0,
|
|
1142
|
+
...a,
|
|
1143
|
+
ref: u,
|
|
1144
|
+
onClick: B(a.onClick, (f) => {
|
|
1145
|
+
f.currentTarget.focus();
|
|
1146
|
+
}),
|
|
1147
|
+
onPointerDown: B(a.onPointerDown, (f) => {
|
|
1148
|
+
const l = f.target;
|
|
1149
|
+
l.hasPointerCapture(f.pointerId) && l.releasePointerCapture(f.pointerId), f.button === 0 && f.ctrlKey === !1 && (y(), c.triggerPointerDownPosRef.current = {
|
|
1150
|
+
x: Math.round(f.pageX),
|
|
1151
|
+
y: Math.round(f.pageY)
|
|
1152
|
+
}, f.preventDefault());
|
|
1153
|
+
}),
|
|
1154
|
+
onKeyDown: B(a.onKeyDown, (f) => {
|
|
1155
|
+
const l = g.current !== "";
|
|
1156
|
+
!(f.ctrlKey || f.altKey || f.metaKey) && f.key.length === 1 && S(f.key), !(l && f.key === " ") && ao.includes(f.key) && (y(), f.preventDefault());
|
|
1157
|
+
})
|
|
1158
|
+
}
|
|
1159
|
+
) });
|
|
1160
|
+
}
|
|
1161
|
+
);
|
|
1162
|
+
Yt.displayName = Kt;
|
|
1163
|
+
var jt = "SelectValue", Xt = s.forwardRef(
|
|
1164
|
+
(e, t) => {
|
|
1165
|
+
const { __scopeSelect: n, className: r, style: a, children: i, placeholder: c = "", ...o } = e, u = oe(jt, n), { onValueNodeHasChildrenChange: d } = u, g = i !== void 0, S = K(t, u.onValueNodeChange);
|
|
1166
|
+
return X(() => {
|
|
1167
|
+
d(g);
|
|
1168
|
+
}, [d, g]), /* @__PURE__ */ v(
|
|
1169
|
+
O.span,
|
|
1170
|
+
{
|
|
1171
|
+
...o,
|
|
1172
|
+
ref: S,
|
|
1173
|
+
style: { pointerEvents: "none" },
|
|
1174
|
+
children: pn(u.value) ? /* @__PURE__ */ v(Xe, { children: c }) : i
|
|
1175
|
+
}
|
|
1176
|
+
);
|
|
1177
|
+
}
|
|
1178
|
+
);
|
|
1179
|
+
Xt.displayName = jt;
|
|
1180
|
+
var fo = "SelectIcon", Gt = s.forwardRef(
|
|
1181
|
+
(e, t) => {
|
|
1182
|
+
const { __scopeSelect: n, children: r, ...a } = e;
|
|
1183
|
+
return /* @__PURE__ */ v(O.span, { "aria-hidden": !0, ...a, ref: t, children: r || "▼" });
|
|
1184
|
+
}
|
|
1185
|
+
);
|
|
1186
|
+
Gt.displayName = fo;
|
|
1187
|
+
var po = "SelectPortal", Zt = (e) => /* @__PURE__ */ v(kt, { asChild: !0, ...e });
|
|
1188
|
+
Zt.displayName = po;
|
|
1189
|
+
var ie = "SelectContent", qt = s.forwardRef(
|
|
1190
|
+
(e, t) => {
|
|
1191
|
+
const n = oe(ie, e.__scopeSelect), [r, a] = s.useState();
|
|
1192
|
+
if (X(() => {
|
|
1193
|
+
a(new DocumentFragment());
|
|
1194
|
+
}, []), !n.open) {
|
|
1195
|
+
const i = r;
|
|
1196
|
+
return i ? mt.createPortal(
|
|
1197
|
+
/* @__PURE__ */ v(Qt, { scope: e.__scopeSelect, children: /* @__PURE__ */ v(Ie.Slot, { scope: e.__scopeSelect, children: /* @__PURE__ */ v("div", { children: e.children }) }) }),
|
|
1198
|
+
i
|
|
1199
|
+
) : null;
|
|
1200
|
+
}
|
|
1201
|
+
return /* @__PURE__ */ v(Jt, { ...e, ref: t });
|
|
1202
|
+
}
|
|
1203
|
+
);
|
|
1204
|
+
qt.displayName = ie;
|
|
1205
|
+
var J = 10, [Qt, ae] = me(ie), mo = "SelectContentImpl", Jt = s.forwardRef(
|
|
1206
|
+
(e, t) => {
|
|
1207
|
+
const {
|
|
1208
|
+
__scopeSelect: n,
|
|
1209
|
+
position: r = "item-aligned",
|
|
1210
|
+
onCloseAutoFocus: a,
|
|
1211
|
+
onEscapeKeyDown: i,
|
|
1212
|
+
onPointerDownOutside: c,
|
|
1213
|
+
//
|
|
1214
|
+
// PopperContent props
|
|
1215
|
+
side: o,
|
|
1216
|
+
sideOffset: u,
|
|
1217
|
+
align: d,
|
|
1218
|
+
alignOffset: g,
|
|
1219
|
+
arrowPadding: S,
|
|
1220
|
+
collisionBoundary: w,
|
|
1221
|
+
collisionPadding: y,
|
|
1222
|
+
sticky: f,
|
|
1223
|
+
hideWhenDetached: l,
|
|
1224
|
+
avoidCollisions: h,
|
|
1225
|
+
//
|
|
1226
|
+
...p
|
|
1227
|
+
} = e, m = oe(ie, n), [C, x] = s.useState(null), [E, A] = s.useState(null), _ = K(t, (b) => x(b)), [N, k] = s.useState(null), [H, G] = s.useState(
|
|
1228
|
+
null
|
|
1229
|
+
), $ = Ae(n), [W, Z] = s.useState(!1), M = s.useRef(!1);
|
|
1230
|
+
s.useEffect(() => {
|
|
1231
|
+
if (C) return kn(C);
|
|
1232
|
+
}, [C]), rr();
|
|
1233
|
+
const U = s.useCallback(
|
|
1234
|
+
(b) => {
|
|
1235
|
+
const [I, ...L] = $().map((R) => R.ref.current), [T] = L.slice(-1), P = document.activeElement;
|
|
1236
|
+
for (const R of b)
|
|
1237
|
+
if (R === P || (R == null || R.scrollIntoView({ block: "nearest" }), R === I && E && (E.scrollTop = 0), R === T && E && (E.scrollTop = E.scrollHeight), R == null || R.focus(), document.activeElement !== P)) return;
|
|
1238
|
+
},
|
|
1239
|
+
[$, E]
|
|
1240
|
+
), F = s.useCallback(
|
|
1241
|
+
() => U([N, C]),
|
|
1242
|
+
[U, N, C]
|
|
1243
|
+
);
|
|
1244
|
+
s.useEffect(() => {
|
|
1245
|
+
W && F();
|
|
1246
|
+
}, [W, F]);
|
|
1247
|
+
const { onOpenChange: z, triggerPointerDownPosRef: Y } = m;
|
|
1248
|
+
s.useEffect(() => {
|
|
1249
|
+
if (C) {
|
|
1250
|
+
let b = { x: 0, y: 0 };
|
|
1251
|
+
const I = (T) => {
|
|
1252
|
+
var P, R;
|
|
1253
|
+
b = {
|
|
1254
|
+
x: Math.abs(Math.round(T.pageX) - (((P = Y.current) == null ? void 0 : P.x) ?? 0)),
|
|
1255
|
+
y: Math.abs(Math.round(T.pageY) - (((R = Y.current) == null ? void 0 : R.y) ?? 0))
|
|
1256
|
+
};
|
|
1257
|
+
}, L = (T) => {
|
|
1258
|
+
b.x <= 10 && b.y <= 10 ? T.preventDefault() : C.contains(T.target) || z(!1), document.removeEventListener("pointermove", I), Y.current = null;
|
|
1259
|
+
};
|
|
1260
|
+
return Y.current !== null && (document.addEventListener("pointermove", I), document.addEventListener("pointerup", L, { capture: !0, once: !0 })), () => {
|
|
1261
|
+
document.removeEventListener("pointermove", I), document.removeEventListener("pointerup", L, { capture: !0 });
|
|
1262
|
+
};
|
|
1263
|
+
}
|
|
1264
|
+
}, [C, z, Y]), s.useEffect(() => {
|
|
1265
|
+
const b = () => z(!1);
|
|
1266
|
+
return window.addEventListener("blur", b), window.addEventListener("resize", b), () => {
|
|
1267
|
+
window.removeEventListener("blur", b), window.removeEventListener("resize", b);
|
|
1268
|
+
};
|
|
1269
|
+
}, [z]);
|
|
1270
|
+
const [he, Q] = hn((b) => {
|
|
1271
|
+
const I = $().filter((P) => !P.disabled), L = I.find((P) => P.ref.current === document.activeElement), T = vn(I, b, L);
|
|
1272
|
+
T && setTimeout(() => T.ref.current.focus());
|
|
1273
|
+
}), ve = s.useCallback(
|
|
1274
|
+
(b, I, L) => {
|
|
1275
|
+
const T = !M.current && !L;
|
|
1276
|
+
(m.value !== void 0 && m.value === I || T) && (k(b), T && (M.current = !0));
|
|
1277
|
+
},
|
|
1278
|
+
[m.value]
|
|
1279
|
+
), ge = s.useCallback(() => C == null ? void 0 : C.focus(), [C]), ee = s.useCallback(
|
|
1280
|
+
(b, I, L) => {
|
|
1281
|
+
const T = !M.current && !L;
|
|
1282
|
+
(m.value !== void 0 && m.value === I || T) && G(b);
|
|
1283
|
+
},
|
|
1284
|
+
[m.value]
|
|
1285
|
+
), le = r === "popper" ? $e : en, se = le === $e ? {
|
|
1286
|
+
side: o,
|
|
1287
|
+
sideOffset: u,
|
|
1288
|
+
align: d,
|
|
1289
|
+
alignOffset: g,
|
|
1290
|
+
arrowPadding: S,
|
|
1291
|
+
collisionBoundary: w,
|
|
1292
|
+
collisionPadding: y,
|
|
1293
|
+
sticky: f,
|
|
1294
|
+
hideWhenDetached: l,
|
|
1295
|
+
avoidCollisions: h
|
|
1296
|
+
} : {};
|
|
1297
|
+
return /* @__PURE__ */ v(
|
|
1298
|
+
Qt,
|
|
1299
|
+
{
|
|
1300
|
+
scope: n,
|
|
1301
|
+
content: C,
|
|
1302
|
+
viewport: E,
|
|
1303
|
+
onViewportChange: A,
|
|
1304
|
+
itemRefCallback: ve,
|
|
1305
|
+
selectedItem: N,
|
|
1306
|
+
onItemLeave: ge,
|
|
1307
|
+
itemTextRefCallback: ee,
|
|
1308
|
+
focusSelectedItem: F,
|
|
1309
|
+
selectedItemText: H,
|
|
1310
|
+
position: r,
|
|
1311
|
+
isPositioned: W,
|
|
1312
|
+
searchRef: he,
|
|
1313
|
+
children: /* @__PURE__ */ v($t, { as: ze, allowPinchZoom: !0, children: /* @__PURE__ */ v(
|
|
1314
|
+
bt,
|
|
1315
|
+
{
|
|
1316
|
+
asChild: !0,
|
|
1317
|
+
trapped: m.open,
|
|
1318
|
+
onMountAutoFocus: (b) => {
|
|
1319
|
+
b.preventDefault();
|
|
1320
|
+
},
|
|
1321
|
+
onUnmountAutoFocus: B(a, (b) => {
|
|
1322
|
+
var I;
|
|
1323
|
+
(I = m.trigger) == null || I.focus({ preventScroll: !0 }), b.preventDefault();
|
|
1324
|
+
}),
|
|
1325
|
+
children: /* @__PURE__ */ v(
|
|
1326
|
+
yt,
|
|
1327
|
+
{
|
|
1328
|
+
asChild: !0,
|
|
1329
|
+
disableOutsidePointerEvents: !0,
|
|
1330
|
+
onEscapeKeyDown: i,
|
|
1331
|
+
onPointerDownOutside: c,
|
|
1332
|
+
onFocusOutside: (b) => b.preventDefault(),
|
|
1333
|
+
onDismiss: () => m.onOpenChange(!1),
|
|
1334
|
+
children: /* @__PURE__ */ v(
|
|
1335
|
+
le,
|
|
1336
|
+
{
|
|
1337
|
+
role: "listbox",
|
|
1338
|
+
id: m.contentId,
|
|
1339
|
+
"data-state": m.open ? "open" : "closed",
|
|
1340
|
+
dir: m.dir,
|
|
1341
|
+
onContextMenu: (b) => b.preventDefault(),
|
|
1342
|
+
...p,
|
|
1343
|
+
...se,
|
|
1344
|
+
onPlaced: () => Z(!0),
|
|
1345
|
+
ref: _,
|
|
1346
|
+
style: {
|
|
1347
|
+
// flex layout so we can place the scroll buttons properly
|
|
1348
|
+
display: "flex",
|
|
1349
|
+
flexDirection: "column",
|
|
1350
|
+
// reset the outline by default as the content MAY get focused
|
|
1351
|
+
outline: "none",
|
|
1352
|
+
...p.style
|
|
1353
|
+
},
|
|
1354
|
+
onKeyDown: B(p.onKeyDown, (b) => {
|
|
1355
|
+
const I = b.ctrlKey || b.altKey || b.metaKey;
|
|
1356
|
+
if (b.key === "Tab" && b.preventDefault(), !I && b.key.length === 1 && Q(b.key), ["ArrowUp", "ArrowDown", "Home", "End"].includes(b.key)) {
|
|
1357
|
+
let T = $().filter((P) => !P.disabled).map((P) => P.ref.current);
|
|
1358
|
+
if (["ArrowUp", "End"].includes(b.key) && (T = T.slice().reverse()), ["ArrowUp", "ArrowDown"].includes(b.key)) {
|
|
1359
|
+
const P = b.target, R = T.indexOf(P);
|
|
1360
|
+
T = T.slice(R + 1);
|
|
1361
|
+
}
|
|
1362
|
+
setTimeout(() => U(T)), b.preventDefault();
|
|
1363
|
+
}
|
|
1364
|
+
})
|
|
1365
|
+
}
|
|
1366
|
+
)
|
|
1367
|
+
}
|
|
1368
|
+
)
|
|
1369
|
+
}
|
|
1370
|
+
) })
|
|
1371
|
+
}
|
|
1372
|
+
);
|
|
1373
|
+
}
|
|
1374
|
+
);
|
|
1375
|
+
Jt.displayName = mo;
|
|
1376
|
+
var ho = "SelectItemAlignedPosition", en = s.forwardRef((e, t) => {
|
|
1377
|
+
const { __scopeSelect: n, onPlaced: r, ...a } = e, i = oe(ie, n), c = ae(ie, n), [o, u] = s.useState(null), [d, g] = s.useState(null), S = K(t, (_) => g(_)), w = Ae(n), y = s.useRef(!1), f = s.useRef(!0), { viewport: l, selectedItem: h, selectedItemText: p, focusSelectedItem: m } = c, C = s.useCallback(() => {
|
|
1378
|
+
if (i.trigger && i.valueNode && o && d && l && h && p) {
|
|
1379
|
+
const _ = i.trigger.getBoundingClientRect(), N = d.getBoundingClientRect(), k = i.valueNode.getBoundingClientRect(), H = p.getBoundingClientRect();
|
|
1380
|
+
if (i.dir !== "rtl") {
|
|
1381
|
+
const P = H.left - N.left, R = k.left - P, V = _.left - R, q = _.width + V, Se = Math.max(q, N.width), we = window.innerWidth - J, ye = Je(R, [J, we - Se]);
|
|
1382
|
+
o.style.minWidth = q + "px", o.style.left = ye + "px";
|
|
1383
|
+
} else {
|
|
1384
|
+
const P = N.right - H.right, R = window.innerWidth - k.right - P, V = window.innerWidth - _.right - R, q = _.width + V, Se = Math.max(q, N.width), we = window.innerWidth - J, ye = Je(R, [J, we - Se]);
|
|
1385
|
+
o.style.minWidth = q + "px", o.style.right = ye + "px";
|
|
1386
|
+
}
|
|
1387
|
+
const G = w(), $ = window.innerHeight - J * 2, W = l.scrollHeight, Z = window.getComputedStyle(d), M = parseInt(Z.borderTopWidth, 10), U = parseInt(Z.paddingTop, 10), F = parseInt(Z.borderBottomWidth, 10), z = parseInt(Z.paddingBottom, 10), Y = M + U + W + z + F, he = Math.min(h.offsetHeight * 5, Y), Q = window.getComputedStyle(l), ve = parseInt(Q.paddingTop, 10), ge = parseInt(Q.paddingBottom, 10), ee = _.top + _.height / 2 - J, le = $ - ee, se = h.offsetHeight / 2, b = h.offsetTop + se, I = M + U + b, L = Y - I;
|
|
1388
|
+
if (I <= ee) {
|
|
1389
|
+
const P = h === G[G.length - 1].ref.current;
|
|
1390
|
+
o.style.bottom = "0px";
|
|
1391
|
+
const R = d.clientHeight - l.offsetTop - l.offsetHeight, V = Math.max(
|
|
1392
|
+
le,
|
|
1393
|
+
se + // viewport might have padding bottom, include it to avoid a scrollable viewport
|
|
1394
|
+
(P ? ge : 0) + R + F
|
|
1395
|
+
), q = I + V;
|
|
1396
|
+
o.style.height = q + "px";
|
|
1397
|
+
} else {
|
|
1398
|
+
const P = h === G[0].ref.current;
|
|
1399
|
+
o.style.top = "0px";
|
|
1400
|
+
const V = Math.max(
|
|
1401
|
+
ee,
|
|
1402
|
+
M + l.offsetTop + // viewport might have padding top, include it to avoid a scrollable viewport
|
|
1403
|
+
(P ? ve : 0) + se
|
|
1404
|
+
) + L;
|
|
1405
|
+
o.style.height = V + "px", l.scrollTop = I - ee + l.offsetTop;
|
|
1406
|
+
}
|
|
1407
|
+
o.style.margin = `${J}px 0`, o.style.minHeight = he + "px", o.style.maxHeight = $ + "px", r == null || r(), requestAnimationFrame(() => y.current = !0);
|
|
1408
|
+
}
|
|
1409
|
+
}, [
|
|
1410
|
+
w,
|
|
1411
|
+
i.trigger,
|
|
1412
|
+
i.valueNode,
|
|
1413
|
+
o,
|
|
1414
|
+
d,
|
|
1415
|
+
l,
|
|
1416
|
+
h,
|
|
1417
|
+
p,
|
|
1418
|
+
i.dir,
|
|
1419
|
+
r
|
|
1420
|
+
]);
|
|
1421
|
+
X(() => C(), [C]);
|
|
1422
|
+
const [x, E] = s.useState();
|
|
1423
|
+
X(() => {
|
|
1424
|
+
d && E(window.getComputedStyle(d).zIndex);
|
|
1425
|
+
}, [d]);
|
|
1426
|
+
const A = s.useCallback(
|
|
1427
|
+
(_) => {
|
|
1428
|
+
_ && f.current === !0 && (C(), m == null || m(), f.current = !1);
|
|
1429
|
+
},
|
|
1430
|
+
[C, m]
|
|
1431
|
+
);
|
|
1432
|
+
return /* @__PURE__ */ v(
|
|
1433
|
+
go,
|
|
1434
|
+
{
|
|
1435
|
+
scope: n,
|
|
1436
|
+
contentWrapper: o,
|
|
1437
|
+
shouldExpandOnScrollRef: y,
|
|
1438
|
+
onScrollButtonChange: A,
|
|
1439
|
+
children: /* @__PURE__ */ v(
|
|
1440
|
+
"div",
|
|
1441
|
+
{
|
|
1442
|
+
ref: u,
|
|
1443
|
+
style: {
|
|
1444
|
+
display: "flex",
|
|
1445
|
+
flexDirection: "column",
|
|
1446
|
+
position: "fixed",
|
|
1447
|
+
zIndex: x
|
|
1448
|
+
},
|
|
1449
|
+
children: /* @__PURE__ */ v(
|
|
1450
|
+
O.div,
|
|
1451
|
+
{
|
|
1452
|
+
...a,
|
|
1453
|
+
ref: S,
|
|
1454
|
+
style: {
|
|
1455
|
+
// When we get the height of the content, it includes borders. If we were to set
|
|
1456
|
+
// the height without having `boxSizing: 'border-box'` it would be too big.
|
|
1457
|
+
boxSizing: "border-box",
|
|
1458
|
+
// We need to ensure the content doesn't get taller than the wrapper
|
|
1459
|
+
maxHeight: "100%",
|
|
1460
|
+
...a.style
|
|
1461
|
+
}
|
|
1462
|
+
}
|
|
1463
|
+
)
|
|
1464
|
+
}
|
|
1465
|
+
)
|
|
1466
|
+
}
|
|
1467
|
+
);
|
|
1468
|
+
});
|
|
1469
|
+
en.displayName = ho;
|
|
1470
|
+
var vo = "SelectPopperPosition", $e = s.forwardRef((e, t) => {
|
|
1471
|
+
const {
|
|
1472
|
+
__scopeSelect: n,
|
|
1473
|
+
align: r = "start",
|
|
1474
|
+
collisionPadding: a = J,
|
|
1475
|
+
...i
|
|
1476
|
+
} = e, c = Oe(n);
|
|
1477
|
+
return /* @__PURE__ */ v(
|
|
1478
|
+
Tr,
|
|
1479
|
+
{
|
|
1480
|
+
...c,
|
|
1481
|
+
...i,
|
|
1482
|
+
ref: t,
|
|
1483
|
+
align: r,
|
|
1484
|
+
collisionPadding: a,
|
|
1485
|
+
style: {
|
|
1486
|
+
// Ensure border-box for floating-ui calculations
|
|
1487
|
+
boxSizing: "border-box",
|
|
1488
|
+
...i.style,
|
|
1489
|
+
"--radix-select-content-transform-origin": "var(--radix-popper-transform-origin)",
|
|
1490
|
+
"--radix-select-content-available-width": "var(--radix-popper-available-width)",
|
|
1491
|
+
"--radix-select-content-available-height": "var(--radix-popper-available-height)",
|
|
1492
|
+
"--radix-select-trigger-width": "var(--radix-popper-anchor-width)",
|
|
1493
|
+
"--radix-select-trigger-height": "var(--radix-popper-anchor-height)"
|
|
1494
|
+
}
|
|
1495
|
+
}
|
|
1496
|
+
);
|
|
1497
|
+
});
|
|
1498
|
+
$e.displayName = vo;
|
|
1499
|
+
var [go, Qe] = me(ie, {}), Ue = "SelectViewport", tn = s.forwardRef(
|
|
1500
|
+
(e, t) => {
|
|
1501
|
+
const { __scopeSelect: n, nonce: r, ...a } = e, i = ae(Ue, n), c = Qe(Ue, n), o = K(t, i.onViewportChange), u = s.useRef(0);
|
|
1502
|
+
return /* @__PURE__ */ ne(Xe, { children: [
|
|
1503
|
+
/* @__PURE__ */ v(
|
|
1504
|
+
"style",
|
|
1505
|
+
{
|
|
1506
|
+
dangerouslySetInnerHTML: {
|
|
1507
|
+
__html: "[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"
|
|
1508
|
+
},
|
|
1509
|
+
nonce: r
|
|
1510
|
+
}
|
|
1511
|
+
),
|
|
1512
|
+
/* @__PURE__ */ v(Ie.Slot, { scope: n, children: /* @__PURE__ */ v(
|
|
1513
|
+
O.div,
|
|
1514
|
+
{
|
|
1515
|
+
"data-radix-select-viewport": "",
|
|
1516
|
+
role: "presentation",
|
|
1517
|
+
...a,
|
|
1518
|
+
ref: o,
|
|
1519
|
+
style: {
|
|
1520
|
+
// we use position: 'relative' here on the `viewport` so that when we call
|
|
1521
|
+
// `selectedItem.offsetTop` in calculations, the offset is relative to the viewport
|
|
1522
|
+
// (independent of the scrollUpButton).
|
|
1523
|
+
position: "relative",
|
|
1524
|
+
flex: 1,
|
|
1525
|
+
overflow: "auto",
|
|
1526
|
+
...a.style
|
|
1527
|
+
},
|
|
1528
|
+
onScroll: B(a.onScroll, (d) => {
|
|
1529
|
+
const g = d.currentTarget, { contentWrapper: S, shouldExpandOnScrollRef: w } = c;
|
|
1530
|
+
if (w != null && w.current && S) {
|
|
1531
|
+
const y = Math.abs(u.current - g.scrollTop);
|
|
1532
|
+
if (y > 0) {
|
|
1533
|
+
const f = window.innerHeight - J * 2, l = parseFloat(S.style.minHeight), h = parseFloat(S.style.height), p = Math.max(l, h);
|
|
1534
|
+
if (p < f) {
|
|
1535
|
+
const m = p + y, C = Math.min(f, m), x = m - C;
|
|
1536
|
+
S.style.height = C + "px", S.style.bottom === "0px" && (g.scrollTop = x > 0 ? x : 0, S.style.justifyContent = "flex-end");
|
|
1537
|
+
}
|
|
1538
|
+
}
|
|
1539
|
+
}
|
|
1540
|
+
u.current = g.scrollTop;
|
|
1541
|
+
})
|
|
1542
|
+
}
|
|
1543
|
+
) })
|
|
1544
|
+
] });
|
|
1545
|
+
}
|
|
1546
|
+
);
|
|
1547
|
+
tn.displayName = Ue;
|
|
1548
|
+
var nn = "SelectGroup", [So, wo] = me(nn), yo = s.forwardRef(
|
|
1549
|
+
(e, t) => {
|
|
1550
|
+
const { __scopeSelect: n, ...r } = e, a = Ge();
|
|
1551
|
+
return /* @__PURE__ */ v(So, { scope: n, id: a, children: /* @__PURE__ */ v(O.div, { role: "group", "aria-labelledby": a, ...r, ref: t }) });
|
|
1552
|
+
}
|
|
1553
|
+
);
|
|
1554
|
+
yo.displayName = nn;
|
|
1555
|
+
var rn = "SelectLabel", Co = s.forwardRef(
|
|
1556
|
+
(e, t) => {
|
|
1557
|
+
const { __scopeSelect: n, ...r } = e, a = wo(rn, n);
|
|
1558
|
+
return /* @__PURE__ */ v(O.div, { id: a.id, ...r, ref: t });
|
|
1559
|
+
}
|
|
1560
|
+
);
|
|
1561
|
+
Co.displayName = rn;
|
|
1562
|
+
var Te = "SelectItem", [bo, on] = me(Te), an = s.forwardRef(
|
|
1563
|
+
(e, t) => {
|
|
1564
|
+
const {
|
|
1565
|
+
__scopeSelect: n,
|
|
1566
|
+
value: r,
|
|
1567
|
+
disabled: a = !1,
|
|
1568
|
+
textValue: i,
|
|
1569
|
+
...c
|
|
1570
|
+
} = e, o = oe(Te, n), u = ae(Te, n), d = o.value === r, [g, S] = s.useState(i ?? ""), [w, y] = s.useState(!1), f = K(
|
|
1571
|
+
t,
|
|
1572
|
+
(p) => {
|
|
1573
|
+
var m;
|
|
1574
|
+
return (m = u.itemRefCallback) == null ? void 0 : m.call(u, p, r, a);
|
|
1575
|
+
}
|
|
1576
|
+
), l = Ge(), h = () => {
|
|
1577
|
+
a || (o.onValueChange(r), o.onOpenChange(!1));
|
|
1578
|
+
};
|
|
1579
|
+
if (r === "")
|
|
1580
|
+
throw new Error(
|
|
1581
|
+
"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."
|
|
1582
|
+
);
|
|
1583
|
+
return /* @__PURE__ */ v(
|
|
1584
|
+
bo,
|
|
1585
|
+
{
|
|
1586
|
+
scope: n,
|
|
1587
|
+
value: r,
|
|
1588
|
+
disabled: a,
|
|
1589
|
+
textId: l,
|
|
1590
|
+
isSelected: d,
|
|
1591
|
+
onItemTextChange: s.useCallback((p) => {
|
|
1592
|
+
S((m) => m || ((p == null ? void 0 : p.textContent) ?? "").trim());
|
|
1593
|
+
}, []),
|
|
1594
|
+
children: /* @__PURE__ */ v(
|
|
1595
|
+
Ie.ItemSlot,
|
|
1596
|
+
{
|
|
1597
|
+
scope: n,
|
|
1598
|
+
value: r,
|
|
1599
|
+
disabled: a,
|
|
1600
|
+
textValue: g,
|
|
1601
|
+
children: /* @__PURE__ */ v(
|
|
1602
|
+
O.div,
|
|
1603
|
+
{
|
|
1604
|
+
role: "option",
|
|
1605
|
+
"aria-labelledby": l,
|
|
1606
|
+
"data-highlighted": w ? "" : void 0,
|
|
1607
|
+
"aria-selected": d && w,
|
|
1608
|
+
"data-state": d ? "checked" : "unchecked",
|
|
1609
|
+
"aria-disabled": a || void 0,
|
|
1610
|
+
"data-disabled": a ? "" : void 0,
|
|
1611
|
+
tabIndex: a ? void 0 : -1,
|
|
1612
|
+
...c,
|
|
1613
|
+
ref: f,
|
|
1614
|
+
onFocus: B(c.onFocus, () => y(!0)),
|
|
1615
|
+
onBlur: B(c.onBlur, () => y(!1)),
|
|
1616
|
+
onPointerUp: B(c.onPointerUp, h),
|
|
1617
|
+
onPointerMove: B(c.onPointerMove, (p) => {
|
|
1618
|
+
var m;
|
|
1619
|
+
a ? (m = u.onItemLeave) == null || m.call(u) : p.currentTarget.focus({ preventScroll: !0 });
|
|
1620
|
+
}),
|
|
1621
|
+
onPointerLeave: B(c.onPointerLeave, (p) => {
|
|
1622
|
+
var m;
|
|
1623
|
+
p.currentTarget === document.activeElement && ((m = u.onItemLeave) == null || m.call(u));
|
|
1624
|
+
}),
|
|
1625
|
+
onKeyDown: B(c.onKeyDown, (p) => {
|
|
1626
|
+
var C;
|
|
1627
|
+
((C = u.searchRef) == null ? void 0 : C.current) !== "" && p.key === " " || (so.includes(p.key) && h(), p.key === " " && p.preventDefault());
|
|
1628
|
+
})
|
|
1629
|
+
}
|
|
1630
|
+
)
|
|
1631
|
+
}
|
|
1632
|
+
)
|
|
1633
|
+
}
|
|
1634
|
+
);
|
|
1635
|
+
}
|
|
1636
|
+
);
|
|
1637
|
+
an.displayName = Te;
|
|
1638
|
+
var Ce = "SelectItemText", sn = s.forwardRef(
|
|
1639
|
+
(e, t) => {
|
|
1640
|
+
const { __scopeSelect: n, className: r, style: a, ...i } = e, c = oe(Ce, n), o = ae(Ce, n), u = on(Ce, n), d = uo(Ce, n), [g, S] = s.useState(null), w = K(
|
|
1641
|
+
t,
|
|
1642
|
+
(p) => S(p),
|
|
1643
|
+
u.onItemTextChange,
|
|
1644
|
+
(p) => {
|
|
1645
|
+
var m;
|
|
1646
|
+
return (m = o.itemTextRefCallback) == null ? void 0 : m.call(o, p, u.value, u.disabled);
|
|
1647
|
+
}
|
|
1648
|
+
), y = g == null ? void 0 : g.textContent, f = s.useMemo(
|
|
1649
|
+
() => /* @__PURE__ */ v("option", { value: u.value, disabled: u.disabled, children: y }, u.value),
|
|
1650
|
+
[u.disabled, u.value, y]
|
|
1651
|
+
), { onNativeOptionAdd: l, onNativeOptionRemove: h } = d;
|
|
1652
|
+
return X(() => (l(f), () => h(f)), [l, h, f]), /* @__PURE__ */ ne(Xe, { children: [
|
|
1653
|
+
/* @__PURE__ */ v(O.span, { id: u.textId, ...i, ref: w }),
|
|
1654
|
+
u.isSelected && c.valueNode && !c.valueNodeHasChildren ? mt.createPortal(i.children, c.valueNode) : null
|
|
1655
|
+
] });
|
|
1656
|
+
}
|
|
1657
|
+
);
|
|
1658
|
+
sn.displayName = Ce;
|
|
1659
|
+
var cn = "SelectItemIndicator", ln = s.forwardRef(
|
|
1660
|
+
(e, t) => {
|
|
1661
|
+
const { __scopeSelect: n, ...r } = e;
|
|
1662
|
+
return on(cn, n).isSelected ? /* @__PURE__ */ v(O.span, { "aria-hidden": !0, ...r, ref: t }) : null;
|
|
1663
|
+
}
|
|
1664
|
+
);
|
|
1665
|
+
ln.displayName = cn;
|
|
1666
|
+
var Ke = "SelectScrollUpButton", un = s.forwardRef((e, t) => {
|
|
1667
|
+
const n = ae(Ke, e.__scopeSelect), r = Qe(Ke, e.__scopeSelect), [a, i] = s.useState(!1), c = K(t, r.onScrollButtonChange);
|
|
1668
|
+
return X(() => {
|
|
1669
|
+
if (n.viewport && n.isPositioned) {
|
|
1670
|
+
let o = function() {
|
|
1671
|
+
const d = u.scrollTop > 0;
|
|
1672
|
+
i(d);
|
|
1673
|
+
};
|
|
1674
|
+
const u = n.viewport;
|
|
1675
|
+
return o(), u.addEventListener("scroll", o), () => u.removeEventListener("scroll", o);
|
|
1676
|
+
}
|
|
1677
|
+
}, [n.viewport, n.isPositioned]), a ? /* @__PURE__ */ v(
|
|
1678
|
+
fn,
|
|
1679
|
+
{
|
|
1680
|
+
...e,
|
|
1681
|
+
ref: c,
|
|
1682
|
+
onAutoScroll: () => {
|
|
1683
|
+
const { viewport: o, selectedItem: u } = n;
|
|
1684
|
+
o && u && (o.scrollTop = o.scrollTop - u.offsetHeight);
|
|
1685
|
+
}
|
|
1686
|
+
}
|
|
1687
|
+
) : null;
|
|
1688
|
+
});
|
|
1689
|
+
un.displayName = Ke;
|
|
1690
|
+
var Ye = "SelectScrollDownButton", dn = s.forwardRef((e, t) => {
|
|
1691
|
+
const n = ae(Ye, e.__scopeSelect), r = Qe(Ye, e.__scopeSelect), [a, i] = s.useState(!1), c = K(t, r.onScrollButtonChange);
|
|
1692
|
+
return X(() => {
|
|
1693
|
+
if (n.viewport && n.isPositioned) {
|
|
1694
|
+
let o = function() {
|
|
1695
|
+
const d = u.scrollHeight - u.clientHeight, g = Math.ceil(u.scrollTop) < d;
|
|
1696
|
+
i(g);
|
|
1697
|
+
};
|
|
1698
|
+
const u = n.viewport;
|
|
1699
|
+
return o(), u.addEventListener("scroll", o), () => u.removeEventListener("scroll", o);
|
|
1700
|
+
}
|
|
1701
|
+
}, [n.viewport, n.isPositioned]), a ? /* @__PURE__ */ v(
|
|
1702
|
+
fn,
|
|
1703
|
+
{
|
|
1704
|
+
...e,
|
|
1705
|
+
ref: c,
|
|
1706
|
+
onAutoScroll: () => {
|
|
1707
|
+
const { viewport: o, selectedItem: u } = n;
|
|
1708
|
+
o && u && (o.scrollTop = o.scrollTop + u.offsetHeight);
|
|
1709
|
+
}
|
|
1710
|
+
}
|
|
1711
|
+
) : null;
|
|
1712
|
+
});
|
|
1713
|
+
dn.displayName = Ye;
|
|
1714
|
+
var fn = s.forwardRef((e, t) => {
|
|
1715
|
+
const { __scopeSelect: n, onAutoScroll: r, ...a } = e, i = ae("SelectScrollButton", n), c = s.useRef(null), o = Ae(n), u = s.useCallback(() => {
|
|
1716
|
+
c.current !== null && (window.clearInterval(c.current), c.current = null);
|
|
1717
|
+
}, []);
|
|
1718
|
+
return s.useEffect(() => () => u(), [u]), X(() => {
|
|
1719
|
+
var g;
|
|
1720
|
+
const d = o().find((S) => S.ref.current === document.activeElement);
|
|
1721
|
+
(g = d == null ? void 0 : d.ref.current) == null || g.scrollIntoView({ block: "nearest" });
|
|
1722
|
+
}, [o]), /* @__PURE__ */ v(
|
|
1723
|
+
O.div,
|
|
1724
|
+
{
|
|
1725
|
+
"aria-hidden": !0,
|
|
1726
|
+
...a,
|
|
1727
|
+
ref: t,
|
|
1728
|
+
style: { flexShrink: 0, ...a.style },
|
|
1729
|
+
onPointerDown: B(a.onPointerDown, () => {
|
|
1730
|
+
c.current === null && (c.current = window.setInterval(r, 50));
|
|
1731
|
+
}),
|
|
1732
|
+
onPointerMove: B(a.onPointerMove, () => {
|
|
1733
|
+
var d;
|
|
1734
|
+
(d = i.onItemLeave) == null || d.call(i), c.current === null && (c.current = window.setInterval(r, 50));
|
|
1735
|
+
}),
|
|
1736
|
+
onPointerLeave: B(a.onPointerLeave, () => {
|
|
1737
|
+
u();
|
|
1738
|
+
})
|
|
1739
|
+
}
|
|
1740
|
+
);
|
|
1741
|
+
}), xo = "SelectSeparator", _o = s.forwardRef(
|
|
1742
|
+
(e, t) => {
|
|
1743
|
+
const { __scopeSelect: n, ...r } = e;
|
|
1744
|
+
return /* @__PURE__ */ v(O.div, { "aria-hidden": !0, ...r, ref: t });
|
|
1745
|
+
}
|
|
1746
|
+
);
|
|
1747
|
+
_o.displayName = xo;
|
|
1748
|
+
var je = "SelectArrow", Eo = s.forwardRef(
|
|
1749
|
+
(e, t) => {
|
|
1750
|
+
const { __scopeSelect: n, ...r } = e, a = Oe(n), i = oe(je, n), c = ae(je, n);
|
|
1751
|
+
return i.open && c.position === "popper" ? /* @__PURE__ */ v(Nr, { ...a, ...r, ref: t }) : null;
|
|
1752
|
+
}
|
|
1753
|
+
);
|
|
1754
|
+
Eo.displayName = je;
|
|
1755
|
+
function pn(e) {
|
|
1756
|
+
return e === "" || e === void 0;
|
|
1757
|
+
}
|
|
1758
|
+
var mn = s.forwardRef(
|
|
1759
|
+
(e, t) => {
|
|
1760
|
+
const { value: n, ...r } = e, a = s.useRef(null), i = K(t, a), c = Bn(n);
|
|
1761
|
+
return s.useEffect(() => {
|
|
1762
|
+
const o = a.current, u = window.HTMLSelectElement.prototype, g = Object.getOwnPropertyDescriptor(
|
|
1763
|
+
u,
|
|
1764
|
+
"value"
|
|
1765
|
+
).set;
|
|
1766
|
+
if (c !== n && g) {
|
|
1767
|
+
const S = new Event("change", { bubbles: !0 });
|
|
1768
|
+
g.call(o, n), o.dispatchEvent(S);
|
|
1769
|
+
}
|
|
1770
|
+
}, [c, n]), /* @__PURE__ */ v(Bt, { asChild: !0, children: /* @__PURE__ */ v("select", { ...r, ref: i, defaultValue: n }) });
|
|
1771
|
+
}
|
|
1772
|
+
);
|
|
1773
|
+
mn.displayName = "BubbleSelect";
|
|
1774
|
+
function hn(e) {
|
|
1775
|
+
const t = pe(e), n = s.useRef(""), r = s.useRef(0), a = s.useCallback(
|
|
1776
|
+
(c) => {
|
|
1777
|
+
const o = n.current + c;
|
|
1778
|
+
t(o), function u(d) {
|
|
1779
|
+
n.current = d, window.clearTimeout(r.current), d !== "" && (r.current = window.setTimeout(() => u(""), 1e3));
|
|
1780
|
+
}(o);
|
|
1781
|
+
},
|
|
1782
|
+
[t]
|
|
1783
|
+
), i = s.useCallback(() => {
|
|
1784
|
+
n.current = "", window.clearTimeout(r.current);
|
|
1785
|
+
}, []);
|
|
1786
|
+
return s.useEffect(() => () => window.clearTimeout(r.current), []), [n, a, i];
|
|
1787
|
+
}
|
|
1788
|
+
function vn(e, t, n) {
|
|
1789
|
+
const a = t.length > 1 && Array.from(t).every((d) => d === t[0]) ? t[0] : t, i = n ? e.indexOf(n) : -1;
|
|
1790
|
+
let c = Po(e, Math.max(i, 0));
|
|
1791
|
+
a.length === 1 && (c = c.filter((d) => d !== n));
|
|
1792
|
+
const u = c.find(
|
|
1793
|
+
(d) => d.textValue.toLowerCase().startsWith(a.toLowerCase())
|
|
1794
|
+
);
|
|
1795
|
+
return u !== n ? u : void 0;
|
|
1796
|
+
}
|
|
1797
|
+
function Po(e, t) {
|
|
1798
|
+
return e.map((n, r) => e[(t + r) % e.length]);
|
|
1799
|
+
}
|
|
1800
|
+
var Ro = Ut, To = Yt, No = Xt, Io = Gt, Ao = Zt, Oo = qt, Mo = tn, Lo = an, Do = sn, ko = ln, Bo = un, Fo = dn, gn = {
|
|
1801
|
+
color: void 0,
|
|
1802
|
+
size: void 0,
|
|
1803
|
+
className: void 0,
|
|
1804
|
+
style: void 0,
|
|
1805
|
+
attr: void 0
|
|
1806
|
+
}, ft = D.createContext && D.createContext(gn), re = function() {
|
|
1807
|
+
return re = Object.assign || function(e) {
|
|
1808
|
+
for (var t, n = 1, r = arguments.length; n < r; n++) {
|
|
1809
|
+
t = arguments[n];
|
|
1810
|
+
for (var a in t) Object.prototype.hasOwnProperty.call(t, a) && (e[a] = t[a]);
|
|
1811
|
+
}
|
|
1812
|
+
return e;
|
|
1813
|
+
}, re.apply(this, arguments);
|
|
1814
|
+
}, Wo = function(e, t) {
|
|
1815
|
+
var n = {};
|
|
1816
|
+
for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]);
|
|
1817
|
+
if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var a = 0, r = Object.getOwnPropertySymbols(e); a < r.length; a++)
|
|
1818
|
+
t.indexOf(r[a]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[a]) && (n[r[a]] = e[r[a]]);
|
|
1819
|
+
return n;
|
|
1820
|
+
};
|
|
1821
|
+
function Sn(e) {
|
|
1822
|
+
return e && e.map(function(t, n) {
|
|
1823
|
+
return D.createElement(t.tag, re({
|
|
1824
|
+
key: n
|
|
1825
|
+
}, t.attr), Sn(t.child));
|
|
1826
|
+
});
|
|
1827
|
+
}
|
|
1828
|
+
function wn(e) {
|
|
1829
|
+
return function(t) {
|
|
1830
|
+
return D.createElement(zo, re({
|
|
1831
|
+
attr: re({}, e.attr)
|
|
1832
|
+
}, t), Sn(e.child));
|
|
1833
|
+
};
|
|
1834
|
+
}
|
|
1835
|
+
function zo(e) {
|
|
1836
|
+
var t = function(n) {
|
|
1837
|
+
var r = e.attr, a = e.size, i = e.title, c = Wo(e, ["attr", "size", "title"]), o = a || n.size || "1em", u;
|
|
1838
|
+
return n.className && (u = n.className), e.className && (u = (u ? u + " " : "") + e.className), D.createElement("svg", re({
|
|
1839
|
+
stroke: "currentColor",
|
|
1840
|
+
fill: "currentColor",
|
|
1841
|
+
strokeWidth: "0"
|
|
1842
|
+
}, n.attr, r, c, {
|
|
1843
|
+
className: u,
|
|
1844
|
+
style: re(re({
|
|
1845
|
+
color: e.color || n.color
|
|
1846
|
+
}, n.style), e.style),
|
|
1847
|
+
height: o,
|
|
1848
|
+
width: o,
|
|
1849
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
1850
|
+
}), i && D.createElement("title", null, i), e.children);
|
|
1851
|
+
};
|
|
1852
|
+
return ft !== void 0 ? D.createElement(ft.Consumer, null, function(n) {
|
|
1853
|
+
return t(n);
|
|
1854
|
+
}) : t(gn);
|
|
1855
|
+
}
|
|
1856
|
+
function pt(e) {
|
|
1857
|
+
return wn({ tag: "svg", attr: { fill: "currentColor", viewBox: "0 0 16 16" }, child: [{ tag: "path", attr: { fillRule: "evenodd", d: "M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z" } }] })(e);
|
|
1858
|
+
}
|
|
1859
|
+
function Vo(e) {
|
|
1860
|
+
return wn({ tag: "svg", attr: { fill: "currentColor", viewBox: "0 0 16 16" }, child: [{ tag: "path", attr: { fillRule: "evenodd", d: "M7.646 4.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1-.708.708L8 5.707l-5.646 5.647a.5.5 0 0 1-.708-.708l6-6z" } }] })(e);
|
|
1861
|
+
}
|
|
1862
|
+
const Ho = "cfxui__Select__trigger__232e4", $o = "cfxui__Select__fullWidth__739d7", Uo = "cfxui__Select__icon__36b6c", Ko = "cfxui__Select__content__067da", Yo = "cfxui__Select__app__e0114", jo = "cfxui__Select__arrow__8e7eb", Xo = "cfxui__Select__option__2de5d", Go = "cfxui__Select__tickIcon__71e80", j = {
|
|
1863
|
+
trigger: Ho,
|
|
1864
|
+
fullWidth: $o,
|
|
1865
|
+
icon: Uo,
|
|
1866
|
+
content: Ko,
|
|
1867
|
+
app: Yo,
|
|
1868
|
+
arrow: jo,
|
|
1869
|
+
option: Xo,
|
|
1870
|
+
tickIcon: Go,
|
|
1871
|
+
"select-size-initial-large": "cfxui__Select__select-size-initial-large__5e47d",
|
|
1872
|
+
"select-size-initial-small": "cfxui__Select__select-size-initial-small__5ae12",
|
|
1873
|
+
"select-size-small-large": "cfxui__Select__select-size-small-large__79811",
|
|
1874
|
+
"select-size-small-small": "cfxui__Select__select-size-small-small__1c10c",
|
|
1875
|
+
"select-size-small-medium-large": "cfxui__Select__select-size-small-medium-large__0bc35",
|
|
1876
|
+
"select-size-small-medium-small": "cfxui__Select__select-size-small-medium-small__82515",
|
|
1877
|
+
"select-size-medium-large": "cfxui__Select__select-size-medium-large__e0eb0",
|
|
1878
|
+
"select-size-medium-small": "cfxui__Select__select-size-medium-small__2c904",
|
|
1879
|
+
"select-size-medium-large-large": "cfxui__Select__select-size-medium-large-large__a66c1",
|
|
1880
|
+
"select-size-medium-large-small": "cfxui__Select__select-size-medium-large-small__7dce3",
|
|
1881
|
+
"select-size-large-large": "cfxui__Select__select-size-large-large__88062",
|
|
1882
|
+
"select-size-large-small": "cfxui__Select__select-size-large-small__fb50b",
|
|
1883
|
+
"select-size-xlarge-large": "cfxui__Select__select-size-xlarge-large__5abb1",
|
|
1884
|
+
"select-size-xlarge-small": "cfxui__Select__select-size-xlarge-small__5ddbb"
|
|
1885
|
+
}, da = D.forwardRef(function(t) {
|
|
1886
|
+
const {
|
|
1887
|
+
value: n,
|
|
1888
|
+
options: r,
|
|
1889
|
+
onChange: a,
|
|
1890
|
+
size: i = "normal",
|
|
1891
|
+
placeholder: c,
|
|
1892
|
+
disabled: o = !1,
|
|
1893
|
+
fullWidth: u = !1,
|
|
1894
|
+
className: d
|
|
1895
|
+
} = t, [g, S] = D.useState(!1), w = Hn.getResponsiveFlatClassnames("select-size", i).map((l) => j[l]), y = Me(
|
|
1896
|
+
d,
|
|
1897
|
+
j.trigger,
|
|
1898
|
+
w,
|
|
1899
|
+
{
|
|
1900
|
+
[j.disabled]: o,
|
|
1901
|
+
[j.fullWidth]: u
|
|
1902
|
+
}
|
|
1903
|
+
), f = Me(
|
|
1904
|
+
j.content,
|
|
1905
|
+
w
|
|
1906
|
+
);
|
|
1907
|
+
return /* @__PURE__ */ ne(Ro, { value: n, onValueChange: a, onOpenChange: S, open: g, children: [
|
|
1908
|
+
/* @__PURE__ */ ne(To, { disabled: o, className: y, children: [
|
|
1909
|
+
/* @__PURE__ */ v(No, { placeholder: c }),
|
|
1910
|
+
/* @__PURE__ */ v(Io, { className: j.icon, children: /* @__PURE__ */ v(pt, {}) })
|
|
1911
|
+
] }),
|
|
1912
|
+
/* @__PURE__ */ v(Ao, { children: /* @__PURE__ */ ne(Oo, { className: f, children: [
|
|
1913
|
+
/* @__PURE__ */ v(Bo, { className: j.arrow, children: /* @__PURE__ */ v(Vo, {}) }),
|
|
1914
|
+
/* @__PURE__ */ v(Mo, { children: r.map((l) => /* @__PURE__ */ ne(Lo, { value: l.value, className: Me(j.option), children: [
|
|
1915
|
+
/* @__PURE__ */ v(Do, { children: l.label }),
|
|
1916
|
+
/* @__PURE__ */ v(ko, { className: j.indicator, children: /* @__PURE__ */ v(Vn, { name: "Tick", className: j.tickIcon }) })
|
|
1917
|
+
] }, l.value)) }),
|
|
1918
|
+
/* @__PURE__ */ v(Fo, { className: j.arrow, children: /* @__PURE__ */ v(pt, {}) })
|
|
1919
|
+
] }) })
|
|
1920
|
+
] });
|
|
1921
|
+
});
|
|
6
1922
|
export {
|
|
7
|
-
|
|
8
|
-
I as Select
|
|
1923
|
+
da as Select
|
|
9
1924
|
};
|