@sanity/ui 2.15.13 → 2.15.15-canary.0

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.15.13",
3
+ "version": "2.15.15-canary.0",
4
4
  "keywords": [
5
5
  "sanity",
6
6
  "ui",
@@ -60,32 +60,6 @@
60
60
  "exports",
61
61
  "src"
62
62
  ],
63
- "scripts": {
64
- "build": "run-s clean pkg:build pkg:check figma:pkg:build",
65
- "clean": "rimraf .workshop dist",
66
- "commit": "cz",
67
- "cypress:dev": "run-p dev cypress:open",
68
- "cypress:open": "cypress open",
69
- "cypress:run": "cypress run",
70
- "dev": "run-p storybook:dev workshop:dev",
71
- "figma:pkg:build": "cd figma && pnpm build",
72
- "format": "prettier --write --cache --ignore-unknown .",
73
- "lint": "eslint .",
74
- "pkg:build": "pkg build --strict",
75
- "pkg:check": "pkg --strict",
76
- "prepare": "husky install",
77
- "prepack": "pnpm build",
78
- "release": "semantic-release",
79
- "storybook:build": "storybook build",
80
- "storybook:dev": "storybook dev -p 6006",
81
- "test": "jest",
82
- "test:browser": "start-server-and-test 'run-s workshop:build workshop:start' http://localhost:1337 'run-s cypress:run'",
83
- "ts:check": "tsc",
84
- "watch": "pkg watch --strict",
85
- "workshop:build": "workshop build",
86
- "workshop:dev": "workshop dev",
87
- "workshop:start": "http-server -a localhost -c-0 -p 1337 -s -P http://localhost:1337/index.html? dist"
88
- },
89
63
  "commitlint": {
90
64
  "extends": [
91
65
  "@commitlint/config-conventional"
@@ -119,8 +93,8 @@
119
93
  "@sanity/color": "^3.0.6",
120
94
  "@sanity/icons": "^3.7.0",
121
95
  "csstype": "^3.1.3",
122
- "framer-motion": "^12.6.3",
123
- "react-compiler-runtime": "19.0.0-beta-e993439-20250405",
96
+ "framer-motion": "^12.9.2",
97
+ "react-compiler-runtime": "19.1.0-rc.1",
124
98
  "react-refractor": "^2.2.0",
125
99
  "use-effect-event": "^1.0.2"
126
100
  },
@@ -131,53 +105,52 @@
131
105
  "@babel/preset-typescript": "^7.27.0",
132
106
  "@commitlint/cli": "^19.8.0",
133
107
  "@commitlint/config-conventional": "^19.8.0",
134
- "@eslint/js": "^9.23.0",
108
+ "@eslint/js": "^9.25.1",
135
109
  "@sanity/pkg-utils": "^7.2.2",
136
110
  "@sanity/prettier-config": "^1.0.3",
137
111
  "@sanity/semantic-release-preset": "^5.0.0",
138
- "@sanity/ui-workshop": "^2.0.34",
139
- "@storybook/addon-a11y": "^8.6.11",
140
- "@storybook/addon-docs": "^8.6.11",
141
- "@storybook/addon-essentials": "^8.6.11",
142
- "@storybook/addon-interactions": "^8.6.11",
143
- "@storybook/addon-links": "^8.6.11",
144
- "@storybook/addon-mdx-gfm": "^8.6.11",
145
- "@storybook/addon-storysource": "^8.6.11",
146
- "@storybook/addon-themes": "^8.6.11",
147
- "@storybook/blocks": "^8.6.11",
148
- "@storybook/manager-api": "^8.6.11",
149
- "@storybook/react": "^8.6.11",
150
- "@storybook/react-vite": "^8.6.11",
151
- "@storybook/test": "^8.6.11",
152
- "@storybook/theming": "^8.6.11",
112
+ "@sanity/ui-workshop": "^2.1.1",
113
+ "@storybook/addon-a11y": "^8.6.12",
114
+ "@storybook/addon-docs": "^8.6.12",
115
+ "@storybook/addon-essentials": "^8.6.12",
116
+ "@storybook/addon-interactions": "^8.6.12",
117
+ "@storybook/addon-links": "^8.6.12",
118
+ "@storybook/addon-mdx-gfm": "^8.6.12",
119
+ "@storybook/addon-storysource": "^8.6.12",
120
+ "@storybook/addon-themes": "^8.6.12",
121
+ "@storybook/blocks": "^8.6.12",
122
+ "@storybook/manager-api": "^8.6.12",
123
+ "@storybook/react": "^8.6.12",
124
+ "@storybook/react-vite": "^8.6.12",
125
+ "@storybook/test": "^8.6.12",
126
+ "@storybook/theming": "^8.6.12",
153
127
  "@testing-library/dom": "^10.4.0",
154
128
  "@testing-library/jest-dom": "^6.6.3",
155
- "@testing-library/react": "^16.2.0",
129
+ "@testing-library/react": "^16.3.0",
156
130
  "@testing-library/user-event": "^14.6.1",
157
131
  "@types/jest": "^29.5.14",
158
132
  "@types/jest-axe": "^3.5.9",
159
133
  "@types/node": "^20.12.7",
160
- "@types/react": "^19.0.12",
161
- "@types/react-dom": "^19.0.4",
134
+ "@types/react": "^19.1.2",
135
+ "@types/react-dom": "^19.1.3",
162
136
  "@types/react-is": "^19.0.0",
163
137
  "@types/refractor": "^3.4.1",
164
- "@vitejs/plugin-react": "^4.3.4",
165
- "babel-plugin-react-compiler": "19.0.0-beta-e993439-20250405",
138
+ "@vitejs/plugin-react": "^4.4.1",
139
+ "babel-plugin-react-compiler": "19.1.0-rc.1",
166
140
  "babel-plugin-styled-components": "^2.1.4",
167
141
  "commitizen": "^4.3.1",
168
142
  "cypress": "^13.17.0",
169
143
  "cypress-real-events": "^1.14.0",
170
144
  "cz-conventional-changelog": "^3.3.0",
171
- "eslint": "^9.23.0",
172
- "eslint-config-prettier": "^10.1.1",
145
+ "eslint": "^9.25.1",
146
+ "eslint-config-prettier": "^10.1.2",
173
147
  "eslint-formatter-compact": "^8.40.0",
174
148
  "eslint-plugin-boundaries": "^5.0.1",
175
149
  "eslint-plugin-import": "^2.31.0",
176
150
  "eslint-plugin-jsx-a11y": "^6.10.2",
177
- "eslint-plugin-react": "^7.37.4",
178
- "eslint-plugin-react-compiler": "19.0.0-beta-e993439-20250405",
179
- "eslint-plugin-react-hooks": "experimental",
180
- "eslint-plugin-react-refresh": "^0.4.19",
151
+ "eslint-plugin-react": "^7.37.5",
152
+ "eslint-plugin-react-hooks": "0.0.0-experimental-0038c501-20250429",
153
+ "eslint-plugin-react-refresh": "^0.4.20",
181
154
  "eslint-plugin-simple-import-sort": "^12.1.1",
182
155
  "eslint-plugin-storybook": "^0.12.0",
183
156
  "globals": "^16.0.0",
@@ -197,12 +170,12 @@
197
170
  "rimraf": "^5.0.5",
198
171
  "semantic-release": "^24.2.3",
199
172
  "start-server-and-test": "^2.0.11",
200
- "storybook": "^8.6.11",
201
- "styled-components": "^6.1.16",
173
+ "storybook": "^8.6.12",
174
+ "styled-components": "^6.1.17",
202
175
  "tsconfig-paths": "^4.2.0",
203
- "typescript": "5.8.2",
204
- "typescript-eslint": "^8.29.0",
205
- "vite": "^5.4.16",
176
+ "typescript": "5.8.3",
177
+ "typescript-eslint": "^8.31.1",
178
+ "vite": "^5.4.19",
206
179
  "vite-tsconfig-paths": "^5.1.4"
207
180
  },
