@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sanity/ui",
3
- "version": "2.13.3",
3
+ "version": "2.13.5",
4
4
  "keywords": [
5
5
  "sanity",
6
6
  "ui",
@@ -120,7 +120,7 @@
120
120
  "@sanity/color": "^3.0.6",
121
121
  "@sanity/icons": "^3.6.0",
122
122
  "csstype": "^3.1.3",
123
- "framer-motion": "12.4.2",
123
+ "framer-motion": "^12.4.3",
124
124
  "react-compiler-runtime": "19.0.0-beta-21e868a-20250216",
125
125
  "react-refractor": "^2.2.0",
126
126
  "use-effect-event": "^1.0.2"
@@ -135,21 +135,21 @@
135
135
  "@sanity/pkg-utils": "^6.13.4",
136
136
  "@sanity/prettier-config": "^1.0.3",
137
137
  "@sanity/semantic-release-preset": "^5.0.0",
138
- "@sanity/ui-workshop": "^2.0.27",
139
- "@storybook/addon-a11y": "^8.5.5",
140
- "@storybook/addon-docs": "^8.5.5",
141
- "@storybook/addon-essentials": "^8.5.5",
142
- "@storybook/addon-interactions": "^8.5.5",
143
- "@storybook/addon-links": "^8.5.5",
144
- "@storybook/addon-mdx-gfm": "^8.5.5",
145
- "@storybook/addon-storysource": "^8.5.5",
146
- "@storybook/addon-themes": "^8.5.5",
147
- "@storybook/blocks": "^8.5.5",
148
- "@storybook/manager-api": "^8.5.5",
149
- "@storybook/react": "^8.5.5",
150
- "@storybook/react-vite": "^8.5.5",
151
- "@storybook/test": "^8.5.5",
152
- "@storybook/theming": "^8.5.5",
138
+ "@sanity/ui-workshop": "^2.0.29",
139
+ "@storybook/addon-a11y": "^8.5.6",
140
+ "@storybook/addon-docs": "^8.5.6",
141
+ "@storybook/addon-essentials": "^8.5.6",
142
+ "@storybook/addon-interactions": "^8.5.6",
143
+ "@storybook/addon-links": "^8.5.6",
144
+ "@storybook/addon-mdx-gfm": "^8.5.6",
145
+ "@storybook/addon-storysource": "^8.5.6",
146
+ "@storybook/addon-themes": "^8.5.6",
147
+ "@storybook/blocks": "^8.5.6",
148
+ "@storybook/manager-api": "^8.5.6",
149
+ "@storybook/react": "^8.5.6",
150
+ "@storybook/react-vite": "^8.5.6",
151
+ "@storybook/test": "^8.5.6",
152
+ "@storybook/theming": "^8.5.6",
153
153
  "@testing-library/dom": "^10.4.0",
154
154
  "@testing-library/jest-dom": "^6.6.3",
155
155
  "@testing-library/react": "^16.2.0",
@@ -157,8 +157,8 @@
157
157
  "@types/jest": "^29.5.14",
158
158
  "@types/jest-axe": "^3.5.9",
159
159
  "@types/node": "^20.12.7",
160
- "@types/react": "^19.0.8",
161
- "@types/react-dom": "^19.0.3",
160
+ "@types/react": "^19.0.10",
161
+ "@types/react-dom": "^19.0.4",
162
162
  "@types/react-is": "^19.0.0",
163
163
  "@types/refractor": "^3.4.1",
164
164
  "@typescript-eslint/eslint-plugin": "^7.18.0",
@@ -195,7 +195,7 @@
195
195
  "rimraf": "^5.0.5",
196
196
  "semantic-release": "^24.2.3",
197
197
  "start-server-and-test": "^2.0.10",
198
- "storybook": "^8.5.5",
198
+ "storybook": "^8.5.6",
199
199
  "styled-components": "^6.1.15",
200
200
  "tsconfig-paths": "^4.2.0",
201
201
  "typescript": "5.7.3",
@@ -51,6 +51,9 @@ export function rootStyles(
51
51
  animation-name: ${loadingAnimation};
52
52
  animation-duration: ${props.$duration}ms;
53
53
  animation-fill-mode: both;
54
+ animation-timing-function: linear;
55
+ opacity: var(${POPOVER_MOTION_CONTENT_OPACITY_PROPERTY}, 1);
56
+ will-change: width;
54
57
  }
55
58
 
56
59
  & > * {
@@ -57,26 +57,31 @@ export function ToastProvider(props: ToastProviderProps): React.JSX.Element {
57
57
  const prefersReducedMotion = usePrefersReducedMotion()
58
58
  const variants = useMemo<Variants>(
59
59
  () => ({
60
+ /**
61
+ * These variants makes use of special timing, by using a negative opacity as a starting position,
62
+ * as well as double opacity as the end position.
63
+ * The purpose of this is to make the tooltip/popover container appear before the content, and when exiting
64
+ * we want the content to disappear faster than the container.
65
+ */
60
66
  initial: {
61
67
  opacity: 0,
62
- [POPOVER_MOTION_CONTENT_OPACITY_PROPERTY]: 0,
68
+ [POPOVER_MOTION_CONTENT_OPACITY_PROPERTY]: -1,
63
69
  y: 32,
64
70
  scale: 0.25,
65
71
  willChange: 'transform',
66
72
  },
67
73
  animate: {
68
- opacity: [0, 1, 1],
69
- [POPOVER_MOTION_CONTENT_OPACITY_PROPERTY]: [0, 0, 1],
74
+ opacity: 2,
75
+ [POPOVER_MOTION_CONTENT_OPACITY_PROPERTY]: 1,
70
76
  y: 0,
71
77
  scale: 1,
72
78
  },
73
- // @ts-expect-error fix later
74
79
  exit: {
75
- opacity: [1, 1, 0],
76
- [POPOVER_MOTION_CONTENT_OPACITY_PROPERTY]: [1, 0, 0],
80
+ opacity: 0,
81
+ [POPOVER_MOTION_CONTENT_OPACITY_PROPERTY]: -1,
77
82
  scale: 0.5,
78
- transition: {duration: prefersReducedMotion ? 0 : 0.2},
79
83
  },
84
+ transition: {duration: prefersReducedMotion ? 0 : 0.2},
80
85
  }),
81
86
  [prefersReducedMotion],
82
87
  )
@@ -25,24 +25,33 @@ export const POPOVER_MOTION_PROPS: {
25
25
  exit: Variant
26
26
  transition: Transition
27
27
  } = {
28
+ /**
29
+ * These variants makes use of special timing, by using a negative opacity as a starting position,
30
+ * as well as double opacity as the end position.
31
+ * The purpose of this is to make the tooltip/popover container appear before the content, and when exiting
32
+ * we want the content to disappear faster than the container.
33
+ */
28
34
  initial: {
29
35
  opacity: 0.5,
30
- [POPOVER_MOTION_CONTENT_OPACITY_PROPERTY as string]: 0,
36
+ // the nagative opacity here, as well as the double opacity further down, are to make the content appear after the backgdrop, and when exiting the content should disappear first.
37
+ [POPOVER_MOTION_CONTENT_OPACITY_PROPERTY as string]: -1,
31
38
  scale: 0.97,
32
39
  willChange: 'transform',
33
40
  },
34
41
  animate: {
35
- opacity: [null, 1, 1],
36
- [POPOVER_MOTION_CONTENT_OPACITY_PROPERTY as string]: [null, null, 1],
42
+ opacity: 2,
43
+ [POPOVER_MOTION_CONTENT_OPACITY_PROPERTY as string]: 1,
37
44
  scale: 1,
38
45
  },
39
46
  exit: {
40
- // @ts-expect-error -- passing null a second time is valid: https://github.com/framer/motion/blob/b9ce4c42914c3916ea523609c5b032dfc72718bb/packages/framer-motion/src/animation/utils/keyframes.ts#L34C22-L34C22
41
- opacity: [null, null, 0],
42
- [POPOVER_MOTION_CONTENT_OPACITY_PROPERTY as string]: [null, 0, 0],
47
+ opacity: 0,
48
+ [POPOVER_MOTION_CONTENT_OPACITY_PROPERTY as string]: -1,
43
49
  scale: 0.97,
44
50
  },
45
- transition: {duration: 0.4, type: 'spring'},
51
+ transition: {
52
+ duration: 0.4,
53
+ type: 'spring',
54
+ },
46
55
  }
47
56
 
48
57
  /**