@react-types/dialog 3.5.24 → 3.6.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.
Files changed (2) hide show
  1. package/package.json +7 -5
  2. package/src/index.d.ts +2 -90
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-types/dialog",
3
- "version": "3.5.24",
3
+ "version": "3.6.0",
4
4
  "description": "Spectrum UI components in React",
5
5
  "license": "Apache-2.0",
6
6
  "types": "src/index.d.ts",
@@ -9,14 +9,16 @@
9
9
  "url": "https://github.com/adobe/react-spectrum"
10
10
  },
11
11
  "dependencies": {
12
- "@react-types/overlays": "^3.9.4",
13
- "@react-types/shared": "^3.33.1"
12
+ "@react-aria/dialog": "^3.6.0",
13
+ "@react-spectrum/dialog": "^3.10.0"
14
14
  },
15
15
  "peerDependencies": {
16
- "react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1"
16
+ "@react-spectrum/provider": "^3.0.0",
17
+ "react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1",
18
+ "react-dom": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1"
17
19
  },
18
20
  "publishConfig": {
19
21
  "access": "public"
20
22
  },
21
- "gitHead": "8df187370053aa35f553cb388ad670f65e1ab371"
23
+ "gitHead": "a6999bdf494a2e9c0381a5881908328bdd22ddae"
22
24
  }
package/src/index.d.ts CHANGED
@@ -10,93 +10,5 @@
10
10
  * governing permissions and limitations under the License.
11
11
  */
12
12
 
13
- import {AriaLabelingProps, DOMProps, RefObject, StyleProps} from '@react-types/shared';
14
- import {OverlayTriggerProps, PositionProps} from '@react-types/overlays';
15
- import {ReactElement, ReactNode} from 'react';
16
-
17
- export type SpectrumDialogClose = (close: () => void) => ReactElement;
18
-
19
- export interface SpectrumDialogTriggerProps extends OverlayTriggerProps, PositionProps {
20
- /** The Dialog and its trigger element. See the DialogTrigger [Content section](#content) for more information on what to provide as children. */
21
- children: [ReactElement, SpectrumDialogClose | ReactElement],
22
- /**
23
- * The type of Dialog that should be rendered. See the DialogTrigger [types section](#dialog-types) for an explanation on each.
24
- * @default 'modal'
25
- */
26
- type?: 'modal' | 'popover' | 'tray' | 'fullscreen' | 'fullscreenTakeover',
27
- /** The type of Dialog that should be rendered when on a mobile device. See DialogTrigger [types section](#dialog-types) for an explanation on each. */
28
- mobileType?: 'modal' | 'tray' | 'fullscreen' | 'fullscreenTakeover',
29
- /**
30
- * Whether a popover type Dialog's arrow should be hidden.
31
- */
32
- hideArrow?: boolean,
33
- /** The ref of the element the Dialog should visually attach itself to. Defaults to the trigger button if not defined. */
34
- targetRef?: RefObject<HTMLElement | null>,
35
- /** Whether a modal type Dialog should be dismissable. */
36
- isDismissable?: boolean,
37
- /** Whether pressing the escape key to close the dialog should be disabled. */
38
- isKeyboardDismissDisabled?: boolean
39
- }
40
-
41
- export interface SpectrumDialogContainerProps {
42
- /** The Dialog to display, if any. */
43
- children: ReactNode,
44
- /** Handler that is called when the 'x' button of a dismissable Dialog is clicked. */
45
- onDismiss: () => void,
46
- /**
47
- * The type of Dialog that should be rendered. See the visual options below for examples of each.
48
- * @default 'modal'
49
- */
50
- type?: 'modal' | 'fullscreen' | 'fullscreenTakeover',
51
- /** Whether the Dialog is dismissable. See the [Dialog docs](Dialog.html#dismissable-dialogs) for more details. */
52
- isDismissable?: boolean,
53
- /** Whether pressing the escape key to close the dialog should be disabled. */
54
- isKeyboardDismissDisabled?: boolean
55
- }
56
-
57
- export interface AriaDialogProps extends DOMProps, AriaLabelingProps {
58
- /**
59
- * The accessibility role for the dialog.
60
- * @default 'dialog'
61
- */
62
- role?: 'dialog' | 'alertdialog'
63
- }
64
-
65
- export interface SpectrumDialogProps extends AriaDialogProps, StyleProps {
66
- /** The contents of the Dialog. */
67
- children: ReactNode,
68
- /** The size of the Dialog. Only applies to "modal" type Dialogs. */
69
- size?: 'S' | 'M' | 'L',
70
- /** Whether the Dialog is dismissable. See the [examples](#examples) for more details. */
71
- isDismissable?: boolean,
72
- /** Handler that is called when the 'x' button of a dismissable Dialog is clicked. */
73
- onDismiss?: () => void
74
- }
75
-
76
- export interface SpectrumAlertDialogProps extends DOMProps, StyleProps {
77
- /** The [visual style](https://spectrum.adobe.com/page/alert-dialog/#Options) of the AlertDialog. */
78
- variant?: 'confirmation' | 'information' | 'destructive' | 'error' | 'warning',
79
- /** The title of the AlertDialog. */
80
- title: string,
81
- /** The contents of the AlertDialog. */
82
- children: ReactNode,
83
- /** The label to display within the cancel button. */
84
- cancelLabel?: string,
85
- /** The label to display within the confirm button. */
86
- primaryActionLabel: string,
87
- /** The label to display within the secondary button. */
88
- secondaryActionLabel?: string,
89
- /** Whether the primary button is disabled. */
90
- isPrimaryActionDisabled?: boolean,
91
- /** Whether the secondary button is disabled. */
92
- isSecondaryActionDisabled?: boolean,
93
- /** Handler that is called when the cancel button is pressed. */
94
- onCancel?: () => void,
95
- /** Handler that is called when the primary button is pressed. */
96
- onPrimaryAction?: () => void,
97
- /** Handler that is called when the secondary button is pressed. */
98
- onSecondaryAction?: () => void,
99
- /** Button to focus by default when the dialog opens. */
100
- autoFocusButton?: 'cancel' | 'primary' | 'secondary'
101
- // allowsKeyboardConfirmation?: boolean, // triggers primary action
102
- }
13
+ export {AriaDialogProps} from '@react-aria/dialog';
14
+ export {SpectrumDialogClose, SpectrumDialogTriggerProps, SpectrumDialogContainerProps, SpectrumDialogProps, SpectrumAlertDialogProps} from '@react-spectrum/dialog';