@sanity/ui 2.8.8 → 2.8.10-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/dist/_chunks-cjs/getTheme_v2.js +7 -10
- package/dist/_chunks-cjs/getTheme_v2.js.map +1 -1
- package/dist/_chunks-es/getTheme_v2.mjs +7 -10
- package/dist/_chunks-es/getTheme_v2.mjs.map +1 -1
- package/dist/_legacy/getTheme_v2.esm.js +7 -10
- package/dist/_legacy/getTheme_v2.esm.js.map +1 -1
- package/dist/index.esm.js +98 -144
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +98 -144
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +98 -144
- package/dist/index.mjs.map +1 -1
- package/dist/theme.esm.js +218 -235
- package/dist/theme.esm.js.map +1 -1
- package/dist/theme.js +218 -235
- package/dist/theme.js.map +1 -1
- package/dist/theme.mjs +218 -235
- package/dist/theme.mjs.map +1 -1
- package/package.json +56 -64
- package/src/core/primitives/popover/popover.tsx +28 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sanity/ui",
|
|
3
|
-
"version": "2.8.
|
|
3
|
+
"version": "2.8.10-canary.0",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"sanity",
|
|
6
6
|
"ui",
|
|
@@ -51,32 +51,6 @@
|
|
|
51
51
|
"src",
|
|
52
52
|
"theme.js"
|
|
53
53
|
],
|
|
54
|
-
"scripts": {
|
|
55
|
-
"build": "run-s clean pkg:build pkg:check figma:pkg:build",
|
|
56
|
-
"clean": "rimraf .workshop dist",
|
|
57
|
-
"commit": "cz",
|
|
58
|
-
"cypress:dev": "run-p dev cypress:open",
|
|
59
|
-
"cypress:open": "cypress open",
|
|
60
|
-
"cypress:run": "cypress run",
|
|
61
|
-
"dev": "run-p storybook:dev workshop:dev",
|
|
62
|
-
"figma:pkg:build": "cd figma && pnpm build",
|
|
63
|
-
"format": "prettier --write --cache --ignore-unknown .",
|
|
64
|
-
"lint": "eslint . --ext .cjs,.js,.jsx,.mjs,.ts,.tsx",
|
|
65
|
-
"pkg:build": "pkg build --strict",
|
|
66
|
-
"pkg:check": "pkg --strict",
|
|
67
|
-
"prepare": "husky install",
|
|
68
|
-
"prepack": "pnpm build",
|
|
69
|
-
"release": "semantic-release",
|
|
70
|
-
"storybook:build": "storybook build",
|
|
71
|
-
"storybook:dev": "storybook dev -p 6006",
|
|
72
|
-
"test": "jest",
|
|
73
|
-
"test:browser": "start-server-and-test 'run-s workshop:build workshop:start' http://localhost:1337 'run-s cypress:run'",
|
|
74
|
-
"ts:check": "tsc",
|
|
75
|
-
"watch": "pkg watch --strict",
|
|
76
|
-
"workshop:build": "workshop build",
|
|
77
|
-
"workshop:dev": "workshop dev",
|
|
78
|
-
"workshop:start": "http-server -a localhost -c-0 -p 1337 -s -P http://localhost:1337/index.html? dist"
|
|
79
|
-
},
|
|
80
54
|
"commitlint": {
|
|
81
55
|
"extends": [
|
|
82
56
|
"@commitlint/config-conventional"
|
|
@@ -107,40 +81,40 @@
|
|
|
107
81
|
"dependencies": {
|
|
108
82
|
"@floating-ui/react-dom": "^2.1.1",
|
|
109
83
|
"@sanity/color": "^3.0.6",
|
|
110
|
-
"@sanity/icons": "^3.
|
|
84
|
+
"@sanity/icons": "^3.4.0",
|
|
111
85
|
"csstype": "^3.1.3",
|
|
112
86
|
"framer-motion": "11.0.8",
|
|
113
87
|
"react-refractor": "^2.2.0",
|
|
114
88
|
"use-effect-event": "^1.0.2"
|
|
115
89
|
},
|
|
116
90
|
"devDependencies": {
|
|
117
|
-
"@babel/core": "^7.
|
|
118
|
-
"@babel/preset-env": "^7.
|
|
91
|
+
"@babel/core": "^7.25.2",
|
|
92
|
+
"@babel/preset-env": "^7.25.4",
|
|
119
93
|
"@babel/preset-react": "^7.24.7",
|
|
120
94
|
"@babel/preset-typescript": "^7.24.7",
|
|
121
|
-
"@commitlint/cli": "^19.
|
|
95
|
+
"@commitlint/cli": "^19.4.0",
|
|
122
96
|
"@commitlint/config-conventional": "^19.2.2",
|
|
123
97
|
"@juggle/resize-observer": "^3.4.0",
|
|
124
|
-
"@sanity/pkg-utils": "^6.10.
|
|
98
|
+
"@sanity/pkg-utils": "^6.10.9",
|
|
125
99
|
"@sanity/prettier-config": "^1.0.2",
|
|
126
100
|
"@sanity/semantic-release-preset": "^5.0.0",
|
|
127
|
-
"@sanity/ui-workshop": "^2.0.
|
|
128
|
-
"@storybook/addon-a11y": "^8.2.
|
|
129
|
-
"@storybook/addon-docs": "^8.2.
|
|
130
|
-
"@storybook/addon-essentials": "^8.2.
|
|
131
|
-
"@storybook/addon-interactions": "^8.2.
|
|
132
|
-
"@storybook/addon-links": "^8.2.
|
|
133
|
-
"@storybook/addon-mdx-gfm": "^8.2.
|
|
134
|
-
"@storybook/addon-storysource": "^8.2.
|
|
135
|
-
"@storybook/addon-themes": "^8.2.
|
|
136
|
-
"@storybook/blocks": "^8.2.
|
|
137
|
-
"@storybook/manager-api": "^8.2.
|
|
138
|
-
"@storybook/react": "^8.2.
|
|
139
|
-
"@storybook/react-vite": "^8.2.
|
|
140
|
-
"@storybook/test": "^8.2.
|
|
141
|
-
"@storybook/theming": "^8.2.
|
|
142
|
-
"@testing-library/dom": "^10.
|
|
143
|
-
"@testing-library/jest-dom": "^6.4.
|
|
101
|
+
"@sanity/ui-workshop": "^2.0.16",
|
|
102
|
+
"@storybook/addon-a11y": "^8.2.9",
|
|
103
|
+
"@storybook/addon-docs": "^8.2.9",
|
|
104
|
+
"@storybook/addon-essentials": "^8.2.9",
|
|
105
|
+
"@storybook/addon-interactions": "^8.2.9",
|
|
106
|
+
"@storybook/addon-links": "^8.2.9",
|
|
107
|
+
"@storybook/addon-mdx-gfm": "^8.2.9",
|
|
108
|
+
"@storybook/addon-storysource": "^8.2.9",
|
|
109
|
+
"@storybook/addon-themes": "^8.2.9",
|
|
110
|
+
"@storybook/blocks": "^8.2.9",
|
|
111
|
+
"@storybook/manager-api": "^8.2.9",
|
|
112
|
+
"@storybook/react": "^8.2.9",
|
|
113
|
+
"@storybook/react-vite": "^8.2.9",
|
|
114
|
+
"@storybook/test": "^8.2.9",
|
|
115
|
+
"@storybook/theming": "^8.2.9",
|
|
116
|
+
"@testing-library/dom": "^10.4.0",
|
|
117
|
+
"@testing-library/jest-dom": "^6.4.8",
|
|
144
118
|
"@testing-library/react": "^16.0.0",
|
|
145
119
|
"@testing-library/user-event": "^14.5.2",
|
|
146
120
|
"@types/jest": "^29.5.12",
|
|
@@ -150,10 +124,10 @@
|
|
|
150
124
|
"@types/react-dom": "^18.3.0",
|
|
151
125
|
"@types/react-is": "^18.3.0",
|
|
152
126
|
"@types/refractor": "^3.4.1",
|
|
153
|
-
"@typescript-eslint/eslint-plugin": "^7.
|
|
154
|
-
"@typescript-eslint/parser": "^7.
|
|
127
|
+
"@typescript-eslint/eslint-plugin": "^7.18.0",
|
|
128
|
+
"@typescript-eslint/parser": "^7.18.0",
|
|
155
129
|
"commitizen": "^4.3.0",
|
|
156
|
-
"cypress": "^13.13.
|
|
130
|
+
"cypress": "^13.13.2",
|
|
157
131
|
"cypress-real-events": "^1.13.0",
|
|
158
132
|
"cz-conventional-changelog": "^3.3.0",
|
|
159
133
|
"eslint": "^8.57.0",
|
|
@@ -162,7 +136,7 @@
|
|
|
162
136
|
"eslint-plugin-import": "^2.29.1",
|
|
163
137
|
"eslint-plugin-jsx-a11y": "^6.9.0",
|
|
164
138
|
"eslint-plugin-prettier": "^5.2.1",
|
|
165
|
-
"eslint-plugin-react": "^7.
|
|
139
|
+
"eslint-plugin-react": "^7.35.0",
|
|
166
140
|
"eslint-plugin-react-compiler": "0.0.0-experimental-a97cca1-20240529",
|
|
167
141
|
"eslint-plugin-react-hooks": "^4.6.2",
|
|
168
142
|
"eslint-plugin-storybook": "^0.8.0",
|
|
@@ -181,13 +155,13 @@
|
|
|
181
155
|
"refractor": "^4.8.1",
|
|
182
156
|
"rimraf": "^5.0.5",
|
|
183
157
|
"semantic-release": "^24.0.0",
|
|
184
|
-
"start-server-and-test": "^2.0.
|
|
185
|
-
"storybook": "^8.2.
|
|
158
|
+
"start-server-and-test": "^2.0.5",
|
|
159
|
+
"storybook": "^8.2.9",
|
|
186
160
|
"styled-components": "^6.1.12",
|
|
187
161
|
"tsconfig-paths": "^4.2.0",
|
|
188
162
|
"typescript": "5.5.3",
|
|
189
|
-
"vite": "^5.
|
|
190
|
-
"vite-tsconfig-paths": "^
|
|
163
|
+
"vite": "^5.4.2",
|
|
164
|
+
"vite-tsconfig-paths": "^5.0.1"
|
|
191
165
|
},
|
|
192
166
|
"peerDependencies": {
|
|
193
167
|
"react": "^18",
|
|
@@ -195,19 +169,37 @@
|
|
|
195
169
|
"react-is": "^18",
|
|
196
170
|
"styled-components": "^5.2 || ^6"
|
|
197
171
|
},
|
|
198
|
-
"packageManager": "pnpm@9.5.0",
|
|
199
172
|
"engines": {
|
|
200
173
|
"node": ">=14.0.0"
|
|
201
174
|
},
|
|
202
175
|
"publishConfig": {
|
|
203
176
|
"access": "public"
|
|
204
177
|
},
|
|
205
|
-
"pnpm": {
|
|
206
|
-
"overrides": {
|
|
207
|
-
"conventional-changelog-conventionalcommits": ">= 8.0.0"
|
|
208
|
-
}
|
|
209
|
-
},
|
|
210
178
|
"esm.sh": {
|
|
211
179
|
"bundle": false
|
|
180
|
+
},
|
|
181
|
+
"scripts": {
|
|
182
|
+
"build": "run-s clean pkg:build pkg:check figma:pkg:build",
|
|
183
|
+
"clean": "rimraf .workshop dist",
|
|
184
|
+
"commit": "cz",
|
|
185
|
+
"cypress:dev": "run-p dev cypress:open",
|
|
186
|
+
"cypress:open": "cypress open",
|
|
187
|
+
"cypress:run": "cypress run",
|
|
188
|
+
"dev": "run-p storybook:dev workshop:dev",
|
|
189
|
+
"figma:pkg:build": "cd figma && pnpm build",
|
|
190
|
+
"format": "prettier --write --cache --ignore-unknown .",
|
|
191
|
+
"lint": "eslint . --ext .cjs,.js,.jsx,.mjs,.ts,.tsx",
|
|
192
|
+
"pkg:build": "pkg build --strict",
|
|
193
|
+
"pkg:check": "pkg --strict",
|
|
194
|
+
"release": "semantic-release",
|
|
195
|
+
"storybook:build": "storybook build",
|
|
196
|
+
"storybook:dev": "storybook dev -p 6006",
|
|
197
|
+
"test": "jest",
|
|
198
|
+
"test:browser": "start-server-and-test 'run-s workshop:build workshop:start' http://localhost:1337 'run-s cypress:run'",
|
|
199
|
+
"ts:check": "tsc",
|
|
200
|
+
"watch": "pkg watch --strict",
|
|
201
|
+
"workshop:build": "workshop build",
|
|
202
|
+
"workshop:dev": "workshop dev",
|
|
203
|
+
"workshop:start": "http-server -a localhost -c-0 -p 1337 -s -P http://localhost:1337/index.html? dist"
|
|
212
204
|
}
|
|
213
|
-
}
|
|
205
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
1
2
|
import {
|
|
2
3
|
Middleware,
|
|
3
4
|
RootBoundary,
|
|
@@ -359,8 +360,7 @@ export const Popover = memo(
|
|
|
359
360
|
(node: HTMLElement | null) => {
|
|
360
361
|
refs.setReference(node)
|
|
361
362
|
|
|
362
|
-
|
|
363
|
-
const childRef = (childProp as any)?.ref
|
|
363
|
+
const childRef = getElementRef(childProp as any)
|
|
364
364
|
|
|
365
365
|
if (typeof childRef === 'function') {
|
|
366
366
|
childRef(node)
|
|
@@ -455,3 +455,29 @@ export const Popover = memo(
|
|
|
455
455
|
}),
|
|
456
456
|
)
|
|
457
457
|
Popover.displayName = 'Memo(ForwardRef(Popover))'
|
|
458
|
+
|
|
459
|
+
// Before React 19 accessing `element.props.ref` will throw a warning and suggest using `element.ref`
|
|
460
|
+
// After React 19 accessing `element.ref` does the opposite.
|
|
461
|
+
// https://github.com/facebook/react/pull/28348
|
|
462
|
+
//
|
|
463
|
+
// Access the ref using the method that doesn't yield a warning.
|
|
464
|
+
function getElementRef(element: React.ReactElement) {
|
|
465
|
+
// React <=18 in DEV
|
|
466
|
+
let getter = Object.getOwnPropertyDescriptor(element.props, 'ref')?.get
|
|
467
|
+
let mayWarn = getter && 'isReactWarning' in getter && getter.isReactWarning
|
|
468
|
+
|
|
469
|
+
if (mayWarn) {
|
|
470
|
+
return (element as any).ref
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
// React 19 in DEV
|
|
474
|
+
getter = Object.getOwnPropertyDescriptor(element, 'ref')?.get
|
|
475
|
+
mayWarn = getter && 'isReactWarning' in getter && getter.isReactWarning
|
|
476
|
+
|
|
477
|
+
if (mayWarn) {
|
|
478
|
+
return element.props.ref
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
// Not DEV
|
|
482
|
+
return element.props.ref || (element as any).ref
|
|
483
|
+
}
|