@sanity/ui 2.0.0 → 2.0.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/dist/index.d.ts +4 -0
- package/dist/index.esm.js +2 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/core/primitives/popover/popover.tsx +6 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sanity/ui",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.2",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"source": "./exports/index.ts",
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
"@sanity/color": "^3.0.0",
|
|
76
76
|
"@sanity/icons": "^2.7.0",
|
|
77
77
|
"csstype": "^3.1.2",
|
|
78
|
-
"framer-motion": "^
|
|
78
|
+
"framer-motion": "^11.0.3",
|
|
79
79
|
"react-refractor": "^2.1.7"
|
|
80
80
|
},
|
|
81
81
|
"devDependencies": {
|
|
@@ -98,6 +98,10 @@ export interface PopoverProps
|
|
|
98
98
|
portal?: boolean | string
|
|
99
99
|
preventOverflow?: boolean
|
|
100
100
|
referenceBoundary?: HTMLElement | null
|
|
101
|
+
/**
|
|
102
|
+
* When defined, the popover will be positioned relative to this element.
|
|
103
|
+
* The children of the popover won't be rendered.
|
|
104
|
+
*/
|
|
101
105
|
referenceElement?: HTMLElement | null
|
|
102
106
|
scheme?: ThemeColorSchemeKey
|
|
103
107
|
tone?: CardTone
|
|
@@ -376,8 +380,9 @@ export const Popover = memo(
|
|
|
376
380
|
}, [update, updateRef])
|
|
377
381
|
|
|
378
382
|
useEffect(() => {
|
|
383
|
+
if (child) return
|
|
379
384
|
refs.setReference(referenceElement || null)
|
|
380
|
-
}, [referenceElement, refs])
|
|
385
|
+
}, [referenceElement, refs, child])
|
|
381
386
|
|
|
382
387
|
if (disabled) {
|
|
383
388
|
return childProp || <></>
|