@mui/material 9.0.0 → 9.1.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 (278) hide show
  1. package/Accordion/Accordion.d.mts +2 -2
  2. package/Accordion/Accordion.d.ts +2 -2
  3. package/Accordion/Accordion.js +3 -2
  4. package/Accordion/Accordion.mjs +3 -2
  5. package/AccordionSummary/AccordionSummary.js +27 -29
  6. package/AccordionSummary/AccordionSummary.mjs +27 -29
  7. package/Autocomplete/Autocomplete.js +73 -17
  8. package/Autocomplete/Autocomplete.mjs +73 -17
  9. package/Avatar/Avatar.js +4 -0
  10. package/Avatar/Avatar.mjs +4 -0
  11. package/Backdrop/Backdrop.d.mts +2 -2
  12. package/Backdrop/Backdrop.d.ts +2 -2
  13. package/Badge/Badge.js +31 -24
  14. package/Badge/Badge.mjs +31 -24
  15. package/BottomNavigationAction/BottomNavigationAction.js +6 -2
  16. package/BottomNavigationAction/BottomNavigationAction.mjs +6 -2
  17. package/Button/Button.js +19 -6
  18. package/Button/Button.mjs +19 -6
  19. package/ButtonBase/ButtonBase.d.mts +7 -0
  20. package/ButtonBase/ButtonBase.d.ts +7 -0
  21. package/ButtonBase/ButtonBase.js +5 -2
  22. package/ButtonBase/ButtonBase.mjs +5 -2
  23. package/ButtonBase/Ripple.js +21 -11
  24. package/ButtonBase/Ripple.mjs +21 -11
  25. package/ButtonBase/TouchRipple.js +252 -116
  26. package/ButtonBase/TouchRipple.mjs +253 -117
  27. package/CHANGELOG.md +216 -1245
  28. package/CardActionArea/CardActionArea.js +2 -1
  29. package/CardActionArea/CardActionArea.mjs +2 -1
  30. package/Checkbox/Checkbox.js +2 -1
  31. package/Checkbox/Checkbox.mjs +2 -1
  32. package/Chip/Chip.js +2 -1
  33. package/Chip/Chip.mjs +2 -1
  34. package/CircularProgress/CircularProgress.d.mts +12 -2
  35. package/CircularProgress/CircularProgress.d.ts +12 -2
  36. package/CircularProgress/CircularProgress.js +115 -58
  37. package/CircularProgress/CircularProgress.mjs +114 -58
  38. package/ClickAwayListener/ClickAwayListener.js +3 -6
  39. package/ClickAwayListener/ClickAwayListener.mjs +3 -6
  40. package/Collapse/Collapse.d.mts +15 -3
  41. package/Collapse/Collapse.d.ts +15 -3
  42. package/Collapse/Collapse.js +44 -31
  43. package/Collapse/Collapse.mjs +43 -30
  44. package/Dialog/Dialog.d.mts +2 -2
  45. package/Dialog/Dialog.d.ts +2 -2
  46. package/Dialog/Dialog.js +13 -6
  47. package/Dialog/Dialog.mjs +13 -6
  48. package/Drawer/Drawer.d.mts +2 -2
  49. package/Drawer/Drawer.d.ts +2 -2
  50. package/Drawer/Drawer.js +18 -4
  51. package/Drawer/Drawer.mjs +18 -4
  52. package/Fab/Fab.js +9 -2
  53. package/Fab/Fab.mjs +9 -2
  54. package/Fade/Fade.d.mts +15 -2
  55. package/Fade/Fade.d.ts +15 -2
  56. package/Fade/Fade.js +46 -19
  57. package/Fade/Fade.mjs +45 -18
  58. package/FilledInput/FilledInput.d.mts +4 -0
  59. package/FilledInput/FilledInput.d.ts +4 -0
  60. package/FilledInput/FilledInput.js +22 -23
  61. package/FilledInput/FilledInput.mjs +22 -23
  62. package/FormControl/useFormControl.d.mts +12 -2
  63. package/FormControl/useFormControl.d.ts +12 -2
  64. package/FormControl/useFormControl.js +13 -0
  65. package/FormControl/useFormControl.mjs +12 -0
  66. package/FormControlLabel/FormControlLabel.js +5 -8
  67. package/FormControlLabel/FormControlLabel.mjs +5 -8
  68. package/FormGroup/FormGroup.js +2 -5
  69. package/FormGroup/FormGroup.mjs +2 -5
  70. package/FormHelperText/FormHelperText.js +2 -5
  71. package/FormHelperText/FormHelperText.mjs +2 -5
  72. package/FormLabel/FormLabel.js +2 -5
  73. package/FormLabel/FormLabel.mjs +2 -5
  74. package/Grow/Grow.d.mts +15 -2
  75. package/Grow/Grow.d.ts +15 -2
  76. package/Grow/Grow.js +45 -28
  77. package/Grow/Grow.mjs +44 -27
  78. package/IconButton/IconButton.js +3 -9
  79. package/IconButton/IconButton.mjs +3 -9
  80. package/Input/Input.d.mts +4 -0
  81. package/Input/Input.d.ts +4 -0
  82. package/Input/Input.js +9 -2
  83. package/Input/Input.mjs +9 -2
  84. package/InputBase/InputBase.d.mts +2 -1
  85. package/InputBase/InputBase.d.ts +2 -1
  86. package/InputBase/InputBase.js +52 -16
  87. package/InputBase/InputBase.mjs +52 -16
  88. package/InputLabel/InputLabel.js +7 -9
  89. package/InputLabel/InputLabel.mjs +7 -9
  90. package/LICENSE +1 -1
  91. package/LinearProgress/LinearProgress.d.mts +12 -2
  92. package/LinearProgress/LinearProgress.d.ts +12 -2
  93. package/LinearProgress/LinearProgress.js +225 -126
  94. package/LinearProgress/LinearProgress.mjs +224 -126
  95. package/List/List.js +2 -1
  96. package/List/List.mjs +2 -1
  97. package/ListItem/ListItem.js +2 -1
  98. package/ListItem/ListItem.mjs +2 -1
  99. package/ListItemButton/ListItemButton.js +9 -2
  100. package/ListItemButton/ListItemButton.mjs +9 -2
  101. package/Menu/Menu.d.mts +1 -1
  102. package/Menu/Menu.d.ts +1 -1
  103. package/MenuItem/MenuItem.js +7 -1
  104. package/MenuItem/MenuItem.mjs +7 -1
  105. package/MenuList/MenuList.js +2 -1
  106. package/MenuList/MenuList.mjs +2 -1
  107. package/MobileStepper/MobileStepper.js +2 -1
  108. package/MobileStepper/MobileStepper.mjs +2 -1
  109. package/NativeSelect/NativeSelect.js +2 -5
  110. package/NativeSelect/NativeSelect.mjs +2 -5
  111. package/OutlinedInput/NotchedOutline.js +4 -3
  112. package/OutlinedInput/NotchedOutline.mjs +4 -3
  113. package/OutlinedInput/OutlinedInput.js +13 -23
  114. package/OutlinedInput/OutlinedInput.mjs +13 -23
  115. package/PaginationItem/PaginationItem.js +2 -1
  116. package/PaginationItem/PaginationItem.mjs +2 -1
  117. package/Paper/Paper.js +2 -1
  118. package/Paper/Paper.mjs +2 -1
  119. package/PigmentContainer/PigmentContainer.js +0 -1
  120. package/PigmentContainer/PigmentContainer.mjs +0 -1
  121. package/Popover/Popover.d.mts +1 -1
  122. package/Popover/Popover.d.ts +1 -1
  123. package/Popper/BasePopper.js +23 -1
  124. package/Popper/BasePopper.mjs +23 -1
  125. package/README.md +3 -2
  126. package/Radio/RadioButtonIcon.js +3 -2
  127. package/Radio/RadioButtonIcon.mjs +3 -2
  128. package/Rating/Rating.js +2 -1
  129. package/Rating/Rating.mjs +2 -1
  130. package/Select/Select.js +2 -5
  131. package/Select/Select.mjs +2 -5
  132. package/Select/SelectInput.js +276 -24
  133. package/Select/SelectInput.mjs +276 -24
  134. package/Select/utils/closedTypeahead.js +73 -0
  135. package/Select/utils/closedTypeahead.mjs +63 -0
  136. package/Skeleton/Skeleton.js +22 -2
  137. package/Skeleton/Skeleton.mjs +22 -2
  138. package/Slide/Slide.d.mts +15 -2
  139. package/Slide/Slide.d.ts +15 -2
  140. package/Slide/Slide.js +97 -47
  141. package/Slide/Slide.mjs +97 -47
  142. package/Slider/Slider.js +14 -4
  143. package/Slider/Slider.mjs +14 -4
  144. package/Slider/useSlider.js +4 -3
  145. package/Slider/useSlider.mjs +4 -3
  146. package/Snackbar/Snackbar.d.mts +2 -2
  147. package/Snackbar/Snackbar.d.ts +2 -2
  148. package/SpeedDial/SpeedDial.d.mts +1 -1
  149. package/SpeedDial/SpeedDial.d.ts +1 -1
  150. package/SpeedDial/SpeedDial.js +6 -2
  151. package/SpeedDial/SpeedDial.mjs +6 -2
  152. package/SpeedDialAction/SpeedDialAction.js +11 -2
  153. package/SpeedDialAction/SpeedDialAction.mjs +12 -3
  154. package/SpeedDialIcon/SpeedDialIcon.js +40 -37
  155. package/SpeedDialIcon/SpeedDialIcon.mjs +40 -37
  156. package/Step/Step.js +47 -15
  157. package/Step/Step.mjs +47 -15
  158. package/StepButton/StepButton.js +9 -3
  159. package/StepButton/StepButton.mjs +9 -3
  160. package/StepConnector/StepConnector.js +10 -0
  161. package/StepConnector/StepConnector.mjs +10 -0
  162. package/StepContent/StepContent.d.mts +2 -2
  163. package/StepContent/StepContent.d.ts +2 -2
  164. package/StepContent/StepContent.js +26 -2
  165. package/StepContent/StepContent.mjs +26 -2
  166. package/StepIcon/StepIcon.js +2 -1
  167. package/StepIcon/StepIcon.mjs +2 -1
  168. package/StepLabel/StepLabel.js +52 -7
  169. package/StepLabel/StepLabel.mjs +52 -7
  170. package/Stepper/Stepper.d.mts +2 -0
  171. package/Stepper/Stepper.d.ts +2 -0
  172. package/Stepper/Stepper.js +18 -0
  173. package/Stepper/Stepper.mjs +18 -0
  174. package/SvgIcon/SvgIcon.js +2 -1
  175. package/SvgIcon/SvgIcon.mjs +2 -1
  176. package/SwipeableDrawer/SwipeableDrawer.js +21 -6
  177. package/SwipeableDrawer/SwipeableDrawer.mjs +21 -6
  178. package/Switch/Switch.js +10 -8
  179. package/Switch/Switch.mjs +10 -8
  180. package/TableSortLabel/TableSortLabel.js +2 -1
  181. package/TableSortLabel/TableSortLabel.mjs +2 -1
  182. package/Tabs/ScrollbarSize.js +2 -1
  183. package/Tabs/ScrollbarSize.mjs +2 -1
  184. package/Tabs/Tabs.js +16 -4
  185. package/Tabs/Tabs.mjs +16 -4
  186. package/Tooltip/Tooltip.d.mts +2 -2
  187. package/Tooltip/Tooltip.d.ts +2 -2
  188. package/Tooltip/Tooltip.js +29 -108
  189. package/Tooltip/Tooltip.mjs +29 -108
  190. package/Unstable_TrapFocus/FocusTrap.js +60 -22
  191. package/Unstable_TrapFocus/FocusTrap.mjs +60 -22
  192. package/Zoom/Zoom.d.mts +15 -2
  193. package/Zoom/Zoom.d.ts +15 -2
  194. package/Zoom/Zoom.js +43 -16
  195. package/Zoom/Zoom.mjs +42 -15
  196. package/index.js +1 -1
  197. package/index.mjs +1 -1
  198. package/internal/Transition.d.mts +34 -0
  199. package/internal/Transition.d.ts +34 -0
  200. package/internal/Transition.js +444 -0
  201. package/internal/Transition.mjs +436 -0
  202. package/internal/react-transition-group.d.mts +8 -0
  203. package/internal/react-transition-group.d.ts +8 -0
  204. package/package.json +50 -50
  205. package/styles/createMotion.d.mts +8 -0
  206. package/styles/createMotion.d.ts +8 -0
  207. package/styles/createMotion.js +13 -0
  208. package/styles/createMotion.mjs +7 -0
  209. package/styles/createThemeFoundation.d.mts +2 -0
  210. package/styles/createThemeFoundation.d.ts +2 -0
  211. package/styles/createThemeNoVars.d.mts +3 -0
  212. package/styles/createThemeNoVars.d.ts +3 -0
  213. package/styles/createThemeNoVars.js +5 -0
  214. package/styles/createThemeNoVars.mjs +5 -0
  215. package/styles/createTransitions.d.mts +6 -2
  216. package/styles/createTransitions.d.ts +6 -2
  217. package/styles/createTransitions.js +12 -4
  218. package/styles/createTransitions.mjs +12 -4
  219. package/styles/enhanceHighContrast.d.mts +70 -0
  220. package/styles/enhanceHighContrast.d.ts +70 -0
  221. package/styles/enhanceHighContrast.js +502 -0
  222. package/styles/enhanceHighContrast.mjs +495 -0
  223. package/styles/index.d.mts +2 -0
  224. package/styles/index.d.ts +2 -0
  225. package/styles/index.js +8 -0
  226. package/styles/index.mjs +1 -0
  227. package/styles/reducedMotion.d.mts +7 -0
  228. package/styles/reducedMotion.d.ts +7 -0
  229. package/styles/reducedMotion.js +21 -0
  230. package/styles/reducedMotion.mjs +14 -0
  231. package/styles/responsiveFontSizes.js +19 -8
  232. package/styles/responsiveFontSizes.mjs +19 -8
  233. package/styles/shouldSkipGeneratingVar.js +1 -1
  234. package/styles/shouldSkipGeneratingVar.mjs +1 -1
  235. package/styles/stringifyTheme.js +1 -0
  236. package/styles/stringifyTheme.mjs +1 -0
  237. package/styles/useThemeProps.d.mts +3 -3
  238. package/styles/useThemeProps.d.ts +3 -3
  239. package/transitions/index.d.mts +1 -1
  240. package/transitions/index.d.ts +1 -1
  241. package/transitions/index.js +0 -11
  242. package/transitions/index.mjs +1 -1
  243. package/transitions/transition.d.mts +1 -12
  244. package/transitions/transition.d.ts +1 -12
  245. package/transitions/types.d.mts +73 -0
  246. package/transitions/types.d.ts +73 -0
  247. package/transitions/useReducedMotion.d.mts +14 -0
  248. package/transitions/useReducedMotion.d.ts +14 -0
  249. package/transitions/useReducedMotion.js +117 -0
  250. package/transitions/useReducedMotion.mjs +110 -0
  251. package/transitions/utils.d.mts +51 -2
  252. package/transitions/utils.d.ts +51 -2
  253. package/transitions/utils.js +97 -4
  254. package/transitions/utils.mjs +94 -4
  255. package/useAutocomplete/useAutocomplete.d.mts +12 -6
  256. package/useAutocomplete/useAutocomplete.d.ts +12 -6
  257. package/useAutocomplete/useAutocomplete.js +230 -55
  258. package/useAutocomplete/useAutocomplete.mjs +230 -55
  259. package/utils/contains.d.mts +2 -0
  260. package/utils/contains.d.ts +2 -0
  261. package/utils/contains.js +9 -0
  262. package/utils/contains.mjs +2 -0
  263. package/utils/focusable.d.mts +7 -0
  264. package/utils/focusable.d.ts +7 -0
  265. package/utils/focusable.js +20 -0
  266. package/utils/focusable.mjs +13 -0
  267. package/utils/getEventTarget.d.mts +2 -0
  268. package/utils/getEventTarget.d.ts +2 -0
  269. package/utils/getEventTarget.js +9 -0
  270. package/utils/getEventTarget.mjs +2 -0
  271. package/utils/mergeSlotProps.js +2 -8
  272. package/utils/mergeSlotProps.mjs +1 -8
  273. package/version/index.js +2 -2
  274. package/version/index.mjs +2 -2
  275. package/FormControl/formControlState.js +0 -21
  276. package/FormControl/formControlState.mjs +0 -15
  277. /package/transitions/{transition.js → types.js} +0 -0
  278. /package/transitions/{transition.mjs → types.mjs} +0 -0
