@tamagui/alert-dialog 2.7.7 → 3.0.0-beta.1091.1

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.
Files changed (69) hide show
  1. package/dist/cjs/AlertDialog.cjs +178 -234
  2. package/dist/cjs/AlertDialog.native.cjs +234 -0
  3. package/dist/cjs/AlertDialog.native.js +182 -324
  4. package/dist/cjs/AlertDialog.native.js.map +1 -1
  5. package/dist/cjs/alertDialogPart.cjs +30 -0
  6. package/dist/cjs/alertDialogPart.native.cjs +32 -0
  7. package/dist/cjs/alertDialogPart.native.js +34 -0
  8. package/dist/cjs/alertDialogPart.native.js.map +1 -0
  9. package/dist/cjs/index.cjs +9 -11
  10. package/dist/cjs/index.native.cjs +20 -0
  11. package/dist/cjs/index.native.js +9 -10
  12. package/dist/cjs/index.native.js.map +1 -1
  13. package/dist/cjs/useNativeAlertDialog.cjs +24 -0
  14. package/dist/cjs/useNativeAlertDialog.native.cjs +139 -0
  15. package/dist/cjs/useNativeAlertDialog.native.js +141 -0
  16. package/dist/cjs/useNativeAlertDialog.native.js.map +1 -0
  17. package/dist/esm/AlertDialog.mjs +153 -187
  18. package/dist/esm/AlertDialog.mjs.map +1 -1
  19. package/dist/esm/AlertDialog.native.js +158 -292
  20. package/dist/esm/AlertDialog.native.js.map +1 -1
  21. package/dist/esm/alertDialogPart.mjs +7 -0
  22. package/dist/esm/alertDialogPart.mjs.map +1 -0
  23. package/dist/esm/alertDialogPart.native.js +7 -0
  24. package/dist/esm/alertDialogPart.native.js.map +1 -0
  25. package/dist/esm/index.js +1 -2
  26. package/dist/esm/index.mjs +1 -2
  27. package/dist/esm/index.native.js +1 -2
  28. package/dist/esm/useNativeAlertDialog.mjs +4 -0
  29. package/dist/esm/useNativeAlertDialog.mjs.map +1 -0
  30. package/dist/esm/useNativeAlertDialog.native.js +112 -0
  31. package/dist/esm/useNativeAlertDialog.native.js.map +1 -0
  32. package/dist/jsx/AlertDialog.mjs +153 -187
  33. package/dist/jsx/AlertDialog.mjs.map +1 -1
  34. package/dist/jsx/AlertDialog.native.cjs +234 -0
  35. package/dist/jsx/AlertDialog.native.js +182 -324
  36. package/dist/jsx/AlertDialog.native.js.map +1 -1
  37. package/dist/jsx/alertDialogPart.mjs +7 -0
  38. package/dist/jsx/alertDialogPart.mjs.map +1 -0
  39. package/dist/jsx/alertDialogPart.native.cjs +32 -0
  40. package/dist/jsx/alertDialogPart.native.js +34 -0
  41. package/dist/jsx/alertDialogPart.native.js.map +1 -0
  42. package/dist/jsx/index.js +1 -2
  43. package/dist/jsx/index.mjs +1 -2
  44. package/dist/jsx/index.native.cjs +20 -0
  45. package/dist/jsx/index.native.js +9 -10
  46. package/dist/jsx/index.native.js.map +1 -1
  47. package/dist/jsx/useNativeAlertDialog.mjs +4 -0
  48. package/dist/jsx/useNativeAlertDialog.mjs.map +1 -0
  49. package/dist/jsx/useNativeAlertDialog.native.cjs +139 -0
  50. package/dist/jsx/useNativeAlertDialog.native.js +141 -0
  51. package/dist/jsx/useNativeAlertDialog.native.js.map +1 -0
  52. package/package.json +22 -20
  53. package/src/AlertDialog.tsx +80 -181
  54. package/src/alertDialogPart.ts +26 -0
  55. package/src/useNativeAlertDialog.native.tsx +129 -0
  56. package/src/useNativeAlertDialog.ts +11 -0
  57. package/types/AlertDialog.d.ts +28 -62
  58. package/types/AlertDialog.d.ts.map +1 -1
  59. package/types/alertDialogPart.d.ts +15 -0
  60. package/types/alertDialogPart.d.ts.map +1 -0
  61. package/types/useNativeAlertDialog.d.ts +11 -0
  62. package/types/useNativeAlertDialog.d.ts.map +1 -0
  63. package/types/useNativeAlertDialog.native.d.ts +11 -0
  64. package/types/useNativeAlertDialog.native.d.ts.map +1 -0
  65. package/dist/esm/index.js.map +0 -1
  66. package/dist/esm/index.mjs.map +0 -1
  67. package/dist/esm/index.native.js.map +0 -1
  68. package/dist/jsx/index.js.map +0 -1
  69. package/dist/jsx/index.mjs.map +0 -1
