@lumx/react 3.15.2-alpha.5 → 3.16.1-alpha.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/index.js CHANGED
@@ -4,7 +4,6 @@ import isBoolean from 'lodash/isBoolean';
4
4
  import isEmpty from 'lodash/isEmpty';
5
5
  import kebabCase from 'lodash/kebabCase';
6
6
  import noop from 'lodash/noop';
7
- import ReactDOM, { createPortal } from 'react-dom';
8
7
  import last from 'lodash/last';
9
8
  import pull from 'lodash/pull';
10
9
  import get from 'lodash/get';
@@ -12,7 +11,7 @@ import concat from 'lodash/concat';
12
11
  import dropRight from 'lodash/dropRight';
13
12
  import partition from 'lodash/partition';
14
13
  import reduce from 'lodash/reduce';
15
- import { ClickAwayProvider } from './utils/index.js';
14
+ import { Portal, ClickAwayProvider } from './utils/index.js';
16
15
  import memoize from 'lodash/memoize';
17
16
  import isFunction from 'lodash/isFunction';
18
17
  import castArray from 'lodash/castArray';
@@ -21,6 +20,7 @@ import isInteger from 'lodash/isInteger';
21
20
  import throttle from 'lodash/throttle';
22
21
  import range from 'lodash/range';
23
22
  import chunk from 'lodash/chunk';
23
+ import ReactDOM from 'react-dom';
24
24
  import take from 'lodash/take';
25
25
  import isObject from 'lodash/isObject';
26
26
  import set from 'lodash/set';
@@ -3284,7 +3284,7 @@ const Dialog = forwardRef((props, ref) => {
3284
3284
  // eslint-disable-next-line react-hooks/rules-of-hooks
3285
3285
  const isVisible = useTransitionVisibility(rootRef, Boolean(isOpen), DIALOG_TRANSITION_DURATION, onVisibilityChange);
3286
3286
  const shouldPreventCloseOnClickAway = preventAutoClose || preventCloseOnClick;
3287
- return isOpen || isVisible ? /*#__PURE__*/createPortal(/*#__PURE__*/React__default.createElement("div", _extends({
3287
+ return isOpen || isVisible ? /*#__PURE__*/React__default.createElement(Portal, null, /*#__PURE__*/React__default.createElement("div", _extends({
3288
3288
  ref: mergeRefs(rootRef, ref)
3289
3289
  }, forwardedProps, {
3290
3290
  className: classNames(className, handleBasicClasses({
@@ -3331,7 +3331,7 @@ const Dialog = forwardRef((props, ref) => {
3331
3331
  className: `${CLASSNAME$16}__progress-overlay`
3332
3332
  }, /*#__PURE__*/React__default.createElement(Progress, {
3333
3333
  variant: ProgressVariant.circular
3334
- })))))))), document.body) : null;
3334
+ }))))))))) : null;
3335
3335
  });
3336
3336
  Dialog.displayName = COMPONENT_NAME$16;
3337
3337
  Dialog.className = CLASSNAME$16;
@@ -6643,7 +6643,7 @@ const DEFAULT_PROPS$P = {
6643
6643
 
6644
6644
  /** Method to render the popover inside a portal if usePortal is true */
6645
6645
  const renderPopover = (children, usePortal) => {
6646
- return usePortal ? /*#__PURE__*/createPortal(children, document.body) : children;
6646
+ return usePortal ? /*#__PURE__*/React__default.createElement(Portal, null, children) : children;
6647
6647
  };
6648
6648
 
6649
6649
  // Inner component (must be wrapped before export)
@@ -8896,10 +8896,7 @@ const Lightbox = forwardRef((props, ref) => {
8896
8896
  // eslint-disable-next-line react-hooks/rules-of-hooks
8897
8897
  const clickAwayRefs = useRef([wrapperRef]);
8898
8898
  if (!isOpen && !isVisible) return null;
8899
- return /*#__PURE__*/createPortal(
8900
- /*#__PURE__*/
8901
- /* eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions */
8902
- React__default.createElement("div", _extends({
8899
+ return /*#__PURE__*/React__default.createElement(Portal, null, /*#__PURE__*/React__default.createElement("div", _extends({
8903
8900
  ref: mergeRefs(ref, wrapperRef)
8904
8901
  }, forwardedProps, {
8905
8902
  "aria-label": ariaLabel,
@@ -8937,7 +8934,7 @@ const Lightbox = forwardRef((props, ref) => {
8937
8934
  ref: childrenRef,
8938
8935
  className: `${CLASSNAME$M}__wrapper`,
8939
8936
  role: "presentation"
8940
- }, children))))), document.body);
8937
+ }, children))))));
8941
8938
  });
8942
8939
  Lightbox.displayName = COMPONENT_NAME$M;
8943
8940
  Lightbox.className = CLASSNAME$M;
@@ -9688,7 +9685,7 @@ const Notification = forwardRef((props, ref) => {
9688
9685
  theme: theme,
9689
9686
  onClick: handleCallback
9690
9687
  }, /*#__PURE__*/React__default.createElement("span", null, actionLabel))));
9691
- return usePortal ? /*#__PURE__*/createPortal(notification, document.body) : notification;
9688
+ return usePortal ? /*#__PURE__*/React__default.createElement(Portal, null, notification) : notification;
9692
9689
  });
9693
9690
  Notification.displayName = COMPONENT_NAME$C;
9694
9691
  Notification.className = CLASSNAME$C;
@@ -14159,7 +14156,7 @@ const Tooltip = forwardRef((props, ref) => {
14159
14156
  }, [isOpen, update, popperElement]);
14160
14157
  const labelLines = label ? label.split('\n') : [];
14161
14158
  const tooltipRef = useMergeRefs(ref, setPopperElement, onPopperMount);
14162
- return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(TooltipContextProvider, null, wrappedChildren), isMounted && /*#__PURE__*/createPortal(/*#__PURE__*/React__default.createElement("div", _extends({
14159
+ return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(TooltipContextProvider, null, wrappedChildren), isMounted && /*#__PURE__*/React__default.createElement(Portal, null, /*#__PURE__*/React__default.createElement("div", _extends({
14163
14160
  ref: tooltipRef
14164
14161
  }, forwardedProps, {
14165
14162
  id: id,
@@ -14178,7 +14175,7 @@ const Tooltip = forwardRef((props, ref) => {
14178
14175
  className: `${CLASSNAME$2}__inner`
14179
14176
  }, labelLines.map(line => /*#__PURE__*/React__default.createElement("p", {
14180
14177
  key: line
14181
- }, line)))), document.body));
14178
+ }, line))))));
14182
14179
  });
14183
14180
  Tooltip.displayName = COMPONENT_NAME$2;
14184
14181
  Tooltip.className = CLASSNAME$2;