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