@mui/material 5.12.2 → 5.13.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.
Files changed (78) hide show
  1. package/Accordion/Accordion.d.ts +71 -57
  2. package/AppBar/AppBar.d.ts +9 -7
  3. package/Autocomplete/Autocomplete.d.ts +2 -1
  4. package/BottomNavigationAction/BottomNavigationAction.js +4 -1
  5. package/ButtonGroup/ButtonGroup.js +8 -2
  6. package/CHANGELOG.md +182 -0
  7. package/Chip/Chip.js +1 -1
  8. package/Divider/Divider.js +10 -11
  9. package/Input/inputClasses.d.ts +4 -0
  10. package/InputBase/InputBase.js +1 -1
  11. package/Paper/Paper.d.ts +6 -1
  12. package/Popper/Popper.d.ts +11 -1
  13. package/Popper/Popper.js +4 -3
  14. package/Select/SelectInput.js +6 -4
  15. package/Slider/Slider.js +1 -1
  16. package/Snackbar/Snackbar.js +4 -3
  17. package/SwipeableDrawer/SwipeableDrawer.js +1 -1
  18. package/TextField/TextField.d.ts +21 -2
  19. package/TextField/TextField.js +7 -1
  20. package/index.js +1 -1
  21. package/legacy/ButtonGroup/ButtonGroup.js +7 -3
  22. package/legacy/Divider/Divider.js +17 -17
  23. package/legacy/Drawer/Drawer.js +4 -4
  24. package/legacy/InputBase/InputBase.js +1 -1
  25. package/legacy/ListItem/ListItem.js +4 -4
  26. package/legacy/Menu/Menu.js +4 -4
  27. package/legacy/Popover/Popover.js +4 -4
  28. package/legacy/Popper/Popper.js +4 -3
  29. package/legacy/Select/SelectInput.js +4 -5
  30. package/legacy/Slider/Slider.js +1 -1
  31. package/legacy/Snackbar/Snackbar.js +16 -15
  32. package/legacy/SpeedDial/SpeedDial.js +8 -8
  33. package/legacy/SwipeableDrawer/SwipeableDrawer.js +4 -4
  34. package/legacy/TextField/TextField.js +7 -1
  35. package/legacy/index.js +1 -1
  36. package/legacy/useMediaQuery/useMediaQuery.js +8 -0
  37. package/modern/BottomNavigationAction/BottomNavigationAction.js +4 -1
  38. package/modern/ButtonGroup/ButtonGroup.js +8 -2
  39. package/modern/Chip/Chip.js +1 -1
  40. package/modern/Divider/Divider.js +10 -11
  41. package/modern/InputBase/InputBase.js +1 -1
  42. package/modern/Popper/Popper.js +4 -3
  43. package/modern/Select/SelectInput.js +6 -4
  44. package/modern/Slider/Slider.js +1 -1
  45. package/modern/Snackbar/Snackbar.js +4 -3
  46. package/modern/SwipeableDrawer/SwipeableDrawer.js +1 -1
  47. package/modern/TextField/TextField.js +7 -1
  48. package/modern/index.js +1 -1
  49. package/modern/useMediaQuery/useMediaQuery.js +8 -0
  50. package/node/BottomNavigationAction/BottomNavigationAction.js +4 -1
  51. package/node/ButtonBase/Ripple.js +1 -2
  52. package/node/ButtonGroup/ButtonGroup.js +8 -2
  53. package/node/Chip/Chip.js +1 -1
  54. package/node/Divider/Divider.js +10 -11
  55. package/node/Grid/Grid.js +10 -1
  56. package/node/Hidden/Hidden.js +2 -2
  57. package/node/Hidden/HiddenJs.js +1 -2
  58. package/node/InputBase/InputBase.js +1 -1
  59. package/node/Popper/Popper.js +4 -3
  60. package/node/Select/SelectInput.js +6 -4
  61. package/node/Slide/Slide.js +2 -3
  62. package/node/Slider/Slider.js +1 -1
  63. package/node/Snackbar/Snackbar.js +4 -3
  64. package/node/SpeedDialAction/SpeedDialAction.js +1 -1
  65. package/node/SwipeableDrawer/SwipeableDrawer.js +3 -4
  66. package/node/Switch/Switch.js +1 -1
  67. package/node/TabScrollButton/TabScrollButton.js +1 -0
  68. package/node/TablePagination/TablePaginationActions.js +2 -2
  69. package/node/TextField/TextField.js +7 -1
  70. package/node/ToggleButton/ToggleButton.js +1 -1
  71. package/node/index.js +1 -1
  72. package/node/styles/index.js +5 -1
  73. package/node/useMediaQuery/useMediaQuery.js +12 -0
  74. package/node/utils/createSvgIcon.js +1 -2
  75. package/package.json +6 -6
  76. package/umd/material-ui.development.js +93 -75
  77. package/umd/material-ui.production.min.js +20 -20
  78. package/useMediaQuery/useMediaQuery.js +8 -0
@@ -111,6 +111,10 @@ export interface BaseTextFieldProps
111
111
  name?: string;
112
112
  onBlur?: InputBaseProps['onBlur'];
113
113
  onFocus?: StandardInputProps['onFocus'];
