@spear-ai/spectral 1.12.6 → 1.13.1
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 +41 -38
- package/dist/Button.d.ts +1 -1
- package/dist/Button.js +46 -45
- package/dist/Checkbox.js +6 -5
- package/dist/{Combobox-DCCcIDgq.js → Combobox-DRQqx0os.js} +9 -8
- package/dist/Combobox.js +1 -1
- package/dist/ControlGroup/ControlGroupSelect.d.ts +5 -1
- package/dist/ControlGroup/ControlGroupSelect.js +73 -67
- package/dist/ControlGroup.js +29 -24
- package/dist/DateTimePicker/TimePeriodSelect.js +1 -1
- package/dist/DateTimePicker.js +8 -7
- package/dist/DropdownMenu-BO_RPCVU.js +870 -0
- package/dist/DropdownMenu.d.ts +3 -2
- package/dist/DropdownMenu.js +2 -868
- package/dist/FormFieldMessage.d.ts +11 -0
- package/dist/FormFieldMessage.js +55 -0
- package/dist/Input.d.ts +1 -0
- package/dist/Input.js +68 -67
- package/dist/InputNumeric.js +3 -14
- package/dist/{InputOTP-DyhesOLs.js → InputOTP-DLn7ja7J.js} +5 -4
- package/dist/InputOTP.js +1 -1
- package/dist/MultiSelect/MultiSelectBase.js +105 -104
- package/dist/RadioButtonGroup/RadioButtonGroupBase.d.ts +2 -2
- package/dist/{RadioGroup-BsBK247l.js → RadioGroup-D-XjCU4Q.js} +33 -28
- package/dist/RadioGroup.js +1 -1
- package/dist/Select.js +21 -20
- package/dist/{Switch-Vep4hsq4.js → Switch-CSmXtkia.js} +26 -25
- package/dist/Switch.js +1 -1
- package/dist/Textarea/TextareaUtils.js +4 -8
- package/dist/Textarea.js +23 -22
- package/dist/Toggle.js +1 -1
- package/dist/ToggleGroup/ToggleGroup.context.d.ts +9 -0
- package/dist/ToggleGroup/ToggleGroup.context.js +11 -0
- package/dist/ToggleGroup/ToggleGroupItem.d.ts +15 -0
- package/dist/ToggleGroup/ToggleGroupItem.js +35 -0
- package/dist/ToggleGroup/ToggleGroupSplitMenuItem.d.ts +22 -0
- package/dist/ToggleGroup/ToggleGroupSplitMenuItem.js +114 -0
- package/dist/ToggleGroup.d.ts +6 -14
- package/dist/ToggleGroup.js +24 -46
- package/dist/Tooltip.js +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/primitives/select.d.ts +1 -1
- package/dist/primitives/select.d.ts.map +1 -1
- package/dist/primitives/select.js +1 -1
- package/dist/primitives/textarea.js +1 -1
- package/dist/{select-oAOoVl5g.js → select-DFE8xm1L.js} +230 -259
- package/dist/styles/spectral.css +1 -1
- package/dist/utils/formFieldUtils.d.ts +1 -13
- package/dist/utils/formFieldUtils.d.ts.map +1 -1
- package/dist/utils/formFieldUtils.js +48 -69
- package/package.json +1 -1
- /package/dist/{Tooltip-vEdD4f2U.js → Tooltip-CTjKOfvC.js} +0 -0
|
@@ -6,27 +6,26 @@ import { a as r, d as i, i as a, l as o, o as s, r as c, t as l } from "./dist-D
|
|
|
6
6
|
import { n as u, t as d } from "./dist-CcsVPym2.js";
|
|
7
7
|
import { t as f } from "./dist-Br_xj9vz.js";
|
|
8
8
|
import { t as p } from "./twUtils-BpqlKSeB.js";
|
|
9
|
-
import { getDropdownSurfaceClasses as m } from "./utils/formFieldUtils.js";
|
|
10
|
-
import { t as
|
|
11
|
-
import { t as
|
|
12
|
-
import { n as
|
|
13
|
-
import { i as
|
|
14
|
-
import { a as
|
|
15
|
-
import { t as
|
|
16
|
-
import { n as
|
|
17
|
-
import { useAutoDropdownHorizontalShift as
|
|
18
|
-
import * as
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import { Fragment as P, jsx as F, jsxs as I } from "react/jsx-runtime";
|
|
9
|
+
import { getDropdownSurfaceClasses as m, getOptionClasses as h, getTriggerClasses as g } from "./utils/formFieldUtils.js";
|
|
10
|
+
import { t as _ } from "./dist-C6pGYii-.js";
|
|
11
|
+
import { t as v } from "./dist-C4MHwt9g.js";
|
|
12
|
+
import { n as y, t as b } from "./dist-iDaHUF3d.js";
|
|
13
|
+
import { i as x, n as S, r as C, t as w } from "./Combination-MimnVFUU.js";
|
|
14
|
+
import { a as T, i as E, n as D, r as O, t as k } from "./dist-CwYxT5fv.js";
|
|
15
|
+
import { t as A } from "./dist-s1uWaZYZ.js";
|
|
16
|
+
import { n as j } from "./dist-C-2mar4Y.js";
|
|
17
|
+
import { useAutoDropdownHorizontalShift as M } from "./utils/dropdownPositioning.js";
|
|
18
|
+
import * as N from "react";
|
|
19
|
+
import * as P from "react-dom";
|
|
20
|
+
import { Fragment as F, jsx as I, jsxs as L } from "react/jsx-runtime";
|
|
22
21
|
//#region node_modules/.pnpm/@radix-ui+react-select@2.2.6_@types+react-dom@19.2.3_@types+react@19.2.14__@types+react_59e27c923ffee0ae02caa79afc2da7e6/node_modules/@radix-ui/react-select/dist/index.mjs
|
|
23
|
-
var
|
|
22
|
+
var R = [
|
|
24
23
|
" ",
|
|
25
24
|
"Enter",
|
|
26
25
|
"ArrowUp",
|
|
27
26
|
"ArrowDown"
|
|
28
|
-
],
|
|
29
|
-
let { __scopeSelect: t, children: n, open: r, defaultOpen: i, onOpenChange: a, value: o, defaultValue: s, onValueChange: l, dir: u, name: p, autoComplete: m, disabled: h, required: g, form: _ } = e, v = G(t), [y, b] =
|
|
27
|
+
], ee = [" ", "Enter"], z = "Select", [B, V, H] = u(z), [U, W] = i(z, [H, T]), G = T(), [te, K] = U(z), [ne, re] = U(z), ie = (e) => {
|
|
28
|
+
let { __scopeSelect: t, children: n, open: r, defaultOpen: i, onOpenChange: a, value: o, defaultValue: s, onValueChange: l, dir: u, name: p, autoComplete: m, disabled: h, required: g, form: _ } = e, v = G(t), [y, b] = N.useState(null), [x, S] = N.useState(null), [C, w] = N.useState(!1), T = d(u), [D, O] = c({
|
|
30
29
|
prop: r,
|
|
31
30
|
defaultProp: i ?? !1,
|
|
32
31
|
onChange: a,
|
|
@@ -36,10 +35,10 @@ var L = [
|
|
|
36
35
|
defaultProp: s,
|
|
37
36
|
onChange: l,
|
|
38
37
|
caller: z
|
|
39
|
-
}),
|
|
40
|
-
return /* @__PURE__ */
|
|
38
|
+
}), j = N.useRef(null), M = y ? _ || !!y.closest("form") : !0, [P, F] = N.useState(/* @__PURE__ */ new Set()), R = Array.from(P).map((e) => e.props.value).join(";");
|
|
39
|
+
return /* @__PURE__ */ I(E, {
|
|
41
40
|
...v,
|
|
42
|
-
children: /* @__PURE__ */
|
|
41
|
+
children: /* @__PURE__ */ L(te, {
|
|
43
42
|
required: g,
|
|
44
43
|
scope: t,
|
|
45
44
|
trigger: y,
|
|
@@ -47,31 +46,31 @@ var L = [
|
|
|
47
46
|
valueNode: x,
|
|
48
47
|
onValueNodeChange: S,
|
|
49
48
|
valueNodeHasChildren: C,
|
|
50
|
-
onValueNodeHasChildrenChange:
|
|
49
|
+
onValueNodeHasChildrenChange: w,
|
|
51
50
|
contentId: f(),
|
|
52
51
|
value: k,
|
|
53
52
|
onValueChange: A,
|
|
54
53
|
open: D,
|
|
55
54
|
onOpenChange: O,
|
|
56
|
-
dir:
|
|
57
|
-
triggerPointerDownPosRef:
|
|
55
|
+
dir: T,
|
|
56
|
+
triggerPointerDownPosRef: j,
|
|
58
57
|
disabled: h,
|
|
59
|
-
children: [/* @__PURE__ */
|
|
58
|
+
children: [/* @__PURE__ */ I(B.Provider, {
|
|
60
59
|
scope: t,
|
|
61
|
-
children: /* @__PURE__ */
|
|
60
|
+
children: /* @__PURE__ */ I(ne, {
|
|
62
61
|
scope: e.__scopeSelect,
|
|
63
|
-
onNativeOptionAdd:
|
|
64
|
-
|
|
62
|
+
onNativeOptionAdd: N.useCallback((e) => {
|
|
63
|
+
F((t) => new Set(t).add(e));
|
|
65
64
|
}, []),
|
|
66
|
-
onNativeOptionRemove:
|
|
67
|
-
|
|
65
|
+
onNativeOptionRemove: N.useCallback((e) => {
|
|
66
|
+
F((t) => {
|
|
68
67
|
let n = new Set(t);
|
|
69
68
|
return n.delete(e), n;
|
|
70
69
|
});
|
|
71
70
|
}, []),
|
|
72
71
|
children: n
|
|
73
72
|
})
|
|
74
|
-
}),
|
|
73
|
+
}), M ? /* @__PURE__ */ L(Ke, {
|
|
75
74
|
"aria-hidden": !0,
|
|
76
75
|
required: g,
|
|
77
76
|
tabIndex: -1,
|
|
@@ -81,15 +80,15 @@ var L = [
|
|
|
81
80
|
onChange: (e) => A(e.target.value),
|
|
82
81
|
disabled: h,
|
|
83
82
|
form: _,
|
|
84
|
-
children: [k === void 0 ? /* @__PURE__ */
|
|
83
|
+
children: [k === void 0 ? /* @__PURE__ */ I("option", { value: "" }) : null, Array.from(P)]
|
|
85
84
|
}, R) : null]
|
|
86
85
|
})
|
|
87
86
|
});
|
|
88
87
|
};
|
|
89
|
-
|
|
90
|
-
var
|
|
91
|
-
let { __scopeSelect: n, disabled: i = !1, ...a } = e, s = G(n), c = K(
|
|
92
|
-
let t = f().filter((e) => !e.disabled), n =
|
|
88
|
+
ie.displayName = z;
|
|
89
|
+
var q = "SelectTrigger", J = N.forwardRef((e, t) => {
|
|
90
|
+
let { __scopeSelect: n, disabled: i = !1, ...a } = e, s = G(n), c = K(q, n), u = c.disabled || i, d = o(t, c.onTriggerChange), f = V(n), p = N.useRef("touch"), [m, h, g] = Je((e) => {
|
|
91
|
+
let t = f().filter((e) => !e.disabled), n = Ye(t, e, t.find((e) => e.value === c.value));
|
|
93
92
|
n !== void 0 && c.onValueChange(n.value);
|
|
94
93
|
}), _ = (e) => {
|
|
95
94
|
u || (c.onOpenChange(!0), g()), e && (c.triggerPointerDownPosRef.current = {
|
|
@@ -97,10 +96,10 @@ var re = "SelectTrigger", J = j.forwardRef((e, t) => {
|
|
|
97
96
|
y: Math.round(e.pageY)
|
|
98
97
|
});
|
|
99
98
|
};
|
|
100
|
-
return /* @__PURE__ */
|
|
99
|
+
return /* @__PURE__ */ I(k, {
|
|
101
100
|
asChild: !0,
|
|
102
101
|
...s,
|
|
103
|
-
children: /* @__PURE__ */
|
|
102
|
+
children: /* @__PURE__ */ I(l.button, {
|
|
104
103
|
type: "button",
|
|
105
104
|
role: "combobox",
|
|
106
105
|
"aria-controls": c.contentId,
|
|
@@ -111,7 +110,7 @@ var re = "SelectTrigger", J = j.forwardRef((e, t) => {
|
|
|
111
110
|
"data-state": c.open ? "open" : "closed",
|
|
112
111
|
disabled: u,
|
|
113
112
|
"data-disabled": u ? "" : void 0,
|
|
114
|
-
"data-placeholder":
|
|
113
|
+
"data-placeholder": qe(c.value) ? "" : void 0,
|
|
115
114
|
...a,
|
|
116
115
|
ref: d,
|
|
117
116
|
onClick: r(a.onClick, (e) => {
|
|
@@ -124,90 +123,90 @@ var re = "SelectTrigger", J = j.forwardRef((e, t) => {
|
|
|
124
123
|
}),
|
|
125
124
|
onKeyDown: r(a.onKeyDown, (e) => {
|
|
126
125
|
let t = m.current !== "";
|
|
127
|
-
!(e.ctrlKey || e.altKey || e.metaKey) && e.key.length === 1 && h(e.key), !(t && e.key === " ") &&
|
|
126
|
+
!(e.ctrlKey || e.altKey || e.metaKey) && e.key.length === 1 && h(e.key), !(t && e.key === " ") && R.includes(e.key) && (_(), e.preventDefault());
|
|
128
127
|
})
|
|
129
128
|
})
|
|
130
129
|
});
|
|
131
130
|
});
|
|
132
|
-
J.displayName =
|
|
133
|
-
var
|
|
134
|
-
let { __scopeSelect: n, className: r, style: i, children: s, placeholder: c = "", ...u } = e, d = K(
|
|
131
|
+
J.displayName = q;
|
|
132
|
+
var ae = "SelectValue", oe = N.forwardRef((e, t) => {
|
|
133
|
+
let { __scopeSelect: n, className: r, style: i, children: s, placeholder: c = "", ...u } = e, d = K(ae, n), { onValueNodeHasChildrenChange: f } = d, p = s !== void 0, m = o(t, d.onValueNodeChange);
|
|
135
134
|
return a(() => {
|
|
136
135
|
f(p);
|
|
137
|
-
}, [f, p]), /* @__PURE__ */
|
|
136
|
+
}, [f, p]), /* @__PURE__ */ I(l.span, {
|
|
138
137
|
...u,
|
|
139
138
|
ref: m,
|
|
140
139
|
style: { pointerEvents: "none" },
|
|
141
|
-
children:
|
|
140
|
+
children: qe(d.value) ? /* @__PURE__ */ I(F, { children: c }) : s
|
|
142
141
|
});
|
|
143
142
|
});
|
|
144
|
-
|
|
145
|
-
var
|
|
143
|
+
oe.displayName = ae;
|
|
144
|
+
var se = "SelectIcon", ce = N.forwardRef((e, t) => {
|
|
146
145
|
let { __scopeSelect: n, children: r, ...i } = e;
|
|
147
|
-
return /* @__PURE__ */
|
|
146
|
+
return /* @__PURE__ */ I(l.span, {
|
|
148
147
|
"aria-hidden": !0,
|
|
149
148
|
...i,
|
|
150
149
|
ref: t,
|
|
151
150
|
children: r || "▼"
|
|
152
151
|
});
|
|
153
152
|
});
|
|
154
|
-
|
|
155
|
-
var
|
|
153
|
+
ce.displayName = se;
|
|
154
|
+
var le = "SelectPortal", ue = (e) => /* @__PURE__ */ I(b, {
|
|
156
155
|
asChild: !0,
|
|
157
156
|
...e
|
|
158
157
|
});
|
|
159
|
-
|
|
160
|
-
var Y = "SelectContent",
|
|
161
|
-
let n = K(Y, e.__scopeSelect), [r, i] =
|
|
158
|
+
ue.displayName = le;
|
|
159
|
+
var Y = "SelectContent", de = N.forwardRef((e, t) => {
|
|
160
|
+
let n = K(Y, e.__scopeSelect), [r, i] = N.useState();
|
|
162
161
|
if (a(() => {
|
|
163
162
|
i(new DocumentFragment());
|
|
164
163
|
}, []), !n.open) {
|
|
165
164
|
let t = r;
|
|
166
|
-
return t ?
|
|
165
|
+
return t ? P.createPortal(/* @__PURE__ */ I(fe, {
|
|
167
166
|
scope: e.__scopeSelect,
|
|
168
|
-
children: /* @__PURE__ */
|
|
167
|
+
children: /* @__PURE__ */ I(B.Slot, {
|
|
169
168
|
scope: e.__scopeSelect,
|
|
170
|
-
children: /* @__PURE__ */
|
|
169
|
+
children: /* @__PURE__ */ I("div", { children: e.children })
|
|
171
170
|
})
|
|
172
171
|
}), t) : null;
|
|
173
172
|
}
|
|
174
|
-
return /* @__PURE__ */
|
|
173
|
+
return /* @__PURE__ */ I(he, {
|
|
175
174
|
...e,
|
|
176
175
|
ref: t
|
|
177
176
|
});
|
|
178
177
|
});
|
|
179
|
-
|
|
180
|
-
var X = 10, [
|
|
181
|
-
let { __scopeSelect: n, position: i = "item-aligned", onCloseAutoFocus: a, onEscapeKeyDown: s, onPointerDownOutside: c, side: l, sideOffset: u, align: d, alignOffset: f, arrowPadding: p, collisionBoundary: m, collisionPadding: h, sticky: g, hideWhenDetached:
|
|
182
|
-
|
|
183
|
-
if (E) return
|
|
184
|
-
}, [E]),
|
|
185
|
-
let
|
|
178
|
+
de.displayName = Y;
|
|
179
|
+
var X = 10, [fe, Z] = U(Y), pe = "SelectContentImpl", me = s("SelectContent.RemoveScroll"), he = N.forwardRef((e, t) => {
|
|
180
|
+
let { __scopeSelect: n, position: i = "item-aligned", onCloseAutoFocus: a, onEscapeKeyDown: s, onPointerDownOutside: c, side: l, sideOffset: u, align: d, alignOffset: f, arrowPadding: p, collisionBoundary: m, collisionPadding: h, sticky: g, hideWhenDetached: _, avoidCollisions: v, ...b } = e, T = K(Y, n), [E, D] = N.useState(null), [O, k] = N.useState(null), A = o(t, (e) => D(e)), [j, M] = N.useState(null), [P, F] = N.useState(null), L = V(n), [R, ee] = N.useState(!1), z = N.useRef(!1);
|
|
181
|
+
N.useEffect(() => {
|
|
182
|
+
if (E) return S(E);
|
|
183
|
+
}, [E]), x();
|
|
184
|
+
let B = N.useCallback((e) => {
|
|
186
185
|
let [t, ...n] = L().map((e) => e.ref.current), [r] = n.slice(-1), i = document.activeElement;
|
|
187
186
|
for (let n of e) if (n === i || (n?.scrollIntoView({ block: "nearest" }), n === t && O && (O.scrollTop = 0), n === r && O && (O.scrollTop = O.scrollHeight), n?.focus(), document.activeElement !== i)) return;
|
|
188
|
-
}, [L, O]),
|
|
189
|
-
|
|
190
|
-
|
|
187
|
+
}, [L, O]), H = N.useCallback(() => B([j, E]), [
|
|
188
|
+
B,
|
|
189
|
+
j,
|
|
191
190
|
E
|
|
192
191
|
]);
|
|
193
|
-
|
|
194
|
-
R &&
|
|
195
|
-
}, [R,
|
|
196
|
-
let { onOpenChange:
|
|
197
|
-
|
|
192
|
+
N.useEffect(() => {
|
|
193
|
+
R && H();
|
|
194
|
+
}, [R, H]);
|
|
195
|
+
let { onOpenChange: U, triggerPointerDownPosRef: W } = T;
|
|
196
|
+
N.useEffect(() => {
|
|
198
197
|
if (E) {
|
|
199
198
|
let e = {
|
|
200
199
|
x: 0,
|
|
201
200
|
y: 0
|
|
202
201
|
}, t = (t) => {
|
|
203
202
|
e = {
|
|
204
|
-
x: Math.abs(Math.round(t.pageX) - (
|
|
205
|
-
y: Math.abs(Math.round(t.pageY) - (
|
|
203
|
+
x: Math.abs(Math.round(t.pageX) - (W.current?.x ?? 0)),
|
|
204
|
+
y: Math.abs(Math.round(t.pageY) - (W.current?.y ?? 0))
|
|
206
205
|
};
|
|
207
206
|
}, n = (n) => {
|
|
208
|
-
e.x <= 10 && e.y <= 10 ? n.preventDefault() : E.contains(n.target) ||
|
|
207
|
+
e.x <= 10 && e.y <= 10 ? n.preventDefault() : E.contains(n.target) || U(!1), document.removeEventListener("pointermove", t), W.current = null;
|
|
209
208
|
};
|
|
210
|
-
return
|
|
209
|
+
return W.current !== null && (document.addEventListener("pointermove", t), document.addEventListener("pointerup", n, {
|
|
211
210
|
capture: !0,
|
|
212
211
|
once: !0
|
|
213
212
|
})), () => {
|
|
@@ -216,24 +215,24 @@ var X = 10, [de, Z] = U(Y), fe = "SelectContentImpl", pe = s("SelectContent.Remo
|
|
|
216
215
|
}
|
|
217
216
|
}, [
|
|
218
217
|
E,
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
]),
|
|
222
|
-
let e = () =>
|
|
218
|
+
U,
|
|
219
|
+
W
|
|
220
|
+
]), N.useEffect(() => {
|
|
221
|
+
let e = () => U(!1);
|
|
223
222
|
return window.addEventListener("blur", e), window.addEventListener("resize", e), () => {
|
|
224
223
|
window.removeEventListener("blur", e), window.removeEventListener("resize", e);
|
|
225
224
|
};
|
|
226
|
-
}, [
|
|
227
|
-
let [
|
|
228
|
-
let t = L().filter((e) => !e.disabled), n =
|
|
225
|
+
}, [U]);
|
|
226
|
+
let [G, te] = Je((e) => {
|
|
227
|
+
let t = L().filter((e) => !e.disabled), n = Ye(t, e, t.find((e) => e.ref.current === document.activeElement));
|
|
229
228
|
n && setTimeout(() => n.ref.current.focus());
|
|
230
|
-
}), ne =
|
|
231
|
-
let r = !
|
|
232
|
-
(T.value !== void 0 && T.value === t || r) && (
|
|
233
|
-
}, [T.value]),
|
|
234
|
-
let r = !
|
|
235
|
-
(T.value !== void 0 && T.value === t || r) &&
|
|
236
|
-
}, [T.value]),
|
|
229
|
+
}), ne = N.useCallback((e, t, n) => {
|
|
230
|
+
let r = !z.current && !n;
|
|
231
|
+
(T.value !== void 0 && T.value === t || r) && (M(e), r && (z.current = !0));
|
|
232
|
+
}, [T.value]), re = N.useCallback(() => E?.focus(), [E]), ie = N.useCallback((e, t, n) => {
|
|
233
|
+
let r = !z.current && !n;
|
|
234
|
+
(T.value !== void 0 && T.value === t || r) && F(e);
|
|
235
|
+
}, [T.value]), q = i === "popper" ? ye : _e, J = q === ye ? {
|
|
237
236
|
side: l,
|
|
238
237
|
sideOffset: u,
|
|
239
238
|
align: d,
|
|
@@ -242,27 +241,27 @@ var X = 10, [de, Z] = U(Y), fe = "SelectContentImpl", pe = s("SelectContent.Remo
|
|
|
242
241
|
collisionBoundary: m,
|
|
243
242
|
collisionPadding: h,
|
|
244
243
|
sticky: g,
|
|
245
|
-
hideWhenDetached:
|
|
246
|
-
avoidCollisions:
|
|
244
|
+
hideWhenDetached: _,
|
|
245
|
+
avoidCollisions: v
|
|
247
246
|
} : {};
|
|
248
|
-
return /* @__PURE__ */
|
|
247
|
+
return /* @__PURE__ */ I(fe, {
|
|
249
248
|
scope: n,
|
|
250
249
|
content: E,
|
|
251
250
|
viewport: O,
|
|
252
251
|
onViewportChange: k,
|
|
253
252
|
itemRefCallback: ne,
|
|
254
|
-
selectedItem:
|
|
255
|
-
onItemLeave:
|
|
256
|
-
itemTextRefCallback:
|
|
257
|
-
focusSelectedItem:
|
|
253
|
+
selectedItem: j,
|
|
254
|
+
onItemLeave: re,
|
|
255
|
+
itemTextRefCallback: ie,
|
|
256
|
+
focusSelectedItem: H,
|
|
258
257
|
selectedItemText: P,
|
|
259
258
|
position: i,
|
|
260
259
|
isPositioned: R,
|
|
261
|
-
searchRef:
|
|
262
|
-
children: /* @__PURE__ */
|
|
263
|
-
as:
|
|
260
|
+
searchRef: G,
|
|
261
|
+
children: /* @__PURE__ */ I(w, {
|
|
262
|
+
as: me,
|
|
264
263
|
allowPinchZoom: !0,
|
|
265
|
-
children: /* @__PURE__ */
|
|
264
|
+
children: /* @__PURE__ */ I(C, {
|
|
266
265
|
asChild: !0,
|
|
267
266
|
trapped: T.open,
|
|
268
267
|
onMountAutoFocus: (e) => {
|
|
@@ -271,30 +270,30 @@ var X = 10, [de, Z] = U(Y), fe = "SelectContentImpl", pe = s("SelectContent.Remo
|
|
|
271
270
|
onUnmountAutoFocus: r(a, (e) => {
|
|
272
271
|
T.trigger?.focus({ preventScroll: !0 }), e.preventDefault();
|
|
273
272
|
}),
|
|
274
|
-
children: /* @__PURE__ */
|
|
273
|
+
children: /* @__PURE__ */ I(y, {
|
|
275
274
|
asChild: !0,
|
|
276
275
|
disableOutsidePointerEvents: !0,
|
|
277
276
|
onEscapeKeyDown: s,
|
|
278
277
|
onPointerDownOutside: c,
|
|
279
278
|
onFocusOutside: (e) => e.preventDefault(),
|
|
280
279
|
onDismiss: () => T.onOpenChange(!1),
|
|
281
|
-
children: /* @__PURE__ */
|
|
280
|
+
children: /* @__PURE__ */ I(q, {
|
|
282
281
|
role: "listbox",
|
|
283
282
|
id: T.contentId,
|
|
284
283
|
"data-state": T.open ? "open" : "closed",
|
|
285
284
|
dir: T.dir,
|
|
286
285
|
onContextMenu: (e) => e.preventDefault(),
|
|
287
|
-
...
|
|
288
|
-
...
|
|
289
|
-
onPlaced: () =>
|
|
286
|
+
...b,
|
|
287
|
+
...J,
|
|
288
|
+
onPlaced: () => ee(!0),
|
|
290
289
|
ref: A,
|
|
291
290
|
style: {
|
|
292
291
|
display: "flex",
|
|
293
292
|
flexDirection: "column",
|
|
294
293
|
outline: "none",
|
|
295
|
-
...
|
|
294
|
+
...b.style
|
|
296
295
|
},
|
|
297
|
-
onKeyDown: r(
|
|
296
|
+
onKeyDown: r(b.onKeyDown, (e) => {
|
|
298
297
|
let t = e.ctrlKey || e.altKey || e.metaKey;
|
|
299
298
|
if (e.key === "Tab" && e.preventDefault(), !t && e.key.length === 1 && te(e.key), [
|
|
300
299
|
"ArrowUp",
|
|
@@ -307,7 +306,7 @@ var X = 10, [de, Z] = U(Y), fe = "SelectContentImpl", pe = s("SelectContent.Remo
|
|
|
307
306
|
let n = e.target, r = t.indexOf(n);
|
|
308
307
|
t = t.slice(r + 1);
|
|
309
308
|
}
|
|
310
|
-
setTimeout(() =>
|
|
309
|
+
setTimeout(() => B(t)), e.preventDefault();
|
|
311
310
|
}
|
|
312
311
|
})
|
|
313
312
|
})
|
|
@@ -316,19 +315,19 @@ var X = 10, [de, Z] = U(Y), fe = "SelectContentImpl", pe = s("SelectContent.Remo
|
|
|
316
315
|
})
|
|
317
316
|
});
|
|
318
317
|
});
|
|
319
|
-
|
|
320
|
-
var
|
|
321
|
-
let { __scopeSelect: n, onPlaced: r, ...i } = e, s = K(Y, n), c = Z(Y, n), [u, d] =
|
|
318
|
+
he.displayName = pe;
|
|
319
|
+
var ge = "SelectItemAlignedPosition", _e = N.forwardRef((e, t) => {
|
|
320
|
+
let { __scopeSelect: n, onPlaced: r, ...i } = e, s = K(Y, n), c = Z(Y, n), [u, d] = N.useState(null), [f, p] = N.useState(null), m = o(t, (e) => p(e)), h = V(n), g = N.useRef(!1), v = N.useRef(!0), { viewport: y, selectedItem: b, selectedItemText: x, focusSelectedItem: S } = c, C = N.useCallback(() => {
|
|
322
321
|
if (s.trigger && s.valueNode && u && f && y && b && x) {
|
|
323
322
|
let e = s.trigger.getBoundingClientRect(), t = f.getBoundingClientRect(), n = s.valueNode.getBoundingClientRect(), i = x.getBoundingClientRect();
|
|
324
323
|
if (s.dir !== "rtl") {
|
|
325
|
-
let r = i.left - t.left, a = n.left - r, o = e.left - a, s = e.width + o, c = Math.max(s, t.width), l = window.innerWidth - X, d =
|
|
324
|
+
let r = i.left - t.left, a = n.left - r, o = e.left - a, s = e.width + o, c = Math.max(s, t.width), l = window.innerWidth - X, d = _(a, [X, Math.max(X, l - c)]);
|
|
326
325
|
u.style.minWidth = s + "px", u.style.left = d + "px";
|
|
327
326
|
} else {
|
|
328
|
-
let r = t.right - i.right, a = window.innerWidth - n.right - r, o = window.innerWidth - e.right - a, s = e.width + o, c = Math.max(s, t.width), l = window.innerWidth - X, d =
|
|
327
|
+
let r = t.right - i.right, a = window.innerWidth - n.right - r, o = window.innerWidth - e.right - a, s = e.width + o, c = Math.max(s, t.width), l = window.innerWidth - X, d = _(a, [X, Math.max(X, l - c)]);
|
|
329
328
|
u.style.minWidth = s + "px", u.style.right = d + "px";
|
|
330
329
|
}
|
|
331
|
-
let a =
|
|
330
|
+
let a = h(), o = window.innerHeight - X * 2, c = y.scrollHeight, l = window.getComputedStyle(f), d = parseInt(l.borderTopWidth, 10), p = parseInt(l.paddingTop, 10), m = parseInt(l.borderBottomWidth, 10), v = parseInt(l.paddingBottom, 10), S = d + p + c + v + m, C = Math.min(b.offsetHeight * 5, S), w = window.getComputedStyle(y), T = parseInt(w.paddingTop, 10), E = parseInt(w.paddingBottom, 10), D = e.top + e.height / 2 - X, O = o - D, k = b.offsetHeight / 2, A = b.offsetTop + k, j = d + p + A, M = S - j;
|
|
332
331
|
if (j <= D) {
|
|
333
332
|
let e = a.length > 0 && b === a[a.length - 1].ref.current;
|
|
334
333
|
u.style.bottom = "0px";
|
|
@@ -340,10 +339,10 @@ var he = "SelectItemAlignedPosition", ge = j.forwardRef((e, t) => {
|
|
|
340
339
|
let t = Math.max(D, d + y.offsetTop + (e ? T : 0) + k) + M;
|
|
341
340
|
u.style.height = t + "px", y.scrollTop = j - D + y.offsetTop;
|
|
342
341
|
}
|
|
343
|
-
u.style.margin = `${X}px 0`, u.style.minHeight = C + "px", u.style.maxHeight = o + "px", r?.(), requestAnimationFrame(() =>
|
|
342
|
+
u.style.margin = `${X}px 0`, u.style.minHeight = C + "px", u.style.maxHeight = o + "px", r?.(), requestAnimationFrame(() => g.current = !0);
|
|
344
343
|
}
|
|
345
344
|
}, [
|
|
346
|
-
|
|
345
|
+
h,
|
|
347
346
|
s.trigger,
|
|
348
347
|
s.valueNode,
|
|
349
348
|
u,
|
|
@@ -355,17 +354,17 @@ var he = "SelectItemAlignedPosition", ge = j.forwardRef((e, t) => {
|
|
|
355
354
|
r
|
|
356
355
|
]);
|
|
357
356
|
a(() => C(), [C]);
|
|
358
|
-
let [w, T] =
|
|
357
|
+
let [w, T] = N.useState();
|
|
359
358
|
return a(() => {
|
|
360
359
|
f && T(window.getComputedStyle(f).zIndex);
|
|
361
|
-
}, [f]), /* @__PURE__ */
|
|
360
|
+
}, [f]), /* @__PURE__ */ I(be, {
|
|
362
361
|
scope: n,
|
|
363
362
|
contentWrapper: u,
|
|
364
|
-
shouldExpandOnScrollRef:
|
|
365
|
-
onScrollButtonChange:
|
|
363
|
+
shouldExpandOnScrollRef: g,
|
|
364
|
+
onScrollButtonChange: N.useCallback((e) => {
|
|
366
365
|
e && v.current === !0 && (C(), S?.(), v.current = !1);
|
|
367
366
|
}, [C, S]),
|
|
368
|
-
children: /* @__PURE__ */
|
|
367
|
+
children: /* @__PURE__ */ I("div", {
|
|
369
368
|
ref: d,
|
|
370
369
|
style: {
|
|
371
370
|
display: "flex",
|
|
@@ -373,7 +372,7 @@ var he = "SelectItemAlignedPosition", ge = j.forwardRef((e, t) => {
|
|
|
373
372
|
position: "fixed",
|
|
374
373
|
zIndex: w
|
|
375
374
|
},
|
|
376
|
-
children: /* @__PURE__ */
|
|
375
|
+
children: /* @__PURE__ */ I(l.div, {
|
|
377
376
|
...i,
|
|
378
377
|
ref: m,
|
|
379
378
|
style: {
|
|
@@ -385,10 +384,10 @@ var he = "SelectItemAlignedPosition", ge = j.forwardRef((e, t) => {
|
|
|
385
384
|
})
|
|
386
385
|
});
|
|
387
386
|
});
|
|
388
|
-
|
|
389
|
-
var
|
|
387
|
+
_e.displayName = ge;
|
|
388
|
+
var ve = "SelectPopperPosition", ye = N.forwardRef((e, t) => {
|
|
390
389
|
let { __scopeSelect: n, align: r = "start", collisionPadding: i = X, ...a } = e;
|
|
391
|
-
return /* @__PURE__ */
|
|
390
|
+
return /* @__PURE__ */ I(O, {
|
|
392
391
|
...G(n),
|
|
393
392
|
...a,
|
|
394
393
|
ref: t,
|
|
@@ -405,15 +404,15 @@ var _e = "SelectPopperPosition", ve = j.forwardRef((e, t) => {
|
|
|
405
404
|
}
|
|
406
405
|
});
|
|
407
406
|
});
|
|
408
|
-
|
|
409
|
-
var [
|
|
410
|
-
let { __scopeSelect: n, nonce: i, ...a } = e, s = Z(
|
|
411
|
-
return /* @__PURE__ */
|
|
407
|
+
ye.displayName = ve;
|
|
408
|
+
var [be, xe] = U(Y, {}), Se = "SelectViewport", Ce = N.forwardRef((e, t) => {
|
|
409
|
+
let { __scopeSelect: n, nonce: i, ...a } = e, s = Z(Se, n), c = xe(Se, n), u = o(t, s.onViewportChange), d = N.useRef(0);
|
|
410
|
+
return /* @__PURE__ */ L(F, { children: [/* @__PURE__ */ I("style", {
|
|
412
411
|
dangerouslySetInnerHTML: { __html: "[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}" },
|
|
413
412
|
nonce: i
|
|
414
|
-
}), /* @__PURE__ */
|
|
413
|
+
}), /* @__PURE__ */ I(B.Slot, {
|
|
415
414
|
scope: n,
|
|
416
|
-
children: /* @__PURE__ */
|
|
415
|
+
children: /* @__PURE__ */ I(l.div, {
|
|
417
416
|
"data-radix-select-viewport": "",
|
|
418
417
|
role: "presentation",
|
|
419
418
|
...a,
|
|
@@ -441,13 +440,13 @@ var [ye, be] = U(Y, {}), xe = "SelectViewport", Se = j.forwardRef((e, t) => {
|
|
|
441
440
|
})
|
|
442
441
|
})] });
|
|
443
442
|
});
|
|
444
|
-
|
|
445
|
-
var
|
|
443
|
+
Ce.displayName = Se;
|
|
444
|
+
var we = "SelectGroup", [Te, Ee] = U(we), De = N.forwardRef((e, t) => {
|
|
446
445
|
let { __scopeSelect: n, ...r } = e, i = f();
|
|
447
|
-
return /* @__PURE__ */
|
|
446
|
+
return /* @__PURE__ */ I(Te, {
|
|
448
447
|
scope: n,
|
|
449
448
|
id: i,
|
|
450
|
-
children: /* @__PURE__ */
|
|
449
|
+
children: /* @__PURE__ */ I(l.div, {
|
|
451
450
|
role: "group",
|
|
452
451
|
"aria-labelledby": i,
|
|
453
452
|
...r,
|
|
@@ -455,36 +454,36 @@ var Ce = "SelectGroup", [we, Te] = U(Ce), Ee = j.forwardRef((e, t) => {
|
|
|
455
454
|
})
|
|
456
455
|
});
|
|
457
456
|
});
|
|
458
|
-
|
|
459
|
-
var
|
|
460
|
-
let { __scopeSelect: n, ...r } = e, i =
|
|
461
|
-
return /* @__PURE__ */
|
|
457
|
+
De.displayName = we;
|
|
458
|
+
var Oe = "SelectLabel", ke = N.forwardRef((e, t) => {
|
|
459
|
+
let { __scopeSelect: n, ...r } = e, i = Ee(Oe, n);
|
|
460
|
+
return /* @__PURE__ */ I(l.div, {
|
|
462
461
|
id: i.id,
|
|
463
462
|
...r,
|
|
464
463
|
ref: t
|
|
465
464
|
});
|
|
466
465
|
});
|
|
467
|
-
|
|
468
|
-
var Q = "SelectItem", [
|
|
469
|
-
let { __scopeSelect: n, value: i, disabled: a = !1, textValue: s, ...c } = e, u = K(Q, n), d = Z(Q, n), p = u.value === i, [m, h] =
|
|
466
|
+
ke.displayName = Oe;
|
|
467
|
+
var Q = "SelectItem", [Ae, je] = U(Q), Me = N.forwardRef((e, t) => {
|
|
468
|
+
let { __scopeSelect: n, value: i, disabled: a = !1, textValue: s, ...c } = e, u = K(Q, n), d = Z(Q, n), p = u.value === i, [m, h] = N.useState(s ?? ""), [g, _] = N.useState(!1), v = o(t, (e) => d.itemRefCallback?.(e, i, a)), y = f(), b = N.useRef("touch"), x = () => {
|
|
470
469
|
a || (u.onValueChange(i), u.onOpenChange(!1));
|
|
471
470
|
};
|
|
472
471
|
if (i === "") throw Error("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.");
|
|
473
|
-
return /* @__PURE__ */
|
|
472
|
+
return /* @__PURE__ */ I(Ae, {
|
|
474
473
|
scope: n,
|
|
475
474
|
value: i,
|
|
476
475
|
disabled: a,
|
|
477
476
|
textId: y,
|
|
478
477
|
isSelected: p,
|
|
479
|
-
onItemTextChange:
|
|
478
|
+
onItemTextChange: N.useCallback((e) => {
|
|
480
479
|
h((t) => t || (e?.textContent ?? "").trim());
|
|
481
480
|
}, []),
|
|
482
|
-
children: /* @__PURE__ */
|
|
481
|
+
children: /* @__PURE__ */ I(B.ItemSlot, {
|
|
483
482
|
scope: n,
|
|
484
483
|
value: i,
|
|
485
484
|
disabled: a,
|
|
486
485
|
textValue: m,
|
|
487
|
-
children: /* @__PURE__ */
|
|
486
|
+
children: /* @__PURE__ */ I(l.div, {
|
|
488
487
|
role: "option",
|
|
489
488
|
"aria-labelledby": y,
|
|
490
489
|
"data-highlighted": g ? "" : void 0,
|
|
@@ -513,15 +512,15 @@ var Q = "SelectItem", [ke, Ae] = U(Q), je = j.forwardRef((e, t) => {
|
|
|
513
512
|
e.currentTarget === document.activeElement && d.onItemLeave?.();
|
|
514
513
|
}),
|
|
515
514
|
onKeyDown: r(c.onKeyDown, (e) => {
|
|
516
|
-
d.searchRef?.current !== "" && e.key === " " || (
|
|
515
|
+
d.searchRef?.current !== "" && e.key === " " || (ee.includes(e.key) && x(), e.key === " " && e.preventDefault());
|
|
517
516
|
})
|
|
518
517
|
})
|
|
519
518
|
})
|
|
520
519
|
});
|
|
521
520
|
});
|
|
522
|
-
|
|
523
|
-
var $ = "SelectItemText",
|
|
524
|
-
let { __scopeSelect: n, className: r, style: i, ...s } = e, c = K($, n), u = Z($, n), d =
|
|
521
|
+
Me.displayName = Q;
|
|
522
|
+
var $ = "SelectItemText", Ne = N.forwardRef((e, t) => {
|
|
523
|
+
let { __scopeSelect: n, className: r, style: i, ...s } = e, c = K($, n), u = Z($, n), d = je($, n), f = re($, n), [p, m] = N.useState(null), h = o(t, (e) => m(e), d.onItemTextChange, (e) => u.itemTextRefCallback?.(e, d.value, d.disabled)), g = p?.textContent, _ = N.useMemo(() => /* @__PURE__ */ I("option", {
|
|
525
524
|
value: d.value,
|
|
526
525
|
disabled: d.disabled,
|
|
527
526
|
children: g
|
|
@@ -534,24 +533,24 @@ var $ = "SelectItemText", Me = j.forwardRef((e, t) => {
|
|
|
534
533
|
v,
|
|
535
534
|
y,
|
|
536
535
|
_
|
|
537
|
-
]), /* @__PURE__ */
|
|
536
|
+
]), /* @__PURE__ */ L(F, { children: [/* @__PURE__ */ I(l.span, {
|
|
538
537
|
id: d.textId,
|
|
539
538
|
...s,
|
|
540
539
|
ref: h
|
|
541
|
-
}), d.isSelected && c.valueNode && !c.valueNodeHasChildren ?
|
|
540
|
+
}), d.isSelected && c.valueNode && !c.valueNodeHasChildren ? P.createPortal(s.children, c.valueNode) : null] });
|
|
542
541
|
});
|
|
543
|
-
|
|
544
|
-
var
|
|
542
|
+
Ne.displayName = $;
|
|
543
|
+
var Pe = "SelectItemIndicator", Fe = N.forwardRef((e, t) => {
|
|
545
544
|
let { __scopeSelect: n, ...r } = e;
|
|
546
|
-
return
|
|
545
|
+
return je(Pe, n).isSelected ? /* @__PURE__ */ I(l.span, {
|
|
547
546
|
"aria-hidden": !0,
|
|
548
547
|
...r,
|
|
549
548
|
ref: t
|
|
550
549
|
}) : null;
|
|
551
550
|
});
|
|
552
|
-
|
|
553
|
-
var
|
|
554
|
-
let n = Z(
|
|
551
|
+
Fe.displayName = Pe;
|
|
552
|
+
var Ie = "SelectScrollUpButton", Le = N.forwardRef((e, t) => {
|
|
553
|
+
let n = Z(Ie, e.__scopeSelect), r = xe(Ie, e.__scopeSelect), [i, s] = N.useState(!1), c = o(t, r.onScrollButtonChange);
|
|
555
554
|
return a(() => {
|
|
556
555
|
if (n.viewport && n.isPositioned) {
|
|
557
556
|
let e = function() {
|
|
@@ -559,7 +558,7 @@ var Fe = "SelectScrollUpButton", Ie = j.forwardRef((e, t) => {
|
|
|
559
558
|
}, t = n.viewport;
|
|
560
559
|
return e(), t.addEventListener("scroll", e), () => t.removeEventListener("scroll", e);
|
|
561
560
|
}
|
|
562
|
-
}, [n.viewport, n.isPositioned]), i ? /* @__PURE__ */
|
|
561
|
+
}, [n.viewport, n.isPositioned]), i ? /* @__PURE__ */ I(Be, {
|
|
563
562
|
...e,
|
|
564
563
|
ref: c,
|
|
565
564
|
onAutoScroll: () => {
|
|
@@ -568,9 +567,9 @@ var Fe = "SelectScrollUpButton", Ie = j.forwardRef((e, t) => {
|
|
|
568
567
|
}
|
|
569
568
|
}) : null;
|
|
570
569
|
});
|
|
571
|
-
|
|
572
|
-
var
|
|
573
|
-
let n = Z(
|
|
570
|
+
Le.displayName = Ie;
|
|
571
|
+
var Re = "SelectScrollDownButton", ze = N.forwardRef((e, t) => {
|
|
572
|
+
let n = Z(Re, e.__scopeSelect), r = xe(Re, e.__scopeSelect), [i, s] = N.useState(!1), c = o(t, r.onScrollButtonChange);
|
|
574
573
|
return a(() => {
|
|
575
574
|
if (n.viewport && n.isPositioned) {
|
|
576
575
|
let e = function() {
|
|
@@ -579,7 +578,7 @@ var Le = "SelectScrollDownButton", Re = j.forwardRef((e, t) => {
|
|
|
579
578
|
}, t = n.viewport;
|
|
580
579
|
return e(), t.addEventListener("scroll", e), () => t.removeEventListener("scroll", e);
|
|
581
580
|
}
|
|
582
|
-
}, [n.viewport, n.isPositioned]), i ? /* @__PURE__ */
|
|
581
|
+
}, [n.viewport, n.isPositioned]), i ? /* @__PURE__ */ I(Be, {
|
|
583
582
|
...e,
|
|
584
583
|
ref: c,
|
|
585
584
|
onAutoScroll: () => {
|
|
@@ -588,14 +587,14 @@ var Le = "SelectScrollDownButton", Re = j.forwardRef((e, t) => {
|
|
|
588
587
|
}
|
|
589
588
|
}) : null;
|
|
590
589
|
});
|
|
591
|
-
|
|
592
|
-
var
|
|
593
|
-
let { __scopeSelect: n, onAutoScroll: i, ...o } = e, s = Z("SelectScrollButton", n), c =
|
|
590
|
+
ze.displayName = Re;
|
|
591
|
+
var Be = N.forwardRef((e, t) => {
|
|
592
|
+
let { __scopeSelect: n, onAutoScroll: i, ...o } = e, s = Z("SelectScrollButton", n), c = N.useRef(null), u = V(n), d = N.useCallback(() => {
|
|
594
593
|
c.current !== null && (window.clearInterval(c.current), c.current = null);
|
|
595
594
|
}, []);
|
|
596
|
-
return
|
|
595
|
+
return N.useEffect(() => () => d(), [d]), a(() => {
|
|
597
596
|
u().find((e) => e.ref.current === document.activeElement)?.ref.current?.scrollIntoView({ block: "nearest" });
|
|
598
|
-
}, [u]), /* @__PURE__ */
|
|
597
|
+
}, [u]), /* @__PURE__ */ I(l.div, {
|
|
599
598
|
"aria-hidden": !0,
|
|
600
599
|
...o,
|
|
601
600
|
ref: t,
|
|
@@ -613,27 +612,27 @@ var ze = j.forwardRef((e, t) => {
|
|
|
613
612
|
d();
|
|
614
613
|
})
|
|
615
614
|
});
|
|
616
|
-
}),
|
|
615
|
+
}), Ve = "SelectSeparator", He = N.forwardRef((e, t) => {
|
|
617
616
|
let { __scopeSelect: n, ...r } = e;
|
|
618
|
-
return /* @__PURE__ */
|
|
617
|
+
return /* @__PURE__ */ I(l.div, {
|
|
619
618
|
"aria-hidden": !0,
|
|
620
619
|
...r,
|
|
621
620
|
ref: t
|
|
622
621
|
});
|
|
623
622
|
});
|
|
624
|
-
|
|
625
|
-
var
|
|
626
|
-
let { __scopeSelect: n, ...r } = e, i = G(n), a = K(
|
|
627
|
-
return a.open && o.position === "popper" ? /* @__PURE__ */
|
|
623
|
+
He.displayName = Ve;
|
|
624
|
+
var Ue = "SelectArrow", We = N.forwardRef((e, t) => {
|
|
625
|
+
let { __scopeSelect: n, ...r } = e, i = G(n), a = K(Ue, n), o = Z(Ue, n);
|
|
626
|
+
return a.open && o.position === "popper" ? /* @__PURE__ */ I(D, {
|
|
628
627
|
...i,
|
|
629
628
|
...r,
|
|
630
629
|
ref: t
|
|
631
630
|
}) : null;
|
|
632
631
|
});
|
|
633
|
-
|
|
634
|
-
var
|
|
635
|
-
let i =
|
|
636
|
-
return
|
|
632
|
+
We.displayName = Ue;
|
|
633
|
+
var Ge = "SelectBubbleInput", Ke = N.forwardRef(({ __scopeSelect: e, value: t, ...n }, r) => {
|
|
634
|
+
let i = N.useRef(null), a = o(r, i), s = A(t);
|
|
635
|
+
return N.useEffect(() => {
|
|
637
636
|
let e = i.current;
|
|
638
637
|
if (!e) return;
|
|
639
638
|
let n = window.HTMLSelectElement.prototype, r = Object.getOwnPropertyDescriptor(n, "value").set;
|
|
@@ -641,157 +640,129 @@ var We = "SelectBubbleInput", Ge = j.forwardRef(({ __scopeSelect: e, value: t, .
|
|
|
641
640
|
let n = new Event("change", { bubbles: !0 });
|
|
642
641
|
r.call(e, t), e.dispatchEvent(n);
|
|
643
642
|
}
|
|
644
|
-
}, [s, t]), /* @__PURE__ */
|
|
643
|
+
}, [s, t]), /* @__PURE__ */ I(l.select, {
|
|
645
644
|
...n,
|
|
646
645
|
style: {
|
|
647
|
-
...
|
|
646
|
+
...j,
|
|
648
647
|
...n.style
|
|
649
648
|
},
|
|
650
649
|
ref: a,
|
|
651
650
|
defaultValue: t
|
|
652
651
|
});
|
|
653
652
|
});
|
|
654
|
-
|
|
655
|
-
function
|
|
653
|
+
Ke.displayName = Ge;
|
|
654
|
+
function qe(e) {
|
|
656
655
|
return e === "" || e === void 0;
|
|
657
656
|
}
|
|
658
|
-
function
|
|
659
|
-
let t =
|
|
657
|
+
function Je(e) {
|
|
658
|
+
let t = v(e), n = N.useRef(""), r = N.useRef(0), i = N.useCallback((e) => {
|
|
660
659
|
let i = n.current + e;
|
|
661
660
|
t(i), (function e(t) {
|
|
662
661
|
n.current = t, window.clearTimeout(r.current), t !== "" && (r.current = window.setTimeout(() => e(""), 1e3));
|
|
663
662
|
})(i);
|
|
664
|
-
}, [t]), a =
|
|
663
|
+
}, [t]), a = N.useCallback(() => {
|
|
665
664
|
n.current = "", window.clearTimeout(r.current);
|
|
666
665
|
}, []);
|
|
667
|
-
return
|
|
666
|
+
return N.useEffect(() => () => window.clearTimeout(r.current), []), [
|
|
668
667
|
n,
|
|
669
668
|
i,
|
|
670
669
|
a
|
|
671
670
|
];
|
|
672
671
|
}
|
|
673
|
-
function
|
|
674
|
-
let r = t.length > 1 && Array.from(t).every((e) => e === t[0]) ? t[0] : t, i = n ? e.indexOf(n) : -1, a =
|
|
672
|
+
function Ye(e, t, n) {
|
|
673
|
+
let r = t.length > 1 && Array.from(t).every((e) => e === t[0]) ? t[0] : t, i = n ? e.indexOf(n) : -1, a = Xe(e, Math.max(i, 0));
|
|
675
674
|
r.length === 1 && (a = a.filter((e) => e !== n));
|
|
676
675
|
let o = a.find((e) => e.textValue.toLowerCase().startsWith(r.toLowerCase()));
|
|
677
676
|
return o === n ? void 0 : o;
|
|
678
677
|
}
|
|
679
|
-
function
|
|
678
|
+
function Xe(e, t) {
|
|
680
679
|
return e.map((n, r) => e[(t + r) % e.length]);
|
|
681
680
|
}
|
|
682
|
-
var
|
|
683
|
-
let t = document.querySelectorAll("[aria-controls]");
|
|
684
|
-
for (let n of t) if (n.getAttribute("aria-controls") === e) return n;
|
|
685
|
-
return null;
|
|
686
|
-
}, pt = (e) => {
|
|
687
|
-
let t = e.id;
|
|
688
|
-
if (!t) return;
|
|
689
|
-
let n = ft(t);
|
|
690
|
-
if (!n) return;
|
|
691
|
-
let r = n.closest("[data-slot=\"dialog-content\"]");
|
|
692
|
-
if (!r) return;
|
|
693
|
-
let i = e.getBoundingClientRect(), a = r.getBoundingClientRect(), o = i.bottom - a.bottom + dt;
|
|
694
|
-
if (o > 0) {
|
|
695
|
-
r.scrollTo({
|
|
696
|
-
top: r.scrollTop + o,
|
|
697
|
-
behavior: "smooth"
|
|
698
|
-
});
|
|
699
|
-
return;
|
|
700
|
-
}
|
|
701
|
-
let s = a.top - i.top + dt;
|
|
702
|
-
s > 0 && r.scrollTo({
|
|
703
|
-
top: Math.max(0, r.scrollTop - s),
|
|
704
|
-
behavior: "smooth"
|
|
705
|
-
});
|
|
706
|
-
}, mt = ({ ...e }) => /* @__PURE__ */ F(Xe, {
|
|
681
|
+
var Ze = ie, Qe = J, $e = oe, et = ce, tt = ue, nt = de, rt = Ce, it = De, at = ke, ot = Me, st = Ne, ct = Fe, lt = Le, ut = ze, dt = He, ft = ({ ...e }) => /* @__PURE__ */ I(Ze, {
|
|
707
682
|
"data-slot": "select",
|
|
708
683
|
...e
|
|
709
|
-
}),
|
|
684
|
+
}), pt = ({ ...e }) => /* @__PURE__ */ I(it, {
|
|
710
685
|
"data-slot": "select-group",
|
|
711
686
|
...e
|
|
712
|
-
}),
|
|
713
|
-
className: p("min-w-0 block max-w-full flex-1 overflow-hidden text-left text-ellipsis whitespace-nowrap text-input-text
|
|
687
|
+
}), mt = ({ className: e, ...t }) => /* @__PURE__ */ I($e, {
|
|
688
|
+
className: p("min-w-0 block max-w-full flex-1 overflow-hidden text-left text-ellipsis whitespace-nowrap text-input-text data-placeholder:text-input-text-placeholder!", "**:max-w-full **:overflow-hidden **:text-ellipsis **:whitespace-nowrap", e),
|
|
714
689
|
"data-slot": "select-value",
|
|
715
690
|
...t
|
|
716
|
-
}),
|
|
691
|
+
}), ht = ({ asChild: e, children: n, className: r, size: i = "default", ...a }) => /* @__PURE__ */ L(Qe, {
|
|
717
692
|
asChild: e,
|
|
718
|
-
className: p("
|
|
693
|
+
className: p(g(!1, a.disabled ? "disabled" : "default"), "min-w-0 gap-2 grid w-full cursor-pointer! grid-cols-[minmax(0,1fr)_auto] items-center overflow-hidden text-left whitespace-nowrap text-input-text! data-placeholder:text-input-text-placeholder! data-[state=open]:cursor-pointer!", "[&>span]:min-w-0 **:data-placeholder:text-input-text-placeholder! [&>span]:block [&>span]:overflow-hidden [&>span]:text-ellipsis [&>span]:whitespace-nowrap [&>span[data-placeholder]]:text-input-text-placeholder!", "data-[state=open]:border-input-border--focus data-[state=open]:hover:border-input-border--focus", "**:data-[slot=select-chevron]:pointer-events-auto **:data-[slot=select-chevron]:cursor-pointer! [&[data-state=open]_[data-slot=select-chevron]]:rotate-180", r),
|
|
719
694
|
"data-size": i,
|
|
720
695
|
"data-slot": "select-trigger",
|
|
721
696
|
...a,
|
|
722
|
-
children: [n, !e && /* @__PURE__ */
|
|
697
|
+
children: [n, !e && /* @__PURE__ */ I(et, {
|
|
723
698
|
asChild: !0,
|
|
724
|
-
children: /* @__PURE__ */
|
|
725
|
-
className: "
|
|
726
|
-
|
|
699
|
+
children: /* @__PURE__ */ I("div", {
|
|
700
|
+
className: "pointer-events-auto flex shrink-0 cursor-pointer items-center",
|
|
701
|
+
children: /* @__PURE__ */ I(t, {
|
|
702
|
+
className: "cursor-pointer transition-transform duration-200",
|
|
703
|
+
"data-slot": "select-chevron",
|
|
704
|
+
size: 20
|
|
705
|
+
})
|
|
727
706
|
})
|
|
728
707
|
})]
|
|
729
|
-
}),
|
|
730
|
-
let
|
|
731
|
-
return /* @__PURE__ */
|
|
708
|
+
}), gt = ({ align: e = "center", children: t, className: n, dropdownWidth: r = "trigger", onCloseAutoFocus: i, position: a = "popper", style: o, ...s }) => {
|
|
709
|
+
let { dropdownShiftStyle: c, setDropdownElement: l } = M(), u = r === "trigger" ? "var(--radix-select-trigger-width)" : r === "content" ? "max-content" : r, d = r === "trigger" || r === "content" ? r : "custom";
|
|
710
|
+
return /* @__PURE__ */ I(tt, { children: /* @__PURE__ */ L(nt, {
|
|
732
711
|
align: e,
|
|
733
|
-
className: p("
|
|
734
|
-
"data-dropdown-width-mode":
|
|
735
|
-
"data-dropdown-width-value":
|
|
712
|
+
className: p("relative z-50 motion-safe:data-[state=closed]:animate-out motion-safe:data-[state=open]:animate-in", m(), "motion-safe:data-[state=closed]:fade-out-0 motion-safe:data-[state=closed]:zoom-out-95 motion-safe:data-[state=open]:fade-in-0 motion-safe:data-[state=open]:zoom-in-95", "max-h-[min(var(--radix-select-content-available-height),300px)] motion-safe:data-[side=bottom]:slide-in-from-top-2 motion-safe:data-[side=top]:slide-in-from-bottom-2", "min-w-32 origin-(--radix-select-content-transform-origin) overflow-hidden", a === "popper" && "data-[side=bottom]:translate-y-1 data-[side=top]:-translate-y-1", n),
|
|
713
|
+
"data-dropdown-width-mode": d,
|
|
714
|
+
"data-dropdown-width-value": d === "custom" ? r : void 0,
|
|
736
715
|
"data-slot": "select-content",
|
|
737
716
|
onCloseAutoFocus: (e) => {
|
|
738
|
-
|
|
717
|
+
i?.(e);
|
|
739
718
|
},
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
l.current = !0;
|
|
743
|
-
let t = e.currentTarget;
|
|
744
|
-
requestAnimationFrame(() => {
|
|
745
|
-
pt(t), d();
|
|
746
|
-
});
|
|
747
|
-
},
|
|
748
|
-
position: o,
|
|
749
|
-
ref: f,
|
|
719
|
+
position: a,
|
|
720
|
+
ref: l,
|
|
750
721
|
style: {
|
|
751
|
-
...
|
|
752
|
-
width:
|
|
753
|
-
...
|
|
722
|
+
...o,
|
|
723
|
+
width: u,
|
|
724
|
+
...c
|
|
754
725
|
},
|
|
755
|
-
...
|
|
726
|
+
...s,
|
|
756
727
|
children: [
|
|
757
|
-
/* @__PURE__ */
|
|
758
|
-
/* @__PURE__ */
|
|
759
|
-
className: p("p-1",
|
|
728
|
+
/* @__PURE__ */ I(bt, {}),
|
|
729
|
+
/* @__PURE__ */ I(rt, {
|
|
730
|
+
className: p("p-1 overflow-x-hidden overflow-y-auto", a === "popper" && "scroll-my-1 h-(--radix-select-trigger-height) w-full min-w-full"),
|
|
760
731
|
"data-slot": "select-viewport",
|
|
761
732
|
children: t
|
|
762
733
|
}),
|
|
763
|
-
/* @__PURE__ */
|
|
734
|
+
/* @__PURE__ */ I(xt, {})
|
|
764
735
|
]
|
|
765
736
|
}) });
|
|
766
|
-
},
|
|
737
|
+
}, _t = ({ className: e, ...t }) => /* @__PURE__ */ I(at, {
|
|
767
738
|
className: p("px-2 py-1.5 text-xs text-text-primary", e),
|
|
768
739
|
"data-slot": "select-label",
|
|
769
740
|
...t
|
|
770
|
-
}),
|
|
771
|
-
className: p(
|
|
741
|
+
}), vt = ({ className: t, children: n, ...r }) => /* @__PURE__ */ L(ot, {
|
|
742
|
+
className: p(h(!!r.disabled, !1, !1), "relative flex w-full cursor-pointer items-center data-[state=checked]:bg-input-bg--selected data-[state=checked]:text-input-text", t),
|
|
772
743
|
"data-slot": "select-item",
|
|
773
744
|
...r,
|
|
774
|
-
children: [/* @__PURE__ */
|
|
745
|
+
children: [/* @__PURE__ */ I("span", {
|
|
775
746
|
className: "right-2 size-3.5 absolute flex items-center justify-center",
|
|
776
|
-
children: /* @__PURE__ */
|
|
777
|
-
}), /* @__PURE__ */
|
|
747
|
+
children: /* @__PURE__ */ I(ct, { children: /* @__PURE__ */ I(e, { className: "size-4" }) })
|
|
748
|
+
}), /* @__PURE__ */ I(st, {
|
|
778
749
|
className: "min-w-0 block max-w-full truncate whitespace-nowrap",
|
|
779
750
|
children: n
|
|
780
751
|
})]
|
|
781
|
-
}),
|
|
752
|
+
}), yt = ({ className: e, ...t }) => /* @__PURE__ */ I(dt, {
|
|
782
753
|
className: p("bg-border -mx-1 my-1 pointer-events-none h-px", e),
|
|
783
754
|
"data-slot": "select-separator",
|
|
784
755
|
...t
|
|
785
|
-
}),
|
|
756
|
+
}), bt = ({ className: e, ...t }) => /* @__PURE__ */ I(lt, {
|
|
786
757
|
className: p("py-1 flex cursor-default items-center justify-center", e),
|
|
787
758
|
"data-slot": "select-scroll-up-button",
|
|
788
759
|
...t,
|
|
789
|
-
children: /* @__PURE__ */
|
|
790
|
-
}),
|
|
760
|
+
children: /* @__PURE__ */ I(n, { className: "size-4" })
|
|
761
|
+
}), xt = ({ className: e, ...n }) => /* @__PURE__ */ I(ut, {
|
|
791
762
|
className: p("py-1 flex cursor-default items-center justify-center", e),
|
|
792
763
|
"data-slot": "select-scroll-down-button",
|
|
793
764
|
...n,
|
|
794
|
-
children: /* @__PURE__ */
|
|
765
|
+
children: /* @__PURE__ */ I(t, { className: "size-4" })
|
|
795
766
|
});
|
|
796
767
|
//#endregion
|
|
797
|
-
export {
|
|
768
|
+
export { rt as C, Qe as S, tt as _, _t as a, lt as b, yt as c, nt as d, it as f, st as g, ct as h, vt as i, ht as l, ot as m, gt as n, xt as o, et as p, pt as r, bt as s, ft as t, mt as u, Ze as v, dt as x, ut as y };
|