@vellira-ui/react 2.56.0 → 2.58.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.js +1498 -1296
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,23 +1,24 @@
|
|
|
1
1
|
import e from "clsx";
|
|
2
2
|
import { Fragment as t, jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
3
|
-
import { Children as i, Fragment as a, cloneElement as o, createContext as s, forwardRef as c, isValidElement as l, useCallback as u, useContext as d, useEffect as f, useId as p, useLayoutEffect as m, useMemo as h, useRef as g, useState as _ } from "react";
|
|
4
|
-
import { createPortal as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { lightTheme as
|
|
3
|
+
import { Children as i, Fragment as a, cloneElement as o, createContext as s, forwardRef as c, isValidElement as l, useCallback as u, useContext as d, useEffect as f, useId as p, useLayoutEffect as m, useMemo as h, useRef as g, useState as _, useSyncExternalStore as v } from "react";
|
|
4
|
+
import { createPortal as y } from "react-dom";
|
|
5
|
+
import { FloatingArrow as b, arrow as x, autoUpdate as S, flip as C, offset as w, shift as T, size as E, useFloating as D, useFocus as O, useHover as k, useInteractions as A } from "@floating-ui/react";
|
|
6
|
+
import { createConsoleOverlayDiagnostics as j, createOverlayStack as M, createOverlayZIndexPolicy as N, getTopOverlay as P, resolveOverlayZIndex as F } from "@vellira-ui/core";
|
|
7
|
+
import { lightTheme as I } from "@vellira-ui/tokens";
|
|
8
|
+
import { Check as L, ChevronDown as R, ChevronRight as z, Close as B, Search as ee } from "@vellira-ui/icons";
|
|
8
9
|
//#region src/utils/cn.ts
|
|
9
|
-
var
|
|
10
|
+
var V = (...t) => e(t), te = { arrow: "_arrow_8b0vb_1" }, H = ({ className: e }) => /* @__PURE__ */ n("span", {
|
|
10
11
|
"aria-hidden": "true",
|
|
11
|
-
className:
|
|
12
|
+
className: V(te.arrow, e)
|
|
12
13
|
});
|
|
13
|
-
|
|
14
|
+
H.__velliraDropdownPart = "arrow", H.displayName = "Dropdown.Arrow";
|
|
14
15
|
//#endregion
|
|
15
16
|
//#region src/components/Dropdown/internal/DropdownCollection.ts
|
|
16
|
-
function
|
|
17
|
+
function U(e, t) {
|
|
17
18
|
let n = () => null;
|
|
18
19
|
return n.__velliraDropdownPart = e, n.displayName = t, n;
|
|
19
20
|
}
|
|
20
|
-
function
|
|
21
|
+
function ne(e) {
|
|
21
22
|
let t = 0, n, r, a, o, s = [], c = [], u = (e) => `${e}-${t++}`;
|
|
22
23
|
function d(e) {
|
|
23
24
|
c.push(e), s.push({
|
|
@@ -97,7 +98,7 @@ function B(e) {
|
|
|
97
98
|
type: "item",
|
|
98
99
|
id: u("item"),
|
|
99
100
|
props: t,
|
|
100
|
-
label:
|
|
101
|
+
label: ie(t.children),
|
|
101
102
|
disabled: t.disabled
|
|
102
103
|
});
|
|
103
104
|
return;
|
|
@@ -108,7 +109,7 @@ function B(e) {
|
|
|
108
109
|
type: "checkbox",
|
|
109
110
|
id: u("checkbox"),
|
|
110
111
|
props: t,
|
|
111
|
-
label:
|
|
112
|
+
label: ie(t.children),
|
|
112
113
|
disabled: t.disabled
|
|
113
114
|
});
|
|
114
115
|
return;
|
|
@@ -130,20 +131,20 @@ function B(e) {
|
|
|
130
131
|
props: n,
|
|
131
132
|
groupId: t.radioGroupId ?? u("radio-group"),
|
|
132
133
|
groupProps: t.radioGroupProps,
|
|
133
|
-
label:
|
|
134
|
+
label: ie(n.children),
|
|
134
135
|
disabled: n.disabled
|
|
135
136
|
});
|
|
136
137
|
return;
|
|
137
138
|
}
|
|
138
139
|
case "sub": {
|
|
139
|
-
let t = e.props, n =
|
|
140
|
+
let t = e.props, n = W(t.children);
|
|
140
141
|
if (!n.trigger) return;
|
|
141
|
-
let r = n.trigger.props, i =
|
|
142
|
+
let r = n.trigger.props, i = ne(n.content?.props.children);
|
|
142
143
|
d({
|
|
143
144
|
type: "subTrigger",
|
|
144
145
|
id: u("sub"),
|
|
145
146
|
props: r,
|
|
146
|
-
label:
|
|
147
|
+
label: ie(r.children),
|
|
147
148
|
disabled: r.disabled,
|
|
148
149
|
content: n.content?.props.children,
|
|
149
150
|
subEntries: i.entries,
|
|
@@ -170,7 +171,7 @@ function B(e) {
|
|
|
170
171
|
trigger: n
|
|
171
172
|
};
|
|
172
173
|
}
|
|
173
|
-
function
|
|
174
|
+
function re(e) {
|
|
174
175
|
let t, n, r, a, o = [];
|
|
175
176
|
return i.forEach(e, (e) => {
|
|
176
177
|
if (!l(e)) {
|
|
@@ -203,7 +204,7 @@ function V(e) {
|
|
|
203
204
|
shortcut: a
|
|
204
205
|
};
|
|
205
206
|
}
|
|
206
|
-
function
|
|
207
|
+
function W(e) {
|
|
207
208
|
let t, n;
|
|
208
209
|
return i.forEach(e, (e) => {
|
|
209
210
|
if (!l(e)) return;
|
|
@@ -214,7 +215,7 @@ function ee(e) {
|
|
|
214
215
|
trigger: t
|
|
215
216
|
};
|
|
216
217
|
}
|
|
217
|
-
function
|
|
218
|
+
function ie(e) {
|
|
218
219
|
let t = [];
|
|
219
220
|
function n(e) {
|
|
220
221
|
i.forEach(e, (e) => {
|
|
@@ -231,7 +232,7 @@ function H(e) {
|
|
|
231
232
|
}
|
|
232
233
|
//#endregion
|
|
233
234
|
//#region src/components/Dropdown/CheckboxItem/DropdownCheckboxItem.tsx
|
|
234
|
-
var
|
|
235
|
+
var ae = U("checkboxItem", "Dropdown.CheckboxItem"), G = ({ active: e, enabled: t, content: n }) => {
|
|
235
236
|
f(() => {
|
|
236
237
|
if (!e || !t || !n) return;
|
|
237
238
|
let r = [], i = n.parentElement;
|
|
@@ -254,7 +255,7 @@ var U = z("checkboxItem", "Dropdown.CheckboxItem"), te = ({ active: e, enabled:
|
|
|
254
255
|
n,
|
|
255
256
|
t
|
|
256
257
|
]);
|
|
257
|
-
},
|
|
258
|
+
}, oe = () => {
|
|
258
259
|
let e = !1;
|
|
259
260
|
return {
|
|
260
261
|
preventDefault: () => {
|
|
@@ -264,7 +265,7 @@ var U = z("checkboxItem", "Dropdown.CheckboxItem"), te = ({ active: e, enabled:
|
|
|
264
265
|
return e;
|
|
265
266
|
}
|
|
266
267
|
};
|
|
267
|
-
},
|
|
268
|
+
}, se = (e) => {
|
|
268
269
|
let t = !1;
|
|
269
270
|
return {
|
|
270
271
|
originalEvent: e,
|
|
@@ -275,44 +276,67 @@ var U = z("checkboxItem", "Dropdown.CheckboxItem"), te = ({ active: e, enabled:
|
|
|
275
276
|
return t;
|
|
276
277
|
}
|
|
277
278
|
};
|
|
278
|
-
}
|
|
279
|
+
};
|
|
280
|
+
//#endregion
|
|
281
|
+
//#region src/hooks/behavior/overlay/useOverlayFocusRestore.ts
|
|
282
|
+
function ce(e) {
|
|
283
|
+
return !(e instanceof HTMLElement) || !e.isConnected ? !1 : (e.focus(), document.activeElement === e);
|
|
284
|
+
}
|
|
285
|
+
var le = ({ active: e, enabled: t = !0, finalFocus: n, onCloseAutoFocus: r }) => {
|
|
286
|
+
let i = g(null), a = g(t), o = g(n), s = g(r);
|
|
287
|
+
a.current = t, o.current = n, s.current = r;
|
|
288
|
+
let c = u(() => {
|
|
289
|
+
typeof document > "u" || (i.current = document.activeElement);
|
|
290
|
+
}, []), l = u(() => {
|
|
291
|
+
a.current && (ce(o.current?.current) || ce(i.current));
|
|
292
|
+
}, []), d = u((e) => {
|
|
293
|
+
let t = e ?? oe();
|
|
294
|
+
s.current?.(t), !(t.defaultPrevented || !a.current) && queueMicrotask(l);
|
|
295
|
+
}, [l]);
|
|
296
|
+
return f(() => {
|
|
297
|
+
if (e) return c(), () => {
|
|
298
|
+
d();
|
|
299
|
+
};
|
|
300
|
+
}, [
|
|
301
|
+
e,
|
|
302
|
+
d,
|
|
303
|
+
c
|
|
304
|
+
]), {
|
|
305
|
+
restoreFocus: l,
|
|
306
|
+
restoreFocusAfterClose: d,
|
|
307
|
+
saveFocusSnapshot: c
|
|
308
|
+
};
|
|
309
|
+
}, K = [
|
|
279
310
|
"a[href]",
|
|
280
311
|
"button:not([disabled])",
|
|
281
312
|
"textarea:not([disabled])",
|
|
282
313
|
"input:not([disabled])",
|
|
283
314
|
"select:not([disabled])",
|
|
284
315
|
"[tabindex]:not([tabindex=\"-1\"])"
|
|
285
|
-
].join(","),
|
|
286
|
-
(
|
|
287
|
-
},
|
|
288
|
-
|
|
316
|
+
].join(","), ue = (e) => Array.from(e.querySelectorAll(K)).filter((e) => !e.hasAttribute("disabled")), de = (e) => {
|
|
317
|
+
(ue(e)[0] ?? e).focus();
|
|
318
|
+
}, fe = ({ active: e, contentRef: t, enabled: n, initialFocus: r, finalFocus: i, restoreFocus: a, onOpenAutoFocus: o, onCloseAutoFocus: s }) => {
|
|
319
|
+
le({
|
|
320
|
+
active: e,
|
|
321
|
+
enabled: a,
|
|
322
|
+
finalFocus: i,
|
|
323
|
+
onCloseAutoFocus: s
|
|
324
|
+
}), f(() => {
|
|
289
325
|
if (!e) return;
|
|
290
|
-
let n =
|
|
291
|
-
|
|
292
|
-
r?.current?.focus(), !r?.current && t.current &&
|
|
293
|
-
})
|
|
294
|
-
let e = ne();
|
|
295
|
-
s?.(e), !(e.defaultPrevented || !a) && queueMicrotask(() => {
|
|
296
|
-
if (c) {
|
|
297
|
-
c.focus();
|
|
298
|
-
return;
|
|
299
|
-
}
|
|
300
|
-
n instanceof HTMLElement && n.focus();
|
|
301
|
-
});
|
|
302
|
-
};
|
|
326
|
+
let n = oe();
|
|
327
|
+
o?.(n), n.defaultPrevented || queueMicrotask(() => {
|
|
328
|
+
r?.current?.focus(), !r?.current && t.current && de(t.current);
|
|
329
|
+
});
|
|
303
330
|
}, [
|
|
304
331
|
e,
|
|
305
332
|
t,
|
|
306
|
-
i,
|
|
307
333
|
r,
|
|
308
|
-
|
|
309
|
-
o,
|
|
310
|
-
a
|
|
334
|
+
o
|
|
311
335
|
]), f(() => {
|
|
312
336
|
if (!e || !n) return;
|
|
313
337
|
let r = (e) => {
|
|
314
338
|
if (e.key !== "Tab" || !t.current) return;
|
|
315
|
-
let n =
|
|
339
|
+
let n = ue(t.current);
|
|
316
340
|
if (n.length === 0) {
|
|
317
341
|
e.preventDefault(), t.current.focus();
|
|
318
342
|
return;
|
|
@@ -332,79 +356,305 @@ var U = z("checkboxItem", "Dropdown.CheckboxItem"), te = ({ active: e, enabled:
|
|
|
332
356
|
t,
|
|
333
357
|
n
|
|
334
358
|
]);
|
|
335
|
-
},
|
|
336
|
-
let
|
|
337
|
-
|
|
338
|
-
if (!e) return;
|
|
339
|
-
let t = (e) =>
|
|
340
|
-
|
|
359
|
+
}, pe = (e) => {
|
|
360
|
+
let [t, n] = _(() => typeof window > "u" || typeof window.matchMedia != "function" || !e ? !1 : window.matchMedia(`(max-width: ${e}px)`).matches);
|
|
361
|
+
return f(() => {
|
|
362
|
+
if (typeof window > "u" || typeof window.matchMedia != "function" || !e) return;
|
|
363
|
+
let t = window.matchMedia(`(max-width: ${e}px)`), r = () => n(t.matches);
|
|
364
|
+
return r(), t.addEventListener("change", r), () => {
|
|
365
|
+
t.removeEventListener("change", r);
|
|
341
366
|
};
|
|
342
|
-
|
|
343
|
-
|
|
367
|
+
}, [e]), t;
|
|
368
|
+
}, me = ({ 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 = [] } = {}) => {
|
|
369
|
+
let u = pe(c), { refs: d, floatingStyles: p, isPositioned: m, update: g, context: _, middlewareData: v, placement: y } = D({
|
|
370
|
+
open: e,
|
|
371
|
+
onOpenChange: t,
|
|
372
|
+
placement: n,
|
|
373
|
+
strategy: r,
|
|
374
|
+
transform: !1,
|
|
375
|
+
middleware: h(() => [
|
|
376
|
+
w(i),
|
|
377
|
+
...s ? [C({ padding: a })] : [],
|
|
378
|
+
E({ apply({ rects: e, elements: t }) {
|
|
379
|
+
!o || u || Object.assign(t.floating.style, { width: `${e.reference.width}px` });
|
|
380
|
+
} }),
|
|
381
|
+
...s ? [T({ padding: a })] : [],
|
|
382
|
+
...l
|
|
383
|
+
], [
|
|
384
|
+
s,
|
|
385
|
+
a,
|
|
386
|
+
l,
|
|
387
|
+
u,
|
|
388
|
+
o,
|
|
389
|
+
i
|
|
390
|
+
]),
|
|
391
|
+
whileElementsMounted: S
|
|
392
|
+
});
|
|
393
|
+
return f(() => {
|
|
394
|
+
u && d.floating.current?.style.removeProperty("width");
|
|
395
|
+
}, [u, d.floating]), {
|
|
396
|
+
context: _,
|
|
397
|
+
placement: y,
|
|
398
|
+
middlewareData: v,
|
|
399
|
+
isPositioned: m,
|
|
400
|
+
floatingStyles: u ? {} : {
|
|
401
|
+
...p,
|
|
402
|
+
visibility: e && !m ? "hidden" : p.visibility
|
|
403
|
+
},
|
|
404
|
+
isMobileSheet: u,
|
|
405
|
+
setRef: d.setReference,
|
|
406
|
+
setFloatingRef: d.setFloating,
|
|
407
|
+
updatePosition: g
|
|
408
|
+
};
|
|
409
|
+
}, he = N({
|
|
410
|
+
defaultLevel: "popover",
|
|
411
|
+
levels: I.tokens.zIndex
|
|
412
|
+
}), ge = j("WebOverlayManager");
|
|
413
|
+
function _e(e) {
|
|
414
|
+
return new Map(Array.from(e.entries()).map(([e, t]) => [e, { ...t }]));
|
|
415
|
+
}
|
|
416
|
+
function ve(e) {
|
|
417
|
+
let t = M(e.values());
|
|
418
|
+
return {
|
|
419
|
+
registry: _e(e),
|
|
420
|
+
stack: t,
|
|
421
|
+
topmost: P(t)
|
|
422
|
+
};
|
|
423
|
+
}
|
|
424
|
+
function ye() {
|
|
425
|
+
let e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Set(), i = 0, a = ve(e), o = () => {
|
|
426
|
+
a = ve(e), r.forEach((e) => e());
|
|
427
|
+
}, s = (e) => F({
|
|
428
|
+
explicitZIndex: e.zIndex,
|
|
429
|
+
level: e.zIndexLevel,
|
|
430
|
+
order: e.order,
|
|
431
|
+
policy: he
|
|
432
|
+
});
|
|
433
|
+
return {
|
|
434
|
+
register(t) {
|
|
435
|
+
e.has(t.id) && ge.duplicateRegistration?.(t.id), e.delete(t.id);
|
|
436
|
+
let n = {
|
|
437
|
+
id: t.id,
|
|
438
|
+
zIndexLevel: t.zIndexLevel ?? he.defaultLevel,
|
|
439
|
+
order: i++,
|
|
440
|
+
zIndex: t.zIndex
|
|
441
|
+
};
|
|
442
|
+
return e.set(t.id, n), o(), n;
|
|
443
|
+
},
|
|
444
|
+
unregister(r) {
|
|
445
|
+
if (t.delete(r), n.delete(r), !e.delete(r)) {
|
|
446
|
+
ge.unknownUnregister?.(r);
|
|
447
|
+
return;
|
|
448
|
+
}
|
|
449
|
+
e.size === 0 && (i = 0), o();
|
|
450
|
+
},
|
|
451
|
+
update(t) {
|
|
452
|
+
let n = e.get(t.id);
|
|
453
|
+
if (!n) return null;
|
|
454
|
+
let r = {
|
|
455
|
+
...n,
|
|
456
|
+
zIndexLevel: t.zIndexLevel ?? n.zIndexLevel,
|
|
457
|
+
zIndex: t.zIndex
|
|
458
|
+
};
|
|
459
|
+
return e.set(t.id, r), o(), r;
|
|
460
|
+
},
|
|
461
|
+
getSnapshot() {
|
|
462
|
+
return a;
|
|
463
|
+
},
|
|
464
|
+
getEntry(t) {
|
|
465
|
+
return e.get(t) ?? null;
|
|
466
|
+
},
|
|
467
|
+
getStack() {
|
|
468
|
+
return a.stack;
|
|
469
|
+
},
|
|
470
|
+
getTopmost() {
|
|
471
|
+
return a.topmost;
|
|
472
|
+
},
|
|
473
|
+
isTopmost(e) {
|
|
474
|
+
return a.topmost?.id === e;
|
|
475
|
+
},
|
|
476
|
+
getZIndex(t) {
|
|
477
|
+
let n = e.get(t);
|
|
478
|
+
return n ? s(n) : void 0;
|
|
479
|
+
},
|
|
480
|
+
registerEscapeHandler(e, n) {
|
|
481
|
+
return t.set(e, n), () => {
|
|
482
|
+
t.get(e) === n && t.delete(e);
|
|
483
|
+
};
|
|
484
|
+
},
|
|
485
|
+
dispatchEscapeKeyDown(e) {
|
|
486
|
+
let n = a.topmost;
|
|
487
|
+
if (!n) return !1;
|
|
488
|
+
let r = t.get(n.id);
|
|
489
|
+
return r ? (r(e), !0) : !1;
|
|
490
|
+
},
|
|
491
|
+
registerPointerDownOutsideHandler(e, t) {
|
|
492
|
+
return n.set(e, t), () => {
|
|
493
|
+
n.get(e) === t && n.delete(e);
|
|
494
|
+
};
|
|
495
|
+
},
|
|
496
|
+
dispatchPointerDownOutside(e) {
|
|
497
|
+
let t = a.topmost;
|
|
498
|
+
if (!t) return !1;
|
|
499
|
+
let r = n.get(t.id);
|
|
500
|
+
return r ? (r(e), !0) : !1;
|
|
501
|
+
},
|
|
502
|
+
subscribe(e) {
|
|
503
|
+
return r.add(e), () => {
|
|
504
|
+
r.delete(e);
|
|
505
|
+
};
|
|
506
|
+
},
|
|
507
|
+
clear() {
|
|
508
|
+
e.size !== 0 && (e.clear(), t.clear(), n.clear(), i = 0, o());
|
|
509
|
+
}
|
|
510
|
+
};
|
|
511
|
+
}
|
|
512
|
+
var be = ye(), xe = s(null), Se = () => d(xe) ?? be, Ce = ({ active: e, id: t, zIndexLevel: n, zIndex: r }) => {
|
|
513
|
+
let i = Se(), a = v(i.subscribe, i.getSnapshot, i.getSnapshot);
|
|
514
|
+
f(() => {
|
|
515
|
+
if (e) return i.register({
|
|
516
|
+
id: t,
|
|
517
|
+
zIndexLevel: n,
|
|
518
|
+
zIndex: r
|
|
519
|
+
}), () => {
|
|
520
|
+
i.unregister(t);
|
|
344
521
|
};
|
|
345
522
|
}, [
|
|
346
523
|
e,
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
])
|
|
524
|
+
t,
|
|
525
|
+
i,
|
|
526
|
+
n,
|
|
527
|
+
r
|
|
528
|
+
]);
|
|
529
|
+
let o = u(() => i.isTopmost(t), [t, i]), s = a.registry.get(t);
|
|
530
|
+
return {
|
|
531
|
+
isTopOverlay: o,
|
|
532
|
+
isTopmost: a.topmost?.id === t,
|
|
533
|
+
order: s?.order,
|
|
534
|
+
zIndex: i.getZIndex(t)
|
|
535
|
+
};
|
|
536
|
+
}, q = /* @__PURE__ */ new Map(), we = /* @__PURE__ */ new Map();
|
|
537
|
+
function Te(e) {
|
|
538
|
+
if (typeof document > "u" || q.has(e)) return;
|
|
539
|
+
let t = (t) => {
|
|
540
|
+
t.key === "Escape" && e.dispatchEscapeKeyDown(t);
|
|
541
|
+
};
|
|
542
|
+
document.addEventListener("keydown", t), q.set(e, {
|
|
543
|
+
count: 0,
|
|
544
|
+
detach: () => {
|
|
545
|
+
document.removeEventListener("keydown", t), q.delete(e);
|
|
546
|
+
}
|
|
547
|
+
});
|
|
548
|
+
}
|
|
549
|
+
function Ee(e) {
|
|
550
|
+
Te(e);
|
|
551
|
+
let t = q.get(e);
|
|
552
|
+
return t ? (t.count += 1, () => {
|
|
553
|
+
let t = q.get(e);
|
|
554
|
+
t && (t.count = Math.max(0, t.count - 1), !(t.count > 0) && t.detach());
|
|
555
|
+
}) : () => void 0;
|
|
556
|
+
}
|
|
557
|
+
function De(e) {
|
|
558
|
+
if (typeof document > "u" || we.has(e)) return;
|
|
559
|
+
let t = (t) => {
|
|
560
|
+
e.dispatchPointerDownOutside(t);
|
|
561
|
+
};
|
|
562
|
+
document.addEventListener("pointerdown", t), we.set(e, {
|
|
563
|
+
count: 0,
|
|
564
|
+
detach: () => {
|
|
565
|
+
document.removeEventListener("pointerdown", t), we.delete(e);
|
|
566
|
+
}
|
|
567
|
+
});
|
|
568
|
+
}
|
|
569
|
+
function Oe(e) {
|
|
570
|
+
De(e);
|
|
571
|
+
let t = we.get(e);
|
|
572
|
+
return t ? (t.count += 1, () => {
|
|
573
|
+
let t = we.get(e);
|
|
574
|
+
t && (t.count = Math.max(0, t.count - 1), !(t.count > 0) && t.detach());
|
|
575
|
+
}) : () => void 0;
|
|
576
|
+
}
|
|
577
|
+
var ke = ({ 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: p, requestClose: m }) => {
|
|
578
|
+
let h = Se(), _ = Ce({
|
|
579
|
+
active: r && !i,
|
|
580
|
+
id: t,
|
|
581
|
+
zIndexLevel: n,
|
|
582
|
+
zIndex: a
|
|
583
|
+
}), v = g(s);
|
|
584
|
+
return v.current = s, f(() => {
|
|
352
585
|
if (!e) return;
|
|
353
|
-
let n = (e) => {
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
586
|
+
let n = Ee(h), r = h.registerEscapeHandler(t, (e) => {
|
|
587
|
+
u?.(e), !(e.defaultPrevented || !c) && m("escape-key", e);
|
|
588
|
+
});
|
|
589
|
+
return () => {
|
|
590
|
+
r(), n();
|
|
357
591
|
};
|
|
358
|
-
|
|
359
|
-
|
|
592
|
+
}, [
|
|
593
|
+
e,
|
|
594
|
+
c,
|
|
595
|
+
t,
|
|
596
|
+
h,
|
|
597
|
+
u,
|
|
598
|
+
m
|
|
599
|
+
]), f(() => {
|
|
600
|
+
if (!e) return;
|
|
601
|
+
let n = Oe(h), r = h.registerPointerDownOutsideHandler(t, (e) => {
|
|
602
|
+
if (e.target instanceof Node && [o, ...v.current].some((t) => t.current?.contains(e.target))) return;
|
|
603
|
+
let t = se(e);
|
|
604
|
+
d?.(t), p?.(t), !(t.defaultPrevented || !l) && m("outside-press", e);
|
|
605
|
+
});
|
|
606
|
+
return () => {
|
|
607
|
+
r(), n();
|
|
360
608
|
};
|
|
361
609
|
}, [
|
|
362
610
|
e,
|
|
363
|
-
|
|
611
|
+
l,
|
|
612
|
+
o,
|
|
364
613
|
t,
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
]);
|
|
370
|
-
},
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
614
|
+
h,
|
|
615
|
+
p,
|
|
616
|
+
d,
|
|
617
|
+
m
|
|
618
|
+
]), _;
|
|
619
|
+
}, Ae = ({ open: e, onOpenChange: t, placement: n = "bottom-start", strategy: r, portal: i = !0, presentation: a, animationStyle: o, offset: s, collisionPadding: c, matchTriggerWidth: l, avoidCollisions: u, mobileSheetBreakpoint: d, middleware: f } = {}) => ({
|
|
620
|
+
...me({
|
|
621
|
+
open: e,
|
|
622
|
+
onOpenChange: t,
|
|
623
|
+
placement: n,
|
|
624
|
+
strategy: r ?? (i ? "fixed" : "absolute"),
|
|
625
|
+
offset: s,
|
|
626
|
+
collisionPadding: c,
|
|
627
|
+
matchTriggerWidth: l,
|
|
628
|
+
avoidCollisions: u,
|
|
629
|
+
mobileSheetBreakpoint: d,
|
|
630
|
+
middleware: f
|
|
631
|
+
}),
|
|
632
|
+
animationStyle: o,
|
|
633
|
+
presentation: a ?? (i ? "floating" : "inline")
|
|
634
|
+
}), je = 0, Me = "", Ne = {
|
|
385
635
|
lock() {
|
|
386
|
-
typeof document > "u" || (
|
|
636
|
+
typeof document > "u" || (je === 0 && (Me = document.body.style.overflow, document.body.style.overflow = "hidden"), je += 1);
|
|
387
637
|
},
|
|
388
638
|
unlock() {
|
|
389
|
-
typeof document > "u" || (
|
|
639
|
+
typeof document > "u" || (je = Math.max(0, je - 1), je === 0 && (document.body.style.overflow = Me));
|
|
390
640
|
}
|
|
391
|
-
},
|
|
641
|
+
}, Pe = ({ active: e, enabled: t = !0 }) => {
|
|
392
642
|
f(() => {
|
|
393
|
-
if (!(!e || !t)) return
|
|
394
|
-
|
|
643
|
+
if (!(!e || !t)) return Ne.lock(), () => {
|
|
644
|
+
Ne.unlock();
|
|
395
645
|
};
|
|
396
646
|
}, [e, t]);
|
|
397
|
-
},
|
|
647
|
+
}, Fe = () => typeof document > "u" ? null : document.body, Ie = ({ container: e } = {}) => {
|
|
398
648
|
let [t, n] = _(!1);
|
|
399
649
|
return f(() => {
|
|
400
650
|
n(!0);
|
|
401
|
-
}, []), t ? e ?? document.getElementById("overlay-root") ??
|
|
402
|
-
},
|
|
651
|
+
}, []), t ? e ?? document.getElementById("overlay-root") ?? Fe() : null;
|
|
652
|
+
}, J = ({ value: e, defaultValue: t, onChange: n }) => {
|
|
403
653
|
let [r, i] = _(t), a = e !== void 0;
|
|
404
654
|
return [a ? e : r, u((e) => {
|
|
405
655
|
a || i(e), n?.(e);
|
|
406
656
|
}, [a, n])];
|
|
407
|
-
},
|
|
657
|
+
}, Le = ({ activeIndex: e, setActiveIndex: t, items: n, isOpen: r, onOpen: i, onSelect: a, onClose: o, getItemText: s, loop: c = !0 }) => {
|
|
408
658
|
let l = g({
|
|
409
659
|
value: "",
|
|
410
660
|
timeoutId: void 0
|
|
@@ -487,7 +737,7 @@ var U = z("checkboxItem", "Dropdown.CheckboxItem"), te = ({ active: e, enabled:
|
|
|
487
737
|
m,
|
|
488
738
|
h
|
|
489
739
|
]) };
|
|
490
|
-
},
|
|
740
|
+
}, Re = ({ items: e, open: t, defaultOpen: n = !1, disabled: r = !1, onOpenChange: i, onSelect: a, getItemValue: o, getItemText: s, loop: c = !0 }) => {
|
|
491
741
|
let [l, d] = _(n), [p, m] = _(-1), h = t !== void 0, g = t ?? l, v = u(() => e.findIndex((e) => !e.disabled), [e]), y = u(() => {
|
|
492
742
|
for (let t = e.length - 1; t >= 0; t--) if (!e[t]?.disabled) return t;
|
|
493
743
|
return -1;
|
|
@@ -542,7 +792,7 @@ var U = z("checkboxItem", "Dropdown.CheckboxItem"), te = ({ active: e, enabled:
|
|
|
542
792
|
p,
|
|
543
793
|
e,
|
|
544
794
|
T
|
|
545
|
-
]), { onKeyDown: D } =
|
|
795
|
+
]), { onKeyDown: D } = Le({
|
|
546
796
|
activeIndex: p,
|
|
547
797
|
setActiveIndex: m,
|
|
548
798
|
items: e,
|
|
@@ -571,8 +821,8 @@ var U = z("checkboxItem", "Dropdown.CheckboxItem"), te = ({ active: e, enabled:
|
|
|
571
821
|
getFirstEnabledIndex: v,
|
|
572
822
|
getLastEnabledIndex: y
|
|
573
823
|
};
|
|
574
|
-
},
|
|
575
|
-
let a = p(), o = p(), s = p(), [c, l] =
|
|
824
|
+
}, ze = ({ open: e, defaultOpen: t = !1, onOpenChange: n, closeOnEscape: r, closeOnOutsidePress: i }) => {
|
|
825
|
+
let a = p(), o = p(), s = p(), [c, l] = J({
|
|
576
826
|
value: e,
|
|
577
827
|
defaultValue: t,
|
|
578
828
|
onChange: n
|
|
@@ -590,12 +840,12 @@ var U = z("checkboxItem", "Dropdown.CheckboxItem"), te = ({ active: e, enabled:
|
|
|
590
840
|
titleId: o,
|
|
591
841
|
descriptionId: s
|
|
592
842
|
};
|
|
593
|
-
},
|
|
594
|
-
let [m, g] =
|
|
843
|
+
}, Be = ({ value: e, defaultValue: t, onValueChange: n, onChange: r, options: i, multiple: a = !1, maxSelected: o, closeOnSelect: s = !a, disabled: c = !1, open: l, defaultOpen: d = !1, onOpenChange: p }) => {
|
|
844
|
+
let [m, g] = J({
|
|
595
845
|
value: e,
|
|
596
846
|
defaultValue: t ?? (a ? [] : ""),
|
|
597
847
|
onChange: n ?? r
|
|
598
|
-
}), [v, y] =
|
|
848
|
+
}), [v, y] = J({
|
|
599
849
|
value: l,
|
|
600
850
|
defaultValue: d,
|
|
601
851
|
onChange: p
|
|
@@ -664,7 +914,7 @@ var U = z("checkboxItem", "Dropdown.CheckboxItem"), te = ({ active: e, enabled:
|
|
|
664
914
|
b,
|
|
665
915
|
i,
|
|
666
916
|
k
|
|
667
|
-
]), { onKeyDown: j } =
|
|
917
|
+
]), { onKeyDown: j } = Le({
|
|
668
918
|
activeIndex: b,
|
|
669
919
|
setActiveIndex: x,
|
|
670
920
|
items: i,
|
|
@@ -694,8 +944,8 @@ var U = z("checkboxItem", "Dropdown.CheckboxItem"), te = ({ active: e, enabled:
|
|
|
694
944
|
selectActiveOption: A,
|
|
695
945
|
onKeyDown: j
|
|
696
946
|
};
|
|
697
|
-
},
|
|
698
|
-
let [r, i] =
|
|
947
|
+
}, Ve = ({ value: e, defaultValue: t = "", onValueChange: n }) => {
|
|
948
|
+
let [r, i] = J({
|
|
699
949
|
value: e,
|
|
700
950
|
defaultValue: t,
|
|
701
951
|
onChange: n
|
|
@@ -704,15 +954,15 @@ var U = z("checkboxItem", "Dropdown.CheckboxItem"), te = ({ active: e, enabled:
|
|
|
704
954
|
value: r,
|
|
705
955
|
setValue: i
|
|
706
956
|
};
|
|
707
|
-
},
|
|
957
|
+
}, He = s(null), Ue = ({ children: e, container: t = null }) => /* @__PURE__ */ n(He.Provider, {
|
|
708
958
|
value: t,
|
|
709
959
|
children: e
|
|
710
|
-
}),
|
|
711
|
-
let n = d(
|
|
712
|
-
return r ?
|
|
960
|
+
}), We = ({ children: e, container: t }) => {
|
|
961
|
+
let n = d(He), r = Ie({ container: t ?? n });
|
|
962
|
+
return r ? y(e, r) : null;
|
|
713
963
|
};
|
|
714
|
-
|
|
715
|
-
var
|
|
964
|
+
We.__velliraPortal = !0, We.displayName = "Portal", Ue.displayName = "PortalProvider";
|
|
965
|
+
var Ge = {
|
|
716
966
|
dropdown: "_dropdown_m7rnq_1",
|
|
717
967
|
"dropdown-in": "_dropdown-in_m7rnq_1",
|
|
718
968
|
primary: "_primary_m7rnq_42",
|
|
@@ -724,31 +974,31 @@ var we = {
|
|
|
724
974
|
searchWrap: "_searchWrap_m7rnq_165",
|
|
725
975
|
search: "_search_m7rnq_165",
|
|
726
976
|
"dropdown-sheet-in": "_dropdown-sheet-in_m7rnq_1"
|
|
727
|
-
},
|
|
977
|
+
}, Ke = U("empty", "Dropdown.Empty"), qe = ({ children: e }) => /* @__PURE__ */ n("li", {
|
|
728
978
|
role: "presentation",
|
|
729
|
-
className:
|
|
979
|
+
className: Ge.empty,
|
|
730
980
|
children: e ?? "No actions available"
|
|
731
981
|
});
|
|
732
|
-
|
|
982
|
+
qe.displayName = "DropdownEmptySurface";
|
|
733
983
|
//#endregion
|
|
734
984
|
//#region src/components/Dropdown/Group/DropdownGroup.tsx
|
|
735
|
-
var
|
|
736
|
-
|
|
985
|
+
var Je = U("group", "Dropdown.Group"), Ye = () => null;
|
|
986
|
+
Ye.displayName = "DropdownGroupSurface";
|
|
737
987
|
//#endregion
|
|
738
988
|
//#region src/components/Dropdown/internal/DropdownContext.tsx
|
|
739
|
-
var
|
|
740
|
-
|
|
741
|
-
function
|
|
742
|
-
let e = d(
|
|
989
|
+
var Xe = s(null), Ze = s(null), Qe = s(null), $e = Xe.Provider, et = Ze.Provider;
|
|
990
|
+
Qe.Provider;
|
|
991
|
+
function tt() {
|
|
992
|
+
let e = d(Xe);
|
|
743
993
|
if (!e) throw Error("Dropdown compound components must be used inside Dropdown.");
|
|
744
994
|
return e;
|
|
745
995
|
}
|
|
746
|
-
function
|
|
747
|
-
let e = d(
|
|
996
|
+
function nt() {
|
|
997
|
+
let e = d(Ze);
|
|
748
998
|
if (!e) throw Error("Dropdown.Trigger must be used inside Dropdown.");
|
|
749
999
|
return e;
|
|
750
1000
|
}
|
|
751
|
-
var
|
|
1001
|
+
var Y = {
|
|
752
1002
|
item: "_item_xmygj_1",
|
|
753
1003
|
disabled: "_disabled_xmygj_35",
|
|
754
1004
|
active: "_active_xmygj_53",
|
|
@@ -773,8 +1023,8 @@ var q = {
|
|
|
773
1023
|
"dropdown-sub-in": "_dropdown-sub-in_xmygj_1",
|
|
774
1024
|
subLabel: "_subLabel_xmygj_300",
|
|
775
1025
|
subSeparator: "_subSeparator_xmygj_308"
|
|
776
|
-
},
|
|
777
|
-
let a =
|
|
1026
|
+
}, rt = U("item", "Dropdown.Item"), it = ({ item: e, itemIndex: i }) => {
|
|
1027
|
+
let a = tt(), o = g(void 0), [s, c] = _(e.type === "checkbox" ? e.props.defaultChecked ?? !1 : !1), l = a.activeIndex === i, u = a.openSubId === e.id, d = e.type === "checkbox", f = e.type === "radio", p = e.type === "subTrigger", m = d ? e.props.checked ?? s : f ? (e.groupProps?.value ?? a.radioValues[e.groupId]) === e.props.value : !1, h = a.loading || e.disabled, v = e.props, y = re(v.children), b = y.icon ?? v.icon, x = y.description ?? ("description" in v ? v.description : void 0), S = y.badge ?? ("badge" in v ? v.badge : void 0), C = y.shortcut ?? v.shortcut, w = y.content.length ? y.content : v.children, T = "color" in v ? v.color : void 0, E = e.type === "item" ? e.props.href : void 0, D = e.type === "item" ? e.props.target : void 0, O = e.type === "item" ? e.props.download : void 0, k = a.getItemId(i), A = d ? "menuitemcheckbox" : f ? "menuitemradio" : "menuitem", j = e.type === "item" && D === "_blank" && !e.props.rel ? "noreferrer noopener" : e.type === "item" ? e.props.rel : void 0, M = E ? "a" : "li", N = d || f, P = (t) => {
|
|
778
1028
|
if (h) {
|
|
779
1029
|
t.preventDefault();
|
|
780
1030
|
return;
|
|
@@ -783,15 +1033,15 @@ var q = {
|
|
|
783
1033
|
let t = !m;
|
|
784
1034
|
c(t), e.props.onCheckedChange?.(t);
|
|
785
1035
|
}
|
|
786
|
-
a.selectItem(e,
|
|
1036
|
+
a.selectItem(e, at(t));
|
|
787
1037
|
};
|
|
788
|
-
return /* @__PURE__ */ r(t, { children: [/* @__PURE__ */ r(
|
|
789
|
-
id:
|
|
790
|
-
role:
|
|
791
|
-
href:
|
|
792
|
-
target:
|
|
793
|
-
rel:
|
|
794
|
-
download:
|
|
1038
|
+
return /* @__PURE__ */ r(t, { children: [/* @__PURE__ */ r(M, {
|
|
1039
|
+
id: k,
|
|
1040
|
+
role: A,
|
|
1041
|
+
href: M === "a" && !h ? E : void 0,
|
|
1042
|
+
target: M === "a" && !h ? D : void 0,
|
|
1043
|
+
rel: M === "a" ? j : void 0,
|
|
1044
|
+
download: M === "a" && !h ? O : void 0,
|
|
795
1045
|
tabIndex: h ? -1 : 0,
|
|
796
1046
|
"aria-disabled": h || void 0,
|
|
797
1047
|
"aria-checked": d || f ? m : void 0,
|
|
@@ -799,12 +1049,12 @@ var q = {
|
|
|
799
1049
|
"aria-expanded": p ? u : void 0,
|
|
800
1050
|
"data-active": l || void 0,
|
|
801
1051
|
"data-state": u ? "open" : void 0,
|
|
802
|
-
className:
|
|
803
|
-
[
|
|
804
|
-
[
|
|
805
|
-
[
|
|
806
|
-
},
|
|
807
|
-
onClick:
|
|
1052
|
+
className: V(Y.item, Y[a.size], {
|
|
1053
|
+
[Y.active]: l,
|
|
1054
|
+
[Y.disabled]: h,
|
|
1055
|
+
[Y.checked]: m
|
|
1056
|
+
}, T && T !== "default" ? Y[T] : void 0, v.className),
|
|
1057
|
+
onClick: P,
|
|
808
1058
|
onMouseEnter: () => {
|
|
809
1059
|
h || (a.setActiveIndex(i), p ? (window.clearTimeout(o.current), o.current = window.setTimeout(() => a.setOpenSubId(e.id), 120)) : (window.clearTimeout(o.current), a.setOpenSubId(void 0)));
|
|
810
1060
|
},
|
|
@@ -812,59 +1062,59 @@ var q = {
|
|
|
812
1062
|
window.clearTimeout(o.current);
|
|
813
1063
|
},
|
|
814
1064
|
children: [
|
|
815
|
-
|
|
816
|
-
className:
|
|
817
|
-
children:
|
|
1065
|
+
b && /* @__PURE__ */ n("span", {
|
|
1066
|
+
className: Y.itemIcon,
|
|
1067
|
+
children: b
|
|
818
1068
|
}),
|
|
819
1069
|
/* @__PURE__ */ r("span", {
|
|
820
|
-
className:
|
|
1070
|
+
className: Y.itemText,
|
|
821
1071
|
children: [/* @__PURE__ */ n("span", {
|
|
822
|
-
className:
|
|
823
|
-
children:
|
|
824
|
-
}),
|
|
825
|
-
className:
|
|
826
|
-
children:
|
|
1072
|
+
className: Y.itemLabel,
|
|
1073
|
+
children: w
|
|
1074
|
+
}), x && /* @__PURE__ */ n("span", {
|
|
1075
|
+
className: Y.itemDescription,
|
|
1076
|
+
children: x
|
|
827
1077
|
})]
|
|
828
1078
|
}),
|
|
829
|
-
|
|
830
|
-
className:
|
|
831
|
-
children:
|
|
1079
|
+
S && /* @__PURE__ */ n("span", {
|
|
1080
|
+
className: Y.itemBadge,
|
|
1081
|
+
children: S
|
|
832
1082
|
}),
|
|
833
|
-
|
|
834
|
-
className:
|
|
835
|
-
children:
|
|
1083
|
+
C && /* @__PURE__ */ n("span", {
|
|
1084
|
+
className: Y.itemShortcut,
|
|
1085
|
+
children: C
|
|
836
1086
|
}),
|
|
837
|
-
|
|
838
|
-
className:
|
|
1087
|
+
N && /* @__PURE__ */ n("span", {
|
|
1088
|
+
className: Y.indicator,
|
|
839
1089
|
"aria-hidden": "true",
|
|
840
|
-
children: m ? /* @__PURE__ */ n(
|
|
1090
|
+
children: m ? /* @__PURE__ */ n(L, {}) : null
|
|
841
1091
|
}),
|
|
842
1092
|
p && /* @__PURE__ */ n("span", {
|
|
843
|
-
className:
|
|
1093
|
+
className: Y.itemShortcut,
|
|
844
1094
|
"aria-hidden": "true",
|
|
845
|
-
children: /* @__PURE__ */ n(
|
|
1095
|
+
children: /* @__PURE__ */ n(z, {})
|
|
846
1096
|
})
|
|
847
1097
|
]
|
|
848
1098
|
}), p && u && e.subEntries.length > 0 && /* @__PURE__ */ n("ul", {
|
|
849
1099
|
role: "menu",
|
|
850
|
-
className:
|
|
1100
|
+
className: Y.subContent,
|
|
851
1101
|
onMouseEnter: () => a.setOpenSubId(e.id),
|
|
852
1102
|
children: e.subEntries.map((e) => e.type === "label" ? /* @__PURE__ */ n("li", {
|
|
853
1103
|
role: "presentation",
|
|
854
|
-
className:
|
|
1104
|
+
className: Y.subLabel,
|
|
855
1105
|
children: e.props.children
|
|
856
1106
|
}, e.id) : e.type === "separator" ? /* @__PURE__ */ n("li", {
|
|
857
1107
|
role: "separator",
|
|
858
|
-
className:
|
|
1108
|
+
className: Y.subSeparator,
|
|
859
1109
|
"aria-hidden": "true"
|
|
860
|
-
}, e.id) : e.type === "item" ? /* @__PURE__ */ n(
|
|
1110
|
+
}, e.id) : e.type === "item" ? /* @__PURE__ */ n(ot, {
|
|
861
1111
|
item: e.item,
|
|
862
|
-
id: `${
|
|
1112
|
+
id: `${k}-${e.itemIndex}`
|
|
863
1113
|
}, e.item.id) : null)
|
|
864
1114
|
})] });
|
|
865
1115
|
};
|
|
866
|
-
|
|
867
|
-
function
|
|
1116
|
+
it.displayName = "DropdownItemRow";
|
|
1117
|
+
function at(e) {
|
|
868
1118
|
let t = !1;
|
|
869
1119
|
return {
|
|
870
1120
|
originalEvent: e,
|
|
@@ -876,9 +1126,9 @@ function Re(e) {
|
|
|
876
1126
|
}
|
|
877
1127
|
};
|
|
878
1128
|
}
|
|
879
|
-
function
|
|
880
|
-
let i =
|
|
881
|
-
if (
|
|
1129
|
+
function ot({ id: e, item: t }) {
|
|
1130
|
+
let i = tt(), [a, o] = _(t.type === "checkbox" ? t.props.defaultChecked ?? !1 : !1), s = t.type === "checkbox", c = t.type === "radio", l = s ? t.props.checked ?? a : c ? (t.groupProps?.value ?? i.radioValues[t.groupId]) === t.props.value : !1, u = t.props, d = re(u.children), f = d.icon ?? u.icon, p = d.description ?? ("description" in u ? u.description : void 0), m = d.badge ?? ("badge" in u ? u.badge : void 0), h = d.shortcut ?? u.shortcut, g = d.content.length ? d.content : u.children, v = "color" in u ? u.color : void 0, y = i.loading || t.disabled, b = t.type === "item" ? t.props.href : void 0, x = t.type === "item" ? t.props.target : void 0, S = t.type === "item" ? t.props.download : void 0, C = s ? "menuitemcheckbox" : c ? "menuitemradio" : "menuitem", w = t.type === "item" && x === "_blank" && !t.props.rel ? "noreferrer noopener" : t.type === "item" ? t.props.rel : void 0, T = b ? "a" : "li", E = s || c, D = (e) => {
|
|
1131
|
+
if (y) {
|
|
882
1132
|
e.preventDefault();
|
|
883
1133
|
return;
|
|
884
1134
|
}
|
|
@@ -886,86 +1136,86 @@ function ze({ id: e, item: t }) {
|
|
|
886
1136
|
let e = !l;
|
|
887
1137
|
o(e), t.props.onCheckedChange?.(e);
|
|
888
1138
|
}
|
|
889
|
-
i.selectItem(t,
|
|
1139
|
+
i.selectItem(t, at(e));
|
|
890
1140
|
};
|
|
891
|
-
return /* @__PURE__ */ r(
|
|
1141
|
+
return /* @__PURE__ */ r(T, {
|
|
892
1142
|
id: e,
|
|
893
|
-
role:
|
|
894
|
-
href:
|
|
895
|
-
target:
|
|
896
|
-
rel:
|
|
897
|
-
download:
|
|
898
|
-
tabIndex:
|
|
899
|
-
"aria-disabled":
|
|
1143
|
+
role: C,
|
|
1144
|
+
href: T === "a" && !y ? b : void 0,
|
|
1145
|
+
target: T === "a" && !y ? x : void 0,
|
|
1146
|
+
rel: T === "a" ? w : void 0,
|
|
1147
|
+
download: T === "a" && !y ? S : void 0,
|
|
1148
|
+
tabIndex: y ? -1 : 0,
|
|
1149
|
+
"aria-disabled": y || void 0,
|
|
900
1150
|
"aria-checked": s || c ? l : void 0,
|
|
901
|
-
className:
|
|
902
|
-
[
|
|
903
|
-
[
|
|
904
|
-
}, v && v !== "default" ?
|
|
905
|
-
onClick:
|
|
1151
|
+
className: V(Y.item, Y[i.size], {
|
|
1152
|
+
[Y.disabled]: y,
|
|
1153
|
+
[Y.checked]: l
|
|
1154
|
+
}, v && v !== "default" ? Y[v] : void 0),
|
|
1155
|
+
onClick: D,
|
|
906
1156
|
children: [
|
|
907
|
-
|
|
908
|
-
className:
|
|
1157
|
+
E && /* @__PURE__ */ n("span", {
|
|
1158
|
+
className: Y.indicator,
|
|
909
1159
|
"aria-hidden": "true",
|
|
910
|
-
children: l ? /* @__PURE__ */ n(
|
|
1160
|
+
children: l ? /* @__PURE__ */ n(L, {}) : null
|
|
911
1161
|
}),
|
|
912
1162
|
f && /* @__PURE__ */ n("span", {
|
|
913
|
-
className:
|
|
1163
|
+
className: Y.itemIcon,
|
|
914
1164
|
children: f
|
|
915
1165
|
}),
|
|
916
1166
|
/* @__PURE__ */ r("span", {
|
|
917
|
-
className:
|
|
1167
|
+
className: Y.itemText,
|
|
918
1168
|
children: [/* @__PURE__ */ n("span", {
|
|
919
|
-
className:
|
|
1169
|
+
className: Y.itemLabel,
|
|
920
1170
|
children: g
|
|
921
1171
|
}), p && /* @__PURE__ */ n("span", {
|
|
922
|
-
className:
|
|
1172
|
+
className: Y.itemDescription,
|
|
923
1173
|
children: p
|
|
924
1174
|
})]
|
|
925
1175
|
}),
|
|
926
1176
|
m && /* @__PURE__ */ n("span", {
|
|
927
|
-
className:
|
|
1177
|
+
className: Y.itemBadge,
|
|
928
1178
|
children: m
|
|
929
1179
|
}),
|
|
930
1180
|
h && /* @__PURE__ */ n("span", {
|
|
931
|
-
className:
|
|
1181
|
+
className: Y.itemShortcut,
|
|
932
1182
|
children: h
|
|
933
1183
|
})
|
|
934
1184
|
]
|
|
935
1185
|
});
|
|
936
1186
|
}
|
|
937
|
-
var
|
|
1187
|
+
var st = { group: "_group_aviwv_1" }, ct = U("label", "Dropdown.Label"), lt = ({ children: e, className: t }) => /* @__PURE__ */ n("li", {
|
|
938
1188
|
role: "presentation",
|
|
939
|
-
className:
|
|
1189
|
+
className: V(st.group, t),
|
|
940
1190
|
children: e
|
|
941
1191
|
});
|
|
942
|
-
|
|
1192
|
+
lt.displayName = "DropdownLabelSurface";
|
|
943
1193
|
//#endregion
|
|
944
1194
|
//#region src/components/Dropdown/Loading/DropdownLoading.tsx
|
|
945
|
-
var
|
|
1195
|
+
var ut = U("loading", "Dropdown.Loading"), dt = ({ children: e }) => /* @__PURE__ */ n("li", {
|
|
946
1196
|
role: "presentation",
|
|
947
1197
|
"aria-live": "polite",
|
|
948
|
-
className:
|
|
1198
|
+
className: Ge.empty,
|
|
949
1199
|
children: e ?? "Loading actions..."
|
|
950
1200
|
});
|
|
951
|
-
|
|
952
|
-
var
|
|
1201
|
+
dt.displayName = "DropdownLoadingSurface";
|
|
1202
|
+
var ft = { separator: "_separator_1v11r_1" }, pt = U("separator", "Dropdown.Separator"), mt = ({ className: e }) => /* @__PURE__ */ n("li", {
|
|
953
1203
|
role: "separator",
|
|
954
|
-
className:
|
|
1204
|
+
className: V(ft.separator, e),
|
|
955
1205
|
"aria-hidden": "true"
|
|
956
1206
|
});
|
|
957
|
-
|
|
1207
|
+
mt.displayName = "DropdownSeparatorSurface";
|
|
958
1208
|
//#endregion
|
|
959
1209
|
//#region src/components/Dropdown/Content/DropdownContent.tsx
|
|
960
|
-
var
|
|
961
|
-
let t =
|
|
1210
|
+
var ht = ({ className: e }) => {
|
|
1211
|
+
let t = tt(), { contentReadyToFocus: i, isOpen: o, setContentRef: s } = t, c = g(null), l = u((e) => {
|
|
962
1212
|
c.current = e, s(e);
|
|
963
1213
|
}, [s]);
|
|
964
1214
|
if (f(() => {
|
|
965
1215
|
let e = c.current;
|
|
966
1216
|
!o || !i || !e || e.contains(document.activeElement) || e.focus({ preventScroll: !0 });
|
|
967
1217
|
}, [i, o]), !o) return null;
|
|
968
|
-
let d =
|
|
1218
|
+
let d = V(Ge.dropdown, Ge[t.color], t.contentProps?.className, e), p = /* @__PURE__ */ r("ul", {
|
|
969
1219
|
ref: l,
|
|
970
1220
|
id: t.contentId,
|
|
971
1221
|
role: "menu",
|
|
@@ -982,9 +1232,9 @@ var Je = ({ className: e }) => {
|
|
|
982
1232
|
"data-color": t.color,
|
|
983
1233
|
children: [t.searchable && /* @__PURE__ */ r("li", {
|
|
984
1234
|
role: "presentation",
|
|
985
|
-
className:
|
|
986
|
-
children: [/* @__PURE__ */ n(
|
|
987
|
-
className:
|
|
1235
|
+
className: V(Ge.searchWrap, t.searchProps?.className),
|
|
1236
|
+
children: [/* @__PURE__ */ n(ee, { "aria-hidden": "true" }), /* @__PURE__ */ n("input", {
|
|
1237
|
+
className: Ge.search,
|
|
988
1238
|
value: t.searchValue,
|
|
989
1239
|
placeholder: t.searchPlaceholder,
|
|
990
1240
|
"aria-label": t.searchProps?.["aria-label"] ?? t.searchPlaceholder,
|
|
@@ -994,75 +1244,25 @@ var Je = ({ className: e }) => {
|
|
|
994
1244
|
e.key === "ArrowDown" || e.key === "ArrowUp" || e.key === "Enter" || e.key === "Escape" || e.stopPropagation();
|
|
995
1245
|
}
|
|
996
1246
|
})]
|
|
997
|
-
}), t.loading ? /* @__PURE__ */ n(
|
|
1247
|
+
}), t.loading ? /* @__PURE__ */ n(dt, { children: t.loadingText }) : t.searchable && t.items.length === 0 ? /* @__PURE__ */ n(qe, { children: t.empty }) : t.entries.length ? t.entries.map((e) => e.type === "groupStart" ? /* @__PURE__ */ n(Ye, {}, e.id) : e.type === "groupEnd" ? null : e.type === "label" ? /* @__PURE__ */ n(lt, { ...e.props }, e.id) : e.type === "separator" ? /* @__PURE__ */ n(mt, { ...e.props }, e.id) : e.type === "empty" ? /* @__PURE__ */ n(qe, { children: e.props.children }, e.id) : e.type === "loading" ? /* @__PURE__ */ n(dt, { children: e.props.children }, e.id) : e.type === "arrow" ? /* @__PURE__ */ n(H, { ...e.props }, e.id) : /* @__PURE__ */ n(a, { children: /* @__PURE__ */ n(it, {
|
|
998
1248
|
item: e.item,
|
|
999
1249
|
itemIndex: e.itemIndex
|
|
1000
|
-
}) }, e.item.id)) : /* @__PURE__ */ n(
|
|
1250
|
+
}) }, e.item.id)) : /* @__PURE__ */ n(qe, {})]
|
|
1001
1251
|
});
|
|
1002
|
-
return t.portal ? /* @__PURE__ */ n(
|
|
1252
|
+
return t.portal ? /* @__PURE__ */ n(We, { children: p }) : p;
|
|
1003
1253
|
};
|
|
1004
|
-
|
|
1254
|
+
ht.__velliraDropdownPart = "content", ht.displayName = "Dropdown.Content";
|
|
1005
1255
|
//#endregion
|
|
1006
1256
|
//#region src/components/Dropdown/ItemBadge/DropdownItemBadge.tsx
|
|
1007
|
-
var
|
|
1008
|
-
let [t, n] = _(() => typeof window > "u" || typeof window.matchMedia != "function" || !e ? !1 : window.matchMedia(`(max-width: ${e}px)`).matches);
|
|
1009
|
-
return f(() => {
|
|
1010
|
-
if (typeof window > "u" || typeof window.matchMedia != "function" || !e) return;
|
|
1011
|
-
let t = window.matchMedia(`(max-width: ${e}px)`), r = () => n(t.matches);
|
|
1012
|
-
return r(), t.addEventListener("change", r), () => {
|
|
1013
|
-
t.removeEventListener("change", r);
|
|
1014
|
-
};
|
|
1015
|
-
}, [e]), t;
|
|
1016
|
-
}, nt = ({ open: e, onOpenChange: t, placement: n = "bottom-start", strategy: r = "fixed", offset: i = 2, collisionPadding: a = 8, matchTriggerWidth: o = !1, avoidCollisions: s = !0, mobileSheetBreakpoint: c, middleware: l = [] } = {}) => {
|
|
1017
|
-
let u = tt(c), { refs: d, floatingStyles: p, isPositioned: m, update: g, context: _, middlewareData: v, placement: y } = j({
|
|
1018
|
-
open: e,
|
|
1019
|
-
onOpenChange: t,
|
|
1020
|
-
placement: n,
|
|
1021
|
-
strategy: r,
|
|
1022
|
-
transform: !1,
|
|
1023
|
-
middleware: h(() => [
|
|
1024
|
-
O(i),
|
|
1025
|
-
...s ? [D({ padding: a })] : [],
|
|
1026
|
-
A({ apply({ rects: e, elements: t }) {
|
|
1027
|
-
!o || u || Object.assign(t.floating.style, { width: `${e.reference.width}px` });
|
|
1028
|
-
} }),
|
|
1029
|
-
...s ? [k({ padding: a })] : [],
|
|
1030
|
-
...l
|
|
1031
|
-
], [
|
|
1032
|
-
s,
|
|
1033
|
-
a,
|
|
1034
|
-
l,
|
|
1035
|
-
u,
|
|
1036
|
-
o,
|
|
1037
|
-
i
|
|
1038
|
-
]),
|
|
1039
|
-
whileElementsMounted: E
|
|
1040
|
-
});
|
|
1041
|
-
return f(() => {
|
|
1042
|
-
u && d.floating.current?.style.removeProperty("width");
|
|
1043
|
-
}, [u, d.floating]), {
|
|
1044
|
-
context: _,
|
|
1045
|
-
placement: y,
|
|
1046
|
-
middlewareData: v,
|
|
1047
|
-
isPositioned: m,
|
|
1048
|
-
floatingStyles: u ? {} : {
|
|
1049
|
-
...p,
|
|
1050
|
-
visibility: e && !m ? "hidden" : p.visibility
|
|
1051
|
-
},
|
|
1052
|
-
isMobileSheet: u,
|
|
1053
|
-
setRef: d.setReference,
|
|
1054
|
-
setFloatingRef: d.setFloating,
|
|
1055
|
-
updatePosition: g
|
|
1056
|
-
};
|
|
1057
|
-
};
|
|
1257
|
+
var gt = U("itemBadge", "Dropdown.ItemBadge"), _t = U("itemDescription", "Dropdown.ItemDescription"), vt = U("itemIcon", "Dropdown.ItemIcon"), yt = U("itemShortcut", "Dropdown.ItemShortcut"), bt = U("radioGroup", "Dropdown.RadioGroup"), xt = U("radioItem", "Dropdown.RadioItem");
|
|
1058
1258
|
//#endregion
|
|
1059
1259
|
//#region src/components/Dropdown/internal/composeEventHandlers.ts
|
|
1060
|
-
function
|
|
1260
|
+
function St(e, t) {
|
|
1061
1261
|
return (n) => {
|
|
1062
1262
|
e?.(n), n.defaultPrevented || t(n);
|
|
1063
1263
|
};
|
|
1064
1264
|
}
|
|
1065
|
-
function
|
|
1265
|
+
function Ct(...e) {
|
|
1066
1266
|
return (t) => {
|
|
1067
1267
|
e.forEach((e) => {
|
|
1068
1268
|
if (e) {
|
|
@@ -1075,67 +1275,65 @@ function it(...e) {
|
|
|
1075
1275
|
});
|
|
1076
1276
|
};
|
|
1077
1277
|
}
|
|
1078
|
-
function
|
|
1278
|
+
function wt(e) {
|
|
1079
1279
|
return typeof e == "number" ? `${e}px` : e;
|
|
1080
1280
|
}
|
|
1081
|
-
var
|
|
1082
|
-
let
|
|
1281
|
+
var Tt = { wrapper: "_wrapper_14ue8_1" }, Et = ({ children: e, open: t, defaultOpen: i = !1, onOpenChange: a, size: o = "md", color: s = "primary", placement: c = "bottom-start", strategy: l, offset: d = 2, collisionPadding: m = 8, matchTriggerWidth: v = !1, minWidth: y, maxWidth: b, portal: x = !0, avoidCollisions: S = !0, modal: C = !1, closeOnSelect: w = !0, loop: T = !0, disabled: E = !1, loading: D = !1, loadingText: O = "Loading actions...", searchable: k = !1, command: A = !1, searchValue: j, defaultSearchValue: M = "", searchPlaceholder: N, onSearch: P, empty: F, className: I }) => {
|
|
1282
|
+
let L = p(), R = `${L}-trigger`, z = `${L}-menu`, B = g(null), ee = g(null), [te, H] = _(), [U, re] = _({}), [W, ie] = _(M), ae = j ?? W, G = h(() => ne(e), [e]), oe = G.content?.props.command ?? !1, se = k || A || oe || !!G.search, ce = h(() => Ot(G.items), [G.items]), le = h(() => G.items.map((e) => ({
|
|
1083
1283
|
disabled: e.disabled,
|
|
1084
1284
|
label: e.label
|
|
1085
|
-
})), [G.items]),
|
|
1086
|
-
|
|
1285
|
+
})), [G.items]), K = h(() => !se || !ae.trim() ? G : kt(G, ae), [
|
|
1286
|
+
se,
|
|
1087
1287
|
G,
|
|
1088
1288
|
ae
|
|
1089
|
-
]),
|
|
1289
|
+
]), ue = h(() => K.items.map((e) => ({
|
|
1090
1290
|
disabled: e.disabled,
|
|
1091
1291
|
label: e.label
|
|
1092
|
-
})), [
|
|
1292
|
+
})), [K.items]);
|
|
1093
1293
|
f(() => {
|
|
1094
1294
|
re((e) => {
|
|
1095
1295
|
let t = { ...e };
|
|
1096
|
-
return
|
|
1296
|
+
return ce.forEach((e) => {
|
|
1097
1297
|
e.type === "radio" && t[e.groupId] === void 0 && (t[e.groupId] = e.groupProps?.value ?? e.groupProps?.defaultValue);
|
|
1098
1298
|
}), t;
|
|
1099
1299
|
});
|
|
1100
|
-
}, [
|
|
1101
|
-
let { activeIndex:
|
|
1102
|
-
items:
|
|
1300
|
+
}, [ce]);
|
|
1301
|
+
let { activeIndex: de, setActiveIndex: fe, isOpen: pe, closeDropdown: me, toggleDropdown: he, onKeyDown: ge } = Re({
|
|
1302
|
+
items: se ? ue : le,
|
|
1103
1303
|
open: t,
|
|
1104
1304
|
defaultOpen: i,
|
|
1105
1305
|
disabled: E,
|
|
1106
1306
|
onOpenChange: a,
|
|
1107
|
-
getItemValue: (e, t) => (
|
|
1307
|
+
getItemValue: (e, t) => (se ? K.items : G.items)[t]?.id ?? "",
|
|
1108
1308
|
getItemText: (e) => e.label,
|
|
1109
1309
|
loop: T
|
|
1110
|
-
}), { floatingStyles:
|
|
1111
|
-
open:
|
|
1310
|
+
}), { floatingStyles: _e, isMobileSheet: ve, isPositioned: ye, setRef: be, setFloatingRef: xe } = Ae({
|
|
1311
|
+
open: pe,
|
|
1112
1312
|
placement: c,
|
|
1113
|
-
strategy: l
|
|
1313
|
+
strategy: l,
|
|
1314
|
+
portal: x,
|
|
1114
1315
|
matchTriggerWidth: v,
|
|
1115
1316
|
avoidCollisions: S,
|
|
1116
1317
|
offset: d,
|
|
1117
1318
|
collisionPadding: m,
|
|
1118
1319
|
mobileSheetBreakpoint: 640
|
|
1119
|
-
}),
|
|
1120
|
-
j === void 0 && ie(e), P?.(e),
|
|
1320
|
+
}), Se = u((e) => {
|
|
1321
|
+
j === void 0 && ie(e), P?.(e), fe(0);
|
|
1121
1322
|
}, [
|
|
1122
1323
|
P,
|
|
1123
1324
|
j,
|
|
1124
|
-
|
|
1125
|
-
])
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
});
|
|
1129
|
-
fe({
|
|
1130
|
-
active: ge,
|
|
1325
|
+
fe
|
|
1326
|
+
]);
|
|
1327
|
+
Pe({
|
|
1328
|
+
active: pe,
|
|
1131
1329
|
enabled: C
|
|
1132
1330
|
});
|
|
1133
|
-
let
|
|
1134
|
-
|
|
1135
|
-
}, [
|
|
1331
|
+
let Ce = u(() => {
|
|
1332
|
+
me(), B.current?.focus();
|
|
1333
|
+
}, [me]), q = u((e, t) => {
|
|
1136
1334
|
if (e.disabled || D) return;
|
|
1137
1335
|
if (e.type === "subTrigger") {
|
|
1138
|
-
|
|
1336
|
+
H(e.id);
|
|
1139
1337
|
return;
|
|
1140
1338
|
}
|
|
1141
1339
|
e.type === "item" && e.props.onSelect?.(t), e.type === "radio" && (re((t) => ({
|
|
@@ -1143,116 +1341,116 @@ var ot = { wrapper: "_wrapper_14ue8_1" }, st = ({ children: e, open: t, defaultO
|
|
|
1143
1341
|
[e.groupId]: e.props.value
|
|
1144
1342
|
})), e.groupProps?.onValueChange?.(e.props.value));
|
|
1145
1343
|
let n = e.props.closeOnSelect ?? (e.type !== "checkbox" && w);
|
|
1146
|
-
!t.defaultPrevented && n &&
|
|
1344
|
+
!t.defaultPrevented && n && Ce();
|
|
1147
1345
|
}, [
|
|
1148
|
-
|
|
1346
|
+
Ce,
|
|
1149
1347
|
w,
|
|
1150
1348
|
D
|
|
1151
|
-
]),
|
|
1152
|
-
let t =
|
|
1349
|
+
]), we = u((e) => {
|
|
1350
|
+
let t = K.items[de];
|
|
1153
1351
|
if (e.key === "ArrowRight" && t?.type === "subTrigger") {
|
|
1154
|
-
e.preventDefault(),
|
|
1352
|
+
e.preventDefault(), H(t.id);
|
|
1155
1353
|
return;
|
|
1156
1354
|
}
|
|
1157
|
-
if (e.key === "ArrowLeft" &&
|
|
1158
|
-
e.preventDefault(),
|
|
1355
|
+
if (e.key === "ArrowLeft" && te) {
|
|
1356
|
+
e.preventDefault(), H(void 0);
|
|
1159
1357
|
return;
|
|
1160
1358
|
}
|
|
1161
1359
|
if ((e.key === "Enter" || e.key === " ") && t) {
|
|
1162
1360
|
e.preventDefault();
|
|
1163
|
-
let n =
|
|
1164
|
-
|
|
1361
|
+
let n = Dt(e);
|
|
1362
|
+
q(t, n);
|
|
1165
1363
|
return;
|
|
1166
1364
|
}
|
|
1167
|
-
|
|
1365
|
+
ge(e), e.key === "Escape" && B.current?.focus();
|
|
1168
1366
|
}, [
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
]),
|
|
1175
|
-
e.preventDefault(),
|
|
1176
|
-
}, [
|
|
1177
|
-
|
|
1178
|
-
}, [
|
|
1179
|
-
|
|
1180
|
-
}, [
|
|
1181
|
-
|
|
1182
|
-
|
|
1367
|
+
de,
|
|
1368
|
+
K.items,
|
|
1369
|
+
ge,
|
|
1370
|
+
te,
|
|
1371
|
+
q
|
|
1372
|
+
]), Te = u((e) => {
|
|
1373
|
+
e.preventDefault(), he();
|
|
1374
|
+
}, [he]), Ee = u((e) => {
|
|
1375
|
+
B.current = e, be(e);
|
|
1376
|
+
}, [be]), De = u((e) => {
|
|
1377
|
+
ee.current = e, xe(e), ve && e?.focus({ preventScroll: !0 });
|
|
1378
|
+
}, [ve, xe]), Oe = ke({
|
|
1379
|
+
active: pe,
|
|
1380
|
+
id: z,
|
|
1381
|
+
zIndexLevel: "dropdown",
|
|
1183
1382
|
closeOnEscape: !0,
|
|
1184
1383
|
closeOnOutsidePress: !0,
|
|
1185
|
-
contentRef:
|
|
1186
|
-
ignoreRefs: [
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
maxWidth: at(b)
|
|
1384
|
+
contentRef: ee,
|
|
1385
|
+
ignoreRefs: [B],
|
|
1386
|
+
requestClose: () => me()
|
|
1387
|
+
}), je = {
|
|
1388
|
+
..._e,
|
|
1389
|
+
zIndex: Oe.zIndex,
|
|
1390
|
+
minWidth: wt(y),
|
|
1391
|
+
maxWidth: wt(b)
|
|
1194
1392
|
};
|
|
1195
|
-
return /* @__PURE__ */ n(
|
|
1393
|
+
return /* @__PURE__ */ n(et, {
|
|
1196
1394
|
value: {
|
|
1197
1395
|
disabled: E,
|
|
1198
|
-
isOpen:
|
|
1199
|
-
contentId:
|
|
1200
|
-
triggerId:
|
|
1201
|
-
setTriggerRef:
|
|
1202
|
-
onClick:
|
|
1203
|
-
onKeyDown:
|
|
1396
|
+
isOpen: pe,
|
|
1397
|
+
contentId: z,
|
|
1398
|
+
triggerId: R,
|
|
1399
|
+
setTriggerRef: Ee,
|
|
1400
|
+
onClick: Te,
|
|
1401
|
+
onKeyDown: we
|
|
1204
1402
|
},
|
|
1205
|
-
children: /* @__PURE__ */ n(
|
|
1403
|
+
children: /* @__PURE__ */ n($e, {
|
|
1206
1404
|
value: {
|
|
1207
|
-
activeIndex:
|
|
1405
|
+
activeIndex: de,
|
|
1208
1406
|
closeOnSelect: w,
|
|
1209
1407
|
color: s,
|
|
1210
|
-
contentReadyToFocus:
|
|
1211
|
-
contentId:
|
|
1408
|
+
contentReadyToFocus: ve || ye,
|
|
1409
|
+
contentId: z,
|
|
1212
1410
|
contentProps: G.content?.props,
|
|
1213
1411
|
disabled: E,
|
|
1214
|
-
entries:
|
|
1215
|
-
getItemId: (e) => `${
|
|
1216
|
-
isOpen:
|
|
1217
|
-
items:
|
|
1412
|
+
entries: K.entries,
|
|
1413
|
+
getItemId: (e) => `${z}-item-${e}`,
|
|
1414
|
+
isOpen: pe,
|
|
1415
|
+
items: K.items,
|
|
1218
1416
|
loading: D,
|
|
1219
1417
|
loadingText: O,
|
|
1220
1418
|
empty: F,
|
|
1221
1419
|
maxWidth: b,
|
|
1222
1420
|
minWidth: y,
|
|
1223
|
-
openSubId:
|
|
1224
|
-
onKeyDown:
|
|
1421
|
+
openSubId: te,
|
|
1422
|
+
onKeyDown: we,
|
|
1225
1423
|
portal: !G.portal && x,
|
|
1226
|
-
radioValues:
|
|
1227
|
-
searchPlaceholder: G.search?.props.placeholder ?? N ?? (A ||
|
|
1424
|
+
radioValues: U,
|
|
1425
|
+
searchPlaceholder: G.search?.props.placeholder ?? N ?? (A || oe ? "Type a command..." : "Search actions..."),
|
|
1228
1426
|
searchProps: G.search?.props,
|
|
1229
1427
|
searchValue: ae,
|
|
1230
|
-
searchable:
|
|
1231
|
-
selectItem:
|
|
1232
|
-
setActiveIndex:
|
|
1233
|
-
setContentRef:
|
|
1234
|
-
setOpenSubId:
|
|
1428
|
+
searchable: se,
|
|
1429
|
+
selectItem: q,
|
|
1430
|
+
setActiveIndex: fe,
|
|
1431
|
+
setContentRef: De,
|
|
1432
|
+
setOpenSubId: H,
|
|
1235
1433
|
setRadioValue: (e, t) => {
|
|
1236
1434
|
re((n) => ({
|
|
1237
1435
|
...n,
|
|
1238
1436
|
[e]: t
|
|
1239
1437
|
}));
|
|
1240
1438
|
},
|
|
1241
|
-
setSearchValue:
|
|
1439
|
+
setSearchValue: Se,
|
|
1242
1440
|
size: o,
|
|
1243
|
-
surfaceStyle:
|
|
1244
|
-
triggerId:
|
|
1441
|
+
surfaceStyle: je,
|
|
1442
|
+
triggerId: R
|
|
1245
1443
|
},
|
|
1246
1444
|
children: /* @__PURE__ */ r("div", {
|
|
1247
|
-
className:
|
|
1445
|
+
className: V(Tt.wrapper, I),
|
|
1248
1446
|
"data-disabled": E || void 0,
|
|
1249
|
-
children: [G.trigger ?? null, G.portal ?? G.content ?? /* @__PURE__ */ n(
|
|
1447
|
+
children: [G.trigger ?? null, G.portal ?? G.content ?? /* @__PURE__ */ n(ht, {})]
|
|
1250
1448
|
})
|
|
1251
1449
|
})
|
|
1252
1450
|
});
|
|
1253
1451
|
};
|
|
1254
|
-
|
|
1255
|
-
function
|
|
1452
|
+
Et.displayName = "DropdownRoot";
|
|
1453
|
+
function Dt(e) {
|
|
1256
1454
|
let t = !1;
|
|
1257
1455
|
return {
|
|
1258
1456
|
originalEvent: e,
|
|
@@ -1264,13 +1462,13 @@ function ct(e) {
|
|
|
1264
1462
|
}
|
|
1265
1463
|
};
|
|
1266
1464
|
}
|
|
1267
|
-
function
|
|
1465
|
+
function Ot(e) {
|
|
1268
1466
|
let t = [];
|
|
1269
1467
|
return e.forEach((e) => {
|
|
1270
|
-
t.push(e), e.type === "subTrigger" && t.push(...
|
|
1468
|
+
t.push(e), e.type === "subTrigger" && t.push(...Ot(e.subItems));
|
|
1271
1469
|
}), t;
|
|
1272
1470
|
}
|
|
1273
|
-
function
|
|
1471
|
+
function kt(e, t) {
|
|
1274
1472
|
let n = t.trim().toLocaleLowerCase(), r = new Set(e.items.filter((e) => e.label.toLocaleLowerCase().includes(n)).map((e) => e.id)), i = e.items.filter((e) => r.has(e.id));
|
|
1275
1473
|
return {
|
|
1276
1474
|
...e,
|
|
@@ -1280,7 +1478,7 @@ function ut(e, t) {
|
|
|
1280
1478
|
}
|
|
1281
1479
|
//#endregion
|
|
1282
1480
|
//#region src/components/Dropdown/Search/DropdownSearch.tsx
|
|
1283
|
-
var
|
|
1481
|
+
var At = U("search", "Dropdown.Search"), jt = U("subContent", "Dropdown.SubContent"), Mt = U("subTrigger", "Dropdown.SubTrigger"), Nt = U("sub", "Dropdown.Sub"), Pt = {
|
|
1284
1482
|
button: "_button_bb3ib_1",
|
|
1285
1483
|
disabled: "_disabled_bb3ib_63",
|
|
1286
1484
|
arrow: "_arrow_bb3ib_71",
|
|
@@ -1296,91 +1494,91 @@ var dt = z("search", "Dropdown.Search"), ft = z("subContent", "Dropdown.SubConte
|
|
|
1296
1494
|
lg: "_lg_bb3ib_350",
|
|
1297
1495
|
label: "_label_bb3ib_362",
|
|
1298
1496
|
open: "_open_bb3ib_390"
|
|
1299
|
-
},
|
|
1300
|
-
|
|
1301
|
-
var
|
|
1302
|
-
let s =
|
|
1497
|
+
}, Ft = (e) => /* @__PURE__ */ n(It, { ...e });
|
|
1498
|
+
Ft.__velliraDropdownPart = "trigger", Ft.displayName = "Dropdown.Trigger";
|
|
1499
|
+
var It = ({ children: e, asChild: t = !1, disabled: i, className: a }) => {
|
|
1500
|
+
let s = tt(), c = nt(), u = t && l(e) ? e : void 0, d = s.disabled || i, f = {
|
|
1303
1501
|
id: c.triggerId,
|
|
1304
|
-
ref: u ?
|
|
1502
|
+
ref: u ? Ct(u.props.ref, c.setTriggerRef) : c.setTriggerRef,
|
|
1305
1503
|
"aria-controls": c.isOpen ? c.contentId : void 0,
|
|
1306
1504
|
"aria-disabled": d || void 0,
|
|
1307
1505
|
"aria-expanded": c.isOpen,
|
|
1308
1506
|
"aria-haspopup": "menu",
|
|
1309
|
-
className:
|
|
1507
|
+
className: V(!u && Pt.button, !u && Pt[s.size], !u && Pt[s.color], a),
|
|
1310
1508
|
"data-state": c.isOpen ? "open" : "closed",
|
|
1311
1509
|
disabled: d || void 0,
|
|
1312
|
-
onClick:
|
|
1313
|
-
onKeyDown:
|
|
1510
|
+
onClick: St(u?.props.onClick, c.onClick),
|
|
1511
|
+
onKeyDown: St(u?.props.onKeyDown, c.onKeyDown)
|
|
1314
1512
|
};
|
|
1315
1513
|
return u ? o(u, {
|
|
1316
1514
|
...f,
|
|
1317
|
-
className:
|
|
1515
|
+
className: V(u.props.className, a)
|
|
1318
1516
|
}) : /* @__PURE__ */ r("button", {
|
|
1319
1517
|
type: "button",
|
|
1320
1518
|
...f,
|
|
1321
1519
|
children: [/* @__PURE__ */ n("span", {
|
|
1322
|
-
className:
|
|
1520
|
+
className: Pt.label,
|
|
1323
1521
|
children: e
|
|
1324
1522
|
}), /* @__PURE__ */ n("span", {
|
|
1325
|
-
className:
|
|
1523
|
+
className: V(Pt.arrow, { [Pt.open]: c.isOpen }),
|
|
1326
1524
|
"aria-hidden": "true",
|
|
1327
|
-
children: /* @__PURE__ */ n(
|
|
1525
|
+
children: /* @__PURE__ */ n(R, {})
|
|
1328
1526
|
})]
|
|
1329
1527
|
});
|
|
1330
1528
|
};
|
|
1331
|
-
|
|
1529
|
+
It.displayName = "DropdownTriggerSurface";
|
|
1332
1530
|
//#endregion
|
|
1333
1531
|
//#region src/components/Dropdown/Dropdown.tsx
|
|
1334
|
-
var
|
|
1335
|
-
Trigger:
|
|
1336
|
-
Content:
|
|
1337
|
-
Search:
|
|
1338
|
-
Item:
|
|
1339
|
-
CheckboxItem:
|
|
1340
|
-
RadioGroup:
|
|
1341
|
-
RadioItem:
|
|
1342
|
-
Group:
|
|
1343
|
-
Label:
|
|
1344
|
-
Separator:
|
|
1345
|
-
Sub:
|
|
1346
|
-
SubTrigger:
|
|
1347
|
-
SubContent:
|
|
1348
|
-
ItemIcon:
|
|
1349
|
-
ItemDescription:
|
|
1350
|
-
ItemBadge:
|
|
1351
|
-
ItemShortcut:
|
|
1352
|
-
Arrow:
|
|
1353
|
-
Empty:
|
|
1354
|
-
Loading:
|
|
1532
|
+
var Lt = Object.assign(Et, {
|
|
1533
|
+
Trigger: Ft,
|
|
1534
|
+
Content: ht,
|
|
1535
|
+
Search: At,
|
|
1536
|
+
Item: rt,
|
|
1537
|
+
CheckboxItem: ae,
|
|
1538
|
+
RadioGroup: bt,
|
|
1539
|
+
RadioItem: xt,
|
|
1540
|
+
Group: Je,
|
|
1541
|
+
Label: ct,
|
|
1542
|
+
Separator: pt,
|
|
1543
|
+
Sub: Nt,
|
|
1544
|
+
SubTrigger: Mt,
|
|
1545
|
+
SubContent: jt,
|
|
1546
|
+
ItemIcon: vt,
|
|
1547
|
+
ItemDescription: _t,
|
|
1548
|
+
ItemBadge: gt,
|
|
1549
|
+
ItemShortcut: yt,
|
|
1550
|
+
Arrow: H,
|
|
1551
|
+
Empty: Ke,
|
|
1552
|
+
Loading: ut
|
|
1355
1553
|
});
|
|
1356
|
-
|
|
1554
|
+
Lt.displayName = "Dropdown";
|
|
1357
1555
|
//#endregion
|
|
1358
1556
|
//#region src/components/Modal/internal/ModalContext.tsx
|
|
1359
|
-
var
|
|
1360
|
-
let e = d(
|
|
1557
|
+
var Rt = s(void 0), zt = s(void 0), Bt = () => {
|
|
1558
|
+
let e = d(Rt);
|
|
1361
1559
|
if (e === void 0) throw Error("Modal compound components must be used inside Modal");
|
|
1362
1560
|
return e;
|
|
1363
|
-
},
|
|
1364
|
-
|
|
1365
|
-
var
|
|
1561
|
+
}, Vt = () => d(zt), Ht = Rt.Provider, Ut = zt.Provider;
|
|
1562
|
+
Rt.displayName = "ModalContext", zt.displayName = "ModalContentContext";
|
|
1563
|
+
var Wt = {
|
|
1366
1564
|
modalBody: "_modalBody_ou4ff_1",
|
|
1367
1565
|
inside: "_inside_ou4ff_6"
|
|
1368
|
-
},
|
|
1369
|
-
let r =
|
|
1566
|
+
}, Gt = ({ children: e, className: t }) => {
|
|
1567
|
+
let r = Vt();
|
|
1370
1568
|
return /* @__PURE__ */ n("div", {
|
|
1371
|
-
className:
|
|
1569
|
+
className: V(Wt.modalBody, r?.scrollBehavior === "inside" && Wt.inside, t),
|
|
1372
1570
|
children: e
|
|
1373
1571
|
});
|
|
1374
1572
|
};
|
|
1375
|
-
|
|
1573
|
+
Gt.displayName = "ModalBody";
|
|
1376
1574
|
//#endregion
|
|
1377
1575
|
//#region src/components/Modal/internal/composeEventHandlers.ts
|
|
1378
|
-
function
|
|
1576
|
+
function Kt(e, t) {
|
|
1379
1577
|
return (n) => {
|
|
1380
1578
|
e?.(n), n.defaultPrevented || t(n);
|
|
1381
1579
|
};
|
|
1382
1580
|
}
|
|
1383
|
-
function
|
|
1581
|
+
function qt(...e) {
|
|
1384
1582
|
return (t) => {
|
|
1385
1583
|
e.forEach((e) => {
|
|
1386
1584
|
if (e) {
|
|
@@ -1393,44 +1591,30 @@ function Ot(...e) {
|
|
|
1393
1591
|
});
|
|
1394
1592
|
};
|
|
1395
1593
|
}
|
|
1396
|
-
var
|
|
1594
|
+
var Jt = {
|
|
1397
1595
|
modalHeader: "_modalHeader_hw9hl_1",
|
|
1398
1596
|
modalHeaderText: "_modalHeaderText_hw9hl_8",
|
|
1399
1597
|
modalHeaderTitle: "_modalHeaderTitle_hw9hl_13",
|
|
1400
1598
|
modalHeaderDescription: "_modalHeaderDescription_hw9hl_20",
|
|
1401
1599
|
modalHeaderCloseButton: "_modalHeaderCloseButton_hw9hl_26"
|
|
1402
|
-
},
|
|
1403
|
-
let a =
|
|
1600
|
+
}, Yt = ({ asChild: e = !1, children: t, className: r, "aria-label": i }) => {
|
|
1601
|
+
let a = Bt(), s = e && l(t) ? t : void 0, c = {
|
|
1404
1602
|
"aria-label": s ? i : i ?? "Close dialog",
|
|
1405
|
-
className:
|
|
1406
|
-
onClick:
|
|
1603
|
+
className: V(!s && Jt.modalHeaderCloseButton, r),
|
|
1604
|
+
onClick: Kt(s?.props.onClick, a.requestClose)
|
|
1407
1605
|
};
|
|
1408
1606
|
return s ? o(s, {
|
|
1409
1607
|
...c,
|
|
1410
|
-
className:
|
|
1608
|
+
className: V(s.props.className, r),
|
|
1411
1609
|
"aria-label": i ?? s.props["aria-label"]
|
|
1412
1610
|
}) : /* @__PURE__ */ n("button", {
|
|
1413
1611
|
type: "button",
|
|
1414
1612
|
...c,
|
|
1415
|
-
children: /* @__PURE__ */ n(
|
|
1613
|
+
children: /* @__PURE__ */ n(B, { size: 16 })
|
|
1416
1614
|
});
|
|
1417
1615
|
};
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
//#region src/components/Modal/internal/useModalDismiss.ts
|
|
1421
|
-
var jt = ({ active: e, contentRef: t, closeOnEscape: n, closeOnOutsidePress: r, isTopModal: i, onEscapeKeyDown: a, onPointerDownOutside: o, onInteractOutside: s, requestClose: c }) => {
|
|
1422
|
-
oe({
|
|
1423
|
-
active: e,
|
|
1424
|
-
closeOnOutsidePress: r,
|
|
1425
|
-
closeOnEscape: n,
|
|
1426
|
-
contentRef: t,
|
|
1427
|
-
isTopOverlay: i,
|
|
1428
|
-
onEscapeKeyDown: a ? (e) => a(e) : void 0,
|
|
1429
|
-
onInteractOutside: s ? (e) => s(e) : void 0,
|
|
1430
|
-
onPointerDownOutside: o ? (e) => o(e) : void 0,
|
|
1431
|
-
requestClose: c
|
|
1432
|
-
});
|
|
1433
|
-
}, Mt = {
|
|
1616
|
+
Yt.displayName = "Modal.Close";
|
|
1617
|
+
var Xt = {
|
|
1434
1618
|
content: "_content_1tnw8_1",
|
|
1435
1619
|
animated: "_animated_1tnw8_24",
|
|
1436
1620
|
"modal-content-open": "_modal-content-open_1tnw8_1",
|
|
@@ -1444,21 +1628,11 @@ var jt = ({ active: e, contentRef: t, closeOnEscape: n, closeOnOutsidePress: r,
|
|
|
1444
1628
|
full: "_full_1tnw8_107",
|
|
1445
1629
|
inside: "_inside_1tnw8_113",
|
|
1446
1630
|
outside: "_outside_1tnw8_117"
|
|
1447
|
-
},
|
|
1448
|
-
let p =
|
|
1631
|
+
}, Zt = ({ children: e, size: t = "md", placement: r = "center", scrollBehavior: i = "inside", animated: a = !0, forceMount: o = !1, ariaLabel: s, ariaLabelledBy: c, ariaDescribedBy: l, className: d, style: f }) => {
|
|
1632
|
+
let p = Bt(), m = p.open, h = m && p.shouldRender, [g, v] = _(null), y = u((e) => {
|
|
1449
1633
|
p.setContentRef(e), v(e);
|
|
1450
1634
|
}, [p]);
|
|
1451
|
-
if (
|
|
1452
|
-
active: m,
|
|
1453
|
-
contentRef: p.contentRef,
|
|
1454
|
-
closeOnEscape: p.closeOnEscape,
|
|
1455
|
-
closeOnOutsidePress: p.closeOnOutsidePress,
|
|
1456
|
-
isTopModal: p.isTopModal,
|
|
1457
|
-
onEscapeKeyDown: p.onEscapeKeyDown,
|
|
1458
|
-
onInteractOutside: p.onInteractOutside,
|
|
1459
|
-
onPointerDownOutside: p.onPointerDownOutside,
|
|
1460
|
-
requestClose: p.requestClose
|
|
1461
|
-
}), G({
|
|
1635
|
+
if (fe({
|
|
1462
1636
|
active: h,
|
|
1463
1637
|
contentRef: p.contentRef,
|
|
1464
1638
|
enabled: p.trapFocus,
|
|
@@ -1467,19 +1641,19 @@ var jt = ({ active: e, contentRef: t, closeOnEscape: n, closeOnOutsidePress: r,
|
|
|
1467
1641
|
onCloseAutoFocus: p.onCloseAutoFocus,
|
|
1468
1642
|
onOpenAutoFocus: p.onOpenAutoFocus,
|
|
1469
1643
|
restoreFocus: p.restoreFocus
|
|
1470
|
-
}),
|
|
1644
|
+
}), G({
|
|
1471
1645
|
active: m,
|
|
1472
1646
|
content: g,
|
|
1473
1647
|
enabled: p.modal
|
|
1474
1648
|
}), !p.shouldRender && !o) return null;
|
|
1475
1649
|
let b = c ?? (s ? void 0 : p.titleId), x = l ?? p.descriptionId;
|
|
1476
|
-
return /* @__PURE__ */ n(
|
|
1650
|
+
return /* @__PURE__ */ n(Ut, {
|
|
1477
1651
|
value: { scrollBehavior: i },
|
|
1478
1652
|
children: /* @__PURE__ */ n("div", {
|
|
1479
1653
|
id: p.contentId,
|
|
1480
|
-
ref:
|
|
1654
|
+
ref: qt(y),
|
|
1481
1655
|
tabIndex: -1,
|
|
1482
|
-
className:
|
|
1656
|
+
className: V(Xt.content, Xt[t], Xt[r], Xt[i], a && Xt.animated, d),
|
|
1483
1657
|
style: {
|
|
1484
1658
|
...p.animationStyle,
|
|
1485
1659
|
...f
|
|
@@ -1495,130 +1669,155 @@ var jt = ({ active: e, contentRef: t, closeOnEscape: n, closeOnOutsidePress: r,
|
|
|
1495
1669
|
})
|
|
1496
1670
|
});
|
|
1497
1671
|
};
|
|
1498
|
-
|
|
1499
|
-
var
|
|
1500
|
-
className:
|
|
1672
|
+
Zt.displayName = "ModalContent";
|
|
1673
|
+
var Qt = { modalFooter: "_modalFooter_sb1pn_1" }, $t = ({ children: e, className: t }) => /* @__PURE__ */ n("div", {
|
|
1674
|
+
className: V(Qt.modalFooter, t),
|
|
1501
1675
|
children: e
|
|
1502
1676
|
});
|
|
1503
|
-
|
|
1677
|
+
$t.displayName = "ModalFooter";
|
|
1504
1678
|
//#endregion
|
|
1505
1679
|
//#region src/components/Modal/Header/ModalDescription.tsx
|
|
1506
|
-
var
|
|
1507
|
-
let { descriptionId: t, setDescriptionPresent: r } =
|
|
1680
|
+
var en = ({ children: e }) => {
|
|
1681
|
+
let { descriptionId: t, setDescriptionPresent: r } = Bt();
|
|
1508
1682
|
return f(() => (r(!0), () => r(!1)), [r]), /* @__PURE__ */ n("p", {
|
|
1509
1683
|
id: t,
|
|
1510
|
-
className:
|
|
1684
|
+
className: Jt.modalHeaderDescription,
|
|
1511
1685
|
children: e
|
|
1512
1686
|
});
|
|
1513
1687
|
};
|
|
1514
|
-
|
|
1688
|
+
en.displayName = "Modal.Description";
|
|
1515
1689
|
//#endregion
|
|
1516
1690
|
//#region src/components/Modal/Header/ModalHeader.tsx
|
|
1517
|
-
var
|
|
1518
|
-
className:
|
|
1691
|
+
var tn = ({ children: e, className: t }) => /* @__PURE__ */ n("div", {
|
|
1692
|
+
className: V(Jt.modalHeader, t),
|
|
1519
1693
|
children: e
|
|
1520
1694
|
});
|
|
1521
|
-
|
|
1695
|
+
tn.displayName = "ModalHeader";
|
|
1522
1696
|
//#endregion
|
|
1523
1697
|
//#region src/components/Modal/Header/ModalTitle.tsx
|
|
1524
|
-
var
|
|
1525
|
-
let { setTitlePresent: t, titleId: r } =
|
|
1698
|
+
var nn = ({ children: e }) => {
|
|
1699
|
+
let { setTitlePresent: t, titleId: r } = Bt();
|
|
1526
1700
|
return f(() => (t(!0), () => t(!1)), [t]), /* @__PURE__ */ n("h2", {
|
|
1527
1701
|
id: r,
|
|
1528
|
-
className:
|
|
1702
|
+
className: Jt.modalHeaderTitle,
|
|
1529
1703
|
children: e
|
|
1530
1704
|
});
|
|
1531
1705
|
};
|
|
1532
|
-
|
|
1533
|
-
var
|
|
1706
|
+
nn.displayName = "Modal.Title";
|
|
1707
|
+
var rn = {
|
|
1534
1708
|
overlay: "_overlay_d6wdf_1",
|
|
1535
1709
|
"overlay--open": "_overlay--open_d6wdf_10",
|
|
1536
1710
|
"overlay--animated": "_overlay--animated_d6wdf_15",
|
|
1537
1711
|
"modal-overlay-open": "_modal-overlay-open_d6wdf_1",
|
|
1538
1712
|
"modal-overlay-close": "_modal-overlay-close_d6wdf_1"
|
|
1539
|
-
},
|
|
1540
|
-
let { animation: i, animationStyle: a, open: o, shouldRender: s } =
|
|
1713
|
+
}, an = ({ className: e, animated: t = !0, forceMount: r = !1 }) => {
|
|
1714
|
+
let { animation: i, animationStyle: a, open: o, shouldRender: s } = Bt();
|
|
1541
1715
|
return !s && !r ? null : /* @__PURE__ */ n("div", {
|
|
1542
|
-
className:
|
|
1716
|
+
className: V(rn.overlay, o && rn["overlay--open"], t && rn["overlay--animated"], e),
|
|
1543
1717
|
style: a,
|
|
1544
1718
|
"data-state": o ? "open" : "closed",
|
|
1545
1719
|
"data-animation": i,
|
|
1546
1720
|
"aria-hidden": "true"
|
|
1547
1721
|
});
|
|
1548
1722
|
};
|
|
1549
|
-
|
|
1723
|
+
an.displayName = "ModalOverlay";
|
|
1550
1724
|
//#endregion
|
|
1551
|
-
//#region src/components/Modal/
|
|
1552
|
-
var
|
|
1553
|
-
|
|
1725
|
+
//#region src/components/Modal/internal/useModalDismiss.ts
|
|
1726
|
+
var on = ({ active: e, registrationActive: t = e, id: n, contentRef: r, closeOnEscape: i, closeOnOutsidePress: a, onEscapeKeyDown: o, onPointerDownOutside: s, onInteractOutside: c, requestClose: l }) => ke({
|
|
1727
|
+
active: e,
|
|
1728
|
+
registrationActive: t,
|
|
1729
|
+
id: n,
|
|
1730
|
+
zIndexLevel: "modal",
|
|
1731
|
+
closeOnOutsidePress: a,
|
|
1732
|
+
closeOnEscape: i,
|
|
1733
|
+
contentRef: r,
|
|
1734
|
+
onEscapeKeyDown: o ? (e) => o(e) : void 0,
|
|
1735
|
+
onInteractOutside: c ? (e) => c(e) : void 0,
|
|
1736
|
+
onPointerDownOutside: s ? (e) => s(e) : void 0,
|
|
1737
|
+
requestClose: l
|
|
1738
|
+
}), sn = {
|
|
1739
|
+
standard: I.components.modal.motion.easing,
|
|
1554
1740
|
linear: "linear",
|
|
1555
1741
|
ease: "ease",
|
|
1556
1742
|
"ease-in": "ease-in",
|
|
1557
1743
|
"ease-out": "ease-out",
|
|
1558
1744
|
"ease-in-out": "ease-in-out"
|
|
1559
|
-
},
|
|
1745
|
+
}, cn = (e) => Number.parseFloat(e), ln = (e) => typeof e == "number" ? {
|
|
1560
1746
|
close: e,
|
|
1561
1747
|
open: e
|
|
1562
1748
|
} : {
|
|
1563
|
-
close: e?.close ??
|
|
1564
|
-
open: e?.open ??
|
|
1565
|
-
},
|
|
1566
|
-
let O = g(null), { contentId: k, descriptionId: A, open: j, requestClose: M, setOpen: N, titleId: P } =
|
|
1749
|
+
close: e?.close ?? cn(I.components.modal.motion.closeDuration),
|
|
1750
|
+
open: e?.open ?? cn(I.components.modal.motion.openDuration)
|
|
1751
|
+
}, un = ({ children: e, open: t, defaultOpen: r = !1, onOpenChange: i, animation: a = "scale", duration: o, easing: s = "standard", modal: c = !0, closeOnEscape: l = !0, closeOnOutsidePress: d = !0, preventScroll: p = !0, restoreFocus: m = !0, trapFocus: v = !0, initialFocus: y, finalFocus: b, onOpenAutoFocus: x, onCloseAutoFocus: S, onEscapeKeyDown: C, onPointerDownOutside: w, onInteractOutside: T, role: E = "dialog", className: D }) => {
|
|
1752
|
+
let O = g(null), { contentId: k, descriptionId: A, open: j, requestClose: M, setOpen: N, titleId: P } = ze({
|
|
1567
1753
|
open: t,
|
|
1568
1754
|
defaultOpen: r,
|
|
1569
1755
|
onOpenChange: i,
|
|
1570
1756
|
closeOnEscape: l,
|
|
1571
1757
|
closeOnOutsidePress: d
|
|
1572
|
-
}), [F,
|
|
1758
|
+
}), [F, I] = _(!1), [L, R] = _(!1), z = ln(o), B = a === "none" ? 0 : z.close, [ee, te] = _(j);
|
|
1573
1759
|
f(() => {
|
|
1574
1760
|
if (j) {
|
|
1575
|
-
|
|
1761
|
+
te(!0);
|
|
1576
1762
|
return;
|
|
1577
1763
|
}
|
|
1578
|
-
if (
|
|
1579
|
-
|
|
1764
|
+
if (B === 0) {
|
|
1765
|
+
te(!1);
|
|
1580
1766
|
return;
|
|
1581
1767
|
}
|
|
1582
1768
|
let e = window.setTimeout(() => {
|
|
1583
|
-
|
|
1584
|
-
},
|
|
1769
|
+
te(!1);
|
|
1770
|
+
}, B);
|
|
1585
1771
|
return () => {
|
|
1586
1772
|
window.clearTimeout(e);
|
|
1587
1773
|
};
|
|
1588
|
-
}, [
|
|
1589
|
-
let
|
|
1774
|
+
}, [B, j]);
|
|
1775
|
+
let H = u(() => {
|
|
1590
1776
|
M();
|
|
1591
|
-
}, [M]),
|
|
1777
|
+
}, [M]), U = u((e) => {
|
|
1592
1778
|
O.current = e;
|
|
1593
|
-
}, [])
|
|
1594
|
-
|
|
1595
|
-
id: k
|
|
1596
|
-
});
|
|
1597
|
-
fe({
|
|
1779
|
+
}, []);
|
|
1780
|
+
Pe({
|
|
1598
1781
|
active: j,
|
|
1599
1782
|
enabled: p
|
|
1600
1783
|
});
|
|
1601
|
-
let
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1784
|
+
let ne = on({
|
|
1785
|
+
active: j,
|
|
1786
|
+
registrationActive: ee,
|
|
1787
|
+
id: k,
|
|
1788
|
+
contentRef: O,
|
|
1789
|
+
closeOnEscape: l,
|
|
1790
|
+
closeOnOutsidePress: d,
|
|
1791
|
+
onEscapeKeyDown: C,
|
|
1792
|
+
onInteractOutside: T,
|
|
1793
|
+
onPointerDownOutside: w,
|
|
1794
|
+
requestClose: H
|
|
1795
|
+
}), re = h(() => ({
|
|
1796
|
+
"--modal-animation-close-duration": `${z.close}ms`,
|
|
1797
|
+
"--modal-animation-easing": sn[s],
|
|
1798
|
+
"--modal-animation-open-duration": `${z.open}ms`,
|
|
1799
|
+
"--z-index-modal": ne.zIndex === void 0 ? void 0 : `${ne.zIndex}`
|
|
1605
1800
|
}), [
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
s
|
|
1609
|
-
|
|
1801
|
+
z.close,
|
|
1802
|
+
z.open,
|
|
1803
|
+
s,
|
|
1804
|
+
ne.zIndex
|
|
1805
|
+
]), W = Ae({
|
|
1806
|
+
presentation: "modal",
|
|
1807
|
+
animationStyle: re
|
|
1808
|
+
}).animationStyle ?? re;
|
|
1610
1809
|
return f(() => {
|
|
1611
1810
|
process.env.NODE_ENV === "production" || !j || F || O.current?.hasAttribute("aria-label") || console.warn("Modal.Content requires Modal.Title or ariaLabel.");
|
|
1612
1811
|
}, [j, F]), f(() => {
|
|
1613
|
-
process.env.NODE_ENV === "production" || !j || E !== "alertdialog" ||
|
|
1812
|
+
process.env.NODE_ENV === "production" || !j || E !== "alertdialog" || L || console.warn("Modal with role=\"alertdialog\" requires Modal.Description.");
|
|
1614
1813
|
}, [
|
|
1615
|
-
|
|
1814
|
+
L,
|
|
1616
1815
|
j,
|
|
1617
1816
|
E
|
|
1618
|
-
]), /* @__PURE__ */ n(
|
|
1817
|
+
]), /* @__PURE__ */ n(Ht, {
|
|
1619
1818
|
value: h(() => ({
|
|
1620
1819
|
animation: a,
|
|
1621
|
-
animationStyle:
|
|
1820
|
+
animationStyle: W,
|
|
1622
1821
|
closeOnEscape: l,
|
|
1623
1822
|
closeOnOutsidePress: d,
|
|
1624
1823
|
contentId: k,
|
|
@@ -1626,7 +1825,7 @@ var Vt = {
|
|
|
1626
1825
|
descriptionId: A,
|
|
1627
1826
|
finalFocus: b,
|
|
1628
1827
|
initialFocus: y,
|
|
1629
|
-
|
|
1828
|
+
zIndex: ne.zIndex,
|
|
1630
1829
|
modal: c,
|
|
1631
1830
|
onCloseAutoFocus: S,
|
|
1632
1831
|
onEscapeKeyDown: C,
|
|
@@ -1635,26 +1834,26 @@ var Vt = {
|
|
|
1635
1834
|
onPointerDownOutside: w,
|
|
1636
1835
|
open: j,
|
|
1637
1836
|
preventScroll: p,
|
|
1638
|
-
requestClose:
|
|
1837
|
+
requestClose: H,
|
|
1639
1838
|
restoreFocus: m,
|
|
1640
1839
|
role: E,
|
|
1641
|
-
setContentRef:
|
|
1642
|
-
setDescriptionPresent:
|
|
1840
|
+
setContentRef: U,
|
|
1841
|
+
setDescriptionPresent: R,
|
|
1643
1842
|
setOpen: N,
|
|
1644
|
-
setTitlePresent:
|
|
1843
|
+
setTitlePresent: I,
|
|
1645
1844
|
shouldRender: ee,
|
|
1646
1845
|
titleId: P,
|
|
1647
1846
|
trapFocus: v
|
|
1648
1847
|
}), [
|
|
1649
1848
|
a,
|
|
1650
|
-
|
|
1849
|
+
W,
|
|
1651
1850
|
l,
|
|
1652
1851
|
d,
|
|
1653
1852
|
k,
|
|
1654
1853
|
A,
|
|
1655
1854
|
b,
|
|
1656
1855
|
y,
|
|
1657
|
-
ne,
|
|
1856
|
+
ne.zIndex,
|
|
1658
1857
|
j,
|
|
1659
1858
|
c,
|
|
1660
1859
|
S,
|
|
@@ -1663,94 +1862,94 @@ var Vt = {
|
|
|
1663
1862
|
x,
|
|
1664
1863
|
w,
|
|
1665
1864
|
p,
|
|
1666
|
-
|
|
1865
|
+
H,
|
|
1667
1866
|
m,
|
|
1668
1867
|
E,
|
|
1669
|
-
|
|
1868
|
+
U,
|
|
1670
1869
|
N,
|
|
1671
1870
|
ee,
|
|
1672
1871
|
P,
|
|
1673
1872
|
v
|
|
1674
1873
|
]),
|
|
1675
1874
|
children: /* @__PURE__ */ n("div", {
|
|
1676
|
-
className:
|
|
1875
|
+
className: V(D),
|
|
1677
1876
|
"data-state": j ? "open" : "closed",
|
|
1678
1877
|
children: e
|
|
1679
1878
|
})
|
|
1680
1879
|
});
|
|
1681
1880
|
};
|
|
1682
|
-
|
|
1881
|
+
un.displayName = "ModalRoot";
|
|
1683
1882
|
//#endregion
|
|
1684
1883
|
//#region src/components/Modal/Trigger/ModalTrigger.tsx
|
|
1685
|
-
var
|
|
1686
|
-
let a =
|
|
1884
|
+
var dn = ({ children: e, asChild: t = !1, disabled: r = !1, className: i }) => {
|
|
1885
|
+
let a = Bt(), s = t && l(e) ? e : void 0, c = r, u = {
|
|
1687
1886
|
"aria-controls": a.contentId,
|
|
1688
1887
|
"aria-disabled": c || void 0,
|
|
1689
1888
|
"aria-expanded": a.open,
|
|
1690
1889
|
"aria-haspopup": "dialog",
|
|
1691
|
-
className:
|
|
1890
|
+
className: V(i),
|
|
1692
1891
|
"data-state": a.open ? "open" : "closed",
|
|
1693
1892
|
disabled: c || void 0,
|
|
1694
|
-
onClick:
|
|
1893
|
+
onClick: Kt(s?.props.onClick, () => {
|
|
1695
1894
|
c || a.setOpen(!0);
|
|
1696
1895
|
})
|
|
1697
1896
|
};
|
|
1698
1897
|
return s ? o(s, {
|
|
1699
1898
|
...u,
|
|
1700
|
-
ref:
|
|
1701
|
-
className:
|
|
1899
|
+
ref: qt(s.props.ref),
|
|
1900
|
+
className: V(s.props.className, i)
|
|
1702
1901
|
}) : /* @__PURE__ */ n("button", {
|
|
1703
1902
|
type: "button",
|
|
1704
1903
|
...u,
|
|
1705
1904
|
children: e
|
|
1706
1905
|
});
|
|
1707
1906
|
};
|
|
1708
|
-
|
|
1907
|
+
dn.displayName = "Modal.Trigger";
|
|
1709
1908
|
//#endregion
|
|
1710
1909
|
//#region src/components/Modal/Modal.tsx
|
|
1711
|
-
var
|
|
1712
|
-
Trigger:
|
|
1713
|
-
Overlay:
|
|
1714
|
-
Content:
|
|
1715
|
-
Header:
|
|
1716
|
-
Title:
|
|
1717
|
-
Description:
|
|
1718
|
-
Body:
|
|
1719
|
-
Footer:
|
|
1720
|
-
Close:
|
|
1910
|
+
var fn = Object.assign(un, {
|
|
1911
|
+
Trigger: dn,
|
|
1912
|
+
Overlay: an,
|
|
1913
|
+
Content: Zt,
|
|
1914
|
+
Header: tn,
|
|
1915
|
+
Title: nn,
|
|
1916
|
+
Description: en,
|
|
1917
|
+
Body: Gt,
|
|
1918
|
+
Footer: $t,
|
|
1919
|
+
Close: Yt
|
|
1721
1920
|
});
|
|
1722
|
-
|
|
1921
|
+
fn.displayName = "Modal";
|
|
1723
1922
|
//#endregion
|
|
1724
1923
|
//#region src/components/Popover/Context/PopoverContext.tsx
|
|
1725
|
-
var
|
|
1726
|
-
function
|
|
1727
|
-
return /* @__PURE__ */ n(
|
|
1924
|
+
var pn = s(null);
|
|
1925
|
+
function mn({ children: e, value: t }) {
|
|
1926
|
+
return /* @__PURE__ */ n(pn.Provider, {
|
|
1728
1927
|
value: t,
|
|
1729
1928
|
children: e
|
|
1730
1929
|
});
|
|
1731
1930
|
}
|
|
1732
|
-
function
|
|
1733
|
-
let t = d(
|
|
1931
|
+
function hn(e) {
|
|
1932
|
+
let t = d(pn);
|
|
1734
1933
|
if (!t) throw Error(`${e} must be used within Popover.Root`);
|
|
1735
1934
|
return t;
|
|
1736
1935
|
}
|
|
1737
1936
|
//#endregion
|
|
1738
1937
|
//#region src/components/Popover/Anchor/PopoverAnchor.tsx
|
|
1739
|
-
function
|
|
1938
|
+
function gn(e, t) {
|
|
1740
1939
|
if (typeof e == "function") {
|
|
1741
1940
|
e(t);
|
|
1742
1941
|
return;
|
|
1743
1942
|
}
|
|
1744
1943
|
e && (e.current = t);
|
|
1745
1944
|
}
|
|
1746
|
-
function
|
|
1747
|
-
let { setAnchorRef: a } =
|
|
1945
|
+
function _n({ children: e, asChild: t = !1, className: r, ...i }) {
|
|
1946
|
+
let { setAnchorRef: a } = hn("Popover.Anchor"), s = t && l(e) ? e : void 0;
|
|
1748
1947
|
return s ? o(s, {
|
|
1749
1948
|
...i,
|
|
1750
1949
|
ref: (e) => {
|
|
1751
|
-
|
|
1950
|
+
gn(s.props.ref, e), a(e);
|
|
1752
1951
|
},
|
|
1753
|
-
className:
|
|
1952
|
+
className: V(s.props.className, r)
|
|
1754
1953
|
}) : /* @__PURE__ */ n("div", {
|
|
1755
1954
|
...i,
|
|
1756
1955
|
ref: a,
|
|
@@ -1758,15 +1957,15 @@ function Zt({ children: e, asChild: t = !1, className: r, ...i }) {
|
|
|
1758
1957
|
children: e
|
|
1759
1958
|
});
|
|
1760
1959
|
}
|
|
1761
|
-
|
|
1762
|
-
var
|
|
1960
|
+
_n.displayName = "Popover.Anchor";
|
|
1961
|
+
var vn = { arrow: "_arrow_6lbs0_1" }, yn = {
|
|
1763
1962
|
start: "20%",
|
|
1764
1963
|
center: null,
|
|
1765
1964
|
end: "80%"
|
|
1766
1965
|
};
|
|
1767
|
-
function
|
|
1768
|
-
let { arrowRef: c, floatingContext: l, placement: u } =
|
|
1769
|
-
return /* @__PURE__ */ n(
|
|
1966
|
+
function bn({ width: e = 14, height: t = 7, tipRadius: r = 1, align: i = "center", offset: a, className: o, ...s }) {
|
|
1967
|
+
let { arrowRef: c, floatingContext: l, placement: u } = hn("Popover.Arrow"), d = a ?? yn[i], f = u.split("-")[0];
|
|
1968
|
+
return /* @__PURE__ */ n(b, {
|
|
1770
1969
|
...s,
|
|
1771
1970
|
ref: c,
|
|
1772
1971
|
context: l,
|
|
@@ -1778,14 +1977,14 @@ function en({ width: e = 14, height: t = 7, tipRadius: r = 1, align: i = "center
|
|
|
1778
1977
|
stroke: "var(--border-muted)",
|
|
1779
1978
|
strokeWidth: 1,
|
|
1780
1979
|
"data-side": f,
|
|
1781
|
-
className:
|
|
1980
|
+
className: V(vn.arrow, o)
|
|
1782
1981
|
});
|
|
1783
1982
|
}
|
|
1784
|
-
|
|
1983
|
+
bn.displayName = "Popover.Arrow";
|
|
1785
1984
|
//#endregion
|
|
1786
1985
|
//#region src/components/Popover/Close/PopoverClose.tsx
|
|
1787
|
-
function
|
|
1788
|
-
let { setOpen: c } =
|
|
1986
|
+
function xn({ children: e, asChild: t = !1, className: r, disabled: i, onClick: a, ...s }) {
|
|
1987
|
+
let { setOpen: c } = hn("Popover.Close"), u = t && l(e) ? e : void 0, d = i || u?.props.disabled === !0, f = (e) => {
|
|
1789
1988
|
u?.props.onClick?.(e), a?.(e), !(e.defaultPrevented || d) && c(!1, {
|
|
1790
1989
|
reason: "close",
|
|
1791
1990
|
event: e.nativeEvent
|
|
@@ -1798,7 +1997,7 @@ function tn({ children: e, asChild: t = !1, className: r, disabled: i, onClick:
|
|
|
1798
1997
|
};
|
|
1799
1998
|
return u ? o(u, {
|
|
1800
1999
|
...p,
|
|
1801
|
-
className:
|
|
2000
|
+
className: V(u.props.className, r)
|
|
1802
2001
|
}) : /* @__PURE__ */ n("button", {
|
|
1803
2002
|
type: "button",
|
|
1804
2003
|
...p,
|
|
@@ -1806,37 +2005,35 @@ function tn({ children: e, asChild: t = !1, className: r, disabled: i, onClick:
|
|
|
1806
2005
|
children: e
|
|
1807
2006
|
});
|
|
1808
2007
|
}
|
|
1809
|
-
|
|
1810
|
-
var
|
|
2008
|
+
xn.displayName = "Popover.Close";
|
|
2009
|
+
var Sn = {
|
|
1811
2010
|
content: "_content_1jzfn_1",
|
|
1812
2011
|
"popover-in": "_popover-in_1jzfn_1"
|
|
1813
2012
|
};
|
|
1814
2013
|
//#endregion
|
|
1815
2014
|
//#region src/components/Popover/Content/PopoverContent.tsx
|
|
1816
|
-
function
|
|
1817
|
-
let { open: y, modal: b, portal: x, triggerRef: S,
|
|
1818
|
-
|
|
1819
|
-
id: w
|
|
1820
|
-
}), P = u((e, t) => {
|
|
1821
|
-
k(!1, {
|
|
2015
|
+
function Cn({ children: e, asChild: t = !1, className: r, style: i, initialFocus: a, returnFocus: s = !0, closeOnEscape: c = !0, closeOnOutsidePress: d = !0, onEscapeKeyDown: f, onPointerDownOutside: p, onInteractOutside: m, onOpenAutoFocus: h, onCloseAutoFocus: g, ...v }) {
|
|
2016
|
+
let { open: y, modal: b, portal: x, triggerRef: S, anchorRef: C, contentRef: w, contentId: T, titleId: E, descriptionId: D, placement: O, floatingStyles: k, setOpen: A, setContentRef: j } = hn("Popover.Content"), [M, N] = _(null), P = u((e, t) => {
|
|
2017
|
+
A(!1, {
|
|
1822
2018
|
reason: e,
|
|
1823
2019
|
event: t
|
|
1824
2020
|
});
|
|
1825
|
-
}, [
|
|
1826
|
-
oe({
|
|
2021
|
+
}, [A]), F = ke({
|
|
1827
2022
|
active: y,
|
|
1828
|
-
|
|
1829
|
-
|
|
2023
|
+
id: T,
|
|
2024
|
+
zIndexLevel: "popover",
|
|
2025
|
+
contentRef: w,
|
|
2026
|
+
ignoreRefs: [S, C],
|
|
1830
2027
|
closeOnEscape: c,
|
|
1831
2028
|
closeOnOutsidePress: d,
|
|
1832
|
-
isTopOverlay: N,
|
|
1833
2029
|
onEscapeKeyDown: f,
|
|
1834
2030
|
onPointerDownOutside: p,
|
|
1835
2031
|
onInteractOutside: m,
|
|
1836
2032
|
requestClose: P
|
|
1837
|
-
})
|
|
2033
|
+
});
|
|
2034
|
+
fe({
|
|
1838
2035
|
active: y,
|
|
1839
|
-
contentRef:
|
|
2036
|
+
contentRef: w,
|
|
1840
2037
|
enabled: b,
|
|
1841
2038
|
initialFocus: a,
|
|
1842
2039
|
finalFocus: S,
|
|
@@ -1849,93 +2046,96 @@ function rn({ children: e, asChild: t = !1, className: r, style: i, initialFocus
|
|
|
1849
2046
|
h
|
|
1850
2047
|
]),
|
|
1851
2048
|
onCloseAutoFocus: g
|
|
1852
|
-
}),
|
|
2049
|
+
}), Pe({
|
|
1853
2050
|
active: y,
|
|
1854
2051
|
enabled: b
|
|
1855
|
-
}),
|
|
2052
|
+
}), G({
|
|
1856
2053
|
active: y,
|
|
1857
2054
|
enabled: b,
|
|
1858
|
-
content:
|
|
2055
|
+
content: M
|
|
1859
2056
|
});
|
|
1860
|
-
let
|
|
1861
|
-
|
|
1862
|
-
}, [
|
|
2057
|
+
let I = u((e) => {
|
|
2058
|
+
N(e), j(e);
|
|
2059
|
+
}, [j]);
|
|
1863
2060
|
if (!y) return null;
|
|
1864
|
-
let L =
|
|
2061
|
+
let L = O.split("-")[0], R = {
|
|
1865
2062
|
...v,
|
|
1866
|
-
id:
|
|
2063
|
+
id: T,
|
|
1867
2064
|
role: v.role ?? "dialog",
|
|
1868
2065
|
tabIndex: v.tabIndex ?? -1,
|
|
1869
|
-
"aria-labelledby":
|
|
1870
|
-
"aria-describedby":
|
|
2066
|
+
"aria-labelledby": E,
|
|
2067
|
+
"aria-describedby": D,
|
|
1871
2068
|
"data-state": "open",
|
|
1872
2069
|
"data-side": L,
|
|
1873
|
-
className:
|
|
2070
|
+
className: V(Sn.content, r),
|
|
1874
2071
|
style: {
|
|
1875
|
-
...
|
|
2072
|
+
...k,
|
|
2073
|
+
zIndex: F.zIndex,
|
|
1876
2074
|
...i
|
|
1877
2075
|
}
|
|
1878
2076
|
}, z = t && l(e) ? e : void 0, B = z ? o(z, {
|
|
1879
2077
|
...R,
|
|
1880
|
-
ref:
|
|
1881
|
-
className:
|
|
2078
|
+
ref: I,
|
|
2079
|
+
className: V(z.props.className, Sn.content, r),
|
|
1882
2080
|
style: {
|
|
1883
|
-
...
|
|
2081
|
+
...k,
|
|
2082
|
+
zIndex: F.zIndex,
|
|
1884
2083
|
...z.props.style,
|
|
1885
2084
|
...i
|
|
1886
2085
|
}
|
|
1887
2086
|
}) : /* @__PURE__ */ n("div", {
|
|
1888
|
-
ref:
|
|
2087
|
+
ref: I,
|
|
1889
2088
|
...R,
|
|
1890
2089
|
children: e
|
|
1891
2090
|
});
|
|
1892
|
-
return x ? /* @__PURE__ */ n(
|
|
2091
|
+
return x ? /* @__PURE__ */ n(We, { children: B }) : B;
|
|
1893
2092
|
}
|
|
1894
|
-
|
|
1895
|
-
var
|
|
2093
|
+
Cn.displayName = "Popover.Content";
|
|
2094
|
+
var wn = { description: "_description_hji8o_1" };
|
|
1896
2095
|
//#endregion
|
|
1897
2096
|
//#region src/components/Popover/Description/PopoverDescription.tsx
|
|
1898
|
-
function
|
|
1899
|
-
let { descriptionId: a } =
|
|
2097
|
+
function Tn({ children: e, asChild: t = !1, className: r, ...i }) {
|
|
2098
|
+
let { descriptionId: a } = hn("Popover.Description"), s = t && l(e) ? e : void 0;
|
|
1900
2099
|
return s ? o(s, {
|
|
1901
2100
|
...i,
|
|
1902
2101
|
id: a,
|
|
1903
|
-
className:
|
|
2102
|
+
className: V(s.props.className, wn.description, r)
|
|
1904
2103
|
}) : /* @__PURE__ */ n("p", {
|
|
1905
2104
|
...i,
|
|
1906
2105
|
id: a,
|
|
1907
|
-
className:
|
|
2106
|
+
className: V(wn.description, r),
|
|
1908
2107
|
children: e
|
|
1909
2108
|
});
|
|
1910
2109
|
}
|
|
1911
|
-
|
|
2110
|
+
Tn.displayName = "Popover.Description";
|
|
1912
2111
|
//#endregion
|
|
1913
2112
|
//#region src/components/Popover/Root/PopoverRoot.tsx
|
|
1914
|
-
function
|
|
2113
|
+
function En(e, t) {
|
|
1915
2114
|
return t === "center" ? e : `${e}-${t}`;
|
|
1916
2115
|
}
|
|
1917
|
-
function
|
|
1918
|
-
let v = g(null), y = g(null), b = g(null),
|
|
2116
|
+
function Dn({ children: e, open: t, defaultOpen: r = !1, modal: i = !1, onOpenChange: a, side: o = "bottom", align: s = "center", sideOffset: c = 8, alignOffset: l = 0, collisionPadding: d = 8, avoidCollisions: f = !0, portal: m = !0, strategy: _ }) {
|
|
2117
|
+
let v = g(null), y = g(null), b = g(null), S = g({ reason: "programmatic" }), C = p(), w = `vellira-popover-trigger-${C}`, T = `vellira-popover-content-${C}`, E = `vellira-popover-title-${C}`, D = `vellira-popover-description-${C}`, [O, k] = J({
|
|
1919
2118
|
value: t,
|
|
1920
2119
|
defaultValue: r,
|
|
1921
2120
|
onChange: (e) => {
|
|
1922
|
-
a?.(e,
|
|
2121
|
+
a?.(e, S.current);
|
|
1923
2122
|
}
|
|
1924
2123
|
}), A = u((e, t) => {
|
|
1925
|
-
|
|
1926
|
-
}, [k]), j = g(null), M = h(() => [
|
|
2124
|
+
S.current = t, k(e);
|
|
2125
|
+
}, [k]), j = g(null), M = h(() => [x({
|
|
1927
2126
|
element: j,
|
|
1928
2127
|
padding: 8
|
|
1929
|
-
})], []), { context: N, floatingStyles: P, isPositioned: F, placement: I, setFloatingRef: L, setRef: R } =
|
|
2128
|
+
})], []), { context: N, floatingStyles: P, isPositioned: F, placement: I, setFloatingRef: L, setRef: R } = Ae({
|
|
1930
2129
|
open: O,
|
|
1931
|
-
placement:
|
|
1932
|
-
strategy: _
|
|
2130
|
+
placement: En(o, s),
|
|
2131
|
+
strategy: _,
|
|
2132
|
+
portal: m,
|
|
1933
2133
|
offset: c + 7,
|
|
1934
2134
|
collisionPadding: d,
|
|
1935
2135
|
avoidCollisions: f,
|
|
1936
2136
|
middleware: M
|
|
1937
2137
|
});
|
|
1938
|
-
return /* @__PURE__ */ n(
|
|
2138
|
+
return /* @__PURE__ */ n(mn, {
|
|
1939
2139
|
value: {
|
|
1940
2140
|
open: O,
|
|
1941
2141
|
modal: i,
|
|
@@ -1943,8 +2143,8 @@ function cn({ children: e, open: t, defaultOpen: r = !1, modal: i = !1, onOpenCh
|
|
|
1943
2143
|
triggerRef: v,
|
|
1944
2144
|
anchorRef: y,
|
|
1945
2145
|
contentRef: b,
|
|
1946
|
-
triggerId:
|
|
1947
|
-
contentId:
|
|
2146
|
+
triggerId: w,
|
|
2147
|
+
contentId: T,
|
|
1948
2148
|
titleId: E,
|
|
1949
2149
|
descriptionId: D,
|
|
1950
2150
|
placement: I,
|
|
@@ -1966,27 +2166,27 @@ function cn({ children: e, open: t, defaultOpen: r = !1, modal: i = !1, onOpenCh
|
|
|
1966
2166
|
children: e
|
|
1967
2167
|
});
|
|
1968
2168
|
}
|
|
1969
|
-
var
|
|
2169
|
+
var On = { title: "_title_1gham_1" };
|
|
1970
2170
|
//#endregion
|
|
1971
2171
|
//#region src/components/Popover/Title/PopoverTitle.tsx
|
|
1972
|
-
function
|
|
1973
|
-
let { titleId: a } =
|
|
2172
|
+
function kn({ children: e, asChild: t = !1, className: r, ...i }) {
|
|
2173
|
+
let { titleId: a } = hn("Popover.Title"), s = t && l(e) ? e : void 0;
|
|
1974
2174
|
return s ? o(s, {
|
|
1975
2175
|
...i,
|
|
1976
2176
|
id: a,
|
|
1977
|
-
className:
|
|
2177
|
+
className: V(s.props.className, On.title, r)
|
|
1978
2178
|
}) : /* @__PURE__ */ n("h2", {
|
|
1979
2179
|
...i,
|
|
1980
2180
|
id: a,
|
|
1981
|
-
className:
|
|
2181
|
+
className: V(On.title, r),
|
|
1982
2182
|
children: e
|
|
1983
2183
|
});
|
|
1984
2184
|
}
|
|
1985
|
-
|
|
2185
|
+
kn.displayName = "Popover.Title";
|
|
1986
2186
|
//#endregion
|
|
1987
2187
|
//#region src/components/Popover/Trigger/PopoverTrigger.tsx
|
|
1988
|
-
function
|
|
1989
|
-
let { open: c, triggerId: u, contentId: d, setOpen: f, setTriggerRef: p } =
|
|
2188
|
+
function An({ children: e, asChild: t = !1, disabled: r = !1, className: i, onClick: a, ...s }) {
|
|
2189
|
+
let { open: c, triggerId: u, contentId: d, setOpen: f, setTriggerRef: p } = hn("Popover.Trigger"), m = t && l(e) ? e : void 0, h = r || m?.props.disabled === !0, g = {
|
|
1990
2190
|
id: u,
|
|
1991
2191
|
"aria-controls": c ? d : void 0,
|
|
1992
2192
|
"aria-expanded": c,
|
|
@@ -2004,7 +2204,7 @@ function dn({ children: e, asChild: t = !1, disabled: r = !1, className: i, onCl
|
|
|
2004
2204
|
...s,
|
|
2005
2205
|
...g,
|
|
2006
2206
|
disabled: h || void 0,
|
|
2007
|
-
className:
|
|
2207
|
+
className: V(m.props.className, i),
|
|
2008
2208
|
ref: (e) => {
|
|
2009
2209
|
let t = m.props.ref;
|
|
2010
2210
|
typeof t == "function" ? t(e) : t && (t.current = e), p(e);
|
|
@@ -2019,22 +2219,22 @@ function dn({ children: e, asChild: t = !1, disabled: r = !1, className: i, onCl
|
|
|
2019
2219
|
children: e
|
|
2020
2220
|
});
|
|
2021
2221
|
}
|
|
2022
|
-
|
|
2222
|
+
An.displayName = "Popover.Trigger";
|
|
2023
2223
|
//#endregion
|
|
2024
2224
|
//#region src/components/Popover/Popover.tsx
|
|
2025
|
-
var
|
|
2026
|
-
Anchor:
|
|
2027
|
-
Arrow:
|
|
2028
|
-
Close:
|
|
2029
|
-
Content:
|
|
2030
|
-
Description:
|
|
2031
|
-
Title:
|
|
2032
|
-
Trigger:
|
|
2033
|
-
}),
|
|
2034
|
-
function
|
|
2035
|
-
return d(
|
|
2225
|
+
var jn = Object.assign(Dn, {
|
|
2226
|
+
Anchor: _n,
|
|
2227
|
+
Arrow: bn,
|
|
2228
|
+
Close: xn,
|
|
2229
|
+
Content: Cn,
|
|
2230
|
+
Description: Tn,
|
|
2231
|
+
Title: kn,
|
|
2232
|
+
Trigger: An
|
|
2233
|
+
}), Mn = s(null), Nn = Mn.Provider;
|
|
2234
|
+
function Pn() {
|
|
2235
|
+
return d(Mn);
|
|
2036
2236
|
}
|
|
2037
|
-
var
|
|
2237
|
+
var Fn = {
|
|
2038
2238
|
root: "_root_7yrws_1",
|
|
2039
2239
|
invalid: "_invalid_7yrws_34",
|
|
2040
2240
|
control: "_control_7yrws_34",
|
|
@@ -2057,23 +2257,23 @@ var J = {
|
|
|
2057
2257
|
"radio-indicator-in": "_radio-indicator-in_7yrws_1",
|
|
2058
2258
|
content: "_content_7yrws_346",
|
|
2059
2259
|
error: "_error_7yrws_363"
|
|
2060
|
-
},
|
|
2061
|
-
primary:
|
|
2062
|
-
neutral:
|
|
2063
|
-
success:
|
|
2064
|
-
warning:
|
|
2065
|
-
danger:
|
|
2066
|
-
},
|
|
2067
|
-
let S =
|
|
2260
|
+
}, In = {
|
|
2261
|
+
primary: Fn.colorPrimary,
|
|
2262
|
+
neutral: Fn.colorNeutral,
|
|
2263
|
+
success: Fn.colorSuccess,
|
|
2264
|
+
warning: Fn.colorWarning,
|
|
2265
|
+
danger: Fn.colorDanger
|
|
2266
|
+
}, Ln = c(({ value: e, checked: t, defaultChecked: i = !1, disabled: a = !1, required: o = !1, size: s, color: c, error: l, onCheckedChange: u, label: d, description: f, icon: m, wrapperClassName: h, className: g, id: _, name: v, "aria-describedby": y, ...b }, x) => {
|
|
2267
|
+
let S = Pn(), C = p(), w = _ ?? C, T = f ? `${w}-description` : void 0, E = l ? `${w}-error` : void 0, D = [
|
|
2068
2268
|
T,
|
|
2069
2269
|
E,
|
|
2070
2270
|
S?.describedBy,
|
|
2071
2271
|
y
|
|
2072
|
-
].filter(Boolean).join(" ") || void 0, O = S !== null, [k, A] =
|
|
2272
|
+
].filter(Boolean).join(" ") || void 0, O = S !== null, [k, A] = J({
|
|
2073
2273
|
value: t,
|
|
2074
2274
|
defaultValue: i,
|
|
2075
2275
|
onChange: u
|
|
2076
|
-
}), j = O ? S.value === e : k, M = !!S?.disabled || a, N = !!S?.required || o, P = S?.name ?? v, F = !!(l || S?.invalid),
|
|
2276
|
+
}), j = O ? S.value === e : k, M = !!S?.disabled || a, N = !!S?.required || o, P = S?.name ?? v, F = !!(l || S?.invalid), I = s ?? S?.size ?? "md", L = c ?? S?.color ?? "primary", R = (t) => {
|
|
2077
2277
|
if (!M) {
|
|
2078
2278
|
if (O) {
|
|
2079
2279
|
S.onValueChange(e);
|
|
@@ -2083,10 +2283,10 @@ var J = {
|
|
|
2083
2283
|
}
|
|
2084
2284
|
};
|
|
2085
2285
|
return /* @__PURE__ */ r("div", {
|
|
2086
|
-
className:
|
|
2286
|
+
className: V(Fn.root, Fn[I], F && Fn.invalid, M && Fn.disabled, In[L], g),
|
|
2087
2287
|
children: [/* @__PURE__ */ r("label", {
|
|
2088
2288
|
htmlFor: w,
|
|
2089
|
-
className:
|
|
2289
|
+
className: V(Fn.wrapper, h),
|
|
2090
2290
|
children: [
|
|
2091
2291
|
/* @__PURE__ */ n("input", {
|
|
2092
2292
|
...b,
|
|
@@ -2100,55 +2300,55 @@ var J = {
|
|
|
2100
2300
|
required: N,
|
|
2101
2301
|
"aria-invalid": F || void 0,
|
|
2102
2302
|
"aria-describedby": D,
|
|
2103
|
-
className:
|
|
2104
|
-
onChange:
|
|
2303
|
+
className: Fn.input,
|
|
2304
|
+
onChange: R
|
|
2105
2305
|
}),
|
|
2106
2306
|
/* @__PURE__ */ n("span", {
|
|
2107
|
-
className:
|
|
2307
|
+
className: Fn.control,
|
|
2108
2308
|
"aria-hidden": "true",
|
|
2109
2309
|
children: /* @__PURE__ */ n("span", {
|
|
2110
|
-
className:
|
|
2310
|
+
className: V(Fn.indicator, m && Fn.customIcon),
|
|
2111
2311
|
children: m
|
|
2112
2312
|
})
|
|
2113
2313
|
}),
|
|
2114
2314
|
(d || f) && /* @__PURE__ */ r("span", {
|
|
2115
|
-
className:
|
|
2315
|
+
className: Fn.content,
|
|
2116
2316
|
children: [d && /* @__PURE__ */ n("span", {
|
|
2117
|
-
className:
|
|
2317
|
+
className: Fn.label,
|
|
2118
2318
|
children: d
|
|
2119
2319
|
}), f && /* @__PURE__ */ n("span", {
|
|
2120
2320
|
id: T,
|
|
2121
|
-
className:
|
|
2321
|
+
className: Fn.description,
|
|
2122
2322
|
children: f
|
|
2123
2323
|
})]
|
|
2124
2324
|
})
|
|
2125
2325
|
]
|
|
2126
2326
|
}), l && /* @__PURE__ */ n("div", {
|
|
2127
2327
|
id: E,
|
|
2128
|
-
className:
|
|
2328
|
+
className: Fn.error,
|
|
2129
2329
|
children: l
|
|
2130
2330
|
})]
|
|
2131
2331
|
});
|
|
2132
2332
|
});
|
|
2133
|
-
|
|
2333
|
+
Ln.displayName = "Radio";
|
|
2134
2334
|
//#endregion
|
|
2135
2335
|
//#region src/components/RadioGroup/Item/RadioGroupItem.tsx
|
|
2136
|
-
var
|
|
2336
|
+
var Rn = c((e, t) => /* @__PURE__ */ n(Ln, {
|
|
2137
2337
|
...e,
|
|
2138
2338
|
ref: t
|
|
2139
2339
|
}));
|
|
2140
|
-
|
|
2340
|
+
Rn.displayName = "RadioGroup.Item";
|
|
2141
2341
|
//#endregion
|
|
2142
2342
|
//#region src/components/RadioGroup/internal/useRadioGroupCollection.ts
|
|
2143
|
-
var
|
|
2343
|
+
var zn = (e) => {
|
|
2144
2344
|
let t = e.current;
|
|
2145
2345
|
return t ? Array.from(t.querySelectorAll("input[type=\"radio\"]")) : [];
|
|
2146
|
-
},
|
|
2147
|
-
function
|
|
2346
|
+
}, Bn = (e) => zn(e).filter((e) => !e.disabled), Vn = ["ArrowLeft", "ArrowRight"], Hn = ["ArrowUp", "ArrowDown"];
|
|
2347
|
+
function Un({ rootRef: e, orientation: t }) {
|
|
2148
2348
|
return u((n) => {
|
|
2149
|
-
let r =
|
|
2349
|
+
let r = Vn.includes(n.key), i = Hn.includes(n.key), a = n.key === "Home" || n.key === "End";
|
|
2150
2350
|
if (!r && !i && !a || t === "horizontal" && i || t === "vertical" && r) return;
|
|
2151
|
-
let o =
|
|
2351
|
+
let o = Bn(e);
|
|
2152
2352
|
if (o.length === 0) return;
|
|
2153
2353
|
n.preventDefault();
|
|
2154
2354
|
let s = document.activeElement, c = o.findIndex((e) => e === s), l = o.findIndex((e) => e.checked), u = c >= 0 ? c : Math.max(l, 0), d = u;
|
|
@@ -2157,7 +2357,7 @@ function Cn({ rootRef: e, orientation: t }) {
|
|
|
2157
2357
|
f?.focus(), f?.click();
|
|
2158
2358
|
}, [t, e]);
|
|
2159
2359
|
}
|
|
2160
|
-
var
|
|
2360
|
+
var Wn = {
|
|
2161
2361
|
root: "_root_1s3vp_1",
|
|
2162
2362
|
sm: "_sm_1s3vp_32",
|
|
2163
2363
|
md: "_md_1s3vp_58",
|
|
@@ -2171,12 +2371,12 @@ var wn = {
|
|
|
2171
2371
|
error: "_error_1s3vp_152",
|
|
2172
2372
|
disabled: "_disabled_1s3vp_160",
|
|
2173
2373
|
invalid: "_invalid_1s3vp_176"
|
|
2174
|
-
},
|
|
2175
|
-
let S = g(null), C = p(), w = v ?? C, T = u ? `${w}-label` : void 0, E = d ? `${w}-description` : void 0, D = f ? `${w}-error` : void 0, O = [E, D].filter(Boolean).join(" ") || void 0, k = l ?? `${w}-radio`, [A, j] =
|
|
2374
|
+
}, Gn = c(({ value: e, defaultValue: t = "", onValueChange: i, disabled: a = !1, required: o = !1, size: s = "md", color: c = "primary", name: l, label: u, description: d, error: f, orientation: m = "vertical", children: h, className: _, id: v, onKeyDown: y, ...b }, x) => {
|
|
2375
|
+
let S = g(null), C = p(), w = v ?? C, T = u ? `${w}-label` : void 0, E = d ? `${w}-description` : void 0, D = f ? `${w}-error` : void 0, O = [E, D].filter(Boolean).join(" ") || void 0, k = l ?? `${w}-radio`, [A, j] = J({
|
|
2176
2376
|
value: e,
|
|
2177
2377
|
defaultValue: t,
|
|
2178
2378
|
onChange: i
|
|
2179
|
-
}), M = !!f, N =
|
|
2379
|
+
}), M = !!f, N = Un({
|
|
2180
2380
|
rootRef: S,
|
|
2181
2381
|
orientation: m
|
|
2182
2382
|
}), P = (e) => {
|
|
@@ -2199,23 +2399,23 @@ var wn = {
|
|
|
2199
2399
|
onKeyDown: (e) => {
|
|
2200
2400
|
y?.(e), e.defaultPrevented || N(e);
|
|
2201
2401
|
},
|
|
2202
|
-
className:
|
|
2402
|
+
className: V(Wn.root, Wn[s], M && Wn.invalid, a && Wn.disabled, _),
|
|
2203
2403
|
children: [
|
|
2204
2404
|
u && /* @__PURE__ */ r("div", {
|
|
2205
2405
|
id: T,
|
|
2206
|
-
className:
|
|
2406
|
+
className: Wn.label,
|
|
2207
2407
|
children: [u, o && /* @__PURE__ */ n("span", {
|
|
2208
|
-
className:
|
|
2408
|
+
className: Wn.required,
|
|
2209
2409
|
"aria-hidden": "true",
|
|
2210
2410
|
children: "*"
|
|
2211
2411
|
})]
|
|
2212
2412
|
}),
|
|
2213
2413
|
d && /* @__PURE__ */ n("div", {
|
|
2214
2414
|
id: E,
|
|
2215
|
-
className:
|
|
2415
|
+
className: Wn.description,
|
|
2216
2416
|
children: d
|
|
2217
2417
|
}),
|
|
2218
|
-
/* @__PURE__ */ n(
|
|
2418
|
+
/* @__PURE__ */ n(Nn, {
|
|
2219
2419
|
value: {
|
|
2220
2420
|
name: k,
|
|
2221
2421
|
value: A,
|
|
@@ -2228,35 +2428,35 @@ var wn = {
|
|
|
2228
2428
|
onValueChange: j
|
|
2229
2429
|
},
|
|
2230
2430
|
children: /* @__PURE__ */ n("div", {
|
|
2231
|
-
className:
|
|
2431
|
+
className: V(Wn.items, Wn[m]),
|
|
2232
2432
|
children: h
|
|
2233
2433
|
})
|
|
2234
2434
|
}),
|
|
2235
2435
|
f && /* @__PURE__ */ n("div", {
|
|
2236
2436
|
id: D,
|
|
2237
|
-
className:
|
|
2437
|
+
className: Wn.error,
|
|
2238
2438
|
children: f
|
|
2239
2439
|
})
|
|
2240
2440
|
]
|
|
2241
2441
|
});
|
|
2242
2442
|
});
|
|
2243
|
-
|
|
2443
|
+
Gn.displayName = "RadioGroup.Root";
|
|
2244
2444
|
//#endregion
|
|
2245
2445
|
//#region src/components/RadioGroup/RadioGroup.tsx
|
|
2246
|
-
var
|
|
2247
|
-
|
|
2446
|
+
var Kn = Object.assign(Gn, { Item: Rn });
|
|
2447
|
+
Kn.displayName = "RadioGroup";
|
|
2248
2448
|
//#endregion
|
|
2249
2449
|
//#region src/components/Select/internal/SelectContext.tsx
|
|
2250
|
-
var
|
|
2251
|
-
function
|
|
2252
|
-
let e = d(
|
|
2450
|
+
var qn = s(null), Jn = qn.Provider;
|
|
2451
|
+
function Yn() {
|
|
2452
|
+
let e = d(qn);
|
|
2253
2453
|
if (!e) throw Error("Select compound components must be used inside <Select>");
|
|
2254
2454
|
return e;
|
|
2255
2455
|
}
|
|
2256
|
-
|
|
2456
|
+
qn.displayName = "SelectContext";
|
|
2257
2457
|
//#endregion
|
|
2258
2458
|
//#region src/components/Select/internal/useSelectVirtualization.ts
|
|
2259
|
-
function
|
|
2459
|
+
function Xn({ loading: e, options: t, scrollTop: n, virtual: r }) {
|
|
2260
2460
|
return h(() => {
|
|
2261
2461
|
let i = typeof r == "object" ? r : r ? {} : void 0, a = i?.itemHeight ?? 40, o = !!(i && t.length > 0 && !e), s = o ? Math.max(0, Math.floor(n / a) - 2) : 0, c = o ? Math.ceil(300 / a) + 4 : t.length, l = o ? t.slice(s, s + c) : t, u = o ? s * a : 0;
|
|
2262
2462
|
return {
|
|
@@ -2275,7 +2475,7 @@ function An({ loading: e, options: t, scrollTop: n, virtual: r }) {
|
|
|
2275
2475
|
r
|
|
2276
2476
|
]);
|
|
2277
2477
|
}
|
|
2278
|
-
var
|
|
2478
|
+
var Zn = {
|
|
2279
2479
|
option: "_option_7msws_1",
|
|
2280
2480
|
selected: "_selected_7msws_38",
|
|
2281
2481
|
disabled: "_disabled_7msws_38",
|
|
@@ -2293,22 +2493,22 @@ var jn = {
|
|
|
2293
2493
|
danger: "_danger_7msws_313",
|
|
2294
2494
|
check: "_check_7msws_377",
|
|
2295
2495
|
checkPop: "_checkPop_7msws_1"
|
|
2296
|
-
},
|
|
2297
|
-
|
|
2298
|
-
var
|
|
2496
|
+
}, Qn = () => null;
|
|
2497
|
+
Qn.__velliraSelectPart = "item", Qn.displayName = "Select.Item";
|
|
2498
|
+
var $n = ({ option: e, isSelected: i, isActive: a, optionId: o, renderOption: s, onSelect: c, onMouseEnter: l }) => {
|
|
2299
2499
|
let u = !!e.disabled;
|
|
2300
2500
|
return /* @__PURE__ */ r("li", {
|
|
2301
2501
|
id: o,
|
|
2302
2502
|
role: "option",
|
|
2303
2503
|
"aria-selected": i,
|
|
2304
2504
|
"aria-disabled": u || void 0,
|
|
2305
|
-
className:
|
|
2306
|
-
[
|
|
2307
|
-
[
|
|
2308
|
-
[
|
|
2309
|
-
[
|
|
2310
|
-
[
|
|
2311
|
-
[
|
|
2505
|
+
className: V(Zn.option, {
|
|
2506
|
+
[Zn.selected]: i,
|
|
2507
|
+
[Zn.active]: a,
|
|
2508
|
+
[Zn.disabled]: u,
|
|
2509
|
+
[Zn.success]: e.color === "success",
|
|
2510
|
+
[Zn.warning]: e.color === "warning",
|
|
2511
|
+
[Zn.danger]: e.color === "danger"
|
|
2312
2512
|
}),
|
|
2313
2513
|
onClick: () => {
|
|
2314
2514
|
u || c(e.value);
|
|
@@ -2317,40 +2517,40 @@ var Nn = ({ option: e, isSelected: i, isActive: a, optionId: o, renderOption: s,
|
|
|
2317
2517
|
u || l();
|
|
2318
2518
|
},
|
|
2319
2519
|
children: [s ? /* @__PURE__ */ n("span", {
|
|
2320
|
-
className:
|
|
2520
|
+
className: Zn.custom,
|
|
2321
2521
|
children: s(e)
|
|
2322
2522
|
}) : /* @__PURE__ */ r(t, { children: [
|
|
2323
2523
|
e.icon && /* @__PURE__ */ n("span", {
|
|
2324
|
-
className:
|
|
2524
|
+
className: Zn.icon,
|
|
2325
2525
|
children: e.icon
|
|
2326
2526
|
}),
|
|
2327
2527
|
/* @__PURE__ */ r("span", {
|
|
2328
|
-
className:
|
|
2528
|
+
className: Zn.content,
|
|
2329
2529
|
children: [/* @__PURE__ */ n("span", {
|
|
2330
|
-
className:
|
|
2530
|
+
className: Zn.label,
|
|
2331
2531
|
children: e.label
|
|
2332
2532
|
}), e.description && /* @__PURE__ */ n("span", {
|
|
2333
|
-
className:
|
|
2533
|
+
className: Zn.description,
|
|
2334
2534
|
children: e.description
|
|
2335
2535
|
})]
|
|
2336
2536
|
}),
|
|
2337
2537
|
e.badge && /* @__PURE__ */ n("span", {
|
|
2338
|
-
className:
|
|
2538
|
+
className: Zn.badge,
|
|
2339
2539
|
children: e.badge
|
|
2340
2540
|
}),
|
|
2341
2541
|
e.shortcut && /* @__PURE__ */ n("kbd", {
|
|
2342
|
-
className:
|
|
2542
|
+
className: Zn.shortcut,
|
|
2343
2543
|
children: e.shortcut
|
|
2344
2544
|
})
|
|
2345
2545
|
] }), /* @__PURE__ */ n("span", {
|
|
2346
|
-
className:
|
|
2546
|
+
className: Zn.check,
|
|
2347
2547
|
"aria-hidden": "true",
|
|
2348
|
-
children: i && /* @__PURE__ */ n(
|
|
2548
|
+
children: i && /* @__PURE__ */ n(L, {})
|
|
2349
2549
|
})]
|
|
2350
2550
|
});
|
|
2351
2551
|
};
|
|
2352
|
-
|
|
2353
|
-
var
|
|
2552
|
+
$n.displayName = "SelectItemRow";
|
|
2553
|
+
var X = {
|
|
2354
2554
|
dropdown: "_dropdown_jkvqg_1",
|
|
2355
2555
|
dropdownIn: "_dropdownIn_jkvqg_1",
|
|
2356
2556
|
primary: "_primary_jkvqg_103",
|
|
@@ -2375,55 +2575,55 @@ var Y = {
|
|
|
2375
2575
|
separator: "_separator_jkvqg_1575",
|
|
2376
2576
|
virtualSpacer: "_virtualSpacer_jkvqg_1581",
|
|
2377
2577
|
mobileDropdownIn: "_mobileDropdownIn_jkvqg_1"
|
|
2378
|
-
},
|
|
2379
|
-
let { contentProps: r } =
|
|
2380
|
-
return /* @__PURE__ */ n(
|
|
2578
|
+
}, er = ({ children: e, className: t }) => {
|
|
2579
|
+
let { contentProps: r } = Yn(), i = nr(e);
|
|
2580
|
+
return /* @__PURE__ */ n(tr, {
|
|
2381
2581
|
...r,
|
|
2382
2582
|
...i,
|
|
2383
2583
|
className: [r.className, t].filter(Boolean).join(" ")
|
|
2384
2584
|
});
|
|
2385
2585
|
};
|
|
2386
|
-
|
|
2387
|
-
var
|
|
2388
|
-
let
|
|
2389
|
-
loading:
|
|
2586
|
+
er.__velliraSelectPart = "content", er.displayName = "Select.Content";
|
|
2587
|
+
var tr = ({ isOpen: e, listboxId: i, labelledById: a, setDropdownRef: o, style: s, options: c, entries: l, multiple: d, selectedValues: p, color: m = "primary", variant: h = "outline", searchable: v, command: y, virtual: b, portal: x = !0, searchValue: S = "", searchPlaceholder: C = "Search...", loading: w, loadingText: T = "Loading...", emptyText: E, searchSlot: D, headerSlot: O, emptySlot: k, loadingSlot: A, renderOption: j, selectedValue: M, activeIndex: N, visualActiveIndex: P = N, className: F, onSelect: I, onSelectGroup: L, onMouseEnter: R, onSearchChange: z }) => {
|
|
2588
|
+
let ee = g(null), V = g(!1), [te, H] = _(null), [U, ne] = _(0), { bottomSpacerHeight: re, isVirtual: W, itemHeight: ie, startIndex: ae, topSpacerHeight: G, viewportHeight: oe, visibleOptions: se } = Xn({
|
|
2589
|
+
loading: w,
|
|
2390
2590
|
options: c,
|
|
2391
|
-
scrollTop:
|
|
2591
|
+
scrollTop: U,
|
|
2392
2592
|
virtual: b
|
|
2393
2593
|
}), ce = u((e) => {
|
|
2394
|
-
|
|
2594
|
+
H(e), o(e);
|
|
2395
2595
|
}, [o]);
|
|
2396
2596
|
if (f(() => {
|
|
2397
|
-
e || (
|
|
2398
|
-
}, [e,
|
|
2597
|
+
e || (V.current = !1, ne(0));
|
|
2598
|
+
}, [e, S]), f(() => {
|
|
2399
2599
|
if (!e || !v) return;
|
|
2400
2600
|
let t = window.setTimeout(() => {
|
|
2401
|
-
|
|
2601
|
+
ee.current?.focus({ preventScroll: !0 });
|
|
2402
2602
|
}, 0);
|
|
2403
2603
|
return () => window.clearTimeout(t);
|
|
2404
2604
|
}, [e, v]), f(() => {
|
|
2405
|
-
if (!e ||
|
|
2406
|
-
let t = c.findIndex((e) => p ? p.includes(e.value) : e.value ===
|
|
2605
|
+
if (!e || w || !te || V.current) return;
|
|
2606
|
+
let t = c.findIndex((e) => p ? p.includes(e.value) : e.value === M), n = t >= 0 ? t : N;
|
|
2407
2607
|
if (n < 0) {
|
|
2408
|
-
|
|
2608
|
+
V.current = !0;
|
|
2409
2609
|
return;
|
|
2410
2610
|
}
|
|
2411
|
-
if (
|
|
2611
|
+
if (V.current = !0, W) {
|
|
2412
2612
|
let e = Math.max(0, n * ie - (oe - ie) / 2);
|
|
2413
|
-
ne(e),
|
|
2613
|
+
ne(e), te.scrollTop = e;
|
|
2414
2614
|
return;
|
|
2415
2615
|
}
|
|
2416
2616
|
document.getElementById(`${i}-option-${n}`)?.scrollIntoView?.({ block: "nearest" });
|
|
2417
2617
|
}, [
|
|
2418
|
-
|
|
2419
|
-
|
|
2618
|
+
N,
|
|
2619
|
+
te,
|
|
2420
2620
|
e,
|
|
2421
2621
|
W,
|
|
2422
2622
|
ie,
|
|
2423
2623
|
i,
|
|
2424
|
-
|
|
2624
|
+
w,
|
|
2425
2625
|
c,
|
|
2426
|
-
|
|
2626
|
+
M,
|
|
2427
2627
|
p,
|
|
2428
2628
|
oe
|
|
2429
2629
|
]), !e) return null;
|
|
@@ -2435,36 +2635,36 @@ var Fn = ({ isOpen: e, listboxId: i, labelledById: a, setDropdownRef: o, style:
|
|
|
2435
2635
|
ref: ce,
|
|
2436
2636
|
tabIndex: 0,
|
|
2437
2637
|
className: [
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
y ?
|
|
2442
|
-
|
|
2638
|
+
X.dropdown,
|
|
2639
|
+
X[m],
|
|
2640
|
+
X[h],
|
|
2641
|
+
y ? X.command : void 0,
|
|
2642
|
+
F
|
|
2443
2643
|
].filter(Boolean).join(" "),
|
|
2444
2644
|
style: s,
|
|
2445
2645
|
onScroll: (e) => {
|
|
2446
2646
|
W && ne(e.currentTarget.scrollTop);
|
|
2447
2647
|
},
|
|
2448
2648
|
children: [
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
className:
|
|
2649
|
+
O,
|
|
2650
|
+
D ?? (v && /* @__PURE__ */ r("div", {
|
|
2651
|
+
className: X.searchWrap,
|
|
2452
2652
|
children: [/* @__PURE__ */ n("input", {
|
|
2453
|
-
ref:
|
|
2454
|
-
className:
|
|
2455
|
-
value:
|
|
2456
|
-
placeholder: y ? "Type a command..." :
|
|
2653
|
+
ref: ee,
|
|
2654
|
+
className: X.search,
|
|
2655
|
+
value: S,
|
|
2656
|
+
placeholder: y ? "Type a command..." : C,
|
|
2457
2657
|
"aria-label": "Search options",
|
|
2458
|
-
onInput: (e) =>
|
|
2459
|
-
onChange: (e) =>
|
|
2460
|
-
}),
|
|
2658
|
+
onInput: (e) => z?.(e.currentTarget.value),
|
|
2659
|
+
onChange: (e) => z?.(e.target.value)
|
|
2660
|
+
}), S && /* @__PURE__ */ n("button", {
|
|
2461
2661
|
type: "button",
|
|
2462
|
-
className:
|
|
2662
|
+
className: X.searchClear,
|
|
2463
2663
|
"aria-label": "Clear search",
|
|
2464
2664
|
onClick: () => {
|
|
2465
|
-
|
|
2665
|
+
z?.(""), ee.current?.focus();
|
|
2466
2666
|
},
|
|
2467
|
-
children: /* @__PURE__ */ n(
|
|
2667
|
+
children: /* @__PURE__ */ n(B, {})
|
|
2468
2668
|
})]
|
|
2469
2669
|
})),
|
|
2470
2670
|
/* @__PURE__ */ n("ul", {
|
|
@@ -2472,16 +2672,16 @@ var Fn = ({ isOpen: e, listboxId: i, labelledById: a, setDropdownRef: o, style:
|
|
|
2472
2672
|
role: "listbox",
|
|
2473
2673
|
"aria-multiselectable": d || void 0,
|
|
2474
2674
|
"aria-labelledby": a,
|
|
2475
|
-
children:
|
|
2675
|
+
children: w ? /* @__PURE__ */ n("li", {
|
|
2476
2676
|
role: "option",
|
|
2477
2677
|
"aria-disabled": "true",
|
|
2478
2678
|
"aria-selected": "false",
|
|
2479
|
-
className:
|
|
2480
|
-
children:
|
|
2679
|
+
className: X.empty,
|
|
2680
|
+
children: A ?? T
|
|
2481
2681
|
}) : c.length ? /* @__PURE__ */ r(t, { children: [
|
|
2482
2682
|
W && /* @__PURE__ */ n("li", {
|
|
2483
2683
|
"aria-hidden": "true",
|
|
2484
|
-
className:
|
|
2684
|
+
className: X.virtualSpacer,
|
|
2485
2685
|
style: { height: G }
|
|
2486
2686
|
}),
|
|
2487
2687
|
le.map((e) => {
|
|
@@ -2492,16 +2692,16 @@ var Fn = ({ isOpen: e, listboxId: i, labelledById: a, setDropdownRef: o, style:
|
|
|
2492
2692
|
role: "presentation",
|
|
2493
2693
|
children: /* @__PURE__ */ r("button", {
|
|
2494
2694
|
type: "button",
|
|
2495
|
-
className:
|
|
2496
|
-
"aria-label":
|
|
2695
|
+
className: X.groupAction,
|
|
2696
|
+
"aria-label": rr(e.selectLabel ?? e.label),
|
|
2497
2697
|
"aria-pressed": o ? "mixed" : a ? "true" : "false",
|
|
2498
2698
|
disabled: t.length === 0,
|
|
2499
|
-
onClick: () =>
|
|
2699
|
+
onClick: () => L(t),
|
|
2500
2700
|
children: [/* @__PURE__ */ n("span", {
|
|
2501
|
-
className:
|
|
2701
|
+
className: X.groupActionText,
|
|
2502
2702
|
children: e.selectLabel ?? e.label
|
|
2503
2703
|
}), /* @__PURE__ */ r("span", {
|
|
2504
|
-
className:
|
|
2704
|
+
className: X.groupActionMeta,
|
|
2505
2705
|
children: [
|
|
2506
2706
|
i,
|
|
2507
2707
|
"/",
|
|
@@ -2513,46 +2713,46 @@ var Fn = ({ isOpen: e, listboxId: i, labelledById: a, setDropdownRef: o, style:
|
|
|
2513
2713
|
}
|
|
2514
2714
|
return /* @__PURE__ */ n("li", {
|
|
2515
2715
|
role: "presentation",
|
|
2516
|
-
className:
|
|
2716
|
+
className: X.groupLabel,
|
|
2517
2717
|
children: e.label
|
|
2518
2718
|
}, e.id);
|
|
2519
2719
|
}
|
|
2520
2720
|
if (e.type === "separator") return /* @__PURE__ */ n("li", {
|
|
2521
2721
|
role: "presentation",
|
|
2522
2722
|
"aria-hidden": "true",
|
|
2523
|
-
className:
|
|
2723
|
+
className: X.separator,
|
|
2524
2724
|
"data-vellira-select-separator": "true"
|
|
2525
2725
|
}, e.id);
|
|
2526
2726
|
let { option: t, optionIndex: a } = e;
|
|
2527
|
-
return /* @__PURE__ */ n(
|
|
2727
|
+
return /* @__PURE__ */ n($n, {
|
|
2528
2728
|
option: t,
|
|
2529
|
-
isSelected: p ? p.includes(t.value) : t.value ===
|
|
2530
|
-
isActive: a ===
|
|
2729
|
+
isSelected: p ? p.includes(t.value) : t.value === M,
|
|
2730
|
+
isActive: a === P,
|
|
2531
2731
|
optionId: `${i}-option-${a}`,
|
|
2532
|
-
renderOption:
|
|
2533
|
-
onSelect:
|
|
2534
|
-
onMouseEnter: () =>
|
|
2732
|
+
renderOption: j,
|
|
2733
|
+
onSelect: I,
|
|
2734
|
+
onMouseEnter: () => R(a)
|
|
2535
2735
|
}, t.value);
|
|
2536
2736
|
}),
|
|
2537
2737
|
W && /* @__PURE__ */ n("li", {
|
|
2538
2738
|
"aria-hidden": "true",
|
|
2539
|
-
className:
|
|
2739
|
+
className: X.virtualSpacer,
|
|
2540
2740
|
style: { height: re }
|
|
2541
2741
|
})
|
|
2542
2742
|
] }) : /* @__PURE__ */ n("li", {
|
|
2543
2743
|
role: "option",
|
|
2544
2744
|
"aria-disabled": "true",
|
|
2545
2745
|
"aria-selected": "false",
|
|
2546
|
-
className:
|
|
2547
|
-
children:
|
|
2746
|
+
className: X.empty,
|
|
2747
|
+
children: k ?? E
|
|
2548
2748
|
})
|
|
2549
2749
|
})
|
|
2550
2750
|
]
|
|
2551
2751
|
});
|
|
2552
|
-
return x ? /* @__PURE__ */ n(
|
|
2752
|
+
return x ? /* @__PURE__ */ n(We, { children: K }) : K;
|
|
2553
2753
|
};
|
|
2554
|
-
|
|
2555
|
-
function
|
|
2754
|
+
tr.displayName = "SelectContentSurface";
|
|
2755
|
+
function nr(e) {
|
|
2556
2756
|
let t, n, r, a;
|
|
2557
2757
|
return i.forEach(e, (e) => {
|
|
2558
2758
|
if (!l(e)) return;
|
|
@@ -2565,21 +2765,21 @@ function In(e) {
|
|
|
2565
2765
|
searchSlot: n
|
|
2566
2766
|
};
|
|
2567
2767
|
}
|
|
2568
|
-
function
|
|
2768
|
+
function rr(e) {
|
|
2569
2769
|
return typeof e == "string" || typeof e == "number" ? String(e) : "Select group";
|
|
2570
2770
|
}
|
|
2571
2771
|
//#endregion
|
|
2572
2772
|
//#region src/components/Select/Content/SelectEmpty.tsx
|
|
2573
|
-
var
|
|
2574
|
-
|
|
2773
|
+
var ir = ({ children: e }) => /* @__PURE__ */ n(t, { children: e });
|
|
2774
|
+
ir.__velliraSelectPart = "empty", ir.displayName = "Select.Empty";
|
|
2575
2775
|
//#endregion
|
|
2576
2776
|
//#region src/components/Select/Content/SelectLoading.tsx
|
|
2577
|
-
var
|
|
2578
|
-
|
|
2777
|
+
var ar = ({ children: e }) => /* @__PURE__ */ n(t, { children: e });
|
|
2778
|
+
ar.__velliraSelectPart = "loading", ar.displayName = "Select.Loading";
|
|
2579
2779
|
//#endregion
|
|
2580
2780
|
//#region src/components/Select/Content/SelectSearch.tsx
|
|
2581
|
-
var
|
|
2582
|
-
let { contentProps: i } =
|
|
2781
|
+
var or = ({ placeholder: e, className: t }) => {
|
|
2782
|
+
let { contentProps: i } = Yn(), a = g(null), o = i.searchValue ?? "";
|
|
2583
2783
|
return f(() => {
|
|
2584
2784
|
if (!i.isOpen) return;
|
|
2585
2785
|
let e = window.setTimeout(() => {
|
|
@@ -2587,10 +2787,10 @@ var Bn = ({ placeholder: e, className: t }) => {
|
|
|
2587
2787
|
}, 0);
|
|
2588
2788
|
return () => window.clearTimeout(e);
|
|
2589
2789
|
}, [i.isOpen]), /* @__PURE__ */ r("div", {
|
|
2590
|
-
className:
|
|
2790
|
+
className: X.searchWrap,
|
|
2591
2791
|
children: [/* @__PURE__ */ n("input", {
|
|
2592
2792
|
ref: a,
|
|
2593
|
-
className:
|
|
2793
|
+
className: V(X.search, t),
|
|
2594
2794
|
value: o,
|
|
2595
2795
|
placeholder: e ?? (i.command ? "Type a command..." : "Search..."),
|
|
2596
2796
|
"aria-label": "Search options",
|
|
@@ -2598,47 +2798,47 @@ var Bn = ({ placeholder: e, className: t }) => {
|
|
|
2598
2798
|
onChange: (e) => i.onSearchChange?.(e.target.value)
|
|
2599
2799
|
}), o && /* @__PURE__ */ n("button", {
|
|
2600
2800
|
type: "button",
|
|
2601
|
-
className:
|
|
2801
|
+
className: X.searchClear,
|
|
2602
2802
|
"aria-label": "Clear search",
|
|
2603
2803
|
onClick: () => {
|
|
2604
2804
|
i.onSearchChange?.(""), a.current?.focus();
|
|
2605
2805
|
},
|
|
2606
|
-
children: /* @__PURE__ */ n(
|
|
2806
|
+
children: /* @__PURE__ */ n(B, {})
|
|
2607
2807
|
})]
|
|
2608
2808
|
});
|
|
2609
2809
|
};
|
|
2610
|
-
|
|
2810
|
+
or.__velliraSelectPart = "search", or.displayName = "Select.Search";
|
|
2611
2811
|
//#endregion
|
|
2612
2812
|
//#region src/components/Select/Group/SelectGroup.tsx
|
|
2613
|
-
var
|
|
2614
|
-
|
|
2813
|
+
var sr = () => null;
|
|
2814
|
+
sr.__velliraSelectPart = "group", sr.displayName = "Select.Group";
|
|
2615
2815
|
//#endregion
|
|
2616
2816
|
//#region src/components/Select/Group/SelectLabel.tsx
|
|
2617
|
-
var
|
|
2817
|
+
var cr = ({ children: e }) => /* @__PURE__ */ n("div", {
|
|
2618
2818
|
role: "presentation",
|
|
2619
|
-
className:
|
|
2819
|
+
className: X.groupLabel,
|
|
2620
2820
|
children: e
|
|
2621
2821
|
});
|
|
2622
|
-
|
|
2822
|
+
cr.__velliraSelectPart = "label", cr.displayName = "Select.Label";
|
|
2623
2823
|
//#endregion
|
|
2624
2824
|
//#region src/components/Select/Group/SelectSeparator.tsx
|
|
2625
|
-
var
|
|
2626
|
-
|
|
2825
|
+
var lr = () => null;
|
|
2826
|
+
lr.__velliraSelectPart = "separator", lr.displayName = "Select.Separator";
|
|
2627
2827
|
//#endregion
|
|
2628
2828
|
//#region src/components/Select/Item/SelectItemBadge.tsx
|
|
2629
|
-
var
|
|
2630
|
-
|
|
2829
|
+
var ur = () => null;
|
|
2830
|
+
ur.__velliraSelectPart = "itemBadge", ur.displayName = "Select.ItemBadge";
|
|
2631
2831
|
//#endregion
|
|
2632
2832
|
//#region src/components/Select/Item/SelectItemDescription.tsx
|
|
2633
|
-
var
|
|
2634
|
-
|
|
2833
|
+
var dr = () => null;
|
|
2834
|
+
dr.__velliraSelectPart = "itemDescription", dr.displayName = "Select.ItemDescription";
|
|
2635
2835
|
//#endregion
|
|
2636
2836
|
//#region src/components/Select/Item/SelectItemIcon.tsx
|
|
2637
|
-
var
|
|
2638
|
-
|
|
2837
|
+
var fr = () => null;
|
|
2838
|
+
fr.__velliraSelectPart = "itemIcon", fr.displayName = "Select.ItemIcon";
|
|
2639
2839
|
//#endregion
|
|
2640
2840
|
//#region src/patterns/FormField/FormFieldContext.ts
|
|
2641
|
-
var
|
|
2841
|
+
var pr = s(null), mr = () => d(pr), hr = {
|
|
2642
2842
|
wrapper: "_wrapper_r078u_1",
|
|
2643
2843
|
sm: "_sm_r078u_41",
|
|
2644
2844
|
md: "_md_r078u_78",
|
|
@@ -2660,12 +2860,12 @@ var qn = s(null), Jn = () => d(qn), X = {
|
|
|
2660
2860
|
messageToneWarning: "_messageToneWarning_r078u_257",
|
|
2661
2861
|
messageToneDanger: "_messageToneDanger_r078u_261",
|
|
2662
2862
|
disabled: "_disabled_r078u_274"
|
|
2663
|
-
},
|
|
2664
|
-
function
|
|
2863
|
+
}, gr = (...e) => e.filter(Boolean).join(" ") || void 0;
|
|
2864
|
+
function _r(e, t) {
|
|
2665
2865
|
let n = () => null;
|
|
2666
2866
|
return n.__velliraFormFieldPart = e, n.displayName = t, n;
|
|
2667
2867
|
}
|
|
2668
|
-
function
|
|
2868
|
+
function vr(e) {
|
|
2669
2869
|
let t = [], n = { hasSlots: !1 };
|
|
2670
2870
|
return i.forEach(e, (e) => {
|
|
2671
2871
|
if (!l(e)) {
|
|
@@ -2689,15 +2889,15 @@ function Zn(e) {
|
|
|
2689
2889
|
}
|
|
2690
2890
|
}), t.length > 0 && (n.fallbackChildren = t.length === 1 ? t[0] : t), n;
|
|
2691
2891
|
}
|
|
2692
|
-
var
|
|
2693
|
-
let j =
|
|
2694
|
-
neutral:
|
|
2695
|
-
success:
|
|
2696
|
-
warning:
|
|
2697
|
-
danger:
|
|
2698
|
-
}[G], se =
|
|
2699
|
-
controlId:
|
|
2700
|
-
labelId:
|
|
2892
|
+
var yr = ({ id: e, label: t, description: i, error: s, message: c, messageTone: u, messageLive: d, required: f = !1, disabled: m = !1, invalid: h = !1, orientation: g = "vertical", labelPosition: _ = "top", size: v = "md", labelInfo: y, labelAction: b, optionalText: x, children: S, bindControl: C = !0, className: w, controlClassName: T, labelClassName: E, descriptionClassName: D, errorClassName: O, messageClassName: k, ...A }) => {
|
|
2893
|
+
let j = vr(S), M = t ?? j.label?.children, N = i ?? j.description?.children, P = c ?? j.message?.children, F = u ?? j.message?.tone ?? "neutral", I = d ?? j.message?.live ?? "off", L = y ?? j.label?.info, R = b ?? j.label?.action, z = x ?? j.label?.optionalText, B = j.hasSlots ? j.control?.children ?? j.fallbackChildren : S, ee = j.control?.bindControl ?? C, te = p(), H = e ?? te, U = M ? `${H}-label` : void 0, ne = N && H ? `${H}-description` : void 0, re = s && H ? `${H}-error` : void 0, W = !s && P && H ? `${H}-message` : void 0, ie = h || !!s, ae = s ?? P, G = s ? "danger" : F, oe = {
|
|
2894
|
+
neutral: hr.messageToneNeutral,
|
|
2895
|
+
success: hr.messageToneSuccess,
|
|
2896
|
+
warning: hr.messageToneWarning,
|
|
2897
|
+
danger: hr.messageToneDanger
|
|
2898
|
+
}[G], se = gr(U), ce = gr(ne, re, W), le = {
|
|
2899
|
+
controlId: H,
|
|
2900
|
+
labelId: U,
|
|
2701
2901
|
descriptionId: ne,
|
|
2702
2902
|
errorId: re,
|
|
2703
2903
|
messageId: W,
|
|
@@ -2707,91 +2907,91 @@ var Qn = ({ id: e, label: t, description: i, error: s, message: c, messageTone:
|
|
|
2707
2907
|
size: v,
|
|
2708
2908
|
ariaLabelledBy: se,
|
|
2709
2909
|
ariaDescribedBy: ce
|
|
2710
|
-
}, K = l(
|
|
2711
|
-
id: K.props.id ??
|
|
2910
|
+
}, K = l(B) && B.type !== a ? B : void 0, ue = ee && K ? o(K, {
|
|
2911
|
+
id: K.props.id ?? H,
|
|
2712
2912
|
required: K.props.required ?? f,
|
|
2713
2913
|
disabled: K.props.disabled ?? m,
|
|
2714
2914
|
"aria-invalid": K.props["aria-invalid"] ?? (ie || void 0),
|
|
2715
|
-
"aria-labelledby":
|
|
2716
|
-
"aria-describedby":
|
|
2717
|
-
}) :
|
|
2915
|
+
"aria-labelledby": gr(K.props["aria-labelledby"], se),
|
|
2916
|
+
"aria-describedby": gr(K.props["aria-describedby"], ce)
|
|
2917
|
+
}) : B;
|
|
2718
2918
|
return /* @__PURE__ */ r("div", {
|
|
2719
2919
|
...A,
|
|
2720
2920
|
"aria-disabled": m || void 0,
|
|
2721
|
-
className:
|
|
2921
|
+
className: V(hr.wrapper, hr[g], hr[_], hr[v], m && hr.disabled, w),
|
|
2722
2922
|
"data-disabled": m || void 0,
|
|
2723
2923
|
"data-invalid": ie || void 0,
|
|
2724
2924
|
"data-orientation": g,
|
|
2725
2925
|
"data-size": v,
|
|
2726
2926
|
children: [
|
|
2727
|
-
(M ||
|
|
2728
|
-
className:
|
|
2927
|
+
(M || R) && /* @__PURE__ */ r("div", {
|
|
2928
|
+
className: hr.labelRow,
|
|
2729
2929
|
children: [M && /* @__PURE__ */ r("label", {
|
|
2730
|
-
id:
|
|
2731
|
-
htmlFor:
|
|
2732
|
-
className:
|
|
2930
|
+
id: U,
|
|
2931
|
+
htmlFor: H,
|
|
2932
|
+
className: V(hr.label, j.label?.className, E),
|
|
2733
2933
|
children: [
|
|
2734
2934
|
/* @__PURE__ */ n("span", {
|
|
2735
|
-
className:
|
|
2935
|
+
className: hr.labelText,
|
|
2736
2936
|
children: M
|
|
2737
2937
|
}),
|
|
2738
2938
|
f && /* @__PURE__ */ n("span", {
|
|
2739
|
-
className:
|
|
2939
|
+
className: hr.required,
|
|
2740
2940
|
"aria-hidden": "true",
|
|
2741
2941
|
children: "*"
|
|
2742
2942
|
}),
|
|
2743
|
-
!f &&
|
|
2744
|
-
className:
|
|
2745
|
-
children:
|
|
2943
|
+
!f && z && /* @__PURE__ */ n("span", {
|
|
2944
|
+
className: hr.optional,
|
|
2945
|
+
children: z
|
|
2746
2946
|
}),
|
|
2747
|
-
|
|
2748
|
-
className:
|
|
2749
|
-
children:
|
|
2947
|
+
L && /* @__PURE__ */ n("span", {
|
|
2948
|
+
className: hr.labelInfo,
|
|
2949
|
+
children: L
|
|
2750
2950
|
})
|
|
2751
2951
|
]
|
|
2752
|
-
}),
|
|
2753
|
-
className:
|
|
2754
|
-
children:
|
|
2952
|
+
}), R && /* @__PURE__ */ n("div", {
|
|
2953
|
+
className: hr.labelAction,
|
|
2954
|
+
children: R
|
|
2755
2955
|
})]
|
|
2756
2956
|
}),
|
|
2757
2957
|
N && /* @__PURE__ */ n("div", {
|
|
2758
2958
|
id: ne,
|
|
2759
|
-
className:
|
|
2959
|
+
className: V(hr.description, j.description?.className, D),
|
|
2760
2960
|
children: N
|
|
2761
2961
|
}),
|
|
2762
|
-
/* @__PURE__ */ n(
|
|
2962
|
+
/* @__PURE__ */ n(pr.Provider, {
|
|
2763
2963
|
value: le,
|
|
2764
2964
|
children: /* @__PURE__ */ n("div", {
|
|
2765
|
-
className:
|
|
2965
|
+
className: V(hr.control, j.control?.className, T),
|
|
2766
2966
|
children: ue
|
|
2767
2967
|
})
|
|
2768
2968
|
}),
|
|
2769
2969
|
ae && /* @__PURE__ */ n("div", {
|
|
2770
2970
|
id: s ? re : W,
|
|
2771
|
-
className:
|
|
2971
|
+
className: V(hr.message, oe, !s && j.message?.className, s ? O : k),
|
|
2772
2972
|
role: s ? "alert" : void 0,
|
|
2773
|
-
"aria-live": !s &&
|
|
2973
|
+
"aria-live": !s && I === "polite" ? "polite" : void 0,
|
|
2774
2974
|
children: ae
|
|
2775
2975
|
})
|
|
2776
2976
|
]
|
|
2777
2977
|
});
|
|
2778
|
-
},
|
|
2779
|
-
Label:
|
|
2780
|
-
Description:
|
|
2781
|
-
Control:
|
|
2782
|
-
Message:
|
|
2978
|
+
}, br = _r("label", "FormField.Label"), xr = _r("description", "FormField.Description"), Sr = _r("control", "FormField.Control"), Cr = _r("message", "FormField.Message"), wr = Object.assign(yr, {
|
|
2979
|
+
Label: br,
|
|
2980
|
+
Description: xr,
|
|
2981
|
+
Control: Sr,
|
|
2982
|
+
Message: Cr,
|
|
2783
2983
|
displayName: "FormField"
|
|
2784
2984
|
});
|
|
2785
2985
|
//#endregion
|
|
2786
2986
|
//#region src/components/Select/internal/SelectCollection.ts
|
|
2787
|
-
function
|
|
2987
|
+
function Tr(e) {
|
|
2788
2988
|
let t = [], n = [], r = 0;
|
|
2789
2989
|
function a(e) {
|
|
2790
2990
|
i.forEach(e, (e) => {
|
|
2791
2991
|
if (!l(e)) return;
|
|
2792
2992
|
let i = e.type;
|
|
2793
2993
|
if (i.__velliraSelectPart === "group") {
|
|
2794
|
-
let n = e.props, i =
|
|
2994
|
+
let n = e.props, i = Dr(n.children);
|
|
2795
2995
|
t.push({
|
|
2796
2996
|
type: "group",
|
|
2797
2997
|
id: `group-${r++}`,
|
|
@@ -2803,7 +3003,7 @@ function ir(e) {
|
|
|
2803
3003
|
return;
|
|
2804
3004
|
}
|
|
2805
3005
|
if (i.__velliraSelectPart === "item") {
|
|
2806
|
-
let r = e.props, i =
|
|
3006
|
+
let r = e.props, i = Or(r.children, r.value), a = r.label ?? i.label, o = n.length, s = {
|
|
2807
3007
|
label: a,
|
|
2808
3008
|
value: r.value,
|
|
2809
3009
|
disabled: r.disabled,
|
|
@@ -2835,7 +3035,7 @@ function ir(e) {
|
|
|
2835
3035
|
options: n
|
|
2836
3036
|
};
|
|
2837
3037
|
}
|
|
2838
|
-
function
|
|
3038
|
+
function Er(e) {
|
|
2839
3039
|
let t = !1;
|
|
2840
3040
|
function n(e) {
|
|
2841
3041
|
i.forEach(e, (e) => {
|
|
@@ -2850,7 +3050,7 @@ function ar(e) {
|
|
|
2850
3050
|
}
|
|
2851
3051
|
return n(e), t;
|
|
2852
3052
|
}
|
|
2853
|
-
function
|
|
3053
|
+
function Dr(e) {
|
|
2854
3054
|
let t = [];
|
|
2855
3055
|
function n(e) {
|
|
2856
3056
|
i.forEach(e, (e) => {
|
|
@@ -2865,7 +3065,7 @@ function or(e) {
|
|
|
2865
3065
|
}
|
|
2866
3066
|
return n(e), t;
|
|
2867
3067
|
}
|
|
2868
|
-
function
|
|
3068
|
+
function Or(e, t) {
|
|
2869
3069
|
let n, r, a, o = [];
|
|
2870
3070
|
function s(e) {
|
|
2871
3071
|
i.forEach(e, (e) => {
|
|
@@ -2901,13 +3101,13 @@ function sr(e, t) {
|
|
|
2901
3101
|
}
|
|
2902
3102
|
//#endregion
|
|
2903
3103
|
//#region src/components/Select/internal/useSelectCollection.ts
|
|
2904
|
-
function
|
|
2905
|
-
return h(() =>
|
|
3104
|
+
function kr(e) {
|
|
3105
|
+
return h(() => Tr(e), [e]);
|
|
2906
3106
|
}
|
|
2907
3107
|
//#endregion
|
|
2908
3108
|
//#region src/components/Select/internal/useSelectPosition.ts
|
|
2909
|
-
function
|
|
2910
|
-
return
|
|
3109
|
+
function Ar({ avoidCollisions: e, isOpen: t, matchTriggerWidth: n, onOpenChange: r, placement: i }) {
|
|
3110
|
+
return Ae({
|
|
2911
3111
|
open: t,
|
|
2912
3112
|
onOpenChange: r,
|
|
2913
3113
|
placement: i === "bottom" || i === "top" ? `${i}-start` : i,
|
|
@@ -2918,18 +3118,18 @@ function lr({ avoidCollisions: e, isOpen: t, matchTriggerWidth: n, onOpenChange:
|
|
|
2918
3118
|
}
|
|
2919
3119
|
//#endregion
|
|
2920
3120
|
//#region src/components/Select/internal/useSelectSearch.ts
|
|
2921
|
-
function
|
|
3121
|
+
function jr({ options: e, searchable: t, searchValue: n }) {
|
|
2922
3122
|
return h(() => {
|
|
2923
3123
|
if (!t || !n) return e;
|
|
2924
3124
|
let r = n.toLocaleLowerCase();
|
|
2925
|
-
return e.filter((e) => `${e.label} ${
|
|
3125
|
+
return e.filter((e) => `${e.label} ${Mr(e.description)}`.toLocaleLowerCase().includes(r));
|
|
2926
3126
|
}, [
|
|
2927
3127
|
e,
|
|
2928
3128
|
n,
|
|
2929
3129
|
t
|
|
2930
3130
|
]);
|
|
2931
3131
|
}
|
|
2932
|
-
function
|
|
3132
|
+
function Mr(e) {
|
|
2933
3133
|
return typeof e == "string" || typeof e == "number" ? String(e) : "";
|
|
2934
3134
|
}
|
|
2935
3135
|
var Z = {
|
|
@@ -2958,18 +3158,18 @@ var Z = {
|
|
|
2958
3158
|
spin: "_spin_ao6y1_795",
|
|
2959
3159
|
loading: "_loading_ao6y1_804",
|
|
2960
3160
|
open: "_open_ao6y1_823"
|
|
2961
|
-
},
|
|
2962
|
-
let { triggerProps: r } =
|
|
2963
|
-
return /* @__PURE__ */ n(
|
|
3161
|
+
}, Nr = ({ children: e, className: t }) => {
|
|
3162
|
+
let { triggerProps: r } = Yn();
|
|
3163
|
+
return /* @__PURE__ */ n(Pr, {
|
|
2964
3164
|
...r,
|
|
2965
3165
|
className: [r.className, t].filter(Boolean).join(" "),
|
|
2966
3166
|
children: e
|
|
2967
3167
|
});
|
|
2968
3168
|
};
|
|
2969
|
-
|
|
2970
|
-
var
|
|
3169
|
+
Nr.__velliraSelectPart = "trigger", Nr.displayName = "Select.Trigger";
|
|
3170
|
+
var Pr = ({ children: e, id: i, describedBy: a, labelledBy: o, isOpen: s, disabled: c, required: l, listboxId: u, activeIndex: d, ariaLabel: f, error: p, displayText: m, isPlaceholder: h, size: g = "md", color: _, variant: v, loading: y, startIcon: b, endIcon: x, prefix: S, suffix: C, clearable: w, onClear: T, className: E, buttonRef: D, onClick: O, onKeyDown: k, onBlur: A, onFocus: j }) => /* @__PURE__ */ n("button", {
|
|
2971
3171
|
id: i,
|
|
2972
|
-
ref:
|
|
3172
|
+
ref: D,
|
|
2973
3173
|
type: "button",
|
|
2974
3174
|
role: "combobox",
|
|
2975
3175
|
disabled: c,
|
|
@@ -2983,296 +3183,297 @@ var pr = ({ children: e, id: i, describedBy: a, labelledBy: o, isOpen: s, disabl
|
|
|
2983
3183
|
"aria-controls": s ? u : void 0,
|
|
2984
3184
|
"aria-describedby": a,
|
|
2985
3185
|
"aria-activedescendant": s && d >= 0 ? `${u}-option-${d}` : void 0,
|
|
2986
|
-
className:
|
|
3186
|
+
className: V(Z.control, Z[g], Z[v], Z[_], {
|
|
2987
3187
|
[Z.error]: !!p,
|
|
2988
3188
|
[Z.disabled]: c,
|
|
2989
3189
|
[Z.loading]: y
|
|
2990
|
-
},
|
|
2991
|
-
onClick:
|
|
2992
|
-
onKeyDown:
|
|
2993
|
-
onBlur:
|
|
2994
|
-
onFocus:
|
|
3190
|
+
}, E),
|
|
3191
|
+
onClick: O,
|
|
3192
|
+
onKeyDown: k,
|
|
3193
|
+
onBlur: A,
|
|
3194
|
+
onFocus: j,
|
|
2995
3195
|
children: e ?? /* @__PURE__ */ r(t, { children: [
|
|
2996
|
-
|
|
3196
|
+
b && /* @__PURE__ */ n("span", {
|
|
2997
3197
|
className: Z.adornment,
|
|
2998
|
-
children:
|
|
3198
|
+
children: b
|
|
2999
3199
|
}),
|
|
3000
|
-
|
|
3200
|
+
S && /* @__PURE__ */ n("span", {
|
|
3001
3201
|
className: Z.affix,
|
|
3002
|
-
children:
|
|
3202
|
+
children: S
|
|
3003
3203
|
}),
|
|
3004
3204
|
/* @__PURE__ */ n("span", {
|
|
3005
3205
|
className: Z.valueWrap,
|
|
3006
3206
|
children: /* @__PURE__ */ n("span", {
|
|
3007
|
-
className:
|
|
3207
|
+
className: V(Z.value, { [Z.placeholder]: h }),
|
|
3008
3208
|
children: m
|
|
3009
3209
|
})
|
|
3010
3210
|
}),
|
|
3011
|
-
|
|
3211
|
+
C && /* @__PURE__ */ n("span", {
|
|
3012
3212
|
className: Z.affix,
|
|
3013
|
-
children:
|
|
3213
|
+
children: C
|
|
3014
3214
|
}),
|
|
3015
|
-
|
|
3215
|
+
w && /* @__PURE__ */ n("span", {
|
|
3016
3216
|
role: "button",
|
|
3017
3217
|
"aria-label": "Clear selection",
|
|
3018
3218
|
tabIndex: -1,
|
|
3019
3219
|
className: Z.clear,
|
|
3020
3220
|
onClick: (e) => {
|
|
3021
|
-
e.stopPropagation(),
|
|
3221
|
+
e.stopPropagation(), T?.();
|
|
3022
3222
|
},
|
|
3023
|
-
children: /* @__PURE__ */ n(
|
|
3223
|
+
children: /* @__PURE__ */ n(B, {})
|
|
3024
3224
|
}),
|
|
3025
3225
|
/* @__PURE__ */ n("span", {
|
|
3026
|
-
className:
|
|
3226
|
+
className: V(Z.arrow, { [Z.open]: s }),
|
|
3027
3227
|
"aria-hidden": "true",
|
|
3028
|
-
children: y ? /* @__PURE__ */ n("span", { className: Z.spinner }) :
|
|
3228
|
+
children: y ? /* @__PURE__ */ n("span", { className: Z.spinner }) : x ?? /* @__PURE__ */ n(R, {})
|
|
3029
3229
|
})
|
|
3030
3230
|
] })
|
|
3031
3231
|
});
|
|
3032
|
-
|
|
3232
|
+
Pr.displayName = "SelectTriggerSurface";
|
|
3033
3233
|
//#endregion
|
|
3034
3234
|
//#region src/components/Select/Root/SelectRoot.tsx
|
|
3035
|
-
var
|
|
3036
|
-
let
|
|
3235
|
+
var Fr = ({ children: e, label: i, description: a, id: o, name: s, "aria-label": c, "aria-describedby": l, "aria-labelledby": d, value: m, defaultValue: v, onValueChange: y, multiple: b = !1, maxSelected: x, closeOnSelect: S, placeholder: C = "Select...", empty: w, loadingText: T = "Loading...", size: E, color: D = "primary", variant: O = "outline", required: k = !1, disabled: A = !1, invalid: j = !1, loading: M = !1, clearable: N = !1, searchable: P = !1, virtual: F, modal: I = !1, command: L = !1, error: R, placement: z = "bottom", matchTriggerWidth: B = !0, avoidCollisions: ee = !0, portal: V = !0, open: te, defaultOpen: H = !1, onOpenChange: U, onSearch: ne, onClear: re, startIcon: W, endIcon: ie, prefix: ae, suffix: G, renderValue: oe, renderOption: se, onBlur: ce, onFocus: le, className: K, triggerClassName: ue, dropdownClassName: de }) => {
|
|
3236
|
+
let fe = p(), pe = mr(), me = !!(i || a || R), he = o ?? (me ? void 0 : pe?.controlId) ?? fe, ge = `${he}-listbox`, [_e, ve] = _(""), ye = !!R, be = ye ? `${he}-error` : void 0, xe = a ? `${he}-description` : void 0, Se = E ?? pe?.size ?? "md", Ce = j || ye || !me && !!pe?.invalid, q = A || !me && !!pe?.disabled, we = k || !me && !!pe?.required, Te = [
|
|
3037
3237
|
l,
|
|
3038
|
-
!
|
|
3039
|
-
|
|
3040
|
-
|
|
3041
|
-
].filter(Boolean).join(" "),
|
|
3042
|
-
options:
|
|
3043
|
-
searchable:
|
|
3044
|
-
searchValue:
|
|
3045
|
-
}), { selectedValue:
|
|
3238
|
+
!me && !l ? pe?.ariaDescribedBy : void 0,
|
|
3239
|
+
xe,
|
|
3240
|
+
be
|
|
3241
|
+
].filter(Boolean).join(" "), Ee = g(null), De = g(null), [Oe, Ae] = _(!1), je = P || L, { entries: Me, options: Ne } = kr(e), Fe = jr({
|
|
3242
|
+
options: Ne,
|
|
3243
|
+
searchable: je,
|
|
3244
|
+
searchValue: _e
|
|
3245
|
+
}), { selectedValue: Ie, selectedValues: J, isOpen: Le, setIsOpen: Re, setSelectedValue: ze, activeIndex: Ve, setActiveIndex: He, closeDropdown: Ue, toggleDropdown: We, selectValue: Ge, onKeyDown: Ke } = Be({
|
|
3046
3246
|
value: m,
|
|
3047
3247
|
defaultValue: v,
|
|
3048
3248
|
onValueChange: y,
|
|
3049
|
-
options:
|
|
3249
|
+
options: Fe,
|
|
3050
3250
|
multiple: b,
|
|
3051
3251
|
maxSelected: x,
|
|
3052
3252
|
closeOnSelect: S,
|
|
3053
|
-
disabled:
|
|
3054
|
-
open:
|
|
3055
|
-
defaultOpen:
|
|
3056
|
-
onOpenChange:
|
|
3057
|
-
}),
|
|
3058
|
-
isOpen:
|
|
3059
|
-
onOpenChange:
|
|
3253
|
+
disabled: q,
|
|
3254
|
+
open: te,
|
|
3255
|
+
defaultOpen: H,
|
|
3256
|
+
onOpenChange: U
|
|
3257
|
+
}), qe = h(() => Ne.find((e) => J.includes(e.value)), [Ne, J]), Je = h(() => Ne.filter((e) => J.includes(e.value)), [Ne, J]), Ye = !!qe, Xe = Array.isArray(Ie) ? Ie[0] ?? "" : Ie, { floatingStyles: Ze, setRef: Qe, setFloatingRef: $e } = Ar({
|
|
3258
|
+
isOpen: Le,
|
|
3259
|
+
onOpenChange: Re,
|
|
3060
3260
|
placement: z,
|
|
3061
3261
|
matchTriggerWidth: B,
|
|
3062
|
-
avoidCollisions:
|
|
3063
|
-
}),
|
|
3064
|
-
|
|
3065
|
-
}, [
|
|
3262
|
+
avoidCollisions: ee
|
|
3263
|
+
}), et = u((e) => {
|
|
3264
|
+
Ge(e), Ee.current?.focus();
|
|
3265
|
+
}, [Ge]), tt = u((e) => {
|
|
3066
3266
|
if (!b || e.length === 0) return;
|
|
3067
|
-
let t = e.filter((e) =>
|
|
3267
|
+
let t = e.filter((e) => Ne.some((t) => t.value === e && !t.disabled)), n = t.filter((e) => J.includes(e)), r = J.filter((e) => !t.includes(e)).length, i = typeof x == "number" ? Math.max(0, Math.min(t.length, x - r)) : t.length;
|
|
3068
3268
|
if (n.length > 0 && n.length >= i) {
|
|
3069
|
-
|
|
3269
|
+
ze(J.filter((e) => !t.includes(e)));
|
|
3070
3270
|
return;
|
|
3071
3271
|
}
|
|
3072
|
-
let a = [...
|
|
3272
|
+
let a = [...J];
|
|
3073
3273
|
for (let e of t) if (!a.includes(e)) {
|
|
3074
3274
|
if (typeof x == "number" && a.length >= x) break;
|
|
3075
3275
|
a.push(e);
|
|
3076
3276
|
}
|
|
3077
|
-
|
|
3277
|
+
ze(a), S && (Ue(), Ee.current?.focus());
|
|
3078
3278
|
}, [
|
|
3079
|
-
|
|
3279
|
+
Ue,
|
|
3080
3280
|
S,
|
|
3081
3281
|
x,
|
|
3082
3282
|
b,
|
|
3083
|
-
|
|
3084
|
-
|
|
3085
|
-
|
|
3086
|
-
]),
|
|
3087
|
-
|
|
3088
|
-
}, [re,
|
|
3089
|
-
|
|
3090
|
-
}, [
|
|
3091
|
-
|
|
3092
|
-
}, [
|
|
3093
|
-
|
|
3094
|
-
}, [
|
|
3095
|
-
|
|
3096
|
-
}, [ne]),
|
|
3097
|
-
active:
|
|
3098
|
-
id:
|
|
3099
|
-
|
|
3100
|
-
oe({
|
|
3101
|
-
active: Be,
|
|
3283
|
+
Ne,
|
|
3284
|
+
J,
|
|
3285
|
+
ze
|
|
3286
|
+
]), nt = u(() => {
|
|
3287
|
+
Ge(""), re?.(), Ee.current?.focus();
|
|
3288
|
+
}, [re, Ge]), Y = u(() => {
|
|
3289
|
+
Le || Ae(!1), We();
|
|
3290
|
+
}, [Le, We]), rt = u((e) => {
|
|
3291
|
+
Ir(e, Le) && Ae(!0), Ke(e);
|
|
3292
|
+
}, [Le, Ke]), it = u((e) => {
|
|
3293
|
+
Ae(!0), He(e);
|
|
3294
|
+
}, [He]), at = u((e) => {
|
|
3295
|
+
ve(e), ne?.(e);
|
|
3296
|
+
}, [ne]), ot = ke({
|
|
3297
|
+
active: Le,
|
|
3298
|
+
id: ge,
|
|
3299
|
+
zIndexLevel: "dropdown",
|
|
3102
3300
|
closeOnEscape: !0,
|
|
3103
3301
|
closeOnOutsidePress: !0,
|
|
3104
|
-
contentRef:
|
|
3105
|
-
ignoreRefs: [
|
|
3106
|
-
|
|
3107
|
-
|
|
3108
|
-
|
|
3109
|
-
|
|
3110
|
-
}, [
|
|
3111
|
-
!
|
|
3112
|
-
}, [
|
|
3113
|
-
active:
|
|
3302
|
+
contentRef: De,
|
|
3303
|
+
ignoreRefs: [Ee],
|
|
3304
|
+
requestClose: Ue
|
|
3305
|
+
});
|
|
3306
|
+
f(() => {
|
|
3307
|
+
Le || Ae(!1);
|
|
3308
|
+
}, [Le]), f(() => {
|
|
3309
|
+
!Le && _e && ve("");
|
|
3310
|
+
}, [Le, _e]), Pe({
|
|
3311
|
+
active: Le,
|
|
3114
3312
|
enabled: I
|
|
3115
3313
|
});
|
|
3116
|
-
let
|
|
3117
|
-
|
|
3118
|
-
}, [
|
|
3119
|
-
|
|
3120
|
-
}, [
|
|
3121
|
-
id:
|
|
3122
|
-
describedBy:
|
|
3314
|
+
let st = u((e) => {
|
|
3315
|
+
Ee.current = e, Qe(e);
|
|
3316
|
+
}, [Qe]), ct = u((e) => {
|
|
3317
|
+
De.current = e, $e(e);
|
|
3318
|
+
}, [$e]), lt = oe ? oe(qe) : b && Je.length ? Je.map((e) => e.label).join(", ") : qe?.label ?? C, ut = w ?? "No options available", dt = N && J.length > 0 && !q && !M, ft = {
|
|
3319
|
+
id: he,
|
|
3320
|
+
describedBy: Te || void 0,
|
|
3123
3321
|
labelledBy: c ? void 0 : d,
|
|
3124
|
-
isOpen:
|
|
3125
|
-
disabled:
|
|
3126
|
-
required:
|
|
3127
|
-
listboxId:
|
|
3128
|
-
activeIndex:
|
|
3129
|
-
ariaLabel: c ?? (!i && !
|
|
3130
|
-
error:
|
|
3322
|
+
isOpen: Le,
|
|
3323
|
+
disabled: q,
|
|
3324
|
+
required: we,
|
|
3325
|
+
listboxId: ge,
|
|
3326
|
+
activeIndex: Ve,
|
|
3327
|
+
ariaLabel: c ?? (!i && !pe?.labelId ? qe?.label || C : void 0),
|
|
3328
|
+
error: Ce,
|
|
3131
3329
|
loading: M,
|
|
3132
|
-
displayText:
|
|
3133
|
-
isPlaceholder: !
|
|
3134
|
-
size:
|
|
3330
|
+
displayText: lt,
|
|
3331
|
+
isPlaceholder: !Ye,
|
|
3332
|
+
size: Se,
|
|
3135
3333
|
color: D,
|
|
3136
3334
|
variant: O,
|
|
3137
3335
|
startIcon: W,
|
|
3138
3336
|
endIcon: ie,
|
|
3139
3337
|
prefix: ae,
|
|
3140
3338
|
suffix: G,
|
|
3141
|
-
clearable:
|
|
3142
|
-
className:
|
|
3143
|
-
buttonRef:
|
|
3144
|
-
onClear:
|
|
3145
|
-
onClick:
|
|
3146
|
-
onKeyDown:
|
|
3147
|
-
onBlur:
|
|
3148
|
-
onFocus:
|
|
3149
|
-
},
|
|
3150
|
-
isOpen:
|
|
3151
|
-
listboxId:
|
|
3152
|
-
labelledById:
|
|
3153
|
-
style:
|
|
3154
|
-
|
|
3155
|
-
|
|
3339
|
+
clearable: dt,
|
|
3340
|
+
className: ue,
|
|
3341
|
+
buttonRef: st,
|
|
3342
|
+
onClear: nt,
|
|
3343
|
+
onClick: Y,
|
|
3344
|
+
onKeyDown: rt,
|
|
3345
|
+
onBlur: ce,
|
|
3346
|
+
onFocus: le
|
|
3347
|
+
}, pt = {
|
|
3348
|
+
isOpen: Le,
|
|
3349
|
+
listboxId: ge,
|
|
3350
|
+
labelledById: he,
|
|
3351
|
+
style: {
|
|
3352
|
+
...Ze,
|
|
3353
|
+
zIndex: ot.zIndex
|
|
3354
|
+
},
|
|
3355
|
+
options: Fe,
|
|
3356
|
+
entries: je || _e ? void 0 : Me,
|
|
3156
3357
|
multiple: b,
|
|
3157
3358
|
color: D,
|
|
3158
3359
|
variant: O,
|
|
3159
|
-
searchable:
|
|
3360
|
+
searchable: je,
|
|
3160
3361
|
command: L,
|
|
3161
3362
|
virtual: F,
|
|
3162
|
-
portal:
|
|
3163
|
-
searchValue:
|
|
3363
|
+
portal: V,
|
|
3364
|
+
searchValue: _e,
|
|
3164
3365
|
loading: M,
|
|
3165
3366
|
loadingText: T,
|
|
3166
|
-
emptyText:
|
|
3167
|
-
renderOption:
|
|
3168
|
-
selectedValue:
|
|
3169
|
-
selectedValues:
|
|
3170
|
-
activeIndex:
|
|
3171
|
-
visualActiveIndex:
|
|
3172
|
-
className:
|
|
3173
|
-
setDropdownRef:
|
|
3174
|
-
onSelect:
|
|
3175
|
-
onSelectGroup:
|
|
3176
|
-
onMouseEnter:
|
|
3177
|
-
onSearchChange:
|
|
3178
|
-
},
|
|
3367
|
+
emptyText: ut,
|
|
3368
|
+
renderOption: se,
|
|
3369
|
+
selectedValue: Xe,
|
|
3370
|
+
selectedValues: J,
|
|
3371
|
+
activeIndex: Ve,
|
|
3372
|
+
visualActiveIndex: Oe ? Ve : -1,
|
|
3373
|
+
className: de,
|
|
3374
|
+
setDropdownRef: ct,
|
|
3375
|
+
onSelect: et,
|
|
3376
|
+
onSelectGroup: tt,
|
|
3377
|
+
onMouseEnter: it,
|
|
3378
|
+
onSearchChange: at
|
|
3379
|
+
}, mt = /* @__PURE__ */ r(t, { children: [s && b && J.length > 0 && /* @__PURE__ */ n(t, { children: J.map((e) => /* @__PURE__ */ n("input", {
|
|
3179
3380
|
type: "hidden",
|
|
3180
3381
|
name: s,
|
|
3181
3382
|
value: e,
|
|
3182
|
-
disabled:
|
|
3383
|
+
disabled: q
|
|
3183
3384
|
}, e)) }), s && !b && /* @__PURE__ */ n("input", {
|
|
3184
3385
|
type: "hidden",
|
|
3185
3386
|
name: s,
|
|
3186
|
-
value:
|
|
3187
|
-
disabled:
|
|
3188
|
-
})] }),
|
|
3387
|
+
value: Xe,
|
|
3388
|
+
disabled: q
|
|
3389
|
+
})] }), ht = Er(e), gt = /* @__PURE__ */ r(Jn, {
|
|
3189
3390
|
value: {
|
|
3190
|
-
triggerProps:
|
|
3191
|
-
contentProps:
|
|
3391
|
+
triggerProps: ft,
|
|
3392
|
+
contentProps: pt
|
|
3192
3393
|
},
|
|
3193
|
-
children: [
|
|
3194
|
-
}),
|
|
3394
|
+
children: [mt, ht ? e : /* @__PURE__ */ r(t, { children: [/* @__PURE__ */ n(Nr, {}), /* @__PURE__ */ n(er, { children: e })] })]
|
|
3395
|
+
}), _t = /* @__PURE__ */ r(Jn, {
|
|
3195
3396
|
value: {
|
|
3196
|
-
triggerProps:
|
|
3197
|
-
contentProps:
|
|
3397
|
+
triggerProps: ft,
|
|
3398
|
+
contentProps: pt
|
|
3198
3399
|
},
|
|
3199
3400
|
children: [
|
|
3200
|
-
|
|
3201
|
-
/* @__PURE__ */ n(
|
|
3202
|
-
/* @__PURE__ */ n(
|
|
3401
|
+
mt,
|
|
3402
|
+
/* @__PURE__ */ n(Pr, { ...ft }),
|
|
3403
|
+
/* @__PURE__ */ n(tr, { ...pt })
|
|
3203
3404
|
]
|
|
3204
3405
|
});
|
|
3205
|
-
return !
|
|
3206
|
-
id:
|
|
3406
|
+
return !me && pe ? e ? gt : _t : /* @__PURE__ */ n(wr, {
|
|
3407
|
+
id: he,
|
|
3207
3408
|
label: i,
|
|
3208
3409
|
description: a,
|
|
3209
3410
|
error: R,
|
|
3210
|
-
required:
|
|
3211
|
-
disabled:
|
|
3411
|
+
required: we,
|
|
3412
|
+
disabled: q,
|
|
3212
3413
|
bindControl: !1,
|
|
3213
|
-
className:
|
|
3214
|
-
children: e ?
|
|
3414
|
+
className: K,
|
|
3415
|
+
children: e ? gt : _t
|
|
3215
3416
|
});
|
|
3216
3417
|
};
|
|
3217
|
-
|
|
3218
|
-
function
|
|
3418
|
+
Fr.displayName = "SelectRoot";
|
|
3419
|
+
function Ir(e, t) {
|
|
3219
3420
|
return e.altKey || e.ctrlKey || e.metaKey ? !1 : t ? e.key === "ArrowDown" || e.key === "ArrowUp" || e.key === "Home" || e.key === "End" || e.key === "Enter" || e.key === " " || e.key.length === 1 : e.key === "ArrowDown" || e.key === "ArrowUp" || e.key === "Enter" || e.key === " ";
|
|
3220
3421
|
}
|
|
3221
3422
|
//#endregion
|
|
3222
3423
|
//#region src/components/Select/Trigger/SelectIcon.tsx
|
|
3223
|
-
var
|
|
3224
|
-
let { triggerProps: r } =
|
|
3424
|
+
var Lr = ({ children: e, className: t }) => {
|
|
3425
|
+
let { triggerProps: r } = Yn();
|
|
3225
3426
|
return /* @__PURE__ */ n("span", {
|
|
3226
|
-
className:
|
|
3427
|
+
className: V(Z.arrow, { [Z.open]: r.isOpen }, t),
|
|
3227
3428
|
"aria-hidden": "true",
|
|
3228
|
-
children: r.loading ? /* @__PURE__ */ n("span", { className: Z.spinner }) : e ?? r.endIcon ?? /* @__PURE__ */ n(
|
|
3429
|
+
children: r.loading ? /* @__PURE__ */ n("span", { className: Z.spinner }) : e ?? r.endIcon ?? /* @__PURE__ */ n(R, {})
|
|
3229
3430
|
});
|
|
3230
3431
|
};
|
|
3231
|
-
|
|
3432
|
+
Lr.__velliraSelectPart = "icon", Lr.displayName = "Select.Icon";
|
|
3232
3433
|
//#endregion
|
|
3233
3434
|
//#region src/components/Select/Trigger/SelectValue.tsx
|
|
3234
|
-
var
|
|
3235
|
-
let { triggerProps: r } =
|
|
3435
|
+
var Rr = ({ children: e, className: t }) => {
|
|
3436
|
+
let { triggerProps: r } = Yn();
|
|
3236
3437
|
return /* @__PURE__ */ n("span", {
|
|
3237
|
-
className:
|
|
3438
|
+
className: V(Z.valueWrap, t),
|
|
3238
3439
|
children: /* @__PURE__ */ n("span", {
|
|
3239
|
-
className:
|
|
3440
|
+
className: V(Z.value, { [Z.placeholder]: r.isPlaceholder }),
|
|
3240
3441
|
children: e ?? r.displayText
|
|
3241
3442
|
})
|
|
3242
3443
|
});
|
|
3243
3444
|
};
|
|
3244
|
-
|
|
3445
|
+
Rr.__velliraSelectPart = "value", Rr.displayName = "Select.Value";
|
|
3245
3446
|
//#endregion
|
|
3246
3447
|
//#region src/components/Select/Select.tsx
|
|
3247
|
-
var
|
|
3248
|
-
Trigger:
|
|
3249
|
-
Value:
|
|
3250
|
-
Icon:
|
|
3251
|
-
Content:
|
|
3252
|
-
Search:
|
|
3253
|
-
Group:
|
|
3254
|
-
Label:
|
|
3255
|
-
Item:
|
|
3256
|
-
ItemIcon:
|
|
3257
|
-
ItemDescription:
|
|
3258
|
-
ItemBadge:
|
|
3259
|
-
Separator:
|
|
3260
|
-
Empty:
|
|
3261
|
-
Loading:
|
|
3448
|
+
var zr = Object.assign(Fr, {
|
|
3449
|
+
Trigger: Nr,
|
|
3450
|
+
Value: Rr,
|
|
3451
|
+
Icon: Lr,
|
|
3452
|
+
Content: er,
|
|
3453
|
+
Search: or,
|
|
3454
|
+
Group: sr,
|
|
3455
|
+
Label: cr,
|
|
3456
|
+
Item: Qn,
|
|
3457
|
+
ItemIcon: fr,
|
|
3458
|
+
ItemDescription: dr,
|
|
3459
|
+
ItemBadge: ur,
|
|
3460
|
+
Separator: lr,
|
|
3461
|
+
Empty: ir,
|
|
3462
|
+
Loading: ar
|
|
3262
3463
|
});
|
|
3263
|
-
|
|
3464
|
+
zr.displayName = "Select";
|
|
3264
3465
|
//#endregion
|
|
3265
3466
|
//#region src/components/Tabs/internal/TabsContext.tsx
|
|
3266
|
-
var
|
|
3267
|
-
let e = d(
|
|
3467
|
+
var Br = s(null), Vr = () => {
|
|
3468
|
+
let e = d(Br);
|
|
3268
3469
|
if (!e) throw Error("Tabs components must be used inside Tabs");
|
|
3269
3470
|
return e;
|
|
3270
|
-
},
|
|
3471
|
+
}, Hr = {
|
|
3271
3472
|
panel: "_panel_1v1a9_1",
|
|
3272
3473
|
visible: "_visible_1v1a9_10",
|
|
3273
3474
|
vertical: "_vertical_1v1a9_14"
|
|
3274
|
-
},
|
|
3275
|
-
let { value: o, orientation: s, keepMounted: c, lazyMount: l, registerContent: u, getTriggerId: d, getContentId: p } =
|
|
3475
|
+
}, Ur = ({ value: e, children: t, className: r, forceMount: i = !1, ...a }) => {
|
|
3476
|
+
let { value: o, orientation: s, keepMounted: c, lazyMount: l, registerContent: u, getTriggerId: d, getContentId: p } = Vr(), m = o === e, [h, g] = _(m);
|
|
3276
3477
|
return f(() => (u(e, !0), () => {
|
|
3277
3478
|
u(e, !1);
|
|
3278
3479
|
}), [u, e]), f(() => {
|
|
@@ -3286,15 +3487,15 @@ var yr = s(null), br = () => {
|
|
|
3286
3487
|
tabIndex: 0,
|
|
3287
3488
|
"data-state": m ? "active" : "inactive",
|
|
3288
3489
|
"data-orientation": s,
|
|
3289
|
-
className:
|
|
3490
|
+
className: V(Hr.panel, m && Hr.visible, s === "vertical" && Hr.vertical, r),
|
|
3290
3491
|
children: t
|
|
3291
3492
|
}) : null;
|
|
3292
3493
|
};
|
|
3293
|
-
|
|
3494
|
+
Ur.displayName = "Tabs.Content";
|
|
3294
3495
|
//#endregion
|
|
3295
3496
|
//#region src/components/Tabs/internal/useTabsIndicator.ts
|
|
3296
|
-
var
|
|
3297
|
-
let e = g(null), t = g(null), n = g(void 0), r = g(null), [i, a] = _({}), { value: o, orientation: s, variant: c, collectionVersion: l, getTriggerId: u } =
|
|
3497
|
+
var Wr = 8, Gr = 360, Kr = () => {
|
|
3498
|
+
let e = g(null), t = g(null), n = g(void 0), r = g(null), [i, a] = _({}), { value: o, orientation: s, variant: c, collectionVersion: l, getTriggerId: u } = Vr();
|
|
3298
3499
|
return f(() => () => {
|
|
3299
3500
|
r.current?.cancel();
|
|
3300
3501
|
}, []), m(() => {
|
|
@@ -3330,7 +3531,7 @@ var Cr = 8, wr = 360, Tr = () => {
|
|
|
3330
3531
|
let s = t.current;
|
|
3331
3532
|
if (e && c === "line" && s && n.current !== o && !(typeof window.matchMedia == "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches) && typeof i.animate == "function") {
|
|
3332
3533
|
r.current?.cancel();
|
|
3333
|
-
let e = s.y + s.height / 2, t = p.y + p.height / 2, n = e -
|
|
3534
|
+
let e = s.y + s.height / 2, t = p.y + p.height / 2, n = e - Wr / 2, a = t - Wr / 2;
|
|
3334
3535
|
r.current = i.animate([
|
|
3335
3536
|
{
|
|
3336
3537
|
height: `${s.height}px`,
|
|
@@ -3338,12 +3539,12 @@ var Cr = 8, wr = 360, Tr = () => {
|
|
|
3338
3539
|
offset: 0
|
|
3339
3540
|
},
|
|
3340
3541
|
{
|
|
3341
|
-
height: `${
|
|
3542
|
+
height: `${Wr}px`,
|
|
3342
3543
|
transform: `translate3d(0, ${n}px, 0)`,
|
|
3343
3544
|
offset: .28
|
|
3344
3545
|
},
|
|
3345
3546
|
{
|
|
3346
|
-
height: `${
|
|
3547
|
+
height: `${Wr}px`,
|
|
3347
3548
|
transform: `translate3d(0, ${a}px, 0)`,
|
|
3348
3549
|
offset: .64
|
|
3349
3550
|
},
|
|
@@ -3353,7 +3554,7 @@ var Cr = 8, wr = 360, Tr = () => {
|
|
|
3353
3554
|
offset: 1
|
|
3354
3555
|
}
|
|
3355
3556
|
], {
|
|
3356
|
-
duration:
|
|
3557
|
+
duration: Gr,
|
|
3357
3558
|
easing: "cubic-bezier(0.22, 1, 0.36, 1)",
|
|
3358
3559
|
fill: "none"
|
|
3359
3560
|
});
|
|
@@ -3369,7 +3570,7 @@ var Cr = 8, wr = 360, Tr = () => {
|
|
|
3369
3570
|
let h = t.current;
|
|
3370
3571
|
if (e && c === "line" && h && n.current !== o && !(typeof window.matchMedia == "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches) && typeof i.animate == "function") {
|
|
3371
3572
|
r.current?.cancel();
|
|
3372
|
-
let e = h.x + h.width / 2, t = p.x + p.width / 2, n = e -
|
|
3573
|
+
let e = h.x + h.width / 2, t = p.x + p.width / 2, n = e - Wr / 2, a = t - Wr / 2;
|
|
3373
3574
|
r.current = i.animate([
|
|
3374
3575
|
{
|
|
3375
3576
|
width: `${h.width}px`,
|
|
@@ -3377,12 +3578,12 @@ var Cr = 8, wr = 360, Tr = () => {
|
|
|
3377
3578
|
offset: 0
|
|
3378
3579
|
},
|
|
3379
3580
|
{
|
|
3380
|
-
width: `${
|
|
3581
|
+
width: `${Wr}px`,
|
|
3381
3582
|
transform: `translate3d(${n}px, 0, 0)`,
|
|
3382
3583
|
offset: .28
|
|
3383
3584
|
},
|
|
3384
3585
|
{
|
|
3385
|
-
width: `${
|
|
3586
|
+
width: `${Wr}px`,
|
|
3386
3587
|
transform: `translate3d(${a}px, 0, 0)`,
|
|
3387
3588
|
offset: .64
|
|
3388
3589
|
},
|
|
@@ -3392,7 +3593,7 @@ var Cr = 8, wr = 360, Tr = () => {
|
|
|
3392
3593
|
offset: 1
|
|
3393
3594
|
}
|
|
3394
3595
|
], {
|
|
3395
|
-
duration:
|
|
3596
|
+
duration: Gr,
|
|
3396
3597
|
easing: "cubic-bezier(0.22, 1, 0.36, 1)",
|
|
3397
3598
|
fill: "none"
|
|
3398
3599
|
});
|
|
@@ -3420,7 +3621,7 @@ var Cr = 8, wr = 360, Tr = () => {
|
|
|
3420
3621
|
ref: e,
|
|
3421
3622
|
style: i
|
|
3422
3623
|
}), [i]);
|
|
3423
|
-
},
|
|
3624
|
+
}, qr = {
|
|
3424
3625
|
list: "_list_j3cp3_1",
|
|
3425
3626
|
vertical: "_vertical_j3cp3_10",
|
|
3426
3627
|
line: "_line_j3cp3_17",
|
|
@@ -3428,24 +3629,24 @@ var Cr = 8, wr = 360, Tr = () => {
|
|
|
3428
3629
|
segmented: "_segmented_j3cp3_29",
|
|
3429
3630
|
scrollable: "_scrollable_j3cp3_37",
|
|
3430
3631
|
indicator: "_indicator_j3cp3_46"
|
|
3431
|
-
},
|
|
3432
|
-
let { ref: i, style: a } =
|
|
3632
|
+
}, Jr = ({ className: e, style: t, ...r }) => {
|
|
3633
|
+
let { ref: i, style: a } = Kr();
|
|
3433
3634
|
return /* @__PURE__ */ n("span", {
|
|
3434
3635
|
...r,
|
|
3435
3636
|
ref: i,
|
|
3436
3637
|
"aria-hidden": "true",
|
|
3437
|
-
className:
|
|
3638
|
+
className: V(qr.indicator, e),
|
|
3438
3639
|
style: {
|
|
3439
3640
|
...a,
|
|
3440
3641
|
...t
|
|
3441
3642
|
}
|
|
3442
3643
|
});
|
|
3443
3644
|
};
|
|
3444
|
-
|
|
3645
|
+
Jr.displayName = "Tabs.Indicator";
|
|
3445
3646
|
//#endregion
|
|
3446
3647
|
//#region src/components/Tabs/List/TabsList.tsx
|
|
3447
|
-
var
|
|
3448
|
-
let { orientation: a, variant: o } =
|
|
3648
|
+
var Yr = ({ children: e, className: t, scrollable: r, ...i }) => {
|
|
3649
|
+
let { orientation: a, variant: o } = Vr(), s = r ?? !1;
|
|
3449
3650
|
return /* @__PURE__ */ n("div", {
|
|
3450
3651
|
...i,
|
|
3451
3652
|
role: "tablist",
|
|
@@ -3453,18 +3654,18 @@ var Or = ({ children: e, className: t, scrollable: r, ...i }) => {
|
|
|
3453
3654
|
"data-orientation": a,
|
|
3454
3655
|
"data-variant": o,
|
|
3455
3656
|
"data-scrollable": s ? "" : void 0,
|
|
3456
|
-
className:
|
|
3657
|
+
className: V(qr.list, a === "vertical" && qr.vertical, o === "line" && qr.line, o === "pills" && qr.pills, o === "segmented" && qr.segmented, s && qr.scrollable, t),
|
|
3457
3658
|
children: e
|
|
3458
3659
|
});
|
|
3459
3660
|
};
|
|
3460
|
-
|
|
3661
|
+
Yr.displayName = "TabsList";
|
|
3461
3662
|
//#endregion
|
|
3462
3663
|
//#region src/components/Tabs/internal/useTabsCollection.ts
|
|
3463
|
-
var
|
|
3664
|
+
var Xr = (e) => [...e].sort((e, t) => {
|
|
3464
3665
|
if (e.element === t.element) return 0;
|
|
3465
3666
|
let n = e.element.compareDocumentPosition(t.element);
|
|
3466
3667
|
return n & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : n & Node.DOCUMENT_POSITION_PRECEDING ? 1 : 0;
|
|
3467
|
-
}),
|
|
3668
|
+
}), Zr = () => {
|
|
3468
3669
|
let e = g([]), t = g([]), [n, r] = _(0), i = u(() => {
|
|
3469
3670
|
r((e) => e + 1);
|
|
3470
3671
|
}, []);
|
|
@@ -3483,7 +3684,7 @@ var kr = (e) => [...e].sort((e, t) => {
|
|
|
3483
3684
|
element: n,
|
|
3484
3685
|
disabled: r
|
|
3485
3686
|
}, o = e.current.findIndex((e) => e.element === n);
|
|
3486
|
-
o >= 0 ? e.current[o] = a : e.current.push(a), e.current =
|
|
3687
|
+
o >= 0 ? e.current[o] = a : e.current.push(a), e.current = Xr(e.current), i();
|
|
3487
3688
|
}, [i]),
|
|
3488
3689
|
registerContent: u((e, n) => {
|
|
3489
3690
|
let r = t.current.findIndex((t) => t.value === e);
|
|
@@ -3494,7 +3695,7 @@ var kr = (e) => [...e].sort((e, t) => {
|
|
|
3494
3695
|
r < 0 && (t.current.push({ value: e }), i());
|
|
3495
3696
|
}, [i])
|
|
3496
3697
|
};
|
|
3497
|
-
},
|
|
3698
|
+
}, Qr = ({ focusedValue: e, setValue: t, setFocusedValue: n, getTabs: r, orientation: i, activationMode: a, dir: o, loop: s }) => ({ onKeyDown: (c) => {
|
|
3498
3699
|
let l = r().filter((e) => !e.disabled);
|
|
3499
3700
|
if (l.length === 0) return;
|
|
3500
3701
|
let u = l.findIndex((e) => e.element === document.activeElement), d = l.findIndex((t) => t.value === e), f = u >= 0 ? u : d >= 0 ? d : 0, p = (e) => {
|
|
@@ -3531,15 +3732,15 @@ var kr = (e) => [...e].sort((e, t) => {
|
|
|
3531
3732
|
}
|
|
3532
3733
|
break;
|
|
3533
3734
|
}
|
|
3534
|
-
} }),
|
|
3735
|
+
} }), $r = {
|
|
3535
3736
|
tabs: "_tabs_1hj56_1",
|
|
3536
3737
|
vertical: "_vertical_1hj56_30"
|
|
3537
|
-
},
|
|
3538
|
-
let S = p(), C = t !== void 0, { value: w, setValue: T } =
|
|
3738
|
+
}, ei = ({ children: e, value: t, defaultValue: r, onValueChange: i, orientation: a = "horizontal", activationMode: o = "automatic", dir: s = "ltr", loop: c = !0, variant: l = "line", color: d = "primary", size: m = "md", keepMounted: h = !1, lazyMount: v = !1, disabled: y = !1, className: b, ...x }) => {
|
|
3739
|
+
let S = p(), C = t !== void 0, { value: w, setValue: T } = Ve({
|
|
3539
3740
|
value: t,
|
|
3540
3741
|
defaultValue: r,
|
|
3541
3742
|
onValueChange: i
|
|
3542
|
-
}), E = g(w), D = g(void 0), O = g(void 0), [k, A] = _(w), { version: j, triggersRef: M, contentsRef: N, registerTrigger: P, registerContent: F } =
|
|
3743
|
+
}), E = g(w), D = g(void 0), O = g(void 0), [k, A] = _(w), { version: j, triggersRef: M, contentsRef: N, registerTrigger: P, registerContent: F } = Zr(), I = u((e, t, n = !1) => {
|
|
3543
3744
|
if (!t) {
|
|
3544
3745
|
let t = E.current, n = M.current, r = n.findIndex((t) => t.value === e);
|
|
3545
3746
|
if (t === e && r >= 0) {
|
|
@@ -3555,7 +3756,7 @@ var kr = (e) => [...e].sort((e, t) => {
|
|
|
3555
3756
|
A,
|
|
3556
3757
|
T,
|
|
3557
3758
|
M
|
|
3558
|
-
]), { onKeyDown:
|
|
3759
|
+
]), { onKeyDown: L } = Qr({
|
|
3559
3760
|
focusedValue: k,
|
|
3560
3761
|
setValue: T,
|
|
3561
3762
|
setFocusedValue: A,
|
|
@@ -3564,7 +3765,7 @@ var kr = (e) => [...e].sort((e, t) => {
|
|
|
3564
3765
|
activationMode: o,
|
|
3565
3766
|
dir: s,
|
|
3566
3767
|
loop: c
|
|
3567
|
-
}),
|
|
3768
|
+
}), R = {
|
|
3568
3769
|
value: w,
|
|
3569
3770
|
focusedValue: k,
|
|
3570
3771
|
collectionVersion: j,
|
|
@@ -3580,9 +3781,9 @@ var kr = (e) => [...e].sort((e, t) => {
|
|
|
3580
3781
|
keepMounted: h,
|
|
3581
3782
|
lazyMount: v,
|
|
3582
3783
|
disabled: y,
|
|
3583
|
-
registerTrigger:
|
|
3784
|
+
registerTrigger: I,
|
|
3584
3785
|
registerContent: F,
|
|
3585
|
-
onTriggerKeyDown:
|
|
3786
|
+
onTriggerKeyDown: L,
|
|
3586
3787
|
getTriggerId: u((e) => `${S}-trigger-${e}`, [S]),
|
|
3587
3788
|
getContentId: u((e) => `${S}-content-${e}`, [S])
|
|
3588
3789
|
};
|
|
@@ -3616,11 +3817,11 @@ var kr = (e) => [...e].sort((e, t) => {
|
|
|
3616
3817
|
N,
|
|
3617
3818
|
M,
|
|
3618
3819
|
j
|
|
3619
|
-
]), /* @__PURE__ */ n(
|
|
3620
|
-
value:
|
|
3820
|
+
]), /* @__PURE__ */ n(Br.Provider, {
|
|
3821
|
+
value: R,
|
|
3621
3822
|
children: /* @__PURE__ */ n("div", {
|
|
3622
3823
|
...x,
|
|
3623
|
-
className:
|
|
3824
|
+
className: V($r.tabs, a === "vertical" && $r.vertical, b),
|
|
3624
3825
|
"data-orientation": a,
|
|
3625
3826
|
dir: s,
|
|
3626
3827
|
"data-variant": l,
|
|
@@ -3631,8 +3832,8 @@ var kr = (e) => [...e].sort((e, t) => {
|
|
|
3631
3832
|
})
|
|
3632
3833
|
});
|
|
3633
3834
|
};
|
|
3634
|
-
|
|
3635
|
-
var
|
|
3835
|
+
ei.displayName = "Tabs";
|
|
3836
|
+
var ti = {
|
|
3636
3837
|
trigger: "_trigger_uc2y5_1",
|
|
3637
3838
|
iconOnly: "_iconOnly_uc2y5_49",
|
|
3638
3839
|
icon: "_icon_uc2y5_49",
|
|
@@ -3647,23 +3848,23 @@ var Pr = {
|
|
|
3647
3848
|
line: "_line_uc2y5_194",
|
|
3648
3849
|
pills: "_pills_uc2y5_209",
|
|
3649
3850
|
vertical: "_vertical_uc2y5_235"
|
|
3650
|
-
},
|
|
3651
|
-
className:
|
|
3851
|
+
}, ni = ({ children: e, className: t }) => /* @__PURE__ */ n("span", {
|
|
3852
|
+
className: V(ti.badge, t),
|
|
3652
3853
|
children: e
|
|
3653
3854
|
});
|
|
3654
|
-
|
|
3855
|
+
ni.displayName = "Tabs.Badge";
|
|
3655
3856
|
//#endregion
|
|
3656
3857
|
//#region src/components/Tabs/Trigger/TabsIcon.tsx
|
|
3657
|
-
var
|
|
3658
|
-
className:
|
|
3858
|
+
var ri = ({ children: e, className: t }) => /* @__PURE__ */ n("span", {
|
|
3859
|
+
className: V(ti.icon, t),
|
|
3659
3860
|
"aria-hidden": "true",
|
|
3660
3861
|
children: e
|
|
3661
3862
|
});
|
|
3662
|
-
|
|
3863
|
+
ri.displayName = "Tabs.Icon";
|
|
3663
3864
|
//#endregion
|
|
3664
3865
|
//#region src/components/Tabs/Trigger/TabsTrigger.tsx
|
|
3665
|
-
var
|
|
3666
|
-
let { value: g, focusedValue: _, setValue: v, setFocusedValue: y, orientation: b, variant: x, size: S, disabled: C, registerTrigger: w, onTriggerKeyDown: T, getTriggerId: E, getContentId: D } =
|
|
3866
|
+
var ii = c(({ value: e, children: t, className: a, disabled: o = !1, icon: s, badge: c, description: d, onClick: f, onKeyDown: p, ...m }, h) => {
|
|
3867
|
+
let { value: g, focusedValue: _, setValue: v, setFocusedValue: y, orientation: b, variant: x, size: S, disabled: C, registerTrigger: w, onTriggerKeyDown: T, getTriggerId: E, getContentId: D } = Vr(), O = C || o, k = g === e, A = _ === e || !_ && k, j = i.toArray(t), M = j.some((e) => l(e) && e.type.displayName === "Tabs.Icon"), N = !!s, P = (N || M) && t == null;
|
|
3667
3868
|
process.env.NODE_ENV !== "production" && N && M && console.warn(`Tabs.Trigger value "${e}" received both icon and Tabs.Icon. Tabs.Icon takes precedence.`);
|
|
3668
3869
|
let F = u((t) => {
|
|
3669
3870
|
w(e, t, O), typeof h == "function" ? h(t) : h && (h.current = t);
|
|
@@ -3672,7 +3873,7 @@ var Lr = c(({ value: e, children: t, className: a, disabled: o = !1, icon: s, ba
|
|
|
3672
3873
|
h,
|
|
3673
3874
|
w,
|
|
3674
3875
|
e
|
|
3675
|
-
]),
|
|
3876
|
+
]), I = N && !M || c || d, L = j.every((e) => typeof e == "string" || typeof e == "number");
|
|
3676
3877
|
return /* @__PURE__ */ r("button", {
|
|
3677
3878
|
...m,
|
|
3678
3879
|
ref: F,
|
|
@@ -3686,7 +3887,7 @@ var Lr = c(({ value: e, children: t, className: a, disabled: o = !1, icon: s, ba
|
|
|
3686
3887
|
"data-state": k ? "active" : "inactive",
|
|
3687
3888
|
"data-orientation": b,
|
|
3688
3889
|
"data-disabled": O ? "" : void 0,
|
|
3689
|
-
className:
|
|
3890
|
+
className: V(ti.trigger, ti[x], ti[S], b === "vertical" && ti.vertical, N && ti.withIcon, P && ti.iconOnly, a),
|
|
3690
3891
|
onClick: (t) => {
|
|
3691
3892
|
f?.(t), !(t.defaultPrevented || O) && (y(e), v(e));
|
|
3692
3893
|
},
|
|
@@ -3695,50 +3896,50 @@ var Lr = c(({ value: e, children: t, className: a, disabled: o = !1, icon: s, ba
|
|
|
3695
3896
|
},
|
|
3696
3897
|
children: [
|
|
3697
3898
|
N && !M && /* @__PURE__ */ n("span", {
|
|
3698
|
-
className:
|
|
3899
|
+
className: ti.icon,
|
|
3699
3900
|
"aria-hidden": "true",
|
|
3700
3901
|
children: s
|
|
3701
3902
|
}),
|
|
3702
|
-
t != null && (
|
|
3703
|
-
className:
|
|
3903
|
+
t != null && (I ? /* @__PURE__ */ r("span", {
|
|
3904
|
+
className: ti.body,
|
|
3704
3905
|
children: [/* @__PURE__ */ n("span", {
|
|
3705
|
-
className:
|
|
3906
|
+
className: ti.label,
|
|
3706
3907
|
children: t
|
|
3707
3908
|
}), d != null && /* @__PURE__ */ n("span", {
|
|
3708
|
-
className:
|
|
3909
|
+
className: ti.description,
|
|
3709
3910
|
children: d
|
|
3710
3911
|
})]
|
|
3711
|
-
}) :
|
|
3712
|
-
className:
|
|
3912
|
+
}) : L ? /* @__PURE__ */ n("span", {
|
|
3913
|
+
className: ti.label,
|
|
3713
3914
|
children: t
|
|
3714
3915
|
}) : t),
|
|
3715
3916
|
c != null && /* @__PURE__ */ n("span", {
|
|
3716
|
-
className:
|
|
3917
|
+
className: ti.badge,
|
|
3717
3918
|
children: c
|
|
3718
3919
|
})
|
|
3719
3920
|
]
|
|
3720
3921
|
});
|
|
3721
3922
|
});
|
|
3722
|
-
|
|
3923
|
+
ii.displayName = "Tabs.Trigger";
|
|
3723
3924
|
//#endregion
|
|
3724
3925
|
//#region src/components/Tabs/Tabs.tsx
|
|
3725
|
-
var
|
|
3726
|
-
List:
|
|
3727
|
-
Trigger:
|
|
3728
|
-
Content:
|
|
3729
|
-
Indicator:
|
|
3730
|
-
Icon:
|
|
3731
|
-
Badge:
|
|
3926
|
+
var ai = Object.assign(ei, {
|
|
3927
|
+
List: Yr,
|
|
3928
|
+
Trigger: ii,
|
|
3929
|
+
Content: Ur,
|
|
3930
|
+
Indicator: Jr,
|
|
3931
|
+
Icon: ri,
|
|
3932
|
+
Badge: ni
|
|
3732
3933
|
});
|
|
3733
|
-
|
|
3934
|
+
ai.displayName = "Tabs";
|
|
3734
3935
|
//#endregion
|
|
3735
3936
|
//#region src/components/Tooltip/internal/composeEventHandlers.ts
|
|
3736
|
-
function
|
|
3937
|
+
function oi(e, t) {
|
|
3737
3938
|
return (n) => {
|
|
3738
3939
|
e?.(n), n.defaultPrevented || t?.(n);
|
|
3739
3940
|
};
|
|
3740
3941
|
}
|
|
3741
|
-
function
|
|
3942
|
+
function si(...e) {
|
|
3742
3943
|
return (t) => {
|
|
3743
3944
|
e.forEach((e) => {
|
|
3744
3945
|
if (e) {
|
|
@@ -3753,18 +3954,18 @@ function Br(...e) {
|
|
|
3753
3954
|
}
|
|
3754
3955
|
//#endregion
|
|
3755
3956
|
//#region src/components/Tooltip/internal/TooltipContext.tsx
|
|
3756
|
-
var
|
|
3957
|
+
var ci = s(null), li = s({
|
|
3757
3958
|
delay: {
|
|
3758
3959
|
open: 300,
|
|
3759
3960
|
close: 100
|
|
3760
3961
|
},
|
|
3761
3962
|
skipDelay: 300
|
|
3762
|
-
}),
|
|
3963
|
+
}), ui = ci.Provider, di = ({ children: e, delay: t = 700, skipDelay: r = 300 }) => {
|
|
3763
3964
|
let i = typeof t == "number" ? {
|
|
3764
3965
|
open: t,
|
|
3765
3966
|
close: 100
|
|
3766
3967
|
} : t;
|
|
3767
|
-
return /* @__PURE__ */ n(
|
|
3968
|
+
return /* @__PURE__ */ n(li.Provider, {
|
|
3768
3969
|
value: {
|
|
3769
3970
|
delay: i,
|
|
3770
3971
|
skipDelay: r
|
|
@@ -3772,39 +3973,39 @@ var Vr = s(null), Hr = s({
|
|
|
3772
3973
|
children: e
|
|
3773
3974
|
});
|
|
3774
3975
|
};
|
|
3775
|
-
function
|
|
3776
|
-
let e = d(
|
|
3976
|
+
function fi() {
|
|
3977
|
+
let e = d(ci);
|
|
3777
3978
|
if (!e) throw Error("Tooltip compound components must be rendered inside Tooltip");
|
|
3778
3979
|
return e;
|
|
3779
3980
|
}
|
|
3780
|
-
function
|
|
3781
|
-
return d(
|
|
3981
|
+
function pi() {
|
|
3982
|
+
return d(li);
|
|
3782
3983
|
}
|
|
3783
|
-
var
|
|
3984
|
+
var mi = {
|
|
3784
3985
|
tooltip: "_tooltip_raj0t_1",
|
|
3785
3986
|
arrow: "_arrow_raj0t_25"
|
|
3786
|
-
},
|
|
3787
|
-
let l =
|
|
3987
|
+
}, hi = c(({ children: e, forceMount: t = !1, withArrow: i = !1, className: a, style: o, ...s }, c) => {
|
|
3988
|
+
let l = fi();
|
|
3788
3989
|
return !t && !l.open ? null : /* @__PURE__ */ r("div", {
|
|
3789
3990
|
...l.getContentProps({
|
|
3790
3991
|
id: l.contentId,
|
|
3791
3992
|
role: "tooltip",
|
|
3792
3993
|
...s
|
|
3793
3994
|
}),
|
|
3794
|
-
ref:
|
|
3795
|
-
className:
|
|
3995
|
+
ref: si(c, l.setContentRef),
|
|
3996
|
+
className: V(mi.tooltip, a),
|
|
3796
3997
|
"data-placement": l.placement,
|
|
3797
3998
|
"data-state": l.open ? "open" : "closed",
|
|
3798
3999
|
style: {
|
|
3799
4000
|
...l.floatingStyles,
|
|
3800
4001
|
...o
|
|
3801
4002
|
},
|
|
3802
|
-
children: [e, i && /* @__PURE__ */ n(
|
|
4003
|
+
children: [e, i && /* @__PURE__ */ n(gi, {})]
|
|
3803
4004
|
});
|
|
3804
4005
|
});
|
|
3805
|
-
|
|
3806
|
-
function
|
|
3807
|
-
let e =
|
|
4006
|
+
hi.displayName = "Tooltip.Content";
|
|
4007
|
+
function gi() {
|
|
4008
|
+
let e = fi(), t = {
|
|
3808
4009
|
top: "bottom",
|
|
3809
4010
|
right: "left",
|
|
3810
4011
|
bottom: "top",
|
|
@@ -3812,7 +4013,7 @@ function Yr() {
|
|
|
3812
4013
|
}[e.placement.split("-")[0]];
|
|
3813
4014
|
return /* @__PURE__ */ n("div", {
|
|
3814
4015
|
ref: e.arrowRef,
|
|
3815
|
-
className:
|
|
4016
|
+
className: mi.arrow,
|
|
3816
4017
|
style: {
|
|
3817
4018
|
left: e.arrowX == null ? void 0 : `${e.arrowX}px`,
|
|
3818
4019
|
top: e.arrowY == null ? void 0 : `${e.arrowY}px`,
|
|
@@ -3822,8 +4023,8 @@ function Yr() {
|
|
|
3822
4023
|
}
|
|
3823
4024
|
//#endregion
|
|
3824
4025
|
//#region src/components/Tooltip/internal/useTooltipDelay.ts
|
|
3825
|
-
function
|
|
3826
|
-
let n =
|
|
4026
|
+
function _i(e, t) {
|
|
4027
|
+
let n = pi();
|
|
3827
4028
|
return e == null ? n.delay : typeof e == "number" ? {
|
|
3828
4029
|
open: e,
|
|
3829
4030
|
close: n.delay.close
|
|
@@ -3834,25 +4035,25 @@ function Xr(e, t) {
|
|
|
3834
4035
|
}
|
|
3835
4036
|
//#endregion
|
|
3836
4037
|
//#region src/components/Tooltip/internal/useTooltipInteractions.ts
|
|
3837
|
-
function
|
|
3838
|
-
return
|
|
4038
|
+
function vi({ context: e, delay: t, disabled: n, interactive: r }) {
|
|
4039
|
+
return A([k(e, {
|
|
3839
4040
|
delay: t,
|
|
3840
4041
|
enabled: !n,
|
|
3841
4042
|
move: !1,
|
|
3842
4043
|
handleClose: r ? void 0 : null
|
|
3843
|
-
}),
|
|
4044
|
+
}), O(e, { enabled: !n })]);
|
|
3844
4045
|
}
|
|
3845
4046
|
//#endregion
|
|
3846
4047
|
//#region src/components/Tooltip/internal/useTooltipPosition.ts
|
|
3847
|
-
function
|
|
3848
|
-
let o = g(null), s =
|
|
4048
|
+
function yi({ open: e, onOpenChange: t, placement: n, offset: r, avoidCollisions: i, matchTriggerWidth: a }) {
|
|
4049
|
+
let o = g(null), s = Ae({
|
|
3849
4050
|
open: e,
|
|
3850
4051
|
onOpenChange: t,
|
|
3851
4052
|
placement: n,
|
|
3852
4053
|
offset: r,
|
|
3853
4054
|
avoidCollisions: i,
|
|
3854
4055
|
matchTriggerWidth: a,
|
|
3855
|
-
middleware: [
|
|
4056
|
+
middleware: [x({ element: o })]
|
|
3856
4057
|
});
|
|
3857
4058
|
return {
|
|
3858
4059
|
...s,
|
|
@@ -3863,38 +4064,36 @@ function Qr({ open: e, onOpenChange: t, placement: n, offset: r, avoidCollisions
|
|
|
3863
4064
|
}
|
|
3864
4065
|
//#endregion
|
|
3865
4066
|
//#region src/components/Tooltip/Root/TooltipRoot.tsx
|
|
3866
|
-
var
|
|
3867
|
-
let h = `${p()}-content`, _ = g(null), v = g(null), [y, b] =
|
|
4067
|
+
var bi = ({ children: e, open: t, defaultOpen: r = !1, onOpenChange: i, placement: a = "top", offset: o = 8, delay: s, skipDelay: c, disabled: l = !1, interactive: u = !1, avoidCollisions: d = !0, matchTriggerWidth: f = !1, modal: m = !1 }) => {
|
|
4068
|
+
let h = `${p()}-content`, _ = g(null), v = g(null), [y, b] = J({
|
|
3868
4069
|
value: t,
|
|
3869
4070
|
defaultValue: r,
|
|
3870
4071
|
onChange: i
|
|
3871
4072
|
}), x = (e) => {
|
|
3872
4073
|
l || b(e);
|
|
3873
|
-
}, S =
|
|
4074
|
+
}, S = yi({
|
|
3874
4075
|
open: y,
|
|
3875
4076
|
onOpenChange: x,
|
|
3876
4077
|
placement: a,
|
|
3877
4078
|
offset: o,
|
|
3878
4079
|
avoidCollisions: d,
|
|
3879
4080
|
matchTriggerWidth: f
|
|
3880
|
-
}), C =
|
|
4081
|
+
}), C = _i(s, c), w = vi({
|
|
3881
4082
|
context: S.context,
|
|
3882
4083
|
delay: C,
|
|
3883
4084
|
disabled: l,
|
|
3884
4085
|
interactive: u
|
|
3885
|
-
}),
|
|
3886
|
-
active: y,
|
|
3887
|
-
id: h
|
|
3888
|
-
});
|
|
3889
|
-
return oe({
|
|
4086
|
+
}), T = ke({
|
|
3890
4087
|
active: y,
|
|
4088
|
+
id: h,
|
|
4089
|
+
zIndexLevel: "tooltip",
|
|
3891
4090
|
contentRef: _,
|
|
3892
4091
|
ignoreRefs: [v],
|
|
3893
4092
|
closeOnEscape: !0,
|
|
3894
4093
|
closeOnOutsidePress: !u,
|
|
3895
|
-
isTopOverlay: T,
|
|
3896
4094
|
requestClose: () => x(!1)
|
|
3897
|
-
})
|
|
4095
|
+
});
|
|
4096
|
+
return /* @__PURE__ */ n(ui, {
|
|
3898
4097
|
value: {
|
|
3899
4098
|
contentId: h,
|
|
3900
4099
|
open: y,
|
|
@@ -3905,36 +4104,39 @@ var $r = ({ children: e, open: t, defaultOpen: r = !1, onOpenChange: i, placemen
|
|
|
3905
4104
|
arrowX: S.arrowX,
|
|
3906
4105
|
arrowY: S.arrowY,
|
|
3907
4106
|
placement: S.placement,
|
|
3908
|
-
floatingStyles:
|
|
4107
|
+
floatingStyles: {
|
|
4108
|
+
...S.floatingStyles,
|
|
4109
|
+
zIndex: T.zIndex
|
|
4110
|
+
},
|
|
3909
4111
|
setOpen: x,
|
|
3910
|
-
setTriggerRef:
|
|
3911
|
-
setContentRef:
|
|
4112
|
+
setTriggerRef: si(v, S.setRef),
|
|
4113
|
+
setContentRef: si(_, S.setFloatingRef),
|
|
3912
4114
|
getTriggerProps: w.getReferenceProps,
|
|
3913
4115
|
getContentProps: w.getFloatingProps
|
|
3914
4116
|
},
|
|
3915
4117
|
children: e
|
|
3916
4118
|
});
|
|
3917
4119
|
};
|
|
3918
|
-
|
|
4120
|
+
bi.displayName = "Tooltip.Root";
|
|
3919
4121
|
//#endregion
|
|
3920
4122
|
//#region src/components/Tooltip/Trigger/TooltipTrigger.tsx
|
|
3921
|
-
var
|
|
3922
|
-
let s =
|
|
4123
|
+
var xi = ({ asChild: e = !1, children: t, disabled: r = !1, className: i, ...a }) => {
|
|
4124
|
+
let s = fi(), c = e && l(t) ? t : void 0, u = s.disabled || r || c?.props.disabled, d = s.getTriggerProps({
|
|
3923
4125
|
...a,
|
|
3924
4126
|
"aria-describedby": s.open ? s.contentId : void 0,
|
|
3925
4127
|
"aria-disabled": u || void 0,
|
|
3926
4128
|
"data-state": s.open ? "open" : "closed"
|
|
3927
4129
|
}), f = {
|
|
3928
4130
|
...d,
|
|
3929
|
-
ref: c ?
|
|
3930
|
-
className:
|
|
4131
|
+
ref: c ? si(c.props.ref, s.setTriggerRef) : s.setTriggerRef,
|
|
4132
|
+
className: V(c?.props.className, i),
|
|
3931
4133
|
disabled: u || void 0,
|
|
3932
|
-
onMouseEnter:
|
|
3933
|
-
onMouseLeave:
|
|
3934
|
-
onPointerEnter:
|
|
3935
|
-
onPointerLeave:
|
|
3936
|
-
onFocus:
|
|
3937
|
-
onBlur:
|
|
4134
|
+
onMouseEnter: oi(c?.props.onMouseEnter, d.onMouseEnter),
|
|
4135
|
+
onMouseLeave: oi(c?.props.onMouseLeave, d.onMouseLeave),
|
|
4136
|
+
onPointerEnter: oi(c?.props.onPointerEnter, d.onPointerEnter),
|
|
4137
|
+
onPointerLeave: oi(c?.props.onPointerLeave, d.onPointerLeave),
|
|
4138
|
+
onFocus: oi(c?.props.onFocus, d.onFocus),
|
|
4139
|
+
onBlur: oi(c?.props.onBlur, d.onBlur)
|
|
3938
4140
|
};
|
|
3939
4141
|
return c ? o(c, f) : /* @__PURE__ */ n("button", {
|
|
3940
4142
|
type: "button",
|
|
@@ -3942,20 +4144,20 @@ var ei = ({ asChild: e = !1, children: t, disabled: r = !1, className: i, ...a }
|
|
|
3942
4144
|
children: t
|
|
3943
4145
|
});
|
|
3944
4146
|
};
|
|
3945
|
-
|
|
4147
|
+
xi.displayName = "Tooltip.Trigger";
|
|
3946
4148
|
//#endregion
|
|
3947
4149
|
//#region src/components/Tooltip/Tooltip.tsx
|
|
3948
|
-
var
|
|
3949
|
-
Trigger:
|
|
3950
|
-
Content:
|
|
3951
|
-
Provider:
|
|
4150
|
+
var Si = Object.assign(bi, {
|
|
4151
|
+
Trigger: xi,
|
|
4152
|
+
Content: hi,
|
|
4153
|
+
Provider: di
|
|
3952
4154
|
});
|
|
3953
|
-
|
|
4155
|
+
Si.displayName = "Tooltip";
|
|
3954
4156
|
//#endregion
|
|
3955
4157
|
//#region src/utils/devWarning.ts
|
|
3956
|
-
var
|
|
4158
|
+
var Ci = (e, t) => {
|
|
3957
4159
|
process.env.NODE_ENV !== "production" && !e && console.warn(t);
|
|
3958
|
-
},
|
|
4160
|
+
}, wi = {
|
|
3959
4161
|
button: "_button_1xn9g_1",
|
|
3960
4162
|
solid: "_solid_1xn9g_23",
|
|
3961
4163
|
primary: "_primary_1xn9g_23",
|
|
@@ -3983,84 +4185,84 @@ var ni = (e, t) => {
|
|
|
3983
4185
|
"button-spin": "_button-spin_1xn9g_1",
|
|
3984
4186
|
badge: "_badge_1xn9g_812",
|
|
3985
4187
|
shortcut: "_shortcut_1xn9g_826"
|
|
3986
|
-
},
|
|
3987
|
-
let
|
|
3988
|
-
[
|
|
3989
|
-
[
|
|
3990
|
-
[
|
|
3991
|
-
[
|
|
4188
|
+
}, Ti = c(({ children: e, color: i = "primary", appearance: a = "solid", size: s = "md", shape: c = "pill", type: u = "button", disabled: d = !1, loading: f = !1, loadingText: p, iconStart: m, iconEnd: h, spinner: g, badge: _, shortcut: v, tooltip: y, fullWidth: b = !1, iconOnly: x = !1, asChild: S = !1, className: C, onClick: w, "aria-label": T, "aria-labelledby": E, href: D, target: O, rel: k, download: A, id: j, role: M, tabIndex: N, ...P }, F) => {
|
|
4189
|
+
let I = S && l(e) ? e : void 0, L = I ? I.props.children : e, R = x || !L && !!(m || h), z = !!(T || E || I?.props["aria-label"] || I?.props["aria-labelledby"]), B = d || f, ee = f && p ? p : L, te = p && L && !R && (typeof L == "string" || typeof L == "number") && (typeof p == "string" || typeof p == "number") ? String(f ? L : p) : void 0, H = O === "_blank" && !k ? "noreferrer noopener" : k, U = V(wi.button, wi[i], wi[a], wi[s], wi[c], C, {
|
|
4190
|
+
[wi.disabled]: B,
|
|
4191
|
+
[wi.loading]: f,
|
|
4192
|
+
[wi.fullWidth]: b,
|
|
4193
|
+
[wi.iconOnly]: R
|
|
3992
4194
|
});
|
|
3993
|
-
|
|
4195
|
+
Ci(!S || !D, "Button: pass href to the child element when using asChild."), Ci(!S || !!I, "Button: asChild requires a single valid React element child."), Ci(!R || z, "Button: icon-only buttons must provide aria-label or aria-labelledby.");
|
|
3994
4196
|
let ne = (e) => {
|
|
3995
4197
|
e.preventDefault(), e.stopPropagation();
|
|
3996
4198
|
}, re = (e) => {
|
|
3997
|
-
if (
|
|
4199
|
+
if (B) {
|
|
3998
4200
|
ne(e);
|
|
3999
4201
|
return;
|
|
4000
4202
|
}
|
|
4001
|
-
|
|
4203
|
+
I?.props.onClick?.(e), e.defaultPrevented || w?.(e);
|
|
4002
4204
|
}, W = /* @__PURE__ */ r(t, { children: [
|
|
4003
4205
|
f && (g ? /* @__PURE__ */ n("span", {
|
|
4004
|
-
className:
|
|
4206
|
+
className: wi.icon,
|
|
4005
4207
|
"aria-hidden": "true",
|
|
4006
4208
|
children: g
|
|
4007
4209
|
}) : /* @__PURE__ */ n("span", {
|
|
4008
|
-
className:
|
|
4210
|
+
className: wi.spinner,
|
|
4009
4211
|
"aria-hidden": "true"
|
|
4010
4212
|
})),
|
|
4011
4213
|
!f && m && /* @__PURE__ */ n("span", {
|
|
4012
|
-
className:
|
|
4214
|
+
className: wi.icon,
|
|
4013
4215
|
children: m
|
|
4014
4216
|
}),
|
|
4015
|
-
ee && !
|
|
4016
|
-
className:
|
|
4017
|
-
"data-measure":
|
|
4217
|
+
ee && !R && /* @__PURE__ */ n("span", {
|
|
4218
|
+
className: wi.label,
|
|
4219
|
+
"data-measure": te,
|
|
4018
4220
|
children: /* @__PURE__ */ n("span", {
|
|
4019
|
-
className:
|
|
4221
|
+
className: wi.labelText,
|
|
4020
4222
|
children: ee
|
|
4021
4223
|
})
|
|
4022
4224
|
}),
|
|
4023
|
-
_ && !
|
|
4024
|
-
className:
|
|
4225
|
+
_ && !R && /* @__PURE__ */ n("span", {
|
|
4226
|
+
className: wi.badge,
|
|
4025
4227
|
children: _
|
|
4026
4228
|
}),
|
|
4027
|
-
v && !
|
|
4028
|
-
className:
|
|
4229
|
+
v && !R && /* @__PURE__ */ n("span", {
|
|
4230
|
+
className: wi.shortcut,
|
|
4029
4231
|
children: v
|
|
4030
4232
|
}),
|
|
4031
4233
|
!f && h && /* @__PURE__ */ n("span", {
|
|
4032
|
-
className:
|
|
4234
|
+
className: wi.icon,
|
|
4033
4235
|
children: h
|
|
4034
4236
|
})
|
|
4035
4237
|
] });
|
|
4036
|
-
return
|
|
4238
|
+
return I ? o(I, {
|
|
4037
4239
|
...P,
|
|
4038
4240
|
ref: F,
|
|
4039
4241
|
"aria-busy": f || void 0,
|
|
4040
|
-
"aria-disabled":
|
|
4041
|
-
"aria-label": T ||
|
|
4042
|
-
"aria-labelledby": E ||
|
|
4043
|
-
className: I
|
|
4044
|
-
href:
|
|
4242
|
+
"aria-disabled": B || void 0,
|
|
4243
|
+
"aria-label": T || I.props["aria-label"] || void 0,
|
|
4244
|
+
"aria-labelledby": E || I.props["aria-labelledby"] || void 0,
|
|
4245
|
+
className: V(I.props.className, U),
|
|
4246
|
+
href: B ? void 0 : I.props.href,
|
|
4045
4247
|
onClick: re,
|
|
4046
|
-
tabIndex:
|
|
4047
|
-
title: y ||
|
|
4248
|
+
tabIndex: B ? -1 : I.props.tabIndex,
|
|
4249
|
+
title: y || I.props.title,
|
|
4048
4250
|
children: W
|
|
4049
4251
|
}) : D ? /* @__PURE__ */ n("a", {
|
|
4050
4252
|
ref: F,
|
|
4051
|
-
href:
|
|
4253
|
+
href: B ? void 0 : D,
|
|
4052
4254
|
id: j,
|
|
4053
4255
|
role: M,
|
|
4054
|
-
tabIndex:
|
|
4256
|
+
tabIndex: B ? -1 : N,
|
|
4055
4257
|
target: O,
|
|
4056
|
-
rel:
|
|
4258
|
+
rel: H,
|
|
4057
4259
|
download: A,
|
|
4058
|
-
onClick:
|
|
4059
|
-
"aria-disabled":
|
|
4260
|
+
onClick: B ? ne : w,
|
|
4261
|
+
"aria-disabled": B || void 0,
|
|
4060
4262
|
"aria-label": T || void 0,
|
|
4061
4263
|
"aria-labelledby": E || void 0,
|
|
4062
4264
|
"aria-busy": f || void 0,
|
|
4063
|
-
className:
|
|
4265
|
+
className: U,
|
|
4064
4266
|
title: y,
|
|
4065
4267
|
children: W
|
|
4066
4268
|
}) : /* @__PURE__ */ n("button", {
|
|
@@ -4070,17 +4272,17 @@ var ni = (e, t) => {
|
|
|
4070
4272
|
role: M,
|
|
4071
4273
|
tabIndex: N,
|
|
4072
4274
|
type: u,
|
|
4073
|
-
disabled:
|
|
4074
|
-
onClick:
|
|
4275
|
+
disabled: B,
|
|
4276
|
+
onClick: B ? void 0 : w,
|
|
4075
4277
|
"aria-label": T || void 0,
|
|
4076
4278
|
"aria-labelledby": E || void 0,
|
|
4077
4279
|
"aria-busy": f || void 0,
|
|
4078
|
-
className:
|
|
4280
|
+
className: U,
|
|
4079
4281
|
title: y,
|
|
4080
4282
|
children: W
|
|
4081
4283
|
});
|
|
4082
4284
|
});
|
|
4083
|
-
|
|
4285
|
+
Ti.displayName = "Button";
|
|
4084
4286
|
var Q = {
|
|
4085
4287
|
wrapper: "_wrapper_11rc7_1",
|
|
4086
4288
|
colorPrimary: "_colorPrimary_11rc7_35",
|
|
@@ -4116,82 +4318,82 @@ var Q = {
|
|
|
4116
4318
|
"checkbox-checkmark-in": "_checkbox-checkmark-in_11rc7_1",
|
|
4117
4319
|
"checkbox-indeterminate-in": "_checkbox-indeterminate-in_11rc7_1",
|
|
4118
4320
|
disabled: "_disabled_11rc7_369"
|
|
4119
|
-
},
|
|
4321
|
+
}, Ei = {
|
|
4120
4322
|
sm: Q.labelSm,
|
|
4121
4323
|
md: Q.labelMd,
|
|
4122
4324
|
lg: Q.labelLg
|
|
4123
|
-
},
|
|
4325
|
+
}, Di = {
|
|
4124
4326
|
sm: Q.wrapperSm,
|
|
4125
4327
|
md: Q.wrapperMd,
|
|
4126
4328
|
lg: Q.wrapperLg
|
|
4127
|
-
},
|
|
4329
|
+
}, Oi = {
|
|
4128
4330
|
sm: Q.containerSm,
|
|
4129
4331
|
md: Q.containerMd,
|
|
4130
4332
|
lg: Q.containerLg
|
|
4131
|
-
},
|
|
4333
|
+
}, ki = {
|
|
4132
4334
|
primary: Q.colorPrimary,
|
|
4133
4335
|
neutral: Q.colorNeutral,
|
|
4134
4336
|
success: Q.colorSuccess,
|
|
4135
4337
|
warning: Q.colorWarning,
|
|
4136
4338
|
danger: Q.colorDanger
|
|
4137
|
-
},
|
|
4138
|
-
let
|
|
4139
|
-
|
|
4140
|
-
|
|
4141
|
-
|
|
4142
|
-
].filter(Boolean).join(" "), [
|
|
4339
|
+
}, Ai = c(({ id: e, label: t, description: i, icon: a, indeterminateIcon: o, checked: s, size: c = "md", color: l = "primary", labelPosition: d = "end", defaultChecked: m = !1, disabled: h = !1, required: _ = !1, indeterminate: v = !1, className: y, wrapperClassName: b, onCheckedChange: x, error: S, "aria-label": C, "aria-labelledby": w, "aria-describedby": T, ...E }, D) => {
|
|
4340
|
+
let O = p(), k = e ?? O, A = g(null), j = !!S, M = i ? `${k}-description` : void 0, N = j ? `${k}-error` : void 0, P = [
|
|
4341
|
+
T,
|
|
4342
|
+
M,
|
|
4343
|
+
N
|
|
4344
|
+
].filter(Boolean).join(" "), [F, I] = J({
|
|
4143
4345
|
value: s,
|
|
4144
4346
|
defaultValue: m,
|
|
4145
|
-
onChange:
|
|
4146
|
-
}),
|
|
4147
|
-
if (
|
|
4148
|
-
|
|
4347
|
+
onChange: x
|
|
4348
|
+
}), R = u((e) => {
|
|
4349
|
+
if (A.current = e, typeof D == "function") {
|
|
4350
|
+
D(e);
|
|
4149
4351
|
return;
|
|
4150
4352
|
}
|
|
4151
|
-
|
|
4152
|
-
}, [
|
|
4353
|
+
D && (D.current = e);
|
|
4354
|
+
}, [D]);
|
|
4153
4355
|
f(() => {
|
|
4154
|
-
|
|
4356
|
+
A.current && (A.current.indeterminate = v);
|
|
4155
4357
|
}, [v]);
|
|
4156
|
-
let
|
|
4157
|
-
|
|
4358
|
+
let z = (e) => {
|
|
4359
|
+
I(e.target.checked);
|
|
4158
4360
|
};
|
|
4159
|
-
return
|
|
4160
|
-
className:
|
|
4361
|
+
return Ci(!!(t || C || w), "Checkbox: an accessible label must be provided through label, aria-label, or aria-labelledby."), /* @__PURE__ */ r("div", {
|
|
4362
|
+
className: V(Q.container, Oi[c], d === "start" && Q.containerLabelStart, y),
|
|
4161
4363
|
children: [
|
|
4162
4364
|
/* @__PURE__ */ r("label", {
|
|
4163
|
-
htmlFor:
|
|
4164
|
-
className:
|
|
4365
|
+
htmlFor: k,
|
|
4366
|
+
className: V(Q.wrapper, Di[c], ki[l], d === "start" && Q.labelStart, !t && Q.iconOnly, h && Q.disabled, b),
|
|
4165
4367
|
children: [
|
|
4166
4368
|
/* @__PURE__ */ n("input", {
|
|
4167
|
-
...
|
|
4168
|
-
ref:
|
|
4169
|
-
id:
|
|
4369
|
+
...E,
|
|
4370
|
+
ref: R,
|
|
4371
|
+
id: k,
|
|
4170
4372
|
type: "checkbox",
|
|
4171
|
-
checked:
|
|
4373
|
+
checked: F,
|
|
4172
4374
|
disabled: h,
|
|
4173
4375
|
required: _,
|
|
4174
|
-
onChange:
|
|
4376
|
+
onChange: z,
|
|
4175
4377
|
className: Q.input,
|
|
4176
|
-
"aria-label":
|
|
4177
|
-
"aria-labelledby":
|
|
4178
|
-
"aria-checked": v ? "mixed" :
|
|
4179
|
-
"aria-invalid":
|
|
4180
|
-
"aria-describedby":
|
|
4378
|
+
"aria-label": C,
|
|
4379
|
+
"aria-labelledby": w,
|
|
4380
|
+
"aria-checked": v ? "mixed" : E["aria-checked"],
|
|
4381
|
+
"aria-invalid": j ? !0 : E["aria-invalid"],
|
|
4382
|
+
"aria-describedby": P || void 0
|
|
4181
4383
|
}),
|
|
4182
4384
|
/* @__PURE__ */ n("span", {
|
|
4183
|
-
className:
|
|
4385
|
+
className: V(Q.customCheckbox, j && Q.error, v && Q.indeterminate),
|
|
4184
4386
|
"aria-hidden": "true",
|
|
4185
4387
|
children: v ? /* @__PURE__ */ n("span", {
|
|
4186
|
-
className:
|
|
4388
|
+
className: V(Q.indeterminateMark, o && Q.customMark),
|
|
4187
4389
|
children: o
|
|
4188
|
-
}) :
|
|
4390
|
+
}) : F && /* @__PURE__ */ n("span", {
|
|
4189
4391
|
className: Q.checkmark,
|
|
4190
|
-
children: a ?? /* @__PURE__ */ n(
|
|
4392
|
+
children: a ?? /* @__PURE__ */ n(L, {})
|
|
4191
4393
|
})
|
|
4192
4394
|
}),
|
|
4193
4395
|
t && /* @__PURE__ */ r("span", {
|
|
4194
|
-
className:
|
|
4396
|
+
className: V(Q.label, Ei[c]),
|
|
4195
4397
|
children: [t, _ && /* @__PURE__ */ n("span", {
|
|
4196
4398
|
className: Q.requiredMark,
|
|
4197
4399
|
"aria-hidden": "true",
|
|
@@ -4201,19 +4403,19 @@ var Q = {
|
|
|
4201
4403
|
]
|
|
4202
4404
|
}),
|
|
4203
4405
|
i && /* @__PURE__ */ n("span", {
|
|
4204
|
-
id:
|
|
4406
|
+
id: M,
|
|
4205
4407
|
className: Q.descriptionText,
|
|
4206
4408
|
children: i
|
|
4207
4409
|
}),
|
|
4208
|
-
|
|
4209
|
-
id:
|
|
4410
|
+
j && /* @__PURE__ */ n("span", {
|
|
4411
|
+
id: N,
|
|
4210
4412
|
className: Q.errorText,
|
|
4211
|
-
children:
|
|
4413
|
+
children: S
|
|
4212
4414
|
})
|
|
4213
4415
|
]
|
|
4214
4416
|
});
|
|
4215
4417
|
});
|
|
4216
|
-
|
|
4418
|
+
Ai.displayName = "Checkbox";
|
|
4217
4419
|
var $ = {
|
|
4218
4420
|
inputGroup: "_inputGroup_1fjhk_1",
|
|
4219
4421
|
primary: "_primary_1fjhk_29",
|
|
@@ -4255,7 +4457,7 @@ var $ = {
|
|
|
4255
4457
|
toneDanger: "_toneDanger_1fjhk_876",
|
|
4256
4458
|
toneMuted: "_toneMuted_1fjhk_880",
|
|
4257
4459
|
toneInverse: "_toneInverse_1fjhk_884"
|
|
4258
|
-
},
|
|
4460
|
+
}, ji = {
|
|
4259
4461
|
default: $.toneDefault,
|
|
4260
4462
|
primary: $.tonePrimary,
|
|
4261
4463
|
secondary: $.toneSecondary,
|
|
@@ -4263,7 +4465,7 @@ var $ = {
|
|
|
4263
4465
|
danger: $.toneDanger,
|
|
4264
4466
|
muted: $.toneMuted,
|
|
4265
4467
|
inverse: $.toneInverse
|
|
4266
|
-
},
|
|
4468
|
+
}, Mi = (e = "text", t) => {
|
|
4267
4469
|
if (t) return t;
|
|
4268
4470
|
switch (e) {
|
|
4269
4471
|
case "email": return "email";
|
|
@@ -4273,7 +4475,7 @@ var $ = {
|
|
|
4273
4475
|
case "search": return "off";
|
|
4274
4476
|
default: return;
|
|
4275
4477
|
}
|
|
4276
|
-
},
|
|
4478
|
+
}, Ni = (e, t) => {
|
|
4277
4479
|
let n = e.replace(/\D/g, ""), r = 0, i = "";
|
|
4278
4480
|
for (let e of t) {
|
|
4279
4481
|
if (e === "#") {
|
|
@@ -4285,127 +4487,127 @@ var $ = {
|
|
|
4285
4487
|
r < n.length && (i += e);
|
|
4286
4488
|
}
|
|
4287
4489
|
return i;
|
|
4288
|
-
},
|
|
4289
|
-
let K = p(), ue =
|
|
4490
|
+
}, Pi = (e, t) => t ? typeof t == "function" ? t(e) : Ni(e, t) : e, Fi = c(({ id: e, label: i, name: a, description: o, placeholder: s, value: c, defaultValue: l, type: d = "text", size: f, color: m = "primary", variant: h = "outline", error: v, invalid: y = !1, disabled: b = !1, required: x = !1, loading: S = !1, className: C, wrapperClassName: w, autoComplete: T, readOnly: E = !1, clearable: D = !1, onClear: O, onValueChange: k, revealPassword: A = !1, showCounter: j = !1, startIcon: M, endIcon: N, startAddon: P, endAddon: F, prefix: I, suffix: L, clearIcon: R, mask: z, format: B, parse: te, startIconTone: H = "default", endIconTone: U = "default", clearIconTone: ne = "danger", autoFocus: re, maxLength: W, onMouseEnter: ie, onMouseLeave: ae, "aria-describedby": G, "aria-invalid": oe, "aria-labelledby": se, ...ce }, le) => {
|
|
4491
|
+
let K = p(), ue = mr(), de = !!(i || o || v), fe = e ?? (de ? void 0 : ue?.controlId) ?? K, pe = g(null), [me, he] = _(!1), [ge, _e] = _(l ?? ""), ve = c !== void 0, ye = String((ve ? c : ge) ?? ""), be = B ? B(ye) : ye, xe = ye.length > 0, Se = f ?? ue?.size ?? "md", Ce = y || !!v || !de && !!ue?.invalid, q = b || !de && !!ue?.disabled, we = x || !de && !!ue?.required, Te = E || S, Ee = d === "password", De = Ee && A && me ? "text" : d, Oe = M ?? (d === "search" ? /* @__PURE__ */ n(ee, {}) : null), ke = N, Ae = Mi(d, T), je = S && !q, Me = D && xe && !q && !Te && !je, Ne = A && Ee && !q && !je && !Me, Pe = !je && !Me && !Ne && !!ke, Fe = !!(j && W), Ie = o ? `${fe}-description` : void 0, J = v ? `${fe}-error` : void 0, Le = Fe ? `${fe}-counter` : void 0, Re = [
|
|
4290
4492
|
G,
|
|
4291
4493
|
!de && !G ? ue?.ariaDescribedBy : void 0,
|
|
4292
4494
|
Ie,
|
|
4293
|
-
|
|
4294
|
-
|
|
4295
|
-
].filter(Boolean).join(" "),
|
|
4495
|
+
J,
|
|
4496
|
+
Le
|
|
4497
|
+
].filter(Boolean).join(" "), ze = R ?? "×", Be = !!(Oe || I), Ve = !!(ke || L || Me || Ne || je), He = !!(Oe && I), Ue = !!(ke && L), We = !!(P || F), Ge = u((e) => {
|
|
4296
4498
|
if (pe.current = e, typeof le == "function") {
|
|
4297
4499
|
le(e);
|
|
4298
4500
|
return;
|
|
4299
4501
|
}
|
|
4300
4502
|
le && (le.current = e);
|
|
4301
|
-
}, [le]),
|
|
4302
|
-
let t =
|
|
4303
|
-
ve || _e(t),
|
|
4503
|
+
}, [le]), Ke = u((e) => {
|
|
4504
|
+
let t = Pi(te ? te(e.target.value) : e.target.value, z);
|
|
4505
|
+
ve || _e(t), k?.(t);
|
|
4304
4506
|
}, [
|
|
4305
4507
|
ve,
|
|
4306
|
-
|
|
4307
|
-
|
|
4308
|
-
|
|
4309
|
-
]),
|
|
4310
|
-
ve || _e(""),
|
|
4508
|
+
z,
|
|
4509
|
+
k,
|
|
4510
|
+
te
|
|
4511
|
+
]), qe = u(() => {
|
|
4512
|
+
ve || _e(""), k?.(""), O?.(), pe.current?.focus();
|
|
4311
4513
|
}, [
|
|
4312
4514
|
ve,
|
|
4313
|
-
|
|
4314
|
-
|
|
4315
|
-
]),
|
|
4316
|
-
className:
|
|
4317
|
-
[$.hasAddons]:
|
|
4318
|
-
[$.isDisabled]:
|
|
4515
|
+
O,
|
|
4516
|
+
k
|
|
4517
|
+
]), Je = /* @__PURE__ */ r(t, { children: [/* @__PURE__ */ r("div", {
|
|
4518
|
+
className: V($.inputGroup, $[h], $[m], {
|
|
4519
|
+
[$.hasAddons]: We,
|
|
4520
|
+
[$.isDisabled]: q,
|
|
4319
4521
|
[$.isInvalid]: Ce,
|
|
4320
|
-
[$.isLoading]:
|
|
4522
|
+
[$.isLoading]: je
|
|
4321
4523
|
}),
|
|
4322
4524
|
children: [
|
|
4323
|
-
|
|
4525
|
+
P && /* @__PURE__ */ n("span", {
|
|
4324
4526
|
className: $.addon,
|
|
4325
|
-
children:
|
|
4527
|
+
children: P
|
|
4326
4528
|
}),
|
|
4327
4529
|
/* @__PURE__ */ r("div", {
|
|
4328
|
-
className:
|
|
4329
|
-
[$.hasLeftAdornment]:
|
|
4330
|
-
[$.hasRightAdornment]:
|
|
4331
|
-
[$.hasStartIconAndPrefix]:
|
|
4332
|
-
[$.hasEndIconAndSuffix]:
|
|
4530
|
+
className: V($.inputWrapper, {
|
|
4531
|
+
[$.hasLeftAdornment]: Be,
|
|
4532
|
+
[$.hasRightAdornment]: Ve,
|
|
4533
|
+
[$.hasStartIconAndPrefix]: He,
|
|
4534
|
+
[$.hasEndIconAndSuffix]: Ue
|
|
4333
4535
|
}),
|
|
4334
4536
|
children: [
|
|
4335
|
-
|
|
4537
|
+
Oe && /* @__PURE__ */ n("span", {
|
|
4336
4538
|
"aria-hidden": "true",
|
|
4337
|
-
className:
|
|
4338
|
-
children:
|
|
4539
|
+
className: V($.startAdornment, ji[H]),
|
|
4540
|
+
children: Oe
|
|
4339
4541
|
}),
|
|
4340
|
-
|
|
4542
|
+
I && /* @__PURE__ */ n("span", {
|
|
4341
4543
|
className: $.prefix,
|
|
4342
|
-
children:
|
|
4544
|
+
children: I
|
|
4343
4545
|
}),
|
|
4344
4546
|
/* @__PURE__ */ n("input", {
|
|
4345
4547
|
...ce,
|
|
4346
|
-
ref:
|
|
4548
|
+
ref: Ge,
|
|
4347
4549
|
id: fe,
|
|
4348
4550
|
name: a,
|
|
4349
|
-
type:
|
|
4350
|
-
autoComplete:
|
|
4351
|
-
className:
|
|
4551
|
+
type: De,
|
|
4552
|
+
autoComplete: Ae,
|
|
4553
|
+
className: V($.input, $[Se], { [$.error]: Ce }, C),
|
|
4352
4554
|
value: be,
|
|
4353
|
-
onChange:
|
|
4555
|
+
onChange: Ke,
|
|
4354
4556
|
placeholder: s,
|
|
4355
|
-
disabled:
|
|
4356
|
-
readOnly:
|
|
4357
|
-
required:
|
|
4557
|
+
disabled: q,
|
|
4558
|
+
readOnly: Te,
|
|
4559
|
+
required: we,
|
|
4358
4560
|
autoFocus: re,
|
|
4359
4561
|
maxLength: W,
|
|
4360
4562
|
"aria-invalid": Ce ? !0 : oe,
|
|
4361
4563
|
"aria-labelledby": se ?? (de ? void 0 : ue?.ariaLabelledBy),
|
|
4362
|
-
"aria-describedby":
|
|
4564
|
+
"aria-describedby": Re || void 0,
|
|
4363
4565
|
"aria-busy": S || void 0,
|
|
4364
4566
|
onMouseEnter: ie,
|
|
4365
4567
|
onMouseLeave: ae
|
|
4366
4568
|
}),
|
|
4367
|
-
|
|
4569
|
+
L && /* @__PURE__ */ n("span", {
|
|
4368
4570
|
className: $.suffix,
|
|
4369
|
-
children:
|
|
4571
|
+
children: L
|
|
4370
4572
|
}),
|
|
4371
4573
|
/* @__PURE__ */ r("div", {
|
|
4372
4574
|
className: $.endSlot,
|
|
4373
4575
|
children: [
|
|
4374
|
-
|
|
4576
|
+
je && /* @__PURE__ */ n("span", {
|
|
4375
4577
|
className: $.spinner,
|
|
4376
4578
|
"aria-hidden": "true",
|
|
4377
4579
|
"data-testid": "input-spinner"
|
|
4378
4580
|
}),
|
|
4379
|
-
|
|
4581
|
+
Ne && /* @__PURE__ */ n("button", {
|
|
4380
4582
|
type: "button",
|
|
4381
4583
|
className: $.iconButton,
|
|
4382
4584
|
onClick: () => he((e) => !e),
|
|
4383
4585
|
"aria-label": me ? "Hide password" : "Show password",
|
|
4384
4586
|
children: me ? "Hide" : "Show"
|
|
4385
4587
|
}),
|
|
4386
|
-
|
|
4588
|
+
Me && /* @__PURE__ */ n("button", {
|
|
4387
4589
|
type: "button",
|
|
4388
|
-
className:
|
|
4389
|
-
onClick:
|
|
4590
|
+
className: V($.clearButton, ji[ne]),
|
|
4591
|
+
onClick: qe,
|
|
4390
4592
|
"aria-label": "Clear input",
|
|
4391
|
-
children:
|
|
4593
|
+
children: ze
|
|
4392
4594
|
}),
|
|
4393
|
-
|
|
4595
|
+
Pe && ke && /* @__PURE__ */ n("span", {
|
|
4394
4596
|
"aria-hidden": "true",
|
|
4395
|
-
className:
|
|
4396
|
-
children:
|
|
4597
|
+
className: V($.endAdornment, ji[U]),
|
|
4598
|
+
children: ke
|
|
4397
4599
|
})
|
|
4398
4600
|
]
|
|
4399
4601
|
})
|
|
4400
4602
|
]
|
|
4401
4603
|
}),
|
|
4402
|
-
|
|
4604
|
+
F && /* @__PURE__ */ n("span", {
|
|
4403
4605
|
className: $.addon,
|
|
4404
|
-
children:
|
|
4606
|
+
children: F
|
|
4405
4607
|
})
|
|
4406
4608
|
]
|
|
4407
|
-
}),
|
|
4408
|
-
id:
|
|
4609
|
+
}), Fe && /* @__PURE__ */ r("div", {
|
|
4610
|
+
id: Le,
|
|
4409
4611
|
className: $.counter,
|
|
4410
4612
|
children: [
|
|
4411
4613
|
ye.length,
|
|
@@ -4413,29 +4615,29 @@ var $ = {
|
|
|
4413
4615
|
W
|
|
4414
4616
|
]
|
|
4415
4617
|
})] });
|
|
4416
|
-
return !de && ue ?
|
|
4618
|
+
return !de && ue ? Je : /* @__PURE__ */ n(wr, {
|
|
4417
4619
|
id: fe,
|
|
4418
4620
|
label: i,
|
|
4419
4621
|
description: o,
|
|
4420
4622
|
error: v,
|
|
4421
|
-
required:
|
|
4422
|
-
disabled:
|
|
4623
|
+
required: we,
|
|
4624
|
+
disabled: q,
|
|
4423
4625
|
invalid: Ce,
|
|
4424
4626
|
size: Se,
|
|
4425
|
-
className:
|
|
4627
|
+
className: w,
|
|
4426
4628
|
bindControl: !1,
|
|
4427
|
-
children:
|
|
4629
|
+
children: Je
|
|
4428
4630
|
});
|
|
4429
4631
|
});
|
|
4430
|
-
|
|
4632
|
+
Fi.displayName = "Input";
|
|
4431
4633
|
//#endregion
|
|
4432
4634
|
//#region src/theme/ThemeContext.ts
|
|
4433
|
-
var
|
|
4434
|
-
let [o, s] =
|
|
4635
|
+
var Ii = s(null), Li = (e) => e === "highContrast" ? "high-contrast" : e, Ri = ({ theme: e, defaultTheme: t = "light", onThemeChange: r, syncDocument: i = !0, children: a }) => {
|
|
4636
|
+
let [o, s] = J({
|
|
4435
4637
|
value: e,
|
|
4436
4638
|
defaultValue: t,
|
|
4437
4639
|
onChange: r
|
|
4438
|
-
}), c =
|
|
4640
|
+
}), c = Li(o);
|
|
4439
4641
|
f(() => {
|
|
4440
4642
|
if (!i || typeof document > "u") return;
|
|
4441
4643
|
let { documentElement: e } = document, t = e.dataset.velliraTheme;
|
|
@@ -4451,7 +4653,7 @@ var hi = s(null), gi = (e) => e === "highContrast" ? "high-contrast" : e, _i = (
|
|
|
4451
4653
|
theme: o,
|
|
4452
4654
|
setTheme: s
|
|
4453
4655
|
}), [o, s]);
|
|
4454
|
-
return /* @__PURE__ */ n(
|
|
4656
|
+
return /* @__PURE__ */ n(Ii.Provider, {
|
|
4455
4657
|
value: l,
|
|
4456
4658
|
children: /* @__PURE__ */ n("div", {
|
|
4457
4659
|
"data-vellira-theme": c,
|
|
@@ -4459,13 +4661,13 @@ var hi = s(null), gi = (e) => e === "highContrast" ? "high-contrast" : e, _i = (
|
|
|
4459
4661
|
})
|
|
4460
4662
|
});
|
|
4461
4663
|
};
|
|
4462
|
-
|
|
4664
|
+
Ri.displayName = "ThemeProvider";
|
|
4463
4665
|
//#endregion
|
|
4464
4666
|
//#region src/theme/useTheme.ts
|
|
4465
|
-
function
|
|
4466
|
-
let e = d(
|
|
4667
|
+
function zi() {
|
|
4668
|
+
let e = d(Ii);
|
|
4467
4669
|
if (!e) throw Error("useTheme must be used within ThemeProvider.");
|
|
4468
4670
|
return e;
|
|
4469
4671
|
}
|
|
4470
4672
|
//#endregion
|
|
4471
|
-
export {
|
|
4673
|
+
export { Ti as Button, Ai as Checkbox, Lt as Dropdown, wr as FormField, Fi as Input, fn as Modal, jn as Popover, We as Portal, Ue as PortalProvider, Ln as Radio, Kn as RadioGroup, zr as Select, ai as Tabs, Ri as ThemeProvider, Si as Tooltip, zi as useTheme };
|