@vellira-ui/react 2.41.0 → 2.42.0
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/README.md +6 -2
- package/dist/index.cjs +1 -1
- package/dist/index.js +350 -356
- package/dist/styles.css +1 -1
- 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
|
+
}, V = [], ue = {
|
|
370
370
|
add(e) {
|
|
371
|
-
|
|
371
|
+
V = V.filter((t) => t !== e), V.push(e);
|
|
372
372
|
},
|
|
373
373
|
remove(e) {
|
|
374
|
-
|
|
374
|
+
V = V.filter((t) => t !== e);
|
|
375
375
|
},
|
|
376
376
|
isTop(e) {
|
|
377
|
-
return
|
|
377
|
+
return V[V.length - 1] === e;
|
|
378
378
|
}
|
|
379
379
|
}, de = ({ active: e, id: t }) => (f(() => {
|
|
380
380
|
if (e) return ue.add(t), () => {
|
|
381
381
|
ue.remove(t);
|
|
382
382
|
};
|
|
383
|
-
}, [e, t]), { isTopOverlay: u(() => ue.isTop(t), [t]) }),
|
|
383
|
+
}, [e, t]), { isTopOverlay: u(() => ue.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
|
+
}, H = () => typeof document > "u" ? null : document.body, ge = ({ 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") ?? H() : null;
|
|
401
|
+
}, _e = ({ 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
|
+
}, ve = ({ 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
|
+
}, ye = ({ 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 } = ve({
|
|
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
|
+
}, be = ({ open: e, defaultOpen: t = !1, onOpenChange: n, closeOnEscape: r, closeOnOutsidePress: i }) => {
|
|
574
|
+
let a = p(), o = p(), s = p(), [c, l] = _e({
|
|
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
|
+
}, xe = ({ 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] = _e({
|
|
594
594
|
value: e,
|
|
595
595
|
defaultValue: t ?? (a ? [] : ""),
|
|
596
596
|
onChange: n ?? r
|
|
597
|
-
}), [v, y] =
|
|
597
|
+
}), [v, y] = _e({
|
|
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 } = ve({
|
|
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
|
+
}, U = ({ value: e, defaultValue: t = "", onValueChange: n }) => {
|
|
697
|
+
let [r, i] = _e({
|
|
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
|
+
}, Se = s(null), Ce = ({ children: e, container: t = null }) => /* @__PURE__ */ n(Se.Provider, {
|
|
707
707
|
value: t,
|
|
708
708
|
children: e
|
|
709
|
-
}),
|
|
710
|
-
let n = d(
|
|
709
|
+
}), we = ({ children: e, container: t }) => {
|
|
710
|
+
let n = d(Se), r = ge({ container: t ?? n });
|
|
711
711
|
return r ? v(e, r) : null;
|
|
712
712
|
};
|
|
713
|
-
|
|
714
|
-
var
|
|
713
|
+
we.__velliraPortal = !0, we.displayName = "Portal", Ce.displayName = "PortalProvider";
|
|
714
|
+
var Te = {
|
|
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: Te.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_1vj4n_1",
|
|
752
752
|
disabled: "_disabled_1vj4n_22",
|
|
753
753
|
active: "_active_1vj4n_37",
|
|
@@ -772,8 +772,8 @@ var K = {
|
|
|
772
772
|
"dropdown-sub-in": "_dropdown-sub-in_1vj4n_1",
|
|
773
773
|
subLabel: "_subLabel_1vj4n_276",
|
|
774
774
|
subSeparator: "_subSeparator_1vj4n_284"
|
|
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
|
I && /* @__PURE__ */ n("span", {
|
|
815
|
-
className:
|
|
815
|
+
className: G.indicator,
|
|
816
816
|
"aria-hidden": "true",
|
|
817
817
|
children: m ? /* @__PURE__ */ n(y, {}) : null
|
|
818
818
|
}),
|
|
819
819
|
S && /* @__PURE__ */ n("span", {
|
|
820
|
-
className:
|
|
820
|
+
className: G.itemIcon,
|
|
821
821
|
children: S
|
|
822
822
|
}),
|
|
823
823
|
/* @__PURE__ */ r("span", {
|
|
824
|
-
className:
|
|
824
|
+
className: G.itemText,
|
|
825
825
|
children: [/* @__PURE__ */ n("span", {
|
|
826
|
-
className:
|
|
826
|
+
className: G.itemLabel,
|
|
827
827
|
children: E
|
|
828
828
|
}), C && /* @__PURE__ */ n("span", {
|
|
829
|
-
className:
|
|
829
|
+
className: G.itemDescription,
|
|
830
830
|
children: C
|
|
831
831
|
})]
|
|
832
832
|
}),
|
|
833
833
|
w && /* @__PURE__ */ n("span", {
|
|
834
|
-
className:
|
|
834
|
+
className: G.itemBadge,
|
|
835
835
|
children: w
|
|
836
836
|
}),
|
|
837
837
|
T && /* @__PURE__ */ n("span", {
|
|
838
|
-
className:
|
|
838
|
+
className: G.itemShortcut,
|
|
839
839
|
children: T
|
|
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: Te.empty,
|
|
948
948
|
children: e ?? "Loading actions..."
|
|
949
949
|
});
|
|
950
950
|
He.displayName = "DropdownLoadingSurface";
|
|
@@ -957,9 +957,9 @@ 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();
|
|
961
961
|
if (!t.isOpen) return null;
|
|
962
|
-
let i = P(
|
|
962
|
+
let i = P(Te.dropdown, Te[t.color], t.contentProps?.className, e), o = /* @__PURE__ */ r("ul", {
|
|
963
963
|
ref: t.setContentRef,
|
|
964
964
|
id: t.contentId,
|
|
965
965
|
role: "menu",
|
|
@@ -975,9 +975,9 @@ var Ke = ({ className: e }) => {
|
|
|
975
975
|
"data-color": t.color,
|
|
976
976
|
children: [t.searchable && /* @__PURE__ */ r("li", {
|
|
977
977
|
role: "presentation",
|
|
978
|
-
className: P(
|
|
978
|
+
className: P(Te.searchWrap, t.searchProps?.className),
|
|
979
979
|
children: [/* @__PURE__ */ n(C, { "aria-hidden": "true" }), /* @__PURE__ */ n("input", {
|
|
980
|
-
className:
|
|
980
|
+
className: Te.search,
|
|
981
981
|
value: t.searchValue,
|
|
982
982
|
placeholder: t.searchPlaceholder,
|
|
983
983
|
"aria-label": t.searchProps?.["aria-label"] ?? t.searchPlaceholder,
|
|
@@ -987,12 +987,12 @@ var Ke = ({ className: e }) => {
|
|
|
987
987
|
e.key === "ArrowDown" || e.key === "ArrowUp" || e.key === "Enter" || e.key === "Escape" || e.stopPropagation();
|
|
988
988
|
}
|
|
989
989
|
})]
|
|
990
|
-
}), t.loading ? /* @__PURE__ */ n(He, { children: t.loadingText }) : t.searchable && t.items.length === 0 ? /* @__PURE__ */ n(
|
|
990
|
+
}), t.loading ? /* @__PURE__ */ n(He, { children: t.loadingText }) : t.searchable && t.items.length === 0 ? /* @__PURE__ */ n(De, { children: t.noOptionsText }) : 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, {
|
|
991
991
|
item: e.item,
|
|
992
992
|
itemIndex: e.itemIndex
|
|
993
|
-
}) }, e.item.id)) : /* @__PURE__ */ n(
|
|
993
|
+
}) }, e.item.id)) : /* @__PURE__ */ n(De, {})]
|
|
994
994
|
});
|
|
995
|
-
return t.portal ? /* @__PURE__ */ n(
|
|
995
|
+
return t.portal ? /* @__PURE__ */ n(we, { children: o }) : o;
|
|
996
996
|
};
|
|
997
997
|
Ke.__velliraDropdownPart = "content", Ke.displayName = "Dropdown.Content";
|
|
998
998
|
//#endregion
|
|
@@ -1066,174 +1066,172 @@ function nt(...e) {
|
|
|
1066
1066
|
function rt(e) {
|
|
1067
1067
|
return typeof e == "number" ? `${e}px` : e;
|
|
1068
1068
|
}
|
|
1069
|
-
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", offset: l = 2, matchTriggerWidth: d = !1, minWidth: m, maxWidth: v, portal: y = !0, avoidCollisions: b = !0, modal: x = !1, closeOnSelect: S = !0, loop: C = !0, disabled: w = !1, loading: T = !1, loadingText: E = "Loading actions...", searchable: D = !1, command: O = !1, searchValue: k, defaultSearchValue: A = "", searchPlaceholder: j, onSearch: M, empty: N, noOptionsText: F,
|
|
1070
|
-
let
|
|
1069
|
+
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", offset: l = 2, matchTriggerWidth: d = !1, minWidth: m, maxWidth: v, portal: y = !0, avoidCollisions: b = !0, modal: x = !1, closeOnSelect: S = !0, loop: C = !0, disabled: w = !1, loading: T = !1, loadingText: E = "Loading actions...", searchable: D = !1, command: O = !1, searchValue: k, defaultSearchValue: A = "", searchPlaceholder: j, onSearch: M, empty: N, noOptionsText: F, className: I }) => {
|
|
1070
|
+
let L = p(), z = `${L}-trigger`, ee = `${L}-menu`, B = g(null), te = g(null), [ne, re] = _(), [ie, ae] = _({}), [oe, se] = _(A), ce = k ?? oe, V = h(() => R(e), [e]), ue = V.content?.props.command ?? !1, fe = D || O || ue || !!V.search, pe = h(() => st(V.items), [V.items]), me = h(() => V.items.map((e) => ({
|
|
1071
1071
|
disabled: e.disabled,
|
|
1072
1072
|
label: e.label
|
|
1073
|
-
})), [
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
]),
|
|
1073
|
+
})), [V.items]), H = h(() => !fe || !ce.trim() ? V : ct(V, ce), [
|
|
1074
|
+
fe,
|
|
1075
|
+
V,
|
|
1076
|
+
ce
|
|
1077
|
+
]), ge = h(() => H.items.map((e) => ({
|
|
1078
1078
|
disabled: e.disabled,
|
|
1079
1079
|
label: e.label
|
|
1080
|
-
})), [
|
|
1080
|
+
})), [H.items]);
|
|
1081
1081
|
f(() => {
|
|
1082
|
-
|
|
1082
|
+
ae((e) => {
|
|
1083
1083
|
let t = { ...e };
|
|
1084
|
-
return
|
|
1084
|
+
return pe.forEach((e) => {
|
|
1085
1085
|
e.type === "radio" && t[e.groupId] === void 0 && (t[e.groupId] = e.groupProps?.value ?? e.groupProps?.defaultValue);
|
|
1086
1086
|
}), t;
|
|
1087
1087
|
});
|
|
1088
|
-
}, [
|
|
1089
|
-
let { activeIndex:
|
|
1090
|
-
items:
|
|
1088
|
+
}, [pe]);
|
|
1089
|
+
let { activeIndex: _e, setActiveIndex: ve, isOpen: be, closeDropdown: xe, toggleDropdown: U, onKeyDown: Se } = ye({
|
|
1090
|
+
items: fe ? ge : me,
|
|
1091
1091
|
open: t,
|
|
1092
1092
|
defaultOpen: i,
|
|
1093
1093
|
disabled: w,
|
|
1094
1094
|
onOpenChange: a,
|
|
1095
|
-
getItemValue: (e, t) => (
|
|
1095
|
+
getItemValue: (e, t) => (fe ? H.items : V.items)[t]?.id ?? "",
|
|
1096
1096
|
getItemText: (e) => e.label,
|
|
1097
1097
|
loop: C
|
|
1098
|
-
}), { floatingStyles:
|
|
1099
|
-
open:
|
|
1098
|
+
}), { floatingStyles: Ce, setRef: we, setFloatingRef: Te } = et({
|
|
1099
|
+
open: be,
|
|
1100
1100
|
placement: c,
|
|
1101
1101
|
matchTriggerWidth: d,
|
|
1102
1102
|
avoidCollisions: b,
|
|
1103
1103
|
offset: l,
|
|
1104
1104
|
mobileSheetBreakpoint: 640
|
|
1105
|
-
}),
|
|
1106
|
-
k === void 0 &&
|
|
1105
|
+
}), Ee = u((e) => {
|
|
1106
|
+
k === void 0 && se(e), M?.(e), ve(0);
|
|
1107
1107
|
}, [
|
|
1108
1108
|
M,
|
|
1109
1109
|
k,
|
|
1110
|
-
|
|
1111
|
-
]), { isTopOverlay:
|
|
1112
|
-
active:
|
|
1113
|
-
id:
|
|
1110
|
+
ve
|
|
1111
|
+
]), { isTopOverlay: De } = de({
|
|
1112
|
+
active: be,
|
|
1113
|
+
id: ee
|
|
1114
1114
|
});
|
|
1115
|
-
|
|
1116
|
-
active:
|
|
1115
|
+
he({
|
|
1116
|
+
active: be,
|
|
1117
1117
|
enabled: x
|
|
1118
1118
|
});
|
|
1119
|
-
let
|
|
1120
|
-
xe(),
|
|
1121
|
-
}, [xe]),
|
|
1119
|
+
let Oe = u(() => {
|
|
1120
|
+
xe(), B.current?.focus();
|
|
1121
|
+
}, [xe]), ke = u((e, t) => {
|
|
1122
1122
|
if (e.disabled || T) return;
|
|
1123
1123
|
if (e.type === "subTrigger") {
|
|
1124
|
-
|
|
1124
|
+
re(e.id);
|
|
1125
1125
|
return;
|
|
1126
1126
|
}
|
|
1127
|
-
e.type === "item" && e.props.onSelect?.(t), e.type === "radio" && (
|
|
1127
|
+
e.type === "item" && e.props.onSelect?.(t), e.type === "radio" && (ae((t) => ({
|
|
1128
1128
|
...t,
|
|
1129
1129
|
[e.groupId]: e.props.value
|
|
1130
1130
|
})), e.groupProps?.onValueChange?.(e.props.value));
|
|
1131
1131
|
let n = e.props.closeOnSelect ?? (e.type !== "checkbox" && S);
|
|
1132
|
-
!t.defaultPrevented && n &&
|
|
1132
|
+
!t.defaultPrevented && n && Oe();
|
|
1133
1133
|
}, [
|
|
1134
|
-
|
|
1134
|
+
Oe,
|
|
1135
1135
|
S,
|
|
1136
1136
|
T
|
|
1137
|
-
]),
|
|
1138
|
-
let t =
|
|
1137
|
+
]), Ae = u((e) => {
|
|
1138
|
+
let t = H.items[_e];
|
|
1139
1139
|
if (e.key === "ArrowRight" && t?.type === "subTrigger") {
|
|
1140
|
-
e.preventDefault(),
|
|
1140
|
+
e.preventDefault(), re(t.id);
|
|
1141
1141
|
return;
|
|
1142
1142
|
}
|
|
1143
|
-
if (e.key === "ArrowLeft" &&
|
|
1144
|
-
e.preventDefault(),
|
|
1143
|
+
if (e.key === "ArrowLeft" && ne) {
|
|
1144
|
+
e.preventDefault(), re(void 0);
|
|
1145
1145
|
return;
|
|
1146
1146
|
}
|
|
1147
1147
|
if ((e.key === "Enter" || e.key === " ") && t) {
|
|
1148
1148
|
e.preventDefault();
|
|
1149
1149
|
let n = ot(e);
|
|
1150
|
-
|
|
1150
|
+
ke(t, n);
|
|
1151
1151
|
return;
|
|
1152
1152
|
}
|
|
1153
|
-
|
|
1153
|
+
Se(e), e.key === "Escape" && B.current?.focus();
|
|
1154
1154
|
}, [
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
]),
|
|
1161
|
-
e.preventDefault(),
|
|
1162
|
-
}, [
|
|
1163
|
-
|
|
1164
|
-
}, [
|
|
1165
|
-
|
|
1166
|
-
}, [
|
|
1167
|
-
|
|
1168
|
-
active:
|
|
1155
|
+
_e,
|
|
1156
|
+
H.items,
|
|
1157
|
+
Se,
|
|
1158
|
+
ne,
|
|
1159
|
+
ke
|
|
1160
|
+
]), je = u((e) => {
|
|
1161
|
+
e.preventDefault(), U();
|
|
1162
|
+
}, [U]), Me = u((e) => {
|
|
1163
|
+
B.current = e, we(e);
|
|
1164
|
+
}, [we]), W = u((e) => {
|
|
1165
|
+
te.current = e, Te(e), e?.focus();
|
|
1166
|
+
}, [Te]);
|
|
1167
|
+
le({
|
|
1168
|
+
active: be,
|
|
1169
1169
|
closeOnEscape: !0,
|
|
1170
1170
|
closeOnOutsidePress: !0,
|
|
1171
|
-
contentRef:
|
|
1172
|
-
ignoreRefs: [
|
|
1173
|
-
isTopOverlay:
|
|
1171
|
+
contentRef: te,
|
|
1172
|
+
ignoreRefs: [B],
|
|
1173
|
+
isTopOverlay: De,
|
|
1174
1174
|
requestClose: xe
|
|
1175
1175
|
});
|
|
1176
1176
|
let Fe = {
|
|
1177
|
-
...
|
|
1177
|
+
...Ce,
|
|
1178
1178
|
minWidth: rt(m),
|
|
1179
1179
|
maxWidth: rt(v)
|
|
1180
1180
|
};
|
|
1181
|
-
return /* @__PURE__ */ n(
|
|
1181
|
+
return /* @__PURE__ */ n(Pe, {
|
|
1182
1182
|
value: {
|
|
1183
1183
|
disabled: w,
|
|
1184
|
-
isOpen:
|
|
1185
|
-
contentId:
|
|
1186
|
-
triggerId:
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
onKeyDown: je
|
|
1184
|
+
isOpen: be,
|
|
1185
|
+
contentId: ee,
|
|
1186
|
+
triggerId: z,
|
|
1187
|
+
setTriggerRef: Me,
|
|
1188
|
+
onClick: je,
|
|
1189
|
+
onKeyDown: Ae
|
|
1191
1190
|
},
|
|
1192
|
-
children: /* @__PURE__ */ n(
|
|
1191
|
+
children: /* @__PURE__ */ n(Ne, {
|
|
1193
1192
|
value: {
|
|
1194
|
-
activeIndex:
|
|
1193
|
+
activeIndex: _e,
|
|
1195
1194
|
closeOnSelect: S,
|
|
1196
1195
|
color: s,
|
|
1197
|
-
contentId:
|
|
1198
|
-
contentProps:
|
|
1196
|
+
contentId: ee,
|
|
1197
|
+
contentProps: V.content?.props,
|
|
1199
1198
|
disabled: w,
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
items: U.items,
|
|
1199
|
+
entries: H.entries,
|
|
1200
|
+
getItemId: (e) => `${ee}-item-${e}`,
|
|
1201
|
+
isOpen: be,
|
|
1202
|
+
items: H.items,
|
|
1205
1203
|
loading: T,
|
|
1206
1204
|
loadingText: E,
|
|
1207
1205
|
noOptionsText: N ?? F,
|
|
1208
1206
|
maxWidth: v,
|
|
1209
1207
|
minWidth: m,
|
|
1210
|
-
openSubId:
|
|
1211
|
-
onKeyDown:
|
|
1212
|
-
portal: !
|
|
1213
|
-
radioValues:
|
|
1214
|
-
searchPlaceholder:
|
|
1215
|
-
searchProps:
|
|
1216
|
-
searchValue:
|
|
1217
|
-
searchable:
|
|
1218
|
-
selectItem:
|
|
1219
|
-
setActiveIndex:
|
|
1220
|
-
setContentRef:
|
|
1221
|
-
setOpenSubId:
|
|
1208
|
+
openSubId: ne,
|
|
1209
|
+
onKeyDown: Ae,
|
|
1210
|
+
portal: !V.portal && y,
|
|
1211
|
+
radioValues: ie,
|
|
1212
|
+
searchPlaceholder: V.search?.props.placeholder ?? j ?? (O || ue ? "Type a command..." : "Search actions..."),
|
|
1213
|
+
searchProps: V.search?.props,
|
|
1214
|
+
searchValue: ce,
|
|
1215
|
+
searchable: fe,
|
|
1216
|
+
selectItem: ke,
|
|
1217
|
+
setActiveIndex: ve,
|
|
1218
|
+
setContentRef: W,
|
|
1219
|
+
setOpenSubId: re,
|
|
1222
1220
|
setRadioValue: (e, t) => {
|
|
1223
|
-
|
|
1221
|
+
ae((n) => ({
|
|
1224
1222
|
...n,
|
|
1225
1223
|
[e]: t
|
|
1226
1224
|
}));
|
|
1227
1225
|
},
|
|
1228
|
-
setSearchValue:
|
|
1226
|
+
setSearchValue: Ee,
|
|
1229
1227
|
size: o,
|
|
1230
1228
|
surfaceStyle: Fe,
|
|
1231
|
-
triggerId:
|
|
1229
|
+
triggerId: z
|
|
1232
1230
|
},
|
|
1233
1231
|
children: /* @__PURE__ */ r("div", {
|
|
1234
|
-
className: P(it.wrapper,
|
|
1232
|
+
className: P(it.wrapper, I),
|
|
1235
1233
|
"data-disabled": w || void 0,
|
|
1236
|
-
children: [
|
|
1234
|
+
children: [V.trigger ?? null, V.portal ?? V.content ?? /* @__PURE__ */ n(Ke, {})]
|
|
1237
1235
|
})
|
|
1238
1236
|
})
|
|
1239
1237
|
});
|
|
@@ -1286,14 +1284,14 @@ var lt = L("search", "Dropdown.Search"), ut = L("subContent", "Dropdown.SubConte
|
|
|
1286
1284
|
}, mt = (e) => /* @__PURE__ */ n(ht, { ...e });
|
|
1287
1285
|
mt.__velliraDropdownPart = "trigger", mt.displayName = "Dropdown.Trigger";
|
|
1288
1286
|
var ht = ({ children: e, asChild: t = !1, disabled: i, className: a }) => {
|
|
1289
|
-
let s =
|
|
1287
|
+
let s = W(), c = Fe(), u = t && l(e) ? e : void 0, d = s.disabled || i, f = {
|
|
1290
1288
|
id: c.triggerId,
|
|
1291
1289
|
ref: u ? nt(u.props.ref, c.setTriggerRef) : c.setTriggerRef,
|
|
1292
1290
|
"aria-controls": c.isOpen ? c.contentId : void 0,
|
|
1293
1291
|
"aria-disabled": d || void 0,
|
|
1294
1292
|
"aria-expanded": c.isOpen,
|
|
1295
1293
|
"aria-haspopup": "menu",
|
|
1296
|
-
className: P(!u && pt.button, !u && pt[s.size], !u && pt[s.color],
|
|
1294
|
+
className: P(!u && pt.button, !u && pt[s.size], !u && pt[s.color], a),
|
|
1297
1295
|
"data-state": c.isOpen ? "open" : "closed",
|
|
1298
1296
|
disabled: d || void 0,
|
|
1299
1297
|
onClick: tt(u?.props.onClick, c.onClick),
|
|
@@ -1322,12 +1320,12 @@ var gt = Object.assign(at, {
|
|
|
1322
1320
|
Trigger: mt,
|
|
1323
1321
|
Content: Ke,
|
|
1324
1322
|
Search: lt,
|
|
1325
|
-
Item:
|
|
1323
|
+
Item: Ie,
|
|
1326
1324
|
CheckboxItem: te,
|
|
1327
1325
|
RadioGroup: Ze,
|
|
1328
1326
|
RadioItem: Qe,
|
|
1329
|
-
Group:
|
|
1330
|
-
Label:
|
|
1327
|
+
Group: Oe,
|
|
1328
|
+
Label: Ve,
|
|
1331
1329
|
Separator: We,
|
|
1332
1330
|
Sub: ft,
|
|
1333
1331
|
SubTrigger: dt,
|
|
@@ -1336,12 +1334,8 @@ var gt = Object.assign(at, {
|
|
|
1336
1334
|
ItemDescription: Je,
|
|
1337
1335
|
ItemBadge: qe,
|
|
1338
1336
|
ItemShortcut: Xe,
|
|
1339
|
-
Icon: Ye,
|
|
1340
|
-
Description: Je,
|
|
1341
|
-
Badge: qe,
|
|
1342
|
-
Shortcut: Xe,
|
|
1343
1337
|
Arrow: I,
|
|
1344
|
-
Empty:
|
|
1338
|
+
Empty: Ee,
|
|
1345
1339
|
Loading: q
|
|
1346
1340
|
});
|
|
1347
1341
|
gt.displayName = "Dropdown";
|
|
@@ -1410,7 +1404,7 @@ Ot.displayName = "Modal.Close";
|
|
|
1410
1404
|
//#endregion
|
|
1411
1405
|
//#region src/components/Modal/internal/useModalDismiss.ts
|
|
1412
1406
|
var kt = ({ active: e, contentRef: t, closeOnEscape: n, closeOnOutsidePress: r, isTopModal: i, onEscapeKeyDown: a, onPointerDownOutside: o, onInteractOutside: s, requestClose: c }) => {
|
|
1413
|
-
|
|
1407
|
+
le({
|
|
1414
1408
|
active: e,
|
|
1415
1409
|
closeOnOutsidePress: r,
|
|
1416
1410
|
closeOnEscape: n,
|
|
@@ -1447,7 +1441,7 @@ var kt = ({ active: e, contentRef: t, closeOnEscape: n, closeOnOutsidePress: r,
|
|
|
1447
1441
|
onInteractOutside: p.onInteractOutside,
|
|
1448
1442
|
onPointerDownOutside: p.onPointerDownOutside,
|
|
1449
1443
|
requestClose: p.requestClose
|
|
1450
|
-
}),
|
|
1444
|
+
}), ce({
|
|
1451
1445
|
active: m,
|
|
1452
1446
|
contentRef: p.contentRef,
|
|
1453
1447
|
enabled: p.trapFocus,
|
|
@@ -1537,7 +1531,7 @@ Rt.displayName = "ModalOverlay";
|
|
|
1537
1531
|
//#endregion
|
|
1538
1532
|
//#region src/components/Modal/Root/ModalRoot.tsx
|
|
1539
1533
|
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 }) => {
|
|
1540
|
-
let T = g(null), { contentId: E, descriptionId: D, open: O, requestClose: k, setOpen: A, titleId: j } =
|
|
1534
|
+
let T = g(null), { contentId: E, descriptionId: D, open: O, requestClose: k, setOpen: A, titleId: j } = be({
|
|
1541
1535
|
open: t,
|
|
1542
1536
|
defaultOpen: r,
|
|
1543
1537
|
onOpenChange: i,
|
|
@@ -1551,7 +1545,7 @@ var zt = ({ children: e, open: t, defaultOpen: r = !1, onOpenChange: i, modal: a
|
|
|
1551
1545
|
active: O,
|
|
1552
1546
|
id: E
|
|
1553
1547
|
});
|
|
1554
|
-
return
|
|
1548
|
+
return he({
|
|
1555
1549
|
active: O,
|
|
1556
1550
|
enabled: c
|
|
1557
1551
|
}), f(() => {
|
|
@@ -1704,7 +1698,7 @@ var J = {
|
|
|
1704
1698
|
E,
|
|
1705
1699
|
S?.describedBy,
|
|
1706
1700
|
y
|
|
1707
|
-
].filter(Boolean).join(" ") || void 0, O = S !== null, [k, A] =
|
|
1701
|
+
].filter(Boolean).join(" ") || void 0, O = S !== null, [k, A] = _e({
|
|
1708
1702
|
value: t,
|
|
1709
1703
|
defaultValue: i,
|
|
1710
1704
|
onChange: u
|
|
@@ -1807,7 +1801,7 @@ var $t = {
|
|
|
1807
1801
|
disabled: "_disabled_1s3vp_160",
|
|
1808
1802
|
invalid: "_invalid_1s3vp_176"
|
|
1809
1803
|
}, 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) => {
|
|
1810
|
-
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] =
|
|
1804
|
+
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] = _e({
|
|
1811
1805
|
value: e,
|
|
1812
1806
|
defaultValue: t,
|
|
1813
1807
|
onChange: i
|
|
@@ -2020,12 +2014,12 @@ var Y = {
|
|
|
2020
2014
|
};
|
|
2021
2015
|
un.__velliraSelectPart = "content", un.displayName = "Select.Content";
|
|
2022
2016
|
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 }) => {
|
|
2023
|
-
let B = g(null), te = g(!1), [ne, re] = _(null), [ie, ae] = _(0), { bottomSpacerHeight: oe, isVirtual:
|
|
2017
|
+
let B = g(null), te = g(!1), [ne, re] = _(null), [ie, ae] = _(0), { bottomSpacerHeight: oe, isVirtual: se, itemHeight: ce, startIndex: le, topSpacerHeight: V, viewportHeight: ue, visibleOptions: de } = on({
|
|
2024
2018
|
loading: T,
|
|
2025
2019
|
options: c,
|
|
2026
2020
|
scrollTop: ie,
|
|
2027
2021
|
virtual: b
|
|
2028
|
-
}),
|
|
2022
|
+
}), fe = u((e) => {
|
|
2029
2023
|
re(e), o(e);
|
|
2030
2024
|
}, [o]);
|
|
2031
2025
|
if (f(() => {
|
|
@@ -2043,8 +2037,8 @@ var dn = ({ isOpen: e, listboxId: i, labelledById: a, setDropdownRef: o, style:
|
|
|
2043
2037
|
te.current = !0;
|
|
2044
2038
|
return;
|
|
2045
2039
|
}
|
|
2046
|
-
if (te.current = !0,
|
|
2047
|
-
let e = Math.max(0, n *
|
|
2040
|
+
if (te.current = !0, se) {
|
|
2041
|
+
let e = Math.max(0, n * ce - (ue - ce) / 2);
|
|
2048
2042
|
ae(e), ne.scrollTop = e;
|
|
2049
2043
|
return;
|
|
2050
2044
|
}
|
|
@@ -2053,8 +2047,8 @@ var dn = ({ isOpen: e, listboxId: i, labelledById: a, setDropdownRef: o, style:
|
|
|
2053
2047
|
P,
|
|
2054
2048
|
ne,
|
|
2055
2049
|
e,
|
|
2056
|
-
V,
|
|
2057
2050
|
se,
|
|
2051
|
+
ce,
|
|
2058
2052
|
i,
|
|
2059
2053
|
T,
|
|
2060
2054
|
c,
|
|
@@ -2062,12 +2056,12 @@ var dn = ({ isOpen: e, listboxId: i, labelledById: a, setDropdownRef: o, style:
|
|
|
2062
2056
|
p,
|
|
2063
2057
|
ue
|
|
2064
2058
|
]), !e) return null;
|
|
2065
|
-
let
|
|
2059
|
+
let pe = l && !se ? l : de.map((e, t) => ({
|
|
2066
2060
|
type: "option",
|
|
2067
2061
|
option: e,
|
|
2068
|
-
optionIndex:
|
|
2069
|
-
})),
|
|
2070
|
-
ref:
|
|
2062
|
+
optionIndex: le + t
|
|
2063
|
+
})), me = /* @__PURE__ */ r("div", {
|
|
2064
|
+
ref: fe,
|
|
2071
2065
|
tabIndex: 0,
|
|
2072
2066
|
className: [
|
|
2073
2067
|
Y.dropdown,
|
|
@@ -2078,7 +2072,7 @@ var dn = ({ isOpen: e, listboxId: i, labelledById: a, setDropdownRef: o, style:
|
|
|
2078
2072
|
].filter(Boolean).join(" "),
|
|
2079
2073
|
style: s,
|
|
2080
2074
|
onScroll: (e) => {
|
|
2081
|
-
|
|
2075
|
+
se && ae(e.currentTarget.scrollTop);
|
|
2082
2076
|
},
|
|
2083
2077
|
children: [
|
|
2084
2078
|
k,
|
|
@@ -2114,12 +2108,12 @@ var dn = ({ isOpen: e, listboxId: i, labelledById: a, setDropdownRef: o, style:
|
|
|
2114
2108
|
className: Y.empty,
|
|
2115
2109
|
children: j ?? E
|
|
2116
2110
|
}) : c.length ? /* @__PURE__ */ r(t, { children: [
|
|
2117
|
-
|
|
2111
|
+
se && /* @__PURE__ */ n("li", {
|
|
2118
2112
|
"aria-hidden": "true",
|
|
2119
2113
|
className: Y.virtualSpacer,
|
|
2120
|
-
style: { height:
|
|
2114
|
+
style: { height: V }
|
|
2121
2115
|
}),
|
|
2122
|
-
|
|
2116
|
+
pe.map((e) => {
|
|
2123
2117
|
if (e.type === "group") {
|
|
2124
2118
|
if (e.selectable && d) {
|
|
2125
2119
|
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;
|
|
@@ -2169,7 +2163,7 @@ var dn = ({ isOpen: e, listboxId: i, labelledById: a, setDropdownRef: o, style:
|
|
|
2169
2163
|
onMouseEnter: () => z(a)
|
|
2170
2164
|
}, t.value);
|
|
2171
2165
|
}),
|
|
2172
|
-
|
|
2166
|
+
se && /* @__PURE__ */ n("li", {
|
|
2173
2167
|
"aria-hidden": "true",
|
|
2174
2168
|
className: Y.virtualSpacer,
|
|
2175
2169
|
style: { height: oe }
|
|
@@ -2184,7 +2178,7 @@ var dn = ({ isOpen: e, listboxId: i, labelledById: a, setDropdownRef: o, style:
|
|
|
2184
2178
|
})
|
|
2185
2179
|
]
|
|
2186
2180
|
});
|
|
2187
|
-
return x ? /* @__PURE__ */ n(
|
|
2181
|
+
return x ? /* @__PURE__ */ n(we, { children: me }) : me;
|
|
2188
2182
|
};
|
|
2189
2183
|
dn.displayName = "SelectContentSurface";
|
|
2190
2184
|
function fn(e) {
|
|
@@ -2613,159 +2607,159 @@ var Ln = ({ children: e, id: i, describedBy: a, labelledBy: o, isOpen: s, disabl
|
|
|
2613
2607
|
Ln.displayName = "SelectTriggerSurface";
|
|
2614
2608
|
//#endregion
|
|
2615
2609
|
//#region src/components/Select/Root/SelectRoot.tsx
|
|
2616
|
-
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:
|
|
2617
|
-
let
|
|
2610
|
+
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: V, prefix: ue, suffix: fe, renderValue: pe, renderOption: me, onBlur: H, onFocus: ge, className: _e, triggerClassName: ve, dropdownClassName: ye }) => {
|
|
2611
|
+
let be = p(), U = wn(), Se = !!(i || a || z), Ce = o ?? (Se ? void 0 : U?.controlId) ?? be, we = `${Ce}-listbox`, [Te, Ee] = _(""), De = !!z, Oe = De ? `${Ce}-error` : void 0, ke = a ? `${Ce}-description` : void 0, Ae = D ?? U?.size ?? "md", je = M || De || !Se && !!U?.invalid, Me = j || !Se && !!U?.disabled, Ne = A || !Se && !!U?.required, Pe = [
|
|
2618
2612
|
l,
|
|
2619
|
-
!
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
].filter(Boolean).join(" "),
|
|
2623
|
-
options:
|
|
2624
|
-
searchable:
|
|
2625
|
-
searchValue:
|
|
2626
|
-
}), { selectedValue:
|
|
2613
|
+
!Se && !l ? U?.ariaDescribedBy : void 0,
|
|
2614
|
+
ke,
|
|
2615
|
+
Oe
|
|
2616
|
+
].filter(Boolean).join(" "), W = g(null), Fe = g(null), [G, Ie] = _(!1), Le = F || R, { entries: Re, options: ze } = Mn(e), Be = Pn({
|
|
2617
|
+
options: ze,
|
|
2618
|
+
searchable: Le,
|
|
2619
|
+
searchValue: Te
|
|
2620
|
+
}), { selectedValue: Ve, selectedValues: K, isOpen: q, setIsOpen: He, setSelectedValue: Ue, activeIndex: We, setActiveIndex: Ge, closeDropdown: Ke, toggleDropdown: qe, selectValue: Je, onKeyDown: Ye } = xe({
|
|
2627
2621
|
value: m,
|
|
2628
2622
|
defaultValue: v,
|
|
2629
2623
|
onValueChange: y,
|
|
2630
|
-
options:
|
|
2624
|
+
options: Be,
|
|
2631
2625
|
multiple: b,
|
|
2632
2626
|
maxSelected: x,
|
|
2633
2627
|
closeOnSelect: S,
|
|
2634
|
-
disabled:
|
|
2628
|
+
disabled: Me,
|
|
2635
2629
|
open: re,
|
|
2636
2630
|
defaultOpen: ie,
|
|
2637
2631
|
onOpenChange: ae
|
|
2638
|
-
}), Xe = h(() =>
|
|
2632
|
+
}), 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({
|
|
2639
2633
|
isOpen: q,
|
|
2640
2634
|
onOpenChange: He,
|
|
2641
2635
|
placement: ee,
|
|
2642
2636
|
matchTriggerWidth: B,
|
|
2643
2637
|
avoidCollisions: te
|
|
2644
2638
|
}), rt = u((e) => {
|
|
2645
|
-
Je(e),
|
|
2639
|
+
Je(e), W.current?.focus();
|
|
2646
2640
|
}, [Je]), it = u((e) => {
|
|
2647
2641
|
if (!b || e.length === 0) return;
|
|
2648
|
-
let t = e.filter((e) =>
|
|
2642
|
+
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;
|
|
2649
2643
|
if (n.length > 0 && n.length >= i) {
|
|
2650
|
-
Ue(
|
|
2644
|
+
Ue(K.filter((e) => !t.includes(e)));
|
|
2651
2645
|
return;
|
|
2652
2646
|
}
|
|
2653
|
-
let a = [...
|
|
2647
|
+
let a = [...K];
|
|
2654
2648
|
for (let e of t) if (!a.includes(e)) {
|
|
2655
2649
|
if (typeof x == "number" && a.length >= x) break;
|
|
2656
2650
|
a.push(e);
|
|
2657
2651
|
}
|
|
2658
|
-
Ue(a), S && (Ke(),
|
|
2652
|
+
Ue(a), S && (Ke(), W.current?.focus());
|
|
2659
2653
|
}, [
|
|
2660
2654
|
Ke,
|
|
2661
2655
|
S,
|
|
2662
2656
|
x,
|
|
2663
2657
|
b,
|
|
2664
|
-
|
|
2665
|
-
|
|
2658
|
+
ze,
|
|
2659
|
+
K,
|
|
2666
2660
|
Ue
|
|
2667
2661
|
]), at = u(() => {
|
|
2668
|
-
Je(""),
|
|
2669
|
-
}, [
|
|
2670
|
-
q ||
|
|
2662
|
+
Je(""), se?.(), W.current?.focus();
|
|
2663
|
+
}, [se, Je]), ot = u(() => {
|
|
2664
|
+
q || Ie(!1), qe();
|
|
2671
2665
|
}, [q, qe]), st = u((e) => {
|
|
2672
|
-
zn(e, q) &&
|
|
2666
|
+
zn(e, q) && Ie(!0), Ye(e);
|
|
2673
2667
|
}, [q, Ye]), ct = u((e) => {
|
|
2674
|
-
|
|
2668
|
+
Ie(!0), Ge(e);
|
|
2675
2669
|
}, [Ge]), lt = u((e) => {
|
|
2676
|
-
|
|
2670
|
+
Ee(e), oe?.(e);
|
|
2677
2671
|
}, [oe]), { isTopOverlay: ut } = de({
|
|
2678
2672
|
active: q,
|
|
2679
|
-
id:
|
|
2673
|
+
id: we
|
|
2680
2674
|
});
|
|
2681
|
-
|
|
2675
|
+
le({
|
|
2682
2676
|
active: q,
|
|
2683
2677
|
closeOnEscape: !0,
|
|
2684
2678
|
closeOnOutsidePress: !0,
|
|
2685
|
-
contentRef:
|
|
2686
|
-
ignoreRefs: [
|
|
2679
|
+
contentRef: Fe,
|
|
2680
|
+
ignoreRefs: [W],
|
|
2687
2681
|
isTopOverlay: ut,
|
|
2688
2682
|
requestClose: Ke
|
|
2689
2683
|
}), f(() => {
|
|
2690
|
-
q ||
|
|
2684
|
+
q || Ie(!1);
|
|
2691
2685
|
}, [q]), f(() => {
|
|
2692
|
-
!q &&
|
|
2693
|
-
}, [q,
|
|
2686
|
+
!q && Te && Ee("");
|
|
2687
|
+
}, [q, Te]), he({
|
|
2694
2688
|
active: q,
|
|
2695
2689
|
enabled: L
|
|
2696
2690
|
});
|
|
2697
2691
|
let dt = u((e) => {
|
|
2698
|
-
|
|
2692
|
+
W.current = e, tt(e);
|
|
2699
2693
|
}, [tt]), ft = u((e) => {
|
|
2700
|
-
|
|
2701
|
-
}, [nt]), pt =
|
|
2702
|
-
id:
|
|
2703
|
-
describedBy:
|
|
2694
|
+
Fe.current = e, nt(e);
|
|
2695
|
+
}, [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 = {
|
|
2696
|
+
id: Ce,
|
|
2697
|
+
describedBy: Pe || void 0,
|
|
2704
2698
|
labelledBy: c ? void 0 : d,
|
|
2705
2699
|
isOpen: q,
|
|
2706
|
-
disabled:
|
|
2707
|
-
required:
|
|
2708
|
-
listboxId:
|
|
2700
|
+
disabled: Me,
|
|
2701
|
+
required: Ne,
|
|
2702
|
+
listboxId: we,
|
|
2709
2703
|
activeIndex: We,
|
|
2710
|
-
ariaLabel: c ?? (!i && !
|
|
2711
|
-
error:
|
|
2704
|
+
ariaLabel: c ?? (!i && !U?.labelId ? Xe?.label || C : void 0),
|
|
2705
|
+
error: je,
|
|
2712
2706
|
loading: N,
|
|
2713
2707
|
displayText: pt,
|
|
2714
2708
|
isPlaceholder: !Qe,
|
|
2715
|
-
size:
|
|
2709
|
+
size: Ae,
|
|
2716
2710
|
color: O,
|
|
2717
2711
|
variant: k,
|
|
2718
|
-
startIcon:
|
|
2719
|
-
endIcon:
|
|
2712
|
+
startIcon: ce,
|
|
2713
|
+
endIcon: V,
|
|
2720
2714
|
prefix: ue,
|
|
2721
|
-
suffix:
|
|
2715
|
+
suffix: fe,
|
|
2722
2716
|
clearable: ht,
|
|
2723
|
-
className:
|
|
2717
|
+
className: ve,
|
|
2724
2718
|
buttonRef: dt,
|
|
2725
2719
|
onClear: at,
|
|
2726
2720
|
onClick: ot,
|
|
2727
2721
|
onKeyDown: st,
|
|
2728
|
-
onBlur:
|
|
2722
|
+
onBlur: H,
|
|
2729
2723
|
onFocus: ge
|
|
2730
2724
|
}, _t = {
|
|
2731
2725
|
isOpen: q,
|
|
2732
|
-
listboxId:
|
|
2733
|
-
labelledById:
|
|
2726
|
+
listboxId: we,
|
|
2727
|
+
labelledById: Ce,
|
|
2734
2728
|
style: et,
|
|
2735
|
-
options:
|
|
2736
|
-
entries:
|
|
2729
|
+
options: Be,
|
|
2730
|
+
entries: Le || Te ? void 0 : Re,
|
|
2737
2731
|
multiple: b,
|
|
2738
2732
|
color: O,
|
|
2739
2733
|
variant: k,
|
|
2740
|
-
searchable:
|
|
2734
|
+
searchable: Le,
|
|
2741
2735
|
command: R,
|
|
2742
2736
|
virtual: I,
|
|
2743
2737
|
portal: ne,
|
|
2744
|
-
searchValue:
|
|
2738
|
+
searchValue: Te,
|
|
2745
2739
|
loading: N,
|
|
2746
2740
|
loadingText: T,
|
|
2747
2741
|
noOptionsText: mt,
|
|
2748
|
-
renderOption:
|
|
2742
|
+
renderOption: me,
|
|
2749
2743
|
selectedValue: $e,
|
|
2750
|
-
selectedValues:
|
|
2744
|
+
selectedValues: K,
|
|
2751
2745
|
activeIndex: We,
|
|
2752
|
-
visualActiveIndex:
|
|
2753
|
-
className:
|
|
2746
|
+
visualActiveIndex: G ? We : -1,
|
|
2747
|
+
className: ye,
|
|
2754
2748
|
setDropdownRef: ft,
|
|
2755
2749
|
onSelect: rt,
|
|
2756
2750
|
onSelectGroup: it,
|
|
2757
2751
|
onMouseEnter: ct,
|
|
2758
2752
|
onSearchChange: lt
|
|
2759
|
-
}, vt = /* @__PURE__ */ r(t, { children: [s && b &&
|
|
2753
|
+
}, vt = /* @__PURE__ */ r(t, { children: [s && b && K.length > 0 && /* @__PURE__ */ n(t, { children: K.map((e) => /* @__PURE__ */ n("input", {
|
|
2760
2754
|
type: "hidden",
|
|
2761
2755
|
name: s,
|
|
2762
2756
|
value: e,
|
|
2763
|
-
disabled:
|
|
2757
|
+
disabled: Me
|
|
2764
2758
|
}, e)) }), s && !b && /* @__PURE__ */ n("input", {
|
|
2765
2759
|
type: "hidden",
|
|
2766
2760
|
name: s,
|
|
2767
2761
|
value: $e,
|
|
2768
|
-
disabled:
|
|
2762
|
+
disabled: Me
|
|
2769
2763
|
})] }), yt = kn(e), bt = /* @__PURE__ */ r(rn, {
|
|
2770
2764
|
value: {
|
|
2771
2765
|
triggerProps: gt,
|
|
@@ -2783,15 +2777,15 @@ var Rn = ({ children: e, label: i, description: a, id: o, name: s, "aria-label":
|
|
|
2783
2777
|
/* @__PURE__ */ n(dn, { ..._t })
|
|
2784
2778
|
]
|
|
2785
2779
|
});
|
|
2786
|
-
return !
|
|
2787
|
-
id:
|
|
2780
|
+
return !Se && U ? e ? bt : xt : /* @__PURE__ */ n(Dn, {
|
|
2781
|
+
id: Ce,
|
|
2788
2782
|
label: i,
|
|
2789
2783
|
description: a,
|
|
2790
2784
|
error: z,
|
|
2791
|
-
required:
|
|
2792
|
-
disabled:
|
|
2785
|
+
required: Ne,
|
|
2786
|
+
disabled: Me,
|
|
2793
2787
|
bindControl: !1,
|
|
2794
|
-
className:
|
|
2788
|
+
className: _e,
|
|
2795
2789
|
children: e ? bt : xt
|
|
2796
2790
|
});
|
|
2797
2791
|
};
|
|
@@ -3116,7 +3110,7 @@ var $n = (e) => [...e].sort((e, t) => {
|
|
|
3116
3110
|
tabs: "_tabs_1hj56_1",
|
|
3117
3111
|
vertical: "_vertical_1hj56_30"
|
|
3118
3112
|
}, 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 }) => {
|
|
3119
|
-
let S = p(), C = t !== void 0, { value: w, setValue: T } =
|
|
3113
|
+
let S = p(), C = t !== void 0, { value: w, setValue: T } = U({
|
|
3120
3114
|
value: t,
|
|
3121
3115
|
defaultValue: r,
|
|
3122
3116
|
onValueChange: i
|
|
@@ -3214,20 +3208,20 @@ var $n = (e) => [...e].sort((e, t) => {
|
|
|
3214
3208
|
};
|
|
3215
3209
|
rr.displayName = "Tabs";
|
|
3216
3210
|
var ir = {
|
|
3217
|
-
trigger: "
|
|
3218
|
-
iconOnly: "
|
|
3219
|
-
icon: "
|
|
3220
|
-
body: "
|
|
3221
|
-
label: "
|
|
3222
|
-
description: "
|
|
3223
|
-
badge: "
|
|
3224
|
-
sm: "
|
|
3225
|
-
md: "
|
|
3226
|
-
lg: "
|
|
3227
|
-
segmented: "
|
|
3228
|
-
line: "
|
|
3229
|
-
pills: "
|
|
3230
|
-
vertical: "
|
|
3211
|
+
trigger: "_trigger_11yl9_1",
|
|
3212
|
+
iconOnly: "_iconOnly_11yl9_30",
|
|
3213
|
+
icon: "_icon_11yl9_30",
|
|
3214
|
+
body: "_body_11yl9_50",
|
|
3215
|
+
label: "_label_11yl9_58",
|
|
3216
|
+
description: "_description_11yl9_65",
|
|
3217
|
+
badge: "_badge_11yl9_71",
|
|
3218
|
+
sm: "_sm_11yl9_86",
|
|
3219
|
+
md: "_md_11yl9_104",
|
|
3220
|
+
lg: "_lg_11yl9_108",
|
|
3221
|
+
segmented: "_segmented_11yl9_130",
|
|
3222
|
+
line: "_line_11yl9_172",
|
|
3223
|
+
pills: "_pills_11yl9_184",
|
|
3224
|
+
vertical: "_vertical_11yl9_207"
|
|
3231
3225
|
}, ar = ({ children: e, className: t }) => /* @__PURE__ */ n("span", {
|
|
3232
3226
|
className: P(ir.badge, t),
|
|
3233
3227
|
children: e
|
|
@@ -3447,7 +3441,7 @@ function Sr({ open: e, onOpenChange: t, placement: n, offset: r, avoidCollisions
|
|
|
3447
3441
|
//#endregion
|
|
3448
3442
|
//#region src/components/Tooltip/Root/TooltipRoot.tsx
|
|
3449
3443
|
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 }) => {
|
|
3450
|
-
let h = `${p()}-content`, _ = g(null), v = g(null), [y, b] =
|
|
3444
|
+
let h = `${p()}-content`, _ = g(null), v = g(null), [y, b] = _e({
|
|
3451
3445
|
value: t,
|
|
3452
3446
|
defaultValue: r,
|
|
3453
3447
|
onChange: i
|
|
@@ -3469,7 +3463,7 @@ var Cr = ({ children: e, open: t, defaultOpen: r = !1, onOpenChange: i, placemen
|
|
|
3469
3463
|
active: y,
|
|
3470
3464
|
id: h
|
|
3471
3465
|
});
|
|
3472
|
-
return
|
|
3466
|
+
return le({
|
|
3473
3467
|
active: y,
|
|
3474
3468
|
contentRef: _,
|
|
3475
3469
|
ignoreRefs: [v],
|
|
@@ -3583,7 +3577,7 @@ var Er = (e, t) => {
|
|
|
3583
3577
|
return;
|
|
3584
3578
|
}
|
|
3585
3579
|
L?.props.onClick?.(e), e.defaultPrevented || w?.(e);
|
|
3586
|
-
},
|
|
3580
|
+
}, se = /* @__PURE__ */ r(t, { children: [
|
|
3587
3581
|
f && (g ? /* @__PURE__ */ n("span", {
|
|
3588
3582
|
className: Z.icon,
|
|
3589
3583
|
"aria-hidden": "true",
|
|
@@ -3629,7 +3623,7 @@ var Er = (e, t) => {
|
|
|
3629
3623
|
onClick: oe,
|
|
3630
3624
|
tabIndex: B ? -1 : L.props.tabIndex,
|
|
3631
3625
|
title: y || L.props.title,
|
|
3632
|
-
children:
|
|
3626
|
+
children: se
|
|
3633
3627
|
}) : D ? /* @__PURE__ */ n("a", {
|
|
3634
3628
|
ref: I,
|
|
3635
3629
|
href: B ? void 0 : D,
|
|
@@ -3646,7 +3640,7 @@ var Er = (e, t) => {
|
|
|
3646
3640
|
"aria-busy": f || void 0,
|
|
3647
3641
|
className: ie,
|
|
3648
3642
|
title: y,
|
|
3649
|
-
children:
|
|
3643
|
+
children: se
|
|
3650
3644
|
}) : /* @__PURE__ */ n("button", {
|
|
3651
3645
|
...F,
|
|
3652
3646
|
ref: I,
|
|
@@ -3661,7 +3655,7 @@ var Er = (e, t) => {
|
|
|
3661
3655
|
"aria-busy": f || void 0,
|
|
3662
3656
|
className: ie,
|
|
3663
3657
|
title: y,
|
|
3664
|
-
children:
|
|
3658
|
+
children: se
|
|
3665
3659
|
});
|
|
3666
3660
|
});
|
|
3667
3661
|
Dr.displayName = "Button";
|
|
@@ -3723,7 +3717,7 @@ var Q = {
|
|
|
3723
3717
|
E,
|
|
3724
3718
|
N,
|
|
3725
3719
|
F
|
|
3726
|
-
].filter(Boolean).join(" "), [L, R] =
|
|
3720
|
+
].filter(Boolean).join(" "), [L, R] = _e({
|
|
3727
3721
|
value: s,
|
|
3728
3722
|
defaultValue: m,
|
|
3729
3723
|
onChange: S
|
|
@@ -3869,39 +3863,39 @@ var $ = {
|
|
|
3869
3863
|
r < n.length && (i += e);
|
|
3870
3864
|
}
|
|
3871
3865
|
return i;
|
|
3872
|
-
}, 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:
|
|
3873
|
-
let
|
|
3874
|
-
|
|
3875
|
-
!
|
|
3876
|
-
Le,
|
|
3866
|
+
}, 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": V, "aria-invalid": ue, "aria-labelledby": de, ...fe }, pe) => {
|
|
3867
|
+
let me = p(), he = wn(), H = !!(i || o || v), ge = e ?? (H ? void 0 : he?.controlId) ?? me, _e = g(null), [ve, ye] = _(!1), [be, xe] = _(l ?? ""), U = c !== void 0, Se = String((U ? c : be) ?? ""), Ce = te ? te(Se) : Se, we = Se.length > 0, Te = f ?? he?.size ?? "md", Ee = y || !!v || !H && !!he?.invalid, De = b || !H && !!he?.disabled, Oe = x || !H && !!he?.required, ke = D || S, Ae = d === "password", je = Ae && j && ve ? "text" : d, Me = N ?? (d === "search" ? /* @__PURE__ */ n(C, {}) : null), Ne = F, Pe = Pr(d, E), W = S && !De, Fe = O && we && !De && !ke && !W, G = j && Ae && !De && !W && !Fe, Ie = !W && !Fe && !G && !!Ne, Le = !!(M && se), Re = o ? `${ge}-description` : void 0, ze = v ? `${ge}-error` : void 0, Be = Le ? `${ge}-counter` : void 0, Ve = [
|
|
3868
|
+
V,
|
|
3869
|
+
!H && !V ? he?.ariaDescribedBy : void 0,
|
|
3877
3870
|
Re,
|
|
3878
|
-
ze
|
|
3879
|
-
|
|
3880
|
-
|
|
3881
|
-
|
|
3871
|
+
ze,
|
|
3872
|
+
Be
|
|
3873
|
+
].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) => {
|
|
3874
|
+
if (_e.current = e, typeof pe == "function") {
|
|
3875
|
+
pe(e);
|
|
3882
3876
|
return;
|
|
3883
3877
|
}
|
|
3884
|
-
|
|
3885
|
-
}, [
|
|
3878
|
+
pe && (pe.current = e);
|
|
3879
|
+
}, [pe]), qe = u((e) => {
|
|
3886
3880
|
let t = Ir(ne ? ne(e.target.value) : e.target.value, B);
|
|
3887
|
-
|
|
3881
|
+
U || xe(t), A?.(t);
|
|
3888
3882
|
}, [
|
|
3889
|
-
|
|
3883
|
+
U,
|
|
3890
3884
|
B,
|
|
3891
3885
|
A,
|
|
3892
3886
|
ne
|
|
3893
3887
|
]), Je = u(() => {
|
|
3894
|
-
|
|
3888
|
+
U || xe(""), A?.(""), k?.(), _e.current?.focus();
|
|
3895
3889
|
}, [
|
|
3896
|
-
|
|
3890
|
+
U,
|
|
3897
3891
|
k,
|
|
3898
3892
|
A
|
|
3899
3893
|
]), Ye = /* @__PURE__ */ r(t, { children: [/* @__PURE__ */ r("div", {
|
|
3900
3894
|
className: P($.inputGroup, $[h], $[m], {
|
|
3901
3895
|
[$.hasAddons]: Ge,
|
|
3902
|
-
[$.isDisabled]:
|
|
3903
|
-
[$.isInvalid]:
|
|
3904
|
-
[$.isLoading]:
|
|
3896
|
+
[$.isDisabled]: De,
|
|
3897
|
+
[$.isInvalid]: Ee,
|
|
3898
|
+
[$.isLoading]: W
|
|
3905
3899
|
}),
|
|
3906
3900
|
children: [
|
|
3907
3901
|
I && /* @__PURE__ */ n("span", {
|
|
@@ -3916,37 +3910,37 @@ var $ = {
|
|
|
3916
3910
|
[$.hasEndIconAndSuffix]: We
|
|
3917
3911
|
}),
|
|
3918
3912
|
children: [
|
|
3919
|
-
|
|
3913
|
+
Me && /* @__PURE__ */ n("span", {
|
|
3920
3914
|
"aria-hidden": "true",
|
|
3921
3915
|
className: P($.startAdornment, Nr[re]),
|
|
3922
|
-
children:
|
|
3916
|
+
children: Me
|
|
3923
3917
|
}),
|
|
3924
3918
|
R && /* @__PURE__ */ n("span", {
|
|
3925
3919
|
className: $.prefix,
|
|
3926
3920
|
children: R
|
|
3927
3921
|
}),
|
|
3928
3922
|
/* @__PURE__ */ n("input", {
|
|
3929
|
-
...
|
|
3923
|
+
...fe,
|
|
3930
3924
|
ref: Ke,
|
|
3931
3925
|
id: ge,
|
|
3932
3926
|
name: a,
|
|
3933
|
-
type:
|
|
3934
|
-
autoComplete:
|
|
3935
|
-
className: P($.input, $[
|
|
3936
|
-
value:
|
|
3927
|
+
type: je,
|
|
3928
|
+
autoComplete: Pe,
|
|
3929
|
+
className: P($.input, $[Te], { [$.error]: Ee }, w),
|
|
3930
|
+
value: Ce,
|
|
3937
3931
|
onChange: qe,
|
|
3938
3932
|
placeholder: s,
|
|
3939
|
-
disabled:
|
|
3940
|
-
readOnly:
|
|
3941
|
-
required:
|
|
3933
|
+
disabled: De,
|
|
3934
|
+
readOnly: ke,
|
|
3935
|
+
required: Oe,
|
|
3942
3936
|
autoFocus: oe,
|
|
3943
|
-
maxLength:
|
|
3944
|
-
"aria-invalid":
|
|
3945
|
-
"aria-labelledby": de ?? (
|
|
3946
|
-
"aria-describedby":
|
|
3937
|
+
maxLength: se,
|
|
3938
|
+
"aria-invalid": Ee ? !0 : ue,
|
|
3939
|
+
"aria-labelledby": de ?? (H ? void 0 : he?.ariaLabelledBy),
|
|
3940
|
+
"aria-describedby": Ve || void 0,
|
|
3947
3941
|
"aria-busy": S || void 0,
|
|
3948
|
-
onMouseEnter:
|
|
3949
|
-
onMouseLeave:
|
|
3942
|
+
onMouseEnter: ce,
|
|
3943
|
+
onMouseLeave: le
|
|
3950
3944
|
}),
|
|
3951
3945
|
z && /* @__PURE__ */ n("span", {
|
|
3952
3946
|
className: $.suffix,
|
|
@@ -3955,29 +3949,29 @@ var $ = {
|
|
|
3955
3949
|
/* @__PURE__ */ r("div", {
|
|
3956
3950
|
className: $.endSlot,
|
|
3957
3951
|
children: [
|
|
3958
|
-
|
|
3952
|
+
W && /* @__PURE__ */ n("span", {
|
|
3959
3953
|
className: $.spinner,
|
|
3960
3954
|
"aria-hidden": "true",
|
|
3961
3955
|
"data-testid": "input-spinner"
|
|
3962
3956
|
}),
|
|
3963
|
-
|
|
3957
|
+
G && /* @__PURE__ */ n("button", {
|
|
3964
3958
|
type: "button",
|
|
3965
3959
|
className: $.iconButton,
|
|
3966
|
-
onClick: () =>
|
|
3967
|
-
"aria-label":
|
|
3968
|
-
children:
|
|
3960
|
+
onClick: () => ye((e) => !e),
|
|
3961
|
+
"aria-label": ve ? "Hide password" : "Show password",
|
|
3962
|
+
children: ve ? "Hide" : "Show"
|
|
3969
3963
|
}),
|
|
3970
|
-
|
|
3964
|
+
Fe && /* @__PURE__ */ n("button", {
|
|
3971
3965
|
type: "button",
|
|
3972
3966
|
className: P($.clearButton, Nr[ae]),
|
|
3973
3967
|
onClick: Je,
|
|
3974
3968
|
"aria-label": "Clear input",
|
|
3975
|
-
children:
|
|
3969
|
+
children: K
|
|
3976
3970
|
}),
|
|
3977
|
-
|
|
3971
|
+
Ie && Ne && /* @__PURE__ */ n("span", {
|
|
3978
3972
|
"aria-hidden": "true",
|
|
3979
3973
|
className: P($.endAdornment, Nr[ie]),
|
|
3980
|
-
children:
|
|
3974
|
+
children: Ne
|
|
3981
3975
|
})
|
|
3982
3976
|
]
|
|
3983
3977
|
})
|
|
@@ -3988,24 +3982,24 @@ var $ = {
|
|
|
3988
3982
|
children: L
|
|
3989
3983
|
})
|
|
3990
3984
|
]
|
|
3991
|
-
}),
|
|
3992
|
-
id:
|
|
3985
|
+
}), Le && /* @__PURE__ */ r("div", {
|
|
3986
|
+
id: Be,
|
|
3993
3987
|
className: $.counter,
|
|
3994
3988
|
children: [
|
|
3995
|
-
|
|
3989
|
+
Se.length,
|
|
3996
3990
|
" / ",
|
|
3997
|
-
|
|
3991
|
+
se
|
|
3998
3992
|
]
|
|
3999
3993
|
})] });
|
|
4000
|
-
return !
|
|
3994
|
+
return !H && he ? Ye : /* @__PURE__ */ n(Dn, {
|
|
4001
3995
|
id: ge,
|
|
4002
3996
|
label: i,
|
|
4003
3997
|
description: o,
|
|
4004
3998
|
error: v,
|
|
4005
|
-
required:
|
|
4006
|
-
disabled:
|
|
4007
|
-
invalid:
|
|
4008
|
-
size:
|
|
3999
|
+
required: Oe,
|
|
4000
|
+
disabled: De,
|
|
4001
|
+
invalid: Ee,
|
|
4002
|
+
size: Te,
|
|
4009
4003
|
className: T,
|
|
4010
4004
|
bindControl: !1,
|
|
4011
4005
|
children: Ye
|
|
@@ -4015,7 +4009,7 @@ Lr.displayName = "Input";
|
|
|
4015
4009
|
//#endregion
|
|
4016
4010
|
//#region src/theme/ThemeContext.ts
|
|
4017
4011
|
var Rr = s(null), zr = (e) => e === "highContrast" ? "high-contrast" : e, Br = ({ theme: e, defaultTheme: t = "light", onThemeChange: r, children: i }) => {
|
|
4018
|
-
let [a, o] =
|
|
4012
|
+
let [a, o] = _e({
|
|
4019
4013
|
value: e,
|
|
4020
4014
|
defaultValue: t,
|
|
4021
4015
|
onChange: r
|
|
@@ -4052,4 +4046,4 @@ function Vr() {
|
|
|
4052
4046
|
return e;
|
|
4053
4047
|
}
|
|
4054
4048
|
//#endregion
|
|
4055
|
-
export { Dr as Button, Mr as Checkbox, gt as Dropdown, Dn as FormField, Lr as Input, Vt as Modal,
|
|
4049
|
+
export { Dr as Button, Mr as Checkbox, gt as Dropdown, Dn as FormField, Lr as Input, Vt as Modal, we as Portal, Ce as PortalProvider, Kt as Radio, tn as RadioGroup, Hn as Select, cr as Tabs, Br as ThemeProvider, Tr as Tooltip, Vr as useTheme };
|