mimir-ui-kit 1.9.1 → 1.10.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (105) hide show
  1. package/README.md +62 -54
  2. package/dist/{NavigationButtons-cTsXB7GS.js → NavigationButtons-B8tMfqrg.js} +18 -18
  3. package/dist/assets/Button.css +1 -1
  4. package/dist/assets/Input.css +1 -1
  5. package/dist/assets/OtpInput.css +1 -1
  6. package/dist/assets/RadioGroup.css +1 -1
  7. package/dist/assets/Slider.css +1 -1
  8. package/dist/assets/index.css +1 -1
  9. package/dist/components/Button/Button.d.ts +1 -0
  10. package/dist/components/Button/Button.js +25 -25
  11. package/dist/components/Input/Input.d.ts +2 -2
  12. package/dist/components/Input/Input.js +15 -15
  13. package/dist/components/InputPassword/InputPassword.js +2 -2
  14. package/dist/components/InputPhoneNumber/InputPhoneNumber.js +1 -1
  15. package/dist/components/MergedButton/MergedButton.d.ts +1 -1
  16. package/dist/components/MergedButton/MergedButton.js +2 -2
  17. package/dist/components/OtpInput/OtpInput.js +6 -6
  18. package/dist/components/RadioGroup/RadioGroup.d.ts +2 -18
  19. package/dist/components/RadioGroup/RadioGroup.js +1061 -127
  20. package/dist/components/RadioGroup/index.d.ts +1 -1
  21. package/dist/components/Slider/NavigationButtons/NavigationButtons.js +1 -1
  22. package/dist/components/Slider/NavigationButtons/index.js +1 -1
  23. package/dist/components/Slider/Slider.js +10 -10
  24. package/dist/components/Tag/Tag.d.ts +79 -0
  25. package/dist/components/Tag/Tag.js +99 -0
  26. package/dist/components/Tag/constants.d.ts +41 -0
  27. package/dist/components/Tag/constants.js +55 -0
  28. package/dist/components/Tag/index.d.ts +3 -0
  29. package/dist/components/Tag/index.js +8 -0
  30. package/dist/components/Tag/types.d.ts +6 -0
  31. package/dist/components/Tag/types.js +1 -0
  32. package/dist/components/index.d.ts +1 -10
  33. package/dist/components/index.js +0 -14
  34. package/dist/hooks/index.d.ts +0 -3
  35. package/dist/hooks/index.js +1 -7
  36. package/dist/index.d.ts +0 -1
  37. package/dist/index.js +1 -23
  38. package/package.json +128 -127
  39. package/dist/DatePickerModal-DUUCHAWF.js +0 -204
  40. package/dist/assets/DatePickerModal.css +0 -1
  41. package/dist/assets/Drawer.css +0 -1
  42. package/dist/assets/SelectSearch.css +0 -1
  43. package/dist/assets/Switch.css +0 -1
  44. package/dist/assets/Timer.css +0 -1
  45. package/dist/components/DatePicker/DatePicker.d.ts +0 -44
  46. package/dist/components/DatePicker/DatePicker.js +0 -69
  47. package/dist/components/DatePicker/DatePickerModal.d.ts +0 -8
  48. package/dist/components/DatePicker/DatePickerModal.js +0 -9
  49. package/dist/components/DatePicker/constants.d.ts +0 -6
  50. package/dist/components/DatePicker/constants.js +0 -11
  51. package/dist/components/DatePicker/index.d.ts +0 -2
  52. package/dist/components/DatePicker/index.js +0 -4
  53. package/dist/components/Drawer/Drawer.d.ts +0 -38
  54. package/dist/components/Drawer/Drawer.js +0 -144
  55. package/dist/components/Drawer/constants.d.ts +0 -5
  56. package/dist/components/Drawer/constants.js +0 -9
  57. package/dist/components/Drawer/index.d.ts +0 -2
  58. package/dist/components/Drawer/index.js +0 -6
  59. package/dist/components/Portal/Portal.d.ts +0 -7
  60. package/dist/components/Portal/Portal.js +0 -10
  61. package/dist/components/Portal/index.d.ts +0 -1
  62. package/dist/components/Portal/index.js +0 -4
  63. package/dist/components/SelectSearch/SelectSearch.d.ts +0 -15
  64. package/dist/components/SelectSearch/SelectSearch.js +0 -3961
  65. package/dist/components/SelectSearch/constants.d.ts +0 -4
  66. package/dist/components/SelectSearch/constants.js +0 -8
  67. package/dist/components/SelectSearch/index.d.ts +0 -2
  68. package/dist/components/SelectSearch/index.js +0 -6
  69. package/dist/components/Switch/Switch.d.ts +0 -294
  70. package/dist/components/Switch/Switch.js +0 -57
  71. package/dist/components/Switch/index.d.ts +0 -2
  72. package/dist/components/Switch/index.js +0 -4
  73. package/dist/components/Timer/Timer.d.ts +0 -24
  74. package/dist/components/Timer/Timer.js +0 -29
  75. package/dist/components/Timer/index.d.ts +0 -1
  76. package/dist/components/Timer/index.js +0 -4
  77. package/dist/focus-management-CFDo6ZSc.js +0 -91
  78. package/dist/hooks/useClickOutside/index.d.ts +0 -1
  79. package/dist/hooks/useClickOutside/index.js +0 -4
  80. package/dist/hooks/useClickOutside/useClickOutside.d.ts +0 -7
  81. package/dist/hooks/useClickOutside/useClickOutside.js +0 -25
  82. package/dist/hooks/useInterval/index.d.ts +0 -1
  83. package/dist/hooks/useInterval/index.js +0 -4
  84. package/dist/hooks/useInterval/useInterval.d.ts +0 -1
  85. package/dist/hooks/useInterval/useInterval.js +0 -17
  86. package/dist/hooks/useLockBodyScroll/index.d.ts +0 -1
  87. package/dist/hooks/useLockBodyScroll/index.js +0 -4
  88. package/dist/hooks/useLockBodyScroll/useLockBodyScroll.d.ts +0 -6
  89. package/dist/hooks/useLockBodyScroll/useLockBodyScroll.js +0 -20
  90. package/dist/hooks/useTimer/index.d.ts +0 -18
  91. package/dist/hooks/useTimer/index.js +0 -83
  92. package/dist/hooks/useTimer/useTimer.d.ts +0 -18
  93. package/dist/hooks/useTimer/useTimer.js +0 -87
  94. package/dist/hooks/useTimer/utils.d.ts +0 -24
  95. package/dist/hooks/useTimer/utils.js +0 -88
  96. package/dist/label-BXAcSLy0.js +0 -913
  97. package/dist/use-active-press-9MCrfRZk.js +0 -31
  98. package/dist/utils/formating/Date.d.ts +0 -1
  99. package/dist/utils/formating/Date.js +0 -26
  100. package/dist/utils/formating/Month.d.ts +0 -8
  101. package/dist/utils/formating/Month.js +0 -80
  102. package/dist/utils/formating/Numbers.d.ts +0 -6
  103. package/dist/utils/formating/Numbers.js +0 -8
  104. package/dist/utils/index.d.ts +0 -9
  105. package/dist/utils/index.js +0 -11
