mimir-ui-kit 1.61.1 → 1.63.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 (59) 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/DropdownSelect/DropdownSelect.js +25 -23
  14. package/dist/components/DropdownSelect/types.d.ts +4 -0
  15. package/dist/components/GosZnak/GosZnak.d.ts +1 -1
  16. package/dist/components/GosZnak/GosZnak.js +88 -67
  17. package/dist/components/GosZnak/types.d.ts +5 -0
  18. package/dist/components/Image/Image.d.ts +5 -0
  19. package/dist/components/Image/Image.js +55 -50
  20. package/dist/components/Input/Input.d.ts +5 -0
  21. package/dist/components/Input/Input.js +1 -1
  22. package/dist/components/Input/index.js +1 -1
  23. package/dist/components/InputPassword/InputPassword.d.ts +5 -0
  24. package/dist/components/InputPassword/InputPassword.js +80 -69
  25. package/dist/components/InputPhoneNumber/InputPhoneNumber.d.ts +5 -1
  26. package/dist/components/InputPhoneNumber/InputPhoneNumber.js +39 -32
  27. package/dist/components/Loader/Loader.d.ts +6 -1
  28. package/dist/components/Loader/Loader.js +37 -14
  29. package/dist/components/MultiSelectSearch/MultiSelectSearch.js +1 -1
  30. package/dist/components/MultiSelectSearch/hooks/useRenderVirtualizedList.d.ts +2 -1
  31. package/dist/components/MultiSelectSearch/hooks/useRenderVirtualizedList.js +50 -48
  32. package/dist/components/MultiSelectSearch/utils.js +1 -1
  33. package/dist/components/OtpInput/OtpInput.js +1 -1
  34. package/dist/components/RadioGroup/RadioGroup.d.ts +9 -0
  35. package/dist/components/RadioGroup/RadioGroup.js +142 -129
  36. package/dist/components/SelectSearch/SelectSearch.d.ts +2 -0
  37. package/dist/components/SelectSearch/SelectSearch.js +299 -275
  38. package/dist/components/SelectSearch/types.d.ts +9 -0
  39. package/dist/components/SelectSearch/utils.js +1 -1
  40. package/dist/components/TextArea/TextArea.d.ts +1 -1
  41. package/dist/components/TextArea/TextArea.js +1 -1
  42. package/dist/components/TextAreaV2/TextArea.js +155 -142
  43. package/dist/components/TextAreaV2/types.d.ts +5 -0
  44. package/dist/components/UniversalUploader/UniversalUploader.d.ts +1 -0
  45. package/dist/components/UniversalUploader/UniversalUploader.js +89 -86
  46. package/dist/components/UniversalUploader/types.d.ts +5 -0
  47. package/dist/components/Uploader/Uploader.d.ts +5 -0
  48. package/dist/components/Uploader/Uploader.js +116 -87
  49. package/dist/components/UploaderFiles/UploaderFiles.js +88 -79
  50. package/dist/components/UploaderFiles/types.d.ts +5 -0
  51. package/dist/components/UploaderPhotos/UploaderPhotos.d.ts +5 -0
  52. package/dist/components/UploaderPhotos/UploaderPhotos.js +60 -57
  53. package/dist/components/index.js +1 -1
  54. package/dist/index.js +1 -1
  55. package/dist/types/dataTestId.d.ts +1 -0
  56. package/dist/types/dataTestId.js +1 -0
  57. package/dist/types/index.d.ts +1 -0
  58. package/package.json +1 -1
  59. package/dist/Input-DPnH8pKc.js +0 -227
