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