@still-forest/canopy 0.39.2 → 0.39.3
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/chunks/{Textarea-Dgp0ZtX9.js → Textarea-1yOGilko.js} +297 -296
- package/dist/forms.d.ts +2 -1
- package/dist/forms.js +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -2
- package/package.json +1 -1
|
@@ -6,7 +6,7 @@ import { F as ne, G as dn } from "./Layout-CvVv48kM.js";
|
|
|
6
6
|
import { T as Ae } from "./Heading-DjVutKs1.js";
|
|
7
7
|
import { L as un } from "./Loader-B_h7e46-.js";
|
|
8
8
|
import { d as ve, j as dt, e as te, f as N, h as _, u as De, c as pe, w as yt, g as Ct, x as Oe, l as It, m as Rt, n as kt, o as Et, p as pn, A as fn, i as oe, q as mn, V as hn, y as vn, z as xn, B as gn, F as bn, s as wn, t as Sn, r as yn, k as jt, R as Cn, P as In, O as Rn, C as kn } from "./index-CA-6Q-v_.js";
|
|
9
|
-
import { c as
|
|
9
|
+
import { c as T } from "./index-CRiPKpXj.js";
|
|
10
10
|
import * as Nt from "react-dom";
|
|
11
11
|
/**
|
|
12
12
|
* @license lucide-react v0.544.0 - ISC
|
|
@@ -155,16 +155,16 @@ var Jn = l.forwardRef((e, r) => {
|
|
|
155
155
|
dir: i,
|
|
156
156
|
currentTabStopId: a,
|
|
157
157
|
defaultCurrentTabStopId: c,
|
|
158
|
-
onCurrentTabStopIdChange:
|
|
159
|
-
onEntryFocus:
|
|
158
|
+
onCurrentTabStopIdChange: d,
|
|
159
|
+
onEntryFocus: u,
|
|
160
160
|
preventScrollOnEntryFocus: p = !1,
|
|
161
161
|
...f
|
|
162
162
|
} = e, x = l.useRef(null), g = V(r, x), w = De(i), [m, v] = pe({
|
|
163
163
|
prop: a,
|
|
164
164
|
defaultProp: c ?? null,
|
|
165
|
-
onChange:
|
|
165
|
+
onChange: d,
|
|
166
166
|
caller: ke
|
|
167
|
-
}), [b, S] = l.useState(!1), y = yt(
|
|
167
|
+
}), [b, S] = l.useState(!1), y = yt(u), R = _t(t), D = l.useRef(!1), [P, j] = l.useState(0);
|
|
168
168
|
return l.useEffect(() => {
|
|
169
169
|
const L = x.current;
|
|
170
170
|
if (L)
|
|
@@ -228,7 +228,7 @@ var Jn = l.forwardRef((e, r) => {
|
|
|
228
228
|
tabStopId: i,
|
|
229
229
|
children: a,
|
|
230
230
|
...c
|
|
231
|
-
} = e,
|
|
231
|
+
} = e, d = te(), u = i || d, p = Zn(Mt, t), f = p.currentTabStopId === u, x = _t(t), { onFocusableItemAdd: g, onFocusableItemRemove: w, currentTabStopId: m } = p;
|
|
232
232
|
return l.useEffect(() => {
|
|
233
233
|
if (n)
|
|
234
234
|
return g(), () => w();
|
|
@@ -236,7 +236,7 @@ var Jn = l.forwardRef((e, r) => {
|
|
|
236
236
|
Qe.ItemSlot,
|
|
237
237
|
{
|
|
238
238
|
scope: t,
|
|
239
|
-
id:
|
|
239
|
+
id: u,
|
|
240
240
|
focusable: n,
|
|
241
241
|
active: o,
|
|
242
242
|
children: /* @__PURE__ */ s.jsx(
|
|
@@ -247,9 +247,9 @@ var Jn = l.forwardRef((e, r) => {
|
|
|
247
247
|
...c,
|
|
248
248
|
ref: r,
|
|
249
249
|
onMouseDown: _(e.onMouseDown, (v) => {
|
|
250
|
-
n ? p.onItemFocus(
|
|
250
|
+
n ? p.onItemFocus(u) : v.preventDefault();
|
|
251
251
|
}),
|
|
252
|
-
onFocus: _(e.onFocus, () => p.onItemFocus(
|
|
252
|
+
onFocus: _(e.onFocus, () => p.onItemFocus(u)),
|
|
253
253
|
onKeyDown: _(e.onKeyDown, (v) => {
|
|
254
254
|
if (v.key === "Tab" && v.shiftKey) {
|
|
255
255
|
p.onItemShiftTab();
|
|
@@ -330,11 +330,11 @@ const _s = ({ disabled: e = !1, handleDelete: r, ...t }) => /* @__PURE__ */ s.js
|
|
|
330
330
|
submittingLabel: i,
|
|
331
331
|
icon: a,
|
|
332
332
|
noIcon: c = !1,
|
|
333
|
-
...
|
|
333
|
+
...d
|
|
334
334
|
}) => {
|
|
335
335
|
if (!xt[n])
|
|
336
336
|
throw new Error(`Invalid action: ${n}`);
|
|
337
|
-
const
|
|
337
|
+
const u = xt[n], p = o || u.label, f = i || u.submittingLabel, x = a || u.IconComponent, g = e ? /* @__PURE__ */ s.jsx(un, { icon: t }) : /* @__PURE__ */ s.jsx(x, {});
|
|
338
338
|
return /* @__PURE__ */ s.jsx(
|
|
339
339
|
Te,
|
|
340
340
|
{
|
|
@@ -342,7 +342,7 @@ const _s = ({ disabled: e = !1, handleDelete: r, ...t }) => /* @__PURE__ */ s.js
|
|
|
342
342
|
icon: c ? void 0 : g,
|
|
343
343
|
type: "submit",
|
|
344
344
|
variant: "primary",
|
|
345
|
-
...
|
|
345
|
+
...d,
|
|
346
346
|
children: e ? f : p
|
|
347
347
|
}
|
|
348
348
|
);
|
|
@@ -361,15 +361,15 @@ function io(e) {
|
|
|
361
361
|
disabled: i,
|
|
362
362
|
form: a,
|
|
363
363
|
name: c,
|
|
364
|
-
onCheckedChange:
|
|
365
|
-
required:
|
|
364
|
+
onCheckedChange: d,
|
|
365
|
+
required: u,
|
|
366
366
|
value: p = "on",
|
|
367
367
|
// @ts-expect-error
|
|
368
368
|
internal_do_not_use_render: f
|
|
369
369
|
} = e, [x, g] = pe({
|
|
370
370
|
prop: t,
|
|
371
371
|
defaultProp: o ?? !1,
|
|
372
|
-
onChange:
|
|
372
|
+
onChange: d,
|
|
373
373
|
caller: Fe
|
|
374
374
|
}), [w, m] = l.useState(null), [v, b] = l.useState(null), S = l.useRef(!1), y = w ? !!a || !!w.closest("form") : (
|
|
375
375
|
// We set this to true by default so that events bubble to forms without JS (SSR)
|
|
@@ -384,7 +384,7 @@ function io(e) {
|
|
|
384
384
|
form: a,
|
|
385
385
|
value: p,
|
|
386
386
|
hasConsumerStoppedPropagationRef: S,
|
|
387
|
-
required:
|
|
387
|
+
required: u,
|
|
388
388
|
defaultChecked: re(o) ? !1 : o,
|
|
389
389
|
isFormControl: y,
|
|
390
390
|
bubbleInput: v,
|
|
@@ -405,14 +405,14 @@ var Ot = "CheckboxTrigger", Ft = l.forwardRef(
|
|
|
405
405
|
control: i,
|
|
406
406
|
value: a,
|
|
407
407
|
disabled: c,
|
|
408
|
-
checked:
|
|
409
|
-
required:
|
|
408
|
+
checked: d,
|
|
409
|
+
required: u,
|
|
410
410
|
setControl: p,
|
|
411
411
|
setChecked: f,
|
|
412
412
|
hasConsumerStoppedPropagationRef: x,
|
|
413
413
|
isFormControl: g,
|
|
414
414
|
bubbleInput: w
|
|
415
|
-
} = pt(Ot, e), m = V(o, p), v = l.useRef(
|
|
415
|
+
} = pt(Ot, e), m = V(o, p), v = l.useRef(d);
|
|
416
416
|
return l.useEffect(() => {
|
|
417
417
|
const b = i?.form;
|
|
418
418
|
if (b) {
|
|
@@ -424,9 +424,9 @@ var Ot = "CheckboxTrigger", Ft = l.forwardRef(
|
|
|
424
424
|
{
|
|
425
425
|
type: "button",
|
|
426
426
|
role: "checkbox",
|
|
427
|
-
"aria-checked": re(
|
|
428
|
-
"aria-required":
|
|
429
|
-
"data-state": Ht(
|
|
427
|
+
"aria-checked": re(d) ? "mixed" : d,
|
|
428
|
+
"aria-required": u,
|
|
429
|
+
"data-state": Ht(d),
|
|
430
430
|
"data-disabled": c ? "" : void 0,
|
|
431
431
|
disabled: c,
|
|
432
432
|
value: a,
|
|
@@ -452,8 +452,8 @@ var Lt = l.forwardRef(
|
|
|
452
452
|
defaultChecked: i,
|
|
453
453
|
required: a,
|
|
454
454
|
disabled: c,
|
|
455
|
-
value:
|
|
456
|
-
onCheckedChange:
|
|
455
|
+
value: d,
|
|
456
|
+
onCheckedChange: u,
|
|
457
457
|
form: p,
|
|
458
458
|
...f
|
|
459
459
|
} = e;
|
|
@@ -465,10 +465,10 @@ var Lt = l.forwardRef(
|
|
|
465
465
|
defaultChecked: i,
|
|
466
466
|
disabled: c,
|
|
467
467
|
required: a,
|
|
468
|
-
onCheckedChange:
|
|
468
|
+
onCheckedChange: u,
|
|
469
469
|
name: n,
|
|
470
470
|
form: p,
|
|
471
|
-
value:
|
|
471
|
+
value: d,
|
|
472
472
|
internal_do_not_use_render: ({ isFormControl: x }) => /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
|
|
473
473
|
/* @__PURE__ */ s.jsx(
|
|
474
474
|
Ft,
|
|
@@ -520,8 +520,8 @@ var Vt = "CheckboxBubbleInput", Kt = l.forwardRef(
|
|
|
520
520
|
checked: i,
|
|
521
521
|
defaultChecked: a,
|
|
522
522
|
required: c,
|
|
523
|
-
disabled:
|
|
524
|
-
name:
|
|
523
|
+
disabled: d,
|
|
524
|
+
name: u,
|
|
525
525
|
value: p,
|
|
526
526
|
form: f,
|
|
527
527
|
bubbleInput: x,
|
|
@@ -547,8 +547,8 @@ var Vt = "CheckboxBubbleInput", Kt = l.forwardRef(
|
|
|
547
547
|
"aria-hidden": !0,
|
|
548
548
|
defaultChecked: a ?? b.current,
|
|
549
549
|
required: c,
|
|
550
|
-
disabled:
|
|
551
|
-
name:
|
|
550
|
+
disabled: d,
|
|
551
|
+
name: u,
|
|
552
552
|
value: p,
|
|
553
553
|
form: f,
|
|
554
554
|
...r,
|
|
@@ -584,7 +584,7 @@ function co({ className: e, ...r }) {
|
|
|
584
584
|
return /* @__PURE__ */ s.jsx(
|
|
585
585
|
Lt,
|
|
586
586
|
{
|
|
587
|
-
className:
|
|
587
|
+
className: T(
|
|
588
588
|
"peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",
|
|
589
589
|
e
|
|
590
590
|
),
|
|
@@ -607,9 +607,9 @@ const Ms = ({ label: e, name: r, value: t, checked: n, onCheckedChange: o }) =>
|
|
|
607
607
|
a(n);
|
|
608
608
|
}, [n]);
|
|
609
609
|
let c = r;
|
|
610
|
-
const
|
|
610
|
+
const d = t || r;
|
|
611
611
|
t && (c += `[${t}]`);
|
|
612
|
-
const
|
|
612
|
+
const u = (p) => {
|
|
613
613
|
a(p), o?.(p);
|
|
614
614
|
};
|
|
615
615
|
return /* @__PURE__ */ s.jsxs(ne, { align: "center", gap: "2", children: [
|
|
@@ -619,8 +619,8 @@ const Ms = ({ label: e, name: r, value: t, checked: n, onCheckedChange: o }) =>
|
|
|
619
619
|
checked: i,
|
|
620
620
|
id: c,
|
|
621
621
|
name: r,
|
|
622
|
-
onCheckedChange:
|
|
623
|
-
value:
|
|
622
|
+
onCheckedChange: u,
|
|
623
|
+
value: d
|
|
624
624
|
}
|
|
625
625
|
),
|
|
626
626
|
/* @__PURE__ */ s.jsx(ae, { className: "cursor-pointer", htmlFor: c, children: e })
|
|
@@ -631,8 +631,8 @@ const Ms = ({ label: e, name: r, value: t, checked: n, onCheckedChange: o }) =>
|
|
|
631
631
|
a.current && clearTimeout(a.current);
|
|
632
632
|
}, []);
|
|
633
633
|
const c = () => {
|
|
634
|
-
const
|
|
635
|
-
|
|
634
|
+
const d = navigator.clipboard?.writeText;
|
|
635
|
+
d && (i(!0), d.call(navigator.clipboard, e).then(() => {
|
|
636
636
|
a.current && clearTimeout(a.current), a.current = setTimeout(() => {
|
|
637
637
|
i(!1), a.current = null;
|
|
638
638
|
}, 2e3);
|
|
@@ -643,7 +643,7 @@ const Ms = ({ label: e, name: r, value: t, checked: n, onCheckedChange: o }) =>
|
|
|
643
643
|
return /* @__PURE__ */ s.jsx(
|
|
644
644
|
Te,
|
|
645
645
|
{
|
|
646
|
-
className:
|
|
646
|
+
className: T(
|
|
647
647
|
{
|
|
648
648
|
"w-[88px]": t === "xs",
|
|
649
649
|
"w-[96px]": t === "sm",
|
|
@@ -665,7 +665,7 @@ const Ms = ({ label: e, name: r, value: t, checked: n, onCheckedChange: o }) =>
|
|
|
665
665
|
}, Ds = ({ name: e, label: r, placeholder: t, note: n, className: o, size: i = "md", ...a }) => /* @__PURE__ */ s.jsx(
|
|
666
666
|
Gt,
|
|
667
667
|
{
|
|
668
|
-
className:
|
|
668
|
+
className: T(
|
|
669
669
|
i === "xs" && "max-w-[140px] md:max-w-[135px]",
|
|
670
670
|
i === "sm" && "max-w-[150px] md:max-w-[140px]",
|
|
671
671
|
i === "md" && "max-w-[170px] md:max-w-[150px]",
|
|
@@ -682,15 +682,15 @@ const Ms = ({ label: e, name: r, value: t, checked: n, onCheckedChange: o }) =>
|
|
|
682
682
|
...a
|
|
683
683
|
}
|
|
684
684
|
), Os = ({ onDateSelection: e, initialValue: r, className: t, size: n = "default", error: o }) => {
|
|
685
|
-
const [i, a] = Me(r), c = (
|
|
686
|
-
a(
|
|
685
|
+
const [i, a] = Me(r), c = (d) => {
|
|
686
|
+
a(d), d && e(d);
|
|
687
687
|
};
|
|
688
688
|
return /* @__PURE__ */ s.jsxs(ne, { direction: "col", gap: "2", children: [
|
|
689
689
|
/* @__PURE__ */ s.jsxs(It, { children: [
|
|
690
690
|
/* @__PURE__ */ s.jsx(Rt, { asChild: !0, children: /* @__PURE__ */ s.jsxs(
|
|
691
691
|
Te,
|
|
692
692
|
{
|
|
693
|
-
className:
|
|
693
|
+
className: T("w-[280px] justify-start text-left font-normal", !i && "text-muted-foreground", t),
|
|
694
694
|
size: n,
|
|
695
695
|
variant: "outline",
|
|
696
696
|
children: [
|
|
@@ -723,7 +723,7 @@ function mo({ className: e, ...r }) {
|
|
|
723
723
|
return /* @__PURE__ */ s.jsx(
|
|
724
724
|
fo,
|
|
725
725
|
{
|
|
726
|
-
className:
|
|
726
|
+
className: T(
|
|
727
727
|
"flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",
|
|
728
728
|
e
|
|
729
729
|
),
|
|
@@ -735,7 +735,7 @@ function mo({ className: e, ...r }) {
|
|
|
735
735
|
const ae = ({ htmlFor: e, value: r, children: t, size: n = "md", className: o = "", ...i }) => /* @__PURE__ */ s.jsx(
|
|
736
736
|
mo,
|
|
737
737
|
{
|
|
738
|
-
className:
|
|
738
|
+
className: T(
|
|
739
739
|
"font-display font-normal text-foreground",
|
|
740
740
|
{
|
|
741
741
|
"text-xs": n === "xs",
|
|
@@ -759,10 +759,10 @@ const ae = ({ htmlFor: e, value: r, children: t, size: n = "md", className: o =
|
|
|
759
759
|
note: i,
|
|
760
760
|
size: a = "md",
|
|
761
761
|
className: c,
|
|
762
|
-
error:
|
|
763
|
-
...
|
|
762
|
+
error: d,
|
|
763
|
+
...u
|
|
764
764
|
}) => {
|
|
765
|
-
const p =
|
|
765
|
+
const p = T(
|
|
766
766
|
"flex w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 shadow-xs outline-none",
|
|
767
767
|
"transition-[color,box-shadow] selection:bg-primary selection:text-primary-foreground file:inline-flex ",
|
|
768
768
|
"file:h-7 file:border-0 file:bg-transparent file:font-medium file:text-foreground file:text-sm",
|
|
@@ -788,11 +788,11 @@ const ae = ({ htmlFor: e, value: r, children: t, size: n = "md", className: o =
|
|
|
788
788
|
name: e,
|
|
789
789
|
placeholder: t,
|
|
790
790
|
type: r,
|
|
791
|
-
...
|
|
791
|
+
...u
|
|
792
792
|
}
|
|
793
793
|
),
|
|
794
794
|
i && /* @__PURE__ */ s.jsx(Ae, { size: "sm", variant: "muted", children: i }),
|
|
795
|
-
|
|
795
|
+
d && /* @__PURE__ */ s.jsx(je, { message: d })
|
|
796
796
|
] });
|
|
797
797
|
}, Fs = ({
|
|
798
798
|
name: e,
|
|
@@ -825,10 +825,10 @@ var ft = "Radio", [ho, zt] = ve(ft), [vo, xo] = ho(ft), Wt = l.forwardRef(
|
|
|
825
825
|
required: i,
|
|
826
826
|
disabled: a,
|
|
827
827
|
value: c = "on",
|
|
828
|
-
onCheck:
|
|
829
|
-
form:
|
|
828
|
+
onCheck: d,
|
|
829
|
+
form: u,
|
|
830
830
|
...p
|
|
831
|
-
} = e, [f, x] = l.useState(null), g = V(r, (v) => x(v)), w = l.useRef(!1), m = f ?
|
|
831
|
+
} = e, [f, x] = l.useState(null), g = V(r, (v) => x(v)), w = l.useRef(!1), m = f ? u || !!f.closest("form") : !0;
|
|
832
832
|
return /* @__PURE__ */ s.jsxs(vo, { scope: t, checked: o, disabled: a, children: [
|
|
833
833
|
/* @__PURE__ */ s.jsx(
|
|
834
834
|
N.button,
|
|
@@ -843,7 +843,7 @@ var ft = "Radio", [ho, zt] = ve(ft), [vo, xo] = ho(ft), Wt = l.forwardRef(
|
|
|
843
843
|
...p,
|
|
844
844
|
ref: g,
|
|
845
845
|
onClick: _(e.onClick, (v) => {
|
|
846
|
-
o ||
|
|
846
|
+
o || d?.(), m && (w.current = v.isPropagationStopped(), w.current || v.stopPropagation());
|
|
847
847
|
})
|
|
848
848
|
}
|
|
849
849
|
),
|
|
@@ -857,7 +857,7 @@ var ft = "Radio", [ho, zt] = ve(ft), [vo, xo] = ho(ft), Wt = l.forwardRef(
|
|
|
857
857
|
checked: o,
|
|
858
858
|
required: i,
|
|
859
859
|
disabled: a,
|
|
860
|
-
form:
|
|
860
|
+
form: u,
|
|
861
861
|
style: { transform: "translateX(-100%)" }
|
|
862
862
|
}
|
|
863
863
|
)
|
|
@@ -888,7 +888,7 @@ var go = "RadioBubbleInput", Xt = l.forwardRef(
|
|
|
888
888
|
bubbles: n = !0,
|
|
889
889
|
...o
|
|
890
890
|
}, i) => {
|
|
891
|
-
const a = l.useRef(null), c = V(a, i),
|
|
891
|
+
const a = l.useRef(null), c = V(a, i), d = Ee(t), u = Oe(r);
|
|
892
892
|
return l.useEffect(() => {
|
|
893
893
|
const p = a.current;
|
|
894
894
|
if (!p) return;
|
|
@@ -896,11 +896,11 @@ var go = "RadioBubbleInput", Xt = l.forwardRef(
|
|
|
896
896
|
f,
|
|
897
897
|
"checked"
|
|
898
898
|
).set;
|
|
899
|
-
if (
|
|
899
|
+
if (d !== t && g) {
|
|
900
900
|
const w = new Event("click", { bubbles: n });
|
|
901
901
|
g.call(p, t), p.dispatchEvent(w);
|
|
902
902
|
}
|
|
903
|
-
}, [
|
|
903
|
+
}, [d, t, n]), /* @__PURE__ */ s.jsx(
|
|
904
904
|
N.input,
|
|
905
905
|
{
|
|
906
906
|
type: "radio",
|
|
@@ -911,7 +911,7 @@ var go = "RadioBubbleInput", Xt = l.forwardRef(
|
|
|
911
911
|
ref: c,
|
|
912
912
|
style: {
|
|
913
913
|
...o.style,
|
|
914
|
-
...
|
|
914
|
+
...u,
|
|
915
915
|
position: "absolute",
|
|
916
916
|
pointerEvents: "none",
|
|
917
917
|
opacity: 0,
|
|
@@ -937,12 +937,12 @@ var bo = ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"], Le = "RadioGroup",
|
|
|
937
937
|
value: i,
|
|
938
938
|
required: a = !1,
|
|
939
939
|
disabled: c = !1,
|
|
940
|
-
orientation:
|
|
941
|
-
dir:
|
|
940
|
+
orientation: d,
|
|
941
|
+
dir: u,
|
|
942
942
|
loop: p = !0,
|
|
943
943
|
onValueChange: f,
|
|
944
944
|
...x
|
|
945
|
-
} = e, g = Jt(t), w = De(
|
|
945
|
+
} = e, g = Jt(t), w = De(u), [m, v] = pe({
|
|
946
946
|
prop: i,
|
|
947
947
|
defaultProp: o ?? null,
|
|
948
948
|
onChange: f,
|
|
@@ -962,7 +962,7 @@ var bo = ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"], Le = "RadioGroup",
|
|
|
962
962
|
{
|
|
963
963
|
asChild: !0,
|
|
964
964
|
...g,
|
|
965
|
-
orientation:
|
|
965
|
+
orientation: d,
|
|
966
966
|
dir: w,
|
|
967
967
|
loop: p,
|
|
968
968
|
children: /* @__PURE__ */ s.jsx(
|
|
@@ -970,7 +970,7 @@ var bo = ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"], Le = "RadioGroup",
|
|
|
970
970
|
{
|
|
971
971
|
role: "radiogroup",
|
|
972
972
|
"aria-required": a,
|
|
973
|
-
"aria-orientation":
|
|
973
|
+
"aria-orientation": d,
|
|
974
974
|
"data-disabled": c ? "" : void 0,
|
|
975
975
|
dir: w,
|
|
976
976
|
...x,
|
|
@@ -986,7 +986,7 @@ var bo = ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"], Le = "RadioGroup",
|
|
|
986
986
|
er.displayName = Le;
|
|
987
987
|
var tr = "RadioGroupItem", rr = l.forwardRef(
|
|
988
988
|
(e, r) => {
|
|
989
|
-
const { __scopeRadioGroup: t, disabled: n, ...o } = e, i = yo(tr, t), a = i.disabled || n, c = Jt(t),
|
|
989
|
+
const { __scopeRadioGroup: t, disabled: n, ...o } = e, i = yo(tr, t), a = i.disabled || n, c = Jt(t), d = Qt(t), u = l.useRef(null), p = V(r, u), f = i.value === o.value, x = l.useRef(!1);
|
|
990
990
|
return l.useEffect(() => {
|
|
991
991
|
const g = (m) => {
|
|
992
992
|
bo.includes(m.key) && (x.current = !0);
|
|
@@ -1007,7 +1007,7 @@ var tr = "RadioGroupItem", rr = l.forwardRef(
|
|
|
1007
1007
|
disabled: a,
|
|
1008
1008
|
required: i.required,
|
|
1009
1009
|
checked: f,
|
|
1010
|
-
...
|
|
1010
|
+
...d,
|
|
1011
1011
|
...o,
|
|
1012
1012
|
name: i.name,
|
|
1013
1013
|
ref: p,
|
|
@@ -1016,7 +1016,7 @@ var tr = "RadioGroupItem", rr = l.forwardRef(
|
|
|
1016
1016
|
g.key === "Enter" && g.preventDefault();
|
|
1017
1017
|
}),
|
|
1018
1018
|
onFocus: _(o.onFocus, () => {
|
|
1019
|
-
x.current &&
|
|
1019
|
+
x.current && u.current?.click();
|
|
1020
1020
|
})
|
|
1021
1021
|
}
|
|
1022
1022
|
)
|
|
@@ -1034,13 +1034,13 @@ var Co = "RadioGroupIndicator", nr = l.forwardRef(
|
|
|
1034
1034
|
nr.displayName = Co;
|
|
1035
1035
|
var Io = er, Ro = rr, ko = nr;
|
|
1036
1036
|
function Eo({ className: e, ...r }) {
|
|
1037
|
-
return /* @__PURE__ */ s.jsx(Io, { className:
|
|
1037
|
+
return /* @__PURE__ */ s.jsx(Io, { className: T("grid gap-3", e), "data-slot": "radio-group", ...r });
|
|
1038
1038
|
}
|
|
1039
1039
|
function jo({ className: e, ...r }) {
|
|
1040
1040
|
return /* @__PURE__ */ s.jsx(
|
|
1041
1041
|
Ro,
|
|
1042
1042
|
{
|
|
1043
|
-
className:
|
|
1043
|
+
className: T(
|
|
1044
1044
|
"border-input text-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",
|
|
1045
1045
|
e
|
|
1046
1046
|
),
|
|
@@ -1079,14 +1079,14 @@ var No = [" ", "Enter", "ArrowUp", "ArrowDown"], _o = [" ", "Enter"], fe = "Sele
|
|
|
1079
1079
|
onOpenChange: i,
|
|
1080
1080
|
value: a,
|
|
1081
1081
|
defaultValue: c,
|
|
1082
|
-
onValueChange:
|
|
1083
|
-
dir:
|
|
1082
|
+
onValueChange: d,
|
|
1083
|
+
dir: u,
|
|
1084
1084
|
name: p,
|
|
1085
1085
|
autoComplete: f,
|
|
1086
1086
|
disabled: x,
|
|
1087
1087
|
required: g,
|
|
1088
1088
|
form: w
|
|
1089
|
-
} = e, m = Ve(r), [v, b] = l.useState(null), [S, y] = l.useState(null), [R, D] = l.useState(!1), P = De(
|
|
1089
|
+
} = e, m = Ve(r), [v, b] = l.useState(null), [S, y] = l.useState(null), [R, D] = l.useState(!1), P = De(u), [j, L] = pe({
|
|
1090
1090
|
prop: n,
|
|
1091
1091
|
defaultProp: o ?? !1,
|
|
1092
1092
|
onChange: i,
|
|
@@ -1094,7 +1094,7 @@ var No = [" ", "Enter", "ArrowUp", "ArrowDown"], _o = [" ", "Enter"], fe = "Sele
|
|
|
1094
1094
|
}), [Z, z] = pe({
|
|
1095
1095
|
prop: a,
|
|
1096
1096
|
defaultProp: c,
|
|
1097
|
-
onChange:
|
|
1097
|
+
onChange: d,
|
|
1098
1098
|
caller: fe
|
|
1099
1099
|
}), O = l.useRef(null), K = v ? w || !!v.closest("form") : !0, [X, W] = l.useState(/* @__PURE__ */ new Set()), U = Array.from(X).map((F) => F.props.value).join(";");
|
|
1100
1100
|
return /* @__PURE__ */ s.jsx(pn, { ...m, children: /* @__PURE__ */ s.jsxs(
|
|
@@ -1159,8 +1159,8 @@ var No = [" ", "Enter", "ArrowUp", "ArrowDown"], _o = [" ", "Enter"], fe = "Sele
|
|
|
1159
1159
|
or.displayName = fe;
|
|
1160
1160
|
var ar = "SelectTrigger", sr = l.forwardRef(
|
|
1161
1161
|
(e, r) => {
|
|
1162
|
-
const { __scopeSelect: t, disabled: n = !1, ...o } = e, i = Ve(t), a = ie(ar, t), c = a.disabled || n,
|
|
1163
|
-
const v =
|
|
1162
|
+
const { __scopeSelect: t, disabled: n = !1, ...o } = e, i = Ve(t), a = ie(ar, t), c = a.disabled || n, d = V(r, a.onTriggerChange), u = $e(t), p = l.useRef("touch"), [f, x, g] = jr((m) => {
|
|
1163
|
+
const v = u().filter((y) => !y.disabled), b = v.find((y) => y.value === a.value), S = Nr(v, m, b);
|
|
1164
1164
|
S !== void 0 && a.onValueChange(S.value);
|
|
1165
1165
|
}), w = (m) => {
|
|
1166
1166
|
c || (a.onOpenChange(!0), g()), m && (a.triggerPointerDownPosRef.current = {
|
|
@@ -1183,7 +1183,7 @@ var ar = "SelectTrigger", sr = l.forwardRef(
|
|
|
1183
1183
|
"data-disabled": c ? "" : void 0,
|
|
1184
1184
|
"data-placeholder": Er(a.value) ? "" : void 0,
|
|
1185
1185
|
...o,
|
|
1186
|
-
ref:
|
|
1186
|
+
ref: d,
|
|
1187
1187
|
onClick: _(o.onClick, (m) => {
|
|
1188
1188
|
m.currentTarget.focus(), p.current !== "mouse" && w(m);
|
|
1189
1189
|
}),
|
|
@@ -1203,16 +1203,16 @@ var ar = "SelectTrigger", sr = l.forwardRef(
|
|
|
1203
1203
|
sr.displayName = ar;
|
|
1204
1204
|
var ir = "SelectValue", lr = l.forwardRef(
|
|
1205
1205
|
(e, r) => {
|
|
1206
|
-
const { __scopeSelect: t, className: n, style: o, children: i, placeholder: a = "", ...c } = e,
|
|
1206
|
+
const { __scopeSelect: t, className: n, style: o, children: i, placeholder: a = "", ...c } = e, d = ie(ir, t), { onValueNodeHasChildrenChange: u } = d, p = i !== void 0, f = V(r, d.onValueNodeChange);
|
|
1207
1207
|
return oe(() => {
|
|
1208
|
-
|
|
1209
|
-
}, [
|
|
1208
|
+
u(p);
|
|
1209
|
+
}, [u, p]), /* @__PURE__ */ s.jsx(
|
|
1210
1210
|
N.span,
|
|
1211
1211
|
{
|
|
1212
1212
|
...c,
|
|
1213
1213
|
ref: f,
|
|
1214
1214
|
style: { pointerEvents: "none" },
|
|
1215
|
-
children: Er(
|
|
1215
|
+
children: Er(d.value) ? /* @__PURE__ */ s.jsx(s.Fragment, { children: a }) : i
|
|
1216
1216
|
}
|
|
1217
1217
|
);
|
|
1218
1218
|
}
|
|
@@ -1254,8 +1254,8 @@ var Q = 10, [pr, le] = we(me), Fo = "SelectContentImpl", Lo = on("SelectContent.
|
|
|
1254
1254
|
//
|
|
1255
1255
|
// PopperContent props
|
|
1256
1256
|
side: c,
|
|
1257
|
-
sideOffset:
|
|
1258
|
-
align:
|
|
1257
|
+
sideOffset: d,
|
|
1258
|
+
align: u,
|
|
1259
1259
|
alignOffset: p,
|
|
1260
1260
|
arrowPadding: f,
|
|
1261
1261
|
collisionBoundary: x,
|
|
@@ -1273,9 +1273,9 @@ var Q = 10, [pr, le] = we(me), Fo = "SelectContentImpl", Lo = on("SelectContent.
|
|
|
1273
1273
|
}, [y]), xn();
|
|
1274
1274
|
const F = l.useCallback(
|
|
1275
1275
|
(C) => {
|
|
1276
|
-
const [
|
|
1276
|
+
const [A, ...B] = K().map((Y) => Y.ref.current), [$] = B.slice(-1), H = document.activeElement;
|
|
1277
1277
|
for (const Y of C)
|
|
1278
|
-
if (Y === H || (Y?.scrollIntoView({ block: "nearest" }), Y ===
|
|
1278
|
+
if (Y === H || (Y?.scrollIntoView({ block: "nearest" }), Y === A && D && (D.scrollTop = 0), Y === $ && D && (D.scrollTop = D.scrollHeight), Y?.focus(), document.activeElement !== H)) return;
|
|
1279
1279
|
},
|
|
1280
1280
|
[K, D]
|
|
1281
1281
|
), G = l.useCallback(
|
|
@@ -1289,16 +1289,16 @@ var Q = 10, [pr, le] = we(me), Fo = "SelectContentImpl", Lo = on("SelectContent.
|
|
|
1289
1289
|
l.useEffect(() => {
|
|
1290
1290
|
if (y) {
|
|
1291
1291
|
let C = { x: 0, y: 0 };
|
|
1292
|
-
const
|
|
1292
|
+
const A = ($) => {
|
|
1293
1293
|
C = {
|
|
1294
1294
|
x: Math.abs(Math.round($.pageX) - (J.current?.x ?? 0)),
|
|
1295
1295
|
y: Math.abs(Math.round($.pageY) - (J.current?.y ?? 0))
|
|
1296
1296
|
};
|
|
1297
1297
|
}, B = ($) => {
|
|
1298
|
-
C.x <= 10 && C.y <= 10 ? $.preventDefault() : y.contains($.target) || q(!1), document.removeEventListener("pointermove",
|
|
1298
|
+
C.x <= 10 && C.y <= 10 ? $.preventDefault() : y.contains($.target) || q(!1), document.removeEventListener("pointermove", A), J.current = null;
|
|
1299
1299
|
};
|
|
1300
|
-
return J.current !== null && (document.addEventListener("pointermove",
|
|
1301
|
-
document.removeEventListener("pointermove",
|
|
1300
|
+
return J.current !== null && (document.addEventListener("pointermove", A), document.addEventListener("pointerup", B, { capture: !0, once: !0 })), () => {
|
|
1301
|
+
document.removeEventListener("pointermove", A), document.removeEventListener("pointerup", B, { capture: !0 });
|
|
1302
1302
|
};
|
|
1303
1303
|
}
|
|
1304
1304
|
}, [y, q, J]), l.useEffect(() => {
|
|
@@ -1308,24 +1308,24 @@ var Q = 10, [pr, le] = we(me), Fo = "SelectContentImpl", Lo = on("SelectContent.
|
|
|
1308
1308
|
};
|
|
1309
1309
|
}, [q]);
|
|
1310
1310
|
const [xe, ce] = jr((C) => {
|
|
1311
|
-
const
|
|
1311
|
+
const A = K().filter((H) => !H.disabled), B = A.find((H) => H.ref.current === document.activeElement), $ = Nr(A, C, B);
|
|
1312
1312
|
$ && setTimeout(() => $.ref.current.focus());
|
|
1313
1313
|
}), h = l.useCallback(
|
|
1314
|
-
(C,
|
|
1314
|
+
(C, A, B) => {
|
|
1315
1315
|
const $ = !U.current && !B;
|
|
1316
|
-
(S.value !== void 0 && S.value ===
|
|
1316
|
+
(S.value !== void 0 && S.value === A || $) && (Z(C), $ && (U.current = !0));
|
|
1317
1317
|
},
|
|
1318
1318
|
[S.value]
|
|
1319
1319
|
), k = l.useCallback(() => y?.focus(), [y]), E = l.useCallback(
|
|
1320
|
-
(C,
|
|
1320
|
+
(C, A, B) => {
|
|
1321
1321
|
const $ = !U.current && !B;
|
|
1322
|
-
(S.value !== void 0 && S.value ===
|
|
1322
|
+
(S.value !== void 0 && S.value === A || $) && O(C);
|
|
1323
1323
|
},
|
|
1324
1324
|
[S.value]
|
|
1325
|
-
), I = n === "popper" ? et : mr,
|
|
1325
|
+
), I = n === "popper" ? et : mr, M = I === et ? {
|
|
1326
1326
|
side: c,
|
|
1327
|
-
sideOffset:
|
|
1328
|
-
align:
|
|
1327
|
+
sideOffset: d,
|
|
1328
|
+
align: u,
|
|
1329
1329
|
alignOffset: p,
|
|
1330
1330
|
arrowPadding: f,
|
|
1331
1331
|
collisionBoundary: x,
|
|
@@ -1379,7 +1379,7 @@ var Q = 10, [pr, le] = we(me), Fo = "SelectContentImpl", Lo = on("SelectContent.
|
|
|
1379
1379
|
dir: S.dir,
|
|
1380
1380
|
onContextMenu: (C) => C.preventDefault(),
|
|
1381
1381
|
...b,
|
|
1382
|
-
...
|
|
1382
|
+
...M,
|
|
1383
1383
|
onPlaced: () => W(!0),
|
|
1384
1384
|
ref: j,
|
|
1385
1385
|
style: {
|
|
@@ -1391,8 +1391,8 @@ var Q = 10, [pr, le] = we(me), Fo = "SelectContentImpl", Lo = on("SelectContent.
|
|
|
1391
1391
|
...b.style
|
|
1392
1392
|
},
|
|
1393
1393
|
onKeyDown: _(b.onKeyDown, (C) => {
|
|
1394
|
-
const
|
|
1395
|
-
if (C.key === "Tab" && C.preventDefault(), !
|
|
1394
|
+
const A = C.ctrlKey || C.altKey || C.metaKey;
|
|
1395
|
+
if (C.key === "Tab" && C.preventDefault(), !A && C.key.length === 1 && ce(C.key), ["ArrowUp", "ArrowDown", "Home", "End"].includes(C.key)) {
|
|
1396
1396
|
let $ = K().filter((H) => !H.disabled).map((H) => H.ref.current);
|
|
1397
1397
|
if (["ArrowUp", "End"].includes(C.key) && ($ = $.slice().reverse()), ["ArrowUp", "ArrowDown"].includes(C.key)) {
|
|
1398
1398
|
const H = C.target, Y = $.indexOf(H);
|
|
@@ -1413,9 +1413,9 @@ var Q = 10, [pr, le] = we(me), Fo = "SelectContentImpl", Lo = on("SelectContent.
|
|
|
1413
1413
|
);
|
|
1414
1414
|
fr.displayName = Fo;
|
|
1415
1415
|
var Bo = "SelectItemAlignedPosition", mr = l.forwardRef((e, r) => {
|
|
1416
|
-
const { __scopeSelect: t, onPlaced: n, ...o } = e, i = ie(me, t), a = le(me, t), [c,
|
|
1417
|
-
if (i.trigger && i.valueNode && c &&
|
|
1418
|
-
const j = i.trigger.getBoundingClientRect(), L =
|
|
1416
|
+
const { __scopeSelect: t, onPlaced: n, ...o } = e, i = ie(me, t), a = le(me, t), [c, d] = l.useState(null), [u, p] = l.useState(null), f = V(r, (j) => p(j)), x = $e(t), g = l.useRef(!1), w = l.useRef(!0), { viewport: m, selectedItem: v, selectedItemText: b, focusSelectedItem: S } = a, y = l.useCallback(() => {
|
|
1417
|
+
if (i.trigger && i.valueNode && c && u && m && v && b) {
|
|
1418
|
+
const j = i.trigger.getBoundingClientRect(), L = u.getBoundingClientRect(), Z = i.valueNode.getBoundingClientRect(), z = b.getBoundingClientRect();
|
|
1419
1419
|
if (i.dir !== "rtl") {
|
|
1420
1420
|
const H = z.left - L.left, Y = Z.left - H, de = j.left - Y, ue = j.width + de, Ge = Math.max(ue, L.width), ze = window.innerWidth - Q, We = _e(Y, [
|
|
1421
1421
|
Q,
|
|
@@ -1434,15 +1434,15 @@ var Bo = "SelectItemAlignedPosition", mr = l.forwardRef((e, r) => {
|
|
|
1434
1434
|
]);
|
|
1435
1435
|
c.style.minWidth = ue + "px", c.style.right = We + "px";
|
|
1436
1436
|
}
|
|
1437
|
-
const O = x(), K = window.innerHeight - Q * 2, X = m.scrollHeight, W = window.getComputedStyle(
|
|
1438
|
-
if (
|
|
1437
|
+
const O = x(), K = window.innerHeight - Q * 2, X = m.scrollHeight, W = window.getComputedStyle(u), U = parseInt(W.borderTopWidth, 10), F = parseInt(W.paddingTop, 10), G = parseInt(W.borderBottomWidth, 10), q = parseInt(W.paddingBottom, 10), J = U + F + X + q + G, xe = Math.min(v.offsetHeight * 5, J), ce = window.getComputedStyle(m), h = parseInt(ce.paddingTop, 10), k = parseInt(ce.paddingBottom, 10), E = j.top + j.height / 2 - Q, I = K - E, M = v.offsetHeight / 2, C = v.offsetTop + M, A = U + F + C, B = J - A;
|
|
1438
|
+
if (A <= E) {
|
|
1439
1439
|
const H = O.length > 0 && v === O[O.length - 1].ref.current;
|
|
1440
1440
|
c.style.bottom = "0px";
|
|
1441
|
-
const Y =
|
|
1441
|
+
const Y = u.clientHeight - m.offsetTop - m.offsetHeight, de = Math.max(
|
|
1442
1442
|
I,
|
|
1443
|
-
|
|
1443
|
+
M + // viewport might have padding bottom, include it to avoid a scrollable viewport
|
|
1444
1444
|
(H ? k : 0) + Y + G
|
|
1445
|
-
), ue =
|
|
1445
|
+
), ue = A + de;
|
|
1446
1446
|
c.style.height = ue + "px";
|
|
1447
1447
|
} else {
|
|
1448
1448
|
const H = O.length > 0 && v === O[0].ref.current;
|
|
@@ -1450,9 +1450,9 @@ var Bo = "SelectItemAlignedPosition", mr = l.forwardRef((e, r) => {
|
|
|
1450
1450
|
const de = Math.max(
|
|
1451
1451
|
E,
|
|
1452
1452
|
U + m.offsetTop + // viewport might have padding top, include it to avoid a scrollable viewport
|
|
1453
|
-
(H ? h : 0) +
|
|
1453
|
+
(H ? h : 0) + M
|
|
1454
1454
|
) + B;
|
|
1455
|
-
c.style.height = de + "px", m.scrollTop =
|
|
1455
|
+
c.style.height = de + "px", m.scrollTop = A - E + m.offsetTop;
|
|
1456
1456
|
}
|
|
1457
1457
|
c.style.margin = `${Q}px 0`, c.style.minHeight = xe + "px", c.style.maxHeight = K + "px", n?.(), requestAnimationFrame(() => g.current = !0);
|
|
1458
1458
|
}
|
|
@@ -1461,7 +1461,7 @@ var Bo = "SelectItemAlignedPosition", mr = l.forwardRef((e, r) => {
|
|
|
1461
1461
|
i.trigger,
|
|
1462
1462
|
i.valueNode,
|
|
1463
1463
|
c,
|
|
1464
|
-
|
|
1464
|
+
u,
|
|
1465
1465
|
m,
|
|
1466
1466
|
v,
|
|
1467
1467
|
b,
|
|
@@ -1471,8 +1471,8 @@ var Bo = "SelectItemAlignedPosition", mr = l.forwardRef((e, r) => {
|
|
|
1471
1471
|
oe(() => y(), [y]);
|
|
1472
1472
|
const [R, D] = l.useState();
|
|
1473
1473
|
oe(() => {
|
|
1474
|
-
|
|
1475
|
-
}, [
|
|
1474
|
+
u && D(window.getComputedStyle(u).zIndex);
|
|
1475
|
+
}, [u]);
|
|
1476
1476
|
const P = l.useCallback(
|
|
1477
1477
|
(j) => {
|
|
1478
1478
|
j && w.current === !0 && (y(), S?.(), w.current = !1);
|
|
@@ -1489,7 +1489,7 @@ var Bo = "SelectItemAlignedPosition", mr = l.forwardRef((e, r) => {
|
|
|
1489
1489
|
children: /* @__PURE__ */ s.jsx(
|
|
1490
1490
|
"div",
|
|
1491
1491
|
{
|
|
1492
|
-
ref:
|
|
1492
|
+
ref: d,
|
|
1493
1493
|
style: {
|
|
1494
1494
|
display: "flex",
|
|
1495
1495
|
flexDirection: "column",
|
|
@@ -1548,7 +1548,7 @@ var $o = "SelectPopperPosition", et = l.forwardRef((e, r) => {
|
|
|
1548
1548
|
et.displayName = $o;
|
|
1549
1549
|
var [Vo, mt] = we(me, {}), tt = "SelectViewport", hr = l.forwardRef(
|
|
1550
1550
|
(e, r) => {
|
|
1551
|
-
const { __scopeSelect: t, nonce: n, ...o } = e, i = le(tt, t), a = mt(tt, t), c = V(r, i.onViewportChange),
|
|
1551
|
+
const { __scopeSelect: t, nonce: n, ...o } = e, i = le(tt, t), a = mt(tt, t), c = V(r, i.onViewportChange), d = l.useRef(0);
|
|
1552
1552
|
return /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
|
|
1553
1553
|
/* @__PURE__ */ s.jsx(
|
|
1554
1554
|
"style",
|
|
@@ -1579,10 +1579,10 @@ var [Vo, mt] = we(me, {}), tt = "SelectViewport", hr = l.forwardRef(
|
|
|
1579
1579
|
overflow: "hidden auto",
|
|
1580
1580
|
...o.style
|
|
1581
1581
|
},
|
|
1582
|
-
onScroll: _(o.onScroll, (
|
|
1583
|
-
const p =
|
|
1582
|
+
onScroll: _(o.onScroll, (u) => {
|
|
1583
|
+
const p = u.currentTarget, { contentWrapper: f, shouldExpandOnScrollRef: x } = a;
|
|
1584
1584
|
if (x?.current && f) {
|
|
1585
|
-
const g = Math.abs(
|
|
1585
|
+
const g = Math.abs(d.current - p.scrollTop);
|
|
1586
1586
|
if (g > 0) {
|
|
1587
1587
|
const w = window.innerHeight - Q * 2, m = parseFloat(f.style.minHeight), v = parseFloat(f.style.height), b = Math.max(m, v);
|
|
1588
1588
|
if (b < w) {
|
|
@@ -1591,7 +1591,7 @@ var [Vo, mt] = we(me, {}), tt = "SelectViewport", hr = l.forwardRef(
|
|
|
1591
1591
|
}
|
|
1592
1592
|
}
|
|
1593
1593
|
}
|
|
1594
|
-
|
|
1594
|
+
d.current = p.scrollTop;
|
|
1595
1595
|
})
|
|
1596
1596
|
}
|
|
1597
1597
|
) })
|
|
@@ -1621,9 +1621,9 @@ var Pe = "SelectItem", [zo, gr] = we(Pe), br = l.forwardRef(
|
|
|
1621
1621
|
disabled: o = !1,
|
|
1622
1622
|
textValue: i,
|
|
1623
1623
|
...a
|
|
1624
|
-
} = e, c = ie(Pe, t),
|
|
1624
|
+
} = e, c = ie(Pe, t), d = le(Pe, t), u = c.value === n, [p, f] = l.useState(i ?? ""), [x, g] = l.useState(!1), w = V(
|
|
1625
1625
|
r,
|
|
1626
|
-
(S) =>
|
|
1626
|
+
(S) => d.itemRefCallback?.(S, n, o)
|
|
1627
1627
|
), m = te(), v = l.useRef("touch"), b = () => {
|
|
1628
1628
|
o || (c.onValueChange(n), c.onOpenChange(!1));
|
|
1629
1629
|
};
|
|
@@ -1638,7 +1638,7 @@ var Pe = "SelectItem", [zo, gr] = we(Pe), br = l.forwardRef(
|
|
|
1638
1638
|
value: n,
|
|
1639
1639
|
disabled: o,
|
|
1640
1640
|
textId: m,
|
|
1641
|
-
isSelected:
|
|
1641
|
+
isSelected: u,
|
|
1642
1642
|
onItemTextChange: l.useCallback((S) => {
|
|
1643
1643
|
f((y) => y || (S?.textContent ?? "").trim());
|
|
1644
1644
|
}, []),
|
|
@@ -1655,8 +1655,8 @@ var Pe = "SelectItem", [zo, gr] = we(Pe), br = l.forwardRef(
|
|
|
1655
1655
|
role: "option",
|
|
1656
1656
|
"aria-labelledby": m,
|
|
1657
1657
|
"data-highlighted": x ? "" : void 0,
|
|
1658
|
-
"aria-selected":
|
|
1659
|
-
"data-state":
|
|
1658
|
+
"aria-selected": u && x,
|
|
1659
|
+
"data-state": u ? "checked" : "unchecked",
|
|
1660
1660
|
"aria-disabled": o || void 0,
|
|
1661
1661
|
"data-disabled": o ? "" : void 0,
|
|
1662
1662
|
tabIndex: o ? void 0 : -1,
|
|
@@ -1674,13 +1674,13 @@ var Pe = "SelectItem", [zo, gr] = we(Pe), br = l.forwardRef(
|
|
|
1674
1674
|
v.current = S.pointerType;
|
|
1675
1675
|
}),
|
|
1676
1676
|
onPointerMove: _(a.onPointerMove, (S) => {
|
|
1677
|
-
v.current = S.pointerType, o ?
|
|
1677
|
+
v.current = S.pointerType, o ? d.onItemLeave?.() : v.current === "mouse" && S.currentTarget.focus({ preventScroll: !0 });
|
|
1678
1678
|
}),
|
|
1679
1679
|
onPointerLeave: _(a.onPointerLeave, (S) => {
|
|
1680
|
-
S.currentTarget === document.activeElement &&
|
|
1680
|
+
S.currentTarget === document.activeElement && d.onItemLeave?.();
|
|
1681
1681
|
}),
|
|
1682
1682
|
onKeyDown: _(a.onKeyDown, (S) => {
|
|
1683
|
-
|
|
1683
|
+
d.searchRef?.current !== "" && S.key === " " || (_o.includes(S.key) && b(), S.key === " " && S.preventDefault());
|
|
1684
1684
|
})
|
|
1685
1685
|
}
|
|
1686
1686
|
)
|
|
@@ -1693,18 +1693,18 @@ var Pe = "SelectItem", [zo, gr] = we(Pe), br = l.forwardRef(
|
|
|
1693
1693
|
br.displayName = Pe;
|
|
1694
1694
|
var Ie = "SelectItemText", wr = l.forwardRef(
|
|
1695
1695
|
(e, r) => {
|
|
1696
|
-
const { __scopeSelect: t, className: n, style: o, ...i } = e, a = ie(Ie, t), c = le(Ie, t),
|
|
1696
|
+
const { __scopeSelect: t, className: n, style: o, ...i } = e, a = ie(Ie, t), c = le(Ie, t), d = gr(Ie, t), u = Ao(Ie, t), [p, f] = l.useState(null), x = V(
|
|
1697
1697
|
r,
|
|
1698
1698
|
(b) => f(b),
|
|
1699
|
-
|
|
1700
|
-
(b) => c.itemTextRefCallback?.(b,
|
|
1699
|
+
d.onItemTextChange,
|
|
1700
|
+
(b) => c.itemTextRefCallback?.(b, d.value, d.disabled)
|
|
1701
1701
|
), g = p?.textContent, w = l.useMemo(
|
|
1702
|
-
() => /* @__PURE__ */ s.jsx("option", { value:
|
|
1703
|
-
[
|
|
1704
|
-
), { onNativeOptionAdd: m, onNativeOptionRemove: v } =
|
|
1702
|
+
() => /* @__PURE__ */ s.jsx("option", { value: d.value, disabled: d.disabled, children: g }, d.value),
|
|
1703
|
+
[d.disabled, d.value, g]
|
|
1704
|
+
), { onNativeOptionAdd: m, onNativeOptionRemove: v } = u;
|
|
1705
1705
|
return oe(() => (m(w), () => v(w)), [m, v, w]), /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
|
|
1706
|
-
/* @__PURE__ */ s.jsx(N.span, { id:
|
|
1707
|
-
|
|
1706
|
+
/* @__PURE__ */ s.jsx(N.span, { id: d.textId, ...i, ref: x }),
|
|
1707
|
+
d.isSelected && a.valueNode && !a.valueNodeHasChildren ? Nt.createPortal(i.children, a.valueNode) : null
|
|
1708
1708
|
] });
|
|
1709
1709
|
}
|
|
1710
1710
|
);
|
|
@@ -1721,11 +1721,11 @@ var rt = "SelectScrollUpButton", Cr = l.forwardRef((e, r) => {
|
|
|
1721
1721
|
return oe(() => {
|
|
1722
1722
|
if (t.viewport && t.isPositioned) {
|
|
1723
1723
|
let c = function() {
|
|
1724
|
-
const
|
|
1725
|
-
i(
|
|
1724
|
+
const u = d.scrollTop > 0;
|
|
1725
|
+
i(u);
|
|
1726
1726
|
};
|
|
1727
|
-
const
|
|
1728
|
-
return c(),
|
|
1727
|
+
const d = t.viewport;
|
|
1728
|
+
return c(), d.addEventListener("scroll", c), () => d.removeEventListener("scroll", c);
|
|
1729
1729
|
}
|
|
1730
1730
|
}, [t.viewport, t.isPositioned]), o ? /* @__PURE__ */ s.jsx(
|
|
1731
1731
|
Rr,
|
|
@@ -1733,8 +1733,8 @@ var rt = "SelectScrollUpButton", Cr = l.forwardRef((e, r) => {
|
|
|
1733
1733
|
...e,
|
|
1734
1734
|
ref: a,
|
|
1735
1735
|
onAutoScroll: () => {
|
|
1736
|
-
const { viewport: c, selectedItem:
|
|
1737
|
-
c &&
|
|
1736
|
+
const { viewport: c, selectedItem: d } = t;
|
|
1737
|
+
c && d && (c.scrollTop = c.scrollTop - d.offsetHeight);
|
|
1738
1738
|
}
|
|
1739
1739
|
}
|
|
1740
1740
|
) : null;
|
|
@@ -1745,11 +1745,11 @@ var nt = "SelectScrollDownButton", Ir = l.forwardRef((e, r) => {
|
|
|
1745
1745
|
return oe(() => {
|
|
1746
1746
|
if (t.viewport && t.isPositioned) {
|
|
1747
1747
|
let c = function() {
|
|
1748
|
-
const
|
|
1748
|
+
const u = d.scrollHeight - d.clientHeight, p = Math.ceil(d.scrollTop) < u;
|
|
1749
1749
|
i(p);
|
|
1750
1750
|
};
|
|
1751
|
-
const
|
|
1752
|
-
return c(),
|
|
1751
|
+
const d = t.viewport;
|
|
1752
|
+
return c(), d.addEventListener("scroll", c), () => d.removeEventListener("scroll", c);
|
|
1753
1753
|
}
|
|
1754
1754
|
}, [t.viewport, t.isPositioned]), o ? /* @__PURE__ */ s.jsx(
|
|
1755
1755
|
Rr,
|
|
@@ -1757,18 +1757,18 @@ var nt = "SelectScrollDownButton", Ir = l.forwardRef((e, r) => {
|
|
|
1757
1757
|
...e,
|
|
1758
1758
|
ref: a,
|
|
1759
1759
|
onAutoScroll: () => {
|
|
1760
|
-
const { viewport: c, selectedItem:
|
|
1761
|
-
c &&
|
|
1760
|
+
const { viewport: c, selectedItem: d } = t;
|
|
1761
|
+
c && d && (c.scrollTop = c.scrollTop + d.offsetHeight);
|
|
1762
1762
|
}
|
|
1763
1763
|
}
|
|
1764
1764
|
) : null;
|
|
1765
1765
|
});
|
|
1766
1766
|
Ir.displayName = nt;
|
|
1767
1767
|
var Rr = l.forwardRef((e, r) => {
|
|
1768
|
-
const { __scopeSelect: t, onAutoScroll: n, ...o } = e, i = le("SelectScrollButton", t), a = l.useRef(null), c = $e(t),
|
|
1768
|
+
const { __scopeSelect: t, onAutoScroll: n, ...o } = e, i = le("SelectScrollButton", t), a = l.useRef(null), c = $e(t), d = l.useCallback(() => {
|
|
1769
1769
|
a.current !== null && (window.clearInterval(a.current), a.current = null);
|
|
1770
1770
|
}, []);
|
|
1771
|
-
return l.useEffect(() => () =>
|
|
1771
|
+
return l.useEffect(() => () => d(), [d]), oe(() => {
|
|
1772
1772
|
c().find((p) => p.ref.current === document.activeElement)?.ref.current?.scrollIntoView({ block: "nearest" });
|
|
1773
1773
|
}, [c]), /* @__PURE__ */ s.jsx(
|
|
1774
1774
|
N.div,
|
|
@@ -1784,7 +1784,7 @@ var Rr = l.forwardRef((e, r) => {
|
|
|
1784
1784
|
i.onItemLeave?.(), a.current === null && (a.current = window.setInterval(n, 50));
|
|
1785
1785
|
}),
|
|
1786
1786
|
onPointerLeave: _(o.onPointerLeave, () => {
|
|
1787
|
-
|
|
1787
|
+
d();
|
|
1788
1788
|
})
|
|
1789
1789
|
}
|
|
1790
1790
|
);
|
|
@@ -1808,8 +1808,8 @@ var Xo = "SelectBubbleInput", kr = l.forwardRef(
|
|
|
1808
1808
|
return l.useEffect(() => {
|
|
1809
1809
|
const c = o.current;
|
|
1810
1810
|
if (!c) return;
|
|
1811
|
-
const
|
|
1812
|
-
|
|
1811
|
+
const d = window.HTMLSelectElement.prototype, p = Object.getOwnPropertyDescriptor(
|
|
1812
|
+
d,
|
|
1813
1813
|
"value"
|
|
1814
1814
|
).set;
|
|
1815
1815
|
if (a !== r && p) {
|
|
@@ -1835,8 +1835,8 @@ function jr(e) {
|
|
|
1835
1835
|
const r = yt(e), t = l.useRef(""), n = l.useRef(0), o = l.useCallback(
|
|
1836
1836
|
(a) => {
|
|
1837
1837
|
const c = t.current + a;
|
|
1838
|
-
r(c), function u
|
|
1839
|
-
t.current =
|
|
1838
|
+
r(c), function d(u) {
|
|
1839
|
+
t.current = u, window.clearTimeout(n.current), u !== "" && (n.current = window.setTimeout(() => d(""), 1e3));
|
|
1840
1840
|
}(c);
|
|
1841
1841
|
},
|
|
1842
1842
|
[r]
|
|
@@ -1846,13 +1846,13 @@ function jr(e) {
|
|
|
1846
1846
|
return l.useEffect(() => () => window.clearTimeout(n.current), []), [t, o, i];
|
|
1847
1847
|
}
|
|
1848
1848
|
function Nr(e, r, t) {
|
|
1849
|
-
const o = r.length > 1 && Array.from(r).every((
|
|
1849
|
+
const o = r.length > 1 && Array.from(r).every((u) => u === r[0]) ? r[0] : r, i = t ? e.indexOf(t) : -1;
|
|
1850
1850
|
let a = Zo(e, Math.max(i, 0));
|
|
1851
|
-
o.length === 1 && (a = a.filter((
|
|
1852
|
-
const
|
|
1853
|
-
(
|
|
1851
|
+
o.length === 1 && (a = a.filter((u) => u !== t));
|
|
1852
|
+
const d = a.find(
|
|
1853
|
+
(u) => u.textValue.toLowerCase().startsWith(o.toLowerCase())
|
|
1854
1854
|
);
|
|
1855
|
-
return
|
|
1855
|
+
return d !== t ? d : void 0;
|
|
1856
1856
|
}
|
|
1857
1857
|
function Zo(e, r) {
|
|
1858
1858
|
return e.map((t, n) => e[(r + n) % e.length]);
|
|
@@ -1873,7 +1873,7 @@ function pa({
|
|
|
1873
1873
|
return /* @__PURE__ */ s.jsxs(
|
|
1874
1874
|
Qo,
|
|
1875
1875
|
{
|
|
1876
|
-
className:
|
|
1876
|
+
className: T(
|
|
1877
1877
|
"border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
1878
1878
|
e
|
|
1879
1879
|
),
|
|
@@ -1898,7 +1898,7 @@ function fa({
|
|
|
1898
1898
|
na,
|
|
1899
1899
|
{
|
|
1900
1900
|
align: n,
|
|
1901
|
-
className:
|
|
1901
|
+
className: T(
|
|
1902
1902
|
"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",
|
|
1903
1903
|
t === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
|
|
1904
1904
|
e
|
|
@@ -1911,7 +1911,7 @@ function fa({
|
|
|
1911
1911
|
/* @__PURE__ */ s.jsx(
|
|
1912
1912
|
oa,
|
|
1913
1913
|
{
|
|
1914
|
-
className:
|
|
1914
|
+
className: T(
|
|
1915
1915
|
"p-1",
|
|
1916
1916
|
t === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"
|
|
1917
1917
|
),
|
|
@@ -1927,7 +1927,7 @@ function ma({ className: e, children: r, ...t }) {
|
|
|
1927
1927
|
return /* @__PURE__ */ s.jsxs(
|
|
1928
1928
|
aa,
|
|
1929
1929
|
{
|
|
1930
|
-
className:
|
|
1930
|
+
className: T(
|
|
1931
1931
|
"focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",
|
|
1932
1932
|
e
|
|
1933
1933
|
),
|
|
@@ -1944,7 +1944,7 @@ function ha({ className: e, ...r }) {
|
|
|
1944
1944
|
return /* @__PURE__ */ s.jsx(
|
|
1945
1945
|
la,
|
|
1946
1946
|
{
|
|
1947
|
-
className:
|
|
1947
|
+
className: T("flex cursor-default items-center justify-center py-1", e),
|
|
1948
1948
|
"data-slot": "select-scroll-up-button",
|
|
1949
1949
|
...r,
|
|
1950
1950
|
children: /* @__PURE__ */ s.jsx(Pn, { className: "size-4" })
|
|
@@ -1958,7 +1958,7 @@ function va({
|
|
|
1958
1958
|
return /* @__PURE__ */ s.jsx(
|
|
1959
1959
|
ca,
|
|
1960
1960
|
{
|
|
1961
|
-
className:
|
|
1961
|
+
className: T("flex cursor-default items-center justify-center py-1", e),
|
|
1962
1962
|
"data-slot": "select-scroll-down-button",
|
|
1963
1963
|
...r,
|
|
1964
1964
|
children: /* @__PURE__ */ s.jsx(jt, { className: "size-4" })
|
|
@@ -1974,12 +1974,12 @@ const Vs = ({
|
|
|
1974
1974
|
note: i,
|
|
1975
1975
|
className: a,
|
|
1976
1976
|
value: c,
|
|
1977
|
-
onValueChange:
|
|
1978
|
-
error:
|
|
1977
|
+
onValueChange: d,
|
|
1978
|
+
error: u,
|
|
1979
1979
|
size: p = "md",
|
|
1980
1980
|
...f
|
|
1981
1981
|
}) => {
|
|
1982
|
-
const x =
|
|
1982
|
+
const x = T(
|
|
1983
1983
|
"min-w-[180px]",
|
|
1984
1984
|
p === "xs" && "h-7 text-xs md:text-xs",
|
|
1985
1985
|
p === "sm" && "h-8 text-sm md:text-xs",
|
|
@@ -1995,7 +1995,7 @@ const Vs = ({
|
|
|
1995
1995
|
{
|
|
1996
1996
|
defaultValue: r,
|
|
1997
1997
|
name: e,
|
|
1998
|
-
onValueChange:
|
|
1998
|
+
onValueChange: d,
|
|
1999
1999
|
value: c,
|
|
2000
2000
|
...f,
|
|
2001
2001
|
children: [
|
|
@@ -2005,7 +2005,7 @@ const Vs = ({
|
|
|
2005
2005
|
}
|
|
2006
2006
|
),
|
|
2007
2007
|
i && /* @__PURE__ */ s.jsx(Ae, { size: "sm", variant: "muted", children: i }),
|
|
2008
|
-
|
|
2008
|
+
u && /* @__PURE__ */ s.jsx(je, { message: u })
|
|
2009
2009
|
] });
|
|
2010
2010
|
};
|
|
2011
2011
|
var gt = 1, xa = 0.9, ga = 0.8, ba = 0.17, Xe = 0.1, Ze = 0.999, wa = 0.9999, Sa = 0.99, ya = /[\\\/_+.#"@\[\(\{&]/, Ca = /[\\\/_+.#"@\[\(\{&]/g, Ia = /[\s-]/, _r = /[\s-]/g;
|
|
@@ -2013,7 +2013,7 @@ function at(e, r, t, n, o, i, a) {
|
|
|
2013
2013
|
if (i === r.length) return o === e.length ? gt : Sa;
|
|
2014
2014
|
var c = `${o},${i}`;
|
|
2015
2015
|
if (a[c] !== void 0) return a[c];
|
|
2016
|
-
for (var
|
|
2016
|
+
for (var d = n.charAt(i), u = t.indexOf(d, o), p = 0, f, x, g, w; u >= 0; ) f = at(e, r, t, n, u + 1, i + 1, a), f > p && (u === o ? f *= gt : ya.test(e.charAt(u - 1)) ? (f *= ga, g = e.slice(o, u - 1).match(Ca), g && o > 0 && (f *= Math.pow(Ze, g.length))) : Ia.test(e.charAt(u - 1)) ? (f *= xa, w = e.slice(o, u - 1).match(_r), w && o > 0 && (f *= Math.pow(Ze, w.length))) : (f *= ba, o > 0 && (f *= Math.pow(Ze, u - o))), e.charAt(u) !== r.charAt(i) && (f *= wa)), (f < Xe && t.charAt(u - 1) === n.charAt(i + 1) || n.charAt(i + 1) === n.charAt(i) && t.charAt(u - 1) !== n.charAt(i)) && (x = at(e, r, t, n, u + 1, i + 2, a), x * Xe > f && (f = x * Xe)), f > p && (p = f), u = t.indexOf(d, u + 1);
|
|
2017
2017
|
return a[c] = p, p;
|
|
2018
2018
|
}
|
|
2019
2019
|
function bt(e) {
|
|
@@ -2026,7 +2026,7 @@ var Ce = '[cmdk-group=""]', Je = '[cmdk-group-items=""]', ka = '[cmdk-group-head
|
|
|
2026
2026
|
let t = be(() => {
|
|
2027
2027
|
var h, k;
|
|
2028
2028
|
return { search: "", value: (k = (h = e.value) != null ? h : e.defaultValue) != null ? k : "", selectedItemId: void 0, filtered: { count: 0, items: /* @__PURE__ */ new Map(), groups: /* @__PURE__ */ new Set() } };
|
|
2029
|
-
}), n = be(() => /* @__PURE__ */ new Set()), o = be(() => /* @__PURE__ */ new Map()), i = be(() => /* @__PURE__ */ new Map()), a = be(() => /* @__PURE__ */ new Set()), c = Or(e), { label:
|
|
2029
|
+
}), n = be(() => /* @__PURE__ */ new Set()), o = be(() => /* @__PURE__ */ new Map()), i = be(() => /* @__PURE__ */ new Map()), a = be(() => /* @__PURE__ */ new Set()), c = Or(e), { label: d, children: u, value: p, onValueChange: f, filter: x, shouldFilter: g, loop: w, disablePointerSelection: m = !1, vimBindings: v = !0, ...b } = e, S = te(), y = te(), R = te(), D = l.useRef(null), P = La();
|
|
2030
2030
|
he(() => {
|
|
2031
2031
|
if (p !== void 0) {
|
|
2032
2032
|
let h = p.trim();
|
|
@@ -2036,7 +2036,7 @@ var Ce = '[cmdk-group=""]', Je = '[cmdk-group-items=""]', ka = '[cmdk-group-head
|
|
|
2036
2036
|
P(6, X);
|
|
2037
2037
|
}, []);
|
|
2038
2038
|
let j = l.useMemo(() => ({ subscribe: (h) => (a.current.add(h), () => a.current.delete(h)), snapshot: () => t.current, setState: (h, k, E) => {
|
|
2039
|
-
var I,
|
|
2039
|
+
var I, M, C, A;
|
|
2040
2040
|
if (!Object.is(t.current[h], k)) {
|
|
2041
2041
|
if (t.current[h] = k, h === "search") K(), z(), P(1, O);
|
|
2042
2042
|
else if (h === "value") {
|
|
@@ -2047,9 +2047,9 @@ var Ce = '[cmdk-group=""]', Je = '[cmdk-group-items=""]', ka = '[cmdk-group-head
|
|
|
2047
2047
|
if (P(7, () => {
|
|
2048
2048
|
var B;
|
|
2049
2049
|
t.current.selectedItemId = (B = W()) == null ? void 0 : B.id, j.emit();
|
|
2050
|
-
}), E || P(5, X), ((
|
|
2050
|
+
}), E || P(5, X), ((M = c.current) == null ? void 0 : M.value) !== void 0) {
|
|
2051
2051
|
let B = k ?? "";
|
|
2052
|
-
(
|
|
2052
|
+
(A = (C = c.current).onValueChange) == null || A.call(C, B);
|
|
2053
2053
|
return;
|
|
2054
2054
|
}
|
|
2055
2055
|
}
|
|
@@ -2072,33 +2072,33 @@ var Ce = '[cmdk-group=""]', Je = '[cmdk-group-items=""]', ka = '[cmdk-group-head
|
|
|
2072
2072
|
});
|
|
2073
2073
|
}), group: (h) => (o.current.has(h) || o.current.set(h, /* @__PURE__ */ new Set()), () => {
|
|
2074
2074
|
i.current.delete(h), o.current.delete(h);
|
|
2075
|
-
}), filter: () => c.current.shouldFilter, label:
|
|
2075
|
+
}), filter: () => c.current.shouldFilter, label: d || e["aria-label"], getDisablePointerSelection: () => c.current.disablePointerSelection, listId: S, inputId: R, labelId: y, listInnerRef: D }), []);
|
|
2076
2076
|
function Z(h, k) {
|
|
2077
2077
|
var E, I;
|
|
2078
|
-
let
|
|
2079
|
-
return h ?
|
|
2078
|
+
let M = (I = (E = c.current) == null ? void 0 : E.filter) != null ? I : Ea;
|
|
2079
|
+
return h ? M(h, t.current.search, k) : 0;
|
|
2080
2080
|
}
|
|
2081
2081
|
function z() {
|
|
2082
2082
|
if (!t.current.search || c.current.shouldFilter === !1) return;
|
|
2083
2083
|
let h = t.current.filtered.items, k = [];
|
|
2084
2084
|
t.current.filtered.groups.forEach((I) => {
|
|
2085
|
-
let
|
|
2086
|
-
|
|
2087
|
-
let B = h.get(
|
|
2085
|
+
let M = o.current.get(I), C = 0;
|
|
2086
|
+
M.forEach((A) => {
|
|
2087
|
+
let B = h.get(A);
|
|
2088
2088
|
C = Math.max(B, C);
|
|
2089
2089
|
}), k.push([I, C]);
|
|
2090
2090
|
});
|
|
2091
2091
|
let E = D.current;
|
|
2092
|
-
U().sort((I,
|
|
2093
|
-
var C,
|
|
2094
|
-
let B = I.getAttribute("id"), $ =
|
|
2095
|
-
return ((C = h.get($)) != null ? C : 0) - ((
|
|
2092
|
+
U().sort((I, M) => {
|
|
2093
|
+
var C, A;
|
|
2094
|
+
let B = I.getAttribute("id"), $ = M.getAttribute("id");
|
|
2095
|
+
return ((C = h.get($)) != null ? C : 0) - ((A = h.get(B)) != null ? A : 0);
|
|
2096
2096
|
}).forEach((I) => {
|
|
2097
|
-
let
|
|
2098
|
-
|
|
2099
|
-
}), k.sort((I,
|
|
2100
|
-
var
|
|
2101
|
-
let C = (
|
|
2097
|
+
let M = I.closest(Je);
|
|
2098
|
+
M ? M.appendChild(I.parentElement === M ? I : I.closest(`${Je} > *`)) : E.appendChild(I.parentElement === E ? I : I.closest(`${Je} > *`));
|
|
2099
|
+
}), k.sort((I, M) => M[1] - I[1]).forEach((I) => {
|
|
2100
|
+
var M;
|
|
2101
|
+
let C = (M = D.current) == null ? void 0 : M.querySelector(`${Ce}[${ge}="${encodeURIComponent(I[0])}"]`);
|
|
2102
2102
|
C?.parentElement.appendChild(C);
|
|
2103
2103
|
});
|
|
2104
2104
|
}
|
|
@@ -2113,16 +2113,16 @@ var Ce = '[cmdk-group=""]', Je = '[cmdk-group-items=""]', ka = '[cmdk-group-head
|
|
|
2113
2113
|
return;
|
|
2114
2114
|
}
|
|
2115
2115
|
t.current.filtered.groups = /* @__PURE__ */ new Set();
|
|
2116
|
-
let
|
|
2116
|
+
let M = 0;
|
|
2117
2117
|
for (let C of n.current) {
|
|
2118
|
-
let
|
|
2119
|
-
t.current.filtered.items.set(C, $), $ > 0 &&
|
|
2118
|
+
let A = (k = (h = i.current.get(C)) == null ? void 0 : h.value) != null ? k : "", B = (I = (E = i.current.get(C)) == null ? void 0 : E.keywords) != null ? I : [], $ = Z(A, B);
|
|
2119
|
+
t.current.filtered.items.set(C, $), $ > 0 && M++;
|
|
2120
2120
|
}
|
|
2121
|
-
for (let [C,
|
|
2121
|
+
for (let [C, A] of o.current) for (let B of A) if (t.current.filtered.items.get(B) > 0) {
|
|
2122
2122
|
t.current.filtered.groups.add(C);
|
|
2123
2123
|
break;
|
|
2124
2124
|
}
|
|
2125
|
-
t.current.filtered.count =
|
|
2125
|
+
t.current.filtered.count = M;
|
|
2126
2126
|
}
|
|
2127
2127
|
function X() {
|
|
2128
2128
|
var h, k, E;
|
|
@@ -2143,8 +2143,8 @@ var Ce = '[cmdk-group=""]', Je = '[cmdk-group-items=""]', ka = '[cmdk-group-head
|
|
|
2143
2143
|
}
|
|
2144
2144
|
function G(h) {
|
|
2145
2145
|
var k;
|
|
2146
|
-
let E = W(), I = U(),
|
|
2147
|
-
(k = c.current) != null && k.loop && (C =
|
|
2146
|
+
let E = W(), I = U(), M = I.findIndex((A) => A === E), C = I[M + h];
|
|
2147
|
+
(k = c.current) != null && k.loop && (C = M + h < 0 ? I[I.length - 1] : M + h === I.length ? I[0] : I[M + h]), C && j.setState("value", C.getAttribute(ge));
|
|
2148
2148
|
}
|
|
2149
2149
|
function q(h) {
|
|
2150
2150
|
let k = W(), E = k?.closest(Ce), I;
|
|
@@ -2191,26 +2191,26 @@ var Ce = '[cmdk-group=""]', Je = '[cmdk-group-items=""]', ka = '[cmdk-group-head
|
|
|
2191
2191
|
h.preventDefault();
|
|
2192
2192
|
let I = W();
|
|
2193
2193
|
if (I) {
|
|
2194
|
-
let
|
|
2195
|
-
I.dispatchEvent(
|
|
2194
|
+
let M = new Event(st);
|
|
2195
|
+
I.dispatchEvent(M);
|
|
2196
2196
|
}
|
|
2197
2197
|
}
|
|
2198
2198
|
}
|
|
2199
|
-
} }, l.createElement("label", { "cmdk-label": "", htmlFor: L.inputId, id: L.labelId, style: $a },
|
|
2199
|
+
} }, l.createElement("label", { "cmdk-label": "", htmlFor: L.inputId, id: L.labelId, style: $a }, d), Ke(e, (h) => l.createElement(Mr.Provider, { value: j }, l.createElement(Tr.Provider, { value: L }, h))));
|
|
2200
2200
|
}), ja = l.forwardRef((e, r) => {
|
|
2201
2201
|
var t, n;
|
|
2202
|
-
let o = te(), i = l.useRef(null), a = l.useContext(Ar), c = Ne(),
|
|
2202
|
+
let o = te(), i = l.useRef(null), a = l.useContext(Ar), c = Ne(), d = Or(e), u = (n = (t = d.current) == null ? void 0 : t.forceMount) != null ? n : a?.forceMount;
|
|
2203
2203
|
he(() => {
|
|
2204
|
-
if (!
|
|
2205
|
-
}, [
|
|
2206
|
-
let p = Fr(o, i, [e.value, e.children, i], e.keywords), f = ht(), x = se((P) => P.value && P.value === p.current), g = se((P) =>
|
|
2204
|
+
if (!u) return c.item(o, a?.id);
|
|
2205
|
+
}, [u]);
|
|
2206
|
+
let p = Fr(o, i, [e.value, e.children, i], e.keywords), f = ht(), x = se((P) => P.value && P.value === p.current), g = se((P) => u || c.filter() === !1 ? !0 : P.search ? P.filtered.items.get(o) > 0 : !0);
|
|
2207
2207
|
l.useEffect(() => {
|
|
2208
2208
|
let P = i.current;
|
|
2209
2209
|
if (!(!P || e.disabled)) return P.addEventListener(st, w), () => P.removeEventListener(st, w);
|
|
2210
2210
|
}, [g, e.onSelect, e.disabled]);
|
|
2211
2211
|
function w() {
|
|
2212
2212
|
var P, j;
|
|
2213
|
-
m(), (j = (P =
|
|
2213
|
+
m(), (j = (P = d.current).onSelect) == null || j.call(P, p.current);
|
|
2214
2214
|
}
|
|
2215
2215
|
function m() {
|
|
2216
2216
|
f.setState("value", p.current, !0);
|
|
@@ -2219,35 +2219,35 @@ var Ce = '[cmdk-group=""]', Je = '[cmdk-group-items=""]', ka = '[cmdk-group-head
|
|
|
2219
2219
|
let { disabled: v, value: b, onSelect: S, forceMount: y, keywords: R, ...D } = e;
|
|
2220
2220
|
return l.createElement(N.div, { ref: Re(i, r), ...D, id: o, "cmdk-item": "", role: "option", "aria-disabled": !!v, "aria-selected": !!x, "data-disabled": !!v, "data-selected": !!x, onPointerMove: v || c.getDisablePointerSelection() ? void 0 : m, onClick: v ? void 0 : w }, e.children);
|
|
2221
2221
|
}), Na = l.forwardRef((e, r) => {
|
|
2222
|
-
let { heading: t, children: n, forceMount: o, ...i } = e, a = te(), c = l.useRef(null),
|
|
2223
|
-
he(() => p.group(a), []), Fr(a, c, [e.value, e.heading,
|
|
2222
|
+
let { heading: t, children: n, forceMount: o, ...i } = e, a = te(), c = l.useRef(null), d = l.useRef(null), u = te(), p = Ne(), f = se((g) => o || p.filter() === !1 ? !0 : g.search ? g.filtered.groups.has(a) : !0);
|
|
2223
|
+
he(() => p.group(a), []), Fr(a, c, [e.value, e.heading, d]);
|
|
2224
2224
|
let x = l.useMemo(() => ({ id: a, forceMount: o }), [o]);
|
|
2225
|
-
return l.createElement(N.div, { ref: Re(c, r), ...i, "cmdk-group": "", role: "presentation", hidden: f ? void 0 : !0 }, t && l.createElement("div", { ref:
|
|
2225
|
+
return l.createElement(N.div, { ref: Re(c, r), ...i, "cmdk-group": "", role: "presentation", hidden: f ? void 0 : !0 }, t && l.createElement("div", { ref: d, "cmdk-group-heading": "", "aria-hidden": !0, id: u }, t), Ke(e, (g) => l.createElement("div", { "cmdk-group-items": "", role: "group", "aria-labelledby": t ? u : void 0 }, l.createElement(Ar.Provider, { value: x }, g))));
|
|
2226
2226
|
}), _a = l.forwardRef((e, r) => {
|
|
2227
2227
|
let { alwaysRender: t, ...n } = e, o = l.useRef(null), i = se((a) => !a.search);
|
|
2228
2228
|
return !t && !i ? null : l.createElement(N.div, { ref: Re(o, r), ...n, "cmdk-separator": "", role: "separator" });
|
|
2229
2229
|
}), Pa = l.forwardRef((e, r) => {
|
|
2230
|
-
let { onValueChange: t, ...n } = e, o = e.value != null, i = ht(), a = se((
|
|
2230
|
+
let { onValueChange: t, ...n } = e, o = e.value != null, i = ht(), a = se((u) => u.search), c = se((u) => u.selectedItemId), d = Ne();
|
|
2231
2231
|
return l.useEffect(() => {
|
|
2232
2232
|
e.value != null && i.setState("search", e.value);
|
|
2233
|
-
}, [e.value]), l.createElement(N.input, { ref: r, ...n, "cmdk-input": "", autoComplete: "off", autoCorrect: "off", spellCheck: !1, "aria-autocomplete": "list", role: "combobox", "aria-expanded": !0, "aria-controls":
|
|
2234
|
-
o || i.setState("search",
|
|
2233
|
+
}, [e.value]), l.createElement(N.input, { ref: r, ...n, "cmdk-input": "", autoComplete: "off", autoCorrect: "off", spellCheck: !1, "aria-autocomplete": "list", role: "combobox", "aria-expanded": !0, "aria-controls": d.listId, "aria-labelledby": d.labelId, "aria-activedescendant": c, id: d.inputId, type: "text", value: o ? e.value : a, onChange: (u) => {
|
|
2234
|
+
o || i.setState("search", u.target.value), t?.(u.target.value);
|
|
2235
2235
|
} });
|
|
2236
2236
|
}), Ta = l.forwardRef((e, r) => {
|
|
2237
|
-
let { children: t, label: n = "Suggestions", ...o } = e, i = l.useRef(null), a = l.useRef(null), c = se((
|
|
2237
|
+
let { children: t, label: n = "Suggestions", ...o } = e, i = l.useRef(null), a = l.useRef(null), c = se((u) => u.selectedItemId), d = Ne();
|
|
2238
2238
|
return l.useEffect(() => {
|
|
2239
2239
|
if (a.current && i.current) {
|
|
2240
|
-
let
|
|
2240
|
+
let u = a.current, p = i.current, f, x = new ResizeObserver(() => {
|
|
2241
2241
|
f = requestAnimationFrame(() => {
|
|
2242
|
-
let g =
|
|
2242
|
+
let g = u.offsetHeight;
|
|
2243
2243
|
p.style.setProperty("--cmdk-list-height", g.toFixed(1) + "px");
|
|
2244
2244
|
});
|
|
2245
2245
|
});
|
|
2246
|
-
return x.observe(
|
|
2247
|
-
cancelAnimationFrame(f), x.unobserve(
|
|
2246
|
+
return x.observe(u), () => {
|
|
2247
|
+
cancelAnimationFrame(f), x.unobserve(u);
|
|
2248
2248
|
};
|
|
2249
2249
|
}
|
|
2250
|
-
}, []), l.createElement(N.div, { ref: Re(i, r), ...o, "cmdk-list": "", role: "listbox", tabIndex: -1, "aria-activedescendant": c, "aria-label": n, id:
|
|
2250
|
+
}, []), l.createElement(N.div, { ref: Re(i, r), ...o, "cmdk-list": "", role: "listbox", tabIndex: -1, "aria-activedescendant": c, "aria-label": n, id: d.listId }, Ke(e, (u) => l.createElement("div", { ref: Re(a, d.listInnerRef), "cmdk-list-sizer": "" }, u)));
|
|
2251
2251
|
}), Ma = l.forwardRef((e, r) => {
|
|
2252
2252
|
let { open: t, onOpenChange: n, overlayClassName: o, contentClassName: i, container: a, ...c } = e;
|
|
2253
2253
|
return l.createElement(Cn, { open: t, onOpenChange: n }, l.createElement(In, { container: a }, l.createElement(Rn, { "cmdk-overlay": "", className: o }), l.createElement(kn, { "aria-label": e.label, "cmdk-dialog": "", className: i }, l.createElement(Dr, { ref: r, ...c }))));
|
|
@@ -2289,13 +2289,13 @@ function Fr(e, r, t, n = []) {
|
|
|
2289
2289
|
return he(() => {
|
|
2290
2290
|
var a;
|
|
2291
2291
|
let c = (() => {
|
|
2292
|
-
var
|
|
2292
|
+
var u;
|
|
2293
2293
|
for (let p of t) {
|
|
2294
2294
|
if (typeof p == "string") return p.trim();
|
|
2295
|
-
if (typeof p == "object" && "current" in p) return p.current ? (
|
|
2295
|
+
if (typeof p == "object" && "current" in p) return p.current ? (u = p.current.textContent) == null ? void 0 : u.trim() : o.current;
|
|
2296
2296
|
}
|
|
2297
|
-
})(),
|
|
2298
|
-
i.value(e, c,
|
|
2297
|
+
})(), d = n.map((u) => u.trim());
|
|
2298
|
+
i.value(e, c, d), (a = r.current) == null || a.setAttribute(ge, c), o.current = c;
|
|
2299
2299
|
}), o;
|
|
2300
2300
|
}
|
|
2301
2301
|
var La = () => {
|
|
@@ -2318,7 +2318,7 @@ function Va({ className: e, ...r }) {
|
|
|
2318
2318
|
return /* @__PURE__ */ s.jsx(
|
|
2319
2319
|
Se,
|
|
2320
2320
|
{
|
|
2321
|
-
className:
|
|
2321
|
+
className: T(
|
|
2322
2322
|
"flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",
|
|
2323
2323
|
e
|
|
2324
2324
|
),
|
|
@@ -2333,7 +2333,7 @@ function Ka({ className: e, ...r }) {
|
|
|
2333
2333
|
/* @__PURE__ */ s.jsx(
|
|
2334
2334
|
Se.Input,
|
|
2335
2335
|
{
|
|
2336
|
-
className:
|
|
2336
|
+
className: T(
|
|
2337
2337
|
"flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",
|
|
2338
2338
|
e
|
|
2339
2339
|
),
|
|
@@ -2347,7 +2347,7 @@ function Ha({ className: e, ...r }) {
|
|
|
2347
2347
|
return /* @__PURE__ */ s.jsx(
|
|
2348
2348
|
Se.List,
|
|
2349
2349
|
{
|
|
2350
|
-
className:
|
|
2350
|
+
className: T("max-h-[300px] scroll-py-1 overflow-y-auto overflow-x-hidden", e),
|
|
2351
2351
|
"data-slot": "command-list",
|
|
2352
2352
|
...r
|
|
2353
2353
|
}
|
|
@@ -2360,7 +2360,7 @@ function Ga({ className: e, ...r }) {
|
|
|
2360
2360
|
return /* @__PURE__ */ s.jsx(
|
|
2361
2361
|
Se.Group,
|
|
2362
2362
|
{
|
|
2363
|
-
className:
|
|
2363
|
+
className: T(
|
|
2364
2364
|
"overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group-heading]]:text-xs",
|
|
2365
2365
|
e
|
|
2366
2366
|
),
|
|
@@ -2373,7 +2373,7 @@ function za({ className: e, ...r }) {
|
|
|
2373
2373
|
return /* @__PURE__ */ s.jsx(
|
|
2374
2374
|
Se.Item,
|
|
2375
2375
|
{
|
|
2376
|
-
className:
|
|
2376
|
+
className: T(
|
|
2377
2377
|
"relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
2378
2378
|
e
|
|
2379
2379
|
),
|
|
@@ -2400,7 +2400,7 @@ const Wa = ({
|
|
|
2400
2400
|
},
|
|
2401
2401
|
renderSelected: i = (a) => a.label
|
|
2402
2402
|
}) => {
|
|
2403
|
-
const [a, c] = Me(!1),
|
|
2403
|
+
const [a, c] = Me(!1), d = ln(() => e.find((u) => u.value === r), [e, r]);
|
|
2404
2404
|
return /* @__PURE__ */ s.jsxs(It, { onOpenChange: c, open: a, children: [
|
|
2405
2405
|
/* @__PURE__ */ s.jsx(
|
|
2406
2406
|
Wa,
|
|
@@ -2409,27 +2409,27 @@ const Wa = ({
|
|
|
2409
2409
|
open: a,
|
|
2410
2410
|
placeholder: t,
|
|
2411
2411
|
renderSelected: i,
|
|
2412
|
-
selected:
|
|
2412
|
+
selected: d
|
|
2413
2413
|
}
|
|
2414
2414
|
),
|
|
2415
2415
|
/* @__PURE__ */ s.jsx(kt, { className: "w-full p-0", children: /* @__PURE__ */ s.jsxs(Va, { value: r, children: [
|
|
2416
2416
|
/* @__PURE__ */ s.jsx(Ka, { "aria-label": "Search options", className: "h-9", placeholder: "Search" }),
|
|
2417
2417
|
/* @__PURE__ */ s.jsxs(Ha, { children: [
|
|
2418
2418
|
/* @__PURE__ */ s.jsx(Ua, { children: "No results found" }),
|
|
2419
|
-
/* @__PURE__ */ s.jsx(Ga, { children: e.map((
|
|
2419
|
+
/* @__PURE__ */ s.jsx(Ga, { children: e.map((u) => /* @__PURE__ */ s.jsxs(
|
|
2420
2420
|
za,
|
|
2421
2421
|
{
|
|
2422
2422
|
onSelect: () => {
|
|
2423
|
-
c(!1), o(
|
|
2423
|
+
c(!1), o(u.value);
|
|
2424
2424
|
},
|
|
2425
|
-
value:
|
|
2425
|
+
value: u.value,
|
|
2426
2426
|
children: [
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
/* @__PURE__ */ s.jsx(ut, { className:
|
|
2427
|
+
u.icon ? /* @__PURE__ */ s.jsx("span", { className: "mr-2", children: u.icon }) : "",
|
|
2428
|
+
u.label,
|
|
2429
|
+
/* @__PURE__ */ s.jsx(ut, { className: T("ml-auto", u.value === r ? "opacity-100" : "opacity-0") })
|
|
2430
2430
|
]
|
|
2431
2431
|
},
|
|
2432
|
-
|
|
2432
|
+
u.value
|
|
2433
2433
|
)) })
|
|
2434
2434
|
] })
|
|
2435
2435
|
] }) })
|
|
@@ -2451,8 +2451,8 @@ var Lr = ["PageUp", "PageDown"], Br = ["ArrowUp", "ArrowDown", "ArrowLeft", "Arr
|
|
|
2451
2451
|
step: i = 1,
|
|
2452
2452
|
orientation: a = "horizontal",
|
|
2453
2453
|
disabled: c = !1,
|
|
2454
|
-
minStepsBetweenThumbs:
|
|
2455
|
-
defaultValue:
|
|
2454
|
+
minStepsBetweenThumbs: d = 0,
|
|
2455
|
+
defaultValue: u = [n],
|
|
2456
2456
|
value: p,
|
|
2457
2457
|
onValueChange: f = () => {
|
|
2458
2458
|
},
|
|
@@ -2463,7 +2463,7 @@ var Lr = ["PageUp", "PageDown"], Br = ["ArrowUp", "ArrowDown", "ArrowLeft", "Arr
|
|
|
2463
2463
|
...m
|
|
2464
2464
|
} = e, v = l.useRef(/* @__PURE__ */ new Set()), b = l.useRef(0), y = a === "horizontal" ? Za : Ja, [R = [], D] = pe({
|
|
2465
2465
|
prop: p,
|
|
2466
|
-
defaultProp:
|
|
2466
|
+
defaultProp: u,
|
|
2467
2467
|
onChange: (O) => {
|
|
2468
2468
|
[...v.current][b.current]?.focus(), f(O);
|
|
2469
2469
|
}
|
|
@@ -2483,7 +2483,7 @@ var Lr = ["PageUp", "PageDown"], Br = ["ArrowUp", "ArrowDown", "ArrowLeft", "Arr
|
|
|
2483
2483
|
const W = is(i), U = ls(Math.round((O - n) / i) * i + n, W), F = _e(U, [n, o]);
|
|
2484
2484
|
D((G = []) => {
|
|
2485
2485
|
const q = ts(G, F, K);
|
|
2486
|
-
if (ss(q,
|
|
2486
|
+
if (ss(q, d * i)) {
|
|
2487
2487
|
b.current = q.indexOf(F);
|
|
2488
2488
|
const J = String(q) !== String(G);
|
|
2489
2489
|
return J && X && x(q), J ? q : G;
|
|
@@ -2549,8 +2549,8 @@ var [Hr, Ur] = Vr(ye, {
|
|
|
2549
2549
|
inverted: i,
|
|
2550
2550
|
onSlideStart: a,
|
|
2551
2551
|
onSlideMove: c,
|
|
2552
|
-
onSlideEnd:
|
|
2553
|
-
onStepKeyDown:
|
|
2552
|
+
onSlideEnd: d,
|
|
2553
|
+
onStepKeyDown: u,
|
|
2554
2554
|
...p
|
|
2555
2555
|
} = e, [f, x] = l.useState(null), g = V(r, (y) => x(y)), w = l.useRef(void 0), m = De(o), v = m === "ltr", b = v && !i || !v && i;
|
|
2556
2556
|
function S(y) {
|
|
@@ -2585,11 +2585,11 @@ var [Hr, Ur] = Vr(ye, {
|
|
|
2585
2585
|
c?.(R);
|
|
2586
2586
|
},
|
|
2587
2587
|
onSlideEnd: () => {
|
|
2588
|
-
w.current = void 0,
|
|
2588
|
+
w.current = void 0, d?.();
|
|
2589
2589
|
},
|
|
2590
2590
|
onStepKeyDown: (y) => {
|
|
2591
2591
|
const D = $r[b ? "from-left" : "from-right"].includes(y.key);
|
|
2592
|
-
|
|
2592
|
+
u?.({ event: y, direction: D ? -1 : 1 });
|
|
2593
2593
|
}
|
|
2594
2594
|
}
|
|
2595
2595
|
)
|
|
@@ -2605,8 +2605,8 @@ var [Hr, Ur] = Vr(ye, {
|
|
|
2605
2605
|
onSlideStart: i,
|
|
2606
2606
|
onSlideMove: a,
|
|
2607
2607
|
onSlideEnd: c,
|
|
2608
|
-
onStepKeyDown:
|
|
2609
|
-
...
|
|
2608
|
+
onStepKeyDown: d,
|
|
2609
|
+
...u
|
|
2610
2610
|
} = e, p = l.useRef(null), f = V(r, p), x = l.useRef(void 0), g = !o;
|
|
2611
2611
|
function w(m) {
|
|
2612
2612
|
const v = x.current || p.current.getBoundingClientRect(), b = [0, v.height], y = vt(b, g ? [n, t] : [t, n]);
|
|
@@ -2624,10 +2624,10 @@ var [Hr, Ur] = Vr(ye, {
|
|
|
2624
2624
|
Gr,
|
|
2625
2625
|
{
|
|
2626
2626
|
"data-orientation": "vertical",
|
|
2627
|
-
...
|
|
2627
|
+
...u,
|
|
2628
2628
|
ref: f,
|
|
2629
2629
|
style: {
|
|
2630
|
-
...
|
|
2630
|
+
...u.style,
|
|
2631
2631
|
"--radix-slider-thumb-transform": "translateY(50%)"
|
|
2632
2632
|
},
|
|
2633
2633
|
onSlideStart: (m) => {
|
|
@@ -2643,7 +2643,7 @@ var [Hr, Ur] = Vr(ye, {
|
|
|
2643
2643
|
},
|
|
2644
2644
|
onStepKeyDown: (m) => {
|
|
2645
2645
|
const b = $r[g ? "from-bottom" : "from-top"].includes(m.key);
|
|
2646
|
-
|
|
2646
|
+
d?.({ event: m, direction: b ? -1 : 1 });
|
|
2647
2647
|
}
|
|
2648
2648
|
}
|
|
2649
2649
|
)
|
|
@@ -2659,16 +2659,16 @@ var [Hr, Ur] = Vr(ye, {
|
|
|
2659
2659
|
onSlideEnd: i,
|
|
2660
2660
|
onHomeKeyDown: a,
|
|
2661
2661
|
onEndKeyDown: c,
|
|
2662
|
-
onStepKeyDown:
|
|
2663
|
-
...
|
|
2662
|
+
onStepKeyDown: d,
|
|
2663
|
+
...u
|
|
2664
2664
|
} = e, p = He(ye, t);
|
|
2665
2665
|
return /* @__PURE__ */ s.jsx(
|
|
2666
2666
|
N.span,
|
|
2667
2667
|
{
|
|
2668
|
-
...
|
|
2668
|
+
...u,
|
|
2669
2669
|
ref: r,
|
|
2670
2670
|
onKeyDown: _(e.onKeyDown, (f) => {
|
|
2671
|
-
f.key === "Home" ? (a(f), f.preventDefault()) : f.key === "End" ? (c(f), f.preventDefault()) : Lr.concat(Br).includes(f.key) && (
|
|
2671
|
+
f.key === "Home" ? (a(f), f.preventDefault()) : f.key === "End" ? (c(f), f.preventDefault()) : Lr.concat(Br).includes(f.key) && (d(f), f.preventDefault());
|
|
2672
2672
|
}),
|
|
2673
2673
|
onPointerDown: _(e.onPointerDown, (f) => {
|
|
2674
2674
|
const x = f.target;
|
|
@@ -2701,9 +2701,9 @@ var [Hr, Ur] = Vr(ye, {
|
|
|
2701
2701
|
Wr.displayName = zr;
|
|
2702
2702
|
var lt = "SliderRange", qr = l.forwardRef(
|
|
2703
2703
|
(e, r) => {
|
|
2704
|
-
const { __scopeSlider: t, ...n } = e, o = He(lt, t), i = Ur(lt, t), a = l.useRef(null), c = V(r, a),
|
|
2704
|
+
const { __scopeSlider: t, ...n } = e, o = He(lt, t), i = Ur(lt, t), a = l.useRef(null), c = V(r, a), d = o.values.length, u = o.values.map(
|
|
2705
2705
|
(x) => Zr(x, o.min, o.max)
|
|
2706
|
-
), p =
|
|
2706
|
+
), p = d > 1 ? Math.min(...u) : 0, f = 100 - Math.max(...u);
|
|
2707
2707
|
return /* @__PURE__ */ s.jsx(
|
|
2708
2708
|
N.span,
|
|
2709
2709
|
{
|
|
@@ -2731,13 +2731,13 @@ var ct = "SliderThumb", Yr = l.forwardRef(
|
|
|
2731
2731
|
}
|
|
2732
2732
|
), Qa = l.forwardRef(
|
|
2733
2733
|
(e, r) => {
|
|
2734
|
-
const { __scopeSlider: t, index: n, name: o, ...i } = e, a = He(ct, t), c = Ur(ct, t), [
|
|
2734
|
+
const { __scopeSlider: t, index: n, name: o, ...i } = e, a = He(ct, t), c = Ur(ct, t), [d, u] = l.useState(null), p = V(r, (S) => u(S)), f = d ? a.form || !!d.closest("form") : !0, x = Oe(d), g = a.values[n], w = g === void 0 ? 0 : Zr(g, a.min, a.max), m = rs(n, a.values.length), v = x?.[c.size], b = v ? os(v, w, c.direction) : 0;
|
|
2735
2735
|
return l.useEffect(() => {
|
|
2736
|
-
if (
|
|
2737
|
-
return a.thumbs.add(
|
|
2738
|
-
a.thumbs.delete(
|
|
2736
|
+
if (d)
|
|
2737
|
+
return a.thumbs.add(d), () => {
|
|
2738
|
+
a.thumbs.delete(d);
|
|
2739
2739
|
};
|
|
2740
|
-
}, [
|
|
2740
|
+
}, [d, a.thumbs]), /* @__PURE__ */ s.jsxs(
|
|
2741
2741
|
"span",
|
|
2742
2742
|
{
|
|
2743
2743
|
style: {
|
|
@@ -2787,7 +2787,7 @@ var es = "RadioBubbleInput", Xr = l.forwardRef(
|
|
|
2787
2787
|
return l.useEffect(() => {
|
|
2788
2788
|
const c = o.current;
|
|
2789
2789
|
if (!c) return;
|
|
2790
|
-
const
|
|
2790
|
+
const d = window.HTMLInputElement.prototype, p = Object.getOwnPropertyDescriptor(d, "value").set;
|
|
2791
2791
|
if (a !== r && p) {
|
|
2792
2792
|
const f = new Event("input", { bubbles: !0 });
|
|
2793
2793
|
p.call(c, r), c.dispatchEvent(f);
|
|
@@ -2859,14 +2859,14 @@ function fs({
|
|
|
2859
2859
|
max: a = 100,
|
|
2860
2860
|
...c
|
|
2861
2861
|
}) {
|
|
2862
|
-
const
|
|
2862
|
+
const d = l.useMemo(
|
|
2863
2863
|
() => Array.isArray(o) ? o : Array.isArray(n) ? n : [i, a],
|
|
2864
2864
|
[o, n, i, a]
|
|
2865
2865
|
);
|
|
2866
2866
|
return /* @__PURE__ */ s.jsxs(
|
|
2867
2867
|
cs,
|
|
2868
2868
|
{
|
|
2869
|
-
className:
|
|
2869
|
+
className: T(
|
|
2870
2870
|
"relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",
|
|
2871
2871
|
e
|
|
2872
2872
|
),
|
|
@@ -2880,7 +2880,7 @@ function fs({
|
|
|
2880
2880
|
/* @__PURE__ */ s.jsx(
|
|
2881
2881
|
ds,
|
|
2882
2882
|
{
|
|
2883
|
-
className:
|
|
2883
|
+
className: T(
|
|
2884
2884
|
"bg-muted relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5",
|
|
2885
2885
|
r
|
|
2886
2886
|
),
|
|
@@ -2888,16 +2888,16 @@ function fs({
|
|
|
2888
2888
|
children: /* @__PURE__ */ s.jsx(
|
|
2889
2889
|
us,
|
|
2890
2890
|
{
|
|
2891
|
-
className:
|
|
2891
|
+
className: T("bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full"),
|
|
2892
2892
|
"data-slot": "slider-range"
|
|
2893
2893
|
}
|
|
2894
2894
|
)
|
|
2895
2895
|
}
|
|
2896
2896
|
),
|
|
2897
|
-
Array.from({ length:
|
|
2897
|
+
Array.from({ length: d.length }, (u, p) => /* @__PURE__ */ s.jsx(
|
|
2898
2898
|
ps,
|
|
2899
2899
|
{
|
|
2900
|
-
className:
|
|
2900
|
+
className: T(
|
|
2901
2901
|
"border-primary ring-ring/50 block size-4 shrink-0 rounded-full border bg-white shadow-sm transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50",
|
|
2902
2902
|
t
|
|
2903
2903
|
),
|
|
@@ -2915,7 +2915,7 @@ const Us = ({ size: e = "md", thumbClassName: r, trackClassName: t, value: n, de
|
|
|
2915
2915
|
fs,
|
|
2916
2916
|
{
|
|
2917
2917
|
defaultValue: a,
|
|
2918
|
-
thumbClassName:
|
|
2918
|
+
thumbClassName: T(
|
|
2919
2919
|
{
|
|
2920
2920
|
"size-2": e === "xs",
|
|
2921
2921
|
"size-3": e === "sm",
|
|
@@ -2926,7 +2926,7 @@ const Us = ({ size: e = "md", thumbClassName: r, trackClassName: t, value: n, de
|
|
|
2926
2926
|
"bg-primary",
|
|
2927
2927
|
r
|
|
2928
2928
|
),
|
|
2929
|
-
trackClassName:
|
|
2929
|
+
trackClassName: T(
|
|
2930
2930
|
{
|
|
2931
2931
|
"data-[orientation=horizontal]:h-1 data-[orientation=vertical]:w-1": e === "xs",
|
|
2932
2932
|
"data-[orientation=horizontal]:h-1.5 data-[orientation=vertical]:w-1.5": e === "sm",
|
|
@@ -2950,14 +2950,14 @@ var Ue = "Switch", [ms, Gs] = ve(Ue), [hs, vs] = ms(Ue), Jr = l.forwardRef(
|
|
|
2950
2950
|
defaultChecked: i,
|
|
2951
2951
|
required: a,
|
|
2952
2952
|
disabled: c,
|
|
2953
|
-
value:
|
|
2954
|
-
onCheckedChange:
|
|
2953
|
+
value: d = "on",
|
|
2954
|
+
onCheckedChange: u,
|
|
2955
2955
|
form: p,
|
|
2956
2956
|
...f
|
|
2957
2957
|
} = e, [x, g] = l.useState(null), w = V(r, (y) => g(y)), m = l.useRef(!1), v = x ? p || !!x.closest("form") : !0, [b, S] = pe({
|
|
2958
2958
|
prop: o,
|
|
2959
2959
|
defaultProp: i ?? !1,
|
|
2960
|
-
onChange:
|
|
2960
|
+
onChange: u,
|
|
2961
2961
|
caller: Ue
|
|
2962
2962
|
});
|
|
2963
2963
|
return /* @__PURE__ */ s.jsxs(hs, { scope: t, checked: b, disabled: c, children: [
|
|
@@ -2971,7 +2971,7 @@ var Ue = "Switch", [ms, Gs] = ve(Ue), [hs, vs] = ms(Ue), Jr = l.forwardRef(
|
|
|
2971
2971
|
"data-state": rn(b),
|
|
2972
2972
|
"data-disabled": c ? "" : void 0,
|
|
2973
2973
|
disabled: c,
|
|
2974
|
-
value:
|
|
2974
|
+
value: d,
|
|
2975
2975
|
...f,
|
|
2976
2976
|
ref: w,
|
|
2977
2977
|
onClick: _(e.onClick, (y) => {
|
|
@@ -2985,7 +2985,7 @@ var Ue = "Switch", [ms, Gs] = ve(Ue), [hs, vs] = ms(Ue), Jr = l.forwardRef(
|
|
|
2985
2985
|
control: x,
|
|
2986
2986
|
bubbles: !m.current,
|
|
2987
2987
|
name: n,
|
|
2988
|
-
value:
|
|
2988
|
+
value: d,
|
|
2989
2989
|
checked: b,
|
|
2990
2990
|
required: a,
|
|
2991
2991
|
disabled: c,
|
|
@@ -3020,7 +3020,7 @@ var xs = "SwitchBubbleInput", tn = l.forwardRef(
|
|
|
3020
3020
|
bubbles: n = !0,
|
|
3021
3021
|
...o
|
|
3022
3022
|
}, i) => {
|
|
3023
|
-
const a = l.useRef(null), c = V(a, i),
|
|
3023
|
+
const a = l.useRef(null), c = V(a, i), d = Ee(t), u = Oe(r);
|
|
3024
3024
|
return l.useEffect(() => {
|
|
3025
3025
|
const p = a.current;
|
|
3026
3026
|
if (!p) return;
|
|
@@ -3028,11 +3028,11 @@ var xs = "SwitchBubbleInput", tn = l.forwardRef(
|
|
|
3028
3028
|
f,
|
|
3029
3029
|
"checked"
|
|
3030
3030
|
).set;
|
|
3031
|
-
if (
|
|
3031
|
+
if (d !== t && g) {
|
|
3032
3032
|
const w = new Event("click", { bubbles: n });
|
|
3033
3033
|
g.call(p, t), p.dispatchEvent(w);
|
|
3034
3034
|
}
|
|
3035
|
-
}, [
|
|
3035
|
+
}, [d, t, n]), /* @__PURE__ */ s.jsx(
|
|
3036
3036
|
"input",
|
|
3037
3037
|
{
|
|
3038
3038
|
type: "checkbox",
|
|
@@ -3043,7 +3043,7 @@ var xs = "SwitchBubbleInput", tn = l.forwardRef(
|
|
|
3043
3043
|
ref: c,
|
|
3044
3044
|
style: {
|
|
3045
3045
|
...o.style,
|
|
3046
|
-
...
|
|
3046
|
+
...u,
|
|
3047
3047
|
position: "absolute",
|
|
3048
3048
|
pointerEvents: "none",
|
|
3049
3049
|
opacity: 0,
|
|
@@ -3066,7 +3066,7 @@ function ws({
|
|
|
3066
3066
|
return /* @__PURE__ */ s.jsx(
|
|
3067
3067
|
gs,
|
|
3068
3068
|
{
|
|
3069
|
-
className:
|
|
3069
|
+
className: T(
|
|
3070
3070
|
"peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",
|
|
3071
3071
|
e
|
|
3072
3072
|
),
|
|
@@ -3075,7 +3075,7 @@ function ws({
|
|
|
3075
3075
|
children: /* @__PURE__ */ s.jsx(
|
|
3076
3076
|
bs,
|
|
3077
3077
|
{
|
|
3078
|
-
className:
|
|
3078
|
+
className: T(
|
|
3079
3079
|
"bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0",
|
|
3080
3080
|
r
|
|
3081
3081
|
),
|
|
@@ -3092,47 +3092,48 @@ const zs = ({
|
|
|
3092
3092
|
rightLabel: n,
|
|
3093
3093
|
className: o,
|
|
3094
3094
|
thumbClassName: i,
|
|
3095
|
-
|
|
3096
|
-
|
|
3095
|
+
labelClassName: a,
|
|
3096
|
+
size: c = "md",
|
|
3097
|
+
...d
|
|
3097
3098
|
}) => {
|
|
3098
|
-
const u = cn(),
|
|
3099
|
+
const u = cn(), p = e || u, f = T("cursor-pointer", a);
|
|
3099
3100
|
return /* @__PURE__ */ s.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
3100
|
-
t && /* @__PURE__ */ s.jsx(ae, { className:
|
|
3101
|
+
t && /* @__PURE__ */ s.jsx(ae, { className: f, htmlFor: p, size: c, children: t }),
|
|
3101
3102
|
/* @__PURE__ */ s.jsx(
|
|
3102
3103
|
ws,
|
|
3103
3104
|
{
|
|
3104
|
-
className:
|
|
3105
|
+
className: T(
|
|
3105
3106
|
{
|
|
3106
|
-
"h-[10px] w-4":
|
|
3107
|
-
"h-[14px] w-6":
|
|
3108
|
-
"h-[18px] w-8":
|
|
3109
|
-
"h-[22px] w-10":
|
|
3110
|
-
"h-[26px] w-12":
|
|
3107
|
+
"h-[10px] w-4": c === "xs",
|
|
3108
|
+
"h-[14px] w-6": c === "sm",
|
|
3109
|
+
"h-[18px] w-8": c === "md",
|
|
3110
|
+
"h-[22px] w-10": c === "lg",
|
|
3111
|
+
"h-[26px] w-12": c === "xl"
|
|
3111
3112
|
},
|
|
3112
3113
|
o
|
|
3113
3114
|
),
|
|
3114
|
-
id:
|
|
3115
|
-
thumbClassName:
|
|
3115
|
+
id: p,
|
|
3116
|
+
thumbClassName: T(
|
|
3116
3117
|
{
|
|
3117
|
-
"size-2":
|
|
3118
|
-
"size-3":
|
|
3119
|
-
"size-4":
|
|
3120
|
-
"size-5":
|
|
3121
|
-
"size-6":
|
|
3118
|
+
"size-2": c === "xs",
|
|
3119
|
+
"size-3": c === "sm",
|
|
3120
|
+
"size-4": c === "md",
|
|
3121
|
+
"size-5": c === "lg",
|
|
3122
|
+
"size-6": c === "xl"
|
|
3122
3123
|
},
|
|
3123
3124
|
i
|
|
3124
3125
|
),
|
|
3125
|
-
...
|
|
3126
|
+
...d
|
|
3126
3127
|
}
|
|
3127
3128
|
),
|
|
3128
|
-
/* @__PURE__ */ s.jsx(ae, { className:
|
|
3129
|
+
/* @__PURE__ */ s.jsx(ae, { className: f, htmlFor: p, size: c, children: n || r })
|
|
3129
3130
|
] });
|
|
3130
3131
|
};
|
|
3131
3132
|
function Ss({ className: e, ...r }) {
|
|
3132
3133
|
return /* @__PURE__ */ s.jsx(
|
|
3133
3134
|
"textarea",
|
|
3134
3135
|
{
|
|
3135
|
-
className:
|
|
3136
|
+
className: T(
|
|
3136
3137
|
"field-sizing-content flex min-h-16 w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-xs outline-none transition-[color,box-shadow] placeholder:text-muted-foreground 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 md:text-sm dark:aria-invalid:ring-destructive/40",
|
|
3137
3138
|
e
|
|
3138
3139
|
),
|