@sanity/ui 2.15.7 → 2.15.8

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
@@ -1003,7 +1003,7 @@ const LOADING_BAR_HEIGHT = 2, STATUS_CARD_TONE = {
1003
1003
  info: "alert"
1004
1004
  }, LONG_ENOUGH_BUT_NOT_TOO_LONG = 1e3 * 60 * 60 * 24 * 24;
1005
1005
  function Toast(props) {
1006
- const $ = c(52);
1006
+ const $ = c(50);
1007
1007
  let closable, description, duration, onClose, restProps, status, t0, title, updatedAt;
1008
1008
  $[0] !== props ? ({
1009
1009
  closable,
@@ -1025,39 +1025,36 @@ function Toast(props) {
1025
1025
  } : {
1026
1026
  duration: 0
1027
1027
  }, $[10] = visualDuration, $[11] = t1) : t1 = $[11];
1028
- const transition = t1;
1028
+ const transition = t1, hasDuration = duration && isFinite(duration) && duration < LONG_ENOUGH_BUT_NOT_TOO_LONG;
1029
1029
  let t2;
1030
- $[12] !== duration ? (t2 = duration && isFinite(duration) && duration < LONG_ENOUGH_BUT_NOT_TOO_LONG, $[12] = duration, $[13] = t2) : t2 = $[13];
1031
- const hasDuration = t2;
1030
+ $[12] === Symbol.for("react.memo_cache_sentinel") ? (t2 = ["hidden", "initial"], $[12] = t2) : t2 = $[12];
1031
+ const initial = t2;
1032
1032
  let t3;
1033
- $[14] === Symbol.for("react.memo_cache_sentinel") ? (t3 = ["hidden", "initial"], $[14] = t3) : t3 = $[14];
1034
- const initial = t3;
1033
+ $[13] === Symbol.for("react.memo_cache_sentinel") ? (t3 = ["visible", "slideIn"], $[13] = t3) : t3 = $[13];
1034
+ const animate = t3;
1035
1035
  let t4;
1036
- $[15] === Symbol.for("react.memo_cache_sentinel") ? (t4 = ["visible", "slideIn"], $[15] = t4) : t4 = $[15];
1037
- const animate = t4;
1038
- let t5;
1039
- $[16] === Symbol.for("react.memo_cache_sentinel") ? (t5 = ["hidden", "slideOut"], $[16] = t5) : t5 = $[16];
1040
- const exit = t5, t6 = hasDuration ? "" : void 0;
1036
+ $[14] === Symbol.for("react.memo_cache_sentinel") ? (t4 = ["hidden", "slideOut"], $[14] = t4) : t4 = $[14];
1037
+ const exit = t4, t5 = hasDuration ? "" : void 0;
1038
+ let t6;
1039
+ $[15] !== title ? (t6 = title && /* @__PURE__ */ jsx(Text, { size: 1, weight: "medium", children: title }), $[15] = title, $[16] = t6) : t6 = $[16];
1041
1040
  let t7;
1042
- $[17] !== title ? (t7 = title && /* @__PURE__ */ jsx(Text, { size: 1, weight: "medium", children: title }), $[17] = title, $[18] = t7) : t7 = $[18];
1041
+ $[17] !== description || $[18] !== transition ? (t7 = description && /* @__PURE__ */ jsx(MotionText, { muted: !0, size: 1, variants: content, transition, children: description }), $[17] = description, $[18] = transition, $[19] = t7) : t7 = $[19];
1043
1042
  let t8;
1044
- $[19] !== description || $[20] !== transition ? (t8 = description && /* @__PURE__ */ jsx(MotionText, { muted: !0, size: 1, variants: content, transition, children: description }), $[19] = description, $[20] = transition, $[21] = t8) : t8 = $[21];
1043
+ $[20] !== t6 || $[21] !== t7 ? (t8 = /* @__PURE__ */ jsx(TextBox, { flex: 1, padding: 3, children: /* @__PURE__ */ jsxs(Stack, { space: 3, children: [
1044
+ t6,
1045
+ t7
1046
+ ] }) }), $[20] = t6, $[21] = t7, $[22] = t8) : t8 = $[22];
1045
1047
  let t9;
1046
- $[22] !== t7 || $[23] !== t8 ? (t9 = /* @__PURE__ */ jsx(TextBox, { flex: 1, padding: 3, children: /* @__PURE__ */ jsxs(Stack, { space: 3, children: [
1047
- t7,
1048
- t8
1049
- ] }) }), $[22] = t7, $[23] = t8, $[24] = t9) : t9 = $[24];
1050
- let t10;
1051
- $[25] !== buttonTone || $[26] !== closable || $[27] !== onClose ? (t10 = closable && /* @__PURE__ */ jsx(Box, { padding: 1, children: /* @__PURE__ */ jsx(Button, { as: "button", icon: CloseIcon, mode: "bleed", padding: 2, tone: buttonTone, onClick: onClose, style: {
1048
+ $[23] !== buttonTone || $[24] !== closable || $[25] !== onClose ? (t9 = closable && /* @__PURE__ */ jsx(Box, { padding: 1, children: /* @__PURE__ */ jsx(Button, { as: "button", icon: CloseIcon, mode: "bleed", padding: 2, tone: buttonTone, onClick: onClose, style: {
1052
1049
  verticalAlign: "top"
1053
- } }) }), $[25] = buttonTone, $[26] = closable, $[27] = onClose, $[28] = t10) : t10 = $[28];
1050
+ } }) }), $[23] = buttonTone, $[24] = closable, $[25] = onClose, $[26] = t9) : t9 = $[26];
1051
+ let t10;
1052
+ $[27] !== t8 || $[28] !== t9 || $[29] !== transition ? (t10 = /* @__PURE__ */ jsxs(MotionFlex, { align: "flex-start", variants: content, transition, children: [
1053
+ t8,
1054
+ t9
1055
+ ] }), $[27] = t8, $[28] = t9, $[29] = transition, $[30] = t10) : t10 = $[30];
1054
1056
  let t11;
1055
- $[29] !== t10 || $[30] !== t9 || $[31] !== transition ? (t11 = /* @__PURE__ */ jsxs(MotionFlex, { align: "flex-start", variants: content, transition, children: [
1056
- t9,
1057
- t10
1058
- ] }), $[29] = t10, $[30] = t9, $[31] = transition, $[32] = t11) : t11 = $[32];
1059
- let t12;
1060
- $[33] !== cardTone || $[34] !== duration || $[35] !== hasDuration || $[36] !== onClose || $[37] !== radius || $[38] !== transition || $[39] !== updatedAt || $[40] !== visualDuration ? (t12 = hasDuration && /* @__PURE__ */ jsxs(MotionLoadingBar, { variants: content, transition, children: [
1057
+ $[31] !== cardTone || $[32] !== duration || $[33] !== hasDuration || $[34] !== onClose || $[35] !== radius || $[36] !== transition || $[37] !== updatedAt || $[38] !== visualDuration ? (t11 = hasDuration && /* @__PURE__ */ jsxs(MotionLoadingBar, { variants: content, transition, children: [
1061
1058
  /* @__PURE__ */ jsx(LoadingBarMask, { tone: cardTone, radius }),
1062
1059
  /* @__PURE__ */ jsx(MotionLoadingBarProgress, { tone: cardTone, initial: {
1063
1060
  scaleX: 0
@@ -1068,12 +1065,12 @@ function Toast(props) {
1068
1065
  duration: duration / 1e3,
1069
1066
  ease: "linear"
1070
1067
  }, onAnimationComplete: onClose }, `progress-${updatedAt}`)
1071
- ] }), $[33] = cardTone, $[34] = duration, $[35] = hasDuration, $[36] = onClose, $[37] = radius, $[38] = transition, $[39] = updatedAt, $[40] = visualDuration, $[41] = t12) : t12 = $[41];
1072
- let t13;
1073
- return $[42] !== cardTone || $[43] !== radius || $[44] !== restProps || $[45] !== role || $[46] !== t11 || $[47] !== t12 || $[48] !== t6 || $[49] !== transition || $[50] !== visualDuration ? (t13 = /* @__PURE__ */ jsxs(MotionToast, { "data-ui": "Toast", role, ...restProps, "data-has-duration": t6, custom: visualDuration, radius, shadow: 2, tone: cardTone, forwardedAs: "li", layout: "position", variants: container, initial, animate, exit, transition, children: [
1074
- t11,
1075
- t12
1076
- ] }), $[42] = cardTone, $[43] = radius, $[44] = restProps, $[45] = role, $[46] = t11, $[47] = t12, $[48] = t6, $[49] = transition, $[50] = visualDuration, $[51] = t13) : t13 = $[51], t13;
1068
+ ] }), $[31] = cardTone, $[32] = duration, $[33] = hasDuration, $[34] = onClose, $[35] = radius, $[36] = transition, $[37] = updatedAt, $[38] = visualDuration, $[39] = t11) : t11 = $[39];
1069
+ let t12;
1070
+ return $[40] !== cardTone || $[41] !== radius || $[42] !== restProps || $[43] !== role || $[44] !== t10 || $[45] !== t11 || $[46] !== t5 || $[47] !== transition || $[48] !== visualDuration ? (t12 = /* @__PURE__ */ jsxs(MotionToast, { "data-ui": "Toast", role, ...restProps, "data-has-duration": t5, custom: visualDuration, radius, shadow: 2, tone: cardTone, forwardedAs: "li", layout: "position", variants: container, initial, animate, exit, transition, children: [
1071
+ t10,
1072
+ t11
1073
+ ] }), $[40] = cardTone, $[41] = radius, $[42] = restProps, $[43] = role, $[44] = t10, $[45] = t11, $[46] = t5, $[47] = transition, $[48] = visualDuration, $[49] = t12) : t12 = $[49], t12;
1077
1074
  }
1078
1075
  Toast.displayName = "Toast";
1079
1076
  const container = {