@radix-ui/react-alert-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.mjs CHANGED
@@ -1,193 +1,169 @@
1
- import $4k4D0$babelruntimehelpersesmextends from "@babel/runtime/helpers/esm/extends";
2
- import {createElement as $4k4D0$createElement, forwardRef as $4k4D0$forwardRef, useRef as $4k4D0$useRef, useEffect as $4k4D0$useEffect} from "react";
3
- import {createContextScope as $4k4D0$createContextScope} from "@radix-ui/react-context";
4
- import {useComposedRefs as $4k4D0$useComposedRefs} from "@radix-ui/react-compose-refs";
5
- import {createDialogScope as $4k4D0$createDialogScope, Root as $4k4D0$Root, Trigger as $4k4D0$Trigger, Portal as $4k4D0$Portal, Overlay as $4k4D0$Overlay, WarningProvider as $4k4D0$WarningProvider, Content as $4k4D0$Content, Title as $4k4D0$Title, Description as $4k4D0$Description, Close as $4k4D0$Close} from "@radix-ui/react-dialog";
6
- import {composeEventHandlers as $4k4D0$composeEventHandlers} from "@radix-ui/primitive";
7
- import {Slottable as $4k4D0$Slottable} from "@radix-ui/react-slot";
8
-
9
-
10
-
11
-
12
-
13
-
14
-
15
-
16
-
17
- /* -------------------------------------------------------------------------------------------------
18
- * AlertDialog
19
- * -----------------------------------------------------------------------------------------------*/ const $905f4ae918aab1aa$var$ROOT_NAME = 'AlertDialog';
20
- const [$905f4ae918aab1aa$var$createAlertDialogContext, $905f4ae918aab1aa$export$b8891880751c2c5b] = $4k4D0$createContextScope($905f4ae918aab1aa$var$ROOT_NAME, [
21
- $4k4D0$createDialogScope
1
+ "use client";
2
+
3
+ // packages/react/alert-dialog/src/AlertDialog.tsx
4
+ import * as React from "react";
5
+ import { createContextScope } from "@radix-ui/react-context";
6
+ import { useComposedRefs } from "@radix-ui/react-compose-refs";
7
+ import * as DialogPrimitive from "@radix-ui/react-dialog";
8
+ import { createDialogScope } from "@radix-ui/react-dialog";
9
+ import { composeEventHandlers } from "@radix-ui/primitive";
10
+ import { Slottable } from "@radix-ui/react-slot";
11
+ import { jsx, jsxs } from "react/jsx-runtime";
12
+ var ROOT_NAME = "AlertDialog";
13
+ var [createAlertDialogContext, createAlertDialogScope] = createContextScope(ROOT_NAME, [
14
+ createDialogScope
22
15
  ]);
23
- const $905f4ae918aab1aa$var$useDialogScope = $4k4D0$createDialogScope();
24
- const $905f4ae918aab1aa$export$de466dd8317b0b75 = (props)=>{
25
- const { __scopeAlertDialog: __scopeAlertDialog , ...alertDialogProps } = props;
26
- const dialogScope = $905f4ae918aab1aa$var$useDialogScope(__scopeAlertDialog);
27
- return /*#__PURE__*/ $4k4D0$createElement($4k4D0$Root, $4k4D0$babelruntimehelpersesmextends({}, dialogScope, alertDialogProps, {
28
- modal: true
29
- }));
16
+ var useDialogScope = createDialogScope();
17
+ var AlertDialog = (props) => {
18
+ const { __scopeAlertDialog, ...alertDialogProps } = props;
19
+ const dialogScope = useDialogScope(__scopeAlertDialog);
20
+ return /* @__PURE__ */ jsx(DialogPrimitive.Root, { ...dialogScope, ...alertDialogProps, modal: true });
30
21
  };
31
- /*#__PURE__*/ Object.assign($905f4ae918aab1aa$export$de466dd8317b0b75, {
32
- displayName: $905f4ae918aab1aa$var$ROOT_NAME
33
- });
34
- /* -------------------------------------------------------------------------------------------------
35
- * AlertDialogTrigger
36
- * -----------------------------------------------------------------------------------------------*/ const $905f4ae918aab1aa$var$TRIGGER_NAME = 'AlertDialogTrigger';
37
- const $905f4ae918aab1aa$export$6edd7a623ef0f40b = /*#__PURE__*/ $4k4D0$forwardRef((props, forwardedRef)=>{
38
- const { __scopeAlertDialog: __scopeAlertDialog , ...triggerProps } = props;
39
- const dialogScope = $905f4ae918aab1aa$var$useDialogScope(__scopeAlertDialog);
40
- return /*#__PURE__*/ $4k4D0$createElement($4k4D0$Trigger, $4k4D0$babelruntimehelpersesmextends({}, dialogScope, triggerProps, {
41
- ref: forwardedRef
42
- }));
43
- });
44
- /*#__PURE__*/ Object.assign($905f4ae918aab1aa$export$6edd7a623ef0f40b, {
45
- displayName: $905f4ae918aab1aa$var$TRIGGER_NAME
46
- });
47
- /* -------------------------------------------------------------------------------------------------
48
- * AlertDialogPortal
49
- * -----------------------------------------------------------------------------------------------*/ const $905f4ae918aab1aa$var$PORTAL_NAME = 'AlertDialogPortal';
50
- const $905f4ae918aab1aa$export$660f2bfdb986706c = (props)=>{
51
- const { __scopeAlertDialog: __scopeAlertDialog , ...portalProps } = props;
52
- const dialogScope = $905f4ae918aab1aa$var$useDialogScope(__scopeAlertDialog);
53
- return /*#__PURE__*/ $4k4D0$createElement($4k4D0$Portal, $4k4D0$babelruntimehelpersesmextends({}, dialogScope, portalProps));
22
+ AlertDialog.displayName = ROOT_NAME;
23
+ var TRIGGER_NAME = "AlertDialogTrigger";
24
+ var AlertDialogTrigger = React.forwardRef(
25
+ (props, forwardedRef) => {
26
+ const { __scopeAlertDialog, ...triggerProps } = props;
27
+ const dialogScope = useDialogScope(__scopeAlertDialog);
28
+ return /* @__PURE__ */ jsx(DialogPrimitive.Trigger, { ...dialogScope, ...triggerProps, ref: forwardedRef });
29
+ }
30
+ );
31
+ AlertDialogTrigger.displayName = TRIGGER_NAME;
32
+ var PORTAL_NAME = "AlertDialogPortal";
33
+ var AlertDialogPortal = (props) => {
34
+ const { __scopeAlertDialog, ...portalProps } = props;
35
+ const dialogScope = useDialogScope(__scopeAlertDialog);
36
+ return /* @__PURE__ */ jsx(DialogPrimitive.Portal, { ...dialogScope, ...portalProps });
54
37
  };
55
- /*#__PURE__*/ Object.assign($905f4ae918aab1aa$export$660f2bfdb986706c, {
56
- displayName: $905f4ae918aab1aa$var$PORTAL_NAME
57
- });
58
- /* -------------------------------------------------------------------------------------------------
59
- * AlertDialogOverlay
60
- * -----------------------------------------------------------------------------------------------*/ const $905f4ae918aab1aa$var$OVERLAY_NAME = 'AlertDialogOverlay';
61
- const $905f4ae918aab1aa$export$a707a4895ce23256 = /*#__PURE__*/ $4k4D0$forwardRef((props, forwardedRef)=>{
62
- const { __scopeAlertDialog: __scopeAlertDialog , ...overlayProps } = props;
63
- const dialogScope = $905f4ae918aab1aa$var$useDialogScope(__scopeAlertDialog);
64
- return /*#__PURE__*/ $4k4D0$createElement($4k4D0$Overlay, $4k4D0$babelruntimehelpersesmextends({}, dialogScope, overlayProps, {
65
- ref: forwardedRef
66
- }));
67
- });
68
- /*#__PURE__*/ Object.assign($905f4ae918aab1aa$export$a707a4895ce23256, {
69
- displayName: $905f4ae918aab1aa$var$OVERLAY_NAME
70
- });
71
- /* -------------------------------------------------------------------------------------------------
72
- * AlertDialogContent
73
- * -----------------------------------------------------------------------------------------------*/ const $905f4ae918aab1aa$var$CONTENT_NAME = 'AlertDialogContent';
74
- const [$905f4ae918aab1aa$var$AlertDialogContentProvider, $905f4ae918aab1aa$var$useAlertDialogContentContext] = $905f4ae918aab1aa$var$createAlertDialogContext($905f4ae918aab1aa$var$CONTENT_NAME);
75
- const $905f4ae918aab1aa$export$94e6af45f0af4efd = /*#__PURE__*/ $4k4D0$forwardRef((props, forwardedRef)=>{
76
- const { __scopeAlertDialog: __scopeAlertDialog , children: children , ...contentProps } = props;
77
- const dialogScope = $905f4ae918aab1aa$var$useDialogScope(__scopeAlertDialog);
78
- const contentRef = $4k4D0$useRef(null);
79
- const composedRefs = $4k4D0$useComposedRefs(forwardedRef, contentRef);
80
- const cancelRef = $4k4D0$useRef(null);
81
- return /*#__PURE__*/ $4k4D0$createElement($4k4D0$WarningProvider, {
82
- contentName: $905f4ae918aab1aa$var$CONTENT_NAME,
83
- titleName: $905f4ae918aab1aa$var$TITLE_NAME,
84
- docsSlug: "alert-dialog"
85
- }, /*#__PURE__*/ $4k4D0$createElement($905f4ae918aab1aa$var$AlertDialogContentProvider, {
86
- scope: __scopeAlertDialog,
87
- cancelRef: cancelRef
88
- }, /*#__PURE__*/ $4k4D0$createElement($4k4D0$Content, $4k4D0$babelruntimehelpersesmextends({
89
- role: "alertdialog"
90
- }, dialogScope, contentProps, {
91
- ref: composedRefs,
92
- onOpenAutoFocus: $4k4D0$composeEventHandlers(contentProps.onOpenAutoFocus, (event)=>{
93
- var _cancelRef$current;
94
- event.preventDefault();
95
- (_cancelRef$current = cancelRef.current) === null || _cancelRef$current === void 0 || _cancelRef$current.focus({
96
- preventScroll: true
97
- });
98
- }),
99
- onPointerDownOutside: (event)=>event.preventDefault()
100
- ,
101
- onInteractOutside: (event)=>event.preventDefault()
102
- }), /*#__PURE__*/ $4k4D0$createElement($4k4D0$Slottable, null, children), false)));
103
- });
104
- /*#__PURE__*/ Object.assign($905f4ae918aab1aa$export$94e6af45f0af4efd, {
105
- displayName: $905f4ae918aab1aa$var$CONTENT_NAME
106
- });
107
- /* -------------------------------------------------------------------------------------------------
108
- * AlertDialogTitle
109
- * -----------------------------------------------------------------------------------------------*/ const $905f4ae918aab1aa$var$TITLE_NAME = 'AlertDialogTitle';
110
- const $905f4ae918aab1aa$export$225e0da62d314b7 = /*#__PURE__*/ $4k4D0$forwardRef((props, forwardedRef)=>{
111
- const { __scopeAlertDialog: __scopeAlertDialog , ...titleProps } = props;
112
- const dialogScope = $905f4ae918aab1aa$var$useDialogScope(__scopeAlertDialog);
113
- return /*#__PURE__*/ $4k4D0$createElement($4k4D0$Title, $4k4D0$babelruntimehelpersesmextends({}, dialogScope, titleProps, {
114
- ref: forwardedRef
115
- }));
116
- });
117
- /*#__PURE__*/ Object.assign($905f4ae918aab1aa$export$225e0da62d314b7, {
118
- displayName: $905f4ae918aab1aa$var$TITLE_NAME
119
- });
120
- /* -------------------------------------------------------------------------------------------------
121
- * AlertDialogDescription
122
- * -----------------------------------------------------------------------------------------------*/ const $905f4ae918aab1aa$var$DESCRIPTION_NAME = 'AlertDialogDescription';
123
- const $905f4ae918aab1aa$export$a23b55cde55ad9a5 = /*#__PURE__*/ $4k4D0$forwardRef((props, forwardedRef)=>{
124
- const { __scopeAlertDialog: __scopeAlertDialog , ...descriptionProps } = props;
125
- const dialogScope = $905f4ae918aab1aa$var$useDialogScope(__scopeAlertDialog);
126
- return /*#__PURE__*/ $4k4D0$createElement($4k4D0$Description, $4k4D0$babelruntimehelpersesmextends({}, dialogScope, descriptionProps, {
127
- ref: forwardedRef
128
- }));
129
- });
130
- /*#__PURE__*/ Object.assign($905f4ae918aab1aa$export$a23b55cde55ad9a5, {
131
- displayName: $905f4ae918aab1aa$var$DESCRIPTION_NAME
132
- });
133
- /* -------------------------------------------------------------------------------------------------
134
- * AlertDialogAction
135
- * -----------------------------------------------------------------------------------------------*/ const $905f4ae918aab1aa$var$ACTION_NAME = 'AlertDialogAction';
136
- const $905f4ae918aab1aa$export$b454f818c58ee85d = /*#__PURE__*/ $4k4D0$forwardRef((props, forwardedRef)=>{
137
- const { __scopeAlertDialog: __scopeAlertDialog , ...actionProps } = props;
138
- const dialogScope = $905f4ae918aab1aa$var$useDialogScope(__scopeAlertDialog);
139
- return /*#__PURE__*/ $4k4D0$createElement($4k4D0$Close, $4k4D0$babelruntimehelpersesmextends({}, dialogScope, actionProps, {
140
- ref: forwardedRef
141
- }));
142
- });
143
- /*#__PURE__*/ Object.assign($905f4ae918aab1aa$export$b454f818c58ee85d, {
144
- displayName: $905f4ae918aab1aa$var$ACTION_NAME
145
- });
146
- /* -------------------------------------------------------------------------------------------------
147
- * AlertDialogCancel
148
- * -----------------------------------------------------------------------------------------------*/ const $905f4ae918aab1aa$var$CANCEL_NAME = 'AlertDialogCancel';
149
- const $905f4ae918aab1aa$export$2f67a923571aaea0 = /*#__PURE__*/ $4k4D0$forwardRef((props, forwardedRef)=>{
150
- const { __scopeAlertDialog: __scopeAlertDialog , ...cancelProps } = props;
151
- const { cancelRef: cancelRef } = $905f4ae918aab1aa$var$useAlertDialogContentContext($905f4ae918aab1aa$var$CANCEL_NAME, __scopeAlertDialog);
152
- const dialogScope = $905f4ae918aab1aa$var$useDialogScope(__scopeAlertDialog);
153
- const ref = $4k4D0$useComposedRefs(forwardedRef, cancelRef);
154
- return /*#__PURE__*/ $4k4D0$createElement($4k4D0$Close, $4k4D0$babelruntimehelpersesmextends({}, dialogScope, cancelProps, {
155
- ref: ref
156
- }));
157
- });
158
- /*#__PURE__*/ Object.assign($905f4ae918aab1aa$export$2f67a923571aaea0, {
159
- displayName: $905f4ae918aab1aa$var$CANCEL_NAME
160
- });
161
- /* ---------------------------------------------------------------------------------------------- */ const $905f4ae918aab1aa$var$DescriptionWarning = ({ contentRef: contentRef })=>{
162
- const MESSAGE = `\`${$905f4ae918aab1aa$var$CONTENT_NAME}\` requires a description for the component to be accessible for screen reader users.
163
-
164
- You can add a description to the \`${$905f4ae918aab1aa$var$CONTENT_NAME}\` by passing a \`${$905f4ae918aab1aa$var$DESCRIPTION_NAME}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
165
-
166
- Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${$905f4ae918aab1aa$var$CONTENT_NAME}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
38
+ AlertDialogPortal.displayName = PORTAL_NAME;
39
+ var OVERLAY_NAME = "AlertDialogOverlay";
40
+ var AlertDialogOverlay = React.forwardRef(
41
+ (props, forwardedRef) => {
42
+ const { __scopeAlertDialog, ...overlayProps } = props;
43
+ const dialogScope = useDialogScope(__scopeAlertDialog);
44
+ return /* @__PURE__ */ jsx(DialogPrimitive.Overlay, { ...dialogScope, ...overlayProps, ref: forwardedRef });
45
+ }
46
+ );
47
+ AlertDialogOverlay.displayName = OVERLAY_NAME;
48
+ var CONTENT_NAME = "AlertDialogContent";
49
+ var [AlertDialogContentProvider, useAlertDialogContentContext] = createAlertDialogContext(CONTENT_NAME);
50
+ var AlertDialogContent = React.forwardRef(
51
+ (props, forwardedRef) => {
52
+ const { __scopeAlertDialog, children, ...contentProps } = props;
53
+ const dialogScope = useDialogScope(__scopeAlertDialog);
54
+ const contentRef = React.useRef(null);
55
+ const composedRefs = useComposedRefs(forwardedRef, contentRef);
56
+ const cancelRef = React.useRef(null);
57
+ return /* @__PURE__ */ jsx(
58
+ DialogPrimitive.WarningProvider,
59
+ {
60
+ contentName: CONTENT_NAME,
61
+ titleName: TITLE_NAME,
62
+ docsSlug: "alert-dialog",
63
+ children: /* @__PURE__ */ jsx(AlertDialogContentProvider, { scope: __scopeAlertDialog, cancelRef, children: /* @__PURE__ */ jsxs(
64
+ DialogPrimitive.Content,
65
+ {
66
+ role: "alertdialog",
67
+ ...dialogScope,
68
+ ...contentProps,
69
+ ref: composedRefs,
70
+ onOpenAutoFocus: composeEventHandlers(contentProps.onOpenAutoFocus, (event) => {
71
+ event.preventDefault();
72
+ cancelRef.current?.focus({ preventScroll: true });
73
+ }),
74
+ onPointerDownOutside: (event) => event.preventDefault(),
75
+ onInteractOutside: (event) => event.preventDefault(),
76
+ children: [
77
+ /* @__PURE__ */ jsx(Slottable, { children }),
78
+ /* @__PURE__ */ jsx(DescriptionWarning, { contentRef })
79
+ ]
80
+ }
81
+ ) })
82
+ }
83
+ );
84
+ }
85
+ );
86
+ AlertDialogContent.displayName = CONTENT_NAME;
87
+ var TITLE_NAME = "AlertDialogTitle";
88
+ var AlertDialogTitle = React.forwardRef(
89
+ (props, forwardedRef) => {
90
+ const { __scopeAlertDialog, ...titleProps } = props;
91
+ const dialogScope = useDialogScope(__scopeAlertDialog);
92
+ return /* @__PURE__ */ jsx(DialogPrimitive.Title, { ...dialogScope, ...titleProps, ref: forwardedRef });
93
+ }
94
+ );
95
+ AlertDialogTitle.displayName = TITLE_NAME;
96
+ var DESCRIPTION_NAME = "AlertDialogDescription";
97
+ var AlertDialogDescription = React.forwardRef((props, forwardedRef) => {
98
+ const { __scopeAlertDialog, ...descriptionProps } = props;
99
+ const dialogScope = useDialogScope(__scopeAlertDialog);
100
+ return /* @__PURE__ */ jsx(DialogPrimitive.Description, { ...dialogScope, ...descriptionProps, ref: forwardedRef });
101
+ });
102
+ AlertDialogDescription.displayName = DESCRIPTION_NAME;
103
+ var ACTION_NAME = "AlertDialogAction";
104
+ var AlertDialogAction = React.forwardRef(
105
+ (props, forwardedRef) => {
106
+ const { __scopeAlertDialog, ...actionProps } = props;
107
+ const dialogScope = useDialogScope(__scopeAlertDialog);
108
+ return /* @__PURE__ */ jsx(DialogPrimitive.Close, { ...dialogScope, ...actionProps, ref: forwardedRef });
109
+ }
110
+ );
111
+ AlertDialogAction.displayName = ACTION_NAME;
112
+ var CANCEL_NAME = "AlertDialogCancel";
113
+ var AlertDialogCancel = React.forwardRef(
114
+ (props, forwardedRef) => {
115
+ const { __scopeAlertDialog, ...cancelProps } = props;
116
+ const { cancelRef } = useAlertDialogContentContext(CANCEL_NAME, __scopeAlertDialog);
117
+ const dialogScope = useDialogScope(__scopeAlertDialog);
118
+ const ref = useComposedRefs(forwardedRef, cancelRef);
119
+ return /* @__PURE__ */ jsx(DialogPrimitive.Close, { ...dialogScope, ...cancelProps, ref });
120
+ }
121
+ );
122
+ AlertDialogCancel.displayName = CANCEL_NAME;
123
+ var DescriptionWarning = ({ contentRef }) => {
124
+ const MESSAGE = `\`${CONTENT_NAME}\` requires a description for the component to be accessible for screen reader users.
125
+
126
+ You can add a description to the \`${CONTENT_NAME}\` by passing a \`${DESCRIPTION_NAME}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
127
+
128
+ Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${CONTENT_NAME}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
167
129
 
168
130
  For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;
169
- $4k4D0$useEffect(()=>{
170
- var _contentRef$current;
171
- const hasDescription = document.getElementById((_contentRef$current = contentRef.current) === null || _contentRef$current === void 0 ? void 0 : _contentRef$current.getAttribute('aria-describedby'));
172
- if (!hasDescription) console.warn(MESSAGE);
173
- }, [
174
- MESSAGE,
175
- contentRef
176
- ]);
177
- return null;
131
+ React.useEffect(() => {
132
+ const hasDescription = document.getElementById(
133
+ contentRef.current?.getAttribute("aria-describedby")
134
+ );
135
+ if (!hasDescription) console.warn(MESSAGE);
136
+ }, [MESSAGE, contentRef]);
137
+ return null;
138
+ };
139
+ var Root2 = AlertDialog;
140
+ var Trigger2 = AlertDialogTrigger;
141
+ var Portal2 = AlertDialogPortal;
142
+ var Overlay2 = AlertDialogOverlay;
143
+ var Content2 = AlertDialogContent;
144
+ var Action = AlertDialogAction;
145
+ var Cancel = AlertDialogCancel;
146
+ var Title2 = AlertDialogTitle;
147
+ var Description2 = AlertDialogDescription;
148
+ export {
149
+ Action,
150
+ AlertDialog,
151
+ AlertDialogAction,
152
+ AlertDialogCancel,
153
+ AlertDialogContent,
154
+ AlertDialogDescription,
155
+ AlertDialogOverlay,
156
+ AlertDialogPortal,
157
+ AlertDialogTitle,
158
+ AlertDialogTrigger,
159
+ Cancel,
160
+ Content2 as Content,
161
+ Description2 as Description,
162
+ Overlay2 as Overlay,
163
+ Portal2 as Portal,
164
+ Root2 as Root,
165
+ Title2 as Title,
166
+ Trigger2 as Trigger,
167
+ createAlertDialogScope
178
168
  };
179
- const $905f4ae918aab1aa$export$be92b6f5f03c0fe9 = $905f4ae918aab1aa$export$de466dd8317b0b75;
180
- const $905f4ae918aab1aa$export$41fb9f06171c75f4 = $905f4ae918aab1aa$export$6edd7a623ef0f40b;
181
- const $905f4ae918aab1aa$export$602eac185826482c = $905f4ae918aab1aa$export$660f2bfdb986706c;
182
- const $905f4ae918aab1aa$export$c6fdb837b070b4ff = $905f4ae918aab1aa$export$a707a4895ce23256;
183
- const $905f4ae918aab1aa$export$7c6e2c02157bb7d2 = $905f4ae918aab1aa$export$94e6af45f0af4efd;
184
- const $905f4ae918aab1aa$export$e19cd5f9376f8cee = $905f4ae918aab1aa$export$b454f818c58ee85d;
185
- const $905f4ae918aab1aa$export$848c9b7ead0df967 = $905f4ae918aab1aa$export$2f67a923571aaea0;
186
- const $905f4ae918aab1aa$export$f99233281efd08a0 = $905f4ae918aab1aa$export$225e0da62d314b7;
187
- const $905f4ae918aab1aa$export$393edc798c47379d = $905f4ae918aab1aa$export$a23b55cde55ad9a5;
188
-
189
-
190
-
191
-
192
- export {$905f4ae918aab1aa$export$b8891880751c2c5b as createAlertDialogScope, $905f4ae918aab1aa$export$de466dd8317b0b75 as AlertDialog, $905f4ae918aab1aa$export$6edd7a623ef0f40b as AlertDialogTrigger, $905f4ae918aab1aa$export$660f2bfdb986706c as AlertDialogPortal, $905f4ae918aab1aa$export$a707a4895ce23256 as AlertDialogOverlay, $905f4ae918aab1aa$export$94e6af45f0af4efd as AlertDialogContent, $905f4ae918aab1aa$export$b454f818c58ee85d as AlertDialogAction, $905f4ae918aab1aa$export$2f67a923571aaea0 as AlertDialogCancel, $905f4ae918aab1aa$export$225e0da62d314b7 as AlertDialogTitle, $905f4ae918aab1aa$export$a23b55cde55ad9a5 as AlertDialogDescription, $905f4ae918aab1aa$export$be92b6f5f03c0fe9 as Root, $905f4ae918aab1aa$export$41fb9f06171c75f4 as Trigger, $905f4ae918aab1aa$export$602eac185826482c as Portal, $905f4ae918aab1aa$export$c6fdb837b070b4ff as Overlay, $905f4ae918aab1aa$export$7c6e2c02157bb7d2 as Content, $905f4ae918aab1aa$export$e19cd5f9376f8cee as Action, $905f4ae918aab1aa$export$848c9b7ead0df967 as Cancel, $905f4ae918aab1aa$export$f99233281efd08a0 as Title, $905f4ae918aab1aa$export$393edc798c47379d as Description};
193
169
  //# sourceMappingURL=index.mjs.map
@@ -1 +1,7 @@
1
- {"mappings":";;;;;;;;A;;;;;;;;ACWA;;oGAEA,CAEA,MAAM0B,+BAAS,GAAG,aAAlB,AAAA;AAGA,MAAM,CAACC,8CAAD,EAA2B3B,yCAA3B,CAAA,GAAqDoB,yBAAkB,CAACM,+BAAD,EAAY;IACvFH,wBADuF;CAAZ,CAA7E,AAAA;AAGA,MAAMK,oCAAc,GAAGL,wBAAiB,EAAxC,AAAA;AAKA,MAAMtB,yCAAuC,GAAI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yCAAA,EAAA;IAAA,WAAA,EAAA,iCAAA;CAAA,CAAA,CAAA;AAEA,oGAAA,CAMA,MAAMC,wCAAqD,GAAG,CAAC,E,YAAEtB,UAAAA,CAAAA,EAAH,GAAoB;IAChF,MAAMuB,OAAO,GAAI,CAAA,EAAA,EAAI5B,kCAAa,CAAlC;;mCAEF,EAAqCA,kCAAa,CAAA,kBAAA,EAAoBoB,sCAAiB,CAAvF;;0JAEA,EAA4JpB,kCAAa,CAAzK;;sFAEA,CANE,AAMF;IAEEtB,gBAAA,CAAgB,IAAM;QAAA,IAAA,mBAAA,AAAA;QACpB,MAAMoD,cAAc,GAAGC,QAAQ,CAACC,cAAT,CAAA,AAAA,CAAA,mBAAA,GACrB3B,UAAU,CAACQ,OADU,CAAA,KAAA,IAAA,IAAA,mBAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GACrB,mBAAA,CAAoBoB,YAApB,CAAiC,kBAAjC,CADqB,CAAvB,AAAA;QAGA,IAAI,CAACH,cAAL,EAAqBI,OAAO,CAACC,IAAR,CAAaP,OAAb,CAArB,CAAA;KAJF,EAKG;QAACA,OAAD;QAAUvB,UAAV;KALH,CAKC,CAAA;IAED,OAAO,IAAP,CAAA;CAhBF,AAiBC;AAED,MAAMpC,yCAAI,GAAGT,yCAAb,AAAA;AACA,MAAMU,yCAAO,GAAGT,yCAAhB,AAAA;AACA,MAAMU,yCAAM,GAAGT,yCAAf,AAAA;AACA,MAAMU,yCAAO,GAAGT,yCAAhB,AAAA;AACA,MAAMU,yCAAO,GAAGT,yCAAhB,AAAA;AACA,MAAMU,yCAAM,GAAGT,yCAAf,AAAA;AACA,MAAMU,yCAAM,GAAGT,yCAAf,AAAA;AACA,MAAMU,yCAAK,GAAGT,wCAAd,AAAA;AACA,MAAMU,yCAAW,GAAGT,yCAApB,AAAA;;AD/QA","sources":["packages/react/alert-dialog/src/index.ts","packages/react/alert-dialog/src/AlertDialog.tsx"],"sourcesContent":["export {\n createAlertDialogScope,\n //\n AlertDialog,\n AlertDialogTrigger,\n AlertDialogPortal,\n AlertDialogOverlay,\n AlertDialogContent,\n AlertDialogAction,\n AlertDialogCancel,\n AlertDialogTitle,\n AlertDialogDescription,\n //\n Root,\n Trigger,\n Portal,\n Overlay,\n Content,\n Action,\n Cancel,\n Title,\n Description,\n} from './AlertDialog';\nexport type {\n AlertDialogProps,\n AlertDialogTriggerProps,\n AlertDialogPortalProps,\n AlertDialogOverlayProps,\n AlertDialogContentProps,\n AlertDialogActionProps,\n AlertDialogCancelProps,\n AlertDialogTitleProps,\n AlertDialogDescriptionProps,\n} from './AlertDialog';\n","import * as React from 'react';\nimport { createContextScope } from '@radix-ui/react-context';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport * as DialogPrimitive from '@radix-ui/react-dialog';\nimport { createDialogScope } from '@radix-ui/react-dialog';\nimport { composeEventHandlers } from '@radix-ui/primitive';\nimport { Slottable } from '@radix-ui/react-slot';\n\nimport type * as Radix from '@radix-ui/react-primitive';\nimport type { Scope } from '@radix-ui/react-context';\n\n/* -------------------------------------------------------------------------------------------------\n * AlertDialog\n * -----------------------------------------------------------------------------------------------*/\n\nconst ROOT_NAME = 'AlertDialog';\n\ntype ScopedProps<P> = P & { __scopeAlertDialog?: Scope };\nconst [createAlertDialogContext, createAlertDialogScope] = createContextScope(ROOT_NAME, [\n createDialogScope,\n]);\nconst useDialogScope = createDialogScope();\n\ntype DialogProps = Radix.ComponentPropsWithoutRef<typeof DialogPrimitive.Root>;\ninterface AlertDialogProps extends Omit<DialogProps, 'modal'> {}\n\nconst AlertDialog: React.FC<AlertDialogProps> = (props: ScopedProps<AlertDialogProps>) => {\n const { __scopeAlertDialog, ...alertDialogProps } = props;\n const dialogScope = useDialogScope(__scopeAlertDialog);\n return <DialogPrimitive.Root {...dialogScope} {...alertDialogProps} modal={true} />;\n};\n\nAlertDialog.displayName = ROOT_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * AlertDialogTrigger\n * -----------------------------------------------------------------------------------------------*/\nconst TRIGGER_NAME = 'AlertDialogTrigger';\n\ntype AlertDialogTriggerElement = React.ElementRef<typeof DialogPrimitive.Trigger>;\ntype DialogTriggerProps = Radix.ComponentPropsWithoutRef<typeof DialogPrimitive.Trigger>;\ninterface AlertDialogTriggerProps extends DialogTriggerProps {}\n\nconst AlertDialogTrigger = React.forwardRef<AlertDialogTriggerElement, AlertDialogTriggerProps>(\n (props: ScopedProps<AlertDialogTriggerProps>, forwardedRef) => {\n const { __scopeAlertDialog, ...triggerProps } = props;\n const dialogScope = useDialogScope(__scopeAlertDialog);\n return <DialogPrimitive.Trigger {...dialogScope} {...triggerProps} ref={forwardedRef} />;\n }\n);\n\nAlertDialogTrigger.displayName = TRIGGER_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * AlertDialogPortal\n * -----------------------------------------------------------------------------------------------*/\n\nconst PORTAL_NAME = 'AlertDialogPortal';\n\ntype DialogPortalProps = Radix.ComponentPropsWithoutRef<typeof DialogPrimitive.Portal>;\ninterface AlertDialogPortalProps extends DialogPortalProps {}\n\nconst AlertDialogPortal: React.FC<AlertDialogPortalProps> = (\n props: ScopedProps<AlertDialogPortalProps>\n) => {\n const { __scopeAlertDialog, ...portalProps } = props;\n const dialogScope = useDialogScope(__scopeAlertDialog);\n return <DialogPrimitive.Portal {...dialogScope} {...portalProps} />;\n};\n\nAlertDialogPortal.displayName = PORTAL_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * AlertDialogOverlay\n * -----------------------------------------------------------------------------------------------*/\n\nconst OVERLAY_NAME = 'AlertDialogOverlay';\n\ntype AlertDialogOverlayElement = React.ElementRef<typeof DialogPrimitive.Overlay>;\ntype DialogOverlayProps = Radix.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>;\ninterface AlertDialogOverlayProps extends DialogOverlayProps {}\n\nconst AlertDialogOverlay = React.forwardRef<AlertDialogOverlayElement, AlertDialogOverlayProps>(\n (props: ScopedProps<AlertDialogOverlayProps>, forwardedRef) => {\n const { __scopeAlertDialog, ...overlayProps } = props;\n const dialogScope = useDialogScope(__scopeAlertDialog);\n return <DialogPrimitive.Overlay {...dialogScope} {...overlayProps} ref={forwardedRef} />;\n }\n);\n\nAlertDialogOverlay.displayName = OVERLAY_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * AlertDialogContent\n * -----------------------------------------------------------------------------------------------*/\n\nconst CONTENT_NAME = 'AlertDialogContent';\n\ntype AlertDialogContentContextValue = {\n cancelRef: React.MutableRefObject<AlertDialogCancelElement | null>;\n};\n\nconst [AlertDialogContentProvider, useAlertDialogContentContext] =\n createAlertDialogContext<AlertDialogContentContextValue>(CONTENT_NAME);\n\ntype AlertDialogContentElement = React.ElementRef<typeof DialogPrimitive.Content>;\ntype DialogContentProps = Radix.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>;\ninterface AlertDialogContentProps\n extends Omit<DialogContentProps, 'onPointerDownOutside' | 'onInteractOutside'> {}\n\nconst AlertDialogContent = React.forwardRef<AlertDialogContentElement, AlertDialogContentProps>(\n (props: ScopedProps<AlertDialogContentProps>, forwardedRef) => {\n const { __scopeAlertDialog, children, ...contentProps } = props;\n const dialogScope = useDialogScope(__scopeAlertDialog);\n const contentRef = React.useRef<AlertDialogContentElement>(null);\n const composedRefs = useComposedRefs(forwardedRef, contentRef);\n const cancelRef = React.useRef<AlertDialogCancelElement | null>(null);\n\n return (\n <DialogPrimitive.WarningProvider\n contentName={CONTENT_NAME}\n titleName={TITLE_NAME}\n docsSlug=\"alert-dialog\"\n >\n <AlertDialogContentProvider scope={__scopeAlertDialog} cancelRef={cancelRef}>\n <DialogPrimitive.Content\n role=\"alertdialog\"\n {...dialogScope}\n {...contentProps}\n ref={composedRefs}\n onOpenAutoFocus={composeEventHandlers(contentProps.onOpenAutoFocus, (event) => {\n event.preventDefault();\n cancelRef.current?.focus({ preventScroll: true });\n })}\n onPointerDownOutside={(event) => event.preventDefault()}\n onInteractOutside={(event) => event.preventDefault()}\n >\n {/**\n * We have to use `Slottable` here as we cannot wrap the `AlertDialogContentProvider`\n * around everything, otherwise the `DescriptionWarning` would be rendered straight away.\n * This is because we want the accessibility checks to run only once the content is actually\n * open and that behaviour is already encapsulated in `DialogContent`.\n */}\n <Slottable>{children}</Slottable>\n {process.env.NODE_ENV === 'development' && (\n <DescriptionWarning contentRef={contentRef} />\n )}\n </DialogPrimitive.Content>\n </AlertDialogContentProvider>\n </DialogPrimitive.WarningProvider>\n );\n }\n);\n\nAlertDialogContent.displayName = CONTENT_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * AlertDialogTitle\n * -----------------------------------------------------------------------------------------------*/\n\nconst TITLE_NAME = 'AlertDialogTitle';\n\ntype AlertDialogTitleElement = React.ElementRef<typeof DialogPrimitive.Title>;\ntype DialogTitleProps = Radix.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>;\ninterface AlertDialogTitleProps extends DialogTitleProps {}\n\nconst AlertDialogTitle = React.forwardRef<AlertDialogTitleElement, AlertDialogTitleProps>(\n (props: ScopedProps<AlertDialogTitleProps>, forwardedRef) => {\n const { __scopeAlertDialog, ...titleProps } = props;\n const dialogScope = useDialogScope(__scopeAlertDialog);\n return <DialogPrimitive.Title {...dialogScope} {...titleProps} ref={forwardedRef} />;\n }\n);\n\nAlertDialogTitle.displayName = TITLE_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * AlertDialogDescription\n * -----------------------------------------------------------------------------------------------*/\n\nconst DESCRIPTION_NAME = 'AlertDialogDescription';\n\ntype AlertDialogDescriptionElement = React.ElementRef<typeof DialogPrimitive.Description>;\ntype DialogDescriptionProps = Radix.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>;\ninterface AlertDialogDescriptionProps extends DialogDescriptionProps {}\n\nconst AlertDialogDescription = React.forwardRef<\n AlertDialogDescriptionElement,\n AlertDialogDescriptionProps\n>((props: ScopedProps<AlertDialogDescriptionProps>, forwardedRef) => {\n const { __scopeAlertDialog, ...descriptionProps } = props;\n const dialogScope = useDialogScope(__scopeAlertDialog);\n return <DialogPrimitive.Description {...dialogScope} {...descriptionProps} ref={forwardedRef} />;\n});\n\nAlertDialogDescription.displayName = DESCRIPTION_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * AlertDialogAction\n * -----------------------------------------------------------------------------------------------*/\n\nconst ACTION_NAME = 'AlertDialogAction';\n\ntype AlertDialogActionElement = React.ElementRef<typeof DialogPrimitive.Close>;\ntype DialogCloseProps = Radix.ComponentPropsWithoutRef<typeof DialogPrimitive.Close>;\ninterface AlertDialogActionProps extends DialogCloseProps {}\n\nconst AlertDialogAction = React.forwardRef<AlertDialogActionElement, AlertDialogActionProps>(\n (props: ScopedProps<AlertDialogActionProps>, forwardedRef) => {\n const { __scopeAlertDialog, ...actionProps } = props;\n const dialogScope = useDialogScope(__scopeAlertDialog);\n return <DialogPrimitive.Close {...dialogScope} {...actionProps} ref={forwardedRef} />;\n }\n);\n\nAlertDialogAction.displayName = ACTION_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * AlertDialogCancel\n * -----------------------------------------------------------------------------------------------*/\n\nconst CANCEL_NAME = 'AlertDialogCancel';\n\ntype AlertDialogCancelElement = React.ElementRef<typeof DialogPrimitive.Close>;\ninterface AlertDialogCancelProps extends DialogCloseProps {}\n\nconst AlertDialogCancel = React.forwardRef<AlertDialogCancelElement, AlertDialogCancelProps>(\n (props: ScopedProps<AlertDialogCancelProps>, forwardedRef) => {\n const { __scopeAlertDialog, ...cancelProps } = props;\n const { cancelRef } = useAlertDialogContentContext(CANCEL_NAME, __scopeAlertDialog);\n const dialogScope = useDialogScope(__scopeAlertDialog);\n const ref = useComposedRefs(forwardedRef, cancelRef);\n return <DialogPrimitive.Close {...dialogScope} {...cancelProps} ref={ref} />;\n }\n);\n\nAlertDialogCancel.displayName = CANCEL_NAME;\n\n/* ---------------------------------------------------------------------------------------------- */\n\ntype DescriptionWarningProps = {\n contentRef: React.RefObject<AlertDialogContentElement>;\n};\n\nconst DescriptionWarning: React.FC<DescriptionWarningProps> = ({ contentRef }) => {\n const MESSAGE = `\\`${CONTENT_NAME}\\` requires a description for the component to be accessible for screen reader users.\n\nYou can add a description to the \\`${CONTENT_NAME}\\` by passing a \\`${DESCRIPTION_NAME}\\` component as a child, which also benefits sighted users by adding visible context to the dialog.\n\nAlternatively, you can use your own component as a description by assigning it an \\`id\\` and passing the same value to the \\`aria-describedby\\` prop in \\`${CONTENT_NAME}\\`. If the description is confusing or duplicative for sighted users, you can use the \\`@radix-ui/react-visually-hidden\\` primitive as a wrapper around your description component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;\n\n React.useEffect(() => {\n const hasDescription = document.getElementById(\n contentRef.current?.getAttribute('aria-describedby')!\n );\n if (!hasDescription) console.warn(MESSAGE);\n }, [MESSAGE, contentRef]);\n\n return null;\n};\n\nconst Root = AlertDialog;\nconst Trigger = AlertDialogTrigger;\nconst Portal = AlertDialogPortal;\nconst Overlay = AlertDialogOverlay;\nconst Content = AlertDialogContent;\nconst Action = AlertDialogAction;\nconst Cancel = AlertDialogCancel;\nconst Title = AlertDialogTitle;\nconst Description = AlertDialogDescription;\n\nexport {\n createAlertDialogScope,\n //\n AlertDialog,\n AlertDialogTrigger,\n AlertDialogPortal,\n AlertDialogOverlay,\n AlertDialogContent,\n AlertDialogAction,\n AlertDialogCancel,\n AlertDialogTitle,\n AlertDialogDescription,\n //\n Root,\n Trigger,\n Portal,\n Overlay,\n Content,\n Action,\n Cancel,\n Title,\n Description,\n};\nexport type {\n AlertDialogProps,\n AlertDialogTriggerProps,\n AlertDialogPortalProps,\n AlertDialogOverlayProps,\n AlertDialogContentProps,\n AlertDialogActionProps,\n AlertDialogCancelProps,\n AlertDialogTitleProps,\n AlertDialogDescriptionProps,\n};\n"],"names":["createAlertDialogScope","AlertDialog","AlertDialogTrigger","AlertDialogPortal","AlertDialogOverlay","AlertDialogContent","AlertDialogAction","AlertDialogCancel","AlertDialogTitle","AlertDialogDescription","Root","Trigger","Portal","Overlay","Content","Action","Cancel","Title","Description","React","createContextScope","useComposedRefs","DialogPrimitive","createDialogScope","composeEventHandlers","Slottable","ROOT_NAME","createAlertDialogContext","useDialogScope","props","__scopeAlertDialog","alertDialogProps","dialogScope","TRIGGER_NAME","forwardRef","forwardedRef","triggerProps","PORTAL_NAME","portalProps","OVERLAY_NAME","overlayProps","CONTENT_NAME","AlertDialogContentProvider","useAlertDialogContentContext","children","contentProps","contentRef","useRef","composedRefs","cancelRef","TITLE_NAME","onOpenAutoFocus","event","preventDefault","current","focus","preventScroll","process","env","NODE_ENV","titleProps","DESCRIPTION_NAME","descriptionProps","ACTION_NAME","actionProps","CANCEL_NAME","cancelProps","ref","DescriptionWarning","MESSAGE","useEffect","hasDescription","document","getElementById","getAttribute","console","warn"],"version":3,"file":"index.mjs.map"}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/AlertDialog.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nimport { createContextScope } from '@radix-ui/react-context';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport * as DialogPrimitive from '@radix-ui/react-dialog';\nimport { createDialogScope } from '@radix-ui/react-dialog';\nimport { composeEventHandlers } from '@radix-ui/primitive';\nimport { Slottable } from '@radix-ui/react-slot';\n\nimport type * as Radix from '@radix-ui/react-primitive';\nimport type { Scope } from '@radix-ui/react-context';\n\n/* -------------------------------------------------------------------------------------------------\n * AlertDialog\n * -----------------------------------------------------------------------------------------------*/\n\nconst ROOT_NAME = 'AlertDialog';\n\ntype ScopedProps<P> = P & { __scopeAlertDialog?: Scope };\nconst [createAlertDialogContext, createAlertDialogScope] = createContextScope(ROOT_NAME, [\n createDialogScope,\n]);\nconst useDialogScope = createDialogScope();\n\ntype DialogProps = Radix.ComponentPropsWithoutRef<typeof DialogPrimitive.Root>;\ninterface AlertDialogProps extends Omit<DialogProps, 'modal'> {}\n\nconst AlertDialog: React.FC<AlertDialogProps> = (props: ScopedProps<AlertDialogProps>) => {\n const { __scopeAlertDialog, ...alertDialogProps } = props;\n const dialogScope = useDialogScope(__scopeAlertDialog);\n return <DialogPrimitive.Root {...dialogScope} {...alertDialogProps} modal={true} />;\n};\n\nAlertDialog.displayName = ROOT_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * AlertDialogTrigger\n * -----------------------------------------------------------------------------------------------*/\nconst TRIGGER_NAME = 'AlertDialogTrigger';\n\ntype AlertDialogTriggerElement = React.ElementRef<typeof DialogPrimitive.Trigger>;\ntype DialogTriggerProps = Radix.ComponentPropsWithoutRef<typeof DialogPrimitive.Trigger>;\ninterface AlertDialogTriggerProps extends DialogTriggerProps {}\n\nconst AlertDialogTrigger = React.forwardRef<AlertDialogTriggerElement, AlertDialogTriggerProps>(\n (props: ScopedProps<AlertDialogTriggerProps>, forwardedRef) => {\n const { __scopeAlertDialog, ...triggerProps } = props;\n const dialogScope = useDialogScope(__scopeAlertDialog);\n return <DialogPrimitive.Trigger {...dialogScope} {...triggerProps} ref={forwardedRef} />;\n }\n);\n\nAlertDialogTrigger.displayName = TRIGGER_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * AlertDialogPortal\n * -----------------------------------------------------------------------------------------------*/\n\nconst PORTAL_NAME = 'AlertDialogPortal';\n\ntype DialogPortalProps = Radix.ComponentPropsWithoutRef<typeof DialogPrimitive.Portal>;\ninterface AlertDialogPortalProps extends DialogPortalProps {}\n\nconst AlertDialogPortal: React.FC<AlertDialogPortalProps> = (\n props: ScopedProps<AlertDialogPortalProps>\n) => {\n const { __scopeAlertDialog, ...portalProps } = props;\n const dialogScope = useDialogScope(__scopeAlertDialog);\n return <DialogPrimitive.Portal {...dialogScope} {...portalProps} />;\n};\n\nAlertDialogPortal.displayName = PORTAL_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * AlertDialogOverlay\n * -----------------------------------------------------------------------------------------------*/\n\nconst OVERLAY_NAME = 'AlertDialogOverlay';\n\ntype AlertDialogOverlayElement = React.ElementRef<typeof DialogPrimitive.Overlay>;\ntype DialogOverlayProps = Radix.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>;\ninterface AlertDialogOverlayProps extends DialogOverlayProps {}\n\nconst AlertDialogOverlay = React.forwardRef<AlertDialogOverlayElement, AlertDialogOverlayProps>(\n (props: ScopedProps<AlertDialogOverlayProps>, forwardedRef) => {\n const { __scopeAlertDialog, ...overlayProps } = props;\n const dialogScope = useDialogScope(__scopeAlertDialog);\n return <DialogPrimitive.Overlay {...dialogScope} {...overlayProps} ref={forwardedRef} />;\n }\n);\n\nAlertDialogOverlay.displayName = OVERLAY_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * AlertDialogContent\n * -----------------------------------------------------------------------------------------------*/\n\nconst CONTENT_NAME = 'AlertDialogContent';\n\ntype AlertDialogContentContextValue = {\n cancelRef: React.MutableRefObject<AlertDialogCancelElement | null>;\n};\n\nconst [AlertDialogContentProvider, useAlertDialogContentContext] =\n createAlertDialogContext<AlertDialogContentContextValue>(CONTENT_NAME);\n\ntype AlertDialogContentElement = React.ElementRef<typeof DialogPrimitive.Content>;\ntype DialogContentProps = Radix.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>;\ninterface AlertDialogContentProps\n extends Omit<DialogContentProps, 'onPointerDownOutside' | 'onInteractOutside'> {}\n\nconst AlertDialogContent = React.forwardRef<AlertDialogContentElement, AlertDialogContentProps>(\n (props: ScopedProps<AlertDialogContentProps>, forwardedRef) => {\n const { __scopeAlertDialog, children, ...contentProps } = props;\n const dialogScope = useDialogScope(__scopeAlertDialog);\n const contentRef = React.useRef<AlertDialogContentElement>(null);\n const composedRefs = useComposedRefs(forwardedRef, contentRef);\n const cancelRef = React.useRef<AlertDialogCancelElement | null>(null);\n\n return (\n <DialogPrimitive.WarningProvider\n contentName={CONTENT_NAME}\n titleName={TITLE_NAME}\n docsSlug=\"alert-dialog\"\n >\n <AlertDialogContentProvider scope={__scopeAlertDialog} cancelRef={cancelRef}>\n <DialogPrimitive.Content\n role=\"alertdialog\"\n {...dialogScope}\n {...contentProps}\n ref={composedRefs}\n onOpenAutoFocus={composeEventHandlers(contentProps.onOpenAutoFocus, (event) => {\n event.preventDefault();\n cancelRef.current?.focus({ preventScroll: true });\n })}\n onPointerDownOutside={(event) => event.preventDefault()}\n onInteractOutside={(event) => event.preventDefault()}\n >\n {/**\n * We have to use `Slottable` here as we cannot wrap the `AlertDialogContentProvider`\n * around everything, otherwise the `DescriptionWarning` would be rendered straight away.\n * This is because we want the accessibility checks to run only once the content is actually\n * open and that behaviour is already encapsulated in `DialogContent`.\n */}\n <Slottable>{children}</Slottable>\n {process.env.NODE_ENV === 'development' && (\n <DescriptionWarning contentRef={contentRef} />\n )}\n </DialogPrimitive.Content>\n </AlertDialogContentProvider>\n </DialogPrimitive.WarningProvider>\n );\n }\n);\n\nAlertDialogContent.displayName = CONTENT_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * AlertDialogTitle\n * -----------------------------------------------------------------------------------------------*/\n\nconst TITLE_NAME = 'AlertDialogTitle';\n\ntype AlertDialogTitleElement = React.ElementRef<typeof DialogPrimitive.Title>;\ntype DialogTitleProps = Radix.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>;\ninterface AlertDialogTitleProps extends DialogTitleProps {}\n\nconst AlertDialogTitle = React.forwardRef<AlertDialogTitleElement, AlertDialogTitleProps>(\n (props: ScopedProps<AlertDialogTitleProps>, forwardedRef) => {\n const { __scopeAlertDialog, ...titleProps } = props;\n const dialogScope = useDialogScope(__scopeAlertDialog);\n return <DialogPrimitive.Title {...dialogScope} {...titleProps} ref={forwardedRef} />;\n }\n);\n\nAlertDialogTitle.displayName = TITLE_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * AlertDialogDescription\n * -----------------------------------------------------------------------------------------------*/\n\nconst DESCRIPTION_NAME = 'AlertDialogDescription';\n\ntype AlertDialogDescriptionElement = React.ElementRef<typeof DialogPrimitive.Description>;\ntype DialogDescriptionProps = Radix.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>;\ninterface AlertDialogDescriptionProps extends DialogDescriptionProps {}\n\nconst AlertDialogDescription = React.forwardRef<\n AlertDialogDescriptionElement,\n AlertDialogDescriptionProps\n>((props: ScopedProps<AlertDialogDescriptionProps>, forwardedRef) => {\n const { __scopeAlertDialog, ...descriptionProps } = props;\n const dialogScope = useDialogScope(__scopeAlertDialog);\n return <DialogPrimitive.Description {...dialogScope} {...descriptionProps} ref={forwardedRef} />;\n});\n\nAlertDialogDescription.displayName = DESCRIPTION_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * AlertDialogAction\n * -----------------------------------------------------------------------------------------------*/\n\nconst ACTION_NAME = 'AlertDialogAction';\n\ntype AlertDialogActionElement = React.ElementRef<typeof DialogPrimitive.Close>;\ntype DialogCloseProps = Radix.ComponentPropsWithoutRef<typeof DialogPrimitive.Close>;\ninterface AlertDialogActionProps extends DialogCloseProps {}\n\nconst AlertDialogAction = React.forwardRef<AlertDialogActionElement, AlertDialogActionProps>(\n (props: ScopedProps<AlertDialogActionProps>, forwardedRef) => {\n const { __scopeAlertDialog, ...actionProps } = props;\n const dialogScope = useDialogScope(__scopeAlertDialog);\n return <DialogPrimitive.Close {...dialogScope} {...actionProps} ref={forwardedRef} />;\n }\n);\n\nAlertDialogAction.displayName = ACTION_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * AlertDialogCancel\n * -----------------------------------------------------------------------------------------------*/\n\nconst CANCEL_NAME = 'AlertDialogCancel';\n\ntype AlertDialogCancelElement = React.ElementRef<typeof DialogPrimitive.Close>;\ninterface AlertDialogCancelProps extends DialogCloseProps {}\n\nconst AlertDialogCancel = React.forwardRef<AlertDialogCancelElement, AlertDialogCancelProps>(\n (props: ScopedProps<AlertDialogCancelProps>, forwardedRef) => {\n const { __scopeAlertDialog, ...cancelProps } = props;\n const { cancelRef } = useAlertDialogContentContext(CANCEL_NAME, __scopeAlertDialog);\n const dialogScope = useDialogScope(__scopeAlertDialog);\n const ref = useComposedRefs(forwardedRef, cancelRef);\n return <DialogPrimitive.Close {...dialogScope} {...cancelProps} ref={ref} />;\n }\n);\n\nAlertDialogCancel.displayName = CANCEL_NAME;\n\n/* ---------------------------------------------------------------------------------------------- */\n\ntype DescriptionWarningProps = {\n contentRef: React.RefObject<AlertDialogContentElement>;\n};\n\nconst DescriptionWarning: React.FC<DescriptionWarningProps> = ({ contentRef }) => {\n const MESSAGE = `\\`${CONTENT_NAME}\\` requires a description for the component to be accessible for screen reader users.\n\nYou can add a description to the \\`${CONTENT_NAME}\\` by passing a \\`${DESCRIPTION_NAME}\\` component as a child, which also benefits sighted users by adding visible context to the dialog.\n\nAlternatively, you can use your own component as a description by assigning it an \\`id\\` and passing the same value to the \\`aria-describedby\\` prop in \\`${CONTENT_NAME}\\`. If the description is confusing or duplicative for sighted users, you can use the \\`@radix-ui/react-visually-hidden\\` primitive as a wrapper around your description component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;\n\n React.useEffect(() => {\n const hasDescription = document.getElementById(\n contentRef.current?.getAttribute('aria-describedby')!\n );\n if (!hasDescription) console.warn(MESSAGE);\n }, [MESSAGE, contentRef]);\n\n return null;\n};\n\nconst Root = AlertDialog;\nconst Trigger = AlertDialogTrigger;\nconst Portal = AlertDialogPortal;\nconst Overlay = AlertDialogOverlay;\nconst Content = AlertDialogContent;\nconst Action = AlertDialogAction;\nconst Cancel = AlertDialogCancel;\nconst Title = AlertDialogTitle;\nconst Description = AlertDialogDescription;\n\nexport {\n createAlertDialogScope,\n //\n AlertDialog,\n AlertDialogTrigger,\n AlertDialogPortal,\n AlertDialogOverlay,\n AlertDialogContent,\n AlertDialogAction,\n AlertDialogCancel,\n AlertDialogTitle,\n AlertDialogDescription,\n //\n Root,\n Trigger,\n Portal,\n Overlay,\n Content,\n Action,\n Cancel,\n Title,\n Description,\n};\nexport type {\n AlertDialogProps,\n AlertDialogTriggerProps,\n AlertDialogPortalProps,\n AlertDialogOverlayProps,\n AlertDialogContentProps,\n AlertDialogActionProps,\n AlertDialogCancelProps,\n AlertDialogTitleProps,\n A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AC,SAAS,UAAU,CAAC;AAExB,SAAO;AACT;AAEA,IAAMA,QAAO;AACb,IAAMC,WAAU;AAChB,IAAMC,UAAS;AACf,IAAMC,WAAU;AAChB,IAAMC,WAAU;AAChB,IAAM,SAAS;AACf,IAAM,SAAS;AACf,IAAMC,SAAQ;AACd,IAAMC,eAAc;",
6
+ "names": ["Root", "Trigger", "Portal", "Overlay", "Content", "Title", "Description"]
7
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@radix-ui/react-alert-dialog",
3
- "version": "1.0.6-rc.6",
3
+ "version": "1.1.0-rc.2",
4
4
  "license": "MIT",
5
5
  "exports": {
6
6
  ".": {
@@ -28,13 +28,12 @@
28
28
  "version": "yarn version"
29
29
  },
30
30
  "dependencies": {
31
- "@babel/runtime": "^7.13.10",
32
- "@radix-ui/primitive": "1.0.1",
33
- "@radix-ui/react-compose-refs": "1.0.1",
34
- "@radix-ui/react-context": "1.0.1",
35
- "@radix-ui/react-dialog": "1.0.6-rc.6",
36
- "@radix-ui/react-primitive": "1.0.3",
37
- "@radix-ui/react-slot": "1.0.2"
31
+ "@radix-ui/primitive": "1.1.0-rc.2",
32
+ "@radix-ui/react-compose-refs": "1.1.0-rc.2",
33
+ "@radix-ui/react-context": "1.1.0-rc.2",
34
+ "@radix-ui/react-dialog": "1.1.0-rc.2",
35
+ "@radix-ui/react-primitive": "1.1.0-rc.2",
36
+ "@radix-ui/react-slot": "1.1.0-rc.2"
38
37
  },
39
38
  "peerDependencies": {
40
39
  "@types/react": "*",
package/src/index.ts CHANGED
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  export {
2
3
  createAlertDialogScope,
3
4
  //
@@ -1 +0,0 @@
1
- {"mappings":";;;AAkBA,OAAA,6FAEE,CAAC;AAGH,mBAAmB,MAAM,wBAAwB,CAAC,OAAO,gBAAgB,IAAI,CAAC,CAAC;AAC/E,iCAA2B,SAAQ,IAAI,CAAC,WAAW,EAAE,OAAO,CAAC;C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C;AACnC,OAAA,MAAM,wCAA0B,CAAC;AACjC,OAAA,MAAM,uGAA4B,CAAC;AACnC,OAAA,MAAM,uGAA4B,CAAC;AACnC,OAAA,MAAM,wGAA0B,CAAC;AACjC,OAAA,MAAM,wGAA0B,CAAC;AACjC,OAAA,MAAM,uGAAwB,CAAC;AAC/B,OAAA,MAAM,qHAAoC,CAAC","sources":["packages/react/alert-dialog/src/packages/react/alert-dialog/src/AlertDialog.tsx","packages/react/alert-dialog/src/packages/react/alert-dialog/src/index.ts","packages/react/alert-dialog/src/index.ts"],"sourcesContent":[null,null,"export {\n createAlertDialogScope,\n //\n AlertDialog,\n AlertDialogTrigger,\n AlertDialogPortal,\n AlertDialogOverlay,\n AlertDialogContent,\n AlertDialogAction,\n AlertDialogCancel,\n AlertDialogTitle,\n AlertDialogDescription,\n //\n Root,\n Trigger,\n Portal,\n Overlay,\n Content,\n Action,\n Cancel,\n Title,\n Description,\n} from './AlertDialog';\nexport type {\n AlertDialogProps,\n AlertDialogTriggerProps,\n AlertDialogPortalProps,\n AlertDialogOverlayProps,\n AlertDialogContentProps,\n AlertDialogActionProps,\n AlertDialogCancelProps,\n AlertDialogTitleProps,\n AlertDialogDescriptionProps,\n} from './AlertDialog';\n"],"names":[],"version":3,"file":"index.d.ts.map"}