@mui/material 7.3.5 → 7.3.7

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 (105) hide show
  1. package/Accordion/Accordion.d.ts +56 -55
  2. package/Accordion/Accordion.js +3 -13
  3. package/Alert/Alert.js +1 -1
  4. package/AppBar/AppBar.d.ts +13 -2
  5. package/AppBar/AppBar.js +14 -2
  6. package/Backdrop/Backdrop.js +0 -1
  7. package/Button/Button.d.ts +1 -0
  8. package/ButtonBase/ButtonBase.js +8 -1
  9. package/ButtonBase/TouchRipple.js +1 -1
  10. package/ButtonGroup/ButtonGroup.js +8 -11
  11. package/CHANGELOG.md +144 -1
  12. package/CardActionArea/CardActionArea.js +0 -1
  13. package/Chip/Chip.js +1 -1
  14. package/CssBaseline/CssBaseline.d.ts +1 -1
  15. package/CssBaseline/CssBaseline.js +1 -1
  16. package/Dialog/Dialog.js +4 -3
  17. package/Dialog/dialogClasses.d.ts +2 -0
  18. package/Dialog/dialogClasses.js +1 -1
  19. package/FormControl/FormControl.d.ts +1 -0
  20. package/FormHelperText/FormHelperText.d.ts +1 -0
  21. package/FormLabel/FormLabel.d.ts +1 -0
  22. package/IconButton/IconButton.d.ts +1 -0
  23. package/InputLabel/InputLabel.d.ts +1 -0
  24. package/ListItem/ListItem.d.ts +5 -0
  25. package/ListItem/ListItem.js +19 -4
  26. package/MenuList/MenuList.js +2 -1
  27. package/Modal/ModalManager.js +1 -1
  28. package/OutlinedInput/OutlinedInput.d.ts +1 -0
  29. package/README.md +2 -2
  30. package/ScopedCssBaseline/ScopedCssBaseline.d.ts +1 -1
  31. package/ScopedCssBaseline/ScopedCssBaseline.js +1 -1
  32. package/Select/SelectInput.d.ts +2 -0
  33. package/Select/SelectInput.js +25 -4
  34. package/Slider/Slider.d.ts +1 -1
  35. package/Slider/useSlider.types.d.ts +1 -1
  36. package/Snackbar/Snackbar.js +1 -3
  37. package/Tabs/Tabs.d.ts +1 -1
  38. package/Tabs/Tabs.js +4 -3
  39. package/TextField/TextField.d.ts +10 -5
  40. package/Unstable_TrapFocus/FocusTrap.js +13 -8
  41. package/esm/Accordion/Accordion.d.ts +56 -55
  42. package/esm/Accordion/Accordion.js +3 -13
  43. package/esm/Alert/Alert.js +1 -1
  44. package/esm/AppBar/AppBar.d.ts +13 -2
  45. package/esm/AppBar/AppBar.js +14 -2
  46. package/esm/Backdrop/Backdrop.js +0 -1
  47. package/esm/Button/Button.d.ts +1 -0
  48. package/esm/ButtonBase/ButtonBase.js +8 -1
  49. package/esm/ButtonBase/TouchRipple.js +1 -1
  50. package/esm/ButtonGroup/ButtonGroup.js +8 -11
  51. package/esm/CardActionArea/CardActionArea.js +0 -1
  52. package/esm/Chip/Chip.js +1 -1
  53. package/esm/CssBaseline/CssBaseline.d.ts +1 -1
  54. package/esm/CssBaseline/CssBaseline.js +1 -1
  55. package/esm/Dialog/Dialog.js +4 -3
  56. package/esm/Dialog/dialogClasses.d.ts +2 -0
  57. package/esm/Dialog/dialogClasses.js +1 -1
  58. package/esm/FormControl/FormControl.d.ts +1 -0
  59. package/esm/FormHelperText/FormHelperText.d.ts +1 -0
  60. package/esm/FormLabel/FormLabel.d.ts +1 -0
  61. package/esm/IconButton/IconButton.d.ts +1 -0
  62. package/esm/InputLabel/InputLabel.d.ts +1 -0
  63. package/esm/ListItem/ListItem.d.ts +5 -0
  64. package/esm/ListItem/ListItem.js +19 -4
  65. package/esm/MenuList/MenuList.js +2 -1
  66. package/esm/Modal/ModalManager.js +1 -1
  67. package/esm/OutlinedInput/OutlinedInput.d.ts +1 -0
  68. package/esm/ScopedCssBaseline/ScopedCssBaseline.d.ts +1 -1
  69. package/esm/ScopedCssBaseline/ScopedCssBaseline.js +1 -1
  70. package/esm/Select/SelectInput.d.ts +2 -0
  71. package/esm/Select/SelectInput.js +25 -4
  72. package/esm/Slider/Slider.d.ts +1 -1
  73. package/esm/Slider/useSlider.types.d.ts +1 -1
  74. package/esm/Snackbar/Snackbar.js +1 -3
  75. package/esm/Tabs/Tabs.d.ts +1 -1
  76. package/esm/Tabs/Tabs.js +4 -3
  77. package/esm/TextField/TextField.d.ts +10 -5
  78. package/esm/Unstable_TrapFocus/FocusTrap.js +13 -8
  79. package/esm/index.js +1 -1
  80. package/esm/internal/SwitchBase.js +1 -1
  81. package/esm/locale/arEG.js +1 -1
  82. package/esm/locale/arSA.js +1 -1
  83. package/esm/locale/arSD.js +1 -1
  84. package/esm/locale/kuCKB.js +1 -1
  85. package/esm/locale/neNP.js +1 -1
  86. package/esm/styles/createThemeNoVars.d.ts +4 -3
  87. package/esm/styles/createThemeWithVars.d.ts +2 -2
  88. package/esm/useAutocomplete/useAutocomplete.js +62 -16
  89. package/esm/utils/getActiveElement.d.ts +2 -0
  90. package/esm/utils/getActiveElement.js +2 -0
  91. package/esm/version/index.js +2 -2
  92. package/index.js +1 -1
  93. package/internal/SwitchBase.js +1 -1
  94. package/locale/arEG.js +1 -1
  95. package/locale/arSA.js +1 -1
  96. package/locale/arSD.js +1 -1
  97. package/locale/kuCKB.js +1 -1
  98. package/locale/neNP.js +1 -1
  99. package/package.json +8 -8
  100. package/styles/createThemeNoVars.d.ts +4 -3
  101. package/styles/createThemeWithVars.d.ts +2 -2
  102. package/useAutocomplete/useAutocomplete.js +62 -16
  103. package/utils/getActiveElement.d.ts +2 -0
  104. package/utils/getActiveElement.js +9 -0
  105. package/version/index.js +2 -2
