@lumx/react 3.6.7-alpha.1 → 3.6.7-alpha.2

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.d.ts CHANGED
@@ -795,7 +795,7 @@ interface PopoverProps extends GenericProps, HasTheme {
795
795
  /** Whether the popover should be rendered into a DOM node that exists outside the DOM hierarchy of the parent component. */
796
796
  usePortal?: boolean;
797
797
  /** The element in which the focus trap should be set. Default to popover. */
798
- focusTrapZone?: RefObject<HTMLElement>;
798
+ focusTrapZoneElement?: RefObject<HTMLElement>;
799
799
  /** Z-axis position. */
800
800
  zIndex?: number;
801
801
  /** On close callback (on click away or Escape pressed). */
package/index.js CHANGED
@@ -2668,7 +2668,8 @@ const DISABLED_SELECTOR = `[hidden], [tabindex="-1"], [disabled]:not([disabled="
2668
2668
 
2669
2669
  const isNotDisabled = element => !element.matches(DISABLED_SELECTOR);
2670
2670
  function getFocusableElements(element) {
2671
- return Array.from(element.querySelectorAll(TABBABLE_ELEMENTS_SELECTOR)).filter(isNotDisabled);
2671
+ const focusableElements = element.shadowRoot ? getFocusableElements(element.shadowRoot) : Array.from(element.querySelectorAll(TABBABLE_ELEMENTS_SELECTOR)).filter(isNotDisabled);
2672
+ return focusableElements;
2672
2673
  }
2673
2674
 
2674
2675
  /**
@@ -6538,7 +6539,7 @@ function usePopoverStyle(_ref5) {
6538
6539
  };
6539
6540
  }
6540
6541
 
6541
- const _excluded$m = ["anchorRef", "as", "children", "className", "closeOnClickAway", "closeOnEscape", "elevation", "focusElement", "hasArrow", "isOpen", "onClose", "parentElement", "usePortal", "focusAnchorOnClose", "withFocusTrap", "boundaryRef", "fitToAnchorWidth", "fitWithinViewportHeight", "focusTrapZone", "offset", "placement", "style", "theme", "zIndex"];
6542
+ const _excluded$m = ["anchorRef", "as", "children", "className", "closeOnClickAway", "closeOnEscape", "elevation", "focusElement", "hasArrow", "isOpen", "onClose", "parentElement", "usePortal", "focusAnchorOnClose", "withFocusTrap", "boundaryRef", "fitToAnchorWidth", "fitWithinViewportHeight", "focusTrapZoneElement", "offset", "placement", "style", "theme", "zIndex"];
6542
6543
 
6543
6544
  /**
6544
6545
  * Defines the props of the component.
@@ -6591,7 +6592,7 @@ const _InnerPopover = /*#__PURE__*/forwardRef((props, ref) => {
6591
6592
  boundaryRef,
6592
6593
  fitToAnchorWidth,
6593
6594
  fitWithinViewportHeight,
6594
- focusTrapZone,
6595
+ focusTrapZoneElement,
6595
6596
  offset,
6596
6597
  placement,
6597
6598
  style,
@@ -6625,8 +6626,7 @@ const _InnerPopover = /*#__PURE__*/forwardRef((props, ref) => {
6625
6626
  anchorRef,
6626
6627
  parentElement
6627
6628
  }, popperElement);
6628
- const focusZoneElement = (focusTrapZone === null || focusTrapZone === void 0 ? void 0 : focusTrapZone.current) || (popoverRef === null || popoverRef === void 0 ? void 0 : popoverRef.current);
6629
- console.log('focusZone', focusZoneElement);
6629
+ const focusZoneElement = (focusTrapZoneElement === null || focusTrapZoneElement === void 0 ? void 0 : focusTrapZoneElement.current) || (popoverRef === null || popoverRef === void 0 ? void 0 : popoverRef.current);
6630
6630
  useCallbackOnEscape(onClose, isOpen && closeOnEscape);
6631
6631
 
6632
6632
  /** Only set focus within if the focus trap is disabled as they interfere with one another. */