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

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 (82) 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 +170 -4
  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/Select/Select.d.ts +9 -6
  18. package/Slider/Slider.js +22 -22
  19. package/Table/Table.d.ts +0 -2
  20. package/Table/Table.js +0 -2
  21. package/index.js +1 -1
  22. package/legacy/AppBar/AppBar.js +124 -64
  23. package/legacy/Badge/Badge.js +2 -4
  24. package/legacy/Button/Button.js +218 -123
  25. package/legacy/ButtonBase/ButtonBase.js +2 -2
  26. package/legacy/ButtonBase/Ripple.js +1 -1
  27. package/legacy/ButtonBase/TouchRipple.js +3 -4
  28. package/legacy/ButtonGroup/ButtonGroup.js +163 -68
  29. package/legacy/Grid/Grid.js +3 -0
  30. package/legacy/RadioGroup/RadioGroup.js +21 -2
  31. package/legacy/RadioGroup/index.js +3 -1
  32. package/legacy/RadioGroup/radioGroupClasses.js +7 -0
  33. package/legacy/Slider/Slider.js +24 -24
  34. package/legacy/Table/Table.js +0 -2
  35. package/legacy/index.js +1 -1
  36. package/legacy/locale/index.js +1 -1
  37. package/legacy/styles/experimental_extendTheme.js +24 -2
  38. package/legacy/zero-styled/index.js +1 -0
  39. package/locale/index.js +1 -1
  40. package/modern/AppBar/AppBar.js +118 -68
  41. package/modern/Badge/Badge.js +2 -4
  42. package/modern/Button/Button.js +220 -131
  43. package/modern/ButtonBase/ButtonBase.js +2 -2
  44. package/modern/ButtonBase/Ripple.js +1 -1
  45. package/modern/ButtonBase/TouchRipple.js +3 -4
  46. package/modern/ButtonGroup/ButtonGroup.js +167 -70
  47. package/modern/Grid/Grid.js +3 -0
  48. package/modern/RadioGroup/RadioGroup.js +23 -2
  49. package/modern/RadioGroup/index.js +3 -1
  50. package/modern/RadioGroup/radioGroupClasses.js +7 -0
  51. package/modern/Slider/Slider.js +22 -22
  52. package/modern/Table/Table.js +0 -2
  53. package/modern/index.js +1 -1
  54. package/modern/locale/index.js +1 -1
  55. package/modern/styles/experimental_extendTheme.js +24 -2
  56. package/modern/zero-styled/index.js +1 -0
  57. package/node/AppBar/AppBar.js +125 -66
  58. package/node/Badge/Badge.js +2 -4
  59. package/node/Button/Button.js +224 -135
  60. package/node/ButtonBase/ButtonBase.js +4 -4
  61. package/node/ButtonBase/Ripple.js +1 -1
  62. package/node/ButtonBase/TouchRipple.js +9 -10
  63. package/node/ButtonGroup/ButtonGroup.js +169 -72
  64. package/node/Grid/Grid.js +3 -0
  65. package/node/RadioGroup/RadioGroup.js +23 -2
  66. package/node/RadioGroup/index.js +25 -1
  67. package/node/RadioGroup/radioGroupClasses.js +15 -0
  68. package/node/Slider/Slider.js +25 -25
  69. package/node/Table/Table.js +0 -2
  70. package/node/index.js +1 -1
  71. package/node/locale/index.js +1 -1
  72. package/node/styles/experimental_extendTheme.js +24 -2
  73. package/node/zero-styled/index.js +7 -0
  74. package/package.json +6 -6
  75. package/styles/components.d.ts +5 -0
  76. package/styles/experimental_extendTheme.d.ts +2 -0
  77. package/styles/experimental_extendTheme.js +24 -2
  78. package/styles/overrides.d.ts +2 -0
  79. package/umd/material-ui.development.js +888 -593
  80. package/umd/material-ui.production.min.js +4 -4
  81. package/zero-styled/index.d.ts +1 -0
  82. package/zero-styled/index.js +1 -0
@@ -151,7 +151,8 @@ export interface BaseSelectProps<Value = unknown>
151
151
  variant?: SelectVariants;
152
152
  }
153
153
 
