@sanity/ui 2.9.0-canary.5 → 2.9.0-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 +167 -71
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +166 -70
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +167 -71
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/core/primitives/tooltip/tooltip.tsx +40 -13
package/dist/index.js
CHANGED
|
@@ -3967,7 +3967,7 @@ const Popover = react.memo(react.forwardRef(function(props, forwardedRef) {
|
|
|
3967
3967
|
}, $[73] = refs, $[74] = t25) : t25 = $[74];
|
|
3968
3968
|
const setReference = t25, t26 = childProp;
|
|
3969
3969
|
let t27;
|
|
3970
|
-
$[75] !== t26 ? (t27 = getElementRef(t26), $[75] = t26, $[76] = t27) : t27 = $[76];
|
|
3970
|
+
$[75] !== t26 ? (t27 = getElementRef$1(t26), $[75] = t26, $[76] = t27) : t27 = $[76];
|
|
3971
3971
|
let t28, t29;
|
|
3972
3972
|
$[77] !== childElement ? (t28 = () => childElement, t29 = [childElement], $[77] = childElement, $[78] = t28, $[79] = t29) : (t28 = $[78], t29 = $[79]), react.useImperativeHandle(t27, t28, t29);
|
|
3973
3973
|
let t30;
|
|
@@ -4008,7 +4008,7 @@ const Popover = react.memo(react.forwardRef(function(props, forwardedRef) {
|
|
|
4008
4008
|
] }), $[125] = t38, $[126] = child, $[127] = t39) : t39 = $[127], t39;
|
|
4009
4009
|
}));
|
|
4010
4010
|
Popover.displayName = "Memo(ForwardRef(Popover))";
|
|
4011
|
-
function getElementRef(element) {
|
|
4011
|
+
function getElementRef$1(element) {
|
|
4012
4012
|
if (!element) return null;
|
|
4013
4013
|
let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get, mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
4014
4014
|
return mayWarn ? element.ref : (getter = Object.getOwnPropertyDescriptor(element, "ref")?.get, mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning, mayWarn ? element.props.ref : element.props.ref || element.ref);
|
|
@@ -4842,55 +4842,80 @@ TooltipDelayGroupProvider.displayName = "TooltipDelayGroupProvider";
|
|
|
4842
4842
|
const Root$a = styledComponents.styled(Layer)`
|
|
4843
4843
|
pointer-events: none;
|
|
4844
4844
|
`, Tooltip = react.forwardRef(function(props, forwardedRef) {
|
|
4845
|
-
const boundaryElementContext = useBoundaryElement(), {
|
|
4845
|
+
const $ = reactCompilerRuntime.c(142), boundaryElementContext = useBoundaryElement(), {
|
|
4846
4846
|
layer
|
|
4847
|
-
} = useTheme_v2()
|
|
4848
|
-
|
|
4849
|
-
|
|
4847
|
+
} = useTheme_v2();
|
|
4848
|
+
let t0, t1, t2, t3, t4, t5, _boundaryElement, _fallbackPlacementsProp, _zOffset, portalProp, delay, childProp, disabled, content, restProps, scheme;
|
|
4849
|
+
$[0] !== props ? ({
|
|
4850
|
+
animate: t0,
|
|
4851
|
+
arrow: t1,
|
|
4850
4852
|
boundaryElement: _boundaryElement,
|
|
4851
4853
|
children: childProp,
|
|
4852
4854
|
content,
|
|
4853
4855
|
disabled,
|
|
4854
4856
|
fallbackPlacements: _fallbackPlacementsProp,
|
|
4855
|
-
padding
|
|
4856
|
-
placement:
|
|
4857
|
+
padding: t2,
|
|
4858
|
+
placement: t3,
|
|
4857
4859
|
portal: portalProp,
|
|
4858
|
-
radius
|
|
4860
|
+
radius: t4,
|
|
4859
4861
|
scheme,
|
|
4860
|
-
shadow
|
|
4862
|
+
shadow: t5,
|
|
4861
4863
|
zOffset: _zOffset,
|
|
4862
4864
|
delay,
|
|
4863
4865
|
...restProps
|
|
4864
|
-
} = props,
|
|
4865
|
-
react.
|
|
4866
|
-
|
|
4867
|
-
|
|
4868
|
-
|
|
4869
|
-
|
|
4866
|
+
} = props, $[0] = props, $[1] = t0, $[2] = t1, $[3] = t2, $[4] = t3, $[5] = t4, $[6] = t5, $[7] = _boundaryElement, $[8] = _fallbackPlacementsProp, $[9] = _zOffset, $[10] = portalProp, $[11] = delay, $[12] = childProp, $[13] = disabled, $[14] = content, $[15] = restProps, $[16] = scheme) : (t0 = $[1], t1 = $[2], t2 = $[3], t3 = $[4], t4 = $[5], t5 = $[6], _boundaryElement = $[7], _fallbackPlacementsProp = $[8], _zOffset = $[9], portalProp = $[10], delay = $[11], childProp = $[12], disabled = $[13], content = $[14], restProps = $[15], scheme = $[16]);
|
|
4867
|
+
const _animate = t0 === void 0 ? !1 : t0, arrowProp = t1 === void 0 ? !1 : t1, padding = t2 === void 0 ? 2 : t2, placementProp = t3 === void 0 ? "bottom" : t3, radius = t4 === void 0 ? 2 : t4, shadow = t5 === void 0 ? 2 : t5, boundaryElement = _boundaryElement ?? boundaryElementContext?.element, fallbackPlacementsProp = _fallbackPlacementsProp ?? DEFAULT_FALLBACK_PLACEMENTS[props.placement ?? "bottom"], zOffset = _zOffset ?? layer.tooltip.zOffset, animate = usePrefersReducedMotion() ? !1 : _animate, fallbackPlacements = useArrayProp(fallbackPlacementsProp), ref = react.useRef(null), [referenceElement, setReferenceElement] = react.useState(null), [arrowElement, setArrowElement] = react.useState(null), [tooltipMaxWidth, setTooltipMaxWidth] = react.useState(0);
|
|
4868
|
+
let t6;
|
|
4869
|
+
$[17] === Symbol.for("react.memo_cache_sentinel") ? (t6 = () => ref.current, $[17] = t6) : t6 = $[17], react.useImperativeHandle(forwardedRef, t6);
|
|
4870
|
+
const portal = usePortal(), portalElement = typeof portalProp == "string" ? portal.elements?.[portalProp] || null : portal.element;
|
|
4871
|
+
let t7, ret;
|
|
4872
|
+
if ($[18] !== boundaryElement || $[19] !== fallbackPlacements || $[20] !== arrowProp || $[21] !== arrowElement || $[22] !== animate) {
|
|
4873
|
+
ret = [];
|
|
4874
|
+
const t82 = boundaryElement || void 0;
|
|
4875
|
+
let t92;
|
|
4876
|
+
$[24] !== t82 || $[25] !== fallbackPlacements ? (t92 = reactDom$1.flip({
|
|
4877
|
+
boundary: t82,
|
|
4870
4878
|
fallbackPlacements,
|
|
4871
4879
|
padding: DEFAULT_TOOLTIP_PADDING,
|
|
4872
|
-
rootBoundary
|
|
4873
|
-
})), ret.push(
|
|
4880
|
+
rootBoundary: "viewport"
|
|
4881
|
+
}), $[24] = t82, $[25] = fallbackPlacements, $[26] = t92) : t92 = $[26], ret.push(t92);
|
|
4882
|
+
let t102;
|
|
4883
|
+
$[27] === Symbol.for("react.memo_cache_sentinel") ? (t102 = reactDom$1.offset({
|
|
4874
4884
|
mainAxis: DEFAULT_TOOLTIP_DISTANCE
|
|
4875
|
-
})), ret.push(
|
|
4876
|
-
|
|
4877
|
-
|
|
4878
|
-
|
|
4879
|
-
|
|
4880
|
-
|
|
4885
|
+
}), $[27] = t102) : t102 = $[27], ret.push(t102);
|
|
4886
|
+
const t112 = boundaryElement || void 0;
|
|
4887
|
+
let t122;
|
|
4888
|
+
if ($[28] !== t112 ? (t122 = reactDom$1.shift({
|
|
4889
|
+
boundary: t112,
|
|
4890
|
+
rootBoundary: "viewport",
|
|
4881
4891
|
padding: DEFAULT_TOOLTIP_PADDING
|
|
4882
|
-
})
|
|
4883
|
-
|
|
4892
|
+
}), $[28] = t112, $[29] = t122) : t122 = $[29], ret.push(t122), arrowProp) {
|
|
4893
|
+
let t132;
|
|
4894
|
+
$[30] !== arrowElement ? (t132 = reactDom$1.arrow({
|
|
4895
|
+
element: arrowElement,
|
|
4896
|
+
padding: DEFAULT_TOOLTIP_PADDING
|
|
4897
|
+
}), $[30] = arrowElement, $[31] = t132) : t132 = $[31], ret.push(t132);
|
|
4898
|
+
}
|
|
4899
|
+
animate && ret.push(origin), $[18] = boundaryElement, $[19] = fallbackPlacements, $[20] = arrowProp, $[21] = arrowElement, $[22] = animate, $[23] = ret;
|
|
4900
|
+
} else
|
|
4901
|
+
ret = $[23];
|
|
4902
|
+
t7 = ret;
|
|
4903
|
+
const middleware = t7;
|
|
4904
|
+
let t8;
|
|
4905
|
+
$[32] !== middleware || $[33] !== placementProp ? (t8 = {
|
|
4906
|
+
middleware,
|
|
4907
|
+
placement: placementProp,
|
|
4908
|
+
whileElementsMounted: reactDom$1.autoUpdate
|
|
4909
|
+
}, $[32] = middleware, $[33] = placementProp, $[34] = t8) : t8 = $[34];
|
|
4910
|
+
const {
|
|
4884
4911
|
floatingStyles,
|
|
4885
4912
|
placement,
|
|
4886
4913
|
middlewareData,
|
|
4887
4914
|
refs,
|
|
4888
4915
|
update
|
|
4889
|
-
} = reactDom$1.useFloating(
|
|
4890
|
-
|
|
4891
|
-
|
|
4892
|
-
whileElementsMounted: reactDom$1.autoUpdate
|
|
4893
|
-
}), arrowX = middlewareData.arrow?.x, arrowY = middlewareData.arrow?.y, originX = middlewareData["@sanity/ui/origin"]?.originX, originY = middlewareData["@sanity/ui/origin"]?.originY, tooltipId = react.useId(), [isOpen, setIsOpen] = useDelayedState(!1), delayGroupContext = useTooltipDelayGroup(), showTooltip = isOpen || delayGroupContext?.openTooltipId === tooltipId, isInsideGroup = delayGroupContext !== null, openDelayProp = typeof delay == "number" ? delay : delay?.open || 0, closeDelayProp = typeof delay == "number" ? delay : delay?.close || 0, openDelay = isInsideGroup ? delayGroupContext.openDelay : openDelayProp, closeDelay = isInsideGroup ? delayGroupContext.closeDelay : closeDelayProp, handleIsOpenChange = react.useCallback((open, immediate) => {
|
|
4916
|
+
} = reactDom$1.useFloating(t8), arrowX = middlewareData.arrow?.x, arrowY = middlewareData.arrow?.y, originX = middlewareData["@sanity/ui/origin"]?.originX, originY = middlewareData["@sanity/ui/origin"]?.originY, tooltipId = react.useId(), [isOpen, setIsOpen] = useDelayedState(!1), delayGroupContext = useTooltipDelayGroup(), showTooltip = isOpen || delayGroupContext?.openTooltipId === tooltipId, isInsideGroup = delayGroupContext !== null, openDelayProp = typeof delay == "number" ? delay : delay?.open || 0, closeDelayProp = typeof delay == "number" ? delay : delay?.close || 0, openDelay = isInsideGroup ? delayGroupContext.openDelay : openDelayProp, closeDelay = isInsideGroup ? delayGroupContext.closeDelay : closeDelayProp;
|
|
4917
|
+
let t9;
|
|
4918
|
+
$[35] !== isInsideGroup || $[36] !== openDelay || $[37] !== delayGroupContext || $[38] !== tooltipId || $[39] !== closeDelay || $[40] !== setIsOpen ? (t9 = (open, immediate) => {
|
|
4894
4919
|
if (isInsideGroup)
|
|
4895
4920
|
if (open) {
|
|
4896
4921
|
const groupedOpenDelay = immediate ? 0 : openDelay;
|
|
@@ -4901,67 +4926,133 @@ const Root$a = styledComponents.styled(Layer)`
|
|
|
4901
4926
|
}
|
|
4902
4927
|
else
|
|
4903
4928
|
setIsOpen(open, immediate ? 0 : open ? openDelay : closeDelay);
|
|
4904
|
-
}, [isInsideGroup,
|
|
4929
|
+
}, $[35] = isInsideGroup, $[36] = openDelay, $[37] = delayGroupContext, $[38] = tooltipId, $[39] = closeDelay, $[40] = setIsOpen, $[41] = t9) : t9 = $[41];
|
|
4930
|
+
const handleIsOpenChange = t9;
|
|
4931
|
+
let t10;
|
|
4932
|
+
$[42] !== handleIsOpenChange || $[43] !== childProp ? (t10 = (e) => {
|
|
4905
4933
|
handleIsOpenChange(!1), childProp?.props?.onBlur?.(e);
|
|
4906
|
-
}, [
|
|
4934
|
+
}, $[42] = handleIsOpenChange, $[43] = childProp, $[44] = t10) : t10 = $[44];
|
|
4935
|
+
const handleBlur = t10;
|
|
4936
|
+
let t11;
|
|
4937
|
+
$[45] !== handleIsOpenChange || $[46] !== childProp ? (t11 = (e_0) => {
|
|
4907
4938
|
handleIsOpenChange(!1, !0), childProp?.props.onClick?.(e_0);
|
|
4908
|
-
}, [
|
|
4939
|
+
}, $[45] = handleIsOpenChange, $[46] = childProp, $[47] = t11) : t11 = $[47];
|
|
4940
|
+
const handleClick = t11;
|
|
4941
|
+
let t12;
|
|
4942
|
+
$[48] !== handleIsOpenChange || $[49] !== childProp ? (t12 = (e_1) => {
|
|
4909
4943
|
handleIsOpenChange(!1, !0), childProp?.props.onContextMenu?.(e_1);
|
|
4910
|
-
}, [
|
|
4944
|
+
}, $[48] = handleIsOpenChange, $[49] = childProp, $[50] = t12) : t12 = $[50];
|
|
4945
|
+
const handleContextMenu = t12;
|
|
4946
|
+
let t13;
|
|
4947
|
+
$[51] !== handleIsOpenChange || $[52] !== childProp ? (t13 = (e_2) => {
|
|
4911
4948
|
handleIsOpenChange(!0), childProp?.props?.onFocus?.(e_2);
|
|
4912
|
-
}, [
|
|
4949
|
+
}, $[51] = handleIsOpenChange, $[52] = childProp, $[53] = t13) : t13 = $[53];
|
|
4950
|
+
const handleFocus = t13;
|
|
4951
|
+
let t14;
|
|
4952
|
+
$[54] !== handleIsOpenChange || $[55] !== childProp ? (t14 = (e_3) => {
|
|
4913
4953
|
handleIsOpenChange(!0), childProp?.props?.onMouseEnter?.(e_3);
|
|
4914
|
-
}, [
|
|
4954
|
+
}, $[54] = handleIsOpenChange, $[55] = childProp, $[56] = t14) : t14 = $[56];
|
|
4955
|
+
const handleMouseEnter = t14;
|
|
4956
|
+
let t15;
|
|
4957
|
+
$[57] !== handleIsOpenChange || $[58] !== childProp ? (t15 = (e_4) => {
|
|
4915
4958
|
handleIsOpenChange(!1), childProp?.props?.onMouseLeave?.(e_4);
|
|
4916
|
-
}, [childProp
|
|
4917
|
-
|
|
4959
|
+
}, $[57] = handleIsOpenChange, $[58] = childProp, $[59] = t15) : t15 = $[59];
|
|
4960
|
+
const handleMouseLeave = t15;
|
|
4961
|
+
let t16;
|
|
4962
|
+
$[60] !== handleIsOpenChange || $[61] !== referenceElement || $[62] !== showTooltip ? (t16 = {
|
|
4918
4963
|
handleIsOpenChange,
|
|
4919
4964
|
referenceElement,
|
|
4920
4965
|
showTooltip
|
|
4921
|
-
}),
|
|
4966
|
+
}, $[60] = handleIsOpenChange, $[61] = referenceElement, $[62] = showTooltip, $[63] = t16) : t16 = $[63], useCloseOnMouseLeave(t16);
|
|
4967
|
+
let t17, t18;
|
|
4968
|
+
$[64] !== disabled || $[65] !== showTooltip || $[66] !== handleIsOpenChange ? (t17 = () => {
|
|
4922
4969
|
disabled && showTooltip && handleIsOpenChange(!1);
|
|
4923
|
-
}, [disabled, handleIsOpenChange, showTooltip]), react.useEffect(
|
|
4970
|
+
}, t18 = [disabled, handleIsOpenChange, showTooltip], $[64] = disabled, $[65] = showTooltip, $[66] = handleIsOpenChange, $[67] = t17, $[68] = t18) : (t17 = $[67], t18 = $[68]), react.useEffect(t17, t18);
|
|
4971
|
+
let t19, t20;
|
|
4972
|
+
$[69] !== content || $[70] !== showTooltip || $[71] !== handleIsOpenChange ? (t19 = () => {
|
|
4924
4973
|
!content && showTooltip && handleIsOpenChange(!1);
|
|
4925
|
-
}, [content, handleIsOpenChange, showTooltip]
|
|
4926
|
-
|
|
4927
|
-
|
|
4974
|
+
}, t20 = [content, handleIsOpenChange, showTooltip], $[69] = content, $[70] = showTooltip, $[71] = handleIsOpenChange, $[72] = t19, $[73] = t20) : (t19 = $[72], t20 = $[73]), react.useEffect(t19, t20);
|
|
4975
|
+
let t21, t22;
|
|
4976
|
+
$[74] !== refs || $[75] !== referenceElement ? (t21 = () => refs.setReference(referenceElement), t22 = [referenceElement, refs], $[74] = refs, $[75] = referenceElement, $[76] = t21, $[77] = t22) : (t21 = $[76], t22 = $[77]), react.useEffect(t21, t22);
|
|
4977
|
+
let t23, t24;
|
|
4978
|
+
$[78] !== showTooltip || $[79] !== handleIsOpenChange ? (t23 = () => {
|
|
4979
|
+
if (!showTooltip)
|
|
4980
|
+
return;
|
|
4981
|
+
const handleWindowKeyDown = function(event) {
|
|
4928
4982
|
event.key === "Escape" && handleIsOpenChange(!1, !0);
|
|
4929
|
-
}
|
|
4983
|
+
};
|
|
4930
4984
|
return window.addEventListener("keydown", handleWindowKeyDown), () => {
|
|
4931
4985
|
window.removeEventListener("keydown", handleWindowKeyDown);
|
|
4932
4986
|
};
|
|
4933
|
-
}, [handleIsOpenChange, showTooltip]), react.
|
|
4987
|
+
}, t24 = [handleIsOpenChange, showTooltip], $[78] = showTooltip, $[79] = handleIsOpenChange, $[80] = t23, $[81] = t24) : (t23 = $[80], t24 = $[81]), react.useEffect(t23, t24);
|
|
4988
|
+
let t25, t26;
|
|
4989
|
+
$[82] !== boundaryElement || $[83] !== portalElement ? (t25 = () => {
|
|
4934
4990
|
const availableWidths = [...boundaryElement ? [boundaryElement.offsetWidth] : [], portalElement?.offsetWidth || document.body.offsetWidth];
|
|
4935
4991
|
setTooltipMaxWidth(Math.min(...availableWidths) - DEFAULT_TOOLTIP_PADDING * 2);
|
|
4936
|
-
}, [boundaryElement, portalElement]);
|
|
4937
|
-
|
|
4938
|
-
|
|
4939
|
-
|
|
4992
|
+
}, t26 = [boundaryElement, portalElement], $[82] = boundaryElement, $[83] = portalElement, $[84] = t25, $[85] = t26) : (t25 = $[84], t26 = $[85]), react.useLayoutEffect(t25, t26);
|
|
4993
|
+
let t27;
|
|
4994
|
+
$[86] !== update ? (t27 = (arrowEl) => {
|
|
4995
|
+
setArrowElement(arrowEl), update();
|
|
4996
|
+
}, $[86] = update, $[87] = t27) : t27 = $[87];
|
|
4997
|
+
const setArrow = t27;
|
|
4998
|
+
let t28;
|
|
4999
|
+
$[88] !== refs ? (t28 = (node) => {
|
|
4940
5000
|
ref.current = node, refs.setFloating(node);
|
|
4941
|
-
}, [refs])
|
|
4942
|
-
react.
|
|
4943
|
-
|
|
4944
|
-
|
|
4945
|
-
|
|
4946
|
-
|
|
4947
|
-
|
|
4948
|
-
|
|
4949
|
-
|
|
4950
|
-
|
|
4951
|
-
|
|
4952
|
-
|
|
5001
|
+
}, $[88] = refs, $[89] = t28) : t28 = $[89];
|
|
5002
|
+
const setFloating = t28, childRef = react.useRef(null), [childElement, setChildElement] = react.useState(null), t29 = childProp;
|
|
5003
|
+
let t30;
|
|
5004
|
+
$[90] !== t29 ? (t30 = getElementRef(t29), $[90] = t29, $[91] = t30) : t30 = $[91];
|
|
5005
|
+
let t31, t32;
|
|
5006
|
+
$[92] !== childElement ? (t31 = () => childElement, t32 = [childElement], $[92] = childElement, $[93] = t31, $[94] = t32) : (t31 = $[93], t32 = $[94]), react.useImperativeHandle(t30, t31, t32);
|
|
5007
|
+
let t33;
|
|
5008
|
+
bb0: {
|
|
5009
|
+
if (!childProp) {
|
|
5010
|
+
t33 = null;
|
|
5011
|
+
break bb0;
|
|
5012
|
+
}
|
|
5013
|
+
let t342;
|
|
5014
|
+
$[95] !== handleBlur || $[96] !== handleFocus || $[97] !== handleMouseEnter || $[98] !== handleMouseLeave || $[99] !== handleClick || $[100] !== handleContextMenu || $[101] !== childProp ? (t342 = react.cloneElement(childProp, {
|
|
5015
|
+
onBlur: handleBlur,
|
|
5016
|
+
onFocus: handleFocus,
|
|
5017
|
+
onMouseEnter: handleMouseEnter,
|
|
5018
|
+
onMouseLeave: handleMouseLeave,
|
|
5019
|
+
onClick: handleClick,
|
|
5020
|
+
onContextMenu: handleContextMenu,
|
|
5021
|
+
ref: setChildElement
|
|
5022
|
+
}), $[95] = handleBlur, $[96] = handleFocus, $[97] = handleMouseEnter, $[98] = handleMouseLeave, $[99] = handleClick, $[100] = handleContextMenu, $[101] = childProp, $[102] = t342) : t342 = $[102], t33 = t342;
|
|
5023
|
+
}
|
|
5024
|
+
const child = t33;
|
|
5025
|
+
let t34, t35;
|
|
5026
|
+
if ($[103] !== child ? (t34 = () => {
|
|
4953
5027
|
if (child)
|
|
4954
5028
|
return setReferenceElement(childRef.current), () => setReferenceElement(null);
|
|
4955
|
-
}, [child]
|
|
4956
|
-
|
|
4957
|
-
|
|
5029
|
+
}, t35 = [child], $[103] = child, $[104] = t34, $[105] = t35) : (t34 = $[104], t35 = $[105]), react.useEffect(t34, t35), !child) {
|
|
5030
|
+
let t362;
|
|
5031
|
+
return $[106] === Symbol.for("react.memo_cache_sentinel") ? (t362 = /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {}), $[106] = t362) : t362 = $[106], t362;
|
|
5032
|
+
}
|
|
5033
|
+
if (disabled)
|
|
5034
|
+
return child;
|
|
5035
|
+
const t36 = tooltipMaxWidth > 0 ? `${tooltipMaxWidth}px` : void 0;
|
|
5036
|
+
let t37;
|
|
5037
|
+
$[107] !== floatingStyles || $[108] !== t36 ? (t37 = {
|
|
4958
5038
|
...floatingStyles,
|
|
4959
|
-
maxWidth:
|
|
4960
|
-
},
|
|
4961
|
-
|
|
4962
|
-
|
|
5039
|
+
maxWidth: t36
|
|
5040
|
+
}, $[107] = floatingStyles, $[108] = t36, $[109] = t37) : t37 = $[109];
|
|
5041
|
+
let t38;
|
|
5042
|
+
$[110] !== restProps || $[111] !== animate || $[112] !== arrowProp || $[113] !== setArrow || $[114] !== arrowX || $[115] !== arrowY || $[116] !== originX || $[117] !== originY || $[118] !== padding || $[119] !== placement || $[120] !== radius || $[121] !== setFloating || $[122] !== scheme || $[123] !== shadow || $[124] !== content ? (t38 = /* @__PURE__ */ jsxRuntime.jsx(TooltipCard, { ...restProps, animate, arrow: arrowProp, arrowRef: setArrow, arrowX, arrowY, originX, originY, padding, placement, radius, ref: setFloating, scheme, shadow, children: content }), $[110] = restProps, $[111] = animate, $[112] = arrowProp, $[113] = setArrow, $[114] = arrowX, $[115] = arrowY, $[116] = originX, $[117] = originY, $[118] = padding, $[119] = placement, $[120] = radius, $[121] = setFloating, $[122] = scheme, $[123] = shadow, $[124] = content, $[125] = t38) : t38 = $[125];
|
|
5043
|
+
let t39;
|
|
5044
|
+
$[126] !== restProps || $[127] !== setFloating || $[128] !== t37 || $[129] !== zOffset || $[130] !== t38 ? (t39 = /* @__PURE__ */ jsxRuntime.jsx(Root$a, { "data-ui": "Tooltip", ...restProps, ref: setFloating, style: t37, zOffset, children: t38 }), $[126] = restProps, $[127] = setFloating, $[128] = t37, $[129] = zOffset, $[130] = t38, $[131] = t39) : t39 = $[131];
|
|
5045
|
+
const tooltip = t39;
|
|
5046
|
+
let t40;
|
|
5047
|
+
$[132] !== showTooltip || $[133] !== portalProp || $[134] !== tooltip ? (t40 = showTooltip && (portalProp ? /* @__PURE__ */ jsxRuntime.jsx(Portal, { __unstable_name: typeof portalProp == "string" ? portalProp : void 0, children: tooltip }) : tooltip), $[132] = showTooltip, $[133] = portalProp, $[134] = tooltip, $[135] = t40) : t40 = $[135];
|
|
5048
|
+
const children = t40;
|
|
5049
|
+
let t41;
|
|
5050
|
+
$[136] !== animate || $[137] !== children ? (t41 = animate ? /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { children }) : children, $[136] = animate, $[137] = children, $[138] = t41) : t41 = $[138];
|
|
5051
|
+
let t42;
|
|
5052
|
+
return $[139] !== t41 || $[140] !== child ? (t42 = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
5053
|
+
t41,
|
|
4963
5054
|
child
|
|
4964
|
-
] });
|
|
5055
|
+
] }), $[139] = t41, $[140] = child, $[141] = t42) : t42 = $[141], t42;
|
|
4965
5056
|
});
|
|
4966
5057
|
Tooltip.displayName = "ForwardRef(Tooltip)";
|
|
4967
5058
|
function useCloseOnMouseLeave(t0) {
|
|
@@ -4985,6 +5076,11 @@ function useCloseOnMouseLeave(t0) {
|
|
|
4985
5076
|
return window.addEventListener("mousemove", handleMouseMove), () => window.removeEventListener("mousemove", handleMouseMove);
|
|
4986
5077
|
}, t3 = [onMouseMove, showTooltip], $[3] = showTooltip, $[4] = onMouseMove, $[5] = t2, $[6] = t3) : (t2 = $[5], t3 = $[6]), react.useEffect(t2, t3);
|
|
4987
5078
|
}
|
|
5079
|
+
function getElementRef(element) {
|
|
5080
|
+
if (!element) return null;
|
|
5081
|
+
let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get, mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
5082
|
+
return mayWarn ? element.ref : (getter = Object.getOwnPropertyDescriptor(element, "ref")?.get, mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning, mayWarn ? element.props.ref : element.props.ref || element.ref);
|
|
5083
|
+
}
|
|
4988
5084
|
const Root$9 = styledComponents.styled.div`
|
|
4989
5085
|
line-height: 0;
|
|
4990
5086
|
`, ListBox = styledComponents.styled(Box)`
|