@mui/material 6.0.0-alpha.0 → 6.0.0-alpha.1

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 (77) hide show
  1. package/AppBar/AppBar.js +118 -68
  2. package/Badge/Badge.d.ts +2 -4
  3. package/Badge/Badge.js +2 -4
  4. package/Button/Button.js +220 -131
  5. package/ButtonBase/ButtonBase.js +2 -2
  6. package/ButtonBase/Ripple.js +1 -1
  7. package/ButtonBase/TouchRipple.js +3 -4
  8. package/ButtonGroup/ButtonGroup.js +167 -70
  9. package/CHANGELOG.md +129 -2
  10. package/Grid/Grid.js +3 -0
  11. package/RadioGroup/RadioGroup.d.ts +0 -2
  12. package/RadioGroup/RadioGroup.js +23 -2
  13. package/RadioGroup/index.d.ts +3 -0
  14. package/RadioGroup/index.js +3 -1
  15. package/RadioGroup/radioGroupClasses.d.ts +6 -0
  16. package/RadioGroup/radioGroupClasses.js +7 -0
  17. package/Slider/Slider.js +22 -22
  18. package/Table/Table.d.ts +0 -2
  19. package/Table/Table.js +0 -2
  20. package/index.js +1 -1
  21. package/legacy/AppBar/AppBar.js +124 -64
  22. package/legacy/Badge/Badge.js +2 -4
  23. package/legacy/Button/Button.js +218 -123
  24. package/legacy/ButtonBase/ButtonBase.js +2 -2
  25. package/legacy/ButtonBase/Ripple.js +1 -1
  26. package/legacy/ButtonBase/TouchRipple.js +3 -4
  27. package/legacy/ButtonGroup/ButtonGroup.js +163 -68
  28. package/legacy/Grid/Grid.js +3 -0
  29. package/legacy/RadioGroup/RadioGroup.js +21 -2
  30. package/legacy/RadioGroup/index.js +3 -1
  31. package/legacy/RadioGroup/radioGroupClasses.js +7 -0
  32. package/legacy/Slider/Slider.js +24 -24
  33. package/legacy/Table/Table.js +0 -2
  34. package/legacy/index.js +1 -1
  35. package/legacy/styles/experimental_extendTheme.js +24 -2
  36. package/legacy/zero-styled/index.js +1 -0
  37. package/modern/AppBar/AppBar.js +118 -68
  38. package/modern/Badge/Badge.js +2 -4
  39. package/modern/Button/Button.js +220 -131
  40. package/modern/ButtonBase/ButtonBase.js +2 -2
  41. package/modern/ButtonBase/Ripple.js +1 -1
  42. package/modern/ButtonBase/TouchRipple.js +3 -4
  43. package/modern/ButtonGroup/ButtonGroup.js +167 -70
  44. package/modern/Grid/Grid.js +3 -0
  45. package/modern/RadioGroup/RadioGroup.js +23 -2
  46. package/modern/RadioGroup/index.js +3 -1
  47. package/modern/RadioGroup/radioGroupClasses.js +7 -0
  48. package/modern/Slider/Slider.js +22 -22
  49. package/modern/Table/Table.js +0 -2
  50. package/modern/index.js +1 -1
  51. package/modern/styles/experimental_extendTheme.js +24 -2
  52. package/modern/zero-styled/index.js +1 -0
  53. package/node/AppBar/AppBar.js +125 -66
  54. package/node/Badge/Badge.js +2 -4
  55. package/node/Button/Button.js +224 -135
  56. package/node/ButtonBase/ButtonBase.js +4 -4
  57. package/node/ButtonBase/Ripple.js +1 -1
  58. package/node/ButtonBase/TouchRipple.js +9 -10
  59. package/node/ButtonGroup/ButtonGroup.js +169 -72
  60. package/node/Grid/Grid.js +3 -0
  61. package/node/RadioGroup/RadioGroup.js +23 -2
  62. package/node/RadioGroup/index.js +25 -1
  63. package/node/RadioGroup/radioGroupClasses.js +15 -0
  64. package/node/Slider/Slider.js +25 -25
  65. package/node/Table/Table.js +0 -2
  66. package/node/index.js +1 -1
  67. package/node/styles/experimental_extendTheme.js +24 -2
  68. package/node/zero-styled/index.js +7 -0
  69. package/package.json +7 -7
  70. package/styles/components.d.ts +5 -0
  71. package/styles/experimental_extendTheme.d.ts +2 -0
  72. package/styles/experimental_extendTheme.js +24 -2
  73. package/styles/overrides.d.ts +2 -0
  74. package/umd/material-ui.development.js +888 -593
  75. package/umd/material-ui.production.min.js +4 -4
  76. package/zero-styled/index.d.ts +1 -0
  77. package/zero-styled/index.js +1 -0
