@sanity/ui 2.13.3 → 2.13.5

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
@@ -935,6 +935,9 @@ function rootStyles(props) {
935
935
  animation-name: ${loadingAnimation};
936
936
  animation-duration: ${props.$duration}ms;
937
937
  animation-fill-mode: both;
938
+ animation-timing-function: linear;
939
+ opacity: var(${_visualEditing.POPOVER_MOTION_CONTENT_OPACITY_PROPERTY}, 1);
940
+ will-change: width;
938
941
  }
939
942
 
940
943
  & > * {
@@ -1027,7 +1030,7 @@ const StyledToastProvider = styledComponents.styled(_visualEditing.Layer).withCo
1027
1030
  componentId: "sc-17mn6j-1"
1028
1031
  })`box-sizing:border-box;position:absolute;right:0;bottom:0;max-width:420px;width:100%;`;
1029
1032
  function ToastProvider(props) {
1030
- const $ = reactCompilerRuntime.c(24), {
1033
+ const $ = reactCompilerRuntime.c(22), {
1031
1034
  children,
1032
1035
  padding: t0,
1033
1036
  paddingX,
@@ -1040,40 +1043,36 @@ function ToastProvider(props) {
1040
1043
  let t2;
1041
1044
  $[1] === Symbol.for("react.memo_cache_sentinel") ? (t2 = {}, $[1] = t2) : t2 = $[1];
1042
1045
  const toastsRef = react.useRef(t2), mounted = useMounted(), prefersReducedMotion = _visualEditing.usePrefersReducedMotion();
1043
- let t3, t4, t5;
1046
+ let t3, t4, t5, t6;
1044
1047
  $[2] === Symbol.for("react.memo_cache_sentinel") ? (t4 = {
1045
1048
  opacity: 0,
1046
- [_visualEditing.POPOVER_MOTION_CONTENT_OPACITY_PROPERTY]: 0,
1049
+ [_visualEditing.POPOVER_MOTION_CONTENT_OPACITY_PROPERTY]: -1,
1047
1050
  y: 32,
1048
1051
  scale: 0.25,
1049
1052
  willChange: "transform"
1050
- }, t5 = [0, 1, 1], $[2] = t4, $[3] = t5) : (t4 = $[2], t5 = $[3]);
1051
- let t6, t7;
1052
- $[4] === Symbol.for("react.memo_cache_sentinel") ? (t6 = {
1053
- opacity: t5,
1054
- [_visualEditing.POPOVER_MOTION_CONTENT_OPACITY_PROPERTY]: [0, 0, 1],
1053
+ }, t5 = {
1054
+ opacity: 2,
1055
+ [_visualEditing.POPOVER_MOTION_CONTENT_OPACITY_PROPERTY]: 1,
1055
1056
  y: 0,
1056
1057
  scale: 1
1057
- }, t7 = [1, 1, 0], $[4] = t6, $[5] = t7) : (t6 = $[4], t7 = $[5]);
1058
+ }, t6 = {
1059
+ opacity: 0,
1060
+ [_visualEditing.POPOVER_MOTION_CONTENT_OPACITY_PROPERTY]: -1,
1061
+ scale: 0.5
1062
+ }, $[2] = t4, $[3] = t5, $[4] = t6) : (t4 = $[2], t5 = $[3], t6 = $[4]);
1063
+ const t7 = prefersReducedMotion ? 0 : 0.2;
1058
1064
  let t8;
1059
- $[6] === Symbol.for("react.memo_cache_sentinel") ? (t8 = [1, 0, 0], $[6] = t8) : t8 = $[6];
1060
- const t9 = prefersReducedMotion ? 0 : 0.2;
1061
- let t10;
1062
- $[7] !== t9 ? (t10 = {
1065
+ $[5] !== t7 ? (t8 = {
1063
1066
  initial: t4,
1064
- animate: t6,
1065
- exit: {
1066
- opacity: t7,
1067
- [_visualEditing.POPOVER_MOTION_CONTENT_OPACITY_PROPERTY]: t8,
1068
- scale: 0.5,
1069
- transition: {
1070
- duration: t9
1071
- }
1067
+ animate: t5,
1068
+ exit: t6,
1069
+ transition: {
1070
+ duration: t7
1072
1071
  }
1073
- }, $[7] = t9, $[8] = t10) : t10 = $[8], t3 = t10;
1072
+ }, $[5] = t7, $[6] = t8) : t8 = $[6], t3 = t8;
1074
1073
  const variants = t3;
1075
- let t11, t12;
1076
- $[9] === Symbol.for("react.memo_cache_sentinel") ? (t12 = {
1074
+ let t9, t10;
1075
+ $[7] === Symbol.for("react.memo_cache_sentinel") ? (t10 = {
1077
1076
  version: 0,
1078
1077
  push: (params) => {
1079
1078
  const setState = (state_0) => react.startTransition(() => _setState(state_0)), id = params.id || generateToastId(), duration = params.duration || 5e3, dismiss = () => {
@@ -1098,23 +1097,23 @@ function ToastProvider(props) {
1098
1097
  timeoutId: setTimeout(dismiss, duration)
1099
1098
  }, id;
1100
1099
  }
1101
- }, $[9] = t12) : t12 = $[9], t11 = t12;
1102
- const value = t11;
1103
- let t13, t14;
1104
- $[10] === Symbol.for("react.memo_cache_sentinel") ? (t13 = () => () => {
1100
+ }, $[7] = t10) : t10 = $[7], t9 = t10;
1101
+ const value = t9;
1102
+ let t11, t12;
1103
+ $[8] === Symbol.for("react.memo_cache_sentinel") ? (t11 = () => () => {
1105
1104
  for (const {
1106
1105
  timeoutId: timeoutId_0
1107
1106
  } of Object.values(toastsRef.current))
1108
1107
  clearTimeout(timeoutId_0);
1109
1108
  toastsRef.current = {};
1110
- }, t14 = [], $[10] = t13, $[11] = t14) : (t13 = $[10], t14 = $[11]), react.useEffect(t13, t14);
1111
- let t15;
1112
- $[12] !== mounted || $[13] !== padding || $[14] !== paddingX || $[15] !== paddingY || $[16] !== prefersReducedMotion || $[17] !== state || $[18] !== variants || $[19] !== zOffset ? (t15 = mounted && /* @__PURE__ */ jsxRuntime.jsx(StyledToastProvider, { "data-ui": "ToastProvider", zOffset, children: /* @__PURE__ */ jsxRuntime.jsx(ToastContainer, { children: /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { padding, paddingX, paddingY, children: /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { initial: !1, children: state.map((t162) => {
1109
+ }, t12 = [], $[8] = t11, $[9] = t12) : (t11 = $[8], t12 = $[9]), react.useEffect(t11, t12);
1110
+ let t13;
1111
+ $[10] !== mounted || $[11] !== padding || $[12] !== paddingX || $[13] !== paddingY || $[14] !== prefersReducedMotion || $[15] !== state || $[16] !== variants || $[17] !== zOffset ? (t13 = mounted && /* @__PURE__ */ jsxRuntime.jsx(StyledToastProvider, { "data-ui": "ToastProvider", zOffset, children: /* @__PURE__ */ jsxRuntime.jsx(ToastContainer, { children: /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { padding, paddingX, paddingY, children: /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { initial: !1, children: state.map((t142) => {
1113
1112
  const {
1114
1113
  dismiss: dismiss_0,
1115
1114
  id: id_0,
1116
1115
  params: params_0
1117
- } = t162;
1116
+ } = t142;
1118
1117
  return /* @__PURE__ */ jsxRuntime.jsx(framerMotion.motion.div, { layout: "position", initial: "initial", animate: "animate", exit: "exit", variants, transition: prefersReducedMotion ? {
1119
1118
  duration: 0
1120
1119
  } : {
@@ -1122,12 +1121,12 @@ function ToastProvider(props) {
1122
1121
  damping: 30,
1123
1122
  stiffness: 400
1124
1123
  }, children: /* @__PURE__ */ jsxRuntime.jsx(Toast, { closable: params_0.closable, description: params_0.description, onClose: dismiss_0, status: params_0.status, title: params_0.title, duration: params_0.duration }) }, id_0);
1125
- }) }) }) }) }), $[12] = mounted, $[13] = padding, $[14] = paddingX, $[15] = paddingY, $[16] = prefersReducedMotion, $[17] = state, $[18] = variants, $[19] = zOffset, $[20] = t15) : t15 = $[20];
1126
- let t16;
1127
- return $[21] !== children || $[22] !== t15 ? (t16 = /* @__PURE__ */ jsxRuntime.jsxs(ToastContext.Provider, { value, children: [
1124
+ }) }) }) }) }), $[10] = mounted, $[11] = padding, $[12] = paddingX, $[13] = paddingY, $[14] = prefersReducedMotion, $[15] = state, $[16] = variants, $[17] = zOffset, $[18] = t13) : t13 = $[18];
1125
+ let t14;
1126
+ return $[19] !== children || $[20] !== t13 ? (t14 = /* @__PURE__ */ jsxRuntime.jsxs(ToastContext.Provider, { value, children: [
1128
1127
  children,
1129
- t15
1130
- ] }), $[21] = children, $[22] = t15, $[23] = t16) : t16 = $[23], t16;
1128
+ t13
1129
+ ] }), $[19] = children, $[20] = t13, $[21] = t14) : t14 = $[21], t14;
1131
1130
  }
1132
1131
  ToastProvider.displayName = "ToastProvider";
1133
1132
  function useToast() {