154
- export interface FilledSelectProps extends Omit<FilledInputProps, 'value' | 'onChange'> {
154
+ export interface FilledSelectProps
155
+ extends Omit<FilledInputProps, 'value' | 'onChange' | 'id' | 'classes' | 'inputProps'> {
155
156
  /**
156
157
  * The variant to use.
157
158
  * @default 'outlined'
@@ -159,7 +160,8 @@ export interface FilledSelectProps extends Omit<FilledInputProps, 'value' | 'onC
159
160
  variant: 'filled';
160
161
  }
161
162
 
162
- export interface StandardSelectProps extends Omit<InputProps, 'value' | 'onChange'> {
163
+ export interface StandardSelectProps
164
+ extends Omit<InputProps, 'value' | 'onChange' | 'id' | 'classes' | 'inputProps'> {
163
165
  /**
164
166
  * The variant to use.
165
167
  * @default 'outlined'
@@ -167,7 +169,8 @@ export interface StandardSelectProps extends Omit<InputProps, 'value' | 'onChang
167
169
  variant: 'standard';
168
170
  }
169
171
 
170
- export interface OutlinedSelectProps extends Omit<OutlinedInputProps, 'value' | 'onChange'> {
172
+ export interface OutlinedSelectProps
173
+ extends Omit<OutlinedInputProps, 'value' | 'onChange' | 'id' | 'classes' | 'inputProps'> {
171
174
  /**
172
175
  * The variant to use.
173
176
  * @default 'outlined'
@@ -193,8 +196,8 @@ export type SelectProps<Value = unknown> =
193
196
  * - [Select API](https://mui.com/material-ui/api/select/)
194
197
  * - inherits [OutlinedInput API](https://mui.com/material-ui/api/outlined-input/)
195
198
  */
196
- export default function Select<Value = unknown>(
197
- props: SelectProps<Value>,
198
- ): JSX.Element & {
199
+ declare const Select: (<Value = unknown>(props: SelectProps<Value>) => JSX.Element) & {
199
200
  muiName: string;
200
201
  };
202
+
203
+ export default Select;
package/Slider/Slider.js CHANGED
@@ -279,27 +279,7 @@ export const SliderThumb = styled('span', {
279
279
  boxShadow: 'none'
280
280
  }
281
281
  },
282
- variants: [...Object.keys((theme.vars ?? theme).palette).filter(key => (theme.vars ?? theme).palette[key].main).map(color => ({
283
- props: {
284
- color
285
- },
286
- style: {
287
- [`&:hover, &.${sliderClasses.focusVisible}`]: _extends({}, theme.vars ? {
288
- boxShadow: `0px 0px 0px 8px rgba(${theme.vars.palette[color].mainChannel} / 0.16)`
289
- } : {
290
- boxShadow: `0px 0px 0px 8px ${alpha(theme.palette[color].main, 0.16)}`
291
- }, {
292
- '@media (hover: none)': {
293
- boxShadow: 'none'
294
- }
295
- }),
296
- [`&.${sliderClasses.active}`]: _extends({}, theme.vars ? {
297
- boxShadow: `0px 0px 0px 14px rgba(${theme.vars.palette[color].mainChannel} / 0.16)}`
298
- } : {
299
- boxShadow: `0px 0px 0px 14px ${alpha(theme.palette[color].main, 0.16)}`
300
- })
301
- }
302
- })), {
282
+ variants: [{
303
283
  props: {
304
284
  size: 'small'
305
285
  },
@@ -326,7 +306,27 @@ export const SliderThumb = styled('span', {
326
306
  left: '50%',
327
307
  transform: 'translate(-50%, 50%)'
328
308
  }
329
- }]
309
+ }, ...Object.keys((theme.vars ?? theme).palette).filter(key => (theme.vars ?? theme).palette[key].main).map(color => ({
310
+ props: {
311
+ color
312
+ },
313
+ style: {
314
+ [`&:hover, &.${sliderClasses.focusVisible}`]: _extends({}, theme.vars ? {
315
+ boxShadow: `0px 0px 0px 8px rgba(${theme.vars.palette[color].mainChannel} / 0.16)`
316
+ } : {
317
+ boxShadow: `0px 0px 0px 8px ${alpha(theme.palette[color].main, 0.16)}`
318
+ }, {
319
+ '@media (hover: none)': {
320
+ boxShadow: 'none'
321
+ }
322
+ }),
323
+ [`&.${sliderClasses.active}`]: _extends({}, theme.vars ? {
324
+ boxShadow: `0px 0px 0px 14px rgba(${theme.vars.palette[color].mainChannel} / 0.16)}`
325
+ } : {
326
+ boxShadow: `0px 0px 0px 14px ${alpha(theme.palette[color].main, 0.16)}`
327
+ })
328
+ }
329
+ }))]
330
330
  }));
331
331
  export const SliderValueLabel = styled(BaseSliderValueLabel, {
332
332
  name: 'MuiSlider',
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.2
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
  */