@@ -0,0 +1,112 @@
1
+ import { useIsomorphicLayoutEffect } from "@tamagui/constants";
2
+ import { isTamaguiElement } from "@tamagui/core";
3
+ import { useControllableState } from "@tamagui/use-controllable-state";
4
+ import * as React from "react";
5
+ import { Alert } from "react-native";
6
+ import { ALERT_DIALOG_PART } from "./alertDialogPart.native.js";
7
+
8
+ var useNativeAlertDialog = function(props) {
9
+ var { native } = props;
10
+ var [open, setOpen] = useControllableState({
11
+ prop: props.open,
12
+ defaultProp: props.defaultOpen || false,
13
+ onChange: props.onOpenChange,
14
+ transition: true
15
+ });
16
+ var triggerElement = null;
17
+ var title = "";
18
+ var description = "";
19
+ var buttons = [];
20
+ forEachChildDeep(React.Children.toArray(props.children), function(child) {
21
+ if (!/* @__PURE__ */ React.isValidElement(child)) return false;
22
+ var part = isTamaguiElement(child) ? child.type.staticConfig[ALERT_DIALOG_PART] : void 0;
23
+ switch (part) {
24
+ case "trigger": {
25
+ triggerElement = /* @__PURE__ */ React.cloneElement(child, { __native: true });
26
+ return false;
27
+ }
28
+ case "title": {
29
+ title = getStringChildren(child);
30
+ return false;
31
+ }
32
+ case "description": {
33
+ description = getStringChildren(child);
34
+ return false;
35
+ }
36
+ case "action":
37
+ case "destructive":
38
+ case "cancel": {
39
+ var style = part === "action" ? "default" : part === "destructive" ? "destructive" : "cancel";
40
+ var text = getStringChildren(child);
41
+ var onPress = function() {
42
+ var _childProps_onPress;
43
+ var childProps = child.props;
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 });
45
+ setOpen(false);
46
+ };
47
+ buttons.push({
48
+ style,
49
+ text,
50
+ onPress
51
+ });
52
+ return false;
53
+ }
54
+ default: {
55
+ return true;
56
+ }
57
+ }
58
+ });
59
+ useIsomorphicLayoutEffect(function() {
60
+ if (!open || !native) return;
61
+ if (title || description) {
62
+ Alert.alert(title, description, buttons);
63
+ }
64
+ }, [native, open]);
65
+ if (native) {
66
+ return /* @__PURE__ */ React.cloneElement(triggerElement, { __onPress: function() {
67
+ setOpen(true);
68
+ } });
69
+ }
70
+ return null;
71
+ };
72
+ function forEachChildDeep(children, onChild) {
73
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
74
+ try {
75
+ for (var _iterator = children[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
76
+ var child = _step.value;
77
+ if (!/* @__PURE__ */ React.isValidElement(child)) continue;
78
+ if (!onChild(child)) continue;
79
+ var childProps = child.props;
80
+ if (childProps.children) {
81
+ forEachChildDeep(React.Children.toArray(childProps.children), onChild);
82
+ }
83
+ }
84
+ } catch (err) {
85
+ _didIteratorError = true;
86
+ _iteratorError = err;
87
+ } finally {
88
+ try {
89
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
90
+ _iterator.return();
91
+ }
92
+ } finally {
93
+ if (_didIteratorError) {
94
+ throw _iteratorError;
95
+ }
96
+ }
97
+ }
98
+ }
99
+ function getStringChildren(child) {
100
+ var string = "";
101
+ forEachChildDeep(React.Children.toArray(child), function(child2) {
102
+ if (typeof child2.props.children === "string") {
103
+ string = child2.props.children;
104
+ return false;
105
+ }
106
+ return true;
107
+ });
108
+ return string;
109
+ }
110
+
111
+ export { useNativeAlertDialog };
112
+ //# sourceMappingURL=useNativeAlertDialog.native.js.map
@@ -0,0 +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;CACzC,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,WAAW;KACvB,IAAI;KACJ,IAAI,aAAa,MAAM;KACvB,eAAe,QAAQ,eAAe,KAAK,IAAI,KAAK,KAAK,sBAAsB,WAAW,aAAa,QAAQ,wBAA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C/D,IAAI,OAAO,OAAO,MAAM,aAAa,UAAU;GAC7C,SAAS,OAAO,MAAM;GACtB,OAAO;EACT;EACA,OAAO;CACT,CAAC;CACD,OAAO;AACT"}
@@ -1,220 +1,186 @@
1
+ import { Slottable, View, createRefComponent, createStyledContext, createStyledHOC, styled } from "@tamagui/core";
1
2
  import { useComposedRefs } from "@tamagui/compose-refs";
2
3
  import { isWeb } from "@tamagui/constants";
3
- import { Slottable, View, createStyledContext, styled } from "@tamagui/core";
4
4
  import { Dialog, DialogClose, DialogContent, DialogDescription, DialogOverlay, DialogOverlayFrame, DialogPortal, DialogTitle, DialogTrigger, DialogWarningProvider } from "@tamagui/dialog";
5
5
  import { composeEventHandlers, withStaticProperties } from "@tamagui/helpers";
6
6
  import * as React from "react";
7
+ import { markAlertDialogPart } from "./alertDialogPart.mjs";
8
+ import { useNativeAlertDialog } from "./useNativeAlertDialog.mjs";
7
9
  import { jsx, jsxs } from "react/jsx-runtime";
8
- const getAlertDialogScope = scope => scope;
10
+
11
+ const getAlertDialogScope = (scope) => scope;
9
12
  const ROOT_NAME = "AlertDialog";
