@prom-ui/core 0.0.121 → 0.0.131

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.
Files changed (116) hide show
  1. package/Avatar/cjs/index.development.js +9 -19
  2. package/Avatar/cjs/index.development.v2.js +9 -19
  3. package/Avatar/package.json +1 -1
  4. package/Body/package.json +1 -1
  5. package/BodyProvider/BodyContext.d.ts +5 -0
  6. package/BodyProvider/cjs/index.development.js +264 -0
  7. package/BodyProvider/cjs/index.development.v2.js +264 -0
  8. package/BodyProvider/cjs/index.production.js +1 -0
  9. package/BodyProvider/cjs/index.production.v2.js +1 -0
  10. package/BodyProvider/index.d.ts +9 -0
  11. package/BodyProvider/index.js +7 -0
  12. package/BodyProvider/index.v2.js +7 -0
  13. package/BodyProvider/package.json +12 -0
  14. package/BodyProvider/useBodyLocale.d.ts +2 -0
  15. package/Box/package.json +1 -1
  16. package/Button/cjs/index.development.js +3 -4
  17. package/Button/cjs/index.development.v2.js +3 -4
  18. package/Button/package.json +1 -1
  19. package/ButtonPageUp/cjs/index.development.js +16 -20
  20. package/ButtonPageUp/cjs/index.development.v2.js +16 -20
  21. package/ButtonPageUp/cjs/index.production.js +1 -1
  22. package/ButtonPageUp/cjs/index.production.v2.js +1 -1
  23. package/ButtonPageUp/package.json +2 -3
  24. package/Checkbox/cjs/index.development.js +5 -7
  25. package/Checkbox/cjs/index.development.v2.js +5 -7
  26. package/Checkbox/package.json +1 -1
  27. package/Flex/package.json +1 -1
  28. package/Grid/package.json +1 -1
  29. package/Icon/cjs/index.development.js +1 -1
  30. package/Icon/cjs/index.development.v2.js +1 -1
  31. package/Icon/cjs/index.production.js +1 -1
  32. package/Icon/cjs/index.production.v2.js +1 -1
  33. package/Icon/cjs/style.development.css +1 -1
  34. package/Icon/cjs/style.development.v2.css +1 -1
  35. package/Icon/cjs/style.production.css +1 -1
  36. package/Icon/cjs/style.production.v2.css +1 -1
  37. package/Icon/index.d.ts +1 -1
  38. package/Icon/package.json +1 -1
  39. package/Image/package.json +1 -1
  40. package/ImageEmoji/cjs/index.development.js +7 -8
  41. package/ImageEmoji/cjs/index.development.v2.js +7 -8
  42. package/ImageEmoji/package.json +1 -1
  43. package/Input/package.json +1 -1
  44. package/InputField/cjs/index.development.js +33 -44
  45. package/InputField/cjs/index.development.v2.js +33 -44
  46. package/InputField/cjs/index.production.js +1 -1
  47. package/InputField/cjs/index.production.v2.js +1 -1
  48. package/InputField/package.json +1 -1
  49. package/KeyPress/cjs/index.development.js +8 -11
  50. package/KeyPress/cjs/index.development.v2.js +8 -11
  51. package/KeyPress/package.json +1 -1
  52. package/Line/package.json +1 -1
  53. package/Link/cjs/index.development.js +0 -1
  54. package/Link/cjs/index.development.v2.js +0 -1
  55. package/Link/package.json +1 -1
  56. package/List/package.json +1 -1
  57. package/Media/cjs/index.development.js +12 -18
  58. package/Media/cjs/index.development.v2.js +12 -18
  59. package/Media/package.json +1 -1
  60. package/OutsideClick/cjs/index.development.js +4 -7
  61. package/OutsideClick/cjs/index.development.v2.js +4 -7
  62. package/OutsideClick/package.json +1 -1
  63. package/Overlay/cjs/index.development.js +67 -90
  64. package/Overlay/cjs/index.development.v2.js +67 -90
  65. package/Overlay/cjs/index.production.js +1 -1
  66. package/Overlay/cjs/index.production.v2.js +1 -1
  67. package/Overlay/package.json +2 -3
  68. package/Picture/package.json +1 -1
  69. package/PortableOverlay/cjs/index.development.js +19 -20
  70. package/PortableOverlay/cjs/index.development.v2.js +19 -20
  71. package/PortableOverlay/package.json +1 -1
  72. package/Portal/cjs/index.development.js +5 -10
  73. package/Portal/cjs/index.development.v2.js +5 -10
  74. package/Portal/package.json +1 -1
  75. package/QRCode/cjs/index.development.js +8 -8
  76. package/QRCode/cjs/index.development.v2.js +8 -8
  77. package/QRCode/package.json +1 -1
  78. package/Rating/cjs/index.development.js +8 -9
  79. package/Rating/cjs/index.development.v2.js +8 -9
  80. package/Rating/package.json +1 -1
  81. package/SafeQuery/cjs/index.development.js +19 -19
  82. package/SafeQuery/cjs/index.development.v2.js +19 -19
  83. package/SafeQuery/cjs/index.production.js +1 -1
  84. package/SafeQuery/cjs/index.production.v2.js +1 -1
  85. package/SafeQuery/package.json +1 -1
  86. package/Scroll/package.json +1 -1
  87. package/ScrollControls/cjs/index.development.js +37 -51
  88. package/ScrollControls/cjs/index.development.v2.js +37 -51
  89. package/ScrollControls/cjs/index.production.js +1 -1
  90. package/ScrollControls/cjs/index.production.v2.js +1 -1
  91. package/ScrollControls/package.json +2 -3
  92. package/SideOverlay/cjs/index.development.js +40 -41
  93. package/SideOverlay/cjs/index.development.v2.js +40 -41
  94. package/SideOverlay/cjs/index.production.js +1 -1
  95. package/SideOverlay/cjs/index.production.v2.js +1 -1
  96. package/SideOverlay/package.json +2 -3
  97. package/SimpleSlider/cjs/index.development.js +53 -89
  98. package/SimpleSlider/cjs/index.development.v2.js +53 -89
  99. package/SimpleSlider/cjs/index.production.js +1 -1
  100. package/SimpleSlider/cjs/index.production.v2.js +1 -1
  101. package/SimpleSlider/package.json +2 -3
  102. package/Skeleton/cjs/index.development.js +10 -11
  103. package/Skeleton/cjs/index.development.v2.js +10 -11
  104. package/Skeleton/package.json +1 -1
  105. package/Spinner/package.json +1 -1
  106. package/Text/package.json +1 -1
  107. package/TextEmoji/cjs/index.development.js +5 -6
  108. package/TextEmoji/cjs/index.development.v2.js +5 -6
  109. package/TextEmoji/package.json +1 -1
  110. package/Tooltip/cjs/index.development.js +53 -55
  111. package/Tooltip/cjs/index.development.v2.js +53 -55
  112. package/Tooltip/package.json +1 -1
  113. package/Tumbler/cjs/index.development.js +5 -7
  114. package/Tumbler/cjs/index.development.v2.js +5 -7
  115. package/Tumbler/package.json +1 -1
  116. package/package.json +6 -3
