@7shifts/sous-chef 2.14.0 → 2.15.1
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/dist/index.css
CHANGED
|
@@ -2807,13 +2807,16 @@ Please ask a designer if you have questions about which colours to use.
|
|
|
2807
2807
|
font-size: 14px;
|
|
2808
2808
|
line-height: 16px;
|
|
2809
2809
|
position: relative;
|
|
2810
|
+
}
|
|
2811
|
+
|
|
2812
|
+
._2ErCP {
|
|
2810
2813
|
z-index: 1;
|
|
2811
2814
|
background: #fff no-repeat;
|
|
2812
2815
|
background-image: radial-gradient(farthest-side at 50% 0, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0)), radial-gradient(farthest-side at 50% 100%, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0));
|
|
2813
2816
|
background-position: 0 0, 0 100%;
|
|
2814
2817
|
background-size: 100% 14px;
|
|
2815
2818
|
}
|
|
2816
|
-
.
|
|
2819
|
+
._2ErCP::before, ._2ErCP::after {
|
|
2817
2820
|
content: "";
|
|
2818
2821
|
position: relative;
|
|
2819
2822
|
z-index: -1;
|
|
@@ -2822,7 +2825,7 @@ Please ask a designer if you have questions about which colours to use.
|
|
|
2822
2825
|
margin: 0 0 -30px;
|
|
2823
2826
|
background: linear-gradient(to bottom, #fff, #fff 30%, rgba(255, 255, 255, 0));
|
|
2824
2827
|
}
|
|
2825
|
-
.
|
|
2828
|
+
._2ErCP::after {
|
|
2826
2829
|
margin: -30px 0 0;
|
|
2827
2830
|
background: linear-gradient(to bottom, rgba(255, 255, 255, 0), #fff 70%, #fff);
|
|
2828
2831
|
}
|
package/dist/index.js
CHANGED
|
@@ -6464,7 +6464,9 @@ var Modal = function Modal(_ref) {
|
|
|
6464
6464
|
_ref$width = _ref.width,
|
|
6465
6465
|
width = _ref$width === void 0 ? 500 : _ref$width,
|
|
6466
6466
|
height = _ref.height,
|
|
6467
|
-
maxWidth = _ref.maxWidth
|
|
6467
|
+
maxWidth = _ref.maxWidth,
|
|
6468
|
+
_ref$shouldReturnFocu = _ref.shouldReturnFocusAfterClose,
|
|
6469
|
+
shouldReturnFocusAfterClose = _ref$shouldReturnFocu === void 0 ? true : _ref$shouldReturnFocu;
|
|
6468
6470
|
var style = {
|
|
6469
6471
|
content: {
|
|
6470
6472
|
width: width,
|
|
@@ -6479,6 +6481,7 @@ var Modal = function Modal(_ref) {
|
|
|
6479
6481
|
isOpen: true,
|
|
6480
6482
|
shouldCloseOnEsc: true,
|
|
6481
6483
|
shouldCloseOnOverlayClick: false,
|
|
6484
|
+
shouldReturnFocusAfterClose: shouldReturnFocusAfterClose,
|
|
6482
6485
|
onRequestClose: onClose,
|
|
6483
6486
|
style: style,
|
|
6484
6487
|
closeTimeoutMS: 200,
|
|
@@ -6505,12 +6508,45 @@ Modal.setAppElement = function (rootElement) {
|
|
|
6505
6508
|
ReactModal.setAppElement(rootElement);
|
|
6506
6509
|
};
|
|
6507
6510
|
|
|
6508
|
-
var
|
|
6511
|
+
var THRESHOLD = 20;
|
|
6512
|
+
var useScrollShadow = function useScrollShadow() {
|
|
6513
|
+
var ref = React.useRef(null);
|
|
6514
|
+
|
|
6515
|
+
var _useState = React.useState(false),
|
|
6516
|
+
showScrollShadow = _useState[0],
|
|
6517
|
+
setShowScrollShadow = _useState[1];
|
|
6518
|
+
|
|
6519
|
+
React.useEffect(function () {
|
|
6520
|
+
if (!ref.current) {
|
|
6521
|
+
return;
|
|
6522
|
+
}
|
|
6523
|
+
|
|
6524
|
+
var modalBody = ref.current;
|
|
6525
|
+
|
|
6526
|
+
if (modalBody.offsetHeight > THRESHOLD) {
|
|
6527
|
+
setShowScrollShadow(true);
|
|
6528
|
+
}
|
|
6529
|
+
}, []);
|
|
6530
|
+
return {
|
|
6531
|
+
ref: ref,
|
|
6532
|
+
showScrollShadow: showScrollShadow
|
|
6533
|
+
};
|
|
6534
|
+
};
|
|
6535
|
+
|
|
6536
|
+
var styles$y = {"modal-body":"_2J-ku","modal-body--with-scroll-shadow":"_2ErCP"};
|
|
6509
6537
|
|
|
6510
6538
|
var ModalBody = function ModalBody(_ref) {
|
|
6539
|
+
var _classNames;
|
|
6540
|
+
|
|
6511
6541
|
var children = _ref.children;
|
|
6542
|
+
|
|
6543
|
+
var _useScrollShadow = useScrollShadow(),
|
|
6544
|
+
ref = _useScrollShadow.ref,
|
|
6545
|
+
showScrollShadow = _useScrollShadow.showScrollShadow;
|
|
6546
|
+
|
|
6512
6547
|
return React__default.createElement("div", {
|
|
6513
|
-
className: styles$y['modal-body']
|
|
6548
|
+
className: classnames(styles$y['modal-body'], (_classNames = {}, _classNames[styles$y['modal-body--with-scroll-shadow']] = showScrollShadow, _classNames)),
|
|
6549
|
+
ref: ref
|
|
6514
6550
|
}, children);
|
|
6515
6551
|
};
|
|
6516
6552
|
|