@mui/material 6.4.5 → 6.4.7
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/Accordion/Accordion.d.ts +14 -12
- package/Alert/Alert.d.ts +3 -15
- package/Backdrop/Backdrop.d.ts +14 -12
- package/CHANGELOG.md +58 -0
- package/CardHeader/CardHeader.d.ts +4 -20
- package/Checkbox/Checkbox.d.ts +45 -9
- package/Checkbox/Checkbox.js +51 -21
- package/Dialog/Dialog.d.ts +4 -4
- package/Drawer/Drawer.d.ts +92 -1
- package/Drawer/Drawer.js +108 -36
- package/InputBase/inputBaseClasses.d.ts +15 -6
- package/Menu/Menu.d.ts +88 -1
- package/Menu/Menu.js +58 -19
- package/Modal/Modal.js +9 -10
- package/Popover/Popover.d.ts +60 -6
- package/Popover/Popover.js +78 -51
- package/Radio/Radio.d.ts +45 -1
- package/Radio/Radio.js +61 -16
- package/Rating/Rating.d.ts +59 -1
- package/Rating/Rating.js +131 -45
- package/Select/SelectInput.js +8 -8
- package/Snackbar/Snackbar.d.ts +79 -2
- package/Snackbar/Snackbar.js +110 -32
- package/SpeedDial/SpeedDial.d.ts +8 -6
- package/SpeedDialAction/SpeedDialAction.d.ts +82 -1
- package/SpeedDialAction/SpeedDialAction.js +108 -30
- package/StepContent/StepContent.d.ts +2 -2
- package/SwipeableDrawer/SwipeableDrawer.d.ts +28 -2
- package/SwipeableDrawer/SwipeableDrawer.js +60 -13
- package/Switch/Switch.js +2 -0
- package/Tabs/Tabs.d.ts +129 -29
- package/Tabs/Tabs.js +120 -52
- package/Tabs/tabsClasses.d.ts +4 -0
- package/Tabs/tabsClasses.js +1 -1
- package/Tooltip/Tooltip.d.ts +20 -12
- package/index.js +1 -1
- package/internal/SwitchBase.d.ts +35 -1
- package/internal/SwitchBase.js +84 -30
- package/modern/Checkbox/Checkbox.js +51 -21
- package/modern/Drawer/Drawer.js +108 -36
- package/modern/Menu/Menu.js +58 -19
- package/modern/Modal/Modal.js +9 -10
- package/modern/Popover/Popover.js +78 -51
- package/modern/Radio/Radio.js +61 -16
- package/modern/Rating/Rating.js +131 -45
- package/modern/Select/SelectInput.js +8 -8
- package/modern/Snackbar/Snackbar.js +110 -32
- package/modern/SpeedDialAction/SpeedDialAction.js +108 -30
- package/modern/SwipeableDrawer/SwipeableDrawer.js +60 -13
- package/modern/Switch/Switch.js +2 -0
- package/modern/Tabs/Tabs.js +120 -52
- package/modern/Tabs/tabsClasses.js +1 -1
- package/modern/index.js +1 -1
- package/modern/internal/SwitchBase.js +84 -30
- package/modern/styles/createThemeNoVars.js +7 -2
- package/modern/version/index.js +2 -2
- package/node/Checkbox/Checkbox.js +51 -21
- package/node/Drawer/Drawer.js +108 -36
- package/node/Menu/Menu.js +58 -19
- package/node/Modal/Modal.js +9 -10
- package/node/Popover/Popover.js +78 -51
- package/node/Radio/Radio.js +61 -16
- package/node/Rating/Rating.js +132 -46
- package/node/Select/SelectInput.js +8 -8
- package/node/Snackbar/Snackbar.js +110 -32
- package/node/SpeedDialAction/SpeedDialAction.js +108 -30
- package/node/SwipeableDrawer/SwipeableDrawer.js +60 -13
- package/node/Switch/Switch.js +2 -0
- package/node/Tabs/Tabs.js +120 -52
- package/node/Tabs/tabsClasses.js +1 -1
- package/node/index.js +1 -1
- package/node/internal/SwitchBase.js +84 -30
- package/node/styles/createThemeNoVars.js +7 -2
- package/node/version/index.js +2 -2
- package/package.json +5 -5
- package/styles/ThemeProvider.d.ts +6 -0
- package/styles/ThemeProviderWithVars.d.ts +1 -0
- package/styles/createThemeNoVars.js +7 -2
- package/styles/index.d.ts +1 -0
- package/version/index.js +2 -2
|
@@ -9,7 +9,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
9
9
|
exports.default = void 0;
|
|
10
10
|
var React = _interopRequireWildcard(require("react"));
|
|
11
11
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
12
|
-
var _clsx = _interopRequireDefault(require("clsx"));
|
|
13
12
|
var _refType = _interopRequireDefault(require("@mui/utils/refType"));
|
|
14
13
|
var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
|
|
15
14
|
var _capitalize = _interopRequireDefault(require("../utils/capitalize"));
|
|
@@ -19,6 +18,7 @@ var _useControlled = _interopRequireDefault(require("../utils/useControlled"));
|
|
|
19
18
|
var _useFormControl = _interopRequireDefault(require("../FormControl/useFormControl"));
|
|
20
19
|
var _ButtonBase = _interopRequireDefault(require("../ButtonBase"));
|
|
21
20
|
var _switchBaseClasses = require("./switchBaseClasses");
|
|
21
|
+
var _useSlot = _interopRequireDefault(require("../utils/useSlot"));
|
|
22
22
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
23
23
|
const useUtilityClasses = ownerState => {
|
|
24
24
|
const {
|
|
@@ -93,7 +93,6 @@ const SwitchBase = /*#__PURE__*/React.forwardRef(function SwitchBase(props, ref)
|
|
|
93
93
|
autoFocus,
|
|
94
94
|
checked: checkedProp,
|
|
95
95
|
checkedIcon,
|
|
96
|
-
className,
|
|
97
96
|
defaultChecked,
|
|
98
97
|
disabled: disabledProp,
|
|
99
98
|
disableFocusRipple = false,
|
|
@@ -111,6 +110,8 @@ const SwitchBase = /*#__PURE__*/React.forwardRef(function SwitchBase(props, ref)
|
|
|
111
110
|
tabIndex,
|
|
112
111
|
type,
|
|
113
112
|
value,
|
|
113
|
+
slots = {},
|
|
114
|
+
slotProps = {},
|
|
114
115
|
...other
|
|
115
116
|
} = props;
|
|
116
117
|
const [checked, setCheckedState] = (0, _useControlled.default)({
|
|
@@ -163,38 +164,75 @@ const SwitchBase = /*#__PURE__*/React.forwardRef(function SwitchBase(props, ref)
|
|
|
163
164
|
edge
|
|
164
165
|
};
|
|
165
166
|
const classes = useUtilityClasses(ownerState);
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
167
|
+
const externalForwardedProps = {
|
|
168
|
+
slots,
|
|
169
|
+
slotProps: {
|
|
170
|
+
input: inputProps,
|
|
171
|
+
...slotProps
|
|
172
|
+
}
|
|
173
|
+
};
|
|
174
|
+
const [RootSlot, rootSlotProps] = (0, _useSlot.default)('root', {
|
|
175
|
+
ref,
|
|
176
|
+
elementType: SwitchBaseRoot,
|
|
177
|
+
className: classes.root,
|
|
178
|
+
shouldForwardComponentProp: true,
|
|
179
|
+
externalForwardedProps: {
|
|
180
|
+
...externalForwardedProps,
|
|
181
|
+
component: 'span',
|
|
182
|
+
...other
|
|
183
|
+
},
|
|
184
|
+
getSlotProps: handlers => ({
|
|
185
|
+
...handlers,
|
|
186
|
+
onFocus: event => {
|
|
187
|
+
handlers.onFocus?.(event);
|
|
188
|
+
handleFocus(event);
|
|
189
|
+
},
|
|
190
|
+
onBlur: event => {
|
|
191
|
+
handlers.onBlur?.(event);
|
|
192
|
+
handleBlur(event);
|
|
193
|
+
}
|
|
194
|
+
}),
|
|
195
|
+
ownerState,
|
|
196
|
+
additionalProps: {
|
|
197
|
+
centerRipple: true,
|
|
198
|
+
focusRipple: !disableFocusRipple,
|
|
199
|
+
disabled,
|
|
200
|
+
role: undefined,
|
|
201
|
+
tabIndex: null
|
|
202
|
+
}
|
|
203
|
+
});
|
|
204
|
+
const [InputSlot, inputSlotProps] = (0, _useSlot.default)('input', {
|
|
205
|
+
ref: inputRef,
|
|
206
|
+
elementType: SwitchBaseInput,
|
|
207
|
+
className: classes.input,
|
|
208
|
+
externalForwardedProps,
|
|
209
|
+
getSlotProps: handlers => ({
|
|
210
|
+
onChange: event => {
|
|
211
|
+
handlers.onChange?.(event);
|
|
212
|
+
handleInputChange(event);
|
|
213
|
+
}
|
|
214
|
+
}),
|
|
215
|
+
ownerState,
|
|
216
|
+
additionalProps: {
|
|
217
|
+
autoFocus,
|
|
181
218
|
checked: checkedProp,
|
|
182
|
-
defaultChecked
|
|
183
|
-
|
|
184
|
-
disabled: disabled,
|
|
219
|
+
defaultChecked,
|
|
220
|
+
disabled,
|
|
185
221
|
id: hasLabelFor ? id : undefined,
|
|
186
|
-
name
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
ownerState: ownerState,
|
|
192
|
-
tabIndex: tabIndex,
|
|
193
|
-
type: type,
|
|
222
|
+
name,
|
|
223
|
+
readOnly,
|
|
224
|
+
required,
|
|
225
|
+
tabIndex,
|
|
226
|
+
type,
|
|
194
227
|
...(type === 'checkbox' && value === undefined ? {} : {
|
|
195
228
|
value
|
|
196
|
-
})
|
|
197
|
-
|
|
229
|
+
})
|
|
230
|
+
}
|
|
231
|
+
});
|
|
232
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(RootSlot, {
|
|
233
|
+
...rootSlotProps,
|
|
234
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(InputSlot, {
|
|
235
|
+
...inputSlotProps
|
|
198
236
|
}), checked ? checkedIcon : icon]
|
|
199
237
|
});
|
|
200
238
|
});
|
|
@@ -287,6 +325,22 @@ process.env.NODE_ENV !== "production" ? SwitchBase.propTypes = {
|
|
|
287
325
|
* If `true`, the `input` element is required.
|
|
288
326
|
*/
|
|
289
327
|
required: _propTypes.default.bool,
|
|
328
|
+
/**
|
|
329
|
+
* The props used for each slot inside.
|
|
330
|
+
* @default {}
|
|
331
|
+
*/
|
|
332
|
+
slotProps: _propTypes.default.shape({
|
|
333
|
+
input: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object]),
|
|
334
|
+
root: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object])
|
|
335
|
+
}),
|
|
336
|
+
/**
|
|
337
|
+
* The components used for each slot inside.
|
|
338
|
+
* @default {}
|
|
339
|
+
*/
|
|
340
|
+
slots: _propTypes.default.shape({
|
|
341
|
+
input: _propTypes.default.elementType,
|
|
342
|
+
root: _propTypes.default.elementType
|
|
343
|
+
}),
|
|
290
344
|
/**
|
|
291
345
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
292
346
|
*/
|
|
@@ -30,8 +30,13 @@ function createThemeNoVars(options = {}, ...args) {
|
|
|
30
30
|
shape: shapeInput,
|
|
31
31
|
...other
|
|
32
32
|
} = options;
|
|
33
|
-
if (options.vars
|
|
34
|
-
|
|
33
|
+
if (options.vars &&
|
|
34
|
+
// The error should throw only for the root theme creation because user is not allowed to use a custom node `vars`.
|
|
35
|
+
// `generateThemeVars` is the closest identifier for checking that the `options` is a result of `createTheme` with CSS variables so that user can create new theme for nested ThemeProvider.
|
|
36
|
+
options.generateThemeVars === undefined) {
|
|
37
|
+
throw new Error(process.env.NODE_ENV !== "production" ? 'MUI: `vars` is a private field used for CSS variables support.\n' +
|
|
38
|
+
// #host-reference
|
|
39
|
+
'Please use another name or follow the [docs](https://mui.com/material-ui/customization/css-theme-variables/usage/) to enable the feature.' : (0, _formatMuiErrorMessage2.default)(20));
|
|
35
40
|
}
|
|
36
41
|
const palette = (0, _createPalette.default)(paletteInput);
|
|
37
42
|
const systemTheme = (0, _createTheme.default)(options);
|
package/node/version/index.js
CHANGED
|
@@ -4,9 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.version = exports.prerelease = exports.patch = exports.minor = exports.major = exports.default = void 0;
|
|
7
|
-
const version = exports.version = "6.4.
|
|
7
|
+
const version = exports.version = "6.4.7";
|
|
8
8
|
const major = exports.major = Number("6");
|
|
9
9
|
const minor = exports.minor = Number("4");
|
|
10
|
-
const patch = exports.patch = Number("
|
|
10
|
+
const patch = exports.patch = Number("7");
|
|
11
11
|
const prerelease = exports.prerelease = undefined;
|
|
12
12
|
var _default = exports.default = version;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/material",
|
|
3
|
-
"version": "6.4.
|
|
3
|
+
"version": "6.4.7",
|
|
4
4
|
"private": false,
|
|
5
5
|
"author": "MUI Team",
|
|
6
6
|
"description": "Material UI is an open-source React component library that implements Google's Material Design. It's comprehensive and can be used in production out of the box.",
|
|
@@ -35,10 +35,10 @@
|
|
|
35
35
|
"prop-types": "^15.8.1",
|
|
36
36
|
"react-is": "^19.0.0",
|
|
37
37
|
"react-transition-group": "^4.4.5",
|
|
38
|
-
"@mui/
|
|
39
|
-
"@mui/system": "^6.4.
|
|
38
|
+
"@mui/utils": "^6.4.6",
|
|
39
|
+
"@mui/system": "^6.4.7",
|
|
40
40
|
"@mui/types": "^7.2.21",
|
|
41
|
-
"@mui/
|
|
41
|
+
"@mui/core-downloads-tracker": "^6.4.7"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
44
|
"@emotion/react": "^11.5.0",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"@types/react": "^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
47
47
|
"react": "^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
48
48
|
"react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
49
|
-
"@mui/material-pigment-css": "^6.4.
|
|
49
|
+
"@mui/material-pigment-css": "^6.4.7"
|
|
50
50
|
},
|
|
51
51
|
"peerDependenciesMeta": {
|
|
52
52
|
"@types/react": {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { DefaultTheme } from '@mui/system';
|
|
3
|
+
import { StorageManager } from '@mui/system/cssVars';
|
|
3
4
|
import { CssThemeVariables } from './createThemeNoVars';
|
|
4
5
|
type ThemeProviderCssVariablesProps = CssThemeVariables extends {
|
|
5
6
|
enabled: true;
|
|
@@ -40,6 +41,11 @@ export interface ThemeProviderProps<Theme = DefaultTheme> extends ThemeProviderC
|
|
|
40
41
|
* @default window
|
|
41
42
|
*/
|
|
42
43
|
storageWindow?: Window | null;
|
|
44
|
+
/**
|
|
45
|
+
* The storage manager to be used for storing the mode and color scheme
|
|
46
|
+
* @default using `window.localStorage`
|
|
47
|
+
*/
|
|
48
|
+
storageManager?: StorageManager | null;
|
|
43
49
|
/**
|
|
44
50
|
* localStorage key used to store application `mode`
|
|
45
51
|
* @default 'mui-mode'
|
|
@@ -43,6 +43,7 @@ export declare const CssVarsProvider: (props: React.PropsWithChildren<Partial<im
|
|
|
43
43
|
defaultMode?: "light" | "dark" | "system";
|
|
44
44
|
documentNode?: Document | null;
|
|
45
45
|
colorSchemeNode?: Element | null;
|
|
46
|
+
storageManager?: import("@mui/system").StorageManager | null;
|
|
46
47
|
storageWindow?: Window | null;
|
|
47
48
|
disableNestedContext?: boolean;
|
|
48
49
|
disableStyleSheetGeneration?: boolean;
|
|
@@ -21,8 +21,13 @@ function createThemeNoVars(options = {}, ...args) {
|
|
|
21
21
|
shape: shapeInput,
|
|
22
22
|
...other
|
|
23
23
|
} = options;
|
|
24
|
-
if (options.vars
|
|
25
|
-
|
|
24
|
+
if (options.vars &&
|
|
25
|
+
// The error should throw only for the root theme creation because user is not allowed to use a custom node `vars`.
|
|
26
|
+
// `generateThemeVars` is the closest identifier for checking that the `options` is a result of `createTheme` with CSS variables so that user can create new theme for nested ThemeProvider.
|
|
27
|
+
options.generateThemeVars === undefined) {
|
|
28
|
+
throw new Error(process.env.NODE_ENV !== "production" ? 'MUI: `vars` is a private field used for CSS variables support.\n' +
|
|
29
|
+
// #host-reference
|
|
30
|
+
'Please use another name or follow the [docs](https://mui.com/material-ui/customization/css-theme-variables/usage/) to enable the feature.' : _formatMuiErrorMessage(20));
|
|
26
31
|
}
|
|
27
32
|
const palette = createPalette(paletteInput);
|
|
28
33
|
const systemTheme = systemCreateTheme(options);
|
package/styles/index.d.ts
CHANGED
|
@@ -103,6 +103,7 @@ export { default as withStyles } from './withStyles';
|
|
|
103
103
|
export { default as withTheme } from './withTheme';
|
|
104
104
|
|
|
105
105
|
export * from './ThemeProviderWithVars';
|
|
106
|
+
export type { StorageManager } from '@mui/system/cssVars';
|
|
106
107
|
|
|
107
108
|
export { default as extendTheme } from './createThemeWithVars';
|
|
108
109
|
|
package/version/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export const version = "6.4.
|
|
1
|
+
export const version = "6.4.7";
|
|
2
2
|
export const major = Number("6");
|
|
3
3
|
export const minor = Number("4");
|
|
4
|
-
export const patch = Number("
|
|
4
|
+
export const patch = Number("7");
|
|
5
5
|
export const prerelease = undefined;
|
|
6
6
|
export default version;
|