mimir-ui-kit 1.38.6 → 1.38.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (29) hide show
  1. package/dist/{combobox-DgSZTriw.js → combobox-CVtJDVoZ.js} +251 -254
  2. package/dist/components/Accordion/Accordion.d.ts +1 -1
  3. package/dist/components/Accordion/Accordion.js +3 -3
  4. package/dist/components/CheckboxMimir/CheckboxMimir.js +4 -4
  5. package/dist/components/Dropdown/Dropdown.js +32 -32
  6. package/dist/components/MultiSelectSearch/MultiSelectSearch.d.ts +1 -0
  7. package/dist/components/MultiSelectSearch/MultiSelectSearch.js +175 -157
  8. package/dist/components/MultiSelectSearch/constants.d.ts +3 -0
  9. package/dist/components/MultiSelectSearch/constants.js +6 -2
  10. package/dist/components/MultiSelectSearch/types.d.ts +4 -0
  11. package/dist/components/MultiSelectSearch/utils.d.ts +1 -0
  12. package/dist/components/MultiSelectSearch/utils.js +19 -14
  13. package/dist/components/RadioGroup/RadioGroup.js +3 -3
  14. package/dist/components/SelectSearch/SelectSearch.js +21 -21
  15. package/dist/components/Slider/Slider.d.ts +21 -8
  16. package/dist/components/Slider/Slider.js +388 -383
  17. package/dist/components/Switcher/Switcher.js +4 -4
  18. package/dist/components/TabTrail/TabTrail.js +4 -4
  19. package/dist/{field-C1kt7aNM.js → field-FJ34aSs4.js} +2 -2
  20. package/dist/{focus-management-BtPpk3D1.js → focus-management-DE4t_lW3.js} +1 -1
  21. package/dist/{hidden-PvGXrYUY.js → hidden-DbgtYPOH.js} +1 -1
  22. package/dist/{keyboard-mgWkd2Vh.js → keyboard-B0lm_zyn.js} +111 -114
  23. package/dist/{label-D4GFpe5F.js → label-y3ANLTNC.js} +2 -2
  24. package/dist/open-closed-CdldUPoq.js +86 -0
  25. package/dist/portal-WDFNoIMz.js +1908 -0
  26. package/dist/{use-active-press-CqLGIFz7.js → use-active-press-86hajhdd.js} +1 -1
  27. package/package.json +1 -1
  28. package/dist/open-closed-D2VjDhAN.js +0 -86
  29. package/dist/portal-DPqg52FR.js +0 -1946
@@ -7,7 +7,7 @@ type TChildrenProps = {
7
7
  };
