@mui/material 9.0.1 → 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 (206) 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 +8 -6
  8. package/Autocomplete/Autocomplete.mjs +8 -6
  9. package/Backdrop/Backdrop.d.mts +2 -2
  10. package/Backdrop/Backdrop.d.ts +2 -2
  11. package/Badge/Badge.js +28 -24
  12. package/Badge/Badge.mjs +28 -24
  13. package/BottomNavigationAction/BottomNavigationAction.js +6 -2
  14. package/BottomNavigationAction/BottomNavigationAction.mjs +6 -2
  15. package/Button/Button.js +11 -15
  16. package/Button/Button.mjs +11 -15
  17. package/ButtonBase/Ripple.js +21 -11
  18. package/ButtonBase/Ripple.mjs +21 -11
  19. package/ButtonBase/TouchRipple.js +252 -116
  20. package/ButtonBase/TouchRipple.mjs +253 -117
  21. package/CHANGELOG.md +84 -0
  22. package/CardActionArea/CardActionArea.js +2 -1
  23. package/CardActionArea/CardActionArea.mjs +2 -1
  24. package/Chip/Chip.js +2 -1
  25. package/Chip/Chip.mjs +2 -1
  26. package/CircularProgress/CircularProgress.js +85 -55
  27. package/CircularProgress/CircularProgress.mjs +84 -55
  28. package/Collapse/Collapse.d.mts +15 -3
  29. package/Collapse/Collapse.d.ts +15 -3
  30. package/Collapse/Collapse.js +44 -31
  31. package/Collapse/Collapse.mjs +43 -30
  32. package/Dialog/Dialog.d.mts +2 -2
  33. package/Dialog/Dialog.d.ts +2 -2
  34. package/Dialog/Dialog.js +2 -0
  35. package/Dialog/Dialog.mjs +2 -0
  36. package/Drawer/Drawer.d.mts +2 -2
  37. package/Drawer/Drawer.d.ts +2 -2
  38. package/Fab/Fab.js +2 -1
  39. package/Fab/Fab.mjs +2 -1
  40. package/Fade/Fade.d.mts +15 -2
  41. package/Fade/Fade.d.ts +15 -2
  42. package/Fade/Fade.js +46 -19
  43. package/Fade/Fade.mjs +45 -18
  44. package/FilledInput/FilledInput.js +4 -3
  45. package/FilledInput/FilledInput.mjs +4 -3
  46. package/Grow/Grow.d.mts +15 -2
  47. package/Grow/Grow.d.ts +15 -2
  48. package/Grow/Grow.js +45 -28
  49. package/Grow/Grow.mjs +44 -27
  50. package/IconButton/IconButton.js +2 -1
  51. package/IconButton/IconButton.mjs +2 -1
  52. package/Input/Input.js +3 -2
  53. package/Input/Input.mjs +3 -2
  54. package/InputBase/InputBase.js +2 -1
  55. package/InputBase/InputBase.mjs +2 -1
  56. package/InputLabel/InputLabel.js +2 -1
  57. package/InputLabel/InputLabel.mjs +2 -1
  58. package/LICENSE +1 -1
  59. package/LinearProgress/LinearProgress.js +187 -120
  60. package/LinearProgress/LinearProgress.mjs +186 -120
  61. package/ListItem/ListItem.js +2 -1
  62. package/ListItem/ListItem.mjs +2 -1
  63. package/ListItemButton/ListItemButton.js +2 -1
  64. package/ListItemButton/ListItemButton.mjs +2 -1
  65. package/Menu/Menu.d.mts +1 -1
  66. package/Menu/Menu.d.ts +1 -1
  67. package/MobileStepper/MobileStepper.js +2 -1
  68. package/MobileStepper/MobileStepper.mjs +2 -1
  69. package/OutlinedInput/NotchedOutline.js +4 -3
  70. package/OutlinedInput/NotchedOutline.mjs +4 -3
  71. package/PaginationItem/PaginationItem.js +2 -1
  72. package/PaginationItem/PaginationItem.mjs +2 -1
  73. package/Paper/Paper.js +2 -1
  74. package/Paper/Paper.mjs +2 -1
  75. package/Popover/Popover.d.mts +1 -1
  76. package/Popover/Popover.d.ts +1 -1
  77. package/README.md +3 -2
  78. package/Radio/RadioButtonIcon.js +3 -2
  79. package/Radio/RadioButtonIcon.mjs +3 -2
  80. package/Rating/Rating.js +2 -1
  81. package/Rating/Rating.mjs +2 -1
  82. package/Select/SelectInput.js +115 -25
  83. package/Select/SelectInput.mjs +115 -25
  84. package/Select/utils/closedTypeahead.js +73 -0
  85. package/Select/utils/closedTypeahead.mjs +63 -0
  86. package/Skeleton/Skeleton.js +22 -2
  87. package/Skeleton/Skeleton.mjs +22 -2
  88. package/Slide/Slide.d.mts +15 -2
  89. package/Slide/Slide.d.ts +15 -2
  90. package/Slide/Slide.js +53 -25
  91. package/Slide/Slide.mjs +52 -24
  92. package/Slider/Slider.js +4 -3
  93. package/Slider/Slider.mjs +4 -3
  94. package/Slider/useSlider.js +1 -1
  95. package/Slider/useSlider.mjs +1 -1
  96. package/Snackbar/Snackbar.d.mts +2 -2
  97. package/Snackbar/Snackbar.d.ts +2 -2
  98. package/SpeedDial/SpeedDial.d.mts +1 -1
  99. package/SpeedDial/SpeedDial.d.ts +1 -1
  100. package/SpeedDial/SpeedDial.js +6 -2
  101. package/SpeedDial/SpeedDial.mjs +6 -2
  102. package/SpeedDialAction/SpeedDialAction.js +11 -2
  103. package/SpeedDialAction/SpeedDialAction.mjs +12 -3
  104. package/SpeedDialIcon/SpeedDialIcon.js +40 -37
  105. package/SpeedDialIcon/SpeedDialIcon.mjs +40 -37
  106. package/Step/Step.js +47 -15
  107. package/Step/Step.mjs +47 -15
  108. package/StepButton/StepButton.js +9 -3
  109. package/StepButton/StepButton.mjs +9 -3
  110. package/StepConnector/StepConnector.js +10 -0
  111. package/StepConnector/StepConnector.mjs +10 -0
  112. package/StepContent/StepContent.d.mts +2 -2
  113. package/StepContent/StepContent.d.ts +2 -2
  114. package/StepContent/StepContent.js +26 -2
  115. package/StepContent/StepContent.mjs +26 -2
  116. package/StepIcon/StepIcon.js +2 -1
  117. package/StepIcon/StepIcon.mjs +2 -1
  118. package/StepLabel/StepLabel.js +52 -7
  119. package/StepLabel/StepLabel.mjs +52 -7
  120. package/Stepper/Stepper.d.mts +2 -0
  121. package/Stepper/Stepper.d.ts +2 -0
  122. package/Stepper/Stepper.js +18 -0
  123. package/Stepper/Stepper.mjs +18 -0
  124. package/SvgIcon/SvgIcon.js +2 -1
  125. package/SvgIcon/SvgIcon.mjs +2 -1
  126. package/SwipeableDrawer/SwipeableDrawer.js +14 -3
  127. package/SwipeableDrawer/SwipeableDrawer.mjs +14 -3
  128. package/Switch/Switch.js +3 -2
  129. package/Switch/Switch.mjs +3 -2
  130. package/TableSortLabel/TableSortLabel.js +2 -1
  131. package/TableSortLabel/TableSortLabel.mjs +2 -1
  132. package/Tabs/Tabs.js +14 -3
  133. package/Tabs/Tabs.mjs +14 -3
  134. package/Tooltip/Tooltip.d.mts +2 -2
  135. package/Tooltip/Tooltip.d.ts +2 -2
  136. package/Tooltip/Tooltip.js +3 -0
  137. package/Tooltip/Tooltip.mjs +3 -0
  138. package/Unstable_TrapFocus/FocusTrap.js +42 -8
  139. package/Unstable_TrapFocus/FocusTrap.mjs +42 -8
  140. package/Zoom/Zoom.d.mts +15 -2
  141. package/Zoom/Zoom.d.ts +15 -2
  142. package/Zoom/Zoom.js +43 -16
  143. package/Zoom/Zoom.mjs +42 -15
  144. package/index.js +1 -1
  145. package/index.mjs +1 -1
  146. package/internal/Transition.d.mts +34 -0
  147. package/internal/Transition.d.ts +34 -0
  148. package/internal/Transition.js +444 -0
  149. package/internal/Transition.mjs +436 -0
  150. package/internal/react-transition-group.d.mts +8 -0
  151. package/internal/react-transition-group.d.ts +8 -0
  152. package/package.json +6 -6
  153. package/styles/createMotion.d.mts +8 -0
  154. package/styles/createMotion.d.ts +8 -0
  155. package/styles/createMotion.js +13 -0
  156. package/styles/createMotion.mjs +7 -0
  157. package/styles/createThemeFoundation.d.mts +2 -0
  158. package/styles/createThemeFoundation.d.ts +2 -0
  159. package/styles/createThemeNoVars.d.mts +3 -0
  160. package/styles/createThemeNoVars.d.ts +3 -0
  161. package/styles/createThemeNoVars.js +5 -0
  162. package/styles/createThemeNoVars.mjs +5 -0
  163. package/styles/createTransitions.d.mts +6 -2
  164. package/styles/createTransitions.d.ts +6 -2
  165. package/styles/createTransitions.js +12 -4
  166. package/styles/createTransitions.mjs +12 -4
  167. package/styles/enhanceHighContrast.d.mts +70 -0
  168. package/styles/enhanceHighContrast.d.ts +70 -0
  169. package/styles/enhanceHighContrast.js +502 -0
  170. package/styles/enhanceHighContrast.mjs +495 -0
  171. package/styles/index.d.mts +2 -0
  172. package/styles/index.d.ts +2 -0
  173. package/styles/index.js +8 -0
  174. package/styles/index.mjs +1 -0
  175. package/styles/reducedMotion.d.mts +7 -0
  176. package/styles/reducedMotion.d.ts +7 -0
  177. package/styles/reducedMotion.js +21 -0
  178. package/styles/reducedMotion.mjs +14 -0
  179. package/styles/shouldSkipGeneratingVar.js +1 -1
  180. package/styles/shouldSkipGeneratingVar.mjs +1 -1
  181. package/styles/stringifyTheme.js +1 -0
  182. package/styles/stringifyTheme.mjs +1 -0
  183. package/transitions/index.d.mts +1 -1
  184. package/transitions/index.d.ts +1 -1
  185. package/transitions/index.js +0 -11
  186. package/transitions/index.mjs +1 -1
  187. package/transitions/transition.d.mts +1 -12
  188. package/transitions/transition.d.ts +1 -12
  189. package/transitions/types.d.mts +73 -0
  190. package/transitions/types.d.ts +73 -0
  191. package/transitions/useReducedMotion.d.mts +14 -0
  192. package/transitions/useReducedMotion.d.ts +14 -0
  193. package/transitions/useReducedMotion.js +117 -0
  194. package/transitions/useReducedMotion.mjs +110 -0
  195. package/transitions/utils.d.mts +34 -2
  196. package/transitions/utils.d.ts +34 -2
  197. package/transitions/utils.js +33 -4
  198. package/transitions/utils.mjs +31 -4
  199. package/useAutocomplete/useAutocomplete.d.mts +8 -1
  200. package/useAutocomplete/useAutocomplete.d.ts +8 -1
  201. package/useAutocomplete/useAutocomplete.js +66 -4
  202. package/useAutocomplete/useAutocomplete.mjs +66 -4
  203. package/version/index.js +3 -3
  204. package/version/index.mjs +3 -3
  205. /package/transitions/{transition.js → types.js} +0 -0
  206. /package/transitions/{transition.mjs → types.mjs} +0 -0
