@mui/material 6.4.4 → 7.0.0-alpha.0
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/Accordion/Accordion.d.ts +3 -3
- package/AccordionActions/AccordionActions.d.ts +2 -2
- package/AccordionDetails/AccordionDetails.d.ts +2 -2
- package/AccordionSummary/AccordionSummary.d.ts +3 -3
- package/Alert/Alert.d.ts +3 -3
- package/AlertTitle/AlertTitle.d.ts +3 -3
- package/AppBar/AppBar.d.ts +3 -3
- package/Autocomplete/Autocomplete.d.ts +2 -2
- package/Avatar/Avatar.d.ts +2 -2
- package/AvatarGroup/AvatarGroup.d.ts +2 -2
- package/Backdrop/Backdrop.d.ts +3 -3
- package/Badge/Badge.d.ts +3 -3
- package/BottomNavigation/BottomNavigation.d.ts +2 -2
- package/BottomNavigationAction/BottomNavigationAction.d.ts +3 -3
- package/Box/Box.d.ts +2 -2
- package/Breadcrumbs/Breadcrumbs.d.ts +3 -3
- package/Button/Button.d.ts +4 -4
- package/ButtonBase/ButtonBase.d.ts +2 -2
- package/ButtonGroup/ButtonGroup.d.ts +2 -2
- package/CHANGELOG.md +24 -2272
- package/Card/Card.d.ts +3 -3
- package/CardActionArea/CardActionArea.d.ts +3 -3
- package/CardActions/CardActions.d.ts +2 -2
- package/CardContent/CardContent.d.ts +2 -2
- package/CardHeader/CardHeader.d.ts +2 -2
- package/CardMedia/CardMedia.d.ts +2 -2
- package/Checkbox/Checkbox.d.ts +4 -4
- package/Chip/Chip.d.ts +2 -2
- package/CircularProgress/CircularProgress.d.ts +3 -7
- package/ClickAwayListener/ClickAwayListener.d.ts +3 -3
- package/ClickAwayListener/ClickAwayListener.js +3 -3
- package/Collapse/Collapse.d.ts +5 -5
- package/Container/Container.d.ts +2 -2
- package/CssBaseline/CssBaseline.d.ts +2 -2
- package/Dialog/Dialog.d.ts +3 -3
- package/DialogActions/DialogActions.d.ts +2 -2
- package/DialogContent/DialogContent.d.ts +2 -2
- package/DialogContentText/DialogContentText.d.ts +3 -3
- package/DialogTitle/DialogTitle.d.ts +3 -3
- package/Divider/Divider.d.ts +3 -3
- package/Drawer/Drawer.d.ts +3 -3
- package/Fab/Fab.d.ts +3 -3
- package/Fade/Fade.d.ts +3 -3
- package/FilledInput/FilledInput.d.ts +3 -3
- package/FormControl/FormControl.d.ts +6 -6
- package/FormControlLabel/FormControlLabel.d.ts +4 -4
- package/FormGroup/FormGroup.d.ts +3 -3
- package/FormHelperText/FormHelperText.d.ts +2 -2
- package/FormLabel/FormLabel.d.ts +4 -4
- package/GlobalStyles/GlobalStyles.d.ts +2 -2
- package/Grid/Grid.d.ts +2 -2
- package/Grid2/Grid2.d.ts +2 -2
- package/Grid2/Grid2.js +2 -2
- package/Grow/Grow.d.ts +5 -5
- package/Hidden/Hidden.d.ts +2 -2
- package/Icon/Icon.d.ts +3 -3
- package/IconButton/IconButton.d.ts +4 -4
- package/ImageList/ImageList.d.ts +2 -2
- package/ImageListItem/ImageListItem.d.ts +2 -2
- package/ImageListItemBar/ImageListItemBar.d.ts +2 -2
- package/Input/Input.d.ts +3 -3
- package/InputAdornment/InputAdornment.d.ts +2 -2
- package/InputBase/InputBase.d.ts +2 -2
- package/InputLabel/InputLabel.d.ts +3 -3
- package/LinearProgress/LinearProgress.d.ts +3 -7
- package/Link/Link.d.ts +4 -4
- package/List/List.d.ts +3 -3
- package/ListItem/ListItem.d.ts +3 -3
- package/ListItemAvatar/ListItemAvatar.d.ts +2 -2
- package/ListItemButton/ListItemButton.d.ts +3 -3
- package/ListItemIcon/ListItemIcon.d.ts +2 -2
- package/ListItemSecondaryAction/ListItemSecondaryAction.d.ts +2 -2
- package/ListItemText/ListItemText.d.ts +2 -2
- package/ListSubheader/ListSubheader.d.ts +2 -2
- package/Menu/Menu.d.ts +4 -4
- package/Menu/Menu.js +6 -2
- package/MenuItem/MenuItem.d.ts +3 -3
- package/MenuList/MenuList.d.ts +4 -4
- package/MobileStepper/MobileStepper.d.ts +4 -72
- package/MobileStepper/MobileStepper.js +18 -76
- package/Modal/Modal.d.ts +7 -7
- package/Modal/Modal.js +9 -10
- package/NativeSelect/NativeSelect.d.ts +3 -3
- package/NoSsr/NoSsr.d.ts +2 -2
- package/NoSsr/NoSsr.js +2 -2
- package/OutlinedInput/OutlinedInput.d.ts +3 -3
- package/Pagination/Pagination.d.ts +2 -2
- package/PaginationItem/PaginationItem.d.ts +2 -2
- package/Paper/Paper.d.ts +3 -3
- package/PigmentContainer/PigmentContainer.d.ts +2 -2
- package/PigmentContainer/PigmentContainer.js +2 -2
- package/PigmentGrid/PigmentGrid.d.ts +2 -2
- package/PigmentGrid/PigmentGrid.js +2 -2
- package/PigmentHidden/PigmentHidden.d.ts +2 -2
- package/PigmentHidden/PigmentHidden.js +2 -2
- package/PigmentStack/PigmentStack.d.ts +2 -2
- package/PigmentStack/PigmentStack.js +2 -2
- package/Popover/Popover.d.ts +64 -10
- package/Popover/Popover.js +78 -51
- package/Popper/Popper.d.ts +4 -4
- package/Popper/Popper.js +4 -4
- package/Portal/Portal.d.ts +2 -2
- package/Portal/Portal.js +2 -2
- package/README.md +4 -3
- package/Radio/Radio.d.ts +3 -3
- package/RadioGroup/RadioGroup.d.ts +3 -3
- package/Rating/Rating.d.ts +2 -2
- package/ScopedCssBaseline/ScopedCssBaseline.d.ts +2 -2
- package/Select/Select.d.ts +3 -3
- package/Skeleton/Skeleton.d.ts +2 -2
- package/Slide/Slide.d.ts +4 -4
- package/Slider/Slider.d.ts +20 -11
- package/Slider/Slider.js +2 -2
- package/Slider/sliderClasses.d.ts +7 -21
- package/Snackbar/Snackbar.d.ts +80 -3
- package/Snackbar/Snackbar.js +122 -32
- package/SnackbarContent/SnackbarContent.d.ts +3 -3
- package/SpeedDial/SpeedDial.d.ts +2 -2
- package/SpeedDialAction/SpeedDialAction.d.ts +3 -3
- package/SpeedDialIcon/SpeedDialIcon.d.ts +2 -2
- package/Stack/Stack.d.ts +2 -2
- package/Step/Step.d.ts +2 -2
- package/StepButton/StepButton.d.ts +3 -3
- package/StepConnector/StepConnector.d.ts +2 -2
- package/StepContent/StepContent.d.ts +2 -2
- package/StepIcon/StepIcon.d.ts +3 -3
- package/StepLabel/StepLabel.d.ts +2 -2
- package/Stepper/Stepper.d.ts +2 -2
- package/SvgIcon/SvgIcon.d.ts +3 -3
- package/SwipeableDrawer/SwipeableDrawer.d.ts +3 -3
- package/Switch/Switch.d.ts +4 -4
- package/Tab/Tab.d.ts +3 -3
- package/TabScrollButton/TabScrollButton.d.ts +2 -2
- package/Table/Table.d.ts +2 -2
- package/TableBody/TableBody.d.ts +2 -2
- package/TableCell/TableCell.d.ts +2 -2
- package/TableContainer/TableContainer.d.ts +2 -2
- package/TableFooter/TableFooter.d.ts +2 -2
- package/TableHead/TableHead.d.ts +2 -2
- package/TablePagination/TablePagination.d.ts +4 -4
- package/TableRow/TableRow.d.ts +2 -2
- package/TableSortLabel/TableSortLabel.d.ts +3 -3
- package/Tabs/Tabs.d.ts +2 -2
- package/TextField/TextField.d.ts +10 -10
- package/TextareaAutosize/TextareaAutosize.d.ts +2 -2
- package/TextareaAutosize/TextareaAutosize.js +2 -2
- package/ToggleButton/ToggleButton.d.ts +3 -3
- package/ToggleButtonGroup/ToggleButtonGroup.d.ts +2 -2
- package/Toolbar/Toolbar.d.ts +2 -2
- package/Tooltip/Tooltip.d.ts +2 -2
- package/Typography/Typography.d.ts +3 -3
- package/Zoom/Zoom.d.ts +3 -3
- package/index.js +1 -1
- package/internal/SwitchBase.d.ts +33 -1
- package/internal/SwitchBase.js +84 -30
- package/modern/ClickAwayListener/ClickAwayListener.js +3 -3
- package/modern/Grid2/Grid2.js +2 -2
- package/modern/Menu/Menu.js +6 -2
- package/modern/MobileStepper/MobileStepper.js +18 -76
- package/modern/Modal/Modal.js +9 -10
- package/modern/NoSsr/NoSsr.js +2 -2
- package/modern/PigmentContainer/PigmentContainer.js +2 -2
- package/modern/PigmentGrid/PigmentGrid.js +2 -2
- package/modern/PigmentHidden/PigmentHidden.js +2 -2
- package/modern/PigmentStack/PigmentStack.js +2 -2
- package/modern/Popover/Popover.js +78 -51
- package/modern/Popper/Popper.js +4 -4
- package/modern/Portal/Portal.js +2 -2
- package/modern/Slider/Slider.js +2 -2
- package/modern/Snackbar/Snackbar.js +122 -32
- package/modern/TextareaAutosize/TextareaAutosize.js +2 -2
- package/modern/index.js +1 -1
- package/modern/internal/SwitchBase.js +84 -30
- package/modern/version/index.js +5 -5
- package/node/ClickAwayListener/ClickAwayListener.js +3 -3
- package/node/Grid2/Grid2.js +2 -2
- package/node/Menu/Menu.js +6 -2
- package/node/MobileStepper/MobileStepper.js +18 -76
- package/node/Modal/Modal.js +9 -10
- package/node/NoSsr/NoSsr.js +2 -2
- package/node/PigmentContainer/PigmentContainer.js +2 -2
- package/node/PigmentGrid/PigmentGrid.js +2 -2
- package/node/PigmentHidden/PigmentHidden.js +2 -2
- package/node/PigmentStack/PigmentStack.js +2 -2
- package/node/Popover/Popover.js +78 -51
- package/node/Popper/Popper.js +4 -4
- package/node/Portal/Portal.js +2 -2
- package/node/Slider/Slider.js +2 -2
- package/node/Snackbar/Snackbar.js +122 -32
- package/node/TextareaAutosize/TextareaAutosize.js +2 -2
- package/node/index.js +1 -1
- package/node/internal/SwitchBase.js +84 -30
- package/node/version/index.js +5 -5
- package/package.json +7 -7
- package/version/index.js +5 -5
|
@@ -10,7 +10,6 @@ exports.default = void 0;
|
|
|
10
10
|
var React = _interopRequireWildcard(require("react"));
|
|
11
11
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
12
12
|
var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
|
|
13
|
-
var _useSlotProps = _interopRequireDefault(require("@mui/utils/useSlotProps"));
|
|
14
13
|
var _useSnackbar = _interopRequireDefault(require("./useSnackbar"));
|
|
15
14
|
var _ClickAwayListener = _interopRequireDefault(require("../ClickAwayListener"));
|
|
16
15
|
var _zeroStyled = require("../zero-styled");
|
|
@@ -20,6 +19,7 @@ var _capitalize = _interopRequireDefault(require("../utils/capitalize"));
|
|
|
20
19
|
var _Grow = _interopRequireDefault(require("../Grow"));
|
|
21
20
|
var _SnackbarContent = _interopRequireDefault(require("../SnackbarContent"));
|
|
22
21
|
var _snackbarClasses = require("./snackbarClasses");
|
|
22
|
+
var _useSlot = _interopRequireDefault(require("../utils/useSlot"));
|
|
23
23
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
24
24
|
const useUtilityClasses = ownerState => {
|
|
25
25
|
const {
|
|
@@ -127,8 +127,8 @@ const Snackbar = /*#__PURE__*/React.forwardRef(function Snackbar(inProps, ref) {
|
|
|
127
127
|
autoHideDuration = null,
|
|
128
128
|
children,
|
|
129
129
|
className,
|
|
130
|
-
ClickAwayListenerProps,
|
|
131
|
-
ContentProps,
|
|
130
|
+
ClickAwayListenerProps: ClickAwayListenerPropsProp,
|
|
131
|
+
ContentProps: ContentPropsProp,
|
|
132
132
|
disableWindowBlurListener = false,
|
|
133
133
|
message,
|
|
134
134
|
onBlur,
|
|
@@ -138,12 +138,14 @@ const Snackbar = /*#__PURE__*/React.forwardRef(function Snackbar(inProps, ref) {
|
|
|
138
138
|
onMouseLeave,
|
|
139
139
|
open,
|
|
140
140
|
resumeHideDuration,
|
|
141
|
-
|
|
141
|
+
slots = {},
|
|
142
|
+
slotProps = {},
|
|
143
|
+
TransitionComponent: TransitionComponentProp,
|
|
142
144
|
transitionDuration = defaultTransitionDuration,
|
|
143
145
|
TransitionProps: {
|
|
144
146
|
onEnter,
|
|
145
147
|
onExited,
|
|
146
|
-
...
|
|
148
|
+
...TransitionPropsProp
|
|
147
149
|
} = {},
|
|
148
150
|
...other
|
|
149
151
|
} = props;
|
|
@@ -155,7 +157,7 @@ const Snackbar = /*#__PURE__*/React.forwardRef(function Snackbar(inProps, ref) {
|
|
|
155
157
|
},
|
|
156
158
|
autoHideDuration,
|
|
157
159
|
disableWindowBlurListener,
|
|
158
|
-
TransitionComponent,
|
|
160
|
+
TransitionComponent: TransitionComponentProp,
|
|
159
161
|
transitionDuration
|
|
160
162
|
};
|
|
161
163
|
const classes = useUtilityClasses(ownerState);
|
|
@@ -166,16 +168,6 @@ const Snackbar = /*#__PURE__*/React.forwardRef(function Snackbar(inProps, ref) {
|
|
|
166
168
|
...ownerState
|
|
167
169
|
});
|
|
168
170
|
const [exited, setExited] = React.useState(true);
|
|
169
|
-
const rootProps = (0, _useSlotProps.default)({
|
|
170
|
-
elementType: SnackbarRoot,
|
|
171
|
-
getSlotProps: getRootProps,
|
|
172
|
-
externalForwardedProps: other,
|
|
173
|
-
ownerState,
|
|
174
|
-
additionalProps: {
|
|
175
|
-
ref
|
|
176
|
-
},
|
|
177
|
-
className: [classes.root, className]
|
|
178
|
-
});
|
|
179
171
|
const handleExited = node => {
|
|
180
172
|
setExited(true);
|
|
181
173
|
if (onExited) {
|
|
@@ -188,28 +180,84 @@ const Snackbar = /*#__PURE__*/React.forwardRef(function Snackbar(inProps, ref) {
|
|
|
188
180
|
onEnter(node, isAppearing);
|
|
189
181
|
}
|
|
190
182
|
};
|
|
183
|
+
const externalForwardedProps = {
|
|
184
|
+
slots: {
|
|
185
|
+
transition: TransitionComponentProp,
|
|
186
|
+
...slots
|
|
187
|
+
},
|
|
188
|
+
slotProps: {
|
|
189
|
+
content: ContentPropsProp,
|
|
190
|
+
clickAwayListener: ClickAwayListenerPropsProp,
|
|
191
|
+
transition: TransitionPropsProp,
|
|
192
|
+
...slotProps
|
|
193
|
+
}
|
|
194
|
+
};
|
|
195
|
+
const [Root, rootProps] = (0, _useSlot.default)('root', {
|
|
196
|
+
ref,
|
|
197
|
+
className: [classes.root, className],
|
|
198
|
+
elementType: SnackbarRoot,
|
|
199
|
+
getSlotProps: getRootProps,
|
|
200
|
+
externalForwardedProps: {
|
|
201
|
+
...externalForwardedProps,
|
|
202
|
+
...other
|
|
203
|
+
},
|
|
204
|
+
ownerState
|
|
205
|
+
});
|
|
206
|
+
const [ClickAwaySlot, clickAwayListenerProps] = (0, _useSlot.default)('clickAwayListener', {
|
|
207
|
+
elementType: _ClickAwayListener.default,
|
|
208
|
+
externalForwardedProps,
|
|
209
|
+
getSlotProps: handlers => ({
|
|
210
|
+
onClickAway: (...params) => {
|
|
211
|
+
handlers.onClickAway?.(...params);
|
|
212
|
+
onClickAway(...params);
|
|
213
|
+
}
|
|
214
|
+
}),
|
|
215
|
+
ownerState
|
|
216
|
+
});
|
|
217
|
+
const [ContentSlot, contentSlotProps] = (0, _useSlot.default)('content', {
|
|
218
|
+
elementType: _SnackbarContent.default,
|
|
219
|
+
shouldForwardComponentProp: true,
|
|
220
|
+
externalForwardedProps,
|
|
221
|
+
additionalProps: {
|
|
222
|
+
message,
|
|
223
|
+
action
|
|
224
|
+
},
|
|
225
|
+
ownerState
|
|
226
|
+
});
|
|
227
|
+
const [TransitionSlot, transitionProps] = (0, _useSlot.default)('transition', {
|
|
228
|
+
elementType: _Grow.default,
|
|
229
|
+
externalForwardedProps,
|
|
230
|
+
getSlotProps: handlers => ({
|
|
231
|
+
onEnter: (...params) => {
|
|
232
|
+
handlers.onEnter?.(...params);
|
|
233
|
+
handleEnter(...params);
|
|
234
|
+
},
|
|
235
|
+
onExited: (...params) => {
|
|
236
|
+
handlers.onExited?.(...params);
|
|
237
|
+
handleExited(...params);
|
|
238
|
+
}
|
|
239
|
+
}),
|
|
240
|
+
additionalProps: {
|
|
241
|
+
appear: true,
|
|
242
|
+
in: open,
|
|
243
|
+
timeout: transitionDuration,
|
|
244
|
+
direction: vertical === 'top' ? 'down' : 'up'
|
|
245
|
+
},
|
|
246
|
+
ownerState
|
|
247
|
+
});
|
|
191
248
|
|
|
192
249
|
// So we only render active snackbars.
|
|
193
250
|
if (!open && exited) {
|
|
194
251
|
return null;
|
|
195
252
|
}
|
|
196
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(SnackbarRoot, {
|
|
253
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(ClickAwaySlot, {
|
|
254
|
+
...clickAwayListenerProps,
|
|
255
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Root, {
|
|
200
256
|
...rootProps,
|
|
201
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
direction: vertical === 'top' ? 'down' : 'up',
|
|
206
|
-
onEnter: handleEnter,
|
|
207
|
-
onExited: handleExited,
|
|
208
|
-
...TransitionProps,
|
|
209
|
-
children: children || /*#__PURE__*/(0, _jsxRuntime.jsx)(_SnackbarContent.default, {
|
|
210
|
-
message: message,
|
|
211
|
-
action: action,
|
|
212
|
-
...ContentProps
|
|
257
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(TransitionSlot, {
|
|
258
|
+
...transitionProps,
|
|
259
|
+
children: children || /*#__PURE__*/(0, _jsxRuntime.jsx)(ContentSlot, {
|
|
260
|
+
...contentSlotProps
|
|
213
261
|
})
|
|
214
262
|
})
|
|
215
263
|
})
|
|
@@ -256,10 +304,12 @@ process.env.NODE_ENV !== "production" ? Snackbar.propTypes /* remove-proptypes *
|
|
|
256
304
|
className: _propTypes.default.string,
|
|
257
305
|
/**
|
|
258
306
|
* Props applied to the `ClickAwayListener` element.
|
|
307
|
+
* @deprecated Use `slotProps.clickAwayListener` instead. This prop will be removed in v7. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
259
308
|
*/
|
|
260
309
|
ClickAwayListenerProps: _propTypes.default.object,
|
|
261
310
|
/**
|
|
262
311
|
* Props applied to the [`SnackbarContent`](https://mui.com/material-ui/api/snackbar-content/) element.
|
|
312
|
+
* @deprecated Use `slotProps.content` instead. This prop will be removed in v7. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
263
313
|
*/
|
|
264
314
|
ContentProps: _propTypes.default.object,
|
|
265
315
|
/**
|
|
@@ -316,6 +366,44 @@ process.env.NODE_ENV !== "production" ? Snackbar.propTypes /* remove-proptypes *
|
|
|
316
366
|
* we default to `autoHideDuration / 2` ms.
|
|
317
367
|
*/
|
|
318
368
|
resumeHideDuration: _propTypes.default.number,
|
|
369
|
+
/**
|
|
370
|
+
* The props used for each slot inside.
|
|
371
|
+
* @default {}
|
|
372
|
+
*/
|
|
373
|
+
slotProps: _propTypes.default.shape({
|
|
374
|
+
clickAwayListener: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object, _propTypes.default.shape({
|
|
375
|
+
children: _propTypes.default.element.isRequired,
|
|
376
|
+
disableReactTree: _propTypes.default.bool,
|
|
377
|
+
mouseEvent: _propTypes.default.oneOf(['onClick', 'onMouseDown', 'onMouseUp', 'onPointerDown', 'onPointerUp', false]),
|
|
378
|
+
onClickAway: _propTypes.default.func,
|
|
379
|
+
touchEvent: _propTypes.default.oneOf(['onTouchEnd', 'onTouchStart', false])
|
|
380
|
+
}), _propTypes.default.shape({
|
|
381
|
+
children: _propTypes.default.element.isRequired,
|
|
382
|
+
disableReactTree: _propTypes.default.bool,
|
|
383
|
+
key: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.shape({
|
|
384
|
+
'__@toStringTag@9059': _propTypes.default.oneOf(['BigInt']).isRequired,
|
|
385
|
+
toLocaleString: _propTypes.default.func.isRequired,
|
|
386
|
+
toString: _propTypes.default.func.isRequired,
|
|
387
|
+
valueOf: _propTypes.default.func.isRequired
|
|
388
|
+
}), _propTypes.default.string]),
|
|
389
|
+
mouseEvent: _propTypes.default.oneOf(['onClick', 'onMouseDown', 'onMouseUp', 'onPointerDown', 'onPointerUp', false]),
|
|
390
|
+
onClickAway: _propTypes.default.func,
|
|
391
|
+
touchEvent: _propTypes.default.oneOf(['onTouchEnd', 'onTouchStart', false])
|
|
392
|
+
})]),
|
|
393
|
+
content: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object]),
|
|
394
|
+
root: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object]),
|
|
395
|
+
transition: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object])
|
|
396
|
+
}),
|
|
397
|
+
/**
|
|
398
|
+
* The components used for each slot inside.
|
|
399
|
+
* @default {}
|
|
400
|
+
*/
|
|
401
|
+
slots: _propTypes.default.shape({
|
|
402
|
+
clickAwayListener: _propTypes.default.elementType,
|
|
403
|
+
content: _propTypes.default.elementType,
|
|
404
|
+
root: _propTypes.default.elementType,
|
|
405
|
+
transition: _propTypes.default.elementType
|
|
406
|
+
}),
|
|
319
407
|
/**
|
|
320
408
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
321
409
|
*/
|
|
@@ -323,6 +411,7 @@ process.env.NODE_ENV !== "production" ? Snackbar.propTypes /* remove-proptypes *
|
|
|
323
411
|
/**
|
|
324
412
|
* The component used for the transition.
|
|
325
413
|
* [Follow this guide](https://mui.com/material-ui/transitions/#transitioncomponent-prop) to learn more about the requirements for this component.
|
|
414
|
+
* @deprecated Use `slots.transition` instead. This prop will be removed in v7. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
326
415
|
* @default Grow
|
|
327
416
|
*/
|
|
328
417
|
TransitionComponent: _propTypes.default.elementType,
|
|
@@ -342,6 +431,7 @@ process.env.NODE_ENV !== "production" ? Snackbar.propTypes /* remove-proptypes *
|
|
|
342
431
|
/**
|
|
343
432
|
* Props applied to the transition element.
|
|
344
433
|
* By default, the element is based on this [`Transition`](https://reactcommunity.org/react-transition-group/transition/) component.
|
|
434
|
+
* @deprecated Use `slotProps.transition` instead. This prop will be removed in v7. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
345
435
|
* @default {}
|
|
346
436
|
*/
|
|
347
437
|
TransitionProps: _propTypes.default.object
|
|
@@ -44,11 +44,11 @@ function isEmpty(obj) {
|
|
|
44
44
|
*
|
|
45
45
|
* Demos:
|
|
46
46
|
*
|
|
47
|
-
* - [Textarea Autosize](https://mui.com/material-ui/react-textarea-autosize/)
|
|
47
|
+
* - [Textarea Autosize](https://next.mui.com/material-ui/react-textarea-autosize/)
|
|
48
48
|
*
|
|
49
49
|
* API:
|
|
50
50
|
*
|
|
51
|
-
* - [TextareaAutosize API](https://mui.com/material-ui/api/textarea-autosize/)
|
|
51
|
+
* - [TextareaAutosize API](https://next.mui.com/material-ui/api/textarea-autosize/)
|
|
52
52
|
*/
|
|
53
53
|
const TextareaAutosize = /*#__PURE__*/React.forwardRef(function TextareaAutosize(props, forwardedRef) {
|
|
54
54
|
const {
|
package/node/index.js
CHANGED
|
@@ -9,7 +9,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
9
9
|
exports.default = void 0;
|
|
10
10
|
var React = _interopRequireWildcard(require("react"));
|
|
11
11
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
12
|
-
var _clsx = _interopRequireDefault(require("clsx"));
|
|
13
12
|
var _refType = _interopRequireDefault(require("@mui/utils/refType"));
|
|
14
13
|
var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
|
|
15
14
|
var _capitalize = _interopRequireDefault(require("../utils/capitalize"));
|
|
@@ -19,6 +18,7 @@ var _useControlled = _interopRequireDefault(require("../utils/useControlled"));
|
|
|
19
18
|
var _useFormControl = _interopRequireDefault(require("../FormControl/useFormControl"));
|
|
20
19
|
var _ButtonBase = _interopRequireDefault(require("../ButtonBase"));
|
|
21
20
|
var _switchBaseClasses = require("./switchBaseClasses");
|
|
21
|
+
var _useSlot = _interopRequireDefault(require("../utils/useSlot"));
|
|
22
22
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
23
23
|
const useUtilityClasses = ownerState => {
|
|
24
24
|
const {
|
|
@@ -93,7 +93,6 @@ const SwitchBase = /*#__PURE__*/React.forwardRef(function SwitchBase(props, ref)
|
|
|
93
93
|
autoFocus,
|
|
94
94
|
checked: checkedProp,
|
|
95
95
|
checkedIcon,
|
|
96
|
-
className,
|
|
97
96
|
defaultChecked,
|
|
98
97
|
disabled: disabledProp,
|
|
99
98
|
disableFocusRipple = false,
|
|
@@ -111,6 +110,8 @@ const SwitchBase = /*#__PURE__*/React.forwardRef(function SwitchBase(props, ref)
|
|
|
111
110
|
tabIndex,
|
|
112
111
|
type,
|
|
113
112
|
value,
|
|
113
|
+
slots = {},
|
|
114
|
+
slotProps = {},
|
|
114
115
|
...other
|
|
115
116
|
} = props;
|
|
116
117
|
const [checked, setCheckedState] = (0, _useControlled.default)({
|
|
@@ -163,38 +164,75 @@ const SwitchBase = /*#__PURE__*/React.forwardRef(function SwitchBase(props, ref)
|
|
|
163
164
|
edge
|
|
164
165
|
};
|
|
165
166
|
const classes = useUtilityClasses(ownerState);
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
167
|
+
const externalForwardedProps = {
|
|
168
|
+
slots,
|
|
169
|
+
slotProps: {
|
|
170
|
+
input: inputProps,
|
|
171
|
+
...slotProps
|
|
172
|
+
}
|
|
173
|
+
};
|
|
174
|
+
const [RootSlot, rootSlotProps] = (0, _useSlot.default)('root', {
|
|
175
|
+
ref,
|
|
176
|
+
elementType: SwitchBaseRoot,
|
|
177
|
+
className: classes.root,
|
|
178
|
+
shouldForwardComponentProp: true,
|
|
179
|
+
externalForwardedProps: {
|
|
180
|
+
...externalForwardedProps,
|
|
181
|
+
component: 'span',
|
|
182
|
+
...other
|
|
183
|
+
},
|
|
184
|
+
getSlotProps: handlers => ({
|
|
185
|
+
...handlers,
|
|
186
|
+
onFocus: event => {
|
|
187
|
+
handlers.onFocus?.(event);
|
|
188
|
+
handleFocus(event);
|
|
189
|
+
},
|
|
190
|
+
onBlur: event => {
|
|
191
|
+
handlers.onBlur?.(event);
|
|
192
|
+
handleBlur(event);
|
|
193
|
+
}
|
|
194
|
+
}),
|
|
195
|
+
ownerState,
|
|
196
|
+
additionalProps: {
|
|
197
|
+
centerRipple: true,
|
|
198
|
+
focusRipple: !disableFocusRipple,
|
|
199
|
+
disabled,
|
|
200
|
+
role: undefined,
|
|
201
|
+
tabIndex: null
|
|
202
|
+
}
|
|
203
|
+
});
|
|
204
|
+
const [InputSlot, inputSlotProps] = (0, _useSlot.default)('input', {
|
|
205
|
+
ref: inputRef,
|
|
206
|
+
elementType: SwitchBaseInput,
|
|
207
|
+
className: classes.input,
|
|
208
|
+
externalForwardedProps,
|
|
209
|
+
getSlotProps: handlers => ({
|
|
210
|
+
onChange: event => {
|
|
211
|
+
handlers.onChange?.(event);
|
|
212
|
+
handleInputChange(event);
|
|
213
|
+
}
|
|
214
|
+
}),
|
|
215
|
+
ownerState,
|
|
216
|
+
additionalProps: {
|
|
217
|
+
autoFocus,
|
|
181
218
|
checked: checkedProp,
|
|
182
|
-
defaultChecked
|
|
183
|
-
|
|
184
|
-
disabled: disabled,
|
|
219
|
+
defaultChecked,
|
|
220
|
+
disabled,
|
|
185
221
|
id: hasLabelFor ? id : undefined,
|
|
186
|
-
name
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
ownerState: ownerState,
|
|
192
|
-
tabIndex: tabIndex,
|
|
193
|
-
type: type,
|
|
222
|
+
name,
|
|
223
|
+
readOnly,
|
|
224
|
+
required,
|
|
225
|
+
tabIndex,
|
|
226
|
+
type,
|
|
194
227
|
...(type === 'checkbox' && value === undefined ? {} : {
|
|
195
228
|
value
|
|
196
|
-
})
|
|
197
|
-
|
|
229
|
+
})
|
|
230
|
+
}
|
|
231
|
+
});
|
|
232
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(RootSlot, {
|
|
233
|
+
...rootSlotProps,
|
|
234
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(InputSlot, {
|
|
235
|
+
...inputSlotProps
|
|
198
236
|
}), checked ? checkedIcon : icon]
|
|
199
237
|
});
|
|
200
238
|
});
|
|
@@ -287,6 +325,22 @@ process.env.NODE_ENV !== "production" ? SwitchBase.propTypes = {
|
|
|
287
325
|
* If `true`, the `input` element is required.
|
|
288
326
|
*/
|
|
289
327
|
required: _propTypes.default.bool,
|
|
328
|
+
/**
|
|
329
|
+
* The props used for each slot inside.
|
|
330
|
+
* @default {}
|
|
331
|
+
*/
|
|
332
|
+
slotProps: _propTypes.default.shape({
|
|
333
|
+
input: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object]),
|
|
334
|
+
root: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object])
|
|
335
|
+
}),
|
|
336
|
+
/**
|
|
337
|
+
* The components used for each slot inside.
|
|
338
|
+
* @default {}
|
|
339
|
+
*/
|
|
340
|
+
slots: _propTypes.default.shape({
|
|
341
|
+
input: _propTypes.default.elementType,
|
|
342
|
+
root: _propTypes.default.elementType
|
|
343
|
+
}),
|
|
290
344
|
/**
|
|
291
345
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
292
346
|
*/
|
package/node/version/index.js
CHANGED
|
@@ -4,9 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.version = exports.prerelease = exports.patch = exports.minor = exports.major = exports.default = void 0;
|
|
7
|
-
const version = exports.version = "
|
|
8
|
-
const major = exports.major = Number("
|
|
9
|
-
const minor = exports.minor = Number("
|
|
10
|
-
const patch = exports.patch = Number("
|
|
11
|
-
const prerelease = exports.prerelease =
|
|
7
|
+
const version = exports.version = "7.0.0-alpha.0";
|
|
8
|
+
const major = exports.major = Number("7");
|
|
9
|
+
const minor = exports.minor = Number("0");
|
|
10
|
+
const patch = exports.patch = Number("0");
|
|
11
|
+
const prerelease = exports.prerelease = "alpha.0";
|
|
12
12
|
var _default = exports.default = version;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/material",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.0-alpha.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"author": "MUI Team",
|
|
6
6
|
"description": "Material UI is an open-source React component library that implements Google's Material Design. It's comprehensive and can be used in production out of the box.",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"url": "https://opencollective.com/mui-org"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@babel/runtime": "^7.26.
|
|
30
|
+
"@babel/runtime": "^7.26.7",
|
|
31
31
|
"@popperjs/core": "^2.11.8",
|
|
32
32
|
"@types/react-transition-group": "^4.4.12",
|
|
33
33
|
"clsx": "^2.1.1",
|
|
@@ -35,10 +35,10 @@
|
|
|
35
35
|
"prop-types": "^15.8.1",
|
|
36
36
|
"react-is": "^19.0.0",
|
|
37
37
|
"react-transition-group": "^4.4.5",
|
|
38
|
-
"@mui/core-downloads-tracker": "^
|
|
39
|
-
"@mui/system": "
|
|
40
|
-
"@mui/
|
|
41
|
-
"@mui/
|
|
38
|
+
"@mui/core-downloads-tracker": "^7.0.0-alpha.0",
|
|
39
|
+
"@mui/system": "7.0.0-alpha.0",
|
|
40
|
+
"@mui/types": "^7.2.22",
|
|
41
|
+
"@mui/utils": "7.0.0-alpha.0"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
44
|
"@emotion/react": "^11.5.0",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"@types/react": "^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
47
47
|
"react": "^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
48
48
|
"react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
49
|
-
"@mui/material-pigment-css": "
|
|
49
|
+
"@mui/material-pigment-css": "7.0.0-alpha.0"
|
|
50
50
|
},
|
|
51
51
|
"peerDependenciesMeta": {
|
|
52
52
|
"@types/react": {
|
package/version/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export const version = "
|
|
2
|
-
export const major = Number("
|
|
3
|
-
export const minor = Number("
|
|
4
|
-
export const patch = Number("
|
|
5
|
-
export const prerelease =
|
|
1
|
+
export const version = "7.0.0-alpha.0";
|
|
2
|
+
export const major = Number("7");
|
|
3
|
+
export const minor = Number("0");
|
|
4
|
+
export const patch = Number("0");
|
|
5
|
+
export const prerelease = "alpha.0";
|
|
6
6
|
export default version;
|