@mui/material 5.11.15 → 5.12.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 (115) hide show
  1. package/Autocomplete/Autocomplete.js +9 -1
  2. package/Badge/badgeClasses.d.ts +18 -18
  3. package/Box/Box.js +2 -0
  4. package/CHANGELOG.md +139 -26
  5. package/CardActionArea/CardActionArea.js +2 -0
  6. package/GlobalStyles/GlobalStyles.js +4 -4
  7. package/Menu/Menu.js +1 -1
  8. package/NativeSelect/NativeSelectInput.d.ts +1 -0
  9. package/NativeSelect/NativeSelectInput.js +12 -5
  10. package/NativeSelect/nativeSelectClasses.d.ts +2 -0
  11. package/NativeSelect/nativeSelectClasses.js +1 -1
  12. package/OverridableComponent.d.ts +1 -1
  13. package/PaginationItem/paginationItemClasses.d.ts +2 -2
  14. package/Popper/Popper.js +0 -4
  15. package/README.md +5 -5
  16. package/Select/Select.d.ts +1 -1
  17. package/Select/Select.js +15 -10
  18. package/Select/SelectInput.d.ts +1 -0
  19. package/Select/SelectInput.js +14 -4
  20. package/Select/selectClasses.d.ts +2 -0
  21. package/Select/selectClasses.js +1 -1
  22. package/Slider/Slider.js +6 -6
  23. package/Slider/sliderClasses.d.ts +22 -22
  24. package/Tabs/Tabs.js +1 -1
  25. package/Toolbar/Toolbar.d.ts +1 -1
  26. package/Toolbar/Toolbar.js +1 -1
  27. package/Unstable_Grid2/Grid2.js +1 -0
  28. package/darkScrollbar/index.js +1 -1
  29. package/index.js +1 -1
  30. package/legacy/Autocomplete/Autocomplete.js +8 -3
  31. package/legacy/Box/Box.js +2 -0
  32. package/legacy/CardActionArea/CardActionArea.js +2 -0
  33. package/legacy/GlobalStyles/GlobalStyles.js +4 -4
  34. package/legacy/Menu/Menu.js +1 -1
  35. package/legacy/NativeSelect/NativeSelectInput.js +12 -5
  36. package/legacy/NativeSelect/nativeSelectClasses.js +1 -1
  37. package/legacy/Popper/Popper.js +0 -4
  38. package/legacy/Select/Select.js +15 -10
  39. package/legacy/Select/SelectInput.js +14 -5
  40. package/legacy/Select/selectClasses.js +1 -1
  41. package/legacy/Slider/Slider.js +6 -6
  42. package/legacy/Tabs/Tabs.js +1 -1
  43. package/legacy/Toolbar/Toolbar.js +1 -1
  44. package/legacy/Unstable_Grid2/Grid2.js +1 -0
  45. package/legacy/darkScrollbar/index.js +1 -1
  46. package/legacy/index.js +1 -1
  47. package/legacy/styles/CssVarsProvider.js +2 -0
  48. package/legacy/styles/ThemeProvider.js +19 -1
  49. package/legacy/styles/identifier.js +1 -0
  50. package/legacy/styles/index.js +1 -0
  51. package/legacy/styles/styled.js +2 -0
  52. package/legacy/styles/useTheme.js +2 -1
  53. package/legacy/styles/useThemeProps.js +3 -1
  54. package/modern/Autocomplete/Autocomplete.js +9 -1
  55. package/modern/Box/Box.js +2 -0
  56. package/modern/CardActionArea/CardActionArea.js +2 -0
  57. package/modern/GlobalStyles/GlobalStyles.js +4 -4
  58. package/modern/Menu/Menu.js +1 -1
  59. package/modern/NativeSelect/NativeSelectInput.js +12 -5
  60. package/modern/NativeSelect/nativeSelectClasses.js +1 -1
  61. package/modern/Popper/Popper.js +0 -4
  62. package/modern/Select/Select.js +15 -10
  63. package/modern/Select/SelectInput.js +14 -4
  64. package/modern/Select/selectClasses.js +1 -1
  65. package/modern/Slider/Slider.js +6 -6
  66. package/modern/Tabs/Tabs.js +1 -1
  67. package/modern/Toolbar/Toolbar.js +1 -1
  68. package/modern/Unstable_Grid2/Grid2.js +1 -0
  69. package/modern/darkScrollbar/index.js +1 -1
  70. package/modern/index.js +1 -1
  71. package/modern/styles/CssVarsProvider.js +2 -0
  72. package/modern/styles/ThemeProvider.js +22 -1
  73. package/modern/styles/identifier.js +1 -0
  74. package/modern/styles/index.js +1 -0
  75. package/modern/styles/styled.js +2 -0
  76. package/modern/styles/useTheme.js +2 -1
  77. package/modern/styles/useThemeProps.js +3 -1
  78. package/node/Autocomplete/Autocomplete.js +9 -1
  79. package/node/Box/Box.js +2 -0
  80. package/node/CardActionArea/CardActionArea.js +2 -0
  81. package/node/GlobalStyles/GlobalStyles.js +4 -4
  82. package/node/Menu/Menu.js +1 -1
  83. package/node/NativeSelect/NativeSelectInput.js +12 -5
  84. package/node/NativeSelect/nativeSelectClasses.js +1 -1
  85. package/node/Popper/Popper.js +0 -4
  86. package/node/Select/Select.js +15 -10
  87. package/node/Select/SelectInput.js +14 -4
  88. package/node/Select/selectClasses.js +1 -1
  89. package/node/Slider/Slider.js +6 -6
  90. package/node/Tabs/Tabs.js +1 -1
  91. package/node/Toolbar/Toolbar.js +1 -1
  92. package/node/Unstable_Grid2/Grid2.js +1 -0
  93. package/node/darkScrollbar/index.js +1 -1
  94. package/node/index.js +1 -1
  95. package/node/styles/CssVarsProvider.js +2 -0
  96. package/node/styles/ThemeProvider.js +26 -7
  97. package/node/styles/identifier.js +8 -0
  98. package/node/styles/index.js +8 -0
  99. package/node/styles/styled.js +2 -0
  100. package/node/styles/useTheme.js +2 -1
  101. package/node/styles/useThemeProps.js +3 -1
  102. package/package.json +7 -7
  103. package/styles/CssVarsProvider.d.ts +5 -0
  104. package/styles/CssVarsProvider.js +2 -0
  105. package/styles/ThemeProvider.js +22 -1
  106. package/styles/experimental_extendTheme.d.ts +1 -1
  107. package/styles/identifier.d.ts +2 -0
  108. package/styles/identifier.js +1 -0
  109. package/styles/index.d.ts +1 -0
  110. package/styles/index.js +1 -0
  111. package/styles/styled.js +2 -0
  112. package/styles/useTheme.js +2 -1
  113. package/styles/useThemeProps.js +3 -1
  114. package/umd/material-ui.development.js +660 -533
  115. package/umd/material-ui.production.min.js +21 -21
