@mui/material 5.11.10 → 5.11.11

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.
Files changed (240) hide show
  1. package/Accordion/accordionClasses.d.ts +18 -18
  2. package/AccordionActions/accordionActionsClasses.d.ts +10 -10
  3. package/AccordionDetails/accordionDetailsClasses.d.ts +8 -8
  4. package/AccordionSummary/accordionSummaryClasses.d.ts +22 -22
  5. package/Alert/alertClasses.d.ts +44 -44
  6. package/AlertTitle/alertTitleClasses.d.ts +8 -8
  7. package/AppBar/appBarClasses.d.ts +28 -28
  8. package/Autocomplete/Autocomplete.d.ts +3 -1
  9. package/Autocomplete/autocompleteClasses.d.ts +54 -54
  10. package/Avatar/avatarClasses.d.ts +20 -20
  11. package/AvatarGroup/avatarGroupClasses.d.ts +10 -10
  12. package/Backdrop/backdropClasses.d.ts +10 -10
  13. package/Badge/Badge.js +1 -1
  14. package/Badge/badgeClasses.d.ts +56 -56
  15. package/BottomNavigation/BottomNavigation.js +0 -0
  16. package/BottomNavigation/bottomNavigationClasses.d.ts +8 -8
  17. package/BottomNavigationAction/bottomNavigationActionClasses.d.ts +14 -14
  18. package/Breadcrumbs/breadcrumbsClasses.d.ts +14 -14
  19. package/Button/buttonClasses.d.ts +100 -100
  20. package/ButtonBase/buttonBaseClasses.d.ts +12 -12
  21. package/ButtonBase/touchRippleClasses.d.ts +20 -20
  22. package/ButtonGroup/ButtonGroupContext.d.ts +18 -18
  23. package/ButtonGroup/buttonGroupClasses.d.ts +58 -58
  24. package/CHANGELOG.md +89 -0
  25. package/Card/cardClasses.d.ts +8 -8
  26. package/CardActionArea/cardActionAreaClasses.d.ts +12 -12
  27. package/CardActions/cardActionsClasses.d.ts +10 -10
  28. package/CardContent/cardContentClasses.d.ts +8 -8
  29. package/CardHeader/cardHeaderClasses.d.ts +18 -18
  30. package/CardMedia/cardMediaClasses.d.ts +12 -12
  31. package/Checkbox/checkboxClasses.d.ts +18 -18
  32. package/Chip/chipClasses.d.ts +96 -96
  33. package/CircularProgress/circularProgressClasses.d.ts +26 -26
  34. package/ClickAwayListener/index.d.ts +2 -2
  35. package/Collapse/collapseClasses.d.ts +18 -18
  36. package/Container/Container.js +0 -1
  37. package/Container/containerClasses.d.ts +6 -6
  38. package/Dialog/DialogContext.d.ts +6 -6
  39. package/Dialog/dialogClasses.d.ts +36 -36
  40. package/DialogActions/dialogActionsClasses.d.ts +10 -10
  41. package/DialogContent/dialogContentClasses.d.ts +10 -10
  42. package/DialogContentText/dialogContentTextClasses.d.ts +8 -8
  43. package/DialogTitle/dialogTitleClasses.d.ts +8 -8
  44. package/Divider/dividerClasses.d.ts +34 -34
  45. package/Drawer/drawerClasses.d.ts +30 -30
  46. package/Fab/fabClasses.d.ts +26 -26
  47. package/FilledInput/filledInputClasses.d.ts +40 -40
  48. package/FormControl/FormControlContext.d.ts +17 -17
  49. package/FormControl/formControlClasses.d.ts +14 -14
  50. package/FormControl/useFormControl.d.ts +2 -2
  51. package/FormControlLabel/formControlLabelClasses.d.ts +20 -20
  52. package/FormGroup/formGroupClasses.d.ts +12 -12
  53. package/FormHelperText/formHelperTextClasses.d.ts +22 -22
  54. package/FormLabel/formLabelClasses.d.ts +22 -22
  55. package/Grid/gridClasses.d.ts +48 -48
  56. package/Icon/iconClasses.d.ts +24 -24
  57. package/IconButton/iconButtonClasses.d.ts +34 -34
  58. package/ImageList/imageListClasses.d.ts +16 -16
  59. package/ImageListItem/imageListItemClasses.d.ts +18 -18
  60. package/ImageListItemBar/imageListItemBarClasses.d.ts +30 -30
  61. package/Input/inputClasses.d.ts +34 -34
  62. package/InputAdornment/inputAdornmentClasses.d.ts +24 -24
  63. package/InputBase/InputBase.js +2 -2
  64. package/InputBase/inputBaseClasses.d.ts +46 -46
  65. package/InputLabel/InputLabel.js +3 -1
  66. package/InputLabel/inputLabelClasses.d.ts +32 -32
  67. package/LinearProgress/linearProgressClasses.d.ts +42 -42
  68. package/Link/getTextDecoration.d.ts +15 -15
  69. package/Link/linkClasses.d.ts +18 -18
  70. package/List/listClasses.d.ts +14 -14
  71. package/ListItem/listItemClasses.d.ts +30 -30
  72. package/ListItemAvatar/listItemAvatarClasses.d.ts +10 -10
  73. package/ListItemButton/listItemButtonClasses.d.ts +22 -22
  74. package/ListItemIcon/listItemIconClasses.d.ts +10 -10
  75. package/ListItemSecondaryAction/listItemSecondaryActionClasses.d.ts +10 -10
  76. package/ListItemText/listItemTextClasses.d.ts +18 -18
  77. package/ListSubheader/ListSubheader.js +1 -0
  78. package/ListSubheader/listSubheaderClasses.d.ts +18 -18
  79. package/Menu/menuClasses.d.ts +12 -12
  80. package/MenuItem/menuItemClasses.d.ts +20 -20
  81. package/MenuList/MenuList.js +7 -0
  82. package/MobileStepper/mobileStepperClasses.d.ts +22 -22
  83. package/Modal/Modal.d.ts +9 -1
  84. package/Modal/Modal.js +14 -9
  85. package/NativeSelect/nativeSelectClasses.d.ts +32 -32
  86. package/OutlinedInput/OutlinedInput.js +1 -1
  87. package/OutlinedInput/outlinedInputClasses.d.ts +36 -36
  88. package/Pagination/paginationClasses.d.ts +14 -14
  89. package/PaginationItem/paginationItemClasses.d.ts +42 -42
  90. package/Paper/paperClasses.d.ts +39 -39
  91. package/Popover/popoverClasses.d.ts +10 -10
  92. package/Popper/Popper.d.ts +55 -55
  93. package/README.md +0 -2
  94. package/Radio/radioClasses.d.ts +16 -16
  95. package/RadioGroup/RadioGroupContext.d.ts +11 -11
  96. package/RadioGroup/useRadioGroup.d.ts +4 -4
  97. package/Rating/Rating.js +2 -2
  98. package/Rating/ratingClasses.d.ts +40 -40
  99. package/ScopedCssBaseline/scopedCssBaselineClasses.d.ts +8 -8
  100. package/Select/SelectInput.js +2 -22
  101. package/Select/selectClasses.d.ts +30 -30
  102. package/Skeleton/skeletonClasses.d.ts +26 -26
  103. package/Slider/Slider.d.ts +5 -1
  104. package/Slider/Slider.js +16 -11
  105. package/Slider/SliderValueLabel.d.ts +15 -15
  106. package/Slider/SliderValueLabel.types.d.ts +24 -24
  107. package/Slider/sliderClasses.d.ts +58 -58
  108. package/Snackbar/Snackbar.js +21 -125
  109. package/Snackbar/snackbarClasses.d.ts +20 -20
  110. package/SnackbarContent/snackbarContentClasses.d.ts +12 -12
  111. package/SpeedDial/speedDialClasses.d.ts +22 -22
  112. package/SpeedDialAction/speedDialActionClasses.d.ts +20 -20
  113. package/SpeedDialIcon/speedDialIconClasses.d.ts +18 -18
  114. package/Stack/Stack.d.ts +0 -1
  115. package/Stack/Stack.js +9 -120
  116. package/Stack/index.d.ts +3 -0
  117. package/Stack/index.js +2 -1
  118. package/Stack/stackClasses.d.ts +6 -0
  119. package/Stack/stackClasses.js +7 -0
  120. package/Step/StepContext.d.ts +20 -20
  121. package/Step/stepClasses.d.ts +16 -16
  122. package/StepButton/stepButtonClasses.d.ts +14 -14
  123. package/StepConnector/stepConnectorClasses.d.ts +26 -26
  124. package/StepContent/stepContentClasses.d.ts +12 -12
  125. package/StepIcon/stepIconClasses.d.ts +16 -16
  126. package/StepLabel/stepLabelClasses.d.ts +28 -28
  127. package/Stepper/StepperContext.d.ts +18 -18
  128. package/Stepper/stepperClasses.d.ts +14 -14
  129. package/SvgIcon/svgIconClasses.d.ts +26 -26
  130. package/Switch/switchClasses.d.ts +32 -32
  131. package/Tab/tabClasses.d.ts +26 -26
  132. package/TabScrollButton/tabScrollButtonClasses.d.ts +12 -12
  133. package/Table/tableClasses.d.ts +10 -10
  134. package/TableBody/tableBodyClasses.d.ts +8 -8
  135. package/TableCell/tableCellClasses.d.ts +32 -32
  136. package/TableContainer/tableContainerClasses.d.ts +8 -8
  137. package/TableFooter/tableFooterClasses.d.ts +8 -8
  138. package/TableHead/tableHeadClasses.d.ts +8 -8
  139. package/TablePagination/tablePaginationClasses.d.ts +28 -28
  140. package/TableRow/tableRowClasses.d.ts +16 -16
  141. package/TableSortLabel/tableSortLabelClasses.d.ts +16 -16
  142. package/Tabs/tabsClasses.d.ts +32 -32
  143. package/TextField/textFieldClasses.d.ts +8 -8
  144. package/ToggleButton/toggleButtonClasses.d.ts +24 -24
  145. package/ToggleButtonGroup/toggleButtonGroupClasses.d.ts +18 -18
  146. package/Toolbar/toolbarClasses.d.ts +14 -14
  147. package/Tooltip/tooltipClasses.d.ts +30 -30
  148. package/Typography/typographyClasses.d.ts +50 -50
  149. package/Unstable_Grid2/Grid2.d.ts +4 -4
  150. package/Unstable_Grid2/Grid2.js +2 -3
  151. package/Unstable_Grid2/Grid2Props.d.ts +15 -15
  152. package/Unstable_Grid2/grid2Classes.d.ts +5 -5
  153. package/Unstable_Grid2/index.d.ts +4 -4
  154. package/className/index.d.ts +1 -1
  155. package/darkScrollbar/index.d.ts +28 -28
  156. package/generateUtilityClass/index.d.ts +2 -2
  157. package/generateUtilityClasses/index.d.ts +1 -1
  158. package/index.js +1 -1
  159. package/internal/switchBaseClasses.d.ts +12 -12
  160. package/legacy/Badge/Badge.js +1 -1
  161. package/legacy/BottomNavigation/BottomNavigation.js +0 -0
  162. package/legacy/Container/Container.js +0 -1
  163. package/legacy/InputBase/InputBase.js +2 -2
  164. package/legacy/InputLabel/InputLabel.js +3 -1
  165. package/legacy/ListSubheader/ListSubheader.js +1 -0
  166. package/legacy/MenuList/MenuList.js +7 -0
  167. package/legacy/Modal/Modal.js +14 -9
  168. package/legacy/OutlinedInput/OutlinedInput.js +1 -1
  169. package/legacy/Rating/Rating.js +2 -2
  170. package/legacy/Select/SelectInput.js +2 -22
  171. package/legacy/Slider/Slider.js +16 -12
  172. package/legacy/Snackbar/Snackbar.js +20 -119
  173. package/legacy/Stack/Stack.js +13 -122
  174. package/legacy/Stack/index.js +2 -1
  175. package/legacy/Stack/stackClasses.js +7 -0
  176. package/legacy/Unstable_Grid2/Grid2.js +2 -3
  177. package/legacy/index.js +1 -1
  178. package/legacy/styles/createTheme.js +1 -0
  179. package/legacy/useAutocomplete/useAutocomplete.js +2 -2
  180. package/locale/index.d.ts +75 -75
  181. package/modern/Badge/Badge.js +1 -1
  182. package/modern/BottomNavigation/BottomNavigation.js +0 -0
  183. package/modern/Container/Container.js +0 -1
  184. package/modern/InputBase/InputBase.js +2 -2
  185. package/modern/InputLabel/InputLabel.js +3 -1
  186. package/modern/ListSubheader/ListSubheader.js +1 -0
  187. package/modern/MenuList/MenuList.js +7 -0
  188. package/modern/Modal/Modal.js +14 -9
  189. package/modern/OutlinedInput/OutlinedInput.js +1 -1
  190. package/modern/Rating/Rating.js +2 -2
  191. package/modern/Select/SelectInput.js +2 -18
  192. package/modern/Slider/Slider.js +16 -11
  193. package/modern/Snackbar/Snackbar.js +21 -125
  194. package/modern/Stack/Stack.js +9 -120
  195. package/modern/Stack/index.js +2 -1
  196. package/modern/Stack/stackClasses.js +7 -0
  197. package/modern/Unstable_Grid2/Grid2.js +2 -3
  198. package/modern/index.js +1 -1
  199. package/modern/styles/createTheme.js +1 -0
  200. package/modern/useAutocomplete/useAutocomplete.js +2 -2
  201. package/node/Badge/Badge.js +2 -2
  202. package/node/BottomNavigation/BottomNavigation.js +0 -0
  203. package/node/Container/Container.js +0 -2
  204. package/node/InputBase/InputBase.js +2 -2
  205. package/node/InputLabel/InputLabel.js +3 -1
  206. package/node/ListSubheader/ListSubheader.js +1 -0
  207. package/node/MenuList/MenuList.js +7 -0
  208. package/node/Modal/Modal.js +14 -9
  209. package/node/OutlinedInput/OutlinedInput.js +1 -1
  210. package/node/Rating/Rating.js +2 -2
  211. package/node/Select/SelectInput.js +2 -22
  212. package/node/Slider/Slider.js +19 -14
  213. package/node/Snackbar/Snackbar.js +20 -124
  214. package/node/Stack/Stack.js +9 -122
  215. package/node/Stack/index.js +8 -1
  216. package/node/Stack/stackClasses.js +16 -0
  217. package/node/Unstable_Grid2/Grid2.js +0 -1
  218. package/node/index.js +1 -1
  219. package/node/styles/createTheme.js +1 -0
  220. package/node/useAutocomplete/useAutocomplete.js +8 -6
  221. package/package.json +6 -6
  222. package/styles/CssVarsProvider.d.ts +16 -16
  223. package/styles/createTheme.js +1 -0
  224. package/styles/excludeVariablesFromRoot.d.ts +5 -5
  225. package/styles/getOverlayAlpha.d.ts +2 -2
  226. package/transitions/index.d.ts +1 -1
  227. package/transitions/transition.d.ts +13 -13
  228. package/transitions/utils.d.ts +23 -23
  229. package/types/OverridableComponentAugmentation.d.ts +31 -31
  230. package/umd/material-ui.development.js +4132 -4060
  231. package/umd/material-ui.production.min.js +21 -21
  232. package/useAutocomplete/useAutocomplete.d.ts +2 -2
  233. package/useAutocomplete/useAutocomplete.js +2 -2
  234. package/useMediaQuery/useMediaQuery.d.ts +46 -46
  235. package/useTouchRipple/index.d.ts +1 -1
  236. package/useTouchRipple/useTouchRipple.d.ts +28 -28
  237. package/utils/getScrollbarSize.d.ts +2 -2
  238. package/utils/ownerDocument.d.ts +2 -2
  239. package/utils/ownerWindow.d.ts +2 -2
  240. package/utils/setRef.d.ts +2 -2
