@foi/design-system 0.0.4 → 0.0.7

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.
Files changed (40) hide show
  1. package/README.md +8 -0
  2. package/dist/DatePicker.utils-ytCEcs6T.js +2680 -0
  3. package/dist/DatePicker.utils-ytCEcs6T.js.map +1 -0
  4. package/dist/RadioGroup-D2s7AY6E.js +325 -0
  5. package/dist/RadioGroup-D2s7AY6E.js.map +1 -0
  6. package/dist/RadioGroup.context-zJGC5Sjc.js +395 -0
  7. package/dist/RadioGroup.context-zJGC5Sjc.js.map +1 -0
  8. package/dist/Switch-CBpbDGqG.js +3830 -0
  9. package/dist/Switch-CBpbDGqG.js.map +1 -0
  10. package/dist/ThemeProvider-oFEpvMxv.js +37 -0
  11. package/dist/ThemeProvider-oFEpvMxv.js.map +1 -0
  12. package/dist/atoms.d.ts +18 -0
  13. package/dist/atoms.mjs +3 -0
  14. package/dist/emotion-react-jsx-runtime.browser.esm-BFNmScj4.js +992 -0
  15. package/dist/emotion-react-jsx-runtime.browser.esm-BFNmScj4.js.map +1 -0
  16. package/dist/hocs.d.ts +2 -0
  17. package/dist/hocs.mjs +2 -0
  18. package/dist/hooks.d.ts +2 -0
  19. package/dist/hooks.mjs +2 -0
  20. package/dist/index.mjs +6 -8654
  21. package/dist/molecules.d.ts +6 -0
  22. package/dist/molecules.mjs +2 -0
  23. package/dist/theme-DEqiATmv.js +436 -0
  24. package/dist/theme-DEqiATmv.js.map +1 -0
  25. package/dist/theme.d.ts +1 -0
  26. package/dist/theme.mjs +2 -0
  27. package/dist/useStateCallback-D9fqdxiO.js +26 -0
  28. package/dist/useStateCallback-D9fqdxiO.js.map +1 -0
  29. package/dist/utilities/cleaner/input.d.ts +1 -0
  30. package/dist/utilities/formatter/date.d.ts +3 -0
  31. package/dist/utilities/formatter/input.d.ts +1 -0
  32. package/dist/utilities/formatter/number.d.ts +2 -0
  33. package/dist/utilities/formatter/strings.d.ts +2 -0
  34. package/dist/utilities/regex/input.d.ts +4 -0
  35. package/dist/utilities/validator/input.d.ts +1 -0
  36. package/dist/utilities.d.ts +7 -0
  37. package/dist/utilities.mjs +23 -0
  38. package/dist/utilities.mjs.map +1 -0
  39. package/package.json +25 -1
  40. package/dist/index.mjs.map +0 -1
