@sanity/ui 2.0.13 → 2.0.14

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.mjs CHANGED
@@ -4361,13 +4361,18 @@ const Root$a = styled(Layer)`
4361
4361
  zOffset = layer.tooltip.zOffset,
4362
4362
  delay,
4363
4363
  ...restProps
4364
- } = props, animate = usePrefersReducedMotion() ? !1 : _animate, fallbackPlacements = useArrayProp(fallbackPlacementsProp), forwardedRef = useForwardedRef(ref), [referenceElement, setReferenceElement] = useState(null), arrowRef = useRef(null), rootBoundary = "viewport", portal = usePortal(), portalElement = typeof portalProp == "string" ? ((_c = portal.elements) == null ? void 0 : _c[portalProp]) || null : portal.element, tooltipWidth = useMemo(() => {
4364
+ } = props, animate = usePrefersReducedMotion() ? !1 : _animate, fallbackPlacements = useArrayProp(fallbackPlacementsProp), forwardedRef = useForwardedRef(ref), [referenceElement, setReferenceElement] = useState(null), arrowRef = useRef(null), rootBoundary = "viewport", portal = usePortal(), portalElement = typeof portalProp == "string" ? ((_c = portal.elements) == null ? void 0 : _c[portalProp]) || null : portal.element, documentBodyOffsetWidth = useSyncExternalStore(
4365
+ emptySubscribe,
4366
+ () => document.body.offsetWidth,
4367
+ // We don't actually know what the width of the body is during SSR, so we'll just assume it's 800px or larger
4368
+ () => 800
4369
+ ), tooltipWidth = useMemo(() => {
4365
4370
  const availableWidths = [
4366
4371
  ...boundaryElement ? [boundaryElement.offsetWidth] : [],
4367
- (portalElement == null ? void 0 : portalElement.offsetWidth) || document.body.offsetWidth
4372
+ (portalElement == null ? void 0 : portalElement.offsetWidth) || documentBodyOffsetWidth
4368
4373
  ];
4369
4374
  return Math.min(...availableWidths) - DEFAULT_TOOLTIP_PADDING * 2;
4370
- }, [boundaryElement, portalElement == null ? void 0 : portalElement.offsetWidth]), middleware = useMemo(() => {
4375
+ }, [boundaryElement, documentBodyOffsetWidth, portalElement == null ? void 0 : portalElement.offsetWidth]), middleware = useMemo(() => {
4371
4376
  const ret = [];
4372
4377
  return ret.push(
4373
4378
  flip({
@@ -4547,7 +4552,8 @@ const Root$a = styled(Layer)`
4547
4552
  ),
4548
4553
  child
4549
4554
  ] });
4550
- }), Root$9 = styled.div`
4555
+ }), emptySubscribe = () => () => {
4556
+ }, Root$9 = styled.div`
4551
4557
  line-height: 0;
4552
4558
  `, ListBox = styled(Box)`
4553
4559
  & > ul {