@tamagui/alert-dialog 1.0.1-beta.104

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2022 WorkOS
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,219 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __defProps = Object.defineProperties;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
8
+ var __getProtoOf = Object.getPrototypeOf;
9
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
10
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
11
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
12
+ var __spreadValues = (a, b) => {
13
+ for (var prop in b || (b = {}))
14
+ if (__hasOwnProp.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ if (__getOwnPropSymbols)
17
+ for (var prop of __getOwnPropSymbols(b)) {
18
+ if (__propIsEnum.call(b, prop))
19
+ __defNormalProp(a, prop, b[prop]);
20
+ }
21
+ return a;
22
+ };
23
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
24
+ var __objRest = (source, exclude) => {
25
+ var target = {};
26
+ for (var prop in source)
27
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
28
+ target[prop] = source[prop];
29
+ if (source != null && __getOwnPropSymbols)
30
+ for (var prop of __getOwnPropSymbols(source)) {
31
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
32
+ target[prop] = source[prop];
33
+ }
34
+ return target;
35
+ };
36
+ var __export = (target, all) => {
37
+ for (var name in all)
38
+ __defProp(target, name, { get: all[name], enumerable: true });
39
+ };
40
+ var __copyProps = (to, from, except, desc) => {
41
+ if (from && typeof from === "object" || typeof from === "function") {
42
+ for (let key of __getOwnPropNames(from))
43
+ if (!__hasOwnProp.call(to, key) && key !== except)
44
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
45
+ }
46
+ return to;
47
+ };
48
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
49
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
50
+ var AlertDialog_exports = {};
51
+ __export(AlertDialog_exports, {
52
+ AlertDialog: () => AlertDialog,
53
+ AlertDialogAction: () => AlertDialogAction,
54
+ AlertDialogCancel: () => AlertDialogCancel,
55
+ AlertDialogContent: () => AlertDialogContent,
56
+ AlertDialogDescription: () => AlertDialogDescription,
57
+ AlertDialogOverlay: () => AlertDialogOverlay,
58
+ AlertDialogPortal: () => AlertDialogPortal,
59
+ AlertDialogTitle: () => AlertDialogTitle,
60
+ AlertDialogTrigger: () => AlertDialogTrigger,
61
+ createAlertDialogScope: () => createAlertDialogScope
62
+ });
63
+ module.exports = __toCommonJS(AlertDialog_exports);
64
+ var import_compose_refs = require("@tamagui/compose-refs");
65
+ var import_core = require("@tamagui/core");
66
+ var import_create_context = require("@tamagui/create-context");
67
+ var import_dialog = require("@tamagui/dialog");
68
+ var React = __toESM(require("react"));
69
+ const ROOT_NAME = "AlertDialog";
70
+ const [createAlertDialogContext, createAlertDialogScope] = (0, import_create_context.createContextScope)(ROOT_NAME, [
71
+ import_dialog.createDialogScope
72
+ ]);
73
+ const useDialogScope = (0, import_dialog.createDialogScope)();
74
+ const TRIGGER_NAME = "AlertDialogTrigger";
75
+ const AlertDialogTrigger = React.forwardRef((props, forwardedRef) => {
76
+ const _a = props, { __scopeAlertDialog } = _a, triggerProps = __objRest(_a, ["__scopeAlertDialog"]);
77
+ const dialogScope = useDialogScope(__scopeAlertDialog);
78
+ return /* @__PURE__ */ React.createElement(import_dialog.DialogTrigger, __spreadProps(__spreadValues(__spreadValues({}, dialogScope), triggerProps), {
79
+ ref: forwardedRef
80
+ }));
81
+ });
82
+ AlertDialogTrigger.displayName = TRIGGER_NAME;
83
+ const PORTAL_NAME = "AlertDialogPortal";
84
+ const AlertDialogPortal = (props) => {
85
+ const _a = props, { __scopeAlertDialog } = _a, portalProps = __objRest(_a, ["__scopeAlertDialog"]);
86
+ const dialogScope = useDialogScope(__scopeAlertDialog);
87
+ return /* @__PURE__ */ React.createElement(import_dialog.DialogPortal, __spreadValues(__spreadValues({}, dialogScope), portalProps));
88
+ };
89
+ AlertDialogPortal.displayName = PORTAL_NAME;
90
+ const OVERLAY_NAME = "AlertDialogOverlay";
91
+ const AlertDialogOverlay = React.forwardRef((props, forwardedRef) => {
92
+ const _a = props, { __scopeAlertDialog } = _a, overlayProps = __objRest(_a, ["__scopeAlertDialog"]);
93
+ const dialogScope = useDialogScope(__scopeAlertDialog);
94
+ return /* @__PURE__ */ React.createElement(import_dialog.DialogOverlay, __spreadProps(__spreadValues(__spreadValues({}, dialogScope), overlayProps), {
95
+ ref: forwardedRef
96
+ }));
97
+ });
98
+ AlertDialogOverlay.displayName = OVERLAY_NAME;
99
+ const CONTENT_NAME = "AlertDialogContent";
100
+ const [AlertDialogContentProvider, useAlertDialogContentContext] = createAlertDialogContext(CONTENT_NAME);
101
+ const AlertDialogContent = React.forwardRef((props, forwardedRef) => {
102
+ const _a = props, { __scopeAlertDialog, children } = _a, contentProps = __objRest(_a, ["__scopeAlertDialog", "children"]);
103
+ const dialogScope = useDialogScope(__scopeAlertDialog);
104
+ const contentRef = React.useRef(null);
105
+ const composedRefs = (0, import_compose_refs.useComposedRefs)(forwardedRef, contentRef);
106
+ const cancelRef = React.useRef(null);
107
+ return /* @__PURE__ */ React.createElement(import_dialog.DialogWarningProvider, {
108
+ contentName: CONTENT_NAME,
109
+ titleName: TITLE_NAME,
110
+ docsSlug: "alert-dialog"
111
+ }, /* @__PURE__ */ React.createElement(AlertDialogContentProvider, {
112
+ scope: __scopeAlertDialog,
113
+ cancelRef
114
+ }, /* @__PURE__ */ React.createElement(import_dialog.DialogContent, __spreadProps(__spreadValues(__spreadValues({
115
+ role: "alertdialog"
116
+ }, dialogScope), contentProps), {
117
+ ref: composedRefs,
118
+ onOpenAutoFocus: (0, import_core.composeEventHandlers)(contentProps.onOpenAutoFocus, (event) => {
119
+ var _a2;
120
+ event.preventDefault();
121
+ if (import_core.isWeb) {
122
+ (_a2 = cancelRef.current) == null ? void 0 : _a2.focus({ preventScroll: true });
123
+ }
124
+ }),
125
+ onPointerDownOutside: (event) => event.preventDefault(),
126
+ onInteractOutside: (event) => event.preventDefault()
127
+ }), /* @__PURE__ */ React.createElement(import_core.Slottable, null, children), process.env.NODE_ENV === "development" && /* @__PURE__ */ React.createElement(DescriptionWarning, {
128
+ contentRef
129
+ }))));
130
+ });
131
+ AlertDialogContent.displayName = CONTENT_NAME;
132
+ const TITLE_NAME = "AlertDialogTitle";
133
+ const AlertDialogTitle = React.forwardRef((props, forwardedRef) => {
134
+ const _a = props, { __scopeAlertDialog } = _a, titleProps = __objRest(_a, ["__scopeAlertDialog"]);
135
+ const dialogScope = useDialogScope(__scopeAlertDialog);
136
+ return /* @__PURE__ */ React.createElement(import_dialog.DialogTitle, __spreadProps(__spreadValues(__spreadValues({}, dialogScope), titleProps), {
137
+ ref: forwardedRef
138
+ }));
139
+ });
140
+ AlertDialogTitle.displayName = TITLE_NAME;
141
+ const DESCRIPTION_NAME = "AlertDialogDescription";
142
+ const AlertDialogDescription = React.forwardRef((props, forwardedRef) => {
143
+ const _a = props, { __scopeAlertDialog } = _a, descriptionProps = __objRest(_a, ["__scopeAlertDialog"]);
144
+ const dialogScope = useDialogScope(__scopeAlertDialog);
145
+ return /* @__PURE__ */ React.createElement(import_dialog.DialogDescription, __spreadProps(__spreadValues(__spreadValues({}, dialogScope), descriptionProps), {
146
+ ref: forwardedRef
147
+ }));
148
+ });
149
+ AlertDialogDescription.displayName = DESCRIPTION_NAME;
150
+ const ACTION_NAME = "AlertDialogAction";
151
+ const AlertDialogAction = React.forwardRef((props, forwardedRef) => {
152
+ const _a = props, { __scopeAlertDialog } = _a, actionProps = __objRest(_a, ["__scopeAlertDialog"]);
153
+ const dialogScope = useDialogScope(__scopeAlertDialog);
154
+ return /* @__PURE__ */ React.createElement(import_dialog.DialogClose, __spreadProps(__spreadValues(__spreadValues({}, dialogScope), actionProps), {
155
+ ref: forwardedRef
156
+ }));
157
+ });
158
+ AlertDialogAction.displayName = ACTION_NAME;
159
+ const CANCEL_NAME = "AlertDialogCancel";
160
+ const AlertDialogCancel = React.forwardRef((props, forwardedRef) => {
161
+ const _a = props, { __scopeAlertDialog } = _a, cancelProps = __objRest(_a, ["__scopeAlertDialog"]);
162
+ const { cancelRef } = useAlertDialogContentContext(CANCEL_NAME, __scopeAlertDialog);
163
+ const dialogScope = useDialogScope(__scopeAlertDialog);
164
+ const ref = (0, import_compose_refs.useComposedRefs)(forwardedRef, cancelRef);
165
+ return /* @__PURE__ */ React.createElement(import_dialog.DialogClose, __spreadProps(__spreadValues(__spreadValues({}, dialogScope), cancelProps), {
166
+ ref
167
+ }));
168
+ });
169
+ AlertDialogCancel.displayName = CANCEL_NAME;
170
+ const DescriptionWarning = ({ contentRef }) => {
171
+ const MESSAGE = `\`${CONTENT_NAME}\` requires a description for the component to be accessible for screen reader users.
172
+
173
+ 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.
174
+
175
+ 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.
176
+
177
+ For more information, see https://tamagui.dev/docs/components/alert-dialog`;
178
+ React.useEffect(() => {
179
+ var _a;
180
+ if (!import_core.isWeb)
181
+ return;
182
+ const hasDescription = document.getElementById((_a = contentRef.current) == null ? void 0 : _a.getAttribute("aria-describedby"));
183
+ if (!hasDescription)
184
+ console.warn(MESSAGE);
185
+ }, [MESSAGE, contentRef]);
186
+ return null;
187
+ };
188
+ const AlertDialogInner = (props) => {
189
+ const _a = props, { __scopeAlertDialog } = _a, alertDialogProps = __objRest(_a, ["__scopeAlertDialog"]);
190
+ const dialogScope = useDialogScope(__scopeAlertDialog);
191
+ return /* @__PURE__ */ React.createElement(import_dialog.Dialog, __spreadProps(__spreadValues(__spreadValues({}, dialogScope), alertDialogProps), {
192
+ modal: true
193
+ }));
194
+ };
195
+ const AlertDialog = (0, import_core.withStaticProperties)(AlertDialogInner, {
196
+ Trigger: AlertDialogTrigger,
197
+ Portal: AlertDialogPortal,
198
+ Overlay: AlertDialogOverlay,
199
+ Content: AlertDialogContent,
200
+ Action: AlertDialogAction,
201
+ Cancel: AlertDialogCancel,
202
+ Title: AlertDialogTitle,
203
+ Description: AlertDialogDescription
204
+ });
205
+ AlertDialog.displayName = ROOT_NAME;
206
+ // Annotate the CommonJS export names for ESM import in node:
207
+ 0 && (module.exports = {
208
+ AlertDialog,
209
+ AlertDialogAction,
210
+ AlertDialogCancel,
211
+ AlertDialogContent,
212
+ AlertDialogDescription,
213
+ AlertDialogOverlay,
214
+ AlertDialogPortal,
215
+ AlertDialogTitle,
216
+ AlertDialogTrigger,
217
+ createAlertDialogScope
218
+ });
219
+ //# sourceMappingURL=AlertDialog.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/AlertDialog.tsx"],
4
+ "sourcesContent": ["// forked from radix-ui\n// https://github.com/radix-ui/primitives/blob/main/packages/react/alert-dialog/src/AlertDialog.tsx\n\nimport { useComposedRefs } from '@tamagui/compose-refs'\nimport {\n Slottable,\n TamaguiElement,\n composeEventHandlers,\n isWeb,\n withStaticProperties,\n} from '@tamagui/core'\nimport { Scope, createContextScope } from '@tamagui/create-context'\nimport {\n Dialog,\n DialogClose,\n DialogCloseProps,\n DialogContent,\n DialogContentProps,\n DialogDescription,\n DialogDescriptionProps,\n DialogOverlay,\n DialogOverlayProps,\n DialogPortal,\n DialogPortalProps,\n DialogProps,\n DialogTitle,\n DialogTitleProps,\n DialogTrigger,\n DialogTriggerProps,\n DialogWarningProvider,\n createDialogScope,\n} from '@tamagui/dialog'\nimport * as React from 'react'\n\nconst ROOT_NAME = 'AlertDialog'\n\ntype ScopedProps<P> = P & { __scopeAlertDialog?: Scope }\nconst [createAlertDialogContext, createAlertDialogScope] = createContextScope(ROOT_NAME, [\n createDialogScope,\n])\n\nconst useDialogScope = createDialogScope()\n\ninterface AlertDialogProps extends Omit<DialogProps, 'modal'> {}\n\n/* -------------------------------------------------------------------------------------------------\n * AlertDialogTrigger\n * -----------------------------------------------------------------------------------------------*/\nconst TRIGGER_NAME = 'AlertDialogTrigger'\n\ninterface AlertDialogTriggerProps extends DialogTriggerProps {}\n\nconst AlertDialogTrigger = React.forwardRef<TamaguiElement, AlertDialogTriggerProps>(\n (props: ScopedProps<AlertDialogTriggerProps>, forwardedRef) => {\n const { __scopeAlertDialog, ...triggerProps } = props\n const dialogScope = useDialogScope(__scopeAlertDialog)\n return <DialogTrigger {...dialogScope} {...triggerProps} ref={forwardedRef} />\n }\n)\n\nAlertDialogTrigger.displayName = TRIGGER_NAME\n\n/* -------------------------------------------------------------------------------------------------\n * AlertDialogPortal\n * -----------------------------------------------------------------------------------------------*/\n\nconst PORTAL_NAME = 'AlertDialogPortal'\n\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 <DialogPortal {...dialogScope} {...portalProps} />\n}\n\nAlertDialogPortal.displayName = PORTAL_NAME\n\n/* -------------------------------------------------------------------------------------------------\n * AlertDialogOverlay\n * -----------------------------------------------------------------------------------------------*/\n\nconst OVERLAY_NAME = 'AlertDialogOverlay'\n\ninterface AlertDialogOverlayProps extends DialogOverlayProps {}\n\nconst AlertDialogOverlay = React.forwardRef<TamaguiElement, AlertDialogOverlayProps>(\n (props: ScopedProps<AlertDialogOverlayProps>, forwardedRef) => {\n const { __scopeAlertDialog, ...overlayProps } = props\n const dialogScope = useDialogScope(__scopeAlertDialog)\n return <DialogOverlay {...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<TamaguiElement | null>\n}\n\nconst [AlertDialogContentProvider, useAlertDialogContentContext] =\n createAlertDialogContext<AlertDialogContentContextValue>(CONTENT_NAME)\n\ninterface AlertDialogContentProps\n extends Omit<DialogContentProps, 'onPointerDownOutside' | 'onInteractOutside'> {}\n\nconst AlertDialogContent = React.forwardRef<TamaguiElement, AlertDialogContentProps>(\n (props: ScopedProps<AlertDialogContentProps>, forwardedRef) => {\n const { __scopeAlertDialog, children, ...contentProps } = props\n const dialogScope = useDialogScope(__scopeAlertDialog)\n const contentRef = React.useRef<TamaguiElement>(null)\n const composedRefs = useComposedRefs(forwardedRef, contentRef)\n const cancelRef = React.useRef<TamaguiElement | null>(null)\n\n return (\n <DialogWarningProvider\n contentName={CONTENT_NAME}\n titleName={TITLE_NAME}\n docsSlug=\"alert-dialog\"\n >\n <AlertDialogContentProvider scope={__scopeAlertDialog} cancelRef={cancelRef}>\n <DialogContent\n // @ts-ignore\n role=\"alertdialog\"\n {...dialogScope}\n {...contentProps}\n ref={composedRefs}\n onOpenAutoFocus={composeEventHandlers(contentProps.onOpenAutoFocus, (event) => {\n event.preventDefault()\n if (isWeb) {\n // @ts-ignore\n cancelRef.current?.focus({ preventScroll: true })\n }\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 </DialogContent>\n </AlertDialogContentProvider>\n </DialogWarningProvider>\n )\n }\n)\n\nAlertDialogContent.displayName = CONTENT_NAME\n\n/* -------------------------------------------------------------------------------------------------\n * AlertDialogTitle\n * -----------------------------------------------------------------------------------------------*/\n\nconst TITLE_NAME = 'AlertDialogTitle'\n\ntype AlertDialogTitleProps = DialogTitleProps\n\nconst AlertDialogTitle = React.forwardRef<TamaguiElement, AlertDialogTitleProps>(\n (props: ScopedProps<AlertDialogTitleProps>, forwardedRef) => {\n const { __scopeAlertDialog, ...titleProps } = props\n const dialogScope = useDialogScope(__scopeAlertDialog)\n return <DialogTitle {...dialogScope} {...titleProps} ref={forwardedRef} />\n }\n)\n\nAlertDialogTitle.displayName = TITLE_NAME\n\n/* -------------------------------------------------------------------------------------------------\n * AlertDialogDescription\n * -----------------------------------------------------------------------------------------------*/\n\nconst DESCRIPTION_NAME = 'AlertDialogDescription'\n\ntype AlertDialogDescriptionProps = DialogDescriptionProps\n\nconst AlertDialogDescription = React.forwardRef<TamaguiElement, AlertDialogDescriptionProps>(\n (props: ScopedProps<AlertDialogDescriptionProps>, forwardedRef) => {\n const { __scopeAlertDialog, ...descriptionProps } = props\n const dialogScope = useDialogScope(__scopeAlertDialog)\n return <DialogDescription {...dialogScope} {...descriptionProps} ref={forwardedRef} />\n }\n)\n\nAlertDialogDescription.displayName = DESCRIPTION_NAME\n\n/* -------------------------------------------------------------------------------------------------\n * AlertDialogAction\n * -----------------------------------------------------------------------------------------------*/\n\nconst ACTION_NAME = 'AlertDialogAction'\n\ntype AlertDialogActionProps = DialogCloseProps\n\nconst AlertDialogAction = React.forwardRef<TamaguiElement, AlertDialogActionProps>(\n (props: ScopedProps<AlertDialogActionProps>, forwardedRef) => {\n const { __scopeAlertDialog, ...actionProps } = props\n const dialogScope = useDialogScope(__scopeAlertDialog)\n return <DialogClose {...dialogScope} {...actionProps} ref={forwardedRef} />\n }\n)\n\nAlertDialogAction.displayName = ACTION_NAME\n\n/* -------------------------------------------------------------------------------------------------\n * AlertDialogCancel\n * -----------------------------------------------------------------------------------------------*/\n\nconst CANCEL_NAME = 'AlertDialogCancel'\n\ninterface AlertDialogCancelProps extends DialogCloseProps {}\n\nconst AlertDialogCancel = React.forwardRef<TamaguiElement, 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 <DialogClose {...dialogScope} {...cancelProps} ref={ref} />\n }\n)\n\nAlertDialogCancel.displayName = CANCEL_NAME\n\n/* ---------------------------------------------------------------------------------------------- */\n\ntype DescriptionWarningProps = {\n contentRef: React.RefObject<TamaguiElement>\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://tamagui.dev/docs/components/alert-dialog`\n\n React.useEffect(() => {\n if (!isWeb) return\n const hasDescription = document.getElementById(\n // @ts-ignore\n // eslint-disable-next-line @typescript-eslint/no-non-null-asserted-optional-chain\n contentRef.current?.getAttribute('aria-describedby')!\n )\n if (!hasDescription) console.warn(MESSAGE)\n }, [MESSAGE, contentRef])\n\n return null\n}\n\n/* -------------------------------------------------------------------------------------------------\n * AlertDialog\n * -----------------------------------------------------------------------------------------------*/\n\nconst AlertDialogInner: React.FC<AlertDialogProps> = (props: ScopedProps<AlertDialogProps>) => {\n const { __scopeAlertDialog, ...alertDialogProps } = props\n const dialogScope = useDialogScope(__scopeAlertDialog)\n return <Dialog {...dialogScope} {...alertDialogProps} modal={true} />\n}\n\nconst AlertDialog = withStaticProperties(AlertDialogInner, {\n Trigger: AlertDialogTrigger,\n Portal: AlertDialogPortal,\n Overlay: AlertDialogOverlay,\n Content: AlertDialogContent,\n Action: AlertDialogAction,\n Cancel: AlertDialogCancel,\n Title: AlertDialogTitle,\n Description: AlertDialogDescription,\n})\n\nAlertDialog.displayName = ROOT_NAME\n\nexport {\n createAlertDialogScope,\n //\n AlertDialog,\n AlertDialogTrigger,\n AlertDialogPortal,\n AlertDialogOverlay,\n AlertDialogContent,\n AlertDialogAction,\n AlertDialogCancel,\n AlertDialogTitle,\n AlertDialogDescription,\n}\nexport type {\n AlertDialogProps,\n AlertDialogTriggerProps,\n AlertDialogPortalProps,\n AlertDialogOverlayProps,\n AlertDialogContentProps,\n AlertDialogActionProps,\n AlertDialogCancelProps,\n AlertDialogTitleProps,\n AlertDialogDescriptionProps,\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,0BAAgC;AAChC,kBAMO;AACP,4BAA0C;AAC1C,oBAmBO;AACP,YAAuB;AAEvB,MAAM,YAAY;AAGlB,MAAM,CAAC,0BAA0B,0BAA0B,8CAAmB,WAAW;AAAA,EACvF;AACF,CAAC;AAED,MAAM,iBAAiB,qCAAkB;AAOzC,MAAM,eAAe;AAIrB,MAAM,qBAAqB,MAAM,WAC/B,CAAC,OAA6C,iBAAiB;AAC7D,QAAgD,YAAxC,yBAAwC,IAAjB,yBAAiB,IAAjB,CAAvB;AACR,QAAM,cAAc,eAAe,kBAAkB;AACrD,SAAO,oCAAC,6EAAkB,cAAiB,eAAnC;AAAA,IAAiD,KAAK;AAAA,IAAc;AAC9E,CACF;AAEA,mBAAmB,cAAc;AAMjC,MAAM,cAAc;AAIpB,MAAM,oBAAsD,CAC1D,UACG;AACH,QAA+C,YAAvC,yBAAuC,IAAhB,wBAAgB,IAAhB,CAAvB;AACR,QAAM,cAAc,eAAe,kBAAkB;A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