mimir-ui-kit 1.42.2 → 1.43.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.
- package/dist/ProgressBar-COdzy3fY.js +67 -0
- package/dist/assets/MultiSelectSearch.css +1 -1
- package/dist/assets/Pagination.css +1 -1
- package/dist/assets/SelectSearch.css +1 -1
- package/dist/assets/Switcher.css +1 -1
- package/dist/assets/TabTrail.css +1 -1
- package/dist/assets/hooks.css +1 -0
- package/dist/{combobox-Dv6-ANkb.js → combobox-fIVOzEhl.js} +6 -6
- package/dist/components/Accordion/Accordion.d.ts +6 -0
- package/dist/components/Accordion/Accordion.js +202 -182
- package/dist/components/AnchorLink/Link.d.ts +2 -0
- package/dist/components/AnchorLink/Link.js +54 -42
- package/dist/components/CheckboxMimir/CheckboxMimir.js +4 -4
- package/dist/components/DatePicker/DatePicker.d.ts +32 -0
- package/dist/components/DatePicker/DatePicker.js +125 -111
- package/dist/components/DatePicker/DatePickerModal.d.ts +5 -1
- package/dist/components/DatePicker/DatePickerModal.js +97 -75
- package/dist/components/DatePicker/MonthPickerModal.d.ts +5 -1
- package/dist/components/DatePicker/MonthPickerModal.js +96 -58
- package/dist/components/DatePicker/YearPickerModal.d.ts +5 -1
- package/dist/components/DatePicker/YearPickerModal.js +75 -57
- package/dist/components/Drawer/Drawer.d.ts +7 -1
- package/dist/components/Drawer/Drawer.js +122 -106
- package/dist/components/Drawer/hooks.d.ts +9 -0
- package/dist/components/Drawer/hooks.js +24 -0
- package/dist/components/Dropdown/Dropdown.d.ts +18 -1
- package/dist/components/Dropdown/Dropdown.js +361 -343
- package/dist/components/Dropdown/constants.d.ts +11 -0
- package/dist/components/Dropdown/constants.js +5 -0
- package/dist/components/Dropdown/hooks.d.ts +19 -0
- package/dist/components/Dropdown/hooks.js +11 -0
- package/dist/components/Dropdown/index.d.ts +1 -0
- package/dist/components/Dropdown/index.js +5 -2
- package/dist/components/MultiSelectSearch/MultiSelectSearch.d.ts +8 -1
- package/dist/components/MultiSelectSearch/MultiSelectSearch.js +461 -302
- package/dist/components/MultiSelectSearch/constants.d.ts +6 -0
- package/dist/components/MultiSelectSearch/constants.js +7 -5
- package/dist/components/MultiSelectSearch/index.d.ts +1 -1
- package/dist/components/MultiSelectSearch/index.js +5 -4
- package/dist/components/MultiSelectSearch/types.d.ts +33 -1
- package/dist/components/MultiSelectSearch/utils.d.ts +1 -0
- package/dist/components/MultiSelectSearch/utils.js +31 -17
- package/dist/components/Pagination/Pagination.d.ts +23 -0
- package/dist/components/Pagination/Pagination.js +137 -99
- package/dist/components/RadioGroup/RadioGroup.js +3 -3
- package/dist/components/SelectSearch/SelectSearch.d.ts +8 -1
- package/dist/components/SelectSearch/SelectSearch.js +381 -220
- package/dist/components/SelectSearch/constants.d.ts +6 -0
- package/dist/components/SelectSearch/constants.js +3 -2
- package/dist/components/SelectSearch/index.d.ts +1 -1
- package/dist/components/SelectSearch/index.js +5 -4
- package/dist/components/SelectSearch/types.d.ts +32 -1
- package/dist/components/SelectSearch/utils.d.ts +2 -0
- package/dist/components/SelectSearch/utils.js +28 -14
- package/dist/components/Switcher/Switcher.js +66 -59
- package/dist/components/Switcher/types.d.ts +1 -0
- package/dist/components/TabTrail/TabTrail.d.ts +9 -0
- package/dist/components/TabTrail/TabTrail.js +198 -190
- package/dist/components/Toasts/ProgressBar.d.ts +4 -2
- package/dist/components/Toasts/ProgressBar.js +1 -1
- package/dist/components/Toasts/Toast.d.ts +5 -1
- package/dist/components/Toasts/Toast.js +59 -44
- package/dist/components/Toasts/ToastList.js +1 -1
- package/dist/components/Toasts/ToastsProvider.js +1 -1
- package/dist/components/index.d.ts +3 -2
- package/dist/components/index.js +154 -149
- package/dist/{field-BP5-U1Nr.js → field-BLi5834s.js} +2 -2
- package/dist/{focus-management-Dp2_vbQ3.js → focus-management-BAl0GmRk.js} +1 -1
- package/dist/{hidden-Dn4lM6EL.js → hidden-CkTYbiNM.js} +1 -1
- package/dist/hooks/useTimer/index.d.ts +2 -1
- package/dist/hooks/useTimer/index.js +55 -41
- package/dist/hooks-HgN6Yauq.js +117 -0
- package/dist/index.js +182 -177
- package/dist/{keyboard-CUMsrFX1.js → keyboard-wis2TUql.js} +2 -2
- package/dist/{label-DOlEWXBl.js → label-BmphTIGY.js} +2 -2
- package/dist/{open-closed-CkTbpRyi.js → open-closed-CJijMeI2.js} +1 -1
- package/dist/{portal-C_u5auU1.js → portal-BnEqSZwo.js} +2 -2
- package/dist/{use-active-press-BVQqDQ3V.js → use-active-press-CnDeVvQq.js} +1 -1
- package/dist/{use-is-mounted-D7cq4xsa.js → use-is-mounted-MBU4fiLr.js} +1 -1
- package/package.json +3 -1
- package/dist/ProgressBar-DEFs1tWq.js +0 -55
- package/dist/assets/Dropdown.css +0 -1
- package/dist/components/Pagination/types.d.ts +0 -0
@@ -1,139 +1,153 @@
|
|
1
|
-
import { jsxs as
|
1
|
+
import { jsxs as f, Fragment as I, jsx as t } from "react/jsx-runtime";
|
2
2
|
import { c as n } from "../../index-DIxK0V-G.js";
|
3
|
-
import { forwardRef as
|
4
|
-
import { EDrawerPosition as
|
5
|
-
import {
|
6
|
-
import {
|
7
|
-
import {
|
8
|
-
import {
|
9
|
-
import {
|
10
|
-
import {
|
11
|
-
import {
|
12
|
-
import {
|
13
|
-
import
|
14
|
-
|
15
|
-
|
3
|
+
import { forwardRef as q, useState as M, useRef as J, useCallback as h, useEffect as U } from "react";
|
4
|
+
import { EDrawerPosition as O } from "./constants.js";
|
5
|
+
import { useContainer as Z } from "./hooks.js";
|
6
|
+
import { useMediaQuery as $ } from "../../hooks/useMediaQuery/useMediaQuery.js";
|
7
|
+
import { EMediaQuery as ee } from "../../hooks/useMediaQuery/constants.js";
|
8
|
+
import { useLockBodyScroll as te } from "../../hooks/useLockBodyScroll/useLockBodyScroll.js";
|
9
|
+
import { useResizeObserver as oe } from "../../hooks/useResizeObserver/useResizeObserver.js";
|
10
|
+
import { Button as S } from "../Button/Button.js";
|
11
|
+
import { EButtonVariantDefault as ne, EButtonSize as r } from "../Button/constants.js";
|
12
|
+
import { Loader as se } from "../Loader/Loader.js";
|
13
|
+
import { Portal as re } from "../Portal/Portal.js";
|
14
|
+
import '../../assets/Drawer.css';const ae = "_drawer_13ua6_2", ie = "_content_13ua6_26", le = "_header_13ua6_44", ce = "_title_13ua6_58", ue = "_space_13ua6_72", de = "_inner_13ua6_83", me = "_button_13ua6_86", _e = "_footer_13ua6_91", fe = "_left_13ua6_104", he = "_right_13ua6_108", pe = "_full_13ua6_112", ye = "_bottom_13ua6_122", ge = "_opened_13ua6_139", Ce = "_overlay_13ua6_195", ve = "_unmount_13ua6_211", e = {
|
15
|
+
drawer: ae,
|
16
|
+
content: ie,
|
16
17
|
"is-loading": "_is-loading_13ua6_40",
|
17
|
-
header:
|
18
|
+
header: le,
|
18
19
|
"sticky-header": "_sticky-header_13ua6_52",
|
19
|
-
title:
|
20
|
-
space:
|
21
|
-
inner:
|
22
|
-
button:
|
23
|
-
footer:
|
20
|
+
title: ce,
|
21
|
+
space: ue,
|
22
|
+
inner: de,
|
23
|
+
button: me,
|
24
|
+
footer: _e,
|
24
25
|
"footer-button": "_footer-button_13ua6_100",
|
25
|
-
left:
|
26
|
-
right:
|
27
|
-
full:
|
28
|
-
bottom:
|
26
|
+
left: fe,
|
27
|
+
right: he,
|
28
|
+
full: pe,
|
29
|
+
bottom: ye,
|
29
30
|
"full-bottom-height": "_full-bottom-height_13ua6_133",
|
30
|
-
opened:
|
31
|
+
opened: ge,
|
31
32
|
"is-closing": "_is-closing_13ua6_158",
|
32
|
-
overlay:
|
33
|
-
unmount:
|
34
|
-
},
|
35
|
-
|
33
|
+
overlay: Ce,
|
34
|
+
unmount: ve
|
35
|
+
}, Ne = 300, be = (a) => a ? {
|
36
|
+
drawer: {
|
37
|
+
position: "absolute",
|
38
|
+
zIndex: 100
|
39
|
+
},
|
40
|
+
overlay: {
|
41
|
+
position: "absolute",
|
42
|
+
zIndex: 90
|
43
|
+
}
|
44
|
+
} : {}, Ae = q(
|
45
|
+
(a, L) => {
|
36
46
|
const {
|
37
|
-
as:
|
47
|
+
as: R = "div",
|
38
48
|
isOpen: s,
|
39
|
-
onClose:
|
40
|
-
title:
|
41
|
-
className:
|
42
|
-
unmount:
|
43
|
-
isLoading:
|
44
|
-
stickyHeader:
|
45
|
-
fullBottomHeight:
|
46
|
-
position:
|
47
|
-
paddingRight:
|
48
|
-
footer:
|
49
|
-
children:
|
50
|
-
classNameTitle:
|
51
|
-
classNameHeader:
|
52
|
-
classNameInner:
|
53
|
-
classNameContent:
|
54
|
-
classNameFooter:
|
55
|
-
closeOnClickOutside:
|
56
|
-
showCloseButton:
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
49
|
+
onClose: i,
|
50
|
+
title: T,
|
51
|
+
className: x,
|
52
|
+
unmount: p = !0,
|
53
|
+
isLoading: l = !1,
|
54
|
+
stickyHeader: z,
|
55
|
+
fullBottomHeight: D = !1,
|
56
|
+
position: c = O.RIGHT,
|
57
|
+
paddingRight: A = 8,
|
58
|
+
footer: u,
|
59
|
+
children: H,
|
60
|
+
classNameTitle: P,
|
61
|
+
classNameHeader: X,
|
62
|
+
classNameInner: j,
|
63
|
+
classNameContent: F,
|
64
|
+
classNameFooter: Q,
|
65
|
+
closeOnClickOutside: y = !0,
|
66
|
+
showCloseButton: g = !0,
|
67
|
+
getContainer: d,
|
68
|
+
...G
|
69
|
+
} = a, [C, v] = M(!1), [K, N] = M(!1), b = J(), m = $(ee.XS1), { ref: V } = oe({
|
70
|
+
enabled: c === O.BOTTOM
|
71
|
+
}), w = Z(d);
|
72
|
+
te({
|
73
|
+
on: s && !C,
|
74
|
+
paddingRight: A
|
64
75
|
});
|
65
|
-
const
|
66
|
-
|
67
|
-
|
68
|
-
},
|
69
|
-
}, [
|
70
|
-
|
71
|
-
}, [
|
72
|
-
(
|
73
|
-
|
76
|
+
const o = h(() => {
|
77
|
+
i && (v(!0), b.current = setTimeout(() => {
|
78
|
+
i(), v(!1);
|
79
|
+
}, Ne));
|
80
|
+
}, [i]), W = h(() => {
|
81
|
+
y && o();
|
82
|
+
}, [y, o]), _ = h(
|
83
|
+
(Y) => {
|
84
|
+
Y.key === "Escape" && o();
|
74
85
|
},
|
75
|
-
[
|
86
|
+
[o]
|
76
87
|
);
|
77
|
-
|
78
|
-
|
79
|
-
}), [s,
|
80
|
-
const
|
81
|
-
[e.opened]:
|
82
|
-
[e["is-closing"]]:
|
83
|
-
[e["full-bottom-height"]]:
|
84
|
-
[e["is-loading"]]:
|
88
|
+
U(() => (s && (N(!0), window.addEventListener("keydown", _)), () => {
|
89
|
+
N(!1), clearTimeout(b.current), window.removeEventListener("keydown", _);
|
90
|
+
}), [s, _]);
|
91
|
+
const k = {
|
92
|
+
[e.opened]: K,
|
93
|
+
[e["is-closing"]]: C,
|
94
|
+
[e["full-bottom-height"]]: D,
|
95
|
+
[e["is-loading"]]: l
|
85
96
|
};
|
86
|
-
|
87
|
-
|
88
|
-
|
97
|
+
if (!s && p)
|
98
|
+
return null;
|
99
|
+
const B = be(d !== void 0 && d !== !1), E = /* @__PURE__ */ f(I, { children: [
|
100
|
+
/* @__PURE__ */ t(
|
101
|
+
R,
|
89
102
|
{
|
90
|
-
ref:
|
103
|
+
ref: L,
|
91
104
|
"aria-hidden": !s,
|
92
105
|
role: "dialog",
|
93
|
-
|
94
|
-
|
95
|
-
|
106
|
+
style: B.drawer,
|
107
|
+
className: n(e.drawer, e[c], k, x),
|
108
|
+
...G,
|
109
|
+
children: /* @__PURE__ */ t(
|
96
110
|
"section",
|
97
111
|
{
|
98
|
-
ref:
|
112
|
+
ref: V,
|
99
113
|
className: n(
|
100
114
|
e.content,
|
101
|
-
|
102
|
-
e[
|
115
|
+
F,
|
116
|
+
e[c],
|
103
117
|
{
|
104
|
-
[e["is-loading"]]: !!
|
118
|
+
[e["is-loading"]]: !!l
|
105
119
|
}
|
106
120
|
),
|
107
|
-
children:
|
108
|
-
/* @__PURE__ */
|
121
|
+
children: l ? /* @__PURE__ */ t(se, {}) : /* @__PURE__ */ f(I, { children: [
|
122
|
+
/* @__PURE__ */ f(
|
109
123
|
"header",
|
110
124
|
{
|
111
|
-
className: n(e.header,
|
112
|
-
[e["sticky-header"]]:
|
125
|
+
className: n(e.header, X, {
|
126
|
+
[e["sticky-header"]]: z
|
113
127
|
}),
|
114
128
|
children: [
|
115
|
-
/* @__PURE__ */
|
116
|
-
/* @__PURE__ */
|
117
|
-
|
129
|
+
/* @__PURE__ */ t("h2", { className: n(e.title, P), children: T }),
|
130
|
+
/* @__PURE__ */ t("div", { className: e.space, children: g && /* @__PURE__ */ t(
|
131
|
+
S,
|
118
132
|
{
|
119
|
-
variant:
|
133
|
+
variant: ne.SecondaryWhite,
|
120
134
|
isIconButton: !0,
|
121
|
-
size:
|
135
|
+
size: m ? r.S : r.M,
|
122
136
|
iconName: "Close16px",
|
123
|
-
onClick:
|
137
|
+
onClick: o,
|
124
138
|
className: e.button
|
125
139
|
}
|
126
140
|
) })
|
127
141
|
]
|
128
142
|
}
|
129
143
|
),
|
130
|
-
/* @__PURE__ */
|
131
|
-
/* @__PURE__ */
|
132
|
-
|
144
|
+
/* @__PURE__ */ t("div", { className: n(e.inner, j), children: H }),
|
145
|
+
/* @__PURE__ */ t("footer", { className: n(e.footer, Q), children: typeof u == "function" ? u({ handleClose: o }) : u || g && /* @__PURE__ */ t(
|
146
|
+
S,
|
133
147
|
{
|
134
|
-
size:
|
135
|
-
full:
|
136
|
-
onClick:
|
148
|
+
size: m ? r.M : r.XXL,
|
149
|
+
full: m,
|
150
|
+
onClick: o,
|
137
151
|
className: e["footer-button"],
|
138
152
|
children: "Закрыть"
|
139
153
|
}
|
@@ -143,24 +157,26 @@ import '../../assets/Drawer.css';const oe = "_drawer_13ua6_2", te = "_content_13
|
|
143
157
|
)
|
144
158
|
}
|
145
159
|
),
|
146
|
-
/* @__PURE__ */
|
160
|
+
/* @__PURE__ */ t(
|
147
161
|
"div",
|
148
162
|
{
|
149
163
|
className: n(
|
150
164
|
e.overlay,
|
151
165
|
{
|
152
|
-
[e.unmount]: !
|
166
|
+
[e.unmount]: !p
|
153
167
|
},
|
154
|
-
|
168
|
+
k
|
155
169
|
),
|
170
|
+
style: B.overlay,
|
156
171
|
"data-testid": "drawer-overlay",
|
157
|
-
onClick:
|
172
|
+
onClick: W
|
158
173
|
}
|
159
174
|
)
|
160
175
|
] });
|
176
|
+
return w === !1 ? E : /* @__PURE__ */ t(re, { element: w, children: E });
|
161
177
|
}
|
162
178
|
);
|
163
179
|
export {
|
164
|
-
|
165
|
-
|
180
|
+
Ne as ANIMATION_DELAY,
|
181
|
+
Ae as Drawer
|
166
182
|
};
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import { RefObject } from 'react';
|
2
|
+
|
3
|
+
type TContainerInput = HTMLElement | RefObject<HTMLElement> | undefined | false;
|
4
|
+
type TContainerOutput = HTMLElement | undefined | false;
|
5
|
+
/**
|
6
|
+
* Хук для безопасного получения DOM-элемента из различных источников
|
7
|
+
*/
|
8
|
+
export declare function useContainer(container: TContainerInput): TContainerOutput;
|
9
|
+
export {};
|
@@ -0,0 +1,24 @@
|
|
1
|
+
import { useState as f, useRef as s, useEffect as l } from "react";
|
2
|
+
function m(e) {
|
3
|
+
const [u, r] = f(
|
4
|
+
e === !1 ? !1 : void 0
|
5
|
+
), t = s(null);
|
6
|
+
return l(() => {
|
7
|
+
if (e === !1) {
|
8
|
+
r(!1);
|
9
|
+
return;
|
10
|
+
}
|
11
|
+
if (e instanceof HTMLElement) {
|
12
|
+
r(e);
|
13
|
+
return;
|
14
|
+
}
|
15
|
+
if (e && "current" in e) {
|
16
|
+
e.current !== t.current && (t.current = e.current, r(e.current || void 0));
|
17
|
+
return;
|
18
|
+
}
|
19
|
+
r(void 0);
|
20
|
+
}, [e]), u;
|
21
|
+
}
|
22
|
+
export {
|
23
|
+
m as useContainer
|
24
|
+
};
|
@@ -53,9 +53,26 @@ type TProps = {
|
|
53
53
|
* Время автоматического закрытия в миллисекундах.
|
54
54
|
*/
|
55
55
|
autoCloseTimeout?: number;
|
56
|
+
/**
|
57
|
+
* Произвольный элемент-триггер для открытия выпадающего меню.
|
58
|
+
* Если указан, то buttonContent игнорируется.
|
59
|
+
*/
|
60
|
+
triggerElement?: ReactNode | ((props: {
|
61
|
+
open: boolean;
|
62
|
+
}) => JSX.Element);
|
63
|
+
/**
|
64
|
+
* Вариант оформления выпадающего меню.
|
65
|
+
* @default 'default'
|
66
|
+
*/
|
67
|
+
variant?: 'default' | 'black';
|
68
|
+
/**
|
69
|
+
* Показывать ли стрелку, указывающую на триггер.
|
70
|
+
* @default false
|
71
|
+
*/
|
72
|
+
arrow?: boolean;
|
56
73
|
};
|
57
74
|
/**
|
58
75
|
* Компонент Dropdown, содержит в себе кнопку и панель выпадающего меню
|
59
76
|
*/
|
60
|
-
export declare const Dropdown: import('react').MemoExoticComponent<({ children, position, popoverProps, className, buttonClassName, panelClassName, menuItemsClassName, buttonContent, needCloseButton, openOnHover, isOpen, autoCloseTimeout }: TProps) => import("react/jsx-runtime").JSX.Element>;
|
77
|
+
export declare const Dropdown: import('react').MemoExoticComponent<({ children, position, popoverProps, className, buttonClassName, panelClassName, menuItemsClassName, buttonContent, needCloseButton, openOnHover, isOpen, autoCloseTimeout, triggerElement, variant, arrow }: TProps) => import("react/jsx-runtime").JSX.Element>;
|
61
78
|
export {};
|