@vellira-ui/react 2.42.0 → 2.43.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/dist/index.cjs +1 -1
- package/dist/index.js +532 -518
- 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")), V = (e) => {
|
|
285
285
|
(oe(e)[0] ?? e).focus();
|
|
286
|
-
},
|
|
286
|
+
}, se = ({ 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 && V(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
|
+
}, ce = ({ 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
|
+
}, le = [], ue = {
|
|
370
370
|
add(e) {
|
|
371
|
-
|
|
371
|
+
le = le.filter((t) => t !== e), le.push(e);
|
|
372
372
|
},
|
|
373
373
|
remove(e) {
|
|
374
|
-
|
|
374
|
+
le = le.filter((t) => t !== e);
|
|
375
375
|
},
|
|
376
376
|
isTop(e) {
|
|
377
|
-
return
|
|
377
|
+
return le[le.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]) }), H = 0, fe = "", pe = {
|
|
384
384
|
lock() {
|
|
385
|
-
typeof document > "u" || (
|
|
385
|
+
typeof document > "u" || (H === 0 && (fe = document.body.style.overflow, document.body.style.overflow = "hidden"), H += 1);
|
|
386
386
|
},
|
|
387
387
|
unlock() {
|
|
388
|
-
typeof document > "u" || (
|
|
388
|
+
typeof document > "u" || (H = Math.max(0, H - 1), H === 0 && (document.body.style.overflow = fe));
|
|
389
389
|
}
|
|
390
|
-
},
|
|
390
|
+
}, me = ({ active: e, enabled: t = !0 }) => {
|
|
391
391
|
f(() => {
|
|
392
|
-
if (!(!e || !t)) return
|
|
393
|
-
|
|
392
|
+
if (!(!e || !t)) return pe.lock(), () => {
|
|
393
|
+
pe.unlock();
|
|
394
394
|
};
|
|
395
395
|
}, [e, t]);
|
|
396
|
-
},
|
|
396
|
+
}, he = () => 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") ?? he() : null;
|
|
401
|
+
}, U = ({ 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
|
+
}, _e = ({ 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
|
+
}, ve = ({ 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 } = _e({
|
|
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
|
+
}, ye = ({ open: e, defaultOpen: t = !1, onOpenChange: n, closeOnEscape: r, closeOnOutsidePress: i }) => {
|
|
574
|
+
let a = p(), o = p(), s = p(), [c, l] = U({
|
|
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
|
+
}, be = ({ 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] = U({
|
|
594
594
|
value: e,
|
|
595
595
|
defaultValue: t ?? (a ? [] : ""),
|
|
596
596
|
onChange: n ?? r
|
|
597
|
-
}), [v, y] =
|
|
597
|
+
}), [v, y] = U({
|
|
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 } = _e({
|
|
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
|
+
}, W = ({ value: e, defaultValue: t = "", onValueChange: n }) => {
|
|
697
|
+
let [r, i] = U({
|
|
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
|
+
}, xe = s(null), Se = ({ children: e, container: t = null }) => /* @__PURE__ */ n(xe.Provider, {
|
|
707
707
|
value: t,
|
|
708
708
|
children: e
|
|
709
|
-
}),
|
|
710
|
-
let n = d(
|
|
709
|
+
}), Ce = ({ children: e, container: t }) => {
|
|
710
|
+
let n = d(xe), r = ge({ container: t ?? n });
|
|
711
711
|
return r ? v(e, r) : null;
|
|
712
712
|
};
|
|
713
|
-
|
|
714
|
-
var
|
|
713
|
+
Ce.__velliraPortal = !0, Ce.displayName = "Portal", Se.displayName = "PortalProvider";
|
|
714
|
+
var we = {
|
|
715
715
|
dropdown: "_dropdown_m7rnq_1",
|
|
716
716
|
"dropdown-in": "_dropdown-in_m7rnq_1",
|
|
717
717
|
primary: "_primary_m7rnq_42",
|
|
@@ -723,57 +723,57 @@ var Te = {
|
|
|
723
723
|
searchWrap: "_searchWrap_m7rnq_165",
|
|
724
724
|
search: "_search_m7rnq_165",
|
|
725
725
|
"dropdown-sheet-in": "_dropdown-sheet-in_m7rnq_1"
|
|
726
|
-
},
|
|
726
|
+
}, Te = L("empty", "Dropdown.Empty"), Ee = ({ children: e }) => /* @__PURE__ */ n("li", {
|
|
727
727
|
role: "presentation",
|
|
728
|
-
className:
|
|
728
|
+
className: we.empty,
|
|
729
729
|
children: e ?? "No actions available"
|
|
730
730
|
});
|
|
731
|
-
|
|
731
|
+
Ee.displayName = "DropdownEmptySurface";
|
|
732
732
|
//#endregion
|
|
733
733
|
//#region src/components/Dropdown/Group/DropdownGroup.tsx
|
|
734
|
-
var
|
|
735
|
-
|
|
734
|
+
var De = L("group", "Dropdown.Group"), Oe = () => null;
|
|
735
|
+
Oe.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 ke = s(null), Ae = s(null), je = s(null), Me = ke.Provider, Ne = Ae.Provider;
|
|
739
|
+
je.Provider;
|
|
740
|
+
function G() {
|
|
741
|
+
let e = d(ke);
|
|
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 Pe() {
|
|
746
|
+
let e = d(Ae);
|
|
747
747
|
if (!e) throw Error("Dropdown.Trigger must be used inside Dropdown.");
|
|
748
748
|
return e;
|
|
749
749
|
}
|
|
750
|
-
var
|
|
751
|
-
item: "
|
|
752
|
-
disabled: "
|
|
753
|
-
active: "
|
|
754
|
-
itemShortcut: "
|
|
755
|
-
itemDescription: "
|
|
756
|
-
primary: "
|
|
757
|
-
success: "
|
|
758
|
-
warning: "
|
|
759
|
-
danger: "
|
|
760
|
-
itemIcon: "
|
|
761
|
-
sm: "
|
|
762
|
-
md: "
|
|
763
|
-
lg: "
|
|
764
|
-
itemText: "
|
|
765
|
-
itemLabel: "
|
|
766
|
-
itemBadge: "
|
|
767
|
-
indicator: "
|
|
768
|
-
"dropdown-indicator-in": "_dropdown-indicator-
|
|
769
|
-
checked: "
|
|
770
|
-
"dropdown-item-pop": "_dropdown-item-
|
|
771
|
-
subContent: "
|
|
772
|
-
"dropdown-sub-in": "_dropdown-sub-
|
|
773
|
-
subLabel: "
|
|
774
|
-
subSeparator: "
|
|
775
|
-
},
|
|
776
|
-
let a =
|
|
750
|
+
var K = {
|
|
751
|
+
item: "_item_xmygj_1",
|
|
752
|
+
disabled: "_disabled_xmygj_35",
|
|
753
|
+
active: "_active_xmygj_53",
|
|
754
|
+
itemShortcut: "_itemShortcut_xmygj_67",
|
|
755
|
+
itemDescription: "_itemDescription_xmygj_68",
|
|
756
|
+
primary: "_primary_xmygj_76",
|
|
757
|
+
success: "_success_xmygj_94",
|
|
758
|
+
warning: "_warning_xmygj_112",
|
|
759
|
+
danger: "_danger_xmygj_130",
|
|
760
|
+
itemIcon: "_itemIcon_xmygj_154",
|
|
761
|
+
sm: "_sm_xmygj_174",
|
|
762
|
+
md: "_md_xmygj_180",
|
|
763
|
+
lg: "_lg_xmygj_184",
|
|
764
|
+
itemText: "_itemText_xmygj_191",
|
|
765
|
+
itemLabel: "_itemLabel_xmygj_200",
|
|
766
|
+
itemBadge: "_itemBadge_xmygj_226",
|
|
767
|
+
indicator: "_indicator_xmygj_253",
|
|
768
|
+
"dropdown-indicator-in": "_dropdown-indicator-in_xmygj_1",
|
|
769
|
+
checked: "_checked_xmygj_270",
|
|
770
|
+
"dropdown-item-pop": "_dropdown-item-pop_xmygj_1",
|
|
771
|
+
subContent: "_subContent_xmygj_275",
|
|
772
|
+
"dropdown-sub-in": "_dropdown-sub-in_xmygj_1",
|
|
773
|
+
subLabel: "_subLabel_xmygj_300",
|
|
774
|
+
subSeparator: "_subSeparator_xmygj_308"
|
|
775
|
+
}, Fe = L("item", "Dropdown.Item"), Ie = ({ item: e, itemIndex: i }) => {
|
|
776
|
+
let a = G(), 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 G = {
|
|
|
782
782
|
let t = !m;
|
|
783
783
|
c(t), e.props.onCheckedChange?.(t);
|
|
784
784
|
}
|
|
785
|
-
a.selectItem(e,
|
|
785
|
+
a.selectItem(e, Le(t));
|
|
786
786
|
};
|
|
787
787
|
return /* @__PURE__ */ r(t, { children: [/* @__PURE__ */ r(F, {
|
|
788
788
|
id: j,
|
|
@@ -798,11 +798,11 @@ var G = {
|
|
|
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(K.item, K[a.size], {
|
|
802
|
+
[K.active]: l,
|
|
803
|
+
[K.disabled]: h,
|
|
804
|
+
[K.checked]: m
|
|
805
|
+
}, D && D !== "default" ? K[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)));
|
|
@@ -811,59 +811,59 @@ var G = {
|
|
|
811
811
|
window.clearTimeout(o.current);
|
|
812
812
|
},
|
|
813
813
|
children: [
|
|
814
|
-
I && /* @__PURE__ */ n("span", {
|
|
815
|
-
className: G.indicator,
|
|
816
|
-
"aria-hidden": "true",
|
|
817
|
-
children: m ? /* @__PURE__ */ n(y, {}) : null
|
|
818
|
-
}),
|
|
819
814
|
S && /* @__PURE__ */ n("span", {
|
|
820
|
-
className:
|
|
815
|
+
className: K.itemIcon,
|
|
821
816
|
children: S
|
|
822
817
|
}),
|
|
823
818
|
/* @__PURE__ */ r("span", {
|
|
824
|
-
className:
|
|
819
|
+
className: K.itemText,
|
|
825
820
|
children: [/* @__PURE__ */ n("span", {
|
|
826
|
-
className:
|
|
821
|
+
className: K.itemLabel,
|
|
827
822
|
children: E
|
|
828
823
|
}), C && /* @__PURE__ */ n("span", {
|
|
829
|
-
className:
|
|
824
|
+
className: K.itemDescription,
|
|
830
825
|
children: C
|
|
831
826
|
})]
|
|
832
827
|
}),
|
|
833
828
|
w && /* @__PURE__ */ n("span", {
|
|
834
|
-
className:
|
|
829
|
+
className: K.itemBadge,
|
|
835
830
|
children: w
|
|
836
831
|
}),
|
|
837
832
|
T && /* @__PURE__ */ n("span", {
|
|
838
|
-
className:
|
|
833
|
+
className: K.itemShortcut,
|
|
839
834
|
children: T
|
|
840
835
|
}),
|
|
836
|
+
I && /* @__PURE__ */ n("span", {
|
|
837
|
+
className: K.indicator,
|
|
838
|
+
"aria-hidden": "true",
|
|
839
|
+
children: m ? /* @__PURE__ */ n(y, {}) : null
|
|
840
|
+
}),
|
|
841
841
|
p && /* @__PURE__ */ n("span", {
|
|
842
|
-
className:
|
|
842
|
+
className: K.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: K.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: K.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: K.subSeparator,
|
|
858
858
|
"aria-hidden": "true"
|
|
859
|
-
}, e.id) : e.type === "item" ? /* @__PURE__ */ n(
|
|
859
|
+
}, e.id) : e.type === "item" ? /* @__PURE__ */ n(Re, {
|
|
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
|
+
Ie.displayName = "DropdownItemRow";
|
|
866
|
+
function Le(e) {
|
|
867
867
|
let t = !1;
|
|
868
868
|
return {
|
|
869
869
|
originalEvent: e,
|
|
@@ -875,8 +875,8 @@ function Re(e) {
|
|
|
875
875
|
}
|
|
876
876
|
};
|
|
877
877
|
}
|
|
878
|
-
function
|
|
879
|
-
let i =
|
|
878
|
+
function Re({ id: e, item: t }) {
|
|
879
|
+
let i = G(), [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 ze({ 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, Le(e));
|
|
889
889
|
};
|
|
890
890
|
return /* @__PURE__ */ r(E, {
|
|
891
891
|
id: e,
|
|
@@ -897,54 +897,54 @@ function ze({ 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(K.item, K[i.size], {
|
|
901
|
+
[K.disabled]: b,
|
|
902
|
+
[K.checked]: l
|
|
903
|
+
}, v && v !== "default" ? K[v] : void 0),
|
|
904
904
|
onClick: O,
|
|
905
905
|
children: [
|
|
906
906
|
D && /* @__PURE__ */ n("span", {
|
|
907
|
-
className:
|
|
907
|
+
className: K.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: K.itemIcon,
|
|
913
913
|
children: f
|
|
914
914
|
}),
|
|
915
915
|
/* @__PURE__ */ r("span", {
|
|
916
|
-
className:
|
|
916
|
+
className: K.itemText,
|
|
917
917
|
children: [/* @__PURE__ */ n("span", {
|
|
918
|
-
className:
|
|
918
|
+
className: K.itemLabel,
|
|
919
919
|
children: g
|
|
920
920
|
}), p && /* @__PURE__ */ n("span", {
|
|
921
|
-
className:
|
|
921
|
+
className: K.itemDescription,
|
|
922
922
|
children: p
|
|
923
923
|
})]
|
|
924
924
|
}),
|
|
925
925
|
m && /* @__PURE__ */ n("span", {
|
|
926
|
-
className:
|
|
926
|
+
className: K.itemBadge,
|
|
927
927
|
children: m
|
|
928
928
|
}),
|
|
929
929
|
h && /* @__PURE__ */ n("span", {
|
|
930
|
-
className:
|
|
930
|
+
className: K.itemShortcut,
|
|
931
931
|
children: h
|
|
932
932
|
})
|
|
933
933
|
]
|
|
934
934
|
});
|
|
935
935
|
}
|
|
936
|
-
var
|
|
936
|
+
var ze = { group: "_group_aviwv_1" }, Be = L("label", "Dropdown.Label"), Ve = ({ children: e, className: t }) => /* @__PURE__ */ n("li", {
|
|
937
937
|
role: "presentation",
|
|
938
|
-
className: P(
|
|
938
|
+
className: P(ze.group, t),
|
|
939
939
|
children: e
|
|
940
940
|
});
|
|
941
|
-
|
|
941
|
+
Ve.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: we.empty,
|
|
948
948
|
children: e ?? "Loading actions..."
|
|
949
949
|
});
|
|
950
950
|
He.displayName = "DropdownLoadingSurface";
|
|
@@ -957,12 +957,18 @@ Ge.displayName = "DropdownSeparatorSurface";
|
|
|
957
957
|
//#endregion
|
|
958
958
|
//#region src/components/Dropdown/Content/DropdownContent.tsx
|
|
959
959
|
var Ke = ({ className: e }) => {
|
|
960
|
-
let t =
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
960
|
+
let t = G(), { contentReadyToFocus: i, isOpen: o, setContentRef: s } = t, c = g(null), l = u((e) => {
|
|
961
|
+
c.current = e, s(e);
|
|
962
|
+
}, [s]);
|
|
963
|
+
if (f(() => {
|
|
964
|
+
let e = c.current;
|
|
965
|
+
!o || !i || !e || e.contains(document.activeElement) || e.focus({ preventScroll: !0 });
|
|
966
|
+
}, [i, o]), !o) return null;
|
|
967
|
+
let d = P(we.dropdown, we[t.color], t.contentProps?.className, e), p = /* @__PURE__ */ r("ul", {
|
|
968
|
+
ref: l,
|
|
964
969
|
id: t.contentId,
|
|
965
970
|
role: "menu",
|
|
971
|
+
autoFocus: !0,
|
|
966
972
|
tabIndex: -1,
|
|
967
973
|
"aria-labelledby": t.triggerId,
|
|
968
974
|
"aria-activedescendant": t.activeIndex >= 0 && t.activeIndex < t.items.length ? t.getItemId(t.activeIndex) : void 0,
|
|
@@ -971,13 +977,13 @@ var Ke = ({ className: e }) => {
|
|
|
971
977
|
...t.surfaceStyle,
|
|
972
978
|
...t.contentProps?.style
|
|
973
979
|
},
|
|
974
|
-
className:
|
|
980
|
+
className: d,
|
|
975
981
|
"data-color": t.color,
|
|
976
982
|
children: [t.searchable && /* @__PURE__ */ r("li", {
|
|
977
983
|
role: "presentation",
|
|
978
|
-
className: P(
|
|
984
|
+
className: P(we.searchWrap, t.searchProps?.className),
|
|
979
985
|
children: [/* @__PURE__ */ n(C, { "aria-hidden": "true" }), /* @__PURE__ */ n("input", {
|
|
980
|
-
className:
|
|
986
|
+
className: we.search,
|
|
981
987
|
value: t.searchValue,
|
|
982
988
|
placeholder: t.searchPlaceholder,
|
|
983
989
|
"aria-label": t.searchProps?.["aria-label"] ?? t.searchPlaceholder,
|
|
@@ -987,12 +993,12 @@ var Ke = ({ className: e }) => {
|
|
|
987
993
|
e.key === "ArrowDown" || e.key === "ArrowUp" || e.key === "Enter" || e.key === "Escape" || e.stopPropagation();
|
|
988
994
|
}
|
|
989
995
|
})]
|
|
990
|
-
}), 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(Ee, { children: t.noOptionsText }) : t.entries.length ? t.entries.map((e) => e.type === "groupStart" ? /* @__PURE__ */ n(Oe, {}, e.id) : e.type === "groupEnd" ? null : e.type === "label" ? /* @__PURE__ */ n(Ve, { ...e.props }, e.id) : e.type === "separator" ? /* @__PURE__ */ n(Ge, { ...e.props }, e.id) : e.type === "empty" ? /* @__PURE__ */ n(Ee, { 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(Ie, {
|
|
991
997
|
item: e.item,
|
|
992
998
|
itemIndex: e.itemIndex
|
|
993
|
-
}) }, e.item.id)) : /* @__PURE__ */ n(
|
|
999
|
+
}) }, e.item.id)) : /* @__PURE__ */ n(Ee, {})]
|
|
994
1000
|
});
|
|
995
|
-
return t.portal ? /* @__PURE__ */ n(
|
|
1001
|
+
return t.portal ? /* @__PURE__ */ n(Ce, { children: p }) : p;
|
|
996
1002
|
};
|
|
997
1003
|
Ke.__velliraDropdownPart = "content", Ke.displayName = "Dropdown.Content";
|
|
998
1004
|
//#endregion
|
|
@@ -1006,8 +1012,8 @@ var qe = L("itemBadge", "Dropdown.ItemBadge"), Je = L("itemDescription", "Dropdo
|
|
|
1006
1012
|
t.removeEventListener("change", r);
|
|
1007
1013
|
};
|
|
1008
1014
|
}, [e]), t;
|
|
1009
|
-
}, et = ({ open: e, onOpenChange: t, placement: n = "bottom-start", strategy: r = "fixed", offset: i = 2,
|
|
1010
|
-
let
|
|
1015
|
+
}, et = ({ open: e, onOpenChange: t, placement: n = "bottom-start", strategy: r = "fixed", offset: i = 2, collisionPadding: a = 8, matchTriggerWidth: o = !1, avoidCollisions: s = !0, mobileSheetBreakpoint: c, middleware: l = [] } = {}) => {
|
|
1016
|
+
let u = $e(c), { refs: d, floatingStyles: p, isPositioned: m, update: g, context: _, middlewareData: v, placement: y } = A({
|
|
1011
1017
|
open: e,
|
|
1012
1018
|
onOpenChange: t,
|
|
1013
1019
|
placement: n,
|
|
@@ -1015,32 +1021,37 @@ var qe = L("itemBadge", "Dropdown.ItemBadge"), Je = L("itemDescription", "Dropdo
|
|
|
1015
1021
|
transform: !1,
|
|
1016
1022
|
middleware: h(() => [
|
|
1017
1023
|
D(i),
|
|
1018
|
-
...
|
|
1024
|
+
...s ? [E({ padding: a })] : [],
|
|
1019
1025
|
k({ apply({ rects: e, elements: t }) {
|
|
1020
|
-
!
|
|
1026
|
+
!o || u || Object.assign(t.floating.style, { width: `${e.reference.width}px` });
|
|
1021
1027
|
} }),
|
|
1022
|
-
...
|
|
1023
|
-
...
|
|
1028
|
+
...s ? [O({ padding: a })] : [],
|
|
1029
|
+
...l
|
|
1024
1030
|
], [
|
|
1025
|
-
|
|
1026
|
-
c,
|
|
1027
|
-
l,
|
|
1031
|
+
s,
|
|
1028
1032
|
a,
|
|
1033
|
+
l,
|
|
1034
|
+
u,
|
|
1035
|
+
o,
|
|
1029
1036
|
i
|
|
1030
1037
|
]),
|
|
1031
1038
|
whileElementsMounted: T
|
|
1032
1039
|
});
|
|
1033
1040
|
return f(() => {
|
|
1034
|
-
|
|
1035
|
-
}, [
|
|
1036
|
-
context:
|
|
1037
|
-
placement:
|
|
1038
|
-
middlewareData:
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1041
|
+
u && d.floating.current?.style.removeProperty("width");
|
|
1042
|
+
}, [u, d.floating]), {
|
|
1043
|
+
context: _,
|
|
1044
|
+
placement: y,
|
|
1045
|
+
middlewareData: v,
|
|
1046
|
+
isPositioned: m,
|
|
1047
|
+
floatingStyles: u ? {} : {
|
|
1048
|
+
...p,
|
|
1049
|
+
visibility: e && !m ? "hidden" : p.visibility
|
|
1050
|
+
},
|
|
1051
|
+
isMobileSheet: u,
|
|
1052
|
+
setRef: d.setReference,
|
|
1053
|
+
setFloatingRef: d.setFloating,
|
|
1054
|
+
updatePosition: g
|
|
1044
1055
|
};
|
|
1045
1056
|
};
|
|
1046
1057
|
//#endregion
|
|
@@ -1066,172 +1077,175 @@ function nt(...e) {
|
|
|
1066
1077
|
function rt(e) {
|
|
1067
1078
|
return typeof e == "number" ? `${e}px` : e;
|
|
1068
1079
|
}
|
|
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",
|
|
1070
|
-
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, noOptionsText: L, className: z }) => {
|
|
1081
|
+
let ee = p(), B = `${ee}-trigger`, te = `${ee}-menu`, ne = g(null), re = g(null), [ie, ae] = _(), [oe, V] = _({}), [se, le] = _(M), ue = j ?? se, H = h(() => R(e), [e]), fe = H.content?.props.command ?? !1, pe = k || A || fe || !!H.search, he = h(() => st(H.items), [H.items]), ge = h(() => H.items.map((e) => ({
|
|
1071
1082
|
disabled: e.disabled,
|
|
1072
1083
|
label: e.label
|
|
1073
|
-
})), [
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
]),
|
|
1084
|
+
})), [H.items]), U = h(() => !pe || !ue.trim() ? H : ct(H, ue), [
|
|
1085
|
+
pe,
|
|
1086
|
+
H,
|
|
1087
|
+
ue
|
|
1088
|
+
]), _e = h(() => U.items.map((e) => ({
|
|
1078
1089
|
disabled: e.disabled,
|
|
1079
1090
|
label: e.label
|
|
1080
|
-
})), [
|
|
1091
|
+
})), [U.items]);
|
|
1081
1092
|
f(() => {
|
|
1082
|
-
|
|
1093
|
+
V((e) => {
|
|
1083
1094
|
let t = { ...e };
|
|
1084
|
-
return
|
|
1095
|
+
return he.forEach((e) => {
|
|
1085
1096
|
e.type === "radio" && t[e.groupId] === void 0 && (t[e.groupId] = e.groupProps?.value ?? e.groupProps?.defaultValue);
|
|
1086
1097
|
}), t;
|
|
1087
1098
|
});
|
|
1088
|
-
}, [
|
|
1089
|
-
let { activeIndex:
|
|
1090
|
-
items:
|
|
1099
|
+
}, [he]);
|
|
1100
|
+
let { activeIndex: ye, setActiveIndex: be, isOpen: W, closeDropdown: xe, toggleDropdown: Se, onKeyDown: Ce } = ve({
|
|
1101
|
+
items: pe ? _e : ge,
|
|
1091
1102
|
open: t,
|
|
1092
1103
|
defaultOpen: i,
|
|
1093
|
-
disabled:
|
|
1104
|
+
disabled: E,
|
|
1094
1105
|
onOpenChange: a,
|
|
1095
|
-
getItemValue: (e, t) => (
|
|
1106
|
+
getItemValue: (e, t) => (pe ? U.items : H.items)[t]?.id ?? "",
|
|
1096
1107
|
getItemText: (e) => e.label,
|
|
1097
|
-
loop:
|
|
1098
|
-
}), { floatingStyles:
|
|
1099
|
-
open:
|
|
1108
|
+
loop: T
|
|
1109
|
+
}), { floatingStyles: we, isMobileSheet: Te, isPositioned: Ee, setRef: De, setFloatingRef: Oe } = et({
|
|
1110
|
+
open: W,
|
|
1100
1111
|
placement: c,
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1112
|
+
strategy: l ?? (x ? "fixed" : "absolute"),
|
|
1113
|
+
matchTriggerWidth: v,
|
|
1114
|
+
avoidCollisions: S,
|
|
1115
|
+
offset: d,
|
|
1116
|
+
collisionPadding: m,
|
|
1104
1117
|
mobileSheetBreakpoint: 640
|
|
1105
|
-
}),
|
|
1106
|
-
|
|
1118
|
+
}), ke = u((e) => {
|
|
1119
|
+
j === void 0 && le(e), F?.(e), be(0);
|
|
1107
1120
|
}, [
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
]), { isTopOverlay:
|
|
1112
|
-
active:
|
|
1113
|
-
id:
|
|
1121
|
+
F,
|
|
1122
|
+
j,
|
|
1123
|
+
be
|
|
1124
|
+
]), { isTopOverlay: Ae } = de({
|
|
1125
|
+
active: W,
|
|
1126
|
+
id: te
|
|
1114
1127
|
});
|
|
1115
|
-
|
|
1116
|
-
active:
|
|
1117
|
-
enabled:
|
|
1128
|
+
me({
|
|
1129
|
+
active: W,
|
|
1130
|
+
enabled: C
|
|
1118
1131
|
});
|
|
1119
|
-
let
|
|
1120
|
-
xe(),
|
|
1121
|
-
}, [xe]),
|
|
1122
|
-
if (e.disabled ||
|
|
1132
|
+
let je = u(() => {
|
|
1133
|
+
xe(), ne.current?.focus();
|
|
1134
|
+
}, [xe]), G = u((e, t) => {
|
|
1135
|
+
if (e.disabled || D) return;
|
|
1123
1136
|
if (e.type === "subTrigger") {
|
|
1124
|
-
|
|
1137
|
+
ae(e.id);
|
|
1125
1138
|
return;
|
|
1126
1139
|
}
|
|
1127
|
-
e.type === "item" && e.props.onSelect?.(t), e.type === "radio" && (
|
|
1140
|
+
e.type === "item" && e.props.onSelect?.(t), e.type === "radio" && (V((t) => ({
|
|
1128
1141
|
...t,
|
|
1129
1142
|
[e.groupId]: e.props.value
|
|
1130
1143
|
})), e.groupProps?.onValueChange?.(e.props.value));
|
|
1131
|
-
let n = e.props.closeOnSelect ?? (e.type !== "checkbox" &&
|
|
1132
|
-
!t.defaultPrevented && n &&
|
|
1144
|
+
let n = e.props.closeOnSelect ?? (e.type !== "checkbox" && w);
|
|
1145
|
+
!t.defaultPrevented && n && je();
|
|
1133
1146
|
}, [
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
]),
|
|
1138
|
-
let t =
|
|
1147
|
+
je,
|
|
1148
|
+
w,
|
|
1149
|
+
D
|
|
1150
|
+
]), Pe = u((e) => {
|
|
1151
|
+
let t = U.items[ye];
|
|
1139
1152
|
if (e.key === "ArrowRight" && t?.type === "subTrigger") {
|
|
1140
|
-
e.preventDefault(),
|
|
1153
|
+
e.preventDefault(), ae(t.id);
|
|
1141
1154
|
return;
|
|
1142
1155
|
}
|
|
1143
|
-
if (e.key === "ArrowLeft" &&
|
|
1144
|
-
e.preventDefault(),
|
|
1156
|
+
if (e.key === "ArrowLeft" && ie) {
|
|
1157
|
+
e.preventDefault(), ae(void 0);
|
|
1145
1158
|
return;
|
|
1146
1159
|
}
|
|
1147
1160
|
if ((e.key === "Enter" || e.key === " ") && t) {
|
|
1148
1161
|
e.preventDefault();
|
|
1149
1162
|
let n = ot(e);
|
|
1150
|
-
|
|
1163
|
+
G(t, n);
|
|
1151
1164
|
return;
|
|
1152
1165
|
}
|
|
1153
|
-
|
|
1166
|
+
Ce(e), e.key === "Escape" && ne.current?.focus();
|
|
1154
1167
|
}, [
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
]),
|
|
1161
|
-
e.preventDefault(),
|
|
1162
|
-
}, [
|
|
1163
|
-
|
|
1164
|
-
}, [
|
|
1165
|
-
|
|
1166
|
-
}, [Te]);
|
|
1167
|
-
|
|
1168
|
-
active:
|
|
1168
|
+
ye,
|
|
1169
|
+
U.items,
|
|
1170
|
+
Ce,
|
|
1171
|
+
ie,
|
|
1172
|
+
G
|
|
1173
|
+
]), K = u((e) => {
|
|
1174
|
+
e.preventDefault(), Se();
|
|
1175
|
+
}, [Se]), Fe = u((e) => {
|
|
1176
|
+
ne.current = e, De(e);
|
|
1177
|
+
}, [De]), Ie = u((e) => {
|
|
1178
|
+
re.current = e, Oe(e), Te && e?.focus({ preventScroll: !0 });
|
|
1179
|
+
}, [Te, Oe]);
|
|
1180
|
+
ce({
|
|
1181
|
+
active: W,
|
|
1169
1182
|
closeOnEscape: !0,
|
|
1170
1183
|
closeOnOutsidePress: !0,
|
|
1171
|
-
contentRef:
|
|
1172
|
-
ignoreRefs: [
|
|
1173
|
-
isTopOverlay:
|
|
1184
|
+
contentRef: re,
|
|
1185
|
+
ignoreRefs: [ne],
|
|
1186
|
+
isTopOverlay: Ae,
|
|
1174
1187
|
requestClose: xe
|
|
1175
1188
|
});
|
|
1176
|
-
let
|
|
1177
|
-
...
|
|
1178
|
-
minWidth: rt(
|
|
1179
|
-
maxWidth: rt(
|
|
1189
|
+
let Le = {
|
|
1190
|
+
...we,
|
|
1191
|
+
minWidth: rt(y),
|
|
1192
|
+
maxWidth: rt(b)
|
|
1180
1193
|
};
|
|
1181
|
-
return /* @__PURE__ */ n(
|
|
1194
|
+
return /* @__PURE__ */ n(Ne, {
|
|
1182
1195
|
value: {
|
|
1183
|
-
disabled:
|
|
1184
|
-
isOpen:
|
|
1185
|
-
contentId:
|
|
1186
|
-
triggerId:
|
|
1187
|
-
setTriggerRef:
|
|
1188
|
-
onClick:
|
|
1189
|
-
onKeyDown:
|
|
1196
|
+
disabled: E,
|
|
1197
|
+
isOpen: W,
|
|
1198
|
+
contentId: te,
|
|
1199
|
+
triggerId: B,
|
|
1200
|
+
setTriggerRef: Fe,
|
|
1201
|
+
onClick: K,
|
|
1202
|
+
onKeyDown: Pe
|
|
1190
1203
|
},
|
|
1191
|
-
children: /* @__PURE__ */ n(
|
|
1204
|
+
children: /* @__PURE__ */ n(Me, {
|
|
1192
1205
|
value: {
|
|
1193
|
-
activeIndex:
|
|
1194
|
-
closeOnSelect:
|
|
1206
|
+
activeIndex: ye,
|
|
1207
|
+
closeOnSelect: w,
|
|
1195
1208
|
color: s,
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1209
|
+
contentReadyToFocus: Te || Ee,
|
|
1210
|
+
contentId: te,
|
|
1211
|
+
contentProps: H.content?.props,
|
|
1212
|
+
disabled: E,
|
|
1213
|
+
entries: U.entries,
|
|
1214
|
+
getItemId: (e) => `${te}-item-${e}`,
|
|
1215
|
+
isOpen: W,
|
|
1216
|
+
items: U.items,
|
|
1217
|
+
loading: D,
|
|
1218
|
+
loadingText: O,
|
|
1219
|
+
noOptionsText: I ?? L,
|
|
1220
|
+
maxWidth: b,
|
|
1221
|
+
minWidth: y,
|
|
1222
|
+
openSubId: ie,
|
|
1223
|
+
onKeyDown: Pe,
|
|
1224
|
+
portal: !H.portal && x,
|
|
1225
|
+
radioValues: oe,
|
|
1226
|
+
searchPlaceholder: H.search?.props.placeholder ?? N ?? (A || fe ? "Type a command..." : "Search actions..."),
|
|
1227
|
+
searchProps: H.search?.props,
|
|
1228
|
+
searchValue: ue,
|
|
1229
|
+
searchable: pe,
|
|
1230
|
+
selectItem: G,
|
|
1231
|
+
setActiveIndex: be,
|
|
1232
|
+
setContentRef: Ie,
|
|
1233
|
+
setOpenSubId: ae,
|
|
1220
1234
|
setRadioValue: (e, t) => {
|
|
1221
|
-
|
|
1235
|
+
V((n) => ({
|
|
1222
1236
|
...n,
|
|
1223
1237
|
[e]: t
|
|
1224
1238
|
}));
|
|
1225
1239
|
},
|
|
1226
|
-
setSearchValue:
|
|
1240
|
+
setSearchValue: ke,
|
|
1227
1241
|
size: o,
|
|
1228
|
-
surfaceStyle:
|
|
1229
|
-
triggerId:
|
|
1242
|
+
surfaceStyle: Le,
|
|
1243
|
+
triggerId: B
|
|
1230
1244
|
},
|
|
1231
1245
|
children: /* @__PURE__ */ r("div", {
|
|
1232
|
-
className: P(it.wrapper,
|
|
1233
|
-
"data-disabled":
|
|
1234
|
-
children: [
|
|
1246
|
+
className: P(it.wrapper, z),
|
|
1247
|
+
"data-disabled": E || void 0,
|
|
1248
|
+
children: [H.trigger ?? null, H.portal ?? H.content ?? /* @__PURE__ */ n(Ke, {})]
|
|
1235
1249
|
})
|
|
1236
1250
|
})
|
|
1237
1251
|
});
|
|
@@ -1284,7 +1298,7 @@ var lt = L("search", "Dropdown.Search"), ut = L("subContent", "Dropdown.SubConte
|
|
|
1284
1298
|
}, mt = (e) => /* @__PURE__ */ n(ht, { ...e });
|
|
1285
1299
|
mt.__velliraDropdownPart = "trigger", mt.displayName = "Dropdown.Trigger";
|
|
1286
1300
|
var ht = ({ children: e, asChild: t = !1, disabled: i, className: a }) => {
|
|
1287
|
-
let s =
|
|
1301
|
+
let s = G(), c = Pe(), u = t && l(e) ? e : void 0, d = s.disabled || i, f = {
|
|
1288
1302
|
id: c.triggerId,
|
|
1289
1303
|
ref: u ? nt(u.props.ref, c.setTriggerRef) : c.setTriggerRef,
|
|
1290
1304
|
"aria-controls": c.isOpen ? c.contentId : void 0,
|
|
@@ -1320,12 +1334,12 @@ var gt = Object.assign(at, {
|
|
|
1320
1334
|
Trigger: mt,
|
|
1321
1335
|
Content: Ke,
|
|
1322
1336
|
Search: lt,
|
|
1323
|
-
Item:
|
|
1337
|
+
Item: Fe,
|
|
1324
1338
|
CheckboxItem: te,
|
|
1325
1339
|
RadioGroup: Ze,
|
|
1326
1340
|
RadioItem: Qe,
|
|
1327
|
-
Group:
|
|
1328
|
-
Label:
|
|
1341
|
+
Group: De,
|
|
1342
|
+
Label: Be,
|
|
1329
1343
|
Separator: We,
|
|
1330
1344
|
Sub: ft,
|
|
1331
1345
|
SubTrigger: dt,
|
|
@@ -1335,7 +1349,7 @@ var gt = Object.assign(at, {
|
|
|
1335
1349
|
ItemBadge: qe,
|
|
1336
1350
|
ItemShortcut: Xe,
|
|
1337
1351
|
Arrow: I,
|
|
1338
|
-
Empty:
|
|
1352
|
+
Empty: Te,
|
|
1339
1353
|
Loading: q
|
|
1340
1354
|
});
|
|
1341
1355
|
gt.displayName = "Dropdown";
|
|
@@ -1404,7 +1418,7 @@ Ot.displayName = "Modal.Close";
|
|
|
1404
1418
|
//#endregion
|
|
1405
1419
|
//#region src/components/Modal/internal/useModalDismiss.ts
|
|
1406
1420
|
var kt = ({ active: e, contentRef: t, closeOnEscape: n, closeOnOutsidePress: r, isTopModal: i, onEscapeKeyDown: a, onPointerDownOutside: o, onInteractOutside: s, requestClose: c }) => {
|
|
1407
|
-
|
|
1421
|
+
ce({
|
|
1408
1422
|
active: e,
|
|
1409
1423
|
closeOnOutsidePress: r,
|
|
1410
1424
|
closeOnEscape: n,
|
|
@@ -1441,7 +1455,7 @@ var kt = ({ active: e, contentRef: t, closeOnEscape: n, closeOnOutsidePress: r,
|
|
|
1441
1455
|
onInteractOutside: p.onInteractOutside,
|
|
1442
1456
|
onPointerDownOutside: p.onPointerDownOutside,
|
|
1443
1457
|
requestClose: p.requestClose
|
|
1444
|
-
}),
|
|
1458
|
+
}), se({
|
|
1445
1459
|
active: m,
|
|
1446
1460
|
contentRef: p.contentRef,
|
|
1447
1461
|
enabled: p.trapFocus,
|
|
@@ -1531,7 +1545,7 @@ Rt.displayName = "ModalOverlay";
|
|
|
1531
1545
|
//#endregion
|
|
1532
1546
|
//#region src/components/Modal/Root/ModalRoot.tsx
|
|
1533
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 }) => {
|
|
1534
|
-
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 } = ye({
|
|
1535
1549
|
open: t,
|
|
1536
1550
|
defaultOpen: r,
|
|
1537
1551
|
onOpenChange: i,
|
|
@@ -1545,7 +1559,7 @@ var zt = ({ children: e, open: t, defaultOpen: r = !1, onOpenChange: i, modal: a
|
|
|
1545
1559
|
active: O,
|
|
1546
1560
|
id: E
|
|
1547
1561
|
});
|
|
1548
|
-
return
|
|
1562
|
+
return me({
|
|
1549
1563
|
active: O,
|
|
1550
1564
|
enabled: c
|
|
1551
1565
|
}), f(() => {
|
|
@@ -1664,28 +1678,28 @@ function Wt() {
|
|
|
1664
1678
|
return d(Ht);
|
|
1665
1679
|
}
|
|
1666
1680
|
var J = {
|
|
1667
|
-
root: "
|
|
1668
|
-
invalid: "
|
|
1669
|
-
control: "
|
|
1670
|
-
label: "
|
|
1671
|
-
wrapper: "
|
|
1672
|
-
input: "
|
|
1673
|
-
disabled: "
|
|
1674
|
-
description: "
|
|
1675
|
-
colorPrimary: "
|
|
1676
|
-
colorNeutral: "
|
|
1677
|
-
colorSuccess: "
|
|
1678
|
-
colorWarning: "
|
|
1679
|
-
colorDanger: "
|
|
1680
|
-
sm: "
|
|
1681
|
-
md: "
|
|
1682
|
-
lg: "
|
|
1683
|
-
indicator: "
|
|
1684
|
-
customIcon: "
|
|
1685
|
-
"radio-pop": "_radio-
|
|
1686
|
-
"radio-indicator-in": "_radio-indicator-
|
|
1687
|
-
content: "
|
|
1688
|
-
error: "
|
|
1681
|
+
root: "_root_owqkg_1",
|
|
1682
|
+
invalid: "_invalid_owqkg_34",
|
|
1683
|
+
control: "_control_owqkg_34",
|
|
1684
|
+
label: "_label_owqkg_37",
|
|
1685
|
+
wrapper: "_wrapper_owqkg_40",
|
|
1686
|
+
input: "_input_owqkg_41",
|
|
1687
|
+
disabled: "_disabled_owqkg_44",
|
|
1688
|
+
description: "_description_owqkg_52",
|
|
1689
|
+
colorPrimary: "_colorPrimary_owqkg_56",
|
|
1690
|
+
colorNeutral: "_colorNeutral_owqkg_72",
|
|
1691
|
+
colorSuccess: "_colorSuccess_owqkg_88",
|
|
1692
|
+
colorWarning: "_colorWarning_owqkg_104",
|
|
1693
|
+
colorDanger: "_colorDanger_owqkg_120",
|
|
1694
|
+
sm: "_sm_owqkg_136",
|
|
1695
|
+
md: "_md_owqkg_145",
|
|
1696
|
+
lg: "_lg_owqkg_154",
|
|
1697
|
+
indicator: "_indicator_owqkg_209",
|
|
1698
|
+
customIcon: "_customIcon_owqkg_223",
|
|
1699
|
+
"radio-pop": "_radio-pop_owqkg_1",
|
|
1700
|
+
"radio-indicator-in": "_radio-indicator-in_owqkg_1",
|
|
1701
|
+
content: "_content_owqkg_346",
|
|
1702
|
+
error: "_error_owqkg_363"
|
|
1689
1703
|
}, Gt = {
|
|
1690
1704
|
primary: J.colorPrimary,
|
|
1691
1705
|
neutral: J.colorNeutral,
|
|
@@ -1698,7 +1712,7 @@ var J = {
|
|
|
1698
1712
|
E,
|
|
1699
1713
|
S?.describedBy,
|
|
1700
1714
|
y
|
|
1701
|
-
].filter(Boolean).join(" ") || void 0, O = S !== null, [k, A] =
|
|
1715
|
+
].filter(Boolean).join(" ") || void 0, O = S !== null, [k, A] = U({
|
|
1702
1716
|
value: t,
|
|
1703
1717
|
defaultValue: i,
|
|
1704
1718
|
onChange: u
|
|
@@ -1801,7 +1815,7 @@ var $t = {
|
|
|
1801
1815
|
disabled: "_disabled_1s3vp_160",
|
|
1802
1816
|
invalid: "_invalid_1s3vp_176"
|
|
1803
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) => {
|
|
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] =
|
|
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] = U({
|
|
1805
1819
|
value: e,
|
|
1806
1820
|
defaultValue: t,
|
|
1807
1821
|
onChange: i
|
|
@@ -2014,12 +2028,12 @@ var Y = {
|
|
|
2014
2028
|
};
|
|
2015
2029
|
un.__velliraSelectPart = "content", un.displayName = "Select.Content";
|
|
2016
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 }) => {
|
|
2017
|
-
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: V, itemHeight: se, startIndex: ce, topSpacerHeight: le, viewportHeight: ue, visibleOptions: de } = on({
|
|
2018
2032
|
loading: T,
|
|
2019
2033
|
options: c,
|
|
2020
2034
|
scrollTop: ie,
|
|
2021
2035
|
virtual: b
|
|
2022
|
-
}),
|
|
2036
|
+
}), H = u((e) => {
|
|
2023
2037
|
re(e), o(e);
|
|
2024
2038
|
}, [o]);
|
|
2025
2039
|
if (f(() => {
|
|
@@ -2037,8 +2051,8 @@ var dn = ({ isOpen: e, listboxId: i, labelledById: a, setDropdownRef: o, style:
|
|
|
2037
2051
|
te.current = !0;
|
|
2038
2052
|
return;
|
|
2039
2053
|
}
|
|
2040
|
-
if (te.current = !0,
|
|
2041
|
-
let e = Math.max(0, n *
|
|
2054
|
+
if (te.current = !0, V) {
|
|
2055
|
+
let e = Math.max(0, n * se - (ue - se) / 2);
|
|
2042
2056
|
ae(e), ne.scrollTop = e;
|
|
2043
2057
|
return;
|
|
2044
2058
|
}
|
|
@@ -2047,8 +2061,8 @@ var dn = ({ isOpen: e, listboxId: i, labelledById: a, setDropdownRef: o, style:
|
|
|
2047
2061
|
P,
|
|
2048
2062
|
ne,
|
|
2049
2063
|
e,
|
|
2064
|
+
V,
|
|
2050
2065
|
se,
|
|
2051
|
-
ce,
|
|
2052
2066
|
i,
|
|
2053
2067
|
T,
|
|
2054
2068
|
c,
|
|
@@ -2056,12 +2070,12 @@ var dn = ({ isOpen: e, listboxId: i, labelledById: a, setDropdownRef: o, style:
|
|
|
2056
2070
|
p,
|
|
2057
2071
|
ue
|
|
2058
2072
|
]), !e) return null;
|
|
2059
|
-
let
|
|
2073
|
+
let fe = l && !V ? l : de.map((e, t) => ({
|
|
2060
2074
|
type: "option",
|
|
2061
2075
|
option: e,
|
|
2062
|
-
optionIndex:
|
|
2063
|
-
})),
|
|
2064
|
-
ref:
|
|
2076
|
+
optionIndex: ce + t
|
|
2077
|
+
})), pe = /* @__PURE__ */ r("div", {
|
|
2078
|
+
ref: H,
|
|
2065
2079
|
tabIndex: 0,
|
|
2066
2080
|
className: [
|
|
2067
2081
|
Y.dropdown,
|
|
@@ -2072,7 +2086,7 @@ var dn = ({ isOpen: e, listboxId: i, labelledById: a, setDropdownRef: o, style:
|
|
|
2072
2086
|
].filter(Boolean).join(" "),
|
|
2073
2087
|
style: s,
|
|
2074
2088
|
onScroll: (e) => {
|
|
2075
|
-
|
|
2089
|
+
V && ae(e.currentTarget.scrollTop);
|
|
2076
2090
|
},
|
|
2077
2091
|
children: [
|
|
2078
2092
|
k,
|
|
@@ -2108,12 +2122,12 @@ var dn = ({ isOpen: e, listboxId: i, labelledById: a, setDropdownRef: o, style:
|
|
|
2108
2122
|
className: Y.empty,
|
|
2109
2123
|
children: j ?? E
|
|
2110
2124
|
}) : c.length ? /* @__PURE__ */ r(t, { children: [
|
|
2111
|
-
|
|
2125
|
+
V && /* @__PURE__ */ n("li", {
|
|
2112
2126
|
"aria-hidden": "true",
|
|
2113
2127
|
className: Y.virtualSpacer,
|
|
2114
|
-
style: { height:
|
|
2128
|
+
style: { height: le }
|
|
2115
2129
|
}),
|
|
2116
|
-
|
|
2130
|
+
fe.map((e) => {
|
|
2117
2131
|
if (e.type === "group") {
|
|
2118
2132
|
if (e.selectable && d) {
|
|
2119
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;
|
|
@@ -2163,7 +2177,7 @@ var dn = ({ isOpen: e, listboxId: i, labelledById: a, setDropdownRef: o, style:
|
|
|
2163
2177
|
onMouseEnter: () => z(a)
|
|
2164
2178
|
}, t.value);
|
|
2165
2179
|
}),
|
|
2166
|
-
|
|
2180
|
+
V && /* @__PURE__ */ n("li", {
|
|
2167
2181
|
"aria-hidden": "true",
|
|
2168
2182
|
className: Y.virtualSpacer,
|
|
2169
2183
|
style: { height: oe }
|
|
@@ -2178,7 +2192,7 @@ var dn = ({ isOpen: e, listboxId: i, labelledById: a, setDropdownRef: o, style:
|
|
|
2178
2192
|
})
|
|
2179
2193
|
]
|
|
2180
2194
|
});
|
|
2181
|
-
return x ? /* @__PURE__ */ n(
|
|
2195
|
+
return x ? /* @__PURE__ */ n(Ce, { children: pe }) : pe;
|
|
2182
2196
|
};
|
|
2183
2197
|
dn.displayName = "SelectContentSurface";
|
|
2184
2198
|
function fn(e) {
|
|
@@ -2607,159 +2621,159 @@ var Ln = ({ children: e, id: i, describedBy: a, labelledBy: o, isOpen: s, disabl
|
|
|
2607
2621
|
Ln.displayName = "SelectTriggerSurface";
|
|
2608
2622
|
//#endregion
|
|
2609
2623
|
//#region src/components/Select/Root/SelectRoot.tsx
|
|
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:
|
|
2611
|
-
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: V, startIcon: se, endIcon: le, prefix: ue, suffix: H, renderValue: fe, renderOption: pe, onBlur: he, onFocus: ge, className: U, triggerClassName: _e, dropdownClassName: ve }) => {
|
|
2625
|
+
let ye = p(), W = wn(), xe = !!(i || a || z), Se = o ?? (xe ? void 0 : W?.controlId) ?? ye, Ce = `${Se}-listbox`, [we, Te] = _(""), Ee = !!z, De = Ee ? `${Se}-error` : void 0, Oe = a ? `${Se}-description` : void 0, ke = D ?? W?.size ?? "md", Ae = M || Ee || !xe && !!W?.invalid, je = j || !xe && !!W?.disabled, Me = A || !xe && !!W?.required, Ne = [
|
|
2612
2626
|
l,
|
|
2613
|
-
!
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
].filter(Boolean).join(" "),
|
|
2617
|
-
options:
|
|
2618
|
-
searchable:
|
|
2619
|
-
searchValue:
|
|
2620
|
-
}), { selectedValue:
|
|
2627
|
+
!xe && !l ? W?.ariaDescribedBy : void 0,
|
|
2628
|
+
Oe,
|
|
2629
|
+
De
|
|
2630
|
+
].filter(Boolean).join(" "), G = g(null), Pe = g(null), [K, Fe] = _(!1), Ie = F || R, { entries: Le, options: Re } = Mn(e), ze = Pn({
|
|
2631
|
+
options: Re,
|
|
2632
|
+
searchable: Ie,
|
|
2633
|
+
searchValue: we
|
|
2634
|
+
}), { selectedValue: Be, selectedValues: Ve, isOpen: q, setIsOpen: He, setSelectedValue: Ue, activeIndex: We, setActiveIndex: Ge, closeDropdown: Ke, toggleDropdown: qe, selectValue: Je, onKeyDown: Ye } = be({
|
|
2621
2635
|
value: m,
|
|
2622
2636
|
defaultValue: v,
|
|
2623
2637
|
onValueChange: y,
|
|
2624
|
-
options:
|
|
2638
|
+
options: ze,
|
|
2625
2639
|
multiple: b,
|
|
2626
2640
|
maxSelected: x,
|
|
2627
2641
|
closeOnSelect: S,
|
|
2628
|
-
disabled:
|
|
2642
|
+
disabled: je,
|
|
2629
2643
|
open: re,
|
|
2630
2644
|
defaultOpen: ie,
|
|
2631
2645
|
onOpenChange: ae
|
|
2632
|
-
}), Xe = h(() =>
|
|
2646
|
+
}), Xe = h(() => Re.find((e) => Ve.includes(e.value)), [Re, Ve]), Ze = h(() => Re.filter((e) => Ve.includes(e.value)), [Re, Ve]), Qe = !!Xe, $e = Array.isArray(Be) ? Be[0] ?? "" : Be, { floatingStyles: et, setRef: tt, setFloatingRef: nt } = Nn({
|
|
2633
2647
|
isOpen: q,
|
|
2634
2648
|
onOpenChange: He,
|
|
2635
2649
|
placement: ee,
|
|
2636
2650
|
matchTriggerWidth: B,
|
|
2637
2651
|
avoidCollisions: te
|
|
2638
2652
|
}), rt = u((e) => {
|
|
2639
|
-
Je(e),
|
|
2653
|
+
Je(e), G.current?.focus();
|
|
2640
2654
|
}, [Je]), it = u((e) => {
|
|
2641
2655
|
if (!b || e.length === 0) return;
|
|
2642
|
-
let t = e.filter((e) =>
|
|
2656
|
+
let t = e.filter((e) => Re.some((t) => t.value === e && !t.disabled)), n = t.filter((e) => Ve.includes(e)), r = Ve.filter((e) => !t.includes(e)).length, i = typeof x == "number" ? Math.max(0, Math.min(t.length, x - r)) : t.length;
|
|
2643
2657
|
if (n.length > 0 && n.length >= i) {
|
|
2644
|
-
Ue(
|
|
2658
|
+
Ue(Ve.filter((e) => !t.includes(e)));
|
|
2645
2659
|
return;
|
|
2646
2660
|
}
|
|
2647
|
-
let a = [...
|
|
2661
|
+
let a = [...Ve];
|
|
2648
2662
|
for (let e of t) if (!a.includes(e)) {
|
|
2649
2663
|
if (typeof x == "number" && a.length >= x) break;
|
|
2650
2664
|
a.push(e);
|
|
2651
2665
|
}
|
|
2652
|
-
Ue(a), S && (Ke(),
|
|
2666
|
+
Ue(a), S && (Ke(), G.current?.focus());
|
|
2653
2667
|
}, [
|
|
2654
2668
|
Ke,
|
|
2655
2669
|
S,
|
|
2656
2670
|
x,
|
|
2657
2671
|
b,
|
|
2658
|
-
|
|
2659
|
-
|
|
2672
|
+
Re,
|
|
2673
|
+
Ve,
|
|
2660
2674
|
Ue
|
|
2661
2675
|
]), at = u(() => {
|
|
2662
|
-
Je(""),
|
|
2663
|
-
}, [
|
|
2664
|
-
q ||
|
|
2676
|
+
Je(""), V?.(), G.current?.focus();
|
|
2677
|
+
}, [V, Je]), ot = u(() => {
|
|
2678
|
+
q || Fe(!1), qe();
|
|
2665
2679
|
}, [q, qe]), st = u((e) => {
|
|
2666
|
-
zn(e, q) &&
|
|
2680
|
+
zn(e, q) && Fe(!0), Ye(e);
|
|
2667
2681
|
}, [q, Ye]), ct = u((e) => {
|
|
2668
|
-
|
|
2682
|
+
Fe(!0), Ge(e);
|
|
2669
2683
|
}, [Ge]), lt = u((e) => {
|
|
2670
|
-
|
|
2684
|
+
Te(e), oe?.(e);
|
|
2671
2685
|
}, [oe]), { isTopOverlay: ut } = de({
|
|
2672
2686
|
active: q,
|
|
2673
|
-
id:
|
|
2687
|
+
id: Ce
|
|
2674
2688
|
});
|
|
2675
|
-
|
|
2689
|
+
ce({
|
|
2676
2690
|
active: q,
|
|
2677
2691
|
closeOnEscape: !0,
|
|
2678
2692
|
closeOnOutsidePress: !0,
|
|
2679
|
-
contentRef:
|
|
2680
|
-
ignoreRefs: [
|
|
2693
|
+
contentRef: Pe,
|
|
2694
|
+
ignoreRefs: [G],
|
|
2681
2695
|
isTopOverlay: ut,
|
|
2682
2696
|
requestClose: Ke
|
|
2683
2697
|
}), f(() => {
|
|
2684
|
-
q ||
|
|
2698
|
+
q || Fe(!1);
|
|
2685
2699
|
}, [q]), f(() => {
|
|
2686
|
-
!q &&
|
|
2687
|
-
}, [q,
|
|
2700
|
+
!q && we && Te("");
|
|
2701
|
+
}, [q, we]), me({
|
|
2688
2702
|
active: q,
|
|
2689
2703
|
enabled: L
|
|
2690
2704
|
});
|
|
2691
2705
|
let dt = u((e) => {
|
|
2692
|
-
|
|
2706
|
+
G.current = e, tt(e);
|
|
2693
2707
|
}, [tt]), ft = u((e) => {
|
|
2694
|
-
|
|
2695
|
-
}, [nt]), pt =
|
|
2696
|
-
id:
|
|
2697
|
-
describedBy:
|
|
2708
|
+
Pe.current = e, nt(e);
|
|
2709
|
+
}, [nt]), pt = fe ? fe(Xe) : b && Ze.length ? Ze.map((e) => e.label).join(", ") : Xe?.label ?? C, mt = w ?? E ?? "No options available", ht = P && Ve.length > 0 && !je && !N, gt = {
|
|
2710
|
+
id: Se,
|
|
2711
|
+
describedBy: Ne || void 0,
|
|
2698
2712
|
labelledBy: c ? void 0 : d,
|
|
2699
2713
|
isOpen: q,
|
|
2700
|
-
disabled:
|
|
2701
|
-
required:
|
|
2702
|
-
listboxId:
|
|
2714
|
+
disabled: je,
|
|
2715
|
+
required: Me,
|
|
2716
|
+
listboxId: Ce,
|
|
2703
2717
|
activeIndex: We,
|
|
2704
|
-
ariaLabel: c ?? (!i && !
|
|
2705
|
-
error:
|
|
2718
|
+
ariaLabel: c ?? (!i && !W?.labelId ? Xe?.label || C : void 0),
|
|
2719
|
+
error: Ae,
|
|
2706
2720
|
loading: N,
|
|
2707
2721
|
displayText: pt,
|
|
2708
2722
|
isPlaceholder: !Qe,
|
|
2709
|
-
size:
|
|
2723
|
+
size: ke,
|
|
2710
2724
|
color: O,
|
|
2711
2725
|
variant: k,
|
|
2712
|
-
startIcon:
|
|
2713
|
-
endIcon:
|
|
2726
|
+
startIcon: se,
|
|
2727
|
+
endIcon: le,
|
|
2714
2728
|
prefix: ue,
|
|
2715
|
-
suffix:
|
|
2729
|
+
suffix: H,
|
|
2716
2730
|
clearable: ht,
|
|
2717
|
-
className:
|
|
2731
|
+
className: _e,
|
|
2718
2732
|
buttonRef: dt,
|
|
2719
2733
|
onClear: at,
|
|
2720
2734
|
onClick: ot,
|
|
2721
2735
|
onKeyDown: st,
|
|
2722
|
-
onBlur:
|
|
2736
|
+
onBlur: he,
|
|
2723
2737
|
onFocus: ge
|
|
2724
2738
|
}, _t = {
|
|
2725
2739
|
isOpen: q,
|
|
2726
|
-
listboxId:
|
|
2727
|
-
labelledById:
|
|
2740
|
+
listboxId: Ce,
|
|
2741
|
+
labelledById: Se,
|
|
2728
2742
|
style: et,
|
|
2729
|
-
options:
|
|
2730
|
-
entries:
|
|
2743
|
+
options: ze,
|
|
2744
|
+
entries: Ie || we ? void 0 : Le,
|
|
2731
2745
|
multiple: b,
|
|
2732
2746
|
color: O,
|
|
2733
2747
|
variant: k,
|
|
2734
|
-
searchable:
|
|
2748
|
+
searchable: Ie,
|
|
2735
2749
|
command: R,
|
|
2736
2750
|
virtual: I,
|
|
2737
2751
|
portal: ne,
|
|
2738
|
-
searchValue:
|
|
2752
|
+
searchValue: we,
|
|
2739
2753
|
loading: N,
|
|
2740
2754
|
loadingText: T,
|
|
2741
2755
|
noOptionsText: mt,
|
|
2742
|
-
renderOption:
|
|
2756
|
+
renderOption: pe,
|
|
2743
2757
|
selectedValue: $e,
|
|
2744
|
-
selectedValues:
|
|
2758
|
+
selectedValues: Ve,
|
|
2745
2759
|
activeIndex: We,
|
|
2746
|
-
visualActiveIndex:
|
|
2747
|
-
className:
|
|
2760
|
+
visualActiveIndex: K ? We : -1,
|
|
2761
|
+
className: ve,
|
|
2748
2762
|
setDropdownRef: ft,
|
|
2749
2763
|
onSelect: rt,
|
|
2750
2764
|
onSelectGroup: it,
|
|
2751
2765
|
onMouseEnter: ct,
|
|
2752
2766
|
onSearchChange: lt
|
|
2753
|
-
}, vt = /* @__PURE__ */ r(t, { children: [s && b &&
|
|
2767
|
+
}, vt = /* @__PURE__ */ r(t, { children: [s && b && Ve.length > 0 && /* @__PURE__ */ n(t, { children: Ve.map((e) => /* @__PURE__ */ n("input", {
|
|
2754
2768
|
type: "hidden",
|
|
2755
2769
|
name: s,
|
|
2756
2770
|
value: e,
|
|
2757
|
-
disabled:
|
|
2771
|
+
disabled: je
|
|
2758
2772
|
}, e)) }), s && !b && /* @__PURE__ */ n("input", {
|
|
2759
2773
|
type: "hidden",
|
|
2760
2774
|
name: s,
|
|
2761
2775
|
value: $e,
|
|
2762
|
-
disabled:
|
|
2776
|
+
disabled: je
|
|
2763
2777
|
})] }), yt = kn(e), bt = /* @__PURE__ */ r(rn, {
|
|
2764
2778
|
value: {
|
|
2765
2779
|
triggerProps: gt,
|
|
@@ -2777,15 +2791,15 @@ var Rn = ({ children: e, label: i, description: a, id: o, name: s, "aria-label":
|
|
|
2777
2791
|
/* @__PURE__ */ n(dn, { ..._t })
|
|
2778
2792
|
]
|
|
2779
2793
|
});
|
|
2780
|
-
return !
|
|
2781
|
-
id:
|
|
2794
|
+
return !xe && W ? e ? bt : xt : /* @__PURE__ */ n(Dn, {
|
|
2795
|
+
id: Se,
|
|
2782
2796
|
label: i,
|
|
2783
2797
|
description: a,
|
|
2784
2798
|
error: z,
|
|
2785
|
-
required:
|
|
2786
|
-
disabled:
|
|
2799
|
+
required: Me,
|
|
2800
|
+
disabled: je,
|
|
2787
2801
|
bindControl: !1,
|
|
2788
|
-
className:
|
|
2802
|
+
className: U,
|
|
2789
2803
|
children: e ? bt : xt
|
|
2790
2804
|
});
|
|
2791
2805
|
};
|
|
@@ -3110,7 +3124,7 @@ var $n = (e) => [...e].sort((e, t) => {
|
|
|
3110
3124
|
tabs: "_tabs_1hj56_1",
|
|
3111
3125
|
vertical: "_vertical_1hj56_30"
|
|
3112
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 }) => {
|
|
3113
|
-
let S = p(), C = t !== void 0, { value: w, setValue: T } =
|
|
3127
|
+
let S = p(), C = t !== void 0, { value: w, setValue: T } = W({
|
|
3114
3128
|
value: t,
|
|
3115
3129
|
defaultValue: r,
|
|
3116
3130
|
onValueChange: i
|
|
@@ -3377,23 +3391,23 @@ function vr(...e) {
|
|
|
3377
3391
|
}
|
|
3378
3392
|
//#endregion
|
|
3379
3393
|
//#region src/components/Tooltip/Content/TooltipContent.tsx
|
|
3380
|
-
var yr = c(({ children: e, forceMount: t = !1, className:
|
|
3381
|
-
let
|
|
3382
|
-
return !t && !
|
|
3383
|
-
...
|
|
3384
|
-
id:
|
|
3394
|
+
var yr = c(({ children: e, forceMount: t = !1, withArrow: i = !1, className: a, style: o, ...s }, c) => {
|
|
3395
|
+
let l = pr();
|
|
3396
|
+
return !t && !l.open ? null : /* @__PURE__ */ r("div", {
|
|
3397
|
+
...l.getContentProps({
|
|
3398
|
+
id: l.contentId,
|
|
3385
3399
|
role: "tooltip",
|
|
3386
|
-
...
|
|
3400
|
+
...s
|
|
3387
3401
|
}),
|
|
3388
|
-
ref: vr(
|
|
3389
|
-
className: P(hr.tooltip,
|
|
3390
|
-
"data-placement":
|
|
3391
|
-
"data-state":
|
|
3402
|
+
ref: vr(c, l.setContentRef),
|
|
3403
|
+
className: P(hr.tooltip, a),
|
|
3404
|
+
"data-placement": l.placement,
|
|
3405
|
+
"data-state": l.open ? "open" : "closed",
|
|
3392
3406
|
style: {
|
|
3393
|
-
...
|
|
3394
|
-
...
|
|
3407
|
+
...l.floatingStyles,
|
|
3408
|
+
...o
|
|
3395
3409
|
},
|
|
3396
|
-
children: e
|
|
3410
|
+
children: [e, i && /* @__PURE__ */ n(gr, {})]
|
|
3397
3411
|
});
|
|
3398
3412
|
});
|
|
3399
3413
|
yr.displayName = "Tooltip.Content";
|
|
@@ -3441,7 +3455,7 @@ function Sr({ open: e, onOpenChange: t, placement: n, offset: r, avoidCollisions
|
|
|
3441
3455
|
//#endregion
|
|
3442
3456
|
//#region src/components/Tooltip/Root/TooltipRoot.tsx
|
|
3443
3457
|
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 }) => {
|
|
3444
|
-
let h = `${p()}-content`, _ = g(null), v = g(null), [y, b] =
|
|
3458
|
+
let h = `${p()}-content`, _ = g(null), v = g(null), [y, b] = U({
|
|
3445
3459
|
value: t,
|
|
3446
3460
|
defaultValue: r,
|
|
3447
3461
|
onChange: i
|
|
@@ -3463,7 +3477,7 @@ var Cr = ({ children: e, open: t, defaultOpen: r = !1, onOpenChange: i, placemen
|
|
|
3463
3477
|
active: y,
|
|
3464
3478
|
id: h
|
|
3465
3479
|
});
|
|
3466
|
-
return
|
|
3480
|
+
return ce({
|
|
3467
3481
|
active: y,
|
|
3468
3482
|
contentRef: _,
|
|
3469
3483
|
ignoreRefs: [v],
|
|
@@ -3534,33 +3548,33 @@ Tr.displayName = "Tooltip";
|
|
|
3534
3548
|
var Er = (e, t) => {
|
|
3535
3549
|
process.env.NODE_ENV !== "production" && !e && console.warn(t);
|
|
3536
3550
|
}, Z = {
|
|
3537
|
-
button: "
|
|
3538
|
-
solid: "
|
|
3539
|
-
primary: "
|
|
3540
|
-
loading: "
|
|
3541
|
-
neutral: "
|
|
3542
|
-
success: "
|
|
3543
|
-
warning: "
|
|
3544
|
-
danger: "
|
|
3545
|
-
outline: "
|
|
3546
|
-
ghost: "
|
|
3547
|
-
soft: "
|
|
3548
|
-
link: "
|
|
3549
|
-
square: "
|
|
3550
|
-
rounded: "
|
|
3551
|
-
pill: "
|
|
3552
|
-
sm: "
|
|
3553
|
-
md: "
|
|
3554
|
-
lg: "
|
|
3555
|
-
fullWidth: "
|
|
3556
|
-
iconOnly: "
|
|
3557
|
-
label: "
|
|
3558
|
-
labelText: "
|
|
3559
|
-
icon: "
|
|
3560
|
-
spinner: "
|
|
3561
|
-
"button-spin": "_button-
|
|
3562
|
-
badge: "
|
|
3563
|
-
shortcut: "
|
|
3551
|
+
button: "_button_1xn9g_1",
|
|
3552
|
+
solid: "_solid_1xn9g_23",
|
|
3553
|
+
primary: "_primary_1xn9g_23",
|
|
3554
|
+
loading: "_loading_1xn9g_23",
|
|
3555
|
+
neutral: "_neutral_1xn9g_49",
|
|
3556
|
+
success: "_success_1xn9g_75",
|
|
3557
|
+
warning: "_warning_1xn9g_101",
|
|
3558
|
+
danger: "_danger_1xn9g_127",
|
|
3559
|
+
outline: "_outline_1xn9g_153",
|
|
3560
|
+
ghost: "_ghost_1xn9g_283",
|
|
3561
|
+
soft: "_soft_1xn9g_413",
|
|
3562
|
+
link: "_link_1xn9g_543",
|
|
3563
|
+
square: "_square_1xn9g_711",
|
|
3564
|
+
rounded: "_rounded_1xn9g_715",
|
|
3565
|
+
pill: "_pill_1xn9g_719",
|
|
3566
|
+
sm: "_sm_1xn9g_723",
|
|
3567
|
+
md: "_md_1xn9g_729",
|
|
3568
|
+
lg: "_lg_1xn9g_735",
|
|
3569
|
+
fullWidth: "_fullWidth_1xn9g_741",
|
|
3570
|
+
iconOnly: "_iconOnly_1xn9g_745",
|
|
3571
|
+
label: "_label_1xn9g_749",
|
|
3572
|
+
labelText: "_labelText_1xn9g_771",
|
|
3573
|
+
icon: "_icon_1xn9g_745",
|
|
3574
|
+
spinner: "_spinner_1xn9g_790",
|
|
3575
|
+
"button-spin": "_button-spin_1xn9g_1",
|
|
3576
|
+
badge: "_badge_1xn9g_812",
|
|
3577
|
+
shortcut: "_shortcut_1xn9g_826"
|
|
3564
3578
|
}, Dr = c(({ children: e, color: i = "primary", appearance: a = "solid", size: s = "md", shape: c = "pill", type: u = "button", disabled: d = !1, loading: f = !1, loadingText: p, iconStart: m, iconEnd: h, spinner: g, badge: _, shortcut: v, tooltip: y, fullWidth: b = !1, iconOnly: x = !1, asChild: S = !1, className: C, onClick: w, "aria-label": T, "aria-labelledby": E, href: D, target: O, rel: k, download: A, id: j, role: M, tabIndex: N, ...F }, I) => {
|
|
3565
3579
|
let L = S && l(e) ? e : void 0, R = L ? L.props.children : e, z = x || !R && !!(m || h), ee = !!(T || E || L?.props["aria-label"] || L?.props["aria-labelledby"]), B = d || f, te = f && p ? p : R, ne = p && R && !z && (typeof R == "string" || typeof R == "number") && (typeof p == "string" || typeof p == "number") ? String(f ? R : p) : void 0, re = O === "_blank" && !k ? "noreferrer noopener" : k, ie = P(Z.button, Z[i], Z[a], Z[s], Z[c], C, {
|
|
3566
3580
|
[Z.disabled]: B,
|
|
@@ -3577,7 +3591,7 @@ var Er = (e, t) => {
|
|
|
3577
3591
|
return;
|
|
3578
3592
|
}
|
|
3579
3593
|
L?.props.onClick?.(e), e.defaultPrevented || w?.(e);
|
|
3580
|
-
},
|
|
3594
|
+
}, V = /* @__PURE__ */ r(t, { children: [
|
|
3581
3595
|
f && (g ? /* @__PURE__ */ n("span", {
|
|
3582
3596
|
className: Z.icon,
|
|
3583
3597
|
"aria-hidden": "true",
|
|
@@ -3623,7 +3637,7 @@ var Er = (e, t) => {
|
|
|
3623
3637
|
onClick: oe,
|
|
3624
3638
|
tabIndex: B ? -1 : L.props.tabIndex,
|
|
3625
3639
|
title: y || L.props.title,
|
|
3626
|
-
children:
|
|
3640
|
+
children: V
|
|
3627
3641
|
}) : D ? /* @__PURE__ */ n("a", {
|
|
3628
3642
|
ref: I,
|
|
3629
3643
|
href: B ? void 0 : D,
|
|
@@ -3640,7 +3654,7 @@ var Er = (e, t) => {
|
|
|
3640
3654
|
"aria-busy": f || void 0,
|
|
3641
3655
|
className: ie,
|
|
3642
3656
|
title: y,
|
|
3643
|
-
children:
|
|
3657
|
+
children: V
|
|
3644
3658
|
}) : /* @__PURE__ */ n("button", {
|
|
3645
3659
|
...F,
|
|
3646
3660
|
ref: I,
|
|
@@ -3655,45 +3669,45 @@ var Er = (e, t) => {
|
|
|
3655
3669
|
"aria-busy": f || void 0,
|
|
3656
3670
|
className: ie,
|
|
3657
3671
|
title: y,
|
|
3658
|
-
children:
|
|
3672
|
+
children: V
|
|
3659
3673
|
});
|
|
3660
3674
|
});
|
|
3661
3675
|
Dr.displayName = "Button";
|
|
3662
3676
|
var Q = {
|
|
3663
|
-
wrapper: "
|
|
3664
|
-
colorPrimary: "
|
|
3665
|
-
colorNeutral: "
|
|
3666
|
-
colorSuccess: "
|
|
3667
|
-
colorWarning: "
|
|
3668
|
-
colorDanger: "
|
|
3669
|
-
labelStart: "
|
|
3670
|
-
wrapperSm: "
|
|
3671
|
-
wrapperMd: "
|
|
3672
|
-
wrapperLg: "
|
|
3673
|
-
iconOnly: "
|
|
3674
|
-
container: "
|
|
3675
|
-
containerSm: "
|
|
3676
|
-
containerMd: "
|
|
3677
|
-
containerLg: "
|
|
3678
|
-
containerLabelStart: "
|
|
3679
|
-
descriptionText: "
|
|
3680
|
-
errorText: "
|
|
3681
|
-
input: "
|
|
3682
|
-
customCheckbox: "
|
|
3683
|
-
requiredMark: "
|
|
3684
|
-
error: "
|
|
3685
|
-
checkmark: "
|
|
3686
|
-
indeterminateMark: "
|
|
3687
|
-
customMark: "
|
|
3688
|
-
label: "
|
|
3689
|
-
labelSm: "
|
|
3690
|
-
labelMd: "
|
|
3691
|
-
labelLg: "
|
|
3692
|
-
indeterminate: "
|
|
3693
|
-
"checkbox-pop": "_checkbox-
|
|
3694
|
-
"checkbox-checkmark-in": "_checkbox-checkmark-
|
|
3695
|
-
"checkbox-indeterminate-in": "_checkbox-indeterminate-
|
|
3696
|
-
disabled: "
|
|
3677
|
+
wrapper: "_wrapper_11rc7_1",
|
|
3678
|
+
colorPrimary: "_colorPrimary_11rc7_35",
|
|
3679
|
+
colorNeutral: "_colorNeutral_11rc7_53",
|
|
3680
|
+
colorSuccess: "_colorSuccess_11rc7_71",
|
|
3681
|
+
colorWarning: "_colorWarning_11rc7_89",
|
|
3682
|
+
colorDanger: "_colorDanger_11rc7_107",
|
|
3683
|
+
labelStart: "_labelStart_11rc7_123",
|
|
3684
|
+
wrapperSm: "_wrapperSm_11rc7_127",
|
|
3685
|
+
wrapperMd: "_wrapperMd_11rc7_133",
|
|
3686
|
+
wrapperLg: "_wrapperLg_11rc7_139",
|
|
3687
|
+
iconOnly: "_iconOnly_11rc7_145",
|
|
3688
|
+
container: "_container_11rc7_151",
|
|
3689
|
+
containerSm: "_containerSm_11rc7_158",
|
|
3690
|
+
containerMd: "_containerMd_11rc7_162",
|
|
3691
|
+
containerLg: "_containerLg_11rc7_166",
|
|
3692
|
+
containerLabelStart: "_containerLabelStart_11rc7_170",
|
|
3693
|
+
descriptionText: "_descriptionText_11rc7_170",
|
|
3694
|
+
errorText: "_errorText_11rc7_171",
|
|
3695
|
+
input: "_input_11rc7_175",
|
|
3696
|
+
customCheckbox: "_customCheckbox_11rc7_187",
|
|
3697
|
+
requiredMark: "_requiredMark_11rc7_202",
|
|
3698
|
+
error: "_error_11rc7_171",
|
|
3699
|
+
checkmark: "_checkmark_11rc7_218",
|
|
3700
|
+
indeterminateMark: "_indeterminateMark_11rc7_234",
|
|
3701
|
+
customMark: "_customMark_11rc7_247",
|
|
3702
|
+
label: "_label_11rc7_123",
|
|
3703
|
+
labelSm: "_labelSm_11rc7_278",
|
|
3704
|
+
labelMd: "_labelMd_11rc7_282",
|
|
3705
|
+
labelLg: "_labelLg_11rc7_286",
|
|
3706
|
+
indeterminate: "_indeterminate_11rc7_234",
|
|
3707
|
+
"checkbox-pop": "_checkbox-pop_11rc7_1",
|
|
3708
|
+
"checkbox-checkmark-in": "_checkbox-checkmark-in_11rc7_1",
|
|
3709
|
+
"checkbox-indeterminate-in": "_checkbox-indeterminate-in_11rc7_1",
|
|
3710
|
+
disabled: "_disabled_11rc7_369"
|
|
3697
3711
|
}, Or = {
|
|
3698
3712
|
sm: Q.labelSm,
|
|
3699
3713
|
md: Q.labelMd,
|
|
@@ -3717,7 +3731,7 @@ var Q = {
|
|
|
3717
3731
|
E,
|
|
3718
3732
|
N,
|
|
3719
3733
|
F
|
|
3720
|
-
].filter(Boolean).join(" "), [L, R] =
|
|
3734
|
+
].filter(Boolean).join(" "), [L, R] = U({
|
|
3721
3735
|
value: s,
|
|
3722
3736
|
defaultValue: m,
|
|
3723
3737
|
onChange: S
|
|
@@ -3863,39 +3877,39 @@ var $ = {
|
|
|
3863
3877
|
r < n.length && (i += e);
|
|
3864
3878
|
}
|
|
3865
3879
|
return i;
|
|
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:
|
|
3867
|
-
let
|
|
3868
|
-
|
|
3869
|
-
!
|
|
3880
|
+
}, 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: V, onMouseEnter: se, onMouseLeave: ce, "aria-describedby": le, "aria-invalid": ue, "aria-labelledby": de, ...H }, fe) => {
|
|
3881
|
+
let pe = p(), me = wn(), he = !!(i || o || v), ge = e ?? (he ? void 0 : me?.controlId) ?? pe, U = g(null), [_e, ve] = _(!1), [ye, be] = _(l ?? ""), W = c !== void 0, xe = String((W ? c : ye) ?? ""), Se = te ? te(xe) : xe, Ce = xe.length > 0, we = f ?? me?.size ?? "md", Te = y || !!v || !he && !!me?.invalid, Ee = b || !he && !!me?.disabled, De = x || !he && !!me?.required, Oe = D || S, ke = d === "password", Ae = ke && j && _e ? "text" : d, je = N ?? (d === "search" ? /* @__PURE__ */ n(C, {}) : null), Me = F, Ne = Pr(d, E), G = S && !Ee, Pe = O && Ce && !Ee && !Oe && !G, K = j && ke && !Ee && !G && !Pe, Fe = !G && !Pe && !K && !!Me, Ie = !!(M && V), Le = o ? `${ge}-description` : void 0, Re = v ? `${ge}-error` : void 0, ze = Ie ? `${ge}-counter` : void 0, Be = [
|
|
3882
|
+
le,
|
|
3883
|
+
!he && !le ? me?.ariaDescribedBy : void 0,
|
|
3884
|
+
Le,
|
|
3870
3885
|
Re,
|
|
3871
|
-
ze
|
|
3872
|
-
|
|
3873
|
-
|
|
3874
|
-
|
|
3875
|
-
pe(e);
|
|
3886
|
+
ze
|
|
3887
|
+
].filter(Boolean).join(" "), Ve = ee ?? "×", q = !!(je || R), He = !!(Me || z || Pe || K || G), Ue = !!(je && R), We = !!(Me && z), Ge = !!(I || L), Ke = u((e) => {
|
|
3888
|
+
if (U.current = e, typeof fe == "function") {
|
|
3889
|
+
fe(e);
|
|
3876
3890
|
return;
|
|
3877
3891
|
}
|
|
3878
|
-
|
|
3879
|
-
}, [
|
|
3892
|
+
fe && (fe.current = e);
|
|
3893
|
+
}, [fe]), qe = u((e) => {
|
|
3880
3894
|
let t = Ir(ne ? ne(e.target.value) : e.target.value, B);
|
|
3881
|
-
|
|
3895
|
+
W || be(t), A?.(t);
|
|
3882
3896
|
}, [
|
|
3883
|
-
|
|
3897
|
+
W,
|
|
3884
3898
|
B,
|
|
3885
3899
|
A,
|
|
3886
3900
|
ne
|
|
3887
3901
|
]), Je = u(() => {
|
|
3888
|
-
|
|
3902
|
+
W || be(""), A?.(""), k?.(), U.current?.focus();
|
|
3889
3903
|
}, [
|
|
3890
|
-
|
|
3904
|
+
W,
|
|
3891
3905
|
k,
|
|
3892
3906
|
A
|
|
3893
3907
|
]), Ye = /* @__PURE__ */ r(t, { children: [/* @__PURE__ */ r("div", {
|
|
3894
3908
|
className: P($.inputGroup, $[h], $[m], {
|
|
3895
3909
|
[$.hasAddons]: Ge,
|
|
3896
|
-
[$.isDisabled]:
|
|
3897
|
-
[$.isInvalid]:
|
|
3898
|
-
[$.isLoading]:
|
|
3910
|
+
[$.isDisabled]: Ee,
|
|
3911
|
+
[$.isInvalid]: Te,
|
|
3912
|
+
[$.isLoading]: G
|
|
3899
3913
|
}),
|
|
3900
3914
|
children: [
|
|
3901
3915
|
I && /* @__PURE__ */ n("span", {
|
|
@@ -3910,37 +3924,37 @@ var $ = {
|
|
|
3910
3924
|
[$.hasEndIconAndSuffix]: We
|
|
3911
3925
|
}),
|
|
3912
3926
|
children: [
|
|
3913
|
-
|
|
3927
|
+
je && /* @__PURE__ */ n("span", {
|
|
3914
3928
|
"aria-hidden": "true",
|
|
3915
3929
|
className: P($.startAdornment, Nr[re]),
|
|
3916
|
-
children:
|
|
3930
|
+
children: je
|
|
3917
3931
|
}),
|
|
3918
3932
|
R && /* @__PURE__ */ n("span", {
|
|
3919
3933
|
className: $.prefix,
|
|
3920
3934
|
children: R
|
|
3921
3935
|
}),
|
|
3922
3936
|
/* @__PURE__ */ n("input", {
|
|
3923
|
-
...
|
|
3937
|
+
...H,
|
|
3924
3938
|
ref: Ke,
|
|
3925
3939
|
id: ge,
|
|
3926
3940
|
name: a,
|
|
3927
|
-
type:
|
|
3928
|
-
autoComplete:
|
|
3929
|
-
className: P($.input, $[
|
|
3930
|
-
value:
|
|
3941
|
+
type: Ae,
|
|
3942
|
+
autoComplete: Ne,
|
|
3943
|
+
className: P($.input, $[we], { [$.error]: Te }, w),
|
|
3944
|
+
value: Se,
|
|
3931
3945
|
onChange: qe,
|
|
3932
3946
|
placeholder: s,
|
|
3933
|
-
disabled:
|
|
3934
|
-
readOnly:
|
|
3935
|
-
required:
|
|
3947
|
+
disabled: Ee,
|
|
3948
|
+
readOnly: Oe,
|
|
3949
|
+
required: De,
|
|
3936
3950
|
autoFocus: oe,
|
|
3937
|
-
maxLength:
|
|
3938
|
-
"aria-invalid":
|
|
3939
|
-
"aria-labelledby": de ?? (
|
|
3940
|
-
"aria-describedby":
|
|
3951
|
+
maxLength: V,
|
|
3952
|
+
"aria-invalid": Te ? !0 : ue,
|
|
3953
|
+
"aria-labelledby": de ?? (he ? void 0 : me?.ariaLabelledBy),
|
|
3954
|
+
"aria-describedby": Be || void 0,
|
|
3941
3955
|
"aria-busy": S || void 0,
|
|
3942
|
-
onMouseEnter:
|
|
3943
|
-
onMouseLeave:
|
|
3956
|
+
onMouseEnter: se,
|
|
3957
|
+
onMouseLeave: ce
|
|
3944
3958
|
}),
|
|
3945
3959
|
z && /* @__PURE__ */ n("span", {
|
|
3946
3960
|
className: $.suffix,
|
|
@@ -3949,29 +3963,29 @@ var $ = {
|
|
|
3949
3963
|
/* @__PURE__ */ r("div", {
|
|
3950
3964
|
className: $.endSlot,
|
|
3951
3965
|
children: [
|
|
3952
|
-
|
|
3966
|
+
G && /* @__PURE__ */ n("span", {
|
|
3953
3967
|
className: $.spinner,
|
|
3954
3968
|
"aria-hidden": "true",
|
|
3955
3969
|
"data-testid": "input-spinner"
|
|
3956
3970
|
}),
|
|
3957
|
-
|
|
3971
|
+
K && /* @__PURE__ */ n("button", {
|
|
3958
3972
|
type: "button",
|
|
3959
3973
|
className: $.iconButton,
|
|
3960
|
-
onClick: () =>
|
|
3961
|
-
"aria-label":
|
|
3962
|
-
children:
|
|
3974
|
+
onClick: () => ve((e) => !e),
|
|
3975
|
+
"aria-label": _e ? "Hide password" : "Show password",
|
|
3976
|
+
children: _e ? "Hide" : "Show"
|
|
3963
3977
|
}),
|
|
3964
|
-
|
|
3978
|
+
Pe && /* @__PURE__ */ n("button", {
|
|
3965
3979
|
type: "button",
|
|
3966
3980
|
className: P($.clearButton, Nr[ae]),
|
|
3967
3981
|
onClick: Je,
|
|
3968
3982
|
"aria-label": "Clear input",
|
|
3969
|
-
children:
|
|
3983
|
+
children: Ve
|
|
3970
3984
|
}),
|
|
3971
|
-
|
|
3985
|
+
Fe && Me && /* @__PURE__ */ n("span", {
|
|
3972
3986
|
"aria-hidden": "true",
|
|
3973
3987
|
className: P($.endAdornment, Nr[ie]),
|
|
3974
|
-
children:
|
|
3988
|
+
children: Me
|
|
3975
3989
|
})
|
|
3976
3990
|
]
|
|
3977
3991
|
})
|
|
@@ -3982,24 +3996,24 @@ var $ = {
|
|
|
3982
3996
|
children: L
|
|
3983
3997
|
})
|
|
3984
3998
|
]
|
|
3985
|
-
}),
|
|
3986
|
-
id:
|
|
3999
|
+
}), Ie && /* @__PURE__ */ r("div", {
|
|
4000
|
+
id: ze,
|
|
3987
4001
|
className: $.counter,
|
|
3988
4002
|
children: [
|
|
3989
|
-
|
|
4003
|
+
xe.length,
|
|
3990
4004
|
" / ",
|
|
3991
|
-
|
|
4005
|
+
V
|
|
3992
4006
|
]
|
|
3993
4007
|
})] });
|
|
3994
|
-
return !
|
|
4008
|
+
return !he && me ? Ye : /* @__PURE__ */ n(Dn, {
|
|
3995
4009
|
id: ge,
|
|
3996
4010
|
label: i,
|
|
3997
4011
|
description: o,
|
|
3998
4012
|
error: v,
|
|
3999
|
-
required:
|
|
4000
|
-
disabled:
|
|
4001
|
-
invalid:
|
|
4002
|
-
size:
|
|
4013
|
+
required: De,
|
|
4014
|
+
disabled: Ee,
|
|
4015
|
+
invalid: Te,
|
|
4016
|
+
size: we,
|
|
4003
4017
|
className: T,
|
|
4004
4018
|
bindControl: !1,
|
|
4005
4019
|
children: Ye
|
|
@@ -4008,32 +4022,32 @@ var $ = {
|
|
|
4008
4022
|
Lr.displayName = "Input";
|
|
4009
4023
|
//#endregion
|
|
4010
4024
|
//#region src/theme/ThemeContext.ts
|
|
4011
|
-
var Rr = s(null), zr = (e) => e === "highContrast" ? "high-contrast" : e, Br = ({ theme: e, defaultTheme: t = "light", onThemeChange: r,
|
|
4012
|
-
let [
|
|
4025
|
+
var Rr = s(null), zr = (e) => e === "highContrast" ? "high-contrast" : e, Br = ({ theme: e, defaultTheme: t = "light", onThemeChange: r, syncDocument: i = !0, children: a }) => {
|
|
4026
|
+
let [o, s] = U({
|
|
4013
4027
|
value: e,
|
|
4014
4028
|
defaultValue: t,
|
|
4015
4029
|
onChange: r
|
|
4016
|
-
}),
|
|
4030
|
+
}), c = zr(o);
|
|
4017
4031
|
f(() => {
|
|
4018
|
-
if (typeof document > "u") return;
|
|
4032
|
+
if (!i || typeof document > "u") return;
|
|
4019
4033
|
let { documentElement: e } = document, t = e.dataset.velliraTheme;
|
|
4020
|
-
return e.dataset.velliraTheme =
|
|
4034
|
+
return e.dataset.velliraTheme = c, () => {
|
|
4021
4035
|
if (t === void 0) {
|
|
4022
4036
|
delete e.dataset.velliraTheme;
|
|
4023
4037
|
return;
|
|
4024
4038
|
}
|
|
4025
4039
|
e.dataset.velliraTheme = t;
|
|
4026
4040
|
};
|
|
4027
|
-
}, [
|
|
4028
|
-
let
|
|
4029
|
-
theme:
|
|
4030
|
-
setTheme:
|
|
4031
|
-
}), [
|
|
4041
|
+
}, [c, i]);
|
|
4042
|
+
let l = h(() => ({
|
|
4043
|
+
theme: o,
|
|
4044
|
+
setTheme: s
|
|
4045
|
+
}), [o, s]);
|
|
4032
4046
|
return /* @__PURE__ */ n(Rr.Provider, {
|
|
4033
|
-
value:
|
|
4047
|
+
value: l,
|
|
4034
4048
|
children: /* @__PURE__ */ n("div", {
|
|
4035
|
-
"data-vellira-theme":
|
|
4036
|
-
children:
|
|
4049
|
+
"data-vellira-theme": c,
|
|
4050
|
+
children: a
|
|
4037
4051
|
})
|
|
4038
4052
|
});
|
|
4039
4053
|
};
|
|
@@ -4046,4 +4060,4 @@ function Vr() {
|
|
|
4046
4060
|
return e;
|
|
4047
4061
|
}
|
|
4048
4062
|
//#endregion
|
|
4049
|
-
export { Dr as Button, Mr as Checkbox, gt as Dropdown, Dn as FormField, Lr as Input, Vt as Modal,
|
|
4063
|
+
export { Dr as Button, Mr as Checkbox, gt as Dropdown, Dn as FormField, Lr as Input, Vt as Modal, Ce as Portal, Se as PortalProvider, Kt as Radio, tn as RadioGroup, Hn as Select, cr as Tabs, Br as ThemeProvider, Tr as Tooltip, Vr as useTheme };
|