@sanity/ui 3.0.0-static.32 → 3.0.0-static.33

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.
@@ -1089,6 +1089,7 @@ function Popover(props) {
1089
1089
  overflow = "hidden",
1090
1090
  padding,
1091
1091
  placement: placementProp = "bottom",
1092
+ placementStrategy = "flip",
1092
1093
  portal,
1093
1094
  preventOverflow = !0,
1094
1095
  radius = 3,
@@ -1106,12 +1107,14 @@ function Popover(props) {
1106
1107
  react.useImperativeHandle(forwardedRef, () => ref.current);
1107
1108
  const referenceWidthRef = react.useRef(void 0), middleware = react.useMemo(() => {
1108
1109
  const ret = [];
1109
- return (constrainSize || preventOverflow) && ret.push(reactDom$1.flip({
1110
+ return (constrainSize || preventOverflow) && (placementStrategy === "autoPlacement" ? ret.push(reactDom$1.autoPlacement({
1111
+ allowedPlacements: [placementProp].concat(fallbackPlacements)
1112
+ })) : ret.push(reactDom$1.flip({
1110
1113
  boundary: floatingBoundary || void 0,
1111
1114
  fallbackPlacements,
1112
1115
  padding: DEFAULT_POPOVER_PADDING,
1113
1116
  rootBoundary
1114
- })), ret.push(reactDom$1.offset({
1117
+ }))), ret.push(reactDom$1.offset({
1115
1118
  mainAxis: DEFAULT_POPOVER_DISTANCE
1116
1119
  })), (constrainSize || matchReferenceWidth) && ret.push(size({
1117
1120
  apply({
@@ -1137,7 +1140,7 @@ function Popover(props) {
1137
1140
  padding: DEFAULT_POPOVER_PADDING,
1138
1141
  strategy: "referenceHidden"
1139
1142
  })), ret;
1140
- }, [animate, arrowProp, constrainSize, fallbackPlacements, floatingBoundary, margins, matchReferenceWidth, preventOverflow, referenceBoundary]), {
1143
+ }, [animate, arrowProp, constrainSize, fallbackPlacements, floatingBoundary, placementProp, placementStrategy, margins, matchReferenceWidth, preventOverflow, referenceBoundary]), {
1141
1144
  x,
1142
1145
  y,
1143
1146
  middlewareData,