@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
@@ -50,7 +50,7 @@ function Ripple(props) {
50
50
  })
51
51
  });
52
52
  }
53
- process.env.NODE_ENV !== "production" ? Ripple.propTypes = {
53
+ process.env.NODE_ENV !== "production" ? Ripple.propTypes /* remove-proptypes */ = {
54
54
  /**
55
55
  * Override or extend the styles applied to the component.
56
56
  */
@@ -7,13 +7,12 @@ import * as React from 'react';
7
7
  import PropTypes from 'prop-types';
8
8
  import { TransitionGroup } from 'react-transition-group';
9
9
  import clsx from 'clsx';
10
- import { keyframes } from '@mui/system';
11
10
  import useTimeout from '@mui/utils/useTimeout';
12
- import styled from '../styles/styled';
13
- import useThemeProps from '../styles/useThemeProps';
11
+ import { keyframes, styled, createUseThemeProps } from '../zero-styled';
14
12
  import Ripple from './Ripple';
15
13
  import touchRippleClasses from './touchRippleClasses';
16
14
  import { jsx as _jsx } from "react/jsx-runtime";
15
+ const useThemeProps = createUseThemeProps('MuiTouchRipple');
17
16
  const DURATION = 550;
18
17
  export const DELAY_RIPPLE = 80;
19
18
  const enterKeyframe = keyframes`
@@ -310,7 +309,7 @@ const TouchRipple = /*#__PURE__*/React.forwardRef(function TouchRipple(inProps,
310
309
  })
311
310
  }));
312
311
  });
313
- process.env.NODE_ENV !== "production" ? TouchRipple.propTypes = {
312
+ process.env.NODE_ENV !== "production" ? TouchRipple.propTypes /* remove-proptypes */ = {
314
313
  /**
315
314
  * If `true`, the ripple starts at the center of the component
316
315
  * rather than at the point of interaction.
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
 
3
- import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
4
3
  import _extends from "@babel/runtime/helpers/esm/extends";
4
+ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
5
5
  const _excluded = ["children", "className", "color", "component", "disabled", "disableElevation", "disableFocusRipple", "disableRipple", "fullWidth", "orientation", "size", "variant"];
6
6
  import * as React from 'react';
7
7
  import PropTypes from 'prop-types';
@@ -10,12 +10,12 @@ import composeClasses from '@mui/utils/composeClasses';
10
10
  import { alpha } from '@mui/system/colorManipulator';
11
11
  import getValidReactChildren from '@mui/utils/getValidReactChildren';
12
12
  import capitalize from '../utils/capitalize';
13
- import styled from '../styles/styled';
14
- import useThemeProps from '../styles/useThemeProps';
13
+ import { styled, createUseThemeProps } from '../zero-styled';
15
14
  import buttonGroupClasses, { getButtonGroupUtilityClass } from './buttonGroupClasses';
16
15
  import ButtonGroupContext from './ButtonGroupContext';
17
16
  import ButtonGroupButtonContext from './ButtonGroupButtonContext';
18
17
  import { jsx as _jsx } from "react/jsx-runtime";
18
+ const useThemeProps = createUseThemeProps('MuiButtonGroup');
19
19
  const overridesResolver = (props, styles) => {
20
20
  const {
21
21
  ownerState
@@ -62,80 +62,177 @@ const ButtonGroupRoot = styled('div', {
62
62
  slot: 'Root',
63
63
  overridesResolver
64
64
  })(({
65
- theme,
66
- ownerState
67
- }) => _extends({
65
+ theme
66
+ }) => ({
68
67
  display: 'inline-flex',
69
- borderRadius: (theme.vars || theme).shape.borderRadius
70
- }, ownerState.variant === 'contained' && {
71
- boxShadow: (theme.vars || theme).shadows[2]
72
- }, ownerState.disableElevation && {
73
- boxShadow: 'none'
74
- }, ownerState.fullWidth && {
75
- width: '100%'
76
- }, ownerState.orientation === 'vertical' && {
77
- flexDirection: 'column'
78
- }, {
79
- [`& .${buttonGroupClasses.grouped}`]: _extends({
80
- minWidth: 40,
81
- '&:hover': _extends({}, ownerState.variant === 'contained' && {
68
+ borderRadius: (theme.vars || theme).shape.borderRadius,
69
+ variants: [{
70
+ props: {
71
+ variant: 'contained'
72
+ },
73
+ style: {
74
+ boxShadow: (theme.vars || theme).shadows[2]
75
+ }
76
+ }, {
77
+ props: {
78
+ disableElevation: true
79
+ },
80
+ style: {
82
81
  boxShadow: 'none'
83
- })
84
- }, ownerState.variant === 'contained' && {
85
- boxShadow: 'none'
86
- }),
87
- [`& .${buttonGroupClasses.firstButton},& .${buttonGroupClasses.middleButton}`]: _extends({}, ownerState.orientation === 'horizontal' && {
88
- borderTopRightRadius: 0,
89
- borderBottomRightRadius: 0
90
- }, ownerState.orientation === 'vertical' && {
91
- borderBottomRightRadius: 0,
92
- borderBottomLeftRadius: 0
93
- }, ownerState.variant === 'text' && ownerState.orientation === 'horizontal' && {
94
- borderRight: theme.vars ? `1px solid rgba(${theme.vars.palette.common.onBackgroundChannel} / 0.23)` : `1px solid ${theme.palette.mode === 'light' ? 'rgba(0, 0, 0, 0.23)' : 'rgba(255, 255, 255, 0.23)'}`,
95
- [`&.${buttonGroupClasses.disabled}`]: {
96
- borderRight: `1px solid ${(theme.vars || theme).palette.action.disabled}`
97
82
  }
98
- }, ownerState.variant === 'text' && ownerState.orientation === 'vertical' && {
99
- borderBottom: theme.vars ? `1px solid rgba(${theme.vars.palette.common.onBackgroundChannel} / 0.23)` : `1px solid ${theme.palette.mode === 'light' ? 'rgba(0, 0, 0, 0.23)' : 'rgba(255, 255, 255, 0.23)'}`,
100
- [`&.${buttonGroupClasses.disabled}`]: {
101
- borderBottom: `1px solid ${(theme.vars || theme).palette.action.disabled}`
83
+ }, {
84
+ props: {
85
+ fullWidth: true
86
+ },
87
+ style: {
88
+ width: '100%'
89
+ }
90
+ }, {
91
+ props: {
92
+ orientation: 'vertical'
93
+ },
94
+ style: {
95
+ flexDirection: 'column',
96
+ [`& .${buttonGroupClasses.lastButton},& .${buttonGroupClasses.middleButton}`]: {
97
+ borderTopRightRadius: 0,
98
+ borderTopLeftRadius: 0
99
+ },
100
+ [`& .${buttonGroupClasses.firstButton},& .${buttonGroupClasses.middleButton}`]: {
101
+ borderBottomRightRadius: 0,
102
+ borderBottomLeftRadius: 0
103
+ }
102
104
  }
103
- }, ownerState.variant === 'text' && ownerState.color !== 'inherit' && {
104
- borderColor: theme.vars ? `rgba(${theme.vars.palette[ownerState.color].mainChannel} / 0.5)` : alpha(theme.palette[ownerState.color].main, 0.5)
105
- }, ownerState.variant === 'outlined' && ownerState.orientation === 'horizontal' && {
106
- borderRightColor: 'transparent'
107
- }, ownerState.variant === 'outlined' && ownerState.orientation === 'vertical' && {
108
- borderBottomColor: 'transparent'
109
- }, ownerState.variant === 'contained' && ownerState.orientation === 'horizontal' && {
110
- borderRight: `1px solid ${(theme.vars || theme).palette.grey[400]}`,
111
- [`&.${buttonGroupClasses.disabled}`]: {
112
- borderRight: `1px solid ${(theme.vars || theme).palette.action.disabled}`
105
+ }, {
106
+ props: {
107
+ orientation: 'horizontal'
108
+ },
109
+ style: {
110
+ [`& .${buttonGroupClasses.firstButton},& .${buttonGroupClasses.middleButton}`]: {
111
+ borderTopRightRadius: 0,
112
+ borderBottomRightRadius: 0
113
+ },
114
+ [`& .${buttonGroupClasses.lastButton},& .${buttonGroupClasses.middleButton}`]: {
115
+ borderTopLeftRadius: 0,
116
+ borderBottomLeftRadius: 0
117
+ }
113
118
  }
114
- }, ownerState.variant === 'contained' && ownerState.orientation === 'vertical' && {
115
- borderBottom: `1px solid ${(theme.vars || theme).palette.grey[400]}`,
116
- [`&.${buttonGroupClasses.disabled}`]: {
117
- borderBottom: `1px solid ${(theme.vars || theme).palette.action.disabled}`
119
+ }, {
120
+ props: {
121
+ variant: 'text',
122
+ orientation: 'horizontal'
123
+ },
124
+ style: {
125
+ [`& .${buttonGroupClasses.firstButton},& .${buttonGroupClasses.middleButton}`]: {
126
+ borderRight: theme.vars ? `1px solid rgba(${theme.vars.palette.common.onBackgroundChannel} / 0.23)` : `1px solid ${theme.palette.mode === 'light' ? 'rgba(0, 0, 0, 0.23)' : 'rgba(255, 255, 255, 0.23)'}`,
127
+ [`&.${buttonGroupClasses.disabled}`]: {
128
+ borderRight: `1px solid ${(theme.vars || theme).palette.action.disabled}`
129
+ }
130
+ }
118
131
  }
119
- }, ownerState.variant === 'contained' && ownerState.color !== 'inherit' && {
120
- borderColor: (theme.vars || theme).palette[ownerState.color].dark
121
132
  }, {
122
- '&:hover': _extends({}, ownerState.variant === 'outlined' && ownerState.orientation === 'horizontal' && {
123
- borderRightColor: 'currentColor'
124
- }, ownerState.variant === 'outlined' && ownerState.orientation === 'vertical' && {
125
- borderBottomColor: 'currentColor'
126
- })
127
- }),
128
- [`& .${buttonGroupClasses.lastButton},& .${buttonGroupClasses.middleButton}`]: _extends({}, ownerState.orientation === 'horizontal' && {
129
- borderTopLeftRadius: 0,
130
- borderBottomLeftRadius: 0
131
- }, ownerState.orientation === 'vertical' && {
132
- borderTopRightRadius: 0,
133
- borderTopLeftRadius: 0
134
- }, ownerState.variant === 'outlined' && ownerState.orientation === 'horizontal' && {
135
- marginLeft: -1
136
- }, ownerState.variant === 'outlined' && ownerState.orientation === 'vertical' && {
137
- marginTop: -1
138
- })
133
+ props: {
134
+ variant: 'text',
135
+ orientation: 'vertical'
136
+ },
137
+ style: {
138
+ [`& .${buttonGroupClasses.firstButton},& .${buttonGroupClasses.middleButton}`]: {
139
+ borderBottom: theme.vars ? `1px solid rgba(${theme.vars.palette.common.onBackgroundChannel} / 0.23)` : `1px solid ${theme.palette.mode === 'light' ? 'rgba(0, 0, 0, 0.23)' : 'rgba(255, 255, 255, 0.23)'}`,
140
+ [`&.${buttonGroupClasses.disabled}`]: {
141
+ borderBottom: `1px solid ${(theme.vars || theme).palette.action.disabled}`
142
+ }
143
+ }
144
+ }
145
+ }, ...Object.entries(theme.palette).filter(([, value]) => value.main).flatMap(([color]) => [{
146
+ props: {
147
+ variant: 'text',
148
+ color
149
+ },
150
+ style: {
151
+ [`& .${buttonGroupClasses.firstButton},& .${buttonGroupClasses.middleButton}`]: {
152
+ borderColor: theme.vars ? `rgba(${theme.vars.palette[color].mainChannel} / 0.5)` : alpha(theme.palette[color].main, 0.5)
153
+ }
154
+ }
155
+ }]), {
156
+ props: {
157
+ variant: 'outlined',
158
+ orientation: 'horizontal'
159
+ },
160
+ style: {
161
+ [`& .${buttonGroupClasses.firstButton},& .${buttonGroupClasses.middleButton}`]: {
162
+ borderRightColor: 'transparent',
163
+ '&:hover': {
164
+ borderRightColor: 'currentColor'
165
+ }
166
+ },
167
+ [`& .${buttonGroupClasses.lastButton},& .${buttonGroupClasses.middleButton}`]: {
168
+ marginLeft: -1
169
+ }
170
+ }
171
+ }, {
172
+ props: {
173
+ variant: 'outlined',
174
+ orientation: 'vertical'
175
+ },
176
+ style: {
177
+ [`& .${buttonGroupClasses.firstButton},& .${buttonGroupClasses.middleButton}`]: {
178
+ borderBottomColor: 'transparent',
179
+ '&:hover': {
180
+ borderBottomColor: 'currentColor'
181
+ }
182
+ },
183
+ [`& .${buttonGroupClasses.lastButton},& .${buttonGroupClasses.middleButton}`]: {
184
+ marginTop: -1
185
+ }
186
+ }
187
+ }, {
188
+ props: {
189
+ variant: 'contained',
190
+ orientation: 'horizontal'
191
+ },
192
+ style: {
193
+ [`& .${buttonGroupClasses.firstButton},& .${buttonGroupClasses.middleButton}`]: {
194
+ borderRight: `1px solid ${(theme.vars || theme).palette.grey[400]}`,
195
+ [`&.${buttonGroupClasses.disabled}`]: {
196
+ borderRight: `1px solid ${(theme.vars || theme).palette.action.disabled}`
197
+ }
198
+ }
199
+ }
200
+ }, {
201
+ props: {
202
+ variant: 'contained',
203
+ orientation: 'vertical'
204
+ },
205
+ style: {
206
+ [`& .${buttonGroupClasses.firstButton},& .${buttonGroupClasses.middleButton}`]: {
207
+ borderBottom: `1px solid ${(theme.vars || theme).palette.grey[400]}`,
208
+ [`&.${buttonGroupClasses.disabled}`]: {
209
+ borderBottom: `1px solid ${(theme.vars || theme).palette.action.disabled}`
210
+ }
211
+ }
212
+ }
213
+ }, ...Object.entries(theme.palette).filter(([, value]) => value.dark).map(([color]) => ({
214
+ props: {
215
+ variant: 'contained',
216
+ color
217
+ },
218
+ style: {
219
+ [`& .${buttonGroupClasses.firstButton},& .${buttonGroupClasses.middleButton}`]: {
220
+ borderColor: (theme.vars || theme).palette[color].dark
221
+ }
222
+ }
223
+ }))],
224
+ [`& .${buttonGroupClasses.grouped}`]: {
225
+ minWidth: 40,
226
+ boxShadow: 'none',
227
+ props: {
228
+ variant: 'contained'
229
+ },
230
+ style: {
231
+ '&:hover': {
232
+ boxShadow: 'none'
233
+ }
234
+ }
235
+ }
139
236
  }));
140
237
  const ButtonGroup = /*#__PURE__*/React.forwardRef(function ButtonGroup(inProps, ref) {
141
238
  const props = useThemeProps({
@@ -28,6 +28,9 @@ import gridClasses, { getGridUtilityClass } from './gridClasses';
28
28
  import { jsx as _jsx } from "react/jsx-runtime";
29
29
  function getOffset(val) {
30
30
  const parse = parseFloat(val);
31
+ if (Number.isNaN(parse)) {
32
+ return val;
33
+ }
31
34
  return `${parse}${String(val).replace(String(parse), '') || 'px'}`;
32
35
  }
33
36
  export function generateGrid({
@@ -2,21 +2,36 @@
2
2
 
3
3
  import _extends from "@babel/runtime/helpers/esm/extends";
4
4
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
5
- const _excluded = ["actions", "children", "defaultValue", "name", "onChange", "value"];
5
+ const _excluded = ["actions", "children", "className", "defaultValue", "name", "onChange", "value"];
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
+ const useUtilityClasses = props => {
18
+ const {
19
+ classes,
20
+ row,
21
+ error
22
+ } = props;
23
+ const slots = {
24
+ root: ['root', row && 'row', error && 'error']
25
+ };
26
+ return composeClasses(slots, getRadioGroupUtilityClass, classes);
27
+ };
14
28
  const RadioGroup = /*#__PURE__*/React.forwardRef(function RadioGroup(props, ref) {
15
29
  const {
16
30
  // private
17
31
  // eslint-disable-next-line react/prop-types
18
32
  actions,
19
33
  children,
34
+ className,
20
35
  defaultValue,
21
36
  name: nameProp,
22
37
  onChange,
@@ -24,6 +39,7 @@ const RadioGroup = /*#__PURE__*/React.forwardRef(function RadioGroup(props, ref)
24
39
  } = props,
25
40
  other = _objectWithoutPropertiesLoose(props, _excluded);
26
41
  const rootRef = React.useRef(null);
42
+ const classes = useUtilityClasses(props);
27
43
  const [value, setValueState] = useControlled({
28
44
  controlled: valueProp,
29
45
  default: defaultValue,
@@ -56,7 +72,8 @@ const RadioGroup = /*#__PURE__*/React.forwardRef(function RadioGroup(props, ref)
56
72
  value: contextValue,
57
73
  children: /*#__PURE__*/_jsx(FormGroup, _extends({
58
74
  role: "radiogroup",
59
- ref: handleRef
75
+ ref: handleRef,
76
+ className: clsx(classes.root, className)
60
77
  }, other, {
61
78
  children: children
62
79
  }))
@@ -71,6 +88,10 @@ process.env.NODE_ENV !== "production" ? RadioGroup.propTypes /* remove-proptypes
71
88
  * The content of the component.
72
89
  */
73
90
  children: PropTypes.node,
91
+ /**
92
+ * @ignore
93
+ */
94
+ className: PropTypes.string,
74
95
  /**
75
96
  * The default value. Use when the component is not controlled.
76
97
  */
@@ -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
+ const radioGroupClasses = generateUtilityClasses('MuiRadioGroup', ['root', 'row', 'error']);
7
+ export default radioGroupClasses;
@@ -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',
@@ -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/modern/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
@@ -3,7 +3,9 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWith
3
3
  const _excluded = ["colorSchemes", "cssVarPrefix", "shouldSkipGeneratingVar", "getSelector"],
4
4
  _excluded2 = ["palette"];
5
5
  import deepmerge from '@mui/utils/deepmerge';
6
- import { unstable_createGetCssVar as systemCreateGetCssVar, unstable_prepareCssVars as prepareCssVars } from '@mui/system';
6
+ import { unstable_createGetCssVar as systemCreateGetCssVar, createSpacing } from '@mui/system';
7
+ import { createUnarySpacing } from '@mui/system/spacing';
8
+ import { prepareCssVars } from '@mui/system/cssVars';
7
9
  import styleFunctionSx, { unstable_defaultSxConfig as defaultSxConfig } from '@mui/system/styleFunctionSx';
8
10
  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';
9
11
  import defaultShouldSkipGeneratingVar from './shouldSkipGeneratingVar';
@@ -42,6 +44,21 @@ function setColorChannel(obj, key) {
42
44
  obj[`${key}Channel`] = safeColorChannel(toRgb(obj[key]), `MUI: Can't create \`palette.${key}Channel\` because \`palette.${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.${key}Channel\` as a string (in rgb format, for example "12 12 12") or undefined if you want to remove the channel token.`);
43
45
  }
44
46
  }