@@ -0,0 +1,495 @@
1
+ import accordionSummaryClasses from "../AccordionSummary/accordionSummaryClasses.mjs";
2
+ import autocompleteClasses from "../Autocomplete/autocompleteClasses.mjs";
3
+ import checkboxClasses from "../Checkbox/checkboxClasses.mjs";
4
+ import filledInputClasses from "../FilledInput/filledInputClasses.mjs";
5
+ import formControlLabelClasses from "../FormControlLabel/formControlLabelClasses.mjs";
6
+ import formHelperTextClasses from "../FormHelperText/formHelperTextClasses.mjs";
7
+ import formLabelClasses from "../FormLabel/formLabelClasses.mjs";
8
+ import inputClasses from "../Input/inputClasses.mjs";
9
+ import listItemButtonClasses from "../ListItemButton/listItemButtonClasses.mjs";
10
+ import menuItemClasses from "../MenuItem/menuItemClasses.mjs";
11
+ import nativeSelectClasses from "../NativeSelect/nativeSelectClasses.mjs";
12
+ import outlinedInputClasses from "../OutlinedInput/outlinedInputClasses.mjs";
13
+ import radioClasses from "../Radio/radioClasses.mjs";
14
+ import sliderClasses from "../Slider/sliderClasses.mjs";
15
+ import toggleButtonClasses from "../ToggleButton/toggleButtonClasses.mjs";
16
+ // System color keywords used in forced-colors / high contrast mode.
17
+ const defaultHcTokens = {
18
+ disabled: 'GrayText',
19
+ error: 'ActiveText',
20
+ selectedBackground: 'SelectedItem',
21
+ selectedText: 'SelectedItemText',
22
+ activeBackground: 'Highlight',
23
+ activeText: 'HighlightText',
24
+ buttonBorder: 'ButtonBorder',
25
+ buttonText: 'ButtonText',
26
+ canvas: 'Canvas'
27
+ };
28
+ const HCM = '@media (forced-colors: active)';
29
+
30
+ /**
31
+ * Enhances a theme with styles for Windows High Contrast Mode (forced-colors).
32
+ *
33
+ * Accepts a fully-created theme, merges in HCM component overrides using arrays
34
+ * so that Emotion emits each entry as a separate CSS rule and the browser
35
+ * cascade (rather than JS object merging) resolves specificity.
36
+ *
37
+ * @param themeInput - The theme to enhance.
38
+ * @param tokens - Override any of the default system color tokens.
39
+ * @returns The enhanced theme (same type as the input).
40
+ *
41
+ * @example
42
+ * // Use defaults
43
+ * const theme = enhanceHighContrast(createTheme({ palette: { ... } }));
44
+ *
45
+ * @example
46
+ * // Override specific tokens
47
+ * const theme = enhanceHighContrast(createTheme(), { disabled: 'ButtonText' });
48
+ */
49
+ export default function enhanceHighContrast(themeInput, tokens) {
50
+ const hcTokens = {
51
+ disabled: tokens?.disabled ?? defaultHcTokens.disabled,
52
+ error: tokens?.error ?? defaultHcTokens.error,
53
+ selectedBackground: tokens?.selectedBackground ?? defaultHcTokens.selectedBackground,
54
+ selectedText: tokens?.selectedText ?? defaultHcTokens.selectedText,
55
+ activeBackground: tokens?.activeBackground ?? defaultHcTokens.activeBackground,
56
+ activeText: tokens?.activeText ?? defaultHcTokens.activeText,
57
+ buttonBorder: tokens?.buttonBorder ?? defaultHcTokens.buttonBorder,
58
+ buttonText: tokens?.buttonText ?? defaultHcTokens.buttonText,
59
+ canvas: tokens?.canvas ?? defaultHcTokens.canvas
60
+ };
61
+ const theme = {
62
+ ...themeInput
63
+ };
64
+ const c = theme.components;
65
+ theme.components = {
66
+ ...c,
67
+ MuiAccordionSummary: {
68
+ ...c?.MuiAccordionSummary,
69
+ styleOverrides: {
70
+ ...c?.MuiAccordionSummary?.styleOverrides,
71
+ root: [c?.MuiAccordionSummary?.styleOverrides?.root, {
72
+ [`&.${accordionSummaryClasses.disabled}`]: {
73
+ [HCM]: {
74
+ opacity: 1
75
+ }
76
+ }
77
+ }]
78
+ }
79
+ },
80
+ MuiAutocomplete: {
81
+ ...c?.MuiAutocomplete,
82
+ styleOverrides: {
83
+ ...c?.MuiAutocomplete?.styleOverrides,
84
+ listbox: [c?.MuiAutocomplete?.styleOverrides?.listbox, {
85
+ [`& .${autocompleteClasses.option}`]: {
86
+ '&[aria-disabled="true"]': {
87
+ [HCM]: {
88
+ color: hcTokens.disabled,
89
+ opacity: 1
90
+ }
91
+ },
92
+ [`&.${autocompleteClasses.focused}, &.${autocompleteClasses.focusVisible}`]: {
93
+ [HCM]: {
94
+ forcedColorAdjust: 'none',
95
+ color: hcTokens.activeText,
96
+ backgroundColor: hcTokens.activeBackground
97
+ }
98
+ },
99
+ '&[aria-selected="true"]': {
100
+ [HCM]: {
101
+ forcedColorAdjust: 'none',
102
+ color: hcTokens.selectedText,
103
+ backgroundColor: hcTokens.selectedBackground
104
+ },
105
+ [`&.${autocompleteClasses.focused}`]: {
106
+ [HCM]: {
107
+ color: hcTokens.activeText,
108
+ backgroundColor: hcTokens.activeBackground
109
+ }
110
+ }
111
+ }
112
+ }
113
+ }]
114
+ }
115
+ },
116
+ MuiCheckbox: {
117
+ ...c?.MuiCheckbox,
118
+ styleOverrides: {
119
+ ...c?.MuiCheckbox?.styleOverrides,
120
+ root: [c?.MuiCheckbox?.styleOverrides?.root, {
121
+ [`&.${checkboxClasses.disabled}`]: {
122
+ [HCM]: {
123
+ color: hcTokens.disabled
124
+ }
125
+ }
126
+ }]
127
+ }
128
+ },
129
+ MuiFilledInput: {
130
+ ...c?.MuiFilledInput,
131
+ styleOverrides: {
132
+ ...c?.MuiFilledInput?.styleOverrides,
133
+ root: [c?.MuiFilledInput?.styleOverrides?.root, {
134
+ [`&.${filledInputClasses.error}`]: {
135
+ '&::before, &::after': {
136
+ [HCM]: {
137
+ borderBottomColor: hcTokens.error
138
+ }
139
+ }
140
+ },
141
+ [`&.${filledInputClasses.disabled}:before`]: {
142
+ [HCM]: {
143
+ borderBottomStyle: 'solid',
144
+ borderBottomColor: hcTokens.disabled
145
+ }
146
+ },
147
+ [`&.${filledInputClasses.disabled}`]: {
148
+ [HCM]: {
149
+ color: hcTokens.disabled
150
+ }
151
+ }
152
+ }]
153
+ }
154
+ },
155
+ MuiFormControlLabel: {
156
+ ...c?.MuiFormControlLabel,
157
+ styleOverrides: {
158
+ ...c?.MuiFormControlLabel?.styleOverrides,
159
+ root: [c?.MuiFormControlLabel?.styleOverrides?.root, {
160
+ [`& .${formControlLabelClasses.label}.${formControlLabelClasses.disabled}`]: {
161
+ [HCM]: {
162
+ color: hcTokens.disabled
163
+ }
164
+ }
165
+ }]
166
+ }
167
+ },
168
+ MuiFormHelperText: {
169
+ ...c?.MuiFormHelperText,
170
+ styleOverrides: {
171
+ ...c?.MuiFormHelperText?.styleOverrides,
172
+ root: [c?.MuiFormHelperText?.styleOverrides?.root, {
173
+ [`&.${formHelperTextClasses.error}`]: {
174
+ [HCM]: {
175
+ color: hcTokens.error
176
+ }
177
+ },
178
+ [`&.${formHelperTextClasses.disabled}`]: {
179
+ [HCM]: {
180
+ color: hcTokens.disabled
181
+ }
182
+ }
183
+ }]
184
+ }
185
+ },
186
+ MuiFormLabel: {
187
+ ...c?.MuiFormLabel,
188
+ styleOverrides: {
189
+ ...c?.MuiFormLabel?.styleOverrides,
190
+ root: [c?.MuiFormLabel?.styleOverrides?.root, {
191
+ [`&.${formLabelClasses.error}`]: {
192
+ [HCM]: {
193
+ color: hcTokens.error
194
+ }
195
+ },
196
+ [`&.${formLabelClasses.disabled}`]: {
197
+ [HCM]: {
198
+ color: hcTokens.disabled
199
+ }
200
+ }
201
+ }]
202
+ }
203
+ },
204
+ MuiInput: {
205
+ ...c?.MuiInput,
206
+ styleOverrides: {
207
+ ...c?.MuiInput?.styleOverrides,
208
+ root: [c?.MuiInput?.styleOverrides?.root, {
209
+ [`&.${inputClasses.error}`]: {
210
+ '&::before, &::after': {
211
+ [HCM]: {
212
+ borderBottomColor: hcTokens.error
213
+ }
214
+ }
215
+ },
216
+ [`&.${inputClasses.disabled}:before`]: {
217
+ [HCM]: {
218
+ borderBottomStyle: 'solid',
219
+ borderBottomColor: hcTokens.disabled
220
+ }
221
+ },
222
+ [`&.${inputClasses.disabled}`]: {
223
+ [HCM]: {
224
+ color: hcTokens.disabled
225
+ }
226
+ }
227
+ }]
228
+ }
229
+ },
230
+ MuiLinearProgress: {
231
+ ...c?.MuiLinearProgress,
232
+ styleOverrides: {
233
+ ...c?.MuiLinearProgress?.styleOverrides,
234
+ root: [c?.MuiLinearProgress?.styleOverrides?.root, {
235
+ [HCM]: {
236
+ forcedColorAdjust: 'none',
237
+ outline: `1px solid ${hcTokens.buttonBorder}`,
238
+ backgroundColor: hcTokens.canvas
239
+ }
240
+ }],
241
+ bar: [c?.MuiLinearProgress?.styleOverrides?.bar, {
242
+ [HCM]: {
243
+ backgroundColor: hcTokens.buttonText
244
+ }
245
+ }],
246
+ bar2: [c?.MuiLinearProgress?.styleOverrides?.bar2, {
247
+ variants: [{
248
+ props: {
249
+ variant: 'buffer'
250
+ },
251
+ style: {
252
+ [HCM]: {
253
+ backgroundColor: hcTokens.disabled
254
+ }
255
+ }
256
+ }]
257
+ }]
258
+ }
259
+ },
260
+ MuiInputBase: {
261
+ ...c?.MuiInputBase,
262
+ styleOverrides: {
263
+ ...c?.MuiInputBase?.styleOverrides,
264
+ input: [c?.MuiInputBase?.styleOverrides?.input, {
265
+ [HCM]: {
266
+ '&::placeholder': {
267
+ opacity: 1
268
+ }
269
+ }
270
+ }]
271
+ }
272
+ },
273
+ MuiMenuItem: {
274
+ ...c?.MuiMenuItem,
275
+ styleOverrides: {
276
+ ...c?.MuiMenuItem?.styleOverrides,
277
+ root: [c?.MuiMenuItem?.styleOverrides?.root, {
278
+ [`&.${menuItemClasses.disabled}`]: {
279
+ [HCM]: {
280
+ color: hcTokens.disabled,
281
+ opacity: 1
282
+ }
283
+ },
284
+ [`&.${menuItemClasses.focusVisible}, &:hover`]: {
285
+ [HCM]: {
286
+ forcedColorAdjust: 'none',
287
+ color: hcTokens.activeText,
288
+ backgroundColor: hcTokens.activeBackground,
289
+ outline: 'none'
290
+ }
291
+ },
292
+ [`&.${menuItemClasses.selected}`]: {
293
+ [HCM]: {
294
+ forcedColorAdjust: 'none',
295
+ color: hcTokens.selectedText,
296
+ backgroundColor: hcTokens.selectedBackground
297
+ }
298
+ },
299
+ [`&.${menuItemClasses.selected}.${menuItemClasses.focusVisible}, &.${menuItemClasses.selected}:hover`]: {
300
+ [HCM]: {
301
+ color: hcTokens.activeText,
302
+ backgroundColor: hcTokens.activeBackground
303
+ }
304
+ }
305
+ }]
306
+ }
307
+ },
308
+ MuiListItemIcon: {
309
+ ...c?.MuiListItemIcon,
310
+ styleOverrides: {
311
+ ...c?.MuiListItemIcon?.styleOverrides,
312
+ root: [c?.MuiListItemIcon?.styleOverrides?.root, {
313
+ [HCM]: {
314
+ color: 'inherit'
315
+ }
316
+ }]
317
+ }
318
+ },
319
+ MuiListItemButton: {
320
+ ...c?.MuiListItemButton,
321
+ styleOverrides: {
322
+ ...c?.MuiListItemButton?.styleOverrides,
323
+ root: [c?.MuiListItemButton?.styleOverrides?.root, {
324
+ [`&.${listItemButtonClasses.focusVisible}, &:hover`]: {
325
+ [HCM]: {
326
+ forcedColorAdjust: 'none',
327
+ color: hcTokens.activeText,
328
+ backgroundColor: hcTokens.activeBackground
329
+ }
330
+ },
331
+ [`&.${listItemButtonClasses.selected}`]: {
332
+ [HCM]: {
333
+ forcedColorAdjust: 'none',
334
+ color: hcTokens.selectedText,
335
+ backgroundColor: hcTokens.selectedBackground
336
+ }
337
+ },
338
+ [`&.${listItemButtonClasses.selected}.${listItemButtonClasses.focusVisible}, &.${listItemButtonClasses.selected}:hover`]: {
339
+ [HCM]: {
340
+ color: hcTokens.activeText,
341
+ backgroundColor: hcTokens.activeBackground
342
+ }
343
+ }
344
+ }]
345
+ }
346
+ },
347
+ MuiNativeSelect: {
348
+ ...c?.MuiNativeSelect,
349
+ styleOverrides: {
350
+ ...c?.MuiNativeSelect?.styleOverrides,
351
+ icon: [c?.MuiNativeSelect?.styleOverrides?.icon, {
352
+ [`&.${nativeSelectClasses.disabled}`]: {
353
+ [HCM]: {
354
+ color: hcTokens.disabled
355
+ }
356
+ }
357
+ }]
358
+ }
359
+ },
360
+ MuiOutlinedInput: {
361
+ ...c?.MuiOutlinedInput,
362
+ styleOverrides: {
363
+ ...c?.MuiOutlinedInput?.styleOverrides,
364
+ root: [c?.MuiOutlinedInput?.styleOverrides?.root, {
365
+ [`&.${outlinedInputClasses.error} .${outlinedInputClasses.notchedOutline}`]: {
366
+ [HCM]: {
367
+ borderColor: hcTokens.error
368
+ }
369
+ },
370
+ [`&.${outlinedInputClasses.disabled} .${outlinedInputClasses.notchedOutline}`]: {
371
+ [HCM]: {
372
+ borderColor: hcTokens.disabled
373
+ }
374
+ },
375
+ [`&.${outlinedInputClasses.disabled}`]: {
376
+ [HCM]: {
377
+ color: hcTokens.disabled
378
+ }
379
+ }
380
+ }]
381
+ }
382
+ },
383
+ MuiRadio: {
384
+ ...c?.MuiRadio,
385
+ styleOverrides: {
386
+ ...c?.MuiRadio?.styleOverrides,
387
+ root: [c?.MuiRadio?.styleOverrides?.root, {
388
+ [`&.${radioClasses.disabled}`]: {
389
+ [HCM]: {
390
+ color: hcTokens.disabled
391
+ }
392
+ }
393
+ }]
394
+ }
395
+ },
396
+ MuiSlider: {
397
+ ...c?.MuiSlider,
398
+ styleOverrides: {
399
+ ...c?.MuiSlider?.styleOverrides,
400
+ // track doesn't receive the disabled class — use ownerState
401
+ track: [c?.MuiSlider?.styleOverrides?.track, ({
402
+ ownerState
403
+ }) => ({
404
+ ...(ownerState.disabled && {
405
+ [HCM]: {
406
+ borderColor: hcTokens.disabled
407
+ }
408
+ })
409
+ })],
410
+ // thumb receives the disabled class directly
411
+ thumb: [c?.MuiSlider?.styleOverrides?.thumb, {
412
+ [`&.${sliderClasses.disabled}`]: {
413
+ [HCM]: {
414
+ borderColor: hcTokens.disabled
415
+ }
416
+ }
417
+ }]
418
+ }
419
+ },
420
+ MuiSwitch: {
421
+ ...c?.MuiSwitch,
422
+ styleOverrides: {
423
+ ...c?.MuiSwitch?.styleOverrides,
424
+ // track and thumb don't receive the disabled class — use ownerState
425
+ track: [c?.MuiSwitch?.styleOverrides?.track, ({
426
+ ownerState
427
+ }) => ({
428
+ ...(ownerState.disabled && {
429
+ [HCM]: {
430
+ borderColor: hcTokens.disabled
431
+ }
432
+ })
433
+ })],
434
+ thumb: [c?.MuiSwitch?.styleOverrides?.thumb, ({
435
+ ownerState
436
+ }) => ({
437
+ ...(ownerState.disabled && {
438
+ [HCM]: {
439
+ borderColor: hcTokens.disabled
440
+ }
441
+ })
442
+ })]
443
+ }
444
+ },
445
+ MuiButtonBase: {
446
+ ...c?.MuiButtonBase,
447
+ styleOverrides: {
448
+ ...c?.MuiButtonBase?.styleOverrides,
449
+ root: [c?.MuiButtonBase?.styleOverrides?.root, {
450
+ // Restore the focus outline in HCM since the ripple is not visible.
451
+ // Also handle components where the focusable element is a hidden inner input (Checkbox, Radio, Switch).
452
+ [HCM]: {
453
+ '&:focus-visible, &:focus-within:has(input:focus-visible)': {
454
+ outline: `5px auto ${hcTokens.activeBackground}`
455
+ }
456
+ }
457
+ }]
458
+ }
459
+ },
460
+ MuiTooltip: {
461
+ ...c?.MuiTooltip,
462
+ styleOverrides: {
463
+ ...c?.MuiTooltip?.styleOverrides,
464
+ tooltip: [c?.MuiTooltip?.styleOverrides?.tooltip, {
465
+ [HCM]: {
466
+ border: `1px solid ${hcTokens.buttonText}`
467
+ }
468
+ }]
469
+ }
470
+ },
471
+ MuiToggleButton: {
472
+ ...c?.MuiToggleButton,
473
+ styleOverrides: {
474
+ ...c?.MuiToggleButton?.styleOverrides,
475
+ root: [c?.MuiToggleButton?.styleOverrides?.root, {
476
+ [`&.${toggleButtonClasses.selected}`]: {
477
+ [HCM]: {
478
+ forcedColorAdjust: 'none',
479
+ color: hcTokens.activeText,
480
+ backgroundColor: hcTokens.activeBackground,
481
+ borderColor: hcTokens.activeBackground
482
+ },
483
+ '&:hover': {
484
+ [HCM]: {
485
+ backgroundColor: hcTokens.activeBackground,
486
+ borderColor: hcTokens.buttonBorder
487
+ }
488
+ }
489
+ }
490
+ }]
491
+ }
492
+ }
493
+ };
494
+ return theme;
495
+ }
@@ -1,6 +1,7 @@
1
1
  import { DistributiveOmit } from '@mui/types';
