@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/_chunks-cjs/_visual-editing.js +12 -6
- package/dist/_chunks-cjs/_visual-editing.js.map +1 -1
- package/dist/_chunks-es/_visual-editing.mjs +12 -6
- package/dist/_chunks-es/_visual-editing.mjs.map +1 -1
- package/dist/_legacy/_visual-editing.esm.js +12 -6
- package/dist/_legacy/_visual-editing.esm.js.map +1 -1
- package/dist/index.esm.js +36 -37
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +36 -37
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +36 -37
- package/dist/index.mjs.map +1 -1
- package/package.json +20 -20
- package/src/core/components/toast/styles.ts +3 -0
- package/src/core/components/toast/toastProvider.tsx +12 -7
- package/src/core/constants.ts +16 -7
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(
|
|
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]:
|
|
1056
|
+
[POPOVER_MOTION_CONTENT_OPACITY_PROPERTY]: -1,
|
|
1054
1057
|
y: 32,
|
|
1055
1058
|
scale: 0.25,
|
|
1056
1059
|
willChange: "transform"
|
|
1057
|
-
}, t5 =
|
|
1058
|
-
|
|
1059
|
-
|
|
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
|
-
},
|
|
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
|
-
$[
|
|
1067
|
-
const t9 = prefersReducedMotion ? 0 : 0.2;
|
|
1068
|
-
let t10;
|
|
1069
|
-
$[7] !== t9 ? (t10 = {
|
|
1072
|
+
$[5] !== t7 ? (t8 = {
|
|
1070
1073
|
initial: t4,
|
|
1071
|
-
animate:
|
|
1072
|
-
exit:
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
scale: 0.5,
|
|
1076
|
-
transition: {
|
|
1077
|
-
duration: t9
|
|
1078
|
-
}
|
|
1074
|
+
animate: t5,
|
|
1075
|
+
exit: t6,
|
|
1076
|
+
transition: {
|
|
1077
|
+
duration: t7
|
|
1079
1078
|
}
|
|
1080
|
-
}, $[
|
|
1079
|
+
}, $[5] = t7, $[6] = t8) : t8 = $[6], t3 = t8;
|
|
1081
1080
|
const variants = t3;
|
|
1082
|
-
let
|
|
1083
|
-
$[
|
|
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
|
-
}, $[
|
|
1109
|
-
const value =
|
|
1110
|
-
let
|
|
1111
|
-
$[
|
|
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
|
-
},
|
|
1118
|
-
let
|
|
1119
|
-
$[
|
|
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
|
-
} =
|
|
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
|
-
}) }) }) }) }), $[
|
|
1133
|
-
let
|
|
1134
|
-
return $[
|
|
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
|
-
|
|
1137
|
-
] }), $[
|
|
1135
|
+
t13
|
|
1136
|
+
] }), $[19] = children, $[20] = t13, $[21] = t14) : t14 = $[21], t14;
|
|
1138
1137
|
}
|
|
1139
1138
|
ToastProvider.displayName = "ToastProvider";
|
|
1140
1139
|
function useToast() {
|