@tamagui/alert-dialog 3.0.6 → 3.0.8
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/cjs/AlertDialog.native.cjs +5 -5
- package/dist/cjs/AlertDialog.native.js +5 -5
- package/dist/cjs/AlertDialog.native.js.map +1 -1
- package/dist/cjs/alertDialogPart.native.cjs +1 -1
- package/dist/cjs/alertDialogPart.native.js +1 -1
- package/dist/cjs/alertDialogPart.native.js.map +1 -1
- package/dist/cjs/useNativeAlertDialog.native.cjs +3 -3
- package/dist/cjs/useNativeAlertDialog.native.js +3 -3
- package/dist/cjs/useNativeAlertDialog.native.js.map +1 -1
- package/dist/esm/AlertDialog.native.js +5 -5
- package/dist/esm/AlertDialog.native.js.map +1 -1
- package/dist/esm/alertDialogPart.native.js +1 -1
- package/dist/esm/alertDialogPart.native.js.map +1 -1
- package/dist/esm/useNativeAlertDialog.native.js +3 -3
- package/dist/esm/useNativeAlertDialog.native.js.map +1 -1
- package/dist/jsx/AlertDialog.native.cjs +5 -5
- package/dist/jsx/AlertDialog.native.js +5 -5
- package/dist/jsx/AlertDialog.native.js.map +1 -1
- package/dist/jsx/alertDialogPart.native.cjs +1 -1
- package/dist/jsx/alertDialogPart.native.js +1 -1
- package/dist/jsx/alertDialogPart.native.js.map +1 -1
- package/dist/jsx/useNativeAlertDialog.native.cjs +3 -3
- package/dist/jsx/useNativeAlertDialog.native.js +3 -3
- package/dist/jsx/useNativeAlertDialog.native.js.map +1 -1
- package/package.json +18 -18
|
@@ -50,7 +50,7 @@ var import_helpers = require("@tamagui/helpers");
|
|
|
50
50
|
var React = __toESM(require("react"), 1);
|
|
51
51
|
var import_alertDialogPart = require("./alertDialogPart.native.js");
|
|
52
52
|
var import_useNativeAlertDialog = require("./useNativeAlertDialog.native.js");
|
|
53
|
-
var getAlertDialogScope = function(scope) {
|
|
53
|
+
var getAlertDialogScope = function getAlertDialogScope2(scope) {
|
|
54
54
|
return scope;
|
|
55
55
|
};
|
|
56
56
|
var ROOT_NAME = "AlertDialog";
|
|
@@ -120,10 +120,10 @@ var AlertDialogContent = (0, import_core.createStyledHOC)(AlertDialogContentFram
|
|
|
120
120
|
(_cancelRef_current = cancelRef.current) === null || _cancelRef_current === void 0 ? void 0 : _cancelRef_current.focus({ preventScroll: true });
|
|
121
121
|
}
|
|
122
122
|
}),
|
|
123
|
-
onPointerDownOutside: function(event) {
|
|
123
|
+
onPointerDownOutside: function onPointerDownOutside(event) {
|
|
124
124
|
return event.cancel();
|
|
125
125
|
},
|
|
126
|
-
onInteractOutside: function(event) {
|
|
126
|
+
onInteractOutside: function onInteractOutside(event) {
|
|
127
127
|
return event.cancel();
|
|
128
128
|
},
|
|
129
129
|
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core2.Slottable, { children }), process.env.NODE_ENV === "development" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DescriptionWarning, { contentRef })]
|
|
@@ -190,7 +190,7 @@ var AlertDialogDestructive = (0, import_core.createStyledHOC)(AlertDialogDestruc
|
|
|
190
190
|
ref
|
|
191
191
|
});
|
|
192
192
|
});
|
|
193
|
-
var DescriptionWarning = function(param) {
|
|
193
|
+
var DescriptionWarning = function DescriptionWarning2(param) {
|
|
194
194
|
var { contentRef } = param;
|
|
195
195
|
if (process.env.NODE_ENV === "development") {
|
|
196
196
|
React.useEffect(function() {
|
|
@@ -210,7 +210,7 @@ var DescriptionWarning = function(param) {
|
|
|
210
210
|
}
|
|
211
211
|
return null;
|
|
212
212
|
};
|
|
213
|
-
var AlertDialogInner = function(props) {
|
|
213
|
+
var AlertDialogInner = function AlertDialogInner2(props) {
|
|
214
214
|
var { scope, native, ...alertDialogProps } = props;
|
|
215
215
|
var dialogScope = getAlertDialogScope(scope);
|
|
216
216
|
var nativeAlert = (0, import_useNativeAlertDialog.useNativeAlertDialog)(props);
|
|
@@ -50,7 +50,7 @@ var import_helpers = require("@tamagui/helpers");
|
|
|
50
50
|
var React = __toESM(require("react"), 1);
|
|
51
51
|
var import_alertDialogPart = require("./alertDialogPart.native.js");
|
|
52
52
|
var import_useNativeAlertDialog = require("./useNativeAlertDialog.native.js");
|
|
53
|
-
var getAlertDialogScope = function(scope) {
|
|
53
|
+
var getAlertDialogScope = function getAlertDialogScope2(scope) {
|
|
54
54
|
return scope;
|
|
55
55
|
};
|
|
56
56
|
var ROOT_NAME = "AlertDialog";
|
|
@@ -120,10 +120,10 @@ var AlertDialogContent = (0, import_core.createStyledHOC)(AlertDialogContentFram
|
|
|
120
120
|
(_cancelRef_current = cancelRef.current) === null || _cancelRef_current === void 0 ? void 0 : _cancelRef_current.focus({ preventScroll: true });
|
|
121
121
|
}
|
|
122
122
|
}),
|
|
123
|
-
onPointerDownOutside: function(event) {
|
|
123
|
+
onPointerDownOutside: function onPointerDownOutside(event) {
|
|
124
124
|
return event.cancel();
|
|
125
125
|
},
|
|
126
|
-
onInteractOutside: function(event) {
|
|
126
|
+
onInteractOutside: function onInteractOutside(event) {
|
|
127
127
|
return event.cancel();
|
|
128
128
|
},
|
|
129
129
|
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core2.Slottable, { children }), process.env.NODE_ENV === "development" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DescriptionWarning, { contentRef })]
|
|
@@ -190,7 +190,7 @@ var AlertDialogDestructive = (0, import_core.createStyledHOC)(AlertDialogDestruc
|
|
|
190
190
|
ref
|
|
191
191
|
});
|
|
192
192
|
});
|
|
193
|
-
var DescriptionWarning = function(param) {
|
|
193
|
+
var DescriptionWarning = function DescriptionWarning2(param) {
|
|
194
194
|
var { contentRef } = param;
|
|
195
195
|
if (process.env.NODE_ENV === "development") {
|
|
196
196
|
React.useEffect(function() {
|
|
@@ -210,7 +210,7 @@ var DescriptionWarning = function(param) {
|
|
|
210
210
|
}
|
|
211
211
|
return null;
|
|
212
212
|
};
|
|
213
|
-
var AlertDialogInner = function(props) {
|
|
213
|
+
var AlertDialogInner = function AlertDialogInner2(props) {
|
|
214
214
|
var { scope, native, ...alertDialogProps } = props;
|
|
215
215
|
var dialogScope = getAlertDialogScope(scope);
|
|
216
216
|
var nativeAlert = (0, import_useNativeAlertDialog.useNativeAlertDialog)(props);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AlertDialog.native.js","names":[],"sources":["cjs/AlertDialog.native.js"],"sourcesContent":["\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar AlertDialog_exports = {};\n__export(AlertDialog_exports, {\n AlertDialog: () => AlertDialog,\n AlertDialogAction: () => AlertDialogAction,\n AlertDialogCancel: () => AlertDialogCancel,\n AlertDialogContent: () => AlertDialogContent,\n AlertDialogDescription: () => AlertDialogDescription,\n AlertDialogDestructive: () => AlertDialogDestructive,\n AlertDialogOverlay: () => AlertDialogOverlay,\n AlertDialogPortal: () => AlertDialogPortal,\n AlertDialogTitle: () => AlertDialogTitle,\n AlertDialogTrigger: () => AlertDialogTrigger\n});\nmodule.exports = __toCommonJS(AlertDialog_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_core = require(\"@tamagui/core\");\nvar import_compose_refs = require(\"@tamagui/compose-refs\");\nvar import_constants = require(\"@tamagui/constants\");\nvar import_core2 = require(\"@tamagui/core\");\nvar import_dialog = require(\"@tamagui/dialog\");\nvar import_helpers = require(\"@tamagui/helpers\");\nvar React = __toESM(require(\"react\"), 1);\nvar import_alertDialogPart = require(\"./alertDialogPart\");\nvar import_useNativeAlertDialog = require(\"./useNativeAlertDialog\");\nvar getAlertDialogScope = function(scope) {\n return scope;\n};\nvar ROOT_NAME = \"AlertDialog\";\nvar TRIGGER_NAME = \"AlertDialogTrigger\";\nvar NativeAlertDialogTriggerFrame = (0, import_core2.styled)(import_core2.View, {\n displayName: TRIGGER_NAME\n});\n(0, import_alertDialogPart.markAlertDialogPart)(NativeAlertDialogTriggerFrame, \"trigger\");\nvar AlertDialogTrigger = (0, import_core.createStyledHOC)(NativeAlertDialogTriggerFrame, function AlertDialogTrigger2(props, forwardedRef) {\n if (props[\"__native\"]) {\n var { __native, onPress, __onPress, ...rest } = props;\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(NativeAlertDialogTriggerFrame, {\n ...rest,\n onPress: (0, import_helpers.composeEventHandlers)(onPress, __onPress)\n });\n }\n var { scope, ...triggerProps } = props;\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.DialogTrigger, {\n scope: getAlertDialogScope(scope),\n ...triggerProps,\n ref: forwardedRef\n });\n});\nvar AlertDialogPortal = function AlertDialogPortal2(props) {\n var { scope, ...portalProps } = props;\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.DialogPortal, {\n scope: getAlertDialogScope(scope),\n ...portalProps\n });\n};\nvar OVERLAY_NAME = \"AlertDialogOverlay\";\nvar AlertDialogOverlayFrame = (0, import_core2.styled)(import_dialog.DialogOverlayFrame, {\n displayName: OVERLAY_NAME\n});\nvar AlertDialogOverlay = (0, import_core.createStyledHOC)(AlertDialogOverlayFrame, function AlertDialogOverlay2(props, forwardedRef) {\n var { scope, ...overlayProps } = props;\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.DialogOverlay, {\n scope: getAlertDialogScope(scope),\n ...overlayProps,\n ref: forwardedRef\n });\n});\nvar CONTENT_NAME = \"AlertDialogContent\";\nvar { Provider: AlertDialogContextProvider, useStyledContext: useAlertDialogContentContext } = (0, import_core2.createStyledContext)({}, \"AlertDialogContext\");\nvar AlertDialogContentFrame = (0, import_core2.styled)(import_dialog.DialogContentFrame, {\n displayName: CONTENT_NAME\n});\nvar AlertDialogContent = (0, import_core.createStyledHOC)(AlertDialogContentFrame, function AlertDialogContent2(props, forwardedRef) {\n var { scope, children, ...contentProps } = props;\n var dialogScope = getAlertDialogScope(scope);\n var contentRef = React.useRef(null);\n var composedRefs = (0, import_compose_refs.useComposedRefs)(forwardedRef, contentRef);\n var cancelRef = React.useRef(null);\n var destructiveRef = React.useRef(null);\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.DialogWarningProvider, {\n contentName: CONTENT_NAME,\n titleName: TITLE_NAME,\n docsSlug: \"alert-dialog\",\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertDialogContextProvider, {\n scope,\n cancelRef,\n destructiveRef,\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_dialog.DialogContent, {\n role: \"alertdialog\",\n \"aria-modal\": true,\n scope: dialogScope,\n ...contentProps,\n ref: composedRefs,\n onOpenAutoFocus: (0, import_helpers.composeEventHandlers)(contentProps.onOpenAutoFocus, function(event) {\n event.cancel();\n if (import_constants.isWeb) {\n var _cancelRef_current;\n (_cancelRef_current = cancelRef.current) === null || _cancelRef_current === void 0 ? void 0 : _cancelRef_current.focus({\n preventScroll: true\n });\n }\n }),\n onPointerDownOutside: function(event) {\n return event.cancel();\n },\n onInteractOutside: function(event) {\n return event.cancel();\n },\n children: [\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 /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core2.Slottable, {\n children\n }),\n process.env.NODE_ENV === \"development\" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DescriptionWarning, {\n contentRef\n })\n ]\n })\n })\n });\n});\nvar TITLE_NAME = \"AlertDialogTitle\";\nvar AlertDialogTitleFrame = (0, import_core2.styled)(import_core2.View, {\n displayName: TITLE_NAME\n});\n(0, import_alertDialogPart.markAlertDialogPart)(AlertDialogTitleFrame, \"title\");\nvar AlertDialogTitle = (0, import_core.createStyledHOC)(AlertDialogTitleFrame, function AlertDialogTitle2(props, forwardedRef) {\n var { scope, ...titleProps } = props;\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.DialogTitle, {\n scope: getAlertDialogScope(scope),\n ...titleProps,\n ref: forwardedRef\n });\n});\nvar DESCRIPTION_NAME = \"AlertDialogDescription\";\nvar AlertDialogDescriptionFrame = (0, import_core2.styled)(import_core2.View, {\n displayName: DESCRIPTION_NAME\n});\n(0, import_alertDialogPart.markAlertDialogPart)(AlertDialogDescriptionFrame, \"description\");\nvar AlertDialogDescription = (0, import_core.createStyledHOC)(AlertDialogDescriptionFrame, function AlertDialogDescription2(props, forwardedRef) {\n var { scope, ...descriptionProps } = props;\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.DialogDescription, {\n scope: getAlertDialogScope(scope),\n ...descriptionProps,\n ref: forwardedRef\n });\n});\nvar ACTION_NAME = \"AlertDialogAction\";\nvar AlertDialogActionFrame = (0, import_core2.styled)(import_core2.View, {\n displayName: ACTION_NAME\n});\n(0, import_alertDialogPart.markAlertDialogPart)(AlertDialogActionFrame, \"action\");\nvar AlertDialogAction = (0, import_core.createStyledHOC)(AlertDialogActionFrame, function AlertDialogAction2(props, forwardedRef) {\n var { scope, ...actionProps } = props;\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.DialogClose, {\n scope: getAlertDialogScope(scope),\n ...actionProps,\n ref: forwardedRef\n });\n});\nvar CANCEL_NAME = \"AlertDialogCancel\";\nvar AlertDialogCancelFrame = (0, import_core2.styled)(import_core2.View, {\n displayName: CANCEL_NAME\n});\n(0, import_alertDialogPart.markAlertDialogPart)(AlertDialogCancelFrame, \"cancel\");\nvar AlertDialogCancel = (0, import_core.createStyledHOC)(AlertDialogCancelFrame, function AlertDialogCancel2(props, forwardedRef) {\n var { scope, ...cancelProps } = props;\n var { cancelRef } = useAlertDialogContentContext(scope);\n var ref = (0, import_compose_refs.useComposedRefs)(forwardedRef, cancelRef);\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.DialogClose, {\n scope: getAlertDialogScope(scope),\n ...cancelProps,\n ref\n });\n});\nvar DESTRUCTIVE_NAME = \"AlertDialogDestructive\";\nvar AlertDialogDestructiveFrame = (0, import_core2.styled)(import_core2.View, {\n displayName: DESTRUCTIVE_NAME\n});\n(0, import_alertDialogPart.markAlertDialogPart)(AlertDialogDestructiveFrame, \"destructive\");\nvar AlertDialogDestructive = (0, import_core.createStyledHOC)(AlertDialogDestructiveFrame, function AlertDialogDestructive2(props, forwardedRef) {\n var { scope, ...destructiveProps } = props;\n var { destructiveRef } = useAlertDialogContentContext(scope);\n var ref = (0, import_compose_refs.useComposedRefs)(forwardedRef, destructiveRef);\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.DialogClose, {\n scope: getAlertDialogScope(scope),\n ...destructiveProps,\n ref\n });\n});\nvar DescriptionWarning = function(param) {\n var { contentRef } = param;\n if (process.env.NODE_ENV === \"development\") {\n React.useEffect(function() {\n var _contentRef_current;\n if (!import_constants.isWeb) return;\n var hasDescription = document.getElementById((_contentRef_current = contentRef.current) === null || _contentRef_current === void 0 ? void 0 : _contentRef_current.getAttribute(\"aria-describedby\"));\n if (!hasDescription) {\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 }, [\n contentRef\n ]);\n }\n return null;\n};\nvar AlertDialogInner = function(props) {\n var { scope, native, ...alertDialogProps } = props;\n var dialogScope = getAlertDialogScope(scope);\n var nativeAlert = (0, import_useNativeAlertDialog.useNativeAlertDialog)(props);\n if (nativeAlert) return nativeAlert;\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.Dialog, {\n scope: dialogScope,\n ...alertDialogProps,\n modal: true\n });\n};\nvar AlertDialog = (0, import_helpers.withStaticProperties)(AlertDialogInner, {\n Trigger: AlertDialogTrigger,\n Portal: AlertDialogPortal,\n Overlay: AlertDialogOverlay,\n Content: AlertDialogContent,\n Action: AlertDialogAction,\n Cancel: AlertDialogCancel,\n Destructive: AlertDialogDestructive,\n Title: AlertDialogTitle,\n Description: AlertDialogDescription\n});\nAlertDialog.displayName = ROOT_NAME;\n//# sourceMappingURL=AlertDialog.js.map\n"],"mappings":";;;AACA,IAAI,WAAW,OAAO;AACtB,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO;AAC1B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,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ACrB,IAAI,QAAQ,IAAI,aAAa,eAAe;EAC1C,MAAM,UAAU,WAAW;GACzB,IAAI;GACJ,IAAI,CAAC,iBAAiB,OAAO;GAC7B,IAAI,iBAAiB,SAAS,gBAAgB,sBAAsB,WAAW,aAAa,QAAQ,wBAAwB,KAAK,IAAI,KAAK,IAAI,oBAAoB,aAAa,kBAAkB,CAAC;GAClM,IAAI,CAAC,gBAAgB;IACnB,QAAQ,KAAK,KAAK,aAAa;;6CAEM,aAAa,oBAAoB,iBAAiB;;oKAEqE,aAAa;;mFAE9F;GAC7E;EACF,GAAG,CACD,UACF,CAAC;CACH;CACA,OAAO;AACT;AACA,IAAI,mBAAmB,SAAS,OAAO;CACrC,IAAI,EAAE,OAAO,QAAQ,GAAG,qBAAqB;CAC7C,IAAI,cAAc,oBAAoB,KAAK;CAC3C,IAAI,eAAe,GAAG,4BAA4B,qBAAoB,CAAE,KAAK;CAC7E,IAAI,aAAa,OAAO;CACxB,OAAuB,iBAAC,GAAG,mBAAmB,IAAG,CAAE,cAAc,QAAQ;EACvE,OAAO;EACP,GAAG;EACH,OAAO;CACT,CAAC;AACH;AACA,IAAI,eAAe,GAAG,eAAe,qBAAoB,CAAE,kBAAkB;CAC3E,SAAS;CACT,QAAQ;CACR,SAAS;CACT,SAAS;CACT,QAAQ;CACR,QAAQ;CACR,aAAa;CACb,OAAO;CACP,aAAa;AACf,CAAC;AACD,YAAY,cAAc"}
|
|
1
|
+
{"version":3,"file":"AlertDialog.native.js","names":[],"sources":["cjs/AlertDialog.native.js"],"sourcesContent":["\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar AlertDialog_exports = {};\n__export(AlertDialog_exports, {\n AlertDialog: () => AlertDialog,\n AlertDialogAction: () => AlertDialogAction,\n AlertDialogCancel: () => AlertDialogCancel,\n AlertDialogContent: () => AlertDialogContent,\n AlertDialogDescription: () => AlertDialogDescription,\n AlertDialogDestructive: () => AlertDialogDestructive,\n AlertDialogOverlay: () => AlertDialogOverlay,\n AlertDialogPortal: () => AlertDialogPortal,\n AlertDialogTitle: () => AlertDialogTitle,\n AlertDialogTrigger: () => AlertDialogTrigger\n});\nmodule.exports = __toCommonJS(AlertDialog_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_core = require(\"@tamagui/core\");\nvar import_compose_refs = require(\"@tamagui/compose-refs\");\nvar import_constants = require(\"@tamagui/constants\");\nvar import_core2 = require(\"@tamagui/core\");\nvar import_dialog = require(\"@tamagui/dialog\");\nvar import_helpers = require(\"@tamagui/helpers\");\nvar React = __toESM(require(\"react\"), 1);\nvar import_alertDialogPart = require(\"./alertDialogPart\");\nvar import_useNativeAlertDialog = require(\"./useNativeAlertDialog\");\nvar getAlertDialogScope = function getAlertDialogScope2(scope) {\n return scope;\n};\nvar ROOT_NAME = \"AlertDialog\";\nvar TRIGGER_NAME = \"AlertDialogTrigger\";\nvar NativeAlertDialogTriggerFrame = (0, import_core2.styled)(import_core2.View, {\n displayName: TRIGGER_NAME\n});\n(0, import_alertDialogPart.markAlertDialogPart)(NativeAlertDialogTriggerFrame, \"trigger\");\nvar AlertDialogTrigger = (0, import_core.createStyledHOC)(NativeAlertDialogTriggerFrame, function AlertDialogTrigger2(props, forwardedRef) {\n if (props[\"__native\"]) {\n var { __native, onPress, __onPress, ...rest } = props;\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(NativeAlertDialogTriggerFrame, {\n ...rest,\n onPress: (0, import_helpers.composeEventHandlers)(onPress, __onPress)\n });\n }\n var { scope, ...triggerProps } = props;\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.DialogTrigger, {\n scope: getAlertDialogScope(scope),\n ...triggerProps,\n ref: forwardedRef\n });\n});\nvar AlertDialogPortal = function AlertDialogPortal2(props) {\n var { scope, ...portalProps } = props;\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.DialogPortal, {\n scope: getAlertDialogScope(scope),\n ...portalProps\n });\n};\nvar OVERLAY_NAME = \"AlertDialogOverlay\";\nvar AlertDialogOverlayFrame = (0, import_core2.styled)(import_dialog.DialogOverlayFrame, {\n displayName: OVERLAY_NAME\n});\nvar AlertDialogOverlay = (0, import_core.createStyledHOC)(AlertDialogOverlayFrame, function AlertDialogOverlay2(props, forwardedRef) {\n var { scope, ...overlayProps } = props;\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.DialogOverlay, {\n scope: getAlertDialogScope(scope),\n ...overlayProps,\n ref: forwardedRef\n });\n});\nvar CONTENT_NAME = \"AlertDialogContent\";\nvar { Provider: AlertDialogContextProvider, useStyledContext: useAlertDialogContentContext } = (0, import_core2.createStyledContext)({}, \"AlertDialogContext\");\nvar AlertDialogContentFrame = (0, import_core2.styled)(import_dialog.DialogContentFrame, {\n displayName: CONTENT_NAME\n});\nvar AlertDialogContent = (0, import_core.createStyledHOC)(AlertDialogContentFrame, function AlertDialogContent2(props, forwardedRef) {\n var { scope, children, ...contentProps } = props;\n var dialogScope = getAlertDialogScope(scope);\n var contentRef = React.useRef(null);\n var composedRefs = (0, import_compose_refs.useComposedRefs)(forwardedRef, contentRef);\n var cancelRef = React.useRef(null);\n var destructiveRef = React.useRef(null);\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.DialogWarningProvider, {\n contentName: CONTENT_NAME,\n titleName: TITLE_NAME,\n docsSlug: \"alert-dialog\",\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertDialogContextProvider, {\n scope,\n cancelRef,\n destructiveRef,\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_dialog.DialogContent, {\n role: \"alertdialog\",\n \"aria-modal\": true,\n scope: dialogScope,\n ...contentProps,\n ref: composedRefs,\n onOpenAutoFocus: (0, import_helpers.composeEventHandlers)(contentProps.onOpenAutoFocus, function(event) {\n event.cancel();\n if (import_constants.isWeb) {\n var _cancelRef_current;\n (_cancelRef_current = cancelRef.current) === null || _cancelRef_current === void 0 ? void 0 : _cancelRef_current.focus({\n preventScroll: true\n });\n }\n }),\n onPointerDownOutside: function onPointerDownOutside(event) {\n return event.cancel();\n },\n onInteractOutside: function onInteractOutside(event) {\n return event.cancel();\n },\n children: [\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 /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core2.Slottable, {\n children\n }),\n process.env.NODE_ENV === \"development\" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DescriptionWarning, {\n contentRef\n })\n ]\n })\n })\n });\n});\nvar TITLE_NAME = \"AlertDialogTitle\";\nvar AlertDialogTitleFrame = (0, import_core2.styled)(import_core2.View, {\n displayName: TITLE_NAME\n});\n(0, import_alertDialogPart.markAlertDialogPart)(AlertDialogTitleFrame, \"title\");\nvar AlertDialogTitle = (0, import_core.createStyledHOC)(AlertDialogTitleFrame, function AlertDialogTitle2(props, forwardedRef) {\n var { scope, ...titleProps } = props;\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.DialogTitle, {\n scope: getAlertDialogScope(scope),\n ...titleProps,\n ref: forwardedRef\n });\n});\nvar DESCRIPTION_NAME = \"AlertDialogDescription\";\nvar AlertDialogDescriptionFrame = (0, import_core2.styled)(import_core2.View, {\n displayName: DESCRIPTION_NAME\n});\n(0, import_alertDialogPart.markAlertDialogPart)(AlertDialogDescriptionFrame, \"description\");\nvar AlertDialogDescription = (0, import_core.createStyledHOC)(AlertDialogDescriptionFrame, function AlertDialogDescription2(props, forwardedRef) {\n var { scope, ...descriptionProps } = props;\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.DialogDescription, {\n scope: getAlertDialogScope(scope),\n ...descriptionProps,\n ref: forwardedRef\n });\n});\nvar ACTION_NAME = \"AlertDialogAction\";\nvar AlertDialogActionFrame = (0, import_core2.styled)(import_core2.View, {\n displayName: ACTION_NAME\n});\n(0, import_alertDialogPart.markAlertDialogPart)(AlertDialogActionFrame, \"action\");\nvar AlertDialogAction = (0, import_core.createStyledHOC)(AlertDialogActionFrame, function AlertDialogAction2(props, forwardedRef) {\n var { scope, ...actionProps } = props;\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.DialogClose, {\n scope: getAlertDialogScope(scope),\n ...actionProps,\n ref: forwardedRef\n });\n});\nvar CANCEL_NAME = \"AlertDialogCancel\";\nvar AlertDialogCancelFrame = (0, import_core2.styled)(import_core2.View, {\n displayName: CANCEL_NAME\n});\n(0, import_alertDialogPart.markAlertDialogPart)(AlertDialogCancelFrame, \"cancel\");\nvar AlertDialogCancel = (0, import_core.createStyledHOC)(AlertDialogCancelFrame, function AlertDialogCancel2(props, forwardedRef) {\n var { scope, ...cancelProps } = props;\n var { cancelRef } = useAlertDialogContentContext(scope);\n var ref = (0, import_compose_refs.useComposedRefs)(forwardedRef, cancelRef);\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.DialogClose, {\n scope: getAlertDialogScope(scope),\n ...cancelProps,\n ref\n });\n});\nvar DESTRUCTIVE_NAME = \"AlertDialogDestructive\";\nvar AlertDialogDestructiveFrame = (0, import_core2.styled)(import_core2.View, {\n displayName: DESTRUCTIVE_NAME\n});\n(0, import_alertDialogPart.markAlertDialogPart)(AlertDialogDestructiveFrame, \"destructive\");\nvar AlertDialogDestructive = (0, import_core.createStyledHOC)(AlertDialogDestructiveFrame, function AlertDialogDestructive2(props, forwardedRef) {\n var { scope, ...destructiveProps } = props;\n var { destructiveRef } = useAlertDialogContentContext(scope);\n var ref = (0, import_compose_refs.useComposedRefs)(forwardedRef, destructiveRef);\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.DialogClose, {\n scope: getAlertDialogScope(scope),\n ...destructiveProps,\n ref\n });\n});\nvar DescriptionWarning = function DescriptionWarning2(param) {\n var { contentRef } = param;\n if (process.env.NODE_ENV === \"development\") {\n React.useEffect(function() {\n var _contentRef_current;\n if (!import_constants.isWeb) return;\n var hasDescription = document.getElementById((_contentRef_current = contentRef.current) === null || _contentRef_current === void 0 ? void 0 : _contentRef_current.getAttribute(\"aria-describedby\"));\n if (!hasDescription) {\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 }, [\n contentRef\n ]);\n }\n return null;\n};\nvar AlertDialogInner = function AlertDialogInner2(props) {\n var { scope, native, ...alertDialogProps } = props;\n var dialogScope = getAlertDialogScope(scope);\n var nativeAlert = (0, import_useNativeAlertDialog.useNativeAlertDialog)(props);\n if (nativeAlert) return nativeAlert;\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.Dialog, {\n scope: dialogScope,\n ...alertDialogProps,\n modal: true\n });\n};\nvar AlertDialog = (0, import_helpers.withStaticProperties)(AlertDialogInner, {\n Trigger: AlertDialogTrigger,\n Portal: AlertDialogPortal,\n Overlay: AlertDialogOverlay,\n Content: AlertDialogContent,\n Action: AlertDialogAction,\n Cancel: AlertDialogCancel,\n Destructive: AlertDialogDestructive,\n Title: AlertDialogTitle,\n Description: AlertDialogDescription\n});\nAlertDialog.displayName = ROOT_NAME;\n//# sourceMappingURL=AlertDialog.js.map\n"],"mappings":";;;AACA,IAAI,WAAW,OAAO;AACtB,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO;AAC1B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,WAAW,KAAK,YAAY,YAAY,SAAS,OAAO,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AAkB,OAAO;CACvD,IAAI,EAAE,OAAO,QAAQ,GAAG,qBAAqB;CAC7C,IAAI,cAAc,oBAAoB,KAAK;CAC3C,IAAI,eAAe,GAAG,4BAA4B,qBAAoB,CAAE,KAAK;CAC7E,IAAI,aAAa,OAAO;CACxB,OAAuB,iBAAC,GAAG,mBAAmB,IAAG,CAAE,cAAc,QAAQ;EACvE,OAAO;EACP,GAAG;EACH,OAAO;CACT,CAAC;AACH;AACA,IAAI,eAAe,GAAG,eAAe,qBAAoB,CAAE,kBAAkB;CAC3E,SAAS;CACT,QAAQ;CACR,SAAS;CACT,SAAS;CACT,QAAQ;CACR,QAAQ;CACR,aAAa;CACb,OAAO;CACP,aAAa;AACf,CAAC;AACD,YAAY,cAAc"}
|
|
@@ -27,6 +27,6 @@ __export(alertDialogPart_exports, {
|
|
|
27
27
|
});
|
|
28
28
|
module.exports = __toCommonJS(alertDialogPart_exports);
|
|
29
29
|
var ALERT_DIALOG_PART = /* @__PURE__ */ Symbol("AlertDialogPart");
|
|
30
|
-
var markAlertDialogPart = function(component, part) {
|
|
30
|
+
var markAlertDialogPart = function markAlertDialogPart2(component, part) {
|
|
31
31
|
Object.assign(component.staticConfig, { [ALERT_DIALOG_PART]: part });
|
|
32
32
|
};
|
|
@@ -27,7 +27,7 @@ __export(alertDialogPart_exports, {
|
|
|
27
27
|
});
|
|
28
28
|
module.exports = __toCommonJS(alertDialogPart_exports);
|
|
29
29
|
var ALERT_DIALOG_PART = /* @__PURE__ */ Symbol("AlertDialogPart");
|
|
30
|
-
var markAlertDialogPart = function(component, part) {
|
|
30
|
+
var markAlertDialogPart = function markAlertDialogPart2(component, part) {
|
|
31
31
|
Object.assign(component.staticConfig, { [ALERT_DIALOG_PART]: part });
|
|
32
32
|
};
|
|
33
33
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alertDialogPart.native.js","names":[],"sources":["cjs/alertDialogPart.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar alertDialogPart_exports = {};\n__export(alertDialogPart_exports, {\n ALERT_DIALOG_PART: () => ALERT_DIALOG_PART,\n markAlertDialogPart: () => markAlertDialogPart\n});\nmodule.exports = __toCommonJS(alertDialogPart_exports);\nvar ALERT_DIALOG_PART = /* @__PURE__ */ Symbol(\"AlertDialogPart\");\nvar markAlertDialogPart = function(component, part) {\n Object.assign(component.staticConfig, {\n [ALERT_DIALOG_PART]: part\n });\n};\n//# sourceMappingURL=alertDialogPart.js.map\n"],"mappings":";;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,0BAA0B,CAAC;AAC/B,SAAS,yBAAyB;CAChC,yBAAyB;CACzB,2BAA2B;AAC7B,CAAC;AACD,OAAO,UAAU,aAAa,uBAAuB;AACrD,IAAI,oBAAoC,uBAAO,iBAAiB;AAChE,IAAI,sBAAsB,SAAS,WAAW,MAAM;
|
|
1
|
+
{"version":3,"file":"alertDialogPart.native.js","names":[],"sources":["cjs/alertDialogPart.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar alertDialogPart_exports = {};\n__export(alertDialogPart_exports, {\n ALERT_DIALOG_PART: () => ALERT_DIALOG_PART,\n markAlertDialogPart: () => markAlertDialogPart\n});\nmodule.exports = __toCommonJS(alertDialogPart_exports);\nvar ALERT_DIALOG_PART = /* @__PURE__ */ Symbol(\"AlertDialogPart\");\nvar markAlertDialogPart = function markAlertDialogPart2(component, part) {\n Object.assign(component.staticConfig, {\n [ALERT_DIALOG_PART]: part\n });\n};\n//# sourceMappingURL=alertDialogPart.js.map\n"],"mappings":";;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,0BAA0B,CAAC;AAC/B,SAAS,yBAAyB;CAChC,yBAAyB;CACzB,2BAA2B;AAC7B,CAAC;AACD,OAAO,UAAU,aAAa,uBAAuB;AACrD,IAAI,oBAAoC,uBAAO,iBAAiB;AAChE,IAAI,sBAAsB,SAAS,qBAAqB,WAAW,MAAM;CACvE,OAAO,OAAO,UAAU,cAAc,GACnC,oBAAoB,KACvB,CAAC;AACH"}
|
|
@@ -35,7 +35,7 @@ var import_use_controllable_state = require("@tamagui/use-controllable-state");
|
|
|
35
35
|
var React = __toESM(require("react"), 1);
|
|
36
36
|
var import_react_native = require("react-native");
|
|
37
37
|
var import_alertDialogPart = require("./alertDialogPart.native.js");
|
|
38
|
-
var useNativeAlertDialog = function(props) {
|
|
38
|
+
var useNativeAlertDialog = function useNativeAlertDialog2(props) {
|
|
39
39
|
var { native } = props;
|
|
40
40
|
var [open, setOpen] = (0, import_use_controllable_state.useControllableState)({
|
|
41
41
|
prop: props.open,
|
|
@@ -68,7 +68,7 @@ var useNativeAlertDialog = function(props) {
|
|
|
68
68
|
case "cancel": {
|
|
69
69
|
var style = part === "action" ? "default" : part === "destructive" ? "destructive" : "cancel";
|
|
70
70
|
var text = getStringChildren(child);
|
|
71
|
-
var onPress = function() {
|
|
71
|
+
var onPress = function onPress2() {
|
|
72
72
|
var _childProps_onPress;
|
|
73
73
|
var childProps = child.props;
|
|
74
74
|
childProps === null || childProps === void 0 ? void 0 : (_childProps_onPress = childProps.onPress) === null || _childProps_onPress === void 0 ? void 0 : _childProps_onPress.call(childProps, { native: true });
|
|
@@ -93,7 +93,7 @@ var useNativeAlertDialog = function(props) {
|
|
|
93
93
|
}
|
|
94
94
|
}, [native, open]);
|
|
95
95
|
if (native) {
|
|
96
|
-
return /* @__PURE__ */ React.cloneElement(triggerElement, { __onPress: function() {
|
|
96
|
+
return /* @__PURE__ */ React.cloneElement(triggerElement, { __onPress: function __onPress() {
|
|
97
97
|
setOpen(true);
|
|
98
98
|
} });
|
|
99
99
|
}
|
|
@@ -35,7 +35,7 @@ var import_use_controllable_state = require("@tamagui/use-controllable-state");
|
|
|
35
35
|
var React = __toESM(require("react"), 1);
|
|
36
36
|
var import_react_native = require("react-native");
|
|
37
37
|
var import_alertDialogPart = require("./alertDialogPart.native.js");
|
|
38
|
-
var useNativeAlertDialog = function(props) {
|
|
38
|
+
var useNativeAlertDialog = function useNativeAlertDialog2(props) {
|
|
39
39
|
var { native } = props;
|
|
40
40
|
var [open, setOpen] = (0, import_use_controllable_state.useControllableState)({
|
|
41
41
|
prop: props.open,
|
|
@@ -68,7 +68,7 @@ var useNativeAlertDialog = function(props) {
|
|
|
68
68
|
case "cancel": {
|
|
69
69
|
var style = part === "action" ? "default" : part === "destructive" ? "destructive" : "cancel";
|
|
70
70
|
var text = getStringChildren(child);
|
|
71
|
-
var onPress = function() {
|
|
71
|
+
var onPress = function onPress2() {
|
|
72
72
|
var _childProps_onPress;
|
|
73
73
|
var childProps = child.props;
|
|
74
74
|
childProps === null || childProps === void 0 ? void 0 : (_childProps_onPress = childProps.onPress) === null || _childProps_onPress === void 0 ? void 0 : _childProps_onPress.call(childProps, { native: true });
|
|
@@ -93,7 +93,7 @@ var useNativeAlertDialog = function(props) {
|
|
|
93
93
|
}
|
|
94
94
|
}, [native, open]);
|
|
95
95
|
if (native) {
|
|
96
|
-
return /* @__PURE__ */ React.cloneElement(triggerElement, { __onPress: function() {
|
|
96
|
+
return /* @__PURE__ */ React.cloneElement(triggerElement, { __onPress: function __onPress() {
|
|
97
97
|
setOpen(true);
|
|
98
98
|
} });
|
|
99
99
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useNativeAlertDialog.native.js","names":[],"sources":["cjs/useNativeAlertDialog.native.js"],"sourcesContent":["\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar useNativeAlertDialog_native_exports = {};\n__export(useNativeAlertDialog_native_exports, {\n useNativeAlertDialog: () => useNativeAlertDialog\n});\nmodule.exports = __toCommonJS(useNativeAlertDialog_native_exports);\nvar import_constants = require(\"@tamagui/constants\");\nvar import_core = require(\"@tamagui/core\");\nvar import_use_controllable_state = require(\"@tamagui/use-controllable-state\");\nvar React = __toESM(require(\"react\"), 1);\nvar import_react_native = require(\"react-native\");\nvar import_alertDialogPart = require(\"./alertDialogPart\");\nvar useNativeAlertDialog = function(props) {\n var { native } = props;\n var [open, setOpen] = (0, import_use_controllable_state.useControllableState)({\n prop: props.open,\n defaultProp: props.defaultOpen || false,\n onChange: props.onOpenChange,\n transition: true\n });\n var triggerElement = null;\n var title = \"\";\n var description = \"\";\n var buttons = [];\n forEachChildDeep(React.Children.toArray(props.children), function(child) {\n if (!/* @__PURE__ */ React.isValidElement(child)) return false;\n var part = (0, import_core.isTamaguiElement)(child) ? child.type.staticConfig[import_alertDialogPart.ALERT_DIALOG_PART] : void 0;\n switch (part) {\n case \"trigger\": {\n triggerElement = /* @__PURE__ */ React.cloneElement(child, {\n __native: true\n });\n return false;\n }\n case \"title\": {\n title = getStringChildren(child);\n return false;\n }\n case \"description\": {\n description = getStringChildren(child);\n return false;\n }\n case \"action\":\n case \"destructive\":\n case \"cancel\": {\n var style = part === \"action\" ? \"default\" : part === \"destructive\" ? \"destructive\" : \"cancel\";\n var text = getStringChildren(child);\n var onPress = function() {\n var _childProps_onPress;\n var childProps = child.props;\n childProps === null || childProps === void 0 ? void 0 : (_childProps_onPress = childProps.onPress) === null || _childProps_onPress === void 0 ? void 0 : _childProps_onPress.call(childProps, {\n native: true\n });\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 (0, import_constants.useIsomorphicLayoutEffect)(function() {\n if (!open || !native) return;\n if (title || description) {\n import_react_native.Alert.alert(title, description, buttons);\n }\n }, [\n native,\n open\n ]);\n if (native) {\n return /* @__PURE__ */ React.cloneElement(triggerElement, {\n __onPress: function() {\n setOpen(true);\n }\n });\n }\n return null;\n};\nfunction forEachChildDeep(children, onChild) {\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = children[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var child = _step.value;\n if (!/* @__PURE__ */ React.isValidElement(child)) continue;\n if (!onChild(child)) continue;\n var childProps = child.props;\n if (childProps.children) {\n forEachChildDeep(React.Children.toArray(childProps.children), onChild);\n }\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n}\nfunction getStringChildren(child) {\n var string = \"\";\n forEachChildDeep(React.Children.toArray(child), function(child2) {\n if (typeof child2.props.children === \"string\") {\n string = child2.props.children;\n return false;\n }\n return true;\n });\n return string;\n}\n//# sourceMappingURL=useNativeAlertDialog.native.js.map\n"],"mappings":";;;AACA,IAAI,WAAW,OAAO;AACtB,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO;AAC1B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,WAAW,KAAK,YAAY,YAAY,SAAS,OAAO,OAAO,SAAS,aAAa,GAAG,CAAC,IAAI,CAAC,GAAG,YAKnG,cAAc,CAAC,OAAO,CAAC,IAAI,aAAa,UAAU,QAAQ,WAAW;CAAE,OAAO;CAAK,YAAY;AAAK,CAAC,IAAI,QACzG,GACF;AACA,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,sCAAsC,CAAC;AAC3C,SAAS,qCAAqC,EAC5C,4BAA4B,qBAC9B,CAAC;AACD,OAAO,UAAU,aAAa,mCAAmC;AACjE,IAAI,mBAAmB,QAAQ,oBAAoB;AACnD,IAAI,cAAc,QAAQ,eAAe;AACzC,IAAI,gCAAgC,QAAQ,iCAAiC;AAC7E,IAAI,QAAQ,QAAQ,QAAQ,OAAO,GAAG,CAAC;AACvC,IAAI,sBAAsB,QAAQ,cAAc;AAChD,IAAI,yBAAyB,QAAQ,6BAAmB;AACxD,IAAI,uBAAuB,SAAS,OAAO;
|
|
1
|
+
{"version":3,"file":"useNativeAlertDialog.native.js","names":[],"sources":["cjs/useNativeAlertDialog.native.js"],"sourcesContent":["\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar useNativeAlertDialog_native_exports = {};\n__export(useNativeAlertDialog_native_exports, {\n useNativeAlertDialog: () => useNativeAlertDialog\n});\nmodule.exports = __toCommonJS(useNativeAlertDialog_native_exports);\nvar import_constants = require(\"@tamagui/constants\");\nvar import_core = require(\"@tamagui/core\");\nvar import_use_controllable_state = require(\"@tamagui/use-controllable-state\");\nvar React = __toESM(require(\"react\"), 1);\nvar import_react_native = require(\"react-native\");\nvar import_alertDialogPart = require(\"./alertDialogPart\");\nvar useNativeAlertDialog = function useNativeAlertDialog2(props) {\n var { native } = props;\n var [open, setOpen] = (0, import_use_controllable_state.useControllableState)({\n prop: props.open,\n defaultProp: props.defaultOpen || false,\n onChange: props.onOpenChange,\n transition: true\n });\n var triggerElement = null;\n var title = \"\";\n var description = \"\";\n var buttons = [];\n forEachChildDeep(React.Children.toArray(props.children), function(child) {\n if (!/* @__PURE__ */ React.isValidElement(child)) return false;\n var part = (0, import_core.isTamaguiElement)(child) ? child.type.staticConfig[import_alertDialogPart.ALERT_DIALOG_PART] : void 0;\n switch (part) {\n case \"trigger\": {\n triggerElement = /* @__PURE__ */ React.cloneElement(child, {\n __native: true\n });\n return false;\n }\n case \"title\": {\n title = getStringChildren(child);\n return false;\n }\n case \"description\": {\n description = getStringChildren(child);\n return false;\n }\n case \"action\":\n case \"destructive\":\n case \"cancel\": {\n var style = part === \"action\" ? \"default\" : part === \"destructive\" ? \"destructive\" : \"cancel\";\n var text = getStringChildren(child);\n var onPress = function onPress2() {\n var _childProps_onPress;\n var childProps = child.props;\n childProps === null || childProps === void 0 ? void 0 : (_childProps_onPress = childProps.onPress) === null || _childProps_onPress === void 0 ? void 0 : _childProps_onPress.call(childProps, {\n native: true\n });\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 (0, import_constants.useIsomorphicLayoutEffect)(function() {\n if (!open || !native) return;\n if (title || description) {\n import_react_native.Alert.alert(title, description, buttons);\n }\n }, [\n native,\n open\n ]);\n if (native) {\n return /* @__PURE__ */ React.cloneElement(triggerElement, {\n __onPress: function __onPress() {\n setOpen(true);\n }\n });\n }\n return null;\n};\nfunction forEachChildDeep(children, onChild) {\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = children[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var child = _step.value;\n if (!/* @__PURE__ */ React.isValidElement(child)) continue;\n if (!onChild(child)) continue;\n var childProps = child.props;\n if (childProps.children) {\n forEachChildDeep(React.Children.toArray(childProps.children), onChild);\n }\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n}\nfunction getStringChildren(child) {\n var string = \"\";\n forEachChildDeep(React.Children.toArray(child), function(child2) {\n if (typeof child2.props.children === \"string\") {\n string = child2.props.children;\n return false;\n }\n return true;\n });\n return string;\n}\n//# sourceMappingURL=useNativeAlertDialog.native.js.map\n"],"mappings":";;;AACA,IAAI,WAAW,OAAO;AACtB,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO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AAC,QAAQ;EACtB,IAAI,SAAS,aAAa;GACxB,oBAAoB,MAAM,MAAM,OAAO,aAAa,OAAO;EAC7D;CACF,GAAG,CACD,QACA,IACF,CAAC;CACD,IAAI,QAAQ;EACV,OAAuB,sBAAM,aAAa,gBAAgB,EACxD,WAAW,SAAS,YAAY;GAC9B,QAAQ,IAAI;EACd,EACF,CAAC;CACH;CACA,OAAO;AACT;AACA,SAAS,iBAAiB,UAAU,SAAS;CAC3C,IAAI,4BAA4B,MAAM,oBAAoB,OAAO,iBAAiB,KAAK;CACvF,IAAI;EACF,KAAK,IAAI,YAAY,SAAS,OAAO,SAAS,CAAC,GAAG,OAAO,EAAE,6BAA6B,QAAQ,UAAU,KAAK,EAAC,CAAE,OAAO,4BAA4B,MAAM;GACzJ,IAAI,QAAQ,MAAM;GAClB,IAAI,CAAiB,sBAAM,eAAe,KAAK,GAAG;GAClD,IAAI,CAAC,QAAQ,KAAK,GAAG;GACrB,IAAI,aAAa,MAAM;GACvB,IAAI,WAAW,UAAU;IACvB,iBAAiB,MAAM,SAAS,QAAQ,WAAW,QAAQ,GAAG,OAAO;GACvE;EACF;CACF,SAAS,KAAK;EACZ,oBAAoB;EACpB,iBAAiB;CACnB,UAAU;EACR,IAAI;GACF,IAAI,CAAC,6BAA6B,UAAU,UAAU,MAAM;IAC1D,UAAU,OAAO;GACnB;EACF,UAAU;GACR,IAAI,mBAAmB;IACrB,MAAM;GACR;EACF;CACF;AACF;AACA,SAAS,kBAAkB,OAAO;CAChC,IAAI,SAAS;CACb,iBAAiB,MAAM,SAAS,QAAQ,KAAK,GAAG,SAAS,QAAQ;EAC/D,IAAI,OAAO,OAAO,MAAM,aAAa,UAAU;GAC7C,SAAS,OAAO,MAAM;GACtB,OAAO;EACT;EACA,OAAO;CACT,CAAC;CACD,OAAO;AACT"}
|
|
@@ -8,7 +8,7 @@ import * as React from "react";
|
|
|
8
8
|
import { markAlertDialogPart } from "./alertDialogPart.native.js";
|
|
9
9
|
import { useNativeAlertDialog } from "./useNativeAlertDialog.native.js";
|
|
10
10
|
|
|
11
|
-
var getAlertDialogScope = function(scope) {
|
|
11
|
+
var getAlertDialogScope = function getAlertDialogScope2(scope) {
|
|
12
12
|
return scope;
|
|
13
13
|
};
|
|
14
14
|
var ROOT_NAME = "AlertDialog";
|
|
@@ -78,10 +78,10 @@ var AlertDialogContent = createStyledHOC(AlertDialogContentFrame, function Alert
|
|
|
78
78
|
(_cancelRef_current = cancelRef.current) === null || _cancelRef_current === void 0 ? void 0 : _cancelRef_current.focus({ preventScroll: true });
|
|
79
79
|
}
|
|
80
80
|
}),
|
|
81
|
-
onPointerDownOutside: function(event) {
|
|
81
|
+
onPointerDownOutside: function onPointerDownOutside(event) {
|
|
82
82
|
return event.cancel();
|
|
83
83
|
},
|
|
84
|
-
onInteractOutside: function(event) {
|
|
84
|
+
onInteractOutside: function onInteractOutside(event) {
|
|
85
85
|
return event.cancel();
|
|
86
86
|
},
|
|
87
87
|
children: [/* @__PURE__ */ jsx(Slottable, { children }), process.env.NODE_ENV === "development" && /* @__PURE__ */ jsx(DescriptionWarning, { contentRef })]
|
|
@@ -148,7 +148,7 @@ var AlertDialogDestructive = createStyledHOC(AlertDialogDestructiveFrame, functi
|
|
|
148
148
|
ref
|
|
149
149
|
});
|
|
150
150
|
});
|
|
151
|
-
var DescriptionWarning = function(param) {
|
|
151
|
+
var DescriptionWarning = function DescriptionWarning2(param) {
|
|
152
152
|
var { contentRef } = param;
|
|
153
153
|
if (process.env.NODE_ENV === "development") {
|
|
154
154
|
React.useEffect(function() {
|
|
@@ -168,7 +168,7 @@ var DescriptionWarning = function(param) {
|
|
|
168
168
|
}
|
|
169
169
|
return null;
|
|
170
170
|
};
|
|
171
|
-
var AlertDialogInner = function(props) {
|
|
171
|
+
var AlertDialogInner = function AlertDialogInner2(props) {
|
|
172
172
|
var { scope, native, ...alertDialogProps } = props;
|
|
173
173
|
var dialogScope = getAlertDialogScope(scope);
|
|
174
174
|
var nativeAlert = useNativeAlertDialog(props);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AlertDialog.native.js","names":[],"sources":["esm/AlertDialog.native.js"],"sourcesContent":["import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { createStyledHOC } from \"@tamagui/core\";\nimport { useComposedRefs } from \"@tamagui/compose-refs\";\nimport { isWeb } from \"@tamagui/constants\";\nimport { Slottable, View, createStyledContext, styled } from \"@tamagui/core\";\nimport { Dialog, DialogClose, DialogContent, DialogContentFrame, DialogDescription, DialogOverlay, DialogOverlayFrame, DialogPortal, DialogTitle, DialogTrigger, DialogWarningProvider } from \"@tamagui/dialog\";\nimport { composeEventHandlers, withStaticProperties } from \"@tamagui/helpers\";\nimport * as React from \"react\";\nimport { markAlertDialogPart } from \"./alertDialogPart\";\nimport { useNativeAlertDialog } from \"./useNativeAlertDialog\";\nvar getAlertDialogScope = function(scope) {\n return scope;\n};\nvar ROOT_NAME = \"AlertDialog\";\nvar TRIGGER_NAME = \"AlertDialogTrigger\";\nvar NativeAlertDialogTriggerFrame = styled(View, {\n displayName: TRIGGER_NAME\n});\nmarkAlertDialogPart(NativeAlertDialogTriggerFrame, \"trigger\");\nvar AlertDialogTrigger = createStyledHOC(NativeAlertDialogTriggerFrame, function AlertDialogTrigger2(props, forwardedRef) {\n if (props[\"__native\"]) {\n var { __native, onPress, __onPress, ...rest } = props;\n return /* @__PURE__ */ _jsx(NativeAlertDialogTriggerFrame, {\n ...rest,\n onPress: composeEventHandlers(onPress, __onPress)\n });\n }\n var { scope, ...triggerProps } = props;\n return /* @__PURE__ */ _jsx(DialogTrigger, {\n scope: getAlertDialogScope(scope),\n ...triggerProps,\n ref: forwardedRef\n });\n});\nvar AlertDialogPortal = function AlertDialogPortal2(props) {\n var { scope, ...portalProps } = props;\n return /* @__PURE__ */ _jsx(DialogPortal, {\n scope: getAlertDialogScope(scope),\n ...portalProps\n });\n};\nvar OVERLAY_NAME = \"AlertDialogOverlay\";\nvar AlertDialogOverlayFrame = styled(DialogOverlayFrame, {\n displayName: OVERLAY_NAME\n});\nvar AlertDialogOverlay = createStyledHOC(AlertDialogOverlayFrame, function AlertDialogOverlay2(props, forwardedRef) {\n var { scope, ...overlayProps } = props;\n return /* @__PURE__ */ _jsx(DialogOverlay, {\n scope: getAlertDialogScope(scope),\n ...overlayProps,\n ref: forwardedRef\n });\n});\nvar CONTENT_NAME = \"AlertDialogContent\";\nvar { Provider: AlertDialogContextProvider, useStyledContext: useAlertDialogContentContext } = createStyledContext({}, \"AlertDialogContext\");\nvar AlertDialogContentFrame = styled(DialogContentFrame, {\n displayName: CONTENT_NAME\n});\nvar AlertDialogContent = createStyledHOC(AlertDialogContentFrame, function AlertDialogContent2(props, forwardedRef) {\n var { scope, children, ...contentProps } = props;\n var dialogScope = getAlertDialogScope(scope);\n var contentRef = React.useRef(null);\n var composedRefs = useComposedRefs(forwardedRef, contentRef);\n var cancelRef = React.useRef(null);\n var destructiveRef = React.useRef(null);\n return /* @__PURE__ */ _jsx(DialogWarningProvider, {\n contentName: CONTENT_NAME,\n titleName: TITLE_NAME,\n docsSlug: \"alert-dialog\",\n children: /* @__PURE__ */ _jsx(AlertDialogContextProvider, {\n scope,\n cancelRef,\n destructiveRef,\n children: /* @__PURE__ */ _jsxs(DialogContent, {\n role: \"alertdialog\",\n \"aria-modal\": true,\n scope: dialogScope,\n ...contentProps,\n ref: composedRefs,\n onOpenAutoFocus: composeEventHandlers(contentProps.onOpenAutoFocus, function(event) {\n event.cancel();\n if (isWeb) {\n var _cancelRef_current;\n (_cancelRef_current = cancelRef.current) === null || _cancelRef_current === void 0 ? void 0 : _cancelRef_current.focus({\n preventScroll: true\n });\n }\n }),\n onPointerDownOutside: function(event) {\n return event.cancel();\n },\n onInteractOutside: function(event) {\n return event.cancel();\n },\n children: [\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 /* @__PURE__ */ _jsx(Slottable, {\n children\n }),\n process.env.NODE_ENV === \"development\" && /* @__PURE__ */ _jsx(DescriptionWarning, {\n contentRef\n })\n ]\n })\n })\n });\n});\nvar TITLE_NAME = \"AlertDialogTitle\";\nvar AlertDialogTitleFrame = styled(View, {\n displayName: TITLE_NAME\n});\nmarkAlertDialogPart(AlertDialogTitleFrame, \"title\");\nvar AlertDialogTitle = createStyledHOC(AlertDialogTitleFrame, function AlertDialogTitle2(props, forwardedRef) {\n var { scope, ...titleProps } = props;\n return /* @__PURE__ */ _jsx(DialogTitle, {\n scope: getAlertDialogScope(scope),\n ...titleProps,\n ref: forwardedRef\n });\n});\nvar DESCRIPTION_NAME = \"AlertDialogDescription\";\nvar AlertDialogDescriptionFrame = styled(View, {\n displayName: DESCRIPTION_NAME\n});\nmarkAlertDialogPart(AlertDialogDescriptionFrame, \"description\");\nvar AlertDialogDescription = createStyledHOC(AlertDialogDescriptionFrame, function AlertDialogDescription2(props, forwardedRef) {\n var { scope, ...descriptionProps } = props;\n return /* @__PURE__ */ _jsx(DialogDescription, {\n scope: getAlertDialogScope(scope),\n ...descriptionProps,\n ref: forwardedRef\n });\n});\nvar ACTION_NAME = \"AlertDialogAction\";\nvar AlertDialogActionFrame = styled(View, {\n displayName: ACTION_NAME\n});\nmarkAlertDialogPart(AlertDialogActionFrame, \"action\");\nvar AlertDialogAction = createStyledHOC(AlertDialogActionFrame, function AlertDialogAction2(props, forwardedRef) {\n var { scope, ...actionProps } = props;\n return /* @__PURE__ */ _jsx(DialogClose, {\n scope: getAlertDialogScope(scope),\n ...actionProps,\n ref: forwardedRef\n });\n});\nvar CANCEL_NAME = \"AlertDialogCancel\";\nvar AlertDialogCancelFrame = styled(View, {\n displayName: CANCEL_NAME\n});\nmarkAlertDialogPart(AlertDialogCancelFrame, \"cancel\");\nvar AlertDialogCancel = createStyledHOC(AlertDialogCancelFrame, function AlertDialogCancel2(props, forwardedRef) {\n var { scope, ...cancelProps } = props;\n var { cancelRef } = useAlertDialogContentContext(scope);\n var ref = useComposedRefs(forwardedRef, cancelRef);\n return /* @__PURE__ */ _jsx(DialogClose, {\n scope: getAlertDialogScope(scope),\n ...cancelProps,\n ref\n });\n});\nvar DESTRUCTIVE_NAME = \"AlertDialogDestructive\";\nvar AlertDialogDestructiveFrame = styled(View, {\n displayName: DESTRUCTIVE_NAME\n});\nmarkAlertDialogPart(AlertDialogDestructiveFrame, \"destructive\");\nvar AlertDialogDestructive = createStyledHOC(AlertDialogDestructiveFrame, function AlertDialogDestructive2(props, forwardedRef) {\n var { scope, ...destructiveProps } = props;\n var { destructiveRef } = useAlertDialogContentContext(scope);\n var ref = useComposedRefs(forwardedRef, destructiveRef);\n return /* @__PURE__ */ _jsx(DialogClose, {\n scope: getAlertDialogScope(scope),\n ...destructiveProps,\n ref\n });\n});\nvar DescriptionWarning = function(param) {\n var { contentRef } = param;\n if (process.env.NODE_ENV === \"development\") {\n React.useEffect(function() {\n var _contentRef_current;\n if (!isWeb) return;\n var hasDescription = document.getElementById((_contentRef_current = contentRef.current) === null || _contentRef_current === void 0 ? void 0 : _contentRef_current.getAttribute(\"aria-describedby\"));\n if (!hasDescription) {\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 }, [\n contentRef\n ]);\n }\n return null;\n};\nvar AlertDialogInner = function(props) {\n var { scope, native, ...alertDialogProps } = props;\n var dialogScope = getAlertDialogScope(scope);\n var nativeAlert = useNativeAlertDialog(props);\n if (nativeAlert) return nativeAlert;\n return /* @__PURE__ */ _jsx(Dialog, {\n scope: dialogScope,\n ...alertDialogProps,\n modal: true\n });\n};\nvar AlertDialog = withStaticProperties(AlertDialogInner, {\n Trigger: AlertDialogTrigger,\n Portal: AlertDialogPortal,\n Overlay: AlertDialogOverlay,\n Content: AlertDialogContent,\n Action: AlertDialogAction,\n Cancel: AlertDialogCancel,\n Destructive: AlertDialogDestructive,\n Title: AlertDialogTitle,\n Description: AlertDialogDescription\n});\nAlertDialog.displayName = ROOT_NAME;\nexport {\n AlertDialog,\n AlertDialogAction,\n AlertDialogCancel,\n AlertDialogContent,\n AlertDialogDescription,\n AlertDialogDestructive,\n AlertDialogOverlay,\n AlertDialogPortal,\n AlertDialogTitle,\n AlertDialogTrigger\n};\n//# sourceMappingURL=AlertDialog.js.map\n"],"mappings":";;;;;;;;;;;AAUA,IAAI,sBAAsB,SAAS,OAAO;CACxC,OAAO;AACT;AACA,IAAI,YAAY;AAChB,IAAI,eAAe;AACnB,IAAI,gCAAgC,OAAO,MAAM,EAC/C,aAAa,aACf,CAAC;AACD,oBAAoB,+BAA+B,SAAS;AAC5D,IAAI,qBAAqB,gBAAgB,+BAA+B,SAAS,oBAAoB,OAAO,cAAc;CACxH,IAAI,MAAM,aAAa;EACrB,IAAI,EAAE,UAAU,SAAS,WAAW,GAAG,SAAS;EAChD,OAAuB,oBAAK,+BAA+B;GACzD,GAAG;GACH,SAAS,qBAAqB,SAAS,SAAS;EAClD,CAAC;CACH;CACA,IAAI,EAAE,OAAO,GAAG,iBAAiB;CACjC,OAAuB,oBAAK,eAAe;EACzC,OAAO,oBAAoB,KAAK;EAChC,GAAG;EACH,KAAK;CACP,CAAC;AACH,CAAC;AACD,IAAI,oBAAoB,SAAS,mBAAmB,OAAO;CACzD,IAAI,EAAE,OAAO,GAAG,gBAAgB;CAChC,OAAuB,oBAAK,cAAc;EACxC,OAAO,oBAAoB,KAAK;EAChC,GAAG;CACL,CAAC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AAuB,oBAAK,QAAQ;EAClC,OAAO;EACP,GAAG;EACH,OAAO;CACT,CAAC;AACH;AACA,IAAI,cAAc,qBAAqB,kBAAkB;CACvD,SAAS;CACT,QAAQ;CACR,SAAS;CACT,SAAS;CACT,QAAQ;CACR,QAAQ;CACR,aAAa;CACb,OAAO;CACP,aAAa;AACf,CAAC;AACD,YAAY,cAAc"}
|
|
1
|
+
{"version":3,"file":"AlertDialog.native.js","names":[],"sources":["esm/AlertDialog.native.js"],"sourcesContent":["import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { createStyledHOC } from \"@tamagui/core\";\nimport { useComposedRefs } from \"@tamagui/compose-refs\";\nimport { isWeb } from \"@tamagui/constants\";\nimport { Slottable, View, createStyledContext, styled } from \"@tamagui/core\";\nimport { Dialog, DialogClose, DialogContent, DialogContentFrame, DialogDescription, DialogOverlay, DialogOverlayFrame, DialogPortal, DialogTitle, DialogTrigger, DialogWarningProvider } from \"@tamagui/dialog\";\nimport { composeEventHandlers, withStaticProperties } from \"@tamagui/helpers\";\nimport * as React from \"react\";\nimport { markAlertDialogPart } from \"./alertDialogPart\";\nimport { useNativeAlertDialog } from \"./useNativeAlertDialog\";\nvar getAlertDialogScope = function getAlertDialogScope2(scope) {\n return scope;\n};\nvar ROOT_NAME = \"AlertDialog\";\nvar TRIGGER_NAME = \"AlertDialogTrigger\";\nvar NativeAlertDialogTriggerFrame = styled(View, {\n displayName: TRIGGER_NAME\n});\nmarkAlertDialogPart(NativeAlertDialogTriggerFrame, \"trigger\");\nvar AlertDialogTrigger = createStyledHOC(NativeAlertDialogTriggerFrame, function AlertDialogTrigger2(props, forwardedRef) {\n if (props[\"__native\"]) {\n var { __native, onPress, __onPress, ...rest } = props;\n return /* @__PURE__ */ _jsx(NativeAlertDialogTriggerFrame, {\n ...rest,\n onPress: composeEventHandlers(onPress, __onPress)\n });\n }\n var { scope, ...triggerProps } = props;\n return /* @__PURE__ */ _jsx(DialogTrigger, {\n scope: getAlertDialogScope(scope),\n ...triggerProps,\n ref: forwardedRef\n });\n});\nvar AlertDialogPortal = function AlertDialogPortal2(props) {\n var { scope, ...portalProps } = props;\n return /* @__PURE__ */ _jsx(DialogPortal, {\n scope: getAlertDialogScope(scope),\n ...portalProps\n });\n};\nvar OVERLAY_NAME = \"AlertDialogOverlay\";\nvar AlertDialogOverlayFrame = styled(DialogOverlayFrame, {\n displayName: OVERLAY_NAME\n});\nvar AlertDialogOverlay = createStyledHOC(AlertDialogOverlayFrame, function AlertDialogOverlay2(props, forwardedRef) {\n var { scope, ...overlayProps } = props;\n return /* @__PURE__ */ _jsx(DialogOverlay, {\n scope: getAlertDialogScope(scope),\n ...overlayProps,\n ref: forwardedRef\n });\n});\nvar CONTENT_NAME = \"AlertDialogContent\";\nvar { Provider: AlertDialogContextProvider, useStyledContext: useAlertDialogContentContext } = createStyledContext({}, \"AlertDialogContext\");\nvar AlertDialogContentFrame = styled(DialogContentFrame, {\n displayName: CONTENT_NAME\n});\nvar AlertDialogContent = createStyledHOC(AlertDialogContentFrame, function AlertDialogContent2(props, forwardedRef) {\n var { scope, children, ...contentProps } = props;\n var dialogScope = getAlertDialogScope(scope);\n var contentRef = React.useRef(null);\n var composedRefs = useComposedRefs(forwardedRef, contentRef);\n var cancelRef = React.useRef(null);\n var destructiveRef = React.useRef(null);\n return /* @__PURE__ */ _jsx(DialogWarningProvider, {\n contentName: CONTENT_NAME,\n titleName: TITLE_NAME,\n docsSlug: \"alert-dialog\",\n children: /* @__PURE__ */ _jsx(AlertDialogContextProvider, {\n scope,\n cancelRef,\n destructiveRef,\n children: /* @__PURE__ */ _jsxs(DialogContent, {\n role: \"alertdialog\",\n \"aria-modal\": true,\n scope: dialogScope,\n ...contentProps,\n ref: composedRefs,\n onOpenAutoFocus: composeEventHandlers(contentProps.onOpenAutoFocus, function(event) {\n event.cancel();\n if (isWeb) {\n var _cancelRef_current;\n (_cancelRef_current = cancelRef.current) === null || _cancelRef_current === void 0 ? void 0 : _cancelRef_current.focus({\n preventScroll: true\n });\n }\n }),\n onPointerDownOutside: function onPointerDownOutside(event) {\n return event.cancel();\n },\n onInteractOutside: function onInteractOutside(event) {\n return event.cancel();\n },\n children: [\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 /* @__PURE__ */ _jsx(Slottable, {\n children\n }),\n process.env.NODE_ENV === \"development\" && /* @__PURE__ */ _jsx(DescriptionWarning, {\n contentRef\n })\n ]\n })\n })\n });\n});\nvar TITLE_NAME = \"AlertDialogTitle\";\nvar AlertDialogTitleFrame = styled(View, {\n displayName: TITLE_NAME\n});\nmarkAlertDialogPart(AlertDialogTitleFrame, \"title\");\nvar AlertDialogTitle = createStyledHOC(AlertDialogTitleFrame, function AlertDialogTitle2(props, forwardedRef) {\n var { scope, ...titleProps } = props;\n return /* @__PURE__ */ _jsx(DialogTitle, {\n scope: getAlertDialogScope(scope),\n ...titleProps,\n ref: forwardedRef\n });\n});\nvar DESCRIPTION_NAME = \"AlertDialogDescription\";\nvar AlertDialogDescriptionFrame = styled(View, {\n displayName: DESCRIPTION_NAME\n});\nmarkAlertDialogPart(AlertDialogDescriptionFrame, \"description\");\nvar AlertDialogDescription = createStyledHOC(AlertDialogDescriptionFrame, function AlertDialogDescription2(props, forwardedRef) {\n var { scope, ...descriptionProps } = props;\n return /* @__PURE__ */ _jsx(DialogDescription, {\n scope: getAlertDialogScope(scope),\n ...descriptionProps,\n ref: forwardedRef\n });\n});\nvar ACTION_NAME = \"AlertDialogAction\";\nvar AlertDialogActionFrame = styled(View, {\n displayName: ACTION_NAME\n});\nmarkAlertDialogPart(AlertDialogActionFrame, \"action\");\nvar AlertDialogAction = createStyledHOC(AlertDialogActionFrame, function AlertDialogAction2(props, forwardedRef) {\n var { scope, ...actionProps } = props;\n return /* @__PURE__ */ _jsx(DialogClose, {\n scope: getAlertDialogScope(scope),\n ...actionProps,\n ref: forwardedRef\n });\n});\nvar CANCEL_NAME = \"AlertDialogCancel\";\nvar AlertDialogCancelFrame = styled(View, {\n displayName: CANCEL_NAME\n});\nmarkAlertDialogPart(AlertDialogCancelFrame, \"cancel\");\nvar AlertDialogCancel = createStyledHOC(AlertDialogCancelFrame, function AlertDialogCancel2(props, forwardedRef) {\n var { scope, ...cancelProps } = props;\n var { cancelRef } = useAlertDialogContentContext(scope);\n var ref = useComposedRefs(forwardedRef, cancelRef);\n return /* @__PURE__ */ _jsx(DialogClose, {\n scope: getAlertDialogScope(scope),\n ...cancelProps,\n ref\n });\n});\nvar DESTRUCTIVE_NAME = \"AlertDialogDestructive\";\nvar AlertDialogDestructiveFrame = styled(View, {\n displayName: DESTRUCTIVE_NAME\n});\nmarkAlertDialogPart(AlertDialogDestructiveFrame, \"destructive\");\nvar AlertDialogDestructive = createStyledHOC(AlertDialogDestructiveFrame, function AlertDialogDestructive2(props, forwardedRef) {\n var { scope, ...destructiveProps } = props;\n var { destructiveRef } = useAlertDialogContentContext(scope);\n var ref = useComposedRefs(forwardedRef, destructiveRef);\n return /* @__PURE__ */ _jsx(DialogClose, {\n scope: getAlertDialogScope(scope),\n ...destructiveProps,\n ref\n });\n});\nvar DescriptionWarning = function DescriptionWarning2(param) {\n var { contentRef } = param;\n if (process.env.NODE_ENV === \"development\") {\n React.useEffect(function() {\n var _contentRef_current;\n if (!isWeb) return;\n var hasDescription = document.getElementById((_contentRef_current = contentRef.current) === null || _contentRef_current === void 0 ? void 0 : _contentRef_current.getAttribute(\"aria-describedby\"));\n if (!hasDescription) {\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 }, [\n contentRef\n ]);\n }\n return null;\n};\nvar AlertDialogInner = function AlertDialogInner2(props) {\n var { scope, native, ...alertDialogProps } = props;\n var dialogScope = getAlertDialogScope(scope);\n var nativeAlert = useNativeAlertDialog(props);\n if (nativeAlert) return nativeAlert;\n return /* @__PURE__ */ _jsx(Dialog, {\n scope: dialogScope,\n ...alertDialogProps,\n modal: true\n });\n};\nvar AlertDialog = withStaticProperties(AlertDialogInner, {\n Trigger: AlertDialogTrigger,\n Portal: AlertDialogPortal,\n Overlay: AlertDialogOverlay,\n Content: AlertDialogContent,\n Action: AlertDialogAction,\n Cancel: AlertDialogCancel,\n Destructive: AlertDialogDestructive,\n Title: AlertDialogTitle,\n Description: AlertDialogDescription\n});\nAlertDialog.displayName = ROOT_NAME;\nexport {\n AlertDialog,\n AlertDialogAction,\n AlertDialogCancel,\n AlertDialogContent,\n AlertDialogDescription,\n AlertDialogDestructive,\n AlertDialogOverlay,\n AlertDialogPortal,\n AlertDialogTitle,\n AlertDialogTrigger\n};\n//# sourceMappingURL=AlertDialog.js.map\n"],"mappings":";;;;;;;;;;;AAUA,IAAI,sBAAsB,SAAS,qBAAqB,OAAO;CAC7D,OAAO;AACT;AACA,IAAI,YAAY;AAChB,IAAI,eAAe;AACnB,IAAI,gCAAgC,OAAO,MAAM,EAC/C,aAAa,aACf,CAAC;AACD,oBAAoB,+BAA+B,SAAS;AAC5D,IAAI,qBAAqB,gBAAgB,+BAA+B,SAAS,oBAAoB,OAAO,cAAc;CACxH,IAAI,MAAM,aAAa;EACrB,IAAI,EAAE,UAAU,SAAS,WAAW,GAAG,SAAS;EAChD,OAAuB,oBAAK,+BAA+B;GACzD,GAAG;GACH,SAAS,qBAAqB,SAAS,SAAS;EAClD,CAAC;CACH;CACA,IAAI,EAAE,OAA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aAAa;;6CAEM,aAAa,oBAAoB,iBAAiB;;oKAEqE,aAAa;;mFAE9F;GAC7E;EACF,GAAG,CACD,UACF,CAAC;CACH;CACA,OAAO;AACT;AACA,IAAI,mBAAmB,SAAS,kBAAkB,OAAO;CACvD,IAAI,EAAE,OAAO,QAAQ,GAAG,qBAAqB;CAC7C,IAAI,cAAc,oBAAoB,KAAK;CAC3C,IAAI,cAAc,qBAAqB,KAAK;CAC5C,IAAI,aAAa,OAAO;CACxB,OAAuB,oBAAK,QAAQ;EAClC,OAAO;EACP,GAAG;EACH,OAAO;CACT,CAAC;AACH;AACA,IAAI,cAAc,qBAAqB,kBAAkB;CACvD,SAAS;CACT,QAAQ;CACR,SAAS;CACT,SAAS;CACT,QAAQ;CACR,QAAQ;CACR,aAAa;CACb,OAAO;CACP,aAAa;AACf,CAAC;AACD,YAAY,cAAc"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
var ALERT_DIALOG_PART = /* @__PURE__ */ Symbol("AlertDialogPart");
|
|
2
|
-
var markAlertDialogPart = function(component, part) {
|
|
2
|
+
var markAlertDialogPart = function markAlertDialogPart2(component, part) {
|
|
3
3
|
Object.assign(component.staticConfig, { [ALERT_DIALOG_PART]: part });
|
|
4
4
|
};
|
|
5
5
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alertDialogPart.native.js","names":[],"sources":["esm/alertDialogPart.native.js"],"sourcesContent":["var ALERT_DIALOG_PART = /* @__PURE__ */ Symbol(\"AlertDialogPart\");\nvar markAlertDialogPart = function(component, part) {\n Object.assign(component.staticConfig, {\n [ALERT_DIALOG_PART]: part\n });\n};\nexport {\n ALERT_DIALOG_PART,\n markAlertDialogPart\n};\n//# sourceMappingURL=alertDialogPart.js.map\n"],"mappings":";AAAA,IAAI,oBAAoC,uBAAO,iBAAiB;AAChE,IAAI,sBAAsB,SAAS,WAAW,MAAM;
|
|
1
|
+
{"version":3,"file":"alertDialogPart.native.js","names":[],"sources":["esm/alertDialogPart.native.js"],"sourcesContent":["var ALERT_DIALOG_PART = /* @__PURE__ */ Symbol(\"AlertDialogPart\");\nvar markAlertDialogPart = function markAlertDialogPart2(component, part) {\n Object.assign(component.staticConfig, {\n [ALERT_DIALOG_PART]: part\n });\n};\nexport {\n ALERT_DIALOG_PART,\n markAlertDialogPart\n};\n//# sourceMappingURL=alertDialogPart.js.map\n"],"mappings":";AAAA,IAAI,oBAAoC,uBAAO,iBAAiB;AAChE,IAAI,sBAAsB,SAAS,qBAAqB,WAAW,MAAM;CACvE,OAAO,OAAO,UAAU,cAAc,GACnC,oBAAoB,KACvB,CAAC;AACH"}
|
|
@@ -5,7 +5,7 @@ import * as React from "react";
|
|
|
5
5
|
import { Alert } from "react-native";
|
|
6
6
|
import { ALERT_DIALOG_PART } from "./alertDialogPart.native.js";
|
|
7
7
|
|
|
8
|
-
var useNativeAlertDialog = function(props) {
|
|
8
|
+
var useNativeAlertDialog = function useNativeAlertDialog2(props) {
|
|
9
9
|
var { native } = props;
|
|
10
10
|
var [open, setOpen] = useControllableState({
|
|
11
11
|
prop: props.open,
|
|
@@ -38,7 +38,7 @@ var useNativeAlertDialog = function(props) {
|
|
|
38
38
|
case "cancel": {
|
|
39
39
|
var style = part === "action" ? "default" : part === "destructive" ? "destructive" : "cancel";
|
|
40
40
|
var text = getStringChildren(child);
|
|
41
|
-
var onPress = function() {
|
|
41
|
+
var onPress = function onPress2() {
|
|
42
42
|
var _childProps_onPress;
|
|
43
43
|
var childProps = child.props;
|
|
44
44
|
childProps === null || childProps === void 0 ? void 0 : (_childProps_onPress = childProps.onPress) === null || _childProps_onPress === void 0 ? void 0 : _childProps_onPress.call(childProps, { native: true });
|
|
@@ -63,7 +63,7 @@ var useNativeAlertDialog = function(props) {
|
|
|
63
63
|
}
|
|
64
64
|
}, [native, open]);
|
|
65
65
|
if (native) {
|
|
66
|
-
return /* @__PURE__ */ React.cloneElement(triggerElement, { __onPress: function() {
|
|
66
|
+
return /* @__PURE__ */ React.cloneElement(triggerElement, { __onPress: function __onPress() {
|
|
67
67
|
setOpen(true);
|
|
68
68
|
} });
|
|
69
69
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useNativeAlertDialog.native.js","names":[],"sources":["esm/useNativeAlertDialog.native.js"],"sourcesContent":["import { useIsomorphicLayoutEffect } from \"@tamagui/constants\";\nimport { isTamaguiElement } from \"@tamagui/core\";\nimport { useControllableState } from \"@tamagui/use-controllable-state\";\nimport * as React from \"react\";\nimport { Alert } from \"react-native\";\nimport { ALERT_DIALOG_PART } from \"./alertDialogPart\";\nvar useNativeAlertDialog = function(props) {\n var { native } = props;\n var [open, setOpen] = useControllableState({\n prop: props.open,\n defaultProp: props.defaultOpen || false,\n onChange: props.onOpenChange,\n transition: true\n });\n var triggerElement = null;\n var title = \"\";\n var description = \"\";\n var buttons = [];\n forEachChildDeep(React.Children.toArray(props.children), function(child) {\n if (!/* @__PURE__ */ React.isValidElement(child)) return false;\n var part = isTamaguiElement(child) ? child.type.staticConfig[ALERT_DIALOG_PART] : void 0;\n switch (part) {\n case \"trigger\": {\n triggerElement = /* @__PURE__ */ React.cloneElement(child, {\n __native: true\n });\n return false;\n }\n case \"title\": {\n title = getStringChildren(child);\n return false;\n }\n case \"description\": {\n description = getStringChildren(child);\n return false;\n }\n case \"action\":\n case \"destructive\":\n case \"cancel\": {\n var style = part === \"action\" ? \"default\" : part === \"destructive\" ? \"destructive\" : \"cancel\";\n var text = getStringChildren(child);\n var onPress = function() {\n var _childProps_onPress;\n var childProps = child.props;\n childProps === null || childProps === void 0 ? void 0 : (_childProps_onPress = childProps.onPress) === null || _childProps_onPress === void 0 ? void 0 : _childProps_onPress.call(childProps, {\n native: true\n });\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 useIsomorphicLayoutEffect(function() {\n if (!open || !native) return;\n if (title || description) {\n Alert.alert(title, description, buttons);\n }\n }, [\n native,\n open\n ]);\n if (native) {\n return /* @__PURE__ */ React.cloneElement(triggerElement, {\n __onPress: function() {\n setOpen(true);\n }\n });\n }\n return null;\n};\nfunction forEachChildDeep(children, onChild) {\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = children[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var child = _step.value;\n if (!/* @__PURE__ */ React.isValidElement(child)) continue;\n if (!onChild(child)) continue;\n var childProps = child.props;\n if (childProps.children) {\n forEachChildDeep(React.Children.toArray(childProps.children), onChild);\n }\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n}\nfunction getStringChildren(child) {\n var string = \"\";\n forEachChildDeep(React.Children.toArray(child), function(child2) {\n if (typeof child2.props.children === \"string\") {\n string = child2.props.children;\n return false;\n }\n return true;\n });\n return string;\n}\nexport {\n useNativeAlertDialog\n};\n//# sourceMappingURL=useNativeAlertDialog.native.js.map\n"],"mappings":";;;;;;;;AAMA,IAAI,uBAAuB,SAAS,OAAO;
|
|
1
|
+
{"version":3,"file":"useNativeAlertDialog.native.js","names":[],"sources":["esm/useNativeAlertDialog.native.js"],"sourcesContent":["import { useIsomorphicLayoutEffect } from \"@tamagui/constants\";\nimport { isTamaguiElement } from \"@tamagui/core\";\nimport { useControllableState } from \"@tamagui/use-controllable-state\";\nimport * as React from \"react\";\nimport { Alert } from \"react-native\";\nimport { ALERT_DIALOG_PART } from \"./alertDialogPart\";\nvar useNativeAlertDialog = function useNativeAlertDialog2(props) {\n var { native } = props;\n var [open, setOpen] = useControllableState({\n prop: props.open,\n defaultProp: props.defaultOpen || false,\n onChange: props.onOpenChange,\n transition: true\n });\n var triggerElement = null;\n var title = \"\";\n var description = \"\";\n var buttons = [];\n forEachChildDeep(React.Children.toArray(props.children), function(child) {\n if (!/* @__PURE__ */ React.isValidElement(child)) return false;\n var part = isTamaguiElement(child) ? child.type.staticConfig[ALERT_DIALOG_PART] : void 0;\n switch (part) {\n case \"trigger\": {\n triggerElement = /* @__PURE__ */ React.cloneElement(child, {\n __native: true\n });\n return false;\n }\n case \"title\": {\n title = getStringChildren(child);\n return false;\n }\n case \"description\": {\n description = getStringChildren(child);\n return false;\n }\n case \"action\":\n case \"destructive\":\n case \"cancel\": {\n var style = part === \"action\" ? \"default\" : part === \"destructive\" ? \"destructive\" : \"cancel\";\n var text = getStringChildren(child);\n var onPress = function onPress2() {\n var _childProps_onPress;\n var childProps = child.props;\n childProps === null || childProps === void 0 ? void 0 : (_childProps_onPress = childProps.onPress) === null || _childProps_onPress === void 0 ? void 0 : _childProps_onPress.call(childProps, {\n native: true\n });\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 useIsomorphicLayoutEffect(function() {\n if (!open || !native) return;\n if (title || description) {\n Alert.alert(title, description, buttons);\n }\n }, [\n native,\n open\n ]);\n if (native) {\n return /* @__PURE__ */ React.cloneElement(triggerElement, {\n __onPress: function __onPress() {\n setOpen(true);\n }\n });\n }\n return null;\n};\nfunction forEachChildDeep(children, onChild) {\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = children[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var child = _step.value;\n if (!/* @__PURE__ */ React.isValidElement(child)) continue;\n if (!onChild(child)) continue;\n var childProps = child.props;\n if (childProps.children) {\n forEachChildDeep(React.Children.toArray(childProps.children), onChild);\n }\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n}\nfunction getStringChildren(child) {\n var string = \"\";\n forEachChildDeep(React.Children.toArray(child), function(child2) {\n if (typeof child2.props.children === \"string\") {\n string = child2.props.children;\n return false;\n }\n return true;\n });\n return string;\n}\nexport {\n useNativeAlertDialog\n};\n//# sourceMappingURL=useNativeAlertDialog.native.js.map\n"],"mappings":";;;;;;;;AAMA,IAAI,uBAAuB,SAAS,sBAAsB,OAAO;CAC/D,IAAI,EAAE,WAAW;CACjB,IAAI,CAAC,MAAM,WAAW,qBAAqB;EACzC,MAAM,MAAM;EACZ,aAAa,MAAM,eAAe;EAClC,UAAU,MAAM;EAChB,YAAY;CACd,CAAC;CACD,IAAI,iBAAiB;CACrB,IAAI,QAAQ;CACZ,IAAI,cAAc;CAClB,IAAI,UAAU,CAAC;CACf,iBAAiB,MAAM,SAAS,QAAQ,MAAM,QAAQ,GAAG,SAAS,OAAO;EACvE,IAAI,CAAiB,sBAAM,eAAe,KAAK,GAAG,OAAO;EACzD,IAAI,OAAO,iBAAiB,KAAK,IAAI,MAAM,KAAK,aAAa,qBAAqB,KAAK;EACvF,QAAQ,MAAR;GACE,KAAK,WAAW;IACd,iBAAiC,sBAAM,aAAa,OAAO,EACzD,UAAU,KACZ,CAAC;IACD,OAAO;GACT;GACA,KAAK,SAAS;IACZ,QAAQ,kBAAkB,KAAK;IAC/B,OAAO;GACT;GACA,KAAK,eAAe;IAClB,cAAc,kBAAkB,KAAK;IACrC,OAAO;GACT;GACA,KAAK;GACL,KAAK;GACL,KAAK,UAAU;IACb,IAAI,QAAQ,SAAS,WAAW,YAAY,SAAS,gBAAgB,gBAAgB;IACrF,IAAI,OAAO,kBAAkB,KAAK;IAClC,IAAI,UAAU,SAAS,WAAW;KAChC,IAAI;KACJ,IAAI,aAAa,MAAM;KACvB,eAAe,QAAQ,eAAe,KAAK,IAAI,KAAK,KAAK,sBAAsB,WAAW,aAAa,QAAQ,wBAAwB,KAAK,IAAI,KAAK,IAAI,oBAAoB,KAAK,Y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AAU;GAC7C,SAAS,OAAO,MAAM;GACtB,OAAO;EACT;EACA,OAAO;CACT,CAAC;CACD,OAAO;AACT"}
|
|
@@ -50,7 +50,7 @@ var import_helpers = require("@tamagui/helpers");
|
|
|
50
50
|
var React = __toESM(require("react"), 1);
|
|
51
51
|
var import_alertDialogPart = require("./alertDialogPart.native.js");
|
|
52
52
|
var import_useNativeAlertDialog = require("./useNativeAlertDialog.native.js");
|
|
53
|
-
var getAlertDialogScope = function(scope) {
|
|
53
|
+
var getAlertDialogScope = function getAlertDialogScope2(scope) {
|
|
54
54
|
return scope;
|
|
55
55
|
};
|
|
56
56
|
var ROOT_NAME = "AlertDialog";
|
|
@@ -120,10 +120,10 @@ var AlertDialogContent = (0, import_core.createStyledHOC)(AlertDialogContentFram
|
|
|
120
120
|
(_cancelRef_current = cancelRef.current) === null || _cancelRef_current === void 0 ? void 0 : _cancelRef_current.focus({ preventScroll: true });
|
|
121
121
|
}
|
|
122
122
|
}),
|
|
123
|
-
onPointerDownOutside: function(event) {
|
|
123
|
+
onPointerDownOutside: function onPointerDownOutside(event) {
|
|
124
124
|
return event.cancel();
|
|
125
125
|
},
|
|
126
|
-
onInteractOutside: function(event) {
|
|
126
|
+
onInteractOutside: function onInteractOutside(event) {
|
|
127
127
|
return event.cancel();
|
|
128
128
|
},
|
|
129
129
|
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core2.Slottable, { children }), process.env.NODE_ENV === "development" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DescriptionWarning, { contentRef })]
|
|
@@ -190,7 +190,7 @@ var AlertDialogDestructive = (0, import_core.createStyledHOC)(AlertDialogDestruc
|
|
|
190
190
|
ref
|
|
191
191
|
});
|
|
192
192
|
});
|
|
193
|
-
var DescriptionWarning = function(param) {
|
|
193
|
+
var DescriptionWarning = function DescriptionWarning2(param) {
|
|
194
194
|
var { contentRef } = param;
|
|
195
195
|
if (process.env.NODE_ENV === "development") {
|
|
196
196
|
React.useEffect(function() {
|
|
@@ -210,7 +210,7 @@ var DescriptionWarning = function(param) {
|
|
|
210
210
|
}
|
|
211
211
|
return null;
|
|
212
212
|
};
|
|
213
|
-
var AlertDialogInner = function(props) {
|
|
213
|
+
var AlertDialogInner = function AlertDialogInner2(props) {
|
|
214
214
|
var { scope, native, ...alertDialogProps } = props;
|
|
215
215
|
var dialogScope = getAlertDialogScope(scope);
|
|
216
216
|
var nativeAlert = (0, import_useNativeAlertDialog.useNativeAlertDialog)(props);
|
|
@@ -50,7 +50,7 @@ var import_helpers = require("@tamagui/helpers");
|
|
|
50
50
|
var React = __toESM(require("react"), 1);
|
|
51
51
|
var import_alertDialogPart = require("./alertDialogPart.native.js");
|
|
52
52
|
var import_useNativeAlertDialog = require("./useNativeAlertDialog.native.js");
|
|
53
|
-
var getAlertDialogScope = function(scope) {
|
|
53
|
+
var getAlertDialogScope = function getAlertDialogScope2(scope) {
|
|
54
54
|
return scope;
|
|
55
55
|
};
|
|
56
56
|
var ROOT_NAME = "AlertDialog";
|
|
@@ -120,10 +120,10 @@ var AlertDialogContent = (0, import_core.createStyledHOC)(AlertDialogContentFram
|
|
|
120
120
|
(_cancelRef_current = cancelRef.current) === null || _cancelRef_current === void 0 ? void 0 : _cancelRef_current.focus({ preventScroll: true });
|
|
121
121
|
}
|
|
122
122
|
}),
|
|
123
|
-
onPointerDownOutside: function(event) {
|
|
123
|
+
onPointerDownOutside: function onPointerDownOutside(event) {
|
|
124
124
|
return event.cancel();
|
|
125
125
|
},
|
|
126
|
-
onInteractOutside: function(event) {
|
|
126
|
+
onInteractOutside: function onInteractOutside(event) {
|
|
127
127
|
return event.cancel();
|
|
128
128
|
},
|
|
129
129
|
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core2.Slottable, { children }), process.env.NODE_ENV === "development" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DescriptionWarning, { contentRef })]
|
|
@@ -190,7 +190,7 @@ var AlertDialogDestructive = (0, import_core.createStyledHOC)(AlertDialogDestruc
|
|
|
190
190
|
ref
|
|
191
191
|
});
|
|
192
192
|
});
|
|
193
|
-
var DescriptionWarning = function(param) {
|
|
193
|
+
var DescriptionWarning = function DescriptionWarning2(param) {
|
|
194
194
|
var { contentRef } = param;
|
|
195
195
|
if (process.env.NODE_ENV === "development") {
|
|
196
196
|
React.useEffect(function() {
|
|
@@ -210,7 +210,7 @@ var DescriptionWarning = function(param) {
|
|
|
210
210
|
}
|
|
211
211
|
return null;
|
|
212
212
|
};
|
|
213
|
-
var AlertDialogInner = function(props) {
|
|
213
|
+
var AlertDialogInner = function AlertDialogInner2(props) {
|
|
214
214
|
var { scope, native, ...alertDialogProps } = props;
|
|
215
215
|
var dialogScope = getAlertDialogScope(scope);
|
|
216
216
|
var nativeAlert = (0, import_useNativeAlertDialog.useNativeAlertDialog)(props);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AlertDialog.native.js","names":[],"sources":["jsx/AlertDialog.native.js"],"sourcesContent":["\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar AlertDialog_exports = {};\n__export(AlertDialog_exports, {\n AlertDialog: () => AlertDialog,\n AlertDialogAction: () => AlertDialogAction,\n AlertDialogCancel: () => AlertDialogCancel,\n AlertDialogContent: () => AlertDialogContent,\n AlertDialogDescription: () => AlertDialogDescription,\n AlertDialogDestructive: () => AlertDialogDestructive,\n AlertDialogOverlay: () => AlertDialogOverlay,\n AlertDialogPortal: () => AlertDialogPortal,\n AlertDialogTitle: () => AlertDialogTitle,\n AlertDialogTrigger: () => AlertDialogTrigger\n});\nmodule.exports = __toCommonJS(AlertDialog_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_core = require(\"@tamagui/core\");\nvar import_compose_refs = require(\"@tamagui/compose-refs\");\nvar import_constants = require(\"@tamagui/constants\");\nvar import_core2 = require(\"@tamagui/core\");\nvar import_dialog = require(\"@tamagui/dialog\");\nvar import_helpers = require(\"@tamagui/helpers\");\nvar React = __toESM(require(\"react\"), 1);\nvar import_alertDialogPart = require(\"./alertDialogPart\");\nvar import_useNativeAlertDialog = require(\"./useNativeAlertDialog\");\nvar getAlertDialogScope = function(scope) {\n return scope;\n};\nvar ROOT_NAME = \"AlertDialog\";\nvar TRIGGER_NAME = \"AlertDialogTrigger\";\nvar NativeAlertDialogTriggerFrame = (0, import_core2.styled)(import_core2.View, {\n displayName: TRIGGER_NAME\n});\n(0, import_alertDialogPart.markAlertDialogPart)(NativeAlertDialogTriggerFrame, \"trigger\");\nvar AlertDialogTrigger = (0, import_core.createStyledHOC)(NativeAlertDialogTriggerFrame, function AlertDialogTrigger2(props, forwardedRef) {\n if (props[\"__native\"]) {\n var { __native, onPress, __onPress, ...rest } = props;\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(NativeAlertDialogTriggerFrame, {\n ...rest,\n onPress: (0, import_helpers.composeEventHandlers)(onPress, __onPress)\n });\n }\n var { scope, ...triggerProps } = props;\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.DialogTrigger, {\n scope: getAlertDialogScope(scope),\n ...triggerProps,\n ref: forwardedRef\n });\n});\nvar AlertDialogPortal = function AlertDialogPortal2(props) {\n var { scope, ...portalProps } = props;\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.DialogPortal, {\n scope: getAlertDialogScope(scope),\n ...portalProps\n });\n};\nvar OVERLAY_NAME = \"AlertDialogOverlay\";\nvar AlertDialogOverlayFrame = (0, import_core2.styled)(import_dialog.DialogOverlayFrame, {\n displayName: OVERLAY_NAME\n});\nvar AlertDialogOverlay = (0, import_core.createStyledHOC)(AlertDialogOverlayFrame, function AlertDialogOverlay2(props, forwardedRef) {\n var { scope, ...overlayProps } = props;\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.DialogOverlay, {\n scope: getAlertDialogScope(scope),\n ...overlayProps,\n ref: forwardedRef\n });\n});\nvar CONTENT_NAME = \"AlertDialogContent\";\nvar { Provider: AlertDialogContextProvider, useStyledContext: useAlertDialogContentContext } = (0, import_core2.createStyledContext)({}, \"AlertDialogContext\");\nvar AlertDialogContentFrame = (0, import_core2.styled)(import_dialog.DialogContentFrame, {\n displayName: CONTENT_NAME\n});\nvar AlertDialogContent = (0, import_core.createStyledHOC)(AlertDialogContentFrame, function AlertDialogContent2(props, forwardedRef) {\n var { scope, children, ...contentProps } = props;\n var dialogScope = getAlertDialogScope(scope);\n var contentRef = React.useRef(null);\n var composedRefs = (0, import_compose_refs.useComposedRefs)(forwardedRef, contentRef);\n var cancelRef = React.useRef(null);\n var destructiveRef = React.useRef(null);\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.DialogWarningProvider, {\n contentName: CONTENT_NAME,\n titleName: TITLE_NAME,\n docsSlug: \"alert-dialog\",\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertDialogContextProvider, {\n scope,\n cancelRef,\n destructiveRef,\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_dialog.DialogContent, {\n role: \"alertdialog\",\n \"aria-modal\": true,\n scope: dialogScope,\n ...contentProps,\n ref: composedRefs,\n onOpenAutoFocus: (0, import_helpers.composeEventHandlers)(contentProps.onOpenAutoFocus, function(event) {\n event.cancel();\n if (import_constants.isWeb) {\n var _cancelRef_current;\n (_cancelRef_current = cancelRef.current) === null || _cancelRef_current === void 0 ? void 0 : _cancelRef_current.focus({\n preventScroll: true\n });\n }\n }),\n onPointerDownOutside: function(event) {\n return event.cancel();\n },\n onInteractOutside: function(event) {\n return event.cancel();\n },\n children: [\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 /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core2.Slottable, {\n children\n }),\n process.env.NODE_ENV === \"development\" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DescriptionWarning, {\n contentRef\n })\n ]\n })\n })\n });\n});\nvar TITLE_NAME = \"AlertDialogTitle\";\nvar AlertDialogTitleFrame = (0, import_core2.styled)(import_core2.View, {\n displayName: TITLE_NAME\n});\n(0, import_alertDialogPart.markAlertDialogPart)(AlertDialogTitleFrame, \"title\");\nvar AlertDialogTitle = (0, import_core.createStyledHOC)(AlertDialogTitleFrame, function AlertDialogTitle2(props, forwardedRef) {\n var { scope, ...titleProps } = props;\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.DialogTitle, {\n scope: getAlertDialogScope(scope),\n ...titleProps,\n ref: forwardedRef\n });\n});\nvar DESCRIPTION_NAME = \"AlertDialogDescription\";\nvar AlertDialogDescriptionFrame = (0, import_core2.styled)(import_core2.View, {\n displayName: DESCRIPTION_NAME\n});\n(0, import_alertDialogPart.markAlertDialogPart)(AlertDialogDescriptionFrame, \"description\");\nvar AlertDialogDescription = (0, import_core.createStyledHOC)(AlertDialogDescriptionFrame, function AlertDialogDescription2(props, forwardedRef) {\n var { scope, ...descriptionProps } = props;\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.DialogDescription, {\n scope: getAlertDialogScope(scope),\n ...descriptionProps,\n ref: forwardedRef\n });\n});\nvar ACTION_NAME = \"AlertDialogAction\";\nvar AlertDialogActionFrame = (0, import_core2.styled)(import_core2.View, {\n displayName: ACTION_NAME\n});\n(0, import_alertDialogPart.markAlertDialogPart)(AlertDialogActionFrame, \"action\");\nvar AlertDialogAction = (0, import_core.createStyledHOC)(AlertDialogActionFrame, function AlertDialogAction2(props, forwardedRef) {\n var { scope, ...actionProps } = props;\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.DialogClose, {\n scope: getAlertDialogScope(scope),\n ...actionProps,\n ref: forwardedRef\n });\n});\nvar CANCEL_NAME = \"AlertDialogCancel\";\nvar AlertDialogCancelFrame = (0, import_core2.styled)(import_core2.View, {\n displayName: CANCEL_NAME\n});\n(0, import_alertDialogPart.markAlertDialogPart)(AlertDialogCancelFrame, \"cancel\");\nvar AlertDialogCancel = (0, import_core.createStyledHOC)(AlertDialogCancelFrame, function AlertDialogCancel2(props, forwardedRef) {\n var { scope, ...cancelProps } = props;\n var { cancelRef } = useAlertDialogContentContext(scope);\n var ref = (0, import_compose_refs.useComposedRefs)(forwardedRef, cancelRef);\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.DialogClose, {\n scope: getAlertDialogScope(scope),\n ...cancelProps,\n ref\n });\n});\nvar DESTRUCTIVE_NAME = \"AlertDialogDestructive\";\nvar AlertDialogDestructiveFrame = (0, import_core2.styled)(import_core2.View, {\n displayName: DESTRUCTIVE_NAME\n});\n(0, import_alertDialogPart.markAlertDialogPart)(AlertDialogDestructiveFrame, \"destructive\");\nvar AlertDialogDestructive = (0, import_core.createStyledHOC)(AlertDialogDestructiveFrame, function AlertDialogDestructive2(props, forwardedRef) {\n var { scope, ...destructiveProps } = props;\n var { destructiveRef } = useAlertDialogContentContext(scope);\n var ref = (0, import_compose_refs.useComposedRefs)(forwardedRef, destructiveRef);\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.DialogClose, {\n scope: getAlertDialogScope(scope),\n ...destructiveProps,\n ref\n });\n});\nvar DescriptionWarning = function(param) {\n var { contentRef } = param;\n if (process.env.NODE_ENV === \"development\") {\n React.useEffect(function() {\n var _contentRef_current;\n if (!import_constants.isWeb) return;\n var hasDescription = document.getElementById((_contentRef_current = contentRef.current) === null || _contentRef_current === void 0 ? void 0 : _contentRef_current.getAttribute(\"aria-describedby\"));\n if (!hasDescription) {\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 }, [\n contentRef\n ]);\n }\n return null;\n};\nvar AlertDialogInner = function(props) {\n var { scope, native, ...alertDialogProps } = props;\n var dialogScope = getAlertDialogScope(scope);\n var nativeAlert = (0, import_useNativeAlertDialog.useNativeAlertDialog)(props);\n if (nativeAlert) return nativeAlert;\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.Dialog, {\n scope: dialogScope,\n ...alertDialogProps,\n modal: true\n });\n};\nvar AlertDialog = (0, import_helpers.withStaticProperties)(AlertDialogInner, {\n Trigger: AlertDialogTrigger,\n Portal: AlertDialogPortal,\n Overlay: AlertDialogOverlay,\n Content: AlertDialogContent,\n Action: AlertDialogAction,\n Cancel: AlertDialogCancel,\n Destructive: AlertDialogDestructive,\n Title: AlertDialogTitle,\n Description: AlertDialogDescription\n});\nAlertDialog.displayName = ROOT_NAME;\n//# sourceMappingURL=AlertDialog.js.map\n"],"mappings":";;;AACA,IAAI,WAAW,OAAO;AACtB,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO;AAC1B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,WAAW,KAAK,YAAY,YAAY,SAAS,OAAO,OAAO,SAAS,aAAa,GAAG,CAAC,IAAI,CAAC,GAAG,YAKnG,cAAc,CAAC,OAAO,CAAC,IAAI,aAAa,UAAU,QAAQ,WAAW;CAAE,OAAO;CAAK,YAAY;AAAK,CAAC,IAAI,QACzG,GACF;AACA,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,sBAAsB,CAAC;AAC3B,SAAS,qBAAqB;CAC5B,mBAAmB;CACnB,yBAAyB;CACzB,yBAAyB;CACzB,0BAA0B;CAC1B,8BAA8B;CAC9B,8BAA8B;CAC9B,0BA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,YAAY,cAAc"}
|
|
1
|
+
{"version":3,"file":"AlertDialog.native.js","names":[],"sources":["jsx/AlertDialog.native.js"],"sourcesContent":["\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar AlertDialog_exports = {};\n__export(AlertDialog_exports, {\n AlertDialog: () => AlertDialog,\n AlertDialogAction: () => AlertDialogAction,\n AlertDialogCancel: () => AlertDialogCancel,\n AlertDialogContent: () => AlertDialogContent,\n AlertDialogDescription: () => AlertDialogDescription,\n AlertDialogDestructive: () => AlertDialogDestructive,\n AlertDialogOverlay: () => AlertDialogOverlay,\n AlertDialogPortal: () => AlertDialogPortal,\n AlertDialogTitle: () => AlertDialogTitle,\n AlertDialogTrigger: () => AlertDialogTrigger\n});\nmodule.exports = __toCommonJS(AlertDialog_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_core = require(\"@tamagui/core\");\nvar import_compose_refs = require(\"@tamagui/compose-refs\");\nvar import_constants = require(\"@tamagui/constants\");\nvar import_core2 = require(\"@tamagui/core\");\nvar import_dialog = require(\"@tamagui/dialog\");\nvar import_helpers = require(\"@tamagui/helpers\");\nvar React = __toESM(require(\"react\"), 1);\nvar import_alertDialogPart = require(\"./alertDialogPart\");\nvar import_useNativeAlertDialog = require(\"./useNativeAlertDialog\");\nvar getAlertDialogScope = function getAlertDialogScope2(scope) {\n return scope;\n};\nvar ROOT_NAME = \"AlertDialog\";\nvar TRIGGER_NAME = \"AlertDialogTrigger\";\nvar NativeAlertDialogTriggerFrame = (0, import_core2.styled)(import_core2.View, {\n displayName: TRIGGER_NAME\n});\n(0, import_alertDialogPart.markAlertDialogPart)(NativeAlertDialogTriggerFrame, \"trigger\");\nvar AlertDialogTrigger = (0, import_core.createStyledHOC)(NativeAlertDialogTriggerFrame, function AlertDialogTrigger2(props, forwardedRef) {\n if (props[\"__native\"]) {\n var { __native, onPress, __onPress, ...rest } = props;\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(NativeAlertDialogTriggerFrame, {\n ...rest,\n onPress: (0, import_helpers.composeEventHandlers)(onPress, __onPress)\n });\n }\n var { scope, ...triggerProps } = props;\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.DialogTrigger, {\n scope: getAlertDialogScope(scope),\n ...triggerProps,\n ref: forwardedRef\n });\n});\nvar AlertDialogPortal = function AlertDialogPortal2(props) {\n var { scope, ...portalProps } = props;\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.DialogPortal, {\n scope: getAlertDialogScope(scope),\n ...portalProps\n });\n};\nvar OVERLAY_NAME = \"AlertDialogOverlay\";\nvar AlertDialogOverlayFrame = (0, import_core2.styled)(import_dialog.DialogOverlayFrame, {\n displayName: OVERLAY_NAME\n});\nvar AlertDialogOverlay = (0, import_core.createStyledHOC)(AlertDialogOverlayFrame, function AlertDialogOverlay2(props, forwardedRef) {\n var { scope, ...overlayProps } = props;\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.DialogOverlay, {\n scope: getAlertDialogScope(scope),\n ...overlayProps,\n ref: forwardedRef\n });\n});\nvar CONTENT_NAME = \"AlertDialogContent\";\nvar { Provider: AlertDialogContextProvider, useStyledContext: useAlertDialogContentContext } = (0, import_core2.createStyledContext)({}, \"AlertDialogContext\");\nvar AlertDialogContentFrame = (0, import_core2.styled)(import_dialog.DialogContentFrame, {\n displayName: CONTENT_NAME\n});\nvar AlertDialogContent = (0, import_core.createStyledHOC)(AlertDialogContentFrame, function AlertDialogContent2(props, forwardedRef) {\n var { scope, children, ...contentProps } = props;\n var dialogScope = getAlertDialogScope(scope);\n var contentRef = React.useRef(null);\n var composedRefs = (0, import_compose_refs.useComposedRefs)(forwardedRef, contentRef);\n var cancelRef = React.useRef(null);\n var destructiveRef = React.useRef(null);\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.DialogWarningProvider, {\n contentName: CONTENT_NAME,\n titleName: TITLE_NAME,\n docsSlug: \"alert-dialog\",\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertDialogContextProvider, {\n scope,\n cancelRef,\n destructiveRef,\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_dialog.DialogContent, {\n role: \"alertdialog\",\n \"aria-modal\": true,\n scope: dialogScope,\n ...contentProps,\n ref: composedRefs,\n onOpenAutoFocus: (0, import_helpers.composeEventHandlers)(contentProps.onOpenAutoFocus, function(event) {\n event.cancel();\n if (import_constants.isWeb) {\n var _cancelRef_current;\n (_cancelRef_current = cancelRef.current) === null || _cancelRef_current === void 0 ? void 0 : _cancelRef_current.focus({\n preventScroll: true\n });\n }\n }),\n onPointerDownOutside: function onPointerDownOutside(event) {\n return event.cancel();\n },\n onInteractOutside: function onInteractOutside(event) {\n return event.cancel();\n },\n children: [\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 /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core2.Slottable, {\n children\n }),\n process.env.NODE_ENV === \"development\" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DescriptionWarning, {\n contentRef\n })\n ]\n })\n })\n });\n});\nvar TITLE_NAME = \"AlertDialogTitle\";\nvar AlertDialogTitleFrame = (0, import_core2.styled)(import_core2.View, {\n displayName: TITLE_NAME\n});\n(0, import_alertDialogPart.markAlertDialogPart)(AlertDialogTitleFrame, \"title\");\nvar AlertDialogTitle = (0, import_core.createStyledHOC)(AlertDialogTitleFrame, function AlertDialogTitle2(props, forwardedRef) {\n var { scope, ...titleProps } = props;\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.DialogTitle, {\n scope: getAlertDialogScope(scope),\n ...titleProps,\n ref: forwardedRef\n });\n});\nvar DESCRIPTION_NAME = \"AlertDialogDescription\";\nvar AlertDialogDescriptionFrame = (0, import_core2.styled)(import_core2.View, {\n displayName: DESCRIPTION_NAME\n});\n(0, import_alertDialogPart.markAlertDialogPart)(AlertDialogDescriptionFrame, \"description\");\nvar AlertDialogDescription = (0, import_core.createStyledHOC)(AlertDialogDescriptionFrame, function AlertDialogDescription2(props, forwardedRef) {\n var { scope, ...descriptionProps } = props;\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.DialogDescription, {\n scope: getAlertDialogScope(scope),\n ...descriptionProps,\n ref: forwardedRef\n });\n});\nvar ACTION_NAME = \"AlertDialogAction\";\nvar AlertDialogActionFrame = (0, import_core2.styled)(import_core2.View, {\n displayName: ACTION_NAME\n});\n(0, import_alertDialogPart.markAlertDialogPart)(AlertDialogActionFrame, \"action\");\nvar AlertDialogAction = (0, import_core.createStyledHOC)(AlertDialogActionFrame, function AlertDialogAction2(props, forwardedRef) {\n var { scope, ...actionProps } = props;\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.DialogClose, {\n scope: getAlertDialogScope(scope),\n ...actionProps,\n ref: forwardedRef\n });\n});\nvar CANCEL_NAME = \"AlertDialogCancel\";\nvar AlertDialogCancelFrame = (0, import_core2.styled)(import_core2.View, {\n displayName: CANCEL_NAME\n});\n(0, import_alertDialogPart.markAlertDialogPart)(AlertDialogCancelFrame, \"cancel\");\nvar AlertDialogCancel = (0, import_core.createStyledHOC)(AlertDialogCancelFrame, function AlertDialogCancel2(props, forwardedRef) {\n var { scope, ...cancelProps } = props;\n var { cancelRef } = useAlertDialogContentContext(scope);\n var ref = (0, import_compose_refs.useComposedRefs)(forwardedRef, cancelRef);\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.DialogClose, {\n scope: getAlertDialogScope(scope),\n ...cancelProps,\n ref\n });\n});\nvar DESTRUCTIVE_NAME = \"AlertDialogDestructive\";\nvar AlertDialogDestructiveFrame = (0, import_core2.styled)(import_core2.View, {\n displayName: DESTRUCTIVE_NAME\n});\n(0, import_alertDialogPart.markAlertDialogPart)(AlertDialogDestructiveFrame, \"destructive\");\nvar AlertDialogDestructive = (0, import_core.createStyledHOC)(AlertDialogDestructiveFrame, function AlertDialogDestructive2(props, forwardedRef) {\n var { scope, ...destructiveProps } = props;\n var { destructiveRef } = useAlertDialogContentContext(scope);\n var ref = (0, import_compose_refs.useComposedRefs)(forwardedRef, destructiveRef);\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.DialogClose, {\n scope: getAlertDialogScope(scope),\n ...destructiveProps,\n ref\n });\n});\nvar DescriptionWarning = function DescriptionWarning2(param) {\n var { contentRef } = param;\n if (process.env.NODE_ENV === \"development\") {\n React.useEffect(function() {\n var _contentRef_current;\n if (!import_constants.isWeb) return;\n var hasDescription = document.getElementById((_contentRef_current = contentRef.current) === null || _contentRef_current === void 0 ? void 0 : _contentRef_current.getAttribute(\"aria-describedby\"));\n if (!hasDescription) {\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 }, [\n contentRef\n ]);\n }\n return null;\n};\nvar AlertDialogInner = function AlertDialogInner2(props) {\n var { scope, native, ...alertDialogProps } = props;\n var dialogScope = getAlertDialogScope(scope);\n var nativeAlert = (0, import_useNativeAlertDialog.useNativeAlertDialog)(props);\n if (nativeAlert) return nativeAlert;\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.Dialog, {\n scope: dialogScope,\n ...alertDialogProps,\n modal: true\n });\n};\nvar AlertDialog = (0, import_helpers.withStaticProperties)(AlertDialogInner, {\n Trigger: AlertDialogTrigger,\n Portal: AlertDialogPortal,\n Overlay: AlertDialogOverlay,\n Content: AlertDialogContent,\n Action: AlertDialogAction,\n Cancel: AlertDialogCancel,\n Destructive: AlertDialogDestructive,\n Title: AlertDialogTitle,\n Description: AlertDialogDescription\n});\nAlertDialog.displayName = ROOT_NAME;\n//# sourceMappingURL=AlertDialog.js.map\n"],"mappings":";;;AACA,IAAI,WAAW,OAAO;AACtB,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO;AAC1B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAA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zB,IAAI;GACJ,IAAI,CAAC,iBAAiB,OAAO;GAC7B,IAAI,iBAAiB,SAAS,gBAAgB,sBAAsB,WAAW,aAAa,QAAQ,wBAAwB,KAAK,IAAI,KAAK,IAAI,oBAAoB,aAAa,kBAAkB,CAAC;GAClM,IAAI,CAAC,gBAAgB;IACnB,QAAQ,KAAK,KAAK,aAAa;;6CAEM,aAAa,oBAAoB,iBAAiB;;oKAEqE,aAAa;;mFAE9F;GAC7E;EACF,GAAG,CACD,UACF,CAAC;CACH;CACA,OAAO;AACT;AACA,IAAI,mBAAmB,SAAS,kBAAkB,OAAO;CACvD,IAAI,EAAE,OAAO,QAAQ,GAAG,qBAAqB;CAC7C,IAAI,cAAc,oBAAoB,KAAK;CAC3C,IAAI,eAAe,GAAG,4BAA4B,qBAAoB,CAAE,KAAK;CAC7E,IAAI,aAAa,OAAO;CACxB,OAAuB,iBAAC,GAAG,mBAAmB,IAAG,CAAE,cAAc,QAAQ;EACvE,OAAO;EACP,GAAG;EACH,OAAO;CACT,CAAC;AACH;AACA,IAAI,eAAe,GAAG,eAAe,qBAAoB,CAAE,kBAAkB;CAC3E,SAAS;CACT,QAAQ;CACR,SAAS;CACT,SAAS;CACT,QAAQ;CACR,QAAQ;CACR,aAAa;CACb,OAAO;CACP,aAAa;AACf,CAAC;AACD,YAAY,cAAc"}
|
|
@@ -27,6 +27,6 @@ __export(alertDialogPart_exports, {
|
|
|
27
27
|
});
|
|
28
28
|
module.exports = __toCommonJS(alertDialogPart_exports);
|
|
29
29
|
var ALERT_DIALOG_PART = /* @__PURE__ */ Symbol("AlertDialogPart");
|
|
30
|
-
var markAlertDialogPart = function(component, part) {
|
|
30
|
+
var markAlertDialogPart = function markAlertDialogPart2(component, part) {
|
|
31
31
|
Object.assign(component.staticConfig, { [ALERT_DIALOG_PART]: part });
|
|
32
32
|
};
|
|
@@ -27,7 +27,7 @@ __export(alertDialogPart_exports, {
|
|
|
27
27
|
});
|
|
28
28
|
module.exports = __toCommonJS(alertDialogPart_exports);
|
|
29
29
|
var ALERT_DIALOG_PART = /* @__PURE__ */ Symbol("AlertDialogPart");
|
|
30
|
-
var markAlertDialogPart = function(component, part) {
|
|
30
|
+
var markAlertDialogPart = function markAlertDialogPart2(component, part) {
|
|
31
31
|
Object.assign(component.staticConfig, { [ALERT_DIALOG_PART]: part });
|
|
32
32
|
};
|
|
33
33
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alertDialogPart.native.js","names":[],"sources":["jsx/alertDialogPart.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar alertDialogPart_exports = {};\n__export(alertDialogPart_exports, {\n ALERT_DIALOG_PART: () => ALERT_DIALOG_PART,\n markAlertDialogPart: () => markAlertDialogPart\n});\nmodule.exports = __toCommonJS(alertDialogPart_exports);\nvar ALERT_DIALOG_PART = /* @__PURE__ */ Symbol(\"AlertDialogPart\");\nvar markAlertDialogPart = function(component, part) {\n Object.assign(component.staticConfig, {\n [ALERT_DIALOG_PART]: part\n });\n};\n//# sourceMappingURL=alertDialogPart.js.map\n"],"mappings":";;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,0BAA0B,CAAC;AAC/B,SAAS,yBAAyB;CAChC,yBAAyB;CACzB,2BAA2B;AAC7B,CAAC;AACD,OAAO,UAAU,aAAa,uBAAuB;AACrD,IAAI,oBAAoC,uBAAO,iBAAiB;AAChE,IAAI,sBAAsB,SAAS,WAAW,MAAM;
|
|
1
|
+
{"version":3,"file":"alertDialogPart.native.js","names":[],"sources":["jsx/alertDialogPart.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar alertDialogPart_exports = {};\n__export(alertDialogPart_exports, {\n ALERT_DIALOG_PART: () => ALERT_DIALOG_PART,\n markAlertDialogPart: () => markAlertDialogPart\n});\nmodule.exports = __toCommonJS(alertDialogPart_exports);\nvar ALERT_DIALOG_PART = /* @__PURE__ */ Symbol(\"AlertDialogPart\");\nvar markAlertDialogPart = function markAlertDialogPart2(component, part) {\n Object.assign(component.staticConfig, {\n [ALERT_DIALOG_PART]: part\n });\n};\n//# sourceMappingURL=alertDialogPart.js.map\n"],"mappings":";;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,0BAA0B,CAAC;AAC/B,SAAS,yBAAyB;CAChC,yBAAyB;CACzB,2BAA2B;AAC7B,CAAC;AACD,OAAO,UAAU,aAAa,uBAAuB;AACrD,IAAI,oBAAoC,uBAAO,iBAAiB;AAChE,IAAI,sBAAsB,SAAS,qBAAqB,WAAW,MAAM;CACvE,OAAO,OAAO,UAAU,cAAc,GACnC,oBAAoB,KACvB,CAAC;AACH"}
|
|
@@ -35,7 +35,7 @@ var import_use_controllable_state = require("@tamagui/use-controllable-state");
|
|
|
35
35
|
var React = __toESM(require("react"), 1);
|
|
36
36
|
var import_react_native = require("react-native");
|
|
37
37
|
var import_alertDialogPart = require("./alertDialogPart.native.js");
|
|
38
|
-
var useNativeAlertDialog = function(props) {
|
|
38
|
+
var useNativeAlertDialog = function useNativeAlertDialog2(props) {
|
|
39
39
|
var { native } = props;
|
|
40
40
|
var [open, setOpen] = (0, import_use_controllable_state.useControllableState)({
|
|
41
41
|
prop: props.open,
|
|
@@ -68,7 +68,7 @@ var useNativeAlertDialog = function(props) {
|
|
|
68
68
|
case "cancel": {
|
|
69
69
|
var style = part === "action" ? "default" : part === "destructive" ? "destructive" : "cancel";
|
|
70
70
|
var text = getStringChildren(child);
|
|
71
|
-
var onPress = function() {
|
|
71
|
+
var onPress = function onPress2() {
|
|
72
72
|
var _childProps_onPress;
|
|
73
73
|
var childProps = child.props;
|
|
74
74
|
childProps === null || childProps === void 0 ? void 0 : (_childProps_onPress = childProps.onPress) === null || _childProps_onPress === void 0 ? void 0 : _childProps_onPress.call(childProps, { native: true });
|
|
@@ -93,7 +93,7 @@ var useNativeAlertDialog = function(props) {
|
|
|
93
93
|
}
|
|
94
94
|
}, [native, open]);
|
|
95
95
|
if (native) {
|
|
96
|
-
return /* @__PURE__ */ React.cloneElement(triggerElement, { __onPress: function() {
|
|
96
|
+
return /* @__PURE__ */ React.cloneElement(triggerElement, { __onPress: function __onPress() {
|
|
97
97
|
setOpen(true);
|
|
98
98
|
} });
|
|
99
99
|
}
|
|
@@ -35,7 +35,7 @@ var import_use_controllable_state = require("@tamagui/use-controllable-state");
|
|
|
35
35
|
var React = __toESM(require("react"), 1);
|
|
36
36
|
var import_react_native = require("react-native");
|
|
37
37
|
var import_alertDialogPart = require("./alertDialogPart.native.js");
|
|
38
|
-
var useNativeAlertDialog = function(props) {
|
|
38
|
+
var useNativeAlertDialog = function useNativeAlertDialog2(props) {
|
|
39
39
|
var { native } = props;
|
|
40
40
|
var [open, setOpen] = (0, import_use_controllable_state.useControllableState)({
|
|
41
41
|
prop: props.open,
|
|
@@ -68,7 +68,7 @@ var useNativeAlertDialog = function(props) {
|
|
|
68
68
|
case "cancel": {
|
|
69
69
|
var style = part === "action" ? "default" : part === "destructive" ? "destructive" : "cancel";
|
|
70
70
|
var text = getStringChildren(child);
|
|
71
|
-
var onPress = function() {
|
|
71
|
+
var onPress = function onPress2() {
|
|
72
72
|
var _childProps_onPress;
|
|
73
73
|
var childProps = child.props;
|
|
74
74
|
childProps === null || childProps === void 0 ? void 0 : (_childProps_onPress = childProps.onPress) === null || _childProps_onPress === void 0 ? void 0 : _childProps_onPress.call(childProps, { native: true });
|
|
@@ -93,7 +93,7 @@ var useNativeAlertDialog = function(props) {
|
|
|
93
93
|
}
|
|
94
94
|
}, [native, open]);
|
|
95
95
|
if (native) {
|
|
96
|
-
return /* @__PURE__ */ React.cloneElement(triggerElement, { __onPress: function() {
|
|
96
|
+
return /* @__PURE__ */ React.cloneElement(triggerElement, { __onPress: function __onPress() {
|
|
97
97
|
setOpen(true);
|
|
98
98
|
} });
|
|
99
99
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useNativeAlertDialog.native.js","names":[],"sources":["jsx/useNativeAlertDialog.native.js"],"sourcesContent":["\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar useNativeAlertDialog_native_exports = {};\n__export(useNativeAlertDialog_native_exports, {\n useNativeAlertDialog: () => useNativeAlertDialog\n});\nmodule.exports = __toCommonJS(useNativeAlertDialog_native_exports);\nvar import_constants = require(\"@tamagui/constants\");\nvar import_core = require(\"@tamagui/core\");\nvar import_use_controllable_state = require(\"@tamagui/use-controllable-state\");\nvar React = __toESM(require(\"react\"), 1);\nvar import_react_native = require(\"react-native\");\nvar import_alertDialogPart = require(\"./alertDialogPart\");\nvar useNativeAlertDialog = function(props) {\n var { native } = props;\n var [open, setOpen] = (0, import_use_controllable_state.useControllableState)({\n prop: props.open,\n defaultProp: props.defaultOpen || false,\n onChange: props.onOpenChange,\n transition: true\n });\n var triggerElement = null;\n var title = \"\";\n var description = \"\";\n var buttons = [];\n forEachChildDeep(React.Children.toArray(props.children), function(child) {\n if (!/* @__PURE__ */ React.isValidElement(child)) return false;\n var part = (0, import_core.isTamaguiElement)(child) ? child.type.staticConfig[import_alertDialogPart.ALERT_DIALOG_PART] : void 0;\n switch (part) {\n case \"trigger\": {\n triggerElement = /* @__PURE__ */ React.cloneElement(child, {\n __native: true\n });\n return false;\n }\n case \"title\": {\n title = getStringChildren(child);\n return false;\n }\n case \"description\": {\n description = getStringChildren(child);\n return false;\n }\n case \"action\":\n case \"destructive\":\n case \"cancel\": {\n var style = part === \"action\" ? \"default\" : part === \"destructive\" ? \"destructive\" : \"cancel\";\n var text = getStringChildren(child);\n var onPress = function() {\n var _childProps_onPress;\n var childProps = child.props;\n childProps === null || childProps === void 0 ? void 0 : (_childProps_onPress = childProps.onPress) === null || _childProps_onPress === void 0 ? void 0 : _childProps_onPress.call(childProps, {\n native: true\n });\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 (0, import_constants.useIsomorphicLayoutEffect)(function() {\n if (!open || !native) return;\n if (title || description) {\n import_react_native.Alert.alert(title, description, buttons);\n }\n }, [\n native,\n open\n ]);\n if (native) {\n return /* @__PURE__ */ React.cloneElement(triggerElement, {\n __onPress: function() {\n setOpen(true);\n }\n });\n }\n return null;\n};\nfunction forEachChildDeep(children, onChild) {\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = children[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var child = _step.value;\n if (!/* @__PURE__ */ React.isValidElement(child)) continue;\n if (!onChild(child)) continue;\n var childProps = child.props;\n if (childProps.children) {\n forEachChildDeep(React.Children.toArray(childProps.children), onChild);\n }\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n}\nfunction getStringChildren(child) {\n var string = \"\";\n forEachChildDeep(React.Children.toArray(child), function(child2) {\n if (typeof child2.props.children === \"string\") {\n string = child2.props.children;\n return false;\n }\n return true;\n });\n return string;\n}\n//# sourceMappingURL=useNativeAlertDialog.native.js.map\n"],"mappings":";;;AACA,IAAI,WAAW,OAAO;AACtB,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,e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eAlertDialog.native.js"],"sourcesContent":["\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar useNativeAlertDialog_native_exports = {};\n__export(useNativeAlertDialog_native_exports, {\n useNativeAlertDialog: () => useNativeAlertDialog\n});\nmodule.exports = __toCommonJS(useNativeAlertDialog_native_exports);\nvar import_constants = require(\"@tamagui/constants\");\nvar import_core = require(\"@tamagui/core\");\nvar import_use_controllable_state = require(\"@tamagui/use-controllable-state\");\nvar React = __toESM(require(\"react\"), 1);\nvar import_react_native = require(\"react-native\");\nvar import_alertDialogPart = require(\"./alertDialogPart\");\nvar useNativeAlertDialog = function useNativeAlertDialog2(props) {\n var { native } = props;\n var [open, setOpen] = (0, import_use_controllable_state.useControllableState)({\n prop: props.open,\n defaultProp: props.defaultOpen || false,\n onChange: props.onOpenChange,\n transition: true\n });\n var triggerElement = null;\n var title = \"\";\n var description = \"\";\n var buttons = [];\n forEachChildDeep(React.Children.toArray(props.children), function(child) {\n if (!/* @__PURE__ */ React.isValidElement(child)) return false;\n var part = (0, import_core.isTamaguiElement)(child) ? child.type.staticConfig[import_alertDialogPart.ALERT_DIALOG_PART] : void 0;\n switch (part) {\n case \"trigger\": {\n triggerElement = /* @__PURE__ */ React.cloneElement(child, {\n __native: true\n });\n return false;\n }\n case \"title\": {\n title = getStringChildren(child);\n return false;\n }\n case \"description\": {\n description = getStringChildren(child);\n return false;\n }\n case \"action\":\n case \"destructive\":\n case \"cancel\": {\n var style = part === \"action\" ? \"default\" : part === \"destructive\" ? \"destructive\" : \"cancel\";\n var text = getStringChildren(child);\n var onPress = function onPress2() {\n var _childProps_onPress;\n var childProps = child.props;\n childProps === null || childProps === void 0 ? void 0 : (_childProps_onPress = childProps.onPress) === null || _childProps_onPress === void 0 ? void 0 : _childProps_onPress.call(childProps, {\n native: true\n });\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 (0, import_constants.useIsomorphicLayoutEffect)(function() {\n if (!open || !native) return;\n if (title || description) {\n import_react_native.Alert.alert(title, description, buttons);\n }\n }, [\n native,\n open\n ]);\n if (native) {\n return /* @__PURE__ */ React.cloneElement(triggerElement, {\n __onPress: function __onPress() {\n setOpen(true);\n }\n });\n }\n return null;\n};\nfunction forEachChildDeep(children, onChild) {\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = children[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var child = _step.value;\n if (!/* @__PURE__ */ React.isValidElement(child)) continue;\n if (!onChild(child)) continue;\n var childProps = child.props;\n if (childProps.children) {\n forEachChildDeep(React.Children.toArray(childProps.children), onChild);\n }\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n}\nfunction getStringChildren(child) {\n var string = \"\";\n forEachChildDeep(React.Children.toArray(child), function(child2) {\n if (typeof child2.props.children === \"string\") {\n string = child2.props.children;\n return false;\n }\n return true;\n });\n return string;\n}\n//# sourceMappingURL=useNativeAlertDialog.native.js.map\n"],"mappings":";;;AACA,IAAI,WAAW,OAAO;AACtB,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO;AAC1B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,WAAW,KAAK,YAAY,YAAY,SAAS,OAAO,OAAO,SAAS,aAAa,GAAG,CAAC,IAAI,CAAC,GAAG,YAKnG,cAAc,CAAC,OAAO,CAAC,IAAI,aAAa,UAAU,QAAQ,WAAW;CAAE,OAAO;CAAK,YAAY;AAAK,CAAC,IAAI,QACzG,GACF;AACA,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,sCAAsC,CAA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;IACrB,MAAM;GACR;EACF;CACF;AACF;AACA,SAAS,kBAAkB,OAAO;CAChC,IAAI,SAAS;CACb,iBAAiB,MAAM,SAAS,QAAQ,KAAK,GAAG,SAAS,QAAQ;EAC/D,IAAI,OAAO,OAAO,MAAM,aAAa,UAAU;GAC7C,SAAS,OAAO,MAAM;GACtB,OAAO;EACT;EACA,OAAO;CACT,CAAC;CACD,OAAO;AACT"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/alert-dialog",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.8",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"source": "src/index.ts",
|
|
6
6
|
"files": [
|
|
@@ -35,24 +35,24 @@
|
|
|
35
35
|
"clean:build": "tamagui-build clean:build"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@tamagui/animate-presence": "3.0.
|
|
39
|
-
"@tamagui/compose-refs": "3.0.
|
|
40
|
-
"@tamagui/constants": "3.0.
|
|
41
|
-
"@tamagui/core": "3.0.
|
|
42
|
-
"@tamagui/create-context": "3.0.
|
|
43
|
-
"@tamagui/dialog": "3.0.
|
|
44
|
-
"@tamagui/dismissable": "3.0.
|
|
45
|
-
"@tamagui/focus-scope": "3.0.
|
|
46
|
-
"@tamagui/helpers": "3.0.
|
|
47
|
-
"@tamagui/polyfill-dev": "3.0.
|
|
48
|
-
"@tamagui/portal": "3.0.
|
|
49
|
-
"@tamagui/remove-scroll": "3.0.
|
|
50
|
-
"@tamagui/stacks": "3.0.
|
|
51
|
-
"@tamagui/text": "3.0.
|
|
52
|
-
"@tamagui/use-controllable-state": "3.0.
|
|
38
|
+
"@tamagui/animate-presence": "3.0.8",
|
|
39
|
+
"@tamagui/compose-refs": "3.0.8",
|
|
40
|
+
"@tamagui/constants": "3.0.8",
|
|
41
|
+
"@tamagui/core": "3.0.8",
|
|
42
|
+
"@tamagui/create-context": "3.0.8",
|
|
43
|
+
"@tamagui/dialog": "3.0.8",
|
|
44
|
+
"@tamagui/dismissable": "3.0.8",
|
|
45
|
+
"@tamagui/focus-scope": "3.0.8",
|
|
46
|
+
"@tamagui/helpers": "3.0.8",
|
|
47
|
+
"@tamagui/polyfill-dev": "3.0.8",
|
|
48
|
+
"@tamagui/portal": "3.0.8",
|
|
49
|
+
"@tamagui/remove-scroll": "3.0.8",
|
|
50
|
+
"@tamagui/stacks": "3.0.8",
|
|
51
|
+
"@tamagui/text": "3.0.8",
|
|
52
|
+
"@tamagui/use-controllable-state": "3.0.8"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
|
-
"@tamagui/build": "3.0.
|
|
55
|
+
"@tamagui/build": "3.0.8",
|
|
56
56
|
"react": "19.2.3",
|
|
57
57
|
"react-native": "0.87.1"
|
|
58
58
|
},
|
|
@@ -67,5 +67,5 @@
|
|
|
67
67
|
"url": "git+https://github.com/tamagui/tamagui.git",
|
|
68
68
|
"directory": "code/ui/alert-dialog"
|
|
69
69
|
},
|
|
70
|
-
"releaseSourceCommit": "
|
|
70
|
+
"releaseSourceCommit": "b723356193510591d9ad15877b8937e8e6a31910"
|
|
71
71
|
}
|