@@ -16,19 +16,23 @@ var _refType = _interopRequireDefault(require("@mui/utils/refType"));
16
16
  var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
17
17
  var _isHostComponent = _interopRequireDefault(require("@mui/utils/isHostComponent"));
18
18
  var _TextareaAutosize = _interopRequireDefault(require("../TextareaAutosize"));
19
- var _formControlState = _interopRequireDefault(require("../FormControl/formControlState"));
20
19
  var _FormControlContext = _interopRequireDefault(require("../FormControl/FormControlContext"));
21
- var _useFormControl = _interopRequireDefault(require("../FormControl/useFormControl"));
20
+ var _useFormControl = require("../FormControl/useFormControl");
22
21
  var _zeroStyled = require("../zero-styled");
23
22
  var _memoTheme = _interopRequireDefault(require("../utils/memoTheme"));
24
23
  var _DefaultPropsProvider = require("../DefaultPropsProvider");
25
24
  var _capitalize = _interopRequireDefault(require("../utils/capitalize"));
26
25
  var _useForkRef = _interopRequireDefault(require("../utils/useForkRef"));
27
26
  var _useEnhancedEffect = _interopRequireDefault(require("../utils/useEnhancedEffect"));
27
+ var _ownerDocument = _interopRequireDefault(require("../utils/ownerDocument"));
28
+ var _getActiveElement = _interopRequireDefault(require("../utils/getActiveElement"));
28
29
  var _utils = require("./utils");
