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