mimir-ui-kit 1.62.0 → 1.64.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/dist/Input-CqNPT8os.js +243 -0
  2. package/dist/components/Accordion/Accordion.d.ts +5 -0
  3. package/dist/components/Accordion/Accordion.js +242 -220
  4. package/dist/components/Accordion/AccordionItem/AccordionItem.d.ts +6 -1
  5. package/dist/components/Accordion/AccordionItem/AccordionItem.js +19 -8
  6. package/dist/components/Button/Button.d.ts +37 -0
  7. package/dist/components/Button/Button.js +77 -61
  8. package/dist/components/CheckboxMimir/CheckboxMimir.d.ts +9 -0
  9. package/dist/components/CheckboxMimir/CheckboxMimir.js +90 -59
  10. package/dist/components/DatePicker/DatePicker.js +1 -1
  11. package/dist/components/Drawer/Drawer.d.ts +5 -0
  12. package/dist/components/Drawer/Drawer.js +141 -135
  13. package/dist/components/GosZnak/GosZnak.d.ts +1 -1
  14. package/dist/components/GosZnak/GosZnak.js +88 -67
  15. package/dist/components/GosZnak/types.d.ts +5 -0
  16. package/dist/components/Image/Image.d.ts +5 -0
  17. package/dist/components/Image/Image.js +55 -50
  18. package/dist/components/Input/Input.d.ts +5 -0
  19. package/dist/components/Input/Input.js +1 -1
  20. package/dist/components/Input/index.js +1 -1
  21. package/dist/components/InputPassword/InputPassword.d.ts +5 -0
  22. package/dist/components/InputPassword/InputPassword.js +80 -69
  23. package/dist/components/InputPhoneNumber/InputPhoneNumber.d.ts +5 -1
  24. package/dist/components/InputPhoneNumber/InputPhoneNumber.js +39 -32
  25. package/dist/components/Loader/Loader.d.ts +6 -1
  26. package/dist/components/Loader/Loader.js +37 -14
  27. package/dist/components/MultiSelectSearch/MultiSelectSearch.js +1 -1
  28. package/dist/components/MultiSelectSearch/utils.js +1 -1
  29. package/dist/components/OtpInput/OtpInput.js +1 -1
  30. package/dist/components/RadioGroup/RadioGroup.d.ts +9 -0
  31. package/dist/components/RadioGroup/RadioGroup.js +142 -129
  32. package/dist/components/SelectSearch/SelectSearch.d.ts +1 -0
  33. package/dist/components/SelectSearch/SelectSearch.js +299 -277
  34. package/dist/components/SelectSearch/types.d.ts +5 -0
  35. package/dist/components/SelectSearch/utils.js +1 -1
  36. package/dist/components/TextArea/TextArea.d.ts +1 -1
  37. package/dist/components/TextArea/TextArea.js +1 -1
  38. package/dist/components/TextAreaV2/TextArea.js +155 -142
  39. package/dist/components/TextAreaV2/types.d.ts +5 -0
  40. package/dist/components/UniversalUploader/UniversalUploader.d.ts +1 -0
  41. package/dist/components/UniversalUploader/UniversalUploader.js +92 -88
  42. package/dist/components/UniversalUploader/types.d.ts +5 -0
  43. package/dist/components/Uploader/Uploader.d.ts +7 -2
  44. package/dist/components/Uploader/Uploader.js +121 -90
  45. package/dist/components/UploaderFiles/UploaderFiles.js +88 -79
  46. package/dist/components/UploaderFiles/types.d.ts +5 -0
  47. package/dist/components/UploaderPhotos/UploaderPhotos.d.ts +5 -0
  48. package/dist/components/UploaderPhotos/UploaderPhotos.js +60 -57
  49. package/dist/components/index.js +1 -1
  50. package/dist/index.js +1 -1
  51. package/dist/types/dataTestId.d.ts +1 -0
  52. package/dist/types/dataTestId.js +1 -0
  53. package/dist/types/index.d.ts +1 -0
  54. package/package.json +1 -1
  55. package/dist/Input-DPnH8pKc.js +0 -227