2
2
  export { default as THEME_ID } from "./identifier.mjs";
3
3
  export { default as createTheme, default as unstable_createMuiStrictModeTheme, ThemeOptions, Theme, CssThemeVariables } from "./createTheme.mjs";
4
+ export { default as enhanceHighContrast, HighContrastTokens } from "./enhanceHighContrast.mjs";
4
5
  export { default as adaptV4Theme, DeprecatedThemeOptions } from "./adaptV4Theme.mjs";
5
6
  export { Shadows } from "./shadows.mjs";
6
7
  export { ZIndex } from "./zIndex.mjs";
@@ -9,6 +10,7 @@ export { default as createColorScheme } from "./createColorScheme.mjs";
9
10
  export { default as createStyles } from "./createStyles.mjs";
10
11
  export { TypographyVariants, TypographyVariantsOptions, TypographyStyle, TypographyVariant } from "./createTypography.mjs";
11
12
  export { default as responsiveFontSizes } from "./responsiveFontSizes.mjs";
13
+ export { ReducedMotionMode, Motion, MotionOptions } from "./createMotion.mjs";
12
14
  export { Duration, Easing, Transitions, TransitionsOptions, duration, easing } from "./createTransitions.mjs";
13
15
  export { Mixins, CSSProperties, MixinsOptions } from "./createMixins.mjs";
