@react-types/overlays 3.9.4 → 3.10.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/package.json +9 -4
- package/src/index.d.ts +9 -73
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-types/overlays",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.10.0",
|
|
4
4
|
"description": "Spectrum UI components in React",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"types": "src/index.d.ts",
|
|
@@ -9,13 +9,18 @@
|
|
|
9
9
|
"url": "https://github.com/adobe/react-spectrum"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@react-
|
|
12
|
+
"@react-aria/overlays": "^3.32.0",
|
|
13
|
+
"@react-spectrum/overlays": "^5.10.0",
|
|
14
|
+
"@react-stately/overlays": "^3.7.0",
|
|
15
|
+
"@react-types/shared": "^3.34.0"
|
|
13
16
|
},
|
|
14
17
|
"peerDependencies": {
|
|
15
|
-
"react": "^
|
|
18
|
+
"@react-spectrum/provider": "^3.0.0",
|
|
19
|
+
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1",
|
|
20
|
+
"react-dom": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1"
|
|
16
21
|
},
|
|
17
22
|
"publishConfig": {
|
|
18
23
|
"access": "public"
|
|
19
24
|
},
|
|
20
|
-
"gitHead": "
|
|
25
|
+
"gitHead": "a6999bdf494a2e9c0381a5881908328bdd22ddae"
|
|
21
26
|
}
|
package/src/index.d.ts
CHANGED
|
@@ -10,73 +10,16 @@
|
|
|
10
10
|
* governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
import {HTMLAttributes,
|
|
13
|
+
import {HTMLAttributes, ReactElement, ReactNode} from 'react';
|
|
14
|
+
import {OverlayProps} from '@react-spectrum/overlays';
|
|
15
|
+
import {PlacementAxis} from '@react-aria/overlays';
|
|
14
16
|
import {StyleProps} from '@react-types/shared';
|
|
15
17
|
|
|
16
|
-
export
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
'right' | 'right top' | 'right bottom' | 'end' | 'end top' | 'end bottom';
|
|
20
|
-
|
|
21
|
-
export type Axis = 'top' | 'bottom' | 'left' | 'right';
|
|
22
|
-
export type SizeAxis = 'width' | 'height';
|
|
23
|
-
export type PlacementAxis = Axis | 'center';
|
|
24
|
-
|
|
25
|
-
export interface PositionProps {
|
|
26
|
-
/**
|
|
27
|
-
* The placement of the element with respect to its anchor element.
|
|
28
|
-
* @default 'bottom'
|
|
29
|
-
*/
|
|
30
|
-
placement?: Placement,
|
|
31
|
-
/**
|
|
32
|
-
* The placement padding that should be applied between the element and its
|
|
33
|
-
* surrounding container.
|
|
34
|
-
* @default 12
|
|
35
|
-
*/
|
|
36
|
-
containerPadding?: number,
|
|
37
|
-
/**
|
|
38
|
-
* The additional offset applied along the main axis between the element and its
|
|
39
|
-
* anchor element.
|
|
40
|
-
* @default 0
|
|
41
|
-
*/
|
|
42
|
-
offset?: number,
|
|
43
|
-
/**
|
|
44
|
-
* The additional offset applied along the cross axis between the element and its
|
|
45
|
-
* anchor element.
|
|
46
|
-
* @default 0
|
|
47
|
-
*/
|
|
48
|
-
crossOffset?: number,
|
|
49
|
-
/**
|
|
50
|
-
* Whether the element should flip its orientation (e.g. top to bottom or left to right) when
|
|
51
|
-
* there is insufficient room for it to render completely.
|
|
52
|
-
* @default true
|
|
53
|
-
*/
|
|
54
|
-
shouldFlip?: boolean,
|
|
55
|
-
// /**
|
|
56
|
-
// * The element that should be used as the bounding container when calculating container offset
|
|
57
|
-
// * or whether it should flip.
|
|
58
|
-
// */
|
|
59
|
-
// boundaryElement?: Element,
|
|
60
|
-
/** Whether the element is rendered. */
|
|
61
|
-
isOpen?: boolean
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
export interface OverlayProps {
|
|
65
|
-
children: ReactNode,
|
|
66
|
-
isOpen?: boolean,
|
|
67
|
-
container?: Element,
|
|
68
|
-
isKeyboardDismissDisabled?: boolean,
|
|
69
|
-
onEnter?: () => void,
|
|
70
|
-
onEntering?: () => void,
|
|
71
|
-
onEntered?: () => void,
|
|
72
|
-
onExit?: () => void,
|
|
73
|
-
onExiting?: () => void,
|
|
74
|
-
onExited?: () => void,
|
|
75
|
-
nodeRef: MutableRefObject<HTMLElement | null>,
|
|
76
|
-
disableFocusManagement?: boolean,
|
|
77
|
-
shouldContainFocus?: boolean
|
|
78
|
-
}
|
|
18
|
+
export {OverlayTriggerProps} from '@react-stately/overlays';
|
|
19
|
+
export {Placement, Axis, SizeAxis, PlacementAxis, PositionProps} from '@react-aria/overlays';
|
|
20
|
+
export {OverlayProps} from '@react-spectrum/overlays';
|
|
79
21
|
|
|
22
|
+
// Old and unused. Left for backward compatibility.
|
|
80
23
|
export interface ModalProps extends StyleProps, Omit<OverlayProps, 'nodeRef'> {
|
|
81
24
|
children: ReactElement,
|
|
82
25
|
isOpen?: boolean,
|
|
@@ -85,6 +28,7 @@ export interface ModalProps extends StyleProps, Omit<OverlayProps, 'nodeRef'> {
|
|
|
85
28
|
isDismissable?: boolean
|
|
86
29
|
}
|
|
87
30
|
|
|
31
|
+
// Old and unused. Left for backward compatibility.
|
|
88
32
|
export interface PopoverProps extends StyleProps, Omit<OverlayProps, 'nodeRef'> {
|
|
89
33
|
children: ReactNode,
|
|
90
34
|
placement?: PlacementAxis,
|
|
@@ -97,6 +41,7 @@ export interface PopoverProps extends StyleProps, Omit<OverlayProps, 'nodeRef'>
|
|
|
97
41
|
isDismissable?: boolean
|
|
98
42
|
}
|
|
99
43
|
|
|
44
|
+
// Old and unused. Left for backward compatibility.
|
|
100
45
|
export interface TrayProps extends StyleProps, Omit<OverlayProps, 'nodeRef'> {
|
|
101
46
|
children: ReactElement,
|
|
102
47
|
isOpen?: boolean,
|
|
@@ -105,12 +50,3 @@ export interface TrayProps extends StyleProps, Omit<OverlayProps, 'nodeRef'> {
|
|
|
105
50
|
isFixedHeight?: boolean,
|
|
106
51
|
isNonModal?: boolean
|
|
107
52
|
}
|
|
108
|
-
|
|
109
|
-
export interface OverlayTriggerProps {
|
|
110
|
-
/** Whether the overlay is open by default (controlled). */
|
|
111
|
-
isOpen?: boolean,
|
|
112
|
-
/** Whether the overlay is open by default (uncontrolled). */
|
|
113
|
-
defaultOpen?: boolean,
|
|
114
|
-
/** Handler that is called when the overlay's open state changes. */
|
|
115
|
-
onOpenChange?: (isOpen: boolean) => void
|
|
116
|
-
}
|