@mui/material 6.1.1 → 6.1.3

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 (129) hide show
  1. package/Autocomplete/Autocomplete.js +1 -5
  2. package/Badge/Badge.d.ts +2 -2
  3. package/Badge/Badge.js +12 -8
  4. package/Button/Button.js +3 -4
  5. package/CHANGELOG.md +136 -0
  6. package/ClickAwayListener/ClickAwayListener.js +2 -2
  7. package/Fade/Fade.js +2 -2
  8. package/Grid2/Grid2.d.ts +16 -11
  9. package/Grid2/Grid2.js +29 -11
  10. package/Grow/Grow.js +2 -2
  11. package/Icon/Icon.js +1 -1
  12. package/InputBase/InputBase.js +1 -1
  13. package/LinearProgress/LinearProgress.js +7 -0
  14. package/MenuList/MenuList.js +2 -1
  15. package/Modal/Modal.js +3 -3
  16. package/Modal/ModalManager.d.ts +1 -1
  17. package/Modal/ModalManager.js +5 -5
  18. package/Modal/useModal.js +9 -5
  19. package/OutlinedInput/OutlinedInput.js +6 -6
  20. package/PigmentGrid/PigmentGrid.d.ts +0 -23
  21. package/PigmentGrid/PigmentGrid.js +0 -23
  22. package/Portal/Portal.js +2 -2
  23. package/Rating/Rating.d.ts +1 -1
  24. package/Rating/Rating.js +7 -2
  25. package/Select/Select.js +2 -2
  26. package/Select/SelectInput.js +1 -1
  27. package/Slide/Slide.js +2 -2
  28. package/SwipeableDrawer/SwipeableDrawer.d.ts +1 -1
  29. package/Tooltip/Tooltip.js +2 -2
  30. package/Unstable_TrapFocus/FocusTrap.js +3 -3
  31. package/Zoom/Zoom.js +2 -2
  32. package/index.js +1 -1
  33. package/modern/Autocomplete/Autocomplete.js +1 -5
  34. package/modern/Badge/Badge.js +12 -8
  35. package/modern/Button/Button.js +3 -4
  36. package/modern/ClickAwayListener/ClickAwayListener.js +2 -2
  37. package/modern/Fade/Fade.js +2 -2
  38. package/modern/Grid2/Grid2.js +29 -11
  39. package/modern/Grow/Grow.js +2 -2
  40. package/modern/Icon/Icon.js +1 -1
  41. package/modern/InputBase/InputBase.js +1 -1
  42. package/modern/LinearProgress/LinearProgress.js +7 -0
  43. package/modern/MenuList/MenuList.js +2 -1
  44. package/modern/Modal/Modal.js +3 -3
  45. package/modern/Modal/ModalManager.js +5 -5
  46. package/modern/Modal/useModal.js +9 -5
  47. package/modern/OutlinedInput/OutlinedInput.js +6 -6
  48. package/modern/PigmentGrid/PigmentGrid.js +0 -23
  49. package/modern/Portal/Portal.js +2 -2
  50. package/modern/Rating/Rating.js +7 -2
  51. package/modern/Select/Select.js +2 -2
  52. package/modern/Select/SelectInput.js +1 -1
  53. package/modern/Slide/Slide.js +2 -2
  54. package/modern/Tooltip/Tooltip.js +2 -2
  55. package/modern/Unstable_TrapFocus/FocusTrap.js +3 -3
  56. package/modern/Zoom/Zoom.js +2 -2
  57. package/modern/index.js +1 -1
  58. package/modern/styles/createGetSelector.js +8 -7
  59. package/modern/styles/createPalette.js +2 -16
  60. package/modern/styles/createThemeNoVars.js +1 -2
  61. package/modern/styles/createThemeWithVars.js +2 -0
  62. package/modern/styles/index.js +1 -1
  63. package/modern/styles/makeStyles.js +1 -3
  64. package/modern/styles/responsiveFontSizes.js +1 -2
  65. package/modern/styles/shouldSkipGeneratingVar.js +1 -1
  66. package/modern/styles/withStyles.js +1 -3
  67. package/modern/styles/withTheme.js +1 -3
  68. package/modern/useAutocomplete/useAutocomplete.js +3 -1
  69. package/modern/utils/memoTheme.js +3 -24
  70. package/modern/version/index.js +2 -2
  71. package/node/Autocomplete/Autocomplete.js +1 -5
  72. package/node/Badge/Badge.js +12 -8
  73. package/node/Button/Button.js +3 -4
  74. package/node/ClickAwayListener/ClickAwayListener.js +2 -2
  75. package/node/Fade/Fade.js +2 -2
  76. package/node/Grid2/Grid2.js +29 -11
  77. package/node/Grow/Grow.js +2 -2
  78. package/node/Icon/Icon.js +1 -1
  79. package/node/InputBase/InputBase.js +1 -1
  80. package/node/LinearProgress/LinearProgress.js +7 -0
  81. package/node/MenuList/MenuList.js +2 -1
  82. package/node/Modal/Modal.js +3 -3
  83. package/node/Modal/ModalManager.js +5 -5
  84. package/node/Modal/useModal.js +9 -5
  85. package/node/OutlinedInput/OutlinedInput.js +6 -6
  86. package/node/PigmentGrid/PigmentGrid.js +0 -23
  87. package/node/Portal/Portal.js +1 -1
  88. package/node/Rating/Rating.js +7 -2
  89. package/node/Select/Select.js +2 -2
  90. package/node/Select/SelectInput.js +1 -1
  91. package/node/Slide/Slide.js +2 -2
  92. package/node/Tooltip/Tooltip.js +2 -2
  93. package/node/Unstable_TrapFocus/FocusTrap.js +2 -2
  94. package/node/Zoom/Zoom.js +2 -2
  95. package/node/index.js +1 -1
  96. package/node/styles/createGetSelector.js +8 -7
  97. package/node/styles/createPalette.js +2 -16
  98. package/node/styles/createThemeNoVars.js +1 -2
  99. package/node/styles/createThemeWithVars.js +2 -0
  100. package/node/styles/index.js +1 -1
  101. package/node/styles/makeStyles.js +1 -3
  102. package/node/styles/responsiveFontSizes.js +1 -2
  103. package/node/styles/shouldSkipGeneratingVar.js +1 -1
  104. package/node/styles/withStyles.js +1 -3
  105. package/node/styles/withTheme.js +1 -3
  106. package/node/useAutocomplete/useAutocomplete.js +3 -1
  107. package/node/utils/memoTheme.js +4 -25
  108. package/node/version/index.js +2 -2
  109. package/package.json +6 -6
  110. package/styles/ThemeProvider.d.ts +6 -0
  111. package/styles/ThemeProviderWithVars.d.ts +2 -1
  112. package/styles/createGetSelector.d.ts +3 -8
  113. package/styles/createGetSelector.js +8 -7
  114. package/styles/createPalette.js +2 -16
  115. package/styles/createTheme.d.ts +1 -1
  116. package/styles/createThemeNoVars.d.ts +1 -0
  117. package/styles/createThemeNoVars.js +1 -2
  118. package/styles/createThemeWithVars.d.ts +8 -0
  119. package/styles/createThemeWithVars.js +2 -0
  120. package/styles/index.js +1 -1
  121. package/styles/makeStyles.js +1 -3
  122. package/styles/responsiveFontSizes.js +1 -2
  123. package/styles/shouldSkipGeneratingVar.js +1 -1
  124. package/styles/withStyles.js +1 -3
  125. package/styles/withTheme.js +1 -3
  126. package/useAutocomplete/useAutocomplete.js +3 -1
  127. package/utils/memoTheme.d.ts +4 -10
  128. package/utils/memoTheme.js +3 -24
  129. package/version/index.js +2 -2
