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