@mui/material 6.0.0-beta.2 → 6.0.0-beta.3-dev.20240725-084532-7340f56bef

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 (73) hide show
  1. package/CHANGELOG.md +427 -33
  2. package/Divider/Divider.js +6 -2
  3. package/Fade/Fade.js +2 -1
  4. package/Grow/Grow.js +2 -1
  5. package/ImageListItemBar/ImageListItemBar.js +1 -1
  6. package/ImageListItemBar/imageListItemBarClasses.d.ts +16 -4
  7. package/ImageListItemBar/imageListItemBarClasses.js +1 -1
  8. package/Paper/Paper.js +1 -1
  9. package/Rating/Rating.d.ts +1 -1
  10. package/Rating/Rating.js +2 -2
  11. package/Select/selectClasses.d.ts +2 -0
  12. package/Slide/Slide.js +2 -1
  13. package/Tooltip/Tooltip.js +2 -1
  14. package/Typography/Typography.d.ts +1 -0
  15. package/Typography/Typography.js +1 -0
  16. package/Typography/typographyClasses.d.ts +4 -1
  17. package/Zoom/Zoom.js +2 -1
  18. package/index.js +1 -1
  19. package/modern/Divider/Divider.js +6 -2
  20. package/modern/Fade/Fade.js +2 -1
  21. package/modern/Grow/Grow.js +2 -1
  22. package/modern/ImageListItemBar/ImageListItemBar.js +1 -1
  23. package/modern/ImageListItemBar/imageListItemBarClasses.js +1 -1
  24. package/modern/Paper/Paper.js +1 -1
  25. package/modern/Rating/Rating.js +2 -2
  26. package/modern/Slide/Slide.js +2 -1
  27. package/modern/Tooltip/Tooltip.js +2 -1
  28. package/modern/Typography/Typography.js +1 -0
  29. package/modern/Zoom/Zoom.js +2 -1
  30. package/modern/index.js +1 -1
  31. package/modern/styles/CssVarsProvider.js +0 -1
  32. package/modern/styles/createGetSelector.js +36 -7
  33. package/modern/styles/excludeVariablesFromRoot.js +1 -1
  34. package/modern/styles/extendTheme.js +105 -65
  35. package/modern/styles/index.js +1 -0
  36. package/modern/styles/shouldSkipGeneratingVar.js +1 -1
  37. package/modern/styles/stringifyTheme.js +1 -2
  38. package/modern/utils/getChildRef.js +9 -0
  39. package/node/Divider/Divider.js +6 -2
  40. package/node/Fade/Fade.js +2 -1
  41. package/node/Grow/Grow.js +2 -1
  42. package/node/ImageListItemBar/ImageListItemBar.js +1 -1
  43. package/node/ImageListItemBar/imageListItemBarClasses.js +1 -1
  44. package/node/Paper/Paper.js +2 -2
  45. package/node/Rating/Rating.js +2 -2
  46. package/node/Slide/Slide.js +2 -1
  47. package/node/Tooltip/Tooltip.js +2 -1
  48. package/node/Typography/Typography.js +1 -0
  49. package/node/Zoom/Zoom.js +2 -1
  50. package/node/index.js +1 -1
  51. package/node/styles/CssVarsProvider.js +0 -1
  52. package/node/styles/createGetSelector.js +36 -7
  53. package/node/styles/excludeVariablesFromRoot.js +1 -1
  54. package/node/styles/extendTheme.js +105 -65
  55. package/node/styles/index.js +8 -0
  56. package/node/styles/shouldSkipGeneratingVar.js +1 -1
  57. package/node/styles/stringifyTheme.js +1 -2
  58. package/node/utils/getChildRef.js +17 -0
  59. package/package.json +5 -5
  60. package/styles/CssVarsProvider.d.ts +2 -1
  61. package/styles/CssVarsProvider.js +0 -1
  62. package/styles/createGetSelector.d.ts +6 -2
  63. package/styles/createGetSelector.js +36 -7
  64. package/styles/excludeVariablesFromRoot.d.ts +1 -1
  65. package/styles/excludeVariablesFromRoot.js +1 -1
  66. package/styles/extendTheme.d.ts +21 -16
  67. package/styles/extendTheme.js +105 -65
  68. package/styles/index.d.ts +1 -0
  69. package/styles/index.js +1 -0
  70. package/styles/shouldSkipGeneratingVar.js +1 -1
  71. package/styles/stringifyTheme.js +1 -2
  72. package/utils/getChildRef.d.ts +1 -0
  73. package/utils/getChildRef.js +9 -0
