UNPKG

19.5 kBSource Map (JSON)View Raw
1{"version":3,"sources":["../src/reach-dialog.tsx"],"sourcesContent":["/* eslint-disable jsx-a11y/no-static-element-interactions */\n\n/**\n * Welcome to @reach/dialog!\n *\n * An accessible dialog or \"modal\" window.\n *\n * @see Docs https://reach.tech/dialog\n * @see Source https://github.com/reach/reach-ui/tree/main/packages/dialog\n * @see WAI-ARIA https://www.w3.org/TR/wai-aria-practices-1.2/#dialog_modal\n */\n\nimport * as React from \"react\";\nimport { Portal } from \"@reach/portal\";\nimport type { PortalProps } from \"@reach/portal\";\nimport {\n\tcomposeEventHandlers,\n\tcreateContext,\n\tgetOwnerDocument,\n\tnoop,\n\tuseComposedRefs,\n} from \"@reach/utils\";\nimport type * as Polymorphic from \"@reach/polymorphic\";\nimport FocusLock from \"react-focus-lock\";\nimport { RemoveScroll } from \"react-remove-scroll\";\n\ndeclare const __DEV__: boolean;\n\nenum DialogState {\n\tOpening = \"opening\",\n\tOpen = \"open\",\n\tClosing = \"closing\",\n\tClosed = \"closed\",\n}\n\ninterface DialogContextValue {\n\tisOpen: boolean;\n}\nconst [DialogContextProvider, useDialogContext] =\n\tcreateContext<DialogContextValue>(\"DialogContext\", {\n\t\tisOpen: false,\n\t});\n\n////////////////////////////////////////////////////////////////////////////////\n\n/**\n * DialogWrapper\n *\n * Low-level component if you need direct access to the portaled dialog wrapper.\n *\n * Note: You must render a `DialogInner` inside.\n */\nfunction DialogWrapper({\n\tisOpen = true,\n\tchildren,\n\t...props\n}: DialogWrapperProps) {\n\t// We want to ignore the immediate focus of a tooltip so it doesn't pop\n\t// up again when the menu closes, only pops up when focus returns again\n\t// to the tooltip (like native OS tooltips).\n\tReact.useEffect(() => {\n\t\tif (isOpen) {\n\t\t\t// @ts-ignore\n\t\t\twindow.__REACH_DISABLE_TOOLTIPS = true;\n\t\t} else {\n\t\t\twindow.requestAnimationFrame(() => {\n\t\t\t\t// Wait a frame so that this doesn't fire before tooltip does\n\t\t\t\t// @ts-ignore\n\t\t\t\twindow.__REACH_DISABLE_TOOLTIPS = false;\n\t\t\t});\n\t\t}\n\t}, [isOpen]);\n\n\treturn (\n\t\t<Portal\n\t\t\tdata-reach-dialog-wrapper=\"\"\n\t\t\tdata-state={isOpen ? DialogState.Open : DialogState.Closed}\n\t\t\t{...props}\n\t\t>\n\t\t\t<DialogContextProvider isOpen={isOpen}>{children}</DialogContextProvider>\n\t\t</Portal>\n\t);\n}\n\nDialogWrapper.displayName = \"unstable_DialogWrapper\";\n\ninterface DialogWrapperProps extends PortalProps {\n\t/**\n\t * Controls whether or not the dialog is open.\n\t */\n\tisOpen?: boolean;\n}\n\n////////////////////////////////////////////////////////////////////////////////\n\n/**\n * DialogInner\n *\n * Low-level component if you need direct access to the portaled dialog wrapper.\n *\n * Note: Must be rendered inside of a `DialogWrapper`.\n *\n * @see Docs https://reach.tech/dialog#dialoginner\n */\nconst DialogInner = React.forwardRef(function DialogInner(\n\t{\n\t\tallowPinchZoom,\n\t\tas: Comp = \"div\",\n\t\tdangerouslyBypassFocusLock,\n\n\t\t// TODO: Consider removing in favor of `lockScroll`, default to `true`.\n\t\tdangerouslyBypassScrollLock,\n\t\tinitialFocusRef,\n\t\tonClick,\n\t\tonDismiss = noop,\n\t\tonKeyDown,\n\t\tonMouseDown,\n\t\tunstable_lockFocusAcrossFrames,\n\t\t...props\n\t},\n\tforwardedRef\n) {\n\tlet { isOpen } = useDialogContext(\"DialogInner\");\n\tlet lockFocusAcrossFramesIsDefined =\n\t\tunstable_lockFocusAcrossFrames !== undefined;\n\n\tif (__DEV__) {\n\t\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\t\tReact.useEffect(() => {\n\t\t\tif (lockFocusAcrossFramesIsDefined) {\n\t\t\t\tconsole.warn(\n\t\t\t\t\t`The unstable_lockFocusAcrossFrames in @reach/dialog is deprecated. It will be removed in the next minor release.`\n\t\t\t\t);\n\t\t\t}\n\t\t}, [lockFocusAcrossFramesIsDefined]);\n\t}\n\n\tconst mouseDownTarget = React.useRef<EventTarget | null>(null);\n\tconst overlayNode = React.useRef<HTMLDivElement | null>(null);\n\tconst ref = useComposedRefs(overlayNode, forwardedRef);\n\n\tconst activateFocusLock = React.useCallback(() => {\n\t\tif (initialFocusRef && initialFocusRef.current) {\n\t\t\tinitialFocusRef.current.focus();\n\t\t}\n\t}, [initialFocusRef]);\n\n\tfunction handleClick(event: React.MouseEvent) {\n\t\tif (mouseDownTarget.current === event.target) {\n\t\t\tevent.stopPropagation();\n\t\t\tonDismiss(event);\n\t\t}\n\t}\n\n\tfunction handleKeyDown(event: React.KeyboardEvent) {\n\t\tif (event.key === \"Escape\") {\n\t\t\tevent.stopPropagation();\n\t\t\tonDismiss(event);\n\t\t}\n\t}\n\n\tfunction handleMouseDown(event: React.MouseEvent) {\n\t\tmouseDownTarget.current = event.target;\n\t}\n\n\tReact.useEffect(() => {\n\t\treturn overlayNode.current\n\t\t\t? createAriaHider(overlayNode.current)\n\t\t\t: void null;\n\t}, []);\n\n\treturn (\n\t\t<FocusLock\n\t\t\tautoFocus\n\t\t\treturnFocus\n\t\t\tonActivation={activateFocusLock}\n\t\t\tdisabled={\n\t\t\t\tdangerouslyBypassFocusLock != null\n\t\t\t\t\t? dangerouslyBypassFocusLock\n\t\t\t\t\t: !isOpen\n\t\t\t}\n\t\t\tcrossFrame={unstable_lockFocusAcrossFrames ?? true}\n\t\t>\n\t\t\t<RemoveScroll\n\t\t\t\tallowPinchZoom={allowPinchZoom}\n\t\t\t\tenabled={\n\t\t\t\t\tdangerouslyBypassScrollLock != null\n\t\t\t\t\t\t? !dangerouslyBypassScrollLock\n\t\t\t\t\t\t: isOpen\n\t\t\t\t}\n\t\t\t>\n\t\t\t\t<Comp\n\t\t\t\t\t{...props}\n\t\t\t\t\tref={ref}\n\t\t\t\t\tdata-reach-dialog-inner=\"\"\n\t\t\t\t\tdata-state={isOpen ? DialogState.Open : DialogState.Closed}\n\t\t\t\t\t/*\n\t\t\t\t\t * We can ignore the `no-static-element-interactions` warning here\n\t\t\t\t\t * because our overlay is only designed to capture any outside\n\t\t\t\t\t * clicks, not to serve as a clickable element itself.\n\t\t\t\t\t */\n\t\t\t\t\tonClick={composeEventHandlers(onClick, handleClick)}\n\t\t\t\t\tonKeyDown={composeEventHandlers(onKeyDown, handleKeyDown)}\n\t\t\t\t\tonMouseDown={composeEventHandlers(onMouseDown, handleMouseDown)}\n\t\t\t\t/>\n\t\t\t</RemoveScroll>\n\t\t</FocusLock>\n\t);\n}) as Polymorphic.ForwardRefComponent<\"div\", DialogOverlayProps>;\n\nDialogInner.displayName = \"DialogInner\";\n\n////////////////////////////////////////////////////////////////////////////////\n\n/**\n * DialogOverlay\n *\n * Low-level component if you need more control over the styles or rendering of\n * the dialog overlay.\n *\n * Note: You must render a `DialogContent` inside.\n *\n * @see Docs https://reach.tech/dialog#dialogoverlay\n */\nconst DialogOverlay = React.forwardRef(function DialogOverlay(\n\t{ as: Comp = \"div\", isOpen = true, ...props },\n\tforwardedRef\n) {\n\treturn isOpen ? (\n\t\t<DialogWrapper isOpen={isOpen}>\n\t\t\t<DialogInner\n\t\t\t\tdata-reach-dialog-overlay=\"\"\n\t\t\t\tref={forwardedRef}\n\t\t\t\tas={Comp}\n\t\t\t\t{...props}\n\t\t\t/>\n\t\t</DialogWrapper>\n\t) : null;\n}) as Polymorphic.ForwardRefComponent<\"div\", DialogOverlayProps>;\n\nDialogOverlay.displayName = \"DialogOverlay\";\n\ninterface DialogOverlayProps extends DialogProps {\n\t/**\n\t * By default the dialog locks the focus inside it. Normally this is what you\n\t * want. This prop is provided so that this feature can be disabled. This,\n\t * however, is strongly discouraged.\n\t *\n\t * The reason it is provided is not to disable the focus lock entirely.\n\t * Rather, there are certain situations where you may need more control on how\n\t * the focus lock works. This should be complemented by setting up a focus\n\t * lock yourself that would allow more flexibility for your specific use case.\n\t *\n\t * If you do set this prop to `true`, make sure you set up your own\n\t * `FocusLock` component. You can likely use\n\t * `react-focus-lock`, which is what Reach uses internally by default. It has\n\t * various settings to allow more customization, but it takes care of a lot of\n\t * hard work that you probably don't want or need to do.\n\t *\n\t * @see Docs https://reach.tech/dialog#dialogoverlay-dangerouslybypassfocuslock\n\t * @see https://github.com/theKashey/react-focus-lock\n\t * @see https://github.com/reach/reach-ui/issues/615\n\t */\n\tdangerouslyBypassFocusLock?: boolean;\n\t/**\n\t * By default the dialog locks scrolling with `react-remove-scroll`, which\n\t * also injects some styles on the body element to remove the scrollbar while\n\t * maintaining its gap to prevent jank when the dialog's open state is\n\t * toggled. This is almost always what you want in a dialog, but in some cases\n\t * you may have the need to customize this behavior further.\n\t *\n\t * This prop will disable `react-remove-scroll` and allow you to compose your\n\t * own scroll lock component to meet your needs. Like the\n\t * `dangerouslyBypassFocusLock` prop, this is generally discouraged and should\n\t * only be used if a proper fallback for managing scroll behavior is provided.\n\t *\n\t * @see Docs https://reach.tech/dialog#dialogoverlay-dangerouslybypassscrolllock\n\t * @see https://github.com/theKashey/react-remove-scroll\n\t */\n\tdangerouslyBypassScrollLock?: boolean;\n}\n\n////////////////////////////////////////////////////////////////////////////////\n\n/**\n * DialogContent\n *\n * Low-level component if you need more control over the styles or rendering of\n * the dialog content.\n *\n * Note: Must be a child of `DialogOverlay`.\n *\n * Note: You only need to use this when you are also styling `DialogOverlay`,\n * otherwise you can use the high-level `Dialog` component and pass the props\n * to it. Any props passed to `Dialog` component (besides `isOpen` and\n * `onDismiss`) will be spread onto `DialogContent`.\n *\n * @see Docs https://reach.tech/dialog#dialogcontent\n */\nconst DialogContent = React.forwardRef(function DialogContent(\n\t{ as: Comp = \"div\", onClick, onKeyDown, ...props },\n\tforwardedRef\n) {\n\tlet { isOpen } = useDialogContext(\"DialogContent\");\n\treturn (\n\t\t<Comp\n\t\t\taria-modal=\"true\"\n\t\t\trole=\"dialog\"\n\t\t\ttabIndex={-1}\n\t\t\t{...props}\n\t\t\tref={forwardedRef}\n\t\t\tdata-reach-dialog-content=\"\"\n\t\t\tdata-state={isOpen ? DialogState.Open : DialogState.Closed}\n\t\t\tonClick={composeEventHandlers(onClick, (event) => {\n\t\t\t\tevent.stopPropagation();\n\t\t\t})}\n\t\t/>\n\t);\n}) as Polymorphic.ForwardRefComponent<\"div\", DialogContentProps>;\n\n/**\n * @see Docs https://reach.tech/dialog#dialogcontent-props\n */\ninterface DialogContentProps {\n\t/**\n\t * Accepts any renderable content.\n\t *\n\t * @see Docs https://reach.tech/dialog#dialogcontent-children\n\t */\n\tchildren?: React.ReactNode;\n}\n\nDialogContent.displayName = \"DialogContent\";\n\n////////////////////////////////////////////////////////////////////////////////\n\n/**\n * Dialog\n *\n * High-level component to render a modal dialog window over the top of the page\n * (or another dialog).\n *\n * @see Docs https://reach.tech/dialog#dialog\n */\nconst Dialog = React.forwardRef(function Dialog(\n\t{\n\t\tallowPinchZoom = false,\n\t\tinitialFocusRef,\n\t\tisOpen,\n\t\tonDismiss = noop,\n\t\t...props\n\t},\n\tforwardedRef\n) {\n\treturn (\n\t\t<DialogOverlay\n\t\t\tallowPinchZoom={allowPinchZoom}\n\t\t\tinitialFocusRef={initialFocusRef}\n\t\t\tisOpen={isOpen}\n\t\t\tonDismiss={onDismiss}\n\t\t>\n\t\t\t<DialogContent ref={forwardedRef} {...props} />\n\t\t</DialogOverlay>\n\t);\n}) as Polymorphic.ForwardRefComponent<\"div\", DialogProps>;\n\n/**\n * @see Docs https://reach.tech/dialog#dialog-props\n */\ninterface DialogProps {\n\t/**\n\t * Handle zoom/pinch gestures on iOS devices when scroll locking is enabled.\n\t * Defaults to `false`.\n\t *\n\t * @see Docs https://reach.tech/dialog#dialog-allowpinchzoom\n\t */\n\tallowPinchZoom?: boolean;\n\t/**\n\t * Accepts any renderable content.\n\t *\n\t * @see Docs https://reach.tech/dialog#dialog-children\n\t */\n\tchildren?: React.ReactNode;\n\n\t/**\n\t * By default the first focusable element will receive focus when the dialog\n\t * opens but you can provide a ref to focus instead.\n\t *\n\t * @see Docs https://reach.tech/dialog#dialog-initialfocusref\n\t */\n\tinitialFocusRef?: React.RefObject<any>;\n\t/**\n\t * Controls whether or not the dialog is open.\n\t *\n\t * @see Docs https://reach.tech/dialog#dialog-isopen\n\t */\n\tisOpen?: boolean;\n\t/**\n\t * This function is called whenever the user hits \"Escape\" or clicks outside\n\t * the dialog. _It's important to close the dialog `onDismiss`_.\n\t *\n\t * The only time you shouldn't close the dialog on dismiss is when the dialog\n\t * requires a choice and none of them are \"cancel\". For example, perhaps two\n\t * records need to be merged and the user needs to pick the surviving record.\n\t * Neither choice is less destructive than the other, so in these cases you\n\t * may want to alert the user they need to a make a choice on dismiss instead\n\t * of closing the dialog.\n\t *\n\t * @see Docs https://reach.tech/dialog#dialog-ondismiss\n\t */\n\tonDismiss?(event: React.MouseEvent | React.KeyboardEvent): void;\n\t/**\n\t * By default, React Focus Lock prevents focus from being moved outside of the\n\t * locked element even if the thing trying to take focus is in another frame.\n\t * Normally this is what you want, as an iframe is typically going to be a\n\t * part of your page content. But in some situations, like when using Code\n\t * Sandbox, you can't use any of the controls or the editor in the sandbox\n\t * while dialog is open because of the focus lock.\n\t *\n\t * This prop may have some negative side effects and unintended consequences,\n\t * and it opens questions about how we might distinguish frames that *should*\n\t * steal focus from those that shouldn't. Perhaps it's best for app devs to\n\t * decide, and if they use this prop we should advise them to imperatively\n\t * assign a -1 tabIndex to other iframes that are a part of the page content\n\t * when the dialog is open.\n\t *\n\t * https://github.com/reach/reach-ui/issues/536\n\t *\n\t * @deprecated\n\t */\n\tunstable_lockFocusAcrossFrames?: boolean;\n}\n\nDialog.displayName = \"Dialog\";\n\n////////////////////////////////////////////////////////////////////////////////\n\nfunction createAriaHider(dialogNode: HTMLElement) {\n\tlet originalValues: any[] = [];\n\tlet rootNodes: HTMLElement[] = [];\n\tlet ownerDocument = getOwnerDocument(dialogNode)!;\n\n\tif (!dialogNode) {\n\t\tif (__DEV__) {\n\t\t\tconsole.warn(\n\t\t\t\t\"A ref has not yet been attached to a dialog node when attempting to call `createAriaHider`.\"\n\t\t\t);\n\t\t}\n\t\treturn noop;\n\t}\n\n\tArray.prototype.forEach.call(\n\t\townerDocument.querySelectorAll(\"body > *\"),\n\t\t(node) => {\n\t\t\tconst portalNode = dialogNode.parentNode?.parentNode?.parentNode;\n\t\t\tif (node === portalNode) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tlet attr = node.getAttribute(\"aria-hidden\");\n\t\t\tlet alreadyHidden = attr !== null && attr !== \"false\";\n\t\t\tif (alreadyHidden) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\toriginalValues.push(attr);\n\t\t\trootNodes.push(node);\n\t\t\tnode.setAttribute(\"aria-hidden\", \"true\");\n\t\t}\n\t);\n\n\treturn () => {\n\t\trootNodes.forEach((node, index) => {\n\t\t\tlet originalValue = originalValues[index];\n\t\t\tif (originalValue === null) {\n\t\t\t\tnode.removeAttribute(\"aria-hidden\");\n\t\t\t} else {\n\t\t\t\tnode.setAttribute(\"aria-hidden\", originalValue);\n\t\t\t}\n\t\t});\n\t};\n}\n\n////////////////////////////////////////////////////////////////////////////////\n// Exports\n\nexport type {\n\tDialogWrapperProps as unstable_DialogWrapperProps,\n\tDialogContentProps,\n\tDialogOverlayProps,\n\tDialogOverlayProps as DialogInnerProps,\n\tDialogProps,\n};\nexport {\n\tDialogWrapper as unstable_DialogWrapper,\n\tDialog,\n\tDialogContent,\n\tDialogInner,\n\tDialogOverlay,\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAYA,YAAuB;AACvB,oBAAuB;AAEvB,mBAMO;AAEP,8BAAsB;AACtB,iCAA6B;AAc7B,IAAM,CAAC,uBAAuB,oBAC7B,gCAAkC,iBAAiB;AAAA,EAClD,QAAQ;AACT,CAAC;AAWF,uBAAuB,IAIA;AAJA,eACtB;AAAA,aAAS;AAAA,IACT;AAAA,MAFsB,IAGnB,kBAHmB,IAGnB;AAAA,IAF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