ics-ui-kit 0.1.0-alpha.12 → 0.1.0-alpha.13
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/Button-DQtBfU9y.js +57 -0
- package/dist/Button-DQtBfU9y.js.map +1 -0
- package/dist/{Button-DhfE69q0.js → ButtonBase-BEM8SNmT.js} +27 -56
- package/dist/ButtonBase-BEM8SNmT.js.map +1 -0
- package/dist/CarouselItem-pSHe0ufN.js +1500 -0
- package/dist/CarouselItem-pSHe0ufN.js.map +1 -0
- package/dist/CheckboxField-i_-dPpFM.js +370 -0
- package/dist/CheckboxField-i_-dPpFM.js.map +1 -0
- package/dist/Divider-C0Ss5GJT.js +47 -0
- package/dist/{Divider-D3NvaU8c.js.map → Divider-C0Ss5GJT.js.map} +1 -1
- package/dist/Field-3XJNFTql.js +78 -0
- package/dist/Field-3XJNFTql.js.map +1 -0
- package/dist/FieldLabel-CAbVan3E.js +97 -0
- package/dist/FieldLabel-CAbVan3E.js.map +1 -0
- package/dist/FormBody-4HptEjhb.js +103 -0
- package/dist/FormBody-4HptEjhb.js.map +1 -0
- package/dist/{IconButton-BUPs2kEo.js → IconButton-BkBsOIf5.js} +15 -15
- package/dist/{IconButton-BUPs2kEo.js.map → IconButton-BkBsOIf5.js.map} +1 -1
- package/dist/ImagePlaceholder-CNAKQWTh.js +45 -0
- package/dist/ImagePlaceholder-CNAKQWTh.js.map +1 -0
- package/dist/ImagePreview-DHi7A8md.js +156 -0
- package/dist/ImagePreview-DHi7A8md.js.map +1 -0
- package/dist/ImageUploader-46sxdmt5.js +123 -0
- package/dist/ImageUploader-46sxdmt5.js.map +1 -0
- package/dist/IsolatedStylesWrapper-WgaoHh7y.js +179 -0
- package/dist/IsolatedStylesWrapper-WgaoHh7y.js.map +1 -0
- package/dist/Modal-D33MSQot.js +125 -0
- package/dist/Modal-D33MSQot.js.map +1 -0
- package/dist/ScrollShadowContainer-ByNH68Kg.js +636 -0
- package/dist/ScrollShadowContainer-ByNH68Kg.js.map +1 -0
- package/dist/Toggle-7AlEmn8A.js +104 -0
- package/dist/Toggle-7AlEmn8A.js.map +1 -0
- package/dist/ToggleGroup-CT453MNp.js +200 -0
- package/dist/ToggleGroup-CT453MNp.js.map +1 -0
- package/dist/Tooltip-C4BbGF2_.js +372 -0
- package/dist/Tooltip-C4BbGF2_.js.map +1 -0
- package/dist/{bundle-mjs-D6wdQkGI.js → bundle-mjs-LhQum_e3.js} +676 -425
- package/dist/bundle-mjs-LhQum_e3.js.map +1 -0
- package/dist/check-C-TqZgvb.js.map +1 -1
- package/dist/chevron-right-CobOebzi.js.map +1 -1
- package/dist/components/badge.js +1 -1
- package/dist/components/button/icon-button/IconButton.stories.d.ts +330 -2
- package/dist/components/button/loading-button/LoadingButton.d.ts +249 -0
- package/dist/components/button/loading-button/LoadingButton.stories.d.ts +219 -0
- package/dist/components/button.js +6 -5
- package/dist/components/button.js.map +1 -1
- package/dist/components/carousel.js +65 -1532
- package/dist/components/carousel.js.map +1 -1
- package/dist/components/checkbox.js +1 -1
- package/dist/components/divider/content-divider/ContentDivider.d.ts +14 -0
- package/dist/components/divider/content-divider/ContentDivider.stories.d.ts +7 -0
- package/dist/components/divider/index.d.ts +1 -0
- package/dist/components/divider.js +45 -2
- package/dist/components/divider.js.map +1 -1
- package/dist/components/drawer/templates/drawer-footer-template/DrawerFooterTemplate.d.ts +3 -0
- package/dist/components/drawer.js +450 -447
- package/dist/components/drawer.js.map +1 -1
- package/dist/components/dropdown.js +37 -33
- package/dist/components/dropdown.js.map +1 -1
- package/dist/components/empty-state/EmptyState.d.ts +2 -2
- package/dist/components/empty-state.js +1 -1
- package/dist/components/empty-state.js.map +1 -1
- package/dist/components/field/Field.d.ts +35 -0
- package/dist/components/field.js +1 -1
- package/dist/components/form/components/form-header/FormHeader.d.ts +2 -2
- package/dist/components/form.js +289 -288
- package/dist/components/form.js.map +1 -1
- package/dist/components/gallery/Gallery.d.ts +21 -0
- package/dist/components/gallery/Gallery.stories.d.ts +26 -0
- package/dist/components/gallery/index.d.ts +1 -0
- package/dist/components/gallery.d.ts +2 -0
- package/dist/components/gallery.js +130 -0
- package/dist/components/gallery.js.map +1 -0
- package/dist/components/icon-tooltip/IconTooltip.d.ts +2 -1
- package/dist/components/image-placeholder.js +2 -42
- package/dist/components/image-placeholder.js.map +1 -1
- package/dist/components/image-preview/ImagePreview.d.ts +6 -6
- package/dist/components/image-preview.js +2 -136
- package/dist/components/image-preview.js.map +1 -1
- package/dist/components/image-uploader.js +2 -118
- package/dist/components/image-uploader.js.map +1 -1
- package/dist/components/input/file-input/FileInput.d.ts +3 -1
- package/dist/components/input-otp.js +1 -1
- package/dist/components/input-otp.js.map +1 -1
- package/dist/components/input.js +176 -195
- package/dist/components/input.js.map +1 -1
- package/dist/components/isolated-styles-wrapper/IsolatedStylesWrapper.d.ts +1 -1
- package/dist/components/label/Label.stories.d.ts +0 -2
- package/dist/components/label/field-label/FieldLabel.d.ts +11 -0
- package/dist/components/label/field-label/FieldLabel.stories.d.ts +1 -0
- package/dist/components/label/field-label/components/RequiredIcon.d.ts +5 -0
- package/dist/components/label.js +1 -1
- package/dist/components/loading/Loading.d.ts +4 -4
- package/dist/components/loading.js +2 -2
- package/dist/components/loading.js.map +1 -1
- package/dist/components/modal.js +12 -122
- package/dist/components/modal.js.map +1 -1
- package/dist/components/option-group.js +1 -1
- package/dist/components/popover.js +34 -31
- package/dist/components/popover.js.map +1 -1
- package/dist/components/scheduler.js +11 -11
- package/dist/components/scheduler.js.map +1 -1
- package/dist/components/scroll-shadow-container/ScrollShadowContainer.d.ts +1 -0
- package/dist/components/scroll-shadow-container.js +1 -1
- package/dist/components/select.js +487 -519
- package/dist/components/select.js.map +1 -1
- package/dist/components/shortcut/Shortcut.d.ts +14 -14
- package/dist/components/shortcut/Shortcut.stories.d.ts +7 -7
- package/dist/components/shortcut.js +16 -16
- package/dist/components/shortcut.js.map +1 -1
- package/dist/components/skeleton/Skeleton.d.ts +1 -0
- package/dist/components/skeleton/Skeleton.stories.d.ts +7 -0
- package/dist/components/skeleton/index.d.ts +1 -0
- package/dist/components/skeleton.d.ts +2 -0
- package/dist/components/skeleton.js +33 -0
- package/dist/components/skeleton.js.map +1 -0
- package/dist/components/switch.js +147 -126
- package/dist/components/switch.js.map +1 -1
- package/dist/components/tabs.js +9 -8
- package/dist/components/tabs.js.map +1 -1
- package/dist/components/tag.js +3 -3
- package/dist/components/toast.js +4 -4
- package/dist/components/toast.js.map +1 -1
- package/dist/components/toggle-group.js +1 -1
- package/dist/components/toggle.js +1 -1
- package/dist/components/tooltip/Tooltip.stories.d.ts +7 -0
- package/dist/components/tooltip/index.d.ts +1 -0
- package/dist/components/tooltip.d.ts +2 -0
- package/dist/components/tooltip.js +8 -0
- package/dist/components/tooltip.js.map +1 -0
- package/dist/createLucideIcon-DgrNxRV5.js.map +1 -1
- package/dist/design-tokens.source.json +1 -1
- package/dist/download-CVOGyQ0e.js.map +1 -1
- package/dist/downloadFile-yZV-aaO2.js +15 -0
- package/dist/downloadFile-yZV-aaO2.js.map +1 -0
- package/dist/index-B6K06mzp.js +67 -0
- package/dist/index-B6K06mzp.js.map +1 -0
- package/dist/index-BCZIl2rL.js +68 -0
- package/dist/index-BCZIl2rL.js.map +1 -0
- package/dist/index-BZPx6jYI.js.map +1 -1
- package/dist/index-Bj6ZBhqh.js +105 -0
- package/dist/index-Bj6ZBhqh.js.map +1 -0
- package/dist/index-ByaXH_ih.js.map +1 -1
- package/dist/index-CACw01gt.js +702 -0
- package/dist/index-CACw01gt.js.map +1 -0
- package/dist/index-COBL2CQB.js +14 -0
- package/dist/index-COBL2CQB.js.map +1 -0
- package/dist/index-CR-odn5-.js.map +1 -1
- package/dist/{index-BjbwEU_d.js → index-ClwWa5fz.js} +20 -20
- package/dist/index-ClwWa5fz.js.map +1 -0
- package/dist/{index-DwbC6luJ.js → index-Cx4x7Bv2.js} +52 -50
- package/dist/index-Cx4x7Bv2.js.map +1 -0
- package/dist/index-CzNelU6n.js +55 -0
- package/dist/index-CzNelU6n.js.map +1 -0
- package/dist/index-DBsc8nMF.js +43 -0
- package/dist/index-DBsc8nMF.js.map +1 -0
- package/dist/index-Mbnk_gHS.js +102 -0
- package/dist/index-Mbnk_gHS.js.map +1 -0
- package/dist/index-bhXb51Q1.js +215 -0
- package/dist/index-bhXb51Q1.js.map +1 -0
- package/dist/index-n71RB2rx.js +1592 -0
- package/dist/index-n71RB2rx.js.map +1 -0
- package/dist/index-rKs9bXHr.js +7 -0
- package/dist/index-rKs9bXHr.js.map +1 -0
- package/dist/lib/utils/file/downloadFile.d.ts +2 -0
- package/dist/lib/utils/image/imageConverter.d.ts +23 -0
- package/dist/styles-scoped.css +72 -18
- package/dist/styles.css +72 -18
- package/dist/{utils-DGzAmwok.js → utils-BK4mPzkB.js} +2 -2
- package/dist/utils-BK4mPzkB.js.map +1 -0
- package/dist/x-JgjNP5oH.js.map +1 -1
- package/package.json +1 -1
- package/dist/Button-DhfE69q0.js.map +0 -1
- package/dist/CheckboxField-CL1Tc7P4.js +0 -257
- package/dist/CheckboxField-CL1Tc7P4.js.map +0 -1
- package/dist/Divider-D3NvaU8c.js +0 -46
- package/dist/Field-COOo8o9f.js +0 -80
- package/dist/Field-COOo8o9f.js.map +0 -1
- package/dist/FieldLabel-BGxT_RaE.js +0 -64
- package/dist/FieldLabel-BGxT_RaE.js.map +0 -1
- package/dist/FormBody-DM52shm4.js +0 -101
- package/dist/FormBody-DM52shm4.js.map +0 -1
- package/dist/IsolatedStylesWrapper-B_Qu75eR.js +0 -555
- package/dist/IsolatedStylesWrapper-B_Qu75eR.js.map +0 -1
- package/dist/ScrollShadowContainer-DSKr3_fV.js +0 -690
- package/dist/ScrollShadowContainer-DSKr3_fV.js.map +0 -1
- package/dist/Toggle-BuYtICWv.js +0 -129
- package/dist/Toggle-BuYtICWv.js.map +0 -1
- package/dist/ToggleGroup-CMyUAz04.js +0 -467
- package/dist/ToggleGroup-CMyUAz04.js.map +0 -1
- package/dist/bundle-mjs-D6wdQkGI.js.map +0 -1
- package/dist/floating-ui.react-dom-CWfR7VfF.js +0 -1346
- package/dist/floating-ui.react-dom-CWfR7VfF.js.map +0 -1
- package/dist/index-0WznJ1QS.js +0 -276
- package/dist/index-0WznJ1QS.js.map +0 -1
- package/dist/index-BjbwEU_d.js.map +0 -1
- package/dist/index-BqriTm0o.js +0 -47
- package/dist/index-BqriTm0o.js.map +0 -1
- package/dist/index-C6bvrqL8.js +0 -563
- package/dist/index-C6bvrqL8.js.map +0 -1
- package/dist/index-C6t9z3on.js +0 -97
- package/dist/index-C6t9z3on.js.map +0 -1
- package/dist/index-CaQG3DzJ.js +0 -64
- package/dist/index-CaQG3DzJ.js.map +0 -1
- package/dist/index-ChTGHCkY.js +0 -255
- package/dist/index-ChTGHCkY.js.map +0 -1
- package/dist/index-D808y1pT.js +0 -178
- package/dist/index-D808y1pT.js.map +0 -1
- package/dist/index-DE3fiSzl.js +0 -28
- package/dist/index-DE3fiSzl.js.map +0 -1
- package/dist/index-DPws5oAn.js +0 -90
- package/dist/index-DPws5oAn.js.map +0 -1
- package/dist/index-DeUgDpdG.js +0 -80
- package/dist/index-DeUgDpdG.js.map +0 -1
- package/dist/index-DvquTpxI.js +0 -140
- package/dist/index-DvquTpxI.js.map +0 -1
- package/dist/index-DwbC6luJ.js.map +0 -1
- package/dist/index-Ncxt32Wo.js +0 -174
- package/dist/index-Ncxt32Wo.js.map +0 -1
- package/dist/index-U7y6nBZR.js +0 -179
- package/dist/index-U7y6nBZR.js.map +0 -1
- package/dist/index-pysSAa5G.js +0 -57
- package/dist/index-pysSAa5G.js.map +0 -1
- package/dist/tooltip-DI3_ZKNk.js +0 -365
- package/dist/tooltip-DI3_ZKNk.js.map +0 -1
- package/dist/utils-DGzAmwok.js.map +0 -1
- /package/dist/components/{ui/tooltip.d.ts → tooltip/Tooltip.d.ts} +0 -0
|
@@ -1,46 +1,50 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
1
|
+
var Tt = Object.defineProperty, Nt = Object.defineProperties;
|
|
2
|
+
var Rt = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var pe = Object.getOwnPropertySymbols;
|
|
4
|
+
var De = Object.prototype.hasOwnProperty, Oe = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var Ae = (t, o, e) => o in t ? Tt(t, o, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[o] = e, h = (t, o) => {
|
|
6
6
|
for (var e in o || (o = {}))
|
|
7
|
-
|
|
8
|
-
if (
|
|
9
|
-
for (var e of
|
|
10
|
-
|
|
7
|
+
De.call(o, e) && Ae(t, e, o[e]);
|
|
8
|
+
if (pe)
|
|
9
|
+
for (var e of pe(o))
|
|
10
|
+
Oe.call(o, e) && Ae(t, e, o[e]);
|
|
11
11
|
return t;
|
|
12
|
-
},
|
|
13
|
-
var
|
|
12
|
+
}, w = (t, o) => Nt(t, Rt(o));
|
|
13
|
+
var T = (t, o) => {
|
|
14
14
|
var e = {};
|
|
15
15
|
for (var s in t)
|
|
16
|
-
|
|
17
|
-
if (t != null &&
|
|
18
|
-
for (var s of
|
|
19
|
-
o.indexOf(s) < 0 &&
|
|
16
|
+
De.call(t, s) && o.indexOf(s) < 0 && (e[s] = t[s]);
|
|
17
|
+
if (t != null && pe)
|
|
18
|
+
for (var s of pe(t))
|
|
19
|
+
o.indexOf(s) < 0 && Oe.call(t, s) && (e[s] = t[s]);
|
|
20
20
|
return e;
|
|
21
21
|
};
|
|
22
|
-
import { jsx as d, jsxs as
|
|
22
|
+
import { jsx as d, jsxs as Q, Fragment as Ee } from "react/jsx-runtime";
|
|
23
23
|
import * as n from "react";
|
|
24
|
-
import
|
|
25
|
-
import
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import { u as
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import { P as
|
|
32
|
-
import { u as
|
|
33
|
-
import {
|
|
24
|
+
import * as Be from "react-dom";
|
|
25
|
+
import { c as Le } from "../index-rKs9bXHr.js";
|
|
26
|
+
import { P as k, u as j, c as A } from "../index-B6K06mzp.js";
|
|
27
|
+
import { c as Pt } from "../index-BCZIl2rL.js";
|
|
28
|
+
import { u as G, c as Et } from "../index-Bj6ZBhqh.js";
|
|
29
|
+
import { c as _t, u as Mt } from "../index-Mbnk_gHS.js";
|
|
30
|
+
import { u as At } from "../index-ByaXH_ih.js";
|
|
31
|
+
import { P as Dt, D as Ot, I as Lt } from "../IsolatedStylesWrapper-WgaoHh7y.js";
|
|
32
|
+
import { h as kt, u as Bt, R as Vt, F as Ht } from "../index-CACw01gt.js";
|
|
33
|
+
import { u as _e } from "../index-COBL2CQB.js";
|
|
34
|
+
import { c as Ve, R as Ut, A as Wt, C as Ft, a as Kt } from "../index-n71RB2rx.js";
|
|
35
|
+
import { u as ke } from "../index-CzNelU6n.js";
|
|
36
|
+
import { u as $t } from "../index-BZPx6jYI.js";
|
|
37
|
+
import { V as Gt } from "../index-DBsc8nMF.js";
|
|
34
38
|
import { c as oe } from "../index-CR-odn5-.js";
|
|
35
|
-
import { c as
|
|
36
|
-
import { C as
|
|
39
|
+
import { c as He } from "../createLucideIcon-DgrNxRV5.js";
|
|
40
|
+
import { C as zt } from "../check-C-TqZgvb.js";
|
|
37
41
|
/**
|
|
38
42
|
* @license lucide-react v0.460.0 - ISC
|
|
39
43
|
*
|
|
40
44
|
* This source code is licensed under the ISC license.
|
|
41
45
|
* See the LICENSE file in the root directory of this source tree.
|
|
42
46
|
*/
|
|
43
|
-
const
|
|
47
|
+
const Ue = He("ChevronDown", [
|
|
44
48
|
["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]
|
|
45
49
|
]);
|
|
46
50
|
/**
|
|
@@ -49,247 +53,201 @@ const Ke = Fe("ChevronDown", [
|
|
|
49
53
|
* This source code is licensed under the ISC license.
|
|
50
54
|
* See the LICENSE file in the root directory of this source tree.
|
|
51
55
|
*/
|
|
52
|
-
const
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
const o = t + "CollectionProvider", [e, s] = Ue(o), [r, a] = e(
|
|
58
|
-
o,
|
|
59
|
-
{ collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }
|
|
60
|
-
), c = (I) => {
|
|
61
|
-
const { scope: y, children: w } = I, u = Q.useRef(null), g = Q.useRef(/* @__PURE__ */ new Map()).current;
|
|
62
|
-
return /* @__PURE__ */ d(r, { scope: y, itemMap: g, collectionRef: u, children: w });
|
|
63
|
-
};
|
|
64
|
-
c.displayName = o;
|
|
65
|
-
const l = t + "CollectionSlot", i = Q.forwardRef(
|
|
66
|
-
(I, y) => {
|
|
67
|
-
const { scope: w, children: u } = I, g = a(l, w), m = B(y, g.collectionRef);
|
|
68
|
-
return /* @__PURE__ */ d(Te, { ref: m, children: u });
|
|
69
|
-
}
|
|
70
|
-
);
|
|
71
|
-
i.displayName = l;
|
|
72
|
-
const f = t + "CollectionItemSlot", S = "data-radix-collection-item", T = Q.forwardRef(
|
|
73
|
-
(I, y) => {
|
|
74
|
-
const N = I, { scope: w, children: u } = N, g = E(N, ["scope", "children"]), m = Q.useRef(null), p = B(y, m), b = a(f, w);
|
|
75
|
-
return Q.useEffect(() => (b.itemMap.set(m, v({ ref: m }, g)), () => void b.itemMap.delete(m))), /* @__PURE__ */ d(Te, { [S]: "", ref: p, children: u });
|
|
76
|
-
}
|
|
77
|
-
);
|
|
78
|
-
T.displayName = f;
|
|
79
|
-
function C(I) {
|
|
80
|
-
const y = a(t + "CollectionConsumer", I);
|
|
81
|
-
return Q.useCallback(() => {
|
|
82
|
-
const u = y.collectionRef.current;
|
|
83
|
-
if (!u) return [];
|
|
84
|
-
const g = Array.from(u.querySelectorAll(`[${S}]`));
|
|
85
|
-
return Array.from(y.itemMap.values()).sort(
|
|
86
|
-
(b, N) => g.indexOf(b.ref.current) - g.indexOf(N.ref.current)
|
|
87
|
-
);
|
|
88
|
-
}, [y.collectionRef, y.itemMap]);
|
|
89
|
-
}
|
|
90
|
-
return [
|
|
91
|
-
{ Provider: c, Slot: i, ItemSlot: T },
|
|
92
|
-
C,
|
|
93
|
-
s
|
|
94
|
-
];
|
|
95
|
-
}
|
|
96
|
-
var qt = n.createContext(void 0);
|
|
97
|
-
function Yt(t) {
|
|
98
|
-
const o = n.useContext(qt);
|
|
99
|
-
return t || o || "ltr";
|
|
100
|
-
}
|
|
101
|
-
var Xt = [" ", "Enter", "ArrowUp", "ArrowDown"], Zt = [" ", "Enter"], de = "Select", [he, ve, Jt] = jt(de), [le, Yo] = Ue(de, [
|
|
102
|
-
Jt,
|
|
103
|
-
We
|
|
104
|
-
]), ge = We(), [Qt, q] = le(de), [eo, to] = le(de), $e = (t) => {
|
|
56
|
+
const jt = He("ChevronUp", [["path", { d: "m18 15-6-6-6 6", key: "153udz" }]]);
|
|
57
|
+
var Yt = [" ", "Enter", "ArrowUp", "ArrowDown"], qt = [" ", "Enter"], ee = "Select", [me, he, Xt] = Pt(ee), [le, Qo] = _t(ee, [
|
|
58
|
+
Xt,
|
|
59
|
+
Ve
|
|
60
|
+
]), ve = Ve(), [Zt, Y] = le(ee), [Jt, Qt] = le(ee), We = (t) => {
|
|
105
61
|
const {
|
|
106
62
|
__scopeSelect: o,
|
|
107
63
|
children: e,
|
|
108
64
|
open: s,
|
|
109
65
|
defaultOpen: r,
|
|
110
66
|
onOpenChange: a,
|
|
111
|
-
value:
|
|
112
|
-
defaultValue:
|
|
67
|
+
value: l,
|
|
68
|
+
defaultValue: c,
|
|
113
69
|
onValueChange: i,
|
|
114
70
|
dir: f,
|
|
115
|
-
name:
|
|
116
|
-
autoComplete:
|
|
117
|
-
disabled:
|
|
118
|
-
required:
|
|
119
|
-
form:
|
|
120
|
-
} = t,
|
|
71
|
+
name: g,
|
|
72
|
+
autoComplete: P,
|
|
73
|
+
disabled: S,
|
|
74
|
+
required: E,
|
|
75
|
+
form: _
|
|
76
|
+
} = t, b = ve(o), [u, y] = n.useState(null), [v, p] = n.useState(null), [I, M] = n.useState(!1), ce = At(f), [re, D] = ke({
|
|
121
77
|
prop: s,
|
|
122
|
-
defaultProp: r,
|
|
123
|
-
onChange: a
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
78
|
+
defaultProp: r != null ? r : !1,
|
|
79
|
+
onChange: a,
|
|
80
|
+
caller: ee
|
|
81
|
+
}), [H, X] = ke({
|
|
82
|
+
prop: l,
|
|
83
|
+
defaultProp: c,
|
|
84
|
+
onChange: i,
|
|
85
|
+
caller: ee
|
|
86
|
+
}), ne = n.useRef(null), B = u ? _ || !!u.closest("form") : !0, [z, se] = n.useState(/* @__PURE__ */ new Set()), U = Array.from(z).map((O) => O.props.value).join(";");
|
|
87
|
+
return /* @__PURE__ */ d(Ut, w(h({}, b), { children: /* @__PURE__ */ Q(
|
|
88
|
+
Zt,
|
|
131
89
|
{
|
|
132
|
-
required:
|
|
90
|
+
required: E,
|
|
133
91
|
scope: o,
|
|
134
92
|
trigger: u,
|
|
135
|
-
onTriggerChange:
|
|
136
|
-
valueNode:
|
|
93
|
+
onTriggerChange: y,
|
|
94
|
+
valueNode: v,
|
|
137
95
|
onValueNodeChange: p,
|
|
138
|
-
valueNodeHasChildren:
|
|
139
|
-
onValueNodeHasChildrenChange:
|
|
140
|
-
contentId:
|
|
141
|
-
value:
|
|
96
|
+
valueNodeHasChildren: I,
|
|
97
|
+
onValueNodeHasChildrenChange: M,
|
|
98
|
+
contentId: _e(),
|
|
99
|
+
value: H,
|
|
142
100
|
onValueChange: X,
|
|
143
101
|
open: re,
|
|
144
|
-
onOpenChange:
|
|
102
|
+
onOpenChange: D,
|
|
145
103
|
dir: ce,
|
|
146
104
|
triggerPointerDownPosRef: ne,
|
|
147
|
-
disabled:
|
|
105
|
+
disabled: S,
|
|
148
106
|
children: [
|
|
149
|
-
/* @__PURE__ */ d(
|
|
150
|
-
|
|
107
|
+
/* @__PURE__ */ d(me.Provider, { scope: o, children: /* @__PURE__ */ d(
|
|
108
|
+
Jt,
|
|
151
109
|
{
|
|
152
110
|
scope: t.__scopeSelect,
|
|
153
|
-
onNativeOptionAdd: n.useCallback((
|
|
154
|
-
se((
|
|
111
|
+
onNativeOptionAdd: n.useCallback((O) => {
|
|
112
|
+
se((W) => new Set(W).add(O));
|
|
155
113
|
}, []),
|
|
156
|
-
onNativeOptionRemove: n.useCallback((
|
|
157
|
-
se((
|
|
158
|
-
const
|
|
159
|
-
return
|
|
114
|
+
onNativeOptionRemove: n.useCallback((O) => {
|
|
115
|
+
se((W) => {
|
|
116
|
+
const F = new Set(W);
|
|
117
|
+
return F.delete(O), F;
|
|
160
118
|
});
|
|
161
119
|
}, []),
|
|
162
120
|
children: e
|
|
163
121
|
}
|
|
164
122
|
) }),
|
|
165
|
-
|
|
166
|
-
|
|
123
|
+
B ? /* @__PURE__ */ Q(
|
|
124
|
+
pt,
|
|
167
125
|
{
|
|
168
126
|
"aria-hidden": !0,
|
|
169
|
-
required:
|
|
127
|
+
required: E,
|
|
170
128
|
tabIndex: -1,
|
|
171
|
-
name:
|
|
172
|
-
autoComplete:
|
|
173
|
-
value:
|
|
174
|
-
onChange: (
|
|
175
|
-
disabled:
|
|
176
|
-
form:
|
|
129
|
+
name: g,
|
|
130
|
+
autoComplete: P,
|
|
131
|
+
value: H,
|
|
132
|
+
onChange: (O) => X(O.target.value),
|
|
133
|
+
disabled: S,
|
|
134
|
+
form: _,
|
|
177
135
|
children: [
|
|
178
|
-
|
|
136
|
+
H === void 0 ? /* @__PURE__ */ d("option", { value: "" }) : null,
|
|
179
137
|
Array.from(z)
|
|
180
138
|
]
|
|
181
139
|
},
|
|
182
|
-
|
|
140
|
+
U
|
|
183
141
|
) : null
|
|
184
142
|
]
|
|
185
143
|
}
|
|
186
144
|
) }));
|
|
187
145
|
};
|
|
188
|
-
|
|
189
|
-
var
|
|
146
|
+
We.displayName = ee;
|
|
147
|
+
var Fe = "SelectTrigger", Ke = n.forwardRef(
|
|
190
148
|
(t, o) => {
|
|
191
|
-
const
|
|
192
|
-
const
|
|
193
|
-
p !== void 0 &&
|
|
194
|
-
}),
|
|
195
|
-
|
|
149
|
+
const b = t, { __scopeSelect: e, disabled: s = !1 } = b, r = T(b, ["__scopeSelect", "disabled"]), a = ve(e), l = Y(Fe, e), c = l.disabled || s, i = G(o, l.onTriggerChange), f = he(e), g = n.useRef("touch"), [P, S, E] = mt((u) => {
|
|
150
|
+
const y = f().filter((I) => !I.disabled), v = y.find((I) => I.value === l.value), p = ht(y, u, v);
|
|
151
|
+
p !== void 0 && l.onValueChange(p.value);
|
|
152
|
+
}), _ = (u) => {
|
|
153
|
+
c || (l.onOpenChange(!0), E()), u && (l.triggerPointerDownPosRef.current = {
|
|
196
154
|
x: Math.round(u.pageX),
|
|
197
155
|
y: Math.round(u.pageY)
|
|
198
156
|
});
|
|
199
157
|
};
|
|
200
|
-
return /* @__PURE__ */ d(
|
|
201
|
-
|
|
202
|
-
|
|
158
|
+
return /* @__PURE__ */ d(Wt, w(h({ asChild: !0 }, a), { children: /* @__PURE__ */ d(
|
|
159
|
+
k.button,
|
|
160
|
+
w(h({
|
|
203
161
|
type: "button",
|
|
204
162
|
role: "combobox",
|
|
205
|
-
"aria-controls":
|
|
206
|
-
"aria-expanded":
|
|
207
|
-
"aria-required":
|
|
163
|
+
"aria-controls": l.contentId,
|
|
164
|
+
"aria-expanded": l.open,
|
|
165
|
+
"aria-required": l.required,
|
|
208
166
|
"aria-autocomplete": "none",
|
|
209
|
-
dir:
|
|
210
|
-
"data-state":
|
|
211
|
-
disabled:
|
|
212
|
-
"data-disabled":
|
|
213
|
-
"data-placeholder":
|
|
167
|
+
dir: l.dir,
|
|
168
|
+
"data-state": l.open ? "open" : "closed",
|
|
169
|
+
disabled: c,
|
|
170
|
+
"data-disabled": c ? "" : void 0,
|
|
171
|
+
"data-placeholder": ft(l.value) ? "" : void 0
|
|
214
172
|
}, r), {
|
|
215
173
|
ref: i,
|
|
216
174
|
onClick: A(r.onClick, (u) => {
|
|
217
|
-
u.currentTarget.focus(),
|
|
175
|
+
u.currentTarget.focus(), g.current !== "mouse" && _(u);
|
|
218
176
|
}),
|
|
219
177
|
onPointerDown: A(r.onPointerDown, (u) => {
|
|
220
|
-
|
|
221
|
-
const
|
|
222
|
-
|
|
178
|
+
g.current = u.pointerType;
|
|
179
|
+
const y = u.target;
|
|
180
|
+
y.hasPointerCapture(u.pointerId) && y.releasePointerCapture(u.pointerId), u.button === 0 && u.ctrlKey === !1 && u.pointerType === "mouse" && (_(u), u.preventDefault());
|
|
223
181
|
}),
|
|
224
182
|
onKeyDown: A(r.onKeyDown, (u) => {
|
|
225
|
-
const
|
|
226
|
-
!(u.ctrlKey || u.altKey || u.metaKey) && u.key.length === 1 &&
|
|
183
|
+
const y = P.current !== "";
|
|
184
|
+
!(u.ctrlKey || u.altKey || u.metaKey) && u.key.length === 1 && S(u.key), !(y && u.key === " ") && Yt.includes(u.key) && (_(), u.preventDefault());
|
|
227
185
|
})
|
|
228
186
|
})
|
|
229
187
|
) }));
|
|
230
188
|
}
|
|
231
189
|
);
|
|
232
|
-
|
|
233
|
-
var
|
|
190
|
+
Ke.displayName = Fe;
|
|
191
|
+
var $e = "SelectValue", Ge = n.forwardRef(
|
|
234
192
|
(t, o) => {
|
|
235
|
-
const
|
|
193
|
+
const S = t, { __scopeSelect: e, className: s, style: r, children: a, placeholder: l = "" } = S, c = T(S, ["__scopeSelect", "className", "style", "children", "placeholder"]), i = Y($e, e), { onValueNodeHasChildrenChange: f } = i, g = a !== void 0, P = G(o, i.onValueNodeChange);
|
|
236
194
|
return j(() => {
|
|
237
|
-
f(
|
|
238
|
-
}, [f,
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
ref:
|
|
195
|
+
f(g);
|
|
196
|
+
}, [f, g]), /* @__PURE__ */ d(
|
|
197
|
+
k.span,
|
|
198
|
+
w(h({}, c), {
|
|
199
|
+
ref: P,
|
|
242
200
|
style: { pointerEvents: "none" },
|
|
243
|
-
children:
|
|
201
|
+
children: ft(i.value) ? /* @__PURE__ */ d(Ee, { children: l }) : a
|
|
244
202
|
})
|
|
245
203
|
);
|
|
246
204
|
}
|
|
247
205
|
);
|
|
248
|
-
|
|
249
|
-
var
|
|
206
|
+
Ge.displayName = $e;
|
|
207
|
+
var eo = "SelectIcon", ze = n.forwardRef(
|
|
250
208
|
(t, o) => {
|
|
251
|
-
const a = t, { __scopeSelect: e, children: s } = a, r =
|
|
252
|
-
return /* @__PURE__ */ d(
|
|
209
|
+
const a = t, { __scopeSelect: e, children: s } = a, r = T(a, ["__scopeSelect", "children"]);
|
|
210
|
+
return /* @__PURE__ */ d(k.span, w(h({ "aria-hidden": !0 }, r), { ref: o, children: s || "▼" }));
|
|
253
211
|
}
|
|
254
212
|
);
|
|
255
|
-
|
|
256
|
-
var
|
|
257
|
-
|
|
258
|
-
var te = "SelectContent",
|
|
213
|
+
ze.displayName = eo;
|
|
214
|
+
var to = "SelectPortal", je = (t) => /* @__PURE__ */ d(Dt, h({ asChild: !0 }, t));
|
|
215
|
+
je.displayName = to;
|
|
216
|
+
var te = "SelectContent", Ye = n.forwardRef(
|
|
259
217
|
(t, o) => {
|
|
260
|
-
const e =
|
|
218
|
+
const e = Y(te, t.__scopeSelect), [s, r] = n.useState();
|
|
261
219
|
if (j(() => {
|
|
262
220
|
r(new DocumentFragment());
|
|
263
221
|
}, []), !e.open) {
|
|
264
222
|
const a = s;
|
|
265
|
-
return a ?
|
|
266
|
-
/* @__PURE__ */ d(
|
|
223
|
+
return a ? Be.createPortal(
|
|
224
|
+
/* @__PURE__ */ d(qe, { scope: t.__scopeSelect, children: /* @__PURE__ */ d(me.Slot, { scope: t.__scopeSelect, children: /* @__PURE__ */ d("div", { children: t.children }) }) }),
|
|
267
225
|
a
|
|
268
226
|
) : null;
|
|
269
227
|
}
|
|
270
|
-
return /* @__PURE__ */ d(
|
|
228
|
+
return /* @__PURE__ */ d(Xe, w(h({}, t), { ref: o }));
|
|
271
229
|
}
|
|
272
230
|
);
|
|
273
|
-
|
|
274
|
-
var
|
|
231
|
+
Ye.displayName = te;
|
|
232
|
+
var V = 10, [qe, q] = le(te), oo = "SelectContentImpl", ro = Et("SelectContent.RemoveScroll"), Xe = n.forwardRef(
|
|
275
233
|
(t, o) => {
|
|
276
234
|
const ae = t, {
|
|
277
235
|
__scopeSelect: e,
|
|
278
236
|
position: s = "item-aligned",
|
|
279
237
|
onCloseAutoFocus: r,
|
|
280
238
|
onEscapeKeyDown: a,
|
|
281
|
-
onPointerDownOutside:
|
|
282
|
-
side:
|
|
239
|
+
onPointerDownOutside: l,
|
|
240
|
+
side: c,
|
|
283
241
|
sideOffset: i,
|
|
284
242
|
align: f,
|
|
285
|
-
alignOffset:
|
|
286
|
-
arrowPadding:
|
|
287
|
-
collisionBoundary:
|
|
288
|
-
collisionPadding:
|
|
289
|
-
sticky:
|
|
290
|
-
hideWhenDetached:
|
|
243
|
+
alignOffset: g,
|
|
244
|
+
arrowPadding: P,
|
|
245
|
+
collisionBoundary: S,
|
|
246
|
+
collisionPadding: E,
|
|
247
|
+
sticky: _,
|
|
248
|
+
hideWhenDetached: b,
|
|
291
249
|
avoidCollisions: u
|
|
292
|
-
} = ae,
|
|
250
|
+
} = ae, y = T(ae, [
|
|
293
251
|
"__scopeSelect",
|
|
294
252
|
"position",
|
|
295
253
|
"onCloseAutoFocus",
|
|
@@ -307,103 +265,103 @@ var H = 10, [Je, Y] = le(te), no = "SelectContentImpl", Qe = n.forwardRef(
|
|
|
307
265
|
"sticky",
|
|
308
266
|
"hideWhenDetached",
|
|
309
267
|
"avoidCollisions"
|
|
310
|
-
]),
|
|
268
|
+
]), v = Y(te, e), [p, I] = n.useState(null), [M, ce] = n.useState(null), re = G(o, (m) => I(m)), [D, H] = n.useState(null), [X, ne] = n.useState(
|
|
311
269
|
null
|
|
312
|
-
),
|
|
270
|
+
), B = he(e), [z, se] = n.useState(!1), U = n.useRef(!1);
|
|
313
271
|
n.useEffect(() => {
|
|
314
|
-
if (p) return
|
|
315
|
-
}, [p]),
|
|
316
|
-
const
|
|
317
|
-
(
|
|
318
|
-
const [
|
|
319
|
-
for (const
|
|
320
|
-
if (
|
|
272
|
+
if (p) return kt(p);
|
|
273
|
+
}, [p]), Bt();
|
|
274
|
+
const O = n.useCallback(
|
|
275
|
+
(m) => {
|
|
276
|
+
const [R, ...L] = B().map((C) => C.ref.current), [N] = L.slice(-1), x = document.activeElement;
|
|
277
|
+
for (const C of m)
|
|
278
|
+
if (C === x || (C == null || C.scrollIntoView({ block: "nearest" }), C === R && M && (M.scrollTop = 0), C === N && M && (M.scrollTop = M.scrollHeight), C == null || C.focus(), document.activeElement !== x)) return;
|
|
321
279
|
},
|
|
322
|
-
[
|
|
323
|
-
),
|
|
324
|
-
() =>
|
|
325
|
-
[
|
|
280
|
+
[B, M]
|
|
281
|
+
), W = n.useCallback(
|
|
282
|
+
() => O([D, p]),
|
|
283
|
+
[O, D, p]
|
|
326
284
|
);
|
|
327
285
|
n.useEffect(() => {
|
|
328
|
-
z &&
|
|
329
|
-
}, [z,
|
|
330
|
-
const { onOpenChange:
|
|
286
|
+
z && W();
|
|
287
|
+
}, [z, W]);
|
|
288
|
+
const { onOpenChange: F, triggerPointerDownPosRef: Z } = v;
|
|
331
289
|
n.useEffect(() => {
|
|
332
290
|
if (p) {
|
|
333
|
-
let
|
|
334
|
-
const
|
|
335
|
-
var
|
|
336
|
-
|
|
337
|
-
x: Math.abs(Math.round(
|
|
338
|
-
y: Math.abs(Math.round(
|
|
291
|
+
let m = { x: 0, y: 0 };
|
|
292
|
+
const R = (N) => {
|
|
293
|
+
var x, C, K, $;
|
|
294
|
+
m = {
|
|
295
|
+
x: Math.abs(Math.round(N.pageX) - ((C = (x = Z.current) == null ? void 0 : x.x) != null ? C : 0)),
|
|
296
|
+
y: Math.abs(Math.round(N.pageY) - (($ = (K = Z.current) == null ? void 0 : K.y) != null ? $ : 0))
|
|
339
297
|
};
|
|
340
|
-
}, L = (
|
|
341
|
-
|
|
298
|
+
}, L = (N) => {
|
|
299
|
+
m.x <= 10 && m.y <= 10 ? N.preventDefault() : p.contains(N.target) || F(!1), document.removeEventListener("pointermove", R), Z.current = null;
|
|
342
300
|
};
|
|
343
|
-
return Z.current !== null && (document.addEventListener("pointermove",
|
|
344
|
-
document.removeEventListener("pointermove",
|
|
301
|
+
return Z.current !== null && (document.addEventListener("pointermove", R), document.addEventListener("pointerup", L, { capture: !0, once: !0 })), () => {
|
|
302
|
+
document.removeEventListener("pointermove", R), document.removeEventListener("pointerup", L, { capture: !0 });
|
|
345
303
|
};
|
|
346
304
|
}
|
|
347
|
-
}, [p,
|
|
348
|
-
const
|
|
349
|
-
return window.addEventListener("blur",
|
|
350
|
-
window.removeEventListener("blur",
|
|
305
|
+
}, [p, F, Z]), n.useEffect(() => {
|
|
306
|
+
const m = () => F(!1);
|
|
307
|
+
return window.addEventListener("blur", m), window.addEventListener("resize", m), () => {
|
|
308
|
+
window.removeEventListener("blur", m), window.removeEventListener("resize", m);
|
|
351
309
|
};
|
|
352
|
-
}, [
|
|
353
|
-
const [
|
|
354
|
-
const
|
|
355
|
-
|
|
356
|
-
}),
|
|
357
|
-
(
|
|
358
|
-
const
|
|
359
|
-
(
|
|
310
|
+
}, [F]);
|
|
311
|
+
const [de, ge] = mt((m) => {
|
|
312
|
+
const R = B().filter((x) => !x.disabled), L = R.find((x) => x.ref.current === document.activeElement), N = ht(R, m, L);
|
|
313
|
+
N && setTimeout(() => N.ref.current.focus());
|
|
314
|
+
}), ue = n.useCallback(
|
|
315
|
+
(m, R, L) => {
|
|
316
|
+
const N = !U.current && !L;
|
|
317
|
+
(v.value !== void 0 && v.value === R || N) && (H(m), N && (U.current = !0));
|
|
360
318
|
},
|
|
361
|
-
[
|
|
362
|
-
),
|
|
363
|
-
(
|
|
364
|
-
const
|
|
365
|
-
(
|
|
319
|
+
[v.value]
|
|
320
|
+
), Se = n.useCallback(() => p == null ? void 0 : p.focus(), [p]), we = n.useCallback(
|
|
321
|
+
(m, R, L) => {
|
|
322
|
+
const N = !U.current && !L;
|
|
323
|
+
(v.value !== void 0 && v.value === R || N) && ne(m);
|
|
366
324
|
},
|
|
367
|
-
[
|
|
368
|
-
), J = s === "popper" ?
|
|
369
|
-
side:
|
|
325
|
+
[v.value]
|
|
326
|
+
), J = s === "popper" ? Ie : Ze, ye = J === Ie ? {
|
|
327
|
+
side: c,
|
|
370
328
|
sideOffset: i,
|
|
371
329
|
align: f,
|
|
372
|
-
alignOffset:
|
|
373
|
-
arrowPadding:
|
|
374
|
-
collisionBoundary:
|
|
375
|
-
collisionPadding:
|
|
376
|
-
sticky:
|
|
377
|
-
hideWhenDetached:
|
|
330
|
+
alignOffset: g,
|
|
331
|
+
arrowPadding: P,
|
|
332
|
+
collisionBoundary: S,
|
|
333
|
+
collisionPadding: E,
|
|
334
|
+
sticky: _,
|
|
335
|
+
hideWhenDetached: b,
|
|
378
336
|
avoidCollisions: u
|
|
379
337
|
} : {};
|
|
380
338
|
return /* @__PURE__ */ d(
|
|
381
|
-
|
|
339
|
+
qe,
|
|
382
340
|
{
|
|
383
341
|
scope: e,
|
|
384
342
|
content: p,
|
|
385
|
-
viewport:
|
|
343
|
+
viewport: M,
|
|
386
344
|
onViewportChange: ce,
|
|
387
|
-
itemRefCallback:
|
|
388
|
-
selectedItem:
|
|
389
|
-
onItemLeave:
|
|
390
|
-
itemTextRefCallback:
|
|
391
|
-
focusSelectedItem:
|
|
345
|
+
itemRefCallback: ue,
|
|
346
|
+
selectedItem: D,
|
|
347
|
+
onItemLeave: Se,
|
|
348
|
+
itemTextRefCallback: we,
|
|
349
|
+
focusSelectedItem: W,
|
|
392
350
|
selectedItemText: X,
|
|
393
351
|
position: s,
|
|
394
352
|
isPositioned: z,
|
|
395
|
-
searchRef:
|
|
396
|
-
children: /* @__PURE__ */ d(
|
|
397
|
-
|
|
353
|
+
searchRef: de,
|
|
354
|
+
children: /* @__PURE__ */ d(Vt, { as: ro, allowPinchZoom: !0, children: /* @__PURE__ */ d(
|
|
355
|
+
Ht,
|
|
398
356
|
{
|
|
399
357
|
asChild: !0,
|
|
400
|
-
trapped:
|
|
401
|
-
onMountAutoFocus: (
|
|
402
|
-
|
|
358
|
+
trapped: v.open,
|
|
359
|
+
onMountAutoFocus: (m) => {
|
|
360
|
+
m.preventDefault();
|
|
403
361
|
},
|
|
404
|
-
onUnmountAutoFocus: A(r, (
|
|
405
|
-
var
|
|
406
|
-
(
|
|
362
|
+
onUnmountAutoFocus: A(r, (m) => {
|
|
363
|
+
var R;
|
|
364
|
+
(R = v.trigger) == null || R.focus({ preventScroll: !0 }), m.preventDefault();
|
|
407
365
|
}),
|
|
408
366
|
children: /* @__PURE__ */ d(
|
|
409
367
|
Ot,
|
|
@@ -411,36 +369,36 @@ var H = 10, [Je, Y] = le(te), no = "SelectContentImpl", Qe = n.forwardRef(
|
|
|
411
369
|
asChild: !0,
|
|
412
370
|
disableOutsidePointerEvents: !0,
|
|
413
371
|
onEscapeKeyDown: a,
|
|
414
|
-
onPointerDownOutside:
|
|
415
|
-
onFocusOutside: (
|
|
416
|
-
onDismiss: () =>
|
|
372
|
+
onPointerDownOutside: l,
|
|
373
|
+
onFocusOutside: (m) => m.preventDefault(),
|
|
374
|
+
onDismiss: () => v.onOpenChange(!1),
|
|
417
375
|
children: /* @__PURE__ */ d(
|
|
418
376
|
J,
|
|
419
|
-
|
|
377
|
+
w(h(h({
|
|
420
378
|
role: "listbox",
|
|
421
|
-
id:
|
|
422
|
-
"data-state":
|
|
423
|
-
dir:
|
|
424
|
-
onContextMenu: (
|
|
425
|
-
},
|
|
379
|
+
id: v.contentId,
|
|
380
|
+
"data-state": v.open ? "open" : "closed",
|
|
381
|
+
dir: v.dir,
|
|
382
|
+
onContextMenu: (m) => m.preventDefault()
|
|
383
|
+
}, y), ye), {
|
|
426
384
|
onPlaced: () => se(!0),
|
|
427
385
|
ref: re,
|
|
428
|
-
style:
|
|
386
|
+
style: h({
|
|
429
387
|
// flex layout so we can place the scroll buttons properly
|
|
430
388
|
display: "flex",
|
|
431
389
|
flexDirection: "column",
|
|
432
390
|
// reset the outline by default as the content MAY get focused
|
|
433
391
|
outline: "none"
|
|
434
|
-
},
|
|
435
|
-
onKeyDown: A(
|
|
436
|
-
const
|
|
437
|
-
if (
|
|
438
|
-
let
|
|
439
|
-
if (["ArrowUp", "End"].includes(
|
|
440
|
-
const
|
|
441
|
-
|
|
392
|
+
}, y.style),
|
|
393
|
+
onKeyDown: A(y.onKeyDown, (m) => {
|
|
394
|
+
const R = m.ctrlKey || m.altKey || m.metaKey;
|
|
395
|
+
if (m.key === "Tab" && m.preventDefault(), !R && m.key.length === 1 && ge(m.key), ["ArrowUp", "ArrowDown", "Home", "End"].includes(m.key)) {
|
|
396
|
+
let N = B().filter((x) => !x.disabled).map((x) => x.ref.current);
|
|
397
|
+
if (["ArrowUp", "End"].includes(m.key) && (N = N.slice().reverse()), ["ArrowUp", "ArrowDown"].includes(m.key)) {
|
|
398
|
+
const x = m.target, C = N.indexOf(x);
|
|
399
|
+
N = N.slice(C + 1);
|
|
442
400
|
}
|
|
443
|
-
setTimeout(() =>
|
|
401
|
+
setTimeout(() => O(N)), m.preventDefault();
|
|
444
402
|
}
|
|
445
403
|
})
|
|
446
404
|
})
|
|
@@ -453,80 +411,80 @@ var H = 10, [Je, Y] = le(te), no = "SelectContentImpl", Qe = n.forwardRef(
|
|
|
453
411
|
);
|
|
454
412
|
}
|
|
455
413
|
);
|
|
456
|
-
|
|
457
|
-
var
|
|
458
|
-
const re = t, { __scopeSelect: e, onPlaced: s } = re, r =
|
|
459
|
-
if (a.trigger && a.valueNode &&
|
|
460
|
-
const
|
|
414
|
+
Xe.displayName = oo;
|
|
415
|
+
var no = "SelectItemAlignedPosition", Ze = n.forwardRef((t, o) => {
|
|
416
|
+
const re = t, { __scopeSelect: e, onPlaced: s } = re, r = T(re, ["__scopeSelect", "onPlaced"]), a = Y(te, e), l = q(te, e), [c, i] = n.useState(null), [f, g] = n.useState(null), P = G(o, (D) => g(D)), S = he(e), E = n.useRef(!1), _ = n.useRef(!0), { viewport: b, selectedItem: u, selectedItemText: y, focusSelectedItem: v } = l, p = n.useCallback(() => {
|
|
417
|
+
if (a.trigger && a.valueNode && c && f && b && u && y) {
|
|
418
|
+
const D = a.trigger.getBoundingClientRect(), H = f.getBoundingClientRect(), X = a.valueNode.getBoundingClientRect(), ne = y.getBoundingClientRect();
|
|
461
419
|
if (a.dir !== "rtl") {
|
|
462
|
-
const
|
|
463
|
-
|
|
420
|
+
const x = ne.left - H.left, C = X.left - x, K = D.left - C, $ = D.width + K, be = Math.max($, H.width), xe = window.innerWidth - V, Ce = Le(C, [
|
|
421
|
+
V,
|
|
464
422
|
// Prevents the content from going off the starting edge of the
|
|
465
423
|
// viewport. It may still go off the ending edge, but this can be
|
|
466
424
|
// controlled by the user since they may want to manage overflow in a
|
|
467
425
|
// specific way.
|
|
468
426
|
// https://github.com/radix-ui/primitives/issues/2049
|
|
469
|
-
Math.max(
|
|
427
|
+
Math.max(V, xe - be)
|
|
470
428
|
]);
|
|
471
|
-
|
|
429
|
+
c.style.minWidth = $ + "px", c.style.left = Ce + "px";
|
|
472
430
|
} else {
|
|
473
|
-
const
|
|
474
|
-
|
|
475
|
-
Math.max(
|
|
431
|
+
const x = H.right - ne.right, C = window.innerWidth - X.right - x, K = window.innerWidth - D.right - C, $ = D.width + K, be = Math.max($, H.width), xe = window.innerWidth - V, Ce = Le(C, [
|
|
432
|
+
V,
|
|
433
|
+
Math.max(V, xe - be)
|
|
476
434
|
]);
|
|
477
|
-
|
|
435
|
+
c.style.minWidth = $ + "px", c.style.right = Ce + "px";
|
|
478
436
|
}
|
|
479
|
-
const
|
|
480
|
-
if (
|
|
481
|
-
const
|
|
482
|
-
|
|
483
|
-
const
|
|
484
|
-
|
|
437
|
+
const B = S(), z = window.innerHeight - V * 2, se = b.scrollHeight, U = window.getComputedStyle(f), O = parseInt(U.borderTopWidth, 10), W = parseInt(U.paddingTop, 10), F = parseInt(U.borderBottomWidth, 10), Z = parseInt(U.paddingBottom, 10), de = O + W + se + Z + F, ge = Math.min(u.offsetHeight * 5, de), ue = window.getComputedStyle(b), Se = parseInt(ue.paddingTop, 10), we = parseInt(ue.paddingBottom, 10), J = D.top + D.height / 2 - V, ye = z - J, ae = u.offsetHeight / 2, m = u.offsetTop + ae, R = O + W + m, L = de - R;
|
|
438
|
+
if (R <= J) {
|
|
439
|
+
const x = B.length > 0 && u === B[B.length - 1].ref.current;
|
|
440
|
+
c.style.bottom = "0px";
|
|
441
|
+
const C = f.clientHeight - b.offsetTop - b.offsetHeight, K = Math.max(
|
|
442
|
+
ye,
|
|
485
443
|
ae + // viewport might have padding bottom, include it to avoid a scrollable viewport
|
|
486
|
-
(
|
|
487
|
-
),
|
|
488
|
-
|
|
444
|
+
(x ? we : 0) + C + F
|
|
445
|
+
), $ = R + K;
|
|
446
|
+
c.style.height = $ + "px";
|
|
489
447
|
} else {
|
|
490
|
-
const
|
|
491
|
-
|
|
492
|
-
const
|
|
448
|
+
const x = B.length > 0 && u === B[0].ref.current;
|
|
449
|
+
c.style.top = "0px";
|
|
450
|
+
const K = Math.max(
|
|
493
451
|
J,
|
|
494
|
-
|
|
495
|
-
(
|
|
452
|
+
O + b.offsetTop + // viewport might have padding top, include it to avoid a scrollable viewport
|
|
453
|
+
(x ? Se : 0) + ae
|
|
496
454
|
) + L;
|
|
497
|
-
|
|
455
|
+
c.style.height = K + "px", b.scrollTop = R - J + b.offsetTop;
|
|
498
456
|
}
|
|
499
|
-
|
|
457
|
+
c.style.margin = `${V}px 0`, c.style.minHeight = ge + "px", c.style.maxHeight = z + "px", s == null || s(), requestAnimationFrame(() => E.current = !0);
|
|
500
458
|
}
|
|
501
459
|
}, [
|
|
502
|
-
|
|
460
|
+
S,
|
|
503
461
|
a.trigger,
|
|
504
462
|
a.valueNode,
|
|
505
|
-
|
|
463
|
+
c,
|
|
506
464
|
f,
|
|
507
|
-
|
|
465
|
+
b,
|
|
508
466
|
u,
|
|
509
|
-
|
|
467
|
+
y,
|
|
510
468
|
a.dir,
|
|
511
469
|
s
|
|
512
470
|
]);
|
|
513
471
|
j(() => p(), [p]);
|
|
514
|
-
const [
|
|
472
|
+
const [I, M] = n.useState();
|
|
515
473
|
j(() => {
|
|
516
|
-
f &&
|
|
474
|
+
f && M(window.getComputedStyle(f).zIndex);
|
|
517
475
|
}, [f]);
|
|
518
476
|
const ce = n.useCallback(
|
|
519
|
-
(
|
|
520
|
-
|
|
477
|
+
(D) => {
|
|
478
|
+
D && _.current === !0 && (p(), v == null || v(), _.current = !1);
|
|
521
479
|
},
|
|
522
|
-
[p,
|
|
480
|
+
[p, v]
|
|
523
481
|
);
|
|
524
482
|
return /* @__PURE__ */ d(
|
|
525
|
-
|
|
483
|
+
ao,
|
|
526
484
|
{
|
|
527
485
|
scope: e,
|
|
528
|
-
contentWrapper:
|
|
529
|
-
shouldExpandOnScrollRef:
|
|
486
|
+
contentWrapper: c,
|
|
487
|
+
shouldExpandOnScrollRef: E,
|
|
530
488
|
onScrollButtonChange: ce,
|
|
531
489
|
children: /* @__PURE__ */ d(
|
|
532
490
|
"div",
|
|
@@ -536,13 +494,13 @@ var so = "SelectItemAlignedPosition", et = n.forwardRef((t, o) => {
|
|
|
536
494
|
display: "flex",
|
|
537
495
|
flexDirection: "column",
|
|
538
496
|
position: "fixed",
|
|
539
|
-
zIndex:
|
|
497
|
+
zIndex: I
|
|
540
498
|
},
|
|
541
499
|
children: /* @__PURE__ */ d(
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
ref:
|
|
545
|
-
style:
|
|
500
|
+
k.div,
|
|
501
|
+
w(h({}, r), {
|
|
502
|
+
ref: P,
|
|
503
|
+
style: h({
|
|
546
504
|
// When we get the height of the content, it includes borders. If we were to set
|
|
547
505
|
// the height without having `boxSizing: 'border-box'` it would be too big.
|
|
548
506
|
boxSizing: "border-box",
|
|
@@ -556,24 +514,24 @@ var so = "SelectItemAlignedPosition", et = n.forwardRef((t, o) => {
|
|
|
556
514
|
}
|
|
557
515
|
);
|
|
558
516
|
});
|
|
559
|
-
|
|
560
|
-
var
|
|
561
|
-
const
|
|
517
|
+
Ze.displayName = no;
|
|
518
|
+
var so = "SelectPopperPosition", Ie = n.forwardRef((t, o) => {
|
|
519
|
+
const c = t, {
|
|
562
520
|
__scopeSelect: e,
|
|
563
521
|
align: s = "start",
|
|
564
|
-
collisionPadding: r =
|
|
565
|
-
} =
|
|
522
|
+
collisionPadding: r = V
|
|
523
|
+
} = c, a = T(c, [
|
|
566
524
|
"__scopeSelect",
|
|
567
525
|
"align",
|
|
568
526
|
"collisionPadding"
|
|
569
|
-
]),
|
|
527
|
+
]), l = ve(e);
|
|
570
528
|
return /* @__PURE__ */ d(
|
|
571
|
-
|
|
572
|
-
|
|
529
|
+
Ft,
|
|
530
|
+
w(h(h({}, l), a), {
|
|
573
531
|
ref: o,
|
|
574
532
|
align: s,
|
|
575
533
|
collisionPadding: r,
|
|
576
|
-
style:
|
|
534
|
+
style: w(h({
|
|
577
535
|
// Ensure border-box for floating-ui calculations
|
|
578
536
|
boxSizing: "border-box"
|
|
579
537
|
}, a.style), {
|
|
@@ -586,11 +544,11 @@ var ao = "SelectPopperPosition", Ne = n.forwardRef((t, o) => {
|
|
|
586
544
|
})
|
|
587
545
|
);
|
|
588
546
|
});
|
|
589
|
-
|
|
590
|
-
var [
|
|
547
|
+
Ie.displayName = so;
|
|
548
|
+
var [ao, Me] = le(te, {}), Te = "SelectViewport", Je = n.forwardRef(
|
|
591
549
|
(t, o) => {
|
|
592
|
-
const f = t, { __scopeSelect: e, nonce: s } = f, r =
|
|
593
|
-
return /* @__PURE__ */
|
|
550
|
+
const f = t, { __scopeSelect: e, nonce: s } = f, r = T(f, ["__scopeSelect", "nonce"]), a = q(Te, e), l = Me(Te, e), c = G(o, a.onViewportChange), i = n.useRef(0);
|
|
551
|
+
return /* @__PURE__ */ Q(Ee, { children: [
|
|
594
552
|
/* @__PURE__ */ d(
|
|
595
553
|
"style",
|
|
596
554
|
{
|
|
@@ -600,14 +558,14 @@ var [lo, Oe] = le(te, {}), Re = "SelectViewport", tt = n.forwardRef(
|
|
|
600
558
|
nonce: s
|
|
601
559
|
}
|
|
602
560
|
),
|
|
603
|
-
/* @__PURE__ */ d(
|
|
604
|
-
|
|
605
|
-
|
|
561
|
+
/* @__PURE__ */ d(me.Slot, { scope: e, children: /* @__PURE__ */ d(
|
|
562
|
+
k.div,
|
|
563
|
+
w(h({
|
|
606
564
|
"data-radix-select-viewport": "",
|
|
607
565
|
role: "presentation"
|
|
608
566
|
}, r), {
|
|
609
|
-
ref:
|
|
610
|
-
style:
|
|
567
|
+
ref: c,
|
|
568
|
+
style: h({
|
|
611
569
|
// we use position: 'relative' here on the `viewport` so that when we call
|
|
612
570
|
// `selectedItem.offsetTop` in calculations, the offset is relative to the viewport
|
|
613
571
|
// (independent of the scrollUpButton).
|
|
@@ -619,121 +577,121 @@ var [lo, Oe] = le(te, {}), Re = "SelectViewport", tt = n.forwardRef(
|
|
|
619
577
|
// https://developer.chrome.com/blog/vertical-form-controls
|
|
620
578
|
overflow: "hidden auto"
|
|
621
579
|
}, r.style),
|
|
622
|
-
onScroll: A(r.onScroll, (
|
|
623
|
-
const
|
|
624
|
-
if (
|
|
625
|
-
const
|
|
626
|
-
if (
|
|
627
|
-
const
|
|
628
|
-
if (
|
|
629
|
-
const p =
|
|
630
|
-
|
|
580
|
+
onScroll: A(r.onScroll, (g) => {
|
|
581
|
+
const P = g.currentTarget, { contentWrapper: S, shouldExpandOnScrollRef: E } = l;
|
|
582
|
+
if (E != null && E.current && S) {
|
|
583
|
+
const _ = Math.abs(i.current - P.scrollTop);
|
|
584
|
+
if (_ > 0) {
|
|
585
|
+
const b = window.innerHeight - V * 2, u = parseFloat(S.style.minHeight), y = parseFloat(S.style.height), v = Math.max(u, y);
|
|
586
|
+
if (v < b) {
|
|
587
|
+
const p = v + _, I = Math.min(b, p), M = p - I;
|
|
588
|
+
S.style.height = I + "px", S.style.bottom === "0px" && (P.scrollTop = M > 0 ? M : 0, S.style.justifyContent = "flex-end");
|
|
631
589
|
}
|
|
632
590
|
}
|
|
633
591
|
}
|
|
634
|
-
i.current =
|
|
592
|
+
i.current = P.scrollTop;
|
|
635
593
|
})
|
|
636
594
|
})
|
|
637
595
|
) })
|
|
638
596
|
] });
|
|
639
597
|
}
|
|
640
598
|
);
|
|
641
|
-
|
|
642
|
-
var
|
|
599
|
+
Je.displayName = Te;
|
|
600
|
+
var Qe = "SelectGroup", [lo, co] = le(Qe), et = n.forwardRef(
|
|
643
601
|
(t, o) => {
|
|
644
|
-
const a = t, { __scopeSelect: e } = a, s =
|
|
645
|
-
return /* @__PURE__ */ d(
|
|
602
|
+
const a = t, { __scopeSelect: e } = a, s = T(a, ["__scopeSelect"]), r = _e();
|
|
603
|
+
return /* @__PURE__ */ d(lo, { scope: e, id: r, children: /* @__PURE__ */ d(k.div, w(h({ role: "group", "aria-labelledby": r }, s), { ref: o })) });
|
|
646
604
|
}
|
|
647
605
|
);
|
|
648
|
-
|
|
649
|
-
var
|
|
606
|
+
et.displayName = Qe;
|
|
607
|
+
var tt = "SelectLabel", ot = n.forwardRef(
|
|
650
608
|
(t, o) => {
|
|
651
|
-
const a = t, { __scopeSelect: e } = a, s =
|
|
652
|
-
return /* @__PURE__ */ d(
|
|
609
|
+
const a = t, { __scopeSelect: e } = a, s = T(a, ["__scopeSelect"]), r = co(tt, e);
|
|
610
|
+
return /* @__PURE__ */ d(k.div, w(h({ id: r.id }, s), { ref: o }));
|
|
653
611
|
}
|
|
654
612
|
);
|
|
655
|
-
|
|
656
|
-
var
|
|
613
|
+
ot.displayName = tt;
|
|
614
|
+
var fe = "SelectItem", [io, rt] = le(fe), nt = n.forwardRef(
|
|
657
615
|
(t, o) => {
|
|
658
|
-
const
|
|
616
|
+
const v = t, {
|
|
659
617
|
__scopeSelect: e,
|
|
660
618
|
value: s,
|
|
661
619
|
disabled: r = !1,
|
|
662
620
|
textValue: a
|
|
663
|
-
} =
|
|
621
|
+
} = v, l = T(v, [
|
|
664
622
|
"__scopeSelect",
|
|
665
623
|
"value",
|
|
666
624
|
"disabled",
|
|
667
625
|
"textValue"
|
|
668
|
-
]),
|
|
626
|
+
]), c = Y(fe, e), i = q(fe, e), f = c.value === s, [g, P] = n.useState(a != null ? a : ""), [S, E] = n.useState(!1), _ = G(
|
|
669
627
|
o,
|
|
670
628
|
(p) => {
|
|
671
|
-
var
|
|
672
|
-
return (
|
|
629
|
+
var I;
|
|
630
|
+
return (I = i.itemRefCallback) == null ? void 0 : I.call(i, p, s, r);
|
|
673
631
|
}
|
|
674
|
-
),
|
|
675
|
-
r || (
|
|
632
|
+
), b = _e(), u = n.useRef("touch"), y = () => {
|
|
633
|
+
r || (c.onValueChange(s), c.onOpenChange(!1));
|
|
676
634
|
};
|
|
677
635
|
if (s === "")
|
|
678
636
|
throw new Error(
|
|
679
637
|
"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."
|
|
680
638
|
);
|
|
681
639
|
return /* @__PURE__ */ d(
|
|
682
|
-
|
|
640
|
+
io,
|
|
683
641
|
{
|
|
684
642
|
scope: e,
|
|
685
643
|
value: s,
|
|
686
644
|
disabled: r,
|
|
687
|
-
textId:
|
|
645
|
+
textId: b,
|
|
688
646
|
isSelected: f,
|
|
689
647
|
onItemTextChange: n.useCallback((p) => {
|
|
690
|
-
|
|
691
|
-
var
|
|
692
|
-
return
|
|
648
|
+
P((I) => {
|
|
649
|
+
var M;
|
|
650
|
+
return I || ((M = p == null ? void 0 : p.textContent) != null ? M : "").trim();
|
|
693
651
|
});
|
|
694
652
|
}, []),
|
|
695
653
|
children: /* @__PURE__ */ d(
|
|
696
|
-
|
|
654
|
+
me.ItemSlot,
|
|
697
655
|
{
|
|
698
656
|
scope: e,
|
|
699
657
|
value: s,
|
|
700
658
|
disabled: r,
|
|
701
|
-
textValue:
|
|
659
|
+
textValue: g,
|
|
702
660
|
children: /* @__PURE__ */ d(
|
|
703
|
-
|
|
704
|
-
|
|
661
|
+
k.div,
|
|
662
|
+
w(h({
|
|
705
663
|
role: "option",
|
|
706
|
-
"aria-labelledby":
|
|
707
|
-
"data-highlighted":
|
|
708
|
-
"aria-selected": f &&
|
|
664
|
+
"aria-labelledby": b,
|
|
665
|
+
"data-highlighted": S ? "" : void 0,
|
|
666
|
+
"aria-selected": f && S,
|
|
709
667
|
"data-state": f ? "checked" : "unchecked",
|
|
710
668
|
"aria-disabled": r || void 0,
|
|
711
669
|
"data-disabled": r ? "" : void 0,
|
|
712
670
|
tabIndex: r ? void 0 : -1
|
|
713
|
-
},
|
|
714
|
-
ref:
|
|
715
|
-
onFocus: A(
|
|
716
|
-
onBlur: A(
|
|
717
|
-
onClick: A(
|
|
718
|
-
u.current !== "mouse" &&
|
|
671
|
+
}, l), {
|
|
672
|
+
ref: _,
|
|
673
|
+
onFocus: A(l.onFocus, () => E(!0)),
|
|
674
|
+
onBlur: A(l.onBlur, () => E(!1)),
|
|
675
|
+
onClick: A(l.onClick, () => {
|
|
676
|
+
console.log("test"), u.current !== "mouse" && y();
|
|
719
677
|
}),
|
|
720
|
-
onPointerUp: A(
|
|
721
|
-
u.current === "mouse" &&
|
|
678
|
+
onPointerUp: A(l.onPointerUp, () => {
|
|
679
|
+
u.current === "mouse" && y();
|
|
722
680
|
}),
|
|
723
|
-
onPointerDown: A(
|
|
681
|
+
onPointerDown: A(l.onPointerDown, (p) => {
|
|
724
682
|
u.current = p.pointerType;
|
|
725
683
|
}),
|
|
726
|
-
onPointerMove: A(
|
|
727
|
-
var
|
|
728
|
-
u.current = p.pointerType, r ? (
|
|
684
|
+
onPointerMove: A(l.onPointerMove, (p) => {
|
|
685
|
+
var I;
|
|
686
|
+
u.current = p.pointerType, r ? (I = i.onItemLeave) == null || I.call(i) : u.current === "mouse" && p.currentTarget.focus({ preventScroll: !0 });
|
|
729
687
|
}),
|
|
730
|
-
onPointerLeave: A(
|
|
731
|
-
var
|
|
732
|
-
p.currentTarget === document.activeElement && ((
|
|
688
|
+
onPointerLeave: A(l.onPointerLeave, (p) => {
|
|
689
|
+
var I;
|
|
690
|
+
p.currentTarget === document.activeElement && ((I = i.onItemLeave) == null || I.call(i));
|
|
733
691
|
}),
|
|
734
|
-
onKeyDown: A(
|
|
735
|
-
var
|
|
736
|
-
((
|
|
692
|
+
onKeyDown: A(l.onKeyDown, (p) => {
|
|
693
|
+
var M;
|
|
694
|
+
((M = i.searchRef) == null ? void 0 : M.current) !== "" && p.key === " " || (qt.includes(p.key) && y(), p.key === " " && p.preventDefault());
|
|
737
695
|
})
|
|
738
696
|
})
|
|
739
697
|
)
|
|
@@ -743,148 +701,158 @@ var me = "SelectItem", [uo, at] = le(me), lt = n.forwardRef(
|
|
|
743
701
|
);
|
|
744
702
|
}
|
|
745
703
|
);
|
|
746
|
-
|
|
747
|
-
var ie = "SelectItemText",
|
|
704
|
+
nt.displayName = fe;
|
|
705
|
+
var ie = "SelectItemText", st = n.forwardRef(
|
|
748
706
|
(t, o) => {
|
|
749
|
-
const
|
|
707
|
+
const y = t, { __scopeSelect: e, className: s, style: r } = y, a = T(y, ["__scopeSelect", "className", "style"]), l = Y(ie, e), c = q(ie, e), i = rt(ie, e), f = Qt(ie, e), [g, P] = n.useState(null), S = G(
|
|
750
708
|
o,
|
|
751
|
-
(
|
|
709
|
+
(v) => P(v),
|
|
752
710
|
i.onItemTextChange,
|
|
753
|
-
(
|
|
711
|
+
(v) => {
|
|
754
712
|
var p;
|
|
755
|
-
return (p =
|
|
713
|
+
return (p = c.itemTextRefCallback) == null ? void 0 : p.call(c, v, i.value, i.disabled);
|
|
756
714
|
}
|
|
757
|
-
),
|
|
758
|
-
() => /* @__PURE__ */ d("option", { value: i.value, disabled: i.disabled, children:
|
|
759
|
-
[i.disabled, i.value,
|
|
760
|
-
), { onNativeOptionAdd:
|
|
761
|
-
return j(() => (
|
|
762
|
-
/* @__PURE__ */ d(
|
|
763
|
-
i.isSelected &&
|
|
715
|
+
), E = g == null ? void 0 : g.textContent, _ = n.useMemo(
|
|
716
|
+
() => /* @__PURE__ */ d("option", { value: i.value, disabled: i.disabled, children: E }, i.value),
|
|
717
|
+
[i.disabled, i.value, E]
|
|
718
|
+
), { onNativeOptionAdd: b, onNativeOptionRemove: u } = f;
|
|
719
|
+
return j(() => (b(_), () => u(_)), [b, u, _]), /* @__PURE__ */ Q(Ee, { children: [
|
|
720
|
+
/* @__PURE__ */ d(k.span, w(h({ id: i.textId }, a), { ref: S })),
|
|
721
|
+
i.isSelected && l.valueNode && !l.valueNodeHasChildren ? Be.createPortal(a.children, l.valueNode) : null
|
|
764
722
|
] });
|
|
765
723
|
}
|
|
766
724
|
);
|
|
767
|
-
|
|
768
|
-
var
|
|
725
|
+
st.displayName = ie;
|
|
726
|
+
var at = "SelectItemIndicator", lt = n.forwardRef(
|
|
769
727
|
(t, o) => {
|
|
770
|
-
const a = t, { __scopeSelect: e } = a, s =
|
|
771
|
-
return at
|
|
728
|
+
const a = t, { __scopeSelect: e } = a, s = T(a, ["__scopeSelect"]);
|
|
729
|
+
return rt(at, e).isSelected ? /* @__PURE__ */ d(k.span, w(h({ "aria-hidden": !0 }, s), { ref: o })) : null;
|
|
772
730
|
}
|
|
773
731
|
);
|
|
774
|
-
|
|
775
|
-
var
|
|
776
|
-
const e =
|
|
732
|
+
lt.displayName = at;
|
|
733
|
+
var Ne = "SelectScrollUpButton", ct = n.forwardRef((t, o) => {
|
|
734
|
+
const e = q(Ne, t.__scopeSelect), s = Me(Ne, t.__scopeSelect), [r, a] = n.useState(!1), l = G(o, s.onScrollButtonChange);
|
|
777
735
|
return j(() => {
|
|
778
736
|
if (e.viewport && e.isPositioned) {
|
|
779
|
-
let
|
|
737
|
+
let c = function() {
|
|
780
738
|
const f = i.scrollTop > 0;
|
|
781
739
|
a(f);
|
|
782
740
|
};
|
|
783
741
|
const i = e.viewport;
|
|
784
|
-
return
|
|
742
|
+
return c(), i.addEventListener("scroll", c), () => i.removeEventListener("scroll", c);
|
|
785
743
|
}
|
|
786
744
|
}, [e.viewport, e.isPositioned]), r ? /* @__PURE__ */ d(
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
ref:
|
|
745
|
+
dt,
|
|
746
|
+
w(h({}, t), {
|
|
747
|
+
ref: l,
|
|
790
748
|
onAutoScroll: () => {
|
|
791
|
-
const { viewport:
|
|
792
|
-
|
|
749
|
+
const { viewport: c, selectedItem: i } = e;
|
|
750
|
+
c && i && (c.scrollTop = c.scrollTop - i.offsetHeight);
|
|
793
751
|
}
|
|
794
752
|
})
|
|
795
753
|
) : null;
|
|
796
754
|
});
|
|
797
|
-
|
|
798
|
-
var
|
|
799
|
-
const e =
|
|
755
|
+
ct.displayName = Ne;
|
|
756
|
+
var Re = "SelectScrollDownButton", it = n.forwardRef((t, o) => {
|
|
757
|
+
const e = q(Re, t.__scopeSelect), s = Me(Re, t.__scopeSelect), [r, a] = n.useState(!1), l = G(o, s.onScrollButtonChange);
|
|
800
758
|
return j(() => {
|
|
801
759
|
if (e.viewport && e.isPositioned) {
|
|
802
|
-
let
|
|
803
|
-
const f = i.scrollHeight - i.clientHeight,
|
|
804
|
-
a(
|
|
760
|
+
let c = function() {
|
|
761
|
+
const f = i.scrollHeight - i.clientHeight, g = Math.ceil(i.scrollTop) < f;
|
|
762
|
+
a(g);
|
|
805
763
|
};
|
|
806
764
|
const i = e.viewport;
|
|
807
|
-
return
|
|
765
|
+
return c(), i.addEventListener("scroll", c), () => i.removeEventListener("scroll", c);
|
|
808
766
|
}
|
|
809
767
|
}, [e.viewport, e.isPositioned]), r ? /* @__PURE__ */ d(
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
ref:
|
|
768
|
+
dt,
|
|
769
|
+
w(h({}, t), {
|
|
770
|
+
ref: l,
|
|
813
771
|
onAutoScroll: () => {
|
|
814
|
-
const { viewport:
|
|
815
|
-
|
|
772
|
+
const { viewport: c, selectedItem: i } = e;
|
|
773
|
+
c && i && (c.scrollTop = c.scrollTop + i.offsetHeight);
|
|
816
774
|
}
|
|
817
775
|
})
|
|
818
776
|
) : null;
|
|
819
777
|
});
|
|
820
|
-
|
|
821
|
-
var
|
|
822
|
-
const f = t, { __scopeSelect: e, onAutoScroll: s } = f, r =
|
|
823
|
-
|
|
778
|
+
it.displayName = Re;
|
|
779
|
+
var dt = n.forwardRef((t, o) => {
|
|
780
|
+
const f = t, { __scopeSelect: e, onAutoScroll: s } = f, r = T(f, ["__scopeSelect", "onAutoScroll"]), a = q("SelectScrollButton", e), l = n.useRef(null), c = he(e), i = n.useCallback(() => {
|
|
781
|
+
l.current !== null && (window.clearInterval(l.current), l.current = null);
|
|
824
782
|
}, []);
|
|
825
783
|
return n.useEffect(() => () => i(), [i]), j(() => {
|
|
826
|
-
var
|
|
827
|
-
const
|
|
828
|
-
(
|
|
829
|
-
}, [
|
|
830
|
-
|
|
831
|
-
|
|
784
|
+
var P;
|
|
785
|
+
const g = c().find((S) => S.ref.current === document.activeElement);
|
|
786
|
+
(P = g == null ? void 0 : g.ref.current) == null || P.scrollIntoView({ block: "nearest" });
|
|
787
|
+
}, [c]), /* @__PURE__ */ d(
|
|
788
|
+
k.div,
|
|
789
|
+
w(h({
|
|
832
790
|
"aria-hidden": !0
|
|
833
791
|
}, r), {
|
|
834
792
|
ref: o,
|
|
835
|
-
style:
|
|
793
|
+
style: h({ flexShrink: 0 }, r.style),
|
|
836
794
|
onPointerDown: A(r.onPointerDown, () => {
|
|
837
|
-
|
|
795
|
+
l.current === null && (l.current = window.setInterval(s, 50));
|
|
838
796
|
}),
|
|
839
797
|
onPointerMove: A(r.onPointerMove, () => {
|
|
840
|
-
var
|
|
841
|
-
(
|
|
798
|
+
var g;
|
|
799
|
+
(g = a.onItemLeave) == null || g.call(a), l.current === null && (l.current = window.setInterval(s, 50));
|
|
842
800
|
}),
|
|
843
801
|
onPointerLeave: A(r.onPointerLeave, () => {
|
|
844
802
|
i();
|
|
845
803
|
})
|
|
846
804
|
})
|
|
847
805
|
);
|
|
848
|
-
}),
|
|
806
|
+
}), uo = "SelectSeparator", ut = n.forwardRef(
|
|
849
807
|
(t, o) => {
|
|
850
|
-
const r = t, { __scopeSelect: e } = r, s =
|
|
851
|
-
return /* @__PURE__ */ d(
|
|
808
|
+
const r = t, { __scopeSelect: e } = r, s = T(r, ["__scopeSelect"]);
|
|
809
|
+
return /* @__PURE__ */ d(k.div, w(h({ "aria-hidden": !0 }, s), { ref: o }));
|
|
852
810
|
}
|
|
853
811
|
);
|
|
854
|
-
|
|
855
|
-
var
|
|
812
|
+
ut.displayName = uo;
|
|
813
|
+
var Pe = "SelectArrow", po = n.forwardRef(
|
|
856
814
|
(t, o) => {
|
|
857
|
-
const
|
|
858
|
-
return a.open &&
|
|
815
|
+
const c = t, { __scopeSelect: e } = c, s = T(c, ["__scopeSelect"]), r = ve(e), a = Y(Pe, e), l = q(Pe, e);
|
|
816
|
+
return a.open && l.position === "popper" ? /* @__PURE__ */ d(Kt, w(h(h({}, r), s), { ref: o })) : null;
|
|
859
817
|
}
|
|
860
818
|
);
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
}
|
|
865
|
-
|
|
866
|
-
(t, o) => {
|
|
867
|
-
const l = t, { value: e } = l, s = E(l, ["value"]), r = n.useRef(null), a = B(o, r), c = Wt(e);
|
|
819
|
+
po.displayName = Pe;
|
|
820
|
+
var fo = "SelectBubbleInput", pt = n.forwardRef(
|
|
821
|
+
(r, s) => {
|
|
822
|
+
var a = r, { __scopeSelect: t, value: o } = a, e = T(a, ["__scopeSelect", "value"]);
|
|
823
|
+
const l = n.useRef(null), c = G(s, l), i = $t(o);
|
|
868
824
|
return n.useEffect(() => {
|
|
869
|
-
const
|
|
870
|
-
|
|
825
|
+
const f = l.current;
|
|
826
|
+
if (!f) return;
|
|
827
|
+
const g = window.HTMLSelectElement.prototype, S = Object.getOwnPropertyDescriptor(
|
|
828
|
+
g,
|
|
871
829
|
"value"
|
|
872
830
|
).set;
|
|
873
|
-
if (
|
|
874
|
-
const
|
|
875
|
-
|
|
831
|
+
if (i !== o && S) {
|
|
832
|
+
const E = new Event("change", { bubbles: !0 });
|
|
833
|
+
S.call(f, o), f.dispatchEvent(E);
|
|
876
834
|
}
|
|
877
|
-
}, [
|
|
835
|
+
}, [i, o]), /* @__PURE__ */ d(
|
|
836
|
+
k.select,
|
|
837
|
+
w(h({}, e), {
|
|
838
|
+
style: h(h({}, Gt), e.style),
|
|
839
|
+
ref: c,
|
|
840
|
+
defaultValue: o
|
|
841
|
+
})
|
|
842
|
+
);
|
|
878
843
|
}
|
|
879
844
|
);
|
|
880
|
-
|
|
881
|
-
function
|
|
845
|
+
pt.displayName = fo;
|
|
846
|
+
function ft(t) {
|
|
847
|
+
return t === "" || t === void 0;
|
|
848
|
+
}
|
|
849
|
+
function mt(t) {
|
|
882
850
|
const o = Mt(t), e = n.useRef(""), s = n.useRef(0), r = n.useCallback(
|
|
883
|
-
(
|
|
884
|
-
const
|
|
885
|
-
o(
|
|
851
|
+
(l) => {
|
|
852
|
+
const c = e.current + l;
|
|
853
|
+
o(c), function i(f) {
|
|
886
854
|
e.current = f, window.clearTimeout(s.current), f !== "" && (s.current = window.setTimeout(() => i(""), 1e3));
|
|
887
|
-
}(
|
|
855
|
+
}(c);
|
|
888
856
|
},
|
|
889
857
|
[o]
|
|
890
858
|
), a = n.useCallback(() => {
|
|
@@ -892,11 +860,11 @@ function gt(t) {
|
|
|
892
860
|
}, []);
|
|
893
861
|
return n.useEffect(() => () => window.clearTimeout(s.current), []), [e, r, a];
|
|
894
862
|
}
|
|
895
|
-
function
|
|
863
|
+
function ht(t, o, e) {
|
|
896
864
|
const r = o.length > 1 && Array.from(o).every((f) => f === o[0]) ? o[0] : o, a = e ? t.indexOf(e) : -1;
|
|
897
|
-
let
|
|
898
|
-
r.length === 1 && (
|
|
899
|
-
const i =
|
|
865
|
+
let l = mo(t, Math.max(a, 0));
|
|
866
|
+
r.length === 1 && (l = l.filter((f) => f !== e));
|
|
867
|
+
const i = l.find(
|
|
900
868
|
(f) => f.textValue.toLowerCase().startsWith(r.toLowerCase())
|
|
901
869
|
);
|
|
902
870
|
return i !== e ? i : void 0;
|
|
@@ -904,8 +872,8 @@ function St(t, o, e) {
|
|
|
904
872
|
function mo(t, o) {
|
|
905
873
|
return t.map((e, s) => t[(o + s) % t.length]);
|
|
906
874
|
}
|
|
907
|
-
var ho =
|
|
908
|
-
const
|
|
875
|
+
var ho = We, vt = Ke, vo = Ge, go = ze, So = je, gt = Ye, wo = Je, yo = et, St = ot, wt = nt, bo = st, xo = lt, yt = ct, bt = it, xt = ut;
|
|
876
|
+
const er = ho, tr = yo, or = vo, Co = oe({
|
|
909
877
|
base: [
|
|
910
878
|
"flex h-10 w-full items-center justify-between whitespace-nowrap rounded-lg border border-secondary-border bg-secondary-bg px-3 py-2.5 shadow-sm outline-none lg:h-9 lg:py-2",
|
|
911
879
|
"text-sm text-primary-fg",
|
|
@@ -930,36 +898,36 @@ const Xo = ho, Zo = yo, Jo = vo, xo = oe({
|
|
|
930
898
|
icon: "h-4 w-4 text-muted group-disabled:hidden"
|
|
931
899
|
}
|
|
932
900
|
}), Io = n.forwardRef((a, r) => {
|
|
933
|
-
var
|
|
934
|
-
const
|
|
935
|
-
return /* @__PURE__ */
|
|
901
|
+
var l = a, { className: t, children: o, invalid: e } = l, s = T(l, ["className", "children", "invalid"]);
|
|
902
|
+
const c = Co({ invalid: e });
|
|
903
|
+
return /* @__PURE__ */ Q(vt, w(h({ ref: r, className: c.base({ className: t }) }, s), { children: [
|
|
936
904
|
o,
|
|
937
|
-
/* @__PURE__ */ d(go, { asChild: !0, children: /* @__PURE__ */ d(
|
|
905
|
+
/* @__PURE__ */ d(go, { asChild: !0, children: /* @__PURE__ */ d(Ue, { className: c.icon() }) })
|
|
938
906
|
] }));
|
|
939
907
|
});
|
|
940
|
-
Io.displayName =
|
|
908
|
+
Io.displayName = vt.displayName;
|
|
941
909
|
const To = oe({
|
|
942
910
|
base: ["flex cursor-default items-center justify-center py-1"],
|
|
943
911
|
slots: {
|
|
944
912
|
icon: "h-4 w-4"
|
|
945
913
|
}
|
|
946
|
-
}),
|
|
947
|
-
var r = s, { className: t } = r, o =
|
|
914
|
+
}), Ct = n.forwardRef((s, e) => {
|
|
915
|
+
var r = s, { className: t } = r, o = T(r, ["className"]);
|
|
948
916
|
const a = To();
|
|
949
|
-
return /* @__PURE__ */ d(
|
|
917
|
+
return /* @__PURE__ */ d(yt, w(h({ ref: e, className: a.base({ className: t }) }, o), { children: /* @__PURE__ */ d(jt, { className: a.icon() }) }));
|
|
950
918
|
});
|
|
951
|
-
|
|
919
|
+
Ct.displayName = yt.displayName;
|
|
952
920
|
const No = oe({
|
|
953
921
|
base: ["flex cursor-default items-center justify-center py-1"],
|
|
954
922
|
slots: {
|
|
955
923
|
icon: "h-4 w-4"
|
|
956
924
|
}
|
|
957
|
-
}),
|
|
958
|
-
var r = s, { className: t } = r, o =
|
|
925
|
+
}), It = n.forwardRef((s, e) => {
|
|
926
|
+
var r = s, { className: t } = r, o = T(r, ["className"]);
|
|
959
927
|
const a = No();
|
|
960
|
-
return /* @__PURE__ */ d(
|
|
928
|
+
return /* @__PURE__ */ d(bt, w(h({ ref: e, className: a.base({ className: t }) }, o), { children: /* @__PURE__ */ d(Ue, { className: a.icon() }) }));
|
|
961
929
|
});
|
|
962
|
-
|
|
930
|
+
It.displayName = bt.displayName;
|
|
963
931
|
const Ro = oe({
|
|
964
932
|
base: [
|
|
965
933
|
"relative z-50 max-h-[--radix-select-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-lg",
|
|
@@ -980,31 +948,31 @@ const Ro = oe({
|
|
|
980
948
|
}
|
|
981
949
|
}
|
|
982
950
|
}), Po = n.forwardRef((a, r) => {
|
|
983
|
-
var
|
|
984
|
-
const
|
|
985
|
-
return /* @__PURE__ */ d(So, { children: /* @__PURE__ */ d(
|
|
986
|
-
|
|
987
|
-
|
|
951
|
+
var l = a, { className: t, children: o, position: e = "popper" } = l, s = T(l, ["className", "children", "position"]);
|
|
952
|
+
const c = Ro({ position: e });
|
|
953
|
+
return /* @__PURE__ */ d(So, { children: /* @__PURE__ */ d(Lt, { children: /* @__PURE__ */ Q(
|
|
954
|
+
gt,
|
|
955
|
+
w(h({
|
|
988
956
|
ref: r,
|
|
989
|
-
className:
|
|
957
|
+
className: c.base({ className: t }),
|
|
990
958
|
position: e
|
|
991
959
|
}, s), {
|
|
992
960
|
children: [
|
|
993
|
-
/* @__PURE__ */ d(
|
|
994
|
-
/* @__PURE__ */ d(wo, { className:
|
|
995
|
-
/* @__PURE__ */ d(
|
|
961
|
+
/* @__PURE__ */ d(Ct, {}),
|
|
962
|
+
/* @__PURE__ */ d(wo, { className: c.viewport(), children: o }),
|
|
963
|
+
/* @__PURE__ */ d(It, {})
|
|
996
964
|
]
|
|
997
965
|
})
|
|
998
966
|
) }) });
|
|
999
967
|
});
|
|
1000
|
-
Po.displayName =
|
|
968
|
+
Po.displayName = gt.displayName;
|
|
1001
969
|
const Eo = oe({
|
|
1002
970
|
base: ["overflow-hidden overflow-ellipsis px-2 py-1.5 text-xs font-medium text-muted"]
|
|
1003
971
|
}), _o = n.forwardRef((s, e) => {
|
|
1004
|
-
var r = s, { className: t } = r, o =
|
|
1005
|
-
return /* @__PURE__ */ d(
|
|
972
|
+
var r = s, { className: t } = r, o = T(r, ["className"]);
|
|
973
|
+
return /* @__PURE__ */ d(St, h({ ref: e, className: Eo({ className: t }) }, o));
|
|
1006
974
|
});
|
|
1007
|
-
_o.displayName =
|
|
975
|
+
_o.displayName = St.displayName;
|
|
1008
976
|
const Mo = oe({
|
|
1009
977
|
base: [
|
|
1010
978
|
"relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8",
|
|
@@ -1015,31 +983,31 @@ const Mo = oe({
|
|
|
1015
983
|
indicatorIcon: "h-4 w-4"
|
|
1016
984
|
}
|
|
1017
985
|
}), Ao = n.forwardRef((r, s) => {
|
|
1018
|
-
var a = r, { className: t, children: o } = a, e =
|
|
1019
|
-
const
|
|
1020
|
-
return /* @__PURE__ */
|
|
1021
|
-
/* @__PURE__ */ d("span", { className:
|
|
1022
|
-
/* @__PURE__ */ d(
|
|
986
|
+
var a = r, { className: t, children: o } = a, e = T(a, ["className", "children"]);
|
|
987
|
+
const l = Mo();
|
|
988
|
+
return /* @__PURE__ */ Q(wt, w(h({ ref: s, className: l.base({ className: t }) }, e), { children: [
|
|
989
|
+
/* @__PURE__ */ d("span", { className: l.indicator(), children: /* @__PURE__ */ d(xo, { children: /* @__PURE__ */ d(zt, { className: l.indicatorIcon() }) }) }),
|
|
990
|
+
/* @__PURE__ */ d(bo, { children: o })
|
|
1023
991
|
] }));
|
|
1024
992
|
});
|
|
1025
|
-
Ao.displayName =
|
|
1026
|
-
const
|
|
993
|
+
Ao.displayName = wt.displayName;
|
|
994
|
+
const Do = oe({
|
|
1027
995
|
base: ["-mx-1 my-1 h-px bg-muted"]
|
|
1028
|
-
}),
|
|
1029
|
-
var r = s, { className: t } = r, o =
|
|
1030
|
-
return /* @__PURE__ */ d(
|
|
996
|
+
}), Oo = n.forwardRef((s, e) => {
|
|
997
|
+
var r = s, { className: t } = r, o = T(r, ["className"]);
|
|
998
|
+
return /* @__PURE__ */ d(xt, h({ ref: e, className: Do({ className: t }) }, o));
|
|
1031
999
|
});
|
|
1032
|
-
|
|
1000
|
+
Oo.displayName = xt.displayName;
|
|
1033
1001
|
export {
|
|
1034
|
-
|
|
1002
|
+
er as Select,
|
|
1035
1003
|
Po as SelectContent,
|
|
1036
|
-
|
|
1004
|
+
tr as SelectGroup,
|
|
1037
1005
|
Ao as SelectItem,
|
|
1038
1006
|
_o as SelectLabel,
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1007
|
+
It as SelectScrollDownButton,
|
|
1008
|
+
Ct as SelectScrollUpButton,
|
|
1009
|
+
Oo as SelectSeparator,
|
|
1042
1010
|
Io as SelectTrigger,
|
|
1043
|
-
|
|
1011
|
+
or as SelectValue
|
|
1044
1012
|
};
|
|
1045
1013
|
//# sourceMappingURL=select.js.map
|