@@ -113,6 +113,8 @@ const DividerRoot = styled('div', {
113
113
  whiteSpace: 'nowrap',
114
114
  textAlign: 'center',
115
115
  border: 0,
116
+ borderTopStyle: 'solid',
117
+ borderLeftStyle: 'solid',
116
118
  '&::before, &::after': {
117
119
  content: '""',
118
120
  alignSelf: 'center'
@@ -125,7 +127,8 @@ const DividerRoot = styled('div', {
125
127
  style: {
126
128
  '&::before, &::after': {
127
129
  width: '100%',
128
- borderTop: `thin solid ${(theme.vars || theme).palette.divider}`
130
+ borderTop: `thin solid ${(theme.vars || theme).palette.divider}`,
131
+ borderTopStyle: 'inherit'
129
132
  }
130
133
  }
131
134
  }, {
@@ -136,7 +139,8 @@ const DividerRoot = styled('div', {
136
139
  flexDirection: 'column',
137
140
  '&::before, &::after': {
138
141
  height: '100%',
139
- borderLeft: `thin solid ${(theme.vars || theme).palette.divider}`
142
+ borderLeft: `thin solid ${(theme.vars || theme).palette.divider}`,
143
+ borderLeftStyle: 'inherit'
140
144
  }
141
145
  }
142
146
  }, {
package/Fade/Fade.js CHANGED
@@ -7,6 +7,7 @@ import elementAcceptingRef from '@mui/utils/elementAcceptingRef';
7
7
  import { useTheme } from '../zero-styled';
8
8
  import { reflow, getTransitionProps } from '../transitions/utils';
9
9
  import useForkRef from '../utils/useForkRef';
10
+ import getChildRef from '../utils/getChildRef';
10
11
  import { jsx as _jsx } from "react/jsx-runtime";
11
12
  const styles = {
12
13
  entering: {
@@ -47,7 +48,7 @@ const Fade = /*#__PURE__*/React.forwardRef(function Fade(props, ref) {
47
48
  } = props;
48
49
  const enableStrictModeCompat = true;
49
50
  const nodeRef = React.useRef(null);
50
- const handleRef = useForkRef(nodeRef, children.ref, ref);
51
+ const handleRef = useForkRef(nodeRef, getChildRef(children), ref);
51
52
  const normalizedTransitionCallback = callback => maybeIsAppearing => {
52
53
  if (callback) {
53
54
  const node = nodeRef.current;
package/Grow/Grow.js CHANGED
@@ -8,6 +8,7 @@ import { Transition } from 'react-transition-group';
8
8
  import { useTheme } from '../zero-styled';
9
9
  import { getTransitionProps, reflow } from '../transitions/utils';
10
10
  import useForkRef from '../utils/useForkRef';
11
+ import getChildRef from '../utils/getChildRef';
11
12
  import { jsx as _jsx } from "react/jsx-runtime";
12
13
  function getScale(value) {
13
14
  return `scale(${value}, ${value ** 2})`;
@@ -57,7 +58,7 @@ const Grow = /*#__PURE__*/React.forwardRef(function Grow(props, ref) {
57
58
  const autoTimeout = React.useRef();
58
59
  const theme = useTheme();
59
60
  const nodeRef = React.useRef(null);
60
- const handleRef = useForkRef(nodeRef, children.ref, ref);
61
+ const handleRef = useForkRef(nodeRef, getChildRef(children), ref);
61
62
  const normalizedTransitionCallback = callback => maybeIsAppearing => {
62
63
  if (callback) {
63
64
  const node = nodeRef.current;
@@ -17,7 +17,7 @@ const useUtilityClasses = ownerState => {
17
17
  actionPosition
18
18
  } = ownerState;
19
19
  const slots = {
20
- root: ['root', `position${capitalize(position)}`],
20
+ root: ['root', `position${capitalize(position)}`, `actionPosition${capitalize(actionPosition)}`],
21
21
  titleWrap: ['titleWrap', `titleWrap${capitalize(position)}`, actionIcon && `titleWrapActionPos${capitalize(actionPosition)}`],
22
22
  title: ['title'],
23
23
  subtitle: ['subtitle'],
@@ -7,13 +7,23 @@ export interface ImageListItemBarClasses {
7
7
  positionTop: string;
8
8
  /** Styles applied to the root element if `position="below"`. */
9
9
  positionBelow: string;
10
+ /** Styles applied to the action container element if `actionPosition="left"`. */
11
+ actionPositionLeft: string;
12
+ /** Styles applied to the action container element if `actionPosition="right"`. */
13
+ actionPositionRight: string;
10
14
  /** Styles applied to the title and subtitle container element. */
11
15
  titleWrap: string;
12
- /** Styles applied to the title and subtitle container element if `position="below"`. */
16
+ /** Styles applied to the title and subtitle container element if `position="below"`.
17
+ * @deprecated Combine the [.MuiImageListItemBar-titleWrap](/material-ui/api/image-list-item-bar/#image-list-item-bar-classes-titleWrap) and [.MuiImageListItemBar-positionBelow](/material-ui/api/image-list-item-bar/#image-list-item-bar-classes-positionBelow) classes instead. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
18
+ */
13
19
  titleWrapBelow: string;
14
- /** Styles applied to the container element if `actionPosition="left"`. */
20
+ /** Styles applied to the container element if `actionPosition="left"`.
21
+ * @deprecated Combine the [.MuiImageListItemBar-titleWrap](/material-ui/api/image-list-item-bar/#image-list-item-bar-classes-titleWrap) and [.MuiImageListItemBar-actionPositionLeft](/material-ui/api/image-list-item-bar/#image-list-item-bar-classes-actionPositionLeft) classes instead. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
22
+ */
15
23
  titleWrapActionPosLeft: string;
16
- /** Styles applied to the container element if `actionPosition="right"`. */
24
+ /** Styles applied to the container element if `actionPosition="right"`.
25
+ * @deprecated Combine the [.MuiImageListItemBar-titleWrap](/material-ui/api/image-list-item-bar/#image-list-item-bar-classes-titleWrap) and [.MuiImageListItemBar-actionPositionRight](/material-ui/api/image-list-item-bar/#image-list-item-bar-classes-actionPositionRight) classes instead. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
26
+ */
17
27
  titleWrapActionPosRight: string;
18
28
  /** Styles applied to the title container element. */
19
29
  title: string;
@@ -21,7 +31,9 @@ export interface ImageListItemBarClasses {
21
31
  subtitle: string;
22
32
  /** Styles applied to the actionIcon if supplied. */
23
33
  actionIcon: string;
24
- /** Styles applied to the actionIcon if `actionPosition="left"`. */
34
+ /** Styles applied to the actionIcon if `actionPosition="left"`.
35
+ * @deprecated Combine the [.MuiImageListItemBar-actionIcon](/material-ui/api/image-list-item-bar/#image-list-item-bar-classes-actionIcon) and [.MuiImageListItemBar-actionPositionLeft](/material-ui/api/image-list-item-bar/#image-list-item-bar-classes-actionPositionLeft) classes instead. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
36
+ */
25
37
  actionIconActionPosLeft: string;
26
38
  }
27
39
  export type ImageListItemBarClassKey = keyof ImageListItemBarClasses;
@@ -3,5 +3,5 @@ import generateUtilityClass from '@mui/utils/generateUtilityClass';
3
3
  export function getImageListItemBarUtilityClass(slot) {
4
4
  return generateUtilityClass('MuiImageListItemBar', slot);
5
5
  }
6
- const imageListItemBarClasses = generateUtilityClasses('MuiImageListItemBar', ['root', 'positionBottom', 'positionTop', 'positionBelow', 'titleWrap', 'titleWrapBottom', 'titleWrapTop', 'titleWrapBelow', 'titleWrapActionPosLeft', 'titleWrapActionPosRight', 'title', 'subtitle', 'actionIcon', 'actionIconActionPosLeft', 'actionIconActionPosRight']);
6
+ const imageListItemBarClasses = generateUtilityClasses('MuiImageListItemBar', ['root', 'positionBottom', 'positionTop', 'positionBelow', 'actionPositionLeft', 'actionPositionRight', 'titleWrap', 'titleWrapBottom', 'titleWrapTop', 'titleWrapBelow', 'titleWrapActionPosLeft', 'titleWrapActionPosRight', 'title', 'subtitle', 'actionIcon', 'actionIconActionPosLeft', 'actionIconActionPosRight']);
7
7
  export default imageListItemBarClasses;
package/Paper/Paper.js CHANGED
@@ -100,7 +100,7 @@ const Paper = /*#__PURE__*/React.forwardRef(function Paper(inProps, ref) {
100
100
  ...(variant === 'elevation' && {
101
101
  '--Paper-shadow': (theme.vars || theme).shadows[elevation],
102
102
  ...(theme.vars && {
103
- '--Paper-overlay': theme.overlays?.[elevation]
103
+ '--Paper-overlay': theme.vars.overlays?.[elevation]
104
104
  }),
105
105
  ...(!theme.vars && theme.palette.mode === 'dark' && {
106
106
  '--Paper-overlay': `linear-gradient(${alpha('#fff', getOverlayAlpha(elevation))}, ${alpha('#fff', getOverlayAlpha(elevation))})`
@@ -44,7 +44,7 @@ export interface RatingProps
44
44
  * @param {number} value The rating label's value to format.
45
45
  * @returns {string}
46
46
  * @default function defaultLabelText(value) {
47
- * return `${value} Star${value !== 1 ? 's' : ''}`;
47
+ * return `${value || '0'} Star${value !== 1 ? 's' : ''}`;
48
48
  * }
49
49
  */
50
50
  getLabelText?: (value: number) => string;
package/Rating/Rating.js CHANGED
@@ -303,7 +303,7 @@ const defaultEmptyIcon = /*#__PURE__*/_jsx(StarBorder, {
303
303
  fontSize: "inherit"
304
304
  });
305
305
  function defaultLabelText(value) {
306
- return `${value} Star${value !== 1 ? 's' : ''}`;
306
+ return `${value || '0'} Star${value !== 1 ? 's' : ''}`;
307
307
  }
308
308
  const Rating = /*#__PURE__*/React.forwardRef(function Rating(inProps, ref) {
309
309
  const props = useDefaultProps({
@@ -588,7 +588,7 @@ process.env.NODE_ENV !== "production" ? Rating.propTypes /* remove-proptypes */
588
588
  * @param {number} value The rating label's value to format.
589
589
  * @returns {string}
590
590
  * @default function defaultLabelText(value) {
591
- * return `${value} Star${value !== 1 ? 's' : ''}`;
591
+ * return `${value || '0'} Star${value !== 1 ? 's' : ''}`;
592
592
  * }
593
593
  */
594
594
  getLabelText: PropTypes.func,
@@ -7,6 +7,8 @@ export interface SelectClasses {
7
7
  multiple: string;
8
8
  /** Styles applied to the select component if `variant="filled"`. */
9
9
  filled: string;
10
+ /** Styles applied to the select component if it is focused. */
11
+ focused: string;
10
12
  /** Styles applied to the select component if `variant="outlined"`. */
11
13
  outlined: string;
12
14
  /** Styles applied to the select component if `variant="standard"`. */
package/Slide/Slide.js CHANGED
@@ -11,6 +11,7 @@ import useForkRef from '../utils/useForkRef';
11
11
  import { useTheme } from '../zero-styled';
12
12
  import { reflow, getTransitionProps } from '../transitions/utils';
13
13
  import { ownerWindow } from '../utils';
14
+ import getChildRef from '../utils/getChildRef';
14
15
 
15
16
  // Translate the node so it can't be seen on the screen.
16
17
  // Later, we're going to translate the node back to its original location with `none`.
@@ -105,7 +106,7 @@ const Slide = /*#__PURE__*/React.forwardRef(function Slide(props, ref) {
105
106
  ...other
106
107
  } = props;
107
108
  const childrenRef = React.useRef(null);
108
- const handleRef = useForkRef(children.ref, childrenRef, ref);
109
+ const handleRef = useForkRef(getChildRef(children), childrenRef, ref);
109
110
  const normalizedTransitionCallback = callback => isAppearing => {
110
111
  if (callback) {
111
112
  // onEnterXxx and onExitXxx callbacks have a different arguments.length value.
@@ -20,6 +20,7 @@ import useForkRef from '../utils/useForkRef';
20
20
  import useId from '../utils/useId';
21
21
  import useControlled from '../utils/useControlled';
22
22
  import tooltipClasses, { getTooltipUtilityClass } from './tooltipClasses';
23
+ import getChildRef from '../utils/getChildRef';
23
24
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
24
25
  function round(value) {
25
26
  return Math.round(value * 1e5) / 1e5;
@@ -510,7 +511,7 @@ const Tooltip = /*#__PURE__*/React.forwardRef(function Tooltip(inProps, ref) {
510
511
  document.removeEventListener('keydown', handleKeyDown);
511
512
  };
512
513
  }, [handleClose, open]);
513
- const handleRef = useForkRef(children.ref, setChildNode, ref);
514
+ const handleRef = useForkRef(getChildRef(children), setChildNode, ref);
514
515
 
515
516
  // There is no point in displaying an empty tooltip.
516
517
  // So we exclude all falsy values, except 0, which is valid.
@@ -38,6 +38,7 @@ export interface TypographyOwnProps extends SystemProps<Theme> {
38
38
  /**
39
39
  * If `true`, the element will be a paragraph element.
40
40
  * @default false
41
+ * @deprecated Use the `component` prop instead. This prop will be removed in v7. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
41
42
  */
42
43
  paragraph?: boolean;
43
44
  /**
@@ -214,6 +214,7 @@ process.env.NODE_ENV !== "production" ? Typography.propTypes /* remove-proptypes
214
214
  /**
215
215
  * If `true`, the element will be a paragraph element.
216
216
  * @default false
217
+ * @deprecated Use the `component` prop instead. This prop will be removed in v7. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
217
218
  */
218
219
  paragraph: PropTypes.bool,
219
220
  /**
@@ -41,7 +41,10 @@ export interface TypographyClasses {
41
41
  noWrap: string;
42
42
  /** Styles applied to the root element if `gutterBottom={true}`. */
43
43
  gutterBottom: string;
44
- /** Styles applied to the root element if `paragraph={true}`. */
44
+ /**
45
+ * Styles applied to the root element if `paragraph={true}`.
46
+ * @deprecated
47
+ */
45
48
  paragraph: string;
46
49
  }
47
50
  export type TypographyClassKey = keyof TypographyClasses;
package/Zoom/Zoom.js CHANGED
@@ -7,6 +7,7 @@ import elementAcceptingRef from '@mui/utils/elementAcceptingRef';
7
7
  import { useTheme } from '../zero-styled';
8
8
  import { reflow, getTransitionProps } from '../transitions/utils';
9
9
  import useForkRef from '../utils/useForkRef';
10
+ import getChildRef from '../utils/getChildRef';
10
11
  import { jsx as _jsx } from "react/jsx-runtime";
11
12
  const styles = {
12
13
  entering: {
@@ -47,7 +48,7 @@ const Zoom = /*#__PURE__*/React.forwardRef(function Zoom(props, ref) {
47
48
  ...other
48
49
  } = props;
49
50
  const nodeRef = React.useRef(null);
50
- const handleRef = useForkRef(nodeRef, children.ref, ref);
51
+ const handleRef = useForkRef(nodeRef, getChildRef(children), ref);
51
52
  const normalizedTransitionCallback = callback => maybeIsAppearing => {
52
53
  if (callback) {
53
54
  const node = nodeRef.current;
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/material v6.0.0-beta.2
2
+ * @mui/material v6.0.0-beta.3-dev.20240725-084532-7340f56bef
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -113,6 +113,8 @@ const DividerRoot = styled('div', {
113
113
  whiteSpace: 'nowrap',
114
114
  textAlign: 'center',
115
115
  border: 0,
116
+ borderTopStyle: 'solid',
117
+ borderLeftStyle: 'solid',
116
118
  '&::before, &::after': {
117
119
  content: '""',
118
120
  alignSelf: 'center'
@@ -125,7 +127,8 @@ const DividerRoot = styled('div', {
125
127
  style: {
126
128
  '&::before, &::after': {
127
129
  width: '100%',
128
- borderTop: `thin solid ${(theme.vars || theme).palette.divider}`
130
+ borderTop: `thin solid ${(theme.vars || theme).palette.divider}`,
131
+ borderTopStyle: 'inherit'
129
132
  }
130
133
  }
131
134
  }, {
@@ -136,7 +139,8 @@ const DividerRoot = styled('div', {
136
139
  flexDirection: 'column',
137
140
  '&::before, &::after': {
138
141
  height: '100%',
139
- borderLeft: `thin solid ${(theme.vars || theme).palette.divider}`
142
+ borderLeft: `thin solid ${(theme.vars || theme).palette.divider}`,
143
+ borderLeftStyle: 'inherit'
140
144
  }
141
145
  }
142
146
  }, {
@@ -7,6 +7,7 @@ import elementAcceptingRef from '@mui/utils/elementAcceptingRef';
7
7
  import { useTheme } from '../zero-styled';
8
8
  import { reflow, getTransitionProps } from '../transitions/utils';
9
9
  import useForkRef from '../utils/useForkRef';
10
+ import getChildRef from '../utils/getChildRef';
10
11
  import { jsx as _jsx } from "react/jsx-runtime";
11
12
  const styles = {
12
13
  entering: {
@@ -47,7 +48,7 @@ const Fade = /*#__PURE__*/React.forwardRef(function Fade(props, ref) {
47
48
  } = props;
48
49
  const enableStrictModeCompat = true;
49
50
  const nodeRef = React.useRef(null);
50
- const handleRef = useForkRef(nodeRef, children.ref, ref);
51
+ const handleRef = useForkRef(nodeRef, getChildRef(children), ref);
51
52
  const normalizedTransitionCallback = callback => maybeIsAppearing => {
52
53
  if (callback) {
53
54
  const node = nodeRef.current;
@@ -8,6 +8,7 @@ import { Transition } from 'react-transition-group';
8
8
  import { useTheme } from '../zero-styled';
9
9
  import { getTransitionProps, reflow } from '../transitions/utils';
10
10
  import useForkRef from '../utils/useForkRef';
11
+ import getChildRef from '../utils/getChildRef';
11
12
  import { jsx as _jsx } from "react/jsx-runtime";
12
13
  function getScale(value) {
13
14
  return `scale(${value}, ${value ** 2})`;
@@ -57,7 +58,7 @@ const Grow = /*#__PURE__*/React.forwardRef(function Grow(props, ref) {
57
58
  const autoTimeout = React.useRef();
58
59
  const theme = useTheme();
59
60
  const nodeRef = React.useRef(null);
60
- const handleRef = useForkRef(nodeRef, children.ref, ref);
61
+ const handleRef = useForkRef(nodeRef, getChildRef(children), ref);
61
62
  const normalizedTransitionCallback = callback => maybeIsAppearing => {
62
63
  if (callback) {
63
64
  const node = nodeRef.current;
@@ -17,7 +17,7 @@ const useUtilityClasses = ownerState => {
17
17
  actionPosition
18
18
  } = ownerState;
19
19
  const slots = {
20
- root: ['root', `position${capitalize(position)}`],
20
+ root: ['root', `position${capitalize(position)}`, `actionPosition${capitalize(actionPosition)}`],
21
21
  titleWrap: ['titleWrap', `titleWrap${capitalize(position)}`, actionIcon && `titleWrapActionPos${capitalize(actionPosition)}`],
22
22
  title: ['title'],
23
23
  subtitle: ['subtitle'],
@@ -3,5 +3,5 @@ import generateUtilityClass from '@mui/utils/generateUtilityClass';
3
3
  export function getImageListItemBarUtilityClass(slot) {
4
4
  return generateUtilityClass('MuiImageListItemBar', slot);
5
5
  }
6
- const imageListItemBarClasses = generateUtilityClasses('MuiImageListItemBar', ['root', 'positionBottom', 'positionTop', 'positionBelow', 'titleWrap', 'titleWrapBottom', 'titleWrapTop', 'titleWrapBelow', 'titleWrapActionPosLeft', 'titleWrapActionPosRight', 'title', 'subtitle', 'actionIcon', 'actionIconActionPosLeft', 'actionIconActionPosRight']);
6
+ const imageListItemBarClasses = generateUtilityClasses('MuiImageListItemBar', ['root', 'positionBottom', 'positionTop', 'positionBelow', 'actionPositionLeft', 'actionPositionRight', 'titleWrap', 'titleWrapBottom', 'titleWrapTop', 'titleWrapBelow', 'titleWrapActionPosLeft', 'titleWrapActionPosRight', 'title', 'subtitle', 'actionIcon', 'actionIconActionPosLeft', 'actionIconActionPosRight']);
7
7
  export default imageListItemBarClasses;
@@ -100,7 +100,7 @@ const Paper = /*#__PURE__*/React.forwardRef(function Paper(inProps, ref) {
100
100
  ...(variant === 'elevation' && {
101
101
  '--Paper-shadow': (theme.vars || theme).shadows[elevation],
102
102
  ...(theme.vars && {
103
- '--Paper-overlay': theme.overlays?.[elevation]
103
+ '--Paper-overlay': theme.vars.overlays?.[elevation]
104
104
  }),
105
105
  ...(!theme.vars && theme.palette.mode === 'dark' && {
106
106
  '--Paper-overlay': `linear-gradient(${alpha('#fff', getOverlayAlpha(elevation))}, ${alpha('#fff', getOverlayAlpha(elevation))})`
@@ -303,7 +303,7 @@ const defaultEmptyIcon = /*#__PURE__*/_jsx(StarBorder, {
303
303
  fontSize: "inherit"
304
304
  });
305
305
  function defaultLabelText(value) {
306
- return `${value} Star${value !== 1 ? 's' : ''}`;
306
+ return `${value || '0'} Star${value !== 1 ? 's' : ''}`;
307
307
  }
308
308
  const Rating = /*#__PURE__*/React.forwardRef(function Rating(inProps, ref) {
309
309
  const props = useDefaultProps({
@@ -588,7 +588,7 @@ process.env.NODE_ENV !== "production" ? Rating.propTypes /* remove-proptypes */
588
588
  * @param {number} value The rating label's value to format.
589
589
  * @returns {string}
590
590
  * @default function defaultLabelText(value) {
591
- * return `${value} Star${value !== 1 ? 's' : ''}`;
591
+ * return `${value || '0'} Star${value !== 1 ? 's' : ''}`;
592
592
  * }
593
593
  */
594
594
  getLabelText: PropTypes.func,
@@ -11,6 +11,7 @@ import useForkRef from '../utils/useForkRef';
11
11
  import { useTheme } from '../zero-styled';
12
12
  import { reflow, getTransitionProps } from '../transitions/utils';
13
13
  import { ownerWindow } from '../utils';
14
+ import getChildRef from '../utils/getChildRef';
14
15
 
15
16
  // Translate the node so it can't be seen on the screen.
16
17
  // Later, we're going to translate the node back to its original location with `none`.
@@ -105,7 +106,7 @@ const Slide = /*#__PURE__*/React.forwardRef(function Slide(props, ref) {
105
106
  ...other
106
107
  } = props;
107
108
  const childrenRef = React.useRef(null);
108
- const handleRef = useForkRef(children.ref, childrenRef, ref);
109
+ const handleRef = useForkRef(getChildRef(children), childrenRef, ref);
109
110
  const normalizedTransitionCallback = callback => isAppearing => {
110
111
  if (callback) {
111
112
  // onEnterXxx and onExitXxx callbacks have a different arguments.length value.
@@ -20,6 +20,7 @@ import useForkRef from '../utils/useForkRef';
20
20
  import useId from '../utils/useId';
21
21
  import useControlled from '../utils/useControlled';
22
22
  import tooltipClasses, { getTooltipUtilityClass } from './tooltipClasses';
23
+ import getChildRef from '../utils/getChildRef';
23
24
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
24
25
  function round(value) {
25
26
  return Math.round(value * 1e5) / 1e5;
@@ -510,7 +511,7 @@ const Tooltip = /*#__PURE__*/React.forwardRef(function Tooltip(inProps, ref) {
510
511
  document.removeEventListener('keydown', handleKeyDown);
511
512
  };
512
513
  }, [handleClose, open]);
513
- const handleRef = useForkRef(children.ref, setChildNode, ref);
514
+ const handleRef = useForkRef(getChildRef(children), setChildNode, ref);
514
515
 
515
516
  // There is no point in displaying an empty tooltip.
516
517
  // So we exclude all falsy values, except 0, which is valid.
@@ -214,6 +214,7 @@ process.env.NODE_ENV !== "production" ? Typography.propTypes /* remove-proptypes
214
214
  /**
215
215
  * If `true`, the element will be a paragraph element.
216
216
  * @default false
217
+ * @deprecated Use the `component` prop instead. This prop will be removed in v7. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
217
218
  */
218
219
  paragraph: PropTypes.bool,
219
220
  /**
@@ -7,6 +7,7 @@ import elementAcceptingRef from '@mui/utils/elementAcceptingRef';
7
7
  import { useTheme } from '../zero-styled';
8
8
  import { reflow, getTransitionProps } from '../transitions/utils';
9
9
  import useForkRef from '../utils/useForkRef';
10
+ import getChildRef from '../utils/getChildRef';
10
11
  import { jsx as _jsx } from "react/jsx-runtime";
11
12
  const styles = {
12
13
  entering: {
@@ -47,7 +48,7 @@ const Zoom = /*#__PURE__*/React.forwardRef(function Zoom(props, ref) {
47
48
  ...other
48
49
  } = props;
49
50
  const nodeRef = React.useRef(null);
50
- const handleRef = useForkRef(nodeRef, children.ref, ref);
51
+ const handleRef = useForkRef(nodeRef, getChildRef(children), ref);
51
52
  const normalizedTransitionCallback = callback => maybeIsAppearing => {
52
53
  if (callback) {
53
54
  const node = nodeRef.current;
package/modern/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/material v6.0.0-beta.2
2
+ * @mui/material v6.0.0-beta.3-dev.20240725-084532-7340f56bef
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -16,7 +16,6 @@ const {
16
16
  } = createCssVarsProvider({
17
17
  themeId: THEME_ID,
18
18
  theme: defaultTheme,
19
- attribute: defaultConfig.attribute,
20
19
  colorSchemeStorageKey: defaultConfig.colorSchemeStorageKey,
21
20
  modeStorageKey: defaultConfig.modeStorageKey,
22
21
  defaultColorScheme: {
@@ -1,5 +1,17 @@
1
1
  import excludeVariablesFromRoot from './excludeVariablesFromRoot';
2
2
  export default (theme => (colorScheme, css) => {
3
+ const selector = theme.colorSchemeSelector;
4
+ let rule = selector;
5
+ if (selector === 'class') {
6
+ rule = '.%s';
7
+ }
8
+ if (selector === 'data') {
9
+ rule = '[data-%s]';
10
+ }
11
+ if (selector?.startsWith('data-') && !selector.includes('%s')) {
12
+ // 'data-mui-color-scheme' -> '[data-mui-color-scheme="%s"]'
13
+ rule = `[${selector}="%s"]`;
14
+ }
3
15
  if (theme.defaultColorScheme === colorScheme) {
4
16
  if (colorScheme === 'dark') {
5
17
  const excludedVariables = {};
@@ -7,15 +19,32 @@ export default (theme => (colorScheme, css) => {
7
19
  excludedVariables[cssVar] = css[cssVar];
8
20
  delete css[cssVar];
9
21
  });
22
+ if (rule === 'media') {
23
+ return {
24
+ ':root': css,
25
+ '@media (prefers-color-scheme: dark) { :root': excludedVariables
26
+ };
27
+ }
28
+ if (rule) {
29
+ return {
30
+ [rule.replace('%s', colorScheme)]: excludedVariables,
31
+ ':root': css
32
+ };
33
+ }
10
34
  return {
11
- [`[${theme.attribute}="${String(colorScheme)}"]`]: excludedVariables,
12
- [theme.colorSchemeSelector]: css
35
+ ':root': {
36
+ ...css,
37
+ ...excludedVariables
38
+ }
13
39
  };
14
40
  }
15
- return `${theme.colorSchemeSelector}, [${theme.attribute}="${String(colorScheme)}"]`;
16
- }
17
- if (colorScheme) {
18
- return `[${theme.attribute}="${String(colorScheme)}"]`;
41
+ } else if (colorScheme) {
42
+ if (rule === 'media') {
43
+ return `@media (prefers-color-scheme: ${String(colorScheme)}) { :root`;
44
+ }
45
+ if (rule) {
46
+ return rule.replace('%s', String(colorScheme));
47
+ }
19
48
  }
20
- return theme.colorSchemeSelector;
49
+ return ':root';
21
50
  });
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @internal These variables should not appear in the :root stylesheet when the `defaultMode="dark"`
2
+ * @internal These variables should not appear in the :root stylesheet when the `defaultColorScheme="dark"`
3
3
  */
4
4
  const excludeVariablesFromRoot = cssVarPrefix => [...[...Array(24)].map((_, index) => `--${cssVarPrefix ? `${cssVarPrefix}-` : ''}overlays-${index + 1}`), `--${cssVarPrefix ? `${cssVarPrefix}-` : ''}palette-AppBar-darkBg`, `--${cssVarPrefix ? `${cssVarPrefix}-` : ''}palette-AppBar-darkColor`];
5
5
  export default excludeVariablesFromRoot;