mimir-ui-kit 1.43.20 → 1.43.21
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.
package/dist/assets/Drawer.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._drawer_pv7po_2{--drawer-width: 808px;--drawer-z-index: 10000;position:fixed;z-index:10000;z-index:var(--drawer-z-index);display:flex;flex-direction:column;width:808px;width:var(--drawer-width);height:100%;overflow:auto;background-color:var(--black-5);transition:all .3s ease;pointer-events:none}._drawer_pv7po_2::-webkit-scrollbar{width:3px}._drawer_pv7po_2::-webkit-scrollbar-thumb{background-color:var(--black-80);border-radius:2px}._drawer_pv7po_2::-webkit-scrollbar-track{background-color:var(--white)}._drawer_pv7po_2 ._content_pv7po_26{position:relative;display:flex;flex:1;flex-direction:column;padding:var(--mimir-space-m) var(--mimir-space-xs) var(--mimir-space-3xs) var(--mimir-space-4xl);overflow:hidden;transition:all .3s ease}@media (max-width: 600px){._drawer_pv7po_2 ._content_pv7po_26{--drawer-width: 100%;padding:var(--mimir-space-m)}}._drawer_pv7po_2 ._header_pv7po_41{display:flex;gap:var(--mimir-space-xs);min-height:68px}._drawer_pv7po_2 ._header_pv7po_41:not(:last-child){margin-bottom:var(--mimir-space-2xl)}._drawer_pv7po_2 ._header_pv7po_41._sticky-header_pv7po_49{position:-webkit-sticky;position:sticky;top:0;left:0;background-color:var(--black-5)}._drawer_pv7po_2 ._header_pv7po_41 ._title_pv7po_55{flex:1;align-self:flex-end;font-weight:var(--mimir-font-weight-text-medium);font-size:var(--mimir-size-text-xl3);line-height:var(--mimir-space-2xxl);letter-spacing:.7px}@media (max-width: 600px){._drawer_pv7po_2 ._header_pv7po_41 ._title_pv7po_55{font-size:var(--mimir-size-text-xl2);line-height:var(--mimir-line-height-text-xs)}}._drawer_pv7po_2 ._header_pv7po_41 ._space_pv7po_69{flex:0 0 var(--button-height-m)}@media (max-width: 600px){._drawer_pv7po_2 ._header_pv7po_41{min-height:55px}._drawer_pv7po_2 ._header_pv7po_41:not(:last-child){margin-bottom:var(--mimir-space-m)}}._drawer_pv7po_2 ._inner_pv7po_80{flex:1;padding-right:var(--mimir-space-xxl);overflow-y:auto}._drawer_pv7po_2 ._inner_pv7po_80._is-loading_pv7po_85{display:flex;flex-direction:column;align-items:center;justify-content:center}._drawer_pv7po_2 ._button_pv7po_91{position:absolute;top:var(--mimir-space-m);right:var(--mimir-space-m)}._drawer_pv7po_2 ._footer_pv7po_96{display:block;padding:var(--mimir-space-2xl) var(--mimir-space-xxl) var(--mimir-space-4xl) var(--mimir-space-xxl)}@media (max-width: 600px){._drawer_pv7po_2 ._footer_pv7po_96{padding:var(--mimir-space-m)}}._drawer_pv7po_2 ._footer_pv7po_96._has-scroll_pv7po_105{box-shadow:var(--mimir-modal-window-bottom-panel-shadow)}._drawer_pv7po_2 ._footer-button_pv7po_108{display:block;margin-left:auto}._drawer_pv7po_2._left_pv7po_112{top:0;left:-100%}._drawer_pv7po_2._right_pv7po_116{top:0;right:-100%}._drawer_pv7po_2._full_pv7po_120{top:0;right:0;bottom:0;left:0;width:100%;height:100%;max-height:100vh;border-radius:0;transform:scale(.95);opacity:0;transition:transform .3s ease-in-out,opacity .3s ease-in-out}._drawer_pv7po_2._bottom_pv7po_130{--drawer-width: calc(100% - var(--mimir-space-m));right:50%;bottom:-100%;left:50%;height:-webkit-max-content;height:-moz-max-content;height:max-content;max-height:calc(100% - var(--mimir-space-xs));border-top-left-radius:var(--mimir-control-radius);border-top-right-radius:var(--mimir-control-radius);transform:translate(-50%)}._drawer_pv7po_2._bottom_pv7po_130._full-bottom-height_pv7po_141{height:calc(100% - var(--mimir-space-xs))}._drawer_pv7po_2._bottom_pv7po_130._is-loading_pv7po_85{height:50vh}._drawer_pv7po_2._opened_pv7po_147{transition:all .3s ease;pointer-events:auto}._drawer_pv7po_2._opened_pv7po_147._left_pv7po_112{left:0%;transition:left .3s ease}._drawer_pv7po_2._opened_pv7po_147._right_pv7po_116{right:0%;transition:right .3s ease}._drawer_pv7po_2._opened_pv7po_147._bottom_pv7po_130{bottom:0%}._drawer_pv7po_2._opened_pv7po_147._full_pv7po_120{transform:scale(1);opacity:1}._drawer_pv7po_2._is-closing_pv7po_166._left_pv7po_112{left:-100%}._drawer_pv7po_2._is-closing_pv7po_166._right_pv7po_116{right:-100%}._drawer_pv7po_2._is-closing_pv7po_166._bottom_pv7po_130{bottom:-100%}._drawer_pv7po_2._is-closing_pv7po_166._full_pv7po_120{transform:scale(.95);opacity:0}@media (max-width: 1440px){._drawer_pv7po_2{--drawer-width: 608px}}@media (max-width: 1280px){._drawer_pv7po_2{--drawer-width: 648px}}@media (max-width: 768px){._drawer_pv7po_2{--drawer-width: 584px}}@media (max-width: 600px){._drawer_pv7po_2{--drawer-width: 100%}._drawer_pv7po_2._bottom_pv7po_130{--drawer-width: calc(100% - var(--mimir-space-m))}}._overlay_pv7po_203{--overlay-z-index: 9990;position:fixed;top:0;left:0;z-index:9990;z-index:var(--overlay-z-index);width:100%;height:100%;background-color:#0009;opacity:0;transition:all .3s ease}._overlay_pv7po_203._opened_pv7po_147{opacity:1;transition:all .3s ease}._overlay_pv7po_203._opened_pv7po_147._unmount_pv7po_219{z-index:var(--overlay-z-index);-webkit-appearance:none;-moz-appearance:none;appearance:none}._overlay_pv7po_203._is-closing_pv7po_166{opacity:0;transition:all .3s ease}._overlay_pv7po_203._unmount_pv7po_219{z-index:-1;-webkit-appearance:none;-moz-appearance:none;appearance:none}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { jsxs as a, Fragment as
|
|
1
|
+
import { jsxs as a, Fragment as te, jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import { c as n } from "../../index-DIxK0V-G.js";
|
|
3
|
-
import { forwardRef as ne, useState as
|
|
3
|
+
import { forwardRef as ne, useState as v, useRef as L, useEffect as M, useCallback as g } from "react";
|
|
4
4
|
import { EDrawerPosition as R } from "./constants.js";
|
|
5
5
|
import { useContainer as re } from "./hooks.js";
|
|
6
6
|
import { ScrollWrapper as se } from "./ScrollWrapper/index.js";
|
|
@@ -9,33 +9,33 @@ import { EMediaQuery as le } from "../../hooks/useMediaQuery/constants.js";
|
|
|
9
9
|
import { useLockBodyScroll as ae } from "../../hooks/useLockBodyScroll/useLockBodyScroll.js";
|
|
10
10
|
import { useResizeObserver as ce } from "../../hooks/useResizeObserver/useResizeObserver.js";
|
|
11
11
|
import { Button as H } from "../Button/Button.js";
|
|
12
|
-
import { EButtonVariantDefault as
|
|
13
|
-
import { Loader as
|
|
14
|
-
import { Portal as
|
|
15
|
-
import { EScrollBarVariant as
|
|
16
|
-
import '../../assets/Drawer.css';const
|
|
17
|
-
drawer:
|
|
18
|
-
content:
|
|
19
|
-
|
|
20
|
-
header:
|
|
21
|
-
"sticky-header": "_sticky-header_14uzm_53",
|
|
12
|
+
import { EButtonVariantDefault as pe, EButtonSize as c } from "../Button/constants.js";
|
|
13
|
+
import { Loader as de } from "../Loader/Loader.js";
|
|
14
|
+
import { Portal as ue } from "../Portal/Portal.js";
|
|
15
|
+
import { EScrollBarVariant as me, EScrollBarSize as fe } from "../ScrollBar/constants.js";
|
|
16
|
+
import '../../assets/Drawer.css';const _e = "_drawer_pv7po_2", he = "_content_pv7po_26", ve = "_header_pv7po_41", ge = "_title_pv7po_55", ye = "_space_pv7po_69", be = "_inner_pv7po_80", Ce = "_button_pv7po_91", we = "_footer_pv7po_96", Ne = "_left_pv7po_112", ke = "_right_pv7po_116", Se = "_full_pv7po_120", Be = "_bottom_pv7po_130", Ee = "_opened_pv7po_147", ze = "_overlay_pv7po_203", Ie = "_unmount_pv7po_219", e = {
|
|
17
|
+
drawer: _e,
|
|
18
|
+
content: he,
|
|
19
|
+
header: ve,
|
|
20
|
+
"sticky-header": "_sticky-header_pv7po_49",
|
|
22
21
|
title: ge,
|
|
23
22
|
space: ye,
|
|
24
|
-
inner:
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
"
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
23
|
+
inner: be,
|
|
24
|
+
"is-loading": "_is-loading_pv7po_85",
|
|
25
|
+
button: Ce,
|
|
26
|
+
footer: we,
|
|
27
|
+
"has-scroll": "_has-scroll_pv7po_105",
|
|
28
|
+
"footer-button": "_footer-button_pv7po_108",
|
|
29
|
+
left: Ne,
|
|
30
|
+
right: ke,
|
|
31
|
+
full: Se,
|
|
32
|
+
bottom: Be,
|
|
33
|
+
"full-bottom-height": "_full-bottom-height_pv7po_141",
|
|
34
|
+
opened: Ee,
|
|
35
|
+
"is-closing": "_is-closing_pv7po_166",
|
|
36
|
+
overlay: ze,
|
|
37
37
|
unmount: Ie
|
|
38
|
-
}, Oe = 300, Le = (
|
|
38
|
+
}, Oe = 300, Le = (p) => p ? {
|
|
39
39
|
drawer: {
|
|
40
40
|
position: "absolute",
|
|
41
41
|
zIndex: 100
|
|
@@ -45,38 +45,38 @@ import '../../assets/Drawer.css';const he = "_drawer_14uzm_2", pe = "_content_14
|
|
|
45
45
|
zIndex: 90
|
|
46
46
|
}
|
|
47
47
|
} : {}, Ye = ne(
|
|
48
|
-
(
|
|
48
|
+
(p, T) => {
|
|
49
49
|
const {
|
|
50
50
|
as: x = "div",
|
|
51
51
|
isOpen: r,
|
|
52
|
-
onClose:
|
|
52
|
+
onClose: d,
|
|
53
53
|
title: D,
|
|
54
54
|
className: A,
|
|
55
55
|
unmount: y = !0,
|
|
56
56
|
isLoading: s = !1,
|
|
57
57
|
stickyHeader: P,
|
|
58
58
|
fullBottomHeight: X = !1,
|
|
59
|
-
position:
|
|
59
|
+
position: u = R.RIGHT,
|
|
60
60
|
paddingRight: j = 8,
|
|
61
|
-
footer:
|
|
61
|
+
footer: m,
|
|
62
62
|
children: F,
|
|
63
63
|
classNameTitle: G,
|
|
64
64
|
classNameHeader: Q,
|
|
65
65
|
classNameInner: V,
|
|
66
66
|
classNameContent: W,
|
|
67
67
|
classNameFooter: K,
|
|
68
|
-
closeOnClickOutside:
|
|
69
|
-
showCloseButton:
|
|
70
|
-
getContainer:
|
|
68
|
+
closeOnClickOutside: b = !0,
|
|
69
|
+
showCloseButton: C = !0,
|
|
70
|
+
getContainer: f,
|
|
71
71
|
...Y
|
|
72
|
-
} =
|
|
73
|
-
enabled:
|
|
74
|
-
}),
|
|
72
|
+
} = p, [w, N] = v(!1), [q, k] = v(!1), S = L(), _ = ie(le.XS1), { ref: J } = ce({
|
|
73
|
+
enabled: u === R.BOTTOM
|
|
74
|
+
}), B = re(f), i = L(null), [U, Z] = v(!1);
|
|
75
75
|
M(() => {
|
|
76
76
|
const l = () => {
|
|
77
77
|
if (i.current) {
|
|
78
|
-
const { scrollHeight: ee, clientHeight:
|
|
79
|
-
Z(ee >
|
|
78
|
+
const { scrollHeight: ee, clientHeight: oe } = i.current;
|
|
79
|
+
Z(ee > oe);
|
|
80
80
|
}
|
|
81
81
|
};
|
|
82
82
|
l();
|
|
@@ -85,41 +85,41 @@ import '../../assets/Drawer.css';const he = "_drawer_14uzm_2", pe = "_content_14
|
|
|
85
85
|
O.disconnect();
|
|
86
86
|
};
|
|
87
87
|
}, [r, s]), ae({
|
|
88
|
-
on: r && !
|
|
88
|
+
on: r && !w,
|
|
89
89
|
paddingRight: j
|
|
90
90
|
});
|
|
91
|
-
const
|
|
92
|
-
|
|
93
|
-
|
|
91
|
+
const t = g(() => {
|
|
92
|
+
d && (N(!0), S.current = setTimeout(() => {
|
|
93
|
+
d(), N(!1);
|
|
94
94
|
}, Oe));
|
|
95
|
-
}, [
|
|
96
|
-
|
|
97
|
-
}, [
|
|
95
|
+
}, [d]), $ = g(() => {
|
|
96
|
+
b && t();
|
|
97
|
+
}, [b, t]), h = g(
|
|
98
98
|
(l) => {
|
|
99
|
-
l.key === "Escape" &&
|
|
99
|
+
l.key === "Escape" && t();
|
|
100
100
|
},
|
|
101
|
-
[
|
|
101
|
+
[t]
|
|
102
102
|
);
|
|
103
|
-
M(() => (r && (
|
|
104
|
-
|
|
105
|
-
}), [r,
|
|
106
|
-
const
|
|
103
|
+
M(() => (r && (k(!0), window.addEventListener("keydown", h)), () => {
|
|
104
|
+
k(!1), clearTimeout(S.current), window.removeEventListener("keydown", h);
|
|
105
|
+
}), [r, h]);
|
|
106
|
+
const E = {
|
|
107
107
|
[e.opened]: q,
|
|
108
|
-
[e["is-closing"]]:
|
|
108
|
+
[e["is-closing"]]: w,
|
|
109
109
|
[e["full-bottom-height"]]: X,
|
|
110
110
|
[e["is-loading"]]: s
|
|
111
111
|
};
|
|
112
112
|
if (!r && y)
|
|
113
113
|
return null;
|
|
114
|
-
const
|
|
114
|
+
const z = Le(f !== void 0 && f !== !1), I = /* @__PURE__ */ a(te, { children: [
|
|
115
115
|
/* @__PURE__ */ a(
|
|
116
116
|
x,
|
|
117
117
|
{
|
|
118
118
|
ref: T,
|
|
119
119
|
"aria-hidden": !r,
|
|
120
120
|
role: "dialog",
|
|
121
|
-
style:
|
|
122
|
-
className: n(e.drawer, e[
|
|
121
|
+
style: z.drawer,
|
|
122
|
+
className: n(e.drawer, e[u], E, A),
|
|
123
123
|
...Y,
|
|
124
124
|
children: [
|
|
125
125
|
/* @__PURE__ */ a(
|
|
@@ -129,7 +129,7 @@ import '../../assets/Drawer.css';const he = "_drawer_14uzm_2", pe = "_content_14
|
|
|
129
129
|
className: n(
|
|
130
130
|
e.content,
|
|
131
131
|
W,
|
|
132
|
-
e[
|
|
132
|
+
e[u],
|
|
133
133
|
{
|
|
134
134
|
[e["is-loading"]]: !!s
|
|
135
135
|
}
|
|
@@ -142,22 +142,22 @@ import '../../assets/Drawer.css';const he = "_drawer_14uzm_2", pe = "_content_14
|
|
|
142
142
|
[e["sticky-header"]]: P
|
|
143
143
|
}),
|
|
144
144
|
children: [
|
|
145
|
-
/* @__PURE__ */
|
|
146
|
-
/* @__PURE__ */
|
|
145
|
+
/* @__PURE__ */ o("h2", { className: n(e.title, G), children: D }),
|
|
146
|
+
/* @__PURE__ */ o("div", { className: e.space, children: C && /* @__PURE__ */ o(
|
|
147
147
|
H,
|
|
148
148
|
{
|
|
149
|
-
variant:
|
|
149
|
+
variant: pe.SecondaryWhite,
|
|
150
150
|
isIconButton: !0,
|
|
151
|
-
size:
|
|
151
|
+
size: _ ? c.S : c.M,
|
|
152
152
|
iconName: "Close16px",
|
|
153
|
-
onClick:
|
|
153
|
+
onClick: t,
|
|
154
154
|
className: e.button
|
|
155
155
|
}
|
|
156
156
|
) })
|
|
157
157
|
]
|
|
158
158
|
}
|
|
159
159
|
),
|
|
160
|
-
/* @__PURE__ */
|
|
160
|
+
/* @__PURE__ */ o(
|
|
161
161
|
se,
|
|
162
162
|
{
|
|
163
163
|
ref: i,
|
|
@@ -168,26 +168,26 @@ import '../../assets/Drawer.css';const he = "_drawer_14uzm_2", pe = "_content_14
|
|
|
168
168
|
},
|
|
169
169
|
V
|
|
170
170
|
),
|
|
171
|
-
variant:
|
|
172
|
-
size:
|
|
173
|
-
children: s ? /* @__PURE__ */
|
|
171
|
+
variant: me.LIGHT,
|
|
172
|
+
size: fe.M,
|
|
173
|
+
children: s ? /* @__PURE__ */ o(de, {}) : F
|
|
174
174
|
}
|
|
175
175
|
)
|
|
176
176
|
]
|
|
177
177
|
}
|
|
178
178
|
),
|
|
179
|
-
/* @__PURE__ */
|
|
179
|
+
/* @__PURE__ */ o(
|
|
180
180
|
"footer",
|
|
181
181
|
{
|
|
182
182
|
className: n(e.footer, K, {
|
|
183
183
|
[e["has-scroll"]]: U
|
|
184
184
|
}),
|
|
185
|
-
children: typeof
|
|
185
|
+
children: typeof m == "function" ? m({ handleClose: t }) : m || C && /* @__PURE__ */ o(
|
|
186
186
|
H,
|
|
187
187
|
{
|
|
188
|
-
size:
|
|
189
|
-
full:
|
|
190
|
-
onClick:
|
|
188
|
+
size: _ ? c.L : c.XXL,
|
|
189
|
+
full: _,
|
|
190
|
+
onClick: t,
|
|
191
191
|
className: e["footer-button"],
|
|
192
192
|
children: "Закрыть"
|
|
193
193
|
}
|
|
@@ -197,7 +197,7 @@ import '../../assets/Drawer.css';const he = "_drawer_14uzm_2", pe = "_content_14
|
|
|
197
197
|
]
|
|
198
198
|
}
|
|
199
199
|
),
|
|
200
|
-
/* @__PURE__ */
|
|
200
|
+
/* @__PURE__ */ o(
|
|
201
201
|
"div",
|
|
202
202
|
{
|
|
203
203
|
className: n(
|
|
@@ -205,15 +205,15 @@ import '../../assets/Drawer.css';const he = "_drawer_14uzm_2", pe = "_content_14
|
|
|
205
205
|
{
|
|
206
206
|
[e.unmount]: !y
|
|
207
207
|
},
|
|
208
|
-
|
|
208
|
+
E
|
|
209
209
|
),
|
|
210
|
-
style:
|
|
210
|
+
style: z.overlay,
|
|
211
211
|
"data-testid": "drawer-overlay",
|
|
212
212
|
onClick: $
|
|
213
213
|
}
|
|
214
214
|
)
|
|
215
215
|
] });
|
|
216
|
-
return
|
|
216
|
+
return B === !1 ? I : /* @__PURE__ */ o(ue, { element: B, children: I });
|
|
217
217
|
}
|
|
218
218
|
);
|
|
219
219
|
export {
|