@vellira-ui/react 2.50.0 → 2.52.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 +31 -250
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +986 -678
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3,21 +3,21 @@ import { Fragment as t, jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
|
3
3
|
import { Children as i, Fragment as a, cloneElement as o, createContext as s, forwardRef as c, isValidElement as l, useCallback as u, useContext as d, useEffect as f, useId as p, useLayoutEffect as m, useMemo as h, useRef as g, useState as _ } from "react";
|
|
4
4
|
import { createPortal as v } from "react-dom";
|
|
5
5
|
import { Check as y, ChevronDown as b, ChevronRight as x, Close as S, Search as C } from "@vellira-ui/icons";
|
|
6
|
-
import {
|
|
7
|
-
import { lightTheme as
|
|
6
|
+
import { FloatingArrow as w, arrow as T, autoUpdate as E, flip as D, offset as O, shift as k, size as A, useFloating as j, useFocus as M, useHover as N, useInteractions as P } from "@floating-ui/react";
|
|
7
|
+
import { lightTheme as F } from "@vellira-ui/tokens";
|
|
8
8
|
//#region src/utils/cn.ts
|
|
9
|
-
var
|
|
9
|
+
var I = (...t) => e(t), L = { arrow: "_arrow_8b0vb_1" }, R = ({ className: e }) => /* @__PURE__ */ n("span", {
|
|
10
10
|
"aria-hidden": "true",
|
|
11
|
-
className:
|
|
11
|
+
className: I(L.arrow, e)
|
|
12
12
|
});
|
|
13
|
-
|
|
13
|
+
R.__velliraDropdownPart = "arrow", R.displayName = "Dropdown.Arrow";
|
|
14
14
|
//#endregion
|
|
15
15
|
//#region src/components/Dropdown/internal/DropdownCollection.ts
|
|
16
|
-
function
|
|
16
|
+
function z(e, t) {
|
|
17
17
|
let n = () => null;
|
|
18
18
|
return n.__velliraDropdownPart = e, n.displayName = t, n;
|
|
19
19
|
}
|
|
20
|
-
function
|
|
20
|
+
function B(e) {
|
|
21
21
|
let t = 0, n, r, a, o, s = [], c = [], u = (e) => `${e}-${t++}`;
|
|
22
22
|
function d(e) {
|
|
23
23
|
c.push(e), s.push({
|
|
@@ -136,9 +136,9 @@ function z(e) {
|
|
|
136
136
|
return;
|
|
137
137
|
}
|
|
138
138
|
case "sub": {
|
|
139
|
-
let t = e.props, n =
|
|
139
|
+
let t = e.props, n = ee(t.children);
|
|
140
140
|
if (!n.trigger) return;
|
|
141
|
-
let r = n.trigger.props, i =
|
|
141
|
+
let r = n.trigger.props, i = B(n.content?.props.children);
|
|
142
142
|
d({
|
|
143
143
|
type: "subTrigger",
|
|
144
144
|
id: u("sub"),
|
|
@@ -170,7 +170,7 @@ function z(e) {
|
|
|
170
170
|
trigger: n
|
|
171
171
|
};
|
|
172
172
|
}
|
|
173
|
-
function
|
|
173
|
+
function V(e) {
|
|
174
174
|
let t, n, r, a, o = [];
|
|
175
175
|
return i.forEach(e, (e) => {
|
|
176
176
|
if (!l(e)) {
|
|
@@ -203,7 +203,7 @@ function B(e) {
|
|
|
203
203
|
shortcut: a
|
|
204
204
|
};
|
|
205
205
|
}
|
|
206
|
-
function
|
|
206
|
+
function ee(e) {
|
|
207
207
|
let t, n;
|
|
208
208
|
return i.forEach(e, (e) => {
|
|
209
209
|
if (!l(e)) return;
|
|
@@ -231,7 +231,7 @@ function H(e) {
|
|
|
231
231
|
}
|
|
232
232
|
//#endregion
|
|
233
233
|
//#region src/components/Dropdown/CheckboxItem/DropdownCheckboxItem.tsx
|
|
234
|
-
var
|
|
234
|
+
var U = z("checkboxItem", "Dropdown.CheckboxItem"), te = ({ active: e, enabled: t, content: n }) => {
|
|
235
235
|
f(() => {
|
|
236
236
|
if (!e || !t || !n) return;
|
|
237
237
|
let r = [], i = n.parentElement;
|
|
@@ -254,7 +254,7 @@ var ee = R("checkboxItem", "Dropdown.CheckboxItem"), U = ({ active: e, enabled:
|
|
|
254
254
|
n,
|
|
255
255
|
t
|
|
256
256
|
]);
|
|
257
|
-
},
|
|
257
|
+
}, ne = () => {
|
|
258
258
|
let e = !1;
|
|
259
259
|
return {
|
|
260
260
|
preventDefault: () => {
|
|
@@ -264,7 +264,7 @@ var ee = R("checkboxItem", "Dropdown.CheckboxItem"), U = ({ active: e, enabled:
|
|
|
264
264
|
return e;
|
|
265
265
|
}
|
|
266
266
|
};
|
|
267
|
-
},
|
|
267
|
+
}, re = (e) => {
|
|
268
268
|
let t = !1;
|
|
269
269
|
return {
|
|
270
270
|
originalEvent: e,
|
|
@@ -275,23 +275,23 @@ var ee = R("checkboxItem", "Dropdown.CheckboxItem"), U = ({ active: e, enabled:
|
|
|
275
275
|
return t;
|
|
276
276
|
}
|
|
277
277
|
};
|
|
278
|
-
},
|
|
278
|
+
}, W = [
|
|
279
279
|
"a[href]",
|
|
280
280
|
"button:not([disabled])",
|
|
281
281
|
"textarea:not([disabled])",
|
|
282
282
|
"input:not([disabled])",
|
|
283
283
|
"select:not([disabled])",
|
|
284
284
|
"[tabindex]:not([tabindex=\"-1\"])"
|
|
285
|
-
].join(","),
|
|
286
|
-
(
|
|
287
|
-
},
|
|
285
|
+
].join(","), ie = (e) => Array.from(e.querySelectorAll(W)).filter((e) => !e.hasAttribute("disabled")), ae = (e) => {
|
|
286
|
+
(ie(e)[0] ?? e).focus();
|
|
287
|
+
}, G = ({ active: e, contentRef: t, enabled: n, initialFocus: r, finalFocus: i, restoreFocus: a, onOpenAutoFocus: o, onCloseAutoFocus: s }) => {
|
|
288
288
|
f(() => {
|
|
289
289
|
if (!e) return;
|
|
290
|
-
let n = document.activeElement, c = i?.current, l =
|
|
290
|
+
let n = document.activeElement, c = i?.current, l = ne();
|
|
291
291
|
return o?.(l), l.defaultPrevented || queueMicrotask(() => {
|
|
292
|
-
r?.current?.focus(), !r?.current && t.current &&
|
|
292
|
+
r?.current?.focus(), !r?.current && t.current && ae(t.current);
|
|
293
293
|
}), () => {
|
|
294
|
-
let e =
|
|
294
|
+
let e = ne();
|
|
295
295
|
s?.(e), !(e.defaultPrevented || !a) && queueMicrotask(() => {
|
|
296
296
|
if (c) {
|
|
297
297
|
c.focus();
|
|
@@ -312,7 +312,7 @@ var ee = R("checkboxItem", "Dropdown.CheckboxItem"), U = ({ active: e, enabled:
|
|
|
312
312
|
if (!e || !n) return;
|
|
313
313
|
let r = (e) => {
|
|
314
314
|
if (e.key !== "Tab" || !t.current) return;
|
|
315
|
-
let n =
|
|
315
|
+
let n = ie(t.current);
|
|
316
316
|
if (n.length === 0) {
|
|
317
317
|
e.preventDefault(), t.current.focus();
|
|
318
318
|
return;
|
|
@@ -352,7 +352,7 @@ var ee = R("checkboxItem", "Dropdown.CheckboxItem"), U = ({ active: e, enabled:
|
|
|
352
352
|
if (!e) return;
|
|
353
353
|
let n = (e) => {
|
|
354
354
|
if (!a() || e.target instanceof Node && [t, ...u.current].some((t) => t.current?.contains(e.target))) return;
|
|
355
|
-
let n =
|
|
355
|
+
let n = re(e);
|
|
356
356
|
s?.(n), c?.(n), !(n.defaultPrevented || !i) && l("outside-press", e);
|
|
357
357
|
};
|
|
358
358
|
return document.addEventListener("pointerdown", n), () => {
|
|
@@ -367,44 +367,44 @@ var ee = R("checkboxItem", "Dropdown.CheckboxItem"), U = ({ active: e, enabled:
|
|
|
367
367
|
s,
|
|
368
368
|
l
|
|
369
369
|
]);
|
|
370
|
-
},
|
|
370
|
+
}, se = [], ce = {
|
|
371
371
|
add(e) {
|
|
372
|
-
|
|
372
|
+
se = se.filter((t) => t !== e), se.push(e);
|
|
373
373
|
},
|
|
374
374
|
remove(e) {
|
|
375
|
-
|
|
375
|
+
se = se.filter((t) => t !== e);
|
|
376
376
|
},
|
|
377
377
|
isTop(e) {
|
|
378
|
-
return
|
|
378
|
+
return se[se.length - 1] === e;
|
|
379
379
|
}
|
|
380
|
-
},
|
|
381
|
-
if (e) return
|
|
382
|
-
|
|
380
|
+
}, le = ({ active: e, id: t }) => (f(() => {
|
|
381
|
+
if (e) return ce.add(t), () => {
|
|
382
|
+
ce.remove(t);
|
|
383
383
|
};
|
|
384
|
-
}, [e, t]), { isTopOverlay: u(() =>
|
|
384
|
+
}, [e, t]), { isTopOverlay: u(() => ce.isTop(t), [t]) }), K = 0, ue = "", de = {
|
|
385
385
|
lock() {
|
|
386
|
-
typeof document > "u" || (K === 0 && (
|
|
386
|
+
typeof document > "u" || (K === 0 && (ue = document.body.style.overflow, document.body.style.overflow = "hidden"), K += 1);
|
|
387
387
|
},
|
|
388
388
|
unlock() {
|
|
389
|
-
typeof document > "u" || (K = Math.max(0, K - 1), K === 0 && (document.body.style.overflow =
|
|
389
|
+
typeof document > "u" || (K = Math.max(0, K - 1), K === 0 && (document.body.style.overflow = ue));
|
|
390
390
|
}
|
|
391
|
-
},
|
|
391
|
+
}, fe = ({ active: e, enabled: t = !0 }) => {
|
|
392
392
|
f(() => {
|
|
393
|
-
if (!(!e || !t)) return
|
|
394
|
-
|
|
393
|
+
if (!(!e || !t)) return de.lock(), () => {
|
|
394
|
+
de.unlock();
|
|
395
395
|
};
|
|
396
396
|
}, [e, t]);
|
|
397
|
-
},
|
|
397
|
+
}, pe = () => typeof document > "u" ? null : document.body, me = ({ container: e } = {}) => {
|
|
398
398
|
let [t, n] = _(!1);
|
|
399
399
|
return f(() => {
|
|
400
400
|
n(!0);
|
|
401
|
-
}, []), t ? e ?? document.getElementById("overlay-root") ??
|
|
402
|
-
},
|
|
401
|
+
}, []), t ? e ?? document.getElementById("overlay-root") ?? pe() : null;
|
|
402
|
+
}, he = ({ value: e, defaultValue: t, onChange: n }) => {
|
|
403
403
|
let [r, i] = _(t), a = e !== void 0;
|
|
404
404
|
return [a ? e : r, u((e) => {
|
|
405
405
|
a || i(e), n?.(e);
|
|
406
406
|
}, [a, n])];
|
|
407
|
-
},
|
|
407
|
+
}, ge = ({ activeIndex: e, setActiveIndex: t, items: n, isOpen: r, onOpen: i, onSelect: a, onClose: o, getItemText: s, loop: c = !0 }) => {
|
|
408
408
|
let l = g({
|
|
409
409
|
value: "",
|
|
410
410
|
timeoutId: void 0
|
|
@@ -487,7 +487,7 @@ var ee = R("checkboxItem", "Dropdown.CheckboxItem"), U = ({ active: e, enabled:
|
|
|
487
487
|
m,
|
|
488
488
|
h
|
|
489
489
|
]) };
|
|
490
|
-
},
|
|
490
|
+
}, _e = ({ items: e, open: t, defaultOpen: n = !1, disabled: r = !1, onOpenChange: i, onSelect: a, getItemValue: o, getItemText: s, loop: c = !0 }) => {
|
|
491
491
|
let [l, d] = _(n), [p, m] = _(-1), h = t !== void 0, g = t ?? l, v = u(() => e.findIndex((e) => !e.disabled), [e]), y = u(() => {
|
|
492
492
|
for (let t = e.length - 1; t >= 0; t--) if (!e[t]?.disabled) return t;
|
|
493
493
|
return -1;
|
|
@@ -542,7 +542,7 @@ var ee = R("checkboxItem", "Dropdown.CheckboxItem"), U = ({ active: e, enabled:
|
|
|
542
542
|
p,
|
|
543
543
|
e,
|
|
544
544
|
T
|
|
545
|
-
]), { onKeyDown: D } =
|
|
545
|
+
]), { onKeyDown: D } = ge({
|
|
546
546
|
activeIndex: p,
|
|
547
547
|
setActiveIndex: m,
|
|
548
548
|
items: e,
|
|
@@ -571,8 +571,8 @@ var ee = R("checkboxItem", "Dropdown.CheckboxItem"), U = ({ active: e, enabled:
|
|
|
571
571
|
getFirstEnabledIndex: v,
|
|
572
572
|
getLastEnabledIndex: y
|
|
573
573
|
};
|
|
574
|
-
},
|
|
575
|
-
let a = p(), o = p(), s = p(), [c, l] =
|
|
574
|
+
}, ve = ({ open: e, defaultOpen: t = !1, onOpenChange: n, closeOnEscape: r, closeOnOutsidePress: i }) => {
|
|
575
|
+
let a = p(), o = p(), s = p(), [c, l] = he({
|
|
576
576
|
value: e,
|
|
577
577
|
defaultValue: t,
|
|
578
578
|
onChange: n
|
|
@@ -590,12 +590,12 @@ var ee = R("checkboxItem", "Dropdown.CheckboxItem"), U = ({ active: e, enabled:
|
|
|
590
590
|
titleId: o,
|
|
591
591
|
descriptionId: s
|
|
592
592
|
};
|
|
593
|
-
},
|
|
594
|
-
let [m, g] =
|
|
593
|
+
}, ye = ({ 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 }) => {
|
|
594
|
+
let [m, g] = he({
|
|
595
595
|
value: e,
|
|
596
596
|
defaultValue: t ?? (a ? [] : ""),
|
|
597
597
|
onChange: n ?? r
|
|
598
|
-
}), [v, y] =
|
|
598
|
+
}), [v, y] = he({
|
|
599
599
|
value: l,
|
|
600
600
|
defaultValue: d,
|
|
601
601
|
onChange: p
|
|
@@ -664,7 +664,7 @@ var ee = R("checkboxItem", "Dropdown.CheckboxItem"), U = ({ active: e, enabled:
|
|
|
664
664
|
b,
|
|
665
665
|
i,
|
|
666
666
|
k
|
|
667
|
-
]), { onKeyDown: j } =
|
|
667
|
+
]), { onKeyDown: j } = ge({
|
|
668
668
|
activeIndex: b,
|
|
669
669
|
setActiveIndex: x,
|
|
670
670
|
items: i,
|
|
@@ -694,8 +694,8 @@ var ee = R("checkboxItem", "Dropdown.CheckboxItem"), U = ({ active: e, enabled:
|
|
|
694
694
|
selectActiveOption: A,
|
|
695
695
|
onKeyDown: j
|
|
696
696
|
};
|
|
697
|
-
},
|
|
698
|
-
let [r, i] =
|
|
697
|
+
}, be = ({ value: e, defaultValue: t = "", onValueChange: n }) => {
|
|
698
|
+
let [r, i] = he({
|
|
699
699
|
value: e,
|
|
700
700
|
defaultValue: t,
|
|
701
701
|
onChange: n
|
|
@@ -704,15 +704,15 @@ var ee = R("checkboxItem", "Dropdown.CheckboxItem"), U = ({ active: e, enabled:
|
|
|
704
704
|
value: r,
|
|
705
705
|
setValue: i
|
|
706
706
|
};
|
|
707
|
-
},
|
|
707
|
+
}, xe = s(null), Se = ({ children: e, container: t = null }) => /* @__PURE__ */ n(xe.Provider, {
|
|
708
708
|
value: t,
|
|
709
709
|
children: e
|
|
710
|
-
}),
|
|
711
|
-
let n = d(
|
|
710
|
+
}), Ce = ({ children: e, container: t }) => {
|
|
711
|
+
let n = d(xe), r = me({ container: t ?? n });
|
|
712
712
|
return r ? v(e, r) : null;
|
|
713
713
|
};
|
|
714
|
-
|
|
715
|
-
var
|
|
714
|
+
Ce.__velliraPortal = !0, Ce.displayName = "Portal", Se.displayName = "PortalProvider";
|
|
715
|
+
var we = {
|
|
716
716
|
dropdown: "_dropdown_m7rnq_1",
|
|
717
717
|
"dropdown-in": "_dropdown-in_m7rnq_1",
|
|
718
718
|
primary: "_primary_m7rnq_42",
|
|
@@ -724,27 +724,27 @@ var Ce = {
|
|
|
724
724
|
searchWrap: "_searchWrap_m7rnq_165",
|
|
725
725
|
search: "_search_m7rnq_165",
|
|
726
726
|
"dropdown-sheet-in": "_dropdown-sheet-in_m7rnq_1"
|
|
727
|
-
},
|
|
727
|
+
}, Te = z("empty", "Dropdown.Empty"), Ee = ({ children: e }) => /* @__PURE__ */ n("li", {
|
|
728
728
|
role: "presentation",
|
|
729
|
-
className:
|
|
729
|
+
className: we.empty,
|
|
730
730
|
children: e ?? "No actions available"
|
|
731
731
|
});
|
|
732
|
-
|
|
732
|
+
Ee.displayName = "DropdownEmptySurface";
|
|
733
733
|
//#endregion
|
|
734
734
|
//#region src/components/Dropdown/Group/DropdownGroup.tsx
|
|
735
|
-
var
|
|
736
|
-
|
|
735
|
+
var De = z("group", "Dropdown.Group"), Oe = () => null;
|
|
736
|
+
Oe.displayName = "DropdownGroupSurface";
|
|
737
737
|
//#endregion
|
|
738
738
|
//#region src/components/Dropdown/internal/DropdownContext.tsx
|
|
739
|
-
var
|
|
740
|
-
|
|
741
|
-
function
|
|
742
|
-
let e = d(
|
|
739
|
+
var ke = s(null), Ae = s(null), je = s(null), Me = ke.Provider, Ne = Ae.Provider;
|
|
740
|
+
je.Provider;
|
|
741
|
+
function Pe() {
|
|
742
|
+
let e = d(ke);
|
|
743
743
|
if (!e) throw Error("Dropdown compound components must be used inside Dropdown.");
|
|
744
744
|
return e;
|
|
745
745
|
}
|
|
746
|
-
function
|
|
747
|
-
let e = d(
|
|
746
|
+
function Fe() {
|
|
747
|
+
let e = d(Ae);
|
|
748
748
|
if (!e) throw Error("Dropdown.Trigger must be used inside Dropdown.");
|
|
749
749
|
return e;
|
|
750
750
|
}
|
|
@@ -773,8 +773,8 @@ var q = {
|
|
|
773
773
|
"dropdown-sub-in": "_dropdown-sub-in_xmygj_1",
|
|
774
774
|
subLabel: "_subLabel_xmygj_300",
|
|
775
775
|
subSeparator: "_subSeparator_xmygj_308"
|
|
776
|
-
},
|
|
777
|
-
let a =
|
|
776
|
+
}, Ie = z("item", "Dropdown.Item"), Le = ({ item: e, itemIndex: i }) => {
|
|
777
|
+
let a = Pe(), 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 = V(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, P = O ? "a" : "li", F = d || f, L = (t) => {
|
|
778
778
|
if (h) {
|
|
779
779
|
t.preventDefault();
|
|
780
780
|
return;
|
|
@@ -783,7 +783,7 @@ var q = {
|
|
|
783
783
|
let t = !m;
|
|
784
784
|
c(t), e.props.onCheckedChange?.(t);
|
|
785
785
|
}
|
|
786
|
-
a.selectItem(e,
|
|
786
|
+
a.selectItem(e, Re(t));
|
|
787
787
|
};
|
|
788
788
|
return /* @__PURE__ */ r(t, { children: [/* @__PURE__ */ r(P, {
|
|
789
789
|
id: j,
|
|
@@ -799,7 +799,7 @@ var q = {
|
|
|
799
799
|
"aria-expanded": p ? u : void 0,
|
|
800
800
|
"data-active": l || void 0,
|
|
801
801
|
"data-state": u ? "open" : void 0,
|
|
802
|
-
className:
|
|
802
|
+
className: I(q.item, q[a.size], {
|
|
803
803
|
[q.active]: l,
|
|
804
804
|
[q.disabled]: h,
|
|
805
805
|
[q.checked]: m
|
|
@@ -834,7 +834,7 @@ var q = {
|
|
|
834
834
|
className: q.itemShortcut,
|
|
835
835
|
children: T
|
|
836
836
|
}),
|
|
837
|
-
|
|
837
|
+
F && /* @__PURE__ */ n("span", {
|
|
838
838
|
className: q.indicator,
|
|
839
839
|
"aria-hidden": "true",
|
|
840
840
|
children: m ? /* @__PURE__ */ n(y, {}) : null
|
|
@@ -857,14 +857,14 @@ var q = {
|
|
|
857
857
|
role: "separator",
|
|
858
858
|
className: q.subSeparator,
|
|
859
859
|
"aria-hidden": "true"
|
|
860
|
-
}, e.id) : e.type === "item" ? /* @__PURE__ */ n(
|
|
860
|
+
}, e.id) : e.type === "item" ? /* @__PURE__ */ n(ze, {
|
|
861
861
|
item: e.item,
|
|
862
862
|
id: `${j}-${e.itemIndex}`
|
|
863
863
|
}, e.item.id) : null)
|
|
864
864
|
})] });
|
|
865
865
|
};
|
|
866
|
-
|
|
867
|
-
function
|
|
866
|
+
Le.displayName = "DropdownItemRow";
|
|
867
|
+
function Re(e) {
|
|
868
868
|
let t = !1;
|
|
869
869
|
return {
|
|
870
870
|
originalEvent: e,
|
|
@@ -876,8 +876,8 @@ function Le(e) {
|
|
|
876
876
|
}
|
|
877
877
|
};
|
|
878
878
|
}
|
|
879
|
-
function
|
|
880
|
-
let i =
|
|
879
|
+
function ze({ id: e, item: t }) {
|
|
880
|
+
let i = Pe(), [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 = V(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) => {
|
|
881
881
|
if (b) {
|
|
882
882
|
e.preventDefault();
|
|
883
883
|
return;
|
|
@@ -886,7 +886,7 @@ function Re({ id: e, item: t }) {
|
|
|
886
886
|
let e = !l;
|
|
887
887
|
o(e), t.props.onCheckedChange?.(e);
|
|
888
888
|
}
|
|
889
|
-
i.selectItem(t,
|
|
889
|
+
i.selectItem(t, Re(e));
|
|
890
890
|
};
|
|
891
891
|
return /* @__PURE__ */ r(E, {
|
|
892
892
|
id: e,
|
|
@@ -898,7 +898,7 @@ function Re({ id: e, item: t }) {
|
|
|
898
898
|
tabIndex: b ? -1 : 0,
|
|
899
899
|
"aria-disabled": b || void 0,
|
|
900
900
|
"aria-checked": s || c ? l : void 0,
|
|
901
|
-
className:
|
|
901
|
+
className: I(q.item, q[i.size], {
|
|
902
902
|
[q.disabled]: b,
|
|
903
903
|
[q.checked]: l
|
|
904
904
|
}, v && v !== "default" ? q[v] : void 0),
|
|
@@ -934,38 +934,38 @@ function Re({ id: e, item: t }) {
|
|
|
934
934
|
]
|
|
935
935
|
});
|
|
936
936
|
}
|
|
937
|
-
var
|
|
937
|
+
var Be = { group: "_group_aviwv_1" }, Ve = z("label", "Dropdown.Label"), He = ({ children: e, className: t }) => /* @__PURE__ */ n("li", {
|
|
938
938
|
role: "presentation",
|
|
939
|
-
className:
|
|
939
|
+
className: I(Be.group, t),
|
|
940
940
|
children: e
|
|
941
941
|
});
|
|
942
|
-
|
|
942
|
+
He.displayName = "DropdownLabelSurface";
|
|
943
943
|
//#endregion
|
|
944
944
|
//#region src/components/Dropdown/Loading/DropdownLoading.tsx
|
|
945
|
-
var
|
|
945
|
+
var Ue = z("loading", "Dropdown.Loading"), We = ({ children: e }) => /* @__PURE__ */ n("li", {
|
|
946
946
|
role: "presentation",
|
|
947
947
|
"aria-live": "polite",
|
|
948
|
-
className:
|
|
948
|
+
className: we.empty,
|
|
949
949
|
children: e ?? "Loading actions..."
|
|
950
950
|
});
|
|
951
|
-
|
|
952
|
-
var
|
|
951
|
+
We.displayName = "DropdownLoadingSurface";
|
|
952
|
+
var Ge = { separator: "_separator_1v11r_1" }, Ke = z("separator", "Dropdown.Separator"), qe = ({ className: e }) => /* @__PURE__ */ n("li", {
|
|
953
953
|
role: "separator",
|
|
954
|
-
className:
|
|
954
|
+
className: I(Ge.separator, e),
|
|
955
955
|
"aria-hidden": "true"
|
|
956
956
|
});
|
|
957
|
-
|
|
957
|
+
qe.displayName = "DropdownSeparatorSurface";
|
|
958
958
|
//#endregion
|
|
959
959
|
//#region src/components/Dropdown/Content/DropdownContent.tsx
|
|
960
|
-
var
|
|
961
|
-
let t =
|
|
960
|
+
var Je = ({ className: e }) => {
|
|
961
|
+
let t = Pe(), { contentReadyToFocus: i, isOpen: o, setContentRef: s } = t, c = g(null), l = u((e) => {
|
|
962
962
|
c.current = e, s(e);
|
|
963
963
|
}, [s]);
|
|
964
964
|
if (f(() => {
|
|
965
965
|
let e = c.current;
|
|
966
966
|
!o || !i || !e || e.contains(document.activeElement) || e.focus({ preventScroll: !0 });
|
|
967
967
|
}, [i, o]), !o) return null;
|
|
968
|
-
let d =
|
|
968
|
+
let d = I(we.dropdown, we[t.color], t.contentProps?.className, e), p = /* @__PURE__ */ r("ul", {
|
|
969
969
|
ref: l,
|
|
970
970
|
id: t.contentId,
|
|
971
971
|
role: "menu",
|
|
@@ -982,9 +982,9 @@ var qe = ({ className: e }) => {
|
|
|
982
982
|
"data-color": t.color,
|
|
983
983
|
children: [t.searchable && /* @__PURE__ */ r("li", {
|
|
984
984
|
role: "presentation",
|
|
985
|
-
className:
|
|
985
|
+
className: I(we.searchWrap, t.searchProps?.className),
|
|
986
986
|
children: [/* @__PURE__ */ n(C, { "aria-hidden": "true" }), /* @__PURE__ */ n("input", {
|
|
987
|
-
className:
|
|
987
|
+
className: we.search,
|
|
988
988
|
value: t.searchValue,
|
|
989
989
|
placeholder: t.searchPlaceholder,
|
|
990
990
|
"aria-label": t.searchProps?.["aria-label"] ?? t.searchPlaceholder,
|
|
@@ -994,17 +994,17 @@ var qe = ({ className: e }) => {
|
|
|
994
994
|
e.key === "ArrowDown" || e.key === "ArrowUp" || e.key === "Enter" || e.key === "Escape" || e.stopPropagation();
|
|
995
995
|
}
|
|
996
996
|
})]
|
|
997
|
-
}), t.loading ? /* @__PURE__ */ n(
|
|
997
|
+
}), t.loading ? /* @__PURE__ */ n(We, { children: t.loadingText }) : t.searchable && t.items.length === 0 ? /* @__PURE__ */ n(Ee, { children: t.empty }) : t.entries.length ? t.entries.map((e) => e.type === "groupStart" ? /* @__PURE__ */ n(Oe, {}, e.id) : e.type === "groupEnd" ? null : e.type === "label" ? /* @__PURE__ */ n(He, { ...e.props }, e.id) : e.type === "separator" ? /* @__PURE__ */ n(qe, { ...e.props }, e.id) : e.type === "empty" ? /* @__PURE__ */ n(Ee, { children: e.props.children }, e.id) : e.type === "loading" ? /* @__PURE__ */ n(We, { children: e.props.children }, e.id) : e.type === "arrow" ? /* @__PURE__ */ n(R, { ...e.props }, e.id) : /* @__PURE__ */ n(a, { children: /* @__PURE__ */ n(Le, {
|
|
998
998
|
item: e.item,
|
|
999
999
|
itemIndex: e.itemIndex
|
|
1000
|
-
}) }, e.item.id)) : /* @__PURE__ */ n(
|
|
1000
|
+
}) }, e.item.id)) : /* @__PURE__ */ n(Ee, {})]
|
|
1001
1001
|
});
|
|
1002
|
-
return t.portal ? /* @__PURE__ */ n(
|
|
1002
|
+
return t.portal ? /* @__PURE__ */ n(Ce, { children: p }) : p;
|
|
1003
1003
|
};
|
|
1004
|
-
|
|
1004
|
+
Je.__velliraDropdownPart = "content", Je.displayName = "Dropdown.Content";
|
|
1005
1005
|
//#endregion
|
|
1006
1006
|
//#region src/components/Dropdown/ItemBadge/DropdownItemBadge.tsx
|
|
1007
|
-
var
|
|
1007
|
+
var Ye = z("itemBadge", "Dropdown.ItemBadge"), Xe = z("itemDescription", "Dropdown.ItemDescription"), Ze = z("itemIcon", "Dropdown.ItemIcon"), Qe = z("itemShortcut", "Dropdown.ItemShortcut"), $e = z("radioGroup", "Dropdown.RadioGroup"), et = z("radioItem", "Dropdown.RadioItem"), tt = (e) => {
|
|
1008
1008
|
let [t, n] = _(() => typeof window > "u" || typeof window.matchMedia != "function" || !e ? !1 : window.matchMedia(`(max-width: ${e}px)`).matches);
|
|
1009
1009
|
return f(() => {
|
|
1010
1010
|
if (typeof window > "u" || typeof window.matchMedia != "function" || !e) return;
|
|
@@ -1013,20 +1013,20 @@ var Je = R("itemBadge", "Dropdown.ItemBadge"), Ye = R("itemDescription", "Dropdo
|
|
|
1013
1013
|
t.removeEventListener("change", r);
|
|
1014
1014
|
};
|
|
1015
1015
|
}, [e]), t;
|
|
1016
|
-
},
|
|
1017
|
-
let u =
|
|
1016
|
+
}, nt = ({ 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 = [] } = {}) => {
|
|
1017
|
+
let u = tt(c), { refs: d, floatingStyles: p, isPositioned: m, update: g, context: _, middlewareData: v, placement: y } = j({
|
|
1018
1018
|
open: e,
|
|
1019
1019
|
onOpenChange: t,
|
|
1020
1020
|
placement: n,
|
|
1021
1021
|
strategy: r,
|
|
1022
1022
|
transform: !1,
|
|
1023
1023
|
middleware: h(() => [
|
|
1024
|
-
|
|
1025
|
-
...s ? [
|
|
1026
|
-
|
|
1024
|
+
O(i),
|
|
1025
|
+
...s ? [D({ padding: a })] : [],
|
|
1026
|
+
A({ apply({ rects: e, elements: t }) {
|
|
1027
1027
|
!o || u || Object.assign(t.floating.style, { width: `${e.reference.width}px` });
|
|
1028
1028
|
} }),
|
|
1029
|
-
...s ? [
|
|
1029
|
+
...s ? [k({ padding: a })] : [],
|
|
1030
1030
|
...l
|
|
1031
1031
|
], [
|
|
1032
1032
|
s,
|
|
@@ -1036,7 +1036,7 @@ var Je = R("itemBadge", "Dropdown.ItemBadge"), Ye = R("itemDescription", "Dropdo
|
|
|
1036
1036
|
o,
|
|
1037
1037
|
i
|
|
1038
1038
|
]),
|
|
1039
|
-
whileElementsMounted:
|
|
1039
|
+
whileElementsMounted: E
|
|
1040
1040
|
});
|
|
1041
1041
|
return f(() => {
|
|
1042
1042
|
u && d.floating.current?.style.removeProperty("width");
|
|
@@ -1057,12 +1057,12 @@ var Je = R("itemBadge", "Dropdown.ItemBadge"), Ye = R("itemDescription", "Dropdo
|
|
|
1057
1057
|
};
|
|
1058
1058
|
//#endregion
|
|
1059
1059
|
//#region src/components/Dropdown/internal/composeEventHandlers.ts
|
|
1060
|
-
function
|
|
1060
|
+
function rt(e, t) {
|
|
1061
1061
|
return (n) => {
|
|
1062
1062
|
e?.(n), n.defaultPrevented || t(n);
|
|
1063
1063
|
};
|
|
1064
1064
|
}
|
|
1065
|
-
function
|
|
1065
|
+
function it(...e) {
|
|
1066
1066
|
return (t) => {
|
|
1067
1067
|
e.forEach((e) => {
|
|
1068
1068
|
if (e) {
|
|
@@ -1075,40 +1075,40 @@ function rt(...e) {
|
|
|
1075
1075
|
});
|
|
1076
1076
|
};
|
|
1077
1077
|
}
|
|
1078
|
-
function
|
|
1078
|
+
function at(e) {
|
|
1079
1079
|
return typeof e == "number" ? `${e}px` : e;
|
|
1080
1080
|
}
|
|
1081
|
-
var
|
|
1082
|
-
let R = p(),
|
|
1081
|
+
var ot = { wrapper: "_wrapper_14ue8_1" }, st = ({ 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: P, empty: F, className: L }) => {
|
|
1082
|
+
let R = p(), z = `${R}-trigger`, V = `${R}-menu`, ee = g(null), H = g(null), [U, te] = _(), [ne, re] = _({}), [W, ie] = _(M), ae = j ?? W, G = h(() => B(e), [e]), se = G.content?.props.command ?? !1, ce = k || A || se || !!G.search, K = h(() => lt(G.items), [G.items]), ue = h(() => G.items.map((e) => ({
|
|
1083
1083
|
disabled: e.disabled,
|
|
1084
1084
|
label: e.label
|
|
1085
|
-
})), [G.items]),
|
|
1086
|
-
|
|
1085
|
+
})), [G.items]), de = h(() => !ce || !ae.trim() ? G : ut(G, ae), [
|
|
1086
|
+
ce,
|
|
1087
1087
|
G,
|
|
1088
1088
|
ae
|
|
1089
|
-
]), pe = h(() =>
|
|
1089
|
+
]), pe = h(() => de.items.map((e) => ({
|
|
1090
1090
|
disabled: e.disabled,
|
|
1091
1091
|
label: e.label
|
|
1092
|
-
})), [
|
|
1092
|
+
})), [de.items]);
|
|
1093
1093
|
f(() => {
|
|
1094
1094
|
re((e) => {
|
|
1095
1095
|
let t = { ...e };
|
|
1096
|
-
return
|
|
1096
|
+
return K.forEach((e) => {
|
|
1097
1097
|
e.type === "radio" && t[e.groupId] === void 0 && (t[e.groupId] = e.groupProps?.value ?? e.groupProps?.defaultValue);
|
|
1098
1098
|
}), t;
|
|
1099
1099
|
});
|
|
1100
|
-
}, [
|
|
1101
|
-
let { activeIndex: me, setActiveIndex: he, isOpen:
|
|
1102
|
-
items:
|
|
1100
|
+
}, [K]);
|
|
1101
|
+
let { activeIndex: me, setActiveIndex: he, isOpen: ge, closeDropdown: ve, toggleDropdown: ye, onKeyDown: be } = _e({
|
|
1102
|
+
items: ce ? pe : ue,
|
|
1103
1103
|
open: t,
|
|
1104
1104
|
defaultOpen: i,
|
|
1105
1105
|
disabled: E,
|
|
1106
1106
|
onOpenChange: a,
|
|
1107
|
-
getItemValue: (e, t) => (
|
|
1107
|
+
getItemValue: (e, t) => (ce ? de.items : G.items)[t]?.id ?? "",
|
|
1108
1108
|
getItemText: (e) => e.label,
|
|
1109
1109
|
loop: T
|
|
1110
|
-
}), { floatingStyles: xe, isMobileSheet: Se, isPositioned: Ce, setRef: we, setFloatingRef: Te } =
|
|
1111
|
-
open:
|
|
1110
|
+
}), { floatingStyles: xe, isMobileSheet: Se, isPositioned: Ce, setRef: we, setFloatingRef: Te } = nt({
|
|
1111
|
+
open: ge,
|
|
1112
1112
|
placement: c,
|
|
1113
1113
|
strategy: l ?? (x ? "fixed" : "absolute"),
|
|
1114
1114
|
matchTriggerWidth: v,
|
|
@@ -1122,16 +1122,16 @@ var at = { wrapper: "_wrapper_14ue8_1" }, ot = ({ children: e, open: t, defaultO
|
|
|
1122
1122
|
P,
|
|
1123
1123
|
j,
|
|
1124
1124
|
he
|
|
1125
|
-
]), { isTopOverlay: De } =
|
|
1126
|
-
active:
|
|
1125
|
+
]), { isTopOverlay: De } = le({
|
|
1126
|
+
active: ge,
|
|
1127
1127
|
id: V
|
|
1128
1128
|
});
|
|
1129
|
-
|
|
1130
|
-
active:
|
|
1129
|
+
fe({
|
|
1130
|
+
active: ge,
|
|
1131
1131
|
enabled: C
|
|
1132
1132
|
});
|
|
1133
1133
|
let Oe = u(() => {
|
|
1134
|
-
ve(),
|
|
1134
|
+
ve(), ee.current?.focus();
|
|
1135
1135
|
}, [ve]), ke = u((e, t) => {
|
|
1136
1136
|
if (e.disabled || D) return;
|
|
1137
1137
|
if (e.type === "subTrigger") {
|
|
@@ -1149,7 +1149,7 @@ var at = { wrapper: "_wrapper_14ue8_1" }, ot = ({ children: e, open: t, defaultO
|
|
|
1149
1149
|
w,
|
|
1150
1150
|
D
|
|
1151
1151
|
]), Ae = u((e) => {
|
|
1152
|
-
let t =
|
|
1152
|
+
let t = de.items[me];
|
|
1153
1153
|
if (e.key === "ArrowRight" && t?.type === "subTrigger") {
|
|
1154
1154
|
e.preventDefault(), te(t.id);
|
|
1155
1155
|
return;
|
|
@@ -1160,49 +1160,49 @@ var at = { wrapper: "_wrapper_14ue8_1" }, ot = ({ children: e, open: t, defaultO
|
|
|
1160
1160
|
}
|
|
1161
1161
|
if ((e.key === "Enter" || e.key === " ") && t) {
|
|
1162
1162
|
e.preventDefault();
|
|
1163
|
-
let n =
|
|
1163
|
+
let n = ct(e);
|
|
1164
1164
|
ke(t, n);
|
|
1165
1165
|
return;
|
|
1166
1166
|
}
|
|
1167
|
-
be(e), e.key === "Escape" &&
|
|
1167
|
+
be(e), e.key === "Escape" && ee.current?.focus();
|
|
1168
1168
|
}, [
|
|
1169
1169
|
me,
|
|
1170
|
-
|
|
1170
|
+
de.items,
|
|
1171
1171
|
be,
|
|
1172
1172
|
U,
|
|
1173
1173
|
ke
|
|
1174
|
-
]),
|
|
1174
|
+
]), je = u((e) => {
|
|
1175
1175
|
e.preventDefault(), ye();
|
|
1176
1176
|
}, [ye]), Pe = u((e) => {
|
|
1177
|
-
|
|
1178
|
-
}, [we]),
|
|
1179
|
-
|
|
1177
|
+
ee.current = e, we(e);
|
|
1178
|
+
}, [we]), Fe = u((e) => {
|
|
1179
|
+
H.current = e, Te(e), Se && e?.focus({ preventScroll: !0 });
|
|
1180
1180
|
}, [Se, Te]);
|
|
1181
1181
|
oe({
|
|
1182
|
-
active:
|
|
1182
|
+
active: ge,
|
|
1183
1183
|
closeOnEscape: !0,
|
|
1184
1184
|
closeOnOutsidePress: !0,
|
|
1185
|
-
contentRef:
|
|
1186
|
-
ignoreRefs: [
|
|
1185
|
+
contentRef: H,
|
|
1186
|
+
ignoreRefs: [ee],
|
|
1187
1187
|
isTopOverlay: De,
|
|
1188
1188
|
requestClose: () => ve()
|
|
1189
1189
|
});
|
|
1190
|
-
let
|
|
1190
|
+
let q = {
|
|
1191
1191
|
...xe,
|
|
1192
|
-
minWidth:
|
|
1193
|
-
maxWidth:
|
|
1192
|
+
minWidth: at(y),
|
|
1193
|
+
maxWidth: at(b)
|
|
1194
1194
|
};
|
|
1195
|
-
return /* @__PURE__ */ n(
|
|
1195
|
+
return /* @__PURE__ */ n(Ne, {
|
|
1196
1196
|
value: {
|
|
1197
1197
|
disabled: E,
|
|
1198
|
-
isOpen:
|
|
1198
|
+
isOpen: ge,
|
|
1199
1199
|
contentId: V,
|
|
1200
|
-
triggerId:
|
|
1200
|
+
triggerId: z,
|
|
1201
1201
|
setTriggerRef: Pe,
|
|
1202
|
-
onClick:
|
|
1202
|
+
onClick: je,
|
|
1203
1203
|
onKeyDown: Ae
|
|
1204
1204
|
},
|
|
1205
|
-
children: /* @__PURE__ */ n(
|
|
1205
|
+
children: /* @__PURE__ */ n(Me, {
|
|
1206
1206
|
value: {
|
|
1207
1207
|
activeIndex: me,
|
|
1208
1208
|
closeOnSelect: w,
|
|
@@ -1211,13 +1211,13 @@ var at = { wrapper: "_wrapper_14ue8_1" }, ot = ({ children: e, open: t, defaultO
|
|
|
1211
1211
|
contentId: V,
|
|
1212
1212
|
contentProps: G.content?.props,
|
|
1213
1213
|
disabled: E,
|
|
1214
|
-
entries:
|
|
1214
|
+
entries: de.entries,
|
|
1215
1215
|
getItemId: (e) => `${V}-item-${e}`,
|
|
1216
|
-
isOpen:
|
|
1217
|
-
items:
|
|
1216
|
+
isOpen: ge,
|
|
1217
|
+
items: de.items,
|
|
1218
1218
|
loading: D,
|
|
1219
1219
|
loadingText: O,
|
|
1220
|
-
empty:
|
|
1220
|
+
empty: F,
|
|
1221
1221
|
maxWidth: b,
|
|
1222
1222
|
minWidth: y,
|
|
1223
1223
|
openSubId: U,
|
|
@@ -1227,10 +1227,10 @@ var at = { wrapper: "_wrapper_14ue8_1" }, ot = ({ children: e, open: t, defaultO
|
|
|
1227
1227
|
searchPlaceholder: G.search?.props.placeholder ?? N ?? (A || se ? "Type a command..." : "Search actions..."),
|
|
1228
1228
|
searchProps: G.search?.props,
|
|
1229
1229
|
searchValue: ae,
|
|
1230
|
-
searchable:
|
|
1230
|
+
searchable: ce,
|
|
1231
1231
|
selectItem: ke,
|
|
1232
1232
|
setActiveIndex: he,
|
|
1233
|
-
setContentRef:
|
|
1233
|
+
setContentRef: Fe,
|
|
1234
1234
|
setOpenSubId: te,
|
|
1235
1235
|
setRadioValue: (e, t) => {
|
|
1236
1236
|
re((n) => ({
|
|
@@ -1240,19 +1240,19 @@ var at = { wrapper: "_wrapper_14ue8_1" }, ot = ({ children: e, open: t, defaultO
|
|
|
1240
1240
|
},
|
|
1241
1241
|
setSearchValue: Ee,
|
|
1242
1242
|
size: o,
|
|
1243
|
-
surfaceStyle:
|
|
1244
|
-
triggerId:
|
|
1243
|
+
surfaceStyle: q,
|
|
1244
|
+
triggerId: z
|
|
1245
1245
|
},
|
|
1246
1246
|
children: /* @__PURE__ */ r("div", {
|
|
1247
|
-
className:
|
|
1247
|
+
className: I(ot.wrapper, L),
|
|
1248
1248
|
"data-disabled": E || void 0,
|
|
1249
|
-
children: [G.trigger ?? null, G.portal ?? G.content ?? /* @__PURE__ */ n(
|
|
1249
|
+
children: [G.trigger ?? null, G.portal ?? G.content ?? /* @__PURE__ */ n(Je, {})]
|
|
1250
1250
|
})
|
|
1251
1251
|
})
|
|
1252
1252
|
});
|
|
1253
1253
|
};
|
|
1254
|
-
|
|
1255
|
-
function
|
|
1254
|
+
st.displayName = "DropdownRoot";
|
|
1255
|
+
function ct(e) {
|
|
1256
1256
|
let t = !1;
|
|
1257
1257
|
return {
|
|
1258
1258
|
originalEvent: e,
|
|
@@ -1264,13 +1264,13 @@ function st(e) {
|
|
|
1264
1264
|
}
|
|
1265
1265
|
};
|
|
1266
1266
|
}
|
|
1267
|
-
function
|
|
1267
|
+
function lt(e) {
|
|
1268
1268
|
let t = [];
|
|
1269
1269
|
return e.forEach((e) => {
|
|
1270
|
-
t.push(e), e.type === "subTrigger" && t.push(...
|
|
1270
|
+
t.push(e), e.type === "subTrigger" && t.push(...lt(e.subItems));
|
|
1271
1271
|
}), t;
|
|
1272
1272
|
}
|
|
1273
|
-
function
|
|
1273
|
+
function ut(e, t) {
|
|
1274
1274
|
let n = t.trim().toLocaleLowerCase(), r = new Set(e.items.filter((e) => e.label.toLocaleLowerCase().includes(n)).map((e) => e.id)), i = e.items.filter((e) => r.has(e.id));
|
|
1275
1275
|
return {
|
|
1276
1276
|
...e,
|
|
@@ -1280,7 +1280,7 @@ function lt(e, t) {
|
|
|
1280
1280
|
}
|
|
1281
1281
|
//#endregion
|
|
1282
1282
|
//#region src/components/Dropdown/Search/DropdownSearch.tsx
|
|
1283
|
-
var
|
|
1283
|
+
var dt = z("search", "Dropdown.Search"), ft = z("subContent", "Dropdown.SubContent"), pt = z("subTrigger", "Dropdown.SubTrigger"), mt = z("sub", "Dropdown.Sub"), ht = {
|
|
1284
1284
|
button: "_button_bb3ib_1",
|
|
1285
1285
|
disabled: "_disabled_bb3ib_63",
|
|
1286
1286
|
arrow: "_arrow_bb3ib_71",
|
|
@@ -1296,91 +1296,91 @@ var ut = R("search", "Dropdown.Search"), dt = R("subContent", "Dropdown.SubConte
|
|
|
1296
1296
|
lg: "_lg_bb3ib_350",
|
|
1297
1297
|
label: "_label_bb3ib_362",
|
|
1298
1298
|
open: "_open_bb3ib_390"
|
|
1299
|
-
},
|
|
1300
|
-
|
|
1301
|
-
var
|
|
1302
|
-
let s =
|
|
1299
|
+
}, gt = (e) => /* @__PURE__ */ n(_t, { ...e });
|
|
1300
|
+
gt.__velliraDropdownPart = "trigger", gt.displayName = "Dropdown.Trigger";
|
|
1301
|
+
var _t = ({ children: e, asChild: t = !1, disabled: i, className: a }) => {
|
|
1302
|
+
let s = Pe(), c = Fe(), u = t && l(e) ? e : void 0, d = s.disabled || i, f = {
|
|
1303
1303
|
id: c.triggerId,
|
|
1304
|
-
ref: u ?
|
|
1304
|
+
ref: u ? it(u.props.ref, c.setTriggerRef) : c.setTriggerRef,
|
|
1305
1305
|
"aria-controls": c.isOpen ? c.contentId : void 0,
|
|
1306
1306
|
"aria-disabled": d || void 0,
|
|
1307
1307
|
"aria-expanded": c.isOpen,
|
|
1308
1308
|
"aria-haspopup": "menu",
|
|
1309
|
-
className:
|
|
1309
|
+
className: I(!u && ht.button, !u && ht[s.size], !u && ht[s.color], a),
|
|
1310
1310
|
"data-state": c.isOpen ? "open" : "closed",
|
|
1311
1311
|
disabled: d || void 0,
|
|
1312
|
-
onClick:
|
|
1313
|
-
onKeyDown:
|
|
1312
|
+
onClick: rt(u?.props.onClick, c.onClick),
|
|
1313
|
+
onKeyDown: rt(u?.props.onKeyDown, c.onKeyDown)
|
|
1314
1314
|
};
|
|
1315
1315
|
return u ? o(u, {
|
|
1316
1316
|
...f,
|
|
1317
|
-
className:
|
|
1317
|
+
className: I(u.props.className, a)
|
|
1318
1318
|
}) : /* @__PURE__ */ r("button", {
|
|
1319
1319
|
type: "button",
|
|
1320
1320
|
...f,
|
|
1321
1321
|
children: [/* @__PURE__ */ n("span", {
|
|
1322
|
-
className:
|
|
1322
|
+
className: ht.label,
|
|
1323
1323
|
children: e
|
|
1324
1324
|
}), /* @__PURE__ */ n("span", {
|
|
1325
|
-
className:
|
|
1325
|
+
className: I(ht.arrow, { [ht.open]: c.isOpen }),
|
|
1326
1326
|
"aria-hidden": "true",
|
|
1327
1327
|
children: /* @__PURE__ */ n(b, {})
|
|
1328
1328
|
})]
|
|
1329
1329
|
});
|
|
1330
1330
|
};
|
|
1331
|
-
|
|
1331
|
+
_t.displayName = "DropdownTriggerSurface";
|
|
1332
1332
|
//#endregion
|
|
1333
1333
|
//#region src/components/Dropdown/Dropdown.tsx
|
|
1334
|
-
var
|
|
1335
|
-
Trigger:
|
|
1336
|
-
Content:
|
|
1337
|
-
Search:
|
|
1338
|
-
Item:
|
|
1339
|
-
CheckboxItem:
|
|
1340
|
-
RadioGroup:
|
|
1341
|
-
RadioItem:
|
|
1342
|
-
Group:
|
|
1343
|
-
Label:
|
|
1344
|
-
Separator:
|
|
1345
|
-
Sub:
|
|
1346
|
-
SubTrigger:
|
|
1347
|
-
SubContent:
|
|
1348
|
-
ItemIcon:
|
|
1349
|
-
ItemDescription:
|
|
1350
|
-
ItemBadge:
|
|
1351
|
-
ItemShortcut:
|
|
1352
|
-
Arrow:
|
|
1353
|
-
Empty:
|
|
1354
|
-
Loading:
|
|
1334
|
+
var vt = Object.assign(st, {
|
|
1335
|
+
Trigger: gt,
|
|
1336
|
+
Content: Je,
|
|
1337
|
+
Search: dt,
|
|
1338
|
+
Item: Ie,
|
|
1339
|
+
CheckboxItem: U,
|
|
1340
|
+
RadioGroup: $e,
|
|
1341
|
+
RadioItem: et,
|
|
1342
|
+
Group: De,
|
|
1343
|
+
Label: Ve,
|
|
1344
|
+
Separator: Ke,
|
|
1345
|
+
Sub: mt,
|
|
1346
|
+
SubTrigger: pt,
|
|
1347
|
+
SubContent: ft,
|
|
1348
|
+
ItemIcon: Ze,
|
|
1349
|
+
ItemDescription: Xe,
|
|
1350
|
+
ItemBadge: Ye,
|
|
1351
|
+
ItemShortcut: Qe,
|
|
1352
|
+
Arrow: R,
|
|
1353
|
+
Empty: Te,
|
|
1354
|
+
Loading: Ue
|
|
1355
1355
|
});
|
|
1356
|
-
|
|
1356
|
+
vt.displayName = "Dropdown";
|
|
1357
1357
|
//#endregion
|
|
1358
1358
|
//#region src/components/Modal/internal/ModalContext.tsx
|
|
1359
|
-
var
|
|
1360
|
-
let e = d(
|
|
1359
|
+
var yt = s(void 0), bt = s(void 0), xt = () => {
|
|
1360
|
+
let e = d(yt);
|
|
1361
1361
|
if (e === void 0) throw Error("Modal compound components must be used inside Modal");
|
|
1362
1362
|
return e;
|
|
1363
|
-
},
|
|
1364
|
-
|
|
1365
|
-
var
|
|
1363
|
+
}, St = () => d(bt), Ct = yt.Provider, wt = bt.Provider;
|
|
1364
|
+
yt.displayName = "ModalContext", bt.displayName = "ModalContentContext";
|
|
1365
|
+
var Tt = {
|
|
1366
1366
|
modalBody: "_modalBody_ou4ff_1",
|
|
1367
1367
|
inside: "_inside_ou4ff_6"
|
|
1368
|
-
},
|
|
1369
|
-
let r =
|
|
1368
|
+
}, Et = ({ children: e, className: t }) => {
|
|
1369
|
+
let r = St();
|
|
1370
1370
|
return /* @__PURE__ */ n("div", {
|
|
1371
|
-
className:
|
|
1371
|
+
className: I(Tt.modalBody, r?.scrollBehavior === "inside" && Tt.inside, t),
|
|
1372
1372
|
children: e
|
|
1373
1373
|
});
|
|
1374
1374
|
};
|
|
1375
|
-
|
|
1375
|
+
Et.displayName = "ModalBody";
|
|
1376
1376
|
//#endregion
|
|
1377
1377
|
//#region src/components/Modal/internal/composeEventHandlers.ts
|
|
1378
|
-
function
|
|
1378
|
+
function Dt(e, t) {
|
|
1379
1379
|
return (n) => {
|
|
1380
1380
|
e?.(n), n.defaultPrevented || t(n);
|
|
1381
1381
|
};
|
|
1382
1382
|
}
|
|
1383
|
-
function
|
|
1383
|
+
function Ot(...e) {
|
|
1384
1384
|
return (t) => {
|
|
1385
1385
|
e.forEach((e) => {
|
|
1386
1386
|
if (e) {
|
|
@@ -1393,21 +1393,21 @@ function Dt(...e) {
|
|
|
1393
1393
|
});
|
|
1394
1394
|
};
|
|
1395
1395
|
}
|
|
1396
|
-
var
|
|
1396
|
+
var kt = {
|
|
1397
1397
|
modalHeader: "_modalHeader_hw9hl_1",
|
|
1398
1398
|
modalHeaderText: "_modalHeaderText_hw9hl_8",
|
|
1399
1399
|
modalHeaderTitle: "_modalHeaderTitle_hw9hl_13",
|
|
1400
1400
|
modalHeaderDescription: "_modalHeaderDescription_hw9hl_20",
|
|
1401
1401
|
modalHeaderCloseButton: "_modalHeaderCloseButton_hw9hl_26"
|
|
1402
|
-
},
|
|
1403
|
-
let a =
|
|
1402
|
+
}, At = ({ asChild: e = !1, children: t, className: r, "aria-label": i }) => {
|
|
1403
|
+
let a = xt(), s = e && l(t) ? t : void 0, c = {
|
|
1404
1404
|
"aria-label": s ? i : i ?? "Close dialog",
|
|
1405
|
-
className:
|
|
1406
|
-
onClick:
|
|
1405
|
+
className: I(!s && kt.modalHeaderCloseButton, r),
|
|
1406
|
+
onClick: Dt(s?.props.onClick, a.requestClose)
|
|
1407
1407
|
};
|
|
1408
1408
|
return s ? o(s, {
|
|
1409
1409
|
...c,
|
|
1410
|
-
className:
|
|
1410
|
+
className: I(s.props.className, r),
|
|
1411
1411
|
"aria-label": i ?? s.props["aria-label"]
|
|
1412
1412
|
}) : /* @__PURE__ */ n("button", {
|
|
1413
1413
|
type: "button",
|
|
@@ -1415,10 +1415,10 @@ var Ot = {
|
|
|
1415
1415
|
children: /* @__PURE__ */ n(S, { size: 16 })
|
|
1416
1416
|
});
|
|
1417
1417
|
};
|
|
1418
|
-
|
|
1418
|
+
At.displayName = "Modal.Close";
|
|
1419
1419
|
//#endregion
|
|
1420
1420
|
//#region src/components/Modal/internal/useModalDismiss.ts
|
|
1421
|
-
var
|
|
1421
|
+
var jt = ({ active: e, contentRef: t, closeOnEscape: n, closeOnOutsidePress: r, isTopModal: i, onEscapeKeyDown: a, onPointerDownOutside: o, onInteractOutside: s, requestClose: c }) => {
|
|
1422
1422
|
oe({
|
|
1423
1423
|
active: e,
|
|
1424
1424
|
closeOnOutsidePress: r,
|
|
@@ -1430,7 +1430,7 @@ var At = ({ active: e, contentRef: t, closeOnEscape: n, closeOnOutsidePress: r,
|
|
|
1430
1430
|
onPointerDownOutside: o ? (e) => o(e) : void 0,
|
|
1431
1431
|
requestClose: c
|
|
1432
1432
|
});
|
|
1433
|
-
},
|
|
1433
|
+
}, Mt = {
|
|
1434
1434
|
content: "_content_1tnw8_1",
|
|
1435
1435
|
animated: "_animated_1tnw8_24",
|
|
1436
1436
|
"modal-content-open": "_modal-content-open_1tnw8_1",
|
|
@@ -1444,11 +1444,11 @@ var At = ({ active: e, contentRef: t, closeOnEscape: n, closeOnOutsidePress: r,
|
|
|
1444
1444
|
full: "_full_1tnw8_107",
|
|
1445
1445
|
inside: "_inside_1tnw8_113",
|
|
1446
1446
|
outside: "_outside_1tnw8_117"
|
|
1447
|
-
},
|
|
1448
|
-
let p =
|
|
1447
|
+
}, Nt = ({ children: e, size: t = "md", placement: r = "center", scrollBehavior: i = "inside", animated: a = !0, forceMount: o = !1, ariaLabel: s, ariaLabelledBy: c, ariaDescribedBy: l, className: d, style: f }) => {
|
|
1448
|
+
let p = xt(), m = p.open, h = m && p.shouldRender, [g, v] = _(null), y = u((e) => {
|
|
1449
1449
|
p.setContentRef(e), v(e);
|
|
1450
1450
|
}, [p]);
|
|
1451
|
-
if (
|
|
1451
|
+
if (jt({
|
|
1452
1452
|
active: m,
|
|
1453
1453
|
contentRef: p.contentRef,
|
|
1454
1454
|
closeOnEscape: p.closeOnEscape,
|
|
@@ -1458,7 +1458,7 @@ var At = ({ active: e, contentRef: t, closeOnEscape: n, closeOnOutsidePress: r,
|
|
|
1458
1458
|
onInteractOutside: p.onInteractOutside,
|
|
1459
1459
|
onPointerDownOutside: p.onPointerDownOutside,
|
|
1460
1460
|
requestClose: p.requestClose
|
|
1461
|
-
}),
|
|
1461
|
+
}), G({
|
|
1462
1462
|
active: h,
|
|
1463
1463
|
contentRef: p.contentRef,
|
|
1464
1464
|
enabled: p.trapFocus,
|
|
@@ -1467,19 +1467,19 @@ var At = ({ active: e, contentRef: t, closeOnEscape: n, closeOnOutsidePress: r,
|
|
|
1467
1467
|
onCloseAutoFocus: p.onCloseAutoFocus,
|
|
1468
1468
|
onOpenAutoFocus: p.onOpenAutoFocus,
|
|
1469
1469
|
restoreFocus: p.restoreFocus
|
|
1470
|
-
}),
|
|
1470
|
+
}), te({
|
|
1471
1471
|
active: m,
|
|
1472
1472
|
content: g,
|
|
1473
1473
|
enabled: p.modal
|
|
1474
1474
|
}), !p.shouldRender && !o) return null;
|
|
1475
1475
|
let b = c ?? (s ? void 0 : p.titleId), x = l ?? p.descriptionId;
|
|
1476
|
-
return /* @__PURE__ */ n(
|
|
1476
|
+
return /* @__PURE__ */ n(wt, {
|
|
1477
1477
|
value: { scrollBehavior: i },
|
|
1478
1478
|
children: /* @__PURE__ */ n("div", {
|
|
1479
1479
|
id: p.contentId,
|
|
1480
|
-
ref:
|
|
1480
|
+
ref: Ot(y),
|
|
1481
1481
|
tabIndex: -1,
|
|
1482
|
-
className:
|
|
1482
|
+
className: I(Mt.content, Mt[t], Mt[r], Mt[i], a && Mt.animated, d),
|
|
1483
1483
|
style: {
|
|
1484
1484
|
...p.animationStyle,
|
|
1485
1485
|
...f
|
|
@@ -1495,92 +1495,92 @@ var At = ({ active: e, contentRef: t, closeOnEscape: n, closeOnOutsidePress: r,
|
|
|
1495
1495
|
})
|
|
1496
1496
|
});
|
|
1497
1497
|
};
|
|
1498
|
-
|
|
1499
|
-
var
|
|
1500
|
-
className:
|
|
1498
|
+
Nt.displayName = "ModalContent";
|
|
1499
|
+
var Pt = { modalFooter: "_modalFooter_sb1pn_1" }, Ft = ({ children: e, className: t }) => /* @__PURE__ */ n("div", {
|
|
1500
|
+
className: I(Pt.modalFooter, t),
|
|
1501
1501
|
children: e
|
|
1502
1502
|
});
|
|
1503
|
-
|
|
1503
|
+
Ft.displayName = "ModalFooter";
|
|
1504
1504
|
//#endregion
|
|
1505
1505
|
//#region src/components/Modal/Header/ModalDescription.tsx
|
|
1506
|
-
var
|
|
1507
|
-
let { descriptionId: t, setDescriptionPresent: r } =
|
|
1506
|
+
var It = ({ children: e }) => {
|
|
1507
|
+
let { descriptionId: t, setDescriptionPresent: r } = xt();
|
|
1508
1508
|
return f(() => (r(!0), () => r(!1)), [r]), /* @__PURE__ */ n("p", {
|
|
1509
1509
|
id: t,
|
|
1510
|
-
className:
|
|
1510
|
+
className: kt.modalHeaderDescription,
|
|
1511
1511
|
children: e
|
|
1512
1512
|
});
|
|
1513
1513
|
};
|
|
1514
|
-
|
|
1514
|
+
It.displayName = "Modal.Description";
|
|
1515
1515
|
//#endregion
|
|
1516
1516
|
//#region src/components/Modal/Header/ModalHeader.tsx
|
|
1517
|
-
var
|
|
1518
|
-
className:
|
|
1517
|
+
var Lt = ({ children: e, className: t }) => /* @__PURE__ */ n("div", {
|
|
1518
|
+
className: I(kt.modalHeader, t),
|
|
1519
1519
|
children: e
|
|
1520
1520
|
});
|
|
1521
|
-
|
|
1521
|
+
Lt.displayName = "ModalHeader";
|
|
1522
1522
|
//#endregion
|
|
1523
1523
|
//#region src/components/Modal/Header/ModalTitle.tsx
|
|
1524
|
-
var
|
|
1525
|
-
let { setTitlePresent: t, titleId: r } =
|
|
1524
|
+
var Rt = ({ children: e }) => {
|
|
1525
|
+
let { setTitlePresent: t, titleId: r } = xt();
|
|
1526
1526
|
return f(() => (t(!0), () => t(!1)), [t]), /* @__PURE__ */ n("h2", {
|
|
1527
1527
|
id: r,
|
|
1528
|
-
className:
|
|
1528
|
+
className: kt.modalHeaderTitle,
|
|
1529
1529
|
children: e
|
|
1530
1530
|
});
|
|
1531
1531
|
};
|
|
1532
|
-
|
|
1533
|
-
var
|
|
1532
|
+
Rt.displayName = "Modal.Title";
|
|
1533
|
+
var zt = {
|
|
1534
1534
|
overlay: "_overlay_d6wdf_1",
|
|
1535
1535
|
"overlay--open": "_overlay--open_d6wdf_10",
|
|
1536
1536
|
"overlay--animated": "_overlay--animated_d6wdf_15",
|
|
1537
1537
|
"modal-overlay-open": "_modal-overlay-open_d6wdf_1",
|
|
1538
1538
|
"modal-overlay-close": "_modal-overlay-close_d6wdf_1"
|
|
1539
|
-
},
|
|
1540
|
-
let { animation: i, animationStyle: a, open: o, shouldRender: s } =
|
|
1539
|
+
}, Bt = ({ className: e, animated: t = !0, forceMount: r = !1 }) => {
|
|
1540
|
+
let { animation: i, animationStyle: a, open: o, shouldRender: s } = xt();
|
|
1541
1541
|
return !s && !r ? null : /* @__PURE__ */ n("div", {
|
|
1542
|
-
className:
|
|
1542
|
+
className: I(zt.overlay, o && zt["overlay--open"], t && zt["overlay--animated"], e),
|
|
1543
1543
|
style: a,
|
|
1544
1544
|
"data-state": o ? "open" : "closed",
|
|
1545
1545
|
"data-animation": i,
|
|
1546
1546
|
"aria-hidden": "true"
|
|
1547
1547
|
});
|
|
1548
1548
|
};
|
|
1549
|
-
|
|
1549
|
+
Bt.displayName = "ModalOverlay";
|
|
1550
1550
|
//#endregion
|
|
1551
1551
|
//#region src/components/Modal/Root/ModalRoot.tsx
|
|
1552
|
-
var
|
|
1553
|
-
standard:
|
|
1552
|
+
var Vt = {
|
|
1553
|
+
standard: F.components.modal.motion.easing,
|
|
1554
1554
|
linear: "linear",
|
|
1555
1555
|
ease: "ease",
|
|
1556
1556
|
"ease-in": "ease-in",
|
|
1557
1557
|
"ease-out": "ease-out",
|
|
1558
1558
|
"ease-in-out": "ease-in-out"
|
|
1559
|
-
},
|
|
1559
|
+
}, Ht = (e) => Number.parseFloat(e), Ut = (e) => typeof e == "number" ? {
|
|
1560
1560
|
close: e,
|
|
1561
1561
|
open: e
|
|
1562
1562
|
} : {
|
|
1563
|
-
close: e?.close ??
|
|
1564
|
-
open: e?.open ??
|
|
1565
|
-
},
|
|
1566
|
-
let O = g(null), { contentId: k, descriptionId: A, open: j, requestClose: M, setOpen: N, titleId: P } =
|
|
1563
|
+
close: e?.close ?? Ht(F.components.modal.motion.closeDuration),
|
|
1564
|
+
open: e?.open ?? Ht(F.components.modal.motion.openDuration)
|
|
1565
|
+
}, Wt = ({ children: e, open: t, defaultOpen: r = !1, onOpenChange: i, animation: a = "scale", duration: o, easing: s = "standard", modal: c = !0, closeOnEscape: l = !0, closeOnOutsidePress: d = !0, preventScroll: p = !0, restoreFocus: m = !0, trapFocus: v = !0, initialFocus: y, finalFocus: b, onOpenAutoFocus: x, onCloseAutoFocus: S, onEscapeKeyDown: C, onPointerDownOutside: w, onInteractOutside: T, role: E = "dialog", className: D }) => {
|
|
1566
|
+
let O = g(null), { contentId: k, descriptionId: A, open: j, requestClose: M, setOpen: N, titleId: P } = ve({
|
|
1567
1567
|
open: t,
|
|
1568
1568
|
defaultOpen: r,
|
|
1569
1569
|
onOpenChange: i,
|
|
1570
1570
|
closeOnEscape: l,
|
|
1571
1571
|
closeOnOutsidePress: d
|
|
1572
|
-
}), [
|
|
1572
|
+
}), [F, L] = _(!1), [R, z] = _(!1), B = Ut(o), V = a === "none" ? 0 : B.close, [ee, H] = _(j);
|
|
1573
1573
|
f(() => {
|
|
1574
1574
|
if (j) {
|
|
1575
|
-
|
|
1575
|
+
H(!0);
|
|
1576
1576
|
return;
|
|
1577
1577
|
}
|
|
1578
1578
|
if (V === 0) {
|
|
1579
|
-
|
|
1579
|
+
H(!1);
|
|
1580
1580
|
return;
|
|
1581
1581
|
}
|
|
1582
1582
|
let e = window.setTimeout(() => {
|
|
1583
|
-
|
|
1583
|
+
H(!1);
|
|
1584
1584
|
}, V);
|
|
1585
1585
|
return () => {
|
|
1586
1586
|
window.clearTimeout(e);
|
|
@@ -1590,17 +1590,17 @@ var Bt = {
|
|
|
1590
1590
|
M();
|
|
1591
1591
|
}, [M]), te = u((e) => {
|
|
1592
1592
|
O.current = e;
|
|
1593
|
-
}, []), { isTopOverlay: ne } =
|
|
1593
|
+
}, []), { isTopOverlay: ne } = le({
|
|
1594
1594
|
active: j,
|
|
1595
1595
|
id: k
|
|
1596
1596
|
});
|
|
1597
|
-
|
|
1597
|
+
fe({
|
|
1598
1598
|
active: j,
|
|
1599
1599
|
enabled: p
|
|
1600
1600
|
});
|
|
1601
1601
|
let re = h(() => ({
|
|
1602
1602
|
"--modal-animation-close-duration": `${B.close}ms`,
|
|
1603
|
-
"--modal-animation-easing":
|
|
1603
|
+
"--modal-animation-easing": Vt[s],
|
|
1604
1604
|
"--modal-animation-open-duration": `${B.open}ms`
|
|
1605
1605
|
}), [
|
|
1606
1606
|
B.close,
|
|
@@ -1608,14 +1608,14 @@ var Bt = {
|
|
|
1608
1608
|
s
|
|
1609
1609
|
]);
|
|
1610
1610
|
return f(() => {
|
|
1611
|
-
process.env.NODE_ENV === "production" || !j ||
|
|
1612
|
-
}, [j,
|
|
1611
|
+
process.env.NODE_ENV === "production" || !j || F || O.current?.hasAttribute("aria-label") || console.warn("Modal.Content requires Modal.Title or ariaLabel.");
|
|
1612
|
+
}, [j, F]), f(() => {
|
|
1613
1613
|
process.env.NODE_ENV === "production" || !j || E !== "alertdialog" || R || console.warn("Modal with role=\"alertdialog\" requires Modal.Description.");
|
|
1614
1614
|
}, [
|
|
1615
1615
|
R,
|
|
1616
1616
|
j,
|
|
1617
1617
|
E
|
|
1618
|
-
]), /* @__PURE__ */ n(
|
|
1618
|
+
]), /* @__PURE__ */ n(Ct, {
|
|
1619
1619
|
value: h(() => ({
|
|
1620
1620
|
animation: a,
|
|
1621
1621
|
animationStyle: re,
|
|
@@ -1642,7 +1642,7 @@ var Bt = {
|
|
|
1642
1642
|
setDescriptionPresent: z,
|
|
1643
1643
|
setOpen: N,
|
|
1644
1644
|
setTitlePresent: L,
|
|
1645
|
-
shouldRender:
|
|
1645
|
+
shouldRender: ee,
|
|
1646
1646
|
titleId: P,
|
|
1647
1647
|
trapFocus: v
|
|
1648
1648
|
}), [
|
|
@@ -1668,63 +1668,371 @@ var Bt = {
|
|
|
1668
1668
|
E,
|
|
1669
1669
|
te,
|
|
1670
1670
|
N,
|
|
1671
|
-
|
|
1671
|
+
ee,
|
|
1672
1672
|
P,
|
|
1673
1673
|
v
|
|
1674
1674
|
]),
|
|
1675
1675
|
children: /* @__PURE__ */ n("div", {
|
|
1676
|
-
className:
|
|
1676
|
+
className: I(D),
|
|
1677
1677
|
"data-state": j ? "open" : "closed",
|
|
1678
1678
|
children: e
|
|
1679
1679
|
})
|
|
1680
1680
|
});
|
|
1681
1681
|
};
|
|
1682
|
-
|
|
1682
|
+
Wt.displayName = "ModalRoot";
|
|
1683
1683
|
//#endregion
|
|
1684
1684
|
//#region src/components/Modal/Trigger/ModalTrigger.tsx
|
|
1685
|
-
var
|
|
1686
|
-
let a =
|
|
1685
|
+
var Gt = ({ children: e, asChild: t = !1, disabled: r = !1, className: i }) => {
|
|
1686
|
+
let a = xt(), s = t && l(e) ? e : void 0, c = r, u = {
|
|
1687
1687
|
"aria-controls": a.contentId,
|
|
1688
1688
|
"aria-disabled": c || void 0,
|
|
1689
1689
|
"aria-expanded": a.open,
|
|
1690
1690
|
"aria-haspopup": "dialog",
|
|
1691
|
-
className:
|
|
1691
|
+
className: I(i),
|
|
1692
1692
|
"data-state": a.open ? "open" : "closed",
|
|
1693
1693
|
disabled: c || void 0,
|
|
1694
|
-
onClick:
|
|
1694
|
+
onClick: Dt(s?.props.onClick, () => {
|
|
1695
1695
|
c || a.setOpen(!0);
|
|
1696
1696
|
})
|
|
1697
1697
|
};
|
|
1698
1698
|
return s ? o(s, {
|
|
1699
1699
|
...u,
|
|
1700
|
-
ref:
|
|
1701
|
-
className:
|
|
1700
|
+
ref: Ot(s.props.ref),
|
|
1701
|
+
className: I(s.props.className, i)
|
|
1702
1702
|
}) : /* @__PURE__ */ n("button", {
|
|
1703
1703
|
type: "button",
|
|
1704
1704
|
...u,
|
|
1705
1705
|
children: e
|
|
1706
1706
|
});
|
|
1707
1707
|
};
|
|
1708
|
-
|
|
1708
|
+
Gt.displayName = "Modal.Trigger";
|
|
1709
1709
|
//#endregion
|
|
1710
1710
|
//#region src/components/Modal/Modal.tsx
|
|
1711
|
-
var
|
|
1712
|
-
Trigger:
|
|
1713
|
-
Overlay:
|
|
1714
|
-
Content:
|
|
1715
|
-
Header:
|
|
1716
|
-
Title:
|
|
1717
|
-
Description:
|
|
1718
|
-
Body:
|
|
1719
|
-
Footer:
|
|
1720
|
-
Close:
|
|
1711
|
+
var Kt = Object.assign(Wt, {
|
|
1712
|
+
Trigger: Gt,
|
|
1713
|
+
Overlay: Bt,
|
|
1714
|
+
Content: Nt,
|
|
1715
|
+
Header: Lt,
|
|
1716
|
+
Title: Rt,
|
|
1717
|
+
Description: It,
|
|
1718
|
+
Body: Et,
|
|
1719
|
+
Footer: Ft,
|
|
1720
|
+
Close: At
|
|
1721
1721
|
});
|
|
1722
|
-
|
|
1722
|
+
Kt.displayName = "Modal";
|
|
1723
|
+
//#endregion
|
|
1724
|
+
//#region src/components/Popover/Context/PopoverContext.tsx
|
|
1725
|
+
var qt = s(null);
|
|
1726
|
+
function Jt({ children: e, value: t }) {
|
|
1727
|
+
return /* @__PURE__ */ n(qt.Provider, {
|
|
1728
|
+
value: t,
|
|
1729
|
+
children: e
|
|
1730
|
+
});
|
|
1731
|
+
}
|
|
1732
|
+
function Yt(e) {
|
|
1733
|
+
let t = d(qt);
|
|
1734
|
+
if (!t) throw Error(`${e} must be used within Popover.Root`);
|
|
1735
|
+
return t;
|
|
1736
|
+
}
|
|
1737
|
+
//#endregion
|
|
1738
|
+
//#region src/components/Popover/Anchor/PopoverAnchor.tsx
|
|
1739
|
+
function Xt(e, t) {
|
|
1740
|
+
if (typeof e == "function") {
|
|
1741
|
+
e(t);
|
|
1742
|
+
return;
|
|
1743
|
+
}
|
|
1744
|
+
e && (e.current = t);
|
|
1745
|
+
}
|
|
1746
|
+
function Zt({ children: e, asChild: t = !1, className: r, ...i }) {
|
|
1747
|
+
let { setAnchorRef: a } = Yt("Popover.Anchor"), s = t && l(e) ? e : void 0;
|
|
1748
|
+
return s ? o(s, {
|
|
1749
|
+
...i,
|
|
1750
|
+
ref: (e) => {
|
|
1751
|
+
Xt(s.props.ref, e), a(e);
|
|
1752
|
+
},
|
|
1753
|
+
className: I(s.props.className, r)
|
|
1754
|
+
}) : /* @__PURE__ */ n("div", {
|
|
1755
|
+
...i,
|
|
1756
|
+
ref: a,
|
|
1757
|
+
className: r,
|
|
1758
|
+
children: e
|
|
1759
|
+
});
|
|
1760
|
+
}
|
|
1761
|
+
Zt.displayName = "Popover.Anchor";
|
|
1762
|
+
var Qt = { arrow: "_arrow_6lbs0_1" }, $t = {
|
|
1763
|
+
start: "20%",
|
|
1764
|
+
center: null,
|
|
1765
|
+
end: "80%"
|
|
1766
|
+
};
|
|
1767
|
+
function en({ width: e = 14, height: t = 7, tipRadius: r = 1, align: i = "center", offset: a, className: o, ...s }) {
|
|
1768
|
+
let { arrowRef: c, floatingContext: l, placement: u } = Yt("Popover.Arrow"), d = a ?? $t[i], f = u.split("-")[0];
|
|
1769
|
+
return /* @__PURE__ */ n(w, {
|
|
1770
|
+
...s,
|
|
1771
|
+
ref: c,
|
|
1772
|
+
context: l,
|
|
1773
|
+
width: e,
|
|
1774
|
+
height: t,
|
|
1775
|
+
tipRadius: r,
|
|
1776
|
+
staticOffset: d,
|
|
1777
|
+
fill: "var(--surface-elevated)",
|
|
1778
|
+
stroke: "var(--border-muted)",
|
|
1779
|
+
strokeWidth: 1,
|
|
1780
|
+
"data-side": f,
|
|
1781
|
+
className: I(Qt.arrow, o)
|
|
1782
|
+
});
|
|
1783
|
+
}
|
|
1784
|
+
en.displayName = "Popover.Arrow";
|
|
1785
|
+
//#endregion
|
|
1786
|
+
//#region src/components/Popover/Close/PopoverClose.tsx
|
|
1787
|
+
function tn({ children: e, asChild: t = !1, className: r, disabled: i, onClick: a, ...s }) {
|
|
1788
|
+
let { setOpen: c } = Yt("Popover.Close"), u = t && l(e) ? e : void 0, d = i || u?.props.disabled === !0, f = (e) => {
|
|
1789
|
+
u?.props.onClick?.(e), a?.(e), !(e.defaultPrevented || d) && c(!1, {
|
|
1790
|
+
reason: "close",
|
|
1791
|
+
event: e.nativeEvent
|
|
1792
|
+
});
|
|
1793
|
+
}, p = {
|
|
1794
|
+
...s,
|
|
1795
|
+
disabled: d || void 0,
|
|
1796
|
+
"aria-disabled": d || void 0,
|
|
1797
|
+
onClick: f
|
|
1798
|
+
};
|
|
1799
|
+
return u ? o(u, {
|
|
1800
|
+
...p,
|
|
1801
|
+
className: I(u.props.className, r)
|
|
1802
|
+
}) : /* @__PURE__ */ n("button", {
|
|
1803
|
+
type: "button",
|
|
1804
|
+
...p,
|
|
1805
|
+
className: r,
|
|
1806
|
+
children: e
|
|
1807
|
+
});
|
|
1808
|
+
}
|
|
1809
|
+
tn.displayName = "Popover.Close";
|
|
1810
|
+
var nn = {
|
|
1811
|
+
content: "_content_1jzfn_1",
|
|
1812
|
+
"popover-in": "_popover-in_1jzfn_1"
|
|
1813
|
+
};
|
|
1814
|
+
//#endregion
|
|
1815
|
+
//#region src/components/Popover/Content/PopoverContent.tsx
|
|
1816
|
+
function rn({ children: e, asChild: t = !1, className: r, style: i, initialFocus: a, returnFocus: s = !0, closeOnEscape: c = !0, closeOnOutsidePress: d = !0, onEscapeKeyDown: f, onPointerDownOutside: p, onInteractOutside: m, onOpenAutoFocus: h, onCloseAutoFocus: g, ...v }) {
|
|
1817
|
+
let { open: y, modal: b, portal: x, triggerRef: S, contentRef: C, contentId: w, titleId: T, descriptionId: E, placement: D, floatingStyles: O, setOpen: k, setContentRef: A } = Yt("Popover.Content"), [j, M] = _(null), { isTopOverlay: N } = le({
|
|
1818
|
+
active: y,
|
|
1819
|
+
id: w
|
|
1820
|
+
}), P = u((e, t) => {
|
|
1821
|
+
k(!1, {
|
|
1822
|
+
reason: e,
|
|
1823
|
+
event: t
|
|
1824
|
+
});
|
|
1825
|
+
}, [k]);
|
|
1826
|
+
oe({
|
|
1827
|
+
active: y,
|
|
1828
|
+
contentRef: C,
|
|
1829
|
+
ignoreRefs: [S],
|
|
1830
|
+
closeOnEscape: c,
|
|
1831
|
+
closeOnOutsidePress: d,
|
|
1832
|
+
isTopOverlay: N,
|
|
1833
|
+
onEscapeKeyDown: f,
|
|
1834
|
+
onPointerDownOutside: p,
|
|
1835
|
+
onInteractOutside: m,
|
|
1836
|
+
requestClose: P
|
|
1837
|
+
}), G({
|
|
1838
|
+
active: y,
|
|
1839
|
+
contentRef: C,
|
|
1840
|
+
enabled: b,
|
|
1841
|
+
initialFocus: a,
|
|
1842
|
+
finalFocus: S,
|
|
1843
|
+
restoreFocus: s,
|
|
1844
|
+
onOpenAutoFocus: u((e) => {
|
|
1845
|
+
h?.(e), !e.defaultPrevented && !b && !a && e.preventDefault();
|
|
1846
|
+
}, [
|
|
1847
|
+
b,
|
|
1848
|
+
a,
|
|
1849
|
+
h
|
|
1850
|
+
]),
|
|
1851
|
+
onCloseAutoFocus: g
|
|
1852
|
+
}), fe({
|
|
1853
|
+
active: y,
|
|
1854
|
+
enabled: b
|
|
1855
|
+
}), te({
|
|
1856
|
+
active: y,
|
|
1857
|
+
enabled: b,
|
|
1858
|
+
content: j
|
|
1859
|
+
});
|
|
1860
|
+
let F = u((e) => {
|
|
1861
|
+
M(e), A(e);
|
|
1862
|
+
}, [A]);
|
|
1863
|
+
if (!y) return null;
|
|
1864
|
+
let L = D.split("-")[0], R = {
|
|
1865
|
+
...v,
|
|
1866
|
+
id: w,
|
|
1867
|
+
role: v.role ?? "dialog",
|
|
1868
|
+
tabIndex: v.tabIndex ?? -1,
|
|
1869
|
+
"aria-labelledby": T,
|
|
1870
|
+
"aria-describedby": E,
|
|
1871
|
+
"data-state": "open",
|
|
1872
|
+
"data-side": L,
|
|
1873
|
+
className: I(nn.content, r),
|
|
1874
|
+
style: {
|
|
1875
|
+
...O,
|
|
1876
|
+
...i
|
|
1877
|
+
}
|
|
1878
|
+
}, z = t && l(e) ? e : void 0, B = z ? o(z, {
|
|
1879
|
+
...R,
|
|
1880
|
+
ref: F,
|
|
1881
|
+
className: I(z.props.className, nn.content, r),
|
|
1882
|
+
style: {
|
|
1883
|
+
...O,
|
|
1884
|
+
...z.props.style,
|
|
1885
|
+
...i
|
|
1886
|
+
}
|
|
1887
|
+
}) : /* @__PURE__ */ n("div", {
|
|
1888
|
+
ref: F,
|
|
1889
|
+
...R,
|
|
1890
|
+
children: e
|
|
1891
|
+
});
|
|
1892
|
+
return x ? /* @__PURE__ */ n(Ce, { children: B }) : B;
|
|
1893
|
+
}
|
|
1894
|
+
rn.displayName = "Popover.Content";
|
|
1895
|
+
var an = { description: "_description_hji8o_1" };
|
|
1723
1896
|
//#endregion
|
|
1724
|
-
//#region src/components/
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
return
|
|
1897
|
+
//#region src/components/Popover/Description/PopoverDescription.tsx
|
|
1898
|
+
function on({ children: e, asChild: t = !1, className: r, ...i }) {
|
|
1899
|
+
let { descriptionId: a } = Yt("Popover.Description"), s = t && l(e) ? e : void 0;
|
|
1900
|
+
return s ? o(s, {
|
|
1901
|
+
...i,
|
|
1902
|
+
id: a,
|
|
1903
|
+
className: I(s.props.className, an.description, r)
|
|
1904
|
+
}) : /* @__PURE__ */ n("p", {
|
|
1905
|
+
...i,
|
|
1906
|
+
id: a,
|
|
1907
|
+
className: I(an.description, r),
|
|
1908
|
+
children: e
|
|
1909
|
+
});
|
|
1910
|
+
}
|
|
1911
|
+
on.displayName = "Popover.Description";
|
|
1912
|
+
//#endregion
|
|
1913
|
+
//#region src/components/Popover/Root/PopoverRoot.tsx
|
|
1914
|
+
function sn(e, t) {
|
|
1915
|
+
return t === "center" ? e : `${e}-${t}`;
|
|
1916
|
+
}
|
|
1917
|
+
function cn({ children: e, open: t, defaultOpen: r = !1, modal: i = !1, onOpenChange: a, side: o = "bottom", align: s = "center", sideOffset: c = 8, alignOffset: l = 0, collisionPadding: d = 8, avoidCollisions: f = !0, portal: m = !0, strategy: _ }) {
|
|
1918
|
+
let v = g(null), y = g(null), b = g(null), x = g({ reason: "programmatic" }), S = p(), C = `vellira-popover-trigger-${S}`, w = `vellira-popover-content-${S}`, E = `vellira-popover-title-${S}`, D = `vellira-popover-description-${S}`, [O, k] = he({
|
|
1919
|
+
value: t,
|
|
1920
|
+
defaultValue: r,
|
|
1921
|
+
onChange: (e) => {
|
|
1922
|
+
a?.(e, x.current);
|
|
1923
|
+
}
|
|
1924
|
+
}), A = u((e, t) => {
|
|
1925
|
+
x.current = t, k(e);
|
|
1926
|
+
}, [k]), j = g(null), M = h(() => [T({
|
|
1927
|
+
element: j,
|
|
1928
|
+
padding: 8
|
|
1929
|
+
})], []), { context: N, floatingStyles: P, isPositioned: F, placement: I, setFloatingRef: L, setRef: R } = nt({
|
|
1930
|
+
open: O,
|
|
1931
|
+
placement: sn(o, s),
|
|
1932
|
+
strategy: _ ?? (m ? "fixed" : "absolute"),
|
|
1933
|
+
offset: c + 7,
|
|
1934
|
+
collisionPadding: d,
|
|
1935
|
+
avoidCollisions: f,
|
|
1936
|
+
middleware: M
|
|
1937
|
+
});
|
|
1938
|
+
return /* @__PURE__ */ n(Jt, {
|
|
1939
|
+
value: {
|
|
1940
|
+
open: O,
|
|
1941
|
+
modal: i,
|
|
1942
|
+
portal: m,
|
|
1943
|
+
triggerRef: v,
|
|
1944
|
+
anchorRef: y,
|
|
1945
|
+
contentRef: b,
|
|
1946
|
+
triggerId: C,
|
|
1947
|
+
contentId: w,
|
|
1948
|
+
titleId: E,
|
|
1949
|
+
descriptionId: D,
|
|
1950
|
+
placement: I,
|
|
1951
|
+
floatingStyles: P,
|
|
1952
|
+
isPositioned: F,
|
|
1953
|
+
floatingContext: N,
|
|
1954
|
+
arrowRef: j,
|
|
1955
|
+
setTriggerRef: u((e) => {
|
|
1956
|
+
v.current = e, y.current || R(e);
|
|
1957
|
+
}, [R]),
|
|
1958
|
+
setAnchorRef: u((e) => {
|
|
1959
|
+
y.current = e, R(e ?? v.current);
|
|
1960
|
+
}, [R]),
|
|
1961
|
+
setContentRef: u((e) => {
|
|
1962
|
+
b.current = e, L(e);
|
|
1963
|
+
}, [L]),
|
|
1964
|
+
setOpen: A
|
|
1965
|
+
},
|
|
1966
|
+
children: e
|
|
1967
|
+
});
|
|
1968
|
+
}
|
|
1969
|
+
var ln = { title: "_title_1gham_1" };
|
|
1970
|
+
//#endregion
|
|
1971
|
+
//#region src/components/Popover/Title/PopoverTitle.tsx
|
|
1972
|
+
function un({ children: e, asChild: t = !1, className: r, ...i }) {
|
|
1973
|
+
let { titleId: a } = Yt("Popover.Title"), s = t && l(e) ? e : void 0;
|
|
1974
|
+
return s ? o(s, {
|
|
1975
|
+
...i,
|
|
1976
|
+
id: a,
|
|
1977
|
+
className: I(s.props.className, ln.title, r)
|
|
1978
|
+
}) : /* @__PURE__ */ n("h2", {
|
|
1979
|
+
...i,
|
|
1980
|
+
id: a,
|
|
1981
|
+
className: I(ln.title, r),
|
|
1982
|
+
children: e
|
|
1983
|
+
});
|
|
1984
|
+
}
|
|
1985
|
+
un.displayName = "Popover.Title";
|
|
1986
|
+
//#endregion
|
|
1987
|
+
//#region src/components/Popover/Trigger/PopoverTrigger.tsx
|
|
1988
|
+
function dn({ children: e, asChild: t = !1, disabled: r = !1, className: i, onClick: a, ...s }) {
|
|
1989
|
+
let { open: c, triggerId: u, contentId: d, setOpen: f, setTriggerRef: p } = Yt("Popover.Trigger"), m = t && l(e) ? e : void 0, h = r || m?.props.disabled === !0, g = {
|
|
1990
|
+
id: u,
|
|
1991
|
+
"aria-controls": c ? d : void 0,
|
|
1992
|
+
"aria-expanded": c,
|
|
1993
|
+
"aria-haspopup": "dialog",
|
|
1994
|
+
"aria-disabled": h || void 0,
|
|
1995
|
+
"data-state": c ? "open" : "closed",
|
|
1996
|
+
onClick: (e) => {
|
|
1997
|
+
m?.props.onClick?.(e), a?.(e), !(e.defaultPrevented || h) && f(!c, {
|
|
1998
|
+
reason: "trigger",
|
|
1999
|
+
event: e.nativeEvent
|
|
2000
|
+
});
|
|
2001
|
+
}
|
|
2002
|
+
};
|
|
2003
|
+
return m ? o(m, {
|
|
2004
|
+
...s,
|
|
2005
|
+
...g,
|
|
2006
|
+
disabled: h || void 0,
|
|
2007
|
+
className: I(m.props.className, i),
|
|
2008
|
+
ref: (e) => {
|
|
2009
|
+
let t = m.props.ref;
|
|
2010
|
+
typeof t == "function" ? t(e) : t && (t.current = e), p(e);
|
|
2011
|
+
}
|
|
2012
|
+
}) : /* @__PURE__ */ n("button", {
|
|
2013
|
+
...s,
|
|
2014
|
+
...g,
|
|
2015
|
+
ref: p,
|
|
2016
|
+
type: "button",
|
|
2017
|
+
disabled: h,
|
|
2018
|
+
className: i,
|
|
2019
|
+
children: e
|
|
2020
|
+
});
|
|
2021
|
+
}
|
|
2022
|
+
dn.displayName = "Popover.Trigger";
|
|
2023
|
+
//#endregion
|
|
2024
|
+
//#region src/components/Popover/Popover.tsx
|
|
2025
|
+
var fn = Object.assign(cn, {
|
|
2026
|
+
Anchor: Zt,
|
|
2027
|
+
Arrow: en,
|
|
2028
|
+
Close: tn,
|
|
2029
|
+
Content: rn,
|
|
2030
|
+
Description: on,
|
|
2031
|
+
Title: un,
|
|
2032
|
+
Trigger: dn
|
|
2033
|
+
}), pn = s(null), mn = pn.Provider;
|
|
2034
|
+
function hn() {
|
|
2035
|
+
return d(pn);
|
|
1728
2036
|
}
|
|
1729
2037
|
var J = {
|
|
1730
2038
|
root: "_root_7yrws_1",
|
|
@@ -1749,23 +2057,23 @@ var J = {
|
|
|
1749
2057
|
"radio-indicator-in": "_radio-indicator-in_7yrws_1",
|
|
1750
2058
|
content: "_content_7yrws_346",
|
|
1751
2059
|
error: "_error_7yrws_363"
|
|
1752
|
-
},
|
|
2060
|
+
}, gn = {
|
|
1753
2061
|
primary: J.colorPrimary,
|
|
1754
2062
|
neutral: J.colorNeutral,
|
|
1755
2063
|
success: J.colorSuccess,
|
|
1756
2064
|
warning: J.colorWarning,
|
|
1757
2065
|
danger: J.colorDanger
|
|
1758
|
-
},
|
|
1759
|
-
let S =
|
|
2066
|
+
}, _n = c(({ value: e, checked: t, defaultChecked: i = !1, disabled: a = !1, required: o = !1, size: s, color: c, error: l, onCheckedChange: u, label: d, description: f, icon: m, wrapperClassName: h, className: g, id: _, name: v, "aria-describedby": y, ...b }, x) => {
|
|
2067
|
+
let S = hn(), C = p(), w = _ ?? C, T = f ? `${w}-description` : void 0, E = l ? `${w}-error` : void 0, D = [
|
|
1760
2068
|
T,
|
|
1761
2069
|
E,
|
|
1762
2070
|
S?.describedBy,
|
|
1763
2071
|
y
|
|
1764
|
-
].filter(Boolean).join(" ") || void 0, O = S !== null, [k, A] =
|
|
2072
|
+
].filter(Boolean).join(" ") || void 0, O = S !== null, [k, A] = he({
|
|
1765
2073
|
value: t,
|
|
1766
2074
|
defaultValue: i,
|
|
1767
2075
|
onChange: u
|
|
1768
|
-
}), j = O ? S.value === e : k, M = !!S?.disabled || a, N = !!S?.required || o, P = S?.name ?? v,
|
|
2076
|
+
}), j = O ? S.value === e : k, M = !!S?.disabled || a, N = !!S?.required || o, P = S?.name ?? v, F = !!(l || S?.invalid), L = s ?? S?.size ?? "md", R = c ?? S?.color ?? "primary", z = (t) => {
|
|
1769
2077
|
if (!M) {
|
|
1770
2078
|
if (O) {
|
|
1771
2079
|
S.onValueChange(e);
|
|
@@ -1775,10 +2083,10 @@ var J = {
|
|
|
1775
2083
|
}
|
|
1776
2084
|
};
|
|
1777
2085
|
return /* @__PURE__ */ r("div", {
|
|
1778
|
-
className:
|
|
2086
|
+
className: I(J.root, J[L], F && J.invalid, M && J.disabled, gn[R], g),
|
|
1779
2087
|
children: [/* @__PURE__ */ r("label", {
|
|
1780
2088
|
htmlFor: w,
|
|
1781
|
-
className:
|
|
2089
|
+
className: I(J.wrapper, h),
|
|
1782
2090
|
children: [
|
|
1783
2091
|
/* @__PURE__ */ n("input", {
|
|
1784
2092
|
...b,
|
|
@@ -1790,7 +2098,7 @@ var J = {
|
|
|
1790
2098
|
checked: j,
|
|
1791
2099
|
disabled: M,
|
|
1792
2100
|
required: N,
|
|
1793
|
-
"aria-invalid":
|
|
2101
|
+
"aria-invalid": F || void 0,
|
|
1794
2102
|
"aria-describedby": D,
|
|
1795
2103
|
className: J.input,
|
|
1796
2104
|
onChange: z
|
|
@@ -1799,7 +2107,7 @@ var J = {
|
|
|
1799
2107
|
className: J.control,
|
|
1800
2108
|
"aria-hidden": "true",
|
|
1801
2109
|
children: /* @__PURE__ */ n("span", {
|
|
1802
|
-
className:
|
|
2110
|
+
className: I(J.indicator, m && J.customIcon),
|
|
1803
2111
|
children: m
|
|
1804
2112
|
})
|
|
1805
2113
|
}),
|
|
@@ -1822,25 +2130,25 @@ var J = {
|
|
|
1822
2130
|
})]
|
|
1823
2131
|
});
|
|
1824
2132
|
});
|
|
1825
|
-
|
|
2133
|
+
_n.displayName = "Radio";
|
|
1826
2134
|
//#endregion
|
|
1827
2135
|
//#region src/components/RadioGroup/Item/RadioGroupItem.tsx
|
|
1828
|
-
var
|
|
2136
|
+
var vn = c((e, t) => /* @__PURE__ */ n(_n, {
|
|
1829
2137
|
...e,
|
|
1830
2138
|
ref: t
|
|
1831
2139
|
}));
|
|
1832
|
-
|
|
2140
|
+
vn.displayName = "RadioGroup.Item";
|
|
1833
2141
|
//#endregion
|
|
1834
2142
|
//#region src/components/RadioGroup/internal/useRadioGroupCollection.ts
|
|
1835
|
-
var
|
|
2143
|
+
var yn = (e) => {
|
|
1836
2144
|
let t = e.current;
|
|
1837
2145
|
return t ? Array.from(t.querySelectorAll("input[type=\"radio\"]")) : [];
|
|
1838
|
-
},
|
|
1839
|
-
function
|
|
2146
|
+
}, bn = (e) => yn(e).filter((e) => !e.disabled), xn = ["ArrowLeft", "ArrowRight"], Sn = ["ArrowUp", "ArrowDown"];
|
|
2147
|
+
function Cn({ rootRef: e, orientation: t }) {
|
|
1840
2148
|
return u((n) => {
|
|
1841
|
-
let r =
|
|
2149
|
+
let r = xn.includes(n.key), i = Sn.includes(n.key), a = n.key === "Home" || n.key === "End";
|
|
1842
2150
|
if (!r && !i && !a || t === "horizontal" && i || t === "vertical" && r) return;
|
|
1843
|
-
let o =
|
|
2151
|
+
let o = bn(e);
|
|
1844
2152
|
if (o.length === 0) return;
|
|
1845
2153
|
n.preventDefault();
|
|
1846
2154
|
let s = document.activeElement, c = o.findIndex((e) => e === s), l = o.findIndex((e) => e.checked), u = c >= 0 ? c : Math.max(l, 0), d = u;
|
|
@@ -1849,7 +2157,7 @@ function nn({ rootRef: e, orientation: t }) {
|
|
|
1849
2157
|
f?.focus(), f?.click();
|
|
1850
2158
|
}, [t, e]);
|
|
1851
2159
|
}
|
|
1852
|
-
var
|
|
2160
|
+
var wn = {
|
|
1853
2161
|
root: "_root_1s3vp_1",
|
|
1854
2162
|
sm: "_sm_1s3vp_32",
|
|
1855
2163
|
md: "_md_1s3vp_58",
|
|
@@ -1863,12 +2171,12 @@ var rn = {
|
|
|
1863
2171
|
error: "_error_1s3vp_152",
|
|
1864
2172
|
disabled: "_disabled_1s3vp_160",
|
|
1865
2173
|
invalid: "_invalid_1s3vp_176"
|
|
1866
|
-
},
|
|
1867
|
-
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] =
|
|
2174
|
+
}, Tn = 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) => {
|
|
2175
|
+
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] = he({
|
|
1868
2176
|
value: e,
|
|
1869
2177
|
defaultValue: t,
|
|
1870
2178
|
onChange: i
|
|
1871
|
-
}), M = !!f, N =
|
|
2179
|
+
}), M = !!f, N = Cn({
|
|
1872
2180
|
rootRef: S,
|
|
1873
2181
|
orientation: m
|
|
1874
2182
|
}), P = (e) => {
|
|
@@ -1891,23 +2199,23 @@ var rn = {
|
|
|
1891
2199
|
onKeyDown: (e) => {
|
|
1892
2200
|
y?.(e), e.defaultPrevented || N(e);
|
|
1893
2201
|
},
|
|
1894
|
-
className:
|
|
2202
|
+
className: I(wn.root, wn[s], M && wn.invalid, a && wn.disabled, _),
|
|
1895
2203
|
children: [
|
|
1896
2204
|
u && /* @__PURE__ */ r("div", {
|
|
1897
2205
|
id: T,
|
|
1898
|
-
className:
|
|
2206
|
+
className: wn.label,
|
|
1899
2207
|
children: [u, o && /* @__PURE__ */ n("span", {
|
|
1900
|
-
className:
|
|
2208
|
+
className: wn.required,
|
|
1901
2209
|
"aria-hidden": "true",
|
|
1902
2210
|
children: "*"
|
|
1903
2211
|
})]
|
|
1904
2212
|
}),
|
|
1905
2213
|
d && /* @__PURE__ */ n("div", {
|
|
1906
2214
|
id: E,
|
|
1907
|
-
className:
|
|
2215
|
+
className: wn.description,
|
|
1908
2216
|
children: d
|
|
1909
2217
|
}),
|
|
1910
|
-
/* @__PURE__ */ n(
|
|
2218
|
+
/* @__PURE__ */ n(mn, {
|
|
1911
2219
|
value: {
|
|
1912
2220
|
name: k,
|
|
1913
2221
|
value: A,
|
|
@@ -1920,35 +2228,35 @@ var rn = {
|
|
|
1920
2228
|
onValueChange: j
|
|
1921
2229
|
},
|
|
1922
2230
|
children: /* @__PURE__ */ n("div", {
|
|
1923
|
-
className:
|
|
2231
|
+
className: I(wn.items, wn[m]),
|
|
1924
2232
|
children: h
|
|
1925
2233
|
})
|
|
1926
2234
|
}),
|
|
1927
2235
|
f && /* @__PURE__ */ n("div", {
|
|
1928
2236
|
id: D,
|
|
1929
|
-
className:
|
|
2237
|
+
className: wn.error,
|
|
1930
2238
|
children: f
|
|
1931
2239
|
})
|
|
1932
2240
|
]
|
|
1933
2241
|
});
|
|
1934
2242
|
});
|
|
1935
|
-
|
|
2243
|
+
Tn.displayName = "RadioGroup.Root";
|
|
1936
2244
|
//#endregion
|
|
1937
2245
|
//#region src/components/RadioGroup/RadioGroup.tsx
|
|
1938
|
-
var
|
|
1939
|
-
|
|
2246
|
+
var En = Object.assign(Tn, { Item: vn });
|
|
2247
|
+
En.displayName = "RadioGroup";
|
|
1940
2248
|
//#endregion
|
|
1941
2249
|
//#region src/components/Select/internal/SelectContext.tsx
|
|
1942
|
-
var
|
|
1943
|
-
function
|
|
1944
|
-
let e = d(
|
|
2250
|
+
var Dn = s(null), On = Dn.Provider;
|
|
2251
|
+
function kn() {
|
|
2252
|
+
let e = d(Dn);
|
|
1945
2253
|
if (!e) throw Error("Select compound components must be used inside <Select>");
|
|
1946
2254
|
return e;
|
|
1947
2255
|
}
|
|
1948
|
-
|
|
2256
|
+
Dn.displayName = "SelectContext";
|
|
1949
2257
|
//#endregion
|
|
1950
2258
|
//#region src/components/Select/internal/useSelectVirtualization.ts
|
|
1951
|
-
function
|
|
2259
|
+
function An({ loading: e, options: t, scrollTop: n, virtual: r }) {
|
|
1952
2260
|
return h(() => {
|
|
1953
2261
|
let i = typeof r == "object" ? r : r ? {} : void 0, a = i?.itemHeight ?? 40, o = !!(i && t.length > 0 && !e), s = o ? Math.max(0, Math.floor(n / a) - 2) : 0, c = o ? Math.ceil(300 / a) + 4 : t.length, l = o ? t.slice(s, s + c) : t, u = o ? s * a : 0;
|
|
1954
2262
|
return {
|
|
@@ -1967,7 +2275,7 @@ function un({ loading: e, options: t, scrollTop: n, virtual: r }) {
|
|
|
1967
2275
|
r
|
|
1968
2276
|
]);
|
|
1969
2277
|
}
|
|
1970
|
-
var
|
|
2278
|
+
var jn = {
|
|
1971
2279
|
option: "_option_7msws_1",
|
|
1972
2280
|
selected: "_selected_7msws_38",
|
|
1973
2281
|
disabled: "_disabled_7msws_38",
|
|
@@ -1985,22 +2293,22 @@ var dn = {
|
|
|
1985
2293
|
danger: "_danger_7msws_313",
|
|
1986
2294
|
check: "_check_7msws_377",
|
|
1987
2295
|
checkPop: "_checkPop_7msws_1"
|
|
1988
|
-
},
|
|
1989
|
-
|
|
1990
|
-
var
|
|
2296
|
+
}, Mn = () => null;
|
|
2297
|
+
Mn.__velliraSelectPart = "item", Mn.displayName = "Select.Item";
|
|
2298
|
+
var Nn = ({ option: e, isSelected: i, isActive: a, optionId: o, renderOption: s, onSelect: c, onMouseEnter: l }) => {
|
|
1991
2299
|
let u = !!e.disabled;
|
|
1992
2300
|
return /* @__PURE__ */ r("li", {
|
|
1993
2301
|
id: o,
|
|
1994
2302
|
role: "option",
|
|
1995
2303
|
"aria-selected": i,
|
|
1996
2304
|
"aria-disabled": u || void 0,
|
|
1997
|
-
className:
|
|
1998
|
-
[
|
|
1999
|
-
[
|
|
2000
|
-
[
|
|
2001
|
-
[
|
|
2002
|
-
[
|
|
2003
|
-
[
|
|
2305
|
+
className: I(jn.option, {
|
|
2306
|
+
[jn.selected]: i,
|
|
2307
|
+
[jn.active]: a,
|
|
2308
|
+
[jn.disabled]: u,
|
|
2309
|
+
[jn.success]: e.color === "success",
|
|
2310
|
+
[jn.warning]: e.color === "warning",
|
|
2311
|
+
[jn.danger]: e.color === "danger"
|
|
2004
2312
|
}),
|
|
2005
2313
|
onClick: () => {
|
|
2006
2314
|
u || c(e.value);
|
|
@@ -2009,39 +2317,39 @@ var pn = ({ option: e, isSelected: i, isActive: a, optionId: o, renderOption: s,
|
|
|
2009
2317
|
u || l();
|
|
2010
2318
|
},
|
|
2011
2319
|
children: [s ? /* @__PURE__ */ n("span", {
|
|
2012
|
-
className:
|
|
2320
|
+
className: jn.custom,
|
|
2013
2321
|
children: s(e)
|
|
2014
2322
|
}) : /* @__PURE__ */ r(t, { children: [
|
|
2015
2323
|
e.icon && /* @__PURE__ */ n("span", {
|
|
2016
|
-
className:
|
|
2324
|
+
className: jn.icon,
|
|
2017
2325
|
children: e.icon
|
|
2018
2326
|
}),
|
|
2019
2327
|
/* @__PURE__ */ r("span", {
|
|
2020
|
-
className:
|
|
2328
|
+
className: jn.content,
|
|
2021
2329
|
children: [/* @__PURE__ */ n("span", {
|
|
2022
|
-
className:
|
|
2330
|
+
className: jn.label,
|
|
2023
2331
|
children: e.label
|
|
2024
2332
|
}), e.description && /* @__PURE__ */ n("span", {
|
|
2025
|
-
className:
|
|
2333
|
+
className: jn.description,
|
|
2026
2334
|
children: e.description
|
|
2027
2335
|
})]
|
|
2028
2336
|
}),
|
|
2029
2337
|
e.badge && /* @__PURE__ */ n("span", {
|
|
2030
|
-
className:
|
|
2338
|
+
className: jn.badge,
|
|
2031
2339
|
children: e.badge
|
|
2032
2340
|
}),
|
|
2033
2341
|
e.shortcut && /* @__PURE__ */ n("kbd", {
|
|
2034
|
-
className:
|
|
2342
|
+
className: jn.shortcut,
|
|
2035
2343
|
children: e.shortcut
|
|
2036
2344
|
})
|
|
2037
2345
|
] }), /* @__PURE__ */ n("span", {
|
|
2038
|
-
className:
|
|
2346
|
+
className: jn.check,
|
|
2039
2347
|
"aria-hidden": "true",
|
|
2040
2348
|
children: i && /* @__PURE__ */ n(y, {})
|
|
2041
2349
|
})]
|
|
2042
2350
|
});
|
|
2043
2351
|
};
|
|
2044
|
-
|
|
2352
|
+
Nn.displayName = "SelectItemRow";
|
|
2045
2353
|
var Y = {
|
|
2046
2354
|
dropdown: "_dropdown_jkvqg_1",
|
|
2047
2355
|
dropdownIn: "_dropdownIn_jkvqg_1",
|
|
@@ -2067,17 +2375,17 @@ var Y = {
|
|
|
2067
2375
|
separator: "_separator_jkvqg_1575",
|
|
2068
2376
|
virtualSpacer: "_virtualSpacer_jkvqg_1581",
|
|
2069
2377
|
mobileDropdownIn: "_mobileDropdownIn_jkvqg_1"
|
|
2070
|
-
},
|
|
2071
|
-
let { contentProps: r } =
|
|
2072
|
-
return /* @__PURE__ */ n(
|
|
2378
|
+
}, Pn = ({ children: e, className: t }) => {
|
|
2379
|
+
let { contentProps: r } = kn(), i = In(e);
|
|
2380
|
+
return /* @__PURE__ */ n(Fn, {
|
|
2073
2381
|
...r,
|
|
2074
2382
|
...i,
|
|
2075
2383
|
className: [r.className, t].filter(Boolean).join(" ")
|
|
2076
2384
|
});
|
|
2077
2385
|
};
|
|
2078
|
-
|
|
2079
|
-
var
|
|
2080
|
-
let V = g(null),
|
|
2386
|
+
Pn.__velliraSelectPart = "content", Pn.displayName = "Select.Content";
|
|
2387
|
+
var Fn = ({ 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...", emptyText: 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: B }) => {
|
|
2388
|
+
let V = g(null), ee = g(!1), [H, U] = _(null), [te, ne] = _(0), { bottomSpacerHeight: re, isVirtual: W, itemHeight: ie, startIndex: ae, topSpacerHeight: G, viewportHeight: oe, visibleOptions: se } = An({
|
|
2081
2389
|
loading: T,
|
|
2082
2390
|
options: c,
|
|
2083
2391
|
scrollTop: te,
|
|
@@ -2086,7 +2394,7 @@ var hn = ({ isOpen: e, listboxId: i, labelledById: a, setDropdownRef: o, style:
|
|
|
2086
2394
|
U(e), o(e);
|
|
2087
2395
|
}, [o]);
|
|
2088
2396
|
if (f(() => {
|
|
2089
|
-
e || (
|
|
2397
|
+
e || (ee.current = !1, ne(0));
|
|
2090
2398
|
}, [e, C]), f(() => {
|
|
2091
2399
|
if (!e || !v) return;
|
|
2092
2400
|
let t = window.setTimeout(() => {
|
|
@@ -2094,21 +2402,21 @@ var hn = ({ isOpen: e, listboxId: i, labelledById: a, setDropdownRef: o, style:
|
|
|
2094
2402
|
}, 0);
|
|
2095
2403
|
return () => window.clearTimeout(t);
|
|
2096
2404
|
}, [e, v]), f(() => {
|
|
2097
|
-
if (!e || T || !
|
|
2405
|
+
if (!e || T || !H || ee.current) return;
|
|
2098
2406
|
let t = c.findIndex((e) => p ? p.includes(e.value) : e.value === N), n = t >= 0 ? t : P;
|
|
2099
2407
|
if (n < 0) {
|
|
2100
|
-
|
|
2408
|
+
ee.current = !0;
|
|
2101
2409
|
return;
|
|
2102
2410
|
}
|
|
2103
|
-
if (
|
|
2104
|
-
let e = Math.max(0, n * ie - (
|
|
2105
|
-
ne(e),
|
|
2411
|
+
if (ee.current = !0, W) {
|
|
2412
|
+
let e = Math.max(0, n * ie - (oe - ie) / 2);
|
|
2413
|
+
ne(e), H.scrollTop = e;
|
|
2106
2414
|
return;
|
|
2107
2415
|
}
|
|
2108
2416
|
document.getElementById(`${i}-option-${n}`)?.scrollIntoView?.({ block: "nearest" });
|
|
2109
2417
|
}, [
|
|
2110
2418
|
P,
|
|
2111
|
-
|
|
2419
|
+
H,
|
|
2112
2420
|
e,
|
|
2113
2421
|
W,
|
|
2114
2422
|
ie,
|
|
@@ -2117,13 +2425,13 @@ var hn = ({ isOpen: e, listboxId: i, labelledById: a, setDropdownRef: o, style:
|
|
|
2117
2425
|
c,
|
|
2118
2426
|
N,
|
|
2119
2427
|
p,
|
|
2120
|
-
|
|
2428
|
+
oe
|
|
2121
2429
|
]), !e) return null;
|
|
2122
|
-
let
|
|
2430
|
+
let le = l && !W ? l : se.map((e, t) => ({
|
|
2123
2431
|
type: "option",
|
|
2124
2432
|
option: e,
|
|
2125
2433
|
optionIndex: ae + t
|
|
2126
|
-
})),
|
|
2434
|
+
})), K = /* @__PURE__ */ r("div", {
|
|
2127
2435
|
ref: ce,
|
|
2128
2436
|
tabIndex: 0,
|
|
2129
2437
|
className: [
|
|
@@ -2174,9 +2482,9 @@ var hn = ({ isOpen: e, listboxId: i, labelledById: a, setDropdownRef: o, style:
|
|
|
2174
2482
|
W && /* @__PURE__ */ n("li", {
|
|
2175
2483
|
"aria-hidden": "true",
|
|
2176
2484
|
className: Y.virtualSpacer,
|
|
2177
|
-
style: { height:
|
|
2485
|
+
style: { height: G }
|
|
2178
2486
|
}),
|
|
2179
|
-
|
|
2487
|
+
le.map((e) => {
|
|
2180
2488
|
if (e.type === "group") {
|
|
2181
2489
|
if (e.selectable && d) {
|
|
2182
2490
|
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;
|
|
@@ -2185,7 +2493,7 @@ var hn = ({ isOpen: e, listboxId: i, labelledById: a, setDropdownRef: o, style:
|
|
|
2185
2493
|
children: /* @__PURE__ */ r("button", {
|
|
2186
2494
|
type: "button",
|
|
2187
2495
|
className: Y.groupAction,
|
|
2188
|
-
"aria-label":
|
|
2496
|
+
"aria-label": Ln(e.selectLabel ?? e.label),
|
|
2189
2497
|
"aria-pressed": o ? "mixed" : a ? "true" : "false",
|
|
2190
2498
|
disabled: t.length === 0,
|
|
2191
2499
|
onClick: () => R(t),
|
|
@@ -2216,7 +2524,7 @@ var hn = ({ isOpen: e, listboxId: i, labelledById: a, setDropdownRef: o, style:
|
|
|
2216
2524
|
"data-vellira-select-separator": "true"
|
|
2217
2525
|
}, e.id);
|
|
2218
2526
|
let { option: t, optionIndex: a } = e;
|
|
2219
|
-
return /* @__PURE__ */ n(
|
|
2527
|
+
return /* @__PURE__ */ n(Nn, {
|
|
2220
2528
|
option: t,
|
|
2221
2529
|
isSelected: p ? p.includes(t.value) : t.value === N,
|
|
2222
2530
|
isActive: a === F,
|
|
@@ -2241,10 +2549,10 @@ var hn = ({ isOpen: e, listboxId: i, labelledById: a, setDropdownRef: o, style:
|
|
|
2241
2549
|
})
|
|
2242
2550
|
]
|
|
2243
2551
|
});
|
|
2244
|
-
return x ? /* @__PURE__ */ n(
|
|
2552
|
+
return x ? /* @__PURE__ */ n(Ce, { children: K }) : K;
|
|
2245
2553
|
};
|
|
2246
|
-
|
|
2247
|
-
function
|
|
2554
|
+
Fn.displayName = "SelectContentSurface";
|
|
2555
|
+
function In(e) {
|
|
2248
2556
|
let t, n, r, a;
|
|
2249
2557
|
return i.forEach(e, (e) => {
|
|
2250
2558
|
if (!l(e)) return;
|
|
@@ -2257,21 +2565,21 @@ function gn(e) {
|
|
|
2257
2565
|
searchSlot: n
|
|
2258
2566
|
};
|
|
2259
2567
|
}
|
|
2260
|
-
function
|
|
2568
|
+
function Ln(e) {
|
|
2261
2569
|
return typeof e == "string" || typeof e == "number" ? String(e) : "Select group";
|
|
2262
2570
|
}
|
|
2263
2571
|
//#endregion
|
|
2264
2572
|
//#region src/components/Select/Content/SelectEmpty.tsx
|
|
2265
|
-
var
|
|
2266
|
-
|
|
2573
|
+
var Rn = ({ children: e }) => /* @__PURE__ */ n(t, { children: e });
|
|
2574
|
+
Rn.__velliraSelectPart = "empty", Rn.displayName = "Select.Empty";
|
|
2267
2575
|
//#endregion
|
|
2268
2576
|
//#region src/components/Select/Content/SelectLoading.tsx
|
|
2269
|
-
var
|
|
2270
|
-
|
|
2577
|
+
var zn = ({ children: e }) => /* @__PURE__ */ n(t, { children: e });
|
|
2578
|
+
zn.__velliraSelectPart = "loading", zn.displayName = "Select.Loading";
|
|
2271
2579
|
//#endregion
|
|
2272
2580
|
//#region src/components/Select/Content/SelectSearch.tsx
|
|
2273
|
-
var
|
|
2274
|
-
let { contentProps: i } =
|
|
2581
|
+
var Bn = ({ placeholder: e, className: t }) => {
|
|
2582
|
+
let { contentProps: i } = kn(), a = g(null), o = i.searchValue ?? "";
|
|
2275
2583
|
return f(() => {
|
|
2276
2584
|
if (!i.isOpen) return;
|
|
2277
2585
|
let e = window.setTimeout(() => {
|
|
@@ -2282,7 +2590,7 @@ var bn = ({ placeholder: e, className: t }) => {
|
|
|
2282
2590
|
className: Y.searchWrap,
|
|
2283
2591
|
children: [/* @__PURE__ */ n("input", {
|
|
2284
2592
|
ref: a,
|
|
2285
|
-
className:
|
|
2593
|
+
className: I(Y.search, t),
|
|
2286
2594
|
value: o,
|
|
2287
2595
|
placeholder: e ?? (i.command ? "Type a command..." : "Search..."),
|
|
2288
2596
|
"aria-label": "Search options",
|
|
@@ -2299,38 +2607,38 @@ var bn = ({ placeholder: e, className: t }) => {
|
|
|
2299
2607
|
})]
|
|
2300
2608
|
});
|
|
2301
2609
|
};
|
|
2302
|
-
|
|
2610
|
+
Bn.__velliraSelectPart = "search", Bn.displayName = "Select.Search";
|
|
2303
2611
|
//#endregion
|
|
2304
2612
|
//#region src/components/Select/Group/SelectGroup.tsx
|
|
2305
|
-
var
|
|
2306
|
-
|
|
2613
|
+
var Vn = () => null;
|
|
2614
|
+
Vn.__velliraSelectPart = "group", Vn.displayName = "Select.Group";
|
|
2307
2615
|
//#endregion
|
|
2308
2616
|
//#region src/components/Select/Group/SelectLabel.tsx
|
|
2309
|
-
var
|
|
2617
|
+
var Hn = ({ children: e }) => /* @__PURE__ */ n("div", {
|
|
2310
2618
|
role: "presentation",
|
|
2311
2619
|
className: Y.groupLabel,
|
|
2312
2620
|
children: e
|
|
2313
2621
|
});
|
|
2314
|
-
|
|
2622
|
+
Hn.__velliraSelectPart = "label", Hn.displayName = "Select.Label";
|
|
2315
2623
|
//#endregion
|
|
2316
2624
|
//#region src/components/Select/Group/SelectSeparator.tsx
|
|
2317
|
-
var
|
|
2318
|
-
|
|
2625
|
+
var Un = () => null;
|
|
2626
|
+
Un.__velliraSelectPart = "separator", Un.displayName = "Select.Separator";
|
|
2319
2627
|
//#endregion
|
|
2320
2628
|
//#region src/components/Select/Item/SelectItemBadge.tsx
|
|
2321
|
-
var
|
|
2322
|
-
|
|
2629
|
+
var Wn = () => null;
|
|
2630
|
+
Wn.__velliraSelectPart = "itemBadge", Wn.displayName = "Select.ItemBadge";
|
|
2323
2631
|
//#endregion
|
|
2324
2632
|
//#region src/components/Select/Item/SelectItemDescription.tsx
|
|
2325
|
-
var
|
|
2326
|
-
|
|
2633
|
+
var Gn = () => null;
|
|
2634
|
+
Gn.__velliraSelectPart = "itemDescription", Gn.displayName = "Select.ItemDescription";
|
|
2327
2635
|
//#endregion
|
|
2328
2636
|
//#region src/components/Select/Item/SelectItemIcon.tsx
|
|
2329
|
-
var
|
|
2330
|
-
|
|
2637
|
+
var Kn = () => null;
|
|
2638
|
+
Kn.__velliraSelectPart = "itemIcon", Kn.displayName = "Select.ItemIcon";
|
|
2331
2639
|
//#endregion
|
|
2332
2640
|
//#region src/patterns/FormField/FormFieldContext.ts
|
|
2333
|
-
var
|
|
2641
|
+
var qn = s(null), Jn = () => d(qn), X = {
|
|
2334
2642
|
wrapper: "_wrapper_r078u_1",
|
|
2335
2643
|
sm: "_sm_r078u_41",
|
|
2336
2644
|
md: "_md_r078u_78",
|
|
@@ -2352,12 +2660,12 @@ var Dn = s(null), On = () => d(Dn), X = {
|
|
|
2352
2660
|
messageToneWarning: "_messageToneWarning_r078u_257",
|
|
2353
2661
|
messageToneDanger: "_messageToneDanger_r078u_261",
|
|
2354
2662
|
disabled: "_disabled_r078u_274"
|
|
2355
|
-
},
|
|
2356
|
-
function
|
|
2663
|
+
}, Yn = (...e) => e.filter(Boolean).join(" ") || void 0;
|
|
2664
|
+
function Xn(e, t) {
|
|
2357
2665
|
let n = () => null;
|
|
2358
2666
|
return n.__velliraFormFieldPart = e, n.displayName = t, n;
|
|
2359
2667
|
}
|
|
2360
|
-
function
|
|
2668
|
+
function Zn(e) {
|
|
2361
2669
|
let t = [], n = { hasSlots: !1 };
|
|
2362
2670
|
return i.forEach(e, (e) => {
|
|
2363
2671
|
if (!l(e)) {
|
|
@@ -2381,13 +2689,13 @@ function jn(e) {
|
|
|
2381
2689
|
}
|
|
2382
2690
|
}), t.length > 0 && (n.fallbackChildren = t.length === 1 ? t[0] : t), n;
|
|
2383
2691
|
}
|
|
2384
|
-
var
|
|
2385
|
-
let j =
|
|
2692
|
+
var Qn = ({ id: e, label: t, description: i, error: s, message: c, messageTone: u, messageLive: d, required: f = !1, disabled: m = !1, invalid: h = !1, orientation: g = "vertical", labelPosition: _ = "top", size: v = "md", labelInfo: y, labelAction: b, optionalText: x, children: S, bindControl: C = !0, className: w, controlClassName: T, labelClassName: E, descriptionClassName: D, errorClassName: O, messageClassName: k, ...A }) => {
|
|
2693
|
+
let j = Zn(S), M = t ?? j.label?.children, N = i ?? j.description?.children, P = c ?? j.message?.children, F = u ?? j.message?.tone ?? "neutral", L = d ?? j.message?.live ?? "off", R = y ?? j.label?.info, z = b ?? j.label?.action, B = x ?? j.label?.optionalText, V = j.hasSlots ? j.control?.children ?? j.fallbackChildren : S, ee = j.control?.bindControl ?? C, H = p(), U = e ?? H, te = M ? `${U}-label` : void 0, ne = N && U ? `${U}-description` : void 0, re = s && U ? `${U}-error` : void 0, W = !s && P && U ? `${U}-message` : void 0, ie = h || !!s, ae = s ?? P, G = s ? "danger" : F, oe = {
|
|
2386
2694
|
neutral: X.messageToneNeutral,
|
|
2387
2695
|
success: X.messageToneSuccess,
|
|
2388
2696
|
warning: X.messageToneWarning,
|
|
2389
2697
|
danger: X.messageToneDanger
|
|
2390
|
-
}[
|
|
2698
|
+
}[G], se = Yn(te), ce = Yn(ne, re, W), le = {
|
|
2391
2699
|
controlId: U,
|
|
2392
2700
|
labelId: te,
|
|
2393
2701
|
descriptionId: ne,
|
|
@@ -2399,18 +2707,18 @@ var Mn = ({ id: e, label: t, description: i, error: s, message: c, messageTone:
|
|
|
2399
2707
|
size: v,
|
|
2400
2708
|
ariaLabelledBy: se,
|
|
2401
2709
|
ariaDescribedBy: ce
|
|
2402
|
-
},
|
|
2403
|
-
id:
|
|
2404
|
-
required:
|
|
2405
|
-
disabled:
|
|
2406
|
-
"aria-invalid":
|
|
2407
|
-
"aria-labelledby":
|
|
2408
|
-
"aria-describedby":
|
|
2710
|
+
}, K = l(V) && V.type !== a ? V : void 0, ue = ee && K ? o(K, {
|
|
2711
|
+
id: K.props.id ?? U,
|
|
2712
|
+
required: K.props.required ?? f,
|
|
2713
|
+
disabled: K.props.disabled ?? m,
|
|
2714
|
+
"aria-invalid": K.props["aria-invalid"] ?? (ie || void 0),
|
|
2715
|
+
"aria-labelledby": Yn(K.props["aria-labelledby"], se),
|
|
2716
|
+
"aria-describedby": Yn(K.props["aria-describedby"], ce)
|
|
2409
2717
|
}) : V;
|
|
2410
2718
|
return /* @__PURE__ */ r("div", {
|
|
2411
2719
|
...A,
|
|
2412
2720
|
"aria-disabled": m || void 0,
|
|
2413
|
-
className:
|
|
2721
|
+
className: I(X.wrapper, X[g], X[_], X[v], m && X.disabled, w),
|
|
2414
2722
|
"data-disabled": m || void 0,
|
|
2415
2723
|
"data-invalid": ie || void 0,
|
|
2416
2724
|
"data-orientation": g,
|
|
@@ -2421,7 +2729,7 @@ var Mn = ({ id: e, label: t, description: i, error: s, message: c, messageTone:
|
|
|
2421
2729
|
children: [M && /* @__PURE__ */ r("label", {
|
|
2422
2730
|
id: te,
|
|
2423
2731
|
htmlFor: U,
|
|
2424
|
-
className:
|
|
2732
|
+
className: I(X.label, j.label?.className, E),
|
|
2425
2733
|
children: [
|
|
2426
2734
|
/* @__PURE__ */ n("span", {
|
|
2427
2735
|
className: X.labelText,
|
|
@@ -2448,42 +2756,42 @@ var Mn = ({ id: e, label: t, description: i, error: s, message: c, messageTone:
|
|
|
2448
2756
|
}),
|
|
2449
2757
|
N && /* @__PURE__ */ n("div", {
|
|
2450
2758
|
id: ne,
|
|
2451
|
-
className:
|
|
2759
|
+
className: I(X.description, j.description?.className, D),
|
|
2452
2760
|
children: N
|
|
2453
2761
|
}),
|
|
2454
|
-
/* @__PURE__ */ n(
|
|
2455
|
-
value:
|
|
2762
|
+
/* @__PURE__ */ n(qn.Provider, {
|
|
2763
|
+
value: le,
|
|
2456
2764
|
children: /* @__PURE__ */ n("div", {
|
|
2457
|
-
className:
|
|
2765
|
+
className: I(X.control, j.control?.className, T),
|
|
2458
2766
|
children: ue
|
|
2459
2767
|
})
|
|
2460
2768
|
}),
|
|
2461
2769
|
ae && /* @__PURE__ */ n("div", {
|
|
2462
2770
|
id: s ? re : W,
|
|
2463
|
-
className:
|
|
2771
|
+
className: I(X.message, oe, !s && j.message?.className, s ? O : k),
|
|
2464
2772
|
role: s ? "alert" : void 0,
|
|
2465
2773
|
"aria-live": !s && L === "polite" ? "polite" : void 0,
|
|
2466
2774
|
children: ae
|
|
2467
2775
|
})
|
|
2468
2776
|
]
|
|
2469
2777
|
});
|
|
2470
|
-
},
|
|
2471
|
-
Label:
|
|
2472
|
-
Description:
|
|
2473
|
-
Control:
|
|
2474
|
-
Message:
|
|
2778
|
+
}, $n = Xn("label", "FormField.Label"), er = Xn("description", "FormField.Description"), tr = Xn("control", "FormField.Control"), nr = Xn("message", "FormField.Message"), rr = Object.assign(Qn, {
|
|
2779
|
+
Label: $n,
|
|
2780
|
+
Description: er,
|
|
2781
|
+
Control: tr,
|
|
2782
|
+
Message: nr,
|
|
2475
2783
|
displayName: "FormField"
|
|
2476
2784
|
});
|
|
2477
2785
|
//#endregion
|
|
2478
2786
|
//#region src/components/Select/internal/SelectCollection.ts
|
|
2479
|
-
function
|
|
2787
|
+
function ir(e) {
|
|
2480
2788
|
let t = [], n = [], r = 0;
|
|
2481
2789
|
function a(e) {
|
|
2482
2790
|
i.forEach(e, (e) => {
|
|
2483
2791
|
if (!l(e)) return;
|
|
2484
2792
|
let i = e.type;
|
|
2485
2793
|
if (i.__velliraSelectPart === "group") {
|
|
2486
|
-
let n = e.props, i =
|
|
2794
|
+
let n = e.props, i = or(n.children);
|
|
2487
2795
|
t.push({
|
|
2488
2796
|
type: "group",
|
|
2489
2797
|
id: `group-${r++}`,
|
|
@@ -2495,7 +2803,7 @@ function Rn(e) {
|
|
|
2495
2803
|
return;
|
|
2496
2804
|
}
|
|
2497
2805
|
if (i.__velliraSelectPart === "item") {
|
|
2498
|
-
let r = e.props, i =
|
|
2806
|
+
let r = e.props, i = sr(r.children, r.value), a = r.label ?? i.label, o = n.length, s = {
|
|
2499
2807
|
label: a,
|
|
2500
2808
|
value: r.value,
|
|
2501
2809
|
disabled: r.disabled,
|
|
@@ -2527,7 +2835,7 @@ function Rn(e) {
|
|
|
2527
2835
|
options: n
|
|
2528
2836
|
};
|
|
2529
2837
|
}
|
|
2530
|
-
function
|
|
2838
|
+
function ar(e) {
|
|
2531
2839
|
let t = !1;
|
|
2532
2840
|
function n(e) {
|
|
2533
2841
|
i.forEach(e, (e) => {
|
|
@@ -2542,7 +2850,7 @@ function zn(e) {
|
|
|
2542
2850
|
}
|
|
2543
2851
|
return n(e), t;
|
|
2544
2852
|
}
|
|
2545
|
-
function
|
|
2853
|
+
function or(e) {
|
|
2546
2854
|
let t = [];
|
|
2547
2855
|
function n(e) {
|
|
2548
2856
|
i.forEach(e, (e) => {
|
|
@@ -2557,7 +2865,7 @@ function Bn(e) {
|
|
|
2557
2865
|
}
|
|
2558
2866
|
return n(e), t;
|
|
2559
2867
|
}
|
|
2560
|
-
function
|
|
2868
|
+
function sr(e, t) {
|
|
2561
2869
|
let n, r, a, o = [];
|
|
2562
2870
|
function s(e) {
|
|
2563
2871
|
i.forEach(e, (e) => {
|
|
@@ -2593,13 +2901,13 @@ function Vn(e, t) {
|
|
|
2593
2901
|
}
|
|
2594
2902
|
//#endregion
|
|
2595
2903
|
//#region src/components/Select/internal/useSelectCollection.ts
|
|
2596
|
-
function
|
|
2597
|
-
return h(() =>
|
|
2904
|
+
function cr(e) {
|
|
2905
|
+
return h(() => ir(e), [e]);
|
|
2598
2906
|
}
|
|
2599
2907
|
//#endregion
|
|
2600
2908
|
//#region src/components/Select/internal/useSelectPosition.ts
|
|
2601
|
-
function
|
|
2602
|
-
return
|
|
2909
|
+
function lr({ avoidCollisions: e, isOpen: t, matchTriggerWidth: n, onOpenChange: r, placement: i }) {
|
|
2910
|
+
return nt({
|
|
2603
2911
|
open: t,
|
|
2604
2912
|
onOpenChange: r,
|
|
2605
2913
|
placement: i === "bottom" || i === "top" ? `${i}-start` : i,
|
|
@@ -2610,18 +2918,18 @@ function Un({ avoidCollisions: e, isOpen: t, matchTriggerWidth: n, onOpenChange:
|
|
|
2610
2918
|
}
|
|
2611
2919
|
//#endregion
|
|
2612
2920
|
//#region src/components/Select/internal/useSelectSearch.ts
|
|
2613
|
-
function
|
|
2921
|
+
function ur({ options: e, searchable: t, searchValue: n }) {
|
|
2614
2922
|
return h(() => {
|
|
2615
2923
|
if (!t || !n) return e;
|
|
2616
2924
|
let r = n.toLocaleLowerCase();
|
|
2617
|
-
return e.filter((e) => `${e.label} ${
|
|
2925
|
+
return e.filter((e) => `${e.label} ${dr(e.description)}`.toLocaleLowerCase().includes(r));
|
|
2618
2926
|
}, [
|
|
2619
2927
|
e,
|
|
2620
2928
|
n,
|
|
2621
2929
|
t
|
|
2622
2930
|
]);
|
|
2623
2931
|
}
|
|
2624
|
-
function
|
|
2932
|
+
function dr(e) {
|
|
2625
2933
|
return typeof e == "string" || typeof e == "number" ? String(e) : "";
|
|
2626
2934
|
}
|
|
2627
2935
|
var Z = {
|
|
@@ -2650,16 +2958,16 @@ var Z = {
|
|
|
2650
2958
|
spin: "_spin_ao6y1_795",
|
|
2651
2959
|
loading: "_loading_ao6y1_804",
|
|
2652
2960
|
open: "_open_ao6y1_823"
|
|
2653
|
-
},
|
|
2654
|
-
let { triggerProps: r } =
|
|
2655
|
-
return /* @__PURE__ */ n(
|
|
2961
|
+
}, fr = ({ children: e, className: t }) => {
|
|
2962
|
+
let { triggerProps: r } = kn();
|
|
2963
|
+
return /* @__PURE__ */ n(pr, {
|
|
2656
2964
|
...r,
|
|
2657
2965
|
className: [r.className, t].filter(Boolean).join(" "),
|
|
2658
2966
|
children: e
|
|
2659
2967
|
});
|
|
2660
2968
|
};
|
|
2661
|
-
|
|
2662
|
-
var
|
|
2969
|
+
fr.__velliraSelectPart = "trigger", fr.displayName = "Select.Trigger";
|
|
2970
|
+
var pr = ({ children: e, id: i, describedBy: a, labelledBy: o, isOpen: s, disabled: c, required: l, listboxId: u, activeIndex: d, ariaLabel: f, error: p, displayText: m, isPlaceholder: h, size: g = "md", color: _, variant: v, loading: y, startIcon: x, endIcon: C, prefix: w, suffix: T, clearable: E, onClear: D, className: O, buttonRef: k, onClick: A, onKeyDown: j, onBlur: M, onFocus: N }) => /* @__PURE__ */ n("button", {
|
|
2663
2971
|
id: i,
|
|
2664
2972
|
ref: k,
|
|
2665
2973
|
type: "button",
|
|
@@ -2675,7 +2983,7 @@ var qn = ({ children: e, id: i, describedBy: a, labelledBy: o, isOpen: s, disabl
|
|
|
2675
2983
|
"aria-controls": s ? u : void 0,
|
|
2676
2984
|
"aria-describedby": a,
|
|
2677
2985
|
"aria-activedescendant": s && d >= 0 ? `${u}-option-${d}` : void 0,
|
|
2678
|
-
className:
|
|
2986
|
+
className: I(Z.control, Z[g], Z[v], Z[_], {
|
|
2679
2987
|
[Z.error]: !!p,
|
|
2680
2988
|
[Z.disabled]: c,
|
|
2681
2989
|
[Z.loading]: y
|
|
@@ -2696,7 +3004,7 @@ var qn = ({ children: e, id: i, describedBy: a, labelledBy: o, isOpen: s, disabl
|
|
|
2696
3004
|
/* @__PURE__ */ n("span", {
|
|
2697
3005
|
className: Z.valueWrap,
|
|
2698
3006
|
children: /* @__PURE__ */ n("span", {
|
|
2699
|
-
className:
|
|
3007
|
+
className: I(Z.value, { [Z.placeholder]: h }),
|
|
2700
3008
|
children: m
|
|
2701
3009
|
})
|
|
2702
3010
|
}),
|
|
@@ -2715,26 +3023,26 @@ var qn = ({ children: e, id: i, describedBy: a, labelledBy: o, isOpen: s, disabl
|
|
|
2715
3023
|
children: /* @__PURE__ */ n(S, {})
|
|
2716
3024
|
}),
|
|
2717
3025
|
/* @__PURE__ */ n("span", {
|
|
2718
|
-
className:
|
|
3026
|
+
className: I(Z.arrow, { [Z.open]: s }),
|
|
2719
3027
|
"aria-hidden": "true",
|
|
2720
3028
|
children: y ? /* @__PURE__ */ n("span", { className: Z.spinner }) : C ?? /* @__PURE__ */ n(b, {})
|
|
2721
3029
|
})
|
|
2722
3030
|
] })
|
|
2723
3031
|
});
|
|
2724
|
-
|
|
3032
|
+
pr.displayName = "SelectTriggerSurface";
|
|
2725
3033
|
//#endregion
|
|
2726
3034
|
//#region src/components/Select/Root/SelectRoot.tsx
|
|
2727
|
-
var
|
|
2728
|
-
let he = p(), ge =
|
|
3035
|
+
var mr = ({ 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...", size: E, color: D = "primary", variant: O = "outline", required: k = !1, disabled: A = !1, invalid: j = !1, loading: M = !1, clearable: N = !1, searchable: P = !1, virtual: F, modal: I = !1, command: L = !1, error: R, placement: z = "bottom", matchTriggerWidth: B = !0, avoidCollisions: V = !0, portal: ee = !0, open: H, defaultOpen: U = !1, onOpenChange: te, onSearch: ne, onClear: re, startIcon: W, endIcon: ie, prefix: ae, suffix: G, renderValue: se, renderOption: ce, onBlur: K, onFocus: ue, className: de, triggerClassName: pe, dropdownClassName: me }) => {
|
|
3036
|
+
let he = p(), ge = Jn(), _e = !!(i || a || R), ve = o ?? (_e ? void 0 : ge?.controlId) ?? he, be = `${ve}-listbox`, [xe, Se] = _(""), Ce = !!R, we = Ce ? `${ve}-error` : void 0, Te = a ? `${ve}-description` : void 0, Ee = E ?? ge?.size ?? "md", De = j || Ce || !_e && !!ge?.invalid, Oe = A || !_e && !!ge?.disabled, ke = k || !_e && !!ge?.required, Ae = [
|
|
2729
3037
|
l,
|
|
2730
3038
|
!_e && !l ? ge?.ariaDescribedBy : void 0,
|
|
2731
3039
|
Te,
|
|
2732
3040
|
we
|
|
2733
|
-
].filter(Boolean).join(" "), je = g(null), Me = g(null), [Ne, Pe] = _(!1),
|
|
3041
|
+
].filter(Boolean).join(" "), je = g(null), Me = g(null), [Ne, Pe] = _(!1), Fe = P || L, { entries: q, options: Ie } = cr(e), Le = ur({
|
|
2734
3042
|
options: Ie,
|
|
2735
|
-
searchable:
|
|
3043
|
+
searchable: Fe,
|
|
2736
3044
|
searchValue: xe
|
|
2737
|
-
}), { selectedValue: Re, selectedValues: ze, isOpen: Be, setIsOpen: Ve, setSelectedValue: He, activeIndex: Ue, setActiveIndex: We, closeDropdown: Ge, toggleDropdown: Ke, selectValue: qe, onKeyDown: Je } =
|
|
3045
|
+
}), { selectedValue: Re, selectedValues: ze, isOpen: Be, setIsOpen: Ve, setSelectedValue: He, activeIndex: Ue, setActiveIndex: We, closeDropdown: Ge, toggleDropdown: Ke, selectValue: qe, onKeyDown: Je } = ye({
|
|
2738
3046
|
value: m,
|
|
2739
3047
|
defaultValue: v,
|
|
2740
3048
|
onValueChange: y,
|
|
@@ -2743,10 +3051,10 @@ var Jn = ({ children: e, label: i, description: a, id: o, name: s, "aria-label":
|
|
|
2743
3051
|
maxSelected: x,
|
|
2744
3052
|
closeOnSelect: S,
|
|
2745
3053
|
disabled: Oe,
|
|
2746
|
-
open:
|
|
3054
|
+
open: H,
|
|
2747
3055
|
defaultOpen: U,
|
|
2748
3056
|
onOpenChange: te
|
|
2749
|
-
}), Ye = h(() => Ie.find((e) => ze.includes(e.value)), [Ie, ze]), Xe = h(() => Ie.filter((e) => ze.includes(e.value)), [Ie, ze]), Ze = !!Ye, Qe = Array.isArray(Re) ? Re[0] ?? "" : Re, { floatingStyles: $e, setRef: et, setFloatingRef: tt } =
|
|
3057
|
+
}), Ye = h(() => Ie.find((e) => ze.includes(e.value)), [Ie, ze]), Xe = h(() => Ie.filter((e) => ze.includes(e.value)), [Ie, ze]), Ze = !!Ye, Qe = Array.isArray(Re) ? Re[0] ?? "" : Re, { floatingStyles: $e, setRef: et, setFloatingRef: tt } = lr({
|
|
2750
3058
|
isOpen: Be,
|
|
2751
3059
|
onOpenChange: Ve,
|
|
2752
3060
|
placement: z,
|
|
@@ -2780,12 +3088,12 @@ var Jn = ({ children: e, label: i, description: a, id: o, name: s, "aria-label":
|
|
|
2780
3088
|
}, [re, qe]), at = u(() => {
|
|
2781
3089
|
Be || Pe(!1), Ke();
|
|
2782
3090
|
}, [Be, Ke]), ot = u((e) => {
|
|
2783
|
-
|
|
3091
|
+
hr(e, Be) && Pe(!0), Je(e);
|
|
2784
3092
|
}, [Be, Je]), st = u((e) => {
|
|
2785
3093
|
Pe(!0), We(e);
|
|
2786
3094
|
}, [We]), ct = u((e) => {
|
|
2787
3095
|
Se(e), ne?.(e);
|
|
2788
|
-
}, [ne]), { isTopOverlay: lt } =
|
|
3096
|
+
}, [ne]), { isTopOverlay: lt } = le({
|
|
2789
3097
|
active: Be,
|
|
2790
3098
|
id: be
|
|
2791
3099
|
});
|
|
@@ -2801,7 +3109,7 @@ var Jn = ({ children: e, label: i, description: a, id: o, name: s, "aria-label":
|
|
|
2801
3109
|
Be || Pe(!1);
|
|
2802
3110
|
}, [Be]), f(() => {
|
|
2803
3111
|
!Be && xe && Se("");
|
|
2804
|
-
}, [Be, xe]),
|
|
3112
|
+
}, [Be, xe]), fe({
|
|
2805
3113
|
active: Be,
|
|
2806
3114
|
enabled: I
|
|
2807
3115
|
});
|
|
@@ -2810,7 +3118,7 @@ var Jn = ({ children: e, label: i, description: a, id: o, name: s, "aria-label":
|
|
|
2810
3118
|
}, [et]), dt = u((e) => {
|
|
2811
3119
|
Me.current = e, tt(e);
|
|
2812
3120
|
}, [tt]), ft = se ? se(Ye) : b && Xe.length ? Xe.map((e) => e.label).join(", ") : Ye?.label ?? C, pt = w ?? "No options available", mt = N && ze.length > 0 && !Oe && !M, ht = {
|
|
2813
|
-
id:
|
|
3121
|
+
id: ve,
|
|
2814
3122
|
describedBy: Ae || void 0,
|
|
2815
3123
|
labelledBy: c ? void 0 : d,
|
|
2816
3124
|
isOpen: Be,
|
|
@@ -2836,27 +3144,27 @@ var Jn = ({ children: e, label: i, description: a, id: o, name: s, "aria-label":
|
|
|
2836
3144
|
onClear: it,
|
|
2837
3145
|
onClick: at,
|
|
2838
3146
|
onKeyDown: ot,
|
|
2839
|
-
onBlur:
|
|
3147
|
+
onBlur: K,
|
|
2840
3148
|
onFocus: ue
|
|
2841
3149
|
}, gt = {
|
|
2842
3150
|
isOpen: Be,
|
|
2843
3151
|
listboxId: be,
|
|
2844
|
-
labelledById:
|
|
3152
|
+
labelledById: ve,
|
|
2845
3153
|
style: $e,
|
|
2846
3154
|
options: Le,
|
|
2847
|
-
entries:
|
|
3155
|
+
entries: Fe || xe ? void 0 : q,
|
|
2848
3156
|
multiple: b,
|
|
2849
3157
|
color: D,
|
|
2850
3158
|
variant: O,
|
|
2851
|
-
searchable:
|
|
3159
|
+
searchable: Fe,
|
|
2852
3160
|
command: L,
|
|
2853
3161
|
virtual: F,
|
|
2854
|
-
portal:
|
|
3162
|
+
portal: ee,
|
|
2855
3163
|
searchValue: xe,
|
|
2856
3164
|
loading: M,
|
|
2857
3165
|
loadingText: T,
|
|
2858
3166
|
emptyText: pt,
|
|
2859
|
-
renderOption:
|
|
3167
|
+
renderOption: ce,
|
|
2860
3168
|
selectedValue: Qe,
|
|
2861
3169
|
selectedValues: ze,
|
|
2862
3170
|
activeIndex: Ue,
|
|
@@ -2877,94 +3185,94 @@ var Jn = ({ children: e, label: i, description: a, id: o, name: s, "aria-label":
|
|
|
2877
3185
|
name: s,
|
|
2878
3186
|
value: Qe,
|
|
2879
3187
|
disabled: Oe
|
|
2880
|
-
})] }), vt =
|
|
3188
|
+
})] }), vt = ar(e), yt = /* @__PURE__ */ r(On, {
|
|
2881
3189
|
value: {
|
|
2882
3190
|
triggerProps: ht,
|
|
2883
3191
|
contentProps: gt
|
|
2884
3192
|
},
|
|
2885
|
-
children: [_t, vt ? e : /* @__PURE__ */ r(t, { children: [/* @__PURE__ */ n(
|
|
2886
|
-
}), bt = /* @__PURE__ */ r(
|
|
3193
|
+
children: [_t, vt ? e : /* @__PURE__ */ r(t, { children: [/* @__PURE__ */ n(fr, {}), /* @__PURE__ */ n(Pn, { children: e })] })]
|
|
3194
|
+
}), bt = /* @__PURE__ */ r(On, {
|
|
2887
3195
|
value: {
|
|
2888
3196
|
triggerProps: ht,
|
|
2889
3197
|
contentProps: gt
|
|
2890
3198
|
},
|
|
2891
3199
|
children: [
|
|
2892
3200
|
_t,
|
|
2893
|
-
/* @__PURE__ */ n(
|
|
2894
|
-
/* @__PURE__ */ n(
|
|
3201
|
+
/* @__PURE__ */ n(pr, { ...ht }),
|
|
3202
|
+
/* @__PURE__ */ n(Fn, { ...gt })
|
|
2895
3203
|
]
|
|
2896
3204
|
});
|
|
2897
|
-
return !_e && ge ? e ? yt : bt : /* @__PURE__ */ n(
|
|
2898
|
-
id:
|
|
3205
|
+
return !_e && ge ? e ? yt : bt : /* @__PURE__ */ n(rr, {
|
|
3206
|
+
id: ve,
|
|
2899
3207
|
label: i,
|
|
2900
3208
|
description: a,
|
|
2901
3209
|
error: R,
|
|
2902
3210
|
required: ke,
|
|
2903
3211
|
disabled: Oe,
|
|
2904
3212
|
bindControl: !1,
|
|
2905
|
-
className:
|
|
3213
|
+
className: de,
|
|
2906
3214
|
children: e ? yt : bt
|
|
2907
3215
|
});
|
|
2908
3216
|
};
|
|
2909
|
-
|
|
2910
|
-
function
|
|
3217
|
+
mr.displayName = "SelectRoot";
|
|
3218
|
+
function hr(e, t) {
|
|
2911
3219
|
return e.altKey || e.ctrlKey || e.metaKey ? !1 : t ? e.key === "ArrowDown" || e.key === "ArrowUp" || e.key === "Home" || e.key === "End" || e.key === "Enter" || e.key === " " || e.key.length === 1 : e.key === "ArrowDown" || e.key === "ArrowUp" || e.key === "Enter" || e.key === " ";
|
|
2912
3220
|
}
|
|
2913
3221
|
//#endregion
|
|
2914
3222
|
//#region src/components/Select/Trigger/SelectIcon.tsx
|
|
2915
|
-
var
|
|
2916
|
-
let { triggerProps: r } =
|
|
3223
|
+
var gr = ({ children: e, className: t }) => {
|
|
3224
|
+
let { triggerProps: r } = kn();
|
|
2917
3225
|
return /* @__PURE__ */ n("span", {
|
|
2918
|
-
className:
|
|
3226
|
+
className: I(Z.arrow, { [Z.open]: r.isOpen }, t),
|
|
2919
3227
|
"aria-hidden": "true",
|
|
2920
3228
|
children: r.loading ? /* @__PURE__ */ n("span", { className: Z.spinner }) : e ?? r.endIcon ?? /* @__PURE__ */ n(b, {})
|
|
2921
3229
|
});
|
|
2922
3230
|
};
|
|
2923
|
-
|
|
3231
|
+
gr.__velliraSelectPart = "icon", gr.displayName = "Select.Icon";
|
|
2924
3232
|
//#endregion
|
|
2925
3233
|
//#region src/components/Select/Trigger/SelectValue.tsx
|
|
2926
|
-
var
|
|
2927
|
-
let { triggerProps: r } =
|
|
3234
|
+
var _r = ({ children: e, className: t }) => {
|
|
3235
|
+
let { triggerProps: r } = kn();
|
|
2928
3236
|
return /* @__PURE__ */ n("span", {
|
|
2929
|
-
className:
|
|
3237
|
+
className: I(Z.valueWrap, t),
|
|
2930
3238
|
children: /* @__PURE__ */ n("span", {
|
|
2931
|
-
className:
|
|
3239
|
+
className: I(Z.value, { [Z.placeholder]: r.isPlaceholder }),
|
|
2932
3240
|
children: e ?? r.displayText
|
|
2933
3241
|
})
|
|
2934
3242
|
});
|
|
2935
3243
|
};
|
|
2936
|
-
|
|
3244
|
+
_r.__velliraSelectPart = "value", _r.displayName = "Select.Value";
|
|
2937
3245
|
//#endregion
|
|
2938
3246
|
//#region src/components/Select/Select.tsx
|
|
2939
|
-
var
|
|
2940
|
-
Trigger:
|
|
2941
|
-
Value:
|
|
2942
|
-
Icon:
|
|
2943
|
-
Content:
|
|
2944
|
-
Search:
|
|
2945
|
-
Group:
|
|
2946
|
-
Label:
|
|
2947
|
-
Item:
|
|
2948
|
-
ItemIcon:
|
|
2949
|
-
ItemDescription:
|
|
2950
|
-
ItemBadge:
|
|
2951
|
-
Separator:
|
|
2952
|
-
Empty:
|
|
2953
|
-
Loading:
|
|
3247
|
+
var vr = Object.assign(mr, {
|
|
3248
|
+
Trigger: fr,
|
|
3249
|
+
Value: _r,
|
|
3250
|
+
Icon: gr,
|
|
3251
|
+
Content: Pn,
|
|
3252
|
+
Search: Bn,
|
|
3253
|
+
Group: Vn,
|
|
3254
|
+
Label: Hn,
|
|
3255
|
+
Item: Mn,
|
|
3256
|
+
ItemIcon: Kn,
|
|
3257
|
+
ItemDescription: Gn,
|
|
3258
|
+
ItemBadge: Wn,
|
|
3259
|
+
Separator: Un,
|
|
3260
|
+
Empty: Rn,
|
|
3261
|
+
Loading: zn
|
|
2954
3262
|
});
|
|
2955
|
-
|
|
3263
|
+
vr.displayName = "Select";
|
|
2956
3264
|
//#endregion
|
|
2957
3265
|
//#region src/components/Tabs/internal/TabsContext.tsx
|
|
2958
|
-
var
|
|
2959
|
-
let e = d(
|
|
3266
|
+
var yr = s(null), br = () => {
|
|
3267
|
+
let e = d(yr);
|
|
2960
3268
|
if (!e) throw Error("Tabs components must be used inside Tabs");
|
|
2961
3269
|
return e;
|
|
2962
|
-
},
|
|
3270
|
+
}, xr = {
|
|
2963
3271
|
panel: "_panel_1v1a9_1",
|
|
2964
3272
|
visible: "_visible_1v1a9_10",
|
|
2965
3273
|
vertical: "_vertical_1v1a9_14"
|
|
2966
|
-
},
|
|
2967
|
-
let { value: o, orientation: s, keepMounted: c, lazyMount: l, registerContent: u, getTriggerId: d, getContentId: p } =
|
|
3274
|
+
}, Sr = ({ value: e, children: t, className: r, forceMount: i = !1, ...a }) => {
|
|
3275
|
+
let { value: o, orientation: s, keepMounted: c, lazyMount: l, registerContent: u, getTriggerId: d, getContentId: p } = br(), m = o === e, [h, g] = _(m);
|
|
2968
3276
|
return f(() => (u(e, !0), () => {
|
|
2969
3277
|
u(e, !1);
|
|
2970
3278
|
}), [u, e]), f(() => {
|
|
@@ -2978,15 +3286,15 @@ var $n = s(null), er = () => {
|
|
|
2978
3286
|
tabIndex: 0,
|
|
2979
3287
|
"data-state": m ? "active" : "inactive",
|
|
2980
3288
|
"data-orientation": s,
|
|
2981
|
-
className:
|
|
3289
|
+
className: I(xr.panel, m && xr.visible, s === "vertical" && xr.vertical, r),
|
|
2982
3290
|
children: t
|
|
2983
3291
|
}) : null;
|
|
2984
3292
|
};
|
|
2985
|
-
|
|
3293
|
+
Sr.displayName = "Tabs.Content";
|
|
2986
3294
|
//#endregion
|
|
2987
3295
|
//#region src/components/Tabs/internal/useTabsIndicator.ts
|
|
2988
|
-
var
|
|
2989
|
-
let e = g(null), t = g(null), n = g(void 0), r = g(null), [i, a] = _({}), { value: o, orientation: s, variant: c, collectionVersion: l, getTriggerId: u } =
|
|
3296
|
+
var Cr = 8, wr = 360, Tr = () => {
|
|
3297
|
+
let e = g(null), t = g(null), n = g(void 0), r = g(null), [i, a] = _({}), { value: o, orientation: s, variant: c, collectionVersion: l, getTriggerId: u } = br();
|
|
2990
3298
|
return f(() => () => {
|
|
2991
3299
|
r.current?.cancel();
|
|
2992
3300
|
}, []), m(() => {
|
|
@@ -3022,7 +3330,7 @@ var rr = 8, ir = 360, ar = () => {
|
|
|
3022
3330
|
let s = t.current;
|
|
3023
3331
|
if (e && c === "line" && s && n.current !== o && !(typeof window.matchMedia == "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches) && typeof i.animate == "function") {
|
|
3024
3332
|
r.current?.cancel();
|
|
3025
|
-
let e = s.y + s.height / 2, t = p.y + p.height / 2, n = e -
|
|
3333
|
+
let e = s.y + s.height / 2, t = p.y + p.height / 2, n = e - Cr / 2, a = t - Cr / 2;
|
|
3026
3334
|
r.current = i.animate([
|
|
3027
3335
|
{
|
|
3028
3336
|
height: `${s.height}px`,
|
|
@@ -3030,12 +3338,12 @@ var rr = 8, ir = 360, ar = () => {
|
|
|
3030
3338
|
offset: 0
|
|
3031
3339
|
},
|
|
3032
3340
|
{
|
|
3033
|
-
height: `${
|
|
3341
|
+
height: `${Cr}px`,
|
|
3034
3342
|
transform: `translate3d(0, ${n}px, 0)`,
|
|
3035
3343
|
offset: .28
|
|
3036
3344
|
},
|
|
3037
3345
|
{
|
|
3038
|
-
height: `${
|
|
3346
|
+
height: `${Cr}px`,
|
|
3039
3347
|
transform: `translate3d(0, ${a}px, 0)`,
|
|
3040
3348
|
offset: .64
|
|
3041
3349
|
},
|
|
@@ -3045,7 +3353,7 @@ var rr = 8, ir = 360, ar = () => {
|
|
|
3045
3353
|
offset: 1
|
|
3046
3354
|
}
|
|
3047
3355
|
], {
|
|
3048
|
-
duration:
|
|
3356
|
+
duration: wr,
|
|
3049
3357
|
easing: "cubic-bezier(0.22, 1, 0.36, 1)",
|
|
3050
3358
|
fill: "none"
|
|
3051
3359
|
});
|
|
@@ -3061,7 +3369,7 @@ var rr = 8, ir = 360, ar = () => {
|
|
|
3061
3369
|
let h = t.current;
|
|
3062
3370
|
if (e && c === "line" && h && n.current !== o && !(typeof window.matchMedia == "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches) && typeof i.animate == "function") {
|
|
3063
3371
|
r.current?.cancel();
|
|
3064
|
-
let e = h.x + h.width / 2, t = p.x + p.width / 2, n = e -
|
|
3372
|
+
let e = h.x + h.width / 2, t = p.x + p.width / 2, n = e - Cr / 2, a = t - Cr / 2;
|
|
3065
3373
|
r.current = i.animate([
|
|
3066
3374
|
{
|
|
3067
3375
|
width: `${h.width}px`,
|
|
@@ -3069,12 +3377,12 @@ var rr = 8, ir = 360, ar = () => {
|
|
|
3069
3377
|
offset: 0
|
|
3070
3378
|
},
|
|
3071
3379
|
{
|
|
3072
|
-
width: `${
|
|
3380
|
+
width: `${Cr}px`,
|
|
3073
3381
|
transform: `translate3d(${n}px, 0, 0)`,
|
|
3074
3382
|
offset: .28
|
|
3075
3383
|
},
|
|
3076
3384
|
{
|
|
3077
|
-
width: `${
|
|
3385
|
+
width: `${Cr}px`,
|
|
3078
3386
|
transform: `translate3d(${a}px, 0, 0)`,
|
|
3079
3387
|
offset: .64
|
|
3080
3388
|
},
|
|
@@ -3084,7 +3392,7 @@ var rr = 8, ir = 360, ar = () => {
|
|
|
3084
3392
|
offset: 1
|
|
3085
3393
|
}
|
|
3086
3394
|
], {
|
|
3087
|
-
duration:
|
|
3395
|
+
duration: wr,
|
|
3088
3396
|
easing: "cubic-bezier(0.22, 1, 0.36, 1)",
|
|
3089
3397
|
fill: "none"
|
|
3090
3398
|
});
|
|
@@ -3112,7 +3420,7 @@ var rr = 8, ir = 360, ar = () => {
|
|
|
3112
3420
|
ref: e,
|
|
3113
3421
|
style: i
|
|
3114
3422
|
}), [i]);
|
|
3115
|
-
},
|
|
3423
|
+
}, Er = {
|
|
3116
3424
|
list: "_list_j3cp3_1",
|
|
3117
3425
|
vertical: "_vertical_j3cp3_10",
|
|
3118
3426
|
line: "_line_j3cp3_17",
|
|
@@ -3120,24 +3428,24 @@ var rr = 8, ir = 360, ar = () => {
|
|
|
3120
3428
|
segmented: "_segmented_j3cp3_29",
|
|
3121
3429
|
scrollable: "_scrollable_j3cp3_37",
|
|
3122
3430
|
indicator: "_indicator_j3cp3_46"
|
|
3123
|
-
},
|
|
3124
|
-
let { ref: i, style: a } =
|
|
3431
|
+
}, Dr = ({ className: e, style: t, ...r }) => {
|
|
3432
|
+
let { ref: i, style: a } = Tr();
|
|
3125
3433
|
return /* @__PURE__ */ n("span", {
|
|
3126
3434
|
...r,
|
|
3127
3435
|
ref: i,
|
|
3128
3436
|
"aria-hidden": "true",
|
|
3129
|
-
className:
|
|
3437
|
+
className: I(Er.indicator, e),
|
|
3130
3438
|
style: {
|
|
3131
3439
|
...a,
|
|
3132
3440
|
...t
|
|
3133
3441
|
}
|
|
3134
3442
|
});
|
|
3135
3443
|
};
|
|
3136
|
-
|
|
3444
|
+
Dr.displayName = "Tabs.Indicator";
|
|
3137
3445
|
//#endregion
|
|
3138
3446
|
//#region src/components/Tabs/List/TabsList.tsx
|
|
3139
|
-
var
|
|
3140
|
-
let { orientation: a, variant: o } =
|
|
3447
|
+
var Or = ({ children: e, className: t, scrollable: r, ...i }) => {
|
|
3448
|
+
let { orientation: a, variant: o } = br(), s = r ?? !1;
|
|
3141
3449
|
return /* @__PURE__ */ n("div", {
|
|
3142
3450
|
...i,
|
|
3143
3451
|
role: "tablist",
|
|
@@ -3145,18 +3453,18 @@ var cr = ({ children: e, className: t, scrollable: r, ...i }) => {
|
|
|
3145
3453
|
"data-orientation": a,
|
|
3146
3454
|
"data-variant": o,
|
|
3147
3455
|
"data-scrollable": s ? "" : void 0,
|
|
3148
|
-
className:
|
|
3456
|
+
className: I(Er.list, a === "vertical" && Er.vertical, o === "line" && Er.line, o === "pills" && Er.pills, o === "segmented" && Er.segmented, s && Er.scrollable, t),
|
|
3149
3457
|
children: e
|
|
3150
3458
|
});
|
|
3151
3459
|
};
|
|
3152
|
-
|
|
3460
|
+
Or.displayName = "TabsList";
|
|
3153
3461
|
//#endregion
|
|
3154
3462
|
//#region src/components/Tabs/internal/useTabsCollection.ts
|
|
3155
|
-
var
|
|
3463
|
+
var kr = (e) => [...e].sort((e, t) => {
|
|
3156
3464
|
if (e.element === t.element) return 0;
|
|
3157
3465
|
let n = e.element.compareDocumentPosition(t.element);
|
|
3158
3466
|
return n & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : n & Node.DOCUMENT_POSITION_PRECEDING ? 1 : 0;
|
|
3159
|
-
}),
|
|
3467
|
+
}), Ar = () => {
|
|
3160
3468
|
let e = g([]), t = g([]), [n, r] = _(0), i = u(() => {
|
|
3161
3469
|
r((e) => e + 1);
|
|
3162
3470
|
}, []);
|
|
@@ -3175,7 +3483,7 @@ var lr = (e) => [...e].sort((e, t) => {
|
|
|
3175
3483
|
element: n,
|
|
3176
3484
|
disabled: r
|
|
3177
3485
|
}, o = e.current.findIndex((e) => e.element === n);
|
|
3178
|
-
o >= 0 ? e.current[o] = a : e.current.push(a), e.current =
|
|
3486
|
+
o >= 0 ? e.current[o] = a : e.current.push(a), e.current = kr(e.current), i();
|
|
3179
3487
|
}, [i]),
|
|
3180
3488
|
registerContent: u((e, n) => {
|
|
3181
3489
|
let r = t.current.findIndex((t) => t.value === e);
|
|
@@ -3186,7 +3494,7 @@ var lr = (e) => [...e].sort((e, t) => {
|
|
|
3186
3494
|
r < 0 && (t.current.push({ value: e }), i());
|
|
3187
3495
|
}, [i])
|
|
3188
3496
|
};
|
|
3189
|
-
},
|
|
3497
|
+
}, jr = ({ focusedValue: e, setValue: t, setFocusedValue: n, getTabs: r, orientation: i, activationMode: a, dir: o, loop: s }) => ({ onKeyDown: (c) => {
|
|
3190
3498
|
let l = r().filter((e) => !e.disabled);
|
|
3191
3499
|
if (l.length === 0) return;
|
|
3192
3500
|
let u = l.findIndex((e) => e.element === document.activeElement), d = l.findIndex((t) => t.value === e), f = u >= 0 ? u : d >= 0 ? d : 0, p = (e) => {
|
|
@@ -3223,15 +3531,15 @@ var lr = (e) => [...e].sort((e, t) => {
|
|
|
3223
3531
|
}
|
|
3224
3532
|
break;
|
|
3225
3533
|
}
|
|
3226
|
-
} }),
|
|
3534
|
+
} }), Mr = {
|
|
3227
3535
|
tabs: "_tabs_1hj56_1",
|
|
3228
3536
|
vertical: "_vertical_1hj56_30"
|
|
3229
|
-
},
|
|
3230
|
-
let S = p(), C = t !== void 0, { value: w, setValue: T } =
|
|
3537
|
+
}, Nr = ({ 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 }) => {
|
|
3538
|
+
let S = p(), C = t !== void 0, { value: w, setValue: T } = be({
|
|
3231
3539
|
value: t,
|
|
3232
3540
|
defaultValue: r,
|
|
3233
3541
|
onValueChange: i
|
|
3234
|
-
}), E = g(w), D = g(void 0), O = g(void 0), [k, A] = _(w), { version: j, triggersRef: M, contentsRef: N, registerTrigger: P, registerContent:
|
|
3542
|
+
}), E = g(w), D = g(void 0), O = g(void 0), [k, A] = _(w), { version: j, triggersRef: M, contentsRef: N, registerTrigger: P, registerContent: F } = Ar(), L = u((e, t, n = !1) => {
|
|
3235
3543
|
if (!t) {
|
|
3236
3544
|
let t = E.current, n = M.current, r = n.findIndex((t) => t.value === e);
|
|
3237
3545
|
if (t === e && r >= 0) {
|
|
@@ -3247,7 +3555,7 @@ var lr = (e) => [...e].sort((e, t) => {
|
|
|
3247
3555
|
A,
|
|
3248
3556
|
T,
|
|
3249
3557
|
M
|
|
3250
|
-
]), { onKeyDown: R } =
|
|
3558
|
+
]), { onKeyDown: R } = jr({
|
|
3251
3559
|
focusedValue: k,
|
|
3252
3560
|
setValue: T,
|
|
3253
3561
|
setFocusedValue: A,
|
|
@@ -3273,7 +3581,7 @@ var lr = (e) => [...e].sort((e, t) => {
|
|
|
3273
3581
|
lazyMount: v,
|
|
3274
3582
|
disabled: y,
|
|
3275
3583
|
registerTrigger: L,
|
|
3276
|
-
registerContent:
|
|
3584
|
+
registerContent: F,
|
|
3277
3585
|
onTriggerKeyDown: R,
|
|
3278
3586
|
getTriggerId: u((e) => `${S}-trigger-${e}`, [S]),
|
|
3279
3587
|
getContentId: u((e) => `${S}-content-${e}`, [S])
|
|
@@ -3308,11 +3616,11 @@ var lr = (e) => [...e].sort((e, t) => {
|
|
|
3308
3616
|
N,
|
|
3309
3617
|
M,
|
|
3310
3618
|
j
|
|
3311
|
-
]), /* @__PURE__ */ n(
|
|
3619
|
+
]), /* @__PURE__ */ n(yr.Provider, {
|
|
3312
3620
|
value: z,
|
|
3313
3621
|
children: /* @__PURE__ */ n("div", {
|
|
3314
3622
|
...x,
|
|
3315
|
-
className:
|
|
3623
|
+
className: I(Mr.tabs, a === "vertical" && Mr.vertical, b),
|
|
3316
3624
|
"data-orientation": a,
|
|
3317
3625
|
dir: s,
|
|
3318
3626
|
"data-variant": l,
|
|
@@ -3323,8 +3631,8 @@ var lr = (e) => [...e].sort((e, t) => {
|
|
|
3323
3631
|
})
|
|
3324
3632
|
});
|
|
3325
3633
|
};
|
|
3326
|
-
|
|
3327
|
-
var
|
|
3634
|
+
Nr.displayName = "Tabs";
|
|
3635
|
+
var Pr = {
|
|
3328
3636
|
trigger: "_trigger_uc2y5_1",
|
|
3329
3637
|
iconOnly: "_iconOnly_uc2y5_49",
|
|
3330
3638
|
icon: "_icon_uc2y5_49",
|
|
@@ -3339,25 +3647,25 @@ var mr = {
|
|
|
3339
3647
|
line: "_line_uc2y5_194",
|
|
3340
3648
|
pills: "_pills_uc2y5_209",
|
|
3341
3649
|
vertical: "_vertical_uc2y5_235"
|
|
3342
|
-
},
|
|
3343
|
-
className:
|
|
3650
|
+
}, Fr = ({ children: e, className: t }) => /* @__PURE__ */ n("span", {
|
|
3651
|
+
className: I(Pr.badge, t),
|
|
3344
3652
|
children: e
|
|
3345
3653
|
});
|
|
3346
|
-
|
|
3654
|
+
Fr.displayName = "Tabs.Badge";
|
|
3347
3655
|
//#endregion
|
|
3348
3656
|
//#region src/components/Tabs/Trigger/TabsIcon.tsx
|
|
3349
|
-
var
|
|
3350
|
-
className:
|
|
3657
|
+
var Ir = ({ children: e, className: t }) => /* @__PURE__ */ n("span", {
|
|
3658
|
+
className: I(Pr.icon, t),
|
|
3351
3659
|
"aria-hidden": "true",
|
|
3352
3660
|
children: e
|
|
3353
3661
|
});
|
|
3354
|
-
|
|
3662
|
+
Ir.displayName = "Tabs.Icon";
|
|
3355
3663
|
//#endregion
|
|
3356
3664
|
//#region src/components/Tabs/Trigger/TabsTrigger.tsx
|
|
3357
|
-
var
|
|
3358
|
-
let { value: g, focusedValue: _, setValue: v, setFocusedValue: y, orientation: b, variant: x, size: S, disabled: C, registerTrigger: w, onTriggerKeyDown: T, getTriggerId: E, getContentId: D } =
|
|
3665
|
+
var Lr = c(({ value: e, children: t, className: a, disabled: o = !1, icon: s, badge: c, description: d, onClick: f, onKeyDown: p, ...m }, h) => {
|
|
3666
|
+
let { value: g, focusedValue: _, setValue: v, setFocusedValue: y, orientation: b, variant: x, size: S, disabled: C, registerTrigger: w, onTriggerKeyDown: T, getTriggerId: E, getContentId: D } = br(), O = C || o, k = g === e, A = _ === e || !_ && k, j = i.toArray(t), M = j.some((e) => l(e) && e.type.displayName === "Tabs.Icon"), N = !!s, P = (N || M) && t == null;
|
|
3359
3667
|
process.env.NODE_ENV !== "production" && N && M && console.warn(`Tabs.Trigger value "${e}" received both icon and Tabs.Icon. Tabs.Icon takes precedence.`);
|
|
3360
|
-
let
|
|
3668
|
+
let F = u((t) => {
|
|
3361
3669
|
w(e, t, O), typeof h == "function" ? h(t) : h && (h.current = t);
|
|
3362
3670
|
}, [
|
|
3363
3671
|
O,
|
|
@@ -3367,7 +3675,7 @@ var _r = c(({ value: e, children: t, className: a, disabled: o = !1, icon: s, ba
|
|
|
3367
3675
|
]), L = N && !M || c || d, R = j.every((e) => typeof e == "string" || typeof e == "number");
|
|
3368
3676
|
return /* @__PURE__ */ r("button", {
|
|
3369
3677
|
...m,
|
|
3370
|
-
ref:
|
|
3678
|
+
ref: F,
|
|
3371
3679
|
type: "button",
|
|
3372
3680
|
role: "tab",
|
|
3373
3681
|
id: E(e),
|
|
@@ -3378,7 +3686,7 @@ var _r = c(({ value: e, children: t, className: a, disabled: o = !1, icon: s, ba
|
|
|
3378
3686
|
"data-state": k ? "active" : "inactive",
|
|
3379
3687
|
"data-orientation": b,
|
|
3380
3688
|
"data-disabled": O ? "" : void 0,
|
|
3381
|
-
className:
|
|
3689
|
+
className: I(Pr.trigger, Pr[x], Pr[S], b === "vertical" && Pr.vertical, N && Pr.withIcon, P && Pr.iconOnly, a),
|
|
3382
3690
|
onClick: (t) => {
|
|
3383
3691
|
f?.(t), !(t.defaultPrevented || O) && (y(e), v(e));
|
|
3384
3692
|
},
|
|
@@ -3387,50 +3695,50 @@ var _r = c(({ value: e, children: t, className: a, disabled: o = !1, icon: s, ba
|
|
|
3387
3695
|
},
|
|
3388
3696
|
children: [
|
|
3389
3697
|
N && !M && /* @__PURE__ */ n("span", {
|
|
3390
|
-
className:
|
|
3698
|
+
className: Pr.icon,
|
|
3391
3699
|
"aria-hidden": "true",
|
|
3392
3700
|
children: s
|
|
3393
3701
|
}),
|
|
3394
3702
|
t != null && (L ? /* @__PURE__ */ r("span", {
|
|
3395
|
-
className:
|
|
3703
|
+
className: Pr.body,
|
|
3396
3704
|
children: [/* @__PURE__ */ n("span", {
|
|
3397
|
-
className:
|
|
3705
|
+
className: Pr.label,
|
|
3398
3706
|
children: t
|
|
3399
3707
|
}), d != null && /* @__PURE__ */ n("span", {
|
|
3400
|
-
className:
|
|
3708
|
+
className: Pr.description,
|
|
3401
3709
|
children: d
|
|
3402
3710
|
})]
|
|
3403
3711
|
}) : R ? /* @__PURE__ */ n("span", {
|
|
3404
|
-
className:
|
|
3712
|
+
className: Pr.label,
|
|
3405
3713
|
children: t
|
|
3406
3714
|
}) : t),
|
|
3407
3715
|
c != null && /* @__PURE__ */ n("span", {
|
|
3408
|
-
className:
|
|
3716
|
+
className: Pr.badge,
|
|
3409
3717
|
children: c
|
|
3410
3718
|
})
|
|
3411
3719
|
]
|
|
3412
3720
|
});
|
|
3413
3721
|
});
|
|
3414
|
-
|
|
3722
|
+
Lr.displayName = "Tabs.Trigger";
|
|
3415
3723
|
//#endregion
|
|
3416
3724
|
//#region src/components/Tabs/Tabs.tsx
|
|
3417
|
-
var
|
|
3418
|
-
List:
|
|
3419
|
-
Trigger:
|
|
3420
|
-
Content:
|
|
3421
|
-
Indicator:
|
|
3422
|
-
Icon:
|
|
3423
|
-
Badge:
|
|
3725
|
+
var Rr = Object.assign(Nr, {
|
|
3726
|
+
List: Or,
|
|
3727
|
+
Trigger: Lr,
|
|
3728
|
+
Content: Sr,
|
|
3729
|
+
Indicator: Dr,
|
|
3730
|
+
Icon: Ir,
|
|
3731
|
+
Badge: Fr
|
|
3424
3732
|
});
|
|
3425
|
-
|
|
3733
|
+
Rr.displayName = "Tabs";
|
|
3426
3734
|
//#endregion
|
|
3427
3735
|
//#region src/components/Tooltip/internal/composeEventHandlers.ts
|
|
3428
|
-
function
|
|
3736
|
+
function zr(e, t) {
|
|
3429
3737
|
return (n) => {
|
|
3430
3738
|
e?.(n), n.defaultPrevented || t?.(n);
|
|
3431
3739
|
};
|
|
3432
3740
|
}
|
|
3433
|
-
function
|
|
3741
|
+
function Br(...e) {
|
|
3434
3742
|
return (t) => {
|
|
3435
3743
|
e.forEach((e) => {
|
|
3436
3744
|
if (e) {
|
|
@@ -3445,18 +3753,18 @@ function br(...e) {
|
|
|
3445
3753
|
}
|
|
3446
3754
|
//#endregion
|
|
3447
3755
|
//#region src/components/Tooltip/internal/TooltipContext.tsx
|
|
3448
|
-
var
|
|
3756
|
+
var Vr = s(null), Hr = s({
|
|
3449
3757
|
delay: {
|
|
3450
3758
|
open: 300,
|
|
3451
3759
|
close: 100
|
|
3452
3760
|
},
|
|
3453
3761
|
skipDelay: 300
|
|
3454
|
-
}),
|
|
3762
|
+
}), Ur = Vr.Provider, Wr = ({ children: e, delay: t = 700, skipDelay: r = 300 }) => {
|
|
3455
3763
|
let i = typeof t == "number" ? {
|
|
3456
3764
|
open: t,
|
|
3457
3765
|
close: 100
|
|
3458
3766
|
} : t;
|
|
3459
|
-
return /* @__PURE__ */ n(
|
|
3767
|
+
return /* @__PURE__ */ n(Hr.Provider, {
|
|
3460
3768
|
value: {
|
|
3461
3769
|
delay: i,
|
|
3462
3770
|
skipDelay: r
|
|
@@ -3464,39 +3772,39 @@ var xr = s(null), Sr = s({
|
|
|
3464
3772
|
children: e
|
|
3465
3773
|
});
|
|
3466
3774
|
};
|
|
3467
|
-
function
|
|
3468
|
-
let e = d(
|
|
3775
|
+
function Gr() {
|
|
3776
|
+
let e = d(Vr);
|
|
3469
3777
|
if (!e) throw Error("Tooltip compound components must be rendered inside Tooltip");
|
|
3470
3778
|
return e;
|
|
3471
3779
|
}
|
|
3472
|
-
function
|
|
3473
|
-
return d(
|
|
3780
|
+
function Kr() {
|
|
3781
|
+
return d(Hr);
|
|
3474
3782
|
}
|
|
3475
|
-
var
|
|
3783
|
+
var qr = {
|
|
3476
3784
|
tooltip: "_tooltip_raj0t_1",
|
|
3477
3785
|
arrow: "_arrow_raj0t_25"
|
|
3478
|
-
},
|
|
3479
|
-
let l =
|
|
3786
|
+
}, Jr = c(({ children: e, forceMount: t = !1, withArrow: i = !1, className: a, style: o, ...s }, c) => {
|
|
3787
|
+
let l = Gr();
|
|
3480
3788
|
return !t && !l.open ? null : /* @__PURE__ */ r("div", {
|
|
3481
3789
|
...l.getContentProps({
|
|
3482
3790
|
id: l.contentId,
|
|
3483
3791
|
role: "tooltip",
|
|
3484
3792
|
...s
|
|
3485
3793
|
}),
|
|
3486
|
-
ref:
|
|
3487
|
-
className:
|
|
3794
|
+
ref: Br(c, l.setContentRef),
|
|
3795
|
+
className: I(qr.tooltip, a),
|
|
3488
3796
|
"data-placement": l.placement,
|
|
3489
3797
|
"data-state": l.open ? "open" : "closed",
|
|
3490
3798
|
style: {
|
|
3491
3799
|
...l.floatingStyles,
|
|
3492
3800
|
...o
|
|
3493
3801
|
},
|
|
3494
|
-
children: [e, i && /* @__PURE__ */ n(
|
|
3802
|
+
children: [e, i && /* @__PURE__ */ n(Yr, {})]
|
|
3495
3803
|
});
|
|
3496
3804
|
});
|
|
3497
|
-
|
|
3498
|
-
function
|
|
3499
|
-
let e =
|
|
3805
|
+
Jr.displayName = "Tooltip.Content";
|
|
3806
|
+
function Yr() {
|
|
3807
|
+
let e = Gr(), t = {
|
|
3500
3808
|
top: "bottom",
|
|
3501
3809
|
right: "left",
|
|
3502
3810
|
bottom: "top",
|
|
@@ -3504,7 +3812,7 @@ function kr() {
|
|
|
3504
3812
|
}[e.placement.split("-")[0]];
|
|
3505
3813
|
return /* @__PURE__ */ n("div", {
|
|
3506
3814
|
ref: e.arrowRef,
|
|
3507
|
-
className:
|
|
3815
|
+
className: qr.arrow,
|
|
3508
3816
|
style: {
|
|
3509
3817
|
left: e.arrowX == null ? void 0 : `${e.arrowX}px`,
|
|
3510
3818
|
top: e.arrowY == null ? void 0 : `${e.arrowY}px`,
|
|
@@ -3514,8 +3822,8 @@ function kr() {
|
|
|
3514
3822
|
}
|
|
3515
3823
|
//#endregion
|
|
3516
3824
|
//#region src/components/Tooltip/internal/useTooltipDelay.ts
|
|
3517
|
-
function
|
|
3518
|
-
let n =
|
|
3825
|
+
function Xr(e, t) {
|
|
3826
|
+
let n = Kr();
|
|
3519
3827
|
return e == null ? n.delay : typeof e == "number" ? {
|
|
3520
3828
|
open: e,
|
|
3521
3829
|
close: n.delay.close
|
|
@@ -3526,25 +3834,25 @@ function Ar(e, t) {
|
|
|
3526
3834
|
}
|
|
3527
3835
|
//#endregion
|
|
3528
3836
|
//#region src/components/Tooltip/internal/useTooltipInteractions.ts
|
|
3529
|
-
function
|
|
3530
|
-
return
|
|
3837
|
+
function Zr({ context: e, delay: t, disabled: n, interactive: r }) {
|
|
3838
|
+
return P([N(e, {
|
|
3531
3839
|
delay: t,
|
|
3532
3840
|
enabled: !n,
|
|
3533
3841
|
move: !1,
|
|
3534
3842
|
handleClose: r ? void 0 : null
|
|
3535
|
-
}),
|
|
3843
|
+
}), M(e, { enabled: !n })]);
|
|
3536
3844
|
}
|
|
3537
3845
|
//#endregion
|
|
3538
3846
|
//#region src/components/Tooltip/internal/useTooltipPosition.ts
|
|
3539
|
-
function
|
|
3540
|
-
let o = g(null), s =
|
|
3847
|
+
function Qr({ open: e, onOpenChange: t, placement: n, offset: r, avoidCollisions: i, matchTriggerWidth: a }) {
|
|
3848
|
+
let o = g(null), s = nt({
|
|
3541
3849
|
open: e,
|
|
3542
3850
|
onOpenChange: t,
|
|
3543
3851
|
placement: n,
|
|
3544
3852
|
offset: r,
|
|
3545
3853
|
avoidCollisions: i,
|
|
3546
3854
|
matchTriggerWidth: a,
|
|
3547
|
-
middleware: [
|
|
3855
|
+
middleware: [T({ element: o })]
|
|
3548
3856
|
});
|
|
3549
3857
|
return {
|
|
3550
3858
|
...s,
|
|
@@ -3555,26 +3863,26 @@ function Mr({ open: e, onOpenChange: t, placement: n, offset: r, avoidCollisions
|
|
|
3555
3863
|
}
|
|
3556
3864
|
//#endregion
|
|
3557
3865
|
//#region src/components/Tooltip/Root/TooltipRoot.tsx
|
|
3558
|
-
var
|
|
3559
|
-
let h = `${p()}-content`, _ = g(null), v = g(null), [y, b] =
|
|
3866
|
+
var $r = ({ 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 }) => {
|
|
3867
|
+
let h = `${p()}-content`, _ = g(null), v = g(null), [y, b] = he({
|
|
3560
3868
|
value: t,
|
|
3561
3869
|
defaultValue: r,
|
|
3562
3870
|
onChange: i
|
|
3563
3871
|
}), x = (e) => {
|
|
3564
3872
|
l || b(e);
|
|
3565
|
-
}, S =
|
|
3873
|
+
}, S = Qr({
|
|
3566
3874
|
open: y,
|
|
3567
3875
|
onOpenChange: x,
|
|
3568
3876
|
placement: a,
|
|
3569
3877
|
offset: o,
|
|
3570
3878
|
avoidCollisions: d,
|
|
3571
3879
|
matchTriggerWidth: f
|
|
3572
|
-
}), C =
|
|
3880
|
+
}), C = Xr(s, c), w = Zr({
|
|
3573
3881
|
context: S.context,
|
|
3574
3882
|
delay: C,
|
|
3575
3883
|
disabled: l,
|
|
3576
3884
|
interactive: u
|
|
3577
|
-
}), { isTopOverlay: T } =
|
|
3885
|
+
}), { isTopOverlay: T } = le({
|
|
3578
3886
|
active: y,
|
|
3579
3887
|
id: h
|
|
3580
3888
|
});
|
|
@@ -3586,7 +3894,7 @@ var Nr = ({ children: e, open: t, defaultOpen: r = !1, onOpenChange: i, placemen
|
|
|
3586
3894
|
closeOnOutsidePress: !u,
|
|
3587
3895
|
isTopOverlay: T,
|
|
3588
3896
|
requestClose: () => x(!1)
|
|
3589
|
-
}), /* @__PURE__ */ n(
|
|
3897
|
+
}), /* @__PURE__ */ n(Ur, {
|
|
3590
3898
|
value: {
|
|
3591
3899
|
contentId: h,
|
|
3592
3900
|
open: y,
|
|
@@ -3599,34 +3907,34 @@ var Nr = ({ children: e, open: t, defaultOpen: r = !1, onOpenChange: i, placemen
|
|
|
3599
3907
|
placement: S.placement,
|
|
3600
3908
|
floatingStyles: S.floatingStyles,
|
|
3601
3909
|
setOpen: x,
|
|
3602
|
-
setTriggerRef:
|
|
3603
|
-
setContentRef:
|
|
3910
|
+
setTriggerRef: Br(v, S.setRef),
|
|
3911
|
+
setContentRef: Br(_, S.setFloatingRef),
|
|
3604
3912
|
getTriggerProps: w.getReferenceProps,
|
|
3605
3913
|
getContentProps: w.getFloatingProps
|
|
3606
3914
|
},
|
|
3607
3915
|
children: e
|
|
3608
3916
|
});
|
|
3609
3917
|
};
|
|
3610
|
-
|
|
3918
|
+
$r.displayName = "Tooltip.Root";
|
|
3611
3919
|
//#endregion
|
|
3612
3920
|
//#region src/components/Tooltip/Trigger/TooltipTrigger.tsx
|
|
3613
|
-
var
|
|
3614
|
-
let s =
|
|
3921
|
+
var ei = ({ asChild: e = !1, children: t, disabled: r = !1, className: i, ...a }) => {
|
|
3922
|
+
let s = Gr(), c = e && l(t) ? t : void 0, u = s.disabled || r || c?.props.disabled, d = s.getTriggerProps({
|
|
3615
3923
|
...a,
|
|
3616
3924
|
"aria-describedby": s.open ? s.contentId : void 0,
|
|
3617
3925
|
"aria-disabled": u || void 0,
|
|
3618
3926
|
"data-state": s.open ? "open" : "closed"
|
|
3619
3927
|
}), f = {
|
|
3620
3928
|
...d,
|
|
3621
|
-
ref: c ?
|
|
3622
|
-
className:
|
|
3929
|
+
ref: c ? Br(c.props.ref, s.setTriggerRef) : s.setTriggerRef,
|
|
3930
|
+
className: I(c?.props.className, i),
|
|
3623
3931
|
disabled: u || void 0,
|
|
3624
|
-
onMouseEnter:
|
|
3625
|
-
onMouseLeave:
|
|
3626
|
-
onPointerEnter:
|
|
3627
|
-
onPointerLeave:
|
|
3628
|
-
onFocus:
|
|
3629
|
-
onBlur:
|
|
3932
|
+
onMouseEnter: zr(c?.props.onMouseEnter, d.onMouseEnter),
|
|
3933
|
+
onMouseLeave: zr(c?.props.onMouseLeave, d.onMouseLeave),
|
|
3934
|
+
onPointerEnter: zr(c?.props.onPointerEnter, d.onPointerEnter),
|
|
3935
|
+
onPointerLeave: zr(c?.props.onPointerLeave, d.onPointerLeave),
|
|
3936
|
+
onFocus: zr(c?.props.onFocus, d.onFocus),
|
|
3937
|
+
onBlur: zr(c?.props.onBlur, d.onBlur)
|
|
3630
3938
|
};
|
|
3631
3939
|
return c ? o(c, f) : /* @__PURE__ */ n("button", {
|
|
3632
3940
|
type: "button",
|
|
@@ -3634,20 +3942,20 @@ var Pr = ({ asChild: e = !1, children: t, disabled: r = !1, className: i, ...a }
|
|
|
3634
3942
|
children: t
|
|
3635
3943
|
});
|
|
3636
3944
|
};
|
|
3637
|
-
|
|
3945
|
+
ei.displayName = "Tooltip.Trigger";
|
|
3638
3946
|
//#endregion
|
|
3639
3947
|
//#region src/components/Tooltip/Tooltip.tsx
|
|
3640
|
-
var
|
|
3641
|
-
Trigger:
|
|
3642
|
-
Content:
|
|
3643
|
-
Provider:
|
|
3948
|
+
var ti = Object.assign($r, {
|
|
3949
|
+
Trigger: ei,
|
|
3950
|
+
Content: Jr,
|
|
3951
|
+
Provider: Wr
|
|
3644
3952
|
});
|
|
3645
|
-
|
|
3953
|
+
ti.displayName = "Tooltip";
|
|
3646
3954
|
//#endregion
|
|
3647
3955
|
//#region src/utils/devWarning.ts
|
|
3648
|
-
var
|
|
3956
|
+
var ni = (e, t) => {
|
|
3649
3957
|
process.env.NODE_ENV !== "production" && !e && console.warn(t);
|
|
3650
|
-
},
|
|
3958
|
+
}, ri = {
|
|
3651
3959
|
button: "_button_1xn9g_1",
|
|
3652
3960
|
solid: "_solid_1xn9g_23",
|
|
3653
3961
|
primary: "_primary_1xn9g_23",
|
|
@@ -3675,14 +3983,14 @@ var Ir = (e, t) => {
|
|
|
3675
3983
|
"button-spin": "_button-spin_1xn9g_1",
|
|
3676
3984
|
badge: "_badge_1xn9g_812",
|
|
3677
3985
|
shortcut: "_shortcut_1xn9g_826"
|
|
3678
|
-
},
|
|
3679
|
-
let L = S && l(e) ? e : void 0, R = L ? L.props.children : e, z = x || !R && !!(m || h), B = !!(T || E || L?.props["aria-label"] || L?.props["aria-labelledby"]), V = d || f,
|
|
3680
|
-
[
|
|
3681
|
-
[
|
|
3682
|
-
[
|
|
3683
|
-
[
|
|
3986
|
+
}, ii = 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, ...P }, F) => {
|
|
3987
|
+
let L = S && l(e) ? e : void 0, R = L ? L.props.children : e, z = x || !R && !!(m || h), B = !!(T || E || L?.props["aria-label"] || L?.props["aria-labelledby"]), V = d || f, ee = f && p ? p : R, H = p && R && !z && (typeof R == "string" || typeof R == "number") && (typeof p == "string" || typeof p == "number") ? String(f ? R : p) : void 0, U = O === "_blank" && !k ? "noreferrer noopener" : k, te = I(ri.button, ri[i], ri[a], ri[s], ri[c], C, {
|
|
3988
|
+
[ri.disabled]: V,
|
|
3989
|
+
[ri.loading]: f,
|
|
3990
|
+
[ri.fullWidth]: b,
|
|
3991
|
+
[ri.iconOnly]: z
|
|
3684
3992
|
});
|
|
3685
|
-
|
|
3993
|
+
ni(!S || !D, "Button: pass href to the child element when using asChild."), ni(!S || !!L, "Button: asChild requires a single valid React element child."), ni(!z || B, "Button: icon-only buttons must provide aria-label or aria-labelledby.");
|
|
3686
3994
|
let ne = (e) => {
|
|
3687
3995
|
e.preventDefault(), e.stopPropagation();
|
|
3688
3996
|
}, re = (e) => {
|
|
@@ -3693,53 +4001,53 @@ var Ir = (e, t) => {
|
|
|
3693
4001
|
L?.props.onClick?.(e), e.defaultPrevented || w?.(e);
|
|
3694
4002
|
}, W = /* @__PURE__ */ r(t, { children: [
|
|
3695
4003
|
f && (g ? /* @__PURE__ */ n("span", {
|
|
3696
|
-
className:
|
|
4004
|
+
className: ri.icon,
|
|
3697
4005
|
"aria-hidden": "true",
|
|
3698
4006
|
children: g
|
|
3699
4007
|
}) : /* @__PURE__ */ n("span", {
|
|
3700
|
-
className:
|
|
4008
|
+
className: ri.spinner,
|
|
3701
4009
|
"aria-hidden": "true"
|
|
3702
4010
|
})),
|
|
3703
4011
|
!f && m && /* @__PURE__ */ n("span", {
|
|
3704
|
-
className:
|
|
4012
|
+
className: ri.icon,
|
|
3705
4013
|
children: m
|
|
3706
4014
|
}),
|
|
3707
|
-
|
|
3708
|
-
className:
|
|
3709
|
-
"data-measure":
|
|
4015
|
+
ee && !z && /* @__PURE__ */ n("span", {
|
|
4016
|
+
className: ri.label,
|
|
4017
|
+
"data-measure": H,
|
|
3710
4018
|
children: /* @__PURE__ */ n("span", {
|
|
3711
|
-
className:
|
|
3712
|
-
children:
|
|
4019
|
+
className: ri.labelText,
|
|
4020
|
+
children: ee
|
|
3713
4021
|
})
|
|
3714
4022
|
}),
|
|
3715
4023
|
_ && !z && /* @__PURE__ */ n("span", {
|
|
3716
|
-
className:
|
|
4024
|
+
className: ri.badge,
|
|
3717
4025
|
children: _
|
|
3718
4026
|
}),
|
|
3719
4027
|
v && !z && /* @__PURE__ */ n("span", {
|
|
3720
|
-
className:
|
|
4028
|
+
className: ri.shortcut,
|
|
3721
4029
|
children: v
|
|
3722
4030
|
}),
|
|
3723
4031
|
!f && h && /* @__PURE__ */ n("span", {
|
|
3724
|
-
className:
|
|
4032
|
+
className: ri.icon,
|
|
3725
4033
|
children: h
|
|
3726
4034
|
})
|
|
3727
4035
|
] });
|
|
3728
4036
|
return L ? o(L, {
|
|
3729
4037
|
...P,
|
|
3730
|
-
ref:
|
|
4038
|
+
ref: F,
|
|
3731
4039
|
"aria-busy": f || void 0,
|
|
3732
4040
|
"aria-disabled": V || void 0,
|
|
3733
4041
|
"aria-label": T || L.props["aria-label"] || void 0,
|
|
3734
4042
|
"aria-labelledby": E || L.props["aria-labelledby"] || void 0,
|
|
3735
|
-
className:
|
|
4043
|
+
className: I(L.props.className, te),
|
|
3736
4044
|
href: V ? void 0 : L.props.href,
|
|
3737
4045
|
onClick: re,
|
|
3738
4046
|
tabIndex: V ? -1 : L.props.tabIndex,
|
|
3739
4047
|
title: y || L.props.title,
|
|
3740
4048
|
children: W
|
|
3741
4049
|
}) : D ? /* @__PURE__ */ n("a", {
|
|
3742
|
-
ref:
|
|
4050
|
+
ref: F,
|
|
3743
4051
|
href: V ? void 0 : D,
|
|
3744
4052
|
id: j,
|
|
3745
4053
|
role: M,
|
|
@@ -3757,7 +4065,7 @@ var Ir = (e, t) => {
|
|
|
3757
4065
|
children: W
|
|
3758
4066
|
}) : /* @__PURE__ */ n("button", {
|
|
3759
4067
|
...P,
|
|
3760
|
-
ref:
|
|
4068
|
+
ref: F,
|
|
3761
4069
|
id: j,
|
|
3762
4070
|
role: M,
|
|
3763
4071
|
tabIndex: N,
|
|
@@ -3772,7 +4080,7 @@ var Ir = (e, t) => {
|
|
|
3772
4080
|
children: W
|
|
3773
4081
|
});
|
|
3774
4082
|
});
|
|
3775
|
-
|
|
4083
|
+
ii.displayName = "Button";
|
|
3776
4084
|
var Q = {
|
|
3777
4085
|
wrapper: "_wrapper_11rc7_1",
|
|
3778
4086
|
colorPrimary: "_colorPrimary_11rc7_35",
|
|
@@ -3808,30 +4116,30 @@ var Q = {
|
|
|
3808
4116
|
"checkbox-checkmark-in": "_checkbox-checkmark-in_11rc7_1",
|
|
3809
4117
|
"checkbox-indeterminate-in": "_checkbox-indeterminate-in_11rc7_1",
|
|
3810
4118
|
disabled: "_disabled_11rc7_369"
|
|
3811
|
-
},
|
|
4119
|
+
}, ai = {
|
|
3812
4120
|
sm: Q.labelSm,
|
|
3813
4121
|
md: Q.labelMd,
|
|
3814
4122
|
lg: Q.labelLg
|
|
3815
|
-
},
|
|
4123
|
+
}, oi = {
|
|
3816
4124
|
sm: Q.wrapperSm,
|
|
3817
4125
|
md: Q.wrapperMd,
|
|
3818
4126
|
lg: Q.wrapperLg
|
|
3819
|
-
},
|
|
4127
|
+
}, si = {
|
|
3820
4128
|
sm: Q.containerSm,
|
|
3821
4129
|
md: Q.containerMd,
|
|
3822
4130
|
lg: Q.containerLg
|
|
3823
|
-
},
|
|
4131
|
+
}, ci = {
|
|
3824
4132
|
primary: Q.colorPrimary,
|
|
3825
4133
|
neutral: Q.colorNeutral,
|
|
3826
4134
|
success: Q.colorSuccess,
|
|
3827
4135
|
warning: Q.colorWarning,
|
|
3828
4136
|
danger: Q.colorDanger
|
|
3829
|
-
},
|
|
3830
|
-
let k = p(), A = e ?? k, j = g(null), M = !!C, N = i ? `${A}-description` : void 0, P = M ? `${A}-error` : void 0,
|
|
4137
|
+
}, li = c(({ id: e, label: t, description: i, icon: a, indeterminateIcon: o, checked: s, size: c = "md", color: l = "primary", labelPosition: d = "end", defaultChecked: m = !1, disabled: h = !1, required: _ = !1, indeterminate: v = !1, className: b, wrapperClassName: x, onCheckedChange: S, error: C, "aria-label": w, "aria-labelledby": T, "aria-describedby": E, ...D }, O) => {
|
|
4138
|
+
let k = p(), A = e ?? k, j = g(null), M = !!C, N = i ? `${A}-description` : void 0, P = M ? `${A}-error` : void 0, F = [
|
|
3831
4139
|
E,
|
|
3832
4140
|
N,
|
|
3833
4141
|
P
|
|
3834
|
-
].filter(Boolean).join(" "), [L, R] =
|
|
4142
|
+
].filter(Boolean).join(" "), [L, R] = he({
|
|
3835
4143
|
value: s,
|
|
3836
4144
|
defaultValue: m,
|
|
3837
4145
|
onChange: S
|
|
@@ -3848,12 +4156,12 @@ var Q = {
|
|
|
3848
4156
|
let B = (e) => {
|
|
3849
4157
|
R(e.target.checked);
|
|
3850
4158
|
};
|
|
3851
|
-
return
|
|
3852
|
-
className:
|
|
4159
|
+
return ni(!!(t || w || T), "Checkbox: an accessible label must be provided through label, aria-label, or aria-labelledby."), /* @__PURE__ */ r("div", {
|
|
4160
|
+
className: I(Q.container, si[c], d === "start" && Q.containerLabelStart, b),
|
|
3853
4161
|
children: [
|
|
3854
4162
|
/* @__PURE__ */ r("label", {
|
|
3855
4163
|
htmlFor: A,
|
|
3856
|
-
className:
|
|
4164
|
+
className: I(Q.wrapper, oi[c], ci[l], d === "start" && Q.labelStart, !t && Q.iconOnly, h && Q.disabled, x),
|
|
3857
4165
|
children: [
|
|
3858
4166
|
/* @__PURE__ */ n("input", {
|
|
3859
4167
|
...D,
|
|
@@ -3869,13 +4177,13 @@ var Q = {
|
|
|
3869
4177
|
"aria-labelledby": T,
|
|
3870
4178
|
"aria-checked": v ? "mixed" : D["aria-checked"],
|
|
3871
4179
|
"aria-invalid": M ? !0 : D["aria-invalid"],
|
|
3872
|
-
"aria-describedby":
|
|
4180
|
+
"aria-describedby": F || void 0
|
|
3873
4181
|
}),
|
|
3874
4182
|
/* @__PURE__ */ n("span", {
|
|
3875
|
-
className:
|
|
4183
|
+
className: I(Q.customCheckbox, M && Q.error, v && Q.indeterminate),
|
|
3876
4184
|
"aria-hidden": "true",
|
|
3877
4185
|
children: v ? /* @__PURE__ */ n("span", {
|
|
3878
|
-
className:
|
|
4186
|
+
className: I(Q.indeterminateMark, o && Q.customMark),
|
|
3879
4187
|
children: o
|
|
3880
4188
|
}) : L && /* @__PURE__ */ n("span", {
|
|
3881
4189
|
className: Q.checkmark,
|
|
@@ -3883,7 +4191,7 @@ var Q = {
|
|
|
3883
4191
|
})
|
|
3884
4192
|
}),
|
|
3885
4193
|
t && /* @__PURE__ */ r("span", {
|
|
3886
|
-
className:
|
|
4194
|
+
className: I(Q.label, ai[c]),
|
|
3887
4195
|
children: [t, _ && /* @__PURE__ */ n("span", {
|
|
3888
4196
|
className: Q.requiredMark,
|
|
3889
4197
|
"aria-hidden": "true",
|
|
@@ -3905,7 +4213,7 @@ var Q = {
|
|
|
3905
4213
|
]
|
|
3906
4214
|
});
|
|
3907
4215
|
});
|
|
3908
|
-
|
|
4216
|
+
li.displayName = "Checkbox";
|
|
3909
4217
|
var $ = {
|
|
3910
4218
|
inputGroup: "_inputGroup_1fjhk_1",
|
|
3911
4219
|
primary: "_primary_1fjhk_29",
|
|
@@ -3947,7 +4255,7 @@ var $ = {
|
|
|
3947
4255
|
toneDanger: "_toneDanger_1fjhk_876",
|
|
3948
4256
|
toneMuted: "_toneMuted_1fjhk_880",
|
|
3949
4257
|
toneInverse: "_toneInverse_1fjhk_884"
|
|
3950
|
-
},
|
|
4258
|
+
}, ui = {
|
|
3951
4259
|
default: $.toneDefault,
|
|
3952
4260
|
primary: $.tonePrimary,
|
|
3953
4261
|
secondary: $.toneSecondary,
|
|
@@ -3955,7 +4263,7 @@ var $ = {
|
|
|
3955
4263
|
danger: $.toneDanger,
|
|
3956
4264
|
muted: $.toneMuted,
|
|
3957
4265
|
inverse: $.toneInverse
|
|
3958
|
-
},
|
|
4266
|
+
}, di = (e = "text", t) => {
|
|
3959
4267
|
if (t) return t;
|
|
3960
4268
|
switch (e) {
|
|
3961
4269
|
case "email": return "email";
|
|
@@ -3965,7 +4273,7 @@ var $ = {
|
|
|
3965
4273
|
case "search": return "off";
|
|
3966
4274
|
default: return;
|
|
3967
4275
|
}
|
|
3968
|
-
},
|
|
4276
|
+
}, fi = (e, t) => {
|
|
3969
4277
|
let n = e.replace(/\D/g, ""), r = 0, i = "";
|
|
3970
4278
|
for (let e of t) {
|
|
3971
4279
|
if (e === "#") {
|
|
@@ -3977,27 +4285,27 @@ var $ = {
|
|
|
3977
4285
|
r < n.length && (i += e);
|
|
3978
4286
|
}
|
|
3979
4287
|
return i;
|
|
3980
|
-
},
|
|
3981
|
-
let
|
|
3982
|
-
|
|
3983
|
-
!de && !
|
|
4288
|
+
}, pi = (e, t) => t ? typeof t == "function" ? t(e) : fi(e, t) : e, mi = 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: P, startAddon: F, endAddon: L, prefix: R, suffix: z, clearIcon: B, mask: V, format: ee, parse: H, startIconTone: U = "default", endIconTone: te = "default", clearIconTone: ne = "danger", autoFocus: re, maxLength: W, onMouseEnter: ie, onMouseLeave: ae, "aria-describedby": G, "aria-invalid": oe, "aria-labelledby": se, ...ce }, le) => {
|
|
4289
|
+
let K = p(), ue = Jn(), de = !!(i || o || v), fe = e ?? (de ? void 0 : ue?.controlId) ?? K, pe = g(null), [me, he] = _(!1), [ge, _e] = _(l ?? ""), ve = c !== void 0, ye = String((ve ? c : ge) ?? ""), be = ee ? ee(ye) : ye, xe = ye.length > 0, Se = f ?? ue?.size ?? "md", Ce = y || !!v || !de && !!ue?.invalid, we = b || !de && !!ue?.disabled, Te = x || !de && !!ue?.required, Ee = D || S, De = d === "password", Oe = De && j && me ? "text" : d, ke = N ?? (d === "search" ? /* @__PURE__ */ n(C, {}) : null), Ae = P, je = di(d, E), Me = S && !we, Ne = O && xe && !we && !Ee && !Me, Pe = j && De && !we && !Me && !Ne, Fe = !Me && !Ne && !Pe && !!Ae, q = !!(M && W), Ie = o ? `${fe}-description` : void 0, Le = v ? `${fe}-error` : void 0, Re = q ? `${fe}-counter` : void 0, ze = [
|
|
4290
|
+
G,
|
|
4291
|
+
!de && !G ? ue?.ariaDescribedBy : void 0,
|
|
3984
4292
|
Ie,
|
|
3985
4293
|
Le,
|
|
3986
4294
|
Re
|
|
3987
|
-
].filter(Boolean).join(" "), Be = B ?? "×", Ve = !!(ke || R), He = !!(Ae || z || Ne || Pe || Me), Ue = !!(ke && R), We = !!(Ae && z), Ge = !!(
|
|
3988
|
-
if (pe.current = e, typeof
|
|
3989
|
-
|
|
4295
|
+
].filter(Boolean).join(" "), Be = B ?? "×", Ve = !!(ke || R), He = !!(Ae || z || Ne || Pe || Me), Ue = !!(ke && R), We = !!(Ae && z), Ge = !!(F || L), Ke = u((e) => {
|
|
4296
|
+
if (pe.current = e, typeof le == "function") {
|
|
4297
|
+
le(e);
|
|
3990
4298
|
return;
|
|
3991
4299
|
}
|
|
3992
|
-
|
|
3993
|
-
}, [
|
|
3994
|
-
let t =
|
|
4300
|
+
le && (le.current = e);
|
|
4301
|
+
}, [le]), qe = u((e) => {
|
|
4302
|
+
let t = pi(H ? H(e.target.value) : e.target.value, V);
|
|
3995
4303
|
ve || _e(t), A?.(t);
|
|
3996
4304
|
}, [
|
|
3997
4305
|
ve,
|
|
3998
4306
|
V,
|
|
3999
4307
|
A,
|
|
4000
|
-
|
|
4308
|
+
H
|
|
4001
4309
|
]), Je = u(() => {
|
|
4002
4310
|
ve || _e(""), A?.(""), k?.(), pe.current?.focus();
|
|
4003
4311
|
}, [
|
|
@@ -4005,19 +4313,19 @@ var $ = {
|
|
|
4005
4313
|
k,
|
|
4006
4314
|
A
|
|
4007
4315
|
]), Ye = /* @__PURE__ */ r(t, { children: [/* @__PURE__ */ r("div", {
|
|
4008
|
-
className:
|
|
4316
|
+
className: I($.inputGroup, $[h], $[m], {
|
|
4009
4317
|
[$.hasAddons]: Ge,
|
|
4010
4318
|
[$.isDisabled]: we,
|
|
4011
4319
|
[$.isInvalid]: Ce,
|
|
4012
4320
|
[$.isLoading]: Me
|
|
4013
4321
|
}),
|
|
4014
4322
|
children: [
|
|
4015
|
-
|
|
4323
|
+
F && /* @__PURE__ */ n("span", {
|
|
4016
4324
|
className: $.addon,
|
|
4017
|
-
children:
|
|
4325
|
+
children: F
|
|
4018
4326
|
}),
|
|
4019
4327
|
/* @__PURE__ */ r("div", {
|
|
4020
|
-
className:
|
|
4328
|
+
className: I($.inputWrapper, {
|
|
4021
4329
|
[$.hasLeftAdornment]: Ve,
|
|
4022
4330
|
[$.hasRightAdornment]: He,
|
|
4023
4331
|
[$.hasStartIconAndPrefix]: Ue,
|
|
@@ -4026,7 +4334,7 @@ var $ = {
|
|
|
4026
4334
|
children: [
|
|
4027
4335
|
ke && /* @__PURE__ */ n("span", {
|
|
4028
4336
|
"aria-hidden": "true",
|
|
4029
|
-
className:
|
|
4337
|
+
className: I($.startAdornment, ui[U]),
|
|
4030
4338
|
children: ke
|
|
4031
4339
|
}),
|
|
4032
4340
|
R && /* @__PURE__ */ n("span", {
|
|
@@ -4040,7 +4348,7 @@ var $ = {
|
|
|
4040
4348
|
name: a,
|
|
4041
4349
|
type: Oe,
|
|
4042
4350
|
autoComplete: je,
|
|
4043
|
-
className:
|
|
4351
|
+
className: I($.input, $[Se], { [$.error]: Ce }, w),
|
|
4044
4352
|
value: be,
|
|
4045
4353
|
onChange: qe,
|
|
4046
4354
|
placeholder: s,
|
|
@@ -4049,7 +4357,7 @@ var $ = {
|
|
|
4049
4357
|
required: Te,
|
|
4050
4358
|
autoFocus: re,
|
|
4051
4359
|
maxLength: W,
|
|
4052
|
-
"aria-invalid": Ce ? !0 :
|
|
4360
|
+
"aria-invalid": Ce ? !0 : oe,
|
|
4053
4361
|
"aria-labelledby": se ?? (de ? void 0 : ue?.ariaLabelledBy),
|
|
4054
4362
|
"aria-describedby": ze || void 0,
|
|
4055
4363
|
"aria-busy": S || void 0,
|
|
@@ -4077,14 +4385,14 @@ var $ = {
|
|
|
4077
4385
|
}),
|
|
4078
4386
|
Ne && /* @__PURE__ */ n("button", {
|
|
4079
4387
|
type: "button",
|
|
4080
|
-
className:
|
|
4388
|
+
className: I($.clearButton, ui[ne]),
|
|
4081
4389
|
onClick: Je,
|
|
4082
4390
|
"aria-label": "Clear input",
|
|
4083
4391
|
children: Be
|
|
4084
4392
|
}),
|
|
4085
|
-
|
|
4393
|
+
Fe && Ae && /* @__PURE__ */ n("span", {
|
|
4086
4394
|
"aria-hidden": "true",
|
|
4087
|
-
className:
|
|
4395
|
+
className: I($.endAdornment, ui[te]),
|
|
4088
4396
|
children: Ae
|
|
4089
4397
|
})
|
|
4090
4398
|
]
|
|
@@ -4096,7 +4404,7 @@ var $ = {
|
|
|
4096
4404
|
children: L
|
|
4097
4405
|
})
|
|
4098
4406
|
]
|
|
4099
|
-
}),
|
|
4407
|
+
}), q && /* @__PURE__ */ r("div", {
|
|
4100
4408
|
id: Re,
|
|
4101
4409
|
className: $.counter,
|
|
4102
4410
|
children: [
|
|
@@ -4105,7 +4413,7 @@ var $ = {
|
|
|
4105
4413
|
W
|
|
4106
4414
|
]
|
|
4107
4415
|
})] });
|
|
4108
|
-
return !de && ue ? Ye : /* @__PURE__ */ n(
|
|
4416
|
+
return !de && ue ? Ye : /* @__PURE__ */ n(rr, {
|
|
4109
4417
|
id: fe,
|
|
4110
4418
|
label: i,
|
|
4111
4419
|
description: o,
|
|
@@ -4119,15 +4427,15 @@ var $ = {
|
|
|
4119
4427
|
children: Ye
|
|
4120
4428
|
});
|
|
4121
4429
|
});
|
|
4122
|
-
|
|
4430
|
+
mi.displayName = "Input";
|
|
4123
4431
|
//#endregion
|
|
4124
4432
|
//#region src/theme/ThemeContext.ts
|
|
4125
|
-
var
|
|
4126
|
-
let [o, s] =
|
|
4433
|
+
var hi = s(null), gi = (e) => e === "highContrast" ? "high-contrast" : e, _i = ({ theme: e, defaultTheme: t = "light", onThemeChange: r, syncDocument: i = !0, children: a }) => {
|
|
4434
|
+
let [o, s] = he({
|
|
4127
4435
|
value: e,
|
|
4128
4436
|
defaultValue: t,
|
|
4129
4437
|
onChange: r
|
|
4130
|
-
}), c =
|
|
4438
|
+
}), c = gi(o);
|
|
4131
4439
|
f(() => {
|
|
4132
4440
|
if (!i || typeof document > "u") return;
|
|
4133
4441
|
let { documentElement: e } = document, t = e.dataset.velliraTheme;
|
|
@@ -4143,7 +4451,7 @@ var Yr = s(null), Xr = (e) => e === "highContrast" ? "high-contrast" : e, Zr = (
|
|
|
4143
4451
|
theme: o,
|
|
4144
4452
|
setTheme: s
|
|
4145
4453
|
}), [o, s]);
|
|
4146
|
-
return /* @__PURE__ */ n(
|
|
4454
|
+
return /* @__PURE__ */ n(hi.Provider, {
|
|
4147
4455
|
value: l,
|
|
4148
4456
|
children: /* @__PURE__ */ n("div", {
|
|
4149
4457
|
"data-vellira-theme": c,
|
|
@@ -4151,13 +4459,13 @@ var Yr = s(null), Xr = (e) => e === "highContrast" ? "high-contrast" : e, Zr = (
|
|
|
4151
4459
|
})
|
|
4152
4460
|
});
|
|
4153
4461
|
};
|
|
4154
|
-
|
|
4462
|
+
_i.displayName = "ThemeProvider";
|
|
4155
4463
|
//#endregion
|
|
4156
4464
|
//#region src/theme/useTheme.ts
|
|
4157
|
-
function
|
|
4158
|
-
let e = d(
|
|
4465
|
+
function vi() {
|
|
4466
|
+
let e = d(hi);
|
|
4159
4467
|
if (!e) throw Error("useTheme must be used within ThemeProvider.");
|
|
4160
4468
|
return e;
|
|
4161
4469
|
}
|
|
4162
4470
|
//#endregion
|
|
4163
|
-
export {
|
|
4471
|
+
export { ii as Button, li as Checkbox, vt as Dropdown, rr as FormField, mi as Input, Kt as Modal, fn as Popover, Ce as Portal, Se as PortalProvider, _n as Radio, En as RadioGroup, vr as Select, Rr as Tabs, _i as ThemeProvider, ti as Tooltip, vi as useTheme };
|