@mui/material 5.12.1 → 5.12.3

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 (92) hide show
  1. package/Accordion/Accordion.d.ts +71 -57
  2. package/Badge/Badge.d.ts +3 -6
  3. package/BottomNavigationAction/BottomNavigationAction.js +4 -1
  4. package/ButtonGroup/ButtonGroup.js +8 -2
  5. package/CHANGELOG.md +188 -0
  6. package/Chip/Chip.js +1 -1
  7. package/Divider/Divider.js +10 -11
  8. package/FormControl/FormControl.js +1 -1
  9. package/Input/inputClasses.d.ts +4 -0
  10. package/InputBase/InputBase.js +1 -1
  11. package/Modal/Modal.d.ts +6 -3
  12. package/Modal/Modal.js +11 -3
  13. package/Modal/index.d.ts +1 -1
  14. package/Modal/index.js +1 -1
  15. package/OverridableComponent.d.ts +1 -1
  16. package/Paper/Paper.d.ts +6 -1
  17. package/Popper/Popper.d.ts +15 -5
  18. package/Popper/Popper.js +31 -6
  19. package/Popper/index.d.ts +1 -1
  20. package/Select/SelectInput.js +4 -1
  21. package/Slider/Slider.js +1 -1
  22. package/Snackbar/Snackbar.js +4 -3
  23. package/SwipeableDrawer/SwipeableDrawer.js +1 -1
  24. package/TextField/TextField.d.ts +21 -2
  25. package/TextField/TextField.js +7 -1
  26. package/index.js +1 -1
  27. package/legacy/ButtonGroup/ButtonGroup.js +7 -3
  28. package/legacy/Divider/Divider.js +17 -17
  29. package/legacy/Drawer/Drawer.js +4 -4
  30. package/legacy/FormControl/FormControl.js +1 -1
  31. package/legacy/InputBase/InputBase.js +1 -1
  32. package/legacy/ListItem/ListItem.js +4 -4
  33. package/legacy/Menu/Menu.js +4 -4
  34. package/legacy/Modal/Modal.js +11 -3
  35. package/legacy/Modal/index.js +1 -1
  36. package/legacy/Popover/Popover.js +4 -4
  37. package/legacy/Popper/Popper.js +32 -7
  38. package/legacy/Slider/Slider.js +1 -1
  39. package/legacy/Snackbar/Snackbar.js +16 -15
  40. package/legacy/SpeedDial/SpeedDial.js +8 -8
  41. package/legacy/SwipeableDrawer/SwipeableDrawer.js +4 -4
  42. package/legacy/TextField/TextField.js +7 -1
  43. package/legacy/index.js +1 -1
  44. package/legacy/useMediaQuery/useMediaQuery.js +8 -0
  45. package/modern/BottomNavigationAction/BottomNavigationAction.js +4 -1
  46. package/modern/ButtonGroup/ButtonGroup.js +8 -2
  47. package/modern/Chip/Chip.js +1 -1
  48. package/modern/Divider/Divider.js +10 -11
  49. package/modern/FormControl/FormControl.js +1 -1
  50. package/modern/InputBase/InputBase.js +1 -1
  51. package/modern/Modal/Modal.js +11 -3
  52. package/modern/Modal/index.js +1 -1
  53. package/modern/Popper/Popper.js +31 -6
  54. package/modern/Select/SelectInput.js +4 -1
  55. package/modern/Slider/Slider.js +1 -1
  56. package/modern/Snackbar/Snackbar.js +4 -3
  57. package/modern/SwipeableDrawer/SwipeableDrawer.js +1 -1
  58. package/modern/TextField/TextField.js +7 -1
  59. package/modern/index.js +1 -1
  60. package/modern/useMediaQuery/useMediaQuery.js +8 -0
  61. package/node/BottomNavigationAction/BottomNavigationAction.js +4 -1
  62. package/node/ButtonBase/Ripple.js +1 -2
  63. package/node/ButtonGroup/ButtonGroup.js +8 -2
  64. package/node/Chip/Chip.js +1 -1
  65. package/node/Divider/Divider.js +10 -11
  66. package/node/FormControl/FormControl.js +1 -1
  67. package/node/Grid/Grid.js +10 -1
  68. package/node/Hidden/Hidden.js +2 -2
  69. package/node/Hidden/HiddenJs.js +1 -2
  70. package/node/InputBase/InputBase.js +1 -1
  71. package/node/Modal/Modal.js +13 -5
  72. package/node/Modal/index.js +15 -18
  73. package/node/Popper/Popper.js +31 -6
  74. package/node/Select/SelectInput.js +4 -1
  75. package/node/Slide/Slide.js +2 -3
  76. package/node/Slider/Slider.js +1 -1
  77. package/node/Snackbar/Snackbar.js +4 -3
  78. package/node/SpeedDialAction/SpeedDialAction.js +1 -1
  79. package/node/SwipeableDrawer/SwipeableDrawer.js +3 -4
  80. package/node/Switch/Switch.js +1 -1
  81. package/node/TabScrollButton/TabScrollButton.js +1 -0
  82. package/node/TablePagination/TablePaginationActions.js +2 -2
  83. package/node/TextField/TextField.js +7 -1
  84. package/node/ToggleButton/ToggleButton.js +1 -1
  85. package/node/index.js +1 -1
  86. package/node/styles/index.js +5 -1
  87. package/node/useMediaQuery/useMediaQuery.js +12 -0
  88. package/node/utils/createSvgIcon.js +1 -2
  89. package/package.json +5 -5
  90. package/umd/material-ui.development.js +164 -103
  91. package/umd/material-ui.production.min.js +21 -21
  92. package/useMediaQuery/useMediaQuery.js +8 -0
