@mui/material 5.11.15 → 5.11.16

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 (50) hide show
  1. package/Autocomplete/Autocomplete.js +9 -1
  2. package/Badge/badgeClasses.d.ts +18 -18
  3. package/CHANGELOG.md +66 -4
  4. package/CardActionArea/CardActionArea.js +2 -0
  5. package/NativeSelect/NativeSelectInput.d.ts +1 -0
  6. package/NativeSelect/NativeSelectInput.js +12 -5
  7. package/NativeSelect/nativeSelectClasses.d.ts +2 -0
  8. package/NativeSelect/nativeSelectClasses.js +1 -1
  9. package/Select/Select.js +14 -9
  10. package/Select/SelectInput.d.ts +1 -0
  11. package/Select/SelectInput.js +14 -4
  12. package/Select/selectClasses.d.ts +2 -0
  13. package/Select/selectClasses.js +1 -1
  14. package/Slider/Slider.js +6 -6
  15. package/Slider/sliderClasses.d.ts +22 -22
  16. package/Unstable_Grid2/Grid2.js +1 -0
  17. package/index.js +1 -1
  18. package/legacy/Autocomplete/Autocomplete.js +8 -3
  19. package/legacy/CardActionArea/CardActionArea.js +2 -0
  20. package/legacy/NativeSelect/NativeSelectInput.js +12 -5
  21. package/legacy/NativeSelect/nativeSelectClasses.js +1 -1
  22. package/legacy/Select/Select.js +14 -9
  23. package/legacy/Select/SelectInput.js +14 -5
  24. package/legacy/Select/selectClasses.js +1 -1
  25. package/legacy/Slider/Slider.js +6 -6
  26. package/legacy/Unstable_Grid2/Grid2.js +1 -0
  27. package/legacy/index.js +1 -1
  28. package/modern/Autocomplete/Autocomplete.js +9 -1
  29. package/modern/CardActionArea/CardActionArea.js +2 -0
  30. package/modern/NativeSelect/NativeSelectInput.js +12 -5
  31. package/modern/NativeSelect/nativeSelectClasses.js +1 -1
  32. package/modern/Select/Select.js +14 -9
  33. package/modern/Select/SelectInput.js +14 -4
  34. package/modern/Select/selectClasses.js +1 -1
  35. package/modern/Slider/Slider.js +6 -6
  36. package/modern/Unstable_Grid2/Grid2.js +1 -0
  37. package/modern/index.js +1 -1
  38. package/node/Autocomplete/Autocomplete.js +9 -1
  39. package/node/CardActionArea/CardActionArea.js +2 -0
  40. package/node/NativeSelect/NativeSelectInput.js +12 -5
  41. package/node/NativeSelect/nativeSelectClasses.js +1 -1
  42. package/node/Select/Select.js +14 -9
  43. package/node/Select/SelectInput.js +14 -4
  44. package/node/Select/selectClasses.js +1 -1
  45. package/node/Slider/Slider.js +6 -6
  46. package/node/Unstable_Grid2/Grid2.js +1 -0
  47. package/node/index.js +1 -1
  48. package/package.json +5 -5
  49. package/umd/material-ui.development.js +81 -45
  50. package/umd/material-ui.production.min.js +9 -9
@@ -23,7 +23,6 @@ var _useThemeProps = _interopRequireDefault(require("../styles/useThemeProps"));
23
23
  var _useForkRef = _interopRequireDefault(require("../utils/useForkRef"));
24
24
  var _styled = _interopRequireWildcard(require("../styles/styled"));
25
25
  var _jsxRuntime = require("react/jsx-runtime");
26
- var _StyledInput, _StyledFilledInput;
27
26
  const _excluded = ["autoWidth", "children", "classes", "className", "defaultOpen", "displayEmpty", "IconComponent", "id", "input", "inputProps", "label", "labelId", "MenuProps", "multiple", "native", "onClose", "onOpen", "open", "renderValue", "SelectDisplayProps", "variant"];
28
27
  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); }
29
28
  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; }
@@ -76,21 +75,26 @@ const Select = /*#__PURE__*/React.forwardRef(function Select(inProps, ref) {
76
75
  const fcs = (0, _formControlState.default)({
77
76
  props,
78
77
  muiFormControl,
79
- states: ['variant']
78
+ states: ['variant', 'error']
80
79
  });
81
80
  const variant = fcs.variant || variantProp;
82
- const InputComponent = input || {
83
- standard: _StyledInput || (_StyledInput = /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledInput, {})),
84
- outlined: /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledOutlinedInput, {
85
- label: label
86
- }),
87
- filled: _StyledFilledInput || (_StyledFilledInput = /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledFilledInput, {}))
88
- }[variant];
89
81
  const ownerState = (0, _extends2.default)({}, props, {
90
82
  variant,
91
83
  classes: classesProp
92
84
  });