@@ -1,92 +1,101 @@
1
- import { jsxs as Q, jsx as y } from "react/jsx-runtime";
2
- import { c as R } from "../../index-DIxK0V-G.js";
3
- import { forwardRef as W, useState as L, useEffect as X } from "react";
4
- import { EUploaderFilesVariant as u } from "./constants.js";
5
- import { useMediaQuery as k } from "../../hooks/useMediaQuery/useMediaQuery.js";
6
- import { EMediaQuery as q } from "../../hooks/useMediaQuery/constants.js";
7
- import { ListFiles as A } from "../ListFiles/ListFiles.js";
8
- import { EFileItemVariant as x } from "../ListFiles/constants.js";
9
- import { Uploader as B } from "../Uploader/Uploader.js";
10
- import '../../assets/UploaderFiles.css';const C = "_container_aj93w_2", G = "_white_aj93w_11", H = "_gray_aj93w_14", J = "_compact_aj93w_17", c = {
11
- container: C,
12
- white: G,
13
- gray: H,
14
- compact: J
15
- }, ta = W(
16
- (F, _) => {
1
+ import { jsxs as X, jsx as l } from "react/jsx-runtime";
2
+ import { c as k } from "../../index-DIxK0V-G.js";
3
+ import { forwardRef as q, useState as A, useEffect as B } from "react";
4
+ import { EUploaderFilesVariant as F } from "./constants.js";
5
+ import { useMediaQuery as C } from "../../hooks/useMediaQuery/useMediaQuery.js";
6
+ import { EMediaQuery as G } from "../../hooks/useMediaQuery/constants.js";
7
+ import { ListFiles as H } from "../ListFiles/ListFiles.js";
8
+ import { EFileItemVariant as w } from "../ListFiles/constants.js";
9
+ import { Uploader as I } from "../Uploader/Uploader.js";
10
+ import '../../assets/UploaderFiles.css';const J = "_container_aj93w_2", K = "_white_aj93w_11", O = "_gray_aj93w_14", P = "_compact_aj93w_17", n = {
11
+ container: J,
12
+ white: K,
13
+ gray: O,
14
+ compact: P
15
+ }, ri = q(
16
+ (x, _) => {
17
17
  const {
18
- compact: w,
19
- readonly: l,
20
- filesType: h,
21
- arrayName: S,
22
- maxSize: j,
23
- onChange: i,
24
- value: t,
25
- name: d,
26
- maxFiles: o,
18
+ compact: h,
19
+ readonly: d,
20
+ filesType: S,
21
+ arrayName: j,
22
+ maxSize: v,
23
+ onChange: s,
24
+ value: r,
25
+ name: p,
26
+ maxFiles: t,
27
27
  buttonText: E,
28
- variant: n = u.White,
29
- className: M,
30
- onMaxFilesExceeded: b,
31
- onMaxSizeExceeded: g,
32
- onInvalidFileType: v
33
- } = F, z = k(q.XSS), [e, r] = L(t || []), N = o && e.length >= o, I = n === u.White ? x.gray : x.white;
34
- X(() => {
35
- t && r(t);
36
- }, [t]);
37
- const V = (s) => {
38
- const D = [
28
+ variant: m = F.White,
29
+ className: b,
30
+ onMaxFilesExceeded: g,
31
+ onMaxSizeExceeded: z,
32
+ onInvalidFileType: N,
33
+ dataTestIdReactMap: a
34
+ } = x, V = C(G.XSS), [e, c] = A(r || []), U = t && e.length >= t, D = m === F.White ? w.gray : w.white;
35
+ B(() => {
36
+ r && c(r);
37
+ }, [r]);
38
+ const M = (o) => {
39
+ const L = [
39
40
  ...e,
40
- ...s.value.map((a) => {
41
- var p, m, f;
41
+ ...o.value.map((i) => {
42
+ var f, y, u;
42
43
  return {
43
- id: a.id,
44
+ id: i.id,
44
45
  url: "",
45
- size: (p = a == null ? void 0 : a.file) == null ? void 0 : p.size,
46
- name: (m = a == null ? void 0 : a.file) == null ? void 0 : m.name,
47
- type: (f = a == null ? void 0 : a.file) == null ? void 0 : f.type
46
+ size: (f = i == null ? void 0 : i.file) == null ? void 0 : f.size,
47
+ name: (y = i == null ? void 0 : i.file) == null ? void 0 : y.name,
48
+ type: (u = i == null ? void 0 : i.file) == null ? void 0 : u.type
48
49
  };
49
50
  })
50
51
  ];
51
- r(D), i == null || i({ type: "add", data: s.value, name: d });
52
- }, T = (s) => {
53
- r(s.list), s.deleteId && (i == null || i({ type: "delete", data: s.deleteId, name: d }));
54
- }, U = R([
55
- c.container,
56
- c[n],
57
- w && c.compact,
58
- M
52
+ c(L), s == null || s({ type: "add", data: o.value, name: p });
53
+ }, Q = (o) => {
54
+ c(o.list), o.deleteId && (s == null || s({ type: "delete", data: o.deleteId, name: p }));
55
+ }, W = k([
56
+ n.container,
57
+ n[m],
58
+ h && n.compact,
59
+ b
59
60
  ]);
60
- return /* @__PURE__ */ Q("div", { className: U, children: [
61
- /* @__PURE__ */ y(
62
- B,
63
- {
64
- filesType: h,
65
- arrayName: S,
66
- maxSize: j,
67
- onChangeValue: V,
68
- ref: _,
69
- buttonSize: z ? "s" : "m",
70
- maxFiles: o && o - e.length,
71
- isDisabled: N || l,
72
- buttonText: E,
73
- onMaxFilesExceeded: b,
74
- onMaxSizeExceeded: g,
75
- onInvalidFileType: v
76
- }
77
- ),
78
- /* @__PURE__ */ y(
79
- A,
80
- {
81
- value: e,
82
- variant: I,
83
- onChange: T,
84
- disabled: l
85
- }
86
- )
87
- ] });
61
+ return /* @__PURE__ */ X(
62
+ "div",
63
+ {
64
+ "data-testid-react": a == null ? void 0 : a.wrapper,
65
+ className: W,
66
+ children: [
67
+ /* @__PURE__ */ l(
68
+ I,
69
+ {
70
+ dataTestIdReactMap: { wrapper: a == null ? void 0 : a.uploader },
71
+ filesType: S,
72
+ arrayName: j,
73
+ maxSize: v,
74
+ onChangeValue: M,
75
+ ref: _,
76
+ buttonSize: V ? "s" : "m",
77
+ maxFiles: t && t - e.length,
78
+ isDisabled: U || d,
79
+ buttonText: E,
80
+ onMaxFilesExceeded: g,
81
+ onMaxSizeExceeded: z,
82
+ onInvalidFileType: N
83
+ }
84
+ ),
85
+ /* @__PURE__ */ l("div", { "data-testid-react": a == null ? void 0 : a.listFiles, children: /* @__PURE__ */ l(
86
+ H,
87
+ {
88
+ value: e,
89
+ variant: D,
90
+ onChange: Q,
91
+ disabled: d
92
+ }
93
+ ) })
94
+ ]
95
+ }
96
+ );
88
97
  }
89
98
  );
90
99
  export {
91
- ta as UploaderFiles
100
+ ri as UploaderFiles
92
101
  };
@@ -1,4 +1,5 @@
1
1
  import { EUploaderFilesVariant } from './constants';
2
+ import { TDataTestIdReactMap } from '../../types';
2
3
  import { TFilesDetail } from '../ListFiles';
3
4
  import { imageTypesArr } from '../Uploader/constants';
4
5
  import { TFileItem } from '../Uploader/Uploader';
@@ -67,6 +68,10 @@ export type TUploaderFiles = {
67
68
  * Проп для обработки ошибки при загрузке файла неразрешенного типа
68
69
  */
69
70
  onInvalidFileType?: (fileName: string) => void;
71
+ /**
72
+ * Объект, для передачи в компонент и его элементы data-testid-react, для автоматизированного тестирования
73
+ */
74
+ dataTestIdReactMap?: TDataTestIdReactMap<'wrapper' | 'uploader' | 'listFiles'>;
70
75
  };
71
76
  export type TOnChangeFilesUpdate = {
72
77
  type: string;
@@ -1,3 +1,4 @@
1
+ import { TDataTestIdReactMap } from '../../types';
1
2
  import { TPhotosDetail } from '../ListPhotos/ListPhotos';
2
3
  import { imageTypesArr } from '../Uploader/constants';
3
4
  import { TFileItem } from '../Uploader/Uploader';
@@ -60,6 +61,10 @@ export type TUploaderPhotos = {
60
61
  * Флаг, указывающий что изображение загружается
61
62
  */
62
63
  isDownloadingImage?: boolean;
64
+ /**
65
+ * Объект, для передачи в компонент и его элементы data-testid-react, для автоматизированного тестирования
66
+ */
67
+ dataTestIdReactMap?: TDataTestIdReactMap<'wrapper' | 'uploader' | 'listPhotos'>;
63
68
  };
64
69
  export type TOnChangePhotosUpdate = {
65
70
  type: string;
@@ -1,82 +1,85 @@
1
- import { jsxs as R, jsx as p } from "react/jsx-runtime";
2
- import { c as D } from "../../index-DIxK0V-G.js";
3
- import { forwardRef as E, useState as L, useEffect as M } from "react";
4
- import { ListPhotos as N } from "../ListPhotos/ListPhotos.js";
5
- import { Uploader as S } from "../Uploader/Uploader.js";
6
- import '../../assets/UploaderPhotos.css';const n = {
1
+ import { jsxs as L, jsx as s } from "react/jsx-runtime";
2
+ import { c as N } from "../../index-DIxK0V-G.js";
3
+ import { forwardRef as S, useState as _, useEffect as z } from "react";
4
+ import { ListPhotos as j } from "../ListPhotos/ListPhotos.js";
5
+ import { Uploader as I } from "../Uploader/Uploader.js";
6
+ import '../../assets/UploaderPhotos.css';const m = {
7
7
  "upload-file-wrapper": "_upload-file-wrapper_1a115_2"
8
- }, V = E(
9
- (m, c) => {
8
+ }, B = S(
9
+ (c, f) => {
10
10
  const {
11
- filesType: f,
12
- arrayName: u,
13
- maxSize: x,
14
- onChange: e,
15
- value: o,
16
- maxFiles: s,
17
- titleUploader: h,
18
- name: i,
11
+ filesType: u,
12
+ arrayName: x,
13
+ maxSize: h,
14
+ onChange: o,
15
+ value: a,
16
+ maxFiles: r,
17
+ titleUploader: w,
18
+ name: d,
19
19
  buttonText: v = "Выберите файлы",
20
- onMaxFilesExceeded: w,
21
- onMaxSizeExceeded: g,
22
- onInvalidFileType: y,
23
- loadImage: F,
24
- isDownloadingImage: I
25
- } = m, [t, l] = L(o || []), d = t.length >= s;
26
- M(() => {
27
- o && l(o);
28
- }, [o]);
29
- const U = (a) => {
30
- const P = [
20
+ onMaxFilesExceeded: g,
21
+ onMaxSizeExceeded: y,
22
+ onInvalidFileType: F,
23
+ loadImage: P,
24
+ isDownloadingImage: U,
25
+ dataTestIdReactMap: e
26
+ } = c, [t, i] = _(a || []), p = t.length >= r;
27
+ z(() => {
28
+ a && i(a);
29
+ }, [a]);
30
+ const b = (l) => {
31
+ const E = [
31
32
  ...t,
32
- ...a.value.map((r) => ({
33
- url: URL.createObjectURL(r.file),
34
- id: r.id
33
+ ...l.value.map((n) => ({
34
+ url: URL.createObjectURL(n.file),
35
+ id: n.id
35
36
  }))
36
37
  ];
37
- l(P), e == null || e({ type: "add", data: a.value, name: i });
38
- }, b = (a) => {
39
- l(a.list), a.deleteId && (e == null || e({ type: "delete", data: a.deleteId, name: i }));
38
+ i(E), o == null || o({ type: "add", data: l.value, name: d });
39
+ }, D = (l) => {
40
+ i(l.list), l.deleteId && (o == null || o({ type: "delete", data: l.deleteId, name: d }));
40
41
  };
41
- return /* @__PURE__ */ R(
42
+ return /* @__PURE__ */ L(
42
43
  "div",
43
44
  {
44
- className: D(
45
- n["upload-file-wrapper"],
46
- d && n.disabled
45
+ className: N(
46
+ m["upload-file-wrapper"],
47
+ p && m.disabled
47
48
  ),
49
+ "data-testid-react": e == null ? void 0 : e.wrapper,
48
50
  children: [
49
- /* @__PURE__ */ p(
50
- S,
51
+ /* @__PURE__ */ s(
52
+ I,
51
53
  {
52
- filesType: f,
53
- arrayName: u,
54
- maxSize: x,
55
- onChangeValue: U,
56
- ref: c,
57
- maxFiles: s - t.length,
58
- isDisabled: d,
59
- titleUploader: h,
54
+ dataTestIdReactMap: { wrapper: e == null ? void 0 : e.uploader },
55
+ filesType: u,
56
+ arrayName: x,
57
+ maxSize: h,
58
+ onChangeValue: b,
59
+ ref: f,
60
+ maxFiles: r - t.length,
61
+ isDisabled: p,
62
+ titleUploader: w,
60
63
  buttonText: v,
61
- onMaxFilesExceeded: w,
62
- onMaxSizeExceeded: g,
63
- onInvalidFileType: y
64
+ onMaxFilesExceeded: g,
65
+ onMaxSizeExceeded: y,
66
+ onInvalidFileType: F
64
67
  }
65
68
  ),
66
- !!t.length && /* @__PURE__ */ p(
67
- N,
69
+ !!t.length && /* @__PURE__ */ s("div", { "data-testid-react": e == null ? void 0 : e.listPhotos, children: /* @__PURE__ */ s(
70
+ j,
68
71
  {
69
72
  value: t,
70
- onChange: b,
71
- loadImage: F,
72
- isDownloadingImage: I
73
+ onChange: D,
74
+ loadImage: P,
75
+ isDownloadingImage: U
73
76
  }
74
- )
77
+ ) })
75
78
  ]
76
79
  }
77
80
  );
78
81
  }
79
82
  );
80
83
  export {
81
- V as UploaderPhotos
84
+ B as UploaderPhotos
82
85
  };
@@ -1,6 +1,6 @@
1
1
  import { Button as e } from "./Button/Button.js";
2
2
  import { EButtonForm as a, EButtonSize as p, EButtonVariantBorderless as i, EButtonVariantDefault as m, EButtonVariantOutline as n, EButtonVariantRound as x } from "./Button/constants.js";
3
- import { I as l } from "../Input-DPnH8pKc.js";
3
+ import { I as l } from "../Input-CqNPT8os.js";
4
4
  import { EInputSize as S, EInputStatus as d, EInputVariant as s } from "./Input/constants.js";
5
5
  import { TextArea as c } from "./TextArea/TextArea.js";
6
6
  import { ETextAreaInputSize as B } from "./TextArea/constants.js";
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Button as e } from "./components/Button/Button.js";
2
2
  import { EButtonForm as p, EButtonSize as a, EButtonVariantBorderless as i, EButtonVariantDefault as m, EButtonVariantOutline as f, EButtonVariantRound as x } from "./components/Button/constants.js";
3
- import { I as l } from "./Input-DPnH8pKc.js";
3
+ import { I as l } from "./Input-CqNPT8os.js";
4
4
  import { EInputSize as E, EInputStatus as u, EInputVariant as S } from "./components/Input/constants.js";
5
5
  import { TextArea as c } from "./components/TextArea/TextArea.js";
6
6
  import { ETextAreaInputSize as B } from "./components/TextArea/constants.js";
@@ -0,0 +1 @@
1
+ export type TDataTestIdReactMap<TKey extends string> = Partial<Record<TKey, string>>;
@@ -0,0 +1 @@
1
+
@@ -1 +1,2 @@
1
1
  export type { Props, PolymorphicRef } from './propsWithAs';
2
+ export type { TDataTestIdReactMap } from './dataTestId';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mimir-ui-kit",
3
3
  "private": false,
4
- "version": "1.62.0",
4
+ "version": "1.64.0",
5
5
  "type": "module",
6
6
  "exports": {
7
7
  ".": {
@@ -1,227 +0,0 @@
1
- import { jsxs as V, jsx as s, Fragment as U } from "react/jsx-runtime";
2
- import { c as i } from "./index-DIxK0V-G.js";
3
- import { memo as X, forwardRef as Y, useState as Z, useRef as ee, useEffect as B } from "react";
4
- import { EInputVariant as ae } from "./components/Input/constants.js";
5
- import { useMergeRefs as te } from "./hooks/useMergeRefs/useMergeRefs.js";
6
- import { Icon as re } from "./icons/Icon.js";
7
- import { Button as se } from "./components/Button/Button.js";
8
- import './assets/Input.css';const le = "_label_1peof_26", oe = "_input_1peof_2", ne = "_disabled_1peof_117", ie = "_clear_1peof_158", ce = "_s_1peof_218", de = "_m_1peof_233", ue = "_l_1peof_26", pe = "_success_1peof_289", _e = "_alarm_1peof_309", fe = "_error_1peof_329", e = {
9
- "input-wrapper": "_input-wrapper_1peof_2",
10
- "required-mark": "_required-mark_1peof_16",
11
- label: le,
12
- "has-left-slot": "_has-left-slot_1peof_45",
13
- "has-right-slot": "_has-right-slot_1peof_48",
14
- "active-label": "_active-label_1peof_53",
15
- "label-text-wrapper": "_label-text-wrapper_1peof_68",
16
- input: oe,
17
- "has-label": "_has-label_1peof_114",
18
- disabled: ne,
19
- "addon-icon": "_addon-icon_1peof_123",
20
- "left-slot": "_left-slot_1peof_127",
21
- "right-slot": "_right-slot_1peof_128",
22
- clear: ie,
23
- "border-radius-left": "_border-radius-left_1peof_206",
24
- "border-radius-right": "_border-radius-right_1peof_210",
25
- "border-radius-none": "_border-radius-none_1peof_214",
26
- s: ce,
27
- m: de,
28
- l: ue,
29
- "default-gray": "_default-gray_1peof_262",
30
- "default-white": "_default-white_1peof_274",
31
- success: pe,
32
- alarm: _e,
33
- error: fe
34
- }, z = (a) => {
35
- var p, l;
36
- if (!a)
37
- return null;
38
- switch (a.addonType) {
39
- case "icon": {
40
- const _ = (p = a.addonContent) == null ? void 0 : p.includes("16px"), g = (l = a.addonContent) == null ? void 0 : l.includes("24px");
41
- return /* @__PURE__ */ s(
42
- re,
43
- {
44
- style: {
45
- "--icon-size": i({
46
- "16px": _,
47
- "24px": g
48
- })
49
- },
50
- className: e["addon-icon"],
51
- iconName: a.addonContent
52
- }
53
- );
54
- }
55
- case "text":
56
- return a.addonContent;
57
- case "react-node":
58
- return /* @__PURE__ */ s(U, { children: a.addonContent });
59
- default:
60
- return null;
61
- }
62
- }, me = X(
63
- Y(
64
- (a, p) => {
65
- const {
66
- value: l,
67
- className: _,
68
- wrapperClassName: g,
69
- rightSlotClassName: F,
70
- requiredMarkClassName: L,
71
- variant: k = ae.DefaultGray,
72
- type: j = "text",
73
- autofocus: q,
74
- readonly: c,
75
- id: I,
76
- onFocus: N,
77
- onBlur: x,
78
- label: u,
79
- withClearButton: D,
80
- disabled: t,
81
- onChange: d,
82
- rightAddon: E,
83
- status: A,
84
- leftAddon: M,
85
- size: w = "m",
86
- numbersOnly: O,
87
- required: C,
88
- maxLength: y,
89
- autocomplete: S = "on",
90
- borderRadius: R = "all",
91
- ...T
92
- } = a, [f, m] = Z(!!l), r = ee(null), G = te(r, p);
93
- B(() => {
94
- q && r.current && r.current.focus();
95
- }, [q]), B(() => {
96
- m(!!l);
97
- }, [l]);
98
- const P = (o) => {
99
- const n = o.currentTarget.value;
100
- x == null || x(o), m(!!n);
101
- }, W = (o) => {
102
- c || N == null || N(o);
103
- }, $ = () => {
104
- r != null && r.current && (r.current.value = "", r.current.focus(), m(!1), d == null || d({
105
- target: r.current
106
- }));
107
- }, H = (o) => {
108
- let n = o.target.value;
109
- O && (n = n.replace(/\D/g, "")), y !== void 0 && (n = n.slice(0, y)), o.target.value = n, d == null || d(o), m(!!n);
110
- }, h = z(M), b = z(E), J = {
111
- [e.readonly]: t || c,
112
- [e.disabled]: t || c,
113
- [e["has-label"]]: !!u,
114
- [e["has-left-slot"]]: !!h,
115
- [e["has-right-slot"]]: !!b
116
- }, v = f || !!l, K = i(e.label, _, e[w], {
117
- [e["active-label"]]: v,
118
- [e.disabled]: t || c,
119
- [e["has-left-slot"]]: !!h,
120
- [e["has-right-slot"]]: !!b
121
- }), Q = i(e.input, J, _, [
122
- e[k],
123
- e[A ?? ""],
124
- e[w]
125
- ]);
126
- return /* @__PURE__ */ V(
127
- "div",
128
- {
129
- className: i(
130
- e["input-wrapper"],
131
- e[k],
132
- e[A ?? ""],
133
- e[w],
134
- {
135
- [e.disabled]: t || c,
136
- [e[`border-radius-${R}`]]: R !== "all"
137
- },
138
- g
139
- ),
140
- children: [
141
- u && /* @__PURE__ */ V("label", { htmlFor: I, className: K, children: [
142
- /* @__PURE__ */ s("span", { className: e["label-text-wrapper"], children: u }),
143
- C && (f || v) && /* @__PURE__ */ s(
144
- "span",
145
- {
146
- className: e["required-mark"],
147
- "data-testid": "required-mark"
148
- }
149
- )
150
- ] }),
151
- h && /* @__PURE__ */ s(
152
- "span",
153
- {
154
- className: i(e["left-slot"], {
155
- [e["has-label"]]: !!u,
156
- [e.disabled]: t
157
- }),
158
- children: h
159
- }
160
- ),
161
- /* @__PURE__ */ s(
162
- "input",
163
- {
164
- ref: G,
165
- type: j,
166
- id: I,
167
- className: Q,
168
- onFocus: W,
169
- onBlur: P,
170
- readOnly: c,
171
- value: l,
172
- onChange: H,
173
- maxLength: y,
174
- disabled: t,
175
- required: C,
176
- autoComplete: S,
177
- ...T
178
- }
179
- ),
180
- b && /* @__PURE__ */ s(
181
- "span",
182
- {
183
- className: i(e["right-slot"], F, {
184
- [e["has-label"]]: !!u,
185
- [e.disabled]: t
186
- }),
187
- children: b
188
- }
189
- ),
190
- C && !f && !v && /* @__PURE__ */ s(
191
- "span",
192
- {
193
- className: i(
194
- e["required-mark"],
195
- L
196
- ),
197
- "data-testid": "required-mark"
198
- }
199
- ),
200
- D && f && /* @__PURE__ */ s(
201
- se,
202
- {
203
- tabIndex: -1,
204
- className: i(e.clear, {
205
- [e.disabled]: t
206
- }),
207
- isIconButton: !0,
208
- iconName: "Close16px",
209
- size: "m-s",
210
- clear: !0,
211
- disabled: t || c,
212
- variant: "secondary-gray",
213
- onClick: $,
214
- "data-testid": "clear-button"
215
- }
216
- )
217
- ]
218
- }
219
- );
220
- }
221
- )
222
- );
223
- me.displayName = "Input";
224
- export {
225
- me as I,
226
- e as c
227
- };