@tamagui/alert-dialog 1.14.0 → 1.14.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.
@@ -1,8 +1,301 @@
1
- import{jsx as n,jsxs as me}from"react/jsx-runtime";import{useComposedRefs as I}from"@tamagui/compose-refs";import{Slottable as H,composeEventHandlers as M,isTamaguiElement as U,isWeb as F,styled as V,useIsomorphicLayoutEffect as z,withStaticProperties as J}from"@tamagui/core";import{createContextScope as K}from"@tamagui/create-context";import{Dialog as Q,DialogClose as W,DialogContent as X,DialogDescription as Z,DialogOverlay as ee,DialogOverlayFrame as oe,DialogPortal as te,DialogTitle as re,DialogTrigger as ae,DialogWarningProvider as le,createDialogScope as L}from"@tamagui/dialog";import{YStack as ne}from"@tamagui/stacks";import{useControllableState as ie}from"@tamagui/use-controllable-state";import*as a from"react";import{Alert as se}from"react-native";const G="AlertDialog",[ce,pe]=K(G,[L]),p=L(),$="AlertDialogTrigger",ge=V(ne,{name:"DialogTrigger"}),f=a.forwardRef((o,t)=>{if(o.__native){const{__native:D,onPress:i,__onPress:u,...g}=o;return n(ge,{...g,onPress:M(i,u)})}const{__scopeAlertDialog:e,...r}=o,l=p(e);return n(ae,{...l,...r,ref:t})});f.displayName=$;const De="AlertDialogPortal",m=o=>{const{__scopeAlertDialog:t,...e}=o,r=p(t);return n(te,{...r,...e})};m.displayName=De;const Y="AlertDialogOverlay",ue=V(oe,{name:Y}),y=ue.extractable(a.forwardRef((o,t)=>{const{__scopeAlertDialog:e,...r}=o,l=p(e);return n(ee,{...l,...r,ref:t})}));y.displayName=Y;const A="AlertDialogContent",[Ae,de]=ce(A),C=a.forwardRef((o,t)=>{const{__scopeAlertDialog:e,children:r,...l}=o,D=p(e),i=a.useRef(null),u=I(t,i),g=a.useRef(null);return n(le,{contentName:A,titleName:T,docsSlug:"alert-dialog",children:n(Ae,{scope:e,cancelRef:g,children:me(X,{role:"alertdialog",...D,...l,ref:u,onOpenAutoFocus:M(l.onOpenAutoFocus,s=>{var d;s.preventDefault(),F&&((d=g.current)==null||d.focus({preventScroll:!0}))}),onPointerDownOutside:s=>s.preventDefault(),onInteractOutside:s=>s.preventDefault(),children:[n(H,{children:r}),process.env.NODE_ENV==="development"&&n(Pe,{contentRef:i})]})})})});C.displayName=A;const T="AlertDialogTitle",v=a.forwardRef((o,t)=>{const{__scopeAlertDialog:e,...r}=o,l=p(e);return n(re,{...l,...r,ref:t})});v.displayName=T;const E="AlertDialogDescription",_=a.forwardRef((o,t)=>{const{__scopeAlertDialog:e,...r}=o,l=p(e);return n(Z,{...l,...r,ref:t})});_.displayName=E;const R="AlertDialogAction",S=a.forwardRef((o,t)=>{const{__scopeAlertDialog:e,...r}=o,l=p(e);return n(W,{...l,...r,ref:t})});S.displayName=R;const N="AlertDialogCancel",O=a.forwardRef((o,t)=>{const{__scopeAlertDialog:e,...r}=o,{cancelRef:l}=de(N,e),D=p(e),i=I(t,l);return n(W,{...D,...r,ref:i})});O.displayName=N;const Pe=({contentRef:o})=>(process.env.NODE_ENV==="development"&&a.useEffect(()=>{var e;if(!F)return;document.getElementById((e=o.current)==null?void 0:e.getAttribute("aria-describedby"))||console.warn(`\`${A}\` requires a description for the component to be accessible for screen reader users.
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { useComposedRefs } from "@tamagui/compose-refs";
3
+ import {
4
+ Slottable,
5
+ composeEventHandlers,
6
+ isTamaguiElement,
7
+ isWeb,
8
+ styled,
9
+ useIsomorphicLayoutEffect,
10
+ withStaticProperties
11
+ } from "@tamagui/core";
12
+ import { createContextScope } from "@tamagui/create-context";
13
+ import {
14
+ Dialog,
15
+ DialogClose,
16
+ DialogContent,
17
+ DialogDescription,
18
+ DialogOverlay,
19
+ DialogOverlayFrame,
20
+ DialogPortal,
21
+ DialogTitle,
22
+ DialogTrigger,
23
+ DialogWarningProvider,
24
+ createDialogScope
25
+ } from "@tamagui/dialog";
26
+ import { YStack } from "@tamagui/stacks";
27
+ import { useControllableState } from "@tamagui/use-controllable-state";
28
+ import * as React from "react";
29
+ import { Alert } from "react-native";
30
+ const ROOT_NAME = "AlertDialog";
31
+ const [createAlertDialogContext, createAlertDialogScope] = createContextScope(ROOT_NAME, [
32
+ createDialogScope
33
+ ]);
34
+ const useDialogScope = createDialogScope();
35
+ const TRIGGER_NAME = "AlertDialogTrigger";
36
+ const NativeAlertDialogTriggerFrame = styled(YStack, {
37
+ name: "DialogTrigger"
38
+ });
39
+ const AlertDialogTrigger = React.forwardRef(
40
+ (props, forwardedRef) => {
41
+ if (props["__native"]) {
42
+ const { __native, onPress, __onPress, ...rest } = props;
43
+ return /* @__PURE__ */ jsx(
44
+ NativeAlertDialogTriggerFrame,
45
+ {
46
+ ...rest,
47
+ onPress: composeEventHandlers(onPress, __onPress)
48
+ }
49
+ );
50
+ }
51
+ const { __scopeAlertDialog, ...triggerProps } = props;
52
+ const dialogScope = useDialogScope(__scopeAlertDialog);
53
+ return /* @__PURE__ */ jsx(DialogTrigger, { ...dialogScope, ...triggerProps, ref: forwardedRef });
54
+ }
55
+ );
56
+ AlertDialogTrigger.displayName = TRIGGER_NAME;
57
+ const PORTAL_NAME = "AlertDialogPortal";
58
+ const AlertDialogPortal = (props) => {
59
+ const { __scopeAlertDialog, ...portalProps } = props;
60
+ const dialogScope = useDialogScope(__scopeAlertDialog);
61
+ return /* @__PURE__ */ jsx(DialogPortal, { ...dialogScope, ...portalProps });
62
+ };
63
+ AlertDialogPortal.displayName = PORTAL_NAME;
64
+ const OVERLAY_NAME = "AlertDialogOverlay";
65
+ const AlertDialogOverlayFrame = styled(DialogOverlayFrame, {
66
+ name: OVERLAY_NAME
67
+ });
68
+ const AlertDialogOverlay = AlertDialogOverlayFrame.extractable(
69
+ React.forwardRef(
70
+ (props, forwardedRef) => {
71
+ const { __scopeAlertDialog, ...overlayProps } = props;
72
+ const dialogScope = useDialogScope(__scopeAlertDialog);
73
+ return /* @__PURE__ */ jsx(DialogOverlay, { ...dialogScope, ...overlayProps, ref: forwardedRef });
74
+ }
75
+ )
76
+ );
77
+ AlertDialogOverlay.displayName = OVERLAY_NAME;
78
+ const CONTENT_NAME = "AlertDialogContent";
79
+ const [AlertDialogContentProvider, useAlertDialogContentContext] = createAlertDialogContext(CONTENT_NAME);
80
+ const AlertDialogContent = React.forwardRef(
81
+ (props, forwardedRef) => {
82
+ const { __scopeAlertDialog, children, ...contentProps } = props;
83
+ const dialogScope = useDialogScope(__scopeAlertDialog);
84
+ const contentRef = React.useRef(null);
85
+ const composedRefs = useComposedRefs(forwardedRef, contentRef);
86
+ const cancelRef = React.useRef(null);
87
+ return /* @__PURE__ */ jsx(
88
+ DialogWarningProvider,
89
+ {
90
+ contentName: CONTENT_NAME,
91
+ titleName: TITLE_NAME,
92
+ docsSlug: "alert-dialog",
93
+ children: /* @__PURE__ */ jsx(AlertDialogContentProvider, { scope: __scopeAlertDialog, cancelRef, children: /* @__PURE__ */ jsxs(
94
+ DialogContent,
95
+ {
96
+ role: "alertdialog",
97
+ ...dialogScope,
98
+ ...contentProps,
99
+ ref: composedRefs,
100
+ onOpenAutoFocus: composeEventHandlers(
101
+ contentProps.onOpenAutoFocus,
102
+ (event) => {
103
+ var _a;
104
+ event.preventDefault();
105
+ if (isWeb) {
106
+ (_a = cancelRef.current) == null ? void 0 : _a.focus({ preventScroll: true });
107
+ }
108
+ }
109
+ ),
110
+ onPointerDownOutside: (event) => event.preventDefault(),
111
+ onInteractOutside: (event) => event.preventDefault(),
112
+ children: [
113
+ /* @__PURE__ */ jsx(Slottable, { children }),
114
+ process.env.NODE_ENV === "development" && /* @__PURE__ */ jsx(DescriptionWarning, { contentRef })
115
+ ]
116
+ }
117
+ ) })
118
+ }
119
+ );
120
+ }
121
+ );
122
+ AlertDialogContent.displayName = CONTENT_NAME;
123
+ const TITLE_NAME = "AlertDialogTitle";
124
+ const AlertDialogTitle = React.forwardRef(
125
+ (props, forwardedRef) => {
126
+ const { __scopeAlertDialog, ...titleProps } = props;
127
+ const dialogScope = useDialogScope(__scopeAlertDialog);
128
+ return /* @__PURE__ */ jsx(DialogTitle, { ...dialogScope, ...titleProps, ref: forwardedRef });
129
+ }
130
+ );
131
+ AlertDialogTitle.displayName = TITLE_NAME;
132
+ const DESCRIPTION_NAME = "AlertDialogDescription";
133
+ const AlertDialogDescription = React.forwardRef((props, forwardedRef) => {
134
+ const { __scopeAlertDialog, ...descriptionProps } = props;
135
+ const dialogScope = useDialogScope(__scopeAlertDialog);
136
+ return /* @__PURE__ */ jsx(DialogDescription, { ...dialogScope, ...descriptionProps, ref: forwardedRef });
137
+ });
138
+ AlertDialogDescription.displayName = DESCRIPTION_NAME;
139
+ const ACTION_NAME = "AlertDialogAction";
140
+ const AlertDialogAction = React.forwardRef(
141
+ (props, forwardedRef) => {
142
+ const { __scopeAlertDialog, ...actionProps } = props;
143
+ const dialogScope = useDialogScope(__scopeAlertDialog);
144
+ return /* @__PURE__ */ jsx(DialogClose, { ...dialogScope, ...actionProps, ref: forwardedRef });
145
+ }
146
+ );
147
+ AlertDialogAction.displayName = ACTION_NAME;
148
+ const CANCEL_NAME = "AlertDialogCancel";
149
+ const AlertDialogCancel = React.forwardRef(
150
+ (props, forwardedRef) => {
151
+ const { __scopeAlertDialog, ...cancelProps } = props;
152
+ const { cancelRef } = useAlertDialogContentContext(CANCEL_NAME, __scopeAlertDialog);
153
+ const dialogScope = useDialogScope(__scopeAlertDialog);
154
+ const ref = useComposedRefs(forwardedRef, cancelRef);
155
+ return /* @__PURE__ */ jsx(DialogClose, { ...dialogScope, ...cancelProps, ref });
156
+ }
157
+ );
158
+ AlertDialogCancel.displayName = CANCEL_NAME;
159
+ const DescriptionWarning = ({ contentRef }) => {
160
+ if (process.env.NODE_ENV === "development") {
161
+ React.useEffect(() => {
162
+ var _a;
163
+ if (!isWeb)
164
+ return;
165
+ const hasDescription = document.getElementById(
166
+ // @ts-ignore
167
+ // eslint-disable-next-line @typescript-eslint/no-non-null-asserted-optional-chain
168
+ (_a = contentRef.current) == null ? void 0 : _a.getAttribute("aria-describedby")
169
+ );
170
+ if (!hasDescription) {
171
+ console.warn(`\`${CONTENT_NAME}\` requires a description for the component to be accessible for screen reader users.
2
172
 
3
- You can add a description to the \`${A}\` by passing a \`${E}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
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.
4
174
 
5
- 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 \`${A}\`. 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.
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.
6
176
 
7
- For more information, see https://tamagui.dev/docs/components/alert-dialog`)},[o]),null),fe=o=>{const{__scopeAlertDialog:t,native:e,...r}=o,l=p(t);if(process.env.TAMAGUI_TARGET==="native"){const[D,i]=ie({prop:o.open,defaultProp:o.defaultOpen||!1,onChange:o.onOpenChange,transition:!0});let u=null,g="",s="";const d=[];if(b(a.Children.toArray(o.children),c=>{if(!a.isValidElement(c))return!1;const x=U(c)?c.type.staticConfig.componentName:c.type.displayName;switch(x){case $:return u=a.cloneElement(c,{__native:!0}),!1;case T:return g=h(c),!1;case E:return s=h(c),!1;case R:case N:{const k=x===R?"default":"cancel",q=h(c),B=()=>{var w;const P=c.props;(w=P==null?void 0:P.onPress)==null||w.call(P,{native:!0}),i(!1)};return d.push({style:k,text:q,onPress:B}),!1}default:return!0}}),z(()=>{!D||!e||(g||s)&&se.alert(g,s,d)},[e,D]),e)return a.cloneElement(u,{__onPress:()=>{i(!0)}})}return n(Q,{...l,...r,modal:!0})};function b(o,t){for(const e of o)a.isValidElement(e)&&t(e)&&e.props.children&&b(a.Children.toArray(e.props.children),t)}function h(o){let t="";return b(a.Children.toArray(o),e=>typeof e.props.children=="string"?(t=e.props.children,!1):!0),t}const j=J(fe,{Trigger:f,Portal:m,Overlay:y,Content:C,Action:S,Cancel:O,Title:v,Description:_});j.displayName=G;export{j as AlertDialog,S as AlertDialogAction,O as AlertDialogCancel,C as AlertDialogContent,_ as AlertDialogDescription,y as AlertDialogOverlay,m as AlertDialogPortal,v as AlertDialogTitle,f as AlertDialogTrigger,pe as createAlertDialogScope};
177
+ For more information, see https://tamagui.dev/docs/components/alert-dialog`);
178
+ }
179
+ }, [contentRef]);
180
+ }
181
+ return null;
182
+ };
183
+ const AlertDialogInner = (props) => {
184
+ const { __scopeAlertDialog, native, ...alertDialogProps } = props;
185
+ const dialogScope = useDialogScope(__scopeAlertDialog);
186
+ if (process.env.TAMAGUI_TARGET === "native") {
187
+ const [open, setOpen] = useControllableState({
188
+ prop: props.open,
189
+ defaultProp: props.defaultOpen || false,
190
+ onChange: props.onOpenChange,
191
+ transition: true
192
+ });
193
+ let triggerElement = null;
194
+ let title = "";
195
+ let description = "";
196
+ const buttons = [];
197
+ forEachChildDeep(React.Children.toArray(props.children), (child) => {
198
+ if (!React.isValidElement(child))
199
+ return false;
200
+ const name = isTamaguiElement(child) ? child.type.staticConfig.componentName : child.type["displayName"];
201
+ switch (name) {
202
+ case TRIGGER_NAME: {
203
+ triggerElement = React.cloneElement(child, {
204
+ __native: true
205
+ });
206
+ return false;
207
+ }
208
+ case TITLE_NAME: {
209
+ title = getStringChildren(child);
210
+ return false;
211
+ }
212
+ case DESCRIPTION_NAME: {
213
+ description = getStringChildren(child);
214
+ return false;
215
+ }
216
+ case ACTION_NAME:
217
+ case CANCEL_NAME: {
218
+ const style = name === ACTION_NAME ? "default" : "cancel";
219
+ const text = getStringChildren(child);
220
+ const onPress = () => {
221
+ var _a;
222
+ const childProps = child.props;
223
+ (_a = childProps == null ? void 0 : childProps.onPress) == null ? void 0 : _a.call(childProps, { native: true });
224
+ setOpen(false);
225
+ };
226
+ buttons.push({
227
+ style,
228
+ text,
229
+ // @ts-ignore
230
+ onPress
231
+ });
232
+ return false;
233
+ }
234
+ default: {
235
+ return true;
236
+ }
237
+ }
238
+ });
239
+ useIsomorphicLayoutEffect(() => {
240
+ if (!open || !native)
241
+ return;
242
+ if (title || description) {
243
+ Alert.alert(title, description, buttons);
244
+ }
245
+ }, [native, open]);
246
+ if (native) {
247
+ return React.cloneElement(triggerElement, {
248
+ __onPress: () => {
249
+ setOpen(true);
250
+ }
251
+ });
252
+ }
253
+ }
254
+ return /* @__PURE__ */ jsx(Dialog, { ...dialogScope, ...alertDialogProps, modal: true });
255
+ };
256
+ function forEachChildDeep(children, onChild) {
257
+ for (const child of children) {
258
+ if (!React.isValidElement(child))
259
+ continue;
260
+ if (!onChild(child))
261
+ continue;
262
+ if (child.props.children) {
263
+ forEachChildDeep(React.Children.toArray(child.props.children), onChild);
264
+ }
265
+ }
266
+ }
267
+ function getStringChildren(child) {
268
+ let string = "";
269
+ forEachChildDeep(React.Children.toArray(child), (child2) => {
270
+ if (typeof child2.props.children === "string") {
271
+ string = child2.props.children;
272
+ return false;
273
+ }
274
+ return true;
275
+ });
276
+ return string;
277
+ }
278
+ const AlertDialog = withStaticProperties(AlertDialogInner, {
279
+ Trigger: AlertDialogTrigger,
280
+ Portal: AlertDialogPortal,
281
+ Overlay: AlertDialogOverlay,
282
+ Content: AlertDialogContent,
283
+ Action: AlertDialogAction,
284
+ Cancel: AlertDialogCancel,
285
+ Title: AlertDialogTitle,
286
+ Description: AlertDialogDescription
287
+ });
288
+ AlertDialog.displayName = ROOT_NAME;
289
+ export {
290
+ AlertDialog,
291
+ AlertDialogAction,
292
+ AlertDialogCancel,
293
+ AlertDialogContent,
294
+ AlertDialogDescription,
295
+ AlertDialogOverlay,
296
+ AlertDialogPortal,
297
+ AlertDialogTitle,
298
+ AlertDialogTrigger,
299
+ createAlertDialogScope
300
+ };
8
301
  //# sourceMappingURL=AlertDialog.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../src/AlertDialog.tsx"],
