@sanity/ui 2.0.0-alpha.21 → 2.0.0-alpha.23

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", {
@@ -5333,7 +5340,8 @@ function badgeStyle(props) {
5333
5340
  const palette = theme.sanity.color[$mode === "outline" ? "muted" : "solid"];
5334
5341
  const color = palette[$tone] || palette.default;
5335
5342
  return {
5336
- backgroundColor: color.enabled.bg,
5343
+ "--card-fg-color": color.enabled.fg,
5344
+ backgroundColor: color.enabled.bg2,
5337
5345
  color: color.enabled.fg,
5338
5346
  boxShadow: "inset 0 0 0 1px ".concat(color.enabled.border),
5339
5347
  cursor: "default",
@@ -7816,6 +7824,7 @@ function useDelayedState(initialState) {
7816
7824
  }, []);
7817
7825
  return [state, onStateChange];
7818
7826
  }
7827
+ const DEFAULT_TOOLTIP_DISTANCE = 4;
7819
7828
  const DEFAULT_TOOLTIP_PADDING = 4;
7820
7829
  const DEFAULT_FALLBACK_PLACEMENTS = {
7821
7830
  top: ["bottom", "left", "right"],
@@ -7911,6 +7920,7 @@ const Tooltip = react.forwardRef(function Tooltip2(props, ref) {
7911
7920
  const boundaryElementContext = useBoundaryElement();
7912
7921
  const theme = useTheme();
7913
7922
  const {
7923
+ arrow: arrowProp = true,
7914
7924
  boundaryElement = boundaryElementContext == null ? void 0 : boundaryElementContext.element,
7915
7925
  children: childProp,
7916
7926
  content,
@@ -7945,19 +7955,21 @@ const Tooltip = react.forwardRef(function Tooltip2(props, ref) {
7945
7955
  rootBoundary
7946
7956
  }));
7947
7957
  ret.push(reactDom$1.offset({
7948
- mainAxis: 3
7958
+ mainAxis: DEFAULT_TOOLTIP_DISTANCE
7949
7959
  }));
7950
7960
  ret.push(reactDom$1.shift({
7951
7961
  boundary: boundaryElement || void 0,
7952
7962
  rootBoundary,
7953
7963
  padding: DEFAULT_TOOLTIP_PADDING
7954
7964
  }));
7955
- ret.push(reactDom$1.arrow({
7956
- element: arrowRef,
7957
- padding: 2
7958
- }));
7965
+ if (arrowProp) {
7966
+ ret.push(reactDom$1.arrow({
7967
+ element: arrowRef,
7968
+ padding: 2
7969
+ }));
7970
+ }
7959
7971
  return ret;
7960
- }, [boundaryElement, fallbackPlacements]);
7972
+ }, [arrowProp, boundaryElement, fallbackPlacements]);
7961
7973
  const {
7962
7974
  floatingStyles,
7963
7975
  placement,
@@ -8117,7 +8129,7 @@ const Tooltip = react.forwardRef(function Tooltip2(props, ref) {
8117
8129
  radius: 3,
8118
8130
  scheme,
8119
8131
  shadow,
8120
- children: [content, /* @__PURE__ */jsxRuntime.jsx(TooltipArrow, {
8132
+ children: [content, arrowProp && /* @__PURE__ */jsxRuntime.jsx(TooltipArrow, {
8121
8133
  ref: setArrow,
8122
8134
  style: arrowStyle
8123
8135
  })]
@@ -8262,7 +8274,7 @@ const InnerAutocomplete = react.forwardRef(function InnerAutocomplete2(props, re
8262
8274
  padding: paddingProp = 3,
8263
8275
  popover = EMPTY_RECORD,
8264
8276
  prefix,
8265
- radius = 3,
8277
+ radius = 2,
8266
8278
  readOnly,
8267
8279
  relatedElements,
8268
8280
  renderOption: renderOptionProp,
@@ -10087,6 +10099,7 @@ function Toast(props) {
10087
10099
  closable,
10088
10100
  description,
10089
10101
  onClose,
10102
+ radius = 3,
10090
10103
  title,
10091
10104
  status,
10092
10105
  ...restProps
@@ -10098,7 +10111,7 @@ function Toast(props) {
10098
10111
  role,
10099
10112
  ...restProps,
10100
10113
  marginTop: 3,
10101
- radius: 2,
10114
+ radius,
10102
10115
  shadow: 2,
10103
10116
  tone: cardTone,
10104
10117
  children: /* @__PURE__ */jsxRuntime.jsxs(Flex, {
@@ -10109,7 +10122,8 @@ function Toast(props) {
10109
10122
  children: /* @__PURE__ */jsxRuntime.jsxs(Stack, {
10110
10123
  space: 3,
10111
10124
  children: [title && /* @__PURE__ */jsxRuntime.jsx(Text, {
10112
- weight: "semibold",
10125
+ size: 1,
10126
+ weight: "medium",
10113
10127
  children: title
10114
10128
  }), description && /* @__PURE__ */jsxRuntime.jsx(Text, {
10115
10129
  muted: true,