package/Table/Table.d.ts CHANGED
@@ -28,8 +28,6 @@ export interface TableOwnProps {
28
28
  size?: OverridableStringUnion<'small' | 'medium', TablePropsSizeOverrides>;
29
29
  /**
30
30
  * Set the header sticky.
31
- *
32
- * ⚠️ It doesn't work with IE11.
33
31
  * @default false
34
32
  */
35
33
  stickyHeader?: boolean;
package/Table/Table.js CHANGED
@@ -119,8 +119,6 @@ process.env.NODE_ENV !== "production" ? Table.propTypes /* remove-proptypes */ =
119
119
  size: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['medium', 'small']), PropTypes.string]),
120
120
  /**
121
121
  * Set the header sticky.
122
- *
123
- * ⚠️ It doesn't work with IE11.
124
122
  * @default false
125
123
  */
126
124
  stickyHeader: PropTypes.bool,
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/material v6.0.0-alpha.0
2
+ * @mui/material v6.0.0-alpha.1
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -2,16 +2,17 @@
2
2
 
3
3
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
4
4
  import _extends from "@babel/runtime/helpers/esm/extends";
5
+ import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
5
6
  import * as React from 'react';
6
7
  import PropTypes from 'prop-types';
7
8
  import clsx from 'clsx';
8
9
  import composeClasses from '@mui/utils/composeClasses';
9
- import styled from '../styles/styled';
10
- import useThemeProps from '../styles/useThemeProps';
10
+ import { styled, createUseThemeProps } from '../zero-styled';
11
11
  import capitalize from '../utils/capitalize';
12
12
  import Paper from '../Paper';
13
13
  import { getAppBarUtilityClass } from './appBarClasses';
14
14
  import { jsx as _jsx } from "react/jsx-runtime";