@@ -27,21 +27,19 @@ var React__namespace = /*#__PURE__*/_interopNamespace(React);
27
27
 
28
28
  var KeyPressApp = function (_a) {
29
29
  var code = _a.code,
30
- onKeyDown = _a.onKeyDown,
31
- onKeyUp = _a.onKeyUp;
30
+ onKeyDown = _a.onKeyDown,
31
+ onKeyUp = _a.onKeyUp;
32
32
  useKeyPress.useKeyPress(code, onKeyDown, onKeyUp);
33
33
  return null;
34
34
  };
35
-
36
35
  var KeyPress = function (_a) {
37
36
  var _b = _a.isActive,
38
- isActive = _b === void 0 ? true : _b,
39
- code = _a.code,
40
- _c = _a.onKeyDown,
41
- onKeyDown = _c === void 0 ? function () {} : _c,
42
- _d = _a.onKeyUp,
43
- onKeyUp = _d === void 0 ? function () {} : _d;
44
-
37
+ isActive = _b === void 0 ? true : _b,
38
+ code = _a.code,
39
+ _c = _a.onKeyDown,
40
+ onKeyDown = _c === void 0 ? function () {} : _c,
41
+ _d = _a.onKeyUp,
42
+ onKeyUp = _d === void 0 ? function () {} : _d;
45
43
  if (isActive) {
46
44
  return React__namespace.createElement(KeyPressApp, {
47
45
  code: code,
@@ -49,7 +47,6 @@ var KeyPress = function (_a) {
49
47
  onKeyUp: onKeyUp
50
48
  });
51
49
  }
52
-
53
50
  return null;
54
51
  };
55
52
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/KeyPress",
3
- "version": "0.0.121",
3
+ "version": "0.0.131",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
package/Line/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/Line",
3
- "version": "0.0.121",
3
+ "version": "0.0.131",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
@@ -11,7 +11,6 @@ evokitLink.Link.defaultProps = {
11
11
  css: css
12
12
  },
13
13
  onTouchStart: function () {} // force css :active for ios
14
-
15
14
  };
