@tamagui/alert-dialog 1.0.1-beta.104

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.
@@ -0,0 +1,523 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __defProps = Object.defineProperties;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
8
+ var __getProtoOf = Object.getPrototypeOf;
9
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
10
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
11
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
12
+ var __spreadValues = (a, b) => {
13
+ for (var prop in b || (b = {}))
14
+ if (__hasOwnProp.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ if (__getOwnPropSymbols)
17
+ for (var prop of __getOwnPropSymbols(b)) {
18
+ if (__propIsEnum.call(b, prop))
19
+ __defNormalProp(a, prop, b[prop]);
20
+ }
21
+ return a;
22
+ };
23
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
24
+ var __objRest = (source, exclude) => {
25
+ var target = {};
26
+ for (var prop in source)
27
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
28
+ target[prop] = source[prop];
29
+ if (source != null && __getOwnPropSymbols)
30
+ for (var prop of __getOwnPropSymbols(source)) {
31
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
32
+ target[prop] = source[prop];
33
+ }
34
+ return target;
35
+ };
36
+ var __export = (target, all) => {
37
+ for (var name in all)
38
+ __defProp(target, name, { get: all[name], enumerable: true });
39
+ };
40
+ var __copyProps = (to, from, except, desc) => {
41
+ if (from && typeof from === "object" || typeof from === "function") {
42
+ for (let key of __getOwnPropNames(from))
43
+ if (!__hasOwnProp.call(to, key) && key !== except)
44
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
45
+ }
46
+ return to;
47
+ };
48
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
49
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
50
+ var Dialog_exports = {};
51
+ __export(Dialog_exports, {
52
+ Dialog: () => Dialog2,
53
+ DialogClose: () => DialogClose,
54
+ DialogContent: () => DialogContent,
55
+ DialogDescription: () => DialogDescription,
56
+ DialogOverlay: () => DialogOverlay,
57
+ DialogPortal: () => DialogPortal,
58
+ DialogPortalFrame: () => DialogPortalFrame,
59
+ DialogSheetContents: () => DialogSheetContents,
60
+ DialogTitle: () => DialogTitle,
61
+ DialogTrigger: () => DialogTrigger,
62
+ WarningProvider: () => WarningProvider,
63
+ createDialogScope: () => createDialogScope
64
+ });
65
+ module.exports = __toCommonJS(Dialog_exports);
66
+ var import_animate_presence = require("@tamagui/animate-presence");
67
+ var import_compose_refs = require("@tamagui/compose-refs");
68
+ var import_core = require("@tamagui/core");
69
+ var import_core2 = require("@tamagui/core");
70
+ var import_create_context = require("@tamagui/create-context");
71
+ var import_dismissable = require("@tamagui/dismissable");
72
+ var import_focus_scope = require("@tamagui/focus-scope");
73
+ var import_portal = require("@tamagui/portal");
74
+ var import_sheet = require("@tamagui/sheet");
75
+ var import_stacks = require("@tamagui/stacks");
76
+ var import_text = require("@tamagui/text");
77
+ var import_use_controllable_state = require("@tamagui/use-controllable-state");
78
+ var import_aria_hidden = require("aria-hidden");
79
+ var React = __toESM(require("react"));
80
+ var import_react_remove_scroll = require("react-remove-scroll");
81
+ const DIALOG_NAME = "Dialog";
82
+ const [createDialogContext, createDialogScope] = (0, import_create_context.createContextScope)(DIALOG_NAME);
83
+ const [DialogProvider, useDialogContext] = createDialogContext(DIALOG_NAME);
84
+ const TRIGGER_NAME = "DialogTrigger";
85
+ const DialogTriggerFrame = (0, import_core2.styled)(import_stacks.YStack, {
86
+ name: TRIGGER_NAME
87
+ });
88
+ const DialogTrigger = React.forwardRef((props, forwardedRef) => {
89
+ const _a = props, { __scopeDialog } = _a, triggerProps = __objRest(_a, ["__scopeDialog"]);
90
+ const context = useDialogContext(TRIGGER_NAME, __scopeDialog);
91
+ const composedTriggerRef = (0, import_compose_refs.useComposedRefs)(forwardedRef, context.triggerRef);
92
+ return /* @__PURE__ */ React.createElement(DialogTriggerFrame, __spreadProps(__spreadValues({
93
+ tag: "button",
94
+ "aria-haspopup": "dialog",
95
+ "aria-expanded": context.open,
96
+ "aria-controls": context.contentId,
97
+ "data-state": getState(context.open)
98
+ }, triggerProps), {
99
+ ref: composedTriggerRef,
100
+ onPress: (0, import_core2.composeEventHandlers)(props.onPress, context.onOpenToggle)
101
+ }));
102
+ });
103
+ DialogTrigger.displayName = TRIGGER_NAME;
104
+ const PORTAL_NAME = "DialogPortal";
105
+ const [PortalProvider, usePortalContext] = createDialogContext(PORTAL_NAME, {
106
+ forceMount: void 0
107
+ });
108
+ const DialogPortalFrame = (0, import_core2.styled)(import_stacks.YStack, __spreadValues({
109
+ alignItems: "center",
110
+ justifyContent: "center",
111
+ fullscreen: true,
112
+ zIndex: 100
113
+ }, import_core2.isWeb && {
114
+ maxHeight: "100vh"
115
+ }));
116
+ const DialogPortal = DialogPortalFrame.extractable((props) => {
117
+ const _a = props, { __scopeDialog, forceMount, children } = _a, frameProps = __objRest(_a, ["__scopeDialog", "forceMount", "children"]);
118
+ const themeName = (0, import_core2.useThemeName)();
119
+ const context = useDialogContext(PORTAL_NAME, __scopeDialog);
120
+ const isShowing = forceMount || context.open;
121
+ const contents = /* @__PURE__ */ React.createElement(import_animate_presence.AnimatePresence, null, isShowing ? children : null);
122
+ const isSheet = useShowDialogSheet(context);
123
+ if (!context.modal || isSheet) {
124
+ return contents;
125
+ }
126
+ return /* @__PURE__ */ React.createElement(import_portal.PortalItem, null, /* @__PURE__ */ React.createElement(DialogProvider, __spreadValues({
127
+ scope: __scopeDialog
128
+ }, context), /* @__PURE__ */ React.createElement(import_core2.Theme, {
129
+ name: themeName
130
+ }, /* @__PURE__ */ React.createElement(PortalProvider, {
131
+ scope: __scopeDialog,
132
+ forceMount
133
+ }, /* @__PURE__ */ React.createElement(DialogPortalFrame, __spreadValues({
134
+ pointerEvents: isShowing ? "auto" : "none"
135
+ }, frameProps), contents)))));
136
+ });
137
+ DialogPortal.displayName = PORTAL_NAME;
138
+ const OVERLAY_NAME = "DialogOverlay";
139
+ const DialogOverlayFrame = (0, import_core2.styled)(import_stacks.ThemeableStack, {
140
+ name: OVERLAY_NAME,
141
+ pointerEvents: "auto",
142
+ backgrounded: true,
143
+ fullscreen: true
144
+ });
145
+ const DialogOverlay = React.forwardRef((_a, forwardedRef) => {
146
+ var _b = _a, { __scopeDialog } = _b, props = __objRest(_b, ["__scopeDialog"]);
147
+ const portalContext = usePortalContext(OVERLAY_NAME, __scopeDialog);
148
+ const _a2 = props, { forceMount = portalContext.forceMount } = _a2, overlayProps = __objRest(_a2, ["forceMount"]);
149
+ const context = useDialogContext(OVERLAY_NAME, __scopeDialog);
150
+ const showSheet = useShowDialogSheet(context);
151
+ if (!forceMount) {
152
+ if (!context.modal || showSheet) {
153
+ return null;
154
+ }
155
+ }
156
+ return /* @__PURE__ */ React.createElement(DialogOverlayImpl, __spreadProps(__spreadValues({}, overlayProps), {
157
+ ref: forwardedRef
158
+ }));
159
+ });
160
+ DialogOverlay.displayName = OVERLAY_NAME;
161
+ const DialogOverlayImpl = React.forwardRef((props, forwardedRef) => {
162
+ const _a = props, { __scopeDialog } = _a, overlayProps = __objRest(_a, ["__scopeDialog"]);
163
+ const context = useDialogContext(OVERLAY_NAME, __scopeDialog);
164
+ const content = /* @__PURE__ */ React.createElement(DialogOverlayFrame, __spreadProps(__spreadValues({
165
+ "data-state": getState(context.open),
166
+ pointerEvents: "auto"
167
+ }, overlayProps), {
168
+ ref: forwardedRef
169
+ }));
170
+ if (!import_core2.isWeb) {
171
+ return content;
172
+ }
173
+ return /* @__PURE__ */ React.createElement(import_react_remove_scroll.RemoveScroll, {
174
+ as: import_core2.Slot,
175
+ allowPinchZoom: context.allowPinchZoom,
176
+ shards: [context.contentRef]
177
+ }, content);
178
+ });
179
+ const CONTENT_NAME = "DialogContent";
180
+ const DialogContentFrame = (0, import_core2.styled)(import_stacks.ThemeableStack, {
181
+ name: CONTENT_NAME,
182
+ tag: "dialog",
183
+ pointerEvents: "auto",
184
+ position: "relative",
185
+ backgrounded: true,
186
+ padded: true,
187
+ radiused: true,
188
+ elevate: true,
189
+ variants: {
190
+ size: {
191
+ "...size": (val, extras) => {
192
+ return {};
193
+ }
194
+ }
195
+ },
196
+ defaultVariants: {
197
+ size: "$4"
198
+ }
199
+ });
200
+ const DialogContent = DialogContentFrame.extractable(React.forwardRef((_c, forwardedRef) => {
201
+ var _d = _c, { __scopeDialog } = _d, props = __objRest(_d, ["__scopeDialog"]);
202
+ const portalContext = usePortalContext(CONTENT_NAME, __scopeDialog);
203
+ const _a = props, { forceMount = portalContext.forceMount } = _a, contentProps = __objRest(_a, ["forceMount"]);
204
+ const context = useDialogContext(CONTENT_NAME, __scopeDialog);
205
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, context.modal ? /* @__PURE__ */ React.createElement(DialogContentModal, __spreadProps(__spreadValues({}, contentProps), {
206
+ ref: forwardedRef
207
+ })) : /* @__PURE__ */ React.createElement(DialogContentNonModal, __spreadProps(__spreadValues({}, contentProps), {
208
+ ref: forwardedRef
209
+ })));
210
+ }));
211
+ DialogContent.displayName = CONTENT_NAME;
212
+ const DialogContentModal = React.forwardRef((_e, forwardedRef) => {
213
+ var _f = _e, { __scopeDialog, children } = _f, props = __objRest(_f, ["__scopeDialog", "children"]);
214
+ const context = useDialogContext(CONTENT_NAME, __scopeDialog);
215
+ const contentRef = React.useRef(null);
216
+ const composedRefs = (0, import_compose_refs.useComposedRefs)(forwardedRef, context.contentRef, contentRef);
217
+ React.useEffect(() => {
218
+ if (!context.open)
219
+ return;
220
+ const content = contentRef.current;
221
+ if (content)
222
+ return (0, import_aria_hidden.hideOthers)(content);
223
+ }, [context.open]);
224
+ return /* @__PURE__ */ React.createElement(DialogContentImpl, __spreadProps(__spreadValues({}, props), {
225
+ ref: composedRefs,
226
+ trapFocus: context.open,
227
+ disableOutsidePointerEvents: true,
228
+ onCloseAutoFocus: (0, import_core2.composeEventHandlers)(props.onCloseAutoFocus, (event) => {
229
+ var _a;
230
+ event.preventDefault();
231
+ (_a = context.triggerRef.current) == null ? void 0 : _a.focus();
232
+ }),
233
+ onPointerDownOutside: (0, import_core2.composeEventHandlers)(props.onPointerDownOutside, (event) => {
234
+ const originalEvent = event["detail"].originalEvent;
235
+ const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;
236
+ const isRightClick = originalEvent.button === 2 || ctrlLeftClick;
237
+ if (isRightClick)
238
+ event.preventDefault();
239
+ }),
240
+ onFocusOutside: (0, import_core2.composeEventHandlers)(props.onFocusOutside, (event) => event.preventDefault())
241
+ }), children);
242
+ });
243
+ const DialogContentNonModal = React.forwardRef((props, forwardedRef) => {
244
+ const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);
245
+ const hasInteractedOutsideRef = React.useRef(false);
246
+ return /* @__PURE__ */ React.createElement(DialogContentImpl, __spreadProps(__spreadValues({}, props), {
247
+ ref: forwardedRef,
248
+ trapFocus: false,
249
+ disableOutsidePointerEvents: false,
250
+ onCloseAutoFocus: (event) => {
251
+ var _a, _b;
252
+ (_a = props.onCloseAutoFocus) == null ? void 0 : _a.call(props, event);
253
+ if (!event.defaultPrevented) {
254
+ if (!hasInteractedOutsideRef.current)
255
+ (_b = context.triggerRef.current) == null ? void 0 : _b.focus();
256
+ event.preventDefault();
257
+ }
258
+ hasInteractedOutsideRef.current = false;
259
+ },
260
+ onInteractOutside: (event) => {
261
+ var _a;
262
+ (_a = props.onInteractOutside) == null ? void 0 : _a.call(props, event);
263
+ if (!event.defaultPrevented)
264
+ hasInteractedOutsideRef.current = true;
265
+ const target = event.target;
266
+ const trigger = context.triggerRef.current;
267
+ if (!(trigger instanceof HTMLElement))
268
+ return;
269
+ const targetIsTrigger = trigger.contains(target);
270
+ if (targetIsTrigger)
271
+ event.preventDefault();
272
+ }
273
+ }));
274
+ });
275
+ const DialogContentImpl = React.forwardRef((props, forwardedRef) => {
276
+ const _a = props, {
277
+ __scopeDialog,
278
+ trapFocus,
279
+ onOpenAutoFocus,
280
+ onCloseAutoFocus,
281
+ disableOutsidePointerEvents,
282
+ onEscapeKeyDown,
283
+ onPointerDownOutside,
284
+ onFocusOutside,
285
+ onInteractOutside
286
+ } = _a, contentProps = __objRest(_a, [
287
+ "__scopeDialog",
288
+ "trapFocus",
289
+ "onOpenAutoFocus",
290
+ "onCloseAutoFocus",
291
+ "disableOutsidePointerEvents",
292
+ "onEscapeKeyDown",
293
+ "onPointerDownOutside",
294
+ "onFocusOutside",
295
+ "onInteractOutside"
296
+ ]);
297
+ const context = useDialogContext(CONTENT_NAME, __scopeDialog);
298
+ const contentRef = React.useRef(null);
299
+ const composedRefs = (0, import_compose_refs.useComposedRefs)(forwardedRef, contentRef);
300
+ const showSheet = useShowDialogSheet(context);
301
+ const contents = /* @__PURE__ */ React.createElement(DialogContentFrame, __spreadValues({
302
+ id: context.contentId,
303
+ "aria-describedby": context.descriptionId,
304
+ "aria-labelledby": context.titleId,
305
+ "data-state": getState(context.open)
306
+ }, contentProps));
307
+ if (showSheet) {
308
+ return /* @__PURE__ */ React.createElement(import_portal.PortalItem, {
309
+ hostName: `${context.scopeKey}SheetContents`
310
+ }, contentProps.children);
311
+ }
312
+ if (!import_core2.isWeb) {
313
+ return contents;
314
+ }
315
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(import_focus_scope.FocusScope, {
316
+ loop: true,
317
+ trapped: trapFocus,
318
+ onMountAutoFocus: onOpenAutoFocus,
319
+ onUnmountAutoFocus: onCloseAutoFocus
320
+ }, /* @__PURE__ */ React.createElement(import_dismissable.Dismissable, {
321
+ disableOutsidePointerEvents,
322
+ onEscapeKeyDown,
323
+ onPointerDownOutside,
324
+ onFocusOutside,
325
+ onInteractOutside,
326
+ ref: composedRefs,
327
+ onDismiss: () => context.onOpenChange(false)
328
+ }, contents)), process.env.NODE_ENV === "development" && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(TitleWarning, {
329
+ titleId: context.titleId
330
+ }), /* @__PURE__ */ React.createElement(DescriptionWarning, {
331
+ contentRef,
332
+ descriptionId: context.descriptionId
333
+ })));
334
+ });
335
+ const SHEET_CONTENTS_NAME = "DialogSheetContents";
336
+ const DialogSheetContents = ({ __scopeDialog }) => {
337
+ const context = useDialogContext(SHEET_CONTENTS_NAME, __scopeDialog);
338
+ return /* @__PURE__ */ React.createElement(import_portal.PortalHost, {
339
+ name: `${context.scopeKey}SheetContents`
340
+ });
341
+ };
342
+ DialogSheetContents.displayName = SHEET_CONTENTS_NAME;
343
+ const TITLE_NAME = "DialogTitle";
344
+ const DialogTitleFrame = (0, import_core2.styled)(import_text.H2, {
345
+ name: TITLE_NAME
346
+ });
347
+ const DialogTitle = React.forwardRef((props, forwardedRef) => {
348
+ const _a = props, { __scopeDialog } = _a, titleProps = __objRest(_a, ["__scopeDialog"]);
349
+ const context = useDialogContext(TITLE_NAME, __scopeDialog);
350
+ return /* @__PURE__ */ React.createElement(DialogTitleFrame, __spreadProps(__spreadValues({
351
+ id: context.titleId
352
+ }, titleProps), {
353
+ ref: forwardedRef
354
+ }));
355
+ });
356
+ DialogTitle.displayName = TITLE_NAME;
357
+ const DialogDescriptionFrame = (0, import_core2.styled)(import_text.Paragraph, {
358
+ name: "DialogDescription"
359
+ });
360
+ const DESCRIPTION_NAME = "DialogDescription";
361
+ const DialogDescription = React.forwardRef((props, forwardedRef) => {
362
+ const _a = props, { __scopeDialog } = _a, descriptionProps = __objRest(_a, ["__scopeDialog"]);
363
+ const context = useDialogContext(DESCRIPTION_NAME, __scopeDialog);
364
+ return /* @__PURE__ */ React.createElement(DialogDescriptionFrame, __spreadProps(__spreadValues({
365
+ id: context.descriptionId
366
+ }, descriptionProps), {
367
+ ref: forwardedRef
368
+ }));
369
+ });
370
+ DialogDescription.displayName = DESCRIPTION_NAME;
371
+ const CLOSE_NAME = "DialogClose";
372
+ const DialogClose = React.forwardRef((props, forwardedRef) => {
373
+ const _a = props, { __scopeDialog } = _a, closeProps = __objRest(_a, ["__scopeDialog"]);
374
+ const context = useDialogContext(CLOSE_NAME, __scopeDialog);
375
+ const isSheet = useShowDialogSheet(context);
376
+ if (isSheet) {
377
+ return null;
378
+ }
379
+ return /* @__PURE__ */ React.createElement(import_stacks.YStack, __spreadProps(__spreadValues({
380
+ tag: "button"
381
+ }, closeProps), {
382
+ ref: forwardedRef,
383
+ onPress: (0, import_core2.composeEventHandlers)(props.onPress, () => context.onOpenChange(false))
384
+ }));
385
+ });
386
+ DialogClose.displayName = CLOSE_NAME;
387
+ function getState(open) {
388
+ return open ? "open" : "closed";
389
+ }
390
+ const TITLE_WARNING_NAME = "DialogTitleWarning";
391
+ const [WarningProvider, useWarningContext] = (0, import_create_context.createContext)(TITLE_WARNING_NAME, {
392
+ contentName: CONTENT_NAME,
393
+ titleName: TITLE_NAME,
394
+ docsSlug: "dialog"
395
+ });
396
+ const TitleWarning = ({ titleId }) => {
397
+ const titleWarningContext = useWarningContext(TITLE_WARNING_NAME);
398
+ const MESSAGE = `\`${titleWarningContext.contentName}\` requires a \`${titleWarningContext.titleName}\` for the component to be accessible for screen reader users.
399
+
400
+ If you want to hide the \`${titleWarningContext.titleName}\`, you can wrap it with our VisuallyHidden component.
401
+
402
+ For more information, see https://radix-ui.com/primitives/docs/components/${titleWarningContext.docsSlug}`;
403
+ React.useEffect(() => {
404
+ if (!import_core2.isWeb)
405
+ return;
406
+ if (titleId) {
407
+ const hasTitle = document.getElementById(titleId);
408
+ if (!hasTitle)
409
+ throw new Error(MESSAGE);
410
+ }
411
+ }, [MESSAGE, titleId]);
412
+ return null;
413
+ };
414
+ const DESCRIPTION_WARNING_NAME = "DialogDescriptionWarning";
415
+ const DescriptionWarning = ({ contentRef, descriptionId }) => {
416
+ const descriptionWarningContext = useWarningContext(DESCRIPTION_WARNING_NAME);
417
+ const MESSAGE = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${descriptionWarningContext.contentName}}.`;
418
+ React.useEffect(() => {
419
+ if (!import_core2.isWeb)
420
+ return;
421
+ const contentNode = contentRef.current;
422
+ if (!(contentNode instanceof HTMLElement)) {
423
+ return;
424
+ }
425
+ const describedById = contentNode.getAttribute("aria-describedby");
426
+ if (descriptionId && describedById) {
427
+ const hasDescription = document.getElementById(descriptionId);
428
+ if (!hasDescription)
429
+ console.warn(MESSAGE);
430
+ }
431
+ }, [MESSAGE, contentRef, descriptionId]);
432
+ return null;
433
+ };
434
+ const DialogInner = React.forwardRef(function Dialog(props, ref) {
435
+ const {
436
+ __scopeDialog,
437
+ children,
438
+ open: openProp,
439
+ defaultOpen = false,
440
+ onOpenChange,
441
+ modal = true,
442
+ allowPinchZoom = false,
443
+ sheetBreakpoint = false
444
+ } = props;
445
+ const triggerRef = React.useRef(null);
446
+ const contentRef = React.useRef(null);
447
+ const [open, setOpen] = (0, import_use_controllable_state.useControllableState)({
448
+ prop: openProp,
449
+ defaultProp: defaultOpen,
450
+ onChange: onOpenChange
451
+ });
452
+ React.useImperativeHandle(ref, () => ({
453
+ open: setOpen
454
+ }), [setOpen]);
455
+ return /* @__PURE__ */ React.createElement(DialogProvider, {
456
+ scope: __scopeDialog,
457
+ scopeKey: __scopeDialog ? Object.keys(__scopeDialog)[0] : "",
458
+ triggerRef,
459
+ contentRef,
460
+ contentId: (0, import_core2.useId)() || "",
461
+ titleId: (0, import_core2.useId)() || "",
462
+ descriptionId: (0, import_core2.useId)() || "",
463
+ open,
464
+ onOpenChange: setOpen,
465
+ onOpenToggle: React.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),
466
+ modal,
467
+ allowPinchZoom,
468
+ sheetBreakpoint
469
+ }, /* @__PURE__ */ React.createElement(DialogSheetController, {
470
+ onChangeOpen: setOpen,
471
+ __scopeDialog
472
+ }, children));
473
+ });
474
+ const Dialog2 = (0, import_core2.withStaticProperties)(DialogInner, {
475
+ Trigger: DialogTrigger,
476
+ Portal: DialogPortal,
477
+ Overlay: DialogOverlay,
478
+ Content: DialogContent,
479
+ Title: DialogTitle,
480
+ Description: DialogDescription,
481
+ Close: DialogClose,
482
+ SheetContents: DialogSheetContents,
483
+ Sheet: import_sheet.Sheet
484
+ });
485
+ const DialogSheetController = (props) => {
486
+ const context = useDialogContext("DialogSheetController", props.__scopeDialog);
487
+ const showSheet = useShowDialogSheet(context);
488
+ const breakpointActive = useDialogBreakpointActive(context);
489
+ const getShowSheet = (0, import_core.useGet)(showSheet);
490
+ return /* @__PURE__ */ React.createElement(import_sheet.SheetController, {
491
+ onChangeOpen: (val) => {
492
+ if (getShowSheet()) {
493
+ props.onChangeOpen(val);
494
+ }
495
+ },
496
+ open: context.open,
497
+ hidden: breakpointActive === false
498
+ }, props.children);
499
+ };
500
+ const useDialogBreakpointActive = (context) => {
501
+ const media = (0, import_core2.useMedia)();
502
+ return context.sheetBreakpoint ? media[context.sheetBreakpoint] : false;
503
+ };
504
+ const useShowDialogSheet = (context) => {
505
+ const breakpointActive = useDialogBreakpointActive(context);
506
+ return context.open === false ? false : breakpointActive;
507
+ };
508
+ // Annotate the CommonJS export names for ESM import in node:
509
+ 0 && (module.exports = {
510
+ Dialog,
511
+ DialogClose,
512
+ DialogContent,
513
+ DialogDescription,
514
+ DialogOverlay,
515
+ DialogPortal,
516
+ DialogPortalFrame,
517
+ DialogSheetContents,
518
+ DialogTitle,
519
+ DialogTrigger,
520
+ WarningProvider,
521
+ createDialogScope
522
+ });
523
+ //# sourceMappingURL=Dialog.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/Dialog.tsx"],
4
+ "sourcesContent": ["import { AnimatePresence } from '@tamagui/animate-presence'\nimport { useComposedRefs } from '@tamagui/compose-refs'\nimport { useGet } from '@tamagui/core'\nimport {\n GetProps,\n MediaPropKeys,\n Slot,\n Theme,\n composeEventHandlers,\n isWeb,\n styled,\n useId,\n useMedia,\n useThemeName,\n withStaticProperties,\n} from '@tamagui/core'\nimport { Scope, createContext, createContextScope } from '@tamagui/create-context'\nimport { Dismissable, DismissableProps } from '@tamagui/dismissable'\nimport { FocusScope, FocusScopeProps } from '@tamagui/focus-scope'\nimport { PortalHost, PortalItem, PortalItemProps } from '@tamagui/portal'\nimport { Sheet, SheetController } from '@tamagui/sheet'\nimport { ThemeableStack, YStack, YStackProps } from '@tamagui/stacks'\nimport { H2, Paragraph } from '@tamagui/text'\nimport { useControllableState } from '@tamagui/use-controllable-state'\nimport { hideOthers } from 'aria-hidden'\nimport * as React from 'react'\nimport { View } from 'react-native'\nimport { RemoveScroll } from 'react-remove-scroll'\n\nconst DIALOG_NAME = 'Dialog'\n\ntype ScopedProps<P> = P & { __scopeDialog?: Scope }\ntype TamaguiElement = HTMLElement | View\n\nconst [createDialogContext, createDialogScope] = createContextScope(DIALOG_NAME)\n\ninterface DialogProps {\n sheetBreakpoint?: MediaPropKeys | false\n children?: React.ReactNode\n open?: boolean\n defaultOpen?: boolean\n onOpenChange?(open: boolean): void\n modal?: boolean\n\n /**\n * @see https://github.com/theKashey/react-remove-scroll#usage\n */\n allowPinchZoom?: RemoveScrollProps['allowPinchZoom']\n}\n\ntype NonNull<A> = Exclude<A, void | null>\n\ntype DialogContextValue = {\n triggerRef: React.RefObject<TamaguiElement>\n contentRef: React.RefObject<TamaguiElement>\n contentId: string\n titleId: string\n descriptionId: string\n onOpenToggle(): void\n open: NonNull<DialogProps['open']>\n onOpenChange: NonNull<DialogProps['onOpenChange']>\n modal: NonNull<DialogProps['modal']>\n allowPinchZoom: NonNull<DialogProps['allowPinchZoom']>\n sheetBreakpoint: NonNull<DialogProps['sheetBreakpoint']>\n scopeKey: string\n}\n\nconst [DialogProvider, useDialogContext] = createDialogContext<DialogContextValue>(DIALOG_NAME)\n\ntype RemoveScrollProps = React.ComponentProps<typeof RemoveScroll>\n\n/* -------------------------------------------------------------------------------------------------\n * DialogTrigger\n * -----------------------------------------------------------------------------------------------*/\n\nconst TRIGGER_NAME = 'DialogTrigger'\n\nconst DialogTriggerFrame = styled(YStack, {\n name: TRIGGER_NAME,\n})\n\ninterface DialogTriggerProps extends YStackProps {}\n\nconst DialogTrigger = React.forwardRef<TamaguiElement, DialogTriggerProps>(\n (props: ScopedProps<DialogTriggerProps>, forwardedRef) => {\n const { __scopeDialog, ...triggerProps } = props\n const context = useDialogContext(TRIGGER_NAME, __scopeDialog)\n const composedTriggerRef = useComposedRefs(forwardedRef, context.triggerRef)\n return (\n <DialogTriggerFrame\n tag=\"button\"\n aria-haspopup=\"dialog\"\n aria-expanded={context.open}\n aria-controls={context.contentId}\n data-state={getState(context.open)}\n {...triggerProps}\n ref={composedTriggerRef}\n onPress={composeEventHandlers(props.onPress, context.onOpenToggle)}\n />\n )\n }\n)\n\nDialogTrigger.displayName = TRIGGER_NAME\n\n/* -------------------------------------------------------------------------------------------------\n * DialogPortal\n * -----------------------------------------------------------------------------------------------*/\n\nconst PORTAL_NAME = 'DialogPortal'\n\ntype PortalContextValue = { forceMount?: true }\nconst [PortalProvider, usePortalContext] = createDialogContext<PortalContextValue>(PORTAL_NAME, {\n forceMount: undefined,\n})\n\ntype DialogPortalProps = Omit<PortalItemProps, 'asChild'> &\n YStackProps & {\n /**\n * Used to force mounting when more control is needed. Useful when\n * controlling animation with React animation libraries.\n */\n forceMount?: true\n }\n\nexport const DialogPortalFrame = styled(YStack, {\n alignItems: 'center',\n justifyContent: 'center',\n fullscreen: true,\n zIndex: 100,\n ...(isWeb && {\n maxHeight: '100vh',\n }),\n})\n\nconst DialogPortal: React.FC<DialogPortalProps> = DialogPortalFrame.extractable(\n (props: ScopedProps<DialogPortalProps>) => {\n const { __scopeDialog, forceMount, children, ...frameProps } = props\n const themeName = useThemeName()\n const context = useDialogContext(PORTAL_NAME, __scopeDialog)\n const isShowing = forceMount || context.open\n const contents = <AnimatePresence>{isShowing ? children : null}</AnimatePresence>\n const isSheet = useShowDialogSheet(context)\n if (!context.modal || isSheet) {\n return contents\n }\n return (\n <PortalItem>\n {/* have to re-propogate context, sketch */}\n <DialogProvider scope={__scopeDialog} {...context}>\n <Theme name={themeName}>\n <PortalProvider scope={__scopeDialog} forceMount={forceMount}>\n <DialogPortalFrame pointerEvents={isShowing ? 'auto' : 'none'} {...frameProps}>\n {contents}\n </DialogPortalFrame>\n </PortalProvider>\n </Theme>\n </DialogProvider>\n </PortalItem>\n )\n }\n)\n\nDialogPortal.displayName = PORTAL_NAME\n\n/* -------------------------------------------------------------------------------------------------\n * DialogOverlay\n * -----------------------------------------------------------------------------------------------*/\n\nconst OVERLAY_NAME = 'DialogOverlay'\n\nconst DialogOverlayFrame = styled(ThemeableStack, {\n name: OVERLAY_NAME,\n pointerEvents: 'auto',\n backgrounded: true,\n fullscreen: true,\n})\n\ninterface DialogOverlayProps extends YStackProps {\n /**\n * Used to force mounting when more control is needed. Useful when\n * controlling animation with React animation libraries.\n */\n forceMount?: true\n}\n\nconst DialogOverlay = React.forwardRef<TamaguiElement, DialogOverlayProps>(\n ({ __scopeDialog, ...props }: ScopedProps<DialogOverlayProps>, forwardedRef) => {\n const portalContext = usePortalContext(OVERLAY_NAME, __scopeDialog)\n const { forceMount = portalContext.forceMount, ...overlayProps } = props\n const context = useDialogContext(OVERLAY_NAME, __scopeDialog)\n const showSheet = useShowDialogSheet(context)\n\n if (!forceMount) {\n if (!context.modal || showSheet) {\n return null\n }\n }\n\n return <DialogOverlayImpl {...overlayProps} ref={forwardedRef} />\n }\n)\n\nDialogOverlay.displayName = OVERLAY_NAME\n\ntype DialogOverlayImplProps = GetProps<typeof DialogOverlayFrame>\n\nconst DialogOverlayImpl = React.forwardRef<TamaguiElement, DialogOverlayImplProps>(\n (props: ScopedProps<DialogOverlayImplProps>, forwardedRef) => {\n const { __scopeDialog, ...overlayProps } = props\n const context = useDialogContext(OVERLAY_NAME, __scopeDialog)\n const content = (\n <DialogOverlayFrame\n data-state={getState(context.open)}\n // We re-enable pointer-events prevented by `Dialog.Content` to allow scrolling the overlay.\n pointerEvents=\"auto\"\n {...overlayProps}\n ref={forwardedRef}\n />\n )\n\n if (!isWeb) {\n return content\n }\n\n return (\n // Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`\n // ie. when `Overlay` and `Content` are siblings\n <RemoveScroll as={Slot} allowPinchZoom={context.allowPinchZoom} shards={[context.contentRef]}>\n {content}\n </RemoveScroll>\n )\n }\n)\n\n/* -------------------------------------------------------------------------------------------------\n * DialogContent\n * -----------------------------------------------------------------------------------------------*/\n\nconst CONTENT_NAME = 'DialogContent'\n\nconst DialogContentFrame = styled(ThemeableStack, {\n name: CONTENT_NAME,\n tag: 'dialog',\n pointerEvents: 'auto',\n position: 'relative',\n backgrounded: true,\n padded: true,\n radiused: true,\n elevate: true,\n\n variants: {\n size: {\n '...size': (val, extras) => {\n return {}\n },\n },\n },\n\n defaultVariants: {\n size: '$4',\n },\n})\n\ntype DialogContentFrameProps = GetProps<typeof DialogContentFrame>\n\ninterface DialogContentProps extends DialogContentFrameProps, DialogContentTypeProps {\n /**\n * Used to force mounting when more control is needed. Useful when\n * controlling animation with React animation libraries.\n */\n forceMount?: true\n}\n\nconst DialogContent = DialogContentFrame.extractable(\n React.forwardRef<TamaguiElement, DialogContentProps>(\n ({ __scopeDialog, ...props }: ScopedProps<DialogContentProps>, forwardedRef) => {\n const portalContext = usePortalContext(CONTENT_NAME, __scopeDialog)\n const { forceMount = portalContext.forceMount, ...contentProps } = props\n const context = useDialogContext(CONTENT_NAME, __scopeDialog)\n\n return (\n <>\n {context.modal ? (\n <DialogContentModal {...contentProps} ref={forwardedRef} />\n ) : (\n <DialogContentNonModal {...contentProps} ref={forwardedRef} />\n )}\n </>\n )\n }\n )\n)\n\nDialogContent.displayName = CONTENT_NAME\n\n/* -----------------------------------------------------------------------------------------------*/\n\ninterface DialogContentTypeProps\n extends Omit<DialogContentImplProps, 'trapFocus' | 'disableOutsidePointerEvents'> {}\n\nconst DialogContentModal = React.forwardRef<TamaguiElement, DialogContentTypeProps>(\n ({ __scopeDialog, children, ...props }: ScopedProps<DialogContentTypeProps>, forwardedRef) => {\n const context = useDialogContext(CONTENT_NAME, __scopeDialog)\n const contentRef = React.useRef<HTMLDivElement>(null)\n const composedRefs = useComposedRefs(forwardedRef, context.contentRef, contentRef)\n\n // aria-hide everything except the content (better supported equivalent to setting aria-modal)\n React.useEffect(() => {\n if (!context.open) return\n const content = contentRef.current\n if (content) return hideOthers(content)\n }, [context.open])\n\n return (\n <DialogContentImpl\n {...props}\n ref={composedRefs}\n // we make sure focus isn't trapped once `DialogContent` has been closed\n // (closed !== unmounted when animating out)\n trapFocus={context.open}\n disableOutsidePointerEvents\n onCloseAutoFocus={composeEventHandlers(props.onCloseAutoFocus, (event) => {\n event.preventDefault()\n context.triggerRef.current?.focus()\n })}\n onPointerDownOutside={composeEventHandlers(props.onPointerDownOutside, (event) => {\n const originalEvent = event['detail'].originalEvent\n const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true\n const isRightClick = originalEvent.button === 2 || ctrlLeftClick\n // If the event is a right-click, we shouldn't close because\n // it is effectively as if we right-clicked the `Overlay`.\n if (isRightClick) event.preventDefault()\n })}\n // When focus is trapped, a `focusout` event may still happen.\n // We make sure we don't trigger our `onDismiss` in such case.\n onFocusOutside={composeEventHandlers(props.onFocusOutside, (event) =>\n event.preventDefault()\n )}\n >\n {children}\n </DialogContentImpl>\n )\n }\n)\n\n/* -----------------------------------------------------------------------------------------------*/\n\nconst DialogContentNonModal = React.forwardRef<TamaguiElement, DialogContentTypeProps>(\n (props: ScopedProps<DialogContentTypeProps>, forwardedRef) => {\n const context = useDialogContext(CONTENT_NAME, props.__scopeDialog)\n const hasInteractedOutsideRef = React.useRef(false)\n\n return (\n <DialogContentImpl\n {...props}\n ref={forwardedRef}\n trapFocus={false}\n disableOutsidePointerEvents={false}\n onCloseAutoFocus={(event) => {\n props.onCloseAutoFocus?.(event)\n\n if (!event.defaultPrevented) {\n if (!hasInteractedOutsideRef.current) context.triggerRef.current?.focus()\n // Always prevent auto focus because we either focus manually or want user agent focus\n event.preventDefault()\n }\n\n hasInteractedOutsideRef.current = false\n }}\n onInteractOutside={(event) => {\n props.onInteractOutside?.(event)\n\n if (!event.defaultPrevented) hasInteractedOutsideRef.current = true\n\n // Prevent dismissing when clicking the trigger.\n // As the trigger is already setup to close, without doing so would\n // cause it to close and immediately open.\n //\n // We use `onInteractOutside` as some browsers also\n // focus on pointer down, creating the same issue.\n const target = event.target as HTMLElement\n const trigger = context.triggerRef.current\n if (!(trigger instanceof HTMLElement)) return\n const targetIsTrigger = trigger.contains(target)\n if (targetIsTrigger) event.preventDefault()\n }}\n />\n )\n }\n)\n\n/* -----------------------------------------------------------------------------------------------*/\n\ntype DialogContentImplProps = DialogContentFrameProps &\n Omit<DismissableProps, 'onDismiss'> & {\n /**\n * When `true`, focus cannot escape the `Content` via keyboard,\n * pointer, or a programmatic focus.\n * @defaultValue false\n */\n trapFocus?: FocusScopeProps['trapped']\n\n /**\n * Event handler called when auto-focusing on open.\n * Can be prevented.\n */\n onOpenAutoFocus?: FocusScopeProps['onMountAutoFocus']\n\n /**\n * Event handler called when auto-focusing on close.\n * Can be prevented.\n */\n onCloseAutoFocus?: FocusScopeProps['onUnmountAutoFocus']\n }\n\nconst DialogContentImpl = React.forwardRef<TamaguiElement, DialogContentImplProps>(\n (props: ScopedProps<DialogContentImplProps>, forwardedRef) => {\n const {\n __scopeDialog,\n trapFocus,\n onOpenAutoFocus,\n onCloseAutoFocus,\n disableOutsidePointerEvents,\n onEscapeKeyDown,\n onPointerDownOutside,\n onFocusOutside,\n onInteractOutside,\n ...contentProps\n } = props\n const context = useDialogContext(CONTENT_NAME, __scopeDialog)\n const contentRef = React.useRef<HTMLDivElement>(null)\n const composedRefs = useComposedRefs(forwardedRef, contentRef)\n const showSheet = useShowDialogSheet(context)\n\n const contents = (\n <DialogContentFrame\n id={context.contentId}\n aria-describedby={context.descriptionId}\n aria-labelledby={context.titleId}\n data-state={getState(context.open)}\n {...contentProps}\n />\n )\n\n if (showSheet) {\n return (\n <PortalItem hostName={`${context.scopeKey}SheetContents`}>\n {contentProps.children}\n </PortalItem>\n )\n }\n\n if (!isWeb) {\n return contents\n }\n\n return (\n <>\n <FocusScope\n loop\n trapped={trapFocus}\n onMountAutoFocus={onOpenAutoFocus}\n onUnmountAutoFocus={onCloseAutoFocus}\n >\n <Dismissable\n disableOutsidePointerEvents={disableOutsidePointerEvents}\n onEscapeKeyDown={onEscapeKeyDown}\n onPointerDownOutside={onPointerDownOutside}\n onFocusOutside={onFocusOutside}\n onInteractOutside={onInteractOutside}\n // @ts-ignore\n ref={composedRefs}\n onDismiss={() => context.onOpenChange(false)}\n >\n {contents}\n </Dismissable>\n </FocusScope>\n {process.env.NODE_ENV === 'development' && (\n <>\n <TitleWarning titleId={context.titleId} />\n <DescriptionWarning contentRef={contentRef} descriptionId={context.descriptionId} />\n </>\n )}\n </>\n )\n }\n)\n\n/* -------------------------------------------------------------------------------------------------\n * DialogSheetContents\n * -----------------------------------------------------------------------------------------------*/\n\nconst SHEET_CONTENTS_NAME = 'DialogSheetContents'\n\nexport const DialogSheetContents = ({ __scopeDialog }: ScopedProps<{}>) => {\n const context = useDialogContext(SHEET_CONTENTS_NAME, __scopeDialog)\n return <PortalHost name={`${context.scopeKey}SheetContents`}></PortalHost>\n}\n\nDialogSheetContents.displayName = SHEET_CONTENTS_NAME\n\n/* -------------------------------------------------------------------------------------------------\n * DialogTitle\n * -----------------------------------------------------------------------------------------------*/\n\nconst TITLE_NAME = 'DialogTitle'\nconst DialogTitleFrame = styled(H2, {\n name: TITLE_NAME,\n})\n\ntype DialogTitleProps = GetProps<typeof DialogTitleFrame>\n\nconst DialogTitle = React.forwardRef<TamaguiElement, DialogTitleProps>(\n (props: ScopedProps<DialogTitleProps>, forwardedRef) => {\n const { __scopeDialog, ...titleProps } = props\n const context = useDialogContext(TITLE_NAME, __scopeDialog)\n return <DialogTitleFrame id={context.titleId} {...titleProps} ref={forwardedRef} />\n }\n)\n\nDialogTitle.displayName = TITLE_NAME\n\n/* -------------------------------------------------------------------------------------------------\n * DialogDescription\n * -----------------------------------------------------------------------------------------------*/\n\nconst DialogDescriptionFrame = styled(Paragraph, {\n name: 'DialogDescription',\n})\n\ntype DialogDescriptionProps = GetProps<typeof DialogDescriptionFrame>\n\nconst DESCRIPTION_NAME = 'DialogDescription'\n\nconst DialogDescription = React.forwardRef<TamaguiElement, DialogDescriptionProps>(\n (props: ScopedProps<DialogDescriptionProps>, forwardedRef) => {\n const { __scopeDialog, ...descriptionProps } = props\n const context = useDialogContext(DESCRIPTION_NAME, __scopeDialog)\n return (\n <DialogDescriptionFrame id={context.descriptionId} {...descriptionProps} ref={forwardedRef} />\n )\n }\n)\n\nDialogDescription.displayName = DESCRIPTION_NAME\n\n/* -------------------------------------------------------------------------------------------------\n * DialogClose\n * -----------------------------------------------------------------------------------------------*/\n\nconst CLOSE_NAME = 'DialogClose'\n\ntype DialogCloseProps = YStackProps\n\nconst DialogClose = React.forwardRef<TamaguiElement, DialogCloseProps>(\n (props: ScopedProps<DialogCloseProps>, forwardedRef) => {\n const { __scopeDialog, ...closeProps } = props\n const context = useDialogContext(CLOSE_NAME, __scopeDialog)\n const isSheet = useShowDialogSheet(context)\n\n if (isSheet) {\n return null\n }\n\n return (\n <YStack\n tag=\"button\"\n {...closeProps}\n ref={forwardedRef}\n onPress={composeEventHandlers(props.onPress, () => context.onOpenChange(false))}\n />\n )\n }\n)\n\nDialogClose.displayName = CLOSE_NAME\n\n/* -----------------------------------------------------------------------------------------------*/\n\nfunction getState(open: boolean) {\n return open ? 'open' : 'closed'\n}\n\nconst TITLE_WARNING_NAME = 'DialogTitleWarning'\n\nconst [WarningProvider, useWarningContext] = createContext(TITLE_WARNING_NAME, {\n contentName: CONTENT_NAME,\n titleName: TITLE_NAME,\n docsSlug: 'dialog',\n})\n\ntype TitleWarningProps = { titleId?: string }\n\nconst TitleWarning: React.FC<TitleWarningProps> = ({ titleId }) => {\n const titleWarningContext = useWarningContext(TITLE_WARNING_NAME)\n\n const MESSAGE = `\\`${titleWarningContext.contentName}\\` requires a \\`${titleWarningContext.titleName}\\` for the component to be accessible for screen reader users.\n\nIf you want to hide the \\`${titleWarningContext.titleName}\\`, you can wrap it with our VisuallyHidden component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/${titleWarningContext.docsSlug}`\n\n React.useEffect(() => {\n if (!isWeb) return\n if (titleId) {\n const hasTitle = document.getElementById(titleId)\n if (!hasTitle) throw new Error(MESSAGE)\n }\n }, [MESSAGE, titleId])\n\n return null\n}\n\nconst DESCRIPTION_WARNING_NAME = 'DialogDescriptionWarning'\n\ntype DescriptionWarningProps = {\n contentRef: React.RefObject<TamaguiElement>\n descriptionId?: string\n}\n\nconst DescriptionWarning: React.FC<DescriptionWarningProps> = ({ contentRef, descriptionId }) => {\n const descriptionWarningContext = useWarningContext(DESCRIPTION_WARNING_NAME)\n const MESSAGE = `Warning: Missing \\`Description\\` or \\`aria-describedby={undefined}\\` for {${descriptionWarningContext.contentName}}.`\n\n React.useEffect(() => {\n if (!isWeb) return\n const contentNode = contentRef.current\n if (!(contentNode instanceof HTMLElement)) {\n return\n }\n const describedById = contentNode.getAttribute('aria-describedby')\n // if we have an id and the user hasn't set aria-describedby={undefined}\n if (descriptionId && describedById) {\n const hasDescription = document.getElementById(descriptionId)\n if (!hasDescription) console.warn(MESSAGE)\n }\n }, [MESSAGE, contentRef, descriptionId])\n\n return null\n}\n\n/* -------------------------------------------------------------------------------------------------\n * Dialog\n * -----------------------------------------------------------------------------------------------*/\n\nconst DialogInner = React.forwardRef<{ open: (val: boolean) => void }, DialogProps>(function Dialog(\n props: ScopedProps<DialogProps>,\n ref\n) {\n const {\n __scopeDialog,\n children,\n open: openProp,\n defaultOpen = false,\n onOpenChange,\n modal = true,\n allowPinchZoom = false,\n sheetBreakpoint = false,\n } = props\n const triggerRef = React.useRef<HTMLButtonElement>(null)\n const contentRef = React.useRef<TamaguiElement>(null)\n const [open, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen,\n onChange: onOpenChange,\n })\n\n React.useImperativeHandle(\n ref,\n () => ({\n open: setOpen,\n }),\n [setOpen]\n )\n\n return (\n <DialogProvider\n scope={__scopeDialog}\n scopeKey={__scopeDialog ? Object.keys(__scopeDialog)[0] : ''}\n triggerRef={triggerRef}\n contentRef={contentRef}\n contentId={useId() || ''}\n titleId={useId() || ''}\n descriptionId={useId() || ''}\n open={open}\n onOpenChange={setOpen}\n onOpenToggle={React.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen])}\n modal={modal}\n allowPinchZoom={allowPinchZoom}\n sheetBreakpoint={sheetBreakpoint}\n >\n <DialogSheetController onChangeOpen={setOpen} __scopeDialog={__scopeDialog}>\n {children}\n </DialogSheetController>\n </DialogProvider>\n )\n})\n\nconst Dialog = withStaticProperties(DialogInner, {\n Trigger: DialogTrigger,\n Portal: DialogPortal,\n Overlay: DialogOverlay,\n Content: DialogContent,\n Title: DialogTitle,\n Description: DialogDescription,\n Close: DialogClose,\n SheetContents: DialogSheetContents,\n Sheet,\n})\n\nconst DialogSheetController = (\n props: ScopedProps<{}> & {\n children: React.ReactNode\n onChangeOpen: React.Dispatch<React.SetStateAction<boolean>>\n }\n) => {\n const context = useDialogContext('DialogSheetController', props.__scopeDialog)\n const showSheet = useShowDialogSheet(context)\n const breakpointActive = useDialogBreakpointActive(context)\n const getShowSheet = useGet(showSheet)\n return (\n <SheetController\n onChangeOpen={(val) => {\n if (getShowSheet()) {\n props.onChangeOpen(val)\n }\n }}\n open={context.open}\n hidden={breakpointActive === false}\n >\n {props.children}\n </SheetController>\n )\n}\n\nconst useDialogBreakpointActive = (context: DialogContextValue) => {\n const media = useMedia()\n return context.sheetBreakpoint ? media[context.sheetBreakpoint] : false\n}\n\nconst useShowDialogSheet = (context: DialogContextValue) => {\n const breakpointActive = useDialogBreakpointActive(context)\n return context.open === false ? false : breakpointActive\n}\n\nexport {\n createDialogScope,\n //\n Dialog,\n DialogTrigger,\n DialogPortal,\n DialogOverlay,\n DialogContent,\n DialogTitle,\n DialogDescription,\n DialogClose,\n //\n WarningProvider,\n}\nexport type {\n DialogProps,\n DialogTriggerProps,\n DialogPortalProps,\n DialogOverlayProps,\n DialogContentProps,\n DialogTitleProps,\n DialogDescriptionProps,\n DialogCloseProps,\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,8BAAgC;AAChC,0BAAgC;AAChC,kBAAuB;AACvB,mBAYO;AACP,4BAAyD;AACzD,yBAA8C;AAC9C,yBAA4C;AAC5C,oBAAwD;AACxD,mBAAuC;AACvC,oBAAoD;AACpD,kBAA8B;AAC9B,oCAAqC;AACrC,yBAA2B;AAC3B,YAAuB;AAEvB,iCAA6B;AAE7B,MAAM,cAAc;AAKpB,MAAM,CAAC,qBAAqB,qBAAqB,8CAAmB,WAAW;AAiC/E,MAAM,CAAC,gBAAgB,oBAAoB,oBAAwC,WAAW;AAQ9F,MAAM,eAAe;AAErB,MAAM,qBAAqB,yBAAO,sBAAQ;AAAA,EACxC,MAAM;AACR,CAAC;AAID,MAAM,gBAAgB,MAAM,WAC1B,CAAC,OAAwC,iBAAiB;AACxD,QAA2C,YAAnC,oBAAmC,IAAjB,yBAAiB,IAA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AI,aAAa,GAAG;AAClB,cAAM,aAAa,GAAG;AAAA,MACxB;AAAA,IACF;AAAA,IACA,MAAM,QAAQ;AAAA,IACd,QAAQ,qBAAqB;AAAA,KAE5B,MAAM,QACT;AAEJ;AAEA,MAAM,4BAA4B,CAAC,YAAgC;AACjE,QAAM,QAAQ,2BAAS;AACvB,SAAO,QAAQ,kBAAkB,MAAM,QAAQ,mBAAmB;AACpE;AAEA,MAAM,qBAAqB,CAAC,YAAgC;AAC1D,QAAM,mBAAmB,0BAA0B,OAAO;AAC1D,SAAO,QAAQ,SAAS,QAAQ,QAAQ;AAC1C;",
6
+ "names": []
7
+ }
@@ -0,0 +1,18 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __copyProps = (to, from, except, desc) => {
6
+ if (from && typeof from === "object" || typeof from === "function") {
7
+ for (let key of __getOwnPropNames(from))
8
+ if (!__hasOwnProp.call(to, key) && key !== except)
9
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
10
+ }
11
+ return to;
12
+ };
13
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+ var src_exports = {};
16
+ module.exports = __toCommonJS(src_exports);
17
+ __reExport(src_exports, require("./AlertDialog"), module.exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/index.ts"],
4
+ "sourcesContent": ["export * from './AlertDialog'\n"],
5
+ "mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA,wBAAc,0BAAd;",
6
+ "names": []
7
+ }