@@ -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.1
2
+ * @mui/material v5.12.3
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
@@ -138,7 +138,7 @@ const FormControl = /*#__PURE__*/React.forwardRef(function FormControl(inProps,
138
138
  if (!isMuiElement(child, ['Input', 'Select'])) {
139
139
  return;
140
140
  }
141
- if (isFilled(child.props, true)) {
141
+ if (isFilled(child.props, true) || isFilled(child.props.inputProps, true)) {
142
142
  initialFilled = true;
143
143
  }
144
144
  });
@@ -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
  };
@@ -1,10 +1,10 @@
1
1
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
2
2
  import _extends from "@babel/runtime/helpers/esm/extends";
3
- const _excluded = ["BackdropComponent", "BackdropProps", "classes", "className", "closeAfterTransition", "children", "component", "components", "componentsProps", "disableAutoFocus", "disableEnforceFocus", "disableEscapeKeyDown", "disablePortal", "disableRestoreFocus", "disableScrollLock", "hideBackdrop", "keepMounted", "slotProps", "slots", "theme"];
3
+ const _excluded = ["BackdropComponent", "BackdropProps", "classes", "className", "closeAfterTransition", "children", "container", "component", "components", "componentsProps", "disableAutoFocus", "disableEnforceFocus", "disableEscapeKeyDown", "disablePortal", "disableRestoreFocus", "disableScrollLock", "hideBackdrop", "keepMounted", "onBackdropClick", "onClose", "open", "slotProps", "slots", "theme"];
4
4
  import * as React from 'react';
5
5
  import PropTypes from 'prop-types';
6
6
  import clsx from 'clsx';
7
- import ModalUnstyled, { modalUnstyledClasses } from '@mui/base/ModalUnstyled';
7
+ import ModalUnstyled, { modalClasses as modalUnstyledClasses } from '@mui/base/Modal';
8
8
  import { isHostComponent, resolveComponentProps } from '@mui/base/utils';
9
9
  import { elementAcceptingRef, HTMLElementType } from '@mui/utils';
10
10
  import styled from '../styles/styled';
