@tamagui/dialog 1.0.1-beta.100

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,302 @@
1
+ import { AnimatePresence } from "@tamagui/animate-presence";
2
+ import { useComposedRefs } from "@tamagui/compose-refs";
3
+ import {
4
+ Slot,
5
+ Theme,
6
+ composeEventHandlers,
7
+ isWeb,
8
+ styled,
9
+ useId,
10
+ useThemeName,
11
+ withStaticProperties
12
+ } from "@tamagui/core";
13
+ import { createContext, createContextScope } from "@tamagui/create-context";
14
+ import { Dismissable } from "@tamagui/dismissable";
15
+ import { FocusScope } from "@tamagui/focus-scope";
16
+ import { Portal } from "@tamagui/portal";
17
+ import { ThemeableStack, YStack } from "@tamagui/stacks";
18
+ import { H2, Paragraph } from "@tamagui/text";
19
+ import { useControllableState } from "@tamagui/use-controllable-state";
20
+ import { hideOthers } from "aria-hidden";
21
+ import * as React from "react";
22
+ import { RemoveScroll } from "react-remove-scroll";
23
+ const DIALOG_NAME = "Dialog";
24
+ const [createDialogContext, createDialogScope] = createContextScope(DIALOG_NAME);
25
+ const [DialogProvider, useDialogContext] = createDialogContext(DIALOG_NAME);
26
+ const TRIGGER_NAME = "DialogTrigger";
27
+ const DialogTriggerFrame = styled(YStack, {
28
+ name: TRIGGER_NAME
29
+ });
30
+ const DialogTrigger = React.forwardRef((props, forwardedRef) => {
31
+ const { __scopeDialog, ...triggerProps } = props;
32
+ const context = useDialogContext(TRIGGER_NAME, __scopeDialog);
33
+ const composedTriggerRef = useComposedRefs(forwardedRef, context.triggerRef);
34
+ return <DialogTriggerFrame tag="button" aria-haspopup="dialog" aria-expanded={context.open} aria-controls={context.contentId} data-state={getState(context.open)} {...triggerProps} ref={composedTriggerRef} onPress={composeEventHandlers(props.onPress, context.onOpenToggle)} />;
35
+ });
36
+ DialogTrigger.displayName = TRIGGER_NAME;
37
+ const PORTAL_NAME = "DialogPortal";
38
+ const [PortalProvider, usePortalContext] = createDialogContext(PORTAL_NAME, {
39
+ forceMount: void 0
40
+ });
41
+ const DialogPortal = (props) => {
42
+ const { __scopeDialog, forceMount, children, ...rest } = props;
43
+ const themeName = useThemeName();
44
+ const context = useDialogContext(PORTAL_NAME, __scopeDialog);
45
+ const isShowing = forceMount || context.open;
46
+ const contents = <AnimatePresence>{isShowing ? children : null}</AnimatePresence>;
47
+ if (!context.modal) {
48
+ return contents;
49
+ }
50
+ if (!isWeb && !isShowing) {
51
+ return contents;
52
+ }
53
+ return <PortalProvider scope={__scopeDialog} forceMount={forceMount}><Portal alignItems="center" justifyContent="center" zIndex={100} pointerEvents={isShowing ? "auto" : "none"} {...isWeb && {
54
+ maxHeight: "100vh"
55
+ }} {...rest}><Theme name={themeName}>{contents}</Theme></Portal></PortalProvider>;
56
+ };
57
+ DialogPortal.displayName = PORTAL_NAME;
58
+ const OVERLAY_NAME = "DialogOverlay";
59
+ const DialogOverlayFrame = styled(ThemeableStack, {
60
+ name: OVERLAY_NAME,
61
+ pointerEvents: "auto",
62
+ backgrounded: true,
63
+ fullscreen: true
64
+ });
65
+ const DialogOverlay = React.forwardRef(({ __scopeDialog, ...props }, forwardedRef) => {
66
+ const portalContext = usePortalContext(OVERLAY_NAME, __scopeDialog);
67
+ const { forceMount = portalContext.forceMount, ...overlayProps } = props;
68
+ const context = useDialogContext(OVERLAY_NAME, __scopeDialog);
69
+ if (!context.modal) {
70
+ return null;
71
+ }
72
+ return <DialogOverlayImpl {...overlayProps} ref={forwardedRef} />;
73
+ });
74
+ DialogOverlay.displayName = OVERLAY_NAME;
75
+ const DialogOverlayImpl = React.forwardRef((props, forwardedRef) => {
76
+ const { __scopeDialog, ...overlayProps } = props;
77
+ const context = useDialogContext(OVERLAY_NAME, __scopeDialog);
78
+ const content = <DialogOverlayFrame data-state={getState(context.open)} pointerEvents="auto" {...overlayProps} ref={forwardedRef} />;
79
+ if (!isWeb) {
80
+ return content;
81
+ }
82
+ return <RemoveScroll as={Slot} allowPinchZoom={context.allowPinchZoom} shards={[context.contentRef]}>{content}</RemoveScroll>;
83
+ });
84
+ const CONTENT_NAME = "DialogContent";
85
+ const DialogContentFrame = styled(ThemeableStack, {
86
+ name: CONTENT_NAME,
87
+ tag: "dialog",
88
+ pointerEvents: "auto",
89
+ position: "relative",
90
+ backgrounded: true,
91
+ padded: true,
92
+ radiused: true,
93
+ elevate: true,
94
+ variants: {
95
+ size: {
96
+ "...size": (val, extras) => {
97
+ return {};
98
+ }
99
+ }
100
+ },
101
+ defaultVariants: {
102
+ size: "$4"
103
+ }
104
+ });
105
+ const DialogContent = React.forwardRef(({ __scopeDialog, ...props }, forwardedRef) => {
106
+ const portalContext = usePortalContext(CONTENT_NAME, __scopeDialog);
107
+ const { forceMount = portalContext.forceMount, ...contentProps } = props;
108
+ const context = useDialogContext(CONTENT_NAME, __scopeDialog);
109
+ return <>{context.modal ? <DialogContentModal {...contentProps} ref={forwardedRef} /> : <DialogContentNonModal {...contentProps} ref={forwardedRef} />}</>;
110
+ });
111
+ DialogContent.displayName = CONTENT_NAME;
112
+ const DialogContentModal = React.forwardRef(({ __scopeDialog, ...props }, forwardedRef) => {
113
+ const context = useDialogContext(CONTENT_NAME, __scopeDialog);
114
+ const contentRef = React.useRef(null);
115
+ const composedRefs = useComposedRefs(forwardedRef, context.contentRef, contentRef);
116
+ React.useEffect(() => {
117
+ if (!context.open)
118
+ return;
119
+ const content = contentRef.current;
120
+ if (content)
121
+ return hideOthers(content);
122
+ }, [context.open]);
123
+ return <DialogContentImpl {...props} ref={composedRefs} trapFocus={context.open} disableOutsidePointerEvents onCloseAutoFocus={composeEventHandlers(props.onCloseAutoFocus, (event) => {
124
+ var _a;
125
+ event.preventDefault();
126
+ (_a = context.triggerRef.current) == null ? void 0 : _a.focus();
127
+ })} onPointerDownOutside={composeEventHandlers(props.onPointerDownOutside, (event) => {
128
+ const originalEvent = event["detail"].originalEvent;
129
+ const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;
130
+ const isRightClick = originalEvent.button === 2 || ctrlLeftClick;
131
+ if (isRightClick)
132
+ event.preventDefault();
133
+ })} onFocusOutside={composeEventHandlers(props.onFocusOutside, (event) => event.preventDefault())} />;
134
+ });
135
+ const DialogContentNonModal = React.forwardRef((props, forwardedRef) => {
136
+ const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);
137
+ const hasInteractedOutsideRef = React.useRef(false);
138
+ return <DialogContentImpl {...props} ref={forwardedRef} trapFocus={false} disableOutsidePointerEvents={false} onCloseAutoFocus={(event) => {
139
+ var _a, _b;
140
+ (_a = props.onCloseAutoFocus) == null ? void 0 : _a.call(props, event);
141
+ if (!event.defaultPrevented) {
142
+ if (!hasInteractedOutsideRef.current)
143
+ (_b = context.triggerRef.current) == null ? void 0 : _b.focus();
144
+ event.preventDefault();
145
+ }
146
+ hasInteractedOutsideRef.current = false;
147
+ }} onInteractOutside={(event) => {
148
+ var _a;
149
+ (_a = props.onInteractOutside) == null ? void 0 : _a.call(props, event);
150
+ if (!event.defaultPrevented)
151
+ hasInteractedOutsideRef.current = true;
152
+ const target = event.target;
153
+ const trigger = context.triggerRef.current;
154
+ if (!(trigger instanceof HTMLElement))
155
+ return;
156
+ const targetIsTrigger = trigger.contains(target);
157
+ if (targetIsTrigger)
158
+ event.preventDefault();
159
+ }} />;
160
+ });
161
+ const DialogContentImpl = React.forwardRef((props, forwardedRef) => {
162
+ const {
163
+ __scopeDialog,
164
+ trapFocus,
165
+ onOpenAutoFocus,
166
+ onCloseAutoFocus,
167
+ disableOutsidePointerEvents,
168
+ onEscapeKeyDown,
169
+ onPointerDownOutside,
170
+ onFocusOutside,
171
+ onInteractOutside,
172
+ ...contentProps
173
+ } = props;
174
+ const context = useDialogContext(CONTENT_NAME, __scopeDialog);
175
+ const contentRef = React.useRef(null);
176
+ const composedRefs = useComposedRefs(forwardedRef, contentRef);
177
+ return <>
178
+ <FocusScope loop trapped={trapFocus} onMountAutoFocus={onOpenAutoFocus} onUnmountAutoFocus={onCloseAutoFocus}><Dismissable disableOutsidePointerEvents={disableOutsidePointerEvents} onEscapeKeyDown={onEscapeKeyDown} onPointerDownOutside={onPointerDownOutside} onFocusOutside={onFocusOutside} onInteractOutside={onInteractOutside} ref={composedRefs} onDismiss={() => context.onOpenChange(false)}><DialogContentFrame id={context.contentId} aria-describedby={context.descriptionId} aria-labelledby={context.titleId} data-state={getState(context.open)} {...contentProps} /></Dismissable></FocusScope>
179
+ {process.env.NODE_ENV === "development" && <>
180
+ <TitleWarning titleId={context.titleId} />
181
+ <DescriptionWarning contentRef={contentRef} descriptionId={context.descriptionId} />
182
+ </>}
183
+ </>;
184
+ });
185
+ const TITLE_NAME = "DialogTitle";
186
+ const DialogTitleFrame = styled(H2, {
187
+ name: TITLE_NAME
188
+ });
189
+ const DialogTitle = React.forwardRef((props, forwardedRef) => {
190
+ const { __scopeDialog, ...titleProps } = props;
191
+ const context = useDialogContext(TITLE_NAME, __scopeDialog);
192
+ return <DialogTitleFrame id={context.titleId} {...titleProps} ref={forwardedRef} />;
193
+ });
194
+ DialogTitle.displayName = TITLE_NAME;
195
+ const DialogDescriptionFrame = styled(Paragraph, {
196
+ name: "DialogDescription"
197
+ });
198
+ const DESCRIPTION_NAME = "DialogDescription";
199
+ const DialogDescription = React.forwardRef((props, forwardedRef) => {
200
+ const { __scopeDialog, ...descriptionProps } = props;
201
+ const context = useDialogContext(DESCRIPTION_NAME, __scopeDialog);
202
+ return <DialogDescriptionFrame id={context.descriptionId} {...descriptionProps} ref={forwardedRef} />;
203
+ });
204
+ DialogDescription.displayName = DESCRIPTION_NAME;
205
+ const CLOSE_NAME = "DialogClose";
206
+ const DialogClose = React.forwardRef((props, forwardedRef) => {
207
+ const { __scopeDialog, ...closeProps } = props;
208
+ const context = useDialogContext(CLOSE_NAME, __scopeDialog);
209
+ return <YStack tag="button" {...closeProps} ref={forwardedRef} onPress={composeEventHandlers(props.onPress, () => context.onOpenChange(false))} />;
210
+ });
211
+ DialogClose.displayName = CLOSE_NAME;
212
+ function getState(open) {
213
+ return open ? "open" : "closed";
214
+ }
215
+ const TITLE_WARNING_NAME = "DialogTitleWarning";
216
+ const [WarningProvider, useWarningContext] = createContext(TITLE_WARNING_NAME, {
217
+ contentName: CONTENT_NAME,
218
+ titleName: TITLE_NAME,
219
+ docsSlug: "dialog"
220
+ });
221
+ const TitleWarning = ({ titleId }) => {
222
+ const titleWarningContext = useWarningContext(TITLE_WARNING_NAME);
223
+ const MESSAGE = `\`${titleWarningContext.contentName}\` requires a \`${titleWarningContext.titleName}\` for the component to be accessible for screen reader users.
224
+
225
+ If you want to hide the \`${titleWarningContext.titleName}\`, you can wrap it with our VisuallyHidden component.
226
+
227
+ For more information, see https://radix-ui.com/primitives/docs/components/${titleWarningContext.docsSlug}`;
228
+ React.useEffect(() => {
229
+ if (!isWeb)
230
+ return;
231
+ if (titleId) {
232
+ const hasTitle = document.getElementById(titleId);
233
+ if (!hasTitle)
234
+ throw new Error(MESSAGE);
235
+ }
236
+ }, [MESSAGE, titleId]);
237
+ return null;
238
+ };
239
+ const DESCRIPTION_WARNING_NAME = "DialogDescriptionWarning";
240
+ const DescriptionWarning = ({ contentRef, descriptionId }) => {
241
+ const descriptionWarningContext = useWarningContext(DESCRIPTION_WARNING_NAME);
242
+ const MESSAGE = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${descriptionWarningContext.contentName}}.`;
243
+ React.useEffect(() => {
244
+ if (!isWeb)
245
+ return;
246
+ const contentNode = contentRef.current;
247
+ if (!(contentNode instanceof HTMLElement)) {
248
+ return;
249
+ }
250
+ const describedById = contentNode.getAttribute("aria-describedby");
251
+ if (descriptionId && describedById) {
252
+ const hasDescription = document.getElementById(descriptionId);
253
+ if (!hasDescription)
254
+ console.warn(MESSAGE);
255
+ }
256
+ }, [MESSAGE, contentRef, descriptionId]);
257
+ return null;
258
+ };
259
+ const DialogInner = React.forwardRef(function Dialog(props, ref) {
260
+ const {
261
+ __scopeDialog,
262
+ children,
263
+ open: openProp,
264
+ defaultOpen = false,
265
+ onOpenChange,
266
+ modal = true,
267
+ allowPinchZoom = false
268
+ } = props;
269
+ const triggerRef = React.useRef(null);
270
+ const contentRef = React.useRef(null);
271
+ const [open, setOpen] = useControllableState({
272
+ prop: openProp,
273
+ defaultProp: defaultOpen,
274
+ onChange: onOpenChange
275
+ });
276
+ React.useImperativeHandle(ref, () => ({
277
+ open: setOpen
278
+ }), [setOpen]);
279
+ return <DialogProvider scope={__scopeDialog} triggerRef={triggerRef} contentRef={contentRef} contentId={useId() || ""} titleId={useId() || ""} descriptionId={useId() || ""} open={open} onOpenChange={setOpen} onOpenToggle={React.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen])} modal={modal} allowPinchZoom={allowPinchZoom}>{children}</DialogProvider>;
280
+ });
281
+ const Dialog2 = withStaticProperties(DialogInner, {
282
+ Trigger: DialogTrigger,
283
+ Portal: DialogPortal,
284
+ Overlay: DialogOverlay,
285
+ Content: DialogContent,
286
+ Title: DialogTitle,
287
+ Description: DialogDescription,
288
+ Close: DialogClose
289
+ });
290
+ export {
291
+ Dialog2 as Dialog,
292
+ DialogClose,
293
+ DialogContent,
294
+ DialogDescription,
295
+ DialogOverlay,
296
+ DialogPortal,
297
+ DialogTitle,
298
+ DialogTrigger,
299
+ WarningProvider,
300
+ createDialogScope
301
+ };
302
+ //# 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 {\n GetProps,\n Slot,\n Theme,\n composeEventHandlers,\n isWeb,\n styled,\n useId,\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 { Portal, PortalProps } from '@tamagui/portal'\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\ntype DialogContextValue = {\n triggerRef: React.RefObject<TamaguiElement>\n contentRef: React.RefObject<TamaguiElement>\n contentId: string\n titleId: string\n descriptionId: string\n open: boolean\n onOpenChange(open: boolean): void\n onOpenToggle(): void\n modal: boolean\n allowPinchZoom: boolean\n}\n\nconst [DialogProvider, useDialogContext] = createDialogContext<DialogContextValue>(DIALOG_NAME)\n\ntype RemoveScrollProps = React.ComponentProps<typeof RemoveScroll>\n\ninterface DialogProps {\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\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\ninterface DialogPortalProps extends Omit<PortalProps, 'asChild'> {\n children?: React.ReactNode\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 DialogPortal: React.FC<DialogPortalProps> = (props: ScopedProps<DialogPortalProps>) => {\n const { __scopeDialog, forceMount, children, ...rest } = 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 if (!context.modal) {\n return contents\n }\n if (!isWeb && !isShowing) {\n return contents\n }\n return (\n <PortalProvider scope={__scopeDialog} forceMount={forceMount}>\n <Portal\n alignItems=\"center\"\n justifyContent=\"center\"\n zIndex={100}\n pointerEvents={isShowing ? 'auto' : 'none'}\n {...(isWeb && {\n maxHeight: '100vh',\n })}\n {...rest}\n >\n <Theme name={themeName}>{contents}</Theme>\n </Portal>\n </PortalProvider>\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\n if (!context.modal) {\n return null\n }\n\n // <AnimatePresence>\n return <DialogOverlayImpl {...overlayProps} ref={forwardedRef} />\n // </AnimatePresence>\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 = 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 return (\n <>\n {context.modal ? (\n <DialogContentModal {...contentProps} ref={forwardedRef} />\n ) : (\n <DialogContentNonModal {...contentProps} ref={forwardedRef} />\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, ...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 )\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\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 <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 </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 * 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 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 } = 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 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 >\n {children}\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})\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;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAWA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAEA,MAAM,cAAc;AAKpB,MAAM,CAAC,qBAAqB,qBAAqB,mBAAmB,WAAW;AAe/E,MAAM,CAAC,gBAAgB,oBAAoB,oBAAwC,WAAW;AAqB9F,MAAM,eAAe;AAErB,MAAM,qBAAqB,OAAO,QAAQ;AAAA,EACxC,MAAM;AACR,CAAC;AAID,MAAM,gBAAgB,MAAM,WAC1B,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AO;AAAA,IACL,MAAM;AAAA,EACR,IACA,CAAC,OAAO,CACV;AAEA,SACE,CAAC,eACC,OAAO,eACP,YAAY,YACZ,YAAY,YACZ,WAAW,MAAM,KAAK,IACtB,SAAS,MAAM,KAAK,IACpB,eAAe,MAAM,KAAK,IAC1B,MAAM,MACN,cAAc,SACd,cAAc,MAAM,YAAY,MAAM,QAAQ,CAAC,aAAa,CAAC,QAAQ,GAAG,CAAC,OAAO,CAAC,GACjF,OAAO,OACP,gBAAgB,iBAEf,SACH,EAdC;AAgBL,CAAC;AAED,MAAM,UAAS,qBAAqB,aAAa;AAAA,EAC/C,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,SAAS;AAAA,EACT,OAAO;AAAA,EACP,aAAa;AAAA,EACb,OAAO;AACT,CAAC;",
6
+ "names": []
7
+ }
@@ -0,0 +1,2 @@
1
+ export * from "./Dialog";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/index.ts"],
4
+ "sourcesContent": ["export * from './Dialog'\n"],
5
+ "mappings": "AAAA;",
6
+ "names": []
7
+ }
package/package.json ADDED
@@ -0,0 +1,55 @@
1
+ {
2
+ "name": "@tamagui/dialog",
3
+ "version": "1.0.1-beta.100",
4
+ "source": "src/index.ts",
5
+ "types": "./types/index.d.ts",
6
+ "main": "dist/cjs",
7
+ "module": "dist/esm",
8
+ "module:jsx": "dist/jsx",
9
+ "sideEffects": [
10
+ "*.css"
11
+ ],
12
+ "files": [
13
+ "src",
14
+ "types",
15
+ "dist"
16
+ ],
17
+ "scripts": {
18
+ "build": "tamagui-build",
19
+ "watch": "tamagui-build --watch",
20
+ "clean": "tamagui-build clean",
21
+ "clean:build": "tamagui-build clean:build"
22
+ },
23
+ "dependencies": {
24
+ "@tamagui/animate-presence": "^1.0.1-beta.100",
25
+ "@tamagui/compose-refs": "^1.0.1-beta.100",
26
+ "@tamagui/core": "^1.0.1-beta.100",
27
+ "@tamagui/create-context": "^1.0.1-beta.100",
28
+ "@tamagui/dismissable": "^1.0.1-beta.100",
29
+ "@tamagui/focus-scope": "^1.0.1-beta.100",
30
+ "@tamagui/polyfill-dev": "^1.0.1-beta.100",
31
+ "@tamagui/popper": "^1.0.1-beta.100",
32
+ "@tamagui/portal": "^1.0.1-beta.100",
33
+ "@tamagui/stacks": "^1.0.1-beta.100",
34
+ "@tamagui/text": "^1.0.1-beta.100",
35
+ "@tamagui/use-controllable-state": "^1.0.1-beta.100",
36
+ "aria-hidden": "^1.1.3",
37
+ "react-remove-scroll": "^2.5.5"
38
+ },
39
+ "peerDependencies": {
40
+ "react": "*",
41
+ "react-dom": "*",
42
+ "react-native": "*"
43
+ },
44
+ "devDependencies": {
45
+ "@tamagui/build": "^1.0.1-beta.100",
46
+ "@types/react-dom": "^18.0.3",
47
+ "@types/react-native": "^0.67.3",
48
+ "react": "*",
49
+ "react-dom": "*",
50
+ "react-native": "*"
51
+ },
52
+ "publishConfig": {
53
+ "access": "public"
54
+ }
55
+ }