@prom-ui/core 0.0.142 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Avatar/cjs/index.development.js +4 -10
- package/Avatar/cjs/index.development.v2.js +4 -10
- package/Avatar/cjs/index.production.js +1 -1
- package/Avatar/cjs/index.production.v2.js +1 -1
- package/Avatar/index.d.ts +1 -1
- package/Avatar/package.json +1 -1
- package/Backdrop/cjs/index.development.js +111 -0
- package/Backdrop/cjs/index.development.v2.js +111 -0
- package/Backdrop/cjs/index.production.js +1 -0
- package/Backdrop/cjs/index.production.v2.js +1 -0
- package/Backdrop/cjs/style.development.css +1 -0
- package/Backdrop/cjs/style.development.v2.css +1 -0
- package/Backdrop/cjs/style.production.css +1 -0
- package/Backdrop/cjs/style.production.v2.css +1 -0
- package/Backdrop/index.d.ts +25 -0
- package/Backdrop/index.js +7 -0
- package/Backdrop/index.v2.js +7 -0
- package/Backdrop/package.json +13 -0
- package/Body/cjs/index.development.js +0 -2
- package/Body/cjs/index.development.v2.js +0 -2
- package/Body/cjs/index.production.js +1 -1
- package/Body/cjs/index.production.v2.js +1 -1
- package/Body/package.json +1 -1
- package/BodyProvider/cjs/index.development.js +3 -6
- package/BodyProvider/cjs/index.development.v2.js +3 -6
- package/BodyProvider/cjs/index.production.js +1 -1
- package/BodyProvider/cjs/index.production.v2.js +1 -1
- package/BodyProvider/index.d.ts +1 -1
- package/BodyProvider/package.json +1 -1
- package/Box/cjs/index.development.js +0 -2
- package/Box/cjs/index.development.v2.js +0 -2
- package/Box/cjs/index.production.js +1 -1
- package/Box/cjs/index.production.v2.js +1 -1
- package/Box/cjs/style.development.css +1 -1
- package/Box/cjs/style.development.v2.css +1 -1
- package/Box/cjs/style.production.css +1 -1
- package/Box/cjs/style.production.v2.css +1 -1
- package/Box/package.json +1 -1
- package/Button/cjs/index.development.js +4 -7
- package/Button/cjs/index.development.v2.js +4 -7
- package/Button/cjs/index.production.js +1 -1
- package/Button/cjs/index.production.v2.js +1 -1
- package/Button/cjs/style.development.css +1 -1
- package/Button/cjs/style.development.v2.css +1 -1
- package/Button/cjs/style.production.css +1 -1
- package/Button/cjs/style.production.v2.css +1 -1
- package/Button/index.d.ts +1 -1
- package/Button/package.json +1 -1
- package/ButtonPageUp/cjs/index.development.js +3 -6
- package/ButtonPageUp/cjs/index.development.v2.js +3 -6
- package/ButtonPageUp/cjs/index.production.js +1 -1
- package/ButtonPageUp/cjs/index.production.v2.js +1 -1
- package/ButtonPageUp/index.d.ts +1 -1
- package/ButtonPageUp/package.json +1 -1
- package/Checkbox/cjs/index.development.js +5 -11
- package/Checkbox/cjs/index.development.v2.js +5 -11
- package/Checkbox/cjs/index.production.js +1 -1
- package/Checkbox/cjs/index.production.v2.js +1 -1
- package/Checkbox/index.d.ts +1 -1
- package/Checkbox/package.json +1 -1
- package/Flex/cjs/index.development.js +0 -2
- package/Flex/cjs/index.development.v2.js +0 -2
- package/Flex/cjs/index.production.js +1 -1
- package/Flex/cjs/index.production.v2.js +1 -1
- package/Flex/package.json +1 -1
- package/Grid/cjs/index.development.js +0 -2
- package/Grid/cjs/index.development.v2.js +0 -2
- package/Grid/cjs/index.production.js +1 -1
- package/Grid/cjs/index.production.v2.js +1 -1
- package/Grid/package.json +1 -1
- package/Icon/cjs/index.development.js +3 -6
- package/Icon/cjs/index.development.v2.js +3 -6
- package/Icon/cjs/index.production.js +1 -1
- package/Icon/cjs/index.production.v2.js +1 -1
- package/Icon/index.d.ts +1 -1
- package/Icon/package.json +1 -1
- package/Image/cjs/index.development.js +0 -2
- package/Image/cjs/index.development.v2.js +0 -2
- package/Image/cjs/index.production.js +1 -1
- package/Image/cjs/index.production.v2.js +1 -1
- package/Image/package.json +1 -1
- package/ImageEmoji/cjs/index.development.js +3 -6
- package/ImageEmoji/cjs/index.development.v2.js +3 -6
- package/ImageEmoji/cjs/index.production.js +1 -1
- package/ImageEmoji/cjs/index.production.v2.js +1 -1
- package/ImageEmoji/index.d.ts +1 -1
- package/ImageEmoji/package.json +1 -1
- package/Input/cjs/index.development.js +3 -6
- package/Input/cjs/index.development.v2.js +3 -6
- package/Input/cjs/index.production.js +1 -1
- package/Input/cjs/index.production.v2.js +1 -1
- package/Input/index.d.ts +1 -1
- package/Input/package.json +1 -1
- package/InputField/addons/AfterClearValue.d.ts +1 -1
- package/InputField/addons/AfterTogglePassword.d.ts +1 -1
- package/InputField/addons/ErrorText.d.ts +1 -1
- package/InputField/cjs/index.development.js +3 -6
- package/InputField/cjs/index.development.v2.js +3 -6
- package/InputField/cjs/index.production.js +1 -1
- package/InputField/cjs/index.production.v2.js +1 -1
- package/InputField/index.d.ts +1 -1
- package/InputField/package.json +1 -1
- package/KeyPress/cjs/index.development.js +3 -6
- package/KeyPress/cjs/index.development.v2.js +3 -6
- package/KeyPress/cjs/index.production.js +1 -1
- package/KeyPress/cjs/index.production.v2.js +1 -1
- package/KeyPress/index.d.ts +1 -1
- package/KeyPress/package.json +1 -1
- package/Line/cjs/index.development.js +0 -2
- package/Line/cjs/index.development.v2.js +0 -2
- package/Line/cjs/index.production.js +1 -1
- package/Line/cjs/index.production.v2.js +1 -1
- package/Line/package.json +1 -1
- package/Link/cjs/index.development.js +0 -2
- package/Link/cjs/index.development.v2.js +0 -2
- package/Link/cjs/index.production.js +1 -1
- package/Link/cjs/index.production.v2.js +1 -1
- package/Link/cjs/style.development.css +1 -1
- package/Link/cjs/style.development.v2.css +1 -1
- package/Link/cjs/style.production.css +1 -1
- package/Link/cjs/style.production.v2.css +1 -1
- package/Link/package.json +1 -1
- package/List/cjs/index.development.js +0 -2
- package/List/cjs/index.development.v2.js +0 -2
- package/List/cjs/index.production.js +1 -1
- package/List/cjs/index.production.v2.js +1 -1
- package/List/package.json +1 -1
- package/Media/breakpoints.d.ts +1 -1
- package/Media/cjs/index.development.js +3 -10
- package/Media/cjs/index.development.v2.js +3 -10
- package/Media/cjs/index.production.js +1 -1
- package/Media/cjs/index.production.v2.js +1 -1
- package/Media/context.d.ts +1 -1
- package/Media/index.d.ts +1 -1
- package/Media/package.json +1 -1
- package/Media/useMedia.d.ts +1 -1
- package/OutsideClick/cjs/index.development.js +3 -6
- package/OutsideClick/cjs/index.development.v2.js +3 -6
- package/OutsideClick/cjs/index.production.js +1 -1
- package/OutsideClick/cjs/index.production.v2.js +1 -1
- package/OutsideClick/index.d.ts +1 -1
- package/OutsideClick/package.json +1 -1
- package/Overlay/cjs/index.development.js +60 -84
- package/Overlay/cjs/index.development.v2.js +60 -84
- package/Overlay/cjs/index.production.js +1 -1
- package/Overlay/cjs/index.production.v2.js +1 -1
- package/Overlay/cjs/style.development.css +1 -1
- package/Overlay/cjs/style.development.v2.css +1 -1
- package/Overlay/cjs/style.production.css +1 -1
- package/Overlay/cjs/style.production.v2.css +1 -1
- package/Overlay/components/OverlayHeader.d.ts +11 -0
- package/Overlay/{SwipeClose.d.ts → components/SwipeClose.d.ts} +1 -1
- package/Overlay/{TouchScrollable.d.ts → components/TouchScrollable.d.ts} +1 -1
- package/Overlay/index.d.ts +6 -2
- package/Overlay/package.json +2 -2
- package/Overlay/utils.d.ts +8 -8
- package/Picture/cjs/index.development.js +0 -2
- package/Picture/cjs/index.development.v2.js +0 -2
- package/Picture/cjs/index.production.js +1 -1
- package/Picture/cjs/index.production.v2.js +1 -1
- package/Picture/package.json +1 -1
- package/PortableOverlay/cjs/index.development.js +5 -11
- package/PortableOverlay/cjs/index.development.v2.js +5 -11
- package/PortableOverlay/cjs/index.production.js +1 -1
- package/PortableOverlay/cjs/index.production.v2.js +1 -1
- package/PortableOverlay/cjs/style.development.css +1 -1
- package/PortableOverlay/cjs/style.development.v2.css +1 -1
- package/PortableOverlay/cjs/style.production.css +1 -1
- package/PortableOverlay/cjs/style.production.v2.css +1 -1
- package/PortableOverlay/index.d.ts +1 -1
- package/PortableOverlay/package.json +1 -1
- package/Portal/cjs/index.development.js +3 -6
- package/Portal/cjs/index.development.v2.js +3 -6
- package/Portal/cjs/index.production.js +1 -1
- package/Portal/cjs/index.production.v2.js +1 -1
- package/Portal/index.d.ts +1 -1
- package/Portal/package.json +1 -1
- package/QRCode/cjs/index.development.js +3 -6
- package/QRCode/cjs/index.development.v2.js +3 -6
- package/QRCode/cjs/index.production.js +1 -1
- package/QRCode/cjs/index.production.v2.js +1 -1
- package/QRCode/index.d.ts +1 -1
- package/QRCode/package.json +1 -1
- package/Rating/cjs/index.development.js +3 -6
- package/Rating/cjs/index.development.v2.js +3 -6
- package/Rating/cjs/index.production.js +1 -1
- package/Rating/cjs/index.production.v2.js +1 -1
- package/Rating/index.d.ts +1 -1
- package/Rating/package.json +1 -1
- package/SafeQuery/cjs/index.development.js +14 -20
- package/SafeQuery/cjs/index.development.v2.js +14 -20
- package/SafeQuery/cjs/index.production.js +1 -1
- package/SafeQuery/cjs/index.production.v2.js +1 -1
- package/SafeQuery/components/Error.d.ts +1 -1
- package/SafeQuery/index.d.ts +1 -1
- package/SafeQuery/package.json +1 -1
- package/Scroll/cjs/index.development.js +3 -6
- package/Scroll/cjs/index.development.v2.js +3 -6
- package/Scroll/cjs/index.production.js +1 -1
- package/Scroll/cjs/index.production.v2.js +1 -1
- package/Scroll/cjs/style.development.css +1 -1
- package/Scroll/cjs/style.development.v2.css +1 -1
- package/Scroll/cjs/style.production.css +1 -1
- package/Scroll/cjs/style.production.v2.css +1 -1
- package/Scroll/index.d.ts +2 -2
- package/Scroll/package.json +1 -1
- package/ScrollControls/ScrollControlsButton.d.ts +1 -1
- package/ScrollControls/cjs/index.development.js +11 -18
- package/ScrollControls/cjs/index.development.v2.js +11 -18
- package/ScrollControls/cjs/index.production.js +1 -1
- package/ScrollControls/cjs/index.production.v2.js +1 -1
- package/ScrollControls/index.d.ts +1 -1
- package/ScrollControls/package.json +1 -1
- package/SideOverlay/blocks.d.ts +1 -1
- package/SideOverlay/cjs/index.development.js +5 -12
- package/SideOverlay/cjs/index.development.v2.js +5 -12
- package/SideOverlay/cjs/index.production.js +1 -1
- package/SideOverlay/cjs/index.production.v2.js +1 -1
- package/SideOverlay/index.d.ts +1 -1
- package/SideOverlay/package.json +1 -1
- package/SideOverlay/utils.d.ts +3 -3
- package/SimpleSlider/cjs/index.development.js +6 -13
- package/SimpleSlider/cjs/index.development.v2.js +6 -13
- package/SimpleSlider/cjs/index.production.js +1 -1
- package/SimpleSlider/cjs/index.production.v2.js +1 -1
- package/SimpleSlider/index.d.ts +1 -1
- package/SimpleSlider/package.json +1 -1
- package/SimpleSlider/useAutoPlay.d.ts +1 -1
- package/SimpleSlider/utils.d.ts +2 -2
- package/Skeleton/cjs/index.development.js +3 -6
- package/Skeleton/cjs/index.development.v2.js +3 -6
- package/Skeleton/cjs/index.production.js +1 -1
- package/Skeleton/cjs/index.production.v2.js +1 -1
- package/Skeleton/cjs/style.development.css +1 -1
- package/Skeleton/cjs/style.development.v2.css +1 -1
- package/Skeleton/cjs/style.production.css +1 -1
- package/Skeleton/cjs/style.production.v2.css +1 -1
- package/Skeleton/index.d.ts +1 -1
- package/Skeleton/package.json +1 -1
- package/Spinner/cjs/index.development.js +3 -6
- package/Spinner/cjs/index.development.v2.js +3 -6
- package/Spinner/cjs/index.production.js +1 -1
- package/Spinner/cjs/index.production.v2.js +1 -1
- package/Spinner/cjs/style.development.css +1 -1
- package/Spinner/cjs/style.development.v2.css +1 -1
- package/Spinner/cjs/style.production.css +1 -1
- package/Spinner/cjs/style.production.v2.css +1 -1
- package/Spinner/index.d.ts +1 -1
- package/Spinner/package.json +1 -1
- package/Text/cjs/index.development.js +0 -2
- package/Text/cjs/index.development.v2.js +0 -2
- package/Text/cjs/index.production.js +1 -1
- package/Text/cjs/index.production.v2.js +1 -1
- package/Text/package.json +1 -1
- package/TextEmoji/cjs/index.development.js +3 -6
- package/TextEmoji/cjs/index.development.v2.js +3 -6
- package/TextEmoji/cjs/index.production.js +1 -1
- package/TextEmoji/cjs/index.production.v2.js +1 -1
- package/TextEmoji/index.d.ts +1 -1
- package/TextEmoji/package.json +1 -1
- package/Tooltip/cjs/index.development.js +5 -11
- package/Tooltip/cjs/index.development.v2.js +5 -11
- package/Tooltip/cjs/index.production.js +1 -1
- package/Tooltip/cjs/index.production.v2.js +1 -1
- package/Tooltip/index.d.ts +4 -4
- package/Tooltip/package.json +1 -1
- package/Tumbler/cjs/index.development.js +5 -11
- package/Tumbler/cjs/index.development.v2.js +5 -11
- package/Tumbler/cjs/index.production.js +1 -1
- package/Tumbler/cjs/index.production.v2.js +1 -1
- package/Tumbler/index.d.ts +1 -1
- package/Tumbler/package.json +1 -1
- package/base/colors-dark.css +11 -11
- package/base/colors.css +57 -57
- package/base/reset.css +1 -1
- package/base/typography.css +8 -8
- package/package.json +71 -68
- package/Overlay/blocks.d.ts +0 -28
package/Media/breakpoints.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export declare const SCREEN_BREAKPOINTS: {
|
|
|
6
6
|
wide: number;
|
|
7
7
|
huge: number;
|
|
8
8
|
};
|
|
9
|
-
export
|
|
9
|
+
export type tSCREEN_BREAKPOINTS = keyof typeof SCREEN_BREAKPOINTS;
|
|
10
10
|
export declare const SCREEN_BREAKPOINTS_PROXY: {
|
|
11
11
|
small: number;
|
|
12
12
|
medium: number;
|
|
@@ -1,16 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
3
|
var reactResponsive = require('react-responsive');
|
|
6
4
|
var React = require('react');
|
|
7
5
|
var PropTypes = require('prop-types');
|
|
8
6
|
|
|
9
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
10
|
-
|
|
11
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
12
|
-
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
13
|
-
|
|
14
7
|
var MIN_SCREEN_WIDTH = 1;
|
|
15
8
|
var SCREEN_BREAKPOINTS = {
|
|
16
9
|
small: 480,
|
|
@@ -60,7 +53,7 @@ var MediaProvider = function (_a) {
|
|
|
60
53
|
setValue(undefined);
|
|
61
54
|
}
|
|
62
55
|
}, []);
|
|
63
|
-
return
|
|
56
|
+
return React.createElement(reactResponsive.Context.Provider, {
|
|
64
57
|
value: value
|
|
65
58
|
}, children);
|
|
66
59
|
};
|
|
@@ -68,9 +61,9 @@ var MediaProvider = function (_a) {
|
|
|
68
61
|
// resetOnMount: false,
|
|
69
62
|
// };
|
|
70
63
|
MediaProvider.propTypes = {
|
|
71
|
-
resetOnMount:
|
|
64
|
+
resetOnMount: PropTypes.bool,
|
|
72
65
|
// children: PropTypes.node.isRequired,
|
|
73
|
-
width:
|
|
66
|
+
width: PropTypes.oneOf(['small', 'medium', 'large', 'wide', 'huge'])
|
|
74
67
|
};
|
|
75
68
|
|
|
76
69
|
var Media = function (_a) {
|
|
@@ -1,16 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
3
|
var reactResponsive = require('react-responsive');
|
|
6
4
|
var React = require('react');
|
|
7
5
|
var PropTypes = require('prop-types');
|
|
8
6
|
|
|
9
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
10
|
-
|
|
11
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
12
|
-
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
13
|
-
|
|
14
7
|
var MIN_SCREEN_WIDTH = 1;
|
|
15
8
|
var SCREEN_BREAKPOINTS = {
|
|
16
9
|
small: 480,
|
|
@@ -60,7 +53,7 @@ var MediaProvider = function (_a) {
|
|
|
60
53
|
setValue(undefined);
|
|
61
54
|
}
|
|
62
55
|
}, []);
|
|
63
|
-
return
|
|
56
|
+
return React.createElement(reactResponsive.Context.Provider, {
|
|
64
57
|
value: value
|
|
65
58
|
}, children);
|
|
66
59
|
};
|
|
@@ -68,9 +61,9 @@ var MediaProvider = function (_a) {
|
|
|
68
61
|
// resetOnMount: false,
|
|
69
62
|
// };
|
|
70
63
|
MediaProvider.propTypes = {
|
|
71
|
-
resetOnMount:
|
|
64
|
+
resetOnMount: PropTypes.bool,
|
|
72
65
|
// children: PropTypes.node.isRequired,
|
|
73
|
-
width:
|
|
66
|
+
width: PropTypes.oneOf(['small', 'medium', 'large', 'wide', 'huge'])
|
|
74
67
|
};
|
|
75
68
|
|
|
76
69
|
var Media = function (_a) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";var e=require("react-responsive"),r=require("react"),t=require("prop-types"),i={small:480,medium:768,large:960,wide:1200,huge:1400},n=new Proxy(i,{get:function(e,r){if(!e.hasOwnProperty(r)){var t=JSON.stringify(Object.keys(e));throw new Error('Media received unknown width "'.concat(r,'". You should use one of ').concat(t))}return e[r]}}),o=function(e){return"production"!==process.env.NODE_ENV?n[e]:i[e]},u=function(r){var t=r.minWidth,i=r.maxWidth;return e.useMediaQuery({minWidth:t?o(t):1,maxWidth:i?o(i)-1:void 0})},d=function(t){var i=t.resetOnMount,n=void 0!==i&&i,u=t.width,d=t.children,a=r.useState({width:u?o(u):1}),s=a[0],c=a[1];return r.useEffect((function(){n&&c(void 0)}),[]),r.createElement(e.Context.Provider,{value:s},d)};d.propTypes={resetOnMount:t.bool,width:t.oneOf(["small","medium","large","wide","huge"])};exports.Media=function(e){var r=e.minWidth,t=e.maxWidth,i=e.children;return u({minWidth:r,maxWidth:t})?i:null},exports.MediaProvider=d,exports.useMedia=u;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";var e=require("react-responsive"),r=require("react"),t=require("prop-types"),i={small:480,medium:768,large:960,wide:1200,huge:1400},n=new Proxy(i,{get:function(e,r){if(!e.hasOwnProperty(r)){var t=JSON.stringify(Object.keys(e));throw new Error('Media received unknown width "'.concat(r,'". You should use one of ').concat(t))}return e[r]}}),o=function(e){return"production"!==process.env.NODE_ENV?n[e]:i[e]},u=function(r){var t=r.minWidth,i=r.maxWidth;return e.useMediaQuery({minWidth:t?o(t):1,maxWidth:i?o(i)-1:void 0})},d=function(t){var i=t.resetOnMount,n=void 0!==i&&i,u=t.width,d=t.children,a=r.useState({width:u?o(u):1}),s=a[0],c=a[1];return r.useEffect((function(){n&&c(void 0)}),[]),r.createElement(e.Context.Provider,{value:s},d)};d.propTypes={resetOnMount:t.bool,width:t.oneOf(["small","medium","large","wide","huge"])};exports.Media=function(e){var r=e.minWidth,t=e.maxWidth,i=e.children;return u({minWidth:r,maxWidth:t})?i:null},exports.MediaProvider=d,exports.useMedia=u;
|
package/Media/context.d.ts
CHANGED
package/Media/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
import { tSCREEN_BREAKPOINTS } from './breakpoints';
|
|
3
3
|
import { useMedia } from './useMedia';
|
|
4
4
|
import { MediaProvider } from './context';
|
|
5
|
-
export
|
|
5
|
+
export type MediaProps = {
|
|
6
6
|
minWidth?: tSCREEN_BREAKPOINTS;
|
|
7
7
|
maxWidth?: tSCREEN_BREAKPOINTS;
|
|
8
8
|
/** React children */
|
package/Media/package.json
CHANGED
package/Media/useMedia.d.ts
CHANGED
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
3
|
var React = require('react');
|
|
6
4
|
var useOutsideClick = require('@prom-ui/hooks/useOutsideClick');
|
|
7
5
|
|
|
8
|
-
function
|
|
9
|
-
if (e && e.__esModule) return e;
|
|
6
|
+
function _interopNamespaceDefault(e) {
|
|
10
7
|
var n = Object.create(null);
|
|
11
8
|
if (e) {
|
|
12
9
|
Object.keys(e).forEach(function (k) {
|
|
@@ -19,11 +16,11 @@ function _interopNamespace(e) {
|
|
|
19
16
|
}
|
|
20
17
|
});
|
|
21
18
|
}
|
|
22
|
-
n
|
|
19
|
+
n.default = e;
|
|
23
20
|
return Object.freeze(n);
|
|
24
21
|
}
|
|
25
22
|
|
|
26
|
-
var React__namespace = /*#__PURE__*/
|
|
23
|
+
var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
|
|
27
24
|
|
|
28
25
|
/******************************************************************************
|
|
29
26
|
Copyright (c) Microsoft Corporation.
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
3
|
var React = require('react');
|
|
6
4
|
var useOutsideClick = require('@prom-ui/hooks/useOutsideClick');
|
|
7
5
|
|
|
8
|
-
function
|
|
9
|
-
if (e && e.__esModule) return e;
|
|
6
|
+
function _interopNamespaceDefault(e) {
|
|
10
7
|
var n = Object.create(null);
|
|
11
8
|
if (e) {
|
|
12
9
|
Object.keys(e).forEach(function (k) {
|
|
@@ -19,11 +16,11 @@ function _interopNamespace(e) {
|
|
|
19
16
|
}
|
|
20
17
|
});
|
|
21
18
|
}
|
|
22
|
-
n
|
|
19
|
+
n.default = e;
|
|
23
20
|
return Object.freeze(n);
|
|
24
21
|
}
|
|
25
22
|
|
|
26
|
-
var React__namespace = /*#__PURE__*/
|
|
23
|
+
var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
|
|
27
24
|
|
|
28
25
|
/******************************************************************************
|
|
29
26
|
Copyright (c) Microsoft Corporation.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";var e=require("react"),t=require("@prom-ui/hooks/useOutsideClick");function r(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var n=r(e),i=function(){return i=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i.apply(this,arguments)};exports.OutsideClick=function(e){var r=e.children,c=e.isActive,o=void 0===c||c,l=e.onClick,u=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r}(e,["children","isActive","onClick"]),a=t.useOutsideClick(l)[0];return o?n.createElement("div",i({},u,{ref:a}),r):n.createElement("div",null,r)};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";var e=require("react"),t=require("@prom-ui/hooks/useOutsideClick");function r(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var n=r(e),i=function(){return i=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i.apply(this,arguments)};exports.OutsideClick=function(e){var r=e.children,c=e.isActive,o=void 0===c||c,l=e.onClick,u=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r}(e,["children","isActive","onClick"]),a=t.useOutsideClick(l)[0];return o?n.createElement("div",i({},u,{ref:a}),r):n.createElement("div",null,r)};
|
package/OutsideClick/index.d.ts
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
3
|
var React = require('react');
|
|
6
4
|
var ScrollLock = require('react-scrolllock');
|
|
5
|
+
var reactTransitionGroup = require('react-transition-group');
|
|
6
|
+
var classNames = require('classnames');
|
|
7
|
+
var Backdrop = require('@prom-ui/core/Backdrop');
|
|
7
8
|
var KeyPress = require('@prom-ui/core/KeyPress');
|
|
8
9
|
var Portal = require('@prom-ui/core/Portal');
|
|
9
10
|
var Media = require('@prom-ui/core/Media');
|
|
10
|
-
var evokit = require('evokit');
|
|
11
|
-
var reactTransitionGroup = require('react-transition-group');
|
|
12
11
|
var Button = require('@prom-ui/core/Button');
|
|
13
12
|
var Icon = require('@prom-ui/core/Icon');
|
|
14
13
|
var Text = require('@prom-ui/core/Text');
|
|
@@ -18,10 +17,7 @@ var ArrowBack = require('@prom-ui/icons/ArrowBack');
|
|
|
18
17
|
var utils = require('react-scrolllock/dist/utils');
|
|
19
18
|
var Swipe = require('react-easy-swipe');
|
|
20
19
|
|
|
21
|
-
function
|
|
22
|
-
|
|
23
|
-
function _interopNamespace(e) {
|
|
24
|
-
if (e && e.__esModule) return e;
|
|
20
|
+
function _interopNamespaceDefault(e) {
|
|
25
21
|
var n = Object.create(null);
|
|
26
22
|
if (e) {
|
|
27
23
|
Object.keys(e).forEach(function (k) {
|
|
@@ -34,14 +30,11 @@ function _interopNamespace(e) {
|
|
|
34
30
|
}
|
|
35
31
|
});
|
|
36
32
|
}
|
|
37
|
-
n
|
|
33
|
+
n.default = e;
|
|
38
34
|
return Object.freeze(n);
|
|
39
35
|
}
|
|
40
36
|
|
|
41
|
-
var
|
|
42
|
-
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
43
|
-
var ScrollLock__default = /*#__PURE__*/_interopDefaultLegacy(ScrollLock);
|
|
44
|
-
var Swipe__default = /*#__PURE__*/_interopDefaultLegacy(Swipe);
|
|
37
|
+
var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
|
|
45
38
|
|
|
46
39
|
/******************************************************************************
|
|
47
40
|
Copyright (c) Microsoft Corporation.
|
|
@@ -88,33 +81,6 @@ function __makeTemplateObject(cooked, raw) {
|
|
|
88
81
|
|
|
89
82
|
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","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"};
|
|
90
83
|
|
|
91
|
-
var BLOCKS_PRESET = {
|
|
92
|
-
css: css,
|
|
93
|
-
b: ''
|
|
94
|
-
};
|
|
95
|
-
var Root = evokit.createBlock('div', 'root', [], BLOCKS_PRESET);
|
|
96
|
-
var Backdrop = evokit.createBlock('div', 'backdrop', [], BLOCKS_PRESET);
|
|
97
|
-
var Popup = evokit.createBlock('div', 'popup', ['placement'], BLOCKS_PRESET);
|
|
98
|
-
var OverlayContent = evokit.createBlock('div', 'content', [], BLOCKS_PRESET);
|
|
99
|
-
var Animate = function (_a) {
|
|
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;
|
|
108
|
-
return React__default["default"].createElement(reactTransitionGroup.CSSTransition, {
|
|
109
|
-
in: open,
|
|
110
|
-
timeout: enabled ? 225 : 0,
|
|
111
|
-
classNames: css,
|
|
112
|
-
unmountOnExit: true,
|
|
113
|
-
onEnter: onEnter,
|
|
114
|
-
onEntered: onEntered,
|
|
115
|
-
onExited: onExited
|
|
116
|
-
}, children);
|
|
117
|
-
};
|
|
118
84
|
var OverlayHeader = function (_a) {
|
|
119
85
|
var isShowPrevButton = _a.isShowPrevButton,
|
|
120
86
|
isShowCloseButton = _a.isShowCloseButton,
|
|
@@ -123,65 +89,46 @@ var OverlayHeader = function (_a) {
|
|
|
123
89
|
onClose = _a.onClose,
|
|
124
90
|
onPrev = _a.onPrev;
|
|
125
91
|
var t = BodyProvider.useBodyLocale().t;
|
|
126
|
-
return
|
|
92
|
+
return React.createElement("header", {
|
|
127
93
|
className: css.header
|
|
128
|
-
}, typeof children !== 'undefined' ? children :
|
|
94
|
+
}, typeof children !== 'undefined' ? children : React.createElement("div", {
|
|
129
95
|
className: css.header__grid
|
|
130
|
-
},
|
|
96
|
+
}, React.createElement("div", {
|
|
131
97
|
className: css.header__action
|
|
132
|
-
}, isShowPrevButton &&
|
|
98
|
+
}, isShowPrevButton && React.createElement(Button.Button, {
|
|
133
99
|
className: css.header__actionButton,
|
|
134
100
|
"button-theme": 'black-inherit',
|
|
135
101
|
type: 'button',
|
|
136
102
|
onClick: onPrev,
|
|
137
103
|
"aria-label": t(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\u041D\u0430\u0437\u0430\u0434"], ["\u041D\u0430\u0437\u0430\u0434"]))),
|
|
138
104
|
"data-qaid": 'prev'
|
|
139
|
-
},
|
|
105
|
+
}, React.createElement(Icon.Icon, {
|
|
140
106
|
"icon-as": ArrowBack.ArrowBack,
|
|
141
107
|
className: css.header__actionIcon
|
|
142
|
-
}))),
|
|
108
|
+
}))), React.createElement("div", {
|
|
143
109
|
className: css.header__title
|
|
144
|
-
}, typeof title === 'string' ?
|
|
110
|
+
}, typeof title === 'string' ? React.createElement(Text.Text, {
|
|
145
111
|
"text-align": 'center',
|
|
146
112
|
"text-size": 'h4',
|
|
147
113
|
"text-wrap": 'ellipsis',
|
|
148
114
|
"text-weight": 'bold',
|
|
149
115
|
"data-qaid": 'title'
|
|
150
|
-
}, title) : title),
|
|
116
|
+
}, title) : title), React.createElement("div", {
|
|
151
117
|
className: css.header__action
|
|
152
|
-
}, isShowCloseButton && onClose &&
|
|
118
|
+
}, isShowCloseButton && onClose && React.createElement(Button.Button, {
|
|
153
119
|
className: css.header__actionButton,
|
|
154
120
|
"button-theme": 'black-inherit',
|
|
155
121
|
type: 'button',
|
|
156
122
|
onClick: onClose,
|
|
157
123
|
"aria-label": t(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\u0417\u0430\u043A\u0440\u044B\u0442\u044C"], ["\u0417\u0430\u043A\u0440\u044B\u0442\u044C"]))),
|
|
158
124
|
"data-qaid": 'close'
|
|
159
|
-
},
|
|
125
|
+
}, React.createElement(Icon.Icon, {
|
|
160
126
|
"icon-as": Close.Close,
|
|
161
127
|
className: css.header__actionIcon
|
|
162
128
|
})))));
|
|
163
129
|
};
|
|
164
|
-
var OverlayFooter = function (_a) {
|
|
165
|
-
var children = _a.children;
|
|
166
|
-
return React__default["default"].createElement("div", {
|
|
167
|
-
className: css.footer
|
|
168
|
-
}, children);
|
|
169
|
-
};
|
|
170
130
|
var templateObject_1, templateObject_2;
|
|
171
131
|
|
|
172
|
-
var getPopupStyle = function (placement, size, maxSize) {
|
|
173
|
-
if (['top', 'bottom'].includes(placement)) {
|
|
174
|
-
return {
|
|
175
|
-
height: size,
|
|
176
|
-
maxHeight: maxSize
|
|
177
|
-
};
|
|
178
|
-
}
|
|
179
|
-
return {
|
|
180
|
-
width: size,
|
|
181
|
-
maxWidth: maxSize
|
|
182
|
-
};
|
|
183
|
-
};
|
|
184
|
-
|
|
185
132
|
// FORK FROM https://github.com/jossmac/react-scrolllock/blob/master/src/TouchScrollable.js
|
|
186
133
|
var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
|
|
187
134
|
/* @ts-ignore */
|
|
@@ -295,7 +242,7 @@ var SwipeClose = function (_a) {
|
|
|
295
242
|
});
|
|
296
243
|
setStyle(contentRef.current, {
|
|
297
244
|
'pointer-events': "none",
|
|
298
|
-
|
|
245
|
+
overflow: 'hidden'
|
|
299
246
|
});
|
|
300
247
|
}
|
|
301
248
|
};
|
|
@@ -307,7 +254,7 @@ var SwipeClose = function (_a) {
|
|
|
307
254
|
});
|
|
308
255
|
setStyle(contentRef.current, {
|
|
309
256
|
'pointer-events': null,
|
|
310
|
-
|
|
257
|
+
overflow: null
|
|
311
258
|
});
|
|
312
259
|
setTimeout(function () {
|
|
313
260
|
setStyle(rootRef.current, {
|
|
@@ -323,13 +270,30 @@ var SwipeClose = function (_a) {
|
|
|
323
270
|
isAllowSwipe.current = null;
|
|
324
271
|
isAllowClose.current = false;
|
|
325
272
|
};
|
|
326
|
-
return React__namespace.createElement(
|
|
273
|
+
return React__namespace.createElement(Swipe, {
|
|
327
274
|
onSwipeMove: onSwipeMove,
|
|
328
275
|
onSwipeEnd: onSwipeEnd
|
|
329
276
|
}, children);
|
|
330
277
|
};
|
|
331
278
|
|
|
279
|
+
var getPopupStyle = function (placement, size, maxSize) {
|
|
280
|
+
if (['top', 'bottom'].includes(placement)) {
|
|
281
|
+
return {
|
|
282
|
+
height: size,
|
|
283
|
+
maxHeight: maxSize
|
|
284
|
+
};
|
|
285
|
+
}
|
|
286
|
+
return {
|
|
287
|
+
width: size,
|
|
288
|
+
maxWidth: maxSize
|
|
289
|
+
};
|
|
290
|
+
};
|
|
291
|
+
|
|
332
292
|
var DEFAULT_SIZE = 400;
|
|
293
|
+
/**
|
|
294
|
+
* Компонент используется для создания оверлея (накладывающегося слоя) на верху содержимого.
|
|
295
|
+
* Он может использоваться, например, для создания модальных окон, выпадающих списков и других элементов интерфейса.
|
|
296
|
+
*/
|
|
333
297
|
var Overlay = function (_a) {
|
|
334
298
|
var children = _a.children,
|
|
335
299
|
onClose = _a.onClose,
|
|
@@ -391,12 +355,19 @@ var Overlay = function (_a) {
|
|
|
391
355
|
if (placement === 'adaptive') {
|
|
392
356
|
currentPlacement = isMinWidthMedium ? 'right' : 'bottom';
|
|
393
357
|
}
|
|
394
|
-
return React__namespace.createElement(
|
|
395
|
-
|
|
358
|
+
return React__namespace.createElement(React__namespace.Fragment, null, React__namespace.createElement(Backdrop.Backdrop, {
|
|
359
|
+
isOpen: isOpen,
|
|
360
|
+
isAnimated: isAnimated,
|
|
361
|
+
zIndex: zIndex - 1,
|
|
362
|
+
isRenderPortal: isRenderPortal
|
|
363
|
+
}), React__namespace.createElement(reactTransitionGroup.CSSTransition, {
|
|
364
|
+
in: isOpen,
|
|
365
|
+
timeout: isAnimated ? 225 : 0,
|
|
366
|
+
classNames: css,
|
|
367
|
+
unmountOnExit: true,
|
|
396
368
|
onEnter: onOpen,
|
|
397
369
|
onEntered: onOpened,
|
|
398
|
-
onExited: onClosed
|
|
399
|
-
enabled: isAnimated
|
|
370
|
+
onExited: onClosed
|
|
400
371
|
}, React__namespace.createElement(Portal.Portal, {
|
|
401
372
|
isActive: isRenderPortal
|
|
402
373
|
}, React__namespace.createElement(SwipeClose, {
|
|
@@ -405,27 +376,29 @@ var Overlay = function (_a) {
|
|
|
405
376
|
contentRef: currentContentRef,
|
|
406
377
|
placement: currentPlacement,
|
|
407
378
|
onClose: onClose
|
|
408
|
-
}, React__namespace.createElement(
|
|
379
|
+
}, React__namespace.createElement("div", __assign({
|
|
380
|
+
className: css.root,
|
|
409
381
|
role: 'presentation',
|
|
410
382
|
style: {
|
|
411
383
|
zIndex: zIndex
|
|
412
384
|
}
|
|
413
|
-
}, props), React__namespace.createElement(
|
|
385
|
+
}, props), React__namespace.createElement(ScrollLock, {
|
|
414
386
|
isActive: isScrollLock
|
|
415
387
|
}), React__namespace.createElement(KeyPress.KeyPress, {
|
|
416
388
|
isActive: isCloseOnEscape,
|
|
417
389
|
code: 'Escape',
|
|
418
390
|
onKeyDown: onClose
|
|
419
|
-
}), React__namespace.createElement(
|
|
391
|
+
}), React__namespace.createElement("div", {
|
|
392
|
+
className: css.backdrop,
|
|
420
393
|
"aria-hidden": true,
|
|
421
394
|
onClick: function (e) {
|
|
422
395
|
if (isCloseOutsideClick && onClose) {
|
|
423
396
|
onClose(e);
|
|
424
397
|
}
|
|
425
398
|
}
|
|
426
|
-
}), React__namespace.createElement(
|
|
399
|
+
}), React__namespace.createElement("div", {
|
|
427
400
|
ref: popupRef,
|
|
428
|
-
|
|
401
|
+
className: classNames(css.popup, css["popup_placement_".concat(currentPlacement)]),
|
|
429
402
|
"aria-modal": true,
|
|
430
403
|
role: 'dialog',
|
|
431
404
|
style: getPopupStyle(currentPlacement, currentSize, maxSize),
|
|
@@ -436,15 +409,18 @@ var Overlay = function (_a) {
|
|
|
436
409
|
onClose: onClose,
|
|
437
410
|
onPrev: onPrev,
|
|
438
411
|
title: title
|
|
439
|
-
}, header), React__namespace.createElement(
|
|
412
|
+
}, header), React__namespace.createElement("footer", {
|
|
413
|
+
className: css.footer
|
|
414
|
+
}, footer), React__namespace.createElement(TouchScrollable, {
|
|
440
415
|
isActive: isScrollLockTouch,
|
|
441
416
|
scrollRef: currentContentRef
|
|
442
|
-
}, React__namespace.createElement(
|
|
417
|
+
}, React__namespace.createElement("div", {
|
|
418
|
+
className: css.content,
|
|
443
419
|
ref: currentContentRef,
|
|
444
420
|
style: {
|
|
445
421
|
padding: padding
|
|
446
422
|
}
|
|
447
|
-
}, children)))))));
|
|
423
|
+
}, children))))))));
|
|
448
424
|
};
|
|
449
425
|
|
|
450
426
|
exports.Overlay = Overlay;
|