mimir-ui-kit 1.58.1 → 1.59.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.
@@ -1,211 +1,215 @@
1
- import { jsxs as C, jsx as c, Fragment as re } from "react/jsx-runtime";
2
- import { c as v } from "../../index-DIxK0V-G.js";
3
- import { forwardRef as st, useId as it, useRef as P, useState as rt, useEffect as le } from "react";
4
- import { EMultiSelectSearchSize as ce, ELoadingIndicatorPlacement as x } from "./constants.js";
1
+ import { jsxs as v, jsx as c, Fragment as le } from "react/jsx-runtime";
2
+ import { c as y } from "../../index-DIxK0V-G.js";
3
+ import { forwardRef as st, useId as it, useRef as P, useState as rt, useEffect as ce } from "react";
4
+ import { EMultiSelectSearchSize as de, ELoadingIndicatorPlacement as V } from "./constants.js";
5
5
  import { useChips as lt } from "./hooks/useChips.js";
6
6
  import { useDataLoading as ct } from "./hooks/useDataLoading.js";
7
7
  import { useEventHandling as dt } from "./hooks/useEventHandling.js";
8
8
  import { useMenuPlacement as ut } from "./hooks/useMenuPlacement.js";
9
9
  import { useMultiSelectState as mt } from "./hooks/useMultiSelectState.js";
10
- import { u as pt, c as t } from "../../useNestedSelection-D1WOAYnL.js";
10
+ import { u as pt, c as t } from "../../useNestedSelection-CBfin3s1.js";
11
11
  import { useRenderVirtualizedList as ft } from "./hooks/useRenderVirtualizedList.js";
12
12
  import { useSearch as ht } from "./hooks/useSearch.js";
13
13
  import { useVirtualization as gt } from "./hooks/useVirtualization.js";
14
- import { normalizeDataForNestedSelection as It, flattenOptions as St, updateInputValueAfterChange as de, getInitialInputValue as Nt, mapSizeToInputSize as ue, getDropdownArrowIcon as zt, processNestedSelectionChange as me, flattenSelectedItems as wt, dispatchMultiselectOpen as A, highlightReactNode as Ct } from "./utils.js";
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 pe } from "../../Input-DPnH8pKc.js";
17
+ import { I as fe } from "../../Input-DPnH8pKc.js";
18
18
  import { EInputVariant as bt } from "../Input/constants.js";
