@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.esm.js +10 -4
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +10 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +7 -7
- package/src/core/primitives/tooltip/tooltip.tsx +20 -11
package/dist/index.esm.js
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,
|
|
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) ||
|
|
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
|
-
}),
|
|
4555
|
+
}), emptySubscribe = () => () => {
|
|
4556
|
+
}, Root$9 = styled.div`
|
|
4551
4557
|
line-height: 0;
|
|
4552
4558
|
`, ListBox = styled(Box)`
|
|
4553
4559
|
& > ul {
|