29
30
  var _inputBaseClasses = _interopRequireWildcard(require("./inputBaseClasses"));
31
+ var _utils2 = require("../transitions/utils");
30
32
  var _jsxRuntime = require("react/jsx-runtime");
31
33
  var _InputGlobalStyles;
34
+ const MUI_AUTO_FILL = 'mui-auto-fill';
35
+ const MUI_AUTO_FILL_CANCEL = 'mui-auto-fill-cancel';
32
36
  const rootOverridesResolver = (props, styles) => {
33
37
  const {
34
38
  ownerState
@@ -126,7 +130,7 @@ const InputBaseInput = exports.InputBaseInput = (0, _zeroStyled.styled)('input',
126
130
  } : {
127
131
  opacity: light ? 0.42 : 0.5
128
132
  }),
129
- transition: theme.transitions.create('opacity', {
133
+ ...(0, _utils2.getTransitionStyles)(theme, 'opacity', {
130
134
  duration: theme.transitions.duration.shorter
131
135
  })
132
136
  };
@@ -193,11 +197,11 @@ const InputBaseInput = exports.InputBaseInput = (0, _zeroStyled.styled)('input',
193
197
  ownerState
194
198
  }) => !ownerState.disableInjectingGlobalStyles,
195
199
  style: {
196
- animationName: 'mui-auto-fill-cancel',
200
+ animationName: MUI_AUTO_FILL_CANCEL,
197
201
  animationDuration: '10ms',
198
202
  '&:-webkit-autofill': {
199
203
  animationDuration: '5000s',
200
- animationName: 'mui-auto-fill'
204
+ animationName: MUI_AUTO_FILL
201
205
  }
202
206
  }
203
207
  }, {
@@ -228,14 +232,16 @@ const InputBaseInput = exports.InputBaseInput = (0, _zeroStyled.styled)('input',
228
232
  };
229
233
  }));
