@sanity/ui 2.15.17 → 2.16.0

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.
@@ -2698,7 +2698,7 @@ const StyledInline = /* @__PURE__ */ styledComponents.styled(Box).withConfig({
2698
2698
  displayName: "StyledInline",
2699
2699
  componentId: "sc-1pkiy6j-0"
2700
2700
  })(inlineBaseStyle, inlineSpaceStyle), Inline = react.forwardRef(function(props, ref) {
2701
- const $ = reactCompilerRuntime.c(12);
2701
+ const $ = reactCompilerRuntime.c(13);
2702
2702
  let as, childrenProp, restProps, space;
2703
2703
  $[0] !== props ? ({
2704
2704
  as,
@@ -2708,9 +2708,9 @@ const StyledInline = /* @__PURE__ */ styledComponents.styled(Box).withConfig({
2708
2708
  } = props, $[0] = props, $[1] = as, $[2] = childrenProp, $[3] = restProps, $[4] = space) : (as = $[1], childrenProp = $[2], restProps = $[3], space = $[4]);
2709
2709
  let t0, t1;
2710
2710
  $[5] !== childrenProp ? (t1 = react.Children.map(childrenProp, _temp$4), $[5] = childrenProp, $[6] = t1) : t1 = $[6], t0 = t1;
2711
- const children = t0, t2 = useArrayProp(space);
2712
- let t3;
2713
- return $[7] !== as || $[8] !== children || $[9] !== restProps || $[10] !== t2 ? (t3 = /* @__PURE__ */ jsxRuntime.jsx(StyledInline, { "data-ui": "Inline", ...restProps, $space: t2, forwardedAs: as, ref, children }), $[7] = as, $[8] = children, $[9] = restProps, $[10] = t2, $[11] = t3) : t3 = $[11], t3;
2711
+ const children = t0, t2 = useArrayProp(space), t3 = ref;
2712
+ let t4;
2713
+ return $[7] !== as || $[8] !== children || $[9] !== restProps || $[10] !== t2 || $[11] !== t3 ? (t4 = /* @__PURE__ */ jsxRuntime.jsx(StyledInline, { "data-ui": "Inline", ...restProps, $space: t2, forwardedAs: as, ref: t3, children }), $[7] = as, $[8] = children, $[9] = restProps, $[10] = t2, $[11] = t3, $[12] = t4) : t4 = $[12], t4;
2714
2714
  });
2715
2715
  Inline.displayName = "ForwardRef(Inline)";
2716
2716
  function _temp$4(child) {
@@ -3534,6 +3534,7 @@ const ViewportOverlay = () => {
3534
3534
  overflow = "hidden",
3535
3535
  padding: paddingProp,
3536
3536
  placement: placementProp = "bottom",
3537
+ placementStrategy = "flip",
3537
3538
  portal,
3538
3539
  preventOverflow = !0,
3539
3540
  radius: radiusProp = 3,
@@ -3572,12 +3573,14 @@ const ViewportOverlay = () => {
3572
3573
  }, [width, matchReferenceWidth, maxWidth, open]);
3573
3574
  const middleware = react.useMemo(() => {
3574
3575
  const ret = [];
3575
- return (constrainSize || preventOverflow) && ret.push(reactDom$1.flip({
3576
+ return (constrainSize || preventOverflow) && (placementStrategy === "autoPlacement" ? ret.push(reactDom$1.autoPlacement({
3577
+ allowedPlacements: [placementProp].concat(fallbackPlacements)
3578
+ })) : ret.push(reactDom$1.flip({
3576
3579
  boundary: floatingBoundary || void 0,
3577
3580
  fallbackPlacements,
3578
3581
  padding: DEFAULT_POPOVER_PADDING,
3579
3582
  rootBoundary
3580
- })), ret.push(reactDom$1.offset({
3583
+ }))), ret.push(reactDom$1.offset({
3581
3584
  mainAxis: DEFAULT_POPOVER_DISTANCE
3582
3585
  })), (constrainSize || matchReferenceWidth) && ret.push(size({
3583
3586
  apply({
@@ -3605,7 +3608,7 @@ const ViewportOverlay = () => {
3605
3608
  padding: DEFAULT_POPOVER_PADDING,
3606
3609
  strategy: "referenceHidden"
3607
3610
  })), ret;
3608
- }, [animate, arrowProp, constrainSize, fallbackPlacements, floatingBoundary, margins, matchReferenceWidth, preventOverflow, referenceBoundary]), {
3611
+ }, [animate, arrowProp, constrainSize, fallbackPlacements, placementProp, placementStrategy, floatingBoundary, margins, matchReferenceWidth, preventOverflow, referenceBoundary]), {
3609
3612
  x,
3610
3613
  y,
3611
3614
  middlewareData,