@lumx/react 3.1.4-alpha-popover.3 → 3.1.4

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
@@ -736,6 +736,8 @@ declare type FitAnchorWidth = ValueOf<typeof FitAnchorWidth>;
736
736
  interface PopoverProps extends GenericProps {
737
737
  /** Reference to the DOM element used to set the position of the popover. */
738
738
  anchorRef: React.RefObject<HTMLElement>;
739
+ /** Customize the root element. (Must accept ref forwarding and props forwarding!). */
740
+ as?: React.ElementType;
739
741
  /** Element which will act as boundary when opening the popover. */
740
742
  boundaryRef?: RefObject<HTMLElement>;
741
743
  /** Content. */
package/index.js CHANGED
@@ -6084,7 +6084,7 @@ function usePopoverStyle(_ref5) {
6084
6084
  };
6085
6085
  }
6086
6086
 
6087
- const _excluded$m = ["anchorRef", "children", "className", "closeOnClickAway", "closeOnEscape", "elevation", "focusElement", "hasArrow", "isOpen", "onClose", "parentElement", "usePortal", "focusAnchorOnClose", "withFocusTrap", "boundaryRef", "fitToAnchorWidth", "fitWithinViewportHeight", "offset", "placement", "style", "zIndex"];
6087
+ const _excluded$m = ["anchorRef", "as", "children", "className", "closeOnClickAway", "closeOnEscape", "elevation", "focusElement", "hasArrow", "isOpen", "onClose", "parentElement", "usePortal", "focusAnchorOnClose", "withFocusTrap", "boundaryRef", "fitToAnchorWidth", "fitWithinViewportHeight", "offset", "placement", "style", "zIndex"];
6088
6088
 
6089
6089
  /**
6090
6090
  * Defines the props of the component.
@@ -6119,6 +6119,7 @@ const renderPopover = (children, usePortal) => {
6119
6119
  const _InnerPopover = /*#__PURE__*/forwardRef((props, ref) => {
6120
6120
  const {
6121
6121
  anchorRef,
6122
+ as: Component = 'div',
6122
6123
  children,
6123
6124
  className,
6124
6125
  closeOnClickAway,
@@ -6212,7 +6213,7 @@ const _InnerPopover = /*#__PURE__*/forwardRef((props, ref) => {
6212
6213
  useFocus(focusElement === null || focusElement === void 0 ? void 0 : focusElement.current, !withFocusTrap && isOpen && isPositioned);
6213
6214
  useFocusTrap(withFocusTrap && isOpen && (contentRef === null || contentRef === void 0 ? void 0 : contentRef.current), focusElement === null || focusElement === void 0 ? void 0 : focusElement.current);
6214
6215
  const clickAwayRefs = useRef([clickAwayRef, anchorRef]);
6215
- return isOpen ? renderPopover( /*#__PURE__*/React.createElement("div", _extends({}, forwardedProps, {
6216
+ return isOpen ? renderPopover( /*#__PURE__*/React.createElement(Component, _extends({}, forwardedProps, {
6216
6217
  ref: mergeRefs(setPopperElement, ref, clickAwayRef, contentRef),
6217
6218
  className: classnames(className, handleBasicClasses({
6218
6219
  prefix: CLASSNAME$i,