@radix-ui/react-dialog 1.0.6-rc.6 → 1.1.0-rc.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.mts +52 -40
- package/dist/index.d.ts +52 -40
- package/dist/index.js +325 -363
- package/dist/index.js.map +7 -1
- package/dist/index.mjs +310 -335
- package/dist/index.mjs.map +7 -1
- package/package.json +13 -14
- package/dist/index.d.ts.map +0 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,24 +1,36 @@
|
|
|
1
|
-
import * as React from
|
|
2
|
-
import { DismissableLayer } from
|
|
3
|
-
import { FocusScope } from
|
|
4
|
-
import { Portal as
|
|
5
|
-
import * as Radix from
|
|
6
|
-
import { Primitive } from
|
|
7
|
-
|
|
8
|
-
|
|
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 { Portal as Portal$1 } from '@radix-ui/react-portal';
|
|
5
|
+
import * as Radix from '@radix-ui/react-primitive';
|
|
6
|
+
import { Primitive } from '@radix-ui/react-primitive';
|
|
7
|
+
|
|
8
|
+
declare type Scope<C = any> = {
|
|
9
|
+
[scopeName: string]: React.Context<C>[];
|
|
10
|
+
} | undefined;
|
|
11
|
+
declare type ScopeHook = (scope: Scope) => {
|
|
12
|
+
[__scopeProp: string]: Scope;
|
|
13
|
+
};
|
|
14
|
+
interface CreateScope {
|
|
15
|
+
scopeName: string;
|
|
16
|
+
(): ScopeHook;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
declare const createDialogScope: CreateScope;
|
|
20
|
+
interface DialogProps {
|
|
9
21
|
children?: React.ReactNode;
|
|
10
22
|
open?: boolean;
|
|
11
23
|
defaultOpen?: boolean;
|
|
12
24
|
onOpenChange?(open: boolean): void;
|
|
13
25
|
modal?: boolean;
|
|
14
26
|
}
|
|
15
|
-
|
|
16
|
-
type PrimitiveButtonProps = Radix.ComponentPropsWithoutRef<typeof Primitive.button>;
|
|
17
|
-
|
|
27
|
+
declare const Dialog: React.FC<DialogProps>;
|
|
28
|
+
declare type PrimitiveButtonProps = Radix.ComponentPropsWithoutRef<typeof Primitive.button>;
|
|
29
|
+
interface DialogTriggerProps extends PrimitiveButtonProps {
|
|
18
30
|
}
|
|
19
|
-
|
|
20
|
-
type PortalProps = React.ComponentPropsWithoutRef<typeof
|
|
21
|
-
|
|
31
|
+
declare const DialogTrigger: React.ForwardRefExoticComponent<DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
32
|
+
declare type PortalProps = React.ComponentPropsWithoutRef<typeof Portal$1>;
|
|
33
|
+
interface DialogPortalProps {
|
|
22
34
|
children?: React.ReactNode;
|
|
23
35
|
/**
|
|
24
36
|
* Specify a container element to portal the content into.
|
|
@@ -30,30 +42,30 @@ export interface DialogPortalProps {
|
|
|
30
42
|
*/
|
|
31
43
|
forceMount?: true;
|
|
32
44
|
}
|
|
33
|
-
|
|
34
|
-
|
|
45
|
+
declare const DialogPortal: React.FC<DialogPortalProps>;
|
|
46
|
+
interface DialogOverlayProps extends DialogOverlayImplProps {
|
|
35
47
|
/**
|
|
36
48
|
* Used to force mounting when more control is needed. Useful when
|
|
37
49
|
* controlling animation with React animation libraries.
|
|
38
50
|
*/
|
|
39
51
|
forceMount?: true;
|
|
40
52
|
}
|
|
41
|
-
|
|
42
|
-
type PrimitiveDivProps = Radix.ComponentPropsWithoutRef<typeof Primitive.div>;
|
|
53
|
+
declare const DialogOverlay: React.ForwardRefExoticComponent<DialogOverlayProps & React.RefAttributes<HTMLDivElement>>;
|
|
54
|
+
declare type PrimitiveDivProps = Radix.ComponentPropsWithoutRef<typeof Primitive.div>;
|
|
43
55
|
interface DialogOverlayImplProps extends PrimitiveDivProps {
|
|
44
56
|
}
|
|
45
|
-
|
|
57
|
+
interface DialogContentProps extends DialogContentTypeProps {
|
|
46
58
|
/**
|
|
47
59
|
* Used to force mounting when more control is needed. Useful when
|
|
48
60
|
* controlling animation with React animation libraries.
|
|
49
61
|
*/
|
|
50
62
|
forceMount?: true;
|
|
51
63
|
}
|
|
52
|
-
|
|
64
|
+
declare const DialogContent: React.ForwardRefExoticComponent<DialogContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
53
65
|
interface DialogContentTypeProps extends Omit<DialogContentImplProps, 'trapFocus' | 'disableOutsidePointerEvents'> {
|
|
54
66
|
}
|
|
55
|
-
type DismissableLayerProps = Radix.ComponentPropsWithoutRef<typeof DismissableLayer>;
|
|
56
|
-
type FocusScopeProps = Radix.ComponentPropsWithoutRef<typeof FocusScope>;
|
|
67
|
+
declare type DismissableLayerProps = Radix.ComponentPropsWithoutRef<typeof DismissableLayer>;
|
|
68
|
+
declare type FocusScopeProps = Radix.ComponentPropsWithoutRef<typeof FocusScope>;
|
|
57
69
|
interface DialogContentImplProps extends Omit<DismissableLayerProps, 'onDismiss'> {
|
|
58
70
|
/**
|
|
59
71
|
* When `true`, focus cannot escape the `Content` via keyboard,
|
|
@@ -72,18 +84,18 @@ interface DialogContentImplProps extends Omit<DismissableLayerProps, 'onDismiss'
|
|
|
72
84
|
*/
|
|
73
85
|
onCloseAutoFocus?: FocusScopeProps['onUnmountAutoFocus'];
|
|
74
86
|
}
|
|
75
|
-
type PrimitiveHeading2Props = Radix.ComponentPropsWithoutRef<typeof Primitive.h2>;
|
|
76
|
-
|
|
87
|
+
declare type PrimitiveHeading2Props = Radix.ComponentPropsWithoutRef<typeof Primitive.h2>;
|
|
88
|
+
interface DialogTitleProps extends PrimitiveHeading2Props {
|
|
77
89
|
}
|
|
78
|
-
|
|
79
|
-
type PrimitiveParagraphProps = Radix.ComponentPropsWithoutRef<typeof Primitive.p>;
|
|
80
|
-
|
|
90
|
+
declare const DialogTitle: React.ForwardRefExoticComponent<DialogTitleProps & React.RefAttributes<HTMLHeadingElement>>;
|
|
91
|
+
declare type PrimitiveParagraphProps = Radix.ComponentPropsWithoutRef<typeof Primitive.p>;
|
|
92
|
+
interface DialogDescriptionProps extends PrimitiveParagraphProps {
|
|
81
93
|
}
|
|
82
|
-
|
|
83
|
-
|
|
94
|
+
declare const DialogDescription: React.ForwardRefExoticComponent<DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>>;
|
|
95
|
+
interface DialogCloseProps extends PrimitiveButtonProps {
|
|
84
96
|
}
|
|
85
|
-
|
|
86
|
-
|
|
97
|
+
declare const DialogClose: React.ForwardRefExoticComponent<DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
|
|
98
|
+
declare const WarningProvider: {
|
|
87
99
|
(props: {
|
|
88
100
|
contentName: string;
|
|
89
101
|
titleName: string;
|
|
@@ -93,13 +105,13 @@ export const WarningProvider: {
|
|
|
93
105
|
}): JSX.Element;
|
|
94
106
|
displayName: string;
|
|
95
107
|
};
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
108
|
+
declare const Root: React.FC<DialogProps>;
|
|
109
|
+
declare const Trigger: React.ForwardRefExoticComponent<DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
110
|
+
declare const Portal: React.FC<DialogPortalProps>;
|
|
111
|
+
declare const Overlay: React.ForwardRefExoticComponent<DialogOverlayProps & React.RefAttributes<HTMLDivElement>>;
|
|
112
|
+
declare const Content: React.ForwardRefExoticComponent<DialogContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
113
|
+
declare const Title: React.ForwardRefExoticComponent<DialogTitleProps & React.RefAttributes<HTMLHeadingElement>>;
|
|
114
|
+
declare const Description: React.ForwardRefExoticComponent<DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>>;
|
|
115
|
+
declare const Close: React.ForwardRefExoticComponent<DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
|
|
104
116
|
|
|
105
|
-
|
|
117
|
+
export { Close, Content, Description, Dialog, DialogClose, type DialogCloseProps, DialogContent, type DialogContentProps, DialogDescription, type DialogDescriptionProps, DialogOverlay, type DialogOverlayProps, DialogPortal, type DialogPortalProps, type DialogProps, DialogTitle, type DialogTitleProps, DialogTrigger, type DialogTriggerProps, Overlay, Portal, Root, Title, Trigger, WarningProvider, createDialogScope };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,24 +1,36 @@
|
|
|
1
|
-
import * as React from
|
|
2
|
-
import { DismissableLayer } from
|
|
3
|
-
import { FocusScope } from
|
|
4
|
-
import { Portal as
|
|
5
|
-
import * as Radix from
|
|
6
|
-
import { Primitive } from
|
|
7
|
-
|
|
8
|
-
|
|
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 { Portal as Portal$1 } from '@radix-ui/react-portal';
|
|
5
|
+
import * as Radix from '@radix-ui/react-primitive';
|
|
6
|
+
import { Primitive } from '@radix-ui/react-primitive';
|
|
7
|
+
|
|
8
|
+
declare type Scope<C = any> = {
|
|
9
|
+
[scopeName: string]: React.Context<C>[];
|
|
10
|
+
} | undefined;
|
|
11
|
+
declare type ScopeHook = (scope: Scope) => {
|
|
12
|
+
[__scopeProp: string]: Scope;
|
|
13
|
+
};
|
|
14
|
+
interface CreateScope {
|
|
15
|
+
scopeName: string;
|
|
16
|
+
(): ScopeHook;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
declare const createDialogScope: CreateScope;
|
|
20
|
+
interface DialogProps {
|
|
9
21
|
children?: React.ReactNode;
|
|
10
22
|
open?: boolean;
|
|
11
23
|
defaultOpen?: boolean;
|
|
12
24
|
onOpenChange?(open: boolean): void;
|
|
13
25
|
modal?: boolean;
|
|
14
26
|
}
|
|
15
|
-
|
|
16
|
-
type PrimitiveButtonProps = Radix.ComponentPropsWithoutRef<typeof Primitive.button>;
|
|
17
|
-
|
|
27
|
+
declare const Dialog: React.FC<DialogProps>;
|
|
28
|
+
declare type PrimitiveButtonProps = Radix.ComponentPropsWithoutRef<typeof Primitive.button>;
|
|
29
|
+
interface DialogTriggerProps extends PrimitiveButtonProps {
|
|
18
30
|
}
|
|
19
|
-
|
|
20
|
-
type PortalProps = React.ComponentPropsWithoutRef<typeof
|
|
21
|
-
|
|
31
|
+
declare const DialogTrigger: React.ForwardRefExoticComponent<DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
32
|
+
declare type PortalProps = React.ComponentPropsWithoutRef<typeof Portal$1>;
|
|
33
|
+
interface DialogPortalProps {
|
|
22
34
|
children?: React.ReactNode;
|
|
23
35
|
/**
|
|
24
36
|
* Specify a container element to portal the content into.
|
|
@@ -30,30 +42,30 @@ export interface DialogPortalProps {
|
|
|
30
42
|
*/
|
|
31
43
|
forceMount?: true;
|
|
32
44
|
}
|
|
33
|
-
|
|
34
|
-
|
|
45
|
+
declare const DialogPortal: React.FC<DialogPortalProps>;
|
|
46
|
+
interface DialogOverlayProps extends DialogOverlayImplProps {
|
|
35
47
|
/**
|
|
36
48
|
* Used to force mounting when more control is needed. Useful when
|
|
37
49
|
* controlling animation with React animation libraries.
|
|
38
50
|
*/
|
|
39
51
|
forceMount?: true;
|
|
40
52
|
}
|
|
41
|
-
|
|
42
|
-
type PrimitiveDivProps = Radix.ComponentPropsWithoutRef<typeof Primitive.div>;
|
|
53
|
+
declare const DialogOverlay: React.ForwardRefExoticComponent<DialogOverlayProps & React.RefAttributes<HTMLDivElement>>;
|
|
54
|
+
declare type PrimitiveDivProps = Radix.ComponentPropsWithoutRef<typeof Primitive.div>;
|
|
43
55
|
interface DialogOverlayImplProps extends PrimitiveDivProps {
|
|
44
56
|
}
|
|
45
|
-
|
|
57
|
+
interface DialogContentProps extends DialogContentTypeProps {
|
|
46
58
|
/**
|
|
47
59
|
* Used to force mounting when more control is needed. Useful when
|
|
48
60
|
* controlling animation with React animation libraries.
|
|
49
61
|
*/
|
|
50
62
|
forceMount?: true;
|
|
51
63
|
}
|
|
52
|
-
|
|
64
|
+
declare const DialogContent: React.ForwardRefExoticComponent<DialogContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
53
65
|
interface DialogContentTypeProps extends Omit<DialogContentImplProps, 'trapFocus' | 'disableOutsidePointerEvents'> {
|
|
54
66
|
}
|
|
55
|
-
type DismissableLayerProps = Radix.ComponentPropsWithoutRef<typeof DismissableLayer>;
|
|
56
|
-
type FocusScopeProps = Radix.ComponentPropsWithoutRef<typeof FocusScope>;
|
|
67
|
+
declare type DismissableLayerProps = Radix.ComponentPropsWithoutRef<typeof DismissableLayer>;
|
|
68
|
+
declare type FocusScopeProps = Radix.ComponentPropsWithoutRef<typeof FocusScope>;
|
|
57
69
|
interface DialogContentImplProps extends Omit<DismissableLayerProps, 'onDismiss'> {
|
|
58
70
|
/**
|
|
59
71
|
* When `true`, focus cannot escape the `Content` via keyboard,
|
|
@@ -72,18 +84,18 @@ interface DialogContentImplProps extends Omit<DismissableLayerProps, 'onDismiss'
|
|
|
72
84
|
*/
|
|
73
85
|
onCloseAutoFocus?: FocusScopeProps['onUnmountAutoFocus'];
|
|
74
86
|
}
|
|
75
|
-
type PrimitiveHeading2Props = Radix.ComponentPropsWithoutRef<typeof Primitive.h2>;
|
|
76
|
-
|
|
87
|
+
declare type PrimitiveHeading2Props = Radix.ComponentPropsWithoutRef<typeof Primitive.h2>;
|
|
88
|
+
interface DialogTitleProps extends PrimitiveHeading2Props {
|
|
77
89
|
}
|
|
78
|
-
|
|
79
|
-
type PrimitiveParagraphProps = Radix.ComponentPropsWithoutRef<typeof Primitive.p>;
|
|
80
|
-
|
|
90
|
+
declare const DialogTitle: React.ForwardRefExoticComponent<DialogTitleProps & React.RefAttributes<HTMLHeadingElement>>;
|
|
91
|
+
declare type PrimitiveParagraphProps = Radix.ComponentPropsWithoutRef<typeof Primitive.p>;
|
|
92
|
+
interface DialogDescriptionProps extends PrimitiveParagraphProps {
|
|
81
93
|
}
|
|
82
|
-
|
|
83
|
-
|
|
94
|
+
declare const DialogDescription: React.ForwardRefExoticComponent<DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>>;
|
|
95
|
+
interface DialogCloseProps extends PrimitiveButtonProps {
|
|
84
96
|
}
|
|
85
|
-
|
|
86
|
-
|
|
97
|
+
declare const DialogClose: React.ForwardRefExoticComponent<DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
|
|
98
|
+
declare const WarningProvider: {
|
|
87
99
|
(props: {
|
|
88
100
|
contentName: string;
|
|
89
101
|
titleName: string;
|
|
@@ -93,13 +105,13 @@ export const WarningProvider: {
|
|
|
93
105
|
}): JSX.Element;
|
|
94
106
|
displayName: string;
|
|
95
107
|
};
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
108
|
+
declare const Root: React.FC<DialogProps>;
|
|
109
|
+
declare const Trigger: React.ForwardRefExoticComponent<DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
110
|
+
declare const Portal: React.FC<DialogPortalProps>;
|
|
111
|
+
declare const Overlay: React.ForwardRefExoticComponent<DialogOverlayProps & React.RefAttributes<HTMLDivElement>>;
|
|
112
|
+
declare const Content: React.ForwardRefExoticComponent<DialogContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
113
|
+
declare const Title: React.ForwardRefExoticComponent<DialogTitleProps & React.RefAttributes<HTMLHeadingElement>>;
|
|
114
|
+
declare const Description: React.ForwardRefExoticComponent<DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>>;
|
|
115
|
+
declare const Close: React.ForwardRefExoticComponent<DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
|
|
104
116
|
|
|
105
|
-
|
|
117
|
+
export { Close, Content, Description, Dialog, DialogClose, type DialogCloseProps, DialogContent, type DialogContentProps, DialogDescription, type DialogDescriptionProps, DialogOverlay, type DialogOverlayProps, DialogPortal, type DialogPortalProps, type DialogProps, DialogTitle, type DialogTitleProps, DialogTrigger, type DialogTriggerProps, Overlay, Portal, Root, Title, Trigger, WarningProvider, createDialogScope };
|