@mui/material 6.0.0-alpha.3 → 6.0.0-alpha.5

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 (86) hide show
  1. package/CHANGELOG.md +93 -0
  2. package/Checkbox/Checkbox.js +51 -20
  3. package/FormControlLabel/FormControlLabel.d.ts +21 -14
  4. package/FormControlLabel/FormControlLabel.js +22 -4
  5. package/FormHelperText/FormHelperText.js +18 -8
  6. package/IconButton/IconButton.js +97 -40
  7. package/ImageList/ImageList.js +16 -14
  8. package/ImageListItem/ImageListItem.js +37 -22
  9. package/ImageListItemBar/ImageListItemBar.js +65 -32
  10. package/ListItem/ListItem.js +94 -50
  11. package/ListItemAvatar/ListItemAvatar.js +12 -8
  12. package/ListItemButton/ListItemButton.js +35 -15
  13. package/ListItemSecondaryAction/ListItemSecondaryAction.js +12 -8
  14. package/ListItemText/ListItemText.js +20 -11
  15. package/ListSubheader/ListSubheader.js +44 -19
  16. package/PaginationItem/PaginationItem.d.ts +26 -14
  17. package/PaginationItem/PaginationItem.js +64 -20
  18. package/Radio/Radio.js +50 -20
  19. package/Radio/RadioButtonIcon.js +18 -12
  20. package/Rating/Rating.js +71 -37
  21. package/SvgIcon/SvgIcon.js +73 -21
  22. package/Table/Table.js +11 -6
  23. package/TableCell/TableCell.js +96 -41
  24. package/TableSortLabel/TableSortLabel.js +19 -9
  25. package/Toolbar/Toolbar.js +33 -17
  26. package/Typography/Typography.js +3 -2
  27. package/index.js +1 -1
  28. package/modern/Checkbox/Checkbox.js +51 -20
  29. package/modern/FormControlLabel/FormControlLabel.js +22 -4
  30. package/modern/FormHelperText/FormHelperText.js +18 -8
  31. package/modern/IconButton/IconButton.js +97 -40
  32. package/modern/ImageList/ImageList.js +16 -14
  33. package/modern/ImageListItem/ImageListItem.js +37 -22
  34. package/modern/ImageListItemBar/ImageListItemBar.js +65 -32
  35. package/modern/ListItem/ListItem.js +94 -50
  36. package/modern/ListItemAvatar/ListItemAvatar.js +12 -8
  37. package/modern/ListItemButton/ListItemButton.js +35 -15
  38. package/modern/ListItemSecondaryAction/ListItemSecondaryAction.js +12 -8
  39. package/modern/ListItemText/ListItemText.js +20 -11
  40. package/modern/ListSubheader/ListSubheader.js +44 -19
  41. package/modern/PaginationItem/PaginationItem.js +64 -20
  42. package/modern/Radio/Radio.js +50 -20
  43. package/modern/Radio/RadioButtonIcon.js +18 -12
  44. package/modern/Rating/Rating.js +71 -37
  45. package/modern/SvgIcon/SvgIcon.js +73 -21
  46. package/modern/Table/Table.js +11 -6
  47. package/modern/TableCell/TableCell.js +96 -41
  48. package/modern/TableSortLabel/TableSortLabel.js +19 -9
  49. package/modern/Toolbar/Toolbar.js +33 -17
  50. package/modern/Typography/Typography.js +3 -2
  51. package/modern/index.js +1 -1
  52. package/modern/styles/experimental_extendTheme.js +2 -1
  53. package/modern/styles/getOverlayAlpha.js +3 -4
  54. package/node/Checkbox/Checkbox.js +54 -23
  55. package/node/FormControlLabel/FormControlLabel.js +23 -5
  56. package/node/FormHelperText/FormHelperText.js +18 -8
  57. package/node/IconButton/IconButton.js +99 -43
  58. package/node/ImageList/ImageList.js +16 -14
  59. package/node/ImageListItem/ImageListItem.js +37 -22
  60. package/node/ImageListItemBar/ImageListItemBar.js +65 -32
  61. package/node/ListItem/ListItem.js +94 -50
  62. package/node/ListItemAvatar/ListItemAvatar.js +12 -8
  63. package/node/ListItemButton/ListItemButton.js +35 -15
  64. package/node/ListItemSecondaryAction/ListItemSecondaryAction.js +12 -8
  65. package/node/ListItemText/ListItemText.js +20 -11
  66. package/node/ListSubheader/ListSubheader.js +44 -19
  67. package/node/PaginationItem/PaginationItem.js +65 -20
  68. package/node/Radio/Radio.js +52 -22
  69. package/node/Radio/RadioButtonIcon.js +21 -15
  70. package/node/Rating/Rating.js +71 -37
  71. package/node/SvgIcon/SvgIcon.js +79 -24
  72. package/node/Table/Table.js +11 -6
  73. package/node/TableCell/TableCell.js +96 -41
  74. package/node/TableSortLabel/TableSortLabel.js +19 -9
  75. package/node/Toolbar/Toolbar.js +33 -17
  76. package/node/Typography/Typography.js +3 -2
  77. package/node/index.js +1 -1
  78. package/node/styles/experimental_extendTheme.js +1 -0
  79. package/node/styles/getOverlayAlpha.js +4 -5
  80. package/package.json +6 -6
  81. package/styles/experimental_extendTheme.d.ts +2 -0
  82. package/styles/experimental_extendTheme.js +2 -1
  83. package/styles/getOverlayAlpha.d.ts +1 -2
  84. package/styles/getOverlayAlpha.js +3 -4
  85. package/umd/material-ui.development.js +1223 -583
  86. package/umd/material-ui.production.min.js +4 -4
