@prom-ui/core 0.0.32 → 0.0.40

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 (41) hide show
  1. package/Body/package.json +1 -1
  2. package/Box/package.json +1 -1
  3. package/Button/package.json +1 -1
  4. package/ButtonPageUp/package.json +1 -1
  5. package/Checkbox/package.json +1 -1
  6. package/Flex/package.json +1 -1
  7. package/Grid/package.json +1 -1
  8. package/Icon/package.json +1 -1
  9. package/Image/package.json +1 -1
  10. package/ImageEmoji/package.json +1 -1
  11. package/Input/package.json +1 -1
  12. package/KeyPress/package.json +1 -1
  13. package/Line/package.json +1 -1
  14. package/Link/package.json +1 -1
  15. package/List/package.json +1 -1
  16. package/Media/package.json +1 -1
  17. package/OutsideClick/package.json +1 -1
  18. package/Overlay/blocks.d.ts +27 -0
  19. package/Overlay/cjs/index.development.js +261 -0
  20. package/Overlay/cjs/index.production.js +1 -0
  21. package/Overlay/cjs/style.development.css +1 -0
  22. package/Overlay/cjs/style.production.css +1 -0
  23. package/Overlay/index.d.ts +48 -0
  24. package/Overlay/index.js +7 -0
  25. package/Overlay/package.json +15 -0
  26. package/Overlay/utils.d.ts +8 -0
  27. package/Picture/package.json +1 -1
  28. package/PortableOverlay/package.json +1 -1
  29. package/Portal/package.json +1 -1
  30. package/Rating/package.json +1 -1
  31. package/SafeQuery/package.json +1 -1
  32. package/Scroll/package.json +1 -1
  33. package/ScrollControls/package.json +1 -1
  34. package/SideOverlay/package.json +1 -1
  35. package/SimpleSlider/package.json +1 -1
  36. package/Skeleton/package.json +1 -1
  37. package/Spinner/package.json +1 -1
  38. package/Text/package.json +1 -1
  39. package/TextEmoji/package.json +1 -1
  40. package/Tumbler/package.json +1 -1
  41. package/package.json +3 -2
