@szymonpiatek/designsystem 0.0.2 → 0.0.3

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/index.js CHANGED
@@ -1,7 +1,8 @@
1
- import { forwardRef, useMemo } from 'react';
2
- import { styled, createTheme, alpha, ThemeProvider } from '@mui/material/styles';
1
+ import { forwardRef, useId, useRef, useEffect, useState, useCallback, useMemo } from 'react';
2
+ import { styled, alpha, createTheme, ThemeProvider } from '@mui/material/styles';
3
3
  import { keyframes } from '@emotion/react';
4
- import { jsxs, jsx } from 'react/jsx-runtime';
4
+ import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
5
+ import { getCountryCallingCode } from 'libphonenumber-js';
5
6
  import CssBaseline from '@mui/material/CssBaseline';
6
7
 
7
8
  // src/components/atoms/buttons/Button/Button.tsx
@@ -14,40 +15,32 @@ var sizeMap = {
14
15
  md: { padding: "0.5rem 1.25rem", fontSize: "0.875rem", gap: "0.375rem" },
15
16
  lg: { padding: "0.75rem 1.75rem", fontSize: "1rem", gap: "0.5rem" }
16
17
  };
17
- var variantStyles = (theme, variant) => {
18
- switch (variant) {
19
- case "primary":
20
- return {
21
- backgroundColor: theme.palette.primary.main,
22
- color: theme.palette.primary.contrastText,
23
- "&:hover:not(:disabled)": { backgroundColor: theme.palette.primary.dark },
24
- "&:active:not(:disabled)": { filter: "brightness(0.92)" }
25
- };
26
- case "secondary":
27
- return {
28
- backgroundColor: theme.palette.secondary.main,
29
- color: theme.palette.secondary.contrastText,
30
- "&:hover:not(:disabled)": { backgroundColor: theme.palette.secondary.dark },
31
- "&:active:not(:disabled)": { filter: "brightness(0.92)" }
32
- };
33
- case "ghost":
34
- return {
35
- backgroundColor: "transparent",
36
- color: theme.palette.primary.main,
37
- border: `1px solid ${theme.palette.primary.main}`,
38
- "&:hover:not(:disabled)": { backgroundColor: alpha(theme.palette.primary.main, 0.08) },
39
- "&:active:not(:disabled)": { backgroundColor: alpha(theme.palette.primary.main, 0.16) }
40
- };
41
- case "danger":
42
- return {
43
- backgroundColor: theme.palette.error.main,
44
- color: theme.palette.error.contrastText,
45
- "&:hover:not(:disabled)": { backgroundColor: theme.palette.error.dark },
46
- "&:active:not(:disabled)": { filter: "brightness(0.92)" }
47
- };
48
- default:
49
- return {};
50
- }
18
+ var variantStyles = {
19
+ primary: (theme) => ({
20
+ backgroundColor: theme.palette.primary.main,
21
+ color: theme.palette.primary.contrastText,
22
+ "&:hover:not(:disabled)": { backgroundColor: theme.palette.primary.dark },
23
+ "&:active:not(:disabled)": { filter: "brightness(0.92)" }
24
+ }),
25
+ secondary: (theme) => ({
26
+ backgroundColor: theme.palette.secondary.main,
27
+ color: theme.palette.secondary.contrastText,
28
+ "&:hover:not(:disabled)": { backgroundColor: theme.palette.secondary.dark },
29
+ "&:active:not(:disabled)": { filter: "brightness(0.92)" }
30
+ }),
31
+ ghost: (theme) => ({
32
+ backgroundColor: "transparent",
33
+ color: theme.palette.primary.main,
34
+ border: `1px solid ${theme.palette.primary.main}`,
35
+ "&:hover:not(:disabled)": { backgroundColor: alpha(theme.palette.primary.main, 0.08) },
36
+ "&:active:not(:disabled)": { backgroundColor: alpha(theme.palette.primary.main, 0.16) }
37
+ }),
38
+ danger: (theme) => ({
39
+ backgroundColor: theme.palette.error.main,
40
+ color: theme.palette.error.contrastText,
41
+ "&:hover:not(:disabled)": { backgroundColor: theme.palette.error.dark },
42
+ "&:active:not(:disabled)": { filter: "brightness(0.92)" }
43
+ })
51
44
  };
52
45
  var StyledButton = styled("button")(
53
46
  ({ theme, $variant, $size, $fullWidth }) => ({
@@ -66,7 +59,7 @@ var StyledButton = styled("button")(
66
59
  transition: "background-color 150ms ease, box-shadow 150ms ease, border-color 150ms ease",
67
60
  width: $fullWidth ? "100%" : "auto",
68
61
  ...sizeMap[$size],
69
- ...variantStyles(theme, $variant),
62
+ ...variantStyles[$variant](theme),
70
63
  "&:focus-visible": {
71
64
  outline: `3px solid ${theme.palette.primary.main}`,
72
65
  outlineOffset: "2px"
@@ -99,7 +92,10 @@ var Button = forwardRef(
99
92
  endIcon,
100
93
  onClick,
101
94
  type = "button",
102
- children
95
+ children,
96
+ className,
97
+ "aria-label": ariaLabel,
98
+ "aria-current": ariaCurrent
103
99
  }, ref) => /* @__PURE__ */ jsxs(
104
100
  StyledButton,
105
101
  {
@@ -111,6 +107,9 @@ var Button = forwardRef(
111
107
  $size: size,
112
108
  $fullWidth: fullWidth,
113
109
  "aria-busy": loading || void 0,
110
+ className,
111
+ "aria-label": ariaLabel,
112
+ "aria-current": ariaCurrent,
114
113
  children: [
115
114
  loading ? /* @__PURE__ */ jsx(Spinner, { "aria-hidden": "true", children: /* @__PURE__ */ jsxs(
116
115
  "svg",
@@ -134,6 +133,4074 @@ var Button = forwardRef(
134
133
  )
135
134
  );
136
135
  Button.displayName = "Button";
136
+ var StyledHelperText = styled("p")(({ theme, $error }) => ({
137
+ margin: "0.25rem 0 0",
138
+ fontSize: "0.75rem",
139
+ fontFamily: theme.typography.fontFamily,
140
+ color: $error ? theme.palette.error.main : theme.palette.text.secondary
141
+ }));
142
+ var HelperText = ({ error = false, children, ...rest }) => /* @__PURE__ */ jsx(StyledHelperText, { $error: error, ...rest, children });
143
+ HelperText.displayName = "HelperText";
144
+ var labelSizeMap = {
145
+ sm: "0.625rem",
146
+ md: "0.75rem",
147
+ lg: "0.875rem"
148
+ };
149
+ var StyledLabel = styled("label")(({ theme, $error, $size }) => ({
150
+ display: "block",
151
+ marginBottom: "0.25rem",
152
+ fontSize: labelSizeMap[$size],
153
+ fontWeight: 500,
154
+ fontFamily: theme.typography.fontFamily,
155
+ color: $error ? theme.palette.error.main : theme.palette.text.primary
156
+ }));
157
+ var Label = ({ error = false, size = "md", children, ...rest }) => /* @__PURE__ */ jsx(StyledLabel, { $error: error, $size: size, ...rest, children });
158
+ Label.displayName = "Label";
159
+
160
+ // src/components/atoms/inputs/elements/sizeMap.ts
161
+ var inputSizeMap = {
162
+ sm: { padding: "0.25rem 0.5rem", fontSize: "0.75rem", gap: "0.25rem" },
163
+ md: { padding: "0.375rem 0.75rem", fontSize: "0.875rem", gap: "0.375rem" },
164
+ lg: { padding: "0.5rem 1rem", fontSize: "1rem", gap: "0.5rem" }
165
+ };
166
+ var inputHeightMap = {
167
+ sm: "26px",
168
+ md: "32px",
169
+ lg: "38.5px"
170
+ };
171
+ var DropdownPanel = styled("div")(({ theme }) => ({
172
+ position: "absolute",
173
+ top: "calc(100% + 4px)",
174
+ left: 0,
175
+ zIndex: theme.zIndex.modal,
176
+ backgroundColor: theme.palette.background.paper,
177
+ border: `1px solid ${theme.palette.divider}`,
178
+ borderRadius: theme.shape.borderRadius,
179
+ boxShadow: theme.shadows[4]
180
+ }));
181
+ var Chevron = () => /* @__PURE__ */ jsx(
182
+ "svg",
183
+ {
184
+ viewBox: "0 0 24 24",
185
+ width: "1em",
186
+ height: "1em",
187
+ fill: "none",
188
+ stroke: "currentColor",
189
+ strokeWidth: 2,
190
+ strokeLinecap: "round",
191
+ strokeLinejoin: "round",
192
+ "aria-hidden": true,
193
+ children: /* @__PURE__ */ jsx("polyline", { points: "6 9 12 15 18 9" })
194
+ }
195
+ );
196
+ var inputColors = (theme, error) => ({
197
+ borderColor: error ? theme.palette.error.main : theme.palette.divider,
198
+ "&:hover:not(:focus-within):not([data-disabled])": {
199
+ borderColor: error ? theme.palette.error.dark : theme.palette.text.secondary
200
+ },
201
+ "&:focus-within": {
202
+ borderColor: error ? theme.palette.error.main : theme.palette.primary.main,
203
+ boxShadow: `0 0 0 3px ${error ? theme.palette.error.main : theme.palette.primary.main}33`
204
+ }
205
+ });
206
+ var Root = styled("div")(({ $fullWidth }) => ({
207
+ display: $fullWidth ? "block" : "inline-block",
208
+ width: $fullWidth ? "100%" : "auto"
209
+ }));
210
+ var InputWrapper = styled("div")(
211
+ ({ theme, $size, $fullWidth, $error, $disabled }) => ({
212
+ display: "inline-flex",
213
+ alignItems: "center",
214
+ width: $fullWidth ? "100%" : "auto",
215
+ borderRadius: theme.shape.borderRadius,
216
+ border: "1px solid",
217
+ backgroundColor: $disabled ? theme.palette.action.disabledBackground : theme.palette.background.paper,
218
+ transition: "border-color 150ms ease, box-shadow 150ms ease",
219
+ cursor: $disabled ? "not-allowed" : "text",
220
+ ...inputSizeMap[$size],
221
+ height: inputHeightMap[$size],
222
+ paddingBlock: 0,
223
+ ...inputColors(theme, $error),
224
+ ...$disabled && {
225
+ borderColor: theme.palette.action.disabled,
226
+ pointerEvents: "none"
227
+ }
228
+ })
229
+ );
230
+ var StyledInput = styled("input")(({ theme }) => ({
231
+ flex: 1,
232
+ border: "none",
233
+ outline: "none",
234
+ background: "transparent",
235
+ fontFamily: theme.typography.fontFamily,
236
+ fontSize: "inherit",
237
+ color: theme.palette.text.primary,
238
+ width: "100%",
239
+ "&::placeholder": {
240
+ color: theme.palette.text.disabled
241
+ },
242
+ "&:disabled": {
243
+ color: theme.palette.action.disabled,
244
+ cursor: "not-allowed"
245
+ },
246
+ '&[type="search"]::-webkit-search-cancel-button': {
247
+ WebkitAppearance: "none"
248
+ }
249
+ }));
250
+ var Adornment = styled("span")(({ theme }) => ({
251
+ display: "inline-flex",
252
+ alignItems: "center",
253
+ color: theme.palette.text.secondary,
254
+ flexShrink: 0
255
+ }));
256
+ var BaseInput = forwardRef(
257
+ ({
258
+ label,
259
+ helperText,
260
+ error = false,
261
+ size = "md",
262
+ fullWidth = false,
263
+ startAdornment,
264
+ endAdornment,
265
+ disabled = false,
266
+ id,
267
+ ...rest
268
+ }, ref) => {
269
+ const autoId = useId();
270
+ const inputId = id ?? autoId;
271
+ return /* @__PURE__ */ jsxs(Root, { $fullWidth: fullWidth, children: [
272
+ label && /* @__PURE__ */ jsx(Label, { htmlFor: inputId, error, size, children: label }),
273
+ /* @__PURE__ */ jsxs(
274
+ InputWrapper,
275
+ {
276
+ $size: size,
277
+ $fullWidth: fullWidth,
278
+ $error: error,
279
+ $disabled: disabled,
280
+ "data-disabled": disabled || void 0,
281
+ children: [
282
+ startAdornment && /* @__PURE__ */ jsx(Adornment, { children: startAdornment }),
283
+ /* @__PURE__ */ jsx(StyledInput, { ref, id: inputId, disabled, ...rest }),
284
+ endAdornment && /* @__PURE__ */ jsx(Adornment, { children: endAdornment })
285
+ ]
286
+ }
287
+ ),
288
+ helperText && /* @__PURE__ */ jsx(HelperText, { error, children: helperText })
289
+ ] });
290
+ }
291
+ );
292
+ BaseInput.displayName = "BaseInput";
293
+ var checkboxSizeMap = {
294
+ sm: "14px",
295
+ md: "16px",
296
+ lg: "20px"
297
+ };
298
+ var labelFontSizeMap = {
299
+ sm: "0.75rem",
300
+ md: "0.875rem",
301
+ lg: "1rem"
302
+ };
303
+ var checkedColor = (theme, error) => error ? theme.palette.error.main : theme.palette.primary.main;
304
+ var Box = styled("span")(({ theme, $size, $error, $disabled }) => ({
305
+ position: "relative",
306
+ flexShrink: 0,
307
+ width: checkboxSizeMap[$size],
308
+ height: checkboxSizeMap[$size],
309
+ borderRadius: theme.shape.borderRadius / 2,
310
+ border: "1px solid",
311
+ borderColor: $disabled ? theme.palette.action.disabled : $error ? theme.palette.error.main : theme.palette.divider,
312
+ backgroundColor: $disabled ? theme.palette.action.disabledBackground : theme.palette.background.paper,
313
+ transition: "border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease",
314
+ display: "inline-flex",
315
+ alignItems: "center",
316
+ justifyContent: "center",
317
+ ...!$disabled && {
318
+ "label:hover &": {
319
+ borderColor: $error ? theme.palette.error.dark : theme.palette.text.secondary
320
+ },
321
+ "label:has(input:checked) &, label:has(input:indeterminate) &": {
322
+ backgroundColor: checkedColor(theme, $error),
323
+ borderColor: checkedColor(theme, $error)
324
+ },
325
+ "label:has(input:focus-visible) &": {
326
+ boxShadow: `0 0 0 3px ${checkedColor(theme, $error)}33`
327
+ }
328
+ },
329
+ "&::after": {
330
+ content: '""',
331
+ position: "absolute",
332
+ display: "none"
333
+ },
334
+ "label:has(input:checked) &::after": {
335
+ display: "block",
336
+ width: "30%",
337
+ height: "55%",
338
+ borderRight: `2px solid #fff`,
339
+ borderBottom: `2px solid #fff`,
340
+ transform: "rotate(45deg) translate(-10%, -15%)"
341
+ },
342
+ "label:has(input:indeterminate) &::after": {
343
+ display: "block",
344
+ width: "55%",
345
+ height: "2px",
346
+ backgroundColor: "#fff",
347
+ borderRadius: "1px"
348
+ }
349
+ }));
350
+ var HiddenInput = styled("input")({
351
+ position: "absolute",
352
+ width: 1,
353
+ height: 1,
354
+ margin: -1,
355
+ overflow: "hidden",
356
+ clip: "rect(0 0 0 0)",
357
+ whiteSpace: "nowrap",
358
+ borderWidth: 0
359
+ });
360
+ var Row = styled("label")(({ theme }) => ({
361
+ display: "inline-flex",
362
+ alignItems: "center",
363
+ gap: "0.5rem",
364
+ cursor: "inherit",
365
+ fontFamily: theme.typography.fontFamily
366
+ }));
367
+ var LabelText = styled("span")(
368
+ ({ theme, $size, $disabled, $error }) => ({
369
+ fontSize: labelFontSizeMap[$size],
370
+ fontWeight: 400,
371
+ color: $disabled ? theme.palette.action.disabled : $error ? theme.palette.error.main : theme.palette.text.primary,
372
+ userSelect: "none"
373
+ })
374
+ );
375
+ var Root2 = styled("span")(({ $disabled }) => ({
376
+ display: "inline-flex",
377
+ flexDirection: "column",
378
+ cursor: $disabled ? "not-allowed" : "pointer"
379
+ }));
380
+ var CheckboxInput = forwardRef(
381
+ ({
382
+ label,
383
+ helperText,
384
+ error = false,
385
+ size = "md",
386
+ disabled = false,
387
+ indeterminate = false,
388
+ id,
389
+ ...rest
390
+ }, ref) => {
391
+ const autoId = useId();
392
+ const inputId = id ?? autoId;
393
+ const innerRef = useRef(null);
394
+ useEffect(() => {
395
+ if (innerRef.current) {
396
+ innerRef.current.indeterminate = indeterminate;
397
+ }
398
+ }, [indeterminate]);
399
+ return /* @__PURE__ */ jsxs(Root2, { $disabled: disabled, children: [
400
+ /* @__PURE__ */ jsxs(Row, { htmlFor: inputId, children: [
401
+ /* @__PURE__ */ jsx(Box, { $size: size, $error: error, $disabled: disabled, children: /* @__PURE__ */ jsx(
402
+ HiddenInput,
403
+ {
404
+ ref: (node) => {
405
+ innerRef.current = node;
406
+ if (typeof ref === "function") ref(node);
407
+ else if (ref)
408
+ ref.current = node;
409
+ },
410
+ id: inputId,
411
+ type: "checkbox",
412
+ disabled,
413
+ ...rest
414
+ }
415
+ ) }),
416
+ label && /* @__PURE__ */ jsx(LabelText, { $size: size, $disabled: disabled, $error: error, children: label })
417
+ ] }),
418
+ helperText && /* @__PURE__ */ jsx(HelperText, { error, children: helperText })
419
+ ] });
420
+ }
421
+ );
422
+ CheckboxInput.displayName = "CheckboxInput";
423
+ var formatSize = (bytes) => {
424
+ if (bytes < 1024) return `${bytes} B`;
425
+ if (bytes < 1024 ** 2) return `${(bytes / 1024).toFixed(1)} KB`;
426
+ return `${(bytes / 1024 ** 2).toFixed(1)} MB`;
427
+ };
428
+ var UploadArrowIcon = ({ size = 13 }) => /* @__PURE__ */ jsxs(
429
+ "svg",
430
+ {
431
+ width: size,
432
+ height: size,
433
+ viewBox: "0 0 24 24",
434
+ fill: "none",
435
+ stroke: "currentColor",
436
+ strokeWidth: 2.5,
437
+ strokeLinecap: "round",
438
+ strokeLinejoin: "round",
439
+ "aria-hidden": true,
440
+ children: [
441
+ /* @__PURE__ */ jsx("polyline", { points: "17 8 12 3 7 8" }),
442
+ /* @__PURE__ */ jsx("line", { x1: "12", y1: "3", x2: "12", y2: "15" }),
443
+ /* @__PURE__ */ jsx("path", { d: "M4 15v4a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-4" })
444
+ ]
445
+ }
446
+ );
447
+ var CloudUploadIcon = ({ size }) => /* @__PURE__ */ jsxs(
448
+ "svg",
449
+ {
450
+ width: size,
451
+ height: size,
452
+ viewBox: "0 0 24 24",
453
+ fill: "none",
454
+ stroke: "currentColor",
455
+ strokeWidth: 1.5,
456
+ strokeLinecap: "round",
457
+ strokeLinejoin: "round",
458
+ "aria-hidden": true,
459
+ children: [
460
+ /* @__PURE__ */ jsx("polyline", { points: "16 16 12 12 8 16" }),
461
+ /* @__PURE__ */ jsx("line", { x1: "12", y1: "12", x2: "12", y2: "21" }),
462
+ /* @__PURE__ */ jsx("path", { d: "M20.39 18.39A5 5 0 0 0 18 9h-1.26A8 8 0 1 0 3 16.3" })
463
+ ]
464
+ }
465
+ );
466
+ var FileDocIcon = ({ size }) => /* @__PURE__ */ jsxs(
467
+ "svg",
468
+ {
469
+ width: size,
470
+ height: size,
471
+ viewBox: "0 0 24 24",
472
+ fill: "none",
473
+ stroke: "currentColor",
474
+ strokeWidth: 1.75,
475
+ strokeLinecap: "round",
476
+ strokeLinejoin: "round",
477
+ "aria-hidden": true,
478
+ children: [
479
+ /* @__PURE__ */ jsx("path", { d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" }),
480
+ /* @__PURE__ */ jsx("polyline", { points: "14 2 14 8 20 8" })
481
+ ]
482
+ }
483
+ );
484
+ var TrashIcon = ({ size = 12 }) => /* @__PURE__ */ jsxs(
485
+ "svg",
486
+ {
487
+ width: size,
488
+ height: size,
489
+ viewBox: "0 0 24 24",
490
+ fill: "none",
491
+ stroke: "currentColor",
492
+ strokeWidth: 2.5,
493
+ strokeLinecap: "round",
494
+ strokeLinejoin: "round",
495
+ "aria-hidden": true,
496
+ children: [
497
+ /* @__PURE__ */ jsx("polyline", { points: "3 6 5 6 21 6" }),
498
+ /* @__PURE__ */ jsx("path", { d: "M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6" }),
499
+ /* @__PURE__ */ jsx("path", { d: "M10 11v6M14 11v6" }),
500
+ /* @__PURE__ */ jsx("path", { d: "M9 6V4a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2" })
501
+ ]
502
+ }
503
+ );
504
+ var XIcon = () => /* @__PURE__ */ jsxs(
505
+ "svg",
506
+ {
507
+ width: "11",
508
+ height: "11",
509
+ viewBox: "0 0 24 24",
510
+ fill: "none",
511
+ stroke: "currentColor",
512
+ strokeWidth: 2.5,
513
+ strokeLinecap: "round",
514
+ "aria-hidden": true,
515
+ children: [
516
+ /* @__PURE__ */ jsx("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
517
+ /* @__PURE__ */ jsx("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
518
+ ]
519
+ }
520
+ );
521
+ var Root3 = styled("div")(({ $fullWidth }) => ({
522
+ display: $fullWidth ? "block" : "inline-block",
523
+ width: $fullWidth ? "100%" : "auto"
524
+ }));
525
+ var HiddenInput2 = styled("input")({
526
+ position: "absolute",
527
+ width: 1,
528
+ height: 1,
529
+ margin: -1,
530
+ overflow: "hidden",
531
+ clip: "rect(0 0 0 0)",
532
+ whiteSpace: "nowrap",
533
+ borderWidth: 0
534
+ });
535
+ var CompactWrapper = styled("div")(({ theme, $size, $fullWidth, $error, $disabled }) => ({
536
+ display: "inline-flex",
537
+ alignItems: "center",
538
+ width: $fullWidth ? "100%" : "auto",
539
+ height: inputHeightMap[$size],
540
+ fontSize: inputSizeMap[$size].fontSize,
541
+ borderRadius: theme.shape.borderRadius,
542
+ border: "1px solid",
543
+ overflow: "hidden",
544
+ transition: "border-color 150ms ease, box-shadow 150ms ease",
545
+ backgroundColor: $disabled ? theme.palette.action.disabledBackground : theme.palette.background.paper,
546
+ ...$disabled ? { borderColor: theme.palette.action.disabled, pointerEvents: "none" } : {
547
+ borderColor: $error ? theme.palette.error.main : theme.palette.divider,
548
+ "&:hover:not(:focus-within)": {
549
+ borderColor: $error ? theme.palette.error.dark : theme.palette.text.secondary
550
+ },
551
+ "&:focus-within": {
552
+ borderColor: $error ? theme.palette.error.main : theme.palette.primary.main,
553
+ boxShadow: `0 0 0 3px ${alpha(
554
+ $error ? theme.palette.error.main : theme.palette.primary.main,
555
+ 0.2
556
+ )}`
557
+ }
558
+ }
559
+ }));
560
+ var BrowseBtn = styled("button")(
561
+ ({ theme, $size, $error }) => ({
562
+ flexShrink: 0,
563
+ display: "inline-flex",
564
+ alignItems: "center",
565
+ gap: "0.35rem",
566
+ height: "100%",
567
+ padding: inputSizeMap[$size].padding,
568
+ paddingBlock: 0,
569
+ border: "none",
570
+ borderRight: `1px solid ${alpha("#fff", 0.25)}`,
571
+ backgroundColor: $error ? theme.palette.error.main : theme.palette.primary.main,
572
+ color: "#fff",
573
+ fontFamily: theme.typography.fontFamily,
574
+ fontSize: "inherit",
575
+ fontWeight: 600,
576
+ letterSpacing: "0.01em",
577
+ cursor: "pointer",
578
+ transition: "background-color 150ms ease",
579
+ whiteSpace: "nowrap",
580
+ "&:hover:not(:disabled)": {
581
+ backgroundColor: $error ? theme.palette.error.dark : theme.palette.primary.dark
582
+ },
583
+ "&:active:not(:disabled)": { filter: "brightness(0.9)" },
584
+ "&:disabled": {
585
+ backgroundColor: theme.palette.action.disabled,
586
+ cursor: "not-allowed"
587
+ }
588
+ })
589
+ );
590
+ var CompactFileName = styled("span")(({ theme, $hasFile }) => ({
591
+ flex: 1,
592
+ overflow: "hidden",
593
+ textOverflow: "ellipsis",
594
+ whiteSpace: "nowrap",
595
+ padding: "0 0.5rem 0 0.75rem",
596
+ fontFamily: theme.typography.fontFamily,
597
+ fontSize: "inherit",
598
+ color: $hasFile ? theme.palette.text.primary : theme.palette.text.disabled
599
+ }));
600
+ var ClearBtn = styled("button")(({ theme }) => ({
601
+ flexShrink: 0,
602
+ display: "inline-flex",
603
+ alignItems: "center",
604
+ justifyContent: "center",
605
+ width: "1.5rem",
606
+ height: "1.5rem",
607
+ marginRight: "0.25rem",
608
+ border: "none",
609
+ background: "none",
610
+ color: theme.palette.text.secondary,
611
+ borderRadius: "50%",
612
+ cursor: "pointer",
613
+ transition: "color 150ms ease, background-color 150ms ease",
614
+ "&:hover": {
615
+ color: theme.palette.error.main,
616
+ backgroundColor: alpha(theme.palette.error.main, 0.08)
617
+ }
618
+ }));
619
+ var FileChipList = styled("div")({
620
+ display: "flex",
621
+ flexWrap: "wrap",
622
+ gap: "0.3rem",
623
+ marginTop: "0.375rem"
624
+ });
625
+ var FileChip = styled("div")(({ theme }) => ({
626
+ display: "inline-flex",
627
+ alignItems: "center",
628
+ gap: "0.25rem",
629
+ maxWidth: "220px",
630
+ padding: "0.1875rem 0.3125rem 0.1875rem 0.5rem",
631
+ borderRadius: "100px",
632
+ backgroundColor: alpha(theme.palette.primary.main, 0.07),
633
+ border: `1px solid ${alpha(theme.palette.primary.main, 0.18)}`,
634
+ fontFamily: theme.typography.fontFamily,
635
+ fontSize: "0.75rem",
636
+ color: theme.palette.text.primary
637
+ }));
638
+ var FileChipName = styled("span")({
639
+ overflow: "hidden",
640
+ textOverflow: "ellipsis",
641
+ whiteSpace: "nowrap",
642
+ flex: 1
643
+ });
644
+ var FileChipRemove = styled("button")(({ theme }) => ({
645
+ flexShrink: 0,
646
+ display: "inline-flex",
647
+ alignItems: "center",
648
+ justifyContent: "center",
649
+ width: "1rem",
650
+ height: "1rem",
651
+ padding: 0,
652
+ border: "none",
653
+ background: "none",
654
+ borderRadius: "50%",
655
+ color: theme.palette.text.secondary,
656
+ cursor: "pointer",
657
+ transition: "color 150ms ease, background-color 150ms ease",
658
+ "&:hover": {
659
+ color: theme.palette.error.main,
660
+ backgroundColor: alpha(theme.palette.error.main, 0.1)
661
+ }
662
+ }));
663
+ var dropzoneSizes = {
664
+ sm: { minHeight: "100px", padding: "1.125rem", iconSize: 16, circleSize: "2.25rem", fontSize: "0.75rem", subFontSize: "0.6875rem", gap: "0.375rem" },
665
+ md: { minHeight: "140px", padding: "1.5rem", iconSize: 20, circleSize: "2.875rem", fontSize: "0.875rem", subFontSize: "0.75rem", gap: "0.5rem" },
666
+ lg: { minHeight: "180px", padding: "2rem", iconSize: 26, circleSize: "3.5rem", fontSize: "1rem", subFontSize: "0.875rem", gap: "0.625rem" }
667
+ };
668
+ var DropzoneArea = styled("div")(({ theme, $size, $fullWidth, $error, $disabled, $isDragging, $hasFile }) => {
669
+ const ds = dropzoneSizes[$size];
670
+ const mainColor = $error ? theme.palette.error.main : theme.palette.primary.main;
671
+ const mainDark = $error ? theme.palette.error.dark : theme.palette.primary.dark;
672
+ return {
673
+ position: "relative",
674
+ display: $fullWidth ? "flex" : "inline-flex",
675
+ flexDirection: "column",
676
+ alignItems: "center",
677
+ justifyContent: "center",
678
+ textAlign: "center",
679
+ width: $fullWidth ? "100%" : "auto",
680
+ minWidth: $fullWidth ? void 0 : "240px",
681
+ minHeight: ds.minHeight,
682
+ padding: ds.padding,
683
+ gap: ds.gap,
684
+ borderRadius: theme.shape.borderRadius * 2,
685
+ border: "2px dashed",
686
+ transition: "border-color 200ms ease, background-color 200ms ease, box-shadow 200ms ease, transform 200ms ease",
687
+ ...$disabled ? {
688
+ borderColor: theme.palette.action.disabled,
689
+ backgroundColor: theme.palette.action.disabledBackground,
690
+ color: theme.palette.action.disabled
691
+ } : $isDragging ? {
692
+ borderStyle: "solid",
693
+ borderColor: mainColor,
694
+ backgroundColor: alpha(mainColor, 0.06),
695
+ color: mainColor,
696
+ transform: "scale(1.01)",
697
+ boxShadow: `0 0 0 3px ${alpha(mainColor, 0.2)}`
698
+ } : $hasFile ? {
699
+ borderStyle: "solid",
700
+ borderColor: $error ? theme.palette.error.main : theme.palette.primary.main,
701
+ backgroundColor: alpha(mainColor, 0.03),
702
+ color: theme.palette.text.secondary
703
+ } : {
704
+ borderColor: $error ? theme.palette.error.main : theme.palette.divider,
705
+ backgroundColor: theme.palette.background.paper,
706
+ color: theme.palette.text.secondary,
707
+ "&:hover": {
708
+ borderColor: $error ? mainDark : theme.palette.text.secondary,
709
+ backgroundColor: alpha(mainColor, 0.04)
710
+ }
711
+ }
712
+ };
713
+ });
714
+ var DropzoneClickBtn = styled("button")(({ theme, $size }) => {
715
+ const ds = dropzoneSizes[$size];
716
+ return {
717
+ display: "flex",
718
+ flexDirection: "column",
719
+ alignItems: "center",
720
+ justifyContent: "center",
721
+ gap: ds.gap,
722
+ width: "100%",
723
+ padding: 0,
724
+ border: "none",
725
+ background: "none",
726
+ cursor: "pointer",
727
+ color: "inherit",
728
+ fontFamily: theme.typography.fontFamily,
729
+ borderRadius: theme.shape.borderRadius,
730
+ transition: "box-shadow 150ms ease",
731
+ "&:focus-visible": {
732
+ boxShadow: `0 0 0 2px ${theme.palette.primary.main}`,
733
+ outline: "none"
734
+ },
735
+ "&:disabled": { cursor: "not-allowed" }
736
+ };
737
+ });
738
+ var DropzoneIconWrap = styled("span")(({ $isDragging }) => ({
739
+ display: "inline-flex",
740
+ transition: "transform 200ms ease",
741
+ transform: $isDragging ? "translateY(-3px)" : "translateY(0)"
742
+ }));
743
+ var DropzoneText = styled("p")(({ theme, $sub }) => ({
744
+ margin: 0,
745
+ fontFamily: theme.typography.fontFamily,
746
+ fontWeight: $sub ? 400 : 500,
747
+ color: "inherit"
748
+ }));
749
+ var BrowseLink = styled("span")(({ theme }) => ({
750
+ color: theme.palette.primary.dark,
751
+ fontWeight: 700,
752
+ textDecoration: "underline",
753
+ textDecorationThickness: "1px",
754
+ textUnderlineOffset: "2px"
755
+ }));
756
+ var FileIconCircle = styled("div")(({ theme, $size }) => ({
757
+ width: dropzoneSizes[$size].circleSize,
758
+ height: dropzoneSizes[$size].circleSize,
759
+ borderRadius: "50%",
760
+ backgroundColor: alpha(theme.palette.primary.main, 0.1),
761
+ display: "flex",
762
+ alignItems: "center",
763
+ justifyContent: "center",
764
+ color: theme.palette.primary.main,
765
+ flexShrink: 0
766
+ }));
767
+ var FileDisplayName = styled("p")(({ theme, $size }) => ({
768
+ margin: 0,
769
+ fontFamily: theme.typography.fontFamily,
770
+ fontWeight: 600,
771
+ fontSize: dropzoneSizes[$size].fontSize,
772
+ color: theme.palette.text.primary,
773
+ maxWidth: "260px",
774
+ overflow: "hidden",
775
+ textOverflow: "ellipsis",
776
+ whiteSpace: "nowrap"
777
+ }));
778
+ var FileDisplayMeta = styled("p")(({ theme, $size }) => ({
779
+ margin: 0,
780
+ fontFamily: theme.typography.fontFamily,
781
+ fontWeight: 400,
782
+ fontSize: dropzoneSizes[$size].subFontSize,
783
+ color: theme.palette.text.secondary
784
+ }));
785
+ var FileListContainer = styled("div")({
786
+ display: "flex",
787
+ flexDirection: "column",
788
+ gap: "0.3rem",
789
+ width: "100%",
790
+ maxWidth: "340px",
791
+ maxHeight: "160px",
792
+ overflowY: "auto"
793
+ });
794
+ var FileListRow = styled("div")(({ theme }) => ({
795
+ display: "flex",
796
+ alignItems: "center",
797
+ gap: "0.5rem",
798
+ padding: "0.3125rem 0.5rem",
799
+ borderRadius: theme.shape.borderRadius,
800
+ backgroundColor: alpha(theme.palette.primary.main, 0.05),
801
+ border: `1px solid ${alpha(theme.palette.primary.main, 0.14)}`,
802
+ textAlign: "left"
803
+ }));
804
+ var FileListRowIcon = styled("span")(({ theme }) => ({
805
+ flexShrink: 0,
806
+ display: "inline-flex",
807
+ color: theme.palette.primary.main
808
+ }));
809
+ var FileListRowBody = styled("span")({
810
+ flex: 1,
811
+ overflow: "hidden",
812
+ display: "flex",
813
+ flexDirection: "column",
814
+ gap: "0.05rem"
815
+ });
816
+ var FileListRowName = styled("span")(({ theme }) => ({
817
+ fontFamily: theme.typography.fontFamily,
818
+ fontSize: "0.8125rem",
819
+ fontWeight: 500,
820
+ color: theme.palette.text.primary,
821
+ overflow: "hidden",
822
+ textOverflow: "ellipsis",
823
+ whiteSpace: "nowrap"
824
+ }));
825
+ var FileListRowSize = styled("span")(({ theme }) => ({
826
+ fontFamily: theme.typography.fontFamily,
827
+ fontSize: "0.6875rem",
828
+ color: theme.palette.text.secondary
829
+ }));
830
+ var FileListRowRemove = styled("button")(({ theme }) => ({
831
+ flexShrink: 0,
832
+ display: "inline-flex",
833
+ alignItems: "center",
834
+ justifyContent: "center",
835
+ width: "1.25rem",
836
+ height: "1.25rem",
837
+ border: "none",
838
+ background: "none",
839
+ borderRadius: "50%",
840
+ color: theme.palette.text.secondary,
841
+ cursor: "pointer",
842
+ transition: "color 150ms ease, background-color 150ms ease",
843
+ "&:hover": {
844
+ color: theme.palette.error.main,
845
+ backgroundColor: alpha(theme.palette.error.main, 0.1)
846
+ }
847
+ }));
848
+ var FileActionsRow = styled("div")({
849
+ display: "flex",
850
+ alignItems: "center",
851
+ gap: "0.5rem",
852
+ marginTop: "0.25rem"
853
+ });
854
+ var FileActionBtn = styled("button")(
855
+ ({ theme, $variant }) => {
856
+ const isRemove = $variant === "remove";
857
+ return {
858
+ display: "inline-flex",
859
+ alignItems: "center",
860
+ gap: "0.3rem",
861
+ padding: "0.25rem 0.75rem",
862
+ border: "1px solid",
863
+ borderColor: isRemove ? theme.palette.error.main : theme.palette.divider,
864
+ borderRadius: "100px",
865
+ background: "none",
866
+ fontFamily: theme.typography.fontFamily,
867
+ fontSize: "0.75rem",
868
+ fontWeight: 500,
869
+ color: isRemove ? theme.palette.error.main : theme.palette.text.secondary,
870
+ cursor: "pointer",
871
+ transition: "background-color 150ms ease, border-color 150ms ease, color 150ms ease",
872
+ whiteSpace: "nowrap",
873
+ "&:hover": isRemove ? {
874
+ backgroundColor: alpha(theme.palette.error.main, 0.06),
875
+ borderColor: theme.palette.error.dark,
876
+ color: theme.palette.error.dark
877
+ } : {
878
+ backgroundColor: theme.palette.action.hover,
879
+ borderColor: theme.palette.text.secondary,
880
+ color: theme.palette.text.primary
881
+ },
882
+ "&:active": { filter: "brightness(0.93)" },
883
+ "&:disabled": { opacity: 0.5, cursor: "not-allowed" }
884
+ };
885
+ }
886
+ );
887
+ var FileInput = forwardRef(
888
+ ({
889
+ label,
890
+ helperText,
891
+ error = false,
892
+ size = "md",
893
+ fullWidth = false,
894
+ disabled = false,
895
+ variant = "compact",
896
+ browseLabel = "Przegl\u0105daj",
897
+ noFileLabel = "Nie wybrano pliku",
898
+ dropzoneLabel,
899
+ dropzoneSublabel,
900
+ dropToUploadLabel = "Upu\u015B\u0107, by wgra\u0107",
901
+ filesSelectedLabel = (n) => `Wybrano ${n} pliki/plik\xF3w`,
902
+ removeLabel = "Usu\u0144",
903
+ removeAllLabel = "Usu\u0144 wszystkie",
904
+ changeLabel = "Zmie\u0144",
905
+ clearAriaLabel = "Wyczy\u015B\u0107 wyb\xF3r pliku",
906
+ removeFileAriaLabel = (name) => `Usu\u0144 ${name}`,
907
+ removeAllAriaLabel = "Usu\u0144 wszystkie pliki",
908
+ changeAriaLabel = "Zmie\u0144 plik",
909
+ chooseFileAriaLabel = "Wybierz plik",
910
+ id,
911
+ multiple,
912
+ onChange,
913
+ ...rest
914
+ }, ref) => {
915
+ const autoId = useId();
916
+ const inputId = id ?? autoId;
917
+ const innerRef = useRef(null);
918
+ const [files, setFiles] = useState([]);
919
+ const [isDragging, setIsDragging] = useState(false);
920
+ const assignRef = (node) => {
921
+ innerRef.current = node;
922
+ if (typeof ref === "function") ref(node);
923
+ else if (ref) ref.current = node;
924
+ };
925
+ const openPicker = () => {
926
+ if (!disabled) innerRef.current?.click();
927
+ };
928
+ const handleChange = (e) => {
929
+ const list = e.target.files;
930
+ setFiles(list && list.length > 0 ? Array.from(list) : []);
931
+ onChange?.(e);
932
+ };
933
+ const handleClear = (e) => {
934
+ e.stopPropagation();
935
+ setFiles([]);
936
+ if (innerRef.current) innerRef.current.value = "";
937
+ };
938
+ const handleRemoveFile = (index) => (e) => {
939
+ e.stopPropagation();
940
+ setFiles((prev) => {
941
+ const next = prev.filter((_, i) => i !== index);
942
+ if (innerRef.current && next.length === 0) innerRef.current.value = "";
943
+ return next;
944
+ });
945
+ };
946
+ const handleDragOver = (e) => {
947
+ e.preventDefault();
948
+ if (!disabled) setIsDragging(true);
949
+ };
950
+ const handleDragLeave = (e) => {
951
+ e.preventDefault();
952
+ setIsDragging(false);
953
+ };
954
+ const handleDrop = (e) => {
955
+ e.preventDefault();
956
+ setIsDragging(false);
957
+ if (disabled || !innerRef.current) return;
958
+ const dropped = Array.from(e.dataTransfer.files);
959
+ const picked = multiple ? dropped : [dropped[0]].filter(Boolean);
960
+ if (picked.length === 0) return;
961
+ setFiles(picked);
962
+ try {
963
+ const dt = new DataTransfer();
964
+ picked.forEach((f) => dt.items.add(f));
965
+ innerRef.current.files = dt.files;
966
+ } catch {
967
+ }
968
+ };
969
+ const hasFiles = files.length > 0;
970
+ const isMultiFile = files.length > 1;
971
+ const ds = dropzoneSizes[size];
972
+ const compactLabel = hasFiles ? files.length === 1 ? files[0].name : filesSelectedLabel(files.length) : noFileLabel;
973
+ const hiddenInput = /* @__PURE__ */ jsx(
974
+ HiddenInput2,
975
+ {
976
+ ref: assignRef,
977
+ id: inputId,
978
+ type: "file",
979
+ disabled,
980
+ multiple,
981
+ onChange: handleChange,
982
+ ...rest
983
+ }
984
+ );
985
+ if (variant === "dropzone") {
986
+ return /* @__PURE__ */ jsxs(Root3, { $fullWidth: fullWidth, children: [
987
+ label && /* @__PURE__ */ jsx(Label, { htmlFor: inputId, error, size, children: label }),
988
+ /* @__PURE__ */ jsxs(
989
+ DropzoneArea,
990
+ {
991
+ $size: size,
992
+ $fullWidth: fullWidth,
993
+ $error: error,
994
+ $disabled: disabled,
995
+ $isDragging: isDragging,
996
+ $hasFile: hasFiles,
997
+ onDragOver: handleDragOver,
998
+ onDragLeave: handleDragLeave,
999
+ onDrop: handleDrop,
1000
+ children: [
1001
+ hiddenInput,
1002
+ hasFiles ? isMultiFile ? (
1003
+ // ── multiple files: scrollable list ──
1004
+ /* @__PURE__ */ jsxs(Fragment, { children: [
1005
+ /* @__PURE__ */ jsx(FileListContainer, { children: files.map((file, i) => /* @__PURE__ */ jsxs(FileListRow, { children: [
1006
+ /* @__PURE__ */ jsx(FileListRowIcon, { children: /* @__PURE__ */ jsx(FileDocIcon, { size: 14 }) }),
1007
+ /* @__PURE__ */ jsxs(FileListRowBody, { children: [
1008
+ /* @__PURE__ */ jsx(FileListRowName, { title: file.name, children: file.name }),
1009
+ /* @__PURE__ */ jsx(FileListRowSize, { children: formatSize(file.size) })
1010
+ ] }),
1011
+ /* @__PURE__ */ jsx(
1012
+ FileListRowRemove,
1013
+ {
1014
+ type: "button",
1015
+ onClick: handleRemoveFile(i),
1016
+ "aria-label": removeFileAriaLabel(file.name),
1017
+ children: /* @__PURE__ */ jsx(XIcon, {})
1018
+ }
1019
+ )
1020
+ ] }, `${file.name}-${i}`)) }),
1021
+ /* @__PURE__ */ jsxs(FileActionsRow, { children: [
1022
+ /* @__PURE__ */ jsxs(
1023
+ FileActionBtn,
1024
+ {
1025
+ type: "button",
1026
+ $variant: "remove",
1027
+ onClick: handleClear,
1028
+ "aria-label": removeAllAriaLabel,
1029
+ children: [
1030
+ /* @__PURE__ */ jsx(TrashIcon, {}),
1031
+ removeAllLabel
1032
+ ]
1033
+ }
1034
+ ),
1035
+ /* @__PURE__ */ jsxs(
1036
+ FileActionBtn,
1037
+ {
1038
+ type: "button",
1039
+ $variant: "replace",
1040
+ onClick: openPicker,
1041
+ disabled,
1042
+ "aria-label": changeAriaLabel,
1043
+ children: [
1044
+ /* @__PURE__ */ jsx(UploadArrowIcon, { size: 11 }),
1045
+ changeLabel
1046
+ ]
1047
+ }
1048
+ )
1049
+ ] })
1050
+ ] })
1051
+ ) : (
1052
+ // ── single file: icon card ──
1053
+ /* @__PURE__ */ jsxs(Fragment, { children: [
1054
+ /* @__PURE__ */ jsx(FileIconCircle, { $size: size, children: /* @__PURE__ */ jsx(FileDocIcon, { size: dropzoneSizes[size].iconSize }) }),
1055
+ /* @__PURE__ */ jsx(FileDisplayName, { $size: size, title: files[0].name, children: files[0].name }),
1056
+ /* @__PURE__ */ jsx(FileDisplayMeta, { $size: size, children: formatSize(files[0].size) }),
1057
+ /* @__PURE__ */ jsxs(FileActionsRow, { children: [
1058
+ /* @__PURE__ */ jsxs(
1059
+ FileActionBtn,
1060
+ {
1061
+ type: "button",
1062
+ $variant: "remove",
1063
+ onClick: handleClear,
1064
+ "aria-label": removeLabel,
1065
+ children: [
1066
+ /* @__PURE__ */ jsx(TrashIcon, {}),
1067
+ removeLabel
1068
+ ]
1069
+ }
1070
+ ),
1071
+ /* @__PURE__ */ jsxs(
1072
+ FileActionBtn,
1073
+ {
1074
+ type: "button",
1075
+ $variant: "replace",
1076
+ onClick: openPicker,
1077
+ disabled,
1078
+ "aria-label": changeAriaLabel,
1079
+ children: [
1080
+ /* @__PURE__ */ jsx(UploadArrowIcon, { size: 11 }),
1081
+ changeLabel
1082
+ ]
1083
+ }
1084
+ )
1085
+ ] })
1086
+ ] })
1087
+ ) : (
1088
+ // ── empty: click-to-browse ──
1089
+ /* @__PURE__ */ jsxs(
1090
+ DropzoneClickBtn,
1091
+ {
1092
+ type: "button",
1093
+ $size: size,
1094
+ disabled,
1095
+ onClick: openPicker,
1096
+ "aria-label": label ? void 0 : chooseFileAriaLabel,
1097
+ children: [
1098
+ /* @__PURE__ */ jsx(DropzoneIconWrap, { $isDragging: isDragging, children: /* @__PURE__ */ jsx(CloudUploadIcon, { size: ds.iconSize + 8 }) }),
1099
+ /* @__PURE__ */ jsx(DropzoneText, { style: { fontSize: ds.fontSize }, children: isDragging ? dropToUploadLabel : dropzoneLabel ?? /* @__PURE__ */ jsxs(Fragment, { children: [
1100
+ "Upu\u015B\u0107 pliki lub ",
1101
+ /* @__PURE__ */ jsx(BrowseLink, { children: "przegl\u0105daj" })
1102
+ ] }) }),
1103
+ dropzoneSublabel && /* @__PURE__ */ jsx(DropzoneText, { $sub: true, style: { fontSize: ds.subFontSize }, children: dropzoneSublabel })
1104
+ ]
1105
+ }
1106
+ )
1107
+ )
1108
+ ]
1109
+ }
1110
+ ),
1111
+ helperText && /* @__PURE__ */ jsx(HelperText, { error, children: helperText })
1112
+ ] });
1113
+ }
1114
+ return /* @__PURE__ */ jsxs(Root3, { $fullWidth: fullWidth, children: [
1115
+ label && /* @__PURE__ */ jsx(Label, { htmlFor: inputId, error, size, children: label }),
1116
+ /* @__PURE__ */ jsxs(
1117
+ CompactWrapper,
1118
+ {
1119
+ $size: size,
1120
+ $fullWidth: fullWidth,
1121
+ $error: error,
1122
+ $disabled: disabled,
1123
+ "data-disabled": disabled || void 0,
1124
+ onDragOver: handleDragOver,
1125
+ onDragLeave: handleDragLeave,
1126
+ onDrop: handleDrop,
1127
+ children: [
1128
+ hiddenInput,
1129
+ /* @__PURE__ */ jsxs(
1130
+ BrowseBtn,
1131
+ {
1132
+ type: "button",
1133
+ $size: size,
1134
+ $error: error,
1135
+ disabled,
1136
+ onClick: openPicker,
1137
+ children: [
1138
+ /* @__PURE__ */ jsx(UploadArrowIcon, {}),
1139
+ browseLabel
1140
+ ]
1141
+ }
1142
+ ),
1143
+ /* @__PURE__ */ jsx(CompactFileName, { $hasFile: hasFiles, children: compactLabel }),
1144
+ hasFiles && /* @__PURE__ */ jsx(
1145
+ ClearBtn,
1146
+ {
1147
+ type: "button",
1148
+ onClick: handleClear,
1149
+ "aria-label": clearAriaLabel,
1150
+ tabIndex: -1,
1151
+ children: /* @__PURE__ */ jsx(XIcon, {})
1152
+ }
1153
+ )
1154
+ ]
1155
+ }
1156
+ ),
1157
+ hasFiles && isMultiFile && /* @__PURE__ */ jsx(FileChipList, { children: files.map((file, i) => /* @__PURE__ */ jsxs(FileChip, { children: [
1158
+ /* @__PURE__ */ jsx(FileChipName, { title: file.name, children: file.name }),
1159
+ /* @__PURE__ */ jsx(
1160
+ FileChipRemove,
1161
+ {
1162
+ type: "button",
1163
+ onClick: handleRemoveFile(i),
1164
+ "aria-label": removeFileAriaLabel(file.name),
1165
+ children: /* @__PURE__ */ jsx(XIcon, {})
1166
+ }
1167
+ )
1168
+ ] }, `${file.name}-${i}`)) }),
1169
+ helperText && /* @__PURE__ */ jsx(HelperText, { error, children: helperText })
1170
+ ] });
1171
+ }
1172
+ );
1173
+ FileInput.displayName = "FileInput";
1174
+ var LOCAL_CHAR = /^[a-zA-Z0-9._+-]$/;
1175
+ var DOMAIN_CHAR = /^[a-zA-Z0-9.-]$/;
1176
+ var filterEmailString = (value) => {
1177
+ const atIdx = value.indexOf("@");
1178
+ if (atIdx === -1) {
1179
+ return value.replace(/[^a-zA-Z0-9._+-]/g, "");
1180
+ }
1181
+ const local = value.slice(0, atIdx).replace(/[^a-zA-Z0-9._+-]/g, "");
1182
+ const domain = value.slice(atIdx + 1).replace(/@/g, "").replace(/[^a-zA-Z0-9.-]/g, "");
1183
+ return `${local}@${domain}`;
1184
+ };
1185
+ var EmailInput = forwardRef(
1186
+ ({ onKeyDown, onPaste, ...props }, ref) => {
1187
+ const handleKeyDown = (e) => {
1188
+ onKeyDown?.(e);
1189
+ if (e.defaultPrevented) return;
1190
+ if (e.ctrlKey || e.metaKey || e.altKey || e.key.length > 1) return;
1191
+ const input = e.currentTarget;
1192
+ const { value } = input;
1193
+ const atIdx = value.indexOf("@");
1194
+ const hasAt = atIdx !== -1;
1195
+ const cursor = input.selectionStart ?? value.length;
1196
+ if (e.key === "@") {
1197
+ if (hasAt) e.preventDefault();
1198
+ return;
1199
+ }
1200
+ const inDomain = hasAt && cursor > atIdx;
1201
+ if (!(inDomain ? DOMAIN_CHAR : LOCAL_CHAR).test(e.key)) {
1202
+ e.preventDefault();
1203
+ }
1204
+ };
1205
+ const handlePaste = (e) => {
1206
+ onPaste?.(e);
1207
+ if (e.defaultPrevented) return;
1208
+ e.preventDefault();
1209
+ const input = e.currentTarget;
1210
+ const pasted = e.clipboardData.getData("text");
1211
+ const start = input.selectionStart ?? 0;
1212
+ const end = input.selectionEnd ?? 0;
1213
+ const merged = input.value.slice(0, start) + pasted + input.value.slice(end);
1214
+ const filtered = filterEmailString(merged);
1215
+ const setter = Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype, "value")?.set;
1216
+ setter?.call(input, filtered);
1217
+ input.dispatchEvent(new Event("input", { bubbles: true }));
1218
+ };
1219
+ return /* @__PURE__ */ jsx(
1220
+ BaseInput,
1221
+ {
1222
+ ref,
1223
+ type: "email",
1224
+ onKeyDown: handleKeyDown,
1225
+ onPaste: handlePaste,
1226
+ ...props
1227
+ }
1228
+ );
1229
+ }
1230
+ );
1231
+ EmailInput.displayName = "EmailInput";
1232
+ var triggerColors = (theme, error, open) => ({
1233
+ borderColor: open ? error ? theme.palette.error.main : theme.palette.primary.main : error ? theme.palette.error.main : theme.palette.divider,
1234
+ boxShadow: open ? `0 0 0 3px ${error ? theme.palette.error.main : theme.palette.primary.main}33` : "none",
1235
+ "&:hover:not(:disabled)": {
1236
+ borderColor: error ? theme.palette.error.dark : theme.palette.text.secondary
1237
+ }
1238
+ });
1239
+ var Root4 = styled("div")(({ $fullWidth }) => ({
1240
+ display: $fullWidth ? "block" : "inline-block",
1241
+ width: $fullWidth ? "100%" : "auto",
1242
+ position: "relative"
1243
+ }));
1244
+ var Trigger = styled("button")(
1245
+ ({ theme, $size, $fullWidth, $error, $open }) => ({
1246
+ display: "inline-flex",
1247
+ alignItems: "center",
1248
+ width: $fullWidth ? "100%" : "auto",
1249
+ borderRadius: theme.shape.borderRadius,
1250
+ border: "1px solid",
1251
+ backgroundColor: theme.palette.background.paper,
1252
+ fontFamily: theme.typography.fontFamily,
1253
+ color: theme.palette.text.primary,
1254
+ cursor: "pointer",
1255
+ transition: "border-color 150ms ease, box-shadow 150ms ease",
1256
+ outline: "none",
1257
+ textAlign: "left",
1258
+ ...inputSizeMap[$size],
1259
+ height: inputHeightMap[$size],
1260
+ paddingBlock: 0,
1261
+ ...triggerColors(theme, $error, $open),
1262
+ "&:disabled": {
1263
+ backgroundColor: theme.palette.action.disabledBackground,
1264
+ borderColor: theme.palette.action.disabled,
1265
+ color: theme.palette.action.disabled,
1266
+ cursor: "not-allowed",
1267
+ pointerEvents: "none"
1268
+ }
1269
+ })
1270
+ );
1271
+ var TriggerContent = styled("span")({
1272
+ flex: 1,
1273
+ overflow: "hidden",
1274
+ textOverflow: "ellipsis",
1275
+ whiteSpace: "nowrap"
1276
+ });
1277
+ var ChevronWrapper = styled("span")(({ $open }) => ({
1278
+ display: "inline-flex",
1279
+ alignItems: "center",
1280
+ flexShrink: 0,
1281
+ marginLeft: "0.5rem",
1282
+ transition: "transform 150ms ease",
1283
+ transform: $open ? "rotate(180deg)" : "rotate(0deg)"
1284
+ }));
1285
+ var DropdownPanel2 = styled(DropdownPanel)({
1286
+ right: 0,
1287
+ maxHeight: "240px",
1288
+ overflowY: "auto"
1289
+ });
1290
+ var OptionItem = styled("div")(
1291
+ ({ theme, $disabled, $size }) => ({
1292
+ padding: "0.5rem 0.75rem",
1293
+ cursor: $disabled ? "not-allowed" : "pointer",
1294
+ fontSize: inputSizeMap[$size].fontSize,
1295
+ fontFamily: theme.typography.fontFamily,
1296
+ color: $disabled ? theme.palette.action.disabled : theme.palette.text.primary,
1297
+ ...!$disabled && {
1298
+ "&:hover": {
1299
+ backgroundColor: theme.palette.action.hover
1300
+ }
1301
+ }
1302
+ })
1303
+ );
1304
+ var DEFAULT_PLACEHOLDER = "Wybierz\u2026";
1305
+ var BaseSelectInput = ({
1306
+ options,
1307
+ value,
1308
+ placeholder = DEFAULT_PLACEHOLDER,
1309
+ onSelect,
1310
+ renderTrigger: renderTrigger2,
1311
+ renderOption: renderOption3,
1312
+ isSelected,
1313
+ open: controlledOpen,
1314
+ onOpenChange,
1315
+ label,
1316
+ helperText,
1317
+ error = false,
1318
+ size = "md",
1319
+ fullWidth = false,
1320
+ disabled = false,
1321
+ id
1322
+ }) => {
1323
+ const checkSelected = isSelected ?? ((option) => option.value === value);
1324
+ const autoId = useId();
1325
+ const inputId = id ?? autoId;
1326
+ const listboxId = `${inputId}-listbox`;
1327
+ const [internalOpen, setInternalOpen] = useState(false);
1328
+ const isOpen = controlledOpen ?? internalOpen;
1329
+ const rootRef = useRef(null);
1330
+ const close = useCallback(() => {
1331
+ setInternalOpen(false);
1332
+ onOpenChange?.(false);
1333
+ }, [onOpenChange]);
1334
+ const toggle = () => {
1335
+ const next = !isOpen;
1336
+ setInternalOpen(next);
1337
+ onOpenChange?.(next);
1338
+ };
1339
+ const handleSelect = (option) => {
1340
+ if (!option.disabled) {
1341
+ onSelect?.(option, close);
1342
+ }
1343
+ };
1344
+ useEffect(() => {
1345
+ if (!isOpen) return;
1346
+ const handleMouseDown = (e) => {
1347
+ if (rootRef.current && !rootRef.current.contains(e.target)) {
1348
+ close();
1349
+ }
1350
+ };
1351
+ document.addEventListener("mousedown", handleMouseDown);
1352
+ return () => document.removeEventListener("mousedown", handleMouseDown);
1353
+ }, [isOpen, close]);
1354
+ const selectedLabel = options.find((o) => o.value === value)?.label;
1355
+ const defaultTriggerContent = /* @__PURE__ */ jsx("span", { style: { opacity: selectedLabel ? 1 : 0.5 }, children: selectedLabel ?? placeholder });
1356
+ return /* @__PURE__ */ jsxs(Root4, { $fullWidth: fullWidth, ref: rootRef, children: [
1357
+ label && /* @__PURE__ */ jsx(Label, { htmlFor: inputId, error, size, children: label }),
1358
+ /* @__PURE__ */ jsxs(
1359
+ Trigger,
1360
+ {
1361
+ type: "button",
1362
+ id: inputId,
1363
+ disabled,
1364
+ "aria-haspopup": "listbox",
1365
+ "aria-expanded": isOpen,
1366
+ "aria-controls": isOpen ? listboxId : void 0,
1367
+ onClick: toggle,
1368
+ onKeyDown: (e) => e.key === "Escape" && close(),
1369
+ $size: size,
1370
+ $fullWidth: fullWidth,
1371
+ $error: error,
1372
+ $open: isOpen,
1373
+ children: [
1374
+ /* @__PURE__ */ jsx(TriggerContent, { children: renderTrigger2 ? renderTrigger2() : defaultTriggerContent }),
1375
+ /* @__PURE__ */ jsx(ChevronWrapper, { $open: isOpen, children: /* @__PURE__ */ jsx(Chevron, {}) })
1376
+ ]
1377
+ }
1378
+ ),
1379
+ isOpen && /* @__PURE__ */ jsx(DropdownPanel2, { id: listboxId, role: "listbox", children: options.map((option) => /* @__PURE__ */ jsx(
1380
+ OptionItem,
1381
+ {
1382
+ role: "option",
1383
+ "aria-selected": checkSelected(option),
1384
+ "aria-disabled": option.disabled,
1385
+ $disabled: !!option.disabled,
1386
+ $size: size,
1387
+ onClick: () => handleSelect(option),
1388
+ onKeyDown: (e) => e.key === "Enter" && handleSelect(option),
1389
+ tabIndex: option.disabled ? -1 : 0,
1390
+ children: renderOption3 ? renderOption3(option) : option.label
1391
+ },
1392
+ option.value
1393
+ )) }),
1394
+ helperText && /* @__PURE__ */ jsx(HelperText, { error, children: helperText })
1395
+ ] });
1396
+ };
1397
+ BaseSelectInput.displayName = "BaseSelectInput";
1398
+ var NumberInput = forwardRef(
1399
+ (props, ref) => /* @__PURE__ */ jsx(BaseInput, { ref, type: "number", ...props })
1400
+ );
1401
+ NumberInput.displayName = "NumberInput";
1402
+ var ChipList = styled("span")({
1403
+ display: "flex",
1404
+ flexWrap: "wrap",
1405
+ gap: "0.25rem",
1406
+ overflow: "hidden"
1407
+ });
1408
+ var Chip = styled("span")(({ theme }) => ({
1409
+ display: "inline-flex",
1410
+ alignItems: "center",
1411
+ padding: "0.125rem 0.375rem",
1412
+ borderRadius: "0.25rem",
1413
+ backgroundColor: theme.palette.primary.main + "22",
1414
+ color: theme.palette.primary.main,
1415
+ fontSize: "0.75em",
1416
+ fontWeight: 500,
1417
+ lineHeight: 1.5,
1418
+ whiteSpace: "nowrap",
1419
+ flexShrink: 0
1420
+ }));
1421
+ var OptionRow = styled("span")({
1422
+ display: "flex",
1423
+ alignItems: "center",
1424
+ gap: "0.5rem"
1425
+ });
1426
+ var CheckboxBox = styled("span")(({ theme, $checked }) => ({
1427
+ display: "inline-flex",
1428
+ alignItems: "center",
1429
+ justifyContent: "center",
1430
+ width: "1rem",
1431
+ height: "1rem",
1432
+ border: `2px solid ${$checked ? theme.palette.primary.main : theme.palette.divider}`,
1433
+ borderRadius: "2px",
1434
+ backgroundColor: $checked ? theme.palette.primary.main : "transparent",
1435
+ color: theme.palette.primary.contrastText,
1436
+ flexShrink: 0,
1437
+ transition: "background-color 150ms ease, border-color 150ms ease"
1438
+ }));
1439
+ var CheckmarkIcon = () => /* @__PURE__ */ jsx(
1440
+ "svg",
1441
+ {
1442
+ viewBox: "0 0 24 24",
1443
+ width: "0.65rem",
1444
+ height: "0.65rem",
1445
+ fill: "none",
1446
+ stroke: "currentColor",
1447
+ strokeWidth: 3,
1448
+ strokeLinecap: "round",
1449
+ strokeLinejoin: "round",
1450
+ "aria-hidden": true,
1451
+ children: /* @__PURE__ */ jsx("polyline", { points: "20 6 9 17 4 12" })
1452
+ }
1453
+ );
1454
+ var renderTrigger = (value, options, placeholder) => {
1455
+ const MultiSelectTrigger = () => {
1456
+ if (value.length === 0) {
1457
+ return /* @__PURE__ */ jsx("span", { style: { opacity: 0.5 }, children: placeholder });
1458
+ }
1459
+ return /* @__PURE__ */ jsx(ChipList, { children: value.map((v) => {
1460
+ const label = options.find((o) => o.value === v)?.label ?? v;
1461
+ return /* @__PURE__ */ jsx(Chip, { children: label }, v);
1462
+ }) });
1463
+ };
1464
+ MultiSelectTrigger.displayName = "MultiSelectTrigger";
1465
+ return MultiSelectTrigger;
1466
+ };
1467
+ var renderOption = (value) => {
1468
+ const MultiSelectOption = (option) => /* @__PURE__ */ jsxs(OptionRow, { children: [
1469
+ /* @__PURE__ */ jsx(CheckboxBox, { $checked: value.includes(option.value), children: value.includes(option.value) && /* @__PURE__ */ jsx(CheckmarkIcon, {}) }),
1470
+ option.label
1471
+ ] });
1472
+ MultiSelectOption.displayName = "MultiSelectOption";
1473
+ return MultiSelectOption;
1474
+ };
1475
+ var MultiSelectInput = ({
1476
+ value = [],
1477
+ onChange,
1478
+ options,
1479
+ placeholder = "Wybierz\u2026",
1480
+ ...rest
1481
+ }) => /* @__PURE__ */ jsx(
1482
+ BaseSelectInput,
1483
+ {
1484
+ options,
1485
+ placeholder,
1486
+ onSelect: (option) => {
1487
+ const next = value.includes(option.value) ? value.filter((v) => v !== option.value) : [...value, option.value];
1488
+ onChange?.(next);
1489
+ },
1490
+ isSelected: (option) => value.includes(option.value),
1491
+ renderTrigger: renderTrigger(value, options, placeholder),
1492
+ renderOption: renderOption(value),
1493
+ ...rest
1494
+ }
1495
+ );
1496
+ MultiSelectInput.displayName = "MultiSelectInput";
1497
+ var ToggleButton = styled("button")(({ theme }) => ({
1498
+ background: "none",
1499
+ border: "none",
1500
+ padding: 0,
1501
+ cursor: "pointer",
1502
+ color: theme.palette.text.secondary,
1503
+ display: "inline-flex",
1504
+ alignItems: "center",
1505
+ flexShrink: 0,
1506
+ "&:hover": {
1507
+ color: theme.palette.text.primary
1508
+ },
1509
+ "&:disabled": {
1510
+ color: theme.palette.action.disabled,
1511
+ cursor: "not-allowed"
1512
+ }
1513
+ }));
1514
+ var EyeIcon = () => /* @__PURE__ */ jsxs(
1515
+ "svg",
1516
+ {
1517
+ viewBox: "0 0 24 24",
1518
+ width: "1em",
1519
+ height: "1em",
1520
+ fill: "none",
1521
+ stroke: "currentColor",
1522
+ strokeWidth: 2,
1523
+ strokeLinecap: "round",
1524
+ strokeLinejoin: "round",
1525
+ "aria-hidden": true,
1526
+ children: [
1527
+ /* @__PURE__ */ jsx("path", { d: "M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z" }),
1528
+ /* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "3" })
1529
+ ]
1530
+ }
1531
+ );
1532
+ var EyeOffIcon = () => /* @__PURE__ */ jsxs(
1533
+ "svg",
1534
+ {
1535
+ viewBox: "0 0 24 24",
1536
+ width: "1em",
1537
+ height: "1em",
1538
+ fill: "none",
1539
+ stroke: "currentColor",
1540
+ strokeWidth: 2,
1541
+ strokeLinecap: "round",
1542
+ strokeLinejoin: "round",
1543
+ "aria-hidden": true,
1544
+ children: [
1545
+ /* @__PURE__ */ jsx("path", { d: "M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24" }),
1546
+ /* @__PURE__ */ jsx("line", { x1: "1", y1: "1", x2: "23", y2: "23" })
1547
+ ]
1548
+ }
1549
+ );
1550
+ var PasswordInput = forwardRef(
1551
+ ({
1552
+ disabled,
1553
+ showPasswordLabel = "Poka\u017C has\u0142o",
1554
+ hidePasswordLabel = "Ukryj has\u0142o",
1555
+ ...props
1556
+ }, ref) => {
1557
+ const [show, setShow] = useState(false);
1558
+ return /* @__PURE__ */ jsx(
1559
+ BaseInput,
1560
+ {
1561
+ ref,
1562
+ type: show ? "text" : "password",
1563
+ disabled,
1564
+ endAdornment: /* @__PURE__ */ jsx(
1565
+ ToggleButton,
1566
+ {
1567
+ type: "button",
1568
+ "aria-label": show ? hidePasswordLabel : showPasswordLabel,
1569
+ onClick: () => setShow((s) => !s),
1570
+ disabled,
1571
+ tabIndex: -1,
1572
+ children: show ? /* @__PURE__ */ jsx(EyeOffIcon, {}) : /* @__PURE__ */ jsx(EyeIcon, {})
1573
+ }
1574
+ ),
1575
+ ...props
1576
+ }
1577
+ );
1578
+ }
1579
+ );
1580
+ PasswordInput.displayName = "PasswordInput";
1581
+ var ClearButton = styled("button")(({ theme }) => ({
1582
+ background: "none",
1583
+ border: "none",
1584
+ padding: 0,
1585
+ cursor: "pointer",
1586
+ color: theme.palette.text.secondary,
1587
+ display: "inline-flex",
1588
+ alignItems: "center",
1589
+ flexShrink: 0,
1590
+ borderRadius: "50%",
1591
+ "&:hover": {
1592
+ color: theme.palette.text.primary
1593
+ }
1594
+ }));
1595
+ var SearchIcon = () => /* @__PURE__ */ jsxs(
1596
+ "svg",
1597
+ {
1598
+ viewBox: "0 0 24 24",
1599
+ width: "1em",
1600
+ height: "1em",
1601
+ fill: "none",
1602
+ stroke: "currentColor",
1603
+ strokeWidth: 2,
1604
+ strokeLinecap: "round",
1605
+ strokeLinejoin: "round",
1606
+ "aria-hidden": true,
1607
+ children: [
1608
+ /* @__PURE__ */ jsx("circle", { cx: "11", cy: "11", r: "8" }),
1609
+ /* @__PURE__ */ jsx("line", { x1: "21", y1: "21", x2: "16.65", y2: "16.65" })
1610
+ ]
1611
+ }
1612
+ );
1613
+ var XIcon2 = () => /* @__PURE__ */ jsxs(
1614
+ "svg",
1615
+ {
1616
+ viewBox: "0 0 24 24",
1617
+ width: "1em",
1618
+ height: "1em",
1619
+ fill: "none",
1620
+ stroke: "currentColor",
1621
+ strokeWidth: 2,
1622
+ strokeLinecap: "round",
1623
+ strokeLinejoin: "round",
1624
+ "aria-hidden": true,
1625
+ children: [
1626
+ /* @__PURE__ */ jsx("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
1627
+ /* @__PURE__ */ jsx("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
1628
+ ]
1629
+ }
1630
+ );
1631
+ var SearchInput = forwardRef(
1632
+ ({ value, onChange, onClear, clearAriaLabel = "Wyczy\u015B\u0107", ...props }, forwardedRef) => {
1633
+ const innerRef = useRef(null);
1634
+ const attachRef = useCallback(
1635
+ (el) => {
1636
+ innerRef.current = el;
1637
+ if (typeof forwardedRef === "function") forwardedRef(el);
1638
+ else if (forwardedRef)
1639
+ forwardedRef.current = el;
1640
+ },
1641
+ [forwardedRef]
1642
+ );
1643
+ const isControlled = value !== void 0;
1644
+ const [localValue, setLocalValue] = useState("");
1645
+ const hasValue = isControlled ? !!value : !!localValue;
1646
+ const handleChange = (e) => {
1647
+ if (!isControlled) setLocalValue(e.target.value);
1648
+ onChange?.(e);
1649
+ };
1650
+ const handleClear = () => {
1651
+ if (!isControlled) {
1652
+ setLocalValue("");
1653
+ if (innerRef.current) {
1654
+ const setter = Object.getOwnPropertyDescriptor(
1655
+ window.HTMLInputElement.prototype,
1656
+ "value"
1657
+ )?.set;
1658
+ setter?.call(innerRef.current, "");
1659
+ innerRef.current.dispatchEvent(new Event("input", { bubbles: true }));
1660
+ }
1661
+ }
1662
+ onClear?.();
1663
+ innerRef.current?.focus();
1664
+ };
1665
+ return /* @__PURE__ */ jsx(
1666
+ BaseInput,
1667
+ {
1668
+ ref: attachRef,
1669
+ type: "search",
1670
+ value,
1671
+ onChange: handleChange,
1672
+ startAdornment: /* @__PURE__ */ jsx(SearchIcon, {}),
1673
+ endAdornment: hasValue ? /* @__PURE__ */ jsx(ClearButton, { type: "button", "aria-label": clearAriaLabel, onClick: handleClear, children: /* @__PURE__ */ jsx(XIcon2, {}) }) : void 0,
1674
+ ...props
1675
+ }
1676
+ );
1677
+ }
1678
+ );
1679
+ SearchInput.displayName = "SearchInput";
1680
+ var Checkmark = () => /* @__PURE__ */ jsx(
1681
+ "svg",
1682
+ {
1683
+ viewBox: "0 0 24 24",
1684
+ width: "1em",
1685
+ height: "1em",
1686
+ fill: "none",
1687
+ stroke: "currentColor",
1688
+ strokeWidth: 2.5,
1689
+ strokeLinecap: "round",
1690
+ strokeLinejoin: "round",
1691
+ "aria-hidden": true,
1692
+ children: /* @__PURE__ */ jsx("polyline", { points: "20 6 9 17 4 12" })
1693
+ }
1694
+ );
1695
+ var renderOption2 = (selected) => {
1696
+ const SelectOption = (option) => /* @__PURE__ */ jsxs("span", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", gap: "0.5rem" }, children: [
1697
+ option.label,
1698
+ option.value === selected && /* @__PURE__ */ jsx(Checkmark, {})
1699
+ ] });
1700
+ SelectOption.displayName = "SelectOption";
1701
+ return SelectOption;
1702
+ };
1703
+ var SelectInput = ({ onChange, value, ...rest }) => /* @__PURE__ */ jsx(
1704
+ BaseSelectInput,
1705
+ {
1706
+ value,
1707
+ onSelect: (option, close) => {
1708
+ onChange?.(option.value);
1709
+ close();
1710
+ },
1711
+ renderOption: renderOption2(value),
1712
+ ...rest
1713
+ }
1714
+ );
1715
+ SelectInput.displayName = "SelectInput";
1716
+ var borderColors = (theme, error) => ({
1717
+ borderColor: error ? theme.palette.error.main : theme.palette.divider,
1718
+ "&:hover:not(:focus-within):not([data-disabled])": {
1719
+ borderColor: error ? theme.palette.error.dark : theme.palette.text.secondary
1720
+ },
1721
+ "&:focus-within": {
1722
+ borderColor: error ? theme.palette.error.main : theme.palette.primary.main,
1723
+ boxShadow: `0 0 0 3px ${error ? theme.palette.error.main : theme.palette.primary.main}33`
1724
+ }
1725
+ });
1726
+ var Root5 = styled("div")(({ $fullWidth }) => ({
1727
+ display: $fullWidth ? "block" : "inline-block",
1728
+ width: $fullWidth ? "100%" : "auto"
1729
+ }));
1730
+ var StyledTextarea = styled("textarea")(({ theme, $size, $fullWidth, $error, $disabled }) => ({
1731
+ display: "block",
1732
+ width: $fullWidth ? "100%" : "auto",
1733
+ borderRadius: theme.shape.borderRadius,
1734
+ border: "1px solid",
1735
+ backgroundColor: $disabled ? theme.palette.action.disabledBackground : theme.palette.background.paper,
1736
+ fontFamily: theme.typography.fontFamily,
1737
+ color: $disabled ? theme.palette.action.disabled : theme.palette.text.primary,
1738
+ resize: "vertical",
1739
+ outline: "none",
1740
+ transition: "border-color 150ms ease, box-shadow 150ms ease",
1741
+ cursor: $disabled ? "not-allowed" : "text",
1742
+ boxSizing: "border-box",
1743
+ ...inputSizeMap[$size],
1744
+ ...borderColors(theme, $error),
1745
+ ...$disabled && {
1746
+ borderColor: theme.palette.action.disabled,
1747
+ pointerEvents: "none"
1748
+ },
1749
+ "&::placeholder": {
1750
+ color: theme.palette.text.disabled
1751
+ }
1752
+ }));
1753
+ var TextareaInput = forwardRef(
1754
+ ({
1755
+ label,
1756
+ helperText,
1757
+ error = false,
1758
+ size = "md",
1759
+ fullWidth = false,
1760
+ rows = 4,
1761
+ disabled = false,
1762
+ id,
1763
+ ...rest
1764
+ }, ref) => {
1765
+ const autoId = useId();
1766
+ const inputId = id ?? autoId;
1767
+ return /* @__PURE__ */ jsxs(Root5, { $fullWidth: fullWidth, children: [
1768
+ label && /* @__PURE__ */ jsx(Label, { htmlFor: inputId, error, size, children: label }),
1769
+ /* @__PURE__ */ jsx(
1770
+ StyledTextarea,
1771
+ {
1772
+ ref,
1773
+ id: inputId,
1774
+ rows,
1775
+ disabled,
1776
+ $size: size,
1777
+ $fullWidth: fullWidth,
1778
+ $error: error,
1779
+ $disabled: disabled,
1780
+ "data-disabled": disabled || void 0,
1781
+ ...rest
1782
+ }
1783
+ ),
1784
+ helperText && /* @__PURE__ */ jsx(HelperText, { error, children: helperText })
1785
+ ] });
1786
+ }
1787
+ );
1788
+ TextareaInput.displayName = "TextareaInput";
1789
+ var sizeMap2 = { sm: "1em", md: "1.25em", lg: "1.75em" };
1790
+ var toFlagEmoji = (code) => code.toUpperCase().replace(/[A-Z]/g, (char) => String.fromCodePoint(127462 + char.charCodeAt(0) - 65));
1791
+ var CountryFlag = ({ countryCode, size = "md", style, ...rest }) => /* @__PURE__ */ jsx(
1792
+ "span",
1793
+ {
1794
+ role: "img",
1795
+ "aria-label": `Flag: ${countryCode}`,
1796
+ style: { fontSize: sizeMap2[size], lineHeight: 1, display: "inline-flex", ...style },
1797
+ ...rest,
1798
+ children: toFlagEmoji(countryCode)
1799
+ }
1800
+ );
1801
+ CountryFlag.displayName = "CountryFlag";
1802
+
1803
+ // src/data/countries.json
1804
+ var countries_default = {
1805
+ countries: [
1806
+ {
1807
+ flagCode: "AU",
1808
+ country: "Australia",
1809
+ phoneNumberLengthByCountry_phLengthMax: 15,
1810
+ phoneNumberLengthByCountry_phLengthMin: 4,
1811
+ phoneNumberLengthByCountry_phLength: "4 to 15"
1812
+ },
1813
+ {
1814
+ flagCode: "DE",
1815
+ country: "Niemcy",
1816
+ phoneNumberLengthByCountry_phLengthMax: 13,
1817
+ phoneNumberLengthByCountry_phLengthMin: 6,
1818
+ phoneNumberLengthByCountry_phLength: "6 to 13"
1819
+ },
1820
+ {
1821
+ flagCode: "SE",
1822
+ country: "Szwecja",
1823
+ phoneNumberLengthByCountry_phLengthMax: 13,
1824
+ phoneNumberLengthByCountry_phLengthMin: 7,
1825
+ phoneNumberLengthByCountry_phLength: "7 to 13"
1826
+ },
1827
+ {
1828
+ flagCode: "AT",
1829
+ country: "Austria",
1830
+ phoneNumberLengthByCountry_phLengthMax: 13,
1831
+ phoneNumberLengthByCountry_phLengthMin: 4,
1832
+ phoneNumberLengthByCountry_phLength: "4 to 13"
1833
+ },
1834
+ {
1835
+ flagCode: "CN",
1836
+ country: "Chiny",
1837
+ phoneNumberLengthByCountry_phLengthMax: 12,
1838
+ phoneNumberLengthByCountry_phLengthMin: 5,
1839
+ phoneNumberLengthByCountry_phLength: "5 to 12"
1840
+ },
1841
+ {
1842
+ flagCode: "CZ",
1843
+ country: "Czechy",
1844
+ phoneNumberLengthByCountry_phLengthMax: 12,
1845
+ phoneNumberLengthByCountry_phLengthMin: 4,
1846
+ phoneNumberLengthByCountry_phLength: "4 to 12"
1847
+ },
1848
+ {
1849
+ flagCode: "CH",
1850
+ country: "Szwajcaria",
1851
+ phoneNumberLengthByCountry_phLengthMax: 12,
1852
+ phoneNumberLengthByCountry_phLengthMin: 4,
1853
+ phoneNumberLengthByCountry_phLength: "4 to 12"
1854
+ },
1855
+ {
1856
+ flagCode: "RS",
1857
+ country: "Serbia",
1858
+ phoneNumberLengthByCountry_phLengthMax: 12,
1859
+ phoneNumberLengthByCountry_phLengthMin: 4,
1860
+ phoneNumberLengthByCountry_phLength: "4 to 12"
1861
+ },
1862
+ {
1863
+ flagCode: "SG",
1864
+ country: "Singapur",
1865
+ phoneNumberLengthByCountry_phLengthMax: 12,
1866
+ phoneNumberLengthByCountry_phLengthMin: 8,
1867
+ phoneNumberLengthByCountry_phLength: "8 to 12"
1868
+ },
1869
+ {
1870
+ flagCode: "FI",
1871
+ country: "Finlandia",
1872
+ phoneNumberLengthByCountry_phLengthMax: 12,
1873
+ phoneNumberLengthByCountry_phLengthMin: 5,
1874
+ phoneNumberLengthByCountry_phLength: "5 to 12"
1875
+ },
1876
+ {
1877
+ flagCode: "HR",
1878
+ country: "Chorwacja",
1879
+ phoneNumberLengthByCountry_phLengthMax: 12,
1880
+ phoneNumberLengthByCountry_phLengthMin: 8,
1881
+ phoneNumberLengthByCountry_phLength: "8 to 12"
1882
+ },
1883
+ {
1884
+ flagCode: "ME",
1885
+ country: "Czarnog\xF3ra",
1886
+ phoneNumberLengthByCountry_phLengthMax: 12,
1887
+ phoneNumberLengthByCountry_phLengthMin: 4,
1888
+ phoneNumberLengthByCountry_phLength: "4 to 12"
1889
+ },
1890
+ {
1891
+ flagCode: "PK",
1892
+ country: "Pakistan",
1893
+ phoneNumberLengthByCountry_phLengthMax: 11,
1894
+ phoneNumberLengthByCountry_phLengthMin: 8,
1895
+ phoneNumberLengthByCountry_phLength: "8 to 11"
1896
+ },
1897
+ {
1898
+ flagCode: "IT",
1899
+ country: "W\u0142ochy",
1900
+ phoneNumberLengthByCountry_phLengthMax: 11,
1901
+ phoneNumberLengthByCountry_phLengthMin: null,
1902
+ phoneNumberLengthByCountry_phLength: "up to 11"
1903
+ },
1904
+ {
1905
+ flagCode: "KR",
1906
+ country: "Korea Po\u0142udniowa",
1907
+ phoneNumberLengthByCountry_phLengthMax: 11,
1908
+ phoneNumberLengthByCountry_phLengthMin: 8,
1909
+ phoneNumberLengthByCountry_phLength: "8 to 11"
1910
+ },
1911
+ {
1912
+ flagCode: "PE",
1913
+ country: "Peru",
1914
+ phoneNumberLengthByCountry_phLengthMax: 11,
1915
+ phoneNumberLengthByCountry_phLengthMin: 8,
1916
+ phoneNumberLengthByCountry_phLength: "8 to 11"
1917
+ },
1918
+ {
1919
+ flagCode: "PG",
1920
+ country: "Papua Nowa Gwinea",
1921
+ phoneNumberLengthByCountry_phLengthMax: 11,
1922
+ phoneNumberLengthByCountry_phLengthMin: 4,
1923
+ phoneNumberLengthByCountry_phLength: "4 to 11"
1924
+ },
1925
+ {
1926
+ flagCode: "PT",
1927
+ country: "Portugalia",
1928
+ phoneNumberLengthByCountry_phLengthMax: 11,
1929
+ phoneNumberLengthByCountry_phLengthMin: 9,
1930
+ phoneNumberLengthByCountry_phLength: "9 or 11"
1931
+ },
1932
+ {
1933
+ flagCode: "SV",
1934
+ country: "Salwador",
1935
+ phoneNumberLengthByCountry_phLengthMax: 11,
1936
+ phoneNumberLengthByCountry_phLengthMin: 7,
1937
+ phoneNumberLengthByCountry_phLength: "7, 8 or 11"
1938
+ },
1939
+ {
1940
+ flagCode: "IE",
1941
+ country: "Irlandia",
1942
+ phoneNumberLengthByCountry_phLengthMax: 11,
1943
+ phoneNumberLengthByCountry_phLengthMin: 7,
1944
+ phoneNumberLengthByCountry_phLength: "7 to 11"
1945
+ },
1946
+ {
1947
+ flagCode: "UY",
1948
+ country: "Urugwaj",
1949
+ phoneNumberLengthByCountry_phLengthMax: 11,
1950
+ phoneNumberLengthByCountry_phLengthMin: 4,
1951
+ phoneNumberLengthByCountry_phLength: "4 to 11"
1952
+ },
1953
+ {
1954
+ flagCode: "CY",
1955
+ country: "Cypr",
1956
+ phoneNumberLengthByCountry_phLengthMax: 11,
1957
+ phoneNumberLengthByCountry_phLengthMin: 8,
1958
+ phoneNumberLengthByCountry_phLength: "8 or 11"
1959
+ },
1960
+ {
1961
+ flagCode: "LU",
1962
+ country: "Luksemburg",
1963
+ phoneNumberLengthByCountry_phLengthMax: 11,
1964
+ phoneNumberLengthByCountry_phLengthMin: 4,
1965
+ phoneNumberLengthByCountry_phLength: "4 to 11"
1966
+ },
1967
+ {
1968
+ flagCode: "VA",
1969
+ country: "Watykan",
1970
+ phoneNumberLengthByCountry_phLengthMax: 11,
1971
+ phoneNumberLengthByCountry_phLengthMin: null,
1972
+ phoneNumberLengthByCountry_phLength: "up to 11"
1973
+ },
1974
+ {
1975
+ flagCode: "IN",
1976
+ country: "Indie",
1977
+ phoneNumberLengthByCountry_phLengthMax: 10,
1978
+ phoneNumberLengthByCountry_phLengthMin: 7,
1979
+ phoneNumberLengthByCountry_phLength: "7 to 10"
1980
+ },
1981
+ {
1982
+ flagCode: "US",
1983
+ country: "Stany Zjednoczone",
1984
+ phoneNumberLengthByCountry_phLengthMax: 10,
1985
+ phoneNumberLengthByCountry_phLengthMin: 10,
1986
+ phoneNumberLengthByCountry_phLength: 10
1987
+ },
1988
+ {
1989
+ flagCode: "ID",
1990
+ country: "Indonezja",
1991
+ phoneNumberLengthByCountry_phLengthMax: 10,
1992
+ phoneNumberLengthByCountry_phLengthMin: 5,
1993
+ phoneNumberLengthByCountry_phLength: "5 to 10"
1994
+ },
1995
+ {
1996
+ flagCode: "NG",
1997
+ country: "Nigeria",
1998
+ phoneNumberLengthByCountry_phLengthMax: 10,
1999
+ phoneNumberLengthByCountry_phLengthMin: 7,
2000
+ phoneNumberLengthByCountry_phLength: "7 to 10"
2001
+ },
2002
+ {
2003
+ flagCode: "BR",
2004
+ country: "Brazylia",
2005
+ phoneNumberLengthByCountry_phLengthMax: 10,
2006
+ phoneNumberLengthByCountry_phLengthMin: 10,
2007
+ phoneNumberLengthByCountry_phLength: 10
2008
+ },
2009
+ {
2010
+ flagCode: "BD",
2011
+ country: "Bangladesz",
2012
+ phoneNumberLengthByCountry_phLengthMax: 10,
2013
+ phoneNumberLengthByCountry_phLengthMin: 6,
2014
+ phoneNumberLengthByCountry_phLength: "6 to 10"
2015
+ },
2016
+ {
2017
+ flagCode: "RU",
2018
+ country: "Rosja",
2019
+ phoneNumberLengthByCountry_phLengthMax: 10,
2020
+ phoneNumberLengthByCountry_phLengthMin: 10,
2021
+ phoneNumberLengthByCountry_phLength: 10
2022
+ },
2023
+ {
2024
+ flagCode: "MX",
2025
+ country: "Meksyk",
2026
+ phoneNumberLengthByCountry_phLengthMax: 10,
2027
+ phoneNumberLengthByCountry_phLengthMin: 10,
2028
+ phoneNumberLengthByCountry_phLength: 10
2029
+ },
2030
+ {
2031
+ flagCode: "JP",
2032
+ country: "Japonia",
2033
+ phoneNumberLengthByCountry_phLengthMax: 10,
2034
+ phoneNumberLengthByCountry_phLengthMin: 9,
2035
+ phoneNumberLengthByCountry_phLength: "9 to 10"
2036
+ },
2037
+ {
2038
+ flagCode: "PH",
2039
+ country: "Filipiny",
2040
+ phoneNumberLengthByCountry_phLengthMax: 10,
2041
+ phoneNumberLengthByCountry_phLengthMin: 8,
2042
+ phoneNumberLengthByCountry_phLength: "8 to 10"
2043
+ },
2044
+ {
2045
+ flagCode: "VN",
2046
+ country: "Wietnam",
2047
+ phoneNumberLengthByCountry_phLengthMax: 10,
2048
+ phoneNumberLengthByCountry_phLengthMin: 7,
2049
+ phoneNumberLengthByCountry_phLength: "7 to 10"
2050
+ },
2051
+ {
2052
+ flagCode: "IR",
2053
+ country: "Iran",
2054
+ phoneNumberLengthByCountry_phLengthMax: 10,
2055
+ phoneNumberLengthByCountry_phLengthMin: 6,
2056
+ phoneNumberLengthByCountry_phLength: "6 to 10"
2057
+ },
2058
+ {
2059
+ flagCode: "TR",
2060
+ country: "Turcja",
2061
+ phoneNumberLengthByCountry_phLengthMax: 10,
2062
+ phoneNumberLengthByCountry_phLengthMin: 10,
2063
+ phoneNumberLengthByCountry_phLength: 10
2064
+ },
2065
+ {
2066
+ flagCode: "GB",
2067
+ country: "Wielka Brytania",
2068
+ phoneNumberLengthByCountry_phLengthMax: 10,
2069
+ phoneNumberLengthByCountry_phLengthMin: 7,
2070
+ phoneNumberLengthByCountry_phLength: "7 to 10"
2071
+ },
2072
+ {
2073
+ flagCode: "KE",
2074
+ country: "Kenia",
2075
+ phoneNumberLengthByCountry_phLengthMax: 10,
2076
+ phoneNumberLengthByCountry_phLengthMin: 6,
2077
+ phoneNumberLengthByCountry_phLength: "6 to 10"
2078
+ },
2079
+ {
2080
+ flagCode: "CO",
2081
+ country: "Kolumbia",
2082
+ phoneNumberLengthByCountry_phLengthMax: 10,
2083
+ phoneNumberLengthByCountry_phLengthMin: 8,
2084
+ phoneNumberLengthByCountry_phLength: "8 or 10"
2085
+ },
2086
+ {
2087
+ flagCode: "IQ",
2088
+ country: "Irak",
2089
+ phoneNumberLengthByCountry_phLengthMax: 10,
2090
+ phoneNumberLengthByCountry_phLengthMin: 8,
2091
+ phoneNumberLengthByCountry_phLength: "8 to 10"
2092
+ },
2093
+ {
2094
+ flagCode: "AR",
2095
+ country: "Argentyna",
2096
+ phoneNumberLengthByCountry_phLengthMax: 10,
2097
+ phoneNumberLengthByCountry_phLengthMin: 10,
2098
+ phoneNumberLengthByCountry_phLength: 10
2099
+ },
2100
+ {
2101
+ flagCode: "CA",
2102
+ country: "Kanada",
2103
+ phoneNumberLengthByCountry_phLengthMax: 10,
2104
+ phoneNumberLengthByCountry_phLengthMin: 10,
2105
+ phoneNumberLengthByCountry_phLength: 10
2106
+ },
2107
+ {
2108
+ flagCode: "MG",
2109
+ country: "Madagaskar",
2110
+ phoneNumberLengthByCountry_phLengthMax: 10,
2111
+ phoneNumberLengthByCountry_phLengthMin: 9,
2112
+ phoneNumberLengthByCountry_phLength: "9 to 10"
2113
+ },
2114
+ {
2115
+ flagCode: "VE",
2116
+ country: "Wenezuela",
2117
+ phoneNumberLengthByCountry_phLengthMax: 10,
2118
+ phoneNumberLengthByCountry_phLengthMin: 10,
2119
+ phoneNumberLengthByCountry_phLength: 10
2120
+ },
2121
+ {
2122
+ flagCode: "KP",
2123
+ country: "Korea P\xF3\u0142nocna",
2124
+ phoneNumberLengthByCountry_phLengthMax: 10,
2125
+ phoneNumberLengthByCountry_phLengthMin: 3,
2126
+ phoneNumberLengthByCountry_phLength: "3 to 10"
2127
+ },
2128
+ {
2129
+ flagCode: "SY",
2130
+ country: "Syria",
2131
+ phoneNumberLengthByCountry_phLengthMax: 10,
2132
+ phoneNumberLengthByCountry_phLengthMin: 8,
2133
+ phoneNumberLengthByCountry_phLength: "8 to 10"
2134
+ },
2135
+ {
2136
+ flagCode: "KZ",
2137
+ country: "Kazachstan",
2138
+ phoneNumberLengthByCountry_phLengthMax: 10,
2139
+ phoneNumberLengthByCountry_phLengthMin: 10,
2140
+ phoneNumberLengthByCountry_phLength: 10
2141
+ },
2142
+ {
2143
+ flagCode: "DO",
2144
+ country: "Dominikana",
2145
+ phoneNumberLengthByCountry_phLengthMax: 10,
2146
+ phoneNumberLengthByCountry_phLengthMin: 10,
2147
+ phoneNumberLengthByCountry_phLength: "(809/829) + 7"
2148
+ },
2149
+ {
2150
+ flagCode: "GR",
2151
+ country: "Grecja",
2152
+ phoneNumberLengthByCountry_phLengthMax: 10,
2153
+ phoneNumberLengthByCountry_phLengthMin: 10,
2154
+ phoneNumberLengthByCountry_phLength: 10
2155
+ },
2156
+ {
2157
+ flagCode: "BY",
2158
+ country: "Bia\u0142oru\u015B",
2159
+ phoneNumberLengthByCountry_phLengthMax: 10,
2160
+ phoneNumberLengthByCountry_phLengthMin: 9,
2161
+ phoneNumberLengthByCountry_phLength: "9 to 10"
2162
+ },
2163
+ {
2164
+ flagCode: "NZ",
2165
+ country: "Nowa Zelandia",
2166
+ phoneNumberLengthByCountry_phLengthMax: 10,
2167
+ phoneNumberLengthByCountry_phLengthMin: 3,
2168
+ phoneNumberLengthByCountry_phLength: "3 to 10"
2169
+ },
2170
+ {
2171
+ flagCode: "PR",
2172
+ country: "Portoryko",
2173
+ phoneNumberLengthByCountry_phLengthMax: 10,
2174
+ phoneNumberLengthByCountry_phLengthMin: 10,
2175
+ phoneNumberLengthByCountry_phLength: "(787/939) + 7"
2176
+ },
2177
+ {
2178
+ flagCode: "QA",
2179
+ country: "Katar",
2180
+ phoneNumberLengthByCountry_phLengthMax: 10,
2181
+ phoneNumberLengthByCountry_phLengthMin: 6,
2182
+ phoneNumberLengthByCountry_phLength: "6, 7, 10"
2183
+ },
2184
+ {
2185
+ flagCode: "NA",
2186
+ country: "Namibia",
2187
+ phoneNumberLengthByCountry_phLengthMax: 10,
2188
+ phoneNumberLengthByCountry_phLengthMin: 6,
2189
+ phoneNumberLengthByCountry_phLength: "6 to 10"
2190
+ },
2191
+ {
2192
+ flagCode: "JM",
2193
+ country: "Jamajka",
2194
+ phoneNumberLengthByCountry_phLengthMax: 10,
2195
+ phoneNumberLengthByCountry_phLengthMin: 10,
2196
+ phoneNumberLengthByCountry_phLength: "(876) + 7"
2197
+ },
2198
+ {
2199
+ flagCode: "TT",
2200
+ country: "Trynidad i Tobago",
2201
+ phoneNumberLengthByCountry_phLengthMax: 10,
2202
+ phoneNumberLengthByCountry_phLengthMin: 10,
2203
+ phoneNumberLengthByCountry_phLength: "(868) + 7"
2204
+ },
2205
+ {
2206
+ flagCode: "EE",
2207
+ country: "Estonia",
2208
+ phoneNumberLengthByCountry_phLengthMax: 10,
2209
+ phoneNumberLengthByCountry_phLengthMin: 7,
2210
+ phoneNumberLengthByCountry_phLength: "7 to 10"
2211
+ },
2212
+ {
2213
+ flagCode: "BS",
2214
+ country: "Bahamy",
2215
+ phoneNumberLengthByCountry_phLengthMax: 10,
2216
+ phoneNumberLengthByCountry_phLengthMin: 10,
2217
+ phoneNumberLengthByCountry_phLength: "(242) + 7"
2218
+ },
2219
+ {
2220
+ flagCode: "BB",
2221
+ country: "Barbados",
2222
+ phoneNumberLengthByCountry_phLengthMax: 10,
2223
+ phoneNumberLengthByCountry_phLengthMin: 10,
2224
+ phoneNumberLengthByCountry_phLength: "(246) + 7"
2225
+ },
2226
+ {
2227
+ flagCode: "LC",
2228
+ country: "Saint Lucia",
2229
+ phoneNumberLengthByCountry_phLengthMax: 10,
2230
+ phoneNumberLengthByCountry_phLengthMin: 10,
2231
+ phoneNumberLengthByCountry_phLength: "(758) + 7"
2232
+ },
2233
+ {
2234
+ flagCode: "GU",
2235
+ country: "Guam",
2236
+ phoneNumberLengthByCountry_phLengthMax: 10,
2237
+ phoneNumberLengthByCountry_phLengthMin: 10,
2238
+ phoneNumberLengthByCountry_phLength: "(671) + 7"
2239
+ },
2240
+ {
2241
+ flagCode: "GD",
2242
+ country: "Grenada",
2243
+ phoneNumberLengthByCountry_phLengthMax: 10,
2244
+ phoneNumberLengthByCountry_phLengthMin: 10,
2245
+ phoneNumberLengthByCountry_phLength: "(473) + 7"
2246
+ },
2247
+ {
2248
+ flagCode: "VC",
2249
+ country: "Saint Vincent i Grenadyny",
2250
+ phoneNumberLengthByCountry_phLengthMax: 10,
2251
+ phoneNumberLengthByCountry_phLengthMin: 10,
2252
+ phoneNumberLengthByCountry_phLength: "(784) + 7"
2253
+ },
2254
+ {
2255
+ flagCode: "AG",
2256
+ country: "Antigua i Barbuda",
2257
+ phoneNumberLengthByCountry_phLengthMax: 10,
2258
+ phoneNumberLengthByCountry_phLengthMin: 10,
2259
+ phoneNumberLengthByCountry_phLength: "(268) + 7"
2260
+ },
2261
+ {
2262
+ flagCode: "VI",
2263
+ country: "Wyspy Dziewicze Stan\xF3w Zjednoczonych",
2264
+ phoneNumberLengthByCountry_phLengthMax: 10,
2265
+ phoneNumberLengthByCountry_phLengthMin: 10,
2266
+ phoneNumberLengthByCountry_phLength: "(340) + 7"
2267
+ },
2268
+ {
2269
+ flagCode: "KY",
2270
+ country: "Kajmany",
2271
+ phoneNumberLengthByCountry_phLengthMax: 10,
2272
+ phoneNumberLengthByCountry_phLengthMin: 10,
2273
+ phoneNumberLengthByCountry_phLength: "(345) + 7"
2274
+ },
2275
+ {
2276
+ flagCode: "DM",
2277
+ country: "Dominika",
2278
+ phoneNumberLengthByCountry_phLengthMax: 10,
2279
+ phoneNumberLengthByCountry_phLengthMin: 10,
2280
+ phoneNumberLengthByCountry_phLength: "(767) + 7"
2281
+ },
2282
+ {
2283
+ flagCode: "BM",
2284
+ country: "Bermudy",
2285
+ phoneNumberLengthByCountry_phLengthMax: 10,
2286
+ phoneNumberLengthByCountry_phLengthMin: 10,
2287
+ phoneNumberLengthByCountry_phLength: "(441) + 7"
2288
+ },
2289
+ {
2290
+ flagCode: "TC",
2291
+ country: "Turks i Caicos",
2292
+ phoneNumberLengthByCountry_phLengthMax: 10,
2293
+ phoneNumberLengthByCountry_phLengthMin: 10,
2294
+ phoneNumberLengthByCountry_phLength: "(649) + 7"
2295
+ },
2296
+ {
2297
+ flagCode: "KN",
2298
+ country: "Saint Kitts i Nevis",
2299
+ phoneNumberLengthByCountry_phLengthMax: 10,
2300
+ phoneNumberLengthByCountry_phLengthMin: 10,
2301
+ phoneNumberLengthByCountry_phLength: "(869) + 7"
2302
+ },
2303
+ {
2304
+ flagCode: "AS",
2305
+ country: "Samoa Ameryka\u0144skie",
2306
+ phoneNumberLengthByCountry_phLengthMax: 10,
2307
+ phoneNumberLengthByCountry_phLengthMin: 10,
2308
+ phoneNumberLengthByCountry_phLength: "(684) + 7"
2309
+ },
2310
+ {
2311
+ flagCode: "SX",
2312
+ country: "Sint Maarten",
2313
+ phoneNumberLengthByCountry_phLengthMax: 10,
2314
+ phoneNumberLengthByCountry_phLengthMin: 10,
2315
+ phoneNumberLengthByCountry_phLength: "(721) + 7"
2316
+ },
2317
+ {
2318
+ flagCode: "VG",
2319
+ country: "Brytyjskie Wyspy Dziewicze",
2320
+ phoneNumberLengthByCountry_phLengthMax: 10,
2321
+ phoneNumberLengthByCountry_phLengthMin: 10,
2322
+ phoneNumberLengthByCountry_phLength: "(284) + 7"
2323
+ },
2324
+ {
2325
+ flagCode: "SM",
2326
+ country: "San Marino",
2327
+ phoneNumberLengthByCountry_phLengthMax: 10,
2328
+ phoneNumberLengthByCountry_phLengthMin: 6,
2329
+ phoneNumberLengthByCountry_phLength: "6 to 10"
2330
+ },
2331
+ {
2332
+ flagCode: "AI",
2333
+ country: "Anguilla",
2334
+ phoneNumberLengthByCountry_phLengthMax: 10,
2335
+ phoneNumberLengthByCountry_phLengthMin: 10,
2336
+ phoneNumberLengthByCountry_phLength: "(264) + 7"
2337
+ },
2338
+ {
2339
+ flagCode: "MS",
2340
+ country: "Montserrat",
2341
+ phoneNumberLengthByCountry_phLengthMax: 10,
2342
+ phoneNumberLengthByCountry_phLengthMin: 10,
2343
+ phoneNumberLengthByCountry_phLength: "(664) + 7"
2344
+ },
2345
+ {
2346
+ flagCode: "ET",
2347
+ country: "Etiopia",
2348
+ phoneNumberLengthByCountry_phLengthMax: 9,
2349
+ phoneNumberLengthByCountry_phLengthMin: 9,
2350
+ phoneNumberLengthByCountry_phLength: 9
2351
+ },
2352
+ {
2353
+ flagCode: "EG",
2354
+ country: "Egipt",
2355
+ phoneNumberLengthByCountry_phLengthMax: 9,
2356
+ phoneNumberLengthByCountry_phLengthMin: 7,
2357
+ phoneNumberLengthByCountry_phLength: "7 to 9"
2358
+ },
2359
+ {
2360
+ flagCode: "CD",
2361
+ country: "Demokratyczna Republika Konga",
2362
+ phoneNumberLengthByCountry_phLengthMax: 9,
2363
+ phoneNumberLengthByCountry_phLengthMin: 5,
2364
+ phoneNumberLengthByCountry_phLength: "5 to 9"
2365
+ },
2366
+ {
2367
+ flagCode: "TZ",
2368
+ country: "Tanzania",
2369
+ phoneNumberLengthByCountry_phLengthMax: 9,
2370
+ phoneNumberLengthByCountry_phLengthMin: 9,
2371
+ phoneNumberLengthByCountry_phLength: 9
2372
+ },
2373
+ {
2374
+ flagCode: "TH",
2375
+ country: "Tajlandia",
2376
+ phoneNumberLengthByCountry_phLengthMax: 9,
2377
+ phoneNumberLengthByCountry_phLengthMin: 8,
2378
+ phoneNumberLengthByCountry_phLength: "8 or 9"
2379
+ },
2380
+ {
2381
+ flagCode: "FR",
2382
+ country: "Francja",
2383
+ phoneNumberLengthByCountry_phLengthMax: 9,
2384
+ phoneNumberLengthByCountry_phLengthMin: 9,
2385
+ phoneNumberLengthByCountry_phLength: 9
2386
+ },
2387
+ {
2388
+ flagCode: "ZA",
2389
+ country: "Republika Po\u0142udniowej Afryki",
2390
+ phoneNumberLengthByCountry_phLengthMax: 9,
2391
+ phoneNumberLengthByCountry_phLengthMin: 9,
2392
+ phoneNumberLengthByCountry_phLength: 9
2393
+ },
2394
+ {
2395
+ flagCode: "MM",
2396
+ country: "Mjanma",
2397
+ phoneNumberLengthByCountry_phLengthMax: 9,
2398
+ phoneNumberLengthByCountry_phLengthMin: 7,
2399
+ phoneNumberLengthByCountry_phLength: "7 to 9"
2400
+ },
2401
+ {
2402
+ flagCode: "SD",
2403
+ country: "Sudan",
2404
+ phoneNumberLengthByCountry_phLengthMax: 9,
2405
+ phoneNumberLengthByCountry_phLengthMin: 9,
2406
+ phoneNumberLengthByCountry_phLength: 9
2407
+ },
2408
+ {
2409
+ flagCode: "UG",
2410
+ country: "Uganda",
2411
+ phoneNumberLengthByCountry_phLengthMax: 9,
2412
+ phoneNumberLengthByCountry_phLengthMin: 9,
2413
+ phoneNumberLengthByCountry_phLength: 9
2414
+ },
2415
+ {
2416
+ flagCode: "DZ",
2417
+ country: "Algieria",
2418
+ phoneNumberLengthByCountry_phLengthMax: 9,
2419
+ phoneNumberLengthByCountry_phLengthMin: 8,
2420
+ phoneNumberLengthByCountry_phLength: "8 or 9"
2421
+ },
2422
+ {
2423
+ flagCode: "ES",
2424
+ country: "Hiszpania",
2425
+ phoneNumberLengthByCountry_phLengthMax: 9,
2426
+ phoneNumberLengthByCountry_phLengthMin: 9,
2427
+ phoneNumberLengthByCountry_phLength: 9
2428
+ },
2429
+ {
2430
+ flagCode: "AF",
2431
+ country: "Afganistan",
2432
+ phoneNumberLengthByCountry_phLengthMax: 9,
2433
+ phoneNumberLengthByCountry_phLengthMin: 9,
2434
+ phoneNumberLengthByCountry_phLength: 9
2435
+ },
2436
+ {
2437
+ flagCode: "YE",
2438
+ country: "Jemen",
2439
+ phoneNumberLengthByCountry_phLengthMax: 9,
2440
+ phoneNumberLengthByCountry_phLengthMin: 6,
2441
+ phoneNumberLengthByCountry_phLength: "6 to 9"
2442
+ },
2443
+ {
2444
+ flagCode: "AO",
2445
+ country: "Angola",
2446
+ phoneNumberLengthByCountry_phLengthMax: 9,
2447
+ phoneNumberLengthByCountry_phLengthMin: 9,
2448
+ phoneNumberLengthByCountry_phLength: 9
2449
+ },
2450
+ {
2451
+ flagCode: "UA",
2452
+ country: "Ukraina",
2453
+ phoneNumberLengthByCountry_phLengthMax: 9,
2454
+ phoneNumberLengthByCountry_phLengthMin: 9,
2455
+ phoneNumberLengthByCountry_phLength: 9
2456
+ },
2457
+ {
2458
+ flagCode: "MA",
2459
+ country: "Maroko",
2460
+ phoneNumberLengthByCountry_phLengthMax: 9,
2461
+ phoneNumberLengthByCountry_phLengthMin: 9,
2462
+ phoneNumberLengthByCountry_phLength: 9
2463
+ },
2464
+ {
2465
+ flagCode: "PL",
2466
+ country: "Polska",
2467
+ phoneNumberLengthByCountry_phLengthMax: 9,
2468
+ phoneNumberLengthByCountry_phLengthMin: 6,
2469
+ phoneNumberLengthByCountry_phLength: "6 to 9"
2470
+ },
2471
+ {
2472
+ flagCode: "UZ",
2473
+ country: "Uzbekistan",
2474
+ phoneNumberLengthByCountry_phLengthMax: 9,
2475
+ phoneNumberLengthByCountry_phLengthMin: 9,
2476
+ phoneNumberLengthByCountry_phLength: 9
2477
+ },
2478
+ {
2479
+ flagCode: "MZ",
2480
+ country: "Mozambik",
2481
+ phoneNumberLengthByCountry_phLengthMax: 9,
2482
+ phoneNumberLengthByCountry_phLengthMin: 8,
2483
+ phoneNumberLengthByCountry_phLength: "8 to 9"
2484
+ },
2485
+ {
2486
+ flagCode: "MY",
2487
+ country: "Malezja",
2488
+ phoneNumberLengthByCountry_phLengthMax: 9,
2489
+ phoneNumberLengthByCountry_phLengthMin: 7,
2490
+ phoneNumberLengthByCountry_phLength: "7 to 9"
2491
+ },
2492
+ {
2493
+ flagCode: "GH",
2494
+ country: "Ghana",
2495
+ phoneNumberLengthByCountry_phLengthMax: 9,
2496
+ phoneNumberLengthByCountry_phLengthMin: 5,
2497
+ phoneNumberLengthByCountry_phLength: "5 to 9"
2498
+ },
2499
+ {
2500
+ flagCode: "SA",
2501
+ country: "Arabia Saudyjska",
2502
+ phoneNumberLengthByCountry_phLengthMax: 9,
2503
+ phoneNumberLengthByCountry_phLengthMin: 8,
2504
+ phoneNumberLengthByCountry_phLength: "8 to 9"
2505
+ },
2506
+ {
2507
+ flagCode: "NP",
2508
+ country: "Nepal",
2509
+ phoneNumberLengthByCountry_phLengthMax: 9,
2510
+ phoneNumberLengthByCountry_phLengthMin: 8,
2511
+ phoneNumberLengthByCountry_phLength: "8 to 9"
2512
+ },
2513
+ {
2514
+ flagCode: "LK",
2515
+ country: "Sri Lanka",
2516
+ phoneNumberLengthByCountry_phLengthMax: 9,
2517
+ phoneNumberLengthByCountry_phLengthMin: 9,
2518
+ phoneNumberLengthByCountry_phLength: 9
2519
+ },
2520
+ {
2521
+ flagCode: "TW",
2522
+ country: "Tajwan",
2523
+ phoneNumberLengthByCountry_phLengthMax: 9,
2524
+ phoneNumberLengthByCountry_phLengthMin: 8,
2525
+ phoneNumberLengthByCountry_phLength: "8 to 9"
2526
+ },
2527
+ {
2528
+ flagCode: "ZM",
2529
+ country: "Zambia",
2530
+ phoneNumberLengthByCountry_phLengthMax: 9,
2531
+ phoneNumberLengthByCountry_phLengthMin: 9,
2532
+ phoneNumberLengthByCountry_phLength: 9
2533
+ },
2534
+ {
2535
+ flagCode: "CL",
2536
+ country: "Chile",
2537
+ phoneNumberLengthByCountry_phLengthMax: 9,
2538
+ phoneNumberLengthByCountry_phLengthMin: 8,
2539
+ phoneNumberLengthByCountry_phLength: "8 to 9"
2540
+ },
2541
+ {
2542
+ flagCode: "SN",
2543
+ country: "Senegal",
2544
+ phoneNumberLengthByCountry_phLengthMax: 9,
2545
+ phoneNumberLengthByCountry_phLengthMin: 9,
2546
+ phoneNumberLengthByCountry_phLength: 9
2547
+ },
2548
+ {
2549
+ flagCode: "RO",
2550
+ country: "Rumunia",
2551
+ phoneNumberLengthByCountry_phLengthMax: 9,
2552
+ phoneNumberLengthByCountry_phLengthMin: 9,
2553
+ phoneNumberLengthByCountry_phLength: 9
2554
+ },
2555
+ {
2556
+ flagCode: "NL",
2557
+ country: "Holandia",
2558
+ phoneNumberLengthByCountry_phLengthMax: 9,
2559
+ phoneNumberLengthByCountry_phLengthMin: 9,
2560
+ phoneNumberLengthByCountry_phLength: 9
2561
+ },
2562
+ {
2563
+ flagCode: "ZW",
2564
+ country: "Zimbabwe",
2565
+ phoneNumberLengthByCountry_phLengthMax: 9,
2566
+ phoneNumberLengthByCountry_phLengthMin: 5,
2567
+ phoneNumberLengthByCountry_phLength: "5 to 9"
2568
+ },
2569
+ {
2570
+ flagCode: "RW",
2571
+ country: "Rwanda",
2572
+ phoneNumberLengthByCountry_phLengthMax: 9,
2573
+ phoneNumberLengthByCountry_phLengthMin: 9,
2574
+ phoneNumberLengthByCountry_phLength: 9
2575
+ },
2576
+ {
2577
+ flagCode: "BE",
2578
+ country: "Belgia",
2579
+ phoneNumberLengthByCountry_phLengthMax: 9,
2580
+ phoneNumberLengthByCountry_phLengthMin: 8,
2581
+ phoneNumberLengthByCountry_phLength: "8 to 9"
2582
+ },
2583
+ {
2584
+ flagCode: "JO",
2585
+ country: "Jordania",
2586
+ phoneNumberLengthByCountry_phLengthMax: 9,
2587
+ phoneNumberLengthByCountry_phLengthMin: 5,
2588
+ phoneNumberLengthByCountry_phLength: "5 to 9"
2589
+ },
2590
+ {
2591
+ flagCode: "AE",
2592
+ country: "Zjednoczone Emiraty Arabskie",
2593
+ phoneNumberLengthByCountry_phLengthMax: 9,
2594
+ phoneNumberLengthByCountry_phLengthMin: 8,
2595
+ phoneNumberLengthByCountry_phLength: "8 to 9"
2596
+ },
2597
+ {
2598
+ flagCode: "TJ",
2599
+ country: "Tad\u017Cykistan",
2600
+ phoneNumberLengthByCountry_phLengthMax: 9,
2601
+ phoneNumberLengthByCountry_phLengthMin: 9,
2602
+ phoneNumberLengthByCountry_phLength: 9
2603
+ },
2604
+ {
2605
+ flagCode: "AZ",
2606
+ country: "Azerbejd\u017Can",
2607
+ phoneNumberLengthByCountry_phLengthMax: 9,
2608
+ phoneNumberLengthByCountry_phLengthMin: 8,
2609
+ phoneNumberLengthByCountry_phLength: "8 to 9"
2610
+ },
2611
+ {
2612
+ flagCode: "IL",
2613
+ country: "Izrael",
2614
+ phoneNumberLengthByCountry_phLengthMax: 9,
2615
+ phoneNumberLengthByCountry_phLengthMin: 8,
2616
+ phoneNumberLengthByCountry_phLength: "8 to 9"
2617
+ },
2618
+ {
2619
+ flagCode: "HU",
2620
+ country: "W\u0119gry",
2621
+ phoneNumberLengthByCountry_phLengthMax: 9,
2622
+ phoneNumberLengthByCountry_phLengthMin: 8,
2623
+ phoneNumberLengthByCountry_phLength: "8 to 9"
2624
+ },
2625
+ {
2626
+ flagCode: "LA",
2627
+ country: "Laos",
2628
+ phoneNumberLengthByCountry_phLengthMax: 9,
2629
+ phoneNumberLengthByCountry_phLengthMin: 8,
2630
+ phoneNumberLengthByCountry_phLength: "8 to 9"
2631
+ },
2632
+ {
2633
+ flagCode: "LY",
2634
+ country: "Libia",
2635
+ phoneNumberLengthByCountry_phLengthMax: 9,
2636
+ phoneNumberLengthByCountry_phLengthMin: 8,
2637
+ phoneNumberLengthByCountry_phLength: "8 to 9"
2638
+ },
2639
+ {
2640
+ flagCode: "KG",
2641
+ country: "Kirgistan",
2642
+ phoneNumberLengthByCountry_phLengthMax: 9,
2643
+ phoneNumberLengthByCountry_phLengthMin: 9,
2644
+ phoneNumberLengthByCountry_phLength: 9
2645
+ },
2646
+ {
2647
+ flagCode: "HK",
2648
+ country: "Hongkong",
2649
+ phoneNumberLengthByCountry_phLengthMax: 9,
2650
+ phoneNumberLengthByCountry_phLengthMin: 4,
2651
+ phoneNumberLengthByCountry_phLength: "4, 8 to 9"
2652
+ },
2653
+ {
2654
+ flagCode: "PY",
2655
+ country: "Paragwaj",
2656
+ phoneNumberLengthByCountry_phLengthMax: 9,
2657
+ phoneNumberLengthByCountry_phLengthMin: 5,
2658
+ phoneNumberLengthByCountry_phLength: "5 to 9"
2659
+ },
2660
+ {
2661
+ flagCode: "BG",
2662
+ country: "Bu\u0142garia",
2663
+ phoneNumberLengthByCountry_phLengthMax: 9,
2664
+ phoneNumberLengthByCountry_phLengthMin: 7,
2665
+ phoneNumberLengthByCountry_phLength: "7 to 9"
2666
+ },
2667
+ {
2668
+ flagCode: "SK",
2669
+ country: "S\u0142owacja",
2670
+ phoneNumberLengthByCountry_phLengthMax: 9,
2671
+ phoneNumberLengthByCountry_phLengthMin: 4,
2672
+ phoneNumberLengthByCountry_phLength: "4 to 9"
2673
+ },
2674
+ {
2675
+ flagCode: "AL",
2676
+ country: "Albania",
2677
+ phoneNumberLengthByCountry_phLengthMax: 9,
2678
+ phoneNumberLengthByCountry_phLengthMin: 3,
2679
+ phoneNumberLengthByCountry_phLength: "3 to 9"
2680
+ },
2681
+ {
2682
+ flagCode: "IS",
2683
+ country: "Islandia",
2684
+ phoneNumberLengthByCountry_phLengthMax: 9,
2685
+ phoneNumberLengthByCountry_phLengthMin: 7,
2686
+ phoneNumberLengthByCountry_phLength: "7 or 9"
2687
+ },
2688
+ {
2689
+ flagCode: "GP",
2690
+ country: "Gwadelupa",
2691
+ phoneNumberLengthByCountry_phLengthMax: 9,
2692
+ phoneNumberLengthByCountry_phLengthMin: 9,
2693
+ phoneNumberLengthByCountry_phLength: 9
2694
+ },
2695
+ {
2696
+ flagCode: "MQ",
2697
+ country: "Martynika",
2698
+ phoneNumberLengthByCountry_phLengthMax: 9,
2699
+ phoneNumberLengthByCountry_phLengthMin: 9,
2700
+ phoneNumberLengthByCountry_phLength: 9
2701
+ },
2702
+ {
2703
+ flagCode: "GF",
2704
+ country: "Gujana Francuska",
2705
+ phoneNumberLengthByCountry_phLengthMax: 9,
2706
+ phoneNumberLengthByCountry_phLengthMin: 9,
2707
+ phoneNumberLengthByCountry_phLength: 9
2708
+ },
2709
+ {
2710
+ flagCode: "AD",
2711
+ country: "Andora",
2712
+ phoneNumberLengthByCountry_phLengthMax: 9,
2713
+ phoneNumberLengthByCountry_phLengthMin: 6,
2714
+ phoneNumberLengthByCountry_phLength: "6, 8 or 9"
2715
+ },
2716
+ {
2717
+ flagCode: "LI",
2718
+ country: "Liechtenstein",
2719
+ phoneNumberLengthByCountry_phLengthMax: 9,
2720
+ phoneNumberLengthByCountry_phLengthMin: 7,
2721
+ phoneNumberLengthByCountry_phLength: "7 to 9"
2722
+ },
2723
+ {
2724
+ flagCode: "MC",
2725
+ country: "Monako",
2726
+ phoneNumberLengthByCountry_phLengthMax: 9,
2727
+ phoneNumberLengthByCountry_phLengthMin: 5,
2728
+ phoneNumberLengthByCountry_phLength: "5 to 9"
2729
+ },
2730
+ {
2731
+ flagCode: "CI",
2732
+ country: "Wybrze\u017Ce Ko\u015Bci S\u0142oniowej",
2733
+ phoneNumberLengthByCountry_phLengthMax: 8,
2734
+ phoneNumberLengthByCountry_phLengthMin: 8,
2735
+ phoneNumberLengthByCountry_phLength: 8
2736
+ },
2737
+ {
2738
+ flagCode: "CM",
2739
+ country: "Kamerun",
2740
+ phoneNumberLengthByCountry_phLengthMax: 8,
2741
+ phoneNumberLengthByCountry_phLengthMin: 8,
2742
+ phoneNumberLengthByCountry_phLength: 8
2743
+ },
2744
+ {
2745
+ flagCode: "NE",
2746
+ country: "Niger",
2747
+ phoneNumberLengthByCountry_phLengthMax: 8,
2748
+ phoneNumberLengthByCountry_phLengthMin: 8,
2749
+ phoneNumberLengthByCountry_phLength: 8
2750
+ },
2751
+ {
2752
+ flagCode: "ML",
2753
+ country: "Mali",
2754
+ phoneNumberLengthByCountry_phLengthMax: 8,
2755
+ phoneNumberLengthByCountry_phLengthMin: 8,
2756
+ phoneNumberLengthByCountry_phLength: 8
2757
+ },
2758
+ {
2759
+ flagCode: "BF",
2760
+ country: "Burkina Faso",
2761
+ phoneNumberLengthByCountry_phLengthMax: 8,
2762
+ phoneNumberLengthByCountry_phLengthMin: 8,
2763
+ phoneNumberLengthByCountry_phLength: 8
2764
+ },
2765
+ {
2766
+ flagCode: "MW",
2767
+ country: "Malawi",
2768
+ phoneNumberLengthByCountry_phLengthMax: 8,
2769
+ phoneNumberLengthByCountry_phLengthMin: 7,
2770
+ phoneNumberLengthByCountry_phLength: "7 or 8"
2771
+ },
2772
+ {
2773
+ flagCode: "SO",
2774
+ country: "Somalia",
2775
+ phoneNumberLengthByCountry_phLengthMax: 8,
2776
+ phoneNumberLengthByCountry_phLengthMin: 5,
2777
+ phoneNumberLengthByCountry_phLength: "5 to 8"
2778
+ },
2779
+ {
2780
+ flagCode: "GT",
2781
+ country: "Gwatemala",
2782
+ phoneNumberLengthByCountry_phLengthMax: 8,
2783
+ phoneNumberLengthByCountry_phLengthMin: 8,
2784
+ phoneNumberLengthByCountry_phLength: 8
2785
+ },
2786
+ {
2787
+ flagCode: "EC",
2788
+ country: "Ekwador",
2789
+ phoneNumberLengthByCountry_phLengthMax: 8,
2790
+ phoneNumberLengthByCountry_phLengthMin: 8,
2791
+ phoneNumberLengthByCountry_phLength: 8
2792
+ },
2793
+ {
2794
+ flagCode: "KH",
2795
+ country: "Kambod\u017Ca",
2796
+ phoneNumberLengthByCountry_phLengthMax: 8,
2797
+ phoneNumberLengthByCountry_phLengthMin: 8,
2798
+ phoneNumberLengthByCountry_phLength: 8
2799
+ },
2800
+ {
2801
+ flagCode: "GN",
2802
+ country: "Gwinea",
2803
+ phoneNumberLengthByCountry_phLengthMax: 8,
2804
+ phoneNumberLengthByCountry_phLengthMin: 8,
2805
+ phoneNumberLengthByCountry_phLength: 8
2806
+ },
2807
+ {
2808
+ flagCode: "BJ",
2809
+ country: "Benin",
2810
+ phoneNumberLengthByCountry_phLengthMax: 8,
2811
+ phoneNumberLengthByCountry_phLengthMin: 8,
2812
+ phoneNumberLengthByCountry_phLength: 8
2813
+ },
2814
+ {
2815
+ flagCode: "BI",
2816
+ country: "Burundi",
2817
+ phoneNumberLengthByCountry_phLengthMax: 8,
2818
+ phoneNumberLengthByCountry_phLengthMin: 8,
2819
+ phoneNumberLengthByCountry_phLength: 8
2820
+ },
2821
+ {
2822
+ flagCode: "BO",
2823
+ country: "Boliwia",
2824
+ phoneNumberLengthByCountry_phLengthMax: 8,
2825
+ phoneNumberLengthByCountry_phLengthMin: 8,
2826
+ phoneNumberLengthByCountry_phLength: 8
2827
+ },
2828
+ {
2829
+ flagCode: "TN",
2830
+ country: "Tunezja",
2831
+ phoneNumberLengthByCountry_phLengthMax: 8,
2832
+ phoneNumberLengthByCountry_phLengthMin: 8,
2833
+ phoneNumberLengthByCountry_phLength: 8
2834
+ },
2835
+ {
2836
+ flagCode: "HT",
2837
+ country: "Haiti",
2838
+ phoneNumberLengthByCountry_phLengthMax: 8,
2839
+ phoneNumberLengthByCountry_phLengthMin: 8,
2840
+ phoneNumberLengthByCountry_phLength: 8
2841
+ },
2842
+ {
2843
+ flagCode: "HN",
2844
+ country: "Honduras",
2845
+ phoneNumberLengthByCountry_phLengthMax: 8,
2846
+ phoneNumberLengthByCountry_phLengthMin: 7,
2847
+ phoneNumberLengthByCountry_phLength: "7 to 8"
2848
+ },
2849
+ {
2850
+ flagCode: "CU",
2851
+ country: "Kuba",
2852
+ phoneNumberLengthByCountry_phLengthMax: 8,
2853
+ phoneNumberLengthByCountry_phLengthMin: 6,
2854
+ phoneNumberLengthByCountry_phLength: "6 to 8"
2855
+ },
2856
+ {
2857
+ flagCode: "SL",
2858
+ country: "Sierra Leone",
2859
+ phoneNumberLengthByCountry_phLengthMax: 8,
2860
+ phoneNumberLengthByCountry_phLengthMin: 8,
2861
+ phoneNumberLengthByCountry_phLength: 8
2862
+ },
2863
+ {
2864
+ flagCode: "TM",
2865
+ country: "Turkmenistan",
2866
+ phoneNumberLengthByCountry_phLengthMax: 8,
2867
+ phoneNumberLengthByCountry_phLengthMin: 8,
2868
+ phoneNumberLengthByCountry_phLength: 8
2869
+ },
2870
+ {
2871
+ flagCode: "NI",
2872
+ country: "Nikaragua",
2873
+ phoneNumberLengthByCountry_phLengthMax: 8,
2874
+ phoneNumberLengthByCountry_phLengthMin: 8,
2875
+ phoneNumberLengthByCountry_phLength: 8
2876
+ },
2877
+ {
2878
+ flagCode: "DK",
2879
+ country: "Dania",
2880
+ phoneNumberLengthByCountry_phLengthMax: 8,
2881
+ phoneNumberLengthByCountry_phLengthMin: 8,
2882
+ phoneNumberLengthByCountry_phLength: 8
2883
+ },
2884
+ {
2885
+ flagCode: "LB",
2886
+ country: "Liban",
2887
+ phoneNumberLengthByCountry_phLengthMax: 8,
2888
+ phoneNumberLengthByCountry_phLengthMin: 7,
2889
+ phoneNumberLengthByCountry_phLength: "7 to 8"
2890
+ },
2891
+ {
2892
+ flagCode: "LR",
2893
+ country: "Liberia",
2894
+ phoneNumberLengthByCountry_phLengthMax: 8,
2895
+ phoneNumberLengthByCountry_phLengthMin: 7,
2896
+ phoneNumberLengthByCountry_phLength: "7 to 8"
2897
+ },
2898
+ {
2899
+ flagCode: "CF",
2900
+ country: "Republika \u015Arodkowoafryka\u0144ska",
2901
+ phoneNumberLengthByCountry_phLengthMax: 8,
2902
+ phoneNumberLengthByCountry_phLengthMin: 8,
2903
+ phoneNumberLengthByCountry_phLength: 8
2904
+ },
2905
+ {
2906
+ flagCode: "OM",
2907
+ country: "Oman",
2908
+ phoneNumberLengthByCountry_phLengthMax: 8,
2909
+ phoneNumberLengthByCountry_phLengthMin: 7,
2910
+ phoneNumberLengthByCountry_phLength: "7 to 8"
2911
+ },
2912
+ {
2913
+ flagCode: "NO",
2914
+ country: "Norwegia",
2915
+ phoneNumberLengthByCountry_phLengthMax: 8,
2916
+ phoneNumberLengthByCountry_phLengthMin: 5,
2917
+ phoneNumberLengthByCountry_phLength: "5 or 8"
2918
+ },
2919
+ {
2920
+ flagCode: "CR",
2921
+ country: "Kostaryka",
2922
+ phoneNumberLengthByCountry_phLengthMax: 8,
2923
+ phoneNumberLengthByCountry_phLengthMin: 8,
2924
+ phoneNumberLengthByCountry_phLength: 8
2925
+ },
2926
+ {
2927
+ flagCode: "KW",
2928
+ country: "Kuwejt",
2929
+ phoneNumberLengthByCountry_phLengthMax: 8,
2930
+ phoneNumberLengthByCountry_phLengthMin: 7,
2931
+ phoneNumberLengthByCountry_phLength: "7 or 8"
2932
+ },
2933
+ {
2934
+ flagCode: "PA",
2935
+ country: "Panama",
2936
+ phoneNumberLengthByCountry_phLengthMax: 8,
2937
+ phoneNumberLengthByCountry_phLengthMin: 7,
2938
+ phoneNumberLengthByCountry_phLength: "7 or 8"
2939
+ },
2940
+ {
2941
+ flagCode: "GE",
2942
+ country: "Gruzja",
2943
+ phoneNumberLengthByCountry_phLengthMax: 8,
2944
+ phoneNumberLengthByCountry_phLengthMin: 8,
2945
+ phoneNumberLengthByCountry_phLength: 8
2946
+ },
2947
+ {
2948
+ flagCode: "MN",
2949
+ country: "Mongolia",
2950
+ phoneNumberLengthByCountry_phLengthMax: 8,
2951
+ phoneNumberLengthByCountry_phLengthMin: 7,
2952
+ phoneNumberLengthByCountry_phLength: "7 to 8"
2953
+ },
2954
+ {
2955
+ flagCode: "BA",
2956
+ country: "Bo\u015Bnia i Hercegowina",
2957
+ phoneNumberLengthByCountry_phLengthMax: 8,
2958
+ phoneNumberLengthByCountry_phLengthMin: 8,
2959
+ phoneNumberLengthByCountry_phLength: 8
2960
+ },
2961
+ {
2962
+ flagCode: "MD",
2963
+ country: "Mo\u0142dawia",
2964
+ phoneNumberLengthByCountry_phLengthMax: 8,
2965
+ phoneNumberLengthByCountry_phLengthMin: 8,
2966
+ phoneNumberLengthByCountry_phLength: 8
2967
+ },
2968
+ {
2969
+ flagCode: "AM",
2970
+ country: "Armenia",
2971
+ phoneNumberLengthByCountry_phLengthMax: 8,
2972
+ phoneNumberLengthByCountry_phLengthMin: 8,
2973
+ phoneNumberLengthByCountry_phLength: 8
2974
+ },
2975
+ {
2976
+ flagCode: "LT",
2977
+ country: "Litwa",
2978
+ phoneNumberLengthByCountry_phLengthMax: 8,
2979
+ phoneNumberLengthByCountry_phLengthMin: 8,
2980
+ phoneNumberLengthByCountry_phLength: 8
2981
+ },
2982
+ {
2983
+ flagCode: "BW",
2984
+ country: "Botswana",
2985
+ phoneNumberLengthByCountry_phLengthMax: 8,
2986
+ phoneNumberLengthByCountry_phLengthMin: 7,
2987
+ phoneNumberLengthByCountry_phLength: "7 to 8"
2988
+ },
2989
+ {
2990
+ flagCode: "LS",
2991
+ country: "Lesotho",
2992
+ phoneNumberLengthByCountry_phLengthMax: 8,
2993
+ phoneNumberLengthByCountry_phLengthMin: 8,
2994
+ phoneNumberLengthByCountry_phLength: 8
2995
+ },
2996
+ {
2997
+ flagCode: "SI",
2998
+ country: "S\u0142owenia",
2999
+ phoneNumberLengthByCountry_phLengthMax: 8,
3000
+ phoneNumberLengthByCountry_phLengthMin: 8,
3001
+ phoneNumberLengthByCountry_phLength: 8
3002
+ },
3003
+ {
3004
+ flagCode: "LV",
3005
+ country: "\u0141otwa",
3006
+ phoneNumberLengthByCountry_phLengthMax: 8,
3007
+ phoneNumberLengthByCountry_phLengthMin: 7,
3008
+ phoneNumberLengthByCountry_phLength: "7 or 8"
3009
+ },
3010
+ {
3011
+ flagCode: "MK",
3012
+ country: "Macedonia P\xF3\u0142nocna",
3013
+ phoneNumberLengthByCountry_phLengthMax: 8,
3014
+ phoneNumberLengthByCountry_phLengthMin: 8,
3015
+ phoneNumberLengthByCountry_phLength: 8
3016
+ },
3017
+ {
3018
+ flagCode: "BH",
3019
+ country: "Bahrajn",
3020
+ phoneNumberLengthByCountry_phLengthMax: 8,
3021
+ phoneNumberLengthByCountry_phLengthMin: 8,
3022
+ phoneNumberLengthByCountry_phLength: 8
3023
+ },
3024
+ {
3025
+ flagCode: "SZ",
3026
+ country: "Eswatini",
3027
+ phoneNumberLengthByCountry_phLengthMax: 8,
3028
+ phoneNumberLengthByCountry_phLengthMin: 7,
3029
+ phoneNumberLengthByCountry_phLength: "7 to 8"
3030
+ },
3031
+ {
3032
+ flagCode: "BT",
3033
+ country: "Bhutan",
3034
+ phoneNumberLengthByCountry_phLengthMax: 8,
3035
+ phoneNumberLengthByCountry_phLengthMin: 7,
3036
+ phoneNumberLengthByCountry_phLength: "7 to 8"
3037
+ },
3038
+ {
3039
+ flagCode: "MO",
3040
+ country: "Makao",
3041
+ phoneNumberLengthByCountry_phLengthMax: 8,
3042
+ phoneNumberLengthByCountry_phLengthMin: 7,
3043
+ phoneNumberLengthByCountry_phLength: "7 to 8"
3044
+ },
3045
+ {
3046
+ flagCode: "MT",
3047
+ country: "Malta",
3048
+ phoneNumberLengthByCountry_phLengthMax: 8,
3049
+ phoneNumberLengthByCountry_phLengthMin: 8,
3050
+ phoneNumberLengthByCountry_phLength: 8
3051
+ },
3052
+ {
3053
+ flagCode: "CW",
3054
+ country: "Cura\xE7ao",
3055
+ phoneNumberLengthByCountry_phLengthMax: 8,
3056
+ phoneNumberLengthByCountry_phLengthMin: 7,
3057
+ phoneNumberLengthByCountry_phLength: "7 to 8"
3058
+ },
3059
+ {
3060
+ flagCode: "GI",
3061
+ country: "Gibraltar",
3062
+ phoneNumberLengthByCountry_phLengthMax: 8,
3063
+ phoneNumberLengthByCountry_phLengthMin: 8,
3064
+ phoneNumberLengthByCountry_phLength: 8
3065
+ },
3066
+ {
3067
+ flagCode: "TD",
3068
+ country: "Czad",
3069
+ phoneNumberLengthByCountry_phLengthMax: 7,
3070
+ phoneNumberLengthByCountry_phLengthMin: 6,
3071
+ phoneNumberLengthByCountry_phLength: "6 to 7"
3072
+ },
3073
+ {
3074
+ flagCode: "TG",
3075
+ country: "Togo",
3076
+ phoneNumberLengthByCountry_phLengthMax: 7,
3077
+ phoneNumberLengthByCountry_phLengthMin: 7,
3078
+ phoneNumberLengthByCountry_phLength: 7
3079
+ },
3080
+ {
3081
+ flagCode: "CG",
3082
+ country: "Republika Konga",
3083
+ phoneNumberLengthByCountry_phLengthMax: 7,
3084
+ phoneNumberLengthByCountry_phLengthMin: 6,
3085
+ phoneNumberLengthByCountry_phLength: "6 to 7"
3086
+ },
3087
+ {
3088
+ flagCode: "MR",
3089
+ country: "Mauretania",
3090
+ phoneNumberLengthByCountry_phLengthMax: 7,
3091
+ phoneNumberLengthByCountry_phLengthMin: 7,
3092
+ phoneNumberLengthByCountry_phLength: 7
3093
+ },
3094
+ {
3095
+ flagCode: "ER",
3096
+ country: "Erytrea",
3097
+ phoneNumberLengthByCountry_phLengthMax: 7,
3098
+ phoneNumberLengthByCountry_phLengthMin: 7,
3099
+ phoneNumberLengthByCountry_phLength: 7
3100
+ },
3101
+ {
3102
+ flagCode: "GM",
3103
+ country: "Gambia",
3104
+ phoneNumberLengthByCountry_phLengthMax: 7,
3105
+ phoneNumberLengthByCountry_phLengthMin: 7,
3106
+ phoneNumberLengthByCountry_phLength: 7
3107
+ },
3108
+ {
3109
+ flagCode: "GA",
3110
+ country: "Gabon",
3111
+ phoneNumberLengthByCountry_phLengthMax: 7,
3112
+ phoneNumberLengthByCountry_phLengthMin: 6,
3113
+ phoneNumberLengthByCountry_phLength: "6 or 7"
3114
+ },
3115
+ {
3116
+ flagCode: "GW",
3117
+ country: "Gwinea Bissau",
3118
+ phoneNumberLengthByCountry_phLengthMax: 7,
3119
+ phoneNumberLengthByCountry_phLengthMin: 7,
3120
+ phoneNumberLengthByCountry_phLength: 7
3121
+ },
3122
+ {
3123
+ flagCode: "TL",
3124
+ country: "Timor Wschodni",
3125
+ phoneNumberLengthByCountry_phLengthMax: 7,
3126
+ phoneNumberLengthByCountry_phLengthMin: 7,
3127
+ phoneNumberLengthByCountry_phLength: 7
3128
+ },
3129
+ {
3130
+ flagCode: "MU",
3131
+ country: "Mauritius",
3132
+ phoneNumberLengthByCountry_phLengthMax: 7,
3133
+ phoneNumberLengthByCountry_phLengthMin: 7,
3134
+ phoneNumberLengthByCountry_phLength: 7
3135
+ },
3136
+ {
3137
+ flagCode: "FJ",
3138
+ country: "Fid\u017Ci",
3139
+ phoneNumberLengthByCountry_phLengthMax: 7,
3140
+ phoneNumberLengthByCountry_phLengthMin: 7,
3141
+ phoneNumberLengthByCountry_phLength: 7
3142
+ },
3143
+ {
3144
+ flagCode: "KM",
3145
+ country: "Komory",
3146
+ phoneNumberLengthByCountry_phLengthMax: 7,
3147
+ phoneNumberLengthByCountry_phLengthMin: 7,
3148
+ phoneNumberLengthByCountry_phLength: 7
3149
+ },
3150
+ {
3151
+ flagCode: "GY",
3152
+ country: "Gujana",
3153
+ phoneNumberLengthByCountry_phLengthMax: 7,
3154
+ phoneNumberLengthByCountry_phLengthMin: 7,
3155
+ phoneNumberLengthByCountry_phLength: 7
3156
+ },
3157
+ {
3158
+ flagCode: "SR",
3159
+ country: "Surinam",
3160
+ phoneNumberLengthByCountry_phLengthMax: 7,
3161
+ phoneNumberLengthByCountry_phLengthMin: 6,
3162
+ phoneNumberLengthByCountry_phLength: "6 to 7"
3163
+ },
3164
+ {
3165
+ flagCode: "MV",
3166
+ country: "Malediwy",
3167
+ phoneNumberLengthByCountry_phLengthMax: 7,
3168
+ phoneNumberLengthByCountry_phLengthMin: 7,
3169
+ phoneNumberLengthByCountry_phLength: 7
3170
+ },
3171
+ {
3172
+ flagCode: "CV",
3173
+ country: "Wyspy Zielonego Przyl\u0105dka",
3174
+ phoneNumberLengthByCountry_phLengthMax: 7,
3175
+ phoneNumberLengthByCountry_phLengthMin: 7,
3176
+ phoneNumberLengthByCountry_phLength: 7
3177
+ },
3178
+ {
3179
+ flagCode: "BN",
3180
+ country: "Brunei",
3181
+ phoneNumberLengthByCountry_phLengthMax: 7,
3182
+ phoneNumberLengthByCountry_phLengthMin: 7,
3183
+ phoneNumberLengthByCountry_phLength: 7
3184
+ },
3185
+ {
3186
+ flagCode: "BZ",
3187
+ country: "Belize",
3188
+ phoneNumberLengthByCountry_phLengthMax: 7,
3189
+ phoneNumberLengthByCountry_phLengthMin: 7,
3190
+ phoneNumberLengthByCountry_phLength: 7
3191
+ },
3192
+ {
3193
+ flagCode: "VU",
3194
+ country: "Vanuatu",
3195
+ phoneNumberLengthByCountry_phLengthMax: 7,
3196
+ phoneNumberLengthByCountry_phLengthMin: 5,
3197
+ phoneNumberLengthByCountry_phLength: "5 or 7"
3198
+ },
3199
+ {
3200
+ flagCode: "ST",
3201
+ country: "Wyspy \u015Awi\u0119tego Tomasza i Ksi\u0105\u017C\u0119ca",
3202
+ phoneNumberLengthByCountry_phLengthMax: 7,
3203
+ phoneNumberLengthByCountry_phLengthMin: 7,
3204
+ phoneNumberLengthByCountry_phLength: 7
3205
+ },
3206
+ {
3207
+ flagCode: "WS",
3208
+ country: "Samoa",
3209
+ phoneNumberLengthByCountry_phLengthMax: 7,
3210
+ phoneNumberLengthByCountry_phLengthMin: 3,
3211
+ phoneNumberLengthByCountry_phLength: "3 to 7"
3212
+ },
3213
+ {
3214
+ flagCode: "FM",
3215
+ country: "Mikronezja",
3216
+ phoneNumberLengthByCountry_phLengthMax: 7,
3217
+ phoneNumberLengthByCountry_phLengthMin: 7,
3218
+ phoneNumberLengthByCountry_phLength: 7
3219
+ },
3220
+ {
3221
+ flagCode: "AW",
3222
+ country: "Aruba",
3223
+ phoneNumberLengthByCountry_phLengthMax: 7,
3224
+ phoneNumberLengthByCountry_phLengthMin: 7,
3225
+ phoneNumberLengthByCountry_phLength: 7
3226
+ },
3227
+ {
3228
+ flagCode: "TO",
3229
+ country: "Tonga",
3230
+ phoneNumberLengthByCountry_phLengthMax: 7,
3231
+ phoneNumberLengthByCountry_phLengthMin: 5,
3232
+ phoneNumberLengthByCountry_phLength: "5 or 7"
3233
+ },
3234
+ {
3235
+ flagCode: "MH",
3236
+ country: "Wyspy Marshalla",
3237
+ phoneNumberLengthByCountry_phLengthMax: 7,
3238
+ phoneNumberLengthByCountry_phLengthMin: 7,
3239
+ phoneNumberLengthByCountry_phLength: 7
3240
+ },
3241
+ {
3242
+ flagCode: "PW",
3243
+ country: "Palau",
3244
+ phoneNumberLengthByCountry_phLengthMax: 7,
3245
+ phoneNumberLengthByCountry_phLengthMin: 7,
3246
+ phoneNumberLengthByCountry_phLength: 7
3247
+ },
3248
+ {
3249
+ flagCode: "NR",
3250
+ country: "Nauru",
3251
+ phoneNumberLengthByCountry_phLengthMax: 7,
3252
+ phoneNumberLengthByCountry_phLengthMin: 4,
3253
+ phoneNumberLengthByCountry_phLength: "4 or 7"
3254
+ },
3255
+ {
3256
+ flagCode: "GQ",
3257
+ country: "Gwinea R\xF3wnikowa",
3258
+ phoneNumberLengthByCountry_phLengthMax: 6,
3259
+ phoneNumberLengthByCountry_phLengthMin: 6,
3260
+ phoneNumberLengthByCountry_phLength: 6
3261
+ },
3262
+ {
3263
+ flagCode: "DJ",
3264
+ country: "D\u017Cibuti",
3265
+ phoneNumberLengthByCountry_phLengthMax: 6,
3266
+ phoneNumberLengthByCountry_phLengthMin: 6,
3267
+ phoneNumberLengthByCountry_phLength: 6
3268
+ },
3269
+ {
3270
+ flagCode: "NC",
3271
+ country: "Nowa Kaledonia",
3272
+ phoneNumberLengthByCountry_phLengthMax: 6,
3273
+ phoneNumberLengthByCountry_phLengthMin: 6,
3274
+ phoneNumberLengthByCountry_phLength: 6
3275
+ },
3276
+ {
3277
+ flagCode: "PF",
3278
+ country: "Polinezja Francuska",
3279
+ phoneNumberLengthByCountry_phLengthMax: 6,
3280
+ phoneNumberLengthByCountry_phLengthMin: 6,
3281
+ phoneNumberLengthByCountry_phLength: 6
3282
+ },
3283
+ {
3284
+ flagCode: "SC",
3285
+ country: "Seszele",
3286
+ phoneNumberLengthByCountry_phLengthMax: 6,
3287
+ phoneNumberLengthByCountry_phLengthMin: 6,
3288
+ phoneNumberLengthByCountry_phLength: 6
3289
+ },
3290
+ {
3291
+ flagCode: "FO",
3292
+ country: "Wyspy Owcze",
3293
+ phoneNumberLengthByCountry_phLengthMax: 6,
3294
+ phoneNumberLengthByCountry_phLengthMin: 6,
3295
+ phoneNumberLengthByCountry_phLength: 6
3296
+ },
3297
+ {
3298
+ flagCode: "GL",
3299
+ country: "Grenlandia",
3300
+ phoneNumberLengthByCountry_phLengthMax: 6,
3301
+ phoneNumberLengthByCountry_phLengthMin: 6,
3302
+ phoneNumberLengthByCountry_phLength: 6
3303
+ },
3304
+ {
3305
+ flagCode: "WF",
3306
+ country: "Wallis i Futuna",
3307
+ phoneNumberLengthByCountry_phLengthMax: 6,
3308
+ phoneNumberLengthByCountry_phLengthMin: 6,
3309
+ phoneNumberLengthByCountry_phLength: 6
3310
+ },
3311
+ {
3312
+ flagCode: "TV",
3313
+ country: "Tuvalu",
3314
+ phoneNumberLengthByCountry_phLengthMax: 6,
3315
+ phoneNumberLengthByCountry_phLengthMin: 5,
3316
+ phoneNumberLengthByCountry_phLength: "5 or 6"
3317
+ },
3318
+ {
3319
+ flagCode: "PM",
3320
+ country: "Saint-Pierre i Miquelon",
3321
+ phoneNumberLengthByCountry_phLengthMax: 6,
3322
+ phoneNumberLengthByCountry_phLengthMin: 6,
3323
+ phoneNumberLengthByCountry_phLength: 6
3324
+ },
3325
+ {
3326
+ flagCode: "SB",
3327
+ country: "Wyspy Salomona",
3328
+ phoneNumberLengthByCountry_phLengthMax: 5,
3329
+ phoneNumberLengthByCountry_phLengthMin: 5,
3330
+ phoneNumberLengthByCountry_phLength: 5
3331
+ },
3332
+ {
3333
+ flagCode: "KI",
3334
+ country: "Kiribati",
3335
+ phoneNumberLengthByCountry_phLengthMax: 5,
3336
+ phoneNumberLengthByCountry_phLengthMin: 5,
3337
+ phoneNumberLengthByCountry_phLength: 5
3338
+ },
3339
+ {
3340
+ flagCode: "CK",
3341
+ country: "Wyspy Cooka",
3342
+ phoneNumberLengthByCountry_phLengthMax: 5,
3343
+ phoneNumberLengthByCountry_phLengthMin: 5,
3344
+ phoneNumberLengthByCountry_phLength: 5
3345
+ },
3346
+ {
3347
+ flagCode: "FK",
3348
+ country: "Falklandy",
3349
+ phoneNumberLengthByCountry_phLengthMax: 5,
3350
+ phoneNumberLengthByCountry_phLengthMin: 5,
3351
+ phoneNumberLengthByCountry_phLength: 5
3352
+ },
3353
+ {
3354
+ flagCode: "TK",
3355
+ country: "Tokelau",
3356
+ phoneNumberLengthByCountry_phLengthMax: 4,
3357
+ phoneNumberLengthByCountry_phLengthMin: 4,
3358
+ phoneNumberLengthByCountry_phLength: 4
3359
+ },
3360
+ {
3361
+ flagCode: "NU",
3362
+ country: "Niue",
3363
+ phoneNumberLengthByCountry_phLengthMax: 4,
3364
+ phoneNumberLengthByCountry_phLengthMin: 4,
3365
+ phoneNumberLengthByCountry_phLength: 4
3366
+ }
3367
+ ]
3368
+ };
3369
+ var COUNTRIES = countries_default.countries.map((c) => {
3370
+ let dialCode = "";
3371
+ try {
3372
+ dialCode = "+" + getCountryCallingCode(c.flagCode);
3373
+ } catch {
3374
+ dialCode = "";
3375
+ }
3376
+ return {
3377
+ flagCode: c.flagCode,
3378
+ country: c.country,
3379
+ dialCode,
3380
+ maxLength: c.phoneNumberLengthByCountry_phLengthMax,
3381
+ minLength: c.phoneNumberLengthByCountry_phLengthMin ?? 1
3382
+ };
3383
+ }).sort((a, b) => a.country.localeCompare(b.country, "pl"));
3384
+ var DEFAULT_COUNTRY = COUNTRIES.find((c) => c.flagCode === "US") ?? COUNTRIES[0];
3385
+ var wrapperColors = (theme, error, focused) => ({
3386
+ borderColor: focused ? error ? theme.palette.error.main : theme.palette.primary.main : error ? theme.palette.error.main : theme.palette.divider,
3387
+ boxShadow: focused ? `0 0 0 3px ${error ? theme.palette.error.main : theme.palette.primary.main}33` : "none",
3388
+ "&:hover": {
3389
+ borderColor: !focused ? error ? theme.palette.error.dark : theme.palette.text.secondary : void 0
3390
+ }
3391
+ });
3392
+ var Root6 = styled("div")(({ $fullWidth }) => ({
3393
+ display: $fullWidth ? "block" : "inline-block",
3394
+ width: $fullWidth ? "100%" : "auto"
3395
+ }));
3396
+ var InputWrapper2 = styled("div")(
3397
+ ({ theme, $size, $fullWidth, $error, $focused, $disabled }) => ({
3398
+ position: "relative",
3399
+ display: "inline-flex",
3400
+ alignItems: "center",
3401
+ width: $fullWidth ? "100%" : "auto",
3402
+ height: inputHeightMap[$size],
3403
+ borderRadius: theme.shape.borderRadius,
3404
+ border: "1px solid",
3405
+ backgroundColor: $disabled ? theme.palette.action.disabledBackground : theme.palette.background.paper,
3406
+ transition: "border-color 150ms ease, box-shadow 150ms ease",
3407
+ fontSize: inputSizeMap[$size].fontSize,
3408
+ overflow: "visible",
3409
+ ...$disabled ? {
3410
+ borderColor: theme.palette.action.disabled,
3411
+ pointerEvents: "none"
3412
+ } : wrapperColors(theme, $error, $focused)
3413
+ })
3414
+ );
3415
+ var CountryTrigger = styled("button")(({ theme, $size }) => ({
3416
+ display: "inline-flex",
3417
+ alignItems: "center",
3418
+ alignSelf: "stretch",
3419
+ gap: "0.375rem",
3420
+ flexShrink: 0,
3421
+ padding: inputSizeMap[$size].padding,
3422
+ paddingBlock: 0,
3423
+ background: "none",
3424
+ border: "none",
3425
+ outline: "none",
3426
+ cursor: "pointer",
3427
+ color: theme.palette.text.primary,
3428
+ fontFamily: theme.typography.fontFamily,
3429
+ fontSize: "inherit",
3430
+ borderRadius: `${theme.shape.borderRadius}px 0 0 ${theme.shape.borderRadius}px`,
3431
+ "&:hover": {
3432
+ backgroundColor: theme.palette.action.hover
3433
+ },
3434
+ "&:disabled": {
3435
+ color: theme.palette.action.disabled,
3436
+ cursor: "not-allowed"
3437
+ }
3438
+ }));
3439
+ var DialCode = styled("span")({
3440
+ fontVariantNumeric: "tabular-nums",
3441
+ whiteSpace: "nowrap"
3442
+ });
3443
+ var ChevronIcon = styled("span")(({ $open }) => ({
3444
+ display: "inline-flex",
3445
+ alignItems: "center",
3446
+ transition: "transform 150ms ease",
3447
+ transform: $open ? "rotate(180deg)" : "rotate(0deg)"
3448
+ }));
3449
+ var Divider = styled("span")(({ theme }) => ({
3450
+ width: "1px",
3451
+ alignSelf: "stretch",
3452
+ backgroundColor: theme.palette.divider,
3453
+ flexShrink: 0,
3454
+ margin: "4px 0"
3455
+ }));
3456
+ var StyledInput2 = styled("input")(({ theme, $size }) => ({
3457
+ flex: 1,
3458
+ minWidth: 0,
3459
+ border: "none",
3460
+ outline: "none",
3461
+ background: "transparent",
3462
+ fontFamily: theme.typography.fontFamily,
3463
+ fontSize: "inherit",
3464
+ color: theme.palette.text.primary,
3465
+ padding: inputSizeMap[$size].padding,
3466
+ paddingBlock: 0,
3467
+ "&::placeholder": {
3468
+ color: theme.palette.text.disabled
3469
+ },
3470
+ "&:disabled": {
3471
+ color: theme.palette.action.disabled,
3472
+ cursor: "not-allowed"
3473
+ }
3474
+ }));
3475
+ var DropdownPanel3 = styled(DropdownPanel)({
3476
+ minWidth: "280px",
3477
+ display: "flex",
3478
+ flexDirection: "column",
3479
+ overflow: "hidden"
3480
+ });
3481
+ var SearchBox = styled("div")(({ theme }) => ({
3482
+ padding: "0.5rem",
3483
+ borderBottom: `1px solid ${theme.palette.divider}`,
3484
+ flexShrink: 0
3485
+ }));
3486
+ var SearchInput2 = styled("input")(({ theme }) => ({
3487
+ width: "100%",
3488
+ border: `1px solid ${theme.palette.divider}`,
3489
+ borderRadius: theme.shape.borderRadius,
3490
+ padding: "0.25rem 0.5rem",
3491
+ fontSize: "0.875rem",
3492
+ fontFamily: theme.typography.fontFamily,
3493
+ color: theme.palette.text.primary,
3494
+ background: theme.palette.background.paper,
3495
+ outline: "none",
3496
+ "&:focus": {
3497
+ borderColor: theme.palette.primary.main,
3498
+ boxShadow: `0 0 0 2px ${theme.palette.primary.main}33`
3499
+ },
3500
+ "&::placeholder": {
3501
+ color: theme.palette.text.disabled
3502
+ }
3503
+ }));
3504
+ var OptionList = styled("ul")({
3505
+ listStyle: "none",
3506
+ margin: 0,
3507
+ padding: "0.25rem 0",
3508
+ overflowY: "auto",
3509
+ maxHeight: "220px"
3510
+ });
3511
+ var OptionItem2 = styled("li")(({ theme, $selected }) => ({
3512
+ display: "flex",
3513
+ alignItems: "center",
3514
+ gap: "0.5rem",
3515
+ padding: "0.375rem 0.75rem",
3516
+ cursor: "pointer",
3517
+ fontSize: "0.875rem",
3518
+ fontFamily: theme.typography.fontFamily,
3519
+ color: theme.palette.text.primary,
3520
+ backgroundColor: $selected ? theme.palette.action.selected : "transparent",
3521
+ "&:hover": {
3522
+ backgroundColor: $selected ? theme.palette.action.selected : theme.palette.action.hover
3523
+ }
3524
+ }));
3525
+ var CountryName = styled("span")({
3526
+ flex: 1,
3527
+ overflow: "hidden",
3528
+ textOverflow: "ellipsis",
3529
+ whiteSpace: "nowrap"
3530
+ });
3531
+ var OptionDialCode = styled("span")(({ theme }) => ({
3532
+ color: theme.palette.text.secondary,
3533
+ flexShrink: 0,
3534
+ fontVariantNumeric: "tabular-nums"
3535
+ }));
3536
+ var EmptyMessage = styled("p")(({ theme }) => ({
3537
+ margin: 0,
3538
+ padding: "0.75rem",
3539
+ textAlign: "center",
3540
+ fontSize: "0.875rem",
3541
+ color: theme.palette.text.secondary
3542
+ }));
3543
+ var PhoneInput = forwardRef(
3544
+ ({
3545
+ value,
3546
+ defaultValue = "",
3547
+ defaultCountry,
3548
+ onChange,
3549
+ onCountryChange,
3550
+ label,
3551
+ helperText,
3552
+ error = false,
3553
+ size = "md",
3554
+ fullWidth = false,
3555
+ disabled = false,
3556
+ placeholder,
3557
+ id,
3558
+ countrySelectAriaLabel = (country, dialCode) => `Wybierz kraj, aktualny: ${country} (${dialCode})`,
3559
+ phoneAriaLabel = "Numer telefonu",
3560
+ countryListAriaLabel = "Wybierz kraj",
3561
+ countrySearchPlaceholder = "Szukaj kraju\u2026",
3562
+ countrySearchAriaLabel = "Szukaj kraju",
3563
+ digitsLabel = "cyfr"
3564
+ }, ref) => {
3565
+ const autoId = useId();
3566
+ const inputId = id ?? autoId;
3567
+ const listboxId = `${inputId}-listbox`;
3568
+ const initialCountry = useMemo(
3569
+ () => COUNTRIES.find((c) => c.flagCode === defaultCountry) ?? DEFAULT_COUNTRY,
3570
+ [defaultCountry]
3571
+ );
3572
+ const [selectedCountry, setSelectedCountry] = useState(initialCountry);
3573
+ const [isOpen, setIsOpen] = useState(false);
3574
+ const [searchQuery, setSearchQuery] = useState("");
3575
+ const [focused, setFocused] = useState(false);
3576
+ const isControlled = value !== void 0;
3577
+ const [internalValue, setInternalValue] = useState(defaultValue);
3578
+ const phoneValue = isControlled ? value : internalValue;
3579
+ const rootRef = useRef(null);
3580
+ const searchRef = useRef(null);
3581
+ const filteredCountries = useMemo(() => {
3582
+ const q = searchQuery.toLowerCase().trim();
3583
+ if (!q) return COUNTRIES;
3584
+ return COUNTRIES.filter(
3585
+ (c) => c.country.toLowerCase().includes(q) || c.flagCode.toLowerCase().includes(q) || c.dialCode.includes(q)
3586
+ );
3587
+ }, [searchQuery]);
3588
+ const close = useCallback(() => {
3589
+ setIsOpen(false);
3590
+ setSearchQuery("");
3591
+ }, []);
3592
+ const openDropdown = () => {
3593
+ if (disabled) return;
3594
+ setIsOpen((prev) => !prev);
3595
+ if (!isOpen) {
3596
+ setTimeout(() => searchRef.current?.focus(), 0);
3597
+ }
3598
+ };
3599
+ const selectCountry = (country) => {
3600
+ setSelectedCountry(country);
3601
+ onCountryChange?.(country);
3602
+ close();
3603
+ if (!isControlled) setInternalValue("");
3604
+ onChange?.("", { country, dialCode: country.dialCode, fullNumber: country.dialCode });
3605
+ };
3606
+ const handlePhoneChange = (e) => {
3607
+ const raw = e.target.value.replace(/\D/g, "");
3608
+ const clamped = raw.slice(0, selectedCountry.maxLength);
3609
+ if (!isControlled) setInternalValue(clamped);
3610
+ onChange?.(clamped, {
3611
+ country: selectedCountry,
3612
+ dialCode: selectedCountry.dialCode,
3613
+ fullNumber: selectedCountry.dialCode + clamped
3614
+ });
3615
+ };
3616
+ const handlePhoneKeyDown = (e) => {
3617
+ if (e.ctrlKey || e.metaKey || e.altKey || e.key.length > 1) return;
3618
+ if (!/^\d$/.test(e.key)) e.preventDefault();
3619
+ };
3620
+ useEffect(() => {
3621
+ if (!isOpen) return;
3622
+ const handler = (e) => {
3623
+ if (rootRef.current && !rootRef.current.contains(e.target)) close();
3624
+ };
3625
+ document.addEventListener("mousedown", handler);
3626
+ return () => document.removeEventListener("mousedown", handler);
3627
+ }, [isOpen, close]);
3628
+ const derivedPlaceholder = placeholder ?? (selectedCountry.minLength === selectedCountry.maxLength ? `${selectedCountry.maxLength} ${digitsLabel}` : `${selectedCountry.minLength}\u2013${selectedCountry.maxLength} ${digitsLabel}`);
3629
+ return /* @__PURE__ */ jsxs(Root6, { $fullWidth: fullWidth, ref: rootRef, children: [
3630
+ label && /* @__PURE__ */ jsx(Label, { htmlFor: inputId, error, size, children: label }),
3631
+ /* @__PURE__ */ jsxs(
3632
+ InputWrapper2,
3633
+ {
3634
+ $size: size,
3635
+ $fullWidth: fullWidth,
3636
+ $error: error,
3637
+ $focused: focused || isOpen,
3638
+ $disabled: disabled,
3639
+ "data-disabled": disabled || void 0,
3640
+ children: [
3641
+ /* @__PURE__ */ jsxs(
3642
+ CountryTrigger,
3643
+ {
3644
+ type: "button",
3645
+ $size: size,
3646
+ disabled,
3647
+ "aria-haspopup": "listbox",
3648
+ "aria-expanded": isOpen,
3649
+ "aria-controls": isOpen ? listboxId : void 0,
3650
+ "aria-label": countrySelectAriaLabel(selectedCountry.country, selectedCountry.dialCode),
3651
+ onClick: openDropdown,
3652
+ onKeyDown: (e) => e.key === "Escape" && close(),
3653
+ onFocus: () => setFocused(true),
3654
+ onBlur: () => setFocused(false),
3655
+ children: [
3656
+ /* @__PURE__ */ jsx(CountryFlag, { countryCode: selectedCountry.flagCode, size }),
3657
+ /* @__PURE__ */ jsx(DialCode, { children: selectedCountry.dialCode }),
3658
+ /* @__PURE__ */ jsx(ChevronIcon, { $open: isOpen, children: /* @__PURE__ */ jsx(Chevron, {}) })
3659
+ ]
3660
+ }
3661
+ ),
3662
+ /* @__PURE__ */ jsx(Divider, { "aria-hidden": true }),
3663
+ /* @__PURE__ */ jsx(
3664
+ StyledInput2,
3665
+ {
3666
+ ref,
3667
+ id: inputId,
3668
+ $size: size,
3669
+ type: "tel",
3670
+ inputMode: "numeric",
3671
+ value: phoneValue,
3672
+ onChange: handlePhoneChange,
3673
+ onKeyDown: handlePhoneKeyDown,
3674
+ onFocus: () => setFocused(true),
3675
+ onBlur: () => setFocused(false),
3676
+ disabled,
3677
+ placeholder: derivedPlaceholder,
3678
+ maxLength: selectedCountry.maxLength,
3679
+ "aria-label": label ? void 0 : phoneAriaLabel
3680
+ }
3681
+ ),
3682
+ isOpen && /* @__PURE__ */ jsxs(DropdownPanel3, { id: listboxId, role: "listbox", "aria-label": countryListAriaLabel, children: [
3683
+ /* @__PURE__ */ jsx(SearchBox, { children: /* @__PURE__ */ jsx(
3684
+ SearchInput2,
3685
+ {
3686
+ ref: searchRef,
3687
+ type: "search",
3688
+ placeholder: countrySearchPlaceholder,
3689
+ value: searchQuery,
3690
+ onChange: (e) => setSearchQuery(e.target.value),
3691
+ onKeyDown: (e) => e.key === "Escape" && close(),
3692
+ "aria-label": countrySearchAriaLabel
3693
+ }
3694
+ ) }),
3695
+ /* @__PURE__ */ jsx(OptionList, { children: filteredCountries.length === 0 ? /* @__PURE__ */ jsx(EmptyMessage, { children: "Nie znaleziono kraju" }) : filteredCountries.map((country) => {
3696
+ const isSelected = country.flagCode === selectedCountry.flagCode;
3697
+ return /* @__PURE__ */ jsxs(
3698
+ OptionItem2,
3699
+ {
3700
+ role: "option",
3701
+ "aria-selected": isSelected,
3702
+ $selected: isSelected,
3703
+ onClick: () => selectCountry(country),
3704
+ onKeyDown: (e) => e.key === "Enter" && selectCountry(country),
3705
+ tabIndex: 0,
3706
+ children: [
3707
+ /* @__PURE__ */ jsx(CountryFlag, { countryCode: country.flagCode, size: "sm" }),
3708
+ /* @__PURE__ */ jsx(CountryName, { children: country.country }),
3709
+ /* @__PURE__ */ jsx(OptionDialCode, { children: country.dialCode })
3710
+ ]
3711
+ },
3712
+ country.flagCode
3713
+ );
3714
+ }) })
3715
+ ] })
3716
+ ]
3717
+ }
3718
+ ),
3719
+ helperText && /* @__PURE__ */ jsx(HelperText, { error, children: helperText })
3720
+ ] });
3721
+ }
3722
+ );
3723
+ PhoneInput.displayName = "PhoneInput";
3724
+ var TextInput = forwardRef(
3725
+ ({ type = "text", ...rest }, ref) => /* @__PURE__ */ jsx(BaseInput, { ref, type, ...rest })
3726
+ );
3727
+ TextInput.displayName = "TextInput";
3728
+ var BREAKPOINT_MAP = {
3729
+ base: "xs",
3730
+ sm: "sm",
3731
+ md: "md",
3732
+ lg: "lg",
3733
+ xl: "xl",
3734
+ "2xl": "xl"
3735
+ };
3736
+ var GAP_MAP = {
3737
+ 0: "0",
3738
+ 1: "0.25rem",
3739
+ 2: "0.5rem",
3740
+ 3: "0.75rem",
3741
+ 4: "1rem",
3742
+ 5: "1.25rem",
3743
+ 6: "1.5rem",
3744
+ 8: "2rem",
3745
+ 10: "2.5rem",
3746
+ 12: "3rem"
3747
+ };
3748
+ var COLS_MAP = {
3749
+ 1: "repeat(1, minmax(0, 1fr))",
3750
+ 2: "repeat(2, minmax(0, 1fr))",
3751
+ 3: "repeat(3, minmax(0, 1fr))",
3752
+ 4: "repeat(4, minmax(0, 1fr))",
3753
+ 5: "repeat(5, minmax(0, 1fr))",
3754
+ 6: "repeat(6, minmax(0, 1fr))",
3755
+ 7: "repeat(7, minmax(0, 1fr))",
3756
+ 8: "repeat(8, minmax(0, 1fr))",
3757
+ 9: "repeat(9, minmax(0, 1fr))",
3758
+ 10: "repeat(10, minmax(0, 1fr))",
3759
+ 11: "repeat(11, minmax(0, 1fr))",
3760
+ 12: "repeat(12, minmax(0, 1fr))"
3761
+ };
3762
+ var StyledBox = styled("div")(
3763
+ ({ theme, $isGrid, $direction, $wrap, $gap, $cols, $rows }) => {
3764
+ const css = { display: $isGrid ? "grid" : "flex" };
3765
+ function apply(value, toCss) {
3766
+ if (value === void 0 || value === null) return;
3767
+ if (typeof value !== "object") {
3768
+ Object.assign(css, toCss(value));
3769
+ return;
3770
+ }
3771
+ for (const [bp, val] of Object.entries(value)) {
3772
+ if (val === void 0) continue;
3773
+ const muiBp = BREAKPOINT_MAP[bp];
3774
+ if (muiBp === "xs") {
3775
+ Object.assign(css, toCss(val));
3776
+ } else {
3777
+ const mq = theme.breakpoints.up(muiBp);
3778
+ css[mq] = { ...css[mq], ...toCss(val) };
3779
+ }
3780
+ }
3781
+ }
3782
+ apply($direction, (v) => ({ flexDirection: v === "col" ? "column" : "row" }));
3783
+ apply($wrap, (v) => ({ flexWrap: v }));
3784
+ apply($gap, (v) => ({ gap: GAP_MAP[v] }));
3785
+ if ($isGrid) {
3786
+ apply($cols, (v) => ({ gridTemplateColumns: COLS_MAP[v] }));
3787
+ apply($rows, (v) => ({ gridTemplateRows: COLS_MAP[v] }));
3788
+ }
3789
+ return css;
3790
+ }
3791
+ );
3792
+ var Box2 = forwardRef(
3793
+ ({ direction = "row", wrap = "nowrap", gap = 0, cols, rows, children, ...rest }, ref) => /* @__PURE__ */ jsx(
3794
+ StyledBox,
3795
+ {
3796
+ ref,
3797
+ $isGrid: !!(cols || rows),
3798
+ $direction: direction,
3799
+ $wrap: wrap,
3800
+ $gap: gap,
3801
+ $cols: cols,
3802
+ $rows: rows,
3803
+ ...rest,
3804
+ children
3805
+ }
3806
+ )
3807
+ );
3808
+ Box2.displayName = "Box";
3809
+ var MAX_WIDTH_MAP = {
3810
+ sm: "40rem",
3811
+ md: "48rem",
3812
+ lg: "64rem",
3813
+ xl: "80rem",
3814
+ "2xl": "96rem",
3815
+ full: "100%"
3816
+ };
3817
+ var StyledContainer = styled("div")(({ theme, $maxWidth }) => ({
3818
+ maxWidth: MAX_WIDTH_MAP[$maxWidth],
3819
+ marginLeft: "auto",
3820
+ marginRight: "auto",
3821
+ paddingLeft: "1.5rem",
3822
+ paddingRight: "1.5rem",
3823
+ width: "100%",
3824
+ [theme.breakpoints.up("sm")]: {
3825
+ paddingLeft: "2rem",
3826
+ paddingRight: "2rem"
3827
+ }
3828
+ }));
3829
+ var Container = forwardRef(
3830
+ ({ maxWidth = "xl", children, ...rest }, ref) => /* @__PURE__ */ jsx(StyledContainer, { ref, $maxWidth: maxWidth, ...rest, children })
3831
+ );
3832
+ Container.displayName = "Container";
3833
+ var StyledSection = styled("section")(({ theme }) => ({
3834
+ paddingTop: "2rem",
3835
+ paddingBottom: "2rem",
3836
+ [theme.breakpoints.up("md")]: {
3837
+ paddingTop: "3rem",
3838
+ paddingBottom: "3rem"
3839
+ }
3840
+ }));
3841
+ var Section = forwardRef(({ children, ...rest }, ref) => /* @__PURE__ */ jsx(StyledSection, { ref, ...rest, children }));
3842
+ Section.displayName = "Section";
3843
+ var getTypographyStyles = (theme) => ({
3844
+ fontFamily: theme.typography.fontFamily,
3845
+ "& h1": { fontSize: "2.25rem", fontWeight: 500, letterSpacing: "-0.025em" },
3846
+ "& h2": { fontSize: "1.875rem", fontWeight: 500, letterSpacing: "-0.025em" },
3847
+ "& h3": { fontSize: "1.5rem", fontWeight: 500, letterSpacing: "-0.025em" },
3848
+ "& h4": { fontSize: "1.25rem", fontWeight: 500, letterSpacing: "-0.025em" },
3849
+ "& h5": { fontSize: "1.125rem", fontWeight: 500, letterSpacing: "-0.025em" },
3850
+ "& h6": { fontSize: "1rem", fontWeight: 500, letterSpacing: "-0.025em" },
3851
+ "& p": { fontSize: "1rem", lineHeight: 1.75, marginBottom: "1rem" },
3852
+ "& strong": { fontWeight: 600 },
3853
+ "& em": { fontStyle: "italic" },
3854
+ "& del": { textDecoration: "line-through" },
3855
+ "& small": { fontSize: "0.875rem", fontWeight: 500, lineHeight: 1 },
3856
+ "& sub, & sup": { fontSize: "0.875rem" },
3857
+ "& a": {
3858
+ textDecoration: "underline",
3859
+ textUnderlineOffset: "4px",
3860
+ textDecorationColor: alpha(theme.palette.primary.main, 0.5),
3861
+ transition: "color 150ms ease, text-decoration-color 150ms ease",
3862
+ "&:hover": {
3863
+ color: theme.palette.primary.main,
3864
+ textDecorationColor: theme.palette.primary.main
3865
+ }
3866
+ },
3867
+ "& ul": {
3868
+ paddingLeft: 0,
3869
+ listStyle: "none",
3870
+ "& > li": { position: "relative", paddingLeft: "1.5rem", marginBottom: "0.5rem" },
3871
+ "& > li::before": {
3872
+ content: '""',
3873
+ position: "absolute",
3874
+ left: "0.25rem",
3875
+ top: "0.6875em",
3876
+ height: "0.375rem",
3877
+ width: "0.375rem",
3878
+ borderRadius: "50%",
3879
+ backgroundColor: alpha(theme.palette.text.primary, 0.8)
3880
+ }
3881
+ },
3882
+ "& ol": {
3883
+ paddingLeft: "1.5rem",
3884
+ listStyleType: "decimal",
3885
+ "& > li": { paddingLeft: "0.5rem", marginBottom: "0.5rem" },
3886
+ "& ol": { listStyleType: "lower-alpha", paddingLeft: "1.5rem" },
3887
+ "& ol ol": { listStyleType: "lower-roman" }
3888
+ },
3889
+ "& code": {
3890
+ position: "relative",
3891
+ borderRadius: "0.25rem",
3892
+ backgroundColor: alpha(theme.palette.grey[500], 0.1),
3893
+ padding: "0.2rem 0.3rem",
3894
+ fontFamily: "monospace",
3895
+ fontSize: "0.875rem",
3896
+ fontWeight: 500
3897
+ },
3898
+ "& pre": {
3899
+ overflowX: "auto",
3900
+ borderRadius: "0.5rem",
3901
+ border: `1px solid ${theme.palette.divider}`,
3902
+ backgroundColor: alpha(theme.palette.grey[500], 0.1),
3903
+ padding: "1rem",
3904
+ margin: "1rem 0",
3905
+ "& code": {
3906
+ background: "transparent",
3907
+ padding: 0,
3908
+ fontSize: "0.875rem",
3909
+ display: "block",
3910
+ width: "100%"
3911
+ }
3912
+ },
3913
+ "& table": {
3914
+ width: "100%",
3915
+ margin: "1rem 0",
3916
+ borderRadius: "0.5rem",
3917
+ border: `1px solid ${theme.palette.divider}`,
3918
+ borderCollapse: "collapse",
3919
+ overflow: "hidden"
3920
+ },
3921
+ "& thead": { backgroundColor: alpha(theme.palette.grey[500], 0.1) },
3922
+ "& tr": {
3923
+ borderBottom: `1px solid ${theme.palette.divider}`,
3924
+ "&:last-child": { borderBottom: "none" }
3925
+ },
3926
+ "& th": {
3927
+ padding: "0.5rem 1rem",
3928
+ textAlign: "left",
3929
+ fontWeight: 600,
3930
+ borderRight: `1px solid ${theme.palette.divider}`,
3931
+ "&:last-child": { borderRight: "none" }
3932
+ },
3933
+ "& td": {
3934
+ padding: "0.5rem 1rem",
3935
+ borderRight: `1px solid ${theme.palette.divider}`,
3936
+ "&:last-child": { borderRight: "none" }
3937
+ },
3938
+ "& img": {
3939
+ borderRadius: "0.5rem",
3940
+ border: `1px solid ${theme.palette.divider}`,
3941
+ margin: "1rem 0",
3942
+ maxWidth: "100%",
3943
+ height: "auto"
3944
+ },
3945
+ "& video": {
3946
+ borderRadius: "0.5rem",
3947
+ border: `1px solid ${theme.palette.divider}`,
3948
+ margin: "1rem 0"
3949
+ },
3950
+ "& figure": { margin: "1rem 0", "& img": { margin: 0 } },
3951
+ "& figcaption": {
3952
+ fontSize: "0.875rem",
3953
+ marginTop: "0.5rem",
3954
+ color: theme.palette.text.secondary
3955
+ },
3956
+ "& blockquote": {
3957
+ borderLeft: `4px solid ${alpha(theme.palette.primary.main, 0.2)}`,
3958
+ paddingLeft: "1rem",
3959
+ paddingTop: "0.25rem",
3960
+ paddingBottom: "0.25rem",
3961
+ margin: "1rem 0",
3962
+ color: theme.palette.text.secondary
3963
+ },
3964
+ "& hr": {
3965
+ margin: "2rem 0",
3966
+ borderTop: `2px solid ${theme.palette.divider}`,
3967
+ borderBottom: "none"
3968
+ },
3969
+ "& abbr": { cursor: "help", textDecoration: "underline dotted", textUnderlineOffset: "4px" },
3970
+ "& kbd": {
3971
+ borderRadius: "0.375rem",
3972
+ border: `1px solid ${theme.palette.divider}`,
3973
+ backgroundColor: alpha(theme.palette.grey[500], 0.1),
3974
+ padding: "0.125rem 0.375rem",
3975
+ fontSize: "0.875rem",
3976
+ fontFamily: "monospace"
3977
+ },
3978
+ "& mark": { backgroundColor: alpha(theme.palette.primary.main, 0.1), padding: "0 0.25rem" },
3979
+ "& details": {
3980
+ borderRadius: "0.5rem",
3981
+ border: `1px solid ${theme.palette.divider}`,
3982
+ padding: "0.5rem 1rem",
3983
+ margin: "1rem 0"
3984
+ },
3985
+ "& summary": { cursor: "pointer", fontWeight: 600 }
3986
+ });
3987
+ var getHeaderSpacingStyles = () => ({
3988
+ "& h1": { marginTop: "2rem", marginBottom: "1rem" },
3989
+ "& h2": { marginTop: "2rem", marginBottom: "1rem" },
3990
+ "& h3": { marginTop: "1.5rem", marginBottom: "0.75rem" },
3991
+ "& h4": { marginTop: "1.5rem", marginBottom: "0.75rem" },
3992
+ "& h5": { marginTop: "1rem", marginBottom: "0.5rem" },
3993
+ "& h6": { marginTop: "1rem", marginBottom: "0.5rem" }
3994
+ });
3995
+ var spacingStyles = {
3996
+ "& > * + *": { marginTop: "1.5rem" }
3997
+ };
3998
+ var StyledMain = styled("main")(({ theme }) => ({
3999
+ ...getTypographyStyles(theme)
4000
+ }));
4001
+ var Main = forwardRef(({ children, ...rest }, ref) => /* @__PURE__ */ jsx(StyledMain, { ref, ...rest, children }));
4002
+ Main.displayName = "Main";
4003
+ var StyledProse = styled("div")(({ theme }) => ({
4004
+ ...getTypographyStyles(theme),
4005
+ ...spacingStyles
4006
+ }));
4007
+ var Prose = forwardRef(({ children, ...rest }, ref) => /* @__PURE__ */ jsx(StyledProse, { ref, ...rest, children }));
4008
+ Prose.displayName = "Prose";
4009
+ var StyledArticle = styled("article")(({ theme }) => ({
4010
+ maxWidth: "56rem",
4011
+ marginLeft: "auto",
4012
+ marginRight: "auto",
4013
+ ...getTypographyStyles(theme),
4014
+ ...getHeaderSpacingStyles(),
4015
+ ...spacingStyles
4016
+ }));
4017
+ var Article = forwardRef(({ children, ...rest }, ref) => /* @__PURE__ */ jsx(StyledArticle, { ref, ...rest, children }));
4018
+ Article.displayName = "Article";
4019
+ var sizeMap3 = {
4020
+ sm: { minWidth: "1.75rem", height: "1.75rem", fontSize: "0.75rem" },
4021
+ md: { minWidth: "2rem", height: "2rem", fontSize: "0.875rem" },
4022
+ lg: { minWidth: "2.5rem", height: "2.5rem", fontSize: "1rem" }
4023
+ };
4024
+ var activeStyles = (theme) => ({
4025
+ backgroundColor: theme.palette.primary.main,
4026
+ color: theme.palette.primary.contrastText,
4027
+ "&:hover:not(:disabled)": { backgroundColor: theme.palette.primary.dark }
4028
+ });
4029
+ var idleStyles = (theme) => ({
4030
+ backgroundColor: "transparent",
4031
+ color: theme.palette.text.primary,
4032
+ "&:hover:not(:disabled)": { backgroundColor: alpha(theme.palette.primary.main, 0.08) },
4033
+ "&:active:not(:disabled)": { backgroundColor: alpha(theme.palette.primary.main, 0.16) }
4034
+ });
4035
+ var StyledButton2 = styled("button")(({ theme, $isActive, $size }) => ({
4036
+ appearance: "none",
4037
+ border: "none",
4038
+ cursor: "pointer",
4039
+ display: "inline-flex",
4040
+ alignItems: "center",
4041
+ justifyContent: "center",
4042
+ borderRadius: theme.shape.borderRadius,
4043
+ fontFamily: theme.typography.fontFamily,
4044
+ fontWeight: $isActive ? 700 : 400,
4045
+ lineHeight: 1,
4046
+ padding: "0 0.25rem",
4047
+ transition: "background-color 150ms ease",
4048
+ ...sizeMap3[$size],
4049
+ ...$isActive ? activeStyles(theme) : idleStyles(theme),
4050
+ "&:focus-visible": {
4051
+ outline: `3px solid ${theme.palette.primary.main}`,
4052
+ outlineOffset: "2px"
4053
+ },
4054
+ "&:disabled": {
4055
+ color: theme.palette.action.disabled,
4056
+ cursor: "not-allowed",
4057
+ pointerEvents: "none"
4058
+ }
4059
+ }));
4060
+ var PaginationButton = forwardRef(
4061
+ ({ onClick, isActive = false, disabled = false, size = "md", children, "aria-label": ariaLabel }, ref) => /* @__PURE__ */ jsx(
4062
+ StyledButton2,
4063
+ {
4064
+ ref,
4065
+ type: "button",
4066
+ onClick,
4067
+ disabled,
4068
+ $isActive: isActive,
4069
+ $size: size,
4070
+ "aria-label": ariaLabel,
4071
+ "aria-current": isActive ? "page" : void 0,
4072
+ children
4073
+ }
4074
+ )
4075
+ );
4076
+ PaginationButton.displayName = "PaginationButton";
4077
+ var sizeMap4 = {
4078
+ sm: { minWidth: "1.75rem", height: "1.75rem", fontSize: "0.75rem" },
4079
+ md: { minWidth: "2rem", height: "2rem", fontSize: "0.875rem" },
4080
+ lg: { minWidth: "2.5rem", height: "2.5rem", fontSize: "1rem" }
4081
+ };
4082
+ var StyledEllipsis = styled("span")(({ theme, $size }) => ({
4083
+ display: "inline-flex",
4084
+ alignItems: "center",
4085
+ justifyContent: "center",
4086
+ color: theme.palette.text.secondary,
4087
+ userSelect: "none",
4088
+ ...sizeMap4[$size]
4089
+ }));
4090
+ var PaginationEllipsis = ({ size = "md" }) => /* @__PURE__ */ jsx(StyledEllipsis, { $size: size, "aria-hidden": "true", children: "\u2026" });
4091
+ PaginationEllipsis.displayName = "PaginationEllipsis";
4092
+ var Nav = styled("nav")({
4093
+ display: "inline-flex",
4094
+ alignItems: "center",
4095
+ gap: "0.25rem"
4096
+ });
4097
+ var DOTS = "DOTS";
4098
+ function buildPageItems(currentPage, totalPages, siblingCount) {
4099
+ const totalSlots = siblingCount * 2 + 5;
4100
+ if (totalPages <= totalSlots) {
4101
+ return Array.from({ length: totalPages }, (_, i) => i + 1);
4102
+ }
4103
+ const leftSibling = Math.max(currentPage - siblingCount, 1);
4104
+ const rightSibling = Math.min(currentPage + siblingCount, totalPages);
4105
+ const showLeftDots = leftSibling > 2;
4106
+ const showRightDots = rightSibling < totalPages - 1;
4107
+ if (!showLeftDots && showRightDots) {
4108
+ const leftRange = Array.from({ length: 3 + siblingCount * 2 }, (_, i) => i + 1);
4109
+ return [...leftRange, DOTS, totalPages];
4110
+ }
4111
+ if (showLeftDots && !showRightDots) {
4112
+ const rightRange = Array.from(
4113
+ { length: 3 + siblingCount * 2 },
4114
+ (_, i) => totalPages - (3 + siblingCount * 2) + 1 + i
4115
+ );
4116
+ return [1, DOTS, ...rightRange];
4117
+ }
4118
+ const middleRange = Array.from(
4119
+ { length: rightSibling - leftSibling + 1 },
4120
+ (_, i) => leftSibling + i
4121
+ );
4122
+ return [1, DOTS, ...middleRange, DOTS, totalPages];
4123
+ }
4124
+ var ChevronLeft = () => /* @__PURE__ */ jsx("svg", { width: "1em", height: "1em", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: /* @__PURE__ */ jsx("polyline", { points: "15 18 9 12 15 6" }) });
4125
+ var ChevronRight = () => /* @__PURE__ */ jsx("svg", { width: "1em", height: "1em", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: /* @__PURE__ */ jsx("polyline", { points: "9 18 15 12 9 6" }) });
4126
+ var ChevronsLeft = () => /* @__PURE__ */ jsxs("svg", { width: "1em", height: "1em", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [
4127
+ /* @__PURE__ */ jsx("polyline", { points: "11 17 6 12 11 7" }),
4128
+ /* @__PURE__ */ jsx("polyline", { points: "18 17 13 12 18 7" })
4129
+ ] });
4130
+ var ChevronsRight = () => /* @__PURE__ */ jsxs("svg", { width: "1em", height: "1em", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [
4131
+ /* @__PURE__ */ jsx("polyline", { points: "13 17 18 12 13 7" }),
4132
+ /* @__PURE__ */ jsx("polyline", { points: "6 17 11 12 6 7" })
4133
+ ] });
4134
+ var PaginationBar = ({
4135
+ currentPage,
4136
+ totalPages,
4137
+ onPageChange,
4138
+ siblingCount = 1,
4139
+ showFirstLast = true,
4140
+ size = "md",
4141
+ disabled = false
4142
+ }) => {
4143
+ const pageItems = buildPageItems(currentPage, totalPages, siblingCount);
4144
+ const isFirst = currentPage === 1;
4145
+ const isLast = currentPage === totalPages;
4146
+ return /* @__PURE__ */ jsxs(Nav, { "aria-label": "Pagination", children: [
4147
+ showFirstLast && /* @__PURE__ */ jsx(
4148
+ PaginationButton,
4149
+ {
4150
+ size,
4151
+ disabled: disabled || isFirst,
4152
+ onClick: () => onPageChange(1),
4153
+ "aria-label": "First page",
4154
+ children: /* @__PURE__ */ jsx(ChevronsLeft, {})
4155
+ }
4156
+ ),
4157
+ /* @__PURE__ */ jsx(
4158
+ PaginationButton,
4159
+ {
4160
+ size,
4161
+ disabled: disabled || isFirst,
4162
+ onClick: () => onPageChange(currentPage - 1),
4163
+ "aria-label": "Previous page",
4164
+ children: /* @__PURE__ */ jsx(ChevronLeft, {})
4165
+ }
4166
+ ),
4167
+ pageItems.map(
4168
+ (item, index) => item === DOTS ? /* @__PURE__ */ jsx(PaginationEllipsis, { size }, `dots-${index}`) : /* @__PURE__ */ jsx(
4169
+ PaginationButton,
4170
+ {
4171
+ size,
4172
+ isActive: item === currentPage,
4173
+ disabled,
4174
+ onClick: () => onPageChange(item),
4175
+ "aria-label": `Page ${item}`,
4176
+ children: item
4177
+ },
4178
+ item
4179
+ )
4180
+ ),
4181
+ /* @__PURE__ */ jsx(
4182
+ PaginationButton,
4183
+ {
4184
+ size,
4185
+ disabled: disabled || isLast,
4186
+ onClick: () => onPageChange(currentPage + 1),
4187
+ "aria-label": "Next page",
4188
+ children: /* @__PURE__ */ jsx(ChevronRight, {})
4189
+ }
4190
+ ),
4191
+ showFirstLast && /* @__PURE__ */ jsx(
4192
+ PaginationButton,
4193
+ {
4194
+ size,
4195
+ disabled: disabled || isLast,
4196
+ onClick: () => onPageChange(totalPages),
4197
+ "aria-label": "Last page",
4198
+ children: /* @__PURE__ */ jsx(ChevronsRight, {})
4199
+ }
4200
+ )
4201
+ ] });
4202
+ };
4203
+ PaginationBar.displayName = "PaginationBar";
137
4204
  var ss = "sans-serif";
138
4205
  var typographyOptions = {
139
4206
  fontFamily: ["'Lato'", ss].join(","),
@@ -239,6 +4306,6 @@ var MyThemeProvider = ({
239
4306
  ] });
240
4307
  };
241
4308
 
242
- export { Button, MyThemeProvider, createMyTheme, myTheme, themeDark, themeHighContrast, themeLight };
4309
+ export { Article, BaseInput, BaseSelectInput, Box2 as Box, Button, CheckboxInput, Container, CountryFlag, EmailInput, FileInput, Main, MultiSelectInput, MyThemeProvider, NumberInput, PaginationBar, PaginationButton, PaginationEllipsis, PasswordInput, PhoneInput, Prose, SearchInput, Section, SelectInput, TextInput, TextareaInput, createMyTheme, myTheme, themeDark, themeHighContrast, themeLight };
243
4310
  //# sourceMappingURL=index.js.map
244
4311
  //# sourceMappingURL=index.js.map