@sanity/ui 2.8.12 → 2.8.13-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 +84 -28
- package/dist/_chunks-cjs/getTheme_v2.js.map +1 -1
- package/dist/_chunks-es/getTheme_v2.mjs +84 -28
- package/dist/_chunks-es/getTheme_v2.mjs.map +1 -1
- package/dist/_legacy/getTheme_v2.esm.js +84 -28
- package/dist/_legacy/getTheme_v2.esm.js.map +1 -1
- package/dist/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.esm.js +2965 -2964
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +2966 -2966
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2965 -2964
- package/dist/index.mjs.map +1 -1
- package/dist/theme.esm.js +1197 -448
- package/dist/theme.esm.js.map +1 -1
- package/dist/theme.js +1197 -448
- package/dist/theme.js.map +1 -1
- package/dist/theme.mjs +1197 -448
- package/dist/theme.mjs.map +1 -1
- package/package.json +30 -34
- package/src/core/primitives/popover/popover.tsx +10 -24
- package/src/core/primitives/tooltip/tooltip.tsx +12 -25
- package/src/core/utils/conditionalWrapper/conditionalWrapper.tsx +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sanity/ui",
|
|
3
|
-
"version": "2.8.
|
|
3
|
+
"version": "2.8.13-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"
|
|
@@ -110,6 +84,7 @@
|
|
|
110
84
|
"@sanity/icons": "^3.4.0",
|
|
111
85
|
"csstype": "^3.1.3",
|
|
112
86
|
"framer-motion": "11.0.8",
|
|
87
|
+
"react-compiler-runtime": "19.0.0-beta-6fc168f-20241025",
|
|
113
88
|
"react-refractor": "^2.2.0",
|
|
114
89
|
"use-effect-event": "^1.0.2"
|
|
115
90
|
},
|
|
@@ -152,6 +127,8 @@
|
|
|
152
127
|
"@types/refractor": "^3.4.1",
|
|
153
128
|
"@typescript-eslint/eslint-plugin": "^7.18.0",
|
|
154
129
|
"@typescript-eslint/parser": "^7.18.0",
|
|
130
|
+
"@vitejs/plugin-react": "^4.3.3",
|
|
131
|
+
"babel-plugin-react-compiler": "beta",
|
|
155
132
|
"commitizen": "^4.3.0",
|
|
156
133
|
"cypress": "^13.13.2",
|
|
157
134
|
"cypress-real-events": "^1.13.0",
|
|
@@ -176,6 +153,7 @@
|
|
|
176
153
|
"npm-run-all2": "^5.0.2",
|
|
177
154
|
"prettier": "^3.3.3",
|
|
178
155
|
"react": "^18.3.1",
|
|
156
|
+
"react-compiler-runtime": "beta",
|
|
179
157
|
"react-dom": "^18.3.1",
|
|
180
158
|
"react-is": "^18.3.1",
|
|
181
159
|
"refractor": "^4.8.1",
|
|
@@ -195,19 +173,37 @@
|
|
|
195
173
|
"react-is": "^18",
|
|
196
174
|
"styled-components": "^5.2 || ^6"
|
|
197
175
|
},
|
|
198
|
-
"packageManager": "pnpm@9.12.3",
|
|
199
176
|
"engines": {
|
|
200
177
|
"node": ">=14.0.0"
|
|
201
178
|
},
|
|
202
179
|
"publishConfig": {
|
|
203
180
|
"access": "public"
|
|
204
181
|
},
|
|
205
|
-
"pnpm": {
|
|
206
|
-
"overrides": {
|
|
207
|
-
"conventional-changelog-conventionalcommits": ">= 8.0.0"
|
|
208
|
-
}
|
|
209
|
-
},
|
|
210
182
|
"esm.sh": {
|
|
211
183
|
"bundle": false
|
|
184
|
+
},
|
|
185
|
+
"scripts": {
|
|
186
|
+
"build": "run-s clean pkg:build pkg:check figma:pkg:build",
|
|
187
|
+
"clean": "rimraf .workshop dist",
|
|
188
|
+
"commit": "cz",
|
|
189
|
+
"cypress:dev": "run-p dev cypress:open",
|
|
190
|
+
"cypress:open": "cypress open",
|
|
191
|
+
"cypress:run": "cypress run",
|
|
192
|
+
"dev": "run-p storybook:dev workshop:dev",
|
|
193
|
+
"figma:pkg:build": "cd figma && pnpm build",
|
|
194
|
+
"format": "prettier --write --cache --ignore-unknown .",
|
|
195
|
+
"lint": "eslint . --ext .cjs,.js,.jsx,.mjs,.ts,.tsx",
|
|
196
|
+
"pkg:build": "pkg build --strict",
|
|
197
|
+
"pkg:check": "pkg --strict",
|
|
198
|
+
"release": "semantic-release",
|
|
199
|
+
"storybook:build": "storybook build",
|
|
200
|
+
"storybook:dev": "storybook dev -p 6006",
|
|
201
|
+
"test": "jest",
|
|
202
|
+
"test:browser": "start-server-and-test 'run-s workshop:build workshop:start' http://localhost:1337 'run-s cypress:run'",
|
|
203
|
+
"ts:check": "tsc",
|
|
204
|
+
"watch": "pkg watch --strict",
|
|
205
|
+
"workshop:build": "workshop build",
|
|
206
|
+
"workshop:dev": "workshop dev",
|
|
207
|
+
"workshop:start": "http-server -a localhost -c-0 -p 1337 -s -P http://localhost:1337/index.html? dist"
|
|
212
208
|
}
|
|
213
|
-
}
|
|
209
|
+
}
|
|
@@ -28,13 +28,7 @@ import {useArrayProp, useElementSize, useMediaIndex, usePrefersReducedMotion} fr
|
|
|
28
28
|
import {origin} from '../../middleware/origin'
|
|
29
29
|
import {useTheme_v2} from '../../theme'
|
|
30
30
|
import {BoxOverflow, CardTone, Placement, PopoverMargins} from '../../types'
|
|
31
|
-
import {
|
|
32
|
-
ConditionalWrapper,
|
|
33
|
-
LayerProps,
|
|
34
|
-
LayerProvider,
|
|
35
|
-
Portal,
|
|
36
|
-
useBoundaryElement,
|
|
37
|
-
} from '../../utils'
|
|
31
|
+
import {LayerProps, LayerProvider, Portal, useBoundaryElement} from '../../utils'
|
|
38
32
|
import {ResponsiveRadiusProps, ResponsiveShadowProps} from '../types'
|
|
39
33
|
import {
|
|
40
34
|
DEFAULT_POPOVER_DISTANCE,
|
|
@@ -427,26 +421,18 @@ export const Popover = memo(
|
|
|
427
421
|
</LayerProvider>
|
|
428
422
|
)
|
|
429
423
|
|
|
424
|
+
const children =
|
|
425
|
+
open &&
|
|
426
|
+
(portal ? (
|
|
427
|
+
<Portal __unstable_name={typeof portal === 'string' ? portal : undefined}>{popover}</Portal>
|
|
428
|
+
) : (
|
|
429
|
+
popover
|
|
430
|
+
))
|
|
431
|
+
|
|
430
432
|
return (
|
|
431
433
|
<>
|
|
432
434
|
{/* the popover */}
|
|
433
|
-
<
|
|
434
|
-
condition={animate}
|
|
435
|
-
wrapper={(children) => <AnimatePresence>{children}</AnimatePresence>}
|
|
436
|
-
>
|
|
437
|
-
{open && (
|
|
438
|
-
<ConditionalWrapper
|
|
439
|
-
condition={!!portal}
|
|
440
|
-
wrapper={(children) => (
|
|
441
|
-
<Portal __unstable_name={typeof portal === 'string' ? portal : undefined}>
|
|
442
|
-
{children}
|
|
443
|
-
</Portal>
|
|
444
|
-
)}
|
|
445
|
-
>
|
|
446
|
-
{popover}
|
|
447
|
-
</ConditionalWrapper>
|
|
448
|
-
)}
|
|
449
|
-
</ConditionalWrapper>
|
|
435
|
+
{animate ? <AnimatePresence>{children}</AnimatePresence> : children}
|
|
450
436
|
|
|
451
437
|
{/* the referred element */}
|
|
452
438
|
{child}
|
|
@@ -30,14 +30,7 @@ import {useDelayedState} from '../../hooks/useDelayedState'
|
|
|
30
30
|
import {origin} from '../../middleware/origin'
|
|
31
31
|
import {useTheme_v2} from '../../theme'
|
|
32
32
|
import type {Placement} from '../../types'
|
|
33
|
-
import {
|
|
34
|
-
ConditionalWrapper,
|
|
35
|
-
Layer,
|
|
36
|
-
type LayerProps,
|
|
37
|
-
Portal,
|
|
38
|
-
useBoundaryElement,
|
|
39
|
-
usePortal,
|
|
40
|
-
} from '../../utils'
|
|
33
|
+
import {Layer, type LayerProps, Portal, useBoundaryElement, usePortal} from '../../utils'
|
|
41
34
|
import type {Delay} from '../types'
|
|
42
35
|
import {
|
|
43
36
|
DEFAULT_FALLBACK_PLACEMENTS,
|
|
@@ -403,26 +396,20 @@ export const Tooltip = forwardRef(function Tooltip(
|
|
|
403
396
|
</Root>
|
|
404
397
|
)
|
|
405
398
|
|
|
399
|
+
const children =
|
|
400
|
+
showTooltip &&
|
|
401
|
+
(portalProp ? (
|
|
402
|
+
<Portal __unstable_name={typeof portalProp === 'string' ? portalProp : undefined}>
|
|
403
|
+
{tooltip}
|
|
404
|
+
</Portal>
|
|
405
|
+
) : (
|
|
406
|
+
tooltip
|
|
407
|
+
))
|
|
408
|
+
|
|
406
409
|
return (
|
|
407
410
|
<>
|
|
408
411
|
{/* the tooltip */}
|
|
409
|
-
<
|
|
410
|
-
condition={animate}
|
|
411
|
-
wrapper={(children) => <AnimatePresence>{children}</AnimatePresence>}
|
|
412
|
-
>
|
|
413
|
-
{showTooltip && (
|
|
414
|
-
<ConditionalWrapper
|
|
415
|
-
condition={!!portalProp}
|
|
416
|
-
wrapper={(children) => (
|
|
417
|
-
<Portal __unstable_name={typeof portalProp === 'string' ? portalProp : undefined}>
|
|
418
|
-
{children}
|
|
419
|
-
</Portal>
|
|
420
|
-
)}
|
|
421
|
-
>
|
|
422
|
-
{tooltip}
|
|
423
|
-
</ConditionalWrapper>
|
|
424
|
-
)}
|
|
425
|
-
</ConditionalWrapper>
|
|
412
|
+
{animate ? <AnimatePresence>{children}</AnimatePresence> : children}
|
|
426
413
|
|
|
427
414
|
{/* the referred element */}
|
|
428
415
|
{child}
|