@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
package/locale/index.js CHANGED
@@ -888,7 +888,7 @@ export const enUS = {
888
888
  MuiBreadcrumbs: { defaultProps: {
889
889
  expandText: 'Show path',
890
890
  }},
891
- MuiTablePagination: { defaultProps: {
891
+ MuiTablePagination: { defaultProps: {
892
892
  getItemAriaLabel: (type) => {
893
893
  if (type === 'first') {
894
894
  return 'Go to first page';
@@ -906,21 +906,21 @@ export const enUS = {
906
906
  labelDisplayedRows: ({ from, to, count }) =>
907
907
  `${from}–${to} of ${count !== -1 ? count : `more than ${to}`}`,
908
908
  }},
909
- MuiRating: { defaultProps: {
909
+ MuiRating: { defaultProps: {
910
910
  getLabelText: value => `${value} Star${value !== 1 ? 's' : ''}`,
911
911
  emptyLabelText: 'Empty',
912
912
  }},
913
- MuiAutocomplete: { defaultProps: {
913
+ MuiAutocomplete: { defaultProps: {
914
914
  clearText: 'Clear',
915
915
  closeText: 'Close',
916
916
  loadingText: 'Loading…',
917
917
  noOptionsText: 'No options',
918
918
  openText: 'Open',
919
919
  }},
920
- MuiAlert: { defaultProps: {
920
+ MuiAlert: { defaultProps: {
921
921
  closeText: 'Close',
922
922
  }},
923
- MuiPagination: { defaultProps: {
923
+ MuiPagination: { defaultProps: {
924
924
  'aria-label': 'Pagination navigation',
925
925
  getItemAriaLabel: (type, page, selected) => {
926
926
  if (type === 'page') {
@@ -938,7 +938,7 @@ export const enUS = {
938
938
  // if (type === 'previous') {
939
939
  return 'Go to previous page';
940
940
  },
941
- },
941
+ }},
942
942
  },
943
943
  */
944
944
  };
@@ -1206,9 +1206,12 @@ export const fiFI = {
1206
1206
 
1207
1207
  return 'Mene edelliselle sivulle';
1208
1208
  },
1209
- labelRowsPerPage: 'Rivejä per sivu:' // labelDisplayedRows: ({ from, to, count }) =>
1210
- // `${from}–${to} / ${count !== -1 ? count : `more than ${to}`}`,
1211
-
1209
+ labelRowsPerPage: 'Rivejä per sivu:',
1210
+ labelDisplayedRows: ({
1211
+ from,
1212
+ to,
1213
+ count
1214
+ }) => `${from}–${to} / ${count !== -1 ? count : `enemmän kuin ${to}`}`
1212
1215
  }
1213
1216
  },
1214
1217
  MuiRating: {
@@ -2186,6 +2189,86 @@ export const kzKZ = {
2186
2189
  }
2187
2190
  }
2188
2191
  };
2192
+ export const nbNO = {
2193
+ components: {
2194
+ MuiBreadcrumbs: {
2195
+ defaultProps: {
2196
+ expandText: 'Vis sti'
2197
+ }
2198
+ },
2199
+ MuiTablePagination: {
2200
+ defaultProps: {
2201
+ getItemAriaLabel: type => {
2202
+ if (type === 'first') {
2203
+ return 'Gå til første side';
2204
+ }
2205
+
2206
+ if (type === 'last') {
2207
+ return 'Gå til siste side';
2208
+ }
2209
+
2210
+ if (type === 'next') {
2211
+ return 'Gå til neste side';
2212
+ } // if (type === 'previous') {
2213
+
2214
+
2215
+ return 'Gå til forrige side';
2216
+ },
2217
+ labelRowsPerPage: 'Rader per side:',
2218
+ labelDisplayedRows: ({
2219
+ from,
2220
+ to,
2221
+ count
2222
+ }) => `${from}–${to} av ${count !== -1 ? count : `mer enn ${to}`}`
2223
+ }
2224
+ },
2225
+ MuiRating: {
2226
+ defaultProps: {
2227
+ getLabelText: value => `${value} Stjerne${value !== 1 ? 'r' : ''}`,
2228
+ emptyLabelText: 'Tom'
2229
+ }
2230
+ },
2231
+ MuiAutocomplete: {
2232
+ defaultProps: {
2233
+ clearText: 'Tøm',
2234
+ closeText: 'Lukk',
2235
+ loadingText: 'Laster inn…',
2236
+ noOptionsText: 'Ingen alternativer',
2237
+ openText: 'Åpne'
2238
+ }
2239
+ },
2240
+ MuiAlert: {
2241
+ defaultProps: {
2242
+ closeText: 'Lukk'
2243
+ }
2244
+ },
2245
+ MuiPagination: {
2246
+ defaultProps: {
2247
+ 'aria-label': 'Paginering navigasjon',
2248
+ getItemAriaLabel: (type, page, selected) => {
2249
+ if (type === 'page') {
2250
+ return `${selected ? '' : 'Gå til '}side ${page}`;
2251
+ }
2252
+
2253
+ if (type === 'first') {
2254
+ return 'Gå til første side';
2255
+ }
2256
+
2257
+ if (type === 'last') {
2258
+ return 'Gå til siste side';
2259
+ }
2260
+
2261
+ if (type === 'next') {
2262
+ return 'Gå til neste side';
2263
+ } // if (type === 'previous') {
2264
+
2265
+
2266
+ return 'Gå til forrige side';
2267
+ }
2268
+ }
2269
+ }
2270
+ }
2271
+ };
2189
2272
  export const nlNL = {
2190
2273
  components: {
2191
2274
  MuiBreadcrumbs: {
@@ -3186,26 +3269,29 @@ export const ukUA = {
3186
3269
  };
3187
3270
  export const viVN = {
3188
3271
  components: {
3189
- // MuiBreadcrumbs: {
3190
- // defaultProps: {
3191
- // expandText: 'Show path',
3192
- // },
3193
- // },
3272
+ MuiBreadcrumbs: {
3273
+ defaultProps: {
3274
+ expandText: 'Mở ra'
3275
+ }
3276
+ },
3194
3277
  MuiTablePagination: {
3195
3278
  defaultProps: {
3196
- // getItemAriaLabel: (type) => {
3197
- // if (type === 'first') {
3198
- // return 'Go to first page';
3199
- // }
3200
- // if (type === 'last') {
3201
- // return 'Go to last page';
3202
- // }
3203
- // if (type === 'next') {
3204
- // return 'Go to next page';
3205
- // }
3206
- // // if (type === 'previous') {
3207
- // return 'Go to previous page';
3208
- // },
3279
+ getItemAriaLabel: type => {
3280
+ if (type === 'first') {
3281
+ return 'Tới trang đầu tiên';
3282
+ }
3283
+
3284
+ if (type === 'last') {
3285
+ return 'Tới trang cuối cùng';
3286
+ }
3287
+
3288
+ if (type === 'next') {
3289
+ return 'Tới trang tiếp theo';
3290
+ } // if (type === 'previous') {
3291
+
3292
+
3293
+ return 'Về trang trước đó';
3294
+ },
3209
3295
  labelRowsPerPage: 'Số hàng mỗi trang:',
3210
3296
  labelDisplayedRows: ({
3211
3297
  from,
@@ -3217,7 +3303,7 @@ export const viVN = {
3217
3303
  MuiRating: {
3218
3304
  defaultProps: {
3219
3305
  getLabelText: value => `${value} sao`,
3220
- emptyLabelText: 'Trống'
3306
+ emptyLabelText: 'Không có dữ liệu'
3221
3307
  }
3222
3308
  },
3223
3309
  MuiAutocomplete: {
@@ -3225,7 +3311,7 @@ export const viVN = {
3225
3311
  clearText: 'Xóa',
3226
3312
  closeText: 'Đóng',
3227
3313
  loadingText: 'Đang tải…',
3228
- noOptionsText: 'Không có lựa chọn',
3314
+ noOptionsText: 'Không có lựa chọn nào',
3229
3315
  openText: 'Mở'
3230
3316
  }
3231
3317
  },
@@ -3233,28 +3319,32 @@ export const viVN = {
3233
3319
  defaultProps: {
3234
3320
  closeText: 'Đóng'
3235
3321
  }
3236
- } // MuiPagination: {
3237
- // defaultProps: {
3238
- // 'aria-label': 'Pagination navigation',
3239
- // getItemAriaLabel: (type, page, selected) => {
3240
- // if (type === 'page') {
3241
- // return `${selected ? '' : 'Go to '}page ${page}`;
3242
- // }
3243
- // if (type === 'first') {
3244
- // return 'Go to first page';
3245
- // }
3246
- // if (type === 'last') {
3247
- // return 'Go to last page';
3248
- // }
3249
- // if (type === 'next') {
3250
- // return 'Go to next page';
3251
- // }
3252
- // // if (type === 'previous') {
3253
- // return 'Go to previous page';
3254
- // },
3255
- // },
3256
- // },
3322
+ },
3323
+ MuiPagination: {
3324
+ defaultProps: {
3325
+ 'aria-label': 'Thanh điều khiển trang',
3326
+ getItemAriaLabel: (type, page, selected) => {
3327
+ if (type === 'page') {
3328
+ return `${selected ? '' : 'Tới '}trang ${page}`;
3329
+ }
3257
3330
 
3331
+ if (type === 'first') {
3332
+ return 'Tới trang đầu tiên';
3333
+ }
3334
+
3335
+ if (type === 'last') {
3336
+ return 'Tới trang cuối cùng';
3337
+ }
3338
+
3339
+ if (type === 'next') {
3340
+ return 'Tới trang tiếp theo';
3341
+ } // if (type === 'previous') {
3342
+
3343
+
3344
+ return 'Về trang trước đó';
3345
+ }
3346
+ }
3347
+ }
3258
3348
  }
3259
3349
  };
3260
3350
  export const zhCN = {
@@ -564,10 +564,11 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps
564
564
  role: "presentation",
565
565
  anchorEl: anchorEl,
566
566
  open: true,
567
- children: /*#__PURE__*/_jsxs(AutocompletePaper, {
568
- as: PaperComponent,
569
- className: classes.paper,
567
+ children: /*#__PURE__*/_jsxs(AutocompletePaper, _extends({
570
568
  ownerState: ownerState,
569
+ as: PaperComponent
570
+ }, componentsProps.paper, {
571
+ className: clsx(classes.paper, componentsProps.paper?.className),
571
572
  children: [loading && groupedOptions.length === 0 ? /*#__PURE__*/_jsx(AutocompleteLoading, {
572
573
  className: classes.loading,
573
574
  ownerState: ownerState,
@@ -598,7 +599,7 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps
598
599
  return renderListOption(option, index);
599
600
  })
600
601
  })) : null]
601
- })
602
+ }))
602
603
  }) : null]
603
604
  });
604
605
  });
@@ -699,7 +700,10 @@ process.env.NODE_ENV !== "production" ? Autocomplete.propTypes
699
700
  * The props used for each slot inside.
700
701
  * @default {}
701
702
  */
702
- componentsProps: PropTypes.object,
703
+ componentsProps: PropTypes.shape({
704
+ clearIndicator: PropTypes.object,
705
+ paper: PropTypes.object
706
+ }),
703
707
 
704
708
  /**
705
709
  * The default value. Use when the component is not controlled.
@@ -124,7 +124,9 @@ process.env.NODE_ENV !== "production" ? Backdrop.propTypes
124
124
  * The props used for each slot inside the Backdrop.
125
125
  * @default {}
126
126
  */
127
- componentsProps: PropTypes.object,
127
+ componentsProps: PropTypes.shape({
128
+ root: PropTypes.object
129
+ }),
128
130
 
129
131
  /**
130
132
  * If `true`, the backdrop is invisible.
@@ -1,27 +1,31 @@
1
1
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
2
2
  import _extends from "@babel/runtime/helpers/esm/extends";
3
- const _excluded = ["component", "components", "componentsProps", "color", "invisible", "badgeContent", "showZero", "variant"];
3
+ const _excluded = ["anchorOrigin", "component", "components", "componentsProps", "overlap", "color", "invisible", "badgeContent", "showZero", "variant"];
4
4
  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 const badgeClasses = _extends({}, badgeUnstyledClasses, generateUtilityClasses('MuiBadge', ['colorError', 'colorInfo', 'colorPrimary', 'colorSecondary', 'colorSuccess', 'colorWarning']));
15
+ export const 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
  const RADIUS_STANDARD = 10;
16
18
  const RADIUS_DOT = 4;
17
19
 
18
20
  const extendUtilityClasses = ownerState => {
19
21
  const {
20
22
  color,
23
+ anchorOrigin,
24
+ overlap,
21
25
  classes = {}
22
26
  } = ownerState;
23
27
  return _extends({}, classes, {
24
- badge: clsx(classes.badge, color !== 'default' && [getBadgeUtilityClass(`color${capitalize(color)}`), classes[`color${capitalize(color)}`]])
28
+ badge: clsx(classes.badge, getBadgeUtilityClass(`anchorOrigin${capitalize(anchorOrigin.vertical)}${capitalize(anchorOrigin.horizontal)}${capitalize(overlap)}`), getBadgeUtilityClass(`overlap${capitalize(overlap)}`), color !== 'default' && [getBadgeUtilityClass(`color${capitalize(color)}`), classes[`color${capitalize(color)}`]])
25
29
  });
26
30
  };
27
31
 
@@ -149,11 +153,6 @@ const BadgeBadge = styled('span', {
149
153
  duration: theme.transitions.duration.leavingScreen
150
154
  })
151
155
  }));
152
-
153
- const shouldSpreadAdditionalProps = Slot => {
154
- return !Slot || !isHostComponent(Slot);
155
- };
156
-
157
156
  const Badge = /*#__PURE__*/React.forwardRef(function Badge(inProps, ref) {
158
157
  const props = useThemeProps({
159
158
  props: inProps,
@@ -161,9 +160,14 @@ const Badge = /*#__PURE__*/React.forwardRef(function Badge(inProps, ref) {
161
160
  });
162
161
 
163
162
  const {
163
+ anchorOrigin: anchorOriginProp = {
164
+ vertical: 'top',
165
+ horizontal: 'right'
166
+ },
164
167
  component = 'span',
165
168
  components = {},
166
169
  componentsProps = {},
170
+ overlap: overlapProp = 'rectangular',
167
171
  color: colorProp = 'default',
168
172
  invisible: invisibleProp,
169
173
  badgeContent: badgeContentProp,
@@ -173,7 +177,9 @@ const Badge = /*#__PURE__*/React.forwardRef(function Badge(inProps, ref) {
173
177
  other = _objectWithoutPropertiesLoose(props, _excluded);
174
178
 
175
179
  const prevProps = usePreviousProps({
176
- color: colorProp
180
+ anchorOrigin: anchorOriginProp,
181
+ color: colorProp,
182
+ overlap: overlapProp
177
183
  });
178
184
  let invisible = invisibleProp;
179
185
 
@@ -182,16 +188,21 @@ const Badge = /*#__PURE__*/React.forwardRef(function Badge(inProps, ref) {
182
188
  }
183
189
 
184
190
  const {
185
- color = colorProp
191
+ color = colorProp,
192
+ overlap = overlapProp,
193
+ anchorOrigin = anchorOriginProp
186
194
  } = invisible ? prevProps : props;
187
195
 
188
196
  const ownerState = _extends({}, props, {
197
+ anchorOrigin,
189
198
  invisible,
190
- color
199
+ color,
200
+ overlap
191
201
  });
192
202
 
193
203
  const classes = extendUtilityClasses(ownerState);
194
204
  return /*#__PURE__*/_jsx(BadgeUnstyled, _extends({
205
+ anchorOrigin: anchorOrigin,
195
206
  invisible: invisibleProp,
196
207
  badgeContent: badgeContentProp,
197
208
  showZero: showZero,
@@ -205,12 +216,14 @@ const Badge = /*#__PURE__*/React.forwardRef(function Badge(inProps, ref) {
205
216
  root: _extends({}, componentsProps.root, shouldSpreadAdditionalProps(components.Root) && {
206
217
  as: component,
207
218
  ownerState: _extends({}, componentsProps.root?.ownerState, {
208
- color
219
+ color,
220
+ overlap
209
221
  })
210
222
  }),
211
223
  badge: _extends({}, componentsProps.badge, shouldSpreadAdditionalProps(components.Badge) && {
212
224
  ownerState: _extends({}, componentsProps.badge?.ownerState, {
213
- color
225
+ color,
226
+ overlap
214
227
  })
215
228
  })
216
229
  },
@@ -281,7 +294,10 @@ process.env.NODE_ENV !== "production" ? Badge.propTypes
281
294
  * The props used for each slot inside the Badge.
282
295
  * @default {}
283
296
  */
284
- componentsProps: PropTypes.object,
297
+ componentsProps: PropTypes.shape({
298
+ badge: PropTypes.object,
299
+ root: PropTypes.object
300
+ }),
285
301
 
286
302
  /**
287
303
  * If `true`, the badge is invisible.
@@ -257,7 +257,10 @@ process.env.NODE_ENV !== "production" ? FilledInput.propTypes
257
257
  * The props used for each slot inside the Input.
258
258
  * @default {}
259
259
  */
260
- componentsProps: PropTypes.object,
260
+ componentsProps: PropTypes.shape({
261
+ input: PropTypes.object,
262
+ root: PropTypes.object
263
+ }),
261
264
 
262
265
  /**
263
266
  * The default value. Use when the component is not controlled.
@@ -162,7 +162,9 @@ process.env.NODE_ENV !== "production" ? FormControlLabel.propTypes
162
162
  * The props used for each slot inside.
163
163
  * @default {}
164
164
  */
165
- componentsProps: PropTypes.object,
165
+ componentsProps: PropTypes.shape({
166
+ typography: PropTypes.object
167
+ }),
166
168
 
167
169
  /**
168
170
  * A control element. For instance, it can be a `Radio`, a `Switch` or a `Checkbox`.
@@ -192,7 +192,10 @@ process.env.NODE_ENV !== "production" ? Input.propTypes
192
192
  * The props used for each slot inside the Input.
193
193
  * @default {}
194
194
  */
195
- componentsProps: PropTypes.object,
195
+ componentsProps: PropTypes.shape({
196
+ input: PropTypes.object,
197
+ root: PropTypes.object
198
+ }),
196
199
 
197
200
  /**
198
201
  * The default value. Use when the component is not controlled.
@@ -552,7 +552,10 @@ process.env.NODE_ENV !== "production" ? InputBase.propTypes
552
552
  * The props used for each slot inside the Input.
553
553
  * @default {}
554
554
  */
555
- componentsProps: PropTypes.object,
555
+ componentsProps: PropTypes.shape({
556
+ input: PropTypes.object,
557
+ root: PropTypes.object
558
+ }),
556
559
 
557
560
  /**
558
561
  * The default value. Use when the component is not controlled.
@@ -82,6 +82,8 @@ const InputLabelRoot = styled(FormLabel, {
82
82
  }, ownerState.size === 'small' && {
83
83
  transform: 'translate(12px, 13px) scale(1)'
84
84
  }, ownerState.shrink && _extends({
85
+ userSelect: 'none',
86
+ pointerEvents: 'auto',
85
87
  transform: 'translate(12px, 7px) scale(0.75)',
86
88
  maxWidth: 'calc(133% - 24px)'
87
89
  }, ownerState.size === 'small' && {
@@ -95,6 +97,8 @@ const InputLabelRoot = styled(FormLabel, {
95
97
  }, ownerState.size === 'small' && {
96
98
  transform: 'translate(14px, 9px) scale(1)'
97
99
  }, ownerState.shrink && {
100
+ userSelect: 'none',
101
+ pointerEvents: 'auto',
98
102
  maxWidth: 'calc(133% - 24px)',
99
103
  transform: 'translate(14px, -9px) scale(0.75)'
100
104
  })));
@@ -346,7 +346,9 @@ process.env.NODE_ENV !== "production" ? ListItem.propTypes
346
346
  * The props used for each slot inside the Input.
347
347
  * @default {}
348
348
  */
349
- componentsProps: PropTypes.object,
349
+ componentsProps: PropTypes.shape({
350
+ root: PropTypes.object
351
+ }),
350
352
 
351
353
  /**
352
354
  * The container component used when a `ListItemSecondaryAction` is the last child.
@@ -177,7 +177,9 @@ process.env.NODE_ENV !== "production" ? Modal.propTypes
177
177
  * The props used for each slot inside the Modal.
178
178
  * @default {}
179
179
  */
180
- componentsProps: PropTypes.object,
180
+ componentsProps: PropTypes.shape({
181
+ root: PropTypes.object
182
+ }),
181
183
 
182
184
  /**
183
185
  * An HTML element or function that returns one.
@@ -3,7 +3,7 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWith
3
3
 
4
4
  var _Input, _FilledInput;
5
5
 
6
- const _excluded = ["autoWidth", "children", "classes", "className", "displayEmpty", "IconComponent", "id", "input", "inputProps", "label", "labelId", "MenuProps", "multiple", "native", "onClose", "onOpen", "open", "renderValue", "SelectDisplayProps", "variant"];
6
+ const _excluded = ["autoWidth", "children", "classes", "className", "defaultOpen", "displayEmpty", "IconComponent", "id", "input", "inputProps", "label", "labelId", "MenuProps", "multiple", "native", "onClose", "onOpen", "open", "renderValue", "SelectDisplayProps", "variant"];
7
7
  import * as React from 'react';
8
8
  import PropTypes from 'prop-types';
9
9
  import clsx from 'clsx';
@@ -38,6 +38,7 @@ const Select = /*#__PURE__*/React.forwardRef(function Select(inProps, ref) {
38
38
  children,
39
39
  classes: classesProp = {},
40
40
  className,
41
+ defaultOpen = false,
41
42
  displayEmpty = false,
42
43
  IconComponent = ArrowDropDownIcon,
43
44
  id,
@@ -94,6 +95,7 @@ const Select = /*#__PURE__*/React.forwardRef(function Select(inProps, ref) {
94
95
  id
95
96
  } : {
96
97
  autoWidth,
98
+ defaultOpen,
97
99
  displayEmpty,
98
100
  labelId,
99
101
  MenuProps,
@@ -148,6 +150,13 @@ process.env.NODE_ENV !== "production" ? Select.propTypes
148
150
  */
149
151
  className: PropTypes.string,
150
152
 
153
+ /**
154
+ * If `true`, the component is initially open. Use when the component open state is not controlled (i.e. the `open` prop is not defined).
155
+ * You can only use it when the `native` prop is `false` (default).
156
+ * @default false
157
+ */
158
+ defaultOpen: PropTypes.bool,
159
+
151
160
  /**
152
161
  * The default value. Use when the component is not controlled.
153
162
  */
@@ -1,7 +1,7 @@
1
1
  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
- const _excluded = ["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"];
4
+ 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
5
  import * as React from 'react';
6
6
  import { isFragment } from 'react-is';
7
7
  import PropTypes from 'prop-types';
@@ -113,6 +113,7 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
113
113
  autoWidth,
114
114
  children,
115
115
  className,
116
+ defaultOpen,
116
117
  defaultValue,
117
118
  disabled,
118
119
  displayEmpty,
@@ -142,6 +143,11 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
142
143
  default: defaultValue,
143
144
  name: 'Select'
144
145
  });
146
+ const [openState, setOpenState] = useControlled({
147
+ controlled: openProp,
148
+ default: defaultOpen,
149
+ name: 'Select'
150
+ });
145
151
  const inputRef = React.useRef(null);
146
152
  const displayRef = React.useRef(null);
147
153
  const [displayNode, setDisplayNode] = React.useState(null);
@@ -149,7 +155,6 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
149
155
  current: isOpenControlled
150
156
  } = React.useRef(openProp != null);
151
157
  const [menuMinWidthState, setMenuMinWidthState] = React.useState();
152
- const [openState, setOpenState] = React.useState(false);
153
158
  const handleRef = useForkRef(ref, inputRefProp);
154
159
  const handleDisplayRef = React.useCallback(node => {
155
160
  displayRef.current = node;
@@ -164,7 +169,17 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
164
169
  },
165
170
  node: inputRef.current,
166
171
  value
167
- }), [value]);
172
+ }), [value]); // Resize menu on `defaultOpen` automatic toggle.
173
+
174
+ React.useEffect(() => {
175
+ if (defaultOpen && openState && displayNode && !isOpenControlled) {
176
+ setMenuMinWidthState(autoWidth ? null : displayNode.clientWidth);
177
+ displayRef.current.focus();
178
+ } // eslint-disable-next-line react-hooks/exhaustive-deps
179
+
180
+ }, [displayNode, autoWidth]); // `isOpenControlled` is ignored because the component should never switch between controlled and uncontrolled modes.
181
+ // `defaultOpen` and `openState` are ignored to avoid unnecessary callbacks.
182
+
168
183
  React.useEffect(() => {
169
184
  if (autoFocus) {
170
185
  displayRef.current.focus();
@@ -300,7 +315,7 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
300
315
  }
301
316
  };
302
317
 
303
- const open = displayNode !== null && (isOpenControlled ? openProp : openState);
318
+ const open = displayNode !== null && openState;
304
319
 
305
320
  const handleBlur = event => {
306
321
  // if open event.stopImmediatePropagation
@@ -559,6 +574,12 @@ process.env.NODE_ENV !== "production" ? SelectInput.propTypes = {
559
574
  */
560
575
  className: PropTypes.string,
561
576
 
577
+ /**
578
+ * If `true`, the component is toggled on mount. Use when the component open state is not controlled.
579
+ * You can only use it when the `native` prop is `false` (default).
580
+ */
581
+ defaultOpen: PropTypes.bool,
582
+
562
583
  /**
563
584
  * The default value. Use when the component is not controlled.
564
585
  */