@sanity/ui 2.13.3 → 2.13.4

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