230
234
  const InputGlobalStyles = (0, _zeroStyled.globalCss)({
231
- '@keyframes mui-auto-fill': {
235
+ // Keep keyframes non-empty for Emotion production builds. Animation properties are ignored
236
+ // inside keyframes, avoiding the visible display animation triggered by Chrome 117+.
237
+ [`@keyframes ${MUI_AUTO_FILL}`]: {
232
238
  from: {
233
- display: 'block'
239
+ animationName: MUI_AUTO_FILL
234
240
  }
235
241
  },
236
- '@keyframes mui-auto-fill-cancel': {
242
+ [`@keyframes ${MUI_AUTO_FILL_CANCEL}`]: {
237
243
  from: {
238
- display: 'block'
244
+ animationName: MUI_AUTO_FILL_CANCEL
239
245
  }
240
246
  }
241
247
  });
@@ -252,6 +258,7 @@ const InputBase = /*#__PURE__*/React.forwardRef(function InputBase(inProps, ref)
252
258
  });
253
259
  const {
254
260
  'aria-describedby': ariaDescribedby,
261
+ 'aria-label': ariaLabel,
255
262
  autoComplete,
256
263
  autoFocus,
257
264
  className,
@@ -303,7 +310,10 @@ const InputBase = /*#__PURE__*/React.forwardRef(function InputBase(inProps, ref)
303
310
  }, []);
304
311
  const handleInputRef = (0, _useForkRef.default)(inputRef, inputRefProp, inputPropsProp.ref, handleInputRefWarning);
305
312
  const [focused, setFocused] = React.useState(false);
306
- const muiFormControl = (0, _useFormControl.default)();
313
+ const [fcs, muiFormControl] = (0, _useFormControl.useFormControlState)({
314
+ props,
315
+ states: ['color', 'disabled', 'error', 'hiddenLabel', 'size', 'required', 'filled']
316
+ });
307
317
  if (process.env.NODE_ENV !== 'production') {
308
318
  // TODO: uncomment once we enable eslint-plugin-react-compiler // eslint-disable-next-line react-compiler/react-compiler
309
319
  // eslint-disable-next-line react-hooks/rules-of-hooks
@@ -314,11 +324,6 @@ const InputBase = /*#__PURE__*/React.forwardRef(function InputBase(inProps, ref)
314
324
  return undefined;
315
325
  }, [muiFormControl]);
316
326
  }
