@lumx/react 3.16.1-alpha.0 → 3.16.1-alpha.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/index.js CHANGED
@@ -6641,11 +6641,6 @@ const DEFAULT_PROPS$P = {
6641
6641
  zIndex: POPOVER_ZINDEX
6642
6642
  };
6643
6643
 
6644
- /** Method to render the popover inside a portal if usePortal is true */
6645
- const renderPopover = (children, usePortal) => {
6646
- return usePortal ? /*#__PURE__*/React__default.createElement(Portal, null, children) : children;
6647
- };
6648
-
6649
6644
  // Inner component (must be wrapped before export)
6650
6645
  const _InnerPopover = forwardRef((props, ref) => {
6651
6646
  var _styles$popover;
@@ -6709,7 +6704,9 @@ const _InnerPopover = forwardRef((props, ref) => {
6709
6704
  useFocusTrap(withFocusTrap && isOpen && focusZoneElement, focusElement === null || focusElement === void 0 ? void 0 : focusElement.current);
6710
6705
  const clickAwayRefs = useRef([popoverRef, anchorRef]);
6711
6706
  const mergedRefs = useMergeRefs(setPopperElement, ref, popoverRef);
6712
- return isOpen ? renderPopover(/*#__PURE__*/React__default.createElement(Component, _extends({}, forwardedProps, {
6707
+ return isOpen ? /*#__PURE__*/React__default.createElement(Portal, {
6708
+ enabled: usePortal
6709
+ }, /*#__PURE__*/React__default.createElement(Component, _extends({}, forwardedProps, {
6713
6710
  ref: mergedRefs,
6714
6711
  className: classNames(className, handleBasicClasses({
6715
6712
  prefix: CLASSNAME$11,
@@ -6733,7 +6730,7 @@ const _InnerPopover = forwardRef((props, ref) => {
6733
6730
  d: "M8 3.49C7.62 2.82 6.66 2.82 6.27 3.48L.04 14 14.04 14 8 3.49Z"
6734
6731
  }))), /*#__PURE__*/React__default.createElement(ThemeProvider, {
6735
6732
  value: theme
6736
- }, children))), usePortal) : null;
6733
+ }, children)))) : null;
6737
6734
  });
6738
6735
  _InnerPopover.displayName = COMPONENT_NAME$11;
6739
6736
 
@@ -9654,10 +9651,9 @@ const Notification = forwardRef((props, ref) => {
9654
9651
  if (!type || !isVisible) {
9655
9652
  return null;
9656
9653
  }
9657
- const notification =
9658
- /*#__PURE__*/
9659
- // eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions
9660
- React__default.createElement("div", _extends({
9654
+ return /*#__PURE__*/React__default.createElement(Portal, {
9655
+ enabled: usePortal
9656
+ }, /*#__PURE__*/React__default.createElement("div", _extends({
9661
9657
  ref: mergeRefs(ref, rootRef),
9662
9658
  role: "alert"
9663
9659
  }, forwardedProps, {
@@ -9684,8 +9680,7 @@ const Notification = forwardRef((props, ref) => {
9684
9680
  emphasis: Emphasis.medium,
9685
9681
  theme: theme,
9686
9682
  onClick: handleCallback
9687
- }, /*#__PURE__*/React__default.createElement("span", null, actionLabel))));
9688
- return usePortal ? /*#__PURE__*/React__default.createElement(Portal, null, notification) : notification;
9683
+ }, /*#__PURE__*/React__default.createElement("span", null, actionLabel)))), ");");
9689
9684
  });
9690
9685
  Notification.displayName = COMPONENT_NAME$C;
9691
9686
  Notification.className = CLASSNAME$C;