package/Body/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/Body",
3
- "version": "0.0.32",
3
+ "version": "0.0.40",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
package/Box/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/Box",
3
- "version": "0.0.32",
3
+ "version": "0.0.40",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/Button",
3
- "version": "0.0.32",
3
+ "version": "0.0.40",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/ButtonPageUp",
3
- "version": "0.0.32",
3
+ "version": "0.0.40",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/Checkbox",
3
- "version": "0.0.32",
3
+ "version": "0.0.40",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
package/Flex/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/Flex",
3
- "version": "0.0.32",
3
+ "version": "0.0.40",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
package/Grid/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/Grid",
3
- "version": "0.0.32",
3
+ "version": "0.0.40",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
package/Icon/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/Icon",
3
- "version": "0.0.32",
3
+ "version": "0.0.40",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/Image",
3
- "version": "0.0.32",
3
+ "version": "0.0.40",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/ImageEmoji",
3
- "version": "0.0.32",
3
+ "version": "0.0.40",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/Input",
3
- "version": "0.0.32",
3
+ "version": "0.0.40",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/KeyPress",
3
- "version": "0.0.32",
3
+ "version": "0.0.40",
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.32",
3
+ "version": "0.0.40",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
package/Link/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/Link",
3
- "version": "0.0.32",
3
+ "version": "0.0.40",
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.32",
3
+ "version": "0.0.40",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/Media",
3
- "version": "0.0.32",
3
+ "version": "0.0.40",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/OutsideClick",
3
- "version": "0.0.32",
3
+ "version": "0.0.40",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
@@ -0,0 +1,27 @@
1
+ import React from 'react';
2
+ export declare const Root: any;
3
+ export declare const Backdrop: any;
4
+ export declare const Popup: any;
5
+ export declare const OverlayContent: any;
6
+ export declare const OverlayBody: any;
7
+ declare type AnimateProps = {
8
+ enabled?: boolean;
9
+ open?: boolean;
10
+ onEnter?: () => void;
11
+ children?: React.ReactNode;
12
+ };
13
+ declare type OverlayHeaderProps = {
14
+ isShowPrevButton?: boolean;
15
+ isShowCloseButton?: boolean;
16
+ children?: React.ReactNode;
17
+ title?: React.ReactNode;
18
+ onClose?: (e: any) => void;
19
+ onPrev?: (e: any) => void;
20
+ };
21
+ declare type OverlayFooterProps = {
22
+ children?: React.ReactNode;
23
+ };
24
+ export declare const Animate: React.FC<AnimateProps>;
25
+ export declare const OverlayHeader: React.FC<OverlayHeaderProps>;
26
+ export declare const OverlayFooter: React.FC<OverlayFooterProps>;
27
+ export {};
@@ -0,0 +1,261 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var React = require('react');
6
+ var ScrollLock = require('react-scrolllock');
7
+ var KeyPress = require('@prom-ui/core/KeyPress');
8
+ var Portal = require('@prom-ui/core/Portal');
9
+ var ttag = require('ttag');
10
+ var evokit = require('evokit');
11
+ var reactTransitionGroup = require('react-transition-group');
12
+ var Text = require('@prom-ui/core/Text');
13
+ var Button = require('@prom-ui/core/Button');
14
+ var Icon = require('@prom-ui/core/Icon');
15
+ var Close = require('@prom-ui/icons/Close');
16
+ var ArrowBack = require('@prom-ui/icons/ArrowBack');
17
+
18
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
19
+
20
+ function _interopNamespace(e) {
21
+ if (e && e.__esModule) return e;
22
+ var n = Object.create(null);
23
+ if (e) {
24
+ Object.keys(e).forEach(function (k) {
25
+ if (k !== 'default') {
26
+ var d = Object.getOwnPropertyDescriptor(e, k);
27
+ Object.defineProperty(n, k, d.get ? d : {
28
+ enumerable: true,
29
+ get: function () { return e[k]; }
30
+ });
31
+ }
32
+ });
33
+ }
34
+ n["default"] = e;
35
+ return Object.freeze(n);
36
+ }
37
+
38
+ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
39
+ var React__namespace = /*#__PURE__*/_interopNamespace(React);
40
+ var ScrollLock__default = /*#__PURE__*/_interopDefaultLegacy(ScrollLock);
41
+
42
+ /******************************************************************************
43
+ Copyright (c) Microsoft Corporation.
44
+
45
+ Permission to use, copy, modify, and/or distribute this software for any
46
+ purpose with or without fee is hereby granted.
47
+
48
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
49
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
50
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
51
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
52
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
53
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
54
+ PERFORMANCE OF THIS SOFTWARE.
55
+ ***************************************************************************** */
56
+
57
+ var __assign = function() {
58
+ __assign = Object.assign || function __assign(t) {
59
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
60
+ s = arguments[i];
61
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
62
+ }
63
+ return t;
64
+ };
65
+ return __assign.apply(this, arguments);
66
+ };
67
+
68
+ function __rest(s, e) {
69
+ var t = {};
70
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
71
+ t[p] = s[p];
72
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
73
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
74
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
75
+ t[p[i]] = s[p[i]];
76
+ }
77
+ return t;
78
+ }
79
+
80
+ function __makeTemplateObject(cooked, raw) {
81
+ if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
82
+ return cooked;
83
+ }
84
+
85
+ var css = {"root":"Overlay__root___v0oYp","backdrop":"Overlay__backdrop___RvRWz","popup":"Overlay__popup___elIqJ","popup_placement_top":"Overlay__popup_placement_top___Llv4b","popup_placement_bottom":"Overlay__popup_placement_bottom___DJyNc","popup_placement_right":"Overlay__popup_placement_right___4DX3c","popup_placement_left":"Overlay__popup_placement_left___OwkR7","body":"Overlay__body___fvbis","content":"Overlay__content___5qQ0k","header":"Overlay__header___LIk9z","header__grid":"Overlay__header__grid___SShy4","header__item":"Overlay__header__item___9fUzS","header__title":"Overlay__header__title___Vuilz Overlay__header__item___9fUzS","header__action":"Overlay__header__action___c-A8d Overlay__header__item___9fUzS","header__actionButton":"Overlay__header__actionButton___yYG24","header__actionIcon":"Overlay__header__actionIcon___La2ok","footer":"Overlay__footer___3Ca-G","enter":"Overlay__enter___OjeZp","exit":"Overlay__exit___HiHMU","enterActive":"Overlay__enterActive___Ne-Vn","exitActive":"Overlay__exitActive___6f7f1"};
86
+
87
+ var BLOCKS_PRESET = {
88
+ css: css,
89
+ b: ''
90
+ };
91
+ var Root = evokit.createBlock('div', 'root', [], BLOCKS_PRESET);
92
+ var Backdrop = evokit.createBlock('div', 'backdrop', [], BLOCKS_PRESET);
93
+ var Popup = evokit.createBlock('div', 'popup', ['placement'], BLOCKS_PRESET);
94
+ var OverlayContent = evokit.createBlock('div', 'content', [], BLOCKS_PRESET);
95
+ var OverlayBody = evokit.createBlock('div', 'body', [], BLOCKS_PRESET);
96
+ var Animate = function (_a) {
97
+ var _b = _a.open,
98
+ open = _b === void 0 ? false : _b,
99
+ children = _a.children,
100
+ _c = _a.enabled,
101
+ enabled = _c === void 0 ? true : _c,
102
+ onEnter = _a.onEnter;
103
+ return React__default["default"].createElement(reactTransitionGroup.CSSTransition, {
104
+ in: open,
105
+ timeout: enabled ? 225 : 0,
106
+ classNames: css,
107
+ unmountOnExit: true,
108
+ onEnter: onEnter
109
+ }, children);
110
+ };
111
+ var OverlayHeader = function (_a) {
112
+ var isShowPrevButton = _a.isShowPrevButton,
113
+ isShowCloseButton = _a.isShowCloseButton,
114
+ children = _a.children,
115
+ title = _a.title,
116
+ onClose = _a.onClose,
117
+ onPrev = _a.onPrev;
118
+ return React__default["default"].createElement("div", {
119
+ className: css.header
120
+ }, typeof children !== 'undefined' ? children : React__default["default"].createElement("div", {
121
+ className: css.header__grid
122
+ }, React__default["default"].createElement("div", {
123
+ className: css.header__action
124
+ }, isShowPrevButton && React__default["default"].createElement(Button.Button, {
125
+ className: css.header__actionButton,
126
+ "button-theme": 'black-inherit',
127
+ type: 'button',
128
+ onClick: onPrev,
129
+ "aria-label": ttag.t(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\u041D\u0430\u0437\u0430\u0434"], ["\u041D\u0430\u0437\u0430\u0434"]))),
130
+ "data-qaid": 'prev'
131
+ }, React__default["default"].createElement(Icon.Icon, {
132
+ "icon-as": ArrowBack.ArrowBack,
133
+ className: css.header__actionIcon
134
+ }))), React__default["default"].createElement("div", {
135
+ className: css.header__title
136
+ }, typeof title === 'string' ? React__default["default"].createElement(Text.Text, {
137
+ "text-align": 'center',
138
+ "text-size": 'h4',
139
+ "text-wrap": 'ellipsis',
140
+ "text-weight": 'bold'
141
+ }, title) : title), React__default["default"].createElement("div", {
142
+ className: css.header__action
143
+ }, isShowCloseButton && onClose && React__default["default"].createElement(Button.Button, {
144
+ className: css.header__actionButton,
145
+ "button-theme": 'black-inherit',
146
+ type: 'button',
147
+ onClick: onClose,
148
+ "aria-label": ttag.t(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\u0417\u0430\u043A\u0440\u044B\u0442\u044C"], ["\u0417\u0430\u043A\u0440\u044B\u0442\u044C"]))),
149
+ "data-qaid": 'close'
150
+ }, React__default["default"].createElement(Icon.Icon, {
151
+ "icon-as": Close.Close,
152
+ className: css.header__actionIcon
153
+ })))));
154
+ };
155
+ var OverlayFooter = function (_a) {
156
+ var children = _a.children;
157
+ return React__default["default"].createElement("div", {
158
+ className: css.footer
159
+ }, children);
160
+ };
161
+ var templateObject_1, templateObject_2;
162
+
163
+ var getPopupStyle = function (placement, size) {
164
+ if (['top', 'bottom'].includes(placement)) {
165
+ return {
166
+ height: size
167
+ };
168
+ }
169
+
170
+ return {
171
+ width: size
172
+ };
173
+ };
174
+
175
+ var Overlay = function (_a) {
176
+ var children = _a.children,
177
+ onClose = _a.onClose,
178
+ onOpen = _a.onOpen,
179
+ onPrev = _a.onPrev,
180
+ isOpen = _a.isOpen,
181
+ _b = _a.isShowCloseButton,
182
+ isShowCloseButton = _b === void 0 ? true : _b,
183
+ _c = _a.isShowPrevButton,
184
+ isShowPrevButton = _c === void 0 ? false : _c,
185
+ _d = _a.isCloseOnEscape,
186
+ isCloseOnEscape = _d === void 0 ? true : _d,
187
+ _e = _a.isAnimated,
188
+ isAnimated = _e === void 0 ? true : _e,
189
+ _f = _a.isCloseOutsideClick,
190
+ isCloseOutsideClick = _f === void 0 ? true : _f,
191
+ _g = _a.isRenderPortal,
192
+ isRenderPortal = _g === void 0 ? true : _g,
193
+ _h = _a.isScrollLock,
194
+ isScrollLock = _h === void 0 ? true : _h,
195
+ _j = _a.isScrollLockTouch,
196
+ isScrollLockTouch = _j === void 0 ? true : _j,
197
+ header = _a.header,
198
+ footer = _a.footer,
199
+ _k = _a.padding,
200
+ padding = _k === void 0 ? '20px 20px 20px 20px' : _k,
201
+ title = _a.title,
202
+ _l = _a.placement,
203
+ placement = _l === void 0 ? 'right' : _l,
204
+ _m = _a.size,
205
+ size = _m === void 0 ? 400 : _m,
206
+ _o = _a.zIndex,
207
+ zIndex = _o === void 0 ? 5000 : _o,
208
+ contentRef = _a.contentRef,
209
+ dataQaId = _a.dataQaId,
210
+ props = __rest(_a, ["children", "onClose", "onOpen", "onPrev", "isOpen", "isShowCloseButton", "isShowPrevButton", "isCloseOnEscape", "isAnimated", "isCloseOutsideClick", "isRenderPortal", "isScrollLock", "isScrollLockTouch", "header", "footer", "padding", "title", "placement", "size", "zIndex", "contentRef", "dataQaId"]);
211
+
212
+ var ScrollableWrapper = isScrollLockTouch ? ScrollLock.TouchScrollable : React__namespace.Fragment;
213
+ return React__namespace.createElement(Animate, {
214
+ open: isOpen,
215
+ onEnter: function () {
216
+ onOpen && onOpen();
217
+ },
218
+ enabled: isAnimated
219
+ }, React__namespace.createElement(Portal.Portal, {
220
+ isActive: isRenderPortal
221
+ }, React__namespace.createElement(Root, __assign({
222
+ role: 'presentation',
223
+ style: {
224
+ zIndex: zIndex
225
+ }
226
+ }, props), React__namespace.createElement(ScrollLock__default["default"], {
227
+ isActive: isScrollLock
228
+ }), React__namespace.createElement(KeyPress.KeyPress, {
229
+ isActive: isCloseOnEscape,
230
+ code: 'Escape',
231
+ onKeyDown: onClose
232
+ }), React__namespace.createElement(Backdrop, {
233
+ "aria-hidden": true,
234
+ onClick: function (e) {
235
+ if (isCloseOutsideClick && onClose) {
236
+ onClose(e);
237
+ }
238
+ }
239
+ }), React__namespace.createElement(Popup, {
240
+ "popup-placement": placement,
241
+ "aria-modal": true,
242
+ role: 'dialog',
243
+ style: getPopupStyle(placement, size),
244
+ "data-qaid": dataQaId
245
+ }, React__namespace.createElement(OverlayBody, null, React__namespace.createElement(OverlayHeader, {
246
+ isShowCloseButton: isShowCloseButton,
247
+ isShowPrevButton: isShowPrevButton,
248
+ onClose: onClose,
249
+ onPrev: onPrev,
250
+ title: title
251
+ }, header), React__namespace.createElement(ScrollableWrapper, null, React__namespace.createElement(OverlayContent, {
252
+ ref: contentRef,
253
+ style: {
254
+ padding: padding
255
+ }
256
+ }, children)), React__namespace.createElement(OverlayFooter, null, footer))))));
257
+ };
258
+
259
+ exports.Overlay = Overlay;
260
+
261
+ require('./style.development.css');
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("react-scrolllock"),r=require("@prom-ui/core/KeyPress"),o=require("@prom-ui/core/Portal"),n=require("ttag"),a=require("evokit"),i=require("react-transition-group"),c=require("@prom-ui/core/Text"),l=require("@prom-ui/core/Button"),d=require("@prom-ui/core/Icon"),u=require("@prom-ui/icons/Close"),s=require("@prom-ui/icons/ArrowBack");function p(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function f(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,o.get?o:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var m=p(e),v=f(e),h=p(t),_=function(){return _=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},_.apply(this,arguments)};function b(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var y,E,O={root:"v0oYp",backdrop:"RvRWz",popup:"elIqJ",popup_placement_top:"Llv4b",popup_placement_bottom:"DJyNc",popup_placement_right:"_4DX3c",popup_placement_left:"OwkR7",body:"fvbis",content:"_5qQ0k",header:"LIk9z",header__grid:"SShy4",header__item:"_9fUzS",header__title:"Vuilz _9fUzS",header__action:"c-A8d _9fUzS",header__actionButton:"yYG24",header__actionIcon:"La2ok",footer:"_3Ca-G",enter:"OjeZp",exit:"HiHMU",enterActive:"Ne-Vn",exitActive:"_6f7f1"},k={css:O,b:""},g=a.createBlock("div","root",[],k),P=a.createBlock("div","backdrop",[],k),w=a.createBlock("div","popup",["placement"],k),S=a.createBlock("div","content",[],k),B=a.createBlock("div","body",[],k),C=function(e){var t=e.open,r=void 0!==t&&t,o=e.children,n=e.enabled,a=void 0===n||n,c=e.onEnter;return m.default.createElement(i.CSSTransition,{in:r,timeout:a?225:0,classNames:O,unmountOnExit:!0,onEnter:c},o)},x=function(e){var t=e.isShowPrevButton,r=e.isShowCloseButton,o=e.children,a=e.title,i=e.onClose,p=e.onPrev;return m.default.createElement("div",{className:O.header},void 0!==o?o:m.default.createElement("div",{className:O.header__grid},m.default.createElement("div",{className:O.header__action},t&&m.default.createElement(l.Button,{className:O.header__actionButton,"button-theme":"black-inherit",type:"button",onClick:p,"aria-label":n.t(y||(y=b(["Назад"],["Назад"]))),"data-qaid":"prev"},m.default.createElement(d.Icon,{"icon-as":s.ArrowBack,className:O.header__actionIcon}))),m.default.createElement("div",{className:O.header__title},"string"==typeof a?m.default.createElement(c.Text,{"text-align":"center","text-size":"h4","text-wrap":"ellipsis","text-weight":"bold"},a):a),m.default.createElement("div",{className:O.header__action},r&&i&&m.default.createElement(l.Button,{className:O.header__actionButton,"button-theme":"black-inherit",type:"button",onClick:i,"aria-label":n.t(E||(E=b(["Закрыть"],["Закрыть"]))),"data-qaid":"close"},m.default.createElement(d.Icon,{"icon-as":u.Close,className:O.header__actionIcon})))))},q=function(e){var t=e.children;return m.default.createElement("div",{className:O.footer},t)},j=function(e,t){return["top","bottom"].includes(e)?{height:t}:{width:t}};exports.Overlay=function(e){var n=e.children,a=e.onClose,i=e.onOpen,c=e.onPrev,l=e.isOpen,d=e.isShowCloseButton,u=void 0===d||d,s=e.isShowPrevButton,p=void 0!==s&&s,f=e.isCloseOnEscape,m=void 0===f||f,b=e.isAnimated,y=void 0===b||b,E=e.isCloseOutsideClick,O=void 0===E||E,k=e.isRenderPortal,I=void 0===k||k,z=e.isScrollLock,N=void 0===z||z,A=e.isScrollLockTouch,L=void 0===A||A,R=e.header,T=e.footer,D=e.padding,U=void 0===D?"20px 20px 20px 20px":D,K=e.title,M=e.placement,Q=void 0===M?"right":M,G=e.size,H=void 0===G?400:G,J=e.zIndex,V=void 0===J?5e3:J,Y=e.contentRef,F=e.dataQaId,W=function(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(o=Object.getOwnPropertySymbols(e);n<o.length;n++)t.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(e,o[n])&&(r[o[n]]=e[o[n]])}return r}(e,["children","onClose","onOpen","onPrev","isOpen","isShowCloseButton","isShowPrevButton","isCloseOnEscape","isAnimated","isCloseOutsideClick","isRenderPortal","isScrollLock","isScrollLockTouch","header","footer","padding","title","placement","size","zIndex","contentRef","dataQaId"]),X=L?t.TouchScrollable:v.Fragment;return v.createElement(C,{open:l,onEnter:function(){i&&i()},enabled:y},v.createElement(o.Portal,{isActive:I},v.createElement(g,_({role:"presentation",style:{zIndex:V}},W),v.createElement(h.default,{isActive:N}),v.createElement(r.KeyPress,{isActive:m,code:"Escape",onKeyDown:a}),v.createElement(P,{"aria-hidden":!0,onClick:function(e){O&&a&&a(e)}}),v.createElement(w,{"popup-placement":Q,"aria-modal":!0,role:"dialog",style:j(Q,H),"data-qaid":F},v.createElement(B,null,v.createElement(x,{isShowCloseButton:u,isShowPrevButton:p,onClose:a,onPrev:c,title:K},R),v.createElement(X,null,v.createElement(S,{ref:Y,style:{padding:U}},n)),v.createElement(q,null,T))))))},require("./style.production.css");
@@ -0,0 +1 @@
1
+ .Overlay__root___v0oYp{position:fixed;right:0;bottom:0;top:0;left:0;width:100%;height:100%}.Overlay__backdrop___RvRWz{top:0;left:0;right:0;bottom:0;display:flex;z-index:-1;position:fixed;align-items:center;justify-content:center;opacity:.5;background-color:var(--black-400);-webkit-tap-highlight-color:transparent;will-change:opacity}.Overlay__popup___elIqJ{z-index:1200;position:fixed;background:var(--white);box-sizing:border-box}.Overlay__popup_placement_top___Llv4b,.Overlay__popup_placement_bottom___DJyNc,.Overlay__popup_placement_right___4DX3c,.Overlay__popup_placement_left___OwkR7{transform:none;will-change:transform}.Overlay__popup_placement_top___Llv4b,.Overlay__popup_placement_bottom___DJyNc{right:0;left:0;max-height:90%}.Overlay__popup_placement_right___4DX3c,.Overlay__popup_placement_left___OwkR7{top:0;bottom:0;max-width:90%}.Overlay__popup_placement_top___Llv4b{top:0;box-shadow:0 3px 6px 0 rgba(0,0,0,.1);border-radius:0 0 var(--pds-round-3xl) var(--pds-round-3xl)}.Overlay__popup_placement_bottom___DJyNc{bottom:0;box-shadow:0-3px 6px 0 rgba(0,0,0,.1);border-radius:var(--pds-round-3xl) var(--pds-round-3xl)0 0}.Overlay__popup_placement_right___4DX3c{right:0;box-shadow:-3px 0 6px 0 rgba(0,0,0,.1);border-radius:var(--pds-round-3xl)0 0 var(--pds-round-3xl)}.Overlay__popup_placement_left___OwkR7{left:0;box-shadow:3px 0 6px 0 rgba(0,0,0,.1);border-radius:0 var(--pds-round-3xl) var(--pds-round-3xl)0}.Overlay__body___fvbis{width:100%;height:100%;pointer-events:auto;display:flex;flex-direction:column;transform:translate3d(0,0,0)}.Overlay__content___5qQ0k{flex:1;min-width:0;min-height:0;box-sizing:border-box;overflow-x:hidden;overflow-y:auto;-webkit-overflow-scrolling:touch}.Overlay__content___5qQ0k:after{clear:both}.Overlay__content___5qQ0k:before,.Overlay__content___5qQ0k:after{content:"";display:table}.Overlay__header___LIk9z{box-sizing:border-box;flex:0}.Overlay__header___LIk9z:after{clear:both}.Overlay__header___LIk9z:before,.Overlay__header___LIk9z:after{content:"";display:table}.Overlay__header__grid___SShy4{box-sizing:border-box;display:flex;flex-wrap:wrap;min-width:0;align-items:center;min-height:50px;padding:var(--pds-spacing-xs)}.Overlay__header__item___9fUzS{display:block;box-sizing:border-box;min-width:0;max-width:100%}.Overlay__header__title___Vuilz{flex:1}.Overlay__header__action___c-A8d{min-width:34px}.Overlay__header__actionButton___yYG24{padding:0;width:34px;height:34px}.Overlay__header__actionIcon___La2ok{width:24px;height:24px}.Overlay__footer___3Ca-G{box-sizing:border-box;flex:0}.Overlay__footer___3Ca-G:after{clear:both}.Overlay__footer___3Ca-G:before,.Overlay__footer___3Ca-G:after{content:"";display:table}.Overlay__enter___OjeZp,.Overlay__exit___HiHMU{pointer-events:auto}.Overlay__enterActive___Ne-Vn,.Overlay__exitActive___6f7f1{pointer-events:none}.Overlay__enterActive___Ne-Vn .Overlay__backdrop___RvRWz,.Overlay__exitActive___6f7f1 .Overlay__backdrop___RvRWz{transition:opacity 256ms cubic-bezier(.4,0,.2,1) 0ms}.Overlay__enterActive___Ne-Vn .Overlay__popup_placement_top___Llv4b,.Overlay__exitActive___6f7f1 .Overlay__popup_placement_top___Llv4b,.Overlay__enterActive___Ne-Vn .Overlay__popup_placement_right___4DX3c,.Overlay__exitActive___6f7f1 .Overlay__popup_placement_right___4DX3c,.Overlay__enterActive___Ne-Vn .Overlay__popup_placement_bottom___DJyNc,.Overlay__exitActive___6f7f1 .Overlay__popup_placement_bottom___DJyNc,.Overlay__enterActive___Ne-Vn .Overlay__popup_placement_left___OwkR7,.Overlay__exitActive___6f7f1 .Overlay__popup_placement_left___OwkR7{transition:transform 256ms cubic-bezier(.4,0,.2,1) 0ms}.Overlay__enter___OjeZp .Overlay__backdrop___RvRWz{opacity:0}.Overlay__enter___OjeZp .Overlay__popup_placement_top___Llv4b{transform:translateY(-100%)}.Overlay__enter___OjeZp .Overlay__popup_placement_right___4DX3c{transform:translateX(100%)}.Overlay__enter___OjeZp .Overlay__popup_placement_bottom___DJyNc{transform:translateY(100%)}.Overlay__enter___OjeZp .Overlay__popup_placement_left___OwkR7{transform:translateX(-100%)}.Overlay__enterActive___Ne-Vn .Overlay__backdrop___RvRWz{opacity:.5}.Overlay__enterActive___Ne-Vn .Overlay__popup_placement_top___Llv4b,.Overlay__enterActive___Ne-Vn .Overlay__popup_placement_bottom___DJyNc{transform:translateY(0)}.Overlay__enterActive___Ne-Vn .Overlay__popup_placement_left___OwkR7,.Overlay__enterActive___Ne-Vn .Overlay__popup_placement_right___4DX3c{transform:translateX(0)}.Overlay__exit___HiHMU .Overlay__backdrop___RvRWz{opacity:.5}.Overlay__exit___HiHMU .Overlay__popup_placement_top___Llv4b,.Overlay__exit___HiHMU .Overlay__popup_placement_bottom___DJyNc{transform:translateY(0)}.Overlay__exit___HiHMU .Overlay__popup_placement_left___OwkR7,.Overlay__exit___HiHMU .Overlay__popup_placement_right___4DX3c{transform:translateX(0)}.Overlay__exitActive___6f7f1 .Overlay__backdrop___RvRWz{opacity:0}.Overlay__exitActive___6f7f1 .Overlay__popup_placement_top___Llv4b{transform:translateY(calc(-100% - 80px))}.Overlay__exitActive___6f7f1 .Overlay__popup_placement_right___4DX3c{transform:translateX(calc(100% + 80px))}.Overlay__exitActive___6f7f1 .Overlay__popup_placement_bottom___DJyNc{transform:translateY(calc(100% + 80px))}.Overlay__exitActive___6f7f1 .Overlay__popup_placement_left___OwkR7{transform:translateX(calc(-100% - 80px))}
@@ -0,0 +1 @@
1
+ .v0oYp{position:fixed;right:0;bottom:0;top:0;left:0;width:100%;height:100%}.RvRWz{top:0;left:0;right:0;bottom:0;display:flex;z-index:-1;position:fixed;align-items:center;justify-content:center;opacity:.5;background-color:var(--black-400);-webkit-tap-highlight-color:transparent;will-change:opacity}.elIqJ{z-index:1200;position:fixed;background:var(--white);box-sizing:border-box}.Llv4b,.DJyNc,._4DX3c,.OwkR7{transform:none;will-change:transform}.Llv4b,.DJyNc{right:0;left:0;max-height:90%}._4DX3c,.OwkR7{top:0;bottom:0;max-width:90%}.Llv4b{top:0;box-shadow:0 3px 6px 0 rgba(0,0,0,.1);border-radius:0 0 var(--pds-round-3xl) var(--pds-round-3xl)}.DJyNc{bottom:0;box-shadow:0-3px 6px 0 rgba(0,0,0,.1);border-radius:var(--pds-round-3xl) var(--pds-round-3xl)0 0}._4DX3c{right:0;box-shadow:-3px 0 6px 0 rgba(0,0,0,.1);border-radius:var(--pds-round-3xl)0 0 var(--pds-round-3xl)}.OwkR7{left:0;box-shadow:3px 0 6px 0 rgba(0,0,0,.1);border-radius:0 var(--pds-round-3xl) var(--pds-round-3xl)0}.fvbis{width:100%;height:100%;pointer-events:auto;display:flex;flex-direction:column;transform:translate3d(0,0,0)}._5qQ0k{flex:1;min-width:0;min-height:0;box-sizing:border-box;overflow-x:hidden;overflow-y:auto;-webkit-overflow-scrolling:touch}._5qQ0k:after{clear:both}._5qQ0k:before,._5qQ0k:after{content:"";display:table}.LIk9z{box-sizing:border-box;flex:0}.LIk9z:after{clear:both}.LIk9z:before,.LIk9z:after{content:"";display:table}.SShy4{box-sizing:border-box;display:flex;flex-wrap:wrap;min-width:0;align-items:center;min-height:50px;padding:var(--pds-spacing-xs)}._9fUzS{display:block;box-sizing:border-box;min-width:0;max-width:100%}.Vuilz{flex:1}.c-A8d{min-width:34px}.yYG24{padding:0;width:34px;height:34px}.La2ok{width:24px;height:24px}._3Ca-G{box-sizing:border-box;flex:0}._3Ca-G:after{clear:both}._3Ca-G:before,._3Ca-G:after{content:"";display:table}.OjeZp,.HiHMU{pointer-events:auto}.Ne-Vn,._6f7f1{pointer-events:none}.Ne-Vn .RvRWz,._6f7f1 .RvRWz{transition:opacity 256ms cubic-bezier(.4,0,.2,1) 0ms}.Ne-Vn .Llv4b,._6f7f1 .Llv4b,.Ne-Vn ._4DX3c,._6f7f1 ._4DX3c,.Ne-Vn .DJyNc,._6f7f1 .DJyNc,.Ne-Vn .OwkR7,._6f7f1 .OwkR7{transition:transform 256ms cubic-bezier(.4,0,.2,1) 0ms}.OjeZp .RvRWz{opacity:0}.OjeZp .Llv4b{transform:translateY(-100%)}.OjeZp ._4DX3c{transform:translateX(100%)}.OjeZp .DJyNc{transform:translateY(100%)}.OjeZp .OwkR7{transform:translateX(-100%)}.Ne-Vn .RvRWz{opacity:.5}.Ne-Vn .Llv4b,.Ne-Vn .DJyNc{transform:translateY(0)}.Ne-Vn .OwkR7,.Ne-Vn ._4DX3c{transform:translateX(0)}.HiHMU .RvRWz{opacity:.5}.HiHMU .Llv4b,.HiHMU .DJyNc{transform:translateY(0)}.HiHMU .OwkR7,.HiHMU ._4DX3c{transform:translateX(0)}._6f7f1 .RvRWz{opacity:0}._6f7f1 .Llv4b{transform:translateY(calc(-100% - 80px))}._6f7f1 ._4DX3c{transform:translateX(calc(100% + 80px))}._6f7f1 .DJyNc{transform:translateY(calc(100% + 80px))}._6f7f1 .OwkR7{transform:translateX(calc(-100% - 80px))}
@@ -0,0 +1,48 @@
1
+ import * as React from 'react';
2
+ export declare type OverlayProps = React.ComponentProps<"div"> & {
3
+ /** Состояние, открыто или нет */
4
+ isOpen: boolean;
5
+ /** Заголовок */
6
+ title?: React.ReactNode;
7
+ /** Отображение кнопки закрытия (крестик) */
8
+ isShowCloseButton?: boolean;
9
+ /** Отображение кнопки назад (стрелка) */
10
+ isShowPrevButton?: boolean;
11
+ /** Разрешает закрыть попап по клавише `Escape` */
12
+ isCloseOnEscape?: boolean;
13
+ /** Рендер в конец `<body>` */
14
+ isRenderPortal?: boolean;
15
+ /** Разрешает закрытие при клике на свободное пространство (затемнение документа) */
16
+ isCloseOutsideClick?: boolean;
17
+ /** Включает/отключает анимацию открытия/скрытия шторки */
18
+ isAnimated?: boolean;
19
+ /** Запрещает прокрутку `<body>` */
20
+ isScrollLock?: boolean;
21
+ /** Запрещает прокрутку `<body>` для iOS */
22
+ isScrollLockTouch?: boolean;
23
+ /** React children */
24
+ children: React.ReactNode;
25
+ /** React children header block */
26
+ header?: React.ReactNode;
27
+ /** React children footer block */
28
+ footer?: React.ReactNode;
29
+ /** Срабатывает когда попап открыт */
30
+ onOpen?: () => void;
31
+ /** Handle для закрытия попапа */
32
+ onClose: (e: any) => void;
33
+ /** Событие при нажатии кнопки назад */
34
+ onPrev?: (e: any) => void;
35
+ /** Расположение */
36
+ placement?: 'top' | 'right' | 'bottom' | 'left';
37
+ /** Внутренние отступы */
38
+ padding?: string | number;
39
+ /** Ширина или высота взависимости от placement */
40
+ size?: string | number;
41
+ /** Размещением по z-оси */
42
+ zIndex?: string | number;
43
+ /** HTML Атрибут `data-qaid` для автотестов */
44
+ /** `ref` для блока с контентом */
45
+ contentRef?: React.RefObject<HTMLElement>;
46
+ dataQaId?: string;
47
+ };
48
+ export declare const Overlay: React.FC<OverlayProps>;
@@ -0,0 +1,7 @@
1
+ 'use strict';
2
+
3
+ if (process.env.NODE_ENV === 'production') {
4
+ module.exports = require('./cjs/index.production.js');
5
+ } else {
6
+ module.exports = require('./cjs/index.development.js');
7
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "name": "@prom-ui/core/Overlay",
3
+ "version": "0.0.40",
4
+ "main": "index.js",
5
+ "types": "index.d.ts",
6
+ "sideEffects": [
7
+ "*.css"
8
+ ],
9
+ "dependencies": {
10
+ "evokit": "^3.2.3",
11
+ "react-scrolllock": "^5.0.1",
12
+ "react-transition-group": "^4.4.2",
13
+ "ttag": "^1.7.24"
14
+ }
15
+ }
@@ -0,0 +1,8 @@
1
+ declare type tPlacement = 'top' | 'right' | 'bottom' | 'left';
2
+ declare type tSize = string | number;
3
+ declare type tGetPopupStyle = {
4
+ height?: tSize;
5
+ width?: tSize;
6
+ };
7
+ export declare const getPopupStyle: (placement: tPlacement, size: tSize) => tGetPopupStyle;
8
+ export {};
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/Picture",
3
- "version": "0.0.32",
3
+ "version": "0.0.40",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/PortableOverlay",
3
- "version": "0.0.32",
3
+ "version": "0.0.40",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/Portal",
3
- "version": "0.0.32",
3
+ "version": "0.0.40",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/Rating",
3
- "version": "0.0.32",
3
+ "version": "0.0.40",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/SafeQuery",
3
- "version": "0.0.32",
3
+ "version": "0.0.40",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/Scroll",
3
- "version": "0.0.32",
3
+ "version": "0.0.40",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/ScrollControls",
3
- "version": "0.0.32",
3
+ "version": "0.0.40",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/SideOverlay",
3
- "version": "0.0.32",
3
+ "version": "0.0.40",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/SimpleSlider",
3
- "version": "0.0.32",
3
+ "version": "0.0.40",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/Skeleton",
3
- "version": "0.0.32",
3
+ "version": "0.0.40",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/Spinner",
3
- "version": "0.0.32",
3
+ "version": "0.0.40",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
package/Text/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/Text",
3
- "version": "0.0.32",
3
+ "version": "0.0.40",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/TextEmoji",
3
- "version": "0.0.32",
3
+ "version": "0.0.40",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/Tumbler",
3
- "version": "0.0.32",
3
+ "version": "0.0.40",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
package/package.json CHANGED
@@ -1,9 +1,10 @@
1
1
  {
2
2
  "name": "@prom-ui/core",
3
3
  "author": "e.marchenko",
4
- "version": "0.0.32",
4
+ "version": "0.0.40",
5
5
  "description": "core ui blocks",
6
6
  "scripts": {
7
+ "test": "jest",
7
8
  "prebuild": "node ./preBuild.js",
8
9
  "build": "NODE_ENV=development rollup --config ./rollup.config.js",
9
10
  "postbuild": "NODE_ENV=production rollup --config ./rollup.config.js",
@@ -61,5 +62,5 @@
61
62
  "optional": true
62
63
  }
63
64
  },
64
- "gitHead": "d08da8cdd19362331abd11aaca788bab303cba4c"
65
+ "gitHead": "779254d46558c0a3d212ac5eed071a386b18ef40"
65
66
  }