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