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