mimir-ui-kit 1.43.22 → 1.43.26
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
|
+
._drawerContainer_yzb8n_2{position:fixed;z-index:1000000}._drawer_yzb8n_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_yzb8n_2::-webkit-scrollbar{width:3px}._drawer_yzb8n_2::-webkit-scrollbar-thumb{background-color:var(--black-80);border-radius:2px}._drawer_yzb8n_2::-webkit-scrollbar-track{background-color:var(--white)}._drawer_yzb8n_2 ._content_yzb8n_31{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_yzb8n_2 ._content_yzb8n_31{--drawer-width: 100%;padding:var(--mimir-space-m)}}._drawer_yzb8n_2 ._header_yzb8n_46{display:flex;gap:var(--mimir-space-xs);min-height:68px}._drawer_yzb8n_2 ._header_yzb8n_46:not(:last-child){margin-bottom:var(--mimir-space-2xl)}._drawer_yzb8n_2 ._header_yzb8n_46._sticky-header_yzb8n_54{position:-webkit-sticky;position:sticky;top:0;left:0;background-color:var(--black-5)}._drawer_yzb8n_2 ._header_yzb8n_46 ._title_yzb8n_60{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_yzb8n_2 ._header_yzb8n_46 ._title_yzb8n_60{font-size:var(--mimir-size-text-xl2);line-height:var(--mimir-line-height-text-xs)}}._drawer_yzb8n_2 ._header_yzb8n_46 ._space_yzb8n_74{flex:0 0 var(--button-height-m)}@media (max-width: 600px){._drawer_yzb8n_2 ._header_yzb8n_46{min-height:55px}._drawer_yzb8n_2 ._header_yzb8n_46:not(:last-child){margin-bottom:var(--mimir-space-m)}}._drawer_yzb8n_2 ._inner_yzb8n_85{flex:1;padding-right:var(--mimir-space-xxl);overflow-y:auto}._drawer_yzb8n_2 ._inner_yzb8n_85._is-loading_yzb8n_90{display:flex;flex-direction:column;align-items:center;justify-content:center}@media (max-width: 600px){._drawer_yzb8n_2 ._inner_yzb8n_85{padding-right:0}}._drawer_yzb8n_2 ._button_yzb8n_101{position:absolute;top:var(--mimir-space-m);right:var(--mimir-space-m)}._drawer_yzb8n_2 ._footer_yzb8n_106{display:block;padding:var(--mimir-space-2xl) var(--mimir-space-xxl) var(--mimir-space-4xl) var(--mimir-space-xxl)}@media (max-width: 600px){._drawer_yzb8n_2 ._footer_yzb8n_106{padding:var(--mimir-space-m)}}._drawer_yzb8n_2 ._footer_yzb8n_106._has-scroll_yzb8n_115{box-shadow:var(--mimir-modal-window-bottom-panel-shadow)}._drawer_yzb8n_2 ._footer-button_yzb8n_118{display:block;margin-left:auto}._drawer_yzb8n_2._left_yzb8n_122{top:0;left:-100%}._drawer_yzb8n_2._right_yzb8n_126{top:0;right:-100%}._drawer_yzb8n_2._full_yzb8n_130{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_yzb8n_2._bottom_yzb8n_140{--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_yzb8n_2._bottom_yzb8n_140._full-bottom-height_yzb8n_151{height:calc(100% - var(--mimir-space-xs))}._drawer_yzb8n_2._bottom_yzb8n_140._is-loading_yzb8n_90{height:50vh}._drawer_yzb8n_2._opened_yzb8n_157{transition:all .3s ease;pointer-events:auto}._drawer_yzb8n_2._opened_yzb8n_157._left_yzb8n_122{left:0%;transition:left .3s ease}._drawer_yzb8n_2._opened_yzb8n_157._right_yzb8n_126{right:0%;transition:right .3s ease}._drawer_yzb8n_2._opened_yzb8n_157._bottom_yzb8n_140{bottom:0%}._drawer_yzb8n_2._opened_yzb8n_157._full_yzb8n_130{transform:scale(1);opacity:1}._drawer_yzb8n_2._is-closing_yzb8n_176._left_yzb8n_122{left:-100%}._drawer_yzb8n_2._is-closing_yzb8n_176._right_yzb8n_126{right:-100%}._drawer_yzb8n_2._is-closing_yzb8n_176._bottom_yzb8n_140{bottom:-100%}._drawer_yzb8n_2._is-closing_yzb8n_176._full_yzb8n_130{transform:scale(.95);opacity:0}@media (max-width: 1440px){._drawer_yzb8n_2{--drawer-width: 608px}}@media (max-width: 1280px){._drawer_yzb8n_2{--drawer-width: 648px}}@media (max-width: 768px){._drawer_yzb8n_2{--drawer-width: 584px}}@media (max-width: 600px){._drawer_yzb8n_2{--drawer-width: 100%}._drawer_yzb8n_2._bottom_yzb8n_140{--drawer-width: calc(100% - var(--mimir-space-m))}}._overlay_yzb8n_213{--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_yzb8n_213._opened_yzb8n_157{opacity:1;transition:all .3s ease}._overlay_yzb8n_213._opened_yzb8n_157._unmount_yzb8n_229{z-index:var(--overlay-z-index);-webkit-appearance:none;-moz-appearance:none;appearance:none}._overlay_yzb8n_213._is-closing_yzb8n_176{opacity:0;transition:all .3s ease}._overlay_yzb8n_213._unmount_yzb8n_229{z-index:-1;-webkit-appearance:none;-moz-appearance:none;appearance:none}
|
@@ -70,6 +70,10 @@ type TProps = {
|
|
70
70
|
* Дополнительный класс для footer.
|
71
71
|
*/
|
72
72
|
classNameFooter?: string;
|
73
|
+
/**
|
74
|
+
* Дополнительный класс для drawerContainer.
|
75
|
+
*/
|
76
|
+
classNameDrawerContainer?: string;
|
73
77
|
/**
|
74
78
|
* Флаг, определяющий, закрывать ли Drawer при клике вне его области
|
75
79
|
*/
|
@@ -1,41 +1,42 @@
|
|
1
|
-
import { jsxs as l,
|
2
|
-
import { c as
|
3
|
-
import { forwardRef as ne, useState as
|
1
|
+
import { jsxs as l, jsx as o } from "react/jsx-runtime";
|
2
|
+
import { c as t } from "../../index-DIxK0V-G.js";
|
3
|
+
import { forwardRef as ne, useState as b, useRef as L, useEffect as M, useCallback as p } 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";
|
7
7
|
import { useMediaQuery as ie } from "../../hooks/useMediaQuery/useMediaQuery.js";
|
8
|
-
import { EMediaQuery as
|
8
|
+
import { EMediaQuery as ae } from "../../hooks/useMediaQuery/constants.js";
|
9
9
|
import { useLockBodyScroll as le } from "../../hooks/useLockBodyScroll/useLockBodyScroll.js";
|
10
|
-
import { useResizeObserver as
|
10
|
+
import { useResizeObserver as ce } from "../../hooks/useResizeObserver/useResizeObserver.js";
|
11
11
|
import { Button as H } from "../Button/Button.js";
|
12
|
-
import { EButtonVariantDefault as de, EButtonSize as
|
12
|
+
import { EButtonVariantDefault as de, EButtonSize as c } from "../Button/constants.js";
|
13
13
|
import { Loader as ue } from "../Loader/Loader.js";
|
14
14
|
import { Portal as me } from "../Portal/Portal.js";
|
15
|
-
import { EScrollBarVariant as fe, EScrollBarSize as
|
16
|
-
import '../../assets/Drawer.css';const
|
17
|
-
|
15
|
+
import { EScrollBarVariant as fe, EScrollBarSize as _e } from "../ScrollBar/constants.js";
|
16
|
+
import '../../assets/Drawer.css';const ye = "_drawerContainer_yzb8n_2", he = "_drawer_yzb8n_2", be = "_content_yzb8n_31", pe = "_header_yzb8n_46", ze = "_title_yzb8n_60", Ce = "_space_yzb8n_74", ge = "_inner_yzb8n_85", we = "_button_yzb8n_101", ve = "_footer_yzb8n_106", Ne = "_left_yzb8n_122", ke = "_right_yzb8n_126", Se = "_full_yzb8n_130", Be = "_bottom_yzb8n_140", Ee = "_opened_yzb8n_157", Ie = "_overlay_yzb8n_213", Oe = "_unmount_yzb8n_229", e = {
|
17
|
+
drawerContainer: ye,
|
18
|
+
drawer: he,
|
18
19
|
content: be,
|
19
20
|
header: pe,
|
20
|
-
"sticky-header": "_sticky-
|
21
|
-
title:
|
22
|
-
space:
|
23
|
-
inner:
|
24
|
-
"is-loading": "_is-
|
25
|
-
button:
|
26
|
-
footer:
|
27
|
-
"has-scroll": "_has-
|
28
|
-
"footer-button": "_footer-
|
21
|
+
"sticky-header": "_sticky-header_yzb8n_54",
|
22
|
+
title: ze,
|
23
|
+
space: Ce,
|
24
|
+
inner: ge,
|
25
|
+
"is-loading": "_is-loading_yzb8n_90",
|
26
|
+
button: we,
|
27
|
+
footer: ve,
|
28
|
+
"has-scroll": "_has-scroll_yzb8n_115",
|
29
|
+
"footer-button": "_footer-button_yzb8n_118",
|
29
30
|
left: Ne,
|
30
31
|
right: ke,
|
31
32
|
full: Se,
|
32
33
|
bottom: Be,
|
33
|
-
"full-bottom-height": "_full-bottom-
|
34
|
+
"full-bottom-height": "_full-bottom-height_yzb8n_151",
|
34
35
|
opened: Ee,
|
35
|
-
"is-closing": "_is-
|
36
|
-
overlay:
|
37
|
-
unmount:
|
38
|
-
},
|
36
|
+
"is-closing": "_is-closing_yzb8n_176",
|
37
|
+
overlay: Ie,
|
38
|
+
unmount: Oe
|
39
|
+
}, Le = 300, Me = (d) => d ? {
|
39
40
|
drawer: {
|
40
41
|
position: "absolute",
|
41
42
|
zIndex: 100
|
@@ -44,7 +45,7 @@ import '../../assets/Drawer.css';const _e = "_drawer_1cohb_2", be = "_content_1c
|
|
44
45
|
position: "absolute",
|
45
46
|
zIndex: 90
|
46
47
|
}
|
47
|
-
} : {},
|
48
|
+
} : {}, qe = ne(
|
48
49
|
(d, T) => {
|
49
50
|
const {
|
50
51
|
as: x = "div",
|
@@ -52,35 +53,36 @@ import '../../assets/Drawer.css';const _e = "_drawer_1cohb_2", be = "_content_1c
|
|
52
53
|
onClose: u,
|
53
54
|
title: D,
|
54
55
|
className: A,
|
55
|
-
unmount:
|
56
|
+
unmount: z = !0,
|
56
57
|
isLoading: s = !1,
|
57
58
|
stickyHeader: P,
|
58
59
|
fullBottomHeight: X = !1,
|
59
60
|
position: m = R.RIGHT,
|
60
61
|
paddingRight: j = 8,
|
61
62
|
footer: f,
|
62
|
-
children:
|
63
|
-
classNameTitle:
|
64
|
-
classNameHeader:
|
65
|
-
classNameInner:
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
63
|
+
children: G,
|
64
|
+
classNameTitle: Q,
|
65
|
+
classNameHeader: V,
|
66
|
+
classNameInner: W,
|
67
|
+
classNameDrawerContainer: F,
|
68
|
+
classNameContent: K,
|
69
|
+
classNameFooter: Y,
|
70
|
+
closeOnClickOutside: C = !0,
|
71
|
+
showCloseButton: g = !0,
|
72
|
+
getContainer: _,
|
73
|
+
...q
|
74
|
+
} = d, [w, v] = b(!1), [J, N] = b(!1), k = L(), y = ie(ae.XS1), { ref: U } = ce({
|
73
75
|
enabled: m === R.BOTTOM
|
74
|
-
}),
|
76
|
+
}), S = re(_), i = L(null), [Z, $] = b(!1);
|
75
77
|
M(() => {
|
76
|
-
const
|
78
|
+
const a = () => {
|
77
79
|
if (i.current) {
|
78
|
-
const { scrollHeight:
|
79
|
-
|
80
|
+
const { scrollHeight: oe, clientHeight: te } = i.current;
|
81
|
+
$(oe > te);
|
80
82
|
}
|
81
83
|
};
|
82
|
-
|
83
|
-
const O = new ResizeObserver(
|
84
|
+
a();
|
85
|
+
const O = new ResizeObserver(a);
|
84
86
|
return i.current && O.observe(i.current), () => {
|
85
87
|
O.disconnect();
|
86
88
|
};
|
@@ -88,135 +90,141 @@ import '../../assets/Drawer.css';const _e = "_drawer_1cohb_2", be = "_content_1c
|
|
88
90
|
on: r && !w,
|
89
91
|
paddingRight: j
|
90
92
|
});
|
91
|
-
const
|
92
|
-
u && (
|
93
|
-
u(),
|
94
|
-
},
|
95
|
-
}, [u]),
|
96
|
-
|
97
|
-
}, [
|
98
|
-
(
|
99
|
-
|
93
|
+
const n = p(() => {
|
94
|
+
u && (v(!0), k.current = setTimeout(() => {
|
95
|
+
u(), v(!1);
|
96
|
+
}, Le));
|
97
|
+
}, [u]), ee = p(() => {
|
98
|
+
C && n();
|
99
|
+
}, [C, n]), h = p(
|
100
|
+
(a) => {
|
101
|
+
a.key === "Escape" && n();
|
100
102
|
},
|
101
|
-
[
|
103
|
+
[n]
|
102
104
|
);
|
103
|
-
M(() => (r && (
|
104
|
-
|
105
|
-
}), [r,
|
106
|
-
const
|
107
|
-
[e.opened]:
|
105
|
+
M(() => (r && (N(!0), window.addEventListener("keydown", h)), () => {
|
106
|
+
N(!1), clearTimeout(k.current), window.removeEventListener("keydown", h);
|
107
|
+
}), [r, h]);
|
108
|
+
const B = {
|
109
|
+
[e.opened]: J,
|
108
110
|
[e["is-closing"]]: w,
|
109
111
|
[e["full-bottom-height"]]: X,
|
110
112
|
[e["is-loading"]]: s
|
111
113
|
};
|
112
|
-
if (!r &&
|
114
|
+
if (!r && z)
|
113
115
|
return null;
|
114
|
-
const
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
W,
|
132
|
-
e[m],
|
116
|
+
const E = Me(_ !== void 0 && _ !== !1), I = /* @__PURE__ */ l(
|
117
|
+
"div",
|
118
|
+
{
|
119
|
+
className: t(e.drawerContainer, F),
|
120
|
+
children: [
|
121
|
+
/* @__PURE__ */ l(
|
122
|
+
x,
|
123
|
+
{
|
124
|
+
ref: T,
|
125
|
+
"aria-hidden": !r,
|
126
|
+
role: "dialog",
|
127
|
+
style: E.drawer,
|
128
|
+
className: t(e.drawer, e[m], B, A),
|
129
|
+
...q,
|
130
|
+
children: [
|
131
|
+
/* @__PURE__ */ l(
|
132
|
+
"section",
|
133
133
|
{
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
/* @__PURE__ */ o("div", { className: e.space, children: C && /* @__PURE__ */ o(
|
147
|
-
H,
|
148
|
-
{
|
149
|
-
variant: de.SecondaryWhite,
|
150
|
-
isIconButton: !0,
|
151
|
-
size: _ ? a.S : a.M,
|
152
|
-
iconName: "Close16px",
|
153
|
-
onClick: t,
|
154
|
-
className: e.button
|
155
|
-
}
|
156
|
-
) })
|
157
|
-
]
|
158
|
-
}
|
159
|
-
),
|
160
|
-
/* @__PURE__ */ o(
|
161
|
-
se,
|
162
|
-
{
|
163
|
-
ref: i,
|
164
|
-
className: n(
|
165
|
-
e.inner,
|
134
|
+
ref: U,
|
135
|
+
className: t(
|
136
|
+
e.content,
|
137
|
+
K,
|
138
|
+
e[m],
|
139
|
+
{
|
140
|
+
[e["is-loading"]]: !!s
|
141
|
+
}
|
142
|
+
),
|
143
|
+
children: [
|
144
|
+
/* @__PURE__ */ l(
|
145
|
+
"header",
|
166
146
|
{
|
167
|
-
|
168
|
-
|
169
|
-
|
147
|
+
className: t(e.header, V, {
|
148
|
+
[e["sticky-header"]]: P
|
149
|
+
}),
|
150
|
+
children: [
|
151
|
+
/* @__PURE__ */ o("h2", { className: t(e.title, Q), children: D }),
|
152
|
+
/* @__PURE__ */ o("div", { className: e.space, children: g && /* @__PURE__ */ o(
|
153
|
+
H,
|
154
|
+
{
|
155
|
+
variant: de.SecondaryWhite,
|
156
|
+
isIconButton: !0,
|
157
|
+
size: y ? c.S : c.M,
|
158
|
+
iconName: "Close16px",
|
159
|
+
onClick: n,
|
160
|
+
className: e.button
|
161
|
+
}
|
162
|
+
) })
|
163
|
+
]
|
164
|
+
}
|
170
165
|
),
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
166
|
+
/* @__PURE__ */ o(
|
167
|
+
se,
|
168
|
+
{
|
169
|
+
ref: i,
|
170
|
+
className: t(
|
171
|
+
e.inner,
|
172
|
+
{
|
173
|
+
[e["is-loading"]]: !!s
|
174
|
+
},
|
175
|
+
W
|
176
|
+
),
|
177
|
+
variant: fe.LIGHT,
|
178
|
+
size: _e.M,
|
179
|
+
children: s ? /* @__PURE__ */ o(ue, {}) : G
|
180
|
+
}
|
181
|
+
)
|
182
|
+
]
|
183
|
+
}
|
184
|
+
),
|
185
|
+
/* @__PURE__ */ o(
|
186
|
+
"footer",
|
187
187
|
{
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
188
|
+
className: t(e.footer, Y, {
|
189
|
+
[e["has-scroll"]]: Z
|
190
|
+
}),
|
191
|
+
children: typeof f == "function" ? f({ handleClose: n }) : f || g && /* @__PURE__ */ o(
|
192
|
+
H,
|
193
|
+
{
|
194
|
+
size: y ? c.L : c.XXL,
|
195
|
+
full: y,
|
196
|
+
onClick: n,
|
197
|
+
className: e["footer-button"],
|
198
|
+
children: "Закрыть"
|
199
|
+
}
|
200
|
+
)
|
193
201
|
}
|
194
202
|
)
|
195
|
-
|
196
|
-
|
197
|
-
]
|
198
|
-
}
|
199
|
-
),
|
200
|
-
/* @__PURE__ */ o(
|
201
|
-
"div",
|
202
|
-
{
|
203
|
-
className: n(
|
204
|
-
e.overlay,
|
205
|
-
{
|
206
|
-
[e.unmount]: !y
|
207
|
-
},
|
208
|
-
E
|
203
|
+
]
|
204
|
+
}
|
209
205
|
),
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
206
|
+
/* @__PURE__ */ o(
|
207
|
+
"div",
|
208
|
+
{
|
209
|
+
className: t(
|
210
|
+
e.overlay,
|
211
|
+
{
|
212
|
+
[e.unmount]: !z
|
213
|
+
},
|
214
|
+
B
|
215
|
+
),
|
216
|
+
style: E.overlay,
|
217
|
+
"data-testid": "drawer-overlay",
|
218
|
+
onClick: ee
|
219
|
+
}
|
220
|
+
)
|
221
|
+
]
|
222
|
+
}
|
223
|
+
);
|
224
|
+
return S === !1 ? I : /* @__PURE__ */ o(me, { element: S, children: I });
|
217
225
|
}
|
218
226
|
);
|
219
227
|
export {
|
220
|
-
|
221
|
-
|
228
|
+
Le as ANIMATION_DELAY,
|
229
|
+
qe as Drawer
|
222
230
|
};
|