47
+ function getSpacingVal(spacingInput) {
48
+ if (typeof spacingInput === 'number') {
49
+ return `${spacingInput}px`;
50
+ }
51
+ if (typeof spacingInput === 'string') {
52
+ return spacingInput;
53
+ }
54
+ if (typeof spacingInput === 'function') {
55
+ return getSpacingVal(spacingInput(1));
56
+ }
57
+ if (Array.isArray(spacingInput)) {
58
+ return spacingInput;
59
+ }
60
+ return '8px';
61
+ }
45
62
  const silent = fn => {
46
63
  try {
47
64
  return fn();
@@ -100,7 +117,8 @@ export default function extendTheme(options = {}, ...args) {
100
117
  }, colorSchemesInput.dark?.opacity),
101
118
  overlays: colorSchemesInput.dark?.overlays || defaultDarkOverlays
102
119
  })
103
- })
120
+ }),
121
+ spacing: getSpacingVal(input.spacing)
104
122
  });
105
123
  Object.keys(theme.colorSchemes).forEach(key => {
106
124
  const palette = theme.colorSchemes[key].palette;
@@ -309,7 +327,11 @@ export default function extendTheme(options = {}, ...args) {
309
327
  });
310
328
  theme.generateThemeVars = generateThemeVars;
311
329
  theme.generateStyleSheets = generateStyleSheets;
330
+ theme.generateSpacing = function generateSpacing() {
331
+ return createSpacing(input.spacing, createUnarySpacing(this));
332
+ };
312
333
  theme.getColorSchemeSelector = colorScheme => `[${theme.attribute}="${colorScheme}"] &`;
334
+ theme.spacing = theme.generateSpacing();
313
335
  theme.shouldSkipGeneratingVar = shouldSkipGeneratingVar;
314
336
  theme.unstable_sxConfig = _extends({}, defaultSxConfig, input?.unstable_sxConfig);
315
337
  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