@sanity/ui 1.7.10 → 1.7.11

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
@@ -6890,28 +6890,11 @@ const Tooltip = react.forwardRef(function Tooltip2(props, ref) {
6890
6890
  boundary: boundaryElement || void 0,
6891
6891
  fallbackPlacements,
6892
6892
  padding: 4,
6893
- rootBoundary,
6894
- mainAxis: false
6893
+ rootBoundary
6895
6894
  }));
6896
6895
  ret.push(reactDom$1.offset({
6897
6896
  mainAxis: 3
6898
6897
  }));
6899
- ret.push(reactDom$1.size({
6900
- apply(_ref22) {
6901
- let {
6902
- availableWidth,
6903
- availableHeight,
6904
- elements
6905
- } = _ref22;
6906
- Object.assign(elements.floating.style, {
6907
- maxWidth: "".concat(availableWidth - 4 * 2, "px"),
6908
- // the padding is `4px`
6909
- maxHeight: "".concat(availableHeight - 4 * 2, "px")
6910
- // the padding is `4px`
6911
- });
6912
- }
6913
- }));
6914
-
6915
6898
  ret.push(reactDom$1.shift({
6916
6899
  boundary: boundaryElement || void 0,
6917
6900
  rootBoundary,
@@ -6924,16 +6907,23 @@ const Tooltip = react.forwardRef(function Tooltip2(props, ref) {
6924
6907
  return ret;
6925
6908
  }, [boundaryElement, fallbackPlacements]);
6926
6909
  const {
6927
- floatingStyles,
6910
+ x,
6911
+ y,
6928
6912
  placement,
6929
6913
  middlewareData,
6930
6914
  refs,
6931
- update
6915
+ update,
6916
+ strategy
6932
6917
  } = reactDom$1.useFloating({
6933
6918
  middleware,
6934
6919
  placement: placementProp,
6935
6920
  whileElementsMounted: reactDom$1.autoUpdate
6936
6921
  });
6922
+ const rootStyle = react.useMemo(() => ({
6923
+ position: strategy,
6924
+ top: y != null ? y : 0,
6925
+ left: x != null ? x : 0
6926
+ }), [strategy, x, y]);
6937
6927
  const staticSide = placement && FLOATING_STATIC_SIDES[placement.split("-")[0]];
6938
6928
  const arrowX = (_b = middlewareData.arrow) == null ? void 0 : _b.x;
6939
6929
  const arrowY = (_c = middlewareData.arrow) == null ? void 0 : _c.y;
@@ -7007,7 +6997,7 @@ const Tooltip = react.forwardRef(function Tooltip2(props, ref) {
7007
6997
  "data-ui": "Tooltip",
7008
6998
  ...restProps,
7009
6999
  ref: setFloating,
7010
- style: floatingStyles,
7000
+ style: rootStyle,
7011
7001
  zOffset,
7012
7002
  children: /* @__PURE__ */jsxRuntime.jsxs(Card, {
7013
7003
  "data-ui": "Tooltip__card",
@@ -7185,10 +7175,10 @@ const InnerAutocomplete = react.forwardRef(function InnerAutocomplete2(props, re
7185
7175
  query,
7186
7176
  value
7187
7177
  } = state;
7188
- const defaultRenderOption = react.useCallback(_ref23 => {
7178
+ const defaultRenderOption = react.useCallback(_ref22 => {
7189
7179
  let {
7190
7180
  value: value2
7191
- } = _ref23;
7181
+ } = _ref22;
7192
7182
  return /* @__PURE__ */jsxRuntime.jsx(Card, {
7193
7183
  "data-as": "button",
7194
7184
  padding: paddingProp,
@@ -7641,10 +7631,10 @@ const Breadcrumbs = react.forwardRef(function Breadcrumbs2(props, ref) {
7641
7631
  }, itemIndex))
7642
7632
  });
7643
7633
  });
7644
- function dialogStyle(_ref24) {
7634
+ function dialogStyle(_ref23) {
7645
7635
  let {
7646
7636
  theme
7647
- } = _ref24;
7637
+ } = _ref23;
7648
7638
  const color = theme.sanity.color.base;
7649
7639
  return {
7650
7640
  "&:not([hidden])": {
@@ -8706,15 +8696,15 @@ var __template$6 = (cooked, raw) => __freeze$6(__defProp$6(cooked, "raw", {
8706
8696
  var _a$6, _b$3, _c$1, _d;
8707
8697
  const keyframe = styled.keyframes(_a$6 || (_a$6 = __template$6(["\n 0% {\n background-position: 100%;\n }\n 100% {\n background-position: -100%;\n }\n"])));
8708
8698
  const animation = styled.css(_b$3 || (_b$3 = __template$6(["\n background-image: linear-gradient(\n to right,\n var(--card-skeleton-color-from),\n var(--card-skeleton-color-to),\n var(--card-skeleton-color-from),\n var(--card-skeleton-color-from),\n var(--card-skeleton-color-from)\n );\n background-position: 100%;\n background-size: 200% 100%;\n background-attachment: fixed;\n animation-name: ", ";\n animation-timing-function: ease-in-out;\n animation-iteration-count: infinite;\n animation-duration: 2000ms;\n"])), keyframe);
8709
- const skeletonStyle = styled.css(_d || (_d = __template$6(["\n opacity: ", ";\n transition: opacity 200ms ease-in;\n\n @media screen and (prefers-reduced-motion: no-preference) {\n ", "\n }\n\n @media screen and (prefers-reduced-motion: reduce) {\n background-color: var(--card-skeleton-color-from);\n }\n"])), _ref25 => {
8699
+ const skeletonStyle = styled.css(_d || (_d = __template$6(["\n opacity: ", ";\n transition: opacity 200ms ease-in;\n\n @media screen and (prefers-reduced-motion: no-preference) {\n ", "\n }\n\n @media screen and (prefers-reduced-motion: reduce) {\n background-color: var(--card-skeleton-color-from);\n }\n"])), _ref24 => {
8710
8700
  let {
8711
8701
  $visible
8712
- } = _ref25;
8702
+ } = _ref24;
8713
8703
  return $visible ? 1 : 0;
8714
- }, _ref26 => {
8704
+ }, _ref25 => {
8715
8705
  let {
8716
8706
  $animated
8717
- } = _ref26;
8707
+ } = _ref25;
8718
8708
  return $animated ? animation : styled.css(_c$1 || (_c$1 = __template$6(["\n background-color: var(--card-skeleton-color-from);\n "])));
8719
8709
  });
8720
8710
  const Root$4 = styled__default.default(Box)(responsiveRadiusStyle, skeletonStyle);
@@ -8745,12 +8735,12 @@ const Skeleton = react.forwardRef(function Skeleton2(props, ref) {
8745
8735
  ref
8746
8736
  });
8747
8737
  });
8748
- const Root$3 = styled__default.default(Skeleton)(_ref27 => {
8738
+ const Root$3 = styled__default.default(Skeleton)(_ref26 => {
8749
8739
  let {
8750
8740
  $size,
8751
8741
  $style,
8752
8742
  theme
8753
- } = _ref27;
8743
+ } = _ref26;
8754
8744
  const {
8755
8745
  media
8756
8746
  } = theme.sanity;
@@ -9097,12 +9087,12 @@ function ToastProvider(props) {
9097
9087
  paddingY,
9098
9088
  children: /* @__PURE__ */jsxRuntime.jsx(framerMotion.AnimatePresence, {
9099
9089
  initial: false,
9100
- children: state.map(_ref28 => {
9090
+ children: state.map(_ref27 => {
9101
9091
  let {
9102
9092
  dismiss,
9103
9093
  id,
9104
9094
  params
9105
- } = _ref28;
9095
+ } = _ref27;
9106
9096
  return /* @__PURE__ */jsxRuntime.jsx(framerMotion.motion.div, {
9107
9097
  animate: {
9108
9098
  opacity: 1,