@@ -6,8 +6,8 @@ Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
8
  exports.default = void 0;
9
- var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
10
9
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
+ var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
11
11
  var React = _interopRequireWildcard(require("react"));
12
12
  var _propTypes = _interopRequireDefault(require("prop-types"));
13
13
  var _clsx = _interopRequireDefault(require("clsx"));
@@ -74,9 +74,8 @@ const RatingRoot = (0, _styled.default)('span', {
74
74
  }, styles.root, styles[`size${(0, _utils.capitalize)(ownerState.size)}`], ownerState.readOnly && styles.readOnly];
75
75
  }
76
76
  })(({
77
- theme,
78
- ownerState
79
- }) => (0, _extends2.default)({
77
+ theme
78
+ }) => ({
80
79
  display: 'inline-flex',
81
80
  // Required to position the pristine input absolutely
82
81
  position: 'relative',
@@ -93,13 +92,30 @@ const RatingRoot = (0, _styled.default)('span', {
93
92
  [`&.${_ratingClasses.default.focusVisible} .${_ratingClasses.default.iconActive}`]: {
94
93
  outline: '1px solid #999'
95
94
  },
96
- [`& .${_ratingClasses.default.visuallyHidden}`]: _visuallyHidden.default
97
- }, ownerState.size === 'small' && {
98
- fontSize: theme.typography.pxToRem(18)
99
- }, ownerState.size === 'large' && {
100
- fontSize: theme.typography.pxToRem(30)
101
- }, ownerState.readOnly && {
102
- pointerEvents: 'none'
95
+ [`& .${_ratingClasses.default.visuallyHidden}`]: _visuallyHidden.default,
96
+ variants: [{
97
+ props: {
98
+ size: 'small'
99
+ },
100
+ style: {
101
+ fontSize: theme.typography.pxToRem(18)
102
+ }
103
+ }, {
104
+ props: {
105
+ size: 'large'
106
+ },
107
+ style: {
108
+ fontSize: theme.typography.pxToRem(30)
109
+ }
110
+ }, {
111
+ // TODO v6: use the .Mui-readOnly global state class
112
+ props: ({
113
+ ownerState
114
+ }) => ownerState.readOnly,
115
+ style: {
116
+ pointerEvents: 'none'
117
+ }
118
+ }]
103
119
  }));
104
120
  const RatingLabel = (0, _styled.default)('label', {
105
121
  name: 'MuiRating',
@@ -107,17 +123,21 @@ const RatingLabel = (0, _styled.default)('label', {
107
123
  overridesResolver: ({
108
124
  ownerState
109
125
  }, styles) => [styles.label, ownerState.emptyValueFocused && styles.labelEmptyValueActive]
110
- })(({
111
- ownerState
112
- }) => (0, _extends2.default)({
113
- cursor: 'inherit'
114
- }, ownerState.emptyValueFocused && {
115
- top: 0,
116
- bottom: 0,
117
- position: 'absolute',
118
- outline: '1px solid #999',
119
- width: '100%'
120
- }));
126
+ })({
127
+ cursor: 'inherit',
128
+ variants: [{
129
+ props: ({
130
+ ownerState
131
+ }) => ownerState.emptyValueFocused,
132
+ style: {
133
+ top: 0,
134
+ bottom: 0,
135
+ position: 'absolute',
136
+ outline: '1px solid #999',
137
+ width: '100%'
138
+ }
139
+ }]
140
+ });
121
141
  const RatingIcon = (0, _styled.default)('span', {
122
142
  name: 'MuiRating',
123
143
  slot: 'Icon',
@@ -128,9 +148,8 @@ const RatingIcon = (0, _styled.default)('span', {
128
148
  return [styles.icon, ownerState.iconEmpty && styles.iconEmpty, ownerState.iconFilled && styles.iconFilled, ownerState.iconHover && styles.iconHover, ownerState.iconFocus && styles.iconFocus, ownerState.iconActive && styles.iconActive];
129
149
  }
130
150
  })(({
131
- theme,
132
- ownerState
133
- }) => (0, _extends2.default)({
151
+ theme
152
+ }) => ({
134
153
  // Fit wrapper to actual icon size.
135
154
  display: 'flex',
136
155
  transition: theme.transitions.create('transform', {
@@ -138,11 +157,22 @@ const RatingIcon = (0, _styled.default)('span', {
138
157
  }),
139
158
  // Fix mouseLeave issue.
140
159
  // https://github.com/facebook/react/issues/4492
141
- pointerEvents: 'none'
142
- }, ownerState.iconActive && {
143
- transform: 'scale(1.2)'
144
- }, ownerState.iconEmpty && {
145
- color: (theme.vars || theme).palette.action.disabled
160
+ pointerEvents: 'none',
161
+ variants: [{
162
+ props: ({
163
+ ownerState
164
+ }) => ownerState.iconActive,
165
+ style: {
166
+ transform: 'scale(1.2)'
167
+ }
168
+ }, {
169
+ props: ({
170
+ ownerState
171
+ }) => ownerState.iconEmpty,
172
+ style: {
173
+ color: (theme.vars || theme).palette.action.disabled
174
+ }
175
+ }]
146
176
  }));
147
177
  const RatingDecimal = (0, _styled.default)('span', {
148
178
  name: 'MuiRating',
@@ -154,13 +184,17 @@ const RatingDecimal = (0, _styled.default)('span', {
154
184
  } = props;
155
185
  return [styles.decimal, iconActive && styles.iconActive];
156
186
  }
157
- })(({
158
- iconActive
159
- }) => (0, _extends2.default)({
160
- position: 'relative'
161
- }, iconActive && {
162
- transform: 'scale(1.2)'
163
- }));
187
+ })({
188
+ position: 'relative',
189
+ variants: [{
190
+ props: ({
191
+ iconActive
192
+ }) => iconActive,
193
+ style: {
194
+ transform: 'scale(1.2)'
195
+ }
196
+ }]
197
+ });
164
198
  function IconContainer(props) {
165
199
  const other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
166
200
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("span", (0, _extends2.default)({}, other));
@@ -13,13 +13,13 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
13
13
  var _clsx = _interopRequireDefault(require("clsx"));
14
14
  var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
15
15
  var _capitalize = _interopRequireDefault(require("../utils/capitalize"));
16
- var _useThemeProps = _interopRequireDefault(require("../styles/useThemeProps"));
17
- var _styled = _interopRequireDefault(require("../styles/styled"));
16
+ var _zeroStyled = require("../zero-styled");
18
17
  var _svgIconClasses = require("./svgIconClasses");
19
18
  var _jsxRuntime = require("react/jsx-runtime");
20
19
  const _excluded = ["children", "className", "color", "component", "fontSize", "htmlColor", "inheritViewBox", "titleAccess", "viewBox"];
21
20
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
22
21
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
22
+ const useThemeProps = (0, _zeroStyled.createUseThemeProps)('MuiSvgIcon');
23
23
  const useUtilityClasses = ownerState => {
24
24
  const {
25
25
  color,
@@ -31,7 +31,7 @@ const useUtilityClasses = ownerState => {
31
31
  };
32
32
  return (0, _composeClasses.default)(slots, _svgIconClasses.getSvgIconUtilityClass, classes);
33
33
  };
34
- const SvgIconRoot = (0, _styled.default)('svg', {
34
+ const SvgIconRoot = (0, _zeroStyled.styled)('svg', {
35
35
  name: 'MuiSvgIcon',
36
36
  slot: 'Root',
37
37
  overridesResolver: (props, styles) => {
@@ -41,38 +41,91 @@ const SvgIconRoot = (0, _styled.default)('svg', {
41
41
  return [styles.root, ownerState.color !== 'inherit' && styles[`color${(0, _capitalize.default)(ownerState.color)}`], styles[`fontSize${(0, _capitalize.default)(ownerState.fontSize)}`]];
42
42
  }
43
43
  })(({
44
- theme,
45
- ownerState
44
+ theme
46
45
  }) => {
47
- var _theme$transitions, _theme$transitions$cr, _theme$transitions2, _theme$typography, _theme$typography$pxT, _theme$typography2, _theme$typography2$px, _theme$typography3, _theme$typography3$px, _palette$ownerState$c, _palette, _palette2, _palette3;
46
+ var _theme$transitions, _theme$transitions$cr, _transitions, _theme$vars, _theme$typography, _theme$typography$pxT, _theme$typography2, _theme$typography2$px, _theme$typography3, _theme$typography3$px, _theme$vars2, _palette2, _theme$vars4, _palette3, _theme$vars5;
48
47
  return {
49
48
  userSelect: 'none',
50
49
  width: '1em',
51
50
  height: '1em',
52
51
  display: 'inline-block',
53
- // the <svg> will define the property that has `currentColor`
54
- // for example heroicons uses fill="none" and stroke="currentColor"
55
- fill: ownerState.hasSvgAsChild ? undefined : 'currentColor',
56
52
  flexShrink: 0,
57
53
  transition: (_theme$transitions = theme.transitions) == null || (_theme$transitions$cr = _theme$transitions.create) == null ? void 0 : _theme$transitions$cr.call(_theme$transitions, 'fill', {
58
- duration: (_theme$transitions2 = theme.transitions) == null || (_theme$transitions2 = _theme$transitions2.duration) == null ? void 0 : _theme$transitions2.shorter
54
+ duration: (_transitions = ((_theme$vars = theme.vars) != null ? _theme$vars : theme).transitions) == null || (_transitions = _transitions.duration) == null ? void 0 : _transitions.shorter
59
55
  }),
60
- fontSize: {
61
- inherit: 'inherit',
62
- small: ((_theme$typography = theme.typography) == null || (_theme$typography$pxT = _theme$typography.pxToRem) == null ? void 0 : _theme$typography$pxT.call(_theme$typography, 20)) || '1.25rem',
63
- medium: ((_theme$typography2 = theme.typography) == null || (_theme$typography2$px = _theme$typography2.pxToRem) == null ? void 0 : _theme$typography2$px.call(_theme$typography2, 24)) || '1.5rem',
64
- large: ((_theme$typography3 = theme.typography) == null || (_theme$typography3$px = _theme$typography3.pxToRem) == null ? void 0 : _theme$typography3$px.call(_theme$typography3, 35)) || '2.1875rem'
65
- }[ownerState.fontSize],
66
- // TODO v5 deprecate, v6 remove for sx
67
- color: (_palette$ownerState$c = (_palette = (theme.vars || theme).palette) == null || (_palette = _palette[ownerState.color]) == null ? void 0 : _palette.main) != null ? _palette$ownerState$c : {
68
- action: (_palette2 = (theme.vars || theme).palette) == null || (_palette2 = _palette2.action) == null ? void 0 : _palette2.active,
69
- disabled: (_palette3 = (theme.vars || theme).palette) == null || (_palette3 = _palette3.action) == null ? void 0 : _palette3.disabled,
70
- inherit: undefined
71
- }[ownerState.color]
56
+ variants: [{
57
+ props: props => !props.hasSvgAsChild,
58
+ style: {
59
+ // the <svg> will define the property that has `currentColor`
60
+ // for example heroicons uses fill="none" and stroke="currentColor"
61
+ fill: 'currentColor'
62
+ }
63
+ }, {
64
+ props: {
65
+ fontSize: 'inherit'
66
+ },
67
+ style: {
68
+ fontSize: 'inherit'
69
+ }
70
+ }, {
71
+ props: {
72
+ fontSize: 'small'
73
+ },
74
+ style: {
75
+ fontSize: ((_theme$typography = theme.typography) == null || (_theme$typography$pxT = _theme$typography.pxToRem) == null ? void 0 : _theme$typography$pxT.call(_theme$typography, 20)) || '1.25rem'
76
+ }
77
+ }, {
78
+ props: {
79
+ fontSize: 'medium'
80
+ },
81
+ style: {
82
+ fontSize: ((_theme$typography2 = theme.typography) == null || (_theme$typography2$px = _theme$typography2.pxToRem) == null ? void 0 : _theme$typography2$px.call(_theme$typography2, 24)) || '1.5rem'
83
+ }
84
+ }, {
85
+ props: {
86
+ fontSize: 'large'
87
+ },
88
+ style: {
89
+ fontSize: ((_theme$typography3 = theme.typography) == null || (_theme$typography3$px = _theme$typography3.pxToRem) == null ? void 0 : _theme$typography3$px.call(_theme$typography3, 35)) || '2.1875rem'
90
+ }
91
+ },
92
+ // TODO v5 deprecate color prop, v6 remove for sx
93
+ ...Object.entries(((_theme$vars2 = theme.vars) != null ? _theme$vars2 : theme).palette).filter(([, value]) => value.main).map(([color]) => {
94
+ var _palette, _theme$vars3;
95
+ return {
96
+ props: {
97
+ color
98
+ },
99
+ style: {
100
+ color: (_palette = ((_theme$vars3 = theme.vars) != null ? _theme$vars3 : theme).palette) == null || (_palette = _palette[color]) == null ? void 0 : _palette.main
101
+ }
102
+ };
103
+ }), {
104
+ props: {
105
+ color: 'action'
106
+ },
107
+ style: {
108
+ color: (_palette2 = ((_theme$vars4 = theme.vars) != null ? _theme$vars4 : theme).palette) == null || (_palette2 = _palette2.action) == null ? void 0 : _palette2.active
109
+ }
110
+ }, {
111
+ props: {
112
+ color: 'disabled'
113
+ },
114
+ style: {
115
+ color: (_palette3 = ((_theme$vars5 = theme.vars) != null ? _theme$vars5 : theme).palette) == null || (_palette3 = _palette3.action) == null ? void 0 : _palette3.disabled
116
+ }
117
+ }, {
118
+ props: {
119
+ color: 'inherit'
120
+ },
121
+ style: {
122
+ color: undefined
123
+ }
124
+ }]
72
125
  };
73
126
  });
74
127
  const SvgIcon = /*#__PURE__*/React.forwardRef(function SvgIcon(inProps, ref) {
75
- const props = (0, _useThemeProps.default)({
128
+ const props = useThemeProps({
76
129
  props: inProps,
77
130
  name: 'MuiSvgIcon'
78
131
  });
@@ -190,5 +243,7 @@ process.env.NODE_ENV !== "production" ? SvgIcon.propTypes /* remove-proptypes */
190
243
  */
191
244
  viewBox: _propTypes.default.string
192
245
  } : void 0;
193
- SvgIcon.muiName = 'SvgIcon';
246
+ if (SvgIcon) {
247
+ SvgIcon.muiName = 'SvgIcon';
248
+ }
194
249
  var _default = exports.default = SvgIcon;
@@ -40,9 +40,8 @@ const TableRoot = (0, _styled.default)('table', {
40
40
  return [styles.root, ownerState.stickyHeader && styles.stickyHeader];
41
41
  }
42
42
  })(({
43
- theme,
44
- ownerState
45
- }) => (0, _extends2.default)({
43
+ theme
44
+ }) => ({
46
45
  display: 'table',
47
46
  width: '100%',
48
47
  borderCollapse: 'collapse',
@@ -52,9 +51,15 @@ const TableRoot = (0, _styled.default)('table', {
52
51
  color: (theme.vars || theme).palette.text.secondary,
53
52
  textAlign: 'left',
54
53
  captionSide: 'bottom'
55
- })
56
- }, ownerState.stickyHeader && {
57
- borderCollapse: 'separate'
54
+ }),
55
+ variants: [{
56
+ props: ({
57
+ ownerState
58
+ }) => ownerState.stickyHeader,
59
+ style: {
60
+ borderCollapse: 'separate'
61
+ }
62
+ }]
58
63
  }));
59
64
  const defaultComponent = 'table';
60
65
  const Table = /*#__PURE__*/React.forwardRef(function Table(inProps, ref) {
@@ -47,8 +47,7 @@ const TableCellRoot = (0, _styled.default)('td', {
47
47
  return [styles.root, styles[ownerState.variant], styles[`size${(0, _capitalize.default)(ownerState.size)}`], ownerState.padding !== 'normal' && styles[`padding${(0, _capitalize.default)(ownerState.padding)}`], ownerState.align !== 'inherit' && styles[`align${(0, _capitalize.default)(ownerState.align)}`], ownerState.stickyHeader && styles.stickyHeader];
48
48
  }
49
49
  })(({
50
- theme,
51
- ownerState
50
+ theme
52
51
  }) => (0, _extends2.default)({}, theme.typography.body2, {
53
52
  display: 'table-cell',
54
53
  verticalAlign: 'inherit',
@@ -57,47 +56,103 @@ const TableCellRoot = (0, _styled.default)('td', {
57
56
  borderBottom: theme.vars ? `1px solid ${theme.vars.palette.TableCell.border}` : `1px solid
58
57
  ${theme.palette.mode === 'light' ? (0, _colorManipulator.lighten)((0, _colorManipulator.alpha)(theme.palette.divider, 1), 0.88) : (0, _colorManipulator.darken)((0, _colorManipulator.alpha)(theme.palette.divider, 1), 0.68)}`,
59
58
  textAlign: 'left',
60
- padding: 16
61
- }, ownerState.variant === 'head' && {
62
- color: (theme.vars || theme).palette.text.primary,
63
- lineHeight: theme.typography.pxToRem(24),
64
- fontWeight: theme.typography.fontWeightMedium
65
- }, ownerState.variant === 'body' && {
66
- color: (theme.vars || theme).palette.text.primary
67
- }, ownerState.variant === 'footer' && {
68
- color: (theme.vars || theme).palette.text.secondary,
69
- lineHeight: theme.typography.pxToRem(21),
70
- fontSize: theme.typography.pxToRem(12)
71
- }, ownerState.size === 'small' && {
72
- padding: '6px 16px',
73
- [`&.${_tableCellClasses.default.paddingCheckbox}`]: {
74
- width: 24,
75
- // prevent the checkbox column from growing
76
- padding: '0 12px 0 16px',
77
- '& > *': {
59
+ padding: 16,
60
+ variants: [{
61
+ props: {
62
+ variant: 'head'
63
+ },
64
+ style: {
65
+ color: (theme.vars || theme).palette.text.primary,
66
+ lineHeight: theme.typography.pxToRem(24),
67
+ fontWeight: theme.typography.fontWeightMedium
68
+ }
69
+ }, {
70
+ props: {
71
+ variant: 'body'
72
+ },
73
+ style: {
74
+ color: (theme.vars || theme).palette.text.primary
75
+ }
76
+ }, {
77
+ props: {
78
+ variant: 'footer'
79
+ },
80
+ style: {
81
+ color: (theme.vars || theme).palette.text.secondary,
82
+ lineHeight: theme.typography.pxToRem(21),
83
+ fontSize: theme.typography.pxToRem(12)
84
+ }
85
+ }, {
86
+ props: {
87
+ size: 'small'
88
+ },
89
+ style: {
90
+ padding: '6px 16px',
91
+ [`&.${_tableCellClasses.default.paddingCheckbox}`]: {
92
+ width: 24,
93
+ // prevent the checkbox column from growing
94
+ padding: '0 12px 0 16px',
95
+ '& > *': {
96
+ padding: 0
97
+ }
98
+ }
99
+ }
100
+ }, {
101
+ props: {
102
+ padding: 'checkbox'
103
+ },
104
+ style: {
105
+ width: 48,
106
+ // prevent the checkbox column from growing
107
+ padding: '0 0 0 4px'
108
+ }
109
+ }, {
110
+ props: {
111
+ padding: 'none'
112
+ },
113
+ style: {
78
114
  padding: 0
79
115
  }
80
- }
81
- }, ownerState.padding === 'checkbox' && {
82
- width: 48,
83
- // prevent the checkbox column from growing
84
- padding: '0 0 0 4px'
85
- }, ownerState.padding === 'none' && {
86
- padding: 0
87
- }, ownerState.align === 'left' && {
88
- textAlign: 'left'
89
- }, ownerState.align === 'center' && {
90
- textAlign: 'center'
91
- }, ownerState.align === 'right' && {
92
- textAlign: 'right',
93
- flexDirection: 'row-reverse'
94
- }, ownerState.align === 'justify' && {
95
- textAlign: 'justify'
96
- }, ownerState.stickyHeader && {
97
- position: 'sticky',
98
- top: 0,
99
- zIndex: 2,
100
- backgroundColor: (theme.vars || theme).palette.background.default
116
+ }, {
117
+ props: {
118
+ align: 'left'
119
+ },
120
+ style: {
121
+ textAlign: 'left'
122
+ }
123
+ }, {
124
+ props: {
125
+ align: 'center'
126
+ },
127
+ style: {
128
+ textAlign: 'center'
129
+ }
130
+ }, {
131
+ props: {
132
+ align: 'right'
133
+ },
134
+ style: {
135
+ textAlign: 'right',
136
+ flexDirection: 'row-reverse'
137
+ }
138
+ }, {
139
+ props: {
140
+ align: 'justify'
141
+ },
142
+ style: {
143
+ textAlign: 'justify'
144
+ }
145
+ }, {
146
+ props: ({
147
+ ownerState
148
+ }) => ownerState.stickyHeader,
149
+ style: {
150
+ position: 'sticky',
151
+ top: 0,
152
+ zIndex: 2,
153
+ backgroundColor: (theme.vars || theme).palette.background.default
154
+ }
155
+ }]
101
156
  }));
102
157
 
103
158
  /**
@@ -6,8 +6,8 @@ Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
8
  exports.default = void 0;
9
- var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
10
9
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
+ var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
11
11
  var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
12
12
  var _clsx = _interopRequireDefault(require("clsx"));
13
13
  var _propTypes = _interopRequireDefault(require("prop-types"));
@@ -78,9 +78,8 @@ const TableSortLabelIcon = (0, _styled.default)('span', {
78
78
  return [styles.icon, styles[`iconDirection${(0, _capitalize.default)(ownerState.direction)}`]];
79
79
  }
80
80
  })(({
81
- theme,
82
- ownerState
83
- }) => (0, _extends2.default)({
81
+ theme
82
+ }) => ({
84
83
  fontSize: 18,
85
84
  marginRight: 4,
86
85
  marginLeft: 4,
@@ -88,11 +87,22 @@ const TableSortLabelIcon = (0, _styled.default)('span', {
88
87
  transition: theme.transitions.create(['opacity', 'transform'], {
89
88
  duration: theme.transitions.duration.shorter
90
89
  }),
91
- userSelect: 'none'
92
- }, ownerState.direction === 'desc' && {
93
- transform: 'rotate(0deg)'
94
- }, ownerState.direction === 'asc' && {
95
- transform: 'rotate(180deg)'
90
+ userSelect: 'none',
91
+ variants: [{
92
+ props: {
93
+ direction: 'desc'
94
+ },
95
+ style: {
96
+ transform: 'rotate(0deg)'
97
+ }
98
+ }, {
99
+ props: {
100
+ direction: 'asc'
101
+ },
102
+ style: {
103
+ transform: 'rotate(180deg)'
104
+ }
105
+ }]
96
106
  }));
97
107
 
98
108
  /**
@@ -6,8 +6,8 @@ Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
8
  exports.default = void 0;
9
- var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
10
9
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
+ var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
11
11
  var React = _interopRequireWildcard(require("react"));
12
12
  var _propTypes = _interopRequireDefault(require("prop-types"));
13
13
  var _clsx = _interopRequireDefault(require("clsx"));
@@ -40,25 +40,41 @@ const ToolbarRoot = (0, _styled.default)('div', {
40
40
  return [styles.root, !ownerState.disableGutters && styles.gutters, styles[ownerState.variant]];
41
41
  }
42
42
  })(({
43
- theme,
44
- ownerState
45
- }) => (0, _extends2.default)({
43
+ theme
44
+ }) => ({
46
45
  position: 'relative',
47
46
  display: 'flex',
48
- alignItems: 'center'
49
- }, !ownerState.disableGutters && {
50
- paddingLeft: theme.spacing(2),
51
- paddingRight: theme.spacing(2),
52
- [theme.breakpoints.up('sm')]: {
53
- paddingLeft: theme.spacing(3),
54
- paddingRight: theme.spacing(3)
55
- }
56
- }, ownerState.variant === 'dense' && {
57
- minHeight: 48
47
+ alignItems: 'center',
48
+ variants: [{
49
+ props: ({
50
+ ownerState
51
+ }) => !ownerState.disableGutters,
52
+ style: {
53
+ paddingLeft: theme.spacing(2),
54
+ paddingRight: theme.spacing(2),
55
+ [theme.breakpoints.up('sm')]: {
56
+ paddingLeft: theme.spacing(3),
57
+ paddingRight: theme.spacing(3)
58
+ }
59
+ }
60
+ }, {
61
+ props: {
62
+ variant: 'dense'
63
+ },
64
+ style: {
65
+ minHeight: 48
66
+ }
67
+ }]
58
68
  }), ({
59
- theme,
60
- ownerState
61
- }) => ownerState.variant === 'regular' && theme.mixins.toolbar);
69
+ theme
70
+ }) => ({
71
+ variants: [{
72
+ props: {
73
+ variant: 'regular'
74
+ },
75
+ style: theme.mixins.toolbar
76
+ }]
77
+ }));
62
78
  const Toolbar = /*#__PURE__*/React.forwardRef(function Toolbar(inProps, ref) {
63
79
  const props = (0, _useThemeProps.default)({
64
80
  props: inProps,
@@ -126,9 +126,10 @@ const Typography = /*#__PURE__*/React.forwardRef(function Typography(inProps, re
126
126
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(TypographyRoot, (0, _extends2.default)({
127
127
  as: Component,
128
128
  ref: ref,
129
- ownerState: ownerState,
130
129
  className: (0, _clsx.default)(classes.root, className)
131
- }, other));
130
+ }, other, {
131
+ ownerState: ownerState
132
+ }));
132
133
  });
133
134
  process.env.NODE_ENV !== "production" ? Typography.propTypes /* remove-proptypes */ = {
134
135
  // ┌────────────────────────────── Warning ──────────────────────────────┐
package/node/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/material v6.0.0-alpha.3
2
+ * @mui/material v6.0.0-alpha.5
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -130,6 +130,7 @@ function extendTheme(options = {}, ...args) {
130
130
  overlays: ((_colorSchemesInput$da3 = colorSchemesInput.dark) == null ? void 0 : _colorSchemesInput$da3.overlays) || defaultDarkOverlays
131
131
  })
132
132
  }),
133
+ font: (0, _extends2.default)({}, (0, _cssVars.prepareTypographyVars)(muiTheme.typography), muiTheme.font),
133
134
  spacing: getSpacingVal(input.spacing)
134
135
  });
135
136
  Object.keys(theme.colorSchemes).forEach(key => {
@@ -3,15 +3,14 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.default = void 0;
6
+ exports.default = getOverlayAlpha;
7
7
  // Inspired by https://github.com/material-components/material-components-ios/blob/bca36107405594d5b7b16265a5b0ed698f85a5ee/components/Elevation/src/UIColor%2BMaterialElevation.m#L61
8
- const getOverlayAlpha = elevation => {
8
+ function getOverlayAlpha(elevation) {
9
9
  let alphaValue;
10
10
  if (elevation < 1) {
11
11
  alphaValue = 5.11916 * elevation ** 2;
12
12
  } else {
13
13
  alphaValue = 4.5 * Math.log(elevation + 1) + 2;
14
14
  }
15
- return (alphaValue / 100).toFixed(2);
16
- };
17
- var _default = exports.default = getOverlayAlpha;
15
+ return Math.round(alphaValue * 10) / 1000;
16
+ }