@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.esm.js CHANGED
@@ -3823,13 +3823,13 @@ const studioTheme = {
3823
3823
  avatar: {
3824
3824
  sizes: [{
3825
3825
  distance: -3,
3826
- size: 23
3826
+ size: 19
3827
3827
  }, {
3828
3828
  distance: -6,
3829
- size: 33
3829
+ size: 31
3830
3830
  }, {
3831
3831
  distance: -9,
3832
- size: 53
3832
+ size: 51
3833
3833
  }],
3834
3834
  focusRing: {
3835
3835
  offset: 0,
@@ -4869,7 +4869,8 @@ const avatarStyle = {
4869
4869
  arrow: avatarArrowStyle,
4870
4870
  bgStroke: avatarBgStrokeStyle,
4871
4871
  stroke: avatarStrokeStyle,
4872
- initials: avatarInitialsStyle
4872
+ initials: avatarInitialsStyle,
4873
+ image: avatarImageStyle
4873
4874
  };
4874
4875
  function avatarArrowStyle() {
4875
4876
  return {
@@ -4976,6 +4977,11 @@ function responsiveAvatarSizeStyle(props) {
4976
4977
  };
4977
4978
  });
4978
4979
  }
4980
+ function avatarImageStyle() {
4981
+ return {
4982
+ position: "relative"
4983
+ };
4984
+ }
4979
4985
  function avatarInitialsStyle(props) {
4980
4986
  const {
4981
4987
  theme
@@ -5017,6 +5023,7 @@ const Arrow = styled.div(avatarStyle.arrow);
5017
5023
  const BgStroke = styled.ellipse(avatarStyle.bgStroke);
5018
5024
  const Stroke = styled.ellipse(avatarStyle.stroke);
5019
5025
  const Initials = styled.div(avatarStyle.initials);
5026
+ const Image = styled.svg(avatarStyle.image);
5020
5027
  const Avatar = forwardRef(function Avatar2(props, ref) {
5021
5028
  const {
5022
5029
  __unstable_hideInnerStroke,
@@ -5081,7 +5088,7 @@ const Avatar = forwardRef(function Avatar2(props, ref) {
5081
5088
  fill: color
5082
5089
  })
5083
5090
  })
5084
- }), !imageFailed && src && /* @__PURE__ */jsxs("svg", {
5091
+ }), !imageFailed && src && /* @__PURE__ */jsxs(Image, {
5085
5092
  viewBox: "0 0 ".concat(_sizeRem, " ").concat(_sizeRem),
5086
5093
  fill: "none",
5087
5094
  children: [/* @__PURE__ */jsx("defs", {
@@ -7863,10 +7870,6 @@ function TooltipDelayGroupProvider(props) {
7863
7870
  } = props;
7864
7871
  const [isGroupActive, setIsGroupActive] = useDelayedState(false);
7865
7872
  const [openTooltipId, setOpenTooltipId] = useDelayedState(null);
7866
- const isInsideContext = useTooltipDelayGroup();
7867
- if (isInsideContext) {
7868
- throw new Error("TooltipDelayGroupProvider cannot be nested inside another TooltipDelayGroupProvider");
7869
- }
7870
7873
  const openDelay = typeof delay === "number" ? delay : (delay == null ? void 0 : delay.open) || 0;
7871
7874
  const closeDelay = typeof delay === "number" ? delay : (delay == null ? void 0 : delay.close) || 0;
7872
7875
  const value = useMemo(() => ({
@@ -8031,7 +8034,7 @@ const Tooltip = forwardRef(function Tooltip2(props, ref) {
8031
8034
  (_b2 = (_a3 = childProp == null ? void 0 : childProp.props) == null ? void 0 : _a3.onMouseLeave) == null ? void 0 : _b2.call(_a3, e);
8032
8035
  }, [childProp == null ? void 0 : childProp.props, handleIsOpenChange]);
8033
8036
  useEffect(() => {
8034
- if (!isOpen) return;
8037
+ if (!showTooltip) return;
8035
8038
  function handleWindowMouseMove(event) {
8036
8039
  if (!referenceElement) return;
8037
8040
  const isHoveringReference = referenceElement === event.target || event.target instanceof Node && referenceElement.contains(event.target);
@@ -8044,13 +8047,13 @@ const Tooltip = forwardRef(function Tooltip2(props, ref) {
8044
8047
  return () => {
8045
8048
  window.removeEventListener("mousemove", handleWindowMouseMove);
8046
8049
  };
8047
- }, [isOpen, referenceElement, handleIsOpenChange]);
8050
+ }, [showTooltip, referenceElement, handleIsOpenChange]);
8048
8051
  useEffect(() => {
8049
- if (disabled) handleIsOpenChange(false);
8050
- }, [disabled, handleIsOpenChange]);
8052
+ if (disabled && showTooltip) handleIsOpenChange(false);
8053
+ }, [disabled, handleIsOpenChange, showTooltip]);
8051
8054
  useEffect(() => {
8052
- if (!content) handleIsOpenChange(false);
8053
- }, [content, handleIsOpenChange]);
8055
+ if (!content && showTooltip) handleIsOpenChange(false);
8056
+ }, [content, handleIsOpenChange, showTooltip]);
8054
8057
  useEffect(() => refs.setReference(referenceElement), [referenceElement, refs]);
8055
8058
  useEffect(() => {
8056
8059
  if (!showTooltip) return;