@tamagui/alert-dialog 1.111.8 → 1.111.10
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/esm/AlertDialog.native.js +238 -179
- package/dist/esm/AlertDialog.native.js.map +1 -6
- package/dist/esm/index.native.js +2 -2
- package/dist/esm/index.native.js.map +1 -6
- package/package.json +20 -20
- package/dist/esm/AlertDialog.native.mjs +0 -309
- package/dist/esm/AlertDialog.native.mjs.map +0 -1
- package/dist/esm/index.native.mjs +0 -2
- package/dist/esm/index.native.mjs.map +0 -1
|
@@ -8,204 +8,275 @@ import { composeEventHandlers, withStaticProperties } from "@tamagui/helpers";
|
|
|
8
8
|
import { useControllableState } from "@tamagui/use-controllable-state";
|
|
9
9
|
import * as React from "react";
|
|
10
10
|
import { Alert } from "react-native";
|
|
11
|
-
var ROOT_NAME = "AlertDialog",
|
|
12
|
-
createDialogScope
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
11
|
+
var ROOT_NAME = "AlertDialog",
|
|
12
|
+
[createAlertDialogContext, createAlertDialogScope] = createContextScope(ROOT_NAME, [createDialogScope]),
|
|
13
|
+
useDialogScope = createDialogScope(),
|
|
14
|
+
TRIGGER_NAME = "AlertDialogTrigger",
|
|
15
|
+
NativeAlertDialogTriggerFrame = styled(View, {
|
|
16
|
+
name: TRIGGER_NAME
|
|
17
|
+
}),
|
|
18
|
+
AlertDialogTrigger = /* @__PURE__ */React.forwardRef(function (props, forwardedRef) {
|
|
19
|
+
if (props.__native) {
|
|
20
|
+
var {
|
|
21
|
+
__native,
|
|
22
|
+
onPress,
|
|
23
|
+
__onPress,
|
|
24
|
+
...rest
|
|
25
|
+
} = props;
|
|
26
|
+
return /* @__PURE__ */_jsx(NativeAlertDialogTriggerFrame, {
|
|
27
|
+
...rest,
|
|
28
|
+
onPress: composeEventHandlers(onPress, __onPress)
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
var {
|
|
32
|
+
__scopeAlertDialog,
|
|
33
|
+
...triggerProps
|
|
34
|
+
} = props,
|
|
35
|
+
dialogScope = useDialogScope(__scopeAlertDialog);
|
|
36
|
+
return /* @__PURE__ */_jsx(DialogTrigger, {
|
|
37
|
+
...dialogScope,
|
|
38
|
+
...triggerProps,
|
|
39
|
+
ref: forwardedRef
|
|
21
40
|
});
|
|
22
|
-
}
|
|
23
|
-
var { __scopeAlertDialog, ...triggerProps } = props, dialogScope = useDialogScope(__scopeAlertDialog);
|
|
24
|
-
return /* @__PURE__ */ _jsx(DialogTrigger, {
|
|
25
|
-
...dialogScope,
|
|
26
|
-
...triggerProps,
|
|
27
|
-
ref: forwardedRef
|
|
28
41
|
});
|
|
29
|
-
});
|
|
30
42
|
AlertDialogTrigger.displayName = TRIGGER_NAME;
|
|
31
|
-
var PORTAL_NAME = "AlertDialogPortal",
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
43
|
+
var PORTAL_NAME = "AlertDialogPortal",
|
|
44
|
+
AlertDialogPortal = function (props) {
|
|
45
|
+
var {
|
|
46
|
+
__scopeAlertDialog,
|
|
47
|
+
...portalProps
|
|
48
|
+
} = props,
|
|
49
|
+
dialogScope = useDialogScope(__scopeAlertDialog);
|
|
50
|
+
return /* @__PURE__ */_jsx(DialogPortal, {
|
|
51
|
+
...dialogScope,
|
|
52
|
+
...portalProps
|
|
53
|
+
});
|
|
54
|
+
};
|
|
38
55
|
AlertDialogPortal.displayName = PORTAL_NAME;
|
|
39
|
-
var OVERLAY_NAME = "AlertDialogOverlay",
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
56
|
+
var OVERLAY_NAME = "AlertDialogOverlay",
|
|
57
|
+
AlertDialogOverlayFrame = styled(DialogOverlayFrame, {
|
|
58
|
+
name: OVERLAY_NAME
|
|
59
|
+
}),
|
|
60
|
+
AlertDialogOverlay = AlertDialogOverlayFrame.extractable(/* @__PURE__ */React.forwardRef(function (props, forwardedRef) {
|
|
61
|
+
var {
|
|
62
|
+
__scopeAlertDialog,
|
|
63
|
+
...overlayProps
|
|
64
|
+
} = props,
|
|
65
|
+
dialogScope = useDialogScope(__scopeAlertDialog);
|
|
66
|
+
return /* @__PURE__ */_jsx(DialogOverlay, {
|
|
67
|
+
...dialogScope,
|
|
68
|
+
...overlayProps,
|
|
69
|
+
ref: forwardedRef
|
|
70
|
+
});
|
|
71
|
+
}));
|
|
49
72
|
AlertDialogOverlay.displayName = OVERLAY_NAME;
|
|
50
|
-
var CONTENT_NAME = "AlertDialogContent",
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
73
|
+
var CONTENT_NAME = "AlertDialogContent",
|
|
74
|
+
[AlertDialogContentProvider, useAlertDialogContentContext] = createAlertDialogContext(CONTENT_NAME),
|
|
75
|
+
AlertDialogContent = /* @__PURE__ */React.forwardRef(function (props, forwardedRef) {
|
|
76
|
+
var {
|
|
77
|
+
__scopeAlertDialog,
|
|
78
|
+
children,
|
|
79
|
+
...contentProps
|
|
80
|
+
} = props,
|
|
81
|
+
dialogScope = useDialogScope(__scopeAlertDialog),
|
|
82
|
+
contentRef = React.useRef(null),
|
|
83
|
+
composedRefs = useComposedRefs(forwardedRef, contentRef),
|
|
84
|
+
cancelRef = React.useRef(null);
|
|
85
|
+
return /* @__PURE__ */_jsx(DialogWarningProvider, {
|
|
86
|
+
contentName: CONTENT_NAME,
|
|
87
|
+
titleName: TITLE_NAME,
|
|
88
|
+
docsSlug: "alert-dialog",
|
|
89
|
+
children: /* @__PURE__ */_jsx(AlertDialogContentProvider, {
|
|
90
|
+
scope: __scopeAlertDialog,
|
|
91
|
+
cancelRef,
|
|
92
|
+
children: /* @__PURE__ */_jsxs(DialogContent, {
|
|
93
|
+
// @ts-ignore
|
|
94
|
+
role: "alertdialog",
|
|
95
|
+
...dialogScope,
|
|
96
|
+
...contentProps,
|
|
97
|
+
ref: composedRefs,
|
|
98
|
+
onOpenAutoFocus: composeEventHandlers(contentProps.onOpenAutoFocus, function (event) {
|
|
99
|
+
if (event.preventDefault(), isWeb) {
|
|
100
|
+
var _cancelRef_current;
|
|
101
|
+
(_cancelRef_current = cancelRef.current) === null || _cancelRef_current === void 0 || _cancelRef_current.focus({
|
|
102
|
+
preventScroll: !0
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
}),
|
|
106
|
+
onPointerDownOutside: function (event) {
|
|
107
|
+
return event.preventDefault();
|
|
108
|
+
},
|
|
109
|
+
onInteractOutside: function (event) {
|
|
110
|
+
return event.preventDefault();
|
|
111
|
+
},
|
|
112
|
+
children: [
|
|
80
113
|
/**
|
|
81
114
|
* We have to use `Slottable` here as we cannot wrap the `AlertDialogContentProvider`
|
|
82
115
|
* around everything, otherwise the `DescriptionWarning` would be rendered straight away.
|
|
83
116
|
* This is because we want the accessibility checks to run only once the content is actually
|
|
84
117
|
* open and that behaviour is already encapsulated in `DialogContent`.
|
|
85
118
|
*/
|
|
86
|
-
/* @__PURE__ */
|
|
119
|
+
/* @__PURE__ */
|
|
120
|
+
_jsx(Slottable, {
|
|
87
121
|
children
|
|
88
|
-
}),
|
|
89
|
-
process.env.NODE_ENV === "development" && /* @__PURE__ */ _jsx(DescriptionWarning, {
|
|
122
|
+
}), process.env.NODE_ENV === "development" && /* @__PURE__ */_jsx(DescriptionWarning, {
|
|
90
123
|
contentRef
|
|
91
|
-
})
|
|
92
|
-
|
|
124
|
+
})]
|
|
125
|
+
})
|
|
93
126
|
})
|
|
94
|
-
})
|
|
127
|
+
});
|
|
95
128
|
});
|
|
96
|
-
});
|
|
97
129
|
AlertDialogContent.displayName = CONTENT_NAME;
|
|
98
|
-
var TITLE_NAME = "AlertDialogTitle",
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
130
|
+
var TITLE_NAME = "AlertDialogTitle",
|
|
131
|
+
AlertDialogTitle = /* @__PURE__ */React.forwardRef(function (props, forwardedRef) {
|
|
132
|
+
var {
|
|
133
|
+
__scopeAlertDialog,
|
|
134
|
+
...titleProps
|
|
135
|
+
} = props,
|
|
136
|
+
dialogScope = useDialogScope(__scopeAlertDialog);
|
|
137
|
+
return /* @__PURE__ */_jsx(DialogTitle, {
|
|
138
|
+
...dialogScope,
|
|
139
|
+
...titleProps,
|
|
140
|
+
ref: forwardedRef
|
|
141
|
+
});
|
|
104
142
|
});
|
|
105
|
-
});
|
|
106
143
|
AlertDialogTitle.displayName = TITLE_NAME;
|
|
107
|
-
var DESCRIPTION_NAME = "AlertDialogDescription",
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
144
|
+
var DESCRIPTION_NAME = "AlertDialogDescription",
|
|
145
|
+
AlertDialogDescription = /* @__PURE__ */React.forwardRef(function (props, forwardedRef) {
|
|
146
|
+
var {
|
|
147
|
+
__scopeAlertDialog,
|
|
148
|
+
...descriptionProps
|
|
149
|
+
} = props,
|
|
150
|
+
dialogScope = useDialogScope(__scopeAlertDialog);
|
|
151
|
+
return /* @__PURE__ */_jsx(DialogDescription, {
|
|
152
|
+
...dialogScope,
|
|
153
|
+
...descriptionProps,
|
|
154
|
+
ref: forwardedRef
|
|
155
|
+
});
|
|
113
156
|
});
|
|
114
|
-
});
|
|
115
157
|
AlertDialogDescription.displayName = DESCRIPTION_NAME;
|
|
116
|
-
var ACTION_NAME = "AlertDialogAction",
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
158
|
+
var ACTION_NAME = "AlertDialogAction",
|
|
159
|
+
AlertDialogAction = /* @__PURE__ */React.forwardRef(function (props, forwardedRef) {
|
|
160
|
+
var {
|
|
161
|
+
__scopeAlertDialog,
|
|
162
|
+
...actionProps
|
|
163
|
+
} = props,
|
|
164
|
+
dialogScope = useDialogScope(__scopeAlertDialog);
|
|
165
|
+
return /* @__PURE__ */_jsx(DialogClose, {
|
|
166
|
+
...dialogScope,
|
|
167
|
+
...actionProps,
|
|
168
|
+
ref: forwardedRef
|
|
169
|
+
});
|
|
122
170
|
});
|
|
123
|
-
});
|
|
124
171
|
AlertDialogAction.displayName = ACTION_NAME;
|
|
125
|
-
var CANCEL_NAME = "AlertDialogCancel",
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
172
|
+
var CANCEL_NAME = "AlertDialogCancel",
|
|
173
|
+
AlertDialogCancel = /* @__PURE__ */React.forwardRef(function (props, forwardedRef) {
|
|
174
|
+
var {
|
|
175
|
+
__scopeAlertDialog,
|
|
176
|
+
...cancelProps
|
|
177
|
+
} = props,
|
|
178
|
+
{
|
|
179
|
+
cancelRef
|
|
180
|
+
} = useAlertDialogContentContext(CANCEL_NAME, __scopeAlertDialog),
|
|
181
|
+
dialogScope = useDialogScope(__scopeAlertDialog),
|
|
182
|
+
ref = useComposedRefs(forwardedRef, cancelRef);
|
|
183
|
+
return /* @__PURE__ */_jsx(DialogClose, {
|
|
184
|
+
...dialogScope,
|
|
185
|
+
...cancelProps,
|
|
186
|
+
ref
|
|
187
|
+
});
|
|
131
188
|
});
|
|
132
|
-
});
|
|
133
189
|
AlertDialogCancel.displayName = CANCEL_NAME;
|
|
134
|
-
var DescriptionWarning = function(param) {
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
var
|
|
140
|
-
|
|
190
|
+
var DescriptionWarning = function (param) {
|
|
191
|
+
var {
|
|
192
|
+
contentRef
|
|
193
|
+
} = param;
|
|
194
|
+
return process.env.NODE_ENV === "development" && React.useEffect(function () {
|
|
195
|
+
var _contentRef_current;
|
|
196
|
+
if (isWeb) {
|
|
197
|
+
var hasDescription = document.getElementById((_contentRef_current = contentRef.current) === null || _contentRef_current === void 0 ? void 0 : _contentRef_current.getAttribute("aria-describedby"));
|
|
198
|
+
hasDescription || console.warn(`\`${CONTENT_NAME}\` requires a description for the component to be accessible for screen reader users.
|
|
141
199
|
|
|
142
200
|
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.
|
|
143
201
|
|
|
144
202
|
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.
|
|
145
203
|
|
|
146
204
|
For more information, see https://tamagui.dev/docs/components/alert-dialog`);
|
|
147
|
-
}
|
|
148
|
-
}, [
|
|
149
|
-
contentRef
|
|
150
|
-
]), null;
|
|
151
|
-
}, AlertDialogInner = function(props) {
|
|
152
|
-
var { __scopeAlertDialog, native, ...alertDialogProps } = props, dialogScope = useDialogScope(__scopeAlertDialog), [open, setOpen] = useControllableState({
|
|
153
|
-
prop: props.open,
|
|
154
|
-
defaultProp: props.defaultOpen || !1,
|
|
155
|
-
onChange: props.onOpenChange,
|
|
156
|
-
transition: !0
|
|
157
|
-
}), triggerElement = null, title = "", description = "", buttons = [];
|
|
158
|
-
return forEachChildDeep(React.Children.toArray(props.children), function(child) {
|
|
159
|
-
if (!/* @__PURE__ */ React.isValidElement(child)) return !1;
|
|
160
|
-
var name = isTamaguiElement(child) ? child.type.staticConfig.componentName : child.type.displayName;
|
|
161
|
-
switch (name) {
|
|
162
|
-
case TRIGGER_NAME:
|
|
163
|
-
return triggerElement = /* @__PURE__ */ React.cloneElement(child, {
|
|
164
|
-
__native: !0
|
|
165
|
-
}), !1;
|
|
166
|
-
case TITLE_NAME:
|
|
167
|
-
return title = getStringChildren(child), !1;
|
|
168
|
-
case DESCRIPTION_NAME:
|
|
169
|
-
return description = getStringChildren(child), !1;
|
|
170
|
-
case ACTION_NAME:
|
|
171
|
-
case CANCEL_NAME: {
|
|
172
|
-
var style = name === ACTION_NAME ? "default" : "cancel", text = getStringChildren(child), onPress = function() {
|
|
173
|
-
var _childProps_onPress, childProps = child.props;
|
|
174
|
-
childProps == null || (_childProps_onPress = childProps.onPress) === null || _childProps_onPress === void 0 || _childProps_onPress.call(childProps, {
|
|
175
|
-
native: !0
|
|
176
|
-
}), setOpen(!1);
|
|
177
|
-
};
|
|
178
|
-
return buttons.push({
|
|
179
|
-
style,
|
|
180
|
-
text,
|
|
181
|
-
// @ts-ignore
|
|
182
|
-
onPress
|
|
183
|
-
}), !1;
|
|
184
205
|
}
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
206
|
+
}, [contentRef]), null;
|
|
207
|
+
},
|
|
208
|
+
AlertDialogInner = function (props) {
|
|
209
|
+
var {
|
|
210
|
+
__scopeAlertDialog,
|
|
211
|
+
native,
|
|
212
|
+
...alertDialogProps
|
|
213
|
+
} = props,
|
|
214
|
+
dialogScope = useDialogScope(__scopeAlertDialog),
|
|
215
|
+
[open, setOpen] = useControllableState({
|
|
216
|
+
prop: props.open,
|
|
217
|
+
defaultProp: props.defaultOpen || !1,
|
|
218
|
+
onChange: props.onOpenChange,
|
|
219
|
+
transition: !0
|
|
220
|
+
}),
|
|
221
|
+
triggerElement = null,
|
|
222
|
+
title = "",
|
|
223
|
+
description = "",
|
|
224
|
+
buttons = [];
|
|
225
|
+
return forEachChildDeep(React.Children.toArray(props.children), function (child) {
|
|
226
|
+
if (! /* @__PURE__ */React.isValidElement(child)) return !1;
|
|
227
|
+
var name = isTamaguiElement(child) ? child.type.staticConfig.componentName : child.type.displayName;
|
|
228
|
+
switch (name) {
|
|
229
|
+
case TRIGGER_NAME:
|
|
230
|
+
return triggerElement = /* @__PURE__ */React.cloneElement(child, {
|
|
231
|
+
__native: !0
|
|
232
|
+
}), !1;
|
|
233
|
+
case TITLE_NAME:
|
|
234
|
+
return title = getStringChildren(child), !1;
|
|
235
|
+
case DESCRIPTION_NAME:
|
|
236
|
+
return description = getStringChildren(child), !1;
|
|
237
|
+
case ACTION_NAME:
|
|
238
|
+
case CANCEL_NAME:
|
|
239
|
+
{
|
|
240
|
+
var style = name === ACTION_NAME ? "default" : "cancel",
|
|
241
|
+
text = getStringChildren(child),
|
|
242
|
+
onPress = function () {
|
|
243
|
+
var _childProps_onPress,
|
|
244
|
+
childProps = child.props;
|
|
245
|
+
childProps == null || (_childProps_onPress = childProps.onPress) === null || _childProps_onPress === void 0 || _childProps_onPress.call(childProps, {
|
|
246
|
+
native: !0
|
|
247
|
+
}), setOpen(!1);
|
|
248
|
+
};
|
|
249
|
+
return buttons.push({
|
|
250
|
+
style,
|
|
251
|
+
text,
|
|
252
|
+
// @ts-ignore
|
|
253
|
+
onPress
|
|
254
|
+
}), !1;
|
|
255
|
+
}
|
|
256
|
+
default:
|
|
257
|
+
return !0;
|
|
258
|
+
}
|
|
259
|
+
}), useIsomorphicLayoutEffect(function () {
|
|
260
|
+
!open || !native || (title || description) && Alert.alert(title, description, buttons);
|
|
261
|
+
}, [native, open]), native ? /* @__PURE__ */React.cloneElement(triggerElement, {
|
|
262
|
+
__onPress: function () {
|
|
263
|
+
setOpen(!0);
|
|
264
|
+
}
|
|
265
|
+
}) : /* @__PURE__ */_jsx(Dialog, {
|
|
266
|
+
...dialogScope,
|
|
267
|
+
...alertDialogProps,
|
|
268
|
+
modal: !0
|
|
269
|
+
});
|
|
270
|
+
};
|
|
203
271
|
function forEachChildDeep(children, onChild) {
|
|
204
|
-
var _iteratorNormalCompletion = !0,
|
|
272
|
+
var _iteratorNormalCompletion = !0,
|
|
273
|
+
_didIteratorError = !1,
|
|
274
|
+
_iteratorError = void 0;
|
|
205
275
|
try {
|
|
206
276
|
for (var _iterator = children[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
|
|
207
277
|
var child = _step.value;
|
|
208
|
-
/* @__PURE__ */
|
|
278
|
+
/* @__PURE__ */
|
|
279
|
+
React.isValidElement(child) && onChild(child) && child.props.children && forEachChildDeep(React.Children.toArray(child.props.children), onChild);
|
|
209
280
|
}
|
|
210
281
|
} catch (err) {
|
|
211
282
|
_didIteratorError = !0, _iteratorError = err;
|
|
@@ -213,14 +284,13 @@ function forEachChildDeep(children, onChild) {
|
|
|
213
284
|
try {
|
|
214
285
|
!_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
|
|
215
286
|
} finally {
|
|
216
|
-
if (_didIteratorError)
|
|
217
|
-
throw _iteratorError;
|
|
287
|
+
if (_didIteratorError) throw _iteratorError;
|
|
218
288
|
}
|
|
219
289
|
}
|
|
220
290
|
}
|
|
221
291
|
function getStringChildren(child) {
|
|
222
292
|
var string = "";
|
|
223
|
-
return forEachChildDeep(React.Children.toArray(child), function(child2) {
|
|
293
|
+
return forEachChildDeep(React.Children.toArray(child), function (child2) {
|
|
224
294
|
return typeof child2.props.children == "string" ? (string = child2.props.children, !1) : !0;
|
|
225
295
|
}), string;
|
|
226
296
|
}
|
|
@@ -235,16 +305,5 @@ var AlertDialog = withStaticProperties(AlertDialogInner, {
|
|
|
235
305
|
Description: AlertDialogDescription
|
|
236
306
|
});
|
|
237
307
|
AlertDialog.displayName = ROOT_NAME;
|
|
238
|
-
export {
|
|
239
|
-
|
|
240
|
-
AlertDialogAction,
|
|
241
|
-
AlertDialogCancel,
|
|
242
|
-
AlertDialogContent,
|
|
243
|
-
AlertDialogDescription,
|
|
244
|
-
AlertDialogOverlay,
|
|
245
|
-
AlertDialogPortal,
|
|
246
|
-
AlertDialogTitle,
|
|
247
|
-
AlertDialogTrigger,
|
|
248
|
-
createAlertDialogScope
|
|
249
|
-
};
|
|
250
|
-
//# sourceMappingURL=AlertDialog.js.map
|
|
308
|
+
export { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, createAlertDialogScope };
|
|
309
|
+
//# sourceMappingURL=AlertDialog.native.js.map
|
|
@@ -1,6 +1 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/Users/n8/tamagui/code/ui/alert-dialog/src/AlertDialog.tsx"],
|
|
4
|
-
"mappings": ";AAGA,SAASA,uBAAuB;AAChC,SAASC,OAAOC,iCAAiC;AAEjD,SAASC,WAAWC,MAAMC,kBAAkBC,cAAc;AAE1D,SAASC,0BAA0B;AAWnC,SACEC,QACAC,aACAC,eACAC,mBACAC,eACAC,oBACAC,cACAC,aACAC,eACAC,uBACAC,yBACK;AACP,SAASC,sBAAsBC,4BAA4B;AAC3D,SAASC,4BAA4B;AACrC,YAAYC,WAAW;AACvB,SAASC,aAAa;AAMtB,IAAMC,YAAY,eAGZ,CAACC,0BAA0BC,sBAAAA,IAA0BnB,mBAAmBiB,WAAW;EACvFN;CACD,GAEKS,iBAAiBT,kBAAAA,GAUjBU,eAAe,sBAIfC,gCAAgCvB,OAAOF,MAAM;EACjD0B,MAAMF;AACR,CAAA,GAEMG,qBAAqBT,sBAAMU,WAC/B,SAACC,OAA6CC,cAAAA;AAC5C,MAAID,MAAM,UAAa;AACrB,QAAM,EAAEE,UAAUC,SAASC,WAAW,GAAGC,K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,qBAAC9F,QAAAA;IAAQ,GAAGiC;IAAc,GAAG2D;IAAkB4B,OAAK;;AAC7D;AAEA,SAASf,iBACPzD,UACAyE,SAA4C;MAEvC,4BAAA,IAAA,oBAAA,IAAA,iBAAA;;AAAL,aAAK,YAAezE,SAAAA,OAAAA,QAAAA,EAAAA,GAAf,OAAA,EAAA,6BAAA,QAAA,UAAA,KAAA,GAAA,OAAA,4BAAA,IAAyB;AAAzB,UAAM4D,QAAN,MAAA;AACH,MAAK9F,sBAAM+F,eAAeD,KAAAA,KACrBa,QAAQb,KAAAA,KACTA,MAAMnF,MAAMuB,YACdyD,iBAAiB3F,MAAM4F,SAASC,QAAQC,MAAMnF,MAAMuB,QAAQ,GAAGyE,OAAAA;IAEnE;;AANK,wBAAA,IAAA,iBAAA;;;OAAA,6BAAA,UAAA,UAAA,QAAA,UAAA,OAAA;;UAAA;cAAA;;;AAOP;AAEA,SAASP,kBAAkBN,OAAyB;AAClD,MAAIc,SAAS;AACbjB,0BAAiB3F,MAAM4F,SAASC,QAAQC,KAAAA,GAAQ,SAACA,QAAAA;AAC/C,WAAI,OAAOA,OAAMnF,MAAMuB,YAAa,YAClC0E,SAASd,OAAMnF,MAAMuB,UACd,MAEF;EACT,CAAA,GACO0E;AACT;AAEA,IAAMC,cAAc/G,qBAAqB8E,kBAAkB;EACzDkC,SAASrG;EACTsG,QAAQxF;EACRyF,SAASrF;EACTsF,SAAShF;EACTiF,QAAQlD;EACRmD,QAAQhD;EACRiD,OAAO1D;EACP2D,aAAaxD;AACf,CAAA;AAEAgD,YAAYxF,cAAcnB;",
|
|
5
|
-
"names": ["useComposedRefs", "isWeb", "useIsomorphicLayoutEffect", "Slottable", "View", "isTamaguiElement", "styled", "createContextScope", "Dialog", "DialogClose", "DialogContent", "DialogDescription", "DialogOverlay", "DialogOverlayFrame", "DialogPortal", "DialogTitle", "DialogTrigger", "DialogWarningProvider", "createDialogScope", "composeEventHandlers", "withStaticProperties", "useControllableState", "React", "Alert", "ROOT_NAME", "createAlertDialogContext", "createAlertDialogScope", "useDialogScope", "TRIGGER_NAME", "NativeAlertDialogTriggerFrame", "name", "AlertDialogTrigger", "forwardRef", "props", "forwardedRef", "__native", "onPress", "__onPress", "rest", "__scopeAlertDialog", "triggerProps", "dialogScope", "ref", "displayName", "PORTAL_NAME", "AlertDialogPortal", "portalProps", "OVERLAY_NAME", "AlertDialogOverlayFrame", "AlertDialogOverlay", "extractable", "overlayProps", "CONTENT_NAME", "AlertDialogContentProvider", "useAlertDialogContentContext", "AlertDialogContent", "children", "contentProps", "contentRef", "useRef", "composedRefs", "cancelRef", "contentName", "titleName", "TITLE_NAME", "docsSlug", "scope", "role", "onOpenAutoFocus", "event", "preventDefault", "current", "focus", "preventScroll", "onPointerDownOutside", "onInteractOutside", "process", "env", "NODE_ENV", "DescriptionWarning", "AlertDialogTitle", "titleProps", "DESCRIPTION_NAME", "AlertDialogDescription", "descriptionProps", "ACTION_NAME", "AlertDialogAction", "actionProps", "CANCEL_NAME", "AlertDialogCancel", "cancelProps", "useEffect", "hasDescription", "document", "getElementById", "getAttribute", "console", "warn", "AlertDialogInner", "native", "alertDialogProps", "open", "setOpen", "prop", "defaultProp", "defaultOpen", "onChange", "onOpenChange", "transition", "triggerElement", "title", "description", "buttons", "forEachChildDeep", "Children", "toArray", "child", "isValidElement", "type", "staticConfig", "componentName", "cloneElement", "getStringChildren", "style", "text", "childProps", "push", "alert", "modal", "onChild", "string", "AlertDialog", "Trigger", "Portal", "Overlay", "Content", "Action", "Cancel", "Title", "Description"]
|
|
6
|
-
}
|
|
1
|
+
{"version":3,"names":["jsx","_jsx","jsxs","_jsxs","useComposedRefs","isWeb","useIsomorphicLayoutEffect","Slottable","View","isTamaguiElement","styled","createContextScope","Dialog","DialogClose","DialogContent","DialogDescription","DialogOverlay","DialogOverlayFrame","DialogPortal","DialogTitle","DialogTrigger","DialogWarningProvider","createDialogScope","composeEventHandlers","withStaticProperties","useControllableState","React","Alert","ROOT_NAME","createAlertDialogContext","createAlertDialogScope","useDialogScope","TRIGGER_NAME","NativeAlertDialogTriggerFrame","name","AlertDialogTrigger","forwardRef","props","forwardedRef","__native","onPress","__onPress","rest","__scopeAlertDialog","triggerProps","dialogScope","ref","displayName","PORTAL_NAME","AlertDialogPortal","portalProps","OVERLAY_NAME","AlertDialogOverlayFrame","AlertDialogOverlay","extractable","overlayProps","CONTENT_NAME","AlertDialogContentProvider","useAlertDialogContentContext","AlertDialogContent","children","contentProps","contentRef","useRef","composedRefs","cancelRef","contentName","titleName","TITLE_NAME","docsSlug","scope","role","onOpenAutoFocus","event","preventDefault","_cancelRef_current","current","focus","preventScroll","onPointerDownOutside","onInteractOutside","process","env","NODE_ENV","DescriptionWarning","AlertDialogTitle","titleProps","DESCRIPTION_NAME","AlertDialogDescription","descriptionProps","ACTION_NAME","AlertDialogAction","actionProps","CANCEL_NAME","AlertDialogCancel","cancelProps","param","useEffect","_contentRef_current","hasDescription","document","getElementById","getAttribute","console","warn"],"sources":["../../src/AlertDialog.tsx"],"sourcesContent":[null],"mappings":"AAGA,SAASA,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAuB;AAChC,SAASC,eAAwC;AAEjD,SAASC,KAAA,EAAAC,yBAAiD;AAE1D,SAASC,SAAA,EAAAC,IAAA,EAAAC,gBAA0B,EAAAC,MAAA;AAWnC,SAAAC,kBAAA;AAAA,SACEC,MAAA,EAAAC,WAAA,EAAAC,aAAA,EAAAC,iBAAA,EAAAC,aAAA,EAAAC,kBAAA,EAAAC,YAAA,EAAAC,WAAA,EAAAC,aAAA,EAAAC,qBAAA,EAAAC,iBAAA;AAAA,SACAC,oBAAA,EAAAC,oBAAA;AAAA,SACAC,oBAAA;AAAA,OACA,KAAAC,KAAA;AAAA,SACAC,KAAA;AAAA,IACAC,SAAA;EAAA,CAAAC,wBAAA,EAAAC,sBAAA,IAAAnB,kBAAA,CAAAiB,SAAA,GACAN,iBAAA,EACA;EAAAS,cAAA,GAAAT,iBAAA;EAAAU,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
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
export * from "./AlertDialog.native.js";
|
|
2
|
+
//# sourceMappingURL=index.native.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/alert-dialog",
|
|
3
|
-
"version": "1.111.
|
|
3
|
+
"version": "1.111.10",
|
|
4
4
|
"source": "src/index.ts",
|
|
5
5
|
"types": "./types/index.d.ts",
|
|
6
6
|
"main": "dist/cjs",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"exports": {
|
|
27
27
|
"./package.json": "./package.json",
|
|
28
28
|
".": {
|
|
29
|
-
"react-native-import": "./dist/esm/index.native.
|
|
29
|
+
"react-native-import": "./dist/esm/index.native.js",
|
|
30
30
|
"react-native": "./dist/cjs/index.native.js",
|
|
31
31
|
"types": "./types/index.d.ts",
|
|
32
32
|
"import": "./dist/esm/index.mjs",
|
|
@@ -34,26 +34,26 @@
|
|
|
34
34
|
}
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@tamagui/animate-presence": "1.111.
|
|
38
|
-
"@tamagui/aria-hidden": "1.111.
|
|
39
|
-
"@tamagui/compose-refs": "1.111.
|
|
40
|
-
"@tamagui/constants": "1.111.
|
|
41
|
-
"@tamagui/core": "1.111.
|
|
42
|
-
"@tamagui/create-context": "1.111.
|
|
43
|
-
"@tamagui/dialog": "1.111.
|
|
44
|
-
"@tamagui/dismissable": "1.111.
|
|
45
|
-
"@tamagui/focus-scope": "1.111.
|
|
46
|
-
"@tamagui/helpers": "1.111.
|
|
47
|
-
"@tamagui/polyfill-dev": "1.111.
|
|
48
|
-
"@tamagui/popper": "1.111.
|
|
49
|
-
"@tamagui/portal": "1.111.
|
|
50
|
-
"@tamagui/remove-scroll": "1.111.
|
|
51
|
-
"@tamagui/stacks": "1.111.
|
|
52
|
-
"@tamagui/text": "1.111.
|
|
53
|
-
"@tamagui/use-controllable-state": "1.111.
|
|
37
|
+
"@tamagui/animate-presence": "1.111.10",
|
|
38
|
+
"@tamagui/aria-hidden": "1.111.10",
|
|
39
|
+
"@tamagui/compose-refs": "1.111.10",
|
|
40
|
+
"@tamagui/constants": "1.111.10",
|
|
41
|
+
"@tamagui/core": "1.111.10",
|
|
42
|
+
"@tamagui/create-context": "1.111.10",
|
|
43
|
+
"@tamagui/dialog": "1.111.10",
|
|
44
|
+
"@tamagui/dismissable": "1.111.10",
|
|
45
|
+
"@tamagui/focus-scope": "1.111.10",
|
|
46
|
+
"@tamagui/helpers": "1.111.10",
|
|
47
|
+
"@tamagui/polyfill-dev": "1.111.10",
|
|
48
|
+
"@tamagui/popper": "1.111.10",
|
|
49
|
+
"@tamagui/portal": "1.111.10",
|
|
50
|
+
"@tamagui/remove-scroll": "1.111.10",
|
|
51
|
+
"@tamagui/stacks": "1.111.10",
|
|
52
|
+
"@tamagui/text": "1.111.10",
|
|
53
|
+
"@tamagui/use-controllable-state": "1.111.10"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
|
-
"@tamagui/build": "1.111.
|
|
56
|
+
"@tamagui/build": "1.111.10",
|
|
57
57
|
"react": "^18.2.0 || ^19.0.0",
|
|
58
58
|
"react-native": "0.74.1"
|
|
59
59
|
},
|
|
@@ -1,309 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useComposedRefs } from "@tamagui/compose-refs";
|
|
3
|
-
import { isWeb, useIsomorphicLayoutEffect } from "@tamagui/constants";
|
|
4
|
-
import { Slottable, View, isTamaguiElement, styled } from "@tamagui/core";
|
|
5
|
-
import { createContextScope } from "@tamagui/create-context";
|
|
6
|
-
import { Dialog, DialogClose, DialogContent, DialogDescription, DialogOverlay, DialogOverlayFrame, DialogPortal, DialogTitle, DialogTrigger, DialogWarningProvider, createDialogScope } from "@tamagui/dialog";
|
|
7
|
-
import { composeEventHandlers, withStaticProperties } from "@tamagui/helpers";
|
|
8
|
-
import { useControllableState } from "@tamagui/use-controllable-state";
|
|
9
|
-
import * as React from "react";
|
|
10
|
-
import { Alert } from "react-native";
|
|
11
|
-
var ROOT_NAME = "AlertDialog",
|
|
12
|
-
[createAlertDialogContext, createAlertDialogScope] = createContextScope(ROOT_NAME, [createDialogScope]),
|
|
13
|
-
useDialogScope = createDialogScope(),
|
|
14
|
-
TRIGGER_NAME = "AlertDialogTrigger",
|
|
15
|
-
NativeAlertDialogTriggerFrame = styled(View, {
|
|
16
|
-
name: TRIGGER_NAME
|
|
17
|
-
}),
|
|
18
|
-
AlertDialogTrigger = /* @__PURE__ */React.forwardRef(function (props, forwardedRef) {
|
|
19
|
-
if (props.__native) {
|
|
20
|
-
var {
|
|
21
|
-
__native,
|
|
22
|
-
onPress,
|
|
23
|
-
__onPress,
|
|
24
|
-
...rest
|
|
25
|
-
} = props;
|
|
26
|
-
return /* @__PURE__ */_jsx(NativeAlertDialogTriggerFrame, {
|
|
27
|
-
...rest,
|
|
28
|
-
onPress: composeEventHandlers(onPress, __onPress)
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
var {
|
|
32
|
-
__scopeAlertDialog,
|
|
33
|
-
...triggerProps
|
|
34
|
-
} = props,
|
|
35
|
-
dialogScope = useDialogScope(__scopeAlertDialog);
|
|
36
|
-
return /* @__PURE__ */_jsx(DialogTrigger, {
|
|
37
|
-
...dialogScope,
|
|
38
|
-
...triggerProps,
|
|
39
|
-
ref: forwardedRef
|
|
40
|
-
});
|
|
41
|
-
});
|
|
42
|
-
AlertDialogTrigger.displayName = TRIGGER_NAME;
|
|
43
|
-
var PORTAL_NAME = "AlertDialogPortal",
|
|
44
|
-
AlertDialogPortal = function (props) {
|
|
45
|
-
var {
|
|
46
|
-
__scopeAlertDialog,
|
|
47
|
-
...portalProps
|
|
48
|
-
} = props,
|
|
49
|
-
dialogScope = useDialogScope(__scopeAlertDialog);
|
|
50
|
-
return /* @__PURE__ */_jsx(DialogPortal, {
|
|
51
|
-
...dialogScope,
|
|
52
|
-
...portalProps
|
|
53
|
-
});
|
|
54
|
-
};
|
|
55
|
-
AlertDialogPortal.displayName = PORTAL_NAME;
|
|
56
|
-
var OVERLAY_NAME = "AlertDialogOverlay",
|
|
57
|
-
AlertDialogOverlayFrame = styled(DialogOverlayFrame, {
|
|
58
|
-
name: OVERLAY_NAME
|
|
59
|
-
}),
|
|
60
|
-
AlertDialogOverlay = AlertDialogOverlayFrame.extractable(/* @__PURE__ */React.forwardRef(function (props, forwardedRef) {
|
|
61
|
-
var {
|
|
62
|
-
__scopeAlertDialog,
|
|
63
|
-
...overlayProps
|
|
64
|
-
} = props,
|
|
65
|
-
dialogScope = useDialogScope(__scopeAlertDialog);
|
|
66
|
-
return /* @__PURE__ */_jsx(DialogOverlay, {
|
|
67
|
-
...dialogScope,
|
|
68
|
-
...overlayProps,
|
|
69
|
-
ref: forwardedRef
|
|
70
|
-
});
|
|
71
|
-
}));
|
|
72
|
-
AlertDialogOverlay.displayName = OVERLAY_NAME;
|
|
73
|
-
var CONTENT_NAME = "AlertDialogContent",
|
|
74
|
-
[AlertDialogContentProvider, useAlertDialogContentContext] = createAlertDialogContext(CONTENT_NAME),
|
|
75
|
-
AlertDialogContent = /* @__PURE__ */React.forwardRef(function (props, forwardedRef) {
|
|
76
|
-
var {
|
|
77
|
-
__scopeAlertDialog,
|
|
78
|
-
children,
|
|
79
|
-
...contentProps
|
|
80
|
-
} = props,
|
|
81
|
-
dialogScope = useDialogScope(__scopeAlertDialog),
|
|
82
|
-
contentRef = React.useRef(null),
|
|
83
|
-
composedRefs = useComposedRefs(forwardedRef, contentRef),
|
|
84
|
-
cancelRef = React.useRef(null);
|
|
85
|
-
return /* @__PURE__ */_jsx(DialogWarningProvider, {
|
|
86
|
-
contentName: CONTENT_NAME,
|
|
87
|
-
titleName: TITLE_NAME,
|
|
88
|
-
docsSlug: "alert-dialog",
|
|
89
|
-
children: /* @__PURE__ */_jsx(AlertDialogContentProvider, {
|
|
90
|
-
scope: __scopeAlertDialog,
|
|
91
|
-
cancelRef,
|
|
92
|
-
children: /* @__PURE__ */_jsxs(DialogContent, {
|
|
93
|
-
// @ts-ignore
|
|
94
|
-
role: "alertdialog",
|
|
95
|
-
...dialogScope,
|
|
96
|
-
...contentProps,
|
|
97
|
-
ref: composedRefs,
|
|
98
|
-
onOpenAutoFocus: composeEventHandlers(contentProps.onOpenAutoFocus, function (event) {
|
|
99
|
-
if (event.preventDefault(), isWeb) {
|
|
100
|
-
var _cancelRef_current;
|
|
101
|
-
(_cancelRef_current = cancelRef.current) === null || _cancelRef_current === void 0 || _cancelRef_current.focus({
|
|
102
|
-
preventScroll: !0
|
|
103
|
-
});
|
|
104
|
-
}
|
|
105
|
-
}),
|
|
106
|
-
onPointerDownOutside: function (event) {
|
|
107
|
-
return event.preventDefault();
|
|
108
|
-
},
|
|
109
|
-
onInteractOutside: function (event) {
|
|
110
|
-
return event.preventDefault();
|
|
111
|
-
},
|
|
112
|
-
children: [
|
|
113
|
-
/**
|
|
114
|
-
* We have to use `Slottable` here as we cannot wrap the `AlertDialogContentProvider`
|
|
115
|
-
* around everything, otherwise the `DescriptionWarning` would be rendered straight away.
|
|
116
|
-
* This is because we want the accessibility checks to run only once the content is actually
|
|
117
|
-
* open and that behaviour is already encapsulated in `DialogContent`.
|
|
118
|
-
*/
|
|
119
|
-
/* @__PURE__ */
|
|
120
|
-
_jsx(Slottable, {
|
|
121
|
-
children
|
|
122
|
-
}), process.env.NODE_ENV === "development" && /* @__PURE__ */_jsx(DescriptionWarning, {
|
|
123
|
-
contentRef
|
|
124
|
-
})]
|
|
125
|
-
})
|
|
126
|
-
})
|
|
127
|
-
});
|
|
128
|
-
});
|
|
129
|
-
AlertDialogContent.displayName = CONTENT_NAME;
|
|
130
|
-
var TITLE_NAME = "AlertDialogTitle",
|
|
131
|
-
AlertDialogTitle = /* @__PURE__ */React.forwardRef(function (props, forwardedRef) {
|
|
132
|
-
var {
|
|
133
|
-
__scopeAlertDialog,
|
|
134
|
-
...titleProps
|
|
135
|
-
} = props,
|
|
136
|
-
dialogScope = useDialogScope(__scopeAlertDialog);
|
|
137
|
-
return /* @__PURE__ */_jsx(DialogTitle, {
|
|
138
|
-
...dialogScope,
|
|
139
|
-
...titleProps,
|
|
140
|
-
ref: forwardedRef
|
|
141
|
-
});
|
|
142
|
-
});
|
|
143
|
-
AlertDialogTitle.displayName = TITLE_NAME;
|
|
144
|
-
var DESCRIPTION_NAME = "AlertDialogDescription",
|
|
145
|
-
AlertDialogDescription = /* @__PURE__ */React.forwardRef(function (props, forwardedRef) {
|
|
146
|
-
var {
|
|
147
|
-
__scopeAlertDialog,
|
|
148
|
-
...descriptionProps
|
|
149
|
-
} = props,
|
|
150
|
-
dialogScope = useDialogScope(__scopeAlertDialog);
|
|
151
|
-
return /* @__PURE__ */_jsx(DialogDescription, {
|
|
152
|
-
...dialogScope,
|
|
153
|
-
...descriptionProps,
|
|
154
|
-
ref: forwardedRef
|
|
155
|
-
});
|
|
156
|
-
});
|
|
157
|
-
AlertDialogDescription.displayName = DESCRIPTION_NAME;
|
|
158
|
-
var ACTION_NAME = "AlertDialogAction",
|
|
159
|
-
AlertDialogAction = /* @__PURE__ */React.forwardRef(function (props, forwardedRef) {
|
|
160
|
-
var {
|
|
161
|
-
__scopeAlertDialog,
|
|
162
|
-
...actionProps
|
|
163
|
-
} = props,
|
|
164
|
-
dialogScope = useDialogScope(__scopeAlertDialog);
|
|
165
|
-
return /* @__PURE__ */_jsx(DialogClose, {
|
|
166
|
-
...dialogScope,
|
|
167
|
-
...actionProps,
|
|
168
|
-
ref: forwardedRef
|
|
169
|
-
});
|
|
170
|
-
});
|
|
171
|
-
AlertDialogAction.displayName = ACTION_NAME;
|
|
172
|
-
var CANCEL_NAME = "AlertDialogCancel",
|
|
173
|
-
AlertDialogCancel = /* @__PURE__ */React.forwardRef(function (props, forwardedRef) {
|
|
174
|
-
var {
|
|
175
|
-
__scopeAlertDialog,
|
|
176
|
-
...cancelProps
|
|
177
|
-
} = props,
|
|
178
|
-
{
|
|
179
|
-
cancelRef
|
|
180
|
-
} = useAlertDialogContentContext(CANCEL_NAME, __scopeAlertDialog),
|
|
181
|
-
dialogScope = useDialogScope(__scopeAlertDialog),
|
|
182
|
-
ref = useComposedRefs(forwardedRef, cancelRef);
|
|
183
|
-
return /* @__PURE__ */_jsx(DialogClose, {
|
|
184
|
-
...dialogScope,
|
|
185
|
-
...cancelProps,
|
|
186
|
-
ref
|
|
187
|
-
});
|
|
188
|
-
});
|
|
189
|
-
AlertDialogCancel.displayName = CANCEL_NAME;
|
|
190
|
-
var DescriptionWarning = function (param) {
|
|
191
|
-
var {
|
|
192
|
-
contentRef
|
|
193
|
-
} = param;
|
|
194
|
-
return process.env.NODE_ENV === "development" && React.useEffect(function () {
|
|
195
|
-
var _contentRef_current;
|
|
196
|
-
if (isWeb) {
|
|
197
|
-
var hasDescription = document.getElementById((_contentRef_current = contentRef.current) === null || _contentRef_current === void 0 ? void 0 : _contentRef_current.getAttribute("aria-describedby"));
|
|
198
|
-
hasDescription || console.warn(`\`${CONTENT_NAME}\` requires a description for the component to be accessible for screen reader users.
|
|
199
|
-
|
|
200
|
-
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.
|
|
201
|
-
|
|
202
|
-
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.
|
|
203
|
-
|
|
204
|
-
For more information, see https://tamagui.dev/docs/components/alert-dialog`);
|
|
205
|
-
}
|
|
206
|
-
}, [contentRef]), null;
|
|
207
|
-
},
|
|
208
|
-
AlertDialogInner = function (props) {
|
|
209
|
-
var {
|
|
210
|
-
__scopeAlertDialog,
|
|
211
|
-
native,
|
|
212
|
-
...alertDialogProps
|
|
213
|
-
} = props,
|
|
214
|
-
dialogScope = useDialogScope(__scopeAlertDialog),
|
|
215
|
-
[open, setOpen] = useControllableState({
|
|
216
|
-
prop: props.open,
|
|
217
|
-
defaultProp: props.defaultOpen || !1,
|
|
218
|
-
onChange: props.onOpenChange,
|
|
219
|
-
transition: !0
|
|
220
|
-
}),
|
|
221
|
-
triggerElement = null,
|
|
222
|
-
title = "",
|
|
223
|
-
description = "",
|
|
224
|
-
buttons = [];
|
|
225
|
-
return forEachChildDeep(React.Children.toArray(props.children), function (child) {
|
|
226
|
-
if (! /* @__PURE__ */React.isValidElement(child)) return !1;
|
|
227
|
-
var name = isTamaguiElement(child) ? child.type.staticConfig.componentName : child.type.displayName;
|
|
228
|
-
switch (name) {
|
|
229
|
-
case TRIGGER_NAME:
|
|
230
|
-
return triggerElement = /* @__PURE__ */React.cloneElement(child, {
|
|
231
|
-
__native: !0
|
|
232
|
-
}), !1;
|
|
233
|
-
case TITLE_NAME:
|
|
234
|
-
return title = getStringChildren(child), !1;
|
|
235
|
-
case DESCRIPTION_NAME:
|
|
236
|
-
return description = getStringChildren(child), !1;
|
|
237
|
-
case ACTION_NAME:
|
|
238
|
-
case CANCEL_NAME:
|
|
239
|
-
{
|
|
240
|
-
var style = name === ACTION_NAME ? "default" : "cancel",
|
|
241
|
-
text = getStringChildren(child),
|
|
242
|
-
onPress = function () {
|
|
243
|
-
var _childProps_onPress,
|
|
244
|
-
childProps = child.props;
|
|
245
|
-
childProps == null || (_childProps_onPress = childProps.onPress) === null || _childProps_onPress === void 0 || _childProps_onPress.call(childProps, {
|
|
246
|
-
native: !0
|
|
247
|
-
}), setOpen(!1);
|
|
248
|
-
};
|
|
249
|
-
return buttons.push({
|
|
250
|
-
style,
|
|
251
|
-
text,
|
|
252
|
-
// @ts-ignore
|
|
253
|
-
onPress
|
|
254
|
-
}), !1;
|
|
255
|
-
}
|
|
256
|
-
default:
|
|
257
|
-
return !0;
|
|
258
|
-
}
|
|
259
|
-
}), useIsomorphicLayoutEffect(function () {
|
|
260
|
-
!open || !native || (title || description) && Alert.alert(title, description, buttons);
|
|
261
|
-
}, [native, open]), native ? /* @__PURE__ */React.cloneElement(triggerElement, {
|
|
262
|
-
__onPress: function () {
|
|
263
|
-
setOpen(!0);
|
|
264
|
-
}
|
|
265
|
-
}) : /* @__PURE__ */_jsx(Dialog, {
|
|
266
|
-
...dialogScope,
|
|
267
|
-
...alertDialogProps,
|
|
268
|
-
modal: !0
|
|
269
|
-
});
|
|
270
|
-
};
|
|
271
|
-
function forEachChildDeep(children, onChild) {
|
|
272
|
-
var _iteratorNormalCompletion = !0,
|
|
273
|
-
_didIteratorError = !1,
|
|
274
|
-
_iteratorError = void 0;
|
|
275
|
-
try {
|
|
276
|
-
for (var _iterator = children[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
|
|
277
|
-
var child = _step.value;
|
|
278
|
-
/* @__PURE__ */
|
|
279
|
-
React.isValidElement(child) && onChild(child) && child.props.children && forEachChildDeep(React.Children.toArray(child.props.children), onChild);
|
|
280
|
-
}
|
|
281
|
-
} catch (err) {
|
|
282
|
-
_didIteratorError = !0, _iteratorError = err;
|
|
283
|
-
} finally {
|
|
284
|
-
try {
|
|
285
|
-
!_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
|
|
286
|
-
} finally {
|
|
287
|
-
if (_didIteratorError) throw _iteratorError;
|
|
288
|
-
}
|
|
289
|
-
}
|
|
290
|
-
}
|
|
291
|
-
function getStringChildren(child) {
|
|
292
|
-
var string = "";
|
|
293
|
-
return forEachChildDeep(React.Children.toArray(child), function (child2) {
|
|
294
|
-
return typeof child2.props.children == "string" ? (string = child2.props.children, !1) : !0;
|
|
295
|
-
}), string;
|
|
296
|
-
}
|
|
297
|
-
var AlertDialog = withStaticProperties(AlertDialogInner, {
|
|
298
|
-
Trigger: AlertDialogTrigger,
|
|
299
|
-
Portal: AlertDialogPortal,
|
|
300
|
-
Overlay: AlertDialogOverlay,
|
|
301
|
-
Content: AlertDialogContent,
|
|
302
|
-
Action: AlertDialogAction,
|
|
303
|
-
Cancel: AlertDialogCancel,
|
|
304
|
-
Title: AlertDialogTitle,
|
|
305
|
-
Description: AlertDialogDescription
|
|
306
|
-
});
|
|
307
|
-
AlertDialog.displayName = ROOT_NAME;
|
|
308
|
-
export { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, createAlertDialogScope };
|
|
309
|
-
//# sourceMappingURL=AlertDialog.native.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["jsx","_jsx","jsxs","_jsxs","useComposedRefs","isWeb","useIsomorphicLayoutEffect","Slottable","View","isTamaguiElement","styled","createContextScope","Dialog","DialogClose","DialogContent","DialogDescription","DialogOverlay","DialogOverlayFrame","DialogPortal","DialogTitle","DialogTrigger","DialogWarningProvider","createDialogScope","composeEventHandlers","withStaticProperties","useControllableState","React","Alert","ROOT_NAME","createAlertDialogContext","createAlertDialogScope","useDialogScope","TRIGGER_NAME","NativeAlertDialogTriggerFrame","name","AlertDialogTrigger","forwardRef","props","forwardedRef","__native","onPress","__onPress","rest","__scopeAlertDialog","triggerProps","dialogScope","ref","displayName","PORTAL_NAME","AlertDialogPortal","portalProps","OVERLAY_NAME","AlertDialogOverlayFrame","AlertDialogOverlay","extractable","overlayProps","CONTENT_NAME","AlertDialogContentProvider","useAlertDialogContentContext","AlertDialogContent","children","contentProps","contentRef","useRef","composedRefs","cancelRef","contentName","titleName","TITLE_NAME","docsSlug","scope","role","onOpenAutoFocus","event","preventDefault","_cancelRef_current","current","focus","preventScroll","onPointerDownOutside","onInteractOutside","process","env","NODE_ENV","DescriptionWarning","AlertDialogTitle","titleProps","DESCRIPTION_NAME","AlertDialogDescription","descriptionProps","ACTION_NAME","AlertDialogAction","actionProps","CANCEL_NAME","AlertDialogCancel","cancelProps","param","useEffect","_contentRef_current","hasDescription","document","getElementById","getA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