@onewelcome/react-lib-components 1.9.0 → 1.9.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/Notifications/BaseModal/BaseModal.d.ts +1 -1
- package/dist/hooks/useGetDomRoot.d.ts +3 -0
- package/dist/react-lib-components.cjs.development.js +54 -18
- package/dist/react-lib-components.cjs.development.js.map +1 -1
- package/dist/react-lib-components.cjs.production.min.js +1 -1
- package/dist/react-lib-components.cjs.production.min.js.map +1 -1
- package/dist/react-lib-components.esm.js +55 -19
- package/dist/react-lib-components.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/ContextMenu/ContextMenu.tsx +18 -3
- package/src/Notifications/BaseModal/BaseModal.tsx +48 -41
- package/src/Notifications/Snackbar/SnackbarProvider/SnackbarProvider.tsx +7 -4
- package/src/Tooltip/Tooltip.tsx +9 -3
- package/src/hooks/useGetDomRoot.ts +40 -0
- package/src/hooks/usePosition.ts +2 -1
|
@@ -16,4 +16,4 @@ export interface Props extends ComponentPropsWithRef<"div"> {
|
|
|
16
16
|
domRoot?: HTMLElement;
|
|
17
17
|
}
|
|
18
18
|
export declare const useSetBodyScroll: (open: boolean) => void;
|
|
19
|
-
export declare const BaseModal: React.ForwardRefExoticComponent<Pick<Props, "hidden" | "slot" | "style" | "title" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "nonce" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "
|
|
19
|
+
export declare const BaseModal: React.ForwardRefExoticComponent<Pick<Props, "hidden" | "slot" | "style" | "title" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "nonce" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "open" | "onClose" | "containerProps" | "backdropProps" | "labelledby" | "describedby" | "disableEscapeKeyDown" | "disableBackdrop" | "forceContainerOpen" | "zIndex" | "domRoot"> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -612,8 +612,8 @@ var usePosition = function usePosition(providedConfigObject) {
|
|
|
612
612
|
});
|
|
613
613
|
};
|
|
614
614
|
var calculatePosition = useDebouncedCallback(function () {
|
|
615
|
-
var _configObject$relativ;
|
|
616
|
-
if (!((_configObject$relativ = configObject.relativeElement) != null && _configObject$relativ.current)) return;
|
|
615
|
+
var _configObject$relativ, _configObject$element;
|
|
616
|
+
if (!((_configObject$relativ = configObject.relativeElement) != null && _configObject$relativ.current) || !((_configObject$element = configObject.elementToBePositioned) != null && _configObject$element.current)) return;
|
|
617
617
|
var relativeElRect = configObject.relativeElement.current.getBoundingClientRect();
|
|
618
618
|
var elementToBePositionedDimensions = {
|
|
619
619
|
height: configObject.elementToBePositioned.current.offsetHeight,
|
|
@@ -727,6 +727,27 @@ var useBodyClick = function useBodyClick(checkFunction, callbackFunction, depend
|
|
|
727
727
|
}, [dependingStateVariable]);
|
|
728
728
|
};
|
|
729
729
|
|
|
730
|
+
var useGetDomRoot = function useGetDomRoot(passedDomRoot, relativeElement) {
|
|
731
|
+
var _useState = React.useState(document.body),
|
|
732
|
+
root = _useState[0],
|
|
733
|
+
setRoot = _useState[1];
|
|
734
|
+
React.useEffect(function () {
|
|
735
|
+
if (relativeElement && relativeElement.current && !passedDomRoot) {
|
|
736
|
+
var closestBaseStylingWrapper = relativeElement.current.closest(".basestyling-wrapper");
|
|
737
|
+
if (closestBaseStylingWrapper) {
|
|
738
|
+
setRoot(closestBaseStylingWrapper);
|
|
739
|
+
return;
|
|
740
|
+
}
|
|
741
|
+
} else if (passedDomRoot) {
|
|
742
|
+
setRoot(passedDomRoot);
|
|
743
|
+
return;
|
|
744
|
+
}
|
|
745
|
+
}, [relativeElement]);
|
|
746
|
+
return {
|
|
747
|
+
root: root
|
|
748
|
+
};
|
|
749
|
+
};
|
|
750
|
+
|
|
730
751
|
var _excluded$U = ["trigger", "children", "decorativeElement", "id", "show", "onShow", "onClose", "placement", "offset", "transformOrigin", "debounceAmount", "domRoot", "popoverProps"];
|
|
731
752
|
var ContextMenuComponent = function ContextMenuComponent(_ref, ref) {
|
|
732
753
|
var trigger = _ref.trigger,
|
|
@@ -755,11 +776,11 @@ var ContextMenuComponent = function ContextMenuComponent(_ref, ref) {
|
|
|
755
776
|
vertical: "top"
|
|
756
777
|
} : _ref$transformOrigin,
|
|
757
778
|
debounceAmount = _ref.debounceAmount,
|
|
758
|
-
|
|
759
|
-
domRoot = _ref$domRoot === void 0 ? document.body : _ref$domRoot,
|
|
779
|
+
domRoot = _ref.domRoot,
|
|
760
780
|
popoverProps = _ref.popoverProps,
|
|
761
781
|
rest = _objectWithoutPropertiesLoose(_ref, _excluded$U);
|
|
762
782
|
var anchorEl = React.useRef(null);
|
|
783
|
+
var wrappingDivRef = ref || React.createRef();
|
|
763
784
|
var _useState = React.useState(show),
|
|
764
785
|
showContextMenu = _useState[0],
|
|
765
786
|
setShowContextMenu = _useState[1];
|
|
@@ -777,6 +798,8 @@ var ContextMenuComponent = function ContextMenuComponent(_ref, ref) {
|
|
|
777
798
|
setShouldClick = _useState5[1]; /** We need this, because whenever we use the arrow keys to select the contextmenu item, and we focus the currently selected item it fires the "click" listener in ContextMenuItem component. Instead, we only want this to fire if we press "enter" or "spacebar" so we set this to true whenever that is the case, and back to false when it has been executed. */
|
|
778
799
|
var _useState6 = React.useState(React__default["default"].Children.count(children)),
|
|
779
800
|
childrenCount = _useState6[0];
|
|
801
|
+
var _useGetDomRoot = useGetDomRoot(domRoot, wrappingDivRef),
|
|
802
|
+
root = _useGetDomRoot.root;
|
|
780
803
|
if (!id) {
|
|
781
804
|
throw new Error("You need to provide an ID to the context menu");
|
|
782
805
|
}
|
|
@@ -874,8 +897,11 @@ var ContextMenuComponent = function ContextMenuComponent(_ref, ref) {
|
|
|
874
897
|
var onOutOfViewHandler = React.useCallback(function () {
|
|
875
898
|
setShowContextMenu(false);
|
|
876
899
|
}, []);
|
|
900
|
+
if (!root) {
|
|
901
|
+
return null;
|
|
902
|
+
}
|
|
877
903
|
return React__default["default"].createElement("div", _extends({}, rest, {
|
|
878
|
-
ref:
|
|
904
|
+
ref: wrappingDivRef,
|
|
879
905
|
onKeyDown: onArrowNavigation,
|
|
880
906
|
className: modules_846e6042["context-menu"]
|
|
881
907
|
}), renderTrigger(), reactDom.createPortal(React__default["default"].createElement(Popover, _extends({}, popoverProps, {
|
|
@@ -893,7 +919,7 @@ var ContextMenuComponent = function ContextMenuComponent(_ref, ref) {
|
|
|
893
919
|
id: id + "-menu",
|
|
894
920
|
"aria-describedby": id,
|
|
895
921
|
role: "menu"
|
|
896
|
-
}, renderChildren())),
|
|
922
|
+
}, renderChildren())), root));
|
|
897
923
|
};
|
|
898
924
|
var ContextMenu = /*#__PURE__*/React__default["default"].forwardRef(ContextMenuComponent);
|
|
899
925
|
|
|
@@ -1471,8 +1497,7 @@ var TooltipComponent = function TooltipComponent(_ref, ref) {
|
|
|
1471
1497
|
offset = _ref$offset === void 0 ? defaultPosition.offset : _ref$offset,
|
|
1472
1498
|
_ref$transformOrigin = _ref.transformOrigin,
|
|
1473
1499
|
transformOrigin = _ref$transformOrigin === void 0 ? defaultPosition.transformOrigin : _ref$transformOrigin,
|
|
1474
|
-
|
|
1475
|
-
domRoot = _ref$domRoot === void 0 ? document.body : _ref$domRoot,
|
|
1500
|
+
domRoot = _ref.domRoot,
|
|
1476
1501
|
label = _ref.label,
|
|
1477
1502
|
rest = _objectWithoutPropertiesLoose(_ref, _excluded$K);
|
|
1478
1503
|
var _useState = React.useState(generateID()),
|
|
@@ -1480,6 +1505,9 @@ var TooltipComponent = function TooltipComponent(_ref, ref) {
|
|
|
1480
1505
|
var _useState2 = React.useState(false),
|
|
1481
1506
|
visible = _useState2[0],
|
|
1482
1507
|
setVisible = _useState2[1];
|
|
1508
|
+
var wrappingDivRef = ref || React.createRef();
|
|
1509
|
+
var _useGetDomRoot = useGetDomRoot(domRoot, wrappingDivRef),
|
|
1510
|
+
root = _useGetDomRoot.root;
|
|
1483
1511
|
var relativeElement = React.useRef(null);
|
|
1484
1512
|
var elementToBePositioned = React.useRef(null);
|
|
1485
1513
|
var _usePosition = usePosition({
|
|
@@ -1536,7 +1564,7 @@ var TooltipComponent = function TooltipComponent(_ref, ref) {
|
|
|
1536
1564
|
}, label);
|
|
1537
1565
|
};
|
|
1538
1566
|
return React__default["default"].createElement("div", _extends({}, rest, {
|
|
1539
|
-
ref:
|
|
1567
|
+
ref: wrappingDivRef,
|
|
1540
1568
|
className: modules_16974fb0.wrapper + " " + (className != null ? className : "")
|
|
1541
1569
|
}), renderChildren(), React__default["default"].createElement("div", {
|
|
1542
1570
|
className: "" + modules_16974fb0["tooltip-wrapper"]
|
|
@@ -1562,7 +1590,7 @@ var TooltipComponent = function TooltipComponent(_ref, ref) {
|
|
|
1562
1590
|
"aria-hidden": !visible,
|
|
1563
1591
|
id: identifier,
|
|
1564
1592
|
className: modules_16974fb0.tooltip + " " + (visible ? modules_16974fb0.visible : "")
|
|
1565
|
-
}, children),
|
|
1593
|
+
}, children), root)));
|
|
1566
1594
|
};
|
|
1567
1595
|
var Tooltip = /*#__PURE__*/React__default["default"].forwardRef(TooltipComponent);
|
|
1568
1596
|
|
|
@@ -2462,10 +2490,12 @@ var BaseModalComponent = function BaseModalComponent(_ref, ref) {
|
|
|
2462
2490
|
_ref$forceContainerOp = _ref.forceContainerOpen,
|
|
2463
2491
|
forceContainerOpen = _ref$forceContainerOp === void 0 ? false : _ref$forceContainerOp,
|
|
2464
2492
|
zIndex = _ref.zIndex,
|
|
2465
|
-
|
|
2466
|
-
domRoot = _ref$domRoot === void 0 ? document.body : _ref$domRoot,
|
|
2493
|
+
domRoot = _ref.domRoot,
|
|
2467
2494
|
rest = _objectWithoutPropertiesLoose(_ref, _excluded$B);
|
|
2468
2495
|
useSetBodyScroll(open);
|
|
2496
|
+
var wrappingDivRef = React.useRef(null);
|
|
2497
|
+
var _useGetDomRoot = useGetDomRoot(domRoot, wrappingDivRef),
|
|
2498
|
+
root = _useGetDomRoot.root;
|
|
2469
2499
|
var handleEscKeyPress = function handleEscKeyPress(event) {
|
|
2470
2500
|
if (!disableEscapeKeyDown && event.key === "Escape") {
|
|
2471
2501
|
event.stopPropagation();
|
|
@@ -2475,7 +2505,9 @@ var BaseModalComponent = function BaseModalComponent(_ref, ref) {
|
|
|
2475
2505
|
var handleBackdropClick = function handleBackdropClick() {
|
|
2476
2506
|
return !disableBackdrop && onClose && onClose();
|
|
2477
2507
|
};
|
|
2478
|
-
return
|
|
2508
|
+
return React__default["default"].createElement("div", {
|
|
2509
|
+
ref: wrappingDivRef
|
|
2510
|
+
}, reactDom.createPortal(React__default["default"].createElement("div", _extends({}, rest, {
|
|
2479
2511
|
ref: ref,
|
|
2480
2512
|
id: id,
|
|
2481
2513
|
className: modules_cf1b230e["modal"] + " " + (open ? modules_cf1b230e["visible"] : "") + " " + className,
|
|
@@ -2505,7 +2537,7 @@ var BaseModalComponent = function BaseModalComponent(_ref, ref) {
|
|
|
2505
2537
|
zIndex: zIndex && zIndex + 1
|
|
2506
2538
|
},
|
|
2507
2539
|
className: modules_cf1b230e["container"] + " " + ((_containerProps$class2 = containerProps == null ? void 0 : containerProps.className) != null ? _containerProps$class2 : "")
|
|
2508
|
-
}), children)),
|
|
2540
|
+
}), children)), root));
|
|
2509
2541
|
};
|
|
2510
2542
|
var BaseModal = /*#__PURE__*/React__default["default"].forwardRef(BaseModalComponent);
|
|
2511
2543
|
|
|
@@ -3075,13 +3107,15 @@ var SnackbarProvider = function SnackbarProvider(_temp) {
|
|
|
3075
3107
|
} : _ref$autoHideDuration,
|
|
3076
3108
|
_ref$stackSize = _ref.stackSize,
|
|
3077
3109
|
stackSize = _ref$stackSize === void 0 ? 3 : _ref$stackSize,
|
|
3078
|
-
|
|
3079
|
-
domRoot = _ref$domRoot === void 0 ? document.body : _ref$domRoot,
|
|
3110
|
+
domRoot = _ref.domRoot,
|
|
3080
3111
|
children = _ref.children,
|
|
3081
3112
|
className = _ref.className;
|
|
3082
3113
|
var _useState = React.useState([]),
|
|
3083
3114
|
snackbars = _useState[0],
|
|
3084
3115
|
setSnackbars = _useState[1];
|
|
3116
|
+
var wrappingDivRef = React.useRef(null);
|
|
3117
|
+
var _useGetDomRoot = useGetDomRoot(domRoot, wrappingDivRef),
|
|
3118
|
+
root = _useGetDomRoot.root;
|
|
3085
3119
|
var addSnackbar = function addSnackbar(item) {
|
|
3086
3120
|
setSnackbars(function (items) {
|
|
3087
3121
|
return [].concat(items, [item]);
|
|
@@ -3159,7 +3193,7 @@ var SnackbarProvider = function SnackbarProvider(_temp) {
|
|
|
3159
3193
|
var snackbarPortal = reactDom.createPortal(React__default["default"].createElement(SnackbarContainer, {
|
|
3160
3194
|
placement: placement,
|
|
3161
3195
|
className: className
|
|
3162
|
-
}, snackbarList),
|
|
3196
|
+
}, snackbarList), root);
|
|
3163
3197
|
return React__default["default"].createElement(SnackbarContextProvider, {
|
|
3164
3198
|
initialState: {
|
|
3165
3199
|
enqueueSnackbar: enqueueSnackbar,
|
|
@@ -3168,7 +3202,9 @@ var SnackbarProvider = function SnackbarProvider(_temp) {
|
|
|
3168
3202
|
setSnackbarHeight: setSnackbarHeight,
|
|
3169
3203
|
snackbars: snackbars
|
|
3170
3204
|
}
|
|
3171
|
-
}, children,
|
|
3205
|
+
}, children, React__default["default"].createElement("div", {
|
|
3206
|
+
ref: wrappingDivRef
|
|
3207
|
+
}, snackbarPortal));
|
|
3172
3208
|
};
|
|
3173
3209
|
|
|
3174
3210
|
var css$p = ".Checkbox_module_checkboxWrapper__0342c60f{position:relative}.Checkbox_module_checkboxWrapper__0342c60f+.Checkbox_module_checkboxWrapper__0342c60f{margin-top:1.25rem}.Checkbox_module_checkboxContainer__0342c60f{align-items:center;display:flex}.Checkbox_module_checkboxContainer__0342c60f label{display:inline-block;font-family:var(--font-family);font-size:var(--font-size);margin-left:.5rem;user-select:none}.Checkbox_module_checkboxList__0342c60f{list-style:none;margin:1.25rem 0 0 1.75rem;padding:0}.Checkbox_module_checkboxList__0342c60f li+li{margin-top:1.25rem}.Checkbox_module_nativeInput__0342c60f{height:1.25rem;left:0;margin:0;opacity:0;position:absolute;top:0;width:1.25rem}.Checkbox_module_nativeInput__0342c60f:checked+*{color:var(--color-primary)}.Checkbox_module_nativeInput__0342c60f:focus-visible+*{border-radius:2px;outline:1px solid var(--color-focus);outline-offset:1px}.Checkbox_module_nativeInput__0342c60f.Checkbox_module_error__0342c60f:focus-visible+*{outline-color:var(--color-error)}.Checkbox_module_input__0342c60f{font-size:1.25rem;pointer-events:none}.Checkbox_module_disabled__0342c60f{color:var(--disabled)}";
|