mimir-ui-kit 1.4.1 → 1.5.0
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +1 -1
- package/dist/{NavigationButtons-B8tMfqrg.js → NavigationButtons-cTsXB7GS.js} +18 -18
- package/dist/assets/Button.css +1 -1
- package/dist/assets/OtpInput.css +1 -1
- package/dist/assets/RadioGroup.css +1 -1
- package/dist/assets/SelectSearch.css +1 -0
- package/dist/assets/Slider.css +1 -1
- package/dist/assets/index.css +1 -1
- package/dist/components/Button/Button.d.ts +1 -0
- package/dist/components/Button/Button.js +24 -24
- package/dist/components/Input/Input.js +1 -1
- package/dist/components/InputPassword/InputPassword.js +2 -2
- package/dist/components/InputPhoneNumber/InputPhoneNumber.js +1 -1
- package/dist/components/MergedButton/MergedButton.d.ts +1 -1
- package/dist/components/MergedButton/MergedButton.js +2 -2
- package/dist/components/OtpInput/OtpInput.js +6 -6
- package/dist/components/RadioGroup/RadioGroup.js +78 -1019
- package/dist/components/SelectSearch/SelectSearch.d.ts +21 -0
- package/dist/components/SelectSearch/SelectSearch.js +3989 -0
- package/dist/components/SelectSearch/constants.d.ts +4 -0
- package/dist/components/SelectSearch/constants.js +8 -0
- package/dist/components/SelectSearch/index.d.ts +2 -0
- package/dist/components/SelectSearch/index.js +6 -0
- package/dist/components/SelectSearch/types.d.ts +17 -0
- package/dist/components/SelectSearch/types.js +1 -0
- package/dist/components/Slider/NavigationButtons/NavigationButtons.js +1 -1
- package/dist/components/Slider/NavigationButtons/index.js +1 -1
- package/dist/components/Slider/Slider.js +10 -10
- package/dist/components/index.d.ts +0 -2
- package/dist/components/index.js +0 -4
- package/dist/focus-management-4cCSLNHi.js +1000 -0
- package/dist/hooks/index.d.ts +0 -1
- package/dist/hooks/index.js +0 -2
- package/dist/index.js +0 -6
- package/package.json +1 -1
- package/dist/assets/Drawer.css +0 -1
- package/dist/components/Drawer/Drawer.d.ts +0 -38
- package/dist/components/Drawer/Drawer.js +0 -144
- package/dist/components/Drawer/constants.d.ts +0 -5
- package/dist/components/Drawer/constants.js +0 -9
- package/dist/components/Drawer/index.d.ts +0 -2
- package/dist/components/Drawer/index.js +0 -6
- package/dist/components/Portal/Portal.d.ts +0 -7
- package/dist/components/Portal/Portal.js +0 -10
- package/dist/components/Portal/index.d.ts +0 -1
- package/dist/components/Portal/index.js +0 -4
- package/dist/hooks/useLockBodyScroll/index.d.ts +0 -1
- package/dist/hooks/useLockBodyScroll/index.js +0 -4
- package/dist/hooks/useLockBodyScroll/useLockBodyScroll.d.ts +0 -6
- package/dist/hooks/useLockBodyScroll/useLockBodyScroll.js +0 -20
package/dist/hooks/index.d.ts
CHANGED
package/dist/hooks/index.js
CHANGED
@@ -1,8 +1,6 @@
|
|
1
1
|
import { useMediaQuery } from "./useMediaQuery/useMediaQuery.js";
|
2
2
|
import { EMediaQuery } from "./useMediaQuery/constants.js";
|
3
|
-
import { useLockBodyScroll } from "./useLockBodyScroll/useLockBodyScroll.js";
|
4
3
|
export {
|
5
4
|
EMediaQuery,
|
6
|
-
useLockBodyScroll,
|
7
5
|
useMediaQuery
|
8
6
|
};
|
package/dist/index.js
CHANGED
@@ -12,24 +12,19 @@ import { EMergedButtonVariantRound } from "./components/MergedButton/constants.j
|
|
12
12
|
import { AppImage } from "./components/Image/Image.js";
|
13
13
|
import { Loader } from "./components/Loader/Loader.js";
|
14
14
|
import { Slider } from "./components/Slider/Slider.js";
|
15
|
-
import { Drawer } from "./components/Drawer/Drawer.js";
|
16
|
-
import { EDrawerPosition } from "./components/Drawer/constants.js";
|
17
15
|
import { Steps } from "./components/Steps/Steps.js";
|
18
16
|
import { EStepsPrimaryColor, EStepsSecondaryColor, EStepsSize } from "./components/Steps/constants.js";
|
19
17
|
import { Vote } from "./components/Vote/Vote.js";
|
20
18
|
import { EVoteSize } from "./components/Vote/constants.js";
|
21
19
|
import { useMediaQuery } from "./hooks/useMediaQuery/useMediaQuery.js";
|
22
20
|
import { EMediaQuery } from "./hooks/useMediaQuery/constants.js";
|
23
|
-
import { useLockBodyScroll } from "./hooks/useLockBodyScroll/useLockBodyScroll.js";
|
24
21
|
import { Icon } from "./icons/Icon.js";
|
25
22
|
import './assets/index.css';export {
|
26
23
|
Button,
|
27
|
-
Drawer,
|
28
24
|
EButtonForm,
|
29
25
|
EButtonSize,
|
30
26
|
EButtonVariantDefault,
|
31
27
|
EButtonVariantRound,
|
32
|
-
EDrawerPosition,
|
33
28
|
EInputSize,
|
34
29
|
EInputVariant,
|
35
30
|
EMediaQuery,
|
@@ -52,6 +47,5 @@ import './assets/index.css';export {
|
|
52
47
|
Vote,
|
53
48
|
getMaskedInputPhoneValue,
|
54
49
|
getUnmaskedInputValue,
|
55
|
-
useLockBodyScroll,
|
56
50
|
useMediaQuery
|
57
51
|
};
|
package/package.json
CHANGED
package/dist/assets/Drawer.css
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
._drawer_vy4rv_3{--drawer-width: 808px;--drawer-z-index: 1000;position:fixed;z-index:1000;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_vy4rv_3 ._content_vy4rv_17{position:relative;z-index:var(--modal-z-index);display:flex;flex:1;flex-direction:column;padding:var(--space-m) var(--space-4xl) var(--space-4xl);transition:all .3s ease}@media (max-width: 600px){._drawer_vy4rv_3 ._content_vy4rv_17{--drawer-width: 100%;padding:var(--space-m)}}._drawer_vy4rv_3 ._header_vy4rv_32{display:flex;gap:var(--space-xs);height:68px}._drawer_vy4rv_3 ._header_vy4rv_32:not(:last-child){margin-bottom:var(--space-2xl)}._drawer_vy4rv_3 ._header_vy4rv_32 ._title_vy4rv_40{flex:1;align-self:flex-end;font-weight:var(--font-weight-text-medium);font-size:var(--size-text-xl3);line-height:var(--line-height-text-s1);letter-spacing:.7px}@media (max-width: 600px){._drawer_vy4rv_3 ._header_vy4rv_32 ._title_vy4rv_40{font-size:var(--size-text-xl2);line-height:var(--line-height-text-xs)}}._drawer_vy4rv_3 ._header_vy4rv_32 ._space_vy4rv_54{flex:0 0 var(--button-height-m)}@media (max-width: 600px){._drawer_vy4rv_3 ._header_vy4rv_32{height:55px}._drawer_vy4rv_3 ._header_vy4rv_32:not(:last-child){margin-bottom:var(--space-m)}}._drawer_vy4rv_3 ._inner_vy4rv_65{flex:1}._drawer_vy4rv_3 ._button_vy4rv_68{position:absolute;top:var(--space-m);right:var(--space-m)}._drawer_vy4rv_3 ._footer_vy4rv_73{display:block;padding-top:var(--space-4xl)}@media (max-width: 600px){._drawer_vy4rv_3 ._footer_vy4rv_73{padding-top:var(--space-m)}}._drawer_vy4rv_3 ._footer-button_vy4rv_82{display:block;margin-left:auto}._drawer_vy4rv_3._left_vy4rv_86{top:0;left:-100%}._drawer_vy4rv_3._right_vy4rv_90{top:0;right:-100%}._drawer_vy4rv_3._bottom_vy4rv_94{right:50%;bottom:-100%;left:50%;max-height:80vh;border-top-left-radius:var(--control-radius);border-top-right-radius:var(--control-radius);transform:translate(-50%)}._drawer_vy4rv_3._opened_vy4rv_103{transition:all .3s ease;pointer-events:auto}._drawer_vy4rv_3._opened_vy4rv_103._left_vy4rv_86{left:0%;transition:left .3s ease}._drawer_vy4rv_3._opened_vy4rv_103._right_vy4rv_90{right:0%;transition:right .3s ease}._drawer_vy4rv_3._opened_vy4rv_103._bottom_vy4rv_94{bottom:0%}._drawer_vy4rv_3._is-closing_vy4rv_118._left_vy4rv_86{left:-100%}._drawer_vy4rv_3._is-closing_vy4rv_118._right_vy4rv_90{right:-100%}._drawer_vy4rv_3._is-closing_vy4rv_118._bottom_vy4rv_94{bottom:-100%}@media (max-width: 1440px){._drawer_vy4rv_3{--drawer-width: 608px}}@media (max-width: 1280px){._drawer_vy4rv_3{--drawer-width: 648px}}@media (max-width: 768px){._drawer_vy4rv_3{--drawer-width: 584px}}@media (max-width: 600px){._drawer_vy4rv_3{--drawer-width: 100%}._drawer_vy4rv_3._bottom_vy4rv_94{max-width:359px}}._overlay_vy4rv_151{position:fixed;top:0;left:0;width:100%;height:100%;background-color:#0009;opacity:0;transition:all .3s ease}._overlay_vy4rv_151._opened_vy4rv_103{opacity:1;transition:all .3s ease}._overlay_vy4rv_151._is-closing_vy4rv_118{opacity:0;transition:all .3s ease}
|
@@ -1,38 +0,0 @@
|
|
1
|
-
import { PropsWithChildren, ReactNode } from 'react';
|
2
|
-
import { EDrawerPosition } from './constants';
|
3
|
-
|
4
|
-
type TProps = {
|
5
|
-
/**
|
6
|
-
* Обязательный заголовок.
|
7
|
-
*/
|
8
|
-
title: string;
|
9
|
-
/**
|
10
|
-
* Флаг отвечачающий за показ/скрытие.
|
11
|
-
*/
|
12
|
-
isOpen?: boolean;
|
13
|
-
/**
|
14
|
-
* Настраиваемый паддинг для body, что бы избежать скачка контента при overflow: hidden
|
15
|
-
*/
|
16
|
-
paddingRight?: number;
|
17
|
-
/**
|
18
|
-
* Функция закрытия шторки
|
19
|
-
*/
|
20
|
-
onClose?: VoidFunction;
|
21
|
-
/**
|
22
|
-
* Дополнительный класс для родительской обертки.
|
23
|
-
*/
|
24
|
-
className?: string;
|
25
|
-
/**
|
26
|
-
* Позиция шторки.
|
27
|
-
*/
|
28
|
-
position?: `${EDrawerPosition}` | EDrawerPosition;
|
29
|
-
/**
|
30
|
-
* Кастомный footer. По дефолту в нем расположена кнопка для закрытия.
|
31
|
-
*/
|
32
|
-
footer?: ReactNode;
|
33
|
-
};
|
34
|
-
/**
|
35
|
-
* Компонент шторки, который может выезжать слева, справа или внизу.
|
36
|
-
*/
|
37
|
-
export declare const Drawer: ({ isOpen, onClose, title, className, position, paddingRight, footer, children }: PropsWithChildren<TProps>) => import("react/jsx-runtime").JSX.Element | null;
|
38
|
-
export {};
|
@@ -1,144 +0,0 @@
|
|
1
|
-
import { jsxs, jsx } from "react/jsx-runtime";
|
2
|
-
import { c as classNames } from "../../index-CweZ_OcN.js";
|
3
|
-
import { useState, useRef, useCallback, useEffect } from "react";
|
4
|
-
import { EDrawerPosition } from "./constants.js";
|
5
|
-
import { useMediaQuery } from "../../hooks/useMediaQuery/useMediaQuery.js";
|
6
|
-
import { EMediaQuery } from "../../hooks/useMediaQuery/constants.js";
|
7
|
-
import { useLockBodyScroll } from "../../hooks/useLockBodyScroll/useLockBodyScroll.js";
|
8
|
-
import { Button } from "../Button/Button.js";
|
9
|
-
import { EButtonVariantDefault, EButtonSize } from "../Button/constants.js";
|
10
|
-
import { Portal } from "../Portal/Portal.js";
|
11
|
-
import '../../assets/Drawer.css';const drawer = "_drawer_vy4rv_3";
|
12
|
-
const content = "_content_vy4rv_17";
|
13
|
-
const header = "_header_vy4rv_32";
|
14
|
-
const title = "_title_vy4rv_40";
|
15
|
-
const space = "_space_vy4rv_54";
|
16
|
-
const inner = "_inner_vy4rv_65";
|
17
|
-
const button = "_button_vy4rv_68";
|
18
|
-
const footer = "_footer_vy4rv_73";
|
19
|
-
const left = "_left_vy4rv_86";
|
20
|
-
const right = "_right_vy4rv_90";
|
21
|
-
const bottom = "_bottom_vy4rv_94";
|
22
|
-
const opened = "_opened_vy4rv_103";
|
23
|
-
const overlay = "_overlay_vy4rv_151";
|
24
|
-
const cls = {
|
25
|
-
drawer,
|
26
|
-
content,
|
27
|
-
header,
|
28
|
-
title,
|
29
|
-
space,
|
30
|
-
inner,
|
31
|
-
button,
|
32
|
-
footer,
|
33
|
-
"footer-button": "_footer-button_vy4rv_82",
|
34
|
-
left,
|
35
|
-
right,
|
36
|
-
bottom,
|
37
|
-
opened,
|
38
|
-
"is-closing": "_is-closing_vy4rv_118",
|
39
|
-
overlay
|
40
|
-
};
|
41
|
-
const ANIMATION_DELAY = 300;
|
42
|
-
const Drawer = ({
|
43
|
-
isOpen,
|
44
|
-
onClose,
|
45
|
-
title: title2,
|
46
|
-
className,
|
47
|
-
position = EDrawerPosition.RIGHT,
|
48
|
-
paddingRight = 8,
|
49
|
-
footer: footer2,
|
50
|
-
children
|
51
|
-
}) => {
|
52
|
-
const [isClosing, setIsClosing] = useState(false);
|
53
|
-
const [isMounted, setIsMounted] = useState(false);
|
54
|
-
const [isBodyScrollLocked, setIsBodyScrollLocked] = useState(false);
|
55
|
-
const timerRef = useRef();
|
56
|
-
const contentRef = useRef(null);
|
57
|
-
const isBottomPosition = position === EDrawerPosition.BOTTOM;
|
58
|
-
const isMobile = useMediaQuery(EMediaQuery.XS1);
|
59
|
-
useLockBodyScroll({
|
60
|
-
on: isBodyScrollLocked,
|
61
|
-
paddingRight
|
62
|
-
});
|
63
|
-
const handleClose = useCallback(() => {
|
64
|
-
if (onClose) {
|
65
|
-
setIsClosing(true);
|
66
|
-
setIsBodyScrollLocked(false);
|
67
|
-
timerRef.current = setTimeout(() => {
|
68
|
-
onClose();
|
69
|
-
setIsClosing(false);
|
70
|
-
}, ANIMATION_DELAY);
|
71
|
-
}
|
72
|
-
}, [onClose]);
|
73
|
-
const handleKeyDown = useCallback(
|
74
|
-
(event) => {
|
75
|
-
if (event.key === "Escape") {
|
76
|
-
handleClose();
|
77
|
-
}
|
78
|
-
},
|
79
|
-
[handleClose]
|
80
|
-
);
|
81
|
-
useEffect(() => {
|
82
|
-
if (isOpen) {
|
83
|
-
setIsBodyScrollLocked(true);
|
84
|
-
setIsMounted(true);
|
85
|
-
window.addEventListener("keydown", handleKeyDown);
|
86
|
-
}
|
87
|
-
return () => {
|
88
|
-
setIsMounted(false);
|
89
|
-
clearTimeout(timerRef.current);
|
90
|
-
window.removeEventListener("keydown", handleKeyDown);
|
91
|
-
};
|
92
|
-
}, [isOpen, handleKeyDown]);
|
93
|
-
const mods = {
|
94
|
-
[cls.opened]: isMounted,
|
95
|
-
[cls["is-closing"]]: isClosing
|
96
|
-
};
|
97
|
-
if (!isOpen) {
|
98
|
-
return null;
|
99
|
-
}
|
100
|
-
return /* @__PURE__ */ jsxs(Portal, { children: [
|
101
|
-
/* @__PURE__ */ jsx(
|
102
|
-
"div",
|
103
|
-
{
|
104
|
-
"aria-hidden": isOpen,
|
105
|
-
role: "dialog",
|
106
|
-
style: {
|
107
|
-
minHeight: isBottomPosition && contentRef.current ? contentRef.current.offsetHeight : void 0
|
108
|
-
},
|
109
|
-
className: classNames(cls.drawer, cls[position], mods, className),
|
110
|
-
children: /* @__PURE__ */ jsxs("section", { className: classNames(cls.content, cls[position]), children: [
|
111
|
-
/* @__PURE__ */ jsxs("header", { className: cls.header, children: [
|
112
|
-
/* @__PURE__ */ jsx("h2", { className: cls.title, children: title2 }),
|
113
|
-
/* @__PURE__ */ jsx("div", { className: cls.space, children: /* @__PURE__ */ jsx(
|
114
|
-
Button,
|
115
|
-
{
|
116
|
-
variant: EButtonVariantDefault.SecondaryWhite,
|
117
|
-
isIconButton: true,
|
118
|
-
size: isMobile ? EButtonSize.S : EButtonSize.M,
|
119
|
-
iconName: "Close16px",
|
120
|
-
onClick: handleClose,
|
121
|
-
className: cls.button
|
122
|
-
}
|
123
|
-
) })
|
124
|
-
] }),
|
125
|
-
/* @__PURE__ */ jsx("div", { ref: contentRef, className: cls.inner, children }),
|
126
|
-
/* @__PURE__ */ jsx("footer", { className: cls.footer, children: footer2 || /* @__PURE__ */ jsx(
|
127
|
-
Button,
|
128
|
-
{
|
129
|
-
size: isMobile ? EButtonSize.M : EButtonSize.XXL,
|
130
|
-
full: isMobile,
|
131
|
-
onClick: handleClose,
|
132
|
-
className: cls["footer-button"],
|
133
|
-
children: "Закрыть"
|
134
|
-
}
|
135
|
-
) })
|
136
|
-
] })
|
137
|
-
}
|
138
|
-
),
|
139
|
-
/* @__PURE__ */ jsx("div", { className: classNames(cls.overlay, mods), onClick: handleClose })
|
140
|
-
] });
|
141
|
-
};
|
142
|
-
export {
|
143
|
-
Drawer
|
144
|
-
};
|
@@ -1,9 +0,0 @@
|
|
1
|
-
var EDrawerPosition = /* @__PURE__ */ ((EDrawerPosition2) => {
|
2
|
-
EDrawerPosition2["LEFT"] = "left";
|
3
|
-
EDrawerPosition2["RIGHT"] = "right";
|
4
|
-
EDrawerPosition2["BOTTOM"] = "bottom";
|
5
|
-
return EDrawerPosition2;
|
6
|
-
})(EDrawerPosition || {});
|
7
|
-
export {
|
8
|
-
EDrawerPosition
|
9
|
-
};
|
@@ -1 +0,0 @@
|
|
1
|
-
export { Portal } from './Portal';
|
@@ -1 +0,0 @@
|
|
1
|
-
export { useLockBodyScroll } from './useLockBodyScroll';
|
@@ -1,20 +0,0 @@
|
|
1
|
-
import { useLayoutEffect } from "react";
|
2
|
-
function useLockBodyScroll({ on, paddingRight }) {
|
3
|
-
useLayoutEffect(() => {
|
4
|
-
const hasVerticalScrollbar = document.documentElement.scrollHeight > document.documentElement.clientHeight;
|
5
|
-
if (!on || !hasVerticalScrollbar) return;
|
6
|
-
const originalStyle = window.getComputedStyle(document.body).overflow;
|
7
|
-
const originalPaddingStyle = window.getComputedStyle(
|
8
|
-
document.body
|
9
|
-
).paddingRight;
|
10
|
-
document.body.style.overflow = "hidden";
|
11
|
-
document.body.style.paddingRight = `${paddingRight}px`;
|
12
|
-
return () => {
|
13
|
-
document.body.style.overflow = originalStyle;
|
14
|
-
document.body.style.paddingRight = originalPaddingStyle;
|
15
|
-
};
|
16
|
-
}, [on, paddingRight]);
|
17
|
-
}
|
18
|
-
export {
|
19
|
-
useLockBodyScroll
|
20
|
-
};
|