@@ -47,22 +47,27 @@ export interface TextFieldSlots {
47
47
  */
48
48
  select: React.ElementType;
49
49
  }
50
+ export interface TextFieldRootSlotPropsOverrides {}
51
+ export interface TextFieldInputSlotPropsOverrides {}
52
+ export interface TextFieldInputLabelSlotPropsOverrides {}
53
+ export interface TextFieldFormHelperTextSlotPropsOverrides {}
54
+ export interface TextFieldSelectSlotPropsOverrides {}
50
55
  export type TextFieldSlotsAndSlotProps<InputPropsType> = CreateSlotsAndSlotProps<TextFieldSlots, {
51
56
  /**
52
57
  * Props forwarded to the root slot.
53
58
  * By default, the available props are based on the [FormControl](https://mui.com/material-ui/api/form-control/#props) component.
54
59
  */
55
- root: SlotProps<React.ElementType<FormControlProps>, {}, TextFieldOwnerState>;
60
+ root: SlotProps<React.ElementType<FormControlProps>, TextFieldRootSlotPropsOverrides, TextFieldOwnerState>;
56
61
  /**
57
62
  * Props forwarded to the input slot.
58
63
  * By default, the available props are based on the [Input](https://mui.com/material-ui/api/input/#props) component.
59
64
  */
60
- input: SlotProps<React.ElementType<InputPropsType>, {}, TextFieldOwnerState>;
65
+ input: SlotProps<React.ElementType<InputPropsType>, TextFieldInputSlotPropsOverrides, TextFieldOwnerState>;
61
66
  /**
62
67
  * Props forwarded to the input label slot.
63
68
  * By default, the available props are based on the [InputLabel](https://mui.com/material-ui/api/input-label/#props) component.
64
69
  */
65
- inputLabel: SlotProps<React.ElementType<InputLabelProps>, {}, TextFieldOwnerState>;
70
+ inputLabel: SlotProps<React.ElementType<InputLabelProps>, TextFieldInputLabelSlotPropsOverrides, TextFieldOwnerState>;
66
71
  /**
67
72
  * Props forwarded to the html input slot.
68
73
  * By default, the available props are based on the html input element.
@@ -72,12 +77,12 @@ export type TextFieldSlotsAndSlotProps<InputPropsType> = CreateSlotsAndSlotProps
72
77
  * Props forwarded to the form helper text slot.
73
78
  * By default, the available props are based on the [FormHelperText](https://mui.com/material-ui/api/form-helper-text/#props) component.
74
79
  */
75
- formHelperText: SlotProps<React.ElementType<FormHelperTextProps>, {}, TextFieldOwnerState>;
80
+ formHelperText: SlotProps<React.ElementType<FormHelperTextProps>, TextFieldFormHelperTextSlotPropsOverrides, TextFieldOwnerState>;
76
81
  /**
77
82
  * Props forwarded to the select slot.
78
83
  * By default, the available props are based on the [Select](https://mui.com/material-ui/api/select/#props) component.
79
84
  */
80
- select: SlotProps<React.ElementType<SelectProps>, {}, TextFieldOwnerState>;
85
+ select: SlotProps<React.ElementType<SelectProps>, TextFieldSelectSlotPropsOverrides, TextFieldOwnerState>;
81
86
  }>;
