@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
@@ -0,0 +1,8 @@
1
+ export type ReducedMotionMode = 'never' | 'system' | 'always';
2
+ export interface Motion {
3
+ reducedMotion: ReducedMotionMode;
4
+ }
5
+ export interface MotionOptions {
6
+ reducedMotion?: ReducedMotionMode | undefined;
7
+ }
8
+ export default function createMotion(inputMotion?: MotionOptions): Motion;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = createMotion;
7
+ const EMPTY_MOTION = {};
8
+ function createMotion(inputMotion = EMPTY_MOTION) {
9
+ return {
10
+ reducedMotion: 'never',
11
+ ...inputMotion
12
+ };
13
+ }
@@ -0,0 +1,7 @@
1
+ const EMPTY_MOTION = {};
2
+ export default function createMotion(inputMotion = EMPTY_MOTION) {
3
+ return {
4
+ reducedMotion: 'never',
5
+ ...inputMotion
6
+ };
7
+ }
@@ -3,6 +3,7 @@ import { SxConfig, SxProps, CSSObject, ApplyStyles, Theme as SystemTheme, Shape
3
3
  import { ExtractTypographyTokens } from '@mui/system/cssVars';
4
4
  import { Palette, PaletteOptions } from "./createPalette.mjs";
5
5
  import { Shadows } from "./shadows.mjs";
6
+ import { Motion } from "./createMotion.mjs";
6
7
  import { Transitions } from "./createTransitions.mjs";
7
8
  import { Mixins } from "./createMixins.mjs";
8
9
  import { TypographyVariants } from "./createTypography.mjs";
@@ -260,6 +261,7 @@ export interface CssVarsTheme extends ColorSystem {
260
261
  breakpoints: SystemTheme['breakpoints'];
261
262
  shape: Shape;
262
263
  typography: TypographyVariants;
264
+ motion: Motion;
263
265
  transitions: Transitions;
264
266
  shadows: Shadows;
265
267
  mixins: Mixins;
@@ -3,6 +3,7 @@ import { SxConfig, SxProps, CSSObject, ApplyStyles, Theme as SystemTheme, Shape
3
3
  import { ExtractTypographyTokens } from '@mui/system/cssVars';
4
4
  import { Palette, PaletteOptions } from "./createPalette.js";
5
5
  import { Shadows } from "./shadows.js";
6
+ import { Motion } from "./createMotion.js";
6
7
  import { Transitions } from "./createTransitions.js";
7
8
  import { Mixins } from "./createMixins.js";
8
9
  import { TypographyVariants } from "./createTypography.js";
@@ -260,6 +261,7 @@ export interface CssVarsTheme extends ColorSystem {
260
261
  breakpoints: SystemTheme['breakpoints'];
261
262
  shape: Shape;
262
263
  typography: TypographyVariants;
264
+ motion: Motion;
263
265
  transitions: Transitions;
264
266
  shadows: Shadows;
265
267
  mixins: Mixins;
@@ -3,6 +3,7 @@ import { Mixins, MixinsOptions } from "./createMixins.mjs";
3
3
  import { Palette, PaletteOptions } from "./createPalette.mjs";
4
4
  import { TypographyVariants, TypographyVariantsOptions } from "./createTypography.mjs";
5
5
  import { Shadows } from "./shadows.mjs";
6
+ import { Motion, MotionOptions } from "./createMotion.mjs";
6
7
  import { Transitions, TransitionsOptions } from "./createTransitions.mjs";
7
8
  import { ZIndex, ZIndexOptions } from "./zIndex.mjs";
8
9
  import { Components } from "./components.mjs";
@@ -25,6 +26,7 @@ type CssVarsOptions = CssThemeVariables extends {
25
26
  export interface ThemeOptions extends Omit<SystemThemeOptions, 'zIndex'>, CssVarsOptions {
26
27
  mixins?: MixinsOptions | undefined;
27
28
  components?: Components<Omit<Theme, 'components'>> | undefined;
29
+ motion?: MotionOptions | undefined;
28
30
  palette?: PaletteOptions | undefined;
29
31
  shadows?: Shadows | undefined;
30
32
  shape?: ShapeOptions | undefined;
@@ -37,6 +39,7 @@ export interface ThemeOptions extends Omit<SystemThemeOptions, 'zIndex'>, CssVar
37
39
  }
38
40
  export interface BaseTheme extends SystemTheme {
39
41
  mixins: Mixins;
42
+ motion: Motion;
40
43
  palette: Palette & (CssThemeVariables extends {
41
44
  enabled: true;
42
45
  } ? CssVarsPalette : {});
@@ -3,6 +3,7 @@ import { Mixins, MixinsOptions } from "./createMixins.js";
3
3
  import { Palette, PaletteOptions } from "./createPalette.js";
4
4
  import { TypographyVariants, TypographyVariantsOptions } from "./createTypography.js";
5
5
  import { Shadows } from "./shadows.js";
6
+ import { Motion, MotionOptions } from "./createMotion.js";
6
7
  import { Transitions, TransitionsOptions } from "./createTransitions.js";
7
8
  import { ZIndex, ZIndexOptions } from "./zIndex.js";
8
9
  import { Components } from "./components.js";
@@ -25,6 +26,7 @@ type CssVarsOptions = CssThemeVariables extends {
25
26
  export interface ThemeOptions extends Omit<SystemThemeOptions, 'zIndex'>, CssVarsOptions {
26
27
  mixins?: MixinsOptions | undefined;
27
28
  components?: Components<Omit<Theme, 'components'>> | undefined;
29
+ motion?: MotionOptions | undefined;
28
30
  palette?: PaletteOptions | undefined;
29
31
  shadows?: Shadows | undefined;
30
32
  shape?: ShapeOptions | undefined;
@@ -37,6 +39,7 @@ export interface ThemeOptions extends Omit<SystemThemeOptions, 'zIndex'>, CssVar
37
39
  }
38
40
  export interface BaseTheme extends SystemTheme {
39
41
  mixins: Mixins;
42
+ motion: Motion;
40
43
  palette: Palette & (CssThemeVariables extends {
41
44
  enabled: true;
42
45
  } ? CssVarsPalette : {});
@@ -17,6 +17,7 @@ var _createPalette = _interopRequireDefault(require("./createPalette"));
17
17
  var _createTypography = _interopRequireDefault(require("./createTypography"));
18
18
  var _shadows = _interopRequireDefault(require("./shadows"));
19
19
  var _createTransitions = _interopRequireDefault(require("./createTransitions"));
20
+ var _createMotion = _interopRequireDefault(require("./createMotion"));
20
21
  var _zIndex = _interopRequireDefault(require("./zIndex"));
21
22
  var _stringifyTheme = require("./stringifyTheme");
22
23
  function coefficientToPercentage(coefficient) {
@@ -77,6 +78,7 @@ function createThemeNoVars(options = {}, ...args) {
77
78
  mixins: mixinsInput = {},
78
79
  spacing: spacingInput,
79
80
  palette: paletteInput = {},
81
+ motion: motionInput = {},
80
82
  transitions: transitionsInput = {},
81
83
  typography: typographyInput = {},
82
84
  shape: shapeInput,
@@ -102,6 +104,7 @@ function createThemeNoVars(options = {}, ...args) {
102
104
  // Don't use [...shadows] until you've verified its transpiled code is not invoking the iterator protocol.
103
105
  shadows: _shadows.default.slice(),
104
106
  typography: (0, _createTypography.default)(palette, typographyInput),
107
+ motion: (0, _createMotion.default)(motionInput),
105
108
  transitions: (0, _createTransitions.default)(transitionsInput),
106
109
  zIndex: {
107
110
  ..._zIndex.default
@@ -109,6 +112,8 @@ function createThemeNoVars(options = {}, ...args) {
109
112
  });
110
113
  muiTheme = (0, _deepmerge.default)(muiTheme, other);
111
114
  muiTheme = args.reduce((acc, argument) => (0, _deepmerge.default)(acc, argument), muiTheme);
115
+ // `reducedMotion` is owned by `theme.motion`; remove stale values preserved by systemCreateTheme.
116
+ delete muiTheme.transitions.reducedMotion;
112
117
  if (process.env.NODE_ENV !== 'production') {
113
118
  // TODO v6: Refactor to use globalStateClassesMapping from @mui/utils once `readOnly` state class is used in Rating component.
114
119
  const stateClasses = ['active', 'checked', 'completed', 'disabled', 'error', 'expanded', 'focused', 'focusVisible', 'required', 'selected'];
@@ -9,6 +9,7 @@ import createPalette from "./createPalette.mjs";
9
9
  import createTypography from "./createTypography.mjs";
10
10
  import shadows from "./shadows.mjs";
11
11
  import createTransitions from "./createTransitions.mjs";
12
+ import createMotion from "./createMotion.mjs";
12
13
  import zIndex from "./zIndex.mjs";
13
14
  import { stringifyTheme } from "./stringifyTheme.mjs";
14
15
  function coefficientToPercentage(coefficient) {
@@ -69,6 +70,7 @@ function createThemeNoVars(options = {}, ...args) {
69
70
  mixins: mixinsInput = {},
70
71
  spacing: spacingInput,
71
72
  palette: paletteInput = {},
73
+ motion: motionInput = {},
72
74
  transitions: transitionsInput = {},
73
75
  typography: typographyInput = {},
74
76
  shape: shapeInput,
@@ -94,6 +96,7 @@ function createThemeNoVars(options = {}, ...args) {
94
96
  // Don't use [...shadows] until you've verified its transpiled code is not invoking the iterator protocol.
95
97
  shadows: shadows.slice(),
96
98
  typography: createTypography(palette, typographyInput),
99
+ motion: createMotion(motionInput),
97
100
  transitions: createTransitions(transitionsInput),
98
101
  zIndex: {
99
102
  ...zIndex
@@ -101,6 +104,8 @@ function createThemeNoVars(options = {}, ...args) {
101
104
  });
102
105
  muiTheme = deepmerge(muiTheme, other);
103
106
  muiTheme = args.reduce((acc, argument) => deepmerge(acc, argument), muiTheme);
107
+ // `reducedMotion` is owned by `theme.motion`; remove stale values preserved by systemCreateTheme.
108
+ delete muiTheme.transitions.reducedMotion;
104
109
  if (process.env.NODE_ENV !== 'production') {
105
110
  // TODO v6: Refactor to use globalStateClassesMapping from @mui/utils once `readOnly` state class is used in Rating component.
106
111
  const stateClasses = ['active', 'checked', 'completed', 'disabled', 'error', 'expanded', 'focused', 'focusVisible', 'required', 'selected'];
@@ -18,7 +18,11 @@ export const duration: Duration;
18
18
  export interface TransitionsOptions {
19
19
  easing?: Partial<Easing> | undefined;
20
20
  duration?: Partial<Duration> | undefined;
21
- create?: ((props: string | string[], options?: Partial<{
21
+ create?: ((props?: string | string[], options?: Partial<{
22
+ duration: number | string;
23
+ easing: string;
24
+ delay: number | string;
25
+ }>) => string) | ((props: string | string[], options?: Partial<{
22
26
  duration: number | string;
23
27
  easing: string;
24
28
  delay: number | string;
@@ -31,7 +35,7 @@ export interface TransitionsOptions {
31
35
  * @param props
32
36
  * @param options
33
37
  */
34
- export function create(props: string | string[], options?: Partial<{
38
+ export function create(props?: string | string[], options?: Partial<{
35
39
  duration: number | string;
36
40
  easing: string;
37
41
  delay: number | string;
@@ -18,7 +18,11 @@ export const duration: Duration;
18
18
  export interface TransitionsOptions {
19
19
  easing?: Partial<Easing> | undefined;
20
20
  duration?: Partial<Duration> | undefined;
21
- create?: ((props: string | string[], options?: Partial<{
21
+ create?: ((props?: string | string[], options?: Partial<{
22
+ duration: number | string;
23
+ easing: string;
24
+ delay: number | string;
25
+ }>) => string) | ((props: string | string[], options?: Partial<{
22
26
  duration: number | string;
23
27
  easing: string;
24
28
  delay: number | string;
@@ -31,7 +35,7 @@ export interface TransitionsOptions {
31
35
  * @param props
32
36
  * @param options
33
37
  */
34
- export function create(props: string | string[], options?: Partial<{
38
+ export function create(props?: string | string[], options?: Partial<{
35
39
  duration: number | string;
36
40
  easing: string;
37
41
  delay: number | string;
@@ -5,6 +5,9 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = createTransitions;
7
7
  exports.easing = exports.duration = void 0;
8
+ const DEFAULT_TRANSITION_PROPS = ['all'];
9
+ const EMPTY_OPTIONS = {};
10
+
8
11
  // Follow https://material.google.com/motion/duration-easing.html#duration-easing-natural-easing-curves
9
12
  // to learn the context in which each easing should be used.
10
13
  const easing = exports.easing = {
@@ -47,15 +50,19 @@ function getAutoHeightDuration(height) {
47
50
  return Math.min(Math.round((4 + 15 * constant ** 0.25 + constant / 5) * 10), 3000);
48
51
  }
49
52
  function createTransitions(inputTransitions) {
53
+ const transitions = {
54
+ ...inputTransitions
55
+ };
56
+ delete transitions.reducedMotion;
50
57
  const mergedEasing = {
51
58
  ...easing,
52
- ...inputTransitions.easing
59
+ ...transitions.easing
53
60
  };
54
61
  const mergedDuration = {
55
62
  ...duration,
56
- ...inputTransitions.duration
63
+ ...transitions.duration
57
64
  };
58
- const create = (props = ['all'], options = {}) => {
65
+ const createTransitionValue = (props = DEFAULT_TRANSITION_PROPS, options = EMPTY_OPTIONS) => {
59
66
  const {
60
67
  duration: durationOption = mergedDuration.standard,
61
68
  easing: easingOption = mergedEasing.easeInOut,
@@ -86,10 +93,11 @@ function createTransitions(inputTransitions) {
86
93
  }
87
94
  return (Array.isArray(props) ? props : [props]).map(animatedProp => `${animatedProp} ${typeof durationOption === 'string' ? durationOption : formatMs(durationOption)} ${easingOption} ${typeof delay === 'string' ? delay : formatMs(delay)}`).join(',');
88
95
  };
96
+ const create = transitions.create ?? createTransitionValue;
89
97
  return {
90
98
  getAutoHeightDuration,
91
99
  create,
92
- ...inputTransitions,
100
+ ...transitions,
93
101
  easing: mergedEasing,
94
102
  duration: mergedDuration
95
103
  };
@@ -1,3 +1,6 @@
1
+ const DEFAULT_TRANSITION_PROPS = ['all'];
2
+ const EMPTY_OPTIONS = {};
3
+
1
4
  // Follow https://material.google.com/motion/duration-easing.html#duration-easing-natural-easing-curves
2
5
  // to learn the context in which each easing should be used.
3
6
  export const easing = {
@@ -40,15 +43,19 @@ function getAutoHeightDuration(height) {
40
43
  return Math.min(Math.round((4 + 15 * constant ** 0.25 + constant / 5) * 10), 3000);
41
44
  }
42
45
  export default function createTransitions(inputTransitions) {
46
+ const transitions = {
47
+ ...inputTransitions
48
+ };
49
+ delete transitions.reducedMotion;
43
50
  const mergedEasing = {
44
51
  ...easing,
45
- ...inputTransitions.easing
52
+ ...transitions.easing
46
53
  };
47
54
  const mergedDuration = {
48
55
  ...duration,
49
- ...inputTransitions.duration
56
+ ...transitions.duration
50
57
  };
51
- const create = (props = ['all'], options = {}) => {
58
+ const createTransitionValue = (props = DEFAULT_TRANSITION_PROPS, options = EMPTY_OPTIONS) => {
52
59
  const {
53
60
  duration: durationOption = mergedDuration.standard,
54
61
  easing: easingOption = mergedEasing.easeInOut,
@@ -79,10 +86,11 @@ export default function createTransitions(inputTransitions) {
79
86
  }
80
87
  return (Array.isArray(props) ? props : [props]).map(animatedProp => `${animatedProp} ${typeof durationOption === 'string' ? durationOption : formatMs(durationOption)} ${easingOption} ${typeof delay === 'string' ? delay : formatMs(delay)}`).join(',');
81
88
  };
89
+ const create = transitions.create ?? createTransitionValue;
82
90
  return {
83
91
  getAutoHeightDuration,
84
92
  create,
85
- ...inputTransitions,
93
+ ...transitions,
86
94
  easing: mergedEasing,
87
95
  duration: mergedDuration
88
96
  };
@@ -0,0 +1,70 @@
1
+ import { Theme } from "./createTheme.mjs";
2
+ export interface HighContrastTokens {
3
+ /**
4
+ * Color for disabled elements.
5
+ * @default 'GrayText'
6
+ */
7
+ disabled?: string | undefined;
8
+ /**
9
+ * Color for error states.
10
+ * @default 'ActiveText'
11
+ */
12
+ error?: string | undefined;
13
+ /**
14
+ * Background color for selected items.
15
+ * @default 'SelectedItem'
16
+ */
17
+ selectedBackground?: string | undefined;
18
+ /**
19
+ * Text color on selected items.
20
+ * @default 'SelectedItemText'
21
+ */
22
+ selectedText?: string | undefined;
23
+ /**
24
+ * Background color for active/toggled controls.
25
+ * @default 'Highlight'
26
+ */
27
+ activeBackground?: string | undefined;
28
+ /**
29
+ * Text color on active/toggled controls.
30
+ * @default 'HighlightText'
31
+ */
32
+ activeText?: string | undefined;
33
+ /**
34
+ * Border color for interactive controls.
35
+ * @default 'ButtonBorder'
36
+ */
37
+ buttonBorder?: string | undefined;
38
+ /**
39
+ * Text/icon color on buttons.
40
+ * @default 'ButtonText'
41
+ */
42
+ buttonText?: string | undefined;
43
+ /**
44
+ * Background color for the page/canvas.
45
+ * @default 'Canvas'
46
+ */
47
+ canvas?: string | undefined;
48
+ }
49
+ /**
50
+ * Enhances a theme with styles for Windows High Contrast Mode (forced-colors).
51
+ *
52
+ * Accepts a fully-created theme, merges in HCM component overrides using arrays
53
+ * so that Emotion emits each entry as a separate CSS rule and the browser
54
+ * cascade (rather than JS object merging) resolves specificity.
55
+ *
56
+ * @param themeInput - The theme to enhance.
57
+ * @param tokens - Override any of the default system color tokens.
58
+ * @returns The enhanced theme (same type as the input).
59
+ *
60
+ * @example
61
+ * // Use defaults
62
+ * const theme = enhanceHighContrast(createTheme({ palette: { ... } }));
63
+ *
64
+ * @example
65
+ * // Override specific tokens
66
+ * const theme = enhanceHighContrast(createTheme(), { disabled: 'ButtonText' });
67
+ */
68
+ export default function enhanceHighContrast<T extends {
69
+ components?: Theme['components'] | undefined;
70
+ }>(themeInput: T, tokens?: HighContrastTokens): T;
@@ -0,0 +1,70 @@
1
+ import { Theme } from "./createTheme.js";
2
+ export interface HighContrastTokens {
3
+ /**
4
+ * Color for disabled elements.
5
+ * @default 'GrayText'
6
+ */
7
+ disabled?: string | undefined;
8
+ /**
9
+ * Color for error states.
10
+ * @default 'ActiveText'
11
+ */
12
+ error?: string | undefined;
13
+ /**
14
+ * Background color for selected items.
15
+ * @default 'SelectedItem'
16
+ */
17
+ selectedBackground?: string | undefined;
18
+ /**
19
+ * Text color on selected items.
20
+ * @default 'SelectedItemText'
21
+ */
22
+ selectedText?: string | undefined;
23
+ /**
24
+ * Background color for active/toggled controls.
25
+ * @default 'Highlight'
26
+ */
27
+ activeBackground?: string | undefined;
28
+ /**
29
+ * Text color on active/toggled controls.
30
+ * @default 'HighlightText'
31
+ */
32
+ activeText?: string | undefined;
33
+ /**
34
+ * Border color for interactive controls.
35
+ * @default 'ButtonBorder'
36
+ */
37
+ buttonBorder?: string | undefined;
38
+ /**
39
+ * Text/icon color on buttons.
40
+ * @default 'ButtonText'
41
+ */
42
+ buttonText?: string | undefined;
43
+ /**
44
+ * Background color for the page/canvas.
45
+ * @default 'Canvas'
46
+ */
47
+ canvas?: string | undefined;
48
+ }
49
+ /**
50
+ * Enhances a theme with styles for Windows High Contrast Mode (forced-colors).
51
+ *
52
+ * Accepts a fully-created theme, merges in HCM component overrides using arrays
53
+ * so that Emotion emits each entry as a separate CSS rule and the browser
54
+ * cascade (rather than JS object merging) resolves specificity.
55
+ *
56
+ * @param themeInput - The theme to enhance.
57
+ * @param tokens - Override any of the default system color tokens.
58
+ * @returns The enhanced theme (same type as the input).
59
+ *
60
+ * @example
61
+ * // Use defaults
62
+ * const theme = enhanceHighContrast(createTheme({ palette: { ... } }));
63
+ *
64
+ * @example
65
+ * // Override specific tokens
66
+ * const theme = enhanceHighContrast(createTheme(), { disabled: 'ButtonText' });
67
+ */
68
+ export default function enhanceHighContrast<T extends {
69
+ components?: Theme['components'] | undefined;
70
+ }>(themeInput: T, tokens?: HighContrastTokens): T;