@@ -69,6 +69,7 @@ const Modal = /*#__PURE__*/React.forwardRef(function Modal(inProps, ref) {
69
69
  className,
70
70
  closeAfterTransition = false,
71
71
  children,
72
+ container,
72
73
  component,
73
74
  components = {},
74
75
  componentsProps = {},
@@ -80,6 +81,9 @@ const Modal = /*#__PURE__*/React.forwardRef(function Modal(inProps, ref) {
80
81
  disableScrollLock = false,
81
82
  hideBackdrop = false,
82
83
  keepMounted = false,
84
+ onBackdropClick,
85
+ onClose,
86
+ open,
83
87
  slotProps,
84
88
  slots,
85
89
  // eslint-disable-next-line react/prop-types
@@ -88,6 +92,7 @@ const Modal = /*#__PURE__*/React.forwardRef(function Modal(inProps, ref) {
88
92
  other = _objectWithoutPropertiesLoose(props, _excluded);
89
93
  const [exited, setExited] = React.useState(true);
90
94
  const commonProps = {
95
+ container,
91
96
  closeAfterTransition,
92
97
  disableAutoFocus,
93
98
  disableEnforceFocus,
@@ -96,7 +101,10 @@ const Modal = /*#__PURE__*/React.forwardRef(function Modal(inProps, ref) {
96
101
  disableRestoreFocus,
97
102
  disableScrollLock,
98
103
  hideBackdrop,
99
- keepMounted
104
+ keepMounted,
105
+ onBackdropClick,
106
+ onClose,
107
+ open
100
108
  };
101
109
  const ownerState = _extends({}, props, commonProps, {
102
110
  exited
@@ -1,3 +1,3 @@
1
- export * from '@mui/base/ModalUnstyled';
1
+ export { ModalManager } from '@mui/base/Modal';
2
2
  export { default } from './Modal';
3
3
  export * from './Modal';
@@ -1,14 +1,14 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
- const _excluded = ["components", "componentsProps", "slots", "slotProps"];
4
- import PopperUnstyled from '@mui/base/PopperUnstyled';
3
+ const _excluded = ["anchorEl", "component", "components", "componentsProps", "container", "disablePortal", "keepMounted", "modifiers", "open", "placement", "popperOptions", "popperRef", "transition", "slots", "slotProps"];
4
+ import BasePopper from '@mui/base/Popper';
5
5
  import { useThemeWithoutDefault as useTheme } from '@mui/system';
6
6
  import { HTMLElementType, refType } from '@mui/utils';
7
7
  import PropTypes from 'prop-types';
8
8
  import * as React from 'react';
9
9
  import { styled, useThemeProps } from '../styles';
10
10
  import { jsx as _jsx } from "react/jsx-runtime";
11
- const PopperRoot = styled(PopperUnstyled, {
11
+ const PopperRoot = styled(BasePopper, {
12
12
  name: 'MuiPopper',
13
13
  slot: 'Root',
14
14
  overridesResolver: (props, styles) => styles.root
@@ -33,20 +33,44 @@ const Popper = /*#__PURE__*/React.forwardRef(function Popper(inProps, ref) {
33
33
  name: 'MuiPopper'
34
34
  });
35
35
  const {
36
+ anchorEl,
37
+ component,
36
38
  components,
37
39
  componentsProps,
40
+ container,
41
+ disablePortal,
42
+ keepMounted,
43
+ modifiers,
44
+ open,
45
+ placement,
46
+ popperOptions,
47
+ popperRef,
48
+ transition,
38
49
  slots,
39
50
  slotProps
40
51
  } = props,
41
52
  other = _objectWithoutPropertiesLoose(props, _excluded);
42
53
  const RootComponent = slots?.root ?? components?.Root;
54
+ const otherProps = _extends({
55
+ anchorEl,
56
+ container,
57
+ disablePortal,
58
+ keepMounted,
59
+ modifiers,
60
+ open,
61
+ placement,
62
+ popperOptions,
63
+ popperRef,
64
+ transition
65
+ }, other);
43
66
  return /*#__PURE__*/_jsx(PopperRoot, _extends({
67
+ as: component,
44
68
  direction: theme?.direction,
45
69
  slots: {
46
70
  root: RootComponent
47
71
  },
48
72
  slotProps: slotProps ?? componentsProps
49
- }, other, {
73
+ }, otherProps, {
50
74
  ref: ref
51
75
  }));
52
76
  });
@@ -67,9 +91,10 @@ process.env.NODE_ENV !== "production" ? Popper.propTypes /* remove-proptypes */
67
91
  */
68
92
  children: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.node, PropTypes.func]),
69
93
  /**
70
- * @ignore
94
+ * The component used for the root node.
95
+ * Either a string to use a HTML element or a component.
71
96
  */
72
- component: PropTypes /* @typescript-to-proptypes-ignore */.elementType,
97
+ component: PropTypes.elementType,
73
98
  /**
74
99
  * The components used for each slot inside the Popper.
75
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,
@@ -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;
@@ -123,15 +123,16 @@ const Snackbar = /*#__PURE__*/React.forwardRef(function Snackbar(inProps, ref) {
123
123
  const {
124
124
  getRootProps,
125
125
  onClickAway
126
- } = useSnackbar(_extends({}, ownerState, {
127
- ref
128
- }));
126
+ } = useSnackbar(_extends({}, ownerState));
129
127
  const [exited, setExited] = React.useState(true);
130
128
  const rootProps = useSlotProps({
131
129
  elementType: SnackbarRoot,
132
130
  getSlotProps: getRootProps,
133
131
  externalForwardedProps: other,
134
132
  ownerState,
133
+ additionalProps: {
134
+ ref
135
+ },
135
136
  className: [classes.root, className]
136
137
  });
137
138
  const handleExited = node => {
@@ -145,7 +145,7 @@ const SwipeableDrawer = /*#__PURE__*/React.forwardRef(function SwipeableDrawer(i
145
145
  SwipeAreaProps,
146
146
  swipeAreaWidth = 20,
147
147
  transitionDuration = transitionDurationDefault,
148
- variant = 'temporary'
148
+ variant = 'temporary' // Mobile first.
149
149
  } = props,
150
150
  ModalPropsProp = _objectWithoutPropertiesLoose(props.ModalProps, _excluded),
151
151
  other = _objectWithoutPropertiesLoose(props, _excluded2);
@@ -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/modern/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/material v5.12.1
2
+ * @mui/material v5.12.3
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -6,6 +6,14 @@ import useEnhancedEffect from '../utils/useEnhancedEffect';
6
6
  * @deprecated Not used internally. Use `MediaQueryListEvent` from lib.dom.d.ts instead.
7
7
  */
8
8
 
9
+ /**
10
+ * @deprecated Not used internally. Use `MediaQueryList` from lib.dom.d.ts instead.
11
+ */
12
+
13
+ /**
14
+ * @deprecated Not used internally. Use `(event: MediaQueryListEvent) => void` instead.
15
+ */
16
+
9
17
  function useMediaQueryOld(query, defaultMatches, matchMedia, ssrMatchMedia, noSsr) {
10
18
  const [match, setMatch] = React.useState(() => {
11
19
  if (noSsr && matchMedia) {
@@ -94,7 +94,10 @@ const BottomNavigationAction = /*#__PURE__*/React.forwardRef(function BottomNavi
94
94
  icon,
95
95
  label,
96
96
  onChange,
97
- onClick,
97
+ onClick
98
+ // eslint-disable-next-line react/prop-types -- private, always overridden by BottomNavigation
99
+ ,
100
+
98
101
  value
99
102
  } = props,
100
103
  other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
@@ -13,8 +13,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
13
13
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
14
14
  /**
15
15
  * @ignore - internal component.
16
- */
17
- function Ripple(props) {
16
+ */function Ripple(props) {
18
17
  const {
19
18
  className,
20
19
  classes,
@@ -92,9 +92,15 @@ const ButtonGroupRoot = (0, _styled.default)('div', {
92
92
  borderBottomRightRadius: 0,
93
93
  borderBottomLeftRadius: 0
94
94
  }, ownerState.variant === 'text' && ownerState.orientation === 'horizontal' && {
95
- 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)'}`
95
+ 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)'}`,
96
+ [`&.${_buttonGroupClasses.default.disabled}`]: {
97
+ borderRight: `1px solid ${(theme.vars || theme).palette.action.disabled}`
98
+ }
96
99
  }, ownerState.variant === 'text' && ownerState.orientation === 'vertical' && {
97
- 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)'}`
100
+ 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)'}`,
101
+ [`&.${_buttonGroupClasses.default.disabled}`]: {
102
+ borderBottom: `1px solid ${(theme.vars || theme).palette.action.disabled}`
103
+ }
98
104
  }, ownerState.variant === 'text' && ownerState.color !== 'inherit' && {
99
105
  borderColor: theme.vars ? `rgba(${theme.vars.palette[ownerState.color].mainChannel} / 0.5)` : (0, _system.alpha)(theme.palette[ownerState.color].main, 0.5)
100
106
  }, ownerState.variant === 'outlined' && ownerState.orientation === 'horizontal' && {
package/node/Chip/Chip.js CHANGED
@@ -301,7 +301,7 @@ const Chip = /*#__PURE__*/React.forwardRef(function Chip(inProps, ref) {
301
301
  size = 'medium',
302
302
  variant = 'filled',
303
303
  tabIndex,
304
- skipFocusWhenDisabled = false
304
+ skipFocusWhenDisabled = false // TODO v6: Rename to `focusableWhenDisabled`.
305
305
  } = props,
306
306
  other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
307
307
  const chipRef = React.useRef(null);
@@ -79,7 +79,6 @@ const DividerRoot = (0, _styled.default)('div', {
79
79
  alignSelf: 'stretch',
80
80
  height: 'auto'
81
81
  }), ({
82
- theme,
83
82
  ownerState
84
83
  }) => (0, _extends2.default)({}, ownerState.children && {
85
84
  display: 'flex',
@@ -87,12 +86,16 @@ const DividerRoot = (0, _styled.default)('div', {
87
86
  textAlign: 'center',
88
87
  border: 0,
89
88
  '&::before, &::after': {
90
- position: 'relative',
91
- width: '100%',
92
- borderTop: `thin solid ${(theme.vars || theme).palette.divider}`,
93
- top: '50%',
94
89
  content: '""',
95
- transform: 'translateY(50%)'
90
+ alignSelf: 'center'
91
+ }
92
+ }), ({
93
+ theme,
94
+ ownerState
95
+ }) => (0, _extends2.default)({}, ownerState.children && ownerState.orientation !== 'vertical' && {
96
+ '&::before, &::after': {
97
+ width: '100%',
98
+ borderTop: `thin solid ${(theme.vars || theme).palette.divider}`
96
99
  }
97
100
  }), ({
98
101
  theme,
@@ -101,11 +104,7 @@ const DividerRoot = (0, _styled.default)('div', {
101
104
  flexDirection: 'column',
102
105
  '&::before, &::after': {
103
106
  height: '100%',
104
- top: '0%',
105
- left: '50%',
106
- borderTop: 0,
107
- borderLeft: `thin solid ${(theme.vars || theme).palette.divider}`,
108
- transform: 'translateX(0%)'
107
+ borderLeft: `thin solid ${(theme.vars || theme).palette.divider}`
109
108
  }
110
109
  }), ({
111
110
  ownerState
@@ -147,7 +147,7 @@ const FormControl = /*#__PURE__*/React.forwardRef(function FormControl(inProps,
147
147
  if (!(0, _isMuiElement.default)(child, ['Input', 'Select'])) {
148
148
  return;
149
149
  }
150
- if ((0, _utils.isFilled)(child.props, true)) {
150
+ if ((0, _utils.isFilled)(child.props, true) || (0, _utils.isFilled)(child.props.inputProps, true)) {
151
151
  initialFilled = true;
152
152
  }
153
153
  });
package/node/Grid/Grid.js CHANGED
@@ -25,7 +25,16 @@ var _useTheme = _interopRequireDefault(require("../styles/useTheme"));
25
25
  var _GridContext = _interopRequireDefault(require("./GridContext"));
26
26
  var _gridClasses = _interopRequireWildcard(require("./gridClasses"));
27
27
  var _jsxRuntime = require("react/jsx-runtime");
28
- const _excluded = ["className", "columns", "columnSpacing", "component", "container", "direction", "item", "rowSpacing", "spacing", "wrap", "zeroMinWidth"];
28
+ const _excluded = ["className", "columns", "columnSpacing", "component", "container", "direction", "item", "rowSpacing", "spacing", "wrap", "zeroMinWidth"]; // A grid component using the following libs as inspiration.
29
+ //
30
+ // For the implementation:
31
+ // - https://getbootstrap.com/docs/4.3/layout/grid/
32
+ // - https://github.com/kristoferjoseph/flexboxgrid/blob/master/src/css/flexboxgrid.css
33
+ // - https://github.com/roylee0704/react-flexbox-grid
34
+ // - https://material.angularjs.org/latest/layout/introduction
35
+ //
36
+ // Follow this flexbox Guide to better understand the underlying model:
37
+ // - https://css-tricks.com/snippets/css/a-guide-to-flexbox/
29
38
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
30
39
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
31
40
  function getOffset(val) {
@@ -13,11 +13,11 @@ var _HiddenJs = _interopRequireDefault(require("./HiddenJs"));
13
13
  var _HiddenCss = _interopRequireDefault(require("./HiddenCss"));
14
14
  var _jsxRuntime = require("react/jsx-runtime");
15
15
  const _excluded = ["implementation", "lgDown", "lgUp", "mdDown", "mdUp", "smDown", "smUp", "xlDown", "xlUp", "xsDown", "xsUp"];
16
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
17
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
18
16
  /**
19
17
  * Responsively hides children based on the selected implementation.
20
18
  */
19
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
20
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
21
21
  function Hidden(props) {
22
22
  const {
23
23
  implementation = 'js',
@@ -15,8 +15,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
15
15
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
16
16
  /**
17
17
  * @ignore - internal component.
18
- */
19
- function HiddenJs(props) {
18
+ */function HiddenJs(props) {
20
19
  const {
21
20
  children,
22
21
  only,
@@ -383,7 +383,7 @@ const InputBase = /*#__PURE__*/React.forwardRef(function InputBase(inProps, ref)
383
383
  if (inputRef.current && event.currentTarget === event.target) {
384
384
  inputRef.current.focus();
385
385
  }
386
- if (onClick) {
386
+ if (onClick && !fcs.disabled) {
387
387
  onClick(event);
388
388
  }
389
389
  };