8
8
  export type TProps = {
9
9
  /** Заголовок аккордеона */
10
- title: string;
10
+ title: string | ReactNode;
11
11
  /** Размер аккордеона */
12
12
  size?: EAccordionSize | `${EAccordionSize}`;
13
13
  /** Преобразование заголовка в верхний регистр */
@@ -7,10 +7,10 @@ import { useMediaQuery as ye } from "../../hooks/useMediaQuery/useMediaQuery.js"
7
7
  import { EMediaQuery as Ee } from "../../hooks/useMediaQuery/constants.js";
8
8
  import { Icon as Se } from "../../icons/Icon.js";
9
9
  import { Link as ke } from "../AnchorLink/Link.js";
10
- import { M as ee, W as q, y as j, T as Ie, o as $, a as W, H as Q, I as ce, $ as be, b as xe, D as te, u as De, c as T } from "../../keyboard-mgWkd2Vh.js";
11
- import { w as he } from "../../use-active-press-CqLGIFz7.js";
10
+ import { M as ee, W as q, y as j, T as Ie, o as $, a as W, H as Q, I as ce, $ as be, b as xe, D as te, u as De, c as T } from "../../keyboard-B0lm_zyn.js";
11
+ import { w as he } from "../../use-active-press-86hajhdd.js";
12
12
  import { e as ve } from "../../use-resolve-button-type-DhFdPxnv.js";
13
- import { c as $e, i as R, u as ge, x as Pe, R as Te, s as we } from "../../open-closed-D2VjDhAN.js";
13
+ import { c as $e, i as R, u as ge, R as Pe, H as Te, s as we } from "../../open-closed-CdldUPoq.js";
14
14
  import { C as Ne } from "../../close-provider-CEutdhG8.js";
15
15
  import { r as Ce } from "../../bugs-diTMAGNw.js";
16
16
  import '../../assets/Accordion.css';var ne;
@@ -1,10 +1,10 @@
1
1
  import { jsxs as L, jsx as p } from "react/jsx-runtime";
2
- import { W as O, p as V, o as d, $ as W, b as X, D as q, H as z, c as D } from "../../keyboard-mgWkd2Vh.js";
2
+ import { W as O, p as V, o as d, $ as W, b as X, D as q, H as z, c as D } from "../../keyboard-B0lm_zyn.js";
3
3
  import h, { useId as J, useState as Q, useMemo as Y, useCallback as Z, forwardRef as ee } from "react";
4
- import { w as re } from "../../use-active-press-CqLGIFz7.js";
5
- import { u as ae, a as oe, b as te, T as ce, I as ne, G as se, j as ie, p as le, K as de } from "../../label-D4GFpe5F.js";
4
+ import { w as re } from "../../use-active-press-86hajhdd.js";
5
+ import { u as ae, a as oe, b as te, T as ce, I as ne, G as se, j as ie, p as le, K as de } from "../../label-y3ANLTNC.js";
6
6
  import { r as be } from "../../bugs-diTMAGNw.js";
7
- import { H as ue } from "../../field-C1kt7aNM.js";
7
+ import { H as ue } from "../../field-FJ34aSs4.js";
8
8
  import { c as me } from "../../index-DIxK0V-G.js";
9
9
  import { Icon as fe } from "../../icons/Icon.js";
10
10
  import '../../assets/CheckboxMimir.css';let pe = "span";
@@ -1,15 +1,15 @@
1
- import { jsx as le, jsxs as Le, Fragment as He } from "react/jsx-runtime";
1
+ import { jsx as le, jsxs as Ae, Fragment as Le } from "react/jsx-runtime";
2
2
  import { c as ae } from "../../index-DIxK0V-G.js";
3
3
  import S, { createContext as te, useState as ne, useContext as oe, useRef as Q, useReducer as Ge, createRef as Pe, useMemo as R, useEffect as se, useId as ie, memo as Ke } from "react";
4
- import { o as E, u as we, M as ce, W as z, y as V, T as Ue, s as Te, a as q, H as re, $ as je, b as qe, D as ye, I as Je, n as We, c as U } from "../../keyboard-mgWkd2Vh.js";
5
- import { w as Xe } from "../../use-active-press-CqLGIFz7.js";
6
- import { n as fe, s as Ze, e as Qe, E as Ve, R as Ye, M as ze, y as et, x as tt, a as nt, b as ot, m as rt, f as lt, d as at, t as ut } from "../../portal-DPqg52FR.js";
4
+ import { o as E, u as we, M as ce, W as z, y as V, T as Ue, s as Te, a as q, H as re, $ as je, b as qe, D as ye, I as Je, n as We, c as U } from "../../keyboard-B0lm_zyn.js";
5
+ import { w as Xe } from "../../use-active-press-86hajhdd.js";
6
+ import { n as fe, s as Ze, e as Qe, E as Ve, R as Ye, v as ze, y as et, x as tt, a as nt, b as ot, m as rt, f as lt, d as at, t as ut } from "../../portal-WDFNoIMz.js";
7
7
  import { e as st } from "../../use-resolve-button-type-DhFdPxnv.js";
8
- import { T as pe, s as de } from "../../hidden-PvGXrYUY.js";
9
- import { c as it, i as Y, u as _e, x as Be, R as Fe, s as ct } from "../../open-closed-D2VjDhAN.js";
8
+ import { T as pe, s as de } from "../../hidden-DbgtYPOH.js";
9
+ import { c as it, i as Y, u as _e, R as Be, H as Fe, s as ct } from "../../open-closed-CdldUPoq.js";
10
10
  import { C as pt } from "../../close-provider-CEutdhG8.js";
11
11
  import { r as ke } from "../../bugs-diTMAGNw.js";
12
- import { b as Se, P as j, F as A, A as dt, h as ft, T as $e } from "../../focus-management-BtPpk3D1.js";
12
+ import { b as Se, P as j, F as H, A as dt, h as ft, T as $e } from "../../focus-management-DE4t_lW3.js";
13
13
  import '../../assets/Dropdown.css';function vt({ defaultContainers: e = [], portals: n, mainTreeNode: s } = {}) {
14
14
  let P = fe(s), i = E(() => {
15
15
  var c, d;
@@ -23,7 +23,7 @@ import '../../assets/Dropdown.css';function vt({ defaultContainers: e = [], port
23
23
  }
24
24
  let Ce = te(null);
25
25
  function xe({ children: e, node: n }) {
26
- let [s, P] = ne(null), i = Me(n ?? s);
26
+ let [s, P] = ne(null), i = Oe(n ?? s);
27
27
  return S.createElement(Ce.Provider, { value: i }, e, i === null && S.createElement(pe, { features: de.Hidden, ref: (c) => {
28
28
  var d, r;
29
29
  if (c) {
@@ -34,12 +34,12 @@ function xe({ children: e, node: n }) {
34
34
  }
35
35
  } }));
36
36
  }
37
- function Me(e = null) {
37
+ function Oe(e = null) {
38
38
  var n;
39
39
  return (n = oe(Ce)) != null ? n : e;
40
40
  }
41
41
  var D = ((e) => (e[e.Forwards = 0] = "Forwards", e[e.Backwards = 1] = "Backwards", e))(D || {});
42
- function Oe() {
42
+ function Me() {
43
43
  let e = Q(0);
44
44
  return Ze(!0, "keydown", (n) => {
45
45
  n.key === "Tab" && (e.current = n.shiftKey ? 1 : 0);
@@ -104,19 +104,19 @@ function ht(e, n) {
104
104
  return (u = x == null ? void 0 : x.isFocusWithinPopoverGroup()) != null ? u : (T == null ? void 0 : T.activeElement) && ((t == null ? void 0 : t.contains(T.activeElement)) || (h == null ? void 0 : h.contains(T.activeElement)));
105
105
  });
106
106
  se(() => w == null ? void 0 : w(W), [w, W]);
107
- let [L, B] = Qe(), H = Me(t), M = vt({ mainTreeNode: H, portals: L, defaultContainers: [t, h] });
107
+ let [A, B] = Qe(), L = Oe(t), O = vt({ mainTreeNode: L, portals: A, defaultContainers: [t, h] });
108
108
  Ve(T == null ? void 0 : T.defaultView, "focus", (u) => {
109
109
  var l, a, m, v, F, _;
110
- u.target !== window && u.target instanceof HTMLElement && y === 0 && (X() || t && h && (M.contains(u.target) || (a = (l = f.current) == null ? void 0 : l.contains) != null && a.call(l, u.target) || (v = (m = b.current) == null ? void 0 : m.contains) != null && v.call(m, u.target) || (_ = (F = p.current) == null ? void 0 : F.contains) != null && _.call(F, u.target) || $({ type: 1 })));
111
- }, !0), Ye(y === 0, M.resolveContainers, (u, l) => {
110
+ u.target !== window && u.target instanceof HTMLElement && y === 0 && (X() || t && h && (O.contains(u.target) || (a = (l = f.current) == null ? void 0 : l.contains) != null && a.call(l, u.target) || (v = (m = b.current) == null ? void 0 : m.contains) != null && v.call(m, u.target) || (_ = (F = p.current) == null ? void 0 : F.contains) != null && _.call(F, u.target) || $({ type: 1 })));
111
+ }, !0), Ye(y === 0, O.resolveContainers, (u, l) => {
112
112
  $({ type: 1 }), dt(l, ft.Loose) || (u.preventDefault(), t == null || t.focus());
113
113
  });
114
- let O = E((u) => {
114
+ let M = E((u) => {
115
115
  $({ type: 1 });
116
116
  let l = u ? u instanceof HTMLElement ? u : "current" in u && u.current instanceof HTMLElement ? u.current : t : t;
117
117
  l == null || l.focus();
118
- }), Z = R(() => ({ close: O, isPortalled: k }), [O, k]), ee = R(() => ({ open: y === 0, close: O }), [y, O]), G = { ref: d };
119
- return S.createElement(xe, { node: H }, S.createElement(ze, null, S.createElement(be.Provider, { value: null }, S.createElement(he.Provider, { value: o }, S.createElement(me.Provider, { value: Z }, S.createElement(pt, { value: O }, S.createElement(it, { value: q(y, { 0: Y.Open, 1: Y.Closed }) }, S.createElement(B, null, re({ ourProps: G, theirProps: i, slot: ee, defaultTag: St, name: "Popover" })))))))));
118
+ }), Z = R(() => ({ close: M, isPortalled: k }), [M, k]), ee = R(() => ({ open: y === 0, close: M }), [y, M]), G = { ref: d };
119
+ return S.createElement(xe, { node: L }, S.createElement(ze, null, S.createElement(be.Provider, { value: null }, S.createElement(he.Provider, { value: o }, S.createElement(me.Provider, { value: Z }, S.createElement(pt, { value: M }, S.createElement(it, { value: q(y, { 0: Y.Open, 1: Y.Closed }) }, S.createElement(B, null, re({ ourProps: G, theirProps: i, slot: ee, defaultTag: St, name: "Popover" })))))))));
120
120
  }
121
121
  let Et = "button";
122
122
  function gt(e, n) {
@@ -163,15 +163,15 @@ function gt(e, n) {
163
163
  ke(l.currentTarget) || i || (f ? (o({ type: 1 }), (a = r.button) == null || a.focus()) : (l.preventDefault(), l.stopPropagation(), r.popoverState === 1 && (I == null || I(r.buttonId)), o({ type: 0 }), (m = r.button) == null || m.focus()));
164
164
  }), W = E((l) => {
165
165
  l.preventDefault(), l.stopPropagation();
166
- }), { isFocusVisible: x, focusProps: w } = je({ autoFocus: c }), { isHovered: X, hoverProps: L } = qe({ isDisabled: i }), { pressed: B, pressProps: H } = Xe({ disabled: i }), M = r.popoverState === 0, O = R(() => ({ open: M, active: B || M, disabled: i, hover: X, focus: x, autofocus: c }), [M, X, x, B, i, c]), Z = st(e, r.button), ee = f ? ye({ ref: $, type: Z, onKeyDown: k, onClick: C, disabled: i || void 0, autoFocus: c }, w, L, H) : ye({ ref: p, id: r.buttonId, type: Z, "aria-expanded": r.popoverState === 0, "aria-controls": r.panel ? r.panelId : void 0, disabled: i || void 0, autoFocus: c, onKeyDown: k, onKeyUp: J, onClick: C, onMouseDown: W }, w, L, H), G = Oe(), u = E(() => {
166
+ }), { isFocusVisible: x, focusProps: w } = je({ autoFocus: c }), { isHovered: X, hoverProps: A } = qe({ isDisabled: i }), { pressed: B, pressProps: L } = Xe({ disabled: i }), O = r.popoverState === 0, M = R(() => ({ open: O, active: B || O, disabled: i, hover: X, focus: x, autofocus: c }), [O, X, x, B, i, c]), Z = st(e, r.button), ee = f ? ye({ ref: $, type: Z, onKeyDown: k, onClick: C, disabled: i || void 0, autoFocus: c }, w, A, L) : ye({ ref: p, id: r.buttonId, type: Z, "aria-expanded": r.popoverState === 0, "aria-controls": r.panel ? r.panelId : void 0, disabled: i || void 0, autoFocus: c, onKeyDown: k, onKeyUp: J, onClick: C, onMouseDown: W }, w, A, L), G = Me(), u = E(() => {
167
167
  let l = r.panel;
168
168
  if (!l) return;
169
169
  function a() {
170
- q(G.current, { [D.Forwards]: () => j(l, A.First), [D.Backwards]: () => j(l, A.Last) }) === $e.Error && j(Se().filter((m) => m.dataset.headlessuiFocusGuard !== "true"), q(G.current, { [D.Forwards]: A.Next, [D.Backwards]: A.Previous }), { relativeTo: r.button });
170
+ q(G.current, { [D.Forwards]: () => j(l, H.First), [D.Backwards]: () => j(l, H.Last) }) === $e.Error && j(Se().filter((m) => m.dataset.headlessuiFocusGuard !== "true"), q(G.current, { [D.Forwards]: H.Next, [D.Backwards]: H.Previous }), { relativeTo: r.button });
171
171
  }
172
172
  a();
173
173
  });
174
- return S.createElement(S.Fragment, null, re({ ourProps: ee, theirProps: d, slot: O, defaultTag: Et, name: "Popover.Button" }), M && !f && y && S.createElement(pe, { id: g, ref: r.afterButtonSentinel, features: de.Focusable, "data-headlessui-focus-guard": !0, as: "button", type: "button", onFocus: u }));
174
+ return S.createElement(S.Fragment, null, re({ ourProps: ee, theirProps: d, slot: M, defaultTag: Et, name: "Popover.Button" }), O && !f && y && S.createElement(pe, { id: g, ref: r.afterButtonSentinel, features: de.Focusable, "data-headlessui-focus-guard": !0, as: "button", type: "button", onFocus: u }));
175
175
  }
176
176
  let It = "div", Tt = ce.RenderStrategy | ce.Static;
177
177
  function Re(e, n) {
@@ -189,13 +189,13 @@ function Bt(e, n) {
189
189
  We(() => (g({ type: 5, panelId: P }), () => {
190
190
  g({ type: 5, panelId: null });
191
191
  }), [P, g]);
192
- let L = _e(), [B, H] = Be(o, C, L !== null ? (L & Y.Open) === Y.Open : t.popoverState === 0);
192
+ let A = _e(), [B, L] = Be(o, C, A !== null ? (A & Y.Open) === Y.Open : t.popoverState === 0);
193
193
  rt(B, t.button, () => {
194
194
  g({ type: 1 });
195
195
  });
196
- let M = t.__demoMode ? !1 : r && B;
197
- lt(M, w);
198
- let O = E((a) => {
196
+ let O = t.__demoMode ? !1 : r && B;
197
+ lt(O, w);
198
+ let M = E((a) => {
199
199
  var m;
200
200
  switch (a.key) {
201
201
  case U.Escape:
@@ -210,19 +210,19 @@ function Bt(e, n) {
210
210
  }, [t.popoverState, e.unmount, e.static, g]), se(() => {
211
211
  if (t.__demoMode || !i || t.popoverState !== 0 || !p.current) return;
212
212
  let a = w == null ? void 0 : w.activeElement;
213
- p.current.contains(a) || j(p.current, A.First);
213
+ p.current.contains(a) || j(p.current, H.First);
214
214
  }, [t.__demoMode, i, p.current, t.popoverState]);
215
- let Z = R(() => ({ open: t.popoverState === 0, close: h }), [t.popoverState, h]), ee = ye($ ? J() : {}, { ref: x, id: P, onKeyDown: O, onBlur: i && t.popoverState === 0 ? (a) => {
215
+ let Z = R(() => ({ open: t.popoverState === 0, close: h }), [t.popoverState, h]), ee = ye($ ? J() : {}, { ref: x, id: P, onKeyDown: M, onBlur: i && t.popoverState === 0 ? (a) => {
216
216
  var m, v, F, _, K;
217
217
  let N = a.relatedTarget;
218
218
  N && p.current && ((m = p.current) != null && m.contains(N) || (g({ type: 1 }), ((F = (v = t.beforePanelSentinel.current) == null ? void 0 : v.contains) != null && F.call(v, N) || (K = (_ = t.afterPanelSentinel.current) == null ? void 0 : _.contains) != null && K.call(_, N)) && N.focus({ preventScroll: !0 })));
219
- } : void 0, tabIndex: -1, style: { ...y.style, ...k, "--button-width": at(t.button, !0).width }, ...Fe(H) }), G = Oe(), u = E(() => {
219
+ } : void 0, tabIndex: -1, style: { ...y.style, ...k, "--button-width": at(t.button, !0).width }, ...Fe(L) }), G = Me(), u = E(() => {
220
220
  let a = p.current;
221
221
  if (!a) return;
222
222
  function m() {
223
223
  q(G.current, { [D.Forwards]: () => {
224
224
  var v;
225
- j(a, A.First) === $e.Error && ((v = t.afterPanelSentinel.current) == null || v.focus());
225
+ j(a, H.First) === $e.Error && ((v = t.afterPanelSentinel.current) == null || v.focus());
226
226
  }, [D.Backwards]: () => {
227
227
  var v;
228
228
  (v = t.button) == null || v.focus({ preventScroll: !0 });
@@ -240,10 +240,10 @@ function Bt(e, n) {
240
240
  let Ie = K.indexOf(N);
241
241
  Ie !== -1 && K.splice(Ie, 1);
242
242
  }
243
- j(K, A.First, { sorted: !1 });
243
+ j(K, H.First, { sorted: !1 });
244
244
  }, [D.Backwards]: () => {
245
245
  var v;
246
- j(a, A.Previous) === $e.Error && ((v = t.button) == null || v.focus());
246
+ j(a, H.Previous) === $e.Error && ((v = t.button) == null || v.focus());
247
247
  } });
248
248
  }
249
249
  m();
@@ -275,7 +275,7 @@ function kt(e, n) {
275
275
  }), t = R(() => ({ registerPopover: r, unregisterPopover: d, isFocusWithinPopoverGroup: o, closeOthers: y }), [r, d, o, y]), g = R(() => ({}), []), h = e, I = { ref: P };
276
276
  return S.createElement(xe, null, S.createElement(ge.Provider, { value: t }, re({ ourProps: I, theirProps: h, slot: g, defaultTag: Ft, name: "Popover.Group" })));
277
277
  }
278
- let Ct = z(ht), De = z(gt), xt = z(Re), Mt = z(Re), Ae = z(Bt), Ot = z(kt), Nt = Object.assign(Ct, { Button: De, Backdrop: Mt, Overlay: xt, Panel: Ae, Group: Ot });
278
+ let Ct = z(ht), De = z(gt), xt = z(Re), Ot = z(Re), He = z(Bt), Mt = z(kt), Nt = Object.assign(Ct, { Button: De, Backdrop: Ot, Overlay: xt, Panel: He, Group: Mt });
279
279
  const Rt = "_menu_1tfih_3", ue = {
280
280
  menu: Rt,
281
281
  "menu-button": "_menu-button_1tfih_6",
@@ -297,7 +297,7 @@ const Rt = "_menu_1tfih_3", ue = {
297
297
  as: "div",
298
298
  className: ae(ue.menu, P),
299
299
  ...s,
300
- children: ({ close: o }) => /* @__PURE__ */ Le(He, { children: [
300
+ children: ({ close: o }) => /* @__PURE__ */ Ae(Le, { children: [
301
301
  /* @__PURE__ */ le(
302
302
  De,
303
303
  {
@@ -307,7 +307,7 @@ const Rt = "_menu_1tfih_3", ue = {
307
307
  }
308
308
  ),
309
309
  /* @__PURE__ */ le(
310
- Ae,
310
+ He,
311
311
  {
312
312
  anchor: n,
313
313
  className: ae(ue["menu-items"], c),
@@ -21,4 +21,5 @@ export declare const MultiSelectSearch: import('react').ForwardRefExoticComponen
21
21
  disableInput?: boolean;
22
22
  autocomplete?: "on" | "off";
23
23
  id?: string;
24
+ autoPlacement?: boolean;
24
25
  } & import('react').RefAttributes<HTMLElement>>;