16
15
 
17
16
  Object.defineProperty(exports, 'Link', {
@@ -11,7 +11,6 @@ evokitLink.Link.defaultProps = {
11
11
  css: css
12
12
  },
13
13
  onTouchStart: function () {} // force css :active for ios
14
-
15
14
  };
16
15
 
17
16
  Object.defineProperty(exports, 'Link', {
package/Link/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/Link",
3
- "version": "0.0.121",
3
+ "version": "0.0.131",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
package/List/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/List",
3
- "version": "0.0.121",
3
+ "version": "0.0.131",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
@@ -25,7 +25,6 @@ var SCREEN_BREAKPOINTS_PROXY = new Proxy(SCREEN_BREAKPOINTS, {
25
25
  var keyListStr = JSON.stringify(Object.keys(target));
26
26
  throw new Error("Media received unknown width \"".concat(key, "\". You should use one of ").concat(keyListStr));
27
27
  }
28
-
29
28
  return target[key];
30
29
  }
31
30
  });
@@ -34,13 +33,12 @@ var getBreakPoint = function (key) {
34
33
  if (process.env.NODE_ENV !== 'production') {
35
34
  return SCREEN_BREAKPOINTS_PROXY[key];
36
35
  }
37
-
38
36
  return SCREEN_BREAKPOINTS[key];
39
37
  };
40
38
 
41
39
  var useMedia = function (_a) {
42
40
  var minWidth = _a.minWidth,
43
- maxWidth = _a.maxWidth;
41
+ maxWidth = _a.maxWidth;
44
42
  return reactResponsive.useMediaQuery({
45
43
  minWidth: minWidth ? getBreakPoint(minWidth) : MIN_SCREEN_WIDTH,
46
44
  maxWidth: maxWidth ? getBreakPoint(maxWidth) - 1 : undefined
@@ -49,16 +47,14 @@ var useMedia = function (_a) {
49
47
 
50
48
  var MediaProvider = function (_a) {
51
49
  var _b = _a.resetOnMount,
52
- resetOnMount = _b === void 0 ? false : _b,
53
- width = _a.width,
54
- children = _a.children;
55
-
50
+ resetOnMount = _b === void 0 ? false : _b,
51
+ width = _a.width,
52
+ children = _a.children;
56
53
  var _c = React.useState({
57
- width: width ? getBreakPoint(width) : MIN_SCREEN_WIDTH
58
- }),
59
- value = _c[0],
60
- setValue = _c[1];
61
-
54
+ width: width ? getBreakPoint(width) : MIN_SCREEN_WIDTH
55
+ }),
56
+ value = _c[0],
57
+ setValue = _c[1];
62
58
  React.useEffect(function () {
63
59
  if (resetOnMount) {
64
60
  setValue(undefined);
@@ -67,10 +63,10 @@ var MediaProvider = function (_a) {
67
63
  return React__default["default"].createElement(reactResponsive.Context.Provider, {
68
64
  value: value
69
65
  }, children);
70
- }; // MediaProvider.defaultProps = {
66
+ };
67
+ // MediaProvider.defaultProps = {
71
68
  // resetOnMount: false,
72
69
  // };
73
-
74
70
  MediaProvider.propTypes = {
75
71
  resetOnMount: PropTypes__default["default"].bool,
76
72
  // children: PropTypes.node.isRequired,
@@ -79,17 +75,15 @@ MediaProvider.propTypes = {
79
75
 
80
76
  var Media = function (_a) {
81
77
  var minWidth = _a.minWidth,
82
- maxWidth = _a.maxWidth,
83
- children = _a.children;
78
+ maxWidth = _a.maxWidth,
79
+ children = _a.children;
84
80
  var matchMedia = useMedia({
85
81
  minWidth: minWidth,
86
82
  maxWidth: maxWidth
87
83
  });
88
-
89
84
  if (matchMedia) {
90
85
  return children;
91
86
  }
92
-
93
87
  return null;
94
88
  };
95
89
 
@@ -25,7 +25,6 @@ var SCREEN_BREAKPOINTS_PROXY = new Proxy(SCREEN_BREAKPOINTS, {
25
25
  var keyListStr = JSON.stringify(Object.keys(target));
26
26
  throw new Error("Media received unknown width \"".concat(key, "\". You should use one of ").concat(keyListStr));
27
27
  }
28
-
29
28
  return target[key];
30
29
  }
31
30
  });
@@ -34,13 +33,12 @@ var getBreakPoint = function (key) {
34
33
  if (process.env.NODE_ENV !== 'production') {
35
34
  return SCREEN_BREAKPOINTS_PROXY[key];
36
35
  }
37
-
38
36
  return SCREEN_BREAKPOINTS[key];
39
37
  };
40
38
 
41
39
  var useMedia = function (_a) {
42
40
  var minWidth = _a.minWidth,
43
- maxWidth = _a.maxWidth;
41
+ maxWidth = _a.maxWidth;
44
42
  return reactResponsive.useMediaQuery({
45
43
  minWidth: minWidth ? getBreakPoint(minWidth) : MIN_SCREEN_WIDTH,
46
44
  maxWidth: maxWidth ? getBreakPoint(maxWidth) - 1 : undefined
@@ -49,16 +47,14 @@ var useMedia = function (_a) {
49
47
 
50
48
  var MediaProvider = function (_a) {
51
49
  var _b = _a.resetOnMount,
52
- resetOnMount = _b === void 0 ? false : _b,
53
- width = _a.width,
54
- children = _a.children;
55
-
50
+ resetOnMount = _b === void 0 ? false : _b,
51
+ width = _a.width,
52
+ children = _a.children;
56
53
  var _c = React.useState({
57
- width: width ? getBreakPoint(width) : MIN_SCREEN_WIDTH
58
- }),
59
- value = _c[0],
60
- setValue = _c[1];
61
-
54
+ width: width ? getBreakPoint(width) : MIN_SCREEN_WIDTH
55
+ }),
56
+ value = _c[0],
57
+ setValue = _c[1];
62
58
  React.useEffect(function () {
63
59
  if (resetOnMount) {
64
60
  setValue(undefined);
@@ -67,10 +63,10 @@ var MediaProvider = function (_a) {
67
63
  return React__default["default"].createElement(reactResponsive.Context.Provider, {
68
64
  value: value
69
65
  }, children);
70
- }; // MediaProvider.defaultProps = {
66
+ };
67
+ // MediaProvider.defaultProps = {
71
68
  // resetOnMount: false,
72
69
  // };
73
-
74
70
  MediaProvider.propTypes = {
75
71
  resetOnMount: PropTypes__default["default"].bool,
76
72
  // children: PropTypes.node.isRequired,
@@ -79,17 +75,15 @@ MediaProvider.propTypes = {
79
75
 
80
76
  var Media = function (_a) {
81
77
  var minWidth = _a.minWidth,
82
- maxWidth = _a.maxWidth,
83
- children = _a.children;
78
+ maxWidth = _a.maxWidth,
79
+ children = _a.children;
84
80
  var matchMedia = useMedia({
85
81
  minWidth: minWidth,
86
82
  maxWidth: maxWidth
87
83
  });
88
-
89
84
  if (matchMedia) {
90
85
  return children;
91
86
  }
92
-
93
87
  return null;
94
88
  };
95
89
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/Media",
3
- "version": "0.0.121",
3
+ "version": "0.0.131",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
@@ -65,17 +65,14 @@ function __rest(s, e) {
65
65
 
66
66
  var OutsideClick = function (_a) {
67
67
  var children = _a.children,
68
- _b = _a.isActive,
69
- isActive = _b === void 0 ? true : _b,
70
- onClick = _a.onClick,
71
- props = __rest(_a, ["children", "isActive", "onClick"]);
72
-
68
+ _b = _a.isActive,
69
+ isActive = _b === void 0 ? true : _b,
70
+ onClick = _a.onClick,
71
+ props = __rest(_a, ["children", "isActive", "onClick"]);
73
72
  var ref = useOutsideClick.useOutsideClick(onClick)[0];
74
-
75
73
  if (!isActive) {
76
74
  return React__namespace.createElement("div", null, children);
77
75
  }
78
-
79
76
  return React__namespace.createElement("div", __assign({}, props, {
80
77
  ref: ref
81
78
  }), children);
@@ -65,17 +65,14 @@ function __rest(s, e) {
65
65
 
66
66
  var OutsideClick = function (_a) {
67
67
  var children = _a.children,
68
- _b = _a.isActive,
69
- isActive = _b === void 0 ? true : _b,
70
- onClick = _a.onClick,
71
- props = __rest(_a, ["children", "isActive", "onClick"]);
72
-
68
+ _b = _a.isActive,
69
+ isActive = _b === void 0 ? true : _b,
70
+ onClick = _a.onClick,
71
+ props = __rest(_a, ["children", "isActive", "onClick"]);
73
72
  var ref = useOutsideClick.useOutsideClick(onClick)[0];
74
-
75
73
  if (!isActive) {
76
74
  return React__namespace.createElement("div", null, children);
77
75
  }
78
-
79
76
  return React__namespace.createElement("div", __assign({}, props, {
80
77
  ref: ref
81
78
  }), children);
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/OutsideClick",
3
- "version": "0.0.121",
3
+ "version": "0.0.131",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
@@ -7,12 +7,12 @@ var ScrollLock = require('react-scrolllock');
7
7
  var KeyPress = require('@prom-ui/core/KeyPress');
8
8
  var Portal = require('@prom-ui/core/Portal');
9
9
  var Media = require('@prom-ui/core/Media');
10
- var ttag = require('ttag');
11
10
  var evokit = require('evokit');
12
11
  var reactTransitionGroup = require('react-transition-group');
13
- var Text = require('@prom-ui/core/Text');
14
12
  var Button = require('@prom-ui/core/Button');
15
13
  var Icon = require('@prom-ui/core/Icon');
14
+ var Text = require('@prom-ui/core/Text');
15
+ var BodyProvider = require('@prom-ui/core/BodyProvider');
16
16
  var Close = require('@prom-ui/icons/Close');
17
17
  var ArrowBack = require('@prom-ui/icons/ArrowBack');
18
18
  var utils = require('react-scrolllock/dist/utils');
@@ -98,13 +98,13 @@ var Popup = evokit.createBlock('div', 'popup', ['placement'], BLOCKS_PRESET);
98
98
  var OverlayContent = evokit.createBlock('div', 'content', [], BLOCKS_PRESET);
99
99
  var Animate = function (_a) {
100
100
  var _b = _a.open,
101
- open = _b === void 0 ? false : _b,
102
- children = _a.children,
103
- _c = _a.enabled,
104
- enabled = _c === void 0 ? true : _c,
105
- onEnter = _a.onEnter,
106
- onEntered = _a.onEntered,
107
- onExited = _a.onExited;
101
+ open = _b === void 0 ? false : _b,
102
+ children = _a.children,
103
+ _c = _a.enabled,
104
+ enabled = _c === void 0 ? true : _c,
105
+ onEnter = _a.onEnter,
106
+ onEntered = _a.onEntered,
107
+ onExited = _a.onExited;
108
108
  return React__default["default"].createElement(reactTransitionGroup.CSSTransition, {
109
109
  in: open,
110
110
  timeout: enabled ? 225 : 0,
@@ -117,11 +117,12 @@ var Animate = function (_a) {
117
117
  };
118
118
  var OverlayHeader = function (_a) {
119
119
  var isShowPrevButton = _a.isShowPrevButton,
120
- isShowCloseButton = _a.isShowCloseButton,
121
- children = _a.children,
122
- title = _a.title,
123
- onClose = _a.onClose,
124
- onPrev = _a.onPrev;
120
+ isShowCloseButton = _a.isShowCloseButton,
121
+ children = _a.children,
122
+ title = _a.title,
123
+ onClose = _a.onClose,
124
+ onPrev = _a.onPrev;
125
+ var t = BodyProvider.useBodyLocale().t;
125
126
  return React__default["default"].createElement("div", {
126
127
  className: css.header
127
128
  }, typeof children !== 'undefined' ? children : React__default["default"].createElement("div", {
@@ -133,7 +134,7 @@ var OverlayHeader = function (_a) {
133
134
  "button-theme": 'black-inherit',
134
135
  type: 'button',
135
136
  onClick: onPrev,
136
- "aria-label": ttag.t(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\u041D\u0430\u0437\u0430\u0434"], ["\u041D\u0430\u0437\u0430\u0434"]))),
137
+ "aria-label": t(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\u041D\u0430\u0437\u0430\u0434"], ["\u041D\u0430\u0437\u0430\u0434"]))),
137
138
  "data-qaid": 'prev'
138
139
  }, React__default["default"].createElement(Icon.Icon, {
139
140
  "icon-as": ArrowBack.ArrowBack,
@@ -153,7 +154,7 @@ var OverlayHeader = function (_a) {
153
154
  "button-theme": 'black-inherit',
154
155
  type: 'button',
155
156
  onClick: onClose,
156
- "aria-label": ttag.t(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\u0417\u0430\u043A\u0440\u044B\u0442\u044C"], ["\u0417\u0430\u043A\u0440\u044B\u0442\u044C"]))),
157
+ "aria-label": t(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\u0417\u0430\u043A\u0440\u044B\u0442\u044C"], ["\u0417\u0430\u043A\u0440\u044B\u0442\u044C"]))),
157
158
  "data-qaid": 'close'
158
159
  }, React__default["default"].createElement(Icon.Icon, {
159
160
  "icon-as": Close.Close,
@@ -175,7 +176,6 @@ var getPopupStyle = function (placement, size, maxSize) {
175
176
  maxHeight: maxSize
176
177
  };
177
178
  }
178
-
179
179
  return {
180
180
  width: size,
181
181
  maxWidth: maxSize
@@ -185,13 +185,12 @@ var getPopupStyle = function (placement, size, maxSize) {
185
185
  // FORK FROM https://github.com/jossmac/react-scrolllock/blob/master/src/TouchScrollable.js
186
186
  var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
187
187
  /* @ts-ignore */
188
-
189
188
  var canUseEventListeners = canUseDOM && !!(window.addEventListener || window.attachEvent);
190
189
  var TouchScrollable = function (_a) {
191
190
  var _b = _a.isActive,
192
- isActive = _b === void 0 ? false : _b,
193
- scrollRef = _a.scrollRef,
194
- children = _a.children;
191
+ isActive = _b === void 0 ? false : _b,
192
+ scrollRef = _a.scrollRef,
193
+ children = _a.children;
195
194
  React__namespace.useEffect(function () {
196
195
  if (!isActive || !canUseEventListeners || !(scrollRef === null || scrollRef === void 0 ? void 0 : scrollRef.current)) return;
197
196
  scrollRef.current.addEventListener('touchstart', utils.preventInertiaScroll, utils.listenerOptions);
@@ -207,16 +206,12 @@ var TouchScrollable = function (_a) {
207
206
 
208
207
  var VENDOR_PREFIX = ['-webkit', '-moz', '-ms', '-o'];
209
208
  var PROPERTYES_VENDOR_PREFIX = ['transform', 'transition'];
210
-
211
209
  var setStyle = function (element, style) {
212
210
  if (!element) return;
213
-
214
211
  for (var property in style) {
215
212
  var isVendorPrefix = PROPERTYES_VENDOR_PREFIX.indexOf(property) !== -1;
216
-
217
213
  if (!!!style[property]) {
218
214
  element.style.removeProperty(property);
219
-
220
215
  if (isVendorPrefix) {
221
216
  for (var _i = 0, VENDOR_PREFIX_1 = VENDOR_PREFIX; _i < VENDOR_PREFIX_1.length; _i++) {
222
217
  var vendor = VENDOR_PREFIX_1[_i];
@@ -225,7 +220,6 @@ var setStyle = function (element, style) {
225
220
  }
226
221
  } else {
227
222
  element.style.setProperty(property, style[property]);
228
-
229
223
  if (isVendorPrefix) {
230
224
  for (var _a = 0, VENDOR_PREFIX_2 = VENDOR_PREFIX; _a < VENDOR_PREFIX_2.length; _a++) {
231
225
  var vendor = VENDOR_PREFIX_2[_a];
@@ -235,31 +229,27 @@ var setStyle = function (element, style) {
235
229
  }
236
230
  }
237
231
  };
238
-
239
232
  var SWIPE_TIME_RATE = 250;
240
233
  var SWIPE_MIN_POS = 70;
241
234
  var SWIPE_TRANSITION_DURATION = 225;
242
235
  var SwipeClose = function (_a) {
243
236
  var _b = _a.isActive,
244
- isActive = _b === void 0 ? true : _b,
245
- children = _a.children,
246
- onClose = _a.onClose,
247
- placement = _a.placement,
248
- rootRef = _a.rootRef,
249
- contentRef = _a.contentRef;
237
+ isActive = _b === void 0 ? true : _b,
238
+ children = _a.children,
239
+ onClose = _a.onClose,
240
+ placement = _a.placement,
241
+ rootRef = _a.rootRef,
242
+ contentRef = _a.contentRef;
250
243
  var isAllowSwipe = React__namespace.useRef(null);
251
244
  var isAllowClose = React__namespace.useRef(false);
252
245
  var startTime = React__namespace.useRef(0);
253
-
254
246
  if (!isActive) {
255
247
  return React__namespace.createElement(React__namespace.Fragment, null, children);
256
248
  }
257
-
258
249
  var onSwipeMove = function (_a) {
259
250
  var _b, _c, _d;
260
-
261
251
  var x = _a.x,
262
- y = _a.y;
252
+ y = _a.y;
263
253
  var contentsScrollHeight = ((_b = contentRef.current) === null || _b === void 0 ? void 0 : _b.scrollHeight) || 0;
264
254
  var contentOffsetHeight = ((_c = contentRef.current) === null || _c === void 0 ? void 0 : _c.offsetHeight) || 0;
265
255
  var contentScrollTop = ((_d = contentRef.current) === null || _d === void 0 ? void 0 : _d.scrollTop) || 0;
@@ -269,7 +259,6 @@ var SwipeClose = function (_a) {
269
259
  var isAllowCloseCords = false;
270
260
  var xAbs = Math.abs(x);
271
261
  var yAbs = Math.abs(y);
272
-
273
262
  if (placement === 'top') {
274
263
  transform = "translateY(".concat(y >= 0 ? 0 : y, "px)");
275
264
  isAllowSwipeCords = contentScrollBottom <= 1 && y <= 0 && yAbs > xAbs;
@@ -287,7 +276,6 @@ var SwipeClose = function (_a) {
287
276
  isAllowSwipeCords = x >= 0 && xAbs > yAbs;
288
277
  isAllowCloseCords = xAbs > SWIPE_MIN_POS;
289
278
  }
290
-
291
279
  if (isAllowSwipe.current === null) {
292
280
  if (isAllowSwipeCords) {
293
281
  isAllowSwipe.current = true;
@@ -295,16 +283,13 @@ var SwipeClose = function (_a) {
295
283
  isAllowSwipe.current = false;
296
284
  }
297
285
  }
298
-
299
286
  if (isAllowSwipe.current) {
300
287
  if (!startTime.current) {
301
288
  startTime.current = new Date().getTime();
302
289
  }
303
-
304
290
  if (!isAllowClose.current && isAllowCloseCords) {
305
291
  isAllowClose.current = true;
306
292
  }
307
-
308
293
  setStyle(rootRef.current, {
309
294
  transform: transform
310
295
  });
@@ -314,7 +299,6 @@ var SwipeClose = function (_a) {
314
299
  });
315
300
  }
316
301
  };
317
-
318
302
  var onSwipeEnd = function () {
319
303
  if (isAllowSwipe.current) {
320
304
  setStyle(rootRef.current, {
@@ -331,17 +315,14 @@ var SwipeClose = function (_a) {
331
315
  });
332
316
  }, SWIPE_TRANSITION_DURATION);
333
317
  var timeRate = new Date().getTime() - startTime.current;
334
-
335
318
  if (isAllowClose.current && timeRate < SWIPE_TIME_RATE && onClose) {
336
319
  onClose({});
337
320
  }
338
321
  }
339
-
340
322
  startTime.current = 0;
341
323
  isAllowSwipe.current = null;
342
324
  isAllowClose.current = false;
343
325
  };
344
-
345
326
  return React__namespace.createElement(Swipe__default["default"], {
346
327
  onSwipeMove: onSwipeMove,
347
328
  onSwipeEnd: onSwipeEnd
@@ -351,47 +332,46 @@ var SwipeClose = function (_a) {
351
332
  var DEFAULT_SIZE = 400;
352
333
  var Overlay = function (_a) {
353
334
  var children = _a.children,
354
- onClose = _a.onClose,
355
- onOpen = _a.onOpen,
356
- onPrev = _a.onPrev,
357
- onOpened = _a.onOpened,
358
- onClosed = _a.onClosed,
359
- isOpen = _a.isOpen,
360
- _b = _a.isShowCloseButton,
361
- isShowCloseButton = _b === void 0 ? true : _b,
362
- _c = _a.isShowPrevButton,
363
- isShowPrevButton = _c === void 0 ? false : _c,
364
- _d = _a.isCloseOnEscape,
365
- isCloseOnEscape = _d === void 0 ? true : _d,
366
- _e = _a.isCloseOnSwipe,
367
- isCloseOnSwipe = _e === void 0 ? true : _e,
368
- _f = _a.isCloseOutsideClick,
369
- isCloseOutsideClick = _f === void 0 ? true : _f,
370
- _g = _a.isAnimated,
371
- isAnimated = _g === void 0 ? true : _g,
372
- _h = _a.isRenderPortal,
373
- isRenderPortal = _h === void 0 ? true : _h,
374
- _j = _a.isScrollLock,
375
- isScrollLock = _j === void 0 ? true : _j,
376
- _k = _a.isScrollLockTouch,
377
- isScrollLockTouch = _k === void 0 ? true : _k,
378
- header = _a.header,
379
- footer = _a.footer,
380
- _l = _a.padding,
381
- padding = _l === void 0 ? '20px 20px 20px 20px' : _l,
382
- title = _a.title,
383
- _m = _a.placement,
384
- placement = _m === void 0 ? 'adaptive' : _m,
385
- _o = _a.size,
386
- size = _o === void 0 ? 'adaptive' : _o,
387
- _p = _a.maxSize,
388
- maxSize = _p === void 0 ? '90%' : _p,
389
- _q = _a.zIndex,
390
- zIndex = _q === void 0 ? 5000 : _q,
391
- contentRef = _a.contentRef,
392
- dataQaId = _a.dataQaId,
393
- props = __rest(_a, ["children", "onClose", "onOpen", "onPrev", "onOpened", "onClosed", "isOpen", "isShowCloseButton", "isShowPrevButton", "isCloseOnEscape", "isCloseOnSwipe", "isCloseOutsideClick", "isAnimated", "isRenderPortal", "isScrollLock", "isScrollLockTouch", "header", "footer", "padding", "title", "placement", "size", "maxSize", "zIndex", "contentRef", "dataQaId"]);
394
-
335
+ onClose = _a.onClose,
336
+ onOpen = _a.onOpen,
337
+ onPrev = _a.onPrev,
338
+ onOpened = _a.onOpened,
339
+ onClosed = _a.onClosed,
340
+ isOpen = _a.isOpen,
341
+ _b = _a.isShowCloseButton,
342
+ isShowCloseButton = _b === void 0 ? true : _b,
343
+ _c = _a.isShowPrevButton,
344
+ isShowPrevButton = _c === void 0 ? false : _c,
345
+ _d = _a.isCloseOnEscape,
346
+ isCloseOnEscape = _d === void 0 ? true : _d,
347
+ _e = _a.isCloseOnSwipe,
348
+ isCloseOnSwipe = _e === void 0 ? true : _e,
349
+ _f = _a.isCloseOutsideClick,
350
+ isCloseOutsideClick = _f === void 0 ? true : _f,
351
+ _g = _a.isAnimated,
352
+ isAnimated = _g === void 0 ? true : _g,
353
+ _h = _a.isRenderPortal,
354
+ isRenderPortal = _h === void 0 ? true : _h,
355
+ _j = _a.isScrollLock,
356
+ isScrollLock = _j === void 0 ? true : _j,
357
+ _k = _a.isScrollLockTouch,
358
+ isScrollLockTouch = _k === void 0 ? true : _k,
359
+ header = _a.header,
360
+ footer = _a.footer,
361
+ _l = _a.padding,
362
+ padding = _l === void 0 ? '20px 20px 20px 20px' : _l,
363
+ title = _a.title,
364
+ _m = _a.placement,
365
+ placement = _m === void 0 ? 'adaptive' : _m,
366
+ _o = _a.size,
367
+ size = _o === void 0 ? 'adaptive' : _o,
368
+ _p = _a.maxSize,
369
+ maxSize = _p === void 0 ? '90%' : _p,
370
+ _q = _a.zIndex,
371
+ zIndex = _q === void 0 ? 5000 : _q,
372
+ contentRef = _a.contentRef,
373
+ dataQaId = _a.dataQaId,
374
+ props = __rest(_a, ["children", "onClose", "onOpen", "onPrev", "onOpened", "onClosed", "isOpen", "isShowCloseButton", "isShowPrevButton", "isCloseOnEscape", "isCloseOnSwipe", "isCloseOutsideClick", "isAnimated", "isRenderPortal", "isScrollLock", "isScrollLockTouch", "header", "footer", "padding", "title", "placement", "size", "maxSize", "zIndex", "contentRef", "dataQaId"]);
395
375
  var popupRef = React__namespace.useRef(null);
396
376
  var currentContentRef = contentRef || React__namespace.useRef(null);
397
377
  var isMinWidthMedium = Media.useMedia({
@@ -399,7 +379,6 @@ var Overlay = function (_a) {
399
379
  });
400
380
  var currentPlacement = placement;
401
381
  var currentSize = size;
402
-
403
382
  if (size === 'adaptive') {
404
383
  if (placement === 'top' || placement === 'bottom') {
405
384
  currentSize = 'auto';
@@ -409,11 +388,9 @@ var Overlay = function (_a) {
409
388
  currentSize = DEFAULT_SIZE;
410
389
  }
411
390
  }
412
-
413
391
  if (placement === 'adaptive') {
414
392
  currentPlacement = isMinWidthMedium ? 'right' : 'bottom';
415
393
  }
416
-
417
394
  return React__namespace.createElement(Animate, {
418
395
  open: isOpen,
419
396
  onEnter: onOpen,