@cfx-dev/ui-components 5.0.14 → 5.0.15
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/{DropdownContent-BMfQCuaP.js → DropdownContent-BqQZ17mb.js} +158 -155
- package/dist/assets/css/DropdownContent.css +1 -1
- package/dist/components/DropdownContent/DropdownContent.d.ts +3 -1
- package/dist/components/DropdownContent/DropdownContent.js +1 -1
- package/dist/components/DropdownContent/index.d.ts +1 -1
- package/dist/components/DropdownContent/index.js +1 -1
- package/dist/components/DropdownMenu/DropdownMenu.js +1 -1
- package/dist/components/DropdownSelect/DropdownSelect.js +1 -1
- package/package.json +1 -1
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { jsx as s } from "react/jsx-runtime";
|
|
2
2
|
import * as a from "react";
|
|
3
3
|
import gn from "react";
|
|
4
|
-
import { c as me, P as N, a as g, b as U, u as ye, g as wn, f as
|
|
4
|
+
import { c as me, P as N, a as g, b as U, u as ye, g as wn, f as _n, h as Pe } from "./index-CfQtbUfi.js";
|
|
5
5
|
import { c as xe, u as Te } from "./index-9LBuZ7x4.js";
|
|
6
|
-
import { u as le, a as ve, c as Ae, h as
|
|
6
|
+
import { u as le, a as ve, c as Ae, h as Mn, b as hn, R as Cn, F as Rn, D as In, C as bn, d as En, A as Sn, e as Dn } from "./Combination-CcTTSYNP.js";
|
|
7
7
|
import { P as ge } from "./index-3ctv5u9o.js";
|
|
8
8
|
import { clsx as Se } from "./utils/clsx.js";
|
|
9
9
|
import { ui as yn } from "./utils/ui/ui.js";
|
|
10
|
-
var de = "rovingFocusGroup.onEntryFocus", Pn = { bubbles: !1, cancelable: !0 },
|
|
11
|
-
|
|
10
|
+
var de = "rovingFocusGroup.onEntryFocus", Pn = { bubbles: !1, cancelable: !0 }, Z = "RovingFocusGroup", [fe, Ne, xn] = xe(Z), [Tn, Oe] = me(
|
|
11
|
+
Z,
|
|
12
12
|
[xn]
|
|
13
|
-
), [An, Nn] = Tn(
|
|
13
|
+
), [An, Nn] = Tn(Z), Fe = a.forwardRef(
|
|
14
14
|
(e, t) => /* @__PURE__ */ s(fe.Provider, { scope: e.__scopeRovingFocusGroup, children: /* @__PURE__ */ s(fe.Slot, { scope: e.__scopeRovingFocusGroup, children: /* @__PURE__ */ s(On, { ...e, ref: t }) }) })
|
|
15
15
|
);
|
|
16
|
-
Fe.displayName =
|
|
16
|
+
Fe.displayName = Z;
|
|
17
17
|
var On = a.forwardRef((e, t) => {
|
|
18
18
|
const {
|
|
19
19
|
__scopeRovingFocusGroup: n,
|
|
@@ -22,16 +22,16 @@ var On = a.forwardRef((e, t) => {
|
|
|
22
22
|
dir: c,
|
|
23
23
|
currentTabStopId: i,
|
|
24
24
|
defaultCurrentTabStopId: l,
|
|
25
|
-
onCurrentTabStopIdChange:
|
|
26
|
-
onEntryFocus:
|
|
25
|
+
onCurrentTabStopIdChange: v,
|
|
26
|
+
onEntryFocus: p,
|
|
27
27
|
preventScrollOnEntryFocus: d = !1,
|
|
28
28
|
...u
|
|
29
|
-
} = e, f = a.useRef(null),
|
|
29
|
+
} = e, f = a.useRef(null), _ = U(t, f), w = Te(c), [b, M] = ye({
|
|
30
30
|
prop: i,
|
|
31
31
|
defaultProp: l ?? null,
|
|
32
|
-
onChange:
|
|
33
|
-
caller:
|
|
34
|
-
}), [R, T] = a.useState(!1), h = ve(
|
|
32
|
+
onChange: v,
|
|
33
|
+
caller: Z
|
|
34
|
+
}), [R, T] = a.useState(!1), h = ve(p), D = Ne(n), B = a.useRef(!1), [Q, O] = a.useState(0);
|
|
35
35
|
return a.useEffect(() => {
|
|
36
36
|
const C = f.current;
|
|
37
37
|
if (C)
|
|
@@ -45,8 +45,8 @@ var On = a.forwardRef((e, t) => {
|
|
|
45
45
|
loop: r,
|
|
46
46
|
currentTabStopId: b,
|
|
47
47
|
onItemFocus: a.useCallback(
|
|
48
|
-
(C) =>
|
|
49
|
-
[
|
|
48
|
+
(C) => M(C),
|
|
49
|
+
[M]
|
|
50
50
|
),
|
|
51
51
|
onItemShiftTab: a.useCallback(() => T(!0), []),
|
|
52
52
|
onFocusableItemAdd: a.useCallback(
|
|
@@ -60,10 +60,10 @@ var On = a.forwardRef((e, t) => {
|
|
|
60
60
|
children: /* @__PURE__ */ s(
|
|
61
61
|
N.div,
|
|
62
62
|
{
|
|
63
|
-
tabIndex: R ||
|
|
63
|
+
tabIndex: R || Q === 0 ? -1 : 0,
|
|
64
64
|
"data-orientation": o,
|
|
65
65
|
...u,
|
|
66
|
-
ref:
|
|
66
|
+
ref: _,
|
|
67
67
|
style: { outline: "none", ...e.style },
|
|
68
68
|
onMouseDown: g(e.onMouseDown, () => {
|
|
69
69
|
B.current = !0;
|
|
@@ -73,7 +73,7 @@ var On = a.forwardRef((e, t) => {
|
|
|
73
73
|
if (C.target === C.currentTarget && G && !R) {
|
|
74
74
|
const F = new CustomEvent(de, Pn);
|
|
75
75
|
if (C.currentTarget.dispatchEvent(F), !F.defaultPrevented) {
|
|
76
|
-
const V = D().filter((P) => P.focusable), W = V.find((P) => P.active),
|
|
76
|
+
const V = D().filter((P) => P.focusable), W = V.find((P) => P.active), ee = V.find((P) => P.id === b), se = [W, ee, ...V].filter(
|
|
77
77
|
Boolean
|
|
78
78
|
).map((P) => P.ref.current);
|
|
79
79
|
Le(se, d);
|
|
@@ -95,15 +95,15 @@ var On = a.forwardRef((e, t) => {
|
|
|
95
95
|
tabStopId: c,
|
|
96
96
|
children: i,
|
|
97
97
|
...l
|
|
98
|
-
} = e,
|
|
98
|
+
} = e, v = le(), p = c || v, d = Nn(ke, n), u = d.currentTabStopId === p, f = Ne(n), { onFocusableItemAdd: _, onFocusableItemRemove: w, currentTabStopId: b } = d;
|
|
99
99
|
return a.useEffect(() => {
|
|
100
100
|
if (o)
|
|
101
|
-
return
|
|
102
|
-
}, [o,
|
|
101
|
+
return _(), () => w();
|
|
102
|
+
}, [o, _, w]), /* @__PURE__ */ s(
|
|
103
103
|
fe.ItemSlot,
|
|
104
104
|
{
|
|
105
105
|
scope: n,
|
|
106
|
-
id:
|
|
106
|
+
id: p,
|
|
107
107
|
focusable: o,
|
|
108
108
|
active: r,
|
|
109
109
|
children: /* @__PURE__ */ s(
|
|
@@ -113,25 +113,25 @@ var On = a.forwardRef((e, t) => {
|
|
|
113
113
|
"data-orientation": d.orientation,
|
|
114
114
|
...l,
|
|
115
115
|
ref: t,
|
|
116
|
-
onMouseDown: g(e.onMouseDown, (
|
|
117
|
-
o ? d.onItemFocus(
|
|
116
|
+
onMouseDown: g(e.onMouseDown, (M) => {
|
|
117
|
+
o ? d.onItemFocus(p) : M.preventDefault();
|
|
118
118
|
}),
|
|
119
|
-
onFocus: g(e.onFocus, () => d.onItemFocus(
|
|
120
|
-
onKeyDown: g(e.onKeyDown, (
|
|
121
|
-
if (
|
|
119
|
+
onFocus: g(e.onFocus, () => d.onItemFocus(p)),
|
|
120
|
+
onKeyDown: g(e.onKeyDown, (M) => {
|
|
121
|
+
if (M.key === "Tab" && M.shiftKey) {
|
|
122
122
|
d.onItemShiftTab();
|
|
123
123
|
return;
|
|
124
124
|
}
|
|
125
|
-
if (
|
|
126
|
-
const R = Gn(
|
|
125
|
+
if (M.target !== M.currentTarget) return;
|
|
126
|
+
const R = Gn(M, d.orientation, d.dir);
|
|
127
127
|
if (R !== void 0) {
|
|
128
|
-
if (
|
|
129
|
-
|
|
128
|
+
if (M.metaKey || M.ctrlKey || M.altKey || M.shiftKey) return;
|
|
129
|
+
M.preventDefault();
|
|
130
130
|
let h = f().filter((D) => D.focusable).map((D) => D.ref.current);
|
|
131
131
|
if (R === "last") h.reverse();
|
|
132
132
|
else if (R === "prev" || R === "next") {
|
|
133
133
|
R === "prev" && h.reverse();
|
|
134
|
-
const D = h.indexOf(
|
|
134
|
+
const D = h.indexOf(M.currentTarget);
|
|
135
135
|
h = d.loop ? Ln(h, D + 1) : h.slice(D + 1);
|
|
136
136
|
}
|
|
137
137
|
setTimeout(() => Le(h));
|
|
@@ -177,18 +177,18 @@ var Kn = Fe, Un = Ge, pe = ["Enter", " "], $n = ["ArrowDown", "PageUp", "Home"],
|
|
|
177
177
|
}, Wn = {
|
|
178
178
|
ltr: ["ArrowLeft"],
|
|
179
179
|
rtl: ["ArrowRight"]
|
|
180
|
-
},
|
|
180
|
+
}, q = "Menu", [j, Yn, Xn] = xe(q), [k, Ue] = me(q, [
|
|
181
181
|
Xn,
|
|
182
182
|
Ae,
|
|
183
183
|
Oe
|
|
184
|
-
]), re = Ae(), $e = Oe(), [Hn, $] = k(
|
|
185
|
-
const { __scopeMenu: t, open: n = !1, children: o, dir: r, onOpenChange: c, modal: i = !0 } = e, l = re(t), [
|
|
184
|
+
]), re = Ae(), $e = Oe(), [Hn, $] = k(q), [jn, J] = k(q), Be = (e) => {
|
|
185
|
+
const { __scopeMenu: t, open: n = !1, children: o, dir: r, onOpenChange: c, modal: i = !0 } = e, l = re(t), [v, p] = a.useState(null), d = a.useRef(!1), u = ve(c), f = Te(r);
|
|
186
186
|
return a.useEffect(() => {
|
|
187
|
-
const
|
|
187
|
+
const _ = () => {
|
|
188
188
|
d.current = !0, document.addEventListener("pointerdown", w, { capture: !0, once: !0 }), document.addEventListener("pointermove", w, { capture: !0, once: !0 });
|
|
189
189
|
}, w = () => d.current = !1;
|
|
190
|
-
return document.addEventListener("keydown",
|
|
191
|
-
document.removeEventListener("keydown",
|
|
190
|
+
return document.addEventListener("keydown", _, { capture: !0 }), () => {
|
|
191
|
+
document.removeEventListener("keydown", _, { capture: !0 }), document.removeEventListener("pointerdown", w, { capture: !0 }), document.removeEventListener("pointermove", w, { capture: !0 });
|
|
192
192
|
};
|
|
193
193
|
}, []), /* @__PURE__ */ s(En, { ...l, children: /* @__PURE__ */ s(
|
|
194
194
|
Hn,
|
|
@@ -196,8 +196,8 @@ var Kn = Fe, Un = Ge, pe = ["Enter", " "], $n = ["ArrowDown", "PageUp", "Home"],
|
|
|
196
196
|
scope: t,
|
|
197
197
|
open: n,
|
|
198
198
|
onOpenChange: u,
|
|
199
|
-
content:
|
|
200
|
-
onContentChange:
|
|
199
|
+
content: v,
|
|
200
|
+
onContentChange: p,
|
|
201
201
|
children: /* @__PURE__ */ s(
|
|
202
202
|
jn,
|
|
203
203
|
{
|
|
@@ -212,7 +212,7 @@ var Kn = Fe, Un = Ge, pe = ["Enter", " "], $n = ["ArrowDown", "PageUp", "Home"],
|
|
|
212
212
|
}
|
|
213
213
|
) });
|
|
214
214
|
};
|
|
215
|
-
Be.displayName =
|
|
215
|
+
Be.displayName = q;
|
|
216
216
|
var zn = "MenuAnchor", we = a.forwardRef(
|
|
217
217
|
(e, t) => {
|
|
218
218
|
const { __scopeMenu: n, ...o } = e, r = re(n);
|
|
@@ -220,21 +220,21 @@ var zn = "MenuAnchor", we = a.forwardRef(
|
|
|
220
220
|
}
|
|
221
221
|
);
|
|
222
222
|
we.displayName = zn;
|
|
223
|
-
var Zn = "MenuPortal", [
|
|
223
|
+
var Zn = "MenuPortal", [vo, Ve] = k(Zn, {
|
|
224
224
|
forceMount: void 0
|
|
225
|
-
}), S = "MenuContent", [qn,
|
|
225
|
+
}), S = "MenuContent", [qn, _e] = k(S), We = a.forwardRef(
|
|
226
226
|
(e, t) => {
|
|
227
|
-
const n = Ve(S, e.__scopeMenu), { forceMount: o = n.forceMount, ...r } = e, c = $(S, e.__scopeMenu), i =
|
|
228
|
-
return /* @__PURE__ */ s(
|
|
227
|
+
const n = Ve(S, e.__scopeMenu), { forceMount: o = n.forceMount, ...r } = e, c = $(S, e.__scopeMenu), i = J(S, e.__scopeMenu);
|
|
228
|
+
return /* @__PURE__ */ s(j.Provider, { scope: e.__scopeMenu, children: /* @__PURE__ */ s(ge, { present: o || c.open, children: /* @__PURE__ */ s(j.Slot, { scope: e.__scopeMenu, children: i.modal ? /* @__PURE__ */ s(Jn, { ...r, ref: t }) : /* @__PURE__ */ s(Qn, { ...r, ref: t }) }) }) });
|
|
229
229
|
}
|
|
230
230
|
), Jn = a.forwardRef(
|
|
231
231
|
(e, t) => {
|
|
232
232
|
const n = $(S, e.__scopeMenu), o = a.useRef(null), r = U(t, o);
|
|
233
233
|
return a.useEffect(() => {
|
|
234
234
|
const c = o.current;
|
|
235
|
-
if (c) return
|
|
235
|
+
if (c) return Mn(c);
|
|
236
236
|
}, []), /* @__PURE__ */ s(
|
|
237
|
-
|
|
237
|
+
Me,
|
|
238
238
|
{
|
|
239
239
|
...e,
|
|
240
240
|
ref: r,
|
|
@@ -253,7 +253,7 @@ var Zn = "MenuPortal", [mo, Ve] = k(Zn, {
|
|
|
253
253
|
), Qn = a.forwardRef((e, t) => {
|
|
254
254
|
const n = $(S, e.__scopeMenu);
|
|
255
255
|
return /* @__PURE__ */ s(
|
|
256
|
-
|
|
256
|
+
Me,
|
|
257
257
|
{
|
|
258
258
|
...e,
|
|
259
259
|
ref: t,
|
|
@@ -263,7 +263,7 @@ var Zn = "MenuPortal", [mo, Ve] = k(Zn, {
|
|
|
263
263
|
onDismiss: () => n.onOpenChange(!1)
|
|
264
264
|
}
|
|
265
265
|
);
|
|
266
|
-
}), et =
|
|
266
|
+
}), et = _n("MenuContent.ScrollLock"), Me = a.forwardRef(
|
|
267
267
|
(e, t) => {
|
|
268
268
|
const {
|
|
269
269
|
__scopeMenu: n,
|
|
@@ -272,25 +272,25 @@ var Zn = "MenuPortal", [mo, Ve] = k(Zn, {
|
|
|
272
272
|
onOpenAutoFocus: c,
|
|
273
273
|
onCloseAutoFocus: i,
|
|
274
274
|
disableOutsidePointerEvents: l,
|
|
275
|
-
onEntryFocus:
|
|
276
|
-
onEscapeKeyDown:
|
|
275
|
+
onEntryFocus: v,
|
|
276
|
+
onEscapeKeyDown: p,
|
|
277
277
|
onPointerDownOutside: d,
|
|
278
278
|
onFocusOutside: u,
|
|
279
279
|
onInteractOutside: f,
|
|
280
|
-
onDismiss:
|
|
280
|
+
onDismiss: _,
|
|
281
281
|
disableOutsideScroll: w,
|
|
282
282
|
...b
|
|
283
|
-
} = e,
|
|
283
|
+
} = e, M = $(S, n), R = J(S, n), T = re(n), h = $e(n), D = Yn(n), [B, Q] = a.useState(null), O = a.useRef(null), C = U(t, O, M.onContentChange), G = a.useRef(0), F = a.useRef(""), V = a.useRef(0), W = a.useRef(null), ee = a.useRef("right"), ne = a.useRef(0), se = w ? Cn : a.Fragment, P = w ? { as: et, allowPinchZoom: !0 } : void 0, vn = (m) => {
|
|
284
284
|
var K, be;
|
|
285
|
-
const E = F.current +
|
|
285
|
+
const E = F.current + m, y = D().filter((x) => !x.disabled), A = document.activeElement, ue = (K = y.find((x) => x.ref.current === A)) == null ? void 0 : K.textValue, ie = y.map((x) => x.textValue), Ie = ft(ie, E, ue), Y = (be = y.find((x) => x.textValue === Ie)) == null ? void 0 : be.ref.current;
|
|
286
286
|
(function x(Ee) {
|
|
287
287
|
F.current = Ee, window.clearTimeout(G.current), Ee !== "" && (G.current = window.setTimeout(() => x(""), 1e3));
|
|
288
288
|
})(E), Y && setTimeout(() => Y.focus());
|
|
289
289
|
};
|
|
290
290
|
a.useEffect(() => () => window.clearTimeout(G.current), []), hn();
|
|
291
|
-
const L = a.useCallback((
|
|
291
|
+
const L = a.useCallback((m) => {
|
|
292
292
|
var y, A;
|
|
293
|
-
return
|
|
293
|
+
return ee.current === ((y = W.current) == null ? void 0 : y.side) && mt(m, (A = W.current) == null ? void 0 : A.area);
|
|
294
294
|
}, []);
|
|
295
295
|
return /* @__PURE__ */ s(
|
|
296
296
|
qn,
|
|
@@ -298,36 +298,36 @@ var Zn = "MenuPortal", [mo, Ve] = k(Zn, {
|
|
|
298
298
|
scope: n,
|
|
299
299
|
searchRef: F,
|
|
300
300
|
onItemEnter: a.useCallback(
|
|
301
|
-
(
|
|
302
|
-
L(
|
|
301
|
+
(m) => {
|
|
302
|
+
L(m) && m.preventDefault();
|
|
303
303
|
},
|
|
304
304
|
[L]
|
|
305
305
|
),
|
|
306
306
|
onItemLeave: a.useCallback(
|
|
307
|
-
(
|
|
307
|
+
(m) => {
|
|
308
308
|
var E;
|
|
309
|
-
L(
|
|
309
|
+
L(m) || ((E = O.current) == null || E.focus(), Q(null));
|
|
310
310
|
},
|
|
311
311
|
[L]
|
|
312
312
|
),
|
|
313
313
|
onTriggerLeave: a.useCallback(
|
|
314
|
-
(
|
|
315
|
-
L(
|
|
314
|
+
(m) => {
|
|
315
|
+
L(m) && m.preventDefault();
|
|
316
316
|
},
|
|
317
317
|
[L]
|
|
318
318
|
),
|
|
319
319
|
pointerGraceTimerRef: V,
|
|
320
|
-
onPointerGraceIntentChange: a.useCallback((
|
|
321
|
-
W.current =
|
|
320
|
+
onPointerGraceIntentChange: a.useCallback((m) => {
|
|
321
|
+
W.current = m;
|
|
322
322
|
}, []),
|
|
323
323
|
children: /* @__PURE__ */ s(se, { ...P, children: /* @__PURE__ */ s(
|
|
324
324
|
Rn,
|
|
325
325
|
{
|
|
326
326
|
asChild: !0,
|
|
327
327
|
trapped: r,
|
|
328
|
-
onMountAutoFocus: g(c, (
|
|
328
|
+
onMountAutoFocus: g(c, (m) => {
|
|
329
329
|
var E;
|
|
330
|
-
|
|
330
|
+
m.preventDefault(), (E = O.current) == null || E.focus({ preventScroll: !0 });
|
|
331
331
|
}),
|
|
332
332
|
onUnmountAutoFocus: i,
|
|
333
333
|
children: /* @__PURE__ */ s(
|
|
@@ -335,11 +335,11 @@ var Zn = "MenuPortal", [mo, Ve] = k(Zn, {
|
|
|
335
335
|
{
|
|
336
336
|
asChild: !0,
|
|
337
337
|
disableOutsidePointerEvents: l,
|
|
338
|
-
onEscapeKeyDown:
|
|
338
|
+
onEscapeKeyDown: p,
|
|
339
339
|
onPointerDownOutside: d,
|
|
340
340
|
onFocusOutside: u,
|
|
341
341
|
onInteractOutside: f,
|
|
342
|
-
onDismiss:
|
|
342
|
+
onDismiss: _,
|
|
343
343
|
children: /* @__PURE__ */ s(
|
|
344
344
|
Kn,
|
|
345
345
|
{
|
|
@@ -349,9 +349,9 @@ var Zn = "MenuPortal", [mo, Ve] = k(Zn, {
|
|
|
349
349
|
orientation: "vertical",
|
|
350
350
|
loop: o,
|
|
351
351
|
currentTabStopId: B,
|
|
352
|
-
onCurrentTabStopIdChange:
|
|
353
|
-
onEntryFocus: g(
|
|
354
|
-
R.isUsingKeyboardRef.current ||
|
|
352
|
+
onCurrentTabStopIdChange: Q,
|
|
353
|
+
onEntryFocus: g(v, (m) => {
|
|
354
|
+
R.isUsingKeyboardRef.current || m.preventDefault();
|
|
355
355
|
}),
|
|
356
356
|
preventScrollOnEntryFocus: !0,
|
|
357
357
|
children: /* @__PURE__ */ s(
|
|
@@ -359,32 +359,32 @@ var Zn = "MenuPortal", [mo, Ve] = k(Zn, {
|
|
|
359
359
|
{
|
|
360
360
|
role: "menu",
|
|
361
361
|
"aria-orientation": "vertical",
|
|
362
|
-
"data-state": cn(
|
|
362
|
+
"data-state": cn(M.open),
|
|
363
363
|
"data-radix-menu-content": "",
|
|
364
364
|
dir: R.dir,
|
|
365
365
|
...T,
|
|
366
366
|
...b,
|
|
367
367
|
ref: C,
|
|
368
368
|
style: { outline: "none", ...b.style },
|
|
369
|
-
onKeyDown: g(b.onKeyDown, (
|
|
370
|
-
const y =
|
|
371
|
-
y && (
|
|
369
|
+
onKeyDown: g(b.onKeyDown, (m) => {
|
|
370
|
+
const y = m.target.closest("[data-radix-menu-content]") === m.currentTarget, A = m.ctrlKey || m.altKey || m.metaKey, ue = m.key.length === 1;
|
|
371
|
+
y && (m.key === "Tab" && m.preventDefault(), !A && ue && vn(m.key));
|
|
372
372
|
const ie = O.current;
|
|
373
|
-
if (
|
|
374
|
-
|
|
373
|
+
if (m.target !== ie || !Bn.includes(m.key)) return;
|
|
374
|
+
m.preventDefault();
|
|
375
375
|
const Y = D().filter((K) => !K.disabled).map((K) => K.ref.current);
|
|
376
|
-
Ke.includes(
|
|
376
|
+
Ke.includes(m.key) && Y.reverse(), dt(Y);
|
|
377
377
|
}),
|
|
378
|
-
onBlur: g(e.onBlur, (
|
|
379
|
-
|
|
378
|
+
onBlur: g(e.onBlur, (m) => {
|
|
379
|
+
m.currentTarget.contains(m.target) || (window.clearTimeout(G.current), F.current = "");
|
|
380
380
|
}),
|
|
381
381
|
onPointerMove: g(
|
|
382
382
|
e.onPointerMove,
|
|
383
|
-
|
|
384
|
-
const E =
|
|
385
|
-
if (
|
|
386
|
-
const A =
|
|
387
|
-
|
|
383
|
+
z((m) => {
|
|
384
|
+
const E = m.target, y = ne.current !== m.clientX;
|
|
385
|
+
if (m.currentTarget.contains(E) && y) {
|
|
386
|
+
const A = m.clientX > ne.current ? "right" : "left";
|
|
387
|
+
ee.current = A, ne.current = m.clientX;
|
|
388
388
|
}
|
|
389
389
|
})
|
|
390
390
|
)
|
|
@@ -417,27 +417,27 @@ var tt = "MenuLabel", Ye = a.forwardRef(
|
|
|
417
417
|
Ye.displayName = tt;
|
|
418
418
|
var te = "MenuItem", De = "menu.itemSelect", ae = a.forwardRef(
|
|
419
419
|
(e, t) => {
|
|
420
|
-
const { disabled: n = !1, onSelect: o, ...r } = e, c = a.useRef(null), i =
|
|
420
|
+
const { disabled: n = !1, onSelect: o, ...r } = e, c = a.useRef(null), i = J(te, e.__scopeMenu), l = _e(te, e.__scopeMenu), v = U(t, c), p = a.useRef(!1), d = () => {
|
|
421
421
|
const u = c.current;
|
|
422
422
|
if (!n && u) {
|
|
423
423
|
const f = new CustomEvent(De, { bubbles: !0, cancelable: !0 });
|
|
424
|
-
u.addEventListener(De, (
|
|
424
|
+
u.addEventListener(De, (_) => o == null ? void 0 : o(_), { once: !0 }), wn(u, f), f.defaultPrevented ? p.current = !1 : i.onClose();
|
|
425
425
|
}
|
|
426
426
|
};
|
|
427
427
|
return /* @__PURE__ */ s(
|
|
428
428
|
Xe,
|
|
429
429
|
{
|
|
430
430
|
...r,
|
|
431
|
-
ref:
|
|
431
|
+
ref: v,
|
|
432
432
|
disabled: n,
|
|
433
433
|
onClick: g(e.onClick, d),
|
|
434
434
|
onPointerDown: (u) => {
|
|
435
435
|
var f;
|
|
436
|
-
(f = e.onPointerDown) == null || f.call(e, u),
|
|
436
|
+
(f = e.onPointerDown) == null || f.call(e, u), p.current = !0;
|
|
437
437
|
},
|
|
438
438
|
onPointerUp: g(e.onPointerUp, (u) => {
|
|
439
439
|
var f;
|
|
440
|
-
|
|
440
|
+
p.current || (f = u.currentTarget) == null || f.click();
|
|
441
441
|
}),
|
|
442
442
|
onKeyDown: g(e.onKeyDown, (u) => {
|
|
443
443
|
const f = l.searchRef.current !== "";
|
|
@@ -450,12 +450,12 @@ var te = "MenuItem", De = "menu.itemSelect", ae = a.forwardRef(
|
|
|
450
450
|
ae.displayName = te;
|
|
451
451
|
var Xe = a.forwardRef(
|
|
452
452
|
(e, t) => {
|
|
453
|
-
const { __scopeMenu: n, disabled: o = !1, textValue: r, ...c } = e, i =
|
|
453
|
+
const { __scopeMenu: n, disabled: o = !1, textValue: r, ...c } = e, i = _e(te, n), l = $e(n), v = a.useRef(null), p = U(t, v), [d, u] = a.useState(!1), [f, _] = a.useState("");
|
|
454
454
|
return a.useEffect(() => {
|
|
455
|
-
const w =
|
|
456
|
-
w &&
|
|
455
|
+
const w = v.current;
|
|
456
|
+
w && _((w.textContent ?? "").trim());
|
|
457
457
|
}, [c.children]), /* @__PURE__ */ s(
|
|
458
|
-
|
|
458
|
+
j.ItemSlot,
|
|
459
459
|
{
|
|
460
460
|
scope: n,
|
|
461
461
|
disabled: o,
|
|
@@ -468,16 +468,16 @@ var Xe = a.forwardRef(
|
|
|
468
468
|
"aria-disabled": o || void 0,
|
|
469
469
|
"data-disabled": o ? "" : void 0,
|
|
470
470
|
...c,
|
|
471
|
-
ref:
|
|
471
|
+
ref: p,
|
|
472
472
|
onPointerMove: g(
|
|
473
473
|
e.onPointerMove,
|
|
474
|
-
|
|
474
|
+
z((w) => {
|
|
475
475
|
o ? i.onItemLeave(w) : (i.onItemEnter(w), w.defaultPrevented || w.currentTarget.focus({ preventScroll: !0 }));
|
|
476
476
|
})
|
|
477
477
|
),
|
|
478
478
|
onPointerLeave: g(
|
|
479
479
|
e.onPointerLeave,
|
|
480
|
-
|
|
480
|
+
z((w) => i.onItemLeave(w))
|
|
481
481
|
),
|
|
482
482
|
onFocus: g(e.onFocus, () => u(!0)),
|
|
483
483
|
onBlur: g(e.onBlur, () => u(!1))
|
|
@@ -587,17 +587,17 @@ var ut = "MenuArrow", nn = a.forwardRef(
|
|
|
587
587
|
}
|
|
588
588
|
);
|
|
589
589
|
nn.displayName = ut;
|
|
590
|
-
var it = "MenuSub", [
|
|
590
|
+
var it = "MenuSub", [go, tn] = k(it), H = "MenuSubTrigger", on = a.forwardRef(
|
|
591
591
|
(e, t) => {
|
|
592
|
-
const n = $(
|
|
592
|
+
const n = $(H, e.__scopeMenu), o = J(H, e.__scopeMenu), r = tn(H, e.__scopeMenu), c = _e(H, e.__scopeMenu), i = a.useRef(null), { pointerGraceTimerRef: l, onPointerGraceIntentChange: v } = c, p = { __scopeMenu: e.__scopeMenu }, d = a.useCallback(() => {
|
|
593
593
|
i.current && window.clearTimeout(i.current), i.current = null;
|
|
594
594
|
}, []);
|
|
595
595
|
return a.useEffect(() => d, [d]), a.useEffect(() => {
|
|
596
596
|
const u = l.current;
|
|
597
597
|
return () => {
|
|
598
|
-
window.clearTimeout(u),
|
|
598
|
+
window.clearTimeout(u), v(null);
|
|
599
599
|
};
|
|
600
|
-
}, [l,
|
|
600
|
+
}, [l, v]), /* @__PURE__ */ s(we, { asChild: !0, ...p, children: /* @__PURE__ */ s(
|
|
601
601
|
Xe,
|
|
602
602
|
{
|
|
603
603
|
id: r.triggerId,
|
|
@@ -613,7 +613,7 @@ var it = "MenuSub", [vo, tn] = k(it), X = "MenuSubTrigger", on = a.forwardRef(
|
|
|
613
613
|
},
|
|
614
614
|
onPointerMove: g(
|
|
615
615
|
e.onPointerMove,
|
|
616
|
-
|
|
616
|
+
z((u) => {
|
|
617
617
|
c.onItemEnter(u), !u.defaultPrevented && !e.disabled && !n.open && !i.current && (c.onPointerGraceIntentChange(null), i.current = window.setTimeout(() => {
|
|
618
618
|
n.onOpenChange(!0), d();
|
|
619
619
|
}, 100));
|
|
@@ -621,12 +621,12 @@ var it = "MenuSub", [vo, tn] = k(it), X = "MenuSubTrigger", on = a.forwardRef(
|
|
|
621
621
|
),
|
|
622
622
|
onPointerLeave: g(
|
|
623
623
|
e.onPointerLeave,
|
|
624
|
-
|
|
625
|
-
var
|
|
624
|
+
z((u) => {
|
|
625
|
+
var _, w;
|
|
626
626
|
d();
|
|
627
|
-
const f = (
|
|
627
|
+
const f = (_ = n.content) == null ? void 0 : _.getBoundingClientRect();
|
|
628
628
|
if (f) {
|
|
629
|
-
const b = (w = n.content) == null ? void 0 : w.dataset.side,
|
|
629
|
+
const b = (w = n.content) == null ? void 0 : w.dataset.side, M = b === "right", R = M ? -5 : 5, T = f[M ? "left" : "right"], h = f[M ? "right" : "left"];
|
|
630
630
|
c.onPointerGraceIntentChange({
|
|
631
631
|
area: [
|
|
632
632
|
// Apply a bleed on clientX to ensure that our exit point is
|
|
@@ -649,25 +649,25 @@ var it = "MenuSub", [vo, tn] = k(it), X = "MenuSubTrigger", on = a.forwardRef(
|
|
|
649
649
|
})
|
|
650
650
|
),
|
|
651
651
|
onKeyDown: g(e.onKeyDown, (u) => {
|
|
652
|
-
var
|
|
652
|
+
var _;
|
|
653
653
|
const f = c.searchRef.current !== "";
|
|
654
|
-
e.disabled || f && u.key === " " || Vn[o.dir].includes(u.key) && (n.onOpenChange(!0), (
|
|
654
|
+
e.disabled || f && u.key === " " || Vn[o.dir].includes(u.key) && (n.onOpenChange(!0), (_ = n.content) == null || _.focus(), u.preventDefault());
|
|
655
655
|
})
|
|
656
656
|
}
|
|
657
657
|
) });
|
|
658
658
|
}
|
|
659
659
|
);
|
|
660
|
-
on.displayName =
|
|
660
|
+
on.displayName = H;
|
|
661
661
|
var rn = "MenuSubContent", an = a.forwardRef(
|
|
662
662
|
(e, t) => {
|
|
663
|
-
const n = Ve(S, e.__scopeMenu), { forceMount: o = n.forceMount, ...r } = e, c = $(S, e.__scopeMenu), i =
|
|
664
|
-
return /* @__PURE__ */ s(
|
|
665
|
-
|
|
663
|
+
const n = Ve(S, e.__scopeMenu), { forceMount: o = n.forceMount, ...r } = e, c = $(S, e.__scopeMenu), i = J(S, e.__scopeMenu), l = tn(rn, e.__scopeMenu), v = a.useRef(null), p = U(t, v);
|
|
664
|
+
return /* @__PURE__ */ s(j.Provider, { scope: e.__scopeMenu, children: /* @__PURE__ */ s(ge, { present: o || c.open, children: /* @__PURE__ */ s(j.Slot, { scope: e.__scopeMenu, children: /* @__PURE__ */ s(
|
|
665
|
+
Me,
|
|
666
666
|
{
|
|
667
667
|
id: l.contentId,
|
|
668
668
|
"aria-labelledby": l.triggerId,
|
|
669
669
|
...r,
|
|
670
|
-
ref:
|
|
670
|
+
ref: p,
|
|
671
671
|
align: "start",
|
|
672
672
|
side: i.dir === "rtl" ? "left" : "right",
|
|
673
673
|
disableOutsidePointerEvents: !1,
|
|
@@ -675,7 +675,7 @@ var rn = "MenuSubContent", an = a.forwardRef(
|
|
|
675
675
|
trapFocus: !1,
|
|
676
676
|
onOpenAutoFocus: (d) => {
|
|
677
677
|
var u;
|
|
678
|
-
i.isUsingKeyboardRef.current && ((u =
|
|
678
|
+
i.isUsingKeyboardRef.current && ((u = v.current) == null || u.focus()), d.preventDefault();
|
|
679
679
|
},
|
|
680
680
|
onCloseAutoFocus: (d) => d.preventDefault(),
|
|
681
681
|
onFocusOutside: g(e.onFocusOutside, (d) => {
|
|
@@ -685,9 +685,9 @@ var rn = "MenuSubContent", an = a.forwardRef(
|
|
|
685
685
|
i.onClose(), d.preventDefault();
|
|
686
686
|
}),
|
|
687
687
|
onKeyDown: g(e.onKeyDown, (d) => {
|
|
688
|
-
var
|
|
688
|
+
var _;
|
|
689
689
|
const u = d.currentTarget.contains(d.target), f = Wn[i.dir].includes(d.key);
|
|
690
|
-
u && f && (c.onOpenChange(!1), (
|
|
690
|
+
u && f && (c.onOpenChange(!1), (_ = l.trigger) == null || _.focus(), d.preventDefault());
|
|
691
691
|
})
|
|
692
692
|
}
|
|
693
693
|
) }) }) });
|
|
@@ -712,20 +712,20 @@ function lt(e, t) {
|
|
|
712
712
|
return e.map((n, o) => e[(t + o) % e.length]);
|
|
713
713
|
}
|
|
714
714
|
function ft(e, t, n) {
|
|
715
|
-
const r = t.length > 1 && Array.from(t).every((
|
|
715
|
+
const r = t.length > 1 && Array.from(t).every((p) => p === t[0]) ? t[0] : t, c = n ? e.indexOf(n) : -1;
|
|
716
716
|
let i = lt(e, Math.max(c, 0));
|
|
717
|
-
r.length === 1 && (i = i.filter((
|
|
718
|
-
const
|
|
719
|
-
(
|
|
717
|
+
r.length === 1 && (i = i.filter((p) => p !== n));
|
|
718
|
+
const v = i.find(
|
|
719
|
+
(p) => p.toLowerCase().startsWith(r.toLowerCase())
|
|
720
720
|
);
|
|
721
|
-
return
|
|
721
|
+
return v !== n ? v : void 0;
|
|
722
722
|
}
|
|
723
723
|
function pt(e, t) {
|
|
724
724
|
const { x: n, y: o } = e;
|
|
725
725
|
let r = !1;
|
|
726
726
|
for (let c = 0, i = t.length - 1; c < t.length; i = c++) {
|
|
727
|
-
const l = t[c],
|
|
728
|
-
d > o != f > o && n < (u -
|
|
727
|
+
const l = t[c], v = t[i], p = l.x, d = l.y, u = v.x, f = v.y;
|
|
728
|
+
d > o != f > o && n < (u - p) * (o - d) / (f - d) + p && (r = !r);
|
|
729
729
|
}
|
|
730
730
|
return r;
|
|
731
731
|
}
|
|
@@ -734,10 +734,10 @@ function mt(e, t) {
|
|
|
734
734
|
const n = { x: e.clientX, y: e.clientY };
|
|
735
735
|
return pt(n, t);
|
|
736
736
|
}
|
|
737
|
-
function
|
|
737
|
+
function z(e) {
|
|
738
738
|
return (t) => t.pointerType === "mouse" ? e(t) : void 0;
|
|
739
739
|
}
|
|
740
|
-
var vt = Be, gt = we, wt = We,
|
|
740
|
+
var vt = Be, gt = we, wt = We, _t = he, Mt = Ye, ht = ae, Ct = He, Rt = ze, It = qe, bt = Qe, Et = en, St = nn, Dt = on, yt = an, ce = "DropdownMenu", [Pt, wo] = me(
|
|
741
741
|
ce,
|
|
742
742
|
[Ue]
|
|
743
743
|
), I = Ue(), [xt, sn] = Pt(ce), un = (e) => {
|
|
@@ -749,7 +749,7 @@ var vt = Be, gt = we, wt = We, Mt = he, _t = Ye, ht = ae, Ct = He, Rt = ze, It =
|
|
|
749
749
|
defaultOpen: c,
|
|
750
750
|
onOpenChange: i,
|
|
751
751
|
modal: l = !0
|
|
752
|
-
} = e,
|
|
752
|
+
} = e, v = I(t), p = a.useRef(null), [d, u] = ye({
|
|
753
753
|
prop: r,
|
|
754
754
|
defaultProp: c ?? !1,
|
|
755
755
|
onChange: i,
|
|
@@ -760,13 +760,13 @@ var vt = Be, gt = we, wt = We, Mt = he, _t = Ye, ht = ae, Ct = He, Rt = ze, It =
|
|
|
760
760
|
{
|
|
761
761
|
scope: t,
|
|
762
762
|
triggerId: le(),
|
|
763
|
-
triggerRef:
|
|
763
|
+
triggerRef: p,
|
|
764
764
|
contentId: le(),
|
|
765
765
|
open: d,
|
|
766
766
|
onOpenChange: u,
|
|
767
767
|
onOpenToggle: a.useCallback(() => u((f) => !f), [u]),
|
|
768
768
|
modal: l,
|
|
769
|
-
children: /* @__PURE__ */ s(vt, { ...
|
|
769
|
+
children: /* @__PURE__ */ s(vt, { ...v, open: d, onOpenChange: u, dir: o, modal: l, children: n })
|
|
770
770
|
}
|
|
771
771
|
);
|
|
772
772
|
};
|
|
@@ -810,11 +810,11 @@ var fn = "DropdownMenuContent", pn = a.forwardRef(
|
|
|
810
810
|
...o,
|
|
811
811
|
ref: t,
|
|
812
812
|
onCloseAutoFocus: g(e.onCloseAutoFocus, (l) => {
|
|
813
|
-
var
|
|
814
|
-
i.current || (
|
|
813
|
+
var v;
|
|
814
|
+
i.current || (v = r.triggerRef.current) == null || v.focus(), i.current = !1, l.preventDefault();
|
|
815
815
|
}),
|
|
816
816
|
onInteractOutside: g(e.onInteractOutside, (l) => {
|
|
817
|
-
const
|
|
817
|
+
const v = l.detail.originalEvent, p = v.button === 0 && v.ctrlKey === !0, d = v.button === 2 || p;
|
|
818
818
|
(!r.modal || d) && (i.current = !0);
|
|
819
819
|
}),
|
|
820
820
|
style: {
|
|
@@ -833,14 +833,14 @@ pn.displayName = fn;
|
|
|
833
833
|
var Tt = "DropdownMenuGroup", At = a.forwardRef(
|
|
834
834
|
(e, t) => {
|
|
835
835
|
const { __scopeDropdownMenu: n, ...o } = e, r = I(n);
|
|
836
|
-
return /* @__PURE__ */ s(
|
|
836
|
+
return /* @__PURE__ */ s(_t, { ...r, ...o, ref: t });
|
|
837
837
|
}
|
|
838
838
|
);
|
|
839
839
|
At.displayName = Tt;
|
|
840
840
|
var Nt = "DropdownMenuLabel", Ot = a.forwardRef(
|
|
841
841
|
(e, t) => {
|
|
842
842
|
const { __scopeDropdownMenu: n, ...o } = e, r = I(n);
|
|
843
|
-
return /* @__PURE__ */ s(
|
|
843
|
+
return /* @__PURE__ */ s(Mt, { ...r, ...o, ref: t });
|
|
844
844
|
}
|
|
845
845
|
);
|
|
846
846
|
Ot.displayName = Nt;
|
|
@@ -908,26 +908,28 @@ var Zt = "DropdownMenuSubContent", qt = a.forwardRef((e, t) => {
|
|
|
908
908
|
);
|
|
909
909
|
});
|
|
910
910
|
qt.displayName = Zt;
|
|
911
|
-
var
|
|
912
|
-
const eo = "cfxui__DropdownContent__fullWidth__c56c3", no = "cfxui__DropdownContent__item__8feac", to = "cfxui__DropdownContent__content__ea3aa", oo = "cfxui__DropdownContent__disabled__9002a",
|
|
911
|
+
var _o = un, Mo = ln, Jt = pn, Qt = mn;
|
|
912
|
+
const eo = "cfxui__DropdownContent__fullWidth__c56c3", no = "cfxui__DropdownContent__item__8feac", to = "cfxui__DropdownContent__content__ea3aa", oo = "cfxui__DropdownContent__disabled__9002a", ro = "cfxui__DropdownContent__selected__91015", X = {
|
|
913
913
|
fullWidth: eo,
|
|
914
914
|
item: no,
|
|
915
915
|
content: to,
|
|
916
|
-
disabled: oo
|
|
916
|
+
disabled: oo,
|
|
917
|
+
selected: ro
|
|
917
918
|
};
|
|
918
|
-
function
|
|
919
|
+
function ao(e) {
|
|
919
920
|
const {
|
|
920
921
|
triggerWidth: t,
|
|
921
922
|
options: n,
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
923
|
+
selectedValue: o,
|
|
924
|
+
fullWidth: r = !1,
|
|
925
|
+
className: c,
|
|
926
|
+
itemClassName: i,
|
|
927
|
+
onSelect: l
|
|
928
|
+
} = e, v = Se(
|
|
929
|
+
c,
|
|
930
|
+
X.content,
|
|
929
931
|
{
|
|
930
|
-
[
|
|
932
|
+
[X.fullWidth]: r
|
|
931
933
|
}
|
|
932
934
|
);
|
|
933
935
|
return /* @__PURE__ */ s(
|
|
@@ -935,30 +937,31 @@ function ro(e) {
|
|
|
935
937
|
{
|
|
936
938
|
align: "end",
|
|
937
939
|
side: "bottom",
|
|
938
|
-
className:
|
|
940
|
+
className: v,
|
|
939
941
|
style: {
|
|
940
942
|
width: t,
|
|
941
943
|
zIndex: yn.zindex("max")
|
|
942
944
|
},
|
|
943
|
-
children: n.map((
|
|
945
|
+
children: n.map((p) => /* @__PURE__ */ s(
|
|
944
946
|
Qt,
|
|
945
947
|
{
|
|
946
|
-
disabled:
|
|
947
|
-
className: Se(
|
|
948
|
-
[
|
|
948
|
+
disabled: p.disabled,
|
|
949
|
+
className: Se(X.item, i, {
|
|
950
|
+
[X.disabled]: p.disabled,
|
|
951
|
+
[X.selected]: p.value === o
|
|
949
952
|
}),
|
|
950
|
-
onSelect: () =>
|
|
953
|
+
onSelect: () => l(p.value),
|
|
951
954
|
style: { width: t },
|
|
952
|
-
children:
|
|
955
|
+
children: p.label
|
|
953
956
|
},
|
|
954
|
-
|
|
957
|
+
p.value
|
|
955
958
|
))
|
|
956
959
|
}
|
|
957
960
|
);
|
|
958
961
|
}
|
|
959
|
-
const
|
|
962
|
+
const ho = gn.memo(ao);
|
|
960
963
|
export {
|
|
961
|
-
|
|
962
|
-
|
|
964
|
+
ho as D,
|
|
965
|
+
_o as R,
|
|
963
966
|
Mo as T
|
|
964
967
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.cfxui__DropdownContent__fullWidth__c56c3{width:100%}.cfxui__DropdownContent__fullWidth__c56c3 .cfxui__DropdownContent__item__8feac{width:100%;padding-left:calc(var(--quant) * 2.5);padding-right:calc(var(--quant) * 2.5)}.cfxui__DropdownContent__content__ea3aa{--border-color: var(--color-input-border);border-radius:var(--border-radius-medium);box-shadow:0 0 0 var(--input-border-size, initial) var(--border-color) inset;background-color:rgba(var(--color-bg),1);overflow:hidden}.cfxui__DropdownContent__content__ea3aa.cfxui__DropdownContent__onlight__352dc{--border-color: var(--color-input-onlight-border)}.cfxui__DropdownContent__content__ea3aa .cfxui__DropdownContent__item__8feac{height:var(--button-height, initial);display:flex;align-items:center;padding:calc(var(--quant) * 2) var(--spacer-xsmall) calc(var(--quant) * 2) var(--spacer-xsmall);cursor:pointer}.cfxui__DropdownContent__content__ea3aa .cfxui__DropdownContent__item__8feac:not(:last-child){box-shadow:0 calc(-1 * var(--input-border-size, initial)) 0 0 var(--border-color) inset}.cfxui__DropdownContent__content__ea3aa .cfxui__DropdownContent__item__8feac:hover:not(.cfxui__DropdownContent__disabled__9002a){background-color:rgba(var(--color-bg-light),1)}.cfxui__DropdownContent__content__ea3aa .cfxui__DropdownContent__item__8feac.cfxui__DropdownContent__disabled__9002a{cursor:not-allowed;color:rgba(var(--color-secondary),1);background-color:rgba(var(--color-bg-dark),.5)}
|
|
1
|
+
.cfxui__DropdownContent__fullWidth__c56c3{width:100%}.cfxui__DropdownContent__fullWidth__c56c3 .cfxui__DropdownContent__item__8feac{width:100%;padding-left:calc(var(--quant) * 2.5);padding-right:calc(var(--quant) * 2.5)}.cfxui__DropdownContent__content__ea3aa{--border-color: var(--color-input-border);border-radius:var(--border-radius-medium);box-shadow:0 0 0 var(--input-border-size, initial) var(--border-color) inset;background-color:rgba(var(--color-bg),1);overflow:hidden}.cfxui__DropdownContent__content__ea3aa.cfxui__DropdownContent__onlight__352dc{--border-color: var(--color-input-onlight-border)}.cfxui__DropdownContent__content__ea3aa .cfxui__DropdownContent__item__8feac{height:var(--button-height, initial);display:flex;align-items:center;padding:calc(var(--quant) * 2) var(--spacer-xsmall) calc(var(--quant) * 2) var(--spacer-xsmall);cursor:pointer}.cfxui__DropdownContent__content__ea3aa .cfxui__DropdownContent__item__8feac:not(:last-child){box-shadow:0 calc(-1 * var(--input-border-size, initial)) 0 0 var(--border-color) inset}.cfxui__DropdownContent__content__ea3aa .cfxui__DropdownContent__item__8feac:hover:not(.cfxui__DropdownContent__disabled__9002a,.cfxui__DropdownContent__selected__91015){background-color:rgba(var(--color-bg-light),1)}.cfxui__DropdownContent__content__ea3aa .cfxui__DropdownContent__item__8feac.cfxui__DropdownContent__disabled__9002a{cursor:not-allowed;color:rgba(var(--color-secondary),1);background-color:rgba(var(--color-bg-dark),.5)}.cfxui__DropdownContent__content__ea3aa .cfxui__DropdownContent__item__8feac.cfxui__DropdownContent__selected__91015{background-color:rgba(var(--color-secondary),.5);font-weight:var(--font-weight-bold)}
|
|
@@ -6,9 +6,11 @@ export interface DropdownOption<T extends string> {
|
|
|
6
6
|
disabled?: boolean;
|
|
7
7
|
}
|
|
8
8
|
export type ExtraClassNameType = 'content' | 'trigger';
|
|
9
|
-
export type
|
|
9
|
+
export type DropdownOptionValueType = string;
|
|
10
|
+
export type DropdownContentOption = DropdownOption<DropdownOptionValueType>;
|
|
10
11
|
export interface DropdownContentProps {
|
|
11
12
|
options: DropdownContentOption[];
|
|
13
|
+
selectedValue?: DropdownOptionValueType;
|
|
12
14
|
className?: string;
|
|
13
15
|
itemClassName?: string;
|
|
14
16
|
triggerWidth?: React.CSSProperties['width'];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { default as DropdownContent } from './DropdownContent';
|
|
2
|
-
export type { DropdownContentProps, DropdownContentOption, } from './DropdownContent';
|
|
2
|
+
export type { DropdownContentProps, DropdownContentOption, DropdownOptionValueType, } from './DropdownContent';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs as f, jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import { R as D, T as W, D as C } from "../../DropdownContent-
|
|
2
|
+
import { R as D, T as W, D as C } from "../../DropdownContent-BqQZ17mb.js";
|
|
3
3
|
import a, { useRef as R, useState as v, useEffect as b } from "react";
|
|
4
4
|
import N from "../Flex/Flex.js";
|
|
5
5
|
import { clsx as T } from "../../utils/clsx.js";
|