@still-forest/canopy 0.28.0 → 0.28.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/SelectInput.js +383 -383
- package/package.json +1 -1
package/dist/SelectInput.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { j as
|
|
1
|
+
import { j as n } from "./jsx-runtime.js";
|
|
2
2
|
import { c as q, u as A, i as Pe, B as Be, j as no } from "./calendar.js";
|
|
3
3
|
import * as i from "react";
|
|
4
4
|
import oe, { useState as qe, useEffect as ro } from "react";
|
|
@@ -13,19 +13,19 @@ import * as Qe from "react-dom";
|
|
|
13
13
|
* This source code is licensed under the ISC license.
|
|
14
14
|
* See the LICENSE file in the root directory of this source tree.
|
|
15
15
|
*/
|
|
16
|
-
const
|
|
16
|
+
const Co = [
|
|
17
17
|
["path", { d: "M8 2v4", key: "1cmpym" }],
|
|
18
18
|
["path", { d: "M16 2v4", key: "4m81vk" }],
|
|
19
19
|
["rect", { width: "18", height: "18", x: "3", y: "4", rx: "2", key: "1hopcy" }],
|
|
20
20
|
["path", { d: "M3 10h18", key: "8toen8" }]
|
|
21
|
-
],
|
|
21
|
+
], wo = q("calendar", Co);
|
|
22
22
|
/**
|
|
23
23
|
* @license lucide-react v0.525.0 - ISC
|
|
24
24
|
*
|
|
25
25
|
* This source code is licensed under the ISC license.
|
|
26
26
|
* See the LICENSE file in the root directory of this source tree.
|
|
27
27
|
*/
|
|
28
|
-
const
|
|
28
|
+
const yo = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]], et = q("check", yo);
|
|
29
29
|
/**
|
|
30
30
|
* @license lucide-react v0.525.0 - ISC
|
|
31
31
|
*
|
|
@@ -53,7 +53,7 @@ const No = [["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }]], To = q(
|
|
|
53
53
|
* This source code is licensed under the ISC license.
|
|
54
54
|
* See the LICENSE file in the root directory of this source tree.
|
|
55
55
|
*/
|
|
56
|
-
const
|
|
56
|
+
const Eo = [
|
|
57
57
|
["path", { d: "M12 2v4", key: "3427ic" }],
|
|
58
58
|
["path", { d: "m16.2 7.8 2.9-2.9", key: "r700ao" }],
|
|
59
59
|
["path", { d: "M18 12h4", key: "wj9ykh" }],
|
|
@@ -62,7 +62,7 @@ const jo = [
|
|
|
62
62
|
["path", { d: "m4.9 19.1 2.9-2.9", key: "bwix9q" }],
|
|
63
63
|
["path", { d: "M2 12h4", key: "j09sii" }],
|
|
64
64
|
["path", { d: "m4.9 4.9 2.9 2.9", key: "giyufr" }]
|
|
65
|
-
],
|
|
65
|
+
], jo = q("loader", Eo);
|
|
66
66
|
/**
|
|
67
67
|
* @license lucide-react v0.525.0 - ISC
|
|
68
68
|
*
|
|
@@ -95,7 +95,7 @@ const Mo = [
|
|
|
95
95
|
}
|
|
96
96
|
],
|
|
97
97
|
["path", { d: "m21.854 2.147-10.94 10.939", key: "12cjpa" }]
|
|
98
|
-
],
|
|
98
|
+
], je = q("send", Mo);
|
|
99
99
|
/**
|
|
100
100
|
* @license lucide-react v0.525.0 - ISC
|
|
101
101
|
*
|
|
@@ -110,25 +110,25 @@ const Ao = [
|
|
|
110
110
|
["line", { x1: "14", x2: "14", y1: "11", y2: "17", key: "xtxkd" }]
|
|
111
111
|
], Do = q("trash-2", Ao);
|
|
112
112
|
function ot(e) {
|
|
113
|
-
const
|
|
114
|
-
|
|
113
|
+
const o = e + "CollectionProvider", [t, r] = ce(o), [s, a] = t(
|
|
114
|
+
o,
|
|
115
115
|
{ collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }
|
|
116
116
|
), c = (u) => {
|
|
117
117
|
const { scope: f, children: x } = u, h = oe.useRef(null), g = oe.useRef(/* @__PURE__ */ new Map()).current;
|
|
118
|
-
return /* @__PURE__ */
|
|
118
|
+
return /* @__PURE__ */ n.jsx(s, { scope: f, itemMap: g, collectionRef: h, children: x });
|
|
119
119
|
};
|
|
120
|
-
c.displayName =
|
|
120
|
+
c.displayName = o;
|
|
121
121
|
const l = e + "CollectionSlot", d = Pe(l), p = oe.forwardRef(
|
|
122
122
|
(u, f) => {
|
|
123
|
-
const { scope: x, children: h } = u, g = a(l, x),
|
|
124
|
-
return /* @__PURE__ */
|
|
123
|
+
const { scope: x, children: h } = u, g = a(l, x), y = A(f, g.collectionRef);
|
|
124
|
+
return /* @__PURE__ */ n.jsx(d, { ref: y, children: h });
|
|
125
125
|
}
|
|
126
126
|
);
|
|
127
127
|
p.displayName = l;
|
|
128
|
-
const m = e + "CollectionItemSlot", v = "data-radix-collection-item",
|
|
128
|
+
const m = e + "CollectionItemSlot", v = "data-radix-collection-item", C = Pe(m), S = oe.forwardRef(
|
|
129
129
|
(u, f) => {
|
|
130
|
-
const { scope: x, children: h, ...g } = u,
|
|
131
|
-
return oe.useEffect(() => (O.itemMap.set(
|
|
130
|
+
const { scope: x, children: h, ...g } = u, y = oe.useRef(null), j = A(f, y), O = a(m, x);
|
|
131
|
+
return oe.useEffect(() => (O.itemMap.set(y, { ref: y, ...g }), () => void O.itemMap.delete(y))), /* @__PURE__ */ n.jsx(C, { [v]: "", ref: j, children: h });
|
|
132
132
|
}
|
|
133
133
|
);
|
|
134
134
|
S.displayName = m;
|
|
@@ -151,17 +151,17 @@ function ot(e) {
|
|
|
151
151
|
}
|
|
152
152
|
var Oo = i.createContext(void 0);
|
|
153
153
|
function Ge(e) {
|
|
154
|
-
const
|
|
155
|
-
return e ||
|
|
154
|
+
const o = i.useContext(Oo);
|
|
155
|
+
return e || o || "ltr";
|
|
156
156
|
}
|
|
157
157
|
function $e(e) {
|
|
158
|
-
const
|
|
159
|
-
return i.useMemo(() => (
|
|
158
|
+
const o = i.useRef({ value: e, previous: e });
|
|
159
|
+
return i.useMemo(() => (o.current.value !== e && (o.current.previous = o.current.value, o.current.value = e), o.current.previous), [e]);
|
|
160
160
|
}
|
|
161
161
|
var ge = "Checkbox", [Lo, hr] = ce(ge), [Fo, He] = Lo(ge);
|
|
162
162
|
function Bo(e) {
|
|
163
163
|
const {
|
|
164
|
-
__scopeCheckbox:
|
|
164
|
+
__scopeCheckbox: o,
|
|
165
165
|
checked: t,
|
|
166
166
|
children: r,
|
|
167
167
|
defaultChecked: s,
|
|
@@ -173,7 +173,7 @@ function Bo(e) {
|
|
|
173
173
|
value: m = "on",
|
|
174
174
|
// @ts-expect-error
|
|
175
175
|
internal_do_not_use_render: v
|
|
176
|
-
} = e, [
|
|
176
|
+
} = e, [C, S] = ue({
|
|
177
177
|
prop: t,
|
|
178
178
|
defaultProp: s ?? !1,
|
|
179
179
|
onChange: d,
|
|
@@ -181,8 +181,8 @@ function Bo(e) {
|
|
|
181
181
|
}), [b, u] = i.useState(null), [f, x] = i.useState(null), h = i.useRef(!1), g = b ? !!c || !!b.closest("form") : (
|
|
182
182
|
// We set this to true by default so that events bubble to forms without JS (SSR)
|
|
183
183
|
!0
|
|
184
|
-
),
|
|
185
|
-
checked:
|
|
184
|
+
), y = {
|
|
185
|
+
checked: C,
|
|
186
186
|
disabled: a,
|
|
187
187
|
setChecked: S,
|
|
188
188
|
control: b,
|
|
@@ -197,17 +197,17 @@ function Bo(e) {
|
|
|
197
197
|
bubbleInput: f,
|
|
198
198
|
setBubbleInput: x
|
|
199
199
|
};
|
|
200
|
-
return /* @__PURE__ */
|
|
200
|
+
return /* @__PURE__ */ n.jsx(
|
|
201
201
|
Fo,
|
|
202
202
|
{
|
|
203
|
-
scope:
|
|
204
|
-
...
|
|
205
|
-
children: Vo(v) ? v(
|
|
203
|
+
scope: o,
|
|
204
|
+
...y,
|
|
205
|
+
children: Vo(v) ? v(y) : r
|
|
206
206
|
}
|
|
207
207
|
);
|
|
208
208
|
}
|
|
209
209
|
var nt = "CheckboxTrigger", rt = i.forwardRef(
|
|
210
|
-
({ __scopeCheckbox: e, onKeyDown:
|
|
210
|
+
({ __scopeCheckbox: e, onKeyDown: o, onClick: t, ...r }, s) => {
|
|
211
211
|
const {
|
|
212
212
|
control: a,
|
|
213
213
|
value: c,
|
|
@@ -216,7 +216,7 @@ var nt = "CheckboxTrigger", rt = i.forwardRef(
|
|
|
216
216
|
required: p,
|
|
217
217
|
setControl: m,
|
|
218
218
|
setChecked: v,
|
|
219
|
-
hasConsumerStoppedPropagationRef:
|
|
219
|
+
hasConsumerStoppedPropagationRef: C,
|
|
220
220
|
isFormControl: S,
|
|
221
221
|
bubbleInput: b
|
|
222
222
|
} = He(nt, e), u = A(s, m), f = i.useRef(d);
|
|
@@ -226,7 +226,7 @@ var nt = "CheckboxTrigger", rt = i.forwardRef(
|
|
|
226
226
|
const h = () => v(f.current);
|
|
227
227
|
return x.addEventListener("reset", h), () => x.removeEventListener("reset", h);
|
|
228
228
|
}
|
|
229
|
-
}, [a, v]), /* @__PURE__ */
|
|
229
|
+
}, [a, v]), /* @__PURE__ */ n.jsx(
|
|
230
230
|
N.button,
|
|
231
231
|
{
|
|
232
232
|
type: "button",
|
|
@@ -239,11 +239,11 @@ var nt = "CheckboxTrigger", rt = i.forwardRef(
|
|
|
239
239
|
value: c,
|
|
240
240
|
...r,
|
|
241
241
|
ref: u,
|
|
242
|
-
onKeyDown: I(
|
|
242
|
+
onKeyDown: I(o, (x) => {
|
|
243
243
|
x.key === "Enter" && x.preventDefault();
|
|
244
244
|
}),
|
|
245
245
|
onClick: I(t, (x) => {
|
|
246
|
-
v((h) => X(h) ? !0 : !h), b && S && (
|
|
246
|
+
v((h) => X(h) ? !0 : !h), b && S && (C.current = x.isPropagationStopped(), C.current || x.stopPropagation());
|
|
247
247
|
})
|
|
248
248
|
}
|
|
249
249
|
);
|
|
@@ -251,7 +251,7 @@ var nt = "CheckboxTrigger", rt = i.forwardRef(
|
|
|
251
251
|
);
|
|
252
252
|
rt.displayName = nt;
|
|
253
253
|
var st = i.forwardRef(
|
|
254
|
-
(e,
|
|
254
|
+
(e, o) => {
|
|
255
255
|
const {
|
|
256
256
|
__scopeCheckbox: t,
|
|
257
257
|
name: r,
|
|
@@ -264,7 +264,7 @@ var st = i.forwardRef(
|
|
|
264
264
|
form: m,
|
|
265
265
|
...v
|
|
266
266
|
} = e;
|
|
267
|
-
return /* @__PURE__ */
|
|
267
|
+
return /* @__PURE__ */ n.jsx(
|
|
268
268
|
Bo,
|
|
269
269
|
{
|
|
270
270
|
__scopeCheckbox: t,
|
|
@@ -276,16 +276,16 @@ var st = i.forwardRef(
|
|
|
276
276
|
name: r,
|
|
277
277
|
form: m,
|
|
278
278
|
value: d,
|
|
279
|
-
internal_do_not_use_render: ({ isFormControl:
|
|
280
|
-
/* @__PURE__ */
|
|
279
|
+
internal_do_not_use_render: ({ isFormControl: C }) => /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
|
|
280
|
+
/* @__PURE__ */ n.jsx(
|
|
281
281
|
rt,
|
|
282
282
|
{
|
|
283
283
|
...v,
|
|
284
|
-
ref:
|
|
284
|
+
ref: o,
|
|
285
285
|
__scopeCheckbox: t
|
|
286
286
|
}
|
|
287
287
|
),
|
|
288
|
-
|
|
288
|
+
C && /* @__PURE__ */ n.jsx(
|
|
289
289
|
lt,
|
|
290
290
|
{
|
|
291
291
|
__scopeCheckbox: t
|
|
@@ -298,19 +298,19 @@ var st = i.forwardRef(
|
|
|
298
298
|
);
|
|
299
299
|
st.displayName = ge;
|
|
300
300
|
var at = "CheckboxIndicator", ct = i.forwardRef(
|
|
301
|
-
(e,
|
|
301
|
+
(e, o) => {
|
|
302
302
|
const { __scopeCheckbox: t, forceMount: r, ...s } = e, a = He(at, t);
|
|
303
|
-
return /* @__PURE__ */
|
|
303
|
+
return /* @__PURE__ */ n.jsx(
|
|
304
304
|
Ye,
|
|
305
305
|
{
|
|
306
306
|
present: r || X(a.checked) || a.checked === !0,
|
|
307
|
-
children: /* @__PURE__ */
|
|
307
|
+
children: /* @__PURE__ */ n.jsx(
|
|
308
308
|
N.span,
|
|
309
309
|
{
|
|
310
310
|
"data-state": dt(a.checked),
|
|
311
311
|
"data-disabled": a.disabled ? "" : void 0,
|
|
312
312
|
...s,
|
|
313
|
-
ref:
|
|
313
|
+
ref: o,
|
|
314
314
|
style: { pointerEvents: "none", ...e.style }
|
|
315
315
|
}
|
|
316
316
|
)
|
|
@@ -320,7 +320,7 @@ var at = "CheckboxIndicator", ct = i.forwardRef(
|
|
|
320
320
|
);
|
|
321
321
|
ct.displayName = at;
|
|
322
322
|
var it = "CheckboxBubbleInput", lt = i.forwardRef(
|
|
323
|
-
({ __scopeCheckbox: e, ...
|
|
323
|
+
({ __scopeCheckbox: e, ...o }, t) => {
|
|
324
324
|
const {
|
|
325
325
|
control: r,
|
|
326
326
|
hasConsumerStoppedPropagationRef: s,
|
|
@@ -331,23 +331,23 @@ var it = "CheckboxBubbleInput", lt = i.forwardRef(
|
|
|
331
331
|
name: p,
|
|
332
332
|
value: m,
|
|
333
333
|
form: v,
|
|
334
|
-
bubbleInput:
|
|
334
|
+
bubbleInput: C,
|
|
335
335
|
setBubbleInput: S
|
|
336
336
|
} = He(it, e), b = A(t, S), u = $e(a), f = Xe(r);
|
|
337
337
|
i.useEffect(() => {
|
|
338
|
-
const h =
|
|
338
|
+
const h = C;
|
|
339
339
|
if (!h) return;
|
|
340
|
-
const g = window.HTMLInputElement.prototype,
|
|
340
|
+
const g = window.HTMLInputElement.prototype, j = Object.getOwnPropertyDescriptor(
|
|
341
341
|
g,
|
|
342
342
|
"checked"
|
|
343
343
|
).set, O = !s.current;
|
|
344
|
-
if (u !== a &&
|
|
344
|
+
if (u !== a && j) {
|
|
345
345
|
const k = new Event("click", { bubbles: O });
|
|
346
|
-
h.indeterminate = X(a),
|
|
346
|
+
h.indeterminate = X(a), j.call(h, X(a) ? !1 : a), h.dispatchEvent(k);
|
|
347
347
|
}
|
|
348
|
-
}, [
|
|
348
|
+
}, [C, u, a, s]);
|
|
349
349
|
const x = i.useRef(X(a) ? !1 : a);
|
|
350
|
-
return /* @__PURE__ */
|
|
350
|
+
return /* @__PURE__ */ n.jsx(
|
|
351
351
|
N.input,
|
|
352
352
|
{
|
|
353
353
|
type: "checkbox",
|
|
@@ -358,11 +358,11 @@ var it = "CheckboxBubbleInput", lt = i.forwardRef(
|
|
|
358
358
|
name: p,
|
|
359
359
|
value: m,
|
|
360
360
|
form: v,
|
|
361
|
-
...
|
|
361
|
+
...o,
|
|
362
362
|
tabIndex: -1,
|
|
363
363
|
ref: b,
|
|
364
364
|
style: {
|
|
365
|
-
...
|
|
365
|
+
...o.style,
|
|
366
366
|
...f,
|
|
367
367
|
position: "absolute",
|
|
368
368
|
pointerEvents: "none",
|
|
@@ -391,10 +391,10 @@ var ke = "rovingFocusGroup.onEntryFocus", Go = { bubbles: !1, cancelable: !0 },
|
|
|
391
391
|
pe,
|
|
392
392
|
[$o]
|
|
393
393
|
), [Uo, zo] = Ho(pe), ft = i.forwardRef(
|
|
394
|
-
(e,
|
|
394
|
+
(e, o) => /* @__PURE__ */ n.jsx(Me.Provider, { scope: e.__scopeRovingFocusGroup, children: /* @__PURE__ */ n.jsx(Me.Slot, { scope: e.__scopeRovingFocusGroup, children: /* @__PURE__ */ n.jsx(Ko, { ...e, ref: o }) }) })
|
|
395
395
|
);
|
|
396
396
|
ft.displayName = pe;
|
|
397
|
-
var Ko = i.forwardRef((e,
|
|
397
|
+
var Ko = i.forwardRef((e, o) => {
|
|
398
398
|
const {
|
|
399
399
|
__scopeRovingFocusGroup: t,
|
|
400
400
|
orientation: r,
|
|
@@ -406,17 +406,17 @@ var Ko = i.forwardRef((e, n) => {
|
|
|
406
406
|
onEntryFocus: p,
|
|
407
407
|
preventScrollOnEntryFocus: m = !1,
|
|
408
408
|
...v
|
|
409
|
-
} = e,
|
|
409
|
+
} = e, C = i.useRef(null), S = A(o, C), b = Ge(a), [u, f] = ue({
|
|
410
410
|
prop: c,
|
|
411
411
|
defaultProp: l ?? null,
|
|
412
412
|
onChange: d,
|
|
413
413
|
caller: pe
|
|
414
|
-
}), [x, h] = i.useState(!1), g = Ze(p),
|
|
414
|
+
}), [x, h] = i.useState(!1), g = Ze(p), y = ut(t), j = i.useRef(!1), [O, k] = i.useState(0);
|
|
415
415
|
return i.useEffect(() => {
|
|
416
|
-
const R =
|
|
416
|
+
const R = C.current;
|
|
417
417
|
if (R)
|
|
418
418
|
return R.addEventListener(ke, g), () => R.removeEventListener(ke, g);
|
|
419
|
-
}, [g]), /* @__PURE__ */
|
|
419
|
+
}, [g]), /* @__PURE__ */ n.jsx(
|
|
420
420
|
Uo,
|
|
421
421
|
{
|
|
422
422
|
scope: t,
|
|
@@ -437,7 +437,7 @@ var Ko = i.forwardRef((e, n) => {
|
|
|
437
437
|
() => k((R) => R - 1),
|
|
438
438
|
[]
|
|
439
439
|
),
|
|
440
|
-
children: /* @__PURE__ */
|
|
440
|
+
children: /* @__PURE__ */ n.jsx(
|
|
441
441
|
N.div,
|
|
442
442
|
{
|
|
443
443
|
tabIndex: x || O === 0 ? -1 : 0,
|
|
@@ -446,20 +446,20 @@ var Ko = i.forwardRef((e, n) => {
|
|
|
446
446
|
ref: S,
|
|
447
447
|
style: { outline: "none", ...e.style },
|
|
448
448
|
onMouseDown: I(e.onMouseDown, () => {
|
|
449
|
-
|
|
449
|
+
j.current = !0;
|
|
450
450
|
}),
|
|
451
451
|
onFocus: I(e.onFocus, (R) => {
|
|
452
|
-
const $ = !
|
|
452
|
+
const $ = !j.current;
|
|
453
453
|
if (R.target === R.currentTarget && $ && !x) {
|
|
454
454
|
const H = new CustomEvent(ke, Go);
|
|
455
455
|
if (R.currentTarget.dispatchEvent(H), !H.defaultPrevented) {
|
|
456
|
-
const L =
|
|
456
|
+
const L = y().filter((T) => T.focusable), B = L.find((T) => T.active), U = L.find((T) => T.id === u), V = [B, U, ...L].filter(
|
|
457
457
|
Boolean
|
|
458
458
|
).map((T) => T.ref.current);
|
|
459
459
|
vt(V, m);
|
|
460
460
|
}
|
|
461
461
|
}
|
|
462
|
-
|
|
462
|
+
j.current = !1;
|
|
463
463
|
}),
|
|
464
464
|
onBlur: I(e.onBlur, () => h(!1))
|
|
465
465
|
}
|
|
@@ -467,7 +467,7 @@ var Ko = i.forwardRef((e, n) => {
|
|
|
467
467
|
}
|
|
468
468
|
);
|
|
469
469
|
}), mt = "RovingFocusGroupItem", ht = i.forwardRef(
|
|
470
|
-
(e,
|
|
470
|
+
(e, o) => {
|
|
471
471
|
const {
|
|
472
472
|
__scopeRovingFocusGroup: t,
|
|
473
473
|
focusable: r = !0,
|
|
@@ -475,24 +475,24 @@ var Ko = i.forwardRef((e, n) => {
|
|
|
475
475
|
tabStopId: a,
|
|
476
476
|
children: c,
|
|
477
477
|
...l
|
|
478
|
-
} = e, d = xe(), p = a || d, m = zo(mt, t), v = m.currentTabStopId === p,
|
|
478
|
+
} = e, d = xe(), p = a || d, m = zo(mt, t), v = m.currentTabStopId === p, C = ut(t), { onFocusableItemAdd: S, onFocusableItemRemove: b, currentTabStopId: u } = m;
|
|
479
479
|
return i.useEffect(() => {
|
|
480
480
|
if (r)
|
|
481
481
|
return S(), () => b();
|
|
482
|
-
}, [r, S, b]), /* @__PURE__ */
|
|
482
|
+
}, [r, S, b]), /* @__PURE__ */ n.jsx(
|
|
483
483
|
Me.ItemSlot,
|
|
484
484
|
{
|
|
485
485
|
scope: t,
|
|
486
486
|
id: p,
|
|
487
487
|
focusable: r,
|
|
488
488
|
active: s,
|
|
489
|
-
children: /* @__PURE__ */
|
|
489
|
+
children: /* @__PURE__ */ n.jsx(
|
|
490
490
|
N.span,
|
|
491
491
|
{
|
|
492
492
|
tabIndex: v ? 0 : -1,
|
|
493
493
|
"data-orientation": m.orientation,
|
|
494
494
|
...l,
|
|
495
|
-
ref:
|
|
495
|
+
ref: o,
|
|
496
496
|
onMouseDown: I(e.onMouseDown, (f) => {
|
|
497
497
|
r ? m.onItemFocus(p) : f.preventDefault();
|
|
498
498
|
}),
|
|
@@ -507,12 +507,12 @@ var Ko = i.forwardRef((e, n) => {
|
|
|
507
507
|
if (x !== void 0) {
|
|
508
508
|
if (f.metaKey || f.ctrlKey || f.altKey || f.shiftKey) return;
|
|
509
509
|
f.preventDefault();
|
|
510
|
-
let g =
|
|
510
|
+
let g = C().filter((y) => y.focusable).map((y) => y.ref.current);
|
|
511
511
|
if (x === "last") g.reverse();
|
|
512
512
|
else if (x === "prev" || x === "next") {
|
|
513
513
|
x === "prev" && g.reverse();
|
|
514
|
-
const
|
|
515
|
-
g = m.loop ? Xo(g,
|
|
514
|
+
const y = g.indexOf(f.currentTarget);
|
|
515
|
+
g = m.loop ? Xo(g, y + 1) : g.slice(y + 1);
|
|
516
516
|
}
|
|
517
517
|
setTimeout(() => vt(g));
|
|
518
518
|
}
|
|
@@ -535,27 +535,27 @@ var Wo = {
|
|
|
535
535
|
PageDown: "last",
|
|
536
536
|
End: "last"
|
|
537
537
|
};
|
|
538
|
-
function qo(e,
|
|
539
|
-
return
|
|
538
|
+
function qo(e, o) {
|
|
539
|
+
return o !== "rtl" ? e : e === "ArrowLeft" ? "ArrowRight" : e === "ArrowRight" ? "ArrowLeft" : e;
|
|
540
540
|
}
|
|
541
|
-
function Yo(e,
|
|
541
|
+
function Yo(e, o, t) {
|
|
542
542
|
const r = qo(e.key, t);
|
|
543
|
-
if (!(
|
|
543
|
+
if (!(o === "vertical" && ["ArrowLeft", "ArrowRight"].includes(r)) && !(o === "horizontal" && ["ArrowUp", "ArrowDown"].includes(r)))
|
|
544
544
|
return Wo[r];
|
|
545
545
|
}
|
|
546
|
-
function vt(e,
|
|
546
|
+
function vt(e, o = !1) {
|
|
547
547
|
const t = document.activeElement;
|
|
548
548
|
for (const r of e)
|
|
549
|
-
if (r === t || (r.focus({ preventScroll:
|
|
549
|
+
if (r === t || (r.focus({ preventScroll: o }), document.activeElement !== t)) return;
|
|
550
550
|
}
|
|
551
|
-
function Xo(e,
|
|
552
|
-
return e.map((t, r) => e[(
|
|
551
|
+
function Xo(e, o) {
|
|
552
|
+
return e.map((t, r) => e[(o + r) % e.length]);
|
|
553
553
|
}
|
|
554
|
-
var Zo = ft, Jo = ht, Qo = "Label", xt = i.forwardRef((e,
|
|
554
|
+
var Zo = ft, Jo = ht, Qo = "Label", xt = i.forwardRef((e, o) => /* @__PURE__ */ n.jsx(
|
|
555
555
|
N.label,
|
|
556
556
|
{
|
|
557
557
|
...e,
|
|
558
|
-
ref:
|
|
558
|
+
ref: o,
|
|
559
559
|
onMouseDown: (t) => {
|
|
560
560
|
t.target.closest("button, input, select, textarea") || (e.onMouseDown?.(t), !t.defaultPrevented && t.detail > 1 && t.preventDefault());
|
|
561
561
|
}
|
|
@@ -563,11 +563,11 @@ var Zo = ft, Jo = ht, Qo = "Label", xt = i.forwardRef((e, n) => /* @__PURE__ */
|
|
|
563
563
|
));
|
|
564
564
|
xt.displayName = Qo;
|
|
565
565
|
var en = xt;
|
|
566
|
-
function Ke(e, [
|
|
567
|
-
return Math.min(t, Math.max(
|
|
566
|
+
function Ke(e, [o, t]) {
|
|
567
|
+
return Math.min(t, Math.max(o, e));
|
|
568
568
|
}
|
|
569
569
|
var Ue = "Radio", [tn, gt] = ce(Ue), [on, nn] = tn(Ue), bt = i.forwardRef(
|
|
570
|
-
(e,
|
|
570
|
+
(e, o) => {
|
|
571
571
|
const {
|
|
572
572
|
__scopeRadio: t,
|
|
573
573
|
name: r,
|
|
@@ -578,15 +578,15 @@ var Ue = "Radio", [tn, gt] = ce(Ue), [on, nn] = tn(Ue), bt = i.forwardRef(
|
|
|
578
578
|
onCheck: d,
|
|
579
579
|
form: p,
|
|
580
580
|
...m
|
|
581
|
-
} = e, [v,
|
|
582
|
-
return /* @__PURE__ */
|
|
583
|
-
/* @__PURE__ */
|
|
581
|
+
} = e, [v, C] = i.useState(null), S = A(o, (f) => C(f)), b = i.useRef(!1), u = v ? p || !!v.closest("form") : !0;
|
|
582
|
+
return /* @__PURE__ */ n.jsxs(on, { scope: t, checked: s, disabled: c, children: [
|
|
583
|
+
/* @__PURE__ */ n.jsx(
|
|
584
584
|
N.button,
|
|
585
585
|
{
|
|
586
586
|
type: "button",
|
|
587
587
|
role: "radio",
|
|
588
588
|
"aria-checked": s,
|
|
589
|
-
"data-state":
|
|
589
|
+
"data-state": yt(s),
|
|
590
590
|
"data-disabled": c ? "" : void 0,
|
|
591
591
|
disabled: c,
|
|
592
592
|
value: l,
|
|
@@ -597,8 +597,8 @@ var Ue = "Radio", [tn, gt] = ce(Ue), [on, nn] = tn(Ue), bt = i.forwardRef(
|
|
|
597
597
|
})
|
|
598
598
|
}
|
|
599
599
|
),
|
|
600
|
-
u && /* @__PURE__ */
|
|
601
|
-
|
|
600
|
+
u && /* @__PURE__ */ n.jsx(
|
|
601
|
+
wt,
|
|
602
602
|
{
|
|
603
603
|
control: v,
|
|
604
604
|
bubbles: !b.current,
|
|
@@ -615,30 +615,30 @@ var Ue = "Radio", [tn, gt] = ce(Ue), [on, nn] = tn(Ue), bt = i.forwardRef(
|
|
|
615
615
|
}
|
|
616
616
|
);
|
|
617
617
|
bt.displayName = Ue;
|
|
618
|
-
var St = "RadioIndicator",
|
|
619
|
-
(e,
|
|
618
|
+
var St = "RadioIndicator", Ct = i.forwardRef(
|
|
619
|
+
(e, o) => {
|
|
620
620
|
const { __scopeRadio: t, forceMount: r, ...s } = e, a = nn(St, t);
|
|
621
|
-
return /* @__PURE__ */
|
|
621
|
+
return /* @__PURE__ */ n.jsx(Ye, { present: r || a.checked, children: /* @__PURE__ */ n.jsx(
|
|
622
622
|
N.span,
|
|
623
623
|
{
|
|
624
|
-
"data-state":
|
|
624
|
+
"data-state": yt(a.checked),
|
|
625
625
|
"data-disabled": a.disabled ? "" : void 0,
|
|
626
626
|
...s,
|
|
627
|
-
ref:
|
|
627
|
+
ref: o
|
|
628
628
|
}
|
|
629
629
|
) });
|
|
630
630
|
}
|
|
631
631
|
);
|
|
632
|
-
|
|
633
|
-
var rn = "RadioBubbleInput",
|
|
632
|
+
Ct.displayName = St;
|
|
633
|
+
var rn = "RadioBubbleInput", wt = i.forwardRef(
|
|
634
634
|
({
|
|
635
635
|
__scopeRadio: e,
|
|
636
|
-
control:
|
|
636
|
+
control: o,
|
|
637
637
|
checked: t,
|
|
638
638
|
bubbles: r = !0,
|
|
639
639
|
...s
|
|
640
640
|
}, a) => {
|
|
641
|
-
const c = i.useRef(null), l = A(c, a), d = $e(t), p = Xe(
|
|
641
|
+
const c = i.useRef(null), l = A(c, a), d = $e(t), p = Xe(o);
|
|
642
642
|
return i.useEffect(() => {
|
|
643
643
|
const m = c.current;
|
|
644
644
|
if (!m) return;
|
|
@@ -650,7 +650,7 @@ var rn = "RadioBubbleInput", yt = i.forwardRef(
|
|
|
650
650
|
const b = new Event("click", { bubbles: r });
|
|
651
651
|
S.call(m, t), m.dispatchEvent(b);
|
|
652
652
|
}
|
|
653
|
-
}, [d, t, r]), /* @__PURE__ */
|
|
653
|
+
}, [d, t, r]), /* @__PURE__ */ n.jsx(
|
|
654
654
|
N.input,
|
|
655
655
|
{
|
|
656
656
|
type: "radio",
|
|
@@ -671,15 +671,15 @@ var rn = "RadioBubbleInput", yt = i.forwardRef(
|
|
|
671
671
|
);
|
|
672
672
|
}
|
|
673
673
|
);
|
|
674
|
-
|
|
675
|
-
function
|
|
674
|
+
wt.displayName = rn;
|
|
675
|
+
function yt(e) {
|
|
676
676
|
return e ? "checked" : "unchecked";
|
|
677
677
|
}
|
|
678
678
|
var sn = ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"], be = "RadioGroup", [an, vr] = ce(be, [
|
|
679
679
|
pt,
|
|
680
680
|
gt
|
|
681
681
|
]), It = pt(), Rt = gt(), [cn, ln] = an(be), _t = i.forwardRef(
|
|
682
|
-
(e,
|
|
682
|
+
(e, o) => {
|
|
683
683
|
const {
|
|
684
684
|
__scopeRadioGroup: t,
|
|
685
685
|
name: r,
|
|
@@ -691,14 +691,14 @@ var sn = ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"], be = "RadioGroup",
|
|
|
691
691
|
dir: p,
|
|
692
692
|
loop: m = !0,
|
|
693
693
|
onValueChange: v,
|
|
694
|
-
...
|
|
694
|
+
...C
|
|
695
695
|
} = e, S = It(t), b = Ge(p), [u, f] = ue({
|
|
696
696
|
prop: a,
|
|
697
697
|
defaultProp: s ?? null,
|
|
698
698
|
onChange: v,
|
|
699
699
|
caller: be
|
|
700
700
|
});
|
|
701
|
-
return /* @__PURE__ */
|
|
701
|
+
return /* @__PURE__ */ n.jsx(
|
|
702
702
|
cn,
|
|
703
703
|
{
|
|
704
704
|
scope: t,
|
|
@@ -707,7 +707,7 @@ var sn = ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"], be = "RadioGroup",
|
|
|
707
707
|
disabled: l,
|
|
708
708
|
value: u,
|
|
709
709
|
onValueChange: f,
|
|
710
|
-
children: /* @__PURE__ */
|
|
710
|
+
children: /* @__PURE__ */ n.jsx(
|
|
711
711
|
Zo,
|
|
712
712
|
{
|
|
713
713
|
asChild: !0,
|
|
@@ -715,7 +715,7 @@ var sn = ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"], be = "RadioGroup",
|
|
|
715
715
|
orientation: d,
|
|
716
716
|
dir: b,
|
|
717
717
|
loop: m,
|
|
718
|
-
children: /* @__PURE__ */
|
|
718
|
+
children: /* @__PURE__ */ n.jsx(
|
|
719
719
|
N.div,
|
|
720
720
|
{
|
|
721
721
|
role: "radiogroup",
|
|
@@ -723,8 +723,8 @@ var sn = ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"], be = "RadioGroup",
|
|
|
723
723
|
"aria-orientation": d,
|
|
724
724
|
"data-disabled": l ? "" : void 0,
|
|
725
725
|
dir: b,
|
|
726
|
-
...
|
|
727
|
-
ref:
|
|
726
|
+
...C,
|
|
727
|
+
ref: o
|
|
728
728
|
}
|
|
729
729
|
)
|
|
730
730
|
}
|
|
@@ -735,23 +735,23 @@ var sn = ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"], be = "RadioGroup",
|
|
|
735
735
|
);
|
|
736
736
|
_t.displayName = be;
|
|
737
737
|
var Nt = "RadioGroupItem", Tt = i.forwardRef(
|
|
738
|
-
(e,
|
|
739
|
-
const { __scopeRadioGroup: t, disabled: r, ...s } = e, a = ln(Nt, t), c = a.disabled || r, l = It(t), d = Rt(t), p = i.useRef(null), m = A(
|
|
738
|
+
(e, o) => {
|
|
739
|
+
const { __scopeRadioGroup: t, disabled: r, ...s } = e, a = ln(Nt, t), c = a.disabled || r, l = It(t), d = Rt(t), p = i.useRef(null), m = A(o, p), v = a.value === s.value, C = i.useRef(!1);
|
|
740
740
|
return i.useEffect(() => {
|
|
741
741
|
const S = (u) => {
|
|
742
|
-
sn.includes(u.key) && (
|
|
743
|
-
}, b = () =>
|
|
742
|
+
sn.includes(u.key) && (C.current = !0);
|
|
743
|
+
}, b = () => C.current = !1;
|
|
744
744
|
return document.addEventListener("keydown", S), document.addEventListener("keyup", b), () => {
|
|
745
745
|
document.removeEventListener("keydown", S), document.removeEventListener("keyup", b);
|
|
746
746
|
};
|
|
747
|
-
}, []), /* @__PURE__ */
|
|
747
|
+
}, []), /* @__PURE__ */ n.jsx(
|
|
748
748
|
Jo,
|
|
749
749
|
{
|
|
750
750
|
asChild: !0,
|
|
751
751
|
...l,
|
|
752
752
|
focusable: !c,
|
|
753
753
|
active: v,
|
|
754
|
-
children: /* @__PURE__ */
|
|
754
|
+
children: /* @__PURE__ */ n.jsx(
|
|
755
755
|
bt,
|
|
756
756
|
{
|
|
757
757
|
disabled: c,
|
|
@@ -766,7 +766,7 @@ var Nt = "RadioGroupItem", Tt = i.forwardRef(
|
|
|
766
766
|
S.key === "Enter" && S.preventDefault();
|
|
767
767
|
}),
|
|
768
768
|
onFocus: I(s.onFocus, () => {
|
|
769
|
-
|
|
769
|
+
C.current && p.current?.click();
|
|
770
770
|
})
|
|
771
771
|
}
|
|
772
772
|
)
|
|
@@ -775,19 +775,19 @@ var Nt = "RadioGroupItem", Tt = i.forwardRef(
|
|
|
775
775
|
}
|
|
776
776
|
);
|
|
777
777
|
Tt.displayName = Nt;
|
|
778
|
-
var dn = "RadioGroupIndicator",
|
|
779
|
-
(e,
|
|
778
|
+
var dn = "RadioGroupIndicator", Et = i.forwardRef(
|
|
779
|
+
(e, o) => {
|
|
780
780
|
const { __scopeRadioGroup: t, ...r } = e, s = Rt(t);
|
|
781
|
-
return /* @__PURE__ */
|
|
781
|
+
return /* @__PURE__ */ n.jsx(Ct, { ...s, ...r, ref: o });
|
|
782
782
|
}
|
|
783
783
|
);
|
|
784
|
-
|
|
785
|
-
var un = _t, pn = Tt, fn =
|
|
784
|
+
Et.displayName = dn;
|
|
785
|
+
var un = _t, pn = Tt, fn = Et, mn = [" ", "Enter", "ArrowUp", "ArrowDown"], hn = [" ", "Enter"], re = "Select", [Se, Ce, vn] = ot(re), [ie, xr] = ce(re, [
|
|
786
786
|
vn,
|
|
787
787
|
Je
|
|
788
|
-
]),
|
|
788
|
+
]), we = Je(), [xn, J] = ie(re), [gn, bn] = ie(re), jt = (e) => {
|
|
789
789
|
const {
|
|
790
|
-
__scopeSelect:
|
|
790
|
+
__scopeSelect: o,
|
|
791
791
|
children: t,
|
|
792
792
|
open: r,
|
|
793
793
|
defaultOpen: s,
|
|
@@ -798,10 +798,10 @@ var un = _t, pn = Tt, fn = jt, mn = [" ", "Enter", "ArrowUp", "ArrowDown"], hn =
|
|
|
798
798
|
dir: p,
|
|
799
799
|
name: m,
|
|
800
800
|
autoComplete: v,
|
|
801
|
-
disabled:
|
|
801
|
+
disabled: C,
|
|
802
802
|
required: S,
|
|
803
803
|
form: b
|
|
804
|
-
} = e, u =
|
|
804
|
+
} = e, u = we(o), [f, x] = i.useState(null), [h, g] = i.useState(null), [y, j] = i.useState(!1), O = Ge(p), [k, R] = ue({
|
|
805
805
|
prop: r,
|
|
806
806
|
defaultProp: s ?? !1,
|
|
807
807
|
onChange: a,
|
|
@@ -812,17 +812,17 @@ var un = _t, pn = Tt, fn = jt, mn = [" ", "Enter", "ArrowUp", "ArrowDown"], hn =
|
|
|
812
812
|
onChange: d,
|
|
813
813
|
caller: re
|
|
814
814
|
}), L = i.useRef(null), B = f ? b || !!f.closest("form") : !0, [U, z] = i.useState(/* @__PURE__ */ new Set()), V = Array.from(U).map((T) => T.props.value).join(";");
|
|
815
|
-
return /* @__PURE__ */
|
|
815
|
+
return /* @__PURE__ */ n.jsx(ao, { ...u, children: /* @__PURE__ */ n.jsxs(
|
|
816
816
|
xn,
|
|
817
817
|
{
|
|
818
818
|
required: S,
|
|
819
|
-
scope:
|
|
819
|
+
scope: o,
|
|
820
820
|
trigger: f,
|
|
821
821
|
onTriggerChange: x,
|
|
822
822
|
valueNode: h,
|
|
823
823
|
onValueNodeChange: g,
|
|
824
|
-
valueNodeHasChildren:
|
|
825
|
-
onValueNodeHasChildrenChange:
|
|
824
|
+
valueNodeHasChildren: y,
|
|
825
|
+
onValueNodeHasChildrenChange: j,
|
|
826
826
|
contentId: xe(),
|
|
827
827
|
value: $,
|
|
828
828
|
onValueChange: H,
|
|
@@ -830,9 +830,9 @@ var un = _t, pn = Tt, fn = jt, mn = [" ", "Enter", "ArrowUp", "ArrowDown"], hn =
|
|
|
830
830
|
onOpenChange: R,
|
|
831
831
|
dir: O,
|
|
832
832
|
triggerPointerDownPosRef: L,
|
|
833
|
-
disabled:
|
|
833
|
+
disabled: C,
|
|
834
834
|
children: [
|
|
835
|
-
/* @__PURE__ */
|
|
835
|
+
/* @__PURE__ */ n.jsx(Se.Provider, { scope: o, children: /* @__PURE__ */ n.jsx(
|
|
836
836
|
gn,
|
|
837
837
|
{
|
|
838
838
|
scope: e.__scopeSelect,
|
|
@@ -848,7 +848,7 @@ var un = _t, pn = Tt, fn = jt, mn = [" ", "Enter", "ArrowUp", "ArrowDown"], hn =
|
|
|
848
848
|
children: t
|
|
849
849
|
}
|
|
850
850
|
) }),
|
|
851
|
-
B ? /* @__PURE__ */
|
|
851
|
+
B ? /* @__PURE__ */ n.jsxs(
|
|
852
852
|
Jt,
|
|
853
853
|
{
|
|
854
854
|
"aria-hidden": !0,
|
|
@@ -858,10 +858,10 @@ var un = _t, pn = Tt, fn = jt, mn = [" ", "Enter", "ArrowUp", "ArrowDown"], hn =
|
|
|
858
858
|
autoComplete: v,
|
|
859
859
|
value: $,
|
|
860
860
|
onChange: (T) => H(T.target.value),
|
|
861
|
-
disabled:
|
|
861
|
+
disabled: C,
|
|
862
862
|
form: b,
|
|
863
863
|
children: [
|
|
864
|
-
$ === void 0 ? /* @__PURE__ */
|
|
864
|
+
$ === void 0 ? /* @__PURE__ */ n.jsx("option", { value: "" }) : null,
|
|
865
865
|
Array.from(U)
|
|
866
866
|
]
|
|
867
867
|
},
|
|
@@ -871,10 +871,10 @@ var un = _t, pn = Tt, fn = jt, mn = [" ", "Enter", "ArrowUp", "ArrowDown"], hn =
|
|
|
871
871
|
}
|
|
872
872
|
) });
|
|
873
873
|
};
|
|
874
|
-
|
|
874
|
+
jt.displayName = re;
|
|
875
875
|
var kt = "SelectTrigger", Pt = i.forwardRef(
|
|
876
|
-
(e,
|
|
877
|
-
const { __scopeSelect: t, disabled: r = !1, ...s } = e, a =
|
|
876
|
+
(e, o) => {
|
|
877
|
+
const { __scopeSelect: t, disabled: r = !1, ...s } = e, a = we(t), c = J(kt, t), l = c.disabled || r, d = A(o, c.onTriggerChange), p = Ce(t), m = i.useRef("touch"), [v, C, S] = eo((u) => {
|
|
878
878
|
const f = p().filter((g) => !g.disabled), x = f.find((g) => g.value === c.value), h = to(f, u, x);
|
|
879
879
|
h !== void 0 && c.onValueChange(h.value);
|
|
880
880
|
}), b = (u) => {
|
|
@@ -883,7 +883,7 @@ var kt = "SelectTrigger", Pt = i.forwardRef(
|
|
|
883
883
|
y: Math.round(u.pageY)
|
|
884
884
|
});
|
|
885
885
|
};
|
|
886
|
-
return /* @__PURE__ */
|
|
886
|
+
return /* @__PURE__ */ n.jsx(co, { asChild: !0, ...a, children: /* @__PURE__ */ n.jsx(
|
|
887
887
|
N.button,
|
|
888
888
|
{
|
|
889
889
|
type: "button",
|
|
@@ -909,7 +909,7 @@ var kt = "SelectTrigger", Pt = i.forwardRef(
|
|
|
909
909
|
}),
|
|
910
910
|
onKeyDown: I(s.onKeyDown, (u) => {
|
|
911
911
|
const f = v.current !== "";
|
|
912
|
-
!(u.ctrlKey || u.altKey || u.metaKey) && u.key.length === 1 &&
|
|
912
|
+
!(u.ctrlKey || u.altKey || u.metaKey) && u.key.length === 1 && C(u.key), !(f && u.key === " ") && mn.includes(u.key) && (b(), u.preventDefault());
|
|
913
913
|
})
|
|
914
914
|
}
|
|
915
915
|
) });
|
|
@@ -917,49 +917,49 @@ var kt = "SelectTrigger", Pt = i.forwardRef(
|
|
|
917
917
|
);
|
|
918
918
|
Pt.displayName = kt;
|
|
919
919
|
var Mt = "SelectValue", At = i.forwardRef(
|
|
920
|
-
(e,
|
|
921
|
-
const { __scopeSelect: t, className: r, style: s, children: a, placeholder: c = "", ...l } = e, d = J(Mt, t), { onValueNodeHasChildrenChange: p } = d, m = a !== void 0, v = A(
|
|
920
|
+
(e, o) => {
|
|
921
|
+
const { __scopeSelect: t, className: r, style: s, children: a, placeholder: c = "", ...l } = e, d = J(Mt, t), { onValueNodeHasChildrenChange: p } = d, m = a !== void 0, v = A(o, d.onValueNodeChange);
|
|
922
922
|
return Z(() => {
|
|
923
923
|
p(m);
|
|
924
|
-
}, [p, m]), /* @__PURE__ */
|
|
924
|
+
}, [p, m]), /* @__PURE__ */ n.jsx(
|
|
925
925
|
N.span,
|
|
926
926
|
{
|
|
927
927
|
...l,
|
|
928
928
|
ref: v,
|
|
929
929
|
style: { pointerEvents: "none" },
|
|
930
|
-
children: Qt(d.value) ? /* @__PURE__ */
|
|
930
|
+
children: Qt(d.value) ? /* @__PURE__ */ n.jsx(n.Fragment, { children: c }) : a
|
|
931
931
|
}
|
|
932
932
|
);
|
|
933
933
|
}
|
|
934
934
|
);
|
|
935
935
|
At.displayName = Mt;
|
|
936
936
|
var Sn = "SelectIcon", Dt = i.forwardRef(
|
|
937
|
-
(e,
|
|
937
|
+
(e, o) => {
|
|
938
938
|
const { __scopeSelect: t, children: r, ...s } = e;
|
|
939
|
-
return /* @__PURE__ */
|
|
939
|
+
return /* @__PURE__ */ n.jsx(N.span, { "aria-hidden": !0, ...s, ref: o, children: r || "▼" });
|
|
940
940
|
}
|
|
941
941
|
);
|
|
942
942
|
Dt.displayName = Sn;
|
|
943
|
-
var
|
|
944
|
-
Ot.displayName =
|
|
943
|
+
var Cn = "SelectPortal", Ot = (e) => /* @__PURE__ */ n.jsx(io, { asChild: !0, ...e });
|
|
944
|
+
Ot.displayName = Cn;
|
|
945
945
|
var se = "SelectContent", Lt = i.forwardRef(
|
|
946
|
-
(e,
|
|
946
|
+
(e, o) => {
|
|
947
947
|
const t = J(se, e.__scopeSelect), [r, s] = i.useState();
|
|
948
948
|
if (Z(() => {
|
|
949
949
|
s(new DocumentFragment());
|
|
950
950
|
}, []), !t.open) {
|
|
951
951
|
const a = r;
|
|
952
952
|
return a ? Qe.createPortal(
|
|
953
|
-
/* @__PURE__ */
|
|
953
|
+
/* @__PURE__ */ n.jsx(Ft, { scope: e.__scopeSelect, children: /* @__PURE__ */ n.jsx(Se.Slot, { scope: e.__scopeSelect, children: /* @__PURE__ */ n.jsx("div", { children: e.children }) }) }),
|
|
954
954
|
a
|
|
955
955
|
) : null;
|
|
956
956
|
}
|
|
957
|
-
return /* @__PURE__ */
|
|
957
|
+
return /* @__PURE__ */ n.jsx(Bt, { ...e, ref: o });
|
|
958
958
|
}
|
|
959
959
|
);
|
|
960
960
|
Lt.displayName = se;
|
|
961
|
-
var G = 10, [Ft, Q] = ie(se),
|
|
962
|
-
(e,
|
|
961
|
+
var G = 10, [Ft, Q] = ie(se), wn = "SelectContentImpl", yn = Pe("SelectContent.RemoveScroll"), Bt = i.forwardRef(
|
|
962
|
+
(e, o) => {
|
|
963
963
|
const {
|
|
964
964
|
__scopeSelect: t,
|
|
965
965
|
position: r = "item-aligned",
|
|
@@ -973,26 +973,26 @@ var G = 10, [Ft, Q] = ie(se), yn = "SelectContentImpl", Cn = Pe("SelectContent.R
|
|
|
973
973
|
align: p,
|
|
974
974
|
alignOffset: m,
|
|
975
975
|
arrowPadding: v,
|
|
976
|
-
collisionBoundary:
|
|
976
|
+
collisionBoundary: C,
|
|
977
977
|
collisionPadding: S,
|
|
978
978
|
sticky: b,
|
|
979
979
|
hideWhenDetached: u,
|
|
980
980
|
avoidCollisions: f,
|
|
981
981
|
//
|
|
982
982
|
...x
|
|
983
|
-
} = e, h = J(se, t), [g,
|
|
983
|
+
} = e, h = J(se, t), [g, y] = i.useState(null), [j, O] = i.useState(null), k = A(o, (w) => y(w)), [R, $] = i.useState(null), [H, L] = i.useState(
|
|
984
984
|
null
|
|
985
|
-
), B =
|
|
985
|
+
), B = Ce(t), [U, z] = i.useState(!1), V = i.useRef(!1);
|
|
986
986
|
i.useEffect(() => {
|
|
987
987
|
if (g) return uo(g);
|
|
988
988
|
}, [g]), po();
|
|
989
989
|
const T = i.useCallback(
|
|
990
|
-
(
|
|
991
|
-
const [P, ...F] = B().map((M) => M.ref.current), [_] = F.slice(-1),
|
|
992
|
-
for (const M of
|
|
993
|
-
if (M ===
|
|
990
|
+
(w) => {
|
|
991
|
+
const [P, ...F] = B().map((M) => M.ref.current), [_] = F.slice(-1), E = document.activeElement;
|
|
992
|
+
for (const M of w)
|
|
993
|
+
if (M === E || (M?.scrollIntoView({ block: "nearest" }), M === P && j && (j.scrollTop = 0), M === _ && j && (j.scrollTop = j.scrollHeight), M?.focus(), document.activeElement !== E)) return;
|
|
994
994
|
},
|
|
995
|
-
[B,
|
|
995
|
+
[B, j]
|
|
996
996
|
), K = i.useCallback(
|
|
997
997
|
() => T([R, g]),
|
|
998
998
|
[T, R, g]
|
|
@@ -1003,38 +1003,38 @@ var G = 10, [Ft, Q] = ie(se), yn = "SelectContentImpl", Cn = Pe("SelectContent.R
|
|
|
1003
1003
|
const { onOpenChange: W, triggerPointerDownPosRef: Y } = h;
|
|
1004
1004
|
i.useEffect(() => {
|
|
1005
1005
|
if (g) {
|
|
1006
|
-
let
|
|
1006
|
+
let w = { x: 0, y: 0 };
|
|
1007
1007
|
const P = (_) => {
|
|
1008
|
-
|
|
1008
|
+
w = {
|
|
1009
1009
|
x: Math.abs(Math.round(_.pageX) - (Y.current?.x ?? 0)),
|
|
1010
1010
|
y: Math.abs(Math.round(_.pageY) - (Y.current?.y ?? 0))
|
|
1011
1011
|
};
|
|
1012
1012
|
}, F = (_) => {
|
|
1013
|
-
|
|
1013
|
+
w.x <= 10 && w.y <= 10 ? _.preventDefault() : g.contains(_.target) || W(!1), document.removeEventListener("pointermove", P), Y.current = null;
|
|
1014
1014
|
};
|
|
1015
1015
|
return Y.current !== null && (document.addEventListener("pointermove", P), document.addEventListener("pointerup", F, { capture: !0, once: !0 })), () => {
|
|
1016
1016
|
document.removeEventListener("pointermove", P), document.removeEventListener("pointerup", F, { capture: !0 });
|
|
1017
1017
|
};
|
|
1018
1018
|
}
|
|
1019
1019
|
}, [g, W, Y]), i.useEffect(() => {
|
|
1020
|
-
const
|
|
1021
|
-
return window.addEventListener("blur",
|
|
1022
|
-
window.removeEventListener("blur",
|
|
1020
|
+
const w = () => W(!1);
|
|
1021
|
+
return window.addEventListener("blur", w), window.addEventListener("resize", w), () => {
|
|
1022
|
+
window.removeEventListener("blur", w), window.removeEventListener("resize", w);
|
|
1023
1023
|
};
|
|
1024
1024
|
}, [W]);
|
|
1025
|
-
const [Ie, me] = eo((
|
|
1026
|
-
const P = B().filter((
|
|
1025
|
+
const [Ie, me] = eo((w) => {
|
|
1026
|
+
const P = B().filter((E) => !E.disabled), F = P.find((E) => E.ref.current === document.activeElement), _ = to(P, w, F);
|
|
1027
1027
|
_ && setTimeout(() => _.ref.current.focus());
|
|
1028
1028
|
}), Re = i.useCallback(
|
|
1029
|
-
(
|
|
1029
|
+
(w, P, F) => {
|
|
1030
1030
|
const _ = !V.current && !F;
|
|
1031
|
-
(h.value !== void 0 && h.value === P || _) && ($(
|
|
1031
|
+
(h.value !== void 0 && h.value === P || _) && ($(w), _ && (V.current = !0));
|
|
1032
1032
|
},
|
|
1033
1033
|
[h.value]
|
|
1034
1034
|
), _e = i.useCallback(() => g?.focus(), [g]), ae = i.useCallback(
|
|
1035
|
-
(
|
|
1035
|
+
(w, P, F) => {
|
|
1036
1036
|
const _ = !V.current && !F;
|
|
1037
|
-
(h.value !== void 0 && h.value === P || _) && L(
|
|
1037
|
+
(h.value !== void 0 && h.value === P || _) && L(w);
|
|
1038
1038
|
},
|
|
1039
1039
|
[h.value]
|
|
1040
1040
|
), he = r === "popper" ? Ae : Vt, le = he === Ae ? {
|
|
@@ -1043,18 +1043,18 @@ var G = 10, [Ft, Q] = ie(se), yn = "SelectContentImpl", Cn = Pe("SelectContent.R
|
|
|
1043
1043
|
align: p,
|
|
1044
1044
|
alignOffset: m,
|
|
1045
1045
|
arrowPadding: v,
|
|
1046
|
-
collisionBoundary:
|
|
1046
|
+
collisionBoundary: C,
|
|
1047
1047
|
collisionPadding: S,
|
|
1048
1048
|
sticky: b,
|
|
1049
1049
|
hideWhenDetached: u,
|
|
1050
1050
|
avoidCollisions: f
|
|
1051
1051
|
} : {};
|
|
1052
|
-
return /* @__PURE__ */
|
|
1052
|
+
return /* @__PURE__ */ n.jsx(
|
|
1053
1053
|
Ft,
|
|
1054
1054
|
{
|
|
1055
1055
|
scope: t,
|
|
1056
1056
|
content: g,
|
|
1057
|
-
viewport:
|
|
1057
|
+
viewport: j,
|
|
1058
1058
|
onViewportChange: O,
|
|
1059
1059
|
itemRefCallback: Re,
|
|
1060
1060
|
selectedItem: R,
|
|
@@ -1065,34 +1065,34 @@ var G = 10, [Ft, Q] = ie(se), yn = "SelectContentImpl", Cn = Pe("SelectContent.R
|
|
|
1065
1065
|
position: r,
|
|
1066
1066
|
isPositioned: U,
|
|
1067
1067
|
searchRef: Ie,
|
|
1068
|
-
children: /* @__PURE__ */
|
|
1068
|
+
children: /* @__PURE__ */ n.jsx(fo, { as: yn, allowPinchZoom: !0, children: /* @__PURE__ */ n.jsx(
|
|
1069
1069
|
mo,
|
|
1070
1070
|
{
|
|
1071
1071
|
asChild: !0,
|
|
1072
1072
|
trapped: h.open,
|
|
1073
|
-
onMountAutoFocus: (
|
|
1074
|
-
|
|
1073
|
+
onMountAutoFocus: (w) => {
|
|
1074
|
+
w.preventDefault();
|
|
1075
1075
|
},
|
|
1076
|
-
onUnmountAutoFocus: I(s, (
|
|
1077
|
-
h.trigger?.focus({ preventScroll: !0 }),
|
|
1076
|
+
onUnmountAutoFocus: I(s, (w) => {
|
|
1077
|
+
h.trigger?.focus({ preventScroll: !0 }), w.preventDefault();
|
|
1078
1078
|
}),
|
|
1079
|
-
children: /* @__PURE__ */
|
|
1079
|
+
children: /* @__PURE__ */ n.jsx(
|
|
1080
1080
|
ho,
|
|
1081
1081
|
{
|
|
1082
1082
|
asChild: !0,
|
|
1083
1083
|
disableOutsidePointerEvents: !0,
|
|
1084
1084
|
onEscapeKeyDown: a,
|
|
1085
1085
|
onPointerDownOutside: c,
|
|
1086
|
-
onFocusOutside: (
|
|
1086
|
+
onFocusOutside: (w) => w.preventDefault(),
|
|
1087
1087
|
onDismiss: () => h.onOpenChange(!1),
|
|
1088
|
-
children: /* @__PURE__ */
|
|
1088
|
+
children: /* @__PURE__ */ n.jsx(
|
|
1089
1089
|
he,
|
|
1090
1090
|
{
|
|
1091
1091
|
role: "listbox",
|
|
1092
1092
|
id: h.contentId,
|
|
1093
1093
|
"data-state": h.open ? "open" : "closed",
|
|
1094
1094
|
dir: h.dir,
|
|
1095
|
-
onContextMenu: (
|
|
1095
|
+
onContextMenu: (w) => w.preventDefault(),
|
|
1096
1096
|
...x,
|
|
1097
1097
|
...le,
|
|
1098
1098
|
onPlaced: () => z(!0),
|
|
@@ -1105,15 +1105,15 @@ var G = 10, [Ft, Q] = ie(se), yn = "SelectContentImpl", Cn = Pe("SelectContent.R
|
|
|
1105
1105
|
outline: "none",
|
|
1106
1106
|
...x.style
|
|
1107
1107
|
},
|
|
1108
|
-
onKeyDown: I(x.onKeyDown, (
|
|
1109
|
-
const P =
|
|
1110
|
-
if (
|
|
1111
|
-
let _ = B().filter((
|
|
1112
|
-
if (["ArrowUp", "End"].includes(
|
|
1113
|
-
const
|
|
1108
|
+
onKeyDown: I(x.onKeyDown, (w) => {
|
|
1109
|
+
const P = w.ctrlKey || w.altKey || w.metaKey;
|
|
1110
|
+
if (w.key === "Tab" && w.preventDefault(), !P && w.key.length === 1 && me(w.key), ["ArrowUp", "ArrowDown", "Home", "End"].includes(w.key)) {
|
|
1111
|
+
let _ = B().filter((E) => !E.disabled).map((E) => E.ref.current);
|
|
1112
|
+
if (["ArrowUp", "End"].includes(w.key) && (_ = _.slice().reverse()), ["ArrowUp", "ArrowDown"].includes(w.key)) {
|
|
1113
|
+
const E = w.target, M = _.indexOf(E);
|
|
1114
1114
|
_ = _.slice(M + 1);
|
|
1115
1115
|
}
|
|
1116
|
-
setTimeout(() => T(_)),
|
|
1116
|
+
setTimeout(() => T(_)), w.preventDefault();
|
|
1117
1117
|
}
|
|
1118
1118
|
})
|
|
1119
1119
|
}
|
|
@@ -1126,13 +1126,13 @@ var G = 10, [Ft, Q] = ie(se), yn = "SelectContentImpl", Cn = Pe("SelectContent.R
|
|
|
1126
1126
|
);
|
|
1127
1127
|
}
|
|
1128
1128
|
);
|
|
1129
|
-
Bt.displayName =
|
|
1130
|
-
var In = "SelectItemAlignedPosition", Vt = i.forwardRef((e,
|
|
1131
|
-
const { __scopeSelect: t, onPlaced: r, ...s } = e, a = J(se, t), c = Q(se, t), [l, d] = i.useState(null), [p, m] = i.useState(null), v = A(
|
|
1129
|
+
Bt.displayName = wn;
|
|
1130
|
+
var In = "SelectItemAlignedPosition", Vt = i.forwardRef((e, o) => {
|
|
1131
|
+
const { __scopeSelect: t, onPlaced: r, ...s } = e, a = J(se, t), c = Q(se, t), [l, d] = i.useState(null), [p, m] = i.useState(null), v = A(o, (k) => m(k)), C = Ce(t), S = i.useRef(!1), b = i.useRef(!0), { viewport: u, selectedItem: f, selectedItemText: x, focusSelectedItem: h } = c, g = i.useCallback(() => {
|
|
1132
1132
|
if (a.trigger && a.valueNode && l && p && u && f && x) {
|
|
1133
1133
|
const k = a.trigger.getBoundingClientRect(), R = p.getBoundingClientRect(), $ = a.valueNode.getBoundingClientRect(), H = x.getBoundingClientRect();
|
|
1134
1134
|
if (a.dir !== "rtl") {
|
|
1135
|
-
const
|
|
1135
|
+
const E = H.left - R.left, M = $.left - E, ee = k.left - M, te = k.width + ee, Ne = Math.max(te, R.width), Te = window.innerWidth - G, Ee = Ke(M, [
|
|
1136
1136
|
G,
|
|
1137
1137
|
// Prevents the content from going off the starting edge of the
|
|
1138
1138
|
// viewport. It may still go off the ending edge, but this can be
|
|
@@ -1141,38 +1141,38 @@ var In = "SelectItemAlignedPosition", Vt = i.forwardRef((e, n) => {
|
|
|
1141
1141
|
// https://github.com/radix-ui/primitives/issues/2049
|
|
1142
1142
|
Math.max(G, Te - Ne)
|
|
1143
1143
|
]);
|
|
1144
|
-
l.style.minWidth = te + "px", l.style.left =
|
|
1144
|
+
l.style.minWidth = te + "px", l.style.left = Ee + "px";
|
|
1145
1145
|
} else {
|
|
1146
|
-
const
|
|
1146
|
+
const E = R.right - H.right, M = window.innerWidth - $.right - E, ee = window.innerWidth - k.right - M, te = k.width + ee, Ne = Math.max(te, R.width), Te = window.innerWidth - G, Ee = Ke(M, [
|
|
1147
1147
|
G,
|
|
1148
1148
|
Math.max(G, Te - Ne)
|
|
1149
1149
|
]);
|
|
1150
|
-
l.style.minWidth = te + "px", l.style.right =
|
|
1150
|
+
l.style.minWidth = te + "px", l.style.right = Ee + "px";
|
|
1151
1151
|
}
|
|
1152
|
-
const L =
|
|
1152
|
+
const L = C(), B = window.innerHeight - G * 2, U = u.scrollHeight, z = window.getComputedStyle(p), V = parseInt(z.borderTopWidth, 10), T = parseInt(z.paddingTop, 10), K = parseInt(z.borderBottomWidth, 10), W = parseInt(z.paddingBottom, 10), Y = V + T + U + W + K, Ie = Math.min(f.offsetHeight * 5, Y), me = window.getComputedStyle(u), Re = parseInt(me.paddingTop, 10), _e = parseInt(me.paddingBottom, 10), ae = k.top + k.height / 2 - G, he = B - ae, le = f.offsetHeight / 2, w = f.offsetTop + le, P = V + T + w, F = Y - P;
|
|
1153
1153
|
if (P <= ae) {
|
|
1154
|
-
const
|
|
1154
|
+
const E = L.length > 0 && f === L[L.length - 1].ref.current;
|
|
1155
1155
|
l.style.bottom = "0px";
|
|
1156
1156
|
const M = p.clientHeight - u.offsetTop - u.offsetHeight, ee = Math.max(
|
|
1157
1157
|
he,
|
|
1158
1158
|
le + // viewport might have padding bottom, include it to avoid a scrollable viewport
|
|
1159
|
-
(
|
|
1159
|
+
(E ? _e : 0) + M + K
|
|
1160
1160
|
), te = P + ee;
|
|
1161
1161
|
l.style.height = te + "px";
|
|
1162
1162
|
} else {
|
|
1163
|
-
const
|
|
1163
|
+
const E = L.length > 0 && f === L[0].ref.current;
|
|
1164
1164
|
l.style.top = "0px";
|
|
1165
1165
|
const ee = Math.max(
|
|
1166
1166
|
ae,
|
|
1167
1167
|
V + u.offsetTop + // viewport might have padding top, include it to avoid a scrollable viewport
|
|
1168
|
-
(
|
|
1168
|
+
(E ? Re : 0) + le
|
|
1169
1169
|
) + F;
|
|
1170
1170
|
l.style.height = ee + "px", u.scrollTop = P - ae + u.offsetTop;
|
|
1171
1171
|
}
|
|
1172
1172
|
l.style.margin = `${G}px 0`, l.style.minHeight = Ie + "px", l.style.maxHeight = B + "px", r?.(), requestAnimationFrame(() => S.current = !0);
|
|
1173
1173
|
}
|
|
1174
1174
|
}, [
|
|
1175
|
-
|
|
1175
|
+
C,
|
|
1176
1176
|
a.trigger,
|
|
1177
1177
|
a.valueNode,
|
|
1178
1178
|
l,
|
|
@@ -1184,9 +1184,9 @@ var In = "SelectItemAlignedPosition", Vt = i.forwardRef((e, n) => {
|
|
|
1184
1184
|
r
|
|
1185
1185
|
]);
|
|
1186
1186
|
Z(() => g(), [g]);
|
|
1187
|
-
const [
|
|
1187
|
+
const [y, j] = i.useState();
|
|
1188
1188
|
Z(() => {
|
|
1189
|
-
p &&
|
|
1189
|
+
p && j(window.getComputedStyle(p).zIndex);
|
|
1190
1190
|
}, [p]);
|
|
1191
1191
|
const O = i.useCallback(
|
|
1192
1192
|
(k) => {
|
|
@@ -1194,14 +1194,14 @@ var In = "SelectItemAlignedPosition", Vt = i.forwardRef((e, n) => {
|
|
|
1194
1194
|
},
|
|
1195
1195
|
[g, h]
|
|
1196
1196
|
);
|
|
1197
|
-
return /* @__PURE__ */
|
|
1197
|
+
return /* @__PURE__ */ n.jsx(
|
|
1198
1198
|
_n,
|
|
1199
1199
|
{
|
|
1200
1200
|
scope: t,
|
|
1201
1201
|
contentWrapper: l,
|
|
1202
1202
|
shouldExpandOnScrollRef: S,
|
|
1203
1203
|
onScrollButtonChange: O,
|
|
1204
|
-
children: /* @__PURE__ */
|
|
1204
|
+
children: /* @__PURE__ */ n.jsx(
|
|
1205
1205
|
"div",
|
|
1206
1206
|
{
|
|
1207
1207
|
ref: d,
|
|
@@ -1209,9 +1209,9 @@ var In = "SelectItemAlignedPosition", Vt = i.forwardRef((e, n) => {
|
|
|
1209
1209
|
display: "flex",
|
|
1210
1210
|
flexDirection: "column",
|
|
1211
1211
|
position: "fixed",
|
|
1212
|
-
zIndex:
|
|
1212
|
+
zIndex: y
|
|
1213
1213
|
},
|
|
1214
|
-
children: /* @__PURE__ */
|
|
1214
|
+
children: /* @__PURE__ */ n.jsx(
|
|
1215
1215
|
N.div,
|
|
1216
1216
|
{
|
|
1217
1217
|
...s,
|
|
@@ -1232,19 +1232,19 @@ var In = "SelectItemAlignedPosition", Vt = i.forwardRef((e, n) => {
|
|
|
1232
1232
|
);
|
|
1233
1233
|
});
|
|
1234
1234
|
Vt.displayName = In;
|
|
1235
|
-
var Rn = "SelectPopperPosition", Ae = i.forwardRef((e,
|
|
1235
|
+
var Rn = "SelectPopperPosition", Ae = i.forwardRef((e, o) => {
|
|
1236
1236
|
const {
|
|
1237
1237
|
__scopeSelect: t,
|
|
1238
1238
|
align: r = "start",
|
|
1239
1239
|
collisionPadding: s = G,
|
|
1240
1240
|
...a
|
|
1241
|
-
} = e, c =
|
|
1242
|
-
return /* @__PURE__ */
|
|
1241
|
+
} = e, c = we(t);
|
|
1242
|
+
return /* @__PURE__ */ n.jsx(
|
|
1243
1243
|
vo,
|
|
1244
1244
|
{
|
|
1245
1245
|
...c,
|
|
1246
1246
|
...a,
|
|
1247
|
-
ref:
|
|
1247
|
+
ref: o,
|
|
1248
1248
|
align: r,
|
|
1249
1249
|
collisionPadding: s,
|
|
1250
1250
|
style: {
|
|
@@ -1262,10 +1262,10 @@ var Rn = "SelectPopperPosition", Ae = i.forwardRef((e, n) => {
|
|
|
1262
1262
|
});
|
|
1263
1263
|
Ae.displayName = Rn;
|
|
1264
1264
|
var [_n, ze] = ie(se, {}), De = "SelectViewport", Gt = i.forwardRef(
|
|
1265
|
-
(e,
|
|
1266
|
-
const { __scopeSelect: t, nonce: r, ...s } = e, a = Q(De, t), c = ze(De, t), l = A(
|
|
1267
|
-
return /* @__PURE__ */
|
|
1268
|
-
/* @__PURE__ */
|
|
1265
|
+
(e, o) => {
|
|
1266
|
+
const { __scopeSelect: t, nonce: r, ...s } = e, a = Q(De, t), c = ze(De, t), l = A(o, a.onViewportChange), d = i.useRef(0);
|
|
1267
|
+
return /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
|
|
1268
|
+
/* @__PURE__ */ n.jsx(
|
|
1269
1269
|
"style",
|
|
1270
1270
|
{
|
|
1271
1271
|
dangerouslySetInnerHTML: {
|
|
@@ -1274,7 +1274,7 @@ var [_n, ze] = ie(se, {}), De = "SelectViewport", Gt = i.forwardRef(
|
|
|
1274
1274
|
nonce: r
|
|
1275
1275
|
}
|
|
1276
1276
|
),
|
|
1277
|
-
/* @__PURE__ */
|
|
1277
|
+
/* @__PURE__ */ n.jsx(Se.Slot, { scope: t, children: /* @__PURE__ */ n.jsx(
|
|
1278
1278
|
N.div,
|
|
1279
1279
|
{
|
|
1280
1280
|
"data-radix-select-viewport": "",
|
|
@@ -1295,14 +1295,14 @@ var [_n, ze] = ie(se, {}), De = "SelectViewport", Gt = i.forwardRef(
|
|
|
1295
1295
|
...s.style
|
|
1296
1296
|
},
|
|
1297
1297
|
onScroll: I(s.onScroll, (p) => {
|
|
1298
|
-
const m = p.currentTarget, { contentWrapper: v, shouldExpandOnScrollRef:
|
|
1299
|
-
if (
|
|
1298
|
+
const m = p.currentTarget, { contentWrapper: v, shouldExpandOnScrollRef: C } = c;
|
|
1299
|
+
if (C?.current && v) {
|
|
1300
1300
|
const S = Math.abs(d.current - m.scrollTop);
|
|
1301
1301
|
if (S > 0) {
|
|
1302
1302
|
const b = window.innerHeight - G * 2, u = parseFloat(v.style.minHeight), f = parseFloat(v.style.height), x = Math.max(u, f);
|
|
1303
1303
|
if (x < b) {
|
|
1304
|
-
const h = x + S, g = Math.min(b, h),
|
|
1305
|
-
v.style.height = g + "px", v.style.bottom === "0px" && (m.scrollTop =
|
|
1304
|
+
const h = x + S, g = Math.min(b, h), y = h - g;
|
|
1305
|
+
v.style.height = g + "px", v.style.bottom === "0px" && (m.scrollTop = y > 0 ? y : 0, v.style.justifyContent = "flex-end");
|
|
1306
1306
|
}
|
|
1307
1307
|
}
|
|
1308
1308
|
}
|
|
@@ -1314,30 +1314,30 @@ var [_n, ze] = ie(se, {}), De = "SelectViewport", Gt = i.forwardRef(
|
|
|
1314
1314
|
}
|
|
1315
1315
|
);
|
|
1316
1316
|
Gt.displayName = De;
|
|
1317
|
-
var $t = "SelectGroup", [Nn, Tn] = ie($t),
|
|
1318
|
-
(e,
|
|
1317
|
+
var $t = "SelectGroup", [Nn, Tn] = ie($t), En = i.forwardRef(
|
|
1318
|
+
(e, o) => {
|
|
1319
1319
|
const { __scopeSelect: t, ...r } = e, s = xe();
|
|
1320
|
-
return /* @__PURE__ */
|
|
1320
|
+
return /* @__PURE__ */ n.jsx(Nn, { scope: t, id: s, children: /* @__PURE__ */ n.jsx(N.div, { role: "group", "aria-labelledby": s, ...r, ref: o }) });
|
|
1321
1321
|
}
|
|
1322
1322
|
);
|
|
1323
|
-
|
|
1324
|
-
var Ht = "SelectLabel",
|
|
1325
|
-
(e,
|
|
1323
|
+
En.displayName = $t;
|
|
1324
|
+
var Ht = "SelectLabel", jn = i.forwardRef(
|
|
1325
|
+
(e, o) => {
|
|
1326
1326
|
const { __scopeSelect: t, ...r } = e, s = Tn(Ht, t);
|
|
1327
|
-
return /* @__PURE__ */
|
|
1327
|
+
return /* @__PURE__ */ n.jsx(N.div, { id: s.id, ...r, ref: o });
|
|
1328
1328
|
}
|
|
1329
1329
|
);
|
|
1330
|
-
|
|
1330
|
+
jn.displayName = Ht;
|
|
1331
1331
|
var ve = "SelectItem", [kn, Ut] = ie(ve), zt = i.forwardRef(
|
|
1332
|
-
(e,
|
|
1332
|
+
(e, o) => {
|
|
1333
1333
|
const {
|
|
1334
1334
|
__scopeSelect: t,
|
|
1335
1335
|
value: r,
|
|
1336
1336
|
disabled: s = !1,
|
|
1337
1337
|
textValue: a,
|
|
1338
1338
|
...c
|
|
1339
|
-
} = e, l = J(ve, t), d = Q(ve, t), p = l.value === r, [m, v] = i.useState(a ?? ""), [
|
|
1340
|
-
|
|
1339
|
+
} = e, l = J(ve, t), d = Q(ve, t), p = l.value === r, [m, v] = i.useState(a ?? ""), [C, S] = i.useState(!1), b = A(
|
|
1340
|
+
o,
|
|
1341
1341
|
(h) => d.itemRefCallback?.(h, r, s)
|
|
1342
1342
|
), u = xe(), f = i.useRef("touch"), x = () => {
|
|
1343
1343
|
s || (l.onValueChange(r), l.onOpenChange(!1));
|
|
@@ -1346,7 +1346,7 @@ var ve = "SelectItem", [kn, Ut] = ie(ve), zt = i.forwardRef(
|
|
|
1346
1346
|
throw new Error(
|
|
1347
1347
|
"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."
|
|
1348
1348
|
);
|
|
1349
|
-
return /* @__PURE__ */
|
|
1349
|
+
return /* @__PURE__ */ n.jsx(
|
|
1350
1350
|
kn,
|
|
1351
1351
|
{
|
|
1352
1352
|
scope: t,
|
|
@@ -1357,20 +1357,20 @@ var ve = "SelectItem", [kn, Ut] = ie(ve), zt = i.forwardRef(
|
|
|
1357
1357
|
onItemTextChange: i.useCallback((h) => {
|
|
1358
1358
|
v((g) => g || (h?.textContent ?? "").trim());
|
|
1359
1359
|
}, []),
|
|
1360
|
-
children: /* @__PURE__ */
|
|
1360
|
+
children: /* @__PURE__ */ n.jsx(
|
|
1361
1361
|
Se.ItemSlot,
|
|
1362
1362
|
{
|
|
1363
1363
|
scope: t,
|
|
1364
1364
|
value: r,
|
|
1365
1365
|
disabled: s,
|
|
1366
1366
|
textValue: m,
|
|
1367
|
-
children: /* @__PURE__ */
|
|
1367
|
+
children: /* @__PURE__ */ n.jsx(
|
|
1368
1368
|
N.div,
|
|
1369
1369
|
{
|
|
1370
1370
|
role: "option",
|
|
1371
1371
|
"aria-labelledby": u,
|
|
1372
|
-
"data-highlighted":
|
|
1373
|
-
"aria-selected": p &&
|
|
1372
|
+
"data-highlighted": C ? "" : void 0,
|
|
1373
|
+
"aria-selected": p && C,
|
|
1374
1374
|
"data-state": p ? "checked" : "unchecked",
|
|
1375
1375
|
"aria-disabled": s || void 0,
|
|
1376
1376
|
"data-disabled": s ? "" : void 0,
|
|
@@ -1407,32 +1407,32 @@ var ve = "SelectItem", [kn, Ut] = ie(ve), zt = i.forwardRef(
|
|
|
1407
1407
|
);
|
|
1408
1408
|
zt.displayName = ve;
|
|
1409
1409
|
var de = "SelectItemText", Kt = i.forwardRef(
|
|
1410
|
-
(e,
|
|
1411
|
-
const { __scopeSelect: t, className: r, style: s, ...a } = e, c = J(de, t), l = Q(de, t), d = Ut(de, t), p = bn(de, t), [m, v] = i.useState(null),
|
|
1412
|
-
|
|
1410
|
+
(e, o) => {
|
|
1411
|
+
const { __scopeSelect: t, className: r, style: s, ...a } = e, c = J(de, t), l = Q(de, t), d = Ut(de, t), p = bn(de, t), [m, v] = i.useState(null), C = A(
|
|
1412
|
+
o,
|
|
1413
1413
|
(x) => v(x),
|
|
1414
1414
|
d.onItemTextChange,
|
|
1415
1415
|
(x) => l.itemTextRefCallback?.(x, d.value, d.disabled)
|
|
1416
1416
|
), S = m?.textContent, b = i.useMemo(
|
|
1417
|
-
() => /* @__PURE__ */
|
|
1417
|
+
() => /* @__PURE__ */ n.jsx("option", { value: d.value, disabled: d.disabled, children: S }, d.value),
|
|
1418
1418
|
[d.disabled, d.value, S]
|
|
1419
1419
|
), { onNativeOptionAdd: u, onNativeOptionRemove: f } = p;
|
|
1420
|
-
return Z(() => (u(b), () => f(b)), [u, f, b]), /* @__PURE__ */
|
|
1421
|
-
/* @__PURE__ */
|
|
1420
|
+
return Z(() => (u(b), () => f(b)), [u, f, b]), /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
|
|
1421
|
+
/* @__PURE__ */ n.jsx(N.span, { id: d.textId, ...a, ref: C }),
|
|
1422
1422
|
d.isSelected && c.valueNode && !c.valueNodeHasChildren ? Qe.createPortal(a.children, c.valueNode) : null
|
|
1423
1423
|
] });
|
|
1424
1424
|
}
|
|
1425
1425
|
);
|
|
1426
1426
|
Kt.displayName = de;
|
|
1427
1427
|
var Wt = "SelectItemIndicator", qt = i.forwardRef(
|
|
1428
|
-
(e,
|
|
1428
|
+
(e, o) => {
|
|
1429
1429
|
const { __scopeSelect: t, ...r } = e;
|
|
1430
|
-
return Ut(Wt, t).isSelected ? /* @__PURE__ */
|
|
1430
|
+
return Ut(Wt, t).isSelected ? /* @__PURE__ */ n.jsx(N.span, { "aria-hidden": !0, ...r, ref: o }) : null;
|
|
1431
1431
|
}
|
|
1432
1432
|
);
|
|
1433
1433
|
qt.displayName = Wt;
|
|
1434
|
-
var Oe = "SelectScrollUpButton", Yt = i.forwardRef((e,
|
|
1435
|
-
const t = Q(Oe, e.__scopeSelect), r = ze(Oe, e.__scopeSelect), [s, a] = i.useState(!1), c = A(
|
|
1434
|
+
var Oe = "SelectScrollUpButton", Yt = i.forwardRef((e, o) => {
|
|
1435
|
+
const t = Q(Oe, e.__scopeSelect), r = ze(Oe, e.__scopeSelect), [s, a] = i.useState(!1), c = A(o, r.onScrollButtonChange);
|
|
1436
1436
|
return Z(() => {
|
|
1437
1437
|
if (t.viewport && t.isPositioned) {
|
|
1438
1438
|
let l = function() {
|
|
@@ -1442,7 +1442,7 @@ var Oe = "SelectScrollUpButton", Yt = i.forwardRef((e, n) => {
|
|
|
1442
1442
|
const d = t.viewport;
|
|
1443
1443
|
return l(), d.addEventListener("scroll", l), () => d.removeEventListener("scroll", l);
|
|
1444
1444
|
}
|
|
1445
|
-
}, [t.viewport, t.isPositioned]), s ? /* @__PURE__ */
|
|
1445
|
+
}, [t.viewport, t.isPositioned]), s ? /* @__PURE__ */ n.jsx(
|
|
1446
1446
|
Zt,
|
|
1447
1447
|
{
|
|
1448
1448
|
...e,
|
|
@@ -1455,8 +1455,8 @@ var Oe = "SelectScrollUpButton", Yt = i.forwardRef((e, n) => {
|
|
|
1455
1455
|
) : null;
|
|
1456
1456
|
});
|
|
1457
1457
|
Yt.displayName = Oe;
|
|
1458
|
-
var Le = "SelectScrollDownButton", Xt = i.forwardRef((e,
|
|
1459
|
-
const t = Q(Le, e.__scopeSelect), r = ze(Le, e.__scopeSelect), [s, a] = i.useState(!1), c = A(
|
|
1458
|
+
var Le = "SelectScrollDownButton", Xt = i.forwardRef((e, o) => {
|
|
1459
|
+
const t = Q(Le, e.__scopeSelect), r = ze(Le, e.__scopeSelect), [s, a] = i.useState(!1), c = A(o, r.onScrollButtonChange);
|
|
1460
1460
|
return Z(() => {
|
|
1461
1461
|
if (t.viewport && t.isPositioned) {
|
|
1462
1462
|
let l = function() {
|
|
@@ -1466,7 +1466,7 @@ var Le = "SelectScrollDownButton", Xt = i.forwardRef((e, n) => {
|
|
|
1466
1466
|
const d = t.viewport;
|
|
1467
1467
|
return l(), d.addEventListener("scroll", l), () => d.removeEventListener("scroll", l);
|
|
1468
1468
|
}
|
|
1469
|
-
}, [t.viewport, t.isPositioned]), s ? /* @__PURE__ */
|
|
1469
|
+
}, [t.viewport, t.isPositioned]), s ? /* @__PURE__ */ n.jsx(
|
|
1470
1470
|
Zt,
|
|
1471
1471
|
{
|
|
1472
1472
|
...e,
|
|
@@ -1479,18 +1479,18 @@ var Le = "SelectScrollDownButton", Xt = i.forwardRef((e, n) => {
|
|
|
1479
1479
|
) : null;
|
|
1480
1480
|
});
|
|
1481
1481
|
Xt.displayName = Le;
|
|
1482
|
-
var Zt = i.forwardRef((e,
|
|
1483
|
-
const { __scopeSelect: t, onAutoScroll: r, ...s } = e, a = Q("SelectScrollButton", t), c = i.useRef(null), l =
|
|
1482
|
+
var Zt = i.forwardRef((e, o) => {
|
|
1483
|
+
const { __scopeSelect: t, onAutoScroll: r, ...s } = e, a = Q("SelectScrollButton", t), c = i.useRef(null), l = Ce(t), d = i.useCallback(() => {
|
|
1484
1484
|
c.current !== null && (window.clearInterval(c.current), c.current = null);
|
|
1485
1485
|
}, []);
|
|
1486
1486
|
return i.useEffect(() => () => d(), [d]), Z(() => {
|
|
1487
1487
|
l().find((m) => m.ref.current === document.activeElement)?.ref.current?.scrollIntoView({ block: "nearest" });
|
|
1488
|
-
}, [l]), /* @__PURE__ */
|
|
1488
|
+
}, [l]), /* @__PURE__ */ n.jsx(
|
|
1489
1489
|
N.div,
|
|
1490
1490
|
{
|
|
1491
1491
|
"aria-hidden": !0,
|
|
1492
1492
|
...s,
|
|
1493
|
-
ref:
|
|
1493
|
+
ref: o,
|
|
1494
1494
|
style: { flexShrink: 0, ...s.style },
|
|
1495
1495
|
onPointerDown: I(s.onPointerDown, () => {
|
|
1496
1496
|
c.current === null && (c.current = window.setInterval(r, 50));
|
|
@@ -1504,22 +1504,22 @@ var Zt = i.forwardRef((e, n) => {
|
|
|
1504
1504
|
}
|
|
1505
1505
|
);
|
|
1506
1506
|
}), Pn = "SelectSeparator", Mn = i.forwardRef(
|
|
1507
|
-
(e,
|
|
1507
|
+
(e, o) => {
|
|
1508
1508
|
const { __scopeSelect: t, ...r } = e;
|
|
1509
|
-
return /* @__PURE__ */
|
|
1509
|
+
return /* @__PURE__ */ n.jsx(N.div, { "aria-hidden": !0, ...r, ref: o });
|
|
1510
1510
|
}
|
|
1511
1511
|
);
|
|
1512
1512
|
Mn.displayName = Pn;
|
|
1513
1513
|
var Fe = "SelectArrow", An = i.forwardRef(
|
|
1514
|
-
(e,
|
|
1515
|
-
const { __scopeSelect: t, ...r } = e, s =
|
|
1516
|
-
return a.open && c.position === "popper" ? /* @__PURE__ */
|
|
1514
|
+
(e, o) => {
|
|
1515
|
+
const { __scopeSelect: t, ...r } = e, s = we(t), a = J(Fe, t), c = Q(Fe, t);
|
|
1516
|
+
return a.open && c.position === "popper" ? /* @__PURE__ */ n.jsx(xo, { ...s, ...r, ref: o }) : null;
|
|
1517
1517
|
}
|
|
1518
1518
|
);
|
|
1519
1519
|
An.displayName = Fe;
|
|
1520
1520
|
var Dn = "SelectBubbleInput", Jt = i.forwardRef(
|
|
1521
|
-
({ __scopeSelect: e, value:
|
|
1522
|
-
const s = i.useRef(null), a = A(r, s), c = $e(
|
|
1521
|
+
({ __scopeSelect: e, value: o, ...t }, r) => {
|
|
1522
|
+
const s = i.useRef(null), a = A(r, s), c = $e(o);
|
|
1523
1523
|
return i.useEffect(() => {
|
|
1524
1524
|
const l = s.current;
|
|
1525
1525
|
if (!l) return;
|
|
@@ -1527,17 +1527,17 @@ var Dn = "SelectBubbleInput", Jt = i.forwardRef(
|
|
|
1527
1527
|
d,
|
|
1528
1528
|
"value"
|
|
1529
1529
|
).set;
|
|
1530
|
-
if (c !==
|
|
1530
|
+
if (c !== o && m) {
|
|
1531
1531
|
const v = new Event("change", { bubbles: !0 });
|
|
1532
|
-
m.call(l,
|
|
1532
|
+
m.call(l, o), l.dispatchEvent(v);
|
|
1533
1533
|
}
|
|
1534
|
-
}, [c,
|
|
1534
|
+
}, [c, o]), /* @__PURE__ */ n.jsx(
|
|
1535
1535
|
N.select,
|
|
1536
1536
|
{
|
|
1537
1537
|
...t,
|
|
1538
1538
|
style: { ...lo, ...t.style },
|
|
1539
1539
|
ref: a,
|
|
1540
|
-
defaultValue:
|
|
1540
|
+
defaultValue: o
|
|
1541
1541
|
}
|
|
1542
1542
|
);
|
|
1543
1543
|
}
|
|
@@ -1547,21 +1547,21 @@ function Qt(e) {
|
|
|
1547
1547
|
return e === "" || e === void 0;
|
|
1548
1548
|
}
|
|
1549
1549
|
function eo(e) {
|
|
1550
|
-
const
|
|
1550
|
+
const o = Ze(e), t = i.useRef(""), r = i.useRef(0), s = i.useCallback(
|
|
1551
1551
|
(c) => {
|
|
1552
1552
|
const l = t.current + c;
|
|
1553
|
-
|
|
1553
|
+
o(l), function d(p) {
|
|
1554
1554
|
t.current = p, window.clearTimeout(r.current), p !== "" && (r.current = window.setTimeout(() => d(""), 1e3));
|
|
1555
1555
|
}(l);
|
|
1556
1556
|
},
|
|
1557
|
-
[
|
|
1557
|
+
[o]
|
|
1558
1558
|
), a = i.useCallback(() => {
|
|
1559
1559
|
t.current = "", window.clearTimeout(r.current);
|
|
1560
1560
|
}, []);
|
|
1561
1561
|
return i.useEffect(() => () => window.clearTimeout(r.current), []), [t, s, a];
|
|
1562
1562
|
}
|
|
1563
|
-
function to(e,
|
|
1564
|
-
const s =
|
|
1563
|
+
function to(e, o, t) {
|
|
1564
|
+
const s = o.length > 1 && Array.from(o).every((p) => p === o[0]) ? o[0] : o, a = t ? e.indexOf(t) : -1;
|
|
1565
1565
|
let c = On(e, Math.max(a, 0));
|
|
1566
1566
|
s.length === 1 && (c = c.filter((p) => p !== t));
|
|
1567
1567
|
const d = c.find(
|
|
@@ -1569,42 +1569,42 @@ function to(e, n, t) {
|
|
|
1569
1569
|
);
|
|
1570
1570
|
return d !== t ? d : void 0;
|
|
1571
1571
|
}
|
|
1572
|
-
function On(e,
|
|
1573
|
-
return e.map((t, r) => e[(
|
|
1572
|
+
function On(e, o) {
|
|
1573
|
+
return e.map((t, r) => e[(o + r) % e.length]);
|
|
1574
1574
|
}
|
|
1575
|
-
var Ln =
|
|
1576
|
-
const gr = ({ disabled: e = !1, handleDelete:
|
|
1575
|
+
var Ln = jt, Fn = Pt, Bn = At, Vn = Dt, Gn = Ot, $n = Lt, Hn = Gt, Un = zt, zn = Kt, Kn = qt, Wn = Yt, qn = Xt;
|
|
1576
|
+
const gr = ({ disabled: e = !1, handleDelete: o, ...t }) => /* @__PURE__ */ n.jsx(
|
|
1577
1577
|
Be,
|
|
1578
1578
|
{
|
|
1579
1579
|
disabled: e,
|
|
1580
|
-
icon: /* @__PURE__ */
|
|
1581
|
-
onClick:
|
|
1580
|
+
icon: /* @__PURE__ */ n.jsx(Do, {}),
|
|
1581
|
+
onClick: o,
|
|
1582
1582
|
variant: "outline",
|
|
1583
1583
|
...t,
|
|
1584
1584
|
className: "border-destructive text-destructive hover:bg-destructive hover:text-white",
|
|
1585
1585
|
children: "Delete"
|
|
1586
1586
|
}
|
|
1587
1587
|
), We = {
|
|
1588
|
-
default: { label: "Submit", submittingLabel: "Submitting",
|
|
1589
|
-
submit: { label: "Submit", submittingLabel: "Submitting",
|
|
1590
|
-
save: { label: "Save", submittingLabel: "Saving",
|
|
1591
|
-
send: { label: "Send", submittingLabel: "Sending",
|
|
1588
|
+
default: { label: "Submit", submittingLabel: "Submitting", IconComponent: je },
|
|
1589
|
+
submit: { label: "Submit", submittingLabel: "Submitting", IconComponent: je },
|
|
1590
|
+
save: { label: "Save", submittingLabel: "Saving", IconComponent: Po },
|
|
1591
|
+
send: { label: "Send", submittingLabel: "Sending", IconComponent: je }
|
|
1592
1592
|
}, br = ({
|
|
1593
1593
|
submitting: e = !1,
|
|
1594
|
-
disabled:
|
|
1594
|
+
disabled: o = !1,
|
|
1595
1595
|
submittingIcon: t,
|
|
1596
1596
|
action: r = "default",
|
|
1597
1597
|
noIcon: s = !1,
|
|
1598
1598
|
...a
|
|
1599
1599
|
}) => {
|
|
1600
|
-
const c = t ||
|
|
1600
|
+
const c = t || jo;
|
|
1601
1601
|
if (!We[r])
|
|
1602
1602
|
throw new Error(`Invalid action: ${r}`);
|
|
1603
|
-
const { label: l, submittingLabel: d,
|
|
1604
|
-
return /* @__PURE__ */
|
|
1603
|
+
const { label: l, submittingLabel: d, IconComponent: p } = We[r], m = e ? /* @__PURE__ */ n.jsx(c, { className: "animate-spin" }) : /* @__PURE__ */ n.jsx(p, {});
|
|
1604
|
+
return /* @__PURE__ */ n.jsx(
|
|
1605
1605
|
Be,
|
|
1606
1606
|
{
|
|
1607
|
-
disabled:
|
|
1607
|
+
disabled: o || e,
|
|
1608
1608
|
icon: s ? void 0 : m,
|
|
1609
1609
|
type: "submit",
|
|
1610
1610
|
variant: "primary",
|
|
@@ -1613,8 +1613,8 @@ const gr = ({ disabled: e = !1, handleDelete: n, ...t }) => /* @__PURE__ */ o.js
|
|
|
1613
1613
|
}
|
|
1614
1614
|
);
|
|
1615
1615
|
};
|
|
1616
|
-
function Yn({ className: e, ...
|
|
1617
|
-
return /* @__PURE__ */
|
|
1616
|
+
function Yn({ className: e, ...o }) {
|
|
1617
|
+
return /* @__PURE__ */ n.jsx(
|
|
1618
1618
|
st,
|
|
1619
1619
|
{
|
|
1620
1620
|
className: D(
|
|
@@ -1622,81 +1622,81 @@ function Yn({ className: e, ...n }) {
|
|
|
1622
1622
|
e
|
|
1623
1623
|
),
|
|
1624
1624
|
"data-slot": "checkbox",
|
|
1625
|
-
...
|
|
1626
|
-
children: /* @__PURE__ */
|
|
1625
|
+
...o,
|
|
1626
|
+
children: /* @__PURE__ */ n.jsx(
|
|
1627
1627
|
ct,
|
|
1628
1628
|
{
|
|
1629
1629
|
className: "flex items-center justify-center text-current transition-none",
|
|
1630
1630
|
"data-slot": "checkbox-indicator",
|
|
1631
|
-
children: /* @__PURE__ */
|
|
1631
|
+
children: /* @__PURE__ */ n.jsx(et, { className: "size-3.5" })
|
|
1632
1632
|
}
|
|
1633
1633
|
)
|
|
1634
1634
|
}
|
|
1635
1635
|
);
|
|
1636
1636
|
}
|
|
1637
|
-
const Sr = ({ label: e, name:
|
|
1637
|
+
const Sr = ({ label: e, name: o, value: t, checked: r, onCheckedChange: s }) => {
|
|
1638
1638
|
const [a, c] = qe(r);
|
|
1639
1639
|
ro(() => {
|
|
1640
1640
|
c(r);
|
|
1641
1641
|
}, [r]);
|
|
1642
|
-
let l =
|
|
1643
|
-
const d = t ||
|
|
1642
|
+
let l = o;
|
|
1643
|
+
const d = t || o;
|
|
1644
1644
|
t && (l += `[${t}]`);
|
|
1645
1645
|
const p = (m) => {
|
|
1646
1646
|
c(m), s?.(m);
|
|
1647
1647
|
};
|
|
1648
|
-
return /* @__PURE__ */
|
|
1649
|
-
/* @__PURE__ */
|
|
1648
|
+
return /* @__PURE__ */ n.jsxs(ne, { align: "center", gap: "2", children: [
|
|
1649
|
+
/* @__PURE__ */ n.jsx(
|
|
1650
1650
|
Yn,
|
|
1651
1651
|
{
|
|
1652
1652
|
checked: a,
|
|
1653
1653
|
id: l,
|
|
1654
|
-
name:
|
|
1654
|
+
name: o,
|
|
1655
1655
|
onCheckedChange: p,
|
|
1656
1656
|
value: d
|
|
1657
1657
|
}
|
|
1658
1658
|
),
|
|
1659
|
-
/* @__PURE__ */
|
|
1659
|
+
/* @__PURE__ */ n.jsx(fe, { className: "cursor-pointer", htmlFor: l, children: e })
|
|
1660
1660
|
] });
|
|
1661
|
-
},
|
|
1661
|
+
}, Cr = ({ name: e, label: o, placeholder: t, note: r, className: s, ...a }) => /* @__PURE__ */ n.jsx(
|
|
1662
1662
|
oo,
|
|
1663
1663
|
{
|
|
1664
1664
|
className: D("max-w-[150px]", s),
|
|
1665
|
-
label:
|
|
1665
|
+
label: o,
|
|
1666
1666
|
name: e,
|
|
1667
1667
|
note: r,
|
|
1668
1668
|
placeholder: t,
|
|
1669
1669
|
type: "date",
|
|
1670
1670
|
...a
|
|
1671
1671
|
}
|
|
1672
|
-
),
|
|
1673
|
-
const [a, c] = qe(
|
|
1672
|
+
), wr = ({ onDateSelection: e, initialValue: o, className: t, size: r = "default", error: s }) => {
|
|
1673
|
+
const [a, c] = qe(o), l = (d) => {
|
|
1674
1674
|
c(d), d && e(d);
|
|
1675
1675
|
};
|
|
1676
|
-
return /* @__PURE__ */
|
|
1677
|
-
/* @__PURE__ */
|
|
1678
|
-
/* @__PURE__ */
|
|
1676
|
+
return /* @__PURE__ */ n.jsxs(ne, { direction: "col", gap: "2", children: [
|
|
1677
|
+
/* @__PURE__ */ n.jsxs(go, { children: [
|
|
1678
|
+
/* @__PURE__ */ n.jsx(bo, { asChild: !0, children: /* @__PURE__ */ n.jsxs(
|
|
1679
1679
|
Be,
|
|
1680
1680
|
{
|
|
1681
1681
|
className: D("w-[280px] justify-start text-left font-normal", !a && "text-muted-foreground", t),
|
|
1682
1682
|
size: r,
|
|
1683
1683
|
variant: "outline",
|
|
1684
1684
|
children: [
|
|
1685
|
-
/* @__PURE__ */
|
|
1686
|
-
a ? a.toISOString().split("T")[0] : /* @__PURE__ */
|
|
1685
|
+
/* @__PURE__ */ n.jsx(wo, { className: "mr-2 h-4 w-4" }),
|
|
1686
|
+
a ? a.toISOString().split("T")[0] : /* @__PURE__ */ n.jsx("span", { children: "Select a date" })
|
|
1687
1687
|
]
|
|
1688
1688
|
}
|
|
1689
1689
|
) }),
|
|
1690
|
-
/* @__PURE__ */
|
|
1690
|
+
/* @__PURE__ */ n.jsx(So, { className: "w-auto p-0", children: /* @__PURE__ */ n.jsx(no, { autoFocus: !0, mode: "single", onSelect: l, selected: a }) })
|
|
1691
1691
|
] }),
|
|
1692
|
-
s && /* @__PURE__ */
|
|
1692
|
+
s && /* @__PURE__ */ n.jsx(ye, { message: s })
|
|
1693
1693
|
] });
|
|
1694
|
-
},
|
|
1695
|
-
e && /* @__PURE__ */
|
|
1696
|
-
/* @__PURE__ */
|
|
1694
|
+
}, ye = ({ message: e }) => /* @__PURE__ */ n.jsx(Ve, { size: "xs", variant: "destructive", children: e }), Xn = ({ label: e, labelFor: o, className: t = "", labelClassName: r = "", children: s }) => /* @__PURE__ */ n.jsxs(ne, { direction: "col", gap: "2", children: [
|
|
1695
|
+
e && /* @__PURE__ */ n.jsx(fe, { className: r, htmlFor: o, children: e }),
|
|
1696
|
+
/* @__PURE__ */ n.jsx(ne, { className: `rounded-md border border-input bg-card p-2 shadow-xs ${t}`, gapY: "1", children: s })
|
|
1697
1697
|
] });
|
|
1698
|
-
function Zn({ className: e, ...
|
|
1699
|
-
return /* @__PURE__ */
|
|
1698
|
+
function Zn({ className: e, ...o }) {
|
|
1699
|
+
return /* @__PURE__ */ n.jsx(
|
|
1700
1700
|
en,
|
|
1701
1701
|
{
|
|
1702
1702
|
className: D(
|
|
@@ -1704,21 +1704,21 @@ function Zn({ className: e, ...n }) {
|
|
|
1704
1704
|
e
|
|
1705
1705
|
),
|
|
1706
1706
|
"data-slot": "label",
|
|
1707
|
-
...
|
|
1707
|
+
...o
|
|
1708
1708
|
}
|
|
1709
1709
|
);
|
|
1710
1710
|
}
|
|
1711
|
-
const fe = ({ htmlFor: e, value:
|
|
1711
|
+
const fe = ({ htmlFor: e, value: o, children: t, className: r = "", ...s }) => /* @__PURE__ */ n.jsx(
|
|
1712
1712
|
Zn,
|
|
1713
1713
|
{
|
|
1714
1714
|
className: D("font-display font-normal text-base text-foreground", r),
|
|
1715
1715
|
htmlFor: e,
|
|
1716
1716
|
...s,
|
|
1717
|
-
children:
|
|
1717
|
+
children: o || t
|
|
1718
1718
|
}
|
|
1719
1719
|
);
|
|
1720
|
-
function Jn({ className: e, type:
|
|
1721
|
-
return /* @__PURE__ */
|
|
1720
|
+
function Jn({ className: e, type: o, ...t }) {
|
|
1721
|
+
return /* @__PURE__ */ n.jsx(
|
|
1722
1722
|
"input",
|
|
1723
1723
|
{
|
|
1724
1724
|
className: D(
|
|
@@ -1728,14 +1728,14 @@ function Jn({ className: e, type: n, ...t }) {
|
|
|
1728
1728
|
e
|
|
1729
1729
|
),
|
|
1730
1730
|
"data-slot": "input",
|
|
1731
|
-
type:
|
|
1731
|
+
type: o,
|
|
1732
1732
|
...t
|
|
1733
1733
|
}
|
|
1734
1734
|
);
|
|
1735
1735
|
}
|
|
1736
1736
|
const oo = ({
|
|
1737
1737
|
name: e,
|
|
1738
|
-
type:
|
|
1738
|
+
type: o = "text",
|
|
1739
1739
|
placeholder: t,
|
|
1740
1740
|
label: r,
|
|
1741
1741
|
labelOrientation: s = "top",
|
|
@@ -1743,9 +1743,9 @@ const oo = ({
|
|
|
1743
1743
|
className: c,
|
|
1744
1744
|
error: l,
|
|
1745
1745
|
...d
|
|
1746
|
-
}) => /* @__PURE__ */
|
|
1747
|
-
r && /* @__PURE__ */
|
|
1748
|
-
/* @__PURE__ */
|
|
1746
|
+
}) => /* @__PURE__ */ n.jsxs(ne, { className: "w-full", direction: s === "left" ? "row" : "col", gap: "2", children: [
|
|
1747
|
+
r && /* @__PURE__ */ n.jsx(fe, { className: s === "left" ? "text-nowrap" : "", htmlFor: e, children: r }),
|
|
1748
|
+
/* @__PURE__ */ n.jsx(
|
|
1749
1749
|
Jn,
|
|
1750
1750
|
{
|
|
1751
1751
|
"aria-label": r || e,
|
|
@@ -1753,26 +1753,26 @@ const oo = ({
|
|
|
1753
1753
|
id: e,
|
|
1754
1754
|
name: e,
|
|
1755
1755
|
placeholder: t,
|
|
1756
|
-
type:
|
|
1756
|
+
type: o,
|
|
1757
1757
|
...d
|
|
1758
1758
|
}
|
|
1759
1759
|
),
|
|
1760
|
-
a && /* @__PURE__ */
|
|
1761
|
-
l && /* @__PURE__ */
|
|
1762
|
-
] }),
|
|
1760
|
+
a && /* @__PURE__ */ n.jsx(Ve, { size: "sm", variant: "muted", children: a }),
|
|
1761
|
+
l && /* @__PURE__ */ n.jsx(ye, { message: l })
|
|
1762
|
+
] }), yr = ({
|
|
1763
1763
|
name: e,
|
|
1764
|
-
label:
|
|
1764
|
+
label: o,
|
|
1765
1765
|
placeholder: t,
|
|
1766
1766
|
note: r,
|
|
1767
1767
|
// Default to two decimal places for currency and general decimal values
|
|
1768
1768
|
step: s = ".01",
|
|
1769
1769
|
className: a,
|
|
1770
1770
|
...c
|
|
1771
|
-
}) => /* @__PURE__ */
|
|
1771
|
+
}) => /* @__PURE__ */ n.jsx(
|
|
1772
1772
|
oo,
|
|
1773
1773
|
{
|
|
1774
1774
|
className: a,
|
|
1775
|
-
label:
|
|
1775
|
+
label: o,
|
|
1776
1776
|
name: e,
|
|
1777
1777
|
note: r,
|
|
1778
1778
|
placeholder: t,
|
|
@@ -1781,11 +1781,11 @@ const oo = ({
|
|
|
1781
1781
|
...c
|
|
1782
1782
|
}
|
|
1783
1783
|
);
|
|
1784
|
-
function Qn({ className: e, ...
|
|
1785
|
-
return /* @__PURE__ */
|
|
1784
|
+
function Qn({ className: e, ...o }) {
|
|
1785
|
+
return /* @__PURE__ */ n.jsx(un, { className: D("grid gap-3", e), "data-slot": "radio-group", ...o });
|
|
1786
1786
|
}
|
|
1787
|
-
function er({ className: e, ...
|
|
1788
|
-
return /* @__PURE__ */
|
|
1787
|
+
function er({ className: e, ...o }) {
|
|
1788
|
+
return /* @__PURE__ */ n.jsx(
|
|
1789
1789
|
pn,
|
|
1790
1790
|
{
|
|
1791
1791
|
className: D(
|
|
@@ -1793,61 +1793,61 @@ function er({ className: e, ...n }) {
|
|
|
1793
1793
|
e
|
|
1794
1794
|
),
|
|
1795
1795
|
"data-slot": "radio-group-item",
|
|
1796
|
-
...
|
|
1797
|
-
children: /* @__PURE__ */
|
|
1796
|
+
...o,
|
|
1797
|
+
children: /* @__PURE__ */ n.jsx(
|
|
1798
1798
|
fn,
|
|
1799
1799
|
{
|
|
1800
1800
|
className: "relative flex items-center justify-center",
|
|
1801
1801
|
"data-slot": "radio-group-indicator",
|
|
1802
|
-
children: /* @__PURE__ */
|
|
1802
|
+
children: /* @__PURE__ */ n.jsx(To, { className: "-translate-x-1/2 -translate-y-1/2 absolute top-1/2 left-1/2 size-2 fill-primary" })
|
|
1803
1803
|
}
|
|
1804
1804
|
)
|
|
1805
1805
|
}
|
|
1806
1806
|
);
|
|
1807
1807
|
}
|
|
1808
|
-
const Ir = ({ label: e, name:
|
|
1809
|
-
/* @__PURE__ */
|
|
1810
|
-
/* @__PURE__ */
|
|
1811
|
-
/* @__PURE__ */
|
|
1808
|
+
const Ir = ({ label: e, name: o, options: t, value: r, onChange: s, error: a }) => /* @__PURE__ */ n.jsxs(Xn, { className: "flex flex-col gap-4 px-2 py-1", label: e, labelFor: o, children: [
|
|
1809
|
+
/* @__PURE__ */ n.jsx(Qn, { className: "w-full", name: o, onValueChange: s, value: r, children: /* @__PURE__ */ n.jsx(so, { cols: "2", children: t.map((c, l) => /* @__PURE__ */ n.jsxs(ne, { align: "center", gap: "2", justify: "start", children: [
|
|
1810
|
+
/* @__PURE__ */ n.jsx(er, { id: c.value, value: c.value }),
|
|
1811
|
+
/* @__PURE__ */ n.jsx(fe, { htmlFor: c.value, children: c.label })
|
|
1812
1812
|
] }, l)) }) }),
|
|
1813
|
-
a && /* @__PURE__ */
|
|
1813
|
+
a && /* @__PURE__ */ n.jsx(ye, { message: a })
|
|
1814
1814
|
] });
|
|
1815
1815
|
function tr({ ...e }) {
|
|
1816
|
-
return /* @__PURE__ */
|
|
1816
|
+
return /* @__PURE__ */ n.jsx(Ln, { "data-slot": "select", ...e });
|
|
1817
1817
|
}
|
|
1818
1818
|
function or({ ...e }) {
|
|
1819
|
-
return /* @__PURE__ */
|
|
1819
|
+
return /* @__PURE__ */ n.jsx(Bn, { "data-slot": "select-value", ...e });
|
|
1820
1820
|
}
|
|
1821
1821
|
function nr({
|
|
1822
1822
|
className: e,
|
|
1823
|
-
size:
|
|
1823
|
+
size: o = "default",
|
|
1824
1824
|
children: t,
|
|
1825
1825
|
...r
|
|
1826
1826
|
}) {
|
|
1827
|
-
return /* @__PURE__ */
|
|
1827
|
+
return /* @__PURE__ */ n.jsxs(
|
|
1828
1828
|
Fn,
|
|
1829
1829
|
{
|
|
1830
1830
|
className: D(
|
|
1831
1831
|
"flex w-fit items-center justify-between gap-2 whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-xs outline-none transition-[color,box-shadow] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[size=default]:h-9 data-[size=sm]:h-8 data-[placeholder]:text-muted-foreground *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 dark:bg-input/30 dark:aria-invalid:ring-destructive/40 dark:hover:bg-input/50 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
1832
1832
|
e
|
|
1833
1833
|
),
|
|
1834
|
-
"data-size":
|
|
1834
|
+
"data-size": o,
|
|
1835
1835
|
"data-slot": "select-trigger",
|
|
1836
1836
|
...r,
|
|
1837
1837
|
children: [
|
|
1838
1838
|
t,
|
|
1839
|
-
/* @__PURE__ */
|
|
1839
|
+
/* @__PURE__ */ n.jsx(Vn, { asChild: !0, children: /* @__PURE__ */ n.jsx(tt, { className: "size-4 opacity-50" }) })
|
|
1840
1840
|
]
|
|
1841
1841
|
}
|
|
1842
1842
|
);
|
|
1843
1843
|
}
|
|
1844
1844
|
function rr({
|
|
1845
1845
|
className: e,
|
|
1846
|
-
children:
|
|
1846
|
+
children: o,
|
|
1847
1847
|
position: t = "popper",
|
|
1848
1848
|
...r
|
|
1849
1849
|
}) {
|
|
1850
|
-
return /* @__PURE__ */
|
|
1850
|
+
return /* @__PURE__ */ n.jsx(Gn, { children: /* @__PURE__ */ n.jsxs(
|
|
1851
1851
|
$n,
|
|
1852
1852
|
{
|
|
1853
1853
|
className: D(
|
|
@@ -1859,24 +1859,24 @@ function rr({
|
|
|
1859
1859
|
position: t,
|
|
1860
1860
|
...r,
|
|
1861
1861
|
children: [
|
|
1862
|
-
/* @__PURE__ */
|
|
1863
|
-
/* @__PURE__ */
|
|
1862
|
+
/* @__PURE__ */ n.jsx(ar, {}),
|
|
1863
|
+
/* @__PURE__ */ n.jsx(
|
|
1864
1864
|
Hn,
|
|
1865
1865
|
{
|
|
1866
1866
|
className: D(
|
|
1867
1867
|
"p-1",
|
|
1868
1868
|
t === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"
|
|
1869
1869
|
),
|
|
1870
|
-
children:
|
|
1870
|
+
children: o
|
|
1871
1871
|
}
|
|
1872
1872
|
),
|
|
1873
|
-
/* @__PURE__ */
|
|
1873
|
+
/* @__PURE__ */ n.jsx(cr, {})
|
|
1874
1874
|
]
|
|
1875
1875
|
}
|
|
1876
1876
|
) });
|
|
1877
1877
|
}
|
|
1878
|
-
function sr({ className: e, children:
|
|
1879
|
-
return /* @__PURE__ */
|
|
1878
|
+
function sr({ className: e, children: o, ...t }) {
|
|
1879
|
+
return /* @__PURE__ */ n.jsxs(
|
|
1880
1880
|
Un,
|
|
1881
1881
|
{
|
|
1882
1882
|
className: D(
|
|
@@ -1886,40 +1886,40 @@ function sr({ className: e, children: n, ...t }) {
|
|
|
1886
1886
|
"data-slot": "select-item",
|
|
1887
1887
|
...t,
|
|
1888
1888
|
children: [
|
|
1889
|
-
/* @__PURE__ */
|
|
1890
|
-
/* @__PURE__ */
|
|
1889
|
+
/* @__PURE__ */ n.jsx("span", { className: "absolute right-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ n.jsx(Kn, { children: /* @__PURE__ */ n.jsx(et, { className: "size-4" }) }) }),
|
|
1890
|
+
/* @__PURE__ */ n.jsx(zn, { children: o })
|
|
1891
1891
|
]
|
|
1892
1892
|
}
|
|
1893
1893
|
);
|
|
1894
1894
|
}
|
|
1895
|
-
function ar({ className: e, ...
|
|
1896
|
-
return /* @__PURE__ */
|
|
1895
|
+
function ar({ className: e, ...o }) {
|
|
1896
|
+
return /* @__PURE__ */ n.jsx(
|
|
1897
1897
|
Wn,
|
|
1898
1898
|
{
|
|
1899
1899
|
className: D("flex cursor-default items-center justify-center py-1", e),
|
|
1900
1900
|
"data-slot": "select-scroll-up-button",
|
|
1901
|
-
...
|
|
1902
|
-
children: /* @__PURE__ */
|
|
1901
|
+
...o,
|
|
1902
|
+
children: /* @__PURE__ */ n.jsx(_o, { className: "size-4" })
|
|
1903
1903
|
}
|
|
1904
1904
|
);
|
|
1905
1905
|
}
|
|
1906
1906
|
function cr({
|
|
1907
1907
|
className: e,
|
|
1908
|
-
...
|
|
1908
|
+
...o
|
|
1909
1909
|
}) {
|
|
1910
|
-
return /* @__PURE__ */
|
|
1910
|
+
return /* @__PURE__ */ n.jsx(
|
|
1911
1911
|
qn,
|
|
1912
1912
|
{
|
|
1913
1913
|
className: D("flex cursor-default items-center justify-center py-1", e),
|
|
1914
1914
|
"data-slot": "select-scroll-down-button",
|
|
1915
|
-
...
|
|
1916
|
-
children: /* @__PURE__ */
|
|
1915
|
+
...o,
|
|
1916
|
+
children: /* @__PURE__ */ n.jsx(tt, { className: "size-4" })
|
|
1917
1917
|
}
|
|
1918
1918
|
);
|
|
1919
1919
|
}
|
|
1920
1920
|
const Rr = ({
|
|
1921
1921
|
name: e,
|
|
1922
|
-
defaultValue:
|
|
1922
|
+
defaultValue: o,
|
|
1923
1923
|
options: t,
|
|
1924
1924
|
label: r,
|
|
1925
1925
|
placeholder: s,
|
|
@@ -1929,36 +1929,36 @@ const Rr = ({
|
|
|
1929
1929
|
onValueChange: d,
|
|
1930
1930
|
error: p,
|
|
1931
1931
|
...m
|
|
1932
|
-
}) => /* @__PURE__ */
|
|
1933
|
-
r && /* @__PURE__ */
|
|
1934
|
-
/* @__PURE__ */
|
|
1932
|
+
}) => /* @__PURE__ */ n.jsxs(ne, { className: "w-full", direction: "col", gap: "2", children: [
|
|
1933
|
+
r && /* @__PURE__ */ n.jsx(fe, { htmlFor: e, children: r }),
|
|
1934
|
+
/* @__PURE__ */ n.jsxs(
|
|
1935
1935
|
tr,
|
|
1936
1936
|
{
|
|
1937
|
-
defaultValue:
|
|
1937
|
+
defaultValue: o,
|
|
1938
1938
|
name: e,
|
|
1939
1939
|
onValueChange: d,
|
|
1940
1940
|
value: l,
|
|
1941
1941
|
...m,
|
|
1942
1942
|
children: [
|
|
1943
|
-
/* @__PURE__ */
|
|
1944
|
-
/* @__PURE__ */
|
|
1943
|
+
/* @__PURE__ */ n.jsx(nr, { className: D("min-w-[180px]", c), "data-testid": `select-input-${e}`, children: /* @__PURE__ */ n.jsx(or, { placeholder: s }) }),
|
|
1944
|
+
/* @__PURE__ */ n.jsx(rr, { children: t.map(({ value: v, label: C }) => /* @__PURE__ */ n.jsx(sr, { value: v, children: C }, `option-${v}`)) })
|
|
1945
1945
|
]
|
|
1946
1946
|
}
|
|
1947
1947
|
),
|
|
1948
|
-
a && /* @__PURE__ */
|
|
1949
|
-
p && /* @__PURE__ */
|
|
1948
|
+
a && /* @__PURE__ */ n.jsx(Ve, { size: "sm", variant: "muted", children: a }),
|
|
1949
|
+
p && /* @__PURE__ */ n.jsx(ye, { message: p })
|
|
1950
1950
|
] });
|
|
1951
1951
|
export {
|
|
1952
1952
|
Sr as C,
|
|
1953
1953
|
gr as D,
|
|
1954
|
-
|
|
1954
|
+
ye as I,
|
|
1955
1955
|
fe as L,
|
|
1956
|
-
|
|
1956
|
+
yr as N,
|
|
1957
1957
|
Ir as R,
|
|
1958
1958
|
br as S,
|
|
1959
1959
|
oo as T,
|
|
1960
|
-
|
|
1961
|
-
|
|
1960
|
+
Cr as a,
|
|
1961
|
+
wr as b,
|
|
1962
1962
|
Xn as c,
|
|
1963
1963
|
Rr as d,
|
|
1964
1964
|
pt as e,
|