@foi/design-system 0.0.9 → 0.0.10
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/{RadioGroup-D2s7AY6E.js → RadioGroup-BGdJ2fTN.js} +96 -98
- package/dist/RadioGroup-BGdJ2fTN.js.map +1 -0
- package/dist/{RadioGroup.context-zJGC5Sjc.js → RadioGroup.context-DJLdImVO.js} +145 -95
- package/dist/RadioGroup.context-DJLdImVO.js.map +1 -0
- package/dist/{Switch-CKpSiHQK.js → Switch-BBGFtWQt.js} +628 -635
- package/dist/Switch-BBGFtWQt.js.map +1 -0
- package/dist/ThemeProvider-DtW2BY15.js +39 -0
- package/dist/ThemeProvider-DtW2BY15.js.map +1 -0
- package/dist/atoms.d.ts +1 -0
- package/dist/atoms.mjs +3 -3
- package/dist/components/atoms/Icon/Icon.d.ts +10 -0
- package/dist/components/atoms/Icon/Icon.emotion.d.ts +2 -0
- package/dist/components/atoms/Icon/Icon.interface.d.ts +17 -0
- package/dist/components/atoms/Icon/index.d.ts +1 -0
- package/dist/hocs.mjs +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.mjs +5 -5
- package/dist/molecules.mjs +1 -1
- package/package.json +1 -4
- package/dist/RadioGroup-D2s7AY6E.js.map +0 -1
- package/dist/RadioGroup.context-zJGC5Sjc.js.map +0 -1
- package/dist/Switch-CKpSiHQK.js.map +0 -1
- package/dist/ThemeProvider-oFEpvMxv.js +0 -37
- package/dist/ThemeProvider-oFEpvMxv.js.map +0 -1
|
@@ -1,18 +1,13 @@
|
|
|
1
1
|
import { i as e, n as t, r as n, t as r } from "./emotion-react-jsx-runtime.browser.esm-BFNmScj4.js";
|
|
2
2
|
import { r as i } from "./theme-DEqiATmv.js";
|
|
3
|
-
import { a, t as
|
|
4
|
-
import { _ as
|
|
5
|
-
import { n as
|
|
6
|
-
import
|
|
7
|
-
import { css as
|
|
8
|
-
import { useController as
|
|
9
|
-
import de from "@mui/icons-material/EventOutlined";
|
|
10
|
-
import fe from "@mui/icons-material/ArrowDropUpOutlined";
|
|
11
|
-
import pe from "@mui/icons-material/KeyboardArrowLeftOutlined";
|
|
12
|
-
import me from "@mui/icons-material/KeyboardArrowRightOutlined";
|
|
13
|
-
import E from "@mui/icons-material/FiberManualRecord";
|
|
3
|
+
import { a, o, t as s } from "./RadioGroup.context-DJLdImVO.js";
|
|
4
|
+
import { _ as c, a as l, c as u, f as d, g as f, h as p, i as ee, l as te, m, n as ne, o as h, p as g, r as _, s as v, t as y, u as b, v as re, y as x } from "./DatePicker.utils-ytCEcs6T.js";
|
|
5
|
+
import { n as ie, t as S } from "./useStateCallback-D9fqdxiO.js";
|
|
6
|
+
import C, { forwardRef as ae, useContext as oe, useEffect as se, useLayoutEffect as ce, useMemo as w, useRef as T, useState as E } from "react";
|
|
7
|
+
import { css as D } from "@emotion/react";
|
|
8
|
+
import { useController as le } from "react-hook-form";
|
|
14
9
|
//#region src/components/atoms/Button/Button.emotion.ts
|
|
15
|
-
var
|
|
10
|
+
var O = (e, t) => `
|
|
16
11
|
// UTILS
|
|
17
12
|
${i(e, "color", `--BUTTON-EVENTS-${t}-COLOR-PRIMARY`)}
|
|
18
13
|
|
|
@@ -29,7 +24,7 @@ var D = (e, t) => `
|
|
|
29
24
|
${i(e, "outline-width", `--BUTTON-EVENTS-${t}-OUTLINE-WIDTH`)}
|
|
30
25
|
${i(e, "outline-style", `--BUTTON-EVENTS-${t}-OUTLINE-STYLE`)}
|
|
31
26
|
${i(e, "outline-offset", `--BUTTON-EVENTS-${t}-OUTLINE-OFFSET`)}
|
|
32
|
-
`,
|
|
27
|
+
`, ue = (e) => D`
|
|
33
28
|
&.--BUTTON {
|
|
34
29
|
width: 100%;
|
|
35
30
|
height: 48px;
|
|
@@ -47,35 +42,35 @@ var D = (e, t) => `
|
|
|
47
42
|
-webkit-tap-highlight-color: transparent;
|
|
48
43
|
|
|
49
44
|
// ENABLED
|
|
50
|
-
${
|
|
45
|
+
${O(e, "ENABLED")};
|
|
51
46
|
|
|
52
47
|
// HOVER
|
|
53
48
|
&:hover {
|
|
54
|
-
${
|
|
49
|
+
${O(e, "HOVER")};
|
|
55
50
|
}
|
|
56
51
|
|
|
57
52
|
// ACTIVE
|
|
58
53
|
&.--BUTTON-active,
|
|
59
54
|
&:active {
|
|
60
|
-
${
|
|
55
|
+
${O(e, "ACTIVE")};
|
|
61
56
|
}
|
|
62
57
|
|
|
63
58
|
// FOCUS
|
|
64
59
|
&:focus-visible {
|
|
65
60
|
outline: none;
|
|
66
|
-
${
|
|
61
|
+
${O(e, "FOCUS")};
|
|
67
62
|
}
|
|
68
63
|
|
|
69
64
|
// DISABLED
|
|
70
65
|
&:disabled {
|
|
71
66
|
pointer-events: none;
|
|
72
|
-
${
|
|
67
|
+
${O(e, "DISABLED")};
|
|
73
68
|
}
|
|
74
69
|
|
|
75
70
|
// LOADING
|
|
76
71
|
&.--BUTTON-loading {
|
|
77
72
|
pointer-events: none;
|
|
78
|
-
${
|
|
73
|
+
${O(e, "LOADING")};
|
|
79
74
|
}
|
|
80
75
|
|
|
81
76
|
.--BUTTON-iconStart,
|
|
@@ -97,8 +92,8 @@ var D = (e, t) => `
|
|
|
97
92
|
letter-spacing: 0.01em;
|
|
98
93
|
}
|
|
99
94
|
}
|
|
100
|
-
`, k = "--BUTTON",
|
|
101
|
-
let [u, d] =
|
|
95
|
+
`, k = "--BUTTON", de = ({ className: e, style: r, children: i = "Click me!", type: a = "button", loading: o = !1, iconStart: s, iconEnd: c, ...l }) => {
|
|
96
|
+
let [u, d] = E(!1);
|
|
102
97
|
return /* @__PURE__ */ n("button", {
|
|
103
98
|
className: [
|
|
104
99
|
k,
|
|
@@ -106,7 +101,7 @@ var D = (e, t) => `
|
|
|
106
101
|
o ? `${k}-loading` : "",
|
|
107
102
|
e || ""
|
|
108
103
|
].join(" "),
|
|
109
|
-
css:
|
|
104
|
+
css: ue(r),
|
|
110
105
|
type: a,
|
|
111
106
|
onKeyDown: (e) => {
|
|
112
107
|
(e.key === "Enter" || e.key === "Space") && d(!0), l.onKeyDown?.(e);
|
|
@@ -134,9 +129,9 @@ var D = (e, t) => `
|
|
|
134
129
|
})
|
|
135
130
|
]
|
|
136
131
|
});
|
|
137
|
-
},
|
|
138
|
-
let { componentStyles: i } = e([
|
|
139
|
-
return /* @__PURE__ */ t(
|
|
132
|
+
}, A = ({ theme: n, ...r }) => {
|
|
133
|
+
let { componentStyles: i } = e([o.BUTTON], n);
|
|
134
|
+
return /* @__PURE__ */ t(de, {
|
|
140
135
|
...r,
|
|
141
136
|
style: i
|
|
142
137
|
});
|
|
@@ -156,7 +151,7 @@ var D = (e, t) => `
|
|
|
156
151
|
~ .--DATEPICKER-helperText {
|
|
157
152
|
${i(e, "color", `--DATEPICKER-EVENTS-${t}-COLOR-TERTIARY`)};
|
|
158
153
|
}
|
|
159
|
-
`,
|
|
154
|
+
`, fe = (e) => D`
|
|
160
155
|
&.--DATEPICKER {
|
|
161
156
|
position: relative;
|
|
162
157
|
padding: 0;
|
|
@@ -504,27 +499,27 @@ var D = (e, t) => `
|
|
|
504
499
|
height: 16px;
|
|
505
500
|
}
|
|
506
501
|
}
|
|
507
|
-
`,
|
|
502
|
+
`, pe = (e, t) => `
|
|
508
503
|
// BACKGROUNDS
|
|
509
504
|
.--ICONBUTTON-span {
|
|
510
505
|
${i(e, "background-color", `--ICONBUTTON-EVENTS-${t}-BACKGROUND-COLOR`)}
|
|
511
506
|
}
|
|
512
|
-
`,
|
|
507
|
+
`, me = (e, t) => `
|
|
513
508
|
// SHADOWS
|
|
514
509
|
${i(e, "background-color", `--ICONBUTTON-EVENTS-${t}-SHADOW-COLOR`)}
|
|
515
|
-
`,
|
|
510
|
+
`, he = (e, t) => `
|
|
516
511
|
// UTILS
|
|
517
|
-
.--ICONBUTTON-span >
|
|
518
|
-
${i(e, "
|
|
512
|
+
.--ICONBUTTON-span > span {
|
|
513
|
+
${i(e, "color", `--ICONBUTTON-EVENTS-${t}-ICON-COLOR`)}
|
|
519
514
|
}
|
|
520
|
-
`,
|
|
515
|
+
`, ge = (e, t) => `
|
|
521
516
|
// BORDER
|
|
522
517
|
.--ICONBUTTON-span {
|
|
523
518
|
${i(e, "border-color", `--ICONBUTTON-EVENTS-${t}-BORDER-COLOR`)}
|
|
524
519
|
${i(e, "border-width", `--ICONBUTTON-EVENTS-${t}-BORDER-WIDTH`)}
|
|
525
520
|
${i(e, "border-style", `--ICONBUTTON-EVENTS-${t}-BORDER-STYLE`)}
|
|
526
521
|
}
|
|
527
|
-
`,
|
|
522
|
+
`, _e = (e, t) => `
|
|
528
523
|
// OUTLINE
|
|
529
524
|
.--ICONBUTTON-span {
|
|
530
525
|
${i(e, "outline-color", `--ICONBUTTON-EVENTS-${t}-OUTLINE-COLOR`)}
|
|
@@ -532,7 +527,7 @@ var D = (e, t) => `
|
|
|
532
527
|
${i(e, "outline-style", `--ICONBUTTON-EVENTS-${t}-OUTLINE-STYLE`)}
|
|
533
528
|
${i(e, "outline-offset", `--ICONBUTTON-EVENTS-${t}-OUTLINE-OFFSET`)}
|
|
534
529
|
}
|
|
535
|
-
`,
|
|
530
|
+
`, ve = (e) => D`
|
|
536
531
|
&.--ICONBUTTON {
|
|
537
532
|
width: 24px;
|
|
538
533
|
height: 24px;
|
|
@@ -553,15 +548,15 @@ var D = (e, t) => `
|
|
|
553
548
|
background-color: transparent;
|
|
554
549
|
|
|
555
550
|
// ENABLED
|
|
556
|
-
${
|
|
557
|
-
${
|
|
558
|
-
${
|
|
551
|
+
${pe(e, "ENABLED")};
|
|
552
|
+
${ge(e, "ENABLED")};
|
|
553
|
+
${he(e, "ENABLED")};
|
|
559
554
|
|
|
560
555
|
// HOVER
|
|
561
556
|
&:hover {
|
|
562
557
|
&:before {
|
|
563
558
|
opacity: 1;
|
|
564
|
-
${
|
|
559
|
+
${me(e, "HOVER")};
|
|
565
560
|
}
|
|
566
561
|
}
|
|
567
562
|
|
|
@@ -570,27 +565,27 @@ var D = (e, t) => `
|
|
|
570
565
|
&:active {
|
|
571
566
|
&:before {
|
|
572
567
|
opacity: 1;
|
|
573
|
-
${
|
|
568
|
+
${me(e, "ACTIVE")};
|
|
574
569
|
}
|
|
575
570
|
}
|
|
576
571
|
|
|
577
572
|
// FOCUS
|
|
578
573
|
&:focus-visible {
|
|
579
574
|
outline: none;
|
|
580
|
-
${
|
|
575
|
+
${_e(e, "FOCUS")};
|
|
581
576
|
}
|
|
582
577
|
|
|
583
578
|
// DISABLED
|
|
584
579
|
&:disabled {
|
|
585
580
|
pointer-events: none;
|
|
586
|
-
${
|
|
587
|
-
${
|
|
588
|
-
${
|
|
581
|
+
${pe(e, "ENABLED")};
|
|
582
|
+
${ge(e, "ENABLED")};
|
|
583
|
+
${he(e, "ENABLED")};
|
|
589
584
|
}
|
|
590
585
|
|
|
591
586
|
&.--ICONBUTTON-flipped {
|
|
592
587
|
.--ICONBUTTON-span {
|
|
593
|
-
>
|
|
588
|
+
> span {
|
|
594
589
|
rotate: 180deg !important;
|
|
595
590
|
}
|
|
596
591
|
}
|
|
@@ -605,7 +600,7 @@ var D = (e, t) => `
|
|
|
605
600
|
box-sizing: border-box;
|
|
606
601
|
${i(e, "border-radius", "--ICONBUTTON-ROOT-BORDER-RADIUS")};
|
|
607
602
|
|
|
608
|
-
>
|
|
603
|
+
> span {
|
|
609
604
|
rotate: 0deg;
|
|
610
605
|
transition: rotate 150ms ease-in-out;
|
|
611
606
|
position: absolute;
|
|
@@ -618,24 +613,24 @@ var D = (e, t) => `
|
|
|
618
613
|
&:before {
|
|
619
614
|
content: '';
|
|
620
615
|
position: absolute;
|
|
621
|
-
width:
|
|
622
|
-
height:
|
|
616
|
+
width: 32px;
|
|
617
|
+
height: 32px;
|
|
623
618
|
border-radius: 50%;
|
|
624
619
|
opacity: 0;
|
|
625
620
|
transition: opacity 150ms ease-in-out;
|
|
626
621
|
z-index: -1;
|
|
627
622
|
}
|
|
628
623
|
}
|
|
629
|
-
`,
|
|
630
|
-
let [s, c] =
|
|
624
|
+
`, F = "--ICONBUTTON", ye = ({ className: e, style: n, icon: r, onClick: i, isFlipped: a, ...o }) => {
|
|
625
|
+
let [s, c] = E(!1);
|
|
631
626
|
return /* @__PURE__ */ t("button", {
|
|
632
627
|
className: [
|
|
633
|
-
|
|
634
|
-
s ? `${
|
|
635
|
-
a ? `${
|
|
628
|
+
F,
|
|
629
|
+
s ? `${F}-active` : "",
|
|
630
|
+
a ? `${F}-flipped` : "",
|
|
636
631
|
e
|
|
637
632
|
].join(" "),
|
|
638
|
-
css:
|
|
633
|
+
css: ve(n),
|
|
639
634
|
type: "button",
|
|
640
635
|
onClick: i,
|
|
641
636
|
onKeyDown: (e) => {
|
|
@@ -647,26 +642,26 @@ var D = (e, t) => `
|
|
|
647
642
|
onBlur: (e) => {
|
|
648
643
|
c(!1), o.onBlur?.(e);
|
|
649
644
|
},
|
|
650
|
-
"data-testid":
|
|
645
|
+
"data-testid": F,
|
|
651
646
|
...o,
|
|
652
647
|
children: /* @__PURE__ */ t("span", {
|
|
653
|
-
className: `${
|
|
648
|
+
className: `${F}-span`,
|
|
654
649
|
children: r
|
|
655
650
|
})
|
|
656
651
|
});
|
|
657
|
-
},
|
|
658
|
-
let { componentStyles: i } = e([
|
|
659
|
-
return /* @__PURE__ */ t(
|
|
652
|
+
}, be = ({ theme: n, ...r }) => {
|
|
653
|
+
let { componentStyles: i } = e([o.ICONBUTTON], n);
|
|
654
|
+
return /* @__PURE__ */ t(ye, {
|
|
660
655
|
...r,
|
|
661
656
|
style: i
|
|
662
657
|
});
|
|
663
|
-
},
|
|
658
|
+
}, I = (e, t) => `
|
|
664
659
|
// OUTLINE
|
|
665
660
|
${i(e, "outline-color", `--DATEPICKERMENU-EVENTS-${t}-OUTLINE-COLOR`)}
|
|
666
661
|
${i(e, "outline-width", `--DATEPICKERMENU-EVENTS-${t}-OUTLINE-WIDTH`)}
|
|
667
662
|
${i(e, "outline-style", `--DATEPICKERMENU-EVENTS-${t}-OUTLINE-STYLE`)}
|
|
668
663
|
${i(e, "outline-offset", `--DATEPICKERMENU-EVENTS-${t}-OUTLINE-OFFSET`)}
|
|
669
|
-
`,
|
|
664
|
+
`, xe = (e) => D`
|
|
670
665
|
&.--DATEPICKERMENU {
|
|
671
666
|
z-index: 100;
|
|
672
667
|
position: absolute;
|
|
@@ -888,7 +883,7 @@ var D = (e, t) => `
|
|
|
888
883
|
&.--DATEPICKERMENU-focused,
|
|
889
884
|
&:focus-visible {
|
|
890
885
|
outline: none;
|
|
891
|
-
${
|
|
886
|
+
${I(e, "FOCUS")};
|
|
892
887
|
}
|
|
893
888
|
|
|
894
889
|
&.--DATEPICKERMENU-today {
|
|
@@ -966,7 +961,7 @@ var D = (e, t) => `
|
|
|
966
961
|
&.--DATEPICKERMENU-focused,
|
|
967
962
|
&:focus-visible {
|
|
968
963
|
outline: none;
|
|
969
|
-
${
|
|
964
|
+
${I(e, "FOCUS")};
|
|
970
965
|
}
|
|
971
966
|
|
|
972
967
|
&.--DATEPICKERMENU-selected {
|
|
@@ -993,92 +988,92 @@ var D = (e, t) => `
|
|
|
993
988
|
translate: 0 0;
|
|
994
989
|
}
|
|
995
990
|
}
|
|
996
|
-
`, L = "--DATEPICKERMENU",
|
|
997
|
-
let [
|
|
998
|
-
|
|
991
|
+
`, L = "--DATEPICKERMENU", Se = ae(({ isOpen: e, hasStaticOptions: i = !1, testId: o = `${L}-root`, monthLabel: s = "", yearLabel: c = "", onPrevMonth: l, onNextMonth: u, disablePrev: d = !1, disableNext: p = !1, weeks: ee = [], years: te = [], daysOfWeek: ne = [], selectedValue: h, format: g = "MM/dd/yyyy", today: _, focusedElement: v = -1, onSelectDay: y = () => {}, onSelectYear: b = () => {}, onMoveFocus: re = () => {}, onClose: x = () => {}, style: ie }, S) => {
|
|
992
|
+
let [C, ae] = E(!1), [oe, w] = E(null), [D, le] = E(0), [O, ue] = E(!1), [k, de] = E(-1), A = T({}), j = T({}), M = T(null), N = T(s + c);
|
|
993
|
+
se(() => {
|
|
999
994
|
if (!e) return;
|
|
1000
|
-
let t =
|
|
1001
|
-
t !==
|
|
995
|
+
let t = s + c;
|
|
996
|
+
t !== N.current && (N.current = t);
|
|
1002
997
|
}, [
|
|
1003
|
-
o,
|
|
1004
998
|
s,
|
|
999
|
+
c,
|
|
1005
1000
|
e
|
|
1006
1001
|
]);
|
|
1007
|
-
let
|
|
1008
|
-
|
|
1009
|
-
},
|
|
1010
|
-
|
|
1002
|
+
let P = () => {
|
|
1003
|
+
w("left"), le((e) => e + 1), l();
|
|
1004
|
+
}, fe = () => {
|
|
1005
|
+
w("right"), le((e) => e + 1), u();
|
|
1011
1006
|
};
|
|
1012
|
-
|
|
1013
|
-
if (!e ||
|
|
1014
|
-
let t =
|
|
1007
|
+
se(() => {
|
|
1008
|
+
if (!e || v < 0) return;
|
|
1009
|
+
let t = A.current[v];
|
|
1015
1010
|
if (!t) return;
|
|
1016
1011
|
let n = document.activeElement;
|
|
1017
1012
|
n && (n.tagName === "INPUT" || n.role === "combobox") || t.focus(), t.scrollIntoView?.({
|
|
1018
1013
|
block: "nearest",
|
|
1019
1014
|
inline: "nearest"
|
|
1020
1015
|
});
|
|
1021
|
-
}, [
|
|
1016
|
+
}, [v, e]), se(() => {
|
|
1022
1017
|
if (!e) {
|
|
1023
|
-
let e = setTimeout(() =>
|
|
1018
|
+
let e = setTimeout(() => ae(!1), 150);
|
|
1024
1019
|
return () => clearTimeout(e);
|
|
1025
1020
|
}
|
|
1026
|
-
}, [e]),
|
|
1027
|
-
if (!
|
|
1028
|
-
|
|
1021
|
+
}, [e]), ce(() => {
|
|
1022
|
+
if (!C) {
|
|
1023
|
+
de(-1);
|
|
1029
1024
|
return;
|
|
1030
1025
|
}
|
|
1031
|
-
let e =
|
|
1032
|
-
|
|
1033
|
-
}, [
|
|
1034
|
-
if (!
|
|
1035
|
-
let e =
|
|
1026
|
+
let e = h && f(h) ? h.getFullYear() : _?.getFullYear() ?? (/* @__PURE__ */ new Date()).getFullYear(), t = te.flat().findIndex((t) => t.label === String(e));
|
|
1027
|
+
de(t >= 0 ? t : 0);
|
|
1028
|
+
}, [C]), ce(() => {
|
|
1029
|
+
if (!C || k < 0) return;
|
|
1030
|
+
let e = j.current[k];
|
|
1036
1031
|
e && (e.focus({ preventScroll: !0 }), e.scrollIntoView?.({
|
|
1037
1032
|
block: "nearest",
|
|
1038
1033
|
inline: "nearest"
|
|
1039
1034
|
}));
|
|
1040
|
-
}, [
|
|
1041
|
-
let
|
|
1035
|
+
}, [k, C]);
|
|
1036
|
+
let pe = (e, t) => {
|
|
1042
1037
|
if ([
|
|
1043
1038
|
"ArrowLeft",
|
|
1044
1039
|
"ArrowRight",
|
|
1045
1040
|
"ArrowUp",
|
|
1046
1041
|
"ArrowDown"
|
|
1047
1042
|
].includes(e.key)) {
|
|
1048
|
-
e.preventDefault(), e.stopPropagation(),
|
|
1043
|
+
e.preventDefault(), e.stopPropagation(), re(e.key);
|
|
1049
1044
|
return;
|
|
1050
1045
|
}
|
|
1051
|
-
e.key === "Enter" && (e.preventDefault(), e.stopPropagation(),
|
|
1052
|
-
},
|
|
1046
|
+
e.key === "Enter" && (e.preventDefault(), e.stopPropagation(), y(t, !0));
|
|
1047
|
+
}, me = (e, t) => {
|
|
1053
1048
|
let n = e.querySelector(t);
|
|
1054
1049
|
return n ? n.tagName === "BUTTON" ? n : n.querySelector("button") : null;
|
|
1055
|
-
},
|
|
1056
|
-
let t =
|
|
1050
|
+
}, he = (e) => {
|
|
1051
|
+
let t = te[0]?.length ?? 4, n = {
|
|
1057
1052
|
ArrowRight: 1,
|
|
1058
1053
|
ArrowLeft: -1,
|
|
1059
1054
|
ArrowDown: t,
|
|
1060
1055
|
ArrowUp: -t
|
|
1061
1056
|
}[e];
|
|
1062
1057
|
if (!n) return;
|
|
1063
|
-
let r =
|
|
1064
|
-
r < 0 || r >=
|
|
1065
|
-
},
|
|
1066
|
-
let t =
|
|
1058
|
+
let r = k + n;
|
|
1059
|
+
r < 0 || r >= te.flat().length || de(r);
|
|
1060
|
+
}, ge = (e) => {
|
|
1061
|
+
let t = M.current;
|
|
1067
1062
|
if (!t) return;
|
|
1068
|
-
let n =
|
|
1063
|
+
let n = me(t, `.${L}-yearArrow`), r = Array.from(t.querySelectorAll(`.${L}-navArrow`)), i = C ? null : r[0]?.tagName === "BUTTON" ? r[0] : r[0]?.querySelector("button") ?? null, a = C ? null : r[1]?.tagName === "BUTTON" ? r[1] : r[1]?.querySelector("button") ?? null, o = !C && v >= 0 ? A.current[v] ?? null : null, s = C && k >= 0 ? j.current[k] ?? null : null, c = C ? [n, s].filter((e) => e !== null) : [
|
|
1069
1064
|
n,
|
|
1070
1065
|
i,
|
|
1071
1066
|
a,
|
|
1072
1067
|
o
|
|
1073
1068
|
].filter((e) => e !== null);
|
|
1074
1069
|
c.length !== 0 && c[(c.indexOf(document.activeElement) + (e ? -1 : 1) + c.length) % c.length]?.focus();
|
|
1075
|
-
},
|
|
1070
|
+
}, _e = (e) => {
|
|
1076
1071
|
if (e.key === "Escape") {
|
|
1077
|
-
e.preventDefault(), e.stopPropagation(),
|
|
1072
|
+
e.preventDefault(), e.stopPropagation(), x();
|
|
1078
1073
|
return;
|
|
1079
1074
|
}
|
|
1080
1075
|
if (e.key === "Tab") {
|
|
1081
|
-
e.preventDefault(), e.stopPropagation(),
|
|
1076
|
+
e.preventDefault(), e.stopPropagation(), ge(e.shiftKey);
|
|
1082
1077
|
return;
|
|
1083
1078
|
}
|
|
1084
1079
|
[
|
|
@@ -1086,22 +1081,22 @@ var D = (e, t) => `
|
|
|
1086
1081
|
"ArrowRight",
|
|
1087
1082
|
"ArrowUp",
|
|
1088
1083
|
"ArrowDown"
|
|
1089
|
-
].includes(e.key) && (
|
|
1090
|
-
},
|
|
1084
|
+
].includes(e.key) && (C ? (e.preventDefault(), e.stopPropagation(), he(e.key)) : Object.values(A.current).some((e) => e === document.activeElement) || (e.preventDefault(), e.stopPropagation(), re(e.key)));
|
|
1085
|
+
}, ve = h && f(h) ? m(h, g) : null, F = _ && f(_) ? m(_, g) : null;
|
|
1091
1086
|
return /* @__PURE__ */ t("div", {
|
|
1092
|
-
ref:
|
|
1087
|
+
ref: S,
|
|
1093
1088
|
children: /* @__PURE__ */ n("div", {
|
|
1094
|
-
ref:
|
|
1089
|
+
ref: M,
|
|
1095
1090
|
className: [
|
|
1096
1091
|
L,
|
|
1097
1092
|
e ? `${L}-open` : "",
|
|
1098
1093
|
i ? `${L}-static` : ""
|
|
1099
1094
|
].filter(Boolean).join(" "),
|
|
1100
|
-
css:
|
|
1095
|
+
css: xe(ie),
|
|
1101
1096
|
role: "dialog",
|
|
1102
1097
|
"aria-label": "Date picker calendar",
|
|
1103
|
-
"data-testid":
|
|
1104
|
-
onKeyDownCapture:
|
|
1098
|
+
"data-testid": o,
|
|
1099
|
+
onKeyDownCapture: _e,
|
|
1105
1100
|
children: [/* @__PURE__ */ n("div", {
|
|
1106
1101
|
className: `${L}-header`,
|
|
1107
1102
|
children: [/* @__PURE__ */ n("div", {
|
|
@@ -1111,46 +1106,46 @@ var D = (e, t) => `
|
|
|
1111
1106
|
children: /* @__PURE__ */ n("span", {
|
|
1112
1107
|
className: `${L}-headerLabel`,
|
|
1113
1108
|
children: [
|
|
1114
|
-
|
|
1109
|
+
s,
|
|
1115
1110
|
" ",
|
|
1116
1111
|
/* @__PURE__ */ t("span", {
|
|
1117
1112
|
className: `${L}-yearLabel`,
|
|
1118
|
-
children:
|
|
1113
|
+
children: c
|
|
1119
1114
|
})
|
|
1120
1115
|
]
|
|
1121
1116
|
})
|
|
1122
|
-
}), /* @__PURE__ */ t(
|
|
1123
|
-
icon: /* @__PURE__ */ t(
|
|
1124
|
-
onClick: () =>
|
|
1117
|
+
}), /* @__PURE__ */ t(be, {
|
|
1118
|
+
icon: /* @__PURE__ */ t(a, { name: "arrow_drop_up" }),
|
|
1119
|
+
onClick: () => ae((e) => !e),
|
|
1125
1120
|
className: `${L}-yearArrow`,
|
|
1126
|
-
isFlipped: !
|
|
1127
|
-
"aria-label":
|
|
1121
|
+
isFlipped: !C,
|
|
1122
|
+
"aria-label": C ? "Close year selector" : "Open year selector",
|
|
1128
1123
|
tabIndex: -1,
|
|
1129
|
-
onFocus: () =>
|
|
1124
|
+
onFocus: () => ue(!0)
|
|
1130
1125
|
})]
|
|
1131
|
-
}), !
|
|
1126
|
+
}), !C && /* @__PURE__ */ n("div", {
|
|
1132
1127
|
className: `${L}-monthNav`,
|
|
1133
|
-
children: [/* @__PURE__ */ t(
|
|
1134
|
-
icon: /* @__PURE__ */ t(
|
|
1135
|
-
onClick:
|
|
1128
|
+
children: [/* @__PURE__ */ t(be, {
|
|
1129
|
+
icon: /* @__PURE__ */ t(a, { name: "keyboard_arrow_left" }),
|
|
1130
|
+
onClick: P,
|
|
1136
1131
|
className: `${L}-navArrow`,
|
|
1137
|
-
disabled:
|
|
1132
|
+
disabled: d,
|
|
1138
1133
|
"aria-label": "Previous month",
|
|
1139
1134
|
tabIndex: -1,
|
|
1140
|
-
onFocus: () =>
|
|
1141
|
-
}), /* @__PURE__ */ t(
|
|
1142
|
-
icon: /* @__PURE__ */ t(
|
|
1143
|
-
onClick:
|
|
1135
|
+
onFocus: () => ue(!0)
|
|
1136
|
+
}), /* @__PURE__ */ t(be, {
|
|
1137
|
+
icon: /* @__PURE__ */ t(a, { name: "keyboard_arrow_right" }),
|
|
1138
|
+
onClick: fe,
|
|
1144
1139
|
className: `${L}-navArrow`,
|
|
1145
|
-
disabled:
|
|
1140
|
+
disabled: p,
|
|
1146
1141
|
"aria-label": "Next month",
|
|
1147
1142
|
tabIndex: -1,
|
|
1148
|
-
onFocus: () =>
|
|
1143
|
+
onFocus: () => ue(!0)
|
|
1149
1144
|
})]
|
|
1150
1145
|
})]
|
|
1151
1146
|
}), /* @__PURE__ */ n("div", {
|
|
1152
|
-
className: [`${L}-body`,
|
|
1153
|
-
children: [!
|
|
1147
|
+
className: [`${L}-body`, C ? `${L}-yearBody` : ""].filter(Boolean).join(" "),
|
|
1148
|
+
children: [!C && /* @__PURE__ */ n(r, { children: [/* @__PURE__ */ t("div", {
|
|
1154
1149
|
className: `${L}-weekRow`,
|
|
1155
1150
|
children: ne.map((e, n) => /* @__PURE__ */ t("span", {
|
|
1156
1151
|
className: `${L}-dayCell`,
|
|
@@ -1161,21 +1156,21 @@ var D = (e, t) => `
|
|
|
1161
1156
|
children: /* @__PURE__ */ t("div", {
|
|
1162
1157
|
className: [
|
|
1163
1158
|
`${L}-calendarGrid`,
|
|
1164
|
-
|
|
1165
|
-
|
|
1159
|
+
oe === "left" ? `${L}-slideLeft` : "",
|
|
1160
|
+
oe === "right" ? `${L}-slideRight` : ""
|
|
1166
1161
|
].filter(Boolean).join(" "),
|
|
1167
|
-
onAnimationEnd: () =>
|
|
1162
|
+
onAnimationEnd: () => w(null),
|
|
1168
1163
|
children: (() => {
|
|
1169
1164
|
let n = 0;
|
|
1170
|
-
return
|
|
1165
|
+
return ee.map((r, i) => /* @__PURE__ */ t("div", {
|
|
1171
1166
|
className: `${L}-weekRow`,
|
|
1172
1167
|
children: r.map((r, a) => {
|
|
1173
1168
|
if (!r.isDate) return /* @__PURE__ */ t("span", { className: `${L}-dayCell` }, `blank-${i}-${a}`);
|
|
1174
|
-
let o = n++, s = !!(
|
|
1169
|
+
let o = n++, s = !!(ve && r.value === ve && e), c = r.value === F, l = v === o && e && !O;
|
|
1175
1170
|
return /* @__PURE__ */ t("button", {
|
|
1176
1171
|
id: `${L}-day-${o}`,
|
|
1177
1172
|
ref: (e) => {
|
|
1178
|
-
|
|
1173
|
+
A.current[o] = e;
|
|
1179
1174
|
},
|
|
1180
1175
|
className: [
|
|
1181
1176
|
`${L}-dayBtn`,
|
|
@@ -1184,9 +1179,9 @@ var D = (e, t) => `
|
|
|
1184
1179
|
l ? `${L}-focused` : ""
|
|
1185
1180
|
].filter(Boolean).join(" "),
|
|
1186
1181
|
type: "button",
|
|
1187
|
-
onClick: () =>
|
|
1188
|
-
onFocus: () =>
|
|
1189
|
-
onKeyDown: (e) =>
|
|
1182
|
+
onClick: () => y(r.value),
|
|
1183
|
+
onFocus: () => ue(!1),
|
|
1184
|
+
onKeyDown: (e) => pe(e, r.value),
|
|
1190
1185
|
disabled: r.isDisabled,
|
|
1191
1186
|
role: "option",
|
|
1192
1187
|
"aria-selected": s,
|
|
@@ -1196,18 +1191,18 @@ var D = (e, t) => `
|
|
|
1196
1191
|
})
|
|
1197
1192
|
}, `week-${i}`));
|
|
1198
1193
|
})()
|
|
1199
|
-
},
|
|
1200
|
-
})] }),
|
|
1194
|
+
}, D)
|
|
1195
|
+
})] }), C && /* @__PURE__ */ t("div", {
|
|
1201
1196
|
className: `${L}-yearScrollWrapper`,
|
|
1202
1197
|
children: (() => {
|
|
1203
1198
|
let e = 0;
|
|
1204
|
-
return
|
|
1199
|
+
return te.map((n, r) => /* @__PURE__ */ t("div", {
|
|
1205
1200
|
className: `${L}-weekRow`,
|
|
1206
1201
|
children: n.map((n) => {
|
|
1207
|
-
let r = e++, i =
|
|
1202
|
+
let r = e++, i = h && f(h) ? n.label === m(h, "yyyy") : !1, a = k === r && !O;
|
|
1208
1203
|
return /* @__PURE__ */ t("button", {
|
|
1209
1204
|
ref: (e) => {
|
|
1210
|
-
|
|
1205
|
+
j.current[r] = e;
|
|
1211
1206
|
},
|
|
1212
1207
|
className: [
|
|
1213
1208
|
`${L}-yearBtn`,
|
|
@@ -1217,9 +1212,9 @@ var D = (e, t) => `
|
|
|
1217
1212
|
type: "button",
|
|
1218
1213
|
tabIndex: -1,
|
|
1219
1214
|
onClick: () => {
|
|
1220
|
-
|
|
1215
|
+
b(n.value), ae(!1);
|
|
1221
1216
|
},
|
|
1222
|
-
onFocus: () =>
|
|
1217
|
+
onFocus: () => ue(!1),
|
|
1223
1218
|
"aria-selected": i,
|
|
1224
1219
|
children: n.label
|
|
1225
1220
|
}, n.value);
|
|
@@ -1231,142 +1226,142 @@ var D = (e, t) => `
|
|
|
1231
1226
|
})
|
|
1232
1227
|
});
|
|
1233
1228
|
});
|
|
1234
|
-
|
|
1229
|
+
Se.displayName = "DatePickerMenu";
|
|
1235
1230
|
//#endregion
|
|
1236
1231
|
//#region src/components/atoms/DatePicker/DatePickerMenu/index.tsx
|
|
1237
|
-
var
|
|
1238
|
-
let { componentStyles:
|
|
1239
|
-
return /* @__PURE__ */ t(
|
|
1232
|
+
var Ce = C.forwardRef(({ theme: n, ...r }, i) => {
|
|
1233
|
+
let { componentStyles: a } = e([o.DATEPICKERMENU, o.DATEPICKER], n);
|
|
1234
|
+
return /* @__PURE__ */ t(Se, {
|
|
1240
1235
|
...r,
|
|
1241
|
-
style:
|
|
1236
|
+
style: a,
|
|
1242
1237
|
ref: i
|
|
1243
1238
|
});
|
|
1244
1239
|
});
|
|
1245
|
-
|
|
1240
|
+
Ce.displayName = "DatePickerMenu";
|
|
1246
1241
|
//#endregion
|
|
1247
1242
|
//#region src/components/atoms/DatePicker/DatePicker.tsx
|
|
1248
|
-
var R = "--DATEPICKER",
|
|
1249
|
-
let
|
|
1243
|
+
var R = "--DATEPICKER", we = ({ name: e, label: r, control: i, language: o = ee(), minDate: s, maxDate: S, disabled: C, disableFuture: ae, disablePast: oe, hasStaticOptions: ce = !1, showErrorText: D = !0, hasPadding: O = !1, helperText: ue, style: k, className: de }) => {
|
|
1244
|
+
let A = y[o].format, j = w(() => c(/* @__PURE__ */ new Date()), []), M = o === "en", { field: N, fieldState: P } = le({
|
|
1250
1245
|
control: i,
|
|
1251
1246
|
name: e
|
|
1252
|
-
}),
|
|
1247
|
+
}), pe = P.error, me = w(() => f(N.value) ? d(N.value) : {
|
|
1253
1248
|
day: "",
|
|
1254
1249
|
month: "",
|
|
1255
1250
|
year: ""
|
|
1256
|
-
}, []), [
|
|
1257
|
-
minDate:
|
|
1258
|
-
maxDate:
|
|
1259
|
-
disableFuture:
|
|
1260
|
-
disablePast:
|
|
1261
|
-
today:
|
|
1251
|
+
}, []), [he, ge] = E(me.day), [_e, ve] = E(me.month), [F, ye] = E(me.year), [I, xe] = E(!1), [L, Se] = E(-1), [we, Te] = E(() => f(N.value) ? N.value : j), z = T(null), B = T(null), V = T(null), Ee = T(null), H = T(null), De = T(null), U = T(""), Oe = T(""), ke = T(""), Ae = I || !!(he || _e || F), je = w(() => l(we, A, o, {
|
|
1252
|
+
minDate: s,
|
|
1253
|
+
maxDate: S,
|
|
1254
|
+
disableFuture: ae,
|
|
1255
|
+
disablePast: oe,
|
|
1256
|
+
today: j
|
|
1262
1257
|
}), [
|
|
1263
1258
|
we,
|
|
1264
|
-
a,
|
|
1265
1259
|
o,
|
|
1260
|
+
s,
|
|
1261
|
+
S,
|
|
1266
1262
|
ae,
|
|
1267
1263
|
oe,
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
A.onChange(r), l(r) && Te(r), j && A.onBlur();
|
|
1264
|
+
j,
|
|
1265
|
+
A
|
|
1266
|
+
]), Me = w(() => je.flat().filter((e) => e.isDate), [je]), Ne = w(() => h(A, 1900, 200, 4), [A]), Pe = y[o].daysOfWeek.map((e) => ne[o][e]), Fe = _(we, o), W = m(we, "yyyy");
|
|
1267
|
+
se(() => {
|
|
1268
|
+
if (!he && !_e && !F) return;
|
|
1269
|
+
let e = he || "01", t = _e || "01", n = F || "2000", r = g(M ? `${t}/${e}/${n}` : `${e}/${t}/${n}`, A, /* @__PURE__ */ new Date());
|
|
1270
|
+
N.onChange(r), u(r) && Te(r), pe && N.onBlur();
|
|
1276
1271
|
}, [
|
|
1277
|
-
|
|
1272
|
+
he,
|
|
1278
1273
|
_e,
|
|
1279
|
-
|
|
1280
|
-
]),
|
|
1281
|
-
ref:
|
|
1274
|
+
F
|
|
1275
|
+
]), ie({
|
|
1276
|
+
ref: B,
|
|
1282
1277
|
onAction: () => {
|
|
1283
|
-
xe(!1),
|
|
1278
|
+
xe(!1), N.onBlur();
|
|
1284
1279
|
},
|
|
1285
|
-
isActive:
|
|
1286
|
-
exceptRef:
|
|
1280
|
+
isActive: I,
|
|
1281
|
+
exceptRef: z
|
|
1287
1282
|
});
|
|
1288
|
-
let
|
|
1289
|
-
let t = e.relatedTarget, n =
|
|
1290
|
-
n || r || (xe(!1),
|
|
1291
|
-
},
|
|
1283
|
+
let Ie = (e) => {
|
|
1284
|
+
let t = e.relatedTarget, n = z.current?.contains(t), r = B.current?.contains(t);
|
|
1285
|
+
n || r || (xe(!1), N.onBlur());
|
|
1286
|
+
}, G = (e) => requestAnimationFrame(() => e.current?.focus()), Le = (e) => {
|
|
1292
1287
|
if ([
|
|
1293
1288
|
"ArrowLeft",
|
|
1294
1289
|
"ArrowRight",
|
|
1295
1290
|
"ArrowUp",
|
|
1296
1291
|
"ArrowDown"
|
|
1297
|
-
].includes(e.key) &&
|
|
1298
|
-
e.preventDefault(), e.stopPropagation(),
|
|
1292
|
+
].includes(e.key) && I) {
|
|
1293
|
+
e.preventDefault(), e.stopPropagation(), Ue(e.key);
|
|
1299
1294
|
return;
|
|
1300
1295
|
}
|
|
1301
1296
|
if (e.key === "Backspace" || e.key === "Delete") {
|
|
1302
|
-
e.preventDefault(),
|
|
1297
|
+
e.preventDefault(), ge(""), U.current = "";
|
|
1303
1298
|
return;
|
|
1304
1299
|
}
|
|
1305
1300
|
if (!/^\d$/.test(e.key)) return;
|
|
1306
|
-
e.preventDefault(),
|
|
1307
|
-
let t = parseInt(
|
|
1301
|
+
e.preventDefault(), U.current = (U.current + e.key).slice(-2);
|
|
1302
|
+
let t = parseInt(U.current, 10);
|
|
1308
1303
|
if (t === 0) {
|
|
1309
|
-
|
|
1304
|
+
ge("01"), U.current = "";
|
|
1310
1305
|
return;
|
|
1311
1306
|
}
|
|
1312
|
-
|
|
1313
|
-
},
|
|
1307
|
+
ge(String(Math.min(t, 31)).padStart(2, "0")), (t > 3 || U.current.length >= 2) && (U.current = "", G(M ? De : H));
|
|
1308
|
+
}, Re = (e) => {
|
|
1314
1309
|
if ([
|
|
1315
1310
|
"ArrowLeft",
|
|
1316
1311
|
"ArrowRight",
|
|
1317
1312
|
"ArrowUp",
|
|
1318
1313
|
"ArrowDown"
|
|
1319
|
-
].includes(e.key) &&
|
|
1320
|
-
e.preventDefault(), e.stopPropagation(),
|
|
1314
|
+
].includes(e.key) && I) {
|
|
1315
|
+
e.preventDefault(), e.stopPropagation(), Ue(e.key);
|
|
1321
1316
|
return;
|
|
1322
1317
|
}
|
|
1323
1318
|
if (e.key === "Backspace" || e.key === "Delete") {
|
|
1324
|
-
e.preventDefault(), ve(""),
|
|
1319
|
+
e.preventDefault(), ve(""), Oe.current = "";
|
|
1325
1320
|
return;
|
|
1326
1321
|
}
|
|
1327
1322
|
if (!/^\d$/.test(e.key)) return;
|
|
1328
|
-
e.preventDefault(),
|
|
1329
|
-
let t = parseInt(
|
|
1323
|
+
e.preventDefault(), Oe.current = (Oe.current + e.key).slice(-2);
|
|
1324
|
+
let t = parseInt(Oe.current, 10);
|
|
1330
1325
|
if (t === 0) {
|
|
1331
|
-
ve("01"),
|
|
1326
|
+
ve("01"), Oe.current = "";
|
|
1332
1327
|
return;
|
|
1333
1328
|
}
|
|
1334
|
-
ve(String(Math.min(t, 12)).padStart(2, "0")), (t > 1 ||
|
|
1335
|
-
},
|
|
1329
|
+
ve(String(Math.min(t, 12)).padStart(2, "0")), (t > 1 || Oe.current.length >= 2) && (Oe.current = "", G(M ? Ee : De));
|
|
1330
|
+
}, ze = (e) => {
|
|
1336
1331
|
if ([
|
|
1337
1332
|
"ArrowLeft",
|
|
1338
1333
|
"ArrowRight",
|
|
1339
1334
|
"ArrowUp",
|
|
1340
1335
|
"ArrowDown"
|
|
1341
|
-
].includes(e.key) &&
|
|
1342
|
-
e.preventDefault(), e.stopPropagation(),
|
|
1336
|
+
].includes(e.key) && I) {
|
|
1337
|
+
e.preventDefault(), e.stopPropagation(), Ue(e.key);
|
|
1343
1338
|
return;
|
|
1344
1339
|
}
|
|
1345
1340
|
if (e.key === "Backspace" || e.key === "Delete") {
|
|
1346
|
-
e.preventDefault(),
|
|
1341
|
+
e.preventDefault(), ye(""), ke.current = "";
|
|
1347
1342
|
return;
|
|
1348
1343
|
}
|
|
1349
|
-
/^\d$/.test(e.key) && (e.preventDefault(),
|
|
1350
|
-
}, G = () => {
|
|
1351
|
-
if (x) return;
|
|
1352
|
-
let e = l(A.value) ? A.value : O;
|
|
1353
|
-
Te(e), Se(e.getDate() - 1), xe(!0);
|
|
1354
|
-
}, Ve = () => xe(!1), He = () => F ? Ve() : G(), Ue = () => {
|
|
1355
|
-
Te((e) => y(e, -1)), Se(-1);
|
|
1344
|
+
/^\d$/.test(e.key) && (e.preventDefault(), ke.current = (ke.current + e.key).slice(-4), ye(String(parseInt(ke.current, 10)).padStart(4, "0")));
|
|
1356
1345
|
}, K = () => {
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1346
|
+
if (C) return;
|
|
1347
|
+
let e = u(N.value) ? N.value : j;
|
|
1348
|
+
Te(e), Se(e.getDate() - 1), xe(!0);
|
|
1349
|
+
}, q = () => xe(!1), J = () => I ? q() : K(), Be = () => {
|
|
1350
|
+
Te((e) => re(e, -1)), Se(-1);
|
|
1351
|
+
}, Y = () => {
|
|
1352
|
+
Te((e) => re(e, 1)), Se(-1);
|
|
1353
|
+
}, Ve = b(we, {
|
|
1354
|
+
minDate: s,
|
|
1355
|
+
disablePast: oe,
|
|
1356
|
+
today: j,
|
|
1357
|
+
format: A
|
|
1358
|
+
}), He = te(we, {
|
|
1359
|
+
maxDate: S,
|
|
1360
|
+
disableFuture: ae,
|
|
1361
|
+
today: j,
|
|
1362
|
+
format: A
|
|
1363
|
+
}), Ue = (e) => {
|
|
1364
|
+
if (!I) return;
|
|
1370
1365
|
let t = {
|
|
1371
1366
|
ArrowRight: 1,
|
|
1372
1367
|
ArrowLeft: -1,
|
|
@@ -1374,155 +1369,155 @@ var R = "--DATEPICKER", Oe = ({ name: e, label: r, control: i, language: a = f()
|
|
|
1374
1369
|
ArrowUp: -7
|
|
1375
1370
|
}[e];
|
|
1376
1371
|
if (!t) return;
|
|
1377
|
-
if (
|
|
1372
|
+
if (L < 0) {
|
|
1378
1373
|
Me.length > 0 && Se(0);
|
|
1379
1374
|
return;
|
|
1380
1375
|
}
|
|
1381
|
-
let n = Me[
|
|
1376
|
+
let n = Me[L];
|
|
1382
1377
|
if (!n) return;
|
|
1383
|
-
let r =
|
|
1384
|
-
if (
|
|
1385
|
-
minDate:
|
|
1386
|
-
maxDate:
|
|
1387
|
-
disableFuture:
|
|
1388
|
-
disablePast:
|
|
1389
|
-
today:
|
|
1378
|
+
let r = g(n.value, A, /* @__PURE__ */ new Date()), i = x(r, t);
|
|
1379
|
+
if (v(i, {
|
|
1380
|
+
minDate: s,
|
|
1381
|
+
maxDate: S,
|
|
1382
|
+
disableFuture: ae,
|
|
1383
|
+
disablePast: oe,
|
|
1384
|
+
today: j
|
|
1390
1385
|
})) return;
|
|
1391
1386
|
if (i.getMonth() !== r.getMonth() || i.getFullYear() !== r.getFullYear()) {
|
|
1392
|
-
if (t > 0 &&
|
|
1393
|
-
Te(
|
|
1387
|
+
if (t > 0 && He || t < 0 && Ve) return;
|
|
1388
|
+
Te(p(i)), Se(i.getDate() - 1);
|
|
1394
1389
|
return;
|
|
1395
1390
|
}
|
|
1396
|
-
let a = Me.findIndex((e) => e.value ===
|
|
1391
|
+
let a = Me.findIndex((e) => e.value === m(i, A));
|
|
1397
1392
|
a >= 0 && Se(a);
|
|
1398
|
-
},
|
|
1399
|
-
let n =
|
|
1400
|
-
|
|
1401
|
-
let r =
|
|
1402
|
-
|
|
1393
|
+
}, We = (e, t) => {
|
|
1394
|
+
let n = g(e, A, /* @__PURE__ */ new Date());
|
|
1395
|
+
N.onChange(n);
|
|
1396
|
+
let r = d(n);
|
|
1397
|
+
ge(r.day), ve(r.month), ye(r.year), xe(!1), t && requestAnimationFrame(() => V.current?.querySelector("button")?.focus());
|
|
1403
1398
|
}, Ge = (e) => {
|
|
1404
|
-
let t =
|
|
1399
|
+
let t = g(e, A, /* @__PURE__ */ new Date()), n = u(N.value) ? N.value : j, r = new Date(n);
|
|
1405
1400
|
r.setFullYear(t.getFullYear());
|
|
1406
|
-
let i =
|
|
1407
|
-
|
|
1408
|
-
let a =
|
|
1409
|
-
|
|
1410
|
-
},
|
|
1401
|
+
let i = g(m(r, A), A, /* @__PURE__ */ new Date());
|
|
1402
|
+
N.onChange(i);
|
|
1403
|
+
let a = d(i);
|
|
1404
|
+
ge(a.day), ve(a.month), ye(a.year), Te(i);
|
|
1405
|
+
}, X = (e) => {
|
|
1411
1406
|
if (e.key === "Tab") {
|
|
1412
|
-
|
|
1407
|
+
q();
|
|
1413
1408
|
return;
|
|
1414
1409
|
}
|
|
1415
1410
|
if (e.key === "Escape") {
|
|
1416
|
-
|
|
1411
|
+
q();
|
|
1417
1412
|
return;
|
|
1418
1413
|
}
|
|
1419
|
-
e.key === "Enter" &&
|
|
1414
|
+
e.key === "Enter" && I && (e.preventDefault(), L >= 0 && Me[L] && !Me[L].isDisabled && We(Me[L].value)), [
|
|
1420
1415
|
"ArrowLeft",
|
|
1421
1416
|
"ArrowRight",
|
|
1422
1417
|
"ArrowUp",
|
|
1423
1418
|
"ArrowDown"
|
|
1424
|
-
].includes(e.key) &&
|
|
1425
|
-
},
|
|
1426
|
-
|
|
1419
|
+
].includes(e.key) && I && (e.preventDefault(), Ue(e.key));
|
|
1420
|
+
}, Ke = M ? H : Ee, qe = M ? "MM" : "DD", Z = M ? _e : he, Je = M ? Re : Le, Ye = M ? () => {
|
|
1421
|
+
Oe.current = "";
|
|
1427
1422
|
} : () => {
|
|
1428
|
-
|
|
1429
|
-
},
|
|
1430
|
-
|
|
1423
|
+
U.current = "";
|
|
1424
|
+
}, Xe = M ? Ee : H, Ze = M ? "DD" : "MM", Qe = M ? he : _e, $e = M ? Le : Re, et = M ? () => {
|
|
1425
|
+
U.current = "";
|
|
1431
1426
|
} : () => {
|
|
1432
|
-
|
|
1427
|
+
Oe.current = "";
|
|
1433
1428
|
};
|
|
1434
1429
|
return /* @__PURE__ */ n("div", {
|
|
1435
1430
|
className: [
|
|
1436
1431
|
R,
|
|
1437
|
-
|
|
1438
|
-
|
|
1432
|
+
O ? `${R}-paddingBottom` : "",
|
|
1433
|
+
de || ""
|
|
1439
1434
|
].join(" "),
|
|
1440
|
-
css:
|
|
1435
|
+
css: fe(k),
|
|
1441
1436
|
"data-testid": R,
|
|
1442
1437
|
children: [
|
|
1443
1438
|
/* @__PURE__ */ n("div", {
|
|
1444
|
-
ref:
|
|
1439
|
+
ref: z,
|
|
1445
1440
|
className: `${R}-container`,
|
|
1446
|
-
onBlur:
|
|
1447
|
-
onKeyDown:
|
|
1441
|
+
onBlur: Ie,
|
|
1442
|
+
onKeyDown: X,
|
|
1448
1443
|
children: [
|
|
1449
1444
|
/* @__PURE__ */ n("div", {
|
|
1450
1445
|
className: [
|
|
1451
1446
|
`${R}-fieldRow`,
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1447
|
+
Ae ? `${R}-open` : "",
|
|
1448
|
+
pe ? `${R}-error` : "",
|
|
1449
|
+
C ? `${R}-disabled` : ""
|
|
1455
1450
|
].join(" "),
|
|
1456
1451
|
onClick: (e) => {
|
|
1457
|
-
e.target === e.currentTarget &&
|
|
1452
|
+
e.target === e.currentTarget && Ke.current?.focus();
|
|
1458
1453
|
},
|
|
1459
1454
|
"data-testid": `${R}-fieldRow`,
|
|
1460
1455
|
children: [
|
|
1461
1456
|
/* @__PURE__ */ t("span", {
|
|
1462
|
-
ref:
|
|
1457
|
+
ref: Ke,
|
|
1463
1458
|
role: "spinbutton",
|
|
1464
|
-
"aria-label":
|
|
1465
|
-
"aria-valuenow": parseInt(
|
|
1459
|
+
"aria-label": M ? "Month" : "Day",
|
|
1460
|
+
"aria-valuenow": parseInt(Z) || void 0,
|
|
1466
1461
|
"aria-valuemin": 1,
|
|
1467
|
-
"aria-valuemax":
|
|
1468
|
-
"aria-valuetext":
|
|
1469
|
-
className: [`${R}-partInput`,
|
|
1470
|
-
tabIndex:
|
|
1471
|
-
onKeyDown:
|
|
1472
|
-
onFocus:
|
|
1462
|
+
"aria-valuemax": M ? 12 : 31,
|
|
1463
|
+
"aria-valuetext": Z || qe,
|
|
1464
|
+
className: [`${R}-partInput`, Z ? "" : `${R}-placeholder`].filter(Boolean).join(" "),
|
|
1465
|
+
tabIndex: C ? -1 : 0,
|
|
1466
|
+
onKeyDown: Je,
|
|
1467
|
+
onFocus: Ye,
|
|
1473
1468
|
"data-testid": `${R}-first`,
|
|
1474
|
-
children:
|
|
1469
|
+
children: Z || qe
|
|
1475
1470
|
}),
|
|
1476
1471
|
/* @__PURE__ */ t("span", {
|
|
1477
1472
|
className: `${R}-separator`,
|
|
1478
1473
|
children: "/"
|
|
1479
1474
|
}),
|
|
1480
1475
|
/* @__PURE__ */ t("span", {
|
|
1481
|
-
ref:
|
|
1476
|
+
ref: Xe,
|
|
1482
1477
|
role: "spinbutton",
|
|
1483
|
-
"aria-label":
|
|
1478
|
+
"aria-label": M ? "Day" : "Month",
|
|
1484
1479
|
"aria-valuenow": parseInt(Qe) || void 0,
|
|
1485
1480
|
"aria-valuemin": 1,
|
|
1486
|
-
"aria-valuemax":
|
|
1487
|
-
"aria-valuetext": Qe ||
|
|
1481
|
+
"aria-valuemax": M ? 31 : 12,
|
|
1482
|
+
"aria-valuetext": Qe || Ze,
|
|
1488
1483
|
className: [`${R}-partInput`, Qe ? "" : `${R}-placeholder`].filter(Boolean).join(" "),
|
|
1489
|
-
tabIndex:
|
|
1484
|
+
tabIndex: C ? -1 : 0,
|
|
1490
1485
|
onKeyDown: $e,
|
|
1491
1486
|
onFocus: et,
|
|
1492
1487
|
"data-testid": `${R}-second`,
|
|
1493
|
-
children: Qe ||
|
|
1488
|
+
children: Qe || Ze
|
|
1494
1489
|
}),
|
|
1495
1490
|
/* @__PURE__ */ t("span", {
|
|
1496
1491
|
className: `${R}-separator`,
|
|
1497
1492
|
children: "/"
|
|
1498
1493
|
}),
|
|
1499
1494
|
/* @__PURE__ */ t("span", {
|
|
1500
|
-
ref:
|
|
1495
|
+
ref: De,
|
|
1501
1496
|
role: "spinbutton",
|
|
1502
1497
|
"aria-label": "Year",
|
|
1503
|
-
"aria-valuenow": parseInt(
|
|
1498
|
+
"aria-valuenow": parseInt(F) || void 0,
|
|
1504
1499
|
"aria-valuemin": 1900,
|
|
1505
1500
|
"aria-valuemax": 2100,
|
|
1506
|
-
"aria-valuetext":
|
|
1507
|
-
className: [`${R}-partInput`,
|
|
1508
|
-
tabIndex:
|
|
1509
|
-
onKeyDown:
|
|
1501
|
+
"aria-valuetext": F || "YYYY",
|
|
1502
|
+
className: [`${R}-partInput`, F ? "" : `${R}-placeholder`].filter(Boolean).join(" "),
|
|
1503
|
+
tabIndex: C ? -1 : 0,
|
|
1504
|
+
onKeyDown: ze,
|
|
1510
1505
|
onFocus: () => {
|
|
1511
|
-
|
|
1506
|
+
ke.current = "";
|
|
1512
1507
|
},
|
|
1513
1508
|
"data-testid": `${R}-year`,
|
|
1514
|
-
children:
|
|
1509
|
+
children: F || "YYYY"
|
|
1515
1510
|
})
|
|
1516
1511
|
]
|
|
1517
1512
|
}),
|
|
1518
1513
|
/* @__PURE__ */ t("div", {
|
|
1519
|
-
ref:
|
|
1514
|
+
ref: V,
|
|
1520
1515
|
className: `${R}-adornment`,
|
|
1521
|
-
children: /* @__PURE__ */ t(
|
|
1516
|
+
children: /* @__PURE__ */ t(be, {
|
|
1522
1517
|
className: `${R}-calendarIcon`,
|
|
1523
|
-
onClick:
|
|
1524
|
-
icon: /* @__PURE__ */ t(
|
|
1525
|
-
disabled:
|
|
1518
|
+
onClick: J,
|
|
1519
|
+
icon: /* @__PURE__ */ t(a, { name: "event" }),
|
|
1520
|
+
disabled: C,
|
|
1526
1521
|
tabIndex: 0,
|
|
1527
1522
|
"data-testid": `${R}-calendarIcon`
|
|
1528
1523
|
})
|
|
@@ -1547,36 +1542,36 @@ var R = "--DATEPICKER", Oe = ({ name: e, label: r, control: i, language: a = f()
|
|
|
1547
1542
|
/* @__PURE__ */ n("span", {
|
|
1548
1543
|
className: `${R}-helperText`,
|
|
1549
1544
|
"data-testid": `${R}-helperText`,
|
|
1550
|
-
children: [
|
|
1545
|
+
children: [ue && !pe && ue, D && pe && pe.message]
|
|
1551
1546
|
}),
|
|
1552
|
-
/* @__PURE__ */ t(
|
|
1553
|
-
ref:
|
|
1554
|
-
isOpen:
|
|
1555
|
-
hasStaticOptions:
|
|
1556
|
-
language:
|
|
1547
|
+
/* @__PURE__ */ t(Ce, {
|
|
1548
|
+
ref: B,
|
|
1549
|
+
isOpen: I,
|
|
1550
|
+
hasStaticOptions: ce,
|
|
1551
|
+
language: o,
|
|
1557
1552
|
monthLabel: Fe,
|
|
1558
|
-
yearLabel:
|
|
1559
|
-
onPrevMonth:
|
|
1560
|
-
onNextMonth:
|
|
1561
|
-
disablePrev:
|
|
1562
|
-
disableNext:
|
|
1563
|
-
weeks:
|
|
1553
|
+
yearLabel: W,
|
|
1554
|
+
onPrevMonth: Be,
|
|
1555
|
+
onNextMonth: Y,
|
|
1556
|
+
disablePrev: Ve,
|
|
1557
|
+
disableNext: He,
|
|
1558
|
+
weeks: je,
|
|
1564
1559
|
years: Ne,
|
|
1565
1560
|
daysOfWeek: Pe,
|
|
1566
|
-
selectedValue:
|
|
1567
|
-
format:
|
|
1568
|
-
today:
|
|
1569
|
-
focusedElement:
|
|
1570
|
-
onSelectDay:
|
|
1561
|
+
selectedValue: u(N.value) ? N.value : void 0,
|
|
1562
|
+
format: A,
|
|
1563
|
+
today: j,
|
|
1564
|
+
focusedElement: L,
|
|
1565
|
+
onSelectDay: We,
|
|
1571
1566
|
onSelectYear: Ge,
|
|
1572
|
-
onMoveFocus:
|
|
1573
|
-
onClose:
|
|
1567
|
+
onMoveFocus: Ue,
|
|
1568
|
+
onClose: q
|
|
1574
1569
|
})
|
|
1575
1570
|
]
|
|
1576
1571
|
});
|
|
1577
|
-
},
|
|
1578
|
-
let { componentStyles: i } = e([
|
|
1579
|
-
return /* @__PURE__ */ t(
|
|
1572
|
+
}, Te = ({ theme: n, ...r }) => {
|
|
1573
|
+
let { componentStyles: i } = e([o.DATEPICKER], n);
|
|
1574
|
+
return /* @__PURE__ */ t(we, {
|
|
1580
1575
|
...r,
|
|
1581
1576
|
style: i
|
|
1582
1577
|
});
|
|
@@ -1592,7 +1587,7 @@ var R = "--DATEPICKER", Oe = ({ name: e, label: r, control: i, language: a = f()
|
|
|
1592
1587
|
`, V = (e, t, n = !1) => `
|
|
1593
1588
|
${i(e, "color", `--INPUT-EVENTS-${t}-COLOR-SECONDARY`)};
|
|
1594
1589
|
${n ? "transform: translate(14px, -24px); font-size: 0.75rem;" : ""};
|
|
1595
|
-
`,
|
|
1590
|
+
`, Ee = (e) => `
|
|
1596
1591
|
.--INPUT-legend {
|
|
1597
1592
|
max-width: ${e ? "100%" : "0px"};
|
|
1598
1593
|
}
|
|
@@ -1601,7 +1596,7 @@ var R = "--DATEPICKER", Oe = ({ name: e, label: r, control: i, language: a = f()
|
|
|
1601
1596
|
~ .--INPUT-helperText {
|
|
1602
1597
|
${i(e, "color", `--INPUT-EVENTS-${t}-COLOR-TERTIARY`)};
|
|
1603
1598
|
}
|
|
1604
|
-
`,
|
|
1599
|
+
`, De = (e) => D`
|
|
1605
1600
|
&.--INPUT {
|
|
1606
1601
|
position: relative;
|
|
1607
1602
|
padding: 0;
|
|
@@ -1744,7 +1739,7 @@ var R = "--DATEPICKER", Oe = ({ name: e, label: r, control: i, language: a = f()
|
|
|
1744
1739
|
}
|
|
1745
1740
|
~ .--INPUT-fieldset {
|
|
1746
1741
|
${z(e, "VALUE")};
|
|
1747
|
-
${
|
|
1742
|
+
${Ee(!0)};
|
|
1748
1743
|
}
|
|
1749
1744
|
}
|
|
1750
1745
|
|
|
@@ -1786,7 +1781,7 @@ var R = "--DATEPICKER", Oe = ({ name: e, label: r, control: i, language: a = f()
|
|
|
1786
1781
|
}
|
|
1787
1782
|
~ .--INPUT-fieldset {
|
|
1788
1783
|
${z(e, "FOCUS")};
|
|
1789
|
-
${
|
|
1784
|
+
${Ee(!0)};
|
|
1790
1785
|
}
|
|
1791
1786
|
}
|
|
1792
1787
|
|
|
@@ -1960,52 +1955,52 @@ var R = "--DATEPICKER", Oe = ({ name: e, label: r, control: i, language: a = f()
|
|
|
1960
1955
|
height: 16px;
|
|
1961
1956
|
}
|
|
1962
1957
|
}
|
|
1963
|
-
`, U = "--INPUT",
|
|
1958
|
+
`, U = "--INPUT", Oe = ({ children: e }) => /* @__PURE__ */ t("div", {
|
|
1964
1959
|
className: `${U}-adornment`,
|
|
1965
1960
|
children: e
|
|
1966
|
-
}),
|
|
1967
|
-
let { field: h, fieldState: g } =
|
|
1961
|
+
}), ke = ({ name: e, label: r, control: i, width: a, disabled: o, type: s = "text", regex: c, hasPadding: l = !1, format: u, startAdornment: d, endAdornment: f, helperText: p, showErrorText: ee = !0, style: te, className: m, ...ne }) => {
|
|
1962
|
+
let { field: h, fieldState: g } = le({
|
|
1968
1963
|
control: i,
|
|
1969
1964
|
name: e
|
|
1970
|
-
}), [
|
|
1965
|
+
}), [_, v] = E(h.value || ""), y = g.error, b = (e) => {
|
|
1971
1966
|
e.preventDefault();
|
|
1972
1967
|
let { value: t } = e.target;
|
|
1973
1968
|
if (c && c.test(t) || !c) {
|
|
1974
1969
|
let e = u && t ? u(t) : t;
|
|
1975
|
-
h.onChange(e),
|
|
1970
|
+
h.onChange(e), v(e), y && re();
|
|
1976
1971
|
}
|
|
1977
|
-
},
|
|
1972
|
+
}, re = () => h.onBlur();
|
|
1978
1973
|
return /* @__PURE__ */ n("div", {
|
|
1979
1974
|
className: [
|
|
1980
1975
|
U,
|
|
1981
1976
|
l ? `${U}-paddingBottom` : "",
|
|
1982
|
-
|
|
1977
|
+
m || ""
|
|
1983
1978
|
].join(" "),
|
|
1984
|
-
css:
|
|
1979
|
+
css: De(te),
|
|
1985
1980
|
"data-testid": U,
|
|
1986
1981
|
children: [/* @__PURE__ */ n("div", {
|
|
1987
1982
|
className: `${U}-container`,
|
|
1988
1983
|
children: [
|
|
1989
|
-
d && /* @__PURE__ */ t(
|
|
1984
|
+
d && /* @__PURE__ */ t(Oe, { children: d }),
|
|
1990
1985
|
/* @__PURE__ */ t("input", {
|
|
1991
1986
|
className: [
|
|
1992
1987
|
`${U}-inputField`,
|
|
1993
|
-
|
|
1988
|
+
y && `${U}-error`,
|
|
1994
1989
|
d && `${U}-open`,
|
|
1995
1990
|
d && `${U}-left`,
|
|
1996
|
-
|
|
1991
|
+
f && `${U}-right`
|
|
1997
1992
|
].join(" "),
|
|
1998
1993
|
placeholder: " ",
|
|
1999
|
-
value:
|
|
1994
|
+
value: _,
|
|
2000
1995
|
disabled: o,
|
|
2001
1996
|
"data-testid": `${U}-inputField`,
|
|
2002
|
-
onChange: (e) =>
|
|
1997
|
+
onChange: (e) => b(e),
|
|
2003
1998
|
onBlur: h.onBlur,
|
|
2004
1999
|
name: e,
|
|
2005
2000
|
type: s,
|
|
2006
|
-
...
|
|
2001
|
+
...ne
|
|
2007
2002
|
}),
|
|
2008
|
-
|
|
2003
|
+
f && /* @__PURE__ */ t(Oe, { children: f }),
|
|
2009
2004
|
/* @__PURE__ */ t("fieldset", {
|
|
2010
2005
|
"aria-hidden": "true",
|
|
2011
2006
|
className: `${U}-fieldset`,
|
|
@@ -2025,43 +2020,43 @@ var R = "--DATEPICKER", Oe = ({ name: e, label: r, control: i, language: a = f()
|
|
|
2025
2020
|
}), /* @__PURE__ */ n("span", {
|
|
2026
2021
|
className: `${U}-helperText`,
|
|
2027
2022
|
"data-testid": `${U}-helperText`,
|
|
2028
|
-
children: [
|
|
2023
|
+
children: [p && (!y || !ee) && p, ee && y && y.message]
|
|
2029
2024
|
})]
|
|
2030
2025
|
});
|
|
2031
|
-
},
|
|
2032
|
-
let { componentStyles: i } = e([
|
|
2033
|
-
return /* @__PURE__ */ t(
|
|
2026
|
+
}, Ae = ({ theme: n, ...r }) => {
|
|
2027
|
+
let { componentStyles: i } = e([o.INPUT], n);
|
|
2028
|
+
return /* @__PURE__ */ t(ke, {
|
|
2034
2029
|
...r,
|
|
2035
2030
|
style: i
|
|
2036
2031
|
});
|
|
2037
|
-
},
|
|
2032
|
+
}, je = (e, t) => `
|
|
2038
2033
|
// BACKGROUNDS
|
|
2039
2034
|
${i(e, "background-color", `--RADIO-EVENTS-${t}-BACKGROUND-COLOR`)}
|
|
2040
|
-
`,
|
|
2035
|
+
`, Me = (e, t) => `
|
|
2041
2036
|
// BORDERS
|
|
2042
2037
|
${i(e, "border-color", `--RADIO-EVENTS-${t}-BORDER-COLOR`)}
|
|
2043
2038
|
${i(e, "border-width", `--RADIO-EVENTS-${t}-BORDER-WIDTH`)}
|
|
2044
2039
|
${i(e, "border-style", `--RADIO-EVENTS-${t}-BORDER-STYLE`)}
|
|
2045
|
-
`,
|
|
2040
|
+
`, Ne = (e, t) => `
|
|
2046
2041
|
// OUTLINE
|
|
2047
2042
|
${i(e, "outline-color", `--RADIO-EVENTS-${t}-OUTLINE-COLOR`)}
|
|
2048
2043
|
${i(e, "outline-width", `--RADIO-EVENTS-${t}-OUTLINE-WIDTH`)}
|
|
2049
2044
|
${i(e, "outline-style", `--RADIO-EVENTS-${t}-OUTLINE-STYLE`)}
|
|
2050
2045
|
${i(e, "outline-offset", `--RADIO-EVENTS-${t}-OUTLINE-OFFSET`)}
|
|
2051
|
-
`,
|
|
2046
|
+
`, Pe = (e, t) => `
|
|
2052
2047
|
// SHADOW
|
|
2053
2048
|
${i(e, "background-color", `--RADIO-EVENTS-${t}-SHADOW-COLOR`)}
|
|
2054
|
-
`,
|
|
2049
|
+
`, Fe = (e, t) => `
|
|
2055
2050
|
// UTILS
|
|
2056
|
-
>
|
|
2057
|
-
${i(e, "
|
|
2051
|
+
> span {
|
|
2052
|
+
${i(e, "color", `--RADIO-EVENTS-${t}-ICON-COLOR`)};
|
|
2058
2053
|
}
|
|
2059
2054
|
`, W = (e, t) => `
|
|
2060
2055
|
// TYPOGRAPHY
|
|
2061
2056
|
.--RADIO-label {
|
|
2062
2057
|
${i(e, "color", `--RADIO-EVENTS-${t}-COLOR-PRIMARY`)}
|
|
2063
2058
|
}
|
|
2064
|
-
`,
|
|
2059
|
+
`, Ie = (e) => D`
|
|
2065
2060
|
&.--RADIO {
|
|
2066
2061
|
display: flex;
|
|
2067
2062
|
flex-direction: column;
|
|
@@ -2089,7 +2084,7 @@ var R = "--DATEPICKER", Oe = ({ name: e, label: r, control: i, language: a = f()
|
|
|
2089
2084
|
.--RADIO-radio .--RADIO-span {
|
|
2090
2085
|
&:before {
|
|
2091
2086
|
opacity: 1;
|
|
2092
|
-
${
|
|
2087
|
+
${Pe(e, "HOVER")};
|
|
2093
2088
|
}
|
|
2094
2089
|
}
|
|
2095
2090
|
}
|
|
@@ -2121,7 +2116,7 @@ var R = "--DATEPICKER", Oe = ({ name: e, label: r, control: i, language: a = f()
|
|
|
2121
2116
|
.--RADIO-radio .--RADIO-span {
|
|
2122
2117
|
&:before {
|
|
2123
2118
|
opacity: 1;
|
|
2124
|
-
${
|
|
2119
|
+
${Pe(e, "ERROR_HOVER")};
|
|
2125
2120
|
}
|
|
2126
2121
|
}
|
|
2127
2122
|
}
|
|
@@ -2165,25 +2160,25 @@ var R = "--DATEPICKER", Oe = ({ name: e, label: r, control: i, language: a = f()
|
|
|
2165
2160
|
margin: 0;
|
|
2166
2161
|
-webkit-tap-highlight-color: transparent;
|
|
2167
2162
|
|
|
2168
|
-
~ .--RADIO-span >
|
|
2163
|
+
~ .--RADIO-span > span {
|
|
2169
2164
|
visibility: hidden;
|
|
2170
2165
|
}
|
|
2171
|
-
&:checked ~ .--RADIO-span >
|
|
2166
|
+
&:checked ~ .--RADIO-span > span {
|
|
2172
2167
|
visibility: visible;
|
|
2173
2168
|
}
|
|
2174
2169
|
|
|
2175
2170
|
// ENABLED
|
|
2176
2171
|
~ .--RADIO-span {
|
|
2172
|
+
${je(e, "ENABLED")};
|
|
2173
|
+
${Me(e, "ENABLED")};
|
|
2177
2174
|
${Fe(e, "ENABLED")};
|
|
2178
|
-
${Ie(e, "ENABLED")};
|
|
2179
|
-
${ze(e, "ENABLED")};
|
|
2180
2175
|
}
|
|
2181
2176
|
|
|
2182
2177
|
// VALUE
|
|
2183
2178
|
&:checked ~ .--RADIO-span {
|
|
2179
|
+
${je(e, "VALUE")};
|
|
2180
|
+
${Me(e, "VALUE")};
|
|
2184
2181
|
${Fe(e, "VALUE")};
|
|
2185
|
-
${Ie(e, "VALUE")};
|
|
2186
|
-
${ze(e, "VALUE")};
|
|
2187
2182
|
}
|
|
2188
2183
|
|
|
2189
2184
|
// HOVER
|
|
@@ -2194,29 +2189,29 @@ var R = "--DATEPICKER", Oe = ({ name: e, label: r, control: i, language: a = f()
|
|
|
2194
2189
|
&:active ~ .--RADIO-span {
|
|
2195
2190
|
&:before {
|
|
2196
2191
|
opacity: 1;
|
|
2197
|
-
${
|
|
2192
|
+
${Pe(e, "ACTIVE")};
|
|
2198
2193
|
}
|
|
2199
2194
|
}
|
|
2200
2195
|
|
|
2201
2196
|
// FOCUS
|
|
2202
2197
|
&:focus-visible ~ .--RADIO-span {
|
|
2203
2198
|
outline: none;
|
|
2204
|
-
${
|
|
2205
|
-
${
|
|
2199
|
+
${Ne(e, "FOCUS")};
|
|
2200
|
+
${Fe(e, "FOCUS")};
|
|
2206
2201
|
}
|
|
2207
2202
|
|
|
2208
2203
|
// ERROR
|
|
2209
2204
|
&.--RADIO-error ~ .--RADIO-span {
|
|
2205
|
+
${je(e, "ERROR")};
|
|
2206
|
+
${Me(e, "ERROR")};
|
|
2210
2207
|
${Fe(e, "ERROR")};
|
|
2211
|
-
${Ie(e, "ERROR")};
|
|
2212
|
-
${ze(e, "ERROR")};
|
|
2213
2208
|
}
|
|
2214
2209
|
|
|
2215
2210
|
// ERROR + VALUE
|
|
2216
2211
|
&.--RADIO-error:checked ~ .--RADIO-span {
|
|
2212
|
+
${je(e, "ERROR_VALUE")};
|
|
2213
|
+
${Me(e, "ERROR_VALUE")};
|
|
2217
2214
|
${Fe(e, "ERROR_VALUE")};
|
|
2218
|
-
${Ie(e, "ERROR_VALUE")};
|
|
2219
|
-
${ze(e, "ERROR_VALUE")};
|
|
2220
2215
|
}
|
|
2221
2216
|
|
|
2222
2217
|
// ERROR + VALUE
|
|
@@ -2227,28 +2222,28 @@ var R = "--DATEPICKER", Oe = ({ name: e, label: r, control: i, language: a = f()
|
|
|
2227
2222
|
&.--RADIO-error.--RADIO-active ~ .--RADIO-span {
|
|
2228
2223
|
&:before {
|
|
2229
2224
|
opacity: 1;
|
|
2230
|
-
${
|
|
2225
|
+
${Pe(e, "ERROR_ACTIVE")};
|
|
2231
2226
|
}
|
|
2232
2227
|
}
|
|
2233
2228
|
|
|
2234
2229
|
// ERROR + FOCUS
|
|
2235
2230
|
&.--RADIO-error:focus-visible ~ .--RADIO-span {
|
|
2236
|
-
${
|
|
2237
|
-
${
|
|
2231
|
+
${Ne(e, "ERROR_FOCUS")};
|
|
2232
|
+
${Fe(e, "ERROR_FOCUS")};
|
|
2238
2233
|
}
|
|
2239
2234
|
|
|
2240
2235
|
// DISABLED
|
|
2241
2236
|
&:disabled ~ .--RADIO-span {
|
|
2237
|
+
${je(e, "DISABLED")};
|
|
2238
|
+
${Me(e, "DISABLED")};
|
|
2242
2239
|
${Fe(e, "DISABLED")};
|
|
2243
|
-
${Ie(e, "DISABLED")};
|
|
2244
|
-
${ze(e, "DISABLED")};
|
|
2245
2240
|
}
|
|
2246
2241
|
|
|
2247
2242
|
// DISABLED + VALUE
|
|
2248
2243
|
&:disabled:checked ~ .--RADIO-span {
|
|
2244
|
+
${je(e, "DISABLED_VALUE")};
|
|
2245
|
+
${Me(e, "DISABLED_VALUE")};
|
|
2249
2246
|
${Fe(e, "DISABLED_VALUE")};
|
|
2250
|
-
${Ie(e, "DISABLED_VALUE")};
|
|
2251
|
-
${ze(e, "DISABLED_VALUE")};
|
|
2252
2247
|
}
|
|
2253
2248
|
}
|
|
2254
2249
|
|
|
@@ -2263,17 +2258,17 @@ var R = "--DATEPICKER", Oe = ({ name: e, label: r, control: i, language: a = f()
|
|
|
2263
2258
|
justify-content: center;
|
|
2264
2259
|
transition: background-color 150ms ease-in-out;
|
|
2265
2260
|
|
|
2266
|
-
>
|
|
2267
|
-
width:
|
|
2268
|
-
height:
|
|
2261
|
+
> span {
|
|
2262
|
+
width: 16px;
|
|
2263
|
+
height: 16px;
|
|
2269
2264
|
z-index: 1;
|
|
2270
2265
|
}
|
|
2271
2266
|
|
|
2272
2267
|
&:before {
|
|
2273
2268
|
content: '';
|
|
2274
2269
|
position: absolute;
|
|
2275
|
-
width:
|
|
2276
|
-
height:
|
|
2270
|
+
width: 32px;
|
|
2271
|
+
height: 32px;
|
|
2277
2272
|
border-radius: 50%;
|
|
2278
2273
|
opacity: 0;
|
|
2279
2274
|
transition: opacity 150ms ease-in-out;
|
|
@@ -2291,15 +2286,19 @@ var R = "--DATEPICKER", Oe = ({ name: e, label: r, control: i, language: a = f()
|
|
|
2291
2286
|
}
|
|
2292
2287
|
}
|
|
2293
2288
|
}
|
|
2294
|
-
`, G = "--RADIO",
|
|
2295
|
-
|
|
2289
|
+
`, G = "--RADIO", Le = C.forwardRef(({ label: e, icon: r = /* @__PURE__ */ t(a, {
|
|
2290
|
+
name: "circle",
|
|
2291
|
+
fill: !0,
|
|
2292
|
+
style: { fontSize: "16px" }
|
|
2293
|
+
}), className: i, style: o = {}, disabled: s, checked: c, onSelect: l, error: u, onKeyDown: d, onKeyUp: f, onBlur: p, value: ee, name: te, ...m }, ne) => {
|
|
2294
|
+
let [h, g] = E(!1);
|
|
2296
2295
|
return /* @__PURE__ */ t("div", {
|
|
2297
2296
|
className: [
|
|
2298
2297
|
G,
|
|
2299
|
-
|
|
2298
|
+
h ? `${G}-active` : "",
|
|
2300
2299
|
i || ""
|
|
2301
2300
|
].join(" "),
|
|
2302
|
-
css:
|
|
2301
|
+
css: Ie(o),
|
|
2303
2302
|
"data-testid": G,
|
|
2304
2303
|
children: /* @__PURE__ */ n("label", {
|
|
2305
2304
|
className: `${G}-container`,
|
|
@@ -2308,27 +2307,27 @@ var R = "--DATEPICKER", Oe = ({ name: e, label: r, control: i, language: a = f()
|
|
|
2308
2307
|
children: [/* @__PURE__ */ t("input", {
|
|
2309
2308
|
className: [
|
|
2310
2309
|
`${G}-inputField`,
|
|
2311
|
-
|
|
2312
|
-
|
|
2310
|
+
h ? `${G}-active` : "",
|
|
2311
|
+
u ? `${G}-error` : ""
|
|
2313
2312
|
].join(" "),
|
|
2314
2313
|
type: "radio",
|
|
2315
|
-
value:
|
|
2316
|
-
name:
|
|
2317
|
-
checked:
|
|
2318
|
-
disabled:
|
|
2319
|
-
onChange: () =>
|
|
2314
|
+
value: ee,
|
|
2315
|
+
name: te,
|
|
2316
|
+
checked: c,
|
|
2317
|
+
disabled: s,
|
|
2318
|
+
onChange: () => l(),
|
|
2320
2319
|
onKeyDown: (e) => {
|
|
2321
|
-
(e.key === "Enter" || e.key === "Space") &&
|
|
2320
|
+
(e.key === "Enter" || e.key === "Space") && g(!0), d?.(e);
|
|
2322
2321
|
},
|
|
2323
2322
|
onKeyUp: (e) => {
|
|
2324
|
-
(e.key === "Enter" || e.key === "Space") && (
|
|
2323
|
+
(e.key === "Enter" || e.key === "Space") && (g(!1), l()), f?.(e);
|
|
2325
2324
|
},
|
|
2326
2325
|
onBlur: () => {
|
|
2327
|
-
|
|
2326
|
+
g(!1), p?.({});
|
|
2328
2327
|
},
|
|
2329
2328
|
ref: ne,
|
|
2330
2329
|
"data-testid": `${G}-inputField`,
|
|
2331
|
-
...
|
|
2330
|
+
...m
|
|
2332
2331
|
}), /* @__PURE__ */ t("span", {
|
|
2333
2332
|
className: `${G}-span`,
|
|
2334
2333
|
"data-testid": `${G}-icon`,
|
|
@@ -2342,12 +2341,12 @@ var R = "--DATEPICKER", Oe = ({ name: e, label: r, control: i, language: a = f()
|
|
|
2342
2341
|
})
|
|
2343
2342
|
});
|
|
2344
2343
|
});
|
|
2345
|
-
|
|
2346
|
-
var
|
|
2347
|
-
let n =
|
|
2344
|
+
Le.displayName = "RadioBase";
|
|
2345
|
+
var Re = (e) => {
|
|
2346
|
+
let n = oe(s);
|
|
2348
2347
|
if (!n) throw Error("Radio must be used inside a RadioGroup.");
|
|
2349
2348
|
let { value: r, ...i } = e, a = n.selectedValue === r;
|
|
2350
|
-
return /* @__PURE__ */ t(
|
|
2349
|
+
return /* @__PURE__ */ t(Le, {
|
|
2351
2350
|
...i,
|
|
2352
2351
|
name: n.name,
|
|
2353
2352
|
value: r,
|
|
@@ -2355,9 +2354,9 @@ var He = (e) => {
|
|
|
2355
2354
|
onSelect: () => n.onChange(r),
|
|
2356
2355
|
disabled: i.disabled ?? n.disabled
|
|
2357
2356
|
});
|
|
2358
|
-
},
|
|
2359
|
-
let { componentStyles: i } = e([
|
|
2360
|
-
return /* @__PURE__ */ t(
|
|
2357
|
+
}, ze = ({ theme: n, ...r }) => {
|
|
2358
|
+
let { componentStyles: i } = e([o.RADIO], n);
|
|
2359
|
+
return /* @__PURE__ */ t(Re, {
|
|
2361
2360
|
...r,
|
|
2362
2361
|
style: i
|
|
2363
2362
|
});
|
|
@@ -2373,7 +2372,7 @@ var He = (e) => {
|
|
|
2373
2372
|
`, J = (e, t, n = !1) => `
|
|
2374
2373
|
${i(e, "color", `--SELECT-EVENTS-${t}-COLOR-SECONDARY`)}
|
|
2375
2374
|
${n ? "transform: translate(14px, -24px); font-size: 0.75rem;" : ""}
|
|
2376
|
-
`,
|
|
2375
|
+
`, Be = (e) => `
|
|
2377
2376
|
.--SELECT-legend {
|
|
2378
2377
|
max-width: ${e ? "100%" : "0px"};
|
|
2379
2378
|
}
|
|
@@ -2382,7 +2381,7 @@ var He = (e) => {
|
|
|
2382
2381
|
~ .--SELECT-helperText {
|
|
2383
2382
|
${i(e, "color", `--SELECT-EVENTS-${t}-COLOR-TERTIARY`)}
|
|
2384
2383
|
}
|
|
2385
|
-
`,
|
|
2384
|
+
`, Ve = (e) => D`
|
|
2386
2385
|
&.--SELECT {
|
|
2387
2386
|
position: relative;
|
|
2388
2387
|
padding: 0;
|
|
@@ -2515,7 +2514,7 @@ var He = (e) => {
|
|
|
2515
2514
|
}
|
|
2516
2515
|
~ .--SELECT-fieldset {
|
|
2517
2516
|
${K(e, "VALUE")};
|
|
2518
|
-
${
|
|
2517
|
+
${Be(!0)};
|
|
2519
2518
|
}
|
|
2520
2519
|
}
|
|
2521
2520
|
|
|
@@ -2551,7 +2550,7 @@ var He = (e) => {
|
|
|
2551
2550
|
}
|
|
2552
2551
|
~ .--SELECT-fieldset {
|
|
2553
2552
|
${K(e, "FOCUS")};
|
|
2554
|
-
${
|
|
2553
|
+
${Be(!0)};
|
|
2555
2554
|
}
|
|
2556
2555
|
}
|
|
2557
2556
|
|
|
@@ -2725,7 +2724,7 @@ var He = (e) => {
|
|
|
2725
2724
|
height: 16px;
|
|
2726
2725
|
}
|
|
2727
2726
|
}
|
|
2728
|
-
`,
|
|
2727
|
+
`, He = (e, t) => `
|
|
2729
2728
|
// BACKGROUNDS
|
|
2730
2729
|
${i(e, "background-color", `--SELECTMENU-EVENTS-${t}-BACKGROUND-COLOR`)}
|
|
2731
2730
|
|
|
@@ -2734,11 +2733,11 @@ var He = (e) => {
|
|
|
2734
2733
|
${i(e, "border-width", `--SELECTMENU-EVENTS-${t}-BORDER-WIDTH`)}
|
|
2735
2734
|
${i(e, "border-style", `--SELECTMENU-EVENTS-${t}-BORDER-STYLE`)}
|
|
2736
2735
|
${i(e, "border-radius", `--SELECTMENU-EVENTS-${t}-BORDER-RADIUS`)}
|
|
2737
|
-
`,
|
|
2736
|
+
`, Ue = (e, t) => `
|
|
2738
2737
|
// TYPOGRAPHY
|
|
2739
2738
|
${i(e, "color", `--SELECTMENU-EVENTS-${t}-COLOR-PRIMARY`)};
|
|
2740
2739
|
${i(e, "caret-color", `--SELECTMENU-EVENTS-${t}-COLOR-PRIMARY`)};
|
|
2741
|
-
`,
|
|
2740
|
+
`, We = (e, t) => `
|
|
2742
2741
|
// BACKGROUNDS
|
|
2743
2742
|
${i(e, "background-color", `--SELECTMENU-${t}-BACKGROUND-COLOR`)}
|
|
2744
2743
|
|
|
@@ -2747,7 +2746,7 @@ var He = (e) => {
|
|
|
2747
2746
|
${i(e, "border-width", `--SELECTMENU-${t}-BORDER-WIDTH`)}
|
|
2748
2747
|
${i(e, "border-style", `--SELECTMENU-${t}-BORDER-STYLE`)}
|
|
2749
2748
|
${i(e, "border-radius", `--SELECTMENU-${t}-BORDER-RADIUS`)}
|
|
2750
|
-
`,
|
|
2749
|
+
`, Ge = (e) => D`
|
|
2751
2750
|
&.--SELECTMENU {
|
|
2752
2751
|
z-index: 100;
|
|
2753
2752
|
position: absolute;
|
|
@@ -2762,7 +2761,7 @@ var He = (e) => {
|
|
|
2762
2761
|
max-height: 126px; // 3 rows * 42px
|
|
2763
2762
|
overflow-y: auto;
|
|
2764
2763
|
cursor: pointer;
|
|
2765
|
-
${
|
|
2764
|
+
${We(e, "ROOT")}
|
|
2766
2765
|
|
|
2767
2766
|
// Animation
|
|
2768
2767
|
display: none;
|
|
@@ -2823,34 +2822,34 @@ var He = (e) => {
|
|
|
2823
2822
|
}
|
|
2824
2823
|
|
|
2825
2824
|
// ENABLED
|
|
2826
|
-
${
|
|
2827
|
-
${
|
|
2825
|
+
${He(e, "ENABLED")}
|
|
2826
|
+
${Ue(e, "ENABLED")}
|
|
2828
2827
|
|
|
2829
2828
|
// VALUE
|
|
2830
2829
|
&.--SELECTMENU-selected {
|
|
2831
|
-
${
|
|
2832
|
-
${
|
|
2830
|
+
${He(e, "VALUE")}
|
|
2831
|
+
${Ue(e, "VALUE")}
|
|
2833
2832
|
}
|
|
2834
2833
|
|
|
2835
2834
|
// HOVER
|
|
2836
2835
|
&:hover {
|
|
2837
|
-
${
|
|
2838
|
-
${
|
|
2836
|
+
${He(e, "HOVER")}
|
|
2837
|
+
${Ue(e, "HOVER")}
|
|
2839
2838
|
}
|
|
2840
2839
|
|
|
2841
2840
|
// - ACTIVE
|
|
2842
2841
|
&:active,
|
|
2843
2842
|
&.--SELECTMENU-active {
|
|
2844
|
-
${
|
|
2845
|
-
${
|
|
2843
|
+
${He(e, "ACTIVE")}
|
|
2844
|
+
${Ue(e, "ACTIVE")}
|
|
2846
2845
|
}
|
|
2847
2846
|
|
|
2848
2847
|
// FOCUS
|
|
2849
2848
|
&:focus-visible {
|
|
2850
2849
|
outline-offset: 0px;
|
|
2851
2850
|
outline: 0;
|
|
2852
|
-
${
|
|
2853
|
-
${
|
|
2851
|
+
${He(e, "FOCUS")}
|
|
2852
|
+
${Ue(e, "FOCUS")}
|
|
2854
2853
|
}
|
|
2855
2854
|
|
|
2856
2855
|
&.--SELECTMENU-descriptionMenu {
|
|
@@ -2879,7 +2878,7 @@ var He = (e) => {
|
|
|
2879
2878
|
max-height: 156px; // 3 rows * 52px
|
|
2880
2879
|
}
|
|
2881
2880
|
}
|
|
2882
|
-
`, X = "--SELECTMENU",
|
|
2881
|
+
`, X = "--SELECTMENU", Ke = C.forwardRef(({ displayOptions: e, value: r, isOpen: i, hasStaticOptions: a, hasDescription: o, onChange: s, focusedElement: c, onScroll: l, style: u, className: d }, f) => (se(() => {
|
|
2883
2882
|
document.getElementById(`${X}-option-${c}`)?.scrollIntoView({ block: "nearest" });
|
|
2884
2883
|
}, [c]), /* @__PURE__ */ t("div", {
|
|
2885
2884
|
id: `${X}-root`,
|
|
@@ -2890,10 +2889,10 @@ var He = (e) => {
|
|
|
2890
2889
|
i && `${X}-open`,
|
|
2891
2890
|
d || ""
|
|
2892
2891
|
].join(" "),
|
|
2893
|
-
css:
|
|
2892
|
+
css: Ge(u),
|
|
2894
2893
|
onScroll: l,
|
|
2895
2894
|
role: "listbox",
|
|
2896
|
-
ref:
|
|
2895
|
+
ref: f,
|
|
2897
2896
|
"data-testid": X,
|
|
2898
2897
|
children: e.map((e, a) => {
|
|
2899
2898
|
let l = e.value === r && i ? `${X}-selected` : "", u = c === a;
|
|
@@ -2919,116 +2918,114 @@ var He = (e) => {
|
|
|
2919
2918
|
})]
|
|
2920
2919
|
}, e.value);
|
|
2921
2920
|
})
|
|
2922
|
-
}))),
|
|
2923
|
-
let { componentStyles:
|
|
2924
|
-
return /* @__PURE__ */ t(
|
|
2921
|
+
}))), qe = C.forwardRef(({ theme: n, ...r }, i) => {
|
|
2922
|
+
let { componentStyles: a } = e([o.SELECTMENU, o.SELECT], n);
|
|
2923
|
+
return /* @__PURE__ */ t(Ke, {
|
|
2925
2924
|
...r,
|
|
2926
|
-
style:
|
|
2925
|
+
style: a,
|
|
2927
2926
|
ref: i
|
|
2928
2927
|
});
|
|
2929
2928
|
});
|
|
2930
|
-
|
|
2929
|
+
qe.displayName = "SelectMenu";
|
|
2931
2930
|
//#endregion
|
|
2932
2931
|
//#region src/components/atoms/Select/Select.tsx
|
|
2933
|
-
var Z = "--SELECT",
|
|
2934
|
-
let { field:
|
|
2932
|
+
var Z = "--SELECT", Je = [], Ye = ({ name: e, label: r, control: i, options: o, disabled: s, range: c = 100, hasStaticOptions: l = !1, hasSearch: u = !1, hasDescription: d = !1, hasPadding: f = !1, showErrorText: p = !0, helperText: ee, style: te, className: m, ...ne }) => {
|
|
2933
|
+
let { field: h, fieldState: g } = le({
|
|
2935
2934
|
control: i,
|
|
2936
2935
|
name: e
|
|
2937
|
-
}), [
|
|
2938
|
-
|
|
2936
|
+
}), [_, v] = S(h.value || ""), [y, b] = S(!1), re = T(!1), x = T(null), C = T(null), ae = T(null), oe = o.find((e) => e.value === _), se = g.error, ce = d ? 156 : 126, [w, D] = S(oe?.label || ""), [O, ue] = E(1), [k, de] = E(!1), [A, j] = E(-1), M = y || !!(u && w && !_), N = (e) => {
|
|
2937
|
+
b(!1), D(e ?? oe?.label ?? ""), de(!1), j(-1), re.current && h.onBlur();
|
|
2938
|
+
}, P = () => {
|
|
2939
|
+
re.current = !0, b(!0);
|
|
2940
|
+
};
|
|
2941
|
+
ie({
|
|
2939
2942
|
ref: x,
|
|
2940
|
-
onAction: () =>
|
|
2941
|
-
|
|
2942
|
-
|
|
2943
|
-
isActive: N,
|
|
2944
|
-
exceptRef: oe
|
|
2943
|
+
onAction: () => N(),
|
|
2944
|
+
isActive: M,
|
|
2945
|
+
exceptRef: C
|
|
2945
2946
|
});
|
|
2946
|
-
let
|
|
2947
|
-
|
|
2948
|
-
},
|
|
2947
|
+
let fe = (e) => {
|
|
2948
|
+
h.onChange(e.value), v(e.value), N(e.label);
|
|
2949
|
+
}, pe = (e) => {
|
|
2949
2950
|
e.target.select();
|
|
2951
|
+
}, me = (e) => {
|
|
2952
|
+
e === "ArrowDown" && M ? j(A + 1 >= Je.length ? 0 : A + 1) : e === "ArrowUp" && M && j(A - 1 < 0 ? Je.length - 1 : A - 1);
|
|
2953
|
+
}, he = (e) => {
|
|
2954
|
+
if (e.stopPropagation(), e.key === "Enter") if (e.preventDefault(), M && A >= 0) {
|
|
2955
|
+
let e = ye()[A];
|
|
2956
|
+
e && fe(e);
|
|
2957
|
+
} else M ? N() : P();
|
|
2958
|
+
else e.key === "Tab" || e.key === "Escape" ? N() : ["ArrowDown", "ArrowUp"].includes(e.key) && M && (e.preventDefault(), me(e.key));
|
|
2959
|
+
}, ge = (e) => {
|
|
2960
|
+
if (e.stopPropagation(), e.key === "Enter") if (e.preventDefault(), M && A >= 0) {
|
|
2961
|
+
let e = ye()[A];
|
|
2962
|
+
e && fe(e);
|
|
2963
|
+
} else M ? N() : P();
|
|
2964
|
+
else e.key === "Tab" || e.key === "Escape" ? N() : ["ArrowDown", "ArrowUp"].includes(e.key) && (e.preventDefault(), ae.current?.focus(), me(e.key));
|
|
2965
|
+
}, _e = (e) => {
|
|
2966
|
+
e.stopPropagation(), s || (M ? N() : P());
|
|
2950
2967
|
}, ve = (e) => {
|
|
2951
|
-
e === "ArrowDown" && N ? he(A + 1 >= Qe.length ? 0 : A + 1) : e === "ArrowUp" && N && he(A - 1 < 0 ? Qe.length - 1 : A - 1);
|
|
2952
|
-
}, ye = (e) => {
|
|
2953
|
-
if (e.stopPropagation(), e.key === "Enter") if (e.preventDefault(), N && A >= 0) {
|
|
2954
|
-
M("keyboard");
|
|
2955
|
-
let e = Se()[A];
|
|
2956
|
-
e && P(e);
|
|
2957
|
-
} else v(!N);
|
|
2958
|
-
else e.key === "Tab" || e.key === "Escape" ? v(!1) : ["ArrowDown", "ArrowUp"].includes(e.key) && N && (e.preventDefault(), ve(e.key));
|
|
2959
|
-
}, be = (e) => {
|
|
2960
|
-
if (e.stopPropagation(), e.key === "Enter") if (e.preventDefault(), N && A >= 0) {
|
|
2961
|
-
M("button");
|
|
2962
|
-
let e = Se()[A];
|
|
2963
|
-
e && P(e);
|
|
2964
|
-
} else v(!N);
|
|
2965
|
-
else e.key === "Tab" || e.key === "Escape" ? v(!1) : ["ArrowDown", "ArrowUp"].includes(e.key) && (e.preventDefault(), se.current?.focus(), ve(e.key));
|
|
2966
|
-
}, F = (e) => {
|
|
2967
|
-
e.stopPropagation(), o || v(!N);
|
|
2968
|
-
}, xe = (e) => {
|
|
2969
2968
|
e.preventDefault();
|
|
2970
2969
|
let { scrollHeight: t, scrollTop: n } = e.target;
|
|
2971
|
-
n +
|
|
2972
|
-
},
|
|
2970
|
+
n + ce >= t && ye().length >= O * c && ue(O + 1);
|
|
2971
|
+
}, F = (e) => {
|
|
2973
2972
|
e.preventDefault();
|
|
2974
2973
|
let { value: t } = e.target;
|
|
2975
|
-
t.length > 2 &&
|
|
2976
|
-
},
|
|
2977
|
-
if (
|
|
2978
|
-
let e =
|
|
2979
|
-
if (
|
|
2980
|
-
let t =
|
|
2981
|
-
return
|
|
2974
|
+
t.length > 2 && ue(1), D(t, () => de(!0)), P();
|
|
2975
|
+
}, ye = () => {
|
|
2976
|
+
if (u && w && w.length > 2) {
|
|
2977
|
+
let e = o.slice(0, c * O);
|
|
2978
|
+
if (w === oe?.label && !k) return Je = e, e;
|
|
2979
|
+
let t = o.filter((e) => e.label.toLocaleUpperCase().includes(w.toLocaleUpperCase())).slice(0, c * O);
|
|
2980
|
+
return Je = k ? t || [] : e, t || [];
|
|
2982
2981
|
}
|
|
2983
|
-
return
|
|
2982
|
+
return Je = o.slice(0, c * O), o.slice(0, c * O);
|
|
2984
2983
|
};
|
|
2985
|
-
return
|
|
2986
|
-
_ || (me(S?.label || ""), k(!1), he(-1), M("none"), y && ge()), _ && (j === "button" ? le.current?.focus() : j === "keyboard" && se.current?.focus(), ie(!0));
|
|
2987
|
-
}, [_]), /* @__PURE__ */ n("div", {
|
|
2984
|
+
return /* @__PURE__ */ n("div", {
|
|
2988
2985
|
className: [
|
|
2989
2986
|
Z,
|
|
2990
|
-
|
|
2991
|
-
|
|
2987
|
+
f ? `${Z}-paddingBottom` : "",
|
|
2988
|
+
m || ""
|
|
2992
2989
|
].join(" "),
|
|
2993
|
-
css:
|
|
2990
|
+
css: Ve(te),
|
|
2994
2991
|
"data-testid": Z,
|
|
2995
2992
|
children: [
|
|
2996
2993
|
/* @__PURE__ */ n("div", {
|
|
2997
2994
|
className: `${Z}-container`,
|
|
2998
|
-
onClick:
|
|
2999
|
-
onKeyDown: (e) => !
|
|
2995
|
+
onClick: _e,
|
|
2996
|
+
onKeyDown: (e) => !s && he(e),
|
|
3000
2997
|
role: "button",
|
|
3001
|
-
ref:
|
|
2998
|
+
ref: C,
|
|
3002
2999
|
"data-testid": `${Z}-container`,
|
|
3003
3000
|
children: [
|
|
3004
3001
|
/* @__PURE__ */ t("input", {
|
|
3005
3002
|
name: e,
|
|
3006
3003
|
className: [
|
|
3007
3004
|
`${Z}-selectField`,
|
|
3008
|
-
|
|
3009
|
-
|
|
3005
|
+
M && `${Z}-open`,
|
|
3006
|
+
se && `${Z}-error`
|
|
3010
3007
|
].join(" "),
|
|
3011
|
-
onClick: (e) =>
|
|
3012
|
-
onChange:
|
|
3013
|
-
value:
|
|
3008
|
+
onClick: (e) => u && pe(e),
|
|
3009
|
+
onChange: F,
|
|
3010
|
+
value: w,
|
|
3014
3011
|
placeholder: " ",
|
|
3015
|
-
disabled:
|
|
3016
|
-
readOnly: !
|
|
3017
|
-
ref:
|
|
3012
|
+
disabled: s,
|
|
3013
|
+
readOnly: !u,
|
|
3014
|
+
ref: ae,
|
|
3018
3015
|
role: "combobox",
|
|
3019
3016
|
autoComplete: "off",
|
|
3020
3017
|
"data-testid": `${Z}-selectField`,
|
|
3021
|
-
...
|
|
3018
|
+
...u && { placeholder: "Search..." },
|
|
3022
3019
|
...ne
|
|
3023
3020
|
}),
|
|
3024
3021
|
/* @__PURE__ */ t("div", {
|
|
3025
3022
|
className: `${Z}-adornment`,
|
|
3026
|
-
children: /* @__PURE__ */ t(
|
|
3027
|
-
icon: /* @__PURE__ */ t(
|
|
3028
|
-
onClick:
|
|
3029
|
-
onKeyDown: (e) => !
|
|
3030
|
-
disabled:
|
|
3031
|
-
isFlipped: !
|
|
3023
|
+
children: /* @__PURE__ */ t(be, {
|
|
3024
|
+
icon: /* @__PURE__ */ t(a, { name: "arrow_drop_up" }),
|
|
3025
|
+
onClick: _e,
|
|
3026
|
+
onKeyDown: (e) => !s && ge(e),
|
|
3027
|
+
disabled: s,
|
|
3028
|
+
isFlipped: !M,
|
|
3032
3029
|
tabIndex: -1
|
|
3033
3030
|
})
|
|
3034
3031
|
}),
|
|
@@ -3052,37 +3049,37 @@ var Z = "--SELECT", Qe = [], $e = ({ name: e, label: r, control: i, options: a,
|
|
|
3052
3049
|
/* @__PURE__ */ n("span", {
|
|
3053
3050
|
className: `${Z}-helperText`,
|
|
3054
3051
|
"data-testid": `${Z}-helperText`,
|
|
3055
|
-
children: [
|
|
3052
|
+
children: [ee && (!se || !p) && ee, p && se && se.message]
|
|
3056
3053
|
}),
|
|
3057
|
-
/* @__PURE__ */ t(
|
|
3058
|
-
displayOptions:
|
|
3059
|
-
value:
|
|
3060
|
-
isOpen:
|
|
3061
|
-
hasStaticOptions:
|
|
3062
|
-
hasDescription:
|
|
3063
|
-
onChange:
|
|
3054
|
+
/* @__PURE__ */ t(qe, {
|
|
3055
|
+
displayOptions: M ? ye() : Je,
|
|
3056
|
+
value: _,
|
|
3057
|
+
isOpen: M,
|
|
3058
|
+
hasStaticOptions: l,
|
|
3059
|
+
hasDescription: d,
|
|
3060
|
+
onChange: fe,
|
|
3064
3061
|
focusedElement: A,
|
|
3065
|
-
onScroll:
|
|
3062
|
+
onScroll: ve,
|
|
3066
3063
|
ref: x
|
|
3067
3064
|
})
|
|
3068
3065
|
]
|
|
3069
3066
|
});
|
|
3070
|
-
},
|
|
3071
|
-
let { componentStyles: i } = e([
|
|
3072
|
-
return /* @__PURE__ */ t(
|
|
3067
|
+
}, Xe = ({ theme: n, ...r }) => {
|
|
3068
|
+
let { componentStyles: i } = e([o.SELECT], n);
|
|
3069
|
+
return /* @__PURE__ */ t(Ye, {
|
|
3073
3070
|
...r,
|
|
3074
3071
|
style: i
|
|
3075
3072
|
});
|
|
3076
|
-
},
|
|
3073
|
+
}, Ze = (e, t) => `
|
|
3077
3074
|
~ .--SLIDER-rail {
|
|
3078
3075
|
${i(e, "background-color", `--SLIDER-EVENTS-${t}-BACKGROUND-COLOR`)}
|
|
3079
3076
|
}
|
|
3080
|
-
`,
|
|
3077
|
+
`, Qe = (e, t) => `
|
|
3081
3078
|
~ .--SLIDER-tracker {
|
|
3082
3079
|
// BACKGROUNDS
|
|
3083
3080
|
${i(e, "background-color", `--SLIDER-EVENTS-${t}-BACKGROUND-COLOR`)}
|
|
3084
3081
|
}
|
|
3085
|
-
`,
|
|
3082
|
+
`, $e = (e, t) => `
|
|
3086
3083
|
~ .--SLIDER-thumbIcon {
|
|
3087
3084
|
// UTILS
|
|
3088
3085
|
${i(e, "background-color", `--SLIDER-EVENTS-${t}-ICON-BACKGROUND-COLOR`)}
|
|
@@ -3094,11 +3091,11 @@ var Z = "--SELECT", Qe = [], $e = ({ name: e, label: r, control: i, options: a,
|
|
|
3094
3091
|
${i(e, "border-radius", `--SLIDER-EVENTS-${t}-BORDER-RADIUS`)}
|
|
3095
3092
|
|
|
3096
3093
|
|
|
3097
|
-
>
|
|
3098
|
-
${i(e, "
|
|
3094
|
+
> span {
|
|
3095
|
+
${i(e, "color", `--SLIDER-EVENTS-${t}-ICON-COLOR`)};
|
|
3099
3096
|
}
|
|
3100
3097
|
}
|
|
3101
|
-
`,
|
|
3098
|
+
`, et = (e) => D`
|
|
3102
3099
|
&.--SLIDER {
|
|
3103
3100
|
justify-content: center;
|
|
3104
3101
|
display: flex;
|
|
@@ -3123,11 +3120,11 @@ var Z = "--SELECT", Qe = [], $e = ({ name: e, label: r, control: i, options: a,
|
|
|
3123
3120
|
margin: 0px;
|
|
3124
3121
|
|
|
3125
3122
|
// ENABLED
|
|
3126
|
-
${
|
|
3127
|
-
${
|
|
3123
|
+
${Ze(e, "ENABLED")};
|
|
3124
|
+
${$e(e, "ENABLED")};
|
|
3128
3125
|
|
|
3129
3126
|
// VALUE
|
|
3130
|
-
${
|
|
3127
|
+
${Qe(e, "VALUE")};
|
|
3131
3128
|
|
|
3132
3129
|
// HOVER
|
|
3133
3130
|
@media (hover: hover) {
|
|
@@ -3157,9 +3154,9 @@ var Z = "--SELECT", Qe = [], $e = ({ name: e, label: r, control: i, options: a,
|
|
|
3157
3154
|
pointer-events: none;
|
|
3158
3155
|
}
|
|
3159
3156
|
|
|
3160
|
-
${
|
|
3161
|
-
${
|
|
3162
|
-
${
|
|
3157
|
+
${Ze(e, "DISABLED")};
|
|
3158
|
+
${Qe(e, "DISABLED_VALUE")};
|
|
3159
|
+
${$e(e, "DISABLED")};
|
|
3163
3160
|
|
|
3164
3161
|
~ .--SLIDER-mark {
|
|
3165
3162
|
${i(e, "background-color", "--SLIDER-EVENTS-DISABLED_VALUE-BACKGROUND-COLOR")}
|
|
@@ -3298,9 +3295,9 @@ var Z = "--SELECT", Qe = [], $e = ({ name: e, label: r, control: i, options: a,
|
|
|
3298
3295
|
position: absolute;
|
|
3299
3296
|
top: 50%;
|
|
3300
3297
|
transform: translateY(-50%);
|
|
3301
|
-
margin-left: -
|
|
3302
|
-
width:
|
|
3303
|
-
height:
|
|
3298
|
+
margin-left: -4px;
|
|
3299
|
+
width: 32px;
|
|
3300
|
+
height: 32px;
|
|
3304
3301
|
border-radius: 50%;
|
|
3305
3302
|
pointer-events: none;
|
|
3306
3303
|
z-index: 2;
|
|
@@ -3324,55 +3321,54 @@ var Z = "--SELECT", Qe = [], $e = ({ name: e, label: r, control: i, options: a,
|
|
|
3324
3321
|
border-radius: 50%;
|
|
3325
3322
|
box-sizing: border-box;
|
|
3326
3323
|
|
|
3327
|
-
>
|
|
3328
|
-
|
|
3329
|
-
height: 20px;
|
|
3324
|
+
> span {
|
|
3325
|
+
font-size: 20px;
|
|
3330
3326
|
}
|
|
3331
3327
|
}
|
|
3332
3328
|
}
|
|
3333
|
-
`, Q = "--SLIDER",
|
|
3334
|
-
let { field:
|
|
3335
|
-
control:
|
|
3329
|
+
`, Q = "--SLIDER", tt = ({ min: e = 0, max: i = Infinity, name: a, step: o = 25, distance: s = 0, disabled: c = !1, iconMin: l, iconMax: u, showMarks: d = !1, direction: f = "horizontal", track: p = "normal", control: ee, style: te }) => {
|
|
3330
|
+
let { field: m } = le({
|
|
3331
|
+
control: ee,
|
|
3336
3332
|
name: a
|
|
3337
|
-
}),
|
|
3338
|
-
|
|
3339
|
-
},
|
|
3340
|
-
let t =
|
|
3341
|
-
|
|
3342
|
-
},
|
|
3343
|
-
let t =
|
|
3344
|
-
|
|
3345
|
-
},
|
|
3346
|
-
if (!
|
|
3347
|
-
let n =
|
|
3348
|
-
if (t.key === "ArrowRight" || t.key === "ArrowUp" ? r =
|
|
3333
|
+
}), ne = m.value ?? [e], h = ne.length >= 2, g = T(null), _ = T(void 0), v = f === "vertical", y = i !== Infinity && e !== i && o > 0 ? Array.from({ length: Math.round((i - e) / o) + 1 }, (t, n) => Math.min(e + n * o, i)) : [], b = y.length > 0, re = (t) => b ? y.reduce((e, n) => Math.abs(n - t) <= Math.abs(e - t) ? n : e) : Math.max(e, Math.min(i, Math.round((t - e) / o) * o + e)), [x, ie] = E(() => b ? ne.map(re) : ne), S = (e) => {
|
|
3334
|
+
m.onChange(e), ie(e);
|
|
3335
|
+
}, C = (e) => {
|
|
3336
|
+
let t = re(parseFloat(e.target.value)), n = h ? Math.min(t, x[1] - s) : t;
|
|
3337
|
+
S(h ? [n, x[1]] : [n]);
|
|
3338
|
+
}, ae = (e) => {
|
|
3339
|
+
let t = re(parseFloat(e.target.value)), n = Math.max(t, x[0] + s);
|
|
3340
|
+
S([x[0], n]);
|
|
3341
|
+
}, oe = (t) => {
|
|
3342
|
+
if (!b) return;
|
|
3343
|
+
let n = x[0], r;
|
|
3344
|
+
if (t.key === "ArrowRight" || t.key === "ArrowUp" ? r = y.find((e) => e > n) ?? n : t.key === "ArrowLeft" || t.key === "ArrowDown" ? r = [...y].reverse().find((e) => e < n) ?? n : t.key === "Home" ? r = e : t.key === "End" && (r = h ? Math.min(i, x[1] - s) : i), r !== void 0 && r !== n) {
|
|
3349
3345
|
t.preventDefault();
|
|
3350
|
-
let e = h ? Math.min(r,
|
|
3351
|
-
|
|
3346
|
+
let e = h ? Math.min(r, x[1] - s) : r;
|
|
3347
|
+
S(h ? [e, x[1]] : [e]);
|
|
3352
3348
|
}
|
|
3353
|
-
},
|
|
3354
|
-
if (!
|
|
3355
|
-
let n =
|
|
3356
|
-
if (t.key === "ArrowRight" || t.key === "ArrowUp" ? r =
|
|
3349
|
+
}, se = (t) => {
|
|
3350
|
+
if (!b) return;
|
|
3351
|
+
let n = x[1], r;
|
|
3352
|
+
if (t.key === "ArrowRight" || t.key === "ArrowUp" ? r = y.find((e) => e > n) ?? n : t.key === "ArrowLeft" || t.key === "ArrowDown" ? r = [...y].reverse().find((e) => e < n) ?? n : t.key === "Home" ? r = Math.max(e, x[0] + s) : t.key === "End" && (r = i), r !== void 0 && r !== n) {
|
|
3357
3353
|
t.preventDefault();
|
|
3358
|
-
let e = Math.max(r,
|
|
3359
|
-
|
|
3354
|
+
let e = Math.max(r, x[0] + s);
|
|
3355
|
+
S([x[0], e]);
|
|
3360
3356
|
}
|
|
3361
|
-
},
|
|
3357
|
+
}, ce = (t) => {
|
|
3362
3358
|
if (c || i === Infinity || i === e) return;
|
|
3363
3359
|
let n = g.current, r = n?.getBoundingClientRect();
|
|
3364
3360
|
if (!r || !n) return;
|
|
3365
|
-
let a =
|
|
3366
|
-
h ? Math.abs(a -
|
|
3367
|
-
},
|
|
3368
|
-
let t =
|
|
3369
|
-
return
|
|
3370
|
-
},
|
|
3371
|
-
let t =
|
|
3372
|
-
return
|
|
3373
|
-
},
|
|
3374
|
-
let e =
|
|
3375
|
-
return
|
|
3361
|
+
let a = re(e + (v ? Math.max(0, Math.min(1, (r.bottom - t.clientY) / r.height)) : Math.max(0, Math.min(1, (t.clientX - r.left) / r.width))) * (i - e));
|
|
3362
|
+
h ? Math.abs(a - x[0]) <= Math.abs(a - x[1]) ? S([Math.max(e, Math.min(a, x[1] - s)), x[1]]) : S([x[0], Math.min(i, Math.max(a, x[0] + s))]) : S([Math.max(e, Math.min(i, a))]), n.classList.add(`${Q}--clicking`), clearTimeout(_.current), _.current = setTimeout(() => n.classList.remove(`${Q}--clicking`), 150);
|
|
3363
|
+
}, w = (t) => i === e ? 0 : (t - e) / (i - e) * 100, D = (e) => {
|
|
3364
|
+
let t = w(e);
|
|
3365
|
+
return v ? { top: `calc(${100 - t}% - ${(100 - t) / 100 * 24}px)` } : { left: `calc(${t}% - ${t / 100 * 24}px)` };
|
|
3366
|
+
}, O = (e) => {
|
|
3367
|
+
let t = w(e);
|
|
3368
|
+
return v ? { top: `calc(${100 - t}% - ${(100 - t) / 100 * 24}px + 11px)` } : { left: `calc(${t}% - ${t / 100 * 24}px + 11px)` };
|
|
3369
|
+
}, ue = () => {
|
|
3370
|
+
let e = x[0], t = x[1] ?? e, n = w(e), r = w(t), i = (e) => 12 - e / 100 * 24;
|
|
3371
|
+
return v ? h ? p === "inverted" ? [{
|
|
3376
3372
|
top: "0%",
|
|
3377
3373
|
bottom: `calc(${r}% + ${i(r)}px)`
|
|
3378
3374
|
}, {
|
|
@@ -3381,13 +3377,13 @@ var Z = "--SELECT", Qe = [], $e = ({ name: e, label: r, control: i, options: a,
|
|
|
3381
3377
|
}] : [{
|
|
3382
3378
|
top: `calc(${100 - r}% - ${i(r)}px)`,
|
|
3383
3379
|
bottom: `calc(${n}% + ${i(n)}px)`
|
|
3384
|
-
}] :
|
|
3380
|
+
}] : p === "inverted" ? [{
|
|
3385
3381
|
top: "0%",
|
|
3386
3382
|
bottom: `calc(${n}% + ${i(n)}px)`
|
|
3387
3383
|
}] : [{
|
|
3388
3384
|
top: `calc(${100 - n}% - ${i(n)}px)`,
|
|
3389
3385
|
bottom: "0%"
|
|
3390
|
-
}] : h ?
|
|
3386
|
+
}] : h ? p === "inverted" ? [{
|
|
3391
3387
|
left: "0%",
|
|
3392
3388
|
right: `calc(${100 - n}% - ${i(n)}px)`
|
|
3393
3389
|
}, {
|
|
@@ -3396,18 +3392,18 @@ var Z = "--SELECT", Qe = [], $e = ({ name: e, label: r, control: i, options: a,
|
|
|
3396
3392
|
}] : [{
|
|
3397
3393
|
left: `calc(${n}% + ${i(n)}px)`,
|
|
3398
3394
|
right: `calc(${100 - r}% - ${i(r)}px)`
|
|
3399
|
-
}] :
|
|
3395
|
+
}] : p === "inverted" ? [{
|
|
3400
3396
|
left: `calc(${n}% + ${i(n)}px)`,
|
|
3401
3397
|
right: "0%"
|
|
3402
3398
|
}] : [{
|
|
3403
3399
|
left: "0%",
|
|
3404
3400
|
right: `calc(${100 - n}% - ${i(n)}px)`
|
|
3405
3401
|
}];
|
|
3406
|
-
},
|
|
3402
|
+
}, k = (e) => h ? p === "inverted" ? e <= x[0] || e >= x[1] : e >= x[0] && e <= x[1] : p === "inverted" ? e >= x[0] : e <= x[0], de = b ? "any" : o;
|
|
3407
3403
|
return /* @__PURE__ */ n("span", {
|
|
3408
3404
|
ref: g,
|
|
3409
|
-
className: [Q,
|
|
3410
|
-
css:
|
|
3405
|
+
className: [Q, v ? `${Q}--vertical` : ""].join(" "),
|
|
3406
|
+
css: et(te),
|
|
3411
3407
|
"data-testid": Q,
|
|
3412
3408
|
children: [
|
|
3413
3409
|
/* @__PURE__ */ t("input", {
|
|
@@ -3415,21 +3411,21 @@ var Z = "--SELECT", Qe = [], $e = ({ name: e, label: r, control: i, options: a,
|
|
|
3415
3411
|
type: "range",
|
|
3416
3412
|
min: e,
|
|
3417
3413
|
max: i,
|
|
3418
|
-
step:
|
|
3419
|
-
value:
|
|
3420
|
-
onChange:
|
|
3421
|
-
onKeyDown:
|
|
3414
|
+
step: de,
|
|
3415
|
+
value: x[0],
|
|
3416
|
+
onChange: C,
|
|
3417
|
+
onKeyDown: oe,
|
|
3422
3418
|
disabled: c,
|
|
3423
3419
|
"data-testid": h ? `${Q}-minField` : `${Q}-field`
|
|
3424
3420
|
}),
|
|
3425
3421
|
/* @__PURE__ */ t("span", {
|
|
3426
3422
|
className: `${Q}-ripple`,
|
|
3427
|
-
style:
|
|
3423
|
+
style: D(x[0]),
|
|
3428
3424
|
"aria-hidden": "true"
|
|
3429
3425
|
}),
|
|
3430
3426
|
/* @__PURE__ */ t("span", {
|
|
3431
3427
|
className: `${Q}-thumbIcon`,
|
|
3432
|
-
style:
|
|
3428
|
+
style: D(x[0]),
|
|
3433
3429
|
"aria-hidden": "true",
|
|
3434
3430
|
children: l
|
|
3435
3431
|
}),
|
|
@@ -3439,54 +3435,54 @@ var Z = "--SELECT", Qe = [], $e = ({ name: e, label: r, control: i, options: a,
|
|
|
3439
3435
|
type: "range",
|
|
3440
3436
|
min: e,
|
|
3441
3437
|
max: i,
|
|
3442
|
-
step:
|
|
3443
|
-
value:
|
|
3444
|
-
onChange:
|
|
3445
|
-
onKeyDown:
|
|
3438
|
+
step: de,
|
|
3439
|
+
value: x[1],
|
|
3440
|
+
onChange: ae,
|
|
3441
|
+
onKeyDown: se,
|
|
3446
3442
|
disabled: c,
|
|
3447
3443
|
"data-testid": `${Q}-maxField`
|
|
3448
3444
|
}),
|
|
3449
3445
|
/* @__PURE__ */ t("span", {
|
|
3450
3446
|
className: `${Q}-ripple`,
|
|
3451
|
-
style:
|
|
3447
|
+
style: D(x[1]),
|
|
3452
3448
|
"aria-hidden": "true"
|
|
3453
3449
|
}),
|
|
3454
3450
|
/* @__PURE__ */ t("span", {
|
|
3455
3451
|
className: `${Q}-thumbIcon`,
|
|
3456
|
-
style:
|
|
3452
|
+
style: D(x[1]),
|
|
3457
3453
|
"aria-hidden": "true",
|
|
3458
3454
|
children: u
|
|
3459
3455
|
})
|
|
3460
3456
|
] }),
|
|
3461
3457
|
/* @__PURE__ */ t("span", {
|
|
3462
3458
|
className: `${Q}-rail`,
|
|
3463
|
-
onClick:
|
|
3459
|
+
onClick: ce
|
|
3464
3460
|
}),
|
|
3465
|
-
|
|
3461
|
+
ue().map((e, n) => /* @__PURE__ */ t("span", {
|
|
3466
3462
|
className: `${Q}-tracker`,
|
|
3467
|
-
onClick:
|
|
3463
|
+
onClick: ce,
|
|
3468
3464
|
style: e
|
|
3469
3465
|
}, n)),
|
|
3470
|
-
d &&
|
|
3471
|
-
className: [`${Q}-mark`,
|
|
3472
|
-
style:
|
|
3466
|
+
d && y.map((e) => /* @__PURE__ */ t("span", {
|
|
3467
|
+
className: [`${Q}-mark`, k(e) && `${Q}-mark--active`].filter(Boolean).join(" "),
|
|
3468
|
+
style: O(e),
|
|
3473
3469
|
"aria-hidden": "true",
|
|
3474
|
-
onClick:
|
|
3470
|
+
onClick: ce
|
|
3475
3471
|
}, e))
|
|
3476
3472
|
]
|
|
3477
3473
|
});
|
|
3478
|
-
},
|
|
3479
|
-
let { componentStyles: i } = e([
|
|
3480
|
-
return /* @__PURE__ */ t(
|
|
3474
|
+
}, nt = ({ theme: n, ...r }) => {
|
|
3475
|
+
let { componentStyles: i } = e([o.SLIDER], n);
|
|
3476
|
+
return /* @__PURE__ */ t(tt, {
|
|
3481
3477
|
...r,
|
|
3482
3478
|
style: i
|
|
3483
3479
|
});
|
|
3484
|
-
},
|
|
3480
|
+
}, rt = (e, t) => `
|
|
3485
3481
|
~ .--SWITCH-span {
|
|
3486
3482
|
// BACKGROUNDS
|
|
3487
3483
|
${i(e, "background-color", `--SWITCH-EVENTS-${t}-BACKGROUND-COLOR`)}
|
|
3488
3484
|
}
|
|
3489
|
-
`,
|
|
3485
|
+
`, it = (e, t) => `
|
|
3490
3486
|
~ .--SWITCH-span {
|
|
3491
3487
|
// BORDERS
|
|
3492
3488
|
${i(e, "border-color", `--SWITCH-EVENTS-${t}-BORDER-COLOR`)}
|
|
@@ -3494,7 +3490,7 @@ var Z = "--SELECT", Qe = [], $e = ({ name: e, label: r, control: i, options: a,
|
|
|
3494
3490
|
${i(e, "border-style", `--SWITCH-EVENTS-${t}-BORDER-STYLE`)}
|
|
3495
3491
|
${i(e, "border-radius", `--SWITCH-EVENTS-${t}-BORDER-RADIUS`)}
|
|
3496
3492
|
}
|
|
3497
|
-
`,
|
|
3493
|
+
`, at = (e, t) => `
|
|
3498
3494
|
~ .--SWITCH-span {
|
|
3499
3495
|
// OUTLINE
|
|
3500
3496
|
${i(e, "outline-color", `--SWITCH-EVENTS-${t}-OUTLINE-COLOR`)}
|
|
@@ -3502,18 +3498,16 @@ var Z = "--SELECT", Qe = [], $e = ({ name: e, label: r, control: i, options: a,
|
|
|
3502
3498
|
${i(e, "outline-style", `--SWITCH-EVENTS-${t}-OUTLINE-STYLE`)}
|
|
3503
3499
|
${i(e, "outline-offset", `--SWITCH-EVENTS-${t}-OUTLINE-OFFSET`)}
|
|
3504
3500
|
}
|
|
3505
|
-
`,
|
|
3501
|
+
`, ot = (e, t) => `
|
|
3506
3502
|
// UTILS
|
|
3507
3503
|
~ .--SWITCH-span > span {
|
|
3508
|
-
|
|
3509
|
-
${i(e, "fill", `--SWITCH-EVENTS-${t}-ICON-COLOR`)};
|
|
3510
|
-
}
|
|
3504
|
+
${i(e, "color", `--SWITCH-EVENTS-${t}-ICON-COLOR`)};
|
|
3511
3505
|
|
|
3512
3506
|
> .--SWITCH-shadow {
|
|
3513
3507
|
${i(e, "background-color", `--SWITCH-EVENTS-${t}-ICON-BACKGROUND-COLOR`)};
|
|
3514
3508
|
}
|
|
3515
3509
|
}
|
|
3516
|
-
`,
|
|
3510
|
+
`, st = (e, t) => `
|
|
3517
3511
|
// TYPOGRAPHY
|
|
3518
3512
|
.--SWITCH-label {
|
|
3519
3513
|
${i(e, "color", `--SWITCH-EVENTS-${t}-COLOR-PRIMARY`)}
|
|
@@ -3522,7 +3516,7 @@ var Z = "--SELECT", Qe = [], $e = ({ name: e, label: r, control: i, options: a,
|
|
|
3522
3516
|
~ .--SWITCH-helperText {
|
|
3523
3517
|
${i(e, "color", `--SWITCH-EVENTS-${t}-COLOR-SECONDARY`)}
|
|
3524
3518
|
}
|
|
3525
|
-
`,
|
|
3519
|
+
`, ct = (e) => D`
|
|
3526
3520
|
&.--SWITCH {
|
|
3527
3521
|
display: flex;
|
|
3528
3522
|
flex-direction: column;
|
|
@@ -3537,37 +3531,37 @@ var Z = "--SELECT", Qe = [], $e = ({ name: e, label: r, control: i, options: a,
|
|
|
3537
3531
|
cursor: pointer;
|
|
3538
3532
|
|
|
3539
3533
|
// ENABLED
|
|
3540
|
-
${
|
|
3534
|
+
${st(e, "ENABLED")};
|
|
3541
3535
|
|
|
3542
3536
|
// VALUE
|
|
3543
3537
|
&:has(.--SWITCH-inputField:checked) {
|
|
3544
|
-
${
|
|
3538
|
+
${st(e, "VALUE")};
|
|
3545
3539
|
}
|
|
3546
3540
|
|
|
3547
3541
|
// HOVER
|
|
3548
3542
|
&:has(.--SWITCH-inputField:hover) {
|
|
3549
|
-
${
|
|
3543
|
+
${st(e, "HOVER")};
|
|
3550
3544
|
}
|
|
3551
3545
|
|
|
3552
3546
|
// ACTIVE
|
|
3553
3547
|
&:has(.--SWITCH-inputField.--SWITCH-active, .--SWITCH-inputField:active) {
|
|
3554
|
-
${
|
|
3548
|
+
${st(e, "ACTIVE")};
|
|
3555
3549
|
}
|
|
3556
3550
|
|
|
3557
3551
|
// FOCUS-VISIBLE
|
|
3558
3552
|
&:has(.--SWITCH-inputField:focus-visible) {
|
|
3559
|
-
${
|
|
3553
|
+
${st(e, "FOCUS")};
|
|
3560
3554
|
}
|
|
3561
3555
|
|
|
3562
3556
|
// DISABLED
|
|
3563
3557
|
&:has(.--SWITCH-inputField:disabled) {
|
|
3564
3558
|
pointer-events: none;
|
|
3565
|
-
${
|
|
3559
|
+
${st(e, "DISABLED")};
|
|
3566
3560
|
}
|
|
3567
3561
|
|
|
3568
3562
|
// DISABLED + VALUE
|
|
3569
3563
|
&:has(.--SWITCH-inputField:disabled:checked) {
|
|
3570
|
-
${
|
|
3564
|
+
${st(e, "DISABLED_VALUE")};
|
|
3571
3565
|
}
|
|
3572
3566
|
|
|
3573
3567
|
.--SWITCH-checkbox {
|
|
@@ -3587,15 +3581,15 @@ var Z = "--SELECT", Qe = [], $e = ({ name: e, label: r, control: i, options: a,
|
|
|
3587
3581
|
-webkit-tap-highlight-color: transparent;
|
|
3588
3582
|
|
|
3589
3583
|
// ENABLED
|
|
3590
|
-
${
|
|
3591
|
-
${
|
|
3592
|
-
${
|
|
3584
|
+
${rt(e, "ENABLED")};
|
|
3585
|
+
${it(e, "ENABLED")};
|
|
3586
|
+
${ot(e, "ENABLED")};
|
|
3593
3587
|
|
|
3594
3588
|
// VALUE
|
|
3595
3589
|
&:checked {
|
|
3596
|
-
${
|
|
3597
|
-
${
|
|
3598
|
-
${
|
|
3590
|
+
${rt(e, "VALUE")};
|
|
3591
|
+
${it(e, "VALUE")};
|
|
3592
|
+
${ot(e, "VALUE")};
|
|
3599
3593
|
|
|
3600
3594
|
~ .--SWITCH-span {
|
|
3601
3595
|
.--SWITCH-iconOff {
|
|
@@ -3639,22 +3633,22 @@ var Z = "--SELECT", Qe = [], $e = ({ name: e, label: r, control: i, options: a,
|
|
|
3639
3633
|
// FOCUS
|
|
3640
3634
|
&:focus-visible {
|
|
3641
3635
|
outline: none;
|
|
3642
|
-
${
|
|
3643
|
-
${
|
|
3636
|
+
${at(e, "FOCUS")};
|
|
3637
|
+
${ot(e, "FOCUS")};
|
|
3644
3638
|
}
|
|
3645
3639
|
|
|
3646
3640
|
// DISABLED
|
|
3647
3641
|
&:disabled {
|
|
3648
|
-
${
|
|
3649
|
-
${
|
|
3650
|
-
${
|
|
3642
|
+
${rt(e, "DISABLED")};
|
|
3643
|
+
${it(e, "DISABLED")};
|
|
3644
|
+
${ot(e, "DISABLED")};
|
|
3651
3645
|
}
|
|
3652
3646
|
|
|
3653
3647
|
// DISABLED + VALUE
|
|
3654
3648
|
&:disabled:checked {
|
|
3655
|
-
${
|
|
3656
|
-
${
|
|
3657
|
-
${
|
|
3649
|
+
${rt(e, "DISABLED_VALUE")};
|
|
3650
|
+
${it(e, "DISABLED_VALUE")};
|
|
3651
|
+
${ot(e, "DISABLED_VALUE")};
|
|
3658
3652
|
|
|
3659
3653
|
~ .--SWITCH-span {
|
|
3660
3654
|
.--SWITCH-iconOff {
|
|
@@ -3697,23 +3691,22 @@ var Z = "--SELECT", Qe = [], $e = ({ name: e, label: r, control: i, options: a,
|
|
|
3697
3691
|
&::before {
|
|
3698
3692
|
content: '';
|
|
3699
3693
|
position: absolute;
|
|
3700
|
-
width:
|
|
3701
|
-
height:
|
|
3694
|
+
width: 32px;
|
|
3695
|
+
height: 32px;
|
|
3702
3696
|
border-radius: 50%;
|
|
3703
|
-
top: calc(50% -
|
|
3704
|
-
left: calc(50% -
|
|
3697
|
+
top: calc(50% - 16px);
|
|
3698
|
+
left: calc(50% - 16px);
|
|
3705
3699
|
opacity: 0;
|
|
3706
3700
|
z-index: -1;
|
|
3707
3701
|
transition: opacity 150ms ease-in-out;
|
|
3708
3702
|
}
|
|
3709
3703
|
|
|
3710
|
-
>
|
|
3711
|
-
width: 12px;
|
|
3712
|
-
height: 12px;
|
|
3704
|
+
> span {
|
|
3713
3705
|
max-width: 100%;
|
|
3714
3706
|
max-height: 100%;
|
|
3715
3707
|
position: absolute;
|
|
3716
3708
|
z-index: 1;
|
|
3709
|
+
font-size: 12px;
|
|
3717
3710
|
}
|
|
3718
3711
|
|
|
3719
3712
|
.--SWITCH-shadow {
|
|
@@ -3757,27 +3750,27 @@ var Z = "--SELECT", Qe = [], $e = ({ name: e, label: r, control: i, options: a,
|
|
|
3757
3750
|
margin-left: 14px;
|
|
3758
3751
|
}
|
|
3759
3752
|
}
|
|
3760
|
-
`, $ = "--SWITCH",
|
|
3761
|
-
let [
|
|
3753
|
+
`, $ = "--SWITCH", lt = ({ name: e, control: r, iconOn: i, iconOff: a, disabled: o, label: s, helperText: c, className: l, style: u, ...d }) => {
|
|
3754
|
+
let [f, p] = E(!1), { field: ee, fieldState: te } = le({
|
|
3762
3755
|
control: r,
|
|
3763
3756
|
name: e
|
|
3764
|
-
}), [
|
|
3765
|
-
|
|
3766
|
-
},
|
|
3757
|
+
}), [m, ne] = E(ee.value || !1), h = te.error, g = (e) => {
|
|
3758
|
+
ee.onChange(e), ne(e), h && b();
|
|
3759
|
+
}, _ = (e) => {
|
|
3767
3760
|
let { checked: t } = e.target;
|
|
3768
3761
|
g(t);
|
|
3769
|
-
}, _ = (e) => {
|
|
3770
|
-
(e.key === "Enter" || e.key === "Space") && f(!0), d.onKeyDown?.(e);
|
|
3771
3762
|
}, v = (e) => {
|
|
3772
|
-
(e.key === "Enter" || e.key === "Space") && (
|
|
3773
|
-
}, y = () =>
|
|
3763
|
+
(e.key === "Enter" || e.key === "Space") && p(!0), d.onKeyDown?.(e);
|
|
3764
|
+
}, y = (e) => {
|
|
3765
|
+
(e.key === "Enter" || e.key === "Space") && (p(!1), g(!m)), d.onKeyUp?.(e);
|
|
3766
|
+
}, b = () => ee.onBlur();
|
|
3774
3767
|
return /* @__PURE__ */ n("div", {
|
|
3775
3768
|
className: [
|
|
3776
3769
|
$,
|
|
3777
|
-
|
|
3770
|
+
f ? `${$}-active` : "",
|
|
3778
3771
|
l || ""
|
|
3779
3772
|
].join(" "),
|
|
3780
|
-
css:
|
|
3773
|
+
css: ct(u),
|
|
3781
3774
|
"data-testid": $,
|
|
3782
3775
|
children: [/* @__PURE__ */ n("label", {
|
|
3783
3776
|
className: `${$}-container`,
|
|
@@ -3786,17 +3779,17 @@ var Z = "--SELECT", Qe = [], $e = ({ name: e, label: r, control: i, options: a,
|
|
|
3786
3779
|
children: [/* @__PURE__ */ t("input", {
|
|
3787
3780
|
className: [
|
|
3788
3781
|
`${$}-inputField`,
|
|
3789
|
-
|
|
3782
|
+
f ? `${$}-active` : "",
|
|
3790
3783
|
h && `${$}-error`
|
|
3791
3784
|
].join(" "),
|
|
3792
3785
|
type: "checkbox",
|
|
3793
3786
|
value: e,
|
|
3794
|
-
checked:
|
|
3787
|
+
checked: m,
|
|
3795
3788
|
disabled: o,
|
|
3796
|
-
onChange:
|
|
3797
|
-
onKeyDown:
|
|
3798
|
-
onKeyUp:
|
|
3799
|
-
onBlur:
|
|
3789
|
+
onChange: _,
|
|
3790
|
+
onKeyDown: v,
|
|
3791
|
+
onKeyUp: y,
|
|
3792
|
+
onBlur: b,
|
|
3800
3793
|
"data-testid": `${$}-inputField`,
|
|
3801
3794
|
...d
|
|
3802
3795
|
}), /* @__PURE__ */ n("span", {
|
|
@@ -3821,14 +3814,14 @@ var Z = "--SELECT", Qe = [], $e = ({ name: e, label: r, control: i, options: a,
|
|
|
3821
3814
|
children: h ? h.message : c
|
|
3822
3815
|
})]
|
|
3823
3816
|
});
|
|
3824
|
-
},
|
|
3825
|
-
let { componentStyles: i } = e([
|
|
3826
|
-
return /* @__PURE__ */ t(
|
|
3817
|
+
}, ut = ({ theme: n, ...r }) => {
|
|
3818
|
+
let { componentStyles: i } = e([o.SWITCH], n);
|
|
3819
|
+
return /* @__PURE__ */ t(lt, {
|
|
3827
3820
|
...r,
|
|
3828
3821
|
style: i
|
|
3829
3822
|
});
|
|
3830
3823
|
};
|
|
3831
3824
|
//#endregion
|
|
3832
|
-
export {
|
|
3825
|
+
export { Ae as a, A as c, ze as i, nt as n, Te as o, Xe as r, be as s, ut as t };
|
|
3833
3826
|
|
|
3834
|
-
//# sourceMappingURL=Switch-
|
|
3827
|
+
//# sourceMappingURL=Switch-BBGFtWQt.js.map
|