@foi/design-system 0.0.16 → 0.0.17
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/README.md +18 -1
- package/dist/RadioGroup-DzEJw4WJ.js +456 -0
- package/dist/RadioGroup-DzEJw4WJ.js.map +1 -0
- package/dist/{RadioGroup.context-BBa8PDLt.js → RadioGroup.context-Bu218uUX.js} +159 -3
- package/dist/RadioGroup.context-Bu218uUX.js.map +1 -0
- package/dist/{Switch-BNFdKefE.js → Switch-oAVuMb0V.js} +906 -1062
- package/dist/Switch-oAVuMb0V.js.map +1 -0
- package/dist/atoms.mjs +3 -3
- package/dist/components/organisms/DataGrid/DataGrid.interface.d.ts +4 -2
- package/dist/index.d.ts +3 -1
- package/dist/index.mjs +128 -128
- package/dist/index.mjs.map +1 -1
- package/dist/molecules.d.ts +2 -0
- package/dist/molecules.mjs +2 -2
- package/package.json +1 -1
- package/dist/RadioGroup-BdWsLUz-.js +0 -324
- package/dist/RadioGroup-BdWsLUz-.js.map +0 -1
- package/dist/RadioGroup.context-BBa8PDLt.js.map +0 -1
- package/dist/Switch-BNFdKefE.js.map +0 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { i as e, n as t, r as n, t as r } from "./emotion-react-jsx-runtime.browser.esm-Ch-DwUYg.js";
|
|
2
2
|
import { r as i } from "./theme-D01EcUA9.js";
|
|
3
|
-
import { a, o, t as
|
|
4
|
-
import { _ as
|
|
5
|
-
import { n as
|
|
6
|
-
import
|
|
7
|
-
import { css as
|
|
8
|
-
import { useController as
|
|
3
|
+
import { n as a, o, s, t as c } from "./RadioGroup.context-Bu218uUX.js";
|
|
4
|
+
import { _ as l, a as u, c as d, f, g as p, h as m, i as ee, l as h, m as g, n as _, o as v, p as y, r as b, s as x, t as te, u as S, v as C, y as ne } from "./DatePicker.utils-ytCEcs6T.js";
|
|
5
|
+
import { n as re, t as ie } from "./useStateCallback-B4O93zzK.js";
|
|
6
|
+
import w, { forwardRef as ae, useContext as oe, useEffect as T, useLayoutEffect as se, useMemo as E, useRef as D, useState as O } from "react";
|
|
7
|
+
import { css as k } from "@emotion/react";
|
|
8
|
+
import { useController as ce } from "react-hook-form";
|
|
9
9
|
//#region src/components/atoms/Button/Button.emotion.ts
|
|
10
|
-
var
|
|
10
|
+
var A = (e, t) => `
|
|
11
11
|
// UTILS
|
|
12
12
|
${i(e, "color", `--BUTTON-EVENTS-${t}-COLOR-PRIMARY`)}
|
|
13
13
|
|
|
@@ -24,7 +24,7 @@ var j = (e, t) => `
|
|
|
24
24
|
${i(e, "outline-width", `--BUTTON-EVENTS-${t}-OUTLINE-WIDTH`)}
|
|
25
25
|
${i(e, "outline-style", `--BUTTON-EVENTS-${t}-OUTLINE-STYLE`)}
|
|
26
26
|
${i(e, "outline-offset", `--BUTTON-EVENTS-${t}-OUTLINE-OFFSET`)}
|
|
27
|
-
`,
|
|
27
|
+
`, le = (e) => k`
|
|
28
28
|
&.--BUTTON {
|
|
29
29
|
width: 100%;
|
|
30
30
|
height: 48px;
|
|
@@ -42,35 +42,35 @@ var j = (e, t) => `
|
|
|
42
42
|
-webkit-tap-highlight-color: transparent;
|
|
43
43
|
|
|
44
44
|
// ENABLED
|
|
45
|
-
${
|
|
45
|
+
${A(e, "ENABLED")};
|
|
46
46
|
|
|
47
47
|
// HOVER
|
|
48
48
|
&:hover {
|
|
49
|
-
${
|
|
49
|
+
${A(e, "HOVER")};
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
// ACTIVE
|
|
53
53
|
&.--BUTTON-active,
|
|
54
54
|
&:active {
|
|
55
|
-
${
|
|
55
|
+
${A(e, "ACTIVE")};
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
// FOCUS
|
|
59
59
|
&:focus-visible {
|
|
60
60
|
outline: none;
|
|
61
|
-
${
|
|
61
|
+
${A(e, "FOCUS")};
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
// DISABLED
|
|
65
65
|
&:disabled {
|
|
66
66
|
pointer-events: none;
|
|
67
|
-
${
|
|
67
|
+
${A(e, "DISABLED")};
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
// LOADING
|
|
71
71
|
&.--BUTTON-loading {
|
|
72
72
|
pointer-events: none;
|
|
73
|
-
${
|
|
73
|
+
${A(e, "LOADING")};
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
.--BUTTON-iconStart,
|
|
@@ -92,16 +92,16 @@ var j = (e, t) => `
|
|
|
92
92
|
letter-spacing: 0.01em;
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
|
-
`,
|
|
96
|
-
let [u, d] =
|
|
95
|
+
`, j = "--BUTTON", ue = ({ className: e, style: r, children: i = "Click me!", type: a = "button", loading: o = !1, iconStart: s, iconEnd: c, ...l }) => {
|
|
96
|
+
let [u, d] = O(!1);
|
|
97
97
|
return /* @__PURE__ */ n("button", {
|
|
98
98
|
className: [
|
|
99
|
-
|
|
100
|
-
u ? `${
|
|
101
|
-
o ? `${
|
|
99
|
+
j,
|
|
100
|
+
u ? `${j}-active` : "",
|
|
101
|
+
o ? `${j}-loading` : "",
|
|
102
102
|
e || ""
|
|
103
103
|
].join(" "),
|
|
104
|
-
css:
|
|
104
|
+
css: le(r),
|
|
105
105
|
type: a,
|
|
106
106
|
onKeyDown: (e) => {
|
|
107
107
|
(e.key === "Enter" || e.key === "Space") && d(!0), l.onKeyDown?.(e);
|
|
@@ -112,46 +112,46 @@ var j = (e, t) => `
|
|
|
112
112
|
onBlur: (e) => {
|
|
113
113
|
d(!1), l.onBlur?.(e);
|
|
114
114
|
},
|
|
115
|
-
"data-testid":
|
|
115
|
+
"data-testid": j,
|
|
116
116
|
...l,
|
|
117
117
|
children: [
|
|
118
118
|
s && /* @__PURE__ */ t("span", {
|
|
119
|
-
className: `${
|
|
119
|
+
className: `${j}-iconStart`,
|
|
120
120
|
children: s
|
|
121
121
|
}),
|
|
122
122
|
/* @__PURE__ */ t("span", {
|
|
123
|
-
className: `${
|
|
123
|
+
className: `${j}-span`,
|
|
124
124
|
children: i
|
|
125
125
|
}),
|
|
126
126
|
c && /* @__PURE__ */ t("span", {
|
|
127
|
-
className: `${
|
|
127
|
+
className: `${j}-iconEnd`,
|
|
128
128
|
children: c
|
|
129
129
|
})
|
|
130
130
|
]
|
|
131
131
|
});
|
|
132
|
-
},
|
|
133
|
-
let { componentStyles: a } = e([
|
|
134
|
-
return /* @__PURE__ */ t(
|
|
132
|
+
}, M = ({ theme: n, variant: r = "default", ...i }) => {
|
|
133
|
+
let { componentStyles: a } = e([s.BUTTON], n, r.toUpperCase());
|
|
134
|
+
return /* @__PURE__ */ t(ue, {
|
|
135
135
|
...i,
|
|
136
136
|
style: a
|
|
137
137
|
});
|
|
138
|
-
},
|
|
138
|
+
}, N = (e, t) => `
|
|
139
139
|
${i(e, "border-color", `--DATEPICKER-EVENTS-${t}-BORDER-COLOR`)};
|
|
140
140
|
${i(e, "border-width", `--DATEPICKER-EVENTS-${t}-BORDER-WIDTH`)};
|
|
141
141
|
${i(e, "border-style", `--DATEPICKER-EVENTS-${t}-BORDER-STYLE`)};
|
|
142
|
-
`,
|
|
142
|
+
`, P = (e, t, n = !1) => `
|
|
143
143
|
${i(e, "color", `--DATEPICKER-EVENTS-${t}-COLOR-SECONDARY`)};
|
|
144
144
|
${n ? "transform: translate(14px, -24px); font-size: 0.75rem;" : ""};
|
|
145
|
-
`,
|
|
145
|
+
`, F = (e) => `
|
|
146
146
|
.--DATEPICKER-legend {
|
|
147
147
|
max-width: ${e ? "100%" : "0px"};
|
|
148
148
|
}
|
|
149
|
-
`,
|
|
149
|
+
`, I = (e, t) => `
|
|
150
150
|
${i(e, "background-color", `--DATEPICKER-EVENTS-${t}-BACKGROUND-COLOR`)};
|
|
151
151
|
~ .--DATEPICKER-helperText {
|
|
152
152
|
${i(e, "color", `--DATEPICKER-EVENTS-${t}-COLOR-TERTIARY`)};
|
|
153
153
|
}
|
|
154
|
-
`,
|
|
154
|
+
`, de = (e) => k`
|
|
155
155
|
&.--DATEPICKER {
|
|
156
156
|
position: relative;
|
|
157
157
|
padding: 0;
|
|
@@ -176,64 +176,64 @@ var j = (e, t) => `
|
|
|
176
176
|
${i(e, "border-radius", "--DATEPICKER-ROOT-BORDER-RADIUS")};
|
|
177
177
|
|
|
178
178
|
// ENABLED
|
|
179
|
-
${
|
|
179
|
+
${I(e, "ENABLED")};
|
|
180
180
|
|
|
181
181
|
// VALUE (field has content or calendar is open)
|
|
182
182
|
&:has(.--DATEPICKER-fieldRow.--DATEPICKER-open) {
|
|
183
|
-
${
|
|
183
|
+
${I(e, "VALUE")};
|
|
184
184
|
}
|
|
185
185
|
|
|
186
186
|
// HOVER
|
|
187
187
|
&:has(.--DATEPICKER-fieldRow:hover) {
|
|
188
|
-
${
|
|
188
|
+
${I(e, "HOVER")};
|
|
189
189
|
}
|
|
190
190
|
|
|
191
191
|
// ACTIVE
|
|
192
192
|
&:has(.--DATEPICKER-fieldRow:active) {
|
|
193
|
-
${
|
|
193
|
+
${I(e, "ACTIVE")};
|
|
194
194
|
}
|
|
195
195
|
|
|
196
196
|
// FOCUS (user is typing inside the 3 sub-inputs)
|
|
197
197
|
&:has(.--DATEPICKER-fieldRow:focus-within) {
|
|
198
198
|
outline: none;
|
|
199
|
-
${
|
|
199
|
+
${I(e, "FOCUS")};
|
|
200
200
|
}
|
|
201
201
|
|
|
202
202
|
// ERROR
|
|
203
203
|
&:has(.--DATEPICKER-fieldRow.--DATEPICKER-error) {
|
|
204
|
-
${
|
|
204
|
+
${I(e, "ERROR")};
|
|
205
205
|
}
|
|
206
206
|
|
|
207
207
|
// ERROR + VALUE
|
|
208
208
|
&:has(.--DATEPICKER-fieldRow.--DATEPICKER-error.--DATEPICKER-open) {
|
|
209
|
-
${
|
|
209
|
+
${I(e, "ERROR_VALUE")};
|
|
210
210
|
}
|
|
211
211
|
|
|
212
212
|
// ERROR + HOVER
|
|
213
213
|
&:has(.--DATEPICKER-fieldRow.--DATEPICKER-error:hover) {
|
|
214
|
-
${
|
|
214
|
+
${I(e, "ERROR_HOVER")};
|
|
215
215
|
}
|
|
216
216
|
|
|
217
217
|
// ERROR + ACTIVE
|
|
218
218
|
&:has(.--DATEPICKER-fieldRow.--DATEPICKER-error:active) {
|
|
219
|
-
${
|
|
219
|
+
${I(e, "ERROR_ACTIVE")};
|
|
220
220
|
}
|
|
221
221
|
|
|
222
222
|
// ERROR + FOCUS
|
|
223
223
|
&:has(.--DATEPICKER-fieldRow.--DATEPICKER-error:focus-within) {
|
|
224
|
-
${
|
|
224
|
+
${I(e, "ERROR_FOCUS")};
|
|
225
225
|
}
|
|
226
226
|
|
|
227
227
|
// DISABLED
|
|
228
228
|
&:has(.--DATEPICKER-fieldRow.--DATEPICKER-disabled) {
|
|
229
229
|
pointer-events: none;
|
|
230
|
-
${
|
|
230
|
+
${I(e, "DISABLED")};
|
|
231
231
|
}
|
|
232
232
|
|
|
233
233
|
// DISABLED + VALUE
|
|
234
234
|
&:has(.--DATEPICKER-fieldRow.--DATEPICKER-disabled.--DATEPICKER-open) {
|
|
235
235
|
pointer-events: none;
|
|
236
|
-
${
|
|
236
|
+
${I(e, "DISABLED_VALUE")};
|
|
237
237
|
}
|
|
238
238
|
|
|
239
239
|
.--DATEPICKER-fieldRow {
|
|
@@ -260,83 +260,83 @@ var j = (e, t) => `
|
|
|
260
260
|
|
|
261
261
|
// ENABLED
|
|
262
262
|
~ .--DATEPICKER-label {
|
|
263
|
-
${
|
|
263
|
+
${P(e, "ENABLED", !0)};
|
|
264
264
|
}
|
|
265
265
|
~ .--DATEPICKER-fieldset {
|
|
266
|
-
${
|
|
267
|
-
${
|
|
266
|
+
${N(e, "ENABLED")};
|
|
267
|
+
${F(!0)};
|
|
268
268
|
}
|
|
269
269
|
|
|
270
270
|
// VALUE
|
|
271
271
|
&.--DATEPICKER-open {
|
|
272
272
|
~ .--DATEPICKER-label {
|
|
273
|
-
${
|
|
273
|
+
${P(e, "VALUE", !0)};
|
|
274
274
|
}
|
|
275
275
|
~ .--DATEPICKER-fieldset {
|
|
276
|
-
${
|
|
277
|
-
${
|
|
276
|
+
${N(e, "VALUE")};
|
|
277
|
+
${F(!0)};
|
|
278
278
|
}
|
|
279
279
|
}
|
|
280
280
|
|
|
281
281
|
// HOVER
|
|
282
282
|
&:hover {
|
|
283
283
|
~ .--DATEPICKER-label {
|
|
284
|
-
${
|
|
284
|
+
${P(e, "HOVER")};
|
|
285
285
|
}
|
|
286
286
|
~ .--DATEPICKER-fieldset {
|
|
287
|
-
${
|
|
287
|
+
${N(e, "HOVER")};
|
|
288
288
|
}
|
|
289
289
|
}
|
|
290
290
|
|
|
291
291
|
// FOCUS (typing in sub-inputs)
|
|
292
292
|
&:focus-within {
|
|
293
293
|
~ .--DATEPICKER-label {
|
|
294
|
-
${
|
|
294
|
+
${P(e, "FOCUS", !0)};
|
|
295
295
|
}
|
|
296
296
|
~ .--DATEPICKER-fieldset {
|
|
297
|
-
${
|
|
298
|
-
${
|
|
297
|
+
${N(e, "FOCUS")};
|
|
298
|
+
${F(!0)};
|
|
299
299
|
}
|
|
300
300
|
}
|
|
301
301
|
|
|
302
302
|
// ERROR
|
|
303
303
|
&.--DATEPICKER-error {
|
|
304
304
|
~ .--DATEPICKER-label {
|
|
305
|
-
${
|
|
305
|
+
${P(e, "ERROR")};
|
|
306
306
|
}
|
|
307
307
|
~ .--DATEPICKER-fieldset {
|
|
308
|
-
${
|
|
308
|
+
${N(e, "ERROR")};
|
|
309
309
|
}
|
|
310
310
|
}
|
|
311
311
|
|
|
312
312
|
// ERROR + VALUE
|
|
313
313
|
&.--DATEPICKER-error.--DATEPICKER-open {
|
|
314
314
|
~ .--DATEPICKER-label {
|
|
315
|
-
${
|
|
315
|
+
${P(e, "ERROR_VALUE")};
|
|
316
316
|
}
|
|
317
317
|
~ .--DATEPICKER-fieldset {
|
|
318
|
-
${
|
|
318
|
+
${N(e, "ERROR_VALUE")};
|
|
319
319
|
}
|
|
320
320
|
}
|
|
321
321
|
|
|
322
322
|
// ERROR + HOVER
|
|
323
323
|
&.--DATEPICKER-error:hover {
|
|
324
324
|
~ .--DATEPICKER-label {
|
|
325
|
-
${
|
|
325
|
+
${P(e, "ERROR_HOVER")};
|
|
326
326
|
}
|
|
327
327
|
~ .--DATEPICKER-fieldset {
|
|
328
|
-
${
|
|
328
|
+
${N(e, "ERROR_HOVER")};
|
|
329
329
|
}
|
|
330
330
|
}
|
|
331
331
|
|
|
332
332
|
// ERROR + FOCUS
|
|
333
333
|
&.--DATEPICKER-error:focus-within {
|
|
334
334
|
~ .--DATEPICKER-label {
|
|
335
|
-
${
|
|
335
|
+
${P(e, "ERROR_FOCUS")};
|
|
336
336
|
}
|
|
337
337
|
~ .--DATEPICKER-fieldset {
|
|
338
|
-
${
|
|
339
|
-
${
|
|
338
|
+
${N(e, "ERROR_FOCUS")};
|
|
339
|
+
${F(!0)};
|
|
340
340
|
}
|
|
341
341
|
}
|
|
342
342
|
|
|
@@ -354,10 +354,10 @@ var j = (e, t) => `
|
|
|
354
354
|
}
|
|
355
355
|
|
|
356
356
|
~ .--DATEPICKER-label {
|
|
357
|
-
${
|
|
357
|
+
${P(e, "DISABLED")};
|
|
358
358
|
}
|
|
359
359
|
~ .--DATEPICKER-fieldset {
|
|
360
|
-
${
|
|
360
|
+
${N(e, "DISABLED")};
|
|
361
361
|
}
|
|
362
362
|
}
|
|
363
363
|
|
|
@@ -498,169 +498,13 @@ var j = (e, t) => `
|
|
|
498
498
|
height: 16px;
|
|
499
499
|
}
|
|
500
500
|
}
|
|
501
|
-
`,
|
|
502
|
-
// BACKGROUNDS
|
|
503
|
-
.--ICONBUTTON-span {
|
|
504
|
-
${i(e, "background-color", `--ICONBUTTON-EVENTS-${t}-BACKGROUND-COLOR`)}
|
|
505
|
-
}
|
|
506
|
-
`, de = (e, t) => `
|
|
507
|
-
// SHADOWS
|
|
508
|
-
${i(e, "background-color", `--ICONBUTTON-EVENTS-${t}-SHADOW-COLOR`)}
|
|
509
|
-
`, fe = (e, t) => `
|
|
510
|
-
// UTILS
|
|
511
|
-
.--ICONBUTTON-span > span {
|
|
512
|
-
${i(e, "color", `--ICONBUTTON-EVENTS-${t}-ICON-COLOR`)}
|
|
513
|
-
}
|
|
514
|
-
`, pe = (e, t) => `
|
|
515
|
-
// BORDER
|
|
516
|
-
.--ICONBUTTON-span {
|
|
517
|
-
${i(e, "border-color", `--ICONBUTTON-EVENTS-${t}-BORDER-COLOR`)}
|
|
518
|
-
${i(e, "border-width", `--ICONBUTTON-EVENTS-${t}-BORDER-WIDTH`)}
|
|
519
|
-
${i(e, "border-style", `--ICONBUTTON-EVENTS-${t}-BORDER-STYLE`)}
|
|
520
|
-
}
|
|
521
|
-
`, me = (e, t) => `
|
|
522
|
-
// OUTLINE
|
|
523
|
-
.--ICONBUTTON-span {
|
|
524
|
-
${i(e, "outline-color", `--ICONBUTTON-EVENTS-${t}-OUTLINE-COLOR`)}
|
|
525
|
-
${i(e, "outline-width", `--ICONBUTTON-EVENTS-${t}-OUTLINE-WIDTH`)}
|
|
526
|
-
${i(e, "outline-style", `--ICONBUTTON-EVENTS-${t}-OUTLINE-STYLE`)}
|
|
527
|
-
${i(e, "outline-offset", `--ICONBUTTON-EVENTS-${t}-OUTLINE-OFFSET`)}
|
|
528
|
-
}
|
|
529
|
-
`, he = (e) => A`
|
|
530
|
-
&.--ICONBUTTON {
|
|
531
|
-
width: 24px;
|
|
532
|
-
height: 24px;
|
|
533
|
-
${i(e, "border-radius", "--ICONBUTTON-ROOT-BORDER-RADIUS")};
|
|
534
|
-
display: inline-flex;
|
|
535
|
-
align-items: center;
|
|
536
|
-
justify-content: center;
|
|
537
|
-
cursor: pointer;
|
|
538
|
-
vertical-align: middle;
|
|
539
|
-
box-sizing: content-box;
|
|
540
|
-
position: relative;
|
|
541
|
-
user-select: none;
|
|
542
|
-
padding: 0px;
|
|
543
|
-
box-sizing: border-box;
|
|
544
|
-
-webkit-tap-highlight-color: transparent;
|
|
545
|
-
isolation: isolate;
|
|
546
|
-
border: none;
|
|
547
|
-
background-color: transparent;
|
|
548
|
-
|
|
549
|
-
// ENABLED
|
|
550
|
-
${ue(e, "ENABLED")};
|
|
551
|
-
${pe(e, "ENABLED")};
|
|
552
|
-
${fe(e, "ENABLED")};
|
|
553
|
-
|
|
554
|
-
// HOVER
|
|
555
|
-
&:hover {
|
|
556
|
-
&:before {
|
|
557
|
-
opacity: 1;
|
|
558
|
-
${de(e, "HOVER")};
|
|
559
|
-
}
|
|
560
|
-
}
|
|
561
|
-
|
|
562
|
-
// ACTIVE
|
|
563
|
-
&.--ICONBUTTON-active,
|
|
564
|
-
&:active {
|
|
565
|
-
&:before {
|
|
566
|
-
opacity: 1;
|
|
567
|
-
${de(e, "ACTIVE")};
|
|
568
|
-
}
|
|
569
|
-
}
|
|
570
|
-
|
|
571
|
-
// FOCUS
|
|
572
|
-
&:focus-visible {
|
|
573
|
-
outline: none;
|
|
574
|
-
${me(e, "FOCUS")};
|
|
575
|
-
}
|
|
576
|
-
|
|
577
|
-
// DISABLED
|
|
578
|
-
&:disabled {
|
|
579
|
-
pointer-events: none;
|
|
580
|
-
${ue(e, "DISABLED")};
|
|
581
|
-
${pe(e, "DISABLED")};
|
|
582
|
-
${fe(e, "DISABLED")};
|
|
583
|
-
}
|
|
584
|
-
|
|
585
|
-
&.--ICONBUTTON-flipped {
|
|
586
|
-
.--ICONBUTTON-span {
|
|
587
|
-
> span {
|
|
588
|
-
rotate: 180deg !important;
|
|
589
|
-
}
|
|
590
|
-
}
|
|
591
|
-
}
|
|
592
|
-
|
|
593
|
-
.--ICONBUTTON-span {
|
|
594
|
-
width: 24px;
|
|
595
|
-
height: 24px;
|
|
596
|
-
display: flex;
|
|
597
|
-
justify-content: center;
|
|
598
|
-
align-items: center;
|
|
599
|
-
box-sizing: border-box;
|
|
600
|
-
${i(e, "border-radius", "--ICONBUTTON-ROOT-BORDER-RADIUS")};
|
|
601
|
-
|
|
602
|
-
> span {
|
|
603
|
-
rotate: 0deg;
|
|
604
|
-
transition: rotate 150ms ease-in-out;
|
|
605
|
-
position: absolute;
|
|
606
|
-
width: 100%;
|
|
607
|
-
height: auto;
|
|
608
|
-
z-index: 1;
|
|
609
|
-
}
|
|
610
|
-
}
|
|
611
|
-
|
|
612
|
-
&:before {
|
|
613
|
-
content: '';
|
|
614
|
-
position: absolute;
|
|
615
|
-
width: 32px;
|
|
616
|
-
height: 32px;
|
|
617
|
-
border-radius: 50%;
|
|
618
|
-
opacity: 0;
|
|
619
|
-
transition: opacity 150ms ease-in-out;
|
|
620
|
-
z-index: -1;
|
|
621
|
-
}
|
|
622
|
-
}
|
|
623
|
-
`, R = "--ICONBUTTON", ge = ({ className: e, style: n, icon: r, onClick: i, isFlipped: a, ...o }) => {
|
|
624
|
-
let [s, c] = k(!1);
|
|
625
|
-
return /* @__PURE__ */ t("button", {
|
|
626
|
-
className: [
|
|
627
|
-
R,
|
|
628
|
-
s ? `${R}-active` : "",
|
|
629
|
-
a ? `${R}-flipped` : "",
|
|
630
|
-
e
|
|
631
|
-
].join(" "),
|
|
632
|
-
css: he(n),
|
|
633
|
-
type: "button",
|
|
634
|
-
onClick: i,
|
|
635
|
-
onKeyDown: (e) => {
|
|
636
|
-
e.stopPropagation(), (e.key === "Enter" || e.key === "Space") && c(!0), o.onKeyDown?.(e);
|
|
637
|
-
},
|
|
638
|
-
onKeyUp: (e) => {
|
|
639
|
-
(e.key === "Enter" || e.key === "Space") && c(!1), o.onKeyUp?.(e);
|
|
640
|
-
},
|
|
641
|
-
onBlur: (e) => {
|
|
642
|
-
c(!1), o.onBlur?.(e);
|
|
643
|
-
},
|
|
644
|
-
"data-testid": R,
|
|
645
|
-
...o,
|
|
646
|
-
children: /* @__PURE__ */ t("span", {
|
|
647
|
-
className: `${R}-span`,
|
|
648
|
-
children: r
|
|
649
|
-
})
|
|
650
|
-
});
|
|
651
|
-
}, _e = ({ theme: n, variant: r = "default", ...i }) => {
|
|
652
|
-
let { componentStyles: a } = e([o.ICONBUTTON], n, r.toUpperCase());
|
|
653
|
-
return /* @__PURE__ */ t(ge, {
|
|
654
|
-
...i,
|
|
655
|
-
style: a
|
|
656
|
-
});
|
|
657
|
-
}, ve = (e, t) => `
|
|
501
|
+
`, fe = (e, t) => `
|
|
658
502
|
// OUTLINE
|
|
659
503
|
${i(e, "outline-color", `--DATEPICKERMENU-EVENTS-${t}-OUTLINE-COLOR`)}
|
|
660
504
|
${i(e, "outline-width", `--DATEPICKERMENU-EVENTS-${t}-OUTLINE-WIDTH`)}
|
|
661
505
|
${i(e, "outline-style", `--DATEPICKERMENU-EVENTS-${t}-OUTLINE-STYLE`)}
|
|
662
506
|
${i(e, "outline-offset", `--DATEPICKERMENU-EVENTS-${t}-OUTLINE-OFFSET`)}
|
|
663
|
-
`,
|
|
507
|
+
`, pe = (e) => k`
|
|
664
508
|
&.--DATEPICKERMENU {
|
|
665
509
|
z-index: 100;
|
|
666
510
|
position: absolute;
|
|
@@ -882,7 +726,7 @@ var j = (e, t) => `
|
|
|
882
726
|
&.--DATEPICKERMENU-focused,
|
|
883
727
|
&:focus-visible {
|
|
884
728
|
outline: none;
|
|
885
|
-
${
|
|
729
|
+
${fe(e, "FOCUS")};
|
|
886
730
|
}
|
|
887
731
|
|
|
888
732
|
&.--DATEPICKERMENU-today {
|
|
@@ -960,7 +804,7 @@ var j = (e, t) => `
|
|
|
960
804
|
&.--DATEPICKERMENU-focused,
|
|
961
805
|
&:focus-visible {
|
|
962
806
|
outline: none;
|
|
963
|
-
${
|
|
807
|
+
${fe(e, "FOCUS")};
|
|
964
808
|
}
|
|
965
809
|
|
|
966
810
|
&.--DATEPICKERMENU-selected {
|
|
@@ -987,66 +831,66 @@ var j = (e, t) => `
|
|
|
987
831
|
translate: 0 0;
|
|
988
832
|
}
|
|
989
833
|
}
|
|
990
|
-
`,
|
|
991
|
-
let [
|
|
992
|
-
|
|
834
|
+
`, L = "--DATEPICKERMENU", me = ae(({ isOpen: e, hasStaticOptions: i = !1, testId: s = `${L}-root`, monthLabel: c = "", yearLabel: l = "", onPrevMonth: u, onNextMonth: d, disablePrev: f = !1, disableNext: m = !1, weeks: ee = [], years: h = [], daysOfWeek: _ = [], selectedValue: v, format: y = "MM/dd/yyyy", today: b, focusedElement: x = -1, onSelectDay: te = () => {}, onSelectYear: S = () => {}, onMoveFocus: C = () => {}, onClose: ne = () => {}, style: re }, ie) => {
|
|
835
|
+
let [w, ae] = O(!1), [oe, E] = O(null), [k, ce] = O(0), [A, le] = O(!1), [j, ue] = O(-1), M = D({}), N = D({}), P = D(null), F = D(c + l);
|
|
836
|
+
T(() => {
|
|
993
837
|
if (!e) return;
|
|
994
|
-
let t =
|
|
995
|
-
t !==
|
|
838
|
+
let t = c + l;
|
|
839
|
+
t !== F.current && (F.current = t);
|
|
996
840
|
}, [
|
|
997
|
-
s,
|
|
998
841
|
c,
|
|
842
|
+
l,
|
|
999
843
|
e
|
|
1000
844
|
]);
|
|
1001
|
-
let
|
|
1002
|
-
|
|
1003
|
-
},
|
|
1004
|
-
|
|
845
|
+
let I = () => {
|
|
846
|
+
E("left"), ce((e) => e + 1), u();
|
|
847
|
+
}, de = () => {
|
|
848
|
+
E("right"), ce((e) => e + 1), d();
|
|
1005
849
|
};
|
|
1006
|
-
|
|
1007
|
-
if (!e ||
|
|
1008
|
-
let t =
|
|
850
|
+
T(() => {
|
|
851
|
+
if (!e || x < 0) return;
|
|
852
|
+
let t = M.current[x];
|
|
1009
853
|
if (!t) return;
|
|
1010
854
|
let n = document.activeElement;
|
|
1011
855
|
n && (n.tagName === "INPUT" || n.role === "combobox") || t.focus(), t.scrollIntoView?.({
|
|
1012
856
|
block: "nearest",
|
|
1013
857
|
inline: "nearest"
|
|
1014
858
|
});
|
|
1015
|
-
}, [
|
|
859
|
+
}, [x, e]), T(() => {
|
|
1016
860
|
if (!e) {
|
|
1017
|
-
let e = setTimeout(() =>
|
|
861
|
+
let e = setTimeout(() => ae(!1), 150);
|
|
1018
862
|
return () => clearTimeout(e);
|
|
1019
863
|
}
|
|
1020
|
-
}, [e]),
|
|
1021
|
-
if (!
|
|
1022
|
-
|
|
864
|
+
}, [e]), se(() => {
|
|
865
|
+
if (!w) {
|
|
866
|
+
ue(-1);
|
|
1023
867
|
return;
|
|
1024
868
|
}
|
|
1025
|
-
let e =
|
|
1026
|
-
|
|
1027
|
-
}, [
|
|
1028
|
-
if (!
|
|
1029
|
-
let e =
|
|
869
|
+
let e = v && p(v) ? v.getFullYear() : b?.getFullYear() ?? (/* @__PURE__ */ new Date()).getFullYear(), t = h.flat().findIndex((t) => t.label === String(e));
|
|
870
|
+
ue(t >= 0 ? t : 0);
|
|
871
|
+
}, [w]), se(() => {
|
|
872
|
+
if (!w || j < 0) return;
|
|
873
|
+
let e = N.current[j];
|
|
1030
874
|
e && (e.focus({ preventScroll: !0 }), e.scrollIntoView?.({
|
|
1031
875
|
block: "nearest",
|
|
1032
876
|
inline: "nearest"
|
|
1033
877
|
}));
|
|
1034
|
-
}, [
|
|
1035
|
-
let
|
|
878
|
+
}, [j, w]);
|
|
879
|
+
let fe = (e, t) => {
|
|
1036
880
|
if ([
|
|
1037
881
|
"ArrowLeft",
|
|
1038
882
|
"ArrowRight",
|
|
1039
883
|
"ArrowUp",
|
|
1040
884
|
"ArrowDown"
|
|
1041
885
|
].includes(e.key)) {
|
|
1042
|
-
e.preventDefault(), e.stopPropagation(),
|
|
886
|
+
e.preventDefault(), e.stopPropagation(), C(e.key);
|
|
1043
887
|
return;
|
|
1044
888
|
}
|
|
1045
|
-
e.key === "Enter" && (e.preventDefault(), e.stopPropagation(),
|
|
1046
|
-
},
|
|
889
|
+
e.key === "Enter" && (e.preventDefault(), e.stopPropagation(), te(t, !0));
|
|
890
|
+
}, me = (e, t) => {
|
|
1047
891
|
let n = e.querySelector(t);
|
|
1048
892
|
return n ? n.tagName === "BUTTON" ? n : n.querySelector("button") : null;
|
|
1049
|
-
},
|
|
893
|
+
}, he = (e) => {
|
|
1050
894
|
let t = h[0]?.length ?? 4, n = {
|
|
1051
895
|
ArrowRight: 1,
|
|
1052
896
|
ArrowLeft: -1,
|
|
@@ -1054,25 +898,25 @@ var j = (e, t) => `
|
|
|
1054
898
|
ArrowUp: -t
|
|
1055
899
|
}[e];
|
|
1056
900
|
if (!n) return;
|
|
1057
|
-
let r =
|
|
1058
|
-
r < 0 || r >= h.flat().length ||
|
|
1059
|
-
},
|
|
1060
|
-
let t =
|
|
901
|
+
let r = j + n;
|
|
902
|
+
r < 0 || r >= h.flat().length || ue(r);
|
|
903
|
+
}, R = (e) => {
|
|
904
|
+
let t = P.current;
|
|
1061
905
|
if (!t) return;
|
|
1062
|
-
let n =
|
|
906
|
+
let n = me(t, `.${L}-yearArrow`), r = Array.from(t.querySelectorAll(`.${L}-navArrow`)), i = w ? null : r[0]?.tagName === "BUTTON" ? r[0] : r[0]?.querySelector("button") ?? null, a = w ? null : r[1]?.tagName === "BUTTON" ? r[1] : r[1]?.querySelector("button") ?? null, o = !w && x >= 0 ? M.current[x] ?? null : null, s = w && j >= 0 ? N.current[j] ?? null : null, c = w ? [n, s].filter((e) => e !== null) : [
|
|
1063
907
|
n,
|
|
1064
908
|
i,
|
|
1065
909
|
a,
|
|
1066
910
|
o
|
|
1067
911
|
].filter((e) => e !== null);
|
|
1068
912
|
c.length !== 0 && c[(c.indexOf(document.activeElement) + (e ? -1 : 1) + c.length) % c.length]?.focus();
|
|
1069
|
-
},
|
|
913
|
+
}, ge = (e) => {
|
|
1070
914
|
if (e.key === "Escape") {
|
|
1071
|
-
e.preventDefault(), e.stopPropagation(),
|
|
915
|
+
e.preventDefault(), e.stopPropagation(), ne();
|
|
1072
916
|
return;
|
|
1073
917
|
}
|
|
1074
918
|
if (e.key === "Tab") {
|
|
1075
|
-
e.preventDefault(), e.stopPropagation(),
|
|
919
|
+
e.preventDefault(), e.stopPropagation(), R(e.shiftKey);
|
|
1076
920
|
return;
|
|
1077
921
|
}
|
|
1078
922
|
[
|
|
@@ -1080,107 +924,107 @@ var j = (e, t) => `
|
|
|
1080
924
|
"ArrowRight",
|
|
1081
925
|
"ArrowUp",
|
|
1082
926
|
"ArrowDown"
|
|
1083
|
-
].includes(e.key) && (
|
|
1084
|
-
},
|
|
927
|
+
].includes(e.key) && (w ? (e.preventDefault(), e.stopPropagation(), he(e.key)) : Object.values(M.current).some((e) => e === document.activeElement) || (e.preventDefault(), e.stopPropagation(), C(e.key)));
|
|
928
|
+
}, _e = v && p(v) ? g(v, y) : null, z = b && p(b) ? g(b, y) : null;
|
|
1085
929
|
return /* @__PURE__ */ t("div", {
|
|
1086
|
-
ref:
|
|
930
|
+
ref: ie,
|
|
1087
931
|
children: /* @__PURE__ */ n("div", {
|
|
1088
|
-
ref:
|
|
932
|
+
ref: P,
|
|
1089
933
|
className: [
|
|
1090
|
-
|
|
1091
|
-
e ? `${
|
|
1092
|
-
i ? `${
|
|
934
|
+
L,
|
|
935
|
+
e ? `${L}-open` : "",
|
|
936
|
+
i ? `${L}-static` : ""
|
|
1093
937
|
].filter(Boolean).join(" "),
|
|
1094
|
-
css:
|
|
938
|
+
css: pe(re),
|
|
1095
939
|
role: "dialog",
|
|
1096
940
|
"aria-label": "Date picker calendar",
|
|
1097
|
-
"data-testid":
|
|
1098
|
-
onKeyDownCapture:
|
|
941
|
+
"data-testid": s,
|
|
942
|
+
onKeyDownCapture: ge,
|
|
1099
943
|
children: [/* @__PURE__ */ n("div", {
|
|
1100
|
-
className: `${
|
|
944
|
+
className: `${L}-header`,
|
|
1101
945
|
children: [/* @__PURE__ */ n("div", {
|
|
1102
|
-
className: `${
|
|
946
|
+
className: `${L}-yearToggle`,
|
|
1103
947
|
children: [/* @__PURE__ */ t("div", {
|
|
1104
|
-
className: `${
|
|
948
|
+
className: `${L}-labelWrap`,
|
|
1105
949
|
children: /* @__PURE__ */ n("span", {
|
|
1106
|
-
className: `${
|
|
950
|
+
className: `${L}-headerLabel`,
|
|
1107
951
|
children: [
|
|
1108
|
-
|
|
952
|
+
c,
|
|
1109
953
|
" ",
|
|
1110
954
|
/* @__PURE__ */ t("span", {
|
|
1111
|
-
className: `${
|
|
1112
|
-
children:
|
|
955
|
+
className: `${L}-yearLabel`,
|
|
956
|
+
children: l
|
|
1113
957
|
})
|
|
1114
958
|
]
|
|
1115
959
|
})
|
|
1116
|
-
}), /* @__PURE__ */ t(
|
|
1117
|
-
icon: /* @__PURE__ */ t(
|
|
1118
|
-
onClick: () =>
|
|
1119
|
-
className: `${
|
|
1120
|
-
isFlipped: !
|
|
1121
|
-
"aria-label":
|
|
960
|
+
}), /* @__PURE__ */ t(a, {
|
|
961
|
+
icon: /* @__PURE__ */ t(o, { name: "arrow_drop_up" }),
|
|
962
|
+
onClick: () => ae((e) => !e),
|
|
963
|
+
className: `${L}-yearArrow`,
|
|
964
|
+
isFlipped: !w,
|
|
965
|
+
"aria-label": w ? "Close year selector" : "Open year selector",
|
|
1122
966
|
tabIndex: -1,
|
|
1123
|
-
onFocus: () =>
|
|
967
|
+
onFocus: () => le(!0)
|
|
1124
968
|
})]
|
|
1125
|
-
}), !
|
|
1126
|
-
className: `${
|
|
1127
|
-
children: [/* @__PURE__ */ t(
|
|
1128
|
-
icon: /* @__PURE__ */ t(
|
|
1129
|
-
onClick:
|
|
1130
|
-
className: `${
|
|
1131
|
-
disabled:
|
|
969
|
+
}), !w && /* @__PURE__ */ n("div", {
|
|
970
|
+
className: `${L}-monthNav`,
|
|
971
|
+
children: [/* @__PURE__ */ t(a, {
|
|
972
|
+
icon: /* @__PURE__ */ t(o, { name: "keyboard_arrow_left" }),
|
|
973
|
+
onClick: I,
|
|
974
|
+
className: `${L}-navArrow`,
|
|
975
|
+
disabled: f,
|
|
1132
976
|
"aria-label": "Previous month",
|
|
1133
977
|
tabIndex: -1,
|
|
1134
|
-
onFocus: () =>
|
|
1135
|
-
}), /* @__PURE__ */ t(
|
|
1136
|
-
icon: /* @__PURE__ */ t(
|
|
1137
|
-
onClick:
|
|
1138
|
-
className: `${
|
|
1139
|
-
disabled:
|
|
978
|
+
onFocus: () => le(!0)
|
|
979
|
+
}), /* @__PURE__ */ t(a, {
|
|
980
|
+
icon: /* @__PURE__ */ t(o, { name: "keyboard_arrow_right" }),
|
|
981
|
+
onClick: de,
|
|
982
|
+
className: `${L}-navArrow`,
|
|
983
|
+
disabled: m,
|
|
1140
984
|
"aria-label": "Next month",
|
|
1141
985
|
tabIndex: -1,
|
|
1142
|
-
onFocus: () =>
|
|
986
|
+
onFocus: () => le(!0)
|
|
1143
987
|
})]
|
|
1144
988
|
})]
|
|
1145
989
|
}), /* @__PURE__ */ n("div", {
|
|
1146
|
-
className: [`${
|
|
1147
|
-
children: [!
|
|
1148
|
-
className: `${
|
|
1149
|
-
children:
|
|
1150
|
-
className: `${
|
|
990
|
+
className: [`${L}-body`, w ? `${L}-yearBody` : ""].filter(Boolean).join(" "),
|
|
991
|
+
children: [!w && /* @__PURE__ */ n(r, { children: [/* @__PURE__ */ t("div", {
|
|
992
|
+
className: `${L}-weekRow`,
|
|
993
|
+
children: _.map((e, n) => /* @__PURE__ */ t("span", {
|
|
994
|
+
className: `${L}-dayCell`,
|
|
1151
995
|
children: e
|
|
1152
996
|
}, `header-${n}`))
|
|
1153
997
|
}), /* @__PURE__ */ t("div", {
|
|
1154
|
-
className: `${
|
|
998
|
+
className: `${L}-gridViewport`,
|
|
1155
999
|
children: /* @__PURE__ */ t("div", {
|
|
1156
1000
|
className: [
|
|
1157
|
-
`${
|
|
1158
|
-
|
|
1159
|
-
|
|
1001
|
+
`${L}-calendarGrid`,
|
|
1002
|
+
oe === "left" ? `${L}-slideLeft` : "",
|
|
1003
|
+
oe === "right" ? `${L}-slideRight` : ""
|
|
1160
1004
|
].filter(Boolean).join(" "),
|
|
1161
|
-
onAnimationEnd: () =>
|
|
1005
|
+
onAnimationEnd: () => E(null),
|
|
1162
1006
|
children: (() => {
|
|
1163
1007
|
let n = 0;
|
|
1164
|
-
return
|
|
1165
|
-
className: `${
|
|
1008
|
+
return ee.map((r, i) => /* @__PURE__ */ t("div", {
|
|
1009
|
+
className: `${L}-weekRow`,
|
|
1166
1010
|
children: r.map((r, a) => {
|
|
1167
|
-
if (!r.isDate) return /* @__PURE__ */ t("span", { className: `${
|
|
1168
|
-
let o = n++, s = !!(
|
|
1011
|
+
if (!r.isDate) return /* @__PURE__ */ t("span", { className: `${L}-dayCell` }, `blank-${i}-${a}`);
|
|
1012
|
+
let o = n++, s = !!(_e && r.value === _e && e), c = r.value === z, l = x === o && e && !A;
|
|
1169
1013
|
return /* @__PURE__ */ t("button", {
|
|
1170
|
-
id: `${
|
|
1014
|
+
id: `${L}-day-${o}`,
|
|
1171
1015
|
ref: (e) => {
|
|
1172
|
-
|
|
1016
|
+
M.current[o] = e;
|
|
1173
1017
|
},
|
|
1174
1018
|
className: [
|
|
1175
|
-
`${
|
|
1176
|
-
s ? `${
|
|
1177
|
-
c ? `${
|
|
1178
|
-
l ? `${
|
|
1019
|
+
`${L}-dayBtn`,
|
|
1020
|
+
s ? `${L}-selected` : "",
|
|
1021
|
+
c ? `${L}-today` : "",
|
|
1022
|
+
l ? `${L}-focused` : ""
|
|
1179
1023
|
].filter(Boolean).join(" "),
|
|
1180
1024
|
type: "button",
|
|
1181
|
-
onClick: () =>
|
|
1182
|
-
onFocus: () =>
|
|
1183
|
-
onKeyDown: (e) =>
|
|
1025
|
+
onClick: () => te(r.value),
|
|
1026
|
+
onFocus: () => le(!1),
|
|
1027
|
+
onKeyDown: (e) => fe(e, r.value),
|
|
1184
1028
|
disabled: r.isDisabled,
|
|
1185
1029
|
role: "option",
|
|
1186
1030
|
"aria-selected": s,
|
|
@@ -1190,30 +1034,30 @@ var j = (e, t) => `
|
|
|
1190
1034
|
})
|
|
1191
1035
|
}, `week-${i}`));
|
|
1192
1036
|
})()
|
|
1193
|
-
},
|
|
1194
|
-
})] }),
|
|
1195
|
-
className: `${
|
|
1037
|
+
}, k)
|
|
1038
|
+
})] }), w && /* @__PURE__ */ t("div", {
|
|
1039
|
+
className: `${L}-yearScrollWrapper`,
|
|
1196
1040
|
children: (() => {
|
|
1197
1041
|
let e = 0;
|
|
1198
1042
|
return h.map((n, r) => /* @__PURE__ */ t("div", {
|
|
1199
|
-
className: `${
|
|
1043
|
+
className: `${L}-weekRow`,
|
|
1200
1044
|
children: n.map((n) => {
|
|
1201
|
-
let r = e++, i =
|
|
1045
|
+
let r = e++, i = v && p(v) ? n.label === g(v, "yyyy") : !1, a = j === r && !A;
|
|
1202
1046
|
return /* @__PURE__ */ t("button", {
|
|
1203
1047
|
ref: (e) => {
|
|
1204
|
-
|
|
1048
|
+
N.current[r] = e;
|
|
1205
1049
|
},
|
|
1206
1050
|
className: [
|
|
1207
|
-
`${
|
|
1208
|
-
i ? `${
|
|
1209
|
-
a ? `${
|
|
1051
|
+
`${L}-yearBtn`,
|
|
1052
|
+
i ? `${L}-selected` : "",
|
|
1053
|
+
a ? `${L}-focused` : ""
|
|
1210
1054
|
].filter(Boolean).join(" "),
|
|
1211
1055
|
type: "button",
|
|
1212
1056
|
tabIndex: -1,
|
|
1213
1057
|
onClick: () => {
|
|
1214
|
-
S(n.value),
|
|
1058
|
+
S(n.value), ae(!1);
|
|
1215
1059
|
},
|
|
1216
|
-
onFocus: () =>
|
|
1060
|
+
onFocus: () => le(!1),
|
|
1217
1061
|
"aria-selected": i,
|
|
1218
1062
|
children: n.label
|
|
1219
1063
|
}, n.value);
|
|
@@ -1225,142 +1069,142 @@ var j = (e, t) => `
|
|
|
1225
1069
|
})
|
|
1226
1070
|
});
|
|
1227
1071
|
});
|
|
1228
|
-
|
|
1072
|
+
me.displayName = "DatePickerMenu";
|
|
1229
1073
|
//#endregion
|
|
1230
1074
|
//#region src/components/atoms/DatePicker/DatePickerMenu/index.tsx
|
|
1231
|
-
var
|
|
1232
|
-
let { componentStyles: a } = e([
|
|
1233
|
-
return /* @__PURE__ */ t(
|
|
1075
|
+
var he = w.forwardRef(({ theme: n, ...r }, i) => {
|
|
1076
|
+
let { componentStyles: a } = e([s.DATEPICKERMENU, s.DATEPICKER], n);
|
|
1077
|
+
return /* @__PURE__ */ t(me, {
|
|
1234
1078
|
...r,
|
|
1235
1079
|
style: a,
|
|
1236
1080
|
ref: i
|
|
1237
1081
|
});
|
|
1238
1082
|
});
|
|
1239
|
-
|
|
1083
|
+
he.displayName = "DatePickerMenu";
|
|
1240
1084
|
//#endregion
|
|
1241
1085
|
//#region src/components/atoms/DatePicker/DatePicker.tsx
|
|
1242
|
-
var
|
|
1243
|
-
let
|
|
1086
|
+
var R = "--DATEPICKER", ge = ({ name: e, label: r, control: i, language: s = ee(), minDate: c, maxDate: ie, disabled: w, disableFuture: ae, disablePast: oe, hasStaticOptions: se = !1, showErrorText: k = !0, hasPadding: A = !1, helperText: le, style: j, className: ue }) => {
|
|
1087
|
+
let M = te[s].format, N = E(() => l(/* @__PURE__ */ new Date()), []), P = s === "en", { field: F, fieldState: I } = ce({
|
|
1244
1088
|
control: i,
|
|
1245
1089
|
name: e
|
|
1246
|
-
}),
|
|
1090
|
+
}), fe = I.error, pe = p(F.value) ? f(F.value) : {
|
|
1247
1091
|
day: "",
|
|
1248
1092
|
month: "",
|
|
1249
1093
|
year: ""
|
|
1250
|
-
}, [
|
|
1251
|
-
minDate:
|
|
1252
|
-
maxDate:
|
|
1253
|
-
disableFuture:
|
|
1254
|
-
disablePast:
|
|
1255
|
-
today:
|
|
1094
|
+
}, [L, me] = O(pe.day), [ge, _e] = O(pe.month), [z, B] = O(pe.year), [V, ve] = O(!1), [H, ye] = O(-1), [U, be] = O(() => p(F.value) ? F.value : N), xe = D(null), Se = D(null), Ce = D(null), we = D(null), W = D(null), G = D(null), K = D(""), Te = D(""), q = D(""), Ee = V || !!(L || ge || z), J = E(() => u(U, M, s, {
|
|
1095
|
+
minDate: c,
|
|
1096
|
+
maxDate: ie,
|
|
1097
|
+
disableFuture: ae,
|
|
1098
|
+
disablePast: oe,
|
|
1099
|
+
today: N
|
|
1256
1100
|
}), [
|
|
1257
|
-
|
|
1258
|
-
o,
|
|
1101
|
+
U,
|
|
1259
1102
|
s,
|
|
1260
|
-
|
|
1261
|
-
re,
|
|
1103
|
+
c,
|
|
1262
1104
|
ie,
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1105
|
+
ae,
|
|
1106
|
+
oe,
|
|
1107
|
+
N,
|
|
1108
|
+
M
|
|
1109
|
+
]), De = E(() => J.flat().filter((e) => e.isDate), [J]), Oe = E(() => v(M, 1900, 200, 4), [M]), ke = te[s].daysOfWeek.map((e) => _[s][e]), Ae = b(U, s), je = g(U, "yyyy");
|
|
1110
|
+
T(() => {
|
|
1111
|
+
if (!L && !ge && !z) return;
|
|
1112
|
+
let e = L || "01", t = ge || "01", n = z || "2000", r = y(P ? `${t}/${e}/${n}` : `${e}/${t}/${n}`, M, /* @__PURE__ */ new Date());
|
|
1113
|
+
F.onChange(r), d(r) && be(r), fe && F.onBlur();
|
|
1270
1114
|
}, [
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
]),
|
|
1275
|
-
ref:
|
|
1115
|
+
L,
|
|
1116
|
+
ge,
|
|
1117
|
+
z
|
|
1118
|
+
]), re({
|
|
1119
|
+
ref: Se,
|
|
1276
1120
|
onAction: () => {
|
|
1277
|
-
|
|
1121
|
+
ve(!1), F.onBlur();
|
|
1278
1122
|
},
|
|
1279
|
-
isActive:
|
|
1280
|
-
exceptRef:
|
|
1123
|
+
isActive: V,
|
|
1124
|
+
exceptRef: xe
|
|
1281
1125
|
});
|
|
1282
|
-
let
|
|
1283
|
-
let t = e.relatedTarget, n =
|
|
1284
|
-
n || r || (
|
|
1285
|
-
},
|
|
1126
|
+
let Me = (e) => {
|
|
1127
|
+
let t = e.relatedTarget, n = xe.current?.contains(t), r = Se.current?.contains(t);
|
|
1128
|
+
n || r || (ve(!1), F.onBlur());
|
|
1129
|
+
}, Ne = (e) => requestAnimationFrame(() => e.current?.focus()), Pe = (e) => {
|
|
1286
1130
|
if ([
|
|
1287
1131
|
"ArrowLeft",
|
|
1288
1132
|
"ArrowRight",
|
|
1289
1133
|
"ArrowUp",
|
|
1290
1134
|
"ArrowDown"
|
|
1291
|
-
].includes(e.key) &&
|
|
1292
|
-
e.preventDefault(), e.stopPropagation(),
|
|
1135
|
+
].includes(e.key) && V) {
|
|
1136
|
+
e.preventDefault(), e.stopPropagation(), Y(e.key);
|
|
1293
1137
|
return;
|
|
1294
1138
|
}
|
|
1295
1139
|
if (e.key === "Backspace" || e.key === "Delete") {
|
|
1296
|
-
e.preventDefault(),
|
|
1140
|
+
e.preventDefault(), me(""), K.current = "";
|
|
1297
1141
|
return;
|
|
1298
1142
|
}
|
|
1299
1143
|
if (!/^\d$/.test(e.key)) return;
|
|
1300
|
-
e.preventDefault(),
|
|
1301
|
-
let t = parseInt(
|
|
1144
|
+
e.preventDefault(), K.current = (K.current + e.key).slice(-2);
|
|
1145
|
+
let t = parseInt(K.current, 10);
|
|
1302
1146
|
if (t === 0) {
|
|
1303
|
-
|
|
1147
|
+
me("01"), K.current = "";
|
|
1304
1148
|
return;
|
|
1305
1149
|
}
|
|
1306
|
-
|
|
1307
|
-
},
|
|
1150
|
+
me(String(Math.min(t, 31)).padStart(2, "0")), (t > 3 || K.current.length >= 2) && (K.current = "", Ne(P ? G : W));
|
|
1151
|
+
}, Fe = (e) => {
|
|
1308
1152
|
if ([
|
|
1309
1153
|
"ArrowLeft",
|
|
1310
1154
|
"ArrowRight",
|
|
1311
1155
|
"ArrowUp",
|
|
1312
1156
|
"ArrowDown"
|
|
1313
|
-
].includes(e.key) &&
|
|
1314
|
-
e.preventDefault(), e.stopPropagation(),
|
|
1157
|
+
].includes(e.key) && V) {
|
|
1158
|
+
e.preventDefault(), e.stopPropagation(), Y(e.key);
|
|
1315
1159
|
return;
|
|
1316
1160
|
}
|
|
1317
1161
|
if (e.key === "Backspace" || e.key === "Delete") {
|
|
1318
|
-
e.preventDefault(),
|
|
1162
|
+
e.preventDefault(), _e(""), Te.current = "";
|
|
1319
1163
|
return;
|
|
1320
1164
|
}
|
|
1321
1165
|
if (!/^\d$/.test(e.key)) return;
|
|
1322
|
-
e.preventDefault(),
|
|
1323
|
-
let t = parseInt(
|
|
1166
|
+
e.preventDefault(), Te.current = (Te.current + e.key).slice(-2);
|
|
1167
|
+
let t = parseInt(Te.current, 10);
|
|
1324
1168
|
if (t === 0) {
|
|
1325
|
-
|
|
1169
|
+
_e("01"), Te.current = "";
|
|
1326
1170
|
return;
|
|
1327
1171
|
}
|
|
1328
|
-
|
|
1329
|
-
},
|
|
1172
|
+
_e(String(Math.min(t, 12)).padStart(2, "0")), (t > 1 || Te.current.length >= 2) && (Te.current = "", Ne(P ? we : G));
|
|
1173
|
+
}, Ie = (e) => {
|
|
1330
1174
|
if ([
|
|
1331
1175
|
"ArrowLeft",
|
|
1332
1176
|
"ArrowRight",
|
|
1333
1177
|
"ArrowUp",
|
|
1334
1178
|
"ArrowDown"
|
|
1335
|
-
].includes(e.key) &&
|
|
1336
|
-
e.preventDefault(), e.stopPropagation(),
|
|
1179
|
+
].includes(e.key) && V) {
|
|
1180
|
+
e.preventDefault(), e.stopPropagation(), Y(e.key);
|
|
1337
1181
|
return;
|
|
1338
1182
|
}
|
|
1339
1183
|
if (e.key === "Backspace" || e.key === "Delete") {
|
|
1340
|
-
e.preventDefault(),
|
|
1184
|
+
e.preventDefault(), B(""), q.current = "";
|
|
1341
1185
|
return;
|
|
1342
1186
|
}
|
|
1343
|
-
/^\d$/.test(e.key) && (e.preventDefault(),
|
|
1344
|
-
},
|
|
1345
|
-
if (
|
|
1346
|
-
let e =
|
|
1347
|
-
|
|
1348
|
-
},
|
|
1349
|
-
|
|
1350
|
-
},
|
|
1351
|
-
|
|
1352
|
-
},
|
|
1353
|
-
minDate:
|
|
1354
|
-
disablePast:
|
|
1355
|
-
today:
|
|
1356
|
-
format:
|
|
1357
|
-
}),
|
|
1358
|
-
maxDate:
|
|
1359
|
-
disableFuture:
|
|
1360
|
-
today:
|
|
1361
|
-
format:
|
|
1362
|
-
}),
|
|
1363
|
-
if (!
|
|
1187
|
+
/^\d$/.test(e.key) && (e.preventDefault(), q.current = (q.current + e.key).slice(-4), B(String(parseInt(q.current, 10)).padStart(4, "0")));
|
|
1188
|
+
}, Le = () => {
|
|
1189
|
+
if (w) return;
|
|
1190
|
+
let e = d(F.value) ? F.value : N;
|
|
1191
|
+
be(e), ye(e.getDate() - 1), ve(!0);
|
|
1192
|
+
}, Re = () => ve(!1), ze = () => V ? Re() : Le(), Be = () => {
|
|
1193
|
+
be((e) => C(e, -1)), ye(-1);
|
|
1194
|
+
}, Ve = () => {
|
|
1195
|
+
be((e) => C(e, 1)), ye(-1);
|
|
1196
|
+
}, He = S(U, {
|
|
1197
|
+
minDate: c,
|
|
1198
|
+
disablePast: oe,
|
|
1199
|
+
today: N,
|
|
1200
|
+
format: M
|
|
1201
|
+
}), Ue = h(U, {
|
|
1202
|
+
maxDate: ie,
|
|
1203
|
+
disableFuture: ae,
|
|
1204
|
+
today: N,
|
|
1205
|
+
format: M
|
|
1206
|
+
}), Y = (e) => {
|
|
1207
|
+
if (!V) return;
|
|
1364
1208
|
let t = {
|
|
1365
1209
|
ArrowRight: 1,
|
|
1366
1210
|
ArrowLeft: -1,
|
|
@@ -1368,234 +1212,234 @@ var B = "--DATEPICKER", Se = ({ name: e, label: r, control: i, language: o = m()
|
|
|
1368
1212
|
ArrowUp: -7
|
|
1369
1213
|
}[e];
|
|
1370
1214
|
if (!t) return;
|
|
1371
|
-
if (
|
|
1372
|
-
|
|
1215
|
+
if (H < 0) {
|
|
1216
|
+
De.length > 0 && ye(0);
|
|
1373
1217
|
return;
|
|
1374
1218
|
}
|
|
1375
|
-
let n =
|
|
1219
|
+
let n = De[H];
|
|
1376
1220
|
if (!n) return;
|
|
1377
|
-
let r =
|
|
1378
|
-
if (
|
|
1379
|
-
minDate:
|
|
1380
|
-
maxDate:
|
|
1381
|
-
disableFuture:
|
|
1382
|
-
disablePast:
|
|
1383
|
-
today:
|
|
1221
|
+
let r = y(n.value, M, /* @__PURE__ */ new Date()), i = ne(r, t);
|
|
1222
|
+
if (x(i, {
|
|
1223
|
+
minDate: c,
|
|
1224
|
+
maxDate: ie,
|
|
1225
|
+
disableFuture: ae,
|
|
1226
|
+
disablePast: oe,
|
|
1227
|
+
today: N
|
|
1384
1228
|
})) return;
|
|
1385
1229
|
if (i.getMonth() !== r.getMonth() || i.getFullYear() !== r.getFullYear()) {
|
|
1386
|
-
if (t > 0 &&
|
|
1387
|
-
|
|
1230
|
+
if (t > 0 && Ue || t < 0 && He) return;
|
|
1231
|
+
be(m(i)), ye(i.getDate() - 1);
|
|
1388
1232
|
return;
|
|
1389
1233
|
}
|
|
1390
|
-
let a =
|
|
1391
|
-
a >= 0 &&
|
|
1392
|
-
},
|
|
1393
|
-
let n =
|
|
1394
|
-
|
|
1395
|
-
let r =
|
|
1396
|
-
|
|
1397
|
-
},
|
|
1398
|
-
let t =
|
|
1234
|
+
let a = De.findIndex((e) => e.value === g(i, M));
|
|
1235
|
+
a >= 0 && ye(a);
|
|
1236
|
+
}, We = (e, t) => {
|
|
1237
|
+
let n = y(e, M, /* @__PURE__ */ new Date());
|
|
1238
|
+
F.onChange(n);
|
|
1239
|
+
let r = f(n);
|
|
1240
|
+
me(r.day), _e(r.month), B(r.year), ve(!1), t && requestAnimationFrame(() => Ce.current?.querySelector("button")?.focus());
|
|
1241
|
+
}, Ge = (e) => {
|
|
1242
|
+
let t = y(e, M, /* @__PURE__ */ new Date()), n = d(F.value) ? F.value : N, r = new Date(n);
|
|
1399
1243
|
r.setFullYear(t.getFullYear());
|
|
1400
|
-
let i =
|
|
1401
|
-
|
|
1402
|
-
let a =
|
|
1403
|
-
|
|
1404
|
-
},
|
|
1244
|
+
let i = y(g(r, M), M, /* @__PURE__ */ new Date());
|
|
1245
|
+
F.onChange(i);
|
|
1246
|
+
let a = f(i);
|
|
1247
|
+
me(a.day), _e(a.month), B(a.year), be(i);
|
|
1248
|
+
}, Ke = (e) => {
|
|
1405
1249
|
if (e.key === "Tab") {
|
|
1406
|
-
|
|
1250
|
+
Re();
|
|
1407
1251
|
return;
|
|
1408
1252
|
}
|
|
1409
1253
|
if (e.key === "Escape") {
|
|
1410
|
-
|
|
1254
|
+
Re();
|
|
1411
1255
|
return;
|
|
1412
1256
|
}
|
|
1413
|
-
e.key === "Enter" &&
|
|
1257
|
+
e.key === "Enter" && V && (e.preventDefault(), H >= 0 && De[H] && !De[H].isDisabled && We(De[H].value)), [
|
|
1414
1258
|
"ArrowLeft",
|
|
1415
1259
|
"ArrowRight",
|
|
1416
1260
|
"ArrowUp",
|
|
1417
1261
|
"ArrowDown"
|
|
1418
|
-
].includes(e.key) &&
|
|
1419
|
-
},
|
|
1420
|
-
|
|
1262
|
+
].includes(e.key) && V && (e.preventDefault(), Y(e.key));
|
|
1263
|
+
}, qe = P ? W : we, Je = P ? "MM" : "DD", Ye = P ? ge : L, Xe = P ? Fe : Pe, Ze = P ? () => {
|
|
1264
|
+
Te.current = "";
|
|
1421
1265
|
} : () => {
|
|
1422
|
-
|
|
1423
|
-
},
|
|
1424
|
-
|
|
1266
|
+
K.current = "";
|
|
1267
|
+
}, X = P ? we : W, Qe = P ? "DD" : "MM", $e = P ? L : ge, Z = P ? Pe : Fe, et = P ? () => {
|
|
1268
|
+
K.current = "";
|
|
1425
1269
|
} : () => {
|
|
1426
|
-
|
|
1270
|
+
Te.current = "";
|
|
1427
1271
|
};
|
|
1428
1272
|
return /* @__PURE__ */ n("div", {
|
|
1429
1273
|
className: [
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1274
|
+
R,
|
|
1275
|
+
A ? `${R}-paddingBottom` : "",
|
|
1276
|
+
ue || ""
|
|
1433
1277
|
].join(" "),
|
|
1434
|
-
css:
|
|
1435
|
-
"data-testid":
|
|
1278
|
+
css: de(j),
|
|
1279
|
+
"data-testid": R,
|
|
1436
1280
|
children: [
|
|
1437
1281
|
/* @__PURE__ */ n("div", {
|
|
1438
|
-
ref:
|
|
1439
|
-
className: `${
|
|
1440
|
-
onBlur:
|
|
1441
|
-
onKeyDown:
|
|
1282
|
+
ref: xe,
|
|
1283
|
+
className: `${R}-container`,
|
|
1284
|
+
onBlur: Me,
|
|
1285
|
+
onKeyDown: Ke,
|
|
1442
1286
|
children: [
|
|
1443
1287
|
/* @__PURE__ */ n("div", {
|
|
1444
1288
|
className: [
|
|
1445
|
-
`${
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1289
|
+
`${R}-fieldRow`,
|
|
1290
|
+
Ee ? `${R}-open` : "",
|
|
1291
|
+
fe ? `${R}-error` : "",
|
|
1292
|
+
w ? `${R}-disabled` : ""
|
|
1449
1293
|
].join(" "),
|
|
1450
1294
|
onClick: (e) => {
|
|
1451
|
-
e.target === e.currentTarget &&
|
|
1295
|
+
e.target === e.currentTarget && qe.current?.focus();
|
|
1452
1296
|
},
|
|
1453
|
-
"data-testid": `${
|
|
1297
|
+
"data-testid": `${R}-fieldRow`,
|
|
1454
1298
|
children: [
|
|
1455
1299
|
/* @__PURE__ */ t("span", {
|
|
1456
|
-
ref:
|
|
1300
|
+
ref: qe,
|
|
1457
1301
|
role: "spinbutton",
|
|
1458
|
-
"aria-label":
|
|
1459
|
-
"aria-valuenow": parseInt(
|
|
1302
|
+
"aria-label": P ? "Month" : "Day",
|
|
1303
|
+
"aria-valuenow": parseInt(Ye) || void 0,
|
|
1460
1304
|
"aria-valuemin": 1,
|
|
1461
|
-
"aria-valuemax":
|
|
1462
|
-
"aria-valuetext":
|
|
1463
|
-
className: [`${
|
|
1464
|
-
tabIndex:
|
|
1465
|
-
onKeyDown:
|
|
1466
|
-
onFocus:
|
|
1467
|
-
"data-testid": `${
|
|
1468
|
-
children:
|
|
1305
|
+
"aria-valuemax": P ? 12 : 31,
|
|
1306
|
+
"aria-valuetext": Ye || Je,
|
|
1307
|
+
className: [`${R}-partInput`, Ye ? "" : `${R}-placeholder`].filter(Boolean).join(" "),
|
|
1308
|
+
tabIndex: w ? -1 : 0,
|
|
1309
|
+
onKeyDown: Xe,
|
|
1310
|
+
onFocus: Ze,
|
|
1311
|
+
"data-testid": `${R}-first`,
|
|
1312
|
+
children: Ye || Je
|
|
1469
1313
|
}),
|
|
1470
1314
|
/* @__PURE__ */ t("span", {
|
|
1471
|
-
className: `${
|
|
1315
|
+
className: `${R}-separator`,
|
|
1472
1316
|
children: "/"
|
|
1473
1317
|
}),
|
|
1474
1318
|
/* @__PURE__ */ t("span", {
|
|
1475
|
-
ref:
|
|
1319
|
+
ref: X,
|
|
1476
1320
|
role: "spinbutton",
|
|
1477
|
-
"aria-label":
|
|
1478
|
-
"aria-valuenow": parseInt(
|
|
1321
|
+
"aria-label": P ? "Day" : "Month",
|
|
1322
|
+
"aria-valuenow": parseInt($e) || void 0,
|
|
1479
1323
|
"aria-valuemin": 1,
|
|
1480
|
-
"aria-valuemax":
|
|
1481
|
-
"aria-valuetext":
|
|
1482
|
-
className: [`${
|
|
1483
|
-
tabIndex:
|
|
1484
|
-
onKeyDown:
|
|
1485
|
-
onFocus:
|
|
1486
|
-
"data-testid": `${
|
|
1487
|
-
children:
|
|
1324
|
+
"aria-valuemax": P ? 31 : 12,
|
|
1325
|
+
"aria-valuetext": $e || Qe,
|
|
1326
|
+
className: [`${R}-partInput`, $e ? "" : `${R}-placeholder`].filter(Boolean).join(" "),
|
|
1327
|
+
tabIndex: w ? -1 : 0,
|
|
1328
|
+
onKeyDown: Z,
|
|
1329
|
+
onFocus: et,
|
|
1330
|
+
"data-testid": `${R}-second`,
|
|
1331
|
+
children: $e || Qe
|
|
1488
1332
|
}),
|
|
1489
1333
|
/* @__PURE__ */ t("span", {
|
|
1490
|
-
className: `${
|
|
1334
|
+
className: `${R}-separator`,
|
|
1491
1335
|
children: "/"
|
|
1492
1336
|
}),
|
|
1493
1337
|
/* @__PURE__ */ t("span", {
|
|
1494
|
-
ref:
|
|
1338
|
+
ref: G,
|
|
1495
1339
|
role: "spinbutton",
|
|
1496
1340
|
"aria-label": "Year",
|
|
1497
|
-
"aria-valuenow": parseInt(
|
|
1341
|
+
"aria-valuenow": parseInt(z) || void 0,
|
|
1498
1342
|
"aria-valuemin": 1900,
|
|
1499
1343
|
"aria-valuemax": 2100,
|
|
1500
|
-
"aria-valuetext":
|
|
1501
|
-
className: [`${
|
|
1502
|
-
tabIndex:
|
|
1503
|
-
onKeyDown:
|
|
1344
|
+
"aria-valuetext": z || "YYYY",
|
|
1345
|
+
className: [`${R}-partInput`, z ? "" : `${R}-placeholder`].filter(Boolean).join(" "),
|
|
1346
|
+
tabIndex: w ? -1 : 0,
|
|
1347
|
+
onKeyDown: Ie,
|
|
1504
1348
|
onFocus: () => {
|
|
1505
|
-
|
|
1349
|
+
q.current = "";
|
|
1506
1350
|
},
|
|
1507
|
-
"data-testid": `${
|
|
1508
|
-
children:
|
|
1351
|
+
"data-testid": `${R}-year`,
|
|
1352
|
+
children: z || "YYYY"
|
|
1509
1353
|
})
|
|
1510
1354
|
]
|
|
1511
1355
|
}),
|
|
1512
1356
|
/* @__PURE__ */ t("div", {
|
|
1513
|
-
ref:
|
|
1514
|
-
className: `${
|
|
1515
|
-
children: /* @__PURE__ */ t(
|
|
1516
|
-
className: `${
|
|
1517
|
-
onClick:
|
|
1518
|
-
icon: /* @__PURE__ */ t(
|
|
1519
|
-
disabled:
|
|
1357
|
+
ref: Ce,
|
|
1358
|
+
className: `${R}-adornment`,
|
|
1359
|
+
children: /* @__PURE__ */ t(a, {
|
|
1360
|
+
className: `${R}-calendarIcon`,
|
|
1361
|
+
onClick: ze,
|
|
1362
|
+
icon: /* @__PURE__ */ t(o, { name: "event" }),
|
|
1363
|
+
disabled: w,
|
|
1520
1364
|
tabIndex: 0,
|
|
1521
|
-
"data-testid": `${
|
|
1365
|
+
"data-testid": `${R}-calendarIcon`
|
|
1522
1366
|
})
|
|
1523
1367
|
}),
|
|
1524
1368
|
/* @__PURE__ */ t("fieldset", {
|
|
1525
1369
|
"aria-hidden": "true",
|
|
1526
|
-
className: `${
|
|
1370
|
+
className: `${R}-fieldset`,
|
|
1527
1371
|
children: /* @__PURE__ */ t("legend", {
|
|
1528
|
-
className: `${
|
|
1372
|
+
className: `${R}-legend`,
|
|
1529
1373
|
children: /* @__PURE__ */ t("span", {
|
|
1530
|
-
className: `${
|
|
1374
|
+
className: `${R}-text`,
|
|
1531
1375
|
children: r
|
|
1532
1376
|
})
|
|
1533
1377
|
})
|
|
1534
1378
|
}),
|
|
1535
1379
|
/* @__PURE__ */ t("span", {
|
|
1536
|
-
className: `${
|
|
1380
|
+
className: `${R}-label`,
|
|
1537
1381
|
children: r
|
|
1538
1382
|
})
|
|
1539
1383
|
]
|
|
1540
1384
|
}),
|
|
1541
|
-
(
|
|
1542
|
-
className: `${
|
|
1543
|
-
"data-testid": `${
|
|
1544
|
-
children: [
|
|
1385
|
+
(k || le) && /* @__PURE__ */ n("span", {
|
|
1386
|
+
className: `${R}-helperText`,
|
|
1387
|
+
"data-testid": `${R}-helperText`,
|
|
1388
|
+
children: [le && !fe && le, k && fe && fe.message]
|
|
1545
1389
|
}),
|
|
1546
|
-
/* @__PURE__ */ t(
|
|
1547
|
-
ref:
|
|
1548
|
-
isOpen:
|
|
1549
|
-
hasStaticOptions:
|
|
1550
|
-
language:
|
|
1551
|
-
monthLabel:
|
|
1552
|
-
yearLabel:
|
|
1553
|
-
onPrevMonth:
|
|
1554
|
-
onNextMonth:
|
|
1555
|
-
disablePrev:
|
|
1556
|
-
disableNext:
|
|
1557
|
-
weeks:
|
|
1558
|
-
years:
|
|
1559
|
-
daysOfWeek:
|
|
1560
|
-
selectedValue:
|
|
1561
|
-
format:
|
|
1562
|
-
today:
|
|
1563
|
-
focusedElement:
|
|
1564
|
-
onSelectDay:
|
|
1565
|
-
onSelectYear:
|
|
1566
|
-
onMoveFocus:
|
|
1567
|
-
onClose:
|
|
1390
|
+
/* @__PURE__ */ t(he, {
|
|
1391
|
+
ref: Se,
|
|
1392
|
+
isOpen: V,
|
|
1393
|
+
hasStaticOptions: se,
|
|
1394
|
+
language: s,
|
|
1395
|
+
monthLabel: Ae,
|
|
1396
|
+
yearLabel: je,
|
|
1397
|
+
onPrevMonth: Be,
|
|
1398
|
+
onNextMonth: Ve,
|
|
1399
|
+
disablePrev: He,
|
|
1400
|
+
disableNext: Ue,
|
|
1401
|
+
weeks: J,
|
|
1402
|
+
years: Oe,
|
|
1403
|
+
daysOfWeek: ke,
|
|
1404
|
+
selectedValue: d(F.value) ? F.value : void 0,
|
|
1405
|
+
format: M,
|
|
1406
|
+
today: N,
|
|
1407
|
+
focusedElement: H,
|
|
1408
|
+
onSelectDay: We,
|
|
1409
|
+
onSelectYear: Ge,
|
|
1410
|
+
onMoveFocus: Y,
|
|
1411
|
+
onClose: Re
|
|
1568
1412
|
})
|
|
1569
1413
|
]
|
|
1570
1414
|
});
|
|
1571
|
-
},
|
|
1572
|
-
let { componentStyles: a } = e([
|
|
1573
|
-
return /* @__PURE__ */ t(
|
|
1415
|
+
}, _e = ({ theme: n, variant: r = "default", ...i }) => {
|
|
1416
|
+
let { componentStyles: a } = e([s.DATEPICKER], n, r.toUpperCase());
|
|
1417
|
+
return /* @__PURE__ */ t(ge, {
|
|
1574
1418
|
...i,
|
|
1575
1419
|
style: a
|
|
1576
1420
|
});
|
|
1577
|
-
},
|
|
1421
|
+
}, z = (e, t) => `
|
|
1578
1422
|
// BORDERS
|
|
1579
1423
|
${i(e, "border-color", `--TEXTFIELD-EVENTS-${t}-BORDER-COLOR`)};
|
|
1580
1424
|
${i(e, "border-width", `--TEXTFIELD-EVENTS-${t}-BORDER-WIDTH`)};
|
|
1581
1425
|
${i(e, "border-style", `--TEXTFIELD-EVENTS-${t}-BORDER-STYLE`)};
|
|
1582
|
-
`,
|
|
1426
|
+
`, B = (e, t) => `
|
|
1583
1427
|
// TYPOGRAPHY
|
|
1584
1428
|
${i(e, "color", `--TEXTFIELD-EVENTS-${t}-COLOR-PRIMARY`)};
|
|
1585
1429
|
${i(e, "caret-color", `--TEXTFIELD-EVENTS-${t}-COLOR-PRIMARY`)};
|
|
1586
|
-
`,
|
|
1430
|
+
`, V = (e, t, n = !1) => `
|
|
1587
1431
|
${i(e, "color", `--TEXTFIELD-EVENTS-${t}-COLOR-SECONDARY`)};
|
|
1588
1432
|
${n ? "transform: translate(14px, -24px); font-size: 0.75rem;" : ""};
|
|
1589
|
-
`,
|
|
1433
|
+
`, ve = (e) => `
|
|
1590
1434
|
.--TEXTFIELD-legend {
|
|
1591
1435
|
max-width: ${e ? "100%" : "0px"};
|
|
1592
1436
|
}
|
|
1593
|
-
`,
|
|
1437
|
+
`, H = (e, t) => `
|
|
1594
1438
|
${i(e, "background-color", `--TEXTFIELD-EVENTS-${t}-BACKGROUND-COLOR`)};
|
|
1595
1439
|
~ .--TEXTFIELD-helperText {
|
|
1596
1440
|
${i(e, "color", `--TEXTFIELD-EVENTS-${t}-COLOR-TERTIARY`)};
|
|
1597
1441
|
}
|
|
1598
|
-
`,
|
|
1442
|
+
`, ye = (e) => k`
|
|
1599
1443
|
&.--TEXTFIELD {
|
|
1600
1444
|
position: relative;
|
|
1601
1445
|
padding: 0;
|
|
@@ -1620,46 +1464,46 @@ var B = "--DATEPICKER", Se = ({ name: e, label: r, control: i, language: o = m()
|
|
|
1620
1464
|
${i(e, "border-radius", "--TEXTFIELD-ROOT-BORDER-RADIUS")};
|
|
1621
1465
|
|
|
1622
1466
|
// ENABLED
|
|
1623
|
-
${
|
|
1467
|
+
${H(e, "ENABLED")};
|
|
1624
1468
|
|
|
1625
1469
|
// VALUE
|
|
1626
1470
|
&:has(.--TEXTFIELD-inputField:not(:placeholder-shown)),
|
|
1627
1471
|
&:has(.--TEXTFIELD-inputField[placeholder]:not([placeholder=' '])),
|
|
1628
1472
|
&:has(.--TEXTFIELD-inputField:-webkit-autofill),
|
|
1629
1473
|
&:has(.--TEXTFIELD-inputField.--TEXTFIELD-open) {
|
|
1630
|
-
${
|
|
1474
|
+
${H(e, "VALUE")};
|
|
1631
1475
|
}
|
|
1632
1476
|
|
|
1633
1477
|
// HOVER
|
|
1634
1478
|
&:has(.--TEXTFIELD-inputField:hover) {
|
|
1635
|
-
${
|
|
1479
|
+
${H(e, "HOVER")};
|
|
1636
1480
|
}
|
|
1637
1481
|
|
|
1638
1482
|
// ACTIVE
|
|
1639
1483
|
&:has(.--TEXTFIELD-inputField:active, .--TEXTFIELD-inputField.--TEXTFIELD-active) {
|
|
1640
|
-
${
|
|
1484
|
+
${H(e, "ACTIVE")};
|
|
1641
1485
|
}
|
|
1642
1486
|
|
|
1643
1487
|
// FOCUS
|
|
1644
1488
|
&:has(.--TEXTFIELD-inputField:focus-visible) {
|
|
1645
1489
|
outline: none;
|
|
1646
|
-
${
|
|
1490
|
+
${H(e, "FOCUS")};
|
|
1647
1491
|
}
|
|
1648
1492
|
|
|
1649
1493
|
// ERROR
|
|
1650
1494
|
&:has(.--TEXTFIELD-inputField.--TEXTFIELD-error) {
|
|
1651
|
-
${
|
|
1495
|
+
${H(e, "ERROR")};
|
|
1652
1496
|
}
|
|
1653
1497
|
|
|
1654
1498
|
// ERROR + VALUE
|
|
1655
1499
|
&:has(.--TEXTFIELD-inputField.--TEXTFIELD-error:not(:placeholder-shown)),
|
|
1656
1500
|
&:has(.--TEXTFIELD-inputField.--TEXTFIELD-error[placeholder]:not([placeholder=' '])) {
|
|
1657
|
-
${
|
|
1501
|
+
${H(e, "ERROR_VALUE")};
|
|
1658
1502
|
}
|
|
1659
1503
|
|
|
1660
1504
|
// ERROR + HOVER
|
|
1661
1505
|
&:has(.--TEXTFIELD-inputField.--TEXTFIELD-error:hover) {
|
|
1662
|
-
${
|
|
1506
|
+
${H(e, "ERROR_HOVER")};
|
|
1663
1507
|
}
|
|
1664
1508
|
|
|
1665
1509
|
// ERROR + ACTIVE
|
|
@@ -1667,25 +1511,25 @@ var B = "--DATEPICKER", Se = ({ name: e, label: r, control: i, language: o = m()
|
|
|
1667
1511
|
.--TEXTFIELD-inputField.--TEXTFIELD-error:active,
|
|
1668
1512
|
.--TEXTFIELD-inputField.--TEXTFIELD-error.--TEXTFIELD-active
|
|
1669
1513
|
) {
|
|
1670
|
-
${
|
|
1514
|
+
${H(e, "ERROR_ACTIVE")};
|
|
1671
1515
|
}
|
|
1672
1516
|
|
|
1673
1517
|
// ERROR + FOCUS
|
|
1674
1518
|
&:has(.--TEXTFIELD-inputField.--TEXTFIELD-error:focus-visible) {
|
|
1675
|
-
${
|
|
1519
|
+
${H(e, "ERROR_FOCUS")};
|
|
1676
1520
|
}
|
|
1677
1521
|
|
|
1678
1522
|
// DISABLED
|
|
1679
1523
|
&:has(.--TEXTFIELD-inputField:disabled) {
|
|
1680
1524
|
pointer-events: none;
|
|
1681
|
-
${
|
|
1525
|
+
${H(e, "DISABLED")};
|
|
1682
1526
|
}
|
|
1683
1527
|
|
|
1684
1528
|
// DISABLED + VALUE
|
|
1685
1529
|
&:has(.--TEXTFIELD-inputField:disabled:not(:placeholder-shown)),
|
|
1686
1530
|
&:has(.--TEXTFIELD-inputField:disabled[placeholder]:not([placeholder=' '])) {
|
|
1687
1531
|
pointer-events: none;
|
|
1688
|
-
${
|
|
1532
|
+
${H(e, "DISABLED_VALUE")};
|
|
1689
1533
|
}
|
|
1690
1534
|
|
|
1691
1535
|
.--TEXTFIELD-inputField {
|
|
@@ -1722,12 +1566,12 @@ var B = "--DATEPICKER", Se = ({ name: e, label: r, control: i, language: o = m()
|
|
|
1722
1566
|
}
|
|
1723
1567
|
|
|
1724
1568
|
// ENABLED
|
|
1725
|
-
${
|
|
1569
|
+
${B(e, "ENABLED")};
|
|
1726
1570
|
~ .--TEXTFIELD-label {
|
|
1727
|
-
${
|
|
1571
|
+
${V(e, "ENABLED")};
|
|
1728
1572
|
}
|
|
1729
1573
|
~ .--TEXTFIELD-fieldset {
|
|
1730
|
-
${
|
|
1574
|
+
${z(e, "ENABLED")};
|
|
1731
1575
|
}
|
|
1732
1576
|
|
|
1733
1577
|
// VALUE
|
|
@@ -1735,13 +1579,13 @@ var B = "--DATEPICKER", Se = ({ name: e, label: r, control: i, language: o = m()
|
|
|
1735
1579
|
&[placeholder]:not([placeholder=' ']),
|
|
1736
1580
|
&:-webkit-autofill,
|
|
1737
1581
|
&.--TEXTFIELD-open {
|
|
1738
|
-
${
|
|
1582
|
+
${B(e, "VALUE")};
|
|
1739
1583
|
~ .--TEXTFIELD-label {
|
|
1740
|
-
${
|
|
1584
|
+
${V(e, "VALUE", !0)};
|
|
1741
1585
|
}
|
|
1742
1586
|
~ .--TEXTFIELD-fieldset {
|
|
1743
|
-
${
|
|
1744
|
-
${
|
|
1587
|
+
${z(e, "VALUE")};
|
|
1588
|
+
${ve(!0)};
|
|
1745
1589
|
}
|
|
1746
1590
|
}
|
|
1747
1591
|
|
|
@@ -1753,94 +1597,94 @@ var B = "--DATEPICKER", Se = ({ name: e, label: r, control: i, language: o = m()
|
|
|
1753
1597
|
|
|
1754
1598
|
// HOVER
|
|
1755
1599
|
&:hover {
|
|
1756
|
-
${
|
|
1600
|
+
${B(e, "HOVER")};
|
|
1757
1601
|
~ .--TEXTFIELD-label {
|
|
1758
|
-
${
|
|
1602
|
+
${V(e, "HOVER")};
|
|
1759
1603
|
}
|
|
1760
1604
|
~ .--TEXTFIELD-fieldset {
|
|
1761
|
-
${
|
|
1605
|
+
${z(e, "HOVER")};
|
|
1762
1606
|
}
|
|
1763
1607
|
}
|
|
1764
1608
|
|
|
1765
1609
|
// ACTIVE
|
|
1766
1610
|
&:active,
|
|
1767
1611
|
&.--TEXTFIELD-active {
|
|
1768
|
-
${
|
|
1612
|
+
${B(e, "ACTIVE")};
|
|
1769
1613
|
~ .--TEXTFIELD-label {
|
|
1770
|
-
${
|
|
1614
|
+
${V(e, "ACTIVE")};
|
|
1771
1615
|
}
|
|
1772
1616
|
~ .--TEXTFIELD-fieldset {
|
|
1773
|
-
${
|
|
1617
|
+
${z(e, "ACTIVE")};
|
|
1774
1618
|
}
|
|
1775
1619
|
}
|
|
1776
1620
|
|
|
1777
1621
|
// FOCUS
|
|
1778
1622
|
&:focus-visible {
|
|
1779
1623
|
outline: none;
|
|
1780
|
-
${
|
|
1624
|
+
${B(e, "FOCUS")};
|
|
1781
1625
|
~ .--TEXTFIELD-label {
|
|
1782
|
-
${
|
|
1626
|
+
${V(e, "FOCUS", !0)};
|
|
1783
1627
|
}
|
|
1784
1628
|
~ .--TEXTFIELD-fieldset {
|
|
1785
|
-
${
|
|
1786
|
-
${
|
|
1629
|
+
${z(e, "FOCUS")};
|
|
1630
|
+
${ve(!0)};
|
|
1787
1631
|
}
|
|
1788
1632
|
}
|
|
1789
1633
|
|
|
1790
1634
|
// ERROR
|
|
1791
1635
|
&.--TEXTFIELD-error {
|
|
1792
|
-
${
|
|
1636
|
+
${B(e, "ERROR")};
|
|
1793
1637
|
~ .--TEXTFIELD-label {
|
|
1794
|
-
${
|
|
1638
|
+
${V(e, "ERROR")};
|
|
1795
1639
|
}
|
|
1796
1640
|
~ .--TEXTFIELD-fieldset {
|
|
1797
|
-
${
|
|
1641
|
+
${z(e, "ERROR")};
|
|
1798
1642
|
}
|
|
1799
1643
|
}
|
|
1800
1644
|
|
|
1801
1645
|
// ERROR + VALUE
|
|
1802
1646
|
&.--TEXTFIELD-error:not(:placeholder-shown),
|
|
1803
1647
|
&.--TEXTFIELD-error[placeholder]:not([placeholder=' ']) {
|
|
1804
|
-
${
|
|
1648
|
+
${B(e, "ERROR_VALUE")};
|
|
1805
1649
|
~ .--TEXTFIELD-label {
|
|
1806
|
-
${
|
|
1650
|
+
${V(e, "ERROR_VALUE")};
|
|
1807
1651
|
}
|
|
1808
1652
|
~ .--TEXTFIELD-fieldset {
|
|
1809
|
-
${
|
|
1653
|
+
${z(e, "ERROR_VALUE")};
|
|
1810
1654
|
}
|
|
1811
1655
|
}
|
|
1812
1656
|
|
|
1813
1657
|
// ERROR + HOVER
|
|
1814
1658
|
&.--TEXTFIELD-error:hover {
|
|
1815
|
-
${
|
|
1659
|
+
${B(e, "ERROR_HOVER")};
|
|
1816
1660
|
~ .--TEXTFIELD-label {
|
|
1817
|
-
${
|
|
1661
|
+
${V(e, "ERROR_HOVER")};
|
|
1818
1662
|
}
|
|
1819
1663
|
~ .--TEXTFIELD-fieldset {
|
|
1820
|
-
${
|
|
1664
|
+
${z(e, "ERROR_HOVER")};
|
|
1821
1665
|
}
|
|
1822
1666
|
}
|
|
1823
1667
|
|
|
1824
1668
|
// ERROR + ACTIVE
|
|
1825
1669
|
&.--TEXTFIELD-error:active,
|
|
1826
1670
|
&.--TEXTFIELD-error.--TEXTFIELD-active {
|
|
1827
|
-
${
|
|
1671
|
+
${B(e, "ERROR_ACTIVE")};
|
|
1828
1672
|
~ .--TEXTFIELD-label {
|
|
1829
|
-
${
|
|
1673
|
+
${V(e, "ERROR_ACTIVE")};
|
|
1830
1674
|
}
|
|
1831
1675
|
~ .--TEXTFIELD-fieldset {
|
|
1832
|
-
${
|
|
1676
|
+
${z(e, "ERROR_ACTIVE")};
|
|
1833
1677
|
}
|
|
1834
1678
|
}
|
|
1835
1679
|
|
|
1836
1680
|
// ERROR + FOCUS
|
|
1837
1681
|
&.--TEXTFIELD-error:focus-visible {
|
|
1838
|
-
${
|
|
1682
|
+
${B(e, "ERROR_FOCUS")};
|
|
1839
1683
|
~ .--TEXTFIELD-label {
|
|
1840
|
-
${
|
|
1684
|
+
${V(e, "ERROR_FOCUS")};
|
|
1841
1685
|
}
|
|
1842
1686
|
~ .--TEXTFIELD-fieldset {
|
|
1843
|
-
${
|
|
1687
|
+
${z(e, "ERROR_FOCUS")};
|
|
1844
1688
|
}
|
|
1845
1689
|
}
|
|
1846
1690
|
|
|
@@ -1848,12 +1692,12 @@ var B = "--DATEPICKER", Se = ({ name: e, label: r, control: i, language: o = m()
|
|
|
1848
1692
|
&:disabled {
|
|
1849
1693
|
user-select: none;
|
|
1850
1694
|
pointer-events: none;
|
|
1851
|
-
${
|
|
1695
|
+
${B(e, "DISABLED")};
|
|
1852
1696
|
~ .--TEXTFIELD-label {
|
|
1853
|
-
${
|
|
1697
|
+
${V(e, "DISABLED")};
|
|
1854
1698
|
}
|
|
1855
1699
|
~ .--TEXTFIELD-fieldset {
|
|
1856
|
-
${
|
|
1700
|
+
${z(e, "DISABLED")};
|
|
1857
1701
|
}
|
|
1858
1702
|
}
|
|
1859
1703
|
|
|
@@ -1862,12 +1706,12 @@ var B = "--DATEPICKER", Se = ({ name: e, label: r, control: i, language: o = m()
|
|
|
1862
1706
|
&:disabled[placeholder]:not([placeholder=' ']) {
|
|
1863
1707
|
user-select: none;
|
|
1864
1708
|
pointer-events: none;
|
|
1865
|
-
${
|
|
1709
|
+
${B(e, "DISABLED_VALUE")};
|
|
1866
1710
|
~ .--TEXTFIELD-label {
|
|
1867
|
-
${
|
|
1711
|
+
${V(e, "DISABLED_VALUE")};
|
|
1868
1712
|
}
|
|
1869
1713
|
~ .--TEXTFIELD-fieldset {
|
|
1870
|
-
${
|
|
1714
|
+
${z(e, "DISABLED_VALUE")};
|
|
1871
1715
|
}
|
|
1872
1716
|
}
|
|
1873
1717
|
}
|
|
@@ -1956,33 +1800,33 @@ var B = "--DATEPICKER", Se = ({ name: e, label: r, control: i, language: o = m()
|
|
|
1956
1800
|
height: 16px;
|
|
1957
1801
|
}
|
|
1958
1802
|
}
|
|
1959
|
-
`,
|
|
1960
|
-
className: `${
|
|
1803
|
+
`, U = "--TEXTFIELD", be = ({ children: e }) => /* @__PURE__ */ t("div", {
|
|
1804
|
+
className: `${U}-adornment`,
|
|
1961
1805
|
children: e
|
|
1962
|
-
}),
|
|
1806
|
+
}), xe = ({ label: e, value: r, onChange: i, error: a, style: o = {}, width: s, disabled: c, type: l = "text", regex: u, hasPadding: d = !1, format: f, startAdornment: p, endAdornment: m, helperText: ee, showErrorText: h = !0, className: g, onBlur: _, ...v }) => /* @__PURE__ */ n("div", {
|
|
1963
1807
|
className: [
|
|
1964
|
-
|
|
1965
|
-
d ? `${
|
|
1966
|
-
|
|
1808
|
+
U,
|
|
1809
|
+
d ? `${U}-paddingBottom` : "",
|
|
1810
|
+
g || ""
|
|
1967
1811
|
].join(" "),
|
|
1968
|
-
css:
|
|
1969
|
-
"data-testid":
|
|
1812
|
+
css: ye(o),
|
|
1813
|
+
"data-testid": U,
|
|
1970
1814
|
children: [/* @__PURE__ */ n("div", {
|
|
1971
|
-
className: `${
|
|
1815
|
+
className: `${U}-container`,
|
|
1972
1816
|
children: [
|
|
1973
|
-
p && /* @__PURE__ */ t(
|
|
1817
|
+
p && /* @__PURE__ */ t(be, { children: p }),
|
|
1974
1818
|
/* @__PURE__ */ t("input", {
|
|
1975
1819
|
className: [
|
|
1976
|
-
`${
|
|
1977
|
-
a && `${
|
|
1978
|
-
p && `${
|
|
1979
|
-
p && `${
|
|
1980
|
-
m && `${
|
|
1820
|
+
`${U}-inputField`,
|
|
1821
|
+
a && `${U}-error`,
|
|
1822
|
+
p && `${U}-open`,
|
|
1823
|
+
p && `${U}-left`,
|
|
1824
|
+
m && `${U}-right`
|
|
1981
1825
|
].join(" "),
|
|
1982
1826
|
placeholder: " ",
|
|
1983
1827
|
value: r,
|
|
1984
1828
|
disabled: c,
|
|
1985
|
-
"data-testid": `${
|
|
1829
|
+
"data-testid": `${U}-inputField`,
|
|
1986
1830
|
onChange: (e) => {
|
|
1987
1831
|
e.preventDefault();
|
|
1988
1832
|
let t = e.target.value;
|
|
@@ -1992,36 +1836,36 @@ var B = "--DATEPICKER", Se = ({ name: e, label: r, control: i, language: o = m()
|
|
|
1992
1836
|
type: l,
|
|
1993
1837
|
...v
|
|
1994
1838
|
}),
|
|
1995
|
-
m && /* @__PURE__ */ t(
|
|
1839
|
+
m && /* @__PURE__ */ t(be, { children: m }),
|
|
1996
1840
|
/* @__PURE__ */ t("fieldset", {
|
|
1997
1841
|
"aria-hidden": "true",
|
|
1998
|
-
className: `${
|
|
1842
|
+
className: `${U}-fieldset`,
|
|
1999
1843
|
children: /* @__PURE__ */ t("legend", {
|
|
2000
|
-
className: `${
|
|
1844
|
+
className: `${U}-legend`,
|
|
2001
1845
|
children: /* @__PURE__ */ t("span", {
|
|
2002
|
-
className: `${
|
|
1846
|
+
className: `${U}-text`,
|
|
2003
1847
|
children: e
|
|
2004
1848
|
})
|
|
2005
1849
|
})
|
|
2006
1850
|
}),
|
|
2007
1851
|
/* @__PURE__ */ t("span", {
|
|
2008
|
-
className: `${
|
|
1852
|
+
className: `${U}-label`,
|
|
2009
1853
|
children: e
|
|
2010
1854
|
})
|
|
2011
1855
|
]
|
|
2012
|
-
}), (
|
|
2013
|
-
className: `${
|
|
2014
|
-
"data-testid": `${
|
|
2015
|
-
children: [
|
|
1856
|
+
}), (h || ee) && /* @__PURE__ */ n("span", {
|
|
1857
|
+
className: `${U}-helperText`,
|
|
1858
|
+
"data-testid": `${U}-helperText`,
|
|
1859
|
+
children: [ee && (!a || !h) && ee, h && a && a.message]
|
|
2016
1860
|
})]
|
|
2017
|
-
}),
|
|
2018
|
-
let { field: i, fieldState: a } =
|
|
1861
|
+
}), Se = ({ name: e, control: n, ...r }) => {
|
|
1862
|
+
let { field: i, fieldState: a } = ce({
|
|
2019
1863
|
control: n,
|
|
2020
1864
|
name: e
|
|
2021
|
-
}), [o, s] =
|
|
1865
|
+
}), [o, s] = O(i.value || ""), c = a.error, l = (e) => {
|
|
2022
1866
|
i.onChange(e), s(e), c && i.onBlur();
|
|
2023
1867
|
};
|
|
2024
|
-
return /* @__PURE__ */ t(
|
|
1868
|
+
return /* @__PURE__ */ t(xe, {
|
|
2025
1869
|
...r,
|
|
2026
1870
|
name: e,
|
|
2027
1871
|
value: o,
|
|
@@ -2029,45 +1873,45 @@ var B = "--DATEPICKER", Se = ({ name: e, label: r, control: i, language: o = m()
|
|
|
2029
1873
|
onBlur: () => i.onBlur(),
|
|
2030
1874
|
error: c
|
|
2031
1875
|
});
|
|
2032
|
-
},
|
|
1876
|
+
}, Ce = (e) => {
|
|
2033
1877
|
if (!e.control) {
|
|
2034
1878
|
let { name: n, control: r, onValueChange: i, value: a, ...o } = e;
|
|
2035
|
-
return /* @__PURE__ */ t(
|
|
1879
|
+
return /* @__PURE__ */ t(xe, {
|
|
2036
1880
|
...o,
|
|
2037
1881
|
name: n,
|
|
2038
1882
|
value: a || "",
|
|
2039
1883
|
onChange: i || (() => {})
|
|
2040
1884
|
});
|
|
2041
1885
|
}
|
|
2042
|
-
return /* @__PURE__ */ t(
|
|
2043
|
-
},
|
|
2044
|
-
let { componentStyles: a } = e([
|
|
2045
|
-
return /* @__PURE__ */ t(
|
|
1886
|
+
return /* @__PURE__ */ t(Se, { ...e });
|
|
1887
|
+
}, we = ({ theme: n, variant: r = "default", ...i }) => {
|
|
1888
|
+
let { componentStyles: a } = e([s.TEXTFIELD], n, r.toUpperCase());
|
|
1889
|
+
return /* @__PURE__ */ t(Ce, {
|
|
2046
1890
|
...i,
|
|
2047
1891
|
style: a
|
|
2048
1892
|
});
|
|
2049
|
-
},
|
|
1893
|
+
}, W = (e, t) => `
|
|
2050
1894
|
// BORDERS
|
|
2051
1895
|
${i(e, "border-color", `--NUMBERFIELD-EVENTS-${t}-BORDER-COLOR`)};
|
|
2052
1896
|
${i(e, "border-width", `--NUMBERFIELD-EVENTS-${t}-BORDER-WIDTH`)};
|
|
2053
1897
|
${i(e, "border-style", `--NUMBERFIELD-EVENTS-${t}-BORDER-STYLE`)};
|
|
2054
|
-
`,
|
|
1898
|
+
`, G = (e, t) => `
|
|
2055
1899
|
// TYPOGRAPHY
|
|
2056
1900
|
${i(e, "color", `--NUMBERFIELD-EVENTS-${t}-COLOR-PRIMARY`)};
|
|
2057
1901
|
${i(e, "caret-color", `--NUMBERFIELD-EVENTS-${t}-COLOR-PRIMARY`)};
|
|
2058
|
-
`,
|
|
1902
|
+
`, K = (e, t, n = !1) => `
|
|
2059
1903
|
${i(e, "color", `--NUMBERFIELD-EVENTS-${t}-COLOR-SECONDARY`)};
|
|
2060
1904
|
${n ? "transform: translate(14px, -24px); font-size: 0.75rem;" : ""};
|
|
2061
|
-
`,
|
|
1905
|
+
`, Te = (e) => `
|
|
2062
1906
|
.--NUMBERFIELD-legend {
|
|
2063
1907
|
max-width: ${e ? "100%" : "0px"};
|
|
2064
1908
|
}
|
|
2065
|
-
`,
|
|
1909
|
+
`, q = (e, t) => `
|
|
2066
1910
|
${i(e, "background-color", `--NUMBERFIELD-EVENTS-${t}-BACKGROUND-COLOR`)};
|
|
2067
1911
|
~ .--NUMBERFIELD-helperText {
|
|
2068
1912
|
${i(e, "color", `--NUMBERFIELD-EVENTS-${t}-COLOR-TERTIARY`)};
|
|
2069
1913
|
}
|
|
2070
|
-
`,
|
|
1914
|
+
`, Ee = (e) => k`
|
|
2071
1915
|
&.--NUMBERFIELD {
|
|
2072
1916
|
position: relative;
|
|
2073
1917
|
padding: 0;
|
|
@@ -2092,46 +1936,46 @@ var B = "--DATEPICKER", Se = ({ name: e, label: r, control: i, language: o = m()
|
|
|
2092
1936
|
${i(e, "border-radius", "--NUMBERFIELD-ROOT-BORDER-RADIUS")};
|
|
2093
1937
|
|
|
2094
1938
|
// ENABLED
|
|
2095
|
-
${
|
|
1939
|
+
${q(e, "ENABLED")};
|
|
2096
1940
|
|
|
2097
1941
|
// VALUE
|
|
2098
1942
|
&:has(.--NUMBERFIELD-inputField:not(:placeholder-shown)),
|
|
2099
1943
|
&:has(.--NUMBERFIELD-inputField[placeholder]:not([placeholder=' '])),
|
|
2100
1944
|
&:has(.--NUMBERFIELD-inputField:-webkit-autofill),
|
|
2101
1945
|
&:has(.--NUMBERFIELD-inputField.--NUMBERFIELD-open) {
|
|
2102
|
-
${
|
|
1946
|
+
${q(e, "VALUE")};
|
|
2103
1947
|
}
|
|
2104
1948
|
|
|
2105
1949
|
// HOVER
|
|
2106
1950
|
&:has(.--NUMBERFIELD-inputField:hover) {
|
|
2107
|
-
${
|
|
1951
|
+
${q(e, "HOVER")};
|
|
2108
1952
|
}
|
|
2109
1953
|
|
|
2110
1954
|
// ACTIVE
|
|
2111
1955
|
&:has(.--NUMBERFIELD-inputField:active, .--NUMBERFIELD-inputField.--NUMBERFIELD-active) {
|
|
2112
|
-
${
|
|
1956
|
+
${q(e, "ACTIVE")};
|
|
2113
1957
|
}
|
|
2114
1958
|
|
|
2115
1959
|
// FOCUS
|
|
2116
1960
|
&:has(.--NUMBERFIELD-inputField:focus-visible) {
|
|
2117
1961
|
outline: none;
|
|
2118
|
-
${
|
|
1962
|
+
${q(e, "FOCUS")};
|
|
2119
1963
|
}
|
|
2120
1964
|
|
|
2121
1965
|
// ERROR
|
|
2122
1966
|
&:has(.--NUMBERFIELD-inputField.--NUMBERFIELD-error) {
|
|
2123
|
-
${
|
|
1967
|
+
${q(e, "ERROR")};
|
|
2124
1968
|
}
|
|
2125
1969
|
|
|
2126
1970
|
// ERROR + VALUE
|
|
2127
1971
|
&:has(.--NUMBERFIELD-inputField.--NUMBERFIELD-error:not(:placeholder-shown)),
|
|
2128
1972
|
&:has(.--NUMBERFIELD-inputField.--NUMBERFIELD-error[placeholder]:not([placeholder=' '])) {
|
|
2129
|
-
${
|
|
1973
|
+
${q(e, "ERROR_VALUE")};
|
|
2130
1974
|
}
|
|
2131
1975
|
|
|
2132
1976
|
// ERROR + HOVER
|
|
2133
1977
|
&:has(.--NUMBERFIELD-inputField.--NUMBERFIELD-error:hover) {
|
|
2134
|
-
${
|
|
1978
|
+
${q(e, "ERROR_HOVER")};
|
|
2135
1979
|
}
|
|
2136
1980
|
|
|
2137
1981
|
// ERROR + ACTIVE
|
|
@@ -2139,25 +1983,25 @@ var B = "--DATEPICKER", Se = ({ name: e, label: r, control: i, language: o = m()
|
|
|
2139
1983
|
.--NUMBERFIELD-inputField.--NUMBERFIELD-error:active,
|
|
2140
1984
|
.--NUMBERFIELD-inputField.--NUMBERFIELD-error.--NUMBERFIELD-active
|
|
2141
1985
|
) {
|
|
2142
|
-
${
|
|
1986
|
+
${q(e, "ERROR_ACTIVE")};
|
|
2143
1987
|
}
|
|
2144
1988
|
|
|
2145
1989
|
// ERROR + FOCUS
|
|
2146
1990
|
&:has(.--NUMBERFIELD-inputField.--NUMBERFIELD-error:focus-visible) {
|
|
2147
|
-
${
|
|
1991
|
+
${q(e, "ERROR_FOCUS")};
|
|
2148
1992
|
}
|
|
2149
1993
|
|
|
2150
1994
|
// DISABLED
|
|
2151
1995
|
&:has(.--NUMBERFIELD-inputField:disabled) {
|
|
2152
1996
|
pointer-events: none;
|
|
2153
|
-
${
|
|
1997
|
+
${q(e, "DISABLED")};
|
|
2154
1998
|
}
|
|
2155
1999
|
|
|
2156
2000
|
// DISABLED + VALUE
|
|
2157
2001
|
&:has(.--NUMBERFIELD-inputField:disabled:not(:placeholder-shown)),
|
|
2158
2002
|
&:has(.--NUMBERFIELD-inputField:disabled[placeholder]:not([placeholder=' '])) {
|
|
2159
2003
|
pointer-events: none;
|
|
2160
|
-
${
|
|
2004
|
+
${q(e, "DISABLED_VALUE")};
|
|
2161
2005
|
}
|
|
2162
2006
|
|
|
2163
2007
|
.--NUMBERFIELD-inputField {
|
|
@@ -2205,12 +2049,12 @@ var B = "--DATEPICKER", Se = ({ name: e, label: r, control: i, language: o = m()
|
|
|
2205
2049
|
}
|
|
2206
2050
|
|
|
2207
2051
|
// ENABLED
|
|
2208
|
-
${
|
|
2052
|
+
${G(e, "ENABLED")};
|
|
2209
2053
|
~ .--NUMBERFIELD-label {
|
|
2210
|
-
${
|
|
2054
|
+
${K(e, "ENABLED")};
|
|
2211
2055
|
}
|
|
2212
2056
|
~ .--NUMBERFIELD-fieldset {
|
|
2213
|
-
${
|
|
2057
|
+
${W(e, "ENABLED")};
|
|
2214
2058
|
}
|
|
2215
2059
|
|
|
2216
2060
|
// VALUE
|
|
@@ -2218,13 +2062,13 @@ var B = "--DATEPICKER", Se = ({ name: e, label: r, control: i, language: o = m()
|
|
|
2218
2062
|
&[placeholder]:not([placeholder=' ']),
|
|
2219
2063
|
&:-webkit-autofill,
|
|
2220
2064
|
&.--NUMBERFIELD-open {
|
|
2221
|
-
${
|
|
2065
|
+
${G(e, "VALUE")};
|
|
2222
2066
|
~ .--NUMBERFIELD-label {
|
|
2223
|
-
${
|
|
2067
|
+
${K(e, "VALUE", !0)};
|
|
2224
2068
|
}
|
|
2225
2069
|
~ .--NUMBERFIELD-fieldset {
|
|
2226
|
-
${
|
|
2227
|
-
${
|
|
2070
|
+
${W(e, "VALUE")};
|
|
2071
|
+
${Te(!0)};
|
|
2228
2072
|
}
|
|
2229
2073
|
}
|
|
2230
2074
|
|
|
@@ -2236,94 +2080,94 @@ var B = "--DATEPICKER", Se = ({ name: e, label: r, control: i, language: o = m()
|
|
|
2236
2080
|
|
|
2237
2081
|
// HOVER
|
|
2238
2082
|
&:hover {
|
|
2239
|
-
${
|
|
2083
|
+
${G(e, "HOVER")};
|
|
2240
2084
|
~ .--NUMBERFIELD-label {
|
|
2241
|
-
${
|
|
2085
|
+
${K(e, "HOVER")};
|
|
2242
2086
|
}
|
|
2243
2087
|
~ .--NUMBERFIELD-fieldset {
|
|
2244
|
-
${
|
|
2088
|
+
${W(e, "HOVER")};
|
|
2245
2089
|
}
|
|
2246
2090
|
}
|
|
2247
2091
|
|
|
2248
2092
|
// ACTIVE
|
|
2249
2093
|
&:active,
|
|
2250
2094
|
&.--NUMBERFIELD-active {
|
|
2251
|
-
${
|
|
2095
|
+
${G(e, "ACTIVE")};
|
|
2252
2096
|
~ .--NUMBERFIELD-label {
|
|
2253
|
-
${
|
|
2097
|
+
${K(e, "ACTIVE")};
|
|
2254
2098
|
}
|
|
2255
2099
|
~ .--NUMBERFIELD-fieldset {
|
|
2256
|
-
${
|
|
2100
|
+
${W(e, "ACTIVE")};
|
|
2257
2101
|
}
|
|
2258
2102
|
}
|
|
2259
2103
|
|
|
2260
2104
|
// FOCUS
|
|
2261
2105
|
&:focus-visible {
|
|
2262
2106
|
outline: none;
|
|
2263
|
-
${
|
|
2107
|
+
${G(e, "FOCUS")};
|
|
2264
2108
|
~ .--NUMBERFIELD-label {
|
|
2265
|
-
${
|
|
2109
|
+
${K(e, "FOCUS", !0)};
|
|
2266
2110
|
}
|
|
2267
2111
|
~ .--NUMBERFIELD-fieldset {
|
|
2268
|
-
${
|
|
2269
|
-
${
|
|
2112
|
+
${W(e, "FOCUS")};
|
|
2113
|
+
${Te(!0)};
|
|
2270
2114
|
}
|
|
2271
2115
|
}
|
|
2272
2116
|
|
|
2273
2117
|
// ERROR
|
|
2274
2118
|
&.--NUMBERFIELD-error {
|
|
2275
|
-
${
|
|
2119
|
+
${G(e, "ERROR")};
|
|
2276
2120
|
~ .--NUMBERFIELD-label {
|
|
2277
|
-
${
|
|
2121
|
+
${K(e, "ERROR")};
|
|
2278
2122
|
}
|
|
2279
2123
|
~ .--NUMBERFIELD-fieldset {
|
|
2280
|
-
${
|
|
2124
|
+
${W(e, "ERROR")};
|
|
2281
2125
|
}
|
|
2282
2126
|
}
|
|
2283
2127
|
|
|
2284
2128
|
// ERROR + VALUE
|
|
2285
2129
|
&.--NUMBERFIELD-error:not(:placeholder-shown),
|
|
2286
2130
|
&.--NUMBERFIELD-error[placeholder]:not([placeholder=' ']) {
|
|
2287
|
-
${
|
|
2131
|
+
${G(e, "ERROR_VALUE")};
|
|
2288
2132
|
~ .--NUMBERFIELD-label {
|
|
2289
|
-
${
|
|
2133
|
+
${K(e, "ERROR_VALUE")};
|
|
2290
2134
|
}
|
|
2291
2135
|
~ .--NUMBERFIELD-fieldset {
|
|
2292
|
-
${
|
|
2136
|
+
${W(e, "ERROR_VALUE")};
|
|
2293
2137
|
}
|
|
2294
2138
|
}
|
|
2295
2139
|
|
|
2296
2140
|
// ERROR + HOVER
|
|
2297
2141
|
&.--NUMBERFIELD-error:hover {
|
|
2298
|
-
${
|
|
2142
|
+
${G(e, "ERROR_HOVER")};
|
|
2299
2143
|
~ .--NUMBERFIELD-label {
|
|
2300
|
-
${
|
|
2144
|
+
${K(e, "ERROR_HOVER")};
|
|
2301
2145
|
}
|
|
2302
2146
|
~ .--NUMBERFIELD-fieldset {
|
|
2303
|
-
${
|
|
2147
|
+
${W(e, "ERROR_HOVER")};
|
|
2304
2148
|
}
|
|
2305
2149
|
}
|
|
2306
2150
|
|
|
2307
2151
|
// ERROR + ACTIVE
|
|
2308
2152
|
&.--NUMBERFIELD-error:active,
|
|
2309
2153
|
&.--NUMBERFIELD-error.--NUMBERFIELD-active {
|
|
2310
|
-
${
|
|
2154
|
+
${G(e, "ERROR_ACTIVE")};
|
|
2311
2155
|
~ .--NUMBERFIELD-label {
|
|
2312
|
-
${
|
|
2156
|
+
${K(e, "ERROR_ACTIVE")};
|
|
2313
2157
|
}
|
|
2314
2158
|
~ .--NUMBERFIELD-fieldset {
|
|
2315
|
-
${
|
|
2159
|
+
${W(e, "ERROR_ACTIVE")};
|
|
2316
2160
|
}
|
|
2317
2161
|
}
|
|
2318
2162
|
|
|
2319
2163
|
// ERROR + FOCUS
|
|
2320
2164
|
&.--NUMBERFIELD-error:focus-visible {
|
|
2321
|
-
${
|
|
2165
|
+
${G(e, "ERROR_FOCUS")};
|
|
2322
2166
|
~ .--NUMBERFIELD-label {
|
|
2323
|
-
${
|
|
2167
|
+
${K(e, "ERROR_FOCUS")};
|
|
2324
2168
|
}
|
|
2325
2169
|
~ .--NUMBERFIELD-fieldset {
|
|
2326
|
-
${
|
|
2170
|
+
${W(e, "ERROR_FOCUS")};
|
|
2327
2171
|
}
|
|
2328
2172
|
}
|
|
2329
2173
|
|
|
@@ -2331,12 +2175,12 @@ var B = "--DATEPICKER", Se = ({ name: e, label: r, control: i, language: o = m()
|
|
|
2331
2175
|
&:disabled {
|
|
2332
2176
|
user-select: none;
|
|
2333
2177
|
pointer-events: none;
|
|
2334
|
-
${
|
|
2178
|
+
${G(e, "DISABLED")};
|
|
2335
2179
|
~ .--NUMBERFIELD-label {
|
|
2336
|
-
${
|
|
2180
|
+
${K(e, "DISABLED")};
|
|
2337
2181
|
}
|
|
2338
2182
|
~ .--NUMBERFIELD-fieldset {
|
|
2339
|
-
${
|
|
2183
|
+
${W(e, "DISABLED")};
|
|
2340
2184
|
}
|
|
2341
2185
|
}
|
|
2342
2186
|
|
|
@@ -2345,12 +2189,12 @@ var B = "--DATEPICKER", Se = ({ name: e, label: r, control: i, language: o = m()
|
|
|
2345
2189
|
&:disabled[placeholder]:not([placeholder=' ']) {
|
|
2346
2190
|
user-select: none;
|
|
2347
2191
|
pointer-events: none;
|
|
2348
|
-
${
|
|
2192
|
+
${G(e, "DISABLED_VALUE")};
|
|
2349
2193
|
~ .--NUMBERFIELD-label {
|
|
2350
|
-
${
|
|
2194
|
+
${K(e, "DISABLED_VALUE")};
|
|
2351
2195
|
}
|
|
2352
2196
|
~ .--NUMBERFIELD-fieldset {
|
|
2353
|
-
${
|
|
2197
|
+
${W(e, "DISABLED_VALUE")};
|
|
2354
2198
|
}
|
|
2355
2199
|
}
|
|
2356
2200
|
}
|
|
@@ -2439,97 +2283,97 @@ var B = "--DATEPICKER", Se = ({ name: e, label: r, control: i, language: o = m()
|
|
|
2439
2283
|
height: 16px;
|
|
2440
2284
|
}
|
|
2441
2285
|
}
|
|
2442
|
-
`,
|
|
2443
|
-
className: `${
|
|
2286
|
+
`, J = "--NUMBERFIELD", De = ({ children: e }) => /* @__PURE__ */ t("div", {
|
|
2287
|
+
className: `${J}-adornment`,
|
|
2444
2288
|
children: e
|
|
2445
|
-
}),
|
|
2446
|
-
let S = r === "" ? NaN : parseFloat(r),
|
|
2447
|
-
let e = parseFloat(((isNaN(S) ?
|
|
2448
|
-
i(String(
|
|
2449
|
-
},
|
|
2450
|
-
let e = parseFloat(((isNaN(S) ?
|
|
2451
|
-
i(String(
|
|
2452
|
-
},
|
|
2289
|
+
}), Oe = ({ label: e, value: r, onChange: i, error: s, style: c = {}, width: l, disabled: u, regex: d, hasPadding: f = !1, format: p, startAdornment: m, helperText: ee, showErrorText: h = !0, className: g, onBlur: _, min: v, max: y, step: b = 1, display: x = "standard", ...te }) => {
|
|
2290
|
+
let S = r === "" ? NaN : parseFloat(r), C = () => {
|
|
2291
|
+
let e = parseFloat(((isNaN(S) ? v ?? 0 : S) - b).toFixed(10));
|
|
2292
|
+
i(String(v === void 0 ? e : Math.max(v, e)));
|
|
2293
|
+
}, ne = () => {
|
|
2294
|
+
let e = parseFloat(((isNaN(S) ? v ?? 0 : S) + b).toFixed(10));
|
|
2295
|
+
i(String(y === void 0 ? e : Math.min(y, e)));
|
|
2296
|
+
}, re = (e) => {
|
|
2453
2297
|
e.preventDefault();
|
|
2454
2298
|
let t = e.target.value;
|
|
2455
|
-
(
|
|
2456
|
-
},
|
|
2457
|
-
icon: /* @__PURE__ */ t(
|
|
2458
|
-
onClick: te,
|
|
2459
|
-
disabled: l || w,
|
|
2460
|
-
"aria-label": "Decrease value"
|
|
2461
|
-
}), ie = /* @__PURE__ */ t(_e, {
|
|
2462
|
-
icon: /* @__PURE__ */ t(a, { name: "add" }),
|
|
2299
|
+
(d && d.test(t) || !d) && i(p && t ? p(t) : t);
|
|
2300
|
+
}, ie = !isNaN(S) && v !== void 0 && S <= v, w = !isNaN(S) && y !== void 0 && S >= y, ae = /* @__PURE__ */ t(a, {
|
|
2301
|
+
icon: /* @__PURE__ */ t(o, { name: "remove" }),
|
|
2463
2302
|
onClick: C,
|
|
2464
|
-
disabled:
|
|
2303
|
+
disabled: u || ie,
|
|
2304
|
+
"aria-label": "Decrease value"
|
|
2305
|
+
}), oe = /* @__PURE__ */ t(a, {
|
|
2306
|
+
icon: /* @__PURE__ */ t(o, { name: "add" }),
|
|
2307
|
+
onClick: ne,
|
|
2308
|
+
disabled: u || w,
|
|
2465
2309
|
"aria-label": "Increase value"
|
|
2466
|
-
}),
|
|
2310
|
+
}), T = x === "spinner", se = T || !!m;
|
|
2467
2311
|
return /* @__PURE__ */ n("div", {
|
|
2468
2312
|
className: [
|
|
2469
|
-
|
|
2470
|
-
|
|
2313
|
+
J,
|
|
2314
|
+
f ? `${J}-paddingBottom` : "",
|
|
2471
2315
|
g || ""
|
|
2472
2316
|
].join(" "),
|
|
2473
|
-
css:
|
|
2474
|
-
"data-testid":
|
|
2317
|
+
css: Ee(c),
|
|
2318
|
+
"data-testid": J,
|
|
2475
2319
|
children: [/* @__PURE__ */ n("div", {
|
|
2476
|
-
className: `${
|
|
2320
|
+
className: `${J}-container`,
|
|
2477
2321
|
children: [
|
|
2478
|
-
|
|
2322
|
+
T ? /* @__PURE__ */ t(De, { children: ae }) : m && /* @__PURE__ */ t(De, { children: m }),
|
|
2479
2323
|
/* @__PURE__ */ t("input", {
|
|
2480
2324
|
className: [
|
|
2481
|
-
`${
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2325
|
+
`${J}-inputField`,
|
|
2326
|
+
s && `${J}-error`,
|
|
2327
|
+
se && `${J}-open`,
|
|
2328
|
+
se && `${J}-left`,
|
|
2329
|
+
T && `${J}-spinner`
|
|
2486
2330
|
].join(" "),
|
|
2487
2331
|
placeholder: " ",
|
|
2488
2332
|
value: r,
|
|
2489
|
-
disabled:
|
|
2490
|
-
"data-testid": `${
|
|
2491
|
-
onChange:
|
|
2492
|
-
onBlur:
|
|
2333
|
+
disabled: u,
|
|
2334
|
+
"data-testid": `${J}-inputField`,
|
|
2335
|
+
onChange: re,
|
|
2336
|
+
onBlur: _,
|
|
2493
2337
|
type: "number",
|
|
2494
|
-
...
|
|
2338
|
+
...te
|
|
2495
2339
|
}),
|
|
2496
|
-
/* @__PURE__ */ t(
|
|
2340
|
+
/* @__PURE__ */ t(De, { children: T ? oe : /* @__PURE__ */ n("div", {
|
|
2497
2341
|
style: {
|
|
2498
2342
|
display: "flex",
|
|
2499
2343
|
gap: "8px"
|
|
2500
2344
|
},
|
|
2501
|
-
children: [
|
|
2345
|
+
children: [ae, oe]
|
|
2502
2346
|
}) }),
|
|
2503
2347
|
/* @__PURE__ */ t("fieldset", {
|
|
2504
2348
|
"aria-hidden": "true",
|
|
2505
|
-
className: `${
|
|
2349
|
+
className: `${J}-fieldset`,
|
|
2506
2350
|
children: /* @__PURE__ */ t("legend", {
|
|
2507
|
-
className: `${
|
|
2351
|
+
className: `${J}-legend`,
|
|
2508
2352
|
children: /* @__PURE__ */ t("span", {
|
|
2509
|
-
className: `${
|
|
2353
|
+
className: `${J}-text`,
|
|
2510
2354
|
children: e
|
|
2511
2355
|
})
|
|
2512
2356
|
})
|
|
2513
2357
|
}),
|
|
2514
2358
|
/* @__PURE__ */ t("span", {
|
|
2515
|
-
className: `${
|
|
2359
|
+
className: `${J}-label`,
|
|
2516
2360
|
children: e
|
|
2517
2361
|
})
|
|
2518
2362
|
]
|
|
2519
|
-
}), (h ||
|
|
2520
|
-
className: `${
|
|
2521
|
-
"data-testid": `${
|
|
2522
|
-
children: [
|
|
2363
|
+
}), (h || ee) && /* @__PURE__ */ n("span", {
|
|
2364
|
+
className: `${J}-helperText`,
|
|
2365
|
+
"data-testid": `${J}-helperText`,
|
|
2366
|
+
children: [ee && (!s || !h) && ee, h && s && s.message]
|
|
2523
2367
|
})]
|
|
2524
2368
|
});
|
|
2525
|
-
},
|
|
2526
|
-
let { field: i, fieldState: a } =
|
|
2369
|
+
}, ke = ({ name: e, control: n, ...r }) => {
|
|
2370
|
+
let { field: i, fieldState: a } = ce({
|
|
2527
2371
|
control: n,
|
|
2528
2372
|
name: e
|
|
2529
|
-
}), [o, s] =
|
|
2373
|
+
}), [o, s] = O(i.value !== void 0 && i.value !== null ? String(i.value) : ""), c = a.error, l = (e) => {
|
|
2530
2374
|
i.onChange(e === "" ? void 0 : Number(e)), s(e), c && i.onBlur();
|
|
2531
2375
|
};
|
|
2532
|
-
return /* @__PURE__ */ t(
|
|
2376
|
+
return /* @__PURE__ */ t(Oe, {
|
|
2533
2377
|
...r,
|
|
2534
2378
|
name: e,
|
|
2535
2379
|
value: o,
|
|
@@ -2537,51 +2381,51 @@ var B = "--DATEPICKER", Se = ({ name: e, label: r, control: i, language: o = m()
|
|
|
2537
2381
|
onBlur: () => i.onBlur(),
|
|
2538
2382
|
error: c
|
|
2539
2383
|
});
|
|
2540
|
-
},
|
|
2384
|
+
}, Ae = (e) => {
|
|
2541
2385
|
if (!e.control) {
|
|
2542
2386
|
let { name: n, control: r, onValueChange: i, value: a, ...o } = e;
|
|
2543
|
-
return /* @__PURE__ */ t(
|
|
2387
|
+
return /* @__PURE__ */ t(Oe, {
|
|
2544
2388
|
...o,
|
|
2545
2389
|
name: n,
|
|
2546
2390
|
value: a === void 0 ? "" : String(a),
|
|
2547
2391
|
onChange: i || (() => {})
|
|
2548
2392
|
});
|
|
2549
2393
|
}
|
|
2550
|
-
return /* @__PURE__ */ t(
|
|
2551
|
-
},
|
|
2552
|
-
let { componentStyles: a } = e([
|
|
2553
|
-
return /* @__PURE__ */ t(
|
|
2394
|
+
return /* @__PURE__ */ t(ke, { ...e });
|
|
2395
|
+
}, je = ({ theme: n, variant: r = "default", ...i }) => {
|
|
2396
|
+
let { componentStyles: a } = e([s.NUMBERFIELD], n, r.toUpperCase());
|
|
2397
|
+
return /* @__PURE__ */ t(Ae, {
|
|
2554
2398
|
...i,
|
|
2555
2399
|
style: a
|
|
2556
2400
|
});
|
|
2557
|
-
},
|
|
2401
|
+
}, Me = (e, t) => `
|
|
2558
2402
|
// BACKGROUNDS
|
|
2559
2403
|
${i(e, "background-color", `--RADIO-EVENTS-${t}-BACKGROUND-COLOR`)}
|
|
2560
|
-
`,
|
|
2404
|
+
`, Ne = (e, t) => `
|
|
2561
2405
|
// BORDERS
|
|
2562
2406
|
${i(e, "border-color", `--RADIO-EVENTS-${t}-BORDER-COLOR`)}
|
|
2563
2407
|
${i(e, "border-width", `--RADIO-EVENTS-${t}-BORDER-WIDTH`)}
|
|
2564
2408
|
${i(e, "border-style", `--RADIO-EVENTS-${t}-BORDER-STYLE`)}
|
|
2565
|
-
`,
|
|
2409
|
+
`, Pe = (e, t) => `
|
|
2566
2410
|
// OUTLINE
|
|
2567
2411
|
${i(e, "outline-color", `--RADIO-EVENTS-${t}-OUTLINE-COLOR`)}
|
|
2568
2412
|
${i(e, "outline-width", `--RADIO-EVENTS-${t}-OUTLINE-WIDTH`)}
|
|
2569
2413
|
${i(e, "outline-style", `--RADIO-EVENTS-${t}-OUTLINE-STYLE`)}
|
|
2570
2414
|
${i(e, "outline-offset", `--RADIO-EVENTS-${t}-OUTLINE-OFFSET`)}
|
|
2571
|
-
`,
|
|
2415
|
+
`, Fe = (e, t) => `
|
|
2572
2416
|
// SHADOW
|
|
2573
2417
|
${i(e, "background-color", `--RADIO-EVENTS-${t}-SHADOW-COLOR`)}
|
|
2574
|
-
`,
|
|
2418
|
+
`, Ie = (e, t) => `
|
|
2575
2419
|
// UTILS
|
|
2576
2420
|
> span {
|
|
2577
2421
|
${i(e, "color", `--RADIO-EVENTS-${t}-ICON-COLOR`)};
|
|
2578
2422
|
}
|
|
2579
|
-
`,
|
|
2423
|
+
`, Le = (e, t) => `
|
|
2580
2424
|
// TYPOGRAPHY
|
|
2581
2425
|
.--RADIO-label {
|
|
2582
2426
|
${i(e, "color", `--RADIO-EVENTS-${t}-COLOR-PRIMARY`)}
|
|
2583
2427
|
}
|
|
2584
|
-
`,
|
|
2428
|
+
`, Re = (e) => k`
|
|
2585
2429
|
&.--RADIO {
|
|
2586
2430
|
display: flex;
|
|
2587
2431
|
flex-direction: column;
|
|
@@ -2595,53 +2439,53 @@ var B = "--DATEPICKER", Se = ({ name: e, label: r, control: i, language: o = m()
|
|
|
2595
2439
|
cursor: pointer;
|
|
2596
2440
|
|
|
2597
2441
|
// ENABLED
|
|
2598
|
-
${
|
|
2442
|
+
${Le(e, "ENABLED")};
|
|
2599
2443
|
|
|
2600
2444
|
// VALUE
|
|
2601
2445
|
&:has(.--RADIO-inputField:checked) {
|
|
2602
|
-
${
|
|
2446
|
+
${Le(e, "VALUE")};
|
|
2603
2447
|
}
|
|
2604
2448
|
|
|
2605
2449
|
// HOVER
|
|
2606
2450
|
&:hover {
|
|
2607
|
-
${
|
|
2451
|
+
${Le(e, "HOVER")};
|
|
2608
2452
|
|
|
2609
2453
|
.--RADIO-radio .--RADIO-span {
|
|
2610
2454
|
&:before {
|
|
2611
2455
|
opacity: 1;
|
|
2612
|
-
${
|
|
2456
|
+
${Fe(e, "HOVER")};
|
|
2613
2457
|
}
|
|
2614
2458
|
}
|
|
2615
2459
|
}
|
|
2616
2460
|
|
|
2617
2461
|
// ACTIVE
|
|
2618
2462
|
&:has(.--RADIO-inputField.--RADIO-active, .--RADIO-inputField:active) {
|
|
2619
|
-
${
|
|
2463
|
+
${Le(e, "ACTIVE")};
|
|
2620
2464
|
}
|
|
2621
2465
|
|
|
2622
2466
|
// FOCUS-VISIBLE
|
|
2623
2467
|
&:has(.--RADIO-inputField:focus-visible) {
|
|
2624
|
-
${
|
|
2468
|
+
${Le(e, "FOCUS")};
|
|
2625
2469
|
}
|
|
2626
2470
|
|
|
2627
2471
|
// ERROR
|
|
2628
2472
|
&:has(.--RADIO-inputField.--RADIO-error) {
|
|
2629
|
-
${
|
|
2473
|
+
${Le(e, "ERROR")};
|
|
2630
2474
|
}
|
|
2631
2475
|
|
|
2632
2476
|
// ERROR + VALUE
|
|
2633
2477
|
&:has(.--RADIO-inputField.--RADIO-error:checked) {
|
|
2634
|
-
${
|
|
2478
|
+
${Le(e, "ERROR_VALUE")};
|
|
2635
2479
|
}
|
|
2636
2480
|
|
|
2637
2481
|
// ERROR + HOVER
|
|
2638
2482
|
&:hover:has(.--RADIO-inputField.--RADIO-error) {
|
|
2639
|
-
${
|
|
2483
|
+
${Le(e, "ERROR_HOVER")};
|
|
2640
2484
|
|
|
2641
2485
|
.--RADIO-radio .--RADIO-span {
|
|
2642
2486
|
&:before {
|
|
2643
2487
|
opacity: 1;
|
|
2644
|
-
${
|
|
2488
|
+
${Fe(e, "ERROR_HOVER")};
|
|
2645
2489
|
}
|
|
2646
2490
|
}
|
|
2647
2491
|
}
|
|
@@ -2649,23 +2493,23 @@ var B = "--DATEPICKER", Se = ({ name: e, label: r, control: i, language: o = m()
|
|
|
2649
2493
|
// ERROR + ACTIVE
|
|
2650
2494
|
&:has(.--RADIO-inputField.--RADIO-error:active),
|
|
2651
2495
|
&:has(.--RADIO-inputField.--RADIO-error.--RADIO-active) {
|
|
2652
|
-
${
|
|
2496
|
+
${Le(e, "ERROR_ACTIVE")};
|
|
2653
2497
|
}
|
|
2654
2498
|
|
|
2655
2499
|
// ERROR + FOCUS
|
|
2656
2500
|
&:has(.--RADIO-inputField.--RADIO-error:focus-visible) {
|
|
2657
|
-
${
|
|
2501
|
+
${Le(e, "ERROR_FOCUS")};
|
|
2658
2502
|
}
|
|
2659
2503
|
|
|
2660
2504
|
// DISABLED
|
|
2661
2505
|
&:has(.--RADIO-inputField:disabled) {
|
|
2662
2506
|
pointer-events: none;
|
|
2663
|
-
${
|
|
2507
|
+
${Le(e, "DISABLED")};
|
|
2664
2508
|
}
|
|
2665
2509
|
|
|
2666
2510
|
// DISABLED + VALUE
|
|
2667
2511
|
&:has(.--RADIO-inputField:disabled:checked) {
|
|
2668
|
-
${
|
|
2512
|
+
${Le(e, "DISABLED_VALUE")};
|
|
2669
2513
|
}
|
|
2670
2514
|
|
|
2671
2515
|
.--RADIO-radio {
|
|
@@ -2694,16 +2538,16 @@ var B = "--DATEPICKER", Se = ({ name: e, label: r, control: i, language: o = m()
|
|
|
2694
2538
|
|
|
2695
2539
|
// ENABLED
|
|
2696
2540
|
~ .--RADIO-span {
|
|
2697
|
-
${
|
|
2698
|
-
${
|
|
2699
|
-
${
|
|
2541
|
+
${Me(e, "ENABLED")};
|
|
2542
|
+
${Ne(e, "ENABLED")};
|
|
2543
|
+
${Ie(e, "ENABLED")};
|
|
2700
2544
|
}
|
|
2701
2545
|
|
|
2702
2546
|
// VALUE
|
|
2703
2547
|
&:checked ~ .--RADIO-span {
|
|
2704
|
-
${
|
|
2705
|
-
${
|
|
2706
|
-
${
|
|
2548
|
+
${Me(e, "VALUE")};
|
|
2549
|
+
${Ne(e, "VALUE")};
|
|
2550
|
+
${Ie(e, "VALUE")};
|
|
2707
2551
|
}
|
|
2708
2552
|
|
|
2709
2553
|
// HOVER
|
|
@@ -2714,29 +2558,29 @@ var B = "--DATEPICKER", Se = ({ name: e, label: r, control: i, language: o = m()
|
|
|
2714
2558
|
&:active ~ .--RADIO-span {
|
|
2715
2559
|
&:before {
|
|
2716
2560
|
opacity: 1;
|
|
2717
|
-
${
|
|
2561
|
+
${Fe(e, "ACTIVE")};
|
|
2718
2562
|
}
|
|
2719
2563
|
}
|
|
2720
2564
|
|
|
2721
2565
|
// FOCUS
|
|
2722
2566
|
&:focus-visible ~ .--RADIO-span {
|
|
2723
2567
|
outline: none;
|
|
2724
|
-
${
|
|
2725
|
-
${
|
|
2568
|
+
${Pe(e, "FOCUS")};
|
|
2569
|
+
${Ie(e, "FOCUS")};
|
|
2726
2570
|
}
|
|
2727
2571
|
|
|
2728
2572
|
// ERROR
|
|
2729
2573
|
&.--RADIO-error ~ .--RADIO-span {
|
|
2730
|
-
${
|
|
2731
|
-
${
|
|
2732
|
-
${
|
|
2574
|
+
${Me(e, "ERROR")};
|
|
2575
|
+
${Ne(e, "ERROR")};
|
|
2576
|
+
${Ie(e, "ERROR")};
|
|
2733
2577
|
}
|
|
2734
2578
|
|
|
2735
2579
|
// ERROR + VALUE
|
|
2736
2580
|
&.--RADIO-error:checked ~ .--RADIO-span {
|
|
2737
|
-
${
|
|
2738
|
-
${
|
|
2739
|
-
${
|
|
2581
|
+
${Me(e, "ERROR_VALUE")};
|
|
2582
|
+
${Ne(e, "ERROR_VALUE")};
|
|
2583
|
+
${Ie(e, "ERROR_VALUE")};
|
|
2740
2584
|
}
|
|
2741
2585
|
|
|
2742
2586
|
// ERROR + VALUE
|
|
@@ -2747,28 +2591,28 @@ var B = "--DATEPICKER", Se = ({ name: e, label: r, control: i, language: o = m()
|
|
|
2747
2591
|
&.--RADIO-error.--RADIO-active ~ .--RADIO-span {
|
|
2748
2592
|
&:before {
|
|
2749
2593
|
opacity: 1;
|
|
2750
|
-
${
|
|
2594
|
+
${Fe(e, "ERROR_ACTIVE")};
|
|
2751
2595
|
}
|
|
2752
2596
|
}
|
|
2753
2597
|
|
|
2754
2598
|
// ERROR + FOCUS
|
|
2755
2599
|
&.--RADIO-error:focus-visible ~ .--RADIO-span {
|
|
2756
|
-
${
|
|
2757
|
-
${
|
|
2600
|
+
${Pe(e, "ERROR_FOCUS")};
|
|
2601
|
+
${Ie(e, "ERROR_FOCUS")};
|
|
2758
2602
|
}
|
|
2759
2603
|
|
|
2760
2604
|
// DISABLED
|
|
2761
2605
|
&:disabled ~ .--RADIO-span {
|
|
2762
|
-
${
|
|
2763
|
-
${
|
|
2764
|
-
${
|
|
2606
|
+
${Me(e, "DISABLED")};
|
|
2607
|
+
${Ne(e, "DISABLED")};
|
|
2608
|
+
${Ie(e, "DISABLED")};
|
|
2765
2609
|
}
|
|
2766
2610
|
|
|
2767
2611
|
// DISABLED + VALUE
|
|
2768
2612
|
&:disabled:checked ~ .--RADIO-span {
|
|
2769
|
-
${
|
|
2770
|
-
${
|
|
2771
|
-
${
|
|
2613
|
+
${Me(e, "DISABLED_VALUE")};
|
|
2614
|
+
${Ne(e, "DISABLED_VALUE")};
|
|
2615
|
+
${Ie(e, "DISABLED_VALUE")};
|
|
2772
2616
|
}
|
|
2773
2617
|
}
|
|
2774
2618
|
|
|
@@ -2811,33 +2655,33 @@ var B = "--DATEPICKER", Se = ({ name: e, label: r, control: i, language: o = m()
|
|
|
2811
2655
|
}
|
|
2812
2656
|
}
|
|
2813
2657
|
}
|
|
2814
|
-
`,
|
|
2658
|
+
`, ze = "--RADIO", Be = w.forwardRef(({ label: e, icon: r = /* @__PURE__ */ t(o, {
|
|
2815
2659
|
name: "circle",
|
|
2816
2660
|
fill: !0,
|
|
2817
2661
|
style: { fontSize: "16px" }
|
|
2818
|
-
}), className: i, style:
|
|
2819
|
-
let [_, v] =
|
|
2662
|
+
}), className: i, style: a = {}, disabled: s, checked: c, onSelect: l, error: u, onKeyDown: d, onKeyUp: f, onBlur: p, value: m, name: ee, ...h }, g) => {
|
|
2663
|
+
let [_, v] = O(!1);
|
|
2820
2664
|
return /* @__PURE__ */ t("div", {
|
|
2821
2665
|
className: [
|
|
2822
|
-
|
|
2823
|
-
_ ? `${
|
|
2666
|
+
ze,
|
|
2667
|
+
_ ? `${ze}-active` : "",
|
|
2824
2668
|
i || ""
|
|
2825
2669
|
].join(" "),
|
|
2826
|
-
css:
|
|
2827
|
-
"data-testid":
|
|
2670
|
+
css: Re(a),
|
|
2671
|
+
"data-testid": ze,
|
|
2828
2672
|
children: /* @__PURE__ */ n("label", {
|
|
2829
|
-
className: `${
|
|
2673
|
+
className: `${ze}-container`,
|
|
2830
2674
|
children: [/* @__PURE__ */ n("div", {
|
|
2831
|
-
className: `${
|
|
2675
|
+
className: `${ze}-radio`,
|
|
2832
2676
|
children: [/* @__PURE__ */ t("input", {
|
|
2833
2677
|
className: [
|
|
2834
|
-
`${
|
|
2835
|
-
_ ? `${
|
|
2836
|
-
u ? `${
|
|
2678
|
+
`${ze}-inputField`,
|
|
2679
|
+
_ ? `${ze}-active` : "",
|
|
2680
|
+
u ? `${ze}-error` : ""
|
|
2837
2681
|
].join(" "),
|
|
2838
2682
|
type: "radio",
|
|
2839
2683
|
value: m,
|
|
2840
|
-
name:
|
|
2684
|
+
name: ee,
|
|
2841
2685
|
checked: c,
|
|
2842
2686
|
disabled: s,
|
|
2843
2687
|
onChange: () => l(),
|
|
@@ -2850,64 +2694,64 @@ var B = "--DATEPICKER", Se = ({ name: e, label: r, control: i, language: o = m()
|
|
|
2850
2694
|
onBlur: () => {
|
|
2851
2695
|
v(!1), p?.({});
|
|
2852
2696
|
},
|
|
2853
|
-
ref:
|
|
2854
|
-
"data-testid": `${
|
|
2855
|
-
...
|
|
2697
|
+
ref: g,
|
|
2698
|
+
"data-testid": `${ze}-inputField`,
|
|
2699
|
+
...h
|
|
2856
2700
|
}), /* @__PURE__ */ t("span", {
|
|
2857
|
-
className: `${
|
|
2858
|
-
"data-testid": `${
|
|
2701
|
+
className: `${ze}-span`,
|
|
2702
|
+
"data-testid": `${ze}-icon`,
|
|
2859
2703
|
children: r
|
|
2860
2704
|
})]
|
|
2861
2705
|
}), /* @__PURE__ */ t("span", {
|
|
2862
|
-
className: `${
|
|
2863
|
-
"data-testid": `${
|
|
2706
|
+
className: `${ze}-label`,
|
|
2707
|
+
"data-testid": `${ze}-label`,
|
|
2864
2708
|
children: e
|
|
2865
2709
|
})]
|
|
2866
2710
|
})
|
|
2867
2711
|
});
|
|
2868
2712
|
});
|
|
2869
|
-
|
|
2870
|
-
var
|
|
2871
|
-
let n =
|
|
2713
|
+
Be.displayName = "RadioBase";
|
|
2714
|
+
var Ve = (e) => {
|
|
2715
|
+
let n = oe(c);
|
|
2872
2716
|
if (!n) throw Error("Radio must be used inside a RadioGroup.");
|
|
2873
|
-
let { value: r, ...i } = e, a = n.selectedValue === r, o = n.selectedValue === "",
|
|
2874
|
-
return /* @__PURE__ */ t(
|
|
2717
|
+
let { value: r, ...i } = e, a = n.selectedValue === r, o = n.selectedValue === "", s = a || o && n.firstValue === r ? 0 : -1;
|
|
2718
|
+
return /* @__PURE__ */ t(Be, {
|
|
2875
2719
|
...i,
|
|
2876
2720
|
name: n.name,
|
|
2877
2721
|
value: r,
|
|
2878
2722
|
checked: a,
|
|
2879
2723
|
onSelect: () => n.onChange(r),
|
|
2880
2724
|
disabled: i.disabled ?? n.disabled,
|
|
2881
|
-
tabIndex:
|
|
2725
|
+
tabIndex: s
|
|
2882
2726
|
});
|
|
2883
|
-
},
|
|
2884
|
-
let { componentStyles: a } = e([
|
|
2885
|
-
return /* @__PURE__ */ t(
|
|
2727
|
+
}, He = ({ theme: n, variant: r = "default", ...i }) => {
|
|
2728
|
+
let { componentStyles: a } = e([s.RADIO], n, r.toUpperCase());
|
|
2729
|
+
return /* @__PURE__ */ t(Ve, {
|
|
2886
2730
|
...i,
|
|
2887
2731
|
style: a
|
|
2888
2732
|
});
|
|
2889
|
-
},
|
|
2733
|
+
}, Ue = (e, t) => `
|
|
2890
2734
|
// BORDERS
|
|
2891
2735
|
${i(e, "border-color", `--SELECT-EVENTS-${t}-BORDER-COLOR`)}
|
|
2892
2736
|
${i(e, "border-width", `--SELECT-EVENTS-${t}-BORDER-WIDTH`)}
|
|
2893
2737
|
${i(e, "border-style", `--SELECT-EVENTS-${t}-BORDER-STYLE`)}
|
|
2894
|
-
`,
|
|
2738
|
+
`, Y = (e, t) => `
|
|
2895
2739
|
// TYPOGRAPHY
|
|
2896
2740
|
${i(e, "color", `--SELECT-EVENTS-${t}-COLOR-PRIMARY`)}
|
|
2897
2741
|
${i(e, "caret-color", `--SELECT-EVENTS-${t}-FONT-PRIMARY`)}
|
|
2898
|
-
`,
|
|
2742
|
+
`, We = (e, t, n = !1) => `
|
|
2899
2743
|
${i(e, "color", `--SELECT-EVENTS-${t}-COLOR-SECONDARY`)}
|
|
2900
2744
|
${n ? "transform: translate(14px, -24px); font-size: 0.75rem;" : ""}
|
|
2901
|
-
`,
|
|
2745
|
+
`, Ge = (e) => `
|
|
2902
2746
|
.--SELECT-legend {
|
|
2903
2747
|
max-width: ${e ? "100%" : "0px"};
|
|
2904
2748
|
}
|
|
2905
|
-
`,
|
|
2749
|
+
`, Ke = (e, t) => `
|
|
2906
2750
|
${i(e, "background-color", `--SELECT-EVENTS-${t}-BACKGROUND-COLOR`)}
|
|
2907
2751
|
~ .--SELECT-helperText {
|
|
2908
2752
|
${i(e, "color", `--SELECT-EVENTS-${t}-COLOR-TERTIARY`)}
|
|
2909
2753
|
}
|
|
2910
|
-
`,
|
|
2754
|
+
`, qe = (e) => k`
|
|
2911
2755
|
&.--SELECT {
|
|
2912
2756
|
position: relative;
|
|
2913
2757
|
padding: 0;
|
|
@@ -2932,64 +2776,64 @@ var Ye = (e) => {
|
|
|
2932
2776
|
${i(e, "border-radius", "--SELECT-ROOT-BORDER-RADIUS")};
|
|
2933
2777
|
|
|
2934
2778
|
// ENABLED
|
|
2935
|
-
${
|
|
2779
|
+
${Ke(e, "ENABLED")};
|
|
2936
2780
|
|
|
2937
2781
|
// VALUE
|
|
2938
2782
|
&:has(.--SELECT-selectField:not(:placeholder-shown)) {
|
|
2939
|
-
${
|
|
2783
|
+
${Ke(e, "VALUE")};
|
|
2940
2784
|
}
|
|
2941
2785
|
|
|
2942
2786
|
// HOVER
|
|
2943
2787
|
&:has(.--SELECT-selectField:hover) {
|
|
2944
|
-
${
|
|
2788
|
+
${Ke(e, "HOVER")};
|
|
2945
2789
|
}
|
|
2946
2790
|
|
|
2947
2791
|
// ACTIVE
|
|
2948
2792
|
&:has(.--SELECT-selectField:active, .--SELECT-selectField.--SELECT-active) {
|
|
2949
|
-
${
|
|
2793
|
+
${Ke(e, "ACTIVE")};
|
|
2950
2794
|
}
|
|
2951
2795
|
|
|
2952
2796
|
// FOCUS
|
|
2953
2797
|
&:has(.--SELECT-selectField:focus-visible) {
|
|
2954
2798
|
outline: none;
|
|
2955
|
-
${
|
|
2799
|
+
${Ke(e, "FOCUS")};
|
|
2956
2800
|
}
|
|
2957
2801
|
|
|
2958
2802
|
// ERROR
|
|
2959
2803
|
&:has(.--SELECT-selectField.--SELECT-error) {
|
|
2960
|
-
${
|
|
2804
|
+
${Ke(e, "ERROR")};
|
|
2961
2805
|
}
|
|
2962
2806
|
|
|
2963
2807
|
// ERROR + VALUE
|
|
2964
2808
|
&:has(.--SELECT-selectField.--SELECT-error:not(:placeholder-shown)) {
|
|
2965
|
-
${
|
|
2809
|
+
${Ke(e, "ERROR_VALUE")};
|
|
2966
2810
|
}
|
|
2967
2811
|
|
|
2968
2812
|
// ERROR + HOVER
|
|
2969
2813
|
&:has(.--SELECT-selectField.--SELECT-error:hover) {
|
|
2970
|
-
${
|
|
2814
|
+
${Ke(e, "ERROR_HOVER")};
|
|
2971
2815
|
}
|
|
2972
2816
|
|
|
2973
2817
|
// ERROR + ACTIVE
|
|
2974
2818
|
&:has(.--SELECT-selectField.--SELECT-error:active, .--SELECT-selectField.--SELECT-error.--SELECT-active) {
|
|
2975
|
-
${
|
|
2819
|
+
${Ke(e, "ERROR_ACTIVE")};
|
|
2976
2820
|
}
|
|
2977
2821
|
|
|
2978
2822
|
// ERROR + FOCUS
|
|
2979
2823
|
&:has(.--SELECT-selectField.--SELECT-error:focus-visible) {
|
|
2980
|
-
${
|
|
2824
|
+
${Ke(e, "ERROR_FOCUS")};
|
|
2981
2825
|
}
|
|
2982
2826
|
|
|
2983
2827
|
// DISABLED
|
|
2984
2828
|
&:has(.--SELECT-selectField:disabled) {
|
|
2985
2829
|
pointer-events: none;
|
|
2986
|
-
${
|
|
2830
|
+
${Ke(e, "DISABLED")};
|
|
2987
2831
|
}
|
|
2988
2832
|
|
|
2989
2833
|
// DISABLED + VALUE
|
|
2990
2834
|
&:has(.--SELECT-selectField:disabled:not(:placeholder-shown)) {
|
|
2991
2835
|
pointer-events: none;
|
|
2992
|
-
${
|
|
2836
|
+
${Ke(e, "DISABLED-VALUE")};
|
|
2993
2837
|
}
|
|
2994
2838
|
|
|
2995
2839
|
.--SELECT-selectField {
|
|
@@ -3022,118 +2866,118 @@ var Ye = (e) => {
|
|
|
3022
2866
|
}
|
|
3023
2867
|
|
|
3024
2868
|
// ENABLED
|
|
3025
|
-
${
|
|
2869
|
+
${Y(e, "ENABLED")};
|
|
3026
2870
|
~ .--SELECT-label {
|
|
3027
|
-
${
|
|
2871
|
+
${We(e, "ENABLED")}
|
|
3028
2872
|
}
|
|
3029
2873
|
~ .--SELECT-fieldset {
|
|
3030
|
-
${
|
|
2874
|
+
${Ue(e, "ENABLED")}
|
|
3031
2875
|
}
|
|
3032
2876
|
|
|
3033
2877
|
// VALUE
|
|
3034
2878
|
&:not(:placeholder-shown),
|
|
3035
2879
|
&[placeholder]:not([placeholder=' ']),
|
|
3036
2880
|
&.--SELECT-open {
|
|
3037
|
-
${
|
|
2881
|
+
${Y(e, "VALUE")};
|
|
3038
2882
|
~ .--SELECT-label {
|
|
3039
|
-
${
|
|
2883
|
+
${We(e, "VALUE", !0)}
|
|
3040
2884
|
}
|
|
3041
2885
|
~ .--SELECT-fieldset {
|
|
3042
|
-
${
|
|
3043
|
-
${
|
|
2886
|
+
${Ue(e, "VALUE")};
|
|
2887
|
+
${Ge(!0)};
|
|
3044
2888
|
}
|
|
3045
2889
|
}
|
|
3046
2890
|
|
|
3047
2891
|
// HOVER
|
|
3048
2892
|
&:hover {
|
|
3049
|
-
${
|
|
2893
|
+
${Y(e, "HOVER")};
|
|
3050
2894
|
~ .--SELECT-label {
|
|
3051
|
-
${
|
|
2895
|
+
${We(e, "HOVER")}
|
|
3052
2896
|
}
|
|
3053
2897
|
~ .--SELECT-fieldset {
|
|
3054
|
-
${
|
|
2898
|
+
${Ue(e, "HOVER")}
|
|
3055
2899
|
}
|
|
3056
2900
|
}
|
|
3057
2901
|
|
|
3058
2902
|
// ACTIVE
|
|
3059
2903
|
&:active,
|
|
3060
2904
|
&.--SELECT-active {
|
|
3061
|
-
${
|
|
2905
|
+
${Y(e, "ACTIVE")};
|
|
3062
2906
|
~ .--SELECT-label {
|
|
3063
|
-
${
|
|
2907
|
+
${We(e, "ACTIVE")};
|
|
3064
2908
|
}
|
|
3065
2909
|
~ .--SELECT-fieldset {
|
|
3066
|
-
${
|
|
2910
|
+
${Ue(e, "ACTIVE")};
|
|
3067
2911
|
}
|
|
3068
2912
|
}
|
|
3069
2913
|
|
|
3070
2914
|
// FOCUS
|
|
3071
2915
|
&:focus-visible {
|
|
3072
2916
|
outline: none;
|
|
3073
|
-
${
|
|
2917
|
+
${Y(e, "FOCUS")};
|
|
3074
2918
|
~ .--SELECT-label {
|
|
3075
|
-
${
|
|
2919
|
+
${We(e, "FOCUS", !0)}
|
|
3076
2920
|
}
|
|
3077
2921
|
~ .--SELECT-fieldset {
|
|
3078
|
-
${
|
|
3079
|
-
${
|
|
2922
|
+
${Ue(e, "FOCUS")};
|
|
2923
|
+
${Ge(!0)};
|
|
3080
2924
|
}
|
|
3081
2925
|
}
|
|
3082
2926
|
|
|
3083
2927
|
// ERROR
|
|
3084
2928
|
&.--SELECT-error {
|
|
3085
|
-
${
|
|
2929
|
+
${Y(e, "ERROR")};
|
|
3086
2930
|
~ .--SELECT-label {
|
|
3087
|
-
${
|
|
2931
|
+
${We(e, "ERROR")}
|
|
3088
2932
|
}
|
|
3089
2933
|
~ .--SELECT-fieldset {
|
|
3090
|
-
${
|
|
2934
|
+
${Ue(e, "ERROR")}
|
|
3091
2935
|
}
|
|
3092
2936
|
}
|
|
3093
2937
|
|
|
3094
2938
|
// ERROR + VALUE
|
|
3095
2939
|
&.--SELECT-error:not(:placeholder-shown),
|
|
3096
2940
|
&.--SELECT-error.--SELECT-open {
|
|
3097
|
-
${
|
|
2941
|
+
${Y(e, "ERROR_VALUE")};
|
|
3098
2942
|
~ .--SELECT-label {
|
|
3099
|
-
${
|
|
2943
|
+
${We(e, "ERROR_VALUE")};
|
|
3100
2944
|
}
|
|
3101
2945
|
~ .--SELECT-fieldset {
|
|
3102
|
-
${
|
|
2946
|
+
${Ue(e, "ERROR_VALUE")};
|
|
3103
2947
|
}
|
|
3104
2948
|
}
|
|
3105
2949
|
|
|
3106
2950
|
// ERROR + HOVER
|
|
3107
2951
|
&.--SELECT-error:hover {
|
|
3108
|
-
${
|
|
2952
|
+
${Y(e, "ERROR_HOVER")};
|
|
3109
2953
|
~ .--SELECT-label {
|
|
3110
|
-
${
|
|
2954
|
+
${We(e, "ERROR_HOVER")}
|
|
3111
2955
|
}
|
|
3112
2956
|
~ .--SELECT-fieldset {
|
|
3113
|
-
${
|
|
2957
|
+
${Ue(e, "ERROR_HOVER")}
|
|
3114
2958
|
}
|
|
3115
2959
|
}
|
|
3116
2960
|
|
|
3117
2961
|
// ERROR + ACTIVE
|
|
3118
2962
|
&.--SELECT-error:active,
|
|
3119
2963
|
&.--SELECT-error.--SELECT-active {
|
|
3120
|
-
${
|
|
2964
|
+
${Y(e, "ERROR_ACTIVE")};
|
|
3121
2965
|
~ .--SELECT-label {
|
|
3122
|
-
${
|
|
2966
|
+
${We(e, "ERROR_ACTIVE")}
|
|
3123
2967
|
}
|
|
3124
2968
|
~ .--SELECT-fieldset {
|
|
3125
|
-
${
|
|
2969
|
+
${Ue(e, "ERROR_ACTIVE")}
|
|
3126
2970
|
}
|
|
3127
2971
|
}
|
|
3128
2972
|
|
|
3129
2973
|
// ERROR + FOCUS
|
|
3130
2974
|
&.--SELECT-error:focus-visible {
|
|
3131
|
-
${
|
|
2975
|
+
${Y(e, "ERROR_FOCUS")};
|
|
3132
2976
|
~ .--SELECT-label {
|
|
3133
|
-
${
|
|
2977
|
+
${We(e, "ERROR_FOCUS")}
|
|
3134
2978
|
}
|
|
3135
2979
|
~ .--SELECT-fieldset {
|
|
3136
|
-
${
|
|
2980
|
+
${Ue(e, "ERROR_FOCUS")}
|
|
3137
2981
|
}
|
|
3138
2982
|
}
|
|
3139
2983
|
|
|
@@ -3141,12 +2985,12 @@ var Ye = (e) => {
|
|
|
3141
2985
|
&:disabled {
|
|
3142
2986
|
user-select: none;
|
|
3143
2987
|
pointer-events: none;
|
|
3144
|
-
${
|
|
2988
|
+
${Y(e, "DISABLED")};
|
|
3145
2989
|
~ .--SELECT-label {
|
|
3146
|
-
${
|
|
2990
|
+
${We(e, "DISABLED")}
|
|
3147
2991
|
}
|
|
3148
2992
|
~ .--SELECT-fieldset {
|
|
3149
|
-
${
|
|
2993
|
+
${Ue(e, "DISABLED")}
|
|
3150
2994
|
}
|
|
3151
2995
|
}
|
|
3152
2996
|
|
|
@@ -3155,12 +2999,12 @@ var Ye = (e) => {
|
|
|
3155
2999
|
&:disabled.--SELECT-open {
|
|
3156
3000
|
user-select: none;
|
|
3157
3001
|
pointer-events: none;
|
|
3158
|
-
${
|
|
3002
|
+
${Y(e, "DISABLED_VALUE")};
|
|
3159
3003
|
~ .--SELECT-label {
|
|
3160
|
-
${
|
|
3004
|
+
${We(e, "DISABLED_VALUE")}
|
|
3161
3005
|
}
|
|
3162
3006
|
~ .--SELECT-fieldset {
|
|
3163
|
-
${
|
|
3007
|
+
${Ue(e, "DISABLED_VALUE")}
|
|
3164
3008
|
}
|
|
3165
3009
|
}
|
|
3166
3010
|
}
|
|
@@ -3249,7 +3093,7 @@ var Ye = (e) => {
|
|
|
3249
3093
|
height: 16px;
|
|
3250
3094
|
}
|
|
3251
3095
|
}
|
|
3252
|
-
`,
|
|
3096
|
+
`, Je = (e, t) => `
|
|
3253
3097
|
// BACKGROUNDS
|
|
3254
3098
|
${i(e, "background-color", `--SELECTMENU-EVENTS-${t}-BACKGROUND-COLOR`)}
|
|
3255
3099
|
|
|
@@ -3258,11 +3102,11 @@ var Ye = (e) => {
|
|
|
3258
3102
|
${i(e, "border-width", `--SELECTMENU-EVENTS-${t}-BORDER-WIDTH`)}
|
|
3259
3103
|
${i(e, "border-style", `--SELECTMENU-EVENTS-${t}-BORDER-STYLE`)}
|
|
3260
3104
|
${i(e, "border-radius", `--SELECTMENU-EVENTS-${t}-BORDER-RADIUS`)}
|
|
3261
|
-
`,
|
|
3105
|
+
`, Ye = (e, t) => `
|
|
3262
3106
|
// TYPOGRAPHY
|
|
3263
3107
|
${i(e, "color", `--SELECTMENU-EVENTS-${t}-COLOR-PRIMARY`)};
|
|
3264
3108
|
${i(e, "caret-color", `--SELECTMENU-EVENTS-${t}-COLOR-PRIMARY`)};
|
|
3265
|
-
`,
|
|
3109
|
+
`, Xe = (e, t) => `
|
|
3266
3110
|
// BACKGROUNDS
|
|
3267
3111
|
${i(e, "background-color", `--SELECTMENU-${t}-BACKGROUND-COLOR`)}
|
|
3268
3112
|
|
|
@@ -3271,7 +3115,7 @@ var Ye = (e) => {
|
|
|
3271
3115
|
${i(e, "border-width", `--SELECTMENU-${t}-BORDER-WIDTH`)}
|
|
3272
3116
|
${i(e, "border-style", `--SELECTMENU-${t}-BORDER-STYLE`)}
|
|
3273
3117
|
${i(e, "border-radius", `--SELECTMENU-${t}-BORDER-RADIUS`)}
|
|
3274
|
-
`,
|
|
3118
|
+
`, Ze = (e) => k`
|
|
3275
3119
|
&.--SELECTMENU {
|
|
3276
3120
|
z-index: 100;
|
|
3277
3121
|
position: absolute;
|
|
@@ -3286,7 +3130,7 @@ var Ye = (e) => {
|
|
|
3286
3130
|
max-height: 126px; // 3 rows * 42px
|
|
3287
3131
|
overflow-y: auto;
|
|
3288
3132
|
cursor: pointer;
|
|
3289
|
-
${
|
|
3133
|
+
${Xe(e, "ROOT")}
|
|
3290
3134
|
|
|
3291
3135
|
// Animation
|
|
3292
3136
|
display: none;
|
|
@@ -3347,34 +3191,34 @@ var Ye = (e) => {
|
|
|
3347
3191
|
}
|
|
3348
3192
|
|
|
3349
3193
|
// ENABLED
|
|
3350
|
-
${
|
|
3351
|
-
${
|
|
3194
|
+
${Je(e, "ENABLED")}
|
|
3195
|
+
${Ye(e, "ENABLED")}
|
|
3352
3196
|
|
|
3353
3197
|
// VALUE
|
|
3354
3198
|
&.--SELECTMENU-selected {
|
|
3355
|
-
${
|
|
3356
|
-
${
|
|
3199
|
+
${Je(e, "VALUE")}
|
|
3200
|
+
${Ye(e, "VALUE")}
|
|
3357
3201
|
}
|
|
3358
3202
|
|
|
3359
3203
|
// HOVER
|
|
3360
3204
|
&:hover {
|
|
3361
|
-
${
|
|
3362
|
-
${
|
|
3205
|
+
${Je(e, "HOVER")}
|
|
3206
|
+
${Ye(e, "HOVER")}
|
|
3363
3207
|
}
|
|
3364
3208
|
|
|
3365
3209
|
// - ACTIVE
|
|
3366
3210
|
&:active,
|
|
3367
3211
|
&.--SELECTMENU-active {
|
|
3368
|
-
${
|
|
3369
|
-
${
|
|
3212
|
+
${Je(e, "ACTIVE")}
|
|
3213
|
+
${Ye(e, "ACTIVE")}
|
|
3370
3214
|
}
|
|
3371
3215
|
|
|
3372
3216
|
// FOCUS
|
|
3373
3217
|
&:focus-visible {
|
|
3374
3218
|
outline-offset: 0px;
|
|
3375
3219
|
outline: 0;
|
|
3376
|
-
${
|
|
3377
|
-
${
|
|
3220
|
+
${Je(e, "FOCUS")}
|
|
3221
|
+
${Ye(e, "FOCUS")}
|
|
3378
3222
|
}
|
|
3379
3223
|
|
|
3380
3224
|
&.--SELECTMENU-descriptionMenu {
|
|
@@ -3403,7 +3247,7 @@ var Ye = (e) => {
|
|
|
3403
3247
|
max-height: 156px; // 3 rows * 52px
|
|
3404
3248
|
}
|
|
3405
3249
|
}
|
|
3406
|
-
`, X = "--SELECTMENU",
|
|
3250
|
+
`, X = "--SELECTMENU", Qe = w.forwardRef(({ displayOptions: e, value: r, isOpen: i, hasStaticOptions: a, hasDescription: o, onChange: s, focusedElement: c, onScroll: l, style: u, className: d }, f) => (T(() => {
|
|
3407
3251
|
document.getElementById(`${X}-option-${c}`)?.scrollIntoView({ block: "nearest" });
|
|
3408
3252
|
}, [c]), /* @__PURE__ */ t("div", {
|
|
3409
3253
|
id: `${X}-root`,
|
|
@@ -3414,7 +3258,7 @@ var Ye = (e) => {
|
|
|
3414
3258
|
i && `${X}-open`,
|
|
3415
3259
|
d || ""
|
|
3416
3260
|
].join(" "),
|
|
3417
|
-
css:
|
|
3261
|
+
css: Ze(u),
|
|
3418
3262
|
onScroll: l,
|
|
3419
3263
|
role: "listbox",
|
|
3420
3264
|
ref: f,
|
|
@@ -3443,114 +3287,114 @@ var Ye = (e) => {
|
|
|
3443
3287
|
})]
|
|
3444
3288
|
}, e.value);
|
|
3445
3289
|
})
|
|
3446
|
-
}))),
|
|
3447
|
-
let { componentStyles: a } = e([
|
|
3448
|
-
return /* @__PURE__ */ t(
|
|
3290
|
+
}))), $e = w.forwardRef(({ theme: n, ...r }, i) => {
|
|
3291
|
+
let { componentStyles: a } = e([s.SELECTMENU, s.SELECT], n);
|
|
3292
|
+
return /* @__PURE__ */ t(Qe, {
|
|
3449
3293
|
...r,
|
|
3450
3294
|
style: a,
|
|
3451
3295
|
ref: i
|
|
3452
3296
|
});
|
|
3453
3297
|
});
|
|
3454
|
-
|
|
3298
|
+
$e.displayName = "SelectMenu";
|
|
3455
3299
|
//#endregion
|
|
3456
3300
|
//#region src/components/atoms/Select/Select.tsx
|
|
3457
|
-
var Z = "--SELECT",
|
|
3458
|
-
let { field:
|
|
3301
|
+
var Z = "--SELECT", et = [], tt = ({ name: e, label: r, control: i, options: s, disabled: c, range: l = 100, hasStaticOptions: u = !1, hasSearch: d = !1, hasDescription: f = !1, hasPadding: p = !1, showErrorText: m = !0, helperText: ee, style: h, className: g, ..._ }) => {
|
|
3302
|
+
let { field: v, fieldState: y } = ce({
|
|
3459
3303
|
control: i,
|
|
3460
3304
|
name: e
|
|
3461
|
-
}), [
|
|
3462
|
-
S(!1),
|
|
3463
|
-
},
|
|
3464
|
-
|
|
3305
|
+
}), [b, x] = ie(v.value || ""), [te, S] = ie(!1), C = D(!1), ne = D(null), w = D(null), ae = D(null), oe = s.find((e) => e.value === b), T = y.error, se = f ? 156 : 126, [E, k] = ie(oe?.label || ""), [A, le] = O(1), [j, ue] = O(!1), [M, N] = O(-1), P = te || !!(d && E && !b), F = (e) => {
|
|
3306
|
+
S(!1), k(e ?? oe?.label ?? ""), ue(!1), N(-1), C.current && v.onBlur();
|
|
3307
|
+
}, I = () => {
|
|
3308
|
+
C.current = !0, S(!0);
|
|
3465
3309
|
};
|
|
3466
|
-
|
|
3467
|
-
ref:
|
|
3468
|
-
onAction: () =>
|
|
3469
|
-
isActive:
|
|
3470
|
-
exceptRef:
|
|
3310
|
+
re({
|
|
3311
|
+
ref: ne,
|
|
3312
|
+
onAction: () => F(),
|
|
3313
|
+
isActive: P,
|
|
3314
|
+
exceptRef: w
|
|
3471
3315
|
});
|
|
3472
|
-
let
|
|
3473
|
-
|
|
3474
|
-
}, ue = (e) => {
|
|
3475
|
-
e.target.select();
|
|
3476
|
-
}, de = (e) => {
|
|
3477
|
-
e === "ArrowDown" && F ? P(N + 1 >= ct.length ? 0 : N + 1) : e === "ArrowUp" && F && P(N - 1 < 0 ? ct.length - 1 : N - 1);
|
|
3316
|
+
let de = (e) => {
|
|
3317
|
+
v.onChange(e.value), x(e.value), F(e.label);
|
|
3478
3318
|
}, fe = (e) => {
|
|
3479
|
-
|
|
3480
|
-
let e = ge()[N];
|
|
3481
|
-
e && le(e);
|
|
3482
|
-
} else F ? I() : L();
|
|
3483
|
-
else e.key === "Tab" || e.key === "Escape" ? I() : ["ArrowDown", "ArrowUp"].includes(e.key) && F && (e.preventDefault(), de(e.key));
|
|
3319
|
+
e.target.select();
|
|
3484
3320
|
}, pe = (e) => {
|
|
3485
|
-
|
|
3486
|
-
|
|
3487
|
-
|
|
3488
|
-
|
|
3489
|
-
|
|
3321
|
+
e === "ArrowDown" && P ? N(M + 1 >= et.length ? 0 : M + 1) : e === "ArrowUp" && P && N(M - 1 < 0 ? et.length - 1 : M - 1);
|
|
3322
|
+
}, L = (e) => {
|
|
3323
|
+
if (e.stopPropagation(), e.key === "Enter") if (e.preventDefault(), P && M >= 0) {
|
|
3324
|
+
let e = _e()[M];
|
|
3325
|
+
e && de(e);
|
|
3326
|
+
} else P ? F() : I();
|
|
3327
|
+
else e.key === "Tab" || e.key === "Escape" ? F() : ["ArrowDown", "ArrowUp"].includes(e.key) && P && (e.preventDefault(), pe(e.key));
|
|
3490
3328
|
}, me = (e) => {
|
|
3491
|
-
e.stopPropagation(),
|
|
3329
|
+
if (e.stopPropagation(), e.key === "Enter") if (e.preventDefault(), P && M >= 0) {
|
|
3330
|
+
let e = _e()[M];
|
|
3331
|
+
e && de(e);
|
|
3332
|
+
} else P ? F() : I();
|
|
3333
|
+
else e.key === "Tab" || e.key === "Escape" ? F() : ["ArrowDown", "ArrowUp"].includes(e.key) && (e.preventDefault(), ae.current?.focus(), pe(e.key));
|
|
3492
3334
|
}, he = (e) => {
|
|
3335
|
+
e.stopPropagation(), c || (P ? F() : I());
|
|
3336
|
+
}, R = (e) => {
|
|
3493
3337
|
e.preventDefault();
|
|
3494
3338
|
let { scrollHeight: t, scrollTop: n } = e.target;
|
|
3495
|
-
n +
|
|
3496
|
-
},
|
|
3339
|
+
n + se >= t && _e().length >= A * l && le(A + 1);
|
|
3340
|
+
}, ge = (e) => {
|
|
3497
3341
|
e.preventDefault();
|
|
3498
3342
|
let { value: t } = e.target;
|
|
3499
|
-
t.length > 2 &&
|
|
3500
|
-
},
|
|
3501
|
-
if (
|
|
3502
|
-
let e =
|
|
3503
|
-
if (
|
|
3504
|
-
let t =
|
|
3505
|
-
return
|
|
3343
|
+
t.length > 2 && le(1), k(t, () => ue(!0)), I();
|
|
3344
|
+
}, _e = () => {
|
|
3345
|
+
if (d && E && E.length > 2) {
|
|
3346
|
+
let e = s.slice(0, l * A);
|
|
3347
|
+
if (E === oe?.label && !j) return et = e, e;
|
|
3348
|
+
let t = s.filter((e) => e.label.toLocaleUpperCase().includes(E.toLocaleUpperCase())).slice(0, l * A);
|
|
3349
|
+
return et = j ? t || [] : e, t || [];
|
|
3506
3350
|
}
|
|
3507
|
-
return
|
|
3351
|
+
return et = s.slice(0, l * A), s.slice(0, l * A);
|
|
3508
3352
|
};
|
|
3509
3353
|
return /* @__PURE__ */ n("div", {
|
|
3510
3354
|
className: [
|
|
3511
3355
|
Z,
|
|
3512
|
-
|
|
3356
|
+
p ? `${Z}-paddingBottom` : "",
|
|
3513
3357
|
g || ""
|
|
3514
3358
|
].join(" "),
|
|
3515
|
-
css:
|
|
3359
|
+
css: qe(h),
|
|
3516
3360
|
"data-testid": Z,
|
|
3517
3361
|
children: [
|
|
3518
3362
|
/* @__PURE__ */ n("div", {
|
|
3519
3363
|
className: `${Z}-container`,
|
|
3520
|
-
onClick:
|
|
3521
|
-
onKeyDown: (e) => !
|
|
3364
|
+
onClick: he,
|
|
3365
|
+
onKeyDown: (e) => !c && L(e),
|
|
3522
3366
|
role: "button",
|
|
3523
|
-
ref:
|
|
3367
|
+
ref: w,
|
|
3524
3368
|
"data-testid": `${Z}-container`,
|
|
3525
3369
|
children: [
|
|
3526
3370
|
/* @__PURE__ */ t("input", {
|
|
3527
3371
|
name: e,
|
|
3528
3372
|
className: [
|
|
3529
3373
|
`${Z}-selectField`,
|
|
3530
|
-
|
|
3531
|
-
|
|
3374
|
+
P && `${Z}-open`,
|
|
3375
|
+
T && `${Z}-error`
|
|
3532
3376
|
].join(" "),
|
|
3533
|
-
onClick: (e) =>
|
|
3534
|
-
onChange:
|
|
3535
|
-
value:
|
|
3377
|
+
onClick: (e) => d && fe(e),
|
|
3378
|
+
onChange: ge,
|
|
3379
|
+
value: E,
|
|
3536
3380
|
placeholder: " ",
|
|
3537
|
-
disabled:
|
|
3538
|
-
readOnly: !
|
|
3539
|
-
ref:
|
|
3381
|
+
disabled: c,
|
|
3382
|
+
readOnly: !d,
|
|
3383
|
+
ref: ae,
|
|
3540
3384
|
role: "combobox",
|
|
3541
3385
|
autoComplete: "off",
|
|
3542
3386
|
"data-testid": `${Z}-selectField`,
|
|
3543
|
-
...
|
|
3544
|
-
...
|
|
3387
|
+
...d && { placeholder: "Search..." },
|
|
3388
|
+
..._
|
|
3545
3389
|
}),
|
|
3546
3390
|
/* @__PURE__ */ t("div", {
|
|
3547
3391
|
className: `${Z}-adornment`,
|
|
3548
|
-
children: /* @__PURE__ */ t(
|
|
3549
|
-
icon: /* @__PURE__ */ t(
|
|
3550
|
-
onClick:
|
|
3551
|
-
onKeyDown: (e) => !
|
|
3552
|
-
disabled:
|
|
3553
|
-
isFlipped: !
|
|
3392
|
+
children: /* @__PURE__ */ t(a, {
|
|
3393
|
+
icon: /* @__PURE__ */ t(o, { name: "arrow_drop_up" }),
|
|
3394
|
+
onClick: he,
|
|
3395
|
+
onKeyDown: (e) => !c && me(e),
|
|
3396
|
+
disabled: c,
|
|
3397
|
+
isFlipped: !P,
|
|
3554
3398
|
tabIndex: -1
|
|
3555
3399
|
})
|
|
3556
3400
|
}),
|
|
@@ -3571,40 +3415,40 @@ var Z = "--SELECT", ct = [], lt = ({ name: e, label: r, control: i, options: o,
|
|
|
3571
3415
|
})
|
|
3572
3416
|
]
|
|
3573
3417
|
}),
|
|
3574
|
-
(
|
|
3418
|
+
(m || ee) && /* @__PURE__ */ n("span", {
|
|
3575
3419
|
className: `${Z}-helperText`,
|
|
3576
3420
|
"data-testid": `${Z}-helperText`,
|
|
3577
|
-
children: [
|
|
3421
|
+
children: [ee && (!T || !m) && ee, m && T && T.message]
|
|
3578
3422
|
}),
|
|
3579
|
-
/* @__PURE__ */ t(
|
|
3580
|
-
displayOptions:
|
|
3581
|
-
value:
|
|
3582
|
-
isOpen:
|
|
3583
|
-
hasStaticOptions:
|
|
3584
|
-
hasDescription:
|
|
3585
|
-
onChange:
|
|
3586
|
-
focusedElement:
|
|
3587
|
-
onScroll:
|
|
3588
|
-
ref:
|
|
3423
|
+
/* @__PURE__ */ t($e, {
|
|
3424
|
+
displayOptions: P ? _e() : et,
|
|
3425
|
+
value: b,
|
|
3426
|
+
isOpen: P,
|
|
3427
|
+
hasStaticOptions: u,
|
|
3428
|
+
hasDescription: f,
|
|
3429
|
+
onChange: de,
|
|
3430
|
+
focusedElement: M,
|
|
3431
|
+
onScroll: R,
|
|
3432
|
+
ref: ne
|
|
3589
3433
|
})
|
|
3590
3434
|
]
|
|
3591
3435
|
});
|
|
3592
|
-
},
|
|
3593
|
-
let { componentStyles: a } = e([
|
|
3594
|
-
return /* @__PURE__ */ t(
|
|
3436
|
+
}, nt = ({ theme: n, variant: r = "default", ...i }) => {
|
|
3437
|
+
let { componentStyles: a } = e([s.SELECT], n, r.toUpperCase());
|
|
3438
|
+
return /* @__PURE__ */ t(tt, {
|
|
3595
3439
|
...i,
|
|
3596
3440
|
style: a
|
|
3597
3441
|
});
|
|
3598
|
-
},
|
|
3442
|
+
}, rt = (e, t) => `
|
|
3599
3443
|
~ .--SLIDER-rail {
|
|
3600
3444
|
${i(e, "background-color", `--SLIDER-EVENTS-${t}-BACKGROUND-COLOR`)}
|
|
3601
3445
|
}
|
|
3602
|
-
`,
|
|
3446
|
+
`, it = (e, t) => `
|
|
3603
3447
|
~ .--SLIDER-tracker {
|
|
3604
3448
|
// BACKGROUNDS
|
|
3605
3449
|
${i(e, "background-color", `--SLIDER-EVENTS-${t}-BACKGROUND-COLOR`)}
|
|
3606
3450
|
}
|
|
3607
|
-
`,
|
|
3451
|
+
`, at = (e, t) => `
|
|
3608
3452
|
~ .--SLIDER-thumbIcon {
|
|
3609
3453
|
// UTILS
|
|
3610
3454
|
${i(e, "background-color", `--SLIDER-EVENTS-${t}-ICON-BACKGROUND-COLOR`)}
|
|
@@ -3620,7 +3464,7 @@ var Z = "--SELECT", ct = [], lt = ({ name: e, label: r, control: i, options: o,
|
|
|
3620
3464
|
${i(e, "color", `--SLIDER-EVENTS-${t}-ICON-COLOR`)};
|
|
3621
3465
|
}
|
|
3622
3466
|
}
|
|
3623
|
-
`,
|
|
3467
|
+
`, ot = (e) => k`
|
|
3624
3468
|
&.--SLIDER {
|
|
3625
3469
|
justify-content: center;
|
|
3626
3470
|
display: flex;
|
|
@@ -3645,11 +3489,11 @@ var Z = "--SELECT", ct = [], lt = ({ name: e, label: r, control: i, options: o,
|
|
|
3645
3489
|
margin: 0px;
|
|
3646
3490
|
|
|
3647
3491
|
// ENABLED
|
|
3648
|
-
${
|
|
3649
|
-
${
|
|
3492
|
+
${rt(e, "ENABLED")};
|
|
3493
|
+
${at(e, "ENABLED")};
|
|
3650
3494
|
|
|
3651
3495
|
// VALUE
|
|
3652
|
-
${
|
|
3496
|
+
${it(e, "VALUE")};
|
|
3653
3497
|
|
|
3654
3498
|
// HOVER
|
|
3655
3499
|
@media (hover: hover) {
|
|
@@ -3679,9 +3523,9 @@ var Z = "--SELECT", ct = [], lt = ({ name: e, label: r, control: i, options: o,
|
|
|
3679
3523
|
pointer-events: none;
|
|
3680
3524
|
}
|
|
3681
3525
|
|
|
3682
|
-
${
|
|
3683
|
-
${
|
|
3684
|
-
${
|
|
3526
|
+
${rt(e, "DISABLED")};
|
|
3527
|
+
${it(e, "DISABLED_VALUE")};
|
|
3528
|
+
${at(e, "DISABLED")};
|
|
3685
3529
|
|
|
3686
3530
|
~ .--SLIDER-mark {
|
|
3687
3531
|
${i(e, "background-color", "--SLIDER-EVENTS-DISABLED_VALUE-BACKGROUND-COLOR")}
|
|
@@ -3851,48 +3695,48 @@ var Z = "--SELECT", ct = [], lt = ({ name: e, label: r, control: i, options: o,
|
|
|
3851
3695
|
}
|
|
3852
3696
|
}
|
|
3853
3697
|
}
|
|
3854
|
-
`, Q = "--SLIDER",
|
|
3855
|
-
let { field:
|
|
3698
|
+
`, Q = "--SLIDER", st = ({ 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: m, style: ee }) => {
|
|
3699
|
+
let { field: h } = ce({
|
|
3856
3700
|
control: m,
|
|
3857
3701
|
name: a
|
|
3858
|
-
}),
|
|
3859
|
-
|
|
3860
|
-
},
|
|
3861
|
-
let t =
|
|
3862
|
-
|
|
3863
|
-
},
|
|
3864
|
-
let t =
|
|
3865
|
-
|
|
3866
|
-
},
|
|
3867
|
-
if (!
|
|
3702
|
+
}), g = h.value ?? [e], _ = g.length >= 2, v = D(null), y = D(void 0), b = f === "vertical", x = i !== Infinity && e !== i && o > 0 ? Array.from({ length: Math.round((i - e) / o) + 1 }, (t, n) => Math.min(e + n * o, i)) : [], te = x.length > 0, S = (t) => te ? x.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)), [C, ne] = O(() => te ? g.map(S) : g), re = (e) => {
|
|
3703
|
+
h.onChange(e), ne(e);
|
|
3704
|
+
}, ie = (e) => {
|
|
3705
|
+
let t = S(parseFloat(e.target.value)), n = _ ? Math.min(t, C[1] - s) : t;
|
|
3706
|
+
re(_ ? [n, C[1]] : [n]);
|
|
3707
|
+
}, w = (e) => {
|
|
3708
|
+
let t = S(parseFloat(e.target.value)), n = Math.max(t, C[0] + s);
|
|
3709
|
+
re([C[0], n]);
|
|
3710
|
+
}, ae = (t) => {
|
|
3711
|
+
if (!te) return;
|
|
3868
3712
|
let n = C[0], r;
|
|
3869
3713
|
if (t.key === "ArrowRight" || t.key === "ArrowUp" ? r = x.find((e) => e > n) ?? n : t.key === "ArrowLeft" || t.key === "ArrowDown" ? r = [...x].reverse().find((e) => e < n) ?? n : t.key === "Home" ? r = e : t.key === "End" && (r = _ ? Math.min(i, C[1] - s) : i), r !== void 0 && r !== n) {
|
|
3870
3714
|
t.preventDefault();
|
|
3871
3715
|
let e = _ ? Math.min(r, C[1] - s) : r;
|
|
3872
|
-
|
|
3716
|
+
re(_ ? [e, C[1]] : [e]);
|
|
3873
3717
|
}
|
|
3874
|
-
},
|
|
3875
|
-
if (!
|
|
3718
|
+
}, oe = (t) => {
|
|
3719
|
+
if (!te) return;
|
|
3876
3720
|
let n = C[1], r;
|
|
3877
3721
|
if (t.key === "ArrowRight" || t.key === "ArrowUp" ? r = x.find((e) => e > n) ?? n : t.key === "ArrowLeft" || t.key === "ArrowDown" ? r = [...x].reverse().find((e) => e < n) ?? n : t.key === "Home" ? r = Math.max(e, C[0] + s) : t.key === "End" && (r = i), r !== void 0 && r !== n) {
|
|
3878
3722
|
t.preventDefault();
|
|
3879
3723
|
let e = Math.max(r, C[0] + s);
|
|
3880
|
-
|
|
3724
|
+
re([C[0], e]);
|
|
3881
3725
|
}
|
|
3882
|
-
},
|
|
3726
|
+
}, T = (t) => {
|
|
3883
3727
|
if (c || i === Infinity || i === e) return;
|
|
3884
3728
|
let n = v.current, r = n?.getBoundingClientRect();
|
|
3885
3729
|
if (!r || !n) return;
|
|
3886
|
-
let a =
|
|
3887
|
-
_ ? Math.abs(a - C[0]) <= Math.abs(a - C[1]) ?
|
|
3888
|
-
},
|
|
3889
|
-
let t =
|
|
3730
|
+
let a = S(e + (b ? 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));
|
|
3731
|
+
_ ? Math.abs(a - C[0]) <= Math.abs(a - C[1]) ? re([Math.max(e, Math.min(a, C[1] - s)), C[1]]) : re([C[0], Math.min(i, Math.max(a, C[0] + s))]) : re([Math.max(e, Math.min(i, a))]), n.classList.add(`${Q}--clicking`), clearTimeout(y.current), y.current = setTimeout(() => n.classList.remove(`${Q}--clicking`), 150);
|
|
3732
|
+
}, se = (t) => i === e ? 0 : (t - e) / (i - e) * 100, E = (e) => {
|
|
3733
|
+
let t = se(e);
|
|
3890
3734
|
return b ? { top: `calc(${100 - t}% - ${(100 - t) / 100 * 24}px)` } : { left: `calc(${t}% - ${t / 100 * 24}px)` };
|
|
3891
|
-
},
|
|
3892
|
-
let t =
|
|
3735
|
+
}, k = (e) => {
|
|
3736
|
+
let t = se(e);
|
|
3893
3737
|
return b ? { top: `calc(${100 - t}% - ${(100 - t) / 100 * 24}px + 11px)` } : { left: `calc(${t}% - ${t / 100 * 24}px + 11px)` };
|
|
3894
|
-
},
|
|
3895
|
-
let e = C[0], t = C[1] ?? e, n =
|
|
3738
|
+
}, A = () => {
|
|
3739
|
+
let e = C[0], t = C[1] ?? e, n = se(e), r = se(t), i = (e) => 12 - e / 100 * 24;
|
|
3896
3740
|
return b ? _ ? p === "inverted" ? [{
|
|
3897
3741
|
top: "0%",
|
|
3898
3742
|
bottom: `calc(${r}% + ${i(r)}px)`
|
|
@@ -3924,11 +3768,11 @@ var Z = "--SELECT", ct = [], lt = ({ name: e, label: r, control: i, options: o,
|
|
|
3924
3768
|
left: "0%",
|
|
3925
3769
|
right: `calc(${100 - n}% - ${i(n)}px)`
|
|
3926
3770
|
}];
|
|
3927
|
-
},
|
|
3771
|
+
}, le = (e) => _ ? p === "inverted" ? e <= C[0] || e >= C[1] : e >= C[0] && e <= C[1] : p === "inverted" ? e >= C[0] : e <= C[0], j = te ? "any" : o;
|
|
3928
3772
|
return /* @__PURE__ */ n("span", {
|
|
3929
3773
|
ref: v,
|
|
3930
3774
|
className: [Q, b ? `${Q}--vertical` : ""].join(" "),
|
|
3931
|
-
css:
|
|
3775
|
+
css: ot(ee),
|
|
3932
3776
|
"data-testid": Q,
|
|
3933
3777
|
children: [
|
|
3934
3778
|
/* @__PURE__ */ t("input", {
|
|
@@ -3936,21 +3780,21 @@ var Z = "--SELECT", ct = [], lt = ({ name: e, label: r, control: i, options: o,
|
|
|
3936
3780
|
type: "range",
|
|
3937
3781
|
min: e,
|
|
3938
3782
|
max: i,
|
|
3939
|
-
step:
|
|
3783
|
+
step: j,
|
|
3940
3784
|
value: C[0],
|
|
3941
|
-
onChange:
|
|
3942
|
-
onKeyDown:
|
|
3785
|
+
onChange: ie,
|
|
3786
|
+
onKeyDown: ae,
|
|
3943
3787
|
disabled: c,
|
|
3944
3788
|
"data-testid": _ ? `${Q}-minField` : `${Q}-field`
|
|
3945
3789
|
}),
|
|
3946
3790
|
/* @__PURE__ */ t("span", {
|
|
3947
3791
|
className: `${Q}-ripple`,
|
|
3948
|
-
style:
|
|
3792
|
+
style: E(C[0]),
|
|
3949
3793
|
"aria-hidden": "true"
|
|
3950
3794
|
}),
|
|
3951
3795
|
/* @__PURE__ */ t("span", {
|
|
3952
3796
|
className: `${Q}-thumbIcon`,
|
|
3953
|
-
style:
|
|
3797
|
+
style: E(C[0]),
|
|
3954
3798
|
"aria-hidden": "true",
|
|
3955
3799
|
children: l
|
|
3956
3800
|
}),
|
|
@@ -3960,54 +3804,54 @@ var Z = "--SELECT", ct = [], lt = ({ name: e, label: r, control: i, options: o,
|
|
|
3960
3804
|
type: "range",
|
|
3961
3805
|
min: e,
|
|
3962
3806
|
max: i,
|
|
3963
|
-
step:
|
|
3807
|
+
step: j,
|
|
3964
3808
|
value: C[1],
|
|
3965
|
-
onChange:
|
|
3966
|
-
onKeyDown:
|
|
3809
|
+
onChange: w,
|
|
3810
|
+
onKeyDown: oe,
|
|
3967
3811
|
disabled: c,
|
|
3968
3812
|
"data-testid": `${Q}-maxField`
|
|
3969
3813
|
}),
|
|
3970
3814
|
/* @__PURE__ */ t("span", {
|
|
3971
3815
|
className: `${Q}-ripple`,
|
|
3972
|
-
style:
|
|
3816
|
+
style: E(C[1]),
|
|
3973
3817
|
"aria-hidden": "true"
|
|
3974
3818
|
}),
|
|
3975
3819
|
/* @__PURE__ */ t("span", {
|
|
3976
3820
|
className: `${Q}-thumbIcon`,
|
|
3977
|
-
style:
|
|
3821
|
+
style: E(C[1]),
|
|
3978
3822
|
"aria-hidden": "true",
|
|
3979
3823
|
children: u
|
|
3980
3824
|
})
|
|
3981
3825
|
] }),
|
|
3982
3826
|
/* @__PURE__ */ t("span", {
|
|
3983
3827
|
className: `${Q}-rail`,
|
|
3984
|
-
onClick:
|
|
3828
|
+
onClick: T
|
|
3985
3829
|
}),
|
|
3986
|
-
|
|
3830
|
+
A().map((e, n) => /* @__PURE__ */ t("span", {
|
|
3987
3831
|
className: `${Q}-tracker`,
|
|
3988
|
-
onClick:
|
|
3832
|
+
onClick: T,
|
|
3989
3833
|
style: e
|
|
3990
3834
|
}, n)),
|
|
3991
3835
|
d && x.map((e) => /* @__PURE__ */ t("span", {
|
|
3992
|
-
className: [`${Q}-mark`,
|
|
3993
|
-
style:
|
|
3836
|
+
className: [`${Q}-mark`, le(e) && `${Q}-mark--active`].filter(Boolean).join(" "),
|
|
3837
|
+
style: k(e),
|
|
3994
3838
|
"aria-hidden": "true",
|
|
3995
|
-
onClick:
|
|
3839
|
+
onClick: T
|
|
3996
3840
|
}, e))
|
|
3997
3841
|
]
|
|
3998
3842
|
});
|
|
3999
|
-
},
|
|
4000
|
-
let { componentStyles: a } = e([
|
|
4001
|
-
return /* @__PURE__ */ t(
|
|
3843
|
+
}, ct = ({ theme: n, variant: r = "default", ...i }) => {
|
|
3844
|
+
let { componentStyles: a } = e([s.SLIDER], n, r.toUpperCase());
|
|
3845
|
+
return /* @__PURE__ */ t(st, {
|
|
4002
3846
|
...i,
|
|
4003
3847
|
style: a
|
|
4004
3848
|
});
|
|
4005
|
-
},
|
|
3849
|
+
}, lt = (e, t) => `
|
|
4006
3850
|
~ .--SWITCH-span {
|
|
4007
3851
|
// BACKGROUNDS
|
|
4008
3852
|
${i(e, "background-color", `--SWITCH-EVENTS-${t}-BACKGROUND-COLOR`)}
|
|
4009
3853
|
}
|
|
4010
|
-
`,
|
|
3854
|
+
`, ut = (e, t) => `
|
|
4011
3855
|
~ .--SWITCH-span {
|
|
4012
3856
|
// BORDERS
|
|
4013
3857
|
${i(e, "border-color", `--SWITCH-EVENTS-${t}-BORDER-COLOR`)}
|
|
@@ -4015,7 +3859,7 @@ var Z = "--SELECT", ct = [], lt = ({ name: e, label: r, control: i, options: o,
|
|
|
4015
3859
|
${i(e, "border-style", `--SWITCH-EVENTS-${t}-BORDER-STYLE`)}
|
|
4016
3860
|
${i(e, "border-radius", `--SWITCH-EVENTS-${t}-BORDER-RADIUS`)}
|
|
4017
3861
|
}
|
|
4018
|
-
`,
|
|
3862
|
+
`, dt = (e, t) => `
|
|
4019
3863
|
~ .--SWITCH-span {
|
|
4020
3864
|
// OUTLINE
|
|
4021
3865
|
${i(e, "outline-color", `--SWITCH-EVENTS-${t}-OUTLINE-COLOR`)}
|
|
@@ -4023,7 +3867,7 @@ var Z = "--SELECT", ct = [], lt = ({ name: e, label: r, control: i, options: o,
|
|
|
4023
3867
|
${i(e, "outline-style", `--SWITCH-EVENTS-${t}-OUTLINE-STYLE`)}
|
|
4024
3868
|
${i(e, "outline-offset", `--SWITCH-EVENTS-${t}-OUTLINE-OFFSET`)}
|
|
4025
3869
|
}
|
|
4026
|
-
`,
|
|
3870
|
+
`, ft = (e, t) => `
|
|
4027
3871
|
// UTILS
|
|
4028
3872
|
~ .--SWITCH-span > span {
|
|
4029
3873
|
${i(e, "color", `--SWITCH-EVENTS-${t}-ICON-COLOR`)};
|
|
@@ -4032,7 +3876,7 @@ var Z = "--SELECT", ct = [], lt = ({ name: e, label: r, control: i, options: o,
|
|
|
4032
3876
|
${i(e, "background-color", `--SWITCH-EVENTS-${t}-ICON-BACKGROUND-COLOR`)};
|
|
4033
3877
|
}
|
|
4034
3878
|
}
|
|
4035
|
-
`,
|
|
3879
|
+
`, pt = (e, t) => `
|
|
4036
3880
|
// TYPOGRAPHY
|
|
4037
3881
|
.--SWITCH-label {
|
|
4038
3882
|
${i(e, "color", `--SWITCH-EVENTS-${t}-COLOR-PRIMARY`)}
|
|
@@ -4041,7 +3885,7 @@ var Z = "--SELECT", ct = [], lt = ({ name: e, label: r, control: i, options: o,
|
|
|
4041
3885
|
~ .--SWITCH-helperText {
|
|
4042
3886
|
${i(e, "color", `--SWITCH-EVENTS-${t}-COLOR-SECONDARY`)}
|
|
4043
3887
|
}
|
|
4044
|
-
`,
|
|
3888
|
+
`, mt = (e) => k`
|
|
4045
3889
|
&.--SWITCH {
|
|
4046
3890
|
display: flex;
|
|
4047
3891
|
flex-direction: column;
|
|
@@ -4056,37 +3900,37 @@ var Z = "--SELECT", ct = [], lt = ({ name: e, label: r, control: i, options: o,
|
|
|
4056
3900
|
cursor: pointer;
|
|
4057
3901
|
|
|
4058
3902
|
// ENABLED
|
|
4059
|
-
${
|
|
3903
|
+
${pt(e, "ENABLED")};
|
|
4060
3904
|
|
|
4061
3905
|
// VALUE
|
|
4062
3906
|
&:has(.--SWITCH-inputField:checked) {
|
|
4063
|
-
${
|
|
3907
|
+
${pt(e, "VALUE")};
|
|
4064
3908
|
}
|
|
4065
3909
|
|
|
4066
3910
|
// HOVER
|
|
4067
3911
|
&:has(.--SWITCH-inputField:hover) {
|
|
4068
|
-
${
|
|
3912
|
+
${pt(e, "HOVER")};
|
|
4069
3913
|
}
|
|
4070
3914
|
|
|
4071
3915
|
// ACTIVE
|
|
4072
3916
|
&:has(.--SWITCH-inputField.--SWITCH-active, .--SWITCH-inputField:active) {
|
|
4073
|
-
${
|
|
3917
|
+
${pt(e, "ACTIVE")};
|
|
4074
3918
|
}
|
|
4075
3919
|
|
|
4076
3920
|
// FOCUS-VISIBLE
|
|
4077
3921
|
&:has(.--SWITCH-inputField:focus-visible) {
|
|
4078
|
-
${
|
|
3922
|
+
${pt(e, "FOCUS")};
|
|
4079
3923
|
}
|
|
4080
3924
|
|
|
4081
3925
|
// DISABLED
|
|
4082
3926
|
&:has(.--SWITCH-inputField:disabled) {
|
|
4083
3927
|
pointer-events: none;
|
|
4084
|
-
${
|
|
3928
|
+
${pt(e, "DISABLED")};
|
|
4085
3929
|
}
|
|
4086
3930
|
|
|
4087
3931
|
// DISABLED + VALUE
|
|
4088
3932
|
&:has(.--SWITCH-inputField:disabled:checked) {
|
|
4089
|
-
${
|
|
3933
|
+
${pt(e, "DISABLED_VALUE")};
|
|
4090
3934
|
}
|
|
4091
3935
|
|
|
4092
3936
|
.--SWITCH-checkbox {
|
|
@@ -4106,15 +3950,15 @@ var Z = "--SELECT", ct = [], lt = ({ name: e, label: r, control: i, options: o,
|
|
|
4106
3950
|
-webkit-tap-highlight-color: transparent;
|
|
4107
3951
|
|
|
4108
3952
|
// ENABLED
|
|
4109
|
-
${
|
|
4110
|
-
${
|
|
4111
|
-
${
|
|
3953
|
+
${lt(e, "ENABLED")};
|
|
3954
|
+
${ut(e, "ENABLED")};
|
|
3955
|
+
${ft(e, "ENABLED")};
|
|
4112
3956
|
|
|
4113
3957
|
// VALUE
|
|
4114
3958
|
&:checked {
|
|
4115
|
-
${
|
|
4116
|
-
${
|
|
4117
|
-
${
|
|
3959
|
+
${lt(e, "VALUE")};
|
|
3960
|
+
${ut(e, "VALUE")};
|
|
3961
|
+
${ft(e, "VALUE")};
|
|
4118
3962
|
|
|
4119
3963
|
~ .--SWITCH-span {
|
|
4120
3964
|
.--SWITCH-iconOff {
|
|
@@ -4158,22 +4002,22 @@ var Z = "--SELECT", ct = [], lt = ({ name: e, label: r, control: i, options: o,
|
|
|
4158
4002
|
// FOCUS
|
|
4159
4003
|
&:focus-visible {
|
|
4160
4004
|
outline: none;
|
|
4161
|
-
${
|
|
4162
|
-
${
|
|
4005
|
+
${dt(e, "FOCUS")};
|
|
4006
|
+
${ft(e, "FOCUS")};
|
|
4163
4007
|
}
|
|
4164
4008
|
|
|
4165
4009
|
// DISABLED
|
|
4166
4010
|
&:disabled {
|
|
4167
|
-
${
|
|
4168
|
-
${
|
|
4169
|
-
${
|
|
4011
|
+
${lt(e, "DISABLED")};
|
|
4012
|
+
${ut(e, "DISABLED")};
|
|
4013
|
+
${ft(e, "DISABLED")};
|
|
4170
4014
|
}
|
|
4171
4015
|
|
|
4172
4016
|
// DISABLED + VALUE
|
|
4173
4017
|
&:disabled:checked {
|
|
4174
|
-
${
|
|
4175
|
-
${
|
|
4176
|
-
${
|
|
4018
|
+
${lt(e, "DISABLED_VALUE")};
|
|
4019
|
+
${ut(e, "DISABLED_VALUE")};
|
|
4020
|
+
${ft(e, "DISABLED_VALUE")};
|
|
4177
4021
|
|
|
4178
4022
|
~ .--SWITCH-span {
|
|
4179
4023
|
.--SWITCH-iconOff {
|
|
@@ -4275,27 +4119,27 @@ var Z = "--SELECT", ct = [], lt = ({ name: e, label: r, control: i, options: o,
|
|
|
4275
4119
|
margin-left: 14px;
|
|
4276
4120
|
}
|
|
4277
4121
|
}
|
|
4278
|
-
`, $ = "--SWITCH",
|
|
4279
|
-
let [f, p] =
|
|
4122
|
+
`, $ = "--SWITCH", ht = ({ name: e, control: r, iconOn: i, iconOff: a, disabled: o, label: s, helperText: c, className: l, style: u, ...d }) => {
|
|
4123
|
+
let [f, p] = O(!1), { field: m, fieldState: ee } = ce({
|
|
4280
4124
|
control: r,
|
|
4281
4125
|
name: e
|
|
4282
|
-
}), [
|
|
4283
|
-
m.onChange(e),
|
|
4126
|
+
}), [h, g] = O(m.value || !1), _ = ee.error, v = (e) => {
|
|
4127
|
+
m.onChange(e), g(e), _ && te();
|
|
4284
4128
|
}, y = (e) => {
|
|
4285
4129
|
let { checked: t } = e.target;
|
|
4286
4130
|
v(t);
|
|
4287
4131
|
}, b = (e) => {
|
|
4288
4132
|
(e.key === "Enter" || e.key === "Space") && p(!0), d.onKeyDown?.(e);
|
|
4289
4133
|
}, x = (e) => {
|
|
4290
|
-
(e.key === "Enter" || e.key === "Space") && (p(!1), v(!
|
|
4291
|
-
},
|
|
4134
|
+
(e.key === "Enter" || e.key === "Space") && (p(!1), v(!h)), d.onKeyUp?.(e);
|
|
4135
|
+
}, te = () => m.onBlur();
|
|
4292
4136
|
return /* @__PURE__ */ n("div", {
|
|
4293
4137
|
className: [
|
|
4294
4138
|
$,
|
|
4295
4139
|
f ? `${$}-active` : "",
|
|
4296
4140
|
l || ""
|
|
4297
4141
|
].join(" "),
|
|
4298
|
-
css:
|
|
4142
|
+
css: mt(u),
|
|
4299
4143
|
"data-testid": $,
|
|
4300
4144
|
children: [/* @__PURE__ */ n("label", {
|
|
4301
4145
|
className: `${$}-container`,
|
|
@@ -4309,12 +4153,12 @@ var Z = "--SELECT", ct = [], lt = ({ name: e, label: r, control: i, options: o,
|
|
|
4309
4153
|
].join(" "),
|
|
4310
4154
|
type: "checkbox",
|
|
4311
4155
|
value: e,
|
|
4312
|
-
checked:
|
|
4156
|
+
checked: h,
|
|
4313
4157
|
disabled: o,
|
|
4314
4158
|
onChange: y,
|
|
4315
4159
|
onKeyDown: b,
|
|
4316
4160
|
onKeyUp: x,
|
|
4317
|
-
onBlur:
|
|
4161
|
+
onBlur: te,
|
|
4318
4162
|
"data-testid": `${$}-inputField`,
|
|
4319
4163
|
...d
|
|
4320
4164
|
}), /* @__PURE__ */ n("span", {
|
|
@@ -4339,14 +4183,14 @@ var Z = "--SELECT", ct = [], lt = ({ name: e, label: r, control: i, options: o,
|
|
|
4339
4183
|
children: _ ? _.message : c
|
|
4340
4184
|
})]
|
|
4341
4185
|
});
|
|
4342
|
-
},
|
|
4343
|
-
let { componentStyles: a } = e([
|
|
4344
|
-
return /* @__PURE__ */ t(
|
|
4186
|
+
}, gt = ({ theme: n, variant: r = "default", ...i }) => {
|
|
4187
|
+
let { componentStyles: a } = e([s.SWITCH], n, r.toUpperCase());
|
|
4188
|
+
return /* @__PURE__ */ t(ht, {
|
|
4345
4189
|
...i,
|
|
4346
4190
|
style: a
|
|
4347
4191
|
});
|
|
4348
4192
|
};
|
|
4349
4193
|
//#endregion
|
|
4350
|
-
export {
|
|
4194
|
+
export { je as a, M as c, He as i, ct as n, we as o, nt as r, _e as s, gt as t };
|
|
4351
4195
|
|
|
4352
|
-
//# sourceMappingURL=Switch-
|
|
4196
|
+
//# sourceMappingURL=Switch-oAVuMb0V.js.map
|