@@ -1,35 +1,42 @@
1
- import { jsx as d } from "react/jsx-runtime";
2
- import { memo as I, forwardRef as i, useState as c, useCallback as f, useImperativeHandle as P } from "react";
3
- import { getMaskedInputPhoneValue as m, getUnmaskedInputValue as o } from "./utils.js";
4
- import { I as b } from "../../Input-DPnH8pKc.js";
5
- const h = I(
6
- i(
7
- ({ value: s = "", onChange: e, ...p }, a) => {
8
- const [r, l] = c(
9
- () => m(s)
10
- ), n = f(
11
- (t) => {
12
- const u = m(t.target.value);
13
- l(u), e == null || e({
14
- ...t,
15
- target: {
16
- ...t.target,
17
- value: o(u)
18
- }
19
- });
20
- },
21
- [e]
22
- );
23
- return P(
24
- a,
25
- () => ({
26
- getPhoneNumber: () => o(r)
27
- })
28
- ), /* @__PURE__ */ d(b, { ref: a, value: r, onChange: n, ...p });
29
- }
30
- )
1
+ import { jsx as f } from "react/jsx-runtime";
2
+ import { memo as P, forwardRef as b, useState as h, useCallback as k, useImperativeHandle as I } from "react";
3
+ import { getMaskedInputPhoneValue as n, getUnmaskedInputValue as p } from "./utils.js";
4
+ import { I as N } from "../../Input-CqNPT8os.js";
5
+ const g = P(
6
+ b(({ value: l = "", onChange: e, dataTestIdReactMap: u, ...s }, t) => {
7
+ const [m, i] = h(
8
+ () => n(l)
9
+ ), a = k(
10
+ (r) => {
11
+ const o = n(r.target.value);
12
+ i(o), e == null || e({
13
+ ...r,
14
+ target: {
15
+ ...r.target,
16
+ value: p(o)
17
+ }
18
+ });
19
+ },
20
+ [e]
21
+ );
22
+ return I(
23
+ t,
24
+ () => ({
25
+ getPhoneNumber: () => p(m)
26
+ })
27
+ ), /* @__PURE__ */ f(
28
+ N,
29
+ {
30
+ ref: t,
31
+ value: m,
32
+ onChange: a,
33
+ dataTestIdReactMap: { input: u == null ? void 0 : u.input },
34
+ ...s
35
+ }
36
+ );
37
+ })
31
38
  );
32
- h.displayName = "InputPhoneNumber";
39
+ g.displayName = "InputPhoneNumber";
33
40
  export {
34
- h as InputPhoneNumber
41
+ g as InputPhoneNumber
35
42
  };
@@ -1,7 +1,12 @@
1
1
  import { ELoaderSize } from './constants';
2
+ import { TDataTestIdReactMap } from '../../types';
2
3
 
3
4
  type TProps = {
4
5
  size?: ELoaderSize | `${ELoaderSize}`;
6
+ /**
7
+ * Объект, для передачи в компонент и его элементы data-testid-react, для автоматизированного тестирования
8
+ */
9
+ dataTestIdReactMap?: TDataTestIdReactMap<'loader' | 'circle'>;
5
10
  };
6
- export declare const Loader: ({ size }: TProps) => import("react/jsx-runtime").JSX.Element;
11
+ export declare const Loader: ({ size, dataTestIdReactMap }: TProps) => import("react/jsx-runtime").JSX.Element;
7
12
  export {};
@@ -1,16 +1,39 @@
1
- import { jsxs as e, jsx as a } from "react/jsx-runtime";
2
- import { c as r } from "../../index-DIxK0V-G.js";
3
- import { ELoaderSize as o } from "./constants.js";
4
- import '../../assets/Loader.css';const t = "_loader_1qwwg_2", l = "_circle_1qwwg_9", m = "_animate_1qwwg_1", i = "_s_1qwwg_33", _ = "_m_1qwwg_37", s = {
5
- loader: t,
6
- circle: l,
7
- animate: m,
8
- s: i,
9
- m: _
10
- }, p = ({ size: c = o.M }) => /* @__PURE__ */ e("div", { className: r(s.loader, s[c]), "data-testid": "loader", children: [
11
- /* @__PURE__ */ a("span", { className: s.circle }),
12
- /* @__PURE__ */ a("span", { className: s.circle })
13
- ] });
1
+ import { jsxs as c, jsx as i } from "react/jsx-runtime";
2
+ import { c as m } from "../../index-DIxK0V-G.js";
3
+ import { ELoaderSize as s } from "./constants.js";
4
+ import '../../assets/Loader.css';const _ = "_loader_1qwwg_2", n = "_circle_1qwwg_9", w = "_animate_1qwwg_1", e = "_s_1qwwg_33", g = "_m_1qwwg_37", o = {
5
+ loader: _,
6
+ circle: n,
7
+ animate: w,
8
+ s: e,
9
+ m: g
10
+ }, x = ({
11
+ size: l = s.M,
12
+ dataTestIdReactMap: r
13
+ }) => /* @__PURE__ */ c(
14
+ "div",
15
+ {
16
+ "data-testid-react": r == null ? void 0 : r.loader,
17
+ className: m(o.loader, o[l]),
18
+ "data-testid": "loader",
19
+ children: [
20
+ /* @__PURE__ */ i(
21
+ "span",
22
+ {
23
+ "data-testid-react": r == null ? void 0 : r.circle,
24
+ className: o.circle
25
+ }
26
+ ),
27
+ /* @__PURE__ */ i(
28
+ "span",
29
+ {
30
+ "data-testid-react": r == null ? void 0 : r.circle,
31
+ className: o.circle
32
+ }
33
+ )
34
+ ]
35
+ }
36
+ );
14
37
  export {
15
- p as Loader
38
+ x as Loader
16
39
  };
@@ -14,7 +14,7 @@ import { useVirtualization as gt } from "./hooks/useVirtualization.js";
14
14
  import { normalizeDataForNestedSelection as It, flattenOptions as St, updateInputValueAfterChange as ue, getInitialInputValue as Nt, mapSizeToInputSize as me, getDropdownArrowIcon as zt, processNestedSelectionChange as pe, flattenSelectedItems as wt, dispatchMultiselectOpen as A, highlightReactNode as Ct } from "./utils.js";
15
15
  import { Icon as vt } from "../../icons/Icon.js";
16
16
  import { Button as yt } from "../Button/Button.js";
17
- import { I as fe } from "../../Input-DPnH8pKc.js";
17
+ import { I as fe } from "../../Input-CqNPT8os.js";
18
18
  import { EInputVariant as bt } from "../Input/constants.js";
19
19
  import { Loader as he } from "../Loader/Loader.js";
20
20
  import { H as Ot, U as ge, G as Ie } from "../../combobox-fIVOzEhl.js";
@@ -25,6 +25,7 @@ type TUseRenderVirtualizedListProps = {
25
25
  highlightMatches?: boolean;
26
26
  internalSearchQuery?: string;
27
27
  searchInHeaderGroupItems?: boolean;
28
+ isModal?: boolean;
28
29
  };
29
- export declare const useRenderVirtualizedList: ({ items, filteredItems, size, actualMenuPlacement, isVisible, noOptionsText, noMatchText, enableNestedSelection, renderNestedOptions, groupBy, parentRef, virtualItems, virtualizer, classNameOption, selectedItems, renderOptionContent, cls, useIconInsteadOfCheckbox, highlightMatches, internalSearchQuery, searchInHeaderGroupItems }: TUseRenderVirtualizedListProps) => () => ReactNode;
30
+ export declare const useRenderVirtualizedList: ({ items, filteredItems, size, actualMenuPlacement, isVisible, noOptionsText, noMatchText, enableNestedSelection, renderNestedOptions, groupBy, parentRef, virtualItems, virtualizer, classNameOption, selectedItems, renderOptionContent, cls, useIconInsteadOfCheckbox, highlightMatches, internalSearchQuery, searchInHeaderGroupItems, isModal }: TUseRenderVirtualizedListProps) => () => ReactNode;
30
31
  export {};
@@ -1,14 +1,14 @@
1
1
  import { jsx as n, jsxs as $, Fragment as D } from "react/jsx-runtime";
2
- import { c } from "../../../index-DIxK0V-G.js";
2
+ import { c as f } from "../../../index-DIxK0V-G.js";
3
3
  import { Icon as k } from "../../../icons/Icon.js";
4
4
  import { CheckboxMimir as b } from "../../CheckboxMimir/CheckboxMimir.js";
5
5
  import { EMultiSelectSearchSize as j } from "../constants.js";
6
- import { highlightReactNode as I } from "../utils.js";
7
- import { W as E, K } from "../../../combobox-fIVOzEhl.js";
8
- const W = (i, a, o, r, e) => /* @__PURE__ */ n(
6
+ import { highlightReactNode as K } from "../utils.js";
7
+ import { W as E, K as W } from "../../../combobox-fIVOzEhl.js";
8
+ const w = (i, a, o, r, e) => /* @__PURE__ */ n(
9
9
  "div",
10
10
  {
11
- className: c(
11
+ className: f(
12
12
  e.options,
13
13
  e[i],
14
14
  e["no-options"],
@@ -17,10 +17,10 @@ const W = (i, a, o, r, e) => /* @__PURE__ */ n(
17
17
  ),
18
18
  children: r
19
19
  }
20
- ), w = (i, a, o, r, e) => /* @__PURE__ */ n(
20
+ ), F = (i, a, o, r, e) => /* @__PURE__ */ n(
21
21
  "div",
22
22
  {
23
- className: c(
23
+ className: f(
24
24
  e.options,
25
25
  e[i],
26
26
  e["no-options"],
@@ -29,21 +29,21 @@ const W = (i, a, o, r, e) => /* @__PURE__ */ n(
29
29
  ),
30
30
  children: r
31
31
  }
32
- ), F = (i, a, o, r, e, p) => /* @__PURE__ */ n(
32
+ ), H = (i, a, o, r, e, p) => /* @__PURE__ */ n(
33
33
  "div",
34
34
  {
35
- className: c(p.options, p[i], p[a], {
35
+ className: f(p.options, p[i], p[a], {
36
36
  [p.visible]: o
37
37
  }),
38
38
  children: e(r)
39
39
  }
40
- ), H = (i, a, o, r, e, p, d, N, v, t, m, f, x, g, l) => {
41
- const u = new Set(N.map((s) => s.id));
40
+ ), T = (i, a, o, r, e, p, d, v, x, t, g, m, N, c, l) => {
41
+ const u = new Set(v.map((s) => s.id));
42
42
  return /* @__PURE__ */ n(
43
43
  "div",
44
44
  {
45
45
  ref: r,
46
- className: c(
46
+ className: f(
47
47
  t.options,
48
48
  t[i],
49
49
  t[a],
@@ -76,9 +76,9 @@ const W = (i, a, o, r, e) => /* @__PURE__ */ n(
76
76
  {
77
77
  className: t["group-header"],
78
78
  "data-testid": `group-header-${h.name}`,
79
- children: x && g && l ? I(
79
+ children: N && c && l ? K(
80
80
  h.name,
81
- g,
81
+ c,
82
82
  t["highlighted-text"]
83
83
  ) : h.name
84
84
  }
@@ -86,13 +86,13 @@ const W = (i, a, o, r, e) => /* @__PURE__ */ n(
86
86
  E,
87
87
  {
88
88
  value: h,
89
- className: ({ focus: L }) => c(t.option, d, i && t[i], {
90
- [t["option-active"]]: L && !m
89
+ className: ({ focus: L }) => f(t.option, d, i && t[i], {
90
+ [t["option-active"]]: L && !g
91
91
  }),
92
92
  "data-testid": `option-${h.id}`,
93
93
  children: /* @__PURE__ */ $(D, { children: [
94
- /* @__PURE__ */ n("div", { className: t["option-inner"], children: v(h) }),
95
- f ? S && /* @__PURE__ */ n(
94
+ /* @__PURE__ */ n("div", { className: t["option-inner"], children: x(h) }),
95
+ m ? S && /* @__PURE__ */ n(
96
96
  k,
97
97
  {
98
98
  iconName: i === j.L ? "Done24px" : "Done16px",
@@ -117,35 +117,35 @@ const W = (i, a, o, r, e) => /* @__PURE__ */ n(
117
117
  )
118
118
  }
119
119
  );
120
- }, T = (i, a, o, r, e, p, d, N, v) => {
121
- const t = new Set(e.map((m) => m.id));
120
+ }, Y = (i, a, o, r, e, p, d, v, x, t) => {
121
+ const g = new Set(e.map((m) => m.id));
122
122
  return /* @__PURE__ */ n(
123
- K,
123
+ W,
124
124
  {
125
- className: c(d.options, d[i], d[a], {
125
+ className: f(d.options, d[i], d[a], {
126
126
  [d.visible]: o
127
127
  }),
128
- modal: !1,
128
+ modal: t,
129
129
  static: !0,
130
130
  children: ({ option: m }) => {
131
- const f = t.has(m.id);
131
+ const N = g.has(m.id);
132
132
  return /* @__PURE__ */ n(
133
133
  E,
134
134
  {
135
135
  value: m,
136
- className: ({ focus: x }) => c(d.option, r, i && d[i], {
137
- [d["option-active"]]: x && !N
136
+ className: ({ focus: c }) => f(d.option, r, i && d[i], {
137
+ [d["option-active"]]: c && !v
138
138
  }),
139
139
  "data-testid": `option-${m.id}`,
140
140
  children: /* @__PURE__ */ $(D, { children: [
141
141
  /* @__PURE__ */ n("div", { className: d["option-inner"], children: p(m) }),
142
- v ? f && /* @__PURE__ */ n(
142
+ x ? N && /* @__PURE__ */ n(
143
143
  k,
144
144
  {
145
145
  iconName: i === j.L ? "Done24px" : "Done16px",
146
146
  className: d["selected-icon"]
147
147
  }
148
- ) : /* @__PURE__ */ n(b, { isInteractive: !1, checked: f })
148
+ ) : /* @__PURE__ */ n(b, { isInteractive: !1, checked: N })
149
149
  ] })
150
150
  },
151
151
  m.id
@@ -153,7 +153,7 @@ const W = (i, a, o, r, e) => /* @__PURE__ */ n(
153
153
  }
154
154
  }
155
155
  );
156
- }, Z = ({
156
+ }, _ = ({
157
157
  items: i,
158
158
  filteredItems: a,
159
159
  size: o,
@@ -161,35 +161,36 @@ const W = (i, a, o, r, e) => /* @__PURE__ */ n(
161
161
  isVisible: e,
162
162
  noOptionsText: p,
163
163
  noMatchText: d,
164
- enableNestedSelection: N,
165
- renderNestedOptions: v,
164
+ enableNestedSelection: v,
165
+ renderNestedOptions: x,
166
166
  groupBy: t,
167
- parentRef: m,
168
- virtualItems: f,
169
- virtualizer: x,
170
- classNameOption: g,
167
+ parentRef: g,
168
+ virtualItems: m,
169
+ virtualizer: N,
170
+ classNameOption: c,
171
171
  selectedItems: l,
172
172
  renderOptionContent: u,
173
173
  cls: s,
174
174
  useIconInsteadOfCheckbox: h = !1,
175
175
  highlightMatches: S = !1,
176
176
  internalSearchQuery: L,
177
- searchInHeaderGroupItems: G = !1
178
- }) => () => i.length ? a.length ? N ? F(
177
+ searchInHeaderGroupItems: G = !1,
178
+ isModal: I = !0
179
+ }) => () => i.length ? a.length ? v ? H(
179
180
  o,
180
181
  r,
181
182
  e,
182
183
  a,
183
- v,
184
+ x,
184
185
  s
185
- ) : t ? H(
186
+ ) : t ? T(
186
187
  o,
187
188
  r,
188
189
  e,
189
- m,
190
- f,
191
- x,
192
190
  g,
191
+ m,
192
+ N,
193
+ c,
193
194
  l,
194
195
  u,
195
196
  s,
@@ -198,23 +199,24 @@ const W = (i, a, o, r, e) => /* @__PURE__ */ n(
198
199
  S,
199
200
  L,
200
201
  G
201
- ) : T(
202
+ ) : Y(
202
203
  o,
203
204
  r,
204
205
  e,
205
- g,
206
+ c,
206
207
  l,
207
208
  u,
208
209
  s,
209
210
  t,
210
- h
211
- ) : w(
211
+ h,
212
+ I
213
+ ) : F(
212
214
  o,
213
215
  r,
214
216
  e,
215
217
  d,
216
218
  s
217
- ) : W(
219
+ ) : w(
218
220
  o,
219
221
  r,
220
222
  e,
@@ -222,5 +224,5 @@ const W = (i, a, o, r, e) => /* @__PURE__ */ n(
222
224
  s
223
225
  );
224
226
  export {
225
- Z as useRenderVirtualizedList
227
+ _ as useRenderVirtualizedList
226
228
  };
@@ -1,6 +1,6 @@
1
1
  import { createElement as g, Fragment as S, isValidElement as w, cloneElement as E } from "react";
2
2
  import { EMultiSelectSearchSize as a, MOBILE_MENU_HEIGHT as M, DESKTOP_MENU_HEIGHT as T } from "./constants.js";
3
- import "../../Input-DPnH8pKc.js";
3
+ import "../../Input-CqNPT8os.js";
4
4
  import { EInputSize as f } from "../Input/constants.js";
5
5
  const j = (n) => {
6
6
  switch (n) {
@@ -3,7 +3,7 @@ import { c as u } from "../../index-DIxK0V-G.js";
3
3
  import { forwardRef as P, useImperativeHandle as R, Fragment as T } from "react";
4
4
  import { ITEMS_PER_SEPARATOR as v, DEFAULT_VALUE_LENGTH as y } from "./constants.js";
5
5
  import { useOTPInput as z } from "./hooks.js";
6
- import { I as A } from "../../Input-DPnH8pKc.js";
6
+ import { I as A } from "../../Input-CqNPT8os.js";
7
7
  import '../../assets/OtpInput.css';const C = "_otp_1ncuz_2", F = "_input_1ncuz_13", L = "_separator_1ncuz_27", n = {
8
8
  otp: C,
9
9
  "input-wrapper": "_input-wrapper_1ncuz_13",
@@ -1,5 +1,6 @@
1
1
  import { RadioGroupProps } from '@headlessui/react';
2
2
  import { ReactNode } from 'react';
3
+ import { TDataTestIdReactMap } from '../../types';
3
4
 
4
5
  export interface TRadioOption {
5
6
  value: string;
@@ -36,6 +37,10 @@ export type TRadioGroupProps = Omit<RadioGroupProps, 'value'> & {
36
37
  * Дополнительный класснейм для обертки контента радиогруппы.
37
38
  */
38
39
  classNameContentWrapper?: string;
40
+ /**
41
+ * Объект, для передачи в компонент и его элементы data-testid-react, для автоматизированного тестирования
42
+ */
43
+ dataTestIdReactMap?: TDataTestIdReactMap<'group' | 'label' | 'contentWrapper' | 'radio' | 'frame'>;
39
44
  };
40
45
  /**
41
46
  * Компонент RadioGroup для выбора одной опции из нескольких.
@@ -68,4 +73,8 @@ export declare const RadioGroup: import('react').ForwardRefExoticComponent<Omit<
68
73
  * Дополнительный класснейм для обертки контента радиогруппы.
69
74
  */
70
75
  classNameContentWrapper?: string;
76
+ /**
77
+ * Объект, для передачи в компонент и его элементы data-testid-react, для автоматизированного тестирования
78
+ */
79
+ dataTestIdReactMap?: TDataTestIdReactMap<"group" | "label" | "contentWrapper" | "radio" | "frame">;
71
80
  } & import('react').RefAttributes<HTMLElement>>;