93
85
  const classes = useUtilityClasses(ownerState);
86
+ const InputComponent = input || {
87
+ standard: /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledInput, {
88
+ ownerState: ownerState
89
+ }),
90
+ outlined: /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledOutlinedInput, {
91
+ label: label,
92
+ ownerState: ownerState
93
+ }),
94
+ filled: /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledFilledInput, {
95
+ ownerState: ownerState
96
+ })
97
+ }[variant];
94
98
  const inputComponentRef = (0, _useForkRef.default)(ref, InputComponent.ref);
95
99
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(React.Fragment, {
96
100
  children: /*#__PURE__*/React.cloneElement(InputComponent, (0, _extends2.default)({
@@ -99,6 +103,7 @@ const Select = /*#__PURE__*/React.forwardRef(function Select(inProps, ref) {
99
103
  inputComponent,
100
104
  inputProps: (0, _extends2.default)({
101
105
  children,
106
+ error: fcs.error,
102
107
  IconComponent,
103
108
  variant,
104
109
  type: undefined,
@@ -24,7 +24,7 @@ var _useControlled = _interopRequireDefault(require("../utils/useControlled"));
24
24
  var _selectClasses = _interopRequireWildcard(require("./selectClasses"));
25
25
  var _jsxRuntime = require("react/jsx-runtime");
26
26
  var _span;
27
- const _excluded = ["aria-describedby", "aria-label", "autoFocus", "autoWidth", "children", "className", "defaultOpen", "defaultValue", "disabled", "displayEmpty", "IconComponent", "inputRef", "labelId", "MenuProps", "multiple", "name", "onBlur", "onChange", "onClose", "onFocus", "onOpen", "open", "readOnly", "renderValue", "SelectDisplayProps", "tabIndex", "type", "value", "variant"];
27
+ const _excluded = ["aria-describedby", "aria-label", "autoFocus", "autoWidth", "children", "className", "defaultOpen", "defaultValue", "disabled", "displayEmpty", "error", "IconComponent", "inputRef", "labelId", "MenuProps", "multiple", "name", "onBlur", "onChange", "onClose", "onFocus", "onOpen", "open", "readOnly", "renderValue", "SelectDisplayProps", "tabIndex", "type", "value", "variant"];
28
28
  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); }
29
29
  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; }
30
30
  const SelectSelect = (0, _styled.default)('div', {
@@ -40,6 +40,8 @@ const SelectSelect = (0, _styled.default)('div', {
40
40
  [`&.${_selectClasses.default.select}`]: styles.select
41
41
  }, {
42
42
  [`&.${_selectClasses.default.select}`]: styles[ownerState.variant]
43
+ }, {
44
+ [`&.${_selectClasses.default.error}`]: styles.error
43
45
  }, {
44
46
  [`&.${_selectClasses.default.multiple}`]: styles.multiple
45
47
  }];
@@ -97,10 +99,11 @@ const useUtilityClasses = ownerState => {
97
99
  variant,
98
100
  disabled,
99
101
  multiple,
100
- open
102
+ open,
103
+ error
101
104
  } = ownerState;
102
105
  const slots = {
103
- select: ['select', variant, disabled && 'disabled', multiple && 'multiple'],
106
+ select: ['select', variant, disabled && 'disabled', multiple && 'multiple', error && 'error'],
104
107
  icon: ['icon', `icon${(0, _capitalize.default)(variant)}`, open && 'iconOpen', disabled && 'disabled'],
105
108
  nativeInput: ['nativeInput']
106
109
  };
@@ -122,6 +125,7 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
122
125
  defaultValue,
123
126
  disabled,
124
127
  displayEmpty,
128
+ error = false,
125
129
  IconComponent,
126
130
  inputRef: inputRefProp,
127
131
  labelId,
@@ -427,7 +431,8 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
427
431
  const ownerState = (0, _extends2.default)({}, props, {
428
432
  variant,
429
433
  value,
430
- open
434
+ open,
435
+ error
431
436
  });
432
437
  const classes = useUtilityClasses(ownerState);
433
438
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(React.Fragment, {
@@ -457,6 +462,7 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
457
462
  children: "\u200B"
458
463
  })) : display
459
464
  })), /*#__PURE__*/(0, _jsxRuntime.jsx)(SelectNativeInput, (0, _extends2.default)({
465
+ "aria-invalid": error,
460
466
  value: Array.isArray(value) ? value.join(',') : value,
461
467
  name: name,
462
468
  ref: inputRef,
@@ -548,6 +554,10 @@ process.env.NODE_ENV !== "production" ? SelectInput.propTypes = {
548
554
  * If `true`, the selected item is displayed even if its value is empty.
549
555
  */
550
556
  displayEmpty: _propTypes.default.bool,
557
+ /**
558
+ * If `true`, the `select input` will indicate an error.
559
+ */
560
+ error: _propTypes.default.bool,
551
561
  /**
552
562
  * The icon that displays the arrow.
553
563
  */
@@ -11,6 +11,6 @@ var _generateUtilityClass = _interopRequireDefault(require("../generateUtilityCl
11
11
  function getSelectUtilityClasses(slot) {
12
12
  return (0, _generateUtilityClass.default)('MuiSelect', slot);
13
13
  }
14
- const selectClasses = (0, _utils.unstable_generateUtilityClasses)('MuiSelect', ['select', 'multiple', 'filled', 'outlined', 'standard', 'disabled', 'focused', 'icon', 'iconOpen', 'iconFilled', 'iconOutlined', 'iconStandard', 'nativeInput']);
14
+ const selectClasses = (0, _utils.unstable_generateUtilityClasses)('MuiSelect', ['select', 'multiple', 'filled', 'outlined', 'standard', 'disabled', 'focused', 'icon', 'iconOpen', 'iconFilled', 'iconOutlined', 'iconStandard', 'nativeInput', 'error']);
15
15
  var _default = selectClasses;
16
16
  exports.default = _default;
@@ -277,7 +277,7 @@ const StyledSliderValueLabel = (0, _styled.default)(_SliderValueLabel.default, {
277
277
  ownerState
278
278
  }) => (0, _extends2.default)({
279
279
  [`&.${_sliderClasses.default.valueLabelOpen}`]: {
280
- transform: 'translateY(-100%) scale(1)'
280
+ transform: `${ownerState.orientation === 'vertical' ? 'translateY(-50%)' : 'translateY(-100%)'} scale(1)`
281
281
  },
282
282
  zIndex: 1,
283
283
  whiteSpace: 'nowrap'
@@ -286,7 +286,7 @@ const StyledSliderValueLabel = (0, _styled.default)(_SliderValueLabel.default, {
286
286
  transition: theme.transitions.create(['transform'], {
287
287
  duration: theme.transitions.duration.shortest
288
288
  }),
289
- transform: 'translateY(-100%) scale(0)',
289
+ transform: `${ownerState.orientation === 'vertical' ? 'translateY(-50%)' : 'translateY(-100%)'} scale(0)`,
290
290
  position: 'absolute',
291
291
  backgroundColor: (theme.vars || theme).palette.grey[600],
292
292
  borderRadius: 2,
@@ -309,18 +309,18 @@ const StyledSliderValueLabel = (0, _styled.default)(_SliderValueLabel.default, {
309
309
  left: '50%'
310
310
  }
311
311
  }, ownerState.orientation === 'vertical' && {
312
- right: '30px',
313
- top: '24px',
312
+ right: ownerState.size === 'small' ? '20px' : '30px',
313
+ top: '50%',
314
314
  transformOrigin: 'right center',
315
315
  '&:before': {
316
316
  position: 'absolute',
317
317
  content: '""',
318
318
  width: 8,
319
319
  height: 8,
320
- transform: 'translate(-50%, 50%) rotate(45deg)',
320
+ transform: 'translate(-50%, -50%) rotate(45deg)',
321
321
  backgroundColor: 'inherit',
322
322
  right: '-20%',
323
- top: '25%'
323
+ top: '50%'
324
324
  }
325
325
  }, ownerState.size === 'small' && {
326
326
  fontSize: theme.typography.pxToRem(12),
@@ -11,6 +11,7 @@ var _styles = require("../styles");
11
11
  const Grid2 = (0, _Unstable_Grid.createGrid)({
12
12
  createStyledComponent: (0, _styles.styled)('div', {
13
13
  name: 'MuiGrid2',
14
+ slot: 'Root',
14
15
  overridesResolver: (props, styles) => styles.root
15
16
  }),
16
17
  componentName: 'MuiGrid2',
package/node/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/material v5.11.15
2
+ * @mui/material v5.11.16
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/material",
3
- "version": "5.11.15",
3
+ "version": "5.11.16",
4
4
  "private": false,
5
5
  "author": "MUI Team",
6
6
  "description": "React components that implement Google's Material Design.",
@@ -46,14 +46,14 @@
46
46
  },
47
47
  "dependencies": {
48
48
  "@babel/runtime": "^7.21.0",
49
- "@mui/base": "5.0.0-alpha.123",
50
- "@mui/core-downloads-tracker": "^5.11.15",
51
- "@mui/system": "^5.11.15",
49
+ "@mui/base": "5.0.0-alpha.124",
50
+ "@mui/core-downloads-tracker": "^5.11.16",
51
+ "@mui/system": "^5.11.16",
52
52
  "@mui/types": "^7.2.3",
53
53
  "@mui/utils": "^5.11.13",
54
54
  "@types/react-transition-group": "^4.4.5",
55
55
  "clsx": "^1.2.1",
56
- "csstype": "^3.1.1",
56
+ "csstype": "^3.1.2",
57
57
  "prop-types": "^15.8.1",
58
58
  "react-is": "^18.2.0",
59
59
  "react-transition-group": "^4.4.5"
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/material v5.11.15
2
+ * @mui/material v5.11.16
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -10738,7 +10738,7 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
10738
10738
  *
10739
10739
  * API:
10740
10740
  *
10741
- * - [useBadge API](https://mui.com/base/api/use-badge/)
10741
+ * - [useBadge API](https://mui.com/base/react-badge/hooks-api/#use-badge)
10742
10742
  */
10743
10743
  function useBadge(parameters) {
10744
10744
  const {
@@ -10784,7 +10784,7 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
10784
10784
  *
10785
10785
  * API:
10786
10786
  *
10787
- * - [ClickAwayListener API](https://mui.com/base/api/click-away-listener/)
10787
+ * - [ClickAwayListener API](https://mui.com/base/react-click-away-listener/components-api/#click-away-listener)
10788
10788
  */
10789
10789
  function ClickAwayListener(props) {
10790
10790
  const {
@@ -11012,7 +11012,7 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
11012
11012
  *
11013
11013
  * API:
11014
11014
  *
11015
- * - [FocusTrap API](https://mui.com/base/api/focus-trap/)
11015
+ * - [FocusTrap API](https://mui.com/base/react-focus-trap/components-api/#focus-trap)
11016
11016
  */
11017
11017
  function FocusTrap(props) {
11018
11018
  const {
@@ -13246,7 +13246,7 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
13246
13246
  *
13247
13247
  * API:
13248
13248
  *
13249
- * - [Portal API](https://mui.com/base/api/portal/)
13249
+ * - [Portal API](https://mui.com/base/react-portal/components-api/#portal)
13250
13250
  */
13251
13251
  const Portal = /*#__PURE__*/React__namespace.forwardRef(function Portal(props, ref) {
13252
13252
  const {
@@ -13485,7 +13485,7 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
13485
13485
  *
13486
13486
  * API:
13487
13487
  *
13488
- * - [PopperUnstyled API](https://mui.com/base/api/popper-unstyled/)
13488
+ * - [PopperUnstyled API](https://mui.com/base/react-popper/components-api/#popper-unstyled)
13489
13489
  */
13490
13490
  const PopperUnstyled = /*#__PURE__*/React__namespace.forwardRef(function PopperUnstyled(props, ref) {
13491
13491
  const {
@@ -13947,7 +13947,7 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
13947
13947
  *
13948
13948
  * API:
13949
13949
  *
13950
- * - [ModalUnstyled API](https://mui.com/base/api/modal-unstyled/)
13950
+ * - [ModalUnstyled API](https://mui.com/base/react-modal/components-api/#modal-unstyled)
13951
13951
  */
13952
13952
  const ModalUnstyled = /*#__PURE__*/React__namespace.forwardRef(function ModalUnstyled(props, forwardedRef) {
13953
13953
  var _props$ariaHidden, _ref;
@@ -14287,7 +14287,7 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
14287
14287
  *
14288
14288
  * API:
14289
14289
  *
14290
- * - [NoSsr API](https://mui.com/base/api/no-ssr/)
14290
+ * - [NoSsr API](https://mui.com/base/react-no-ssr/components-api/#no-ssr)
14291
14291
  */
14292
14292
  function NoSsr(props) {
14293
14293
  const {
@@ -14488,7 +14488,7 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
14488
14488
  *
14489
14489
  * API:
14490
14490
  *
14491
- * - [useSlider API](https://mui.com/base/api/use-slider/)
14491
+ * - [useSlider API](https://mui.com/base/react-slider/hooks-api/#use-slider)
14492
14492
  */
14493
14493
  function useSlider(parameters) {
14494
14494
  const {
@@ -14952,7 +14952,7 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
14952
14952
  *
14953
14953
  * API:
14954
14954
  *
14955
- * - [useSnackbar API](https://mui.com/base/api/use-snackbar/)
14955
+ * - [useSnackbar API](https://mui.com/base/react-snackbar/hooks-api/#use-snackbar)
14956
14956
  */
14957
14957
  function useSnackbar(parameters) {
14958
14958
  const {
@@ -15108,7 +15108,7 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
15108
15108
  *
15109
15109
  * API:
15110
15110
  *
15111
- * - [TextareaAutosize API](https://mui.com/base/api/textarea-autosize/)
15111
+ * - [TextareaAutosize API](https://mui.com/base/react-textarea-autosize/components-api/#textarea-autosize)
15112
15112
  */
15113
15113
  const TextareaAutosize = /*#__PURE__*/React__namespace.forwardRef(function TextareaAutosize(props, ref) {
15114
15114
  const {
@@ -16108,12 +16108,15 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
16108
16108
  handleOpen(event);
16109
16109
  }
16110
16110
  };
16111
- const handleOptionMouseOver = event => {
16112
- setHighlightedIndex({
16113
- event,
16114
- index: Number(event.currentTarget.getAttribute('data-option-index')),
16115
- reason: 'mouse'
16116
- });
16111
+ const handleOptionMouseMove = event => {
16112
+ const index = Number(event.currentTarget.getAttribute('data-option-index'));
16113
+ if (highlightedIndexRef.current !== index) {
16114
+ setHighlightedIndex({
16115
+ event,
16116
+ index,
16117
+ reason: 'mouse'
16118
+ });
16119
+ }
16117
16120
  };
16118
16121
  const handleOptionTouchStart = event => {
16119
16122
  setHighlightedIndex({
@@ -16267,7 +16270,7 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
16267
16270
  tabIndex: -1,
16268
16271
  role: 'option',
16269
16272
  id: `${id}-option-${index}`,
16270
- onMouseOver: handleOptionMouseOver,
16273
+ onMouseMove: handleOptionMouseMove,
16271
16274
  onClick: handleOptionClick,
16272
16275
  onTouchStart: handleOptionTouchStart,
16273
16276
  'data-option-index': index,
@@ -22454,6 +22457,9 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
22454
22457
  }));
22455
22458
  const hasClearIcon = !disableClearable && !disabled && dirty && !readOnly;
22456
22459
  const hasPopupIcon = (!freeSolo || forcePopupIcon === true) && forcePopupIcon !== false;
22460
+ const {
22461
+ onMouseDown: handleInputMouseDown
22462
+ } = getInputProps();
22457
22463
 
22458
22464
  // If you modify this, make sure to keep the `AutocompleteOwnerState` type in sync.
22459
22465
  const ownerState = _extends({}, props, {
@@ -22544,7 +22550,12 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
22544
22550
  InputProps: _extends({
22545
22551
  ref: setAnchorEl,
22546
22552
  className: classes.inputRoot,
22547
- startAdornment
22553
+ startAdornment,
22554
+ onClick: event => {
22555
+ if (event.target === event.currentTarget) {
22556
+ handleInputMouseDown(event);
22557
+ }
22558
+ }
22548
22559
  }, (hasClearIcon || hasPopupIcon) && {
22549
22560
  endAdornment: /*#__PURE__*/jsxRuntime_2(AutocompleteEndAdornment, {
22550
22561
  className: classes.endAdornment,
@@ -25563,6 +25574,8 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
25563
25574
  }) => ({
25564
25575
  display: 'block',
25565
25576
  textAlign: 'inherit',
25577
+ borderRadius: 'inherit',
25578
+ // for Safari to work https://github.com/mui/material-ui/issues/36285.
25566
25579
  width: '100%',
25567
25580
  [`&:hover .${cardActionAreaClasses$1.focusHighlight}`]: {
25568
25581
  opacity: (theme.vars || theme).palette.action.hoverOpacity,
@@ -31009,6 +31022,7 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
31009
31022
  const Grid2 = createGrid({
31010
31023
  createStyledComponent: styled$1('div', {
31011
31024
  name: 'MuiGrid2',
31025
+ slot: 'Root',
31012
31026
  overridesResolver: (props, styles) => styles.root
31013
31027
  }),
31014
31028
  componentName: 'MuiGrid2',
@@ -36462,20 +36476,21 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
36462
36476
  function getNativeSelectUtilityClasses(slot) {
36463
36477
  return generateUtilityClass('MuiNativeSelect', slot);
36464
36478
  }
36465
- const nativeSelectClasses = generateUtilityClasses('MuiNativeSelect', ['root', 'select', 'multiple', 'filled', 'outlined', 'standard', 'disabled', 'icon', 'iconOpen', 'iconFilled', 'iconOutlined', 'iconStandard', 'nativeInput']);
36479
+ const nativeSelectClasses = generateUtilityClasses('MuiNativeSelect', ['root', 'select', 'multiple', 'filled', 'outlined', 'standard', 'disabled', 'icon', 'iconOpen', 'iconFilled', 'iconOutlined', 'iconStandard', 'nativeInput', 'error']);
36466
36480
  var nativeSelectClasses$1 = nativeSelectClasses;
36467
36481
 
36468
- const _excluded$O = ["className", "disabled", "IconComponent", "inputRef", "variant"];
36482
+ const _excluded$O = ["className", "disabled", "error", "IconComponent", "inputRef", "variant"];
36469
36483
  const useUtilityClasses$F = ownerState => {
36470
36484
  const {
36471
36485
  classes,
36472
36486
  variant,
36473
36487
  disabled,
36474
36488
  multiple,
36475
- open
36489
+ open,
36490
+ error
36476
36491
  } = ownerState;
36477
36492
  const slots = {
36478
- select: ['select', variant, disabled && 'disabled', multiple && 'multiple'],
36493
+ select: ['select', variant, disabled && 'disabled', multiple && 'multiple', error && 'error'],
36479
36494
  icon: ['icon', `icon${capitalize(variant)}`, open && 'iconOpen', disabled && 'disabled']
36480
36495
  };
36481
36496
  return composeClasses(slots, getNativeSelectUtilityClasses, classes);
@@ -36542,7 +36557,7 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
36542
36557
  const {
36543
36558
  ownerState
36544
36559
  } = props;
36545
- return [styles.select, styles[ownerState.variant], {
36560
+ return [styles.select, styles[ownerState.variant], ownerState.error && styles.error, {
36546
36561
  [`&.${nativeSelectClasses$1.multiple}`]: styles.multiple
36547
36562
  }];
36548
36563
  }
@@ -36588,6 +36603,7 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
36588
36603
  const {
36589
36604
  className,
36590
36605
  disabled,
36606
+ error,
36591
36607
  IconComponent,
36592
36608
  inputRef,
36593
36609
  variant = 'standard'
@@ -36595,7 +36611,8 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
36595
36611
  other = _objectWithoutPropertiesLoose(props, _excluded$O);
36596
36612
  const ownerState = _extends({}, props, {
36597
36613
  disabled,
36598
- variant
36614
+ variant,
36615
+ error
36599
36616
  });
36600
36617
  const classes = useUtilityClasses$F(ownerState);
36601
36618
  return /*#__PURE__*/jsxRuntime_2(React__namespace.Fragment, {
@@ -36630,6 +36647,10 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
36630
36647
  * If `true`, the select is disabled.
36631
36648
  */
36632
36649
  disabled: PropTypes.bool,
36650
+ /**
36651
+ * If `true`, the `select input` will indicate an error.
36652
+ */
36653
+ error: PropTypes.bool,
36633
36654
  /**
36634
36655
  * The icon that displays the arrow.
36635
36656
  */
@@ -39071,11 +39092,11 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
39071
39092
  function getSelectUtilityClasses(slot) {
39072
39093
  return generateUtilityClass('MuiSelect', slot);
39073
39094
  }
39074
- const selectClasses = generateUtilityClasses('MuiSelect', ['select', 'multiple', 'filled', 'outlined', 'standard', 'disabled', 'focused', 'icon', 'iconOpen', 'iconFilled', 'iconOutlined', 'iconStandard', 'nativeInput']);
39095
+ const selectClasses = generateUtilityClasses('MuiSelect', ['select', 'multiple', 'filled', 'outlined', 'standard', 'disabled', 'focused', 'icon', 'iconOpen', 'iconFilled', 'iconOutlined', 'iconStandard', 'nativeInput', 'error']);
39075
39096
  var selectClasses$1 = selectClasses;
39076
39097
 
39077
39098
  var _span;
39078
- const _excluded$D = ["aria-describedby", "aria-label", "autoFocus", "autoWidth", "children", "className", "defaultOpen", "defaultValue", "disabled", "displayEmpty", "IconComponent", "inputRef", "labelId", "MenuProps", "multiple", "name", "onBlur", "onChange", "onClose", "onFocus", "onOpen", "open", "readOnly", "renderValue", "SelectDisplayProps", "tabIndex", "type", "value", "variant"];
39099
+ const _excluded$D = ["aria-describedby", "aria-label", "autoFocus", "autoWidth", "children", "className", "defaultOpen", "defaultValue", "disabled", "displayEmpty", "error", "IconComponent", "inputRef", "labelId", "MenuProps", "multiple", "name", "onBlur", "onChange", "onClose", "onFocus", "onOpen", "open", "readOnly", "renderValue", "SelectDisplayProps", "tabIndex", "type", "value", "variant"];
39079
39100
  const SelectSelect = styled$1('div', {
39080
39101
  name: 'MuiSelect',
39081
39102
  slot: 'Select',
@@ -39089,6 +39110,8 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
39089
39110
  [`&.${selectClasses$1.select}`]: styles.select
39090
39111
  }, {
39091
39112
  [`&.${selectClasses$1.select}`]: styles[ownerState.variant]
39113
+ }, {
39114
+ [`&.${selectClasses$1.error}`]: styles.error
39092
39115
  }, {
39093
39116
  [`&.${selectClasses$1.multiple}`]: styles.multiple
39094
39117
  }];
@@ -39146,10 +39169,11 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
39146
39169
  variant,
39147
39170
  disabled,
39148
39171
  multiple,
39149
- open
39172
+ open,
39173
+ error
39150
39174
  } = ownerState;
39151
39175
  const slots = {
39152
- select: ['select', variant, disabled && 'disabled', multiple && 'multiple'],
39176
+ select: ['select', variant, disabled && 'disabled', multiple && 'multiple', error && 'error'],
39153
39177
  icon: ['icon', `icon${capitalize(variant)}`, open && 'iconOpen', disabled && 'disabled'],
39154
39178
  nativeInput: ['nativeInput']
39155
39179
  };
@@ -39171,6 +39195,7 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
39171
39195
  defaultValue,
39172
39196
  disabled,
39173
39197
  displayEmpty,
39198
+ error = false,
39174
39199
  IconComponent,
39175
39200
  inputRef: inputRefProp,
39176
39201
  labelId,
@@ -39476,7 +39501,8 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
39476
39501
  const ownerState = _extends({}, props, {
39477
39502
  variant,
39478
39503
  value,
39479
- open
39504
+ open,
39505
+ error
39480
39506
  });
39481
39507
  const classes = useUtilityClasses$x(ownerState);
39482
39508
  return /*#__PURE__*/jsxRuntime_2(React__namespace.Fragment, {
@@ -39506,6 +39532,7 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
39506
39532
  children: "\u200B"
39507
39533
  })) : display
39508
39534
  })), /*#__PURE__*/jsxRuntime_1(SelectNativeInput, _extends({
39535
+ "aria-invalid": error,
39509
39536
  value: Array.isArray(value) ? value.join(',') : value,
39510
39537
  name: name,
39511
39538
  ref: inputRef,
@@ -39597,6 +39624,10 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
39597
39624
  * If `true`, the selected item is displayed even if its value is empty.
39598
39625
  */
39599
39626
  displayEmpty: PropTypes.bool,
39627
+ /**
39628
+ * If `true`, the `select input` will indicate an error.
39629
+ */
39630
+ error: PropTypes.bool,
39600
39631
  /**
39601
39632
  * The icon that displays the arrow.
39602
39633
  */
@@ -39691,7 +39722,6 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
39691
39722
  } ;
39692
39723
  var SelectInput$1 = SelectInput;
39693
39724
 
39694
- var _StyledInput, _StyledFilledInput;
39695
39725
  const _excluded$C = ["autoWidth", "children", "classes", "className", "defaultOpen", "displayEmpty", "IconComponent", "id", "input", "inputProps", "label", "labelId", "MenuProps", "multiple", "native", "onClose", "onOpen", "open", "renderValue", "SelectDisplayProps", "variant"];
39696
39726
  const useUtilityClasses$w = ownerState => {
39697
39727
  const {
@@ -39742,21 +39772,26 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
39742
39772
  const fcs = formControlState({
39743
39773
  props,
39744
39774
  muiFormControl,
39745
- states: ['variant']
39775
+ states: ['variant', 'error']
39746
39776
  });
39747
39777
  const variant = fcs.variant || variantProp;
39748
- const InputComponent = input || {
39749
- standard: _StyledInput || (_StyledInput = /*#__PURE__*/jsxRuntime_1(StyledInput, {})),
39750
- outlined: /*#__PURE__*/jsxRuntime_1(StyledOutlinedInput, {
39751
- label: label
39752
- }),
39753
- filled: _StyledFilledInput || (_StyledFilledInput = /*#__PURE__*/jsxRuntime_1(StyledFilledInput, {}))
39754
- }[variant];
39755
39778
  const ownerState = _extends({}, props, {
39756
39779
  variant,
39757
39780
  classes: classesProp
39758
39781
  });
39759
39782
  const classes = useUtilityClasses$w(ownerState);
39783
+ const InputComponent = input || {
39784
+ standard: /*#__PURE__*/jsxRuntime_1(StyledInput, {
39785
+ ownerState: ownerState
39786
+ }),
39787
+ outlined: /*#__PURE__*/jsxRuntime_1(StyledOutlinedInput, {
39788
+ label: label,
39789
+ ownerState: ownerState
39790
+ }),
39791
+ filled: /*#__PURE__*/jsxRuntime_1(StyledFilledInput, {
39792
+ ownerState: ownerState
39793
+ })
39794
+ }[variant];
39760
39795
  const inputComponentRef = useForkRef(ref, InputComponent.ref);
39761
39796
  return /*#__PURE__*/jsxRuntime_1(React__namespace.Fragment, {
39762
39797
  children: /*#__PURE__*/React__namespace.cloneElement(InputComponent, _extends({
@@ -39765,6 +39800,7 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
39765
39800
  inputComponent,
39766
39801
  inputProps: _extends({
39767
39802
  children,
39803
+ error: fcs.error,
39768
39804
  IconComponent,
39769
39805
  variant,
39770
39806
  type: undefined,
@@ -40470,7 +40506,7 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
40470
40506
  ownerState
40471
40507
  }) => _extends({
40472
40508
  [`&.${sliderClasses$1.valueLabelOpen}`]: {
40473
- transform: 'translateY(-100%) scale(1)'
40509
+ transform: `${ownerState.orientation === 'vertical' ? 'translateY(-50%)' : 'translateY(-100%)'} scale(1)`
40474
40510
  },
40475
40511
  zIndex: 1,
40476
40512
  whiteSpace: 'nowrap'
@@ -40479,7 +40515,7 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
40479
40515
  transition: theme.transitions.create(['transform'], {
40480
40516
  duration: theme.transitions.duration.shortest
40481
40517
  }),
40482
- transform: 'translateY(-100%) scale(0)',
40518
+ transform: `${ownerState.orientation === 'vertical' ? 'translateY(-50%)' : 'translateY(-100%)'} scale(0)`,
40483
40519
  position: 'absolute',
40484
40520
  backgroundColor: (theme.vars || theme).palette.grey[600],
40485
40521
  borderRadius: 2,
@@ -40502,18 +40538,18 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
40502
40538
  left: '50%'
40503
40539
  }
40504
40540
  }, ownerState.orientation === 'vertical' && {
40505
- right: '30px',
40506
- top: '24px',
40541
+ right: ownerState.size === 'small' ? '20px' : '30px',
40542
+ top: '50%',
40507
40543
  transformOrigin: 'right center',
40508
40544
  '&:before': {
40509
40545
  position: 'absolute',
40510
40546
  content: '""',
40511
40547
  width: 8,
40512
40548
  height: 8,
40513
- transform: 'translate(-50%, 50%) rotate(45deg)',
40549
+ transform: 'translate(-50%, -50%) rotate(45deg)',
40514
40550
  backgroundColor: 'inherit',
40515
40551
  right: '-20%',
40516
- top: '25%'
40552
+ top: '50%'
40517
40553
  }
40518
40554
  }, ownerState.size === 'small' && {
40519
40555
  fontSize: theme.typography.pxToRem(12),