package/README.md CHANGED
@@ -11,7 +11,7 @@
11
11
 
12
12
  - [_Joy UI_](https://mui.com/joy-ui/getting-started/overview/) is a beautifully designed library of React UI components.
13
13
 
14
- - [_MUI Base_](https://mui.com/base/getting-started/overview/) is our library of "unstyled" components and low-level hooks. With Base, you gain complete control over your app's CSS and accessibility features.
14
+ - [_Base UI_](https://mui.com/base/getting-started/overview/) is our library of "unstyled" components and low-level hooks. With Base, you gain complete control over your app's CSS and accessibility features.
15
15
 
16
16
  - [_MUI System_](https://mui.com/system/getting-started/overview/) is a collection of CSS utilities to help you rapidly lay out custom designs.
17
17
 
@@ -63,9 +63,9 @@ yarn add @mui/material @emotion/react @emotion/styled
63
63
  **Note:** `@next` only points to pre-releases.
64
64
  Use `@latest` for the latest stable release.
65
65
 
66
- ### MUI Base
66
+ ### Base UI
67
67
 
68
- MUI Base is available as an [npm package](https://www.npmjs.com/package/@mui/base).
68
+ Base UI is available as an [npm package](https://www.npmjs.com/package/@mui/base).
69
69
 
70
70
  **npm:**
71
71
 
@@ -79,7 +79,7 @@ npm install @mui/base
79
79
  yarn add @mui/base
80
80
  ```
81
81
 
82
- **Note**: MUI Base is still in alpha.
82
+ **Note**: Base UI is still in alpha.
83
83
  We are adding new components regularly and you're welcome to contribute!
84
84
 
85
85
  ### MUI System
@@ -180,7 +180,7 @@ Our documentation features [a collection of example projects using Material UI](
180
180
 
181
181
  - [Material UI](https://mui.com/material-ui/getting-started/overview/)
182
182
  - [Joy UI](https://mui.com/joy-ui/getting-started/overview/)
183
- - [MUI Base](https://mui.com/base/getting-started/overview/)
183
+ - [Base UI](https://mui.com/base/getting-started/overview/)
184
184
  - [MUI System](https://mui.com/system/getting-started/overview/)
185
185
 
186
186
  ## Premium themes
@@ -104,7 +104,7 @@ export interface SelectProps<T = unknown>
104
104
  onChange?: SelectInputProps<T>['onChange'];
105
105
  /**
106
106
  * Callback fired when the component requests to be closed.
107
- * Use it in either controlled (see the `open` prop), or uncontrolled mode (to detect when the Select collapes).
107
+ * Use it in either controlled (see the `open` prop), or uncontrolled mode (to detect when the Select collapses).
108
108
  *
109
109
  * @param {object} event The event source of the callback.
110
110
  */
package/Select/Select.js CHANGED
@@ -1,6 +1,5 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
- var _StyledInput, _StyledFilledInput;
4
3
  const _excluded = ["autoWidth", "children", "classes", "className", "defaultOpen", "displayEmpty", "IconComponent", "id", "input", "inputProps", "label", "labelId", "MenuProps", "multiple", "native", "onClose", "onOpen", "open", "renderValue", "SelectDisplayProps", "variant"];
5
4
  import * as React from 'react';
6
5
  import PropTypes from 'prop-types';
@@ -67,21 +66,26 @@ const Select = /*#__PURE__*/React.forwardRef(function Select(inProps, ref) {
67
66
  const fcs = formControlState({
68
67
  props,
69
68
  muiFormControl,
70
- states: ['variant']
69
+ states: ['variant', 'error']
71
70
  });
72
71
  const variant = fcs.variant || variantProp;
73
- const InputComponent = input || {
74
- standard: _StyledInput || (_StyledInput = /*#__PURE__*/_jsx(StyledInput, {})),
75
- outlined: /*#__PURE__*/_jsx(StyledOutlinedInput, {
76
- label: label
77
- }),
78
- filled: _StyledFilledInput || (_StyledFilledInput = /*#__PURE__*/_jsx(StyledFilledInput, {}))
79
- }[variant];
80
72
  const ownerState = _extends({}, props, {
81
73
  variant,
82
74
  classes: classesProp
83
75
  });
84
76
  const classes = useUtilityClasses(ownerState);
77
+ const InputComponent = input || {
78
+ standard: /*#__PURE__*/_jsx(StyledInput, {
79
+ ownerState: ownerState
80
+ }),
81
+ outlined: /*#__PURE__*/_jsx(StyledOutlinedInput, {
82
+ label: label,
83
+ ownerState: ownerState
84
+ }),
85
+ filled: /*#__PURE__*/_jsx(StyledFilledInput, {
86
+ ownerState: ownerState
87
+ })
88
+ }[variant];
85
89
  const inputComponentRef = useForkRef(ref, InputComponent.ref);
86
90
  return /*#__PURE__*/_jsx(React.Fragment, {
87
91
  children: /*#__PURE__*/React.cloneElement(InputComponent, _extends({
@@ -90,6 +94,7 @@ const Select = /*#__PURE__*/React.forwardRef(function Select(inProps, ref) {
90
94
  inputComponent,
91
95
  inputProps: _extends({
92
96
  children,
97
+ error: fcs.error,
93
98
  IconComponent,
94
99
  variant,
95
100
  type: undefined,
@@ -223,7 +228,7 @@ process.env.NODE_ENV !== "production" ? Select.propTypes /* remove-proptypes */
223
228
  onChange: PropTypes.func,
224
229
  /**
225
230
  * Callback fired when the component requests to be closed.
226
- * Use it in either controlled (see the `open` prop), or uncontrolled mode (to detect when the Select collapes).
231
+ * Use it in either controlled (see the `open` prop), or uncontrolled mode (to detect when the Select collapses).
227
232
  *
228
233
  * @param {object} event The event source of the callback.
229
234
  */
@@ -17,6 +17,7 @@ export interface SelectInputProps<T = unknown> {
17
17
  autoWidth: boolean;
18
18
  defaultOpen?: boolean;
19
19
  disabled?: boolean;
20
+ error?: boolean;
20
21
  IconComponent?: React.ElementType;
21
22
  inputRef?: (
22
23
  ref: HTMLSelectElement | { node: HTMLInputElement; value: SelectInputProps<T>['value'] },
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
3
  import { formatMuiErrorMessage as _formatMuiErrorMessage } from "@mui/utils";
4
4
  var _span;
5
- 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"];
5
+ 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"];
6
6
  import * as React from 'react';
7
7
  import { isFragment } from 'react-is';
8
8
  import PropTypes from 'prop-types';
@@ -33,6 +33,8 @@ const SelectSelect = styled('div', {
33
33
  [`&.${selectClasses.select}`]: styles.select
34
34
  }, {
35
35
  [`&.${selectClasses.select}`]: styles[ownerState.variant]
36
+ }, {
37
+ [`&.${selectClasses.error}`]: styles.error
36
38
  }, {
37
39
  [`&.${selectClasses.multiple}`]: styles.multiple
38
40
  }];
@@ -90,10 +92,11 @@ const useUtilityClasses = ownerState => {
90
92
  variant,
91
93
  disabled,
92
94
  multiple,
93
- open
95
+ open,
96
+ error
94
97
  } = ownerState;
95
98
  const slots = {
96
- select: ['select', variant, disabled && 'disabled', multiple && 'multiple'],
99
+ select: ['select', variant, disabled && 'disabled', multiple && 'multiple', error && 'error'],
97
100
  icon: ['icon', `icon${capitalize(variant)}`, open && 'iconOpen', disabled && 'disabled'],
98
101
  nativeInput: ['nativeInput']
99
102
  };
@@ -115,6 +118,7 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
115
118
  defaultValue,
116
119
  disabled,
117
120
  displayEmpty,
121
+ error = false,
118
122
  IconComponent,
119
123
  inputRef: inputRefProp,
120
124
  labelId,
@@ -420,7 +424,8 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
420
424
  const ownerState = _extends({}, props, {
421
425
  variant,
422
426
  value,
423
- open
427
+ open,
428
+ error
424
429
  });
425
430
  const classes = useUtilityClasses(ownerState);
426
431
  return /*#__PURE__*/_jsxs(React.Fragment, {
@@ -450,6 +455,7 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
450
455
  children: "\u200B"
451
456
  })) : display
452
457
  })), /*#__PURE__*/_jsx(SelectNativeInput, _extends({
458
+ "aria-invalid": error,
453
459
  value: Array.isArray(value) ? value.join(',') : value,
454
460
  name: name,
455
461
  ref: inputRef,
@@ -541,6 +547,10 @@ process.env.NODE_ENV !== "production" ? SelectInput.propTypes = {
541
547
  * If `true`, the selected item is displayed even if its value is empty.
542
548
  */
543
549
  displayEmpty: PropTypes.bool,
550
+ /**
551
+ * If `true`, the `select input` will indicate an error.
552
+ */
553
+ error: PropTypes.bool,
544
554
  /**
545
555
  * The icon that displays the arrow.
546
556
  */
@@ -23,6 +23,8 @@ export interface SelectClasses {
23
23
  iconStandard: string;
24
24
  /** Styles applied to the underlying native input component. */
25
25
  nativeInput: string;
26
+ /** State class applied to the root element if `error={true}`. */
27
+ error: string;
26
28
  }
27
29
  export type SelectClassKey = keyof SelectClasses;
28
30
  export declare function getSelectUtilityClasses(slot: string): string;
@@ -3,5 +3,5 @@ import generateUtilityClass from '../generateUtilityClass';
3
3
  export function getSelectUtilityClasses(slot) {
4
4
  return generateUtilityClass('MuiSelect', slot);
5
5
  }
6
- const selectClasses = generateUtilityClasses('MuiSelect', ['select', 'multiple', 'filled', 'outlined', 'standard', 'disabled', 'focused', 'icon', 'iconOpen', 'iconFilled', 'iconOutlined', 'iconStandard', 'nativeInput']);
6
+ const selectClasses = generateUtilityClasses('MuiSelect', ['select', 'multiple', 'filled', 'outlined', 'standard', 'disabled', 'focused', 'icon', 'iconOpen', 'iconFilled', 'iconOutlined', 'iconStandard', 'nativeInput', 'error']);
7
7
  export default selectClasses;
package/Slider/Slider.js CHANGED
@@ -269,7 +269,7 @@ const StyledSliderValueLabel = styled(SliderValueLabel, {
269
269
  ownerState
270
270
  }) => _extends({
271
271
  [`&.${sliderClasses.valueLabelOpen}`]: {
272
- transform: 'translateY(-100%) scale(1)'
272
+ transform: `${ownerState.orientation === 'vertical' ? 'translateY(-50%)' : 'translateY(-100%)'} scale(1)`
273
273
  },
274
274
  zIndex: 1,
275
275
  whiteSpace: 'nowrap'
@@ -278,7 +278,7 @@ const StyledSliderValueLabel = styled(SliderValueLabel, {
278
278
  transition: theme.transitions.create(['transform'], {
279
279
  duration: theme.transitions.duration.shortest
280
280
  }),
281
- transform: 'translateY(-100%) scale(0)',
281
+ transform: `${ownerState.orientation === 'vertical' ? 'translateY(-50%)' : 'translateY(-100%)'} scale(0)`,
282
282
  position: 'absolute',
283
283
  backgroundColor: (theme.vars || theme).palette.grey[600],
284
284
  borderRadius: 2,
@@ -301,18 +301,18 @@ const StyledSliderValueLabel = styled(SliderValueLabel, {
301
301
  left: '50%'
302
302
  }
303
303
  }, ownerState.orientation === 'vertical' && {
304
- right: '30px',
305
- top: '24px',
304
+ right: ownerState.size === 'small' ? '20px' : '30px',
305
+ top: '50%',
306
306
  transformOrigin: 'right center',
307
307
  '&:before': {
308
308
  position: 'absolute',
309
309
  content: '""',
310
310
  width: 8,
311
311
  height: 8,
312
- transform: 'translate(-50%, 50%) rotate(45deg)',
312
+ transform: 'translate(-50%, -50%) rotate(45deg)',
313
313
  backgroundColor: 'inherit',
314
314
  right: '-20%',
315
- top: '25%'
315
+ top: '50%'
316
316
  }
317
317
  }, ownerState.size === 'small' && {
318
318
  fontSize: theme.typography.pxToRem(12),
@@ -1,55 +1,55 @@
1
1
  export interface SliderClasses {
2
- /** Class name applied to the root element. */
2
+ /** Styles applied to the root element. */
3
3
  root: string;
4
- /** Class name applied to the root element if `color="primary"`. */
4
+ /** Styles applied to the root element if `color="primary"`. */
5
5
  colorPrimary: string;
6
- /** Class name applied to the root element if `color="secondary"`. */
6
+ /** Styles applied to the root element if `color="secondary"`. */
7
7
  colorSecondary: string;
8
- /** Class name applied to the root element if `marks` is provided with at least one label. */
8
+ /** Styles applied to the root element if `marks` is provided with at least one label. */
9
9
  marked: string;
10
- /** Class name applied to the root element if `orientation="vertical"`. */
10
+ /** Styles applied to the root element if `orientation="vertical"`. */
11
11
  vertical: string;
12
12
  /** State class applied to the root and thumb element if `disabled={true}`. */
13
13
  disabled: string;
14
14
  /** State class applied to the root if a thumb is being dragged. */
15
15
  dragging: string;
16
- /** Class name applied to the rail element. */
16
+ /** Styles applied to the rail element. */
17
17
  rail: string;
18
- /** Class name applied to the track element. */
18
+ /** Styles applied to the track element. */
19
19
  track: string;
20
- /** Class name applied to the root element if `track={false}`. */
20
+ /** Styles applied to the root element if `track={false}`. */
21
21
  trackFalse: string;
22
- /** Class name applied to the root element if `track="inverted"`. */
22
+ /** Styles applied to the root element if `track="inverted"`. */
23
23
  trackInverted: string;
24
- /** Class name applied to the thumb element. */
24
+ /** Styles applied to the thumb element. */
25
25
  thumb: string;
26
26
  /** State class applied to the thumb element if it's active. */
27
27
  active: string;
28
28
  /** State class applied to the thumb element if keyboard focused. */
29
29
  focusVisible: string;
30
- /** Class name applied to the mark element. */
30
+ /** Styles applied to the mark element. */
31
31
  mark: string;
32
- /** Class name applied to the mark element if active (depending on the value). */
32
+ /** Styles applied to the mark element if active (depending on the value). */
33
33
  markActive: string;
34
- /** Class name applied to the mark label element. */
34
+ /** Styles applied to the mark label element. */
35
35
  markLabel: string;
36
- /** Class name applied to the mark label element if active (depending on the value). */
36
+ /** Styles applied to the mark label element if active (depending on the value). */
37
37
  markLabelActive: string;
38
- /** Class name applied to the root element if `size="small"`. */
38
+ /** Styles applied to the root element if `size="small"`. */
39
39
  sizeSmall: string;
40
- /** Class name applied to the thumb element if `color="primary"`. */
40
+ /** Styles applied to the thumb element if `color="primary"`. */
41
41
  thumbColorPrimary: string;
42
- /** Class name applied to the thumb element if `color="secondary"`. */
42
+ /** Styles applied to the thumb element if `color="secondary"`. */
43
43
  thumbColorSecondary: string;
44
- /** Class name applied to the thumb element if `size="small"`. */
44
+ /** Styles applied to the thumb element if `size="small"`. */
45
45
  thumbSizeSmall: string;
46
- /** Class name applied to the thumb label element. */
46
+ /** Styles applied to the thumb label element. */
47
47
  valueLabel: string;
48
- /** Class name applied to the thumb label element if it's open. */
48
+ /** Styles applied to the thumb label element if it's open. */
49
49
  valueLabelOpen: string;
50
- /** Class name applied to the thumb label's circle element. */
50
+ /** Styles applied to the thumb label's circle element. */
51
51
  valueLabelCircle: string;
52
- /** Class name applied to the thumb label's label element. */
52
+ /** Styles applied to the thumb label's label element. */
53
53
  valueLabelLabel: string;
54
54
  }
55
55
  export type SliderClassKey = keyof SliderClasses;
package/Tabs/Tabs.js CHANGED
@@ -418,7 +418,7 @@ const Tabs = /*#__PURE__*/React.forwardRef(function Tabs(inProps, ref) {
418
418
  moveTabsScroll(getScrollSize());
419
419
  };
420
420
 
421
- // TODO Remove <ScrollbarSize /> as browser support for hidding the scrollbar
421
+ // TODO Remove <ScrollbarSize /> as browser support for hiding the scrollbar
422
422
  // with CSS improves.
423
423
  const handleScrollbarSizeChange = React.useCallback(scrollbarWidth => {
424
424
  setScrollerStyle({
@@ -11,7 +11,7 @@ export interface ToolbarTypeMap<P = {}, D extends React.ElementType = 'div'> {
11
11
  props: P & {
12
12
  /**
13
13
  * The Toolbar children, usually a mixture of `IconButton`, `Button` and `Typography`.
14
- * The Toolbar is a flex container, allowing flex item properites to be used to lay out the children.
14
+ * The Toolbar is a flex container, allowing flex item properties to be used to lay out the children.
15
15
  */
16
16
  children?: React.ReactNode;
17
17
  /**
@@ -81,7 +81,7 @@ process.env.NODE_ENV !== "production" ? Toolbar.propTypes /* remove-proptypes */
81
81
  // ----------------------------------------------------------------------
82
82
  /**
83
83
  * The Toolbar children, usually a mixture of `IconButton`, `Button` and `Typography`.
84
- * The Toolbar is a flex container, allowing flex item properites to be used to lay out the children.
84
+ * The Toolbar is a flex container, allowing flex item properties to be used to lay out the children.
85
85
  */
86
86
  children: PropTypes.node,
87
87
  /**
@@ -4,6 +4,7 @@ import { styled, useThemeProps } from '../styles';
4
4
  const Grid2 = createGrid2({
5
5
  createStyledComponent: styled('div', {
6
6
  name: 'MuiGrid2',
7
+ slot: 'Root',
7
8
  overridesResolver: (props, styles) => styles.root
8
9
  }),
9
10
  componentName: 'MuiGrid2',
@@ -1,4 +1,4 @@
1
- // track, thumb and active are derieved from macOS 10.15.7
1
+ // track, thumb and active are derived from macOS 10.15.7
2
2
  const scrollBar = {
3
3
  track: '#2b2b2b',
4
4
  thumb: '#6b6b6b',
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/material v5.11.15
2
+ * @mui/material v5.12.0
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -465,8 +465,8 @@ var Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps,
465
465
  groupedOptions = _useAutocomplete.groupedOptions;
466
466
  var hasClearIcon = !disableClearable && !disabled && dirty && !readOnly;
467
467
  var hasPopupIcon = (!freeSolo || forcePopupIcon === true) && forcePopupIcon !== false;
468
-
469
- // If you modify this, make sure to keep the `AutocompleteOwnerState` type in sync.
468
+ var _getInputProps = getInputProps(),
469
+ handleInputMouseDown = _getInputProps.onMouseDown; // If you modify this, make sure to keep the `AutocompleteOwnerState` type in sync.
470
470
  var ownerState = _extends({}, props, {
471
471
  disablePortal: disablePortal,
472
472
  expanded: expanded,
@@ -563,7 +563,12 @@ var Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps,
563
563
  InputProps: _extends({
564
564
  ref: setAnchorEl,
565
565
  className: classes.inputRoot,
566
- startAdornment: startAdornment
566
+ startAdornment: startAdornment,
567
+ onClick: function onClick(event) {
568
+ if (event.target === event.currentTarget) {
569
+ handleInputMouseDown(event);
570
+ }
571
+ }
567
572
  }, (hasClearIcon || hasPopupIcon) && {
568
573
  endAdornment: /*#__PURE__*/_jsxs(AutocompleteEndAdornment, {
569
574
  className: classes.endAdornment,
package/legacy/Box/Box.js CHANGED
@@ -2,8 +2,10 @@ import { createBox } from '@mui/system';
2
2
  import PropTypes from 'prop-types';
3
3
  import { unstable_ClassNameGenerator as ClassNameGenerator } from '../className';
4
4
  import { createTheme } from '../styles';
5
+ import THEME_ID from '../styles/identifier';
5
6
  var defaultTheme = createTheme();
6
7
  var Box = createBox({
8
+ themeId: THEME_ID,
7
9
  defaultTheme: defaultTheme,
8
10
  defaultClassName: 'MuiBox-root',
9
11
  generateClassName: ClassNameGenerator.generate
@@ -31,6 +31,8 @@ var CardActionAreaRoot = styled(ButtonBase, {
31
31
  return _ref2 = {
32
32
  display: 'block',
33
33
  textAlign: 'inherit',
34
+ borderRadius: 'inherit',
35
+ // for Safari to work https://github.com/mui/material-ui/issues/36285.
34
36
  width: '100%'
35
37
  }, _defineProperty(_ref2, "&:hover .".concat(cardActionAreaClasses.focusHighlight), {
36
38
  opacity: (theme.vars || theme).palette.action.hoverOpacity,
@@ -3,10 +3,12 @@ import * as React from 'react';
3
3
  import PropTypes from 'prop-types';
4
4
  import { GlobalStyles as SystemGlobalStyles } from '@mui/system';
5
5
  import defaultTheme from '../styles/defaultTheme';
6
+ import THEME_ID from '../styles/identifier';
6
7
  import { jsx as _jsx } from "react/jsx-runtime";
7
8
  function GlobalStyles(props) {
8
9
  return /*#__PURE__*/_jsx(SystemGlobalStyles, _extends({}, props, {
9
- defaultTheme: defaultTheme
10
+ defaultTheme: defaultTheme,
11
+ themeId: THEME_ID
10
12
  }));
11
13
  }
12
14
  process.env.NODE_ENV !== "production" ? GlobalStyles.propTypes /* remove-proptypes */ = {
@@ -17,8 +19,6 @@ process.env.NODE_ENV !== "production" ? GlobalStyles.propTypes /* remove-proptyp
17
19
  /**
18
20
  * The styles you want to apply globally.
19
21
  */
20
- styles: PropTypes.oneOfType([PropTypes.func, PropTypes.number, PropTypes.object, PropTypes.shape({
21
- __emotion_styles: PropTypes.any.isRequired
22
- }), PropTypes.string, PropTypes.bool])
22
+ styles: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.array, PropTypes.func, PropTypes.number, PropTypes.object, PropTypes.string, PropTypes.bool])
23
23
  } : void 0;
24
24
  export default GlobalStyles;
@@ -49,7 +49,7 @@ var MenuPaper = styled(Paper, {
49
49
  }
50
50
  })({
51
51
  // specZ: The maximum height of a simple menu should be one or more rows less than the view
52
- // height. This ensures a tapable area outside of the simple menu with which to dismiss
52
+ // height. This ensures a tappable area outside of the simple menu with which to dismiss
53
53
  // the menu.
54
54
  maxHeight: 'calc(100% - 96px)',
55
55
  // Add iOS momentum scrolling for iOS < 13.0
@@ -16,9 +16,10 @@ var useUtilityClasses = function useUtilityClasses(ownerState) {
16
16
  variant = ownerState.variant,
17
17
  disabled = ownerState.disabled,
18
18
  multiple = ownerState.multiple,
19
- open = ownerState.open;
19
+ open = ownerState.open,
20
+ error = ownerState.error;
20
21
  var slots = {
21
- select: ['select', variant, disabled && 'disabled', multiple && 'multiple'],
22
+ select: ['select', variant, disabled && 'disabled', multiple && 'multiple', error && 'error'],
22
23
  icon: ['icon', "icon".concat(capitalize(variant)), open && 'iconOpen', disabled && 'disabled']
23
24
  };
24
25
  return composeClasses(slots, getNativeSelectUtilityClasses, classes);
@@ -80,7 +81,7 @@ var NativeSelectSelect = styled('select', {
80
81
  shouldForwardProp: rootShouldForwardProp,
81
82
  overridesResolver: function overridesResolver(props, styles) {
82
83
  var ownerState = props.ownerState;
83
- return [styles.select, styles[ownerState.variant], _defineProperty({}, "&.".concat(nativeSelectClasses.multiple), styles.multiple)];
84
+ return [styles.select, styles[ownerState.variant], ownerState.error && styles.error, _defineProperty({}, "&.".concat(nativeSelectClasses.multiple), styles.multiple)];
84
85
  }
85
86
  })(nativeSelectSelectStyles);
86
87
  export var nativeSelectIconStyles = function nativeSelectIconStyles(_ref3) {
@@ -121,14 +122,16 @@ var NativeSelectIcon = styled('svg', {
121
122
  var NativeSelectInput = /*#__PURE__*/React.forwardRef(function NativeSelectInput(props, ref) {
122
123
  var className = props.className,
123
124
  disabled = props.disabled,
125
+ error = props.error,
124
126
  IconComponent = props.IconComponent,
125
127
  inputRef = props.inputRef,
126
128
  _props$variant = props.variant,
127
129
  variant = _props$variant === void 0 ? 'standard' : _props$variant,
128
- other = _objectWithoutProperties(props, ["className", "disabled", "IconComponent", "inputRef", "variant"]);
130
+ other = _objectWithoutProperties(props, ["className", "disabled", "error", "IconComponent", "inputRef", "variant"]);
129
131
  var ownerState = _extends({}, props, {
130
132
  disabled: disabled,
131
- variant: variant
133
+ variant: variant,
134
+ error: error
132
135
  });
133
136
  var classes = useUtilityClasses(ownerState);
134
137
  return /*#__PURE__*/_jsxs(React.Fragment, {
@@ -163,6 +166,10 @@ process.env.NODE_ENV !== "production" ? NativeSelectInput.propTypes = {
163
166
  * If `true`, the select is disabled.
164
167
  */
165
168
  disabled: PropTypes.bool,
169
+ /**
170
+ * If `true`, the `select input` will indicate an error.
171
+ */
172
+ error: PropTypes.bool,
166
173
  /**
167
174
  * The icon that displays the arrow.
168
175
  */
@@ -3,5 +3,5 @@ import generateUtilityClass from '../generateUtilityClass';
3
3
  export function getNativeSelectUtilityClasses(slot) {
4
4
  return generateUtilityClass('MuiNativeSelect', slot);
5
5
  }
6
- var nativeSelectClasses = generateUtilityClasses('MuiNativeSelect', ['root', 'select', 'multiple', 'filled', 'outlined', 'standard', 'disabled', 'icon', 'iconOpen', 'iconFilled', 'iconOutlined', 'iconStandard', 'nativeInput']);
6
+ var nativeSelectClasses = generateUtilityClasses('MuiNativeSelect', ['root', 'select', 'multiple', 'filled', 'outlined', 'standard', 'disabled', 'icon', 'iconOpen', 'iconFilled', 'iconOutlined', 'iconStandard', 'nativeInput', 'error']);
7
7
  export default nativeSelectClasses;
@@ -129,10 +129,6 @@ process.env.NODE_ENV !== "production" ? Popper.propTypes /* remove-proptypes */
129
129
  * If `true`, the component is shown.
130
130
  */
131
131
  open: PropTypes.bool.isRequired,
132
- /**
133
- * @ignore
134
- */
135
- ownerState: PropTypes.any,
136
132
  /**
137
133
  * Popper placement.
138
134
  * @default 'bottom'
@@ -1,6 +1,5 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
- var _StyledInput, _StyledFilledInput;
4
3
  import * as React from 'react';
5
4
  import PropTypes from 'prop-types';
6
5
  import clsx from 'clsx';
@@ -74,21 +73,26 @@ var Select = /*#__PURE__*/React.forwardRef(function Select(inProps, ref) {
74
73
  var fcs = formControlState({
75
74
  props: props,
76
75
  muiFormControl: muiFormControl,
77
- states: ['variant']
76
+ states: ['variant', 'error']
78
77
  });
79
78
  var variant = fcs.variant || variantProp;
80
- var InputComponent = input || {
81
- standard: _StyledInput || (_StyledInput = /*#__PURE__*/_jsx(StyledInput, {})),
82
- outlined: /*#__PURE__*/_jsx(StyledOutlinedInput, {
83
- label: label
84
- }),
85
- filled: _StyledFilledInput || (_StyledFilledInput = /*#__PURE__*/_jsx(StyledFilledInput, {}))
86
- }[variant];
87
79
  var ownerState = _extends({}, props, {
88
80
  variant: variant,
89
81
  classes: classesProp
90
82
  });
91
83
  var classes = useUtilityClasses(ownerState);
84
+ var InputComponent = input || {
85
+ standard: /*#__PURE__*/_jsx(StyledInput, {
86
+ ownerState: ownerState
87
+ }),
88
+ outlined: /*#__PURE__*/_jsx(StyledOutlinedInput, {
89
+ label: label,
90
+ ownerState: ownerState
91
+ }),
92
+ filled: /*#__PURE__*/_jsx(StyledFilledInput, {
93
+ ownerState: ownerState
94
+ })
95
+ }[variant];
92
96
  var inputComponentRef = useForkRef(ref, InputComponent.ref);
93
97
  return /*#__PURE__*/_jsx(React.Fragment, {
94
98
  children: /*#__PURE__*/React.cloneElement(InputComponent, _extends({
@@ -97,6 +101,7 @@ var Select = /*#__PURE__*/React.forwardRef(function Select(inProps, ref) {
97
101
  inputComponent: inputComponent,
98
102
  inputProps: _extends({
99
103
  children: children,
104
+ error: fcs.error,
100
105
  IconComponent: IconComponent,
101
106
  variant: variant,
102
107
  type: undefined,
@@ -230,7 +235,7 @@ process.env.NODE_ENV !== "production" ? Select.propTypes /* remove-proptypes */
230
235
  onChange: PropTypes.func,
231
236
  /**
232
237
  * Callback fired when the component requests to be closed.
233
- * Use it in either controlled (see the `open` prop), or uncontrolled mode (to detect when the Select collapes).
238
+ * Use it in either controlled (see the `open` prop), or uncontrolled mode (to detect when the Select collapses).
234
239
  *
235
240
  * @param {object} event The event source of the callback.
236
241
  */