15
+ var useThemeProps = createUseThemeProps('MuiAppBar');
15
16
  var useUtilityClasses = function useUtilityClasses(ownerState) {
16
17
  var color = ownerState.color,
17
18
  position = ownerState.position,
@@ -35,73 +36,132 @@ var AppBarRoot = styled(Paper, {
35
36
  return [styles.root, styles["position".concat(capitalize(ownerState.position))], styles["color".concat(capitalize(ownerState.color))]];
36
37
  }
37
38
  })(function (_ref) {
38
- var theme = _ref.theme,
39
- ownerState = _ref.ownerState;
40
- var backgroundColorDefault = theme.palette.mode === 'light' ? theme.palette.grey[100] : theme.palette.grey[900];
41
- return _extends({
39
+ var _theme$vars;
40
+ var theme = _ref.theme;
41
+ return {
42
42
  display: 'flex',
43
43
  flexDirection: 'column',
44
44
  width: '100%',
45
45
  boxSizing: 'border-box',
46
46
  // Prevent padding issue with the Modal and fixed positioned AppBar.
47
- flexShrink: 0
48
- }, ownerState.position === 'fixed' && {
49
- position: 'fixed',
50
- zIndex: (theme.vars || theme).zIndex.appBar,
51
- top: 0,
52
- left: 'auto',
53
- right: 0,
54
- '@media print': {
55
- // Prevent the app bar to be visible on each printed page.
56
- position: 'absolute'
57
- }
58
- }, ownerState.position === 'absolute' && {
59
- position: 'absolute',
60
- zIndex: (theme.vars || theme).zIndex.appBar,
61
- top: 0,
62
- left: 'auto',
63
- right: 0
64
- }, ownerState.position === 'sticky' && {
65
- // ⚠️ sticky is not supported by IE11.
66
- position: 'sticky',
67
- zIndex: (theme.vars || theme).zIndex.appBar,
68
- top: 0,
69
- left: 'auto',
70
- right: 0
71
- }, ownerState.position === 'static' && {
72
- position: 'static'
73
- }, ownerState.position === 'relative' && {
74
- position: 'relative'
75
- }, !theme.vars && _extends({}, ownerState.color === 'default' && {
76
- backgroundColor: backgroundColorDefault,
77
- color: theme.palette.getContrastText(backgroundColorDefault)
78
- }, ownerState.color && ownerState.color !== 'default' && ownerState.color !== 'inherit' && ownerState.color !== 'transparent' && {
79
- backgroundColor: theme.palette[ownerState.color].main,
80
- color: theme.palette[ownerState.color].contrastText
81
- }, ownerState.color === 'inherit' && {
82
- color: 'inherit'
83
- }, theme.palette.mode === 'dark' && !ownerState.enableColorOnDark && {
84
- backgroundColor: null,
85
- color: null
86
- }, ownerState.color === 'transparent' && _extends({
87
- backgroundColor: 'transparent',
88
- color: 'inherit'
89
- }, theme.palette.mode === 'dark' && {
90
- backgroundImage: 'none'
91
- })), theme.vars && _extends({}, ownerState.color === 'default' && {
92
- '--AppBar-background': ownerState.enableColorOnDark ? theme.vars.palette.AppBar.defaultBg : joinVars(theme.vars.palette.AppBar.darkBg, theme.vars.palette.AppBar.defaultBg),
93
- '--AppBar-color': ownerState.enableColorOnDark ? theme.vars.palette.text.primary : joinVars(theme.vars.palette.AppBar.darkColor, theme.vars.palette.text.primary)
94
- }, ownerState.color && !ownerState.color.match(/^(default|inherit|transparent)$/) && {
95
- '--AppBar-background': ownerState.enableColorOnDark ? theme.vars.palette[ownerState.color].main : joinVars(theme.vars.palette.AppBar.darkBg, theme.vars.palette[ownerState.color].main),
96
- '--AppBar-color': ownerState.enableColorOnDark ? theme.vars.palette[ownerState.color].contrastText : joinVars(theme.vars.palette.AppBar.darkColor, theme.vars.palette[ownerState.color].contrastText)
97
- }, {
98
- backgroundColor: 'var(--AppBar-background)',
99
- color: ownerState.color === 'inherit' ? 'inherit' : 'var(--AppBar-color)'
100
- }, ownerState.color === 'transparent' && {
101
- backgroundImage: 'none',
102
- backgroundColor: 'transparent',
103
- color: 'inherit'
104
- }));
47
+ flexShrink: 0,
48
+ variants: [{
49
+ props: {
50
+ position: 'fixed'
51
+ },
52
+ style: {
53
+ position: 'fixed',
54
+ zIndex: (theme.vars || theme).zIndex.appBar,
55
+ top: 0,
56
+ left: 'auto',
57
+ right: 0,
58
+ '@media print': {
59
+ // Prevent the app bar to be visible on each printed page.
60
+ position: 'absolute'
61
+ }
62
+ }
63
+ }, {
64
+ props: {
65
+ position: 'absolute'
66
+ },
67
+ style: {
68
+ position: 'absolute',
69
+ zIndex: (theme.vars || theme).zIndex.appBar,
70
+ top: 0,
71
+ left: 'auto',
72
+ right: 0
73
+ }
74
+ }, {
75
+ props: {
76
+ position: 'sticky'
77
+ },
78
+ style: {
79
+ // ⚠️ sticky is not supported by IE11.
80
+ position: 'sticky',
81
+ zIndex: (theme.vars || theme).zIndex.appBar,
82
+ top: 0,
83
+ left: 'auto',
84
+ right: 0
85
+ }
86
+ }, {
87
+ props: {
88
+ position: 'static'
89
+ },
90
+ style: {
91
+ position: 'static'
92
+ }
93
+ }, {
94
+ props: {
95
+ position: 'relative'
96
+ },
97
+ style: {
98
+ position: 'relative'
99
+ }
100
+ }, {
101
+ props: {
102
+ color: 'inherit'
103
+ },
104
+ style: {
105
+ '--AppBar-color': 'inherit'
106
+ }
107
+ }, {
108
+ props: {
109
+ color: 'default'
110
+ },
111
+ style: _extends({
112
+ '--AppBar-background': theme.vars ? theme.vars.palette.AppBar.defaultBg : theme.palette.grey[100],
113
+ '--AppBar-color': theme.vars ? theme.vars.palette.text.primary : theme.palette.getContrastText(theme.palette.grey[100])
114
+ }, theme.applyStyles('dark', {
115
+ '--AppBar-background': theme.vars ? theme.vars.palette.AppBar.defaultBg : theme.palette.grey[900],
116
+ '--AppBar-color': theme.vars ? theme.vars.palette.text.primary : theme.palette.getContrastText(theme.palette.grey[900])
117
+ }))
118
+ }].concat(_toConsumableArray(Object.keys(((_theme$vars = theme.vars) != null ? _theme$vars : theme).palette).filter(function (key) {
119
+ var _theme$vars2, _theme$vars3;
120
+ return ((_theme$vars2 = theme.vars) != null ? _theme$vars2 : theme).palette[key].main && ((_theme$vars3 = theme.vars) != null ? _theme$vars3 : theme).palette[key].contrastText;
121
+ }).map(function (color) {
122
+ var _theme$vars4, _theme$vars5;
123
+ return {
124
+ props: {
125
+ color: color
126
+ },
127
+ style: {
128
+ '--AppBar-background': ((_theme$vars4 = theme.vars) != null ? _theme$vars4 : theme).palette[color].main,
129
+ '--AppBar-color': ((_theme$vars5 = theme.vars) != null ? _theme$vars5 : theme).palette[color].contrastText
130
+ }
131
+ };
132
+ })), [{
133
+ props: {
134
+ enableColorOnDark: true
135
+ },
136
+ style: {
137
+ backgroundColor: 'var(--AppBar-background)',
138
+ color: 'var(--AppBar-color)'
139
+ }
140
+ }, {
141
+ props: {
142
+ enableColorOnDark: false
143
+ },
144
+ style: _extends({
145
+ backgroundColor: 'var(--AppBar-background)',
146
+ color: 'var(--AppBar-color)'
147
+ }, theme.applyStyles('dark', {
148
+ backgroundColor: theme.vars ? joinVars(theme.vars.palette.AppBar.darkBg, 'var(--AppBar-background)') : null,
149
+ color: theme.vars ? joinVars(theme.vars.palette.AppBar.darkColor, 'var(--AppBar-color)') : null
150
+ }))
151
+ }, {
152
+ props: {
153
+ color: 'transparent'
154
+ },
155
+ style: _extends({
156
+ '--AppBar-background': 'transparent',
157
+ '--AppBar-color': 'inherit',
158
+ backgroundColor: 'var(--AppBar-background)',
159
+ color: 'var(--AppBar-color)'
160
+ }, theme.applyStyles('dark', {
161
+ backgroundImage: 'none'
162
+ }))
163
+ }])
164
+ };
105
165
  });
