@mui/material 5.2.5 → 5.3.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 (99) hide show
  1. package/Autocomplete/Autocomplete.d.ts +2 -0
  2. package/Autocomplete/Autocomplete.js +10 -6
  3. package/Avatar/Avatar.d.ts +3 -1
  4. package/Backdrop/Backdrop.js +3 -1
  5. package/Badge/Badge.d.ts +25 -0
  6. package/Badge/Badge.js +31 -15
  7. package/ButtonGroup/ButtonGroupContext.d.ts +1 -1
  8. package/CHANGELOG.md +245 -32
  9. package/FilledInput/FilledInput.js +4 -1
  10. package/FormControlLabel/FormControlLabel.js +3 -1
  11. package/Input/Input.js +4 -1
  12. package/InputBase/InputBase.js +4 -1
  13. package/InputLabel/InputLabel.js +4 -0
  14. package/ListItem/ListItem.js +3 -1
  15. package/Modal/Modal.js +3 -1
  16. package/README.md +19 -24
  17. package/Select/Select.d.ts +9 -1
  18. package/Select/Select.js +10 -1
  19. package/Select/SelectInput.d.ts +1 -0
  20. package/Select/SelectInput.js +25 -4
  21. package/Slider/Slider.d.ts +2 -0
  22. package/Slider/Slider.js +126 -53
  23. package/StepLabel/StepLabel.js +3 -1
  24. package/SvgIcon/SvgIcon.d.ts +8 -0
  25. package/SvgIcon/SvgIcon.js +19 -3
  26. package/TextField/TextField.d.ts +1 -0
  27. package/TextField/TextField.js +1 -0
  28. package/Tooltip/Tooltip.js +6 -1
  29. package/index.js +1 -1
  30. package/legacy/Autocomplete/Autocomplete.js +10 -6
  31. package/legacy/Backdrop/Backdrop.js +3 -1
  32. package/legacy/Badge/Badge.js +36 -16
  33. package/legacy/FilledInput/FilledInput.js +4 -1
  34. package/legacy/FormControlLabel/FormControlLabel.js +3 -1
  35. package/legacy/Input/Input.js +4 -1
  36. package/legacy/InputBase/InputBase.js +4 -1
  37. package/legacy/InputLabel/InputLabel.js +4 -0
  38. package/legacy/ListItem/ListItem.js +3 -1
  39. package/legacy/Modal/Modal.js +3 -1
  40. package/legacy/Select/Select.js +11 -1
  41. package/legacy/Select/SelectInput.js +29 -7
  42. package/legacy/Slider/Slider.js +127 -54
  43. package/legacy/StepLabel/StepLabel.js +3 -1
  44. package/legacy/SvgIcon/SvgIcon.js +20 -3
  45. package/legacy/TextField/TextField.js +1 -0
  46. package/legacy/Tooltip/Tooltip.js +6 -1
  47. package/legacy/index.js +1 -1
  48. package/legacy/locale/index.js +224 -130
  49. package/legacy/utils/shouldSpreadAdditionalProps.js +7 -0
  50. package/locale/index.d.ts +1 -0
  51. package/locale/index.js +140 -50
  52. package/modern/Autocomplete/Autocomplete.js +9 -5
  53. package/modern/Backdrop/Backdrop.js +3 -1
  54. package/modern/Badge/Badge.js +31 -15
  55. package/modern/FilledInput/FilledInput.js +4 -1
  56. package/modern/FormControlLabel/FormControlLabel.js +3 -1
  57. package/modern/Input/Input.js +4 -1
  58. package/modern/InputBase/InputBase.js +4 -1
  59. package/modern/InputLabel/InputLabel.js +4 -0
  60. package/modern/ListItem/ListItem.js +3 -1
  61. package/modern/Modal/Modal.js +3 -1
  62. package/modern/Select/Select.js +10 -1
  63. package/modern/Select/SelectInput.js +25 -4
  64. package/modern/Slider/Slider.js +126 -53
  65. package/modern/StepLabel/StepLabel.js +3 -1
  66. package/modern/SvgIcon/SvgIcon.js +19 -3
  67. package/modern/TextField/TextField.js +1 -0
  68. package/modern/Tooltip/Tooltip.js +6 -1
  69. package/modern/index.js +1 -1
  70. package/modern/locale/index.js +140 -50
  71. package/modern/utils/shouldSpreadAdditionalProps.js +7 -0
  72. package/node/Autocomplete/Autocomplete.js +10 -6
  73. package/node/Backdrop/Backdrop.js +3 -1
  74. package/node/Badge/Badge.js +33 -16
  75. package/node/FilledInput/FilledInput.js +4 -1
  76. package/node/FormControlLabel/FormControlLabel.js +3 -1
  77. package/node/Input/Input.js +4 -1
  78. package/node/InputBase/InputBase.js +4 -1
  79. package/node/InputLabel/InputLabel.js +4 -0
  80. package/node/ListItem/ListItem.js +3 -1
  81. package/node/Modal/Modal.js +3 -1
  82. package/node/Select/Select.js +10 -1
  83. package/node/Select/SelectInput.js +25 -4
  84. package/node/Slider/Slider.js +112 -45
  85. package/node/StepLabel/StepLabel.js +3 -1
  86. package/node/SvgIcon/SvgIcon.js +19 -3
  87. package/node/TextField/TextField.js +1 -0
  88. package/node/Tooltip/Tooltip.js +6 -1
  89. package/node/index.js +1 -1
  90. package/node/locale/index.js +142 -51
  91. package/node/utils/shouldSpreadAdditionalProps.js +15 -0
  92. package/package.json +7 -7
  93. package/styles/components.d.ts +452 -113
  94. package/styles/createTheme.d.ts +12 -6
  95. package/styles/overrides.d.ts +16 -4
  96. package/styles/useThemeProps.d.ts +2 -1
  97. package/umd/material-ui.development.js +703 -332
  98. package/umd/material-ui.production.min.js +21 -21
  99. package/utils/shouldSpreadAdditionalProps.js +7 -0