@@ -4,13 +4,12 @@ const _excluded = ["onEnter", "onExited"],
4
4
  _excluded2 = ["action", "anchorOrigin", "autoHideDuration", "children", "className", "ClickAwayListenerProps", "ContentProps", "disableWindowBlurListener", "message", "onBlur", "onClose", "onFocus", "onMouseEnter", "onMouseLeave", "open", "resumeHideDuration", "TransitionComponent", "transitionDuration", "TransitionProps"];
5
5
  import * as React from 'react';
6
6
  import PropTypes from 'prop-types';
7
- import clsx from 'clsx';
8
- import { unstable_composeClasses as composeClasses } from '@mui/base';
7
+ import { unstable_composeClasses as composeClasses, useSlotProps } from '@mui/base';
9
8
  import ClickAwayListener from '@mui/base/ClickAwayListener';
9
+ import useSnackbar from '@mui/base/useSnackbar';
10
10
  import styled from '../styles/styled';
11
11
  import useTheme from '../styles/useTheme';
12
12
  import useThemeProps from '../styles/useThemeProps';
13
- import useEventCallback from '../utils/useEventCallback';
14
13
  import capitalize from '../utils/capitalize';
15
14
  import Grow from '../Grow';
16
15
  import SnackbarContent from '../SnackbarContent';