208
181
  "peerDependencies": {
@@ -211,25 +184,37 @@
211
184
  "react-is": "^18 || >=19.0.0-0",
212
185
  "styled-components": "^5.2 || ^6"
213
186
  },
214
- "packageManager": "pnpm@9.15.9",
215
187
  "engines": {
216
188
  "node": ">=14.0.0"
217
189
  },
218
190
  "publishConfig": {
219
191
  "access": "public"
220
192
  },
221
- "pnpm": {
222
- "overrides": {
223
- "@types/react": "$@types/react",
224
- "@types/react-dom": "$@types/react-dom",
225
- "@types/react-is": "$@types/react-is",
226
- "conventional-changelog-conventionalcommits": ">= 8.0.0",
227
- "react": "$react",
228
- "react-dom": "$react-dom",
229
- "react-is": "$react-is"
230
- }
231
- },
232
193
  "esm.sh": {
233
194
  "bundle": false
195
+ },
196
+ "scripts": {
197
+ "build": "run-s clean pkg:build pkg:check figma:pkg:build",
198
+ "clean": "rimraf .workshop dist",
199
+ "commit": "cz",
200
+ "cypress:dev": "run-p dev cypress:open",
201
+ "cypress:open": "cypress open",
202
+ "cypress:run": "cypress run",
203
+ "dev": "run-p storybook:dev workshop:dev",
204
+ "figma:pkg:build": "cd figma && pnpm build",
205
+ "format": "prettier --write --cache --ignore-unknown .",
206
+ "lint": "eslint .",
207
+ "pkg:build": "pkg build --strict",
208
+ "pkg:check": "pkg --strict",
209
+ "release": "semantic-release",
210
+ "storybook:build": "storybook build",
211
+ "storybook:dev": "storybook dev -p 6006",
212
+ "test": "jest",
213
+ "test:browser": "start-server-and-test 'run-s workshop:build workshop:start' http://localhost:1337 'run-s cypress:run'",
214
+ "ts:check": "tsc",
215
+ "watch": "pkg watch --strict",
216
+ "workshop:build": "workshop build",
217
+ "workshop:dev": "workshop dev",
218
+ "workshop:start": "http-server -a localhost -c-0 -p 1337 -s -P http://localhost:1337/index.html? dist"
234
219
  }