114
+ /**
115
+ * @ignore
116
+ */
117
+ onClick?: InputBaseProps['onClick'];
114
118
  /**
115
119
  * The short hint displayed in the `input` before the user enters a value.
116
120
  */
@@ -226,7 +230,14 @@ export interface OutlinedTextFieldProps extends BaseTextFieldProps {
226
230
  InputProps?: Partial<OutlinedInputProps>;
227
231
  }
228
232
 
229
- export type TextFieldProps = StandardTextFieldProps | FilledTextFieldProps | OutlinedTextFieldProps;
233
+ export type TextFieldVariants = 'outlined' | 'standard' | 'filled';
234
+
235
+ export type TextFieldProps<Variant extends TextFieldVariants = TextFieldVariants> =
236
+ Variant extends 'filled'
237
+ ? FilledTextFieldProps
238
+ : Variant extends 'standard'
239
+ ? StandardTextFieldProps
240
+ : OutlinedTextFieldProps;
230
241
 
231
242
  /**
232
243
  * The `TextField` is a convenience wrapper for the most common cases (80%).
@@ -270,4 +281,12 @@ export type TextFieldProps = StandardTextFieldProps | FilledTextFieldProps | Out
270
281
  * - [TextField API](https://mui.com/material-ui/api/text-field/)
271
282
  * - inherits [FormControl API](https://mui.com/material-ui/api/form-control/)
272
283
  */
273
- export default function TextField(props: TextFieldProps): JSX.Element;
284
+ export default function TextField<Variant extends TextFieldVariants>(
285
+ props: {
286
+ /**
287
+ * The variant to use.
288
+ * @default 'outlined'
289
+ */
290
+ variant?: Variant;
291
+ } & Omit<TextFieldProps, 'variant'>,
292
+ ): JSX.Element;
@@ -1,6 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
- const _excluded = ["autoComplete", "autoFocus", "children", "className", "color", "defaultValue", "disabled", "error", "FormHelperTextProps", "fullWidth", "helperText", "id", "InputLabelProps", "inputProps", "InputProps", "inputRef", "label", "maxRows", "minRows", "multiline", "name", "onBlur", "onChange", "onFocus", "placeholder", "required", "rows", "select", "SelectProps", "type", "value", "variant"];
3
+ const _excluded = ["autoComplete", "autoFocus", "children", "className", "color", "defaultValue", "disabled", "error", "FormHelperTextProps", "fullWidth", "helperText", "id", "InputLabelProps", "inputProps", "InputProps", "inputRef", "label", "maxRows", "minRows", "multiline", "name", "onBlur", "onChange", "onClick", "onFocus", "placeholder", "required", "rows", "select", "SelectProps", "type", "value", "variant"];
4
4
  import * as React from 'react';
5
5
  import PropTypes from 'prop-types';
6
6
  import clsx from 'clsx';
@@ -99,6 +99,7 @@ const TextField = /*#__PURE__*/React.forwardRef(function TextField(inProps, ref)
99
99
  name,
100
100
  onBlur,
101
101
  onChange,
102
+ onClick,
102
103
  onFocus,
103
104
  placeholder,
104
105
  required = false,
@@ -163,6 +164,7 @@ const TextField = /*#__PURE__*/React.forwardRef(function TextField(inProps, ref)
163
164
  onBlur: onBlur,
164
165
  onChange: onChange,
165
166
  onFocus: onFocus,
167
+ onClick: onClick,
166
168
  placeholder: placeholder,
167
169
  inputProps: inputProps
168
170
  }, InputMore, InputProps));
@@ -321,6 +323,10 @@ process.env.NODE_ENV !== "production" ? TextField.propTypes /* remove-proptypes
321
323
  * You can pull out the new value by accessing `event.target.value` (string).
322
324
  */
323
325
  onChange: PropTypes.func,