106
166
  var AppBar = /*#__PURE__*/React.forwardRef(function AppBar(inProps, ref) {
107
167
  var props = useThemeProps({
@@ -369,8 +369,7 @@ process.env.NODE_ENV !== "production" ? Badge.propTypes /* remove-proptypes */ =
369
369
  /**
370
370
  * The components used for each slot inside.
371
371
  *
372
- * This prop is an alias for the `slots` prop.
373
- * It's recommended to use the `slots` prop instead.
372
+ * @deprecated use the `slots` prop instead. This prop will be removed in v7. [How to migrate](/material-ui/migration/migrating-from-deprecated-apis/).
374
373
  *
375
374
  * @default {}
376
375
  */
@@ -382,8 +381,7 @@ process.env.NODE_ENV !== "production" ? Badge.propTypes /* remove-proptypes */ =
382
381
  * The extra props for the slot components.
383
382
  * You can override the existing props or add new ones.
384
383
  *
385
- * This prop is an alias for the `slotProps` prop.
386
- * It's recommended to use the `slotProps` prop instead, as `componentsProps` will be deprecated in the future.
384
+ * @deprecated use the `slotProps` prop instead. This prop will be removed in v7. [How to migrate](/material-ui/migration/migrating-from-deprecated-apis/).
387
385
  *
388
386
  * @default {}
389
387
  */