@sanity/ui 3.1.1-canary.1 → 3.1.2

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": "3.1.1-canary.1",
3
+ "version": "3.1.2",
4
4
  "keywords": [
5
5
  "sanity",
6
6
  "ui",
@@ -60,6 +60,32 @@
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
+ "prepack": "pnpm build",
75
+ "pkg:build": "pkg build --strict",
76
+ "pkg:check": "pkg --strict",
77
+ "prepare": "husky install",
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
+ },
63
89
  "commitlint": {
64
90
  "extends": [
65
91
  "@commitlint/config-conventional"
@@ -93,19 +119,19 @@
93
119
  "@sanity/color": "^3.0.6",
94
120
  "@sanity/icons": "^3.7.4",
95
121
  "csstype": "^3.1.3",
96
- "framer-motion": "^12.23.12",
122
+ "framer-motion": "^12.23.15",
97
123
  "react-compiler-runtime": "19.1.0-rc.3",
98
124
  "react-refractor": "^4.0.0",
99
125
  "use-effect-event": "^2.0.3"
100
126
  },
101
127
  "devDependencies": {
102
- "@babel/core": "^7.28.3",
128
+ "@babel/core": "^7.28.4",
103
129
  "@babel/preset-env": "^7.28.3",
104
130
  "@babel/preset-react": "^7.27.1",
105
131
  "@babel/preset-typescript": "^7.27.1",
106
132
  "@commitlint/cli": "^19.8.1",
107
133
  "@commitlint/config-conventional": "^19.8.1",
108
- "@eslint/js": "^9.34.0",
134
+ "@eslint/js": "^9.35.0",
109
135
  "@sanity/pkg-utils": "^8.1.12",
110
136
  "@sanity/prettier-config": "^2.0.1",
111
137
  "@sanity/semantic-release-preset": "^5.0.0",
@@ -131,17 +157,17 @@
131
157
  "@types/jest": "^30.0.0",
132
158
  "@types/jest-axe": "^3.5.9",
133
159
  "@types/node": "^22.18.1",
134
- "@types/react": "^19.1.11",
135
- "@types/react-dom": "^19.1.8",
160
+ "@types/react": "^19.1.13",
161
+ "@types/react-dom": "^19.1.9",
136
162
  "@types/react-is": "^19.0.0",
137
- "@vitejs/plugin-react": "^5.0.1",
163
+ "@vitejs/plugin-react": "^5.0.3",
138
164
  "babel-plugin-react-compiler": "19.1.0-rc.3",
139
165
  "babel-plugin-styled-components": "^2.1.4",
140
166
  "commitizen": "^4.3.1",
141
167
  "cypress": "^13.17.0",
142
168
  "cypress-real-events": "^1.14.0",
143
169
  "cz-conventional-changelog": "^3.3.0",
144
- "eslint": "^9.34.0",
170
+ "eslint": "^9.35.0",
145
171
  "eslint-config-prettier": "^10.1.8",
146
172
  "eslint-formatter-gha": "^1.6.0",
147
173
  "eslint-plugin-boundaries": "^5.0.1",
@@ -149,16 +175,16 @@
149
175
  "eslint-plugin-jsx-a11y": "^6.10.2",
150
176
  "eslint-plugin-react": "^7.37.5",
151
177
  "eslint-plugin-react-hooks": "6.0.0-rc.2",
152
- "eslint-plugin-react-hooks-with-use-effect-event": "npm:eslint-plugin-react-hooks@0.0.0-experimental-edac0dde-20250723",
178
+ "eslint-plugin-react-hooks-with-use-effect-event": "npm:eslint-plugin-react-hooks@0.0.0-experimental-84af9085-20250917",
153
179
  "eslint-plugin-react-refresh": "^0.4.20",
154
180
  "eslint-plugin-simple-import-sort": "^12.1.1",
155
181
  "eslint-plugin-storybook": "^0.12.0",
156
182
  "globals": "^16.3.0",
157
183
  "http-server": "^14.1.1",
158
184
  "husky": "^8.0.3",
159
- "jest": "^30.0.5",
185
+ "jest": "^30.1.3",
160
186
  "jest-axe": "^10.0.0",
161
- "jest-environment-jsdom": "^30.0.5",
187
+ "jest-environment-jsdom": "^30.1.2",
162
188
  "lint-staged": "^14.0.1",
163
189
  "module-alias": "^2.2.3",
164
190
  "npm-run-all2": "^8.0.4",
@@ -171,11 +197,11 @@
171
197
  "semantic-release": "^24.2.7",
172
198
  "start-server-and-test": "^2.1.0",
173
199
  "storybook": "^8.6.14",
174
- "styled-components": "npm:@sanity/styled-components@^6.1.22",
200
+ "styled-components": "npm:@sanity/styled-components@^6.1.23",
175
201
  "tsconfig-paths": "^4.2.0",
176
202
  "typescript": "5.9.2",
177
- "typescript-eslint": "^8.41.0",
178
- "vite": "^7.1.3",
203
+ "typescript-eslint": "^8.44.0",
204
+ "vite": "^7.1.6",
179
205
  "vite-tsconfig-paths": "^5.1.4"
180
206
  },
181
207
  "peerDependencies": {
@@ -184,37 +210,25 @@
184
210
  "react-is": "^18 || >=19.0.0-0",
185
211
  "styled-components": "^5.2 || ^6"
186
212
  },
213
+ "packageManager": "pnpm@9.15.9",
187
214
  "engines": {
188
215
  "node": ">=20.19 <22 || >=22.12"
189
216
  },
190
217
  "publishConfig": {
191
218
  "access": "public"
192
219
  },
220
+ "pnpm": {
221
+ "overrides": {
222
+ "@types/react": "$@types/react",
223
+ "@types/react-dom": "$@types/react-dom",
224
+ "@types/react-is": "$@types/react-is",
225
+ "conventional-changelog-conventionalcommits": ">= 8.0.0",
226
+ "react": "$react",
227
+ "react-dom": "$react-dom",
228
+ "react-is": "$react-is"
229
+ }
230
+ },
193
231
  "esm.sh": {
194
232
  "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"
219
233
  }
220
- }
234
+ }
@@ -10,7 +10,6 @@ import {
10
10
  MouseEvent,
11
11
  ReactNode,
12
12
  Ref,
13
- startTransition,
14
13
  useCallback,
15
14
  useEffect,
16
15
  useImperativeHandle,
@@ -192,16 +191,7 @@ const InnerAutocomplete = forwardRef(function InnerAutocomplete<
192
191
  const inputElementRef = useRef<HTMLInputElement | null>(null)
193
192
  const listBoxElementRef = useRef<HTMLDivElement | null>(null)
194
193
  // Element refs that need to be accessed during render
195
- const [inputElement, _setInputElement] = useState<HTMLInputElement | null>(null)
196
- /**
197
- * The startTransition wrapper here is to avoid an issue when on React 18 where this error can happen:
198
- * >Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.
199
- * This doesn't happen on React 19 due to automatic batching of all state updates, the startTransition wrapper here gives a type of batching for 18 users in a way that still works with 19.
200
- * NOTE: The startTransition wrapper is not needed in UI v4, since the baseline there is React 19.
201
- */
202
- const setInputElement = useCallback((node: HTMLInputElement | null) => {
203
- startTransition(() => _setInputElement(node))
204
- }, [])
194
+ const [inputElement, setInputElement] = useState<HTMLInputElement | null>(null)
205
195
 
206
196
  // Value refs
207
197
  const listFocusedRef = useRef(false)
@@ -1,6 +1,6 @@
1
1
  import {ToggleArrowRightIcon} from '@sanity/icons'
2
2
  import {ThemeFontWeightKey} from '@sanity/ui/theme'
3
- import {startTransition, useCallback, useEffect, useId, useMemo, useRef, useState} from 'react'
3
+ import {useCallback, useEffect, useId, useMemo, useRef, useState} from 'react'
4
4
  import {styled} from 'styled-components'
5
5
 
6
6
  import {Box, BoxProps, Flex, Text} from '../../primitives'
@@ -65,17 +65,7 @@ export function TreeItem(
65
65
  weight,
66
66
  ...restProps
67
67
  } = props
68
- const [rootElement, _setRootElement] = useState<HTMLLIElement | null>(null)
69
- /**
70
- * The startTransition wrapper here is to avoid an issue when on React 18 where this error can happen:
71
- * >Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.
72
- * This doesn't happen on React 19 due to automatic batching of all state updates, the startTransition wrapper here gives a type of batching for 18 users in a way that still works with 19.
73
- * NOTE: The startTransition wrapper is not needed in UI v4, since the baseline there is React 19.
74
- */
75
- const setRootElement = useCallback((node: HTMLLIElement | null) => {
76
- startTransition(() => _setRootElement(node))
77
- }, [])
78
-
68
+ const [rootElement, setRootElement] = useState<HTMLLIElement | null>(null)
79
69
  const treeitemRef = useRef<HTMLDivElement | null>(null)
80
70
  const tree = useTree()
81
71
  const {path, registerItem, setExpanded, setFocusedElement} = tree