@radix-ui/react-dialog 1.0.6-rc.5 → 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 CHANGED
@@ -1,24 +1,36 @@
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 _Portal1 } from "@radix-ui/react-portal";
5
- import * as Radix from "@radix-ui/react-primitive";
6
- import { Primitive } from "@radix-ui/react-primitive";
7
- export const createDialogScope: import("@radix-ui/react-context").CreateScope;
8
- export interface DialogProps {
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
- export const Dialog: React.FC<DialogProps>;
16
- type PrimitiveButtonProps = Radix.ComponentPropsWithoutRef<typeof Primitive.button>;
17
- export interface DialogTriggerProps extends PrimitiveButtonProps {
27
+ declare const Dialog: React.FC<DialogProps>;
28
+ declare type PrimitiveButtonProps = Radix.ComponentPropsWithoutRef<typeof Primitive.button>;
29
+ interface DialogTriggerProps extends PrimitiveButtonProps {
18
30
  }
19
- export const DialogTrigger: React.ForwardRefExoticComponent<DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
20
- type PortalProps = React.ComponentPropsWithoutRef<typeof _Portal1>;
21
- export interface DialogPortalProps {
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
- export const DialogPortal: React.FC<DialogPortalProps>;
34
- export interface DialogOverlayProps extends DialogOverlayImplProps {
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
- export const DialogOverlay: React.ForwardRefExoticComponent<DialogOverlayProps & React.RefAttributes<HTMLDivElement>>;
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
- export interface DialogContentProps extends DialogContentTypeProps {
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
- export const DialogContent: React.ForwardRefExoticComponent<DialogContentProps & React.RefAttributes<HTMLDivElement>>;
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
- export interface DialogTitleProps extends PrimitiveHeading2Props {
87
+ declare type PrimitiveHeading2Props = Radix.ComponentPropsWithoutRef<typeof Primitive.h2>;
88
+ interface DialogTitleProps extends PrimitiveHeading2Props {
77
89
  }
78
- export const DialogTitle: React.ForwardRefExoticComponent<DialogTitleProps & React.RefAttributes<HTMLHeadingElement>>;
79
- type PrimitiveParagraphProps = Radix.ComponentPropsWithoutRef<typeof Primitive.p>;
80
- export interface DialogDescriptionProps extends PrimitiveParagraphProps {
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
- export const DialogDescription: React.ForwardRefExoticComponent<DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>>;
83
- export interface DialogCloseProps extends PrimitiveButtonProps {
94
+ declare const DialogDescription: React.ForwardRefExoticComponent<DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>>;
95
+ interface DialogCloseProps extends PrimitiveButtonProps {
84
96
  }
85
- export const DialogClose: React.ForwardRefExoticComponent<DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
86
- export const WarningProvider: {
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
- export const Root: React.FC<DialogProps>;
97
- export const Trigger: React.ForwardRefExoticComponent<DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
98
- export const Portal: React.FC<DialogPortalProps>;
99
- export const Overlay: React.ForwardRefExoticComponent<DialogOverlayProps & React.RefAttributes<HTMLDivElement>>;
100
- export const Content: React.ForwardRefExoticComponent<DialogContentProps & React.RefAttributes<HTMLDivElement>>;
101
- export const Title: React.ForwardRefExoticComponent<DialogTitleProps & React.RefAttributes<HTMLHeadingElement>>;
102
- export const Description: React.ForwardRefExoticComponent<DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>>;
103
- export const Close: React.ForwardRefExoticComponent<DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
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
- //# sourceMappingURL=index.d.ts.map
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 "react";
2
- import { DismissableLayer } from "@radix-ui/react-dismissable-layer";
3
- import { FocusScope } from "@radix-ui/react-focus-scope";
4
- import { Portal as _Portal1 } from "@radix-ui/react-portal";
5
- import * as Radix from "@radix-ui/react-primitive";
6
- import { Primitive } from "@radix-ui/react-primitive";
7
- export const createDialogScope: import("@radix-ui/react-context").CreateScope;
8
- export interface DialogProps {
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
- export const Dialog: React.FC<DialogProps>;
16
- type PrimitiveButtonProps = Radix.ComponentPropsWithoutRef<typeof Primitive.button>;
17
- export interface DialogTriggerProps extends PrimitiveButtonProps {
27
+ declare const Dialog: React.FC<DialogProps>;
28
+ declare type PrimitiveButtonProps = Radix.ComponentPropsWithoutRef<typeof Primitive.button>;
29
+ interface DialogTriggerProps extends PrimitiveButtonProps {
18
30
  }
19
- export const DialogTrigger: React.ForwardRefExoticComponent<DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
20
- type PortalProps = React.ComponentPropsWithoutRef<typeof _Portal1>;
21
- export interface DialogPortalProps {
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
- export const DialogPortal: React.FC<DialogPortalProps>;
34
- export interface DialogOverlayProps extends DialogOverlayImplProps {
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
- export const DialogOverlay: React.ForwardRefExoticComponent<DialogOverlayProps & React.RefAttributes<HTMLDivElement>>;
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
- export interface DialogContentProps extends DialogContentTypeProps {
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
- export const DialogContent: React.ForwardRefExoticComponent<DialogContentProps & React.RefAttributes<HTMLDivElement>>;
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
- export interface DialogTitleProps extends PrimitiveHeading2Props {
87
+ declare type PrimitiveHeading2Props = Radix.ComponentPropsWithoutRef<typeof Primitive.h2>;
88
+ interface DialogTitleProps extends PrimitiveHeading2Props {
77
89
  }
78
- export const DialogTitle: React.ForwardRefExoticComponent<DialogTitleProps & React.RefAttributes<HTMLHeadingElement>>;
79
- type PrimitiveParagraphProps = Radix.ComponentPropsWithoutRef<typeof Primitive.p>;
80
- export interface DialogDescriptionProps extends PrimitiveParagraphProps {
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
- export const DialogDescription: React.ForwardRefExoticComponent<DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>>;
83
- export interface DialogCloseProps extends PrimitiveButtonProps {
94
+ declare const DialogDescription: React.ForwardRefExoticComponent<DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>>;
95
+ interface DialogCloseProps extends PrimitiveButtonProps {
84
96
  }
85
- export const DialogClose: React.ForwardRefExoticComponent<DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
86
- export const WarningProvider: {
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
- export const Root: React.FC<DialogProps>;
97
- export const Trigger: React.ForwardRefExoticComponent<DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
98
- export const Portal: React.FC<DialogPortalProps>;
99
- export const Overlay: React.ForwardRefExoticComponent<DialogOverlayProps & React.RefAttributes<HTMLDivElement>>;
100
- export const Content: React.ForwardRefExoticComponent<DialogContentProps & React.RefAttributes<HTMLDivElement>>;
101
- export const Title: React.ForwardRefExoticComponent<DialogTitleProps & React.RefAttributes<HTMLHeadingElement>>;
102
- export const Description: React.ForwardRefExoticComponent<DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>>;
103
- export const Close: React.ForwardRefExoticComponent<DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
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
- //# sourceMappingURL=index.d.ts.map
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 };