@senitix/ui 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/avatar-C0aVNCG9.cjs +2 -0
- package/dist/avatar-C0aVNCG9.cjs.map +1 -0
- package/dist/avatar-CN6wcrqY.js +288 -0
- package/dist/avatar-CN6wcrqY.js.map +1 -0
- package/dist/calendar-BFWc4IB7.js +1182 -0
- package/dist/calendar-BFWc4IB7.js.map +1 -0
- package/dist/calendar-BUm7YrNf.cjs +2 -0
- package/dist/calendar-BUm7YrNf.cjs.map +1 -0
- package/dist/calendar-ChJkFXXr.js +11 -0
- package/dist/calendar-ChJkFXXr.js.map +1 -0
- package/dist/calendar-SwL5isYC.cjs +2 -0
- package/dist/calendar-SwL5isYC.cjs.map +1 -0
- package/dist/card-K4fxyYwE.js +51 -0
- package/dist/card-K4fxyYwE.js.map +1 -0
- package/dist/card-tMkUxpmW.cjs +2 -0
- package/dist/card-tMkUxpmW.cjs.map +1 -0
- package/dist/checkbox-CpOq5hkT.js +289 -0
- package/dist/checkbox-CpOq5hkT.js.map +1 -0
- package/dist/checkbox-D7-LQyCl.cjs +2 -0
- package/dist/checkbox-D7-LQyCl.cjs.map +1 -0
- package/dist/chevron-down-DHdXqOqK.cjs +2 -0
- package/dist/chevron-down-DHdXqOqK.cjs.map +1 -0
- package/dist/chevron-down-DJ1_YIFu.js +8 -0
- package/dist/chevron-down-DJ1_YIFu.js.map +1 -0
- package/dist/chevron-right-B3bovvh0.js +8 -0
- package/dist/chevron-right-B3bovvh0.js.map +1 -0
- package/dist/chevron-right-Dvyd11q0.cjs +2 -0
- package/dist/chevron-right-Dvyd11q0.cjs.map +1 -0
- package/dist/chevron-up-B9fuiZhc.cjs +2 -0
- package/dist/chevron-up-B9fuiZhc.cjs.map +1 -0
- package/dist/chevron-up-CGtXOr51.js +6 -0
- package/dist/chevron-up-CGtXOr51.js.map +1 -0
- package/dist/components/charts/index.cjs.js +2 -0
- package/dist/components/charts/index.cjs.js.map +1 -0
- package/dist/components/charts/index.es.js +12 -0
- package/dist/components/charts/index.es.js.map +1 -0
- package/dist/components/data-display/index.cjs.js +2 -0
- package/dist/components/data-display/index.cjs.js.map +1 -0
- package/dist/components/data-display/index.es.js +25 -0
- package/dist/components/data-display/index.es.js.map +1 -0
- package/dist/components/dnd/index.cjs.js +2 -0
- package/dist/components/dnd/index.cjs.js.map +1 -0
- package/dist/components/dnd/index.es.js +9 -0
- package/dist/components/dnd/index.es.js.map +1 -0
- package/dist/components/feedback/index.cjs.js +2 -0
- package/dist/components/feedback/index.cjs.js.map +1 -0
- package/dist/components/feedback/index.es.js +16 -0
- package/dist/components/feedback/index.es.js.map +1 -0
- package/dist/components/forms/index.cjs.js +2 -0
- package/dist/components/forms/index.cjs.js.map +1 -0
- package/dist/components/forms/index.es.js +27 -0
- package/dist/components/forms/index.es.js.map +1 -0
- package/dist/components/layouts/index.cjs.js +2 -0
- package/dist/components/layouts/index.cjs.js.map +1 -0
- package/dist/components/layouts/index.es.js +25 -0
- package/dist/components/layouts/index.es.js.map +1 -0
- package/dist/components/navigation/index.cjs.js +2 -0
- package/dist/components/navigation/index.cjs.js.map +1 -0
- package/dist/components/navigation/index.es.js +42 -0
- package/dist/components/navigation/index.es.js.map +1 -0
- package/dist/components/ui/index.cjs.js +2 -0
- package/dist/components/ui/index.cjs.js.map +1 -0
- package/dist/components/ui/index.es.js +165 -0
- package/dist/components/ui/index.es.js.map +1 -0
- package/dist/createLucideIcon-BbeNo6vq.js +56 -0
- package/dist/createLucideIcon-BbeNo6vq.js.map +1 -0
- package/dist/createLucideIcon-i5GEhNMV.cjs +2 -0
- package/dist/createLucideIcon-i5GEhNMV.cjs.map +1 -0
- package/dist/ellipsis-BW2gWki8.cjs +2 -0
- package/dist/ellipsis-BW2gWki8.cjs.map +1 -0
- package/dist/ellipsis-CiKEaUNP.js +10 -0
- package/dist/ellipsis-CiKEaUNP.js.map +1 -0
- package/dist/file-V_hhCUhr.cjs +2 -0
- package/dist/file-V_hhCUhr.cjs.map +1 -0
- package/dist/file-wzTXnWqz.js +9 -0
- package/dist/file-wzTXnWqz.js.map +1 -0
- package/dist/filter-tags-DjUaNXHR.cjs +5 -0
- package/dist/filter-tags-DjUaNXHR.cjs.map +1 -0
- package/dist/filter-tags-i_I8qV1N.js +2658 -0
- package/dist/filter-tags-i_I8qV1N.js.map +1 -0
- package/dist/full-calendar-7ac2FFU6.js +3518 -0
- package/dist/full-calendar-7ac2FFU6.js.map +1 -0
- package/dist/full-calendar-Cpeh5xMP.cjs +8 -0
- package/dist/full-calendar-Cpeh5xMP.cjs.map +1 -0
- package/dist/global-search-UNXjoFlI.cjs +2 -0
- package/dist/global-search-UNXjoFlI.cjs.map +1 -0
- package/dist/global-search-h1rVbP2q.js +1188 -0
- package/dist/global-search-h1rVbP2q.js.map +1 -0
- package/dist/hooks/index.cjs.js +2 -0
- package/dist/hooks/index.cjs.js.map +1 -0
- package/dist/hooks/index.es.js +13 -0
- package/dist/hooks/index.es.js.map +1 -0
- package/dist/index-Co9o9StL.js +33 -0
- package/dist/index-Co9o9StL.js.map +1 -0
- package/dist/index-CwJPJKOE.js +2278 -0
- package/dist/index-CwJPJKOE.js.map +1 -0
- package/dist/index-CzVK9Zyb.cjs +6 -0
- package/dist/index-CzVK9Zyb.cjs.map +1 -0
- package/dist/index-l828OqQN.js +288 -0
- package/dist/index-l828OqQN.js.map +1 -0
- package/dist/index-lGzB9daF.cjs +2 -0
- package/dist/index-lGzB9daF.cjs.map +1 -0
- package/dist/index-lT9bLt9X.cjs +2 -0
- package/dist/index-lT9bLt9X.cjs.map +1 -0
- package/dist/index.cjs.js +2 -0
- package/dist/index.cjs.js.map +1 -0
- package/dist/index.es.js +332 -0
- package/dist/index.es.js.map +1 -0
- package/dist/input-CZrckPLk.cjs +42 -0
- package/dist/input-CZrckPLk.cjs.map +1 -0
- package/dist/input-D4AoiWxo.js +3629 -0
- package/dist/input-D4AoiWxo.js.map +1 -0
- package/dist/locale-provider-DHMwuneF.cjs +2 -0
- package/dist/locale-provider-DHMwuneF.cjs.map +1 -0
- package/dist/locale-provider-DanG6RRG.js +1012 -0
- package/dist/locale-provider-DanG6RRG.js.map +1 -0
- package/dist/locale-selector-Ppe0KTi-.cjs +2 -0
- package/dist/locale-selector-Ppe0KTi-.cjs.map +1 -0
- package/dist/locale-selector-xn2GpdP9.js +1745 -0
- package/dist/locale-selector-xn2GpdP9.js.map +1 -0
- package/dist/minus-BXBFZSZs.cjs +2 -0
- package/dist/minus-BXBFZSZs.cjs.map +1 -0
- package/dist/minus-DvlYtl96.js +6 -0
- package/dist/minus-DvlYtl96.js.map +1 -0
- package/dist/multi-container-C2UpSw5f.js +731 -0
- package/dist/multi-container-C2UpSw5f.js.map +1 -0
- package/dist/multi-container-DMKL8c9B.cjs +2 -0
- package/dist/multi-container-DMKL8c9B.cjs.map +1 -0
- package/dist/pipeline-By5_8AFg.cjs +2 -0
- package/dist/pipeline-By5_8AFg.cjs.map +1 -0
- package/dist/pipeline-D-QNSU0U.js +1036 -0
- package/dist/pipeline-D-QNSU0U.js.map +1 -0
- package/dist/plus-8wKRkVu-.cjs +2 -0
- package/dist/plus-8wKRkVu-.cjs.map +1 -0
- package/dist/plus-CJD68KQD.js +9 -0
- package/dist/plus-CJD68KQD.js.map +1 -0
- package/dist/popover-4V4sGe1U.js +765 -0
- package/dist/popover-4V4sGe1U.js.map +1 -0
- package/dist/popover-ivh-plLc.cjs +2 -0
- package/dist/popover-ivh-plLc.cjs.map +1 -0
- package/dist/progress-CFnuLqnS.cjs +7 -0
- package/dist/progress-CFnuLqnS.cjs.map +1 -0
- package/dist/progress-D5AsrWa6.js +222 -0
- package/dist/progress-D5AsrWa6.js.map +1 -0
- package/dist/providers/index.cjs.js +2 -0
- package/dist/providers/index.cjs.js.map +1 -0
- package/dist/providers/index.es.js +9 -0
- package/dist/providers/index.es.js.map +1 -0
- package/dist/scroll-area-DQeqDp3Y.js +952 -0
- package/dist/scroll-area-DQeqDp3Y.js.map +1 -0
- package/dist/scroll-area-DYOiJMXh.cjs +2 -0
- package/dist/scroll-area-DYOiJMXh.cjs.map +1 -0
- package/dist/select-C1rNBi6c.js +974 -0
- package/dist/select-C1rNBi6c.js.map +1 -0
- package/dist/select-m-Mqwxu3.cjs +2 -0
- package/dist/select-m-Mqwxu3.cjs.map +1 -0
- package/dist/separator-DBUivkHq.cjs +2 -0
- package/dist/separator-DBUivkHq.cjs.map +1 -0
- package/dist/separator-DsfoJx-2.js +395 -0
- package/dist/separator-DsfoJx-2.js.map +1 -0
- package/dist/sheet-BVWCpq7E.js +84 -0
- package/dist/sheet-BVWCpq7E.js.map +1 -0
- package/dist/sheet-mKiFLVnK.cjs +2 -0
- package/dist/sheet-mKiFLVnK.cjs.map +1 -0
- package/dist/skeleton-BSwwYaQU.cjs +2 -0
- package/dist/skeleton-BSwwYaQU.cjs.map +1 -0
- package/dist/skeleton-BmGbfJw3.js +9 -0
- package/dist/skeleton-BmGbfJw3.js.map +1 -0
- package/dist/sortable.esm-Blhf_jh1.js +3391 -0
- package/dist/sortable.esm-Blhf_jh1.js.map +1 -0
- package/dist/sortable.esm-DcQYlXi3.cjs +6 -0
- package/dist/sortable.esm-DcQYlXi3.cjs.map +1 -0
- package/dist/sparkline-chart-Da-ehDGv.js +21082 -0
- package/dist/sparkline-chart-Da-ehDGv.js.map +1 -0
- package/dist/sparkline-chart-ca3uTzVK.cjs +68 -0
- package/dist/sparkline-chart-ca3uTzVK.cjs.map +1 -0
- package/dist/trending-up-D3Nfrhi3.cjs +2 -0
- package/dist/trending-up-D3Nfrhi3.cjs.map +1 -0
- package/dist/trending-up-DPwlYzQb.js +9 -0
- package/dist/trending-up-DPwlYzQb.js.map +1 -0
- package/dist/ui.css +1 -0
- package/dist/use-formatters-d97RVcmg.cjs +2 -0
- package/dist/use-formatters-d97RVcmg.cjs.map +1 -0
- package/dist/use-formatters-l1_2c8z0.js +6682 -0
- package/dist/use-formatters-l1_2c8z0.js.map +1 -0
- package/dist/use-local-storage-BjlrKzE-.js +42 -0
- package/dist/use-local-storage-BjlrKzE-.js.map +1 -0
- package/dist/use-local-storage-q-1odzIu.cjs +2 -0
- package/dist/use-local-storage-q-1odzIu.cjs.map +1 -0
- package/dist/use-mobile-C-LMK4T8.js +15 -0
- package/dist/use-mobile-C-LMK4T8.js.map +1 -0
- package/dist/use-mobile-DY7TJ5lx.cjs +2 -0
- package/dist/use-mobile-DY7TJ5lx.cjs.map +1 -0
- package/dist/use-toast-DG2qdYhl.js +97 -0
- package/dist/use-toast-DG2qdYhl.js.map +1 -0
- package/dist/use-toast-DxZJ8uUm.cjs +2 -0
- package/dist/use-toast-DxZJ8uUm.cjs.map +1 -0
- package/dist/utils/index.cjs.js +2 -0
- package/dist/utils/index.cjs.js.map +1 -0
- package/dist/utils/index.es.js +5 -0
- package/dist/utils/index.es.js.map +1 -0
- package/dist/welcome-card-CPolYl1D.cjs +2 -0
- package/dist/welcome-card-CPolYl1D.cjs.map +1 -0
- package/dist/welcome-card-CxMJZ8bv.js +963 -0
- package/dist/welcome-card-CxMJZ8bv.js.map +1 -0
- package/package.json +179 -0
|
@@ -0,0 +1,974 @@
|
|
|
1
|
+
import { jsx as i, jsxs as Q, Fragment as Te } from "react/jsx-runtime";
|
|
2
|
+
import * as o from "react";
|
|
3
|
+
import * as Ee from "react-dom";
|
|
4
|
+
import { f as gt, u as vt, g as St, P as M, h as V, i as z, j as N, k as wt, l as Re, e as yt, C as xt } from "./scroll-area-DQeqDp3Y.js";
|
|
5
|
+
import { o as _e, u as Pe, R as Ct, p as be, q as It, A as Tt, P as bt, r as Nt, s as Rt, t as Pt, F as Et, v as _t, C as Mt, w as At } from "./input-D4AoiWxo.js";
|
|
6
|
+
import { u as Ot } from "./checkbox-CpOq5hkT.js";
|
|
7
|
+
import { V as Dt } from "./index-Co9o9StL.js";
|
|
8
|
+
import { c as G } from "./index-CwJPJKOE.js";
|
|
9
|
+
import { C as Me } from "./chevron-down-DJ1_YIFu.js";
|
|
10
|
+
import { C as Lt } from "./chevron-up-CGtXOr51.js";
|
|
11
|
+
// @__NO_SIDE_EFFECTS__
|
|
12
|
+
function Vt(t) {
|
|
13
|
+
const n = /* @__PURE__ */ kt(t), e = o.forwardRef((s, r) => {
|
|
14
|
+
const { children: d, ...l } = s, a = o.Children.toArray(d), c = a.find(Ht);
|
|
15
|
+
if (c) {
|
|
16
|
+
const p = c.props.children, g = a.map((S) => S === c ? o.Children.count(p) > 1 ? o.Children.only(null) : o.isValidElement(p) ? p.props.children : null : S);
|
|
17
|
+
return /* @__PURE__ */ i(n, { ...l, ref: r, children: o.isValidElement(p) ? o.cloneElement(p, void 0, g) : null });
|
|
18
|
+
}
|
|
19
|
+
return /* @__PURE__ */ i(n, { ...l, ref: r, children: d });
|
|
20
|
+
});
|
|
21
|
+
return e.displayName = `${t}.Slot`, e;
|
|
22
|
+
}
|
|
23
|
+
// @__NO_SIDE_EFFECTS__
|
|
24
|
+
function kt(t) {
|
|
25
|
+
const n = o.forwardRef((e, s) => {
|
|
26
|
+
const { children: r, ...d } = e;
|
|
27
|
+
if (o.isValidElement(r)) {
|
|
28
|
+
const l = Ft(r), a = Wt(d, r.props);
|
|
29
|
+
return r.type !== o.Fragment && (a.ref = s ? gt(s, l) : l), o.cloneElement(r, a);
|
|
30
|
+
}
|
|
31
|
+
return o.Children.count(r) > 1 ? o.Children.only(null) : null;
|
|
32
|
+
});
|
|
33
|
+
return n.displayName = `${t}.SlotClone`, n;
|
|
34
|
+
}
|
|
35
|
+
var Bt = /* @__PURE__ */ Symbol("radix.slottable");
|
|
36
|
+
function Ht(t) {
|
|
37
|
+
return o.isValidElement(t) && typeof t.type == "function" && "__radixId" in t.type && t.type.__radixId === Bt;
|
|
38
|
+
}
|
|
39
|
+
function Wt(t, n) {
|
|
40
|
+
const e = { ...n };
|
|
41
|
+
for (const s in n) {
|
|
42
|
+
const r = t[s], d = n[s];
|
|
43
|
+
/^on[A-Z]/.test(s) ? r && d ? e[s] = (...a) => {
|
|
44
|
+
const c = d(...a);
|
|
45
|
+
return r(...a), c;
|
|
46
|
+
} : r && (e[s] = r) : s === "style" ? e[s] = { ...r, ...d } : s === "className" && (e[s] = [r, d].filter(Boolean).join(" "));
|
|
47
|
+
}
|
|
48
|
+
return { ...t, ...e };
|
|
49
|
+
}
|
|
50
|
+
function Ft(t) {
|
|
51
|
+
let n = Object.getOwnPropertyDescriptor(t.props, "ref")?.get, e = n && "isReactWarning" in n && n.isReactWarning;
|
|
52
|
+
return e ? t.ref : (n = Object.getOwnPropertyDescriptor(t, "ref")?.get, e = n && "isReactWarning" in n && n.isReactWarning, e ? t.props.ref : t.props.ref || t.ref);
|
|
53
|
+
}
|
|
54
|
+
var Ut = [" ", "Enter", "ArrowUp", "ArrowDown"], Kt = [" ", "Enter"], ee = "Select", [de, ue, $t] = It(ee), [ne] = St(ee, [
|
|
55
|
+
$t,
|
|
56
|
+
_e
|
|
57
|
+
]), pe = _e(), [jt, Y] = ne(ee), [zt, Gt] = ne(ee), Ae = (t) => {
|
|
58
|
+
const {
|
|
59
|
+
__scopeSelect: n,
|
|
60
|
+
children: e,
|
|
61
|
+
open: s,
|
|
62
|
+
defaultOpen: r,
|
|
63
|
+
onOpenChange: d,
|
|
64
|
+
value: l,
|
|
65
|
+
defaultValue: a,
|
|
66
|
+
onValueChange: c,
|
|
67
|
+
dir: p,
|
|
68
|
+
name: g,
|
|
69
|
+
autoComplete: S,
|
|
70
|
+
disabled: R,
|
|
71
|
+
required: T,
|
|
72
|
+
form: C
|
|
73
|
+
} = t, u = pe(n), [h, w] = o.useState(null), [m, v] = o.useState(null), [U, A] = o.useState(!1), re = vt(p), [P, D] = Pe({
|
|
74
|
+
prop: s,
|
|
75
|
+
defaultProp: r ?? !1,
|
|
76
|
+
onChange: d,
|
|
77
|
+
caller: ee
|
|
78
|
+
}), [K, Z] = Pe({
|
|
79
|
+
prop: l,
|
|
80
|
+
defaultProp: a,
|
|
81
|
+
onChange: c,
|
|
82
|
+
caller: ee
|
|
83
|
+
}), k = o.useRef(null), B = h ? C || !!h.closest("form") : !0, [$, H] = o.useState(/* @__PURE__ */ new Set()), W = Array.from($).map((E) => E.props.value).join(";");
|
|
84
|
+
return /* @__PURE__ */ i(Ct, { ...u, children: /* @__PURE__ */ Q(
|
|
85
|
+
jt,
|
|
86
|
+
{
|
|
87
|
+
required: T,
|
|
88
|
+
scope: n,
|
|
89
|
+
trigger: h,
|
|
90
|
+
onTriggerChange: w,
|
|
91
|
+
valueNode: m,
|
|
92
|
+
onValueNodeChange: v,
|
|
93
|
+
valueNodeHasChildren: U,
|
|
94
|
+
onValueNodeHasChildrenChange: A,
|
|
95
|
+
contentId: be(),
|
|
96
|
+
value: K,
|
|
97
|
+
onValueChange: Z,
|
|
98
|
+
open: P,
|
|
99
|
+
onOpenChange: D,
|
|
100
|
+
dir: re,
|
|
101
|
+
triggerPointerDownPosRef: k,
|
|
102
|
+
disabled: R,
|
|
103
|
+
children: [
|
|
104
|
+
/* @__PURE__ */ i(de.Provider, { scope: n, children: /* @__PURE__ */ i(
|
|
105
|
+
zt,
|
|
106
|
+
{
|
|
107
|
+
scope: t.__scopeSelect,
|
|
108
|
+
onNativeOptionAdd: o.useCallback((E) => {
|
|
109
|
+
H((L) => new Set(L).add(E));
|
|
110
|
+
}, []),
|
|
111
|
+
onNativeOptionRemove: o.useCallback((E) => {
|
|
112
|
+
H((L) => {
|
|
113
|
+
const F = new Set(L);
|
|
114
|
+
return F.delete(E), F;
|
|
115
|
+
});
|
|
116
|
+
}, []),
|
|
117
|
+
children: e
|
|
118
|
+
}
|
|
119
|
+
) }),
|
|
120
|
+
B ? /* @__PURE__ */ Q(
|
|
121
|
+
nt,
|
|
122
|
+
{
|
|
123
|
+
"aria-hidden": !0,
|
|
124
|
+
required: T,
|
|
125
|
+
tabIndex: -1,
|
|
126
|
+
name: g,
|
|
127
|
+
autoComplete: S,
|
|
128
|
+
value: K,
|
|
129
|
+
onChange: (E) => Z(E.target.value),
|
|
130
|
+
disabled: R,
|
|
131
|
+
form: C,
|
|
132
|
+
children: [
|
|
133
|
+
K === void 0 ? /* @__PURE__ */ i("option", { value: "" }) : null,
|
|
134
|
+
Array.from($)
|
|
135
|
+
]
|
|
136
|
+
},
|
|
137
|
+
W
|
|
138
|
+
) : null
|
|
139
|
+
]
|
|
140
|
+
}
|
|
141
|
+
) });
|
|
142
|
+
};
|
|
143
|
+
Ae.displayName = ee;
|
|
144
|
+
var Oe = "SelectTrigger", De = o.forwardRef(
|
|
145
|
+
(t, n) => {
|
|
146
|
+
const { __scopeSelect: e, disabled: s = !1, ...r } = t, d = pe(e), l = Y(Oe, e), a = l.disabled || s, c = V(n, l.onTriggerChange), p = ue(e), g = o.useRef("touch"), [S, R, T] = st((u) => {
|
|
147
|
+
const h = p().filter((v) => !v.disabled), w = h.find((v) => v.value === l.value), m = lt(h, u, w);
|
|
148
|
+
m !== void 0 && l.onValueChange(m.value);
|
|
149
|
+
}), C = (u) => {
|
|
150
|
+
a || (l.onOpenChange(!0), T()), u && (l.triggerPointerDownPosRef.current = {
|
|
151
|
+
x: Math.round(u.pageX),
|
|
152
|
+
y: Math.round(u.pageY)
|
|
153
|
+
});
|
|
154
|
+
};
|
|
155
|
+
return /* @__PURE__ */ i(Tt, { asChild: !0, ...d, children: /* @__PURE__ */ i(
|
|
156
|
+
M.button,
|
|
157
|
+
{
|
|
158
|
+
type: "button",
|
|
159
|
+
role: "combobox",
|
|
160
|
+
"aria-controls": l.contentId,
|
|
161
|
+
"aria-expanded": l.open,
|
|
162
|
+
"aria-required": l.required,
|
|
163
|
+
"aria-autocomplete": "none",
|
|
164
|
+
dir: l.dir,
|
|
165
|
+
"data-state": l.open ? "open" : "closed",
|
|
166
|
+
disabled: a,
|
|
167
|
+
"data-disabled": a ? "" : void 0,
|
|
168
|
+
"data-placeholder": rt(l.value) ? "" : void 0,
|
|
169
|
+
...r,
|
|
170
|
+
ref: c,
|
|
171
|
+
onClick: N(r.onClick, (u) => {
|
|
172
|
+
u.currentTarget.focus(), g.current !== "mouse" && C(u);
|
|
173
|
+
}),
|
|
174
|
+
onPointerDown: N(r.onPointerDown, (u) => {
|
|
175
|
+
g.current = u.pointerType;
|
|
176
|
+
const h = u.target;
|
|
177
|
+
h.hasPointerCapture(u.pointerId) && h.releasePointerCapture(u.pointerId), u.button === 0 && u.ctrlKey === !1 && u.pointerType === "mouse" && (C(u), u.preventDefault());
|
|
178
|
+
}),
|
|
179
|
+
onKeyDown: N(r.onKeyDown, (u) => {
|
|
180
|
+
const h = S.current !== "";
|
|
181
|
+
!(u.ctrlKey || u.altKey || u.metaKey) && u.key.length === 1 && R(u.key), !(h && u.key === " ") && Ut.includes(u.key) && (C(), u.preventDefault());
|
|
182
|
+
})
|
|
183
|
+
}
|
|
184
|
+
) });
|
|
185
|
+
}
|
|
186
|
+
);
|
|
187
|
+
De.displayName = Oe;
|
|
188
|
+
var Le = "SelectValue", Ve = o.forwardRef(
|
|
189
|
+
(t, n) => {
|
|
190
|
+
const { __scopeSelect: e, className: s, style: r, children: d, placeholder: l = "", ...a } = t, c = Y(Le, e), { onValueNodeHasChildrenChange: p } = c, g = d !== void 0, S = V(n, c.onValueNodeChange);
|
|
191
|
+
return z(() => {
|
|
192
|
+
p(g);
|
|
193
|
+
}, [p, g]), /* @__PURE__ */ i(
|
|
194
|
+
M.span,
|
|
195
|
+
{
|
|
196
|
+
...a,
|
|
197
|
+
ref: S,
|
|
198
|
+
style: { pointerEvents: "none" },
|
|
199
|
+
children: rt(c.value) ? /* @__PURE__ */ i(Te, { children: l }) : d
|
|
200
|
+
}
|
|
201
|
+
);
|
|
202
|
+
}
|
|
203
|
+
);
|
|
204
|
+
Ve.displayName = Le;
|
|
205
|
+
var Yt = "SelectIcon", ke = o.forwardRef(
|
|
206
|
+
(t, n) => {
|
|
207
|
+
const { __scopeSelect: e, children: s, ...r } = t;
|
|
208
|
+
return /* @__PURE__ */ i(M.span, { "aria-hidden": !0, ...r, ref: n, children: s || "▼" });
|
|
209
|
+
}
|
|
210
|
+
);
|
|
211
|
+
ke.displayName = Yt;
|
|
212
|
+
var qt = "SelectPortal", Be = (t) => /* @__PURE__ */ i(bt, { asChild: !0, ...t });
|
|
213
|
+
Be.displayName = qt;
|
|
214
|
+
var te = "SelectContent", He = o.forwardRef(
|
|
215
|
+
(t, n) => {
|
|
216
|
+
const e = Y(te, t.__scopeSelect), [s, r] = o.useState();
|
|
217
|
+
if (z(() => {
|
|
218
|
+
r(new DocumentFragment());
|
|
219
|
+
}, []), !e.open) {
|
|
220
|
+
const d = s;
|
|
221
|
+
return d ? Ee.createPortal(
|
|
222
|
+
/* @__PURE__ */ i(We, { scope: t.__scopeSelect, children: /* @__PURE__ */ i(de.Slot, { scope: t.__scopeSelect, children: /* @__PURE__ */ i("div", { children: t.children }) }) }),
|
|
223
|
+
d
|
|
224
|
+
) : null;
|
|
225
|
+
}
|
|
226
|
+
return /* @__PURE__ */ i(Fe, { ...t, ref: n });
|
|
227
|
+
}
|
|
228
|
+
);
|
|
229
|
+
He.displayName = te;
|
|
230
|
+
var O = 10, [We, q] = ne(te), Zt = "SelectContentImpl", Xt = /* @__PURE__ */ Vt("SelectContent.RemoveScroll"), Fe = o.forwardRef(
|
|
231
|
+
(t, n) => {
|
|
232
|
+
const {
|
|
233
|
+
__scopeSelect: e,
|
|
234
|
+
position: s = "item-aligned",
|
|
235
|
+
onCloseAutoFocus: r,
|
|
236
|
+
onEscapeKeyDown: d,
|
|
237
|
+
onPointerDownOutside: l,
|
|
238
|
+
//
|
|
239
|
+
// PopperContent props
|
|
240
|
+
side: a,
|
|
241
|
+
sideOffset: c,
|
|
242
|
+
align: p,
|
|
243
|
+
alignOffset: g,
|
|
244
|
+
arrowPadding: S,
|
|
245
|
+
collisionBoundary: R,
|
|
246
|
+
collisionPadding: T,
|
|
247
|
+
sticky: C,
|
|
248
|
+
hideWhenDetached: u,
|
|
249
|
+
avoidCollisions: h,
|
|
250
|
+
//
|
|
251
|
+
...w
|
|
252
|
+
} = t, m = Y(te, e), [v, U] = o.useState(null), [A, re] = o.useState(null), P = V(n, (f) => U(f)), [D, K] = o.useState(null), [Z, k] = o.useState(
|
|
253
|
+
null
|
|
254
|
+
), B = ue(e), [$, H] = o.useState(!1), W = o.useRef(!1);
|
|
255
|
+
o.useEffect(() => {
|
|
256
|
+
if (v) return Nt(v);
|
|
257
|
+
}, [v]), Rt();
|
|
258
|
+
const E = o.useCallback(
|
|
259
|
+
(f) => {
|
|
260
|
+
const [I, ..._] = B().map((b) => b.ref.current), [y] = _.slice(-1), x = document.activeElement;
|
|
261
|
+
for (const b of f)
|
|
262
|
+
if (b === x || (b?.scrollIntoView({ block: "nearest" }), b === I && A && (A.scrollTop = 0), b === y && A && (A.scrollTop = A.scrollHeight), b?.focus(), document.activeElement !== x)) return;
|
|
263
|
+
},
|
|
264
|
+
[B, A]
|
|
265
|
+
), L = o.useCallback(
|
|
266
|
+
() => E([D, v]),
|
|
267
|
+
[E, D, v]
|
|
268
|
+
);
|
|
269
|
+
o.useEffect(() => {
|
|
270
|
+
$ && L();
|
|
271
|
+
}, [$, L]);
|
|
272
|
+
const { onOpenChange: F, triggerPointerDownPosRef: j } = m;
|
|
273
|
+
o.useEffect(() => {
|
|
274
|
+
if (v) {
|
|
275
|
+
let f = { x: 0, y: 0 };
|
|
276
|
+
const I = (y) => {
|
|
277
|
+
f = {
|
|
278
|
+
x: Math.abs(Math.round(y.pageX) - (j.current?.x ?? 0)),
|
|
279
|
+
y: Math.abs(Math.round(y.pageY) - (j.current?.y ?? 0))
|
|
280
|
+
};
|
|
281
|
+
}, _ = (y) => {
|
|
282
|
+
f.x <= 10 && f.y <= 10 ? y.preventDefault() : v.contains(y.target) || F(!1), document.removeEventListener("pointermove", I), j.current = null;
|
|
283
|
+
};
|
|
284
|
+
return j.current !== null && (document.addEventListener("pointermove", I), document.addEventListener("pointerup", _, { capture: !0, once: !0 })), () => {
|
|
285
|
+
document.removeEventListener("pointermove", I), document.removeEventListener("pointerup", _, { capture: !0 });
|
|
286
|
+
};
|
|
287
|
+
}
|
|
288
|
+
}, [v, F, j]), o.useEffect(() => {
|
|
289
|
+
const f = () => F(!1);
|
|
290
|
+
return window.addEventListener("blur", f), window.addEventListener("resize", f), () => {
|
|
291
|
+
window.removeEventListener("blur", f), window.removeEventListener("resize", f);
|
|
292
|
+
};
|
|
293
|
+
}, [F]);
|
|
294
|
+
const [fe, ae] = st((f) => {
|
|
295
|
+
const I = B().filter((x) => !x.disabled), _ = I.find((x) => x.ref.current === document.activeElement), y = lt(I, f, _);
|
|
296
|
+
y && setTimeout(() => y.ref.current.focus());
|
|
297
|
+
}), me = o.useCallback(
|
|
298
|
+
(f, I, _) => {
|
|
299
|
+
const y = !W.current && !_;
|
|
300
|
+
(m.value !== void 0 && m.value === I || y) && (K(f), y && (W.current = !0));
|
|
301
|
+
},
|
|
302
|
+
[m.value]
|
|
303
|
+
), he = o.useCallback(() => v?.focus(), [v]), oe = o.useCallback(
|
|
304
|
+
(f, I, _) => {
|
|
305
|
+
const y = !W.current && !_;
|
|
306
|
+
(m.value !== void 0 && m.value === I || y) && k(f);
|
|
307
|
+
},
|
|
308
|
+
[m.value]
|
|
309
|
+
), ce = s === "popper" ? we : Ue, se = ce === we ? {
|
|
310
|
+
side: a,
|
|
311
|
+
sideOffset: c,
|
|
312
|
+
align: p,
|
|
313
|
+
alignOffset: g,
|
|
314
|
+
arrowPadding: S,
|
|
315
|
+
collisionBoundary: R,
|
|
316
|
+
collisionPadding: T,
|
|
317
|
+
sticky: C,
|
|
318
|
+
hideWhenDetached: u,
|
|
319
|
+
avoidCollisions: h
|
|
320
|
+
} : {};
|
|
321
|
+
return /* @__PURE__ */ i(
|
|
322
|
+
We,
|
|
323
|
+
{
|
|
324
|
+
scope: e,
|
|
325
|
+
content: v,
|
|
326
|
+
viewport: A,
|
|
327
|
+
onViewportChange: re,
|
|
328
|
+
itemRefCallback: me,
|
|
329
|
+
selectedItem: D,
|
|
330
|
+
onItemLeave: he,
|
|
331
|
+
itemTextRefCallback: oe,
|
|
332
|
+
focusSelectedItem: L,
|
|
333
|
+
selectedItemText: Z,
|
|
334
|
+
position: s,
|
|
335
|
+
isPositioned: $,
|
|
336
|
+
searchRef: fe,
|
|
337
|
+
children: /* @__PURE__ */ i(Pt, { as: Xt, allowPinchZoom: !0, children: /* @__PURE__ */ i(
|
|
338
|
+
Et,
|
|
339
|
+
{
|
|
340
|
+
asChild: !0,
|
|
341
|
+
trapped: m.open,
|
|
342
|
+
onMountAutoFocus: (f) => {
|
|
343
|
+
f.preventDefault();
|
|
344
|
+
},
|
|
345
|
+
onUnmountAutoFocus: N(r, (f) => {
|
|
346
|
+
m.trigger?.focus({ preventScroll: !0 }), f.preventDefault();
|
|
347
|
+
}),
|
|
348
|
+
children: /* @__PURE__ */ i(
|
|
349
|
+
_t,
|
|
350
|
+
{
|
|
351
|
+
asChild: !0,
|
|
352
|
+
disableOutsidePointerEvents: !0,
|
|
353
|
+
onEscapeKeyDown: d,
|
|
354
|
+
onPointerDownOutside: l,
|
|
355
|
+
onFocusOutside: (f) => f.preventDefault(),
|
|
356
|
+
onDismiss: () => m.onOpenChange(!1),
|
|
357
|
+
children: /* @__PURE__ */ i(
|
|
358
|
+
ce,
|
|
359
|
+
{
|
|
360
|
+
role: "listbox",
|
|
361
|
+
id: m.contentId,
|
|
362
|
+
"data-state": m.open ? "open" : "closed",
|
|
363
|
+
dir: m.dir,
|
|
364
|
+
onContextMenu: (f) => f.preventDefault(),
|
|
365
|
+
...w,
|
|
366
|
+
...se,
|
|
367
|
+
onPlaced: () => H(!0),
|
|
368
|
+
ref: P,
|
|
369
|
+
style: {
|
|
370
|
+
// flex layout so we can place the scroll buttons properly
|
|
371
|
+
display: "flex",
|
|
372
|
+
flexDirection: "column",
|
|
373
|
+
// reset the outline by default as the content MAY get focused
|
|
374
|
+
outline: "none",
|
|
375
|
+
...w.style
|
|
376
|
+
},
|
|
377
|
+
onKeyDown: N(w.onKeyDown, (f) => {
|
|
378
|
+
const I = f.ctrlKey || f.altKey || f.metaKey;
|
|
379
|
+
if (f.key === "Tab" && f.preventDefault(), !I && f.key.length === 1 && ae(f.key), ["ArrowUp", "ArrowDown", "Home", "End"].includes(f.key)) {
|
|
380
|
+
let y = B().filter((x) => !x.disabled).map((x) => x.ref.current);
|
|
381
|
+
if (["ArrowUp", "End"].includes(f.key) && (y = y.slice().reverse()), ["ArrowUp", "ArrowDown"].includes(f.key)) {
|
|
382
|
+
const x = f.target, b = y.indexOf(x);
|
|
383
|
+
y = y.slice(b + 1);
|
|
384
|
+
}
|
|
385
|
+
setTimeout(() => E(y)), f.preventDefault();
|
|
386
|
+
}
|
|
387
|
+
})
|
|
388
|
+
}
|
|
389
|
+
)
|
|
390
|
+
}
|
|
391
|
+
)
|
|
392
|
+
}
|
|
393
|
+
) })
|
|
394
|
+
}
|
|
395
|
+
);
|
|
396
|
+
}
|
|
397
|
+
);
|
|
398
|
+
Fe.displayName = Zt;
|
|
399
|
+
var Jt = "SelectItemAlignedPosition", Ue = o.forwardRef((t, n) => {
|
|
400
|
+
const { __scopeSelect: e, onPlaced: s, ...r } = t, d = Y(te, e), l = q(te, e), [a, c] = o.useState(null), [p, g] = o.useState(null), S = V(n, (P) => g(P)), R = ue(e), T = o.useRef(!1), C = o.useRef(!0), { viewport: u, selectedItem: h, selectedItemText: w, focusSelectedItem: m } = l, v = o.useCallback(() => {
|
|
401
|
+
if (d.trigger && d.valueNode && a && p && u && h && w) {
|
|
402
|
+
const P = d.trigger.getBoundingClientRect(), D = p.getBoundingClientRect(), K = d.valueNode.getBoundingClientRect(), Z = w.getBoundingClientRect();
|
|
403
|
+
if (d.dir !== "rtl") {
|
|
404
|
+
const x = Z.left - D.left, b = K.left - x, X = P.left - b, J = P.width + X, ge = Math.max(J, D.width), ve = window.innerWidth - O, Se = Re(b, [
|
|
405
|
+
O,
|
|
406
|
+
// Prevents the content from going off the starting edge of the
|
|
407
|
+
// viewport. It may still go off the ending edge, but this can be
|
|
408
|
+
// controlled by the user since they may want to manage overflow in a
|
|
409
|
+
// specific way.
|
|
410
|
+
// https://github.com/radix-ui/primitives/issues/2049
|
|
411
|
+
Math.max(O, ve - ge)
|
|
412
|
+
]);
|
|
413
|
+
a.style.minWidth = J + "px", a.style.left = Se + "px";
|
|
414
|
+
} else {
|
|
415
|
+
const x = D.right - Z.right, b = window.innerWidth - K.right - x, X = window.innerWidth - P.right - b, J = P.width + X, ge = Math.max(J, D.width), ve = window.innerWidth - O, Se = Re(b, [
|
|
416
|
+
O,
|
|
417
|
+
Math.max(O, ve - ge)
|
|
418
|
+
]);
|
|
419
|
+
a.style.minWidth = J + "px", a.style.right = Se + "px";
|
|
420
|
+
}
|
|
421
|
+
const k = R(), B = window.innerHeight - O * 2, $ = u.scrollHeight, H = window.getComputedStyle(p), W = parseInt(H.borderTopWidth, 10), E = parseInt(H.paddingTop, 10), L = parseInt(H.borderBottomWidth, 10), F = parseInt(H.paddingBottom, 10), j = W + E + $ + F + L, fe = Math.min(h.offsetHeight * 5, j), ae = window.getComputedStyle(u), me = parseInt(ae.paddingTop, 10), he = parseInt(ae.paddingBottom, 10), oe = P.top + P.height / 2 - O, ce = B - oe, se = h.offsetHeight / 2, f = h.offsetTop + se, I = W + E + f, _ = j - I;
|
|
422
|
+
if (I <= oe) {
|
|
423
|
+
const x = k.length > 0 && h === k[k.length - 1].ref.current;
|
|
424
|
+
a.style.bottom = "0px";
|
|
425
|
+
const b = p.clientHeight - u.offsetTop - u.offsetHeight, X = Math.max(
|
|
426
|
+
ce,
|
|
427
|
+
se + // viewport might have padding bottom, include it to avoid a scrollable viewport
|
|
428
|
+
(x ? he : 0) + b + L
|
|
429
|
+
), J = I + X;
|
|
430
|
+
a.style.height = J + "px";
|
|
431
|
+
} else {
|
|
432
|
+
const x = k.length > 0 && h === k[0].ref.current;
|
|
433
|
+
a.style.top = "0px";
|
|
434
|
+
const X = Math.max(
|
|
435
|
+
oe,
|
|
436
|
+
W + u.offsetTop + // viewport might have padding top, include it to avoid a scrollable viewport
|
|
437
|
+
(x ? me : 0) + se
|
|
438
|
+
) + _;
|
|
439
|
+
a.style.height = X + "px", u.scrollTop = I - oe + u.offsetTop;
|
|
440
|
+
}
|
|
441
|
+
a.style.margin = `${O}px 0`, a.style.minHeight = fe + "px", a.style.maxHeight = B + "px", s?.(), requestAnimationFrame(() => T.current = !0);
|
|
442
|
+
}
|
|
443
|
+
}, [
|
|
444
|
+
R,
|
|
445
|
+
d.trigger,
|
|
446
|
+
d.valueNode,
|
|
447
|
+
a,
|
|
448
|
+
p,
|
|
449
|
+
u,
|
|
450
|
+
h,
|
|
451
|
+
w,
|
|
452
|
+
d.dir,
|
|
453
|
+
s
|
|
454
|
+
]);
|
|
455
|
+
z(() => v(), [v]);
|
|
456
|
+
const [U, A] = o.useState();
|
|
457
|
+
z(() => {
|
|
458
|
+
p && A(window.getComputedStyle(p).zIndex);
|
|
459
|
+
}, [p]);
|
|
460
|
+
const re = o.useCallback(
|
|
461
|
+
(P) => {
|
|
462
|
+
P && C.current === !0 && (v(), m?.(), C.current = !1);
|
|
463
|
+
},
|
|
464
|
+
[v, m]
|
|
465
|
+
);
|
|
466
|
+
return /* @__PURE__ */ i(
|
|
467
|
+
eo,
|
|
468
|
+
{
|
|
469
|
+
scope: e,
|
|
470
|
+
contentWrapper: a,
|
|
471
|
+
shouldExpandOnScrollRef: T,
|
|
472
|
+
onScrollButtonChange: re,
|
|
473
|
+
children: /* @__PURE__ */ i(
|
|
474
|
+
"div",
|
|
475
|
+
{
|
|
476
|
+
ref: c,
|
|
477
|
+
style: {
|
|
478
|
+
display: "flex",
|
|
479
|
+
flexDirection: "column",
|
|
480
|
+
position: "fixed",
|
|
481
|
+
zIndex: U
|
|
482
|
+
},
|
|
483
|
+
children: /* @__PURE__ */ i(
|
|
484
|
+
M.div,
|
|
485
|
+
{
|
|
486
|
+
...r,
|
|
487
|
+
ref: S,
|
|
488
|
+
style: {
|
|
489
|
+
// When we get the height of the content, it includes borders. If we were to set
|
|
490
|
+
// the height without having `boxSizing: 'border-box'` it would be too big.
|
|
491
|
+
boxSizing: "border-box",
|
|
492
|
+
// We need to ensure the content doesn't get taller than the wrapper
|
|
493
|
+
maxHeight: "100%",
|
|
494
|
+
...r.style
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
)
|
|
498
|
+
}
|
|
499
|
+
)
|
|
500
|
+
}
|
|
501
|
+
);
|
|
502
|
+
});
|
|
503
|
+
Ue.displayName = Jt;
|
|
504
|
+
var Qt = "SelectPopperPosition", we = o.forwardRef((t, n) => {
|
|
505
|
+
const {
|
|
506
|
+
__scopeSelect: e,
|
|
507
|
+
align: s = "start",
|
|
508
|
+
collisionPadding: r = O,
|
|
509
|
+
...d
|
|
510
|
+
} = t, l = pe(e);
|
|
511
|
+
return /* @__PURE__ */ i(
|
|
512
|
+
Mt,
|
|
513
|
+
{
|
|
514
|
+
...l,
|
|
515
|
+
...d,
|
|
516
|
+
ref: n,
|
|
517
|
+
align: s,
|
|
518
|
+
collisionPadding: r,
|
|
519
|
+
style: {
|
|
520
|
+
// Ensure border-box for floating-ui calculations
|
|
521
|
+
boxSizing: "border-box",
|
|
522
|
+
...d.style,
|
|
523
|
+
"--radix-select-content-transform-origin": "var(--radix-popper-transform-origin)",
|
|
524
|
+
"--radix-select-content-available-width": "var(--radix-popper-available-width)",
|
|
525
|
+
"--radix-select-content-available-height": "var(--radix-popper-available-height)",
|
|
526
|
+
"--radix-select-trigger-width": "var(--radix-popper-anchor-width)",
|
|
527
|
+
"--radix-select-trigger-height": "var(--radix-popper-anchor-height)"
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
);
|
|
531
|
+
});
|
|
532
|
+
we.displayName = Qt;
|
|
533
|
+
var [eo, Ne] = ne(te, {}), ye = "SelectViewport", Ke = o.forwardRef(
|
|
534
|
+
(t, n) => {
|
|
535
|
+
const { __scopeSelect: e, nonce: s, ...r } = t, d = q(ye, e), l = Ne(ye, e), a = V(n, d.onViewportChange), c = o.useRef(0);
|
|
536
|
+
return /* @__PURE__ */ Q(Te, { children: [
|
|
537
|
+
/* @__PURE__ */ i(
|
|
538
|
+
"style",
|
|
539
|
+
{
|
|
540
|
+
dangerouslySetInnerHTML: {
|
|
541
|
+
__html: "[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"
|
|
542
|
+
},
|
|
543
|
+
nonce: s
|
|
544
|
+
}
|
|
545
|
+
),
|
|
546
|
+
/* @__PURE__ */ i(de.Slot, { scope: e, children: /* @__PURE__ */ i(
|
|
547
|
+
M.div,
|
|
548
|
+
{
|
|
549
|
+
"data-radix-select-viewport": "",
|
|
550
|
+
role: "presentation",
|
|
551
|
+
...r,
|
|
552
|
+
ref: a,
|
|
553
|
+
style: {
|
|
554
|
+
// we use position: 'relative' here on the `viewport` so that when we call
|
|
555
|
+
// `selectedItem.offsetTop` in calculations, the offset is relative to the viewport
|
|
556
|
+
// (independent of the scrollUpButton).
|
|
557
|
+
position: "relative",
|
|
558
|
+
flex: 1,
|
|
559
|
+
// Viewport should only be scrollable in the vertical direction.
|
|
560
|
+
// This won't work in vertical writing modes, so we'll need to
|
|
561
|
+
// revisit this if/when that is supported
|
|
562
|
+
// https://developer.chrome.com/blog/vertical-form-controls
|
|
563
|
+
overflow: "hidden auto",
|
|
564
|
+
...r.style
|
|
565
|
+
},
|
|
566
|
+
onScroll: N(r.onScroll, (p) => {
|
|
567
|
+
const g = p.currentTarget, { contentWrapper: S, shouldExpandOnScrollRef: R } = l;
|
|
568
|
+
if (R?.current && S) {
|
|
569
|
+
const T = Math.abs(c.current - g.scrollTop);
|
|
570
|
+
if (T > 0) {
|
|
571
|
+
const C = window.innerHeight - O * 2, u = parseFloat(S.style.minHeight), h = parseFloat(S.style.height), w = Math.max(u, h);
|
|
572
|
+
if (w < C) {
|
|
573
|
+
const m = w + T, v = Math.min(C, m), U = m - v;
|
|
574
|
+
S.style.height = v + "px", S.style.bottom === "0px" && (g.scrollTop = U > 0 ? U : 0, S.style.justifyContent = "flex-end");
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
c.current = g.scrollTop;
|
|
579
|
+
})
|
|
580
|
+
}
|
|
581
|
+
) })
|
|
582
|
+
] });
|
|
583
|
+
}
|
|
584
|
+
);
|
|
585
|
+
Ke.displayName = ye;
|
|
586
|
+
var $e = "SelectGroup", [to, oo] = ne($e), je = o.forwardRef(
|
|
587
|
+
(t, n) => {
|
|
588
|
+
const { __scopeSelect: e, ...s } = t, r = be();
|
|
589
|
+
return /* @__PURE__ */ i(to, { scope: e, id: r, children: /* @__PURE__ */ i(M.div, { role: "group", "aria-labelledby": r, ...s, ref: n }) });
|
|
590
|
+
}
|
|
591
|
+
);
|
|
592
|
+
je.displayName = $e;
|
|
593
|
+
var ze = "SelectLabel", Ge = o.forwardRef(
|
|
594
|
+
(t, n) => {
|
|
595
|
+
const { __scopeSelect: e, ...s } = t, r = oo(ze, e);
|
|
596
|
+
return /* @__PURE__ */ i(M.div, { id: r.id, ...s, ref: n });
|
|
597
|
+
}
|
|
598
|
+
);
|
|
599
|
+
Ge.displayName = ze;
|
|
600
|
+
var ie = "SelectItem", [no, Ye] = ne(ie), qe = o.forwardRef(
|
|
601
|
+
(t, n) => {
|
|
602
|
+
const {
|
|
603
|
+
__scopeSelect: e,
|
|
604
|
+
value: s,
|
|
605
|
+
disabled: r = !1,
|
|
606
|
+
textValue: d,
|
|
607
|
+
...l
|
|
608
|
+
} = t, a = Y(ie, e), c = q(ie, e), p = a.value === s, [g, S] = o.useState(d ?? ""), [R, T] = o.useState(!1), C = V(
|
|
609
|
+
n,
|
|
610
|
+
(m) => c.itemRefCallback?.(m, s, r)
|
|
611
|
+
), u = be(), h = o.useRef("touch"), w = () => {
|
|
612
|
+
r || (a.onValueChange(s), a.onOpenChange(!1));
|
|
613
|
+
};
|
|
614
|
+
if (s === "")
|
|
615
|
+
throw new Error(
|
|
616
|
+
"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."
|
|
617
|
+
);
|
|
618
|
+
return /* @__PURE__ */ i(
|
|
619
|
+
no,
|
|
620
|
+
{
|
|
621
|
+
scope: e,
|
|
622
|
+
value: s,
|
|
623
|
+
disabled: r,
|
|
624
|
+
textId: u,
|
|
625
|
+
isSelected: p,
|
|
626
|
+
onItemTextChange: o.useCallback((m) => {
|
|
627
|
+
S((v) => v || (m?.textContent ?? "").trim());
|
|
628
|
+
}, []),
|
|
629
|
+
children: /* @__PURE__ */ i(
|
|
630
|
+
de.ItemSlot,
|
|
631
|
+
{
|
|
632
|
+
scope: e,
|
|
633
|
+
value: s,
|
|
634
|
+
disabled: r,
|
|
635
|
+
textValue: g,
|
|
636
|
+
children: /* @__PURE__ */ i(
|
|
637
|
+
M.div,
|
|
638
|
+
{
|
|
639
|
+
role: "option",
|
|
640
|
+
"aria-labelledby": u,
|
|
641
|
+
"data-highlighted": R ? "" : void 0,
|
|
642
|
+
"aria-selected": p && R,
|
|
643
|
+
"data-state": p ? "checked" : "unchecked",
|
|
644
|
+
"aria-disabled": r || void 0,
|
|
645
|
+
"data-disabled": r ? "" : void 0,
|
|
646
|
+
tabIndex: r ? void 0 : -1,
|
|
647
|
+
...l,
|
|
648
|
+
ref: C,
|
|
649
|
+
onFocus: N(l.onFocus, () => T(!0)),
|
|
650
|
+
onBlur: N(l.onBlur, () => T(!1)),
|
|
651
|
+
onClick: N(l.onClick, () => {
|
|
652
|
+
h.current !== "mouse" && w();
|
|
653
|
+
}),
|
|
654
|
+
onPointerUp: N(l.onPointerUp, () => {
|
|
655
|
+
h.current === "mouse" && w();
|
|
656
|
+
}),
|
|
657
|
+
onPointerDown: N(l.onPointerDown, (m) => {
|
|
658
|
+
h.current = m.pointerType;
|
|
659
|
+
}),
|
|
660
|
+
onPointerMove: N(l.onPointerMove, (m) => {
|
|
661
|
+
h.current = m.pointerType, r ? c.onItemLeave?.() : h.current === "mouse" && m.currentTarget.focus({ preventScroll: !0 });
|
|
662
|
+
}),
|
|
663
|
+
onPointerLeave: N(l.onPointerLeave, (m) => {
|
|
664
|
+
m.currentTarget === document.activeElement && c.onItemLeave?.();
|
|
665
|
+
}),
|
|
666
|
+
onKeyDown: N(l.onKeyDown, (m) => {
|
|
667
|
+
c.searchRef?.current !== "" && m.key === " " || (Kt.includes(m.key) && w(), m.key === " " && m.preventDefault());
|
|
668
|
+
})
|
|
669
|
+
}
|
|
670
|
+
)
|
|
671
|
+
}
|
|
672
|
+
)
|
|
673
|
+
}
|
|
674
|
+
);
|
|
675
|
+
}
|
|
676
|
+
);
|
|
677
|
+
qe.displayName = ie;
|
|
678
|
+
var le = "SelectItemText", Ze = o.forwardRef(
|
|
679
|
+
(t, n) => {
|
|
680
|
+
const { __scopeSelect: e, className: s, style: r, ...d } = t, l = Y(le, e), a = q(le, e), c = Ye(le, e), p = Gt(le, e), [g, S] = o.useState(null), R = V(
|
|
681
|
+
n,
|
|
682
|
+
(w) => S(w),
|
|
683
|
+
c.onItemTextChange,
|
|
684
|
+
(w) => a.itemTextRefCallback?.(w, c.value, c.disabled)
|
|
685
|
+
), T = g?.textContent, C = o.useMemo(
|
|
686
|
+
() => /* @__PURE__ */ i("option", { value: c.value, disabled: c.disabled, children: T }, c.value),
|
|
687
|
+
[c.disabled, c.value, T]
|
|
688
|
+
), { onNativeOptionAdd: u, onNativeOptionRemove: h } = p;
|
|
689
|
+
return z(() => (u(C), () => h(C)), [u, h, C]), /* @__PURE__ */ Q(Te, { children: [
|
|
690
|
+
/* @__PURE__ */ i(M.span, { id: c.textId, ...d, ref: R }),
|
|
691
|
+
c.isSelected && l.valueNode && !l.valueNodeHasChildren ? Ee.createPortal(d.children, l.valueNode) : null
|
|
692
|
+
] });
|
|
693
|
+
}
|
|
694
|
+
);
|
|
695
|
+
Ze.displayName = le;
|
|
696
|
+
var Xe = "SelectItemIndicator", Je = o.forwardRef(
|
|
697
|
+
(t, n) => {
|
|
698
|
+
const { __scopeSelect: e, ...s } = t;
|
|
699
|
+
return Ye(Xe, e).isSelected ? /* @__PURE__ */ i(M.span, { "aria-hidden": !0, ...s, ref: n }) : null;
|
|
700
|
+
}
|
|
701
|
+
);
|
|
702
|
+
Je.displayName = Xe;
|
|
703
|
+
var xe = "SelectScrollUpButton", Qe = o.forwardRef((t, n) => {
|
|
704
|
+
const e = q(xe, t.__scopeSelect), s = Ne(xe, t.__scopeSelect), [r, d] = o.useState(!1), l = V(n, s.onScrollButtonChange);
|
|
705
|
+
return z(() => {
|
|
706
|
+
if (e.viewport && e.isPositioned) {
|
|
707
|
+
let a = function() {
|
|
708
|
+
const p = c.scrollTop > 0;
|
|
709
|
+
d(p);
|
|
710
|
+
};
|
|
711
|
+
const c = e.viewport;
|
|
712
|
+
return a(), c.addEventListener("scroll", a), () => c.removeEventListener("scroll", a);
|
|
713
|
+
}
|
|
714
|
+
}, [e.viewport, e.isPositioned]), r ? /* @__PURE__ */ i(
|
|
715
|
+
tt,
|
|
716
|
+
{
|
|
717
|
+
...t,
|
|
718
|
+
ref: l,
|
|
719
|
+
onAutoScroll: () => {
|
|
720
|
+
const { viewport: a, selectedItem: c } = e;
|
|
721
|
+
a && c && (a.scrollTop = a.scrollTop - c.offsetHeight);
|
|
722
|
+
}
|
|
723
|
+
}
|
|
724
|
+
) : null;
|
|
725
|
+
});
|
|
726
|
+
Qe.displayName = xe;
|
|
727
|
+
var Ce = "SelectScrollDownButton", et = o.forwardRef((t, n) => {
|
|
728
|
+
const e = q(Ce, t.__scopeSelect), s = Ne(Ce, t.__scopeSelect), [r, d] = o.useState(!1), l = V(n, s.onScrollButtonChange);
|
|
729
|
+
return z(() => {
|
|
730
|
+
if (e.viewport && e.isPositioned) {
|
|
731
|
+
let a = function() {
|
|
732
|
+
const p = c.scrollHeight - c.clientHeight, g = Math.ceil(c.scrollTop) < p;
|
|
733
|
+
d(g);
|
|
734
|
+
};
|
|
735
|
+
const c = e.viewport;
|
|
736
|
+
return a(), c.addEventListener("scroll", a), () => c.removeEventListener("scroll", a);
|
|
737
|
+
}
|
|
738
|
+
}, [e.viewport, e.isPositioned]), r ? /* @__PURE__ */ i(
|
|
739
|
+
tt,
|
|
740
|
+
{
|
|
741
|
+
...t,
|
|
742
|
+
ref: l,
|
|
743
|
+
onAutoScroll: () => {
|
|
744
|
+
const { viewport: a, selectedItem: c } = e;
|
|
745
|
+
a && c && (a.scrollTop = a.scrollTop + c.offsetHeight);
|
|
746
|
+
}
|
|
747
|
+
}
|
|
748
|
+
) : null;
|
|
749
|
+
});
|
|
750
|
+
et.displayName = Ce;
|
|
751
|
+
var tt = o.forwardRef((t, n) => {
|
|
752
|
+
const { __scopeSelect: e, onAutoScroll: s, ...r } = t, d = q("SelectScrollButton", e), l = o.useRef(null), a = ue(e), c = o.useCallback(() => {
|
|
753
|
+
l.current !== null && (window.clearInterval(l.current), l.current = null);
|
|
754
|
+
}, []);
|
|
755
|
+
return o.useEffect(() => () => c(), [c]), z(() => {
|
|
756
|
+
a().find((g) => g.ref.current === document.activeElement)?.ref.current?.scrollIntoView({ block: "nearest" });
|
|
757
|
+
}, [a]), /* @__PURE__ */ i(
|
|
758
|
+
M.div,
|
|
759
|
+
{
|
|
760
|
+
"aria-hidden": !0,
|
|
761
|
+
...r,
|
|
762
|
+
ref: n,
|
|
763
|
+
style: { flexShrink: 0, ...r.style },
|
|
764
|
+
onPointerDown: N(r.onPointerDown, () => {
|
|
765
|
+
l.current === null && (l.current = window.setInterval(s, 50));
|
|
766
|
+
}),
|
|
767
|
+
onPointerMove: N(r.onPointerMove, () => {
|
|
768
|
+
d.onItemLeave?.(), l.current === null && (l.current = window.setInterval(s, 50));
|
|
769
|
+
}),
|
|
770
|
+
onPointerLeave: N(r.onPointerLeave, () => {
|
|
771
|
+
c();
|
|
772
|
+
})
|
|
773
|
+
}
|
|
774
|
+
);
|
|
775
|
+
}), ro = "SelectSeparator", ot = o.forwardRef(
|
|
776
|
+
(t, n) => {
|
|
777
|
+
const { __scopeSelect: e, ...s } = t;
|
|
778
|
+
return /* @__PURE__ */ i(M.div, { "aria-hidden": !0, ...s, ref: n });
|
|
779
|
+
}
|
|
780
|
+
);
|
|
781
|
+
ot.displayName = ro;
|
|
782
|
+
var Ie = "SelectArrow", so = o.forwardRef(
|
|
783
|
+
(t, n) => {
|
|
784
|
+
const { __scopeSelect: e, ...s } = t, r = pe(e), d = Y(Ie, e), l = q(Ie, e);
|
|
785
|
+
return d.open && l.position === "popper" ? /* @__PURE__ */ i(At, { ...r, ...s, ref: n }) : null;
|
|
786
|
+
}
|
|
787
|
+
);
|
|
788
|
+
so.displayName = Ie;
|
|
789
|
+
var lo = "SelectBubbleInput", nt = o.forwardRef(
|
|
790
|
+
({ __scopeSelect: t, value: n, ...e }, s) => {
|
|
791
|
+
const r = o.useRef(null), d = V(s, r), l = Ot(n);
|
|
792
|
+
return o.useEffect(() => {
|
|
793
|
+
const a = r.current;
|
|
794
|
+
if (!a) return;
|
|
795
|
+
const c = window.HTMLSelectElement.prototype, g = Object.getOwnPropertyDescriptor(
|
|
796
|
+
c,
|
|
797
|
+
"value"
|
|
798
|
+
).set;
|
|
799
|
+
if (l !== n && g) {
|
|
800
|
+
const S = new Event("change", { bubbles: !0 });
|
|
801
|
+
g.call(a, n), a.dispatchEvent(S);
|
|
802
|
+
}
|
|
803
|
+
}, [l, n]), /* @__PURE__ */ i(
|
|
804
|
+
M.select,
|
|
805
|
+
{
|
|
806
|
+
...e,
|
|
807
|
+
style: { ...Dt, ...e.style },
|
|
808
|
+
ref: d,
|
|
809
|
+
defaultValue: n
|
|
810
|
+
}
|
|
811
|
+
);
|
|
812
|
+
}
|
|
813
|
+
);
|
|
814
|
+
nt.displayName = lo;
|
|
815
|
+
function rt(t) {
|
|
816
|
+
return t === "" || t === void 0;
|
|
817
|
+
}
|
|
818
|
+
function st(t) {
|
|
819
|
+
const n = wt(t), e = o.useRef(""), s = o.useRef(0), r = o.useCallback(
|
|
820
|
+
(l) => {
|
|
821
|
+
const a = e.current + l;
|
|
822
|
+
n(a), (function c(p) {
|
|
823
|
+
e.current = p, window.clearTimeout(s.current), p !== "" && (s.current = window.setTimeout(() => c(""), 1e3));
|
|
824
|
+
})(a);
|
|
825
|
+
},
|
|
826
|
+
[n]
|
|
827
|
+
), d = o.useCallback(() => {
|
|
828
|
+
e.current = "", window.clearTimeout(s.current);
|
|
829
|
+
}, []);
|
|
830
|
+
return o.useEffect(() => () => window.clearTimeout(s.current), []), [e, r, d];
|
|
831
|
+
}
|
|
832
|
+
function lt(t, n, e) {
|
|
833
|
+
const r = n.length > 1 && Array.from(n).every((p) => p === n[0]) ? n[0] : n, d = e ? t.indexOf(e) : -1;
|
|
834
|
+
let l = ao(t, Math.max(d, 0));
|
|
835
|
+
r.length === 1 && (l = l.filter((p) => p !== e));
|
|
836
|
+
const c = l.find(
|
|
837
|
+
(p) => p.textValue.toLowerCase().startsWith(r.toLowerCase())
|
|
838
|
+
);
|
|
839
|
+
return c !== e ? c : void 0;
|
|
840
|
+
}
|
|
841
|
+
function ao(t, n) {
|
|
842
|
+
return t.map((e, s) => t[(n + s) % t.length]);
|
|
843
|
+
}
|
|
844
|
+
var co = Ae, at = De, io = Ve, uo = ke, po = Be, ct = He, fo = Ke, mo = je, it = Ge, dt = qe, ho = Ze, go = Je, ut = Qe, pt = et, ft = ot;
|
|
845
|
+
const Mo = co, Ao = mo, Oo = io, vo = yt(
|
|
846
|
+
"flex items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1 transition-all duration-200",
|
|
847
|
+
{
|
|
848
|
+
variants: {
|
|
849
|
+
size: {
|
|
850
|
+
sm: "h-8 text-sm",
|
|
851
|
+
md: "h-10 text-base",
|
|
852
|
+
lg: "h-12 text-lg"
|
|
853
|
+
},
|
|
854
|
+
width: {
|
|
855
|
+
auto: "w-auto",
|
|
856
|
+
full: "w-full",
|
|
857
|
+
sm: "w-24",
|
|
858
|
+
md: "w-32",
|
|
859
|
+
lg: "w-48"
|
|
860
|
+
}
|
|
861
|
+
},
|
|
862
|
+
defaultVariants: {
|
|
863
|
+
size: "md",
|
|
864
|
+
width: "full"
|
|
865
|
+
}
|
|
866
|
+
}
|
|
867
|
+
), So = o.forwardRef(({ className: t, children: n, size: e, width: s, ...r }, d) => /* @__PURE__ */ Q(
|
|
868
|
+
at,
|
|
869
|
+
{
|
|
870
|
+
ref: d,
|
|
871
|
+
className: G(vo({ size: e, width: s }), t),
|
|
872
|
+
...r,
|
|
873
|
+
children: [
|
|
874
|
+
n,
|
|
875
|
+
/* @__PURE__ */ i(uo, { asChild: !0, children: /* @__PURE__ */ i(Me, { className: "h-4 w-4 opacity-50" }) })
|
|
876
|
+
]
|
|
877
|
+
}
|
|
878
|
+
));
|
|
879
|
+
So.displayName = at.displayName;
|
|
880
|
+
const mt = o.forwardRef(({ className: t, ...n }, e) => /* @__PURE__ */ i(
|
|
881
|
+
ut,
|
|
882
|
+
{
|
|
883
|
+
ref: e,
|
|
884
|
+
className: G("flex cursor-default items-center justify-center py-1", t),
|
|
885
|
+
...n,
|
|
886
|
+
children: /* @__PURE__ */ i(Lt, { className: "h-4 w-4" })
|
|
887
|
+
}
|
|
888
|
+
));
|
|
889
|
+
mt.displayName = ut.displayName;
|
|
890
|
+
const ht = o.forwardRef(({ className: t, ...n }, e) => /* @__PURE__ */ i(
|
|
891
|
+
pt,
|
|
892
|
+
{
|
|
893
|
+
ref: e,
|
|
894
|
+
className: G("flex cursor-default items-center justify-center py-1", t),
|
|
895
|
+
...n,
|
|
896
|
+
children: /* @__PURE__ */ i(Me, { className: "h-4 w-4" })
|
|
897
|
+
}
|
|
898
|
+
));
|
|
899
|
+
ht.displayName = pt.displayName;
|
|
900
|
+
const wo = o.forwardRef(({ className: t, children: n, position: e = "popper", ...s }, r) => /* @__PURE__ */ i(po, { children: /* @__PURE__ */ Q(
|
|
901
|
+
ct,
|
|
902
|
+
{
|
|
903
|
+
ref: r,
|
|
904
|
+
className: G(
|
|
905
|
+
"relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
906
|
+
e === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
|
|
907
|
+
t
|
|
908
|
+
),
|
|
909
|
+
position: e,
|
|
910
|
+
...s,
|
|
911
|
+
children: [
|
|
912
|
+
/* @__PURE__ */ i(mt, {}),
|
|
913
|
+
/* @__PURE__ */ i(
|
|
914
|
+
fo,
|
|
915
|
+
{
|
|
916
|
+
className: G(
|
|
917
|
+
"p-1",
|
|
918
|
+
e === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"
|
|
919
|
+
),
|
|
920
|
+
children: n
|
|
921
|
+
}
|
|
922
|
+
),
|
|
923
|
+
/* @__PURE__ */ i(ht, {})
|
|
924
|
+
]
|
|
925
|
+
}
|
|
926
|
+
) }));
|
|
927
|
+
wo.displayName = ct.displayName;
|
|
928
|
+
const yo = o.forwardRef(({ className: t, ...n }, e) => /* @__PURE__ */ i(
|
|
929
|
+
it,
|
|
930
|
+
{
|
|
931
|
+
ref: e,
|
|
932
|
+
className: G("py-1.5 pl-8 pr-2 text-sm font-semibold", t),
|
|
933
|
+
...n
|
|
934
|
+
}
|
|
935
|
+
));
|
|
936
|
+
yo.displayName = it.displayName;
|
|
937
|
+
const xo = o.forwardRef(({ className: t, children: n, ...e }, s) => /* @__PURE__ */ Q(
|
|
938
|
+
dt,
|
|
939
|
+
{
|
|
940
|
+
ref: s,
|
|
941
|
+
className: G(
|
|
942
|
+
"relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
943
|
+
t
|
|
944
|
+
),
|
|
945
|
+
...e,
|
|
946
|
+
children: [
|
|
947
|
+
/* @__PURE__ */ i("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ i(go, { children: /* @__PURE__ */ i(xt, { className: "h-4 w-4" }) }) }),
|
|
948
|
+
/* @__PURE__ */ i(ho, { children: n })
|
|
949
|
+
]
|
|
950
|
+
}
|
|
951
|
+
));
|
|
952
|
+
xo.displayName = dt.displayName;
|
|
953
|
+
const Co = o.forwardRef(({ className: t, ...n }, e) => /* @__PURE__ */ i(
|
|
954
|
+
ft,
|
|
955
|
+
{
|
|
956
|
+
ref: e,
|
|
957
|
+
className: G("-mx-1 my-1 h-px bg-muted", t),
|
|
958
|
+
...n
|
|
959
|
+
}
|
|
960
|
+
));
|
|
961
|
+
Co.displayName = ft.displayName;
|
|
962
|
+
export {
|
|
963
|
+
Mo as S,
|
|
964
|
+
Ao as a,
|
|
965
|
+
Oo as b,
|
|
966
|
+
So as c,
|
|
967
|
+
wo as d,
|
|
968
|
+
yo as e,
|
|
969
|
+
xo as f,
|
|
970
|
+
Co as g,
|
|
971
|
+
mt as h,
|
|
972
|
+
ht as i
|
|
973
|
+
};
|
|
974
|
+
//# sourceMappingURL=select-C1rNBi6c.js.map
|