317
- const fcs = (0, _formControlState.default)({
318
- props,
319
- muiFormControl,
320
- states: ['color', 'disabled', 'error', 'hiddenLabel', 'size', 'required', 'filled']
321
- });
322
327
  fcs.focused = muiFormControl ? muiFormControl.focused : focused;
323
328
 
324
329
  // The blur won't fire when the disabled state is set on a focused input.
@@ -349,6 +354,32 @@ const InputBase = /*#__PURE__*/React.forwardRef(function InputBase(inProps, ref)
349
354
  });
350
355
  }
351
356
  }, [value, checkDirty, isControlled]);
357
+
358
+ // Sync focused state when autoFocus is used in SSR.
359
+ // If the browser focused the element before hydration, the onFocus handler never
360
+ // fires. If it did not, React hydration does not call focus() for autoFocus.
361
+ (0, _useEnhancedEffect.default)(() => {
362
+ if (!autoFocus) {
363
+ return;
364
+ }
365
+ const input = inputRef.current;
366
+ if (!input) {
367
+ return;
368
+ }
369
+ const doc = (0, _ownerDocument.default)(input);
370
+ const activeElement = (0, _getActiveElement.default)(doc);
371
+ const noElementFocused = activeElement == null || activeElement === doc.body || activeElement === doc.documentElement;
372
+ if (input === activeElement) {
373
+ if (muiFormControl && muiFormControl.onFocus) {
374
+ muiFormControl.onFocus();
375
+ } else {
376
+ setFocused(true);
377
+ }
378
+ } else if (noElementFocused) {
379
+ input.focus();
380
+ }
381
+ // eslint-disable-next-line react-hooks/exhaustive-deps
382
+ }, [autoFocus]);
352
383
  const handleFocus = event => {
353
384
  if (onFocus) {
354
385
  onFocus(event);
@@ -437,7 +468,7 @@ const InputBase = /*#__PURE__*/React.forwardRef(function InputBase(inProps, ref)
437
468
  }
438
469
  const handleAutoFill = event => {
439
470
  // Provide a fake value as Chrome might not let you access it for security reasons.
440
- checkDirty(event.animationName === 'mui-auto-fill-cancel' ? inputRef.current : {
471
+ checkDirty(event.animationName === MUI_AUTO_FILL_CANCEL ? inputRef.current : {
441
472
  value: 'x'
442
473
  });
443
474
  };
@@ -489,6 +520,7 @@ const InputBase = /*#__PURE__*/React.forwardRef(function InputBase(inProps, ref)
489
520
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Input, {
490
521
  "aria-invalid": fcs.error,
491
522
  "aria-describedby": ariaDescribedby,
523
+ "aria-label": ariaLabel,
492
524
  autoComplete: autoComplete,
493
525
  autoFocus: autoFocus,
494
526
  defaultValue: defaultValue,
@@ -534,6 +566,10 @@ process.env.NODE_ENV !== "production" ? InputBase.propTypes /* remove-proptypes
534
566
  * @ignore
535
567
  */
536
568
  'aria-describedby': _propTypes.default.string,
569
+ /**
570
+ * @ignore
571
+ */
572
+ 'aria-label': _propTypes.default.string,
537
573
  /**
538
574
  * This prop helps users to fill forms faster, especially on mobile devices.
539
575
  * The name can be confusing, as it's more like an autofill.
@@ -10,18 +10,22 @@ import refType from '@mui/utils/refType';
10
10
  import composeClasses from '@mui/utils/composeClasses';
11
11
  import isHostComponent from '@mui/utils/isHostComponent';
12
12
  import TextareaAutosize from "../TextareaAutosize/index.mjs";
13
- import formControlState from "../FormControl/formControlState.mjs";
14
13
  import FormControlContext from "../FormControl/FormControlContext.mjs";
15
- import useFormControl from "../FormControl/useFormControl.mjs";
14
+ import { useFormControlState } from "../FormControl/useFormControl.mjs";
16
15
  import { styled, globalCss } from "../zero-styled/index.mjs";
17
16
  import memoTheme from "../utils/memoTheme.mjs";
18
17
  import { useDefaultProps } from "../DefaultPropsProvider/index.mjs";
19
18
  import capitalize from "../utils/capitalize.mjs";
20
19
  import useForkRef from "../utils/useForkRef.mjs";
21
20
  import useEnhancedEffect from "../utils/useEnhancedEffect.mjs";
21
+ import ownerDocument from "../utils/ownerDocument.mjs";
22
+ import getActiveElement from "../utils/getActiveElement.mjs";
22
23
  import { isFilled } from "./utils.mjs";
23
24
  import inputBaseClasses, { getInputBaseUtilityClass } from "./inputBaseClasses.mjs";
25
+ import { getTransitionStyles } from "../transitions/utils.mjs";
24
26
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
27
+ const MUI_AUTO_FILL = 'mui-auto-fill';
28
+ const MUI_AUTO_FILL_CANCEL = 'mui-auto-fill-cancel';
25
29
  export const rootOverridesResolver = (props, styles) => {
26
30
  const {
27
31
  ownerState
@@ -117,7 +121,7 @@ export const InputBaseInput = styled('input', {
117
121
  } : {
118
122
  opacity: light ? 0.42 : 0.5
119
123
  }),
120
- transition: theme.transitions.create('opacity', {
124
+ ...getTransitionStyles(theme, 'opacity', {
121
125
  duration: theme.transitions.duration.shorter
122
126
  })
123
127
  };
@@ -184,11 +188,11 @@ export const InputBaseInput = styled('input', {
184
188
  ownerState
185
189
  }) => !ownerState.disableInjectingGlobalStyles,
186
190
  style: {
187
- animationName: 'mui-auto-fill-cancel',
191
+ animationName: MUI_AUTO_FILL_CANCEL,
188
192
  animationDuration: '10ms',
189
193
  '&:-webkit-autofill': {
190
194
  animationDuration: '5000s',
191
- animationName: 'mui-auto-fill'
195
+ animationName: MUI_AUTO_FILL
192
196
  }
193
197
  }
194
198
  }, {
@@ -219,14 +223,16 @@ export const InputBaseInput = styled('input', {
219
223
  };
220
224
  }));
221
225
  const InputGlobalStyles = globalCss({
222
- '@keyframes mui-auto-fill': {
226
+ // Keep keyframes non-empty for Emotion production builds. Animation properties are ignored
227
+ // inside keyframes, avoiding the visible display animation triggered by Chrome 117+.
228
+ [`@keyframes ${MUI_AUTO_FILL}`]: {
223
229
  from: {
224
- display: 'block'
230
+ animationName: MUI_AUTO_FILL
225
231
  }
226
232
  },
227
- '@keyframes mui-auto-fill-cancel': {
233
+ [`@keyframes ${MUI_AUTO_FILL_CANCEL}`]: {
228
234
  from: {
229
- display: 'block'
235
+ animationName: MUI_AUTO_FILL_CANCEL
230
236
  }
231
237
  }
232
238
  });
@@ -243,6 +249,7 @@ const InputBase = /*#__PURE__*/React.forwardRef(function InputBase(inProps, ref)
243
249
  });
244
250
  const {
245
251
  'aria-describedby': ariaDescribedby,
252
+ 'aria-label': ariaLabel,
246
253
  autoComplete,
247
254
  autoFocus,
248
255
  className,
@@ -294,7 +301,10 @@ const InputBase = /*#__PURE__*/React.forwardRef(function InputBase(inProps, ref)
294
301
  }, []);
295
302
  const handleInputRef = useForkRef(inputRef, inputRefProp, inputPropsProp.ref, handleInputRefWarning);
296
303
  const [focused, setFocused] = React.useState(false);
297
- const muiFormControl = useFormControl();
304
+ const [fcs, muiFormControl] = useFormControlState({
305
+ props,
306
+ states: ['color', 'disabled', 'error', 'hiddenLabel', 'size', 'required', 'filled']
307
+ });
298
308
  if (process.env.NODE_ENV !== 'production') {
299
309
  // TODO: uncomment once we enable eslint-plugin-react-compiler // eslint-disable-next-line react-compiler/react-compiler
300
310
  // eslint-disable-next-line react-hooks/rules-of-hooks
@@ -305,11 +315,6 @@ const InputBase = /*#__PURE__*/React.forwardRef(function InputBase(inProps, ref)
305
315
  return undefined;
306
316
  }, [muiFormControl]);
307
317
  }
308
- const fcs = formControlState({
309
- props,
310
- muiFormControl,
311
- states: ['color', 'disabled', 'error', 'hiddenLabel', 'size', 'required', 'filled']
312
- });
313
318
  fcs.focused = muiFormControl ? muiFormControl.focused : focused;
314
319
 
315
320
  // The blur won't fire when the disabled state is set on a focused input.
@@ -340,6 +345,32 @@ const InputBase = /*#__PURE__*/React.forwardRef(function InputBase(inProps, ref)
340
345
  });
341
346
  }
342
347
  }, [value, checkDirty, isControlled]);