19
- import { Loader as fe } from "../Loader/Loader.js";
20
- import { H as Ot, U as he, G as ge } from "../../combobox-fIVOzEhl.js";
19
+ import { Loader as he } from "../Loader/Loader.js";
20
+ import { H as Ot, U as ge, G as Ie } from "../../combobox-fIVOzEhl.js";
21
21
  const Wt = st(
22
- (Ie, Se) => {
22
+ (Se, Ne) => {
23
23
  const {
24
- placeholder: J,
25
- size: d = ce.L,
24
+ placeholder: U,
25
+ size: d = de.L,
26
26
  value: S,
27
- onChange: s,
28
- full: Ne,
29
- showArrow: ze = !0,
30
- items: i = [],
31
- classNameOption: U,
32
- displayValue: p = "name",
33
- filterOnSearch: we = !0,
27
+ onChange: i,
28
+ full: ze,
29
+ showArrow: we = !0,
30
+ items: r = [],
31
+ classNameOption: $,
32
+ displayValue: f = "name",
33
+ filterOnSearch: Ce = !0,
34
34
  onSearch: k,
35
- variant: $ = bt.DefaultGray,
36
- menuPlacement: Ce = "bottom",
35
+ variant: W = bt.DefaultGray,
36
+ menuPlacement: ve = "bottom",
37
37
  disabled: m = !1,
38
- searchProps: W,
38
+ searchProps: K,
39
39
  withClearButton: E = !1,
40
- withChip: ve = !1,
41
- chipVariant: ye = "sapphire",
42
- disableInput: y = !1,
43
- autocomplete: K = "on",
44
- id: be,
45
- autoPlacement: Oe = !1,
46
- onIsOpen: V,
47
- noOptionsText: De = "Нет данных",
48
- noMatchText: Me = "Ничего не найдено",
49
- loadOnOpen: xe,
50
- loading: Ve,
51
- loadingIndicatorPlacement: T = x.Both,
40
+ withChip: ye = !1,
41
+ chipVariant: be = "sapphire",
42
+ disableInput: b = !1,
43
+ autocomplete: X = "on",
44
+ id: Oe,
45
+ autoPlacement: De = !1,
46
+ onIsOpen: T,
47
+ noOptionsText: Me = "Нет данных",
48
+ noMatchText: xe = "Ничего не найдено",
49
+ loadOnOpen: Ve,
50
+ loading: Te,
51
+ loadingIndicatorPlacement: L = V.Both,
52
52
  groupBy: N,
53
- getGroupTitle: Te = (e) => e,
53
+ getGroupTitle: Le = (e) => e,
54
54
  highlightMatches: F = !1,
55
55
  enableNestedSelection: a = !1,
56
- searchInNestedItems: X = !1,
57
- useIconInsteadOfCheckbox: Y = !1,
56
+ searchInNestedItems: Y = !1,
57
+ useIconInsteadOfCheckbox: Z = !1,
58
58
  searchInHeaderGroupItems: G = !1,
59
59
  showCollapsedSearchedGroups: Re = !1,
60
- showSearchResultsAfterOptionSelect: R = !1
61
- } = Ie, Le = it(), b = be || `multiselect-${Le}`, L = P(null), z = P(null), Be = P(!1), Z = P(null), [o, _] = rt(null), Pe = mt({ value: S, displayValue: p }), {
62
- isOpen: f,
63
- setIsOpen: O,
64
- inputValue: D,
60
+ showSearchResultsAfterOptionSelect: O = !1
61
+ } = Se, Be = it(), D = Oe || `multiselect-${Be}`, R = P(null), z = P(null), Pe = P(!1), _ = P(null), [o, ee] = rt(null), Ae = mt({ value: S, displayValue: f }), {
62
+ isOpen: p,
63
+ setIsOpen: M,
64
+ inputValue: x,
65
65
  setInputValue: w,
66
66
  selectedItems: u,
67
- setSelectedItems: g,
68
- expandedOptions: Ae,
69
- setExpandedOptions: ke,
70
- internalSearchQuery: I,
67
+ setSelectedItems: I,
68
+ expandedOptions: ke,
69
+ setExpandedOptions: Ee,
70
+ internalSearchQuery: h,
71
71
  setInternalSearchQuery: q,
72
- firstSelectedSearchQuery: Ee,
73
- setFirstSelectedSearchQuery: M
74
- } = Pe, Fe = ut({
75
- autoPlacement: Oe,
76
- menuPlacement: Ce,
72
+ firstSelectedSearchQuery: Fe,
73
+ setFirstSelectedSearchQuery: C
74
+ } = Ae, Ge = ut({
75
+ autoPlacement: De,
76
+ menuPlacement: ve,
77
77
  size: d,
78
- selectSearchRef: L,
79
- isOpen: f
80
- }), { actualMenuPlacement: Ge, isVisible: qe, isMenuReady: He, updateMenuPlacement: ee } = Fe, Qe = ct({ loadOnOpen: xe, loading: Ve }), { isLoading: te, handleDataLoading: H } = Qe, je = ht({
81
- filterOnSearch: we,
82
- items: a && o ? o.normalizedItems : i,
83
- internalSearchQuery: I,
78
+ selectSearchRef: R,
79
+ isOpen: p
80
+ }), { actualMenuPlacement: qe, isVisible: He, isMenuReady: Qe, updateMenuPlacement: te } = Ge, je = ct({ loadOnOpen: Ve, loading: Te }), { isLoading: ne, handleDataLoading: H } = je, Je = ht({
81
+ filterOnSearch: Ce,
82
+ items: a && o ? o.normalizedItems : r,
83
+ internalSearchQuery: h,
84
84
  selectedItems: u,
85
85
  enableNestedSelection: a,
86
- searchInNestedItems: X,
87
- displayValue: p,
86
+ searchInNestedItems: Y,
87
+ displayValue: f,
88
88
  groupBy: N,
89
89
  searchInHeaderGroupItems: G,
90
- firstSelectedSearchQuery: Ee
91
- }), { filteredItems: B } = je, Je = gt({
90
+ firstSelectedSearchQuery: Fe
91
+ }), { filteredItems: B } = Je, Ue = gt({
92
92
  filteredItems: B,
93
93
  groupBy: N,
94
- getGroupTitle: Te,
94
+ getGroupTitle: Le,
95
95
  size: d,
96
- parentRef: Z
97
- }), { virtualItems: Ue, virtualizer: $e } = Je;
98
- le(() => {
99
- if (a && i.length > 0) {
100
- const e = It(i);
101
- _(e);
96
+ parentRef: _
97
+ }), { virtualItems: $e, virtualizer: We } = Ue;
98
+ ce(() => {
99
+ if (a && r.length > 0) {
100
+ const e = It(r);
101
+ ee(e);
102
102
  } else
103
- _(null);
104
- }, [i, a]), le(() => {
103
+ ee(null);
104
+ }, [r, a]), ce(() => {
105
105
  if (S) {
106
106
  let e = S;
107
- a && o && (e = S.map((r) => St(
107
+ a && o && (e = S.map((l) => St(
108
108
  o.normalizedItems
109
109
  ).find(
110
- (l) => l.id === r.id || l.originalId === (r.originalId || r.id) && l.name === r.name
111
- )).filter(Boolean)), g(e);
112
- const n = a ? de(
110
+ (s) => s.id === l.id || s.originalId === (l.originalId || l.id) && s.name === l.name
111
+ )).filter(Boolean)), I(e);
112
+ const n = a ? ue(
113
113
  e,
114
114
  a,
115
- o ? o.normalizedItems : i,
116
- p
117
- ) : Nt(e, p);
115
+ o ? o.normalizedItems : r,
116
+ f
117
+ ) : Nt(e, f);
118
118
  w(n);
119
- } else S === null && (g([]), w(""));
120
- }, [S, p, a, o, i]);
121
- const We = (e) => {
119
+ } else S === null && (I([]), w(""));
120
+ }, [S, f, a, o, r]);
121
+ const Ke = (e) => {
122
122
  let n = e;
123
123
  if (a && o) {
124
- const { normalizedItems: l } = o;
125
- n = me(
124
+ const { normalizedItems: s } = o;
125
+ n = pe(
126
126
  e,
127
127
  u,
128
- l
128
+ s
129
129
  );
130
- } else a && (n = me(
130
+ } else a && (n = pe(
131
131
  e,
132
132
  u,
133
- i
133
+ r
134
134
  ));
135
- const r = wt(
135
+ const l = wt(
136
136
  n,
137
- a && o ? o.normalizedItems : i
137
+ a && o ? o.normalizedItems : r
138
138
  );
139
- g(n), s == null || s(r);
140
- const h = de(
141
- r,
139
+ I(n), i == null || i(l);
140
+ const g = ue(
141
+ l,
142
142
  a,
143
- a && o ? o.normalizedItems : i,
144
- p
143
+ a && o ? o.normalizedItems : r,
144
+ f
145
145
  );
146
- w(h), q(""), R && ((u.length === 0 || D.includes(",")) && M(I), n.length === 0 && M("")), O(!0), A(b), setTimeout(() => {
146
+ if (w(g), q(""), O) {
147
+ const s = x.replace(h, "").trim(), Q = s[s.length - 1] === ",";
148
+ (u.length === 0 || Q) && C(h), n.length === 0 && C("");
149
+ }
150
+ M(!0), A(D), setTimeout(() => {
147
151
  if (z.current) {
148
152
  z.current.focus(), z.current.scrollLeft = z.current.scrollWidth;
149
- const l = h.length;
150
- z.current.setSelectionRange(l, l);
153
+ const s = g.length;
154
+ z.current.setSelectionRange(s, s);
151
155
  }
152
156
  }, 0);
153
- }, ne = async (e) => {
154
- var h, l;
155
- if (y) return;
157
+ }, ae = async (e) => {
158
+ var g, s;
159
+ if (b) return;
156
160
  const n = e.target.value;
157
- if (w(n), q(((h = n.split(",").pop()) == null ? void 0 : h.trim()) || ""), k == null || k(n), a)
158
- R && n[n.length - 1] === "," && M(""), n === "" && u.length > 0 && (R && M(""), g([]), s == null || s([]));
161
+ if (w(n), q(((g = n.split(",").pop()) == null ? void 0 : g.trim()) || ""), k == null || k(n), a)
162
+ O && n[n.length - 1] === "," && C(""), n === "" && u.length > 0 && (O && C(""), I([]), i == null || i([]));
159
163
  else {
160
- const ot = n.split(",").map((j) => j.trim()).filter(Boolean), Q = i.filter(
161
- (j) => ot.includes(j[p])
164
+ const Q = n.split(",").map((J) => J.trim()).filter(Boolean), j = r.filter(
165
+ (J) => Q.includes(J[f])
162
166
  );
163
- JSON.stringify(Q) !== JSON.stringify(u) && (g(Q), s == null || s(Q));
167
+ JSON.stringify(j) !== JSON.stringify(u) && (I(j), i == null || i(j));
164
168
  }
165
- f || (O(!0), A(b), await H());
166
- const r = (l = L.current) == null ? void 0 : l.querySelector(
169
+ p || (M(!0), A(D), await H());
170
+ const l = (s = R.current) == null ? void 0 : s.querySelector(
167
171
  `.${t.options}`
168
172
  );
169
- r && typeof r.scrollTo == "function" && r.scrollTo({ top: 0, behavior: "smooth" });
170
- }, Ke = (e) => {
173
+ l && typeof l.scrollTo == "function" && l.scrollTo({ top: 0, behavior: "smooth" });
174
+ }, Xe = (e) => {
171
175
  e.preventDefault(), e.currentTarget.focus();
172
176
  const n = e.currentTarget.value.length;
173
177
  e.currentTarget.setSelectionRange(n, n);
174
- }, Xe = () => {
175
- w(""), q(""), g([]), R && M(""), s == null || s([]);
176
- }, Ye = (e) => {
177
- e.stopPropagation(), Xe();
178
- }, ae = async () => {
179
- ee(), O(!0), A(b), await H();
180
- }, Ze = async (e) => {
181
- if (y) {
178
+ }, Ye = () => {
179
+ w(""), q(""), I([]), O && C(""), i == null || i([]);
180
+ }, Ze = (e) => {
181
+ e.stopPropagation(), Ye();
182
+ }, oe = async () => {
183
+ te(), M(!0), A(D), await H();
184
+ }, _e = async (e) => {
185
+ if (b) {
182
186
  e.target.blur();
183
187
  return;
184
188
  }
185
- await ae();
186
- }, oe = async () => {
187
- const e = !f;
188
- e && (ee(), A(b), await H()), O(e), V == null || V(e);
189
- }, _e = () => {
190
- if (ze)
189
+ await oe();
190
+ }, se = async () => {
191
+ const e = !p;
192
+ e && (te(), A(D), O && C(""), await H()), M(e), T == null || T(e);
193
+ }, et = () => {
194
+ if (we)
191
195
  return {
192
196
  addonType: "react-node",
193
- addonContent: /* @__PURE__ */ C(re, { children: [
194
- te && (T === x.Input || T === x.Both) && /* @__PURE__ */ c(fe, { size: "s" }),
197
+ addonContent: /* @__PURE__ */ v(le, { children: [
198
+ ne && (L === V.Input || L === V.Both) && /* @__PURE__ */ c(he, { size: "s" }),
195
199
  /* @__PURE__ */ c(
196
- he,
200
+ ge,
197
201
  {
198
- className: v(t.button, {
202
+ className: y(t.button, {
199
203
  [t.disabled]: m
200
204
  }),
201
205
  disabled: m,
202
- onMouseDown: oe,
206
+ onMouseDown: se,
203
207
  children: /* @__PURE__ */ c(
204
208
  vt,
205
209
  {
206
- iconName: d == ce.M ? "DropdownArrowBottom16px" : "DropdownArrowDown24px",
207
- className: v(t["selector-icon"], {
208
- [t["selector-icon-open"]]: f
210
+ iconName: d == de.M ? "DropdownArrowBottom16px" : "DropdownArrowDown24px",
211
+ className: y(t["selector-icon"], {
212
+ [t["selector-icon-open"]]: p
209
213
  })
210
214
  }
211
215
  )
@@ -213,144 +217,145 @@ const Wt = st(
213
217
  )
214
218
  ] })
215
219
  };
216
- }, et = () => te && (T === x.Dropdown || T === x.Both) ? /* @__PURE__ */ C("div", { className: t.loader, children: [
217
- /* @__PURE__ */ c(fe, { size: "s" }),
220
+ }, tt = () => ne && (L === V.Dropdown || L === V.Both) ? /* @__PURE__ */ v("div", { className: t.loader, children: [
221
+ /* @__PURE__ */ c(he, { size: "s" }),
218
222
  "Загрузка..."
219
- ] }) : De, se = (e) => {
223
+ ] }) : Me, ie = (e) => {
220
224
  let n = e.name;
221
- const r = e.bottom && /* @__PURE__ */ c("div", { children: e.bottom });
222
- if (F && I && !(N && G)) {
223
- const h = I.toLowerCase();
224
- (typeof e.name == "string" ? e.name : String(e.name || "")).toLowerCase().includes(h) && (n = Ct(
225
+ const l = e.bottom && /* @__PURE__ */ c("div", { children: e.bottom });
226
+ if (F && h && !(N && G)) {
227
+ const g = h.toLowerCase();
228
+ (typeof e.name == "string" ? e.name : String(e.name || "")).toLowerCase().includes(g) && (n = Ct(
225
229
  e.name,
226
- I,
230
+ h,
227
231
  t["highlighted-text"]
228
232
  ));
229
233
  }
230
- return /* @__PURE__ */ C(re, { children: [
234
+ return /* @__PURE__ */ v(le, { children: [
231
235
  n,
232
- r
236
+ l
233
237
  ] });
234
- }, tt = pt({
235
- inputValue: D,
238
+ }, nt = pt({
239
+ isOpen: p,
240
+ inputValue: x,
236
241
  filteredItems: B,
237
242
  selectedItems: u,
238
- expandedOptions: Ae,
239
- setExpandedOptions: ke,
243
+ expandedOptions: ke,
244
+ setExpandedOptions: Ee,
240
245
  size: d,
241
- classNameOption: U,
242
- items: a && o ? o.normalizedItems : i,
246
+ classNameOption: $,
247
+ items: a && o ? o.normalizedItems : r,
243
248
  enableNestedSelection: a,
244
- searchInNestedItems: X,
245
- internalSearchQuery: I,
246
- renderOptionContent: se,
249
+ searchInNestedItems: Y,
250
+ internalSearchQuery: h,
251
+ renderOptionContent: ie,
247
252
  groupBy: N,
248
- useIconInsteadOfCheckbox: Y,
253
+ useIconInsteadOfCheckbox: Z,
249
254
  highlightMatches: F,
250
255
  showCollapsedSearchedGroups: Re
251
- }), { renderNestedOptions: nt } = tt, ie = lt({
256
+ }), { renderNestedOptions: at } = nt, re = lt({
252
257
  selectedItems: u,
253
258
  enableNestedSelection: a,
254
259
  size: d,
255
- chipVariant: ye,
256
- items: a && o ? o.normalizedItems : i,
257
- displayValue: p,
258
- setSelectedItems: g,
259
- onChange: s,
260
+ chipVariant: be,
261
+ items: a && o ? o.normalizedItems : r,
262
+ displayValue: f,
263
+ setSelectedItems: I,
264
+ onChange: i,
260
265
  setInputValue: w
261
266
  });
262
267
  dt({
263
- isOpen: f,
264
- setIsOpen: O,
265
- onIsOpen: V,
266
- id: b,
267
- selectSearchRef: L,
268
- isHandlingRef: Be
268
+ isOpen: p,
269
+ setIsOpen: M,
270
+ onIsOpen: T,
271
+ id: D,
272
+ selectSearchRef: R,
273
+ isHandlingRef: Pe
269
274
  });
270
- const at = ft({
271
- items: a && o ? o.normalizedItems : i,
275
+ const ot = ft({
276
+ items: a && o ? o.normalizedItems : r,
272
277
  filteredItems: B,
273
278
  size: d,
274
- actualMenuPlacement: Ge,
275
- isVisible: qe,
276
- noOptionsText: et(),
277
- noMatchText: Me,
279
+ actualMenuPlacement: qe,
280
+ isVisible: He,
281
+ noOptionsText: tt(),
282
+ noMatchText: xe,
278
283
  enableNestedSelection: a,
279
- renderNestedOptions: nt,
284
+ renderNestedOptions: at,
280
285
  groupBy: N,
281
- parentRef: Z,
282
- virtualItems: Ue,
283
- virtualizer: $e,
284
- classNameOption: U,
286
+ parentRef: _,
287
+ virtualItems: $e,
288
+ virtualizer: We,
289
+ classNameOption: $,
285
290
  selectedItems: u,
286
- renderOptionContent: se,
291
+ renderOptionContent: ie,
287
292
  cls: t,
288
- useIconInsteadOfCheckbox: Y,
293
+ useIconInsteadOfCheckbox: Z,
289
294
  highlightMatches: F,
290
- internalSearchQuery: I,
295
+ internalSearchQuery: h,
291
296
  searchInHeaderGroupItems: G
292
297
  });
293
- return /* @__PURE__ */ C("div", { ref: L, children: [
298
+ return /* @__PURE__ */ v("div", { ref: R, children: [
294
299
  /* @__PURE__ */ c(
295
300
  Ot,
296
301
  {
297
302
  multiple: !0,
298
303
  as: "div",
299
304
  value: u,
300
- className: v(t["multi-select-search"], {
301
- [t.full]: Ne,
305
+ className: y(t["multi-select-search"], {
306
+ [t.full]: ze,
302
307
  [t.disabled]: m
303
308
  }),
304
- onChange: We,
305
- ref: Se,
309
+ onChange: Ke,
310
+ ref: Ne,
306
311
  disabled: m,
307
312
  virtual: N ? void 0 : { options: B },
308
- children: /* @__PURE__ */ C(
313
+ children: /* @__PURE__ */ v(
309
314
  "div",
310
315
  {
311
- className: v(t.container, t[d], {
312
- [t["container-open"]]: f
316
+ className: y(t.container, t[d], {
317
+ [t["container-open"]]: p
313
318
  }),
314
319
  children: [
315
- y && /* @__PURE__ */ C("div", { className: t["input-container"], children: [
320
+ b && /* @__PURE__ */ v("div", { className: t["input-container"], children: [
316
321
  /* @__PURE__ */ c(
317
- he,
322
+ ge,
318
323
  {
319
324
  disabled: m,
320
325
  style: { width: "100%" },
321
- onClick: oe,
326
+ onClick: se,
322
327
  children: /* @__PURE__ */ c(
323
- ge,
328
+ Ie,
324
329
  {
325
- as: pe,
326
- label: J,
327
- size: ue(d),
328
- className: v(t["multi-select-input"], {
329
- [t["multi-select-input-disabled"]]: y && E
330
+ as: fe,
331
+ label: U,
332
+ size: me(d),
333
+ className: y(t["multi-select-input"], {
334
+ [t["multi-select-input-disabled"]]: b && E
330
335
  }),
331
- onChange: ne,
332
- value: D,
336
+ onChange: ae,
337
+ value: x,
333
338
  disabled: m,
334
- variant: $,
339
+ variant: W,
335
340
  rightSlotClassName: t["right-slot"],
336
341
  requiredMarkClassName: t["required-mark"],
337
342
  "data-testid": "select-search-input",
338
- onFocus: Ze,
343
+ onFocus: _e,
339
344
  rightAddon: {
340
345
  addonType: "icon",
341
- addonContent: zt(f, d)
346
+ addonContent: zt(p, d)
342
347
  },
343
- autocomplete: K,
344
- ...W
348
+ autocomplete: X,
349
+ ...K
345
350
  }
346
351
  )
347
352
  }
348
353
  ),
349
- E && D && /* @__PURE__ */ c(
354
+ E && x && /* @__PURE__ */ c(
350
355
  yt,
351
356
  {
352
357
  tabIndex: -1,
353
- className: v(t.clear, {
358
+ className: y(t.clear, {
354
359
  [t.disabled]: m
355
360
  }),
356
361
  iconButtonClassName: t["icon-button"],
@@ -360,41 +365,41 @@ const Wt = st(
360
365
  clear: !0,
361
366
  disabled: m,
362
367
  variant: "secondary-gray",
363
- onClick: Ye,
368
+ onClick: Ze,
364
369
  "data-testid": "clear-button"
365
370
  }
366
371
  )
367
372
  ] }),
368
- !y && /* @__PURE__ */ c(
369
- ge,
373
+ !b && /* @__PURE__ */ c(
374
+ Ie,
370
375
  {
371
- as: pe,
372
- label: J,
373
- size: ue(d),
376
+ as: fe,
377
+ label: U,
378
+ size: me(d),
374
379
  className: t["multi-select-input"],
375
380
  rightSlotClassName: t["right-slot"],
376
381
  requiredMarkClassName: t["required-mark"],
377
- value: D,
382
+ value: x,
378
383
  disabled: m,
379
- variant: $,
384
+ variant: W,
380
385
  withClearButton: E,
381
- onFocus: ae,
382
- onMouseDown: Ke,
383
- onChange: ne,
386
+ onFocus: oe,
387
+ onMouseDown: Xe,
388
+ onChange: ae,
384
389
  ref: z,
385
- rightAddon: _e(),
390
+ rightAddon: et(),
386
391
  "data-testid": "select-search-input",
387
- autocomplete: K,
388
- ...W
392
+ autocomplete: X,
393
+ ...K
389
394
  }
390
395
  ),
391
- f && He && at()
396
+ p && Qe && ot()
392
397
  ]
393
398
  }
394
399
  )
395
400
  }
396
401
  ),
397
- ve && ie && /* @__PURE__ */ c("div", { className: t["chip-container"], children: ie })
402
+ ye && re && /* @__PURE__ */ c("div", { className: t["chip-container"], children: re })
398
403
  ] });
399
404
  }
400
405
  );
@@ -3,6 +3,7 @@ import { EMultiSelectSearchSize } from '../constants';
3
3
  import { TMultiSelectOption } from '../types';
4
4
 
5
5
  type TUseNestedSelectionProps = {
6
+ isOpen: boolean;
6
7
  inputValue: string;
7
8
  filteredItems: TMultiSelectOption[];
8
9
  selectedItems: TMultiSelectOption[];
@@ -24,5 +25,5 @@ type TUseNestedSelectionReturn = {
24
25
  toggleExpanded: (optionId: string | number) => void;
25
26
  renderNestedOptions: (options: TMultiSelectOption[], level?: number) => ReactNode[];
26
27
  };
27
- export declare const useNestedSelection: ({ inputValue, filteredItems, selectedItems, expandedOptions, setExpandedOptions, size, classNameOption, items, enableNestedSelection, searchInNestedItems, internalSearchQuery, renderOptionContent, groupBy, useIconInsteadOfCheckbox, showCollapsedSearchedGroups }: TUseNestedSelectionProps) => TUseNestedSelectionReturn;
28
+ export declare const useNestedSelection: ({ isOpen, inputValue, filteredItems, selectedItems, expandedOptions, setExpandedOptions, size, classNameOption, items, enableNestedSelection, searchInNestedItems, internalSearchQuery, renderOptionContent, groupBy, useIconInsteadOfCheckbox, showCollapsedSearchedGroups }: TUseNestedSelectionProps) => TUseNestedSelectionReturn;
28
29
  export {};
@@ -4,7 +4,7 @@ import "react";
4
4
  import "../../../icons/Icon.js";
5
5
  import "../../CheckboxMimir/CheckboxMimir.js";
6
6
  import "../constants.js";
7
- import { u as c } from "../../../useNestedSelection-D1WOAYnL.js";
7
+ import { u as c } from "../../../useNestedSelection-CBfin3s1.js";
8
8
  import "../utils.js";
9
9
  import "../../../combobox-fIVOzEhl.js";
10
10
  export {
@@ -46,13 +46,23 @@ export type TProps = {
46
46
  * Функция обратного вызова, вызываемая при удалении уведомления.
47
47
  */
48
48
  onToastRemove?: (toastId: string, ref: RefObject<HTMLDivElement>) => void;
49
+ /**
50
+ * Функция обратного вызова, вызываемая при удалении тоста по причине истечения таймера.
51
+ */
52
+ onExpire?: () => void;
53
+ /**
54
+ * Функция обратного вызова, вызываемая при клике на крестик.
55
+ */
56
+ onButtonRemoveClick?: () => void;
49
57
  /**
50
58
  * Слот уведомления.
51
59
  */
52
- slot?: ReactNode;
60
+ slot?: ReactNode | ((props: {
61
+ handleToastRemove: VoidFunction;
62
+ }) => JSX.Element);
53
63
  /**
54
64
  * Флаг, указывающий на приостановку таймера при наведении курсора.
55
65
  */
56
66
  pauseOnHover?: boolean;
57
67
  };
58
- export declare const Toast: import('react').MemoExoticComponent<({ id, title, message, position, variant, duration, autoClose, needProgress, needTimer, needCloseButton, onToastRemove, slot, pauseOnHover }: TProps) => import("react/jsx-runtime").JSX.Element>;
68
+ export declare const Toast: import('react').MemoExoticComponent<({ id, title, message, position, variant, duration, autoClose, needProgress, needTimer, needCloseButton, onToastRemove, onExpire, onButtonRemoveClick, slot, pauseOnHover }: TProps) => import("react/jsx-runtime").JSX.Element>;
@@ -1,87 +1,97 @@
1
- import { jsxs as a, jsx as r } from "react/jsx-runtime";
2
- import { c as P } from "../../index-DIxK0V-G.js";
3
- import { memo as L, useRef as _, useState as B } from "react";
4
- import { ANIMATION_VARIABLES_MAP as D, EToastPosition as S, EToastVariant as w, DEFAULT_TOAST_DURATION as O } from "./constants.js";
5
- import { c as s, P as T } from "../../ProgressBar-F970LqqJ.js";
6
- import { useTimer as U } from "../../hooks/useTimer/index.js";
7
- import { Button as j } from "../Button/Button.js";
8
- const g = L(
1
+ import { jsxs as t, jsx as a } from "react/jsx-runtime";
2
+ import { c as S } from "../../index-DIxK0V-G.js";
3
+ import { memo as w, useRef as y, useState as O } from "react";
4
+ import { ANIMATION_VARIABLES_MAP as U, EToastPosition as j, EToastVariant as x, DEFAULT_TOAST_DURATION as F } from "./constants.js";
5
+ import { c as s, P as V } from "../../ProgressBar-F970LqqJ.js";
6
+ import { useTimer as b } from "../../hooks/useTimer/index.js";
7
+ import { Button as G } from "../Button/Button.js";
8
+ const Q = w(
9
9
  ({
10
- id: c,
11
- title: i = "",
12
- message: m,
13
- position: A = S.TOP_RIGHT,
14
- variant: n = w.DEFAULT,
15
- duration: t = O,
16
- autoClose: o = !0,
17
- needProgress: u = !0,
18
- needTimer: p = !0,
19
- needCloseButton: E = !0,
20
- onToastRemove: e,
21
- slot: f,
22
- pauseOnHover: d = !1
10
+ id: i,
11
+ title: m = "",
12
+ message: u,
13
+ position: P = j.TOP_RIGHT,
14
+ variant: h = x.DEFAULT,
15
+ duration: c = F,
16
+ autoClose: p = !0,
17
+ needProgress: N = !0,
18
+ needTimer: A = !0,
19
+ needCloseButton: L = !0,
20
+ onToastRemove: r,
21
+ onExpire: f,
22
+ onButtonRemoveClick: d,
23
+ slot: e,
24
+ pauseOnHover: I = !1
23
25
  }) => {
24
- const l = _(null), [N, h] = B(!1), { seconds: I } = U({
25
- expiryTimestamp: Date.now() + t,
26
- autoStart: o,
27
- onExpire: o ? () => e == null ? void 0 : e(c, l) : void 0,
28
- isPaused: N
29
- }), x = () => {
30
- d && h(!0);
31
- }, M = () => {
32
- d && h(!1);
26
+ const l = y(null), [n, M] = O(!1), { seconds: _ } = b({
27
+ expiryTimestamp: Date.now() + c,
28
+ autoStart: p,
29
+ onExpire: p ? () => {
30
+ r == null || r(i, l), f == null || f();
31
+ } : void 0,
32
+ isPaused: n
33
+ }), D = () => {
34
+ I && M(!0);
35
+ }, E = () => {
36
+ I && M(!1);
33
37
  };
34
- return /* @__PURE__ */ a(
38
+ return /* @__PURE__ */ t(
35
39
  "div",
36
40
  {
37
41
  style: {
38
- "--elm-translate": D[A]
42
+ "--elm-translate": U[P]
39
43
  },
40
- className: P(
44
+ className: S(
41
45
  s["toast-in"],
42
46
  s["toast-wrapper"],
43
- s[n]
47
+ s[h]
44
48
  ),
45
49
  ref: l,
46
50
  role: "alert",
47
- onMouseEnter: x,
48
- onMouseLeave: M,
51
+ onMouseEnter: D,
52
+ onMouseLeave: E,
49
53
  children: [
50
- i && /* @__PURE__ */ r("h3", { className: s.title, children: i }),
51
- m && /* @__PURE__ */ r("div", { className: s.message, children: m }),
52
- (p || u) && /* @__PURE__ */ a("div", { children: [
53
- !!t && p && /* @__PURE__ */ a("div", { className: s.timer, children: [
54
- /* @__PURE__ */ r("h4", { className: s["timer-title"], children: "Осталось" }),
55
- /* @__PURE__ */ a("p", { className: s.seconds, children: [
56
- I,
54
+ m && /* @__PURE__ */ a("h3", { className: s.title, children: m }),
55
+ u && /* @__PURE__ */ a("div", { className: s.message, children: u }),
56
+ (A || N) && /* @__PURE__ */ t("div", { children: [
57
+ !!c && A && /* @__PURE__ */ t("div", { className: s.timer, children: [
58
+ /* @__PURE__ */ a("h4", { className: s["timer-title"], children: "Осталось" }),
59
+ /* @__PURE__ */ t("p", { className: s.seconds, children: [
60
+ _,
57
61
  " сек"
58
62
  ] })
59
63
  ] }),
60
- !!t && u && /* @__PURE__ */ r(
61
- T,
64
+ !!c && N && /* @__PURE__ */ a(
65
+ V,
62
66
  {
63
- variant: n,
64
- duration: t,
65
- isPaused: N
67
+ variant: h,
68
+ duration: c,
69
+ isPaused: n
66
70
  }
67
71
  )
68
72
  ] }),
69
- E && /* @__PURE__ */ r(
70
- j,
73
+ L && /* @__PURE__ */ a(
74
+ G,
71
75
  {
72
- onClick: () => e == null ? void 0 : e(c, l),
76
+ onClick: () => {
77
+ r == null || r(i, l), d == null || d();
78
+ },
73
79
  clear: !0,
74
80
  isIconButton: !0,
75
81
  className: s["close-button"],
76
82
  iconName: "Close24px"
77
83
  }
78
84
  ),
79
- f && /* @__PURE__ */ r("div", { className: s.slot, children: f })
85
+ e && /* @__PURE__ */ a("div", { className: s.slot, children: typeof e == "function" ? e({
86
+ handleToastRemove: () => {
87
+ r == null || r(i, l);
88
+ }
89
+ }) : e })
80
90
  ]
81
91
  }
82
92
  );
83
93
  }
84
94
  );
85
95
  export {
86
- g as Toast
96
+ Q as Toast
87
97
  };
@@ -1,5 +1,5 @@
1
1
  import { EToastVariant } from './constants';
2
2
  import { TProps } from './Toast';
3
3
 
4
- export type TToast = Record<EToastVariant | `${EToastVariant}`, (toast: Omit<TProps, 'id' | 'variant'>) => void>;
4
+ export type TToast = Record<EToastVariant | `${EToastVariant}`, (toast: Omit<TProps, 'id' | 'variant' | 'onToastRemove'>) => void>;
5
5
  export type ToastContextType = TToast;
@@ -1,44 +1,44 @@
1
- import { jsxs as k, jsx as d } from "react/jsx-runtime";
2
- import { c as M } from "./index-DIxK0V-G.js";
3
- import { useEffect as F } from "react";
4
- import { Icon as v } from "./icons/Icon.js";
5
- import { CheckboxMimir as L } from "./components/CheckboxMimir/CheckboxMimir.js";
6
- import { EMultiSelectSearchSize as S } from "./components/MultiSelectSearch/constants.js";
7
- import { getAllChildrenIds as P } from "./components/MultiSelectSearch/utils.js";
8
- import { W } from "./combobox-fIVOzEhl.js";
9
- import './assets/useNestedSelection.css';const B = "_disabled_1l3p8_5", T = "_container_1l3p8_9", $ = "_l_1l3p8_36", y = "_loader_1l3p8_40", H = "_full_1l3p8_50", J = "_button_1l3p8_62", K = "_options_1l3p8_32", R = "_visible_1l3p8_89", U = "_top_1l3p8_92", X = "_bottom_1l3p8_97", Y = "_m_1l3p8_2", Z = "_focused_1l3p8_157", G = "_option_1l3p8_32", Q = "_chip_1l3p8_186", V = "_clear_1l3p8_211", l = {
1
+ import { jsxs as M, jsx as d } from "react/jsx-runtime";
2
+ import { c as v } from "./index-DIxK0V-G.js";
3
+ import { useEffect as L } from "react";
4
+ import { Icon as S } from "./icons/Icon.js";
5
+ import { CheckboxMimir as P } from "./components/CheckboxMimir/CheckboxMimir.js";
6
+ import { EMultiSelectSearchSize as N } from "./components/MultiSelectSearch/constants.js";
7
+ import { getAllChildrenIds as W } from "./components/MultiSelectSearch/utils.js";
8
+ import { W as B } from "./combobox-fIVOzEhl.js";
9
+ import './assets/useNestedSelection.css';const T = "_disabled_1l3p8_5", $ = "_container_1l3p8_9", y = "_l_1l3p8_36", H = "_loader_1l3p8_40", J = "_full_1l3p8_50", K = "_button_1l3p8_62", R = "_options_1l3p8_32", U = "_visible_1l3p8_89", X = "_top_1l3p8_92", Y = "_bottom_1l3p8_97", Z = "_m_1l3p8_2", G = "_focused_1l3p8_157", Q = "_option_1l3p8_32", V = "_chip_1l3p8_186", z = "_clear_1l3p8_211", l = {
10
10
  "multi-select-search": "_multi-select-search_1l3p8_2",
11
- disabled: B,
12
- container: T,
11
+ disabled: T,
12
+ container: $,
13
13
  "container-open": "_container-open_1l3p8_18",
14
14
  "group-header": "_group-header_1l3p8_22",
15
15
  "options-container": "_options-container_1l3p8_32",
16
- l: $,
17
- loader: y,
16
+ l: y,
17
+ loader: H,
18
18
  "input-container": "_input-container_1l3p8_45",
19
- full: H,
19
+ full: J,
20
20
  "selected-icon": "_selected-icon_1l3p8_54",
21
21
  "selector-icon-open": "_selector-icon-open_1l3p8_58",
22
- button: J,
22
+ button: K,
23
23
  "selector-icon": "_selector-icon_1l3p8_58",
24
- options: K,
25
- visible: R,
26
- top: U,
27
- bottom: X,
24
+ options: R,
25
+ visible: U,
26
+ top: X,
27
+ bottom: Y,
28
28
  "no-options": "_no-options_1l3p8_118",
29
- m: Y,
29
+ m: Z,
30
30
  "multi-select-input-disabled": "_multi-select-input-disabled_1l3p8_154",
31
31
  "multi-select-input": "_multi-select-input_1l3p8_154",
32
- focused: Z,
33
- option: G,
32
+ focused: G,
33
+ option: Q,
34
34
  "option-active": "_option-active_1l3p8_176",
35
35
  "option-inner": "_option-inner_1l3p8_179",
36
- chip: Q,
36
+ chip: V,
37
37
  "chip-container": "_chip-container_1l3p8_191",
38
38
  "chip-root": "_chip-root_1l3p8_197",
39
39
  "right-slot": "_right-slot_1l3p8_201",
40
40
  "required-mark": "_required-mark_1l3p8_206",
41
- clear: V,
41
+ clear: z,
42
42
  "icon-button": "_icon-button_1l3p8_220",
43
43
  "highlighted-text": "_highlighted-text_1l3p8_224",
44
44
  "highlighted-text-wrapper": "_highlighted-text-wrapper_1l3p8_229",
@@ -46,73 +46,75 @@ import './assets/useNestedSelection.css';const B = "_disabled_1l3p8_5", T = "_co
46
46
  "expand-button": "_expand-button_1l3p8_241",
47
47
  "expand-icon": "_expand-icon_1l3p8_253",
48
48
  "expand-icon-expanded": "_expand-icon-expanded_1l3p8_256"
49
- }, sn = ({
49
+ }, rn = ({
50
+ isOpen: m,
50
51
  inputValue: h,
51
52
  filteredItems: u,
52
- selectedItems: N,
53
- expandedOptions: D,
53
+ selectedItems: D,
54
+ expandedOptions: A,
54
55
  setExpandedOptions: p,
55
56
  size: a,
56
- classNameOption: A,
57
+ classNameOption: E,
57
58
  items: f,
58
59
  enableNestedSelection: g,
59
60
  searchInNestedItems: x = !1,
60
- internalSearchQuery: m,
61
- renderOptionContent: E,
62
- groupBy: I,
63
- useIconInsteadOfCheckbox: j = !1,
64
- showCollapsedSearchedGroups: b = !1
61
+ internalSearchQuery: b,
62
+ renderOptionContent: I,
63
+ groupBy: j,
64
+ useIconInsteadOfCheckbox: q = !1,
65
+ showCollapsedSearchedGroups: C = !1
65
66
  }) => {
66
- const C = (i) => {
67
- p((c) => {
68
- const e = new Set(c);
69
- return e.has(i) ? e.delete(i) : e.add(i), e;
67
+ const w = (c) => {
68
+ p((i) => {
69
+ const e = new Set(i);
70
+ return e.has(c) ? e.delete(c) : e.add(c), e;
70
71
  });
71
72
  };
72
- F(() => {
73
- const i = h.trim()[h.length - 1] === ",";
74
- if (b && i) {
73
+ L(() => {
74
+ const c = h.trim()[h.length - 1] === ",";
75
+ if (C && (c || !m)) {
75
76
  p(/* @__PURE__ */ new Set([]));
76
77
  return;
77
78
  }
78
- if (g && x && m) {
79
- const c = /* @__PURE__ */ new Set(), e = /* @__PURE__ */ new Set(), s = (n) => {
79
+ if (g && x && b) {
80
+ const i = /* @__PURE__ */ new Set(), e = /* @__PURE__ */ new Set(), s = (n) => {
80
81
  n.forEach((o) => {
81
82
  e.has(o.id) || (e.add(o.id), o.children && o.children.length > 0 && (o.children.some(
82
83
  (t) => u.some((_) => _.id === t.id)
83
- ) && c.add(o.id), s(o.children)));
84
+ ) && i.add(o.id), s(o.children)));
84
85
  });
85
86
  };
86
- s(f), p((n) => /* @__PURE__ */ new Set([...n, ...c]));
87
+ s(f), p((n) => /* @__PURE__ */ new Set([...n, ...i]));
87
88
  }
88
89
  }, [
90
+ m,
89
91
  h,
90
- b,
92
+ C,
91
93
  u,
92
94
  g,
93
95
  x,
94
- m,
96
+ b,
95
97
  f,
96
98
  p
97
99
  ]);
98
- const q = (i) => {
99
- const c = N.map((t) => t.id);
100
- if (!i.children || i.children.length === 0)
100
+ const F = (c) => {
101
+ const i = D.map((t) => t.id);
102
+ if (!c.children || c.children.length === 0)
101
103
  return {
102
- checked: c.includes(i.id),
104
+ checked: i.includes(c.id),
103
105
  isMinusIcon: !1
104
106
  };
105
- const e = i.children.flatMap((t) => [
107
+ const e = c.children.flatMap((t) => [
106
108
  t.id,
107
- ...P(t)
109
+ ...W(t)
108
110
  ]), s = e.filter(
109
- (t) => c.includes(t)
111
+ (t) => i.includes(t)
110
112
  ).length, n = e.length, o = s > 0;
111
113
  return {
112
114
  checked: o,
113
115
  isMinusIcon: o && !(s === n)
114
116
  };
115
- }, w = (i, c = 0) => {
117
+ }, k = (c, i = 0) => {
116
118
  const e = /* @__PURE__ */ new Map(), s = (n) => {
117
119
  if (e.has(n.id))
118
120
  return e.get(n.id);
@@ -126,46 +128,46 @@ import './assets/useNestedSelection.css';const B = "_disabled_1l3p8_5", T = "_co
126
128
  }
127
129
  return e.set(n.id, !1), !1;
128
130
  };
129
- return i.filter((n) => c === 0 ? s(n) && f.some((o) => o.id === n.id) : x ? s(n) : !n.children).map((n) => {
130
- const o = D.has(n.id), r = n.children && n.children.length > 0, t = q(n);
131
- return /* @__PURE__ */ k("div", { children: [
132
- /* @__PURE__ */ k(
133
- W,
131
+ return c.filter((n) => i === 0 ? s(n) && f.some((o) => o.id === n.id) : x ? s(n) : !n.children).map((n) => {
132
+ const o = A.has(n.id), r = n.children && n.children.length > 0, t = F(n);
133
+ return /* @__PURE__ */ M("div", { children: [
134
+ /* @__PURE__ */ M(
135
+ B,
134
136
  {
135
137
  value: n,
136
- className: ({ focus: _ }) => M(l.option, A, a && l[a], {
137
- [l["option-active"]]: _ && !I && !g,
138
- [l["nested-option"]]: c > 0
138
+ className: ({ focus: _ }) => v(l.option, E, a && l[a], {
139
+ [l["option-active"]]: _ && !j && !g,
140
+ [l["nested-option"]]: i > 0
139
141
  }),
140
142
  children: [
141
- j ? t.checked && /* @__PURE__ */ d(
142
- v,
143
+ q ? t.checked && /* @__PURE__ */ d(
144
+ S,
143
145
  {
144
- iconName: a === S.L ? "Done24px" : "Done16px",
146
+ iconName: a === N.L ? "Done24px" : "Done16px",
145
147
  className: l["selected-icon"]
146
148
  }
147
149
  ) : /* @__PURE__ */ d(
148
- L,
150
+ P,
149
151
  {
150
152
  isInteractive: !1,
151
153
  checked: t.checked,
152
154
  isMinusIcon: t.isMinusIcon
153
155
  }
154
156
  ),
155
- /* @__PURE__ */ d("div", { className: l["option-inner"], children: E(n) }),
157
+ /* @__PURE__ */ d("div", { className: l["option-inner"], children: I(n) }),
156
158
  r && /* @__PURE__ */ d(
157
159
  "div",
158
160
  {
159
161
  className: l["expand-button"],
160
162
  "data-testid": `expand-button-${n.id}`,
161
163
  onMouseDown: (_) => {
162
- _.stopPropagation(), C(n.id);
164
+ _.stopPropagation(), w(n.id);
163
165
  },
164
166
  children: /* @__PURE__ */ d(
165
- v,
167
+ S,
166
168
  {
167
- iconName: a === S.M ? "DropdownArrowBottom16px" : "DropdownArrowDown24px",
168
- className: M(l["expand-icon"], {
169
+ iconName: a === N.M ? "DropdownArrowBottom16px" : "DropdownArrowDown24px",
170
+ className: v(l["expand-icon"], {
169
171
  [l["expand-icon-expanded"]]: o
170
172
  })
171
173
  }
@@ -175,16 +177,16 @@ import './assets/useNestedSelection.css';const B = "_disabled_1l3p8_5", T = "_co
175
177
  ]
176
178
  }
177
179
  ),
178
- r && o && /* @__PURE__ */ d("div", { className: l["nested-children"], children: w(n.children, c + 1) })
180
+ r && o && /* @__PURE__ */ d("div", { className: l["nested-children"], children: k(n.children, i + 1) })
179
181
  ] }, n.id);
180
182
  });
181
183
  };
182
184
  return {
183
- toggleExpanded: C,
184
- renderNestedOptions: w
185
+ toggleExpanded: w,
186
+ renderNestedOptions: k
185
187
  };
186
188
  };
187
189
  export {
188
190
  l as c,
189
- sn as u
191
+ rn as u
190
192
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mimir-ui-kit",
3
3
  "private": false,
4
- "version": "1.58.1",
4
+ "version": "1.59.0",
5
5
  "type": "module",
6
6
  "exports": {
7
7
  ".": {