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