|
1 | 1 | // WAI-ARIA: https://www.w3.org/WAI/ARIA/apg/patterns/dialogmodal/
|
2 | 2 | import React, {
|
| 3 | + ContextType, |
3 | 4 | createContext,
|
4 | 5 | createRef,
|
| 6 | + ElementType, |
| 7 | + MouseEvent as ReactMouseEvent, |
| 8 | + MutableRefObject, |
| 9 | + Ref, |
| 10 | + RefObject, |
5 | 11 | useCallback,
|
6 | 12 | useContext,
|
7 | 13 | useEffect,
|
8 | 14 | useMemo,
|
9 | 15 | useReducer,
|
10 | 16 | useRef,
|
11 | 17 | useState,
|
12 |
| - |
13 |
| - // Types |
14 |
| - ContextType, |
15 |
| - ElementType, |
16 |
| - MouseEvent as ReactMouseEvent, |
17 |
| - RefObject, |
18 |
| - MutableRefObject, |
19 |
| - Ref, |
20 | 18 | } from 'react'
|
21 | 19 |
|
| 20 | +import { FocusTrap } from '../../components/focus-trap/focus-trap' |
| 21 | +import { Portal, useNestedPortals } from '../../components/portal/portal' |
| 22 | +import { useDocumentOverflowLockedEffect } from '../../hooks/document-overflow/use-document-overflow' |
| 23 | +import { useEvent } from '../../hooks/use-event' |
| 24 | +import { useEventListener } from '../../hooks/use-event-listener' |
| 25 | +import { useId } from '../../hooks/use-id' |
| 26 | +import { useInert } from '../../hooks/use-inert' |
| 27 | +import { useOutsideClick } from '../../hooks/use-outside-click' |
| 28 | +import { useOwnerDocument } from '../../hooks/use-owner' |
| 29 | +import { useRootContainers } from '../../hooks/use-root-containers' |
| 30 | +import { useServerHandoffComplete } from '../../hooks/use-server-handoff-complete' |
| 31 | +import { useSyncRefs } from '../../hooks/use-sync-refs' |
| 32 | +import { State, useOpenClosed } from '../../internal/open-closed' |
| 33 | +import { ForcePortalRoot } from '../../internal/portal-force-root' |
| 34 | +import { StackMessage, StackProvider } from '../../internal/stack-context' |
22 | 35 | import { Props } from '../../types'
|
| 36 | +import { isDisabledReactIssue7711 } from '../../utils/bugs' |
23 | 37 | import { match } from '../../utils/match'
|
24 | 38 | import {
|
25 |
| - forwardRefWithAs, |
26 |
| - render, |
27 | 39 | Features,
|
28 |
| - PropsForFeatures, |
| 40 | + forwardRefWithAs, |
29 | 41 | HasDisplayName,
|
| 42 | + PropsForFeatures, |
30 | 43 | RefProp,
|
| 44 | + render, |
31 | 45 | } from '../../utils/render'
|
32 |
| -import { useSyncRefs } from '../../hooks/use-sync-refs' |
33 |
| -import { Keys } from '../keyboard' |
34 |
| -import { isDisabledReactIssue7711 } from '../../utils/bugs' |
35 |
| -import { useId } from '../../hooks/use-id' |
36 |
| -import { FocusTrap } from '../../components/focus-trap/focus-trap' |
37 |
| -import { Portal, useNestedPortals } from '../../components/portal/portal' |
38 |
| -import { ForcePortalRoot } from '../../internal/portal-force-root' |
39 | 46 | import {
|
40 |
| - _internal_ComponentDescription, |
41 | 47 | Description,
|
42 | 48 | useDescriptions,
|
| 49 | + _internal_ComponentDescription, |
43 | 50 | } from '../description/description'
|
44 |
| -import { useOpenClosed, State } from '../../internal/open-closed' |
45 |
| -import { useServerHandoffComplete } from '../../hooks/use-server-handoff-complete' |
46 |
| -import { StackProvider, StackMessage } from '../../internal/stack-context' |
47 |
| -import { useOutsideClick } from '../../hooks/use-outside-click' |
48 |
| -import { useOwnerDocument } from '../../hooks/use-owner' |
49 |
| -import { useEventListener } from '../../hooks/use-event-listener' |
50 |
| -import { useEvent } from '../../hooks/use-event' |
51 |
| -import { useDocumentOverflowLockedEffect } from '../../hooks/document-overflow/use-document-overflow' |
52 |
| -import { useInert } from '../../hooks/use-inert' |
53 |
| -import { useRootContainers } from '../../hooks/use-root-containers' |
| 51 | +import { Keys } from '../keyboard' |
54 | 52 |
|
55 | 53 | enum DialogStates {
|
56 | 54 | Open,
|
|
0 commit comments