@@ -1,4 +0,0 @@
1
- import { DatePicker } from "./DatePicker.js";
2
- export {
3
- DatePicker
4
- };
@@ -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,5 +0,0 @@
1
- export declare enum EDrawerPosition {
2
- LEFT = "left",
3
- RIGHT = "right",
4
- BOTTOM = "bottom"
5
- }
@@ -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,2 +0,0 @@
1
- export { Drawer } from './Drawer';
2
- export { EDrawerPosition } from './constants';
@@ -1,6 +0,0 @@
1
- import { Drawer } from "./Drawer.js";
2
- import { EDrawerPosition } from "./constants.js";
3
- export {
4
- Drawer,
5
- EDrawerPosition
6
- };
@@ -1,7 +0,0 @@
1
- import { PropsWithChildren } from 'react';
2
-
3
- type TProps = {
4
- element?: HTMLElement;
5
- };
6
- export declare const Portal: ({ element, children }: PropsWithChildren<TProps>) => import('react').ReactPortal;
7
- export {};
@@ -1,10 +0,0 @@
1
- import { createPortal } from "react-dom";
2
- const Portal = ({
3
- element = document.body,
4
- children
5
- }) => {
6
- return createPortal(children, element);
7
- };
8
- export {
9
- Portal
10
- };
@@ -1 +0,0 @@
1
- export { Portal } from './Portal';
@@ -1,4 +0,0 @@
1
- import { Portal } from "./Portal.js";
2
- export {
3
- Portal
4
- };
@@ -1,15 +0,0 @@
1
- import { ESelectSearchSize } from './constants';
2
-
3
- export type TSelectSearchItem = {
4
- id: number;
5
- name: string;
6
- };
7
- export type TSelectSearchProps = {
8
- items: TSelectSearchItem[];
9
- value?: TSelectSearchItem | null;
10
- onChange?: (value: TSelectSearchItem | null) => void;
11
- placeholder?: string;
12
- size?: ESelectSearchSize;
13
- full?: boolean;
14
- };
15
- export declare const SelectSearch: import('react').ForwardRefExoticComponent<TSelectSearchProps & import('react').RefAttributes<HTMLElement>>;