@tamagui/alert-dialog 1.113.1 → 1.114.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -8,275 +8,204 @@ 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
|
-
|
|
13
|
-
|
|
14
|
-
TRIGGER_NAME
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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
|
|
11
|
+
var ROOT_NAME = "AlertDialog", [createAlertDialogContext, createAlertDialogScope] = createContextScope(ROOT_NAME, [
|
|
12
|
+
createDialogScope
|
|
13
|
+
]), useDialogScope = createDialogScope(), TRIGGER_NAME = "AlertDialogTrigger", NativeAlertDialogTriggerFrame = styled(View, {
|
|
14
|
+
name: TRIGGER_NAME
|
|
15
|
+
}), AlertDialogTrigger = /* @__PURE__ */ React.forwardRef(function(props, forwardedRef) {
|
|
16
|
+
if (props.__native) {
|
|
17
|
+
var { __native, onPress, __onPress, ...rest } = props;
|
|
18
|
+
return /* @__PURE__ */ _jsx(NativeAlertDialogTriggerFrame, {
|
|
19
|
+
...rest,
|
|
20
|
+
onPress: composeEventHandlers(onPress, __onPress)
|
|
40
21
|
});
|
|
22
|
+
}
|
|
23
|
+
var { __scopeAlertDialog, ...triggerProps } = props, dialogScope = useDialogScope(__scopeAlertDialog);
|
|
24
|
+
return /* @__PURE__ */ _jsx(DialogTrigger, {
|
|
25
|
+
...dialogScope,
|
|
26
|
+
...triggerProps,
|
|
27
|
+
ref: forwardedRef
|
|
41
28
|
});
|
|
29
|
+
});
|
|
42
30
|
AlertDialogTrigger.displayName = TRIGGER_NAME;
|
|
43
|
-
var PORTAL_NAME = "AlertDialogPortal",
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
return /* @__PURE__ */_jsx(DialogPortal, {
|
|
51
|
-
...dialogScope,
|
|
52
|
-
...portalProps
|
|
53
|
-
});
|
|
54
|
-
};
|
|
31
|
+
var PORTAL_NAME = "AlertDialogPortal", AlertDialogPortal = function(props) {
|
|
32
|
+
var { __scopeAlertDialog, ...portalProps } = props, dialogScope = useDialogScope(__scopeAlertDialog);
|
|
33
|
+
return /* @__PURE__ */ _jsx(DialogPortal, {
|
|
34
|
+
...dialogScope,
|
|
35
|
+
...portalProps
|
|
36
|
+
});
|
|
37
|
+
};
|
|
55
38
|
AlertDialogPortal.displayName = PORTAL_NAME;
|
|
56
|
-
var OVERLAY_NAME = "AlertDialogOverlay",
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
})
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
return /* @__PURE__ */_jsx(DialogOverlay, {
|
|
67
|
-
...dialogScope,
|
|
68
|
-
...overlayProps,
|
|
69
|
-
ref: forwardedRef
|
|
70
|
-
});
|
|
71
|
-
}));
|
|
39
|
+
var OVERLAY_NAME = "AlertDialogOverlay", AlertDialogOverlayFrame = styled(DialogOverlayFrame, {
|
|
40
|
+
name: OVERLAY_NAME
|
|
41
|
+
}), AlertDialogOverlay = AlertDialogOverlayFrame.extractable(/* @__PURE__ */ React.forwardRef(function(props, forwardedRef) {
|
|
42
|
+
var { __scopeAlertDialog, ...overlayProps } = props, dialogScope = useDialogScope(__scopeAlertDialog);
|
|
43
|
+
return /* @__PURE__ */ _jsx(DialogOverlay, {
|
|
44
|
+
...dialogScope,
|
|
45
|
+
...overlayProps,
|
|
46
|
+
ref: forwardedRef
|
|
47
|
+
});
|
|
48
|
+
}));
|
|
72
49
|
AlertDialogOverlay.displayName = OVERLAY_NAME;
|
|
73
|
-
var CONTENT_NAME = "AlertDialogContent",
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
});
|
|
104
|
-
}
|
|
105
|
-
}),
|
|
106
|
-
onPointerDownOutside: function (event) {
|
|
107
|
-
return event.preventDefault();
|
|
108
|
-
},
|
|
109
|
-
onInteractOutside: function (event) {
|
|
110
|
-
return event.preventDefault();
|
|
111
|
-
},
|
|
112
|
-
children: [
|
|
50
|
+
var CONTENT_NAME = "AlertDialogContent", [AlertDialogContentProvider, useAlertDialogContentContext] = createAlertDialogContext(CONTENT_NAME), AlertDialogContent = /* @__PURE__ */ React.forwardRef(function(props, forwardedRef) {
|
|
51
|
+
var { __scopeAlertDialog, children, ...contentProps } = props, dialogScope = useDialogScope(__scopeAlertDialog), contentRef = React.useRef(null), composedRefs = useComposedRefs(forwardedRef, contentRef), cancelRef = React.useRef(null);
|
|
52
|
+
return /* @__PURE__ */ _jsx(DialogWarningProvider, {
|
|
53
|
+
contentName: CONTENT_NAME,
|
|
54
|
+
titleName: TITLE_NAME,
|
|
55
|
+
docsSlug: "alert-dialog",
|
|
56
|
+
children: /* @__PURE__ */ _jsx(AlertDialogContentProvider, {
|
|
57
|
+
scope: __scopeAlertDialog,
|
|
58
|
+
cancelRef,
|
|
59
|
+
children: /* @__PURE__ */ _jsxs(DialogContent, {
|
|
60
|
+
// @ts-ignore
|
|
61
|
+
role: "alertdialog",
|
|
62
|
+
...dialogScope,
|
|
63
|
+
...contentProps,
|
|
64
|
+
ref: composedRefs,
|
|
65
|
+
onOpenAutoFocus: composeEventHandlers(contentProps.onOpenAutoFocus, function(event) {
|
|
66
|
+
if (event.preventDefault(), isWeb) {
|
|
67
|
+
var _cancelRef_current;
|
|
68
|
+
(_cancelRef_current = cancelRef.current) === null || _cancelRef_current === void 0 || _cancelRef_current.focus({
|
|
69
|
+
preventScroll: !0
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
}),
|
|
73
|
+
onPointerDownOutside: function(event) {
|
|
74
|
+
return event.preventDefault();
|
|
75
|
+
},
|
|
76
|
+
onInteractOutside: function(event) {
|
|
77
|
+
return event.preventDefault();
|
|
78
|
+
},
|
|
79
|
+
children: [
|
|
113
80
|
/**
|
|
114
81
|
* We have to use `Slottable` here as we cannot wrap the `AlertDialogContentProvider`
|
|
115
82
|
* around everything, otherwise the `DescriptionWarning` would be rendered straight away.
|
|
116
83
|
* This is because we want the accessibility checks to run only once the content is actually
|
|
117
84
|
* open and that behaviour is already encapsulated in `DialogContent`.
|
|
118
85
|
*/
|
|
119
|
-
/* @__PURE__ */
|
|
120
|
-
_jsx(Slottable, {
|
|
86
|
+
/* @__PURE__ */ _jsx(Slottable, {
|
|
121
87
|
children
|
|
122
|
-
}),
|
|
88
|
+
}),
|
|
89
|
+
process.env.NODE_ENV === "development" && /* @__PURE__ */ _jsx(DescriptionWarning, {
|
|
123
90
|
contentRef
|
|
124
|
-
})
|
|
125
|
-
|
|
91
|
+
})
|
|
92
|
+
]
|
|
126
93
|
})
|
|
127
|
-
})
|
|
94
|
+
})
|
|
128
95
|
});
|
|
96
|
+
});
|
|
129
97
|
AlertDialogContent.displayName = CONTENT_NAME;
|
|
130
|
-
var TITLE_NAME = "AlertDialogTitle",
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
dialogScope = useDialogScope(__scopeAlertDialog);
|
|
137
|
-
return /* @__PURE__ */_jsx(DialogTitle, {
|
|
138
|
-
...dialogScope,
|
|
139
|
-
...titleProps,
|
|
140
|
-
ref: forwardedRef
|
|
141
|
-
});
|
|
98
|
+
var TITLE_NAME = "AlertDialogTitle", AlertDialogTitle = /* @__PURE__ */ React.forwardRef(function(props, forwardedRef) {
|
|
99
|
+
var { __scopeAlertDialog, ...titleProps } = props, dialogScope = useDialogScope(__scopeAlertDialog);
|
|
100
|
+
return /* @__PURE__ */ _jsx(DialogTitle, {
|
|
101
|
+
...dialogScope,
|
|
102
|
+
...titleProps,
|
|
103
|
+
ref: forwardedRef
|
|
142
104
|
});
|
|
105
|
+
});
|
|
143
106
|
AlertDialogTitle.displayName = TITLE_NAME;
|
|
144
|
-
var DESCRIPTION_NAME = "AlertDialogDescription",
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
dialogScope = useDialogScope(__scopeAlertDialog);
|
|
151
|
-
return /* @__PURE__ */_jsx(DialogDescription, {
|
|
152
|
-
...dialogScope,
|
|
153
|
-
...descriptionProps,
|
|
154
|
-
ref: forwardedRef
|
|
155
|
-
});
|
|
107
|
+
var DESCRIPTION_NAME = "AlertDialogDescription", AlertDialogDescription = /* @__PURE__ */ React.forwardRef(function(props, forwardedRef) {
|
|
108
|
+
var { __scopeAlertDialog, ...descriptionProps } = props, dialogScope = useDialogScope(__scopeAlertDialog);
|
|
109
|
+
return /* @__PURE__ */ _jsx(DialogDescription, {
|
|
110
|
+
...dialogScope,
|
|
111
|
+
...descriptionProps,
|
|
112
|
+
ref: forwardedRef
|
|
156
113
|
});
|
|
114
|
+
});
|
|
157
115
|
AlertDialogDescription.displayName = DESCRIPTION_NAME;
|
|
158
|
-
var ACTION_NAME = "AlertDialogAction",
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
dialogScope = useDialogScope(__scopeAlertDialog);
|
|
165
|
-
return /* @__PURE__ */_jsx(DialogClose, {
|
|
166
|
-
...dialogScope,
|
|
167
|
-
...actionProps,
|
|
168
|
-
ref: forwardedRef
|
|
169
|
-
});
|
|
116
|
+
var ACTION_NAME = "AlertDialogAction", AlertDialogAction = /* @__PURE__ */ React.forwardRef(function(props, forwardedRef) {
|
|
117
|
+
var { __scopeAlertDialog, ...actionProps } = props, dialogScope = useDialogScope(__scopeAlertDialog);
|
|
118
|
+
return /* @__PURE__ */ _jsx(DialogClose, {
|
|
119
|
+
...dialogScope,
|
|
120
|
+
...actionProps,
|
|
121
|
+
ref: forwardedRef
|
|
170
122
|
});
|
|
123
|
+
});
|
|
171
124
|
AlertDialogAction.displayName = ACTION_NAME;
|
|
172
|
-
var CANCEL_NAME = "AlertDialogCancel",
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
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
|
-
});
|
|
125
|
+
var CANCEL_NAME = "AlertDialogCancel", AlertDialogCancel = /* @__PURE__ */ React.forwardRef(function(props, forwardedRef) {
|
|
126
|
+
var { __scopeAlertDialog, ...cancelProps } = props, { cancelRef } = useAlertDialogContentContext(CANCEL_NAME, __scopeAlertDialog), dialogScope = useDialogScope(__scopeAlertDialog), ref = useComposedRefs(forwardedRef, cancelRef);
|
|
127
|
+
return /* @__PURE__ */ _jsx(DialogClose, {
|
|
128
|
+
...dialogScope,
|
|
129
|
+
...cancelProps,
|
|
130
|
+
ref
|
|
188
131
|
});
|
|
132
|
+
});
|
|
189
133
|
AlertDialogCancel.displayName = CANCEL_NAME;
|
|
190
|
-
var DescriptionWarning = function
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
var _contentRef_current;
|
|
196
|
-
|
|
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.
|
|
134
|
+
var DescriptionWarning = function(param) {
|
|
135
|
+
var { contentRef } = param;
|
|
136
|
+
return process.env.NODE_ENV === "development" && React.useEffect(function() {
|
|
137
|
+
var _contentRef_current;
|
|
138
|
+
if (isWeb) {
|
|
139
|
+
var hasDescription = document.getElementById((_contentRef_current = contentRef.current) === null || _contentRef_current === void 0 ? void 0 : _contentRef_current.getAttribute("aria-describedby"));
|
|
140
|
+
hasDescription || console.warn(`\`${CONTENT_NAME}\` requires a description for the component to be accessible for screen reader users.
|
|
199
141
|
|
|
200
142
|
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
143
|
|
|
202
144
|
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
145
|
|
|
204
146
|
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;
|
|
205
184
|
}
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
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
|
-
};
|
|
185
|
+
default:
|
|
186
|
+
return !0;
|
|
187
|
+
}
|
|
188
|
+
}), useIsomorphicLayoutEffect(function() {
|
|
189
|
+
!open || !native || (title || description) && Alert.alert(title, description, buttons);
|
|
190
|
+
}, [
|
|
191
|
+
native,
|
|
192
|
+
open
|
|
193
|
+
]), native ? /* @__PURE__ */ React.cloneElement(triggerElement, {
|
|
194
|
+
__onPress: function() {
|
|
195
|
+
setOpen(!0);
|
|
196
|
+
}
|
|
197
|
+
}) : /* @__PURE__ */ _jsx(Dialog, {
|
|
198
|
+
...dialogScope,
|
|
199
|
+
...alertDialogProps,
|
|
200
|
+
modal: !0
|
|
201
|
+
});
|
|
202
|
+
};
|
|
271
203
|
function forEachChildDeep(children, onChild) {
|
|
272
|
-
var _iteratorNormalCompletion = !0,
|
|
273
|
-
_didIteratorError = !1,
|
|
274
|
-
_iteratorError = void 0;
|
|
204
|
+
var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
|
|
275
205
|
try {
|
|
276
206
|
for (var _iterator = children[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
|
|
277
207
|
var child = _step.value;
|
|
278
|
-
/* @__PURE__ */
|
|
279
|
-
React.isValidElement(child) && onChild(child) && child.props.children && forEachChildDeep(React.Children.toArray(child.props.children), onChild);
|
|
208
|
+
/* @__PURE__ */ React.isValidElement(child) && onChild(child) && child.props.children && forEachChildDeep(React.Children.toArray(child.props.children), onChild);
|
|
280
209
|
}
|
|
281
210
|
} catch (err) {
|
|
282
211
|
_didIteratorError = !0, _iteratorError = err;
|
|
@@ -284,13 +213,14 @@ function forEachChildDeep(children, onChild) {
|
|
|
284
213
|
try {
|
|
285
214
|
!_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
|
|
286
215
|
} finally {
|
|
287
|
-
if (_didIteratorError)
|
|
216
|
+
if (_didIteratorError)
|
|
217
|
+
throw _iteratorError;
|
|
288
218
|
}
|
|
289
219
|
}
|
|
290
220
|
}
|
|
291
221
|
function getStringChildren(child) {
|
|
292
222
|
var string = "";
|
|
293
|
-
return forEachChildDeep(React.Children.toArray(child), function
|
|
223
|
+
return forEachChildDeep(React.Children.toArray(child), function(child2) {
|
|
294
224
|
return typeof child2.props.children == "string" ? (string = child2.props.children, !1) : !0;
|
|
295
225
|
}), string;
|
|
296
226
|
}
|
|
@@ -305,5 +235,16 @@ var AlertDialog = withStaticProperties(AlertDialogInner, {
|
|
|
305
235
|
Description: AlertDialogDescription
|
|
306
236
|
});
|
|
307
237
|
AlertDialog.displayName = ROOT_NAME;
|
|
308
|
-
export {
|
|
309
|
-
|
|
238
|
+
export {
|
|
239
|
+
AlertDialog,
|
|
240
|
+
AlertDialogAction,
|
|
241
|
+
AlertDialogCancel,
|
|
242
|
+
AlertDialogContent,
|
|
243
|
+
AlertDialogDescription,
|
|
244
|
+
AlertDialogOverlay,
|
|
245
|
+
AlertDialogPortal,
|
|
246
|
+
AlertDialogTitle,
|
|
247
|
+
AlertDialogTrigger,
|
|
248
|
+
createAlertDialogScope
|
|
249
|
+
};
|
|
250
|
+
//# sourceMappingURL=AlertDialog.js.map
|
|
@@ -1 +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,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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
|
+
}
|
package/dist/esm/index.native.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from "./AlertDialog
|
|
2
|
-
//# sourceMappingURL=index.
|
|
1
|
+
export * from "./AlertDialog";
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/alert-dialog",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.114.0",
|
|
4
4
|
"source": "src/index.ts",
|
|
5
5
|
"types": "./types/index.d.ts",
|
|
6
6
|
"main": "dist/cjs",
|
|
@@ -34,26 +34,26 @@
|
|
|
34
34
|
}
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@tamagui/animate-presence": "1.
|
|
38
|
-
"@tamagui/aria-hidden": "1.
|
|
39
|
-
"@tamagui/compose-refs": "1.
|
|
40
|
-
"@tamagui/constants": "1.
|
|
41
|
-
"@tamagui/core": "1.
|
|
42
|
-
"@tamagui/create-context": "1.
|
|
43
|
-
"@tamagui/dialog": "1.
|
|
44
|
-
"@tamagui/dismissable": "1.
|
|
45
|
-
"@tamagui/focus-scope": "1.
|
|
46
|
-
"@tamagui/helpers": "1.
|
|
47
|
-
"@tamagui/polyfill-dev": "1.
|
|
48
|
-
"@tamagui/popper": "1.
|
|
49
|
-
"@tamagui/portal": "1.
|
|
50
|
-
"@tamagui/remove-scroll": "1.
|
|
51
|
-
"@tamagui/stacks": "1.
|
|
52
|
-
"@tamagui/text": "1.
|
|
53
|
-
"@tamagui/use-controllable-state": "1.
|
|
37
|
+
"@tamagui/animate-presence": "1.114.0",
|
|
38
|
+
"@tamagui/aria-hidden": "1.114.0",
|
|
39
|
+
"@tamagui/compose-refs": "1.114.0",
|
|
40
|
+
"@tamagui/constants": "1.114.0",
|
|
41
|
+
"@tamagui/core": "1.114.0",
|
|
42
|
+
"@tamagui/create-context": "1.114.0",
|
|
43
|
+
"@tamagui/dialog": "1.114.0",
|
|
44
|
+
"@tamagui/dismissable": "1.114.0",
|
|
45
|
+
"@tamagui/focus-scope": "1.114.0",
|
|
46
|
+
"@tamagui/helpers": "1.114.0",
|
|
47
|
+
"@tamagui/polyfill-dev": "1.114.0",
|
|
48
|
+
"@tamagui/popper": "1.114.0",
|
|
49
|
+
"@tamagui/portal": "1.114.0",
|
|
50
|
+
"@tamagui/remove-scroll": "1.114.0",
|
|
51
|
+
"@tamagui/stacks": "1.114.0",
|
|
52
|
+
"@tamagui/text": "1.114.0",
|
|
53
|
+
"@tamagui/use-controllable-state": "1.114.0"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
|
-
"@tamagui/build": "1.
|
|
56
|
+
"@tamagui/build": "1.114.0",
|
|
57
57
|
"react": "^18.2.0 || ^19.0.0",
|
|
58
58
|
"react-native": "0.74.1"
|
|
59
59
|
},
|