10
- const NativeAlertDialogTriggerFrame = styled(View, {
11
- name: "AlertDialogTrigger"
12
- });
13
- const AlertDialogTrigger = NativeAlertDialogTriggerFrame.styleable(function AlertDialogTrigger2(props, forwardedRef) {
14
- if (props["__native"]) {
15
- const {
16
- __native,
17
- onPress,
18
- __onPress,
19
- ...rest
20
- } = props;
21
- return /* @__PURE__ */jsx(NativeAlertDialogTriggerFrame, {
22
- ...rest,
23
- onPress: composeEventHandlers(onPress, __onPress)
24
- });
25
- }
26
- const {
27
- scope,
28
- ...triggerProps
29
- } = props;
30
- return /* @__PURE__ */jsx(DialogTrigger, {
31
- scope: getAlertDialogScope(scope),
32
- ...triggerProps,
33
- ref: forwardedRef
34
- });
13
+ const TRIGGER_NAME = "AlertDialogTrigger";
14
+ const NativeAlertDialogTriggerFrame = styled(View, { displayName: TRIGGER_NAME });
15
+ markAlertDialogPart(NativeAlertDialogTriggerFrame, "trigger");
16
+ const AlertDialogTrigger = createStyledHOC(NativeAlertDialogTriggerFrame, function AlertDialogTrigger2(props, forwardedRef) {
17
+ if (props["__native"]) {
18
+ const { __native, onPress, __onPress, ...rest } = props;
19
+ return /* @__PURE__ */ jsx(NativeAlertDialogTriggerFrame, {
20
+ ...rest,
21
+ onPress: composeEventHandlers(onPress, __onPress)
22
+ });
23
+ }
24
+ const { scope, ...triggerProps } = props;
25
+ return /* @__PURE__ */ jsx(DialogTrigger, {
26
+ scope: getAlertDialogScope(scope),
27
+ ...triggerProps,
28
+ ref: forwardedRef
29
+ });
35
30
  });
36
31
  const AlertDialogPortal = function AlertDialogPortal2(props) {
37
- const {
38
- scope,
39
- ...portalProps
40
- } = props;
41
- return /* @__PURE__ */jsx(DialogPortal, {
42
- scope: getAlertDialogScope(scope),
43
- ...portalProps
44
- });
32
+ const { scope, ...portalProps } = props;
33
+ return /* @__PURE__ */ jsx(DialogPortal, {
34
+ scope: getAlertDialogScope(scope),
35
+ ...portalProps
36
+ });
45
37
  };
46
- const AlertDialogOverlay = styled(DialogOverlayFrame, {
47
- name: "AlertDialogOverlay"
48
- }).styleable(function AlertDialogOverlay2(props, forwardedRef) {
49
- const {
50
- scope,
51
- ...overlayProps
52
- } = props;
53
- return /* @__PURE__ */jsx(DialogOverlay, {
54
- scope: getAlertDialogScope(scope),
55
- ...overlayProps,
56
- ref: forwardedRef
57
- });
38
+ const OVERLAY_NAME = "AlertDialogOverlay";
39
+ const AlertDialogOverlayFrame = styled(DialogOverlayFrame, { displayName: OVERLAY_NAME });
40
+ const AlertDialogOverlay = createStyledHOC(AlertDialogOverlayFrame, function AlertDialogOverlay2(props, forwardedRef) {
41
+ const { scope, ...overlayProps } = props;
42
+ return /* @__PURE__ */ jsx(DialogOverlay, {
43
+ scope: getAlertDialogScope(scope),
44
+ ...overlayProps,
45
+ ref: forwardedRef
46
+ });
58
47
  });
59
48
  const CONTENT_NAME = "AlertDialogContent";
60
- const {
61
- Provider: AlertDialogContextProvider,
62
- useStyledContext: useAlertDialogContentContext
63
- } = createStyledContext({}, "AlertDialogContext");
64
- const AlertDialogContent = React.forwardRef(function AlertDialogContent2(props, forwardedRef) {
65
- const {
66
- scope,
67
- children,
68
- ...contentProps
69
- } = props;
70
- const dialogScope = getAlertDialogScope(scope);
71
- const contentRef = React.useRef(null);
72
- const composedRefs = useComposedRefs(forwardedRef, contentRef);
73
- const cancelRef = React.useRef(null);
74
- return /* @__PURE__ */jsx(DialogWarningProvider, {
75
- contentName: CONTENT_NAME,
76
- titleName: TITLE_NAME,
77
- docsSlug: "alert-dialog",
78
- children: /* @__PURE__ */jsx(AlertDialogContextProvider, {
79
- scope,
80
- cancelRef,
81
- destructiveRef: React.useRef(null),
82
- children: /* @__PURE__ */jsxs(DialogContent, {
83
- role: "alertdialog",
84
- "aria-modal": true,
85
- scope: dialogScope,
86
- ...contentProps,
87
- ref: composedRefs,
88
- onOpenAutoFocus: composeEventHandlers(contentProps.onOpenAutoFocus, event => {
89
- event.preventDefault();
90
- if (isWeb) cancelRef.current?.focus({
91
- preventScroll: true
92
- });
93
- }),
94
- onPointerDownOutside: event => event.preventDefault(),
95
- onInteractOutside: event => event.preventDefault(),
96
- children: [/* @__PURE__ */jsx(Slottable, {
97
- children
98
- }), process.env.NODE_ENV === "development" && /* @__PURE__ */jsx(DescriptionWarning, {
99
- contentRef
100
- })]
101
- })
102
- })
103
- });
49
+ const { Provider: AlertDialogContextProvider, useStyledContext: useAlertDialogContentContext } = createStyledContext({}, "AlertDialogContext");
50
+ const AlertDialogContent = createRefComponent(function AlertDialogContent2(props, forwardedRef) {
51
+ const { scope, children, ...contentProps } = props;
52
+ const dialogScope = getAlertDialogScope(scope);
53
+ const contentRef = React.useRef(null);
54
+ const composedRefs = useComposedRefs(forwardedRef, contentRef);
55
+ const cancelRef = React.useRef(null);
56
+ const destructiveRef = React.useRef(null);
57
+ return /* @__PURE__ */ jsx(DialogWarningProvider, {
58
+ contentName: CONTENT_NAME,
59
+ titleName: TITLE_NAME,
60
+ docsSlug: "alert-dialog",
61
+ children: /* @__PURE__ */ jsx(AlertDialogContextProvider, {
62
+ scope,
63
+ cancelRef,
64
+ destructiveRef,
65
+ children: /* @__PURE__ */ jsxs(DialogContent, {
66
+ role: "alertdialog",
67
+ "aria-modal": true,
68
+ scope: dialogScope,
69
+ ...contentProps,
70
+ ref: composedRefs,
71
+ onOpenAutoFocus: composeEventHandlers(contentProps.onOpenAutoFocus, (event) => {
72
+ event.cancel();
73
+ if (isWeb) {
74
+ cancelRef.current?.focus({ preventScroll: true });
75
+ }
76
+ }),
77
+ onPointerDownOutside: (event) => event.cancel(),
78
+ onInteractOutside: (event) => event.cancel(),
79
+ children: [/* @__PURE__ */ jsx(Slottable, { children }), process.env.NODE_ENV === "development" && /* @__PURE__ */ jsx(DescriptionWarning, { contentRef })]
80
+ })
81
+ })
82
+ });
104
83
  });
105
84
  const TITLE_NAME = "AlertDialogTitle";
106
- const AlertDialogTitle = styled(View, {
107
- name: TITLE_NAME
108
- }).styleable(function AlertDialogTitle2(props, forwardedRef) {
109
- const {
110
- scope,
111
- ...titleProps
112
- } = props;
113
- return /* @__PURE__ */jsx(DialogTitle, {
114
- scope: getAlertDialogScope(scope),
115
- ...titleProps,
116
- ref: forwardedRef
117
- });
85
+ const AlertDialogTitleFrame = styled(View, { displayName: TITLE_NAME });
86
+ markAlertDialogPart(AlertDialogTitleFrame, "title");
87
+ const AlertDialogTitle = createStyledHOC(AlertDialogTitleFrame, function AlertDialogTitle2(props, forwardedRef) {
88
+ const { scope, ...titleProps } = props;
89
+ return /* @__PURE__ */ jsx(DialogTitle, {
90
+ scope: getAlertDialogScope(scope),
91
+ ...titleProps,
92
+ ref: forwardedRef
93
+ });
118
94
  });
119
95
  const DESCRIPTION_NAME = "AlertDialogDescription";
120
- const AlertDialogDescription = styled(View, {
121
- name: DESCRIPTION_NAME
122
- }).styleable(function AlertDialogDescription2(props, forwardedRef) {
123
- const {
124
- scope,
125
- ...descriptionProps
126
- } = props;
127
- return /* @__PURE__ */jsx(DialogDescription, {
128
- scope: getAlertDialogScope(scope),
129
- ...descriptionProps,
130
- ref: forwardedRef
131
- });
96
+ const AlertDialogDescriptionFrame = styled(View, { displayName: DESCRIPTION_NAME });
97
+ markAlertDialogPart(AlertDialogDescriptionFrame, "description");
98
+ const AlertDialogDescription = createStyledHOC(AlertDialogDescriptionFrame, function AlertDialogDescription2(props, forwardedRef) {
99
+ const { scope, ...descriptionProps } = props;
100
+ return /* @__PURE__ */ jsx(DialogDescription, {
101
+ scope: getAlertDialogScope(scope),
102
+ ...descriptionProps,
103
+ ref: forwardedRef
104
+ });
132
105
  });
133
- const AlertDialogAction = styled(View, {
134
- name: "AlertDialogAction"
135
- }).styleable(function AlertDialogAction2(props, forwardedRef) {
136
- const {
137
- scope,
138
- ...actionProps
139
- } = props;
140
- return /* @__PURE__ */jsx(DialogClose, {
141
- scope: getAlertDialogScope(scope),
142
- ...actionProps,
143
- ref: forwardedRef
144
- });
106
+ const ACTION_NAME = "AlertDialogAction";
107
+ const AlertDialogActionFrame = styled(View, { displayName: ACTION_NAME });
108
+ markAlertDialogPart(AlertDialogActionFrame, "action");
109
+ const AlertDialogAction = createStyledHOC(AlertDialogActionFrame, function AlertDialogAction2(props, forwardedRef) {
110
+ const { scope, ...actionProps } = props;
111
+ return /* @__PURE__ */ jsx(DialogClose, {
112
+ scope: getAlertDialogScope(scope),
113
+ ...actionProps,
114
+ ref: forwardedRef
115
+ });
145
116
  });
146
- const AlertDialogCancel = styled(View, {
147
- name: "AlertDialogCancel"
148
- }).styleable(function AlertDialogCancel2(props, forwardedRef) {
149
- const {
150
- scope,
151
- ...cancelProps
152
- } = props;
153
- const {
154
- cancelRef
155
- } = useAlertDialogContentContext(scope);
156
- const ref = useComposedRefs(forwardedRef, cancelRef);
157
- return /* @__PURE__ */jsx(DialogClose, {
158
- scope: getAlertDialogScope(scope),
159
- ...cancelProps,
160
- ref
161
- });
117
+ const CANCEL_NAME = "AlertDialogCancel";
118
+ const AlertDialogCancelFrame = styled(View, { displayName: CANCEL_NAME });
119
+ markAlertDialogPart(AlertDialogCancelFrame, "cancel");
120
+ const AlertDialogCancel = createStyledHOC(AlertDialogCancelFrame, function AlertDialogCancel2(props, forwardedRef) {
121
+ const { scope, ...cancelProps } = props;
122
+ const { cancelRef } = useAlertDialogContentContext(scope);
123
+ const ref = useComposedRefs(forwardedRef, cancelRef);
124
+ return /* @__PURE__ */ jsx(DialogClose, {
125
+ scope: getAlertDialogScope(scope),
126
+ ...cancelProps,
127
+ ref
128
+ });
162
129
  });
163
- const AlertDialogDestructive = styled(View, {
164
- name: "AlertDialogDestructive"
165
- }).styleable(function AlertDialogDestructive2(props, forwardedRef) {
166
- const {
167
- scope,
168
- ...destructiveProps
169
- } = props;
170
- const {
171
- destructiveRef
172
- } = useAlertDialogContentContext(scope);
173
- const ref = useComposedRefs(forwardedRef, destructiveRef);
174
- return /* @__PURE__ */jsx(DialogClose, {
175
- scope: getAlertDialogScope(scope),
176
- ...destructiveProps,
177
- ref
178
- });
130
+ const DESTRUCTIVE_NAME = "AlertDialogDestructive";
131
+ const AlertDialogDestructiveFrame = styled(View, { displayName: DESTRUCTIVE_NAME });
132
+ markAlertDialogPart(AlertDialogDestructiveFrame, "destructive");
133
+ const AlertDialogDestructive = createStyledHOC(AlertDialogDestructiveFrame, function AlertDialogDestructive2(props, forwardedRef) {
134
+ const { scope, ...destructiveProps } = props;
135
+ const { destructiveRef } = useAlertDialogContentContext(scope);
136
+ const ref = useComposedRefs(forwardedRef, destructiveRef);
137
+ return /* @__PURE__ */ jsx(DialogClose, {
138
+ scope: getAlertDialogScope(scope),
139
+ ...destructiveProps,
140
+ ref
141
+ });
179
142
  });
180
- const DescriptionWarning = ({
181
- contentRef
182
- }) => {
183
- if (process.env.NODE_ENV === "development") React.useEffect(() => {
184
- if (!isWeb) return;
185
- if (!document.getElementById(contentRef.current?.getAttribute("aria-describedby"))) console.warn(`\`${CONTENT_NAME}\` requires a description for the component to be accessible for screen reader users.
143
+ const DescriptionWarning = ({ contentRef }) => {
144
+ if (process.env.NODE_ENV === "development") {
145
+ React.useEffect(() => {
146
+ if (!isWeb) return;
147
+ const hasDescription = document.getElementById(contentRef.current?.getAttribute("aria-describedby"));
148
+ if (!hasDescription) {
149
+ console.warn(`\`${CONTENT_NAME}\` requires a description for the component to be accessible for screen reader users.
186
150
 
187
151
  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.
188
152
 
189
153
  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.
190
154
 
191
155
  For more information, see https://tamagui.dev/docs/components/alert-dialog`);
192
- }, [contentRef]);
193
- return null;
156
+ }
157
+ }, [contentRef]);
158
+ }
159
+ return null;
194
160
  };
195
- const AlertDialogInner = props => {
196
- const {
197
- scope,
198
- native,
199
- ...alertDialogProps
200
- } = props;
201
- return /* @__PURE__ */jsx(Dialog, {
202
- scope: getAlertDialogScope(scope),
203
- ...alertDialogProps,
204
- modal: true
205
- });
161
+ const AlertDialogInner = (props) => {
162
+ const { scope, native, ...alertDialogProps } = props;
163
+ const dialogScope = getAlertDialogScope(scope);
164
+ const nativeAlert = useNativeAlertDialog(props);
165
+ if (nativeAlert) return nativeAlert;
166
+ return /* @__PURE__ */ jsx(Dialog, {
167
+ scope: dialogScope,
168
+ ...alertDialogProps,
169
+ modal: true
170
+ });
206
171
  };
207
172
  const AlertDialog = withStaticProperties(AlertDialogInner, {
208
- Trigger: AlertDialogTrigger,
209
- Portal: AlertDialogPortal,
210
- Overlay: AlertDialogOverlay,
211
- Content: AlertDialogContent,
212
- Action: AlertDialogAction,
213
- Cancel: AlertDialogCancel,
214
- Destructive: AlertDialogDestructive,
215
- Title: AlertDialogTitle,
216
- Description: AlertDialogDescription
173
+ Trigger: AlertDialogTrigger,
174
+ Portal: AlertDialogPortal,
175
+ Overlay: AlertDialogOverlay,
176
+ Content: AlertDialogContent,
177
+ Action: AlertDialogAction,
178
+ Cancel: AlertDialogCancel,
179
+ Destructive: AlertDialogDestructive,
180
+ Title: AlertDialogTitle,
181
+ Description: AlertDialogDescription
217
182
  });
218
183
  AlertDialog.displayName = ROOT_NAME;
184
+
219
185
  export { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogDestructive, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger };
220
186
  //# sourceMappingURL=AlertDialog.mjs.map
@@ -1 +1 @@
1
- {"version":3,"names":["useComposedRefs","isWeb","Slottable","View","createStyledContext","styled","Dialog","DialogClose","DialogContent","DialogDescription","DialogOverlay","DialogOverlayFrame","DialogPortal","DialogTitle","DialogTrigger","DialogWarningProvider","composeEventHandlers","withStaticProperties","React","jsx","jsxs","getAlertDialogScope","scope","ROOT_NAME","NativeAlertDialogTriggerFrame","name","AlertDialogTrigger","styleable","AlertDialogTrigger2","props","forwardedRef","__native","onPress","__onPress","rest","triggerProps","ref","AlertDialogPortal","AlertDialogPortal2","portalProps","AlertDialogOverlay","AlertDialogOverlay2","overlayProps","CONTENT_NAME","Provider","AlertDialogContextProvider","useStyledContext","useAlertDialogContentContext","AlertDialogContent","forwardRef","AlertDialogContent2","children","contentProps","dialogScope","contentRef","useRef","composedRefs","cancelRef","contentName","titleName","TITLE_NAME","docsSlug","destructiveRef","role","onOpenAutoFocus","event","preventDefault","current","focus","preventScroll","onPointerDownOutside","onInteractOutside","process","env","NODE_ENV","DescriptionWarning","AlertDialogTitle","AlertDialogTitle2","titleProps","DESCRIPTION_NAME","AlertDialogDescription","AlertDialogDescription2","descriptionProps","AlertDialogAction","AlertDialogAction2","actionProps","AlertDialogCancel","AlertDialogCancel2","cancelProps","AlertDialogDestructive","AlertDialogDestructive2","destructiveProps","useEffect","document","getElementById","getAttribute","console","warn","AlertDialogInner","native","alertDialogProps","modal","AlertDialog","Trigger","Portal","Overlay","Content","Action","Cancel","Destructive","Title","Description","displayName"],"sources":["AlertDialog.mjs"],"sourcesContent":["import { useComposedRefs } from \"@tamagui/compose-refs\";\nimport { isWeb } from \"@tamagui/constants\";\nimport { Slottable, View, createStyledContext, styled } from \"@tamagui/core\";\nimport { Dialog, DialogClose, DialogContent, DialogDescription, DialogOverlay, DialogOverlayFrame, DialogPortal, DialogTitle, DialogTrigger, DialogWarningProvider } from \"@tamagui/dialog\";\nimport { composeEventHandlers, withStaticProperties } from \"@tamagui/helpers\";\nimport * as React from \"react\";\nimport { jsx, jsxs } from \"react/jsx-runtime\";\n\nconst getAlertDialogScope = (scope) => scope;\nconst ROOT_NAME = \"AlertDialog\";\nconst NativeAlertDialogTriggerFrame = styled(View, { name: \"AlertDialogTrigger\" });\nconst AlertDialogTrigger = NativeAlertDialogTriggerFrame.styleable(function AlertDialogTrigger2(props, forwardedRef) {\n\tif (props[\"__native\"]) {\n\t\tconst { __native, onPress, __onPress, ...rest } = props;\n\t\treturn /* @__PURE__ */ jsx(NativeAlertDialogTriggerFrame, {\n\t\t\t...rest,\n\t\t\tonPress: composeEventHandlers(onPress, __onPress)\n\t\t});\n\t}\n\tconst { scope, ...triggerProps } = props;\n\treturn /* @__PURE__ */ jsx(DialogTrigger, {\n\t\tscope: getAlertDialogScope(scope),\n\t\t...triggerProps,\n\t\tref: forwardedRef\n\t});\n});\nconst AlertDialogPortal = function AlertDialogPortal2(props) {\n\tconst { scope, ...portalProps } = props;\n\treturn /* @__PURE__ */ jsx(DialogPortal, {\n\t\tscope: getAlertDialogScope(scope),\n\t\t...portalProps\n\t});\n};\nconst AlertDialogOverlay = styled(DialogOverlayFrame, { name: \"AlertDialogOverlay\" }).styleable(function AlertDialogOverlay2(props, forwardedRef) {\n\tconst { scope, ...overlayProps } = props;\n\treturn /* @__PURE__ */ jsx(DialogOverlay, {\n\t\tscope: getAlertDialogScope(scope),\n\t\t...overlayProps,\n\t\tref: forwardedRef\n\t});\n});\nconst CONTENT_NAME = \"AlertDialogContent\";\nconst { Provider: AlertDialogContextProvider, useStyledContext: useAlertDialogContentContext } = createStyledContext({}, \"AlertDialogContext\");\nconst AlertDialogContent = React.forwardRef(function AlertDialogContent2(props, forwardedRef) {\n\tconst { scope, children, ...contentProps } = props;\n\tconst dialogScope = getAlertDialogScope(scope);\n\tconst contentRef = React.useRef(null);\n\tconst composedRefs = useComposedRefs(forwardedRef, contentRef);\n\tconst cancelRef = React.useRef(null);\n\treturn /* @__PURE__ */ jsx(DialogWarningProvider, {\n\t\tcontentName: CONTENT_NAME,\n\t\ttitleName: TITLE_NAME,\n\t\tdocsSlug: \"alert-dialog\",\n\t\tchildren: /* @__PURE__ */ jsx(AlertDialogContextProvider, {\n\t\t\tscope,\n\t\t\tcancelRef,\n\t\t\tdestructiveRef: React.useRef(null),\n\t\t\tchildren: /* @__PURE__ */ jsxs(DialogContent, {\n\t\t\t\trole: \"alertdialog\",\n\t\t\t\t\"aria-modal\": true,\n\t\t\t\tscope: dialogScope,\n\t\t\t\t...contentProps,\n\t\t\t\tref: composedRefs,\n\t\t\t\tonOpenAutoFocus: composeEventHandlers(contentProps.onOpenAutoFocus, (event) => {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\tif (isWeb) cancelRef.current?.focus({ preventScroll: true });\n\t\t\t\t}),\n\t\t\t\tonPointerDownOutside: (event) => event.preventDefault(),\n\t\t\t\tonInteractOutside: (event) => event.preventDefault(),\n\t\t\t\tchildren: [/* @__PURE__ */ jsx(Slottable, { children }), process.env.NODE_ENV === \"development\" && /* @__PURE__ */ jsx(DescriptionWarning, { contentRef })]\n\t\t\t})\n\t\t})\n\t});\n});\nconst TITLE_NAME = \"AlertDialogTitle\";\nconst AlertDialogTitle = styled(View, { name: TITLE_NAME }).styleable(function AlertDialogTitle2(props, forwardedRef) {\n\tconst { scope, ...titleProps } = props;\n\treturn /* @__PURE__ */ jsx(DialogTitle, {\n\t\tscope: getAlertDialogScope(scope),\n\t\t...titleProps,\n\t\tref: forwardedRef\n\t});\n});\nconst DESCRIPTION_NAME = \"AlertDialogDescription\";\nconst AlertDialogDescription = styled(View, { name: DESCRIPTION_NAME }).styleable(function AlertDialogDescription2(props, forwardedRef) {\n\tconst { scope, ...descriptionProps } = props;\n\treturn /* @__PURE__ */ jsx(DialogDescription, {\n\t\tscope: getAlertDialogScope(scope),\n\t\t...descriptionProps,\n\t\tref: forwardedRef\n\t});\n});\nconst AlertDialogAction = styled(View, { name: \"AlertDialogAction\" }).styleable(function AlertDialogAction2(props, forwardedRef) {\n\tconst { scope, ...actionProps } = props;\n\treturn /* @__PURE__ */ jsx(DialogClose, {\n\t\tscope: getAlertDialogScope(scope),\n\t\t...actionProps,\n\t\tref: forwardedRef\n\t});\n});\nconst AlertDialogCancel = styled(View, { name: \"AlertDialogCancel\" }).styleable(function AlertDialogCancel2(props, forwardedRef) {\n\tconst { scope, ...cancelProps } = props;\n\tconst { cancelRef } = useAlertDialogContentContext(scope);\n\tconst ref = useComposedRefs(forwardedRef, cancelRef);\n\treturn /* @__PURE__ */ jsx(DialogClose, {\n\t\tscope: getAlertDialogScope(scope),\n\t\t...cancelProps,\n\t\tref\n\t});\n});\nconst AlertDialogDestructive = styled(View, { name: \"AlertDialogDestructive\" }).styleable(function AlertDialogDestructive2(props, forwardedRef) {\n\tconst { scope, ...destructiveProps } = props;\n\tconst { destructiveRef } = useAlertDialogContentContext(scope);\n\tconst ref = useComposedRefs(forwardedRef, destructiveRef);\n\treturn /* @__PURE__ */ jsx(DialogClose, {\n\t\tscope: getAlertDialogScope(scope),\n\t\t...destructiveProps,\n\t\tref\n\t});\n});\nconst DescriptionWarning = ({ contentRef }) => {\n\tif (process.env.NODE_ENV === \"development\") React.useEffect(() => {\n\t\tif (!isWeb) return;\n\t\tif (!document.getElementById(contentRef.current?.getAttribute(\"aria-describedby\"))) 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\t}, [contentRef]);\n\treturn null;\n};\nconst AlertDialogInner = (props) => {\n\tconst { scope, native, ...alertDialogProps } = props;\n\treturn /* @__PURE__ */ jsx(Dialog, {\n\t\tscope: getAlertDialogScope(scope),\n\t\t...alertDialogProps,\n\t\tmodal: true\n\t});\n};\nconst AlertDialog = withStaticProperties(AlertDialogInner, {\n\tTrigger: AlertDialogTrigger,\n\tPortal: AlertDialogPortal,\n\tOverlay: AlertDialogOverlay,\n\tContent: AlertDialogContent,\n\tAction: AlertDialogAction,\n\tCancel: AlertDialogCancel,\n\tDestructive: AlertDialogDestructive,\n\tTitle: AlertDialogTitle,\n\tDescription: AlertDialogDescription\n});\nAlertDialog.displayName = ROOT_NAME;\n\nexport { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogDestructive, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger };"],"mappings":"AAAA,SAASA,eAAe,QAAQ,uBAAuB;AACvD,SAASC,KAAK,QAAQ,oBAAoB;AAC1C,SAASC,SAAS,EAAEC,IAAI,EAAEC,mBAAmB,EAAEC,MAAM,QAAQ,eAAe;AAC5E,SAASC,MAAM,EAAEC,WAAW,EAAEC,aAAa,EAAEC,iBAAiB,EAAEC,aAAa,EAAEC,kBAAkB,EAAEC,YAAY,EAAEC,WAAW,EAAEC,aAAa,EAAEC,qBAAqB,QAAQ,iBAAiB;AAC3L,SAASC,oBAAoB,EAAEC,oBAAo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AiB,CAAC,GAAGvE,KAAK;EACpD,OAAO,eAAgBV,GAAG,CAACb,MAAM,EAAE;IAClCgB,KAAK,EAAED,mBAAmB,CAACC,KAAK,CAAC;IACjC,GAAG8E,gBAAgB;IACnBC,KAAK,EAAE;EACR,CAAC,CAAC;AACH,CAAC;AACD,MAAMC,WAAW,GAAGrF,oBAAoB,CAACiF,gBAAgB,EAAE;EAC1DK,OAAO,EAAE7E,kBAAkB;EAC3B8E,MAAM,EAAEnE,iBAAiB;EACzBoE,OAAO,EAAEjE,kBAAkB;EAC3BkE,OAAO,EAAE1D,kBAAkB;EAC3B2D,MAAM,EAAExB,iBAAiB;EACzByB,MAAM,EAAEtB,iBAAiB;EACzBuB,WAAW,EAAEpB,sBAAsB;EACnCqB,KAAK,EAAElC,gBAAgB;EACvBmC,WAAW,EAAE/B;AACd,CAAC,CAAC;AACFsB,WAAW,CAACU,WAAW,GAAGzF,SAAS;AAEnC,SAAS+E,WAAW,EAAEnB,iBAAiB,EAAEG,iBAAiB,EAAEtC,kBAAkB,EAAEgC,sBAAsB,EAAES,sBAAsB,EAAEjD,kBAAkB,EAAEH,iBAAiB,EAAEuC,gBAAgB,EAAElD,kBAAkB","ignoreList":[]}
1
+ {"version":3,"file":"AlertDialog.js","names":[],"sources":["jsx/AlertDialog.js"],"sourcesContent":["import { createStyledHOC, createRefComponent } from \"@tamagui/core\";\nimport { useComposedRefs } from \"@tamagui/compose-refs\";\nimport { isWeb } from \"@tamagui/constants\";\nimport { Slottable, View, createStyledContext, styled } from \"@tamagui/core\";\nimport {\n Dialog,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogOverlay,\n DialogOverlayFrame,\n DialogPortal,\n DialogTitle,\n DialogTrigger,\n DialogWarningProvider\n} from \"@tamagui/dialog\";\nimport { composeEventHandlers, withStaticProperties } from \"@tamagui/helpers\";\nimport * as React from \"react\";\nimport { markAlertDialogPart } from \"./alertDialogPart\";\nimport { useNativeAlertDialog } from \"./useNativeAlertDialog\";\nimport { jsx, jsxs } from \"react/jsx-runtime\";\nconst getAlertDialogScope = (scope) => scope;\nconst ROOT_NAME = \"AlertDialog\";\nconst TRIGGER_NAME = \"AlertDialogTrigger\";\nconst NativeAlertDialogTriggerFrame = styled(View, {\n displayName: TRIGGER_NAME\n});\nmarkAlertDialogPart(NativeAlertDialogTriggerFrame, \"trigger\");\nconst AlertDialogTrigger = createStyledHOC(\n NativeAlertDialogTriggerFrame,\n function AlertDialogTrigger2(props, forwardedRef) {\n if (props[\"__native\"]) {\n const { __native, onPress, __onPress, ...rest } = props;\n return /* @__PURE__ */ jsx(\n NativeAlertDialogTriggerFrame,\n {\n ...rest,\n onPress: composeEventHandlers(onPress, __onPress)\n }\n );\n }\n const { scope, ...triggerProps } = props;\n return /* @__PURE__ */ jsx(\n DialogTrigger,\n {\n scope: getAlertDialogScope(scope),\n ...triggerProps,\n ref: forwardedRef\n }\n );\n }\n);\nconst AlertDialogPortal = function AlertDialogPortal2(props) {\n const { scope, ...portalProps } = props;\n return /* @__PURE__ */ jsx(DialogPortal, { scope: getAlertDialogScope(scope), ...portalProps });\n};\nconst OVERLAY_NAME = \"AlertDialogOverlay\";\nconst AlertDialogOverlayFrame = styled(DialogOverlayFrame, {\n displayName: OVERLAY_NAME\n});\nconst AlertDialogOverlay = createStyledHOC(\n AlertDialogOverlayFrame,\n function AlertDialogOverlay2(props, forwardedRef) {\n const { scope, ...overlayProps } = props;\n return /* @__PURE__ */ jsx(\n DialogOverlay,\n {\n scope: getAlertDialogScope(scope),\n ...overlayProps,\n ref: forwardedRef\n }\n );\n }\n);\nconst CONTENT_NAME = \"AlertDialogContent\";\nconst {\n Provider: AlertDialogContextProvider,\n useStyledContext: useAlertDialogContentContext\n} = createStyledContext({}, \"AlertDialogContext\");\nconst AlertDialogContent = createRefComponent(\n function AlertDialogContent2(props, forwardedRef) {\n const { scope, children, ...contentProps } = props;\n const dialogScope = getAlertDialogScope(scope);\n const contentRef = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, contentRef);\n const cancelRef = React.useRef(null);\n const destructiveRef = React.useRef(null);\n return /* @__PURE__ */ jsx(\n DialogWarningProvider,\n {\n contentName: CONTENT_NAME,\n titleName: TITLE_NAME,\n docsSlug: \"alert-dialog\",\n children: /* @__PURE__ */ jsx(\n AlertDialogContextProvider,\n {\n scope,\n cancelRef,\n destructiveRef,\n children: /* @__PURE__ */ jsxs(\n DialogContent,\n {\n role: \"alertdialog\",\n \"aria-modal\": true,\n scope: dialogScope,\n ...contentProps,\n ref: composedRefs,\n onOpenAutoFocus: composeEventHandlers(\n contentProps.onOpenAutoFocus,\n (event) => {\n event.cancel();\n if (isWeb) {\n cancelRef.current?.focus({ preventScroll: true });\n }\n }\n ),\n onPointerDownOutside: (event) => event.cancel(),\n onInteractOutside: (event) => event.cancel(),\n children: [\n /* @__PURE__ */ jsx(Slottable, { children }),\n process.env.NODE_ENV === \"development\" && /* @__PURE__ */ jsx(DescriptionWarning, { contentRef })\n ]\n }\n )\n }\n )\n }\n );\n }\n);\nconst TITLE_NAME = \"AlertDialogTitle\";\nconst AlertDialogTitleFrame = styled(View, {\n displayName: TITLE_NAME\n});\nmarkAlertDialogPart(AlertDialogTitleFrame, \"title\");\nconst AlertDialogTitle = createStyledHOC(\n AlertDialogTitleFrame,\n function AlertDialogTitle2(props, forwardedRef) {\n const { scope, ...titleProps } = props;\n return /* @__PURE__ */ jsx(\n DialogTitle,\n {\n scope: getAlertDialogScope(scope),\n ...titleProps,\n ref: forwardedRef\n }\n );\n }\n);\nconst DESCRIPTION_NAME = \"AlertDialogDescription\";\nconst AlertDialogDescriptionFrame = styled(View, {\n displayName: DESCRIPTION_NAME\n});\nmarkAlertDialogPart(AlertDialogDescriptionFrame, \"description\");\nconst AlertDialogDescription = createStyledHOC(\n AlertDialogDescriptionFrame,\n function AlertDialogDescription2(props, forwardedRef) {\n const { scope, ...descriptionProps } = props;\n return /* @__PURE__ */ jsx(\n DialogDescription,\n {\n scope: getAlertDialogScope(scope),\n ...descriptionProps,\n ref: forwardedRef\n }\n );\n }\n);\nconst ACTION_NAME = \"AlertDialogAction\";\nconst AlertDialogActionFrame = styled(View, {\n displayName: ACTION_NAME\n});\nmarkAlertDialogPart(AlertDialogActionFrame, \"action\");\nconst AlertDialogAction = createStyledHOC(\n AlertDialogActionFrame,\n function AlertDialogAction2(props, forwardedRef) {\n const { scope, ...actionProps } = props;\n return /* @__PURE__ */ jsx(\n DialogClose,\n {\n scope: getAlertDialogScope(scope),\n ...actionProps,\n ref: forwardedRef\n }\n );\n }\n);\nconst CANCEL_NAME = \"AlertDialogCancel\";\nconst AlertDialogCancelFrame = styled(View, {\n displayName: CANCEL_NAME\n});\nmarkAlertDialogPart(AlertDialogCancelFrame, \"cancel\");\nconst AlertDialogCancel = createStyledHOC(\n AlertDialogCancelFrame,\n function AlertDialogCancel2(props, forwardedRef) {\n const { scope, ...cancelProps } = props;\n const { cancelRef } = useAlertDialogContentContext(scope);\n const ref = useComposedRefs(forwardedRef, cancelRef);\n return /* @__PURE__ */ jsx(DialogClose, { scope: getAlertDialogScope(scope), ...cancelProps, ref });\n }\n);\nconst DESTRUCTIVE_NAME = \"AlertDialogDestructive\";\nconst AlertDialogDestructiveFrame = styled(View, {\n displayName: DESTRUCTIVE_NAME\n});\nmarkAlertDialogPart(AlertDialogDestructiveFrame, \"destructive\");\nconst AlertDialogDestructive = createStyledHOC(\n AlertDialogDestructiveFrame,\n function AlertDialogDestructive2(props, forwardedRef) {\n const { scope, ...destructiveProps } = props;\n const { destructiveRef } = useAlertDialogContentContext(scope);\n const ref = useComposedRefs(forwardedRef, destructiveRef);\n return /* @__PURE__ */ jsx(DialogClose, { scope: getAlertDialogScope(scope), ...destructiveProps, ref });\n }\n);\nconst DescriptionWarning = ({ contentRef }) => {\n if (process.env.NODE_ENV === \"development\") {\n React.useEffect(() => {\n if (!isWeb) return;\n const hasDescription = document.getElementById(\n // @ts-ignore\n contentRef.current?.getAttribute(\"aria-describedby\")\n );\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 }, [contentRef]);\n }\n return null;\n};\nconst AlertDialogInner = (props) => {\n const { scope, native, ...alertDialogProps } = props;\n const dialogScope = getAlertDialogScope(scope);\n const nativeAlert = useNativeAlertDialog(props);\n if (nativeAlert) return nativeAlert;\n return /* @__PURE__ */ jsx(Dialog, { scope: dialogScope, ...alertDialogProps, modal: true });\n};\nconst 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":";;;;;;;;;;;AAqBA,MAAM,uBAAuB,UAAU;AACvC,MAAM,YAAY;AAClB,MAAM,eAAe;AACrB,MAAM,gCAAgC,OAAO,MAAM,EACjD,aAAa,aACf,CAAC;AACD,oBAAoB,+BAA+B,SAAS;AAC5D,MAAM,qBAAqB,gBACzB,+BACA,SAAS,oBAAoB,OAAO,cAAc;CAChD,IAAI,MAAM,aAAa;EAC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