@@ -83,6 +83,7 @@ export interface BaseTextFieldProps
83
83
  id?: string;
84
84
  /**
85
85
  * Props applied to the [`InputLabel`](/api/input-label/) element.
86
+ * Pointer events like `onClick` are enabled if and only if `shrink` is `true`.
86
87
  */
87
88
  InputLabelProps?: Partial<InputLabelProps>;
88
89
  /**
@@ -296,6 +296,7 @@ process.env.NODE_ENV !== "production" ? TextField.propTypes
296
296
 
297
297
  /**
298
298
  * Props applied to the [`InputLabel`](/api/input-label/) element.
299
+ * Pointer events like `onClick` are enabled if and only if `shrink` is `true`.
299
300
  */
300
301
  InputLabelProps: PropTypes.object,
301
302
 
@@ -681,7 +681,12 @@ process.env.NODE_ENV !== "production" ? Tooltip.propTypes
681
681
  * and `componentsProps.transition` prop values win over `TransitionProps` if both are applied.
682
682
  * @default {}
683
683
  */
684
- componentsProps: PropTypes.object,
684
+ componentsProps: PropTypes.shape({
685
+ arrow: PropTypes.object,
686
+ popper: PropTypes.object,
687
+ tooltip: PropTypes.object,
688
+ transition: PropTypes.object
689
+ }),
685
690
 
686
691
  /**
687
692
  * Set to `true` if the `title` acts as an accessible description.
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license MUI v5.2.5
1
+ /** @license MUI v5.3.0
2
2
  *
3
3
  * This source code is licensed under the MIT license found in the
4
4
  * LICENSE file in the root directory of this source tree.
@@ -316,7 +316,7 @@ var AutocompleteGroupUl = styled('ul', {
316
316
  }));
317
317
  export { createFilterOptions };
318
318
  var Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps, ref) {
319
- var _componentsProps$clea;
319
+ var _componentsProps$clea, _componentsProps$pape;
320
320
 
321
321
  var props = useThemeProps({
322
322
  props: inProps,
@@ -596,10 +596,11 @@ var Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps,
596
596
  role: "presentation",
597
597
  anchorEl: anchorEl,
598
598
  open: true,
599
- children: /*#__PURE__*/_jsxs(AutocompletePaper, {
600
- as: PaperComponent,
601
- className: classes.paper,
599
+ children: /*#__PURE__*/_jsxs(AutocompletePaper, _extends({
602
600
  ownerState: ownerState,
601
+ as: PaperComponent
602
+ }, componentsProps.paper, {
603
+ className: clsx(classes.paper, (_componentsProps$pape = componentsProps.paper) == null ? void 0 : _componentsProps$pape.className),
603
604
  children: [loading && groupedOptions.length === 0 ? /*#__PURE__*/_jsx(AutocompleteLoading, {
604
605
  className: classes.loading,
605
606
  ownerState: ownerState,
@@ -632,7 +633,7 @@ var Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps,
632
633
  return renderListOption(option, index);
633
634
  })
634
635
  })) : null]
635
- })
636
+ }))
636
637
  }) : null]