@@ -710,11 +710,7 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps
710
710
  ref: setAnchorEl,
711
711
  className: classes.inputRoot,
712
712
  startAdornment,
713
- onClick: event => {
714
- if (event.target === event.currentTarget) {
715
- handleInputMouseDown(event);
716
- }
717
- },
713
+ onMouseDown: event => handleInputMouseDown(event),
718
714
  ...((hasClearIcon || hasPopupIcon) && {
719
715
  endAdornment: /*#__PURE__*/_jsxs(AutocompleteEndAdornment, {
720
716
  className: classes.endAdornment,
package/Badge/Badge.d.ts CHANGED
@@ -29,8 +29,8 @@ export type BadgeOwnerState = Simplify<
29
29
  >;
30
30
 
31
31
  export interface BadgeOrigin {
32
- vertical: 'top' | 'bottom';
33
- horizontal: 'left' | 'right';
32
+ vertical?: 'top' | 'bottom';
33
+ horizontal?: 'left' | 'right';
34
34
  }
35
35
 
36
36
  export interface BadgeOwnProps {
package/Badge/Badge.js CHANGED
@@ -210,16 +210,19 @@ const BadgeBadge = styled('span', {
210
210
  }
211
211
  }]
212
212
  })));
213
+ function getAnchorOrigin(anchorOrigin) {
214
+ return {
215
+ vertical: anchorOrigin?.vertical ?? 'top',
216
+ horizontal: anchorOrigin?.horizontal ?? 'right'
217
+ };
218
+ }
213
219
  const Badge = /*#__PURE__*/React.forwardRef(function Badge(inProps, ref) {
214
220
  const props = useDefaultProps({
215
221
  props: inProps,
216
222
  name: 'MuiBadge'
217
223
  });
218
224
  const {
219
- anchorOrigin: anchorOriginProp = {
220
- vertical: 'top',
221
- horizontal: 'right'
222
- },
225
+ anchorOrigin: anchorOriginProp,
223
226
  className,
224
227
  classes: classesProp,
225
228
  component,
@@ -249,7 +252,7 @@ const Badge = /*#__PURE__*/React.forwardRef(function Badge(inProps, ref) {
249
252
  showZero
250
253
  });
251
254
  const prevProps = usePreviousProps({
252
- anchorOrigin: anchorOriginProp,
255
+ anchorOrigin: getAnchorOrigin(anchorOriginProp),
253
256
  color: colorProp,
254
257
  overlap: overlapProp,
255
258
  variant: variantProp,
@@ -259,9 +262,10 @@ const Badge = /*#__PURE__*/React.forwardRef(function Badge(inProps, ref) {
259
262
  const {
260
263
  color = colorProp,
261
264
  overlap = overlapProp,
262
- anchorOrigin = anchorOriginProp,
265
+ anchorOrigin: anchorOriginPropProp,
263
266
  variant = variantProp
264
267
  } = invisible ? prevProps : props;
268
+ const anchorOrigin = getAnchorOrigin(anchorOriginPropProp);
265
269
  const displayValue = variant !== 'dot' ? displayValueFromHook : undefined;
266
270
  const ownerState = {
267
271
  ...props,
@@ -320,8 +324,8 @@ process.env.NODE_ENV !== "production" ? Badge.propTypes /* remove-proptypes */ =
320
324
  * }
321
325
  */
322
326
  anchorOrigin: PropTypes.shape({
323
- horizontal: PropTypes.oneOf(['left', 'right']).isRequired,
324
- vertical: PropTypes.oneOf(['bottom', 'top']).isRequired
327
+ horizontal: PropTypes.oneOf(['left', 'right']),
328
+ vertical: PropTypes.oneOf(['bottom', 'top'])
325
329
  }),
326
330
  /**
327
331
  * The content rendered within the badge.
package/Button/Button.js CHANGED
@@ -147,7 +147,7 @@ const ButtonRoot = styled(ButtonBase, {
147
147
  color: `var(--variant-textColor)`,
148
148
  backgroundColor: `var(--variant-textBg)`
149
149
  }
150
- }, ...Object.entries(theme.palette).filter(createSimplePaletteValueFilter(['dark', 'contrastText'])).map(([color]) => ({
150
+ }, ...Object.entries(theme.palette).filter(createSimplePaletteValueFilter()).map(([color]) => ({
151
151
  props: {
152
152
  color
153
153
  },
@@ -171,9 +171,8 @@ const ButtonRoot = styled(ButtonBase, {
171
171
  color: 'inherit'
172
172
  },
173
173
  style: {
174
- '--variant-containedColor': theme.vars ?
175
- // this is safe because grey does not change between default light/dark mode
176
- theme.vars.palette.text.primary : theme.palette.getContrastText?.(inheritContainedBackgroundColor),
174
+ color: 'inherit',
175
+ borderColor: 'currentColor',
177
176
  '--variant-containedBg': theme.vars ? theme.vars.palette.Button.inheritContainedBg : inheritContainedBackgroundColor,
178
177
  '@media (hover: hover)': {
179
178
  '&:hover': {
package/CHANGELOG.md CHANGED
@@ -1,5 +1,141 @@
1
1
  # [Versions](https://mui.com/versions/)
2
2
 
3
+ ## v6.1.3
4
+
5
+ <!-- generated comparing v6.1.2..master -->
6
+
7
+ _Oct 9, 2024_
8
+
9
+ A big thanks to the 18 contributors who made this release possible. Here are some highlights ✨:
10
+
11
+ - 🚀 Improved performance on styled components by pre-serializing and caching the styles (#43412) @romgrk
12
+
13
+ ### `@mui/material@6.1.3`
14
+
15
+ - &#8203;<!-- 18 -->Change React.ReactElement<any> to React.ReactElement<unknown> (#43402) @sai6855
16
+ - &#8203;<!-- 42 -->[Badge] Make keys in anchor origin partial (#43950) @sai6855
17
+ - &#8203;<!-- 22 -->[Grid2] Fix column spacing for nested containers (#43733) @Janpot
18
+ - &#8203;<!-- 21 -->[Grid2] Remove required `item` prop for `size` prop (#44027) @Janpot
19
+ - &#8203;<!-- 20 -->[Grid2] Add compatible props warning (#43801) @k-rajat19
20
+ - &#8203;<!-- 17 -->[Modal] Fix comment location (#44026) @oliviertassinari
21
+ - &#8203;<!-- 16 -->[OutlinedInput] Resolve border color issue on mobile (#43797) (#43879) @wojtek35
22
+
23
+ ### `@mui/system@6.1.3`
24
+
25
+ - &#8203;<!-- 15 -->Make createGrid compatible with React 19 types (#44035) @aarongarciah
26
+ - &#8203;<!-- 14 -->Add empty interfaces to fix issue with typescript module augmentation (#43873) @yonatan0
27
+ - &#8203;<!-- 13 -->Pre-serialize & cache styles to improve performance (#43412) @romgrk
28
+ - &#8203;<!-- 09 -->[typescript] `SystemCSSProperties` should not have `SystemStyleObject` as value (#44029) @siriwatknp
29
+
30
+ ### `@mui/utils@6.0.0-beta.11`
31
+
32
+ - &#8203;<!-- 08 -->[utils] Make getReactElementRef React 19 compatible (#44034) @aarongarciah
33
+
34
+ ### `@mui/lab@6.1.3`
35
+
36
+ - &#8203;<!-- 20 -->[lab][Timeline] Fix types for React 19 (#44043) @aarongarciah
37
+
38
+ ### Docs
39
+
40
+ - &#8203;<!-- 35 -->Update docs-infra role (#44032) @mnajdova
41
+ - &#8203;<!-- 34 -->Update Material Symbols plan to reflect Google development (#44000) @oliviertassinari
42
+ - &#8203;<!-- 33 -->Fix 301 redirections in docs @oliviertassinari
43
+ - &#8203;<!-- 32 -->Fix indentation @oliviertassinari
44
+ - &#8203;<!-- 31 -->Fix Live edit copies (#43835) @oliviertassinari
45
+ - &#8203;<!-- 30 -->Virtualize icons svg (#43939) @Janpot
46
+ - &#8203;<!-- 28 -->[Grid] Fix Grid2 gap description (#43967) @aarongarciah
47
+ - &#8203;<!-- 27 -->[icons] Index search synchronously (#44001) @oliviertassinari
48
+ - &#8203;<!-- 26 -->[material-ui] Incorrect React useState Example on Toggle Button (#43987) @barrownicholas
49
+ - &#8203;<!-- 25 -->[material-ui] Add theme setting for pigment-css migration (#43993) @effektsvk
50
+ - &#8203;<!-- 24 -->[material-ui] Fix incorrect `slotProp` name in the `TextField` deprecation note. (#43985) @Chee7ah
51
+ - &#8203;<!-- 23 -->[examples] Use CSS Variables (#43856) @Juneezee
52
+ - &#8203;<!-- 29 -->[material-ui] Improved documentation for indeterminateIcon prop (#43791) @marctaylor01
53
+
54
+ ### Core
55
+
56
+ - &#8203;<!-- 37 -->Fix typo in useLocalStorageState (#44024) @hieunguyenduc696
57
+ - &#8203;<!-- 36 -->Amend changelog (#43968) @aarongarciah
58
+ - &#8203;<!-- 41 -->Remove `@mui/styled-engine-sc` dev dependency from `@mui/styled-engine-sc` (#44050) @Janpot
59
+ - &#8203;<!-- 43 -->[docs-infra] Add pointer cursor on hover for logo to improve UX (#43999) @Asin-Junior-Honore
60
+ - &#8203;<!-- 41 -->[blog] Migrate some .gif to <video> (#43945) @oliviertassinari
61
+ - &#8203;<!-- 40 -->[code-infra] Align `next` dependency specifier across project (#44036) @Janpot
62
+ - &#8203;<!-- 39 -->[code-infra] Move MuiError babel macro to babel plugin (#43904) @Janpot
63
+ - &#8203;<!-- 38 -->[code-infra] Forbid calling `Error` without `new` (#43963) @Janpot
64
+ - &#8203;<!-- 29 -->[docs-infra] Fix link in header regression (#43834) @oliviertassinari
65
+ - &#8203;<!-- 19 -->[infra] Fix line break in Stack Overflow message @oliviertassinari
66
+ - &#8203;<!-- 12 -->[test] Add missing async (#44028) @oliviertassinari
67
+ - &#8203;<!-- 11 -->[test] Fix Escape event firing event (#43961) @oliviertassinari
68
+ - &#8203;<!-- 10 -->[test] Fix flaky pigment-css screenshot (#43959) @Janpot
69
+ - &#8203;<!-- 07 -->[website] Add missing \_redirects HTTP status @oliviertassinari
70
+ - &#8203;<!-- 06 -->[website] Fix sponsor image height @oliviertassinari
71
+ - &#8203;<!-- 05 -->[website] Remove srcset, does nothing in README @oliviertassinari
72
+ - &#8203;<!-- 04 -->[website] Polish display of sponsors @oliviertassinari
73
+ - &#8203;<!-- 03 -->[website] Standardize utm tags @oliviertassinari
74
+ - &#8203;<!-- 02 -->[website] Improve utm_source strategy @oliviertassinari
75
+ - &#8203;<!-- 01 -->[website] Clarify min-level docs-infra @oliviertassinari
76
+ - &#8203;<!-- 08 -->[website] Update backlink sponsors (#43995) @rluzists1
77
+
78
+ All contributors of this release in alphabetical order: @aarongarciah, @Asin-Junior-Honore, @barrownicholas, @Chee7ah, @effektsvk, @hieunguyenduc696, @Janpot, @Juneezee, @k-rajat19, @mnajdova, @oliviertassinari, @romgrk, @sai6855, @siriwatknp, @wojtek35, @yonatan0
79
+
80
+ ## v6.1.2
81
+
82
+ <!-- generated comparing v6.1.1..master -->
83
+
84
+ _Oct 2, 2024_
85
+
86
+ A big thanks to the 13 contributors who made this release possible.
87
+
88
+ ### `@mui/material@6.1.2`
89
+
90
+ - [Autocomplete] Fix listbox opens and closes on click when used with `limitTags` (#42494) @appleSimple
91
+ - [Button] Ignore `dark` and `contrastText` if not provided in the theme (#43861) @siriwatknp
92
+ - [Button] Fix regression for color `inherit` (#43862) @siriwatknp
93
+ - [LinearProgress] Fix background color (#43949) @sai6855
94
+ - Support CSS variables with shadow DOM (#43948) @siriwatknp
95
+ - [Rating] Use Rating `name` as prefix of input element ids (#43829) @yash49
96
+ - [Drawer] Fix issue with main window being used instead of iframe's window (#43818) @albarv340
97
+ - [ThemeProvider] Support setting default mode (#43951) @siriwatknp
98
+
99
+ ### Docs
100
+
101
+ - Update theme toggle demo (#43956) @Janpot
102
+ - Add note about minimum required webpack version (#43864) @Janpot
103
+ - Format Pigment CSS docs (#43812) @oliviertassinari
104
+ - Fix visual bug on dashboard template (#43836) @oliviertassinari
105
+ - Fix pigment-css.md syntax error (#43837) @kdichev
106
+ - Fix Sign-in template form experience (#43838) @oliviertassinari
107
+ - Remove "To be continued" section from v0 –> v1 migration guide (#43832) @samuelsycamore
108
+ - Fix 301 to chromium (#43809) @oliviertassinari
109
+ - [joy-ui] Add missing ComponentLinkHeader components (#43865) @samuelsycamore
110
+ - [Modal] Remove unnecessary type assertion (#43825) @ZeeshanTamboli
111
+ - [Table] Stabilize random series in virtualized table demo (#43744) @Janpot
112
+ - [system] Add migration guide link to `@mui/styles` pages (#43833) @samuelsycamore
113
+
114
+ ### Core
115
+
116
+ - [code-infra] Fix flaky dashboard screenshot - take 2 (#43937) @Janpot
117
+ - [code-infra] Replace all instances of `e` with `event` and add eslint rule (#43866) @samuelsycamore
118
+ - [code-infra] Fix and update bundling fixtures (#43709) @Janpot
119
+ - [code-infra] Update transitive dependencies with vulnerabilties (#43895) @Janpot
120
+ - [code-infra] Optimize regression tests (#43889) @Janpot
121
+ - [code-infra] Remove custom playwright installation steps (#43881) @Janpot
122
+ - [code-infra] Fix flaky dashboard screenshot (#43890) @Janpot
123
+ - [code-infra] Add new instanceof proptypes for toolpad (#43814) @Janpot
124
+ - Fix eslint-plugin-react-compiler issues in usePagination tests (#43946) @wilhelmlofsten
125
+ - Uniformity in version range @oliviertassinari
126
+ - Replace `toBeAriaHidden` matcher with `toBeInaccessible` in tests (#43870) @ZeeshanTamboli
127
+ - [docs-infra] Strengthen CSP (#43711) @oliviertassinari
128
+ - [docs-infra] Open Codesandbox demo with fontsize=12 (#43860) @siriwatknp
129
+ - [icons] Reduce Material Icon page size (#43911) @oliviertassinari
130
+ - [test] Point Istanbul to correct URL (#43935) @sai6855
131
+ - [test] Sync React.version parse logic with codebase (#43820) @oliviertassinari
132
+ - Improve getReactElementRef() utils (#43022) @sai6855
133
+ - [Drawer] Refactor getScrollbarSize usages (#43828) @BrianWoolfolk
134
+ - [Modal] Replace `show` parameter name with `hide` in modal manager (#43868) @ZeeshanTamboli
135
+ - [Modal] Remove unnecessary `manager` prop handling (#43867) @ZeeshanTamboli
136
+
137
+ All contributors of this release in alphabetical order: @albarv340, @appleSimple, @BrianWoolfolk, @DanailH, @Janpot, @kdichev, @oliviertassinari, @sai6855, @samuelsycamore, @siriwatknp, @wilhelmlofsten, @yash49, @ZeeshanTamboli
138
+
3
139
  ## v6.1.1
4
140
 
5
141
  <!-- generated comparing v6.1.0..master -->
@@ -3,7 +3,7 @@
3
3
  import * as React from 'react';
4
4
  import PropTypes from 'prop-types';
5
5
  import { elementAcceptingRef, exactProp, unstable_ownerDocument as ownerDocument, unstable_useForkRef as useForkRef, unstable_useEventCallback as useEventCallback } from '@mui/utils';
6
- import getReactNodeRef from '@mui/utils/getReactNodeRef';
6
+ import getReactElementRef from '@mui/utils/getReactElementRef';
7
7
 
8
8
  // TODO: return `EventHandlerName extends `on${infer EventName}` ? Lowercase<EventName> : never` once generatePropTypes runs with TS 4.1
9
9
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -48,7 +48,7 @@ function ClickAwayListener(props) {
48
48
  activatedRef.current = false;
49
49
  };
50
50
  }, []);
51
- const handleRef = useForkRef(getReactNodeRef(children), nodeRef);
51
+ const handleRef = useForkRef(getReactElementRef(children), nodeRef);
52
52
 
53
53
  // The handler doesn't take event.defaultPrevented into account:
54
54
  //
package/Fade/Fade.js CHANGED
@@ -4,7 +4,7 @@ import * as React from 'react';
4
4
  import PropTypes from 'prop-types';
5
5
  import { Transition } from 'react-transition-group';
6
6
  import elementAcceptingRef from '@mui/utils/elementAcceptingRef';
7
- import getReactNodeRef from '@mui/utils/getReactNodeRef';
7
+ import getReactElementRef from '@mui/utils/getReactElementRef';
8
8
  import { useTheme } from "../zero-styled/index.js";
9
9
  import { reflow, getTransitionProps } from "../transitions/utils.js";
10
10
  import useForkRef from "../utils/useForkRef.js";
@@ -48,7 +48,7 @@ const Fade = /*#__PURE__*/React.forwardRef(function Fade(props, ref) {
48
48
  } = props;
49
49
  const enableStrictModeCompat = true;
50
50
  const nodeRef = React.useRef(null);
51
- const handleRef = useForkRef(nodeRef, getReactNodeRef(children), ref);
51
+ const handleRef = useForkRef(nodeRef, getReactElementRef(children), ref);
52
52
  const normalizedTransitionCallback = callback => maybeIsAppearing => {
53
53
  if (callback) {
54
54
  const node = nodeRef.current;
package/Grid2/Grid2.d.ts CHANGED
@@ -43,24 +43,29 @@ export interface GridBaseProps {
43
43
  offset?: ResponsiveStyleValue<GridOffset>;
44
44
  /**
45
45
  * @internal
46
- * The level of the grid starts from `0`
47
- * and increases when the grid nests inside another grid regardless of container or item.
46
+ * The level of the grid starts from `0` and increases when the grid nests
47
+ * inside another grid. Nesting is defined as a container Grid being a direct
48
+ * child of a container Grid.
48
49
  *
49
50
  * ```js
50
- * <Grid> // level 0
51
- * <Grid> // level 1
52
- * <Grid> // level 2
53
- * <Grid> // level 1
51
+ * <Grid container> // level 0
52
+ * <Grid container> // level 1
53
+ * <Grid container> // level 2
54
54
  * ```
55
55
  *
56
- * Only consecutive grid is considered nesting.
57
- * A grid container will start at `0` if there are non-Grid element above it.
56
+ * Only consecutive grid is considered nesting. A grid container will start at
57
+ * `0` if there are non-Grid container element above it.
58
58
  *
59
59
  * ```js
60
- * <Grid> // level 0
60
+ * <Grid container> // level 0
61
61
  * <div>
62
- * <Grid> // level 0
63
- * <Grid> // level 1
62
+ * <Grid container> // level 0
63
+ * ```
64
+ *
65
+ * ```js
66
+ * <Grid container> // level 0
67
+ * <Grid>
68
+ * <Grid container> // level 0
64
69
  * ```
65
70
  */
66
71
  unstable_level?: number;
package/Grid2/Grid2.js CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  import PropTypes from 'prop-types';
4
4
  import { createGrid as createGrid2 } from '@mui/system/Grid';
5
+ import requirePropFactory from "../utils/requirePropFactory.js";
5
6
  import { styled, useThemeProps } from "../styles/index.js";
6
7
  /**
7
8
  *
@@ -81,24 +82,29 @@ process.env.NODE_ENV !== "production" ? Grid2.propTypes /* remove-proptypes */ =
81
82
  sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
82
83
  /**
83
84
  * @internal
84
- * The level of the grid starts from `0`
85
- * and increases when the grid nests inside another grid regardless of container or item.
85
+ * The level of the grid starts from `0` and increases when the grid nests
86
+ * inside another grid. Nesting is defined as a container Grid being a direct
87
+ * child of a container Grid.
86
88
  *
87
89
  * ```js
88
- * <Grid> // level 0
89
- * <Grid> // level 1
90
- * <Grid> // level 2
91
- * <Grid> // level 1
90
+ * <Grid container> // level 0
91
+ * <Grid container> // level 1
92
+ * <Grid container> // level 2
92
93
  * ```
93
94
  *
94
- * Only consecutive grid is considered nesting.
95
- * A grid container will start at `0` if there are non-Grid element above it.
95
+ * Only consecutive grid is considered nesting. A grid container will start at
96
+ * `0` if there are non-Grid container element above it.
96
97
  *
97
98
  * ```js
98
- * <Grid> // level 0
99
+ * <Grid container> // level 0
99
100
  * <div>
100
- * <Grid> // level 0
101
- * <Grid> // level 1
101
+ * <Grid container> // level 0
102
+ * ```
103
+ *
104
+ * ```js
105
+ * <Grid container> // level 0
106
+ * <Grid>
107
+ * <Grid container> // level 0
102
108
  * ```
103
109
  */
104
110
  unstable_level: PropTypes.number,
@@ -109,4 +115,16 @@ process.env.NODE_ENV !== "production" ? Grid2.propTypes /* remove-proptypes */ =
109
115
  */
110
116
  wrap: PropTypes.oneOf(['nowrap', 'wrap-reverse', 'wrap'])
111
117
  } : void 0;
118
+ if (process.env.NODE_ENV !== 'production') {
119
+ const Component = Grid2;
120
+ const requireProp = requirePropFactory('Grid2', Component);
121
+ // eslint-disable-next-line no-useless-concat
122
+ Component['propTypes' + ''] = {
123
+ // eslint-disable-next-line react/forbid-foreign-prop-types
124
+ ...Component.propTypes,
125
+ direction: requireProp('container'),
126
+ spacing: requireProp('container'),
127
+ wrap: requireProp('container')
128
+ };
129
+ }
112
130
  export default Grid2;
package/Grow/Grow.js CHANGED
@@ -4,7 +4,7 @@ import * as React from 'react';
4
4
  import PropTypes from 'prop-types';
5
5
  import useTimeout from '@mui/utils/useTimeout';
6
6
  import elementAcceptingRef from '@mui/utils/elementAcceptingRef';
7
- import getReactNodeRef from '@mui/utils/getReactNodeRef';
7
+ import getReactElementRef from '@mui/utils/getReactElementRef';
8
8
  import { Transition } from 'react-transition-group';
9
9
  import { useTheme } from "../zero-styled/index.js";
10
10
  import { getTransitionProps, reflow } from "../transitions/utils.js";
@@ -58,7 +58,7 @@ const Grow = /*#__PURE__*/React.forwardRef(function Grow(props, ref) {
58
58
  const autoTimeout = React.useRef();
59
59
  const theme = useTheme();
60
60
  const nodeRef = React.useRef(null);
61
- const handleRef = useForkRef(nodeRef, getReactNodeRef(children), ref);
61
+ const handleRef = useForkRef(nodeRef, getReactElementRef(children), ref);
62
62
  const normalizedTransitionCallback = callback => maybeIsAppearing => {
63
63
  if (callback) {
64
64
  const node = nodeRef.current;
package/Icon/Icon.js CHANGED
@@ -37,7 +37,7 @@ const IconRoot = styled('span', {
37
37
  userSelect: 'none',
38
38
  width: '1em',
39
39
  height: '1em',
40
- // Chrome fix for https://bugs.chromium.org/p/chromium/issues/detail?id=820541
40
+ // Chrome fix for https://issues.chromium.org/issues/41375697
41
41
  // To remove at some point.
42
42
  overflow: 'hidden',
43
43
  display: 'inline-block',
@@ -372,7 +372,7 @@ const InputBase = /*#__PURE__*/React.forwardRef(function InputBase(inProps, ref)
372
372
  if (!isControlled) {
373
373
  const element = event.target || inputRef.current;
374
374
  if (element == null) {
375
- throw new Error(process.env.NODE_ENV !== "production" ? `MUI: Expected valid input target. Did you use a custom \`inputComponent\` and forget to forward refs? See https://mui.com/r/input-component-ref-interface for more info.` : _formatMuiErrorMessage(1));
375
+ throw new Error(process.env.NODE_ENV !== "production" ? 'MUI: Expected valid input target. ' + 'Did you use a custom `inputComponent` and forget to forward refs? ' + 'See https://mui.com/r/input-component-ref-interface for more info.' : _formatMuiErrorMessage(1));
376
376
  }
377
377
  checkDirty({
378
378
  value: element.value
@@ -293,6 +293,13 @@ const LinearProgressBar2 = styled('span', {
293
293
  style: {
294
294
  backgroundColor: 'var(--LinearProgressBar2-barColor, currentColor)'
295
295
  }
296
+ }, {
297
+ props: ({
298
+ ownerState
299
+ }) => ownerState.variant !== 'buffer' && ownerState.color === 'inherit',
300
+ style: {
301
+ backgroundColor: 'currentColor'
302
+ }
296
303
  }, {
297
304
  props: {
298
305
  color: 'inherit'
@@ -8,6 +8,7 @@ import List from "../List/index.js";
8
8
  import getScrollbarSize from "../utils/getScrollbarSize.js";
9
9
  import useForkRef from "../utils/useForkRef.js";
10
10
  import useEnhancedEffect from "../utils/useEnhancedEffect.js";
11
+ import { ownerWindow } from "../utils/index.js";
11
12
  import { jsx as _jsx } from "react/jsx-runtime";
12
13
  function nextItem(list, item, disableListWrap) {
13
14
  if (list === item) {
@@ -111,7 +112,7 @@ const MenuList = /*#__PURE__*/React.forwardRef(function MenuList(props, ref) {
111
112
  // of the menu.
112
113
  const noExplicitWidth = !listRef.current.style.width;
113
114
  if (containerElement.clientHeight < listRef.current.clientHeight && noExplicitWidth) {
114
- const scrollbarSize = `${getScrollbarSize(ownerDocument(containerElement))}px`;
115
+ const scrollbarSize = `${getScrollbarSize(ownerWindow(containerElement))}px`;
115
116
  listRef.current.style[direction === 'rtl' ? 'paddingLeft' : 'paddingRight'] = scrollbarSize;
116
117
  listRef.current.style.width = `calc(100% + ${scrollbarSize})`;
117
118
  }
package/Modal/Modal.js CHANGED
@@ -187,12 +187,12 @@ const Modal = /*#__PURE__*/React.forwardRef(function Modal(inProps, ref) {
187
187
  getSlotProps: otherHandlers => {
188
188
  return getBackdropProps({
189
189
  ...otherHandlers,
190
- onClick: e => {
190
+ onClick: event => {
191
191
  if (onBackdropClick) {
192
- onBackdropClick(e);
192
+ onBackdropClick(event);
193
193
  }
194
194
  if (otherHandlers?.onClick) {
195
- otherHandlers.onClick(e);
195
+ otherHandlers.onClick(event);
196
196
  }
197
197
  }
198
198
  });
@@ -1,7 +1,7 @@
1
1
  export interface ManagedModalProps {
2
2
  disableScrollLock?: boolean;
3
3
  }
4
- export declare function ariaHidden(element: Element, show: boolean): void;
4
+ export declare function ariaHidden(element: Element, hide: boolean): void;
5
5
  interface Modal {
6
6
  mount: Element;
7
7
  modalRef: Element;
@@ -7,8 +7,8 @@ function isOverflowing(container) {
7
7
  }
8
8
  return container.scrollHeight > container.clientHeight;
9
9
  }
10
- export function ariaHidden(element, show) {
11
- if (show) {
10
+ export function ariaHidden(element, hide) {
11
+ if (hide) {
12
12
  element.setAttribute('aria-hidden', 'true');
13
13
  } else {
14
14
  element.removeAttribute('aria-hidden');
@@ -26,13 +26,13 @@ function isAriaHiddenForbiddenOnElement(element) {
26
26
  const isInputHidden = element.tagName === 'INPUT' && element.getAttribute('type') === 'hidden';
27
27
  return isForbiddenTagName || isInputHidden;
28
28
  }
29
- function ariaHiddenSiblings(container, mountElement, currentElement, elementsToExclude, show) {
29
+ function ariaHiddenSiblings(container, mountElement, currentElement, elementsToExclude, hide) {
30
30
  const blacklist = [mountElement, currentElement, ...elementsToExclude];
31
31
  [].forEach.call(container.children, element => {
32
32
  const isNotExcludedElement = !blacklist.includes(element);
33
33
  const isNotForbiddenElement = !isAriaHiddenForbiddenOnElement(element);
34
34
  if (isNotExcludedElement && isNotForbiddenElement) {
35
- ariaHidden(element, show);
35
+ ariaHidden(element, hide);
36
36
  }
37
37
  });
38
38
  }
@@ -53,7 +53,7 @@ function handleContainer(containerInfo, props) {
53
53
  if (!props.disableScrollLock) {
54
54
  if (isOverflowing(container)) {
55
55
  // Compute the size before applying overflow hidden to avoid any scroll jumps.
56
- const scrollbarSize = getScrollbarSize(ownerDocument(container));
56
+ const scrollbarSize = getScrollbarSize(ownerWindow(container));
57
57
  restoreStyle.push({
58
58
  value: container.style.paddingRight,
59
59
  property: 'padding-right',
package/Modal/useModal.js CHANGED
@@ -13,7 +13,7 @@ function getHasTransition(children) {
13
13
 
14
14
  // A modal manager used to track and manage the state of open Modals.
15
15
  // Modals don't open on the server so this won't conflict with concurrent requests.
16
- const defaultManager = new ModalManager();
16
+ const manager = new ModalManager();
17
17
  /**
18
18
  *
19
19
  * Demos:
@@ -29,8 +29,6 @@ function useModal(parameters) {
29
29
  container,
30
30
  disableEscapeKeyDown = false,
31
31
  disableScrollLock = false,
32
- // @ts-ignore internal logic - Base UI supports the manager as a prop too
33
- manager = defaultManager,
34
32
  closeAfterTransition = false,
35
33
  onTransitionEnter,
36
34
  onTransitionExited,
@@ -76,7 +74,7 @@ function useModal(parameters) {
76
74
  handleMounted();
77
75
  }
78
76
  });
79
- const isTopModal = React.useCallback(() => manager.isTopModal(getModal()), [manager]);
77
+ const isTopModal = () => manager.isTopModal(getModal());
80
78
  const handlePortalRef = useEventCallback(node => {
81
79
  mountNodeRef.current = node;
82
80
  if (!node) {
@@ -90,7 +88,7 @@ function useModal(parameters) {
90
88
  });
91
89
  const handleClose = React.useCallback(() => {
92
90
  manager.remove(getModal(), ariaHiddenProp);
93
- }, [ariaHiddenProp, manager]);
91
+ }, [ariaHiddenProp]);
94
92
  React.useEffect(() => {
95
93
  return () => {
96
94
  handleClose();
@@ -145,6 +143,12 @@ function useModal(parameters) {
145
143
  ...otherHandlers
146
144
  };
147
145
  return {
146
+ /*
147
+ * Marking an element with the role presentation indicates to assistive technology
148
+ * that this element should be ignored; it exists to support the web application and
149
+ * is not meant for humans to interact with directly.
150
+ * https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/no-static-element-interactions.md
151
+ */
148
152
  role: 'presentation',
149
153
  ...externalEventHandlers,
150
154
  onKeyDown: createHandleKeyDown(externalEventHandlers),
@@ -46,6 +46,12 @@ const OutlinedInputRoot = styled(InputBaseRoot, {
46
46
  [`&:hover .${outlinedInputClasses.notchedOutline}`]: {
47
47
  borderColor: (theme.vars || theme).palette.text.primary
48
48
  },
49
+ // Reset on touch devices, it doesn't add specificity
50
+ '@media (hover: none)': {
51
+ [`&:hover .${outlinedInputClasses.notchedOutline}`]: {
52
+ borderColor: theme.vars ? `rgba(${theme.vars.palette.common.onBackgroundChannel} / 0.23)` : borderColor
53
+ }
54
+ },
49
55
  [`&.${outlinedInputClasses.focused} .${outlinedInputClasses.notchedOutline}`]: {
50
56
  borderWidth: 2
51
57
  },
@@ -62,12 +68,6 @@ const OutlinedInputRoot = styled(InputBaseRoot, {
62
68
  props: {},
63
69
  // to overide the above style
64
70
  style: {
65
- // Reset on touch devices, it doesn't add specificity
66
- '@media (hover: none)': {
67
- [`&:hover .${outlinedInputClasses.notchedOutline}`]: {
68
- borderColor: theme.vars ? `rgba(${theme.vars.palette.common.onBackgroundChannel} / 0.23)` : borderColor
69
- }
70
- },
71
71
  [`&.${outlinedInputClasses.error} .${outlinedInputClasses.notchedOutline}`]: {
72
72
  borderColor: (theme.vars || theme).palette.error.main
73
73
  },
@@ -40,29 +40,6 @@ export interface GridBaseProps {
40
40
  * Defines the offset of the grid.
41
41
  */
42
42
  offset?: ResponsiveStyleValue<number> | undefined;
43
- /**
44
- * @internal
45
- * The level of the grid starts from `0`
46
- * and increases when the grid nests inside another grid regardless of container or item.
47
- *
48
- * ```js
49
- * <Grid> // level 0
50
- * <Grid> // level 1
51
- * <Grid> // level 2
52
- * <Grid> // level 1
53
- * ```
54
- *
55
- * Only consecutive grid is considered nesting.
56
- * A grid container will start at `0` if there are non-Grid element above it.
57
- *
58
- * ```js
59
- * <Grid> // level 0
60
- * <div>
61
- * <Grid> // level 0
62
- * <Grid> // level 1
63
- * ```
64
- */
65
- unstable_level?: number;
66
43
  /**
67
44
  * Defines the vertical space between the type `item` components.
68
45
  * It overrides the value of the `spacing` prop.