@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
@@ -1,7 +1,9 @@
1
1
  'use client';
2
2
 
3
- import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
4
3
  import _extends from "@babel/runtime/helpers/esm/extends";
4
+ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
5
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
6
+ import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
5
7
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
6
8
  import * as React from 'react';
7
9
  import PropTypes from 'prop-types';
@@ -10,12 +12,12 @@ import composeClasses from '@mui/utils/composeClasses';
10
12
  import { alpha } from '@mui/system/colorManipulator';
11
13
  import getValidReactChildren from '@mui/utils/getValidReactChildren';
12
14
  import capitalize from '../utils/capitalize';
13
- import styled from '../styles/styled';
14
- import useThemeProps from '../styles/useThemeProps';
15
+ import { styled, createUseThemeProps } from '../zero-styled';
15
16
  import buttonGroupClasses, { getButtonGroupUtilityClass } from './buttonGroupClasses';
16
17
  import ButtonGroupContext from './ButtonGroupContext';
17
18
  import ButtonGroupButtonContext from './ButtonGroupButtonContext';
18
19
  import { jsx as _jsx } from "react/jsx-runtime";
20
+ var useThemeProps = createUseThemeProps('MuiButtonGroup');
19
21
  var overridesResolver = function overridesResolver(props, styles) {
20
22
  var ownerState = props.ownerState;
21
23
  return [_defineProperty({}, "& .".concat(buttonGroupClasses.grouped), styles.grouped), _defineProperty({}, "& .".concat(buttonGroupClasses.grouped), styles["grouped".concat(capitalize(ownerState.orientation))]), _defineProperty({}, "& .".concat(buttonGroupClasses.grouped), styles["grouped".concat(capitalize(ownerState.variant))]), _defineProperty({}, "& .".concat(buttonGroupClasses.grouped), styles["grouped".concat(capitalize(ownerState.variant)).concat(capitalize(ownerState.orientation))]), _defineProperty({}, "& .".concat(buttonGroupClasses.grouped), styles["grouped".concat(capitalize(ownerState.variant)).concat(capitalize(ownerState.color))]), _defineProperty({}, "& .".concat(buttonGroupClasses.firstButton), styles.firstButton), _defineProperty({}, "& .".concat(buttonGroupClasses.lastButton), styles.lastButton), _defineProperty({}, "& .".concat(buttonGroupClasses.middleButton), styles.middleButton), styles.root, styles[ownerState.variant], ownerState.disableElevation === true && styles.disableElevation, ownerState.fullWidth && styles.fullWidth, ownerState.orientation === 'vertical' && styles.vertical];
@@ -42,73 +44,166 @@ var ButtonGroupRoot = styled('div', {
42
44
  slot: 'Root',
43
45
  overridesResolver: overridesResolver
44
46
  })(function (_ref9) {
45
- var theme = _ref9.theme,
46
- ownerState = _ref9.ownerState;
47
- return _extends({
47
+ var theme = _ref9.theme;
48
+ return _defineProperty({
48
49
  display: 'inline-flex',
49
- borderRadius: (theme.vars || theme).shape.borderRadius
50
- }, ownerState.variant === 'contained' && {
51
- boxShadow: (theme.vars || theme).shadows[2]
52
- }, ownerState.disableElevation && {
53
- boxShadow: 'none'
54
- }, ownerState.fullWidth && {
55
- width: '100%'
56
- }, ownerState.orientation === 'vertical' && {
57
- flexDirection: 'column'
58
- }, _defineProperty(_defineProperty(_defineProperty({}, "& .".concat(buttonGroupClasses.grouped), _extends({
50
+ borderRadius: (theme.vars || theme).shape.borderRadius,
51
+ variants: [{
52
+ props: {
53
+ variant: 'contained'
54
+ },
55
+ style: {
56
+ boxShadow: (theme.vars || theme).shadows[2]
57
+ }
58
+ }, {
59
+ props: {
60
+ disableElevation: true
61
+ },
62
+ style: {
63
+ boxShadow: 'none'
64
+ }
65
+ }, {
66
+ props: {
67
+ fullWidth: true
68
+ },
69
+ style: {
70
+ width: '100%'
71
+ }
72
+ }, {
73
+ props: {
74
+ orientation: 'vertical'
75
+ },
76
+ style: _defineProperty(_defineProperty({
77
+ flexDirection: 'column'
78
+ }, "& .".concat(buttonGroupClasses.lastButton, ",& .").concat(buttonGroupClasses.middleButton), {
79
+ borderTopRightRadius: 0,
80
+ borderTopLeftRadius: 0
81
+ }), "& .".concat(buttonGroupClasses.firstButton, ",& .").concat(buttonGroupClasses.middleButton), {
82
+ borderBottomRightRadius: 0,
83
+ borderBottomLeftRadius: 0
84
+ })
85
+ }, {
86
+ props: {
87
+ orientation: 'horizontal'
88
+ },
89
+ style: _defineProperty(_defineProperty({}, "& .".concat(buttonGroupClasses.firstButton, ",& .").concat(buttonGroupClasses.middleButton), {
90
+ borderTopRightRadius: 0,
91
+ borderBottomRightRadius: 0
92
+ }), "& .".concat(buttonGroupClasses.lastButton, ",& .").concat(buttonGroupClasses.middleButton), {
93
+ borderTopLeftRadius: 0,
94
+ borderBottomLeftRadius: 0
95
+ })
96
+ }, {
97
+ props: {
98
+ variant: 'text',
99
+ orientation: 'horizontal'
100
+ },
101
+ style: _defineProperty({}, "& .".concat(buttonGroupClasses.firstButton, ",& .").concat(buttonGroupClasses.middleButton), _defineProperty({
102
+ borderRight: theme.vars ? "1px solid rgba(".concat(theme.vars.palette.common.onBackgroundChannel, " / 0.23)") : "1px solid ".concat(theme.palette.mode === 'light' ? 'rgba(0, 0, 0, 0.23)' : 'rgba(255, 255, 255, 0.23)')
103
+ }, "&.".concat(buttonGroupClasses.disabled), {
104
+ borderRight: "1px solid ".concat((theme.vars || theme).palette.action.disabled)
105
+ }))
106
+ }, {
107
+ props: {
108
+ variant: 'text',
109
+ orientation: 'vertical'
110
+ },
111
+ style: _defineProperty({}, "& .".concat(buttonGroupClasses.firstButton, ",& .").concat(buttonGroupClasses.middleButton), _defineProperty({
112
+ borderBottom: theme.vars ? "1px solid rgba(".concat(theme.vars.palette.common.onBackgroundChannel, " / 0.23)") : "1px solid ".concat(theme.palette.mode === 'light' ? 'rgba(0, 0, 0, 0.23)' : 'rgba(255, 255, 255, 0.23)')
113
+ }, "&.".concat(buttonGroupClasses.disabled), {
114
+ borderBottom: "1px solid ".concat((theme.vars || theme).palette.action.disabled)
115
+ }))
116
+ }].concat(_toConsumableArray(Object.entries(theme.palette).filter(function (_ref10) {
117
+ var _ref11 = _slicedToArray(_ref10, 2),
118
+ value = _ref11[1];
119
+ return value.main;
120
+ }).flatMap(function (_ref12) {
121
+ var _ref13 = _slicedToArray(_ref12, 1),
122
+ color = _ref13[0];
123
+ return [{
124
+ props: {
125
+ variant: 'text',
126
+ color: color
127
+ },
128
+ style: _defineProperty({}, "& .".concat(buttonGroupClasses.firstButton, ",& .").concat(buttonGroupClasses.middleButton), {
129
+ borderColor: theme.vars ? "rgba(".concat(theme.vars.palette[color].mainChannel, " / 0.5)") : alpha(theme.palette[color].main, 0.5)
130
+ })
131
+ }];
132
+ })), [{
133
+ props: {
134
+ variant: 'outlined',
135
+ orientation: 'horizontal'
136
+ },
137
+ style: _defineProperty(_defineProperty({}, "& .".concat(buttonGroupClasses.firstButton, ",& .").concat(buttonGroupClasses.middleButton), {
138
+ borderRightColor: 'transparent',
139
+ '&:hover': {
140
+ borderRightColor: 'currentColor'
141
+ }
142
+ }), "& .".concat(buttonGroupClasses.lastButton, ",& .").concat(buttonGroupClasses.middleButton), {
143
+ marginLeft: -1
144
+ })
145
+ }, {
146
+ props: {
147
+ variant: 'outlined',
148
+ orientation: 'vertical'
149
+ },
150
+ style: _defineProperty(_defineProperty({}, "& .".concat(buttonGroupClasses.firstButton, ",& .").concat(buttonGroupClasses.middleButton), {
151
+ borderBottomColor: 'transparent',
152
+ '&:hover': {
153
+ borderBottomColor: 'currentColor'
154
+ }
155
+ }), "& .".concat(buttonGroupClasses.lastButton, ",& .").concat(buttonGroupClasses.middleButton), {
156
+ marginTop: -1
157
+ })
158
+ }, {
159
+ props: {
160
+ variant: 'contained',
161
+ orientation: 'horizontal'
162
+ },
163
+ style: _defineProperty({}, "& .".concat(buttonGroupClasses.firstButton, ",& .").concat(buttonGroupClasses.middleButton), _defineProperty({
164
+ borderRight: "1px solid ".concat((theme.vars || theme).palette.grey[400])
165
+ }, "&.".concat(buttonGroupClasses.disabled), {
166
+ borderRight: "1px solid ".concat((theme.vars || theme).palette.action.disabled)
167
+ }))
168
+ }, {
169
+ props: {
170
+ variant: 'contained',
171
+ orientation: 'vertical'
172
+ },
173
+ style: _defineProperty({}, "& .".concat(buttonGroupClasses.firstButton, ",& .").concat(buttonGroupClasses.middleButton), _defineProperty({
174
+ borderBottom: "1px solid ".concat((theme.vars || theme).palette.grey[400])
175
+ }, "&.".concat(buttonGroupClasses.disabled), {
176
+ borderBottom: "1px solid ".concat((theme.vars || theme).palette.action.disabled)
177
+ }))
178
+ }], _toConsumableArray(Object.entries(theme.palette).filter(function (_ref14) {
179
+ var _ref15 = _slicedToArray(_ref14, 2),
180
+ value = _ref15[1];
181
+ return value.dark;
182
+ }).map(function (_ref16) {
183
+ var _ref17 = _slicedToArray(_ref16, 1),
184
+ color = _ref17[0];
185
+ return {
186
+ props: {
187
+ variant: 'contained',
188
+ color: color
189
+ },
190
+ style: _defineProperty({}, "& .".concat(buttonGroupClasses.firstButton, ",& .").concat(buttonGroupClasses.middleButton), {
191
+ borderColor: (theme.vars || theme).palette[color].dark
192
+ })
193
+ };
194
+ })))
195
+ }, "& .".concat(buttonGroupClasses.grouped), {
59
196
  minWidth: 40,
60
- '&:hover': _extends({}, ownerState.variant === 'contained' && {
61
- boxShadow: 'none'
62
- })
63
- }, ownerState.variant === 'contained' && {
64
- boxShadow: 'none'
65
- })), "& .".concat(buttonGroupClasses.firstButton, ",& .").concat(buttonGroupClasses.middleButton), _extends({}, ownerState.orientation === 'horizontal' && {
66
- borderTopRightRadius: 0,
67
- borderBottomRightRadius: 0
68
- }, ownerState.orientation === 'vertical' && {
69
- borderBottomRightRadius: 0,
70
- borderBottomLeftRadius: 0
71
- }, ownerState.variant === 'text' && ownerState.orientation === 'horizontal' && _defineProperty({
72
- borderRight: theme.vars ? "1px solid rgba(".concat(theme.vars.palette.common.onBackgroundChannel, " / 0.23)") : "1px solid ".concat(theme.palette.mode === 'light' ? 'rgba(0, 0, 0, 0.23)' : 'rgba(255, 255, 255, 0.23)')
73
- }, "&.".concat(buttonGroupClasses.disabled), {
74
- borderRight: "1px solid ".concat((theme.vars || theme).palette.action.disabled)
75
- }), ownerState.variant === 'text' && ownerState.orientation === 'vertical' && _defineProperty({
76
- borderBottom: theme.vars ? "1px solid rgba(".concat(theme.vars.palette.common.onBackgroundChannel, " / 0.23)") : "1px solid ".concat(theme.palette.mode === 'light' ? 'rgba(0, 0, 0, 0.23)' : 'rgba(255, 255, 255, 0.23)')
77
- }, "&.".concat(buttonGroupClasses.disabled), {
78
- borderBottom: "1px solid ".concat((theme.vars || theme).palette.action.disabled)
79
- }), ownerState.variant === 'text' && ownerState.color !== 'inherit' && {
80
- borderColor: theme.vars ? "rgba(".concat(theme.vars.palette[ownerState.color].mainChannel, " / 0.5)") : alpha(theme.palette[ownerState.color].main, 0.5)
81
- }, ownerState.variant === 'outlined' && ownerState.orientation === 'horizontal' && {
82
- borderRightColor: 'transparent'
83
- }, ownerState.variant === 'outlined' && ownerState.orientation === 'vertical' && {
84
- borderBottomColor: 'transparent'
85
- }, ownerState.variant === 'contained' && ownerState.orientation === 'horizontal' && _defineProperty({
86
- borderRight: "1px solid ".concat((theme.vars || theme).palette.grey[400])
87
- }, "&.".concat(buttonGroupClasses.disabled), {
88
- borderRight: "1px solid ".concat((theme.vars || theme).palette.action.disabled)
89
- }), ownerState.variant === 'contained' && ownerState.orientation === 'vertical' && _defineProperty({
90
- borderBottom: "1px solid ".concat((theme.vars || theme).palette.grey[400])
91
- }, "&.".concat(buttonGroupClasses.disabled), {
92
- borderBottom: "1px solid ".concat((theme.vars || theme).palette.action.disabled)
93
- }), ownerState.variant === 'contained' && ownerState.color !== 'inherit' && {
94
- borderColor: (theme.vars || theme).palette[ownerState.color].dark
95
- }, {
96
- '&:hover': _extends({}, ownerState.variant === 'outlined' && ownerState.orientation === 'horizontal' && {
97
- borderRightColor: 'currentColor'
98
- }, ownerState.variant === 'outlined' && ownerState.orientation === 'vertical' && {
99
- borderBottomColor: 'currentColor'
100
- })
101
- })), "& .".concat(buttonGroupClasses.lastButton, ",& .").concat(buttonGroupClasses.middleButton), _extends({}, ownerState.orientation === 'horizontal' && {
102
- borderTopLeftRadius: 0,
103
- borderBottomLeftRadius: 0
104
- }, ownerState.orientation === 'vertical' && {
105
- borderTopRightRadius: 0,
106
- borderTopLeftRadius: 0
107
- }, ownerState.variant === 'outlined' && ownerState.orientation === 'horizontal' && {
108
- marginLeft: -1
109
- }, ownerState.variant === 'outlined' && ownerState.orientation === 'vertical' && {
110
- marginTop: -1
111
- })));
197
+ boxShadow: 'none',
198
+ props: {
199
+ variant: 'contained'
200
+ },
201
+ style: {
202
+ '&:hover': {
203
+ boxShadow: 'none'
204
+ }
205
+ }
206
+ });
112
207
  });
113
208
  var ButtonGroup = /*#__PURE__*/React.forwardRef(function ButtonGroup(inProps, ref) {
114
209
  var props = useThemeProps({
@@ -30,6 +30,9 @@ import gridClasses, { getGridUtilityClass } from './gridClasses';
30
30
  import { jsx as _jsx } from "react/jsx-runtime";
31
31
  function getOffset(val) {
32
32
  var parse = parseFloat(val);
33
+ if (Number.isNaN(parse)) {
34
+ return val;
35
+ }
33
36
  return "".concat(parse).concat(String(val).replace(String(parse), '') || 'px');
34
37
  }
35
38
  export function generateGrid(_ref) {
@@ -5,21 +5,35 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
5
5
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
6
6
  import * as React from 'react';
7
7
  import PropTypes from 'prop-types';
8
+ import clsx from 'clsx';
9
+ import composeClasses from '@mui/utils/composeClasses';
8
10
  import FormGroup from '../FormGroup';
11
+ import { getRadioGroupUtilityClass } from './radioGroupClasses';
9
12
  import useForkRef from '../utils/useForkRef';
10
13
  import useControlled from '../utils/useControlled';
11
14
  import RadioGroupContext from './RadioGroupContext';
12
15
  import useId from '../utils/useId';
13
16
  import { jsx as _jsx } from "react/jsx-runtime";
17
+ var useUtilityClasses = function useUtilityClasses(props) {
18
+ var classes = props.classes,
19
+ row = props.row,
20
+ error = props.error;
21
+ var slots = {
22
+ root: ['root', row && 'row', error && 'error']
23
+ };
24
+ return composeClasses(slots, getRadioGroupUtilityClass, classes);
25
+ };
14
26
  var RadioGroup = /*#__PURE__*/React.forwardRef(function RadioGroup(props, ref) {
15
27
  var actions = props.actions,
16
28
  children = props.children,
29
+ className = props.className,
17
30
  defaultValue = props.defaultValue,
18
31
  nameProp = props.name,
19
32
  _onChange = props.onChange,
20
33
  valueProp = props.value,
21
- other = _objectWithoutProperties(props, ["actions", "children", "defaultValue", "name", "onChange", "value"]);
34
+ other = _objectWithoutProperties(props, ["actions", "children", "className", "defaultValue", "name", "onChange", "value"]);
22
35
  var rootRef = React.useRef(null);
36
+ var classes = useUtilityClasses(props);
23
37
  var _useControlled = useControlled({
24
38
  controlled: valueProp,
25
39
  default: defaultValue,
@@ -59,7 +73,8 @@ var RadioGroup = /*#__PURE__*/React.forwardRef(function RadioGroup(props, ref) {
59
73
  value: contextValue,
60
74
  children: /*#__PURE__*/_jsx(FormGroup, _extends({
61
75
  role: "radiogroup",
62
- ref: handleRef
76
+ ref: handleRef,
77
+ className: clsx(classes.root, className)
63
78
  }, other, {
64
79
  children: children
65
80
  }))
@@ -74,6 +89,10 @@ process.env.NODE_ENV !== "production" ? RadioGroup.propTypes /* remove-proptypes
74
89
  * The content of the component.
75
90
  */
76
91
  children: PropTypes.node,
92
+ /**
93
+ * @ignore
94
+ */
95
+ className: PropTypes.string,
77
96
  /**
78
97
  * The default value. Use when the component is not controlled.
79
98
  */
@@ -1,4 +1,6 @@
1
1
  'use client';
2
2
 
3
3
  export { default } from './RadioGroup';
4
- export { default as useRadioGroup } from './useRadioGroup';
4
+ export { default as useRadioGroup } from './useRadioGroup';
5
+ export { default as radioGroupClasses } from './radioGroupClasses';
6
+ export * from './radioGroupClasses';
@@ -0,0 +1,7 @@
1
+ import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
2
+ import generateUtilityClass from '@mui/utils/generateUtilityClass';
3
+ export function getRadioGroupUtilityClass(slot) {
4
+ return generateUtilityClass('MuiRadioGroup', slot);
5
+ }
6
+ var radioGroupClasses = generateUtilityClasses('MuiRadioGroup', ['root', 'row', 'error']);
7
+ export default radioGroupClasses;
@@ -287,29 +287,7 @@ export var SliderThumb = styled('span', {
287
287
  '&:hover': {
288
288
  boxShadow: 'none'
289
289
  }
290
- }), "variants", [].concat(_toConsumableArray(Object.keys(((_theme$vars5 = theme.vars) != null ? _theme$vars5 : theme).palette).filter(function (key) {
291
- var _theme$vars6;
292
- return ((_theme$vars6 = theme.vars) != null ? _theme$vars6 : theme).palette[key].main;
293
- }).map(function (color) {
294
- return {
295
- props: {
296
- color: color
297
- },
298
- style: _defineProperty(_defineProperty({}, "&:hover, &.".concat(sliderClasses.focusVisible), _extends({}, theme.vars ? {
299
- boxShadow: "0px 0px 0px 8px rgba(".concat(theme.vars.palette[color].mainChannel, " / 0.16)")
300
- } : {
301
- boxShadow: "0px 0px 0px 8px ".concat(alpha(theme.palette[color].main, 0.16))
302
- }, {
303
- '@media (hover: none)': {
304
- boxShadow: 'none'
305
- }
306
- })), "&.".concat(sliderClasses.active), _extends({}, theme.vars ? {
307
- boxShadow: "0px 0px 0px 14px rgba(".concat(theme.vars.palette[color].mainChannel, " / 0.16)}")
308
- } : {
309
- boxShadow: "0px 0px 0px 14px ".concat(alpha(theme.palette[color].main, 0.16))
310
- }))
311
- };
312
- })), [{
290
+ }), "variants", [{
313
291
  props: {
314
292
  size: 'small'
315
293
  },
@@ -336,7 +314,29 @@ export var SliderThumb = styled('span', {
336
314
  left: '50%',
337
315
  transform: 'translate(-50%, 50%)'
338
316
  }
339
- }]));
317
+ }].concat(_toConsumableArray(Object.keys(((_theme$vars5 = theme.vars) != null ? _theme$vars5 : theme).palette).filter(function (key) {
318
+ var _theme$vars6;
319
+ return ((_theme$vars6 = theme.vars) != null ? _theme$vars6 : theme).palette[key].main;
320
+ }).map(function (color) {
321
+ return {
322
+ props: {
323
+ color: color
324
+ },
325
+ style: _defineProperty(_defineProperty({}, "&:hover, &.".concat(sliderClasses.focusVisible), _extends({}, theme.vars ? {
326
+ boxShadow: "0px 0px 0px 8px rgba(".concat(theme.vars.palette[color].mainChannel, " / 0.16)")
327
+ } : {
328
+ boxShadow: "0px 0px 0px 8px ".concat(alpha(theme.palette[color].main, 0.16))
329
+ }, {
330
+ '@media (hover: none)': {
331
+ boxShadow: 'none'
332
+ }
333
+ })), "&.".concat(sliderClasses.active), _extends({}, theme.vars ? {
334
+ boxShadow: "0px 0px 0px 14px rgba(".concat(theme.vars.palette[color].mainChannel, " / 0.16)}")
335
+ } : {
336
+ boxShadow: "0px 0px 0px 14px ".concat(alpha(theme.palette[color].main, 0.16))
337
+ }))
338
+ };
339
+ }))));
340
340
  });
341
341
  export var SliderValueLabel = styled(BaseSliderValueLabel, {
342
342
  name: 'MuiSlider',
@@ -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/legacy/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
@@ -4,7 +4,9 @@ import _extends from "@babel/runtime/helpers/esm/extends";
4
4
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
5
5
  import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
6
6
  import deepmerge from '@mui/utils/deepmerge';
7
- import { unstable_createGetCssVar as systemCreateGetCssVar, unstable_prepareCssVars as prepareCssVars } from '@mui/system';
7
+ import { unstable_createGetCssVar as systemCreateGetCssVar, createSpacing } from '@mui/system';
8
+ import { createUnarySpacing } from '@mui/system/spacing';
9
+ import { prepareCssVars } from '@mui/system/cssVars';
8
10
  import styleFunctionSx, { unstable_defaultSxConfig as defaultSxConfig } from '@mui/system/styleFunctionSx';
9
11
  import { private_safeColorChannel as safeColorChannel, private_safeAlpha as safeAlpha, private_safeDarken as safeDarken, private_safeLighten as safeLighten, private_safeEmphasize as safeEmphasize, hslToRgb } from '@mui/system/colorManipulator';
10
12
  import defaultShouldSkipGeneratingVar from './shouldSkipGeneratingVar';
@@ -43,6 +45,21 @@ function setColorChannel(obj, key) {
43
45
  obj["".concat(key, "Channel")] = safeColorChannel(toRgb(obj[key]), "MUI: Can't create `palette.".concat(key, "Channel` because `palette.").concat(key, "` is not one of these formats: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color().") + '\n' + "To suppress this warning, you need to explicitly provide the `palette.".concat(key, "Channel` as a string (in rgb format, for example \"12 12 12\") or undefined if you want to remove the channel token."));
44
46
  }
45
47
  }
48
+ function getSpacingVal(spacingInput) {
49
+ if (typeof spacingInput === 'number') {
50
+ return "".concat(spacingInput, "px");
51
+ }
52
+ if (typeof spacingInput === 'string') {
53
+ return spacingInput;
54
+ }
55
+ if (typeof spacingInput === 'function') {
56
+ return getSpacingVal(spacingInput(1));
57
+ }
58
+ if (Array.isArray(spacingInput)) {
59
+ return spacingInput;
60
+ }
61
+ return '8px';
62
+ }
46
63
  var silent = function silent(fn) {
47
64
  try {
48
65
  return fn();
@@ -104,7 +121,8 @@ export default function extendTheme() {
104
121
  }, (_colorSchemesInput$da2 = colorSchemesInput.dark) == null ? void 0 : _colorSchemesInput$da2.opacity),
105
122
  overlays: ((_colorSchemesInput$da3 = colorSchemesInput.dark) == null ? void 0 : _colorSchemesInput$da3.overlays) || defaultDarkOverlays
106
123
  })
107
- })
124
+ }),
125
+ spacing: getSpacingVal(input.spacing)
108
126
  });
109
127
  Object.keys(theme.colorSchemes).forEach(function (key) {
110
128
  var palette = theme.colorSchemes[key].palette;
@@ -340,9 +358,13 @@ export default function extendTheme() {
340
358
  });
341
359
  theme.generateThemeVars = generateThemeVars;
342
360
  theme.generateStyleSheets = generateStyleSheets;
361
+ theme.generateSpacing = function generateSpacing() {
362
+ return createSpacing(input.spacing, createUnarySpacing(this));
363
+ };
343
364
  theme.getColorSchemeSelector = function (colorScheme) {
344
365
  return "[".concat(theme.attribute, "=\"").concat(colorScheme, "\"] &");
345
366
  };
367
+ theme.spacing = theme.generateSpacing();
346
368
  theme.shouldSkipGeneratingVar = shouldSkipGeneratingVar;
347
369
  theme.unstable_sxConfig = _extends({}, defaultSxConfig, input == null ? void 0 : input.unstable_sxConfig);
348
370
  theme.unstable_sx = function sx(props) {
@@ -1,4 +1,5 @@
1
1
  import useThemeProps from '../styles/useThemeProps';
2
+ export { keyframes } from '@mui/system';
2
3
  export { default as styled } from '../styles/styled';
3
4
 
4
5
  // eslint-disable-next-line @typescript-eslint/no-unused-vars