14
16
  export { Direction, Breakpoint, BreakpointOverrides, Breakpoints, BreakpointsOptions, CreateMUIStyled, Interpolation, CSSInterpolation, CSSObject, css, keyframes,
package/styles/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import { DistributiveOmit } from '@mui/types';
2
2
  export { default as THEME_ID } from "./identifier.js";
3
3
  export { default as createTheme, default as unstable_createMuiStrictModeTheme, ThemeOptions, Theme, CssThemeVariables } from "./createTheme.js";
4
+ export { default as enhanceHighContrast, HighContrastTokens } from "./enhanceHighContrast.js";
4
5
  export { default as adaptV4Theme, DeprecatedThemeOptions } from "./adaptV4Theme.js";
5
6
  export { Shadows } from "./shadows.js";
6
7
  export { ZIndex } from "./zIndex.js";
@@ -9,6 +10,7 @@ export { default as createColorScheme } from "./createColorScheme.js";
9
10
  export { default as createStyles } from "./createStyles.js";
10
11
  export { TypographyVariants, TypographyVariantsOptions, TypographyStyle, TypographyVariant } from "./createTypography.js";
11
12
  export { default as responsiveFontSizes } from "./responsiveFontSizes.js";
13
+ export { ReducedMotionMode, Motion, MotionOptions } from "./createMotion.js";
12
14
  export { Duration, Easing, Transitions, TransitionsOptions, duration, easing } from "./createTransitions.js";
13
15
  export { Mixins, CSSProperties, MixinsOptions } from "./createMixins.js";
14
16
  export { Direction, Breakpoint, BreakpointOverrides, Breakpoints, BreakpointsOptions, CreateMUIStyled, Interpolation, CSSInterpolation, CSSObject, css, keyframes,
package/styles/index.js CHANGED
@@ -25,6 +25,7 @@ var _exportNames = {
25
25
  StyledEngineProvider: true,
26
26
  unstable_createBreakpoints: true,
27
27
  createTheme: true,
28
+ enhanceHighContrast: true,
28
29
  unstable_createMuiStrictModeTheme: true,
29
30
  createStyles: true,
30
31
  unstable_getUnit: true,
@@ -139,6 +140,12 @@ Object.defineProperty(exports, "emphasize", {
139
140
  return _system.emphasize;
140
141
  }
141
142
  });
143
+ Object.defineProperty(exports, "enhanceHighContrast", {
144
+ enumerable: true,
145
+ get: function () {
146
+ return _enhanceHighContrast.default;
147
+ }
148
+ });
142
149
  Object.defineProperty(exports, "experimental_extendTheme", {
143
150
  enumerable: true,
144
151
  get: function () {
@@ -302,6 +309,7 @@ var _adaptV4Theme = _interopRequireDefault(require("./adaptV4Theme"));
302
309
  var _system = require("@mui/system");
303
310
  var _createBreakpoints = require("@mui/system/createBreakpoints");
304
311
  var _createTheme = _interopRequireDefault(require("./createTheme"));
312
+ var _enhanceHighContrast = _interopRequireDefault(require("./enhanceHighContrast"));
305
313
  var _createMuiStrictModeTheme = _interopRequireDefault(require("./createMuiStrictModeTheme"));
306
314
  var _createStyles = _interopRequireDefault(require("./createStyles"));
307
315
  var _cssUtils = require("./cssUtils");
package/styles/index.mjs CHANGED
@@ -9,6 +9,7 @@ export function experimental_sx() {
9
9
  throw new Error(process.env.NODE_ENV !== "production" ? 'MUI: The `experimental_sx` has been moved to `theme.unstable_sx`.' + 'For more details, see https://github.com/mui/material-ui/pull/35150.' : _formatErrorMessage(19));
10
10
  }
11
11
  export { default as createTheme } from "./createTheme.mjs";
12
+ export { default as enhanceHighContrast } from "./enhanceHighContrast.mjs";
12
13
  export { default as unstable_createMuiStrictModeTheme } from "./createMuiStrictModeTheme.mjs";
13
14
  export { default as createStyles } from "./createStyles.mjs";
14
15
  export { getUnit as unstable_getUnit, toUnitless as unstable_toUnitless } from "./cssUtils.mjs";
@@ -0,0 +1,7 @@
1
+ import type { ReducedMotionMode } from "./createMotion.mjs";
2
+ export declare const defaultStyles: {
3
+ transition: string;
4
+ };
5
+ export declare function resolveReducedMotionStyles<Styles extends object>(reducedMotion: ReducedMotionMode | undefined, styles: Styles): Styles | {
6
+ '@media (prefers-reduced-motion: reduce)': Styles;
7
+ } | null;
@@ -0,0 +1,7 @@
1
+ import type { ReducedMotionMode } from "./createMotion.js";
2
+ export declare const defaultStyles: {
3
+ transition: string;
4
+ };
5
+ export declare function resolveReducedMotionStyles<Styles extends object>(reducedMotion: ReducedMotionMode | undefined, styles: Styles): Styles | {
6
+ '@media (prefers-reduced-motion: reduce)': Styles;
7
+ } | null;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.defaultStyles = void 0;
7
+ exports.resolveReducedMotionStyles = resolveReducedMotionStyles;
8
+ const defaultStyles = exports.defaultStyles = {
9
+ transition: 'none'
10
+ };
11
+ function resolveReducedMotionStyles(reducedMotion, styles) {
12
+ if (reducedMotion === 'always') {
13
+ return styles;
14
+ }
15
+ if (reducedMotion === 'system') {
16
+ return {
17
+ '@media (prefers-reduced-motion: reduce)': styles
18
+ };
19
+ }
20
+ return null;
21
+ }
@@ -0,0 +1,14 @@
1
+ export const defaultStyles = {
2
+ transition: 'none'
3
+ };
4
+ export function resolveReducedMotionStyles(reducedMotion, styles) {
5
+ if (reducedMotion === 'always') {
6
+ return styles;
7
+ }
8
+ if (reducedMotion === 'system') {
9
+ return {
10
+ '@media (prefers-reduced-motion: reduce)': styles
11
+ };
12
+ }
13
+ return null;
14
+ }
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = shouldSkipGeneratingVar;
7
7
  function shouldSkipGeneratingVar(keys) {
8
- return !!keys[0].match(/(cssVarPrefix|colorSchemeSelector|modularCssLayers|rootSelector|typography|mixins|breakpoints|direction|transitions)/) || !!keys[0].match(/sxConfig$/) ||
8
+ return keys[0] === 'motion' || !!keys[0].match(/(cssVarPrefix|colorSchemeSelector|modularCssLayers|rootSelector|typography|mixins|breakpoints|direction|transitions)/) || !!keys[0].match(/sxConfig$/) ||
9
9
  // ends with sxConfig
10
10
  keys[0] === 'palette' && !!keys[1]?.match(/(mode|contrastThreshold|tonalOffset)/);
11
11
  }
@@ -1,5 +1,5 @@
1
1
  export default function shouldSkipGeneratingVar(keys) {
2
- return !!keys[0].match(/(cssVarPrefix|colorSchemeSelector|modularCssLayers|rootSelector|typography|mixins|breakpoints|direction|transitions)/) || !!keys[0].match(/sxConfig$/) ||
2
+ return keys[0] === 'motion' || !!keys[0].match(/(cssVarPrefix|colorSchemeSelector|modularCssLayers|rootSelector|typography|mixins|breakpoints|direction|transitions)/) || !!keys[0].match(/sxConfig$/) ||
3
3
  // ends with sxConfig
4
4
  keys[0] === 'palette' && !!keys[1]?.match(/(mode|contrastThreshold|tonalOffset)/);
5
5
  }
@@ -55,6 +55,7 @@ function stringifyTheme(baseTheme = {}) {
55
55
  const theme = ${JSON.stringify(serializableTheme, null, 2)};
56
56
 
57
57
  theme.breakpoints = createBreakpoints(theme.breakpoints || {});
58
+ theme.motion = { reducedMotion: 'never', ...theme.motion };
58
59
  theme.transitions = createTransitions(theme.transitions || {});
59
60
 
60
61
  export default theme;`;
@@ -48,6 +48,7 @@ export function stringifyTheme(baseTheme = {}) {
48
48
  const theme = ${JSON.stringify(serializableTheme, null, 2)};
49
49
 
50
50
  theme.breakpoints = createBreakpoints(theme.breakpoints || {});
51
+ theme.motion = { reducedMotion: 'never', ...theme.motion };
51
52
  theme.transitions = createTransitions(theme.transitions || {});
52
53
 
53
54
  export default theme;`;
@@ -1 +1 @@
1
- export * from "./transition.mjs";
1
+ export type { EasingProps, TransitionHandlerKeys, TransitionHandlerProps, TransitionKeys, TransitionProps } from "./types.mjs";
@@ -1 +1 @@
1
- export * from "./transition.js";
1
+ export type { EasingProps, TransitionHandlerKeys, TransitionHandlerProps, TransitionKeys, TransitionProps } from "./types.js";
@@ -2,15 +2,4 @@
2
2
 
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
- });
6
- var _transition = require("./transition");
7
- Object.keys(_transition).forEach(function (key) {
8
- if (key === "default" || key === "__esModule") return;
9
- if (key in exports && exports[key] === _transition[key]) return;
10
- Object.defineProperty(exports, key, {
11
- enumerable: true,
12
- get: function () {
13
- return _transition[key];
14
- }
15
- });
16
5
  });
@@ -1 +1 @@
1
- export * from "./transition.mjs";
1
+ export {};