235
- }
220
+ }
@@ -1,4 +1,4 @@
1
- import {useDebugValue, useMemo, useSyncExternalStore} from 'react'
1
+ import {useCallback, useDebugValue, useSyncExternalStore} from 'react'
2
2
 
3
3
  /**
4
4
  * Efficiently subscribes to `window.matchMedia` queries
@@ -11,36 +11,18 @@ export function useMatchMedia(
11
11
  mediaQueryString: `(${string})`,
12
12
  getServerSnapshot?: () => boolean,
13
13
  ): boolean {
14
- const {subscribe, getSnapshot} = useMemo(() => {
15
- /**
16
- * `subscribe` and `getSnapshot` are only called on the client and both need access to the same `matchMedia` instance
17
- * we don't want to eagerly instantiate it to ensure it's only created when actually used
18
- */
19
- let MEDIA_QUERY_CACHE: MediaQueryList | undefined
20
-
21
- const getMatchMedia = (): MediaQueryList => {
22
- if (!MEDIA_QUERY_CACHE) {
23
- // As this function is only called during `subscribe` and `getSnapshot`, we can assume that the
24
- // the `window` global is available and we're in a browser environment
25
- MEDIA_QUERY_CACHE = window.matchMedia(mediaQueryString)
26
- }
27
-
28
- return MEDIA_QUERY_CACHE
29
- }
30
-
31
- return {
32
- subscribe: (onStoreChange: () => void): (() => void) => {
33
- const matchMedia = getMatchMedia()
34
-
35
- matchMedia.addEventListener('change', onStoreChange)
36
-
37
- return () => matchMedia.removeEventListener('change', onStoreChange)
38
- },
39
- getSnapshot: () => getMatchMedia().matches,
40
- }
41
- }, [mediaQueryString])
42
-
43
14
  useDebugValue(mediaQueryString)
44
15
 
45
- return useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot)
16
+ return useSyncExternalStore(
17
+ useCallback(
18
+ (onStoreChange) => {
19
+ const media = window.matchMedia(mediaQueryString)
20
+ media.addEventListener('change', onStoreChange)
21
+ return () => media.removeEventListener('change', onStoreChange)
22
+ },
23
+ [mediaQueryString],
24
+ ),
25
+ () => window.matchMedia(mediaQueryString).matches,
26
+ getServerSnapshot,
27
+ )
46
28
  }