@liketysplit/react-luna 0.1.4 → 0.1.6
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/components/index.d.ts +6 -0
- package/dist/components/luna-checkbox/LunaCheckbox.d.ts +9 -0
- package/dist/components/luna-checkbox/LunaCheckbox.props.d.ts +8 -0
- package/dist/components/luna-checkbox/index.d.ts +2 -0
- package/dist/components/luna-date-input/LunaDateInput.d.ts +10 -0
- package/dist/components/luna-date-input/LunaDateInput.props.d.ts +9 -0
- package/dist/components/luna-date-input/index.d.ts +2 -0
- package/dist/components/luna-date-picker/LunaDatePicker.d.ts +4 -0
- package/dist/components/luna-date-picker/LunaDatePicker.props.d.ts +28 -0
- package/dist/components/luna-date-picker/dateUtils.d.ts +19 -0
- package/dist/components/luna-date-picker/index.d.ts +2 -0
- package/dist/components/luna-radio/LunaRadio.d.ts +8 -0
- package/dist/components/luna-radio/LunaRadio.props.d.ts +7 -0
- package/dist/components/luna-radio/index.d.ts +2 -0
- package/dist/components/luna-slider/LunaSlider.d.ts +9 -0
- package/dist/components/luna-slider/LunaSlider.props.d.ts +8 -0
- package/dist/components/luna-slider/index.d.ts +2 -0
- package/dist/components/luna-switch/LunaSwitch.d.ts +8 -0
- package/dist/components/luna-switch/LunaSwitch.props.d.ts +7 -0
- package/dist/components/luna-switch/index.d.ts +2 -0
- package/dist/index.js +2467 -1477
- package/dist/style.css +1 -1
- package/dist/theme/types.d.ts +26 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
const
|
|
1
|
+
import c from "react";
|
|
2
|
+
const Zn = {
|
|
3
3
|
colors: {
|
|
4
4
|
scale: {
|
|
5
5
|
primary: {
|
|
@@ -382,10 +382,56 @@ const Wn = {
|
|
|
382
382
|
labelFg: "neutral.100"
|
|
383
383
|
}
|
|
384
384
|
}
|
|
385
|
+
},
|
|
386
|
+
checkbox: {
|
|
387
|
+
radius: "sm",
|
|
388
|
+
boxSize: "1.125rem",
|
|
389
|
+
gap: "2",
|
|
390
|
+
offsetY: "0.125rem",
|
|
391
|
+
modes: {
|
|
392
|
+
light: {
|
|
393
|
+
bg: "neutral.50",
|
|
394
|
+
border: "neutral.300",
|
|
395
|
+
hoverBorder: "neutral.400",
|
|
396
|
+
checkedBg: "primary.600",
|
|
397
|
+
checkedBorder: "primary.600",
|
|
398
|
+
checkFg: "#ffffff",
|
|
399
|
+
focusBorder: "primary.500",
|
|
400
|
+
focusRing: "rgba(99, 102, 241, 0.18)",
|
|
401
|
+
disabledBg: "neutral.100",
|
|
402
|
+
disabledBorder: "neutral.200",
|
|
403
|
+
disabledFg: "neutral.500",
|
|
404
|
+
errorBorder: "danger.500",
|
|
405
|
+
helpFg: "neutral.500",
|
|
406
|
+
errorFg: "danger.600",
|
|
407
|
+
labelFg: "neutral.900",
|
|
408
|
+
descriptionFg: "neutral.500",
|
|
409
|
+
disabledLabelFg: "neutral.500"
|
|
410
|
+
},
|
|
411
|
+
dark: {
|
|
412
|
+
bg: "neutral.800",
|
|
413
|
+
border: "neutral.600",
|
|
414
|
+
hoverBorder: "neutral.500",
|
|
415
|
+
checkedBg: "primary.400",
|
|
416
|
+
checkedBorder: "primary.400",
|
|
417
|
+
checkFg: "#ffffff",
|
|
418
|
+
focusBorder: "primary.300",
|
|
419
|
+
focusRing: "rgba(129, 140, 248, 0.22)",
|
|
420
|
+
disabledBg: "neutral.900",
|
|
421
|
+
disabledBorder: "neutral.700",
|
|
422
|
+
disabledFg: "neutral.500",
|
|
423
|
+
errorBorder: "danger.400",
|
|
424
|
+
helpFg: "neutral.400",
|
|
425
|
+
errorFg: "danger.300",
|
|
426
|
+
labelFg: "neutral.50",
|
|
427
|
+
descriptionFg: "neutral.400",
|
|
428
|
+
disabledLabelFg: "neutral.500"
|
|
429
|
+
}
|
|
430
|
+
}
|
|
385
431
|
}
|
|
386
432
|
}
|
|
387
433
|
};
|
|
388
|
-
var
|
|
434
|
+
var fn = { exports: {} }, Xe = {};
|
|
389
435
|
/**
|
|
390
436
|
* @license React
|
|
391
437
|
* react-jsx-runtime.production.min.js
|
|
@@ -395,21 +441,21 @@ var Ze = { exports: {} }, Le = {};
|
|
|
395
441
|
* This source code is licensed under the MIT license found in the
|
|
396
442
|
* LICENSE file in the root directory of this source tree.
|
|
397
443
|
*/
|
|
398
|
-
var
|
|
399
|
-
function
|
|
400
|
-
if (
|
|
401
|
-
|
|
402
|
-
var e =
|
|
403
|
-
function
|
|
404
|
-
var
|
|
405
|
-
|
|
406
|
-
for (
|
|
407
|
-
if (
|
|
408
|
-
return { $$typeof: a, type:
|
|
444
|
+
var jn;
|
|
445
|
+
function Mn() {
|
|
446
|
+
if (jn) return Xe;
|
|
447
|
+
jn = 1;
|
|
448
|
+
var e = c, a = Symbol.for("react.element"), n = Symbol.for("react.fragment"), s = Object.prototype.hasOwnProperty, l = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, i = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
449
|
+
function g(v, d, _) {
|
|
450
|
+
var b, f = {}, y = null, o = null;
|
|
451
|
+
_ !== void 0 && (y = "" + _), d.key !== void 0 && (y = "" + d.key), d.ref !== void 0 && (o = d.ref);
|
|
452
|
+
for (b in d) s.call(d, b) && !i.hasOwnProperty(b) && (f[b] = d[b]);
|
|
453
|
+
if (v && v.defaultProps) for (b in d = v.defaultProps, d) f[b] === void 0 && (f[b] = d[b]);
|
|
454
|
+
return { $$typeof: a, type: v, key: y, ref: o, props: f, _owner: l.current };
|
|
409
455
|
}
|
|
410
|
-
return
|
|
456
|
+
return Xe.Fragment = n, Xe.jsx = g, Xe.jsxs = g, Xe;
|
|
411
457
|
}
|
|
412
|
-
var
|
|
458
|
+
var Ge = {};
|
|
413
459
|
/**
|
|
414
460
|
* @license React
|
|
415
461
|
* react-jsx-runtime.development.js
|
|
@@ -419,91 +465,91 @@ var Ae = {};
|
|
|
419
465
|
* This source code is licensed under the MIT license found in the
|
|
420
466
|
* LICENSE file in the root directory of this source tree.
|
|
421
467
|
*/
|
|
422
|
-
var
|
|
423
|
-
function
|
|
424
|
-
return
|
|
425
|
-
var e =
|
|
426
|
-
function
|
|
427
|
-
if (
|
|
468
|
+
var Sn;
|
|
469
|
+
function ea() {
|
|
470
|
+
return Sn || (Sn = 1, process.env.NODE_ENV !== "production" && function() {
|
|
471
|
+
var e = c, a = Symbol.for("react.element"), n = Symbol.for("react.portal"), s = Symbol.for("react.fragment"), l = Symbol.for("react.strict_mode"), i = Symbol.for("react.profiler"), g = Symbol.for("react.provider"), v = Symbol.for("react.context"), d = Symbol.for("react.forward_ref"), _ = Symbol.for("react.suspense"), b = Symbol.for("react.suspense_list"), f = Symbol.for("react.memo"), y = Symbol.for("react.lazy"), o = Symbol.for("react.offscreen"), h = Symbol.iterator, u = "@@iterator";
|
|
472
|
+
function j(t) {
|
|
473
|
+
if (t === null || typeof t != "object")
|
|
428
474
|
return null;
|
|
429
|
-
var
|
|
430
|
-
return typeof
|
|
475
|
+
var m = h && t[h] || t[u];
|
|
476
|
+
return typeof m == "function" ? m : null;
|
|
431
477
|
}
|
|
432
|
-
var
|
|
433
|
-
function
|
|
478
|
+
var k = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
479
|
+
function D(t) {
|
|
434
480
|
{
|
|
435
|
-
for (var
|
|
436
|
-
|
|
437
|
-
|
|
481
|
+
for (var m = arguments.length, w = new Array(m > 1 ? m - 1 : 0), z = 1; z < m; z++)
|
|
482
|
+
w[z - 1] = arguments[z];
|
|
483
|
+
O("error", t, w);
|
|
438
484
|
}
|
|
439
485
|
}
|
|
440
|
-
function
|
|
486
|
+
function O(t, m, w) {
|
|
441
487
|
{
|
|
442
|
-
var
|
|
443
|
-
|
|
444
|
-
var
|
|
445
|
-
return String(
|
|
488
|
+
var z = k.ReactDebugCurrentFrame, ae = z.getStackAddendum();
|
|
489
|
+
ae !== "" && (m += "%s", w = w.concat([ae]));
|
|
490
|
+
var se = w.map(function(J) {
|
|
491
|
+
return String(J);
|
|
446
492
|
});
|
|
447
|
-
|
|
493
|
+
se.unshift("Warning: " + m), Function.prototype.apply.call(console[t], console, se);
|
|
448
494
|
}
|
|
449
495
|
}
|
|
450
|
-
var
|
|
496
|
+
var C = !1, T = !1, N = !1, p = !1, Y = !1, K;
|
|
451
497
|
K = Symbol.for("react.module.reference");
|
|
452
|
-
function
|
|
453
|
-
return !!(typeof
|
|
498
|
+
function P(t) {
|
|
499
|
+
return !!(typeof t == "string" || typeof t == "function" || t === s || t === i || Y || t === l || t === _ || t === b || p || t === o || C || T || N || typeof t == "object" && t !== null && (t.$$typeof === y || t.$$typeof === f || t.$$typeof === g || t.$$typeof === v || t.$$typeof === d || // This needs to include all possible module reference object
|
|
454
500
|
// types supported by any Flight configuration anywhere since
|
|
455
501
|
// we don't know which Flight build this will end up being used
|
|
456
502
|
// with.
|
|
457
|
-
|
|
503
|
+
t.$$typeof === K || t.getModuleId !== void 0));
|
|
458
504
|
}
|
|
459
|
-
function
|
|
460
|
-
var
|
|
461
|
-
if (
|
|
462
|
-
return
|
|
463
|
-
var
|
|
464
|
-
return
|
|
505
|
+
function Q(t, m, w) {
|
|
506
|
+
var z = t.displayName;
|
|
507
|
+
if (z)
|
|
508
|
+
return z;
|
|
509
|
+
var ae = m.displayName || m.name || "";
|
|
510
|
+
return ae !== "" ? w + "(" + ae + ")" : w;
|
|
465
511
|
}
|
|
466
|
-
function
|
|
467
|
-
return
|
|
512
|
+
function H(t) {
|
|
513
|
+
return t.displayName || "Context";
|
|
468
514
|
}
|
|
469
|
-
function
|
|
470
|
-
if (
|
|
515
|
+
function X(t) {
|
|
516
|
+
if (t == null)
|
|
471
517
|
return null;
|
|
472
|
-
if (typeof
|
|
473
|
-
return
|
|
474
|
-
if (typeof
|
|
475
|
-
return
|
|
476
|
-
switch (
|
|
477
|
-
case
|
|
518
|
+
if (typeof t.tag == "number" && D("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof t == "function")
|
|
519
|
+
return t.displayName || t.name || null;
|
|
520
|
+
if (typeof t == "string")
|
|
521
|
+
return t;
|
|
522
|
+
switch (t) {
|
|
523
|
+
case s:
|
|
478
524
|
return "Fragment";
|
|
479
|
-
case
|
|
525
|
+
case n:
|
|
480
526
|
return "Portal";
|
|
481
|
-
case
|
|
527
|
+
case i:
|
|
482
528
|
return "Profiler";
|
|
483
529
|
case l:
|
|
484
530
|
return "StrictMode";
|
|
485
|
-
case
|
|
531
|
+
case _:
|
|
486
532
|
return "Suspense";
|
|
487
|
-
case
|
|
533
|
+
case b:
|
|
488
534
|
return "SuspenseList";
|
|
489
535
|
}
|
|
490
|
-
if (typeof
|
|
491
|
-
switch (
|
|
492
|
-
case
|
|
493
|
-
var
|
|
494
|
-
return
|
|
495
|
-
case _:
|
|
496
|
-
var h = n;
|
|
497
|
-
return G(h._context) + ".Provider";
|
|
536
|
+
if (typeof t == "object")
|
|
537
|
+
switch (t.$$typeof) {
|
|
538
|
+
case v:
|
|
539
|
+
var m = t;
|
|
540
|
+
return H(m) + ".Consumer";
|
|
498
541
|
case g:
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
return
|
|
503
|
-
case
|
|
504
|
-
var
|
|
542
|
+
var w = t;
|
|
543
|
+
return H(w._context) + ".Provider";
|
|
544
|
+
case d:
|
|
545
|
+
return Q(t, t.render, "ForwardRef");
|
|
546
|
+
case f:
|
|
547
|
+
var z = t.displayName || null;
|
|
548
|
+
return z !== null ? z : X(t.type) || "Memo";
|
|
549
|
+
case y: {
|
|
550
|
+
var ae = t, se = ae._payload, J = ae._init;
|
|
505
551
|
try {
|
|
506
|
-
return J(
|
|
552
|
+
return X(J(se));
|
|
507
553
|
} catch {
|
|
508
554
|
return null;
|
|
509
555
|
}
|
|
@@ -511,821 +557,827 @@ function Yn() {
|
|
|
511
557
|
}
|
|
512
558
|
return null;
|
|
513
559
|
}
|
|
514
|
-
var ee = Object.assign,
|
|
515
|
-
function
|
|
560
|
+
var ee = Object.assign, ce = 0, oe, me, pe, Z, ge, q, L;
|
|
561
|
+
function A() {
|
|
516
562
|
}
|
|
517
|
-
|
|
518
|
-
function
|
|
563
|
+
A.__reactDisabledLog = !0;
|
|
564
|
+
function ne() {
|
|
519
565
|
{
|
|
520
|
-
if (
|
|
521
|
-
|
|
522
|
-
var
|
|
566
|
+
if (ce === 0) {
|
|
567
|
+
oe = console.log, me = console.info, pe = console.warn, Z = console.error, ge = console.group, q = console.groupCollapsed, L = console.groupEnd;
|
|
568
|
+
var t = {
|
|
523
569
|
configurable: !0,
|
|
524
570
|
enumerable: !0,
|
|
525
|
-
value:
|
|
571
|
+
value: A,
|
|
526
572
|
writable: !0
|
|
527
573
|
};
|
|
528
574
|
Object.defineProperties(console, {
|
|
529
|
-
info:
|
|
530
|
-
log:
|
|
531
|
-
warn:
|
|
532
|
-
error:
|
|
533
|
-
group:
|
|
534
|
-
groupCollapsed:
|
|
535
|
-
groupEnd:
|
|
575
|
+
info: t,
|
|
576
|
+
log: t,
|
|
577
|
+
warn: t,
|
|
578
|
+
error: t,
|
|
579
|
+
group: t,
|
|
580
|
+
groupCollapsed: t,
|
|
581
|
+
groupEnd: t
|
|
536
582
|
});
|
|
537
583
|
}
|
|
538
|
-
|
|
584
|
+
ce++;
|
|
539
585
|
}
|
|
540
586
|
}
|
|
541
|
-
function
|
|
587
|
+
function te() {
|
|
542
588
|
{
|
|
543
|
-
if (
|
|
544
|
-
var
|
|
589
|
+
if (ce--, ce === 0) {
|
|
590
|
+
var t = {
|
|
545
591
|
configurable: !0,
|
|
546
592
|
enumerable: !0,
|
|
547
593
|
writable: !0
|
|
548
594
|
};
|
|
549
595
|
Object.defineProperties(console, {
|
|
550
|
-
log: ee({},
|
|
551
|
-
value:
|
|
596
|
+
log: ee({}, t, {
|
|
597
|
+
value: oe
|
|
552
598
|
}),
|
|
553
|
-
info: ee({},
|
|
554
|
-
value:
|
|
599
|
+
info: ee({}, t, {
|
|
600
|
+
value: me
|
|
555
601
|
}),
|
|
556
|
-
warn: ee({},
|
|
557
|
-
value:
|
|
602
|
+
warn: ee({}, t, {
|
|
603
|
+
value: pe
|
|
558
604
|
}),
|
|
559
|
-
error: ee({},
|
|
560
|
-
value:
|
|
605
|
+
error: ee({}, t, {
|
|
606
|
+
value: Z
|
|
561
607
|
}),
|
|
562
|
-
group: ee({},
|
|
563
|
-
value:
|
|
608
|
+
group: ee({}, t, {
|
|
609
|
+
value: ge
|
|
564
610
|
}),
|
|
565
|
-
groupCollapsed: ee({},
|
|
566
|
-
value:
|
|
611
|
+
groupCollapsed: ee({}, t, {
|
|
612
|
+
value: q
|
|
567
613
|
}),
|
|
568
|
-
groupEnd: ee({},
|
|
569
|
-
value:
|
|
614
|
+
groupEnd: ee({}, t, {
|
|
615
|
+
value: L
|
|
570
616
|
})
|
|
571
617
|
});
|
|
572
618
|
}
|
|
573
|
-
|
|
619
|
+
ce < 0 && D("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
574
620
|
}
|
|
575
621
|
}
|
|
576
|
-
var
|
|
577
|
-
function de(
|
|
622
|
+
var $ = k.ReactCurrentDispatcher, re;
|
|
623
|
+
function de(t, m, w) {
|
|
578
624
|
{
|
|
579
|
-
if (
|
|
625
|
+
if (re === void 0)
|
|
580
626
|
try {
|
|
581
627
|
throw Error();
|
|
582
|
-
} catch (
|
|
583
|
-
var
|
|
584
|
-
|
|
628
|
+
} catch (ae) {
|
|
629
|
+
var z = ae.stack.trim().match(/\n( *(at )?)/);
|
|
630
|
+
re = z && z[1] || "";
|
|
585
631
|
}
|
|
586
632
|
return `
|
|
587
|
-
` +
|
|
633
|
+
` + re + t;
|
|
588
634
|
}
|
|
589
635
|
}
|
|
590
|
-
var be = !1,
|
|
636
|
+
var be = !1, ie;
|
|
591
637
|
{
|
|
592
|
-
var
|
|
593
|
-
|
|
638
|
+
var G = typeof WeakMap == "function" ? WeakMap : Map;
|
|
639
|
+
ie = new G();
|
|
594
640
|
}
|
|
595
|
-
function
|
|
596
|
-
if (!
|
|
641
|
+
function U(t, m) {
|
|
642
|
+
if (!t || be)
|
|
597
643
|
return "";
|
|
598
644
|
{
|
|
599
|
-
var
|
|
600
|
-
if (
|
|
601
|
-
return
|
|
645
|
+
var w = ie.get(t);
|
|
646
|
+
if (w !== void 0)
|
|
647
|
+
return w;
|
|
602
648
|
}
|
|
603
|
-
var
|
|
649
|
+
var z;
|
|
604
650
|
be = !0;
|
|
605
|
-
var
|
|
651
|
+
var ae = Error.prepareStackTrace;
|
|
606
652
|
Error.prepareStackTrace = void 0;
|
|
607
|
-
var
|
|
608
|
-
|
|
653
|
+
var se;
|
|
654
|
+
se = $.current, $.current = null, ne();
|
|
609
655
|
try {
|
|
610
|
-
if (
|
|
611
|
-
var
|
|
656
|
+
if (m) {
|
|
657
|
+
var J = function() {
|
|
612
658
|
throw Error();
|
|
613
659
|
};
|
|
614
|
-
if (Object.defineProperty(
|
|
660
|
+
if (Object.defineProperty(J.prototype, "props", {
|
|
615
661
|
set: function() {
|
|
616
662
|
throw Error();
|
|
617
663
|
}
|
|
618
664
|
}), typeof Reflect == "object" && Reflect.construct) {
|
|
619
665
|
try {
|
|
620
|
-
Reflect.construct(
|
|
621
|
-
} catch (
|
|
622
|
-
|
|
666
|
+
Reflect.construct(J, []);
|
|
667
|
+
} catch (Fe) {
|
|
668
|
+
z = Fe;
|
|
623
669
|
}
|
|
624
|
-
Reflect.construct(
|
|
670
|
+
Reflect.construct(t, [], J);
|
|
625
671
|
} else {
|
|
626
672
|
try {
|
|
627
|
-
|
|
628
|
-
} catch (
|
|
629
|
-
|
|
673
|
+
J.call();
|
|
674
|
+
} catch (Fe) {
|
|
675
|
+
z = Fe;
|
|
630
676
|
}
|
|
631
|
-
|
|
677
|
+
t.call(J.prototype);
|
|
632
678
|
}
|
|
633
679
|
} else {
|
|
634
680
|
try {
|
|
635
681
|
throw Error();
|
|
636
|
-
} catch (
|
|
637
|
-
|
|
682
|
+
} catch (Fe) {
|
|
683
|
+
z = Fe;
|
|
638
684
|
}
|
|
639
|
-
|
|
685
|
+
t();
|
|
640
686
|
}
|
|
641
|
-
} catch (
|
|
642
|
-
if (
|
|
643
|
-
for (var
|
|
644
|
-
`),
|
|
645
|
-
`),
|
|
646
|
-
|
|
647
|
-
for (;
|
|
648
|
-
if (
|
|
649
|
-
if (
|
|
687
|
+
} catch (Fe) {
|
|
688
|
+
if (Fe && z && typeof Fe.stack == "string") {
|
|
689
|
+
for (var W = Fe.stack.split(`
|
|
690
|
+
`), Ie = z.stack.split(`
|
|
691
|
+
`), ve = W.length - 1, ye = Ie.length - 1; ve >= 1 && ye >= 0 && W[ve] !== Ie[ye]; )
|
|
692
|
+
ye--;
|
|
693
|
+
for (; ve >= 1 && ye >= 0; ve--, ye--)
|
|
694
|
+
if (W[ve] !== Ie[ye]) {
|
|
695
|
+
if (ve !== 1 || ye !== 1)
|
|
650
696
|
do
|
|
651
|
-
if (
|
|
652
|
-
var
|
|
653
|
-
` +
|
|
654
|
-
return
|
|
697
|
+
if (ve--, ye--, ye < 0 || W[ve] !== Ie[ye]) {
|
|
698
|
+
var Le = `
|
|
699
|
+
` + W[ve].replace(" at new ", " at ");
|
|
700
|
+
return t.displayName && Le.includes("<anonymous>") && (Le = Le.replace("<anonymous>", t.displayName)), typeof t == "function" && ie.set(t, Le), Le;
|
|
655
701
|
}
|
|
656
|
-
while (
|
|
702
|
+
while (ve >= 1 && ye >= 0);
|
|
657
703
|
break;
|
|
658
704
|
}
|
|
659
705
|
}
|
|
660
706
|
} finally {
|
|
661
|
-
be = !1,
|
|
707
|
+
be = !1, $.current = se, te(), Error.prepareStackTrace = ae;
|
|
662
708
|
}
|
|
663
|
-
var
|
|
664
|
-
return typeof
|
|
709
|
+
var Ue = t ? t.displayName || t.name : "", Ye = Ue ? de(Ue) : "";
|
|
710
|
+
return typeof t == "function" && ie.set(t, Ye), Ye;
|
|
665
711
|
}
|
|
666
|
-
function
|
|
667
|
-
return
|
|
712
|
+
function je(t, m, w) {
|
|
713
|
+
return U(t, !1);
|
|
668
714
|
}
|
|
669
|
-
function
|
|
670
|
-
var
|
|
671
|
-
return !!(
|
|
715
|
+
function he(t) {
|
|
716
|
+
var m = t.prototype;
|
|
717
|
+
return !!(m && m.isReactComponent);
|
|
672
718
|
}
|
|
673
|
-
function fe(
|
|
674
|
-
if (
|
|
719
|
+
function fe(t, m, w) {
|
|
720
|
+
if (t == null)
|
|
675
721
|
return "";
|
|
676
|
-
if (typeof
|
|
677
|
-
return
|
|
678
|
-
if (typeof
|
|
679
|
-
return de(
|
|
680
|
-
switch (
|
|
681
|
-
case
|
|
722
|
+
if (typeof t == "function")
|
|
723
|
+
return U(t, he(t));
|
|
724
|
+
if (typeof t == "string")
|
|
725
|
+
return de(t);
|
|
726
|
+
switch (t) {
|
|
727
|
+
case _:
|
|
682
728
|
return de("Suspense");
|
|
683
|
-
case
|
|
729
|
+
case b:
|
|
684
730
|
return de("SuspenseList");
|
|
685
731
|
}
|
|
686
|
-
if (typeof
|
|
687
|
-
switch (
|
|
688
|
-
case
|
|
689
|
-
return
|
|
690
|
-
case
|
|
691
|
-
return fe(
|
|
692
|
-
case
|
|
693
|
-
var
|
|
732
|
+
if (typeof t == "object")
|
|
733
|
+
switch (t.$$typeof) {
|
|
734
|
+
case d:
|
|
735
|
+
return je(t.render);
|
|
736
|
+
case f:
|
|
737
|
+
return fe(t.type, m, w);
|
|
738
|
+
case y: {
|
|
739
|
+
var z = t, ae = z._payload, se = z._init;
|
|
694
740
|
try {
|
|
695
|
-
return fe(
|
|
741
|
+
return fe(se(ae), m, w);
|
|
696
742
|
} catch {
|
|
697
743
|
}
|
|
698
744
|
}
|
|
699
745
|
}
|
|
700
746
|
return "";
|
|
701
747
|
}
|
|
702
|
-
var
|
|
703
|
-
function
|
|
704
|
-
if (
|
|
705
|
-
var
|
|
706
|
-
Se.setExtraStackFrame(
|
|
748
|
+
var we = Object.prototype.hasOwnProperty, Ee = {}, Se = k.ReactDebugCurrentFrame;
|
|
749
|
+
function De(t) {
|
|
750
|
+
if (t) {
|
|
751
|
+
var m = t._owner, w = fe(t.type, t._source, m ? m.type : null);
|
|
752
|
+
Se.setExtraStackFrame(w);
|
|
707
753
|
} else
|
|
708
754
|
Se.setExtraStackFrame(null);
|
|
709
755
|
}
|
|
710
|
-
function
|
|
756
|
+
function ke(t, m, w, z, ae) {
|
|
711
757
|
{
|
|
712
|
-
var
|
|
713
|
-
for (var
|
|
714
|
-
if (
|
|
715
|
-
var
|
|
758
|
+
var se = Function.call.bind(we);
|
|
759
|
+
for (var J in t)
|
|
760
|
+
if (se(t, J)) {
|
|
761
|
+
var W = void 0;
|
|
716
762
|
try {
|
|
717
|
-
if (typeof
|
|
718
|
-
var
|
|
719
|
-
throw
|
|
763
|
+
if (typeof t[J] != "function") {
|
|
764
|
+
var Ie = Error((z || "React class") + ": " + w + " type `" + J + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof t[J] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
765
|
+
throw Ie.name = "Invariant Violation", Ie;
|
|
720
766
|
}
|
|
721
|
-
|
|
722
|
-
} catch (
|
|
723
|
-
|
|
767
|
+
W = t[J](m, J, z, w, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
768
|
+
} catch (ve) {
|
|
769
|
+
W = ve;
|
|
724
770
|
}
|
|
725
|
-
|
|
771
|
+
W && !(W instanceof Error) && (De(ae), D("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", z || "React class", w, J, typeof W), De(null)), W instanceof Error && !(W.message in Ee) && (Ee[W.message] = !0, De(ae), D("Failed %s type: %s", w, W.message), De(null));
|
|
726
772
|
}
|
|
727
773
|
}
|
|
728
774
|
}
|
|
729
|
-
var
|
|
730
|
-
function
|
|
731
|
-
return
|
|
775
|
+
var Ce = Array.isArray;
|
|
776
|
+
function Be(t) {
|
|
777
|
+
return Ce(t);
|
|
732
778
|
}
|
|
733
|
-
function
|
|
779
|
+
function Oe(t) {
|
|
734
780
|
{
|
|
735
|
-
var
|
|
736
|
-
return
|
|
781
|
+
var m = typeof Symbol == "function" && Symbol.toStringTag, w = m && t[Symbol.toStringTag] || t.constructor.name || "Object";
|
|
782
|
+
return w;
|
|
737
783
|
}
|
|
738
784
|
}
|
|
739
|
-
function
|
|
785
|
+
function I(t) {
|
|
740
786
|
try {
|
|
741
|
-
return
|
|
787
|
+
return V(t), !1;
|
|
742
788
|
} catch {
|
|
743
789
|
return !0;
|
|
744
790
|
}
|
|
745
791
|
}
|
|
746
|
-
function
|
|
747
|
-
return "" +
|
|
792
|
+
function V(t) {
|
|
793
|
+
return "" + t;
|
|
748
794
|
}
|
|
749
|
-
function
|
|
750
|
-
if (
|
|
751
|
-
return
|
|
795
|
+
function _e(t) {
|
|
796
|
+
if (I(t))
|
|
797
|
+
return D("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Oe(t)), V(t);
|
|
752
798
|
}
|
|
753
|
-
var
|
|
799
|
+
var F = k.ReactCurrentOwner, x = {
|
|
754
800
|
key: !0,
|
|
755
801
|
ref: !0,
|
|
756
802
|
__self: !0,
|
|
757
803
|
__source: !0
|
|
758
|
-
},
|
|
759
|
-
function
|
|
760
|
-
if (
|
|
761
|
-
var
|
|
762
|
-
if (
|
|
804
|
+
}, R, le;
|
|
805
|
+
function Ne(t) {
|
|
806
|
+
if (we.call(t, "ref")) {
|
|
807
|
+
var m = Object.getOwnPropertyDescriptor(t, "ref").get;
|
|
808
|
+
if (m && m.isReactWarning)
|
|
763
809
|
return !1;
|
|
764
810
|
}
|
|
765
|
-
return
|
|
811
|
+
return t.ref !== void 0;
|
|
766
812
|
}
|
|
767
|
-
function
|
|
768
|
-
if (
|
|
769
|
-
var
|
|
770
|
-
if (
|
|
813
|
+
function Ae(t) {
|
|
814
|
+
if (we.call(t, "key")) {
|
|
815
|
+
var m = Object.getOwnPropertyDescriptor(t, "key").get;
|
|
816
|
+
if (m && m.isReactWarning)
|
|
771
817
|
return !1;
|
|
772
818
|
}
|
|
773
|
-
return
|
|
819
|
+
return t.key !== void 0;
|
|
774
820
|
}
|
|
775
|
-
function
|
|
776
|
-
typeof
|
|
821
|
+
function en(t, m) {
|
|
822
|
+
typeof t.ref == "string" && F.current;
|
|
777
823
|
}
|
|
778
|
-
function
|
|
824
|
+
function nn(t, m) {
|
|
779
825
|
{
|
|
780
|
-
var
|
|
781
|
-
|
|
826
|
+
var w = function() {
|
|
827
|
+
R || (R = !0, D("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", m));
|
|
782
828
|
};
|
|
783
|
-
|
|
784
|
-
get:
|
|
829
|
+
w.isReactWarning = !0, Object.defineProperty(t, "key", {
|
|
830
|
+
get: w,
|
|
785
831
|
configurable: !0
|
|
786
832
|
});
|
|
787
833
|
}
|
|
788
834
|
}
|
|
789
|
-
function
|
|
835
|
+
function qe(t, m) {
|
|
790
836
|
{
|
|
791
|
-
var
|
|
792
|
-
|
|
837
|
+
var w = function() {
|
|
838
|
+
le || (le = !0, D("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", m));
|
|
793
839
|
};
|
|
794
|
-
|
|
795
|
-
get:
|
|
840
|
+
w.isReactWarning = !0, Object.defineProperty(t, "ref", {
|
|
841
|
+
get: w,
|
|
796
842
|
configurable: !0
|
|
797
843
|
});
|
|
798
844
|
}
|
|
799
845
|
}
|
|
800
|
-
var
|
|
801
|
-
var
|
|
846
|
+
var S = function(t, m, w, z, ae, se, J) {
|
|
847
|
+
var W = {
|
|
802
848
|
// This tag allows us to uniquely identify this as a React Element
|
|
803
849
|
$$typeof: a,
|
|
804
850
|
// Built-in properties that belong on the element
|
|
805
|
-
type:
|
|
806
|
-
key:
|
|
807
|
-
ref:
|
|
808
|
-
props:
|
|
851
|
+
type: t,
|
|
852
|
+
key: m,
|
|
853
|
+
ref: w,
|
|
854
|
+
props: J,
|
|
809
855
|
// Record the component responsible for creating this element.
|
|
810
|
-
_owner:
|
|
856
|
+
_owner: se
|
|
811
857
|
};
|
|
812
|
-
return
|
|
858
|
+
return W._store = {}, Object.defineProperty(W._store, "validated", {
|
|
813
859
|
configurable: !1,
|
|
814
860
|
enumerable: !1,
|
|
815
861
|
writable: !0,
|
|
816
862
|
value: !1
|
|
817
|
-
}), Object.defineProperty(
|
|
863
|
+
}), Object.defineProperty(W, "_self", {
|
|
818
864
|
configurable: !1,
|
|
819
865
|
enumerable: !1,
|
|
820
866
|
writable: !1,
|
|
821
|
-
value:
|
|
822
|
-
}), Object.defineProperty(
|
|
867
|
+
value: z
|
|
868
|
+
}), Object.defineProperty(W, "_source", {
|
|
823
869
|
configurable: !1,
|
|
824
870
|
enumerable: !1,
|
|
825
871
|
writable: !1,
|
|
826
|
-
value:
|
|
827
|
-
}), Object.freeze && (Object.freeze(
|
|
872
|
+
value: ae
|
|
873
|
+
}), Object.freeze && (Object.freeze(W.props), Object.freeze(W)), W;
|
|
828
874
|
};
|
|
829
|
-
function
|
|
875
|
+
function ue(t, m, w, z, ae) {
|
|
830
876
|
{
|
|
831
|
-
var
|
|
832
|
-
|
|
833
|
-
for (
|
|
834
|
-
|
|
835
|
-
if (
|
|
836
|
-
var
|
|
837
|
-
for (
|
|
838
|
-
|
|
877
|
+
var se, J = {}, W = null, Ie = null;
|
|
878
|
+
w !== void 0 && (_e(w), W = "" + w), Ae(m) && (_e(m.key), W = "" + m.key), Ne(m) && (Ie = m.ref, en(m, ae));
|
|
879
|
+
for (se in m)
|
|
880
|
+
we.call(m, se) && !x.hasOwnProperty(se) && (J[se] = m[se]);
|
|
881
|
+
if (t && t.defaultProps) {
|
|
882
|
+
var ve = t.defaultProps;
|
|
883
|
+
for (se in ve)
|
|
884
|
+
J[se] === void 0 && (J[se] = ve[se]);
|
|
839
885
|
}
|
|
840
|
-
if (
|
|
841
|
-
var
|
|
842
|
-
|
|
886
|
+
if (W || Ie) {
|
|
887
|
+
var ye = typeof t == "function" ? t.displayName || t.name || "Unknown" : t;
|
|
888
|
+
W && nn(J, ye), Ie && qe(J, ye);
|
|
843
889
|
}
|
|
844
|
-
return
|
|
890
|
+
return S(t, W, Ie, ae, z, F.current, J);
|
|
845
891
|
}
|
|
846
892
|
}
|
|
847
|
-
var
|
|
848
|
-
function $e(
|
|
849
|
-
if (
|
|
850
|
-
var
|
|
851
|
-
|
|
893
|
+
var xe = k.ReactCurrentOwner, ze = k.ReactDebugCurrentFrame;
|
|
894
|
+
function $e(t) {
|
|
895
|
+
if (t) {
|
|
896
|
+
var m = t._owner, w = fe(t.type, t._source, m ? m.type : null);
|
|
897
|
+
ze.setExtraStackFrame(w);
|
|
852
898
|
} else
|
|
853
|
-
|
|
899
|
+
ze.setExtraStackFrame(null);
|
|
854
900
|
}
|
|
855
|
-
var
|
|
856
|
-
|
|
857
|
-
function
|
|
858
|
-
return typeof
|
|
901
|
+
var Pe;
|
|
902
|
+
Pe = !1;
|
|
903
|
+
function Ke(t) {
|
|
904
|
+
return typeof t == "object" && t !== null && t.$$typeof === a;
|
|
859
905
|
}
|
|
860
|
-
function
|
|
906
|
+
function Qe() {
|
|
861
907
|
{
|
|
862
|
-
if (
|
|
863
|
-
var
|
|
864
|
-
if (
|
|
908
|
+
if (xe.current) {
|
|
909
|
+
var t = X(xe.current.type);
|
|
910
|
+
if (t)
|
|
865
911
|
return `
|
|
866
912
|
|
|
867
|
-
Check the render method of \`` +
|
|
913
|
+
Check the render method of \`` + t + "`.";
|
|
868
914
|
}
|
|
869
915
|
return "";
|
|
870
916
|
}
|
|
871
917
|
}
|
|
872
|
-
function
|
|
918
|
+
function Yn(t) {
|
|
873
919
|
return "";
|
|
874
920
|
}
|
|
875
|
-
var
|
|
876
|
-
function
|
|
921
|
+
var bn = {};
|
|
922
|
+
function Hn(t) {
|
|
877
923
|
{
|
|
878
|
-
var
|
|
879
|
-
if (!
|
|
880
|
-
var
|
|
881
|
-
|
|
924
|
+
var m = Qe();
|
|
925
|
+
if (!m) {
|
|
926
|
+
var w = typeof t == "string" ? t : t.displayName || t.name;
|
|
927
|
+
w && (m = `
|
|
882
928
|
|
|
883
|
-
Check the top-level render call using <` +
|
|
929
|
+
Check the top-level render call using <` + w + ">.");
|
|
884
930
|
}
|
|
885
|
-
return
|
|
931
|
+
return m;
|
|
886
932
|
}
|
|
887
933
|
}
|
|
888
|
-
function
|
|
934
|
+
function hn(t, m) {
|
|
889
935
|
{
|
|
890
|
-
if (!
|
|
936
|
+
if (!t._store || t._store.validated || t.key != null)
|
|
891
937
|
return;
|
|
892
|
-
|
|
893
|
-
var
|
|
894
|
-
if (
|
|
938
|
+
t._store.validated = !0;
|
|
939
|
+
var w = Hn(m);
|
|
940
|
+
if (bn[w])
|
|
895
941
|
return;
|
|
896
|
-
|
|
897
|
-
var
|
|
898
|
-
|
|
942
|
+
bn[w] = !0;
|
|
943
|
+
var z = "";
|
|
944
|
+
t && t._owner && t._owner !== xe.current && (z = " It was passed a child from " + X(t._owner.type) + "."), $e(t), D('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', w, z), $e(null);
|
|
899
945
|
}
|
|
900
946
|
}
|
|
901
|
-
function
|
|
947
|
+
function _n(t, m) {
|
|
902
948
|
{
|
|
903
|
-
if (typeof
|
|
949
|
+
if (typeof t != "object")
|
|
904
950
|
return;
|
|
905
|
-
if (
|
|
906
|
-
for (var
|
|
907
|
-
var
|
|
908
|
-
|
|
951
|
+
if (Be(t))
|
|
952
|
+
for (var w = 0; w < t.length; w++) {
|
|
953
|
+
var z = t[w];
|
|
954
|
+
Ke(z) && hn(z, m);
|
|
909
955
|
}
|
|
910
|
-
else if (
|
|
911
|
-
|
|
912
|
-
else if (
|
|
913
|
-
var
|
|
914
|
-
if (typeof
|
|
915
|
-
for (var
|
|
916
|
-
|
|
956
|
+
else if (Ke(t))
|
|
957
|
+
t._store && (t._store.validated = !0);
|
|
958
|
+
else if (t) {
|
|
959
|
+
var ae = j(t);
|
|
960
|
+
if (typeof ae == "function" && ae !== t.entries)
|
|
961
|
+
for (var se = ae.call(t), J; !(J = se.next()).done; )
|
|
962
|
+
Ke(J.value) && hn(J.value, m);
|
|
917
963
|
}
|
|
918
964
|
}
|
|
919
965
|
}
|
|
920
|
-
function
|
|
966
|
+
function Wn(t) {
|
|
921
967
|
{
|
|
922
|
-
var
|
|
923
|
-
if (
|
|
968
|
+
var m = t.type;
|
|
969
|
+
if (m == null || typeof m == "string")
|
|
924
970
|
return;
|
|
925
|
-
var
|
|
926
|
-
if (typeof
|
|
927
|
-
|
|
928
|
-
else if (typeof
|
|
971
|
+
var w;
|
|
972
|
+
if (typeof m == "function")
|
|
973
|
+
w = m.propTypes;
|
|
974
|
+
else if (typeof m == "object" && (m.$$typeof === d || // Note: Memo only checks outer props here.
|
|
929
975
|
// Inner props are checked in the reconciler.
|
|
930
|
-
|
|
931
|
-
|
|
976
|
+
m.$$typeof === f))
|
|
977
|
+
w = m.propTypes;
|
|
932
978
|
else
|
|
933
979
|
return;
|
|
934
|
-
if (
|
|
935
|
-
var
|
|
936
|
-
|
|
937
|
-
} else if (
|
|
938
|
-
|
|
939
|
-
var
|
|
940
|
-
|
|
980
|
+
if (w) {
|
|
981
|
+
var z = X(m);
|
|
982
|
+
ke(w, t.props, "prop", z, t);
|
|
983
|
+
} else if (m.PropTypes !== void 0 && !Pe) {
|
|
984
|
+
Pe = !0;
|
|
985
|
+
var ae = X(m);
|
|
986
|
+
D("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", ae || "Unknown");
|
|
941
987
|
}
|
|
942
|
-
typeof
|
|
988
|
+
typeof m.getDefaultProps == "function" && !m.getDefaultProps.isReactClassApproved && D("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
943
989
|
}
|
|
944
990
|
}
|
|
945
|
-
function
|
|
991
|
+
function Un(t) {
|
|
946
992
|
{
|
|
947
|
-
for (var
|
|
948
|
-
var
|
|
949
|
-
if (
|
|
950
|
-
$e(
|
|
993
|
+
for (var m = Object.keys(t.props), w = 0; w < m.length; w++) {
|
|
994
|
+
var z = m[w];
|
|
995
|
+
if (z !== "children" && z !== "key") {
|
|
996
|
+
$e(t), D("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", z), $e(null);
|
|
951
997
|
break;
|
|
952
998
|
}
|
|
953
999
|
}
|
|
954
|
-
|
|
1000
|
+
t.ref !== null && ($e(t), D("Invalid attribute `ref` supplied to `React.Fragment`."), $e(null));
|
|
955
1001
|
}
|
|
956
1002
|
}
|
|
957
|
-
var
|
|
958
|
-
function
|
|
1003
|
+
var xn = {};
|
|
1004
|
+
function yn(t, m, w, z, ae, se) {
|
|
959
1005
|
{
|
|
960
|
-
var
|
|
961
|
-
if (!
|
|
962
|
-
var
|
|
963
|
-
(
|
|
964
|
-
var
|
|
965
|
-
|
|
966
|
-
var
|
|
967
|
-
|
|
1006
|
+
var J = P(t);
|
|
1007
|
+
if (!J) {
|
|
1008
|
+
var W = "";
|
|
1009
|
+
(t === void 0 || typeof t == "object" && t !== null && Object.keys(t).length === 0) && (W += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
1010
|
+
var Ie = Yn();
|
|
1011
|
+
Ie ? W += Ie : W += Qe();
|
|
1012
|
+
var ve;
|
|
1013
|
+
t === null ? ve = "null" : Be(t) ? ve = "array" : t !== void 0 && t.$$typeof === a ? (ve = "<" + (X(t.type) || "Unknown") + " />", W = " Did you accidentally export a JSX literal instead of a component?") : ve = typeof t, D("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", ve, W);
|
|
968
1014
|
}
|
|
969
|
-
var
|
|
970
|
-
if (
|
|
971
|
-
return
|
|
972
|
-
if (
|
|
973
|
-
var
|
|
974
|
-
if (
|
|
975
|
-
if (
|
|
976
|
-
if (
|
|
977
|
-
for (var
|
|
978
|
-
|
|
979
|
-
Object.freeze && Object.freeze(
|
|
1015
|
+
var ye = ue(t, m, w, ae, se);
|
|
1016
|
+
if (ye == null)
|
|
1017
|
+
return ye;
|
|
1018
|
+
if (J) {
|
|
1019
|
+
var Le = m.children;
|
|
1020
|
+
if (Le !== void 0)
|
|
1021
|
+
if (z)
|
|
1022
|
+
if (Be(Le)) {
|
|
1023
|
+
for (var Ue = 0; Ue < Le.length; Ue++)
|
|
1024
|
+
_n(Le[Ue], t);
|
|
1025
|
+
Object.freeze && Object.freeze(Le);
|
|
980
1026
|
} else
|
|
981
|
-
|
|
1027
|
+
D("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
982
1028
|
else
|
|
983
|
-
|
|
1029
|
+
_n(Le, t);
|
|
984
1030
|
}
|
|
985
|
-
if (
|
|
986
|
-
var
|
|
987
|
-
return
|
|
988
|
-
}),
|
|
989
|
-
if (!
|
|
990
|
-
var
|
|
991
|
-
|
|
1031
|
+
if (we.call(m, "key")) {
|
|
1032
|
+
var Ye = X(t), Fe = Object.keys(m).filter(function(Qn) {
|
|
1033
|
+
return Qn !== "key";
|
|
1034
|
+
}), an = Fe.length > 0 ? "{key: someKey, " + Fe.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
1035
|
+
if (!xn[Ye + an]) {
|
|
1036
|
+
var qn = Fe.length > 0 ? "{" + Fe.join(": ..., ") + ": ...}" : "{}";
|
|
1037
|
+
D(`A props object containing a "key" prop is being spread into JSX:
|
|
992
1038
|
let props = %s;
|
|
993
1039
|
<%s {...props} />
|
|
994
1040
|
React keys must be passed directly to JSX without using spread:
|
|
995
1041
|
let props = %s;
|
|
996
|
-
<%s key={someKey} {...props} />`,
|
|
1042
|
+
<%s key={someKey} {...props} />`, an, Ye, qn, Ye), xn[Ye + an] = !0;
|
|
997
1043
|
}
|
|
998
1044
|
}
|
|
999
|
-
return
|
|
1045
|
+
return t === s ? Un(ye) : Wn(ye), ye;
|
|
1000
1046
|
}
|
|
1001
1047
|
}
|
|
1002
|
-
function
|
|
1003
|
-
return
|
|
1048
|
+
function Kn(t, m, w) {
|
|
1049
|
+
return yn(t, m, w, !0);
|
|
1004
1050
|
}
|
|
1005
|
-
function
|
|
1006
|
-
return
|
|
1051
|
+
function Xn(t, m, w) {
|
|
1052
|
+
return yn(t, m, w, !1);
|
|
1007
1053
|
}
|
|
1008
|
-
var
|
|
1009
|
-
|
|
1010
|
-
}()),
|
|
1054
|
+
var Gn = Xn, Jn = Kn;
|
|
1055
|
+
Ge.Fragment = s, Ge.jsx = Gn, Ge.jsxs = Jn;
|
|
1056
|
+
}()), Ge;
|
|
1011
1057
|
}
|
|
1012
|
-
process.env.NODE_ENV === "production" ?
|
|
1013
|
-
var
|
|
1014
|
-
function
|
|
1058
|
+
process.env.NODE_ENV === "production" ? fn.exports = Mn() : fn.exports = ea();
|
|
1059
|
+
var r = fn.exports;
|
|
1060
|
+
function Tn(e, a) {
|
|
1015
1061
|
if (!a)
|
|
1016
1062
|
return e;
|
|
1017
1063
|
if (Array.isArray(e) || typeof e != "object" || e === null)
|
|
1018
1064
|
return a ?? e;
|
|
1019
|
-
const
|
|
1020
|
-
for (const l of Object.keys(
|
|
1021
|
-
const
|
|
1022
|
-
if (Array.isArray(
|
|
1023
|
-
|
|
1065
|
+
const n = { ...e }, s = a;
|
|
1066
|
+
for (const l of Object.keys(s)) {
|
|
1067
|
+
const i = e[l], g = s[l];
|
|
1068
|
+
if (Array.isArray(i)) {
|
|
1069
|
+
n[l] = g ?? i;
|
|
1024
1070
|
continue;
|
|
1025
1071
|
}
|
|
1026
|
-
if (typeof
|
|
1027
|
-
|
|
1072
|
+
if (typeof i == "object" && i !== null && typeof g == "object" && g !== null) {
|
|
1073
|
+
n[l] = Tn(i, g);
|
|
1028
1074
|
continue;
|
|
1029
1075
|
}
|
|
1030
|
-
|
|
1076
|
+
n[l] = g ?? i;
|
|
1031
1077
|
}
|
|
1032
|
-
return
|
|
1078
|
+
return n;
|
|
1033
1079
|
}
|
|
1034
|
-
const
|
|
1035
|
-
function
|
|
1080
|
+
const na = [/^#/, /^rgb/, /^hsl/, /^var\(/], aa = [50, 100, 200, 300, 400, 500, 600, 700, 800, 900];
|
|
1081
|
+
function ta(e) {
|
|
1036
1082
|
if (!e)
|
|
1037
1083
|
return;
|
|
1038
1084
|
const a = Number(e);
|
|
1039
|
-
if (
|
|
1085
|
+
if (aa.includes(a))
|
|
1040
1086
|
return a;
|
|
1041
1087
|
}
|
|
1042
|
-
function
|
|
1043
|
-
return
|
|
1088
|
+
function ra(e) {
|
|
1089
|
+
return na.some((a) => a.test(e));
|
|
1044
1090
|
}
|
|
1045
|
-
function
|
|
1046
|
-
if (
|
|
1091
|
+
function E(e, a) {
|
|
1092
|
+
if (ra(a))
|
|
1047
1093
|
return a;
|
|
1048
1094
|
if (e.colors.custom[a])
|
|
1049
1095
|
return e.colors.custom[a];
|
|
1050
|
-
const [
|
|
1096
|
+
const [n, s] = a.split("."), l = e.colors.scale[n];
|
|
1051
1097
|
if (l) {
|
|
1052
|
-
const
|
|
1053
|
-
return
|
|
1098
|
+
const i = ta(s);
|
|
1099
|
+
return i ? l[i] : l[600];
|
|
1054
1100
|
}
|
|
1055
1101
|
return a;
|
|
1056
1102
|
}
|
|
1057
|
-
function
|
|
1058
|
-
const
|
|
1103
|
+
function la(e, a) {
|
|
1104
|
+
const n = e.modes[a];
|
|
1059
1105
|
return {
|
|
1060
|
-
background:
|
|
1061
|
-
foreground:
|
|
1062
|
-
surface:
|
|
1063
|
-
border:
|
|
1064
|
-
muted:
|
|
1106
|
+
background: E(e, n.background),
|
|
1107
|
+
foreground: E(e, n.foreground),
|
|
1108
|
+
surface: E(e, n.surface),
|
|
1109
|
+
border: E(e, n.border),
|
|
1110
|
+
muted: E(e, n.muted)
|
|
1065
1111
|
};
|
|
1066
1112
|
}
|
|
1067
|
-
function
|
|
1113
|
+
function M(e, a) {
|
|
1068
1114
|
if (a)
|
|
1069
1115
|
return e[a] ?? a;
|
|
1070
1116
|
}
|
|
1071
|
-
function
|
|
1117
|
+
function ia(e, a) {
|
|
1072
1118
|
if (a !== void 0)
|
|
1073
1119
|
return String(typeof a == "number" ? a : e.typography.weights[a] ?? a);
|
|
1074
1120
|
}
|
|
1075
|
-
function
|
|
1076
|
-
var
|
|
1077
|
-
const
|
|
1078
|
-
|
|
1079
|
-
for (const [
|
|
1080
|
-
for (const [
|
|
1081
|
-
|
|
1082
|
-
for (const [
|
|
1083
|
-
|
|
1084
|
-
for (const [
|
|
1085
|
-
|
|
1086
|
-
for (const [
|
|
1087
|
-
|
|
1088
|
-
for (const [
|
|
1089
|
-
|
|
1090
|
-
for (const [
|
|
1091
|
-
|
|
1121
|
+
function sa(e, a) {
|
|
1122
|
+
var j, k, D, O, C, T;
|
|
1123
|
+
const n = {}, s = la(e, a);
|
|
1124
|
+
n["--luna-background"] = s.background, n["--luna-foreground"] = s.foreground, n["--luna-surface"] = s.surface, n["--luna-border"] = s.border, n["--luna-muted"] = s.muted, n["--luna-font-family"] = e.typography.fontFamily;
|
|
1125
|
+
for (const [N, p] of Object.entries(e.colors.scale))
|
|
1126
|
+
for (const [Y, K] of Object.entries(p))
|
|
1127
|
+
n[`--luna-color-${N}-${Y}`] = K;
|
|
1128
|
+
for (const [N, p] of Object.entries(e.colors.custom))
|
|
1129
|
+
n[`--luna-color-${N}`] = E(e, p);
|
|
1130
|
+
for (const [N, p] of Object.entries(e.spacing))
|
|
1131
|
+
n[`--luna-space-${N}`] = p;
|
|
1132
|
+
for (const [N, p] of Object.entries(e.radii))
|
|
1133
|
+
n[`--luna-radius-${N}`] = p;
|
|
1134
|
+
for (const [N, p] of Object.entries(e.shadows))
|
|
1135
|
+
n[`--luna-shadow-${N}`] = p;
|
|
1136
|
+
for (const [N, p] of Object.entries(e.motion))
|
|
1137
|
+
n[`--luna-motion-${N}`] = p;
|
|
1092
1138
|
const l = e.components.button;
|
|
1093
|
-
l != null && l.defaultSize && (
|
|
1094
|
-
const
|
|
1095
|
-
if (
|
|
1096
|
-
for (const [
|
|
1097
|
-
|
|
1098
|
-
const
|
|
1099
|
-
|
|
1100
|
-
const
|
|
1101
|
-
if (
|
|
1102
|
-
for (const [
|
|
1103
|
-
|
|
1104
|
-
const
|
|
1105
|
-
|
|
1106
|
-
const
|
|
1107
|
-
|
|
1108
|
-
const
|
|
1109
|
-
|
|
1110
|
-
const
|
|
1111
|
-
|
|
1112
|
-
const
|
|
1113
|
-
|
|
1114
|
-
const
|
|
1115
|
-
if (
|
|
1116
|
-
for (const [
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
const
|
|
1121
|
-
|
|
1139
|
+
l != null && l.defaultSize && (n["--luna-btn-size-default"] = l.defaultSize), l != null && l.defaultIconDirection && (n["--luna-btn-icon-direction-default"] = l.defaultIconDirection), l != null && l.radius && (n["--luna-btn-radius"] = M(e.radii, l.radius) ?? l.radius), l != null && l.fontWeight && (n["--luna-btn-font-weight"] = String(l.fontWeight));
|
|
1140
|
+
const i = (j = l == null ? void 0 : l.modes) == null ? void 0 : j[a];
|
|
1141
|
+
if (i != null && i.bg && (n["--luna-btn-bg-default"] = E(e, i.bg)), i != null && i.fg && (n["--luna-btn-fg-default"] = E(e, i.fg)), i != null && i.hoverBg && (n["--luna-btn-hover-bg"] = E(e, i.hoverBg)), i != null && i.outlineFg && (n["--luna-btn-outline-fg"] = E(e, i.outlineFg)), i != null && i.outlineBorder && (n["--luna-btn-outline-border"] = E(e, i.outlineBorder)), i != null && i.outlineHoverBg && (n["--luna-btn-outline-hover-bg"] = E(e, i.outlineHoverBg)), i != null && i.flatFg && (n["--luna-btn-flat-fg"] = E(e, i.flatFg)), i != null && i.infoFg && (n["--luna-btn-info-fg"] = E(e, i.infoFg)), i != null && i.infoHoverFg && (n["--luna-btn-info-hover-fg"] = E(e, i.infoHoverFg)), l != null && l.sizes)
|
|
1142
|
+
for (const [N, p] of Object.entries(l.sizes))
|
|
1143
|
+
p.paddingX && (n[`--luna-btn-size-${N}-padding-x`] = M(e.spacing, p.paddingX) ?? p.paddingX), p.paddingY && (n[`--luna-btn-size-${N}-padding-y`] = M(e.spacing, p.paddingY) ?? p.paddingY), p.fontSize && (n[`--luna-btn-size-${N}-font-size`] = M(e.typography.sizes, p.fontSize) ?? p.fontSize), p.minHeight && (n[`--luna-btn-size-${N}-min-height`] = M(e.spacing, p.minHeight) ?? p.minHeight), p.gap && (n[`--luna-btn-size-${N}-gap`] = M(e.spacing, p.gap) ?? p.gap), p.iconSize && (n[`--luna-btn-size-${N}-icon-size`] = M(e.typography.sizes, p.iconSize) ?? p.iconSize);
|
|
1144
|
+
const g = e.components.text;
|
|
1145
|
+
g != null && g.defaultVariant && (n["--luna-text-variant-default"] = g.defaultVariant);
|
|
1146
|
+
const v = (k = g == null ? void 0 : g.modes) == null ? void 0 : k[a];
|
|
1147
|
+
if (v != null && v.fg && (n["--luna-text-fg"] = E(e, v.fg)), v != null && v.mutedFg && (n["--luna-text-muted-fg"] = E(e, v.mutedFg)), v != null && v.surfaceBg && (n["--luna-text-surface-bg"] = E(e, v.surfaceBg)), v != null && v.surfaceBorder && (n["--luna-text-surface-border"] = E(e, v.surfaceBorder)), g != null && g.variants)
|
|
1148
|
+
for (const [N, p] of Object.entries(g.variants))
|
|
1149
|
+
p.fontSize && (n[`--luna-text-variant-${N}-font-size`] = M(e.typography.sizes, p.fontSize) ?? p.fontSize), p.fontWeight !== void 0 && (n[`--luna-text-variant-${N}-font-weight`] = ia(e, p.fontWeight) ?? String(p.fontWeight)), p.lineHeight && (n[`--luna-text-variant-${N}-line-height`] = M(e.typography.lineHeights, p.lineHeight) ?? p.lineHeight), p.letterSpacing && (n[`--luna-text-variant-${N}-letter-spacing`] = p.letterSpacing), p.textTransform && (n[`--luna-text-variant-${N}-text-transform`] = p.textTransform);
|
|
1150
|
+
const d = e.components.card;
|
|
1151
|
+
d != null && d.defaultPadding && (n["--luna-card-padding-default"] = M(e.spacing, d.defaultPadding) ?? d.defaultPadding), d != null && d.defaultGap && (n["--luna-card-gap-default"] = M(e.spacing, d.defaultGap) ?? d.defaultGap), d != null && d.radius && (n["--luna-card-radius"] = M(e.radii, d.radius) ?? d.radius);
|
|
1152
|
+
const _ = (D = d == null ? void 0 : d.modes) == null ? void 0 : D[a];
|
|
1153
|
+
_ != null && _.bg && (n["--luna-card-bg"] = E(e, _.bg)), _ != null && _.fg && (n["--luna-card-fg"] = E(e, _.fg)), _ != null && _.border && (n["--luna-card-border"] = E(e, _.border)), _ != null && _.shadow && (n["--luna-card-shadow"] = M(e.shadows, _.shadow) ?? E(e, _.shadow)), _ != null && _.elevatedShadow && (n["--luna-card-elevated-shadow"] = M(e.shadows, _.elevatedShadow) ?? E(e, _.elevatedShadow)), _ != null && _.hoverBorder && (n["--luna-card-hover-border"] = E(e, _.hoverBorder)), _ != null && _.hoverShadow && (n["--luna-card-hover-shadow"] = M(e.shadows, _.hoverShadow) ?? E(e, _.hoverShadow));
|
|
1154
|
+
const b = e.components.divider;
|
|
1155
|
+
b != null && b.defaultSpacing && (n["--luna-divider-spacing-default"] = M(e.spacing, b.defaultSpacing) ?? b.defaultSpacing), b != null && b.defaultInset && (n["--luna-divider-inset-default"] = M(e.spacing, b.defaultInset) ?? b.defaultInset);
|
|
1156
|
+
const f = (O = b == null ? void 0 : b.modes) == null ? void 0 : O[a];
|
|
1157
|
+
f != null && f.default && (n["--luna-divider-default"] = E(e, f.default)), f != null && f.muted && (n["--luna-divider-muted"] = E(e, f.muted)), f != null && f.strong && (n["--luna-divider-strong"] = E(e, f.strong)), f != null && f.labelBg && (n["--luna-divider-label-bg"] = E(e, f.labelBg)), f != null && f.labelFg && (n["--luna-divider-label-fg"] = E(e, f.labelFg));
|
|
1158
|
+
const y = e.components.input;
|
|
1159
|
+
y != null && y.defaultSize && (n["--luna-input-size-default"] = y.defaultSize), y != null && y.radius && (n["--luna-input-radius"] = M(e.radii, y.radius) ?? y.radius);
|
|
1160
|
+
const o = (C = y == null ? void 0 : y.modes) == null ? void 0 : C[a];
|
|
1161
|
+
if (o != null && o.bg && (n["--luna-input-bg"] = E(e, o.bg)), o != null && o.fg && (n["--luna-input-fg"] = E(e, o.fg)), o != null && o.border && (n["--luna-input-border"] = E(e, o.border)), o != null && o.hoverBorder && (n["--luna-input-hover-border"] = E(e, o.hoverBorder)), o != null && o.focusBorder && (n["--luna-input-focus-border"] = E(e, o.focusBorder)), o != null && o.focusRing && (n["--luna-input-focus-ring"] = o.focusRing), o != null && o.placeholder && (n["--luna-input-placeholder"] = E(e, o.placeholder)), o != null && o.disabledBg && (n["--luna-input-disabled-bg"] = E(e, o.disabledBg)), o != null && o.disabledFg && (n["--luna-input-disabled-fg"] = E(e, o.disabledFg)), o != null && o.disabledBorder && (n["--luna-input-disabled-border"] = E(e, o.disabledBorder)), o != null && o.errorBorder && (n["--luna-input-error-border"] = E(e, o.errorBorder)), o != null && o.errorFocusRing && (n["--luna-input-error-focus-ring"] = o.errorFocusRing), o != null && o.helpFg && (n["--luna-input-help-fg"] = E(e, o.helpFg)), o != null && o.errorFg && (n["--luna-input-error-fg"] = E(e, o.errorFg)), o != null && o.labelFg && (n["--luna-input-label-fg"] = E(e, o.labelFg)), y != null && y.sizes)
|
|
1162
|
+
for (const [N, p] of Object.entries(y.sizes))
|
|
1163
|
+
p.minHeight && (n[`--luna-input-size-${N}-min-height`] = M(e.spacing, p.minHeight) ?? p.minHeight), p.paddingX && (n[`--luna-input-size-${N}-padding-x`] = M(e.spacing, p.paddingX) ?? p.paddingX), p.paddingY && (n[`--luna-input-size-${N}-padding-y`] = M(e.spacing, p.paddingY) ?? p.paddingY), p.fontSize && (n[`--luna-input-size-${N}-font-size`] = M(e.typography.sizes, p.fontSize) ?? p.fontSize), p.gap && (n[`--luna-input-size-${N}-gap`] = M(e.spacing, p.gap) ?? p.gap);
|
|
1164
|
+
const h = e.components.checkbox;
|
|
1165
|
+
h != null && h.radius && (n["--luna-checkbox-radius"] = M(e.radii, h.radius) ?? h.radius), h != null && h.boxSize && (n["--luna-checkbox-current-box-size"] = M(e.spacing, h.boxSize) ?? h.boxSize), h != null && h.gap && (n["--luna-checkbox-current-gap"] = M(e.spacing, h.gap) ?? h.gap), h != null && h.offsetY && (n["--luna-checkbox-current-offset-y"] = M(e.spacing, h.offsetY) ?? h.offsetY);
|
|
1166
|
+
const u = (T = h == null ? void 0 : h.modes) == null ? void 0 : T[a];
|
|
1167
|
+
return u != null && u.bg && (n["--luna-checkbox-bg"] = E(e, u.bg)), u != null && u.border && (n["--luna-checkbox-border"] = E(e, u.border)), u != null && u.hoverBorder && (n["--luna-checkbox-hover-border"] = E(e, u.hoverBorder)), u != null && u.checkedBg && (n["--luna-checkbox-checked-bg"] = E(e, u.checkedBg)), u != null && u.checkedBorder && (n["--luna-checkbox-checked-border"] = E(e, u.checkedBorder)), u != null && u.checkFg && (n["--luna-checkbox-check-fg"] = E(e, u.checkFg)), u != null && u.focusBorder && (n["--luna-checkbox-focus-border"] = E(e, u.focusBorder)), u != null && u.focusRing && (n["--luna-checkbox-focus-ring"] = u.focusRing), u != null && u.disabledBg && (n["--luna-checkbox-disabled-bg"] = E(e, u.disabledBg)), u != null && u.disabledBorder && (n["--luna-checkbox-disabled-border"] = E(e, u.disabledBorder)), u != null && u.disabledFg && (n["--luna-checkbox-disabled-fg"] = E(e, u.disabledFg)), u != null && u.errorBorder && (n["--luna-checkbox-error-border"] = E(e, u.errorBorder)), u != null && u.helpFg && (n["--luna-checkbox-help-fg"] = E(e, u.helpFg)), u != null && u.errorFg && (n["--luna-checkbox-error-fg"] = E(e, u.errorFg)), u != null && u.labelFg && (n["--luna-checkbox-label-fg"] = E(e, u.labelFg)), u != null && u.descriptionFg && (n["--luna-checkbox-description-fg"] = E(e, u.descriptionFg)), u != null && u.disabledLabelFg && (n["--luna-checkbox-disabled-label-fg"] = E(
|
|
1168
|
+
e,
|
|
1169
|
+
u.disabledLabelFg
|
|
1170
|
+
)), n;
|
|
1171
|
+
}
|
|
1172
|
+
const On = c.createContext(void 0);
|
|
1173
|
+
function Ma({
|
|
1122
1174
|
children: e,
|
|
1123
1175
|
mode: a,
|
|
1124
|
-
theme:
|
|
1125
|
-
colors:
|
|
1176
|
+
theme: n,
|
|
1177
|
+
colors: s,
|
|
1126
1178
|
className: l,
|
|
1127
|
-
style:
|
|
1179
|
+
style: i
|
|
1128
1180
|
}) {
|
|
1129
|
-
const [
|
|
1181
|
+
const [g, v] = c.useState(
|
|
1130
1182
|
a ?? "light"
|
|
1131
1183
|
);
|
|
1132
|
-
|
|
1133
|
-
a &&
|
|
1184
|
+
c.useEffect(() => {
|
|
1185
|
+
a && v(a);
|
|
1134
1186
|
}, [a]);
|
|
1135
|
-
const
|
|
1136
|
-
const
|
|
1137
|
-
return !
|
|
1138
|
-
...
|
|
1187
|
+
const d = c.useMemo(() => {
|
|
1188
|
+
const f = Tn(Zn, n);
|
|
1189
|
+
return !s || Object.keys(s).length === 0 ? f : {
|
|
1190
|
+
...f,
|
|
1139
1191
|
colors: {
|
|
1140
|
-
...
|
|
1192
|
+
...f.colors,
|
|
1141
1193
|
custom: {
|
|
1142
|
-
...
|
|
1143
|
-
...
|
|
1194
|
+
...f.colors.custom,
|
|
1195
|
+
...s
|
|
1144
1196
|
}
|
|
1145
1197
|
}
|
|
1146
1198
|
};
|
|
1147
|
-
}, [
|
|
1148
|
-
() =>
|
|
1149
|
-
[
|
|
1150
|
-
),
|
|
1151
|
-
() => ({ theme:
|
|
1152
|
-
[g, _
|
|
1199
|
+
}, [n, s]), _ = c.useMemo(
|
|
1200
|
+
() => sa(d, g),
|
|
1201
|
+
[d, g]
|
|
1202
|
+
), b = c.useMemo(
|
|
1203
|
+
() => ({ theme: d, mode: g, vars: _, setMode: v }),
|
|
1204
|
+
[d, g, _]
|
|
1153
1205
|
);
|
|
1154
|
-
return /* @__PURE__ */
|
|
1206
|
+
return /* @__PURE__ */ r.jsx(On.Provider, { value: b, children: /* @__PURE__ */ r.jsx("div", { "data-luna-theme": !0, "data-luna-mode": g, className: l, style: { ..._, ...i }, children: e }) });
|
|
1155
1207
|
}
|
|
1156
|
-
function
|
|
1157
|
-
const e =
|
|
1208
|
+
function Re() {
|
|
1209
|
+
const e = c.useContext(On);
|
|
1158
1210
|
if (!e)
|
|
1159
1211
|
throw new Error("useTheme must be used within ThemeProvider");
|
|
1160
1212
|
return e;
|
|
1161
1213
|
}
|
|
1162
|
-
const
|
|
1214
|
+
const ua = {
|
|
1163
1215
|
bounce: "bounce 3s infinite",
|
|
1164
1216
|
wiggle: "wiggle 4s infinite",
|
|
1165
1217
|
pulse: "pulse 2s infinite"
|
|
1166
1218
|
};
|
|
1167
|
-
function
|
|
1219
|
+
function oa(e) {
|
|
1168
1220
|
return e.filter(Boolean).join(" ");
|
|
1169
1221
|
}
|
|
1170
|
-
function
|
|
1222
|
+
function ca(e, a) {
|
|
1171
1223
|
if (e)
|
|
1172
|
-
return
|
|
1224
|
+
return E(a, e);
|
|
1173
1225
|
}
|
|
1174
|
-
function
|
|
1226
|
+
function da(e) {
|
|
1175
1227
|
if (!e)
|
|
1176
1228
|
return;
|
|
1177
|
-
const
|
|
1178
|
-
return !
|
|
1229
|
+
const n = (ua[e] ?? e).trim(), [s, ...l] = n.split(/\s+/);
|
|
1230
|
+
return !s || l.length < 2 ? void 0 : [s === "lunarPulse" ? "luna-button-lunar-pulse" : `luna-button-${s}`, ...l].join(" ");
|
|
1179
1231
|
}
|
|
1180
|
-
const
|
|
1232
|
+
const wn = c.forwardRef(
|
|
1181
1233
|
function({
|
|
1182
1234
|
absolute: a,
|
|
1183
|
-
animation:
|
|
1184
|
-
block:
|
|
1235
|
+
animation: n,
|
|
1236
|
+
block: s,
|
|
1185
1237
|
bottom: l,
|
|
1186
|
-
children:
|
|
1187
|
-
className:
|
|
1188
|
-
color:
|
|
1189
|
-
dark:
|
|
1190
|
-
depressed:
|
|
1191
|
-
disabled:
|
|
1192
|
-
fab:
|
|
1193
|
-
fixed:
|
|
1194
|
-
flat:
|
|
1195
|
-
icon:
|
|
1196
|
-
iconDirection:
|
|
1197
|
-
iconName:
|
|
1198
|
-
info:
|
|
1199
|
-
left:
|
|
1200
|
-
light:
|
|
1201
|
-
loading:
|
|
1202
|
-
loadingAnimation:
|
|
1203
|
-
outline:
|
|
1204
|
-
right:
|
|
1205
|
-
rounded:
|
|
1238
|
+
children: i,
|
|
1239
|
+
className: g,
|
|
1240
|
+
color: v,
|
|
1241
|
+
dark: d,
|
|
1242
|
+
depressed: _,
|
|
1243
|
+
disabled: b,
|
|
1244
|
+
fab: f,
|
|
1245
|
+
fixed: y,
|
|
1246
|
+
flat: o,
|
|
1247
|
+
icon: h,
|
|
1248
|
+
iconDirection: u,
|
|
1249
|
+
iconName: j,
|
|
1250
|
+
info: k,
|
|
1251
|
+
left: D,
|
|
1252
|
+
light: O,
|
|
1253
|
+
loading: C,
|
|
1254
|
+
loadingAnimation: T = "lunar",
|
|
1255
|
+
outline: N,
|
|
1256
|
+
right: p,
|
|
1257
|
+
rounded: Y,
|
|
1206
1258
|
size: K,
|
|
1207
|
-
style:
|
|
1208
|
-
top:
|
|
1209
|
-
type:
|
|
1210
|
-
value:
|
|
1259
|
+
style: P,
|
|
1260
|
+
top: Q,
|
|
1261
|
+
type: H = "button",
|
|
1262
|
+
value: X,
|
|
1211
1263
|
...ee
|
|
1212
|
-
},
|
|
1213
|
-
var
|
|
1214
|
-
const { theme:
|
|
1264
|
+
}, ce) {
|
|
1265
|
+
var re, de;
|
|
1266
|
+
const { theme: oe } = Re(), me = K ?? ((re = oe.components.button) == null ? void 0 : re.defaultSize) ?? "medium", pe = u ?? ((de = oe.components.button) == null ? void 0 : de.defaultIconDirection) ?? "right", Z = ca(v, oe), ge = da(n), q = h ?? (j ? /* @__PURE__ */ r.jsx("span", { children: j }) : null), L = i ?? X, A = q && pe === "left", ne = q && pe === "right", te = oa([
|
|
1215
1267
|
"luna-button",
|
|
1216
|
-
|
|
1217
|
-
!
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
!
|
|
1221
|
-
!
|
|
1222
|
-
!
|
|
1223
|
-
!
|
|
1224
|
-
!
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
]),
|
|
1229
|
-
...
|
|
1230
|
-
...
|
|
1231
|
-
...
|
|
1268
|
+
y && "luna-button--fixed",
|
|
1269
|
+
!y && a && "luna-button--absolute",
|
|
1270
|
+
s && "luna-button--block",
|
|
1271
|
+
k && "luna-button--info",
|
|
1272
|
+
!k && N && "luna-button--outline",
|
|
1273
|
+
!k && o && "luna-button--flat",
|
|
1274
|
+
!k && _ && "luna-button--depressed",
|
|
1275
|
+
!k && !f && Y && "luna-button--rounded",
|
|
1276
|
+
!k && f && "luna-button--fab",
|
|
1277
|
+
O && "luna-button--light",
|
|
1278
|
+
d && "luna-button--dark",
|
|
1279
|
+
g
|
|
1280
|
+
]), $ = {
|
|
1281
|
+
...ge ? { animation: ge } : {},
|
|
1282
|
+
...Z ? k ? { "--luna-btn-info-color": Z } : { "--luna-btn-bg": Z } : {},
|
|
1283
|
+
...P
|
|
1232
1284
|
};
|
|
1233
|
-
return /* @__PURE__ */
|
|
1285
|
+
return /* @__PURE__ */ r.jsxs(
|
|
1234
1286
|
"button",
|
|
1235
1287
|
{
|
|
1236
1288
|
...ee,
|
|
1237
|
-
ref:
|
|
1238
|
-
type:
|
|
1239
|
-
className:
|
|
1240
|
-
"aria-busy":
|
|
1241
|
-
"data-disabled":
|
|
1242
|
-
"data-icon-direction":
|
|
1243
|
-
"data-loading":
|
|
1244
|
-
"data-loading-animation":
|
|
1245
|
-
"data-size":
|
|
1246
|
-
disabled:
|
|
1247
|
-
style:
|
|
1289
|
+
ref: ce,
|
|
1290
|
+
type: H,
|
|
1291
|
+
className: te,
|
|
1292
|
+
"aria-busy": C ? "true" : void 0,
|
|
1293
|
+
"data-disabled": b ? "true" : void 0,
|
|
1294
|
+
"data-icon-direction": pe,
|
|
1295
|
+
"data-loading": C ? "true" : void 0,
|
|
1296
|
+
"data-loading-animation": C ? T : void 0,
|
|
1297
|
+
"data-size": me,
|
|
1298
|
+
disabled: b,
|
|
1299
|
+
style: $,
|
|
1248
1300
|
children: [
|
|
1249
|
-
|
|
1250
|
-
/* @__PURE__ */
|
|
1251
|
-
|
|
1252
|
-
/* @__PURE__ */
|
|
1253
|
-
/* @__PURE__ */
|
|
1254
|
-
/* @__PURE__ */
|
|
1255
|
-
/* @__PURE__ */
|
|
1256
|
-
/* @__PURE__ */
|
|
1301
|
+
A ? /* @__PURE__ */ r.jsx("span", { className: "luna-button__icon", children: q }) : null,
|
|
1302
|
+
/* @__PURE__ */ r.jsx("span", { className: "luna-button__content", children: L }),
|
|
1303
|
+
C ? /* @__PURE__ */ r.jsx("span", { "aria-hidden": "true", className: "luna-button__loader", children: T === "loading-star" ? /* @__PURE__ */ r.jsx("span", { className: "luna-button__loader-star" }) : /* @__PURE__ */ r.jsxs("span", { className: "luna-button__loader-phases", children: [
|
|
1304
|
+
/* @__PURE__ */ r.jsx("span", { className: "luna-button__moon luna-button__moon--new" }),
|
|
1305
|
+
/* @__PURE__ */ r.jsx("span", { className: "luna-button__moon luna-button__moon--waxing" }),
|
|
1306
|
+
/* @__PURE__ */ r.jsx("span", { className: "luna-button__moon luna-button__moon--full" }),
|
|
1307
|
+
/* @__PURE__ */ r.jsx("span", { className: "luna-button__moon luna-button__moon--waning" }),
|
|
1308
|
+
/* @__PURE__ */ r.jsx("span", { className: "luna-button__moon luna-button__moon--faint" })
|
|
1257
1309
|
] }) }) : null,
|
|
1258
|
-
|
|
1310
|
+
ne ? /* @__PURE__ */ r.jsx("span", { className: "luna-button__icon", children: q }) : null
|
|
1259
1311
|
]
|
|
1260
1312
|
}
|
|
1261
1313
|
);
|
|
1262
1314
|
}
|
|
1263
|
-
),
|
|
1315
|
+
), Nn = ["xs", "sm", "md", "lg", "xl"], kn = {
|
|
1264
1316
|
mobile: "xs",
|
|
1265
1317
|
tablet: "md",
|
|
1266
1318
|
desktop: "lg"
|
|
1267
|
-
},
|
|
1319
|
+
}, fa = {
|
|
1268
1320
|
start: "flex-start",
|
|
1269
1321
|
center: "center",
|
|
1270
1322
|
end: "flex-end",
|
|
1271
1323
|
between: "space-between",
|
|
1272
1324
|
around: "space-around",
|
|
1273
1325
|
evenly: "space-evenly"
|
|
1274
|
-
},
|
|
1326
|
+
}, ga = {
|
|
1275
1327
|
start: "flex-start",
|
|
1276
1328
|
center: "center",
|
|
1277
1329
|
end: "flex-end",
|
|
1278
1330
|
stretch: "stretch",
|
|
1279
1331
|
baseline: "baseline"
|
|
1280
1332
|
};
|
|
1281
|
-
function
|
|
1333
|
+
function gn(e) {
|
|
1282
1334
|
return e.filter(Boolean).join(" ");
|
|
1283
1335
|
}
|
|
1284
|
-
function
|
|
1336
|
+
function mn(e, a) {
|
|
1285
1337
|
if (e)
|
|
1286
|
-
return
|
|
1338
|
+
return M(a.spacing, e) ?? e;
|
|
1287
1339
|
}
|
|
1288
|
-
function
|
|
1340
|
+
function ma(e) {
|
|
1289
1341
|
if (typeof e == "number" || e === "auto")
|
|
1290
1342
|
return { xs: e, sm: e, md: e, lg: e, xl: e };
|
|
1291
1343
|
if (!e)
|
|
1292
1344
|
return { xs: 12, sm: 12, md: 12, lg: 12, xl: 12 };
|
|
1293
1345
|
const a = {};
|
|
1294
|
-
for (const [l,
|
|
1295
|
-
if (typeof
|
|
1346
|
+
for (const [l, i] of Object.entries(e)) {
|
|
1347
|
+
if (typeof i != "number" && i !== "auto")
|
|
1296
1348
|
continue;
|
|
1297
|
-
const
|
|
1298
|
-
|
|
1349
|
+
const g = l in kn ? kn[l] : l;
|
|
1350
|
+
Nn.includes(g) && (a[g] = i);
|
|
1299
1351
|
}
|
|
1300
|
-
let
|
|
1301
|
-
const
|
|
1302
|
-
xs:
|
|
1303
|
-
sm:
|
|
1304
|
-
md:
|
|
1305
|
-
lg:
|
|
1306
|
-
xl:
|
|
1352
|
+
let n = a.xs ?? 12;
|
|
1353
|
+
const s = {
|
|
1354
|
+
xs: n,
|
|
1355
|
+
sm: n,
|
|
1356
|
+
md: n,
|
|
1357
|
+
lg: n,
|
|
1358
|
+
xl: n
|
|
1307
1359
|
};
|
|
1308
|
-
for (const l of
|
|
1309
|
-
a[l] !== void 0 && (
|
|
1310
|
-
return
|
|
1360
|
+
for (const l of Nn)
|
|
1361
|
+
a[l] !== void 0 && (n = a[l]), s[l] = n;
|
|
1362
|
+
return s;
|
|
1311
1363
|
}
|
|
1312
|
-
function
|
|
1313
|
-
if (!
|
|
1364
|
+
function pa(e, a) {
|
|
1365
|
+
if (!c.isValidElement(e))
|
|
1314
1366
|
return a;
|
|
1315
|
-
const
|
|
1316
|
-
return
|
|
1367
|
+
const n = e.props;
|
|
1368
|
+
return n.colSpan ?? n["data-col-span"] ?? a;
|
|
1317
1369
|
}
|
|
1318
|
-
function
|
|
1319
|
-
if (!
|
|
1370
|
+
function va(e) {
|
|
1371
|
+
if (!c.isValidElement(e))
|
|
1320
1372
|
return e;
|
|
1321
1373
|
const a = e.props;
|
|
1322
1374
|
if (!("colSpan" in a) && !("data-col-span" in a))
|
|
1323
1375
|
return e;
|
|
1324
|
-
const
|
|
1325
|
-
return delete
|
|
1376
|
+
const n = { ...a };
|
|
1377
|
+
return delete n.colSpan, delete n["data-col-span"], c.cloneElement(e, n);
|
|
1326
1378
|
}
|
|
1327
|
-
function
|
|
1328
|
-
const a =
|
|
1379
|
+
function Me(e) {
|
|
1380
|
+
const a = ma(e);
|
|
1329
1381
|
return {
|
|
1330
1382
|
"--luna-layout-span-xs": String(a.xs),
|
|
1331
1383
|
"--luna-layout-span-sm": String(a.sm),
|
|
@@ -1334,242 +1386,1048 @@ function He(e) {
|
|
|
1334
1386
|
"--luna-layout-span-xl": String(a.xl)
|
|
1335
1387
|
};
|
|
1336
1388
|
}
|
|
1337
|
-
function
|
|
1389
|
+
function An(e) {
|
|
1338
1390
|
if (e)
|
|
1339
|
-
return
|
|
1391
|
+
return ga[e];
|
|
1340
1392
|
}
|
|
1341
|
-
function
|
|
1393
|
+
function Vn(e) {
|
|
1342
1394
|
if (e)
|
|
1343
|
-
return
|
|
1395
|
+
return fa[e];
|
|
1344
1396
|
}
|
|
1345
|
-
function
|
|
1346
|
-
return
|
|
1397
|
+
function pn(e, a, n) {
|
|
1398
|
+
return c.Children.map(e, (s, l) => s == null || typeof s == "boolean" ? s : /* @__PURE__ */ r.jsx(
|
|
1347
1399
|
"div",
|
|
1348
1400
|
{
|
|
1349
1401
|
className: a,
|
|
1350
|
-
style:
|
|
1351
|
-
children:
|
|
1402
|
+
style: Me(pa(s, n)),
|
|
1403
|
+
children: va(s)
|
|
1352
1404
|
},
|
|
1353
1405
|
l
|
|
1354
1406
|
));
|
|
1355
1407
|
}
|
|
1356
|
-
const
|
|
1357
|
-
const { theme:
|
|
1358
|
-
...
|
|
1359
|
-
...
|
|
1360
|
-
...
|
|
1361
|
-
...
|
|
1362
|
-
...
|
|
1408
|
+
const In = c.forwardRef(function({ as: a, align: n, children: s, className: l, colSpan: i, gap: g, inline: v, justify: d, style: _, ...b }, f) {
|
|
1409
|
+
const { theme: y } = Re(), o = a ?? "div", h = {
|
|
1410
|
+
...Me(i),
|
|
1411
|
+
...g ? { "--luna-layout-gap": mn(g, y) } : {},
|
|
1412
|
+
...n ? { "--luna-layout-align": An(n) } : {},
|
|
1413
|
+
...d ? { "--luna-layout-justify": Vn(d) } : {},
|
|
1414
|
+
..._
|
|
1363
1415
|
};
|
|
1364
|
-
return /* @__PURE__ */
|
|
1365
|
-
|
|
1416
|
+
return /* @__PURE__ */ r.jsx(
|
|
1417
|
+
o,
|
|
1366
1418
|
{
|
|
1367
|
-
...
|
|
1368
|
-
ref:
|
|
1369
|
-
className:
|
|
1370
|
-
style:
|
|
1371
|
-
children:
|
|
1419
|
+
...b,
|
|
1420
|
+
ref: f,
|
|
1421
|
+
className: gn(["luna-column", v && "luna-column--inline", l]),
|
|
1422
|
+
style: h,
|
|
1423
|
+
children: pn(s, "luna-column__item")
|
|
1372
1424
|
}
|
|
1373
1425
|
);
|
|
1374
|
-
}),
|
|
1375
|
-
const { theme:
|
|
1376
|
-
...
|
|
1377
|
-
...
|
|
1378
|
-
...
|
|
1379
|
-
...
|
|
1380
|
-
...
|
|
1426
|
+
}), ba = c.forwardRef(function({ as: a, align: n, children: s, className: l, colSpan: i, gap: g, inline: v, justify: d, style: _, wrap: b = !0, ...f }, y) {
|
|
1427
|
+
const { theme: o } = Re(), h = a ?? "div", u = {
|
|
1428
|
+
...Me(i),
|
|
1429
|
+
...g ? { "--luna-layout-gap": mn(g, o) } : {},
|
|
1430
|
+
...n ? { "--luna-layout-align": An(n) } : {},
|
|
1431
|
+
...d ? { "--luna-layout-justify": Vn(d) } : {},
|
|
1432
|
+
..._
|
|
1381
1433
|
};
|
|
1382
|
-
return /* @__PURE__ */
|
|
1383
|
-
|
|
1434
|
+
return /* @__PURE__ */ r.jsx(
|
|
1435
|
+
h,
|
|
1384
1436
|
{
|
|
1385
|
-
...
|
|
1386
|
-
ref:
|
|
1387
|
-
className:
|
|
1437
|
+
...f,
|
|
1438
|
+
ref: y,
|
|
1439
|
+
className: gn([
|
|
1388
1440
|
"luna-row",
|
|
1389
|
-
|
|
1390
|
-
!
|
|
1441
|
+
v && "luna-row--inline",
|
|
1442
|
+
!b && "luna-row--no-wrap",
|
|
1391
1443
|
l
|
|
1392
1444
|
]),
|
|
1393
|
-
style:
|
|
1394
|
-
children:
|
|
1445
|
+
style: u,
|
|
1446
|
+
children: pn(s, "luna-row__item", "auto")
|
|
1395
1447
|
}
|
|
1396
1448
|
);
|
|
1397
1449
|
});
|
|
1398
|
-
function
|
|
1450
|
+
function ha(e) {
|
|
1399
1451
|
return e.filter(Boolean).join(" ");
|
|
1400
1452
|
}
|
|
1401
|
-
function
|
|
1453
|
+
function _a(e, a) {
|
|
1402
1454
|
if (e)
|
|
1403
|
-
return
|
|
1455
|
+
return E(a, e);
|
|
1404
1456
|
}
|
|
1405
|
-
function
|
|
1457
|
+
function tn(e, a) {
|
|
1406
1458
|
if (e)
|
|
1407
|
-
return
|
|
1459
|
+
return M(a.spacing, e) ?? e;
|
|
1408
1460
|
}
|
|
1409
|
-
function
|
|
1410
|
-
return
|
|
1461
|
+
function Pn(e) {
|
|
1462
|
+
return c.Children.toArray(e).flatMap((a) => c.isValidElement(a) && a.type === c.Fragment ? Pn(a.props.children) : [a]);
|
|
1411
1463
|
}
|
|
1412
|
-
const
|
|
1464
|
+
const et = c.forwardRef(function({
|
|
1413
1465
|
actions: a,
|
|
1414
|
-
actionsAlign:
|
|
1415
|
-
actionsGap:
|
|
1466
|
+
actionsAlign: n = "left",
|
|
1467
|
+
actionsGap: s = "2",
|
|
1416
1468
|
as: l,
|
|
1417
|
-
bodyAlign:
|
|
1418
|
-
children:
|
|
1419
|
-
className:
|
|
1420
|
-
color:
|
|
1421
|
-
elevated:
|
|
1422
|
-
flat:
|
|
1423
|
-
gap:
|
|
1424
|
-
header:
|
|
1425
|
-
interactive:
|
|
1426
|
-
outlined:
|
|
1427
|
-
padding:
|
|
1428
|
-
rounded:
|
|
1429
|
-
style:
|
|
1430
|
-
...
|
|
1431
|
-
},
|
|
1432
|
-
const { theme:
|
|
1469
|
+
bodyAlign: i = "left",
|
|
1470
|
+
children: g,
|
|
1471
|
+
className: v,
|
|
1472
|
+
color: d,
|
|
1473
|
+
elevated: _,
|
|
1474
|
+
flat: b,
|
|
1475
|
+
gap: f,
|
|
1476
|
+
header: y,
|
|
1477
|
+
interactive: o,
|
|
1478
|
+
outlined: h,
|
|
1479
|
+
padding: u,
|
|
1480
|
+
rounded: j,
|
|
1481
|
+
style: k,
|
|
1482
|
+
...D
|
|
1483
|
+
}, O) {
|
|
1484
|
+
const { theme: C } = Re(), T = l ?? "section", N = _a(d, C), p = tn(f, C), Y = tn(u, C), K = tn(s, C), P = ha([
|
|
1433
1485
|
"luna-card",
|
|
1434
|
-
|
|
1435
|
-
!
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
]),
|
|
1441
|
-
...
|
|
1442
|
-
...
|
|
1443
|
-
...
|
|
1444
|
-
...
|
|
1486
|
+
h && "luna-card--outlined",
|
|
1487
|
+
!b && _ && "luna-card--elevated",
|
|
1488
|
+
b && "luna-card--flat",
|
|
1489
|
+
j && "luna-card--rounded",
|
|
1490
|
+
o && "luna-card--interactive",
|
|
1491
|
+
v
|
|
1492
|
+
]), Q = {
|
|
1493
|
+
...N ? { "--luna-card-bg-override": N } : {},
|
|
1494
|
+
...p ? { "--luna-card-gap": p } : {},
|
|
1495
|
+
...Y ? { "--luna-card-padding": Y } : {},
|
|
1496
|
+
...k
|
|
1445
1497
|
};
|
|
1446
|
-
return /* @__PURE__ */
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
a ? /* @__PURE__ */
|
|
1450
|
-
|
|
1498
|
+
return /* @__PURE__ */ r.jsxs(T, { ...D, ref: O, className: P, style: Q, children: [
|
|
1499
|
+
y ? /* @__PURE__ */ r.jsx(In, { className: "luna-card__header", align: "start", gap: "2", children: /* @__PURE__ */ r.jsx("div", { className: "luna-card__header-content", children: y }) }) : null,
|
|
1500
|
+
g ? /* @__PURE__ */ r.jsx(In, { className: "luna-card__body", align: i === "center" ? "center" : i === "right" ? "end" : "start", gap: "2", children: g }) : null,
|
|
1501
|
+
a ? /* @__PURE__ */ r.jsx(
|
|
1502
|
+
ba,
|
|
1451
1503
|
{
|
|
1452
1504
|
className: "luna-card__actions",
|
|
1453
1505
|
align: "center",
|
|
1454
1506
|
gap: K,
|
|
1455
|
-
justify:
|
|
1507
|
+
justify: n === "center" ? "center" : n === "right" ? "end" : "start",
|
|
1456
1508
|
wrap: !1,
|
|
1457
|
-
children:
|
|
1458
|
-
(
|
|
1509
|
+
children: Pn(a).map(
|
|
1510
|
+
(H, X) => H == null || typeof H == "boolean" ? H : /* @__PURE__ */ r.jsx("div", { "data-col-span": "auto", children: H }, X)
|
|
1459
1511
|
)
|
|
1460
1512
|
}
|
|
1461
1513
|
) : null
|
|
1462
1514
|
] });
|
|
1463
|
-
}),
|
|
1464
|
-
function
|
|
1515
|
+
}), xa = /* @__PURE__ */ new Set(["span", "strong", "em", "small", "label", "b", "i", "u"]);
|
|
1516
|
+
function ya(e) {
|
|
1465
1517
|
return e.filter(Boolean).join(" ");
|
|
1466
1518
|
}
|
|
1467
|
-
function
|
|
1519
|
+
function ja(e, a) {
|
|
1468
1520
|
if (e)
|
|
1469
|
-
return
|
|
1521
|
+
return E(a, e);
|
|
1470
1522
|
}
|
|
1471
|
-
const
|
|
1523
|
+
const B = c.forwardRef(function({
|
|
1472
1524
|
as: a,
|
|
1473
|
-
align:
|
|
1474
|
-
children:
|
|
1525
|
+
align: n,
|
|
1526
|
+
children: s,
|
|
1475
1527
|
className: l,
|
|
1476
|
-
color:
|
|
1477
|
-
inline:
|
|
1478
|
-
italic:
|
|
1479
|
-
muted:
|
|
1480
|
-
surface:
|
|
1481
|
-
style:
|
|
1482
|
-
truncate:
|
|
1483
|
-
underline:
|
|
1484
|
-
variant:
|
|
1485
|
-
weight:
|
|
1486
|
-
...
|
|
1487
|
-
},
|
|
1488
|
-
var
|
|
1489
|
-
const { theme:
|
|
1490
|
-
...
|
|
1491
|
-
...
|
|
1492
|
-
...
|
|
1493
|
-
...
|
|
1528
|
+
color: i,
|
|
1529
|
+
inline: g,
|
|
1530
|
+
italic: v,
|
|
1531
|
+
muted: d,
|
|
1532
|
+
surface: _,
|
|
1533
|
+
style: b,
|
|
1534
|
+
truncate: f,
|
|
1535
|
+
underline: y,
|
|
1536
|
+
variant: o,
|
|
1537
|
+
weight: h,
|
|
1538
|
+
...u
|
|
1539
|
+
}, j) {
|
|
1540
|
+
var p;
|
|
1541
|
+
const { theme: k } = Re(), D = a ?? "p", O = o ?? ((p = k.components.text) == null ? void 0 : p.defaultVariant) ?? "body", C = ja(i, k), T = g === !0 || g !== !1 && typeof D == "string" && xa.has(D), N = {
|
|
1542
|
+
...n ? { "--luna-text-align": n } : {},
|
|
1543
|
+
...C ? { "--luna-text-color": C } : {},
|
|
1544
|
+
...h !== void 0 ? { fontWeight: h } : {},
|
|
1545
|
+
...b
|
|
1494
1546
|
};
|
|
1495
|
-
return /* @__PURE__ */
|
|
1496
|
-
|
|
1547
|
+
return /* @__PURE__ */ r.jsx(
|
|
1548
|
+
D,
|
|
1497
1549
|
{
|
|
1498
|
-
...
|
|
1499
|
-
ref:
|
|
1500
|
-
className:
|
|
1550
|
+
...u,
|
|
1551
|
+
ref: j,
|
|
1552
|
+
className: ya([
|
|
1501
1553
|
"luna-text",
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1554
|
+
T && "luna-text--inline",
|
|
1555
|
+
d && "luna-text--muted",
|
|
1556
|
+
f && "luna-text--truncate",
|
|
1557
|
+
_ && "luna-text--surface",
|
|
1558
|
+
v && "luna-text--italic",
|
|
1559
|
+
y && "luna-text--underline",
|
|
1508
1560
|
l
|
|
1509
1561
|
]),
|
|
1510
|
-
"data-variant":
|
|
1511
|
-
style:
|
|
1512
|
-
children:
|
|
1562
|
+
"data-variant": O,
|
|
1563
|
+
style: N,
|
|
1564
|
+
children: s
|
|
1565
|
+
}
|
|
1566
|
+
);
|
|
1567
|
+
});
|
|
1568
|
+
function Sa(e) {
|
|
1569
|
+
return e.filter(Boolean).join(" ");
|
|
1570
|
+
}
|
|
1571
|
+
const nt = c.forwardRef(
|
|
1572
|
+
function({
|
|
1573
|
+
className: a,
|
|
1574
|
+
description: n,
|
|
1575
|
+
disabled: s,
|
|
1576
|
+
error: l,
|
|
1577
|
+
helpText: i,
|
|
1578
|
+
id: g,
|
|
1579
|
+
indeterminate: v = !1,
|
|
1580
|
+
label: d,
|
|
1581
|
+
onChange: _,
|
|
1582
|
+
checked: b,
|
|
1583
|
+
...f
|
|
1584
|
+
}, y) {
|
|
1585
|
+
const o = c.useId(), h = g ?? `luna-checkbox-${o.replace(/:/g, "")}`, u = l || i ? `${h}-message` : void 0, j = n ? `${h}-description` : void 0, k = c.useRef(null), D = l != null;
|
|
1586
|
+
c.useImperativeHandle(y, () => k.current, []), c.useEffect(() => {
|
|
1587
|
+
k.current && (k.current.indeterminate = v);
|
|
1588
|
+
}, [v]);
|
|
1589
|
+
function O(C) {
|
|
1590
|
+
k.current && (k.current.indeterminate = !1), _ == null || _(C);
|
|
1591
|
+
}
|
|
1592
|
+
return /* @__PURE__ */ r.jsxs(
|
|
1593
|
+
"div",
|
|
1594
|
+
{
|
|
1595
|
+
className: Sa([
|
|
1596
|
+
"luna-checkbox-field",
|
|
1597
|
+
s && "luna-checkbox-field--disabled",
|
|
1598
|
+
D && "luna-checkbox-field--invalid",
|
|
1599
|
+
a
|
|
1600
|
+
]),
|
|
1601
|
+
children: [
|
|
1602
|
+
/* @__PURE__ */ r.jsxs("label", { htmlFor: h, className: "luna-checkbox-field__main", children: [
|
|
1603
|
+
/* @__PURE__ */ r.jsx(
|
|
1604
|
+
"input",
|
|
1605
|
+
{
|
|
1606
|
+
...f,
|
|
1607
|
+
ref: k,
|
|
1608
|
+
id: h,
|
|
1609
|
+
className: "luna-checkbox",
|
|
1610
|
+
type: "checkbox",
|
|
1611
|
+
checked: b,
|
|
1612
|
+
disabled: s,
|
|
1613
|
+
onChange: O,
|
|
1614
|
+
"data-indeterminate": v ? "true" : "false",
|
|
1615
|
+
"aria-invalid": D ? !0 : f["aria-invalid"],
|
|
1616
|
+
"aria-checked": v ? "mixed" : f["aria-checked"],
|
|
1617
|
+
"aria-describedby": [j, u].filter(Boolean).join(" ") || void 0
|
|
1618
|
+
}
|
|
1619
|
+
),
|
|
1620
|
+
/* @__PURE__ */ r.jsx("span", { className: "luna-checkbox__box", "aria-hidden": "true" }),
|
|
1621
|
+
/* @__PURE__ */ r.jsxs("span", { className: "luna-checkbox-field__text", children: [
|
|
1622
|
+
d != null ? /* @__PURE__ */ r.jsx(B, { as: "span", variant: "label", className: "luna-checkbox-field__label", children: d }) : null,
|
|
1623
|
+
n != null ? /* @__PURE__ */ r.jsx(
|
|
1624
|
+
B,
|
|
1625
|
+
{
|
|
1626
|
+
id: j,
|
|
1627
|
+
as: "span",
|
|
1628
|
+
variant: "body-small",
|
|
1629
|
+
className: "luna-checkbox-field__description",
|
|
1630
|
+
children: n
|
|
1631
|
+
}
|
|
1632
|
+
) : null
|
|
1633
|
+
] })
|
|
1634
|
+
] }),
|
|
1635
|
+
D ? /* @__PURE__ */ r.jsx(
|
|
1636
|
+
B,
|
|
1637
|
+
{
|
|
1638
|
+
id: u,
|
|
1639
|
+
variant: "caption",
|
|
1640
|
+
className: "luna-checkbox-field__message luna-checkbox-field__message--error",
|
|
1641
|
+
children: l
|
|
1642
|
+
}
|
|
1643
|
+
) : i != null ? /* @__PURE__ */ r.jsx(
|
|
1644
|
+
B,
|
|
1645
|
+
{
|
|
1646
|
+
id: u,
|
|
1647
|
+
variant: "caption",
|
|
1648
|
+
className: "luna-checkbox-field__message luna-checkbox-field__message--help",
|
|
1649
|
+
children: i
|
|
1650
|
+
}
|
|
1651
|
+
) : null
|
|
1652
|
+
]
|
|
1653
|
+
}
|
|
1654
|
+
);
|
|
1655
|
+
}
|
|
1656
|
+
);
|
|
1657
|
+
function wa(e) {
|
|
1658
|
+
return e === "transparent" || e === "rgba(0, 0, 0, 0)";
|
|
1659
|
+
}
|
|
1660
|
+
function Na(e) {
|
|
1661
|
+
let a = (e == null ? void 0 : e.parentElement) ?? null;
|
|
1662
|
+
for (; a; ) {
|
|
1663
|
+
const n = window.getComputedStyle(a).backgroundColor;
|
|
1664
|
+
if (n && !wa(n))
|
|
1665
|
+
return n;
|
|
1666
|
+
a = a.parentElement;
|
|
1667
|
+
}
|
|
1668
|
+
return "";
|
|
1669
|
+
}
|
|
1670
|
+
function We(e = []) {
|
|
1671
|
+
const a = c.useRef(null);
|
|
1672
|
+
return c.useLayoutEffect(() => {
|
|
1673
|
+
const n = a.current;
|
|
1674
|
+
if (!n)
|
|
1675
|
+
return;
|
|
1676
|
+
const s = Na(n);
|
|
1677
|
+
if (s) {
|
|
1678
|
+
n.style.setProperty("--luna-container-bg", s);
|
|
1679
|
+
return;
|
|
1680
|
+
}
|
|
1681
|
+
n.style.removeProperty("--luna-container-bg");
|
|
1682
|
+
}, e), a;
|
|
1683
|
+
}
|
|
1684
|
+
function ka(e) {
|
|
1685
|
+
return e.filter(Boolean).join(" ");
|
|
1686
|
+
}
|
|
1687
|
+
const Ia = c.forwardRef(
|
|
1688
|
+
function({
|
|
1689
|
+
className: a,
|
|
1690
|
+
defaultValue: n,
|
|
1691
|
+
disabled: s,
|
|
1692
|
+
error: l,
|
|
1693
|
+
externalLabel: i = !1,
|
|
1694
|
+
fullWidth: g,
|
|
1695
|
+
helpText: v,
|
|
1696
|
+
id: d,
|
|
1697
|
+
inputSize: _,
|
|
1698
|
+
label: b,
|
|
1699
|
+
onBlur: f,
|
|
1700
|
+
onChange: y,
|
|
1701
|
+
value: o,
|
|
1702
|
+
...h
|
|
1703
|
+
}, u) {
|
|
1704
|
+
var Q;
|
|
1705
|
+
const { theme: j } = Re(), k = c.useId(), D = d ?? `luna-date-input-${k.replace(/:/g, "")}`, O = l || v ? `${D}-message` : void 0, C = _ ?? ((Q = j.components.input) == null ? void 0 : Q.defaultSize) ?? "md", T = l != null, N = b != null && i, p = b != null && !i, Y = We([j]);
|
|
1706
|
+
function K(H) {
|
|
1707
|
+
y == null || y(H);
|
|
1708
|
+
}
|
|
1709
|
+
function P(H) {
|
|
1710
|
+
f == null || f(H);
|
|
1711
|
+
}
|
|
1712
|
+
return /* @__PURE__ */ r.jsxs(
|
|
1713
|
+
"div",
|
|
1714
|
+
{
|
|
1715
|
+
ref: Y,
|
|
1716
|
+
className: ka([
|
|
1717
|
+
"luna-date-input-field",
|
|
1718
|
+
g && "luna-date-input-field--full-width",
|
|
1719
|
+
p && "luna-date-input-field--inset-label",
|
|
1720
|
+
p && "luna-date-input-field--inset-label-active",
|
|
1721
|
+
s && "luna-date-input-field--disabled",
|
|
1722
|
+
T && "luna-date-input-field--invalid",
|
|
1723
|
+
a
|
|
1724
|
+
]),
|
|
1725
|
+
"data-size": C,
|
|
1726
|
+
children: [
|
|
1727
|
+
N ? /* @__PURE__ */ r.jsx("label", { htmlFor: D, className: "luna-date-input-field__label", children: /* @__PURE__ */ r.jsx(B, { as: "span", variant: "label", children: b }) }) : null,
|
|
1728
|
+
/* @__PURE__ */ r.jsxs("div", { className: "luna-date-input-field__control", children: [
|
|
1729
|
+
p ? /* @__PURE__ */ r.jsx(
|
|
1730
|
+
"label",
|
|
1731
|
+
{
|
|
1732
|
+
htmlFor: D,
|
|
1733
|
+
className: "luna-date-input-field__label luna-date-input-field__label--inset",
|
|
1734
|
+
children: /* @__PURE__ */ r.jsx(B, { as: "span", variant: "caption", children: b })
|
|
1735
|
+
}
|
|
1736
|
+
) : null,
|
|
1737
|
+
/* @__PURE__ */ r.jsx("div", { className: "luna-date-input-field__content", children: /* @__PURE__ */ r.jsx(
|
|
1738
|
+
"input",
|
|
1739
|
+
{
|
|
1740
|
+
...h,
|
|
1741
|
+
id: D,
|
|
1742
|
+
ref: u,
|
|
1743
|
+
className: "luna-date-input",
|
|
1744
|
+
type: "date",
|
|
1745
|
+
value: o,
|
|
1746
|
+
defaultValue: n,
|
|
1747
|
+
disabled: s,
|
|
1748
|
+
onChange: K,
|
|
1749
|
+
onFocus: h.onFocus,
|
|
1750
|
+
onBlur: P,
|
|
1751
|
+
"aria-invalid": T ? !0 : h["aria-invalid"],
|
|
1752
|
+
"aria-describedby": O ?? h["aria-describedby"]
|
|
1753
|
+
}
|
|
1754
|
+
) })
|
|
1755
|
+
] }),
|
|
1756
|
+
T ? /* @__PURE__ */ r.jsx(
|
|
1757
|
+
B,
|
|
1758
|
+
{
|
|
1759
|
+
id: O,
|
|
1760
|
+
variant: "caption",
|
|
1761
|
+
className: "luna-date-input-field__message luna-date-input-field__message--error",
|
|
1762
|
+
children: l
|
|
1763
|
+
}
|
|
1764
|
+
) : v != null ? /* @__PURE__ */ r.jsx(
|
|
1765
|
+
B,
|
|
1766
|
+
{
|
|
1767
|
+
id: O,
|
|
1768
|
+
variant: "caption",
|
|
1769
|
+
className: "luna-date-input-field__message luna-date-input-field__message--help",
|
|
1770
|
+
children: v
|
|
1771
|
+
}
|
|
1772
|
+
) : null
|
|
1773
|
+
]
|
|
1774
|
+
}
|
|
1775
|
+
);
|
|
1776
|
+
}
|
|
1777
|
+
);
|
|
1778
|
+
function He(e) {
|
|
1779
|
+
if (!e)
|
|
1780
|
+
return null;
|
|
1781
|
+
const a = e.split("-").map(Number);
|
|
1782
|
+
return a.length !== 3 || a.some(Number.isNaN) ? null : new Date(a[0], a[1] - 1, a[2]);
|
|
1783
|
+
}
|
|
1784
|
+
function vn(e) {
|
|
1785
|
+
const a = e.getFullYear(), n = String(e.getMonth() + 1).padStart(2, "0"), s = String(e.getDate()).padStart(2, "0");
|
|
1786
|
+
return `${a}-${n}-${s}`;
|
|
1787
|
+
}
|
|
1788
|
+
function Te(e) {
|
|
1789
|
+
const a = He(e);
|
|
1790
|
+
if (!a)
|
|
1791
|
+
return "";
|
|
1792
|
+
const n = String(a.getMonth() + 1).padStart(2, "0"), s = String(a.getDate()).padStart(2, "0"), l = String(a.getFullYear());
|
|
1793
|
+
return `${n}/${s}/${l}`;
|
|
1794
|
+
}
|
|
1795
|
+
function rn(e) {
|
|
1796
|
+
if (!e)
|
|
1797
|
+
return null;
|
|
1798
|
+
const a = e.trim();
|
|
1799
|
+
if (!a)
|
|
1800
|
+
return "";
|
|
1801
|
+
const n = a.match(/^(\d{1,2})\/(\d{1,2})\/(\d{4})$/);
|
|
1802
|
+
if (!n)
|
|
1803
|
+
return null;
|
|
1804
|
+
const s = Number(n[1]), l = Number(n[2]), i = Number(n[3]), g = new Date(i, s - 1, l);
|
|
1805
|
+
return Number.isNaN(s) || Number.isNaN(l) || Number.isNaN(i) || g.getFullYear() !== i || g.getMonth() !== s - 1 || g.getDate() !== l ? null : vn(g);
|
|
1806
|
+
}
|
|
1807
|
+
function Ze(e) {
|
|
1808
|
+
return new Date(e.getFullYear(), e.getMonth(), 1);
|
|
1809
|
+
}
|
|
1810
|
+
function Rn(e, a) {
|
|
1811
|
+
return new Date(e.getFullYear(), e.getMonth() + a, 1);
|
|
1812
|
+
}
|
|
1813
|
+
function ln(e, a) {
|
|
1814
|
+
return !e || !a ? !1 : e.getFullYear() === a.getFullYear() && e.getMonth() === a.getMonth() && e.getDate() === a.getDate();
|
|
1815
|
+
}
|
|
1816
|
+
function En(e, a) {
|
|
1817
|
+
return !e || !a ? !1 : e.getTime() < a.getTime();
|
|
1818
|
+
}
|
|
1819
|
+
function Ra(e, a, n) {
|
|
1820
|
+
if (!a || !n)
|
|
1821
|
+
return !1;
|
|
1822
|
+
const s = e.getTime();
|
|
1823
|
+
return s > a.getTime() && s < n.getTime();
|
|
1824
|
+
}
|
|
1825
|
+
function Ea(e, a, n) {
|
|
1826
|
+
const s = He(a), l = He(n);
|
|
1827
|
+
return !!(s && En(e, s) || l && En(l, e));
|
|
1828
|
+
}
|
|
1829
|
+
function Da(e) {
|
|
1830
|
+
const a = Ze(e), n = a.getMonth(), s = a.getDay(), l = new Date(
|
|
1831
|
+
a.getFullYear(),
|
|
1832
|
+
a.getMonth(),
|
|
1833
|
+
a.getDate() - s
|
|
1834
|
+
);
|
|
1835
|
+
return Array.from({ length: 42 }, (i, g) => {
|
|
1836
|
+
const v = new Date(l.getFullYear(), l.getMonth(), l.getDate() + g);
|
|
1837
|
+
return {
|
|
1838
|
+
date: v,
|
|
1839
|
+
value: vn(v),
|
|
1840
|
+
day: v.getDate(),
|
|
1841
|
+
inMonth: v.getMonth() === n
|
|
1842
|
+
};
|
|
1843
|
+
});
|
|
1844
|
+
}
|
|
1845
|
+
function Ve(e) {
|
|
1846
|
+
return e.filter(Boolean).join(" ");
|
|
1847
|
+
}
|
|
1848
|
+
function Fa() {
|
|
1849
|
+
const e = new Intl.DateTimeFormat(void 0, { weekday: "short" });
|
|
1850
|
+
return Array.from(
|
|
1851
|
+
{ length: 7 },
|
|
1852
|
+
(a, n) => e.format(new Date(2026, 2, 22 + n))
|
|
1853
|
+
);
|
|
1854
|
+
}
|
|
1855
|
+
function Ca(e) {
|
|
1856
|
+
if (e.mode !== "range")
|
|
1857
|
+
return e.value;
|
|
1858
|
+
}
|
|
1859
|
+
function $a(e) {
|
|
1860
|
+
if (e.mode !== "range")
|
|
1861
|
+
return e.defaultValue;
|
|
1862
|
+
}
|
|
1863
|
+
function Ba(e) {
|
|
1864
|
+
if (e.mode === "range")
|
|
1865
|
+
return e.value;
|
|
1866
|
+
}
|
|
1867
|
+
function za(e) {
|
|
1868
|
+
if (e.mode === "range")
|
|
1869
|
+
return e.defaultValue;
|
|
1870
|
+
}
|
|
1871
|
+
const at = c.forwardRef(
|
|
1872
|
+
function(a, n) {
|
|
1873
|
+
var qe;
|
|
1874
|
+
const {
|
|
1875
|
+
className: s,
|
|
1876
|
+
disabled: l,
|
|
1877
|
+
error: i,
|
|
1878
|
+
externalLabel: g = !1,
|
|
1879
|
+
fullWidth: v,
|
|
1880
|
+
helpText: d,
|
|
1881
|
+
id: _,
|
|
1882
|
+
inputSize: b,
|
|
1883
|
+
label: f,
|
|
1884
|
+
max: y,
|
|
1885
|
+
min: o,
|
|
1886
|
+
mode: h = "simple",
|
|
1887
|
+
buttonPosition: u = "post"
|
|
1888
|
+
} = a;
|
|
1889
|
+
if (h === "simple") {
|
|
1890
|
+
const S = a, {
|
|
1891
|
+
defaultValue: ue,
|
|
1892
|
+
onChange: xe,
|
|
1893
|
+
value: ze,
|
|
1894
|
+
...$e
|
|
1895
|
+
} = S;
|
|
1896
|
+
return /* @__PURE__ */ r.jsx(
|
|
1897
|
+
Ia,
|
|
1898
|
+
{
|
|
1899
|
+
...$e,
|
|
1900
|
+
ref: n,
|
|
1901
|
+
id: _,
|
|
1902
|
+
className: s,
|
|
1903
|
+
disabled: l,
|
|
1904
|
+
error: i,
|
|
1905
|
+
externalLabel: g,
|
|
1906
|
+
fullWidth: v,
|
|
1907
|
+
helpText: d,
|
|
1908
|
+
inputSize: b,
|
|
1909
|
+
label: f,
|
|
1910
|
+
min: typeof o == "string" ? o : void 0,
|
|
1911
|
+
max: typeof y == "string" ? y : void 0,
|
|
1912
|
+
value: ze,
|
|
1913
|
+
defaultValue: ue,
|
|
1914
|
+
onChange: (Pe) => xe == null ? void 0 : xe(Pe.currentTarget.value)
|
|
1915
|
+
}
|
|
1916
|
+
);
|
|
1917
|
+
}
|
|
1918
|
+
const { theme: j } = Re(), k = c.useId(), D = _ ?? `luna-date-picker-${k.replace(/:/g, "")}`, O = `${D}-label`, C = `${D}-value`, T = `${D}-panel`, N = i || d ? `${D}-message` : void 0, p = b ?? ((qe = j.components.input) == null ? void 0 : qe.defaultSize) ?? "md", Y = i != null, K = f != null && g, P = f != null && !g, Q = We([j]), H = c.useRef(null), [X, ee] = c.useState(!1), ce = Ca(a), oe = $a(a), me = Ba(a), pe = za(a), Z = h === "range", ge = Z ? me !== void 0 : ce !== void 0, [q, L] = c.useState(oe ?? ""), [A, ne] = c.useState(
|
|
1919
|
+
pe ?? {}
|
|
1920
|
+
), te = ge ? ce ?? "" : q, $ = ge ? me ?? {} : A, [re, de] = c.useState(Te(te)), [be, ie] = c.useState(
|
|
1921
|
+
Te($.start)
|
|
1922
|
+
), [G, U] = c.useState(
|
|
1923
|
+
Te($.end)
|
|
1924
|
+
), je = c.useMemo(
|
|
1925
|
+
() => He(te),
|
|
1926
|
+
[te]
|
|
1927
|
+
), he = c.useMemo(
|
|
1928
|
+
() => He($.start),
|
|
1929
|
+
[$.start]
|
|
1930
|
+
), fe = c.useMemo(
|
|
1931
|
+
() => He($.end),
|
|
1932
|
+
[$.end]
|
|
1933
|
+
), we = he ?? je ?? Ze(/* @__PURE__ */ new Date()), [Ee, Se] = c.useState(Ze(we));
|
|
1934
|
+
c.useEffect(() => {
|
|
1935
|
+
const S = Z ? he ?? fe : je;
|
|
1936
|
+
S && Se(Ze(S));
|
|
1937
|
+
}, [Z, $.end, $.start, te]), c.useEffect(() => {
|
|
1938
|
+
de(Te(te));
|
|
1939
|
+
}, [te]), c.useEffect(() => {
|
|
1940
|
+
ie(Te($.start));
|
|
1941
|
+
}, [$.start]), c.useEffect(() => {
|
|
1942
|
+
U(Te($.end));
|
|
1943
|
+
}, [$.end]), c.useImperativeHandle(n, () => H.current, []), c.useEffect(() => {
|
|
1944
|
+
if (!X)
|
|
1945
|
+
return;
|
|
1946
|
+
function S(ue) {
|
|
1947
|
+
var ze;
|
|
1948
|
+
const xe = ue.target;
|
|
1949
|
+
(ze = Q.current) != null && ze.contains(xe) || ee(!1);
|
|
1950
|
+
}
|
|
1951
|
+
return document.addEventListener("mousedown", S), () => {
|
|
1952
|
+
document.removeEventListener("mousedown", S);
|
|
1953
|
+
};
|
|
1954
|
+
}, [X, Q]);
|
|
1955
|
+
function De(S) {
|
|
1956
|
+
var ue;
|
|
1957
|
+
ge || L(S), de(Te(S)), (ue = a.onChange) == null || ue.call(a, S);
|
|
1958
|
+
}
|
|
1959
|
+
function ke(S) {
|
|
1960
|
+
var ue;
|
|
1961
|
+
ge || ne(S), ie(Te(S.start)), U(Te(S.end)), (ue = a.onChange) == null || ue.call(a, S);
|
|
1962
|
+
}
|
|
1963
|
+
function Ce(S) {
|
|
1964
|
+
const ue = vn(S);
|
|
1965
|
+
if (Z) {
|
|
1966
|
+
if (!$.start || $.start && $.end) {
|
|
1967
|
+
ke({ start: ue, end: void 0 });
|
|
1968
|
+
return;
|
|
1969
|
+
}
|
|
1970
|
+
const xe = He($.start);
|
|
1971
|
+
if (!xe) {
|
|
1972
|
+
ke({ start: ue, end: void 0 });
|
|
1973
|
+
return;
|
|
1974
|
+
}
|
|
1975
|
+
S.getTime() < xe.getTime() ? ke({ start: ue, end: $.start }) : ke({ start: $.start, end: ue });
|
|
1976
|
+
return;
|
|
1977
|
+
}
|
|
1978
|
+
De(ue);
|
|
1979
|
+
}
|
|
1980
|
+
function Be() {
|
|
1981
|
+
var S;
|
|
1982
|
+
Z ? ke({ start: void 0, end: void 0 }) : De(""), (S = H.current) == null || S.focus();
|
|
1983
|
+
}
|
|
1984
|
+
function Oe() {
|
|
1985
|
+
var S;
|
|
1986
|
+
ee(!1), (S = H.current) == null || S.focus();
|
|
1987
|
+
}
|
|
1988
|
+
function I(S) {
|
|
1989
|
+
if (!l)
|
|
1990
|
+
switch (S.key) {
|
|
1991
|
+
case "ArrowDown":
|
|
1992
|
+
case "Enter":
|
|
1993
|
+
case " ": {
|
|
1994
|
+
S.preventDefault(), ee(!0);
|
|
1995
|
+
break;
|
|
1996
|
+
}
|
|
1997
|
+
case "Escape": {
|
|
1998
|
+
X && (S.preventDefault(), ee(!1));
|
|
1999
|
+
break;
|
|
2000
|
+
}
|
|
2001
|
+
}
|
|
2002
|
+
}
|
|
2003
|
+
function V() {
|
|
2004
|
+
const S = rn(re);
|
|
2005
|
+
if (S === null) {
|
|
2006
|
+
de(Te(te));
|
|
2007
|
+
return;
|
|
2008
|
+
}
|
|
2009
|
+
De(S);
|
|
2010
|
+
}
|
|
2011
|
+
function _e() {
|
|
2012
|
+
const S = rn(be);
|
|
2013
|
+
if (S === null) {
|
|
2014
|
+
ie(Te($.start));
|
|
2015
|
+
return;
|
|
2016
|
+
}
|
|
2017
|
+
ke({
|
|
2018
|
+
start: S || void 0,
|
|
2019
|
+
end: $.end
|
|
2020
|
+
});
|
|
2021
|
+
}
|
|
2022
|
+
function F() {
|
|
2023
|
+
const S = rn(G);
|
|
2024
|
+
if (S === null) {
|
|
2025
|
+
U(Te($.end));
|
|
2026
|
+
return;
|
|
2027
|
+
}
|
|
2028
|
+
ke({
|
|
2029
|
+
start: $.start,
|
|
2030
|
+
end: S || void 0
|
|
2031
|
+
});
|
|
2032
|
+
}
|
|
2033
|
+
function x(S) {
|
|
2034
|
+
var xe;
|
|
2035
|
+
const ue = S.relatedTarget;
|
|
2036
|
+
(xe = Q.current) != null && xe.contains(ue) || ee(!1);
|
|
2037
|
+
}
|
|
2038
|
+
const R = Z ? !!($.start || $.end) : te.length > 0, le = P, Ne = Da(Ee), Ae = Ee.toLocaleDateString(void 0, {
|
|
2039
|
+
month: "long",
|
|
2040
|
+
year: "numeric"
|
|
2041
|
+
}), en = typeof o == "string" ? o : void 0, nn = typeof y == "string" ? y : void 0;
|
|
2042
|
+
return /* @__PURE__ */ r.jsxs(
|
|
2043
|
+
"div",
|
|
2044
|
+
{
|
|
2045
|
+
ref: Q,
|
|
2046
|
+
className: Ve([
|
|
2047
|
+
"luna-date-picker-field",
|
|
2048
|
+
v && "luna-date-picker-field--full-width",
|
|
2049
|
+
P && "luna-date-picker-field--inset-label",
|
|
2050
|
+
le && "luna-date-picker-field--inset-label-active",
|
|
2051
|
+
R && "luna-date-picker-field--has-value",
|
|
2052
|
+
X && "luna-date-picker-field--open",
|
|
2053
|
+
l && "luna-date-picker-field--disabled",
|
|
2054
|
+
Y && "luna-date-picker-field--invalid",
|
|
2055
|
+
s
|
|
2056
|
+
]),
|
|
2057
|
+
"data-size": p,
|
|
2058
|
+
onBlurCapture: x,
|
|
2059
|
+
children: [
|
|
2060
|
+
K ? /* @__PURE__ */ r.jsx("div", { id: O, className: "luna-date-picker-field__label", children: /* @__PURE__ */ r.jsx(B, { as: "span", variant: "label", children: f }) }) : null,
|
|
2061
|
+
/* @__PURE__ */ r.jsxs(
|
|
2062
|
+
"div",
|
|
2063
|
+
{
|
|
2064
|
+
className: Ve([
|
|
2065
|
+
"luna-date-picker-field__control",
|
|
2066
|
+
u === "pre" && "luna-date-picker-field__control--button-pre",
|
|
2067
|
+
u === "post" && "luna-date-picker-field__control--button-post"
|
|
2068
|
+
]),
|
|
2069
|
+
children: [
|
|
2070
|
+
P ? /* @__PURE__ */ r.jsx("div", { id: O, className: "luna-date-picker-field__label luna-date-picker-field__label--inset", children: /* @__PURE__ */ r.jsx(B, { as: "span", variant: "caption", children: f }) }) : null,
|
|
2071
|
+
/* @__PURE__ */ r.jsx(
|
|
2072
|
+
"div",
|
|
2073
|
+
{
|
|
2074
|
+
className: Ve([
|
|
2075
|
+
"luna-date-picker__input-group",
|
|
2076
|
+
Z ? "luna-date-picker__input-group--range" : "luna-date-picker__input-group--single"
|
|
2077
|
+
]),
|
|
2078
|
+
children: Z ? /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
|
|
2079
|
+
/* @__PURE__ */ r.jsx(
|
|
2080
|
+
"div",
|
|
2081
|
+
{
|
|
2082
|
+
className: Ve([
|
|
2083
|
+
"luna-date-picker__input-rail",
|
|
2084
|
+
"luna-date-picker__input-rail--range-start",
|
|
2085
|
+
$.start ? "luna-date-picker__input-rail--filled" : "luna-date-picker__input-rail--empty"
|
|
2086
|
+
]),
|
|
2087
|
+
children: /* @__PURE__ */ r.jsx(
|
|
2088
|
+
"input",
|
|
2089
|
+
{
|
|
2090
|
+
id: D,
|
|
2091
|
+
ref: H,
|
|
2092
|
+
className: Ve([
|
|
2093
|
+
"luna-date-picker__input",
|
|
2094
|
+
"luna-date-picker__input--range-start",
|
|
2095
|
+
$.start ? "luna-date-picker__input--filled" : "luna-date-picker__input--empty"
|
|
2096
|
+
]),
|
|
2097
|
+
type: "text",
|
|
2098
|
+
inputMode: "numeric",
|
|
2099
|
+
placeholder: "MM/DD/YYYY",
|
|
2100
|
+
value: be,
|
|
2101
|
+
disabled: l,
|
|
2102
|
+
"aria-invalid": Y ? !0 : void 0,
|
|
2103
|
+
"aria-describedby": N,
|
|
2104
|
+
"aria-labelledby": f ? `${O} ${C}` : C,
|
|
2105
|
+
onChange: (S) => ie(S.currentTarget.value),
|
|
2106
|
+
onBlur: _e
|
|
2107
|
+
}
|
|
2108
|
+
)
|
|
2109
|
+
}
|
|
2110
|
+
),
|
|
2111
|
+
/* @__PURE__ */ r.jsx("span", { id: C, className: "luna-date-picker__range-separator", children: "to" }),
|
|
2112
|
+
/* @__PURE__ */ r.jsx(
|
|
2113
|
+
"div",
|
|
2114
|
+
{
|
|
2115
|
+
className: Ve([
|
|
2116
|
+
"luna-date-picker__input-rail",
|
|
2117
|
+
"luna-date-picker__input-rail--range-end",
|
|
2118
|
+
$.end ? "luna-date-picker__input-rail--filled" : "luna-date-picker__input-rail--empty"
|
|
2119
|
+
]),
|
|
2120
|
+
children: /* @__PURE__ */ r.jsx(
|
|
2121
|
+
"input",
|
|
2122
|
+
{
|
|
2123
|
+
className: Ve([
|
|
2124
|
+
"luna-date-picker__input",
|
|
2125
|
+
"luna-date-picker__input--range-end",
|
|
2126
|
+
$.end ? "luna-date-picker__input--filled" : "luna-date-picker__input--empty"
|
|
2127
|
+
]),
|
|
2128
|
+
type: "text",
|
|
2129
|
+
inputMode: "numeric",
|
|
2130
|
+
placeholder: "MM/DD/YYYY",
|
|
2131
|
+
value: G,
|
|
2132
|
+
disabled: l,
|
|
2133
|
+
"aria-invalid": Y ? !0 : void 0,
|
|
2134
|
+
"aria-describedby": N,
|
|
2135
|
+
"aria-label": "End date",
|
|
2136
|
+
onChange: (S) => U(S.currentTarget.value),
|
|
2137
|
+
onBlur: F
|
|
2138
|
+
}
|
|
2139
|
+
)
|
|
2140
|
+
}
|
|
2141
|
+
)
|
|
2142
|
+
] }) : /* @__PURE__ */ r.jsx(
|
|
2143
|
+
"div",
|
|
2144
|
+
{
|
|
2145
|
+
className: Ve([
|
|
2146
|
+
"luna-date-picker__input-rail",
|
|
2147
|
+
"luna-date-picker__input-rail--single",
|
|
2148
|
+
te ? "luna-date-picker__input-rail--filled" : "luna-date-picker__input-rail--empty"
|
|
2149
|
+
]),
|
|
2150
|
+
children: /* @__PURE__ */ r.jsx(
|
|
2151
|
+
"input",
|
|
2152
|
+
{
|
|
2153
|
+
id: D,
|
|
2154
|
+
ref: H,
|
|
2155
|
+
className: Ve([
|
|
2156
|
+
"luna-date-picker__input",
|
|
2157
|
+
"luna-date-picker__input--single",
|
|
2158
|
+
te ? "luna-date-picker__input--filled" : "luna-date-picker__input--empty"
|
|
2159
|
+
]),
|
|
2160
|
+
type: "text",
|
|
2161
|
+
inputMode: "numeric",
|
|
2162
|
+
placeholder: "MM/DD/YYYY",
|
|
2163
|
+
value: re,
|
|
2164
|
+
disabled: l,
|
|
2165
|
+
"aria-invalid": Y ? !0 : void 0,
|
|
2166
|
+
"aria-describedby": N,
|
|
2167
|
+
"aria-labelledby": f ? `${O} ${C}` : C,
|
|
2168
|
+
onChange: (S) => de(S.currentTarget.value),
|
|
2169
|
+
onBlur: V
|
|
2170
|
+
}
|
|
2171
|
+
)
|
|
2172
|
+
}
|
|
2173
|
+
)
|
|
2174
|
+
}
|
|
2175
|
+
),
|
|
2176
|
+
R && !l ? /* @__PURE__ */ r.jsx(
|
|
2177
|
+
"button",
|
|
2178
|
+
{
|
|
2179
|
+
type: "button",
|
|
2180
|
+
className: "luna-date-picker__clear",
|
|
2181
|
+
"aria-label": "Clear value",
|
|
2182
|
+
onMouseDown: (S) => S.preventDefault(),
|
|
2183
|
+
onClick: Be
|
|
2184
|
+
}
|
|
2185
|
+
) : null,
|
|
2186
|
+
/* @__PURE__ */ r.jsx(
|
|
2187
|
+
"button",
|
|
2188
|
+
{
|
|
2189
|
+
type: "button",
|
|
2190
|
+
className: "luna-date-picker__calendar-button",
|
|
2191
|
+
disabled: l,
|
|
2192
|
+
"aria-label": "Open calendar",
|
|
2193
|
+
"aria-expanded": X,
|
|
2194
|
+
"aria-haspopup": "dialog",
|
|
2195
|
+
"aria-controls": X ? T : void 0,
|
|
2196
|
+
onMouseDown: (S) => S.preventDefault(),
|
|
2197
|
+
onClick: () => ee((S) => !S),
|
|
2198
|
+
onKeyDown: I,
|
|
2199
|
+
children: /* @__PURE__ */ r.jsx("span", { className: "luna-date-picker__calendar-icon", "aria-hidden": "true" })
|
|
2200
|
+
}
|
|
2201
|
+
),
|
|
2202
|
+
X ? /* @__PURE__ */ r.jsxs("div", { className: "luna-date-picker__panel", id: T, role: "dialog", "aria-labelledby": O, children: [
|
|
2203
|
+
/* @__PURE__ */ r.jsxs("div", { className: "luna-date-picker__calendar-header", children: [
|
|
2204
|
+
/* @__PURE__ */ r.jsx(
|
|
2205
|
+
"button",
|
|
2206
|
+
{
|
|
2207
|
+
type: "button",
|
|
2208
|
+
className: "luna-date-picker__month-nav",
|
|
2209
|
+
onMouseDown: (S) => S.preventDefault(),
|
|
2210
|
+
onClick: () => Se((S) => Rn(S, -1)),
|
|
2211
|
+
children: "Prev"
|
|
2212
|
+
}
|
|
2213
|
+
),
|
|
2214
|
+
/* @__PURE__ */ r.jsx(B, { as: "span", variant: "label", className: "luna-date-picker__month-label", children: Ae }),
|
|
2215
|
+
/* @__PURE__ */ r.jsx(
|
|
2216
|
+
"button",
|
|
2217
|
+
{
|
|
2218
|
+
type: "button",
|
|
2219
|
+
className: "luna-date-picker__month-nav",
|
|
2220
|
+
onMouseDown: (S) => S.preventDefault(),
|
|
2221
|
+
onClick: () => Se((S) => Rn(S, 1)),
|
|
2222
|
+
children: "Next"
|
|
2223
|
+
}
|
|
2224
|
+
)
|
|
2225
|
+
] }),
|
|
2226
|
+
/* @__PURE__ */ r.jsx("div", { className: "luna-date-picker__weekday-row", children: Fa().map((S) => /* @__PURE__ */ r.jsx(
|
|
2227
|
+
B,
|
|
2228
|
+
{
|
|
2229
|
+
as: "span",
|
|
2230
|
+
variant: "caption",
|
|
2231
|
+
className: "luna-date-picker__weekday",
|
|
2232
|
+
children: S
|
|
2233
|
+
},
|
|
2234
|
+
S
|
|
2235
|
+
)) }),
|
|
2236
|
+
/* @__PURE__ */ r.jsx("div", { className: "luna-date-picker__month-grid", children: Ne.map((S) => {
|
|
2237
|
+
const ue = S.date, xe = ln(ue, he), ze = ln(ue, fe), $e = !Z && ln(ue, je), Pe = Z && Ra(ue, he, fe), Ke = Ea(ue, en, nn);
|
|
2238
|
+
return /* @__PURE__ */ r.jsx(
|
|
2239
|
+
"button",
|
|
2240
|
+
{
|
|
2241
|
+
type: "button",
|
|
2242
|
+
className: Ve([
|
|
2243
|
+
"luna-date-picker__day",
|
|
2244
|
+
!S.inMonth && "luna-date-picker__day--outside-month",
|
|
2245
|
+
($e || xe || ze) && "luna-date-picker__day--selected",
|
|
2246
|
+
Pe && "luna-date-picker__day--in-range"
|
|
2247
|
+
]),
|
|
2248
|
+
disabled: Ke,
|
|
2249
|
+
onMouseDown: (Qe) => Qe.preventDefault(),
|
|
2250
|
+
onClick: () => Ce(ue),
|
|
2251
|
+
"aria-pressed": $e || xe || ze ? !0 : void 0,
|
|
2252
|
+
"data-day-value": S.value,
|
|
2253
|
+
"data-selected": $e || xe || ze ? "true" : void 0,
|
|
2254
|
+
"data-in-range": Pe ? "true" : void 0,
|
|
2255
|
+
"data-selected-single": $e ? "true" : void 0,
|
|
2256
|
+
"data-selected-start": xe ? "true" : void 0,
|
|
2257
|
+
"data-selected-end": ze ? "true" : void 0,
|
|
2258
|
+
children: S.day
|
|
2259
|
+
},
|
|
2260
|
+
S.value
|
|
2261
|
+
);
|
|
2262
|
+
}) }),
|
|
2263
|
+
/* @__PURE__ */ r.jsxs("div", { className: "luna-date-picker__actions", children: [
|
|
2264
|
+
/* @__PURE__ */ r.jsx("div", { className: "luna-date-picker__actions-pre", children: /* @__PURE__ */ r.jsx(
|
|
2265
|
+
wn,
|
|
2266
|
+
{
|
|
2267
|
+
flat: !0,
|
|
2268
|
+
onMouseDown: (S) => S.preventDefault(),
|
|
2269
|
+
onClick: Be,
|
|
2270
|
+
children: "Clear"
|
|
2271
|
+
}
|
|
2272
|
+
) }),
|
|
2273
|
+
/* @__PURE__ */ r.jsx("div", { className: "luna-date-picker__actions-post", children: /* @__PURE__ */ r.jsx(
|
|
2274
|
+
wn,
|
|
2275
|
+
{
|
|
2276
|
+
onMouseDown: (S) => S.preventDefault(),
|
|
2277
|
+
onClick: Oe,
|
|
2278
|
+
children: Z ? "Apply" : "Done"
|
|
2279
|
+
}
|
|
2280
|
+
) })
|
|
2281
|
+
] })
|
|
2282
|
+
] }) : null
|
|
2283
|
+
]
|
|
2284
|
+
}
|
|
2285
|
+
),
|
|
2286
|
+
Y ? /* @__PURE__ */ r.jsx(
|
|
2287
|
+
B,
|
|
2288
|
+
{
|
|
2289
|
+
id: N,
|
|
2290
|
+
variant: "caption",
|
|
2291
|
+
className: "luna-date-picker-field__message luna-date-picker-field__message--error",
|
|
2292
|
+
children: i
|
|
2293
|
+
}
|
|
2294
|
+
) : d != null ? /* @__PURE__ */ r.jsx(
|
|
2295
|
+
B,
|
|
2296
|
+
{
|
|
2297
|
+
id: N,
|
|
2298
|
+
variant: "caption",
|
|
2299
|
+
className: "luna-date-picker-field__message luna-date-picker-field__message--help",
|
|
2300
|
+
children: d
|
|
2301
|
+
}
|
|
2302
|
+
) : null
|
|
2303
|
+
]
|
|
2304
|
+
}
|
|
2305
|
+
);
|
|
2306
|
+
}
|
|
2307
|
+
);
|
|
2308
|
+
function La(e) {
|
|
2309
|
+
return e.filter(Boolean).join(" ");
|
|
2310
|
+
}
|
|
2311
|
+
const tt = c.forwardRef(function({ checked: a, className: n, description: s, disabled: l, error: i, helpText: g, id: v, label: d, ..._ }, b) {
|
|
2312
|
+
const f = c.useId(), y = v ?? `luna-radio-${f.replace(/:/g, "")}`, o = i || g ? `${y}-message` : void 0, h = s ? `${y}-description` : void 0, u = i != null;
|
|
2313
|
+
return /* @__PURE__ */ r.jsxs(
|
|
2314
|
+
"div",
|
|
2315
|
+
{
|
|
2316
|
+
className: La([
|
|
2317
|
+
"luna-radio-field",
|
|
2318
|
+
l && "luna-radio-field--disabled",
|
|
2319
|
+
u && "luna-radio-field--invalid",
|
|
2320
|
+
n
|
|
2321
|
+
]),
|
|
2322
|
+
children: [
|
|
2323
|
+
/* @__PURE__ */ r.jsxs("label", { htmlFor: y, className: "luna-radio-field__main", children: [
|
|
2324
|
+
/* @__PURE__ */ r.jsx(
|
|
2325
|
+
"input",
|
|
2326
|
+
{
|
|
2327
|
+
..._,
|
|
2328
|
+
ref: b,
|
|
2329
|
+
id: y,
|
|
2330
|
+
className: "luna-radio",
|
|
2331
|
+
type: "radio",
|
|
2332
|
+
checked: a,
|
|
2333
|
+
disabled: l,
|
|
2334
|
+
"aria-invalid": u ? !0 : _["aria-invalid"],
|
|
2335
|
+
"aria-describedby": [h, o].filter(Boolean).join(" ") || void 0
|
|
2336
|
+
}
|
|
2337
|
+
),
|
|
2338
|
+
/* @__PURE__ */ r.jsx("span", { className: "luna-radio__control", "aria-hidden": "true" }),
|
|
2339
|
+
/* @__PURE__ */ r.jsxs("span", { className: "luna-radio-field__text", children: [
|
|
2340
|
+
d != null ? /* @__PURE__ */ r.jsx(B, { as: "span", variant: "label", className: "luna-radio-field__label", children: d }) : null,
|
|
2341
|
+
s != null ? /* @__PURE__ */ r.jsx(
|
|
2342
|
+
B,
|
|
2343
|
+
{
|
|
2344
|
+
id: h,
|
|
2345
|
+
as: "span",
|
|
2346
|
+
variant: "body-small",
|
|
2347
|
+
className: "luna-radio-field__description",
|
|
2348
|
+
children: s
|
|
2349
|
+
}
|
|
2350
|
+
) : null
|
|
2351
|
+
] })
|
|
2352
|
+
] }),
|
|
2353
|
+
u ? /* @__PURE__ */ r.jsx(
|
|
2354
|
+
B,
|
|
2355
|
+
{
|
|
2356
|
+
id: o,
|
|
2357
|
+
variant: "caption",
|
|
2358
|
+
className: "luna-radio-field__message luna-radio-field__message--error",
|
|
2359
|
+
children: i
|
|
2360
|
+
}
|
|
2361
|
+
) : g != null ? /* @__PURE__ */ r.jsx(
|
|
2362
|
+
B,
|
|
2363
|
+
{
|
|
2364
|
+
id: o,
|
|
2365
|
+
variant: "caption",
|
|
2366
|
+
className: "luna-radio-field__message luna-radio-field__message--help",
|
|
2367
|
+
children: g
|
|
2368
|
+
}
|
|
2369
|
+
) : null
|
|
2370
|
+
]
|
|
1513
2371
|
}
|
|
1514
2372
|
);
|
|
1515
2373
|
});
|
|
1516
|
-
function
|
|
2374
|
+
function Ta(e) {
|
|
1517
2375
|
return e.filter(Boolean).join(" ");
|
|
1518
2376
|
}
|
|
1519
|
-
function
|
|
2377
|
+
function Dn(e, a) {
|
|
1520
2378
|
if (e)
|
|
1521
|
-
return
|
|
2379
|
+
return M(a.spacing, e) ?? e;
|
|
1522
2380
|
}
|
|
1523
|
-
const
|
|
2381
|
+
const rt = c.forwardRef(function({
|
|
1524
2382
|
as: a,
|
|
1525
|
-
className:
|
|
1526
|
-
decorative:
|
|
2383
|
+
className: n,
|
|
2384
|
+
decorative: s,
|
|
1527
2385
|
inset: l,
|
|
1528
|
-
label:
|
|
1529
|
-
labelAlign:
|
|
1530
|
-
orientation:
|
|
1531
|
-
spacing:
|
|
1532
|
-
style:
|
|
1533
|
-
tone:
|
|
1534
|
-
...
|
|
1535
|
-
},
|
|
1536
|
-
const { theme:
|
|
1537
|
-
...
|
|
1538
|
-
...
|
|
1539
|
-
...
|
|
1540
|
-
},
|
|
2386
|
+
label: i,
|
|
2387
|
+
labelAlign: g = "center",
|
|
2388
|
+
orientation: v = "horizontal",
|
|
2389
|
+
spacing: d,
|
|
2390
|
+
style: _,
|
|
2391
|
+
tone: b = "default",
|
|
2392
|
+
...f
|
|
2393
|
+
}, y) {
|
|
2394
|
+
const { theme: o } = Re(), h = Dn(d, o), u = typeof l == "string" ? Dn(l, o) : l ? "var(--luna-divider-inset-default)" : void 0, j = v === "horizontal" && i !== void 0 && i !== null, k = a ?? (v === "vertical" || j ? "div" : "hr"), D = {
|
|
2395
|
+
...h ? { "--luna-divider-spacing": h } : {},
|
|
2396
|
+
...u ? { "--luna-divider-inset": u } : {},
|
|
2397
|
+
..._
|
|
2398
|
+
}, O = Ta([
|
|
1541
2399
|
"luna-divider",
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
2400
|
+
v === "vertical" ? "luna-divider--vertical" : "luna-divider--horizontal",
|
|
2401
|
+
b === "muted" && "luna-divider--muted",
|
|
2402
|
+
b === "strong" && "luna-divider--strong",
|
|
1545
2403
|
l && "luna-divider--inset",
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
]),
|
|
1550
|
-
return /* @__PURE__ */
|
|
1551
|
-
|
|
2404
|
+
j && "luna-divider--labeled",
|
|
2405
|
+
j && `luna-divider--label-${g}`,
|
|
2406
|
+
n
|
|
2407
|
+
]), C = v === "vertical" ? s ? { "aria-hidden": !0 } : { role: "separator", "aria-orientation": "vertical" } : j ? s ? { "aria-hidden": !0 } : { role: "separator", "aria-orientation": "horizontal" } : s ? { "aria-hidden": !0 } : {};
|
|
2408
|
+
return /* @__PURE__ */ r.jsx(
|
|
2409
|
+
k,
|
|
1552
2410
|
{
|
|
1553
|
-
...
|
|
1554
|
-
...
|
|
1555
|
-
ref:
|
|
1556
|
-
className:
|
|
1557
|
-
style:
|
|
1558
|
-
children:
|
|
2411
|
+
...f,
|
|
2412
|
+
...C,
|
|
2413
|
+
ref: y,
|
|
2414
|
+
className: O,
|
|
2415
|
+
style: D,
|
|
2416
|
+
children: j ? /* @__PURE__ */ r.jsx(B, { as: "span", variant: "caption", className: "luna-divider__label", children: i }) : null
|
|
1559
2417
|
}
|
|
1560
2418
|
);
|
|
1561
2419
|
});
|
|
1562
|
-
function
|
|
2420
|
+
function Oa(e) {
|
|
1563
2421
|
return e.filter(Boolean).join(" ");
|
|
1564
2422
|
}
|
|
1565
|
-
function
|
|
2423
|
+
function Aa(e, a) {
|
|
1566
2424
|
if (e)
|
|
1567
|
-
return
|
|
2425
|
+
return M(a.spacing, e) ?? e;
|
|
1568
2426
|
}
|
|
1569
|
-
function
|
|
2427
|
+
function Va(e) {
|
|
1570
2428
|
return e === "center" ? { item: "center", text: "center" } : e === "right" ? { item: "end", text: "right" } : { item: "start", text: "left" };
|
|
1571
2429
|
}
|
|
1572
|
-
function
|
|
2430
|
+
function Pa(e) {
|
|
1573
2431
|
return e === "sm" ? {
|
|
1574
2432
|
title: "label",
|
|
1575
2433
|
subtitle: "caption"
|
|
@@ -1581,302 +2439,362 @@ function bt(e) {
|
|
|
1581
2439
|
subtitle: "body-small"
|
|
1582
2440
|
};
|
|
1583
2441
|
}
|
|
1584
|
-
const
|
|
1585
|
-
const { theme:
|
|
1586
|
-
...
|
|
1587
|
-
"--luna-header-align":
|
|
1588
|
-
"--luna-header-text-align":
|
|
1589
|
-
...
|
|
2442
|
+
const lt = c.forwardRef(function({ align: a = "left", as: n, className: s, gap: l, size: i = "md", style: g, subtitle: v, title: d, ..._ }, b) {
|
|
2443
|
+
const { theme: f } = Re(), y = n ?? "div", o = Aa(l, f), h = Va(a), u = Pa(i), j = {
|
|
2444
|
+
...o ? { "--luna-header-gap": o } : {},
|
|
2445
|
+
"--luna-header-align": h.item,
|
|
2446
|
+
"--luna-header-text-align": h.text,
|
|
2447
|
+
...g
|
|
1590
2448
|
};
|
|
1591
|
-
return /* @__PURE__ */
|
|
1592
|
-
|
|
2449
|
+
return /* @__PURE__ */ r.jsxs(
|
|
2450
|
+
y,
|
|
1593
2451
|
{
|
|
1594
|
-
...
|
|
1595
|
-
ref:
|
|
1596
|
-
className:
|
|
1597
|
-
style:
|
|
2452
|
+
..._,
|
|
2453
|
+
ref: b,
|
|
2454
|
+
className: Oa(["luna-header", s]),
|
|
2455
|
+
style: j,
|
|
1598
2456
|
children: [
|
|
1599
|
-
|
|
1600
|
-
|
|
2457
|
+
d != null ? typeof d == "string" ? /* @__PURE__ */ r.jsx(
|
|
2458
|
+
B,
|
|
1601
2459
|
{
|
|
1602
2460
|
as: "h2",
|
|
1603
|
-
variant:
|
|
2461
|
+
variant: u.title,
|
|
1604
2462
|
className: "luna-header__title",
|
|
1605
|
-
"data-size":
|
|
1606
|
-
children:
|
|
2463
|
+
"data-size": i,
|
|
2464
|
+
children: d
|
|
1607
2465
|
}
|
|
1608
|
-
) : /* @__PURE__ */
|
|
1609
|
-
|
|
1610
|
-
|
|
2466
|
+
) : /* @__PURE__ */ r.jsx("div", { className: "luna-header__title", "data-size": i, children: d }) : null,
|
|
2467
|
+
v != null ? typeof v == "string" ? /* @__PURE__ */ r.jsx(
|
|
2468
|
+
B,
|
|
1611
2469
|
{
|
|
1612
|
-
variant:
|
|
2470
|
+
variant: u.subtitle,
|
|
1613
2471
|
muted: !0,
|
|
1614
2472
|
className: "luna-header__subtitle",
|
|
1615
|
-
"data-size":
|
|
1616
|
-
children:
|
|
2473
|
+
"data-size": i,
|
|
2474
|
+
children: v
|
|
1617
2475
|
}
|
|
1618
|
-
) : /* @__PURE__ */
|
|
2476
|
+
) : /* @__PURE__ */ r.jsx("div", { className: "luna-header__subtitle", "data-size": i, children: v }) : null
|
|
1619
2477
|
]
|
|
1620
2478
|
}
|
|
1621
2479
|
);
|
|
1622
2480
|
});
|
|
1623
|
-
function
|
|
1624
|
-
return e === "transparent" || e === "rgba(0, 0, 0, 0)";
|
|
1625
|
-
}
|
|
1626
|
-
function _t(e) {
|
|
1627
|
-
let a = (e == null ? void 0 : e.parentElement) ?? null;
|
|
1628
|
-
for (; a; ) {
|
|
1629
|
-
const t = window.getComputedStyle(a).backgroundColor;
|
|
1630
|
-
if (t && !ht(t))
|
|
1631
|
-
return t;
|
|
1632
|
-
a = a.parentElement;
|
|
1633
|
-
}
|
|
1634
|
-
return "";
|
|
1635
|
-
}
|
|
1636
|
-
function Pe(e = []) {
|
|
1637
|
-
const a = d.useRef(null);
|
|
1638
|
-
return d.useLayoutEffect(() => {
|
|
1639
|
-
const t = a.current;
|
|
1640
|
-
if (!t)
|
|
1641
|
-
return;
|
|
1642
|
-
const u = _t(t);
|
|
1643
|
-
if (u) {
|
|
1644
|
-
t.style.setProperty("--luna-container-bg", u);
|
|
1645
|
-
return;
|
|
1646
|
-
}
|
|
1647
|
-
t.style.removeProperty("--luna-container-bg");
|
|
1648
|
-
}, e), a;
|
|
1649
|
-
}
|
|
1650
|
-
function xt(e) {
|
|
2481
|
+
function Ya(e) {
|
|
1651
2482
|
return e.filter(Boolean).join(" ");
|
|
1652
2483
|
}
|
|
1653
|
-
const
|
|
2484
|
+
const it = c.forwardRef(function({
|
|
1654
2485
|
onBlur: a,
|
|
1655
|
-
onChange:
|
|
1656
|
-
placeholder:
|
|
2486
|
+
onChange: n,
|
|
2487
|
+
placeholder: s,
|
|
1657
2488
|
className: l,
|
|
1658
|
-
defaultValue:
|
|
1659
|
-
disabled:
|
|
1660
|
-
error:
|
|
1661
|
-
externalLabel:
|
|
1662
|
-
fullWidth:
|
|
1663
|
-
helpText:
|
|
1664
|
-
id:
|
|
1665
|
-
inputSize:
|
|
1666
|
-
label:
|
|
1667
|
-
leading:
|
|
1668
|
-
trailing:
|
|
1669
|
-
value:
|
|
1670
|
-
...
|
|
1671
|
-
},
|
|
1672
|
-
var
|
|
1673
|
-
const { theme:
|
|
1674
|
-
|
|
2489
|
+
defaultValue: i,
|
|
2490
|
+
disabled: g,
|
|
2491
|
+
error: v,
|
|
2492
|
+
externalLabel: d = !1,
|
|
2493
|
+
fullWidth: _,
|
|
2494
|
+
helpText: b,
|
|
2495
|
+
id: f,
|
|
2496
|
+
inputSize: y,
|
|
2497
|
+
label: o,
|
|
2498
|
+
leading: h,
|
|
2499
|
+
trailing: u,
|
|
2500
|
+
value: j,
|
|
2501
|
+
...k
|
|
2502
|
+
}, D) {
|
|
2503
|
+
var ge;
|
|
2504
|
+
const { theme: O } = Re(), C = c.useId(), T = f ?? `luna-input-${C.replace(/:/g, "")}`, N = v || b ? `${T}-message` : void 0, p = y ?? ((ge = O.components.input) == null ? void 0 : ge.defaultSize) ?? "md", Y = v != null, K = o != null && d, P = o != null && !d, Q = typeof s == "string" && s.length > 0, H = We([O]), [X, ee] = c.useState(!1), [ce, oe] = c.useState(
|
|
2505
|
+
j !== void 0 ? String(j).length > 0 : i !== void 0 ? String(i).length > 0 : !1
|
|
1675
2506
|
);
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
}, [
|
|
1679
|
-
function
|
|
1680
|
-
|
|
2507
|
+
c.useEffect(() => {
|
|
2508
|
+
j !== void 0 && oe(String(j).length > 0);
|
|
2509
|
+
}, [j]);
|
|
2510
|
+
function me(q) {
|
|
2511
|
+
j === void 0 && oe(q.currentTarget.value.length > 0), n == null || n(q);
|
|
1681
2512
|
}
|
|
1682
|
-
function
|
|
1683
|
-
var
|
|
1684
|
-
ee(!0), (
|
|
2513
|
+
function pe(q) {
|
|
2514
|
+
var L;
|
|
2515
|
+
ee(!0), (L = k.onFocus) == null || L.call(k, q);
|
|
1685
2516
|
}
|
|
1686
|
-
function
|
|
1687
|
-
ee(!1),
|
|
2517
|
+
function Z(q) {
|
|
2518
|
+
ee(!1), j === void 0 && oe(q.currentTarget.value.length > 0), a == null || a(q);
|
|
1688
2519
|
}
|
|
1689
|
-
return /* @__PURE__ */
|
|
2520
|
+
return /* @__PURE__ */ r.jsxs(
|
|
1690
2521
|
"div",
|
|
1691
2522
|
{
|
|
1692
|
-
ref:
|
|
1693
|
-
className:
|
|
2523
|
+
ref: H,
|
|
2524
|
+
className: Ya([
|
|
1694
2525
|
"luna-input-field",
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
2526
|
+
_ && "luna-input-field--full-width",
|
|
2527
|
+
P && "luna-input-field--inset-label",
|
|
2528
|
+
P && (X || ce || Q) && "luna-input-field--inset-label-active",
|
|
2529
|
+
g && "luna-input-field--disabled",
|
|
2530
|
+
Y && "luna-input-field--invalid",
|
|
1700
2531
|
l
|
|
1701
2532
|
]),
|
|
1702
|
-
"data-size":
|
|
2533
|
+
"data-size": p,
|
|
1703
2534
|
children: [
|
|
1704
|
-
K ? /* @__PURE__ */
|
|
1705
|
-
/* @__PURE__ */
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
/* @__PURE__ */
|
|
2535
|
+
K ? /* @__PURE__ */ r.jsx("label", { htmlFor: T, className: "luna-input-field__label", children: /* @__PURE__ */ r.jsx(B, { as: "span", variant: "label", children: o }) }) : null,
|
|
2536
|
+
/* @__PURE__ */ r.jsxs("div", { className: "luna-input-field__control", children: [
|
|
2537
|
+
P ? /* @__PURE__ */ r.jsx("label", { htmlFor: T, className: "luna-input-field__label luna-input-field__label--inset", children: /* @__PURE__ */ r.jsx(B, { as: "span", variant: "caption", children: o }) }) : null,
|
|
2538
|
+
h != null ? /* @__PURE__ */ r.jsx("div", { className: "luna-input-field__leading", children: h }) : null,
|
|
2539
|
+
/* @__PURE__ */ r.jsx("div", { className: "luna-input-field__content", children: /* @__PURE__ */ r.jsx(
|
|
1709
2540
|
"input",
|
|
1710
2541
|
{
|
|
1711
|
-
...
|
|
1712
|
-
id:
|
|
1713
|
-
ref:
|
|
2542
|
+
...k,
|
|
2543
|
+
id: T,
|
|
2544
|
+
ref: D,
|
|
1714
2545
|
className: "luna-input",
|
|
1715
|
-
value:
|
|
1716
|
-
defaultValue:
|
|
1717
|
-
placeholder:
|
|
1718
|
-
disabled:
|
|
1719
|
-
onChange:
|
|
1720
|
-
onFocus:
|
|
1721
|
-
onBlur:
|
|
1722
|
-
"aria-invalid":
|
|
1723
|
-
"aria-describedby":
|
|
2546
|
+
value: j,
|
|
2547
|
+
defaultValue: i,
|
|
2548
|
+
placeholder: s,
|
|
2549
|
+
disabled: g,
|
|
2550
|
+
onChange: me,
|
|
2551
|
+
onFocus: pe,
|
|
2552
|
+
onBlur: Z,
|
|
2553
|
+
"aria-invalid": Y ? !0 : k["aria-invalid"],
|
|
2554
|
+
"aria-describedby": N ?? k["aria-describedby"]
|
|
1724
2555
|
}
|
|
1725
2556
|
) }),
|
|
1726
|
-
|
|
2557
|
+
u != null ? /* @__PURE__ */ r.jsx("div", { className: "luna-input-field__trailing", children: u }) : null
|
|
1727
2558
|
] }),
|
|
1728
|
-
|
|
1729
|
-
|
|
2559
|
+
Y ? /* @__PURE__ */ r.jsx(
|
|
2560
|
+
B,
|
|
1730
2561
|
{
|
|
1731
|
-
id:
|
|
2562
|
+
id: N,
|
|
1732
2563
|
variant: "caption",
|
|
1733
2564
|
className: "luna-input-field__message luna-input-field__message--error",
|
|
1734
|
-
children:
|
|
2565
|
+
children: v
|
|
1735
2566
|
}
|
|
1736
|
-
) :
|
|
1737
|
-
|
|
2567
|
+
) : b != null ? /* @__PURE__ */ r.jsx(
|
|
2568
|
+
B,
|
|
1738
2569
|
{
|
|
1739
|
-
id:
|
|
2570
|
+
id: N,
|
|
1740
2571
|
variant: "caption",
|
|
1741
2572
|
className: "luna-input-field__message luna-input-field__message--help",
|
|
1742
|
-
children:
|
|
2573
|
+
children: b
|
|
2574
|
+
}
|
|
2575
|
+
) : null
|
|
2576
|
+
]
|
|
2577
|
+
}
|
|
2578
|
+
);
|
|
2579
|
+
});
|
|
2580
|
+
function Ha(e) {
|
|
2581
|
+
return e.filter(Boolean).join(" ");
|
|
2582
|
+
}
|
|
2583
|
+
function Wa(e, a, n) {
|
|
2584
|
+
return n <= a ? 0 : (e - a) / (n - a) * 100;
|
|
2585
|
+
}
|
|
2586
|
+
const st = c.forwardRef(function({
|
|
2587
|
+
className: a,
|
|
2588
|
+
defaultValue: n,
|
|
2589
|
+
description: s,
|
|
2590
|
+
disabled: l,
|
|
2591
|
+
error: i,
|
|
2592
|
+
helpText: g,
|
|
2593
|
+
id: v,
|
|
2594
|
+
label: d,
|
|
2595
|
+
max: _ = 100,
|
|
2596
|
+
min: b = 0,
|
|
2597
|
+
onChange: f,
|
|
2598
|
+
showValue: y = !0,
|
|
2599
|
+
step: o,
|
|
2600
|
+
value: h,
|
|
2601
|
+
...u
|
|
2602
|
+
}, j) {
|
|
2603
|
+
const k = c.useId(), D = v ?? `luna-slider-${k.replace(/:/g, "")}`, O = i || g ? `${D}-message` : void 0, C = s ? `${D}-description` : void 0, T = i != null, N = Number(h !== void 0 ? h : n !== void 0 ? n : b), [p, Y] = c.useState(N);
|
|
2604
|
+
c.useEffect(() => {
|
|
2605
|
+
h !== void 0 && Y(Number(h));
|
|
2606
|
+
}, [h]);
|
|
2607
|
+
function K(Q) {
|
|
2608
|
+
h === void 0 && Y(Number(Q.currentTarget.value)), f == null || f(Q);
|
|
2609
|
+
}
|
|
2610
|
+
const P = Wa(p, Number(b), Number(_));
|
|
2611
|
+
return /* @__PURE__ */ r.jsxs(
|
|
2612
|
+
"div",
|
|
2613
|
+
{
|
|
2614
|
+
className: Ha([
|
|
2615
|
+
"luna-slider-field",
|
|
2616
|
+
l && "luna-slider-field--disabled",
|
|
2617
|
+
T && "luna-slider-field--invalid",
|
|
2618
|
+
a
|
|
2619
|
+
]),
|
|
2620
|
+
style: { "--luna-slider-percent": `${P}%` },
|
|
2621
|
+
children: [
|
|
2622
|
+
d != null || y ? /* @__PURE__ */ r.jsxs("div", { className: "luna-slider-field__header", children: [
|
|
2623
|
+
d != null ? /* @__PURE__ */ r.jsx("label", { htmlFor: D, className: "luna-slider-field__label", children: /* @__PURE__ */ r.jsx(B, { as: "span", variant: "label", children: d }) }) : /* @__PURE__ */ r.jsx("span", {}),
|
|
2624
|
+
y ? /* @__PURE__ */ r.jsx(B, { as: "span", variant: "caption", className: "luna-slider-field__value", children: p }) : null
|
|
2625
|
+
] }) : null,
|
|
2626
|
+
s != null ? /* @__PURE__ */ r.jsx(B, { id: C, variant: "body-small", className: "luna-slider-field__description", children: s }) : null,
|
|
2627
|
+
/* @__PURE__ */ r.jsx(
|
|
2628
|
+
"input",
|
|
2629
|
+
{
|
|
2630
|
+
...u,
|
|
2631
|
+
id: D,
|
|
2632
|
+
ref: j,
|
|
2633
|
+
className: "luna-slider",
|
|
2634
|
+
type: "range",
|
|
2635
|
+
min: b,
|
|
2636
|
+
max: _,
|
|
2637
|
+
step: o,
|
|
2638
|
+
value: h,
|
|
2639
|
+
defaultValue: n,
|
|
2640
|
+
disabled: l,
|
|
2641
|
+
onChange: K,
|
|
2642
|
+
"aria-invalid": T ? !0 : u["aria-invalid"],
|
|
2643
|
+
"aria-describedby": [C, O, u["aria-describedby"]].filter(Boolean).join(" ") || void 0
|
|
2644
|
+
}
|
|
2645
|
+
),
|
|
2646
|
+
T ? /* @__PURE__ */ r.jsx(
|
|
2647
|
+
B,
|
|
2648
|
+
{
|
|
2649
|
+
id: O,
|
|
2650
|
+
variant: "caption",
|
|
2651
|
+
className: "luna-slider-field__message luna-slider-field__message--error",
|
|
2652
|
+
children: i
|
|
2653
|
+
}
|
|
2654
|
+
) : g != null ? /* @__PURE__ */ r.jsx(
|
|
2655
|
+
B,
|
|
2656
|
+
{
|
|
2657
|
+
id: O,
|
|
2658
|
+
variant: "caption",
|
|
2659
|
+
className: "luna-slider-field__message luna-slider-field__message--help",
|
|
2660
|
+
children: g
|
|
1743
2661
|
}
|
|
1744
2662
|
) : null
|
|
1745
2663
|
]
|
|
1746
2664
|
}
|
|
1747
2665
|
);
|
|
1748
2666
|
});
|
|
1749
|
-
function
|
|
2667
|
+
function Ua(e) {
|
|
1750
2668
|
return e.filter(Boolean).join(" ");
|
|
1751
2669
|
}
|
|
1752
|
-
function
|
|
2670
|
+
function Fn(e, a) {
|
|
1753
2671
|
if (e)
|
|
1754
|
-
return
|
|
2672
|
+
return M(a.spacing, e) ?? e;
|
|
1755
2673
|
}
|
|
1756
|
-
const
|
|
2674
|
+
const ut = c.forwardRef(
|
|
1757
2675
|
function({
|
|
1758
2676
|
className: a,
|
|
1759
|
-
defaultValue:
|
|
1760
|
-
disabled:
|
|
2677
|
+
defaultValue: n,
|
|
2678
|
+
disabled: s,
|
|
1761
2679
|
error: l,
|
|
1762
|
-
externalLabel:
|
|
1763
|
-
fullWidth:
|
|
1764
|
-
helpText:
|
|
1765
|
-
id:
|
|
1766
|
-
inputSize:
|
|
1767
|
-
label:
|
|
1768
|
-
maxRows:
|
|
1769
|
-
minHeight:
|
|
1770
|
-
minRows:
|
|
1771
|
-
height:
|
|
1772
|
-
onBlur:
|
|
1773
|
-
onChange:
|
|
1774
|
-
placeholder:
|
|
1775
|
-
resize:
|
|
1776
|
-
rows:
|
|
1777
|
-
value:
|
|
1778
|
-
autoGrow:
|
|
1779
|
-
style:
|
|
1780
|
-
...
|
|
1781
|
-
},
|
|
1782
|
-
var
|
|
1783
|
-
const { theme: K } =
|
|
1784
|
-
|
|
1785
|
-
),
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
}, [
|
|
1789
|
-
const
|
|
1790
|
-
const
|
|
1791
|
-
if (!
|
|
2680
|
+
externalLabel: i = !1,
|
|
2681
|
+
fullWidth: g,
|
|
2682
|
+
helpText: v,
|
|
2683
|
+
id: d,
|
|
2684
|
+
inputSize: _,
|
|
2685
|
+
label: b,
|
|
2686
|
+
maxRows: f,
|
|
2687
|
+
minHeight: y,
|
|
2688
|
+
minRows: o,
|
|
2689
|
+
height: h,
|
|
2690
|
+
onBlur: u,
|
|
2691
|
+
onChange: j,
|
|
2692
|
+
placeholder: k,
|
|
2693
|
+
resize: D = "none",
|
|
2694
|
+
rows: O,
|
|
2695
|
+
value: C,
|
|
2696
|
+
autoGrow: T,
|
|
2697
|
+
style: N,
|
|
2698
|
+
...p
|
|
2699
|
+
}, Y) {
|
|
2700
|
+
var ie;
|
|
2701
|
+
const { theme: K } = Re(), P = c.useId(), Q = d ?? `luna-textarea-${P.replace(/:/g, "")}`, H = l || v ? `${Q}-message` : void 0, X = _ ?? ((ie = K.components.input) == null ? void 0 : ie.defaultSize) ?? "md", ee = l != null, ce = b != null && i, oe = b != null && !i, me = typeof k == "string" && k.length > 0, pe = We([K]), [Z, ge] = c.useState(!1), [q, L] = c.useState(
|
|
2702
|
+
C !== void 0 ? String(C).length > 0 : n !== void 0 ? String(n).length > 0 : !1
|
|
2703
|
+
), A = c.useRef(null);
|
|
2704
|
+
c.useImperativeHandle(Y, () => A.current, []), c.useEffect(() => {
|
|
2705
|
+
C !== void 0 && L(String(C).length > 0);
|
|
2706
|
+
}, [C]);
|
|
2707
|
+
const ne = c.useCallback(() => {
|
|
2708
|
+
const G = A.current;
|
|
2709
|
+
if (!T || !G)
|
|
1792
2710
|
return;
|
|
1793
|
-
|
|
1794
|
-
const
|
|
1795
|
-
|
|
1796
|
-
}, [
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
}, [
|
|
1800
|
-
function
|
|
1801
|
-
|
|
1802
|
-
}
|
|
1803
|
-
function
|
|
1804
|
-
var
|
|
1805
|
-
|
|
1806
|
-
}
|
|
1807
|
-
function
|
|
1808
|
-
|
|
2711
|
+
G.style.height = "auto";
|
|
2712
|
+
const U = window.getComputedStyle(G), je = Number.parseFloat(U.lineHeight || "0") || 24, he = Number.parseFloat(U.borderTopWidth || "0") + Number.parseFloat(U.borderBottomWidth || "0"), fe = Number.parseFloat(U.paddingTop || "0") + Number.parseFloat(U.paddingBottom || "0"), we = o ? je * o + he + fe : 0, Ee = f ? je * f + he + fe : void 0, Se = Math.max(G.scrollHeight, we || 0);
|
|
2713
|
+
G.style.height = `${Ee ? Math.min(Se, Ee) : Se}px`;
|
|
2714
|
+
}, [T, f, o]);
|
|
2715
|
+
c.useLayoutEffect(() => {
|
|
2716
|
+
ne();
|
|
2717
|
+
}, [ne, C, n]);
|
|
2718
|
+
function te(G) {
|
|
2719
|
+
C === void 0 && L(G.currentTarget.value.length > 0), j == null || j(G), T && ne();
|
|
2720
|
+
}
|
|
2721
|
+
function $(G) {
|
|
2722
|
+
var U;
|
|
2723
|
+
ge(!0), (U = p.onFocus) == null || U.call(p, G);
|
|
2724
|
+
}
|
|
2725
|
+
function re(G) {
|
|
2726
|
+
ge(!1), C === void 0 && L(G.currentTarget.value.length > 0), u == null || u(G);
|
|
1809
2727
|
}
|
|
1810
2728
|
const de = {
|
|
1811
|
-
...
|
|
1812
|
-
...
|
|
1813
|
-
"--luna-textarea-resize":
|
|
1814
|
-
...
|
|
1815
|
-
}, be =
|
|
1816
|
-
return /* @__PURE__ */
|
|
2729
|
+
...y ? { "--luna-textarea-min-height": Fn(y, K) } : {},
|
|
2730
|
+
...h ? { "--luna-textarea-height": Fn(h, K) } : {},
|
|
2731
|
+
"--luna-textarea-resize": D,
|
|
2732
|
+
...N
|
|
2733
|
+
}, be = O ?? o ?? 3;
|
|
2734
|
+
return /* @__PURE__ */ r.jsxs(
|
|
1817
2735
|
"div",
|
|
1818
2736
|
{
|
|
1819
|
-
ref:
|
|
1820
|
-
className:
|
|
2737
|
+
ref: pe,
|
|
2738
|
+
className: Ua([
|
|
1821
2739
|
"luna-textarea-field",
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
2740
|
+
g && "luna-textarea-field--full-width",
|
|
2741
|
+
oe && "luna-textarea-field--inset-label",
|
|
2742
|
+
oe && (Z || q || me) && "luna-textarea-field--inset-label-active",
|
|
2743
|
+
s && "luna-textarea-field--disabled",
|
|
1826
2744
|
ee && "luna-textarea-field--invalid",
|
|
1827
2745
|
a
|
|
1828
2746
|
]),
|
|
1829
|
-
"data-size":
|
|
2747
|
+
"data-size": X,
|
|
1830
2748
|
children: [
|
|
1831
|
-
|
|
1832
|
-
/* @__PURE__ */
|
|
1833
|
-
|
|
2749
|
+
ce ? /* @__PURE__ */ r.jsx("label", { htmlFor: Q, className: "luna-textarea-field__label", children: /* @__PURE__ */ r.jsx(B, { as: "span", variant: "label", children: b }) }) : null,
|
|
2750
|
+
/* @__PURE__ */ r.jsxs("div", { className: "luna-textarea-field__control", style: de, children: [
|
|
2751
|
+
oe ? /* @__PURE__ */ r.jsx(
|
|
1834
2752
|
"label",
|
|
1835
2753
|
{
|
|
1836
|
-
htmlFor:
|
|
2754
|
+
htmlFor: Q,
|
|
1837
2755
|
className: "luna-textarea-field__label luna-textarea-field__label--inset",
|
|
1838
|
-
children: /* @__PURE__ */
|
|
2756
|
+
children: /* @__PURE__ */ r.jsx(B, { as: "span", variant: "caption", children: b })
|
|
1839
2757
|
}
|
|
1840
2758
|
) : null,
|
|
1841
|
-
/* @__PURE__ */
|
|
2759
|
+
/* @__PURE__ */ r.jsx(
|
|
1842
2760
|
"textarea",
|
|
1843
2761
|
{
|
|
1844
|
-
...
|
|
1845
|
-
id:
|
|
1846
|
-
ref:
|
|
2762
|
+
...p,
|
|
2763
|
+
id: Q,
|
|
2764
|
+
ref: A,
|
|
1847
2765
|
className: "luna-textarea",
|
|
1848
|
-
value:
|
|
1849
|
-
defaultValue:
|
|
1850
|
-
placeholder:
|
|
1851
|
-
disabled:
|
|
2766
|
+
value: C,
|
|
2767
|
+
defaultValue: n,
|
|
2768
|
+
placeholder: k,
|
|
2769
|
+
disabled: s,
|
|
1852
2770
|
rows: be,
|
|
1853
|
-
onChange:
|
|
1854
|
-
onFocus:
|
|
1855
|
-
onBlur:
|
|
1856
|
-
"aria-invalid": ee ? !0 :
|
|
1857
|
-
"aria-describedby":
|
|
2771
|
+
onChange: te,
|
|
2772
|
+
onFocus: $,
|
|
2773
|
+
onBlur: re,
|
|
2774
|
+
"aria-invalid": ee ? !0 : p["aria-invalid"],
|
|
2775
|
+
"aria-describedby": H ?? p["aria-describedby"],
|
|
1858
2776
|
style: {
|
|
1859
2777
|
minHeight: "var(--luna-textarea-min-height, auto)",
|
|
1860
|
-
height:
|
|
2778
|
+
height: T ? void 0 : "var(--luna-textarea-height, auto)"
|
|
1861
2779
|
}
|
|
1862
2780
|
}
|
|
1863
2781
|
)
|
|
1864
2782
|
] }),
|
|
1865
|
-
ee ? /* @__PURE__ */
|
|
1866
|
-
|
|
2783
|
+
ee ? /* @__PURE__ */ r.jsx(
|
|
2784
|
+
B,
|
|
1867
2785
|
{
|
|
1868
|
-
id:
|
|
2786
|
+
id: H,
|
|
1869
2787
|
variant: "caption",
|
|
1870
2788
|
className: "luna-textarea-field__message luna-textarea-field__message--error",
|
|
1871
2789
|
children: l
|
|
1872
2790
|
}
|
|
1873
|
-
) :
|
|
1874
|
-
|
|
2791
|
+
) : v != null ? /* @__PURE__ */ r.jsx(
|
|
2792
|
+
B,
|
|
1875
2793
|
{
|
|
1876
|
-
id:
|
|
2794
|
+
id: H,
|
|
1877
2795
|
variant: "caption",
|
|
1878
2796
|
className: "luna-textarea-field__message luna-textarea-field__message--help",
|
|
1879
|
-
children:
|
|
2797
|
+
children: v
|
|
1880
2798
|
}
|
|
1881
2799
|
) : null
|
|
1882
2800
|
]
|
|
@@ -1884,584 +2802,584 @@ const kt = d.forwardRef(
|
|
|
1884
2802
|
);
|
|
1885
2803
|
}
|
|
1886
2804
|
);
|
|
1887
|
-
function
|
|
2805
|
+
function sn(e) {
|
|
1888
2806
|
return e.filter(Boolean).join(" ");
|
|
1889
2807
|
}
|
|
1890
|
-
function
|
|
2808
|
+
function Ka(e, a) {
|
|
1891
2809
|
return typeof e == "string" ? e : typeof a == "string" ? a : "";
|
|
1892
2810
|
}
|
|
1893
|
-
function
|
|
1894
|
-
return e.find((
|
|
2811
|
+
function Xa(e, a) {
|
|
2812
|
+
return e.find((n) => n.value === a);
|
|
1895
2813
|
}
|
|
1896
|
-
function
|
|
2814
|
+
function un(e) {
|
|
1897
2815
|
return e.findIndex((a) => !a.disabled);
|
|
1898
2816
|
}
|
|
1899
|
-
function
|
|
2817
|
+
function Cn(e, a, n) {
|
|
1900
2818
|
var l;
|
|
1901
2819
|
if (!e.length)
|
|
1902
2820
|
return -1;
|
|
1903
|
-
let
|
|
1904
|
-
for (let
|
|
1905
|
-
if (
|
|
1906
|
-
return
|
|
2821
|
+
let s = a;
|
|
2822
|
+
for (let i = 0; i < e.length; i += 1)
|
|
2823
|
+
if (s = (s + n + e.length) % e.length, !((l = e[s]) != null && l.disabled))
|
|
2824
|
+
return s;
|
|
1907
2825
|
return -1;
|
|
1908
2826
|
}
|
|
1909
|
-
const
|
|
2827
|
+
const ot = c.forwardRef(function({
|
|
1910
2828
|
className: a,
|
|
1911
|
-
defaultValue:
|
|
1912
|
-
disabled:
|
|
2829
|
+
defaultValue: n,
|
|
2830
|
+
disabled: s,
|
|
1913
2831
|
error: l,
|
|
1914
|
-
externalLabel:
|
|
1915
|
-
fullWidth:
|
|
1916
|
-
helpText:
|
|
1917
|
-
id:
|
|
1918
|
-
inputSize:
|
|
1919
|
-
label:
|
|
1920
|
-
name:
|
|
1921
|
-
onBlur:
|
|
1922
|
-
onChange:
|
|
1923
|
-
onFocus:
|
|
1924
|
-
placeholder:
|
|
1925
|
-
options:
|
|
1926
|
-
required:
|
|
1927
|
-
value:
|
|
1928
|
-
autoFocus:
|
|
1929
|
-
...
|
|
1930
|
-
},
|
|
1931
|
-
var
|
|
1932
|
-
const { theme:
|
|
1933
|
-
|
|
1934
|
-
),
|
|
1935
|
-
const
|
|
1936
|
-
return
|
|
1937
|
-
}), be =
|
|
1938
|
-
|
|
1939
|
-
if (
|
|
1940
|
-
const
|
|
2832
|
+
externalLabel: i = !1,
|
|
2833
|
+
fullWidth: g,
|
|
2834
|
+
helpText: v,
|
|
2835
|
+
id: d,
|
|
2836
|
+
inputSize: _,
|
|
2837
|
+
label: b,
|
|
2838
|
+
name: f,
|
|
2839
|
+
onBlur: y,
|
|
2840
|
+
onChange: o,
|
|
2841
|
+
onFocus: h,
|
|
2842
|
+
placeholder: u,
|
|
2843
|
+
options: j,
|
|
2844
|
+
required: k,
|
|
2845
|
+
value: D,
|
|
2846
|
+
autoFocus: O,
|
|
2847
|
+
...C
|
|
2848
|
+
}, T) {
|
|
2849
|
+
var Oe;
|
|
2850
|
+
const { theme: N } = Re(), p = c.useId(), Y = d ?? `luna-select-${p.replace(/:/g, "")}`, K = `${Y}-label`, P = `${Y}-value`, Q = `${Y}-listbox`, H = l || v ? `${Y}-message` : void 0, X = _ ?? ((Oe = N.components.input) == null ? void 0 : Oe.defaultSize) ?? "md", ee = l != null, ce = b != null && i, oe = b != null && !i, me = typeof u == "string" && u.length > 0, pe = typeof D == "string", [Z, ge] = c.useState(
|
|
2851
|
+
Ka(D, n)
|
|
2852
|
+
), q = pe ? String(D ?? "") : Z, L = Xa(j, q), [A, ne] = c.useState(!1), [te, $] = c.useState(!1), [re, de] = c.useState(() => {
|
|
2853
|
+
const I = j.findIndex((V) => V.value === q);
|
|
2854
|
+
return I >= 0 ? I : un(j);
|
|
2855
|
+
}), be = c.useRef(null), ie = c.useRef(null), G = We([N]);
|
|
2856
|
+
c.useImperativeHandle(T, () => ie.current, []), c.useEffect(() => {
|
|
2857
|
+
if (pe) {
|
|
2858
|
+
const I = j.findIndex((V) => V.value === q);
|
|
1941
2859
|
de(
|
|
1942
|
-
|
|
2860
|
+
I >= 0 ? I : un(j)
|
|
1943
2861
|
);
|
|
1944
2862
|
}
|
|
1945
|
-
}, [
|
|
1946
|
-
var
|
|
1947
|
-
|
|
1948
|
-
}, [
|
|
1949
|
-
if (!
|
|
2863
|
+
}, [pe, j, q]), c.useEffect(() => {
|
|
2864
|
+
var I;
|
|
2865
|
+
O && ((I = be.current) == null || I.focus());
|
|
2866
|
+
}, [O]), c.useEffect(() => {
|
|
2867
|
+
if (!A)
|
|
1950
2868
|
return;
|
|
1951
|
-
function
|
|
1952
|
-
var
|
|
1953
|
-
const
|
|
1954
|
-
(
|
|
2869
|
+
function I(V) {
|
|
2870
|
+
var F;
|
|
2871
|
+
const _e = V.target;
|
|
2872
|
+
(F = G.current) != null && F.contains(_e) || ne(!1);
|
|
1955
2873
|
}
|
|
1956
|
-
return document.addEventListener("mousedown",
|
|
1957
|
-
document.removeEventListener("mousedown",
|
|
2874
|
+
return document.addEventListener("mousedown", I), () => {
|
|
2875
|
+
document.removeEventListener("mousedown", I);
|
|
1958
2876
|
};
|
|
1959
|
-
}, [
|
|
1960
|
-
function
|
|
1961
|
-
|
|
1962
|
-
target: { value:
|
|
1963
|
-
currentTarget: { value:
|
|
2877
|
+
}, [A]);
|
|
2878
|
+
function U(I) {
|
|
2879
|
+
pe || ge(I), ie.current && (ie.current.value = I), o && o({
|
|
2880
|
+
target: { value: I, name: f },
|
|
2881
|
+
currentTarget: { value: I, name: f }
|
|
1964
2882
|
});
|
|
1965
2883
|
}
|
|
1966
|
-
function
|
|
1967
|
-
var
|
|
1968
|
-
|
|
2884
|
+
function je(I) {
|
|
2885
|
+
var V;
|
|
2886
|
+
I.disabled || (U(I.value), ne(!1), (V = be.current) == null || V.focus());
|
|
1969
2887
|
}
|
|
1970
|
-
function
|
|
1971
|
-
var
|
|
1972
|
-
|
|
2888
|
+
function he() {
|
|
2889
|
+
var I;
|
|
2890
|
+
U(""), ne(!1), (I = be.current) == null || I.focus();
|
|
1973
2891
|
}
|
|
1974
2892
|
function fe() {
|
|
1975
|
-
if (
|
|
2893
|
+
if (s)
|
|
1976
2894
|
return;
|
|
1977
|
-
const
|
|
2895
|
+
const I = j.findIndex((V) => V.value === q);
|
|
1978
2896
|
de(
|
|
1979
|
-
|
|
1980
|
-
),
|
|
2897
|
+
I >= 0 ? I : un(j)
|
|
2898
|
+
), ne(!0);
|
|
1981
2899
|
}
|
|
1982
|
-
function
|
|
1983
|
-
if (
|
|
1984
|
-
|
|
2900
|
+
function we() {
|
|
2901
|
+
if (A) {
|
|
2902
|
+
ne(!1);
|
|
1985
2903
|
return;
|
|
1986
2904
|
}
|
|
1987
2905
|
fe();
|
|
1988
2906
|
}
|
|
1989
|
-
function
|
|
1990
|
-
var
|
|
1991
|
-
if (
|
|
2907
|
+
function Ee(I) {
|
|
2908
|
+
var _e;
|
|
2909
|
+
if (s)
|
|
1992
2910
|
return;
|
|
1993
|
-
const
|
|
1994
|
-
|
|
2911
|
+
const V = I.target;
|
|
2912
|
+
V != null && V.closest(".luna-select__listbox") || V != null && V.closest(".luna-select__clear") || (I.preventDefault(), (_e = be.current) == null || _e.focus(), we());
|
|
1995
2913
|
}
|
|
1996
|
-
function Se(
|
|
1997
|
-
if (!
|
|
1998
|
-
switch (
|
|
2914
|
+
function Se(I) {
|
|
2915
|
+
if (!s)
|
|
2916
|
+
switch (I.key) {
|
|
1999
2917
|
case "ArrowDown": {
|
|
2000
|
-
if (
|
|
2918
|
+
if (I.preventDefault(), !A) {
|
|
2001
2919
|
fe();
|
|
2002
2920
|
return;
|
|
2003
2921
|
}
|
|
2004
2922
|
de(
|
|
2005
|
-
(
|
|
2923
|
+
(V) => Cn(j, V < 0 ? -1 : V, 1)
|
|
2006
2924
|
);
|
|
2007
2925
|
break;
|
|
2008
2926
|
}
|
|
2009
2927
|
case "ArrowUp": {
|
|
2010
|
-
if (
|
|
2928
|
+
if (I.preventDefault(), !A) {
|
|
2011
2929
|
fe();
|
|
2012
2930
|
return;
|
|
2013
2931
|
}
|
|
2014
2932
|
de(
|
|
2015
|
-
(
|
|
2933
|
+
(V) => Cn(j, V < 0 ? j.length : V, -1)
|
|
2016
2934
|
);
|
|
2017
2935
|
break;
|
|
2018
2936
|
}
|
|
2019
2937
|
case "Enter":
|
|
2020
2938
|
case " ": {
|
|
2021
|
-
if (
|
|
2939
|
+
if (I.preventDefault(), !A) {
|
|
2022
2940
|
fe();
|
|
2023
2941
|
return;
|
|
2024
2942
|
}
|
|
2025
|
-
const
|
|
2026
|
-
|
|
2943
|
+
const V = j[re];
|
|
2944
|
+
V && je(V);
|
|
2027
2945
|
break;
|
|
2028
2946
|
}
|
|
2029
2947
|
case "Escape": {
|
|
2030
|
-
|
|
2948
|
+
A && (I.preventDefault(), ne(!1));
|
|
2031
2949
|
break;
|
|
2032
2950
|
}
|
|
2033
2951
|
}
|
|
2034
2952
|
}
|
|
2035
|
-
function
|
|
2036
|
-
|
|
2953
|
+
function De(I) {
|
|
2954
|
+
$(!0), h == null || h(I);
|
|
2037
2955
|
}
|
|
2038
|
-
function
|
|
2039
|
-
var
|
|
2040
|
-
const
|
|
2041
|
-
(
|
|
2956
|
+
function ke(I) {
|
|
2957
|
+
var _e;
|
|
2958
|
+
const V = I.relatedTarget;
|
|
2959
|
+
(_e = G.current) != null && _e.contains(V) || ($(!1), ne(!1), y == null || y(I));
|
|
2042
2960
|
}
|
|
2043
|
-
const
|
|
2044
|
-
return /* @__PURE__ */
|
|
2961
|
+
const Ce = q.length > 0, Be = oe && (te || A || Ce || me);
|
|
2962
|
+
return /* @__PURE__ */ r.jsxs(
|
|
2045
2963
|
"div",
|
|
2046
2964
|
{
|
|
2047
|
-
ref:
|
|
2048
|
-
className:
|
|
2965
|
+
ref: G,
|
|
2966
|
+
className: sn([
|
|
2049
2967
|
"luna-select-field",
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2968
|
+
g && "luna-select-field--full-width",
|
|
2969
|
+
oe && "luna-select-field--inset-label",
|
|
2970
|
+
Be && "luna-select-field--inset-label-active",
|
|
2971
|
+
Ce && "luna-select-field--has-selection",
|
|
2972
|
+
A && "luna-select-field--open",
|
|
2973
|
+
s && "luna-select-field--disabled",
|
|
2056
2974
|
ee && "luna-select-field--invalid",
|
|
2057
2975
|
a
|
|
2058
2976
|
]),
|
|
2059
|
-
"data-size":
|
|
2977
|
+
"data-size": X,
|
|
2060
2978
|
children: [
|
|
2061
|
-
|
|
2062
|
-
/* @__PURE__ */
|
|
2063
|
-
|
|
2064
|
-
/* @__PURE__ */
|
|
2979
|
+
ce ? /* @__PURE__ */ r.jsx("div", { id: K, className: "luna-select-field__label", children: /* @__PURE__ */ r.jsx(B, { as: "span", variant: "label", children: b }) }) : null,
|
|
2980
|
+
/* @__PURE__ */ r.jsxs("div", { className: "luna-select-field__control", onMouseDown: Ee, children: [
|
|
2981
|
+
oe ? /* @__PURE__ */ r.jsx("div", { id: K, className: "luna-select-field__label luna-select-field__label--inset", children: /* @__PURE__ */ r.jsx(B, { as: "span", variant: "caption", children: b }) }) : null,
|
|
2982
|
+
/* @__PURE__ */ r.jsx(
|
|
2065
2983
|
"button",
|
|
2066
2984
|
{
|
|
2067
|
-
...
|
|
2985
|
+
...C,
|
|
2068
2986
|
ref: be,
|
|
2069
|
-
id:
|
|
2987
|
+
id: Y,
|
|
2070
2988
|
type: "button",
|
|
2071
2989
|
className: "luna-select",
|
|
2072
|
-
disabled:
|
|
2073
|
-
"aria-invalid": ee ? !0 :
|
|
2074
|
-
"aria-describedby":
|
|
2075
|
-
"aria-labelledby":
|
|
2990
|
+
disabled: s,
|
|
2991
|
+
"aria-invalid": ee ? !0 : C["aria-invalid"],
|
|
2992
|
+
"aria-describedby": H ?? C["aria-describedby"],
|
|
2993
|
+
"aria-labelledby": b ? `${K} ${P}` : P,
|
|
2076
2994
|
"aria-haspopup": "listbox",
|
|
2077
|
-
"aria-expanded":
|
|
2078
|
-
"aria-controls":
|
|
2995
|
+
"aria-expanded": A,
|
|
2996
|
+
"aria-controls": A ? Q : void 0,
|
|
2079
2997
|
onKeyDown: Se,
|
|
2080
|
-
onFocus:
|
|
2081
|
-
onBlur:
|
|
2082
|
-
children: /* @__PURE__ */
|
|
2998
|
+
onFocus: De,
|
|
2999
|
+
onBlur: ke,
|
|
3000
|
+
children: /* @__PURE__ */ r.jsx(
|
|
2083
3001
|
"span",
|
|
2084
3002
|
{
|
|
2085
|
-
id:
|
|
2086
|
-
className:
|
|
3003
|
+
id: P,
|
|
3004
|
+
className: sn([
|
|
2087
3005
|
"luna-select__value",
|
|
2088
|
-
!
|
|
3006
|
+
!Ce && u && "luna-select__value--placeholder"
|
|
2089
3007
|
]),
|
|
2090
|
-
children:
|
|
3008
|
+
children: Ce ? (L == null ? void 0 : L.label) ?? q : u ?? (oe ? "" : "Select an option")
|
|
2091
3009
|
}
|
|
2092
3010
|
)
|
|
2093
3011
|
}
|
|
2094
3012
|
),
|
|
2095
|
-
|
|
3013
|
+
Ce && !s ? /* @__PURE__ */ r.jsx(
|
|
2096
3014
|
"button",
|
|
2097
3015
|
{
|
|
2098
3016
|
type: "button",
|
|
2099
3017
|
className: "luna-select__clear",
|
|
2100
3018
|
"aria-label": "Clear selection",
|
|
2101
|
-
onMouseDown: (
|
|
2102
|
-
onClick:
|
|
3019
|
+
onMouseDown: (I) => I.preventDefault(),
|
|
3020
|
+
onClick: he
|
|
2103
3021
|
}
|
|
2104
3022
|
) : null,
|
|
2105
|
-
/* @__PURE__ */
|
|
3023
|
+
/* @__PURE__ */ r.jsxs(
|
|
2106
3024
|
"select",
|
|
2107
3025
|
{
|
|
2108
|
-
ref:
|
|
3026
|
+
ref: ie,
|
|
2109
3027
|
tabIndex: -1,
|
|
2110
3028
|
"aria-hidden": "true",
|
|
2111
3029
|
className: "luna-select__native",
|
|
2112
|
-
name:
|
|
2113
|
-
required:
|
|
2114
|
-
disabled:
|
|
2115
|
-
value:
|
|
3030
|
+
name: f,
|
|
3031
|
+
required: k,
|
|
3032
|
+
disabled: s,
|
|
3033
|
+
value: q,
|
|
2116
3034
|
onChange: () => {
|
|
2117
3035
|
},
|
|
2118
3036
|
children: [
|
|
2119
|
-
|
|
2120
|
-
|
|
3037
|
+
u ? /* @__PURE__ */ r.jsx("option", { value: "", children: u }) : null,
|
|
3038
|
+
j.map((I) => /* @__PURE__ */ r.jsx("option", { value: I.value, disabled: I.disabled, children: I.label }, I.value))
|
|
2121
3039
|
]
|
|
2122
3040
|
}
|
|
2123
3041
|
),
|
|
2124
|
-
|
|
2125
|
-
const
|
|
2126
|
-
return /* @__PURE__ */
|
|
3042
|
+
A ? /* @__PURE__ */ r.jsx("div", { className: "luna-select__listbox", id: Q, role: "listbox", "aria-labelledby": K, children: j.map((I, V) => {
|
|
3043
|
+
const _e = I.value === q, F = V === re;
|
|
3044
|
+
return /* @__PURE__ */ r.jsx(
|
|
2127
3045
|
"div",
|
|
2128
3046
|
{
|
|
2129
3047
|
role: "option",
|
|
2130
|
-
"aria-selected":
|
|
2131
|
-
"aria-disabled":
|
|
2132
|
-
className:
|
|
3048
|
+
"aria-selected": _e,
|
|
3049
|
+
"aria-disabled": I.disabled ? !0 : void 0,
|
|
3050
|
+
className: sn([
|
|
2133
3051
|
"luna-select__option",
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
3052
|
+
_e && "luna-select__option--selected",
|
|
3053
|
+
F && "luna-select__option--highlighted",
|
|
3054
|
+
I.disabled && "luna-select__option--disabled"
|
|
2137
3055
|
]),
|
|
2138
|
-
onMouseDown: (
|
|
2139
|
-
onClick: () =>
|
|
2140
|
-
children:
|
|
3056
|
+
onMouseDown: (x) => x.preventDefault(),
|
|
3057
|
+
onClick: () => je(I),
|
|
3058
|
+
children: I.label
|
|
2141
3059
|
},
|
|
2142
|
-
|
|
3060
|
+
I.value
|
|
2143
3061
|
);
|
|
2144
3062
|
}) }) : null
|
|
2145
3063
|
] }),
|
|
2146
|
-
ee ? /* @__PURE__ */
|
|
2147
|
-
|
|
3064
|
+
ee ? /* @__PURE__ */ r.jsx(
|
|
3065
|
+
B,
|
|
2148
3066
|
{
|
|
2149
|
-
id:
|
|
3067
|
+
id: H,
|
|
2150
3068
|
variant: "caption",
|
|
2151
3069
|
className: "luna-select-field__message luna-select-field__message--error",
|
|
2152
3070
|
children: l
|
|
2153
3071
|
}
|
|
2154
|
-
) :
|
|
2155
|
-
|
|
3072
|
+
) : v != null ? /* @__PURE__ */ r.jsx(
|
|
3073
|
+
B,
|
|
2156
3074
|
{
|
|
2157
|
-
id:
|
|
3075
|
+
id: H,
|
|
2158
3076
|
variant: "caption",
|
|
2159
3077
|
className: "luna-select-field__message luna-select-field__message--help",
|
|
2160
|
-
children:
|
|
3078
|
+
children: v
|
|
2161
3079
|
}
|
|
2162
3080
|
) : null
|
|
2163
3081
|
]
|
|
2164
3082
|
}
|
|
2165
3083
|
);
|
|
2166
3084
|
});
|
|
2167
|
-
function
|
|
3085
|
+
function on(e) {
|
|
2168
3086
|
return e.filter(Boolean).join(" ");
|
|
2169
3087
|
}
|
|
2170
|
-
function
|
|
3088
|
+
function cn(e, a) {
|
|
2171
3089
|
return Array.isArray(e) ? e.map(String) : Array.isArray(a) ? a.map(String) : [];
|
|
2172
3090
|
}
|
|
2173
|
-
function
|
|
3091
|
+
function dn(e) {
|
|
2174
3092
|
return e.findIndex((a) => !a.disabled);
|
|
2175
3093
|
}
|
|
2176
|
-
function
|
|
3094
|
+
function $n(e, a, n) {
|
|
2177
3095
|
var l;
|
|
2178
3096
|
if (!e.length)
|
|
2179
3097
|
return -1;
|
|
2180
|
-
let
|
|
2181
|
-
for (let
|
|
2182
|
-
if (
|
|
2183
|
-
return
|
|
3098
|
+
let s = a;
|
|
3099
|
+
for (let i = 0; i < e.length; i += 1)
|
|
3100
|
+
if (s = (s + n + e.length) % e.length, !((l = e[s]) != null && l.disabled))
|
|
3101
|
+
return s;
|
|
2184
3102
|
return -1;
|
|
2185
3103
|
}
|
|
2186
|
-
function
|
|
3104
|
+
function Ga(e, a, n) {
|
|
2187
3105
|
var l;
|
|
2188
3106
|
if (!a.length)
|
|
2189
|
-
return
|
|
2190
|
-
const
|
|
2191
|
-
return a.length === 1 ?
|
|
3107
|
+
return n ?? "";
|
|
3108
|
+
const s = ((l = e.find((i) => i.value === a[0])) == null ? void 0 : l.label) ?? a[0];
|
|
3109
|
+
return a.length === 1 ? s : `${s} (+${a.length - 1})`;
|
|
2192
3110
|
}
|
|
2193
|
-
const
|
|
3111
|
+
const ct = c.forwardRef(
|
|
2194
3112
|
function({
|
|
2195
3113
|
autoFocus: a,
|
|
2196
|
-
className:
|
|
2197
|
-
defaultValue:
|
|
3114
|
+
className: n,
|
|
3115
|
+
defaultValue: s,
|
|
2198
3116
|
disabled: l,
|
|
2199
|
-
error:
|
|
2200
|
-
externalLabel:
|
|
2201
|
-
fullWidth:
|
|
2202
|
-
helpText:
|
|
2203
|
-
id:
|
|
2204
|
-
inputSize:
|
|
2205
|
-
label:
|
|
2206
|
-
name:
|
|
2207
|
-
onBlur:
|
|
2208
|
-
onFocus:
|
|
2209
|
-
onChange:
|
|
2210
|
-
options:
|
|
2211
|
-
placeholder:
|
|
2212
|
-
required:
|
|
2213
|
-
style:
|
|
2214
|
-
value:
|
|
2215
|
-
...
|
|
2216
|
-
},
|
|
2217
|
-
var
|
|
2218
|
-
const { theme:
|
|
2219
|
-
() =>
|
|
2220
|
-
),
|
|
2221
|
-
const
|
|
2222
|
-
return
|
|
2223
|
-
}),
|
|
2224
|
-
|
|
2225
|
-
if (
|
|
2226
|
-
const
|
|
2227
|
-
|
|
2228
|
-
|
|
3117
|
+
error: i,
|
|
3118
|
+
externalLabel: g = !1,
|
|
3119
|
+
fullWidth: v,
|
|
3120
|
+
helpText: d,
|
|
3121
|
+
id: _,
|
|
3122
|
+
inputSize: b,
|
|
3123
|
+
label: f,
|
|
3124
|
+
name: y,
|
|
3125
|
+
onBlur: o,
|
|
3126
|
+
onFocus: h,
|
|
3127
|
+
onChange: u,
|
|
3128
|
+
options: j,
|
|
3129
|
+
placeholder: k,
|
|
3130
|
+
required: D,
|
|
3131
|
+
style: O,
|
|
3132
|
+
value: C,
|
|
3133
|
+
...T
|
|
3134
|
+
}, N) {
|
|
3135
|
+
var F;
|
|
3136
|
+
const { theme: p } = Re(), Y = c.useId(), K = _ ?? `luna-multiselect-${Y.replace(/:/g, "")}`, P = `${K}-label`, Q = `${K}-value`, H = `${K}-listbox`, X = i || d ? `${K}-message` : void 0, ee = b ?? ((F = p.components.input) == null ? void 0 : F.defaultSize) ?? "md", ce = i != null, oe = f != null && g, me = f != null && !g, pe = typeof k == "string" && k.length > 0, Z = Array.isArray(C), [ge, q] = c.useState(
|
|
3137
|
+
() => cn(C, s)
|
|
3138
|
+
), L = Z ? cn(C, s) : ge, [A, ne] = c.useState(!1), [te, $] = c.useState(!1), [re, de] = c.useState(null), [be, ie] = c.useState(() => {
|
|
3139
|
+
const x = j.findIndex((R) => L.includes(R.value));
|
|
3140
|
+
return x >= 0 ? x : dn(j);
|
|
3141
|
+
}), G = c.useRef(null), U = c.useRef(null), je = c.useRef(null), he = We([p]);
|
|
3142
|
+
c.useImperativeHandle(N, () => U.current, []), c.useEffect(() => {
|
|
3143
|
+
if (Z) {
|
|
3144
|
+
const x = cn(C, s), R = j.findIndex((le) => x.includes(le.value));
|
|
3145
|
+
ie(
|
|
3146
|
+
R >= 0 ? R : dn(j)
|
|
2229
3147
|
);
|
|
2230
3148
|
}
|
|
2231
|
-
}, [
|
|
2232
|
-
if (!
|
|
3149
|
+
}, [s, Z, j, C]), c.useEffect(() => {
|
|
3150
|
+
if (!U.current)
|
|
2233
3151
|
return;
|
|
2234
|
-
const
|
|
2235
|
-
for (const
|
|
2236
|
-
|
|
2237
|
-
}, [
|
|
2238
|
-
var
|
|
2239
|
-
a && ((
|
|
2240
|
-
}, [a]),
|
|
2241
|
-
var
|
|
2242
|
-
if (!
|
|
3152
|
+
const x = new Set(L);
|
|
3153
|
+
for (const R of U.current.options)
|
|
3154
|
+
R.selected = x.has(R.value);
|
|
3155
|
+
}, [L]), c.useEffect(() => {
|
|
3156
|
+
var x;
|
|
3157
|
+
a && ((x = G.current) == null || x.focus());
|
|
3158
|
+
}, [a]), c.useEffect(() => {
|
|
3159
|
+
var R;
|
|
3160
|
+
if (!A) {
|
|
2243
3161
|
de(null);
|
|
2244
3162
|
return;
|
|
2245
3163
|
}
|
|
2246
|
-
de(((
|
|
2247
|
-
function
|
|
2248
|
-
var
|
|
2249
|
-
const
|
|
2250
|
-
(
|
|
3164
|
+
de(((R = je.current) == null ? void 0 : R.offsetWidth) ?? null);
|
|
3165
|
+
function x(le) {
|
|
3166
|
+
var Ae;
|
|
3167
|
+
const Ne = le.target;
|
|
3168
|
+
(Ae = he.current) != null && Ae.contains(Ne) || ne(!1);
|
|
2251
3169
|
}
|
|
2252
|
-
return document.addEventListener("mousedown",
|
|
2253
|
-
document.removeEventListener("mousedown",
|
|
3170
|
+
return document.addEventListener("mousedown", x), () => {
|
|
3171
|
+
document.removeEventListener("mousedown", x);
|
|
2254
3172
|
};
|
|
2255
|
-
}, [
|
|
2256
|
-
function fe(
|
|
2257
|
-
|
|
3173
|
+
}, [A, he]);
|
|
3174
|
+
function fe(x) {
|
|
3175
|
+
Z || q(x), u == null || u(x);
|
|
2258
3176
|
}
|
|
2259
|
-
function
|
|
2260
|
-
var
|
|
2261
|
-
if (
|
|
3177
|
+
function we(x) {
|
|
3178
|
+
var Ne;
|
|
3179
|
+
if (x.disabled)
|
|
2262
3180
|
return;
|
|
2263
|
-
const
|
|
2264
|
-
fe(
|
|
3181
|
+
const le = L.includes(x.value) ? L.filter((Ae) => Ae !== x.value) : [...L, x.value];
|
|
3182
|
+
fe(le), (Ne = G.current) == null || Ne.focus();
|
|
2265
3183
|
}
|
|
2266
|
-
function
|
|
2267
|
-
var
|
|
2268
|
-
fe([]),
|
|
3184
|
+
function Ee() {
|
|
3185
|
+
var x;
|
|
3186
|
+
fe([]), ne(!1), (x = G.current) == null || x.focus();
|
|
2269
3187
|
}
|
|
2270
3188
|
function Se() {
|
|
2271
3189
|
if (l)
|
|
2272
3190
|
return;
|
|
2273
|
-
const
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
),
|
|
2277
|
-
}
|
|
2278
|
-
function
|
|
2279
|
-
if (
|
|
2280
|
-
|
|
3191
|
+
const x = j.findIndex((R) => L.includes(R.value));
|
|
3192
|
+
ie(
|
|
3193
|
+
x >= 0 ? x : dn(j)
|
|
3194
|
+
), ne(!0);
|
|
3195
|
+
}
|
|
3196
|
+
function De() {
|
|
3197
|
+
if (A) {
|
|
3198
|
+
ne(!1);
|
|
2281
3199
|
return;
|
|
2282
3200
|
}
|
|
2283
3201
|
Se();
|
|
2284
3202
|
}
|
|
2285
|
-
function
|
|
2286
|
-
var
|
|
3203
|
+
function ke(x) {
|
|
3204
|
+
var le;
|
|
2287
3205
|
if (l)
|
|
2288
3206
|
return;
|
|
2289
|
-
const
|
|
2290
|
-
|
|
3207
|
+
const R = x.target;
|
|
3208
|
+
R != null && R.closest(".luna-multiselect__listbox") || R != null && R.closest(".luna-multiselect__clear") || (x.preventDefault(), (le = G.current) == null || le.focus(), De());
|
|
2291
3209
|
}
|
|
2292
|
-
function
|
|
3210
|
+
function Ce(x) {
|
|
2293
3211
|
if (!l)
|
|
2294
|
-
switch (
|
|
3212
|
+
switch (x.key) {
|
|
2295
3213
|
case "ArrowDown": {
|
|
2296
|
-
if (
|
|
3214
|
+
if (x.preventDefault(), !A) {
|
|
2297
3215
|
Se();
|
|
2298
3216
|
return;
|
|
2299
3217
|
}
|
|
2300
|
-
|
|
2301
|
-
(
|
|
3218
|
+
ie(
|
|
3219
|
+
(R) => $n(j, R < 0 ? -1 : R, 1)
|
|
2302
3220
|
);
|
|
2303
3221
|
break;
|
|
2304
3222
|
}
|
|
2305
3223
|
case "ArrowUp": {
|
|
2306
|
-
if (
|
|
3224
|
+
if (x.preventDefault(), !A) {
|
|
2307
3225
|
Se();
|
|
2308
3226
|
return;
|
|
2309
3227
|
}
|
|
2310
|
-
|
|
2311
|
-
(
|
|
3228
|
+
ie(
|
|
3229
|
+
(R) => $n(j, R < 0 ? j.length : R, -1)
|
|
2312
3230
|
);
|
|
2313
3231
|
break;
|
|
2314
3232
|
}
|
|
2315
3233
|
case "Enter":
|
|
2316
3234
|
case " ": {
|
|
2317
|
-
if (
|
|
3235
|
+
if (x.preventDefault(), !A) {
|
|
2318
3236
|
Se();
|
|
2319
3237
|
return;
|
|
2320
3238
|
}
|
|
2321
|
-
const
|
|
2322
|
-
|
|
3239
|
+
const R = j[be];
|
|
3240
|
+
R && we(R);
|
|
2323
3241
|
break;
|
|
2324
3242
|
}
|
|
2325
3243
|
case "Escape": {
|
|
2326
|
-
|
|
3244
|
+
A && (x.preventDefault(), ne(!1));
|
|
2327
3245
|
break;
|
|
2328
3246
|
}
|
|
2329
3247
|
}
|
|
2330
3248
|
}
|
|
2331
|
-
function
|
|
2332
|
-
|
|
3249
|
+
function Be(x) {
|
|
3250
|
+
$(!0), h == null || h(x);
|
|
2333
3251
|
}
|
|
2334
|
-
function
|
|
2335
|
-
var
|
|
2336
|
-
const
|
|
2337
|
-
(
|
|
3252
|
+
function Oe(x) {
|
|
3253
|
+
var le;
|
|
3254
|
+
const R = x.relatedTarget;
|
|
3255
|
+
(le = he.current) != null && le.contains(R) || ($(!1), ne(!1), o == null || o(x));
|
|
2338
3256
|
}
|
|
2339
|
-
const
|
|
2340
|
-
return /* @__PURE__ */
|
|
3257
|
+
const I = L.length > 0, V = me && (te || A || I || pe), _e = Ga(j, L, k);
|
|
3258
|
+
return /* @__PURE__ */ r.jsxs(
|
|
2341
3259
|
"div",
|
|
2342
3260
|
{
|
|
2343
|
-
ref:
|
|
2344
|
-
className:
|
|
3261
|
+
ref: he,
|
|
3262
|
+
className: on([
|
|
2345
3263
|
"luna-multiselect-field",
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
3264
|
+
v && "luna-multiselect-field--full-width",
|
|
3265
|
+
me && "luna-multiselect-field--inset-label",
|
|
3266
|
+
V && "luna-multiselect-field--inset-label-active",
|
|
3267
|
+
I && "luna-multiselect-field--has-selection",
|
|
3268
|
+
A && "luna-multiselect-field--open",
|
|
2351
3269
|
l && "luna-multiselect-field--disabled",
|
|
2352
|
-
|
|
2353
|
-
|
|
3270
|
+
ce && "luna-multiselect-field--invalid",
|
|
3271
|
+
n
|
|
2354
3272
|
]),
|
|
2355
3273
|
"data-size": ee,
|
|
2356
3274
|
style: {
|
|
2357
|
-
...
|
|
2358
|
-
...
|
|
3275
|
+
...O,
|
|
3276
|
+
...re ? { width: `${re}px` } : null
|
|
2359
3277
|
},
|
|
2360
3278
|
children: [
|
|
2361
|
-
|
|
2362
|
-
/* @__PURE__ */
|
|
3279
|
+
oe ? /* @__PURE__ */ r.jsx("div", { id: P, className: "luna-multiselect-field__label", children: /* @__PURE__ */ r.jsx(B, { as: "span", variant: "label", children: f }) }) : null,
|
|
3280
|
+
/* @__PURE__ */ r.jsxs(
|
|
2363
3281
|
"div",
|
|
2364
3282
|
{
|
|
2365
|
-
ref:
|
|
3283
|
+
ref: je,
|
|
2366
3284
|
className: "luna-multiselect-field__control",
|
|
2367
|
-
onMouseDown:
|
|
3285
|
+
onMouseDown: ke,
|
|
2368
3286
|
children: [
|
|
2369
|
-
|
|
3287
|
+
me ? /* @__PURE__ */ r.jsx(
|
|
2370
3288
|
"div",
|
|
2371
3289
|
{
|
|
2372
|
-
id:
|
|
3290
|
+
id: P,
|
|
2373
3291
|
className: "luna-multiselect-field__label luna-multiselect-field__label--inset",
|
|
2374
|
-
children: /* @__PURE__ */
|
|
3292
|
+
children: /* @__PURE__ */ r.jsx(B, { as: "span", variant: "caption", children: f })
|
|
2375
3293
|
}
|
|
2376
3294
|
) : null,
|
|
2377
|
-
/* @__PURE__ */
|
|
3295
|
+
/* @__PURE__ */ r.jsx(
|
|
2378
3296
|
"button",
|
|
2379
3297
|
{
|
|
2380
|
-
...
|
|
2381
|
-
ref:
|
|
3298
|
+
...T,
|
|
3299
|
+
ref: G,
|
|
2382
3300
|
id: K,
|
|
2383
3301
|
type: "button",
|
|
2384
3302
|
className: "luna-multiselect",
|
|
2385
3303
|
disabled: l,
|
|
2386
|
-
"aria-invalid":
|
|
2387
|
-
"aria-describedby":
|
|
2388
|
-
"aria-labelledby":
|
|
3304
|
+
"aria-invalid": ce ? !0 : T["aria-invalid"],
|
|
3305
|
+
"aria-describedby": X ?? T["aria-describedby"],
|
|
3306
|
+
"aria-labelledby": f ? `${P} ${Q}` : Q,
|
|
2389
3307
|
"aria-haspopup": "listbox",
|
|
2390
|
-
"aria-expanded":
|
|
2391
|
-
"aria-controls":
|
|
2392
|
-
onKeyDown:
|
|
2393
|
-
onFocus:
|
|
2394
|
-
onBlur:
|
|
2395
|
-
children: /* @__PURE__ */
|
|
3308
|
+
"aria-expanded": A,
|
|
3309
|
+
"aria-controls": A ? H : void 0,
|
|
3310
|
+
onKeyDown: Ce,
|
|
3311
|
+
onFocus: Be,
|
|
3312
|
+
onBlur: Oe,
|
|
3313
|
+
children: /* @__PURE__ */ r.jsx(
|
|
2396
3314
|
"span",
|
|
2397
3315
|
{
|
|
2398
|
-
id:
|
|
2399
|
-
className:
|
|
3316
|
+
id: Q,
|
|
3317
|
+
className: on([
|
|
2400
3318
|
"luna-multiselect__value",
|
|
2401
|
-
!
|
|
3319
|
+
!I && k && "luna-multiselect__value--placeholder"
|
|
2402
3320
|
]),
|
|
2403
|
-
children:
|
|
3321
|
+
children: _e
|
|
2404
3322
|
}
|
|
2405
3323
|
)
|
|
2406
3324
|
}
|
|
2407
3325
|
),
|
|
2408
|
-
|
|
3326
|
+
I && !l ? /* @__PURE__ */ r.jsx(
|
|
2409
3327
|
"button",
|
|
2410
3328
|
{
|
|
2411
3329
|
type: "button",
|
|
2412
3330
|
className: "luna-multiselect__clear",
|
|
2413
3331
|
"aria-label": "Clear selection",
|
|
2414
|
-
onMouseDown: (
|
|
2415
|
-
onClick:
|
|
3332
|
+
onMouseDown: (x) => x.preventDefault(),
|
|
3333
|
+
onClick: Ee
|
|
2416
3334
|
}
|
|
2417
3335
|
) : null,
|
|
2418
|
-
/* @__PURE__ */
|
|
3336
|
+
/* @__PURE__ */ r.jsx(
|
|
2419
3337
|
"select",
|
|
2420
3338
|
{
|
|
2421
|
-
ref:
|
|
3339
|
+
ref: U,
|
|
2422
3340
|
tabIndex: -1,
|
|
2423
3341
|
"aria-hidden": "true",
|
|
2424
3342
|
className: "luna-multiselect__native",
|
|
2425
|
-
name:
|
|
2426
|
-
required:
|
|
3343
|
+
name: y,
|
|
3344
|
+
required: D,
|
|
2427
3345
|
disabled: l,
|
|
2428
3346
|
multiple: !0,
|
|
2429
|
-
value:
|
|
3347
|
+
value: L,
|
|
2430
3348
|
onChange: () => {
|
|
2431
3349
|
},
|
|
2432
|
-
children:
|
|
3350
|
+
children: j.map((x) => /* @__PURE__ */ r.jsx("option", { value: x.value, disabled: x.disabled, children: x.label }, x.value))
|
|
2433
3351
|
}
|
|
2434
3352
|
),
|
|
2435
|
-
|
|
3353
|
+
A ? /* @__PURE__ */ r.jsx(
|
|
2436
3354
|
"div",
|
|
2437
3355
|
{
|
|
2438
3356
|
className: "luna-multiselect__listbox",
|
|
2439
|
-
id:
|
|
3357
|
+
id: H,
|
|
2440
3358
|
role: "listbox",
|
|
2441
|
-
"aria-labelledby":
|
|
3359
|
+
"aria-labelledby": P,
|
|
2442
3360
|
"aria-multiselectable": "true",
|
|
2443
|
-
children:
|
|
2444
|
-
const
|
|
2445
|
-
return /* @__PURE__ */
|
|
3361
|
+
children: j.map((x, R) => {
|
|
3362
|
+
const le = L.includes(x.value), Ne = R === be;
|
|
3363
|
+
return /* @__PURE__ */ r.jsxs(
|
|
2446
3364
|
"div",
|
|
2447
3365
|
{
|
|
2448
3366
|
role: "option",
|
|
2449
|
-
"aria-selected":
|
|
2450
|
-
"aria-disabled":
|
|
2451
|
-
className:
|
|
3367
|
+
"aria-selected": le,
|
|
3368
|
+
"aria-disabled": x.disabled ? !0 : void 0,
|
|
3369
|
+
className: on([
|
|
2452
3370
|
"luna-multiselect__option",
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
3371
|
+
le && "luna-multiselect__option--selected",
|
|
3372
|
+
Ne && "luna-multiselect__option--highlighted",
|
|
3373
|
+
x.disabled && "luna-multiselect__option--disabled"
|
|
2456
3374
|
]),
|
|
2457
|
-
onMouseDown: (
|
|
2458
|
-
onClick: () =>
|
|
3375
|
+
onMouseDown: (Ae) => Ae.preventDefault(),
|
|
3376
|
+
onClick: () => we(x),
|
|
2459
3377
|
children: [
|
|
2460
|
-
/* @__PURE__ */
|
|
2461
|
-
/* @__PURE__ */
|
|
3378
|
+
/* @__PURE__ */ r.jsx("span", { className: "luna-multiselect__option-label", children: x.label }),
|
|
3379
|
+
/* @__PURE__ */ r.jsx("span", { className: "luna-multiselect__option-indicator", "aria-hidden": "true" })
|
|
2462
3380
|
]
|
|
2463
3381
|
},
|
|
2464
|
-
|
|
3382
|
+
x.value
|
|
2465
3383
|
);
|
|
2466
3384
|
})
|
|
2467
3385
|
}
|
|
@@ -2469,21 +3387,21 @@ const Dt = d.forwardRef(
|
|
|
2469
3387
|
]
|
|
2470
3388
|
}
|
|
2471
3389
|
),
|
|
2472
|
-
|
|
2473
|
-
|
|
3390
|
+
ce ? /* @__PURE__ */ r.jsx(
|
|
3391
|
+
B,
|
|
2474
3392
|
{
|
|
2475
|
-
id:
|
|
3393
|
+
id: X,
|
|
2476
3394
|
variant: "caption",
|
|
2477
3395
|
className: "luna-multiselect-field__message luna-multiselect-field__message--error",
|
|
2478
|
-
children:
|
|
3396
|
+
children: i
|
|
2479
3397
|
}
|
|
2480
|
-
) :
|
|
2481
|
-
|
|
3398
|
+
) : d != null ? /* @__PURE__ */ r.jsx(
|
|
3399
|
+
B,
|
|
2482
3400
|
{
|
|
2483
|
-
id:
|
|
3401
|
+
id: X,
|
|
2484
3402
|
variant: "caption",
|
|
2485
3403
|
className: "luna-multiselect-field__message luna-multiselect-field__message--help",
|
|
2486
|
-
children:
|
|
3404
|
+
children: d
|
|
2487
3405
|
}
|
|
2488
3406
|
) : null
|
|
2489
3407
|
]
|
|
@@ -2491,331 +3409,403 @@ const Dt = d.forwardRef(
|
|
|
2491
3409
|
);
|
|
2492
3410
|
}
|
|
2493
3411
|
);
|
|
2494
|
-
function
|
|
3412
|
+
function Bn(e) {
|
|
2495
3413
|
return e.filter(Boolean).join(" ");
|
|
2496
3414
|
}
|
|
2497
|
-
function
|
|
3415
|
+
function Ja(e, a) {
|
|
2498
3416
|
return typeof e == "string" ? e : typeof a == "string" ? a : "";
|
|
2499
3417
|
}
|
|
2500
|
-
function
|
|
2501
|
-
return e.find((
|
|
3418
|
+
function Je(e, a) {
|
|
3419
|
+
return e.find((n) => n.value === a);
|
|
2502
3420
|
}
|
|
2503
|
-
function
|
|
2504
|
-
const
|
|
2505
|
-
return
|
|
3421
|
+
function qa(e, a) {
|
|
3422
|
+
const n = a.trim().toLowerCase();
|
|
3423
|
+
return n ? e.filter((s) => s.label.toLowerCase().includes(n)) : e;
|
|
2506
3424
|
}
|
|
2507
|
-
function
|
|
3425
|
+
function zn(e) {
|
|
2508
3426
|
return e.findIndex((a) => !a.disabled);
|
|
2509
3427
|
}
|
|
2510
|
-
function
|
|
3428
|
+
function Ln(e, a, n) {
|
|
2511
3429
|
var l;
|
|
2512
3430
|
if (!e.length)
|
|
2513
3431
|
return -1;
|
|
2514
|
-
let
|
|
2515
|
-
for (let
|
|
2516
|
-
if (
|
|
2517
|
-
return
|
|
3432
|
+
let s = a;
|
|
3433
|
+
for (let i = 0; i < e.length; i += 1)
|
|
3434
|
+
if (s = (s + n + e.length) % e.length, !((l = e[s]) != null && l.disabled))
|
|
3435
|
+
return s;
|
|
2518
3436
|
return -1;
|
|
2519
3437
|
}
|
|
2520
|
-
const
|
|
3438
|
+
const dt = c.forwardRef(
|
|
2521
3439
|
function({
|
|
2522
3440
|
autoFocus: a,
|
|
2523
|
-
className:
|
|
2524
|
-
defaultValue:
|
|
3441
|
+
className: n,
|
|
3442
|
+
defaultValue: s,
|
|
2525
3443
|
disabled: l,
|
|
2526
|
-
error:
|
|
2527
|
-
externalLabel:
|
|
2528
|
-
fullWidth:
|
|
2529
|
-
helpText:
|
|
2530
|
-
id:
|
|
2531
|
-
inputSize:
|
|
2532
|
-
label:
|
|
2533
|
-
name:
|
|
2534
|
-
noResultsText:
|
|
2535
|
-
onBlur:
|
|
2536
|
-
onChange:
|
|
2537
|
-
onFocus:
|
|
2538
|
-
options:
|
|
2539
|
-
placeholder:
|
|
2540
|
-
required:
|
|
2541
|
-
style:
|
|
2542
|
-
value:
|
|
2543
|
-
...
|
|
2544
|
-
},
|
|
2545
|
-
var
|
|
2546
|
-
const { theme:
|
|
2547
|
-
|
|
2548
|
-
),
|
|
2549
|
-
() =>
|
|
3444
|
+
error: i,
|
|
3445
|
+
externalLabel: g = !1,
|
|
3446
|
+
fullWidth: v,
|
|
3447
|
+
helpText: d,
|
|
3448
|
+
id: _,
|
|
3449
|
+
inputSize: b,
|
|
3450
|
+
label: f,
|
|
3451
|
+
name: y,
|
|
3452
|
+
noResultsText: o = "No results",
|
|
3453
|
+
onBlur: h,
|
|
3454
|
+
onChange: u,
|
|
3455
|
+
onFocus: j,
|
|
3456
|
+
options: k,
|
|
3457
|
+
placeholder: D,
|
|
3458
|
+
required: O,
|
|
3459
|
+
style: C,
|
|
3460
|
+
value: T,
|
|
3461
|
+
...N
|
|
3462
|
+
}, p) {
|
|
3463
|
+
var _e;
|
|
3464
|
+
const { theme: Y } = Re(), K = c.useId(), P = _ ?? `luna-autocomplete-${K.replace(/:/g, "")}`, Q = `${P}-label`, H = `${P}-listbox`, X = i || d ? `${P}-message` : void 0, ee = b ?? ((_e = Y.components.input) == null ? void 0 : _e.defaultSize) ?? "md", ce = i != null, oe = f != null && g, me = f != null && !g, pe = typeof D == "string" && D.length > 0, Z = typeof T == "string", [ge, q] = c.useState(
|
|
3465
|
+
Ja(T, s)
|
|
3466
|
+
), L = Z ? String(T ?? "") : ge, A = Je(k, L), [ne, te] = c.useState((A == null ? void 0 : A.label) ?? ""), [$, re] = c.useState(!1), [de, be] = c.useState(!1), ie = We([Y]), G = c.useRef(null), U = c.useMemo(() => qa(k, ne), [k, ne]), [je, he] = c.useState(
|
|
3467
|
+
() => zn(U)
|
|
2550
3468
|
);
|
|
2551
|
-
|
|
2552
|
-
const
|
|
2553
|
-
|
|
2554
|
-
}, [
|
|
2555
|
-
var
|
|
2556
|
-
a && ((
|
|
2557
|
-
}, [a]),
|
|
2558
|
-
const
|
|
2559
|
-
(
|
|
3469
|
+
c.useImperativeHandle(p, () => G.current, []), c.useEffect(() => {
|
|
3470
|
+
const F = Je(k, L);
|
|
3471
|
+
te((F == null ? void 0 : F.label) ?? "");
|
|
3472
|
+
}, [k, L]), c.useEffect(() => {
|
|
3473
|
+
var F;
|
|
3474
|
+
a && ((F = G.current) == null || F.focus());
|
|
3475
|
+
}, [a]), c.useEffect(() => {
|
|
3476
|
+
const F = U.findIndex(
|
|
3477
|
+
(x) => x.value === L && !x.disabled
|
|
2560
3478
|
);
|
|
2561
|
-
|
|
2562
|
-
|
|
3479
|
+
he(
|
|
3480
|
+
F >= 0 ? F : zn(U)
|
|
2563
3481
|
);
|
|
2564
|
-
}, [
|
|
2565
|
-
if (
|
|
3482
|
+
}, [U, L]), c.useEffect(() => {
|
|
3483
|
+
if (!$)
|
|
2566
3484
|
return;
|
|
2567
|
-
function
|
|
2568
|
-
var
|
|
2569
|
-
const
|
|
2570
|
-
if (!((
|
|
2571
|
-
|
|
2572
|
-
const
|
|
2573
|
-
|
|
3485
|
+
function F(x) {
|
|
3486
|
+
var le;
|
|
3487
|
+
const R = x.target;
|
|
3488
|
+
if (!((le = ie.current) != null && le.contains(R))) {
|
|
3489
|
+
re(!1);
|
|
3490
|
+
const Ne = Je(k, L);
|
|
3491
|
+
te((Ne == null ? void 0 : Ne.label) ?? "");
|
|
2574
3492
|
}
|
|
2575
3493
|
}
|
|
2576
|
-
return document.addEventListener("mousedown",
|
|
2577
|
-
document.removeEventListener("mousedown",
|
|
3494
|
+
return document.addEventListener("mousedown", F), () => {
|
|
3495
|
+
document.removeEventListener("mousedown", F);
|
|
2578
3496
|
};
|
|
2579
|
-
}, [
|
|
2580
|
-
function fe(
|
|
2581
|
-
|
|
2582
|
-
}
|
|
2583
|
-
function
|
|
2584
|
-
|
|
2585
|
-
}
|
|
2586
|
-
function
|
|
2587
|
-
var
|
|
2588
|
-
fe(""),
|
|
2589
|
-
}
|
|
2590
|
-
function Se(
|
|
2591
|
-
be(!0),
|
|
2592
|
-
}
|
|
2593
|
-
function
|
|
2594
|
-
var
|
|
2595
|
-
const
|
|
2596
|
-
if (!((
|
|
2597
|
-
be(!1),
|
|
2598
|
-
const
|
|
2599
|
-
|
|
3497
|
+
}, [$, k, ie, L]);
|
|
3498
|
+
function fe(F) {
|
|
3499
|
+
Z || q(F), u == null || u(F);
|
|
3500
|
+
}
|
|
3501
|
+
function we(F) {
|
|
3502
|
+
F.disabled || (fe(F.value), te(F.label), re(!1));
|
|
3503
|
+
}
|
|
3504
|
+
function Ee() {
|
|
3505
|
+
var F;
|
|
3506
|
+
fe(""), te(""), re(!1), (F = G.current) == null || F.focus();
|
|
3507
|
+
}
|
|
3508
|
+
function Se(F) {
|
|
3509
|
+
be(!0), re(!0), j == null || j(F);
|
|
3510
|
+
}
|
|
3511
|
+
function De(F) {
|
|
3512
|
+
var R;
|
|
3513
|
+
const x = F.relatedTarget;
|
|
3514
|
+
if (!((R = ie.current) != null && R.contains(x))) {
|
|
3515
|
+
be(!1), re(!1);
|
|
3516
|
+
const le = Je(k, L);
|
|
3517
|
+
te((le == null ? void 0 : le.label) ?? ""), h == null || h(F);
|
|
2600
3518
|
}
|
|
2601
3519
|
}
|
|
2602
|
-
function
|
|
2603
|
-
const
|
|
2604
|
-
|
|
3520
|
+
function ke(F) {
|
|
3521
|
+
const x = F.currentTarget.value;
|
|
3522
|
+
te(x), re(!0), L && fe("");
|
|
2605
3523
|
}
|
|
2606
|
-
function
|
|
2607
|
-
var
|
|
3524
|
+
function Ce(F) {
|
|
3525
|
+
var x;
|
|
2608
3526
|
if (!l) {
|
|
2609
|
-
switch (
|
|
3527
|
+
switch (F.key) {
|
|
2610
3528
|
case "ArrowDown": {
|
|
2611
|
-
if (
|
|
2612
|
-
|
|
3529
|
+
if (F.preventDefault(), !$) {
|
|
3530
|
+
re(!0);
|
|
2613
3531
|
return;
|
|
2614
3532
|
}
|
|
2615
|
-
|
|
2616
|
-
(
|
|
3533
|
+
he(
|
|
3534
|
+
(R) => Ln(U, R < 0 ? -1 : R, 1)
|
|
2617
3535
|
);
|
|
2618
3536
|
break;
|
|
2619
3537
|
}
|
|
2620
3538
|
case "ArrowUp": {
|
|
2621
|
-
if (
|
|
2622
|
-
|
|
3539
|
+
if (F.preventDefault(), !$) {
|
|
3540
|
+
re(!0);
|
|
2623
3541
|
return;
|
|
2624
3542
|
}
|
|
2625
|
-
|
|
2626
|
-
(
|
|
2627
|
-
|
|
2628
|
-
|
|
3543
|
+
he(
|
|
3544
|
+
(R) => Ln(
|
|
3545
|
+
U,
|
|
3546
|
+
R < 0 ? U.length : R,
|
|
2629
3547
|
-1
|
|
2630
3548
|
)
|
|
2631
3549
|
);
|
|
2632
3550
|
break;
|
|
2633
3551
|
}
|
|
2634
3552
|
case "Enter": {
|
|
2635
|
-
if (
|
|
3553
|
+
if (!$)
|
|
2636
3554
|
break;
|
|
2637
|
-
|
|
2638
|
-
const
|
|
2639
|
-
|
|
3555
|
+
F.preventDefault();
|
|
3556
|
+
const R = U[je];
|
|
3557
|
+
R && we(R);
|
|
2640
3558
|
break;
|
|
2641
3559
|
}
|
|
2642
3560
|
case "Escape": {
|
|
2643
|
-
if (
|
|
2644
|
-
|
|
2645
|
-
const
|
|
2646
|
-
|
|
3561
|
+
if ($) {
|
|
3562
|
+
F.preventDefault(), re(!1);
|
|
3563
|
+
const R = Je(k, L);
|
|
3564
|
+
te((R == null ? void 0 : R.label) ?? "");
|
|
2647
3565
|
}
|
|
2648
3566
|
break;
|
|
2649
3567
|
}
|
|
2650
3568
|
}
|
|
2651
|
-
(
|
|
3569
|
+
(x = N.onKeyDown) == null || x.call(N, F);
|
|
2652
3570
|
}
|
|
2653
3571
|
}
|
|
2654
|
-
function
|
|
2655
|
-
var
|
|
3572
|
+
function Be(F) {
|
|
3573
|
+
var R;
|
|
2656
3574
|
if (l)
|
|
2657
3575
|
return;
|
|
2658
|
-
const
|
|
2659
|
-
|
|
3576
|
+
const x = F.target;
|
|
3577
|
+
x != null && x.closest(".luna-autocomplete__listbox") || x != null && x.closest(".luna-autocomplete__clear") || (F.preventDefault(), (R = G.current) == null || R.focus(), re(!0));
|
|
2660
3578
|
}
|
|
2661
|
-
const
|
|
2662
|
-
return /* @__PURE__ */
|
|
3579
|
+
const Oe = ne.length > 0, I = me && (de || $ || Oe || pe), V = $ && je >= 0 ? `${P}-option-${je}` : void 0;
|
|
3580
|
+
return /* @__PURE__ */ r.jsxs(
|
|
2663
3581
|
"div",
|
|
2664
3582
|
{
|
|
2665
|
-
ref:
|
|
2666
|
-
className:
|
|
3583
|
+
ref: ie,
|
|
3584
|
+
className: Bn([
|
|
2667
3585
|
"luna-autocomplete-field",
|
|
2668
|
-
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
|
|
2672
|
-
|
|
2673
|
-
|
|
3586
|
+
v && "luna-autocomplete-field--full-width",
|
|
3587
|
+
me && "luna-autocomplete-field--inset-label",
|
|
3588
|
+
I && "luna-autocomplete-field--inset-label-active",
|
|
3589
|
+
L && "luna-autocomplete-field--has-selection",
|
|
3590
|
+
ne && "luna-autocomplete-field--has-query",
|
|
3591
|
+
$ && "luna-autocomplete-field--open",
|
|
2674
3592
|
l && "luna-autocomplete-field--disabled",
|
|
2675
|
-
|
|
2676
|
-
|
|
3593
|
+
ce && "luna-autocomplete-field--invalid",
|
|
3594
|
+
n
|
|
2677
3595
|
]),
|
|
2678
3596
|
"data-size": ee,
|
|
2679
|
-
style:
|
|
3597
|
+
style: C,
|
|
2680
3598
|
children: [
|
|
2681
|
-
|
|
2682
|
-
/* @__PURE__ */
|
|
2683
|
-
|
|
3599
|
+
oe ? /* @__PURE__ */ r.jsx("label", { htmlFor: P, className: "luna-autocomplete-field__label", children: /* @__PURE__ */ r.jsx(B, { as: "span", variant: "label", children: f }) }) : null,
|
|
3600
|
+
/* @__PURE__ */ r.jsxs("div", { className: "luna-autocomplete-field__control", onMouseDown: Be, children: [
|
|
3601
|
+
me ? /* @__PURE__ */ r.jsx(
|
|
2684
3602
|
"label",
|
|
2685
3603
|
{
|
|
2686
|
-
htmlFor:
|
|
2687
|
-
id:
|
|
3604
|
+
htmlFor: P,
|
|
3605
|
+
id: Q,
|
|
2688
3606
|
className: "luna-autocomplete-field__label luna-autocomplete-field__label--inset",
|
|
2689
|
-
children: /* @__PURE__ */
|
|
3607
|
+
children: /* @__PURE__ */ r.jsx(B, { as: "span", variant: "caption", children: f })
|
|
2690
3608
|
}
|
|
2691
3609
|
) : null,
|
|
2692
|
-
/* @__PURE__ */
|
|
3610
|
+
/* @__PURE__ */ r.jsx(
|
|
2693
3611
|
"input",
|
|
2694
3612
|
{
|
|
2695
|
-
...
|
|
2696
|
-
ref:
|
|
2697
|
-
id:
|
|
3613
|
+
...N,
|
|
3614
|
+
ref: G,
|
|
3615
|
+
id: P,
|
|
2698
3616
|
className: "luna-autocomplete",
|
|
2699
3617
|
type: "text",
|
|
2700
|
-
value:
|
|
2701
|
-
placeholder:
|
|
3618
|
+
value: ne,
|
|
3619
|
+
placeholder: D,
|
|
2702
3620
|
disabled: l,
|
|
2703
|
-
onChange:
|
|
3621
|
+
onChange: ke,
|
|
2704
3622
|
onFocus: Se,
|
|
2705
|
-
onBlur:
|
|
2706
|
-
onKeyDown:
|
|
2707
|
-
"aria-invalid":
|
|
2708
|
-
"aria-describedby":
|
|
2709
|
-
"aria-labelledby":
|
|
2710
|
-
"aria-controls":
|
|
2711
|
-
"aria-expanded":
|
|
3623
|
+
onBlur: De,
|
|
3624
|
+
onKeyDown: Ce,
|
|
3625
|
+
"aria-invalid": ce ? !0 : N["aria-invalid"],
|
|
3626
|
+
"aria-describedby": X ?? N["aria-describedby"],
|
|
3627
|
+
"aria-labelledby": f ? Q : void 0,
|
|
3628
|
+
"aria-controls": $ ? H : void 0,
|
|
3629
|
+
"aria-expanded": $,
|
|
2712
3630
|
"aria-autocomplete": "list",
|
|
2713
|
-
"aria-activedescendant":
|
|
3631
|
+
"aria-activedescendant": V,
|
|
2714
3632
|
role: "combobox"
|
|
2715
3633
|
}
|
|
2716
3634
|
),
|
|
2717
|
-
(
|
|
3635
|
+
(L || ne) && !l ? /* @__PURE__ */ r.jsx(
|
|
2718
3636
|
"button",
|
|
2719
3637
|
{
|
|
2720
3638
|
type: "button",
|
|
2721
3639
|
className: "luna-autocomplete__clear",
|
|
2722
3640
|
"aria-label": "Clear value",
|
|
2723
|
-
onMouseDown: (
|
|
2724
|
-
onClick:
|
|
3641
|
+
onMouseDown: (F) => F.preventDefault(),
|
|
3642
|
+
onClick: Ee
|
|
2725
3643
|
}
|
|
2726
3644
|
) : null,
|
|
2727
|
-
/* @__PURE__ */
|
|
3645
|
+
/* @__PURE__ */ r.jsx(
|
|
2728
3646
|
"input",
|
|
2729
3647
|
{
|
|
2730
3648
|
type: "hidden",
|
|
2731
3649
|
className: "luna-autocomplete__hidden",
|
|
2732
|
-
name:
|
|
2733
|
-
value:
|
|
2734
|
-
required:
|
|
3650
|
+
name: y,
|
|
3651
|
+
value: L,
|
|
3652
|
+
required: O,
|
|
2735
3653
|
readOnly: !0
|
|
2736
3654
|
}
|
|
2737
3655
|
),
|
|
2738
|
-
|
|
2739
|
-
const
|
|
2740
|
-
return /* @__PURE__ */
|
|
3656
|
+
$ ? /* @__PURE__ */ r.jsx("div", { className: "luna-autocomplete__listbox", id: H, role: "listbox", children: U.length ? U.map((F, x) => {
|
|
3657
|
+
const R = F.value === L, le = x === je;
|
|
3658
|
+
return /* @__PURE__ */ r.jsx(
|
|
2741
3659
|
"div",
|
|
2742
3660
|
{
|
|
2743
|
-
id: `${
|
|
3661
|
+
id: `${P}-option-${x}`,
|
|
2744
3662
|
role: "option",
|
|
2745
|
-
"aria-selected":
|
|
2746
|
-
"aria-disabled":
|
|
2747
|
-
className:
|
|
3663
|
+
"aria-selected": R,
|
|
3664
|
+
"aria-disabled": F.disabled ? !0 : void 0,
|
|
3665
|
+
className: Bn([
|
|
2748
3666
|
"luna-autocomplete__option",
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
|
|
3667
|
+
R && "luna-autocomplete__option--selected",
|
|
3668
|
+
le && "luna-autocomplete__option--highlighted",
|
|
3669
|
+
F.disabled && "luna-autocomplete__option--disabled"
|
|
2752
3670
|
]),
|
|
2753
|
-
onMouseDown: (
|
|
2754
|
-
onClick: () =>
|
|
2755
|
-
children:
|
|
3671
|
+
onMouseDown: (Ne) => Ne.preventDefault(),
|
|
3672
|
+
onClick: () => we(F),
|
|
3673
|
+
children: F.label
|
|
2756
3674
|
},
|
|
2757
|
-
|
|
3675
|
+
F.value
|
|
2758
3676
|
);
|
|
2759
|
-
}) : /* @__PURE__ */
|
|
3677
|
+
}) : /* @__PURE__ */ r.jsx("div", { className: "luna-autocomplete__empty", children: o }) }) : null
|
|
2760
3678
|
] }),
|
|
2761
|
-
|
|
2762
|
-
|
|
3679
|
+
ce ? /* @__PURE__ */ r.jsx(
|
|
3680
|
+
B,
|
|
2763
3681
|
{
|
|
2764
|
-
id:
|
|
3682
|
+
id: X,
|
|
2765
3683
|
variant: "caption",
|
|
2766
3684
|
className: "luna-autocomplete-field__message luna-autocomplete-field__message--error",
|
|
2767
|
-
children:
|
|
3685
|
+
children: i
|
|
2768
3686
|
}
|
|
2769
|
-
) :
|
|
2770
|
-
|
|
3687
|
+
) : d != null ? /* @__PURE__ */ r.jsx(
|
|
3688
|
+
B,
|
|
2771
3689
|
{
|
|
2772
|
-
id:
|
|
3690
|
+
id: X,
|
|
2773
3691
|
variant: "caption",
|
|
2774
3692
|
className: "luna-autocomplete-field__message luna-autocomplete-field__message--help",
|
|
2775
|
-
children:
|
|
3693
|
+
children: d
|
|
2776
3694
|
}
|
|
2777
3695
|
) : null
|
|
2778
3696
|
]
|
|
2779
3697
|
}
|
|
2780
3698
|
);
|
|
2781
3699
|
}
|
|
2782
|
-
)
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
|
|
2787
|
-
|
|
3700
|
+
);
|
|
3701
|
+
function Qa(e) {
|
|
3702
|
+
return e.filter(Boolean).join(" ");
|
|
3703
|
+
}
|
|
3704
|
+
const ft = c.forwardRef(function({ checked: a, className: n, description: s, disabled: l, error: i, helpText: g, id: v, label: d, ..._ }, b) {
|
|
3705
|
+
const f = c.useId(), y = v ?? `luna-switch-${f.replace(/:/g, "")}`, o = i || g ? `${y}-message` : void 0, h = s ? `${y}-description` : void 0, u = i != null;
|
|
3706
|
+
return /* @__PURE__ */ r.jsxs(
|
|
3707
|
+
"div",
|
|
3708
|
+
{
|
|
3709
|
+
className: Qa([
|
|
3710
|
+
"luna-switch-field",
|
|
3711
|
+
l && "luna-switch-field--disabled",
|
|
3712
|
+
u && "luna-switch-field--invalid",
|
|
3713
|
+
n
|
|
3714
|
+
]),
|
|
3715
|
+
children: [
|
|
3716
|
+
/* @__PURE__ */ r.jsxs("label", { htmlFor: y, className: "luna-switch-field__main", children: [
|
|
3717
|
+
/* @__PURE__ */ r.jsx(
|
|
3718
|
+
"input",
|
|
3719
|
+
{
|
|
3720
|
+
..._,
|
|
3721
|
+
ref: b,
|
|
3722
|
+
id: y,
|
|
3723
|
+
className: "luna-switch",
|
|
3724
|
+
type: "checkbox",
|
|
3725
|
+
checked: a,
|
|
3726
|
+
disabled: l,
|
|
3727
|
+
"aria-invalid": u ? !0 : _["aria-invalid"],
|
|
3728
|
+
"aria-describedby": [h, o].filter(Boolean).join(" ") || void 0
|
|
3729
|
+
}
|
|
3730
|
+
),
|
|
3731
|
+
/* @__PURE__ */ r.jsx("span", { className: "luna-switch__track", "aria-hidden": "true", children: /* @__PURE__ */ r.jsx("span", { className: "luna-switch__thumb" }) }),
|
|
3732
|
+
/* @__PURE__ */ r.jsxs("span", { className: "luna-switch-field__text", children: [
|
|
3733
|
+
d != null ? /* @__PURE__ */ r.jsx(B, { as: "span", variant: "label", className: "luna-switch-field__label", children: d }) : null,
|
|
3734
|
+
s != null ? /* @__PURE__ */ r.jsx(
|
|
3735
|
+
B,
|
|
3736
|
+
{
|
|
3737
|
+
id: h,
|
|
3738
|
+
as: "span",
|
|
3739
|
+
variant: "body-small",
|
|
3740
|
+
className: "luna-switch-field__description",
|
|
3741
|
+
children: s
|
|
3742
|
+
}
|
|
3743
|
+
) : null
|
|
3744
|
+
] })
|
|
3745
|
+
] }),
|
|
3746
|
+
u ? /* @__PURE__ */ r.jsx(
|
|
3747
|
+
B,
|
|
3748
|
+
{
|
|
3749
|
+
id: o,
|
|
3750
|
+
variant: "caption",
|
|
3751
|
+
className: "luna-switch-field__message luna-switch-field__message--error",
|
|
3752
|
+
children: i
|
|
3753
|
+
}
|
|
3754
|
+
) : g != null ? /* @__PURE__ */ r.jsx(
|
|
3755
|
+
B,
|
|
3756
|
+
{
|
|
3757
|
+
id: o,
|
|
3758
|
+
variant: "caption",
|
|
3759
|
+
className: "luna-switch-field__message luna-switch-field__message--help",
|
|
3760
|
+
children: g
|
|
3761
|
+
}
|
|
3762
|
+
) : null
|
|
3763
|
+
]
|
|
3764
|
+
}
|
|
3765
|
+
);
|
|
3766
|
+
}), gt = c.forwardRef(function({ as: a, children: n, className: s, colSpan: l, columns: i = 12, gap: g, inline: v, style: d, ..._ }, b) {
|
|
3767
|
+
const { theme: f } = Re(), y = a ?? "div", o = {
|
|
3768
|
+
...Me(l),
|
|
3769
|
+
"--luna-grid-columns": String(i),
|
|
3770
|
+
...g ? { "--luna-layout-gap": mn(g, f) } : {},
|
|
3771
|
+
...d
|
|
2788
3772
|
};
|
|
2789
|
-
return /* @__PURE__ */
|
|
2790
|
-
|
|
3773
|
+
return /* @__PURE__ */ r.jsx(
|
|
3774
|
+
y,
|
|
2791
3775
|
{
|
|
2792
|
-
...
|
|
2793
|
-
ref:
|
|
2794
|
-
className:
|
|
2795
|
-
style:
|
|
2796
|
-
children:
|
|
3776
|
+
..._,
|
|
3777
|
+
ref: b,
|
|
3778
|
+
className: gn(["luna-grid", v && "luna-grid--inline", s]),
|
|
3779
|
+
style: o,
|
|
3780
|
+
children: pn(n, "luna-grid__item")
|
|
2797
3781
|
}
|
|
2798
3782
|
);
|
|
2799
3783
|
});
|
|
2800
3784
|
export {
|
|
2801
|
-
|
|
2802
|
-
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
|
|
2819
|
-
|
|
2820
|
-
|
|
3785
|
+
dt as LunaAutocomplete,
|
|
3786
|
+
wn as LunaButton,
|
|
3787
|
+
et as LunaCard,
|
|
3788
|
+
nt as LunaCheckbox,
|
|
3789
|
+
In as LunaColumn,
|
|
3790
|
+
Ia as LunaDateInput,
|
|
3791
|
+
at as LunaDatePicker,
|
|
3792
|
+
rt as LunaDivider,
|
|
3793
|
+
gt as LunaGrid,
|
|
3794
|
+
lt as LunaHeader,
|
|
3795
|
+
it as LunaInput,
|
|
3796
|
+
ct as LunaMultiselect,
|
|
3797
|
+
tt as LunaRadio,
|
|
3798
|
+
ba as LunaRow,
|
|
3799
|
+
ot as LunaSelect,
|
|
3800
|
+
st as LunaSlider,
|
|
3801
|
+
ft as LunaSwitch,
|
|
3802
|
+
B as LunaText,
|
|
3803
|
+
ut as LunaTextarea,
|
|
3804
|
+
Ma as ThemeProvider,
|
|
3805
|
+
ra as isRawColor,
|
|
3806
|
+
Zn as lunarTheme,
|
|
3807
|
+
la as resolveModeTokens,
|
|
3808
|
+
M as resolveScaleValue,
|
|
3809
|
+
E as resolveTokenValue,
|
|
3810
|
+
Re as useTheme
|
|
2821
3811
|
};
|