@vellira-ui/react 2.66.0 → 2.66.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.js +1144 -1142
- package/package.json +11 -1
package/dist/index.js
CHANGED
|
@@ -1,27 +1,26 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
import
|
|
1
|
+
import { createConsoleOverlayDiagnostics as e, createOverlayManagerStore as t, createOverlayZIndexPolicy as n, createRetainedResourceRegistry as r, deferOverlayFocusRestore as i, getCompoundSlot as a, markCompoundSlot as o, resolveOverlayPresentation as s, runOverlayCloseAutoFocus as c } from "@vellira-ui/core";
|
|
2
|
+
import l from "clsx";
|
|
3
3
|
import { Fragment as u, jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
4
4
|
import { Children as p, Fragment as m, cloneElement as h, createContext as g, forwardRef as _, isValidElement as v, useCallback as y, useContext as b, useEffect as x, useId as S, useLayoutEffect as C, useMemo as w, useRef as T, useState as E, useSyncExternalStore as D } from "react";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
var U = (...t) => e(t), ie = { arrow: "_arrow_8b0vb_1" }, W = ({ className: e }) => /* @__PURE__ */ d("span", {
|
|
5
|
+
import { Check as O, ChevronDown as k, ChevronRight as A, Close as j, Search as M } from "@vellira-ui/icons";
|
|
6
|
+
import { createPortal as N } from "react-dom";
|
|
7
|
+
import { FloatingArrow as P, arrow as F, autoUpdate as I, flip as L, offset as R, shift as z, size as B, useFloating as V, useFocus as ee, useHover as H, useInteractions as U } from "@floating-ui/react";
|
|
8
|
+
import { controlSizes as te, lightTheme as ne } from "@vellira-ui/tokens";
|
|
9
|
+
var re = { arrow: "_arrow_8b0vb_1" }, W = (...e) => l(e), ie = ({ className: e }) => /* @__PURE__ */ d("span", {
|
|
11
10
|
"aria-hidden": "true",
|
|
12
|
-
className:
|
|
11
|
+
className: W(re.arrow, e)
|
|
13
12
|
});
|
|
14
|
-
|
|
13
|
+
o(ie, "arrow"), ie.displayName = "Dropdown.Arrow";
|
|
15
14
|
//#endregion
|
|
16
15
|
//#region src/components/Dropdown/internal/types.ts
|
|
17
16
|
function G(e) {
|
|
18
|
-
return
|
|
17
|
+
return a(e);
|
|
19
18
|
}
|
|
20
19
|
//#endregion
|
|
21
20
|
//#region src/components/Dropdown/internal/DropdownCollection.ts
|
|
22
21
|
function K(e, t) {
|
|
23
22
|
let n = () => null;
|
|
24
|
-
return
|
|
23
|
+
return o(n, e), n.displayName = t, n;
|
|
25
24
|
}
|
|
26
25
|
function ae(e) {
|
|
27
26
|
let t = 0, n, r, i, a, o = [], s = [], c = (e) => `${e}-${t++}`;
|
|
@@ -237,7 +236,279 @@ function ce(e) {
|
|
|
237
236
|
}
|
|
238
237
|
//#endregion
|
|
239
238
|
//#region src/components/Dropdown/CheckboxItem/DropdownCheckboxItem.tsx
|
|
240
|
-
var
|
|
239
|
+
var le = K("checkboxItem", "Dropdown.CheckboxItem"), ue = {
|
|
240
|
+
dropdown: "_dropdown_m7rnq_1",
|
|
241
|
+
"dropdown-in": "_dropdown-in_m7rnq_1",
|
|
242
|
+
primary: "_primary_m7rnq_42",
|
|
243
|
+
neutral: "_neutral_m7rnq_65",
|
|
244
|
+
success: "_success_m7rnq_88",
|
|
245
|
+
warning: "_warning_m7rnq_111",
|
|
246
|
+
danger: "_danger_m7rnq_134",
|
|
247
|
+
empty: "_empty_m7rnq_157",
|
|
248
|
+
searchWrap: "_searchWrap_m7rnq_165",
|
|
249
|
+
search: "_search_m7rnq_165",
|
|
250
|
+
"dropdown-sheet-in": "_dropdown-sheet-in_m7rnq_1"
|
|
251
|
+
}, de = K("empty", "Dropdown.Empty"), q = ({ children: e }) => /* @__PURE__ */ d("li", {
|
|
252
|
+
role: "presentation",
|
|
253
|
+
className: ue.empty,
|
|
254
|
+
children: e ?? "No actions available"
|
|
255
|
+
});
|
|
256
|
+
q.displayName = "DropdownEmptySurface";
|
|
257
|
+
//#endregion
|
|
258
|
+
//#region src/components/Dropdown/Group/DropdownGroup.tsx
|
|
259
|
+
var J = K("group", "Dropdown.Group"), fe = () => null;
|
|
260
|
+
fe.displayName = "DropdownGroupSurface";
|
|
261
|
+
//#endregion
|
|
262
|
+
//#region src/components/Dropdown/internal/DropdownContext.tsx
|
|
263
|
+
var pe = g(null), me = g(null), he = g(null), ge = pe.Provider, _e = me.Provider;
|
|
264
|
+
he.Provider;
|
|
265
|
+
function ve() {
|
|
266
|
+
let e = b(pe);
|
|
267
|
+
if (!e) throw Error("Dropdown compound components must be used inside Dropdown.");
|
|
268
|
+
return e;
|
|
269
|
+
}
|
|
270
|
+
function ye() {
|
|
271
|
+
let e = b(me);
|
|
272
|
+
if (!e) throw Error("Dropdown.Trigger must be used inside Dropdown.");
|
|
273
|
+
return e;
|
|
274
|
+
}
|
|
275
|
+
var Y = {
|
|
276
|
+
item: "_item_xmygj_1",
|
|
277
|
+
disabled: "_disabled_xmygj_35",
|
|
278
|
+
active: "_active_xmygj_53",
|
|
279
|
+
itemShortcut: "_itemShortcut_xmygj_67",
|
|
280
|
+
itemDescription: "_itemDescription_xmygj_68",
|
|
281
|
+
primary: "_primary_xmygj_76",
|
|
282
|
+
success: "_success_xmygj_94",
|
|
283
|
+
warning: "_warning_xmygj_112",
|
|
284
|
+
danger: "_danger_xmygj_130",
|
|
285
|
+
itemIcon: "_itemIcon_xmygj_154",
|
|
286
|
+
sm: "_sm_xmygj_174",
|
|
287
|
+
md: "_md_xmygj_180",
|
|
288
|
+
lg: "_lg_xmygj_184",
|
|
289
|
+
itemText: "_itemText_xmygj_191",
|
|
290
|
+
itemLabel: "_itemLabel_xmygj_200",
|
|
291
|
+
itemBadge: "_itemBadge_xmygj_226",
|
|
292
|
+
indicator: "_indicator_xmygj_253",
|
|
293
|
+
"dropdown-indicator-in": "_dropdown-indicator-in_xmygj_1",
|
|
294
|
+
checked: "_checked_xmygj_270",
|
|
295
|
+
"dropdown-item-pop": "_dropdown-item-pop_xmygj_1",
|
|
296
|
+
subContent: "_subContent_xmygj_275",
|
|
297
|
+
"dropdown-sub-in": "_dropdown-sub-in_xmygj_1",
|
|
298
|
+
subLabel: "_subLabel_xmygj_300",
|
|
299
|
+
subSeparator: "_subSeparator_xmygj_308"
|
|
300
|
+
}, be = (e, t) => {
|
|
301
|
+
process.env.NODE_ENV !== "production" && !e && console.warn(t);
|
|
302
|
+
}, xe = K("item", "Dropdown.Item"), Se = ({ item: e, itemIndex: t }) => {
|
|
303
|
+
let n = ve(), r = T(void 0), [i, a] = E(e.type === "checkbox" ? e.props.defaultChecked ?? !1 : !1), o = n.activeIndex === t, s = n.openSubId === e.id, c = e.type === "checkbox", l = e.type === "radio", p = e.type === "subTrigger", m = c ? e.props.checked ?? i : l ? (e.groupProps?.value ?? n.radioValues[e.groupId]) === e.props.value : !1, g = n.loading || e.disabled, _ = e.props, y = oe(_.children), b = y.icon ?? _.icon, x = y.description ?? ("description" in _ ? _.description : void 0), S = y.badge ?? ("badge" in _ ? _.badge : void 0), C = y.shortcut ?? _.shortcut, w = y.content.length ? y.content : _.children, D = "color" in _ ? _.color : void 0, k = e.type === "item" ? e.props.href : void 0, j = e.type === "item" ? e.props.target : void 0, M = e.type === "item" ? e.props.download : void 0, N = n.getItemId(t), P = c ? "menuitemcheckbox" : l ? "menuitemradio" : "menuitem", F = e.type === "item" && j === "_blank" && !e.props.rel ? "noreferrer noopener" : e.type === "item" ? e.props.rel : void 0, I = k ? "a" : "li", L = c || l, R = _.asChild && v(_.children) ? _.children : void 0, z = W(Y.item, Y[n.size], {
|
|
304
|
+
[Y.active]: o,
|
|
305
|
+
[Y.disabled]: g,
|
|
306
|
+
[Y.checked]: m
|
|
307
|
+
}, D && D !== "default" ? Y[D] : void 0, _.className);
|
|
308
|
+
be(!_.asChild || !!R, "Dropdown.Item: asChild requires a single valid React element child.");
|
|
309
|
+
let B = (t) => {
|
|
310
|
+
if (g) {
|
|
311
|
+
t.preventDefault();
|
|
312
|
+
return;
|
|
313
|
+
}
|
|
314
|
+
if (c && e.type === "checkbox") {
|
|
315
|
+
let t = !m;
|
|
316
|
+
a(t), e.props.onCheckedChange?.(t);
|
|
317
|
+
}
|
|
318
|
+
n.selectItem(e, Ce(t));
|
|
319
|
+
}, V = () => {
|
|
320
|
+
g || (n.setActiveIndex(t), p ? (window.clearTimeout(r.current), r.current = window.setTimeout(() => n.setOpenSubId(e.id), 120)) : (window.clearTimeout(r.current), n.setOpenSubId(void 0)));
|
|
321
|
+
}, ee = () => {
|
|
322
|
+
window.clearTimeout(r.current);
|
|
323
|
+
};
|
|
324
|
+
return R ? /* @__PURE__ */ f(u, { children: [h(R, {
|
|
325
|
+
id: N,
|
|
326
|
+
role: P,
|
|
327
|
+
tabIndex: g ? -1 : 0,
|
|
328
|
+
"aria-disabled": g || void 0,
|
|
329
|
+
"aria-checked": c || l ? m : void 0,
|
|
330
|
+
"aria-haspopup": p ? "menu" : void 0,
|
|
331
|
+
"aria-expanded": p ? s : void 0,
|
|
332
|
+
"data-active": o || void 0,
|
|
333
|
+
"data-state": s ? "open" : void 0,
|
|
334
|
+
className: W(R.props.className, z),
|
|
335
|
+
onClick: (e) => {
|
|
336
|
+
R.props.onClick?.(e), e.defaultPrevented || B(e);
|
|
337
|
+
},
|
|
338
|
+
onMouseEnter: (e) => {
|
|
339
|
+
R.props.onMouseEnter?.(e), e.defaultPrevented || V(e);
|
|
340
|
+
},
|
|
341
|
+
onMouseLeave: (e) => {
|
|
342
|
+
R.props.onMouseLeave?.(e), e.defaultPrevented || ee(e);
|
|
343
|
+
}
|
|
344
|
+
}), we(e, N, p, s, () => n.setOpenSubId(e.id))] }) : /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ f(I, {
|
|
345
|
+
id: N,
|
|
346
|
+
role: P,
|
|
347
|
+
href: I === "a" && !g ? k : void 0,
|
|
348
|
+
target: I === "a" && !g ? j : void 0,
|
|
349
|
+
rel: I === "a" ? F : void 0,
|
|
350
|
+
download: I === "a" && !g ? M : void 0,
|
|
351
|
+
tabIndex: g ? -1 : 0,
|
|
352
|
+
"aria-disabled": g || void 0,
|
|
353
|
+
"aria-checked": c || l ? m : void 0,
|
|
354
|
+
"aria-haspopup": p ? "menu" : void 0,
|
|
355
|
+
"aria-expanded": p ? s : void 0,
|
|
356
|
+
"data-active": o || void 0,
|
|
357
|
+
"data-state": s ? "open" : void 0,
|
|
358
|
+
className: z,
|
|
359
|
+
onClick: B,
|
|
360
|
+
onMouseEnter: V,
|
|
361
|
+
onMouseLeave: ee,
|
|
362
|
+
children: [
|
|
363
|
+
b && /* @__PURE__ */ d("span", {
|
|
364
|
+
className: Y.itemIcon,
|
|
365
|
+
children: b
|
|
366
|
+
}),
|
|
367
|
+
/* @__PURE__ */ f("span", {
|
|
368
|
+
className: Y.itemText,
|
|
369
|
+
children: [/* @__PURE__ */ d("span", {
|
|
370
|
+
className: Y.itemLabel,
|
|
371
|
+
children: w
|
|
372
|
+
}), x && /* @__PURE__ */ d("span", {
|
|
373
|
+
className: Y.itemDescription,
|
|
374
|
+
children: x
|
|
375
|
+
})]
|
|
376
|
+
}),
|
|
377
|
+
S && /* @__PURE__ */ d("span", {
|
|
378
|
+
className: Y.itemBadge,
|
|
379
|
+
children: S
|
|
380
|
+
}),
|
|
381
|
+
C && /* @__PURE__ */ d("span", {
|
|
382
|
+
className: Y.itemShortcut,
|
|
383
|
+
children: C
|
|
384
|
+
}),
|
|
385
|
+
L && /* @__PURE__ */ d("span", {
|
|
386
|
+
className: Y.indicator,
|
|
387
|
+
"aria-hidden": "true",
|
|
388
|
+
children: m ? /* @__PURE__ */ d(O, {}) : null
|
|
389
|
+
}),
|
|
390
|
+
p && /* @__PURE__ */ d("span", {
|
|
391
|
+
className: Y.itemShortcut,
|
|
392
|
+
"aria-hidden": "true",
|
|
393
|
+
children: /* @__PURE__ */ d(A, {})
|
|
394
|
+
})
|
|
395
|
+
]
|
|
396
|
+
}), we(e, N, p, s, () => n.setOpenSubId(e.id))] });
|
|
397
|
+
};
|
|
398
|
+
Se.displayName = "DropdownItemRow";
|
|
399
|
+
function Ce(e) {
|
|
400
|
+
let t = !1;
|
|
401
|
+
return {
|
|
402
|
+
originalEvent: e,
|
|
403
|
+
preventDefault: () => {
|
|
404
|
+
t = !0;
|
|
405
|
+
},
|
|
406
|
+
get defaultPrevented() {
|
|
407
|
+
return t;
|
|
408
|
+
}
|
|
409
|
+
};
|
|
410
|
+
}
|
|
411
|
+
function we(e, t, n, r, i) {
|
|
412
|
+
return !n || !r || e.type !== "subTrigger" || e.subEntries.length === 0 ? null : /* @__PURE__ */ d("ul", {
|
|
413
|
+
role: "menu",
|
|
414
|
+
className: Y.subContent,
|
|
415
|
+
onMouseEnter: i,
|
|
416
|
+
children: e.subEntries.map((e) => e.type === "label" ? /* @__PURE__ */ d("li", {
|
|
417
|
+
role: "presentation",
|
|
418
|
+
className: Y.subLabel,
|
|
419
|
+
children: e.props.children
|
|
420
|
+
}, e.id) : e.type === "separator" ? /* @__PURE__ */ d("li", {
|
|
421
|
+
role: "separator",
|
|
422
|
+
className: Y.subSeparator,
|
|
423
|
+
"aria-hidden": "true"
|
|
424
|
+
}, e.id) : e.type === "item" ? /* @__PURE__ */ d(Te, {
|
|
425
|
+
item: e.item,
|
|
426
|
+
id: `${t}-${e.itemIndex}`
|
|
427
|
+
}, e.item.id) : null)
|
|
428
|
+
});
|
|
429
|
+
}
|
|
430
|
+
function Te({ id: e, item: t }) {
|
|
431
|
+
let n = ve(), [r, i] = E(t.type === "checkbox" ? t.props.defaultChecked ?? !1 : !1), a = t.type === "checkbox", o = t.type === "radio", s = a ? t.props.checked ?? r : o ? (t.groupProps?.value ?? n.radioValues[t.groupId]) === t.props.value : !1, c = t.props, l = oe(c.children), u = l.icon ?? c.icon, p = l.description ?? ("description" in c ? c.description : void 0), m = l.badge ?? ("badge" in c ? c.badge : void 0), h = l.shortcut ?? c.shortcut, g = l.content.length ? l.content : c.children, _ = "color" in c ? c.color : void 0, v = n.loading || t.disabled, y = t.type === "item" ? t.props.href : void 0, b = t.type === "item" ? t.props.target : void 0, x = t.type === "item" ? t.props.download : void 0, S = a ? "menuitemcheckbox" : o ? "menuitemradio" : "menuitem", C = t.type === "item" && b === "_blank" && !t.props.rel ? "noreferrer noopener" : t.type === "item" ? t.props.rel : void 0, w = y ? "a" : "li", T = a || o, D = (e) => {
|
|
432
|
+
if (v) {
|
|
433
|
+
e.preventDefault();
|
|
434
|
+
return;
|
|
435
|
+
}
|
|
436
|
+
if (a && t.type === "checkbox") {
|
|
437
|
+
let e = !s;
|
|
438
|
+
i(e), t.props.onCheckedChange?.(e);
|
|
439
|
+
}
|
|
440
|
+
n.selectItem(t, Ce(e));
|
|
441
|
+
};
|
|
442
|
+
return /* @__PURE__ */ f(w, {
|
|
443
|
+
id: e,
|
|
444
|
+
role: S,
|
|
445
|
+
href: w === "a" && !v ? y : void 0,
|
|
446
|
+
target: w === "a" && !v ? b : void 0,
|
|
447
|
+
rel: w === "a" ? C : void 0,
|
|
448
|
+
download: w === "a" && !v ? x : void 0,
|
|
449
|
+
tabIndex: v ? -1 : 0,
|
|
450
|
+
"aria-disabled": v || void 0,
|
|
451
|
+
"aria-checked": a || o ? s : void 0,
|
|
452
|
+
className: W(Y.item, Y[n.size], {
|
|
453
|
+
[Y.disabled]: v,
|
|
454
|
+
[Y.checked]: s
|
|
455
|
+
}, _ && _ !== "default" ? Y[_] : void 0),
|
|
456
|
+
onClick: D,
|
|
457
|
+
children: [
|
|
458
|
+
T && /* @__PURE__ */ d("span", {
|
|
459
|
+
className: Y.indicator,
|
|
460
|
+
"aria-hidden": "true",
|
|
461
|
+
children: s ? /* @__PURE__ */ d(O, {}) : null
|
|
462
|
+
}),
|
|
463
|
+
u && /* @__PURE__ */ d("span", {
|
|
464
|
+
className: Y.itemIcon,
|
|
465
|
+
children: u
|
|
466
|
+
}),
|
|
467
|
+
/* @__PURE__ */ f("span", {
|
|
468
|
+
className: Y.itemText,
|
|
469
|
+
children: [/* @__PURE__ */ d("span", {
|
|
470
|
+
className: Y.itemLabel,
|
|
471
|
+
children: g
|
|
472
|
+
}), p && /* @__PURE__ */ d("span", {
|
|
473
|
+
className: Y.itemDescription,
|
|
474
|
+
children: p
|
|
475
|
+
})]
|
|
476
|
+
}),
|
|
477
|
+
m && /* @__PURE__ */ d("span", {
|
|
478
|
+
className: Y.itemBadge,
|
|
479
|
+
children: m
|
|
480
|
+
}),
|
|
481
|
+
h && /* @__PURE__ */ d("span", {
|
|
482
|
+
className: Y.itemShortcut,
|
|
483
|
+
children: h
|
|
484
|
+
})
|
|
485
|
+
]
|
|
486
|
+
});
|
|
487
|
+
}
|
|
488
|
+
var Ee = { group: "_group_aviwv_1" }, De = K("label", "Dropdown.Label"), Oe = ({ children: e, className: t }) => /* @__PURE__ */ d("li", {
|
|
489
|
+
role: "presentation",
|
|
490
|
+
className: W(Ee.group, t),
|
|
491
|
+
children: e
|
|
492
|
+
});
|
|
493
|
+
Oe.displayName = "DropdownLabelSurface";
|
|
494
|
+
//#endregion
|
|
495
|
+
//#region src/components/Dropdown/Loading/DropdownLoading.tsx
|
|
496
|
+
var ke = K("loading", "Dropdown.Loading"), Ae = ({ children: e }) => /* @__PURE__ */ d("li", {
|
|
497
|
+
role: "presentation",
|
|
498
|
+
"aria-live": "polite",
|
|
499
|
+
className: ue.empty,
|
|
500
|
+
children: e ?? "Loading actions..."
|
|
501
|
+
});
|
|
502
|
+
Ae.displayName = "DropdownLoadingSurface";
|
|
503
|
+
var je = { separator: "_separator_1v11r_1" }, Me = K("separator", "Dropdown.Separator"), Ne = ({ className: e }) => /* @__PURE__ */ d("li", {
|
|
504
|
+
role: "separator",
|
|
505
|
+
className: W(je.separator, e),
|
|
506
|
+
"aria-hidden": "true"
|
|
507
|
+
});
|
|
508
|
+
Ne.displayName = "DropdownSeparatorSurface";
|
|
509
|
+
//#endregion
|
|
510
|
+
//#region src/hooks/behavior/focus/useAriaIsolation.ts
|
|
511
|
+
var Pe = ({ active: e, enabled: t, content: n }) => {
|
|
241
512
|
x(() => {
|
|
242
513
|
if (!e || !t || !n) return;
|
|
243
514
|
let r = [], i = n.parentElement;
|
|
@@ -263,22 +534,22 @@ var q = K("checkboxItem", "Dropdown.CheckboxItem"), le = ({ active: e, enabled:
|
|
|
263
534
|
};
|
|
264
535
|
//#endregion
|
|
265
536
|
//#region src/hooks/behavior/overlay/useOverlayFocusRestore.ts
|
|
266
|
-
function
|
|
537
|
+
function X(e) {
|
|
267
538
|
return !(e instanceof HTMLElement) || !e.isConnected ? !1 : (e.focus(), document.activeElement === e);
|
|
268
539
|
}
|
|
269
|
-
var
|
|
270
|
-
let
|
|
271
|
-
o.current = t, s.current = n,
|
|
540
|
+
var Fe = ({ active: e, enabled: t = !0, finalFocus: n, onCloseAutoFocus: r }) => {
|
|
541
|
+
let a = T(null), o = T(t), s = T(n), l = T(r);
|
|
542
|
+
o.current = t, s.current = n, l.current = r;
|
|
272
543
|
let u = y(() => {
|
|
273
|
-
typeof document > "u" || (
|
|
544
|
+
typeof document > "u" || (a.current = document.activeElement);
|
|
274
545
|
}, []), d = y(() => {
|
|
275
|
-
o.current && (
|
|
546
|
+
o.current && (X(s.current?.current) || X(a.current));
|
|
276
547
|
}, []), f = y((e) => {
|
|
277
|
-
|
|
548
|
+
c({
|
|
278
549
|
enabled: o.current,
|
|
279
550
|
event: e,
|
|
280
|
-
onCloseAutoFocus:
|
|
281
|
-
}) &&
|
|
551
|
+
onCloseAutoFocus: l.current
|
|
552
|
+
}) && i(d);
|
|
282
553
|
}, [d]);
|
|
283
554
|
return x(() => {
|
|
284
555
|
if (e) return u(), () => {
|
|
@@ -293,7 +564,7 @@ var de = ({ active: e, enabled: t = !0, finalFocus: n, onCloseAutoFocus: r }) =>
|
|
|
293
564
|
restoreFocusAfterClose: f,
|
|
294
565
|
saveFocusSnapshot: u
|
|
295
566
|
};
|
|
296
|
-
},
|
|
567
|
+
}, Ie = () => {
|
|
297
568
|
let e = !1;
|
|
298
569
|
return {
|
|
299
570
|
preventDefault: () => {
|
|
@@ -303,7 +574,7 @@ var de = ({ active: e, enabled: t = !0, finalFocus: n, onCloseAutoFocus: r }) =>
|
|
|
303
574
|
return e;
|
|
304
575
|
}
|
|
305
576
|
};
|
|
306
|
-
},
|
|
577
|
+
}, Le = (e) => {
|
|
307
578
|
let t = !1;
|
|
308
579
|
return {
|
|
309
580
|
originalEvent: e,
|
|
@@ -314,26 +585,26 @@ var de = ({ active: e, enabled: t = !0, finalFocus: n, onCloseAutoFocus: r }) =>
|
|
|
314
585
|
return t;
|
|
315
586
|
}
|
|
316
587
|
};
|
|
317
|
-
},
|
|
588
|
+
}, Re = [
|
|
318
589
|
"a[href]",
|
|
319
590
|
"button:not([disabled])",
|
|
320
591
|
"textarea:not([disabled])",
|
|
321
592
|
"input:not([disabled])",
|
|
322
593
|
"select:not([disabled])",
|
|
323
594
|
"[tabindex]:not([tabindex=\"-1\"])"
|
|
324
|
-
].join(","),
|
|
325
|
-
(
|
|
326
|
-
},
|
|
327
|
-
|
|
595
|
+
].join(","), ze = (e) => Array.from(e.querySelectorAll(Re)).filter((e) => !e.hasAttribute("disabled")), Be = (e) => {
|
|
596
|
+
(ze(e)[0] ?? e).focus();
|
|
597
|
+
}, Ve = ({ active: e, contentRef: t, enabled: n, initialFocus: r, finalFocus: i, restoreFocus: a, onOpenAutoFocus: o, onCloseAutoFocus: s }) => {
|
|
598
|
+
Fe({
|
|
328
599
|
active: e,
|
|
329
600
|
enabled: a,
|
|
330
601
|
finalFocus: i,
|
|
331
602
|
onCloseAutoFocus: s
|
|
332
603
|
}), x(() => {
|
|
333
604
|
if (!e) return;
|
|
334
|
-
let n =
|
|
605
|
+
let n = Ie();
|
|
335
606
|
o?.(n), n.defaultPrevented || queueMicrotask(() => {
|
|
336
|
-
r?.current?.focus(), !r?.current && t.current &&
|
|
607
|
+
r?.current?.focus(), !r?.current && t.current && Be(t.current);
|
|
337
608
|
});
|
|
338
609
|
}, [
|
|
339
610
|
e,
|
|
@@ -344,7 +615,7 @@ var de = ({ active: e, enabled: t = !0, finalFocus: n, onCloseAutoFocus: r }) =>
|
|
|
344
615
|
if (!e || !n) return;
|
|
345
616
|
let r = (e) => {
|
|
346
617
|
if (e.key !== "Tab" || !t.current) return;
|
|
347
|
-
let n =
|
|
618
|
+
let n = ze(t.current);
|
|
348
619
|
if (n.length === 0) {
|
|
349
620
|
e.preventDefault(), t.current.focus();
|
|
350
621
|
return;
|
|
@@ -364,7 +635,7 @@ var de = ({ active: e, enabled: t = !0, finalFocus: n, onCloseAutoFocus: r }) =>
|
|
|
364
635
|
t,
|
|
365
636
|
n
|
|
366
637
|
]);
|
|
367
|
-
},
|
|
638
|
+
}, He = (e) => {
|
|
368
639
|
let [t, n] = E(() => typeof window > "u" || typeof window.matchMedia != "function" || !e ? !1 : window.matchMedia(`(max-width: ${e}px)`).matches);
|
|
369
640
|
return x(() => {
|
|
370
641
|
if (typeof window > "u" || typeof window.matchMedia != "function" || !e) return;
|
|
@@ -373,14 +644,14 @@ var de = ({ active: e, enabled: t = !0, finalFocus: n, onCloseAutoFocus: r }) =>
|
|
|
373
644
|
t.removeEventListener("change", r);
|
|
374
645
|
};
|
|
375
646
|
}, [e]), t;
|
|
376
|
-
},
|
|
377
|
-
let u =
|
|
378
|
-
|
|
379
|
-
...s ? [
|
|
380
|
-
|
|
647
|
+
}, Ue = ({ open: e, onOpenChange: t, placement: n = "bottom-start", strategy: r = "fixed", offset: i = 2, collisionPadding: a = 8, matchTriggerWidth: o = !1, avoidCollisions: s = !0, mobileSheetBreakpoint: c, middleware: l = [] } = {}) => {
|
|
648
|
+
let u = He(c), d = w(() => [
|
|
649
|
+
R(i),
|
|
650
|
+
...s ? [L({ padding: a })] : [],
|
|
651
|
+
B({ apply({ rects: e, elements: t }) {
|
|
381
652
|
!o || u || Object.assign(t.floating.style, { width: `${e.reference.width}px` });
|
|
382
653
|
} }),
|
|
383
|
-
...s ? [
|
|
654
|
+
...s ? [z({ padding: a })] : [],
|
|
384
655
|
...l
|
|
385
656
|
], [
|
|
386
657
|
s,
|
|
@@ -389,14 +660,14 @@ var de = ({ active: e, enabled: t = !0, finalFocus: n, onCloseAutoFocus: r }) =>
|
|
|
389
660
|
u,
|
|
390
661
|
o,
|
|
391
662
|
i
|
|
392
|
-
]), { refs: f, floatingStyles: p, isPositioned: m, update: h, context: g, middlewareData: _, placement: v } =
|
|
663
|
+
]), { refs: f, floatingStyles: p, isPositioned: m, update: h, context: g, middlewareData: _, placement: v } = V({
|
|
393
664
|
open: e,
|
|
394
665
|
onOpenChange: t,
|
|
395
666
|
placement: n,
|
|
396
667
|
strategy: r,
|
|
397
668
|
transform: !1,
|
|
398
669
|
middleware: d,
|
|
399
|
-
whileElementsMounted:
|
|
670
|
+
whileElementsMounted: I
|
|
400
671
|
});
|
|
401
672
|
return x(() => {
|
|
402
673
|
u && f.floating.current?.style.removeProperty("width");
|
|
@@ -414,21 +685,21 @@ var de = ({ active: e, enabled: t = !0, finalFocus: n, onCloseAutoFocus: r }) =>
|
|
|
414
685
|
setFloatingRef: f.setFloating,
|
|
415
686
|
updatePosition: h
|
|
416
687
|
};
|
|
417
|
-
},
|
|
688
|
+
}, We = n({
|
|
418
689
|
defaultLevel: "popover",
|
|
419
|
-
levels:
|
|
420
|
-
}),
|
|
421
|
-
function
|
|
422
|
-
let e =
|
|
423
|
-
diagnostics:
|
|
424
|
-
policy:
|
|
425
|
-
}),
|
|
690
|
+
levels: ne.tokens.zIndex
|
|
691
|
+
}), Ge = e("WebOverlayManager");
|
|
692
|
+
function Ke() {
|
|
693
|
+
let e = t({
|
|
694
|
+
diagnostics: Ge,
|
|
695
|
+
policy: We
|
|
696
|
+
}), n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map();
|
|
426
697
|
return {
|
|
427
698
|
register(t) {
|
|
428
699
|
return e.register(t);
|
|
429
700
|
},
|
|
430
|
-
unregister(
|
|
431
|
-
|
|
701
|
+
unregister(t) {
|
|
702
|
+
n.delete(t), r.delete(t), e.unregister(t);
|
|
432
703
|
},
|
|
433
704
|
update(t) {
|
|
434
705
|
return e.update(t);
|
|
@@ -451,16 +722,16 @@ function xe() {
|
|
|
451
722
|
getZIndex(t) {
|
|
452
723
|
return e.getZIndex(t);
|
|
453
724
|
},
|
|
454
|
-
registerEscapeHandler(e,
|
|
455
|
-
return
|
|
456
|
-
|
|
725
|
+
registerEscapeHandler(e, t) {
|
|
726
|
+
return n.set(e, t), () => {
|
|
727
|
+
n.get(e) === t && n.delete(e);
|
|
457
728
|
};
|
|
458
729
|
},
|
|
459
|
-
dispatchEscapeKeyDown(
|
|
730
|
+
dispatchEscapeKeyDown(t) {
|
|
460
731
|
let r = e.getTopmost();
|
|
461
732
|
if (!r) return !1;
|
|
462
|
-
let i =
|
|
463
|
-
return i ? (i(
|
|
733
|
+
let i = n.get(r.id);
|
|
734
|
+
return i ? (i(t), !0) : !1;
|
|
464
735
|
},
|
|
465
736
|
registerPointerDownOutsideHandler(e, t) {
|
|
466
737
|
return r.set(e, t), () => {
|
|
@@ -477,12 +748,12 @@ function xe() {
|
|
|
477
748
|
return e.subscribe(t);
|
|
478
749
|
},
|
|
479
750
|
clear() {
|
|
480
|
-
|
|
751
|
+
n.clear(), r.clear(), e.clear();
|
|
481
752
|
}
|
|
482
753
|
};
|
|
483
754
|
}
|
|
484
|
-
var
|
|
485
|
-
let i =
|
|
755
|
+
var qe = Ke(), Je = g(null), Ye = () => b(Je) ?? qe, Xe = ({ active: e, id: t, zIndexLevel: n, zIndex: r }) => {
|
|
756
|
+
let i = Ye(), a = D(i.subscribe, i.getSnapshot, i.getSnapshot);
|
|
486
757
|
x(() => {
|
|
487
758
|
if (e) return i.register({
|
|
488
759
|
id: t,
|
|
@@ -505,7 +776,7 @@ var Se = xe(), Ce = g(null), we = () => b(Ce) ?? Se, Te = ({ active: e, id: t, z
|
|
|
505
776
|
order: s?.order,
|
|
506
777
|
zIndex: i.getZIndex(t)
|
|
507
778
|
};
|
|
508
|
-
},
|
|
779
|
+
}, Ze = r((e) => {
|
|
509
780
|
if (typeof document > "u") return;
|
|
510
781
|
let t = (t) => {
|
|
511
782
|
t.key === "Escape" && e.dispatchEscapeKeyDown(t);
|
|
@@ -513,7 +784,7 @@ var Se = xe(), Ce = g(null), we = () => b(Ce) ?? Se, Te = ({ active: e, id: t, z
|
|
|
513
784
|
return document.addEventListener("keydown", t), () => {
|
|
514
785
|
document.removeEventListener("keydown", t);
|
|
515
786
|
};
|
|
516
|
-
}),
|
|
787
|
+
}), Qe = r((e) => {
|
|
517
788
|
if (typeof document > "u") return;
|
|
518
789
|
let t = (t) => {
|
|
519
790
|
e.dispatchPointerDownOutside(t);
|
|
@@ -522,14 +793,14 @@ var Se = xe(), Ce = g(null), we = () => b(Ce) ?? Se, Te = ({ active: e, id: t, z
|
|
|
522
793
|
document.removeEventListener("pointerdown", t);
|
|
523
794
|
};
|
|
524
795
|
});
|
|
525
|
-
function
|
|
526
|
-
return
|
|
796
|
+
function $e(e) {
|
|
797
|
+
return Ze.retain(e);
|
|
527
798
|
}
|
|
528
|
-
function
|
|
529
|
-
return
|
|
799
|
+
function et(e) {
|
|
800
|
+
return Qe.retain(e);
|
|
530
801
|
}
|
|
531
|
-
var
|
|
532
|
-
let m =
|
|
802
|
+
var tt = ({ active: e, id: t, zIndexLevel: n, registrationActive: r = e, registered: i = !1, zIndex: a, contentRef: o, ignoreRefs: s = [], closeOnEscape: c, closeOnOutsidePress: l, onEscapeKeyDown: u, onPointerDownOutside: d, onInteractOutside: f, requestClose: p }) => {
|
|
803
|
+
let m = Ye(), h = Xe({
|
|
533
804
|
active: r && !i,
|
|
534
805
|
id: t,
|
|
535
806
|
zIndexLevel: n,
|
|
@@ -537,7 +808,7 @@ var Ae = ({ active: e, id: t, zIndexLevel: n, registrationActive: r = e, registe
|
|
|
537
808
|
}), g = T(s);
|
|
538
809
|
return g.current = s, x(() => {
|
|
539
810
|
if (!e) return;
|
|
540
|
-
let n =
|
|
811
|
+
let n = $e(m), r = m.registerEscapeHandler(t, (e) => {
|
|
541
812
|
u?.(e), !(e.defaultPrevented || !c) && p("escape-key", e);
|
|
542
813
|
});
|
|
543
814
|
return () => {
|
|
@@ -552,9 +823,9 @@ var Ae = ({ active: e, id: t, zIndexLevel: n, registrationActive: r = e, registe
|
|
|
552
823
|
p
|
|
553
824
|
]), x(() => {
|
|
554
825
|
if (!e) return;
|
|
555
|
-
let n =
|
|
826
|
+
let n = et(m), r = m.registerPointerDownOutsideHandler(t, (e) => {
|
|
556
827
|
if (e.target instanceof Node && [o, ...g.current].some((t) => t.current?.contains(e.target))) return;
|
|
557
|
-
let t =
|
|
828
|
+
let t = Le(e);
|
|
558
829
|
d?.(t), f?.(t), !(t.defaultPrevented || !l) && p("outside-press", e);
|
|
559
830
|
});
|
|
560
831
|
return () => {
|
|
@@ -570,13 +841,13 @@ var Ae = ({ active: e, id: t, zIndexLevel: n, registrationActive: r = e, registe
|
|
|
570
841
|
d,
|
|
571
842
|
p
|
|
572
843
|
]), h;
|
|
573
|
-
},
|
|
574
|
-
...
|
|
844
|
+
}, nt = ({ open: e, onOpenChange: t, placement: n = "bottom-start", strategy: r, portal: i = !0, presentation: a, animationStyle: o, offset: c, collisionPadding: l, matchTriggerWidth: u, avoidCollisions: d, mobileSheetBreakpoint: f, middleware: p } = {}) => ({
|
|
845
|
+
...Ue({
|
|
575
846
|
open: e,
|
|
576
847
|
onOpenChange: t,
|
|
577
848
|
placement: n,
|
|
578
849
|
strategy: r ?? (i ? "fixed" : "absolute"),
|
|
579
|
-
offset:
|
|
850
|
+
offset: c,
|
|
580
851
|
collisionPadding: l,
|
|
581
852
|
matchTriggerWidth: u,
|
|
582
853
|
avoidCollisions: d,
|
|
@@ -584,33 +855,33 @@ var Ae = ({ active: e, id: t, zIndexLevel: n, registrationActive: r = e, registe
|
|
|
584
855
|
middleware: p
|
|
585
856
|
}),
|
|
586
857
|
animationStyle: o,
|
|
587
|
-
presentation:
|
|
858
|
+
presentation: s({
|
|
588
859
|
presentation: a,
|
|
589
860
|
defaultPresentation: i ? "floating" : "inline"
|
|
590
861
|
})
|
|
591
|
-
}),
|
|
862
|
+
}), rt = 0, it = "", at = {
|
|
592
863
|
lock() {
|
|
593
|
-
typeof document > "u" || (
|
|
864
|
+
typeof document > "u" || (rt === 0 && (it = document.body.style.overflow, document.body.style.overflow = "hidden"), rt += 1);
|
|
594
865
|
},
|
|
595
866
|
unlock() {
|
|
596
|
-
typeof document > "u" || (
|
|
867
|
+
typeof document > "u" || (rt = Math.max(0, rt - 1), rt === 0 && (document.body.style.overflow = it));
|
|
597
868
|
}
|
|
598
|
-
},
|
|
869
|
+
}, ot = ({ active: e, enabled: t = !0 }) => {
|
|
599
870
|
x(() => {
|
|
600
|
-
if (!(!e || !t)) return
|
|
601
|
-
|
|
871
|
+
if (!(!e || !t)) return at.lock(), () => {
|
|
872
|
+
at.unlock();
|
|
602
873
|
};
|
|
603
874
|
}, [e, t]);
|
|
604
|
-
},
|
|
875
|
+
}, st = () => typeof document > "u" ? null : document.body, ct = ({ container: e } = {}) => {
|
|
605
876
|
let [t, n] = E(!1);
|
|
606
877
|
return x(() => {
|
|
607
878
|
n(!0);
|
|
608
|
-
}, []), t ? e ?? document.getElementById("overlay-root") ??
|
|
879
|
+
}, []), t ? e ?? document.getElementById("overlay-root") ?? st() : null;
|
|
609
880
|
};
|
|
610
881
|
//#endregion
|
|
611
882
|
//#region src/hooks/behavior/select/useSelectPosition.ts
|
|
612
|
-
function
|
|
613
|
-
return
|
|
883
|
+
function lt({ avoidCollisions: e, isOpen: t, matchTriggerWidth: n, onOpenChange: r, placement: i }) {
|
|
884
|
+
return nt({
|
|
614
885
|
open: t,
|
|
615
886
|
onOpenChange: r,
|
|
616
887
|
placement: i === "bottom" || i === "top" ? `${i}-start` : i,
|
|
@@ -621,12 +892,12 @@ function Re({ avoidCollisions: e, isOpen: t, matchTriggerWidth: n, onOpenChange:
|
|
|
621
892
|
}
|
|
622
893
|
//#endregion
|
|
623
894
|
//#region src/hooks/useControllableState.ts
|
|
624
|
-
var
|
|
895
|
+
var ut = ({ value: e, defaultValue: t, onChange: n }) => {
|
|
625
896
|
let [r, i] = E(t), a = e !== void 0;
|
|
626
897
|
return [a ? e : r, y((e) => {
|
|
627
898
|
a || i(e), n?.(e);
|
|
628
899
|
}, [a, n])];
|
|
629
|
-
},
|
|
900
|
+
}, dt = ({ activeIndex: e, setActiveIndex: t, items: n, isOpen: r, onOpen: i, onSelect: a, onClose: o, getItemText: s, loop: c = !0 }) => {
|
|
630
901
|
let l = T({
|
|
631
902
|
value: "",
|
|
632
903
|
timeoutId: void 0
|
|
@@ -707,7 +978,7 @@ var Y = ({ value: e, defaultValue: t, onChange: n }) => {
|
|
|
707
978
|
f,
|
|
708
979
|
p
|
|
709
980
|
]) };
|
|
710
|
-
},
|
|
981
|
+
}, ft = ({ items: e, open: t, defaultOpen: n = !1, disabled: r = !1, onOpenChange: i, onSelect: a, getItemValue: o, getItemText: s, loop: c = !0 }) => {
|
|
711
982
|
let [l, u] = E(n), [d, f] = E(-1), p = t !== void 0, m = t ?? l, h = y(() => e.findIndex((e) => !e.disabled), [e]), g = y(() => {
|
|
712
983
|
for (let t = e.length - 1; t >= 0; t--) if (!e[t]?.disabled) return t;
|
|
713
984
|
return -1;
|
|
@@ -762,7 +1033,7 @@ var Y = ({ value: e, defaultValue: t, onChange: n }) => {
|
|
|
762
1033
|
d,
|
|
763
1034
|
e,
|
|
764
1035
|
w
|
|
765
|
-
]), { onKeyDown: D } =
|
|
1036
|
+
]), { onKeyDown: D } = dt({
|
|
766
1037
|
activeIndex: d,
|
|
767
1038
|
setActiveIndex: f,
|
|
768
1039
|
items: e,
|
|
@@ -791,8 +1062,8 @@ var Y = ({ value: e, defaultValue: t, onChange: n }) => {
|
|
|
791
1062
|
getFirstEnabledIndex: h,
|
|
792
1063
|
getLastEnabledIndex: g
|
|
793
1064
|
};
|
|
794
|
-
},
|
|
795
|
-
let a = S(), o = S(), s = S(), [c, l] =
|
|
1065
|
+
}, pt = ({ open: e, defaultOpen: t = !1, onOpenChange: n, closeOnEscape: r, closeOnOutsidePress: i }) => {
|
|
1066
|
+
let a = S(), o = S(), s = S(), [c, l] = ut({
|
|
796
1067
|
value: e,
|
|
797
1068
|
defaultValue: t,
|
|
798
1069
|
onChange: n
|
|
@@ -810,7 +1081,7 @@ var Y = ({ value: e, defaultValue: t, onChange: n }) => {
|
|
|
810
1081
|
titleId: o,
|
|
811
1082
|
descriptionId: s
|
|
812
1083
|
};
|
|
813
|
-
},
|
|
1084
|
+
}, mt = ({ value: e, defaultValue: t, onValueChange: n, options: r, multiple: i = !1, maxSelected: a, closeOnSelect: o = !i, disabled: s = !1, open: c, defaultOpen: l = !1, onOpenChange: u }) => {
|
|
814
1085
|
let d = y((e) => {
|
|
815
1086
|
if (n) {
|
|
816
1087
|
if (i) {
|
|
@@ -823,11 +1094,11 @@ var Y = ({ value: e, defaultValue: t, onChange: n }) => {
|
|
|
823
1094
|
}
|
|
824
1095
|
n(Array.isArray(e) ? e[0] ?? "" : e);
|
|
825
1096
|
}
|
|
826
|
-
}, [i, n]), [f, p] =
|
|
1097
|
+
}, [i, n]), [f, p] = ut({
|
|
827
1098
|
value: e,
|
|
828
1099
|
defaultValue: t ?? (i ? [] : ""),
|
|
829
1100
|
onChange: d
|
|
830
|
-
}), [m, h] =
|
|
1101
|
+
}), [m, h] = ut({
|
|
831
1102
|
value: c,
|
|
832
1103
|
defaultValue: l,
|
|
833
1104
|
onChange: u
|
|
@@ -896,7 +1167,7 @@ var Y = ({ value: e, defaultValue: t, onChange: n }) => {
|
|
|
896
1167
|
g,
|
|
897
1168
|
r,
|
|
898
1169
|
k
|
|
899
|
-
]), { onKeyDown: j } =
|
|
1170
|
+
]), { onKeyDown: j } = dt({
|
|
900
1171
|
activeIndex: g,
|
|
901
1172
|
setActiveIndex: _,
|
|
902
1173
|
items: r,
|
|
@@ -917,316 +1188,44 @@ var Y = ({ value: e, defaultValue: t, onChange: n }) => {
|
|
|
917
1188
|
setIsOpen: h,
|
|
918
1189
|
activeIndex: g,
|
|
919
1190
|
setActiveIndex: _,
|
|
920
|
-
getInitialActiveIndex: C,
|
|
921
|
-
openDropdown: T,
|
|
922
|
-
closeDropdown: D,
|
|
923
|
-
toggleDropdown: O,
|
|
924
|
-
selectValue: k,
|
|
925
|
-
select: k,
|
|
926
|
-
selectActiveOption: A,
|
|
927
|
-
onKeyDown: j
|
|
928
|
-
};
|
|
929
|
-
}, Ue = ({ value: e, defaultValue: t = "", onValueChange: n }) => {
|
|
930
|
-
let [r, i] = Y({
|
|
931
|
-
value: e,
|
|
932
|
-
defaultValue: t,
|
|
933
|
-
onChange: n
|
|
934
|
-
});
|
|
935
|
-
return {
|
|
936
|
-
value: r,
|
|
937
|
-
setValue: i
|
|
938
|
-
};
|
|
939
|
-
}, We = g(null), Ge = ({ children: e, container: t = null }) => /* @__PURE__ */ d(We.Provider, {
|
|
940
|
-
value: t,
|
|
941
|
-
children: e
|
|
942
|
-
}), Ke = ({ children: e, container: t }) => {
|
|
943
|
-
let n = b(We), r = Le({ container: t ?? n });
|
|
944
|
-
return r ? O(e, r) : null;
|
|
945
|
-
};
|
|
946
|
-
Ke.__velliraPortal = !0, Ke.displayName = "Portal", Ge.displayName = "PortalProvider";
|
|
947
|
-
var qe = {
|
|
948
|
-
dropdown: "_dropdown_m7rnq_1",
|
|
949
|
-
"dropdown-in": "_dropdown-in_m7rnq_1",
|
|
950
|
-
primary: "_primary_m7rnq_42",
|
|
951
|
-
neutral: "_neutral_m7rnq_65",
|
|
952
|
-
success: "_success_m7rnq_88",
|
|
953
|
-
warning: "_warning_m7rnq_111",
|
|
954
|
-
danger: "_danger_m7rnq_134",
|
|
955
|
-
empty: "_empty_m7rnq_157",
|
|
956
|
-
searchWrap: "_searchWrap_m7rnq_165",
|
|
957
|
-
search: "_search_m7rnq_165",
|
|
958
|
-
"dropdown-sheet-in": "_dropdown-sheet-in_m7rnq_1"
|
|
959
|
-
}, Je = K("empty", "Dropdown.Empty"), Ye = ({ children: e }) => /* @__PURE__ */ d("li", {
|
|
960
|
-
role: "presentation",
|
|
961
|
-
className: qe.empty,
|
|
962
|
-
children: e ?? "No actions available"
|
|
963
|
-
});
|
|
964
|
-
Ye.displayName = "DropdownEmptySurface";
|
|
965
|
-
//#endregion
|
|
966
|
-
//#region src/components/Dropdown/Group/DropdownGroup.tsx
|
|
967
|
-
var Xe = K("group", "Dropdown.Group"), Ze = () => null;
|
|
968
|
-
Ze.displayName = "DropdownGroupSurface";
|
|
969
|
-
//#endregion
|
|
970
|
-
//#region src/components/Dropdown/internal/DropdownContext.tsx
|
|
971
|
-
var Qe = g(null), $e = g(null), et = g(null), tt = Qe.Provider, nt = $e.Provider;
|
|
972
|
-
et.Provider;
|
|
973
|
-
function rt() {
|
|
974
|
-
let e = b(Qe);
|
|
975
|
-
if (!e) throw Error("Dropdown compound components must be used inside Dropdown.");
|
|
976
|
-
return e;
|
|
977
|
-
}
|
|
978
|
-
function it() {
|
|
979
|
-
let e = b($e);
|
|
980
|
-
if (!e) throw Error("Dropdown.Trigger must be used inside Dropdown.");
|
|
981
|
-
return e;
|
|
982
|
-
}
|
|
983
|
-
//#endregion
|
|
984
|
-
//#region src/utils/devWarning.ts
|
|
985
|
-
var at = (e, t) => {
|
|
986
|
-
process.env.NODE_ENV !== "production" && !e && console.warn(t);
|
|
987
|
-
}, X = {
|
|
988
|
-
item: "_item_xmygj_1",
|
|
989
|
-
disabled: "_disabled_xmygj_35",
|
|
990
|
-
active: "_active_xmygj_53",
|
|
991
|
-
itemShortcut: "_itemShortcut_xmygj_67",
|
|
992
|
-
itemDescription: "_itemDescription_xmygj_68",
|
|
993
|
-
primary: "_primary_xmygj_76",
|
|
994
|
-
success: "_success_xmygj_94",
|
|
995
|
-
warning: "_warning_xmygj_112",
|
|
996
|
-
danger: "_danger_xmygj_130",
|
|
997
|
-
itemIcon: "_itemIcon_xmygj_154",
|
|
998
|
-
sm: "_sm_xmygj_174",
|
|
999
|
-
md: "_md_xmygj_180",
|
|
1000
|
-
lg: "_lg_xmygj_184",
|
|
1001
|
-
itemText: "_itemText_xmygj_191",
|
|
1002
|
-
itemLabel: "_itemLabel_xmygj_200",
|
|
1003
|
-
itemBadge: "_itemBadge_xmygj_226",
|
|
1004
|
-
indicator: "_indicator_xmygj_253",
|
|
1005
|
-
"dropdown-indicator-in": "_dropdown-indicator-in_xmygj_1",
|
|
1006
|
-
checked: "_checked_xmygj_270",
|
|
1007
|
-
"dropdown-item-pop": "_dropdown-item-pop_xmygj_1",
|
|
1008
|
-
subContent: "_subContent_xmygj_275",
|
|
1009
|
-
"dropdown-sub-in": "_dropdown-sub-in_xmygj_1",
|
|
1010
|
-
subLabel: "_subLabel_xmygj_300",
|
|
1011
|
-
subSeparator: "_subSeparator_xmygj_308"
|
|
1012
|
-
}, ot = K("item", "Dropdown.Item"), st = ({ item: e, itemIndex: t }) => {
|
|
1013
|
-
let n = rt(), r = T(void 0), [i, a] = E(e.type === "checkbox" ? e.props.defaultChecked ?? !1 : !1), o = n.activeIndex === t, s = n.openSubId === e.id, c = e.type === "checkbox", l = e.type === "radio", p = e.type === "subTrigger", m = c ? e.props.checked ?? i : l ? (e.groupProps?.value ?? n.radioValues[e.groupId]) === e.props.value : !1, g = n.loading || e.disabled, _ = e.props, y = oe(_.children), b = y.icon ?? _.icon, x = y.description ?? ("description" in _ ? _.description : void 0), S = y.badge ?? ("badge" in _ ? _.badge : void 0), C = y.shortcut ?? _.shortcut, w = y.content.length ? y.content : _.children, D = "color" in _ ? _.color : void 0, O = e.type === "item" ? e.props.href : void 0, k = e.type === "item" ? e.props.target : void 0, A = e.type === "item" ? e.props.download : void 0, j = n.getItemId(t), M = c ? "menuitemcheckbox" : l ? "menuitemradio" : "menuitem", N = e.type === "item" && k === "_blank" && !e.props.rel ? "noreferrer noopener" : e.type === "item" ? e.props.rel : void 0, P = O ? "a" : "li", F = c || l, I = _.asChild && v(_.children) ? _.children : void 0, L = U(X.item, X[n.size], {
|
|
1014
|
-
[X.active]: o,
|
|
1015
|
-
[X.disabled]: g,
|
|
1016
|
-
[X.checked]: m
|
|
1017
|
-
}, D && D !== "default" ? X[D] : void 0, _.className);
|
|
1018
|
-
at(!_.asChild || !!I, "Dropdown.Item: asChild requires a single valid React element child.");
|
|
1019
|
-
let R = (t) => {
|
|
1020
|
-
if (g) {
|
|
1021
|
-
t.preventDefault();
|
|
1022
|
-
return;
|
|
1023
|
-
}
|
|
1024
|
-
if (c && e.type === "checkbox") {
|
|
1025
|
-
let t = !m;
|
|
1026
|
-
a(t), e.props.onCheckedChange?.(t);
|
|
1027
|
-
}
|
|
1028
|
-
n.selectItem(e, ct(t));
|
|
1029
|
-
}, z = () => {
|
|
1030
|
-
g || (n.setActiveIndex(t), p ? (window.clearTimeout(r.current), r.current = window.setTimeout(() => n.setOpenSubId(e.id), 120)) : (window.clearTimeout(r.current), n.setOpenSubId(void 0)));
|
|
1031
|
-
}, B = () => {
|
|
1032
|
-
window.clearTimeout(r.current);
|
|
1033
|
-
};
|
|
1034
|
-
return I ? /* @__PURE__ */ f(u, { children: [h(I, {
|
|
1035
|
-
id: j,
|
|
1036
|
-
role: M,
|
|
1037
|
-
tabIndex: g ? -1 : 0,
|
|
1038
|
-
"aria-disabled": g || void 0,
|
|
1039
|
-
"aria-checked": c || l ? m : void 0,
|
|
1040
|
-
"aria-haspopup": p ? "menu" : void 0,
|
|
1041
|
-
"aria-expanded": p ? s : void 0,
|
|
1042
|
-
"data-active": o || void 0,
|
|
1043
|
-
"data-state": s ? "open" : void 0,
|
|
1044
|
-
className: U(I.props.className, L),
|
|
1045
|
-
onClick: (e) => {
|
|
1046
|
-
I.props.onClick?.(e), e.defaultPrevented || R(e);
|
|
1047
|
-
},
|
|
1048
|
-
onMouseEnter: (e) => {
|
|
1049
|
-
I.props.onMouseEnter?.(e), e.defaultPrevented || z(e);
|
|
1050
|
-
},
|
|
1051
|
-
onMouseLeave: (e) => {
|
|
1052
|
-
I.props.onMouseLeave?.(e), e.defaultPrevented || B(e);
|
|
1053
|
-
}
|
|
1054
|
-
}), lt(e, j, p, s, () => n.setOpenSubId(e.id))] }) : /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ f(P, {
|
|
1055
|
-
id: j,
|
|
1056
|
-
role: M,
|
|
1057
|
-
href: P === "a" && !g ? O : void 0,
|
|
1058
|
-
target: P === "a" && !g ? k : void 0,
|
|
1059
|
-
rel: P === "a" ? N : void 0,
|
|
1060
|
-
download: P === "a" && !g ? A : void 0,
|
|
1061
|
-
tabIndex: g ? -1 : 0,
|
|
1062
|
-
"aria-disabled": g || void 0,
|
|
1063
|
-
"aria-checked": c || l ? m : void 0,
|
|
1064
|
-
"aria-haspopup": p ? "menu" : void 0,
|
|
1065
|
-
"aria-expanded": p ? s : void 0,
|
|
1066
|
-
"data-active": o || void 0,
|
|
1067
|
-
"data-state": s ? "open" : void 0,
|
|
1068
|
-
className: L,
|
|
1069
|
-
onClick: R,
|
|
1070
|
-
onMouseEnter: z,
|
|
1071
|
-
onMouseLeave: B,
|
|
1072
|
-
children: [
|
|
1073
|
-
b && /* @__PURE__ */ d("span", {
|
|
1074
|
-
className: X.itemIcon,
|
|
1075
|
-
children: b
|
|
1076
|
-
}),
|
|
1077
|
-
/* @__PURE__ */ f("span", {
|
|
1078
|
-
className: X.itemText,
|
|
1079
|
-
children: [/* @__PURE__ */ d("span", {
|
|
1080
|
-
className: X.itemLabel,
|
|
1081
|
-
children: w
|
|
1082
|
-
}), x && /* @__PURE__ */ d("span", {
|
|
1083
|
-
className: X.itemDescription,
|
|
1084
|
-
children: x
|
|
1085
|
-
})]
|
|
1086
|
-
}),
|
|
1087
|
-
S && /* @__PURE__ */ d("span", {
|
|
1088
|
-
className: X.itemBadge,
|
|
1089
|
-
children: S
|
|
1090
|
-
}),
|
|
1091
|
-
C && /* @__PURE__ */ d("span", {
|
|
1092
|
-
className: X.itemShortcut,
|
|
1093
|
-
children: C
|
|
1094
|
-
}),
|
|
1095
|
-
F && /* @__PURE__ */ d("span", {
|
|
1096
|
-
className: X.indicator,
|
|
1097
|
-
"aria-hidden": "true",
|
|
1098
|
-
children: m ? /* @__PURE__ */ d(V, {}) : null
|
|
1099
|
-
}),
|
|
1100
|
-
p && /* @__PURE__ */ d("span", {
|
|
1101
|
-
className: X.itemShortcut,
|
|
1102
|
-
"aria-hidden": "true",
|
|
1103
|
-
children: /* @__PURE__ */ d(te, {})
|
|
1104
|
-
})
|
|
1105
|
-
]
|
|
1106
|
-
}), lt(e, j, p, s, () => n.setOpenSubId(e.id))] });
|
|
1107
|
-
};
|
|
1108
|
-
st.displayName = "DropdownItemRow";
|
|
1109
|
-
function ct(e) {
|
|
1110
|
-
let t = !1;
|
|
1111
|
-
return {
|
|
1112
|
-
originalEvent: e,
|
|
1113
|
-
preventDefault: () => {
|
|
1114
|
-
t = !0;
|
|
1115
|
-
},
|
|
1116
|
-
get defaultPrevented() {
|
|
1117
|
-
return t;
|
|
1118
|
-
}
|
|
1119
|
-
};
|
|
1120
|
-
}
|
|
1121
|
-
function lt(e, t, n, r, i) {
|
|
1122
|
-
return !n || !r || e.type !== "subTrigger" || e.subEntries.length === 0 ? null : /* @__PURE__ */ d("ul", {
|
|
1123
|
-
role: "menu",
|
|
1124
|
-
className: X.subContent,
|
|
1125
|
-
onMouseEnter: i,
|
|
1126
|
-
children: e.subEntries.map((e) => e.type === "label" ? /* @__PURE__ */ d("li", {
|
|
1127
|
-
role: "presentation",
|
|
1128
|
-
className: X.subLabel,
|
|
1129
|
-
children: e.props.children
|
|
1130
|
-
}, e.id) : e.type === "separator" ? /* @__PURE__ */ d("li", {
|
|
1131
|
-
role: "separator",
|
|
1132
|
-
className: X.subSeparator,
|
|
1133
|
-
"aria-hidden": "true"
|
|
1134
|
-
}, e.id) : e.type === "item" ? /* @__PURE__ */ d(ut, {
|
|
1135
|
-
item: e.item,
|
|
1136
|
-
id: `${t}-${e.itemIndex}`
|
|
1137
|
-
}, e.item.id) : null)
|
|
1138
|
-
});
|
|
1139
|
-
}
|
|
1140
|
-
function ut({ id: e, item: t }) {
|
|
1141
|
-
let n = rt(), [r, i] = E(t.type === "checkbox" ? t.props.defaultChecked ?? !1 : !1), a = t.type === "checkbox", o = t.type === "radio", s = a ? t.props.checked ?? r : o ? (t.groupProps?.value ?? n.radioValues[t.groupId]) === t.props.value : !1, c = t.props, l = oe(c.children), u = l.icon ?? c.icon, p = l.description ?? ("description" in c ? c.description : void 0), m = l.badge ?? ("badge" in c ? c.badge : void 0), h = l.shortcut ?? c.shortcut, g = l.content.length ? l.content : c.children, _ = "color" in c ? c.color : void 0, v = n.loading || t.disabled, y = t.type === "item" ? t.props.href : void 0, b = t.type === "item" ? t.props.target : void 0, x = t.type === "item" ? t.props.download : void 0, S = a ? "menuitemcheckbox" : o ? "menuitemradio" : "menuitem", C = t.type === "item" && b === "_blank" && !t.props.rel ? "noreferrer noopener" : t.type === "item" ? t.props.rel : void 0, w = y ? "a" : "li", T = a || o, D = (e) => {
|
|
1142
|
-
if (v) {
|
|
1143
|
-
e.preventDefault();
|
|
1144
|
-
return;
|
|
1145
|
-
}
|
|
1146
|
-
if (a && t.type === "checkbox") {
|
|
1147
|
-
let e = !s;
|
|
1148
|
-
i(e), t.props.onCheckedChange?.(e);
|
|
1149
|
-
}
|
|
1150
|
-
n.selectItem(t, ct(e));
|
|
1191
|
+
getInitialActiveIndex: C,
|
|
1192
|
+
openDropdown: T,
|
|
1193
|
+
closeDropdown: D,
|
|
1194
|
+
toggleDropdown: O,
|
|
1195
|
+
selectValue: k,
|
|
1196
|
+
select: k,
|
|
1197
|
+
selectActiveOption: A,
|
|
1198
|
+
onKeyDown: j
|
|
1151
1199
|
};
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
rel: w === "a" ? C : void 0,
|
|
1158
|
-
download: w === "a" && !v ? x : void 0,
|
|
1159
|
-
tabIndex: v ? -1 : 0,
|
|
1160
|
-
"aria-disabled": v || void 0,
|
|
1161
|
-
"aria-checked": a || o ? s : void 0,
|
|
1162
|
-
className: U(X.item, X[n.size], {
|
|
1163
|
-
[X.disabled]: v,
|
|
1164
|
-
[X.checked]: s
|
|
1165
|
-
}, _ && _ !== "default" ? X[_] : void 0),
|
|
1166
|
-
onClick: D,
|
|
1167
|
-
children: [
|
|
1168
|
-
T && /* @__PURE__ */ d("span", {
|
|
1169
|
-
className: X.indicator,
|
|
1170
|
-
"aria-hidden": "true",
|
|
1171
|
-
children: s ? /* @__PURE__ */ d(V, {}) : null
|
|
1172
|
-
}),
|
|
1173
|
-
u && /* @__PURE__ */ d("span", {
|
|
1174
|
-
className: X.itemIcon,
|
|
1175
|
-
children: u
|
|
1176
|
-
}),
|
|
1177
|
-
/* @__PURE__ */ f("span", {
|
|
1178
|
-
className: X.itemText,
|
|
1179
|
-
children: [/* @__PURE__ */ d("span", {
|
|
1180
|
-
className: X.itemLabel,
|
|
1181
|
-
children: g
|
|
1182
|
-
}), p && /* @__PURE__ */ d("span", {
|
|
1183
|
-
className: X.itemDescription,
|
|
1184
|
-
children: p
|
|
1185
|
-
})]
|
|
1186
|
-
}),
|
|
1187
|
-
m && /* @__PURE__ */ d("span", {
|
|
1188
|
-
className: X.itemBadge,
|
|
1189
|
-
children: m
|
|
1190
|
-
}),
|
|
1191
|
-
h && /* @__PURE__ */ d("span", {
|
|
1192
|
-
className: X.itemShortcut,
|
|
1193
|
-
children: h
|
|
1194
|
-
})
|
|
1195
|
-
]
|
|
1200
|
+
}, ht = ({ value: e, defaultValue: t = "", onValueChange: n }) => {
|
|
1201
|
+
let [r, i] = ut({
|
|
1202
|
+
value: e,
|
|
1203
|
+
defaultValue: t,
|
|
1204
|
+
onChange: n
|
|
1196
1205
|
});
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1206
|
+
return {
|
|
1207
|
+
value: r,
|
|
1208
|
+
setValue: i
|
|
1209
|
+
};
|
|
1210
|
+
}, gt = g(null), _t = ({ children: e, container: t = null }) => /* @__PURE__ */ d(gt.Provider, {
|
|
1211
|
+
value: t,
|
|
1201
1212
|
children: e
|
|
1202
|
-
})
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
role: "presentation",
|
|
1208
|
-
"aria-live": "polite",
|
|
1209
|
-
className: qe.empty,
|
|
1210
|
-
children: e ?? "Loading actions..."
|
|
1211
|
-
});
|
|
1212
|
-
ht.displayName = "DropdownLoadingSurface";
|
|
1213
|
-
var gt = { separator: "_separator_1v11r_1" }, _t = K("separator", "Dropdown.Separator"), vt = ({ className: e }) => /* @__PURE__ */ d("li", {
|
|
1214
|
-
role: "separator",
|
|
1215
|
-
className: U(gt.separator, e),
|
|
1216
|
-
"aria-hidden": "true"
|
|
1217
|
-
});
|
|
1218
|
-
vt.displayName = "DropdownSeparatorSurface";
|
|
1213
|
+
}), vt = ({ children: e, container: t }) => {
|
|
1214
|
+
let n = b(gt), r = ct({ container: t ?? n });
|
|
1215
|
+
return r ? N(e, r) : null;
|
|
1216
|
+
};
|
|
1217
|
+
vt.__velliraPortal = !0, vt.displayName = "Portal", _t.displayName = "PortalProvider";
|
|
1219
1218
|
//#endregion
|
|
1220
1219
|
//#region src/components/Dropdown/Content/DropdownContent.tsx
|
|
1221
1220
|
var yt = ({ className: e }) => {
|
|
1222
|
-
let t =
|
|
1221
|
+
let t = ve(), { contentReadyToFocus: n, isOpen: r, setContentRef: i } = t, a = T(null), o = y((e) => {
|
|
1223
1222
|
a.current = e, i(e);
|
|
1224
1223
|
}, [i]);
|
|
1225
1224
|
if (x(() => {
|
|
1226
1225
|
let e = a.current;
|
|
1227
1226
|
!r || !n || !e || e.contains(document.activeElement) || e.focus({ preventScroll: !0 });
|
|
1228
1227
|
}, [n, r]), !r) return null;
|
|
1229
|
-
let s =
|
|
1228
|
+
let s = W(ue.dropdown, ue[t.color], t.contentProps?.className, e), c = /* @__PURE__ */ f("ul", {
|
|
1230
1229
|
ref: o,
|
|
1231
1230
|
id: t.contentId,
|
|
1232
1231
|
role: "menu",
|
|
@@ -1243,9 +1242,9 @@ var yt = ({ className: e }) => {
|
|
|
1243
1242
|
"data-color": t.color,
|
|
1244
1243
|
children: [t.searchable && /* @__PURE__ */ f("li", {
|
|
1245
1244
|
role: "presentation",
|
|
1246
|
-
className:
|
|
1247
|
-
children: [/* @__PURE__ */ d(
|
|
1248
|
-
className:
|
|
1245
|
+
className: W(ue.searchWrap, t.searchProps?.className),
|
|
1246
|
+
children: [/* @__PURE__ */ d(M, { "aria-hidden": "true" }), /* @__PURE__ */ d("input", {
|
|
1247
|
+
className: ue.search,
|
|
1249
1248
|
value: t.searchValue,
|
|
1250
1249
|
placeholder: t.searchPlaceholder,
|
|
1251
1250
|
"aria-label": t.searchProps?.["aria-label"] ?? t.searchPlaceholder,
|
|
@@ -1255,14 +1254,14 @@ var yt = ({ className: e }) => {
|
|
|
1255
1254
|
e.key !== "ArrowDown" && e.key !== "ArrowUp" && e.key !== "Enter" && e.key !== "Escape" && e.stopPropagation();
|
|
1256
1255
|
}
|
|
1257
1256
|
})]
|
|
1258
|
-
}), t.loading ? /* @__PURE__ */ d(
|
|
1257
|
+
}), t.loading ? /* @__PURE__ */ d(Ae, { children: t.loadingText }) : t.searchable && t.items.length === 0 ? /* @__PURE__ */ d(q, { children: t.empty }) : t.entries.length ? t.entries.map((e) => e.type === "groupStart" ? /* @__PURE__ */ d(fe, {}, e.id) : e.type === "groupEnd" ? null : e.type === "label" ? /* @__PURE__ */ d(Oe, { ...e.props }, e.id) : e.type === "separator" ? /* @__PURE__ */ d(Ne, { ...e.props }, e.id) : e.type === "empty" ? /* @__PURE__ */ d(q, { children: e.props.children }, e.id) : e.type === "loading" ? /* @__PURE__ */ d(Ae, { children: e.props.children }, e.id) : e.type === "arrow" ? /* @__PURE__ */ d(ie, { ...e.props }, e.id) : /* @__PURE__ */ d(m, { children: /* @__PURE__ */ d(Se, {
|
|
1259
1258
|
item: e.item,
|
|
1260
1259
|
itemIndex: e.itemIndex
|
|
1261
|
-
}) }, e.item.id)) : /* @__PURE__ */ d(
|
|
1260
|
+
}) }, e.item.id)) : /* @__PURE__ */ d(q, {})]
|
|
1262
1261
|
});
|
|
1263
|
-
return t.portal ? /* @__PURE__ */ d(
|
|
1262
|
+
return t.portal ? /* @__PURE__ */ d(vt, { children: c }) : c;
|
|
1264
1263
|
};
|
|
1265
|
-
|
|
1264
|
+
o(yt, "content"), yt.displayName = "Dropdown.Content";
|
|
1266
1265
|
//#endregion
|
|
1267
1266
|
//#region src/components/Dropdown/ItemBadge/DropdownItemBadge.tsx
|
|
1268
1267
|
var bt = K("itemBadge", "Dropdown.ItemBadge"), xt = K("itemDescription", "Dropdown.ItemDescription"), St = K("itemIcon", "Dropdown.ItemIcon"), Ct = K("itemShortcut", "Dropdown.ItemShortcut"), wt = K("radioGroup", "Dropdown.RadioGroup"), Tt = K("radioItem", "Dropdown.RadioItem");
|
|
@@ -1290,35 +1289,35 @@ function Ot(e) {
|
|
|
1290
1289
|
return typeof e == "number" ? `${e}px` : e;
|
|
1291
1290
|
}
|
|
1292
1291
|
var kt = { wrapper: "_wrapper_14ue8_1" }, At = ({ children: e, open: t, defaultOpen: n = !1, onOpenChange: r, size: i = "md", color: a = "primary", placement: o = "bottom-start", strategy: s, offset: c = 2, collisionPadding: l = 8, matchTriggerWidth: u = !1, minWidth: p, maxWidth: m, portal: h = !0, avoidCollisions: g = !0, modal: _ = !1, closeOnSelect: v = !0, loop: b = !0, disabled: C = !1, loading: D = !1, loadingText: O = "Loading actions...", searchable: k = !1, command: A = !1, searchValue: j, defaultSearchValue: M = "", searchPlaceholder: N, onSearch: P, empty: F, className: I }) => {
|
|
1293
|
-
let L = S(), R = `${L}-trigger`, z = `${L}-menu`, B = T(null),
|
|
1292
|
+
let L = S(), R = `${L}-trigger`, z = `${L}-menu`, B = T(null), V = T(null), [ee, H] = E(), [U, te] = E({}), [ne, re] = E(M), ie = j ?? ne, G = w(() => ae(e), [e]), K = G.content?.props.command ?? !1, oe = k || A || K || !!G.search, se = w(() => Mt(G.items), [G.items]), ce = w(() => G.items.map((e) => ({
|
|
1294
1293
|
disabled: e.disabled,
|
|
1295
1294
|
label: e.label
|
|
1296
|
-
})), [G.items]),
|
|
1295
|
+
})), [G.items]), le = w(() => !oe || !ie.trim() ? G : Nt(G, ie), [
|
|
1297
1296
|
oe,
|
|
1298
1297
|
G,
|
|
1299
|
-
|
|
1300
|
-
]),
|
|
1298
|
+
ie
|
|
1299
|
+
]), ue = w(() => le.items.map((e) => ({
|
|
1301
1300
|
disabled: e.disabled,
|
|
1302
1301
|
label: e.label
|
|
1303
|
-
})), [
|
|
1302
|
+
})), [le.items]);
|
|
1304
1303
|
x(() => {
|
|
1305
|
-
|
|
1304
|
+
te((e) => {
|
|
1306
1305
|
let t = { ...e };
|
|
1307
1306
|
return se.forEach((e) => {
|
|
1308
1307
|
e.type === "radio" && t[e.groupId] === void 0 && (t[e.groupId] = e.groupProps?.value ?? e.groupProps?.defaultValue);
|
|
1309
1308
|
}), t;
|
|
1310
1309
|
});
|
|
1311
1310
|
}, [se]);
|
|
1312
|
-
let { activeIndex:
|
|
1313
|
-
items: oe ?
|
|
1311
|
+
let { activeIndex: de, setActiveIndex: q, isOpen: J, closeDropdown: fe, toggleDropdown: pe, onKeyDown: me } = ft({
|
|
1312
|
+
items: oe ? ue : ce,
|
|
1314
1313
|
open: t,
|
|
1315
1314
|
defaultOpen: n,
|
|
1316
1315
|
disabled: C,
|
|
1317
1316
|
onOpenChange: r,
|
|
1318
|
-
getItemValue: (e, t) => (oe ?
|
|
1317
|
+
getItemValue: (e, t) => (oe ? le.items : G.items)[t]?.id ?? "",
|
|
1319
1318
|
getItemText: (e) => e.label,
|
|
1320
1319
|
loop: b
|
|
1321
|
-
}), { floatingStyles: he, isMobileSheet:
|
|
1320
|
+
}), { floatingStyles: he, isMobileSheet: ve, isPositioned: ye, setRef: Y, setFloatingRef: be } = nt({
|
|
1322
1321
|
open: J,
|
|
1323
1322
|
placement: o,
|
|
1324
1323
|
strategy: s,
|
|
@@ -1328,132 +1327,132 @@ var kt = { wrapper: "_wrapper_14ue8_1" }, At = ({ children: e, open: t, defaultO
|
|
|
1328
1327
|
offset: c,
|
|
1329
1328
|
collisionPadding: l,
|
|
1330
1329
|
mobileSheetBreakpoint: 640
|
|
1331
|
-
}),
|
|
1332
|
-
j === void 0 &&
|
|
1330
|
+
}), xe = y((e) => {
|
|
1331
|
+
j === void 0 && re(e), P?.(e), q(0);
|
|
1333
1332
|
}, [
|
|
1334
1333
|
P,
|
|
1335
1334
|
j,
|
|
1336
|
-
|
|
1335
|
+
q
|
|
1337
1336
|
]);
|
|
1338
|
-
|
|
1337
|
+
ot({
|
|
1339
1338
|
active: J,
|
|
1340
1339
|
enabled: _
|
|
1341
1340
|
});
|
|
1342
|
-
let
|
|
1341
|
+
let Se = y(() => {
|
|
1343
1342
|
fe(), B.current?.focus();
|
|
1344
|
-
}, [fe]),
|
|
1343
|
+
}, [fe]), Ce = y((e, t) => {
|
|
1345
1344
|
if (e.disabled || D) return;
|
|
1346
1345
|
if (e.type === "subTrigger") {
|
|
1347
1346
|
H(e.id);
|
|
1348
1347
|
return;
|
|
1349
1348
|
}
|
|
1350
|
-
e.type === "item" && e.props.onSelect?.(t), e.type === "radio" && (
|
|
1349
|
+
e.type === "item" && e.props.onSelect?.(t), e.type === "radio" && (te((t) => ({
|
|
1351
1350
|
...t,
|
|
1352
1351
|
[e.groupId]: e.props.value
|
|
1353
1352
|
})), e.groupProps?.onValueChange?.(e.props.value));
|
|
1354
1353
|
let n = e.props.closeOnSelect ?? (e.type !== "checkbox" && v);
|
|
1355
|
-
!t.defaultPrevented && n &&
|
|
1354
|
+
!t.defaultPrevented && n && Se();
|
|
1356
1355
|
}, [
|
|
1357
|
-
|
|
1356
|
+
Se,
|
|
1358
1357
|
v,
|
|
1359
1358
|
D
|
|
1360
|
-
]),
|
|
1361
|
-
let t =
|
|
1359
|
+
]), we = y((e) => {
|
|
1360
|
+
let t = le.items[de];
|
|
1362
1361
|
if (e.key === "ArrowRight" && t?.type === "subTrigger") {
|
|
1363
1362
|
e.preventDefault(), H(t.id);
|
|
1364
1363
|
return;
|
|
1365
1364
|
}
|
|
1366
|
-
if (e.key === "ArrowLeft" &&
|
|
1365
|
+
if (e.key === "ArrowLeft" && ee) {
|
|
1367
1366
|
e.preventDefault(), H(void 0);
|
|
1368
1367
|
return;
|
|
1369
1368
|
}
|
|
1370
1369
|
if ((e.key === "Enter" || e.key === " ") && t) {
|
|
1371
1370
|
e.preventDefault();
|
|
1372
1371
|
let n = jt(e);
|
|
1373
|
-
|
|
1372
|
+
Ce(t, n);
|
|
1374
1373
|
return;
|
|
1375
1374
|
}
|
|
1376
1375
|
me(e), e.key === "Escape" && B.current?.focus();
|
|
1377
1376
|
}, [
|
|
1378
|
-
|
|
1379
|
-
|
|
1377
|
+
de,
|
|
1378
|
+
le.items,
|
|
1380
1379
|
me,
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
]),
|
|
1380
|
+
ee,
|
|
1381
|
+
Ce
|
|
1382
|
+
]), Te = y((e) => {
|
|
1384
1383
|
e.preventDefault(), pe();
|
|
1385
|
-
}, [pe]),
|
|
1386
|
-
B.current = e,
|
|
1387
|
-
}, [
|
|
1388
|
-
|
|
1389
|
-
}, [
|
|
1384
|
+
}, [pe]), Ee = y((e) => {
|
|
1385
|
+
B.current = e, Y(e);
|
|
1386
|
+
}, [Y]), De = y((e) => {
|
|
1387
|
+
V.current = e, be(e), ve && e?.focus({ preventScroll: !0 });
|
|
1388
|
+
}, [ve, be]), Oe = tt({
|
|
1390
1389
|
active: J,
|
|
1391
1390
|
id: z,
|
|
1392
1391
|
zIndexLevel: "dropdown",
|
|
1393
1392
|
closeOnEscape: !0,
|
|
1394
1393
|
closeOnOutsidePress: !0,
|
|
1395
|
-
contentRef:
|
|
1394
|
+
contentRef: V,
|
|
1396
1395
|
ignoreRefs: [B],
|
|
1397
1396
|
requestClose: () => fe()
|
|
1398
|
-
}),
|
|
1397
|
+
}), ke = {
|
|
1399
1398
|
...he,
|
|
1400
|
-
zIndex:
|
|
1399
|
+
zIndex: Oe.zIndex,
|
|
1401
1400
|
minWidth: Ot(p),
|
|
1402
1401
|
maxWidth: Ot(m)
|
|
1403
|
-
},
|
|
1402
|
+
}, Ae = {
|
|
1404
1403
|
disabled: C,
|
|
1405
1404
|
isOpen: J,
|
|
1406
1405
|
contentId: z,
|
|
1407
1406
|
triggerId: R,
|
|
1408
|
-
setTriggerRef:
|
|
1409
|
-
onClick:
|
|
1410
|
-
onKeyDown:
|
|
1411
|
-
},
|
|
1412
|
-
activeIndex:
|
|
1407
|
+
setTriggerRef: Ee,
|
|
1408
|
+
onClick: Te,
|
|
1409
|
+
onKeyDown: we
|
|
1410
|
+
}, je = {
|
|
1411
|
+
activeIndex: de,
|
|
1413
1412
|
closeOnSelect: v,
|
|
1414
1413
|
color: a,
|
|
1415
|
-
contentReadyToFocus:
|
|
1414
|
+
contentReadyToFocus: ve || ye,
|
|
1416
1415
|
contentId: z,
|
|
1417
1416
|
contentProps: G.content?.props,
|
|
1418
1417
|
disabled: C,
|
|
1419
|
-
entries:
|
|
1418
|
+
entries: le.entries,
|
|
1420
1419
|
getItemId: (e) => `${z}-item-${e}`,
|
|
1421
1420
|
isOpen: J,
|
|
1422
|
-
items:
|
|
1421
|
+
items: le.items,
|
|
1423
1422
|
loading: D,
|
|
1424
1423
|
loadingText: O,
|
|
1425
1424
|
empty: F,
|
|
1426
1425
|
maxWidth: m,
|
|
1427
1426
|
minWidth: p,
|
|
1428
|
-
openSubId:
|
|
1429
|
-
onKeyDown:
|
|
1427
|
+
openSubId: ee,
|
|
1428
|
+
onKeyDown: we,
|
|
1430
1429
|
portal: !G.portal && h,
|
|
1431
|
-
radioValues:
|
|
1430
|
+
radioValues: U,
|
|
1432
1431
|
searchPlaceholder: G.search?.props.placeholder ?? N ?? (A || K ? "Type a command..." : "Search actions..."),
|
|
1433
1432
|
searchProps: G.search?.props,
|
|
1434
|
-
searchValue:
|
|
1433
|
+
searchValue: ie,
|
|
1435
1434
|
searchable: oe,
|
|
1436
|
-
selectItem:
|
|
1437
|
-
setActiveIndex:
|
|
1438
|
-
setContentRef:
|
|
1435
|
+
selectItem: Ce,
|
|
1436
|
+
setActiveIndex: q,
|
|
1437
|
+
setContentRef: De,
|
|
1439
1438
|
setOpenSubId: H,
|
|
1440
1439
|
setRadioValue: (e, t) => {
|
|
1441
|
-
|
|
1440
|
+
te((n) => ({
|
|
1442
1441
|
...n,
|
|
1443
1442
|
[e]: t
|
|
1444
1443
|
}));
|
|
1445
1444
|
},
|
|
1446
|
-
setSearchValue:
|
|
1445
|
+
setSearchValue: xe,
|
|
1447
1446
|
size: i,
|
|
1448
|
-
surfaceStyle:
|
|
1447
|
+
surfaceStyle: ke,
|
|
1449
1448
|
triggerId: R
|
|
1450
1449
|
};
|
|
1451
|
-
return /* @__PURE__ */ d(
|
|
1452
|
-
value:
|
|
1453
|
-
children: /* @__PURE__ */ d(
|
|
1454
|
-
value:
|
|
1450
|
+
return /* @__PURE__ */ d(_e, {
|
|
1451
|
+
value: Ae,
|
|
1452
|
+
children: /* @__PURE__ */ d(ge, {
|
|
1453
|
+
value: je,
|
|
1455
1454
|
children: /* @__PURE__ */ f("div", {
|
|
1456
|
-
className:
|
|
1455
|
+
className: W(kt.wrapper, I),
|
|
1457
1456
|
"data-disabled": C || void 0,
|
|
1458
1457
|
children: [G.trigger ?? null, G.portal ?? G.content ?? /* @__PURE__ */ d(yt, {})]
|
|
1459
1458
|
})
|
|
@@ -1506,16 +1505,16 @@ var Pt = K("search", "Dropdown.Search"), Ft = K("subContent", "Dropdown.SubConte
|
|
|
1506
1505
|
label: "_label_bb3ib_362",
|
|
1507
1506
|
open: "_open_bb3ib_390"
|
|
1508
1507
|
}, zt = (e) => /* @__PURE__ */ d(Bt, { ...e });
|
|
1509
|
-
|
|
1508
|
+
o(zt, "trigger"), zt.displayName = "Dropdown.Trigger";
|
|
1510
1509
|
var Bt = ({ children: e, asChild: t = !1, disabled: n, className: r }) => {
|
|
1511
|
-
let i =
|
|
1510
|
+
let i = ve(), a = ye(), o = t && v(e) ? e : void 0, s = i.disabled || n, c = {
|
|
1512
1511
|
id: a.triggerId,
|
|
1513
1512
|
ref: o ? Dt(o.props.ref, a.setTriggerRef) : a.setTriggerRef,
|
|
1514
1513
|
"aria-controls": a.isOpen ? a.contentId : void 0,
|
|
1515
1514
|
"aria-disabled": s || void 0,
|
|
1516
1515
|
"aria-expanded": a.isOpen,
|
|
1517
1516
|
"aria-haspopup": "menu",
|
|
1518
|
-
className:
|
|
1517
|
+
className: W(!o && Rt.button, !o && Rt[i.size], !o && Rt[i.color], r),
|
|
1519
1518
|
"data-state": a.isOpen ? "open" : "closed",
|
|
1520
1519
|
disabled: s || void 0,
|
|
1521
1520
|
onClick: Et(o?.props.onClick, a.onClick),
|
|
@@ -1523,7 +1522,7 @@ var Bt = ({ children: e, asChild: t = !1, disabled: n, className: r }) => {
|
|
|
1523
1522
|
};
|
|
1524
1523
|
return o ? h(o, {
|
|
1525
1524
|
...c,
|
|
1526
|
-
className:
|
|
1525
|
+
className: W(o.props.className, r)
|
|
1527
1526
|
}) : /* @__PURE__ */ f("button", {
|
|
1528
1527
|
type: "button",
|
|
1529
1528
|
...c,
|
|
@@ -1531,9 +1530,9 @@ var Bt = ({ children: e, asChild: t = !1, disabled: n, className: r }) => {
|
|
|
1531
1530
|
className: Rt.label,
|
|
1532
1531
|
children: e
|
|
1533
1532
|
}), /* @__PURE__ */ d("span", {
|
|
1534
|
-
className:
|
|
1533
|
+
className: W(Rt.arrow, { [Rt.open]: a.isOpen }),
|
|
1535
1534
|
"aria-hidden": "true",
|
|
1536
|
-
children: /* @__PURE__ */ d(
|
|
1535
|
+
children: /* @__PURE__ */ d(k, {})
|
|
1537
1536
|
})]
|
|
1538
1537
|
});
|
|
1539
1538
|
};
|
|
@@ -1544,13 +1543,13 @@ var Vt = Object.assign(At, {
|
|
|
1544
1543
|
Trigger: zt,
|
|
1545
1544
|
Content: yt,
|
|
1546
1545
|
Search: Pt,
|
|
1547
|
-
Item:
|
|
1548
|
-
CheckboxItem:
|
|
1546
|
+
Item: xe,
|
|
1547
|
+
CheckboxItem: le,
|
|
1549
1548
|
RadioGroup: wt,
|
|
1550
1549
|
RadioItem: Tt,
|
|
1551
|
-
Group:
|
|
1552
|
-
Label:
|
|
1553
|
-
Separator:
|
|
1550
|
+
Group: J,
|
|
1551
|
+
Label: De,
|
|
1552
|
+
Separator: Me,
|
|
1554
1553
|
Sub: Lt,
|
|
1555
1554
|
SubTrigger: It,
|
|
1556
1555
|
SubContent: Ft,
|
|
@@ -1558,9 +1557,9 @@ var Vt = Object.assign(At, {
|
|
|
1558
1557
|
ItemDescription: xt,
|
|
1559
1558
|
ItemBadge: bt,
|
|
1560
1559
|
ItemShortcut: Ct,
|
|
1561
|
-
Arrow:
|
|
1562
|
-
Empty:
|
|
1563
|
-
Loading:
|
|
1560
|
+
Arrow: ie,
|
|
1561
|
+
Empty: de,
|
|
1562
|
+
Loading: ke
|
|
1564
1563
|
});
|
|
1565
1564
|
Vt.displayName = "Dropdown";
|
|
1566
1565
|
//#endregion
|
|
@@ -1577,7 +1576,7 @@ var Jt = {
|
|
|
1577
1576
|
}, Yt = ({ children: e, className: t }) => {
|
|
1578
1577
|
let n = Gt();
|
|
1579
1578
|
return /* @__PURE__ */ d("div", {
|
|
1580
|
-
className:
|
|
1579
|
+
className: W(Jt.modalBody, n?.scrollBehavior === "inside" && Jt.inside, t),
|
|
1581
1580
|
children: e
|
|
1582
1581
|
});
|
|
1583
1582
|
};
|
|
@@ -1611,17 +1610,17 @@ var Qt = {
|
|
|
1611
1610
|
}, $t = ({ asChild: e = !1, children: t, className: n, "aria-label": r }) => {
|
|
1612
1611
|
let i = Wt(), a = e && v(t) ? t : void 0, o = {
|
|
1613
1612
|
"aria-label": a ? r : r ?? "Close dialog",
|
|
1614
|
-
className:
|
|
1613
|
+
className: W(!a && Qt.modalHeaderCloseButton, n),
|
|
1615
1614
|
onClick: Xt(a?.props.onClick, i.requestClose)
|
|
1616
1615
|
};
|
|
1617
1616
|
return a ? h(a, {
|
|
1618
1617
|
...o,
|
|
1619
|
-
className:
|
|
1618
|
+
className: W(a.props.className, n),
|
|
1620
1619
|
"aria-label": r ?? a.props["aria-label"]
|
|
1621
1620
|
}) : /* @__PURE__ */ d("button", {
|
|
1622
1621
|
type: "button",
|
|
1623
1622
|
...o,
|
|
1624
|
-
children: /* @__PURE__ */ d(
|
|
1623
|
+
children: /* @__PURE__ */ d(j, { size: 16 })
|
|
1625
1624
|
});
|
|
1626
1625
|
};
|
|
1627
1626
|
$t.displayName = "Modal.Close";
|
|
@@ -1643,7 +1642,7 @@ var en = {
|
|
|
1643
1642
|
let f = Wt(), p = f.open, m = p && f.shouldRender, [h, g] = E(null), _ = y((e) => {
|
|
1644
1643
|
f.setContentRef(e), g(e);
|
|
1645
1644
|
}, [f]);
|
|
1646
|
-
if (
|
|
1645
|
+
if (Ve({
|
|
1647
1646
|
active: m,
|
|
1648
1647
|
contentRef: f.contentRef,
|
|
1649
1648
|
enabled: f.trapFocus,
|
|
@@ -1652,7 +1651,7 @@ var en = {
|
|
|
1652
1651
|
onCloseAutoFocus: f.onCloseAutoFocus,
|
|
1653
1652
|
onOpenAutoFocus: f.onOpenAutoFocus,
|
|
1654
1653
|
restoreFocus: f.restoreFocus
|
|
1655
|
-
}),
|
|
1654
|
+
}), Pe({
|
|
1656
1655
|
active: p,
|
|
1657
1656
|
content: h,
|
|
1658
1657
|
enabled: f.modal
|
|
@@ -1664,7 +1663,7 @@ var en = {
|
|
|
1664
1663
|
id: f.contentId,
|
|
1665
1664
|
ref: Zt(_),
|
|
1666
1665
|
tabIndex: -1,
|
|
1667
|
-
className:
|
|
1666
|
+
className: W(en.content, en[t], en[n], en[r], i && en.animated, l),
|
|
1668
1667
|
style: {
|
|
1669
1668
|
...f.animationStyle,
|
|
1670
1669
|
...u
|
|
@@ -1682,7 +1681,7 @@ var en = {
|
|
|
1682
1681
|
};
|
|
1683
1682
|
tn.displayName = "ModalContent";
|
|
1684
1683
|
var nn = { modalFooter: "_modalFooter_sb1pn_1" }, rn = ({ children: e, className: t }) => /* @__PURE__ */ d("div", {
|
|
1685
|
-
className:
|
|
1684
|
+
className: W(nn.modalFooter, t),
|
|
1686
1685
|
children: e
|
|
1687
1686
|
});
|
|
1688
1687
|
rn.displayName = "ModalFooter";
|
|
@@ -1700,7 +1699,7 @@ an.displayName = "Modal.Description";
|
|
|
1700
1699
|
//#endregion
|
|
1701
1700
|
//#region src/components/Modal/Header/ModalHeader.tsx
|
|
1702
1701
|
var on = ({ children: e, className: t }) => /* @__PURE__ */ d("div", {
|
|
1703
|
-
className:
|
|
1702
|
+
className: W(Qt.modalHeader, t),
|
|
1704
1703
|
children: e
|
|
1705
1704
|
});
|
|
1706
1705
|
on.displayName = "ModalHeader";
|
|
@@ -1724,7 +1723,7 @@ var cn = {
|
|
|
1724
1723
|
}, ln = ({ className: e, animated: t = !0, forceMount: n = !1 }) => {
|
|
1725
1724
|
let { animation: r, animationStyle: i, open: a, shouldRender: o } = Wt();
|
|
1726
1725
|
return !o && !n ? null : /* @__PURE__ */ d("div", {
|
|
1727
|
-
className:
|
|
1726
|
+
className: W(cn.overlay, a && cn["overlay--open"], t && cn["overlay--animated"], e),
|
|
1728
1727
|
style: i,
|
|
1729
1728
|
"data-state": a ? "open" : "closed",
|
|
1730
1729
|
"data-animation": r,
|
|
@@ -1734,7 +1733,7 @@ var cn = {
|
|
|
1734
1733
|
ln.displayName = "ModalOverlay";
|
|
1735
1734
|
//#endregion
|
|
1736
1735
|
//#region src/components/Modal/internal/useModalDismiss.ts
|
|
1737
|
-
var un = ({ active: e, registrationActive: t = e, id: n, contentRef: r, closeOnEscape: i, closeOnOutsidePress: a, onEscapeKeyDown: o, onPointerDownOutside: s, onInteractOutside: c, requestClose: l }) =>
|
|
1736
|
+
var un = ({ active: e, registrationActive: t = e, id: n, contentRef: r, closeOnEscape: i, closeOnOutsidePress: a, onEscapeKeyDown: o, onPointerDownOutside: s, onInteractOutside: c, requestClose: l }) => tt({
|
|
1738
1737
|
active: e,
|
|
1739
1738
|
registrationActive: t,
|
|
1740
1739
|
id: n,
|
|
@@ -1747,7 +1746,7 @@ var un = ({ active: e, registrationActive: t = e, id: n, contentRef: r, closeOnE
|
|
|
1747
1746
|
onPointerDownOutside: s ? (e) => s(e) : void 0,
|
|
1748
1747
|
requestClose: l
|
|
1749
1748
|
}), dn = {
|
|
1750
|
-
standard:
|
|
1749
|
+
standard: ne.components.modal.motion.easing,
|
|
1751
1750
|
linear: "linear",
|
|
1752
1751
|
ease: "ease",
|
|
1753
1752
|
"ease-in": "ease-in",
|
|
@@ -1757,42 +1756,42 @@ var un = ({ active: e, registrationActive: t = e, id: n, contentRef: r, closeOnE
|
|
|
1757
1756
|
close: e,
|
|
1758
1757
|
open: e
|
|
1759
1758
|
} : {
|
|
1760
|
-
close: e?.close ?? fn(
|
|
1761
|
-
open: e?.open ?? fn(
|
|
1759
|
+
close: e?.close ?? fn(ne.components.modal.motion.closeDuration),
|
|
1760
|
+
open: e?.open ?? fn(ne.components.modal.motion.openDuration)
|
|
1762
1761
|
}, mn = ({ open: e, defaultOpen: t = !1, onOpenChange: n, animation: r = "scale", duration: i, easing: a = "standard", modal: o = !0, closeOnEscape: s = !0, closeOnOutsidePress: c = !0, preventScroll: l = !0, restoreFocus: u = !0, trapFocus: d = !0, initialFocus: f, finalFocus: p, onOpenAutoFocus: m, onCloseAutoFocus: h, onEscapeKeyDown: g, onPointerDownOutside: _, onInteractOutside: v, role: b = "dialog" }) => {
|
|
1763
|
-
let S = T(null), { contentId: C, descriptionId: D, open: O, requestClose: k, setOpen: A, titleId: j } =
|
|
1762
|
+
let S = T(null), { contentId: C, descriptionId: D, open: O, requestClose: k, setOpen: A, titleId: j } = pt({
|
|
1764
1763
|
open: e,
|
|
1765
1764
|
defaultOpen: t,
|
|
1766
1765
|
onOpenChange: n,
|
|
1767
1766
|
closeOnEscape: s,
|
|
1768
1767
|
closeOnOutsidePress: c
|
|
1769
|
-
}), [M, N] = E(!1), [P, F] = E(!1), [I, L] = E(0), R = pn(i), z = r === "none" ? 0 : R.close, [B,
|
|
1768
|
+
}), [M, N] = E(!1), [P, F] = E(!1), [I, L] = E(0), R = pn(i), z = r === "none" ? 0 : R.close, [B, V] = E(O);
|
|
1770
1769
|
x(() => {
|
|
1771
1770
|
if (O) {
|
|
1772
|
-
|
|
1771
|
+
V(!0);
|
|
1773
1772
|
return;
|
|
1774
1773
|
}
|
|
1775
1774
|
if (z === 0) {
|
|
1776
|
-
|
|
1775
|
+
V(!1);
|
|
1777
1776
|
return;
|
|
1778
1777
|
}
|
|
1779
1778
|
let e = window.setTimeout(() => {
|
|
1780
|
-
|
|
1779
|
+
V(!1);
|
|
1781
1780
|
}, z);
|
|
1782
1781
|
return () => {
|
|
1783
1782
|
window.clearTimeout(e);
|
|
1784
1783
|
};
|
|
1785
1784
|
}, [z, O]);
|
|
1786
|
-
let
|
|
1785
|
+
let ee = y(() => {
|
|
1787
1786
|
k();
|
|
1788
1787
|
}, [k]), H = y((e) => {
|
|
1789
1788
|
S.current !== e && (S.current = e, L((e) => e + 1));
|
|
1790
1789
|
}, []);
|
|
1791
|
-
|
|
1790
|
+
ot({
|
|
1792
1791
|
active: O,
|
|
1793
1792
|
enabled: l
|
|
1794
1793
|
});
|
|
1795
|
-
let
|
|
1794
|
+
let U = un({
|
|
1796
1795
|
active: O,
|
|
1797
1796
|
registrationActive: B,
|
|
1798
1797
|
id: C,
|
|
@@ -1802,21 +1801,21 @@ var un = ({ active: e, registrationActive: t = e, id: n, contentRef: r, closeOnE
|
|
|
1802
1801
|
onEscapeKeyDown: g,
|
|
1803
1802
|
onInteractOutside: v,
|
|
1804
1803
|
onPointerDownOutside: _,
|
|
1805
|
-
requestClose:
|
|
1806
|
-
}),
|
|
1804
|
+
requestClose: ee
|
|
1805
|
+
}), te = w(() => ({
|
|
1807
1806
|
"--modal-animation-close-duration": `${R.close}ms`,
|
|
1808
1807
|
"--modal-animation-easing": dn[a],
|
|
1809
1808
|
"--modal-animation-open-duration": `${R.open}ms`,
|
|
1810
|
-
"--z-index-modal":
|
|
1809
|
+
"--z-index-modal": U.zIndex === void 0 ? void 0 : `${U.zIndex}`
|
|
1811
1810
|
}), [
|
|
1812
1811
|
R.close,
|
|
1813
1812
|
R.open,
|
|
1814
1813
|
a,
|
|
1815
|
-
|
|
1816
|
-
]),
|
|
1814
|
+
U.zIndex
|
|
1815
|
+
]), ne = nt({
|
|
1817
1816
|
presentation: "modal",
|
|
1818
|
-
animationStyle:
|
|
1819
|
-
}).animationStyle ??
|
|
1817
|
+
animationStyle: te
|
|
1818
|
+
}).animationStyle ?? te;
|
|
1820
1819
|
return x(() => {
|
|
1821
1820
|
if (process.env.NODE_ENV === "production" || !O || M || !S.current) return;
|
|
1822
1821
|
let e = window.setTimeout(() => {
|
|
@@ -1839,7 +1838,7 @@ var un = ({ active: e, registrationActive: t = e, id: n, contentRef: r, closeOnE
|
|
|
1839
1838
|
]), {
|
|
1840
1839
|
context: w(() => ({
|
|
1841
1840
|
animation: r,
|
|
1842
|
-
animationStyle:
|
|
1841
|
+
animationStyle: ne,
|
|
1843
1842
|
closeOnEscape: s,
|
|
1844
1843
|
closeOnOutsidePress: c,
|
|
1845
1844
|
contentId: C,
|
|
@@ -1847,7 +1846,7 @@ var un = ({ active: e, registrationActive: t = e, id: n, contentRef: r, closeOnE
|
|
|
1847
1846
|
descriptionId: D,
|
|
1848
1847
|
finalFocus: p,
|
|
1849
1848
|
initialFocus: f,
|
|
1850
|
-
zIndex:
|
|
1849
|
+
zIndex: U.zIndex,
|
|
1851
1850
|
modal: o,
|
|
1852
1851
|
onCloseAutoFocus: h,
|
|
1853
1852
|
onEscapeKeyDown: g,
|
|
@@ -1856,7 +1855,7 @@ var un = ({ active: e, registrationActive: t = e, id: n, contentRef: r, closeOnE
|
|
|
1856
1855
|
onPointerDownOutside: _,
|
|
1857
1856
|
open: O,
|
|
1858
1857
|
preventScroll: l,
|
|
1859
|
-
requestClose:
|
|
1858
|
+
requestClose: ee,
|
|
1860
1859
|
restoreFocus: u,
|
|
1861
1860
|
role: b,
|
|
1862
1861
|
setContentRef: H,
|
|
@@ -1868,14 +1867,14 @@ var un = ({ active: e, registrationActive: t = e, id: n, contentRef: r, closeOnE
|
|
|
1868
1867
|
trapFocus: d
|
|
1869
1868
|
}), [
|
|
1870
1869
|
r,
|
|
1871
|
-
|
|
1870
|
+
ne,
|
|
1872
1871
|
s,
|
|
1873
1872
|
c,
|
|
1874
1873
|
C,
|
|
1875
1874
|
D,
|
|
1876
1875
|
p,
|
|
1877
1876
|
f,
|
|
1878
|
-
|
|
1877
|
+
U.zIndex,
|
|
1879
1878
|
O,
|
|
1880
1879
|
o,
|
|
1881
1880
|
h,
|
|
@@ -1884,7 +1883,7 @@ var un = ({ active: e, registrationActive: t = e, id: n, contentRef: r, closeOnE
|
|
|
1884
1883
|
m,
|
|
1885
1884
|
_,
|
|
1886
1885
|
l,
|
|
1887
|
-
|
|
1886
|
+
ee,
|
|
1888
1887
|
u,
|
|
1889
1888
|
b,
|
|
1890
1889
|
H,
|
|
@@ -1900,7 +1899,7 @@ var un = ({ active: e, registrationActive: t = e, id: n, contentRef: r, closeOnE
|
|
|
1900
1899
|
return /* @__PURE__ */ d(Kt, {
|
|
1901
1900
|
value: r,
|
|
1902
1901
|
children: /* @__PURE__ */ d("div", {
|
|
1903
|
-
className:
|
|
1902
|
+
className: W(t),
|
|
1904
1903
|
"data-state": i ? "open" : "closed",
|
|
1905
1904
|
children: e
|
|
1906
1905
|
})
|
|
@@ -1915,7 +1914,7 @@ var gn = ({ children: e, asChild: t = !1, disabled: n = !1, className: r }) => {
|
|
|
1915
1914
|
"aria-disabled": o || void 0,
|
|
1916
1915
|
"aria-expanded": i.open,
|
|
1917
1916
|
"aria-haspopup": "dialog",
|
|
1918
|
-
className:
|
|
1917
|
+
className: W(r),
|
|
1919
1918
|
"data-state": i.open ? "open" : "closed",
|
|
1920
1919
|
disabled: o || void 0,
|
|
1921
1920
|
onClick: Xt(a?.props.onClick, () => {
|
|
@@ -1925,7 +1924,7 @@ var gn = ({ children: e, asChild: t = !1, disabled: n = !1, className: r }) => {
|
|
|
1925
1924
|
return a ? h(a, {
|
|
1926
1925
|
...s,
|
|
1927
1926
|
ref: Zt(a.props.ref),
|
|
1928
|
-
className:
|
|
1927
|
+
className: W(a.props.className, r)
|
|
1929
1928
|
}) : /* @__PURE__ */ d("button", {
|
|
1930
1929
|
type: "button",
|
|
1931
1930
|
...s,
|
|
@@ -1977,7 +1976,7 @@ function Sn({ children: e, asChild: t = !1, className: n, ...r }) {
|
|
|
1977
1976
|
ref: (e) => {
|
|
1978
1977
|
xn(a.props.ref, e), i(e);
|
|
1979
1978
|
},
|
|
1980
|
-
className:
|
|
1979
|
+
className: W(a.props.className, n)
|
|
1981
1980
|
}) : /* @__PURE__ */ d("div", {
|
|
1982
1981
|
...r,
|
|
1983
1982
|
ref: i,
|
|
@@ -1993,7 +1992,7 @@ var Cn = { arrow: "_arrow_6lbs0_1" }, wn = {
|
|
|
1993
1992
|
};
|
|
1994
1993
|
function Tn({ width: e = 14, height: t = 7, tipRadius: n = 1, align: r = "center", offset: i, className: a, ...o }) {
|
|
1995
1994
|
let { arrowRef: s, floatingContext: c, placement: l } = bn("Popover.Arrow"), u = i ?? wn[r], f = l.split("-")[0];
|
|
1996
|
-
return /* @__PURE__ */ d(
|
|
1995
|
+
return /* @__PURE__ */ d(P, {
|
|
1997
1996
|
...o,
|
|
1998
1997
|
ref: s,
|
|
1999
1998
|
context: c,
|
|
@@ -2005,7 +2004,7 @@ function Tn({ width: e = 14, height: t = 7, tipRadius: n = 1, align: r = "center
|
|
|
2005
2004
|
stroke: "var(--border-muted)",
|
|
2006
2005
|
strokeWidth: 1,
|
|
2007
2006
|
"data-side": f,
|
|
2008
|
-
className:
|
|
2007
|
+
className: W(Cn.arrow, a)
|
|
2009
2008
|
});
|
|
2010
2009
|
}
|
|
2011
2010
|
Tn.displayName = "Popover.Arrow";
|
|
@@ -2025,7 +2024,7 @@ function En({ children: e, asChild: t = !1, className: n, disabled: r, onClick:
|
|
|
2025
2024
|
};
|
|
2026
2025
|
return s ? h(s, {
|
|
2027
2026
|
...u,
|
|
2028
|
-
className:
|
|
2027
|
+
className: W(s.props.className, n)
|
|
2029
2028
|
}) : /* @__PURE__ */ d("button", {
|
|
2030
2029
|
type: "button",
|
|
2031
2030
|
...u,
|
|
@@ -2046,7 +2045,7 @@ function On({ children: e, asChild: t = !1, className: n, style: r, initialFocus
|
|
|
2046
2045
|
reason: e,
|
|
2047
2046
|
event: t
|
|
2048
2047
|
});
|
|
2049
|
-
}, [A]), F =
|
|
2048
|
+
}, [A]), F = tt({
|
|
2050
2049
|
active: g,
|
|
2051
2050
|
id: w,
|
|
2052
2051
|
zIndexLevel: "popover",
|
|
@@ -2059,7 +2058,7 @@ function On({ children: e, asChild: t = !1, className: n, style: r, initialFocus
|
|
|
2059
2058
|
onInteractOutside: u,
|
|
2060
2059
|
requestClose: P
|
|
2061
2060
|
});
|
|
2062
|
-
|
|
2061
|
+
Ve({
|
|
2063
2062
|
active: g,
|
|
2064
2063
|
contentRef: C,
|
|
2065
2064
|
enabled: _,
|
|
@@ -2074,10 +2073,10 @@ function On({ children: e, asChild: t = !1, className: n, style: r, initialFocus
|
|
|
2074
2073
|
f
|
|
2075
2074
|
]),
|
|
2076
2075
|
onCloseAutoFocus: p
|
|
2077
|
-
}),
|
|
2076
|
+
}), ot({
|
|
2078
2077
|
active: g,
|
|
2079
2078
|
enabled: _
|
|
2080
|
-
}),
|
|
2079
|
+
}), Pe({
|
|
2081
2080
|
active: g,
|
|
2082
2081
|
enabled: _,
|
|
2083
2082
|
content: M
|
|
@@ -2095,7 +2094,7 @@ function On({ children: e, asChild: t = !1, className: n, style: r, initialFocus
|
|
|
2095
2094
|
"aria-describedby": D,
|
|
2096
2095
|
"data-state": "open",
|
|
2097
2096
|
"data-side": L,
|
|
2098
|
-
className:
|
|
2097
|
+
className: W(Dn.content, n),
|
|
2099
2098
|
style: {
|
|
2100
2099
|
...k,
|
|
2101
2100
|
zIndex: F.zIndex,
|
|
@@ -2104,7 +2103,7 @@ function On({ children: e, asChild: t = !1, className: n, style: r, initialFocus
|
|
|
2104
2103
|
}, z = t && v(e) ? e : void 0, B = z ? h(z, {
|
|
2105
2104
|
...R,
|
|
2106
2105
|
ref: I,
|
|
2107
|
-
className:
|
|
2106
|
+
className: W(z.props.className, Dn.content, n),
|
|
2108
2107
|
style: {
|
|
2109
2108
|
...k,
|
|
2110
2109
|
zIndex: F.zIndex,
|
|
@@ -2116,7 +2115,7 @@ function On({ children: e, asChild: t = !1, className: n, style: r, initialFocus
|
|
|
2116
2115
|
...R,
|
|
2117
2116
|
children: e
|
|
2118
2117
|
});
|
|
2119
|
-
return b ? /* @__PURE__ */ d(
|
|
2118
|
+
return b ? /* @__PURE__ */ d(vt, { children: B }) : B;
|
|
2120
2119
|
}
|
|
2121
2120
|
On.displayName = "Popover.Content";
|
|
2122
2121
|
var kn = { description: "_description_hji8o_1" };
|
|
@@ -2127,11 +2126,11 @@ function An({ children: e, asChild: t = !1, className: n, ...r }) {
|
|
|
2127
2126
|
return a ? h(a, {
|
|
2128
2127
|
...r,
|
|
2129
2128
|
id: i,
|
|
2130
|
-
className:
|
|
2129
|
+
className: W(a.props.className, kn.description, n)
|
|
2131
2130
|
}) : /* @__PURE__ */ d("p", {
|
|
2132
2131
|
...r,
|
|
2133
2132
|
id: i,
|
|
2134
|
-
className:
|
|
2133
|
+
className: W(kn.description, n),
|
|
2135
2134
|
children: e
|
|
2136
2135
|
});
|
|
2137
2136
|
}
|
|
@@ -2142,7 +2141,7 @@ function jn(e, t) {
|
|
|
2142
2141
|
return t === "center" ? e : `${e}-${t}`;
|
|
2143
2142
|
}
|
|
2144
2143
|
function Mn({ children: e, open: t, defaultOpen: n = !1, modal: r = !1, onOpenChange: i, side: a = "bottom", align: o = "center", sideOffset: s = 8, collisionPadding: c = 8, avoidCollisions: l = !0, portal: u = !0, strategy: f }) {
|
|
2145
|
-
let p = T(null), m = T(null), h = T(null), g = T({ reason: "programmatic" }), _ = S(), v = `vellira-popover-trigger-${_}`, b = `vellira-popover-content-${_}`, x = `vellira-popover-title-${_}`, C = `vellira-popover-description-${_}`, [E, D] =
|
|
2144
|
+
let p = T(null), m = T(null), h = T(null), g = T({ reason: "programmatic" }), _ = S(), v = `vellira-popover-trigger-${_}`, b = `vellira-popover-content-${_}`, x = `vellira-popover-title-${_}`, C = `vellira-popover-description-${_}`, [E, D] = ut({
|
|
2146
2145
|
value: t,
|
|
2147
2146
|
defaultValue: n,
|
|
2148
2147
|
onChange: (e) => {
|
|
@@ -2150,10 +2149,10 @@ function Mn({ children: e, open: t, defaultOpen: n = !1, modal: r = !1, onOpenCh
|
|
|
2150
2149
|
}
|
|
2151
2150
|
}), O = y((e, t) => {
|
|
2152
2151
|
g.current = t, D(e);
|
|
2153
|
-
}, [D]), k = T(null),
|
|
2152
|
+
}, [D]), k = T(null), A = w(() => [F({
|
|
2154
2153
|
element: k,
|
|
2155
2154
|
padding: 8
|
|
2156
|
-
})], []), { context:
|
|
2155
|
+
})], []), { context: j, floatingStyles: M, isPositioned: N, placement: P, setFloatingRef: I, setRef: L } = nt({
|
|
2157
2156
|
open: E,
|
|
2158
2157
|
placement: jn(a, o),
|
|
2159
2158
|
strategy: f,
|
|
@@ -2161,7 +2160,7 @@ function Mn({ children: e, open: t, defaultOpen: n = !1, modal: r = !1, onOpenCh
|
|
|
2161
2160
|
offset: s + 7,
|
|
2162
2161
|
collisionPadding: c,
|
|
2163
2162
|
avoidCollisions: l,
|
|
2164
|
-
middleware:
|
|
2163
|
+
middleware: A
|
|
2165
2164
|
}), R = y((e) => {
|
|
2166
2165
|
p.current = e, m.current || L(e);
|
|
2167
2166
|
}, [L]), z = y((e) => {
|
|
@@ -2181,10 +2180,10 @@ function Mn({ children: e, open: t, defaultOpen: n = !1, modal: r = !1, onOpenCh
|
|
|
2181
2180
|
contentId: b,
|
|
2182
2181
|
titleId: x,
|
|
2183
2182
|
descriptionId: C,
|
|
2184
|
-
placement:
|
|
2185
|
-
floatingStyles:
|
|
2186
|
-
isPositioned:
|
|
2187
|
-
floatingContext:
|
|
2183
|
+
placement: P,
|
|
2184
|
+
floatingStyles: M,
|
|
2185
|
+
isPositioned: N,
|
|
2186
|
+
floatingContext: j,
|
|
2188
2187
|
arrowRef: k,
|
|
2189
2188
|
setTriggerRef: R,
|
|
2190
2189
|
setAnchorRef: z,
|
|
@@ -2202,11 +2201,11 @@ function Pn({ children: e, asChild: t = !1, className: n, ...r }) {
|
|
|
2202
2201
|
return a ? h(a, {
|
|
2203
2202
|
...r,
|
|
2204
2203
|
id: i,
|
|
2205
|
-
className:
|
|
2204
|
+
className: W(a.props.className, Nn.title, n)
|
|
2206
2205
|
}) : /* @__PURE__ */ d("h2", {
|
|
2207
2206
|
...r,
|
|
2208
2207
|
id: i,
|
|
2209
|
-
className:
|
|
2208
|
+
className: W(Nn.title, n),
|
|
2210
2209
|
children: e
|
|
2211
2210
|
});
|
|
2212
2211
|
}
|
|
@@ -2232,7 +2231,7 @@ function Fn({ children: e, asChild: t = !1, disabled: n = !1, className: r, onCl
|
|
|
2232
2231
|
...a,
|
|
2233
2232
|
...m,
|
|
2234
2233
|
disabled: p || void 0,
|
|
2235
|
-
className:
|
|
2234
|
+
className: W(f.props.className, r),
|
|
2236
2235
|
ref: (e) => {
|
|
2237
2236
|
let t = f.props.ref;
|
|
2238
2237
|
typeof t == "function" ? t(e) : t && (t.current = e), u(e);
|
|
@@ -2297,7 +2296,7 @@ var Bn = {
|
|
|
2297
2296
|
E,
|
|
2298
2297
|
x?.describedBy,
|
|
2299
2298
|
v
|
|
2300
|
-
].filter(Boolean).join(" ") || void 0, O = x !== null, [k, A] =
|
|
2299
|
+
].filter(Boolean).join(" ") || void 0, O = x !== null, [k, A] = ut({
|
|
2301
2300
|
value: t,
|
|
2302
2301
|
defaultValue: n,
|
|
2303
2302
|
onChange: c
|
|
@@ -2311,10 +2310,10 @@ var Bn = {
|
|
|
2311
2310
|
}
|
|
2312
2311
|
};
|
|
2313
2312
|
return /* @__PURE__ */ f("div", {
|
|
2314
|
-
className:
|
|
2313
|
+
className: W(Bn.root, Bn[I], F && Bn.invalid, M && Bn.disabled, Vn[L], h),
|
|
2315
2314
|
children: [/* @__PURE__ */ f("label", {
|
|
2316
2315
|
htmlFor: w,
|
|
2317
|
-
className:
|
|
2316
|
+
className: W(Bn.wrapper, m),
|
|
2318
2317
|
children: [
|
|
2319
2318
|
/* @__PURE__ */ d("input", {
|
|
2320
2319
|
...y,
|
|
@@ -2335,7 +2334,7 @@ var Bn = {
|
|
|
2335
2334
|
className: Bn.control,
|
|
2336
2335
|
"aria-hidden": "true",
|
|
2337
2336
|
children: /* @__PURE__ */ d("span", {
|
|
2338
|
-
className:
|
|
2337
|
+
className: W(Bn.indicator, p && Bn.customIcon),
|
|
2339
2338
|
children: p
|
|
2340
2339
|
})
|
|
2341
2340
|
}),
|
|
@@ -2400,7 +2399,7 @@ var Yn = {
|
|
|
2400
2399
|
disabled: "_disabled_1s3vp_160",
|
|
2401
2400
|
invalid: "_invalid_1s3vp_176"
|
|
2402
2401
|
}, Xn = _(({ value: e, defaultValue: t = "", onValueChange: n, disabled: r = !1, required: i = !1, invalid: a = !1, size: o = "md", color: s = "primary", name: c, label: l, description: u, error: p, orientation: m = "vertical", children: h, className: g, id: _, onKeyDown: v, ...y }, b) => {
|
|
2403
|
-
let x = T(null), C = S(), w = _ ?? C, E = l ? `${w}-label` : void 0, D = u ? `${w}-description` : void 0, O = p ? `${w}-error` : void 0, k = [D, O].filter(Boolean).join(" ") || void 0, A = c ?? `${w}-radio`, [j, M] =
|
|
2402
|
+
let x = T(null), C = S(), w = _ ?? C, E = l ? `${w}-label` : void 0, D = u ? `${w}-description` : void 0, O = p ? `${w}-error` : void 0, k = [D, O].filter(Boolean).join(" ") || void 0, A = c ?? `${w}-radio`, [j, M] = ut({
|
|
2404
2403
|
value: e,
|
|
2405
2404
|
defaultValue: t,
|
|
2406
2405
|
onChange: n
|
|
@@ -2427,7 +2426,7 @@ var Yn = {
|
|
|
2427
2426
|
onKeyDown: (e) => {
|
|
2428
2427
|
v?.(e), e.defaultPrevented || P(e);
|
|
2429
2428
|
},
|
|
2430
|
-
className:
|
|
2429
|
+
className: W(Yn.root, Yn[o], N && Yn.invalid, r && Yn.disabled, g),
|
|
2431
2430
|
children: [
|
|
2432
2431
|
l && /* @__PURE__ */ f("div", {
|
|
2433
2432
|
id: E,
|
|
@@ -2456,7 +2455,7 @@ var Yn = {
|
|
|
2456
2455
|
onValueChange: M
|
|
2457
2456
|
},
|
|
2458
2457
|
children: /* @__PURE__ */ d("div", {
|
|
2459
|
-
className:
|
|
2458
|
+
className: W(Yn.items, Yn[m]),
|
|
2460
2459
|
children: h
|
|
2461
2460
|
})
|
|
2462
2461
|
}),
|
|
@@ -2501,10 +2500,10 @@ function tr({ loading: e, options: t, scrollTop: n, virtual: r, viewportHeight:
|
|
|
2501
2500
|
//#endregion
|
|
2502
2501
|
//#region src/components/Select/internal/types.ts
|
|
2503
2502
|
function nr(e, t) {
|
|
2504
|
-
return
|
|
2503
|
+
return o(e, t);
|
|
2505
2504
|
}
|
|
2506
2505
|
function rr(e) {
|
|
2507
|
-
return
|
|
2506
|
+
return a(e);
|
|
2508
2507
|
}
|
|
2509
2508
|
var ir = {
|
|
2510
2509
|
option: "_option_7msws_1",
|
|
@@ -2527,7 +2526,7 @@ var ir = {
|
|
|
2527
2526
|
}, ar = () => null;
|
|
2528
2527
|
nr(ar, "item"), ar.displayName = "Select.Item";
|
|
2529
2528
|
var or = ({ option: e, isSelected: t, isActive: n, optionId: r, optionIndex: i, selectedValues: a, multiple: o, renderOption: s, onSelect: c, onMouseEnter: l }) => {
|
|
2530
|
-
let p = !!e.disabled, m = e.asChild && v(e.children) ? e.children : void 0, g =
|
|
2529
|
+
let p = !!e.disabled, m = e.asChild && v(e.children) ? e.children : void 0, g = W(ir.option, {
|
|
2531
2530
|
[ir.selected]: t,
|
|
2532
2531
|
[ir.active]: n,
|
|
2533
2532
|
[ir.disabled]: p,
|
|
@@ -2535,7 +2534,7 @@ var or = ({ option: e, isSelected: t, isActive: n, optionId: r, optionIndex: i,
|
|
|
2535
2534
|
[ir.warning]: e.color === "warning",
|
|
2536
2535
|
[ir.danger]: e.color === "danger"
|
|
2537
2536
|
});
|
|
2538
|
-
|
|
2537
|
+
be(!e.asChild || !!m, "Select.Item: asChild requires a single valid React element child.");
|
|
2539
2538
|
let _ = (t) => {
|
|
2540
2539
|
if (p) {
|
|
2541
2540
|
t.preventDefault();
|
|
@@ -2550,7 +2549,7 @@ var or = ({ option: e, isSelected: t, isActive: n, optionId: r, optionIndex: i,
|
|
|
2550
2549
|
role: "option",
|
|
2551
2550
|
"aria-selected": t,
|
|
2552
2551
|
"aria-disabled": p || void 0,
|
|
2553
|
-
className:
|
|
2552
|
+
className: W(m.props.className, g),
|
|
2554
2553
|
onClick: (e) => {
|
|
2555
2554
|
m.props.onClick?.(e), e.defaultPrevented || _(e);
|
|
2556
2555
|
},
|
|
@@ -2604,7 +2603,7 @@ var or = ({ option: e, isSelected: t, isActive: n, optionId: r, optionIndex: i,
|
|
|
2604
2603
|
] }), /* @__PURE__ */ d("span", {
|
|
2605
2604
|
className: ir.check,
|
|
2606
2605
|
"aria-hidden": "true",
|
|
2607
|
-
children: t && /* @__PURE__ */ d(
|
|
2606
|
+
children: t && /* @__PURE__ */ d(O, {})
|
|
2608
2607
|
})]
|
|
2609
2608
|
});
|
|
2610
2609
|
};
|
|
@@ -2643,84 +2642,84 @@ var sr = {
|
|
|
2643
2642
|
});
|
|
2644
2643
|
};
|
|
2645
2644
|
nr(cr, "content"), cr.displayName = "Select.Content";
|
|
2646
|
-
var lr = ({ isOpen: e, listboxId: t, labelledById: n, setDropdownRef: r, style: i, options: a, entries: o, multiple: s, selectedValues: c, color: l = "primary", variant: p = "outline", searchable: m, command: h, virtual: g, portal: _ = !0, searchValue: v = "", searchPlaceholder: b = "Search...", loading: S, loadingText: C = "Loading...", emptyText: D, searchSlot: O, headerSlot: k, emptySlot: A, loadingSlot:
|
|
2647
|
-
let ee = T(null),
|
|
2645
|
+
var lr = ({ isOpen: e, listboxId: t, labelledById: n, setDropdownRef: r, style: i, options: a, entries: o, multiple: s, selectedValues: c, color: l = "primary", variant: p = "outline", searchable: m, command: h, virtual: g, portal: _ = !0, searchValue: v = "", searchPlaceholder: b = "Search...", loading: S, loadingText: C = "Loading...", emptyText: D, searchSlot: O, headerSlot: k, emptySlot: A, loadingSlot: M, renderOption: N, selectedValue: P, activeIndex: F, visualActiveIndex: I = F, className: L, onSelect: R, onSelectGroup: z, onMouseEnter: B, onSearchChange: V }) => {
|
|
2646
|
+
let ee = T(null), H = T(!1), [U, te] = E(null), [ne, re] = E(0), [W, ie] = E(), { bottomSpacerHeight: G, isVirtual: K, itemHeight: ae, maxHeight: oe, startIndex: se, topSpacerHeight: ce, viewportHeight: le, visibleOptions: ue } = w(() => tr({
|
|
2648
2647
|
loading: S,
|
|
2649
2648
|
options: a,
|
|
2650
|
-
scrollTop:
|
|
2649
|
+
scrollTop: ne,
|
|
2651
2650
|
virtual: g,
|
|
2652
|
-
viewportHeight:
|
|
2651
|
+
viewportHeight: W
|
|
2653
2652
|
}), [
|
|
2654
2653
|
S,
|
|
2655
2654
|
a,
|
|
2656
|
-
|
|
2657
|
-
|
|
2655
|
+
ne,
|
|
2656
|
+
W,
|
|
2658
2657
|
g
|
|
2659
|
-
]),
|
|
2660
|
-
te(e), r(e), e &&
|
|
2658
|
+
]), de = y((e) => {
|
|
2659
|
+
te(e), r(e), e && ie(e.clientHeight || void 0);
|
|
2661
2660
|
}, [r]);
|
|
2662
2661
|
x(() => {
|
|
2663
|
-
e || (
|
|
2662
|
+
e || (H.current = !1, re(0), ie(void 0));
|
|
2664
2663
|
}, [e, v]), x(() => {
|
|
2665
|
-
if (!e || !
|
|
2664
|
+
if (!e || !U || (ie(U.clientHeight || void 0), !("ResizeObserver" in window))) return;
|
|
2666
2665
|
let t = new ResizeObserver(([e]) => {
|
|
2667
|
-
|
|
2666
|
+
ie(e?.contentRect.height || void 0);
|
|
2668
2667
|
});
|
|
2669
|
-
return t.observe(
|
|
2670
|
-
}, [
|
|
2668
|
+
return t.observe(U), () => t.disconnect();
|
|
2669
|
+
}, [U, e]), x(() => {
|
|
2671
2670
|
if (!e || !m) return;
|
|
2672
2671
|
let t = window.setTimeout(() => {
|
|
2673
2672
|
ee.current?.focus({ preventScroll: !0 });
|
|
2674
2673
|
}, 0);
|
|
2675
2674
|
return () => window.clearTimeout(t);
|
|
2676
2675
|
}, [e, m]), x(() => {
|
|
2677
|
-
if (!e || S || !
|
|
2678
|
-
let n = a.findIndex((e) => c ? c.includes(e.value) : e.value ===
|
|
2676
|
+
if (!e || S || !U || H.current) return;
|
|
2677
|
+
let n = a.findIndex((e) => c ? c.includes(e.value) : e.value === P), r = n >= 0 ? n : F;
|
|
2679
2678
|
if (r < 0) {
|
|
2680
|
-
|
|
2679
|
+
H.current = !0;
|
|
2681
2680
|
return;
|
|
2682
2681
|
}
|
|
2683
|
-
if (
|
|
2684
|
-
let e = Math.max(0, r * ae - (
|
|
2685
|
-
|
|
2682
|
+
if (H.current = !0, K) {
|
|
2683
|
+
let e = Math.max(0, r * ae - (le - ae) / 2);
|
|
2684
|
+
re(e), U.scrollTop = e;
|
|
2686
2685
|
return;
|
|
2687
2686
|
}
|
|
2688
2687
|
document.getElementById(`${t}-option-${r}`)?.scrollIntoView?.({ block: "nearest" });
|
|
2689
2688
|
}, [
|
|
2690
|
-
|
|
2691
|
-
|
|
2689
|
+
F,
|
|
2690
|
+
U,
|
|
2692
2691
|
e,
|
|
2693
2692
|
K,
|
|
2694
2693
|
ae,
|
|
2695
2694
|
t,
|
|
2696
2695
|
S,
|
|
2697
2696
|
a,
|
|
2698
|
-
|
|
2697
|
+
P,
|
|
2699
2698
|
c,
|
|
2700
|
-
|
|
2699
|
+
le
|
|
2701
2700
|
]);
|
|
2702
|
-
let
|
|
2701
|
+
let q = w(() => ({
|
|
2703
2702
|
...i,
|
|
2704
2703
|
"--select-dropdown-max-height": typeof oe == "number" ? `${oe}px` : oe
|
|
2705
2704
|
}), [oe, i]);
|
|
2706
2705
|
if (!e) return null;
|
|
2707
|
-
let J = o && !K ? o :
|
|
2706
|
+
let J = o && !K ? o : ue.map((e, t) => ({
|
|
2708
2707
|
type: "option",
|
|
2709
2708
|
option: e,
|
|
2710
2709
|
optionIndex: se + t
|
|
2711
2710
|
})), fe = /* @__PURE__ */ f("div", {
|
|
2712
|
-
ref:
|
|
2711
|
+
ref: de,
|
|
2713
2712
|
tabIndex: 0,
|
|
2714
2713
|
className: [
|
|
2715
2714
|
sr.dropdown,
|
|
2716
2715
|
sr[l],
|
|
2717
2716
|
sr[p],
|
|
2718
2717
|
h ? sr.command : void 0,
|
|
2719
|
-
|
|
2718
|
+
L
|
|
2720
2719
|
].filter(Boolean).join(" "),
|
|
2721
|
-
style:
|
|
2720
|
+
style: q,
|
|
2722
2721
|
onScroll: (e) => {
|
|
2723
|
-
K &&
|
|
2722
|
+
K && re(e.currentTarget.scrollTop);
|
|
2724
2723
|
},
|
|
2725
2724
|
children: [
|
|
2726
2725
|
k,
|
|
@@ -2732,16 +2731,16 @@ var lr = ({ isOpen: e, listboxId: t, labelledById: n, setDropdownRef: r, style:
|
|
|
2732
2731
|
value: v,
|
|
2733
2732
|
placeholder: h ? "Type a command..." : b,
|
|
2734
2733
|
"aria-label": "Search options",
|
|
2735
|
-
onInput: (e) =>
|
|
2736
|
-
onChange: (e) =>
|
|
2734
|
+
onInput: (e) => V?.(e.currentTarget.value),
|
|
2735
|
+
onChange: (e) => V?.(e.target.value)
|
|
2737
2736
|
}), v && /* @__PURE__ */ d("button", {
|
|
2738
2737
|
type: "button",
|
|
2739
2738
|
className: sr.searchClear,
|
|
2740
2739
|
"aria-label": "Clear search",
|
|
2741
2740
|
onClick: () => {
|
|
2742
|
-
|
|
2741
|
+
V?.(""), ee.current?.focus();
|
|
2743
2742
|
},
|
|
2744
|
-
children: /* @__PURE__ */ d(
|
|
2743
|
+
children: /* @__PURE__ */ d(j, {})
|
|
2745
2744
|
})]
|
|
2746
2745
|
})),
|
|
2747
2746
|
/* @__PURE__ */ d("ul", {
|
|
@@ -2754,7 +2753,7 @@ var lr = ({ isOpen: e, listboxId: t, labelledById: n, setDropdownRef: r, style:
|
|
|
2754
2753
|
"aria-disabled": "true",
|
|
2755
2754
|
"aria-selected": "false",
|
|
2756
2755
|
className: sr.empty,
|
|
2757
|
-
children:
|
|
2756
|
+
children: M ?? C
|
|
2758
2757
|
}) : a.length ? /* @__PURE__ */ f(u, { children: [
|
|
2759
2758
|
K && /* @__PURE__ */ d("li", {
|
|
2760
2759
|
"aria-hidden": "true",
|
|
@@ -2773,7 +2772,7 @@ var lr = ({ isOpen: e, listboxId: t, labelledById: n, setDropdownRef: r, style:
|
|
|
2773
2772
|
"aria-label": dr(e.selectLabel ?? e.label),
|
|
2774
2773
|
"aria-pressed": i ? "mixed" : r ? "true" : "false",
|
|
2775
2774
|
disabled: t.length === 0,
|
|
2776
|
-
onClick: () =>
|
|
2775
|
+
onClick: () => z(t),
|
|
2777
2776
|
children: [/* @__PURE__ */ d("span", {
|
|
2778
2777
|
className: sr.groupActionText,
|
|
2779
2778
|
children: e.selectLabel ?? e.label
|
|
@@ -2803,15 +2802,15 @@ var lr = ({ isOpen: e, listboxId: t, labelledById: n, setDropdownRef: r, style:
|
|
|
2803
2802
|
let { option: n, optionIndex: r } = e;
|
|
2804
2803
|
return /* @__PURE__ */ d(or, {
|
|
2805
2804
|
option: n,
|
|
2806
|
-
isSelected: c ? c.includes(n.value) : n.value ===
|
|
2807
|
-
isActive: r ===
|
|
2805
|
+
isSelected: c ? c.includes(n.value) : n.value === P,
|
|
2806
|
+
isActive: r === I,
|
|
2808
2807
|
optionId: `${t}-option-${r}`,
|
|
2809
2808
|
optionIndex: r,
|
|
2810
2809
|
selectedValues: c ?? [],
|
|
2811
2810
|
multiple: !!s,
|
|
2812
|
-
renderOption:
|
|
2813
|
-
onSelect:
|
|
2814
|
-
onMouseEnter: () =>
|
|
2811
|
+
renderOption: N,
|
|
2812
|
+
onSelect: R,
|
|
2813
|
+
onMouseEnter: () => B(r)
|
|
2815
2814
|
}, n.value);
|
|
2816
2815
|
}),
|
|
2817
2816
|
K && /* @__PURE__ */ d("li", {
|
|
@@ -2829,249 +2828,106 @@ var lr = ({ isOpen: e, listboxId: t, labelledById: n, setDropdownRef: r, style:
|
|
|
2829
2828
|
})
|
|
2830
2829
|
]
|
|
2831
2830
|
});
|
|
2832
|
-
return _ ? /* @__PURE__ */ d(
|
|
2831
|
+
return _ ? /* @__PURE__ */ d(vt, { children: fe }) : fe;
|
|
2833
2832
|
};
|
|
2834
2833
|
lr.displayName = "SelectContentSurface";
|
|
2835
2834
|
function ur(e) {
|
|
2836
2835
|
let t, n, r, i;
|
|
2837
2836
|
return p.forEach(e, (e) => {
|
|
2838
2837
|
if (!v(e)) return;
|
|
2839
|
-
let a = rr(e.type);
|
|
2840
|
-
a === "label" && (t = e), a === "search" && (n = e), a === "empty" && (r = e), a === "loading" && (i = e);
|
|
2841
|
-
}), {
|
|
2842
|
-
emptySlot: r,
|
|
2843
|
-
headerSlot: t,
|
|
2844
|
-
loadingSlot: i,
|
|
2845
|
-
searchSlot: n
|
|
2846
|
-
};
|
|
2847
|
-
}
|
|
2848
|
-
function dr(e) {
|
|
2849
|
-
return typeof e == "string" || typeof e == "number" ? String(e) : "Select group";
|
|
2850
|
-
}
|
|
2851
|
-
//#endregion
|
|
2852
|
-
//#region src/components/Select/Empty/SelectEmpty.tsx
|
|
2853
|
-
var fr = ({ children: e }) => /* @__PURE__ */ d(u, { children: e });
|
|
2854
|
-
nr(fr, "empty"), fr.displayName = "Select.Empty";
|
|
2855
|
-
//#endregion
|
|
2856
|
-
//#region src/components/Select/Group/SelectGroup.tsx
|
|
2857
|
-
var pr = () => null;
|
|
2858
|
-
nr(pr, "group"), pr.displayName = "Select.Group";
|
|
2859
|
-
var Z = {
|
|
2860
|
-
root: "_root_jn0gk_1",
|
|
2861
|
-
control: "_control_jn0gk_8",
|
|
2862
|
-
disabled: "_disabled_jn0gk_50",
|
|
2863
|
-
arrow: "_arrow_jn0gk_56",
|
|
2864
|
-
withClear: "_withClear_jn0gk_71",
|
|
2865
|
-
primary: "_primary_jn0gk_75",
|
|
2866
|
-
outline: "_outline_jn0gk_75",
|
|
2867
|
-
filled: "_filled_jn0gk_116",
|
|
2868
|
-
soft: "_soft_jn0gk_157",
|
|
2869
|
-
neutral: "_neutral_jn0gk_198",
|
|
2870
|
-
success: "_success_jn0gk_321",
|
|
2871
|
-
warning: "_warning_jn0gk_444",
|
|
2872
|
-
danger: "_danger_jn0gk_567",
|
|
2873
|
-
sm: "_sm_jn0gk_690",
|
|
2874
|
-
md: "_md_jn0gk_697",
|
|
2875
|
-
lg: "_lg_jn0gk_704",
|
|
2876
|
-
valueWrap: "_valueWrap_jn0gk_711",
|
|
2877
|
-
value: "_value_jn0gk_711",
|
|
2878
|
-
adornment: "_adornment_jn0gk_725",
|
|
2879
|
-
affix: "_affix_jn0gk_726",
|
|
2880
|
-
clear: "_clear_jn0gk_741",
|
|
2881
|
-
placeholder: "_placeholder_jn0gk_777",
|
|
2882
|
-
error: "_error_jn0gk_781",
|
|
2883
|
-
spinner: "_spinner_jn0gk_817",
|
|
2884
|
-
spin: "_spin_jn0gk_817",
|
|
2885
|
-
loading: "_loading_jn0gk_826",
|
|
2886
|
-
open: "_open_jn0gk_845"
|
|
2887
|
-
}, mr = ({ children: e, className: t }) => {
|
|
2888
|
-
let { triggerProps: n } = er();
|
|
2889
|
-
return /* @__PURE__ */ d("span", {
|
|
2890
|
-
className:
|
|
2891
|
-
"aria-hidden": "true",
|
|
2892
|
-
children: n.loading ? /* @__PURE__ */ d("span", { className: Z.spinner }) : e ?? n.endIcon ?? /* @__PURE__ */ d(
|
|
2893
|
-
});
|
|
2894
|
-
};
|
|
2895
|
-
nr(mr, "icon"), mr.displayName = "Select.Icon";
|
|
2896
|
-
//#endregion
|
|
2897
|
-
//#region src/components/Select/ItemBadge/SelectItemBadge.tsx
|
|
2898
|
-
var hr = () => null;
|
|
2899
|
-
nr(hr, "itemBadge"), hr.displayName = "Select.ItemBadge";
|
|
2900
|
-
//#endregion
|
|
2901
|
-
//#region src/components/Select/ItemDescription/SelectItemDescription.tsx
|
|
2902
|
-
var gr = () => null;
|
|
2903
|
-
nr(gr, "itemDescription"), gr.displayName = "Select.ItemDescription";
|
|
2904
|
-
//#endregion
|
|
2905
|
-
//#region src/components/Select/ItemIcon/SelectItemIcon.tsx
|
|
2906
|
-
var _r = () => null;
|
|
2907
|
-
nr(_r, "itemIcon"), _r.displayName = "Select.ItemIcon";
|
|
2908
|
-
//#endregion
|
|
2909
|
-
//#region src/components/Select/Label/SelectLabel.tsx
|
|
2910
|
-
var vr = ({ children: e }) => /* @__PURE__ */ d("div", {
|
|
2911
|
-
role: "presentation",
|
|
2912
|
-
className: sr.groupLabel,
|
|
2913
|
-
children: e
|
|
2914
|
-
});
|
|
2915
|
-
nr(vr, "label"), vr.displayName = "Select.Label";
|
|
2916
|
-
//#endregion
|
|
2917
|
-
//#region src/components/Select/Loading/SelectLoading.tsx
|
|
2918
|
-
var yr = ({ children: e }) => /* @__PURE__ */ d(u, { children: e });
|
|
2919
|
-
nr(yr, "loading"), yr.displayName = "Select.Loading";
|
|
2920
|
-
//#endregion
|
|
2921
|
-
//#region src/patterns/FormField/FormFieldContext.ts
|
|
2922
|
-
var br = g(null), xr = () => b(br), Sr = {
|
|
2923
|
-
wrapper: "_wrapper_r078u_1",
|
|
2924
|
-
sm: "_sm_r078u_41",
|
|
2925
|
-
md: "_md_r078u_78",
|
|
2926
|
-
lg: "_lg_r078u_115",
|
|
2927
|
-
horizontal: "_horizontal_r078u_152",
|
|
2928
|
-
start: "_start_r078u_153",
|
|
2929
|
-
labelRow: "_labelRow_r078u_160",
|
|
2930
|
-
description: "_description_r078u_161",
|
|
2931
|
-
control: "_control_r078u_162",
|
|
2932
|
-
message: "_message_r078u_163",
|
|
2933
|
-
label: "_label_r078u_160",
|
|
2934
|
-
labelText: "_labelText_r078u_196",
|
|
2935
|
-
required: "_required_r078u_200",
|
|
2936
|
-
optional: "_optional_r078u_204",
|
|
2937
|
-
labelInfo: "_labelInfo_r078u_211",
|
|
2938
|
-
labelAction: "_labelAction_r078u_224",
|
|
2939
|
-
messageToneNeutral: "_messageToneNeutral_r078u_249",
|
|
2940
|
-
messageToneSuccess: "_messageToneSuccess_r078u_253",
|
|
2941
|
-
messageToneWarning: "_messageToneWarning_r078u_257",
|
|
2942
|
-
messageToneDanger: "_messageToneDanger_r078u_261",
|
|
2943
|
-
disabled: "_disabled_r078u_274"
|
|
2944
|
-
}, Cr = (...e) => e.filter(Boolean).join(" ") || void 0;
|
|
2945
|
-
function wr(e, t) {
|
|
2946
|
-
let n = () => null;
|
|
2947
|
-
return n.__velliraFormFieldPart = e, n.displayName = t, n;
|
|
2948
|
-
}
|
|
2949
|
-
function Tr(e) {
|
|
2950
|
-
let t = [], n = { hasSlots: !1 };
|
|
2951
|
-
return p.forEach(e, (e) => {
|
|
2952
|
-
if (!v(e)) {
|
|
2953
|
-
e != null && e !== !1 && t.push(e);
|
|
2954
|
-
return;
|
|
2955
|
-
}
|
|
2956
|
-
switch (e.type.__velliraFormFieldPart) {
|
|
2957
|
-
case "label":
|
|
2958
|
-
n.hasSlots = !0, n.label = e.props;
|
|
2959
|
-
return;
|
|
2960
|
-
case "description":
|
|
2961
|
-
n.hasSlots = !0, n.description = e.props;
|
|
2962
|
-
return;
|
|
2963
|
-
case "control":
|
|
2964
|
-
n.hasSlots = !0, n.control = e.props;
|
|
2965
|
-
return;
|
|
2966
|
-
case "message":
|
|
2967
|
-
n.hasSlots = !0, n.message = e.props;
|
|
2968
|
-
return;
|
|
2969
|
-
default: t.push(e);
|
|
2970
|
-
}
|
|
2971
|
-
}), t.length > 0 && (n.fallbackChildren = t.length === 1 ? t[0] : t), n;
|
|
2972
|
-
}
|
|
2973
|
-
var Er = ({ id: e, label: t, description: n, error: r, message: i, messageTone: a, messageLive: o, required: s = !1, disabled: c = !1, invalid: l = !1, orientation: u = "vertical", labelPosition: p = "top", size: g = "md", labelInfo: _, labelAction: y, optionalText: b, children: x, bindControl: C = !0, className: w, controlClassName: T, labelClassName: E, descriptionClassName: D, errorClassName: O, messageClassName: k, ...A }) => {
|
|
2974
|
-
let j = Tr(x), M = t ?? j.label?.children, N = n ?? j.description?.children, P = i ?? j.message?.children, F = a ?? j.message?.tone ?? "neutral", I = o ?? j.message?.live ?? "off", L = _ ?? j.label?.info, R = y ?? j.label?.action, z = b ?? j.label?.optionalText, B = j.hasSlots ? j.control?.children ?? j.fallbackChildren : x, ee = j.control?.bindControl ?? C, V = S(), H = e ?? V, te = M ? `${H}-label` : void 0, ne = N && H ? `${H}-description` : void 0, re = r && H ? `${H}-error` : void 0, ie = !r && P && H ? `${H}-message` : void 0, W = l || !!r, G = r ?? P, K = r ? "danger" : F, ae = {
|
|
2975
|
-
neutral: Sr.messageToneNeutral,
|
|
2976
|
-
success: Sr.messageToneSuccess,
|
|
2977
|
-
warning: Sr.messageToneWarning,
|
|
2978
|
-
danger: Sr.messageToneDanger
|
|
2979
|
-
}[K], oe = Cr(te), se = Cr(ne, re, ie), ce = {
|
|
2980
|
-
controlId: H,
|
|
2981
|
-
labelId: te,
|
|
2982
|
-
descriptionId: ne,
|
|
2983
|
-
errorId: re,
|
|
2984
|
-
messageId: ie,
|
|
2985
|
-
required: s,
|
|
2986
|
-
disabled: c,
|
|
2987
|
-
invalid: W,
|
|
2988
|
-
size: g,
|
|
2989
|
-
ariaLabelledBy: oe,
|
|
2990
|
-
ariaDescribedBy: se
|
|
2991
|
-
}, q = v(B) && B.type !== m ? B : void 0, le = ee && q ? h(q, {
|
|
2992
|
-
id: q.props.id ?? H,
|
|
2993
|
-
required: q.props.required ?? s,
|
|
2994
|
-
disabled: q.props.disabled ?? c,
|
|
2995
|
-
"aria-invalid": q.props["aria-invalid"] ?? (W || void 0),
|
|
2996
|
-
"aria-labelledby": Cr(q.props["aria-labelledby"], oe),
|
|
2997
|
-
"aria-describedby": Cr(q.props["aria-describedby"], se)
|
|
2998
|
-
}) : B;
|
|
2999
|
-
return /* @__PURE__ */ f("div", {
|
|
3000
|
-
...A,
|
|
3001
|
-
"aria-disabled": c || void 0,
|
|
3002
|
-
className: U(Sr.wrapper, Sr[u], Sr[p], Sr[g], c && Sr.disabled, w),
|
|
3003
|
-
"data-disabled": c || void 0,
|
|
3004
|
-
"data-invalid": W || void 0,
|
|
3005
|
-
"data-orientation": u,
|
|
3006
|
-
"data-size": g,
|
|
3007
|
-
children: [
|
|
3008
|
-
(M || R) && /* @__PURE__ */ f("div", {
|
|
3009
|
-
className: Sr.labelRow,
|
|
3010
|
-
children: [M && /* @__PURE__ */ f("label", {
|
|
3011
|
-
id: te,
|
|
3012
|
-
htmlFor: H,
|
|
3013
|
-
className: U(Sr.label, j.label?.className, E),
|
|
3014
|
-
children: [
|
|
3015
|
-
/* @__PURE__ */ d("span", {
|
|
3016
|
-
className: Sr.labelText,
|
|
3017
|
-
children: M
|
|
3018
|
-
}),
|
|
3019
|
-
s && /* @__PURE__ */ d("span", {
|
|
3020
|
-
className: Sr.required,
|
|
3021
|
-
"aria-hidden": "true",
|
|
3022
|
-
children: "*"
|
|
3023
|
-
}),
|
|
3024
|
-
!s && z && /* @__PURE__ */ d("span", {
|
|
3025
|
-
className: Sr.optional,
|
|
3026
|
-
children: z
|
|
3027
|
-
}),
|
|
3028
|
-
L && /* @__PURE__ */ d("span", {
|
|
3029
|
-
className: Sr.labelInfo,
|
|
3030
|
-
children: L
|
|
3031
|
-
})
|
|
3032
|
-
]
|
|
3033
|
-
}), R && /* @__PURE__ */ d("div", {
|
|
3034
|
-
className: Sr.labelAction,
|
|
3035
|
-
children: R
|
|
3036
|
-
})]
|
|
3037
|
-
}),
|
|
3038
|
-
N && /* @__PURE__ */ d("div", {
|
|
3039
|
-
id: ne,
|
|
3040
|
-
className: U(Sr.description, j.description?.className, D),
|
|
3041
|
-
children: N
|
|
3042
|
-
}),
|
|
3043
|
-
/* @__PURE__ */ d(br.Provider, {
|
|
3044
|
-
value: ce,
|
|
3045
|
-
children: /* @__PURE__ */ d("div", {
|
|
3046
|
-
className: U(Sr.control, j.control?.className, T),
|
|
3047
|
-
children: le
|
|
3048
|
-
})
|
|
3049
|
-
}),
|
|
3050
|
-
G && /* @__PURE__ */ d("div", {
|
|
3051
|
-
id: r ? re : ie,
|
|
3052
|
-
className: U(Sr.message, ae, !r && j.message?.className, r ? O : k),
|
|
3053
|
-
role: r ? "alert" : void 0,
|
|
3054
|
-
"aria-live": !r && I === "polite" ? "polite" : void 0,
|
|
3055
|
-
children: G
|
|
3056
|
-
})
|
|
3057
|
-
]
|
|
2838
|
+
let a = rr(e.type);
|
|
2839
|
+
a === "label" && (t = e), a === "search" && (n = e), a === "empty" && (r = e), a === "loading" && (i = e);
|
|
2840
|
+
}), {
|
|
2841
|
+
emptySlot: r,
|
|
2842
|
+
headerSlot: t,
|
|
2843
|
+
loadingSlot: i,
|
|
2844
|
+
searchSlot: n
|
|
2845
|
+
};
|
|
2846
|
+
}
|
|
2847
|
+
function dr(e) {
|
|
2848
|
+
return typeof e == "string" || typeof e == "number" ? String(e) : "Select group";
|
|
2849
|
+
}
|
|
2850
|
+
//#endregion
|
|
2851
|
+
//#region src/components/Select/Empty/SelectEmpty.tsx
|
|
2852
|
+
var fr = ({ children: e }) => /* @__PURE__ */ d(u, { children: e });
|
|
2853
|
+
nr(fr, "empty"), fr.displayName = "Select.Empty";
|
|
2854
|
+
//#endregion
|
|
2855
|
+
//#region src/components/Select/Group/SelectGroup.tsx
|
|
2856
|
+
var pr = () => null;
|
|
2857
|
+
nr(pr, "group"), pr.displayName = "Select.Group";
|
|
2858
|
+
var Z = {
|
|
2859
|
+
root: "_root_jn0gk_1",
|
|
2860
|
+
control: "_control_jn0gk_8",
|
|
2861
|
+
disabled: "_disabled_jn0gk_50",
|
|
2862
|
+
arrow: "_arrow_jn0gk_56",
|
|
2863
|
+
withClear: "_withClear_jn0gk_71",
|
|
2864
|
+
primary: "_primary_jn0gk_75",
|
|
2865
|
+
outline: "_outline_jn0gk_75",
|
|
2866
|
+
filled: "_filled_jn0gk_116",
|
|
2867
|
+
soft: "_soft_jn0gk_157",
|
|
2868
|
+
neutral: "_neutral_jn0gk_198",
|
|
2869
|
+
success: "_success_jn0gk_321",
|
|
2870
|
+
warning: "_warning_jn0gk_444",
|
|
2871
|
+
danger: "_danger_jn0gk_567",
|
|
2872
|
+
sm: "_sm_jn0gk_690",
|
|
2873
|
+
md: "_md_jn0gk_697",
|
|
2874
|
+
lg: "_lg_jn0gk_704",
|
|
2875
|
+
valueWrap: "_valueWrap_jn0gk_711",
|
|
2876
|
+
value: "_value_jn0gk_711",
|
|
2877
|
+
adornment: "_adornment_jn0gk_725",
|
|
2878
|
+
affix: "_affix_jn0gk_726",
|
|
2879
|
+
clear: "_clear_jn0gk_741",
|
|
2880
|
+
placeholder: "_placeholder_jn0gk_777",
|
|
2881
|
+
error: "_error_jn0gk_781",
|
|
2882
|
+
spinner: "_spinner_jn0gk_817",
|
|
2883
|
+
spin: "_spin_jn0gk_817",
|
|
2884
|
+
loading: "_loading_jn0gk_826",
|
|
2885
|
+
open: "_open_jn0gk_845"
|
|
2886
|
+
}, mr = ({ children: e, className: t }) => {
|
|
2887
|
+
let { triggerProps: n } = er();
|
|
2888
|
+
return /* @__PURE__ */ d("span", {
|
|
2889
|
+
className: W(Z.arrow, { [Z.open]: n.isOpen }, t),
|
|
2890
|
+
"aria-hidden": "true",
|
|
2891
|
+
children: n.loading ? /* @__PURE__ */ d("span", { className: Z.spinner }) : e ?? n.endIcon ?? /* @__PURE__ */ d(k, {})
|
|
3058
2892
|
});
|
|
3059
|
-
}
|
|
3060
|
-
|
|
3061
|
-
|
|
3062
|
-
|
|
3063
|
-
|
|
3064
|
-
|
|
3065
|
-
|
|
2893
|
+
};
|
|
2894
|
+
nr(mr, "icon"), mr.displayName = "Select.Icon";
|
|
2895
|
+
//#endregion
|
|
2896
|
+
//#region src/components/Select/ItemBadge/SelectItemBadge.tsx
|
|
2897
|
+
var hr = () => null;
|
|
2898
|
+
nr(hr, "itemBadge"), hr.displayName = "Select.ItemBadge";
|
|
2899
|
+
//#endregion
|
|
2900
|
+
//#region src/components/Select/ItemDescription/SelectItemDescription.tsx
|
|
2901
|
+
var gr = () => null;
|
|
2902
|
+
nr(gr, "itemDescription"), gr.displayName = "Select.ItemDescription";
|
|
2903
|
+
//#endregion
|
|
2904
|
+
//#region src/components/Select/ItemIcon/SelectItemIcon.tsx
|
|
2905
|
+
var _r = () => null;
|
|
2906
|
+
nr(_r, "itemIcon"), _r.displayName = "Select.ItemIcon";
|
|
2907
|
+
//#endregion
|
|
2908
|
+
//#region src/components/Select/Label/SelectLabel.tsx
|
|
2909
|
+
var vr = ({ children: e }) => /* @__PURE__ */ d("div", {
|
|
2910
|
+
role: "presentation",
|
|
2911
|
+
className: sr.groupLabel,
|
|
2912
|
+
children: e
|
|
2913
|
+
});
|
|
2914
|
+
nr(vr, "label"), vr.displayName = "Select.Label";
|
|
2915
|
+
//#endregion
|
|
2916
|
+
//#region src/components/Select/Loading/SelectLoading.tsx
|
|
2917
|
+
var yr = ({ children: e }) => /* @__PURE__ */ d(u, { children: e });
|
|
2918
|
+
nr(yr, "loading"), yr.displayName = "Select.Loading";
|
|
2919
|
+
//#endregion
|
|
2920
|
+
//#region src/components/Select/Trigger/SelectTrigger.tsx
|
|
2921
|
+
var br = ({ children: e, className: t }) => {
|
|
3066
2922
|
let { triggerProps: n } = er();
|
|
3067
|
-
return /* @__PURE__ */ d(
|
|
2923
|
+
return /* @__PURE__ */ d(xr, {
|
|
3068
2924
|
...n,
|
|
3069
2925
|
className: [n.className, t].filter(Boolean).join(" "),
|
|
3070
2926
|
children: e
|
|
3071
2927
|
});
|
|
3072
2928
|
};
|
|
3073
|
-
nr(
|
|
3074
|
-
var
|
|
2929
|
+
nr(br, "trigger"), br.displayName = "Select.Trigger";
|
|
2930
|
+
var xr = ({ children: e, id: t, describedBy: n, labelledBy: r, isOpen: i, disabled: a, required: o, listboxId: s, activeIndex: c, ariaLabel: l, error: p, displayText: m, isPlaceholder: h, size: g = "md", color: _, variant: v, loading: y, startIcon: b, endIcon: x, prefix: S, suffix: C, clearable: w, onClear: T, className: E, buttonRef: D, onClick: O, onKeyDown: A, onBlur: M, onFocus: N }) => /* @__PURE__ */ f("span", {
|
|
3075
2931
|
className: Z.root,
|
|
3076
2932
|
children: [/* @__PURE__ */ d("button", {
|
|
3077
2933
|
id: t,
|
|
@@ -3089,16 +2945,16 @@ var Nr = ({ children: e, id: t, describedBy: n, labelledBy: r, isOpen: i, disabl
|
|
|
3089
2945
|
"aria-controls": i ? s : void 0,
|
|
3090
2946
|
"aria-describedby": n,
|
|
3091
2947
|
"aria-activedescendant": i && c >= 0 ? `${s}-option-${c}` : void 0,
|
|
3092
|
-
className:
|
|
2948
|
+
className: W(Z.control, Z[g], Z[v], Z[_], {
|
|
3093
2949
|
[Z.error]: !!p,
|
|
3094
2950
|
[Z.disabled]: a,
|
|
3095
2951
|
[Z.loading]: y,
|
|
3096
2952
|
[Z.withClear]: w
|
|
3097
2953
|
}, E),
|
|
3098
2954
|
onClick: O,
|
|
3099
|
-
onKeyDown:
|
|
3100
|
-
onBlur:
|
|
3101
|
-
onFocus:
|
|
2955
|
+
onKeyDown: A,
|
|
2956
|
+
onBlur: M,
|
|
2957
|
+
onFocus: N,
|
|
3102
2958
|
children: e ?? /* @__PURE__ */ f(u, { children: [
|
|
3103
2959
|
b && /* @__PURE__ */ d("span", {
|
|
3104
2960
|
className: Z.adornment,
|
|
@@ -3111,7 +2967,7 @@ var Nr = ({ children: e, id: t, describedBy: n, labelledBy: r, isOpen: i, disabl
|
|
|
3111
2967
|
/* @__PURE__ */ d("span", {
|
|
3112
2968
|
className: Z.valueWrap,
|
|
3113
2969
|
children: /* @__PURE__ */ d("span", {
|
|
3114
|
-
className:
|
|
2970
|
+
className: W(Z.value, { [Z.placeholder]: h }),
|
|
3115
2971
|
children: m
|
|
3116
2972
|
})
|
|
3117
2973
|
}),
|
|
@@ -3120,9 +2976,9 @@ var Nr = ({ children: e, id: t, describedBy: n, labelledBy: r, isOpen: i, disabl
|
|
|
3120
2976
|
children: C
|
|
3121
2977
|
}),
|
|
3122
2978
|
/* @__PURE__ */ d("span", {
|
|
3123
|
-
className:
|
|
2979
|
+
className: W(Z.arrow, { [Z.open]: i }),
|
|
3124
2980
|
"aria-hidden": "true",
|
|
3125
|
-
children: y ? /* @__PURE__ */ d("span", { className: Z.spinner }) : x ?? /* @__PURE__ */ d(
|
|
2981
|
+
children: y ? /* @__PURE__ */ d("span", { className: Z.spinner }) : x ?? /* @__PURE__ */ d(k, {})
|
|
3126
2982
|
})
|
|
3127
2983
|
] })
|
|
3128
2984
|
}), w && !e && /* @__PURE__ */ d("button", {
|
|
@@ -3132,20 +2988,20 @@ var Nr = ({ children: e, id: t, describedBy: n, labelledBy: r, isOpen: i, disabl
|
|
|
3132
2988
|
onClick: (e) => {
|
|
3133
2989
|
e.stopPropagation(), T?.();
|
|
3134
2990
|
},
|
|
3135
|
-
children: /* @__PURE__ */ d(
|
|
2991
|
+
children: /* @__PURE__ */ d(j, {})
|
|
3136
2992
|
})]
|
|
3137
2993
|
});
|
|
3138
|
-
|
|
2994
|
+
xr.displayName = "SelectTriggerSurface";
|
|
3139
2995
|
//#endregion
|
|
3140
2996
|
//#region src/components/Select/internal/SelectCollection.ts
|
|
3141
|
-
function
|
|
2997
|
+
function Sr(e) {
|
|
3142
2998
|
let t = [], n = [], r = 0;
|
|
3143
2999
|
function i(e) {
|
|
3144
3000
|
p.forEach(e, (e) => {
|
|
3145
3001
|
if (!v(e)) return;
|
|
3146
3002
|
let a = rr(e.type);
|
|
3147
3003
|
if (a === "group") {
|
|
3148
|
-
let n = e.props, a =
|
|
3004
|
+
let n = e.props, a = wr(n.children);
|
|
3149
3005
|
t.push({
|
|
3150
3006
|
type: "group",
|
|
3151
3007
|
id: `group-${r++}`,
|
|
@@ -3157,7 +3013,7 @@ function Pr(e) {
|
|
|
3157
3013
|
return;
|
|
3158
3014
|
}
|
|
3159
3015
|
if (a === "item") {
|
|
3160
|
-
let r = e.props, i =
|
|
3016
|
+
let r = e.props, i = Tr(r.children, r.value), a = r.label ?? i.label, o = n.length, s = {
|
|
3161
3017
|
asChild: r.asChild,
|
|
3162
3018
|
children: r.children,
|
|
3163
3019
|
label: a,
|
|
@@ -3191,7 +3047,7 @@ function Pr(e) {
|
|
|
3191
3047
|
options: n
|
|
3192
3048
|
};
|
|
3193
3049
|
}
|
|
3194
|
-
function
|
|
3050
|
+
function Cr(e) {
|
|
3195
3051
|
let t = !1;
|
|
3196
3052
|
function n(e) {
|
|
3197
3053
|
p.forEach(e, (e) => {
|
|
@@ -3206,7 +3062,7 @@ function Fr(e) {
|
|
|
3206
3062
|
}
|
|
3207
3063
|
return n(e), t;
|
|
3208
3064
|
}
|
|
3209
|
-
function
|
|
3065
|
+
function wr(e) {
|
|
3210
3066
|
let t = [];
|
|
3211
3067
|
function n(e) {
|
|
3212
3068
|
p.forEach(e, (e) => {
|
|
@@ -3221,7 +3077,7 @@ function Ir(e) {
|
|
|
3221
3077
|
}
|
|
3222
3078
|
return n(e), t;
|
|
3223
3079
|
}
|
|
3224
|
-
function
|
|
3080
|
+
function Tr(e, t) {
|
|
3225
3081
|
let n, r, i, a = [];
|
|
3226
3082
|
function o(e) {
|
|
3227
3083
|
p.forEach(e, (e) => {
|
|
@@ -3257,274 +3113,420 @@ function Lr(e, t) {
|
|
|
3257
3113
|
}
|
|
3258
3114
|
//#endregion
|
|
3259
3115
|
//#region src/components/Select/internal/SelectSearch.ts
|
|
3260
|
-
function
|
|
3116
|
+
function Er({ options: e, searchable: t, searchValue: n }) {
|
|
3261
3117
|
if (!t || !n) return e;
|
|
3262
3118
|
let r = n.toLocaleLowerCase();
|
|
3263
|
-
return e.filter((e) => `${e.label} ${
|
|
3119
|
+
return e.filter((e) => `${e.label} ${Dr(e.description)}`.toLocaleLowerCase().includes(r));
|
|
3264
3120
|
}
|
|
3265
|
-
function
|
|
3121
|
+
function Dr(e) {
|
|
3266
3122
|
return typeof e == "string" || typeof e == "number" ? String(e) : "";
|
|
3267
3123
|
}
|
|
3268
3124
|
//#endregion
|
|
3269
3125
|
//#region src/components/Select/internal/useSelectCollection.ts
|
|
3270
|
-
function
|
|
3271
|
-
return w(() =>
|
|
3126
|
+
function Or(e) {
|
|
3127
|
+
return w(() => Sr(e), [e]);
|
|
3128
|
+
}
|
|
3129
|
+
//#endregion
|
|
3130
|
+
//#region src/patterns/FormField/FormFieldContext.ts
|
|
3131
|
+
var kr = g(null), Ar = () => b(kr), jr = {
|
|
3132
|
+
wrapper: "_wrapper_r078u_1",
|
|
3133
|
+
sm: "_sm_r078u_41",
|
|
3134
|
+
md: "_md_r078u_78",
|
|
3135
|
+
lg: "_lg_r078u_115",
|
|
3136
|
+
horizontal: "_horizontal_r078u_152",
|
|
3137
|
+
start: "_start_r078u_153",
|
|
3138
|
+
labelRow: "_labelRow_r078u_160",
|
|
3139
|
+
description: "_description_r078u_161",
|
|
3140
|
+
control: "_control_r078u_162",
|
|
3141
|
+
message: "_message_r078u_163",
|
|
3142
|
+
label: "_label_r078u_160",
|
|
3143
|
+
labelText: "_labelText_r078u_196",
|
|
3144
|
+
required: "_required_r078u_200",
|
|
3145
|
+
optional: "_optional_r078u_204",
|
|
3146
|
+
labelInfo: "_labelInfo_r078u_211",
|
|
3147
|
+
labelAction: "_labelAction_r078u_224",
|
|
3148
|
+
messageToneNeutral: "_messageToneNeutral_r078u_249",
|
|
3149
|
+
messageToneSuccess: "_messageToneSuccess_r078u_253",
|
|
3150
|
+
messageToneWarning: "_messageToneWarning_r078u_257",
|
|
3151
|
+
messageToneDanger: "_messageToneDanger_r078u_261",
|
|
3152
|
+
disabled: "_disabled_r078u_274"
|
|
3153
|
+
}, Mr = (...e) => e.filter(Boolean).join(" ") || void 0;
|
|
3154
|
+
function Nr(e, t) {
|
|
3155
|
+
let n = () => null;
|
|
3156
|
+
return n.__velliraFormFieldPart = e, n.displayName = t, n;
|
|
3157
|
+
}
|
|
3158
|
+
function Pr(e) {
|
|
3159
|
+
let t = [], n = { hasSlots: !1 };
|
|
3160
|
+
return p.forEach(e, (e) => {
|
|
3161
|
+
if (!v(e)) {
|
|
3162
|
+
e != null && e !== !1 && t.push(e);
|
|
3163
|
+
return;
|
|
3164
|
+
}
|
|
3165
|
+
switch (e.type.__velliraFormFieldPart) {
|
|
3166
|
+
case "label":
|
|
3167
|
+
n.hasSlots = !0, n.label = e.props;
|
|
3168
|
+
return;
|
|
3169
|
+
case "description":
|
|
3170
|
+
n.hasSlots = !0, n.description = e.props;
|
|
3171
|
+
return;
|
|
3172
|
+
case "control":
|
|
3173
|
+
n.hasSlots = !0, n.control = e.props;
|
|
3174
|
+
return;
|
|
3175
|
+
case "message":
|
|
3176
|
+
n.hasSlots = !0, n.message = e.props;
|
|
3177
|
+
return;
|
|
3178
|
+
default: t.push(e);
|
|
3179
|
+
}
|
|
3180
|
+
}), t.length > 0 && (n.fallbackChildren = t.length === 1 ? t[0] : t), n;
|
|
3272
3181
|
}
|
|
3182
|
+
var Fr = ({ id: e, label: t, description: n, error: r, message: i, messageTone: a, messageLive: o, required: s = !1, disabled: c = !1, invalid: l = !1, orientation: u = "vertical", labelPosition: p = "top", size: g = "md", labelInfo: _, labelAction: y, optionalText: b, children: x, bindControl: C = !0, className: w, controlClassName: T, labelClassName: E, descriptionClassName: D, errorClassName: O, messageClassName: k, ...A }) => {
|
|
3183
|
+
let j = Pr(x), M = t ?? j.label?.children, N = n ?? j.description?.children, P = i ?? j.message?.children, F = a ?? j.message?.tone ?? "neutral", I = o ?? j.message?.live ?? "off", L = _ ?? j.label?.info, R = y ?? j.label?.action, z = b ?? j.label?.optionalText, B = j.hasSlots ? j.control?.children ?? j.fallbackChildren : x, V = j.control?.bindControl ?? C, ee = S(), H = e ?? ee, U = M ? `${H}-label` : void 0, te = N && H ? `${H}-description` : void 0, ne = r && H ? `${H}-error` : void 0, re = !r && P && H ? `${H}-message` : void 0, ie = l || !!r, G = r ?? P, K = r ? "danger" : F, ae = {
|
|
3184
|
+
neutral: jr.messageToneNeutral,
|
|
3185
|
+
success: jr.messageToneSuccess,
|
|
3186
|
+
warning: jr.messageToneWarning,
|
|
3187
|
+
danger: jr.messageToneDanger
|
|
3188
|
+
}[K], oe = Mr(U), se = Mr(te, ne, re), ce = {
|
|
3189
|
+
controlId: H,
|
|
3190
|
+
labelId: U,
|
|
3191
|
+
descriptionId: te,
|
|
3192
|
+
errorId: ne,
|
|
3193
|
+
messageId: re,
|
|
3194
|
+
required: s,
|
|
3195
|
+
disabled: c,
|
|
3196
|
+
invalid: ie,
|
|
3197
|
+
size: g,
|
|
3198
|
+
ariaLabelledBy: oe,
|
|
3199
|
+
ariaDescribedBy: se
|
|
3200
|
+
}, le = v(B) && B.type !== m ? B : void 0, ue = V && le ? h(le, {
|
|
3201
|
+
id: le.props.id ?? H,
|
|
3202
|
+
required: le.props.required ?? s,
|
|
3203
|
+
disabled: le.props.disabled ?? c,
|
|
3204
|
+
"aria-invalid": le.props["aria-invalid"] ?? (ie || void 0),
|
|
3205
|
+
"aria-labelledby": Mr(le.props["aria-labelledby"], oe),
|
|
3206
|
+
"aria-describedby": Mr(le.props["aria-describedby"], se)
|
|
3207
|
+
}) : B;
|
|
3208
|
+
return /* @__PURE__ */ f("div", {
|
|
3209
|
+
...A,
|
|
3210
|
+
"aria-disabled": c || void 0,
|
|
3211
|
+
className: W(jr.wrapper, jr[u], jr[p], jr[g], c && jr.disabled, w),
|
|
3212
|
+
"data-disabled": c || void 0,
|
|
3213
|
+
"data-invalid": ie || void 0,
|
|
3214
|
+
"data-orientation": u,
|
|
3215
|
+
"data-size": g,
|
|
3216
|
+
children: [
|
|
3217
|
+
(M || R) && /* @__PURE__ */ f("div", {
|
|
3218
|
+
className: jr.labelRow,
|
|
3219
|
+
children: [M && /* @__PURE__ */ f("label", {
|
|
3220
|
+
id: U,
|
|
3221
|
+
htmlFor: H,
|
|
3222
|
+
className: W(jr.label, j.label?.className, E),
|
|
3223
|
+
children: [
|
|
3224
|
+
/* @__PURE__ */ d("span", {
|
|
3225
|
+
className: jr.labelText,
|
|
3226
|
+
children: M
|
|
3227
|
+
}),
|
|
3228
|
+
s && /* @__PURE__ */ d("span", {
|
|
3229
|
+
className: jr.required,
|
|
3230
|
+
"aria-hidden": "true",
|
|
3231
|
+
children: "*"
|
|
3232
|
+
}),
|
|
3233
|
+
!s && z && /* @__PURE__ */ d("span", {
|
|
3234
|
+
className: jr.optional,
|
|
3235
|
+
children: z
|
|
3236
|
+
}),
|
|
3237
|
+
L && /* @__PURE__ */ d("span", {
|
|
3238
|
+
className: jr.labelInfo,
|
|
3239
|
+
children: L
|
|
3240
|
+
})
|
|
3241
|
+
]
|
|
3242
|
+
}), R && /* @__PURE__ */ d("div", {
|
|
3243
|
+
className: jr.labelAction,
|
|
3244
|
+
children: R
|
|
3245
|
+
})]
|
|
3246
|
+
}),
|
|
3247
|
+
N && /* @__PURE__ */ d("div", {
|
|
3248
|
+
id: te,
|
|
3249
|
+
className: W(jr.description, j.description?.className, D),
|
|
3250
|
+
children: N
|
|
3251
|
+
}),
|
|
3252
|
+
/* @__PURE__ */ d(kr.Provider, {
|
|
3253
|
+
value: ce,
|
|
3254
|
+
children: /* @__PURE__ */ d("div", {
|
|
3255
|
+
className: W(jr.control, j.control?.className, T),
|
|
3256
|
+
children: ue
|
|
3257
|
+
})
|
|
3258
|
+
}),
|
|
3259
|
+
G && /* @__PURE__ */ d("div", {
|
|
3260
|
+
id: r ? ne : re,
|
|
3261
|
+
className: W(jr.message, ae, !r && j.message?.className, r ? O : k),
|
|
3262
|
+
role: r ? "alert" : void 0,
|
|
3263
|
+
"aria-live": !r && I === "polite" ? "polite" : void 0,
|
|
3264
|
+
children: G
|
|
3265
|
+
})
|
|
3266
|
+
]
|
|
3267
|
+
});
|
|
3268
|
+
}, Ir = Nr("label", "FormField.Label"), Lr = Nr("description", "FormField.Description"), Rr = Nr("control", "FormField.Control"), zr = Nr("message", "FormField.Message"), Br = Object.assign(Fr, {
|
|
3269
|
+
Label: Ir,
|
|
3270
|
+
Description: Lr,
|
|
3271
|
+
Control: Rr,
|
|
3272
|
+
Message: zr,
|
|
3273
|
+
displayName: "FormField"
|
|
3274
|
+
});
|
|
3273
3275
|
//#endregion
|
|
3274
3276
|
//#region src/components/Select/Root/useSelectRootState.tsx
|
|
3275
3277
|
function Vr(e) {
|
|
3276
|
-
let { children: t, label: n, description: r, id: i, name: a, "aria-label": o, "aria-describedby": s, "aria-labelledby": c, multiple: l = !1, maxSelected: p, closeOnSelect: m, placeholder: h = "Select...", empty: g, loadingText: _ = "Loading...", size: v, color: b = "primary", variant: C = "outline", required: D = !1, disabled: O = !1, invalid: k = !1, loading: A = !1, clearable: j = !1, searchable: M = !1, virtual: N, modal: P = !1, command: F = !1, error: I, placement: L = "bottom", matchTriggerWidth: R = !0, avoidCollisions: z = !0, portal: B = !0, open:
|
|
3278
|
+
let { children: t, label: n, description: r, id: i, name: a, "aria-label": o, "aria-describedby": s, "aria-labelledby": c, multiple: l = !1, maxSelected: p, closeOnSelect: m, placeholder: h = "Select...", empty: g, loadingText: _ = "Loading...", size: v, color: b = "primary", variant: C = "outline", required: D = !1, disabled: O = !1, invalid: k = !1, loading: A = !1, clearable: j = !1, searchable: M = !1, virtual: N, modal: P = !1, command: F = !1, error: I, placement: L = "bottom", matchTriggerWidth: R = !0, avoidCollisions: z = !0, portal: B = !0, open: V, defaultOpen: ee = !1, onOpenChange: H, onSearch: U, onClear: te, startIcon: ne, endIcon: re, prefix: W, suffix: ie, renderValue: G, renderOption: K, onBlur: ae, onFocus: oe, className: se, triggerClassName: ce, dropdownClassName: le } = e, ue = S(), de = Ar(), q = !!(n || r || I), J = i ?? (q ? void 0 : de?.controlId) ?? ue, fe = `${J}-listbox`, [pe, me] = E(""), he = !!I, ge = he ? `${J}-error` : void 0, _e = r ? `${J}-description` : void 0, ve = v ?? de?.size ?? "md", ye = k || he || !q && !!de?.invalid, Y = O || !q && !!de?.disabled, be = D || !q && !!de?.required, xe = [
|
|
3277
3279
|
s,
|
|
3278
|
-
!
|
|
3280
|
+
!q && !s ? de?.ariaDescribedBy : void 0,
|
|
3279
3281
|
_e,
|
|
3280
3282
|
ge
|
|
3281
|
-
].filter(Boolean).join(" "),
|
|
3282
|
-
options:
|
|
3283
|
-
searchable:
|
|
3283
|
+
].filter(Boolean).join(" "), Se = T(null), Ce = T(null), [we, Te] = E(!1), Ee = M || F, { entries: De, options: Oe } = Or(t), ke = w(() => Er({
|
|
3284
|
+
options: Oe,
|
|
3285
|
+
searchable: Ee,
|
|
3284
3286
|
searchValue: pe
|
|
3285
3287
|
}), [
|
|
3286
|
-
|
|
3287
|
-
|
|
3288
|
+
Ee,
|
|
3289
|
+
Oe,
|
|
3288
3290
|
pe
|
|
3289
|
-
]),
|
|
3290
|
-
value:
|
|
3291
|
-
defaultValue:
|
|
3291
|
+
]), Ae = e.multiple === !0 ? e.value : e.value === null ? "" : e.value, je = e.multiple === !0 ? e.defaultValue : e.defaultValue === null ? "" : e.defaultValue, Me = e.multiple === !0 ? e.onValueChange : void 0, Ne = e.multiple === !0 ? void 0 : e.onValueChange, { selectedValue: Pe, selectedValues: X, isOpen: Fe, setIsOpen: Ie, setSelectedValue: Le, activeIndex: Re, setActiveIndex: ze, closeDropdown: Be, toggleDropdown: Ve, selectValue: He, onKeyDown: Ue } = mt({
|
|
3292
|
+
value: Ae,
|
|
3293
|
+
defaultValue: je,
|
|
3292
3294
|
onValueChange: y((e) => {
|
|
3293
3295
|
if (l) {
|
|
3294
|
-
|
|
3296
|
+
Me?.(Array.isArray(e) ? e : e ? [e] : []);
|
|
3295
3297
|
return;
|
|
3296
3298
|
}
|
|
3297
|
-
|
|
3299
|
+
Ne?.(Array.isArray(e) ? e[0] ?? null : e === "" ? null : e);
|
|
3298
3300
|
}, [
|
|
3299
3301
|
l,
|
|
3300
|
-
|
|
3301
|
-
|
|
3302
|
+
Me,
|
|
3303
|
+
Ne
|
|
3302
3304
|
]),
|
|
3303
|
-
options:
|
|
3305
|
+
options: ke,
|
|
3304
3306
|
multiple: l,
|
|
3305
3307
|
maxSelected: p,
|
|
3306
3308
|
closeOnSelect: m,
|
|
3307
|
-
disabled:
|
|
3308
|
-
open:
|
|
3309
|
-
defaultOpen:
|
|
3309
|
+
disabled: Y,
|
|
3310
|
+
open: V,
|
|
3311
|
+
defaultOpen: ee,
|
|
3310
3312
|
onOpenChange: H
|
|
3311
|
-
}),
|
|
3312
|
-
isOpen:
|
|
3313
|
-
onOpenChange:
|
|
3313
|
+
}), We = w(() => Oe.find((e) => X.includes(e.value)), [Oe, X]), Ge = w(() => Oe.filter((e) => X.includes(e.value)), [Oe, X]), Ke = !!We, qe = Array.isArray(Pe) ? Pe[0] ?? "" : Pe, { floatingStyles: Je, setRef: Ye, setFloatingRef: Xe } = lt({
|
|
3314
|
+
isOpen: Fe,
|
|
3315
|
+
onOpenChange: Ie,
|
|
3314
3316
|
placement: L,
|
|
3315
3317
|
matchTriggerWidth: R,
|
|
3316
3318
|
avoidCollisions: z
|
|
3317
|
-
}),
|
|
3318
|
-
|
|
3319
|
-
}, [
|
|
3319
|
+
}), Ze = y((e) => {
|
|
3320
|
+
He(e), Se.current?.focus();
|
|
3321
|
+
}, [He]), Qe = y((e) => {
|
|
3320
3322
|
if (!l || e.length === 0) return;
|
|
3321
|
-
let t = e.filter((e) =>
|
|
3323
|
+
let t = e.filter((e) => Oe.some((t) => t.value === e && !t.disabled)), n = t.filter((e) => X.includes(e)), r = X.filter((e) => !t.includes(e)).length, i = typeof p == "number" ? Math.max(0, Math.min(t.length, p - r)) : t.length;
|
|
3322
3324
|
if (n.length > 0 && n.length >= i) {
|
|
3323
|
-
|
|
3325
|
+
Le(X.filter((e) => !t.includes(e)));
|
|
3324
3326
|
return;
|
|
3325
3327
|
}
|
|
3326
|
-
let a = [...
|
|
3328
|
+
let a = [...X];
|
|
3327
3329
|
for (let e of t) if (!a.includes(e)) {
|
|
3328
3330
|
if (typeof p == "number" && a.length >= p) break;
|
|
3329
3331
|
a.push(e);
|
|
3330
3332
|
}
|
|
3331
|
-
|
|
3333
|
+
Le(a), m && (Be(), Se.current?.focus());
|
|
3332
3334
|
}, [
|
|
3333
|
-
|
|
3335
|
+
Be,
|
|
3334
3336
|
m,
|
|
3335
3337
|
p,
|
|
3336
3338
|
l,
|
|
3337
|
-
|
|
3338
|
-
|
|
3339
|
-
|
|
3340
|
-
]),
|
|
3341
|
-
|
|
3342
|
-
}, [
|
|
3343
|
-
|
|
3344
|
-
}, [
|
|
3345
|
-
Hr(e,
|
|
3346
|
-
}, [
|
|
3347
|
-
|
|
3348
|
-
}, [
|
|
3349
|
-
me(e),
|
|
3350
|
-
}, [
|
|
3351
|
-
active:
|
|
3339
|
+
Oe,
|
|
3340
|
+
X,
|
|
3341
|
+
Le
|
|
3342
|
+
]), $e = y(() => {
|
|
3343
|
+
He(""), te?.(), Se.current?.focus();
|
|
3344
|
+
}, [te, He]), et = y(() => {
|
|
3345
|
+
Fe || Te(!1), Ve();
|
|
3346
|
+
}, [Fe, Ve]), nt = y((e) => {
|
|
3347
|
+
Hr(e, Fe) && Te(!0), Ue(e);
|
|
3348
|
+
}, [Fe, Ue]), rt = y((e) => {
|
|
3349
|
+
Te(!0), ze(e);
|
|
3350
|
+
}, [ze]), it = y((e) => {
|
|
3351
|
+
me(e), U?.(e);
|
|
3352
|
+
}, [U]), at = tt({
|
|
3353
|
+
active: Fe,
|
|
3352
3354
|
id: fe,
|
|
3353
3355
|
zIndexLevel: "dropdown",
|
|
3354
3356
|
closeOnEscape: !0,
|
|
3355
3357
|
closeOnOutsidePress: !0,
|
|
3356
|
-
contentRef:
|
|
3357
|
-
ignoreRefs: [
|
|
3358
|
-
requestClose:
|
|
3358
|
+
contentRef: Ce,
|
|
3359
|
+
ignoreRefs: [Se],
|
|
3360
|
+
requestClose: Be
|
|
3359
3361
|
});
|
|
3360
3362
|
x(() => {
|
|
3361
|
-
|
|
3362
|
-
}, [
|
|
3363
|
-
!
|
|
3364
|
-
}, [
|
|
3365
|
-
active:
|
|
3363
|
+
Fe || Te(!1);
|
|
3364
|
+
}, [Fe]), x(() => {
|
|
3365
|
+
!Fe && pe && me("");
|
|
3366
|
+
}, [Fe, pe]), ot({
|
|
3367
|
+
active: Fe,
|
|
3366
3368
|
enabled: P
|
|
3367
3369
|
});
|
|
3368
|
-
let
|
|
3369
|
-
|
|
3370
|
-
}, [
|
|
3371
|
-
|
|
3372
|
-
}, [
|
|
3370
|
+
let st = y((e) => {
|
|
3371
|
+
Se.current = e, Ye(e);
|
|
3372
|
+
}, [Ye]), ct = y((e) => {
|
|
3373
|
+
Ce.current = e, Xe(e);
|
|
3374
|
+
}, [Xe]), ut = w(() => G ? G({
|
|
3373
3375
|
multiple: l,
|
|
3374
|
-
option:
|
|
3375
|
-
options:
|
|
3376
|
-
value:
|
|
3377
|
-
values:
|
|
3378
|
-
}) : l &&
|
|
3376
|
+
option: We,
|
|
3377
|
+
options: Ge,
|
|
3378
|
+
value: qe,
|
|
3379
|
+
values: X
|
|
3380
|
+
}) : l && Ge.length ? Ge.map((e) => e.label).join(", ") : We?.label ?? h, [
|
|
3379
3381
|
l,
|
|
3380
3382
|
h,
|
|
3381
3383
|
G,
|
|
3382
|
-
|
|
3383
|
-
|
|
3384
|
-
|
|
3385
|
-
|
|
3386
|
-
]),
|
|
3387
|
-
|
|
3388
|
-
zIndex:
|
|
3389
|
-
}), [
|
|
3384
|
+
We,
|
|
3385
|
+
Ge,
|
|
3386
|
+
X,
|
|
3387
|
+
qe
|
|
3388
|
+
]), dt = g ?? "No options available", ft = j && X.length > 0 && !Y && !A, pt = w(() => ({
|
|
3389
|
+
...Je,
|
|
3390
|
+
zIndex: at.zIndex
|
|
3391
|
+
}), [at.zIndex, Je]), ht = w(() => ({
|
|
3390
3392
|
id: J,
|
|
3391
|
-
describedBy:
|
|
3393
|
+
describedBy: xe || void 0,
|
|
3392
3394
|
labelledBy: o ? void 0 : c,
|
|
3393
|
-
isOpen:
|
|
3394
|
-
disabled:
|
|
3395
|
-
required:
|
|
3395
|
+
isOpen: Fe,
|
|
3396
|
+
disabled: Y,
|
|
3397
|
+
required: be,
|
|
3396
3398
|
listboxId: fe,
|
|
3397
|
-
activeIndex:
|
|
3398
|
-
ariaLabel: o ?? (!n && !
|
|
3399
|
+
activeIndex: Re,
|
|
3400
|
+
ariaLabel: o ?? (!n && !de?.labelId ? We?.label || h : void 0),
|
|
3399
3401
|
error: ye,
|
|
3400
3402
|
loading: A,
|
|
3401
|
-
displayText:
|
|
3402
|
-
isPlaceholder: !
|
|
3403
|
+
displayText: ut,
|
|
3404
|
+
isPlaceholder: !Ke,
|
|
3403
3405
|
size: ve,
|
|
3404
3406
|
color: b,
|
|
3405
3407
|
variant: C,
|
|
3406
|
-
startIcon:
|
|
3407
|
-
endIcon:
|
|
3408
|
-
prefix:
|
|
3409
|
-
suffix:
|
|
3410
|
-
clearable:
|
|
3408
|
+
startIcon: ne,
|
|
3409
|
+
endIcon: re,
|
|
3410
|
+
prefix: W,
|
|
3411
|
+
suffix: ie,
|
|
3412
|
+
clearable: ft,
|
|
3411
3413
|
className: ce,
|
|
3412
|
-
buttonRef:
|
|
3413
|
-
onClear:
|
|
3414
|
-
onClick:
|
|
3415
|
-
onKeyDown:
|
|
3414
|
+
buttonRef: st,
|
|
3415
|
+
onClear: $e,
|
|
3416
|
+
onClick: et,
|
|
3417
|
+
onKeyDown: nt,
|
|
3416
3418
|
onBlur: ae,
|
|
3417
3419
|
onFocus: oe
|
|
3418
3420
|
}), [
|
|
3419
|
-
|
|
3421
|
+
Re,
|
|
3420
3422
|
o,
|
|
3421
3423
|
c,
|
|
3422
3424
|
b,
|
|
3423
|
-
Se,
|
|
3424
|
-
U,
|
|
3425
|
-
ue?.labelId,
|
|
3426
|
-
it,
|
|
3427
|
-
at,
|
|
3428
|
-
X,
|
|
3429
|
-
Ze,
|
|
3430
|
-
be,
|
|
3431
|
-
ye,
|
|
3432
|
-
ze,
|
|
3433
3425
|
xe,
|
|
3426
|
+
re,
|
|
3427
|
+
de?.labelId,
|
|
3428
|
+
$e,
|
|
3429
|
+
et,
|
|
3430
|
+
nt,
|
|
3431
|
+
Ke,
|
|
3432
|
+
Y,
|
|
3433
|
+
ye,
|
|
3434
|
+
Fe,
|
|
3435
|
+
be,
|
|
3434
3436
|
n,
|
|
3435
3437
|
fe,
|
|
3436
3438
|
A,
|
|
3437
3439
|
ae,
|
|
3438
3440
|
oe,
|
|
3439
3441
|
h,
|
|
3440
|
-
ie,
|
|
3441
|
-
ve,
|
|
3442
|
-
dt,
|
|
3443
|
-
Ye?.label,
|
|
3444
|
-
lt,
|
|
3445
|
-
pt,
|
|
3446
|
-
re,
|
|
3447
3442
|
W,
|
|
3443
|
+
ve,
|
|
3444
|
+
ut,
|
|
3445
|
+
We?.label,
|
|
3446
|
+
st,
|
|
3447
|
+
ft,
|
|
3448
|
+
ne,
|
|
3449
|
+
ie,
|
|
3448
3450
|
ce,
|
|
3449
3451
|
J,
|
|
3450
3452
|
C
|
|
3451
3453
|
]), gt = w(() => ({
|
|
3452
|
-
isOpen:
|
|
3454
|
+
isOpen: Fe,
|
|
3453
3455
|
listboxId: fe,
|
|
3454
3456
|
labelledById: J,
|
|
3455
|
-
style:
|
|
3456
|
-
options:
|
|
3457
|
-
entries:
|
|
3457
|
+
style: pt,
|
|
3458
|
+
options: ke,
|
|
3459
|
+
entries: Ee || pe ? void 0 : De,
|
|
3458
3460
|
multiple: l,
|
|
3459
3461
|
color: b,
|
|
3460
3462
|
variant: C,
|
|
3461
|
-
searchable:
|
|
3463
|
+
searchable: Ee,
|
|
3462
3464
|
command: F,
|
|
3463
3465
|
virtual: N,
|
|
3464
3466
|
portal: B,
|
|
3465
3467
|
searchValue: pe,
|
|
3466
3468
|
loading: A,
|
|
3467
3469
|
loadingText: _,
|
|
3468
|
-
emptyText:
|
|
3470
|
+
emptyText: dt,
|
|
3469
3471
|
renderOption: K,
|
|
3470
|
-
selectedValue:
|
|
3471
|
-
selectedValues:
|
|
3472
|
-
activeIndex:
|
|
3473
|
-
visualActiveIndex:
|
|
3474
|
-
className:
|
|
3475
|
-
setDropdownRef:
|
|
3476
|
-
onSelect:
|
|
3477
|
-
onSelectGroup:
|
|
3478
|
-
onMouseEnter:
|
|
3479
|
-
onSearchChange:
|
|
3472
|
+
selectedValue: qe,
|
|
3473
|
+
selectedValues: X,
|
|
3474
|
+
activeIndex: Re,
|
|
3475
|
+
visualActiveIndex: we ? Re : -1,
|
|
3476
|
+
className: le,
|
|
3477
|
+
setDropdownRef: ct,
|
|
3478
|
+
onSelect: Ze,
|
|
3479
|
+
onSelectGroup: Qe,
|
|
3480
|
+
onMouseEnter: rt,
|
|
3481
|
+
onSearchChange: it
|
|
3480
3482
|
}), [
|
|
3481
|
-
|
|
3483
|
+
Re,
|
|
3482
3484
|
b,
|
|
3483
3485
|
F,
|
|
3484
|
-
|
|
3485
|
-
|
|
3486
|
-
|
|
3487
|
-
|
|
3488
|
-
ot,
|
|
3489
|
-
st,
|
|
3490
|
-
nt,
|
|
3486
|
+
pt,
|
|
3487
|
+
le,
|
|
3488
|
+
dt,
|
|
3489
|
+
ke,
|
|
3491
3490
|
rt,
|
|
3492
|
-
|
|
3493
|
-
|
|
3494
|
-
|
|
3491
|
+
it,
|
|
3492
|
+
Ze,
|
|
3493
|
+
Qe,
|
|
3494
|
+
we,
|
|
3495
|
+
Fe,
|
|
3496
|
+
Ee,
|
|
3495
3497
|
fe,
|
|
3496
3498
|
A,
|
|
3497
3499
|
_,
|
|
3498
3500
|
l,
|
|
3499
3501
|
B,
|
|
3500
3502
|
K,
|
|
3501
|
-
|
|
3503
|
+
De,
|
|
3502
3504
|
pe,
|
|
3503
|
-
|
|
3504
|
-
|
|
3505
|
-
|
|
3505
|
+
X,
|
|
3506
|
+
ct,
|
|
3507
|
+
qe,
|
|
3506
3508
|
J,
|
|
3507
3509
|
C,
|
|
3508
3510
|
N
|
|
3509
3511
|
]), _t = w(() => ({
|
|
3510
3512
|
triggerProps: ht,
|
|
3511
3513
|
contentProps: gt
|
|
3512
|
-
}), [gt, ht]), vt = w(() => /* @__PURE__ */ f(u, { children: [a && l &&
|
|
3514
|
+
}), [gt, ht]), vt = w(() => /* @__PURE__ */ f(u, { children: [a && l && X.length > 0 && /* @__PURE__ */ d(u, { children: X.map((e) => /* @__PURE__ */ d("input", {
|
|
3513
3515
|
type: "hidden",
|
|
3514
3516
|
name: a,
|
|
3515
3517
|
value: e,
|
|
3516
|
-
disabled:
|
|
3518
|
+
disabled: Y
|
|
3517
3519
|
}, e)) }), a && !l && /* @__PURE__ */ d("input", {
|
|
3518
3520
|
type: "hidden",
|
|
3519
3521
|
name: a,
|
|
3520
|
-
value:
|
|
3521
|
-
disabled:
|
|
3522
|
+
value: qe,
|
|
3523
|
+
disabled: Y
|
|
3522
3524
|
})] }), [
|
|
3523
|
-
|
|
3525
|
+
Y,
|
|
3524
3526
|
l,
|
|
3525
3527
|
a,
|
|
3526
|
-
|
|
3527
|
-
|
|
3528
|
+
X,
|
|
3529
|
+
qe
|
|
3528
3530
|
]);
|
|
3529
3531
|
return {
|
|
3530
3532
|
children: t,
|
|
@@ -3533,11 +3535,11 @@ function Vr(e) {
|
|
|
3533
3535
|
contextValue: _t,
|
|
3534
3536
|
description: r,
|
|
3535
3537
|
error: I,
|
|
3536
|
-
hasCompoundLayout: w(() =>
|
|
3537
|
-
hasExternalField: !
|
|
3538
|
+
hasCompoundLayout: w(() => Cr(t), [t]),
|
|
3539
|
+
hasExternalField: !q && !!de,
|
|
3538
3540
|
hiddenInputs: vt,
|
|
3539
|
-
isDisabled:
|
|
3540
|
-
isRequired:
|
|
3541
|
+
isDisabled: Y,
|
|
3542
|
+
isRequired: be,
|
|
3541
3543
|
label: n,
|
|
3542
3544
|
resolvedSize: ve,
|
|
3543
3545
|
triggerId: J,
|
|
@@ -3552,7 +3554,7 @@ function Hr(e, t) {
|
|
|
3552
3554
|
var Ur = (e) => {
|
|
3553
3555
|
let { children: t, className: n, contentProps: r, contextValue: i, description: a, error: o, hasCompoundLayout: s, hasExternalField: c, hiddenInputs: l, isDisabled: p, isRequired: m, label: h, resolvedSize: g, triggerId: _, triggerProps: v } = Vr(e), y = w(() => /* @__PURE__ */ f($n, {
|
|
3554
3556
|
value: i,
|
|
3555
|
-
children: [l, s ? t : /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d(
|
|
3557
|
+
children: [l, s ? t : /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d(br, {}), /* @__PURE__ */ d(cr, { children: t })] })]
|
|
3556
3558
|
}), [
|
|
3557
3559
|
t,
|
|
3558
3560
|
i,
|
|
@@ -3562,7 +3564,7 @@ var Ur = (e) => {
|
|
|
3562
3564
|
value: i,
|
|
3563
3565
|
children: [
|
|
3564
3566
|
l,
|
|
3565
|
-
/* @__PURE__ */ d(
|
|
3567
|
+
/* @__PURE__ */ d(xr, { ...v }),
|
|
3566
3568
|
/* @__PURE__ */ d(lr, { ...r })
|
|
3567
3569
|
]
|
|
3568
3570
|
}), [
|
|
@@ -3571,7 +3573,7 @@ var Ur = (e) => {
|
|
|
3571
3573
|
l,
|
|
3572
3574
|
v
|
|
3573
3575
|
]);
|
|
3574
|
-
return c ? t ? y : b : /* @__PURE__ */ d(
|
|
3576
|
+
return c ? t ? y : b : /* @__PURE__ */ d(Br, {
|
|
3575
3577
|
id: _,
|
|
3576
3578
|
label: h,
|
|
3577
3579
|
description: a,
|
|
@@ -3599,7 +3601,7 @@ var Wr = ({ placeholder: e, className: t }) => {
|
|
|
3599
3601
|
className: sr.searchWrap,
|
|
3600
3602
|
children: [/* @__PURE__ */ d("input", {
|
|
3601
3603
|
ref: r,
|
|
3602
|
-
className:
|
|
3604
|
+
className: W(sr.search, t),
|
|
3603
3605
|
value: i,
|
|
3604
3606
|
placeholder: e ?? (n.command ? "Type a command..." : "Search..."),
|
|
3605
3607
|
"aria-label": "Search options",
|
|
@@ -3612,7 +3614,7 @@ var Wr = ({ placeholder: e, className: t }) => {
|
|
|
3612
3614
|
onClick: () => {
|
|
3613
3615
|
n.onSearchChange?.(""), r.current?.focus();
|
|
3614
3616
|
},
|
|
3615
|
-
children: /* @__PURE__ */ d(
|
|
3617
|
+
children: /* @__PURE__ */ d(j, {})
|
|
3616
3618
|
})]
|
|
3617
3619
|
});
|
|
3618
3620
|
};
|
|
@@ -3626,9 +3628,9 @@ nr(Gr, "separator"), Gr.displayName = "Select.Separator";
|
|
|
3626
3628
|
var Kr = ({ children: e, className: t }) => {
|
|
3627
3629
|
let { triggerProps: n } = er();
|
|
3628
3630
|
return /* @__PURE__ */ d("span", {
|
|
3629
|
-
className:
|
|
3631
|
+
className: W(Z.valueWrap, t),
|
|
3630
3632
|
children: /* @__PURE__ */ d("span", {
|
|
3631
|
-
className:
|
|
3633
|
+
className: W(Z.value, { [Z.placeholder]: n.isPlaceholder }),
|
|
3632
3634
|
children: e ?? n.displayText
|
|
3633
3635
|
})
|
|
3634
3636
|
});
|
|
@@ -3637,7 +3639,7 @@ nr(Kr, "value"), Kr.displayName = "Select.Value";
|
|
|
3637
3639
|
//#endregion
|
|
3638
3640
|
//#region src/components/Select/Select.tsx
|
|
3639
3641
|
var qr = Object.assign(Ur, {
|
|
3640
|
-
Trigger:
|
|
3642
|
+
Trigger: br,
|
|
3641
3643
|
Value: Kr,
|
|
3642
3644
|
Icon: mr,
|
|
3643
3645
|
Content: cr,
|
|
@@ -3678,7 +3680,7 @@ var Jr = g(null), Yr = () => {
|
|
|
3678
3680
|
tabIndex: 0,
|
|
3679
3681
|
"data-state": p ? "active" : "inactive",
|
|
3680
3682
|
"data-orientation": o,
|
|
3681
|
-
className:
|
|
3683
|
+
className: W(Xr.panel, p && Xr.visible, o === "vertical" && Xr.vertical, n),
|
|
3682
3684
|
children: t
|
|
3683
3685
|
}) : null;
|
|
3684
3686
|
};
|
|
@@ -3826,7 +3828,7 @@ var Qr = 8, $r = 360, ei = () => {
|
|
|
3826
3828
|
...n,
|
|
3827
3829
|
ref: r,
|
|
3828
3830
|
"aria-hidden": "true",
|
|
3829
|
-
className:
|
|
3831
|
+
className: W(ti.indicator, e),
|
|
3830
3832
|
style: {
|
|
3831
3833
|
...i,
|
|
3832
3834
|
...t
|
|
@@ -3845,7 +3847,7 @@ var ri = ({ children: e, className: t, scrollable: n, ...r }) => {
|
|
|
3845
3847
|
"data-orientation": a,
|
|
3846
3848
|
"data-variant": o,
|
|
3847
3849
|
"data-scrollable": s ? "" : void 0,
|
|
3848
|
-
className:
|
|
3850
|
+
className: W(ti.list, a === "vertical" && ti.vertical, o === "line" && ti.line, o === "pills" && ti.pills, o === "segmented" && ti.segmented, s && ti.scrollable, t),
|
|
3849
3851
|
children: e
|
|
3850
3852
|
});
|
|
3851
3853
|
};
|
|
@@ -3925,7 +3927,7 @@ var ii = (e) => [...e].sort((e, t) => {
|
|
|
3925
3927
|
tabs: "_tabs_1hj56_1",
|
|
3926
3928
|
vertical: "_vertical_1hj56_30"
|
|
3927
3929
|
}, ci = ({ children: e, value: t, defaultValue: n, onValueChange: r, orientation: i = "horizontal", activationMode: a = "automatic", dir: o = "ltr", loop: s = !0, mode: c = "tabs", variant: l = "line", color: u = "primary", size: f = "md", keepMounted: p = !1, lazyMount: m = !1, disabled: h = !1, className: g, ..._ }) => {
|
|
3928
|
-
let v = S(), b = t !== void 0, { value: C, setValue: w } =
|
|
3930
|
+
let v = S(), b = t !== void 0, { value: C, setValue: w } = ht({
|
|
3929
3931
|
value: t,
|
|
3930
3932
|
defaultValue: n,
|
|
3931
3933
|
onValueChange: r
|
|
@@ -4012,7 +4014,7 @@ var ii = (e) => [...e].sort((e, t) => {
|
|
|
4012
4014
|
value: z,
|
|
4013
4015
|
children: /* @__PURE__ */ d("div", {
|
|
4014
4016
|
..._,
|
|
4015
|
-
className:
|
|
4017
|
+
className: W(si.tabs, i === "vertical" && si.vertical, g),
|
|
4016
4018
|
"data-mode": c,
|
|
4017
4019
|
"data-orientation": i,
|
|
4018
4020
|
dir: o,
|
|
@@ -4041,14 +4043,14 @@ var li = {
|
|
|
4041
4043
|
pills: "_pills_1xafk_228",
|
|
4042
4044
|
vertical: "_vertical_1xafk_256"
|
|
4043
4045
|
}, ui = ({ children: e, className: t }) => /* @__PURE__ */ d("span", {
|
|
4044
|
-
className:
|
|
4046
|
+
className: W(li.badge, t),
|
|
4045
4047
|
children: e
|
|
4046
4048
|
});
|
|
4047
4049
|
ui.displayName = "Tabs.Badge";
|
|
4048
4050
|
//#endregion
|
|
4049
4051
|
//#region src/components/Tabs/Trigger/TabsIcon.tsx
|
|
4050
4052
|
var di = ({ children: e, className: t }) => /* @__PURE__ */ d("span", {
|
|
4051
|
-
className:
|
|
4053
|
+
className: W(li.icon, t),
|
|
4052
4054
|
"aria-hidden": "true",
|
|
4053
4055
|
children: e
|
|
4054
4056
|
});
|
|
@@ -4058,27 +4060,27 @@ di.displayName = "Tabs.Icon";
|
|
|
4058
4060
|
var fi = _(({ value: e, children: t, className: n, disabled: r = !1, asChild: i = !1, icon: a, badge: o, description: s, onClick: c, onKeyDown: l, ...m }, g) => {
|
|
4059
4061
|
let { value: _, focusedValue: b, setValue: x, setFocusedValue: S, mode: C, orientation: w, variant: T, size: E, disabled: D, registerTrigger: O, onTriggerKeyDown: k, getTriggerId: A, getContentId: j } = Yr(), M = D || r, N = _ === e, P = b === e || !b && N, F = i && v(t) ? t : void 0, I = F ? F.props.children : t, L = p.toArray(I), R = L.some((e) => v(e) && e.type.displayName === "Tabs.Icon"), z = !!a, B = (z || R) && I == null;
|
|
4060
4062
|
process.env.NODE_ENV !== "production" && z && R && console.warn(`Tabs.Trigger value "${e}" received both icon and Tabs.Icon. Tabs.Icon takes precedence.`);
|
|
4061
|
-
let
|
|
4063
|
+
let V = y((t) => {
|
|
4062
4064
|
O(e, t, M), typeof g == "function" ? g(t) : g && (g.current = t);
|
|
4063
4065
|
}, [
|
|
4064
4066
|
M,
|
|
4065
4067
|
g,
|
|
4066
4068
|
O,
|
|
4067
4069
|
e
|
|
4068
|
-
]),
|
|
4070
|
+
]), ee = z && !R || o || s, H = L.every((e) => typeof e == "string" || typeof e == "number"), U = W(li.trigger, li[T], li[E], w === "vertical" && li.vertical, z && li.withIcon, B && li.iconOnly, n), te = (t) => {
|
|
4069
4071
|
if (M) {
|
|
4070
4072
|
t.preventDefault();
|
|
4071
4073
|
return;
|
|
4072
4074
|
}
|
|
4073
4075
|
S(e), x(e);
|
|
4074
|
-
},
|
|
4076
|
+
}, ne = (e) => {
|
|
4075
4077
|
e.defaultPrevented || k(e);
|
|
4076
4078
|
};
|
|
4077
4079
|
return C === "navigation" && F ? h(F, {
|
|
4078
4080
|
...m,
|
|
4079
|
-
ref:
|
|
4081
|
+
ref: V,
|
|
4080
4082
|
id: A(e),
|
|
4081
|
-
className:
|
|
4083
|
+
className: W(F.props.className, U),
|
|
4082
4084
|
"aria-current": N ? "page" : void 0,
|
|
4083
4085
|
"aria-disabled": M || void 0,
|
|
4084
4086
|
"data-state": N ? "active" : "inactive",
|
|
@@ -4088,10 +4090,10 @@ var fi = _(({ value: e, children: t, className: n, disabled: r = !1, asChild: i
|
|
|
4088
4090
|
e.preventDefault();
|
|
4089
4091
|
return;
|
|
4090
4092
|
}
|
|
4091
|
-
|
|
4093
|
+
te(e);
|
|
4092
4094
|
},
|
|
4093
4095
|
onKeyDown: (e) => {
|
|
4094
|
-
F.props.onKeyDown?.(e), !e.defaultPrevented &&
|
|
4096
|
+
F.props.onKeyDown?.(e), !e.defaultPrevented && ne(e);
|
|
4095
4097
|
},
|
|
4096
4098
|
children: /* @__PURE__ */ f(u, { children: [
|
|
4097
4099
|
z && !R && /* @__PURE__ */ d("span", {
|
|
@@ -4099,7 +4101,7 @@ var fi = _(({ value: e, children: t, className: n, disabled: r = !1, asChild: i
|
|
|
4099
4101
|
"aria-hidden": "true",
|
|
4100
4102
|
children: a
|
|
4101
4103
|
}),
|
|
4102
|
-
I != null && (
|
|
4104
|
+
I != null && (ee ? /* @__PURE__ */ f("span", {
|
|
4103
4105
|
className: li.body,
|
|
4104
4106
|
children: [/* @__PURE__ */ d("span", {
|
|
4105
4107
|
className: li.label,
|
|
@@ -4119,7 +4121,7 @@ var fi = _(({ value: e, children: t, className: n, disabled: r = !1, asChild: i
|
|
|
4119
4121
|
] })
|
|
4120
4122
|
}) : (process.env.NODE_ENV !== "production" && C === "tabs" && i && console.warn("Tabs.Trigger: asChild is only supported when Tabs mode=\"navigation\"."), process.env.NODE_ENV !== "production" && C === "navigation" && i && !F && console.warn("Tabs.Trigger: asChild requires a single valid React element child."), /* @__PURE__ */ f("button", {
|
|
4121
4123
|
...m,
|
|
4122
|
-
ref:
|
|
4124
|
+
ref: V,
|
|
4123
4125
|
type: "button",
|
|
4124
4126
|
role: "tab",
|
|
4125
4127
|
id: A(e),
|
|
@@ -4130,12 +4132,12 @@ var fi = _(({ value: e, children: t, className: n, disabled: r = !1, asChild: i
|
|
|
4130
4132
|
"data-state": N ? "active" : "inactive",
|
|
4131
4133
|
"data-orientation": w,
|
|
4132
4134
|
"data-disabled": M ? "" : void 0,
|
|
4133
|
-
className:
|
|
4135
|
+
className: U,
|
|
4134
4136
|
onClick: (e) => {
|
|
4135
|
-
c?.(e), !e.defaultPrevented &&
|
|
4137
|
+
c?.(e), !e.defaultPrevented && te(e);
|
|
4136
4138
|
},
|
|
4137
4139
|
onKeyDown: (e) => {
|
|
4138
|
-
l?.(e), !e.defaultPrevented &&
|
|
4140
|
+
l?.(e), !e.defaultPrevented && ne(e);
|
|
4139
4141
|
},
|
|
4140
4142
|
children: [
|
|
4141
4143
|
z && !R && /* @__PURE__ */ d("span", {
|
|
@@ -4143,7 +4145,7 @@ var fi = _(({ value: e, children: t, className: n, disabled: r = !1, asChild: i
|
|
|
4143
4145
|
"aria-hidden": "true",
|
|
4144
4146
|
children: a
|
|
4145
4147
|
}),
|
|
4146
|
-
I != null && (
|
|
4148
|
+
I != null && (ee ? /* @__PURE__ */ f("span", {
|
|
4147
4149
|
className: li.body,
|
|
4148
4150
|
children: [/* @__PURE__ */ d("span", {
|
|
4149
4151
|
className: li.label,
|
|
@@ -4238,7 +4240,7 @@ var Si = {
|
|
|
4238
4240
|
return /* @__PURE__ */ f("div", {
|
|
4239
4241
|
...c,
|
|
4240
4242
|
ref: hi(o, s.setContentRef),
|
|
4241
|
-
className:
|
|
4243
|
+
className: W(Si.tooltip, r),
|
|
4242
4244
|
"data-placement": s.placement,
|
|
4243
4245
|
"data-state": s.open ? "open" : "closed",
|
|
4244
4246
|
style: {
|
|
@@ -4281,25 +4283,25 @@ function Ti(e, t) {
|
|
|
4281
4283
|
//#endregion
|
|
4282
4284
|
//#region src/components/Tooltip/internal/useTooltipInteractions.ts
|
|
4283
4285
|
function Ei({ context: e, delay: t, disabled: n, interactive: r }) {
|
|
4284
|
-
let i =
|
|
4286
|
+
let i = H(e, {
|
|
4285
4287
|
delay: t,
|
|
4286
4288
|
enabled: !n,
|
|
4287
4289
|
move: !1,
|
|
4288
4290
|
handleClose: r ? void 0 : null
|
|
4289
|
-
}), a =
|
|
4290
|
-
return
|
|
4291
|
+
}), a = ee(e, { enabled: !n });
|
|
4292
|
+
return U([i, a]);
|
|
4291
4293
|
}
|
|
4292
4294
|
//#endregion
|
|
4293
4295
|
//#region src/components/Tooltip/internal/useTooltipPosition.ts
|
|
4294
4296
|
function Di({ open: e, onOpenChange: t, placement: n, offset: r, avoidCollisions: i, matchTriggerWidth: a }) {
|
|
4295
|
-
let o = T(null), s =
|
|
4297
|
+
let o = T(null), s = nt({
|
|
4296
4298
|
open: e,
|
|
4297
4299
|
onOpenChange: t,
|
|
4298
4300
|
placement: n,
|
|
4299
4301
|
offset: r,
|
|
4300
4302
|
avoidCollisions: i,
|
|
4301
4303
|
matchTriggerWidth: a,
|
|
4302
|
-
middleware: [
|
|
4304
|
+
middleware: [F({ element: o })]
|
|
4303
4305
|
});
|
|
4304
4306
|
return {
|
|
4305
4307
|
...s,
|
|
@@ -4311,7 +4313,7 @@ function Di({ open: e, onOpenChange: t, placement: n, offset: r, avoidCollisions
|
|
|
4311
4313
|
//#endregion
|
|
4312
4314
|
//#region src/components/Tooltip/Root/TooltipRoot.tsx
|
|
4313
4315
|
var Oi = ({ children: e, open: t, defaultOpen: n = !1, onOpenChange: r, placement: i = "top", offset: a = 8, delay: o, skipDelay: s, disabled: c = !1, interactive: l = !1, avoidCollisions: u = !0, matchTriggerWidth: f = !1 }) => {
|
|
4314
|
-
let p = `${S()}-content`, m = T(null), h = T(null), [g, _] =
|
|
4316
|
+
let p = `${S()}-content`, m = T(null), h = T(null), [g, _] = ut({
|
|
4315
4317
|
value: t,
|
|
4316
4318
|
defaultValue: n,
|
|
4317
4319
|
onChange: r
|
|
@@ -4329,7 +4331,7 @@ var Oi = ({ children: e, open: t, defaultOpen: n = !1, onOpenChange: r, placemen
|
|
|
4329
4331
|
delay: b,
|
|
4330
4332
|
disabled: c,
|
|
4331
4333
|
interactive: l
|
|
4332
|
-
}), C =
|
|
4334
|
+
}), C = tt({
|
|
4333
4335
|
active: g,
|
|
4334
4336
|
id: p,
|
|
4335
4337
|
zIndexLevel: "tooltip",
|
|
@@ -4375,7 +4377,7 @@ var ki = ({ asChild: e = !1, children: t, disabled: n = !1, className: r, ...i }
|
|
|
4375
4377
|
}), l = {
|
|
4376
4378
|
...c,
|
|
4377
4379
|
ref: o ? hi(o.props.ref, a.setTriggerRef) : a.setTriggerRef,
|
|
4378
|
-
className:
|
|
4380
|
+
className: W(o?.props.className, r),
|
|
4379
4381
|
disabled: s || void 0,
|
|
4380
4382
|
onMouseEnter: mi(o?.props.onMouseEnter, c.onMouseEnter),
|
|
4381
4383
|
onMouseLeave: mi(o?.props.onMouseLeave, c.onMouseLeave),
|
|
@@ -4428,18 +4430,18 @@ var ji = {
|
|
|
4428
4430
|
badge: "_badge_tqwey_799",
|
|
4429
4431
|
shortcut: "_shortcut_tqwey_813"
|
|
4430
4432
|
}, Mi = _(({ children: e, color: t = "primary", appearance: n = "solid", size: r = "md", shape: i = "pill", type: a = "button", disabled: o = !1, loading: s = !1, loadingText: c, iconStart: l, iconEnd: p, spinner: m, badge: g, shortcut: _, tooltip: y, fullWidth: b = !1, iconOnly: x = !1, asChild: S = !1, className: C, style: w, onClick: T, "aria-label": E, "aria-labelledby": D, href: O, target: k, rel: A, download: j, id: M, role: N, tabIndex: P, ...F }, I) => {
|
|
4431
|
-
let L = S && v(e) ? e : void 0, R = L ? L.props.children : e, z = x || !R && !!(l || p),
|
|
4432
|
-
"--button-height": `${
|
|
4433
|
-
"--button-font-size": `${
|
|
4434
|
-
"--button-line-height": `${
|
|
4435
|
-
"--icon-size": `${
|
|
4436
|
-
},
|
|
4433
|
+
let L = S && v(e) ? e : void 0, R = L ? L.props.children : e, z = x || !R && !!(l || p), B = !!(E || D || L?.props["aria-label"] || L?.props["aria-labelledby"]), V = o || s, ee = te[r], H = {
|
|
4434
|
+
"--button-height": `${ee.height}px`,
|
|
4435
|
+
"--button-font-size": `${ee.fontSize}px`,
|
|
4436
|
+
"--button-line-height": `${ee.lineHeight}px`,
|
|
4437
|
+
"--icon-size": `${ee.iconSize}px`
|
|
4438
|
+
}, U = s && c ? c : R, ne = c && R && !z && (typeof R == "string" || typeof R == "number") && (typeof c == "string" || typeof c == "number") ? String(s ? R : c) : void 0, re = k === "_blank" && !A ? "noreferrer noopener" : A, ie = W(ji.button, ji[t], ji[n], ji[r], ji[i], C, {
|
|
4437
4439
|
[ji.disabled]: V,
|
|
4438
4440
|
[ji.loading]: s,
|
|
4439
4441
|
[ji.fullWidth]: b,
|
|
4440
4442
|
[ji.iconOnly]: z
|
|
4441
4443
|
});
|
|
4442
|
-
|
|
4444
|
+
be(!S || !O, "Button: pass href to the child element when using asChild."), be(!S || !!L, "Button: asChild requires a single valid React element child."), be(!z || B, "Button: icon-only buttons must provide aria-label or aria-labelledby.");
|
|
4443
4445
|
let G = (e) => {
|
|
4444
4446
|
e.preventDefault(), e.stopPropagation();
|
|
4445
4447
|
}, K = (e) => {
|
|
@@ -4461,12 +4463,12 @@ var ji = {
|
|
|
4461
4463
|
className: ji.icon,
|
|
4462
4464
|
children: l
|
|
4463
4465
|
}),
|
|
4464
|
-
|
|
4466
|
+
U && !z && /* @__PURE__ */ d("span", {
|
|
4465
4467
|
className: ji.label,
|
|
4466
|
-
"data-measure":
|
|
4468
|
+
"data-measure": ne,
|
|
4467
4469
|
children: /* @__PURE__ */ d("span", {
|
|
4468
4470
|
className: ji.labelText,
|
|
4469
|
-
children:
|
|
4471
|
+
children: U
|
|
4470
4472
|
})
|
|
4471
4473
|
}),
|
|
4472
4474
|
g && !z && /* @__PURE__ */ d("span", {
|
|
@@ -4486,7 +4488,7 @@ var ji = {
|
|
|
4486
4488
|
...F,
|
|
4487
4489
|
ref: I,
|
|
4488
4490
|
style: {
|
|
4489
|
-
...
|
|
4491
|
+
...H,
|
|
4490
4492
|
...L.props.style,
|
|
4491
4493
|
...w
|
|
4492
4494
|
},
|
|
@@ -4494,7 +4496,7 @@ var ji = {
|
|
|
4494
4496
|
"aria-disabled": V || void 0,
|
|
4495
4497
|
"aria-label": E || L.props["aria-label"] || void 0,
|
|
4496
4498
|
"aria-labelledby": D || L.props["aria-labelledby"] || void 0,
|
|
4497
|
-
className:
|
|
4499
|
+
className: W(L.props.className, ie),
|
|
4498
4500
|
href: V ? void 0 : L.props.href,
|
|
4499
4501
|
onClick: K,
|
|
4500
4502
|
tabIndex: V ? -1 : L.props.tabIndex,
|
|
@@ -4507,17 +4509,17 @@ var ji = {
|
|
|
4507
4509
|
role: N,
|
|
4508
4510
|
tabIndex: V ? -1 : P,
|
|
4509
4511
|
target: k,
|
|
4510
|
-
rel:
|
|
4512
|
+
rel: re,
|
|
4511
4513
|
download: j,
|
|
4512
4514
|
onClick: V ? G : T,
|
|
4513
4515
|
"aria-disabled": V || void 0,
|
|
4514
4516
|
"aria-label": E || void 0,
|
|
4515
4517
|
"aria-labelledby": D || void 0,
|
|
4516
4518
|
"aria-busy": s || void 0,
|
|
4517
|
-
className:
|
|
4519
|
+
className: ie,
|
|
4518
4520
|
title: y,
|
|
4519
4521
|
style: {
|
|
4520
|
-
...
|
|
4522
|
+
...H,
|
|
4521
4523
|
...w
|
|
4522
4524
|
},
|
|
4523
4525
|
children: ae
|
|
@@ -4533,10 +4535,10 @@ var ji = {
|
|
|
4533
4535
|
"aria-label": E || void 0,
|
|
4534
4536
|
"aria-labelledby": D || void 0,
|
|
4535
4537
|
"aria-busy": s || void 0,
|
|
4536
|
-
className:
|
|
4538
|
+
className: ie,
|
|
4537
4539
|
title: y,
|
|
4538
4540
|
style: {
|
|
4539
|
-
...
|
|
4541
|
+
...H,
|
|
4540
4542
|
...w
|
|
4541
4543
|
},
|
|
4542
4544
|
children: ae
|
|
@@ -4597,63 +4599,63 @@ var Q = {
|
|
|
4597
4599
|
warning: Q.colorWarning,
|
|
4598
4600
|
danger: Q.colorDanger
|
|
4599
4601
|
}, Li = _(({ id: e, label: t, description: n, icon: r, indeterminateIcon: i, checked: a, size: o = "md", color: s = "primary", labelPosition: c = "end", defaultChecked: l = !1, disabled: u = !1, required: p = !1, indeterminate: m = !1, className: h, wrapperClassName: g, onCheckedChange: _, error: v, "aria-label": b, "aria-labelledby": C, "aria-describedby": w, ...E }, D) => {
|
|
4600
|
-
let
|
|
4602
|
+
let k = S(), A = e ?? k, j = T(null), M = !!v, N = n ? `${A}-description` : void 0, P = M ? `${A}-error` : void 0, F = [
|
|
4601
4603
|
w,
|
|
4602
|
-
|
|
4603
|
-
|
|
4604
|
-
].filter(Boolean).join(" "), [
|
|
4604
|
+
N,
|
|
4605
|
+
P
|
|
4606
|
+
].filter(Boolean).join(" "), [I, L] = ut({
|
|
4605
4607
|
value: a,
|
|
4606
4608
|
defaultValue: l,
|
|
4607
4609
|
onChange: _
|
|
4608
|
-
}),
|
|
4609
|
-
if (
|
|
4610
|
+
}), R = y((e) => {
|
|
4611
|
+
if (j.current = e, typeof D == "function") {
|
|
4610
4612
|
D(e);
|
|
4611
4613
|
return;
|
|
4612
4614
|
}
|
|
4613
4615
|
D && (D.current = e);
|
|
4614
4616
|
}, [D]);
|
|
4615
4617
|
x(() => {
|
|
4616
|
-
|
|
4618
|
+
j.current && (j.current.indeterminate = m);
|
|
4617
4619
|
}, [m]);
|
|
4618
|
-
let
|
|
4619
|
-
|
|
4620
|
+
let z = (e) => {
|
|
4621
|
+
L(e.target.checked);
|
|
4620
4622
|
};
|
|
4621
|
-
return
|
|
4622
|
-
className:
|
|
4623
|
+
return be(!!(t || b || C), "Checkbox: an accessible label must be provided through label, aria-label, or aria-labelledby."), /* @__PURE__ */ f("div", {
|
|
4624
|
+
className: W(Q.container, Fi[o], c === "start" && Q.containerLabelStart, h),
|
|
4623
4625
|
children: [
|
|
4624
4626
|
/* @__PURE__ */ f("label", {
|
|
4625
|
-
htmlFor:
|
|
4626
|
-
className:
|
|
4627
|
+
htmlFor: A,
|
|
4628
|
+
className: W(Q.wrapper, Pi[o], Ii[s], c === "start" && Q.labelStart, !t && Q.iconOnly, u && Q.disabled, g),
|
|
4627
4629
|
children: [
|
|
4628
4630
|
/* @__PURE__ */ d("input", {
|
|
4629
4631
|
...E,
|
|
4630
|
-
ref:
|
|
4631
|
-
id:
|
|
4632
|
+
ref: R,
|
|
4633
|
+
id: A,
|
|
4632
4634
|
type: "checkbox",
|
|
4633
|
-
checked:
|
|
4635
|
+
checked: I,
|
|
4634
4636
|
disabled: u,
|
|
4635
4637
|
required: p,
|
|
4636
|
-
onChange:
|
|
4638
|
+
onChange: z,
|
|
4637
4639
|
className: Q.input,
|
|
4638
4640
|
"aria-label": b,
|
|
4639
4641
|
"aria-labelledby": C,
|
|
4640
4642
|
"aria-checked": m ? "mixed" : E["aria-checked"],
|
|
4641
|
-
"aria-invalid":
|
|
4642
|
-
"aria-describedby":
|
|
4643
|
+
"aria-invalid": M ? !0 : E["aria-invalid"],
|
|
4644
|
+
"aria-describedby": F || void 0
|
|
4643
4645
|
}),
|
|
4644
4646
|
/* @__PURE__ */ d("span", {
|
|
4645
|
-
className:
|
|
4647
|
+
className: W(Q.customCheckbox, M && Q.error, m && Q.indeterminate),
|
|
4646
4648
|
"aria-hidden": "true",
|
|
4647
4649
|
children: m ? /* @__PURE__ */ d("span", {
|
|
4648
|
-
className:
|
|
4650
|
+
className: W(Q.indeterminateMark, i && Q.customMark),
|
|
4649
4651
|
children: i
|
|
4650
|
-
}) :
|
|
4652
|
+
}) : I && /* @__PURE__ */ d("span", {
|
|
4651
4653
|
className: Q.checkmark,
|
|
4652
|
-
children: r ?? /* @__PURE__ */ d(
|
|
4654
|
+
children: r ?? /* @__PURE__ */ d(O, {})
|
|
4653
4655
|
})
|
|
4654
4656
|
}),
|
|
4655
4657
|
t && /* @__PURE__ */ f("span", {
|
|
4656
|
-
className:
|
|
4658
|
+
className: W(Q.label, Ni[o]),
|
|
4657
4659
|
children: [t, p && /* @__PURE__ */ d("span", {
|
|
4658
4660
|
className: Q.requiredMark,
|
|
4659
4661
|
"aria-hidden": "true",
|
|
@@ -4663,12 +4665,12 @@ var Q = {
|
|
|
4663
4665
|
]
|
|
4664
4666
|
}),
|
|
4665
4667
|
n && /* @__PURE__ */ d("span", {
|
|
4666
|
-
id:
|
|
4668
|
+
id: N,
|
|
4667
4669
|
className: Q.descriptionText,
|
|
4668
4670
|
children: n
|
|
4669
4671
|
}),
|
|
4670
|
-
|
|
4671
|
-
id:
|
|
4672
|
+
M && /* @__PURE__ */ d("span", {
|
|
4673
|
+
id: P,
|
|
4672
4674
|
className: Q.errorText,
|
|
4673
4675
|
children: v
|
|
4674
4676
|
})
|
|
@@ -4747,136 +4749,136 @@ var $ = {
|
|
|
4747
4749
|
r < n.length && (i += e);
|
|
4748
4750
|
}
|
|
4749
4751
|
return i;
|
|
4750
|
-
}, Vi = (e, t) => t ? typeof t == "function" ? t(e) : Bi(e, t) : e, Hi = _(({ id: e, label: t, name: n, description: r, placeholder: i, value: a, defaultValue: o, type: s = "text", size: c, color: l = "primary", variant: p = "outline", error: m, invalid: h = !1, disabled: g = !1, required: _ = !1, loading: v = !1, className: b, style: x, wrapperClassName: C, autoComplete: w, readOnly: D = !1, clearable: O = !1, onClear: k, onValueChange: A, revealPassword: j = !1, showCounter:
|
|
4751
|
-
let
|
|
4752
|
-
"--input-height": `${
|
|
4753
|
-
"--input-font-size": `${
|
|
4754
|
-
"--input-line-height": `${
|
|
4755
|
-
"--input-icon-size": `${
|
|
4756
|
-
},
|
|
4752
|
+
}, Vi = (e, t) => t ? typeof t == "function" ? t(e) : Bi(e, t) : e, Hi = _(({ id: e, label: t, name: n, description: r, placeholder: i, value: a, defaultValue: o, type: s = "text", size: c, color: l = "primary", variant: p = "outline", error: m, invalid: h = !1, disabled: g = !1, required: _ = !1, loading: v = !1, className: b, style: x, wrapperClassName: C, autoComplete: w, readOnly: D = !1, clearable: O = !1, onClear: k, onValueChange: A, revealPassword: j = !1, showCounter: N = !1, startIcon: P, endIcon: F, startAddon: I, endAddon: L, prefix: R, suffix: z, clearIcon: B, mask: V, format: ee, parse: H, startIconTone: U = "default", endIconTone: ne = "default", clearIconTone: re = "danger", autoFocus: ie, maxLength: G, onMouseEnter: K, onMouseLeave: ae, "aria-describedby": oe, "aria-invalid": se, "aria-labelledby": ce, ...le }, ue) => {
|
|
4753
|
+
let de = S(), q = Ar(), J = !!(t || r || m), fe = e ?? (J ? void 0 : q?.controlId) ?? de, pe = T(null), [me, he] = E(!1), [ge, _e] = E(o ?? ""), ve = a !== void 0, ye = String((ve ? a : ge) ?? ""), Y = ee ? ee(ye) : ye, be = ye.length > 0, xe = c ?? q?.size ?? "md", Se = te[xe], Ce = {
|
|
4754
|
+
"--input-height": `${Se.height}px`,
|
|
4755
|
+
"--input-font-size": `${Se.fontSize}px`,
|
|
4756
|
+
"--input-line-height": `${Se.lineHeight}px`,
|
|
4757
|
+
"--input-icon-size": `${Se.iconSize}px`
|
|
4758
|
+
}, we = h || !!m || !J && !!q?.invalid, Te = g || !J && !!q?.disabled, Ee = _ || !J && !!q?.required, De = D || v, Oe = s === "password", ke = Oe && j && me ? "text" : s, Ae = P ?? (s === "search" ? /* @__PURE__ */ d(M, {}) : null), je = F, Me = zi(s, w), Ne = v && !Te, Pe = O && be && !Te && !De && !Ne, X = j && Oe && !Te && !Ne && !Pe, Fe = !Ne && !Pe && !X && !!je, Ie = !!(N && G), Le = r ? `${fe}-description` : void 0, Re = m ? `${fe}-error` : void 0, ze = Ie ? `${fe}-counter` : void 0, Be = [
|
|
4757
4759
|
oe,
|
|
4758
|
-
!J && !oe ?
|
|
4759
|
-
|
|
4760
|
-
|
|
4761
|
-
|
|
4762
|
-
].filter(Boolean).join(" "),
|
|
4763
|
-
if (pe.current = e, typeof
|
|
4764
|
-
|
|
4760
|
+
!J && !oe ? q?.ariaDescribedBy : void 0,
|
|
4761
|
+
Le,
|
|
4762
|
+
Re,
|
|
4763
|
+
ze
|
|
4764
|
+
].filter(Boolean).join(" "), Ve = B ?? "×", He = !!(Ae || R), Ue = !!(je || z || Pe || X || Ne), We = !!(Ae && R), Ge = !!(je && z), Ke = !!(I || L), qe = y((e) => {
|
|
4765
|
+
if (pe.current = e, typeof ue == "function") {
|
|
4766
|
+
ue(e);
|
|
4765
4767
|
return;
|
|
4766
4768
|
}
|
|
4767
|
-
|
|
4768
|
-
}, [
|
|
4769
|
-
let t = Vi(H ? H(e.target.value) : e.target.value,
|
|
4769
|
+
ue && (ue.current = e);
|
|
4770
|
+
}, [ue]), Je = y((e) => {
|
|
4771
|
+
let t = Vi(H ? H(e.target.value) : e.target.value, V);
|
|
4770
4772
|
ve || _e(t), A?.(t);
|
|
4771
4773
|
}, [
|
|
4772
4774
|
ve,
|
|
4773
|
-
|
|
4775
|
+
V,
|
|
4774
4776
|
A,
|
|
4775
4777
|
H
|
|
4776
|
-
]),
|
|
4778
|
+
]), Ye = y(() => {
|
|
4777
4779
|
ve || _e(""), A?.(""), k?.(), pe.current?.focus();
|
|
4778
4780
|
}, [
|
|
4779
4781
|
ve,
|
|
4780
4782
|
k,
|
|
4781
4783
|
A
|
|
4782
|
-
]),
|
|
4783
|
-
className:
|
|
4784
|
-
[$.hasAddons]:
|
|
4785
|
-
[$.isDisabled]:
|
|
4786
|
-
[$.isInvalid]:
|
|
4787
|
-
[$.isLoading]:
|
|
4784
|
+
]), Xe = /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ f("div", {
|
|
4785
|
+
className: W($.inputGroup, $[p], $[l], {
|
|
4786
|
+
[$.hasAddons]: Ke,
|
|
4787
|
+
[$.isDisabled]: Te,
|
|
4788
|
+
[$.isInvalid]: we,
|
|
4789
|
+
[$.isLoading]: Ne
|
|
4788
4790
|
}),
|
|
4789
4791
|
children: [
|
|
4790
|
-
|
|
4792
|
+
I && /* @__PURE__ */ d("span", {
|
|
4791
4793
|
className: $.addon,
|
|
4792
|
-
children:
|
|
4794
|
+
children: I
|
|
4793
4795
|
}),
|
|
4794
4796
|
/* @__PURE__ */ f("div", {
|
|
4795
|
-
className:
|
|
4796
|
-
[$.hasLeftAdornment]:
|
|
4797
|
-
[$.hasRightAdornment]:
|
|
4798
|
-
[$.hasStartIconAndPrefix]:
|
|
4799
|
-
[$.hasEndIconAndSuffix]:
|
|
4797
|
+
className: W($.inputWrapper, {
|
|
4798
|
+
[$.hasLeftAdornment]: He,
|
|
4799
|
+
[$.hasRightAdornment]: Ue,
|
|
4800
|
+
[$.hasStartIconAndPrefix]: We,
|
|
4801
|
+
[$.hasEndIconAndSuffix]: Ge
|
|
4800
4802
|
}),
|
|
4801
4803
|
children: [
|
|
4802
|
-
|
|
4804
|
+
Ae && /* @__PURE__ */ d("span", {
|
|
4803
4805
|
"aria-hidden": "true",
|
|
4804
|
-
className:
|
|
4805
|
-
children:
|
|
4806
|
+
className: W($.startAdornment, Ri[U]),
|
|
4807
|
+
children: Ae
|
|
4806
4808
|
}),
|
|
4807
|
-
|
|
4809
|
+
R && /* @__PURE__ */ d("span", {
|
|
4808
4810
|
className: $.prefix,
|
|
4809
|
-
children:
|
|
4811
|
+
children: R
|
|
4810
4812
|
}),
|
|
4811
4813
|
/* @__PURE__ */ d("input", {
|
|
4812
|
-
...
|
|
4813
|
-
ref:
|
|
4814
|
+
...le,
|
|
4815
|
+
ref: qe,
|
|
4814
4816
|
id: fe,
|
|
4815
4817
|
name: n,
|
|
4816
|
-
type:
|
|
4817
|
-
autoComplete:
|
|
4818
|
-
className:
|
|
4818
|
+
type: ke,
|
|
4819
|
+
autoComplete: Me,
|
|
4820
|
+
className: W($.input, $[xe], { [$.error]: we }, b),
|
|
4819
4821
|
style: {
|
|
4820
|
-
...
|
|
4822
|
+
...Ce,
|
|
4821
4823
|
...x
|
|
4822
4824
|
},
|
|
4823
|
-
value:
|
|
4824
|
-
onChange:
|
|
4825
|
+
value: Y,
|
|
4826
|
+
onChange: Je,
|
|
4825
4827
|
placeholder: i,
|
|
4826
|
-
disabled:
|
|
4827
|
-
readOnly:
|
|
4828
|
-
required:
|
|
4829
|
-
autoFocus:
|
|
4828
|
+
disabled: Te,
|
|
4829
|
+
readOnly: De,
|
|
4830
|
+
required: Ee,
|
|
4831
|
+
autoFocus: ie,
|
|
4830
4832
|
maxLength: G,
|
|
4831
|
-
"aria-invalid":
|
|
4832
|
-
"aria-labelledby": ce ?? (J ? void 0 :
|
|
4833
|
-
"aria-describedby":
|
|
4833
|
+
"aria-invalid": we ? !0 : se,
|
|
4834
|
+
"aria-labelledby": ce ?? (J ? void 0 : q?.ariaLabelledBy),
|
|
4835
|
+
"aria-describedby": Be || void 0,
|
|
4834
4836
|
"aria-busy": v || void 0,
|
|
4835
4837
|
onMouseEnter: K,
|
|
4836
4838
|
onMouseLeave: ae
|
|
4837
4839
|
}),
|
|
4838
|
-
|
|
4840
|
+
z && /* @__PURE__ */ d("span", {
|
|
4839
4841
|
className: $.suffix,
|
|
4840
|
-
children:
|
|
4842
|
+
children: z
|
|
4841
4843
|
}),
|
|
4842
4844
|
/* @__PURE__ */ f("div", {
|
|
4843
4845
|
className: $.endSlot,
|
|
4844
4846
|
children: [
|
|
4845
|
-
|
|
4847
|
+
Ne && /* @__PURE__ */ d("span", {
|
|
4846
4848
|
className: $.spinner,
|
|
4847
4849
|
"aria-hidden": "true",
|
|
4848
4850
|
"data-testid": "input-spinner"
|
|
4849
4851
|
}),
|
|
4850
|
-
|
|
4852
|
+
X && /* @__PURE__ */ d("button", {
|
|
4851
4853
|
type: "button",
|
|
4852
4854
|
className: $.iconButton,
|
|
4853
4855
|
onClick: () => he((e) => !e),
|
|
4854
4856
|
"aria-label": me ? "Hide password" : "Show password",
|
|
4855
4857
|
children: me ? "Hide" : "Show"
|
|
4856
4858
|
}),
|
|
4857
|
-
|
|
4859
|
+
Pe && /* @__PURE__ */ d("button", {
|
|
4858
4860
|
type: "button",
|
|
4859
|
-
className:
|
|
4860
|
-
onClick:
|
|
4861
|
+
className: W($.clearButton, Ri[re]),
|
|
4862
|
+
onClick: Ye,
|
|
4861
4863
|
"aria-label": "Clear input",
|
|
4862
|
-
children:
|
|
4864
|
+
children: Ve
|
|
4863
4865
|
}),
|
|
4864
|
-
|
|
4866
|
+
Fe && je && /* @__PURE__ */ d("span", {
|
|
4865
4867
|
"aria-hidden": "true",
|
|
4866
|
-
className:
|
|
4867
|
-
children:
|
|
4868
|
+
className: W($.endAdornment, Ri[ne]),
|
|
4869
|
+
children: je
|
|
4868
4870
|
})
|
|
4869
4871
|
]
|
|
4870
4872
|
})
|
|
4871
4873
|
]
|
|
4872
4874
|
}),
|
|
4873
|
-
|
|
4875
|
+
L && /* @__PURE__ */ d("span", {
|
|
4874
4876
|
className: $.addon,
|
|
4875
|
-
children:
|
|
4877
|
+
children: L
|
|
4876
4878
|
})
|
|
4877
4879
|
]
|
|
4878
|
-
}),
|
|
4879
|
-
id:
|
|
4880
|
+
}), Ie && /* @__PURE__ */ f("div", {
|
|
4881
|
+
id: ze,
|
|
4880
4882
|
className: $.counter,
|
|
4881
4883
|
children: [
|
|
4882
4884
|
ye.length,
|
|
@@ -4884,25 +4886,25 @@ var $ = {
|
|
|
4884
4886
|
G
|
|
4885
4887
|
]
|
|
4886
4888
|
})] });
|
|
4887
|
-
return !J &&
|
|
4889
|
+
return !J && q ? Xe : /* @__PURE__ */ d(Br, {
|
|
4888
4890
|
id: fe,
|
|
4889
4891
|
label: t,
|
|
4890
4892
|
description: r,
|
|
4891
4893
|
error: m,
|
|
4892
|
-
required:
|
|
4893
|
-
disabled:
|
|
4894
|
-
invalid:
|
|
4895
|
-
size:
|
|
4894
|
+
required: Ee,
|
|
4895
|
+
disabled: Te,
|
|
4896
|
+
invalid: we,
|
|
4897
|
+
size: xe,
|
|
4896
4898
|
className: C,
|
|
4897
4899
|
bindControl: !1,
|
|
4898
|
-
children:
|
|
4900
|
+
children: Xe
|
|
4899
4901
|
});
|
|
4900
4902
|
});
|
|
4901
4903
|
Hi.displayName = "Input";
|
|
4902
4904
|
//#endregion
|
|
4903
4905
|
//#region src/theme/ThemeContext.ts
|
|
4904
4906
|
var Ui = g(null), Wi = (e) => e === "highContrast" ? "high-contrast" : e, Gi = ({ theme: e, defaultTheme: t = "light", onThemeChange: n, syncDocument: r = !0, children: i }) => {
|
|
4905
|
-
let [a, o] =
|
|
4907
|
+
let [a, o] = ut({
|
|
4906
4908
|
value: e,
|
|
4907
4909
|
defaultValue: t,
|
|
4908
4910
|
onChange: n
|
|
@@ -4939,4 +4941,4 @@ function Ki() {
|
|
|
4939
4941
|
return e;
|
|
4940
4942
|
}
|
|
4941
4943
|
//#endregion
|
|
4942
|
-
export { Mi as Button, Li as Checkbox, Vt as Dropdown,
|
|
4944
|
+
export { Mi as Button, Li as Checkbox, Vt as Dropdown, Br as FormField, Hi as Input, _n as Modal, In as Popover, vt as Portal, _t as PortalProvider, Hn as Radio, Zn as RadioGroup, qr as Select, pi as Tabs, Gi as ThemeProvider, Ai as Tooltip, Ki as useTheme };
|