637
638
  });
638
639
  });
@@ -733,7 +734,10 @@ process.env.NODE_ENV !== "production" ? Autocomplete.propTypes
733
734
  * The props used for each slot inside.
734
735
  * @default {}
735
736
  */
736
- componentsProps: PropTypes.object,
737
+ componentsProps: PropTypes.shape({
738
+ clearIndicator: PropTypes.object,
739
+ paper: PropTypes.object
740
+ }),
737
741
 
738
742
  /**
739
743
  * The default value. Use when the component is not controlled.
@@ -123,7 +123,9 @@ process.env.NODE_ENV !== "production" ? Backdrop.propTypes
123
123
  * The props used for each slot inside the Backdrop.
124
124
  * @default {}
125
125
  */
126
- componentsProps: PropTypes.object,
126
+ componentsProps: PropTypes.shape({
127
+ root: PropTypes.object
128
+ }),
127
129
 
128
130
  /**
129
131
  * If `true`, the backdrop is invisible.
@@ -5,22 +5,26 @@ import * as React from 'react';
5
5
  import PropTypes from 'prop-types';
6
6
  import clsx from 'clsx';
7
7
  import { usePreviousProps } from '@mui/utils';
8
- import { generateUtilityClasses, isHostComponent } from '@mui/base';
8
+ import { generateUtilityClasses } from '@mui/base';
9
9
  import BadgeUnstyled, { badgeUnstyledClasses, getBadgeUtilityClass } from '@mui/base/BadgeUnstyled';
10
10
  import styled from '../styles/styled';
11
11
  import useThemeProps from '../styles/useThemeProps';
12
+ import shouldSpreadAdditionalProps from '../utils/shouldSpreadAdditionalProps';
12
13
  import capitalize from '../utils/capitalize';
13
14
  import { jsx as _jsx } from "react/jsx-runtime";
14
- export var badgeClasses = _extends({}, badgeUnstyledClasses, generateUtilityClasses('MuiBadge', ['colorError', 'colorInfo', 'colorPrimary', 'colorSecondary', 'colorSuccess', 'colorWarning']));
15
+ export var badgeClasses = _extends({}, badgeUnstyledClasses, generateUtilityClasses('MuiBadge', ['colorError', 'colorInfo', 'colorPrimary', 'colorSecondary', 'colorSuccess', 'colorWarning', 'overlapRectangular', 'overlapCircular', // TODO: v6 remove the overlap value from these class keys
16
+ 'anchorOriginTopLeftCircular', 'anchorOriginTopLeftRectangular', 'anchorOriginTopRightCircular', 'anchorOriginTopRightRectangular', 'anchorOriginBottomLeftCircular', 'anchorOriginBottomLeftRectangular', 'anchorOriginBottomRightCircular', 'anchorOriginBottomRightRectangular']));
15
17
  var RADIUS_STANDARD = 10;
16
18
  var RADIUS_DOT = 4;
17
19
 
18
20
  var extendUtilityClasses = function extendUtilityClasses(ownerState) {
19
21
  var color = ownerState.color,
22
+ anchorOrigin = ownerState.anchorOrigin,
23
+ overlap = ownerState.overlap,
20
24
  _ownerState$classes = ownerState.classes,
21
25
  classes = _ownerState$classes === void 0 ? {} : _ownerState$classes;
22
26
  return _extends({}, classes, {
23
- badge: clsx(classes.badge, color !== 'default' && [getBadgeUtilityClass("color".concat(capitalize(color))), classes["color".concat(capitalize(color))]])
27
+ badge: clsx(classes.badge, getBadgeUtilityClass("anchorOrigin".concat(capitalize(anchorOrigin.vertical)).concat(capitalize(anchorOrigin.horizontal)).concat(capitalize(overlap))), getBadgeUtilityClass("overlap".concat(capitalize(overlap))), color !== 'default' && [getBadgeUtilityClass("color".concat(capitalize(color))), classes["color".concat(capitalize(color))]])
24
28
  });
25
29
  };
26
30
 
@@ -141,11 +145,6 @@ var BadgeBadge = styled('span', {
141
145
  })
142
146
  });
143
147
  });
144
-
145
- var shouldSpreadAdditionalProps = function shouldSpreadAdditionalProps(Slot) {
146
- return !Slot || !isHostComponent(Slot);
147
- };
148
-
149
148
  var Badge = /*#__PURE__*/React.forwardRef(function Badge(inProps, ref) {
150
149
  var _componentsProps$root, _componentsProps$badg;
151
150
 
@@ -154,12 +153,19 @@ var Badge = /*#__PURE__*/React.forwardRef(function Badge(inProps, ref) {
154
153
  name: 'MuiBadge'
155
154
  });
156
155
 
157
- var _props$component = props.component,
156
+ var _props$anchorOrigin = props.anchorOrigin,
157
+ anchorOriginProp = _props$anchorOrigin === void 0 ? {
158
+ vertical: 'top',
159
+ horizontal: 'right'
160
+ } : _props$anchorOrigin,
161
+ _props$component = props.component,
158
162
  component = _props$component === void 0 ? 'span' : _props$component,
159
163
  _props$components = props.components,
160
164
  components = _props$components === void 0 ? {} : _props$components,
161
165
  _props$componentsProp = props.componentsProps,
162
166
  componentsProps = _props$componentsProp === void 0 ? {} : _props$componentsProp,
167
+ _props$overlap = props.overlap,
168
+ overlapProp = _props$overlap === void 0 ? 'rectangular' : _props$overlap,
163
169
  _props$color = props.color,
164
170
  colorProp = _props$color === void 0 ? 'default' : _props$color,
165
171
  invisibleProp = props.invisible,
@@ -168,10 +174,12 @@ var Badge = /*#__PURE__*/React.forwardRef(function Badge(inProps, ref) {
168
174
  showZero = _props$showZero === void 0 ? false : _props$showZero,
169
175
  _props$variant = props.variant,
170
176
  variantProp = _props$variant === void 0 ? 'standard' : _props$variant,
171
- other = _objectWithoutProperties(props, ["component", "components", "componentsProps", "color", "invisible", "badgeContent", "showZero", "variant"]);
177
+ other = _objectWithoutProperties(props, ["anchorOrigin", "component", "components", "componentsProps", "overlap", "color", "invisible", "badgeContent", "showZero", "variant"]);
172
178
 
173
179
  var prevProps = usePreviousProps({
174
- color: colorProp
180
+ anchorOrigin: anchorOriginProp,
181
+ color: colorProp,
182
+ overlap: overlapProp
175
183
  });
176
184
  var invisible = invisibleProp;
177
185
 
@@ -181,15 +189,22 @@ var Badge = /*#__PURE__*/React.forwardRef(function Badge(inProps, ref) {
181
189
 
182
190
  var _ref10 = invisible ? prevProps : props,
183
191
  _ref10$color = _ref10.color,
184
- color = _ref10$color === void 0 ? colorProp : _ref10$color;
192
+ color = _ref10$color === void 0 ? colorProp : _ref10$color,
193
+ _ref10$overlap = _ref10.overlap,
194
+ overlap = _ref10$overlap === void 0 ? overlapProp : _ref10$overlap,
195
+ _ref10$anchorOrigin = _ref10.anchorOrigin,
196
+ anchorOrigin = _ref10$anchorOrigin === void 0 ? anchorOriginProp : _ref10$anchorOrigin;
185
197
 
186
198
  var ownerState = _extends({}, props, {
199
+ anchorOrigin: anchorOrigin,
187
200
  invisible: invisible,
188
- color: color
201
+ color: color,
202
+ overlap: overlap
189
203
  });
190
204
 
191
205
  var classes = extendUtilityClasses(ownerState);
192
206
  return /*#__PURE__*/_jsx(BadgeUnstyled, _extends({
207
+ anchorOrigin: anchorOrigin,
193
208
  invisible: invisibleProp,
194
209
  badgeContent: badgeContentProp,
195
210
  showZero: showZero,
@@ -203,12 +218,14 @@ var Badge = /*#__PURE__*/React.forwardRef(function Badge(inProps, ref) {
203
218
  root: _extends({}, componentsProps.root, shouldSpreadAdditionalProps(components.Root) && {
204
219
  as: component,
205
220
  ownerState: _extends({}, (_componentsProps$root = componentsProps.root) == null ? void 0 : _componentsProps$root.ownerState, {
206
- color: color
221
+ color: color,
222
+ overlap: overlap
207
223
  })
208
224
  }),
209
225
  badge: _extends({}, componentsProps.badge, shouldSpreadAdditionalProps(components.Badge) && {
210
226
  ownerState: _extends({}, (_componentsProps$badg = componentsProps.badge) == null ? void 0 : _componentsProps$badg.ownerState, {
211
- color: color
227
+ color: color,
228
+ overlap: overlap
212
229
  })
213
230
  })
214
231
  },
@@ -279,7 +296,10 @@ process.env.NODE_ENV !== "production" ? Badge.propTypes
279
296
  * The props used for each slot inside the Badge.
280
297
  * @default {}
281
298
  */
282
- componentsProps: PropTypes.object,
299
+ componentsProps: PropTypes.shape({
300
+ badge: PropTypes.object,
301
+ root: PropTypes.object
302
+ }),
283
303
 
284
304
  /**
285
305
  * If `true`, the badge is invisible.
@@ -255,7 +255,10 @@ process.env.NODE_ENV !== "production" ? FilledInput.propTypes
255
255
  * The props used for each slot inside the Input.
256
256
  * @default {}
257
257
  */
258
- componentsProps: PropTypes.object,
258
+ componentsProps: PropTypes.shape({
259
+ input: PropTypes.object,
260
+ root: PropTypes.object
261
+ }),
259
262
 
260
263
  /**
261
264
  * The default value. Use when the component is not controlled.
@@ -156,7 +156,9 @@ process.env.NODE_ENV !== "production" ? FormControlLabel.propTypes
156
156
  * The props used for each slot inside.
157
157
  * @default {}
158
158
  */
159
- componentsProps: PropTypes.object,
159
+ componentsProps: PropTypes.shape({
160
+ typography: PropTypes.object
161
+ }),
160
162
 
161
163
  /**
162
164
  * A control element. For instance, it can be a `Radio`, a `Switch` or a `Checkbox`.
@@ -190,7 +190,10 @@ process.env.NODE_ENV !== "production" ? Input.propTypes
190
190
  * The props used for each slot inside the Input.
191
191
  * @default {}
192
192
  */
193
- componentsProps: PropTypes.object,
193
+ componentsProps: PropTypes.shape({
194
+ input: PropTypes.object,
195
+ root: PropTypes.object
196
+ }),
194
197
 
195
198
  /**
196
199
  * The default value. Use when the component is not controlled.
@@ -561,7 +561,10 @@ process.env.NODE_ENV !== "production" ? InputBase.propTypes
561
561
  * The props used for each slot inside the Input.
562
562
  * @default {}
563
563
  */
564
- componentsProps: PropTypes.object,
564
+ componentsProps: PropTypes.shape({
565
+ input: PropTypes.object,
566
+ root: PropTypes.object
567
+ }),
565
568
 
566
569
  /**
567
570
  * The default value. Use when the component is not controlled.
@@ -78,6 +78,8 @@ var InputLabelRoot = styled(FormLabel, {
78
78
  }, ownerState.size === 'small' && {
79
79
  transform: 'translate(12px, 13px) scale(1)'
80
80
  }, ownerState.shrink && _extends({
81
+ userSelect: 'none',
82
+ pointerEvents: 'auto',
81
83
  transform: 'translate(12px, 7px) scale(0.75)',
82
84
  maxWidth: 'calc(133% - 24px)'
83
85
  }, ownerState.size === 'small' && {
@@ -91,6 +93,8 @@ var InputLabelRoot = styled(FormLabel, {
91
93
  }, ownerState.size === 'small' && {
92
94
  transform: 'translate(14px, 9px) scale(1)'
93
95
  }, ownerState.shrink && {
96
+ userSelect: 'none',
97
+ pointerEvents: 'auto',
94
98
  maxWidth: 'calc(133% - 24px)',
95
99
  transform: 'translate(14px, -9px) scale(0.75)'
96
100
  }));
@@ -348,7 +348,9 @@ process.env.NODE_ENV !== "production" ? ListItem.propTypes
348
348
  * The props used for each slot inside the Input.
349
349
  * @default {}
350
350
  */
351
- componentsProps: PropTypes.object,
351
+ componentsProps: PropTypes.shape({
352
+ root: PropTypes.object
353
+ }),
352
354
 
353
355
  /**
354
356
  * The container component used when a `ListItemSecondaryAction` is the last child.
@@ -194,7 +194,9 @@ process.env.NODE_ENV !== "production" ? Modal.propTypes
194
194
  * The props used for each slot inside the Modal.
195
195
  * @default {}
196
196
  */
197
- componentsProps: PropTypes.object,
197
+ componentsProps: PropTypes.shape({
198
+ root: PropTypes.object
199
+ }),
198
200
 
199
201
  /**
200
202
  * An HTML element or function that returns one.
@@ -36,6 +36,8 @@ var Select = /*#__PURE__*/React.forwardRef(function Select(inProps, ref) {
36
36
  _props$classes = props.classes,
37
37
  classesProp = _props$classes === void 0 ? {} : _props$classes,
38
38
  className = props.className,
39
+ _props$defaultOpen = props.defaultOpen,
40
+ defaultOpen = _props$defaultOpen === void 0 ? false : _props$defaultOpen,
39
41
  _props$displayEmpty = props.displayEmpty,
40
42
  displayEmpty = _props$displayEmpty === void 0 ? false : _props$displayEmpty,
41
43
  _props$IconComponent = props.IconComponent,
@@ -57,7 +59,7 @@ var Select = /*#__PURE__*/React.forwardRef(function Select(inProps, ref) {
57
59
  SelectDisplayProps = props.SelectDisplayProps,
58
60
  _props$variant = props.variant,
59
61
  variantProps = _props$variant === void 0 ? 'outlined' : _props$variant,
60
- other = _objectWithoutProperties(props, ["autoWidth", "children", "classes", "className", "displayEmpty", "IconComponent", "id", "input", "inputProps", "label", "labelId", "MenuProps", "multiple", "native", "onClose", "onOpen", "open", "renderValue", "SelectDisplayProps", "variant"]);
62
+ other = _objectWithoutProperties(props, ["autoWidth", "children", "classes", "className", "defaultOpen", "displayEmpty", "IconComponent", "id", "input", "inputProps", "label", "labelId", "MenuProps", "multiple", "native", "onClose", "onOpen", "open", "renderValue", "SelectDisplayProps", "variant"]);
61
63
 
62
64
  var inputComponent = native ? NativeSelectInput : SelectInput;
63
65
  var muiFormControl = useFormControl();
@@ -96,6 +98,7 @@ var Select = /*#__PURE__*/React.forwardRef(function Select(inProps, ref) {
96
98
  id: id
97
99
  } : {
98
100
  autoWidth: autoWidth,
101
+ defaultOpen: defaultOpen,
99
102
  displayEmpty: displayEmpty,
100
103
  labelId: labelId,
101
104
  MenuProps: MenuProps,
@@ -150,6 +153,13 @@ process.env.NODE_ENV !== "production" ? Select.propTypes
150
153
  */
151
154
  className: PropTypes.string,
152
155
 
156
+ /**
157
+ * If `true`, the component is initially open. Use when the component open state is not controlled (i.e. the `open` prop is not defined).
158
+ * You can only use it when the `native` prop is `false` (default).
159
+ * @default false
160
+ */
161
+ defaultOpen: PropTypes.bool,
162
+
153
163
  /**
154
164
  * The default value. Use when the component is not controlled.
155
165
  */
@@ -103,6 +103,7 @@ var SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, ref)
103
103
  autoWidth = props.autoWidth,
104
104
  children = props.children,
105
105
  className = props.className,
106
+ defaultOpen = props.defaultOpen,
106
107
  defaultValue = props.defaultValue,
107
108
  disabled = props.disabled,
108
109
  displayEmpty = props.displayEmpty,
@@ -128,7 +129,7 @@ var SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, ref)
128
129
  valueProp = props.value,
129
130
  _props$variant = props.variant,
130
131
  variant = _props$variant === void 0 ? 'standard' : _props$variant,
131
- other = _objectWithoutProperties(props, ["aria-describedby", "aria-label", "autoFocus", "autoWidth", "children", "className", "defaultValue", "disabled", "displayEmpty", "IconComponent", "inputRef", "labelId", "MenuProps", "multiple", "name", "onBlur", "onChange", "onClose", "onFocus", "onOpen", "open", "readOnly", "renderValue", "SelectDisplayProps", "tabIndex", "type", "value", "variant"]);
132
+ other = _objectWithoutProperties(props, ["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"]);
132
133
 
133
134
  var _useControlled = useControlled({
134
135
  controlled: valueProp,
@@ -139,6 +140,15 @@ var SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, ref)
139
140
  value = _useControlled2[0],
140
141
  setValueState = _useControlled2[1];
141
142
 
143
+ var _useControlled3 = useControlled({
144
+ controlled: openProp,
145
+ default: defaultOpen,
146
+ name: 'Select'
147
+ }),
148
+ _useControlled4 = _slicedToArray(_useControlled3, 2),
149
+ openState = _useControlled4[0],
150
+ setOpenState = _useControlled4[1];
151
+
142
152
  var inputRef = React.useRef(null);
143
153
  var displayRef = React.useRef(null);
144
154
 
@@ -153,10 +163,6 @@ var SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, ref)
153
163
  menuMinWidthState = _React$useState2[0],
154
164
  setMenuMinWidthState = _React$useState2[1];
155
165
 
156
- var _React$useState3 = React.useState(false),
157
- openState = _React$useState3[0],
158
- setOpenState = _React$useState3[1];
159
-
160
166
  var handleRef = useForkRef(ref, inputRefProp);
161
167
  var handleDisplayRef = React.useCallback(function (node) {
162
168
  displayRef.current = node;
@@ -173,7 +179,17 @@ var SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, ref)
173
179
  node: inputRef.current,
174
180
  value: value
175
181
  };
176
- }, [value]);
182
+ }, [value]); // Resize menu on `defaultOpen` automatic toggle.
183
+
184
+ React.useEffect(function () {
185
+ if (defaultOpen && openState && displayNode && !isOpenControlled) {
186
+ setMenuMinWidthState(autoWidth ? null : displayNode.clientWidth);
187
+ displayRef.current.focus();
188
+ } // eslint-disable-next-line react-hooks/exhaustive-deps
189
+
190
+ }, [displayNode, autoWidth]); // `isOpenControlled` is ignored because the component should never switch between controlled and uncontrolled modes.
191
+ // `defaultOpen` and `openState` are ignored to avoid unnecessary callbacks.
192
+
177
193
  React.useEffect(function () {
178
194
  if (autoFocus) {
179
195
  displayRef.current.focus();
@@ -313,7 +329,7 @@ var SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, ref)
313
329
  }
314
330
  };
315
331
 
316
- var open = displayNode !== null && (isOpenControlled ? openProp : openState);
332
+ var open = displayNode !== null && openState;
317
333
 
318
334
  var handleBlur = function handleBlur(event) {
319
335
  // if open event.stopImmediatePropagation
@@ -580,6 +596,12 @@ process.env.NODE_ENV !== "production" ? SelectInput.propTypes = {
580
596
  */
581
597
  className: PropTypes.string,
582
598
 
599
+ /**
600
+ * If `true`, the component is toggled on mount. Use when the component open state is not controlled.
601
+ * You can only use it when the `native` prop is `false` (default).
602
+ */
603
+ defaultOpen: PropTypes.bool,
604
+
583
605
  /**
584
606
  * The default value. Use when the component is not controlled.
585
607
  */