@sanity/ui 2.0.0-alpha.22 → 2.0.0-alpha.24

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
@@ -3836,13 +3836,13 @@ const studioTheme = {
3836
3836
  avatar: {
3837
3837
  sizes: [{
3838
3838
  distance: -3,
3839
- size: 23
3839
+ size: 19
3840
3840
  }, {
3841
3841
  distance: -6,
3842
- size: 33
3842
+ size: 31
3843
3843
  }, {
3844
3844
  distance: -9,
3845
- size: 53
3845
+ size: 51
3846
3846
  }],
3847
3847
  focusRing: {
3848
3848
  offset: 0,
@@ -4882,7 +4882,8 @@ const avatarStyle = {
4882
4882
  arrow: avatarArrowStyle,
4883
4883
  bgStroke: avatarBgStrokeStyle,
4884
4884
  stroke: avatarStrokeStyle,
4885
- initials: avatarInitialsStyle
4885
+ initials: avatarInitialsStyle,
4886
+ image: avatarImageStyle
4886
4887
  };
4887
4888
  function avatarArrowStyle() {
4888
4889
  return {
@@ -4989,6 +4990,11 @@ function responsiveAvatarSizeStyle(props) {
4989
4990
  };
4990
4991
  });
4991
4992
  }
4993
+ function avatarImageStyle() {
4994
+ return {
4995
+ position: "relative"
4996
+ };
4997
+ }
4992
4998
  function avatarInitialsStyle(props) {
4993
4999
  const {
4994
5000
  theme
@@ -5030,6 +5036,7 @@ const Arrow = styled__default.default.div(avatarStyle.arrow);
5030
5036
  const BgStroke = styled__default.default.ellipse(avatarStyle.bgStroke);
5031
5037
  const Stroke = styled__default.default.ellipse(avatarStyle.stroke);
5032
5038
  const Initials = styled__default.default.div(avatarStyle.initials);
5039
+ const Image = styled__default.default.svg(avatarStyle.image);
5033
5040
  const Avatar = react.forwardRef(function Avatar2(props, ref) {
5034
5041
  const {
5035
5042
  __unstable_hideInnerStroke,
@@ -5094,7 +5101,7 @@ const Avatar = react.forwardRef(function Avatar2(props, ref) {
5094
5101
  fill: color
5095
5102
  })
5096
5103
  })
5097
- }), !imageFailed && src && /* @__PURE__ */jsxRuntime.jsxs("svg", {
5104
+ }), !imageFailed && src && /* @__PURE__ */jsxRuntime.jsxs(Image, {
5098
5105
  viewBox: "0 0 ".concat(_sizeRem, " ").concat(_sizeRem),
5099
5106
  fill: "none",
5100
5107
  children: [/* @__PURE__ */jsxRuntime.jsx("defs", {
@@ -7876,10 +7883,6 @@ function TooltipDelayGroupProvider(props) {
7876
7883
  } = props;
7877
7884
  const [isGroupActive, setIsGroupActive] = useDelayedState(false);
7878
7885
  const [openTooltipId, setOpenTooltipId] = useDelayedState(null);
7879
- const isInsideContext = useTooltipDelayGroup();
7880
- if (isInsideContext) {
7881
- throw new Error("TooltipDelayGroupProvider cannot be nested inside another TooltipDelayGroupProvider");
7882
- }
7883
7886
  const openDelay = typeof delay === "number" ? delay : (delay == null ? void 0 : delay.open) || 0;
7884
7887
  const closeDelay = typeof delay === "number" ? delay : (delay == null ? void 0 : delay.close) || 0;
7885
7888
  const value = react.useMemo(() => ({
@@ -8044,7 +8047,7 @@ const Tooltip = react.forwardRef(function Tooltip2(props, ref) {
8044
8047
  (_b2 = (_a3 = childProp == null ? void 0 : childProp.props) == null ? void 0 : _a3.onMouseLeave) == null ? void 0 : _b2.call(_a3, e);
8045
8048
  }, [childProp == null ? void 0 : childProp.props, handleIsOpenChange]);
8046
8049
  react.useEffect(() => {
8047
- if (!isOpen) return;
8050
+ if (!showTooltip) return;
8048
8051
  function handleWindowMouseMove(event) {
8049
8052
  if (!referenceElement) return;
8050
8053
  const isHoveringReference = referenceElement === event.target || event.target instanceof Node && referenceElement.contains(event.target);
@@ -8057,13 +8060,13 @@ const Tooltip = react.forwardRef(function Tooltip2(props, ref) {
8057
8060
  return () => {
8058
8061
  window.removeEventListener("mousemove", handleWindowMouseMove);
8059
8062
  };
8060
- }, [isOpen, referenceElement, handleIsOpenChange]);
8063
+ }, [showTooltip, referenceElement, handleIsOpenChange]);
8061
8064
  react.useEffect(() => {
8062
- if (disabled) handleIsOpenChange(false);
8063
- }, [disabled, handleIsOpenChange]);
8065
+ if (disabled && showTooltip) handleIsOpenChange(false);
8066
+ }, [disabled, handleIsOpenChange, showTooltip]);
8064
8067
  react.useEffect(() => {
8065
- if (!content) handleIsOpenChange(false);
8066
- }, [content, handleIsOpenChange]);
8068
+ if (!content && showTooltip) handleIsOpenChange(false);
8069
+ }, [content, handleIsOpenChange, showTooltip]);
8067
8070
  react.useEffect(() => refs.setReference(referenceElement), [referenceElement, refs]);
8068
8071
  react.useEffect(() => {
8069
8072
  if (!showTooltip) return;