@@ -0,0 +1,3830 @@
1
+ import { i as e, n as t, r as n, t as r } from "./emotion-react-jsx-runtime.browser.esm-BFNmScj4.js";
2
+ import { r as i } from "./theme-DEqiATmv.js";
3
+ import { a, t as o } from "./RadioGroup.context-zJGC5Sjc.js";
4
+ import { _ as s, a as c, c as l, f as u, g as d, h as ee, i as f, l as p, m as te, n as ne, o as m, p as h, r as g, s as re, t as _, u as v, v as y, y as ie } from "./DatePicker.utils-ytCEcs6T.js";
5
+ import { n as b, t as ae } from "./useStateCallback-D9fqdxiO.js";
6
+ import x, { forwardRef as oe, useContext as se, useEffect as ce, useLayoutEffect as le, useMemo as S, useRef as C, useState as w } from "react";
7
+ import { css as T } from "@emotion/react";
8
+ import { useController as ue } from "react-hook-form";
9
+ import de from "@mui/icons-material/EventOutlined";
10
+ import fe from "@mui/icons-material/ArrowDropUpOutlined";
11
+ import pe from "@mui/icons-material/KeyboardArrowLeftOutlined";
12
+ import me from "@mui/icons-material/KeyboardArrowRightOutlined";
13
+ import E from "@mui/icons-material/FiberManualRecord";
14
+ //#region src/components/atoms/Button/Button.emotion.ts
15
+ var D = (e, t) => `
16
+ // UTILS
17
+ ${i(e, "color", `--BUTTON-EVENTS-${t}-COLOR-PRIMARY`)}
18
+
19
+ // BACKGROUNDS
20
+ ${i(e, "background-color", `--BUTTON-EVENTS-${t}-BACKGROUND-COLOR`)}
21
+
22
+ // BORDERS
23
+ ${i(e, "border-color", `--BUTTON-EVENTS-${t}-BORDER-COLOR`)}
24
+ ${i(e, "border-width", `--BUTTON-EVENTS-${t}-BORDER-WIDTH`)}
25
+ ${i(e, "border-style", `--BUTTON-EVENTS-${t}-BORDER-STYLE`)}
26
+
27
+ // OUTLINE
28
+ ${i(e, "outline-color", `--BUTTON-EVENTS-${t}-OUTLINE-COLOR`)}
29
+ ${i(e, "outline-width", `--BUTTON-EVENTS-${t}-OUTLINE-WIDTH`)}
30
+ ${i(e, "outline-style", `--BUTTON-EVENTS-${t}-OUTLINE-STYLE`)}
31
+ ${i(e, "outline-offset", `--BUTTON-EVENTS-${t}-OUTLINE-OFFSET`)}
32
+ `, O = (e) => T`
33
+ &.--BUTTON {
34
+ width: 100%;
35
+ height: 48px;
36
+ ${i(e, "border-radius", "--BUTTON-ROOT-BORDER-RADIUS")};
37
+ display: flex;
38
+ justify-content: center;
39
+ align-items: center;
40
+ gap: 8px;
41
+ text-transform: none;
42
+ position: relative;
43
+ text-decoration: none;
44
+ cursor: pointer;
45
+ padding: 13.5px 16px;
46
+ user-select: none;
47
+ -webkit-tap-highlight-color: transparent;
48
+
49
+ // ENABLED
50
+ ${D(e, "ENABLED")};
51
+
52
+ // HOVER
53
+ &:hover {
54
+ ${D(e, "HOVER")};
55
+ }
56
+
57
+ // ACTIVE
58
+ &.--BUTTON-active,
59
+ &:active {
60
+ ${D(e, "ACTIVE")};
61
+ }
62
+
63
+ // FOCUS
64
+ &:focus-visible {
65
+ outline: none;
66
+ ${D(e, "FOCUS")};
67
+ }
68
+
69
+ // DISABLED
70
+ &:disabled {
71
+ pointer-events: none;
72
+ ${D(e, "DISABLED")};
73
+ }
74
+
75
+ // LOADING
76
+ &.--BUTTON-loading {
77
+ pointer-events: none;
78
+ ${D(e, "LOADING")};
79
+ }
80
+
81
+ .--BUTTON-iconStart,
82
+ .--BUTTON-iconEnd {
83
+ display: inline-flex;
84
+ align-items: center;
85
+ > svg {
86
+ width: 20px;
87
+ height: 20px;
88
+ }
89
+ }
90
+
91
+ .--BUTTON-span {
92
+ // FONT
93
+ font-family: ${e["--FONTFAMILY-PRIMARY"]};
94
+ font-size: 0.875rem; // 14px
95
+ font-weight: 500;
96
+ line-height: 1.5;
97
+ letter-spacing: 0.01em;
98
+ }
99
+ }
100
+ `, k = "--BUTTON", A = ({ className: e, style: r, children: i = "Click me!", type: a = "button", loading: o = !1, iconStart: s, iconEnd: c, ...l }) => {
101
+ let [u, d] = w(!1);
102
+ return /* @__PURE__ */ n("button", {
103
+ className: [
104
+ k,
105
+ u ? `${k}-active` : "",
106
+ o ? `${k}-loading` : "",
107
+ e || ""
108
+ ].join(" "),
109
+ css: O(r),
110
+ type: a,
111
+ onKeyDown: (e) => {
112
+ (e.key === "Enter" || e.key === "Space") && d(!0), l.onKeyDown?.(e);
113
+ },
114
+ onKeyUp: (e) => {
115
+ (e.key === "Enter" || e.key === "Space") && d(!1), l.onKeyUp?.(e);
116
+ },
117
+ onBlur: (e) => {
118
+ d(!1), l.onBlur?.(e);
119
+ },
120
+ "data-testid": k,
121
+ ...l,
122
+ children: [
123
+ s && /* @__PURE__ */ t("span", {
124
+ className: `${k}-iconStart`,
125
+ children: s
126
+ }),
127
+ /* @__PURE__ */ t("span", {
128
+ className: `${k}-span`,
129
+ children: i
130
+ }),
131
+ c && /* @__PURE__ */ t("span", {
132
+ className: `${k}-iconEnd`,
133
+ children: c
134
+ })
135
+ ]
136
+ });
137
+ }, he = ({ theme: n, ...r }) => {
138
+ let { componentStyles: i } = e([a.BUTTON], n);
139
+ return /* @__PURE__ */ t(A, {
140
+ ...r,
141
+ style: i
142
+ });
143
+ }, j = (e, t) => `
144
+ ${i(e, "border-color", `--DATEPICKER-EVENTS-${t}-BORDER-COLOR`)};
145
+ ${i(e, "border-width", `--DATEPICKER-EVENTS-${t}-BORDER-WIDTH`)};
146
+ ${i(e, "border-style", `--DATEPICKER-EVENTS-${t}-BORDER-STYLE`)};
147
+ `, M = (e, t, n = !1) => `
148
+ ${i(e, "color", `--DATEPICKER-EVENTS-${t}-COLOR-SECONDARY`)};
149
+ ${n ? "transform: translate(14px, -24px); font-size: 0.75rem;" : ""};
150
+ `, N = (e) => `
151
+ .--DATEPICKER-legend {
152
+ max-width: ${e ? "100%" : "0px"};
153
+ }
154
+ `, P = (e, t) => `
155
+ ${i(e, "background-color", `--DATEPICKER-EVENTS-${t}-BACKGROUND-COLOR`)};
156
+ ~ .--DATEPICKER-helperText {
157
+ ${i(e, "color", `--DATEPICKER-EVENTS-${t}-COLOR-TERTIARY`)};
158
+ }
159
+ `, ge = (e) => T`
160
+ &.--DATEPICKER {
161
+ position: relative;
162
+ padding: 0;
163
+ border: 0;
164
+ width: 100%;
165
+
166
+ &.--DATEPICKER-paddingBottom {
167
+ padding-bottom: 24px;
168
+ }
169
+
170
+ .--DATEPICKER-container {
171
+ box-sizing: border-box;
172
+ position: relative;
173
+ display: inline-flex;
174
+ align-items: center;
175
+ min-height: 48px;
176
+
177
+ width: -webkit-fill-available;
178
+ width: -moz-available;
179
+ width: stretch;
180
+
181
+ ${i(e, "border-radius", "--DATEPICKER-ROOT-BORDER-RADIUS")};
182
+
183
+ // ENABLED
184
+ ${P(e, "ENABLED")};
185
+
186
+ // VALUE (field has content or calendar is open)
187
+ &:has(.--DATEPICKER-fieldRow.--DATEPICKER-open) {
188
+ ${P(e, "VALUE")};
189
+ }
190
+
191
+ // HOVER
192
+ &:has(.--DATEPICKER-fieldRow:hover) {
193
+ ${P(e, "HOVER")};
194
+ }
195
+
196
+ // ACTIVE
197
+ &:has(.--DATEPICKER-fieldRow:active) {
198
+ ${P(e, "ACTIVE")};
199
+ }
200
+
201
+ // FOCUS (user is typing inside the 3 sub-inputs)
202
+ &:has(.--DATEPICKER-fieldRow:focus-within) {
203
+ outline: none;
204
+ ${P(e, "FOCUS")};
205
+ }
206
+
207
+ // ERROR
208
+ &:has(.--DATEPICKER-fieldRow.--DATEPICKER-error) {
209
+ ${P(e, "ERROR")};
210
+ }
211
+
212
+ // ERROR + VALUE
213
+ &:has(.--DATEPICKER-fieldRow.--DATEPICKER-error.--DATEPICKER-open) {
214
+ ${P(e, "ERROR_VALUE")};
215
+ }
216
+
217
+ // ERROR + HOVER
218
+ &:has(.--DATEPICKER-fieldRow.--DATEPICKER-error:hover) {
219
+ ${P(e, "ERROR_HOVER")};
220
+ }
221
+
222
+ // ERROR + ACTIVE
223
+ &:has(.--DATEPICKER-fieldRow.--DATEPICKER-error:active) {
224
+ ${P(e, "ERROR_ACTIVE")};
225
+ }
226
+
227
+ // ERROR + FOCUS
228
+ &:has(.--DATEPICKER-fieldRow.--DATEPICKER-error:focus-within) {
229
+ ${P(e, "ERROR_FOCUS")};
230
+ }
231
+
232
+ // DISABLED
233
+ &:has(.--DATEPICKER-fieldRow.--DATEPICKER-disabled) {
234
+ pointer-events: none;
235
+ ${P(e, "DISABLED")};
236
+ }
237
+
238
+ // DISABLED + VALUE
239
+ &:has(.--DATEPICKER-fieldRow.--DATEPICKER-disabled.--DATEPICKER-open) {
240
+ pointer-events: none;
241
+ ${P(e, "DISABLED_VALUE")};
242
+ }
243
+
244
+ .--DATEPICKER-fieldRow {
245
+ display: flex;
246
+ align-items: center;
247
+ gap: 0px;
248
+
249
+ height: -webkit-fill-available;
250
+ height: -moz-available;
251
+ height: stretch;
252
+ width: -webkit-fill-available;
253
+ width: -moz-available;
254
+ width: stretch;
255
+
256
+ min-width: 0;
257
+ border: 0;
258
+ margin: 0;
259
+ padding: 15px 14px;
260
+ background-color: transparent;
261
+ cursor: text;
262
+ box-sizing: border-box;
263
+
264
+ // ── Label / fieldset states triggered as sibling ────────────────
265
+
266
+ // ENABLED
267
+ ~ .--DATEPICKER-label {
268
+ ${M(e, "ENABLED", !0)};
269
+ }
270
+ ~ .--DATEPICKER-fieldset {
271
+ ${j(e, "ENABLED")};
272
+ ${N(!0)};
273
+ }
274
+
275
+ // VALUE
276
+ &.--DATEPICKER-open {
277
+ ~ .--DATEPICKER-label {
278
+ ${M(e, "VALUE", !0)};
279
+ }
280
+ ~ .--DATEPICKER-fieldset {
281
+ ${j(e, "VALUE")};
282
+ ${N(!0)};
283
+ }
284
+ }
285
+
286
+ // HOVER
287
+ &:hover {
288
+ ~ .--DATEPICKER-label {
289
+ ${M(e, "HOVER")};
290
+ }
291
+ ~ .--DATEPICKER-fieldset {
292
+ ${j(e, "HOVER")};
293
+ }
294
+ }
295
+
296
+ // FOCUS (typing in sub-inputs)
297
+ &:focus-within {
298
+ ~ .--DATEPICKER-label {
299
+ ${M(e, "FOCUS", !0)};
300
+ }
301
+ ~ .--DATEPICKER-fieldset {
302
+ ${j(e, "FOCUS")};
303
+ ${N(!0)};
304
+ }
305
+ }
306
+
307
+ // ERROR
308
+ &.--DATEPICKER-error {
309
+ ~ .--DATEPICKER-label {
310
+ ${M(e, "ERROR")};
311
+ }
312
+ ~ .--DATEPICKER-fieldset {
313
+ ${j(e, "ERROR")};
314
+ }
315
+ }
316
+
317
+ // ERROR + VALUE
318
+ &.--DATEPICKER-error.--DATEPICKER-open {
319
+ ~ .--DATEPICKER-label {
320
+ ${M(e, "ERROR_VALUE")};
321
+ }
322
+ ~ .--DATEPICKER-fieldset {
323
+ ${j(e, "ERROR_VALUE")};
324
+ }
325
+ }
326
+
327
+ // ERROR + HOVER
328
+ &.--DATEPICKER-error:hover {
329
+ ~ .--DATEPICKER-label {
330
+ ${M(e, "ERROR_HOVER")};
331
+ }
332
+ ~ .--DATEPICKER-fieldset {
333
+ ${j(e, "ERROR_HOVER")};
334
+ }
335
+ }
336
+
337
+ // ERROR + FOCUS
338
+ &.--DATEPICKER-error:focus-within {
339
+ ~ .--DATEPICKER-label {
340
+ ${M(e, "ERROR_FOCUS")};
341
+ }
342
+ ~ .--DATEPICKER-fieldset {
343
+ ${j(e, "ERROR_FOCUS")};
344
+ ${N(!0)};
345
+ }
346
+ }
347
+
348
+ // DISABLED
349
+ &.--DATEPICKER-disabled {
350
+ user-select: none;
351
+ pointer-events: none;
352
+ cursor: default;
353
+
354
+ .--DATEPICKER-partInput {
355
+ ${i(e, "color", "--DATEPICKER-EVENTS-DISABLED-COLOR-PRIMARY")};
356
+ }
357
+ .--DATEPICKER-separator {
358
+ ${i(e, "color", "--DATEPICKER-EVENTS-DISABLED-COLOR-PRIMARY")};
359
+ }
360
+
361
+ ~ .--DATEPICKER-label {
362
+ ${M(e, "DISABLED")};
363
+ }
364
+ ~ .--DATEPICKER-fieldset {
365
+ ${j(e, "DISABLED")};
366
+ }
367
+ }
368
+
369
+ // ── Sub-input elements ───────────────────────────────────────────
370
+
371
+ .--DATEPICKER-separator {
372
+ font-family: ${e["--FONTFAMILY-PRIMARY"]};
373
+ font-size: 0.875rem;
374
+ font-weight: 400;
375
+ letter-spacing: 0.01em;
376
+ line-height: 1;
377
+ ${i(e, "color", "--DATEPICKER-EVENTS-ENABLED-COLOR-PRIMARY")};
378
+ user-select: none;
379
+ padding: 0 2px;
380
+ }
381
+
382
+ .--DATEPICKER-partInput {
383
+ font-family: ${e["--FONTFAMILY-PRIMARY"]};
384
+ font-size: 0.875rem;
385
+ font-weight: 500;
386
+ letter-spacing: 0.01em;
387
+ line-height: 1;
388
+ padding: 0;
389
+ margin: 0;
390
+
391
+ display: inline-flex;
392
+ align-items: center;
393
+ justify-content: center;
394
+ flex: 0 0 auto;
395
+ white-space: nowrap;
396
+ user-select: none;
397
+ cursor: text;
398
+ outline: none;
399
+
400
+ &.--DATEPICKER-placeholder {
401
+ ${i(e, "color", "--DATEPICKER-EVENTS-ENABLED-COLOR-SECONDARY")};
402
+ }
403
+
404
+ &:focus {
405
+ ${i(e, "background-color", "--DATEPICKER-EVENTS-VALUE-BORDER-COLOR")};
406
+ border-radius: 2px;
407
+ }
408
+
409
+ &:focus-visible {
410
+ outline: none;
411
+ }
412
+
413
+ ${i(e, "color", "--DATEPICKER-EVENTS-ENABLED-COLOR-PRIMARY")};
414
+ }
415
+ }
416
+
417
+ // ── Calendar icon button ─────────────────────────────────────────
418
+
419
+ .--DATEPICKER-calendarIcon {
420
+ flex-shrink: 0;
421
+ ${i(e, "color", "--DATEPICKER-EVENTS-ENABLED-ICON-COLOR")};
422
+ }
423
+
424
+ // ── Floating label ───────────────────────────────────────────────
425
+
426
+ .--DATEPICKER-label {
427
+ font-family: ${e["--FONTFAMILY-PRIMARY"]};
428
+ font-size: 0.875rem;
429
+ font-weight: 500;
430
+ letter-spacing: 0.01em;
431
+ line-height: normal;
432
+
433
+ padding: 0;
434
+ display: block;
435
+ white-space: nowrap;
436
+ overflow: hidden;
437
+ text-overflow: ellipsis;
438
+ position: absolute;
439
+ pointer-events: none;
440
+ z-index: 4;
441
+
442
+ transform: translate(14px, 0px);
443
+ transition: 150ms ease-in-out;
444
+ }
445
+
446
+ // ── Fieldset border ──────────────────────────────────────────────
447
+
448
+ .--DATEPICKER-fieldset {
449
+ height: 100%;
450
+ width: -webkit-fill-available;
451
+ width: -moz-available;
452
+ width: stretch;
453
+
454
+ text-align: left;
455
+ position: absolute;
456
+ margin: 0;
457
+ padding: 0 6px;
458
+ pointer-events: none;
459
+ overflow: hidden;
460
+ z-index: 5;
461
+ box-sizing: border-box;
462
+ ${i(e, "border-radius", "--DATEPICKER-ROOT-BORDER-RADIUS")};
463
+ -webkit-tap-highlight-color: transparent;
464
+
465
+ .--DATEPICKER-legend {
466
+ width: auto;
467
+ overflow: hidden;
468
+ display: block;
469
+ padding: 0;
470
+ height: 0px;
471
+ visibility: hidden;
472
+
473
+ max-width: 0px;
474
+ transition: max-width 150ms ease-in-out;
475
+
476
+ .--DATEPICKER-text {
477
+ font-family: ${e["--FONTFAMILY-PRIMARY"]};
478
+ font-size: 0.75rem;
479
+ letter-spacing: 0.01em;
480
+ font-weight: 500;
481
+ padding: 0px 7px;
482
+ }
483
+ }
484
+ }
485
+
486
+ .--DATEPICKER-adornment {
487
+ display: flex;
488
+ align-items: center;
489
+ justify-content: center;
490
+ height: 100%;
491
+ width: 48px;
492
+ min-width: 48px;
493
+ }
494
+ }
495
+
496
+ .--DATEPICKER-helperText {
497
+ font-family: ${e["--FONTFAMILY-PRIMARY"]};
498
+ font-size: 0.75rem;
499
+ line-height: 1;
500
+
501
+ display: block;
502
+ margin-top: 8px;
503
+ margin-left: 14px;
504
+ height: 16px;
505
+ }
506
+ }
507
+ `, _e = (e, t) => `
508
+ // BACKGROUNDS
509
+ .--ICONBUTTON-span {
510
+ ${i(e, "background-color", `--ICONBUTTON-EVENTS-${t}-BACKGROUND-COLOR`)}
511
+ }
512
+ `, ve = (e, t) => `
513
+ // SHADOWS
514
+ ${i(e, "background-color", `--ICONBUTTON-EVENTS-${t}-SHADOW-COLOR`)}
515
+ `, ye = (e, t) => `
516
+ // UTILS
517
+ .--ICONBUTTON-span > svg > path {
518
+ ${i(e, "fill", `--ICONBUTTON-EVENTS-${t}-ICON-COLOR`)}
519
+ }
520
+ `, be = (e, t) => `
521
+ // BORDER
522
+ .--ICONBUTTON-span {
523
+ ${i(e, "border-color", `--ICONBUTTON-EVENTS-${t}-BORDER-COLOR`)}
524
+ ${i(e, "border-width", `--ICONBUTTON-EVENTS-${t}-BORDER-WIDTH`)}
525
+ ${i(e, "border-style", `--ICONBUTTON-EVENTS-${t}-BORDER-STYLE`)}
526
+ }
527
+ `, F = (e, t) => `
528
+ // OUTLINE
529
+ .--ICONBUTTON-span {
530
+ ${i(e, "outline-color", `--ICONBUTTON-EVENTS-${t}-OUTLINE-COLOR`)}
531
+ ${i(e, "outline-width", `--ICONBUTTON-EVENTS-${t}-OUTLINE-WIDTH`)}
532
+ ${i(e, "outline-style", `--ICONBUTTON-EVENTS-${t}-OUTLINE-STYLE`)}
533
+ ${i(e, "outline-offset", `--ICONBUTTON-EVENTS-${t}-OUTLINE-OFFSET`)}
534
+ }
535
+ `, xe = (e) => T`
536
+ &.--ICONBUTTON {
537
+ width: 24px;
538
+ height: 24px;
539
+ ${i(e, "border-radius", "--ICONBUTTON-ROOT-BORDER-RADIUS")};
540
+ display: inline-flex;
541
+ align-items: center;
542
+ justify-content: center;
543
+ cursor: pointer;
544
+ vertical-align: middle;
545
+ box-sizing: content-box;
546
+ position: relative;
547
+ user-select: none;
548
+ padding: 0px;
549
+ box-sizing: border-box;
550
+ -webkit-tap-highlight-color: transparent;
551
+ isolation: isolate;
552
+ border: none;
553
+ background-color: transparent;
554
+
555
+ // ENABLED
556
+ ${_e(e, "ENABLED")};
557
+ ${be(e, "ENABLED")};
558
+ ${ye(e, "ENABLED")};
559
+
560
+ // HOVER
561
+ &:hover {
562
+ &:before {
563
+ opacity: 1;
564
+ ${ve(e, "HOVER")};
565
+ }
566
+ }
567
+
568
+ // ACTIVE
569
+ &.--ICONBUTTON-active,
570
+ &:active {
571
+ &:before {
572
+ opacity: 1;
573
+ ${ve(e, "ACTIVE")};
574
+ }
575
+ }
576
+
577
+ // FOCUS
578
+ &:focus-visible {
579
+ outline: none;
580
+ ${F(e, "FOCUS")};
581
+ }
582
+
583
+ // DISABLED
584
+ &:disabled {
585
+ pointer-events: none;
586
+ ${_e(e, "ENABLED")};
587
+ ${be(e, "ENABLED")};
588
+ ${ye(e, "ENABLED")};
589
+ }
590
+
591
+ &.--ICONBUTTON-flipped {
592
+ .--ICONBUTTON-span {
593
+ > svg {
594
+ rotate: 180deg !important;
595
+ }
596
+ }
597
+ }
598
+
599
+ .--ICONBUTTON-span {
600
+ width: 24px;
601
+ height: 24px;
602
+ display: flex;
603
+ justify-content: center;
604
+ align-items: center;
605
+ box-sizing: border-box;
606
+ ${i(e, "border-radius", "--ICONBUTTON-ROOT-BORDER-RADIUS")};
607
+
608
+ > svg {
609
+ rotate: 0deg;
610
+ transition: rotate 150ms ease-in-out;
611
+ position: absolute;
612
+ width: 100%;
613
+ height: auto;
614
+ z-index: 1;
615
+ }
616
+ }
617
+
618
+ &:before {
619
+ content: '';
620
+ position: absolute;
621
+ width: 36px;
622
+ height: 36px;
623
+ border-radius: 50%;
624
+ opacity: 0;
625
+ transition: opacity 150ms ease-in-out;
626
+ z-index: -1;
627
+ }
628
+ }
629
+ `, I = "--ICONBUTTON", Se = ({ className: e, style: n, icon: r, onClick: i, isFlipped: a, ...o }) => {
630
+ let [s, c] = w(!1);
631
+ return /* @__PURE__ */ t("button", {
632
+ className: [
633
+ I,
634
+ s ? `${I}-active` : "",
635
+ a ? `${I}-flipped` : "",
636
+ e
637
+ ].join(" "),
638
+ css: xe(n),
639
+ type: "button",
640
+ onClick: i,
641
+ onKeyDown: (e) => {
642
+ e.stopPropagation(), (e.key === "Enter" || e.key === "Space") && c(!0), o.onKeyDown?.(e);
643
+ },
644
+ onKeyUp: (e) => {
645
+ (e.key === "Enter" || e.key === "Space") && c(!1), o.onKeyUp?.(e);
646
+ },
647
+ onBlur: (e) => {
648
+ c(!1), o.onBlur?.(e);
649
+ },
650
+ "data-testid": I,
651
+ ...o,
652
+ children: /* @__PURE__ */ t("span", {
653
+ className: `${I}-span`,
654
+ children: r
655
+ })
656
+ });
657
+ }, Ce = ({ theme: n, ...r }) => {
658
+ let { componentStyles: i } = e([a.ICONBUTTON], n);
659
+ return /* @__PURE__ */ t(Se, {
660
+ ...r,
661
+ style: i
662
+ });
663
+ }, we = (e, t) => `
664
+ // OUTLINE
665
+ ${i(e, "outline-color", `--DATEPICKERMENU-EVENTS-${t}-OUTLINE-COLOR`)}
666
+ ${i(e, "outline-width", `--DATEPICKERMENU-EVENTS-${t}-OUTLINE-WIDTH`)}
667
+ ${i(e, "outline-style", `--DATEPICKERMENU-EVENTS-${t}-OUTLINE-STYLE`)}
668
+ ${i(e, "outline-offset", `--DATEPICKERMENU-EVENTS-${t}-OUTLINE-OFFSET`)}
669
+ `, Te = (e) => T`
670
+ &.--DATEPICKERMENU {
671
+ z-index: 100;
672
+ position: absolute;
673
+ top: 52px;
674
+ left: 0px;
675
+ box-shadow:
676
+ rgba(0, 0, 0, 0.2) 0px 5px 5px -3px,
677
+ rgba(0, 0, 0, 0.14) 0px 8px 10px 1px,
678
+ rgba(0, 0, 0, 0.12) 0px 3px 14px 2px;
679
+ ${i(e, "border-radius", "--DATEPICKERMENU-ROOT-BORDER-RADIUS")};
680
+ ${i(e, "background-color", "--DATEPICKERMENU-ROOT-BACKGROUND-COLOR")};
681
+ box-sizing: border-box;
682
+ padding: 16px;
683
+ width: 272px;
684
+ height: autopx;
685
+
686
+ // Animation
687
+ display: none;
688
+ opacity: 0;
689
+ translate: 0px -10px;
690
+ transition-property: display opacity translate;
691
+ transition-duration: 150ms;
692
+ transition-behavior: allow-discrete;
693
+
694
+ &.--DATEPICKERMENU-open {
695
+ display: block;
696
+ opacity: 1;
697
+ translate: 0px 0px;
698
+
699
+ @starting-style {
700
+ opacity: 0;
701
+ translate: 0px -10px;
702
+ }
703
+ }
704
+
705
+ &.--DATEPICKERMENU-static {
706
+ position: static;
707
+ margin-top: 8px;
708
+ }
709
+
710
+ // ── Header (month/year + navigation) ──────────────────────────────────────
711
+
712
+ .--DATEPICKERMENU-header {
713
+ display: flex;
714
+ justify-content: space-between;
715
+ align-items: center;
716
+ margin: 0 0px 12px 4px;
717
+
718
+ .--DATEPICKERMENU-yearToggle {
719
+ display: flex;
720
+ gap: 12px;
721
+ align-items: center;
722
+
723
+ .--DATEPICKERMENU-labelWrap {
724
+ overflow-x: hidden;
725
+
726
+ .--DATEPICKERMENU-headerLabel {
727
+ font-family: ${e["--FONTFAMILY-PRIMARY"]};
728
+ font-size: 1rem;
729
+ ${i(e, "color", "--DATEPICKERMENU-EVENTS-ENABLED-COLOR-PRIMARY")};
730
+
731
+ .--DATEPICKERMENU-yearLabel {
732
+ font-family: ${e["--FONTFAMILY-SECONDARY"] || e["--FONTFAMILY-PRIMARY"]};
733
+ font-size: 0.938rem;
734
+ ${i(e, "color", "--DATEPICKERMENU-EVENTS-ENABLED-COLOR-PRIMARY")};
735
+ }
736
+ }
737
+
738
+ // Slide animations when month changes
739
+ &.--DATEPICKERMENU-slideLeft .--DATEPICKERMENU-headerLabel {
740
+ animation: dpSlideFromLeft 150ms ease-in-out;
741
+ }
742
+ &.--DATEPICKERMENU-slideRight .--DATEPICKERMENU-headerLabel {
743
+ animation: dpSlideFromRight 150ms ease-in-out;
744
+ }
745
+ }
746
+
747
+ .--DATEPICKERMENU-yearArrow {
748
+ ${i(e, "color", "--DATEPICKERMENU-EVENTS-ENABLED-ICON-COLOR")};
749
+ }
750
+ }
751
+
752
+ .--DATEPICKERMENU-monthNav {
753
+ display: flex;
754
+ gap: 12px;
755
+
756
+ .--DATEPICKERMENU-navArrow {
757
+ ${i(e, "color", "--DATEPICKERMENU-EVENTS-ENABLED-ICON-COLOR")};
758
+ }
759
+ }
760
+ }
761
+
762
+ // ── Calendar grid ─────────────────────────────────────────────────────────
763
+
764
+ .--DATEPICKERMENU-body {
765
+ display: flex;
766
+ flex-direction: column;
767
+ gap: 12px;
768
+ overflow-y: clip;
769
+ height: 245px;
770
+
771
+ &.--DATEPICKERMENU-yearBody {
772
+ overflow: clip;
773
+ overflow-clip-margin: 18px;
774
+ }
775
+ }
776
+
777
+ .--DATEPICKERMENU-yearScrollWrapper {
778
+ display: flex;
779
+ flex-direction: column;
780
+ gap: 12px;
781
+ overflow-y: scroll;
782
+ height: 100%;
783
+ width: calc(100% + 24px);
784
+ margin-left: -8px;
785
+ padding: 8px;
786
+ box-sizing: border-box;
787
+ scroll-padding: 8px;
788
+
789
+ &::-webkit-scrollbar {
790
+ width: 12px;
791
+ height: 4px;
792
+ cursor: pointer;
793
+ }
794
+
795
+ &::-webkit-scrollbar-thumb {
796
+ background-color: rgba(0, 0, 0, 0.5);
797
+ border-radius: 9999px;
798
+ border: 3px solid transparent;
799
+ background-clip: padding-box;
800
+ }
801
+ }
802
+
803
+ .--DATEPICKERMENU-weekRow {
804
+ display: flex;
805
+ width: 100%;
806
+ justify-content: space-between;
807
+ gap: 12px;
808
+ }
809
+
810
+ // Viewport that clips the slide animation while letting outlines overflow
811
+ .--DATEPICKERMENU-gridViewport {
812
+ overflow: clip;
813
+ overflow-clip-margin: 6px;
814
+ }
815
+
816
+ // Month grid (with slide animation)
817
+ .--DATEPICKERMENU-calendarGrid {
818
+ display: flex;
819
+ flex-direction: column;
820
+ gap: 12px;
821
+
822
+ &.--DATEPICKERMENU-slideLeft {
823
+ animation: dpSlideFromLeft 150ms ease-in-out;
824
+ }
825
+ &.--DATEPICKERMENU-slideRight {
826
+ animation: dpSlideFromRight 150ms ease-in-out;
827
+ }
828
+ }
829
+
830
+ // ── Day cells ─────────────────────────────────────────────────────────────
831
+
832
+ .--DATEPICKERMENU-dayCell {
833
+ font-family: ${e["--FONTFAMILY-PRIMARY"]};
834
+ font-size: 14px;
835
+ ${i(e, "color", "--DATEPICKERMENU-EVENTS-ENABLED-COLOR-SECONDARY")};
836
+ width: 24px;
837
+ height: 24px;
838
+ display: flex;
839
+ justify-content: center;
840
+ align-items: center;
841
+ background-color: transparent;
842
+ }
843
+
844
+ .--DATEPICKERMENU-dayBtn {
845
+ width: 24px;
846
+ height: 24px;
847
+ cursor: pointer;
848
+ border: none;
849
+ border-radius: 4px;
850
+ font-family: ${e["--FONTFAMILY-PRIMARY"]};
851
+ font-size: 14px;
852
+ ${i(e, "color", "--DATEPICKERMENU-EVENTS-ENABLED-COLOR-PRIMARY")};
853
+ display: flex;
854
+ justify-content: center;
855
+ align-items: center;
856
+ background-color: transparent;
857
+ isolation: isolate;
858
+ padding: 0px;
859
+
860
+ &::before {
861
+ content: '';
862
+ position: absolute;
863
+ width: 36px;
864
+ height: 36px;
865
+ border-radius: 50%;
866
+ opacity: 0;
867
+ transition: opacity 150ms ease-in-out;
868
+ z-index: -1;
869
+ }
870
+
871
+ // Hover
872
+ &:hover {
873
+ ::before {
874
+ opacity: 1;
875
+ ${i(e, "background-color", "--DATEPICKERMENU-EVENTS-HOVER-BACKGROUND-COLOR")};
876
+ }
877
+ }
878
+
879
+ // Active
880
+ &:active {
881
+ &::before {
882
+ opacity: 1;
883
+ ${i(e, "background-color", "--DATEPICKERMENU-EVENTS-ACTIVE-BACKGROUND-COLOR")};
884
+ }
885
+ }
886
+
887
+ // Focus
888
+ &.--DATEPICKERMENU-focused,
889
+ &:focus-visible {
890
+ outline: none;
891
+ ${we(e, "FOCUS")};
892
+ }
893
+
894
+ &.--DATEPICKERMENU-today {
895
+ ${i(e, "background-color", "--DATEPICKERMENU-EVENTS-ENABLED-BACKGROUND-COLOR")};
896
+ }
897
+
898
+ &.--DATEPICKERMENU-selected {
899
+ ${i(e, "background-color", "--DATEPICKERMENU-EVENTS-VALUE-BACKGROUND-COLOR")};
900
+ ${i(e, "color", "--DATEPICKERMENU-EVENTS-VALUE-COLOR-PRIMARY")};
901
+ }
902
+
903
+ &:disabled {
904
+ pointer-events: none;
905
+ cursor: default;
906
+ ${i(e, "color", "--DATEPICKERMENU-EVENTS-DISABLED-COLOR-PRIMARY")};
907
+ background-color: transparent;
908
+
909
+ &.--DATEPICKERMENU-selected {
910
+ ${i(e, "background-color", "--DATEPICKERMENU-EVENTS-DISABLED-COLOR-PRIMARY")};
911
+ }
912
+
913
+ &.--DATEPICKERMENU-today::after {
914
+ ${i(e, "background-color", "--DATEPICKERMENU-EVENTS-DISABLED-COLOR-PRIMARY")};
915
+ }
916
+ }
917
+ }
918
+
919
+ // ── Year cells ────────────────────────────────────────────────────────────
920
+
921
+ .--DATEPICKERMENU-yearBtn {
922
+ cursor: pointer;
923
+ border: none;
924
+ border-radius: 4px;
925
+ font-family: ${e["--FONTFAMILY-PRIMARY"]};
926
+ font-size: 14px;
927
+ ${i(e, "color", "--DATEPICKERMENU-EVENTS-ENABLED-COLOR-PRIMARY")};
928
+ width: 40.5px;
929
+ height: 24px;
930
+ display: flex;
931
+ justify-content: center;
932
+ align-items: center;
933
+ background-color: transparent;
934
+ position: relative;
935
+ isolation: isolate;
936
+ padding: 0px;
937
+
938
+ &::before {
939
+ content: '';
940
+ position: absolute;
941
+ width: 54px;
942
+ height: 36px;
943
+ border-radius: 18px;
944
+ opacity: 0;
945
+ transition: opacity 150ms ease-in-out;
946
+ z-index: -1;
947
+ }
948
+
949
+ // Hover
950
+ &:hover {
951
+ ::before {
952
+ opacity: 1;
953
+ ${i(e, "background-color", "--DATEPICKERMENU-EVENTS-HOVER-BACKGROUND-COLOR")};
954
+ }
955
+ }
956
+
957
+ // Active
958
+ &:active {
959
+ &::before {
960
+ opacity: 1;
961
+ ${i(e, "background-color", "--DATEPICKERMENU-EVENTS-ACTIVE-BACKGROUND-COLOR")};
962
+ }
963
+ }
964
+
965
+ // Focus
966
+ &.--DATEPICKERMENU-focused,
967
+ &:focus-visible {
968
+ outline: none;
969
+ ${we(e, "FOCUS")};
970
+ }
971
+
972
+ &.--DATEPICKERMENU-selected {
973
+ ${i(e, "background-color", "--DATEPICKERMENU-EVENTS-VALUE-BACKGROUND-COLOR")};
974
+ ${i(e, "color", "--DATEPICKERMENU-EVENTS-VALUE-COLOR-PRIMARY")};
975
+ }
976
+ }
977
+ }
978
+
979
+ @keyframes dpSlideFromLeft {
980
+ from {
981
+ translate: -100% 0;
982
+ }
983
+ to {
984
+ translate: 0 0;
985
+ }
986
+ }
987
+
988
+ @keyframes dpSlideFromRight {
989
+ from {
990
+ translate: 100% 0;
991
+ }
992
+ to {
993
+ translate: 0 0;
994
+ }
995
+ }
996
+ `, L = "--DATEPICKERMENU", Ee = oe(({ isOpen: e, hasStaticOptions: i = !1, testId: a = `${L}-root`, monthLabel: o = "", yearLabel: s = "", onPrevMonth: c, onNextMonth: l, disablePrev: u = !1, disableNext: ee = !1, weeks: f = [], years: p = [], daysOfWeek: ne = [], selectedValue: m, format: h = "MM/dd/yyyy", today: g, focusedElement: re = -1, onSelectDay: _ = () => {}, onSelectYear: v = () => {}, onMoveFocus: y = () => {}, onClose: ie = () => {}, style: b }, ae) => {
997
+ let [x, oe] = w(!1), [se, S] = w(null), [T, ue] = w(0), [de, E] = w(!1), [D, O] = w(-1), k = C({}), A = C({}), he = C(null), j = C(o + s);
998
+ ce(() => {
999
+ if (!e) return;
1000
+ let t = o + s;
1001
+ t !== j.current && (j.current = t);
1002
+ }, [
1003
+ o,
1004
+ s,
1005
+ e
1006
+ ]);
1007
+ let M = () => {
1008
+ S("left"), ue((e) => e + 1), c();
1009
+ }, N = () => {
1010
+ S("right"), ue((e) => e + 1), l();
1011
+ };
1012
+ ce(() => {
1013
+ if (!e || re < 0) return;
1014
+ let t = k.current[re];
1015
+ if (!t) return;
1016
+ let n = document.activeElement;
1017
+ n && (n.tagName === "INPUT" || n.role === "combobox") || t.focus(), t.scrollIntoView?.({
1018
+ block: "nearest",
1019
+ inline: "nearest"
1020
+ });
1021
+ }, [re, e]), ce(() => {
1022
+ if (!e) {
1023
+ let e = setTimeout(() => oe(!1), 150);
1024
+ return () => clearTimeout(e);
1025
+ }
1026
+ }, [e]), le(() => {
1027
+ if (!x) {
1028
+ O(-1);
1029
+ return;
1030
+ }
1031
+ let e = m && d(m) ? m.getFullYear() : g?.getFullYear() ?? (/* @__PURE__ */ new Date()).getFullYear(), t = p.flat().findIndex((t) => t.label === String(e));
1032
+ O(t >= 0 ? t : 0);
1033
+ }, [x]), le(() => {
1034
+ if (!x || D < 0) return;
1035
+ let e = A.current[D];
1036
+ e && (e.focus({ preventScroll: !0 }), e.scrollIntoView?.({
1037
+ block: "nearest",
1038
+ inline: "nearest"
1039
+ }));
1040
+ }, [D, x]);
1041
+ let P = (e, t) => {
1042
+ if ([
1043
+ "ArrowLeft",
1044
+ "ArrowRight",
1045
+ "ArrowUp",
1046
+ "ArrowDown"
1047
+ ].includes(e.key)) {
1048
+ e.preventDefault(), e.stopPropagation(), y(e.key);
1049
+ return;
1050
+ }
1051
+ e.key === "Enter" && (e.preventDefault(), e.stopPropagation(), _(t, !0));
1052
+ }, ge = (e, t) => {
1053
+ let n = e.querySelector(t);
1054
+ return n ? n.tagName === "BUTTON" ? n : n.querySelector("button") : null;
1055
+ }, _e = (e) => {
1056
+ let t = p[0]?.length ?? 4, n = {
1057
+ ArrowRight: 1,
1058
+ ArrowLeft: -1,
1059
+ ArrowDown: t,
1060
+ ArrowUp: -t
1061
+ }[e];
1062
+ if (!n) return;
1063
+ let r = D + n;
1064
+ r < 0 || r >= p.flat().length || O(r);
1065
+ }, ve = (e) => {
1066
+ let t = he.current;
1067
+ if (!t) return;
1068
+ let n = ge(t, `.${L}-yearArrow`), r = Array.from(t.querySelectorAll(`.${L}-navArrow`)), i = x ? null : r[0]?.tagName === "BUTTON" ? r[0] : r[0]?.querySelector("button") ?? null, a = x ? null : r[1]?.tagName === "BUTTON" ? r[1] : r[1]?.querySelector("button") ?? null, o = !x && re >= 0 ? k.current[re] ?? null : null, s = x && D >= 0 ? A.current[D] ?? null : null, c = x ? [n, s].filter((e) => e !== null) : [
1069
+ n,
1070
+ i,
1071
+ a,
1072
+ o
1073
+ ].filter((e) => e !== null);
1074
+ c.length !== 0 && c[(c.indexOf(document.activeElement) + (e ? -1 : 1) + c.length) % c.length]?.focus();
1075
+ }, ye = (e) => {
1076
+ if (e.key === "Escape") {
1077
+ e.preventDefault(), e.stopPropagation(), ie();
1078
+ return;
1079
+ }
1080
+ if (e.key === "Tab") {
1081
+ e.preventDefault(), e.stopPropagation(), ve(e.shiftKey);
1082
+ return;
1083
+ }
1084
+ [
1085
+ "ArrowLeft",
1086
+ "ArrowRight",
1087
+ "ArrowUp",
1088
+ "ArrowDown"
1089
+ ].includes(e.key) && (x ? (e.preventDefault(), e.stopPropagation(), _e(e.key)) : Object.values(k.current).some((e) => e === document.activeElement) || (e.preventDefault(), e.stopPropagation(), y(e.key)));
1090
+ }, be = m && d(m) ? te(m, h) : null, F = g && d(g) ? te(g, h) : null;
1091
+ return /* @__PURE__ */ t("div", {
1092
+ ref: ae,
1093
+ children: /* @__PURE__ */ n("div", {
1094
+ ref: he,
1095
+ className: [
1096
+ L,
1097
+ e ? `${L}-open` : "",
1098
+ i ? `${L}-static` : ""
1099
+ ].filter(Boolean).join(" "),
1100
+ css: Te(b),
1101
+ role: "dialog",
1102
+ "aria-label": "Date picker calendar",
1103
+ "data-testid": a,
1104
+ onKeyDownCapture: ye,
1105
+ children: [/* @__PURE__ */ n("div", {
1106
+ className: `${L}-header`,
1107
+ children: [/* @__PURE__ */ n("div", {
1108
+ className: `${L}-yearToggle`,
1109
+ children: [/* @__PURE__ */ t("div", {
1110
+ className: `${L}-labelWrap`,
1111
+ children: /* @__PURE__ */ n("span", {
1112
+ className: `${L}-headerLabel`,
1113
+ children: [
1114
+ o,
1115
+ " ",
1116
+ /* @__PURE__ */ t("span", {
1117
+ className: `${L}-yearLabel`,
1118
+ children: s
1119
+ })
1120
+ ]
1121
+ })
1122
+ }), /* @__PURE__ */ t(Ce, {
1123
+ icon: /* @__PURE__ */ t(fe, {}),
1124
+ onClick: () => oe((e) => !e),
1125
+ className: `${L}-yearArrow`,
1126
+ isFlipped: !x,
1127
+ "aria-label": x ? "Close year selector" : "Open year selector",
1128
+ tabIndex: -1,
1129
+ onFocus: () => E(!0)
1130
+ })]
1131
+ }), !x && /* @__PURE__ */ n("div", {
1132
+ className: `${L}-monthNav`,
1133
+ children: [/* @__PURE__ */ t(Ce, {
1134
+ icon: /* @__PURE__ */ t(pe, {}),
1135
+ onClick: M,
1136
+ className: `${L}-navArrow`,
1137
+ disabled: u,
1138
+ "aria-label": "Previous month",
1139
+ tabIndex: -1,
1140
+ onFocus: () => E(!0)
1141
+ }), /* @__PURE__ */ t(Ce, {
1142
+ icon: /* @__PURE__ */ t(me, {}),
1143
+ onClick: N,
1144
+ className: `${L}-navArrow`,
1145
+ disabled: ee,
1146
+ "aria-label": "Next month",
1147
+ tabIndex: -1,
1148
+ onFocus: () => E(!0)
1149
+ })]
1150
+ })]
1151
+ }), /* @__PURE__ */ n("div", {
1152
+ className: [`${L}-body`, x ? `${L}-yearBody` : ""].filter(Boolean).join(" "),
1153
+ children: [!x && /* @__PURE__ */ n(r, { children: [/* @__PURE__ */ t("div", {
1154
+ className: `${L}-weekRow`,
1155
+ children: ne.map((e, n) => /* @__PURE__ */ t("span", {
1156
+ className: `${L}-dayCell`,
1157
+ children: e
1158
+ }, `header-${n}`))
1159
+ }), /* @__PURE__ */ t("div", {
1160
+ className: `${L}-gridViewport`,
1161
+ children: /* @__PURE__ */ t("div", {
1162
+ className: [
1163
+ `${L}-calendarGrid`,
1164
+ se === "left" ? `${L}-slideLeft` : "",
1165
+ se === "right" ? `${L}-slideRight` : ""
1166
+ ].filter(Boolean).join(" "),
1167
+ onAnimationEnd: () => S(null),
1168
+ children: (() => {
1169
+ let n = 0;
1170
+ return f.map((r, i) => /* @__PURE__ */ t("div", {
1171
+ className: `${L}-weekRow`,
1172
+ children: r.map((r, a) => {
1173
+ if (!r.isDate) return /* @__PURE__ */ t("span", { className: `${L}-dayCell` }, `blank-${i}-${a}`);
1174
+ let o = n++, s = !!(be && r.value === be && e), c = r.value === F, l = re === o && e && !de;
1175
+ return /* @__PURE__ */ t("button", {
1176
+ id: `${L}-day-${o}`,
1177
+ ref: (e) => {
1178
+ k.current[o] = e;
1179
+ },
1180
+ className: [
1181
+ `${L}-dayBtn`,
1182
+ s ? `${L}-selected` : "",
1183
+ c ? `${L}-today` : "",
1184
+ l ? `${L}-focused` : ""
1185
+ ].filter(Boolean).join(" "),
1186
+ type: "button",
1187
+ onClick: () => _(r.value),
1188
+ onFocus: () => E(!1),
1189
+ onKeyDown: (e) => P(e, r.value),
1190
+ disabled: r.isDisabled,
1191
+ role: "option",
1192
+ "aria-selected": s,
1193
+ tabIndex: -1,
1194
+ children: r.label
1195
+ }, r.value);
1196
+ })
1197
+ }, `week-${i}`));
1198
+ })()
1199
+ }, T)
1200
+ })] }), x && /* @__PURE__ */ t("div", {
1201
+ className: `${L}-yearScrollWrapper`,
1202
+ children: (() => {
1203
+ let e = 0;
1204
+ return p.map((n, r) => /* @__PURE__ */ t("div", {
1205
+ className: `${L}-weekRow`,
1206
+ children: n.map((n) => {
1207
+ let r = e++, i = m && d(m) ? n.label === te(m, "yyyy") : !1, a = D === r && !de;
1208
+ return /* @__PURE__ */ t("button", {
1209
+ ref: (e) => {
1210
+ A.current[r] = e;
1211
+ },
1212
+ className: [
1213
+ `${L}-yearBtn`,
1214
+ i ? `${L}-selected` : "",
1215
+ a ? `${L}-focused` : ""
1216
+ ].filter(Boolean).join(" "),
1217
+ type: "button",
1218
+ tabIndex: -1,
1219
+ onClick: () => {
1220
+ v(n.value), oe(!1);
1221
+ },
1222
+ onFocus: () => E(!1),
1223
+ "aria-selected": i,
1224
+ children: n.label
1225
+ }, n.value);
1226
+ })
1227
+ }, `year-row-${r}`));
1228
+ })()
1229
+ })]
1230
+ })]
1231
+ })
1232
+ });
1233
+ });
1234
+ Ee.displayName = "DatePickerMenu";
1235
+ //#endregion
1236
+ //#region src/components/atoms/DatePicker/DatePickerMenu/index.tsx
1237
+ var De = x.forwardRef(({ theme: n, ...r }, i) => {
1238
+ let { componentStyles: o } = e([a.DATEPICKERMENU, a.DATEPICKER], n);
1239
+ return /* @__PURE__ */ t(Ee, {
1240
+ ...r,
1241
+ style: o,
1242
+ ref: i
1243
+ });
1244
+ });
1245
+ De.displayName = "DatePickerMenu";
1246
+ //#endregion
1247
+ //#region src/components/atoms/DatePicker/DatePicker.tsx
1248
+ var R = "--DATEPICKER", Oe = ({ name: e, label: r, control: i, language: a = f(), minDate: o, maxDate: ae, disabled: x, disableFuture: oe, disablePast: se, hasStaticOptions: le = !1, showErrorText: T = !0, hasPadding: fe = !1, helperText: pe, style: me, className: E }) => {
1249
+ let D = _[a].format, O = S(() => s(/* @__PURE__ */ new Date()), []), k = a === "en", { field: A, fieldState: he } = ue({
1250
+ control: i,
1251
+ name: e
1252
+ }), j = he.error, M = S(() => d(A.value) ? u(A.value) : {
1253
+ day: "",
1254
+ month: "",
1255
+ year: ""
1256
+ }, []), [N, P] = w(M.day), [_e, ve] = w(M.month), [ye, be] = w(M.year), [F, xe] = w(!1), [I, Se] = w(-1), [we, Te] = w(() => d(A.value) ? A.value : O), L = C(null), Ee = C(null), Oe = C(null), ke = C(null), z = C(null), B = C(null), V = C(""), Ae = C(""), H = C(""), je = F || !!(N || _e || ye), U = S(() => c(we, D, a, {
1257
+ minDate: o,
1258
+ maxDate: ae,
1259
+ disableFuture: oe,
1260
+ disablePast: se,
1261
+ today: O
1262
+ }), [
1263
+ we,
1264
+ a,
1265
+ o,
1266
+ ae,
1267
+ oe,
1268
+ se,
1269
+ O,
1270
+ D
1271
+ ]), Me = S(() => U.flat().filter((e) => e.isDate), [U]), Ne = S(() => m(D, 1900, 200, 4), [D]), Pe = _[a].daysOfWeek.map((e) => ne[a][e]), Fe = g(we, a), Ie = te(we, "yyyy");
1272
+ ce(() => {
1273
+ if (!N && !_e && !ye) return;
1274
+ let e = N || "01", t = _e || "01", n = ye || "2000", r = h(k ? `${t}/${e}/${n}` : `${e}/${t}/${n}`, D, /* @__PURE__ */ new Date());
1275
+ A.onChange(r), l(r) && Te(r), j && A.onBlur();
1276
+ }, [
1277
+ N,
1278
+ _e,
1279
+ ye
1280
+ ]), b({
1281
+ ref: Ee,
1282
+ onAction: () => {
1283
+ xe(!1), A.onBlur();
1284
+ },
1285
+ isActive: F,
1286
+ exceptRef: L
1287
+ });
1288
+ let Le = (e) => {
1289
+ let t = e.relatedTarget, n = L.current?.contains(t), r = Ee.current?.contains(t);
1290
+ n || r || (xe(!1), A.onBlur());
1291
+ }, Re = (e) => requestAnimationFrame(() => e.current?.focus()), ze = (e) => {
1292
+ if ([
1293
+ "ArrowLeft",
1294
+ "ArrowRight",
1295
+ "ArrowUp",
1296
+ "ArrowDown"
1297
+ ].includes(e.key) && F) {
1298
+ e.preventDefault(), e.stopPropagation(), We(e.key);
1299
+ return;
1300
+ }
1301
+ if (e.key === "Backspace" || e.key === "Delete") {
1302
+ e.preventDefault(), P(""), V.current = "";
1303
+ return;
1304
+ }
1305
+ if (!/^\d$/.test(e.key)) return;
1306
+ e.preventDefault(), V.current = (V.current + e.key).slice(-2);
1307
+ let t = parseInt(V.current, 10);
1308
+ if (t === 0) {
1309
+ P("01"), V.current = "";
1310
+ return;
1311
+ }
1312
+ P(String(Math.min(t, 31)).padStart(2, "0")), (t > 3 || V.current.length >= 2) && (V.current = "", Re(k ? B : z));
1313
+ }, W = (e) => {
1314
+ if ([
1315
+ "ArrowLeft",
1316
+ "ArrowRight",
1317
+ "ArrowUp",
1318
+ "ArrowDown"
1319
+ ].includes(e.key) && F) {
1320
+ e.preventDefault(), e.stopPropagation(), We(e.key);
1321
+ return;
1322
+ }
1323
+ if (e.key === "Backspace" || e.key === "Delete") {
1324
+ e.preventDefault(), ve(""), Ae.current = "";
1325
+ return;
1326
+ }
1327
+ if (!/^\d$/.test(e.key)) return;
1328
+ e.preventDefault(), Ae.current = (Ae.current + e.key).slice(-2);
1329
+ let t = parseInt(Ae.current, 10);
1330
+ if (t === 0) {
1331
+ ve("01"), Ae.current = "";
1332
+ return;
1333
+ }
1334
+ ve(String(Math.min(t, 12)).padStart(2, "0")), (t > 1 || Ae.current.length >= 2) && (Ae.current = "", Re(k ? ke : B));
1335
+ }, Be = (e) => {
1336
+ if ([
1337
+ "ArrowLeft",
1338
+ "ArrowRight",
1339
+ "ArrowUp",
1340
+ "ArrowDown"
1341
+ ].includes(e.key) && F) {
1342
+ e.preventDefault(), e.stopPropagation(), We(e.key);
1343
+ return;
1344
+ }
1345
+ if (e.key === "Backspace" || e.key === "Delete") {
1346
+ e.preventDefault(), be(""), H.current = "";
1347
+ return;
1348
+ }
1349
+ /^\d$/.test(e.key) && (e.preventDefault(), H.current = (H.current + e.key).slice(-4), be(String(parseInt(H.current, 10)).padStart(4, "0")));
1350
+ }, G = () => {
1351
+ if (x) return;
1352
+ let e = l(A.value) ? A.value : O;
1353
+ Te(e), Se(e.getDate() - 1), xe(!0);
1354
+ }, Ve = () => xe(!1), He = () => F ? Ve() : G(), Ue = () => {
1355
+ Te((e) => y(e, -1)), Se(-1);
1356
+ }, K = () => {
1357
+ Te((e) => y(e, 1)), Se(-1);
1358
+ }, q = v(we, {
1359
+ minDate: o,
1360
+ disablePast: se,
1361
+ today: O,
1362
+ format: D
1363
+ }), J = p(we, {
1364
+ maxDate: ae,
1365
+ disableFuture: oe,
1366
+ today: O,
1367
+ format: D
1368
+ }), We = (e) => {
1369
+ if (!F) return;
1370
+ let t = {
1371
+ ArrowRight: 1,
1372
+ ArrowLeft: -1,
1373
+ ArrowDown: 7,
1374
+ ArrowUp: -7
1375
+ }[e];
1376
+ if (!t) return;
1377
+ if (I < 0) {
1378
+ Me.length > 0 && Se(0);
1379
+ return;
1380
+ }
1381
+ let n = Me[I];
1382
+ if (!n) return;
1383
+ let r = h(n.value, D, /* @__PURE__ */ new Date()), i = ie(r, t);
1384
+ if (re(i, {
1385
+ minDate: o,
1386
+ maxDate: ae,
1387
+ disableFuture: oe,
1388
+ disablePast: se,
1389
+ today: O
1390
+ })) return;
1391
+ if (i.getMonth() !== r.getMonth() || i.getFullYear() !== r.getFullYear()) {
1392
+ if (t > 0 && J || t < 0 && q) return;
1393
+ Te(ee(i)), Se(i.getDate() - 1);
1394
+ return;
1395
+ }
1396
+ let a = Me.findIndex((e) => e.value === te(i, D));
1397
+ a >= 0 && Se(a);
1398
+ }, Y = (e, t) => {
1399
+ let n = h(e, D, /* @__PURE__ */ new Date());
1400
+ A.onChange(n);
1401
+ let r = u(n);
1402
+ P(r.day), ve(r.month), be(r.year), xe(!1), t && requestAnimationFrame(() => Oe.current?.querySelector("button")?.focus());
1403
+ }, Ge = (e) => {
1404
+ let t = h(e, D, /* @__PURE__ */ new Date()), n = l(A.value) ? A.value : O, r = new Date(n);
1405
+ r.setFullYear(t.getFullYear());
1406
+ let i = h(te(r, D), D, /* @__PURE__ */ new Date());
1407
+ A.onChange(i);
1408
+ let a = u(i);
1409
+ P(a.day), ve(a.month), be(a.year), Te(i);
1410
+ }, Ke = (e) => {
1411
+ if (e.key === "Tab") {
1412
+ Ve();
1413
+ return;
1414
+ }
1415
+ if (e.key === "Escape") {
1416
+ Ve();
1417
+ return;
1418
+ }
1419
+ e.key === "Enter" && F && (e.preventDefault(), I >= 0 && Me[I] && !Me[I].isDisabled && Y(Me[I].value)), [
1420
+ "ArrowLeft",
1421
+ "ArrowRight",
1422
+ "ArrowUp",
1423
+ "ArrowDown"
1424
+ ].includes(e.key) && F && (e.preventDefault(), We(e.key));
1425
+ }, qe = k ? z : ke, Je = k ? "MM" : "DD", Ye = k ? _e : N, X = k ? W : ze, Xe = k ? () => {
1426
+ Ae.current = "";
1427
+ } : () => {
1428
+ V.current = "";
1429
+ }, Ze = k ? ke : z, Z = k ? "DD" : "MM", Qe = k ? N : _e, $e = k ? ze : W, et = k ? () => {
1430
+ V.current = "";
1431
+ } : () => {
1432
+ Ae.current = "";
1433
+ };
1434
+ return /* @__PURE__ */ n("div", {
1435
+ className: [
1436
+ R,
1437
+ fe ? `${R}-paddingBottom` : "",
1438
+ E || ""
1439
+ ].join(" "),
1440
+ css: ge(me),
1441
+ "data-testid": R,
1442
+ children: [
1443
+ /* @__PURE__ */ n("div", {
1444
+ ref: L,
1445
+ className: `${R}-container`,
1446
+ onBlur: Le,
1447
+ onKeyDown: Ke,
1448
+ children: [
1449
+ /* @__PURE__ */ n("div", {
1450
+ className: [
1451
+ `${R}-fieldRow`,
1452
+ je ? `${R}-open` : "",
1453
+ j ? `${R}-error` : "",
1454
+ x ? `${R}-disabled` : ""
1455
+ ].join(" "),
1456
+ onClick: (e) => {
1457
+ e.target === e.currentTarget && qe.current?.focus();
1458
+ },
1459
+ "data-testid": `${R}-fieldRow`,
1460
+ children: [
1461
+ /* @__PURE__ */ t("span", {
1462
+ ref: qe,
1463
+ role: "spinbutton",
1464
+ "aria-label": k ? "Month" : "Day",
1465
+ "aria-valuenow": parseInt(Ye) || void 0,
1466
+ "aria-valuemin": 1,
1467
+ "aria-valuemax": k ? 12 : 31,
1468
+ "aria-valuetext": Ye || Je,
1469
+ className: [`${R}-partInput`, Ye ? "" : `${R}-placeholder`].filter(Boolean).join(" "),
1470
+ tabIndex: x ? -1 : 0,
1471
+ onKeyDown: X,
1472
+ onFocus: Xe,
1473
+ "data-testid": `${R}-first`,
1474
+ children: Ye || Je
1475
+ }),
1476
+ /* @__PURE__ */ t("span", {
1477
+ className: `${R}-separator`,
1478
+ children: "/"
1479
+ }),
1480
+ /* @__PURE__ */ t("span", {
1481
+ ref: Ze,
1482
+ role: "spinbutton",
1483
+ "aria-label": k ? "Day" : "Month",
1484
+ "aria-valuenow": parseInt(Qe) || void 0,
1485
+ "aria-valuemin": 1,
1486
+ "aria-valuemax": k ? 31 : 12,
1487
+ "aria-valuetext": Qe || Z,
1488
+ className: [`${R}-partInput`, Qe ? "" : `${R}-placeholder`].filter(Boolean).join(" "),
1489
+ tabIndex: x ? -1 : 0,
1490
+ onKeyDown: $e,
1491
+ onFocus: et,
1492
+ "data-testid": `${R}-second`,
1493
+ children: Qe || Z
1494
+ }),
1495
+ /* @__PURE__ */ t("span", {
1496
+ className: `${R}-separator`,
1497
+ children: "/"
1498
+ }),
1499
+ /* @__PURE__ */ t("span", {
1500
+ ref: B,
1501
+ role: "spinbutton",
1502
+ "aria-label": "Year",
1503
+ "aria-valuenow": parseInt(ye) || void 0,
1504
+ "aria-valuemin": 1900,
1505
+ "aria-valuemax": 2100,
1506
+ "aria-valuetext": ye || "YYYY",
1507
+ className: [`${R}-partInput`, ye ? "" : `${R}-placeholder`].filter(Boolean).join(" "),
1508
+ tabIndex: x ? -1 : 0,
1509
+ onKeyDown: Be,
1510
+ onFocus: () => {
1511
+ H.current = "";
1512
+ },
1513
+ "data-testid": `${R}-year`,
1514
+ children: ye || "YYYY"
1515
+ })
1516
+ ]
1517
+ }),
1518
+ /* @__PURE__ */ t("div", {
1519
+ ref: Oe,
1520
+ className: `${R}-adornment`,
1521
+ children: /* @__PURE__ */ t(Ce, {
1522
+ className: `${R}-calendarIcon`,
1523
+ onClick: He,
1524
+ icon: /* @__PURE__ */ t(de, {}),
1525
+ disabled: x,
1526
+ tabIndex: 0,
1527
+ "data-testid": `${R}-calendarIcon`
1528
+ })
1529
+ }),
1530
+ /* @__PURE__ */ t("fieldset", {
1531
+ "aria-hidden": "true",
1532
+ className: `${R}-fieldset`,
1533
+ children: /* @__PURE__ */ t("legend", {
1534
+ className: `${R}-legend`,
1535
+ children: /* @__PURE__ */ t("span", {
1536
+ className: `${R}-text`,
1537
+ children: r
1538
+ })
1539
+ })
1540
+ }),
1541
+ /* @__PURE__ */ t("span", {
1542
+ className: `${R}-label`,
1543
+ children: r
1544
+ })
1545
+ ]
1546
+ }),
1547
+ /* @__PURE__ */ n("span", {
1548
+ className: `${R}-helperText`,
1549
+ "data-testid": `${R}-helperText`,
1550
+ children: [pe && !j && pe, T && j && j.message]
1551
+ }),
1552
+ /* @__PURE__ */ t(De, {
1553
+ ref: Ee,
1554
+ isOpen: F,
1555
+ hasStaticOptions: le,
1556
+ language: a,
1557
+ monthLabel: Fe,
1558
+ yearLabel: Ie,
1559
+ onPrevMonth: Ue,
1560
+ onNextMonth: K,
1561
+ disablePrev: q,
1562
+ disableNext: J,
1563
+ weeks: U,
1564
+ years: Ne,
1565
+ daysOfWeek: Pe,
1566
+ selectedValue: l(A.value) ? A.value : void 0,
1567
+ format: D,
1568
+ today: O,
1569
+ focusedElement: I,
1570
+ onSelectDay: Y,
1571
+ onSelectYear: Ge,
1572
+ onMoveFocus: We,
1573
+ onClose: Ve
1574
+ })
1575
+ ]
1576
+ });
1577
+ }, ke = ({ theme: n, ...r }) => {
1578
+ let { componentStyles: i } = e([a.DATEPICKER], n);
1579
+ return /* @__PURE__ */ t(Oe, {
1580
+ ...r,
1581
+ style: i
1582
+ });
1583
+ }, z = (e, t) => `
1584
+ // BORDERS
1585
+ ${i(e, "border-color", `--INPUT-EVENTS-${t}-BORDER-COLOR`)};
1586
+ ${i(e, "border-width", `--INPUT-EVENTS-${t}-BORDER-WIDTH`)};
1587
+ ${i(e, "border-style", `--INPUT-EVENTS-${t}-BORDER-STYLE`)};
1588
+ `, B = (e, t) => `
1589
+ // TYPOGRAPHY
1590
+ ${i(e, "color", `--INPUT-EVENTS-${t}-COLOR-PRIMARY`)};
1591
+ ${i(e, "caret-color", `--INPUT-EVENTS-${t}-COLOR-PRIMARY`)};
1592
+ `, V = (e, t, n = !1) => `
1593
+ ${i(e, "color", `--INPUT-EVENTS-${t}-COLOR-SECONDARY`)};
1594
+ ${n ? "transform: translate(14px, -24px); font-size: 0.75rem;" : ""};
1595
+ `, Ae = (e) => `
1596
+ .--INPUT-legend {
1597
+ max-width: ${e ? "100%" : "0px"};
1598
+ }
1599
+ `, H = (e, t) => `
1600
+ ${i(e, "background-color", `--INPUT-EVENTS-${t}-BACKGROUND-COLOR`)};
1601
+ ~ .--INPUT-helperText {
1602
+ ${i(e, "color", `--INPUT-EVENTS-${t}-COLOR-TERTIARY`)};
1603
+ }
1604
+ `, je = (e) => T`
1605
+ &.--INPUT {
1606
+ position: relative;
1607
+ padding: 0;
1608
+ border: 0;
1609
+ width: 100%;
1610
+
1611
+ &.--INPUT-paddingBottom {
1612
+ padding-bottom: 24px;
1613
+ }
1614
+
1615
+ .--INPUT-container {
1616
+ box-sizing: border-box;
1617
+ position: relative;
1618
+ display: inline-flex;
1619
+ align-items: center;
1620
+
1621
+ // Safari Firefox Chrome/Edge
1622
+ width: -webkit-fill-available;
1623
+ width: -moz-available;
1624
+ width: stretch;
1625
+
1626
+ ${i(e, "border-radius", "--INPUT-ROOT-BORDER-RADIUS")};
1627
+
1628
+ // ENABLED
1629
+ ${H(e, "ENABLED")};
1630
+
1631
+ // VALUE
1632
+ &:has(.--INPUT-inputField:not(:placeholder-shown)),
1633
+ &:has(.--INPUT-inputField[placeholder]:not([placeholder=' '])) {
1634
+ ${H(e, "VALUE")};
1635
+ }
1636
+
1637
+ // HOVER
1638
+ &:has(.--INPUT-inputField:hover) {
1639
+ ${H(e, "HOVER")};
1640
+ }
1641
+
1642
+ // ACTIVE
1643
+ &:has(.--INPUT-inputField:active, .--INPUT-inputField.--INPUT-active) {
1644
+ ${H(e, "ACTIVE")};
1645
+ }
1646
+
1647
+ // FOCUS
1648
+ &:has(.--INPUT-inputField:focus-visible) {
1649
+ outline: none;
1650
+ ${H(e, "FOCUS")};
1651
+ }
1652
+
1653
+ // ERROR
1654
+ &:has(.--INPUT-inputField.--INPUT-error) {
1655
+ ${H(e, "ERROR")};
1656
+ }
1657
+
1658
+ // ERROR + VALUE
1659
+ &:has(.--INPUT-inputField.--INPUT-error:not(:placeholder-shown)),
1660
+ &:has(.--INPUT-inputField.--INPUT-error[placeholder]:not([placeholder=' '])) {
1661
+ ${H(e, "ERROR_VALUE")};
1662
+ }
1663
+
1664
+ // ERROR + HOVER
1665
+ &:has(.--INPUT-inputField.--INPUT-error:hover) {
1666
+ ${H(e, "ERROR_HOVER")};
1667
+ }
1668
+
1669
+ // ERROR + ACTIVE
1670
+ &:has(.--INPUT-inputField.--INPUT-error:active, .--INPUT-inputField.--INPUT-error.--INPUT-active) {
1671
+ ${H(e, "ERROR_ACTIVE")};
1672
+ }
1673
+
1674
+ // ERROR + FOCUS
1675
+ &:has(.--INPUT-inputField.--INPUT-error:focus-visible) {
1676
+ ${H(e, "ERROR_FOCUS")};
1677
+ }
1678
+
1679
+ // DISABLED
1680
+ &:has(.--INPUT-inputField:disabled) {
1681
+ pointer-events: none;
1682
+ ${H(e, "DISABLED")};
1683
+ }
1684
+
1685
+ // DISABLED + VALUE
1686
+ &:has(.--INPUT-inputField:disabled:not(:placeholder-shown)),
1687
+ &:has(.--INPUT-inputField:disabled[placeholder]:not([placeholder=' '])) {
1688
+ pointer-events: none;
1689
+ ${H(e, "DISABLED_VALUE")};
1690
+ }
1691
+
1692
+ .--INPUT-inputField {
1693
+ // FONT
1694
+ font-family: ${e["--FONTFAMILY-PRIMARY"]};
1695
+ font-size: 0.875rem; // 14px
1696
+ font-weight: 500;
1697
+ letter-spacing: 0.01em;
1698
+ line-height: 1;
1699
+
1700
+ // Safari Firefox Chrome/Edge
1701
+ height: -webkit-fill-available;
1702
+ height: -moz-available;
1703
+ height: stretch;
1704
+ width: -webkit-fill-available;
1705
+ width: -moz-available;
1706
+ width: stretch;
1707
+
1708
+ min-width: 0;
1709
+ border: 0;
1710
+ margin: 0;
1711
+ padding: 15px 14px;
1712
+ background-color: transparent;
1713
+ cursor: text;
1714
+ display: block;
1715
+ box-sizing: border-box;
1716
+
1717
+ &.--INPUT-right {
1718
+ padding-right: 0px;
1719
+ }
1720
+
1721
+ &.--INPUT-left {
1722
+ padding-left: 0px;
1723
+ }
1724
+
1725
+ // ENABLED
1726
+ ${B(e, "ENABLED")};
1727
+ ~ .--INPUT-label {
1728
+ ${V(e, "ENABLED")};
1729
+ }
1730
+ ~ .--INPUT-fieldset {
1731
+ ${z(e, "ENABLED")};
1732
+ }
1733
+
1734
+ // VALUE
1735
+ &:not(:placeholder-shown),
1736
+ &[placeholder]:not([placeholder=' ']) {
1737
+ ${B(e, "VALUE")};
1738
+ ~ .--INPUT-label {
1739
+ ${V(e, "VALUE", !0)};
1740
+ }
1741
+ ~ .--INPUT-fieldset {
1742
+ ${z(e, "VALUE")};
1743
+ ${Ae(!0)};
1744
+ }
1745
+ }
1746
+
1747
+ // Autocomplete
1748
+ &:-webkit-autofill {
1749
+ -webkit-background-clip: text;
1750
+ ${i(e, "-webkit-text-fill-color", "--INPUT-EVENTS-ENABLED-COLOR-PRIMARY")};
1751
+ }
1752
+
1753
+ // HOVER
1754
+ &:hover {
1755
+ ${B(e, "HOVER")};
1756
+ ~ .--INPUT-label {
1757
+ ${V(e, "HOVER")};
1758
+ }
1759
+ ~ .--INPUT-fieldset {
1760
+ ${z(e, "HOVER")};
1761
+ }
1762
+ }
1763
+
1764
+ // ACTIVE
1765
+ &:active,
1766
+ &.--INPUT-active {
1767
+ ${B(e, "ACTIVE")};
1768
+ ~ .--INPUT-label {
1769
+ ${V(e, "ACTIVE")};
1770
+ }
1771
+ ~ .--INPUT-fieldset {
1772
+ ${z(e, "ACTIVE")};
1773
+ }
1774
+ }
1775
+
1776
+ // FOCUS
1777
+ &:focus-visible {
1778
+ outline: none;
1779
+ ${B(e, "FOCUS")};
1780
+ ~ .--INPUT-label {
1781
+ ${V(e, "FOCUS", !0)};
1782
+ }
1783
+ ~ .--INPUT-fieldset {
1784
+ ${z(e, "FOCUS")};
1785
+ ${Ae(!0)};
1786
+ }
1787
+ }
1788
+
1789
+ // ERROR
1790
+ &.--INPUT-error {
1791
+ ${B(e, "ERROR")};
1792
+ ~ .--INPUT-label {
1793
+ ${V(e, "ERROR")};
1794
+ }
1795
+ ~ .--INPUT-fieldset {
1796
+ ${z(e, "ERROR")};
1797
+ }
1798
+ }
1799
+
1800
+ // ERROR + VALUE
1801
+ &.--INPUT-error:not(:placeholder-shown),
1802
+ &.--INPUT-error[placeholder]:not([placeholder=' ']) {
1803
+ ${B(e, "ERROR_VALUE")};
1804
+ ~ .--INPUT-label {
1805
+ ${V(e, "ERROR_VALUE")};
1806
+ }
1807
+ ~ .--INPUT-fieldset {
1808
+ ${z(e, "ERROR_VALUE")};
1809
+ }
1810
+ }
1811
+
1812
+ // ERROR + HOVER
1813
+ &.--INPUT-error:hover {
1814
+ ${B(e, "ERROR_HOVER")};
1815
+ ~ .--INPUT-label {
1816
+ ${V(e, "ERROR_HOVER")};
1817
+ }
1818
+ ~ .--INPUT-fieldset {
1819
+ ${z(e, "ERROR_HOVER")};
1820
+ }
1821
+ }
1822
+
1823
+ // ERROR + ACTIVE
1824
+ &.--INPUT-error:active,
1825
+ &.--INPUT-error.--INPUT-active {
1826
+ ${B(e, "ERROR_ACTIVE")};
1827
+ ~ .--INPUT-label {
1828
+ ${V(e, "ERROR_ACTIVE")};
1829
+ }
1830
+ ~ .--INPUT-fieldset {
1831
+ ${z(e, "ERROR_ACTIVE")};
1832
+ }
1833
+ }
1834
+
1835
+ // ERROR + FOCUS
1836
+ &.--INPUT-error:focus-visible {
1837
+ ${B(e, "ERROR_FOCUS")};
1838
+ ~ .--INPUT-label {
1839
+ ${V(e, "ERROR_FOCUS")};
1840
+ }
1841
+ ~ .--INPUT-fieldset {
1842
+ ${z(e, "ERROR_FOCUS")};
1843
+ }
1844
+ }
1845
+
1846
+ // DISABLED
1847
+ &:disabled {
1848
+ user-select: none;
1849
+ pointer-events: none;
1850
+ ${B(e, "DISABLED")};
1851
+ ~ .--INPUT-label {
1852
+ ${V(e, "DISABLED")};
1853
+ }
1854
+ ~ .--INPUT-fieldset {
1855
+ ${z(e, "DISABLED")};
1856
+ }
1857
+ }
1858
+
1859
+ // DISABLED + VALUE
1860
+ &:disabled:not(:placeholder-shown),
1861
+ &:disabled[placeholder]:not([placeholder=' ']) {
1862
+ user-select: none;
1863
+ pointer-events: none;
1864
+ ${B(e, "DISABLED_VALUE")};
1865
+ ~ .--INPUT-label {
1866
+ ${V(e, "DISABLED_VALUE")};
1867
+ }
1868
+ ~ .--INPUT-fieldset {
1869
+ ${z(e, "DISABLED_VALUE")};
1870
+ }
1871
+ }
1872
+ }
1873
+
1874
+ .--INPUT-label {
1875
+ // FONT
1876
+ font-family: ${e["--FONTFAMILY-PRIMARY"]};
1877
+ font-size: 0.875rem; // 14px
1878
+ font-weight: 500;
1879
+ letter-spacing: 0.01em;
1880
+ line-height: normal;
1881
+
1882
+ padding: 0;
1883
+ display: block;
1884
+ white-space: nowrap;
1885
+ overflow: hidden;
1886
+ text-overflow: ellipsis;
1887
+ position: absolute;
1888
+ pointer-events: none;
1889
+ z-index: 4;
1890
+
1891
+ // ANIMATION
1892
+ transform: translate(14px, 0px);
1893
+ transition: 150ms ease-in-out;
1894
+ }
1895
+
1896
+ .--INPUT-fieldset {
1897
+ // Safari Firefox Chrome/Edge
1898
+ height: 100%;
1899
+ width: -webkit-fill-available;
1900
+ width: -moz-available;
1901
+ width: stretch;
1902
+
1903
+ text-align: left;
1904
+ position: absolute;
1905
+ margin: 0;
1906
+ padding: 0 6px;
1907
+ pointer-events: none;
1908
+ overflow: hidden;
1909
+ z-index: 5;
1910
+ box-sizing: border-box;
1911
+ ${i(e, "border-radius", "--INPUT-ROOT-BORDER-RADIUS")};
1912
+ -webkit-tap-highlight-color: transparent;
1913
+
1914
+ .--INPUT-legend {
1915
+ width: auto;
1916
+ overflow: hidden;
1917
+ display: block;
1918
+ padding: 0;
1919
+ height: 0px;
1920
+ visibility: hidden;
1921
+
1922
+ // Animation
1923
+ max-width: 0px;
1924
+ transition: max-width 150ms ease-in-out;
1925
+
1926
+ .--INPUT-text {
1927
+ // FONT
1928
+ font-family: ${e["--FONTFAMILY-PRIMARY"]};
1929
+ font-size: 0.75rem; // 12px
1930
+ letter-spacing: 0.01em;
1931
+ font-weight: 500;
1932
+ padding: 0px 7px;
1933
+ }
1934
+ }
1935
+ }
1936
+
1937
+ .--INPUT-adornment {
1938
+ display: flex;
1939
+ align-items: center;
1940
+ justify-content: center;
1941
+ height: 100%;
1942
+ width: 48px;
1943
+ min-width: 48px;
1944
+ }
1945
+ }
1946
+
1947
+ .--INPUT-helperText {
1948
+ // FONT
1949
+ font-family: ${e["--FONTFAMILY-PRIMARY"]};
1950
+ font-size: 0.75rem; // 12px
1951
+ line-height: 1;
1952
+
1953
+ display: block;
1954
+ margin-top: 8px;
1955
+ margin-left: 14px;
1956
+ height: 16px;
1957
+ }
1958
+ }
1959
+ `, U = "--INPUT", Me = ({ children: e }) => /* @__PURE__ */ t("div", {
1960
+ className: `${U}-adornment`,
1961
+ children: e
1962
+ }), Ne = ({ name: e, label: r, control: i, width: a, disabled: o, type: s = "text", regex: c, hasPadding: l = !1, format: u, startAdornment: d, endAdornment: ee, helperText: f, showErrorText: p = !0, style: te, className: ne, ...m }) => {
1963
+ let { field: h, fieldState: g } = ue({
1964
+ control: i,
1965
+ name: e
1966
+ }), [re, _] = w(h.value || ""), v = g.error, y = (e) => {
1967
+ e.preventDefault();
1968
+ let { value: t } = e.target;
1969
+ if (c && c.test(t) || !c) {
1970
+ let e = u && t ? u(t) : t;
1971
+ h.onChange(e), _(e), v && ie();
1972
+ }
1973
+ }, ie = () => h.onBlur();
1974
+ return /* @__PURE__ */ n("div", {
1975
+ className: [
1976
+ U,
1977
+ l ? `${U}-paddingBottom` : "",
1978
+ ne || ""
1979
+ ].join(" "),
1980
+ css: je(te),
1981
+ "data-testid": U,
1982
+ children: [/* @__PURE__ */ n("div", {
1983
+ className: `${U}-container`,
1984
+ children: [
1985
+ d && /* @__PURE__ */ t(Me, { children: d }),
1986
+ /* @__PURE__ */ t("input", {
1987
+ className: [
1988
+ `${U}-inputField`,
1989
+ v && `${U}-error`,
1990
+ d && `${U}-open`,
1991
+ d && `${U}-left`,
1992
+ ee && `${U}-right`
1993
+ ].join(" "),
1994
+ placeholder: " ",
1995
+ value: re,
1996
+ disabled: o,
1997
+ "data-testid": `${U}-inputField`,
1998
+ onChange: (e) => y(e),
1999
+ onBlur: h.onBlur,
2000
+ name: e,
2001
+ type: s,
2002
+ ...m
2003
+ }),
2004
+ ee && /* @__PURE__ */ t(Me, { children: ee }),
2005
+ /* @__PURE__ */ t("fieldset", {
2006
+ "aria-hidden": "true",
2007
+ className: `${U}-fieldset`,
2008
+ children: /* @__PURE__ */ t("legend", {
2009
+ className: `${U}-legend`,
2010
+ children: /* @__PURE__ */ t("span", {
2011
+ className: `${U}-text`,
2012
+ children: r
2013
+ })
2014
+ })
2015
+ }),
2016
+ /* @__PURE__ */ t("span", {
2017
+ className: `${U}-label`,
2018
+ children: r
2019
+ })
2020
+ ]
2021
+ }), /* @__PURE__ */ n("span", {
2022
+ className: `${U}-helperText`,
2023
+ "data-testid": `${U}-helperText`,
2024
+ children: [f && (!v || !p) && f, p && v && v.message]
2025
+ })]
2026
+ });
2027
+ }, Pe = ({ theme: n, ...r }) => {
2028
+ let { componentStyles: i } = e([a.INPUT], n);
2029
+ return /* @__PURE__ */ t(Ne, {
2030
+ ...r,
2031
+ style: i
2032
+ });
2033
+ }, Fe = (e, t) => `
2034
+ // BACKGROUNDS
2035
+ ${i(e, "background-color", `--RADIO-EVENTS-${t}-BACKGROUND-COLOR`)}
2036
+ `, Ie = (e, t) => `
2037
+ // BORDERS
2038
+ ${i(e, "border-color", `--RADIO-EVENTS-${t}-BORDER-COLOR`)}
2039
+ ${i(e, "border-width", `--RADIO-EVENTS-${t}-BORDER-WIDTH`)}
2040
+ ${i(e, "border-style", `--RADIO-EVENTS-${t}-BORDER-STYLE`)}
2041
+ `, Le = (e, t) => `
2042
+ // OUTLINE
2043
+ ${i(e, "outline-color", `--RADIO-EVENTS-${t}-OUTLINE-COLOR`)}
2044
+ ${i(e, "outline-width", `--RADIO-EVENTS-${t}-OUTLINE-WIDTH`)}
2045
+ ${i(e, "outline-style", `--RADIO-EVENTS-${t}-OUTLINE-STYLE`)}
2046
+ ${i(e, "outline-offset", `--RADIO-EVENTS-${t}-OUTLINE-OFFSET`)}
2047
+ `, Re = (e, t) => `
2048
+ // SHADOW
2049
+ ${i(e, "background-color", `--RADIO-EVENTS-${t}-SHADOW-COLOR`)}
2050
+ `, ze = (e, t) => `
2051
+ // UTILS
2052
+ > svg > circle {
2053
+ ${i(e, "fill", `--RADIO-EVENTS-${t}-ICON-COLOR`)};
2054
+ }
2055
+ `, W = (e, t) => `
2056
+ // TYPOGRAPHY
2057
+ .--RADIO-label {
2058
+ ${i(e, "color", `--RADIO-EVENTS-${t}-COLOR-PRIMARY`)}
2059
+ }
2060
+ `, Be = (e) => T`
2061
+ &.--RADIO {
2062
+ display: flex;
2063
+ flex-direction: column;
2064
+ width: fit-content;
2065
+
2066
+ .--RADIO-container {
2067
+ display: flex;
2068
+ flex-direction: row;
2069
+ gap: 12px;
2070
+ align-items: center;
2071
+ cursor: pointer;
2072
+
2073
+ // ENABLED
2074
+ ${W(e, "ENABLED")};
2075
+
2076
+ // VALUE
2077
+ &:has(.--RADIO-inputField:checked) {
2078
+ ${W(e, "VALUE")};
2079
+ }
2080
+
2081
+ // HOVER
2082
+ &:hover {
2083
+ ${W(e, "HOVER")};
2084
+
2085
+ .--RADIO-radio .--RADIO-span {
2086
+ &:before {
2087
+ opacity: 1;
2088
+ ${Re(e, "HOVER")};
2089
+ }
2090
+ }
2091
+ }
2092
+
2093
+ // ACTIVE
2094
+ &:has(.--RADIO-inputField.--RADIO-active, .--RADIO-inputField:active) {
2095
+ ${W(e, "ACTIVE")};
2096
+ }
2097
+
2098
+ // FOCUS-VISIBLE
2099
+ &:has(.--RADIO-inputField:focus-visible) {
2100
+ ${W(e, "FOCUS")};
2101
+ }
2102
+
2103
+ // ERROR
2104
+ &:has(.--RADIO-inputField.--RADIO-error) {
2105
+ ${W(e, "ERROR")};
2106
+ }
2107
+
2108
+ // ERROR + VALUE
2109
+ &:has(.--RADIO-inputField.--RADIO-error:checked) {
2110
+ ${W(e, "ERROR_VALUE")};
2111
+ }
2112
+
2113
+ // ERROR + HOVER
2114
+ &:hover:has(.--RADIO-inputField.--RADIO-error) {
2115
+ ${W(e, "ERROR_HOVER")};
2116
+
2117
+ .--RADIO-radio .--RADIO-span {
2118
+ &:before {
2119
+ opacity: 1;
2120
+ ${Re(e, "ERROR_HOVER")};
2121
+ }
2122
+ }
2123
+ }
2124
+
2125
+ // ERROR + ACTIVE
2126
+ &:has(.--RADIO-inputField.--RADIO-error:active),
2127
+ &:has(.--RADIO-inputField.--RADIO-error.--RADIO-active) {
2128
+ ${W(e, "ERROR_ACTIVE")};
2129
+ }
2130
+
2131
+ // ERROR + FOCUS
2132
+ &:has(.--RADIO-inputField.--RADIO-error:focus-visible) {
2133
+ ${W(e, "ERROR_FOCUS")};
2134
+ }
2135
+
2136
+ // DISABLED
2137
+ &:has(.--RADIO-inputField:disabled) {
2138
+ pointer-events: none;
2139
+ ${W(e, "DISABLED")};
2140
+ }
2141
+
2142
+ // DISABLED + VALUE
2143
+ &:has(.--RADIO-inputField:disabled:checked) {
2144
+ ${W(e, "DISABLED_VALUE")};
2145
+ }
2146
+
2147
+ .--RADIO-radio {
2148
+ position: relative;
2149
+ display: inline-flex;
2150
+ width: 24px;
2151
+ height: 24px;
2152
+ isolation: isolate;
2153
+
2154
+ .--RADIO-inputField {
2155
+ cursor: pointer;
2156
+ position: absolute;
2157
+ opacity: 0;
2158
+ width: 100%;
2159
+ height: 100%;
2160
+ z-index: 2;
2161
+ margin: 0;
2162
+ -webkit-tap-highlight-color: transparent;
2163
+
2164
+ ~ .--RADIO-span > svg {
2165
+ visibility: hidden;
2166
+ }
2167
+ &:checked ~ .--RADIO-span > svg {
2168
+ visibility: visible;
2169
+ }
2170
+
2171
+ // ENABLED
2172
+ ~ .--RADIO-span {
2173
+ ${Fe(e, "ENABLED")};
2174
+ ${Ie(e, "ENABLED")};
2175
+ ${ze(e, "ENABLED")};
2176
+ }
2177
+
2178
+ // VALUE
2179
+ &:checked ~ .--RADIO-span {
2180
+ ${Fe(e, "VALUE")};
2181
+ ${Ie(e, "VALUE")};
2182
+ ${ze(e, "VALUE")};
2183
+ }
2184
+
2185
+ // HOVER
2186
+ // Is at the container level
2187
+
2188
+ // ACTIVE
2189
+ &.--RADIO-active ~ .--RADIO-span,
2190
+ &:active ~ .--RADIO-span {
2191
+ &:before {
2192
+ opacity: 1;
2193
+ ${Re(e, "ACTIVE")};
2194
+ }
2195
+ }
2196
+
2197
+ // FOCUS
2198
+ &:focus-visible ~ .--RADIO-span {
2199
+ outline: none;
2200
+ ${Le(e, "FOCUS")};
2201
+ ${ze(e, "FOCUS")};
2202
+ }
2203
+
2204
+ // ERROR
2205
+ &.--RADIO-error ~ .--RADIO-span {
2206
+ ${Fe(e, "ERROR")};
2207
+ ${Ie(e, "ERROR")};
2208
+ ${ze(e, "ERROR")};
2209
+ }
2210
+
2211
+ // ERROR + VALUE
2212
+ &.--RADIO-error:checked ~ .--RADIO-span {
2213
+ ${Fe(e, "ERROR_VALUE")};
2214
+ ${Ie(e, "ERROR_VALUE")};
2215
+ ${ze(e, "ERROR_VALUE")};
2216
+ }
2217
+
2218
+ // ERROR + VALUE
2219
+ // Is at the container level
2220
+
2221
+ // ERROR + ACTIVE
2222
+ &.--RADIO-error:active ~ .--RADIO-span,
2223
+ &.--RADIO-error.--RADIO-active ~ .--RADIO-span {
2224
+ &:before {
2225
+ opacity: 1;
2226
+ ${Re(e, "ERROR_ACTIVE")};
2227
+ }
2228
+ }
2229
+
2230
+ // ERROR + FOCUS
2231
+ &.--RADIO-error:focus-visible ~ .--RADIO-span {
2232
+ ${Le(e, "ERROR_FOCUS")};
2233
+ ${ze(e, "ERROR_FOCUS")};
2234
+ }
2235
+
2236
+ // DISABLED
2237
+ &:disabled ~ .--RADIO-span {
2238
+ ${Fe(e, "DISABLED")};
2239
+ ${Ie(e, "DISABLED")};
2240
+ ${ze(e, "DISABLED")};
2241
+ }
2242
+
2243
+ // DISABLED + VALUE
2244
+ &:disabled:checked ~ .--RADIO-span {
2245
+ ${Fe(e, "DISABLED_VALUE")};
2246
+ ${Ie(e, "DISABLED_VALUE")};
2247
+ ${ze(e, "DISABLED_VALUE")};
2248
+ }
2249
+ }
2250
+
2251
+ .--RADIO-span {
2252
+ width: 24px;
2253
+ height: 24px;
2254
+ border-radius: 50%;
2255
+ position: absolute;
2256
+ box-sizing: border-box;
2257
+ display: flex;
2258
+ align-items: center;
2259
+ justify-content: center;
2260
+ transition: background-color 150ms ease-in-out;
2261
+
2262
+ > svg {
2263
+ width: 20px;
2264
+ height: 20px;
2265
+ z-index: 1;
2266
+ }
2267
+
2268
+ &:before {
2269
+ content: '';
2270
+ position: absolute;
2271
+ width: 36px;
2272
+ height: 36px;
2273
+ border-radius: 50%;
2274
+ opacity: 0;
2275
+ transition: opacity 150ms ease-in-out;
2276
+ z-index: -1;
2277
+ }
2278
+ }
2279
+ }
2280
+
2281
+ .--RADIO-label {
2282
+ // FONT
2283
+ font-family: ${e["--FONTFAMILY-PRIMARY"]};
2284
+ font-size: 0.875rem;
2285
+ font-weight: 500;
2286
+ line-height: 1;
2287
+ }
2288
+ }
2289
+ }
2290
+ `, G = "--RADIO", Ve = x.forwardRef(({ label: e, icon: r = /* @__PURE__ */ t(E, {}), className: i, style: a = {}, disabled: o, checked: s, onSelect: c, error: l, onKeyDown: u, onKeyUp: d, onBlur: ee, value: f, name: p, ...te }, ne) => {
2291
+ let [m, h] = w(!1);
2292
+ return /* @__PURE__ */ t("div", {
2293
+ className: [
2294
+ G,
2295
+ m ? `${G}-active` : "",
2296
+ i || ""
2297
+ ].join(" "),
2298
+ css: Be(a),
2299
+ "data-testid": G,
2300
+ children: /* @__PURE__ */ n("label", {
2301
+ className: `${G}-container`,
2302
+ children: [/* @__PURE__ */ n("div", {
2303
+ className: `${G}-radio`,
2304
+ children: [/* @__PURE__ */ t("input", {
2305
+ className: [
2306
+ `${G}-inputField`,
2307
+ m ? `${G}-active` : "",
2308
+ l ? `${G}-error` : ""
2309
+ ].join(" "),
2310
+ type: "radio",
2311
+ value: f,
2312
+ name: p,
2313
+ checked: s,
2314
+ disabled: o,
2315
+ onChange: () => c(),
2316
+ onKeyDown: (e) => {
2317
+ (e.key === "Enter" || e.key === "Space") && h(!0), u?.(e);
2318
+ },
2319
+ onKeyUp: (e) => {
2320
+ (e.key === "Enter" || e.key === "Space") && (h(!1), c()), d?.(e);
2321
+ },
2322
+ onBlur: () => {
2323
+ h(!1), ee?.({});
2324
+ },
2325
+ ref: ne,
2326
+ "data-testid": `${G}-inputField`,
2327
+ ...te
2328
+ }), /* @__PURE__ */ t("span", {
2329
+ className: `${G}-span`,
2330
+ "data-testid": `${G}-icon`,
2331
+ children: r
2332
+ })]
2333
+ }), /* @__PURE__ */ t("span", {
2334
+ className: `${G}-label`,
2335
+ "data-testid": `${G}-label`,
2336
+ children: e
2337
+ })]
2338
+ })
2339
+ });
2340
+ });
2341
+ Ve.displayName = "RadioBase";
2342
+ var He = (e) => {
2343
+ let n = se(o);
2344
+ if (!n) throw Error("Radio must be used inside a RadioGroup.");
2345
+ let { value: r, ...i } = e, a = n.selectedValue === r;
2346
+ return /* @__PURE__ */ t(Ve, {
2347
+ ...i,
2348
+ name: n.name,
2349
+ value: r,
2350
+ checked: a,
2351
+ onSelect: () => n.onChange(r),
2352
+ disabled: i.disabled ?? n.disabled
2353
+ });
2354
+ }, Ue = ({ theme: n, ...r }) => {
2355
+ let { componentStyles: i } = e([a.RADIO], n);
2356
+ return /* @__PURE__ */ t(He, {
2357
+ ...r,
2358
+ style: i
2359
+ });
2360
+ }, K = (e, t) => `
2361
+ // BORDERS
2362
+ ${i(e, "border-color", `--SELECT-EVENTS-${t}-BORDER-COLOR`)}
2363
+ ${i(e, "border-width", `--SELECT-EVENTS-${t}-BORDER-WIDTH`)}
2364
+ ${i(e, "border-style", `--SELECT-EVENTS-${t}-BORDER-STYLE`)}
2365
+ `, q = (e, t) => `
2366
+ // TYPOGRAPHY
2367
+ ${i(e, "color", `--SELECT-EVENTS-${t}-COLOR-PRIMARY`)}
2368
+ ${i(e, "caret-color", `--SELECT-EVENTS-${t}-FONT-PRIMARY`)}
2369
+ `, J = (e, t, n = !1) => `
2370
+ ${i(e, "color", `--SELECT-EVENTS-${t}-COLOR-SECONDARY`)}
2371
+ ${n ? "transform: translate(14px, -24px); font-size: 0.75rem;" : ""}
2372
+ `, We = (e) => `
2373
+ .--SELECT-legend {
2374
+ max-width: ${e ? "100%" : "0px"};
2375
+ }
2376
+ `, Y = (e, t) => `
2377
+ ${i(e, "background-color", `--SELECT-EVENTS-${t}-BACKGROUND-COLOR`)}
2378
+ ~ .--SELECT-helperText {
2379
+ ${i(e, "color", `--SELECT-EVENTS-${t}-COLOR-TERTIARY`)}
2380
+ }
2381
+ `, Ge = (e) => T`
2382
+ &.--SELECT {
2383
+ position: relative;
2384
+ padding: 0;
2385
+ border: 0;
2386
+ width: 100%;
2387
+
2388
+ &.--SELECT-paddingBottom {
2389
+ padding-bottom: 24px;
2390
+ }
2391
+
2392
+ .--SELECT-container {
2393
+ box-sizing: border-box;
2394
+ position: relative;
2395
+ display: inline-flex;
2396
+ align-items: center;
2397
+
2398
+ // Safari Firefox Chrome/Edge
2399
+ width: -webkit-fill-available;
2400
+ width: -moz-available;
2401
+ width: stretch;
2402
+
2403
+ ${i(e, "border-radius", "--SELECT-ROOT-BORDER-RADIUS")};
2404
+
2405
+ // ENABLED
2406
+ ${Y(e, "ENABLED")};
2407
+
2408
+ // VALUE
2409
+ &:has(.--SELECT-selectField:not(:placeholder-shown)) {
2410
+ ${Y(e, "VALUE")};
2411
+ }
2412
+
2413
+ // HOVER
2414
+ &:has(.--SELECT-selectField:hover) {
2415
+ ${Y(e, "HOVER")};
2416
+ }
2417
+
2418
+ // ACTIVE
2419
+ &:has(.--SELECT-selectField:active, .--SELECT-selectField.--SELECT-active) {
2420
+ ${Y(e, "ACTIVE")};
2421
+ }
2422
+
2423
+ // FOCUS
2424
+ &:has(.--SELECT-selectField:focus-visible) {
2425
+ outline: none;
2426
+ ${Y(e, "FOCUS")};
2427
+ }
2428
+
2429
+ // ERROR
2430
+ &:has(.--SELECT-selectField.--SELECT-error) {
2431
+ ${Y(e, "ERROR")};
2432
+ }
2433
+
2434
+ // ERROR + VALUE
2435
+ &:has(.--SELECT-selectField.--SELECT-error:not(:placeholder-shown)) {
2436
+ ${Y(e, "ERROR_VALUE")};
2437
+ }
2438
+
2439
+ // ERROR + HOVER
2440
+ &:has(.--SELECT-selectField.--SELECT-error:hover) {
2441
+ ${Y(e, "ERROR_HOVER")};
2442
+ }
2443
+
2444
+ // ERROR + ACTIVE
2445
+ &:has(.--SELECT-selectField.--SELECT-error:active, .--SELECT-selectField.--SELECT-error.--SELECT-active) {
2446
+ ${Y(e, "ERROR_ACTIVE")};
2447
+ }
2448
+
2449
+ // ERROR + FOCUS
2450
+ &:has(.--SELECT-selectField.--SELECT-error:focus-visible) {
2451
+ ${Y(e, "ERROR_FOCUS")};
2452
+ }
2453
+
2454
+ // DISABLED
2455
+ &:has(.--SELECT-selectField:disabled) {
2456
+ pointer-events: none;
2457
+ ${Y(e, "DISABLED")};
2458
+ }
2459
+
2460
+ // DISABLED + VALUE
2461
+ &:has(.--SELECT-selectField:disabled:not(:placeholder-shown)) {
2462
+ pointer-events: none;
2463
+ ${Y(e, "DISABLED-VALUE")};
2464
+ }
2465
+
2466
+ .--SELECT-selectField {
2467
+ // FONT
2468
+ font-family: ${e["--FONTFAMILY-PRIMARY"]};
2469
+ font-size: 0.875rem; // 14px
2470
+ font-weight: 500;
2471
+ letter-spacing: 0.01em;
2472
+ line-height: 1;
2473
+
2474
+ // Safari Firefox Chrome/Edge
2475
+ height: -webkit-fill-available;
2476
+ height: -moz-available;
2477
+ height: stretch;
2478
+ width: -webkit-fill-available;
2479
+ width: -moz-available;
2480
+ width: stretch;
2481
+
2482
+ min-width: 0;
2483
+ border: 0;
2484
+ margin: 0;
2485
+ padding: 15px 14px;
2486
+ background-color: transparent;
2487
+ cursor: text;
2488
+ display: block;
2489
+ box-sizing: border-box;
2490
+
2491
+ &:read-only {
2492
+ cursor: pointer;
2493
+ }
2494
+
2495
+ // ENABLED
2496
+ ${q(e, "ENABLED")};
2497
+ ~ .--SELECT-label {
2498
+ ${J(e, "ENABLED")}
2499
+ }
2500
+ ~ .--SELECT-fieldset {
2501
+ ${K(e, "ENABLED")}
2502
+ }
2503
+
2504
+ // VALUE
2505
+ &:not(:placeholder-shown),
2506
+ &[placeholder]:not([placeholder=' ']),
2507
+ &.--SELECT-open {
2508
+ ${q(e, "VALUE")};
2509
+ ~ .--SELECT-label {
2510
+ ${J(e, "VALUE", !0)}
2511
+ }
2512
+ ~ .--SELECT-fieldset {
2513
+ ${K(e, "VALUE")};
2514
+ ${We(!0)};
2515
+ }
2516
+ }
2517
+
2518
+ // HOVER
2519
+ &:hover {
2520
+ ${q(e, "HOVER")};
2521
+ ~ .--SELECT-label {
2522
+ ${J(e, "HOVER")}
2523
+ }
2524
+ ~ .--SELECT-fieldset {
2525
+ ${K(e, "HOVER")}
2526
+ }
2527
+ }
2528
+
2529
+ // ACTIVE
2530
+ &:active,
2531
+ &.--SELECT-active {
2532
+ ${q(e, "ACTIVE")};
2533
+ ~ .--SELECT-label {
2534
+ ${J(e, "ACTIVE")};
2535
+ }
2536
+ ~ .--SELECT-fieldset {
2537
+ ${K(e, "ACTIVE")};
2538
+ }
2539
+ }
2540
+
2541
+ // FOCUS
2542
+ &:focus-visible {
2543
+ outline: none;
2544
+ ${q(e, "FOCUS")};
2545
+ ~ .--SELECT-label {
2546
+ ${J(e, "FOCUS", !0)}
2547
+ }
2548
+ ~ .--SELECT-fieldset {
2549
+ ${K(e, "FOCUS")};
2550
+ ${We(!0)};
2551
+ }
2552
+ }
2553
+
2554
+ // ERROR
2555
+ &.--SELECT-error {
2556
+ ${q(e, "ERROR")};
2557
+ ~ .--SELECT-label {
2558
+ ${J(e, "ERROR")}
2559
+ }
2560
+ ~ .--SELECT-fieldset {
2561
+ ${K(e, "ERROR")}
2562
+ }
2563
+ }
2564
+
2565
+ // ERROR + VALUE
2566
+ &.--SELECT-error:not(:placeholder-shown),
2567
+ &.--SELECT-error.--SELECT-open {
2568
+ ${q(e, "ERROR_VALUE")};
2569
+ ~ .--SELECT-label {
2570
+ ${J(e, "ERROR_VALUE")};
2571
+ }
2572
+ ~ .--SELECT-fieldset {
2573
+ ${K(e, "ERROR_VALUE")};
2574
+ }
2575
+ }
2576
+
2577
+ // ERROR + HOVER
2578
+ &.--SELECT-error:hover {
2579
+ ${q(e, "ERROR_HOVER")};
2580
+ ~ .--SELECT-label {
2581
+ ${J(e, "ERROR_HOVER")}
2582
+ }
2583
+ ~ .--SELECT-fieldset {
2584
+ ${K(e, "ERROR_HOVER")}
2585
+ }
2586
+ }
2587
+
2588
+ // ERROR + ACTIVE
2589
+ &.--SELECT-error:active,
2590
+ &.--SELECT-error.--SELECT-active {
2591
+ ${q(e, "ERROR_ACTIVE")};
2592
+ ~ .--SELECT-label {
2593
+ ${J(e, "ERROR_ACTIVE")}
2594
+ }
2595
+ ~ .--SELECT-fieldset {
2596
+ ${K(e, "ERROR_ACTIVE")}
2597
+ }
2598
+ }
2599
+
2600
+ // ERROR + FOCUS
2601
+ &.--SELECT-error:focus-visible {
2602
+ ${q(e, "ERROR_FOCUS")};
2603
+ ~ .--SELECT-label {
2604
+ ${J(e, "ERROR_FOCUS")}
2605
+ }
2606
+ ~ .--SELECT-fieldset {
2607
+ ${K(e, "ERROR_FOCUS")}
2608
+ }
2609
+ }
2610
+
2611
+ // DISABLED
2612
+ &:disabled {
2613
+ user-select: none;
2614
+ pointer-events: none;
2615
+ ${q(e, "DISABLED")};
2616
+ ~ .--SELECT-label {
2617
+ ${J(e, "DISABLED")}
2618
+ }
2619
+ ~ .--SELECT-fieldset {
2620
+ ${K(e, "DISABLED")}
2621
+ }
2622
+ }
2623
+
2624
+ // DISABLED + VALUE
2625
+ &:disabled:not(:placeholder-shown),
2626
+ &:disabled.--SELECT-open {
2627
+ user-select: none;
2628
+ pointer-events: none;
2629
+ ${q(e, "DISABLED_VALUE")};
2630
+ ~ .--SELECT-label {
2631
+ ${J(e, "DISABLED_VALUE")}
2632
+ }
2633
+ ~ .--SELECT-fieldset {
2634
+ ${K(e, "DISABLED_VALUE")}
2635
+ }
2636
+ }
2637
+ }
2638
+
2639
+ .--SELECT-label {
2640
+ // FONT
2641
+ font-family: ${e["--FONTFAMILY-PRIMARY"]};
2642
+ font-size: 0.875rem; // 14px
2643
+ font-weight: 500;
2644
+ letter-spacing: 0.01em;
2645
+ line-height: normal;
2646
+
2647
+ padding: 0;
2648
+ display: block;
2649
+ white-space: nowrap;
2650
+ overflow: hidden;
2651
+ text-overflow: ellipsis;
2652
+ position: absolute;
2653
+ pointer-events: none;
2654
+ z-index: 4;
2655
+
2656
+ // ANIMATION
2657
+ transform: translate(14px, 0px);
2658
+ transition: 150ms ease-in-out;
2659
+ }
2660
+
2661
+ .--SELECT-fieldset {
2662
+ // Safari Firefox Chrome/Edge
2663
+ height: 100%;
2664
+ width: -webkit-fill-available;
2665
+ width: -moz-available;
2666
+ width: stretch;
2667
+
2668
+ text-align: left;
2669
+ position: absolute;
2670
+ margin: 0;
2671
+ padding: 0 6px;
2672
+ pointer-events: none;
2673
+ overflow: hidden;
2674
+ z-index: 5;
2675
+ box-sizing: border-box;
2676
+ ${i(e, "border-radius", "--SELECT-ROOT-BORDER-RADIUS")};
2677
+ -webkit-tap-highlight-color: transparent;
2678
+
2679
+ .--SELECT-legend {
2680
+ width: auto;
2681
+ overflow: hidden;
2682
+ display: block;
2683
+ padding: 0;
2684
+ height: 0px;
2685
+ visibility: hidden;
2686
+
2687
+ // Animation
2688
+ max-width: 0px;
2689
+ transition: max-width 150ms ease-in-out;
2690
+
2691
+ .--SELECT-text {
2692
+ // FONT
2693
+ font-family: ${e["--FONTFAMILY-PRIMARY"]};
2694
+ font-size: 0.75rem; // 12px
2695
+ letter-spacing: 0.01em;
2696
+ font-weight: 500;
2697
+ padding: 0px 7px;
2698
+ }
2699
+ }
2700
+ }
2701
+
2702
+ .--SELECT-adornment {
2703
+ display: flex;
2704
+ align-items: center;
2705
+ justify-content: center;
2706
+ height: 100%;
2707
+ width: 48px;
2708
+ min-width: 48px;
2709
+ }
2710
+ }
2711
+
2712
+ .--SELECT-helperText {
2713
+ // FONT
2714
+ font-family: ${e["--FONTFAMILY-PRIMARY"]};
2715
+ font-size: 0.75rem; // 12px
2716
+ line-height: 1;
2717
+
2718
+ display: block;
2719
+ margin-top: 8px;
2720
+ margin-left: 14px;
2721
+ height: 16px;
2722
+ }
2723
+ }
2724
+ `, Ke = (e, t) => `
2725
+ // BACKGROUNDS
2726
+ ${i(e, "background-color", `--SELECTMENU-EVENTS-${t}-BACKGROUND-COLOR`)}
2727
+
2728
+ // BORDERS
2729
+ ${i(e, "border-color", `--SELECTMENU-EVENTS-${t}-BORDER-COLOR`)}
2730
+ ${i(e, "border-width", `--SELECTMENU-EVENTS-${t}-BORDER-WIDTH`)}
2731
+ ${i(e, "border-style", `--SELECTMENU-EVENTS-${t}-BORDER-STYLE`)}
2732
+ ${i(e, "border-radius", `--SELECTMENU-EVENTS-${t}-BORDER-RADIUS`)}
2733
+ `, qe = (e, t) => `
2734
+ // TYPOGRAPHY
2735
+ ${i(e, "color", `--SELECTMENU-EVENTS-${t}-COLOR-PRIMARY`)};
2736
+ ${i(e, "caret-color", `--SELECTMENU-EVENTS-${t}-COLOR-PRIMARY`)};
2737
+ `, Je = (e, t) => `
2738
+ // BACKGROUNDS
2739
+ ${i(e, "background-color", `--SELECTMENU-${t}-BACKGROUND-COLOR`)}
2740
+
2741
+ // BORDERS
2742
+ ${i(e, "border-color", `--SELECTMENU-${t}-BORDER-COLOR`)}
2743
+ ${i(e, "border-width", `--SELECTMENU-${t}-BORDER-WIDTH`)}
2744
+ ${i(e, "border-style", `--SELECTMENU-${t}-BORDER-STYLE`)}
2745
+ ${i(e, "border-radius", `--SELECTMENU-${t}-BORDER-RADIUS`)}
2746
+ `, Ye = (e) => T`
2747
+ &.--SELECTMENU {
2748
+ z-index: 100;
2749
+ position: absolute;
2750
+ top: calc(48px + ${e["--SELECTMENU-ROOT-TOP"] || ""});
2751
+ left: 0px;
2752
+ width: 100%;
2753
+ box-shadow:
2754
+ rgba(0, 0, 0, 0.2) 0px 5px 5px -3px,
2755
+ rgba(0, 0, 0, 0.14) 0px 8px 10px 1px,
2756
+ rgba(0, 0, 0, 0.12) 0px 3px 14px 2px;
2757
+ box-sizing: border-box;
2758
+ max-height: 126px; // 3 rows * 42px
2759
+ overflow-y: auto;
2760
+ cursor: pointer;
2761
+ ${Je(e, "ROOT")}
2762
+
2763
+ // Animation
2764
+ display: none;
2765
+ opacity: 0;
2766
+ translate: 0px -10px;
2767
+ transition-property: display opacity;
2768
+ transition-duration: 150ms;
2769
+ transition-behavior: allow-discrete;
2770
+
2771
+ &.--SELECTMENU-open {
2772
+ display: block;
2773
+ opacity: 1;
2774
+ translate: 0px 0px;
2775
+
2776
+ @starting-style {
2777
+ opacity: 0;
2778
+ translate: 0px -10px;
2779
+ }
2780
+ }
2781
+
2782
+ // ROW STYLES
2783
+ .--SELECTMENU-row:last-child,
2784
+ .--SELECTMENU-row:has(+ .--SELECTMENU-row:hover),
2785
+ .--SELECTMENU-row:has(+ .--SELECTMENU-selected) {
2786
+ // border-bottom: none;
2787
+ }
2788
+
2789
+ .--SELECTMENU-row {
2790
+ padding: 0px 24px;
2791
+ display: flex;
2792
+ flex-direction: column;
2793
+ gap: 2px;
2794
+ justify-content: center;
2795
+ border-top: none;
2796
+ border-left: none;
2797
+ border-right: none;
2798
+ height: 42px;
2799
+ box-sizing: border-box;
2800
+
2801
+ .--SELECTMENU-rowTitle {
2802
+ font-family: ${e["--FONTFAMILY-PRIMARY"]};
2803
+ ${i(e, "color", "--SELECTMENU-ENABLED-FONT-PRIMARY")}
2804
+ font-size: 0.875rem; // 14px
2805
+ line-height: 1.5;
2806
+ text-overflow: ellipsis;
2807
+ overflow: hidden;
2808
+ white-space: nowrap;
2809
+ }
2810
+
2811
+ .--SELECTMENU-rowDescription {
2812
+ font-family: ${e["--FONTFAMILY-PRIMARY"]};
2813
+ ${i(e, "color", "--SELECTMENU-ENABLED-FONT-SECONDARY")}
2814
+ font-size: 0.75rem; // 12px
2815
+ line-height: 1;
2816
+ text-overflow: ellipsis;
2817
+ overflow: hidden;
2818
+ white-space: nowrap;
2819
+ }
2820
+
2821
+ // ENABLED
2822
+ ${Ke(e, "ENABLED")}
2823
+ ${qe(e, "ENABLED")}
2824
+
2825
+ // VALUE
2826
+ &.--SELECTMENU-selected {
2827
+ ${Ke(e, "VALUE")}
2828
+ ${qe(e, "VALUE")}
2829
+ }
2830
+
2831
+ // HOVER
2832
+ &:hover {
2833
+ ${Ke(e, "HOVER")}
2834
+ ${qe(e, "HOVER")}
2835
+ }
2836
+
2837
+ // - ACTIVE
2838
+ &:active,
2839
+ &.--SELECTMENU-active {
2840
+ ${Ke(e, "ACTIVE")}
2841
+ ${qe(e, "ACTIVE")}
2842
+ }
2843
+
2844
+ // FOCUS
2845
+ &:focus-visible {
2846
+ outline-offset: 0px;
2847
+ outline: 0;
2848
+ ${Ke(e, "FOCUS")}
2849
+ ${qe(e, "FOCUS")}
2850
+ }
2851
+
2852
+ &.--SELECTMENU-descriptionMenu {
2853
+ height: 52px;
2854
+ }
2855
+ }
2856
+
2857
+ &::-webkit-scrollbar {
2858
+ width: 12px;
2859
+ height: 4px;
2860
+ }
2861
+
2862
+ ::-webkit-scrollbar-thumb {
2863
+ background-color: rgba(0, 0, 0, 0.5);
2864
+ border-radius: 9999px;
2865
+ border: 3px solid transparent;
2866
+ background-clip: padding-box;
2867
+ }
2868
+
2869
+ &.--SELECTMENU-staticMenu {
2870
+ position: static;
2871
+ margin-top: 8px;
2872
+ }
2873
+
2874
+ &.--SELECTMENU-descriptionMenu {
2875
+ max-height: 156px; // 3 rows * 52px
2876
+ }
2877
+ }
2878
+ `, X = "--SELECTMENU", Xe = x.forwardRef(({ displayOptions: e, value: r, isOpen: i, hasStaticOptions: a, hasDescription: o, onChange: s, focusedElement: c, onScroll: l, style: u, className: d }, ee) => (ce(() => {
2879
+ document.getElementById(`${X}-option-${c}`)?.scrollIntoView({ block: "nearest" });
2880
+ }, [c]), /* @__PURE__ */ t("div", {
2881
+ id: `${X}-root`,
2882
+ className: [
2883
+ X,
2884
+ a ? `${X}-staticMenu` : "",
2885
+ o ? `${X}-descriptionMenu` : "",
2886
+ i && `${X}-open`,
2887
+ d || ""
2888
+ ].join(" "),
2889
+ css: Ye(u),
2890
+ onScroll: l,
2891
+ role: "listbox",
2892
+ ref: ee,
2893
+ "data-testid": X,
2894
+ children: e.map((e, a) => {
2895
+ let l = e.value === r && i ? `${X}-selected` : "", u = c === a;
2896
+ return /* @__PURE__ */ n("div", {
2897
+ id: `${X}-option-${a}`,
2898
+ className: [
2899
+ `${X}-row`,
2900
+ l,
2901
+ `${X}-row`,
2902
+ o ? `${X}-descriptionMenu` : "",
2903
+ u ? `${X}-active` : ""
2904
+ ].join(" "),
2905
+ onClick: () => s(e),
2906
+ role: "option",
2907
+ tabIndex: -1,
2908
+ "data-testid": `${X}-row-${e.label}`,
2909
+ children: [/* @__PURE__ */ t("span", {
2910
+ className: `${X}-rowTitle`,
2911
+ children: e.label
2912
+ }), o && /* @__PURE__ */ t("span", {
2913
+ className: `${X}-rowDescription`,
2914
+ children: e.description
2915
+ })]
2916
+ }, e.value);
2917
+ })
2918
+ }))), Ze = x.forwardRef(({ theme: n, ...r }, i) => {
2919
+ let { componentStyles: o } = e([a.SELECTMENU, a.SELECT], n);
2920
+ return /* @__PURE__ */ t(Xe, {
2921
+ ...r,
2922
+ style: o,
2923
+ ref: i
2924
+ });
2925
+ });
2926
+ Ze.displayName = "SelectMenu";
2927
+ //#endregion
2928
+ //#region src/components/atoms/Select/Select.tsx
2929
+ var Z = "--SELECT", Qe = [], $e = ({ name: e, label: r, control: i, options: a, disabled: o, range: s = 100, hasStaticOptions: c = !1, hasSearch: l = !1, hasDescription: u = !1, hasPadding: d = !1, showErrorText: ee = !0, helperText: f, style: p, className: te, ...ne }) => {
2930
+ let { field: m, fieldState: h } = ue({
2931
+ control: i,
2932
+ name: e
2933
+ }), [g, re] = ae(m.value || ""), [_, v] = ae(!1), [y, ie] = ae(!1), x = C(null), oe = C(null), se = C(null), le = C(null), S = a.find((e) => e.value === g), T = h.error, de = u ? 156 : 126, [pe, me] = ae(S?.label || ""), [E, D] = w(1), [O, k] = w(!1), [A, he] = w(-1), [j, M] = ae("none"), N = _ || !!(l && pe && !g);
2934
+ b({
2935
+ ref: x,
2936
+ onAction: () => {
2937
+ l && pe && !g && me(""), v(!1);
2938
+ },
2939
+ isActive: N,
2940
+ exceptRef: oe
2941
+ });
2942
+ let P = (e) => {
2943
+ m.onChange(e.value), re(e.value), v(!1), ge();
2944
+ }, ge = () => m.onBlur(), _e = (e) => {
2945
+ e.target.select();
2946
+ }, ve = (e) => {
2947
+ e === "ArrowDown" && N ? he(A + 1 >= Qe.length ? 0 : A + 1) : e === "ArrowUp" && N && he(A - 1 < 0 ? Qe.length - 1 : A - 1);
2948
+ }, ye = (e) => {
2949
+ if (e.stopPropagation(), e.key === "Enter") if (e.preventDefault(), N && A >= 0) {
2950
+ M("keyboard");
2951
+ let e = Se()[A];
2952
+ e && P(e);
2953
+ } else v(!N);
2954
+ else e.key === "Tab" || e.key === "Escape" ? v(!1) : ["ArrowDown", "ArrowUp"].includes(e.key) && N && (e.preventDefault(), ve(e.key));
2955
+ }, be = (e) => {
2956
+ if (e.stopPropagation(), e.key === "Enter") if (e.preventDefault(), N && A >= 0) {
2957
+ M("button");
2958
+ let e = Se()[A];
2959
+ e && P(e);
2960
+ } else v(!N);
2961
+ else e.key === "Tab" || e.key === "Escape" ? v(!1) : ["ArrowDown", "ArrowUp"].includes(e.key) && (e.preventDefault(), se.current?.focus(), ve(e.key));
2962
+ }, F = (e) => {
2963
+ e.stopPropagation(), o || v(!N);
2964
+ }, xe = (e) => {
2965
+ e.preventDefault();
2966
+ let { scrollHeight: t, scrollTop: n } = e.target;
2967
+ n + de >= t && Se().length >= E * s && D(E + 1);
2968
+ }, I = (e) => {
2969
+ e.preventDefault();
2970
+ let { value: t } = e.target;
2971
+ t.length > 2 && D(1), me(t, () => k(!0)), v(!0);
2972
+ }, Se = () => {
2973
+ if (l && pe && pe.length > 2) {
2974
+ let e = a.slice(0, s * E);
2975
+ if (pe === S?.label && !O) return Qe = e, e;
2976
+ let t = a.filter((e) => e.label.toLocaleUpperCase().includes(pe.toLocaleUpperCase())).slice(0, s * E);
2977
+ return Qe = O ? t || [] : e, t || [];
2978
+ }
2979
+ return Qe = a.slice(0, s * E), a.slice(0, s * E);
2980
+ };
2981
+ return ce(() => {
2982
+ _ || (me(S?.label || ""), k(!1), he(-1), M("none"), y && ge()), _ && (j === "button" ? le.current?.focus() : j === "keyboard" && se.current?.focus(), ie(!0));
2983
+ }, [_]), /* @__PURE__ */ n("div", {
2984
+ className: [
2985
+ Z,
2986
+ d ? `${Z}-paddingBottom` : "",
2987
+ te || ""
2988
+ ].join(" "),
2989
+ css: Ge(p),
2990
+ "data-testid": Z,
2991
+ children: [
2992
+ /* @__PURE__ */ n("div", {
2993
+ className: `${Z}-container`,
2994
+ onClick: F,
2995
+ onKeyDown: (e) => !o && ye(e),
2996
+ role: "button",
2997
+ ref: oe,
2998
+ "data-testid": `${Z}-container`,
2999
+ children: [
3000
+ /* @__PURE__ */ t("input", {
3001
+ name: e,
3002
+ className: [
3003
+ `${Z}-selectField`,
3004
+ N && `${Z}-open`,
3005
+ T && `${Z}-error`
3006
+ ].join(" "),
3007
+ onClick: (e) => l && _e(e),
3008
+ onChange: I,
3009
+ value: pe,
3010
+ placeholder: " ",
3011
+ disabled: o,
3012
+ readOnly: !l,
3013
+ ref: se,
3014
+ role: "combobox",
3015
+ autoComplete: "off",
3016
+ "data-testid": `${Z}-selectField`,
3017
+ ...l && { placeholder: "Search..." },
3018
+ ...ne
3019
+ }),
3020
+ /* @__PURE__ */ t("div", {
3021
+ className: `${Z}-adornment`,
3022
+ children: /* @__PURE__ */ t(Ce, {
3023
+ icon: /* @__PURE__ */ t(fe, {}),
3024
+ onClick: F,
3025
+ onKeyDown: (e) => !o && be(e),
3026
+ disabled: o,
3027
+ isFlipped: !N,
3028
+ tabIndex: -1
3029
+ })
3030
+ }),
3031
+ /* @__PURE__ */ t("fieldset", {
3032
+ "aria-hidden": "true",
3033
+ className: `${Z}-fieldset`,
3034
+ children: /* @__PURE__ */ t("legend", {
3035
+ className: `${Z}-legend`,
3036
+ children: /* @__PURE__ */ t("span", {
3037
+ className: `${Z}-text`,
3038
+ children: r
3039
+ })
3040
+ })
3041
+ }),
3042
+ /* @__PURE__ */ t("span", {
3043
+ className: `${Z}-label`,
3044
+ children: r
3045
+ })
3046
+ ]
3047
+ }),
3048
+ /* @__PURE__ */ n("span", {
3049
+ className: `${Z}-helperText`,
3050
+ "data-testid": `${Z}-helperText`,
3051
+ children: [f && (!T || !ee) && f, ee && T && T.message]
3052
+ }),
3053
+ /* @__PURE__ */ t(Ze, {
3054
+ displayOptions: N ? Se() : Qe,
3055
+ value: g,
3056
+ isOpen: N,
3057
+ hasStaticOptions: c,
3058
+ hasDescription: u,
3059
+ onChange: P,
3060
+ focusedElement: A,
3061
+ onScroll: xe,
3062
+ ref: x
3063
+ })
3064
+ ]
3065
+ });
3066
+ }, et = ({ theme: n, ...r }) => {
3067
+ let { componentStyles: i } = e([a.SELECT], n);
3068
+ return /* @__PURE__ */ t($e, {
3069
+ ...r,
3070
+ style: i
3071
+ });
3072
+ }, tt = (e, t) => `
3073
+ ~ .--SLIDER-rail {
3074
+ ${i(e, "background-color", `--SLIDER-EVENTS-${t}-BACKGROUND-COLOR`)}
3075
+ }
3076
+ `, nt = (e, t) => `
3077
+ ~ .--SLIDER-tracker {
3078
+ // BACKGROUNDS
3079
+ ${i(e, "background-color", `--SLIDER-EVENTS-${t}-BACKGROUND-COLOR`)}
3080
+ }
3081
+ `, rt = (e, t) => `
3082
+ ~ .--SLIDER-thumbIcon {
3083
+ // UTILS
3084
+ ${i(e, "background-color", `--SLIDER-EVENTS-${t}-ICON-BACKGROUND-COLOR`)}
3085
+
3086
+ // BORDERS
3087
+ ${i(e, "border-color", `--SLIDER-EVENTS-${t}-BORDER-COLOR`)}
3088
+ ${i(e, "border-width", `--SLIDER-EVENTS-${t}-BORDER-WIDTH`)}
3089
+ ${i(e, "border-style", `--SLIDER-EVENTS-${t}-BORDER-STYLE`)}
3090
+ ${i(e, "border-radius", `--SLIDER-EVENTS-${t}-BORDER-RADIUS`)}
3091
+
3092
+
3093
+ > svg {
3094
+ ${i(e, "fill", `--SLIDER-EVENTS-${t}-ICON-COLOR`)};
3095
+ }
3096
+ }
3097
+ `, it = (e) => T`
3098
+ &.--SLIDER {
3099
+ justify-content: center;
3100
+ display: flex;
3101
+ border-radius: 12px;
3102
+ box-sizing: content-box;
3103
+ position: relative;
3104
+ touch-action: none;
3105
+ -webkit-tap-highlight-color: transparent;
3106
+ height: 4px;
3107
+ width: 100%;
3108
+ padding: 8px 0px;
3109
+
3110
+ .--SLIDER-inputField {
3111
+ appearance: none;
3112
+ width: 100%;
3113
+ height: 0px;
3114
+ outline: none;
3115
+ position: absolute;
3116
+ pointer-events: none;
3117
+ cursor: default;
3118
+ z-index: 3;
3119
+ margin: 0px;
3120
+
3121
+ // ENABLED
3122
+ ${tt(e, "ENABLED")};
3123
+ ${rt(e, "ENABLED")};
3124
+
3125
+ // VALUE
3126
+ ${nt(e, "VALUE")};
3127
+
3128
+ // HOVER
3129
+ @media (hover: hover) {
3130
+ :hover + .--SLIDER-ripple {
3131
+ opacity: 1;
3132
+ ${i(e, "background-color", "--SLIDER-EVENTS-HOVER-BACKGROUND-COLOR")};
3133
+ }
3134
+ }
3135
+
3136
+ // ACTIVE
3137
+ :active + .--SLIDER-ripple {
3138
+ opacity: 1;
3139
+ ${i(e, "background-color", "--SLIDER-EVENTS-ACTIVE-BACKGROUND-COLOR")};
3140
+ }
3141
+
3142
+ // FOCUS
3143
+ &:focus-visible + .--SLIDER-ripple + .--SLIDER-thumbIcon {
3144
+ ${i(e, "outline-color", "--SLIDER-EVENTS-FOCUS-OUTLINE-COLOR")}
3145
+ ${i(e, "outline-width", "--SLIDER-EVENTS-FOCUS-OUTLINE-WIDTH")}
3146
+ ${i(e, "outline-style", "--SLIDER-EVENTS-FOCUS-OUTLINE-STYLE")}
3147
+ ${i(e, "outline-offset", "--SLIDER-EVENTS-FOCUS-OUTLINE-OFFSET")}
3148
+ }
3149
+
3150
+ // DISABLED
3151
+ &:disabled {
3152
+ &::-webkit-slider-thumb {
3153
+ pointer-events: none;
3154
+ }
3155
+
3156
+ ${tt(e, "DISABLED")};
3157
+ ${nt(e, "DISABLED_VALUE")};
3158
+ ${rt(e, "DISABLED")};
3159
+
3160
+ ~ .--SLIDER-mark {
3161
+ ${i(e, "background-color", "--SLIDER-EVENTS-DISABLED_VALUE-BACKGROUND-COLOR")}
3162
+ }
3163
+
3164
+ ~ .--SLIDER-mark.--SLIDER-mark--active {
3165
+ ${i(e, "background-color", "--SLIDER-EVENTS-DISABLED-BACKGROUND-COLOR")}
3166
+ }
3167
+ }
3168
+
3169
+ &::-webkit-slider-thumb {
3170
+ -webkit-appearance: none;
3171
+ appearance: none;
3172
+ cursor: pointer;
3173
+ border-radius: 50%;
3174
+ width: 24px;
3175
+ height: 24px;
3176
+ pointer-events: auto;
3177
+ }
3178
+ }
3179
+
3180
+ .--SLIDER-rail {
3181
+ display: block;
3182
+ position: absolute;
3183
+ border-radius: inherit;
3184
+ width: 100%;
3185
+ height: inherit;
3186
+ top: 50%;
3187
+ -webkit-transform: translateY(-50%);
3188
+ -moz-transform: translateY(-50%);
3189
+ -ms-transform: translateY(-50%);
3190
+ transform: translateY(-50%);
3191
+ cursor: pointer;
3192
+ }
3193
+
3194
+ .--SLIDER-tracker {
3195
+ border: none;
3196
+ display: block;
3197
+ position: absolute;
3198
+ border-radius: inherit;
3199
+ height: inherit;
3200
+ top: 50%;
3201
+ transform: translateY(-50%);
3202
+ z-index: 1;
3203
+ cursor: pointer;
3204
+ }
3205
+
3206
+ &.--SLIDER--clicking {
3207
+ .--SLIDER-thumbIcon,
3208
+ .--SLIDER-ripple {
3209
+ transition:
3210
+ left 150ms ease-in-out,
3211
+ top 150ms ease-in-out,
3212
+ background-color 150ms ease-in-out,
3213
+ opacity 150ms ease-in-out;
3214
+ }
3215
+
3216
+ .--SLIDER-tracker {
3217
+ transition:
3218
+ left 150ms ease-in-out,
3219
+ right 150ms ease-in-out,
3220
+ width 150ms ease-in-out,
3221
+ top 150ms ease-in-out,
3222
+ bottom 150ms ease-in-out,
3223
+ height 150ms ease-in-out;
3224
+ }
3225
+ }
3226
+
3227
+ &.--SLIDER--vertical {
3228
+ width: 4px;
3229
+ height: 100%;
3230
+ padding: 0px 8px;
3231
+ flex-direction: column;
3232
+
3233
+ .--SLIDER-inputField {
3234
+ width: 0px;
3235
+ height: 100%;
3236
+ writing-mode: vertical-lr;
3237
+ direction: rtl;
3238
+ }
3239
+
3240
+ .--SLIDER-rail {
3241
+ width: inherit;
3242
+ height: 100%;
3243
+ left: 50%;
3244
+ top: 0;
3245
+ transform: translateX(-50%);
3246
+ }
3247
+
3248
+ .--SLIDER-tracker {
3249
+ width: inherit;
3250
+ left: 50%;
3251
+ height: auto;
3252
+ top: auto;
3253
+ transform: translateX(-50%);
3254
+ }
3255
+
3256
+ .--SLIDER-ripple {
3257
+ top: auto;
3258
+ left: 50%;
3259
+ transform: translateX(-50%);
3260
+ margin-left: 0;
3261
+ margin-top: -6px;
3262
+ }
3263
+
3264
+ .--SLIDER-thumbIcon {
3265
+ top: auto;
3266
+ left: 50%;
3267
+ transform: translateX(-50%);
3268
+ }
3269
+
3270
+ .--SLIDER-mark {
3271
+ top: auto;
3272
+ left: 50%;
3273
+ transform: translateX(-50%);
3274
+ }
3275
+ }
3276
+
3277
+ .--SLIDER-mark {
3278
+ position: absolute;
3279
+ top: 50%;
3280
+ transform: translateY(-50%);
3281
+ width: 2px;
3282
+ height: 2px;
3283
+ border-radius: 50%;
3284
+ pointer-events: none;
3285
+ z-index: 1;
3286
+ ${i(e, "background-color", "--SLIDER-EVENTS-VALUE-BACKGROUND-COLOR")}
3287
+
3288
+ &.--SLIDER-mark--active {
3289
+ ${i(e, "background-color", "--SLIDER-EVENTS-ENABLED-BACKGROUND-COLOR")}
3290
+ }
3291
+ }
3292
+
3293
+ .--SLIDER-ripple {
3294
+ position: absolute;
3295
+ top: 50%;
3296
+ transform: translateY(-50%);
3297
+ margin-left: -6px;
3298
+ width: 36px;
3299
+ height: 36px;
3300
+ border-radius: 50%;
3301
+ pointer-events: none;
3302
+ z-index: 2;
3303
+ opacity: 0;
3304
+ transition:
3305
+ background-color 150ms ease-in-out,
3306
+ opacity 150ms ease-in-out;
3307
+ }
3308
+
3309
+ .--SLIDER-thumbIcon {
3310
+ position: absolute;
3311
+ top: 50%;
3312
+ transform: translateY(-50%);
3313
+ width: 24px;
3314
+ height: 24px;
3315
+ display: flex;
3316
+ align-items: center;
3317
+ justify-content: center;
3318
+ pointer-events: none;
3319
+ z-index: 4;
3320
+ border-radius: 50%;
3321
+ box-sizing: border-box;
3322
+
3323
+ > svg {
3324
+ width: 20px;
3325
+ height: 20px;
3326
+ }
3327
+ }
3328
+ }
3329
+ `, Q = "--SLIDER", at = ({ 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: ee = "horizontal", track: f = "normal", control: p, style: te }) => {
3330
+ let { field: ne } = ue({
3331
+ control: p,
3332
+ name: a
3333
+ }), m = ne.value ?? [e], h = m.length >= 2, g = C(null), re = C(void 0), _ = ee === "vertical", v = i !== Infinity && e !== i && o > 0 ? Array.from({ length: Math.round((i - e) / o) + 1 }, (t, n) => Math.min(e + n * o, i)) : [], y = v.length > 0, ie = (t) => y ? v.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)), [b, ae] = w(() => y ? m.map(ie) : m), x = (e) => {
3334
+ ne.onChange(e), ae(e);
3335
+ }, oe = (e) => {
3336
+ let t = ie(parseFloat(e.target.value)), n = h ? Math.min(t, b[1] - s) : t;
3337
+ x(h ? [n, b[1]] : [n]);
3338
+ }, se = (e) => {
3339
+ let t = ie(parseFloat(e.target.value)), n = Math.max(t, b[0] + s);
3340
+ x([b[0], n]);
3341
+ }, ce = (t) => {
3342
+ if (!y) return;
3343
+ let n = b[0], r;
3344
+ if (t.key === "ArrowRight" || t.key === "ArrowUp" ? r = v.find((e) => e > n) ?? n : t.key === "ArrowLeft" || t.key === "ArrowDown" ? r = [...v].reverse().find((e) => e < n) ?? n : t.key === "Home" ? r = e : t.key === "End" && (r = h ? Math.min(i, b[1] - s) : i), r !== void 0 && r !== n) {
3345
+ t.preventDefault();
3346
+ let e = h ? Math.min(r, b[1] - s) : r;
3347
+ x(h ? [e, b[1]] : [e]);
3348
+ }
3349
+ }, le = (t) => {
3350
+ if (!y) return;
3351
+ let n = b[1], r;
3352
+ if (t.key === "ArrowRight" || t.key === "ArrowUp" ? r = v.find((e) => e > n) ?? n : t.key === "ArrowLeft" || t.key === "ArrowDown" ? r = [...v].reverse().find((e) => e < n) ?? n : t.key === "Home" ? r = Math.max(e, b[0] + s) : t.key === "End" && (r = i), r !== void 0 && r !== n) {
3353
+ t.preventDefault();
3354
+ let e = Math.max(r, b[0] + s);
3355
+ x([b[0], e]);
3356
+ }
3357
+ }, S = (t) => {
3358
+ if (c || i === Infinity || i === e) return;
3359
+ let n = g.current, r = n?.getBoundingClientRect();
3360
+ if (!r || !n) return;
3361
+ let a = ie(e + (_ ? Math.max(0, Math.min(1, (r.bottom - t.clientY) / r.height)) : Math.max(0, Math.min(1, (t.clientX - r.left) / r.width))) * (i - e));
3362
+ h ? Math.abs(a - b[0]) <= Math.abs(a - b[1]) ? x([Math.max(e, Math.min(a, b[1] - s)), b[1]]) : x([b[0], Math.min(i, Math.max(a, b[0] + s))]) : x([Math.max(e, Math.min(i, a))]), n.classList.add(`${Q}--clicking`), clearTimeout(re.current), re.current = setTimeout(() => n.classList.remove(`${Q}--clicking`), 150);
3363
+ }, T = (t) => i === e ? 0 : (t - e) / (i - e) * 100, de = (e) => {
3364
+ let t = T(e);
3365
+ return _ ? { top: `calc(${100 - t}% - ${(100 - t) / 100 * 24}px)` } : { left: `calc(${t}% - ${t / 100 * 24}px)` };
3366
+ }, fe = (e) => {
3367
+ let t = T(e);
3368
+ return _ ? { top: `calc(${100 - t}% - ${(100 - t) / 100 * 24}px + 11px)` } : { left: `calc(${t}% - ${t / 100 * 24}px + 11px)` };
3369
+ }, pe = () => {
3370
+ let e = b[0], t = b[1] ?? e, n = T(e), r = T(t), i = (e) => 12 - e / 100 * 24;
3371
+ return _ ? h ? f === "inverted" ? [{
3372
+ top: "0%",
3373
+ bottom: `calc(${r}% + ${i(r)}px)`
3374
+ }, {
3375
+ top: `calc(${100 - n}% - ${i(n)}px)`,
3376
+ bottom: "0%"
3377
+ }] : [{
3378
+ top: `calc(${100 - r}% - ${i(r)}px)`,
3379
+ bottom: `calc(${n}% + ${i(n)}px)`
3380
+ }] : f === "inverted" ? [{
3381
+ top: "0%",
3382
+ bottom: `calc(${n}% + ${i(n)}px)`
3383
+ }] : [{
3384
+ top: `calc(${100 - n}% - ${i(n)}px)`,
3385
+ bottom: "0%"
3386
+ }] : h ? f === "inverted" ? [{
3387
+ left: "0%",
3388
+ right: `calc(${100 - n}% - ${i(n)}px)`
3389
+ }, {
3390
+ left: `calc(${r}% + ${i(r)}px)`,
3391
+ right: "0%"
3392
+ }] : [{
3393
+ left: `calc(${n}% + ${i(n)}px)`,
3394
+ right: `calc(${100 - r}% - ${i(r)}px)`
3395
+ }] : f === "inverted" ? [{
3396
+ left: `calc(${n}% + ${i(n)}px)`,
3397
+ right: "0%"
3398
+ }] : [{
3399
+ left: "0%",
3400
+ right: `calc(${100 - n}% - ${i(n)}px)`
3401
+ }];
3402
+ }, me = (e) => h ? f === "inverted" ? e <= b[0] || e >= b[1] : e >= b[0] && e <= b[1] : f === "inverted" ? e >= b[0] : e <= b[0], E = y ? "any" : o;
3403
+ return /* @__PURE__ */ n("span", {
3404
+ ref: g,
3405
+ className: [Q, _ ? `${Q}--vertical` : ""].join(" "),
3406
+ css: it(te),
3407
+ "data-testid": Q,
3408
+ children: [
3409
+ /* @__PURE__ */ t("input", {
3410
+ className: `${Q}-inputField`,
3411
+ type: "range",
3412
+ min: e,
3413
+ max: i,
3414
+ step: E,
3415
+ value: b[0],
3416
+ onChange: oe,
3417
+ onKeyDown: ce,
3418
+ disabled: c,
3419
+ "data-testid": h ? `${Q}-minField` : `${Q}-field`
3420
+ }),
3421
+ /* @__PURE__ */ t("span", {
3422
+ className: `${Q}-ripple`,
3423
+ style: de(b[0]),
3424
+ "aria-hidden": "true"
3425
+ }),
3426
+ /* @__PURE__ */ t("span", {
3427
+ className: `${Q}-thumbIcon`,
3428
+ style: de(b[0]),
3429
+ "aria-hidden": "true",
3430
+ children: l
3431
+ }),
3432
+ h && /* @__PURE__ */ n(r, { children: [
3433
+ /* @__PURE__ */ t("input", {
3434
+ className: `${Q}-inputField`,
3435
+ type: "range",
3436
+ min: e,
3437
+ max: i,
3438
+ step: E,
3439
+ value: b[1],
3440
+ onChange: se,
3441
+ onKeyDown: le,
3442
+ disabled: c,
3443
+ "data-testid": `${Q}-maxField`
3444
+ }),
3445
+ /* @__PURE__ */ t("span", {
3446
+ className: `${Q}-ripple`,
3447
+ style: de(b[1]),
3448
+ "aria-hidden": "true"
3449
+ }),
3450
+ /* @__PURE__ */ t("span", {
3451
+ className: `${Q}-thumbIcon`,
3452
+ style: de(b[1]),
3453
+ "aria-hidden": "true",
3454
+ children: u
3455
+ })
3456
+ ] }),
3457
+ /* @__PURE__ */ t("span", {
3458
+ className: `${Q}-rail`,
3459
+ onClick: S
3460
+ }),
3461
+ pe().map((e, n) => /* @__PURE__ */ t("span", {
3462
+ className: `${Q}-tracker`,
3463
+ onClick: S,
3464
+ style: e
3465
+ }, n)),
3466
+ d && v.map((e) => /* @__PURE__ */ t("span", {
3467
+ className: [`${Q}-mark`, me(e) && `${Q}-mark--active`].filter(Boolean).join(" "),
3468
+ style: fe(e),
3469
+ "aria-hidden": "true",
3470
+ onClick: S
3471
+ }, e))
3472
+ ]
3473
+ });
3474
+ }, ot = ({ theme: n, ...r }) => {
3475
+ let { componentStyles: i } = e([a.SLIDER], n);
3476
+ return /* @__PURE__ */ t(at, {
3477
+ ...r,
3478
+ style: i
3479
+ });
3480
+ }, st = (e, t) => `
3481
+ ~ .--SWITCH-span {
3482
+ // BACKGROUNDS
3483
+ ${i(e, "background-color", `--SWITCH-EVENTS-${t}-BACKGROUND-COLOR`)}
3484
+ }
3485
+ `, ct = (e, t) => `
3486
+ ~ .--SWITCH-span {
3487
+ // BORDERS
3488
+ ${i(e, "border-color", `--SWITCH-EVENTS-${t}-BORDER-COLOR`)}
3489
+ ${i(e, "border-width", `--SWITCH-EVENTS-${t}-BORDER-WIDTH`)}
3490
+ ${i(e, "border-style", `--SWITCH-EVENTS-${t}-BORDER-STYLE`)}
3491
+ ${i(e, "border-radius", `--SWITCH-EVENTS-${t}-BORDER-RADIUS`)}
3492
+ }
3493
+ `, lt = (e, t) => `
3494
+ ~ .--SWITCH-span {
3495
+ // OUTLINE
3496
+ ${i(e, "outline-color", `--SWITCH-EVENTS-${t}-OUTLINE-COLOR`)}
3497
+ ${i(e, "outline-width", `--SWITCH-EVENTS-${t}-OUTLINE-WIDTH`)}
3498
+ ${i(e, "outline-style", `--SWITCH-EVENTS-${t}-OUTLINE-STYLE`)}
3499
+ ${i(e, "outline-offset", `--SWITCH-EVENTS-${t}-OUTLINE-OFFSET`)}
3500
+ }
3501
+ `, ut = (e, t) => `
3502
+ // UTILS
3503
+ ~ .--SWITCH-span > span {
3504
+ > svg > path {
3505
+ ${i(e, "fill", `--SWITCH-EVENTS-${t}-ICON-COLOR`)};
3506
+ }
3507
+
3508
+ > .--SWITCH-shadow {
3509
+ ${i(e, "background-color", `--SWITCH-EVENTS-${t}-ICON-BACKGROUND-COLOR`)};
3510
+ }
3511
+ }
3512
+ `, dt = (e, t) => `
3513
+ // TYPOGRAPHY
3514
+ .--SWITCH-label {
3515
+ ${i(e, "color", `--SWITCH-EVENTS-${t}-COLOR-PRIMARY`)}
3516
+ }
3517
+
3518
+ ~ .--SWITCH-helperText {
3519
+ ${i(e, "color", `--SWITCH-EVENTS-${t}-COLOR-SECONDARY`)}
3520
+ }
3521
+ `, ft = (e) => T`
3522
+ &.--SWITCH {
3523
+ display: flex;
3524
+ flex-direction: column;
3525
+ gap: 8px;
3526
+ width: fit-content;
3527
+
3528
+ .--SWITCH-container {
3529
+ display: flex;
3530
+ flex-direction: row;
3531
+ gap: 12px;
3532
+ align-items: center;
3533
+ cursor: pointer;
3534
+
3535
+ // ENABLED
3536
+ ${dt(e, "ENABLED")};
3537
+
3538
+ // VALUE
3539
+ &:has(.--SWITCH-inputField:checked) {
3540
+ ${dt(e, "VALUE")};
3541
+ }
3542
+
3543
+ // HOVER
3544
+ &:has(.--SWITCH-inputField:hover) {
3545
+ ${dt(e, "HOVER")};
3546
+ }
3547
+
3548
+ // ACTIVE
3549
+ &:has(.--SWITCH-inputField.--SWITCH-active, .--SWITCH-inputField:active) {
3550
+ ${dt(e, "ACTIVE")};
3551
+ }
3552
+
3553
+ // FOCUS-VISIBLE
3554
+ &:has(.--SWITCH-inputField:focus-visible) {
3555
+ ${dt(e, "FOCUS")};
3556
+ }
3557
+
3558
+ // DISABLED
3559
+ &:has(.--SWITCH-inputField:disabled) {
3560
+ pointer-events: none;
3561
+ ${dt(e, "DISABLED")};
3562
+ }
3563
+
3564
+ // DISABLED + VALUE
3565
+ &:has(.--SWITCH-inputField:disabled:checked) {
3566
+ ${dt(e, "DISABLED_VALUE")};
3567
+ }
3568
+
3569
+ .--SWITCH-checkbox {
3570
+ position: relative;
3571
+ display: inline-flex;
3572
+ width: 48px;
3573
+ height: 24px;
3574
+
3575
+ .--SWITCH-inputField {
3576
+ cursor: pointer;
3577
+ position: absolute;
3578
+ opacity: 0;
3579
+ width: 100%;
3580
+ height: 100%;
3581
+ z-index: 2;
3582
+ margin: 0;
3583
+ -webkit-tap-highlight-color: transparent;
3584
+
3585
+ // ENABLED
3586
+ ${st(e, "ENABLED")};
3587
+ ${ct(e, "ENABLED")};
3588
+ ${ut(e, "ENABLED")};
3589
+
3590
+ // VALUE
3591
+ &:checked {
3592
+ ${st(e, "VALUE")};
3593
+ ${ct(e, "VALUE")};
3594
+ ${ut(e, "VALUE")};
3595
+
3596
+ ~ .--SWITCH-span {
3597
+ .--SWITCH-iconOff {
3598
+ transform: translateX(27px);
3599
+ opacity: 0;
3600
+ }
3601
+ .--SWITCH-iconOn {
3602
+ transform: translateX(-3px);
3603
+ opacity: 1;
3604
+ }
3605
+ }
3606
+ }
3607
+
3608
+ // HOVER
3609
+ &:hover {
3610
+ ~ .--SWITCH-span {
3611
+ .--SWITCH-iconOn,
3612
+ .--SWITCH-iconOff {
3613
+ &::before {
3614
+ opacity: 1;
3615
+ ${i(e, "background-color", "--SWITCH-EVENTS-HOVER-SHADOW-COLOR")}
3616
+ }
3617
+ }
3618
+ }
3619
+ }
3620
+
3621
+ // ACTIVE
3622
+ &.--SWITCH-active,
3623
+ &:active {
3624
+ ~ .--SWITCH-span {
3625
+ .--SWITCH-iconOn,
3626
+ .--SWITCH-iconOff {
3627
+ &::before {
3628
+ opacity: 1;
3629
+ ${i(e, "background-color", "--SWITCH-EVENTS-ACTIVE-SHADOW-COLOR")}
3630
+ }
3631
+ }
3632
+ }
3633
+ }
3634
+
3635
+ // FOCUS
3636
+ &:focus-visible {
3637
+ outline: none;
3638
+ ${lt(e, "FOCUS")};
3639
+ ${ut(e, "FOCUS")};
3640
+ }
3641
+
3642
+ // DISABLED
3643
+ &:disabled {
3644
+ ${st(e, "DISABLED")};
3645
+ ${ct(e, "DISABLED")};
3646
+ ${ut(e, "DISABLED")};
3647
+ }
3648
+
3649
+ // DISABLED + VALUE
3650
+ &:disabled:checked {
3651
+ ${st(e, "DISABLED_VALUE")};
3652
+ ${ct(e, "DISABLED_VALUE")};
3653
+ ${ut(e, "DISABLED_VALUE")};
3654
+
3655
+ ~ .--SWITCH-span {
3656
+ .--SWITCH-iconOff {
3657
+ transform: translateX(27px);
3658
+ opacity: 0;
3659
+ }
3660
+ .--SWITCH-iconOn {
3661
+ transform: translateX(-3px);
3662
+ opacity: 1;
3663
+ }
3664
+ }
3665
+ }
3666
+ }
3667
+
3668
+ .--SWITCH-span {
3669
+ width: 48px;
3670
+ height: 24px;
3671
+ ${i(e, "border-radius", "--SWITCH-ROOT-BORDER-RADIUS")};
3672
+ position: relative;
3673
+ box-sizing: border-box;
3674
+ display: flex;
3675
+ align-items: center;
3676
+ transition: background-color 150ms ease-in-out;
3677
+
3678
+ .--SWITCH-iconOff,
3679
+ .--SWITCH-iconOn {
3680
+ position: absolute;
3681
+ display: flex;
3682
+ align-items: center;
3683
+ justify-content: center;
3684
+ border-radius: 50%;
3685
+
3686
+ height: min(16px, calc(100% - 6px));
3687
+ aspect-ratio: 1;
3688
+
3689
+ transition:
3690
+ transform 150ms ease-in-out,
3691
+ opacity 150ms ease-in-out;
3692
+
3693
+ &::before {
3694
+ content: '';
3695
+ position: absolute;
3696
+ width: 36px;
3697
+ height: 36px;
3698
+ border-radius: 50%;
3699
+ top: calc(50% - 18px);
3700
+ left: calc(50% - 18px);
3701
+ opacity: 0;
3702
+ z-index: -1;
3703
+ transition: opacity 150ms ease-in-out;
3704
+ }
3705
+
3706
+ > svg {
3707
+ width: 12px;
3708
+ height: 12px;
3709
+ max-width: 100%;
3710
+ max-height: 100%;
3711
+ position: absolute;
3712
+ z-index: 1;
3713
+ }
3714
+
3715
+ .--SWITCH-shadow {
3716
+ position: absolute;
3717
+ width: 100%;
3718
+ height: 100%;
3719
+ border-radius: 50%;
3720
+ pointer-events: none;
3721
+ z-index: -1;
3722
+ transition: background-color 150ms ease-in-out;
3723
+ }
3724
+ }
3725
+
3726
+ .--SWITCH-iconOff {
3727
+ left: 0;
3728
+ transform: translateX(3px);
3729
+ opacity: 1;
3730
+ }
3731
+ .--SWITCH-iconOn {
3732
+ right: 0;
3733
+ transform: translateX(calc(-1 * 27px));
3734
+ opacity: 0;
3735
+ }
3736
+ }
3737
+ }
3738
+ }
3739
+
3740
+ .--SWITCH-label {
3741
+ // FONT
3742
+ font-family: ${e["--FONTFAMILY-PRIMARY"]};
3743
+ font-size: 0.875rem;
3744
+ font-weight: 500;
3745
+ line-height: 1;
3746
+ }
3747
+
3748
+ .--SWITCH-helperText {
3749
+ // FONT
3750
+ font-family: ${e["--FONTFAMILY-PRIMARY"]};
3751
+ font-size: 13px;
3752
+ line-height: 16px;
3753
+ margin-left: 14px;
3754
+ }
3755
+ }
3756
+ `, $ = "--SWITCH", pt = ({ name: e, control: r, iconOn: i, iconOff: a, disabled: o, label: s, helperText: c, className: l, style: u, ...d }) => {
3757
+ let [ee, f] = w(!1), { field: p, fieldState: te } = ue({
3758
+ control: r,
3759
+ name: e
3760
+ }), [ne, m] = w(p.value || !1), h = te.error, g = (e) => {
3761
+ p.onChange(e), m(e), h && y();
3762
+ }, re = (e) => {
3763
+ let { checked: t } = e.target;
3764
+ g(t);
3765
+ }, _ = (e) => {
3766
+ (e.key === "Enter" || e.key === "Space") && f(!0), d.onKeyDown?.(e);
3767
+ }, v = (e) => {
3768
+ (e.key === "Enter" || e.key === "Space") && (f(!1), g(!ne)), d.onKeyUp?.(e);
3769
+ }, y = () => p.onBlur();
3770
+ return /* @__PURE__ */ n("div", {
3771
+ className: [
3772
+ $,
3773
+ ee ? `${$}-active` : "",
3774
+ l || ""
3775
+ ].join(" "),
3776
+ css: ft(u),
3777
+ "data-testid": $,
3778
+ children: [/* @__PURE__ */ n("label", {
3779
+ className: `${$}-container`,
3780
+ children: [/* @__PURE__ */ n("div", {
3781
+ className: `${$}-checkbox`,
3782
+ children: [/* @__PURE__ */ t("input", {
3783
+ className: [
3784
+ `${$}-inputField`,
3785
+ ee ? `${$}-active` : "",
3786
+ h && `${$}-error`
3787
+ ].join(" "),
3788
+ type: "checkbox",
3789
+ value: e,
3790
+ checked: ne,
3791
+ disabled: o,
3792
+ onChange: re,
3793
+ onKeyDown: _,
3794
+ onKeyUp: v,
3795
+ onBlur: y,
3796
+ "data-testid": `${$}-inputField`,
3797
+ ...d
3798
+ }), /* @__PURE__ */ n("span", {
3799
+ className: `${$}-span`,
3800
+ "data-testid": `${$}-icon`,
3801
+ children: [/* @__PURE__ */ n("span", {
3802
+ className: `${$}-iconOff`,
3803
+ children: [/* @__PURE__ */ t("span", { className: `${$}-shadow` }), a]
3804
+ }), /* @__PURE__ */ n("span", {
3805
+ className: `${$}-iconOn`,
3806
+ children: [/* @__PURE__ */ t("span", { className: `${$}-shadow` }), i]
3807
+ })]
3808
+ })]
3809
+ }), /* @__PURE__ */ t("span", {
3810
+ className: `${$}-label`,
3811
+ "data-testid": `${$}-label`,
3812
+ children: s
3813
+ })]
3814
+ }), (c || h) && /* @__PURE__ */ t("span", {
3815
+ className: `${$}-helperText`,
3816
+ "data-testid": `${$}-helperText`,
3817
+ children: h ? h.message : c
3818
+ })]
3819
+ });
3820
+ }, mt = ({ theme: n, ...r }) => {
3821
+ let { componentStyles: i } = e([a.SWITCH], n);
3822
+ return /* @__PURE__ */ t(pt, {
3823
+ ...r,
3824
+ style: i
3825
+ });
3826
+ };
3827
+ //#endregion
3828
+ export { Pe as a, he as c, Ue as i, ot as n, ke as o, et as r, Ce as s, mt as t };
3829
+
3830
+ //# sourceMappingURL=Switch-CBpbDGqG.js.map