@sanity/ui 1.5.0 → 1.7.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/index.d.ts +24 -9
- package/dist/index.esm.js +185 -120
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +184 -119
- package/dist/index.js.map +1 -1
- package/package.json +7 -7
- package/src/components/tree/treeItem.tsx +7 -1
- package/src/primitives/popover/__workshop__/AlignedStory.tsx +1 -0
- package/src/primitives/popover/__workshop__/SidePanelStory.tsx +86 -0
- package/src/primitives/popover/__workshop__/TestStory.tsx +30 -18
- package/src/primitives/popover/__workshop__/index.ts +5 -0
- package/src/primitives/popover/helpers.ts +32 -0
- package/src/primitives/popover/index.ts +1 -0
- package/src/primitives/popover/popover.tsx +125 -51
- package/src/primitives/popover/popoverCard.tsx +21 -50
- package/src/primitives/popover/types.ts +6 -0
- package/src/primitives/tooltip/tooltip.tsx +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -6,12 +6,14 @@ import {ElementType} from 'react'
|
|
|
6
6
|
import {ForwardRefExoticComponent} from 'react'
|
|
7
7
|
import {HTMLProps} from 'react'
|
|
8
8
|
import {MemoExoticComponent} from 'react'
|
|
9
|
+
import {MutableRefObject} from 'react'
|
|
9
10
|
import {NamedExoticComponent} from 'react'
|
|
10
11
|
import {PropsWithChildren} from 'react'
|
|
11
12
|
import {ReactElement} from 'react'
|
|
12
13
|
import {ReactNode} from 'react'
|
|
13
14
|
import {Ref} from 'react'
|
|
14
15
|
import {RefAttributes} from 'react'
|
|
16
|
+
import {RefCallback} from 'react'
|
|
15
17
|
import {StyledComponent} from 'styled-components'
|
|
16
18
|
|
|
17
19
|
/** @beta */
|
|
@@ -1349,37 +1351,46 @@ export declare const Popover: MemoExoticComponent<
|
|
|
1349
1351
|
*/
|
|
1350
1352
|
export declare type PopoverMargins = [number, number, number, number]
|
|
1351
1353
|
|
|
1352
|
-
/**
|
|
1353
|
-
* @public
|
|
1354
|
-
*/
|
|
1354
|
+
/** @public */
|
|
1355
1355
|
export declare interface PopoverProps
|
|
1356
1356
|
extends Omit<LayerProps, 'as'>,
|
|
1357
1357
|
ResponsiveRadiusProps,
|
|
1358
|
-
ResponsiveShadowProps
|
|
1359
|
-
|
|
1360
|
-
/**
|
|
1361
|
-
* @beta
|
|
1362
|
-
*/
|
|
1358
|
+
ResponsiveShadowProps {
|
|
1359
|
+
/** @beta */
|
|
1363
1360
|
__unstable_margins?: PopoverMargins
|
|
1364
1361
|
arrow?: boolean
|
|
1362
|
+
/** @deprecated Use `floatingBoundary` and/or `referenceBoundary` instead */
|
|
1365
1363
|
boundaryElement?: HTMLElement | null
|
|
1366
1364
|
children?: React.ReactElement
|
|
1367
1365
|
constrainSize?: boolean
|
|
1368
1366
|
content?: React.ReactNode
|
|
1369
1367
|
disabled?: boolean
|
|
1370
1368
|
fallbackPlacements?: Placement[]
|
|
1369
|
+
floatingBoundary?: HTMLElement | null
|
|
1370
|
+
matchReferenceWidth?: boolean
|
|
1371
1371
|
open?: boolean
|
|
1372
1372
|
overflow?: BoxOverflow
|
|
1373
1373
|
padding?: number | number[]
|
|
1374
1374
|
placement?: Placement
|
|
1375
1375
|
portal?: boolean | string
|
|
1376
1376
|
preventOverflow?: boolean
|
|
1377
|
+
referenceBoundary?: HTMLElement | null
|
|
1377
1378
|
referenceElement?: HTMLElement | null
|
|
1378
|
-
matchReferenceWidth?: boolean
|
|
1379
1379
|
scheme?: ThemeColorSchemeKey
|
|
1380
1380
|
tone?: CardTone
|
|
1381
|
+
/** @beta */
|
|
1382
|
+
updateRef?:
|
|
1383
|
+
| MutableRefObject<PopoverUpdateCallback | undefined>
|
|
1384
|
+
| RefCallback<PopoverUpdateCallback | undefined>
|
|
1385
|
+
width?: PopoverWidth | PopoverWidth[]
|
|
1381
1386
|
}
|
|
1382
1387
|
|
|
1388
|
+
/** @beta */
|
|
1389
|
+
export declare type PopoverUpdateCallback = () => void
|
|
1390
|
+
|
|
1391
|
+
/** @public */
|
|
1392
|
+
export declare type PopoverWidth = number | 'auto'
|
|
1393
|
+
|
|
1383
1394
|
/**
|
|
1384
1395
|
* @public
|
|
1385
1396
|
*/
|
|
@@ -2703,6 +2714,10 @@ export declare interface TreeItemProps {
|
|
|
2703
2714
|
expanded?: boolean
|
|
2704
2715
|
fontSize?: number | number[]
|
|
2705
2716
|
icon?: React.ElementType
|
|
2717
|
+
/**
|
|
2718
|
+
* Allows passing a custom element type to the link component
|
|
2719
|
+
*/
|
|
2720
|
+
linkAs?: BoxProps['as']
|
|
2706
2721
|
padding?: number | number[]
|
|
2707
2722
|
space?: number | number[]
|
|
2708
2723
|
text?: React.ReactNode
|