326
+ /**
327
+ * @ignore
328
+ */
329
+ onClick: PropTypes.func,
324
330
  /**
325
331
  * @ignore
326
332
  */
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/material v5.12.2
2
+ * @mui/material v5.13.0
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -67,11 +67,15 @@ var ButtonGroupRoot = styled('div', {
67
67
  }, ownerState.orientation === 'vertical' && {
68
68
  borderBottomRightRadius: 0,
69
69
  borderBottomLeftRadius: 0
70
- }, ownerState.variant === 'text' && ownerState.orientation === 'horizontal' && {
70
+ }, ownerState.variant === 'text' && ownerState.orientation === 'horizontal' && _defineProperty({
71
71
  borderRight: theme.vars ? "1px solid rgba(".concat(theme.vars.palette.common.onBackgroundChannel, " / 0.23)") : "1px solid ".concat(theme.palette.mode === 'light' ? 'rgba(0, 0, 0, 0.23)' : 'rgba(255, 255, 255, 0.23)')
72
- }, ownerState.variant === 'text' && ownerState.orientation === 'vertical' && {
72
+ }, "&.".concat(buttonGroupClasses.disabled), {
73
+ borderRight: "1px solid ".concat((theme.vars || theme).palette.action.disabled)
74
+ }), ownerState.variant === 'text' && ownerState.orientation === 'vertical' && _defineProperty({
73
75
  borderBottom: theme.vars ? "1px solid rgba(".concat(theme.vars.palette.common.onBackgroundChannel, " / 0.23)") : "1px solid ".concat(theme.palette.mode === 'light' ? 'rgba(0, 0, 0, 0.23)' : 'rgba(255, 255, 255, 0.23)')
74
- }, ownerState.variant === 'text' && ownerState.color !== 'inherit' && {
76
+ }, "&.".concat(buttonGroupClasses.disabled), {
77
+ borderBottom: "1px solid ".concat((theme.vars || theme).palette.action.disabled)
78
+ }), ownerState.variant === 'text' && ownerState.color !== 'inherit' && {
75
79
  borderColor: theme.vars ? "rgba(".concat(theme.vars.palette[ownerState.color].mainChannel, " / 0.5)") : alpha(theme.palette[ownerState.color].main, 0.5)
76
80
  }, ownerState.variant === 'outlined' && ownerState.orientation === 'horizontal' && {
77
81
  borderRightColor: 'transparent'
@@ -66,38 +66,38 @@ var DividerRoot = styled('div', {
66
66
  height: 'auto'
67
67
  });
68
68
  }, function (_ref2) {
69
- var theme = _ref2.theme,
70
- ownerState = _ref2.ownerState;
69
+ var ownerState = _ref2.ownerState;
71
70
  return _extends({}, ownerState.children && {
72
71
  display: 'flex',
73
72
  whiteSpace: 'nowrap',
74
73
  textAlign: 'center',
75
74
  border: 0,
76
75
  '&::before, &::after': {
77
- position: 'relative',
78
- width: '100%',
79
- borderTop: "thin solid ".concat((theme.vars || theme).palette.divider),
80
- top: '50%',
81
76
  content: '""',
82
- transform: 'translateY(50%)'
77
+ alignSelf: 'center'
83
78
  }
84
79
  });
85
80
  }, function (_ref3) {
86
81
  var theme = _ref3.theme,
87
82
  ownerState = _ref3.ownerState;
83
+ return _extends({}, ownerState.children && ownerState.orientation !== 'vertical' && {
84
+ '&::before, &::after': {
85
+ width: '100%',
86
+ borderTop: "thin solid ".concat((theme.vars || theme).palette.divider)
87
+ }
88
+ });
89
+ }, function (_ref4) {
90
+ var theme = _ref4.theme,
91
+ ownerState = _ref4.ownerState;
88
92
  return _extends({}, ownerState.children && ownerState.orientation === 'vertical' && {
89
93
  flexDirection: 'column',
90
94
  '&::before, &::after': {
91
95
  height: '100%',
92
- top: '0%',
93
- left: '50%',
94
- borderTop: 0,
95
- borderLeft: "thin solid ".concat((theme.vars || theme).palette.divider),
96
- transform: 'translateX(0%)'
96
+ borderLeft: "thin solid ".concat((theme.vars || theme).palette.divider)
97
97
  }
98
98
  });
99
- }, function (_ref4) {
100
- var ownerState = _ref4.ownerState;
99
+ }, function (_ref5) {
100
+ var ownerState = _ref5.ownerState;
101
101
  return _extends({}, ownerState.textAlign === 'right' && ownerState.orientation !== 'vertical' && {
102
102
  '&::before': {
103
103
  width: '90%'
@@ -121,9 +121,9 @@ var DividerWrapper = styled('span', {
121
121
  var ownerState = props.ownerState;
122
122
  return [styles.wrapper, ownerState.orientation === 'vertical' && styles.wrapperVertical];
123
123
  }
124
- })(function (_ref5) {
125
- var theme = _ref5.theme,
126
- ownerState = _ref5.ownerState;
124
+ })(function (_ref6) {
125
+ var theme = _ref6.theme,
126
+ ownerState = _ref6.ownerState;
127
127
  return _extends({
128
128
  display: 'inline-block',
129
129
  paddingLeft: "calc(".concat(theme.spacing(1), " * 1.2)"),
@@ -138,10 +138,10 @@ var Drawer = /*#__PURE__*/React.forwardRef(function Drawer(inProps, ref) {
138
138
  elevation = _props$elevation === void 0 ? 16 : _props$elevation,
139
139
  _props$hideBackdrop = props.hideBackdrop,
140
140
  hideBackdrop = _props$hideBackdrop === void 0 ? false : _props$hideBackdrop,
141
- _props$ModalProps = props.ModalProps;
142
- _props$ModalProps = _props$ModalProps === void 0 ? {} : _props$ModalProps;
143
- var BackdropPropsProp = _props$ModalProps.BackdropProps,
144
- ModalProps = _objectWithoutProperties(_props$ModalProps, ["BackdropProps"]),
141
+ _props$ModalProps = props.ModalProps,
142
+ _props$ModalProps2 = _props$ModalProps === void 0 ? {} : _props$ModalProps,
143
+ BackdropPropsProp = _props$ModalProps2.BackdropProps,
144
+ ModalProps = _objectWithoutProperties(_props$ModalProps2, ["BackdropProps"]),
145
145
  onClose = props.onClose,
146
146
  _props$open = props.open,
147
147
  open = _props$open === void 0 ? false : _props$open,
@@ -375,7 +375,7 @@ var InputBase = /*#__PURE__*/React.forwardRef(function InputBase(inProps, ref) {
375
375
  if (inputRef.current && event.currentTarget === event.target) {
376
376
  inputRef.current.focus();
377
377
  }
378
- if (onClick) {
378
+ if (onClick && !fcs.disabled) {
379
379
  onClick(event);
380
380
  }
381
381
  };
@@ -142,10 +142,10 @@ var ListItem = /*#__PURE__*/React.forwardRef(function ListItem(inProps, ref) {
142
142
  componentsProps = _props$componentsProp === void 0 ? {} : _props$componentsProp,
143
143
  _props$ContainerCompo = props.ContainerComponent,
144
144
  ContainerComponent = _props$ContainerCompo === void 0 ? 'li' : _props$ContainerCompo,
145
- _props$ContainerProps = props.ContainerProps;
146
- _props$ContainerProps = _props$ContainerProps === void 0 ? {} : _props$ContainerProps;
147
- var ContainerClassName = _props$ContainerProps.className,
148
- ContainerProps = _objectWithoutProperties(_props$ContainerProps, ["className"]),
145
+ _props$ContainerProps = props.ContainerProps,
146
+ _props$ContainerProps2 = _props$ContainerProps === void 0 ? {} : _props$ContainerProps,
147
+ ContainerClassName = _props$ContainerProps2.className,
148
+ ContainerProps = _objectWithoutProperties(_props$ContainerProps2, ["className"]),
149
149
  _props$dense = props.dense,
150
150
  dense = _props$dense === void 0 ? false : _props$dense,
151
151
  _props$disabled = props.disabled,
@@ -84,10 +84,10 @@ var Menu = /*#__PURE__*/React.forwardRef(function Menu(inProps, ref) {
84
84
  PopoverClasses = props.PopoverClasses,
85
85
  _props$transitionDura = props.transitionDuration,
86
86
  transitionDuration = _props$transitionDura === void 0 ? 'auto' : _props$transitionDura,
87
- _props$TransitionProp = props.TransitionProps;
88
- _props$TransitionProp = _props$TransitionProp === void 0 ? {} : _props$TransitionProp;
89
- var onEntering = _props$TransitionProp.onEntering,
90
- TransitionProps = _objectWithoutProperties(_props$TransitionProp, ["onEntering"]),
87
+ _props$TransitionProp = props.TransitionProps,
88
+ _props$TransitionProp2 = _props$TransitionProp === void 0 ? {} : _props$TransitionProp,
89
+ onEntering = _props$TransitionProp2.onEntering,
90
+ TransitionProps = _objectWithoutProperties(_props$TransitionProp2, ["onEntering"]),
91
91
  _props$variant = props.variant,
92
92
  variant = _props$variant === void 0 ? 'selectedMenu' : _props$variant,
93
93
  other = _objectWithoutProperties(props, ["autoFocus", "children", "disableAutoFocusItem", "MenuListProps", "onClose", "open", "PaperProps", "PopoverClasses", "transitionDuration", "TransitionProps", "variant"]);
@@ -114,10 +114,10 @@ var Popover = /*#__PURE__*/React.forwardRef(function Popover(inProps, ref) {
114
114
  TransitionComponent = _props$TransitionComp === void 0 ? Grow : _props$TransitionComp,
115
115
  _props$transitionDura = props.transitionDuration,
116
116
  transitionDurationProp = _props$transitionDura === void 0 ? 'auto' : _props$transitionDura,
117
- _props$TransitionProp = props.TransitionProps;
118
- _props$TransitionProp = _props$TransitionProp === void 0 ? {} : _props$TransitionProp;
119
- var onEntering = _props$TransitionProp.onEntering,
120
- TransitionProps = _objectWithoutProperties(_props$TransitionProp, ["onEntering"]),
117
+ _props$TransitionProp = props.TransitionProps,
118
+ _props$TransitionProp2 = _props$TransitionProp === void 0 ? {} : _props$TransitionProp,
119
+ onEntering = _props$TransitionProp2.onEntering,
120
+ TransitionProps = _objectWithoutProperties(_props$TransitionProp2, ["onEntering"]),
121
121
  other = _objectWithoutProperties(props, ["action", "anchorEl", "anchorOrigin", "anchorPosition", "anchorReference", "children", "className", "container", "elevation", "marginThreshold", "open", "PaperProps", "transformOrigin", "TransitionComponent", "transitionDuration", "TransitionProps"]);
122
122
  var paperRef = React.useRef();
123
123
  var handlePaperRef = useForkRef(paperRef, PaperProps.ref);
@@ -53,7 +53,6 @@ var Popper = /*#__PURE__*/React.forwardRef(function Popper(inProps, ref) {
53
53
  var RootComponent = (_slots$root = slots == null ? void 0 : slots.root) != null ? _slots$root : components == null ? void 0 : components.Root;
54
54
  var otherProps = _extends({
55
55
  anchorEl: anchorEl,
56
- component: component,
57
56
  container: container,
58
57
  disablePortal: disablePortal,
59
58
  keepMounted: keepMounted,
@@ -65,6 +64,7 @@ var Popper = /*#__PURE__*/React.forwardRef(function Popper(inProps, ref) {
65
64
  transition: transition
66
65
  }, other);
67
66
  return /*#__PURE__*/_jsx(PopperRoot, _extends({
67
+ as: component,
68
68
  direction: theme == null ? void 0 : theme.direction,
69
69
  slots: {
70
70
  root: RootComponent
@@ -91,9 +91,10 @@ process.env.NODE_ENV !== "production" ? Popper.propTypes /* remove-proptypes */
91
91
  */
92
92
  children: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.node, PropTypes.func]),
93
93
  /**
94
- * @ignore
94
+ * The component used for the root node.
95
+ * Either a string to use a HTML element or a component.
95
96
  */
96
- component: PropTypes /* @typescript-to-proptypes-ignore */.elementType,
97
+ component: PropTypes.elementType,
97
98
  /**
98
99
  * The components used for each slot inside the Popper.
99
100
  * Either a string to use a HTML element or a component.
@@ -237,13 +237,12 @@ var SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, ref)
237
237
 
238
238
  // Support autofill.
239
239
  var handleChange = function handleChange(event) {
240
- var index = childrenArray.map(function (child) {
241
- return child.props.value;
242
- }).indexOf(event.target.value);
243
- if (index === -1) {
240
+ var child = childrenArray.find(function (childItem) {
241
+ return childItem.props.value === event.target.value;
242
+ });
243
+ if (child === undefined) {
244
244
  return;
245
245
  }
246
- var child = childrenArray[index];
247
246
  setValueState(child.props.value);
248
247
  if (onChange) {
249
248
  onChange(event, child);
@@ -514,7 +514,7 @@ var Slider = /*#__PURE__*/React.forwardRef(function Slider(inputProps, ref) {
514
514
  valueLabelFormat: valueLabelFormat
515
515
  });
516
516
  var _useSlider = useSlider(_extends({}, ownerState, {
517
- ref: ref
517
+ rootRef: ref
518
518
  })),
519
519
  axisProps = _useSlider.axisProps,
520
520
  getRootProps = _useSlider.getRootProps,
@@ -76,13 +76,13 @@ var Snackbar = /*#__PURE__*/React.forwardRef(function Snackbar(inProps, ref) {
76
76
  exit: theme.transitions.duration.leavingScreen
77
77
  };
78
78
  var action = props.action,
79
- _props$anchorOrigin = props.anchorOrigin;
80
- _props$anchorOrigin = _props$anchorOrigin === void 0 ? {
81
- vertical: 'bottom',
82
- horizontal: 'left'
83
- } : _props$anchorOrigin;
84
- var vertical = _props$anchorOrigin.vertical,
85
- horizontal = _props$anchorOrigin.horizontal,
79
+ _props$anchorOrigin = props.anchorOrigin,
80
+ _props$anchorOrigin2 = _props$anchorOrigin === void 0 ? {
81
+ vertical: 'bottom',
82
+ horizontal: 'left'
83
+ } : _props$anchorOrigin,
84
+ vertical = _props$anchorOrigin2.vertical,
85
+ horizontal = _props$anchorOrigin2.horizontal,
86
86
  _props$autoHideDurati = props.autoHideDuration,
87
87
  autoHideDuration = _props$autoHideDurati === void 0 ? null : _props$autoHideDurati,
88
88
  children = props.children,
@@ -103,11 +103,11 @@ var Snackbar = /*#__PURE__*/React.forwardRef(function Snackbar(inProps, ref) {
103
103
  TransitionComponent = _props$TransitionComp === void 0 ? Grow : _props$TransitionComp,
104
104
  _props$transitionDura = props.transitionDuration,
105
105
  transitionDuration = _props$transitionDura === void 0 ? defaultTransitionDuration : _props$transitionDura,
106
- _props$TransitionProp = props.TransitionProps;
107
- _props$TransitionProp = _props$TransitionProp === void 0 ? {} : _props$TransitionProp;
108
- var onEnter = _props$TransitionProp.onEnter,
109
- onExited = _props$TransitionProp.onExited,
110
- TransitionProps = _objectWithoutProperties(_props$TransitionProp, ["onEnter", "onExited"]),
106
+ _props$TransitionProp = props.TransitionProps,
107
+ _props$TransitionProp2 = _props$TransitionProp === void 0 ? {} : _props$TransitionProp,
108
+ onEnter = _props$TransitionProp2.onEnter,
109
+ onExited = _props$TransitionProp2.onExited,
110
+ TransitionProps = _objectWithoutProperties(_props$TransitionProp2, ["onEnter", "onExited"]),
111
111
  other = _objectWithoutProperties(props, ["action", "anchorOrigin", "autoHideDuration", "children", "className", "ClickAwayListenerProps", "ContentProps", "disableWindowBlurListener", "message", "onBlur", "onClose", "onFocus", "onMouseEnter", "onMouseLeave", "open", "resumeHideDuration", "TransitionComponent", "transitionDuration", "TransitionProps"]);
112
112
  var ownerState = _extends({}, props, {
113
113
  anchorOrigin: {
@@ -120,9 +120,7 @@ var Snackbar = /*#__PURE__*/React.forwardRef(function Snackbar(inProps, ref) {
120
120
  transitionDuration: transitionDuration
121
121
  });
122
122
  var classes = useUtilityClasses(ownerState);
123
- var _useSnackbar = useSnackbar(_extends({}, ownerState, {
124
- ref: ref
125
- })),
123
+ var _useSnackbar = useSnackbar(_extends({}, ownerState)),
126
124
  getRootProps = _useSnackbar.getRootProps,
127
125
  onClickAway = _useSnackbar.onClickAway;
128
126
  var _React$useState = React.useState(true),
@@ -133,6 +131,9 @@ var Snackbar = /*#__PURE__*/React.forwardRef(function Snackbar(inProps, ref) {
133
131
  getSlotProps: getRootProps,
134
132
  externalForwardedProps: other,
135
133
  ownerState: ownerState,
134
+ additionalProps: {
135
+ ref: ref
136
+ },
136
137
  className: [classes.root, className]
137
138
  });
138
139
  var handleExited = function handleExited(node) {
@@ -130,10 +130,10 @@ var SpeedDial = /*#__PURE__*/React.forwardRef(function SpeedDial(inProps, ref) {
130
130
  exit: theme.transitions.duration.leavingScreen
131
131
  };
132
132
  var ariaLabel = props.ariaLabel,
133
- _props$FabProps = props.FabProps;
134
- _props$FabProps = _props$FabProps === void 0 ? {} : _props$FabProps;
135
- var origDialButtonRef = _props$FabProps.ref,
136
- FabProps = _objectWithoutProperties(_props$FabProps, ["ref"]),
133
+ _props$FabProps = props.FabProps,
134
+ _props$FabProps2 = _props$FabProps === void 0 ? {} : _props$FabProps,
135
+ origDialButtonRef = _props$FabProps2.ref,
136
+ FabProps = _objectWithoutProperties(_props$FabProps2, ["ref"]),
137
137
  childrenProp = props.children,
138
138
  className = props.className,
139
139
  _props$direction = props.direction,
@@ -329,10 +329,10 @@ var SpeedDial = /*#__PURE__*/React.forwardRef(function SpeedDial(inProps, ref) {
329
329
  });
330
330
  var children = allItems.map(function (child, index) {
331
331
  var _child$props = child.props,
332
- _child$props$FabProps = _child$props.FabProps;
333
- _child$props$FabProps = _child$props$FabProps === void 0 ? {} : _child$props$FabProps;
334
- var origButtonRef = _child$props$FabProps.ref,
335
- ChildFabProps = _objectWithoutProperties(_child$props$FabProps, ["ref"]),
332
+ _child$props$FabProps = _child$props.FabProps,
333
+ _child$props$FabProps2 = _child$props$FabProps === void 0 ? {} : _child$props$FabProps,
334
+ origButtonRef = _child$props$FabProps2.ref,
335
+ ChildFabProps = _objectWithoutProperties(_child$props$FabProps2, ["ref"]),
336
336
  tooltipPlacementProp = _child$props.tooltipPlacement;
337
337
  var tooltipPlacement = tooltipPlacementProp || (getOrientation(direction) === 'vertical' ? 'left' : 'top');
338
338
  return /*#__PURE__*/React.cloneElement(child, {
@@ -138,10 +138,10 @@ var SwipeableDrawer = /*#__PURE__*/React.forwardRef(function SwipeableDrawer(inP
138
138
  allowSwipeInChildren = _props$allowSwipeInCh === void 0 ? false : _props$allowSwipeInCh,
139
139
  _props$minFlingVeloci = props.minFlingVelocity,
140
140
  minFlingVelocity = _props$minFlingVeloci === void 0 ? 450 : _props$minFlingVeloci,
141
- _props$ModalProps = props.ModalProps;
142
- _props$ModalProps = _props$ModalProps === void 0 ? {} : _props$ModalProps;
143
- var BackdropProps = _props$ModalProps.BackdropProps,
144
- ModalPropsProp = _objectWithoutProperties(_props$ModalProps, ["BackdropProps"]),
141
+ _props$ModalProps = props.ModalProps,
142
+ _props$ModalProps2 = _props$ModalProps === void 0 ? {} : _props$ModalProps,
143
+ BackdropProps = _props$ModalProps2.BackdropProps,
144
+ ModalPropsProp = _objectWithoutProperties(_props$ModalProps2, ["BackdropProps"]),
145
145
  onClose = props.onClose,
146
146
  onOpen = props.onOpen,
147
147
  _props$open = props.open,
@@ -103,6 +103,7 @@ var TextField = /*#__PURE__*/React.forwardRef(function TextField(inProps, ref) {
103
103
  name = props.name,
104
104
  onBlur = props.onBlur,
105
105
  onChange = props.onChange,
106
+ onClick = props.onClick,
106
107
  onFocus = props.onFocus,
107
108
  placeholder = props.placeholder,
108
109
  _props$required = props.required,
@@ -115,7 +116,7 @@ var TextField = /*#__PURE__*/React.forwardRef(function TextField(inProps, ref) {
115
116
  value = props.value,
116
117
  _props$variant = props.variant,
117
118
  variant = _props$variant === void 0 ? 'outlined' : _props$variant,
118
- other = _objectWithoutProperties(props, ["autoComplete", "autoFocus", "children", "className", "color", "defaultValue", "disabled", "error", "FormHelperTextProps", "fullWidth", "helperText", "id", "InputLabelProps", "inputProps", "InputProps", "inputRef", "label", "maxRows", "minRows", "multiline", "name", "onBlur", "onChange", "onFocus", "placeholder", "required", "rows", "select", "SelectProps", "type", "value", "variant"]);
119
+ other = _objectWithoutProperties(props, ["autoComplete", "autoFocus", "children", "className", "color", "defaultValue", "disabled", "error", "FormHelperTextProps", "fullWidth", "helperText", "id", "InputLabelProps", "inputProps", "InputProps", "inputRef", "label", "maxRows", "minRows", "multiline", "name", "onBlur", "onChange", "onClick", "onFocus", "placeholder", "required", "rows", "select", "SelectProps", "type", "value", "variant"]);
119
120
  var ownerState = _extends({}, props, {
120
121
  autoFocus: autoFocus,
121
122
  color: color,
@@ -169,6 +170,7 @@ var TextField = /*#__PURE__*/React.forwardRef(function TextField(inProps, ref) {
169
170
  onBlur: onBlur,
170
171
  onChange: onChange,
171
172
  onFocus: onFocus,
173
+ onClick: onClick,
172
174
  placeholder: placeholder,
173
175
  inputProps: inputProps
174
176
  }, InputMore, InputProps));
@@ -327,6 +329,10 @@ process.env.NODE_ENV !== "production" ? TextField.propTypes /* remove-proptypes
327
329
  * You can pull out the new value by accessing `event.target.value` (string).
328
330
  */
329
331
  onChange: PropTypes.func,
332
+ /**
333
+ * @ignore
334
+ */
335
+ onClick: PropTypes.func,
330
336
  /**
331
337
  * @ignore
332
338
  */
package/legacy/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/material v5.12.2
2
+ * @mui/material v5.13.0
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -7,6 +7,14 @@ import useEnhancedEffect from '../utils/useEnhancedEffect';
7
7
  * @deprecated Not used internally. Use `MediaQueryListEvent` from lib.dom.d.ts instead.
8
8
  */
9
9
 
10
+ /**
11
+ * @deprecated Not used internally. Use `MediaQueryList` from lib.dom.d.ts instead.
12
+ */
13
+
14
+ /**
15
+ * @deprecated Not used internally. Use `(event: MediaQueryListEvent) => void` instead.
16
+ */
17
+
10
18
  function useMediaQueryOld(query, defaultMatches, matchMedia, ssrMatchMedia, noSsr) {
11
19
  var _React$useState = React.useState(function () {
12
20
  if (noSsr && matchMedia) {
@@ -86,7 +86,10 @@ const BottomNavigationAction = /*#__PURE__*/React.forwardRef(function BottomNavi
86
86
  icon,
87
87
  label,
88
88
  onChange,
89
- onClick,
89
+ onClick
90
+ // eslint-disable-next-line react/prop-types -- private, always overridden by BottomNavigation
91
+ ,
92
+
90
93
  value
91
94
  } = props,
92
95
  other = _objectWithoutPropertiesLoose(props, _excluded);
@@ -83,9 +83,15 @@ const ButtonGroupRoot = styled('div', {
83
83
  borderBottomRightRadius: 0,
84
84
  borderBottomLeftRadius: 0
85
85
  }, ownerState.variant === 'text' && ownerState.orientation === 'horizontal' && {
86
- borderRight: theme.vars ? `1px solid rgba(${theme.vars.palette.common.onBackgroundChannel} / 0.23)` : `1px solid ${theme.palette.mode === 'light' ? 'rgba(0, 0, 0, 0.23)' : 'rgba(255, 255, 255, 0.23)'}`
86
+ borderRight: theme.vars ? `1px solid rgba(${theme.vars.palette.common.onBackgroundChannel} / 0.23)` : `1px solid ${theme.palette.mode === 'light' ? 'rgba(0, 0, 0, 0.23)' : 'rgba(255, 255, 255, 0.23)'}`,
87
+ [`&.${buttonGroupClasses.disabled}`]: {
88
+ borderRight: `1px solid ${(theme.vars || theme).palette.action.disabled}`
89
+ }
87
90
  }, ownerState.variant === 'text' && ownerState.orientation === 'vertical' && {
88
- borderBottom: theme.vars ? `1px solid rgba(${theme.vars.palette.common.onBackgroundChannel} / 0.23)` : `1px solid ${theme.palette.mode === 'light' ? 'rgba(0, 0, 0, 0.23)' : 'rgba(255, 255, 255, 0.23)'}`
91
+ borderBottom: theme.vars ? `1px solid rgba(${theme.vars.palette.common.onBackgroundChannel} / 0.23)` : `1px solid ${theme.palette.mode === 'light' ? 'rgba(0, 0, 0, 0.23)' : 'rgba(255, 255, 255, 0.23)'}`,
92
+ [`&.${buttonGroupClasses.disabled}`]: {
93
+ borderBottom: `1px solid ${(theme.vars || theme).palette.action.disabled}`
94
+ }
89
95
  }, ownerState.variant === 'text' && ownerState.color !== 'inherit' && {
90
96
  borderColor: theme.vars ? `rgba(${theme.vars.palette[ownerState.color].mainChannel} / 0.5)` : alpha(theme.palette[ownerState.color].main, 0.5)
91
97
  }, ownerState.variant === 'outlined' && ownerState.orientation === 'horizontal' && {
@@ -293,7 +293,7 @@ const Chip = /*#__PURE__*/React.forwardRef(function Chip(inProps, ref) {
293
293
  size = 'medium',
294
294
  variant = 'filled',
295
295
  tabIndex,
296
- skipFocusWhenDisabled = false
296
+ skipFocusWhenDisabled = false // TODO v6: Rename to `focusableWhenDisabled`.
297
297
  } = props,
298
298
  other = _objectWithoutPropertiesLoose(props, _excluded);
299
299
  const chipRef = React.useRef(null);
@@ -70,7 +70,6 @@ const DividerRoot = styled('div', {
70
70
  alignSelf: 'stretch',
71
71
  height: 'auto'
72
72
  }), ({
73
- theme,
74
73
  ownerState
75
74
  }) => _extends({}, ownerState.children && {
76
75
  display: 'flex',
@@ -78,12 +77,16 @@ const DividerRoot = styled('div', {
78
77
  textAlign: 'center',
79
78
  border: 0,
80
79
  '&::before, &::after': {
81
- position: 'relative',
82
- width: '100%',
83
- borderTop: `thin solid ${(theme.vars || theme).palette.divider}`,
84
- top: '50%',
85
80
  content: '""',
86
- transform: 'translateY(50%)'
81
+ alignSelf: 'center'
82
+ }
83
+ }), ({
84
+ theme,
85
+ ownerState
86
+ }) => _extends({}, ownerState.children && ownerState.orientation !== 'vertical' && {
87
+ '&::before, &::after': {
88
+ width: '100%',
89
+ borderTop: `thin solid ${(theme.vars || theme).palette.divider}`
87
90
  }
88
91
  }), ({
89
92
  theme,
@@ -92,11 +95,7 @@ const DividerRoot = styled('div', {
92
95
  flexDirection: 'column',
93
96
  '&::before, &::after': {
94
97
  height: '100%',
95
- top: '0%',
96
- left: '50%',
97
- borderTop: 0,
98
- borderLeft: `thin solid ${(theme.vars || theme).palette.divider}`,
99
- transform: 'translateX(0%)'
98
+ borderLeft: `thin solid ${(theme.vars || theme).palette.divider}`
100
99
  }
101
100
  }), ({
102
101
  ownerState
@@ -371,7 +371,7 @@ const InputBase = /*#__PURE__*/React.forwardRef(function InputBase(inProps, ref)
371
371
  if (inputRef.current && event.currentTarget === event.target) {
372
372
  inputRef.current.focus();
373
373
  }
374
- if (onClick) {
374
+ if (onClick && !fcs.disabled) {
375
375
  onClick(event);
376
376
  }
377
377
  };
@@ -53,7 +53,6 @@ const Popper = /*#__PURE__*/React.forwardRef(function Popper(inProps, ref) {
53
53
  const RootComponent = slots?.root ?? components?.Root;
54
54
  const otherProps = _extends({
55
55
  anchorEl,
56
- component,
57
56
  container,
58
57
  disablePortal,
59
58
  keepMounted,
@@ -65,6 +64,7 @@ const Popper = /*#__PURE__*/React.forwardRef(function Popper(inProps, ref) {
65
64
  transition
66
65
  }, other);
67
66
  return /*#__PURE__*/_jsx(PopperRoot, _extends({
67
+ as: component,
68
68
  direction: theme?.direction,
69
69
  slots: {
70
70
  root: RootComponent
@@ -91,9 +91,10 @@ process.env.NODE_ENV !== "production" ? Popper.propTypes /* remove-proptypes */
91
91
  */
92
92
  children: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.node, PropTypes.func]),
93
93
  /**
94
- * @ignore
94
+ * The component used for the root node.
95
+ * Either a string to use a HTML element or a component.
95
96
  */
96
- component: PropTypes /* @typescript-to-proptypes-ignore */.elementType,
97
+ component: PropTypes.elementType,
97
98
  /**
98
99
  * The components used for each slot inside the Popper.
99
100
  * Either a string to use a HTML element or a component.
@@ -134,7 +134,10 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
134
134
  readOnly,
135
135
  renderValue,
136
136
  SelectDisplayProps = {},
137
- tabIndex: tabIndexProp,
137
+ tabIndex: tabIndexProp
138
+ // catching `type` from Input which makes no sense for SelectInput
139
+ ,
140
+
138
141
  value: valueProp,
139
142
  variant = 'standard'
140
143
  } = props,
@@ -235,11 +238,10 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
235
238
 
236
239
  // Support autofill.
237
240
  const handleChange = event => {
238
- const index = childrenArray.map(child => child.props.value).indexOf(event.target.value);
239
- if (index === -1) {
241
+ const child = childrenArray.find(childItem => childItem.props.value === event.target.value);
242
+ if (child === undefined) {
240
243
  return;
241
244
  }
242
- const child = childrenArray[index];
243
245
  setValueState(child.props.value);
244
246
  if (onChange) {
245
247
  onChange(event, child);
@@ -508,7 +508,7 @@ const Slider = /*#__PURE__*/React.forwardRef(function Slider(inputProps, ref) {
508
508
  trackOffset,
509
509
  trackLeap
510
510
  } = useSlider(_extends({}, ownerState, {
511
- ref
511
+ rootRef: ref
512
512
  }));
513
513
  ownerState.marked = marks.length > 0 && marks.some(mark => mark.label);
514
514
  ownerState.dragging = dragging;