mimir-ui-kit 1.36.10 → 1.36.11

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,97 +1,97 @@
1
- import { jsxs as m, jsx as t, Fragment as P } from "react/jsx-runtime";
1
+ import { jsxs as m, jsx as t, Fragment as X } from "react/jsx-runtime";
2
2
  import { c as s } from "../../index-DIxK0V-G.js";
3
- import { useState as u, useRef as Q, useCallback as f, useEffect as F } from "react";
4
- import { EDrawerPosition as k } from "./constants.js";
5
- import { useMediaQuery as G } from "../../hooks/useMediaQuery/useMediaQuery.js";
6
- import { EMediaQuery as H } from "../../hooks/useMediaQuery/constants.js";
7
- import { useLockBodyScroll as K } from "../../hooks/useLockBodyScroll/useLockBodyScroll.js";
8
- import { useResizeObserver as V } from "../../hooks/useResizeObserver/useResizeObserver.js";
9
- import { Button as w } from "../Button/Button.js";
10
- import { EButtonVariantDefault as W, EButtonSize as n } from "../Button/constants.js";
11
- import { Loader as Y } from "../Loader/Loader.js";
12
- import { Portal as q } from "../Portal/Portal.js";
13
- import '../../assets/Drawer.css';const J = "_drawer_1xs4d_3", O = "_content_1xs4d_27", U = "_header_1xs4d_45", Z = "_title_1xs4d_59", $ = "_space_1xs4d_73", ee = "_inner_1xs4d_84", te = "_button_1xs4d_87", oe = "_footer_1xs4d_92", se = "_left_1xs4d_105", re = "_right_1xs4d_109", ne = "_full_1xs4d_113", le = "_bottom_1xs4d_123", ae = "_opened_1xs4d_140", ie = "_overlay_1xs4d_196", ce = "_unmount_1xs4d_212", e = {
14
- drawer: J,
15
- content: O,
3
+ import { useState as N, useRef as j, useCallback as u, useEffect as P } from "react";
4
+ import { EDrawerPosition as w } from "./constants.js";
5
+ import { useMediaQuery as Q } from "../../hooks/useMediaQuery/useMediaQuery.js";
6
+ import { EMediaQuery as F } from "../../hooks/useMediaQuery/constants.js";
7
+ import { useLockBodyScroll as G } from "../../hooks/useLockBodyScroll/useLockBodyScroll.js";
8
+ import { useResizeObserver as H } from "../../hooks/useResizeObserver/useResizeObserver.js";
9
+ import { Button as k } from "../Button/Button.js";
10
+ import { EButtonVariantDefault as K, EButtonSize as n } from "../Button/constants.js";
11
+ import { Loader as V } from "../Loader/Loader.js";
12
+ import { Portal as W } from "../Portal/Portal.js";
13
+ import '../../assets/Drawer.css';const Y = "_drawer_1xs4d_3", q = "_content_1xs4d_27", J = "_header_1xs4d_45", U = "_title_1xs4d_59", Z = "_space_1xs4d_73", $ = "_inner_1xs4d_84", O = "_button_1xs4d_87", ee = "_footer_1xs4d_92", te = "_left_1xs4d_105", oe = "_right_1xs4d_109", se = "_full_1xs4d_113", re = "_bottom_1xs4d_123", ne = "_opened_1xs4d_140", ae = "_overlay_1xs4d_196", ie = "_unmount_1xs4d_212", e = {
14
+ drawer: Y,
15
+ content: q,
16
16
  "is-loading": "_is-loading_1xs4d_41",
17
- header: U,
17
+ header: J,
18
18
  "sticky-header": "_sticky-header_1xs4d_53",
19
- title: Z,
20
- space: $,
21
- inner: ee,
22
- button: te,
23
- footer: oe,
19
+ title: U,
20
+ space: Z,
21
+ inner: $,
22
+ button: O,
23
+ footer: ee,
24
24
  "footer-button": "_footer-button_1xs4d_101",
25
- left: se,
26
- right: re,
27
- full: ne,
28
- bottom: le,
25
+ left: te,
26
+ right: oe,
27
+ full: se,
28
+ bottom: re,
29
29
  "full-bottom-height": "_full-bottom-height_1xs4d_134",
30
- opened: ae,
30
+ opened: ne,
31
31
  "is-closing": "_is-closing_1xs4d_159",
32
- overlay: ie,
33
- unmount: ce
34
- }, de = 300, ke = ({
32
+ overlay: ae,
33
+ unmount: ie
34
+ }, le = 300, ve = ({
35
35
  isOpen: r,
36
- onClose: l,
36
+ onClose: a,
37
37
  title: E,
38
38
  className: M,
39
- unmount: h = !0,
40
- isLoading: a = !1,
39
+ unmount: f = !0,
40
+ isLoading: i = !1,
41
41
  stickyHeader: B,
42
- fullBottomHeight: S = !1,
43
- position: i = k.RIGHT,
44
- paddingRight: I = 8,
42
+ fullBottomHeight: I = !1,
43
+ position: l = w.RIGHT,
44
+ paddingRight: S = 8,
45
45
  footer: c,
46
- children: L,
47
- classNameInner: T,
48
- classNameFooter: C,
49
- closeOnClickOutside: x = !0,
50
- showCloseButton: y = !0
46
+ children: T,
47
+ classNameInner: C,
48
+ classNameFooter: D,
49
+ closeOnClickOutside: h = !0,
50
+ showCloseButton: x = !0
51
51
  }) => {
52
- const [D, p] = u(!1), [z, b] = u(!1), [R, g] = u(!1), v = Q(), d = G(H.XS1), { ref: A } = V({
53
- enabled: i === k.BOTTOM
52
+ const [p, y] = N(!1), [z, b] = N(!1), g = j(), d = Q(F.XS1), { ref: L } = H({
53
+ enabled: l === w.BOTTOM
54
54
  });
55
- K({
56
- on: R,
57
- paddingRight: I
55
+ G({
56
+ on: r && !p,
57
+ paddingRight: S
58
58
  });
59
- const o = f(() => {
60
- l && (p(!0), g(!1), v.current = setTimeout(() => {
61
- l(), p(!1);
62
- }, de));
63
- }, [l]), X = f(() => {
64
- x && o();
65
- }, [x, o]), _ = f(
66
- (j) => {
67
- j.key === "Escape" && o();
59
+ const o = u(() => {
60
+ a && (y(!0), g.current = setTimeout(() => {
61
+ a(), y(!1);
62
+ }, le));
63
+ }, [a]), R = u(() => {
64
+ h && o();
65
+ }, [h, o]), _ = u(
66
+ (A) => {
67
+ A.key === "Escape" && o();
68
68
  },
69
69
  [o]
70
70
  );
71
- F(() => (r && (g(!0), b(!0), window.addEventListener("keydown", _)), () => {
72
- b(!1), clearTimeout(v.current), window.removeEventListener("keydown", _);
71
+ P(() => (r && (b(!0), window.addEventListener("keydown", _)), () => {
72
+ b(!1), clearTimeout(g.current), window.removeEventListener("keydown", _);
73
73
  }), [r, _]);
74
- const N = {
74
+ const v = {
75
75
  [e.opened]: z,
76
- [e["is-closing"]]: D,
77
- [e["full-bottom-height"]]: S,
78
- [e["is-loading"]]: a
76
+ [e["is-closing"]]: p,
77
+ [e["full-bottom-height"]]: I,
78
+ [e["is-loading"]]: i
79
79
  };
80
- return !r && h ? null : /* @__PURE__ */ m(q, { children: [
80
+ return !r && f ? null : /* @__PURE__ */ m(W, { children: [
81
81
  /* @__PURE__ */ t(
82
82
  "div",
83
83
  {
84
84
  "aria-hidden": !r,
85
85
  role: "dialog",
86
- className: s(e.drawer, e[i], N, M),
86
+ className: s(e.drawer, e[l], v, M),
87
87
  children: /* @__PURE__ */ t(
88
88
  "section",
89
89
  {
90
- ref: A,
91
- className: s(e.content, e[i], {
92
- [e["is-loading"]]: !!a
90
+ ref: L,
91
+ className: s(e.content, e[l], {
92
+ [e["is-loading"]]: !!i
93
93
  }),
94
- children: a ? /* @__PURE__ */ t(Y, {}) : /* @__PURE__ */ m(P, { children: [
94
+ children: i ? /* @__PURE__ */ t(V, {}) : /* @__PURE__ */ m(X, { children: [
95
95
  /* @__PURE__ */ m(
96
96
  "header",
97
97
  {
@@ -100,10 +100,10 @@ import '../../assets/Drawer.css';const J = "_drawer_1xs4d_3", O = "_content_1xs4
100
100
  }),
101
101
  children: [
102
102
  /* @__PURE__ */ t("h2", { className: e.title, children: E }),
103
- /* @__PURE__ */ t("div", { className: e.space, children: y && /* @__PURE__ */ t(
104
- w,
103
+ /* @__PURE__ */ t("div", { className: e.space, children: x && /* @__PURE__ */ t(
104
+ k,
105
105
  {
106
- variant: W.SecondaryWhite,
106
+ variant: K.SecondaryWhite,
107
107
  isIconButton: !0,
108
108
  size: d ? n.S : n.M,
109
109
  iconName: "Close16px",
@@ -114,9 +114,9 @@ import '../../assets/Drawer.css';const J = "_drawer_1xs4d_3", O = "_content_1xs4
114
114
  ]
115
115
  }
116
116
  ),
117
- /* @__PURE__ */ t("div", { className: s(e.inner, T), children: L }),
118
- /* @__PURE__ */ t("footer", { className: s(e.footer, C), children: typeof c == "function" ? c({ handleClose: o }) : c || y && /* @__PURE__ */ t(
119
- w,
117
+ /* @__PURE__ */ t("div", { className: s(e.inner, C), children: T }),
118
+ /* @__PURE__ */ t("footer", { className: s(e.footer, D), children: typeof c == "function" ? c({ handleClose: o }) : c || x && /* @__PURE__ */ t(
119
+ k,
120
120
  {
121
121
  size: d ? n.M : n.XXL,
122
122
  full: d,
@@ -136,17 +136,17 @@ import '../../assets/Drawer.css';const J = "_drawer_1xs4d_3", O = "_content_1xs4
136
136
  className: s(
137
137
  e.overlay,
138
138
  {
139
- [e.unmount]: !h
139
+ [e.unmount]: !f
140
140
  },
141
- N
141
+ v
142
142
  ),
143
143
  "data-testid": "drawer-overlay",
144
- onClick: X
144
+ onClick: R
145
145
  }
146
146
  )
147
147
  ] });
148
148
  };
149
149
  export {
150
- de as ANIMATION_DELAY,
151
- ke as Drawer
150
+ le as ANIMATION_DELAY,
151
+ ve as Drawer
152
152
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mimir-ui-kit",
3
3
  "private": false,
4
- "version": "1.36.10",
4
+ "version": "1.36.11",
5
5
  "type": "module",
6
6
  "exports": {
7
7
  ".": {