@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.
- package/AppBar/AppBar.js +118 -68
- package/Badge/Badge.d.ts +2 -4
- package/Badge/Badge.js +2 -4
- package/Button/Button.js +220 -131
- package/ButtonBase/ButtonBase.js +2 -2
- package/ButtonBase/Ripple.js +1 -1
- package/ButtonBase/TouchRipple.js +3 -4
- package/ButtonGroup/ButtonGroup.js +167 -70
- package/CHANGELOG.md +129 -2
- package/Grid/Grid.js +3 -0
- package/RadioGroup/RadioGroup.d.ts +0 -2
- package/RadioGroup/RadioGroup.js +23 -2
- package/RadioGroup/index.d.ts +3 -0
- package/RadioGroup/index.js +3 -1
- package/RadioGroup/radioGroupClasses.d.ts +6 -0
- package/RadioGroup/radioGroupClasses.js +7 -0
- package/Slider/Slider.js +22 -22
- package/Table/Table.d.ts +0 -2
- package/Table/Table.js +0 -2
- package/index.js +1 -1
- package/legacy/AppBar/AppBar.js +124 -64
- package/legacy/Badge/Badge.js +2 -4
- package/legacy/Button/Button.js +218 -123
- package/legacy/ButtonBase/ButtonBase.js +2 -2
- package/legacy/ButtonBase/Ripple.js +1 -1
- package/legacy/ButtonBase/TouchRipple.js +3 -4
- package/legacy/ButtonGroup/ButtonGroup.js +163 -68
- package/legacy/Grid/Grid.js +3 -0
- package/legacy/RadioGroup/RadioGroup.js +21 -2
- package/legacy/RadioGroup/index.js +3 -1
- package/legacy/RadioGroup/radioGroupClasses.js +7 -0
- package/legacy/Slider/Slider.js +24 -24
- package/legacy/Table/Table.js +0 -2
- package/legacy/index.js +1 -1
- package/legacy/styles/experimental_extendTheme.js +24 -2
- package/legacy/zero-styled/index.js +1 -0
- package/modern/AppBar/AppBar.js +118 -68
- package/modern/Badge/Badge.js +2 -4
- package/modern/Button/Button.js +220 -131
- package/modern/ButtonBase/ButtonBase.js +2 -2
- package/modern/ButtonBase/Ripple.js +1 -1
- package/modern/ButtonBase/TouchRipple.js +3 -4
- package/modern/ButtonGroup/ButtonGroup.js +167 -70
- package/modern/Grid/Grid.js +3 -0
- package/modern/RadioGroup/RadioGroup.js +23 -2
- package/modern/RadioGroup/index.js +3 -1
- package/modern/RadioGroup/radioGroupClasses.js +7 -0
- package/modern/Slider/Slider.js +22 -22
- package/modern/Table/Table.js +0 -2
- package/modern/index.js +1 -1
- package/modern/styles/experimental_extendTheme.js +24 -2
- package/modern/zero-styled/index.js +1 -0
- package/node/AppBar/AppBar.js +125 -66
- package/node/Badge/Badge.js +2 -4
- package/node/Button/Button.js +224 -135
- package/node/ButtonBase/ButtonBase.js +4 -4
- package/node/ButtonBase/Ripple.js +1 -1
- package/node/ButtonBase/TouchRipple.js +9 -10
- package/node/ButtonGroup/ButtonGroup.js +169 -72
- package/node/Grid/Grid.js +3 -0
- package/node/RadioGroup/RadioGroup.js +23 -2
- package/node/RadioGroup/index.js +25 -1
- package/node/RadioGroup/radioGroupClasses.js +15 -0
- package/node/Slider/Slider.js +25 -25
- package/node/Table/Table.js +0 -2
- package/node/index.js +1 -1
- package/node/styles/experimental_extendTheme.js +24 -2
- package/node/zero-styled/index.js +7 -0
- package/package.json +7 -7
- package/styles/components.d.ts +5 -0
- package/styles/experimental_extendTheme.d.ts +2 -0
- package/styles/experimental_extendTheme.js +24 -2
- package/styles/overrides.d.ts +2 -0
- package/umd/material-ui.development.js +888 -593
- package/umd/material-ui.production.min.js +4 -4
- package/zero-styled/index.d.ts +1 -0
- package/zero-styled/index.js +1 -0
|
@@ -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,
|
|
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) {
|
package/styles/overrides.d.ts
CHANGED
|
@@ -77,6 +77,7 @@ import { PaginationItemClassKey } from '../PaginationItem';
|
|
|
77
77
|
import { PaperClassKey } from '../Paper';
|
|
78
78
|
import { PopoverClassKey } from '../Popover';
|
|
79
79
|
import { RadioClassKey } from '../Radio';
|
|
80
|
+
import { RadioGroupClassKey } from '../RadioGroup';
|
|
80
81
|
import { RatingClassKey } from '../Rating';
|
|
81
82
|
import { ScopedCssBaselineClassKey } from '../ScopedCssBaseline';
|
|
82
83
|
import { SelectClassKey } from '../Select';
|
|
@@ -222,6 +223,7 @@ export interface ComponentNameToClassKey {
|
|
|
222
223
|
MuiPopover: PopoverClassKey;
|
|
223
224
|
MuiPopper: PopperClassKey;
|
|
224
225
|
MuiRadio: RadioClassKey;
|
|
226
|
+
MuiRadioGroup: RadioGroupClassKey;
|
|
225
227
|
MuiRating: RatingClassKey;
|
|
226
228
|
MuiScopedCssBaseline: ScopedCssBaselineClassKey;
|
|
227
229
|
MuiSelect: SelectClassKey;
|