@radix-ui/react-popover 1.0.8-rc.8 → 1.1.0-rc.1
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.mts +49 -37
- package/dist/index.d.ts +49 -37
- package/dist/index.js +315 -326
- package/dist/index.js.map +7 -1
- package/dist/index.mjs +287 -292
- package/dist/index.mjs.map +7 -1
- package/package.json +14 -15
- package/dist/index.d.ts.map +0 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,29 +1,41 @@
|
|
|
1
|
-
import * as React from
|
|
2
|
-
import { DismissableLayer } from
|
|
3
|
-
import { FocusScope } from
|
|
4
|
-
import * as PopperPrimitive from
|
|
5
|
-
import { Portal as
|
|
6
|
-
import * as Radix from
|
|
7
|
-
import { Primitive } from
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { DismissableLayer } from '@radix-ui/react-dismissable-layer';
|
|
3
|
+
import { FocusScope } from '@radix-ui/react-focus-scope';
|
|
4
|
+
import * as PopperPrimitive from '@radix-ui/react-popper';
|
|
5
|
+
import { Portal as Portal$1 } from '@radix-ui/react-portal';
|
|
6
|
+
import * as Radix from '@radix-ui/react-primitive';
|
|
7
|
+
import { Primitive } from '@radix-ui/react-primitive';
|
|
8
|
+
|
|
9
|
+
declare type Scope<C = any> = {
|
|
10
|
+
[scopeName: string]: React.Context<C>[];
|
|
11
|
+
} | undefined;
|
|
12
|
+
declare type ScopeHook = (scope: Scope) => {
|
|
13
|
+
[__scopeProp: string]: Scope;
|
|
14
|
+
};
|
|
15
|
+
interface CreateScope {
|
|
16
|
+
scopeName: string;
|
|
17
|
+
(): ScopeHook;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
declare const createPopoverScope: CreateScope;
|
|
21
|
+
interface PopoverProps {
|
|
10
22
|
children?: React.ReactNode;
|
|
11
23
|
open?: boolean;
|
|
12
24
|
defaultOpen?: boolean;
|
|
13
25
|
onOpenChange?: (open: boolean) => void;
|
|
14
26
|
modal?: boolean;
|
|
15
27
|
}
|
|
16
|
-
|
|
17
|
-
type PopperAnchorProps = Radix.ComponentPropsWithoutRef<typeof PopperPrimitive.Anchor>;
|
|
18
|
-
|
|
28
|
+
declare const Popover: React.FC<PopoverProps>;
|
|
29
|
+
declare type PopperAnchorProps = Radix.ComponentPropsWithoutRef<typeof PopperPrimitive.Anchor>;
|
|
30
|
+
interface PopoverAnchorProps extends PopperAnchorProps {
|
|
19
31
|
}
|
|
20
|
-
|
|
21
|
-
type PrimitiveButtonProps = Radix.ComponentPropsWithoutRef<typeof Primitive.button>;
|
|
22
|
-
|
|
32
|
+
declare const PopoverAnchor: React.ForwardRefExoticComponent<PopoverAnchorProps & React.RefAttributes<HTMLDivElement>>;
|
|
33
|
+
declare type PrimitiveButtonProps = Radix.ComponentPropsWithoutRef<typeof Primitive.button>;
|
|
34
|
+
interface PopoverTriggerProps extends PrimitiveButtonProps {
|
|
23
35
|
}
|
|
24
|
-
|
|
25
|
-
type PortalProps = React.ComponentPropsWithoutRef<typeof
|
|
26
|
-
|
|
36
|
+
declare const PopoverTrigger: React.ForwardRefExoticComponent<PopoverTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
37
|
+
declare type PortalProps = React.ComponentPropsWithoutRef<typeof Portal$1>;
|
|
38
|
+
interface PopoverPortalProps {
|
|
27
39
|
children?: React.ReactNode;
|
|
28
40
|
/**
|
|
29
41
|
* Specify a container element to portal the content into.
|
|
@@ -35,20 +47,20 @@ export interface PopoverPortalProps {
|
|
|
35
47
|
*/
|
|
36
48
|
forceMount?: true;
|
|
37
49
|
}
|
|
38
|
-
|
|
39
|
-
|
|
50
|
+
declare const PopoverPortal: React.FC<PopoverPortalProps>;
|
|
51
|
+
interface PopoverContentProps extends PopoverContentTypeProps {
|
|
40
52
|
/**
|
|
41
53
|
* Used to force mounting when more control is needed. Useful when
|
|
42
54
|
* controlling animation with React animation libraries.
|
|
43
55
|
*/
|
|
44
56
|
forceMount?: true;
|
|
45
57
|
}
|
|
46
|
-
|
|
58
|
+
declare const PopoverContent: React.ForwardRefExoticComponent<PopoverContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
47
59
|
interface PopoverContentTypeProps extends Omit<PopoverContentImplProps, 'trapFocus' | 'disableOutsidePointerEvents'> {
|
|
48
60
|
}
|
|
49
|
-
type FocusScopeProps = Radix.ComponentPropsWithoutRef<typeof FocusScope>;
|
|
50
|
-
type DismissableLayerProps = Radix.ComponentPropsWithoutRef<typeof DismissableLayer>;
|
|
51
|
-
type PopperContentProps = Radix.ComponentPropsWithoutRef<typeof PopperPrimitive.Content>;
|
|
61
|
+
declare type FocusScopeProps = Radix.ComponentPropsWithoutRef<typeof FocusScope>;
|
|
62
|
+
declare type DismissableLayerProps = Radix.ComponentPropsWithoutRef<typeof DismissableLayer>;
|
|
63
|
+
declare type PopperContentProps = Radix.ComponentPropsWithoutRef<typeof PopperPrimitive.Content>;
|
|
52
64
|
interface PopoverContentImplProps extends Omit<PopperContentProps, 'onPlaced'>, Omit<DismissableLayerProps, 'onDismiss'> {
|
|
53
65
|
/**
|
|
54
66
|
* Whether focus should be trapped within the `Popover`
|
|
@@ -66,19 +78,19 @@ interface PopoverContentImplProps extends Omit<PopperContentProps, 'onPlaced'>,
|
|
|
66
78
|
*/
|
|
67
79
|
onCloseAutoFocus?: FocusScopeProps['onUnmountAutoFocus'];
|
|
68
80
|
}
|
|
69
|
-
|
|
81
|
+
interface PopoverCloseProps extends PrimitiveButtonProps {
|
|
70
82
|
}
|
|
71
|
-
|
|
72
|
-
type PopperArrowProps = Radix.ComponentPropsWithoutRef<typeof PopperPrimitive.Arrow>;
|
|
73
|
-
|
|
83
|
+
declare const PopoverClose: React.ForwardRefExoticComponent<PopoverCloseProps & React.RefAttributes<HTMLButtonElement>>;
|
|
84
|
+
declare type PopperArrowProps = Radix.ComponentPropsWithoutRef<typeof PopperPrimitive.Arrow>;
|
|
85
|
+
interface PopoverArrowProps extends PopperArrowProps {
|
|
74
86
|
}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
87
|
+
declare const PopoverArrow: React.ForwardRefExoticComponent<PopoverArrowProps & React.RefAttributes<SVGSVGElement>>;
|
|
88
|
+
declare const Root: React.FC<PopoverProps>;
|
|
89
|
+
declare const Anchor: React.ForwardRefExoticComponent<PopoverAnchorProps & React.RefAttributes<HTMLDivElement>>;
|
|
90
|
+
declare const Trigger: React.ForwardRefExoticComponent<PopoverTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
91
|
+
declare const Portal: React.FC<PopoverPortalProps>;
|
|
92
|
+
declare const Content: React.ForwardRefExoticComponent<PopoverContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
93
|
+
declare const Close: React.ForwardRefExoticComponent<PopoverCloseProps & React.RefAttributes<HTMLButtonElement>>;
|
|
94
|
+
declare const Arrow: React.ForwardRefExoticComponent<PopoverArrowProps & React.RefAttributes<SVGSVGElement>>;
|
|
83
95
|
|
|
84
|
-
|
|
96
|
+
export { Anchor, Arrow, Close, Content, Popover, PopoverAnchor, type PopoverAnchorProps, PopoverArrow, type PopoverArrowProps, PopoverClose, type PopoverCloseProps, PopoverContent, type PopoverContentProps, PopoverPortal, type PopoverPortalProps, type PopoverProps, PopoverTrigger, type PopoverTriggerProps, Portal, Root, Trigger, createPopoverScope };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,29 +1,41 @@
|
|
|
1
|
-
import * as React from
|
|
2
|
-
import { DismissableLayer } from
|
|
3
|
-
import { FocusScope } from
|
|
4
|
-
import * as PopperPrimitive from
|
|
5
|
-
import { Portal as
|
|
6
|
-
import * as Radix from
|
|
7
|
-
import { Primitive } from
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { DismissableLayer } from '@radix-ui/react-dismissable-layer';
|
|
3
|
+
import { FocusScope } from '@radix-ui/react-focus-scope';
|
|
4
|
+
import * as PopperPrimitive from '@radix-ui/react-popper';
|
|
5
|
+
import { Portal as Portal$1 } from '@radix-ui/react-portal';
|
|
6
|
+
import * as Radix from '@radix-ui/react-primitive';
|
|
7
|
+
import { Primitive } from '@radix-ui/react-primitive';
|
|
8
|
+
|
|
9
|
+
declare type Scope<C = any> = {
|
|
10
|
+
[scopeName: string]: React.Context<C>[];
|
|
11
|
+
} | undefined;
|
|
12
|
+
declare type ScopeHook = (scope: Scope) => {
|
|
13
|
+
[__scopeProp: string]: Scope;
|
|
14
|
+
};
|
|
15
|
+
interface CreateScope {
|
|
16
|
+
scopeName: string;
|
|
17
|
+
(): ScopeHook;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
declare const createPopoverScope: CreateScope;
|
|
21
|
+
interface PopoverProps {
|
|
10
22
|
children?: React.ReactNode;
|
|
11
23
|
open?: boolean;
|
|
12
24
|
defaultOpen?: boolean;
|
|
13
25
|
onOpenChange?: (open: boolean) => void;
|
|
14
26
|
modal?: boolean;
|
|
15
27
|
}
|
|
16
|
-
|
|
17
|
-
type PopperAnchorProps = Radix.ComponentPropsWithoutRef<typeof PopperPrimitive.Anchor>;
|
|
18
|
-
|
|
28
|
+
declare const Popover: React.FC<PopoverProps>;
|
|
29
|
+
declare type PopperAnchorProps = Radix.ComponentPropsWithoutRef<typeof PopperPrimitive.Anchor>;
|
|
30
|
+
interface PopoverAnchorProps extends PopperAnchorProps {
|
|
19
31
|
}
|
|
20
|
-
|
|
21
|
-
type PrimitiveButtonProps = Radix.ComponentPropsWithoutRef<typeof Primitive.button>;
|
|
22
|
-
|
|
32
|
+
declare const PopoverAnchor: React.ForwardRefExoticComponent<PopoverAnchorProps & React.RefAttributes<HTMLDivElement>>;
|
|
33
|
+
declare type PrimitiveButtonProps = Radix.ComponentPropsWithoutRef<typeof Primitive.button>;
|
|
34
|
+
interface PopoverTriggerProps extends PrimitiveButtonProps {
|
|
23
35
|
}
|
|
24
|
-
|
|
25
|
-
type PortalProps = React.ComponentPropsWithoutRef<typeof
|
|
26
|
-
|
|
36
|
+
declare const PopoverTrigger: React.ForwardRefExoticComponent<PopoverTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
37
|
+
declare type PortalProps = React.ComponentPropsWithoutRef<typeof Portal$1>;
|
|
38
|
+
interface PopoverPortalProps {
|
|
27
39
|
children?: React.ReactNode;
|
|
28
40
|
/**
|
|
29
41
|
* Specify a container element to portal the content into.
|
|
@@ -35,20 +47,20 @@ export interface PopoverPortalProps {
|
|
|
35
47
|
*/
|
|
36
48
|
forceMount?: true;
|
|
37
49
|
}
|
|
38
|
-
|
|
39
|
-
|
|
50
|
+
declare const PopoverPortal: React.FC<PopoverPortalProps>;
|
|
51
|
+
interface PopoverContentProps extends PopoverContentTypeProps {
|
|
40
52
|
/**
|
|
41
53
|
* Used to force mounting when more control is needed. Useful when
|
|
42
54
|
* controlling animation with React animation libraries.
|
|
43
55
|
*/
|
|
44
56
|
forceMount?: true;
|
|
45
57
|
}
|
|
46
|
-
|
|
58
|
+
declare const PopoverContent: React.ForwardRefExoticComponent<PopoverContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
47
59
|
interface PopoverContentTypeProps extends Omit<PopoverContentImplProps, 'trapFocus' | 'disableOutsidePointerEvents'> {
|
|
48
60
|
}
|
|
49
|
-
type FocusScopeProps = Radix.ComponentPropsWithoutRef<typeof FocusScope>;
|
|
50
|
-
type DismissableLayerProps = Radix.ComponentPropsWithoutRef<typeof DismissableLayer>;
|
|
51
|
-
type PopperContentProps = Radix.ComponentPropsWithoutRef<typeof PopperPrimitive.Content>;
|
|
61
|
+
declare type FocusScopeProps = Radix.ComponentPropsWithoutRef<typeof FocusScope>;
|
|
62
|
+
declare type DismissableLayerProps = Radix.ComponentPropsWithoutRef<typeof DismissableLayer>;
|
|
63
|
+
declare type PopperContentProps = Radix.ComponentPropsWithoutRef<typeof PopperPrimitive.Content>;
|
|
52
64
|
interface PopoverContentImplProps extends Omit<PopperContentProps, 'onPlaced'>, Omit<DismissableLayerProps, 'onDismiss'> {
|
|
53
65
|
/**
|
|
54
66
|
* Whether focus should be trapped within the `Popover`
|
|
@@ -66,19 +78,19 @@ interface PopoverContentImplProps extends Omit<PopperContentProps, 'onPlaced'>,
|
|
|
66
78
|
*/
|
|
67
79
|
onCloseAutoFocus?: FocusScopeProps['onUnmountAutoFocus'];
|
|
68
80
|
}
|
|
69
|
-
|
|
81
|
+
interface PopoverCloseProps extends PrimitiveButtonProps {
|
|
70
82
|
}
|
|
71
|
-
|
|
72
|
-
type PopperArrowProps = Radix.ComponentPropsWithoutRef<typeof PopperPrimitive.Arrow>;
|
|
73
|
-
|
|
83
|
+
declare const PopoverClose: React.ForwardRefExoticComponent<PopoverCloseProps & React.RefAttributes<HTMLButtonElement>>;
|
|
84
|
+
declare type PopperArrowProps = Radix.ComponentPropsWithoutRef<typeof PopperPrimitive.Arrow>;
|
|
85
|
+
interface PopoverArrowProps extends PopperArrowProps {
|
|
74
86
|
}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
87
|
+
declare const PopoverArrow: React.ForwardRefExoticComponent<PopoverArrowProps & React.RefAttributes<SVGSVGElement>>;
|
|
88
|
+
declare const Root: React.FC<PopoverProps>;
|
|
89
|
+
declare const Anchor: React.ForwardRefExoticComponent<PopoverAnchorProps & React.RefAttributes<HTMLDivElement>>;
|
|
90
|
+
declare const Trigger: React.ForwardRefExoticComponent<PopoverTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
91
|
+
declare const Portal: React.FC<PopoverPortalProps>;
|
|
92
|
+
declare const Content: React.ForwardRefExoticComponent<PopoverContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
93
|
+
declare const Close: React.ForwardRefExoticComponent<PopoverCloseProps & React.RefAttributes<HTMLButtonElement>>;
|
|
94
|
+
declare const Arrow: React.ForwardRefExoticComponent<PopoverArrowProps & React.RefAttributes<SVGSVGElement>>;
|
|
83
95
|
|
|
84
|
-
|
|
96
|
+
export { Anchor, Arrow, Close, Content, Popover, PopoverAnchor, type PopoverAnchorProps, PopoverArrow, type PopoverArrowProps, PopoverClose, type PopoverCloseProps, PopoverContent, type PopoverContentProps, PopoverPortal, type PopoverPortalProps, type PopoverProps, PopoverTrigger, type PopoverTriggerProps, Portal, Root, Trigger, createPopoverScope };
|