@vellira-ui/react 2.43.3 → 2.44.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/index.cjs +1 -1
- package/dist/index.js +330 -330
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -281,14 +281,14 @@ var te = L("checkboxItem", "Dropdown.CheckboxItem"), ne = ({ active: e, enabled:
|
|
|
281
281
|
"input:not([disabled])",
|
|
282
282
|
"select:not([disabled])",
|
|
283
283
|
"[tabindex]:not([tabindex=\"-1\"])"
|
|
284
|
-
].join(","), oe = (e) => Array.from(e.querySelectorAll(ae)).filter((e) => !e.hasAttribute("disabled")),
|
|
284
|
+
].join(","), oe = (e) => Array.from(e.querySelectorAll(ae)).filter((e) => !e.hasAttribute("disabled")), se = (e) => {
|
|
285
285
|
(oe(e)[0] ?? e).focus();
|
|
286
|
-
},
|
|
286
|
+
}, ce = ({ active: e, contentRef: t, enabled: n, initialFocus: r, finalFocus: i, restoreFocus: a, onOpenAutoFocus: o, onCloseAutoFocus: s }) => {
|
|
287
287
|
f(() => {
|
|
288
288
|
if (!e) return;
|
|
289
289
|
let n = document.activeElement, c = i?.current, l = re();
|
|
290
290
|
return o?.(l), l.defaultPrevented || queueMicrotask(() => {
|
|
291
|
-
r?.current?.focus(), !r?.current && t.current &&
|
|
291
|
+
r?.current?.focus(), !r?.current && t.current && se(t.current);
|
|
292
292
|
}), () => {
|
|
293
293
|
let e = re();
|
|
294
294
|
s?.(e), !(e.defaultPrevented || !a) && queueMicrotask(() => {
|
|
@@ -331,7 +331,7 @@ var te = L("checkboxItem", "Dropdown.CheckboxItem"), ne = ({ active: e, enabled:
|
|
|
331
331
|
t,
|
|
332
332
|
n
|
|
333
333
|
]);
|
|
334
|
-
},
|
|
334
|
+
}, le = ({ active: e, contentRef: t, ignoreRefs: n = [], closeOnEscape: r, closeOnOutsidePress: i, isTopOverlay: a, onEscapeKeyDown: o, onPointerDownOutside: s, onInteractOutside: c, requestClose: l }) => {
|
|
335
335
|
let u = g(n);
|
|
336
336
|
u.current = n, f(() => {
|
|
337
337
|
if (!e) return;
|
|
@@ -366,44 +366,44 @@ var te = L("checkboxItem", "Dropdown.CheckboxItem"), ne = ({ active: e, enabled:
|
|
|
366
366
|
s,
|
|
367
367
|
l
|
|
368
368
|
]);
|
|
369
|
-
},
|
|
369
|
+
}, ue = [], V = {
|
|
370
370
|
add(e) {
|
|
371
|
-
|
|
371
|
+
ue = ue.filter((t) => t !== e), ue.push(e);
|
|
372
372
|
},
|
|
373
373
|
remove(e) {
|
|
374
|
-
|
|
374
|
+
ue = ue.filter((t) => t !== e);
|
|
375
375
|
},
|
|
376
376
|
isTop(e) {
|
|
377
|
-
return
|
|
377
|
+
return ue[ue.length - 1] === e;
|
|
378
378
|
}
|
|
379
379
|
}, de = ({ active: e, id: t }) => (f(() => {
|
|
380
|
-
if (e) return
|
|
381
|
-
|
|
380
|
+
if (e) return V.add(t), () => {
|
|
381
|
+
V.remove(t);
|
|
382
382
|
};
|
|
383
|
-
}, [e, t]), { isTopOverlay: u(() =>
|
|
383
|
+
}, [e, t]), { isTopOverlay: u(() => V.isTop(t), [t]) }), fe = 0, pe = "", me = {
|
|
384
384
|
lock() {
|
|
385
|
-
typeof document > "u" || (
|
|
385
|
+
typeof document > "u" || (fe === 0 && (pe = document.body.style.overflow, document.body.style.overflow = "hidden"), fe += 1);
|
|
386
386
|
},
|
|
387
387
|
unlock() {
|
|
388
|
-
typeof document > "u" || (
|
|
388
|
+
typeof document > "u" || (fe = Math.max(0, fe - 1), fe === 0 && (document.body.style.overflow = pe));
|
|
389
389
|
}
|
|
390
|
-
},
|
|
390
|
+
}, he = ({ active: e, enabled: t = !0 }) => {
|
|
391
391
|
f(() => {
|
|
392
|
-
if (!(!e || !t)) return
|
|
393
|
-
|
|
392
|
+
if (!(!e || !t)) return me.lock(), () => {
|
|
393
|
+
me.unlock();
|
|
394
394
|
};
|
|
395
395
|
}, [e, t]);
|
|
396
|
-
},
|
|
396
|
+
}, ge = () => typeof document > "u" ? null : document.body, _e = ({ container: e } = {}) => {
|
|
397
397
|
let [t, n] = _(!1);
|
|
398
398
|
return f(() => {
|
|
399
399
|
n(!0);
|
|
400
|
-
}, []), t ? e ?? document.getElementById("overlay-root") ??
|
|
401
|
-
},
|
|
400
|
+
}, []), t ? e ?? document.getElementById("overlay-root") ?? ge() : null;
|
|
401
|
+
}, ve = ({ value: e, defaultValue: t, onChange: n }) => {
|
|
402
402
|
let [r, i] = _(t), a = e !== void 0;
|
|
403
403
|
return [a ? e : r, u((e) => {
|
|
404
404
|
a || i(e), n?.(e);
|
|
405
405
|
}, [a, n])];
|
|
406
|
-
},
|
|
406
|
+
}, ye = ({ activeIndex: e, setActiveIndex: t, items: n, isOpen: r, onOpen: i, onSelect: a, onClose: o, getItemText: s, loop: c = !0 }) => {
|
|
407
407
|
let l = g({
|
|
408
408
|
value: "",
|
|
409
409
|
timeoutId: void 0
|
|
@@ -486,7 +486,7 @@ var te = L("checkboxItem", "Dropdown.CheckboxItem"), ne = ({ active: e, enabled:
|
|
|
486
486
|
m,
|
|
487
487
|
h
|
|
488
488
|
]) };
|
|
489
|
-
},
|
|
489
|
+
}, be = ({ items: e, open: t, defaultOpen: n = !1, disabled: r = !1, onOpenChange: i, onSelect: a, getItemValue: o, getItemText: s, loop: c = !0 }) => {
|
|
490
490
|
let [l, d] = _(n), [p, m] = _(-1), h = t !== void 0, g = t ?? l, v = u(() => e.findIndex((e) => !e.disabled), [e]), y = u(() => {
|
|
491
491
|
for (let t = e.length - 1; t >= 0; t--) if (!e[t]?.disabled) return t;
|
|
492
492
|
return -1;
|
|
@@ -541,7 +541,7 @@ var te = L("checkboxItem", "Dropdown.CheckboxItem"), ne = ({ active: e, enabled:
|
|
|
541
541
|
p,
|
|
542
542
|
e,
|
|
543
543
|
T
|
|
544
|
-
]), { onKeyDown: D } =
|
|
544
|
+
]), { onKeyDown: D } = ye({
|
|
545
545
|
activeIndex: p,
|
|
546
546
|
setActiveIndex: m,
|
|
547
547
|
items: e,
|
|
@@ -570,8 +570,8 @@ var te = L("checkboxItem", "Dropdown.CheckboxItem"), ne = ({ active: e, enabled:
|
|
|
570
570
|
getFirstEnabledIndex: v,
|
|
571
571
|
getLastEnabledIndex: y
|
|
572
572
|
};
|
|
573
|
-
},
|
|
574
|
-
let a = p(), o = p(), s = p(), [c, l] =
|
|
573
|
+
}, xe = ({ open: e, defaultOpen: t = !1, onOpenChange: n, closeOnEscape: r, closeOnOutsidePress: i }) => {
|
|
574
|
+
let a = p(), o = p(), s = p(), [c, l] = ve({
|
|
575
575
|
value: e,
|
|
576
576
|
defaultValue: t,
|
|
577
577
|
onChange: n
|
|
@@ -589,12 +589,12 @@ var te = L("checkboxItem", "Dropdown.CheckboxItem"), ne = ({ active: e, enabled:
|
|
|
589
589
|
titleId: o,
|
|
590
590
|
descriptionId: s
|
|
591
591
|
};
|
|
592
|
-
},
|
|
593
|
-
let [m, g] =
|
|
592
|
+
}, Se = ({ value: e, defaultValue: t, onValueChange: n, onChange: r, options: i, multiple: a = !1, maxSelected: o, closeOnSelect: s = !a, disabled: c = !1, open: l, defaultOpen: d = !1, onOpenChange: p }) => {
|
|
593
|
+
let [m, g] = ve({
|
|
594
594
|
value: e,
|
|
595
595
|
defaultValue: t ?? (a ? [] : ""),
|
|
596
596
|
onChange: n ?? r
|
|
597
|
-
}), [v, y] =
|
|
597
|
+
}), [v, y] = ve({
|
|
598
598
|
value: l,
|
|
599
599
|
defaultValue: d,
|
|
600
600
|
onChange: p
|
|
@@ -663,7 +663,7 @@ var te = L("checkboxItem", "Dropdown.CheckboxItem"), ne = ({ active: e, enabled:
|
|
|
663
663
|
b,
|
|
664
664
|
i,
|
|
665
665
|
k
|
|
666
|
-
]), { onKeyDown: j } =
|
|
666
|
+
]), { onKeyDown: j } = ye({
|
|
667
667
|
activeIndex: b,
|
|
668
668
|
setActiveIndex: x,
|
|
669
669
|
items: i,
|
|
@@ -693,8 +693,8 @@ var te = L("checkboxItem", "Dropdown.CheckboxItem"), ne = ({ active: e, enabled:
|
|
|
693
693
|
selectActiveOption: A,
|
|
694
694
|
onKeyDown: j
|
|
695
695
|
};
|
|
696
|
-
},
|
|
697
|
-
let [r, i] =
|
|
696
|
+
}, H = ({ value: e, defaultValue: t = "", onValueChange: n }) => {
|
|
697
|
+
let [r, i] = ve({
|
|
698
698
|
value: e,
|
|
699
699
|
defaultValue: t,
|
|
700
700
|
onChange: n
|
|
@@ -703,15 +703,15 @@ var te = L("checkboxItem", "Dropdown.CheckboxItem"), ne = ({ active: e, enabled:
|
|
|
703
703
|
value: r,
|
|
704
704
|
setValue: i
|
|
705
705
|
};
|
|
706
|
-
},
|
|
706
|
+
}, Ce = s(null), we = ({ children: e, container: t = null }) => /* @__PURE__ */ n(Ce.Provider, {
|
|
707
707
|
value: t,
|
|
708
708
|
children: e
|
|
709
|
-
}),
|
|
710
|
-
let n = d(
|
|
709
|
+
}), Te = ({ children: e, container: t }) => {
|
|
710
|
+
let n = d(Ce), r = _e({ container: t ?? n });
|
|
711
711
|
return r ? v(e, r) : null;
|
|
712
712
|
};
|
|
713
|
-
|
|
714
|
-
var
|
|
713
|
+
Te.__velliraPortal = !0, Te.displayName = "Portal", we.displayName = "PortalProvider";
|
|
714
|
+
var U = {
|
|
715
715
|
dropdown: "_dropdown_m7rnq_1",
|
|
716
716
|
"dropdown-in": "_dropdown-in_m7rnq_1",
|
|
717
717
|
primary: "_primary_m7rnq_42",
|
|
@@ -723,31 +723,31 @@ var we = {
|
|
|
723
723
|
searchWrap: "_searchWrap_m7rnq_165",
|
|
724
724
|
search: "_search_m7rnq_165",
|
|
725
725
|
"dropdown-sheet-in": "_dropdown-sheet-in_m7rnq_1"
|
|
726
|
-
},
|
|
726
|
+
}, Ee = L("empty", "Dropdown.Empty"), De = ({ children: e }) => /* @__PURE__ */ n("li", {
|
|
727
727
|
role: "presentation",
|
|
728
|
-
className:
|
|
728
|
+
className: U.empty,
|
|
729
729
|
children: e ?? "No actions available"
|
|
730
730
|
});
|
|
731
|
-
|
|
731
|
+
De.displayName = "DropdownEmptySurface";
|
|
732
732
|
//#endregion
|
|
733
733
|
//#region src/components/Dropdown/Group/DropdownGroup.tsx
|
|
734
|
-
var
|
|
735
|
-
|
|
734
|
+
var Oe = L("group", "Dropdown.Group"), ke = () => null;
|
|
735
|
+
ke.displayName = "DropdownGroupSurface";
|
|
736
736
|
//#endregion
|
|
737
737
|
//#region src/components/Dropdown/internal/DropdownContext.tsx
|
|
738
|
-
var
|
|
739
|
-
|
|
740
|
-
function
|
|
741
|
-
let e = d(
|
|
738
|
+
var Ae = s(null), je = s(null), Me = s(null), Ne = Ae.Provider, Pe = je.Provider;
|
|
739
|
+
Me.Provider;
|
|
740
|
+
function W() {
|
|
741
|
+
let e = d(Ae);
|
|
742
742
|
if (!e) throw Error("Dropdown compound components must be used inside Dropdown.");
|
|
743
743
|
return e;
|
|
744
744
|
}
|
|
745
|
-
function
|
|
746
|
-
let e = d(
|
|
745
|
+
function Fe() {
|
|
746
|
+
let e = d(je);
|
|
747
747
|
if (!e) throw Error("Dropdown.Trigger must be used inside Dropdown.");
|
|
748
748
|
return e;
|
|
749
749
|
}
|
|
750
|
-
var
|
|
750
|
+
var G = {
|
|
751
751
|
item: "_item_xmygj_1",
|
|
752
752
|
disabled: "_disabled_xmygj_35",
|
|
753
753
|
active: "_active_xmygj_53",
|
|
@@ -772,8 +772,8 @@ var K = {
|
|
|
772
772
|
"dropdown-sub-in": "_dropdown-sub-in_xmygj_1",
|
|
773
773
|
subLabel: "_subLabel_xmygj_300",
|
|
774
774
|
subSeparator: "_subSeparator_xmygj_308"
|
|
775
|
-
},
|
|
776
|
-
let a =
|
|
775
|
+
}, Ie = L("item", "Dropdown.Item"), Le = ({ item: e, itemIndex: i }) => {
|
|
776
|
+
let a = W(), o = g(void 0), [s, c] = _(e.type === "checkbox" ? e.props.defaultChecked ?? !1 : !1), l = a.activeIndex === i, u = a.openSubId === e.id, d = e.type === "checkbox", f = e.type === "radio", p = e.type === "subTrigger", m = d ? e.props.checked ?? s : f ? (e.groupProps?.value ?? a.radioValues[e.groupId]) === e.props.value : !1, h = a.loading || e.disabled, v = e.props, b = z(v.children), S = b.icon ?? v.icon, C = b.description ?? ("description" in v ? v.description : void 0), w = b.badge ?? ("badge" in v ? v.badge : void 0), T = b.shortcut ?? v.shortcut, E = b.content.length ? b.content : v.children, D = "color" in v ? v.color : void 0, O = e.type === "item" ? e.props.href : void 0, k = e.type === "item" ? e.props.target : void 0, A = e.type === "item" ? e.props.download : void 0, j = a.getItemId(i), M = d ? "menuitemcheckbox" : f ? "menuitemradio" : "menuitem", N = e.type === "item" && k === "_blank" && !e.props.rel ? "noreferrer noopener" : e.type === "item" ? e.props.rel : void 0, F = O ? "a" : "li", I = d || f, L = (t) => {
|
|
777
777
|
if (h) {
|
|
778
778
|
t.preventDefault();
|
|
779
779
|
return;
|
|
@@ -782,7 +782,7 @@ var K = {
|
|
|
782
782
|
let t = !m;
|
|
783
783
|
c(t), e.props.onCheckedChange?.(t);
|
|
784
784
|
}
|
|
785
|
-
a.selectItem(e,
|
|
785
|
+
a.selectItem(e, Re(t));
|
|
786
786
|
};
|
|
787
787
|
return /* @__PURE__ */ r(t, { children: [/* @__PURE__ */ r(F, {
|
|
788
788
|
id: j,
|
|
@@ -798,11 +798,11 @@ var K = {
|
|
|
798
798
|
"aria-expanded": p ? u : void 0,
|
|
799
799
|
"data-active": l || void 0,
|
|
800
800
|
"data-state": u ? "open" : void 0,
|
|
801
|
-
className: P(
|
|
802
|
-
[
|
|
803
|
-
[
|
|
804
|
-
[
|
|
805
|
-
}, D && D !== "default" ?
|
|
801
|
+
className: P(G.item, G[a.size], {
|
|
802
|
+
[G.active]: l,
|
|
803
|
+
[G.disabled]: h,
|
|
804
|
+
[G.checked]: m
|
|
805
|
+
}, D && D !== "default" ? G[D] : void 0, v.className),
|
|
806
806
|
onClick: L,
|
|
807
807
|
onMouseEnter: () => {
|
|
808
808
|
h || (a.setActiveIndex(i), p ? (window.clearTimeout(o.current), o.current = window.setTimeout(() => a.setOpenSubId(e.id), 120)) : (window.clearTimeout(o.current), a.setOpenSubId(void 0)));
|
|
@@ -812,58 +812,58 @@ var K = {
|
|
|
812
812
|
},
|
|
813
813
|
children: [
|
|
814
814
|
S && /* @__PURE__ */ n("span", {
|
|
815
|
-
className:
|
|
815
|
+
className: G.itemIcon,
|
|
816
816
|
children: S
|
|
817
817
|
}),
|
|
818
818
|
/* @__PURE__ */ r("span", {
|
|
819
|
-
className:
|
|
819
|
+
className: G.itemText,
|
|
820
820
|
children: [/* @__PURE__ */ n("span", {
|
|
821
|
-
className:
|
|
821
|
+
className: G.itemLabel,
|
|
822
822
|
children: E
|
|
823
823
|
}), C && /* @__PURE__ */ n("span", {
|
|
824
|
-
className:
|
|
824
|
+
className: G.itemDescription,
|
|
825
825
|
children: C
|
|
826
826
|
})]
|
|
827
827
|
}),
|
|
828
828
|
w && /* @__PURE__ */ n("span", {
|
|
829
|
-
className:
|
|
829
|
+
className: G.itemBadge,
|
|
830
830
|
children: w
|
|
831
831
|
}),
|
|
832
832
|
T && /* @__PURE__ */ n("span", {
|
|
833
|
-
className:
|
|
833
|
+
className: G.itemShortcut,
|
|
834
834
|
children: T
|
|
835
835
|
}),
|
|
836
836
|
I && /* @__PURE__ */ n("span", {
|
|
837
|
-
className:
|
|
837
|
+
className: G.indicator,
|
|
838
838
|
"aria-hidden": "true",
|
|
839
839
|
children: m ? /* @__PURE__ */ n(y, {}) : null
|
|
840
840
|
}),
|
|
841
841
|
p && /* @__PURE__ */ n("span", {
|
|
842
|
-
className:
|
|
842
|
+
className: G.itemShortcut,
|
|
843
843
|
"aria-hidden": "true",
|
|
844
844
|
children: /* @__PURE__ */ n(x, {})
|
|
845
845
|
})
|
|
846
846
|
]
|
|
847
847
|
}), p && u && e.subEntries.length > 0 && /* @__PURE__ */ n("ul", {
|
|
848
848
|
role: "menu",
|
|
849
|
-
className:
|
|
849
|
+
className: G.subContent,
|
|
850
850
|
onMouseEnter: () => a.setOpenSubId(e.id),
|
|
851
851
|
children: e.subEntries.map((e) => e.type === "label" ? /* @__PURE__ */ n("li", {
|
|
852
852
|
role: "presentation",
|
|
853
|
-
className:
|
|
853
|
+
className: G.subLabel,
|
|
854
854
|
children: e.props.children
|
|
855
855
|
}, e.id) : e.type === "separator" ? /* @__PURE__ */ n("li", {
|
|
856
856
|
role: "separator",
|
|
857
|
-
className:
|
|
857
|
+
className: G.subSeparator,
|
|
858
858
|
"aria-hidden": "true"
|
|
859
|
-
}, e.id) : e.type === "item" ? /* @__PURE__ */ n(
|
|
859
|
+
}, e.id) : e.type === "item" ? /* @__PURE__ */ n(ze, {
|
|
860
860
|
item: e.item,
|
|
861
861
|
id: `${j}-${e.itemIndex}`
|
|
862
862
|
}, e.item.id) : null)
|
|
863
863
|
})] });
|
|
864
864
|
};
|
|
865
|
-
|
|
866
|
-
function
|
|
865
|
+
Le.displayName = "DropdownItemRow";
|
|
866
|
+
function Re(e) {
|
|
867
867
|
let t = !1;
|
|
868
868
|
return {
|
|
869
869
|
originalEvent: e,
|
|
@@ -875,8 +875,8 @@ function Le(e) {
|
|
|
875
875
|
}
|
|
876
876
|
};
|
|
877
877
|
}
|
|
878
|
-
function
|
|
879
|
-
let i =
|
|
878
|
+
function ze({ id: e, item: t }) {
|
|
879
|
+
let i = W(), [a, o] = _(t.type === "checkbox" ? t.props.defaultChecked ?? !1 : !1), s = t.type === "checkbox", c = t.type === "radio", l = s ? t.props.checked ?? a : c ? (t.groupProps?.value ?? i.radioValues[t.groupId]) === t.props.value : !1, u = t.props, d = z(u.children), f = d.icon ?? u.icon, p = d.description ?? ("description" in u ? u.description : void 0), m = d.badge ?? ("badge" in u ? u.badge : void 0), h = d.shortcut ?? u.shortcut, g = d.content.length ? d.content : u.children, v = "color" in u ? u.color : void 0, b = i.loading || t.disabled, x = t.type === "item" ? t.props.href : void 0, S = t.type === "item" ? t.props.target : void 0, C = t.type === "item" ? t.props.download : void 0, w = s ? "menuitemcheckbox" : c ? "menuitemradio" : "menuitem", T = t.type === "item" && S === "_blank" && !t.props.rel ? "noreferrer noopener" : t.type === "item" ? t.props.rel : void 0, E = x ? "a" : "li", D = s || c, O = (e) => {
|
|
880
880
|
if (b) {
|
|
881
881
|
e.preventDefault();
|
|
882
882
|
return;
|
|
@@ -885,7 +885,7 @@ function Re({ id: e, item: t }) {
|
|
|
885
885
|
let e = !l;
|
|
886
886
|
o(e), t.props.onCheckedChange?.(e);
|
|
887
887
|
}
|
|
888
|
-
i.selectItem(t,
|
|
888
|
+
i.selectItem(t, Re(e));
|
|
889
889
|
};
|
|
890
890
|
return /* @__PURE__ */ r(E, {
|
|
891
891
|
id: e,
|
|
@@ -897,54 +897,54 @@ function Re({ id: e, item: t }) {
|
|
|
897
897
|
tabIndex: b ? -1 : 0,
|
|
898
898
|
"aria-disabled": b || void 0,
|
|
899
899
|
"aria-checked": s || c ? l : void 0,
|
|
900
|
-
className: P(
|
|
901
|
-
[
|
|
902
|
-
[
|
|
903
|
-
}, v && v !== "default" ?
|
|
900
|
+
className: P(G.item, G[i.size], {
|
|
901
|
+
[G.disabled]: b,
|
|
902
|
+
[G.checked]: l
|
|
903
|
+
}, v && v !== "default" ? G[v] : void 0),
|
|
904
904
|
onClick: O,
|
|
905
905
|
children: [
|
|
906
906
|
D && /* @__PURE__ */ n("span", {
|
|
907
|
-
className:
|
|
907
|
+
className: G.indicator,
|
|
908
908
|
"aria-hidden": "true",
|
|
909
909
|
children: l ? /* @__PURE__ */ n(y, {}) : null
|
|
910
910
|
}),
|
|
911
911
|
f && /* @__PURE__ */ n("span", {
|
|
912
|
-
className:
|
|
912
|
+
className: G.itemIcon,
|
|
913
913
|
children: f
|
|
914
914
|
}),
|
|
915
915
|
/* @__PURE__ */ r("span", {
|
|
916
|
-
className:
|
|
916
|
+
className: G.itemText,
|
|
917
917
|
children: [/* @__PURE__ */ n("span", {
|
|
918
|
-
className:
|
|
918
|
+
className: G.itemLabel,
|
|
919
919
|
children: g
|
|
920
920
|
}), p && /* @__PURE__ */ n("span", {
|
|
921
|
-
className:
|
|
921
|
+
className: G.itemDescription,
|
|
922
922
|
children: p
|
|
923
923
|
})]
|
|
924
924
|
}),
|
|
925
925
|
m && /* @__PURE__ */ n("span", {
|
|
926
|
-
className:
|
|
926
|
+
className: G.itemBadge,
|
|
927
927
|
children: m
|
|
928
928
|
}),
|
|
929
929
|
h && /* @__PURE__ */ n("span", {
|
|
930
|
-
className:
|
|
930
|
+
className: G.itemShortcut,
|
|
931
931
|
children: h
|
|
932
932
|
})
|
|
933
933
|
]
|
|
934
934
|
});
|
|
935
935
|
}
|
|
936
|
-
var
|
|
936
|
+
var Be = { group: "_group_aviwv_1" }, Ve = L("label", "Dropdown.Label"), K = ({ children: e, className: t }) => /* @__PURE__ */ n("li", {
|
|
937
937
|
role: "presentation",
|
|
938
|
-
className: P(
|
|
938
|
+
className: P(Be.group, t),
|
|
939
939
|
children: e
|
|
940
940
|
});
|
|
941
|
-
|
|
941
|
+
K.displayName = "DropdownLabelSurface";
|
|
942
942
|
//#endregion
|
|
943
943
|
//#region src/components/Dropdown/Loading/DropdownLoading.tsx
|
|
944
944
|
var q = L("loading", "Dropdown.Loading"), He = ({ children: e }) => /* @__PURE__ */ n("li", {
|
|
945
945
|
role: "presentation",
|
|
946
946
|
"aria-live": "polite",
|
|
947
|
-
className:
|
|
947
|
+
className: U.empty,
|
|
948
948
|
children: e ?? "Loading actions..."
|
|
949
949
|
});
|
|
950
950
|
He.displayName = "DropdownLoadingSurface";
|
|
@@ -957,14 +957,14 @@ Ge.displayName = "DropdownSeparatorSurface";
|
|
|
957
957
|
//#endregion
|
|
958
958
|
//#region src/components/Dropdown/Content/DropdownContent.tsx
|
|
959
959
|
var Ke = ({ className: e }) => {
|
|
960
|
-
let t =
|
|
960
|
+
let t = W(), { contentReadyToFocus: i, isOpen: o, setContentRef: s } = t, c = g(null), l = u((e) => {
|
|
961
961
|
c.current = e, s(e);
|
|
962
962
|
}, [s]);
|
|
963
963
|
if (f(() => {
|
|
964
964
|
let e = c.current;
|
|
965
965
|
!o || !i || !e || e.contains(document.activeElement) || e.focus({ preventScroll: !0 });
|
|
966
966
|
}, [i, o]), !o) return null;
|
|
967
|
-
let d = P(
|
|
967
|
+
let d = P(U.dropdown, U[t.color], t.contentProps?.className, e), p = /* @__PURE__ */ r("ul", {
|
|
968
968
|
ref: l,
|
|
969
969
|
id: t.contentId,
|
|
970
970
|
role: "menu",
|
|
@@ -981,9 +981,9 @@ var Ke = ({ className: e }) => {
|
|
|
981
981
|
"data-color": t.color,
|
|
982
982
|
children: [t.searchable && /* @__PURE__ */ r("li", {
|
|
983
983
|
role: "presentation",
|
|
984
|
-
className: P(
|
|
984
|
+
className: P(U.searchWrap, t.searchProps?.className),
|
|
985
985
|
children: [/* @__PURE__ */ n(C, { "aria-hidden": "true" }), /* @__PURE__ */ n("input", {
|
|
986
|
-
className:
|
|
986
|
+
className: U.search,
|
|
987
987
|
value: t.searchValue,
|
|
988
988
|
placeholder: t.searchPlaceholder,
|
|
989
989
|
"aria-label": t.searchProps?.["aria-label"] ?? t.searchPlaceholder,
|
|
@@ -993,12 +993,12 @@ var Ke = ({ className: e }) => {
|
|
|
993
993
|
e.key === "ArrowDown" || e.key === "ArrowUp" || e.key === "Enter" || e.key === "Escape" || e.stopPropagation();
|
|
994
994
|
}
|
|
995
995
|
})]
|
|
996
|
-
}), t.loading ? /* @__PURE__ */ n(He, { children: t.loadingText }) : t.searchable && t.items.length === 0 ? /* @__PURE__ */ n(
|
|
996
|
+
}), t.loading ? /* @__PURE__ */ n(He, { children: t.loadingText }) : t.searchable && t.items.length === 0 ? /* @__PURE__ */ n(De, { children: t.empty }) : t.entries.length ? t.entries.map((e) => e.type === "groupStart" ? /* @__PURE__ */ n(ke, {}, e.id) : e.type === "groupEnd" ? null : e.type === "label" ? /* @__PURE__ */ n(K, { ...e.props }, e.id) : e.type === "separator" ? /* @__PURE__ */ n(Ge, { ...e.props }, e.id) : e.type === "empty" ? /* @__PURE__ */ n(De, { children: e.props.children }, e.id) : e.type === "loading" ? /* @__PURE__ */ n(He, { children: e.props.children }, e.id) : e.type === "arrow" ? /* @__PURE__ */ n(I, { ...e.props }, e.id) : /* @__PURE__ */ n(a, { children: /* @__PURE__ */ n(Le, {
|
|
997
997
|
item: e.item,
|
|
998
998
|
itemIndex: e.itemIndex
|
|
999
|
-
}) }, e.item.id)) : /* @__PURE__ */ n(
|
|
999
|
+
}) }, e.item.id)) : /* @__PURE__ */ n(De, {})]
|
|
1000
1000
|
});
|
|
1001
|
-
return t.portal ? /* @__PURE__ */ n(
|
|
1001
|
+
return t.portal ? /* @__PURE__ */ n(Te, { children: p }) : p;
|
|
1002
1002
|
};
|
|
1003
1003
|
Ke.__velliraDropdownPart = "content", Ke.displayName = "Dropdown.Content";
|
|
1004
1004
|
//#endregion
|
|
@@ -1077,37 +1077,37 @@ function nt(...e) {
|
|
|
1077
1077
|
function rt(e) {
|
|
1078
1078
|
return typeof e == "number" ? `${e}px` : e;
|
|
1079
1079
|
}
|
|
1080
|
-
var it = { wrapper: "_wrapper_14ue8_1" }, at = ({ children: e, open: t, defaultOpen: i = !1, onOpenChange: a, size: o = "md", color: s = "primary", placement: c = "bottom-start", strategy: l, offset: d = 2, collisionPadding: m = 8, matchTriggerWidth: v = !1, minWidth: y, maxWidth: b, portal: x = !0, avoidCollisions: S = !0, modal: C = !1, closeOnSelect: w = !0, loop: T = !0, disabled: E = !1, loading: D = !1, loadingText: O = "Loading actions...", searchable: k = !1, command: A = !1, searchValue: j, defaultSearchValue: M = "", searchPlaceholder: N, onSearch: F, empty: I,
|
|
1081
|
-
let
|
|
1080
|
+
var it = { wrapper: "_wrapper_14ue8_1" }, at = ({ children: e, open: t, defaultOpen: i = !1, onOpenChange: a, size: o = "md", color: s = "primary", placement: c = "bottom-start", strategy: l, offset: d = 2, collisionPadding: m = 8, matchTriggerWidth: v = !1, minWidth: y, maxWidth: b, portal: x = !0, avoidCollisions: S = !0, modal: C = !1, closeOnSelect: w = !0, loop: T = !0, disabled: E = !1, loading: D = !1, loadingText: O = "Loading actions...", searchable: k = !1, command: A = !1, searchValue: j, defaultSearchValue: M = "", searchPlaceholder: N, onSearch: F, empty: I, className: L }) => {
|
|
1081
|
+
let z = p(), ee = `${z}-trigger`, B = `${z}-menu`, te = g(null), ne = g(null), [re, ie] = _(), [ae, oe] = _({}), [se, ce] = _(M), ue = j ?? se, V = h(() => R(e), [e]), fe = V.content?.props.command ?? !1, pe = k || A || fe || !!V.search, me = h(() => st(V.items), [V.items]), ge = h(() => V.items.map((e) => ({
|
|
1082
1082
|
disabled: e.disabled,
|
|
1083
1083
|
label: e.label
|
|
1084
|
-
})), [
|
|
1084
|
+
})), [V.items]), _e = h(() => !pe || !ue.trim() ? V : ct(V, ue), [
|
|
1085
1085
|
pe,
|
|
1086
|
-
|
|
1086
|
+
V,
|
|
1087
1087
|
ue
|
|
1088
|
-
]),
|
|
1088
|
+
]), ve = h(() => _e.items.map((e) => ({
|
|
1089
1089
|
disabled: e.disabled,
|
|
1090
1090
|
label: e.label
|
|
1091
|
-
})), [
|
|
1091
|
+
})), [_e.items]);
|
|
1092
1092
|
f(() => {
|
|
1093
|
-
|
|
1093
|
+
oe((e) => {
|
|
1094
1094
|
let t = { ...e };
|
|
1095
|
-
return
|
|
1095
|
+
return me.forEach((e) => {
|
|
1096
1096
|
e.type === "radio" && t[e.groupId] === void 0 && (t[e.groupId] = e.groupProps?.value ?? e.groupProps?.defaultValue);
|
|
1097
1097
|
}), t;
|
|
1098
1098
|
});
|
|
1099
|
-
}, [
|
|
1100
|
-
let { activeIndex: ye, setActiveIndex:
|
|
1101
|
-
items: pe ?
|
|
1099
|
+
}, [me]);
|
|
1100
|
+
let { activeIndex: ye, setActiveIndex: xe, isOpen: Se, closeDropdown: H, toggleDropdown: Ce, onKeyDown: we } = be({
|
|
1101
|
+
items: pe ? ve : ge,
|
|
1102
1102
|
open: t,
|
|
1103
1103
|
defaultOpen: i,
|
|
1104
1104
|
disabled: E,
|
|
1105
1105
|
onOpenChange: a,
|
|
1106
|
-
getItemValue: (e, t) => (pe ?
|
|
1106
|
+
getItemValue: (e, t) => (pe ? _e.items : V.items)[t]?.id ?? "",
|
|
1107
1107
|
getItemText: (e) => e.label,
|
|
1108
1108
|
loop: T
|
|
1109
|
-
}), { floatingStyles:
|
|
1110
|
-
open:
|
|
1109
|
+
}), { floatingStyles: Te, isMobileSheet: U, isPositioned: Ee, setRef: De, setFloatingRef: Oe } = et({
|
|
1110
|
+
open: Se,
|
|
1111
1111
|
placement: c,
|
|
1112
1112
|
strategy: l ?? (x ? "fixed" : "absolute"),
|
|
1113
1113
|
matchTriggerWidth: v,
|
|
@@ -1116,28 +1116,28 @@ var it = { wrapper: "_wrapper_14ue8_1" }, at = ({ children: e, open: t, defaultO
|
|
|
1116
1116
|
collisionPadding: m,
|
|
1117
1117
|
mobileSheetBreakpoint: 640
|
|
1118
1118
|
}), ke = u((e) => {
|
|
1119
|
-
j === void 0 &&
|
|
1119
|
+
j === void 0 && ce(e), F?.(e), xe(0);
|
|
1120
1120
|
}, [
|
|
1121
1121
|
F,
|
|
1122
1122
|
j,
|
|
1123
|
-
|
|
1123
|
+
xe
|
|
1124
1124
|
]), { isTopOverlay: Ae } = de({
|
|
1125
|
-
active:
|
|
1126
|
-
id:
|
|
1125
|
+
active: Se,
|
|
1126
|
+
id: B
|
|
1127
1127
|
});
|
|
1128
|
-
|
|
1129
|
-
active:
|
|
1128
|
+
he({
|
|
1129
|
+
active: Se,
|
|
1130
1130
|
enabled: C
|
|
1131
1131
|
});
|
|
1132
1132
|
let je = u(() => {
|
|
1133
|
-
|
|
1134
|
-
}, [
|
|
1133
|
+
H(), te.current?.focus();
|
|
1134
|
+
}, [H]), Me = u((e, t) => {
|
|
1135
1135
|
if (e.disabled || D) return;
|
|
1136
1136
|
if (e.type === "subTrigger") {
|
|
1137
|
-
|
|
1137
|
+
ie(e.id);
|
|
1138
1138
|
return;
|
|
1139
1139
|
}
|
|
1140
|
-
e.type === "item" && e.props.onSelect?.(t), e.type === "radio" && (
|
|
1140
|
+
e.type === "item" && e.props.onSelect?.(t), e.type === "radio" && (oe((t) => ({
|
|
1141
1141
|
...t,
|
|
1142
1142
|
[e.groupId]: e.props.value
|
|
1143
1143
|
})), e.groupProps?.onValueChange?.(e.props.value));
|
|
@@ -1147,92 +1147,92 @@ var it = { wrapper: "_wrapper_14ue8_1" }, at = ({ children: e, open: t, defaultO
|
|
|
1147
1147
|
je,
|
|
1148
1148
|
w,
|
|
1149
1149
|
D
|
|
1150
|
-
]),
|
|
1151
|
-
let t =
|
|
1150
|
+
]), W = u((e) => {
|
|
1151
|
+
let t = _e.items[ye];
|
|
1152
1152
|
if (e.key === "ArrowRight" && t?.type === "subTrigger") {
|
|
1153
|
-
e.preventDefault(),
|
|
1153
|
+
e.preventDefault(), ie(t.id);
|
|
1154
1154
|
return;
|
|
1155
1155
|
}
|
|
1156
|
-
if (e.key === "ArrowLeft" &&
|
|
1157
|
-
e.preventDefault(),
|
|
1156
|
+
if (e.key === "ArrowLeft" && re) {
|
|
1157
|
+
e.preventDefault(), ie(void 0);
|
|
1158
1158
|
return;
|
|
1159
1159
|
}
|
|
1160
1160
|
if ((e.key === "Enter" || e.key === " ") && t) {
|
|
1161
1161
|
e.preventDefault();
|
|
1162
1162
|
let n = ot(e);
|
|
1163
|
-
|
|
1163
|
+
Me(t, n);
|
|
1164
1164
|
return;
|
|
1165
1165
|
}
|
|
1166
|
-
|
|
1166
|
+
we(e), e.key === "Escape" && te.current?.focus();
|
|
1167
1167
|
}, [
|
|
1168
1168
|
ye,
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
]),
|
|
1174
|
-
e.preventDefault(),
|
|
1175
|
-
}, [
|
|
1176
|
-
|
|
1169
|
+
_e.items,
|
|
1170
|
+
we,
|
|
1171
|
+
re,
|
|
1172
|
+
Me
|
|
1173
|
+
]), Fe = u((e) => {
|
|
1174
|
+
e.preventDefault(), Ce();
|
|
1175
|
+
}, [Ce]), G = u((e) => {
|
|
1176
|
+
te.current = e, De(e);
|
|
1177
1177
|
}, [De]), Ie = u((e) => {
|
|
1178
|
-
|
|
1179
|
-
}, [
|
|
1180
|
-
|
|
1181
|
-
active:
|
|
1178
|
+
ne.current = e, Oe(e), U && e?.focus({ preventScroll: !0 });
|
|
1179
|
+
}, [U, Oe]);
|
|
1180
|
+
le({
|
|
1181
|
+
active: Se,
|
|
1182
1182
|
closeOnEscape: !0,
|
|
1183
1183
|
closeOnOutsidePress: !0,
|
|
1184
|
-
contentRef:
|
|
1185
|
-
ignoreRefs: [
|
|
1184
|
+
contentRef: ne,
|
|
1185
|
+
ignoreRefs: [te],
|
|
1186
1186
|
isTopOverlay: Ae,
|
|
1187
|
-
requestClose:
|
|
1187
|
+
requestClose: H
|
|
1188
1188
|
});
|
|
1189
1189
|
let Le = {
|
|
1190
|
-
...
|
|
1190
|
+
...Te,
|
|
1191
1191
|
minWidth: rt(y),
|
|
1192
1192
|
maxWidth: rt(b)
|
|
1193
1193
|
};
|
|
1194
|
-
return /* @__PURE__ */ n(
|
|
1194
|
+
return /* @__PURE__ */ n(Pe, {
|
|
1195
1195
|
value: {
|
|
1196
1196
|
disabled: E,
|
|
1197
|
-
isOpen:
|
|
1198
|
-
contentId:
|
|
1199
|
-
triggerId:
|
|
1200
|
-
setTriggerRef:
|
|
1201
|
-
onClick:
|
|
1202
|
-
onKeyDown:
|
|
1197
|
+
isOpen: Se,
|
|
1198
|
+
contentId: B,
|
|
1199
|
+
triggerId: ee,
|
|
1200
|
+
setTriggerRef: G,
|
|
1201
|
+
onClick: Fe,
|
|
1202
|
+
onKeyDown: W
|
|
1203
1203
|
},
|
|
1204
|
-
children: /* @__PURE__ */ n(
|
|
1204
|
+
children: /* @__PURE__ */ n(Ne, {
|
|
1205
1205
|
value: {
|
|
1206
1206
|
activeIndex: ye,
|
|
1207
1207
|
closeOnSelect: w,
|
|
1208
1208
|
color: s,
|
|
1209
|
-
contentReadyToFocus:
|
|
1210
|
-
contentId:
|
|
1211
|
-
contentProps:
|
|
1209
|
+
contentReadyToFocus: U || Ee,
|
|
1210
|
+
contentId: B,
|
|
1211
|
+
contentProps: V.content?.props,
|
|
1212
1212
|
disabled: E,
|
|
1213
|
-
entries:
|
|
1214
|
-
getItemId: (e) => `${
|
|
1215
|
-
isOpen:
|
|
1216
|
-
items:
|
|
1213
|
+
entries: _e.entries,
|
|
1214
|
+
getItemId: (e) => `${B}-item-${e}`,
|
|
1215
|
+
isOpen: Se,
|
|
1216
|
+
items: _e.items,
|
|
1217
1217
|
loading: D,
|
|
1218
1218
|
loadingText: O,
|
|
1219
|
-
|
|
1219
|
+
empty: I,
|
|
1220
1220
|
maxWidth: b,
|
|
1221
1221
|
minWidth: y,
|
|
1222
|
-
openSubId:
|
|
1223
|
-
onKeyDown:
|
|
1224
|
-
portal: !
|
|
1225
|
-
radioValues:
|
|
1226
|
-
searchPlaceholder:
|
|
1227
|
-
searchProps:
|
|
1222
|
+
openSubId: re,
|
|
1223
|
+
onKeyDown: W,
|
|
1224
|
+
portal: !V.portal && x,
|
|
1225
|
+
radioValues: ae,
|
|
1226
|
+
searchPlaceholder: V.search?.props.placeholder ?? N ?? (A || fe ? "Type a command..." : "Search actions..."),
|
|
1227
|
+
searchProps: V.search?.props,
|
|
1228
1228
|
searchValue: ue,
|
|
1229
1229
|
searchable: pe,
|
|
1230
|
-
selectItem:
|
|
1231
|
-
setActiveIndex:
|
|
1230
|
+
selectItem: Me,
|
|
1231
|
+
setActiveIndex: xe,
|
|
1232
1232
|
setContentRef: Ie,
|
|
1233
|
-
setOpenSubId:
|
|
1233
|
+
setOpenSubId: ie,
|
|
1234
1234
|
setRadioValue: (e, t) => {
|
|
1235
|
-
|
|
1235
|
+
oe((n) => ({
|
|
1236
1236
|
...n,
|
|
1237
1237
|
[e]: t
|
|
1238
1238
|
}));
|
|
@@ -1240,12 +1240,12 @@ var it = { wrapper: "_wrapper_14ue8_1" }, at = ({ children: e, open: t, defaultO
|
|
|
1240
1240
|
setSearchValue: ke,
|
|
1241
1241
|
size: o,
|
|
1242
1242
|
surfaceStyle: Le,
|
|
1243
|
-
triggerId:
|
|
1243
|
+
triggerId: ee
|
|
1244
1244
|
},
|
|
1245
1245
|
children: /* @__PURE__ */ r("div", {
|
|
1246
|
-
className: P(it.wrapper,
|
|
1246
|
+
className: P(it.wrapper, L),
|
|
1247
1247
|
"data-disabled": E || void 0,
|
|
1248
|
-
children: [
|
|
1248
|
+
children: [V.trigger ?? null, V.portal ?? V.content ?? /* @__PURE__ */ n(Ke, {})]
|
|
1249
1249
|
})
|
|
1250
1250
|
})
|
|
1251
1251
|
});
|
|
@@ -1298,7 +1298,7 @@ var lt = L("search", "Dropdown.Search"), ut = L("subContent", "Dropdown.SubConte
|
|
|
1298
1298
|
}, mt = (e) => /* @__PURE__ */ n(ht, { ...e });
|
|
1299
1299
|
mt.__velliraDropdownPart = "trigger", mt.displayName = "Dropdown.Trigger";
|
|
1300
1300
|
var ht = ({ children: e, asChild: t = !1, disabled: i, className: a }) => {
|
|
1301
|
-
let s =
|
|
1301
|
+
let s = W(), c = Fe(), u = t && l(e) ? e : void 0, d = s.disabled || i, f = {
|
|
1302
1302
|
id: c.triggerId,
|
|
1303
1303
|
ref: u ? nt(u.props.ref, c.setTriggerRef) : c.setTriggerRef,
|
|
1304
1304
|
"aria-controls": c.isOpen ? c.contentId : void 0,
|
|
@@ -1334,12 +1334,12 @@ var gt = Object.assign(at, {
|
|
|
1334
1334
|
Trigger: mt,
|
|
1335
1335
|
Content: Ke,
|
|
1336
1336
|
Search: lt,
|
|
1337
|
-
Item:
|
|
1337
|
+
Item: Ie,
|
|
1338
1338
|
CheckboxItem: te,
|
|
1339
1339
|
RadioGroup: Ze,
|
|
1340
1340
|
RadioItem: Qe,
|
|
1341
|
-
Group:
|
|
1342
|
-
Label:
|
|
1341
|
+
Group: Oe,
|
|
1342
|
+
Label: Ve,
|
|
1343
1343
|
Separator: We,
|
|
1344
1344
|
Sub: ft,
|
|
1345
1345
|
SubTrigger: dt,
|
|
@@ -1349,7 +1349,7 @@ var gt = Object.assign(at, {
|
|
|
1349
1349
|
ItemBadge: qe,
|
|
1350
1350
|
ItemShortcut: Xe,
|
|
1351
1351
|
Arrow: I,
|
|
1352
|
-
Empty:
|
|
1352
|
+
Empty: Ee,
|
|
1353
1353
|
Loading: q
|
|
1354
1354
|
});
|
|
1355
1355
|
gt.displayName = "Dropdown";
|
|
@@ -1418,7 +1418,7 @@ Ot.displayName = "Modal.Close";
|
|
|
1418
1418
|
//#endregion
|
|
1419
1419
|
//#region src/components/Modal/internal/useModalDismiss.ts
|
|
1420
1420
|
var kt = ({ active: e, contentRef: t, closeOnEscape: n, closeOnOutsidePress: r, isTopModal: i, onEscapeKeyDown: a, onPointerDownOutside: o, onInteractOutside: s, requestClose: c }) => {
|
|
1421
|
-
|
|
1421
|
+
le({
|
|
1422
1422
|
active: e,
|
|
1423
1423
|
closeOnOutsidePress: r,
|
|
1424
1424
|
closeOnEscape: n,
|
|
@@ -1455,7 +1455,7 @@ var kt = ({ active: e, contentRef: t, closeOnEscape: n, closeOnOutsidePress: r,
|
|
|
1455
1455
|
onInteractOutside: p.onInteractOutside,
|
|
1456
1456
|
onPointerDownOutside: p.onPointerDownOutside,
|
|
1457
1457
|
requestClose: p.requestClose
|
|
1458
|
-
}),
|
|
1458
|
+
}), ce({
|
|
1459
1459
|
active: m,
|
|
1460
1460
|
contentRef: p.contentRef,
|
|
1461
1461
|
enabled: p.trapFocus,
|
|
@@ -1545,7 +1545,7 @@ Rt.displayName = "ModalOverlay";
|
|
|
1545
1545
|
//#endregion
|
|
1546
1546
|
//#region src/components/Modal/Root/ModalRoot.tsx
|
|
1547
1547
|
var zt = ({ children: e, open: t, defaultOpen: r = !1, onOpenChange: i, modal: a = !0, closeOnEscape: o = !0, closeOnOutsidePress: s = !0, preventScroll: c = !0, restoreFocus: l = !0, trapFocus: d = !0, initialFocus: p, finalFocus: m, onOpenAutoFocus: v, onCloseAutoFocus: y, onEscapeKeyDown: b, onPointerDownOutside: x, onInteractOutside: S, role: C = "dialog", className: w }) => {
|
|
1548
|
-
let T = g(null), { contentId: E, descriptionId: D, open: O, requestClose: k, setOpen: A, titleId: j } =
|
|
1548
|
+
let T = g(null), { contentId: E, descriptionId: D, open: O, requestClose: k, setOpen: A, titleId: j } = xe({
|
|
1549
1549
|
open: t,
|
|
1550
1550
|
defaultOpen: r,
|
|
1551
1551
|
onOpenChange: i,
|
|
@@ -1559,7 +1559,7 @@ var zt = ({ children: e, open: t, defaultOpen: r = !1, onOpenChange: i, modal: a
|
|
|
1559
1559
|
active: O,
|
|
1560
1560
|
id: E
|
|
1561
1561
|
});
|
|
1562
|
-
return
|
|
1562
|
+
return he({
|
|
1563
1563
|
active: O,
|
|
1564
1564
|
enabled: c
|
|
1565
1565
|
}), f(() => {
|
|
@@ -1712,7 +1712,7 @@ var J = {
|
|
|
1712
1712
|
E,
|
|
1713
1713
|
S?.describedBy,
|
|
1714
1714
|
y
|
|
1715
|
-
].filter(Boolean).join(" ") || void 0, O = S !== null, [k, A] =
|
|
1715
|
+
].filter(Boolean).join(" ") || void 0, O = S !== null, [k, A] = ve({
|
|
1716
1716
|
value: t,
|
|
1717
1717
|
defaultValue: i,
|
|
1718
1718
|
onChange: u
|
|
@@ -1815,7 +1815,7 @@ var $t = {
|
|
|
1815
1815
|
disabled: "_disabled_1s3vp_160",
|
|
1816
1816
|
invalid: "_invalid_1s3vp_176"
|
|
1817
1817
|
}, en = c(({ value: e, defaultValue: t = "", onValueChange: i, disabled: a = !1, required: o = !1, size: s = "md", color: c = "primary", name: l, label: u, description: d, error: f, orientation: m = "vertical", children: h, className: _, id: v, onKeyDown: y, ...b }, x) => {
|
|
1818
|
-
let S = g(null), C = p(), w = v ?? C, T = u ? `${w}-label` : void 0, E = d ? `${w}-description` : void 0, D = f ? `${w}-error` : void 0, O = [E, D].filter(Boolean).join(" ") || void 0, k = l ?? `${w}-radio`, [A, j] =
|
|
1818
|
+
let S = g(null), C = p(), w = v ?? C, T = u ? `${w}-label` : void 0, E = d ? `${w}-description` : void 0, D = f ? `${w}-error` : void 0, O = [E, D].filter(Boolean).join(" ") || void 0, k = l ?? `${w}-radio`, [A, j] = ve({
|
|
1819
1819
|
value: e,
|
|
1820
1820
|
defaultValue: t,
|
|
1821
1821
|
onChange: i
|
|
@@ -2028,12 +2028,12 @@ var Y = {
|
|
|
2028
2028
|
};
|
|
2029
2029
|
un.__velliraSelectPart = "content", un.displayName = "Select.Content";
|
|
2030
2030
|
var dn = ({ isOpen: e, listboxId: i, labelledById: a, setDropdownRef: o, style: s, options: c, entries: l, multiple: d, selectedValues: p, color: m = "primary", variant: h = "outline", searchable: v, command: y, virtual: b, portal: x = !0, searchValue: C = "", searchPlaceholder: w = "Search...", loading: T, loadingText: E = "Loading...", noOptionsText: D, searchSlot: O, headerSlot: k, emptySlot: A, loadingSlot: j, renderOption: M, selectedValue: N, activeIndex: P, visualActiveIndex: F = P, className: I, onSelect: L, onSelectGroup: R, onMouseEnter: z, onSearchChange: ee }) => {
|
|
2031
|
-
let B = g(null), te = g(!1), [ne, re] = _(null), [ie, ae] = _(0), { bottomSpacerHeight: oe, isVirtual:
|
|
2031
|
+
let B = g(null), te = g(!1), [ne, re] = _(null), [ie, ae] = _(0), { bottomSpacerHeight: oe, isVirtual: se, itemHeight: ce, startIndex: le, topSpacerHeight: ue, viewportHeight: V, visibleOptions: de } = on({
|
|
2032
2032
|
loading: T,
|
|
2033
2033
|
options: c,
|
|
2034
2034
|
scrollTop: ie,
|
|
2035
2035
|
virtual: b
|
|
2036
|
-
}),
|
|
2036
|
+
}), fe = u((e) => {
|
|
2037
2037
|
re(e), o(e);
|
|
2038
2038
|
}, [o]);
|
|
2039
2039
|
if (f(() => {
|
|
@@ -2051,8 +2051,8 @@ var dn = ({ isOpen: e, listboxId: i, labelledById: a, setDropdownRef: o, style:
|
|
|
2051
2051
|
te.current = !0;
|
|
2052
2052
|
return;
|
|
2053
2053
|
}
|
|
2054
|
-
if (te.current = !0,
|
|
2055
|
-
let e = Math.max(0, n *
|
|
2054
|
+
if (te.current = !0, se) {
|
|
2055
|
+
let e = Math.max(0, n * ce - (V - ce) / 2);
|
|
2056
2056
|
ae(e), ne.scrollTop = e;
|
|
2057
2057
|
return;
|
|
2058
2058
|
}
|
|
@@ -2061,21 +2061,21 @@ var dn = ({ isOpen: e, listboxId: i, labelledById: a, setDropdownRef: o, style:
|
|
|
2061
2061
|
P,
|
|
2062
2062
|
ne,
|
|
2063
2063
|
e,
|
|
2064
|
-
V,
|
|
2065
2064
|
se,
|
|
2065
|
+
ce,
|
|
2066
2066
|
i,
|
|
2067
2067
|
T,
|
|
2068
2068
|
c,
|
|
2069
2069
|
N,
|
|
2070
2070
|
p,
|
|
2071
|
-
|
|
2071
|
+
V
|
|
2072
2072
|
]), !e) return null;
|
|
2073
|
-
let
|
|
2073
|
+
let pe = l && !se ? l : de.map((e, t) => ({
|
|
2074
2074
|
type: "option",
|
|
2075
2075
|
option: e,
|
|
2076
|
-
optionIndex:
|
|
2077
|
-
})),
|
|
2078
|
-
ref:
|
|
2076
|
+
optionIndex: le + t
|
|
2077
|
+
})), me = /* @__PURE__ */ r("div", {
|
|
2078
|
+
ref: fe,
|
|
2079
2079
|
tabIndex: 0,
|
|
2080
2080
|
className: [
|
|
2081
2081
|
Y.dropdown,
|
|
@@ -2086,7 +2086,7 @@ var dn = ({ isOpen: e, listboxId: i, labelledById: a, setDropdownRef: o, style:
|
|
|
2086
2086
|
].filter(Boolean).join(" "),
|
|
2087
2087
|
style: s,
|
|
2088
2088
|
onScroll: (e) => {
|
|
2089
|
-
|
|
2089
|
+
se && ae(e.currentTarget.scrollTop);
|
|
2090
2090
|
},
|
|
2091
2091
|
children: [
|
|
2092
2092
|
k,
|
|
@@ -2122,12 +2122,12 @@ var dn = ({ isOpen: e, listboxId: i, labelledById: a, setDropdownRef: o, style:
|
|
|
2122
2122
|
className: Y.empty,
|
|
2123
2123
|
children: j ?? E
|
|
2124
2124
|
}) : c.length ? /* @__PURE__ */ r(t, { children: [
|
|
2125
|
-
|
|
2125
|
+
se && /* @__PURE__ */ n("li", {
|
|
2126
2126
|
"aria-hidden": "true",
|
|
2127
2127
|
className: Y.virtualSpacer,
|
|
2128
|
-
style: { height:
|
|
2128
|
+
style: { height: ue }
|
|
2129
2129
|
}),
|
|
2130
|
-
|
|
2130
|
+
pe.map((e) => {
|
|
2131
2131
|
if (e.type === "group") {
|
|
2132
2132
|
if (e.selectable && d) {
|
|
2133
2133
|
let t = e.itemValues.filter((e) => c.some((t) => t.value === e && !t.disabled)), i = p ? t.filter((e) => p.includes(e)).length : 0, a = t.length > 0 && i === t.length, o = i > 0 && i < t.length;
|
|
@@ -2177,7 +2177,7 @@ var dn = ({ isOpen: e, listboxId: i, labelledById: a, setDropdownRef: o, style:
|
|
|
2177
2177
|
onMouseEnter: () => z(a)
|
|
2178
2178
|
}, t.value);
|
|
2179
2179
|
}),
|
|
2180
|
-
|
|
2180
|
+
se && /* @__PURE__ */ n("li", {
|
|
2181
2181
|
"aria-hidden": "true",
|
|
2182
2182
|
className: Y.virtualSpacer,
|
|
2183
2183
|
style: { height: oe }
|
|
@@ -2192,7 +2192,7 @@ var dn = ({ isOpen: e, listboxId: i, labelledById: a, setDropdownRef: o, style:
|
|
|
2192
2192
|
})
|
|
2193
2193
|
]
|
|
2194
2194
|
});
|
|
2195
|
-
return x ? /* @__PURE__ */ n(
|
|
2195
|
+
return x ? /* @__PURE__ */ n(Te, { children: me }) : me;
|
|
2196
2196
|
};
|
|
2197
2197
|
dn.displayName = "SelectContentSurface";
|
|
2198
2198
|
function fn(e) {
|
|
@@ -2621,159 +2621,159 @@ var Ln = ({ children: e, id: i, describedBy: a, labelledBy: o, isOpen: s, disabl
|
|
|
2621
2621
|
Ln.displayName = "SelectTriggerSurface";
|
|
2622
2622
|
//#endregion
|
|
2623
2623
|
//#region src/components/Select/Root/SelectRoot.tsx
|
|
2624
|
-
var Rn = ({ children: e, label: i, description: a, id: o, name: s, "aria-label": c, "aria-describedby": l, "aria-labelledby": d, value: m, defaultValue: v, onValueChange: y, multiple: b = !1, maxSelected: x, closeOnSelect: S, placeholder: C = "Select...", empty: w, loadingText: T = "Loading...", noOptionsText: E, size: D, color: O = "primary", variant: k = "outline", required: A = !1, disabled: j = !1, invalid: M = !1, loading: N = !1, clearable: P = !1, searchable: F = !1, virtual: I, modal: L = !1, command: R = !1, error: z, placement: ee = "bottom", matchTriggerWidth: B = !0, avoidCollisions: te = !0, portal: ne = !0, open: re, defaultOpen: ie = !1, onOpenChange: ae, onSearch: oe, onClear:
|
|
2625
|
-
let
|
|
2624
|
+
var Rn = ({ children: e, label: i, description: a, id: o, name: s, "aria-label": c, "aria-describedby": l, "aria-labelledby": d, value: m, defaultValue: v, onValueChange: y, multiple: b = !1, maxSelected: x, closeOnSelect: S, placeholder: C = "Select...", empty: w, loadingText: T = "Loading...", noOptionsText: E, size: D, color: O = "primary", variant: k = "outline", required: A = !1, disabled: j = !1, invalid: M = !1, loading: N = !1, clearable: P = !1, searchable: F = !1, virtual: I, modal: L = !1, command: R = !1, error: z, placement: ee = "bottom", matchTriggerWidth: B = !0, avoidCollisions: te = !0, portal: ne = !0, open: re, defaultOpen: ie = !1, onOpenChange: ae, onSearch: oe, onClear: se, startIcon: ce, endIcon: ue, prefix: V, suffix: fe, renderValue: pe, renderOption: me, onBlur: ge, onFocus: _e, className: ve, triggerClassName: ye, dropdownClassName: be }) => {
|
|
2625
|
+
let xe = p(), H = wn(), Ce = !!(i || a || z), we = o ?? (Ce ? void 0 : H?.controlId) ?? xe, Te = `${we}-listbox`, [U, Ee] = _(""), De = !!z, Oe = De ? `${we}-error` : void 0, ke = a ? `${we}-description` : void 0, Ae = D ?? H?.size ?? "md", je = M || De || !Ce && !!H?.invalid, Me = j || !Ce && !!H?.disabled, Ne = A || !Ce && !!H?.required, Pe = [
|
|
2626
2626
|
l,
|
|
2627
|
-
!
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
].filter(Boolean).join(" "),
|
|
2631
|
-
options:
|
|
2632
|
-
searchable:
|
|
2633
|
-
searchValue:
|
|
2634
|
-
}), { selectedValue:
|
|
2627
|
+
!Ce && !l ? H?.ariaDescribedBy : void 0,
|
|
2628
|
+
ke,
|
|
2629
|
+
Oe
|
|
2630
|
+
].filter(Boolean).join(" "), W = g(null), Fe = g(null), [G, Ie] = _(!1), Le = F || R, { entries: Re, options: ze } = Mn(e), Be = Pn({
|
|
2631
|
+
options: ze,
|
|
2632
|
+
searchable: Le,
|
|
2633
|
+
searchValue: U
|
|
2634
|
+
}), { selectedValue: Ve, selectedValues: K, isOpen: q, setIsOpen: He, setSelectedValue: Ue, activeIndex: We, setActiveIndex: Ge, closeDropdown: Ke, toggleDropdown: qe, selectValue: Je, onKeyDown: Ye } = Se({
|
|
2635
2635
|
value: m,
|
|
2636
2636
|
defaultValue: v,
|
|
2637
2637
|
onValueChange: y,
|
|
2638
|
-
options:
|
|
2638
|
+
options: Be,
|
|
2639
2639
|
multiple: b,
|
|
2640
2640
|
maxSelected: x,
|
|
2641
2641
|
closeOnSelect: S,
|
|
2642
|
-
disabled:
|
|
2642
|
+
disabled: Me,
|
|
2643
2643
|
open: re,
|
|
2644
2644
|
defaultOpen: ie,
|
|
2645
2645
|
onOpenChange: ae
|
|
2646
|
-
}), Xe = h(() =>
|
|
2646
|
+
}), Xe = h(() => ze.find((e) => K.includes(e.value)), [ze, K]), Ze = h(() => ze.filter((e) => K.includes(e.value)), [ze, K]), Qe = !!Xe, $e = Array.isArray(Ve) ? Ve[0] ?? "" : Ve, { floatingStyles: et, setRef: tt, setFloatingRef: nt } = Nn({
|
|
2647
2647
|
isOpen: q,
|
|
2648
2648
|
onOpenChange: He,
|
|
2649
2649
|
placement: ee,
|
|
2650
2650
|
matchTriggerWidth: B,
|
|
2651
2651
|
avoidCollisions: te
|
|
2652
2652
|
}), rt = u((e) => {
|
|
2653
|
-
Je(e),
|
|
2653
|
+
Je(e), W.current?.focus();
|
|
2654
2654
|
}, [Je]), it = u((e) => {
|
|
2655
2655
|
if (!b || e.length === 0) return;
|
|
2656
|
-
let t = e.filter((e) =>
|
|
2656
|
+
let t = e.filter((e) => ze.some((t) => t.value === e && !t.disabled)), n = t.filter((e) => K.includes(e)), r = K.filter((e) => !t.includes(e)).length, i = typeof x == "number" ? Math.max(0, Math.min(t.length, x - r)) : t.length;
|
|
2657
2657
|
if (n.length > 0 && n.length >= i) {
|
|
2658
|
-
Ue(
|
|
2658
|
+
Ue(K.filter((e) => !t.includes(e)));
|
|
2659
2659
|
return;
|
|
2660
2660
|
}
|
|
2661
|
-
let a = [...
|
|
2661
|
+
let a = [...K];
|
|
2662
2662
|
for (let e of t) if (!a.includes(e)) {
|
|
2663
2663
|
if (typeof x == "number" && a.length >= x) break;
|
|
2664
2664
|
a.push(e);
|
|
2665
2665
|
}
|
|
2666
|
-
Ue(a), S && (Ke(),
|
|
2666
|
+
Ue(a), S && (Ke(), W.current?.focus());
|
|
2667
2667
|
}, [
|
|
2668
2668
|
Ke,
|
|
2669
2669
|
S,
|
|
2670
2670
|
x,
|
|
2671
2671
|
b,
|
|
2672
|
-
|
|
2673
|
-
|
|
2672
|
+
ze,
|
|
2673
|
+
K,
|
|
2674
2674
|
Ue
|
|
2675
2675
|
]), at = u(() => {
|
|
2676
|
-
Je(""),
|
|
2677
|
-
}, [
|
|
2678
|
-
q ||
|
|
2676
|
+
Je(""), se?.(), W.current?.focus();
|
|
2677
|
+
}, [se, Je]), ot = u(() => {
|
|
2678
|
+
q || Ie(!1), qe();
|
|
2679
2679
|
}, [q, qe]), st = u((e) => {
|
|
2680
|
-
zn(e, q) &&
|
|
2680
|
+
zn(e, q) && Ie(!0), Ye(e);
|
|
2681
2681
|
}, [q, Ye]), ct = u((e) => {
|
|
2682
|
-
|
|
2682
|
+
Ie(!0), Ge(e);
|
|
2683
2683
|
}, [Ge]), lt = u((e) => {
|
|
2684
|
-
|
|
2684
|
+
Ee(e), oe?.(e);
|
|
2685
2685
|
}, [oe]), { isTopOverlay: ut } = de({
|
|
2686
2686
|
active: q,
|
|
2687
|
-
id:
|
|
2687
|
+
id: Te
|
|
2688
2688
|
});
|
|
2689
|
-
|
|
2689
|
+
le({
|
|
2690
2690
|
active: q,
|
|
2691
2691
|
closeOnEscape: !0,
|
|
2692
2692
|
closeOnOutsidePress: !0,
|
|
2693
|
-
contentRef:
|
|
2694
|
-
ignoreRefs: [
|
|
2693
|
+
contentRef: Fe,
|
|
2694
|
+
ignoreRefs: [W],
|
|
2695
2695
|
isTopOverlay: ut,
|
|
2696
2696
|
requestClose: Ke
|
|
2697
2697
|
}), f(() => {
|
|
2698
|
-
q ||
|
|
2698
|
+
q || Ie(!1);
|
|
2699
2699
|
}, [q]), f(() => {
|
|
2700
|
-
!q &&
|
|
2701
|
-
}, [q,
|
|
2700
|
+
!q && U && Ee("");
|
|
2701
|
+
}, [q, U]), he({
|
|
2702
2702
|
active: q,
|
|
2703
2703
|
enabled: L
|
|
2704
2704
|
});
|
|
2705
2705
|
let dt = u((e) => {
|
|
2706
|
-
|
|
2706
|
+
W.current = e, tt(e);
|
|
2707
2707
|
}, [tt]), ft = u((e) => {
|
|
2708
|
-
|
|
2709
|
-
}, [nt]), pt =
|
|
2710
|
-
id:
|
|
2711
|
-
describedBy:
|
|
2708
|
+
Fe.current = e, nt(e);
|
|
2709
|
+
}, [nt]), pt = pe ? pe(Xe) : b && Ze.length ? Ze.map((e) => e.label).join(", ") : Xe?.label ?? C, mt = w ?? E ?? "No options available", ht = P && K.length > 0 && !Me && !N, gt = {
|
|
2710
|
+
id: we,
|
|
2711
|
+
describedBy: Pe || void 0,
|
|
2712
2712
|
labelledBy: c ? void 0 : d,
|
|
2713
2713
|
isOpen: q,
|
|
2714
|
-
disabled:
|
|
2715
|
-
required:
|
|
2716
|
-
listboxId:
|
|
2714
|
+
disabled: Me,
|
|
2715
|
+
required: Ne,
|
|
2716
|
+
listboxId: Te,
|
|
2717
2717
|
activeIndex: We,
|
|
2718
|
-
ariaLabel: c ?? (!i && !
|
|
2719
|
-
error:
|
|
2718
|
+
ariaLabel: c ?? (!i && !H?.labelId ? Xe?.label || C : void 0),
|
|
2719
|
+
error: je,
|
|
2720
2720
|
loading: N,
|
|
2721
2721
|
displayText: pt,
|
|
2722
2722
|
isPlaceholder: !Qe,
|
|
2723
|
-
size:
|
|
2723
|
+
size: Ae,
|
|
2724
2724
|
color: O,
|
|
2725
2725
|
variant: k,
|
|
2726
|
-
startIcon:
|
|
2727
|
-
endIcon:
|
|
2728
|
-
prefix:
|
|
2729
|
-
suffix:
|
|
2726
|
+
startIcon: ce,
|
|
2727
|
+
endIcon: ue,
|
|
2728
|
+
prefix: V,
|
|
2729
|
+
suffix: fe,
|
|
2730
2730
|
clearable: ht,
|
|
2731
|
-
className:
|
|
2731
|
+
className: ye,
|
|
2732
2732
|
buttonRef: dt,
|
|
2733
2733
|
onClear: at,
|
|
2734
2734
|
onClick: ot,
|
|
2735
2735
|
onKeyDown: st,
|
|
2736
|
-
onBlur:
|
|
2737
|
-
onFocus:
|
|
2736
|
+
onBlur: ge,
|
|
2737
|
+
onFocus: _e
|
|
2738
2738
|
}, _t = {
|
|
2739
2739
|
isOpen: q,
|
|
2740
|
-
listboxId:
|
|
2741
|
-
labelledById:
|
|
2740
|
+
listboxId: Te,
|
|
2741
|
+
labelledById: we,
|
|
2742
2742
|
style: et,
|
|
2743
|
-
options:
|
|
2744
|
-
entries:
|
|
2743
|
+
options: Be,
|
|
2744
|
+
entries: Le || U ? void 0 : Re,
|
|
2745
2745
|
multiple: b,
|
|
2746
2746
|
color: O,
|
|
2747
2747
|
variant: k,
|
|
2748
|
-
searchable:
|
|
2748
|
+
searchable: Le,
|
|
2749
2749
|
command: R,
|
|
2750
2750
|
virtual: I,
|
|
2751
2751
|
portal: ne,
|
|
2752
|
-
searchValue:
|
|
2752
|
+
searchValue: U,
|
|
2753
2753
|
loading: N,
|
|
2754
2754
|
loadingText: T,
|
|
2755
2755
|
noOptionsText: mt,
|
|
2756
|
-
renderOption:
|
|
2756
|
+
renderOption: me,
|
|
2757
2757
|
selectedValue: $e,
|
|
2758
|
-
selectedValues:
|
|
2758
|
+
selectedValues: K,
|
|
2759
2759
|
activeIndex: We,
|
|
2760
|
-
visualActiveIndex:
|
|
2761
|
-
className:
|
|
2760
|
+
visualActiveIndex: G ? We : -1,
|
|
2761
|
+
className: be,
|
|
2762
2762
|
setDropdownRef: ft,
|
|
2763
2763
|
onSelect: rt,
|
|
2764
2764
|
onSelectGroup: it,
|
|
2765
2765
|
onMouseEnter: ct,
|
|
2766
2766
|
onSearchChange: lt
|
|
2767
|
-
}, vt = /* @__PURE__ */ r(t, { children: [s && b &&
|
|
2767
|
+
}, vt = /* @__PURE__ */ r(t, { children: [s && b && K.length > 0 && /* @__PURE__ */ n(t, { children: K.map((e) => /* @__PURE__ */ n("input", {
|
|
2768
2768
|
type: "hidden",
|
|
2769
2769
|
name: s,
|
|
2770
2770
|
value: e,
|
|
2771
|
-
disabled:
|
|
2771
|
+
disabled: Me
|
|
2772
2772
|
}, e)) }), s && !b && /* @__PURE__ */ n("input", {
|
|
2773
2773
|
type: "hidden",
|
|
2774
2774
|
name: s,
|
|
2775
2775
|
value: $e,
|
|
2776
|
-
disabled:
|
|
2776
|
+
disabled: Me
|
|
2777
2777
|
})] }), yt = kn(e), bt = /* @__PURE__ */ r(rn, {
|
|
2778
2778
|
value: {
|
|
2779
2779
|
triggerProps: gt,
|
|
@@ -2791,15 +2791,15 @@ var Rn = ({ children: e, label: i, description: a, id: o, name: s, "aria-label":
|
|
|
2791
2791
|
/* @__PURE__ */ n(dn, { ..._t })
|
|
2792
2792
|
]
|
|
2793
2793
|
});
|
|
2794
|
-
return !
|
|
2795
|
-
id:
|
|
2794
|
+
return !Ce && H ? e ? bt : xt : /* @__PURE__ */ n(Dn, {
|
|
2795
|
+
id: we,
|
|
2796
2796
|
label: i,
|
|
2797
2797
|
description: a,
|
|
2798
2798
|
error: z,
|
|
2799
|
-
required:
|
|
2800
|
-
disabled:
|
|
2799
|
+
required: Ne,
|
|
2800
|
+
disabled: Me,
|
|
2801
2801
|
bindControl: !1,
|
|
2802
|
-
className:
|
|
2802
|
+
className: ve,
|
|
2803
2803
|
children: e ? bt : xt
|
|
2804
2804
|
});
|
|
2805
2805
|
};
|
|
@@ -3124,7 +3124,7 @@ var $n = (e) => [...e].sort((e, t) => {
|
|
|
3124
3124
|
tabs: "_tabs_1hj56_1",
|
|
3125
3125
|
vertical: "_vertical_1hj56_30"
|
|
3126
3126
|
}, rr = ({ children: e, value: t, defaultValue: r, onValueChange: i, orientation: a = "horizontal", activationMode: o = "automatic", dir: s = "ltr", loop: c = !0, variant: l = "line", color: d = "primary", size: m = "md", keepMounted: h = !1, lazyMount: v = !1, disabled: y = !1, className: b, ...x }) => {
|
|
3127
|
-
let S = p(), C = t !== void 0, { value: w, setValue: T } =
|
|
3127
|
+
let S = p(), C = t !== void 0, { value: w, setValue: T } = H({
|
|
3128
3128
|
value: t,
|
|
3129
3129
|
defaultValue: r,
|
|
3130
3130
|
onValueChange: i
|
|
@@ -3450,7 +3450,7 @@ function Sr({ open: e, onOpenChange: t, placement: n, offset: r, avoidCollisions
|
|
|
3450
3450
|
//#endregion
|
|
3451
3451
|
//#region src/components/Tooltip/Root/TooltipRoot.tsx
|
|
3452
3452
|
var Cr = ({ children: e, open: t, defaultOpen: r = !1, onOpenChange: i, placement: a = "top", offset: o = 8, delay: s, skipDelay: c, disabled: l = !1, interactive: u = !1, avoidCollisions: d = !0, matchTriggerWidth: f = !1, modal: m = !1 }) => {
|
|
3453
|
-
let h = `${p()}-content`, _ = g(null), v = g(null), [y, b] =
|
|
3453
|
+
let h = `${p()}-content`, _ = g(null), v = g(null), [y, b] = ve({
|
|
3454
3454
|
value: t,
|
|
3455
3455
|
defaultValue: r,
|
|
3456
3456
|
onChange: i
|
|
@@ -3472,7 +3472,7 @@ var Cr = ({ children: e, open: t, defaultOpen: r = !1, onOpenChange: i, placemen
|
|
|
3472
3472
|
active: y,
|
|
3473
3473
|
id: h
|
|
3474
3474
|
});
|
|
3475
|
-
return
|
|
3475
|
+
return le({
|
|
3476
3476
|
active: y,
|
|
3477
3477
|
contentRef: _,
|
|
3478
3478
|
ignoreRefs: [v],
|
|
@@ -3585,7 +3585,7 @@ var Er = (e, t) => {
|
|
|
3585
3585
|
return;
|
|
3586
3586
|
}
|
|
3587
3587
|
L?.props.onClick?.(e), e.defaultPrevented || w?.(e);
|
|
3588
|
-
},
|
|
3588
|
+
}, se = /* @__PURE__ */ r(t, { children: [
|
|
3589
3589
|
f && (g ? /* @__PURE__ */ n("span", {
|
|
3590
3590
|
className: Z.icon,
|
|
3591
3591
|
"aria-hidden": "true",
|
|
@@ -3631,7 +3631,7 @@ var Er = (e, t) => {
|
|
|
3631
3631
|
onClick: oe,
|
|
3632
3632
|
tabIndex: B ? -1 : L.props.tabIndex,
|
|
3633
3633
|
title: y || L.props.title,
|
|
3634
|
-
children:
|
|
3634
|
+
children: se
|
|
3635
3635
|
}) : D ? /* @__PURE__ */ n("a", {
|
|
3636
3636
|
ref: I,
|
|
3637
3637
|
href: B ? void 0 : D,
|
|
@@ -3648,7 +3648,7 @@ var Er = (e, t) => {
|
|
|
3648
3648
|
"aria-busy": f || void 0,
|
|
3649
3649
|
className: ie,
|
|
3650
3650
|
title: y,
|
|
3651
|
-
children:
|
|
3651
|
+
children: se
|
|
3652
3652
|
}) : /* @__PURE__ */ n("button", {
|
|
3653
3653
|
...F,
|
|
3654
3654
|
ref: I,
|
|
@@ -3663,7 +3663,7 @@ var Er = (e, t) => {
|
|
|
3663
3663
|
"aria-busy": f || void 0,
|
|
3664
3664
|
className: ie,
|
|
3665
3665
|
title: y,
|
|
3666
|
-
children:
|
|
3666
|
+
children: se
|
|
3667
3667
|
});
|
|
3668
3668
|
});
|
|
3669
3669
|
Dr.displayName = "Button";
|
|
@@ -3725,7 +3725,7 @@ var Q = {
|
|
|
3725
3725
|
E,
|
|
3726
3726
|
N,
|
|
3727
3727
|
F
|
|
3728
|
-
].filter(Boolean).join(" "), [L, R] =
|
|
3728
|
+
].filter(Boolean).join(" "), [L, R] = ve({
|
|
3729
3729
|
value: s,
|
|
3730
3730
|
defaultValue: m,
|
|
3731
3731
|
onChange: S
|
|
@@ -3871,39 +3871,39 @@ var $ = {
|
|
|
3871
3871
|
r < n.length && (i += e);
|
|
3872
3872
|
}
|
|
3873
3873
|
return i;
|
|
3874
|
-
}, Ir = (e, t) => t ? typeof t == "function" ? t(e) : Fr(e, t) : e, Lr = c(({ id: e, label: i, name: a, description: o, placeholder: s, value: c, defaultValue: l, type: d = "text", size: f, color: m = "primary", variant: h = "outline", error: v, invalid: y = !1, disabled: b = !1, required: x = !1, loading: S = !1, className: w, wrapperClassName: T, autoComplete: E, readOnly: D = !1, clearable: O = !1, onClear: k, onValueChange: A, revealPassword: j = !1, showCounter: M = !1, startIcon: N, endIcon: F, startAddon: I, endAddon: L, prefix: R, suffix: z, clearIcon: ee, mask: B, format: te, parse: ne, startIconTone: re = "default", endIconTone: ie = "default", clearIconTone: ae = "danger", autoFocus: oe, maxLength:
|
|
3875
|
-
let
|
|
3876
|
-
|
|
3877
|
-
!
|
|
3878
|
-
Le,
|
|
3874
|
+
}, Ir = (e, t) => t ? typeof t == "function" ? t(e) : Fr(e, t) : e, Lr = c(({ id: e, label: i, name: a, description: o, placeholder: s, value: c, defaultValue: l, type: d = "text", size: f, color: m = "primary", variant: h = "outline", error: v, invalid: y = !1, disabled: b = !1, required: x = !1, loading: S = !1, className: w, wrapperClassName: T, autoComplete: E, readOnly: D = !1, clearable: O = !1, onClear: k, onValueChange: A, revealPassword: j = !1, showCounter: M = !1, startIcon: N, endIcon: F, startAddon: I, endAddon: L, prefix: R, suffix: z, clearIcon: ee, mask: B, format: te, parse: ne, startIconTone: re = "default", endIconTone: ie = "default", clearIconTone: ae = "danger", autoFocus: oe, maxLength: se, onMouseEnter: ce, onMouseLeave: le, "aria-describedby": ue, "aria-invalid": V, "aria-labelledby": de, ...fe }, pe) => {
|
|
3875
|
+
let me = p(), he = wn(), ge = !!(i || o || v), _e = e ?? (ge ? void 0 : he?.controlId) ?? me, ve = g(null), [ye, be] = _(!1), [xe, Se] = _(l ?? ""), H = c !== void 0, Ce = String((H ? c : xe) ?? ""), we = te ? te(Ce) : Ce, Te = Ce.length > 0, U = f ?? he?.size ?? "md", Ee = y || !!v || !ge && !!he?.invalid, De = b || !ge && !!he?.disabled, Oe = x || !ge && !!he?.required, ke = D || S, Ae = d === "password", je = Ae && j && ye ? "text" : d, Me = N ?? (d === "search" ? /* @__PURE__ */ n(C, {}) : null), Ne = F, Pe = Pr(d, E), W = S && !De, Fe = O && Te && !De && !ke && !W, G = j && Ae && !De && !W && !Fe, Ie = !W && !Fe && !G && !!Ne, Le = !!(M && se), Re = o ? `${_e}-description` : void 0, ze = v ? `${_e}-error` : void 0, Be = Le ? `${_e}-counter` : void 0, Ve = [
|
|
3876
|
+
ue,
|
|
3877
|
+
!ge && !ue ? he?.ariaDescribedBy : void 0,
|
|
3879
3878
|
Re,
|
|
3880
|
-
ze
|
|
3881
|
-
|
|
3882
|
-
|
|
3883
|
-
|
|
3879
|
+
ze,
|
|
3880
|
+
Be
|
|
3881
|
+
].filter(Boolean).join(" "), K = ee ?? "×", q = !!(Me || R), He = !!(Ne || z || Fe || G || W), Ue = !!(Me && R), We = !!(Ne && z), Ge = !!(I || L), Ke = u((e) => {
|
|
3882
|
+
if (ve.current = e, typeof pe == "function") {
|
|
3883
|
+
pe(e);
|
|
3884
3884
|
return;
|
|
3885
3885
|
}
|
|
3886
|
-
|
|
3887
|
-
}, [
|
|
3886
|
+
pe && (pe.current = e);
|
|
3887
|
+
}, [pe]), qe = u((e) => {
|
|
3888
3888
|
let t = Ir(ne ? ne(e.target.value) : e.target.value, B);
|
|
3889
|
-
|
|
3889
|
+
H || Se(t), A?.(t);
|
|
3890
3890
|
}, [
|
|
3891
|
-
|
|
3891
|
+
H,
|
|
3892
3892
|
B,
|
|
3893
3893
|
A,
|
|
3894
3894
|
ne
|
|
3895
3895
|
]), Je = u(() => {
|
|
3896
|
-
|
|
3896
|
+
H || Se(""), A?.(""), k?.(), ve.current?.focus();
|
|
3897
3897
|
}, [
|
|
3898
|
-
|
|
3898
|
+
H,
|
|
3899
3899
|
k,
|
|
3900
3900
|
A
|
|
3901
3901
|
]), Ye = /* @__PURE__ */ r(t, { children: [/* @__PURE__ */ r("div", {
|
|
3902
3902
|
className: P($.inputGroup, $[h], $[m], {
|
|
3903
3903
|
[$.hasAddons]: Ge,
|
|
3904
|
-
[$.isDisabled]:
|
|
3905
|
-
[$.isInvalid]:
|
|
3906
|
-
[$.isLoading]:
|
|
3904
|
+
[$.isDisabled]: De,
|
|
3905
|
+
[$.isInvalid]: Ee,
|
|
3906
|
+
[$.isLoading]: W
|
|
3907
3907
|
}),
|
|
3908
3908
|
children: [
|
|
3909
3909
|
I && /* @__PURE__ */ n("span", {
|
|
@@ -3918,37 +3918,37 @@ var $ = {
|
|
|
3918
3918
|
[$.hasEndIconAndSuffix]: We
|
|
3919
3919
|
}),
|
|
3920
3920
|
children: [
|
|
3921
|
-
|
|
3921
|
+
Me && /* @__PURE__ */ n("span", {
|
|
3922
3922
|
"aria-hidden": "true",
|
|
3923
3923
|
className: P($.startAdornment, Nr[re]),
|
|
3924
|
-
children:
|
|
3924
|
+
children: Me
|
|
3925
3925
|
}),
|
|
3926
3926
|
R && /* @__PURE__ */ n("span", {
|
|
3927
3927
|
className: $.prefix,
|
|
3928
3928
|
children: R
|
|
3929
3929
|
}),
|
|
3930
3930
|
/* @__PURE__ */ n("input", {
|
|
3931
|
-
...
|
|
3931
|
+
...fe,
|
|
3932
3932
|
ref: Ke,
|
|
3933
|
-
id:
|
|
3933
|
+
id: _e,
|
|
3934
3934
|
name: a,
|
|
3935
|
-
type:
|
|
3936
|
-
autoComplete:
|
|
3937
|
-
className: P($.input, $[
|
|
3938
|
-
value:
|
|
3935
|
+
type: je,
|
|
3936
|
+
autoComplete: Pe,
|
|
3937
|
+
className: P($.input, $[U], { [$.error]: Ee }, w),
|
|
3938
|
+
value: we,
|
|
3939
3939
|
onChange: qe,
|
|
3940
3940
|
placeholder: s,
|
|
3941
|
-
disabled:
|
|
3942
|
-
readOnly:
|
|
3943
|
-
required:
|
|
3941
|
+
disabled: De,
|
|
3942
|
+
readOnly: ke,
|
|
3943
|
+
required: Oe,
|
|
3944
3944
|
autoFocus: oe,
|
|
3945
|
-
maxLength:
|
|
3946
|
-
"aria-invalid":
|
|
3947
|
-
"aria-labelledby": de ?? (
|
|
3948
|
-
"aria-describedby":
|
|
3945
|
+
maxLength: se,
|
|
3946
|
+
"aria-invalid": Ee ? !0 : V,
|
|
3947
|
+
"aria-labelledby": de ?? (ge ? void 0 : he?.ariaLabelledBy),
|
|
3948
|
+
"aria-describedby": Ve || void 0,
|
|
3949
3949
|
"aria-busy": S || void 0,
|
|
3950
|
-
onMouseEnter:
|
|
3951
|
-
onMouseLeave:
|
|
3950
|
+
onMouseEnter: ce,
|
|
3951
|
+
onMouseLeave: le
|
|
3952
3952
|
}),
|
|
3953
3953
|
z && /* @__PURE__ */ n("span", {
|
|
3954
3954
|
className: $.suffix,
|
|
@@ -3957,29 +3957,29 @@ var $ = {
|
|
|
3957
3957
|
/* @__PURE__ */ r("div", {
|
|
3958
3958
|
className: $.endSlot,
|
|
3959
3959
|
children: [
|
|
3960
|
-
|
|
3960
|
+
W && /* @__PURE__ */ n("span", {
|
|
3961
3961
|
className: $.spinner,
|
|
3962
3962
|
"aria-hidden": "true",
|
|
3963
3963
|
"data-testid": "input-spinner"
|
|
3964
3964
|
}),
|
|
3965
|
-
|
|
3965
|
+
G && /* @__PURE__ */ n("button", {
|
|
3966
3966
|
type: "button",
|
|
3967
3967
|
className: $.iconButton,
|
|
3968
|
-
onClick: () =>
|
|
3969
|
-
"aria-label":
|
|
3970
|
-
children:
|
|
3968
|
+
onClick: () => be((e) => !e),
|
|
3969
|
+
"aria-label": ye ? "Hide password" : "Show password",
|
|
3970
|
+
children: ye ? "Hide" : "Show"
|
|
3971
3971
|
}),
|
|
3972
|
-
|
|
3972
|
+
Fe && /* @__PURE__ */ n("button", {
|
|
3973
3973
|
type: "button",
|
|
3974
3974
|
className: P($.clearButton, Nr[ae]),
|
|
3975
3975
|
onClick: Je,
|
|
3976
3976
|
"aria-label": "Clear input",
|
|
3977
|
-
children:
|
|
3977
|
+
children: K
|
|
3978
3978
|
}),
|
|
3979
|
-
|
|
3979
|
+
Ie && Ne && /* @__PURE__ */ n("span", {
|
|
3980
3980
|
"aria-hidden": "true",
|
|
3981
3981
|
className: P($.endAdornment, Nr[ie]),
|
|
3982
|
-
children:
|
|
3982
|
+
children: Ne
|
|
3983
3983
|
})
|
|
3984
3984
|
]
|
|
3985
3985
|
})
|
|
@@ -3990,24 +3990,24 @@ var $ = {
|
|
|
3990
3990
|
children: L
|
|
3991
3991
|
})
|
|
3992
3992
|
]
|
|
3993
|
-
}),
|
|
3994
|
-
id:
|
|
3993
|
+
}), Le && /* @__PURE__ */ r("div", {
|
|
3994
|
+
id: Be,
|
|
3995
3995
|
className: $.counter,
|
|
3996
3996
|
children: [
|
|
3997
|
-
|
|
3997
|
+
Ce.length,
|
|
3998
3998
|
" / ",
|
|
3999
|
-
|
|
3999
|
+
se
|
|
4000
4000
|
]
|
|
4001
4001
|
})] });
|
|
4002
|
-
return !
|
|
4003
|
-
id:
|
|
4002
|
+
return !ge && he ? Ye : /* @__PURE__ */ n(Dn, {
|
|
4003
|
+
id: _e,
|
|
4004
4004
|
label: i,
|
|
4005
4005
|
description: o,
|
|
4006
4006
|
error: v,
|
|
4007
|
-
required:
|
|
4008
|
-
disabled:
|
|
4009
|
-
invalid:
|
|
4010
|
-
size:
|
|
4007
|
+
required: Oe,
|
|
4008
|
+
disabled: De,
|
|
4009
|
+
invalid: Ee,
|
|
4010
|
+
size: U,
|
|
4011
4011
|
className: T,
|
|
4012
4012
|
bindControl: !1,
|
|
4013
4013
|
children: Ye
|
|
@@ -4017,7 +4017,7 @@ Lr.displayName = "Input";
|
|
|
4017
4017
|
//#endregion
|
|
4018
4018
|
//#region src/theme/ThemeContext.ts
|
|
4019
4019
|
var Rr = s(null), zr = (e) => e === "highContrast" ? "high-contrast" : e, Br = ({ theme: e, defaultTheme: t = "light", onThemeChange: r, syncDocument: i = !0, children: a }) => {
|
|
4020
|
-
let [o, s] =
|
|
4020
|
+
let [o, s] = ve({
|
|
4021
4021
|
value: e,
|
|
4022
4022
|
defaultValue: t,
|
|
4023
4023
|
onChange: r
|
|
@@ -4054,4 +4054,4 @@ function Vr() {
|
|
|
4054
4054
|
return e;
|
|
4055
4055
|
}
|
|
4056
4056
|
//#endregion
|
|
4057
|
-
export { Dr as Button, Mr as Checkbox, gt as Dropdown, Dn as FormField, Lr as Input, Vt as Modal,
|
|
4057
|
+
export { Dr as Button, Mr as Checkbox, gt as Dropdown, Dn as FormField, Lr as Input, Vt as Modal, Te as Portal, we as PortalProvider, Kt as Radio, tn as RadioGroup, Hn as Select, cr as Tabs, Br as ThemeProvider, Tr as Tooltip, Vr as useTheme };
|