glints-aries 4.0.225 → 4.0.227
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/es/@next/Modal/Modal.js +10 -1
- package/es/@next/Modal/Modal.stories.d.ts +2 -0
- package/es/@next/Modal/ModalStyle.js +2 -2
- package/es/@next/Modal/ModalWithProvider.stories.d.ts +1 -0
- package/lib/@next/Modal/Modal.js +12 -1
- package/lib/@next/Modal/Modal.stories.d.ts +2 -0
- package/lib/@next/Modal/ModalStyle.js +2 -2
- package/lib/@next/Modal/ModalWithProvider.stories.d.ts +1 -0
- package/package.json +1 -1
package/es/@next/Modal/Modal.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
|
|
3
3
|
var _excluded = ["isOpen", "header", "headerDescription", "children", "secondaryAction", "primaryAction", "customActions", "showBackButton", "showCloseButton", "showHeaderBorder", "closeOnClickOutside", "onClose", "onBack"];
|
|
4
|
-
import React from 'react';
|
|
4
|
+
import React, { useEffect } from 'react';
|
|
5
5
|
import { Button, PrimaryButton } from '../Button';
|
|
6
6
|
import { ButtonGroup } from '../ButtonGroup';
|
|
7
7
|
import { Icon } from '../Icon';
|
|
@@ -25,6 +25,15 @@ export var Modal = /*#__PURE__*/React.forwardRef(function Modal(_ref, ref) {
|
|
|
25
25
|
onClose = _ref.onClose,
|
|
26
26
|
onBack = _ref.onBack,
|
|
27
27
|
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
28
|
+
useEffect(function () {
|
|
29
|
+
if (isOpen) {
|
|
30
|
+
if (typeof window != 'undefined' && window.document) {
|
|
31
|
+
document.body.style.overflow = 'hidden';
|
|
32
|
+
}
|
|
33
|
+
} else {
|
|
34
|
+
document.body.style.overflow = 'unset';
|
|
35
|
+
}
|
|
36
|
+
}, [isOpen]);
|
|
28
37
|
if (!isOpen) {
|
|
29
38
|
return null;
|
|
30
39
|
}
|
|
@@ -3,5 +3,7 @@ declare const _default: Meta<import("@storybook/react").Args>;
|
|
|
3
3
|
export default _default;
|
|
4
4
|
export declare const Interactive: any;
|
|
5
5
|
export declare const WithLargeContent: any;
|
|
6
|
+
export declare const WithOverflowContent: any;
|
|
7
|
+
export declare const WithLockedScrollableBackdrop: any;
|
|
6
8
|
export declare const WithSpinner: any;
|
|
7
9
|
export declare const WithCustomActions: any;
|
|
@@ -10,7 +10,7 @@ export var StyledModalWrapper = styled.div.withConfig({
|
|
|
10
10
|
export var StyledModalContainer = styled.div.withConfig({
|
|
11
11
|
displayName: "ModalStyle__StyledModalContainer",
|
|
12
12
|
componentId: "sc-1694up4-1"
|
|
13
|
-
})(["position:relative;background:", ";display:flex;flex-direction:column;justify-content:space-between;align-items:flex-start;padding:0;box-shadow:0px 26px 80px rgba(0,0,0,0.2),0px 0px 1px rgba(0,0,0,0.2);border-radius:", ";min-width:320px;width:fit-content;max-width:calc(100vw - 32px);"], Neutral.B100, borderRadius8);
|
|
13
|
+
})(["position:relative;background:", ";display:flex;flex-direction:column;justify-content:space-between;align-items:flex-start;padding:0;box-shadow:0px 26px 80px rgba(0,0,0,0.2),0px 0px 1px rgba(0,0,0,0.2);border-radius:", ";min-width:320px;width:fit-content;max-width:calc(100vw - 32px);height:fit-content;max-height:calc(100vh - 96px);"], Neutral.B100, borderRadius8);
|
|
14
14
|
export var StyledModalHeader = styled.div.withConfig({
|
|
15
15
|
displayName: "ModalStyle__StyledModalHeader",
|
|
16
16
|
componentId: "sc-1694up4-2"
|
|
@@ -18,7 +18,7 @@ export var StyledModalHeader = styled.div.withConfig({
|
|
|
18
18
|
export var StyledModalContent = styled.div.withConfig({
|
|
19
19
|
displayName: "ModalStyle__StyledModalContent",
|
|
20
20
|
componentId: "sc-1694up4-3"
|
|
21
|
-
})(["min-height:24px;color:#202223;width:fit-content;padding:20px;@media (max-width:", "){padding:20px ", ";}"], Breakpoints.large, space16);
|
|
21
|
+
})(["min-height:24px;color:#202223;width:fit-content;padding:20px;overflow:auto;@media (max-width:", "){padding:20px ", ";}"], Breakpoints.large, space16);
|
|
22
22
|
export var StyledModalActions = styled.div.withConfig({
|
|
23
23
|
displayName: "ModalStyle__StyledModalActions",
|
|
24
24
|
componentId: "sc-1694up4-4"
|
package/lib/@next/Modal/Modal.js
CHANGED
|
@@ -5,7 +5,7 @@ exports.__esModule = true;
|
|
|
5
5
|
exports.Modal = void 0;
|
|
6
6
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
7
7
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
8
|
-
var _react =
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
var _Button = require("../Button");
|
|
10
10
|
var _ButtonGroup = require("../ButtonGroup");
|
|
11
11
|
var _Icon = require("../Icon");
|
|
@@ -13,6 +13,8 @@ var _Portal = require("../Portal/Portal");
|
|
|
13
13
|
var _Typography = require("../Typography");
|
|
14
14
|
var _ModalStyle = require("./ModalStyle");
|
|
15
15
|
var _excluded = ["isOpen", "header", "headerDescription", "children", "secondaryAction", "primaryAction", "customActions", "showBackButton", "showCloseButton", "showHeaderBorder", "closeOnClickOutside", "onClose", "onBack"];
|
|
16
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
17
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
16
18
|
var Modal = /*#__PURE__*/_react["default"].forwardRef(function Modal(_ref, ref) {
|
|
17
19
|
var isOpen = _ref.isOpen,
|
|
18
20
|
header = _ref.header,
|
|
@@ -30,6 +32,15 @@ var Modal = /*#__PURE__*/_react["default"].forwardRef(function Modal(_ref, ref)
|
|
|
30
32
|
onClose = _ref.onClose,
|
|
31
33
|
onBack = _ref.onBack,
|
|
32
34
|
props = (0, _objectWithoutPropertiesLoose2["default"])(_ref, _excluded);
|
|
35
|
+
(0, _react.useEffect)(function () {
|
|
36
|
+
if (isOpen) {
|
|
37
|
+
if (typeof window != 'undefined' && window.document) {
|
|
38
|
+
document.body.style.overflow = 'hidden';
|
|
39
|
+
}
|
|
40
|
+
} else {
|
|
41
|
+
document.body.style.overflow = 'unset';
|
|
42
|
+
}
|
|
43
|
+
}, [isOpen]);
|
|
33
44
|
if (!isOpen) {
|
|
34
45
|
return null;
|
|
35
46
|
}
|
|
@@ -3,5 +3,7 @@ declare const _default: Meta<import("@storybook/react").Args>;
|
|
|
3
3
|
export default _default;
|
|
4
4
|
export declare const Interactive: any;
|
|
5
5
|
export declare const WithLargeContent: any;
|
|
6
|
+
export declare const WithOverflowContent: any;
|
|
7
|
+
export declare const WithLockedScrollableBackdrop: any;
|
|
6
8
|
export declare const WithSpinner: any;
|
|
7
9
|
export declare const WithCustomActions: any;
|
|
@@ -18,7 +18,7 @@ exports.StyledModalWrapper = StyledModalWrapper;
|
|
|
18
18
|
var StyledModalContainer = _styledComponents["default"].div.withConfig({
|
|
19
19
|
displayName: "ModalStyle__StyledModalContainer",
|
|
20
20
|
componentId: "sc-1694up4-1"
|
|
21
|
-
})(["position:relative;background:", ";display:flex;flex-direction:column;justify-content:space-between;align-items:flex-start;padding:0;box-shadow:0px 26px 80px rgba(0,0,0,0.2),0px 0px 1px rgba(0,0,0,0.2);border-radius:", ";min-width:320px;width:fit-content;max-width:calc(100vw - 32px);"], _colors.Neutral.B100, _borderRadius.borderRadius8);
|
|
21
|
+
})(["position:relative;background:", ";display:flex;flex-direction:column;justify-content:space-between;align-items:flex-start;padding:0;box-shadow:0px 26px 80px rgba(0,0,0,0.2),0px 0px 1px rgba(0,0,0,0.2);border-radius:", ";min-width:320px;width:fit-content;max-width:calc(100vw - 32px);height:fit-content;max-height:calc(100vh - 96px);"], _colors.Neutral.B100, _borderRadius.borderRadius8);
|
|
22
22
|
exports.StyledModalContainer = StyledModalContainer;
|
|
23
23
|
var StyledModalHeader = _styledComponents["default"].div.withConfig({
|
|
24
24
|
displayName: "ModalStyle__StyledModalHeader",
|
|
@@ -28,7 +28,7 @@ exports.StyledModalHeader = StyledModalHeader;
|
|
|
28
28
|
var StyledModalContent = _styledComponents["default"].div.withConfig({
|
|
29
29
|
displayName: "ModalStyle__StyledModalContent",
|
|
30
30
|
componentId: "sc-1694up4-3"
|
|
31
|
-
})(["min-height:24px;color:#202223;width:fit-content;padding:20px;@media (max-width:", "){padding:20px ", ";}"], Breakpoints.large, _spacing.space16);
|
|
31
|
+
})(["min-height:24px;color:#202223;width:fit-content;padding:20px;overflow:auto;@media (max-width:", "){padding:20px ", ";}"], Breakpoints.large, _spacing.space16);
|
|
32
32
|
exports.StyledModalContent = StyledModalContent;
|
|
33
33
|
var StyledModalActions = _styledComponents["default"].div.withConfig({
|
|
34
34
|
displayName: "ModalStyle__StyledModalActions",
|