4
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 isTamaguiElement,\n isWeb,\n styled,\n useIsomorphicLayoutEffect,\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 DialogOverlayFrame,\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 { YStack } from '@tamagui/stacks'\nimport { useControllableState } from '@tamagui/use-controllable-state'\nimport * as React from 'react'\nimport { Alert } from 'react-native'\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])\n\nconst useDialogScope = createDialogScope()\n\ntype AlertDialogProps = DialogProps & {\n native?: boolean\n}\n\n/* -------------------------------------------------------------------------------------------------\n * AlertDialogTrigger\n * -----------------------------------------------------------------------------------------------*/\n\nconst TRIGGER_NAME = 'AlertDialogTrigger'\n\ninterface AlertDialogTriggerProps extends DialogTriggerProps {}\n\nconst NativeAlertDialogTriggerFrame = styled(YStack, {\n name: 'DialogTrigger',\n})\n\nconst AlertDialogTrigger = React.forwardRef<TamaguiElement, AlertDialogTriggerProps>(\n (props: ScopedProps<AlertDialogTriggerProps>, forwardedRef) => {\n if (props['__native']) {\n const { __native, onPress, __onPress, ...rest } = props as any\n return (\n <NativeAlertDialogTriggerFrame\n {...rest}\n onPress={composeEventHandlers(onPress, __onPress)}\n />\n )\n }\n\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\nconst AlertDialogOverlayFrame = styled(DialogOverlayFrame, {\n name: OVERLAY_NAME,\n})\n\ninterface AlertDialogOverlayProps extends DialogOverlayProps {}\n\nconst AlertDialogOverlay = AlertDialogOverlayFrame.extractable(\n 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)\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(\n contentProps.onOpenAutoFocus,\n (event) => {\n event.preventDefault()\n if (isWeb) {\n // @ts-ignore\n cancelRef.current?.focus({ preventScroll: true })\n }\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<\n TamaguiElement,\n 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\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 if (process.env.NODE_ENV === 'development') {\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) {\n // eslint-disable-next-line no-console\n console.warn(`\\`${CONTENT_NAME}\\` requires a description for the component to be accessible for screen reader users.\n \n 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.\n \n 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.\n \n For more information, see https://tamagui.dev/docs/components/alert-dialog`)\n }\n }, [contentRef])\n }\n\n return null\n}\n\nconst AlertDialogInner: React.FC<AlertDialogProps> = (\n props: ScopedProps<AlertDialogProps>\n) => {\n const { __scopeAlertDialog, native, ...alertDialogProps } = props\n const dialogScope = useDialogScope(__scopeAlertDialog)\n\n if (process.env.TAMAGUI_TARGET === 'native') {\n const [open, setOpen] = useControllableState({\n prop: props.open,\n defaultProp: props.defaultOpen || false,\n onChange: props.onOpenChange,\n transition: true,\n })\n\n let triggerElement: any = null\n let title = ''\n let description = ''\n const buttons: {\n text: string\n onPress: (value?: string | undefined) => void\n style?: 'default' | 'cancel' | 'destructive'\n }[] = []\n\n forEachChildDeep(React.Children.toArray(props.children), (child) => {\n if (!React.isValidElement(child)) return false\n const name = isTamaguiElement(child)\n ? child.type.staticConfig.componentName\n : (child.type['displayName'] as string | undefined)\n switch (name) {\n case TRIGGER_NAME: {\n triggerElement = React.cloneElement(child as any, {\n __native: true,\n })\n return false\n }\n case TITLE_NAME: {\n title = getStringChildren(child)\n return false\n }\n case DESCRIPTION_NAME: {\n description = getStringChildren(child)\n return false\n }\n case ACTION_NAME:\n case CANCEL_NAME: {\n const style = name === ACTION_NAME ? 'default' : 'cancel'\n const text = getStringChildren(child)\n const onPress = () => {\n const childProps = child.props as any\n childProps?.onPress?.({ native: true })\n setOpen(false)\n }\n buttons.push({\n style,\n text,\n // @ts-ignore\n onPress,\n })\n return false\n }\n default: {\n return true\n }\n }\n })\n\n useIsomorphicLayoutEffect(() => {\n if (!open || !native) return\n if (title || description) {\n Alert.alert(title, description, buttons)\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [native, open])\n\n if (native) {\n return React.cloneElement(triggerElement, {\n __onPress: () => {\n setOpen(true)\n },\n })\n }\n }\n\n return <Dialog {...dialogScope} {...alertDialogProps} modal />\n}\n\nfunction forEachChildDeep(\n children: React.ReactNode[],\n onChild: (el: React.ReactElement) => boolean\n) {\n for (const child of children) {\n if (!React.isValidElement(child)) continue\n if (!onChild(child)) continue\n if (child.props.children) {\n forEachChildDeep(React.Children.toArray(child.props.children), onChild)\n }\n }\n}\n\nfunction getStringChildren(child: React.ReactElement) {\n let string = ''\n forEachChildDeep(React.Children.toArray(child), (child) => {\n if (typeof child.props.children === 'string') {\n string = child.props.children\n return false\n }\n return true\n })\n return string\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": "AA2EQ,cAAAA,EAwFE,QAAAC,OAxFF,oBAxER,OAAS,mBAAAC,MAAuB,wBAChC,OACE,aAAAC,EAEA,wBAAAC,EACA,oBAAAC,EACA,SAAAC,EACA,UAAAC,EACA,6BAAAC,EACA,wBAAAC,MACK,gBACP,OAAgB,sBAAAC,MAA0B,0BAC1C,OACE,UAAAC,EACA,eAAAC,EAEA,iBAAAC,EAEA,qBAAAC,EAEA,iBAAAC,GACA,sBAAAC,GAEA,gBAAAC,GAGA,eAAAC,GAEA,iBAAAC,GAEA,yBAAAC,GACA,qBAAAC,MACK,kBACP,OAAS,UAAAC,OAAc,kBACvB,OAAS,wBAAAC,OAA4B,kCACrC,UAAYC,MAAW,QACvB,OAAS,SAAAC,OAAa,eAMtB,MAAMC,EAAY,cAGZ,CAACC,GAA0BC,EAAsB,EAAIlB,EAAmBgB,EAAW,CACvFL,CACF,CAAC,EAEKQ,EAAiBR,EAAkB,EAUnCS,EAAe,qBAIfC,GAAgCxB,EAAOe,GAAQ,CACnD,KAAM,eACR,CAAC,EAEKU,EAAqBR,EAAM,WAC/B,CAACS,EAA6CC,IAAiB,CAC7D,GAAID,EAAM,SAAa,CACrB,KAAM,CAAE,SAAAE,EAAU,QAAAC,EAAS,UAA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EACb7B,EAAM,eAAe4D,CAAK,GAC1BM,EAAQN,CAAK,GACdA,EAAM,MAAM,UACdD,EAAiB3D,EAAM,SAAS,QAAQ4D,EAAM,MAAM,QAAQ,EAAGM,CAAO,CAG5E,CAEA,SAASJ,EAAkBF,EAA2B,CACpD,IAAIO,EAAS,GACb,OAAAR,EAAiB3D,EAAM,SAAS,QAAQ4D,CAAK,EAAIA,GAC3C,OAAOA,EAAM,MAAM,UAAa,UAClCO,EAASP,EAAM,MAAM,SACd,IAEF,EACR,EACMO,CACT,CAEA,MAAMC,EAAcnF,EAAqBiE,GAAkB,CACzD,QAAS1C,EACT,OAAQW,EACR,QAASI,EACT,QAASK,EACT,OAAQgB,EACR,OAAQG,EACR,MAAOT,EACP,YAAaG,CACf,CAAC,EAED2B,EAAY,YAAclE",
6
- "names": ["jsx", "jsxs", "useComposedRefs", "Slottable", "composeEventHandlers", "isTamaguiElement", "isWeb", "styled", "useIsomorphicLayoutEffect", "withStaticProperties", "createContextScope", "Dialog", "DialogClose", "DialogContent", "DialogDescription", "DialogOverlay", "DialogOverlayFrame", "DialogPortal", "DialogTitle", "DialogTrigger", "DialogWarningProvider", "createDialogScope", "YStack", "useControllableState", "React", "Alert", "ROOT_NAME", "createAlertDialogContext", "createAlertDialogScope", "useDialogScope", "TRIGGER_NAME", "NativeAlertDialogTriggerFrame", "AlertDialogTrigger", "props", "forwardedRef", "__native", "onPress", "__onPress", "rest", "__scopeAlertDialog", "triggerProps", "dialogScope", "PORTAL_NAME", "AlertDialogPortal", "portalProps", "OVERLAY_NAME", "AlertDialogOverlayFrame", "AlertDialogOverlay", "overlayProps", "CONTENT_NAME", "AlertDialogContentProvider", "useAlertDialogContentContext", "AlertDialogContent", "children", "contentProps", "contentRef", "composedRefs", "cancelRef", "TITLE_NAME", "event", "_a", "DescriptionWarning", "AlertDialogTitle", "titleProps", "DESCRIPTION_NAME", "AlertDialogDescription", "descriptionProps", "ACTION_NAME", "AlertDialogAction", "actionProps", "CANCEL_NAME", "AlertDialogCancel", "cancelProps", "ref", "AlertDialogInner", "native", "alertDialogProps", "open", "setOpen", "triggerElement", "title", "description", "buttons", "forEachChildDeep", "child", "name", "getStringChildren", "style", "text", "childProps", "onChild", "string", "AlertDialog"]
5
+ "mappings": "AA2EQ,cAwFE,YAxFF;AAxER,SAAS,uBAAuB;AAChC;AAAA,EACE;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAgB,0BAA0B;AAC1C;AAAA,EACE;AAAA,EACA;AAAA,EAEA;AAAA,EAEA;AAAA,EAEA;AAAA,EACA;AAAA,EAEA;AAAA,EAGA;AAAA,EAEA;AAAA,EAEA;AAAA,EACA;AAAA,OACK;AACP,SAAS,cAAc;AACvB,SAAS,4BAA4B;AACrC,YAAY,WAAW;AACvB,SAAS,aAAa;AAMtB,MAAM,YAAY;AAGlB,MAAM,CAAC,0BAA0B,sBAAsB,IAAI,mBAAmB,WAAW;AAAA,EACvF;AACF,CAAC;AAED,MAAM,iBAAiB,kBAAkB;AAUzC,MAAM,eAAe;AAIrB,MAAM,gCAAgC,OAAO,QAAQ;AAAA,EACnD,MAAM;AACR,CAAC;AAED,MAAM,qBAAqB,MAAM;AAAA,EAC/B,CAAC,OAA6C,iBAAiB;AAC7D,QAAI,MAAM,UAAU,GAAG;AACrB,YAAM,EAAE,UAAU,SAAS,WAAW,GAAG,KAAK,IAAI;AAClD,aACE;AAAA,QAAC;AAAA;AAAA,UACE,GAAG;AAAA,UACJ,SAAS,qBAAqB,SAAS,SAAS;AAAA;AAAA,MAClD;AAAA,IAEJ;AAEA,UAAM,EAAE,oBAAoB,GAAG,aAAa,IAAI;AAChD,UAAM,cAAc,eAAe,kBAAkB;AACrD,WAAO,oBAAC,iBAAe,GAAG,aAAc,GAAG,cAAc,KAAK,cAAc;AAAA,EAC9E;AACF;AAEA,mBAAmB,cAAc;AAMjC,MAAM,cAAc;AAIpB,MAAM,oBAAsD,C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