348
+
349
+ // Sync focused state when autoFocus is used in SSR.
350
+ // If the browser focused the element before hydration, the onFocus handler never
351
+ // fires. If it did not, React hydration does not call focus() for autoFocus.
352
+ useEnhancedEffect(() => {
353
+ if (!autoFocus) {
354
+ return;
355
+ }
356
+ const input = inputRef.current;
357
+ if (!input) {
358
+ return;
359
+ }
360
+ const doc = ownerDocument(input);
361
+ const activeElement = getActiveElement(doc);
362
+ const noElementFocused = activeElement == null || activeElement === doc.body || activeElement === doc.documentElement;
363
+ if (input === activeElement) {
364
+ if (muiFormControl && muiFormControl.onFocus) {
365
+ muiFormControl.onFocus();
366
+ } else {
367
+ setFocused(true);
368
+ }
369
+ } else if (noElementFocused) {
370
+ input.focus();
371
+ }
372
+ // eslint-disable-next-line react-hooks/exhaustive-deps
373
+ }, [autoFocus]);
343
374
  const handleFocus = event => {
344
375
  if (onFocus) {
345
376
  onFocus(event);
@@ -428,7 +459,7 @@ const InputBase = /*#__PURE__*/React.forwardRef(function InputBase(inProps, ref)
428
459
  }
429
460
  const handleAutoFill = event => {
430
461
  // Provide a fake value as Chrome might not let you access it for security reasons.
431
- checkDirty(event.animationName === 'mui-auto-fill-cancel' ? inputRef.current : {
462
+ checkDirty(event.animationName === MUI_AUTO_FILL_CANCEL ? inputRef.current : {
432
463
  value: 'x'
433
464
  });
434
465
  };
@@ -480,6 +511,7 @@ const InputBase = /*#__PURE__*/React.forwardRef(function InputBase(inProps, ref)
480
511
  children: /*#__PURE__*/_jsx(Input, {
481
512
  "aria-invalid": fcs.error,
482
513
  "aria-describedby": ariaDescribedby,
514
+ "aria-label": ariaLabel,
483
515
  autoComplete: autoComplete,
484
516
  autoFocus: autoFocus,
485
517
  defaultValue: defaultValue,
@@ -525,6 +557,10 @@ process.env.NODE_ENV !== "production" ? InputBase.propTypes /* remove-proptypes
525
557
  * @ignore
526
558
  */
527
559
  'aria-describedby': PropTypes.string,
560
+ /**
561
+ * @ignore
562
+ */
563
+ 'aria-label': PropTypes.string,
528
564
  /**
529
565
  * This prop helps users to fill forms faster, especially on mobile devices.
530
566
  * The name can be confusing, as it's more like an autofill.
@@ -11,8 +11,7 @@ var React = _interopRequireWildcard(require("react"));
11
11
  var _propTypes = _interopRequireDefault(require("prop-types"));
12
12
  var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
13
13
  var _clsx = _interopRequireDefault(require("clsx"));
14
- var _formControlState = _interopRequireDefault(require("../FormControl/formControlState"));
15
- var _useFormControl = _interopRequireDefault(require("../FormControl/useFormControl"));
14
+ var _useFormControl = require("../FormControl/useFormControl");
16
15
  var _FormLabel = _interopRequireWildcard(require("../FormLabel"));
17
16
  var _capitalize = _interopRequireDefault(require("../utils/capitalize"));
18
17
  var _rootShouldForwardProp = _interopRequireDefault(require("../styles/rootShouldForwardProp"));
@@ -20,6 +19,7 @@ var _zeroStyled = require("../zero-styled");
20
19
  var _memoTheme = _interopRequireDefault(require("../utils/memoTheme"));
21
20
  var _DefaultPropsProvider = require("../DefaultPropsProvider");
22
21
  var _inputLabelClasses = require("./inputLabelClasses");
22
+ var _utils = require("../transitions/utils");
23
23
  var _jsxRuntime = require("react/jsx-runtime");
24
24
  const useUtilityClasses = ownerState => {
25
25
  const {
@@ -96,7 +96,7 @@ const InputLabelRoot = (0, _zeroStyled.styled)(_FormLabel.default, {
96
96
  ownerState
97
97
  }) => !ownerState.disableAnimation,
98
98
  style: {
99
- transition: theme.transitions.create(['color', 'transform', 'max-width'], {
99
+ ...(0, _utils.getTransitionStyles)(theme, ['color', 'transform', 'max-width'], {
100
100
  duration: theme.transitions.duration.shorter,
101
101
  easing: theme.transitions.easing.easeOut
102
102
  })
@@ -190,16 +190,14 @@ const InputLabel = /*#__PURE__*/React.forwardRef(function InputLabel(inProps, re
190
190
  className,
191
191
  ...other
192
192
  } = props;
193
- const muiFormControl = (0, _useFormControl.default)();
193
+ const [fcs, muiFormControl] = (0, _useFormControl.useFormControlState)({
194
+ props,
195
+ states: ['size', 'variant', 'required', 'focused']
196
+ });
194
197
  let shrink = shrinkProp;
195
198
  if (typeof shrink === 'undefined' && muiFormControl) {
196
199
  shrink = muiFormControl.filled || muiFormControl.focused || muiFormControl.adornedStart;
197
200
  }
198
- const fcs = (0, _formControlState.default)({
199
- props,
200
- muiFormControl,
201
- states: ['size', 'variant', 'required', 'focused']
202
- });
203
201
  const ownerState = {
204
202
  ...props,
205
203
  disableAnimation,
@@ -4,8 +4,7 @@ import * as React from 'react';
4
4
  import PropTypes from 'prop-types';
5
5
  import composeClasses from '@mui/utils/composeClasses';
6
6
  import clsx from 'clsx';
7
- import formControlState from "../FormControl/formControlState.mjs";
8
- import useFormControl from "../FormControl/useFormControl.mjs";
7
+ import { useFormControlState } from "../FormControl/useFormControl.mjs";
9
8
  import FormLabel, { formLabelClasses } from "../FormLabel/index.mjs";
10
9
  import capitalize from "../utils/capitalize.mjs";
11
10
  import rootShouldForwardProp from "../styles/rootShouldForwardProp.mjs";
@@ -13,6 +12,7 @@ import { styled } from "../zero-styled/index.mjs";
13
12
  import memoTheme from "../utils/memoTheme.mjs";
14
13
  import { useDefaultProps } from "../DefaultPropsProvider/index.mjs";
15
14
  import { getInputLabelUtilityClasses } from "./inputLabelClasses.mjs";
15
+ import { getTransitionStyles } from "../transitions/utils.mjs";
16
16
  import { jsx as _jsx } from "react/jsx-runtime";
17
17
  const useUtilityClasses = ownerState => {
18
18
  const {
@@ -89,7 +89,7 @@ const InputLabelRoot = styled(FormLabel, {
89
89
  ownerState
90
90
  }) => !ownerState.disableAnimation,
91
91
  style: {
92
- transition: theme.transitions.create(['color', 'transform', 'max-width'], {
92
+ ...getTransitionStyles(theme, ['color', 'transform', 'max-width'], {
93
93
  duration: theme.transitions.duration.shorter,
94
94
  easing: theme.transitions.easing.easeOut
95
95
  })
@@ -183,16 +183,14 @@ const InputLabel = /*#__PURE__*/React.forwardRef(function InputLabel(inProps, re
183
183
  className,
184
184
  ...other
185
185
  } = props;
186
- const muiFormControl = useFormControl();
186
+ const [fcs, muiFormControl] = useFormControlState({
187
+ props,
188
+ states: ['size', 'variant', 'required', 'focused']
189
+ });
187
190
  let shrink = shrinkProp;
188
191
  if (typeof shrink === 'undefined' && muiFormControl) {
189
192
  shrink = muiFormControl.filled || muiFormControl.focused || muiFormControl.adornedStart;
190
193
  }
191
- const fcs = formControlState({
192
- props,
193
- muiFormControl,
194
- states: ['size', 'variant', 'required', 'focused']
195
- });
196
194
  const ownerState = {
197
195
  ...props,
198
196
  disableAnimation,
package/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- The MIT License (MIT)
1
+ MIT License
2
2
 
3
3
  Copyright (c) 2014 Call-Em-All
4
4
 
@@ -18,18 +18,28 @@ export interface LinearProgressProps extends StandardProps<React.HTMLAttributes<
18
18
  * @default 'primary'
19
19
  */
20
20
  color?: OverridableStringUnion<'primary' | 'secondary' | 'error' | 'info' | 'success' | 'warning' | 'inherit', LinearProgressPropsColorOverrides> | undefined;
21
+ /**
22
+ * The maximum value for the progress indicator for the determinate and buffer variants.
23
+ * @default 100
24
+ */
25
+ max?: number | undefined;
26
+ /**
27
+ * The minimum value for the progress indicator for the determinate and buffer variants.
28
+ * @default 0
29
+ */
30
+ min?: number | undefined;
21
31
  /**
22
32
  * The system prop that allows defining system overrides as well as additional CSS styles.
23
33
  */
24
34
  sx?: SxProps<Theme> | undefined;
25
35
  /**
26
36
  * The value of the progress indicator for the determinate and buffer variants.
27
- * Value between 0 and 100.
37
+ * Value between `min` and `max`.
28
38
  */
29
39
  value?: number | undefined;
30
40
  /**
31
41
  * The value for the buffer variant.
32
- * Value between 0 and 100.
42
+ * Value between `min` and `max`.
33
43
  */
34
44
  valueBuffer?: number | undefined;
35
45
  /**
@@ -18,18 +18,28 @@ export interface LinearProgressProps extends StandardProps<React.HTMLAttributes<
18
18
  * @default 'primary'
19
19
  */
20
20
  color?: OverridableStringUnion<'primary' | 'secondary' | 'error' | 'info' | 'success' | 'warning' | 'inherit', LinearProgressPropsColorOverrides> | undefined;
21
+ /**
22
+ * The maximum value for the progress indicator for the determinate and buffer variants.
23
+ * @default 100
24
+ */
25
+ max?: number | undefined;
26
+ /**
27
+ * The minimum value for the progress indicator for the determinate and buffer variants.
28
+ * @default 0
29
+ */
30
+ min?: number | undefined;
21
31
  /**
22
32
  * The system prop that allows defining system overrides as well as additional CSS styles.
23
33
  */
24
34
  sx?: SxProps<Theme> | undefined;
25
35
  /**
26
36
  * The value of the progress indicator for the determinate and buffer variants.
27
- * Value between 0 and 100.
37
+ * Value between `min` and `max`.
28
38
  */
29
39
  value?: number | undefined;
30
40
  /**
31
41
  * The value for the buffer variant.
32
- * Value between 0 and 100.
42
+ * Value between `min` and `max`.
33
43
  */
34
44
  valueBuffer?: number | undefined;
35
45
  /**