@spear-ai/spectral 1.3.62 → 1.3.63
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/.js +181 -152
- package/dist/Accordion.d.ts +37 -0
- package/dist/Accordion.js +465 -0
- package/dist/Alert/AlertBase.js +2 -2
- package/dist/Alert.js +4 -3
- package/dist/Avatar.js +1 -1
- package/dist/Badge.d.ts +12 -2
- package/dist/Badge.js +28 -4
- package/dist/Button.js +2 -2
- package/dist/ButtonGroup/ButtonGroupButton.d.ts +13 -0
- package/dist/ButtonGroup/ButtonGroupButton.js +51 -0
- package/dist/ButtonGroup.d.ts +29 -0
- package/dist/ButtonGroup.js +89 -0
- package/dist/ButtonIcon.js +2 -1
- package/dist/Checkbox/CheckboxBase.js +1 -1
- package/dist/Checkbox.js +11 -12
- package/dist/Dialog/DialogBase.d.ts +1 -1
- package/dist/Dialog/DialogBase.js +2 -2
- package/dist/Dialog.js +4 -4
- package/dist/Drawer.js +24 -1283
- package/dist/HoverCard.d.ts +29 -0
- package/dist/HoverCard.js +207 -0
- package/dist/Icons/MessagesIcon.d.ts +3 -0
- package/dist/Icons/MessagesIcon.js +31 -0
- package/dist/Icons/index.d.ts +1 -0
- package/dist/Icons.js +50 -48
- package/dist/Input.d.ts +2 -0
- package/dist/Input.js +98 -89
- package/dist/InputGroup.d.ts +16 -0
- package/dist/InputGroup.js +129 -0
- package/dist/InputOTP.d.ts +0 -2
- package/dist/InputOTP.js +138 -142
- package/dist/Label.d.ts +3 -7
- package/dist/Label.js +11 -11
- package/dist/MultiSelect/MultiSelectBase.js +22 -22
- package/dist/Popover.d.ts +6 -7
- package/dist/Popover.js +60 -71
- package/dist/RadioButtonGroup/RadioButtonGroupBase.js +1 -1
- package/dist/RadioButtonGroup.js +1 -1
- package/dist/RadioGroup.d.ts +1 -1
- package/dist/RadioGroup.js +141 -134
- package/dist/Select.js +97 -895
- package/dist/Separator.d.ts +12 -0
- package/dist/Separator.js +24 -0
- package/dist/Skeleton.js +3 -3
- package/dist/Slider.d.ts +15 -3
- package/dist/Slider.js +464 -40
- package/dist/Switch/SwitchBase.js +1 -1
- package/dist/Switch.js +2 -2
- package/dist/Tabs/TabsBase.js +1 -1
- package/dist/Tabs.js +16 -16
- package/dist/Textarea.js +41 -42
- package/dist/Toggle.js +2 -2
- package/dist/ToggleGroup.js +1 -1
- package/dist/Tooltip/TooltipBase.js +29 -29
- package/dist/Tooltip.js +15 -15
- package/dist/Tray/TrayStoriesData.d.ts +39 -0
- package/dist/Tray/TrayStoriesData.js +438 -0
- package/dist/Tray.d.ts +28 -0
- package/dist/Tray.js +227 -0
- package/dist/clsx-OuTLNxxd.js +16 -0
- package/dist/components/Accordion/Accordion.d.ts +37 -0
- package/dist/components/Accordion/Accordion.d.ts.map +1 -0
- package/dist/components/Badge/Badge.d.ts +12 -2
- package/dist/components/Badge/Badge.d.ts.map +1 -1
- package/dist/components/ButtonGroup/ButtonGroup.d.ts +29 -0
- package/dist/components/ButtonGroup/ButtonGroup.d.ts.map +1 -0
- package/dist/components/ButtonGroup/ButtonGroupButton.d.ts +13 -0
- package/dist/components/ButtonGroup/ButtonGroupButton.d.ts.map +1 -0
- package/dist/components/Checkbox/Checkbox.d.ts.map +1 -1
- package/dist/components/Dialog/DialogBase.d.ts +1 -1
- package/dist/components/HoverCard/HoverCard.d.ts +29 -0
- package/dist/components/HoverCard/HoverCard.d.ts.map +1 -0
- package/dist/components/Icons/MessagesIcon.d.ts +3 -0
- package/dist/components/Icons/MessagesIcon.d.ts.map +1 -0
- package/dist/components/Icons/index.d.ts +1 -0
- package/dist/components/Icons/index.d.ts.map +1 -1
- package/dist/components/Input/Input.d.ts +2 -0
- package/dist/components/Input/Input.d.ts.map +1 -1
- package/dist/components/InputGroup/InputGroup.d.ts +16 -0
- package/dist/components/InputGroup/InputGroup.d.ts.map +1 -0
- package/dist/components/InputOTP/InputOTP.d.ts +0 -2
- package/dist/components/InputOTP/InputOTP.d.ts.map +1 -1
- package/dist/components/Label/Label.d.ts +3 -7
- package/dist/components/Label/Label.d.ts.map +1 -1
- package/dist/components/Popover/Popover.d.ts +6 -7
- package/dist/components/Popover/Popover.d.ts.map +1 -1
- package/dist/components/RadioGroup/RadioGroup.d.ts +1 -1
- package/dist/components/RadioGroup/RadioGroup.d.ts.map +1 -1
- package/dist/components/Separator/Separator.d.ts +12 -0
- package/dist/components/Separator/Separator.d.ts.map +1 -0
- package/dist/components/Slider/Slider.d.ts +15 -3
- package/dist/components/Slider/Slider.d.ts.map +1 -1
- package/dist/components/Textarea/Textarea.d.ts.map +1 -1
- package/dist/components/Tray/Tray.d.ts +28 -0
- package/dist/components/Tray/Tray.d.ts.map +1 -0
- package/dist/components/Tray/TrayStoriesData.d.ts +39 -0
- package/dist/components/Tray/TrayStoriesData.d.ts.map +1 -0
- package/dist/features/AuthCard/ForgotPasswordEmailForm.js +4 -3
- package/dist/features/AuthCard/ForgotPasswordResetForm.js +9 -9
- package/dist/features/AuthCard/PasswordInput.js +78 -9
- package/dist/features/AuthCard/SignInForm.js +8 -7
- package/dist/features/AuthCard/SignUpForm.js +8 -7
- package/dist/features/AuthCard.js +2 -2
- package/dist/features/LabelingTools.js +7 -6
- package/dist/features/SensorMetadata.js +3 -2
- package/dist/features/SettingsPopover.js +3 -2
- package/dist/index-0ioNhtNM.js +10 -0
- package/dist/{index-CBwRmAsQ.js → index-6Abv_Flm.js} +1 -1
- package/dist/{index-DUK1rxhf.js → index-B-GQStVW.js} +6 -5
- package/dist/index-B2oBi8ng.js +142 -0
- package/dist/index-BIpuW_o8.js +146 -0
- package/dist/index-BZPx6jYI.js +8 -0
- package/dist/index-BhufZRa2.js +232 -0
- package/dist/index-CAKA12cC.js +1265 -0
- package/dist/{index-Cfyte2YO.js → index-CGALWSq_.js} +1 -1
- package/dist/index-CVSxKOPp.js +13 -0
- package/dist/index-CevVJ05e.js +822 -0
- package/dist/{index-CRBC94ik.js → index-D29mdTf5.js} +1 -1
- package/dist/{index-FeGk8zep.js → index-NzygPVvJ.js} +10 -9
- package/dist/index-UEFPWH8U.js +54 -0
- package/dist/index-rKs9bXHr.js +6 -0
- package/dist/{index-Cb7rjMhE.js → index-y6Br5T4h.js} +6 -6
- package/dist/index.d.ts +10 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/linear-cursor-small.png +0 -0
- package/dist/message-alert-matte-glass-gradient.webp +0 -0
- package/dist/primitives/button.d.ts +10 -0
- package/dist/primitives/button.d.ts.map +1 -0
- package/dist/primitives/button.js +42 -0
- package/dist/primitives/input.d.ts +3 -0
- package/dist/primitives/input.d.ts.map +1 -0
- package/dist/primitives/input.js +18 -0
- package/dist/primitives/select.d.ts +16 -0
- package/dist/primitives/select.d.ts.map +1 -0
- package/dist/primitives/select.js +196 -0
- package/dist/primitives/slot.d.ts.map +1 -1
- package/dist/primitives/slot.js +21 -20
- package/dist/primitives/textarea.d.ts +3 -0
- package/dist/primitives/textarea.d.ts.map +1 -0
- package/dist/primitives/textarea.js +16 -0
- package/dist/{proxy-DD79Ok6n.js → proxy-C9AqCss6.js} +1 -1
- package/dist/speech-bubble-fluid-glass-gradient.webp +0 -0
- package/dist/styles/main.css +1 -1
- package/dist/utils/formFieldUtils.js +1 -1
- package/dist/utils/twUtils.js +2728 -2
- package/package.json +13 -8
- package/dist/Accordion/AccordionBase.d.ts +0 -42
- package/dist/Accordion/AccordionBase.js +0 -225
- package/dist/Badge/BadgeBase.d.ts +0 -13
- package/dist/Badge/BadgeBase.js +0 -35
- package/dist/PasswordInput-ClY_hxuN.js +0 -261
- package/dist/components/Accordion/AccordionBase.d.ts +0 -42
- package/dist/components/Accordion/AccordionBase.d.ts.map +0 -1
- package/dist/components/Badge/BadgeBase.d.ts +0 -13
- package/dist/components/Badge/BadgeBase.d.ts.map +0 -1
- package/dist/index-CA7haECj.js +0 -248
- package/dist/index-CbXx14YO.js +0 -59
- package/dist/index-VXXKXen4.js +0 -15
- package/dist/index-cCg4yNa8.js +0 -132
- package/dist/primitives/label.d.ts +0 -5
- package/dist/primitives/label.d.ts.map +0 -1
- package/dist/primitives/label.js +0 -27
- package/dist/twUtils-CRiPKpXj.js +0 -2743
|
@@ -0,0 +1,822 @@
|
|
|
1
|
+
import "./styles/main.css";
|
|
2
|
+
import * as t from "react";
|
|
3
|
+
import * as be from "react-dom";
|
|
4
|
+
import { c as Re } from "./index-rKs9bXHr.js";
|
|
5
|
+
import { u as Ee, c as st, a as k, P as M, b as R, d as Y, e as ct } from "./index-BhufZRa2.js";
|
|
6
|
+
import { u as lt, c as at } from "./index-UEFPWH8U.js";
|
|
7
|
+
import { D as it, P as dt } from "./index-B2oBi8ng.js";
|
|
8
|
+
import { h as ut, u as pt, R as ft, F as mt } from "./index-B-GQStVW.js";
|
|
9
|
+
import { u as Ie } from "./index-CVSxKOPp.js";
|
|
10
|
+
import { c as _e, R as ht, A as vt, C as gt, a as St } from "./index-NzygPVvJ.js";
|
|
11
|
+
import { u as wt } from "./index-0ioNhtNM.js";
|
|
12
|
+
import { u as Ct } from "./index-BZPx6jYI.js";
|
|
13
|
+
import { V as xt } from "./index-CGALWSq_.js";
|
|
14
|
+
import { jsx as p, jsxs as le, Fragment as Te } from "react/jsx-runtime";
|
|
15
|
+
var yt = [" ", "Enter", "ArrowUp", "ArrowDown"], It = [" ", "Enter"], J = "Select", [ie, de, Tt] = at(J), [te] = st(J, [
|
|
16
|
+
Tt,
|
|
17
|
+
_e
|
|
18
|
+
]), ue = _e(), [Pt, j] = te(J), [Rt, Et] = te(J), Ne = (o) => {
|
|
19
|
+
const {
|
|
20
|
+
__scopeSelect: l,
|
|
21
|
+
children: e,
|
|
22
|
+
open: a,
|
|
23
|
+
defaultOpen: s,
|
|
24
|
+
onOpenChange: d,
|
|
25
|
+
value: n,
|
|
26
|
+
defaultValue: r,
|
|
27
|
+
onValueChange: c,
|
|
28
|
+
dir: f,
|
|
29
|
+
name: g,
|
|
30
|
+
autoComplete: C,
|
|
31
|
+
disabled: E,
|
|
32
|
+
required: T,
|
|
33
|
+
form: y
|
|
34
|
+
} = o, i = ue(l), [h, S] = t.useState(null), [m, v] = t.useState(null), [W, A] = t.useState(!1), oe = lt(f), [b, D] = Ee({
|
|
35
|
+
prop: a,
|
|
36
|
+
defaultProp: s ?? !1,
|
|
37
|
+
onChange: d,
|
|
38
|
+
caller: J
|
|
39
|
+
}), [K, X] = Ee({
|
|
40
|
+
prop: n,
|
|
41
|
+
defaultProp: r,
|
|
42
|
+
onChange: c,
|
|
43
|
+
caller: J
|
|
44
|
+
}), V = t.useRef(null), B = h ? y || !!h.closest("form") : !0, [G, H] = t.useState(/* @__PURE__ */ new Set()), F = Array.from(G).map((_) => _.props.value).join(";");
|
|
45
|
+
return /* @__PURE__ */ p(ht, { ...i, children: /* @__PURE__ */ le(
|
|
46
|
+
Pt,
|
|
47
|
+
{
|
|
48
|
+
required: T,
|
|
49
|
+
scope: l,
|
|
50
|
+
trigger: h,
|
|
51
|
+
onTriggerChange: S,
|
|
52
|
+
valueNode: m,
|
|
53
|
+
onValueNodeChange: v,
|
|
54
|
+
valueNodeHasChildren: W,
|
|
55
|
+
onValueNodeHasChildrenChange: A,
|
|
56
|
+
contentId: Ie(),
|
|
57
|
+
value: K,
|
|
58
|
+
onValueChange: X,
|
|
59
|
+
open: b,
|
|
60
|
+
onOpenChange: D,
|
|
61
|
+
dir: oe,
|
|
62
|
+
triggerPointerDownPosRef: V,
|
|
63
|
+
disabled: E,
|
|
64
|
+
children: [
|
|
65
|
+
/* @__PURE__ */ p(ie.Provider, { scope: l, children: /* @__PURE__ */ p(
|
|
66
|
+
Rt,
|
|
67
|
+
{
|
|
68
|
+
scope: o.__scopeSelect,
|
|
69
|
+
onNativeOptionAdd: t.useCallback((_) => {
|
|
70
|
+
H((L) => new Set(L).add(_));
|
|
71
|
+
}, []),
|
|
72
|
+
onNativeOptionRemove: t.useCallback((_) => {
|
|
73
|
+
H((L) => {
|
|
74
|
+
const U = new Set(L);
|
|
75
|
+
return U.delete(_), U;
|
|
76
|
+
});
|
|
77
|
+
}, []),
|
|
78
|
+
children: e
|
|
79
|
+
}
|
|
80
|
+
) }),
|
|
81
|
+
B ? /* @__PURE__ */ le(
|
|
82
|
+
tt,
|
|
83
|
+
{
|
|
84
|
+
"aria-hidden": !0,
|
|
85
|
+
required: T,
|
|
86
|
+
tabIndex: -1,
|
|
87
|
+
name: g,
|
|
88
|
+
autoComplete: C,
|
|
89
|
+
value: K,
|
|
90
|
+
onChange: (_) => X(_.target.value),
|
|
91
|
+
disabled: E,
|
|
92
|
+
form: y,
|
|
93
|
+
children: [
|
|
94
|
+
K === void 0 ? /* @__PURE__ */ p("option", { value: "" }) : null,
|
|
95
|
+
Array.from(G)
|
|
96
|
+
]
|
|
97
|
+
},
|
|
98
|
+
F
|
|
99
|
+
) : null
|
|
100
|
+
]
|
|
101
|
+
}
|
|
102
|
+
) });
|
|
103
|
+
};
|
|
104
|
+
Ne.displayName = J;
|
|
105
|
+
var Me = "SelectTrigger", Ae = t.forwardRef(
|
|
106
|
+
(o, l) => {
|
|
107
|
+
const { __scopeSelect: e, disabled: a = !1, ...s } = o, d = ue(e), n = j(Me, e), r = n.disabled || a, c = k(l, n.onTriggerChange), f = de(e), g = t.useRef("touch"), [C, E, T] = nt((i) => {
|
|
108
|
+
const h = f().filter((v) => !v.disabled), S = h.find((v) => v.value === n.value), m = rt(h, i, S);
|
|
109
|
+
m !== void 0 && n.onValueChange(m.value);
|
|
110
|
+
}), y = (i) => {
|
|
111
|
+
r || (n.onOpenChange(!0), T()), i && (n.triggerPointerDownPosRef.current = {
|
|
112
|
+
x: Math.round(i.pageX),
|
|
113
|
+
y: Math.round(i.pageY)
|
|
114
|
+
});
|
|
115
|
+
};
|
|
116
|
+
return /* @__PURE__ */ p(vt, { asChild: !0, ...d, children: /* @__PURE__ */ p(
|
|
117
|
+
M.button,
|
|
118
|
+
{
|
|
119
|
+
type: "button",
|
|
120
|
+
role: "combobox",
|
|
121
|
+
"aria-controls": n.contentId,
|
|
122
|
+
"aria-expanded": n.open,
|
|
123
|
+
"aria-required": n.required,
|
|
124
|
+
"aria-autocomplete": "none",
|
|
125
|
+
dir: n.dir,
|
|
126
|
+
"data-state": n.open ? "open" : "closed",
|
|
127
|
+
disabled: r,
|
|
128
|
+
"data-disabled": r ? "" : void 0,
|
|
129
|
+
"data-placeholder": ot(n.value) ? "" : void 0,
|
|
130
|
+
...s,
|
|
131
|
+
ref: c,
|
|
132
|
+
onClick: R(s.onClick, (i) => {
|
|
133
|
+
i.currentTarget.focus(), g.current !== "mouse" && y(i);
|
|
134
|
+
}),
|
|
135
|
+
onPointerDown: R(s.onPointerDown, (i) => {
|
|
136
|
+
g.current = i.pointerType;
|
|
137
|
+
const h = i.target;
|
|
138
|
+
h.hasPointerCapture(i.pointerId) && h.releasePointerCapture(i.pointerId), i.button === 0 && i.ctrlKey === !1 && i.pointerType === "mouse" && (y(i), i.preventDefault());
|
|
139
|
+
}),
|
|
140
|
+
onKeyDown: R(s.onKeyDown, (i) => {
|
|
141
|
+
const h = C.current !== "";
|
|
142
|
+
!(i.ctrlKey || i.altKey || i.metaKey) && i.key.length === 1 && E(i.key), !(h && i.key === " ") && yt.includes(i.key) && (y(), i.preventDefault());
|
|
143
|
+
})
|
|
144
|
+
}
|
|
145
|
+
) });
|
|
146
|
+
}
|
|
147
|
+
);
|
|
148
|
+
Ae.displayName = Me;
|
|
149
|
+
var Oe = "SelectValue", De = t.forwardRef(
|
|
150
|
+
(o, l) => {
|
|
151
|
+
const { __scopeSelect: e, className: a, style: s, children: d, placeholder: n = "", ...r } = o, c = j(Oe, e), { onValueNodeHasChildrenChange: f } = c, g = d !== void 0, C = k(l, c.onValueNodeChange);
|
|
152
|
+
return Y(() => {
|
|
153
|
+
f(g);
|
|
154
|
+
}, [f, g]), /* @__PURE__ */ p(
|
|
155
|
+
M.span,
|
|
156
|
+
{
|
|
157
|
+
...r,
|
|
158
|
+
ref: C,
|
|
159
|
+
style: { pointerEvents: "none" },
|
|
160
|
+
children: ot(c.value) ? /* @__PURE__ */ p(Te, { children: n }) : d
|
|
161
|
+
}
|
|
162
|
+
);
|
|
163
|
+
}
|
|
164
|
+
);
|
|
165
|
+
De.displayName = Oe;
|
|
166
|
+
var bt = "SelectIcon", Le = t.forwardRef(
|
|
167
|
+
(o, l) => {
|
|
168
|
+
const { __scopeSelect: e, children: a, ...s } = o;
|
|
169
|
+
return /* @__PURE__ */ p(M.span, { "aria-hidden": !0, ...s, ref: l, children: a || "▼" });
|
|
170
|
+
}
|
|
171
|
+
);
|
|
172
|
+
Le.displayName = bt;
|
|
173
|
+
var _t = "SelectPortal", ke = (o) => /* @__PURE__ */ p(dt, { asChild: !0, ...o });
|
|
174
|
+
ke.displayName = _t;
|
|
175
|
+
var Q = "SelectContent", Ve = t.forwardRef(
|
|
176
|
+
(o, l) => {
|
|
177
|
+
const e = j(Q, o.__scopeSelect), [a, s] = t.useState();
|
|
178
|
+
if (Y(() => {
|
|
179
|
+
s(new DocumentFragment());
|
|
180
|
+
}, []), !e.open) {
|
|
181
|
+
const d = a;
|
|
182
|
+
return d ? be.createPortal(
|
|
183
|
+
/* @__PURE__ */ p(Be, { scope: o.__scopeSelect, children: /* @__PURE__ */ p(ie.Slot, { scope: o.__scopeSelect, children: /* @__PURE__ */ p("div", { children: o.children }) }) }),
|
|
184
|
+
d
|
|
185
|
+
) : null;
|
|
186
|
+
}
|
|
187
|
+
return /* @__PURE__ */ p(He, { ...o, ref: l });
|
|
188
|
+
}
|
|
189
|
+
);
|
|
190
|
+
Ve.displayName = Q;
|
|
191
|
+
var O = 10, [Be, q] = te(Q), Nt = "SelectContentImpl", Mt = ct("SelectContent.RemoveScroll"), He = t.forwardRef(
|
|
192
|
+
(o, l) => {
|
|
193
|
+
const {
|
|
194
|
+
__scopeSelect: e,
|
|
195
|
+
position: a = "item-aligned",
|
|
196
|
+
onCloseAutoFocus: s,
|
|
197
|
+
onEscapeKeyDown: d,
|
|
198
|
+
onPointerDownOutside: n,
|
|
199
|
+
//
|
|
200
|
+
// PopperContent props
|
|
201
|
+
side: r,
|
|
202
|
+
sideOffset: c,
|
|
203
|
+
align: f,
|
|
204
|
+
alignOffset: g,
|
|
205
|
+
arrowPadding: C,
|
|
206
|
+
collisionBoundary: E,
|
|
207
|
+
collisionPadding: T,
|
|
208
|
+
sticky: y,
|
|
209
|
+
hideWhenDetached: i,
|
|
210
|
+
avoidCollisions: h,
|
|
211
|
+
//
|
|
212
|
+
...S
|
|
213
|
+
} = o, m = j(Q, e), [v, W] = t.useState(null), [A, oe] = t.useState(null), b = k(l, (u) => W(u)), [D, K] = t.useState(null), [X, V] = t.useState(
|
|
214
|
+
null
|
|
215
|
+
), B = de(e), [G, H] = t.useState(!1), F = t.useRef(!1);
|
|
216
|
+
t.useEffect(() => {
|
|
217
|
+
if (v) return ut(v);
|
|
218
|
+
}, [v]), pt();
|
|
219
|
+
const _ = t.useCallback(
|
|
220
|
+
(u) => {
|
|
221
|
+
const [I, ...N] = B().map((P) => P.ref.current), [w] = N.slice(-1), x = document.activeElement;
|
|
222
|
+
for (const P of u)
|
|
223
|
+
if (P === x || (P?.scrollIntoView({ block: "nearest" }), P === I && A && (A.scrollTop = 0), P === w && A && (A.scrollTop = A.scrollHeight), P?.focus(), document.activeElement !== x)) return;
|
|
224
|
+
},
|
|
225
|
+
[B, A]
|
|
226
|
+
), L = t.useCallback(
|
|
227
|
+
() => _([D, v]),
|
|
228
|
+
[_, D, v]
|
|
229
|
+
);
|
|
230
|
+
t.useEffect(() => {
|
|
231
|
+
G && L();
|
|
232
|
+
}, [G, L]);
|
|
233
|
+
const { onOpenChange: U, triggerPointerDownPosRef: z } = m;
|
|
234
|
+
t.useEffect(() => {
|
|
235
|
+
if (v) {
|
|
236
|
+
let u = { x: 0, y: 0 };
|
|
237
|
+
const I = (w) => {
|
|
238
|
+
u = {
|
|
239
|
+
x: Math.abs(Math.round(w.pageX) - (z.current?.x ?? 0)),
|
|
240
|
+
y: Math.abs(Math.round(w.pageY) - (z.current?.y ?? 0))
|
|
241
|
+
};
|
|
242
|
+
}, N = (w) => {
|
|
243
|
+
u.x <= 10 && u.y <= 10 ? w.preventDefault() : v.contains(w.target) || U(!1), document.removeEventListener("pointermove", I), z.current = null;
|
|
244
|
+
};
|
|
245
|
+
return z.current !== null && (document.addEventListener("pointermove", I), document.addEventListener("pointerup", N, { capture: !0, once: !0 })), () => {
|
|
246
|
+
document.removeEventListener("pointermove", I), document.removeEventListener("pointerup", N, { capture: !0 });
|
|
247
|
+
};
|
|
248
|
+
}
|
|
249
|
+
}, [v, U, z]), t.useEffect(() => {
|
|
250
|
+
const u = () => U(!1);
|
|
251
|
+
return window.addEventListener("blur", u), window.addEventListener("resize", u), () => {
|
|
252
|
+
window.removeEventListener("blur", u), window.removeEventListener("resize", u);
|
|
253
|
+
};
|
|
254
|
+
}, [U]);
|
|
255
|
+
const [pe, se] = nt((u) => {
|
|
256
|
+
const I = B().filter((x) => !x.disabled), N = I.find((x) => x.ref.current === document.activeElement), w = rt(I, u, N);
|
|
257
|
+
w && setTimeout(() => w.ref.current.focus());
|
|
258
|
+
}), fe = t.useCallback(
|
|
259
|
+
(u, I, N) => {
|
|
260
|
+
const w = !F.current && !N;
|
|
261
|
+
(m.value !== void 0 && m.value === I || w) && (K(u), w && (F.current = !0));
|
|
262
|
+
},
|
|
263
|
+
[m.value]
|
|
264
|
+
), me = t.useCallback(() => v?.focus(), [v]), ee = t.useCallback(
|
|
265
|
+
(u, I, N) => {
|
|
266
|
+
const w = !F.current && !N;
|
|
267
|
+
(m.value !== void 0 && m.value === I || w) && V(u);
|
|
268
|
+
},
|
|
269
|
+
[m.value]
|
|
270
|
+
), ce = a === "popper" ? Se : Fe, ne = ce === Se ? {
|
|
271
|
+
side: r,
|
|
272
|
+
sideOffset: c,
|
|
273
|
+
align: f,
|
|
274
|
+
alignOffset: g,
|
|
275
|
+
arrowPadding: C,
|
|
276
|
+
collisionBoundary: E,
|
|
277
|
+
collisionPadding: T,
|
|
278
|
+
sticky: y,
|
|
279
|
+
hideWhenDetached: i,
|
|
280
|
+
avoidCollisions: h
|
|
281
|
+
} : {};
|
|
282
|
+
return /* @__PURE__ */ p(
|
|
283
|
+
Be,
|
|
284
|
+
{
|
|
285
|
+
scope: e,
|
|
286
|
+
content: v,
|
|
287
|
+
viewport: A,
|
|
288
|
+
onViewportChange: oe,
|
|
289
|
+
itemRefCallback: fe,
|
|
290
|
+
selectedItem: D,
|
|
291
|
+
onItemLeave: me,
|
|
292
|
+
itemTextRefCallback: ee,
|
|
293
|
+
focusSelectedItem: L,
|
|
294
|
+
selectedItemText: X,
|
|
295
|
+
position: a,
|
|
296
|
+
isPositioned: G,
|
|
297
|
+
searchRef: pe,
|
|
298
|
+
children: /* @__PURE__ */ p(ft, { as: Mt, allowPinchZoom: !0, children: /* @__PURE__ */ p(
|
|
299
|
+
mt,
|
|
300
|
+
{
|
|
301
|
+
asChild: !0,
|
|
302
|
+
trapped: m.open,
|
|
303
|
+
onMountAutoFocus: (u) => {
|
|
304
|
+
u.preventDefault();
|
|
305
|
+
},
|
|
306
|
+
onUnmountAutoFocus: R(s, (u) => {
|
|
307
|
+
m.trigger?.focus({ preventScroll: !0 }), u.preventDefault();
|
|
308
|
+
}),
|
|
309
|
+
children: /* @__PURE__ */ p(
|
|
310
|
+
it,
|
|
311
|
+
{
|
|
312
|
+
asChild: !0,
|
|
313
|
+
disableOutsidePointerEvents: !0,
|
|
314
|
+
onEscapeKeyDown: d,
|
|
315
|
+
onPointerDownOutside: n,
|
|
316
|
+
onFocusOutside: (u) => u.preventDefault(),
|
|
317
|
+
onDismiss: () => m.onOpenChange(!1),
|
|
318
|
+
children: /* @__PURE__ */ p(
|
|
319
|
+
ce,
|
|
320
|
+
{
|
|
321
|
+
role: "listbox",
|
|
322
|
+
id: m.contentId,
|
|
323
|
+
"data-state": m.open ? "open" : "closed",
|
|
324
|
+
dir: m.dir,
|
|
325
|
+
onContextMenu: (u) => u.preventDefault(),
|
|
326
|
+
...S,
|
|
327
|
+
...ne,
|
|
328
|
+
onPlaced: () => H(!0),
|
|
329
|
+
ref: b,
|
|
330
|
+
style: {
|
|
331
|
+
// flex layout so we can place the scroll buttons properly
|
|
332
|
+
display: "flex",
|
|
333
|
+
flexDirection: "column",
|
|
334
|
+
// reset the outline by default as the content MAY get focused
|
|
335
|
+
outline: "none",
|
|
336
|
+
...S.style
|
|
337
|
+
},
|
|
338
|
+
onKeyDown: R(S.onKeyDown, (u) => {
|
|
339
|
+
const I = u.ctrlKey || u.altKey || u.metaKey;
|
|
340
|
+
if (u.key === "Tab" && u.preventDefault(), !I && u.key.length === 1 && se(u.key), ["ArrowUp", "ArrowDown", "Home", "End"].includes(u.key)) {
|
|
341
|
+
let w = B().filter((x) => !x.disabled).map((x) => x.ref.current);
|
|
342
|
+
if (["ArrowUp", "End"].includes(u.key) && (w = w.slice().reverse()), ["ArrowUp", "ArrowDown"].includes(u.key)) {
|
|
343
|
+
const x = u.target, P = w.indexOf(x);
|
|
344
|
+
w = w.slice(P + 1);
|
|
345
|
+
}
|
|
346
|
+
setTimeout(() => _(w)), u.preventDefault();
|
|
347
|
+
}
|
|
348
|
+
})
|
|
349
|
+
}
|
|
350
|
+
)
|
|
351
|
+
}
|
|
352
|
+
)
|
|
353
|
+
}
|
|
354
|
+
) })
|
|
355
|
+
}
|
|
356
|
+
);
|
|
357
|
+
}
|
|
358
|
+
);
|
|
359
|
+
He.displayName = Nt;
|
|
360
|
+
var At = "SelectItemAlignedPosition", Fe = t.forwardRef((o, l) => {
|
|
361
|
+
const { __scopeSelect: e, onPlaced: a, ...s } = o, d = j(Q, e), n = q(Q, e), [r, c] = t.useState(null), [f, g] = t.useState(null), C = k(l, (b) => g(b)), E = de(e), T = t.useRef(!1), y = t.useRef(!0), { viewport: i, selectedItem: h, selectedItemText: S, focusSelectedItem: m } = n, v = t.useCallback(() => {
|
|
362
|
+
if (d.trigger && d.valueNode && r && f && i && h && S) {
|
|
363
|
+
const b = d.trigger.getBoundingClientRect(), D = f.getBoundingClientRect(), K = d.valueNode.getBoundingClientRect(), X = S.getBoundingClientRect();
|
|
364
|
+
if (d.dir !== "rtl") {
|
|
365
|
+
const x = X.left - D.left, P = K.left - x, Z = b.left - P, $ = b.width + Z, he = Math.max($, D.width), ve = window.innerWidth - O, ge = Re(P, [
|
|
366
|
+
O,
|
|
367
|
+
// Prevents the content from going off the starting edge of the
|
|
368
|
+
// viewport. It may still go off the ending edge, but this can be
|
|
369
|
+
// controlled by the user since they may want to manage overflow in a
|
|
370
|
+
// specific way.
|
|
371
|
+
// https://github.com/radix-ui/primitives/issues/2049
|
|
372
|
+
Math.max(O, ve - he)
|
|
373
|
+
]);
|
|
374
|
+
r.style.minWidth = $ + "px", r.style.left = ge + "px";
|
|
375
|
+
} else {
|
|
376
|
+
const x = D.right - X.right, P = window.innerWidth - K.right - x, Z = window.innerWidth - b.right - P, $ = b.width + Z, he = Math.max($, D.width), ve = window.innerWidth - O, ge = Re(P, [
|
|
377
|
+
O,
|
|
378
|
+
Math.max(O, ve - he)
|
|
379
|
+
]);
|
|
380
|
+
r.style.minWidth = $ + "px", r.style.right = ge + "px";
|
|
381
|
+
}
|
|
382
|
+
const V = E(), B = window.innerHeight - O * 2, G = i.scrollHeight, H = window.getComputedStyle(f), F = parseInt(H.borderTopWidth, 10), _ = parseInt(H.paddingTop, 10), L = parseInt(H.borderBottomWidth, 10), U = parseInt(H.paddingBottom, 10), z = F + _ + G + U + L, pe = Math.min(h.offsetHeight * 5, z), se = window.getComputedStyle(i), fe = parseInt(se.paddingTop, 10), me = parseInt(se.paddingBottom, 10), ee = b.top + b.height / 2 - O, ce = B - ee, ne = h.offsetHeight / 2, u = h.offsetTop + ne, I = F + _ + u, N = z - I;
|
|
383
|
+
if (I <= ee) {
|
|
384
|
+
const x = V.length > 0 && h === V[V.length - 1].ref.current;
|
|
385
|
+
r.style.bottom = "0px";
|
|
386
|
+
const P = f.clientHeight - i.offsetTop - i.offsetHeight, Z = Math.max(
|
|
387
|
+
ce,
|
|
388
|
+
ne + // viewport might have padding bottom, include it to avoid a scrollable viewport
|
|
389
|
+
(x ? me : 0) + P + L
|
|
390
|
+
), $ = I + Z;
|
|
391
|
+
r.style.height = $ + "px";
|
|
392
|
+
} else {
|
|
393
|
+
const x = V.length > 0 && h === V[0].ref.current;
|
|
394
|
+
r.style.top = "0px";
|
|
395
|
+
const Z = Math.max(
|
|
396
|
+
ee,
|
|
397
|
+
F + i.offsetTop + // viewport might have padding top, include it to avoid a scrollable viewport
|
|
398
|
+
(x ? fe : 0) + ne
|
|
399
|
+
) + N;
|
|
400
|
+
r.style.height = Z + "px", i.scrollTop = I - ee + i.offsetTop;
|
|
401
|
+
}
|
|
402
|
+
r.style.margin = `${O}px 0`, r.style.minHeight = pe + "px", r.style.maxHeight = B + "px", a?.(), requestAnimationFrame(() => T.current = !0);
|
|
403
|
+
}
|
|
404
|
+
}, [
|
|
405
|
+
E,
|
|
406
|
+
d.trigger,
|
|
407
|
+
d.valueNode,
|
|
408
|
+
r,
|
|
409
|
+
f,
|
|
410
|
+
i,
|
|
411
|
+
h,
|
|
412
|
+
S,
|
|
413
|
+
d.dir,
|
|
414
|
+
a
|
|
415
|
+
]);
|
|
416
|
+
Y(() => v(), [v]);
|
|
417
|
+
const [W, A] = t.useState();
|
|
418
|
+
Y(() => {
|
|
419
|
+
f && A(window.getComputedStyle(f).zIndex);
|
|
420
|
+
}, [f]);
|
|
421
|
+
const oe = t.useCallback(
|
|
422
|
+
(b) => {
|
|
423
|
+
b && y.current === !0 && (v(), m?.(), y.current = !1);
|
|
424
|
+
},
|
|
425
|
+
[v, m]
|
|
426
|
+
);
|
|
427
|
+
return /* @__PURE__ */ p(
|
|
428
|
+
Dt,
|
|
429
|
+
{
|
|
430
|
+
scope: e,
|
|
431
|
+
contentWrapper: r,
|
|
432
|
+
shouldExpandOnScrollRef: T,
|
|
433
|
+
onScrollButtonChange: oe,
|
|
434
|
+
children: /* @__PURE__ */ p(
|
|
435
|
+
"div",
|
|
436
|
+
{
|
|
437
|
+
ref: c,
|
|
438
|
+
style: {
|
|
439
|
+
display: "flex",
|
|
440
|
+
flexDirection: "column",
|
|
441
|
+
position: "fixed",
|
|
442
|
+
zIndex: W
|
|
443
|
+
},
|
|
444
|
+
children: /* @__PURE__ */ p(
|
|
445
|
+
M.div,
|
|
446
|
+
{
|
|
447
|
+
...s,
|
|
448
|
+
ref: C,
|
|
449
|
+
style: {
|
|
450
|
+
// When we get the height of the content, it includes borders. If we were to set
|
|
451
|
+
// the height without having `boxSizing: 'border-box'` it would be too big.
|
|
452
|
+
boxSizing: "border-box",
|
|
453
|
+
// We need to ensure the content doesn't get taller than the wrapper
|
|
454
|
+
maxHeight: "100%",
|
|
455
|
+
...s.style
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
)
|
|
459
|
+
}
|
|
460
|
+
)
|
|
461
|
+
}
|
|
462
|
+
);
|
|
463
|
+
});
|
|
464
|
+
Fe.displayName = At;
|
|
465
|
+
var Ot = "SelectPopperPosition", Se = t.forwardRef((o, l) => {
|
|
466
|
+
const {
|
|
467
|
+
__scopeSelect: e,
|
|
468
|
+
align: a = "start",
|
|
469
|
+
collisionPadding: s = O,
|
|
470
|
+
...d
|
|
471
|
+
} = o, n = ue(e);
|
|
472
|
+
return /* @__PURE__ */ p(
|
|
473
|
+
gt,
|
|
474
|
+
{
|
|
475
|
+
...n,
|
|
476
|
+
...d,
|
|
477
|
+
ref: l,
|
|
478
|
+
align: a,
|
|
479
|
+
collisionPadding: s,
|
|
480
|
+
style: {
|
|
481
|
+
// Ensure border-box for floating-ui calculations
|
|
482
|
+
boxSizing: "border-box",
|
|
483
|
+
...d.style,
|
|
484
|
+
"--radix-select-content-transform-origin": "var(--radix-popper-transform-origin)",
|
|
485
|
+
"--radix-select-content-available-width": "var(--radix-popper-available-width)",
|
|
486
|
+
"--radix-select-content-available-height": "var(--radix-popper-available-height)",
|
|
487
|
+
"--radix-select-trigger-width": "var(--radix-popper-anchor-width)",
|
|
488
|
+
"--radix-select-trigger-height": "var(--radix-popper-anchor-height)"
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
);
|
|
492
|
+
});
|
|
493
|
+
Se.displayName = Ot;
|
|
494
|
+
var [Dt, Pe] = te(Q, {}), we = "SelectViewport", Ue = t.forwardRef(
|
|
495
|
+
(o, l) => {
|
|
496
|
+
const { __scopeSelect: e, nonce: a, ...s } = o, d = q(we, e), n = Pe(we, e), r = k(l, d.onViewportChange), c = t.useRef(0);
|
|
497
|
+
return /* @__PURE__ */ le(Te, { children: [
|
|
498
|
+
/* @__PURE__ */ p(
|
|
499
|
+
"style",
|
|
500
|
+
{
|
|
501
|
+
dangerouslySetInnerHTML: {
|
|
502
|
+
__html: "[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"
|
|
503
|
+
},
|
|
504
|
+
nonce: a
|
|
505
|
+
}
|
|
506
|
+
),
|
|
507
|
+
/* @__PURE__ */ p(ie.Slot, { scope: e, children: /* @__PURE__ */ p(
|
|
508
|
+
M.div,
|
|
509
|
+
{
|
|
510
|
+
"data-radix-select-viewport": "",
|
|
511
|
+
role: "presentation",
|
|
512
|
+
...s,
|
|
513
|
+
ref: r,
|
|
514
|
+
style: {
|
|
515
|
+
// we use position: 'relative' here on the `viewport` so that when we call
|
|
516
|
+
// `selectedItem.offsetTop` in calculations, the offset is relative to the viewport
|
|
517
|
+
// (independent of the scrollUpButton).
|
|
518
|
+
position: "relative",
|
|
519
|
+
flex: 1,
|
|
520
|
+
// Viewport should only be scrollable in the vertical direction.
|
|
521
|
+
// This won't work in vertical writing modes, so we'll need to
|
|
522
|
+
// revisit this if/when that is supported
|
|
523
|
+
// https://developer.chrome.com/blog/vertical-form-controls
|
|
524
|
+
overflow: "hidden auto",
|
|
525
|
+
...s.style
|
|
526
|
+
},
|
|
527
|
+
onScroll: R(s.onScroll, (f) => {
|
|
528
|
+
const g = f.currentTarget, { contentWrapper: C, shouldExpandOnScrollRef: E } = n;
|
|
529
|
+
if (E?.current && C) {
|
|
530
|
+
const T = Math.abs(c.current - g.scrollTop);
|
|
531
|
+
if (T > 0) {
|
|
532
|
+
const y = window.innerHeight - O * 2, i = parseFloat(C.style.minHeight), h = parseFloat(C.style.height), S = Math.max(i, h);
|
|
533
|
+
if (S < y) {
|
|
534
|
+
const m = S + T, v = Math.min(y, m), W = m - v;
|
|
535
|
+
C.style.height = v + "px", C.style.bottom === "0px" && (g.scrollTop = W > 0 ? W : 0, C.style.justifyContent = "flex-end");
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
c.current = g.scrollTop;
|
|
540
|
+
})
|
|
541
|
+
}
|
|
542
|
+
) })
|
|
543
|
+
] });
|
|
544
|
+
}
|
|
545
|
+
);
|
|
546
|
+
Ue.displayName = we;
|
|
547
|
+
var We = "SelectGroup", [Lt, kt] = te(We), Ke = t.forwardRef(
|
|
548
|
+
(o, l) => {
|
|
549
|
+
const { __scopeSelect: e, ...a } = o, s = Ie();
|
|
550
|
+
return /* @__PURE__ */ p(Lt, { scope: e, id: s, children: /* @__PURE__ */ p(M.div, { role: "group", "aria-labelledby": s, ...a, ref: l }) });
|
|
551
|
+
}
|
|
552
|
+
);
|
|
553
|
+
Ke.displayName = We;
|
|
554
|
+
var Ge = "SelectLabel", ze = t.forwardRef(
|
|
555
|
+
(o, l) => {
|
|
556
|
+
const { __scopeSelect: e, ...a } = o, s = kt(Ge, e);
|
|
557
|
+
return /* @__PURE__ */ p(M.div, { id: s.id, ...a, ref: l });
|
|
558
|
+
}
|
|
559
|
+
);
|
|
560
|
+
ze.displayName = Ge;
|
|
561
|
+
var ae = "SelectItem", [Vt, Ye] = te(ae), je = t.forwardRef(
|
|
562
|
+
(o, l) => {
|
|
563
|
+
const {
|
|
564
|
+
__scopeSelect: e,
|
|
565
|
+
value: a,
|
|
566
|
+
disabled: s = !1,
|
|
567
|
+
textValue: d,
|
|
568
|
+
...n
|
|
569
|
+
} = o, r = j(ae, e), c = q(ae, e), f = r.value === a, [g, C] = t.useState(d ?? ""), [E, T] = t.useState(!1), y = k(
|
|
570
|
+
l,
|
|
571
|
+
(m) => c.itemRefCallback?.(m, a, s)
|
|
572
|
+
), i = Ie(), h = t.useRef("touch"), S = () => {
|
|
573
|
+
s || (r.onValueChange(a), r.onOpenChange(!1));
|
|
574
|
+
};
|
|
575
|
+
if (a === "")
|
|
576
|
+
throw new Error(
|
|
577
|
+
"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."
|
|
578
|
+
);
|
|
579
|
+
return /* @__PURE__ */ p(
|
|
580
|
+
Vt,
|
|
581
|
+
{
|
|
582
|
+
scope: e,
|
|
583
|
+
value: a,
|
|
584
|
+
disabled: s,
|
|
585
|
+
textId: i,
|
|
586
|
+
isSelected: f,
|
|
587
|
+
onItemTextChange: t.useCallback((m) => {
|
|
588
|
+
C((v) => v || (m?.textContent ?? "").trim());
|
|
589
|
+
}, []),
|
|
590
|
+
children: /* @__PURE__ */ p(
|
|
591
|
+
ie.ItemSlot,
|
|
592
|
+
{
|
|
593
|
+
scope: e,
|
|
594
|
+
value: a,
|
|
595
|
+
disabled: s,
|
|
596
|
+
textValue: g,
|
|
597
|
+
children: /* @__PURE__ */ p(
|
|
598
|
+
M.div,
|
|
599
|
+
{
|
|
600
|
+
role: "option",
|
|
601
|
+
"aria-labelledby": i,
|
|
602
|
+
"data-highlighted": E ? "" : void 0,
|
|
603
|
+
"aria-selected": f && E,
|
|
604
|
+
"data-state": f ? "checked" : "unchecked",
|
|
605
|
+
"aria-disabled": s || void 0,
|
|
606
|
+
"data-disabled": s ? "" : void 0,
|
|
607
|
+
tabIndex: s ? void 0 : -1,
|
|
608
|
+
...n,
|
|
609
|
+
ref: y,
|
|
610
|
+
onFocus: R(n.onFocus, () => T(!0)),
|
|
611
|
+
onBlur: R(n.onBlur, () => T(!1)),
|
|
612
|
+
onClick: R(n.onClick, () => {
|
|
613
|
+
h.current !== "mouse" && S();
|
|
614
|
+
}),
|
|
615
|
+
onPointerUp: R(n.onPointerUp, () => {
|
|
616
|
+
h.current === "mouse" && S();
|
|
617
|
+
}),
|
|
618
|
+
onPointerDown: R(n.onPointerDown, (m) => {
|
|
619
|
+
h.current = m.pointerType;
|
|
620
|
+
}),
|
|
621
|
+
onPointerMove: R(n.onPointerMove, (m) => {
|
|
622
|
+
h.current = m.pointerType, s ? c.onItemLeave?.() : h.current === "mouse" && m.currentTarget.focus({ preventScroll: !0 });
|
|
623
|
+
}),
|
|
624
|
+
onPointerLeave: R(n.onPointerLeave, (m) => {
|
|
625
|
+
m.currentTarget === document.activeElement && c.onItemLeave?.();
|
|
626
|
+
}),
|
|
627
|
+
onKeyDown: R(n.onKeyDown, (m) => {
|
|
628
|
+
c.searchRef?.current !== "" && m.key === " " || (It.includes(m.key) && S(), m.key === " " && m.preventDefault());
|
|
629
|
+
})
|
|
630
|
+
}
|
|
631
|
+
)
|
|
632
|
+
}
|
|
633
|
+
)
|
|
634
|
+
}
|
|
635
|
+
);
|
|
636
|
+
}
|
|
637
|
+
);
|
|
638
|
+
je.displayName = ae;
|
|
639
|
+
var re = "SelectItemText", qe = t.forwardRef(
|
|
640
|
+
(o, l) => {
|
|
641
|
+
const { __scopeSelect: e, className: a, style: s, ...d } = o, n = j(re, e), r = q(re, e), c = Ye(re, e), f = Et(re, e), [g, C] = t.useState(null), E = k(
|
|
642
|
+
l,
|
|
643
|
+
(S) => C(S),
|
|
644
|
+
c.onItemTextChange,
|
|
645
|
+
(S) => r.itemTextRefCallback?.(S, c.value, c.disabled)
|
|
646
|
+
), T = g?.textContent, y = t.useMemo(
|
|
647
|
+
() => /* @__PURE__ */ p("option", { value: c.value, disabled: c.disabled, children: T }, c.value),
|
|
648
|
+
[c.disabled, c.value, T]
|
|
649
|
+
), { onNativeOptionAdd: i, onNativeOptionRemove: h } = f;
|
|
650
|
+
return Y(() => (i(y), () => h(y)), [i, h, y]), /* @__PURE__ */ le(Te, { children: [
|
|
651
|
+
/* @__PURE__ */ p(M.span, { id: c.textId, ...d, ref: E }),
|
|
652
|
+
c.isSelected && n.valueNode && !n.valueNodeHasChildren ? be.createPortal(d.children, n.valueNode) : null
|
|
653
|
+
] });
|
|
654
|
+
}
|
|
655
|
+
);
|
|
656
|
+
qe.displayName = re;
|
|
657
|
+
var Xe = "SelectItemIndicator", Ze = t.forwardRef(
|
|
658
|
+
(o, l) => {
|
|
659
|
+
const { __scopeSelect: e, ...a } = o;
|
|
660
|
+
return Ye(Xe, e).isSelected ? /* @__PURE__ */ p(M.span, { "aria-hidden": !0, ...a, ref: l }) : null;
|
|
661
|
+
}
|
|
662
|
+
);
|
|
663
|
+
Ze.displayName = Xe;
|
|
664
|
+
var Ce = "SelectScrollUpButton", $e = t.forwardRef((o, l) => {
|
|
665
|
+
const e = q(Ce, o.__scopeSelect), a = Pe(Ce, o.__scopeSelect), [s, d] = t.useState(!1), n = k(l, a.onScrollButtonChange);
|
|
666
|
+
return Y(() => {
|
|
667
|
+
if (e.viewport && e.isPositioned) {
|
|
668
|
+
let r = function() {
|
|
669
|
+
const f = c.scrollTop > 0;
|
|
670
|
+
d(f);
|
|
671
|
+
};
|
|
672
|
+
const c = e.viewport;
|
|
673
|
+
return r(), c.addEventListener("scroll", r), () => c.removeEventListener("scroll", r);
|
|
674
|
+
}
|
|
675
|
+
}, [e.viewport, e.isPositioned]), s ? /* @__PURE__ */ p(
|
|
676
|
+
Qe,
|
|
677
|
+
{
|
|
678
|
+
...o,
|
|
679
|
+
ref: n,
|
|
680
|
+
onAutoScroll: () => {
|
|
681
|
+
const { viewport: r, selectedItem: c } = e;
|
|
682
|
+
r && c && (r.scrollTop = r.scrollTop - c.offsetHeight);
|
|
683
|
+
}
|
|
684
|
+
}
|
|
685
|
+
) : null;
|
|
686
|
+
});
|
|
687
|
+
$e.displayName = Ce;
|
|
688
|
+
var xe = "SelectScrollDownButton", Je = t.forwardRef((o, l) => {
|
|
689
|
+
const e = q(xe, o.__scopeSelect), a = Pe(xe, o.__scopeSelect), [s, d] = t.useState(!1), n = k(l, a.onScrollButtonChange);
|
|
690
|
+
return Y(() => {
|
|
691
|
+
if (e.viewport && e.isPositioned) {
|
|
692
|
+
let r = function() {
|
|
693
|
+
const f = c.scrollHeight - c.clientHeight, g = Math.ceil(c.scrollTop) < f;
|
|
694
|
+
d(g);
|
|
695
|
+
};
|
|
696
|
+
const c = e.viewport;
|
|
697
|
+
return r(), c.addEventListener("scroll", r), () => c.removeEventListener("scroll", r);
|
|
698
|
+
}
|
|
699
|
+
}, [e.viewport, e.isPositioned]), s ? /* @__PURE__ */ p(
|
|
700
|
+
Qe,
|
|
701
|
+
{
|
|
702
|
+
...o,
|
|
703
|
+
ref: n,
|
|
704
|
+
onAutoScroll: () => {
|
|
705
|
+
const { viewport: r, selectedItem: c } = e;
|
|
706
|
+
r && c && (r.scrollTop = r.scrollTop + c.offsetHeight);
|
|
707
|
+
}
|
|
708
|
+
}
|
|
709
|
+
) : null;
|
|
710
|
+
});
|
|
711
|
+
Je.displayName = xe;
|
|
712
|
+
var Qe = t.forwardRef((o, l) => {
|
|
713
|
+
const { __scopeSelect: e, onAutoScroll: a, ...s } = o, d = q("SelectScrollButton", e), n = t.useRef(null), r = de(e), c = t.useCallback(() => {
|
|
714
|
+
n.current !== null && (window.clearInterval(n.current), n.current = null);
|
|
715
|
+
}, []);
|
|
716
|
+
return t.useEffect(() => () => c(), [c]), Y(() => {
|
|
717
|
+
r().find((g) => g.ref.current === document.activeElement)?.ref.current?.scrollIntoView({ block: "nearest" });
|
|
718
|
+
}, [r]), /* @__PURE__ */ p(
|
|
719
|
+
M.div,
|
|
720
|
+
{
|
|
721
|
+
"aria-hidden": !0,
|
|
722
|
+
...s,
|
|
723
|
+
ref: l,
|
|
724
|
+
style: { flexShrink: 0, ...s.style },
|
|
725
|
+
onPointerDown: R(s.onPointerDown, () => {
|
|
726
|
+
n.current === null && (n.current = window.setInterval(a, 50));
|
|
727
|
+
}),
|
|
728
|
+
onPointerMove: R(s.onPointerMove, () => {
|
|
729
|
+
d.onItemLeave?.(), n.current === null && (n.current = window.setInterval(a, 50));
|
|
730
|
+
}),
|
|
731
|
+
onPointerLeave: R(s.onPointerLeave, () => {
|
|
732
|
+
c();
|
|
733
|
+
})
|
|
734
|
+
}
|
|
735
|
+
);
|
|
736
|
+
}), Bt = "SelectSeparator", et = t.forwardRef(
|
|
737
|
+
(o, l) => {
|
|
738
|
+
const { __scopeSelect: e, ...a } = o;
|
|
739
|
+
return /* @__PURE__ */ p(M.div, { "aria-hidden": !0, ...a, ref: l });
|
|
740
|
+
}
|
|
741
|
+
);
|
|
742
|
+
et.displayName = Bt;
|
|
743
|
+
var ye = "SelectArrow", Ht = t.forwardRef(
|
|
744
|
+
(o, l) => {
|
|
745
|
+
const { __scopeSelect: e, ...a } = o, s = ue(e), d = j(ye, e), n = q(ye, e);
|
|
746
|
+
return d.open && n.position === "popper" ? /* @__PURE__ */ p(St, { ...s, ...a, ref: l }) : null;
|
|
747
|
+
}
|
|
748
|
+
);
|
|
749
|
+
Ht.displayName = ye;
|
|
750
|
+
var Ft = "SelectBubbleInput", tt = t.forwardRef(
|
|
751
|
+
({ __scopeSelect: o, value: l, ...e }, a) => {
|
|
752
|
+
const s = t.useRef(null), d = k(a, s), n = Ct(l);
|
|
753
|
+
return t.useEffect(() => {
|
|
754
|
+
const r = s.current;
|
|
755
|
+
if (!r) return;
|
|
756
|
+
const c = window.HTMLSelectElement.prototype, g = Object.getOwnPropertyDescriptor(
|
|
757
|
+
c,
|
|
758
|
+
"value"
|
|
759
|
+
).set;
|
|
760
|
+
if (n !== l && g) {
|
|
761
|
+
const C = new Event("change", { bubbles: !0 });
|
|
762
|
+
g.call(r, l), r.dispatchEvent(C);
|
|
763
|
+
}
|
|
764
|
+
}, [n, l]), /* @__PURE__ */ p(
|
|
765
|
+
M.select,
|
|
766
|
+
{
|
|
767
|
+
...e,
|
|
768
|
+
style: { ...xt, ...e.style },
|
|
769
|
+
ref: d,
|
|
770
|
+
defaultValue: l
|
|
771
|
+
}
|
|
772
|
+
);
|
|
773
|
+
}
|
|
774
|
+
);
|
|
775
|
+
tt.displayName = Ft;
|
|
776
|
+
function ot(o) {
|
|
777
|
+
return o === "" || o === void 0;
|
|
778
|
+
}
|
|
779
|
+
function nt(o) {
|
|
780
|
+
const l = wt(o), e = t.useRef(""), a = t.useRef(0), s = t.useCallback(
|
|
781
|
+
(n) => {
|
|
782
|
+
const r = e.current + n;
|
|
783
|
+
l(r), (function c(f) {
|
|
784
|
+
e.current = f, window.clearTimeout(a.current), f !== "" && (a.current = window.setTimeout(() => c(""), 1e3));
|
|
785
|
+
})(r);
|
|
786
|
+
},
|
|
787
|
+
[l]
|
|
788
|
+
), d = t.useCallback(() => {
|
|
789
|
+
e.current = "", window.clearTimeout(a.current);
|
|
790
|
+
}, []);
|
|
791
|
+
return t.useEffect(() => () => window.clearTimeout(a.current), []), [e, s, d];
|
|
792
|
+
}
|
|
793
|
+
function rt(o, l, e) {
|
|
794
|
+
const s = l.length > 1 && Array.from(l).every((f) => f === l[0]) ? l[0] : l, d = e ? o.indexOf(e) : -1;
|
|
795
|
+
let n = Ut(o, Math.max(d, 0));
|
|
796
|
+
s.length === 1 && (n = n.filter((f) => f !== e));
|
|
797
|
+
const c = n.find(
|
|
798
|
+
(f) => f.textValue.toLowerCase().startsWith(s.toLowerCase())
|
|
799
|
+
);
|
|
800
|
+
return c !== e ? c : void 0;
|
|
801
|
+
}
|
|
802
|
+
function Ut(o, l) {
|
|
803
|
+
return o.map((e, a) => o[(l + a) % o.length]);
|
|
804
|
+
}
|
|
805
|
+
var Qt = Ne, eo = Ae, to = De, oo = Le, no = ke, ro = Ve, so = Ue, co = Ke, lo = ze, ao = je, io = qe, uo = Ze, po = $e, fo = Je, mo = et;
|
|
806
|
+
export {
|
|
807
|
+
ro as C,
|
|
808
|
+
co as G,
|
|
809
|
+
ao as I,
|
|
810
|
+
lo as L,
|
|
811
|
+
no as P,
|
|
812
|
+
Qt as R,
|
|
813
|
+
fo as S,
|
|
814
|
+
eo as T,
|
|
815
|
+
so as V,
|
|
816
|
+
uo as a,
|
|
817
|
+
io as b,
|
|
818
|
+
po as c,
|
|
819
|
+
mo as d,
|
|
820
|
+
oo as e,
|
|
821
|
+
to as f
|
|
822
|
+
};
|