@react-spectrum/overlays 5.5.2 → 5.5.3

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/import.mjs CHANGED
@@ -1,3 +1,5 @@
1
+ "use client";
2
+
1
3
  import "./main.css";
2
4
  import {Provider as $fQOb3$Provider} from "@react-spectrum/provider";
3
5
  import $fQOb3$react, {useState as $fQOb3$useState, useCallback as $fQOb3$useCallback, useRef as $fQOb3$useRef, forwardRef as $fQOb3$forwardRef} from "react";
@@ -337,7 +339,7 @@ function $17b503f7de08fecc$var$Popover(props, ref) {
337
339
  }, children));
338
340
  }
339
341
  const $17b503f7de08fecc$var$PopoverWrapper = /*#__PURE__*/ (0, $fQOb3$forwardRef)((props, ref)=>{
340
- let { children: children, isOpen: isOpen, hideArrow: hideArrow, isNonModal: isNonModal, enableBothDismissButtons: enableBothDismissButtons, state: state, wrapperRef: wrapperRef } = props;
342
+ let { children: children, isOpen: isOpen, hideArrow: hideArrow, isNonModal: isNonModal, enableBothDismissButtons: enableBothDismissButtons, state: state, wrapperRef: wrapperRef, onDismissButtonPress: onDismissButtonPress = ()=>state.close() } = props;
341
343
  let { styleProps: styleProps } = (0, $fQOb3$useStyleProps)(props);
342
344
  let { size: size, borderWidth: borderWidth, arrowRef: arrowRef } = $17b503f7de08fecc$var$useArrowSize();
343
345
  const borderRadius = $17b503f7de08fecc$var$usePopoverBorderRadius(ref);
@@ -380,7 +382,7 @@ const $17b503f7de08fecc$var$PopoverWrapper = /*#__PURE__*/ (0, $fQOb3$forwardRef
380
382
  role: "presentation",
381
383
  "data-testid": "popover"
382
384
  }, (!isNonModal || enableBothDismissButtons) && /*#__PURE__*/ (0, $fQOb3$react).createElement((0, $fQOb3$DismissButton), {
383
- onDismiss: state.close
385
+ onDismiss: onDismissButtonPress
384
386
  }), children, hideArrow ? null : /*#__PURE__*/ (0, $fQOb3$react).createElement($17b503f7de08fecc$var$Arrow, {
385
387
  arrowProps: arrowProps,
386
388
  isLandscape: $17b503f7de08fecc$var$arrowPlacement[placement] === "bottom",
@@ -389,7 +391,7 @@ const $17b503f7de08fecc$var$PopoverWrapper = /*#__PURE__*/ (0, $fQOb3$forwardRef
389
391
  secondary: secondary,
390
392
  borderDiagonal: borderDiagonal
391
393
  }), /*#__PURE__*/ (0, $fQOb3$react).createElement((0, $fQOb3$DismissButton), {
392
- onDismiss: state.close
394
+ onDismiss: onDismissButtonPress
393
395
  })));
394
396
  });
395
397
  function $17b503f7de08fecc$var$usePopoverBorderRadius(popoverRef) {