@mui/material 6.0.0-beta.0 → 6.0.0-beta.1
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.
- package/Autocomplete/Autocomplete.d.ts +6 -7
- package/Autocomplete/Autocomplete.js +1 -1
- package/Badge/Badge.d.ts +1 -1
- package/Badge/Badge.js +2 -2
- package/Badge/useBadge.d.ts +13 -0
- package/Badge/useBadge.js +41 -0
- package/Badge/useBadge.types.d.ts +40 -0
- package/Badge/useBadge.types.js +1 -0
- package/Breadcrumbs/Breadcrumbs.d.ts +1 -1
- package/Breadcrumbs/Breadcrumbs.js +1 -1
- package/CHANGELOG.md +32 -0
- package/ClickAwayListener/ClickAwayListener.d.ts +47 -0
- package/ClickAwayListener/ClickAwayListener.js +178 -0
- package/ClickAwayListener/index.d.ts +2 -2
- package/ClickAwayListener/index.js +1 -1
- package/InputBase/InputBase.js +2 -2
- package/ListItem/ListItem.js +1 -1
- package/Menu/Menu.js +1 -1
- package/Modal/Modal.d.ts +1 -1
- package/Modal/Modal.js +1 -1
- package/Modal/ModalManager.d.ts +25 -0
- package/Modal/ModalManager.js +211 -0
- package/Modal/index.d.ts +1 -1
- package/Modal/index.js +1 -1
- package/Modal/useModal.d.ts +13 -0
- package/Modal/useModal.js +195 -0
- package/Modal/useModal.types.d.ts +115 -0
- package/Modal/useModal.types.js +1 -0
- package/NoSsr/NoSsr.d.ts +25 -0
- package/NoSsr/NoSsr.js +73 -0
- package/NoSsr/NoSsr.types.d.ts +18 -0
- package/NoSsr/NoSsr.types.js +1 -0
- package/NoSsr/index.d.ts +3 -2
- package/NoSsr/index.js +1 -1
- package/Popover/Popover.js +1 -1
- package/Popper/BasePopper.d.ts +7 -0
- package/Popper/BasePopper.js +370 -0
- package/Popper/BasePopper.types.d.ts +130 -0
- package/Popper/BasePopper.types.js +1 -0
- package/Popper/Popper.d.ts +1 -1
- package/Popper/Popper.js +1 -1
- package/Popper/index.d.ts +2 -1
- package/Popper/index.js +2 -1
- package/Popper/popperClasses.d.ts +8 -0
- package/Popper/popperClasses.js +7 -0
- package/Portal/Portal.d.ts +16 -0
- package/Portal/Portal.js +92 -0
- package/Portal/Portal.types.d.ts +23 -0
- package/Portal/Portal.types.js +1 -0
- package/Portal/index.d.ts +3 -2
- package/Portal/index.js +1 -1
- package/Slider/Slider.d.ts +2 -2
- package/Slider/Slider.js +3 -2
- package/Slider/useSlider.d.ts +14 -0
- package/Slider/useSlider.js +647 -0
- package/Slider/useSlider.types.d.ts +228 -0
- package/Slider/useSlider.types.js +1 -0
- package/Snackbar/Snackbar.d.ts +1 -1
- package/Snackbar/Snackbar.js +3 -3
- package/Snackbar/useSnackbar.d.ts +14 -0
- package/Snackbar/useSnackbar.js +133 -0
- package/Snackbar/useSnackbar.types.d.ts +60 -0
- package/Snackbar/useSnackbar.types.js +1 -0
- package/SwipeableDrawer/SwipeableDrawer.js +1 -1
- package/TabScrollButton/TabScrollButton.d.ts +1 -1
- package/TabScrollButton/TabScrollButton.js +1 -1
- package/TablePagination/TablePagination.js +1 -1
- package/Tabs/Tabs.d.ts +1 -1
- package/Tabs/Tabs.js +1 -1
- package/TextareaAutosize/TextareaAutosize.d.ts +14 -0
- package/TextareaAutosize/TextareaAutosize.js +222 -0
- package/TextareaAutosize/TextareaAutosize.types.d.ts +13 -0
- package/TextareaAutosize/TextareaAutosize.types.js +1 -0
- package/TextareaAutosize/index.d.ts +3 -2
- package/TextareaAutosize/index.js +1 -1
- package/Tooltip/Tooltip.js +1 -1
- package/Unstable_TrapFocus/FocusTrap.d.ts +10 -0
- package/Unstable_TrapFocus/FocusTrap.js +330 -0
- package/Unstable_TrapFocus/FocusTrap.types.d.ts +51 -0
- package/Unstable_TrapFocus/FocusTrap.types.js +1 -0
- package/Unstable_TrapFocus/index.d.ts +2 -2
- package/Unstable_TrapFocus/index.js +1 -1
- package/index.d.ts +1 -1
- package/index.js +2 -2
- package/modern/Autocomplete/Autocomplete.js +1 -1
- package/modern/Badge/Badge.js +2 -2
- package/modern/Badge/useBadge.js +41 -0
- package/modern/Badge/useBadge.types.js +1 -0
- package/modern/Breadcrumbs/Breadcrumbs.js +1 -1
- package/modern/ClickAwayListener/ClickAwayListener.js +178 -0
- package/modern/ClickAwayListener/index.js +1 -1
- package/modern/InputBase/InputBase.js +2 -2
- package/modern/ListItem/ListItem.js +1 -1
- package/modern/Menu/Menu.js +1 -1
- package/modern/Modal/Modal.js +1 -1
- package/modern/Modal/ModalManager.js +211 -0
- package/modern/Modal/index.js +1 -1
- package/modern/Modal/useModal.js +195 -0
- package/modern/Modal/useModal.types.js +1 -0
- package/modern/NoSsr/NoSsr.js +73 -0
- package/modern/NoSsr/NoSsr.types.js +1 -0
- package/modern/NoSsr/index.js +1 -1
- package/modern/Popover/Popover.js +1 -1
- package/modern/Popper/BasePopper.js +370 -0
- package/modern/Popper/BasePopper.types.js +1 -0
- package/modern/Popper/Popper.js +1 -1
- package/modern/Popper/index.js +2 -1
- package/modern/Popper/popperClasses.js +7 -0
- package/modern/Portal/Portal.js +92 -0
- package/modern/Portal/Portal.types.js +1 -0
- package/modern/Portal/index.js +1 -1
- package/modern/Slider/Slider.js +3 -2
- package/modern/Slider/useSlider.js +647 -0
- package/modern/Slider/useSlider.types.js +1 -0
- package/modern/Snackbar/Snackbar.js +3 -3
- package/modern/Snackbar/useSnackbar.js +133 -0
- package/modern/Snackbar/useSnackbar.types.js +1 -0
- package/modern/SwipeableDrawer/SwipeableDrawer.js +1 -1
- package/modern/TabScrollButton/TabScrollButton.js +1 -1
- package/modern/TablePagination/TablePagination.js +1 -1
- package/modern/Tabs/Tabs.js +1 -1
- package/modern/TextareaAutosize/TextareaAutosize.js +222 -0
- package/modern/TextareaAutosize/TextareaAutosize.types.js +1 -0
- package/modern/TextareaAutosize/index.js +1 -1
- package/modern/Tooltip/Tooltip.js +1 -1
- package/modern/Unstable_TrapFocus/FocusTrap.js +330 -0
- package/modern/Unstable_TrapFocus/FocusTrap.types.js +1 -0
- package/modern/Unstable_TrapFocus/index.js +1 -1
- package/modern/index.js +2 -2
- package/modern/useAutocomplete/useAutocomplete.js +976 -2
- package/modern/utils/PolymorphicComponent.js +1 -0
- package/modern/utils/areArraysEqual.js +4 -0
- package/modern/utils/index.js +1 -1
- package/modern/utils/isHostComponent.js +7 -0
- package/modern/utils/omitEventHandlers.js +18 -0
- package/modern/utils/shouldSpreadAdditionalProps.js +1 -1
- package/modern/utils/useSlot.js +3 -1
- package/node/Autocomplete/Autocomplete.js +3 -3
- package/node/Badge/Badge.js +5 -5
- package/node/Badge/useBadge.js +46 -0
- package/node/Badge/useBadge.types.js +5 -0
- package/node/Breadcrumbs/Breadcrumbs.js +2 -2
- package/node/ClickAwayListener/ClickAwayListener.js +184 -0
- package/node/ClickAwayListener/index.js +1 -1
- package/node/InputBase/InputBase.js +7 -7
- package/node/ListItem/ListItem.js +3 -3
- package/node/Menu/Menu.js +3 -3
- package/node/Modal/Modal.js +2 -2
- package/node/Modal/ModalManager.js +219 -0
- package/node/Modal/index.js +2 -2
- package/node/Modal/useModal.js +205 -0
- package/node/Modal/useModal.types.js +5 -0
- package/node/NoSsr/NoSsr.js +81 -0
- package/node/NoSsr/NoSsr.types.js +5 -0
- package/node/NoSsr/index.js +3 -2
- package/node/Popover/Popover.js +2 -2
- package/node/Popper/BasePopper.js +379 -0
- package/node/Popper/BasePopper.types.js +5 -0
- package/node/Popper/Popper.js +2 -2
- package/node/Popper/index.js +14 -1
- package/node/Popper/popperClasses.js +15 -0
- package/node/Portal/Portal.js +100 -0
- package/node/Portal/Portal.types.js +5 -0
- package/node/Portal/index.js +3 -2
- package/node/Slider/Slider.js +14 -13
- package/node/Slider/useSlider.js +670 -0
- package/node/Slider/useSlider.types.js +5 -0
- package/node/Snackbar/Snackbar.js +6 -6
- package/node/Snackbar/useSnackbar.js +141 -0
- package/node/Snackbar/useSnackbar.types.js +5 -0
- package/node/SwipeableDrawer/SwipeableDrawer.js +2 -2
- package/node/TabScrollButton/TabScrollButton.js +3 -3
- package/node/TablePagination/TablePagination.js +2 -2
- package/node/Tabs/Tabs.js +3 -3
- package/node/TextareaAutosize/TextareaAutosize.js +230 -0
- package/node/TextareaAutosize/TextareaAutosize.types.js +5 -0
- package/node/TextareaAutosize/index.js +3 -2
- package/node/Tooltip/Tooltip.js +5 -5
- package/node/Unstable_TrapFocus/FocusTrap.js +339 -0
- package/node/Unstable_TrapFocus/FocusTrap.types.js +5 -0
- package/node/Unstable_TrapFocus/index.js +3 -2
- package/node/index.js +3 -3
- package/node/useAutocomplete/useAutocomplete.js +985 -18
- package/node/utils/PolymorphicComponent.js +5 -0
- package/node/utils/areArraysEqual.js +10 -0
- package/node/utils/index.js +2 -2
- package/node/utils/isHostComponent.js +13 -0
- package/node/utils/omitEventHandlers.js +24 -0
- package/node/utils/shouldSpreadAdditionalProps.js +3 -2
- package/node/utils/useSlot.js +6 -4
- package/package.json +6 -7
- package/styles/overrides.d.ts +1 -1
- package/useAutocomplete/useAutocomplete.d.ts +468 -2
- package/useAutocomplete/useAutocomplete.js +976 -2
- package/utils/PolymorphicComponent.d.ts +17 -0
- package/utils/PolymorphicComponent.js +1 -0
- package/utils/areArraysEqual.d.ts +3 -0
- package/utils/areArraysEqual.js +4 -0
- package/utils/index.d.ts +2 -1
- package/utils/index.js +1 -1
- package/utils/isHostComponent.d.ts +6 -0
- package/utils/isHostComponent.js +7 -0
- package/utils/omitEventHandlers.d.ts +9 -0
- package/utils/omitEventHandlers.js +18 -0
- package/utils/shouldSpreadAdditionalProps.js +1 -1
- package/utils/types.d.ts +2 -1
- package/utils/useSlot.js +3 -1
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { unstable_ownerDocument as ownerDocument, unstable_useForkRef as useForkRef, unstable_useEventCallback as useEventCallback, unstable_createChainedFunction as createChainedFunction } from '@mui/utils';
|
|
5
|
+
import extractEventHandlers from '@mui/utils/extractEventHandlers';
|
|
6
|
+
import { ModalManager, ariaHidden } from './ModalManager';
|
|
7
|
+
function getContainer(container) {
|
|
8
|
+
return typeof container === 'function' ? container() : container;
|
|
9
|
+
}
|
|
10
|
+
function getHasTransition(children) {
|
|
11
|
+
return children ? children.props.hasOwnProperty('in') : false;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
// A modal manager used to track and manage the state of open Modals.
|
|
15
|
+
// Modals don't open on the server so this won't conflict with concurrent requests.
|
|
16
|
+
const defaultManager = new ModalManager();
|
|
17
|
+
/**
|
|
18
|
+
*
|
|
19
|
+
* Demos:
|
|
20
|
+
*
|
|
21
|
+
* - [Modal](https://next.mui.com/base-ui/react-modal/#hook)
|
|
22
|
+
*
|
|
23
|
+
* API:
|
|
24
|
+
*
|
|
25
|
+
* - [useModal API](https://next.mui.com/base-ui/react-modal/hooks-api/#use-modal)
|
|
26
|
+
*/
|
|
27
|
+
function useModal(parameters) {
|
|
28
|
+
const {
|
|
29
|
+
container,
|
|
30
|
+
disableEscapeKeyDown = false,
|
|
31
|
+
disableScrollLock = false,
|
|
32
|
+
// @ts-ignore internal logic - Base UI supports the manager as a prop too
|
|
33
|
+
manager = defaultManager,
|
|
34
|
+
closeAfterTransition = false,
|
|
35
|
+
onTransitionEnter,
|
|
36
|
+
onTransitionExited,
|
|
37
|
+
children,
|
|
38
|
+
onClose,
|
|
39
|
+
open,
|
|
40
|
+
rootRef
|
|
41
|
+
} = parameters;
|
|
42
|
+
|
|
43
|
+
// @ts-ignore internal logic
|
|
44
|
+
const modal = React.useRef({});
|
|
45
|
+
const mountNodeRef = React.useRef(null);
|
|
46
|
+
const modalRef = React.useRef(null);
|
|
47
|
+
const handleRef = useForkRef(modalRef, rootRef);
|
|
48
|
+
const [exited, setExited] = React.useState(!open);
|
|
49
|
+
const hasTransition = getHasTransition(children);
|
|
50
|
+
let ariaHiddenProp = true;
|
|
51
|
+
if (parameters['aria-hidden'] === 'false' || parameters['aria-hidden'] === false) {
|
|
52
|
+
ariaHiddenProp = false;
|
|
53
|
+
}
|
|
54
|
+
const getDoc = () => ownerDocument(mountNodeRef.current);
|
|
55
|
+
const getModal = () => {
|
|
56
|
+
modal.current.modalRef = modalRef.current;
|
|
57
|
+
modal.current.mount = mountNodeRef.current;
|
|
58
|
+
return modal.current;
|
|
59
|
+
};
|
|
60
|
+
const handleMounted = () => {
|
|
61
|
+
manager.mount(getModal(), {
|
|
62
|
+
disableScrollLock
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
// Fix a bug on Chrome where the scroll isn't initially 0.
|
|
66
|
+
if (modalRef.current) {
|
|
67
|
+
modalRef.current.scrollTop = 0;
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
const handleOpen = useEventCallback(() => {
|
|
71
|
+
const resolvedContainer = getContainer(container) || getDoc().body;
|
|
72
|
+
manager.add(getModal(), resolvedContainer);
|
|
73
|
+
|
|
74
|
+
// The element was already mounted.
|
|
75
|
+
if (modalRef.current) {
|
|
76
|
+
handleMounted();
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
const isTopModal = React.useCallback(() => manager.isTopModal(getModal()), [manager]);
|
|
80
|
+
const handlePortalRef = useEventCallback(node => {
|
|
81
|
+
mountNodeRef.current = node;
|
|
82
|
+
if (!node) {
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
if (open && isTopModal()) {
|
|
86
|
+
handleMounted();
|
|
87
|
+
} else if (modalRef.current) {
|
|
88
|
+
ariaHidden(modalRef.current, ariaHiddenProp);
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
const handleClose = React.useCallback(() => {
|
|
92
|
+
manager.remove(getModal(), ariaHiddenProp);
|
|
93
|
+
}, [ariaHiddenProp, manager]);
|
|
94
|
+
React.useEffect(() => {
|
|
95
|
+
return () => {
|
|
96
|
+
handleClose();
|
|
97
|
+
};
|
|
98
|
+
}, [handleClose]);
|
|
99
|
+
React.useEffect(() => {
|
|
100
|
+
if (open) {
|
|
101
|
+
handleOpen();
|
|
102
|
+
} else if (!hasTransition || !closeAfterTransition) {
|
|
103
|
+
handleClose();
|
|
104
|
+
}
|
|
105
|
+
}, [open, handleClose, hasTransition, closeAfterTransition, handleOpen]);
|
|
106
|
+
const createHandleKeyDown = otherHandlers => event => {
|
|
107
|
+
otherHandlers.onKeyDown?.(event);
|
|
108
|
+
|
|
109
|
+
// The handler doesn't take event.defaultPrevented into account:
|
|
110
|
+
//
|
|
111
|
+
// event.preventDefault() is meant to stop default behaviors like
|
|
112
|
+
// clicking a checkbox to check it, hitting a button to submit a form,
|
|
113
|
+
// and hitting left arrow to move the cursor in a text input etc.
|
|
114
|
+
// Only special HTML elements have these default behaviors.
|
|
115
|
+
if (event.key !== 'Escape' || event.which === 229 ||
|
|
116
|
+
// Wait until IME is settled.
|
|
117
|
+
!isTopModal()) {
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
if (!disableEscapeKeyDown) {
|
|
121
|
+
// Swallow the event, in case someone is listening for the escape key on the body.
|
|
122
|
+
event.stopPropagation();
|
|
123
|
+
if (onClose) {
|
|
124
|
+
onClose(event, 'escapeKeyDown');
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
const createHandleBackdropClick = otherHandlers => event => {
|
|
129
|
+
otherHandlers.onClick?.(event);
|
|
130
|
+
if (event.target !== event.currentTarget) {
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
if (onClose) {
|
|
134
|
+
onClose(event, 'backdropClick');
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
const getRootProps = (otherHandlers = {}) => {
|
|
138
|
+
const propsEventHandlers = extractEventHandlers(parameters);
|
|
139
|
+
|
|
140
|
+
// The custom event handlers shouldn't be spread on the root element
|
|
141
|
+
delete propsEventHandlers.onTransitionEnter;
|
|
142
|
+
delete propsEventHandlers.onTransitionExited;
|
|
143
|
+
const externalEventHandlers = {
|
|
144
|
+
...propsEventHandlers,
|
|
145
|
+
...otherHandlers
|
|
146
|
+
};
|
|
147
|
+
return {
|
|
148
|
+
role: 'presentation',
|
|
149
|
+
...externalEventHandlers,
|
|
150
|
+
onKeyDown: createHandleKeyDown(externalEventHandlers),
|
|
151
|
+
ref: handleRef
|
|
152
|
+
};
|
|
153
|
+
};
|
|
154
|
+
const getBackdropProps = (otherHandlers = {}) => {
|
|
155
|
+
const externalEventHandlers = otherHandlers;
|
|
156
|
+
return {
|
|
157
|
+
'aria-hidden': true,
|
|
158
|
+
...externalEventHandlers,
|
|
159
|
+
onClick: createHandleBackdropClick(externalEventHandlers),
|
|
160
|
+
open
|
|
161
|
+
};
|
|
162
|
+
};
|
|
163
|
+
const getTransitionProps = () => {
|
|
164
|
+
const handleEnter = () => {
|
|
165
|
+
setExited(false);
|
|
166
|
+
if (onTransitionEnter) {
|
|
167
|
+
onTransitionEnter();
|
|
168
|
+
}
|
|
169
|
+
};
|
|
170
|
+
const handleExited = () => {
|
|
171
|
+
setExited(true);
|
|
172
|
+
if (onTransitionExited) {
|
|
173
|
+
onTransitionExited();
|
|
174
|
+
}
|
|
175
|
+
if (closeAfterTransition) {
|
|
176
|
+
handleClose();
|
|
177
|
+
}
|
|
178
|
+
};
|
|
179
|
+
return {
|
|
180
|
+
onEnter: createChainedFunction(handleEnter, children?.props.onEnter),
|
|
181
|
+
onExited: createChainedFunction(handleExited, children?.props.onExited)
|
|
182
|
+
};
|
|
183
|
+
};
|
|
184
|
+
return {
|
|
185
|
+
getRootProps,
|
|
186
|
+
getBackdropProps,
|
|
187
|
+
getTransitionProps,
|
|
188
|
+
rootRef: handleRef,
|
|
189
|
+
portalRef: handlePortalRef,
|
|
190
|
+
isTopModal,
|
|
191
|
+
exited,
|
|
192
|
+
hasTransition
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
export default useModal;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import PropTypes from 'prop-types';
|
|
5
|
+
import { exactProp, unstable_useEnhancedEffect as useEnhancedEffect } from '@mui/utils';
|
|
6
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
+
/**
|
|
8
|
+
* NoSsr purposely removes components from the subject of Server Side Rendering (SSR).
|
|
9
|
+
*
|
|
10
|
+
* This component can be useful in a variety of situations:
|
|
11
|
+
*
|
|
12
|
+
* * Escape hatch for broken dependencies not supporting SSR.
|
|
13
|
+
* * Improve the time-to-first paint on the client by only rendering above the fold.
|
|
14
|
+
* * Reduce the rendering time on the server.
|
|
15
|
+
* * Under too heavy server load, you can turn on service degradation.
|
|
16
|
+
*
|
|
17
|
+
* Demos:
|
|
18
|
+
*
|
|
19
|
+
* - [No SSR](https://next.mui.com/material-ui/react-no-ssr/)
|
|
20
|
+
*
|
|
21
|
+
* API:
|
|
22
|
+
*
|
|
23
|
+
* - [NoSsr API](https://next.mui.com/material-ui/api/no-ssr/)
|
|
24
|
+
*/
|
|
25
|
+
function NoSsr(props) {
|
|
26
|
+
const {
|
|
27
|
+
children,
|
|
28
|
+
defer = false,
|
|
29
|
+
fallback = null
|
|
30
|
+
} = props;
|
|
31
|
+
const [mountedState, setMountedState] = React.useState(false);
|
|
32
|
+
useEnhancedEffect(() => {
|
|
33
|
+
if (!defer) {
|
|
34
|
+
setMountedState(true);
|
|
35
|
+
}
|
|
36
|
+
}, [defer]);
|
|
37
|
+
React.useEffect(() => {
|
|
38
|
+
if (defer) {
|
|
39
|
+
setMountedState(true);
|
|
40
|
+
}
|
|
41
|
+
}, [defer]);
|
|
42
|
+
|
|
43
|
+
// We need the Fragment here to force react-docgen to recognise NoSsr as a component.
|
|
44
|
+
return /*#__PURE__*/_jsx(React.Fragment, {
|
|
45
|
+
children: mountedState ? children : fallback
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
process.env.NODE_ENV !== "production" ? NoSsr.propTypes /* remove-proptypes */ = {
|
|
49
|
+
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
50
|
+
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
51
|
+
// │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
|
|
52
|
+
// └─────────────────────────────────────────────────────────────────────┘
|
|
53
|
+
/**
|
|
54
|
+
* You can wrap a node.
|
|
55
|
+
*/
|
|
56
|
+
children: PropTypes.node,
|
|
57
|
+
/**
|
|
58
|
+
* If `true`, the component will not only prevent server-side rendering.
|
|
59
|
+
* It will also defer the rendering of the children into a different screen frame.
|
|
60
|
+
* @default false
|
|
61
|
+
*/
|
|
62
|
+
defer: PropTypes.bool,
|
|
63
|
+
/**
|
|
64
|
+
* The fallback content to display.
|
|
65
|
+
* @default null
|
|
66
|
+
*/
|
|
67
|
+
fallback: PropTypes.node
|
|
68
|
+
} : void 0;
|
|
69
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
70
|
+
// eslint-disable-next-line
|
|
71
|
+
NoSsr['propTypes' + ''] = exactProp(NoSsr.propTypes);
|
|
72
|
+
}
|
|
73
|
+
export default NoSsr;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/modern/NoSsr/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { default } from './NoSsr';
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
|
-
import { isHostComponent } from '@mui/base/utils';
|
|
7
6
|
import composeClasses from '@mui/utils/composeClasses';
|
|
8
7
|
import HTMLElementType from '@mui/utils/HTMLElementType';
|
|
9
8
|
import refType from '@mui/utils/refType';
|
|
10
9
|
import elementTypeAcceptingRef from '@mui/utils/elementTypeAcceptingRef';
|
|
11
10
|
import integerPropType from '@mui/utils/integerPropType';
|
|
12
11
|
import chainPropTypes from '@mui/utils/chainPropTypes';
|
|
12
|
+
import isHostComponent from '../utils/isHostComponent';
|
|
13
13
|
import { styled } from '../zero-styled';
|
|
14
14
|
import { useDefaultProps } from '../DefaultPropsProvider';
|
|
15
15
|
import debounce from '../utils/debounce';
|
|
@@ -0,0 +1,370 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { chainPropTypes, HTMLElementType, refType, unstable_ownerDocument as ownerDocument, unstable_useEnhancedEffect as useEnhancedEffect, unstable_useForkRef as useForkRef } from '@mui/utils';
|
|
5
|
+
import { createPopper } from '@popperjs/core';
|
|
6
|
+
import PropTypes from 'prop-types';
|
|
7
|
+
import composeClasses from '@mui/utils/composeClasses';
|
|
8
|
+
import useSlotProps from '@mui/utils/useSlotProps';
|
|
9
|
+
import Portal from '../Portal';
|
|
10
|
+
import { getPopperUtilityClass } from './popperClasses';
|
|
11
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
|
+
function flipPlacement(placement, direction) {
|
|
13
|
+
if (direction === 'ltr') {
|
|
14
|
+
return placement;
|
|
15
|
+
}
|
|
16
|
+
switch (placement) {
|
|
17
|
+
case 'bottom-end':
|
|
18
|
+
return 'bottom-start';
|
|
19
|
+
case 'bottom-start':
|
|
20
|
+
return 'bottom-end';
|
|
21
|
+
case 'top-end':
|
|
22
|
+
return 'top-start';
|
|
23
|
+
case 'top-start':
|
|
24
|
+
return 'top-end';
|
|
25
|
+
default:
|
|
26
|
+
return placement;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
function resolveAnchorEl(anchorEl) {
|
|
30
|
+
return typeof anchorEl === 'function' ? anchorEl() : anchorEl;
|
|
31
|
+
}
|
|
32
|
+
function isHTMLElement(element) {
|
|
33
|
+
return element.nodeType !== undefined;
|
|
34
|
+
}
|
|
35
|
+
function isVirtualElement(element) {
|
|
36
|
+
return !isHTMLElement(element);
|
|
37
|
+
}
|
|
38
|
+
const useUtilityClasses = ownerState => {
|
|
39
|
+
const {
|
|
40
|
+
classes
|
|
41
|
+
} = ownerState;
|
|
42
|
+
const slots = {
|
|
43
|
+
root: ['root']
|
|
44
|
+
};
|
|
45
|
+
return composeClasses(slots, getPopperUtilityClass, classes);
|
|
46
|
+
};
|
|
47
|
+
const defaultPopperOptions = {};
|
|
48
|
+
const PopperTooltip = /*#__PURE__*/React.forwardRef(function PopperTooltip(props, forwardedRef) {
|
|
49
|
+
const {
|
|
50
|
+
anchorEl,
|
|
51
|
+
children,
|
|
52
|
+
direction,
|
|
53
|
+
disablePortal,
|
|
54
|
+
modifiers,
|
|
55
|
+
open,
|
|
56
|
+
placement: initialPlacement,
|
|
57
|
+
popperOptions,
|
|
58
|
+
popperRef: popperRefProp,
|
|
59
|
+
slotProps = {},
|
|
60
|
+
slots = {},
|
|
61
|
+
TransitionProps,
|
|
62
|
+
// @ts-ignore internal logic
|
|
63
|
+
ownerState: ownerStateProp,
|
|
64
|
+
// prevent from spreading to DOM, it can come from the parent component e.g. Select.
|
|
65
|
+
...other
|
|
66
|
+
} = props;
|
|
67
|
+
const tooltipRef = React.useRef(null);
|
|
68
|
+
const ownRef = useForkRef(tooltipRef, forwardedRef);
|
|
69
|
+
const popperRef = React.useRef(null);
|
|
70
|
+
const handlePopperRef = useForkRef(popperRef, popperRefProp);
|
|
71
|
+
const handlePopperRefRef = React.useRef(handlePopperRef);
|
|
72
|
+
useEnhancedEffect(() => {
|
|
73
|
+
handlePopperRefRef.current = handlePopperRef;
|
|
74
|
+
}, [handlePopperRef]);
|
|
75
|
+
React.useImperativeHandle(popperRefProp, () => popperRef.current, []);
|
|
76
|
+
const rtlPlacement = flipPlacement(initialPlacement, direction);
|
|
77
|
+
/**
|
|
78
|
+
* placement initialized from prop but can change during lifetime if modifiers.flip.
|
|
79
|
+
* modifiers.flip is essentially a flip for controlled/uncontrolled behavior
|
|
80
|
+
*/
|
|
81
|
+
const [placement, setPlacement] = React.useState(rtlPlacement);
|
|
82
|
+
const [resolvedAnchorElement, setResolvedAnchorElement] = React.useState(resolveAnchorEl(anchorEl));
|
|
83
|
+
React.useEffect(() => {
|
|
84
|
+
if (popperRef.current) {
|
|
85
|
+
popperRef.current.forceUpdate();
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
React.useEffect(() => {
|
|
89
|
+
if (anchorEl) {
|
|
90
|
+
setResolvedAnchorElement(resolveAnchorEl(anchorEl));
|
|
91
|
+
}
|
|
92
|
+
}, [anchorEl]);
|
|
93
|
+
useEnhancedEffect(() => {
|
|
94
|
+
if (!resolvedAnchorElement || !open) {
|
|
95
|
+
return undefined;
|
|
96
|
+
}
|
|
97
|
+
const handlePopperUpdate = data => {
|
|
98
|
+
setPlacement(data.placement);
|
|
99
|
+
};
|
|
100
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
101
|
+
if (resolvedAnchorElement && isHTMLElement(resolvedAnchorElement) && resolvedAnchorElement.nodeType === 1) {
|
|
102
|
+
const box = resolvedAnchorElement.getBoundingClientRect();
|
|
103
|
+
if (process.env.NODE_ENV !== 'test' && box.top === 0 && box.left === 0 && box.right === 0 && box.bottom === 0) {
|
|
104
|
+
console.warn(['MUI: The `anchorEl` prop provided to the component is invalid.', 'The anchor element should be part of the document layout.', "Make sure the element is present in the document or that it's not display none."].join('\n'));
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
let popperModifiers = [{
|
|
109
|
+
name: 'preventOverflow',
|
|
110
|
+
options: {
|
|
111
|
+
altBoundary: disablePortal
|
|
112
|
+
}
|
|
113
|
+
}, {
|
|
114
|
+
name: 'flip',
|
|
115
|
+
options: {
|
|
116
|
+
altBoundary: disablePortal
|
|
117
|
+
}
|
|
118
|
+
}, {
|
|
119
|
+
name: 'onUpdate',
|
|
120
|
+
enabled: true,
|
|
121
|
+
phase: 'afterWrite',
|
|
122
|
+
fn: ({
|
|
123
|
+
state
|
|
124
|
+
}) => {
|
|
125
|
+
handlePopperUpdate(state);
|
|
126
|
+
}
|
|
127
|
+
}];
|
|
128
|
+
if (modifiers != null) {
|
|
129
|
+
popperModifiers = popperModifiers.concat(modifiers);
|
|
130
|
+
}
|
|
131
|
+
if (popperOptions && popperOptions.modifiers != null) {
|
|
132
|
+
popperModifiers = popperModifiers.concat(popperOptions.modifiers);
|
|
133
|
+
}
|
|
134
|
+
const popper = createPopper(resolvedAnchorElement, tooltipRef.current, {
|
|
135
|
+
placement: rtlPlacement,
|
|
136
|
+
...popperOptions,
|
|
137
|
+
modifiers: popperModifiers
|
|
138
|
+
});
|
|
139
|
+
handlePopperRefRef.current(popper);
|
|
140
|
+
return () => {
|
|
141
|
+
popper.destroy();
|
|
142
|
+
handlePopperRefRef.current(null);
|
|
143
|
+
};
|
|
144
|
+
}, [resolvedAnchorElement, disablePortal, modifiers, open, popperOptions, rtlPlacement]);
|
|
145
|
+
const childProps = {
|
|
146
|
+
placement: placement
|
|
147
|
+
};
|
|
148
|
+
if (TransitionProps !== null) {
|
|
149
|
+
childProps.TransitionProps = TransitionProps;
|
|
150
|
+
}
|
|
151
|
+
const classes = useUtilityClasses(props);
|
|
152
|
+
const Root = slots.root ?? 'div';
|
|
153
|
+
const rootProps = useSlotProps({
|
|
154
|
+
elementType: Root,
|
|
155
|
+
externalSlotProps: slotProps.root,
|
|
156
|
+
externalForwardedProps: other,
|
|
157
|
+
additionalProps: {
|
|
158
|
+
role: 'tooltip',
|
|
159
|
+
ref: ownRef
|
|
160
|
+
},
|
|
161
|
+
ownerState: props,
|
|
162
|
+
className: classes.root
|
|
163
|
+
});
|
|
164
|
+
return /*#__PURE__*/_jsx(Root, {
|
|
165
|
+
...rootProps,
|
|
166
|
+
children: typeof children === 'function' ? children(childProps) : children
|
|
167
|
+
});
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* @ignore - internal component.
|
|
172
|
+
*/
|
|
173
|
+
const Popper = /*#__PURE__*/React.forwardRef(function Popper(props, forwardedRef) {
|
|
174
|
+
const {
|
|
175
|
+
anchorEl,
|
|
176
|
+
children,
|
|
177
|
+
container: containerProp,
|
|
178
|
+
direction = 'ltr',
|
|
179
|
+
disablePortal = false,
|
|
180
|
+
keepMounted = false,
|
|
181
|
+
modifiers,
|
|
182
|
+
open,
|
|
183
|
+
placement = 'bottom',
|
|
184
|
+
popperOptions = defaultPopperOptions,
|
|
185
|
+
popperRef,
|
|
186
|
+
style,
|
|
187
|
+
transition = false,
|
|
188
|
+
slotProps = {},
|
|
189
|
+
slots = {},
|
|
190
|
+
...other
|
|
191
|
+
} = props;
|
|
192
|
+
const [exited, setExited] = React.useState(true);
|
|
193
|
+
const handleEnter = () => {
|
|
194
|
+
setExited(false);
|
|
195
|
+
};
|
|
196
|
+
const handleExited = () => {
|
|
197
|
+
setExited(true);
|
|
198
|
+
};
|
|
199
|
+
if (!keepMounted && !open && (!transition || exited)) {
|
|
200
|
+
return null;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
// If the container prop is provided, use that
|
|
204
|
+
// If the anchorEl prop is provided, use its parent body element as the container
|
|
205
|
+
// If neither are provided let the Modal take care of choosing the container
|
|
206
|
+
let container;
|
|
207
|
+
if (containerProp) {
|
|
208
|
+
container = containerProp;
|
|
209
|
+
} else if (anchorEl) {
|
|
210
|
+
const resolvedAnchorEl = resolveAnchorEl(anchorEl);
|
|
211
|
+
container = resolvedAnchorEl && isHTMLElement(resolvedAnchorEl) ? ownerDocument(resolvedAnchorEl).body : ownerDocument(null).body;
|
|
212
|
+
}
|
|
213
|
+
const display = !open && keepMounted && (!transition || exited) ? 'none' : undefined;
|
|
214
|
+
const transitionProps = transition ? {
|
|
215
|
+
in: open,
|
|
216
|
+
onEnter: handleEnter,
|
|
217
|
+
onExited: handleExited
|
|
218
|
+
} : undefined;
|
|
219
|
+
return /*#__PURE__*/_jsx(Portal, {
|
|
220
|
+
disablePortal: disablePortal,
|
|
221
|
+
container: container,
|
|
222
|
+
children: /*#__PURE__*/_jsx(PopperTooltip, {
|
|
223
|
+
anchorEl: anchorEl,
|
|
224
|
+
direction: direction,
|
|
225
|
+
disablePortal: disablePortal,
|
|
226
|
+
modifiers: modifiers,
|
|
227
|
+
ref: forwardedRef,
|
|
228
|
+
open: transition ? !exited : open,
|
|
229
|
+
placement: placement,
|
|
230
|
+
popperOptions: popperOptions,
|
|
231
|
+
popperRef: popperRef,
|
|
232
|
+
slotProps: slotProps,
|
|
233
|
+
slots: slots,
|
|
234
|
+
...other,
|
|
235
|
+
style: {
|
|
236
|
+
// Prevents scroll issue, waiting for Popper.js to add this style once initiated.
|
|
237
|
+
position: 'fixed',
|
|
238
|
+
// Fix Popper.js display issue
|
|
239
|
+
top: 0,
|
|
240
|
+
left: 0,
|
|
241
|
+
display,
|
|
242
|
+
...style
|
|
243
|
+
},
|
|
244
|
+
TransitionProps: transitionProps,
|
|
245
|
+
children: children
|
|
246
|
+
})
|
|
247
|
+
});
|
|
248
|
+
});
|
|
249
|
+
process.env.NODE_ENV !== "production" ? Popper.propTypes /* remove-proptypes */ = {
|
|
250
|
+
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
251
|
+
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
252
|
+
// │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
|
|
253
|
+
// └─────────────────────────────────────────────────────────────────────┘
|
|
254
|
+
/**
|
|
255
|
+
* An HTML element, [virtualElement](https://popper.js.org/docs/v2/virtual-elements/),
|
|
256
|
+
* or a function that returns either.
|
|
257
|
+
* It's used to set the position of the popper.
|
|
258
|
+
* The return value will passed as the reference object of the Popper instance.
|
|
259
|
+
*/
|
|
260
|
+
anchorEl: chainPropTypes(PropTypes.oneOfType([HTMLElementType, PropTypes.object, PropTypes.func]), props => {
|
|
261
|
+
if (props.open) {
|
|
262
|
+
const resolvedAnchorEl = resolveAnchorEl(props.anchorEl);
|
|
263
|
+
if (resolvedAnchorEl && isHTMLElement(resolvedAnchorEl) && resolvedAnchorEl.nodeType === 1) {
|
|
264
|
+
const box = resolvedAnchorEl.getBoundingClientRect();
|
|
265
|
+
if (process.env.NODE_ENV !== 'test' && box.top === 0 && box.left === 0 && box.right === 0 && box.bottom === 0) {
|
|
266
|
+
return new Error(['MUI: The `anchorEl` prop provided to the component is invalid.', 'The anchor element should be part of the document layout.', "Make sure the element is present in the document or that it's not display none."].join('\n'));
|
|
267
|
+
}
|
|
268
|
+
} else if (!resolvedAnchorEl || typeof resolvedAnchorEl.getBoundingClientRect !== 'function' || isVirtualElement(resolvedAnchorEl) && resolvedAnchorEl.contextElement != null && resolvedAnchorEl.contextElement.nodeType !== 1) {
|
|
269
|
+
return new Error(['MUI: The `anchorEl` prop provided to the component is invalid.', 'It should be an HTML element instance or a virtualElement ', '(https://popper.js.org/docs/v2/virtual-elements/).'].join('\n'));
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
return null;
|
|
273
|
+
}),
|
|
274
|
+
/**
|
|
275
|
+
* Popper render function or node.
|
|
276
|
+
*/
|
|
277
|
+
children: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.node, PropTypes.func]),
|
|
278
|
+
/**
|
|
279
|
+
* An HTML element or function that returns one.
|
|
280
|
+
* The `container` will have the portal children appended to it.
|
|
281
|
+
*
|
|
282
|
+
* You can also provide a callback, which is called in a React layout effect.
|
|
283
|
+
* This lets you set the container from a ref, and also makes server-side rendering possible.
|
|
284
|
+
*
|
|
285
|
+
* By default, it uses the body of the top-level document object,
|
|
286
|
+
* so it's simply `document.body` most of the time.
|
|
287
|
+
*/
|
|
288
|
+
container: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([HTMLElementType, PropTypes.func]),
|
|
289
|
+
/**
|
|
290
|
+
* Direction of the text.
|
|
291
|
+
* @default 'ltr'
|
|
292
|
+
*/
|
|
293
|
+
direction: PropTypes.oneOf(['ltr', 'rtl']),
|
|
294
|
+
/**
|
|
295
|
+
* The `children` will be under the DOM hierarchy of the parent component.
|
|
296
|
+
* @default false
|
|
297
|
+
*/
|
|
298
|
+
disablePortal: PropTypes.bool,
|
|
299
|
+
/**
|
|
300
|
+
* Always keep the children in the DOM.
|
|
301
|
+
* This prop can be useful in SEO situation or
|
|
302
|
+
* when you want to maximize the responsiveness of the Popper.
|
|
303
|
+
* @default false
|
|
304
|
+
*/
|
|
305
|
+
keepMounted: PropTypes.bool,
|
|
306
|
+
/**
|
|
307
|
+
* Popper.js is based on a "plugin-like" architecture,
|
|
308
|
+
* most of its features are fully encapsulated "modifiers".
|
|
309
|
+
*
|
|
310
|
+
* A modifier is a function that is called each time Popper.js needs to
|
|
311
|
+
* compute the position of the popper.
|
|
312
|
+
* For this reason, modifiers should be very performant to avoid bottlenecks.
|
|
313
|
+
* To learn how to create a modifier, [read the modifiers documentation](https://popper.js.org/docs/v2/modifiers/).
|
|
314
|
+
*/
|
|
315
|
+
modifiers: PropTypes.arrayOf(PropTypes.shape({
|
|
316
|
+
data: PropTypes.object,
|
|
317
|
+
effect: PropTypes.func,
|
|
318
|
+
enabled: PropTypes.bool,
|
|
319
|
+
fn: PropTypes.func,
|
|
320
|
+
name: PropTypes.any,
|
|
321
|
+
options: PropTypes.object,
|
|
322
|
+
phase: PropTypes.oneOf(['afterMain', 'afterRead', 'afterWrite', 'beforeMain', 'beforeRead', 'beforeWrite', 'main', 'read', 'write']),
|
|
323
|
+
requires: PropTypes.arrayOf(PropTypes.string),
|
|
324
|
+
requiresIfExists: PropTypes.arrayOf(PropTypes.string)
|
|
325
|
+
})),
|
|
326
|
+
/**
|
|
327
|
+
* If `true`, the component is shown.
|
|
328
|
+
*/
|
|
329
|
+
open: PropTypes.bool.isRequired,
|
|
330
|
+
/**
|
|
331
|
+
* Popper placement.
|
|
332
|
+
* @default 'bottom'
|
|
333
|
+
*/
|
|
334
|
+
placement: PropTypes.oneOf(['auto-end', 'auto-start', 'auto', 'bottom-end', 'bottom-start', 'bottom', 'left-end', 'left-start', 'left', 'right-end', 'right-start', 'right', 'top-end', 'top-start', 'top']),
|
|
335
|
+
/**
|
|
336
|
+
* Options provided to the [`Popper.js`](https://popper.js.org/docs/v2/constructors/#options) instance.
|
|
337
|
+
* @default {}
|
|
338
|
+
*/
|
|
339
|
+
popperOptions: PropTypes.shape({
|
|
340
|
+
modifiers: PropTypes.array,
|
|
341
|
+
onFirstUpdate: PropTypes.func,
|
|
342
|
+
placement: PropTypes.oneOf(['auto-end', 'auto-start', 'auto', 'bottom-end', 'bottom-start', 'bottom', 'left-end', 'left-start', 'left', 'right-end', 'right-start', 'right', 'top-end', 'top-start', 'top']),
|
|
343
|
+
strategy: PropTypes.oneOf(['absolute', 'fixed'])
|
|
344
|
+
}),
|
|
345
|
+
/**
|
|
346
|
+
* A ref that points to the used popper instance.
|
|
347
|
+
*/
|
|
348
|
+
popperRef: refType,
|
|
349
|
+
/**
|
|
350
|
+
* The props used for each slot inside the Popper.
|
|
351
|
+
* @default {}
|
|
352
|
+
*/
|
|
353
|
+
slotProps: PropTypes.shape({
|
|
354
|
+
root: PropTypes.oneOfType([PropTypes.func, PropTypes.object])
|
|
355
|
+
}),
|
|
356
|
+
/**
|
|
357
|
+
* The components used for each slot inside the Popper.
|
|
358
|
+
* Either a string to use a HTML element or a component.
|
|
359
|
+
* @default {}
|
|
360
|
+
*/
|
|
361
|
+
slots: PropTypes.shape({
|
|
362
|
+
root: PropTypes.elementType
|
|
363
|
+
}),
|
|
364
|
+
/**
|
|
365
|
+
* Help supporting a react-transition-group/Transition component.
|
|
366
|
+
* @default false
|
|
367
|
+
*/
|
|
368
|
+
transition: PropTypes.bool
|
|
369
|
+
} : void 0;
|
|
370
|
+
export default Popper;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/modern/Popper/Popper.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import { Popper as BasePopper } from '@mui/base/Popper';
|
|
4
3
|
import { useRtl } from '@mui/system/RtlProvider';
|
|
5
4
|
import refType from '@mui/utils/refType';
|
|
6
5
|
import HTMLElementType from '@mui/utils/HTMLElementType';
|
|
7
6
|
import PropTypes from 'prop-types';
|
|
8
7
|
import * as React from 'react';
|
|
8
|
+
import BasePopper from './BasePopper';
|
|
9
9
|
import { styled } from '../zero-styled';
|
|
10
10
|
import { useDefaultProps } from '../DefaultPropsProvider';
|
|
11
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
package/modern/Popper/index.js
CHANGED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
|
|
2
|
+
import generateUtilityClass from '@mui/utils/generateUtilityClass';
|
|
3
|
+
export function getPopperUtilityClass(slot) {
|
|
4
|
+
return generateUtilityClass('MuiPopper', slot);
|
|
5
|
+
}
|
|
6
|
+
const popperClasses = generateUtilityClasses('MuiPopper', ['root']);
|
|
7
|
+
export default popperClasses;
|