@sanity/ui 2.3.6-canary.5 → 2.3.6-canary.6

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/index.esm.js CHANGED
@@ -3264,7 +3264,7 @@ const Popover = memo(
3264
3264
  animate: _animate = !1,
3265
3265
  arrow: arrowProp = !1,
3266
3266
  boundaryElement: _boundaryElement,
3267
- children,
3267
+ children: _children,
3268
3268
  constrainSize = !1,
3269
3269
  content,
3270
3270
  disabled,
@@ -3378,10 +3378,16 @@ const Popover = memo(
3378
3378
  },
3379
3379
  [refs]
3380
3380
  );
3381
- if (useImperativeHandle(updateRef, () => update, [update]), useEffect(() => {
3382
- children || refs.setReference(referenceElement || null);
3383
- }, [children, referenceElement, refs]), disabled)
3384
- return children || /* @__PURE__ */ jsx(Fragment, {});
3381
+ useImperativeHandle(updateRef, () => update, [update]), useEffect(() => {
3382
+ _children || refs.setReference(referenceElement || null);
3383
+ }, [_children, referenceElement, refs]);
3384
+ const children = useMemo(() => !_children || referenceElement ? null : cloneElement(_children, {
3385
+ ref: (node) => {
3386
+ logDeprecatedWarning(), refs.setReference(node);
3387
+ }
3388
+ }), [_children, referenceElement, refs]);
3389
+ if (disabled)
3390
+ return _children || /* @__PURE__ */ jsx(Fragment, {});
3385
3391
  const popover = /* @__PURE__ */ jsx(LayerProvider, { zOffset, children: /* @__PURE__ */ jsx(
3386
3392
  PopoverCard,
3387
3393
  {
@@ -3426,16 +3432,7 @@ const Popover = memo(
3426
3432
  )
3427
3433
  }
3428
3434
  ),
3429
- children && !referenceElement && /* @__PURE__ */ jsx(
3430
- "div",
3431
- {
3432
- ref: (node) => {
3433
- logDeprecatedWarning(), refs.setReference(node);
3434
- },
3435
- style: { display: "contents" },
3436
- children
3437
- }
3438
- )
3435
+ children
3439
3436
  ] });
3440
3437
  })
3441
3438
  );