@vellira-ui/react 2.44.4 → 2.45.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +538 -484
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -231,7 +231,7 @@ function H(e) {
|
|
|
231
231
|
}
|
|
232
232
|
//#endregion
|
|
233
233
|
//#region src/components/Dropdown/CheckboxItem/DropdownCheckboxItem.tsx
|
|
234
|
-
var ee = R("checkboxItem", "Dropdown.CheckboxItem"),
|
|
234
|
+
var ee = R("checkboxItem", "Dropdown.CheckboxItem"), U = ({ 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"), te = ({ active: e, enabled:
|
|
|
254
254
|
n,
|
|
255
255
|
t
|
|
256
256
|
]);
|
|
257
|
-
},
|
|
257
|
+
}, te = () => {
|
|
258
258
|
let e = !1;
|
|
259
259
|
return {
|
|
260
260
|
preventDefault: () => {
|
|
@@ -264,7 +264,7 @@ var ee = R("checkboxItem", "Dropdown.CheckboxItem"), te = ({ active: e, enabled:
|
|
|
264
264
|
return e;
|
|
265
265
|
}
|
|
266
266
|
};
|
|
267
|
-
},
|
|
267
|
+
}, ne = (e) => {
|
|
268
268
|
let t = !1;
|
|
269
269
|
return {
|
|
270
270
|
originalEvent: e,
|
|
@@ -275,23 +275,23 @@ var ee = R("checkboxItem", "Dropdown.CheckboxItem"), te = ({ active: e, enabled:
|
|
|
275
275
|
return t;
|
|
276
276
|
}
|
|
277
277
|
};
|
|
278
|
-
},
|
|
278
|
+
}, re = [
|
|
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(","), W = (e) => Array.from(e.querySelectorAll(re)).filter((e) => !e.hasAttribute("disabled")), ie = (e) => {
|
|
286
|
+
(W(e)[0] ?? e).focus();
|
|
287
|
+
}, ae = ({ 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 = te();
|
|
291
291
|
return o?.(l), l.defaultPrevented || queueMicrotask(() => {
|
|
292
|
-
r?.current?.focus(), !r?.current && t.current &&
|
|
292
|
+
r?.current?.focus(), !r?.current && t.current && ie(t.current);
|
|
293
293
|
}), () => {
|
|
294
|
-
let e =
|
|
294
|
+
let e = te();
|
|
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"), te = ({ 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 = W(t.current);
|
|
316
316
|
if (n.length === 0) {
|
|
317
317
|
e.preventDefault(), t.current.focus();
|
|
318
318
|
return;
|
|
@@ -332,7 +332,7 @@ var ee = R("checkboxItem", "Dropdown.CheckboxItem"), te = ({ active: e, enabled:
|
|
|
332
332
|
t,
|
|
333
333
|
n
|
|
334
334
|
]);
|
|
335
|
-
},
|
|
335
|
+
}, oe = ({ active: e, contentRef: t, ignoreRefs: n = [], closeOnEscape: r, closeOnOutsidePress: i, isTopOverlay: a, onEscapeKeyDown: o, onPointerDownOutside: s, onInteractOutside: c, requestClose: l }) => {
|
|
336
336
|
let u = g(n);
|
|
337
337
|
u.current = n, f(() => {
|
|
338
338
|
if (!e) return;
|
|
@@ -352,7 +352,7 @@ var ee = R("checkboxItem", "Dropdown.CheckboxItem"), te = ({ 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 = ne(e);
|
|
356
356
|
s?.(n), c?.(n), !(n.defaultPrevented || !i) && l();
|
|
357
357
|
};
|
|
358
358
|
return document.addEventListener("pointerdown", n), () => {
|
|
@@ -367,39 +367,39 @@ var ee = R("checkboxItem", "Dropdown.CheckboxItem"), te = ({ active: e, enabled:
|
|
|
367
367
|
s,
|
|
368
368
|
l
|
|
369
369
|
]);
|
|
370
|
-
},
|
|
370
|
+
}, G = [], se = {
|
|
371
371
|
add(e) {
|
|
372
|
-
|
|
372
|
+
G = G.filter((t) => t !== e), G.push(e);
|
|
373
373
|
},
|
|
374
374
|
remove(e) {
|
|
375
|
-
|
|
375
|
+
G = G.filter((t) => t !== e);
|
|
376
376
|
},
|
|
377
377
|
isTop(e) {
|
|
378
|
-
return
|
|
378
|
+
return G[G.length - 1] === e;
|
|
379
379
|
}
|
|
380
|
-
},
|
|
381
|
-
if (e) return
|
|
382
|
-
|
|
380
|
+
}, ce = ({ active: e, id: t }) => (f(() => {
|
|
381
|
+
if (e) return se.add(t), () => {
|
|
382
|
+
se.remove(t);
|
|
383
383
|
};
|
|
384
|
-
}, [e, t]), { isTopOverlay: u(() =>
|
|
384
|
+
}, [e, t]), { isTopOverlay: u(() => se.isTop(t), [t]) }), K = 0, le = "", ue = {
|
|
385
385
|
lock() {
|
|
386
|
-
typeof document > "u" || (
|
|
386
|
+
typeof document > "u" || (K === 0 && (le = document.body.style.overflow, document.body.style.overflow = "hidden"), K += 1);
|
|
387
387
|
},
|
|
388
388
|
unlock() {
|
|
389
|
-
typeof document > "u" || (
|
|
389
|
+
typeof document > "u" || (K = Math.max(0, K - 1), K === 0 && (document.body.style.overflow = le));
|
|
390
390
|
}
|
|
391
|
-
},
|
|
391
|
+
}, de = ({ active: e, enabled: t = !0 }) => {
|
|
392
392
|
f(() => {
|
|
393
|
-
if (!(!e || !t)) return
|
|
394
|
-
|
|
393
|
+
if (!(!e || !t)) return ue.lock(), () => {
|
|
394
|
+
ue.unlock();
|
|
395
395
|
};
|
|
396
396
|
}, [e, t]);
|
|
397
|
-
},
|
|
397
|
+
}, fe = () => typeof document > "u" ? null : document.body, pe = ({ 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") ?? fe() : null;
|
|
402
|
+
}, me = ({ 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);
|
|
@@ -572,7 +572,7 @@ var ee = R("checkboxItem", "Dropdown.CheckboxItem"), te = ({ active: e, enabled:
|
|
|
572
572
|
getLastEnabledIndex: y
|
|
573
573
|
};
|
|
574
574
|
}, _e = ({ open: e, defaultOpen: t = !1, onOpenChange: n, closeOnEscape: r, closeOnOutsidePress: i }) => {
|
|
575
|
-
let a = p(), o = p(), s = p(), [c, l] =
|
|
575
|
+
let a = p(), o = p(), s = p(), [c, l] = me({
|
|
576
576
|
value: e,
|
|
577
577
|
defaultValue: t,
|
|
578
578
|
onChange: n
|
|
@@ -591,11 +591,11 @@ var ee = R("checkboxItem", "Dropdown.CheckboxItem"), te = ({ active: e, enabled:
|
|
|
591
591
|
descriptionId: s
|
|
592
592
|
};
|
|
593
593
|
}, ve = ({ 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] =
|
|
594
|
+
let [m, g] = me({
|
|
595
595
|
value: e,
|
|
596
596
|
defaultValue: t ?? (a ? [] : ""),
|
|
597
597
|
onChange: n ?? r
|
|
598
|
-
}), [v, y] =
|
|
598
|
+
}), [v, y] = me({
|
|
599
599
|
value: l,
|
|
600
600
|
defaultValue: d,
|
|
601
601
|
onChange: p
|
|
@@ -695,7 +695,7 @@ var ee = R("checkboxItem", "Dropdown.CheckboxItem"), te = ({ active: e, enabled:
|
|
|
695
695
|
onKeyDown: j
|
|
696
696
|
};
|
|
697
697
|
}, ye = ({ value: e, defaultValue: t = "", onValueChange: n }) => {
|
|
698
|
-
let [r, i] =
|
|
698
|
+
let [r, i] = me({
|
|
699
699
|
value: e,
|
|
700
700
|
defaultValue: t,
|
|
701
701
|
onChange: n
|
|
@@ -708,7 +708,7 @@ var ee = R("checkboxItem", "Dropdown.CheckboxItem"), te = ({ active: e, enabled:
|
|
|
708
708
|
value: t,
|
|
709
709
|
children: e
|
|
710
710
|
}), Se = ({ children: e, container: t }) => {
|
|
711
|
-
let n = d(be), r =
|
|
711
|
+
let n = d(be), r = pe({ container: t ?? n });
|
|
712
712
|
return r ? v(e, r) : null;
|
|
713
713
|
};
|
|
714
714
|
Se.__velliraPortal = !0, Se.displayName = "Portal", xe.displayName = "PortalProvider";
|
|
@@ -1079,32 +1079,32 @@ function it(e) {
|
|
|
1079
1079
|
return typeof e == "number" ? `${e}px` : e;
|
|
1080
1080
|
}
|
|
1081
1081
|
var at = { wrapper: "_wrapper_14ue8_1" }, ot = ({ 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: I, className: L }) => {
|
|
1082
|
-
let R = p(), B = `${R}-trigger`, V = `${R}-menu`, H = g(null), ee = g(null), [
|
|
1082
|
+
let R = p(), B = `${R}-trigger`, V = `${R}-menu`, H = g(null), ee = g(null), [U, te] = _(), [ne, re] = _({}), [W, ie] = _(M), ae = j ?? W, G = h(() => z(e), [e]), se = G.content?.props.command ?? !1, K = k || A || se || !!G.search, le = h(() => ct(G.items), [G.items]), ue = h(() => G.items.map((e) => ({
|
|
1083
1083
|
disabled: e.disabled,
|
|
1084
1084
|
label: e.label
|
|
1085
|
-
})), [
|
|
1085
|
+
})), [G.items]), fe = h(() => !K || !ae.trim() ? G : lt(G, ae), [
|
|
1086
|
+
K,
|
|
1086
1087
|
G,
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
]), me = h(() => pe.items.map((e) => ({
|
|
1088
|
+
ae
|
|
1089
|
+
]), pe = h(() => fe.items.map((e) => ({
|
|
1090
1090
|
disabled: e.disabled,
|
|
1091
1091
|
label: e.label
|
|
1092
|
-
})), [
|
|
1092
|
+
})), [fe.items]);
|
|
1093
1093
|
f(() => {
|
|
1094
|
-
|
|
1094
|
+
re((e) => {
|
|
1095
1095
|
let t = { ...e };
|
|
1096
|
-
return
|
|
1096
|
+
return le.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:
|
|
1102
|
-
items:
|
|
1100
|
+
}, [le]);
|
|
1101
|
+
let { activeIndex: me, setActiveIndex: he, isOpen: _e, closeDropdown: ve, toggleDropdown: ye, onKeyDown: be } = ge({
|
|
1102
|
+
items: K ? 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) => (K ? fe.items : G.items)[t]?.id ?? "",
|
|
1108
1108
|
getItemText: (e) => e.label,
|
|
1109
1109
|
loop: T
|
|
1110
1110
|
}), { floatingStyles: xe, isMobileSheet: Se, isPositioned: Ce, setRef: we, setFloatingRef: Te } = tt({
|
|
@@ -1117,16 +1117,16 @@ var at = { wrapper: "_wrapper_14ue8_1" }, ot = ({ children: e, open: t, defaultO
|
|
|
1117
1117
|
collisionPadding: m,
|
|
1118
1118
|
mobileSheetBreakpoint: 640
|
|
1119
1119
|
}), Ee = u((e) => {
|
|
1120
|
-
j === void 0 &&
|
|
1120
|
+
j === void 0 && ie(e), P?.(e), he(0);
|
|
1121
1121
|
}, [
|
|
1122
1122
|
P,
|
|
1123
1123
|
j,
|
|
1124
1124
|
he
|
|
1125
|
-
]), { isTopOverlay: De } =
|
|
1125
|
+
]), { isTopOverlay: De } = ce({
|
|
1126
1126
|
active: _e,
|
|
1127
1127
|
id: V
|
|
1128
1128
|
});
|
|
1129
|
-
|
|
1129
|
+
de({
|
|
1130
1130
|
active: _e,
|
|
1131
1131
|
enabled: C
|
|
1132
1132
|
});
|
|
@@ -1135,10 +1135,10 @@ var at = { wrapper: "_wrapper_14ue8_1" }, ot = ({ children: e, open: t, defaultO
|
|
|
1135
1135
|
}, [ve]), ke = u((e, t) => {
|
|
1136
1136
|
if (e.disabled || D) return;
|
|
1137
1137
|
if (e.type === "subTrigger") {
|
|
1138
|
-
|
|
1138
|
+
te(e.id);
|
|
1139
1139
|
return;
|
|
1140
1140
|
}
|
|
1141
|
-
e.type === "item" && e.props.onSelect?.(t), e.type === "radio" && (
|
|
1141
|
+
e.type === "item" && e.props.onSelect?.(t), e.type === "radio" && (re((t) => ({
|
|
1142
1142
|
...t,
|
|
1143
1143
|
[e.groupId]: e.props.value
|
|
1144
1144
|
})), e.groupProps?.onValueChange?.(e.props.value));
|
|
@@ -1149,13 +1149,13 @@ 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 = fe.items[me];
|
|
1153
1153
|
if (e.key === "ArrowRight" && t?.type === "subTrigger") {
|
|
1154
|
-
e.preventDefault(),
|
|
1154
|
+
e.preventDefault(), te(t.id);
|
|
1155
1155
|
return;
|
|
1156
1156
|
}
|
|
1157
|
-
if (e.key === "ArrowLeft" &&
|
|
1158
|
-
e.preventDefault(),
|
|
1157
|
+
if (e.key === "ArrowLeft" && U) {
|
|
1158
|
+
e.preventDefault(), te(void 0);
|
|
1159
1159
|
return;
|
|
1160
1160
|
}
|
|
1161
1161
|
if ((e.key === "Enter" || e.key === " ") && t) {
|
|
@@ -1166,10 +1166,10 @@ var at = { wrapper: "_wrapper_14ue8_1" }, ot = ({ children: e, open: t, defaultO
|
|
|
1166
1166
|
}
|
|
1167
1167
|
be(e), e.key === "Escape" && H.current?.focus();
|
|
1168
1168
|
}, [
|
|
1169
|
-
|
|
1170
|
-
|
|
1169
|
+
me,
|
|
1170
|
+
fe.items,
|
|
1171
1171
|
be,
|
|
1172
|
-
|
|
1172
|
+
U,
|
|
1173
1173
|
ke
|
|
1174
1174
|
]), Ne = u((e) => {
|
|
1175
1175
|
e.preventDefault(), ye();
|
|
@@ -1178,7 +1178,7 @@ var at = { wrapper: "_wrapper_14ue8_1" }, ot = ({ children: e, open: t, defaultO
|
|
|
1178
1178
|
}, [we]), q = u((e) => {
|
|
1179
1179
|
ee.current = e, Te(e), Se && e?.focus({ preventScroll: !0 });
|
|
1180
1180
|
}, [Se, Te]);
|
|
1181
|
-
|
|
1181
|
+
oe({
|
|
1182
1182
|
active: _e,
|
|
1183
1183
|
closeOnEscape: !0,
|
|
1184
1184
|
closeOnOutsidePress: !0,
|
|
@@ -1204,36 +1204,36 @@ var at = { wrapper: "_wrapper_14ue8_1" }, ot = ({ children: e, open: t, defaultO
|
|
|
1204
1204
|
},
|
|
1205
1205
|
children: /* @__PURE__ */ n(je, {
|
|
1206
1206
|
value: {
|
|
1207
|
-
activeIndex:
|
|
1207
|
+
activeIndex: me,
|
|
1208
1208
|
closeOnSelect: w,
|
|
1209
1209
|
color: s,
|
|
1210
1210
|
contentReadyToFocus: Se || Ce,
|
|
1211
1211
|
contentId: V,
|
|
1212
|
-
contentProps:
|
|
1212
|
+
contentProps: G.content?.props,
|
|
1213
1213
|
disabled: E,
|
|
1214
|
-
entries:
|
|
1214
|
+
entries: fe.entries,
|
|
1215
1215
|
getItemId: (e) => `${V}-item-${e}`,
|
|
1216
1216
|
isOpen: _e,
|
|
1217
|
-
items:
|
|
1217
|
+
items: fe.items,
|
|
1218
1218
|
loading: D,
|
|
1219
1219
|
loadingText: O,
|
|
1220
1220
|
empty: I,
|
|
1221
1221
|
maxWidth: b,
|
|
1222
1222
|
minWidth: y,
|
|
1223
|
-
openSubId:
|
|
1223
|
+
openSubId: U,
|
|
1224
1224
|
onKeyDown: Ae,
|
|
1225
|
-
portal: !
|
|
1226
|
-
radioValues:
|
|
1227
|
-
searchPlaceholder:
|
|
1228
|
-
searchProps:
|
|
1229
|
-
searchValue:
|
|
1230
|
-
searchable:
|
|
1225
|
+
portal: !G.portal && x,
|
|
1226
|
+
radioValues: ne,
|
|
1227
|
+
searchPlaceholder: G.search?.props.placeholder ?? N ?? (A || se ? "Type a command..." : "Search actions..."),
|
|
1228
|
+
searchProps: G.search?.props,
|
|
1229
|
+
searchValue: ae,
|
|
1230
|
+
searchable: K,
|
|
1231
1231
|
selectItem: ke,
|
|
1232
1232
|
setActiveIndex: he,
|
|
1233
1233
|
setContentRef: q,
|
|
1234
|
-
setOpenSubId:
|
|
1234
|
+
setOpenSubId: te,
|
|
1235
1235
|
setRadioValue: (e, t) => {
|
|
1236
|
-
|
|
1236
|
+
re((n) => ({
|
|
1237
1237
|
...n,
|
|
1238
1238
|
[e]: t
|
|
1239
1239
|
}));
|
|
@@ -1246,7 +1246,7 @@ var at = { wrapper: "_wrapper_14ue8_1" }, ot = ({ children: e, open: t, defaultO
|
|
|
1246
1246
|
children: /* @__PURE__ */ r("div", {
|
|
1247
1247
|
className: F(at.wrapper, L),
|
|
1248
1248
|
"data-disabled": E || void 0,
|
|
1249
|
-
children: [
|
|
1249
|
+
children: [G.trigger ?? null, G.portal ?? G.content ?? /* @__PURE__ */ n(qe, {})]
|
|
1250
1250
|
})
|
|
1251
1251
|
})
|
|
1252
1252
|
});
|
|
@@ -1419,7 +1419,7 @@ kt.displayName = "Modal.Close";
|
|
|
1419
1419
|
//#endregion
|
|
1420
1420
|
//#region src/components/Modal/internal/useModalDismiss.ts
|
|
1421
1421
|
var At = ({ 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,
|
|
1425
1425
|
closeOnEscape: n,
|
|
@@ -1445,8 +1445,8 @@ var At = ({ active: e, contentRef: t, closeOnEscape: n, closeOnOutsidePress: r,
|
|
|
1445
1445
|
inside: "_inside_1tnw8_113",
|
|
1446
1446
|
outside: "_outside_1tnw8_117"
|
|
1447
1447
|
}, Mt = ({ 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 = bt(), m = p.open,
|
|
1449
|
-
p.setContentRef(e),
|
|
1448
|
+
let p = bt(), m = p.open, h = m && p.shouldRender, [g, v] = _(null), y = u((e) => {
|
|
1449
|
+
p.setContentRef(e), v(e);
|
|
1450
1450
|
}, [p]);
|
|
1451
1451
|
if (At({
|
|
1452
1452
|
active: m,
|
|
@@ -1458,8 +1458,8 @@ 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
|
-
}),
|
|
1462
|
-
active:
|
|
1461
|
+
}), ae({
|
|
1462
|
+
active: h,
|
|
1463
1463
|
contentRef: p.contentRef,
|
|
1464
1464
|
enabled: p.trapFocus,
|
|
1465
1465
|
finalFocus: p.finalFocus,
|
|
@@ -1467,17 +1467,17 @@ 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
|
+
}), U({
|
|
1471
1471
|
active: m,
|
|
1472
|
-
content:
|
|
1472
|
+
content: g,
|
|
1473
1473
|
enabled: p.modal
|
|
1474
1474
|
}), !p.shouldRender && !o) return null;
|
|
1475
|
-
let
|
|
1475
|
+
let b = c ?? (s ? void 0 : p.titleId), x = l ?? p.descriptionId;
|
|
1476
1476
|
return /* @__PURE__ */ n(Ct, {
|
|
1477
1477
|
value: { scrollBehavior: i },
|
|
1478
1478
|
children: /* @__PURE__ */ n("div", {
|
|
1479
1479
|
id: p.contentId,
|
|
1480
|
-
ref: Dt(
|
|
1480
|
+
ref: Dt(y),
|
|
1481
1481
|
tabIndex: -1,
|
|
1482
1482
|
className: F(jt.content, jt[t], jt[r], jt[i], a && jt.animated, d),
|
|
1483
1483
|
style: {
|
|
@@ -1487,8 +1487,8 @@ var At = ({ active: e, contentRef: t, closeOnEscape: n, closeOnOutsidePress: r,
|
|
|
1487
1487
|
role: p.role,
|
|
1488
1488
|
"aria-modal": p.modal ? "true" : void 0,
|
|
1489
1489
|
"aria-label": s,
|
|
1490
|
-
"aria-labelledby":
|
|
1491
|
-
"aria-describedby":
|
|
1490
|
+
"aria-labelledby": b,
|
|
1491
|
+
"aria-describedby": x,
|
|
1492
1492
|
"data-state": m ? "open" : "closed",
|
|
1493
1493
|
"data-animation": p.animation,
|
|
1494
1494
|
children: e
|
|
@@ -1586,19 +1586,19 @@ var Bt = {
|
|
|
1586
1586
|
window.clearTimeout(e);
|
|
1587
1587
|
};
|
|
1588
1588
|
}, [V, j]);
|
|
1589
|
-
let
|
|
1589
|
+
let U = u(() => {
|
|
1590
1590
|
M();
|
|
1591
|
-
}, [M]),
|
|
1591
|
+
}, [M]), te = u((e) => {
|
|
1592
1592
|
O.current = e;
|
|
1593
|
-
}, []), { isTopOverlay:
|
|
1593
|
+
}, []), { isTopOverlay: ne } = ce({
|
|
1594
1594
|
active: j,
|
|
1595
1595
|
id: k
|
|
1596
1596
|
});
|
|
1597
|
-
|
|
1597
|
+
de({
|
|
1598
1598
|
active: j,
|
|
1599
1599
|
enabled: p
|
|
1600
1600
|
});
|
|
1601
|
-
let
|
|
1601
|
+
let re = h(() => ({
|
|
1602
1602
|
"--modal-animation-close-duration": `${B.close}ms`,
|
|
1603
1603
|
"--modal-animation-easing": Bt[s],
|
|
1604
1604
|
"--modal-animation-open-duration": `${B.open}ms`
|
|
@@ -1618,7 +1618,7 @@ var Bt = {
|
|
|
1618
1618
|
]), /* @__PURE__ */ n(St, {
|
|
1619
1619
|
value: h(() => ({
|
|
1620
1620
|
animation: a,
|
|
1621
|
-
animationStyle:
|
|
1621
|
+
animationStyle: re,
|
|
1622
1622
|
closeOnEscape: l,
|
|
1623
1623
|
closeOnOutsidePress: d,
|
|
1624
1624
|
contentId: k,
|
|
@@ -1626,7 +1626,7 @@ var Bt = {
|
|
|
1626
1626
|
descriptionId: A,
|
|
1627
1627
|
finalFocus: b,
|
|
1628
1628
|
initialFocus: y,
|
|
1629
|
-
isTopModal:
|
|
1629
|
+
isTopModal: ne,
|
|
1630
1630
|
modal: c,
|
|
1631
1631
|
onCloseAutoFocus: S,
|
|
1632
1632
|
onEscapeKeyDown: C,
|
|
@@ -1635,10 +1635,10 @@ var Bt = {
|
|
|
1635
1635
|
onPointerDownOutside: w,
|
|
1636
1636
|
open: j,
|
|
1637
1637
|
preventScroll: p,
|
|
1638
|
-
requestClose:
|
|
1638
|
+
requestClose: U,
|
|
1639
1639
|
restoreFocus: m,
|
|
1640
1640
|
role: E,
|
|
1641
|
-
setContentRef:
|
|
1641
|
+
setContentRef: te,
|
|
1642
1642
|
setDescriptionPresent: z,
|
|
1643
1643
|
setOpen: N,
|
|
1644
1644
|
setTitlePresent: L,
|
|
@@ -1647,14 +1647,14 @@ var Bt = {
|
|
|
1647
1647
|
trapFocus: v
|
|
1648
1648
|
}), [
|
|
1649
1649
|
a,
|
|
1650
|
-
|
|
1650
|
+
re,
|
|
1651
1651
|
l,
|
|
1652
1652
|
d,
|
|
1653
1653
|
k,
|
|
1654
1654
|
A,
|
|
1655
1655
|
b,
|
|
1656
1656
|
y,
|
|
1657
|
-
|
|
1657
|
+
ne,
|
|
1658
1658
|
j,
|
|
1659
1659
|
c,
|
|
1660
1660
|
S,
|
|
@@ -1663,10 +1663,10 @@ var Bt = {
|
|
|
1663
1663
|
x,
|
|
1664
1664
|
w,
|
|
1665
1665
|
p,
|
|
1666
|
-
|
|
1666
|
+
U,
|
|
1667
1667
|
m,
|
|
1668
1668
|
E,
|
|
1669
|
-
|
|
1669
|
+
te,
|
|
1670
1670
|
N,
|
|
1671
1671
|
H,
|
|
1672
1672
|
P,
|
|
@@ -1727,28 +1727,28 @@ function Jt() {
|
|
|
1727
1727
|
return d(Kt);
|
|
1728
1728
|
}
|
|
1729
1729
|
var J = {
|
|
1730
|
-
root: "
|
|
1731
|
-
invalid: "
|
|
1732
|
-
control: "
|
|
1733
|
-
label: "
|
|
1734
|
-
wrapper: "
|
|
1735
|
-
input: "
|
|
1736
|
-
disabled: "
|
|
1737
|
-
description: "
|
|
1738
|
-
colorPrimary: "
|
|
1739
|
-
colorNeutral: "
|
|
1740
|
-
colorSuccess: "
|
|
1741
|
-
colorWarning: "
|
|
1742
|
-
colorDanger: "
|
|
1743
|
-
sm: "
|
|
1744
|
-
md: "
|
|
1745
|
-
lg: "
|
|
1746
|
-
indicator: "
|
|
1747
|
-
customIcon: "
|
|
1748
|
-
"radio-pop": "_radio-
|
|
1749
|
-
"radio-indicator-in": "_radio-indicator-
|
|
1750
|
-
content: "
|
|
1751
|
-
error: "
|
|
1730
|
+
root: "_root_7yrws_1",
|
|
1731
|
+
invalid: "_invalid_7yrws_34",
|
|
1732
|
+
control: "_control_7yrws_34",
|
|
1733
|
+
label: "_label_7yrws_37",
|
|
1734
|
+
wrapper: "_wrapper_7yrws_40",
|
|
1735
|
+
input: "_input_7yrws_41",
|
|
1736
|
+
disabled: "_disabled_7yrws_44",
|
|
1737
|
+
description: "_description_7yrws_52",
|
|
1738
|
+
colorPrimary: "_colorPrimary_7yrws_56",
|
|
1739
|
+
colorNeutral: "_colorNeutral_7yrws_72",
|
|
1740
|
+
colorSuccess: "_colorSuccess_7yrws_88",
|
|
1741
|
+
colorWarning: "_colorWarning_7yrws_104",
|
|
1742
|
+
colorDanger: "_colorDanger_7yrws_120",
|
|
1743
|
+
sm: "_sm_7yrws_136",
|
|
1744
|
+
md: "_md_7yrws_145",
|
|
1745
|
+
lg: "_lg_7yrws_154",
|
|
1746
|
+
indicator: "_indicator_7yrws_209",
|
|
1747
|
+
customIcon: "_customIcon_7yrws_223",
|
|
1748
|
+
"radio-pop": "_radio-pop_7yrws_1",
|
|
1749
|
+
"radio-indicator-in": "_radio-indicator-in_7yrws_1",
|
|
1750
|
+
content: "_content_7yrws_346",
|
|
1751
|
+
error: "_error_7yrws_363"
|
|
1752
1752
|
}, Yt = {
|
|
1753
1753
|
primary: J.colorPrimary,
|
|
1754
1754
|
neutral: J.colorNeutral,
|
|
@@ -1761,7 +1761,7 @@ var J = {
|
|
|
1761
1761
|
E,
|
|
1762
1762
|
S?.describedBy,
|
|
1763
1763
|
y
|
|
1764
|
-
].filter(Boolean).join(" ") || void 0, O = S !== null, [k, A] =
|
|
1764
|
+
].filter(Boolean).join(" ") || void 0, O = S !== null, [k, A] = me({
|
|
1765
1765
|
value: t,
|
|
1766
1766
|
defaultValue: i,
|
|
1767
1767
|
onChange: u
|
|
@@ -1864,7 +1864,7 @@ var rn = {
|
|
|
1864
1864
|
disabled: "_disabled_1s3vp_160",
|
|
1865
1865
|
invalid: "_invalid_1s3vp_176"
|
|
1866
1866
|
}, an = 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) => {
|
|
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] =
|
|
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] = me({
|
|
1868
1868
|
value: e,
|
|
1869
1869
|
defaultValue: t,
|
|
1870
1870
|
onChange: i
|
|
@@ -2077,16 +2077,16 @@ var Y = {
|
|
|
2077
2077
|
};
|
|
2078
2078
|
mn.__velliraSelectPart = "content", mn.displayName = "Select.Content";
|
|
2079
2079
|
var hn = ({ 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 }) => {
|
|
2080
|
-
let V = g(null), H = g(!1), [ee,
|
|
2080
|
+
let V = g(null), H = g(!1), [ee, U] = _(null), [te, ne] = _(0), { bottomSpacerHeight: re, isVirtual: W, itemHeight: ie, startIndex: ae, topSpacerHeight: oe, viewportHeight: G, visibleOptions: se } = un({
|
|
2081
2081
|
loading: T,
|
|
2082
2082
|
options: c,
|
|
2083
|
-
scrollTop:
|
|
2083
|
+
scrollTop: te,
|
|
2084
2084
|
virtual: b
|
|
2085
|
-
}),
|
|
2086
|
-
|
|
2085
|
+
}), ce = u((e) => {
|
|
2086
|
+
U(e), o(e);
|
|
2087
2087
|
}, [o]);
|
|
2088
2088
|
if (f(() => {
|
|
2089
|
-
e || (H.current = !1,
|
|
2089
|
+
e || (H.current = !1, ne(0));
|
|
2090
2090
|
}, [e, C]), f(() => {
|
|
2091
2091
|
if (!e || !v) return;
|
|
2092
2092
|
let t = window.setTimeout(() => {
|
|
@@ -2100,9 +2100,9 @@ var hn = ({ isOpen: e, listboxId: i, labelledById: a, setDropdownRef: o, style:
|
|
|
2100
2100
|
H.current = !0;
|
|
2101
2101
|
return;
|
|
2102
2102
|
}
|
|
2103
|
-
if (H.current = !0,
|
|
2104
|
-
let e = Math.max(0, n *
|
|
2105
|
-
|
|
2103
|
+
if (H.current = !0, W) {
|
|
2104
|
+
let e = Math.max(0, n * ie - (G - ie) / 2);
|
|
2105
|
+
ne(e), ee.scrollTop = e;
|
|
2106
2106
|
return;
|
|
2107
2107
|
}
|
|
2108
2108
|
document.getElementById(`${i}-option-${n}`)?.scrollIntoView?.({ block: "nearest" });
|
|
@@ -2110,21 +2110,21 @@ var hn = ({ isOpen: e, listboxId: i, labelledById: a, setDropdownRef: o, style:
|
|
|
2110
2110
|
P,
|
|
2111
2111
|
ee,
|
|
2112
2112
|
e,
|
|
2113
|
-
|
|
2114
|
-
|
|
2113
|
+
W,
|
|
2114
|
+
ie,
|
|
2115
2115
|
i,
|
|
2116
2116
|
T,
|
|
2117
2117
|
c,
|
|
2118
2118
|
N,
|
|
2119
2119
|
p,
|
|
2120
|
-
|
|
2120
|
+
G
|
|
2121
2121
|
]), !e) return null;
|
|
2122
|
-
let
|
|
2122
|
+
let K = l && !W ? l : se.map((e, t) => ({
|
|
2123
2123
|
type: "option",
|
|
2124
2124
|
option: e,
|
|
2125
|
-
optionIndex:
|
|
2126
|
-
})),
|
|
2127
|
-
ref:
|
|
2125
|
+
optionIndex: ae + t
|
|
2126
|
+
})), le = /* @__PURE__ */ r("div", {
|
|
2127
|
+
ref: ce,
|
|
2128
2128
|
tabIndex: 0,
|
|
2129
2129
|
className: [
|
|
2130
2130
|
Y.dropdown,
|
|
@@ -2135,7 +2135,7 @@ var hn = ({ isOpen: e, listboxId: i, labelledById: a, setDropdownRef: o, style:
|
|
|
2135
2135
|
].filter(Boolean).join(" "),
|
|
2136
2136
|
style: s,
|
|
2137
2137
|
onScroll: (e) => {
|
|
2138
|
-
|
|
2138
|
+
W && ne(e.currentTarget.scrollTop);
|
|
2139
2139
|
},
|
|
2140
2140
|
children: [
|
|
2141
2141
|
k,
|
|
@@ -2171,12 +2171,12 @@ var hn = ({ isOpen: e, listboxId: i, labelledById: a, setDropdownRef: o, style:
|
|
|
2171
2171
|
className: Y.empty,
|
|
2172
2172
|
children: j ?? E
|
|
2173
2173
|
}) : c.length ? /* @__PURE__ */ r(t, { children: [
|
|
2174
|
-
|
|
2174
|
+
W && /* @__PURE__ */ n("li", {
|
|
2175
2175
|
"aria-hidden": "true",
|
|
2176
2176
|
className: Y.virtualSpacer,
|
|
2177
|
-
style: { height:
|
|
2177
|
+
style: { height: oe }
|
|
2178
2178
|
}),
|
|
2179
|
-
|
|
2179
|
+
K.map((e) => {
|
|
2180
2180
|
if (e.type === "group") {
|
|
2181
2181
|
if (e.selectable && d) {
|
|
2182
2182
|
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;
|
|
@@ -2226,10 +2226,10 @@ var hn = ({ isOpen: e, listboxId: i, labelledById: a, setDropdownRef: o, style:
|
|
|
2226
2226
|
onMouseEnter: () => z(a)
|
|
2227
2227
|
}, t.value);
|
|
2228
2228
|
}),
|
|
2229
|
-
|
|
2229
|
+
W && /* @__PURE__ */ n("li", {
|
|
2230
2230
|
"aria-hidden": "true",
|
|
2231
2231
|
className: Y.virtualSpacer,
|
|
2232
|
-
style: { height:
|
|
2232
|
+
style: { height: re }
|
|
2233
2233
|
})
|
|
2234
2234
|
] }) : /* @__PURE__ */ n("li", {
|
|
2235
2235
|
role: "option",
|
|
@@ -2241,7 +2241,7 @@ var hn = ({ isOpen: e, listboxId: i, labelledById: a, setDropdownRef: o, style:
|
|
|
2241
2241
|
})
|
|
2242
2242
|
]
|
|
2243
2243
|
});
|
|
2244
|
-
return x ? /* @__PURE__ */ n(Se, { children:
|
|
2244
|
+
return x ? /* @__PURE__ */ n(Se, { children: le }) : le;
|
|
2245
2245
|
};
|
|
2246
2246
|
hn.displayName = "SelectContentSurface";
|
|
2247
2247
|
function gn(e) {
|
|
@@ -2330,106 +2330,160 @@ var En = () => null;
|
|
|
2330
2330
|
En.__velliraSelectPart = "itemIcon", En.displayName = "Select.ItemIcon";
|
|
2331
2331
|
//#endregion
|
|
2332
2332
|
//#region src/patterns/FormField/FormFieldContext.ts
|
|
2333
|
-
var Dn = s(null), On = () => d(Dn),
|
|
2334
|
-
wrapper: "
|
|
2335
|
-
sm: "
|
|
2336
|
-
md: "
|
|
2337
|
-
lg: "
|
|
2338
|
-
horizontal: "
|
|
2339
|
-
start: "
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2333
|
+
var Dn = s(null), On = () => d(Dn), X = {
|
|
2334
|
+
wrapper: "_wrapper_r078u_1",
|
|
2335
|
+
sm: "_sm_r078u_41",
|
|
2336
|
+
md: "_md_r078u_78",
|
|
2337
|
+
lg: "_lg_r078u_115",
|
|
2338
|
+
horizontal: "_horizontal_r078u_152",
|
|
2339
|
+
start: "_start_r078u_153",
|
|
2340
|
+
labelRow: "_labelRow_r078u_160",
|
|
2341
|
+
description: "_description_r078u_161",
|
|
2342
|
+
control: "_control_r078u_162",
|
|
2343
|
+
message: "_message_r078u_163",
|
|
2344
|
+
label: "_label_r078u_160",
|
|
2345
|
+
labelText: "_labelText_r078u_196",
|
|
2346
|
+
required: "_required_r078u_200",
|
|
2347
|
+
optional: "_optional_r078u_204",
|
|
2348
|
+
labelInfo: "_labelInfo_r078u_211",
|
|
2349
|
+
labelAction: "_labelAction_r078u_224",
|
|
2350
|
+
messageToneNeutral: "_messageToneNeutral_r078u_249",
|
|
2351
|
+
messageToneSuccess: "_messageToneSuccess_r078u_253",
|
|
2352
|
+
messageToneWarning: "_messageToneWarning_r078u_257",
|
|
2353
|
+
messageToneDanger: "_messageToneDanger_r078u_261",
|
|
2354
|
+
disabled: "_disabled_r078u_274"
|
|
2355
|
+
}, kn = (...e) => e.filter(Boolean).join(" ") || void 0;
|
|
2356
|
+
function An(e, t) {
|
|
2357
|
+
let n = () => null;
|
|
2358
|
+
return n.__velliraFormFieldPart = e, n.displayName = t, n;
|
|
2359
|
+
}
|
|
2360
|
+
function jn(e) {
|
|
2361
|
+
let t = [], n = { hasSlots: !1 };
|
|
2362
|
+
return i.forEach(e, (e) => {
|
|
2363
|
+
if (!l(e)) {
|
|
2364
|
+
e != null && e !== !1 && t.push(e);
|
|
2365
|
+
return;
|
|
2366
|
+
}
|
|
2367
|
+
switch (e.type.__velliraFormFieldPart) {
|
|
2368
|
+
case "label":
|
|
2369
|
+
n.hasSlots = !0, n.label = e.props;
|
|
2370
|
+
return;
|
|
2371
|
+
case "description":
|
|
2372
|
+
n.hasSlots = !0, n.description = e.props;
|
|
2373
|
+
return;
|
|
2374
|
+
case "control":
|
|
2375
|
+
n.hasSlots = !0, n.control = e.props;
|
|
2376
|
+
return;
|
|
2377
|
+
case "message":
|
|
2378
|
+
n.hasSlots = !0, n.message = e.props;
|
|
2379
|
+
return;
|
|
2380
|
+
default: t.push(e);
|
|
2381
|
+
}
|
|
2382
|
+
}), t.length > 0 && (n.fallbackChildren = t.length === 1 ? t[0] : t), n;
|
|
2383
|
+
}
|
|
2384
|
+
var Mn = ({ 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 }) => {
|
|
2385
|
+
let j = jn(S), M = t ?? j.label?.children, N = i ?? j.description?.children, P = c ?? j.message?.children, I = 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, H = j.control?.bindControl ?? C, ee = p(), U = e ?? ee, 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, oe = s ? "danger" : I, G = {
|
|
2386
|
+
neutral: X.messageToneNeutral,
|
|
2387
|
+
success: X.messageToneSuccess,
|
|
2388
|
+
warning: X.messageToneWarning,
|
|
2389
|
+
danger: X.messageToneDanger
|
|
2390
|
+
}[oe], se = kn(te), ce = kn(ne, re, W), K = {
|
|
2391
|
+
controlId: U,
|
|
2392
|
+
labelId: te,
|
|
2393
|
+
descriptionId: ne,
|
|
2394
|
+
errorId: re,
|
|
2395
|
+
messageId: W,
|
|
2396
|
+
required: f,
|
|
2397
|
+
disabled: m,
|
|
2398
|
+
invalid: ie,
|
|
2399
|
+
size: v,
|
|
2400
|
+
ariaLabelledBy: se,
|
|
2401
|
+
ariaDescribedBy: ce
|
|
2402
|
+
}, le = l(V) && V.type !== a ? V : void 0, ue = H && le ? o(le, {
|
|
2403
|
+
id: le.props.id ?? U,
|
|
2404
|
+
required: le.props.required ?? f,
|
|
2405
|
+
disabled: le.props.disabled ?? m,
|
|
2406
|
+
"aria-invalid": le.props["aria-invalid"] ?? (ie || void 0),
|
|
2407
|
+
"aria-labelledby": kn(le.props["aria-labelledby"], se),
|
|
2408
|
+
"aria-describedby": kn(le.props["aria-describedby"], ce)
|
|
2409
|
+
}) : V;
|
|
2369
2410
|
return /* @__PURE__ */ r("div", {
|
|
2370
|
-
...
|
|
2371
|
-
"aria-disabled":
|
|
2372
|
-
className: F(
|
|
2373
|
-
"data-disabled":
|
|
2374
|
-
"data-invalid":
|
|
2375
|
-
"data-orientation":
|
|
2376
|
-
"data-size":
|
|
2411
|
+
...A,
|
|
2412
|
+
"aria-disabled": m || void 0,
|
|
2413
|
+
className: F(X.wrapper, X[g], X[_], X[v], m && X.disabled, w),
|
|
2414
|
+
"data-disabled": m || void 0,
|
|
2415
|
+
"data-invalid": ie || void 0,
|
|
2416
|
+
"data-orientation": g,
|
|
2417
|
+
"data-size": v,
|
|
2377
2418
|
children: [
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2419
|
+
(M || z) && /* @__PURE__ */ r("div", {
|
|
2420
|
+
className: X.labelRow,
|
|
2421
|
+
children: [M && /* @__PURE__ */ r("label", {
|
|
2422
|
+
id: te,
|
|
2423
|
+
htmlFor: U,
|
|
2424
|
+
className: F(X.label, j.label?.className, E),
|
|
2425
|
+
children: [
|
|
2426
|
+
/* @__PURE__ */ n("span", {
|
|
2427
|
+
className: X.labelText,
|
|
2428
|
+
children: M
|
|
2429
|
+
}),
|
|
2430
|
+
f && /* @__PURE__ */ n("span", {
|
|
2431
|
+
className: X.required,
|
|
2432
|
+
"aria-hidden": "true",
|
|
2433
|
+
children: "*"
|
|
2434
|
+
}),
|
|
2435
|
+
!f && B && /* @__PURE__ */ n("span", {
|
|
2436
|
+
className: X.optional,
|
|
2437
|
+
children: B
|
|
2438
|
+
}),
|
|
2439
|
+
R && /* @__PURE__ */ n("span", {
|
|
2440
|
+
className: X.labelInfo,
|
|
2441
|
+
children: R
|
|
2442
|
+
})
|
|
2443
|
+
]
|
|
2444
|
+
}), z && /* @__PURE__ */ n("div", {
|
|
2445
|
+
className: X.labelAction,
|
|
2446
|
+
children: z
|
|
2447
|
+
})]
|
|
2401
2448
|
}),
|
|
2402
|
-
|
|
2403
|
-
id:
|
|
2404
|
-
className: F(
|
|
2405
|
-
children:
|
|
2449
|
+
N && /* @__PURE__ */ n("div", {
|
|
2450
|
+
id: ne,
|
|
2451
|
+
className: F(X.description, j.description?.className, D),
|
|
2452
|
+
children: N
|
|
2406
2453
|
}),
|
|
2407
2454
|
/* @__PURE__ */ n(Dn.Provider, {
|
|
2408
|
-
value:
|
|
2455
|
+
value: K,
|
|
2409
2456
|
children: /* @__PURE__ */ n("div", {
|
|
2410
|
-
className: F(
|
|
2411
|
-
children:
|
|
2457
|
+
className: F(X.control, j.control?.className, T),
|
|
2458
|
+
children: ue
|
|
2412
2459
|
})
|
|
2413
2460
|
}),
|
|
2414
|
-
|
|
2415
|
-
id:
|
|
2416
|
-
className: F(
|
|
2417
|
-
role: "alert",
|
|
2418
|
-
|
|
2461
|
+
ae && /* @__PURE__ */ n("div", {
|
|
2462
|
+
id: s ? re : W,
|
|
2463
|
+
className: F(X.message, G, !s && j.message?.className, s ? O : k),
|
|
2464
|
+
role: s ? "alert" : void 0,
|
|
2465
|
+
"aria-live": !s && L === "polite" ? "polite" : void 0,
|
|
2466
|
+
children: ae
|
|
2419
2467
|
})
|
|
2420
2468
|
]
|
|
2421
2469
|
});
|
|
2422
|
-
}
|
|
2470
|
+
}, Nn = An("label", "FormField.Label"), Pn = An("description", "FormField.Description"), Fn = An("control", "FormField.Control"), In = An("message", "FormField.Message"), Ln = Object.assign(Mn, {
|
|
2471
|
+
Label: Nn,
|
|
2472
|
+
Description: Pn,
|
|
2473
|
+
Control: Fn,
|
|
2474
|
+
Message: In,
|
|
2475
|
+
displayName: "FormField"
|
|
2476
|
+
});
|
|
2423
2477
|
//#endregion
|
|
2424
2478
|
//#region src/components/Select/internal/SelectCollection.ts
|
|
2425
|
-
function
|
|
2479
|
+
function Rn(e) {
|
|
2426
2480
|
let t = [], n = [], r = 0;
|
|
2427
2481
|
function a(e) {
|
|
2428
2482
|
i.forEach(e, (e) => {
|
|
2429
2483
|
if (!l(e)) return;
|
|
2430
2484
|
let i = e.type;
|
|
2431
2485
|
if (i.__velliraSelectPart === "group") {
|
|
2432
|
-
let n = e.props, i =
|
|
2486
|
+
let n = e.props, i = Bn(n.children);
|
|
2433
2487
|
t.push({
|
|
2434
2488
|
type: "group",
|
|
2435
2489
|
id: `group-${r++}`,
|
|
@@ -2441,7 +2495,7 @@ function Mn(e) {
|
|
|
2441
2495
|
return;
|
|
2442
2496
|
}
|
|
2443
2497
|
if (i.__velliraSelectPart === "item") {
|
|
2444
|
-
let r = e.props, i =
|
|
2498
|
+
let r = e.props, i = Vn(r.children, r.value), a = r.label ?? i.label, o = n.length, s = {
|
|
2445
2499
|
label: a,
|
|
2446
2500
|
value: r.value,
|
|
2447
2501
|
disabled: r.disabled,
|
|
@@ -2473,7 +2527,7 @@ function Mn(e) {
|
|
|
2473
2527
|
options: n
|
|
2474
2528
|
};
|
|
2475
2529
|
}
|
|
2476
|
-
function
|
|
2530
|
+
function zn(e) {
|
|
2477
2531
|
let t = !1;
|
|
2478
2532
|
function n(e) {
|
|
2479
2533
|
i.forEach(e, (e) => {
|
|
@@ -2488,7 +2542,7 @@ function Nn(e) {
|
|
|
2488
2542
|
}
|
|
2489
2543
|
return n(e), t;
|
|
2490
2544
|
}
|
|
2491
|
-
function
|
|
2545
|
+
function Bn(e) {
|
|
2492
2546
|
let t = [];
|
|
2493
2547
|
function n(e) {
|
|
2494
2548
|
i.forEach(e, (e) => {
|
|
@@ -2503,7 +2557,7 @@ function Pn(e) {
|
|
|
2503
2557
|
}
|
|
2504
2558
|
return n(e), t;
|
|
2505
2559
|
}
|
|
2506
|
-
function
|
|
2560
|
+
function Vn(e, t) {
|
|
2507
2561
|
let n, r, a, o = [];
|
|
2508
2562
|
function s(e) {
|
|
2509
2563
|
i.forEach(e, (e) => {
|
|
@@ -2539,12 +2593,12 @@ function Fn(e, t) {
|
|
|
2539
2593
|
}
|
|
2540
2594
|
//#endregion
|
|
2541
2595
|
//#region src/components/Select/internal/useSelectCollection.ts
|
|
2542
|
-
function
|
|
2543
|
-
return h(() =>
|
|
2596
|
+
function Hn(e) {
|
|
2597
|
+
return h(() => Rn(e), [e]);
|
|
2544
2598
|
}
|
|
2545
2599
|
//#endregion
|
|
2546
2600
|
//#region src/components/Select/internal/useSelectPosition.ts
|
|
2547
|
-
function
|
|
2601
|
+
function Un({ avoidCollisions: e, isOpen: t, matchTriggerWidth: n, onOpenChange: r, placement: i }) {
|
|
2548
2602
|
return tt({
|
|
2549
2603
|
open: t,
|
|
2550
2604
|
onOpenChange: r,
|
|
@@ -2556,21 +2610,21 @@ function Ln({ avoidCollisions: e, isOpen: t, matchTriggerWidth: n, onOpenChange:
|
|
|
2556
2610
|
}
|
|
2557
2611
|
//#endregion
|
|
2558
2612
|
//#region src/components/Select/internal/useSelectSearch.ts
|
|
2559
|
-
function
|
|
2613
|
+
function Wn({ options: e, searchable: t, searchValue: n }) {
|
|
2560
2614
|
return h(() => {
|
|
2561
2615
|
if (!t || !n) return e;
|
|
2562
2616
|
let r = n.toLocaleLowerCase();
|
|
2563
|
-
return e.filter((e) => `${e.label} ${
|
|
2617
|
+
return e.filter((e) => `${e.label} ${Gn(e.description)}`.toLocaleLowerCase().includes(r));
|
|
2564
2618
|
}, [
|
|
2565
2619
|
e,
|
|
2566
2620
|
n,
|
|
2567
2621
|
t
|
|
2568
2622
|
]);
|
|
2569
2623
|
}
|
|
2570
|
-
function
|
|
2624
|
+
function Gn(e) {
|
|
2571
2625
|
return typeof e == "string" || typeof e == "number" ? String(e) : "";
|
|
2572
2626
|
}
|
|
2573
|
-
var
|
|
2627
|
+
var Z = {
|
|
2574
2628
|
control: "_control_ao6y1_1",
|
|
2575
2629
|
disabled: "_disabled_ao6y1_43",
|
|
2576
2630
|
arrow: "_arrow_ao6y1_49",
|
|
@@ -2596,16 +2650,16 @@ var X = {
|
|
|
2596
2650
|
spin: "_spin_ao6y1_795",
|
|
2597
2651
|
loading: "_loading_ao6y1_804",
|
|
2598
2652
|
open: "_open_ao6y1_823"
|
|
2599
|
-
},
|
|
2653
|
+
}, Kn = ({ children: e, className: t }) => {
|
|
2600
2654
|
let { triggerProps: r } = ln();
|
|
2601
|
-
return /* @__PURE__ */ n(
|
|
2655
|
+
return /* @__PURE__ */ n(qn, {
|
|
2602
2656
|
...r,
|
|
2603
2657
|
className: [r.className, t].filter(Boolean).join(" "),
|
|
2604
2658
|
children: e
|
|
2605
2659
|
});
|
|
2606
2660
|
};
|
|
2607
|
-
|
|
2608
|
-
var
|
|
2661
|
+
Kn.__velliraSelectPart = "trigger", Kn.displayName = "Select.Trigger";
|
|
2662
|
+
var qn = ({ 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", {
|
|
2609
2663
|
id: i,
|
|
2610
2664
|
ref: k,
|
|
2611
2665
|
type: "button",
|
|
@@ -2621,10 +2675,10 @@ var Vn = ({ children: e, id: i, describedBy: a, labelledBy: o, isOpen: s, disabl
|
|
|
2621
2675
|
"aria-controls": s ? u : void 0,
|
|
2622
2676
|
"aria-describedby": a,
|
|
2623
2677
|
"aria-activedescendant": s && d >= 0 ? `${u}-option-${d}` : void 0,
|
|
2624
|
-
className: F(
|
|
2625
|
-
[
|
|
2626
|
-
[
|
|
2627
|
-
[
|
|
2678
|
+
className: F(Z.control, Z[g], Z[v], Z[_], {
|
|
2679
|
+
[Z.error]: !!p,
|
|
2680
|
+
[Z.disabled]: c,
|
|
2681
|
+
[Z.loading]: y
|
|
2628
2682
|
}, O),
|
|
2629
2683
|
onClick: A,
|
|
2630
2684
|
onKeyDown: j,
|
|
@@ -2632,51 +2686,51 @@ var Vn = ({ children: e, id: i, describedBy: a, labelledBy: o, isOpen: s, disabl
|
|
|
2632
2686
|
onFocus: N,
|
|
2633
2687
|
children: e ?? /* @__PURE__ */ r(t, { children: [
|
|
2634
2688
|
x && /* @__PURE__ */ n("span", {
|
|
2635
|
-
className:
|
|
2689
|
+
className: Z.adornment,
|
|
2636
2690
|
children: x
|
|
2637
2691
|
}),
|
|
2638
2692
|
w && /* @__PURE__ */ n("span", {
|
|
2639
|
-
className:
|
|
2693
|
+
className: Z.affix,
|
|
2640
2694
|
children: w
|
|
2641
2695
|
}),
|
|
2642
2696
|
/* @__PURE__ */ n("span", {
|
|
2643
|
-
className:
|
|
2697
|
+
className: Z.valueWrap,
|
|
2644
2698
|
children: /* @__PURE__ */ n("span", {
|
|
2645
|
-
className: F(
|
|
2699
|
+
className: F(Z.value, { [Z.placeholder]: h }),
|
|
2646
2700
|
children: m
|
|
2647
2701
|
})
|
|
2648
2702
|
}),
|
|
2649
2703
|
T && /* @__PURE__ */ n("span", {
|
|
2650
|
-
className:
|
|
2704
|
+
className: Z.affix,
|
|
2651
2705
|
children: T
|
|
2652
2706
|
}),
|
|
2653
2707
|
E && /* @__PURE__ */ n("span", {
|
|
2654
2708
|
role: "button",
|
|
2655
2709
|
"aria-label": "Clear selection",
|
|
2656
2710
|
tabIndex: -1,
|
|
2657
|
-
className:
|
|
2711
|
+
className: Z.clear,
|
|
2658
2712
|
onClick: (e) => {
|
|
2659
2713
|
e.stopPropagation(), D?.();
|
|
2660
2714
|
},
|
|
2661
2715
|
children: /* @__PURE__ */ n(S, {})
|
|
2662
2716
|
}),
|
|
2663
2717
|
/* @__PURE__ */ n("span", {
|
|
2664
|
-
className: F(
|
|
2718
|
+
className: F(Z.arrow, { [Z.open]: s }),
|
|
2665
2719
|
"aria-hidden": "true",
|
|
2666
|
-
children: y ? /* @__PURE__ */ n("span", { className:
|
|
2720
|
+
children: y ? /* @__PURE__ */ n("span", { className: Z.spinner }) : C ?? /* @__PURE__ */ n(b, {})
|
|
2667
2721
|
})
|
|
2668
2722
|
] })
|
|
2669
2723
|
});
|
|
2670
|
-
|
|
2724
|
+
qn.displayName = "SelectTriggerSurface";
|
|
2671
2725
|
//#endregion
|
|
2672
2726
|
//#region src/components/Select/Root/SelectRoot.tsx
|
|
2673
|
-
var
|
|
2727
|
+
var Jn = ({ 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: H = !0, open: ee, defaultOpen: U = !1, onOpenChange: te, onSearch: ne, onClear: re, startIcon: W, endIcon: ie, prefix: ae, suffix: G, renderValue: se, renderOption: K, onBlur: le, onFocus: ue, className: fe, triggerClassName: pe, dropdownClassName: me }) => {
|
|
2674
2728
|
let he = p(), ge = On(), _e = !!(i || a || R), ye = o ?? (_e ? void 0 : ge?.controlId) ?? he, be = `${ye}-listbox`, [xe, Se] = _(""), Ce = !!R, we = Ce ? `${ye}-error` : void 0, Te = a ? `${ye}-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 = [
|
|
2675
2729
|
l,
|
|
2676
2730
|
!_e && !l ? ge?.ariaDescribedBy : void 0,
|
|
2677
2731
|
Te,
|
|
2678
2732
|
we
|
|
2679
|
-
].filter(Boolean).join(" "), je = g(null), Me = g(null), [Ne, Pe] = _(!1), q = P || L, { entries: Fe, options: Ie } =
|
|
2733
|
+
].filter(Boolean).join(" "), je = g(null), Me = g(null), [Ne, Pe] = _(!1), q = P || L, { entries: Fe, options: Ie } = Hn(e), Le = Wn({
|
|
2680
2734
|
options: Ie,
|
|
2681
2735
|
searchable: q,
|
|
2682
2736
|
searchValue: xe
|
|
@@ -2690,9 +2744,9 @@ var Hn = ({ children: e, label: i, description: a, id: o, name: s, "aria-label":
|
|
|
2690
2744
|
closeOnSelect: S,
|
|
2691
2745
|
disabled: Oe,
|
|
2692
2746
|
open: ee,
|
|
2693
|
-
defaultOpen:
|
|
2694
|
-
onOpenChange:
|
|
2695
|
-
}), 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 } =
|
|
2747
|
+
defaultOpen: U,
|
|
2748
|
+
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 } = Un({
|
|
2696
2750
|
isOpen: Be,
|
|
2697
2751
|
onOpenChange: Ve,
|
|
2698
2752
|
placement: z,
|
|
@@ -2722,20 +2776,20 @@ var Hn = ({ children: e, label: i, description: a, id: o, name: s, "aria-label":
|
|
|
2722
2776
|
ze,
|
|
2723
2777
|
He
|
|
2724
2778
|
]), it = u(() => {
|
|
2725
|
-
qe(""),
|
|
2726
|
-
}, [
|
|
2779
|
+
qe(""), re?.(), je.current?.focus();
|
|
2780
|
+
}, [re, qe]), at = u(() => {
|
|
2727
2781
|
Be || Pe(!1), Ke();
|
|
2728
2782
|
}, [Be, Ke]), ot = u((e) => {
|
|
2729
|
-
|
|
2783
|
+
Yn(e, Be) && Pe(!0), Je(e);
|
|
2730
2784
|
}, [Be, Je]), st = u((e) => {
|
|
2731
2785
|
Pe(!0), We(e);
|
|
2732
2786
|
}, [We]), ct = u((e) => {
|
|
2733
|
-
Se(e),
|
|
2734
|
-
}, [
|
|
2787
|
+
Se(e), ne?.(e);
|
|
2788
|
+
}, [ne]), { isTopOverlay: lt } = ce({
|
|
2735
2789
|
active: Be,
|
|
2736
2790
|
id: be
|
|
2737
2791
|
});
|
|
2738
|
-
|
|
2792
|
+
oe({
|
|
2739
2793
|
active: Be,
|
|
2740
2794
|
closeOnEscape: !0,
|
|
2741
2795
|
closeOnOutsidePress: !0,
|
|
@@ -2747,7 +2801,7 @@ var Hn = ({ children: e, label: i, description: a, id: o, name: s, "aria-label":
|
|
|
2747
2801
|
Be || Pe(!1);
|
|
2748
2802
|
}, [Be]), f(() => {
|
|
2749
2803
|
!Be && xe && Se("");
|
|
2750
|
-
}, [Be, xe]),
|
|
2804
|
+
}, [Be, xe]), de({
|
|
2751
2805
|
active: Be,
|
|
2752
2806
|
enabled: I
|
|
2753
2807
|
});
|
|
@@ -2755,7 +2809,7 @@ var Hn = ({ children: e, label: i, description: a, id: o, name: s, "aria-label":
|
|
|
2755
2809
|
je.current = e, et(e);
|
|
2756
2810
|
}, [et]), dt = u((e) => {
|
|
2757
2811
|
Me.current = e, tt(e);
|
|
2758
|
-
}, [tt]), ft =
|
|
2812
|
+
}, [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 = {
|
|
2759
2813
|
id: ye,
|
|
2760
2814
|
describedBy: Ae || void 0,
|
|
2761
2815
|
labelledBy: c ? void 0 : d,
|
|
@@ -2772,18 +2826,18 @@ var Hn = ({ children: e, label: i, description: a, id: o, name: s, "aria-label":
|
|
|
2772
2826
|
size: Ee,
|
|
2773
2827
|
color: D,
|
|
2774
2828
|
variant: O,
|
|
2775
|
-
startIcon:
|
|
2776
|
-
endIcon:
|
|
2777
|
-
prefix:
|
|
2778
|
-
suffix:
|
|
2829
|
+
startIcon: W,
|
|
2830
|
+
endIcon: ie,
|
|
2831
|
+
prefix: ae,
|
|
2832
|
+
suffix: G,
|
|
2779
2833
|
clearable: mt,
|
|
2780
|
-
className:
|
|
2834
|
+
className: pe,
|
|
2781
2835
|
buttonRef: ut,
|
|
2782
2836
|
onClear: it,
|
|
2783
2837
|
onClick: at,
|
|
2784
2838
|
onKeyDown: ot,
|
|
2785
|
-
onBlur:
|
|
2786
|
-
onFocus:
|
|
2839
|
+
onBlur: le,
|
|
2840
|
+
onFocus: ue
|
|
2787
2841
|
}, gt = {
|
|
2788
2842
|
isOpen: Be,
|
|
2789
2843
|
listboxId: be,
|
|
@@ -2802,12 +2856,12 @@ var Hn = ({ children: e, label: i, description: a, id: o, name: s, "aria-label":
|
|
|
2802
2856
|
loading: M,
|
|
2803
2857
|
loadingText: T,
|
|
2804
2858
|
emptyText: pt,
|
|
2805
|
-
renderOption:
|
|
2859
|
+
renderOption: K,
|
|
2806
2860
|
selectedValue: Qe,
|
|
2807
2861
|
selectedValues: ze,
|
|
2808
2862
|
activeIndex: Ue,
|
|
2809
2863
|
visualActiveIndex: Ne ? Ue : -1,
|
|
2810
|
-
className:
|
|
2864
|
+
className: me,
|
|
2811
2865
|
setDropdownRef: dt,
|
|
2812
2866
|
onSelect: nt,
|
|
2813
2867
|
onSelectGroup: rt,
|
|
@@ -2823,12 +2877,12 @@ var Hn = ({ children: e, label: i, description: a, id: o, name: s, "aria-label":
|
|
|
2823
2877
|
name: s,
|
|
2824
2878
|
value: Qe,
|
|
2825
2879
|
disabled: Oe
|
|
2826
|
-
})] }), vt =
|
|
2880
|
+
})] }), vt = zn(e), yt = /* @__PURE__ */ r(cn, {
|
|
2827
2881
|
value: {
|
|
2828
2882
|
triggerProps: ht,
|
|
2829
2883
|
contentProps: gt
|
|
2830
2884
|
},
|
|
2831
|
-
children: [_t, vt ? e : /* @__PURE__ */ r(t, { children: [/* @__PURE__ */ n(
|
|
2885
|
+
children: [_t, vt ? e : /* @__PURE__ */ r(t, { children: [/* @__PURE__ */ n(Kn, {}), /* @__PURE__ */ n(mn, { children: e })] })]
|
|
2832
2886
|
}), bt = /* @__PURE__ */ r(cn, {
|
|
2833
2887
|
value: {
|
|
2834
2888
|
triggerProps: ht,
|
|
@@ -2836,11 +2890,11 @@ var Hn = ({ children: e, label: i, description: a, id: o, name: s, "aria-label":
|
|
|
2836
2890
|
},
|
|
2837
2891
|
children: [
|
|
2838
2892
|
_t,
|
|
2839
|
-
/* @__PURE__ */ n(
|
|
2893
|
+
/* @__PURE__ */ n(qn, { ...ht }),
|
|
2840
2894
|
/* @__PURE__ */ n(hn, { ...gt })
|
|
2841
2895
|
]
|
|
2842
2896
|
});
|
|
2843
|
-
return !_e && ge ? e ? yt : bt : /* @__PURE__ */ n(
|
|
2897
|
+
return !_e && ge ? e ? yt : bt : /* @__PURE__ */ n(Ln, {
|
|
2844
2898
|
id: ye,
|
|
2845
2899
|
label: i,
|
|
2846
2900
|
description: a,
|
|
@@ -2848,44 +2902,44 @@ var Hn = ({ children: e, label: i, description: a, id: o, name: s, "aria-label":
|
|
|
2848
2902
|
required: ke,
|
|
2849
2903
|
disabled: Oe,
|
|
2850
2904
|
bindControl: !1,
|
|
2851
|
-
className:
|
|
2905
|
+
className: fe,
|
|
2852
2906
|
children: e ? yt : bt
|
|
2853
2907
|
});
|
|
2854
2908
|
};
|
|
2855
|
-
|
|
2856
|
-
function
|
|
2909
|
+
Jn.displayName = "SelectRoot";
|
|
2910
|
+
function Yn(e, t) {
|
|
2857
2911
|
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 === " ";
|
|
2858
2912
|
}
|
|
2859
2913
|
//#endregion
|
|
2860
2914
|
//#region src/components/Select/Trigger/SelectIcon.tsx
|
|
2861
|
-
var
|
|
2915
|
+
var Xn = ({ children: e, className: t }) => {
|
|
2862
2916
|
let { triggerProps: r } = ln();
|
|
2863
2917
|
return /* @__PURE__ */ n("span", {
|
|
2864
|
-
className: F(
|
|
2918
|
+
className: F(Z.arrow, { [Z.open]: r.isOpen }, t),
|
|
2865
2919
|
"aria-hidden": "true",
|
|
2866
|
-
children: r.loading ? /* @__PURE__ */ n("span", { className:
|
|
2920
|
+
children: r.loading ? /* @__PURE__ */ n("span", { className: Z.spinner }) : e ?? r.endIcon ?? /* @__PURE__ */ n(b, {})
|
|
2867
2921
|
});
|
|
2868
2922
|
};
|
|
2869
|
-
|
|
2923
|
+
Xn.__velliraSelectPart = "icon", Xn.displayName = "Select.Icon";
|
|
2870
2924
|
//#endregion
|
|
2871
2925
|
//#region src/components/Select/Trigger/SelectValue.tsx
|
|
2872
|
-
var
|
|
2926
|
+
var Zn = ({ children: e, className: t }) => {
|
|
2873
2927
|
let { triggerProps: r } = ln();
|
|
2874
2928
|
return /* @__PURE__ */ n("span", {
|
|
2875
|
-
className: F(
|
|
2929
|
+
className: F(Z.valueWrap, t),
|
|
2876
2930
|
children: /* @__PURE__ */ n("span", {
|
|
2877
|
-
className: F(
|
|
2931
|
+
className: F(Z.value, { [Z.placeholder]: r.isPlaceholder }),
|
|
2878
2932
|
children: e ?? r.displayText
|
|
2879
2933
|
})
|
|
2880
2934
|
});
|
|
2881
2935
|
};
|
|
2882
|
-
|
|
2936
|
+
Zn.__velliraSelectPart = "value", Zn.displayName = "Select.Value";
|
|
2883
2937
|
//#endregion
|
|
2884
2938
|
//#region src/components/Select/Select.tsx
|
|
2885
|
-
var
|
|
2886
|
-
Trigger:
|
|
2887
|
-
Value:
|
|
2888
|
-
Icon:
|
|
2939
|
+
var Qn = Object.assign(Jn, {
|
|
2940
|
+
Trigger: Kn,
|
|
2941
|
+
Value: Zn,
|
|
2942
|
+
Icon: Xn,
|
|
2889
2943
|
Content: mn,
|
|
2890
2944
|
Search: bn,
|
|
2891
2945
|
Group: xn,
|
|
@@ -2898,19 +2952,19 @@ var Kn = Object.assign(Hn, {
|
|
|
2898
2952
|
Empty: vn,
|
|
2899
2953
|
Loading: yn
|
|
2900
2954
|
});
|
|
2901
|
-
|
|
2955
|
+
Qn.displayName = "Select";
|
|
2902
2956
|
//#endregion
|
|
2903
2957
|
//#region src/components/Tabs/internal/TabsContext.tsx
|
|
2904
|
-
var
|
|
2905
|
-
let e = d(
|
|
2958
|
+
var $n = s(null), er = () => {
|
|
2959
|
+
let e = d($n);
|
|
2906
2960
|
if (!e) throw Error("Tabs components must be used inside Tabs");
|
|
2907
2961
|
return e;
|
|
2908
|
-
},
|
|
2962
|
+
}, tr = {
|
|
2909
2963
|
panel: "_panel_1v1a9_1",
|
|
2910
2964
|
visible: "_visible_1v1a9_10",
|
|
2911
2965
|
vertical: "_vertical_1v1a9_14"
|
|
2912
|
-
},
|
|
2913
|
-
let { value: o, orientation: s, keepMounted: c, lazyMount: l, registerContent: u, getTriggerId: d, getContentId: p } =
|
|
2966
|
+
}, nr = ({ value: e, children: t, className: r, forceMount: i = !1, ...a }) => {
|
|
2967
|
+
let { value: o, orientation: s, keepMounted: c, lazyMount: l, registerContent: u, getTriggerId: d, getContentId: p } = er(), m = o === e, [h, g] = _(m);
|
|
2914
2968
|
return f(() => (u(e, !0), () => {
|
|
2915
2969
|
u(e, !1);
|
|
2916
2970
|
}), [u, e]), f(() => {
|
|
@@ -2924,15 +2978,15 @@ var qn = s(null), Jn = () => {
|
|
|
2924
2978
|
tabIndex: 0,
|
|
2925
2979
|
"data-state": m ? "active" : "inactive",
|
|
2926
2980
|
"data-orientation": s,
|
|
2927
|
-
className: F(
|
|
2981
|
+
className: F(tr.panel, m && tr.visible, s === "vertical" && tr.vertical, r),
|
|
2928
2982
|
children: t
|
|
2929
2983
|
}) : null;
|
|
2930
2984
|
};
|
|
2931
|
-
|
|
2985
|
+
nr.displayName = "Tabs.Content";
|
|
2932
2986
|
//#endregion
|
|
2933
2987
|
//#region src/components/Tabs/internal/useTabsIndicator.ts
|
|
2934
|
-
var
|
|
2935
|
-
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 } =
|
|
2988
|
+
var rr = 8, ir = 360, ar = () => {
|
|
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 } = er();
|
|
2936
2990
|
return f(() => () => {
|
|
2937
2991
|
r.current?.cancel();
|
|
2938
2992
|
}, []), m(() => {
|
|
@@ -2968,7 +3022,7 @@ var Zn = 8, Qn = 360, $n = () => {
|
|
|
2968
3022
|
let s = t.current;
|
|
2969
3023
|
if (e && c === "line" && s && n.current !== o && !(typeof window.matchMedia == "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches) && typeof i.animate == "function") {
|
|
2970
3024
|
r.current?.cancel();
|
|
2971
|
-
let e = s.y + s.height / 2, t = p.y + p.height / 2, n = e -
|
|
3025
|
+
let e = s.y + s.height / 2, t = p.y + p.height / 2, n = e - rr / 2, a = t - rr / 2;
|
|
2972
3026
|
r.current = i.animate([
|
|
2973
3027
|
{
|
|
2974
3028
|
height: `${s.height}px`,
|
|
@@ -2976,12 +3030,12 @@ var Zn = 8, Qn = 360, $n = () => {
|
|
|
2976
3030
|
offset: 0
|
|
2977
3031
|
},
|
|
2978
3032
|
{
|
|
2979
|
-
height: `${
|
|
3033
|
+
height: `${rr}px`,
|
|
2980
3034
|
transform: `translate3d(0, ${n}px, 0)`,
|
|
2981
3035
|
offset: .28
|
|
2982
3036
|
},
|
|
2983
3037
|
{
|
|
2984
|
-
height: `${
|
|
3038
|
+
height: `${rr}px`,
|
|
2985
3039
|
transform: `translate3d(0, ${a}px, 0)`,
|
|
2986
3040
|
offset: .64
|
|
2987
3041
|
},
|
|
@@ -2991,7 +3045,7 @@ var Zn = 8, Qn = 360, $n = () => {
|
|
|
2991
3045
|
offset: 1
|
|
2992
3046
|
}
|
|
2993
3047
|
], {
|
|
2994
|
-
duration:
|
|
3048
|
+
duration: ir,
|
|
2995
3049
|
easing: "cubic-bezier(0.22, 1, 0.36, 1)",
|
|
2996
3050
|
fill: "none"
|
|
2997
3051
|
});
|
|
@@ -3007,7 +3061,7 @@ var Zn = 8, Qn = 360, $n = () => {
|
|
|
3007
3061
|
let h = t.current;
|
|
3008
3062
|
if (e && c === "line" && h && n.current !== o && !(typeof window.matchMedia == "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches) && typeof i.animate == "function") {
|
|
3009
3063
|
r.current?.cancel();
|
|
3010
|
-
let e = h.x + h.width / 2, t = p.x + p.width / 2, n = e -
|
|
3064
|
+
let e = h.x + h.width / 2, t = p.x + p.width / 2, n = e - rr / 2, a = t - rr / 2;
|
|
3011
3065
|
r.current = i.animate([
|
|
3012
3066
|
{
|
|
3013
3067
|
width: `${h.width}px`,
|
|
@@ -3015,12 +3069,12 @@ var Zn = 8, Qn = 360, $n = () => {
|
|
|
3015
3069
|
offset: 0
|
|
3016
3070
|
},
|
|
3017
3071
|
{
|
|
3018
|
-
width: `${
|
|
3072
|
+
width: `${rr}px`,
|
|
3019
3073
|
transform: `translate3d(${n}px, 0, 0)`,
|
|
3020
3074
|
offset: .28
|
|
3021
3075
|
},
|
|
3022
3076
|
{
|
|
3023
|
-
width: `${
|
|
3077
|
+
width: `${rr}px`,
|
|
3024
3078
|
transform: `translate3d(${a}px, 0, 0)`,
|
|
3025
3079
|
offset: .64
|
|
3026
3080
|
},
|
|
@@ -3030,7 +3084,7 @@ var Zn = 8, Qn = 360, $n = () => {
|
|
|
3030
3084
|
offset: 1
|
|
3031
3085
|
}
|
|
3032
3086
|
], {
|
|
3033
|
-
duration:
|
|
3087
|
+
duration: ir,
|
|
3034
3088
|
easing: "cubic-bezier(0.22, 1, 0.36, 1)",
|
|
3035
3089
|
fill: "none"
|
|
3036
3090
|
});
|
|
@@ -3058,7 +3112,7 @@ var Zn = 8, Qn = 360, $n = () => {
|
|
|
3058
3112
|
ref: e,
|
|
3059
3113
|
style: i
|
|
3060
3114
|
}), [i]);
|
|
3061
|
-
},
|
|
3115
|
+
}, or = {
|
|
3062
3116
|
list: "_list_j3cp3_1",
|
|
3063
3117
|
vertical: "_vertical_j3cp3_10",
|
|
3064
3118
|
line: "_line_j3cp3_17",
|
|
@@ -3066,24 +3120,24 @@ var Zn = 8, Qn = 360, $n = () => {
|
|
|
3066
3120
|
segmented: "_segmented_j3cp3_29",
|
|
3067
3121
|
scrollable: "_scrollable_j3cp3_37",
|
|
3068
3122
|
indicator: "_indicator_j3cp3_46"
|
|
3069
|
-
},
|
|
3070
|
-
let { ref: i, style: a } =
|
|
3123
|
+
}, sr = ({ className: e, style: t, ...r }) => {
|
|
3124
|
+
let { ref: i, style: a } = ar();
|
|
3071
3125
|
return /* @__PURE__ */ n("span", {
|
|
3072
3126
|
...r,
|
|
3073
3127
|
ref: i,
|
|
3074
3128
|
"aria-hidden": "true",
|
|
3075
|
-
className: F(
|
|
3129
|
+
className: F(or.indicator, e),
|
|
3076
3130
|
style: {
|
|
3077
3131
|
...a,
|
|
3078
3132
|
...t
|
|
3079
3133
|
}
|
|
3080
3134
|
});
|
|
3081
3135
|
};
|
|
3082
|
-
|
|
3136
|
+
sr.displayName = "Tabs.Indicator";
|
|
3083
3137
|
//#endregion
|
|
3084
3138
|
//#region src/components/Tabs/List/TabsList.tsx
|
|
3085
|
-
var
|
|
3086
|
-
let { orientation: a, variant: o } =
|
|
3139
|
+
var cr = ({ children: e, className: t, scrollable: r, ...i }) => {
|
|
3140
|
+
let { orientation: a, variant: o } = er(), s = r ?? !1;
|
|
3087
3141
|
return /* @__PURE__ */ n("div", {
|
|
3088
3142
|
...i,
|
|
3089
3143
|
role: "tablist",
|
|
@@ -3091,18 +3145,18 @@ var nr = ({ children: e, className: t, scrollable: r, ...i }) => {
|
|
|
3091
3145
|
"data-orientation": a,
|
|
3092
3146
|
"data-variant": o,
|
|
3093
3147
|
"data-scrollable": s ? "" : void 0,
|
|
3094
|
-
className: F(
|
|
3148
|
+
className: F(or.list, a === "vertical" && or.vertical, o === "line" && or.line, o === "pills" && or.pills, o === "segmented" && or.segmented, s && or.scrollable, t),
|
|
3095
3149
|
children: e
|
|
3096
3150
|
});
|
|
3097
3151
|
};
|
|
3098
|
-
|
|
3152
|
+
cr.displayName = "TabsList";
|
|
3099
3153
|
//#endregion
|
|
3100
3154
|
//#region src/components/Tabs/internal/useTabsCollection.ts
|
|
3101
|
-
var
|
|
3155
|
+
var lr = (e) => [...e].sort((e, t) => {
|
|
3102
3156
|
if (e.element === t.element) return 0;
|
|
3103
3157
|
let n = e.element.compareDocumentPosition(t.element);
|
|
3104
3158
|
return n & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : n & Node.DOCUMENT_POSITION_PRECEDING ? 1 : 0;
|
|
3105
|
-
}),
|
|
3159
|
+
}), ur = () => {
|
|
3106
3160
|
let e = g([]), t = g([]), [n, r] = _(0), i = u(() => {
|
|
3107
3161
|
r((e) => e + 1);
|
|
3108
3162
|
}, []);
|
|
@@ -3121,7 +3175,7 @@ var rr = (e) => [...e].sort((e, t) => {
|
|
|
3121
3175
|
element: n,
|
|
3122
3176
|
disabled: r
|
|
3123
3177
|
}, o = e.current.findIndex((e) => e.element === n);
|
|
3124
|
-
o >= 0 ? e.current[o] = a : e.current.push(a), e.current =
|
|
3178
|
+
o >= 0 ? e.current[o] = a : e.current.push(a), e.current = lr(e.current), i();
|
|
3125
3179
|
}, [i]),
|
|
3126
3180
|
registerContent: u((e, n) => {
|
|
3127
3181
|
let r = t.current.findIndex((t) => t.value === e);
|
|
@@ -3132,7 +3186,7 @@ var rr = (e) => [...e].sort((e, t) => {
|
|
|
3132
3186
|
r < 0 && (t.current.push({ value: e }), i());
|
|
3133
3187
|
}, [i])
|
|
3134
3188
|
};
|
|
3135
|
-
},
|
|
3189
|
+
}, dr = ({ focusedValue: e, setValue: t, setFocusedValue: n, getTabs: r, orientation: i, activationMode: a, dir: o, loop: s }) => ({ onKeyDown: (c) => {
|
|
3136
3190
|
let l = r().filter((e) => !e.disabled);
|
|
3137
3191
|
if (l.length === 0) return;
|
|
3138
3192
|
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) => {
|
|
@@ -3169,15 +3223,15 @@ var rr = (e) => [...e].sort((e, t) => {
|
|
|
3169
3223
|
}
|
|
3170
3224
|
break;
|
|
3171
3225
|
}
|
|
3172
|
-
} }),
|
|
3226
|
+
} }), fr = {
|
|
3173
3227
|
tabs: "_tabs_1hj56_1",
|
|
3174
3228
|
vertical: "_vertical_1hj56_30"
|
|
3175
|
-
},
|
|
3229
|
+
}, pr = ({ 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 }) => {
|
|
3176
3230
|
let S = p(), C = t !== void 0, { value: w, setValue: T } = ye({
|
|
3177
3231
|
value: t,
|
|
3178
3232
|
defaultValue: r,
|
|
3179
3233
|
onValueChange: i
|
|
3180
|
-
}), E = g(w), D = g(void 0), O = g(void 0), [k, A] = _(w), { version: j, triggersRef: M, contentsRef: N, registerTrigger: P, registerContent: 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: I } = ur(), L = u((e, t, n = !1) => {
|
|
3181
3235
|
if (!t) {
|
|
3182
3236
|
let t = E.current, n = M.current, r = n.findIndex((t) => t.value === e);
|
|
3183
3237
|
if (t === e && r >= 0) {
|
|
@@ -3193,7 +3247,7 @@ var rr = (e) => [...e].sort((e, t) => {
|
|
|
3193
3247
|
A,
|
|
3194
3248
|
T,
|
|
3195
3249
|
M
|
|
3196
|
-
]), { onKeyDown: R } =
|
|
3250
|
+
]), { onKeyDown: R } = dr({
|
|
3197
3251
|
focusedValue: k,
|
|
3198
3252
|
setValue: T,
|
|
3199
3253
|
setFocusedValue: A,
|
|
@@ -3254,11 +3308,11 @@ var rr = (e) => [...e].sort((e, t) => {
|
|
|
3254
3308
|
N,
|
|
3255
3309
|
M,
|
|
3256
3310
|
j
|
|
3257
|
-
]), /* @__PURE__ */ n(
|
|
3311
|
+
]), /* @__PURE__ */ n($n.Provider, {
|
|
3258
3312
|
value: z,
|
|
3259
3313
|
children: /* @__PURE__ */ n("div", {
|
|
3260
3314
|
...x,
|
|
3261
|
-
className: F(
|
|
3315
|
+
className: F(fr.tabs, a === "vertical" && fr.vertical, b),
|
|
3262
3316
|
"data-orientation": a,
|
|
3263
3317
|
dir: s,
|
|
3264
3318
|
"data-variant": l,
|
|
@@ -3269,8 +3323,8 @@ var rr = (e) => [...e].sort((e, t) => {
|
|
|
3269
3323
|
})
|
|
3270
3324
|
});
|
|
3271
3325
|
};
|
|
3272
|
-
|
|
3273
|
-
var
|
|
3326
|
+
pr.displayName = "Tabs";
|
|
3327
|
+
var mr = {
|
|
3274
3328
|
trigger: "_trigger_uc2y5_1",
|
|
3275
3329
|
iconOnly: "_iconOnly_uc2y5_49",
|
|
3276
3330
|
icon: "_icon_uc2y5_49",
|
|
@@ -3285,23 +3339,23 @@ var cr = {
|
|
|
3285
3339
|
line: "_line_uc2y5_194",
|
|
3286
3340
|
pills: "_pills_uc2y5_209",
|
|
3287
3341
|
vertical: "_vertical_uc2y5_235"
|
|
3288
|
-
},
|
|
3289
|
-
className: F(
|
|
3342
|
+
}, hr = ({ children: e, className: t }) => /* @__PURE__ */ n("span", {
|
|
3343
|
+
className: F(mr.badge, t),
|
|
3290
3344
|
children: e
|
|
3291
3345
|
});
|
|
3292
|
-
|
|
3346
|
+
hr.displayName = "Tabs.Badge";
|
|
3293
3347
|
//#endregion
|
|
3294
3348
|
//#region src/components/Tabs/Trigger/TabsIcon.tsx
|
|
3295
|
-
var
|
|
3296
|
-
className: F(
|
|
3349
|
+
var gr = ({ children: e, className: t }) => /* @__PURE__ */ n("span", {
|
|
3350
|
+
className: F(mr.icon, t),
|
|
3297
3351
|
"aria-hidden": "true",
|
|
3298
3352
|
children: e
|
|
3299
3353
|
});
|
|
3300
|
-
|
|
3354
|
+
gr.displayName = "Tabs.Icon";
|
|
3301
3355
|
//#endregion
|
|
3302
3356
|
//#region src/components/Tabs/Trigger/TabsTrigger.tsx
|
|
3303
|
-
var
|
|
3304
|
-
let { value: g, focusedValue: _, setValue: v, setFocusedValue: y, orientation: b, variant: x, size: S, disabled: C, registerTrigger: w, onTriggerKeyDown: T, getTriggerId: E, getContentId: D } =
|
|
3357
|
+
var _r = c(({ value: e, children: t, className: a, disabled: o = !1, icon: s, badge: c, description: d, onClick: f, onKeyDown: p, ...m }, h) => {
|
|
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 } = er(), 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;
|
|
3305
3359
|
process.env.NODE_ENV !== "production" && N && M && console.warn(`Tabs.Trigger value "${e}" received both icon and Tabs.Icon. Tabs.Icon takes precedence.`);
|
|
3306
3360
|
let I = u((t) => {
|
|
3307
3361
|
w(e, t, O), typeof h == "function" ? h(t) : h && (h.current = t);
|
|
@@ -3324,7 +3378,7 @@ var dr = c(({ value: e, children: t, className: a, disabled: o = !1, icon: s, ba
|
|
|
3324
3378
|
"data-state": k ? "active" : "inactive",
|
|
3325
3379
|
"data-orientation": b,
|
|
3326
3380
|
"data-disabled": O ? "" : void 0,
|
|
3327
|
-
className: F(
|
|
3381
|
+
className: F(mr.trigger, mr[x], mr[S], b === "vertical" && mr.vertical, N && mr.withIcon, P && mr.iconOnly, a),
|
|
3328
3382
|
onClick: (t) => {
|
|
3329
3383
|
f?.(t), !(t.defaultPrevented || O) && (y(e), v(e));
|
|
3330
3384
|
},
|
|
@@ -3333,50 +3387,50 @@ var dr = c(({ value: e, children: t, className: a, disabled: o = !1, icon: s, ba
|
|
|
3333
3387
|
},
|
|
3334
3388
|
children: [
|
|
3335
3389
|
N && !M && /* @__PURE__ */ n("span", {
|
|
3336
|
-
className:
|
|
3390
|
+
className: mr.icon,
|
|
3337
3391
|
"aria-hidden": "true",
|
|
3338
3392
|
children: s
|
|
3339
3393
|
}),
|
|
3340
3394
|
t != null && (L ? /* @__PURE__ */ r("span", {
|
|
3341
|
-
className:
|
|
3395
|
+
className: mr.body,
|
|
3342
3396
|
children: [/* @__PURE__ */ n("span", {
|
|
3343
|
-
className:
|
|
3397
|
+
className: mr.label,
|
|
3344
3398
|
children: t
|
|
3345
3399
|
}), d != null && /* @__PURE__ */ n("span", {
|
|
3346
|
-
className:
|
|
3400
|
+
className: mr.description,
|
|
3347
3401
|
children: d
|
|
3348
3402
|
})]
|
|
3349
3403
|
}) : R ? /* @__PURE__ */ n("span", {
|
|
3350
|
-
className:
|
|
3404
|
+
className: mr.label,
|
|
3351
3405
|
children: t
|
|
3352
3406
|
}) : t),
|
|
3353
3407
|
c != null && /* @__PURE__ */ n("span", {
|
|
3354
|
-
className:
|
|
3408
|
+
className: mr.badge,
|
|
3355
3409
|
children: c
|
|
3356
3410
|
})
|
|
3357
3411
|
]
|
|
3358
3412
|
});
|
|
3359
3413
|
});
|
|
3360
|
-
|
|
3414
|
+
_r.displayName = "Tabs.Trigger";
|
|
3361
3415
|
//#endregion
|
|
3362
3416
|
//#region src/components/Tabs/Tabs.tsx
|
|
3363
|
-
var
|
|
3364
|
-
List:
|
|
3365
|
-
Trigger:
|
|
3366
|
-
Content:
|
|
3367
|
-
Indicator:
|
|
3368
|
-
Icon:
|
|
3369
|
-
Badge:
|
|
3417
|
+
var vr = Object.assign(pr, {
|
|
3418
|
+
List: cr,
|
|
3419
|
+
Trigger: _r,
|
|
3420
|
+
Content: nr,
|
|
3421
|
+
Indicator: sr,
|
|
3422
|
+
Icon: gr,
|
|
3423
|
+
Badge: hr
|
|
3370
3424
|
});
|
|
3371
|
-
|
|
3425
|
+
vr.displayName = "Tabs";
|
|
3372
3426
|
//#endregion
|
|
3373
3427
|
//#region src/components/Tooltip/internal/composeEventHandlers.ts
|
|
3374
|
-
function
|
|
3428
|
+
function yr(e, t) {
|
|
3375
3429
|
return (n) => {
|
|
3376
3430
|
e?.(n), n.defaultPrevented || t?.(n);
|
|
3377
3431
|
};
|
|
3378
3432
|
}
|
|
3379
|
-
function
|
|
3433
|
+
function br(...e) {
|
|
3380
3434
|
return (t) => {
|
|
3381
3435
|
e.forEach((e) => {
|
|
3382
3436
|
if (e) {
|
|
@@ -3391,18 +3445,18 @@ function mr(...e) {
|
|
|
3391
3445
|
}
|
|
3392
3446
|
//#endregion
|
|
3393
3447
|
//#region src/components/Tooltip/internal/TooltipContext.tsx
|
|
3394
|
-
var
|
|
3448
|
+
var xr = s(null), Sr = s({
|
|
3395
3449
|
delay: {
|
|
3396
3450
|
open: 300,
|
|
3397
3451
|
close: 100
|
|
3398
3452
|
},
|
|
3399
3453
|
skipDelay: 300
|
|
3400
|
-
}),
|
|
3454
|
+
}), Cr = xr.Provider, wr = ({ children: e, delay: t = 700, skipDelay: r = 300 }) => {
|
|
3401
3455
|
let i = typeof t == "number" ? {
|
|
3402
3456
|
open: t,
|
|
3403
3457
|
close: 100
|
|
3404
3458
|
} : t;
|
|
3405
|
-
return /* @__PURE__ */ n(
|
|
3459
|
+
return /* @__PURE__ */ n(Sr.Provider, {
|
|
3406
3460
|
value: {
|
|
3407
3461
|
delay: i,
|
|
3408
3462
|
skipDelay: r
|
|
@@ -3410,39 +3464,39 @@ var hr = s(null), gr = s({
|
|
|
3410
3464
|
children: e
|
|
3411
3465
|
});
|
|
3412
3466
|
};
|
|
3413
|
-
function
|
|
3414
|
-
let e = d(
|
|
3467
|
+
function Tr() {
|
|
3468
|
+
let e = d(xr);
|
|
3415
3469
|
if (!e) throw Error("Tooltip compound components must be rendered inside Tooltip");
|
|
3416
3470
|
return e;
|
|
3417
3471
|
}
|
|
3418
|
-
function
|
|
3419
|
-
return d(
|
|
3472
|
+
function Er() {
|
|
3473
|
+
return d(Sr);
|
|
3420
3474
|
}
|
|
3421
|
-
var
|
|
3475
|
+
var Dr = {
|
|
3422
3476
|
tooltip: "_tooltip_raj0t_1",
|
|
3423
3477
|
arrow: "_arrow_raj0t_25"
|
|
3424
|
-
},
|
|
3425
|
-
let l =
|
|
3478
|
+
}, Or = c(({ children: e, forceMount: t = !1, withArrow: i = !1, className: a, style: o, ...s }, c) => {
|
|
3479
|
+
let l = Tr();
|
|
3426
3480
|
return !t && !l.open ? null : /* @__PURE__ */ r("div", {
|
|
3427
3481
|
...l.getContentProps({
|
|
3428
3482
|
id: l.contentId,
|
|
3429
3483
|
role: "tooltip",
|
|
3430
3484
|
...s
|
|
3431
3485
|
}),
|
|
3432
|
-
ref:
|
|
3433
|
-
className: F(
|
|
3486
|
+
ref: br(c, l.setContentRef),
|
|
3487
|
+
className: F(Dr.tooltip, a),
|
|
3434
3488
|
"data-placement": l.placement,
|
|
3435
3489
|
"data-state": l.open ? "open" : "closed",
|
|
3436
3490
|
style: {
|
|
3437
3491
|
...l.floatingStyles,
|
|
3438
3492
|
...o
|
|
3439
3493
|
},
|
|
3440
|
-
children: [e, i && /* @__PURE__ */ n(
|
|
3494
|
+
children: [e, i && /* @__PURE__ */ n(kr, {})]
|
|
3441
3495
|
});
|
|
3442
3496
|
});
|
|
3443
|
-
|
|
3444
|
-
function
|
|
3445
|
-
let e =
|
|
3497
|
+
Or.displayName = "Tooltip.Content";
|
|
3498
|
+
function kr() {
|
|
3499
|
+
let e = Tr(), t = {
|
|
3446
3500
|
top: "bottom",
|
|
3447
3501
|
right: "left",
|
|
3448
3502
|
bottom: "top",
|
|
@@ -3450,7 +3504,7 @@ function Cr() {
|
|
|
3450
3504
|
}[e.placement.split("-")[0]];
|
|
3451
3505
|
return /* @__PURE__ */ n("div", {
|
|
3452
3506
|
ref: e.arrowRef,
|
|
3453
|
-
className:
|
|
3507
|
+
className: Dr.arrow,
|
|
3454
3508
|
style: {
|
|
3455
3509
|
left: e.arrowX == null ? void 0 : `${e.arrowX}px`,
|
|
3456
3510
|
top: e.arrowY == null ? void 0 : `${e.arrowY}px`,
|
|
@@ -3460,8 +3514,8 @@ function Cr() {
|
|
|
3460
3514
|
}
|
|
3461
3515
|
//#endregion
|
|
3462
3516
|
//#region src/components/Tooltip/internal/useTooltipDelay.ts
|
|
3463
|
-
function
|
|
3464
|
-
let n =
|
|
3517
|
+
function Ar(e, t) {
|
|
3518
|
+
let n = Er();
|
|
3465
3519
|
return e == null ? n.delay : typeof e == "number" ? {
|
|
3466
3520
|
open: e,
|
|
3467
3521
|
close: n.delay.close
|
|
@@ -3472,7 +3526,7 @@ function wr(e, t) {
|
|
|
3472
3526
|
}
|
|
3473
3527
|
//#endregion
|
|
3474
3528
|
//#region src/components/Tooltip/internal/useTooltipInteractions.ts
|
|
3475
|
-
function
|
|
3529
|
+
function jr({ context: e, delay: t, disabled: n, interactive: r }) {
|
|
3476
3530
|
return N([M(e, {
|
|
3477
3531
|
delay: t,
|
|
3478
3532
|
enabled: !n,
|
|
@@ -3482,7 +3536,7 @@ function Tr({ context: e, delay: t, disabled: n, interactive: r }) {
|
|
|
3482
3536
|
}
|
|
3483
3537
|
//#endregion
|
|
3484
3538
|
//#region src/components/Tooltip/internal/useTooltipPosition.ts
|
|
3485
|
-
function
|
|
3539
|
+
function Mr({ open: e, onOpenChange: t, placement: n, offset: r, avoidCollisions: i, matchTriggerWidth: a }) {
|
|
3486
3540
|
let o = g(null), s = tt({
|
|
3487
3541
|
open: e,
|
|
3488
3542
|
onOpenChange: t,
|
|
@@ -3501,30 +3555,30 @@ function Er({ open: e, onOpenChange: t, placement: n, offset: r, avoidCollisions
|
|
|
3501
3555
|
}
|
|
3502
3556
|
//#endregion
|
|
3503
3557
|
//#region src/components/Tooltip/Root/TooltipRoot.tsx
|
|
3504
|
-
var
|
|
3505
|
-
let h = `${p()}-content`, _ = g(null), v = g(null), [y, b] =
|
|
3558
|
+
var Nr = ({ 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 }) => {
|
|
3559
|
+
let h = `${p()}-content`, _ = g(null), v = g(null), [y, b] = me({
|
|
3506
3560
|
value: t,
|
|
3507
3561
|
defaultValue: r,
|
|
3508
3562
|
onChange: i
|
|
3509
3563
|
}), x = (e) => {
|
|
3510
3564
|
l || b(e);
|
|
3511
|
-
}, S =
|
|
3565
|
+
}, S = Mr({
|
|
3512
3566
|
open: y,
|
|
3513
3567
|
onOpenChange: x,
|
|
3514
3568
|
placement: a,
|
|
3515
3569
|
offset: o,
|
|
3516
3570
|
avoidCollisions: d,
|
|
3517
3571
|
matchTriggerWidth: f
|
|
3518
|
-
}), C =
|
|
3572
|
+
}), C = Ar(s, c), w = jr({
|
|
3519
3573
|
context: S.context,
|
|
3520
3574
|
delay: C,
|
|
3521
3575
|
disabled: l,
|
|
3522
3576
|
interactive: u
|
|
3523
|
-
}), { isTopOverlay: T } =
|
|
3577
|
+
}), { isTopOverlay: T } = ce({
|
|
3524
3578
|
active: y,
|
|
3525
3579
|
id: h
|
|
3526
3580
|
});
|
|
3527
|
-
return
|
|
3581
|
+
return oe({
|
|
3528
3582
|
active: y,
|
|
3529
3583
|
contentRef: _,
|
|
3530
3584
|
ignoreRefs: [v],
|
|
@@ -3532,7 +3586,7 @@ var Dr = ({ children: e, open: t, defaultOpen: r = !1, onOpenChange: i, placemen
|
|
|
3532
3586
|
closeOnOutsidePress: !u,
|
|
3533
3587
|
isTopOverlay: T,
|
|
3534
3588
|
requestClose: () => x(!1)
|
|
3535
|
-
}), /* @__PURE__ */ n(
|
|
3589
|
+
}), /* @__PURE__ */ n(Cr, {
|
|
3536
3590
|
value: {
|
|
3537
3591
|
contentId: h,
|
|
3538
3592
|
open: y,
|
|
@@ -3545,34 +3599,34 @@ var Dr = ({ children: e, open: t, defaultOpen: r = !1, onOpenChange: i, placemen
|
|
|
3545
3599
|
placement: S.placement,
|
|
3546
3600
|
floatingStyles: S.floatingStyles,
|
|
3547
3601
|
setOpen: x,
|
|
3548
|
-
setTriggerRef:
|
|
3549
|
-
setContentRef:
|
|
3602
|
+
setTriggerRef: br(v, S.setRef),
|
|
3603
|
+
setContentRef: br(_, S.setFloatingRef),
|
|
3550
3604
|
getTriggerProps: w.getReferenceProps,
|
|
3551
3605
|
getContentProps: w.getFloatingProps
|
|
3552
3606
|
},
|
|
3553
3607
|
children: e
|
|
3554
3608
|
});
|
|
3555
3609
|
};
|
|
3556
|
-
|
|
3610
|
+
Nr.displayName = "Tooltip.Root";
|
|
3557
3611
|
//#endregion
|
|
3558
3612
|
//#region src/components/Tooltip/Trigger/TooltipTrigger.tsx
|
|
3559
|
-
var
|
|
3560
|
-
let s =
|
|
3613
|
+
var Pr = ({ asChild: e = !1, children: t, disabled: r = !1, className: i, ...a }) => {
|
|
3614
|
+
let s = Tr(), c = e && l(t) ? t : void 0, u = s.disabled || r || c?.props.disabled, d = s.getTriggerProps({
|
|
3561
3615
|
...a,
|
|
3562
3616
|
"aria-describedby": s.open ? s.contentId : void 0,
|
|
3563
3617
|
"aria-disabled": u || void 0,
|
|
3564
3618
|
"data-state": s.open ? "open" : "closed"
|
|
3565
3619
|
}), f = {
|
|
3566
3620
|
...d,
|
|
3567
|
-
ref: c ?
|
|
3621
|
+
ref: c ? br(c.props.ref, s.setTriggerRef) : s.setTriggerRef,
|
|
3568
3622
|
className: F(c?.props.className, i),
|
|
3569
3623
|
disabled: u || void 0,
|
|
3570
|
-
onMouseEnter:
|
|
3571
|
-
onMouseLeave:
|
|
3572
|
-
onPointerEnter:
|
|
3573
|
-
onPointerLeave:
|
|
3574
|
-
onFocus:
|
|
3575
|
-
onBlur:
|
|
3624
|
+
onMouseEnter: yr(c?.props.onMouseEnter, d.onMouseEnter),
|
|
3625
|
+
onMouseLeave: yr(c?.props.onMouseLeave, d.onMouseLeave),
|
|
3626
|
+
onPointerEnter: yr(c?.props.onPointerEnter, d.onPointerEnter),
|
|
3627
|
+
onPointerLeave: yr(c?.props.onPointerLeave, d.onPointerLeave),
|
|
3628
|
+
onFocus: yr(c?.props.onFocus, d.onFocus),
|
|
3629
|
+
onBlur: yr(c?.props.onBlur, d.onBlur)
|
|
3576
3630
|
};
|
|
3577
3631
|
return c ? o(c, f) : /* @__PURE__ */ n("button", {
|
|
3578
3632
|
type: "button",
|
|
@@ -3580,20 +3634,20 @@ var Or = ({ asChild: e = !1, children: t, disabled: r = !1, className: i, ...a }
|
|
|
3580
3634
|
children: t
|
|
3581
3635
|
});
|
|
3582
3636
|
};
|
|
3583
|
-
|
|
3637
|
+
Pr.displayName = "Tooltip.Trigger";
|
|
3584
3638
|
//#endregion
|
|
3585
3639
|
//#region src/components/Tooltip/Tooltip.tsx
|
|
3586
|
-
var
|
|
3587
|
-
Trigger:
|
|
3588
|
-
Content:
|
|
3589
|
-
Provider:
|
|
3640
|
+
var Fr = Object.assign(Nr, {
|
|
3641
|
+
Trigger: Pr,
|
|
3642
|
+
Content: Or,
|
|
3643
|
+
Provider: wr
|
|
3590
3644
|
});
|
|
3591
|
-
|
|
3645
|
+
Fr.displayName = "Tooltip";
|
|
3592
3646
|
//#endregion
|
|
3593
3647
|
//#region src/utils/devWarning.ts
|
|
3594
|
-
var
|
|
3648
|
+
var Ir = (e, t) => {
|
|
3595
3649
|
process.env.NODE_ENV !== "production" && !e && console.warn(t);
|
|
3596
|
-
},
|
|
3650
|
+
}, Lr = {
|
|
3597
3651
|
button: "_button_1xn9g_1",
|
|
3598
3652
|
solid: "_solid_1xn9g_23",
|
|
3599
3653
|
primary: "_primary_1xn9g_23",
|
|
@@ -3621,53 +3675,53 @@ var Ar = (e, t) => {
|
|
|
3621
3675
|
"button-spin": "_button-spin_1xn9g_1",
|
|
3622
3676
|
badge: "_badge_1xn9g_812",
|
|
3623
3677
|
shortcut: "_shortcut_1xn9g_826"
|
|
3624
|
-
},
|
|
3625
|
-
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, H = f && p ? p : R, ee = p && R && !z && (typeof R == "string" || typeof R == "number") && (typeof p == "string" || typeof p == "number") ? String(f ? R : p) : void 0,
|
|
3626
|
-
[
|
|
3627
|
-
[
|
|
3628
|
-
[
|
|
3629
|
-
[
|
|
3678
|
+
}, Rr = 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 }, I) => {
|
|
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, H = f && p ? p : R, ee = 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 = F(Lr.button, Lr[i], Lr[a], Lr[s], Lr[c], C, {
|
|
3680
|
+
[Lr.disabled]: V,
|
|
3681
|
+
[Lr.loading]: f,
|
|
3682
|
+
[Lr.fullWidth]: b,
|
|
3683
|
+
[Lr.iconOnly]: z
|
|
3630
3684
|
});
|
|
3631
|
-
|
|
3632
|
-
let
|
|
3685
|
+
Ir(!S || !D, "Button: pass href to the child element when using asChild."), Ir(!S || !!L, "Button: asChild requires a single valid React element child."), Ir(!z || B, "Button: icon-only buttons must provide aria-label or aria-labelledby.");
|
|
3686
|
+
let ne = (e) => {
|
|
3633
3687
|
e.preventDefault(), e.stopPropagation();
|
|
3634
|
-
},
|
|
3688
|
+
}, re = (e) => {
|
|
3635
3689
|
if (V) {
|
|
3636
|
-
|
|
3690
|
+
ne(e);
|
|
3637
3691
|
return;
|
|
3638
3692
|
}
|
|
3639
3693
|
L?.props.onClick?.(e), e.defaultPrevented || w?.(e);
|
|
3640
|
-
},
|
|
3694
|
+
}, W = /* @__PURE__ */ r(t, { children: [
|
|
3641
3695
|
f && (g ? /* @__PURE__ */ n("span", {
|
|
3642
|
-
className:
|
|
3696
|
+
className: Lr.icon,
|
|
3643
3697
|
"aria-hidden": "true",
|
|
3644
3698
|
children: g
|
|
3645
3699
|
}) : /* @__PURE__ */ n("span", {
|
|
3646
|
-
className:
|
|
3700
|
+
className: Lr.spinner,
|
|
3647
3701
|
"aria-hidden": "true"
|
|
3648
3702
|
})),
|
|
3649
3703
|
!f && m && /* @__PURE__ */ n("span", {
|
|
3650
|
-
className:
|
|
3704
|
+
className: Lr.icon,
|
|
3651
3705
|
children: m
|
|
3652
3706
|
}),
|
|
3653
3707
|
H && !z && /* @__PURE__ */ n("span", {
|
|
3654
|
-
className:
|
|
3708
|
+
className: Lr.label,
|
|
3655
3709
|
"data-measure": ee,
|
|
3656
3710
|
children: /* @__PURE__ */ n("span", {
|
|
3657
|
-
className:
|
|
3711
|
+
className: Lr.labelText,
|
|
3658
3712
|
children: H
|
|
3659
3713
|
})
|
|
3660
3714
|
}),
|
|
3661
3715
|
_ && !z && /* @__PURE__ */ n("span", {
|
|
3662
|
-
className:
|
|
3716
|
+
className: Lr.badge,
|
|
3663
3717
|
children: _
|
|
3664
3718
|
}),
|
|
3665
3719
|
v && !z && /* @__PURE__ */ n("span", {
|
|
3666
|
-
className:
|
|
3720
|
+
className: Lr.shortcut,
|
|
3667
3721
|
children: v
|
|
3668
3722
|
}),
|
|
3669
3723
|
!f && h && /* @__PURE__ */ n("span", {
|
|
3670
|
-
className:
|
|
3724
|
+
className: Lr.icon,
|
|
3671
3725
|
children: h
|
|
3672
3726
|
})
|
|
3673
3727
|
] });
|
|
@@ -3678,12 +3732,12 @@ var Ar = (e, t) => {
|
|
|
3678
3732
|
"aria-disabled": V || void 0,
|
|
3679
3733
|
"aria-label": T || L.props["aria-label"] || void 0,
|
|
3680
3734
|
"aria-labelledby": E || L.props["aria-labelledby"] || void 0,
|
|
3681
|
-
className: F(L.props.className,
|
|
3735
|
+
className: F(L.props.className, te),
|
|
3682
3736
|
href: V ? void 0 : L.props.href,
|
|
3683
|
-
onClick:
|
|
3737
|
+
onClick: re,
|
|
3684
3738
|
tabIndex: V ? -1 : L.props.tabIndex,
|
|
3685
3739
|
title: y || L.props.title,
|
|
3686
|
-
children:
|
|
3740
|
+
children: W
|
|
3687
3741
|
}) : D ? /* @__PURE__ */ n("a", {
|
|
3688
3742
|
ref: I,
|
|
3689
3743
|
href: V ? void 0 : D,
|
|
@@ -3691,16 +3745,16 @@ var Ar = (e, t) => {
|
|
|
3691
3745
|
role: M,
|
|
3692
3746
|
tabIndex: V ? -1 : N,
|
|
3693
3747
|
target: O,
|
|
3694
|
-
rel:
|
|
3748
|
+
rel: U,
|
|
3695
3749
|
download: A,
|
|
3696
|
-
onClick: V ?
|
|
3750
|
+
onClick: V ? ne : w,
|
|
3697
3751
|
"aria-disabled": V || void 0,
|
|
3698
3752
|
"aria-label": T || void 0,
|
|
3699
3753
|
"aria-labelledby": E || void 0,
|
|
3700
3754
|
"aria-busy": f || void 0,
|
|
3701
|
-
className:
|
|
3755
|
+
className: te,
|
|
3702
3756
|
title: y,
|
|
3703
|
-
children:
|
|
3757
|
+
children: W
|
|
3704
3758
|
}) : /* @__PURE__ */ n("button", {
|
|
3705
3759
|
...P,
|
|
3706
3760
|
ref: I,
|
|
@@ -3713,12 +3767,12 @@ var Ar = (e, t) => {
|
|
|
3713
3767
|
"aria-label": T || void 0,
|
|
3714
3768
|
"aria-labelledby": E || void 0,
|
|
3715
3769
|
"aria-busy": f || void 0,
|
|
3716
|
-
className:
|
|
3770
|
+
className: te,
|
|
3717
3771
|
title: y,
|
|
3718
|
-
children:
|
|
3772
|
+
children: W
|
|
3719
3773
|
});
|
|
3720
3774
|
});
|
|
3721
|
-
|
|
3775
|
+
Rr.displayName = "Button";
|
|
3722
3776
|
var Q = {
|
|
3723
3777
|
wrapper: "_wrapper_11rc7_1",
|
|
3724
3778
|
colorPrimary: "_colorPrimary_11rc7_35",
|
|
@@ -3754,30 +3808,30 @@ var Q = {
|
|
|
3754
3808
|
"checkbox-checkmark-in": "_checkbox-checkmark-in_11rc7_1",
|
|
3755
3809
|
"checkbox-indeterminate-in": "_checkbox-indeterminate-in_11rc7_1",
|
|
3756
3810
|
disabled: "_disabled_11rc7_369"
|
|
3757
|
-
},
|
|
3811
|
+
}, zr = {
|
|
3758
3812
|
sm: Q.labelSm,
|
|
3759
3813
|
md: Q.labelMd,
|
|
3760
3814
|
lg: Q.labelLg
|
|
3761
|
-
},
|
|
3815
|
+
}, Br = {
|
|
3762
3816
|
sm: Q.wrapperSm,
|
|
3763
3817
|
md: Q.wrapperMd,
|
|
3764
3818
|
lg: Q.wrapperLg
|
|
3765
|
-
},
|
|
3819
|
+
}, Vr = {
|
|
3766
3820
|
sm: Q.containerSm,
|
|
3767
3821
|
md: Q.containerMd,
|
|
3768
3822
|
lg: Q.containerLg
|
|
3769
|
-
},
|
|
3823
|
+
}, Hr = {
|
|
3770
3824
|
primary: Q.colorPrimary,
|
|
3771
3825
|
neutral: Q.colorNeutral,
|
|
3772
3826
|
success: Q.colorSuccess,
|
|
3773
3827
|
warning: Q.colorWarning,
|
|
3774
3828
|
danger: Q.colorDanger
|
|
3775
|
-
},
|
|
3829
|
+
}, Ur = 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) => {
|
|
3776
3830
|
let k = p(), A = e ?? k, j = g(null), M = !!C, N = i ? `${A}-description` : void 0, P = M ? `${A}-error` : void 0, I = [
|
|
3777
3831
|
E,
|
|
3778
3832
|
N,
|
|
3779
3833
|
P
|
|
3780
|
-
].filter(Boolean).join(" "), [L, R] =
|
|
3834
|
+
].filter(Boolean).join(" "), [L, R] = me({
|
|
3781
3835
|
value: s,
|
|
3782
3836
|
defaultValue: m,
|
|
3783
3837
|
onChange: S
|
|
@@ -3794,12 +3848,12 @@ var Q = {
|
|
|
3794
3848
|
let B = (e) => {
|
|
3795
3849
|
R(e.target.checked);
|
|
3796
3850
|
};
|
|
3797
|
-
return
|
|
3798
|
-
className: F(Q.container,
|
|
3851
|
+
return Ir(!!(t || w || T), "Checkbox: an accessible label must be provided through label, aria-label, or aria-labelledby."), /* @__PURE__ */ r("div", {
|
|
3852
|
+
className: F(Q.container, Vr[c], d === "start" && Q.containerLabelStart, b),
|
|
3799
3853
|
children: [
|
|
3800
3854
|
/* @__PURE__ */ r("label", {
|
|
3801
3855
|
htmlFor: A,
|
|
3802
|
-
className: F(Q.wrapper,
|
|
3856
|
+
className: F(Q.wrapper, Br[c], Hr[l], d === "start" && Q.labelStart, !t && Q.iconOnly, h && Q.disabled, x),
|
|
3803
3857
|
children: [
|
|
3804
3858
|
/* @__PURE__ */ n("input", {
|
|
3805
3859
|
...D,
|
|
@@ -3829,7 +3883,7 @@ var Q = {
|
|
|
3829
3883
|
})
|
|
3830
3884
|
}),
|
|
3831
3885
|
t && /* @__PURE__ */ r("span", {
|
|
3832
|
-
className: F(Q.label,
|
|
3886
|
+
className: F(Q.label, zr[c]),
|
|
3833
3887
|
children: [t, _ && /* @__PURE__ */ n("span", {
|
|
3834
3888
|
className: Q.requiredMark,
|
|
3835
3889
|
"aria-hidden": "true",
|
|
@@ -3851,7 +3905,7 @@ var Q = {
|
|
|
3851
3905
|
]
|
|
3852
3906
|
});
|
|
3853
3907
|
});
|
|
3854
|
-
|
|
3908
|
+
Ur.displayName = "Checkbox";
|
|
3855
3909
|
var $ = {
|
|
3856
3910
|
inputGroup: "_inputGroup_1fjhk_1",
|
|
3857
3911
|
primary: "_primary_1fjhk_29",
|
|
@@ -3893,7 +3947,7 @@ var $ = {
|
|
|
3893
3947
|
toneDanger: "_toneDanger_1fjhk_876",
|
|
3894
3948
|
toneMuted: "_toneMuted_1fjhk_880",
|
|
3895
3949
|
toneInverse: "_toneInverse_1fjhk_884"
|
|
3896
|
-
},
|
|
3950
|
+
}, Wr = {
|
|
3897
3951
|
default: $.toneDefault,
|
|
3898
3952
|
primary: $.tonePrimary,
|
|
3899
3953
|
secondary: $.toneSecondary,
|
|
@@ -3901,7 +3955,7 @@ var $ = {
|
|
|
3901
3955
|
danger: $.toneDanger,
|
|
3902
3956
|
muted: $.toneMuted,
|
|
3903
3957
|
inverse: $.toneInverse
|
|
3904
|
-
},
|
|
3958
|
+
}, Gr = (e = "text", t) => {
|
|
3905
3959
|
if (t) return t;
|
|
3906
3960
|
switch (e) {
|
|
3907
3961
|
case "email": return "email";
|
|
@@ -3911,7 +3965,7 @@ var $ = {
|
|
|
3911
3965
|
case "search": return "off";
|
|
3912
3966
|
default: return;
|
|
3913
3967
|
}
|
|
3914
|
-
},
|
|
3968
|
+
}, Kr = (e, t) => {
|
|
3915
3969
|
let n = e.replace(/\D/g, ""), r = 0, i = "";
|
|
3916
3970
|
for (let e of t) {
|
|
3917
3971
|
if (e === "#") {
|
|
@@ -3923,21 +3977,21 @@ var $ = {
|
|
|
3923
3977
|
r < n.length && (i += e);
|
|
3924
3978
|
}
|
|
3925
3979
|
return i;
|
|
3926
|
-
},
|
|
3927
|
-
let
|
|
3928
|
-
|
|
3929
|
-
!
|
|
3980
|
+
}, qr = (e, t) => t ? typeof t == "function" ? t(e) : Kr(e, t) : e, Jr = 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: I, endAddon: L, prefix: R, suffix: z, clearIcon: B, mask: V, format: H, parse: ee, startIconTone: U = "default", endIconTone: te = "default", clearIconTone: ne = "danger", autoFocus: re, maxLength: W, onMouseEnter: ie, onMouseLeave: ae, "aria-describedby": oe, "aria-invalid": G, "aria-labelledby": se, ...ce }, K) => {
|
|
3981
|
+
let le = p(), ue = On(), de = !!(i || o || v), fe = e ?? (de ? void 0 : ue?.controlId) ?? le, pe = g(null), [me, he] = _(!1), [ge, _e] = _(l ?? ""), ve = c !== void 0, ye = String((ve ? c : ge) ?? ""), be = H ? H(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 = Gr(d, E), Me = S && !we, Ne = O && xe && !we && !Ee && !Me, Pe = j && De && !we && !Me && !Ne, q = !Me && !Ne && !Pe && !!Ae, Fe = !!(M && W), Ie = o ? `${fe}-description` : void 0, Le = v ? `${fe}-error` : void 0, Re = Fe ? `${fe}-counter` : void 0, ze = [
|
|
3982
|
+
oe,
|
|
3983
|
+
!de && !oe ? ue?.ariaDescribedBy : void 0,
|
|
3930
3984
|
Ie,
|
|
3931
3985
|
Le,
|
|
3932
3986
|
Re
|
|
3933
3987
|
].filter(Boolean).join(" "), Be = B ?? "×", Ve = !!(ke || R), He = !!(Ae || z || Ne || Pe || Me), Ue = !!(ke && R), We = !!(Ae && z), Ge = !!(I || L), Ke = u((e) => {
|
|
3934
|
-
if (
|
|
3935
|
-
|
|
3988
|
+
if (pe.current = e, typeof K == "function") {
|
|
3989
|
+
K(e);
|
|
3936
3990
|
return;
|
|
3937
3991
|
}
|
|
3938
|
-
|
|
3939
|
-
}, [
|
|
3940
|
-
let t =
|
|
3992
|
+
K && (K.current = e);
|
|
3993
|
+
}, [K]), qe = u((e) => {
|
|
3994
|
+
let t = qr(ee ? ee(e.target.value) : e.target.value, V);
|
|
3941
3995
|
ve || _e(t), A?.(t);
|
|
3942
3996
|
}, [
|
|
3943
3997
|
ve,
|
|
@@ -3945,7 +3999,7 @@ var $ = {
|
|
|
3945
3999
|
A,
|
|
3946
4000
|
ee
|
|
3947
4001
|
]), Je = u(() => {
|
|
3948
|
-
ve || _e(""), A?.(""), k?.(),
|
|
4002
|
+
ve || _e(""), A?.(""), k?.(), pe.current?.focus();
|
|
3949
4003
|
}, [
|
|
3950
4004
|
ve,
|
|
3951
4005
|
k,
|
|
@@ -3972,7 +4026,7 @@ var $ = {
|
|
|
3972
4026
|
children: [
|
|
3973
4027
|
ke && /* @__PURE__ */ n("span", {
|
|
3974
4028
|
"aria-hidden": "true",
|
|
3975
|
-
className: F($.startAdornment,
|
|
4029
|
+
className: F($.startAdornment, Wr[U]),
|
|
3976
4030
|
children: ke
|
|
3977
4031
|
}),
|
|
3978
4032
|
R && /* @__PURE__ */ n("span", {
|
|
@@ -3980,9 +4034,9 @@ var $ = {
|
|
|
3980
4034
|
children: R
|
|
3981
4035
|
}),
|
|
3982
4036
|
/* @__PURE__ */ n("input", {
|
|
3983
|
-
...
|
|
4037
|
+
...ce,
|
|
3984
4038
|
ref: Ke,
|
|
3985
|
-
id:
|
|
4039
|
+
id: fe,
|
|
3986
4040
|
name: a,
|
|
3987
4041
|
type: Oe,
|
|
3988
4042
|
autoComplete: je,
|
|
@@ -3993,14 +4047,14 @@ var $ = {
|
|
|
3993
4047
|
disabled: we,
|
|
3994
4048
|
readOnly: Ee,
|
|
3995
4049
|
required: Te,
|
|
3996
|
-
autoFocus:
|
|
3997
|
-
maxLength:
|
|
3998
|
-
"aria-invalid": Ce ? !0 :
|
|
3999
|
-
"aria-labelledby":
|
|
4050
|
+
autoFocus: re,
|
|
4051
|
+
maxLength: W,
|
|
4052
|
+
"aria-invalid": Ce ? !0 : G,
|
|
4053
|
+
"aria-labelledby": se ?? (de ? void 0 : ue?.ariaLabelledBy),
|
|
4000
4054
|
"aria-describedby": ze || void 0,
|
|
4001
4055
|
"aria-busy": S || void 0,
|
|
4002
|
-
onMouseEnter:
|
|
4003
|
-
onMouseLeave:
|
|
4056
|
+
onMouseEnter: ie,
|
|
4057
|
+
onMouseLeave: ae
|
|
4004
4058
|
}),
|
|
4005
4059
|
z && /* @__PURE__ */ n("span", {
|
|
4006
4060
|
className: $.suffix,
|
|
@@ -4018,19 +4072,19 @@ var $ = {
|
|
|
4018
4072
|
type: "button",
|
|
4019
4073
|
className: $.iconButton,
|
|
4020
4074
|
onClick: () => he((e) => !e),
|
|
4021
|
-
"aria-label":
|
|
4022
|
-
children:
|
|
4075
|
+
"aria-label": me ? "Hide password" : "Show password",
|
|
4076
|
+
children: me ? "Hide" : "Show"
|
|
4023
4077
|
}),
|
|
4024
4078
|
Ne && /* @__PURE__ */ n("button", {
|
|
4025
4079
|
type: "button",
|
|
4026
|
-
className: F($.clearButton,
|
|
4080
|
+
className: F($.clearButton, Wr[ne]),
|
|
4027
4081
|
onClick: Je,
|
|
4028
4082
|
"aria-label": "Clear input",
|
|
4029
4083
|
children: Be
|
|
4030
4084
|
}),
|
|
4031
4085
|
q && Ae && /* @__PURE__ */ n("span", {
|
|
4032
4086
|
"aria-hidden": "true",
|
|
4033
|
-
className: F($.endAdornment,
|
|
4087
|
+
className: F($.endAdornment, Wr[te]),
|
|
4034
4088
|
children: Ae
|
|
4035
4089
|
})
|
|
4036
4090
|
]
|
|
@@ -4048,11 +4102,11 @@ var $ = {
|
|
|
4048
4102
|
children: [
|
|
4049
4103
|
ye.length,
|
|
4050
4104
|
" / ",
|
|
4051
|
-
|
|
4105
|
+
W
|
|
4052
4106
|
]
|
|
4053
4107
|
})] });
|
|
4054
|
-
return !
|
|
4055
|
-
id:
|
|
4108
|
+
return !de && ue ? Ye : /* @__PURE__ */ n(Ln, {
|
|
4109
|
+
id: fe,
|
|
4056
4110
|
label: i,
|
|
4057
4111
|
description: o,
|
|
4058
4112
|
error: v,
|
|
@@ -4065,15 +4119,15 @@ var $ = {
|
|
|
4065
4119
|
children: Ye
|
|
4066
4120
|
});
|
|
4067
4121
|
});
|
|
4068
|
-
|
|
4122
|
+
Jr.displayName = "Input";
|
|
4069
4123
|
//#endregion
|
|
4070
4124
|
//#region src/theme/ThemeContext.ts
|
|
4071
|
-
var
|
|
4072
|
-
let [o, s] =
|
|
4125
|
+
var Yr = s(null), Xr = (e) => e === "highContrast" ? "high-contrast" : e, Zr = ({ theme: e, defaultTheme: t = "light", onThemeChange: r, syncDocument: i = !0, children: a }) => {
|
|
4126
|
+
let [o, s] = me({
|
|
4073
4127
|
value: e,
|
|
4074
4128
|
defaultValue: t,
|
|
4075
4129
|
onChange: r
|
|
4076
|
-
}), c =
|
|
4130
|
+
}), c = Xr(o);
|
|
4077
4131
|
f(() => {
|
|
4078
4132
|
if (!i || typeof document > "u") return;
|
|
4079
4133
|
let { documentElement: e } = document, t = e.dataset.velliraTheme;
|
|
@@ -4089,7 +4143,7 @@ var Hr = s(null), Ur = (e) => e === "highContrast" ? "high-contrast" : e, Wr = (
|
|
|
4089
4143
|
theme: o,
|
|
4090
4144
|
setTheme: s
|
|
4091
4145
|
}), [o, s]);
|
|
4092
|
-
return /* @__PURE__ */ n(
|
|
4146
|
+
return /* @__PURE__ */ n(Yr.Provider, {
|
|
4093
4147
|
value: l,
|
|
4094
4148
|
children: /* @__PURE__ */ n("div", {
|
|
4095
4149
|
"data-vellira-theme": c,
|
|
@@ -4097,13 +4151,13 @@ var Hr = s(null), Ur = (e) => e === "highContrast" ? "high-contrast" : e, Wr = (
|
|
|
4097
4151
|
})
|
|
4098
4152
|
});
|
|
4099
4153
|
};
|
|
4100
|
-
|
|
4154
|
+
Zr.displayName = "ThemeProvider";
|
|
4101
4155
|
//#endregion
|
|
4102
4156
|
//#region src/theme/useTheme.ts
|
|
4103
|
-
function
|
|
4104
|
-
let e = d(
|
|
4157
|
+
function Qr() {
|
|
4158
|
+
let e = d(Yr);
|
|
4105
4159
|
if (!e) throw Error("useTheme must be used within ThemeProvider.");
|
|
4106
4160
|
return e;
|
|
4107
4161
|
}
|
|
4108
4162
|
//#endregion
|
|
4109
|
-
export {
|
|
4163
|
+
export { Rr as Button, Ur as Checkbox, _t as Dropdown, Ln as FormField, Jr as Input, Gt as Modal, Se as Portal, xe as PortalProvider, Xt as Radio, on as RadioGroup, Qn as Select, vr as Tabs, Zr as ThemeProvider, Fr as Tooltip, Qr as useTheme };
|