@tamagui/alert-dialog 2.0.0-rc.9 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/index.ts"],
4
- "mappings": "AAAA,cAAc;",
5
- "names": []
6
- }
1
+ {"version":3,"names":[],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA,cAAc","ignoreList":[]}
@@ -1,220 +1,221 @@
1
1
  import { useComposedRefs } from "@tamagui/compose-refs";
2
- import { isWeb } from "@tamagui/constants";
3
- import { Slottable, View, createStyledContext, styled } from "@tamagui/core";
2
+ import { isWeb, useIsomorphicLayoutEffect } from "@tamagui/constants";
3
+ import { Slottable, View, createStyledContext, isTamaguiElement, 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
+ import { useControllableState } from "@tamagui/use-controllable-state";
6
7
  import * as React from "react";
8
+ import { Alert } from "react-native-web";
7
9
  import { jsx, jsxs } from "react/jsx-runtime";
8
- const getAlertDialogScope = scope => scope,
9
- ROOT_NAME = "AlertDialog",
10
- TRIGGER_NAME = "AlertDialogTrigger",
11
- NativeAlertDialogTriggerFrame = styled(View, {
12
- name: TRIGGER_NAME
13
- }),
14
- AlertDialogTrigger = NativeAlertDialogTriggerFrame.styleable(function (props, forwardedRef) {
15
- if (props.__native) {
16
- const {
17
- __native,
18
- onPress,
19
- __onPress,
20
- ...rest
21
- } = props;
22
- return /* @__PURE__ */jsx(NativeAlertDialogTriggerFrame, {
23
- ...rest,
24
- onPress: composeEventHandlers(onPress, __onPress)
25
- });
26
- }
10
+ const getAlertDialogScope = scope => scope;
11
+ const ROOT_NAME = "AlertDialog";
12
+ const NativeAlertDialogTriggerFrame = styled(View, {
13
+ name: "AlertDialogTrigger"
14
+ });
15
+ const AlertDialogTrigger = NativeAlertDialogTriggerFrame.styleable(function AlertDialogTrigger2(props, forwardedRef) {
16
+ if (props["__native"]) {
27
17
  const {
28
- scope,
29
- ...triggerProps
18
+ __native,
19
+ onPress,
20
+ __onPress,
21
+ ...rest
30
22
  } = props;
31
- return /* @__PURE__ */jsx(DialogTrigger, {
32
- scope: getAlertDialogScope(scope),
33
- ...triggerProps,
34
- ref: forwardedRef
23
+ return /* @__PURE__ */jsx(NativeAlertDialogTriggerFrame, {
24
+ ...rest,
25
+ onPress: composeEventHandlers(onPress, __onPress)
35
26
  });
27
+ }
28
+ const {
29
+ scope,
30
+ ...triggerProps
31
+ } = props;
32
+ return /* @__PURE__ */jsx(DialogTrigger, {
33
+ scope: getAlertDialogScope(scope),
34
+ ...triggerProps,
35
+ ref: forwardedRef
36
36
  });
37
- const AlertDialogPortal = function (props) {
38
- const {
39
- scope,
40
- ...portalProps
41
- } = props;
42
- return /* @__PURE__ */jsx(DialogPortal, {
43
- scope: getAlertDialogScope(scope),
44
- ...portalProps
45
- });
46
- },
47
- OVERLAY_NAME = "AlertDialogOverlay",
48
- AlertDialogOverlayFrame = styled(DialogOverlayFrame, {
49
- name: OVERLAY_NAME
50
- }),
51
- AlertDialogOverlay = AlertDialogOverlayFrame.styleable(function (props, forwardedRef) {
52
- const {
37
+ });
38
+ const AlertDialogPortal = function AlertDialogPortal2(props) {
39
+ const {
40
+ scope,
41
+ ...portalProps
42
+ } = props;
43
+ return /* @__PURE__ */jsx(DialogPortal, {
44
+ scope: getAlertDialogScope(scope),
45
+ ...portalProps
46
+ });
47
+ };
48
+ const AlertDialogOverlay = styled(DialogOverlayFrame, {
49
+ name: "AlertDialogOverlay"
50
+ }).styleable(function AlertDialogOverlay2(props, forwardedRef) {
51
+ const {
52
+ scope,
53
+ ...overlayProps
54
+ } = props;
55
+ return /* @__PURE__ */jsx(DialogOverlay, {
56
+ scope: getAlertDialogScope(scope),
57
+ ...overlayProps,
58
+ ref: forwardedRef
59
+ });
60
+ });
61
+ const CONTENT_NAME = "AlertDialogContent";
62
+ const {
63
+ Provider: AlertDialogContextProvider,
64
+ useStyledContext: useAlertDialogContentContext
65
+ } = createStyledContext({}, "AlertDialogContext");
66
+ const AlertDialogContent = React.forwardRef(function AlertDialogContent2(props, forwardedRef) {
67
+ const {
68
+ scope,
69
+ children,
70
+ ...contentProps
71
+ } = props;
72
+ const dialogScope = getAlertDialogScope(scope);
73
+ const contentRef = React.useRef(null);
74
+ const composedRefs = useComposedRefs(forwardedRef, contentRef);
75
+ const cancelRef = React.useRef(null);
76
+ return /* @__PURE__ */jsx(DialogWarningProvider, {
77
+ contentName: CONTENT_NAME,
78
+ titleName: TITLE_NAME,
79
+ docsSlug: "alert-dialog",
80
+ children: /* @__PURE__ */jsx(AlertDialogContextProvider, {
53
81
  scope,
54
- ...overlayProps
55
- } = props;
56
- return /* @__PURE__ */jsx(DialogOverlay, {
57
- scope: getAlertDialogScope(scope),
58
- ...overlayProps,
59
- ref: forwardedRef
60
- });
61
- }),
62
- CONTENT_NAME = "AlertDialogContent",
63
- {
64
- Provider: AlertDialogContextProvider,
65
- useStyledContext: useAlertDialogContentContext
66
- } = createStyledContext({}, "AlertDialogContext"),
67
- AlertDialogContent = React.forwardRef(function (props, forwardedRef) {
68
- const {
69
- scope,
70
- children,
71
- ...contentProps
72
- } = props,
73
- dialogScope = getAlertDialogScope(scope),
74
- contentRef = React.useRef(null),
75
- composedRefs = useComposedRefs(forwardedRef, contentRef),
76
- cancelRef = React.useRef(null),
77
- destructiveRef = React.useRef(null);
78
- return /* @__PURE__ */jsx(DialogWarningProvider, {
79
- contentName: CONTENT_NAME,
80
- titleName: TITLE_NAME,
81
- docsSlug: "alert-dialog",
82
- children: /* @__PURE__ */jsx(AlertDialogContextProvider, {
83
- scope,
84
- cancelRef,
85
- destructiveRef,
86
- children: /* @__PURE__ */jsxs(DialogContent, {
87
- role: "alertdialog",
88
- "aria-modal": !0,
89
- scope: dialogScope,
90
- ...contentProps,
91
- ref: composedRefs,
92
- onOpenAutoFocus: composeEventHandlers(contentProps.onOpenAutoFocus, event => {
93
- event.preventDefault(), isWeb && cancelRef.current?.focus({
94
- preventScroll: !0
95
- });
96
- }),
97
- onPointerDownOutside: event => event.preventDefault(),
98
- onInteractOutside: event => event.preventDefault(),
99
- children: [/* @__PURE__ */jsx(Slottable, {
100
- children
101
- }), process.env.NODE_ENV === "development" && /* @__PURE__ */jsx(DescriptionWarning, {
102
- contentRef
103
- })]
104
- })
82
+ cancelRef,
83
+ destructiveRef: React.useRef(null),
84
+ children: /* @__PURE__ */jsxs(DialogContent, {
85
+ role: "alertdialog",
86
+ "aria-modal": true,
87
+ scope: dialogScope,
88
+ ...contentProps,
89
+ ref: composedRefs,
90
+ onOpenAutoFocus: composeEventHandlers(contentProps.onOpenAutoFocus, event => {
91
+ event.preventDefault();
92
+ if (isWeb) cancelRef.current?.focus({
93
+ preventScroll: true
94
+ });
95
+ }),
96
+ onPointerDownOutside: event => event.preventDefault(),
97
+ onInteractOutside: event => event.preventDefault(),
98
+ children: [/* @__PURE__ */jsx(Slottable, {
99
+ children
100
+ }), process.env.NODE_ENV === "development" && /* @__PURE__ */jsx(DescriptionWarning, {
101
+ contentRef
102
+ })]
105
103
  })
106
- });
107
- }),
108
- TITLE_NAME = "AlertDialogTitle",
109
- AlertDialogTitleFrame = styled(View, {
110
- name: TITLE_NAME
111
- }),
112
- AlertDialogTitle = AlertDialogTitleFrame.styleable(function (props, forwardedRef) {
113
- const {
114
- scope,
115
- ...titleProps
116
- } = props;
117
- return /* @__PURE__ */jsx(DialogTitle, {
118
- scope: getAlertDialogScope(scope),
119
- ...titleProps,
120
- ref: forwardedRef
121
- });
122
- }),
123
- DESCRIPTION_NAME = "AlertDialogDescription",
124
- AlertDialogDescriptionFrame = styled(View, {
125
- name: DESCRIPTION_NAME
126
- }),
127
- AlertDialogDescription = AlertDialogDescriptionFrame.styleable(function (props, forwardedRef) {
128
- const {
129
- scope,
130
- ...descriptionProps
131
- } = props;
132
- return /* @__PURE__ */jsx(DialogDescription, {
133
- scope: getAlertDialogScope(scope),
134
- ...descriptionProps,
135
- ref: forwardedRef
136
- });
137
- }),
138
- ACTION_NAME = "AlertDialogAction",
139
- AlertDialogActionFrame = styled(View, {
140
- name: ACTION_NAME
141
- }),
142
- AlertDialogAction = AlertDialogActionFrame.styleable(function (props, forwardedRef) {
143
- const {
144
- scope,
145
- ...actionProps
146
- } = props;
147
- return /* @__PURE__ */jsx(DialogClose, {
148
- scope: getAlertDialogScope(scope),
149
- ...actionProps,
150
- ref: forwardedRef
151
- });
152
- }),
153
- CANCEL_NAME = "AlertDialogCancel",
154
- AlertDialogCancelFrame = styled(View, {
155
- name: CANCEL_NAME
156
- }),
157
- AlertDialogCancel = AlertDialogCancelFrame.styleable(function (props, forwardedRef) {
158
- const {
159
- scope,
160
- ...cancelProps
161
- } = props,
162
- {
163
- cancelRef
164
- } = useAlertDialogContentContext(scope),
165
- ref = useComposedRefs(forwardedRef, cancelRef);
166
- return /* @__PURE__ */jsx(DialogClose, {
167
- scope: getAlertDialogScope(scope),
168
- ...cancelProps,
169
- ref
170
- });
171
- }),
172
- DESTRUCTIVE_NAME = "AlertDialogDestructive",
173
- AlertDialogDestructiveFrame = styled(View, {
174
- name: DESTRUCTIVE_NAME
175
- }),
176
- AlertDialogDestructive = AlertDialogDestructiveFrame.styleable(function (props, forwardedRef) {
177
- const {
178
- scope,
179
- ...destructiveProps
180
- } = props,
181
- {
182
- destructiveRef
183
- } = useAlertDialogContentContext(scope),
184
- ref = useComposedRefs(forwardedRef, destructiveRef);
185
- return /* @__PURE__ */jsx(DialogClose, {
186
- scope: getAlertDialogScope(scope),
187
- ...destructiveProps,
188
- ref
189
- });
190
- }),
191
- DescriptionWarning = ({
192
- contentRef
193
- }) => (process.env.NODE_ENV === "development" && React.useEffect(() => {
104
+ })
105
+ });
106
+ });
107
+ const TITLE_NAME = "AlertDialogTitle";
108
+ const AlertDialogTitle = styled(View, {
109
+ name: TITLE_NAME
110
+ }).styleable(function AlertDialogTitle2(props, forwardedRef) {
111
+ const {
112
+ scope,
113
+ ...titleProps
114
+ } = props;
115
+ return /* @__PURE__ */jsx(DialogTitle, {
116
+ scope: getAlertDialogScope(scope),
117
+ ...titleProps,
118
+ ref: forwardedRef
119
+ });
120
+ });
121
+ const DESCRIPTION_NAME = "AlertDialogDescription";
122
+ const AlertDialogDescription = styled(View, {
123
+ name: DESCRIPTION_NAME
124
+ }).styleable(function AlertDialogDescription2(props, forwardedRef) {
125
+ const {
126
+ scope,
127
+ ...descriptionProps
128
+ } = props;
129
+ return /* @__PURE__ */jsx(DialogDescription, {
130
+ scope: getAlertDialogScope(scope),
131
+ ...descriptionProps,
132
+ ref: forwardedRef
133
+ });
134
+ });
135
+ const AlertDialogAction = styled(View, {
136
+ name: "AlertDialogAction"
137
+ }).styleable(function AlertDialogAction2(props, forwardedRef) {
138
+ const {
139
+ scope,
140
+ ...actionProps
141
+ } = props;
142
+ return /* @__PURE__ */jsx(DialogClose, {
143
+ scope: getAlertDialogScope(scope),
144
+ ...actionProps,
145
+ ref: forwardedRef
146
+ });
147
+ });
148
+ const AlertDialogCancel = styled(View, {
149
+ name: "AlertDialogCancel"
150
+ }).styleable(function AlertDialogCancel2(props, forwardedRef) {
151
+ const {
152
+ scope,
153
+ ...cancelProps
154
+ } = props;
155
+ const {
156
+ cancelRef
157
+ } = useAlertDialogContentContext(scope);
158
+ const ref = useComposedRefs(forwardedRef, cancelRef);
159
+ return /* @__PURE__ */jsx(DialogClose, {
160
+ scope: getAlertDialogScope(scope),
161
+ ...cancelProps,
162
+ ref
163
+ });
164
+ });
165
+ const AlertDialogDestructive = styled(View, {
166
+ name: "AlertDialogDestructive"
167
+ }).styleable(function AlertDialogDestructive2(props, forwardedRef) {
168
+ const {
169
+ scope,
170
+ ...destructiveProps
171
+ } = props;
172
+ const {
173
+ destructiveRef
174
+ } = useAlertDialogContentContext(scope);
175
+ const ref = useComposedRefs(forwardedRef, destructiveRef);
176
+ return /* @__PURE__ */jsx(DialogClose, {
177
+ scope: getAlertDialogScope(scope),
178
+ ...destructiveProps,
179
+ ref
180
+ });
181
+ });
182
+ const DescriptionWarning = ({
183
+ contentRef
184
+ }) => {
185
+ if (process.env.NODE_ENV === "development") React.useEffect(() => {
194
186
  if (!isWeb) return;
195
- document.getElementById(
187
+ if (!document.getElementById(
196
188
  // @ts-ignore
197
- contentRef.current?.getAttribute("aria-describedby")) || console.warn(`\`${CONTENT_NAME}\` requires a description for the component to be accessible for screen reader users.
189
+ contentRef.current?.getAttribute("aria-describedby"))) console.warn(`\`${CONTENT_NAME}\` requires a description for the component to be accessible for screen reader users.
198
190
 
199
191
  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.
200
192
 
201
193
  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.
202
194
 
203
195
  For more information, see https://tamagui.dev/docs/components/alert-dialog`);
204
- }, [contentRef]), null),
205
- AlertDialogInner = props => {
206
- const {
207
- scope,
208
- native,
209
- ...alertDialogProps
210
- } = props,
211
- dialogScope = getAlertDialogScope(scope);
212
- return /* @__PURE__ */jsx(Dialog, {
213
- scope: dialogScope,
214
- ...alertDialogProps,
215
- modal: !0
216
- });
217
- };
196
+ }, [contentRef]);
197
+ return null;
198
+ };
199
+ const AlertDialogInner = props => {
200
+ const {
201
+ scope,
202
+ native,
203
+ ...alertDialogProps
204
+ } = props;
205
+ return /* @__PURE__ */jsx(Dialog, {
206
+ scope: getAlertDialogScope(scope),
207
+ ...alertDialogProps,
208
+ modal: true
209
+ });
210
+ };
211
+ function forEachChildDeep(children, onChild) {
212
+ for (const child of children) {
213
+ if (!React.isValidElement(child)) continue;
214
+ if (!onChild(child)) continue;
215
+ const childProps = child.props;
216
+ if (childProps.children) forEachChildDeep(React.Children.toArray(childProps.children), onChild);
217
+ }
218
+ }
218
219
  const AlertDialog = withStaticProperties(AlertDialogInner, {
219
220
  Trigger: AlertDialogTrigger,
220
221
  Portal: AlertDialogPortal,
@@ -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","TRIGGER_NAME","NativeAlertDialogTriggerFrame","name","AlertDialogTrigger","styleable","props","forwardedRef","__native","onPress","__onPress","rest","triggerProps","ref","AlertDialogPortal","portalProps","OVERLAY_NAME","AlertDialogOverlayFrame","AlertDialogOverlay","overlayProps","CONTENT_NAME","Provider","AlertDialogContextProvider","useStyledContext","useAlertDialogContentContext","AlertDialogContent","forwardRef","children","contentProps","dialogScope","contentRef","useRef","composedRefs","cancelRef","destructiveRef","contentName","titleName","TITLE_NAME","docsSlug","role","onOpenAutoFocus","event","preventDefault","current","focus","preventScroll","onPointerDownOutside","onInteractOutside","process","env","NODE_ENV","DescriptionWarning","AlertDialogTitleFrame","AlertDialogTitle","titleProps","DESCRIPTION_NAME","AlertDialogDescriptionFrame","AlertDialogDescription","descriptionProps","ACTION_NAME","AlertDialogActionFrame","AlertDialogAction","actionProps","CANCEL_NAME","AlertDialogCancelFrame","AlertDialogCancel","cancelProps","DESTRUCTIVE_NAME","AlertDialogDestructiveFrame","AlertDialogDestructive","destructiveProps","useEffect","document","getElementById","getAttribute","console","warn","AlertDialogInner","native","alertDialogProps","modal","AlertDialog","Trigger","Portal","Overlay","Content","Action","Cancel","Destructive","Title","Description","displayName"],"sources":["../../src/AlertDialog.tsx"],"sourcesContent":[null],"mappings":"AAGA,SAASA,eAAA,QAAuB;AAChC,S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AAA,EAAQzB,iBAAA;EACR0B,MAAA,EAAQtB,iBAAA;EACRuB,WAAA,EAAanB,sBAAA;EACboB,KAAA,EAAOpC,gBAAA;EACPqC,WAAA,EAAajC;AACf,CAAC;AAEDwB,WAAA,CAAYU,WAAA,GAAc3F,SAAA","ignoreList":[]}
1
+ {"version":3,"names":["useComposedRefs","isWeb","useIsomorphicLayoutEffect","Slottable","View","createStyledContext","isTamaguiElement","styled","Dialog","DialogClose","DialogContent","DialogDescription","DialogOverlay","DialogOverlayFrame","DialogPortal","DialogTitle","DialogTrigger","DialogWarningProvider","composeEventHandlers","withStaticProperties","useControllableState","React","Alert","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","forEachChildDeep","onChild","child","isValidElement","childProps","Children","toArray","AlertDialog","Trigger","Portal","Overlay","Content","Action","Cancel","Destructive","Title","Description","displayName"],"sources":["../../src/AlertDialog.tsx"],"sourcesContent":[null],"mappings":"AAGA,SAASA,eAA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