@@ -100,13 +99,7 @@ const Snackbar = /*#__PURE__*/React.forwardRef(function Snackbar(inProps, ref) {
100
99
  ContentProps,
101
100
  disableWindowBlurListener = false,
102
101
  message,
103
- onBlur,
104
- onClose,
105
- onFocus,
106
- onMouseEnter,
107
- onMouseLeave,
108
102
  open,
109
- resumeHideDuration,
110
103
  TransitionComponent = Grow,
111
104
  transitionDuration = defaultTransitionDuration,
112
105
  TransitionProps: {
@@ -120,76 +113,27 @@ const Snackbar = /*#__PURE__*/React.forwardRef(function Snackbar(inProps, ref) {
120
113
  anchorOrigin: {
121
114
  vertical,
122
115
  horizontal
123
- }
116
+ },
117
+ autoHideDuration,
118
+ disableWindowBlurListener,
119
+ TransitionComponent,
120
+ transitionDuration
124
121
  });
125
122
  const classes = useUtilityClasses(ownerState);
126
- const timerAutoHide = React.useRef();
123
+ const {
124
+ getRootProps,
125
+ onClickAway
126
+ } = useSnackbar(_extends({}, ownerState, {
127
+ ref
128
+ }));
127
129
  const [exited, setExited] = React.useState(true);
128
- const handleClose = useEventCallback((...args) => {
129
- if (onClose) {
130
- onClose(...args);
131
- }
130
+ const rootProps = useSlotProps({
131
+ elementType: SnackbarRoot,
132
+ getSlotProps: getRootProps,
133
+ externalForwardedProps: other,
134
+ ownerState,
135
+ className: [classes.root, className]
132
136
  });
133
- const setAutoHideTimer = useEventCallback(autoHideDurationParam => {
134
- if (!onClose || autoHideDurationParam == null) {
135
- return;
136
- }
137
- clearTimeout(timerAutoHide.current);
138
- timerAutoHide.current = setTimeout(() => {
139
- handleClose(null, 'timeout');
140
- }, autoHideDurationParam);
141
- });
142
- React.useEffect(() => {
143
- if (open) {
144
- setAutoHideTimer(autoHideDuration);
145
- }
146
- return () => {
147
- clearTimeout(timerAutoHide.current);
148
- };
149
- }, [open, autoHideDuration, setAutoHideTimer]);
150
-
151
- // Pause the timer when the user is interacting with the Snackbar
152
- // or when the user hide the window.
153
- const handlePause = () => {
154
- clearTimeout(timerAutoHide.current);
155
- };
156
-
157
- // Restart the timer when the user is no longer interacting with the Snackbar
158
- // or when the window is shown back.
159
- const handleResume = React.useCallback(() => {
160
- if (autoHideDuration != null) {
161
- setAutoHideTimer(resumeHideDuration != null ? resumeHideDuration : autoHideDuration * 0.5);
162
- }
163
- }, [autoHideDuration, resumeHideDuration, setAutoHideTimer]);
164
- const handleFocus = event => {
165
- if (onFocus) {
166
- onFocus(event);
167
- }
168
- handlePause();
169
- };
170
- const handleMouseEnter = event => {
171
- if (onMouseEnter) {
172
- onMouseEnter(event);
173
- }
174
- handlePause();
175
- };
176
- const handleBlur = event => {
177
- if (onBlur) {
178
- onBlur(event);
179
- }
180
- handleResume();
181
- };
182
- const handleMouseLeave = event => {
183
- if (onMouseLeave) {
184
- onMouseLeave(event);
185
- }
186
- handleResume();
187
- };
188
- const handleClickAway = event => {
189
- if (onClose) {
190
- onClose(event, 'clickaway');
191
- }
192
- };
193
137
  const handleExited = node => {
194
138
  setExited(true);
195
139
  if (onExited) {
@@ -202,63 +146,15 @@ const Snackbar = /*#__PURE__*/React.forwardRef(function Snackbar(inProps, ref) {
202
146
  onEnter(node, isAppearing);
203
147
  }
204
148
  };
205
- React.useEffect(() => {
206
- // TODO: window global should be refactored here
207
- if (!disableWindowBlurListener && open) {
208
- window.addEventListener('focus', handleResume);
209
- window.addEventListener('blur', handlePause);
210
- return () => {
211
- window.removeEventListener('focus', handleResume);
212
- window.removeEventListener('blur', handlePause);
213
- };
214
- }
215
- return undefined;
216
- }, [disableWindowBlurListener, handleResume, open]);
217
- React.useEffect(() => {
218
- if (!open) {
219
- return undefined;
220
- }
221
-
222
- /**
223
- * @param {KeyboardEvent} nativeEvent
224
- */
225
- function handleKeyDown(nativeEvent) {
226
- if (!nativeEvent.defaultPrevented) {
227
- // IE11, Edge (prior to using Bink?) use 'Esc'
228
- if (nativeEvent.key === 'Escape' || nativeEvent.key === 'Esc') {
229
- // not calling `preventDefault` since we don't know if people may ignore this event e.g. a permanently open snackbar
230
- if (onClose) {
231
- onClose(nativeEvent, 'escapeKeyDown');
232
- }
233
- }
234
- }
235
- }
236
- document.addEventListener('keydown', handleKeyDown);
237
- return () => {
238
- document.removeEventListener('keydown', handleKeyDown);
239
- };
240
- }, [exited, open, onClose]);
241
149
 
242
150
  // So we only render active snackbars.
243
151
  if (!open && exited) {
244
152
  return null;
245
153
  }
246
154
  return /*#__PURE__*/_jsx(ClickAwayListener, _extends({
247
- onClickAway: handleClickAway
155
+ onClickAway: onClickAway
248
156
  }, ClickAwayListenerProps, {
249
- children: /*#__PURE__*/_jsx(SnackbarRoot, _extends({
250
- className: clsx(classes.root, className),
251
- onBlur: handleBlur,
252
- onFocus: handleFocus,
253
- onMouseEnter: handleMouseEnter,
254
- onMouseLeave: handleMouseLeave,
255
- ownerState: ownerState,
256
- ref: ref
257
- // ClickAwayListener adds an `onClick` prop which results in the alert not being announced.
258
- // See https://github.com/mui/material-ui/issues/29080
259
- ,
260
- role: "presentation"
261
- }, other, {
157
+ children: /*#__PURE__*/_jsx(SnackbarRoot, _extends({}, rootProps, {
262
158
  children: /*#__PURE__*/_jsx(TransitionComponent, _extends({
263
159
  appear: true,
264
160
  in: open,
@@ -1,20 +1,20 @@
1
- export interface SnackbarClasses {
2
- /** Styles applied to the root element. */
3
- root: string;
4
- /** Styles applied to the root element if `anchorOrigin={{ 'top', 'center' }}`. */
5
- anchorOriginTopCenter: string;
6
- /** Styles applied to the root element if `anchorOrigin={{ 'bottom', 'center' }}`. */
7
- anchorOriginBottomCenter: string;
8
- /** Styles applied to the root element if `anchorOrigin={{ 'top', 'right' }}`. */
9
- anchorOriginTopRight: string;
10
- /** Styles applied to the root element if `anchorOrigin={{ 'bottom', 'right' }}`. */
11
- anchorOriginBottomRight: string;
12
- /** Styles applied to the root element if `anchorOrigin={{ 'top', 'left' }}`. */
13
- anchorOriginTopLeft: string;
14
- /** Styles applied to the root element if `anchorOrigin={{ 'bottom', 'left' }}`. */
15
- anchorOriginBottomLeft: string;
16
- }
17
- export type SnackbarClassKey = keyof SnackbarClasses;
18
- export declare function getSnackbarUtilityClass(slot: string): string;
19
- declare const snackbarClasses: SnackbarClasses;
20
- export default snackbarClasses;
1
+ export interface SnackbarClasses {
2
+ /** Styles applied to the root element. */
3
+ root: string;
4
+ /** Styles applied to the root element if `anchorOrigin={{ 'top', 'center' }}`. */
5
+ anchorOriginTopCenter: string;
6
+ /** Styles applied to the root element if `anchorOrigin={{ 'bottom', 'center' }}`. */
7
+ anchorOriginBottomCenter: string;
8
+ /** Styles applied to the root element if `anchorOrigin={{ 'top', 'right' }}`. */
9
+ anchorOriginTopRight: string;
10
+ /** Styles applied to the root element if `anchorOrigin={{ 'bottom', 'right' }}`. */
11
+ anchorOriginBottomRight: string;
12
+ /** Styles applied to the root element if `anchorOrigin={{ 'top', 'left' }}`. */
13
+ anchorOriginTopLeft: string;
14
+ /** Styles applied to the root element if `anchorOrigin={{ 'bottom', 'left' }}`. */
15
+ anchorOriginBottomLeft: string;
16
+ }
17
+ export type SnackbarClassKey = keyof SnackbarClasses;
18
+ export declare function getSnackbarUtilityClass(slot: string): string;
19
+ declare const snackbarClasses: SnackbarClasses;
20
+ export default snackbarClasses;
@@ -1,12 +1,12 @@
1
- export interface SnackbarContentClasses {
2
- /** Styles applied to the root element. */
3
- root: string;
4
- /** Styles applied to the message wrapper element. */
5
- message: string;
6
- /** Styles applied to the action wrapper element if `action` is provided. */
7
- action: string;
8
- }
9
- export type SnackbarContentClassKey = keyof SnackbarContentClasses;
10
- export declare function getSnackbarContentUtilityClass(slot: string): string;
11
- declare const snackbarContentClasses: SnackbarContentClasses;
12
- export default snackbarContentClasses;
1
+ export interface SnackbarContentClasses {
2
+ /** Styles applied to the root element. */
3
+ root: string;
4
+ /** Styles applied to the message wrapper element. */
5
+ message: string;
6
+ /** Styles applied to the action wrapper element if `action` is provided. */
7
+ action: string;
8
+ }
9
+ export type SnackbarContentClassKey = keyof SnackbarContentClasses;
10
+ export declare function getSnackbarContentUtilityClass(slot: string): string;
11
+ declare const snackbarContentClasses: SnackbarContentClasses;
12
+ export default snackbarContentClasses;
@@ -1,22 +1,22 @@
1
- export interface SpeedDialClasses {
2
- /** Styles applied to the root element. */
3
- root: string;
4
- /** Styles applied to the Fab component. */
5
- fab: string;
6
- /** Styles applied to the root element if direction="up" */
7
- directionUp: string;
8
- /** Styles applied to the root element if direction="down" */
9
- directionDown: string;
10
- /** Styles applied to the root element if direction="left" */
11
- directionLeft: string;
12
- /** Styles applied to the root element if direction="right" */
13
- directionRight: string;
14
- /** Styles applied to the actions (`children` wrapper) element. */
15
- actions: string;
16
- /** Styles applied to the actions (`children` wrapper) element if `open={false}`. */
17
- actionsClosed: string;
18
- }
19
- export type SpeedDialClassKey = keyof SpeedDialClasses;
20
- export declare function getSpeedDialUtilityClass(slot: string): string;
21
- declare const speedDialClasses: SpeedDialClasses;
22
- export default speedDialClasses;
1
+ export interface SpeedDialClasses {
2
+ /** Styles applied to the root element. */
3
+ root: string;
4
+ /** Styles applied to the Fab component. */
5
+ fab: string;
6
+ /** Styles applied to the root element if direction="up" */
7
+ directionUp: string;
8
+ /** Styles applied to the root element if direction="down" */
9
+ directionDown: string;
10
+ /** Styles applied to the root element if direction="left" */
11
+ directionLeft: string;
12
+ /** Styles applied to the root element if direction="right" */
13
+ directionRight: string;
14
+ /** Styles applied to the actions (`children` wrapper) element. */
15
+ actions: string;
16
+ /** Styles applied to the actions (`children` wrapper) element if `open={false}`. */
17
+ actionsClosed: string;
18
+ }
19
+ export type SpeedDialClassKey = keyof SpeedDialClasses;
20
+ export declare function getSpeedDialUtilityClass(slot: string): string;
21
+ declare const speedDialClasses: SpeedDialClasses;
22
+ export default speedDialClasses;
@@ -1,20 +1,20 @@
1
- export interface SpeedDialActionClasses {
2
- /** Styles applied to the Fab component. */
3
- fab: string;
4
- /** Styles applied to the Fab component if `open={false}`. */
5
- fabClosed: string;
6
- /** Styles applied to the root element if `tooltipOpen={true}`. */
7
- staticTooltip: string;
8
- /** Styles applied to the root element if `tooltipOpen={true}` and `open={false}`. */
9
- staticTooltipClosed: string;
10
- /** Styles applied to the static tooltip label if `tooltipOpen={true}`. */
11
- staticTooltipLabel: string;
12
- /** Styles applied to the root element if `tooltipOpen={true}` and `tooltipPlacement="left"`` */
13
- tooltipPlacementLeft: string;
14
- /** Styles applied to the root element if `tooltipOpen={true}` and `tooltipPlacement="right"`` */
15
- tooltipPlacementRight: string;
16
- }
17
- export type SpeedDialActionClassKey = keyof SpeedDialActionClasses;
18
- export declare function getSpeedDialActionUtilityClass(slot: string): string;
19
- declare const speedDialActionClasses: SpeedDialActionClasses;
20
- export default speedDialActionClasses;
1
+ export interface SpeedDialActionClasses {
2
+ /** Styles applied to the Fab component. */
3
+ fab: string;
4
+ /** Styles applied to the Fab component if `open={false}`. */
5
+ fabClosed: string;
6
+ /** Styles applied to the root element if `tooltipOpen={true}`. */
7
+ staticTooltip: string;
8
+ /** Styles applied to the root element if `tooltipOpen={true}` and `open={false}`. */
9
+ staticTooltipClosed: string;
10
+ /** Styles applied to the static tooltip label if `tooltipOpen={true}`. */
11
+ staticTooltipLabel: string;
12
+ /** Styles applied to the root element if `tooltipOpen={true}` and `tooltipPlacement="left"`` */
13
+ tooltipPlacementLeft: string;
14
+ /** Styles applied to the root element if `tooltipOpen={true}` and `tooltipPlacement="right"`` */
15
+ tooltipPlacementRight: string;
16
+ }
17
+ export type SpeedDialActionClassKey = keyof SpeedDialActionClasses;
18
+ export declare function getSpeedDialActionUtilityClass(slot: string): string;
19
+ declare const speedDialActionClasses: SpeedDialActionClasses;
20
+ export default speedDialActionClasses;
@@ -1,18 +1,18 @@
1
- export interface SpeedDialIconClasses {
2
- /** Styles applied to the root element. */
3
- root: string;
4
- /** Styles applied to the icon component. */
5
- icon: string;
6
- /** Styles applied to the icon component if `open={true}`. */
7
- iconOpen: string;
8
- /** Styles applied to the icon when an `openIcon` is provided and if `open={true}`. */
9
- iconWithOpenIconOpen: string;
10
- /** Styles applied to the `openIcon` if provided. */
11
- openIcon: string;
12
- /** Styles applied to the `openIcon` if provided and if `open={true}`. */
13
- openIconOpen: string;
14
- }
15
- export type SpeedDialIconClassKey = keyof SpeedDialIconClasses;
16
- export declare function getSpeedDialIconUtilityClass(slot: string): string;
17
- declare const speedDialIconClasses: SpeedDialIconClasses;
18
- export default speedDialIconClasses;
1
+ export interface SpeedDialIconClasses {
2
+ /** Styles applied to the root element. */
3
+ root: string;
4
+ /** Styles applied to the icon component. */
5
+ icon: string;
6
+ /** Styles applied to the icon component if `open={true}`. */
7
+ iconOpen: string;
8
+ /** Styles applied to the icon when an `openIcon` is provided and if `open={true}`. */
9
+ iconWithOpenIconOpen: string;
10
+ /** Styles applied to the `openIcon` if provided. */
11
+ openIcon: string;
12
+ /** Styles applied to the `openIcon` if provided and if `open={true}`. */
13
+ openIconOpen: string;
14
+ }
15
+ export type SpeedDialIconClassKey = keyof SpeedDialIconClasses;
16
+ export declare function getSpeedDialIconUtilityClass(slot: string): string;
17
+ declare const speedDialIconClasses: SpeedDialIconClasses;
18
+ export default speedDialIconClasses;
package/Stack/Stack.d.ts CHANGED
@@ -6,7 +6,6 @@ import { Theme } from '../styles/createTheme';
6
6
  export interface StackTypeMap<P = {}, D extends React.ElementType = 'div'> {
7
7
  props: P &
8
8
  SystemProps<Theme> & {
9
- ref?: React.Ref<unknown>;
10
9
  /**
11
10
  * The content of the component.
12
11
  */
package/Stack/Stack.js CHANGED
@@ -1,128 +1,17 @@
1
- import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
2
- import _extends from "@babel/runtime/helpers/esm/extends";
3
- const _excluded = ["component", "direction", "spacing", "divider", "children"];
4
- import * as React from 'react';
5
1
  import PropTypes from 'prop-types';
6
- import { createUnarySpacing, getValue, handleBreakpoints, mergeBreakpointsInOrder, unstable_extendSxProp as extendSxProp, unstable_resolveBreakpointValues as resolveBreakpointValues } from '@mui/system';
7
- import { deepmerge } from '@mui/utils';
2
+ import { createStack } from '@mui/system';
8
3
  import styled from '../styles/styled';
9
4
  import useThemeProps from '../styles/useThemeProps';
10
-
11
- /**
12
- * Return an array with the separator React element interspersed between
13
- * each React node of the input children.
14
- *
15
- * > joinChildren([1,2,3], 0)
16
- * [1,0,2,0,3]
17
- */
18
- import { jsx as _jsx } from "react/jsx-runtime";
19
- function joinChildren(children, separator) {
20
- const childrenArray = React.Children.toArray(children).filter(Boolean);
21
- return childrenArray.reduce((output, child, index) => {
22
- output.push(child);
23
- if (index < childrenArray.length - 1) {
24
- output.push( /*#__PURE__*/React.cloneElement(separator, {
25
- key: `separator-${index}`
26
- }));
27
- }
28
- return output;
29
- }, []);
30
- }
31
- const getSideFromDirection = direction => {
32
- return {
33
- row: 'Left',
34
- 'row-reverse': 'Right',
35
- column: 'Top',
36
- 'column-reverse': 'Bottom'
37
- }[direction];
38
- };
39
- export const style = ({
40
- ownerState,
41
- theme
42
- }) => {
43
- let styles = _extends({
44
- display: 'flex',
45
- flexDirection: 'column'
46
- }, handleBreakpoints({
47
- theme
48
- }, resolveBreakpointValues({
49
- values: ownerState.direction,
50
- breakpoints: theme.breakpoints.values
51
- }), propValue => ({
52
- flexDirection: propValue
53
- })));
54
- if (ownerState.spacing) {
55
- const transformer = createUnarySpacing(theme);
56
- const base = Object.keys(theme.breakpoints.values).reduce((acc, breakpoint) => {
57
- if (typeof ownerState.spacing === 'object' && ownerState.spacing[breakpoint] != null || typeof ownerState.direction === 'object' && ownerState.direction[breakpoint] != null) {
58
- acc[breakpoint] = true;
59
- }
60
- return acc;
61
- }, {});
62
- const directionValues = resolveBreakpointValues({
63
- values: ownerState.direction,
64
- base
65
- });
66
- const spacingValues = resolveBreakpointValues({
67
- values: ownerState.spacing,
68
- base
69
- });
70
- if (typeof directionValues === 'object') {
71
- Object.keys(directionValues).forEach((breakpoint, index, breakpoints) => {
72
- const directionValue = directionValues[breakpoint];
73
- if (!directionValue) {
74
- const previousDirectionValue = index > 0 ? directionValues[breakpoints[index - 1]] : 'column';
75
- directionValues[breakpoint] = previousDirectionValue;
76
- }
77
- });
78
- }
79
- const styleFromPropValue = (propValue, breakpoint) => {
80
- return {
81
- '& > :not(style) + :not(style)': {
82
- margin: 0,
83
- [`margin${getSideFromDirection(breakpoint ? directionValues[breakpoint] : ownerState.direction)}`]: getValue(transformer, propValue)
84
- }
85
- };
86
- };
87
- styles = deepmerge(styles, handleBreakpoints({
88
- theme
89
- }, spacingValues, styleFromPropValue));
90
- }
91
- styles = mergeBreakpointsInOrder(theme.breakpoints, styles);
92
- return styles;
93
- };
94
- const StackRoot = styled('div', {
95
- name: 'MuiStack',
96
- slot: 'Root',
97
- overridesResolver: (props, styles) => {
98
- return [styles.root];
99
- }
100
- })(style);
101
- const Stack = /*#__PURE__*/React.forwardRef(function Stack(inProps, ref) {
102
- const themeProps = useThemeProps({
5
+ const Stack = createStack({
6
+ createStyledComponent: styled('div', {
7
+ name: 'MuiStack',
8
+ slot: 'Root',
9
+ overridesResolver: (props, styles) => styles.root
10
+ }),
11
+ useThemeProps: inProps => useThemeProps({
103
12
  props: inProps,
104
13
  name: 'MuiStack'
105
- });
106
- const props = extendSxProp(themeProps);
107
- const {
108
- component = 'div',
109
- direction = 'column',
110
- spacing = 0,
111
- divider,
112
- children
113
- } = props,
114
- other = _objectWithoutPropertiesLoose(props, _excluded);
115
- const ownerState = {
116
- direction,
117
- spacing
118
- };
119
- return /*#__PURE__*/_jsx(StackRoot, _extends({
120
- as: component,
121
- ownerState: ownerState,
122
- ref: ref
123
- }, other, {
124
- children: divider ? joinChildren(children, divider) : children
125
- }));
14
+ })
126
15
  });
127
16
  process.env.NODE_ENV !== "production" ? Stack.propTypes /* remove-proptypes */ = {
128
17
  // ----------------------------- Warning --------------------------------
package/Stack/index.d.ts CHANGED
@@ -1,2 +1,5 @@
1
1
  export { default } from './Stack';
2
2
  export * from './Stack';
3
+
4
+ export { default as stackClasses } from './stackClasses';
5
+ export * from './stackClasses';
package/Stack/index.js CHANGED
@@ -1 +1,2 @@
1
- export { default } from './Stack';
1
+ export { default } from './Stack';
2
+ export { default as stackClasses } from './stackClasses';
@@ -0,0 +1,6 @@
1
+ import { StackClasses } from '@mui/system';
2
+ export type { StackClassKey } from '@mui/system';
3
+ export type { StackClasses };
4
+ export declare function getStackUtilityClass(slot: string): string;
5
+ declare const stackClasses: StackClasses;
6
+ export default stackClasses;
@@ -0,0 +1,7 @@
1
+ import { unstable_generateUtilityClasses as generateUtilityClasses } from '@mui/utils';
2
+ import generateUtilityClass from '../generateUtilityClass';
3
+ export function getStackUtilityClass(slot) {
4
+ return generateUtilityClass('MuiStack', slot);
5
+ }
6
+ const stackClasses = generateUtilityClasses('MuiStack', ['root']);
7
+ export default stackClasses;
@@ -1,20 +1,20 @@
1
- import * as React from 'react';
2
- export interface StepContextType {
3
- index: number;
4
- last: boolean;
5
- expanded: boolean;
6
- icon: React.ReactNode;
7
- active: boolean;
8
- completed: boolean;
9
- disabled: boolean;
10
- }
11
- /**
12
- * Provides information about the current step in Stepper.
13
- */
14
- declare const StepContext: React.Context<{} | StepContextType>;
15
- /**
16
- * Returns the current StepContext or an empty object if no StepContext
17
- * has been defined in the component tree.
18
- */
19
- export declare function useStepContext(): StepContextType | {};
20
- export default StepContext;
1
+ import * as React from 'react';
2
+ export interface StepContextType {
3
+ index: number;
4
+ last: boolean;
5
+ expanded: boolean;
6
+ icon: React.ReactNode;
7
+ active: boolean;
8
+ completed: boolean;
9
+ disabled: boolean;
10
+ }
11
+ /**
12
+ * Provides information about the current step in Stepper.
13
+ */
14
+ declare const StepContext: React.Context<{} | StepContextType>;
15
+ /**
16
+ * Returns the current StepContext or an empty object if no StepContext
17
+ * has been defined in the component tree.
18
+ */
19
+ export declare function useStepContext(): StepContextType | {};
20
+ export default StepContext;
@@ -1,16 +1,16 @@
1
- export interface StepClasses {
2
- /** Styles applied to the root element. */
3
- root: string;
4
- /** Styles applied to the root element if `orientation="horizontal"`. */
5
- horizontal: string;
6
- /** Styles applied to the root element if `orientation="vertical"`. */
7
- vertical: string;
8
- /** Styles applied to the root element if `alternativeLabel={true}`. */
9
- alternativeLabel: string;
10
- /** State class applied to the root element if `completed={true}`. */
11
- completed: string;
12
- }
13
- export type StepClassKey = keyof StepClasses;
14
- export declare function getStepUtilityClass(slot: string): string;
15
- declare const stepClasses: StepClasses;
16
- export default stepClasses;
1
+ export interface StepClasses {
2
+ /** Styles applied to the root element. */
3
+ root: string;
4
+ /** Styles applied to the root element if `orientation="horizontal"`. */
5
+ horizontal: string;
6
+ /** Styles applied to the root element if `orientation="vertical"`. */
7
+ vertical: string;
8
+ /** Styles applied to the root element if `alternativeLabel={true}`. */
9
+ alternativeLabel: string;
10
+ /** State class applied to the root element if `completed={true}`. */
11
+ completed: string;
12
+ }
13
+ export type StepClassKey = keyof StepClasses;
14
+ export declare function getStepUtilityClass(slot: string): string;
15
+ declare const stepClasses: StepClasses;
16
+ export default stepClasses;
@@ -1,14 +1,14 @@
1
- export interface StepButtonClasses {
2
- /** Styles applied to the root element. */
3
- root: string;
4
- /** Styles applied to the root element if `orientation="horizontal"`. */
5
- horizontal: string;
6
- /** Styles applied to the root element if `orientation="vertical"`. */
7
- vertical: string;
8
- /** Styles applied to the `ButtonBase` touch-ripple. */
9
- touchRipple: string;
10
- }
11
- export type StepButtonClassKey = keyof StepButtonClasses;
12
- export declare function getStepButtonUtilityClass(slot: string): string;
13
- declare const stepButtonClasses: StepButtonClasses;
14
- export default stepButtonClasses;
1
+ export interface StepButtonClasses {
2
+ /** Styles applied to the root element. */
3
+ root: string;
4
+ /** Styles applied to the root element if `orientation="horizontal"`. */
5
+ horizontal: string;
6
+ /** Styles applied to the root element if `orientation="vertical"`. */
7
+ vertical: string;
8
+ /** Styles applied to the `ButtonBase` touch-ripple. */
9
+ touchRipple: string;
10
+ }
11
+ export type StepButtonClassKey = keyof StepButtonClasses;
12
+ export declare function getStepButtonUtilityClass(slot: string): string;
13
+ declare const stepButtonClasses: StepButtonClasses;
14
+ export default stepButtonClasses;