82
87
  export interface BaseTextFieldProps extends StandardProps<FormControlProps,
83
88
  // event handlers are declared on derived interfaces
@@ -8,6 +8,7 @@ import ownerDocument from '@mui/utils/ownerDocument';
8
8
  import getReactElementRef from '@mui/utils/getReactElementRef';
9
9
  import exactProp from '@mui/utils/exactProp';
10
10
  import elementAcceptingRef from '@mui/utils/elementAcceptingRef';
11
+ import getActiveElement from "../utils/getActiveElement.js";
11
12
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
12
13
  // Inspired by https://github.com/focus-trap/tabbable
13
14
  const candidatesSelector = ['input', 'select', 'textarea', 'a[href]', 'button', '[tabindex]', 'audio[controls]', 'video[controls]', '[contenteditable]:not([contenteditable="false"])'].join(',');
@@ -111,7 +112,8 @@ function FocusTrap(props) {
111
112
  return;
112
113
  }
113
114
  const doc = ownerDocument(rootRef.current);
114
- if (!rootRef.current.contains(doc.activeElement)) {
115
+ const activeElement = getActiveElement(doc);
116
+ if (!rootRef.current.contains(activeElement)) {
115
117
  if (!rootRef.current.hasAttribute('tabIndex')) {
116
118
  if (process.env.NODE_ENV !== 'production') {
117
119
  console.error(['MUI: The modal content node does not accept focus.', 'For the benefit of assistive technologies, ' + 'the tabIndex of the node is being set to "-1".'].join('\n'));
@@ -151,10 +153,11 @@ function FocusTrap(props) {
151
153
  if (disableEnforceFocus || !isEnabled() || nativeEvent.key !== 'Tab') {
152
154
  return;
153
155
  }
156
+ const activeElement = getActiveElement(doc);
154
157
 
155
158
  // Make sure the next tab starts from the right place.
156
- // doc.activeElement refers to the origin.
157
- if (doc.activeElement === rootRef.current && nativeEvent.shiftKey) {
159
+ // activeElement refers to the origin.
160
+ if (activeElement === rootRef.current && nativeEvent.shiftKey) {
158
161
  // We need to ignore the next contain as
159
162
  // it will try to move the focus back to the rootRef element.
160
163
  ignoreNextEnforceFocus.current = true;
@@ -171,23 +174,24 @@ function FocusTrap(props) {
171
174
  if (rootElement === null) {
172
175
  return;
173
176
  }
177
+ const activeEl = getActiveElement(doc);
174
178
  if (!doc.hasFocus() || !isEnabled() || ignoreNextEnforceFocus.current) {
175
179
  ignoreNextEnforceFocus.current = false;
176
180
  return;
177
181
  }
178
182
 
179
183
  // The focus is already inside
180
- if (rootElement.contains(doc.activeElement)) {
184
+ if (rootElement.contains(activeEl)) {
181
185
  return;
182
186
  }
183
187
 
184
188
  // The disableEnforceFocus is set and the focus is outside of the focus trap (and sentinel nodes)
185
- if (disableEnforceFocus && doc.activeElement !== sentinelStart.current && doc.activeElement !== sentinelEnd.current) {
189
+ if (disableEnforceFocus && activeEl !== sentinelStart.current && activeEl !== sentinelEnd.current) {
186
190
  return;
187
191
  }
188
192
 
189
193
  // if the focus event is not coming from inside the children's react tree, reset the refs
190
- if (doc.activeElement !== reactFocusEventTarget.current) {
194
+ if (activeEl !== reactFocusEventTarget.current) {
191
195
  reactFocusEventTarget.current = null;
192
196
  } else if (reactFocusEventTarget.current !== null) {
193
197
  return;
@@ -196,7 +200,7 @@ function FocusTrap(props) {
196
200
  return;
197
201
  }
198
202
  let tabbable = [];
199
- if (doc.activeElement === sentinelStart.current || doc.activeElement === sentinelEnd.current) {
203
+ if (activeEl === sentinelStart.current || activeEl === sentinelEnd.current) {
200
204
  tabbable = getTabbable(rootRef.current);
201
205
  }
202
206
 
@@ -228,7 +232,8 @@ function FocusTrap(props) {
228
232
  // The whatwg spec defines how the browser should behave but does not explicitly mention any events:
229
233
  // https://html.spec.whatwg.org/multipage/interaction.html#focus-fixup-rule.
230
234
  const interval = setInterval(() => {
231
- if (doc.activeElement && doc.activeElement.tagName === 'BODY') {
235
+ const activeEl = getActiveElement(doc);
236
+ if (activeEl && activeEl.tagName === 'BODY') {
232
237
  contain();
233
238
  }
234
239
  }, 50);
package/esm/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/material v7.3.5
2
+ * @mui/material v7.3.7
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -135,7 +135,7 @@ const SwitchBase = /*#__PURE__*/React.forwardRef(function SwitchBase(props, ref)
135
135
  };
136
136
  const handleInputChange = event => {
137
137
  // Workaround for https://github.com/facebook/react/issues/9023
138
- if (event.nativeEvent.defaultPrevented) {
138
+ if (event.nativeEvent.defaultPrevented || readOnly) {
139
139
  return;
140
140
  }
141
141
  const newChecked = event.target.checked;
@@ -38,7 +38,7 @@ export const arEG = {
38
38
  defaultProps: {
39
39
  clearText: 'مسح',
40
40
  closeText: 'إغلاق',
41
- loadingText: 'جار التحميل...',
41
+ loadingText: 'جار التحميل…',
42
42
  noOptionsText: 'لا يوجد خيارات',
43
43
  openText: 'فتح'
44
44
  }
@@ -38,7 +38,7 @@ export const arSA = {
38
38
  defaultProps: {
39
39
  clearText: 'مسح',
40
40
  closeText: 'إغلاق',
41
- loadingText: 'جار التحميل...',
41
+ loadingText: 'جار التحميل…',
42
42
  noOptionsText: 'لا توجد خيارات',
43
43
  openText: 'فتح'
44
44
  }
@@ -38,7 +38,7 @@ export const arSD = {
38
38
  defaultProps: {
39
39
  clearText: 'مسح',
40
40
  closeText: 'إغلاق',
41
- loadingText: 'جار التحميل...',
41
+ loadingText: 'جار التحميل…',
42
42
  noOptionsText: 'لا يوجد خيارات',
43
43
  openText: 'فتح'
44
44
  }
@@ -38,7 +38,7 @@ export const kuCKB = {
38
38
  defaultProps: {
39
39
  clearText: 'سڕینەوە',
40
40
  closeText: 'داخستن',
41
- loadingText: 'لە بارکردندایە...',
41
+ loadingText: 'لە بارکردندایە…',
42
42
  noOptionsText: 'هیچ بژاردەیەک نیە',
43
43
  openText: 'کردنەوە'
44
44
  }
@@ -42,7 +42,7 @@ export const neNP = {
42
42
  defaultProps: {
43
43
  clearText: 'खाली गर्नुहोस्',
44
44
  closeText: 'बन्द गर्नुहोस्',
45
- loadingText: 'लोड हुँदै...',
45
+ loadingText: 'लोड हुँदै…',
46
46
  noOptionsText: 'कुनै विकल्प छैन',
47
47
  openText: 'खोल्नुहोस्'
48
48
  }
@@ -1,4 +1,4 @@
1
- import { ThemeOptions as SystemThemeOptions, Theme as SystemTheme, SxProps, CSSObject, SxConfig } from '@mui/system';
1
+ import { ThemeOptions as SystemThemeOptions, Theme as SystemTheme, SxProps, CSSObject, SxConfig, ApplyStyles } from '@mui/system';
2
2
  import { Mixins, MixinsOptions } from "./createMixins.js";
3
3
  import { Palette, PaletteOptions } from "./createPalette.js";
4
4
  import { TypographyVariants, TypographyVariantsOptions } from "./createTypography.js";
@@ -6,7 +6,7 @@ import { Shadows } from "./shadows.js";
6
6
  import { Transitions, TransitionsOptions } from "./createTransitions.js";
7
7
  import { ZIndex, ZIndexOptions } from "./zIndex.js";
8
8
  import { Components } from "./components.js";
9
- import { CssVarsTheme, CssVarsPalette, ColorSystemOptions, Shape, ShapeOptions } from "./createThemeFoundation.js";
9
+ import { CssVarsTheme, CssVarsPalette, ColorSystemOptions, Shape, ShapeOptions, SupportedColorScheme } from "./createThemeFoundation.js";
10
10
 
11
11
  /**
12
12
  * To disable custom properties, use module augmentation
@@ -46,13 +46,14 @@ export interface BaseTheme extends SystemTheme {
46
46
  typography: TypographyVariants;
47
47
  zIndex: ZIndex;
48
48
  unstable_strictMode?: boolean;
49
+ applyStyles: ApplyStyles<SupportedColorScheme>;
49
50
  }
50
51
 
51
52
  // shut off automatic exporting for the `BaseTheme` above
52
53
  export {};
53
54
  type CssVarsProperties = CssThemeVariables extends {
54
55
  enabled: true;
55
- } ? Pick<CssVarsTheme, 'applyStyles' | 'colorSchemes' | 'colorSchemeSelector' | 'rootSelector' | 'cssVarPrefix' | 'defaultColorScheme' | 'getCssVar' | 'getColorSchemeSelector' | 'generateThemeVars' | 'generateStyleSheets' | 'generateSpacing' | 'shouldSkipGeneratingVar' | 'vars'> : Partial<Pick<CssVarsTheme, 'vars'>>;
56
+ } ? Pick<CssVarsTheme, 'colorSchemes' | 'colorSchemeSelector' | 'rootSelector' | 'cssVarPrefix' | 'defaultColorScheme' | 'getCssVar' | 'getColorSchemeSelector' | 'generateThemeVars' | 'generateStyleSheets' | 'generateSpacing' | 'shouldSkipGeneratingVar' | 'vars'> : Partial<Pick<CssVarsTheme, 'vars'>>;
56
57
 
57
58
  /**
58
59
  * Our [TypeScript guide on theme customization](https://mui.com/material-ui/guides/typescript/#customization-of-theme) explains in detail how you would add custom properties.
@@ -9,7 +9,7 @@ export interface CssVarsThemeOptions extends Omit<ThemeOptions, 'palette' | 'com
9
9
  * The strategy to generate CSS variables
10
10
  *
11
11
  * @example 'media'
12
- * Generate CSS variables using [prefers-color-scheme](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme)
12
+ * Generate CSS variables using [prefers-color-scheme](https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/At-rules/@media/prefers-color-scheme)
13
13
  *
14
14
  * @example '.mode-%s'
15
15
  * Generate CSS variables within a class .mode-light, .mode-dark
@@ -25,7 +25,7 @@ export interface CssVarsThemeOptions extends Omit<ThemeOptions, 'palette' | 'com
25
25
  cssVarPrefix?: string;
26
26
  /**
27
27
  * If `true`, the CSS color-scheme will not be set.
28
- * https://developer.mozilla.org/en-US/docs/Web/CSS/color-scheme
28
+ * https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Properties/color-scheme
29
29
  * @default false
30
30
  */
31
31
  disableCssColorScheme?: boolean;
@@ -465,7 +465,7 @@ function useAutocomplete(props) {
465
465
  filteredOptions.length,
466
466
  // Don't sync the highlighted index with the value when multiple
467
467
  // eslint-disable-next-line react-hooks/exhaustive-deps
468
- multiple ? false : value, filterSelectedOptions, changeHighlightedIndex, setHighlightedIndex, popupOpen, inputValue, multiple]);
468
+ multiple ? false : value, changeHighlightedIndex, setHighlightedIndex, popupOpen, inputValue, multiple]);
469
469
  const handleListboxRef = useEventCallback(node => {
470
470
  setRef(listboxRef, node);
471
471
  if (!node) {
@@ -584,9 +584,17 @@ function useAutocomplete(props) {
584
584
  handleClose(event, 'toggleInput');
585
585
  }
586
586
  let nextItem = focusedItem;
587
- if (focusedItem === -1) {
588
- if (inputValue === '' && direction === 'previous') {
589
- nextItem = value.length - 1;
587
+
588
+ // When moving focus from the input to tags with ArrowLeft,
589
+ // always jump to the last tag (if any) from the input.
590
+ if (focusedItem === -1 && direction === 'previous') {
591
+ nextItem = value.length - 1;
592
+ // In freeSolo, clear any draft text so it doesn't "come back" later.
593
+ if (freeSolo && inputValue !== '') {
594
+ setInputValueState('');
595
+ if (onInputChange) {
596
+ onInputChange(event, '', 'reset');
597
+ }
590
598
  }
591
599
  } else {
592
600
  nextItem += direction === 'next' ? 1 : -1;
@@ -693,14 +701,37 @@ function useAutocomplete(props) {
693
701
  handleOpen(event);
694
702
  break;
695
703
  case 'ArrowLeft':
696
- if (!multiple && renderValue) {
697
- focusItem(0);
698
- } else {
699
- handleFocusItem(event, 'previous');
704
+ {
705
+ const input = inputRef.current;
706
+ // Only handle ArrowLeft when the caret is at the start of the input.
707
+ // Otherwise let the browser move the caret normally.
708
+ const caretAtStart = input && input.selectionStart === 0 && input.selectionEnd === 0;
709
+ if (!caretAtStart) {
710
+ // Let the browser handle normal cursor movement
711
+ return;
712
+ }
713
+
714
+ // Single-value rendering: move focus from input to the single tag.
715
+ if (!multiple && renderValue && value != null) {
716
+ // Moving from input to single tag; clear freeSolo draft text,
717
+ // so it doesn't reappear when we move back.
718
+ if (freeSolo && inputValue !== '') {
719
+ setInputValueState('');
720
+ if (onInputChange) {
721
+ onInputChange(event, '', 'reset');
722
+ }
723
+ }
724
+ setFocusedItem(0);
725
+ focusItem(0);
726
+ } else {
727
+ // Multi-value: delegate to tag navigation helper.
728
+ handleFocusItem(event, 'previous');
729
+ }
730
+ break;
700
731
  }
701
- break;
702
732
  case 'ArrowRight':
703
733
  if (!multiple && renderValue) {
734
+ setFocusedItem(-1);
704
735
  focusItem(-1);
705
736
  } else {
706
737
  handleFocusItem(event, 'next');
@@ -755,9 +786,10 @@ function useAutocomplete(props) {
755
786
  option: value[index]
756
787
  });
757
788
  }
758
- if (!multiple && renderValue && !readOnly) {
759
- setValueState(null);
760
- focusItem(-1);
789
+ if (!multiple && renderValue && !readOnly && inputValue === '') {
790
+ handleValue(event, null, 'removeOption', {
791
+ option: value
792
+ });
761
793
  }
762
794
  break;
763
795
  case 'Delete':
@@ -770,9 +802,12 @@ function useAutocomplete(props) {
770
802
  option: value[index]
771
803
  });
772
804
  }
773
- if (!multiple && renderValue && !readOnly) {
774
- setValueState(null);
775
- focusItem(-1);
805
+ if (!multiple && renderValue && !readOnly && inputValue === '') {
806
+ // Single-value rendering: Delete on empty input removes
807
+ // the single rendered option, same "removeOption" reason as multiple.
808
+ handleValue(event, null, 'removeOption', {
809
+ option: value
810
+ });
776
811
  }
777
812
  break;
778
813
  default:
@@ -781,6 +816,15 @@ function useAutocomplete(props) {
781
816
  };
782
817
  const handleFocus = event => {
783
818
  setFocused(true);
819
+
820
+ // When focusing the input, ensure any previously focused item (chip)
821
+ // is cleared so the input receives the visible caret and the
822
+ // input-focused styling is applied.
823
+ if (focusedItem !== -1) {
824
+ setFocusedItem(-1);
825
+ // Ensure DOM focus lands on the input
826
+ focusItem(-1);
827
+ }
784
828
  if (openOnFocus && !ignoreFocus.current) {
785
829
  handleOpen(event);
786
830
  }
@@ -813,7 +857,9 @@ function useAutocomplete(props) {
813
857
  }
814
858
  }
815
859
  if (newValue === '') {
816
- if (!disableClearable && !multiple) {
860
+ // For normal single-select, clearing the input clears the value.
861
+ // For renderValue (chip-style single), only Backspace/Delete clear the value.
862
+ if (!disableClearable && !multiple && !renderValue) {
817
863
  handleValue(event, null, 'clear');
818
864
  }
819
865
  } else {
@@ -0,0 +1,2 @@
1
+ import getActiveElement from '@mui/utils/getActiveElement';
2
+ export default getActiveElement;
@@ -0,0 +1,2 @@
1
+ import getActiveElement from '@mui/utils/getActiveElement';
2
+ export default getActiveElement;
@@ -1,6 +1,6 @@
1
- export const version = "7.3.5";
1
+ export const version = "7.3.7";
2
2
  export const major = Number("7");
3
3
  export const minor = Number("3");
4
- export const patch = Number("5");
4
+ export const patch = Number("7");
5
5
  export const prerelease = undefined;
6
6
  export default version;
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/material v7.3.5
2
+ * @mui/material v7.3.7
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -142,7 +142,7 @@ const SwitchBase = /*#__PURE__*/React.forwardRef(function SwitchBase(props, ref)
142
142
  };
143
143
  const handleInputChange = event => {
144
144
  // Workaround for https://github.com/facebook/react/issues/9023
145
- if (event.nativeEvent.defaultPrevented) {
145
+ if (event.nativeEvent.defaultPrevented || readOnly) {
146
146
  return;
147
147
  }
148
148
  const newChecked = event.target.checked;
package/locale/arEG.js CHANGED
@@ -44,7 +44,7 @@ const arEG = exports.arEG = {
44
44
  defaultProps: {
45
45
  clearText: 'مسح',
46
46
  closeText: 'إغلاق',
47
- loadingText: 'جار التحميل...',
47
+ loadingText: 'جار التحميل…',
48
48
  noOptionsText: 'لا يوجد خيارات',
49
49
  openText: 'فتح'
50
50
  }
package/locale/arSA.js CHANGED
@@ -44,7 +44,7 @@ const arSA = exports.arSA = {
44
44
  defaultProps: {
45
45
  clearText: 'مسح',
46
46
  closeText: 'إغلاق',
47
- loadingText: 'جار التحميل...',
47
+ loadingText: 'جار التحميل…',
48
48
  noOptionsText: 'لا توجد خيارات',
49
49
  openText: 'فتح'
50
50
  }
package/locale/arSD.js CHANGED
@@ -44,7 +44,7 @@ const arSD = exports.arSD = {
44
44
  defaultProps: {
45
45
  clearText: 'مسح',
46
46
  closeText: 'إغلاق',
47
- loadingText: 'جار التحميل...',
47
+ loadingText: 'جار التحميل…',
48
48
  noOptionsText: 'لا يوجد خيارات',
49
49
  openText: 'فتح'
50
50
  }
package/locale/kuCKB.js CHANGED
@@ -44,7 +44,7 @@ const kuCKB = exports.kuCKB = {
44
44
  defaultProps: {
45
45
  clearText: 'سڕینەوە',
46
46
  closeText: 'داخستن',
47
- loadingText: 'لە بارکردندایە...',
47
+ loadingText: 'لە بارکردندایە…',
48
48
  noOptionsText: 'هیچ بژاردەیەک نیە',
49
49
  openText: 'کردنەوە'
50
50
  }
package/locale/neNP.js CHANGED
@@ -48,7 +48,7 @@ const neNP = exports.neNP = {
48
48
  defaultProps: {
49
49
  clearText: 'खाली गर्नुहोस्',
50
50
  closeText: 'बन्द गर्नुहोस्',
51
- loadingText: 'लोड हुँदै...',
51
+ loadingText: 'लोड हुँदै…',
52
52
  noOptionsText: 'कुनै विकल्प छैन',
53
53
  openText: 'खोल्नुहोस्'
54
54
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/material",
3
- "version": "7.3.5",
3
+ "version": "7.3.7",
4
4
  "author": "MUI Team",
5
5
  "description": "Material UI is an open-source React component library that implements Google's Material Design. It's comprehensive and can be used in production out of the box.",
6
6
  "keywords": [
@@ -29,14 +29,14 @@
29
29
  "@popperjs/core": "^2.11.8",
30
30
  "@types/react-transition-group": "^4.4.12",
31
31
  "clsx": "^2.1.1",
32
- "csstype": "^3.1.3",
32
+ "csstype": "^3.2.3",
33
33
  "prop-types": "^15.8.1",
34
- "react-is": "^19.2.0",
34
+ "react-is": "^19.2.3",
35
35
  "react-transition-group": "^4.4.5",
36
- "@mui/core-downloads-tracker": "^7.3.5",
37
- "@mui/system": "^7.3.5",
38
- "@mui/types": "^7.4.8",
39
- "@mui/utils": "^7.3.5"
36
+ "@mui/core-downloads-tracker": "^7.3.7",
37
+ "@mui/system": "^7.3.7",
38
+ "@mui/utils": "^7.3.7",
39
+ "@mui/types": "^7.4.10"
40
40
  },
41
41
  "peerDependencies": {
42
42
  "@emotion/react": "^11.5.0",
@@ -44,7 +44,7 @@
44
44
  "@types/react": "^17.0.0 || ^18.0.0 || ^19.0.0",
45
45
  "react": "^17.0.0 || ^18.0.0 || ^19.0.0",
46
46
  "react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0",
47
- "@mui/material-pigment-css": "^7.3.5"
47
+ "@mui/material-pigment-css": "^7.3.7"
48
48
  },
49
49
  "peerDependenciesMeta": {
50
50
  "@types/react": {
@@ -1,4 +1,4 @@
1
- import { ThemeOptions as SystemThemeOptions, Theme as SystemTheme, SxProps, CSSObject, SxConfig } from '@mui/system';
1
+ import { ThemeOptions as SystemThemeOptions, Theme as SystemTheme, SxProps, CSSObject, SxConfig, ApplyStyles } from '@mui/system';
2
2
  import { Mixins, MixinsOptions } from "./createMixins.js";
3
3
  import { Palette, PaletteOptions } from "./createPalette.js";
4
4
  import { TypographyVariants, TypographyVariantsOptions } from "./createTypography.js";
@@ -6,7 +6,7 @@ import { Shadows } from "./shadows.js";
6
6
  import { Transitions, TransitionsOptions } from "./createTransitions.js";
7
7
  import { ZIndex, ZIndexOptions } from "./zIndex.js";
8
8
  import { Components } from "./components.js";
9
- import { CssVarsTheme, CssVarsPalette, ColorSystemOptions, Shape, ShapeOptions } from "./createThemeFoundation.js";
9
+ import { CssVarsTheme, CssVarsPalette, ColorSystemOptions, Shape, ShapeOptions, SupportedColorScheme } from "./createThemeFoundation.js";
10
10
 
11
11
  /**
12
12
  * To disable custom properties, use module augmentation
@@ -46,13 +46,14 @@ export interface BaseTheme extends SystemTheme {
46
46
  typography: TypographyVariants;
47
47
  zIndex: ZIndex;
48
48
  unstable_strictMode?: boolean;
49
+ applyStyles: ApplyStyles<SupportedColorScheme>;
49
50
  }
50
51
 
51
52
  // shut off automatic exporting for the `BaseTheme` above
52
53
  export {};
53
54
  type CssVarsProperties = CssThemeVariables extends {
54
55
  enabled: true;
55
- } ? Pick<CssVarsTheme, 'applyStyles' | 'colorSchemes' | 'colorSchemeSelector' | 'rootSelector' | 'cssVarPrefix' | 'defaultColorScheme' | 'getCssVar' | 'getColorSchemeSelector' | 'generateThemeVars' | 'generateStyleSheets' | 'generateSpacing' | 'shouldSkipGeneratingVar' | 'vars'> : Partial<Pick<CssVarsTheme, 'vars'>>;
56
+ } ? Pick<CssVarsTheme, 'colorSchemes' | 'colorSchemeSelector' | 'rootSelector' | 'cssVarPrefix' | 'defaultColorScheme' | 'getCssVar' | 'getColorSchemeSelector' | 'generateThemeVars' | 'generateStyleSheets' | 'generateSpacing' | 'shouldSkipGeneratingVar' | 'vars'> : Partial<Pick<CssVarsTheme, 'vars'>>;
56
57
 
57
58
  /**
58
59
  * Our [TypeScript guide on theme customization](https://mui.com/material-ui/guides/typescript/#customization-of-theme) explains in detail how you would add custom properties.
@@ -9,7 +9,7 @@ export interface CssVarsThemeOptions extends Omit<ThemeOptions, 'palette' | 'com
9
9
  * The strategy to generate CSS variables
10
10
  *
11
11
  * @example 'media'
12
- * Generate CSS variables using [prefers-color-scheme](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme)
12
+ * Generate CSS variables using [prefers-color-scheme](https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/At-rules/@media/prefers-color-scheme)
13
13
  *
14
14
  * @example '.mode-%s'
15
15
  * Generate CSS variables within a class .mode-light, .mode-dark
@@ -25,7 +25,7 @@ export interface CssVarsThemeOptions extends Omit<ThemeOptions, 'palette' | 'com
25
25
  cssVarPrefix?: string;
26
26
  /**
27
27
  * If `true`, the CSS color-scheme will not be set.
28
- * https://developer.mozilla.org/en-US/docs/Web/CSS/color-scheme
28
+ * https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Properties/color-scheme
29
29
  * @default false
30
30
  */
31
31
  disableCssColorScheme?: boolean;