@mui/material 5.8.1 → 5.8.4
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/Alert/Alert.js +3 -1
- package/Autocomplete/autocompleteClasses.d.ts +1 -1
- package/Button/buttonClasses.d.ts +24 -0
- package/Button/buttonClasses.js +1 -1
- package/CHANGELOG.md +217 -8
- package/Checkbox/Checkbox.js +4 -4
- package/Grid/Grid.d.ts +73 -52
- package/Grid/Grid.js +94 -40
- package/Grow/Grow.js +4 -4
- package/Hidden/withWidth.js +0 -2
- package/InputLabel/InputLabel.d.ts +5 -0
- package/InputLabel/InputLabel.js +6 -0
- package/Link/Link.js +10 -17
- package/Link/getTextDecoration.d.ts +15 -0
- package/Link/getTextDecoration.js +29 -0
- package/Popover/Popover.d.ts +7 -0
- package/Popover/index.js +1 -0
- package/README.md +13 -12
- package/Slider/Slider.d.ts +3 -1
- package/Slider/Slider.js +23 -8
- package/Snackbar/Snackbar.js +6 -20
- package/Stack/Stack.js +1 -1
- package/StepIcon/StepIcon.js +2 -1
- package/Tab/Tab.d.ts +0 -1
- package/Tabs/Tabs.js +16 -0
- package/index.js +1 -1
- package/legacy/Alert/Alert.js +3 -1
- package/legacy/Button/buttonClasses.js +1 -1
- package/legacy/Checkbox/Checkbox.js +4 -4
- package/legacy/Grid/Grid.js +97 -48
- package/legacy/Grow/Grow.js +4 -4
- package/legacy/Hidden/withWidth.js +0 -2
- package/legacy/InputLabel/InputLabel.js +6 -0
- package/legacy/Link/Link.js +10 -17
- package/legacy/Link/getTextDecoration.js +28 -0
- package/legacy/Popover/index.js +1 -0
- package/legacy/Slider/Slider.js +23 -8
- package/legacy/Snackbar/Snackbar.js +6 -21
- package/legacy/Stack/Stack.js +2 -1
- package/legacy/StepIcon/StepIcon.js +2 -1
- package/legacy/Tabs/Tabs.js +16 -0
- package/legacy/index.js +1 -1
- package/legacy/styles/CssVarsProvider.js +3 -0
- package/modern/Alert/Alert.js +3 -1
- package/modern/Button/buttonClasses.js +1 -1
- package/modern/Checkbox/Checkbox.js +4 -4
- package/modern/Grid/Grid.js +94 -40
- package/modern/Grow/Grow.js +4 -4
- package/modern/Hidden/withWidth.js +0 -2
- package/modern/InputLabel/InputLabel.js +6 -0
- package/modern/Link/Link.js +10 -17
- package/modern/Link/getTextDecoration.js +29 -0
- package/modern/Popover/index.js +1 -0
- package/modern/Slider/Slider.js +23 -8
- package/modern/Snackbar/Snackbar.js +6 -20
- package/modern/Stack/Stack.js +1 -1
- package/modern/StepIcon/StepIcon.js +2 -1
- package/modern/Tabs/Tabs.js +16 -0
- package/modern/index.js +1 -1
- package/modern/styles/CssVarsProvider.js +3 -0
- package/node/Alert/Alert.js +3 -1
- package/node/Button/buttonClasses.js +1 -1
- package/node/Checkbox/Checkbox.js +4 -4
- package/node/Grid/Grid.js +95 -40
- package/node/Grow/Grow.js +4 -4
- package/node/Hidden/withWidth.js +0 -3
- package/node/InputLabel/InputLabel.js +6 -0
- package/node/Link/Link.js +12 -20
- package/node/Link/getTextDecoration.js +39 -0
- package/node/Popover/index.js +13 -3
- package/node/Slider/Slider.js +23 -8
- package/node/Snackbar/Snackbar.js +6 -18
- package/node/Stack/Stack.js +1 -1
- package/node/StepIcon/StepIcon.js +2 -1
- package/node/Tabs/Tabs.js +16 -0
- package/node/index.js +1 -1
- package/node/styles/CssVarsProvider.js +3 -0
- package/package.json +6 -7
- package/styles/CssVarsProvider.js +3 -0
- package/umd/material-ui.development.js +291 -227
- package/umd/material-ui.production.min.js +21 -21
|
@@ -72,10 +72,10 @@ const CheckboxRoot = (0, _styled.default)(_SwitchBase.default, {
|
|
|
72
72
|
theme,
|
|
73
73
|
ownerState
|
|
74
74
|
}) => (0, _extends2.default)({
|
|
75
|
-
color: theme.palette.text.secondary
|
|
75
|
+
color: (theme.vars || theme).palette.text.secondary
|
|
76
76
|
}, !ownerState.disableRipple && {
|
|
77
77
|
'&:hover': {
|
|
78
|
-
backgroundColor: (0, _system.alpha)(ownerState.color === 'default' ? theme.palette.action.active : theme.palette[ownerState.color].main, theme.palette.action.hoverOpacity),
|
|
78
|
+
backgroundColor: theme.vars ? `rgba(${ownerState.color === 'default' ? theme.vars.palette.action.activeChannel : theme.vars.palette.primary.mainChannel} / ${theme.vars.palette.action.hoverOpacity})` : (0, _system.alpha)(ownerState.color === 'default' ? theme.palette.action.active : theme.palette[ownerState.color].main, theme.palette.action.hoverOpacity),
|
|
79
79
|
// Reset on touch devices, it doesn't add specificity
|
|
80
80
|
'@media (hover: none)': {
|
|
81
81
|
backgroundColor: 'transparent'
|
|
@@ -83,10 +83,10 @@ const CheckboxRoot = (0, _styled.default)(_SwitchBase.default, {
|
|
|
83
83
|
}
|
|
84
84
|
}, ownerState.color !== 'default' && {
|
|
85
85
|
[`&.${_checkboxClasses.default.checked}, &.${_checkboxClasses.default.indeterminate}`]: {
|
|
86
|
-
color: theme.palette[ownerState.color].main
|
|
86
|
+
color: (theme.vars || theme).palette[ownerState.color].main
|
|
87
87
|
},
|
|
88
88
|
[`&.${_checkboxClasses.default.disabled}`]: {
|
|
89
|
-
color: theme.palette.action.disabled
|
|
89
|
+
color: (theme.vars || theme).palette.action.disabled
|
|
90
90
|
}
|
|
91
91
|
}));
|
|
92
92
|
const defaultCheckedIcon = /*#__PURE__*/(0, _jsxRuntime.jsx)(_CheckBox.default, {});
|
package/node/Grid/Grid.js
CHANGED
|
@@ -11,6 +11,7 @@ exports.generateDirection = generateDirection;
|
|
|
11
11
|
exports.generateGrid = generateGrid;
|
|
12
12
|
exports.generateRowGap = generateRowGap;
|
|
13
13
|
exports.resolveSpacingClasses = resolveSpacingClasses;
|
|
14
|
+
exports.resolveSpacingStyles = resolveSpacingStyles;
|
|
14
15
|
|
|
15
16
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
16
17
|
|
|
@@ -32,13 +33,15 @@ var _styled = _interopRequireDefault(require("../styles/styled"));
|
|
|
32
33
|
|
|
33
34
|
var _useThemeProps = _interopRequireDefault(require("../styles/useThemeProps"));
|
|
34
35
|
|
|
36
|
+
var _useTheme = _interopRequireDefault(require("../styles/useTheme"));
|
|
37
|
+
|
|
35
38
|
var _GridContext = _interopRequireDefault(require("./GridContext"));
|
|
36
39
|
|
|
37
40
|
var _gridClasses = _interopRequireWildcard(require("./gridClasses"));
|
|
38
41
|
|
|
39
42
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
40
43
|
|
|
41
|
-
const _excluded = ["className", "columns", "columnSpacing", "component", "container", "direction", "item", "
|
|
44
|
+
const _excluded = ["className", "columns", "columnSpacing", "component", "container", "direction", "item", "rowSpacing", "spacing", "wrap", "zeroMinWidth"];
|
|
42
45
|
|
|
43
46
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
44
47
|
|
|
@@ -226,26 +229,27 @@ function generateColumnGap({
|
|
|
226
229
|
return styles;
|
|
227
230
|
}
|
|
228
231
|
|
|
229
|
-
function
|
|
230
|
-
//
|
|
231
|
-
if (!
|
|
232
|
+
function resolveSpacingStyles(spacing, breakpoints, styles = {}) {
|
|
233
|
+
// undefined/null or `spacing` <= 0
|
|
234
|
+
if (!spacing || spacing <= 0) {
|
|
232
235
|
return [];
|
|
233
236
|
} // in case of string/number `spacing`
|
|
234
237
|
|
|
235
238
|
|
|
236
239
|
if (typeof spacing === 'string' && !Number.isNaN(Number(spacing)) || typeof spacing === 'number') {
|
|
237
|
-
return [styles[`spacing-xs-${String(spacing)}`]
|
|
240
|
+
return [styles[`spacing-xs-${String(spacing)}`]];
|
|
238
241
|
} // in case of object `spacing`
|
|
239
242
|
|
|
240
243
|
|
|
241
|
-
const
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
244
|
+
const spacingStyles = [];
|
|
245
|
+
breakpoints.forEach(breakpoint => {
|
|
246
|
+
const value = spacing[breakpoint];
|
|
247
|
+
|
|
248
|
+
if (Number(value) > 0) {
|
|
249
|
+
spacingStyles.push(styles[`spacing-${breakpoint}-${String(value)}`]);
|
|
250
|
+
}
|
|
251
|
+
});
|
|
252
|
+
return spacingStyles;
|
|
249
253
|
} // Default CSS values
|
|
250
254
|
// flex: '0 1 auto',
|
|
251
255
|
// flexDirection: 'row',
|
|
@@ -258,20 +262,33 @@ const GridRoot = (0, _styled.default)('div', {
|
|
|
258
262
|
name: 'MuiGrid',
|
|
259
263
|
slot: 'Root',
|
|
260
264
|
overridesResolver: (props, styles) => {
|
|
265
|
+
const {
|
|
266
|
+
ownerState
|
|
267
|
+
} = props;
|
|
261
268
|
const {
|
|
262
269
|
container,
|
|
263
270
|
direction,
|
|
264
271
|
item,
|
|
265
|
-
lg,
|
|
266
|
-
md,
|
|
267
|
-
sm,
|
|
268
272
|
spacing,
|
|
269
273
|
wrap,
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
274
|
+
zeroMinWidth,
|
|
275
|
+
breakpoints
|
|
276
|
+
} = ownerState;
|
|
277
|
+
let spacingStyles = []; // in case of grid item
|
|
278
|
+
|
|
279
|
+
if (container) {
|
|
280
|
+
spacingStyles = resolveSpacingStyles(spacing, breakpoints, styles);
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
const breakpointsStyles = [];
|
|
284
|
+
breakpoints.forEach(breakpoint => {
|
|
285
|
+
const value = ownerState[breakpoint];
|
|
286
|
+
|
|
287
|
+
if (value) {
|
|
288
|
+
breakpointsStyles.push(styles[`grid-${breakpoint}-${String(value)}`]);
|
|
289
|
+
}
|
|
290
|
+
});
|
|
291
|
+
return [styles.root, container && styles.container, item && styles.item, zeroMinWidth && styles.zeroMinWidth, ...spacingStyles, direction !== 'row' && styles[`direction-xs-${String(direction)}`], wrap !== 'wrap' && styles[`wrap-xs-${String(wrap)}`], ...breakpointsStyles];
|
|
275
292
|
}
|
|
276
293
|
})(({
|
|
277
294
|
ownerState
|
|
@@ -290,23 +307,57 @@ const GridRoot = (0, _styled.default)('div', {
|
|
|
290
307
|
flexWrap: ownerState.wrap
|
|
291
308
|
}), generateDirection, generateRowGap, generateColumnGap, generateGrid);
|
|
292
309
|
|
|
310
|
+
function resolveSpacingClasses(spacing, breakpoints) {
|
|
311
|
+
// undefined/null or `spacing` <= 0
|
|
312
|
+
if (!spacing || spacing <= 0) {
|
|
313
|
+
return [];
|
|
314
|
+
} // in case of string/number `spacing`
|
|
315
|
+
|
|
316
|
+
|
|
317
|
+
if (typeof spacing === 'string' && !Number.isNaN(Number(spacing)) || typeof spacing === 'number') {
|
|
318
|
+
return [`spacing-xs-${String(spacing)}`];
|
|
319
|
+
} // in case of object `spacing`
|
|
320
|
+
|
|
321
|
+
|
|
322
|
+
const classes = [];
|
|
323
|
+
breakpoints.forEach(breakpoint => {
|
|
324
|
+
const value = spacing[breakpoint];
|
|
325
|
+
|
|
326
|
+
if (Number(value) > 0) {
|
|
327
|
+
const className = `spacing-${breakpoint}-${String(value)}`;
|
|
328
|
+
classes.push(className);
|
|
329
|
+
}
|
|
330
|
+
});
|
|
331
|
+
return classes;
|
|
332
|
+
}
|
|
333
|
+
|
|
293
334
|
const useUtilityClasses = ownerState => {
|
|
294
335
|
const {
|
|
295
336
|
classes,
|
|
296
337
|
container,
|
|
297
338
|
direction,
|
|
298
339
|
item,
|
|
299
|
-
lg,
|
|
300
|
-
md,
|
|
301
|
-
sm,
|
|
302
340
|
spacing,
|
|
303
341
|
wrap,
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
zeroMinWidth
|
|
342
|
+
zeroMinWidth,
|
|
343
|
+
breakpoints
|
|
307
344
|
} = ownerState;
|
|
345
|
+
let spacingClasses = []; // in case of grid item
|
|
346
|
+
|
|
347
|
+
if (container) {
|
|
348
|
+
spacingClasses = resolveSpacingClasses(spacing, breakpoints);
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
const breakpointsClasses = [];
|
|
352
|
+
breakpoints.forEach(breakpoint => {
|
|
353
|
+
const value = ownerState[breakpoint];
|
|
354
|
+
|
|
355
|
+
if (value) {
|
|
356
|
+
breakpointsClasses.push(`grid-${breakpoint}-${String(value)}`);
|
|
357
|
+
}
|
|
358
|
+
});
|
|
308
359
|
const slots = {
|
|
309
|
-
root: ['root', container && 'container', item && 'item', zeroMinWidth && 'zeroMinWidth', ...
|
|
360
|
+
root: ['root', container && 'container', item && 'item', zeroMinWidth && 'zeroMinWidth', ...spacingClasses, direction !== 'row' && `direction-xs-${String(direction)}`, wrap !== 'wrap' && `wrap-xs-${String(wrap)}`, ...breakpointsClasses]
|
|
310
361
|
};
|
|
311
362
|
return (0, _base.unstable_composeClasses)(slots, _gridClasses.getGridUtilityClass, classes);
|
|
312
363
|
};
|
|
@@ -316,6 +367,9 @@ const Grid = /*#__PURE__*/React.forwardRef(function Grid(inProps, ref) {
|
|
|
316
367
|
props: inProps,
|
|
317
368
|
name: 'MuiGrid'
|
|
318
369
|
});
|
|
370
|
+
const {
|
|
371
|
+
breakpoints
|
|
372
|
+
} = (0, _useTheme.default)();
|
|
319
373
|
const props = (0, _system.unstable_extendSxProp)(themeProps);
|
|
320
374
|
const {
|
|
321
375
|
className,
|
|
@@ -325,14 +379,9 @@ const Grid = /*#__PURE__*/React.forwardRef(function Grid(inProps, ref) {
|
|
|
325
379
|
container = false,
|
|
326
380
|
direction = 'row',
|
|
327
381
|
item = false,
|
|
328
|
-
lg = false,
|
|
329
|
-
md = false,
|
|
330
382
|
rowSpacing: rowSpacingProp,
|
|
331
|
-
sm = false,
|
|
332
383
|
spacing = 0,
|
|
333
384
|
wrap = 'wrap',
|
|
334
|
-
xl = false,
|
|
335
|
-
xs = false,
|
|
336
385
|
zeroMinWidth = false
|
|
337
386
|
} = props,
|
|
338
387
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
@@ -341,20 +390,26 @@ const Grid = /*#__PURE__*/React.forwardRef(function Grid(inProps, ref) {
|
|
|
341
390
|
const columnsContext = React.useContext(_GridContext.default); // columns set with default breakpoint unit of 12
|
|
342
391
|
|
|
343
392
|
const columns = container ? columnsProp || 12 : columnsContext;
|
|
393
|
+
const breakpointsValues = {};
|
|
394
|
+
const otherFiltered = (0, _extends2.default)({}, other);
|
|
395
|
+
breakpoints.keys.forEach(breakpoint => {
|
|
396
|
+
if (other[breakpoint] != null) {
|
|
397
|
+
breakpointsValues[breakpoint] = other[breakpoint];
|
|
398
|
+
delete otherFiltered[breakpoint];
|
|
399
|
+
}
|
|
400
|
+
});
|
|
344
401
|
const ownerState = (0, _extends2.default)({}, props, {
|
|
345
402
|
columns,
|
|
346
403
|
container,
|
|
347
404
|
direction,
|
|
348
405
|
item,
|
|
349
|
-
lg,
|
|
350
|
-
md,
|
|
351
|
-
sm,
|
|
352
406
|
rowSpacing,
|
|
353
407
|
columnSpacing,
|
|
354
408
|
wrap,
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
409
|
+
zeroMinWidth,
|
|
410
|
+
spacing
|
|
411
|
+
}, breakpointsValues, {
|
|
412
|
+
breakpoints: breakpoints.keys
|
|
358
413
|
});
|
|
359
414
|
const classes = useUtilityClasses(ownerState);
|
|
360
415
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_GridContext.default.Provider, {
|
|
@@ -364,7 +419,7 @@ const Grid = /*#__PURE__*/React.forwardRef(function Grid(inProps, ref) {
|
|
|
364
419
|
className: (0, _clsx.default)(classes.root, className),
|
|
365
420
|
as: component,
|
|
366
421
|
ref: ref
|
|
367
|
-
},
|
|
422
|
+
}, otherFiltered))
|
|
368
423
|
});
|
|
369
424
|
});
|
|
370
425
|
process.env.NODE_ENV !== "production" ? Grid.propTypes
|
package/node/Grow/Grow.js
CHANGED
|
@@ -47,12 +47,12 @@ const styles = {
|
|
|
47
47
|
transform: 'none'
|
|
48
48
|
}
|
|
49
49
|
};
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
50
|
+
/*
|
|
51
|
+
TODO v6: remove
|
|
52
|
+
Conditionally apply a workaround for the CSS transition bug in Safari 15.4 / WebKit browsers.
|
|
53
53
|
*/
|
|
54
54
|
|
|
55
|
-
const isWebKit154 = typeof navigator !== 'undefined' && /^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent) && /(os |version\/)15(.|_)
|
|
55
|
+
const isWebKit154 = typeof navigator !== 'undefined' && /^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent) && /(os |version\/)15(.|_)4/i.test(navigator.userAgent);
|
|
56
56
|
/**
|
|
57
57
|
* The Grow transition is used by the [Tooltip](/material-ui/react-tooltip/) and
|
|
58
58
|
* [Popover](/material-ui/react-popover/) components.
|
package/node/Hidden/withWidth.js
CHANGED
|
@@ -19,8 +19,6 @@ var _utils = require("@mui/utils");
|
|
|
19
19
|
|
|
20
20
|
var _system = require("@mui/system");
|
|
21
21
|
|
|
22
|
-
var _hoistNonReactStatics = _interopRequireDefault(require("hoist-non-react-statics"));
|
|
23
|
-
|
|
24
22
|
var _useTheme = _interopRequireDefault(require("../styles/useTheme"));
|
|
25
23
|
|
|
26
24
|
var _useEnhancedEffect = _interopRequireDefault(require("../utils/useEnhancedEffect"));
|
|
@@ -141,7 +139,6 @@ const withWidth = (options = {}) => Component => {
|
|
|
141
139
|
WithWidth.displayName = `WithWidth(${(0, _utils.getDisplayName)(Component)})`;
|
|
142
140
|
}
|
|
143
141
|
|
|
144
|
-
(0, _hoistNonReactStatics.default)(WithWidth, Component);
|
|
145
142
|
return WithWidth;
|
|
146
143
|
};
|
|
147
144
|
|
|
@@ -230,6 +230,12 @@ process.env.NODE_ENV !== "production" ? InputLabel.propTypes
|
|
|
230
230
|
*/
|
|
231
231
|
shrink: _propTypes.default.bool,
|
|
232
232
|
|
|
233
|
+
/**
|
|
234
|
+
* The size of the component.
|
|
235
|
+
* @default 'normal'
|
|
236
|
+
*/
|
|
237
|
+
size: _propTypes.default.oneOf(['normal', 'small']),
|
|
238
|
+
|
|
233
239
|
/**
|
|
234
240
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
235
241
|
*/
|
package/node/Link/Link.js
CHANGED
|
@@ -21,8 +21,6 @@ var _utils = require("@mui/utils");
|
|
|
21
21
|
|
|
22
22
|
var _base = require("@mui/base");
|
|
23
23
|
|
|
24
|
-
var _system = require("@mui/system");
|
|
25
|
-
|
|
26
24
|
var _capitalize = _interopRequireDefault(require("../utils/capitalize"));
|
|
27
25
|
|
|
28
26
|
var _styled = _interopRequireDefault(require("../styles/styled"));
|
|
@@ -37,6 +35,8 @@ var _Typography = _interopRequireDefault(require("../Typography"));
|
|
|
37
35
|
|
|
38
36
|
var _linkClasses = _interopRequireWildcard(require("./linkClasses"));
|
|
39
37
|
|
|
38
|
+
var _getTextDecoration = _interopRequireWildcard(require("./getTextDecoration"));
|
|
39
|
+
|
|
40
40
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
41
41
|
|
|
42
42
|
const _excluded = ["className", "color", "component", "onBlur", "onFocus", "TypographyClasses", "underline", "variant", "sx"];
|
|
@@ -45,18 +45,6 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
45
45
|
|
|
46
46
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
47
47
|
|
|
48
|
-
const colorTransformations = {
|
|
49
|
-
primary: 'primary.main',
|
|
50
|
-
textPrimary: 'text.primary',
|
|
51
|
-
secondary: 'secondary.main',
|
|
52
|
-
textSecondary: 'text.secondary',
|
|
53
|
-
error: 'error.main'
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
const transformDeprecatedColors = color => {
|
|
57
|
-
return colorTransformations[color] || color;
|
|
58
|
-
};
|
|
59
|
-
|
|
60
48
|
const useUtilityClasses = ownerState => {
|
|
61
49
|
const {
|
|
62
50
|
classes,
|
|
@@ -83,7 +71,6 @@ const LinkRoot = (0, _styled.default)(_Typography.default, {
|
|
|
83
71
|
theme,
|
|
84
72
|
ownerState
|
|
85
73
|
}) => {
|
|
86
|
-
const color = (0, _system.getPath)(theme, `palette.${transformDeprecatedColors(ownerState.color)}`) || ownerState.color;
|
|
87
74
|
return (0, _extends2.default)({}, ownerState.underline === 'none' && {
|
|
88
75
|
textDecoration: 'none'
|
|
89
76
|
}, ownerState.underline === 'hover' && {
|
|
@@ -91,13 +78,18 @@ const LinkRoot = (0, _styled.default)(_Typography.default, {
|
|
|
91
78
|
'&:hover': {
|
|
92
79
|
textDecoration: 'underline'
|
|
93
80
|
}
|
|
94
|
-
}, ownerState.underline === 'always' && {
|
|
95
|
-
textDecoration: 'underline'
|
|
96
|
-
|
|
81
|
+
}, ownerState.underline === 'always' && (0, _extends2.default)({
|
|
82
|
+
textDecoration: 'underline'
|
|
83
|
+
}, ownerState.color !== 'inherit' && {
|
|
84
|
+
textDecorationColor: (0, _getTextDecoration.default)({
|
|
85
|
+
theme,
|
|
86
|
+
ownerState
|
|
87
|
+
})
|
|
88
|
+
}, {
|
|
97
89
|
'&:hover': {
|
|
98
90
|
textDecorationColor: 'inherit'
|
|
99
91
|
}
|
|
100
|
-
}, ownerState.component === 'button' && {
|
|
92
|
+
}), ownerState.component === 'button' && {
|
|
101
93
|
position: 'relative',
|
|
102
94
|
WebkitTapHighlightColor: 'transparent',
|
|
103
95
|
backgroundColor: 'transparent',
|
|
@@ -194,7 +186,7 @@ const Link = /*#__PURE__*/React.forwardRef(function Link(inProps, ref) {
|
|
|
194
186
|
ref: handlerRef,
|
|
195
187
|
ownerState: ownerState,
|
|
196
188
|
variant: variant,
|
|
197
|
-
sx: [...(!Object.keys(colorTransformations).includes(color) ? [{
|
|
189
|
+
sx: [...(!Object.keys(_getTextDecoration.colorTransformations).includes(color) ? [{
|
|
198
190
|
color
|
|
199
191
|
}] : []), ...(Array.isArray(sx) ? sx : [sx])]
|
|
200
192
|
}, other));
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.colorTransformations = void 0;
|
|
7
|
+
|
|
8
|
+
var _system = require("@mui/system");
|
|
9
|
+
|
|
10
|
+
const colorTransformations = {
|
|
11
|
+
primary: 'primary.main',
|
|
12
|
+
textPrimary: 'text.primary',
|
|
13
|
+
secondary: 'secondary.main',
|
|
14
|
+
textSecondary: 'text.secondary',
|
|
15
|
+
error: 'error.main'
|
|
16
|
+
};
|
|
17
|
+
exports.colorTransformations = colorTransformations;
|
|
18
|
+
|
|
19
|
+
const transformDeprecatedColors = color => {
|
|
20
|
+
return colorTransformations[color] || color;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const getTextDecoration = ({
|
|
24
|
+
theme,
|
|
25
|
+
ownerState
|
|
26
|
+
}) => {
|
|
27
|
+
const transformedColor = transformDeprecatedColors(ownerState.color);
|
|
28
|
+
const color = (0, _system.getPath)(theme, `palette.${transformedColor}`, false) || ownerState.color;
|
|
29
|
+
const channelColor = (0, _system.getPath)(theme, `palette.${transformedColor}Channel`);
|
|
30
|
+
|
|
31
|
+
if ('vars' in theme && channelColor) {
|
|
32
|
+
return `rgba(${channelColor} / 0.4)`;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return (0, _system.alpha)(color, 0.4);
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
var _default = getTextDecoration;
|
|
39
|
+
exports.default = _default;
|
package/node/Popover/index.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
@@ -21,7 +19,19 @@ Object.defineProperty(exports, "popoverClasses", {
|
|
|
21
19
|
}
|
|
22
20
|
});
|
|
23
21
|
|
|
24
|
-
var _Popover =
|
|
22
|
+
var _Popover = _interopRequireWildcard(require("./Popover"));
|
|
23
|
+
|
|
24
|
+
Object.keys(_Popover).forEach(function (key) {
|
|
25
|
+
if (key === "default" || key === "__esModule") return;
|
|
26
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
27
|
+
if (key in exports && exports[key] === _Popover[key]) return;
|
|
28
|
+
Object.defineProperty(exports, key, {
|
|
29
|
+
enumerable: true,
|
|
30
|
+
get: function () {
|
|
31
|
+
return _Popover[key];
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
});
|
|
25
35
|
|
|
26
36
|
var _popoverClasses = _interopRequireWildcard(require("./popoverClasses"));
|
|
27
37
|
|
package/node/Slider/Slider.js
CHANGED
|
@@ -314,7 +314,6 @@ const SliderValueLabel = (0, _styled.default)(_SliderUnstyled.SliderValueLabelUn
|
|
|
314
314
|
transition: theme.transitions.create(['transform'], {
|
|
315
315
|
duration: theme.transitions.duration.shortest
|
|
316
316
|
}),
|
|
317
|
-
top: -10,
|
|
318
317
|
transformOrigin: 'bottom center',
|
|
319
318
|
transform: 'translateY(-100%) scale(0)',
|
|
320
319
|
position: 'absolute',
|
|
@@ -325,20 +324,34 @@ const SliderValueLabel = (0, _styled.default)(_SliderUnstyled.SliderValueLabelUn
|
|
|
325
324
|
alignItems: 'center',
|
|
326
325
|
justifyContent: 'center',
|
|
327
326
|
padding: '0.25rem 0.75rem'
|
|
328
|
-
}, ownerState.
|
|
329
|
-
|
|
330
|
-
padding: '0.25rem 0.5rem'
|
|
331
|
-
}, {
|
|
327
|
+
}, ownerState.orientation === 'horizontal' && {
|
|
328
|
+
top: '-10px',
|
|
332
329
|
'&:before': {
|
|
333
330
|
position: 'absolute',
|
|
334
331
|
content: '""',
|
|
335
332
|
width: 8,
|
|
336
333
|
height: 8,
|
|
334
|
+
transform: 'translate(-50%, 50%) rotate(45deg)',
|
|
335
|
+
backgroundColor: 'inherit',
|
|
337
336
|
bottom: 0,
|
|
338
|
-
left: '50%'
|
|
337
|
+
left: '50%'
|
|
338
|
+
}
|
|
339
|
+
}, ownerState.orientation === 'vertical' && {
|
|
340
|
+
right: '30px',
|
|
341
|
+
top: '25px',
|
|
342
|
+
'&:before': {
|
|
343
|
+
position: 'absolute',
|
|
344
|
+
content: '""',
|
|
345
|
+
width: 8,
|
|
346
|
+
height: 8,
|
|
339
347
|
transform: 'translate(-50%, 50%) rotate(45deg)',
|
|
340
|
-
backgroundColor: 'inherit'
|
|
348
|
+
backgroundColor: 'inherit',
|
|
349
|
+
right: '-20%',
|
|
350
|
+
top: '25%'
|
|
341
351
|
}
|
|
352
|
+
}, ownerState.size === 'small' && {
|
|
353
|
+
fontSize: theme.typography.pxToRem(12),
|
|
354
|
+
padding: '0.25rem 0.5rem'
|
|
342
355
|
}));
|
|
343
356
|
exports.SliderValueLabel = SliderValueLabel;
|
|
344
357
|
process.env.NODE_ENV !== "production" ? SliderValueLabel.propTypes
|
|
@@ -601,12 +614,14 @@ process.env.NODE_ENV !== "production" ? Slider.propTypes
|
|
|
601
614
|
thumb: _propTypes.default.object,
|
|
602
615
|
track: _propTypes.default.object,
|
|
603
616
|
valueLabel: _propTypes.default.shape({
|
|
617
|
+
children: _propTypes.default.element,
|
|
604
618
|
className: _propTypes.default.string,
|
|
605
619
|
components: _propTypes.default.shape({
|
|
606
620
|
Root: _propTypes.default.elementType
|
|
607
621
|
}),
|
|
622
|
+
open: _propTypes.default.bool,
|
|
608
623
|
style: _propTypes.default.object,
|
|
609
|
-
value: _propTypes.default.
|
|
624
|
+
value: _propTypes.default.number,
|
|
610
625
|
valueLabelDisplay: _propTypes.default.oneOf(['auto', 'off', 'on'])
|
|
611
626
|
})
|
|
612
627
|
}),
|
|
@@ -70,15 +70,11 @@ const SnackbarRoot = (0, _styled.default)('div', {
|
|
|
70
70
|
theme,
|
|
71
71
|
ownerState
|
|
72
72
|
}) => {
|
|
73
|
-
const center =
|
|
73
|
+
const center = {
|
|
74
74
|
left: '50%',
|
|
75
75
|
right: 'auto',
|
|
76
76
|
transform: 'translateX(-50%)'
|
|
77
|
-
}
|
|
78
|
-
right: '50%',
|
|
79
|
-
left: 'auto',
|
|
80
|
-
transform: 'translateX(50%)'
|
|
81
|
-
});
|
|
77
|
+
};
|
|
82
78
|
return (0, _extends2.default)({
|
|
83
79
|
zIndex: (theme.vars || theme).zIndex.snackbar,
|
|
84
80
|
position: 'fixed',
|
|
@@ -100,19 +96,13 @@ const SnackbarRoot = (0, _styled.default)('div', {
|
|
|
100
96
|
top: 24
|
|
101
97
|
} : {
|
|
102
98
|
bottom: 24
|
|
103
|
-
}, ownerState.anchorOrigin.horizontal === 'center' && center, ownerState.anchorOrigin.horizontal === 'left' &&
|
|
99
|
+
}, ownerState.anchorOrigin.horizontal === 'center' && center, ownerState.anchorOrigin.horizontal === 'left' && {
|
|
104
100
|
left: 24,
|
|
105
101
|
right: 'auto'
|
|
106
|
-
}, ownerState.
|
|
102
|
+
}, ownerState.anchorOrigin.horizontal === 'right' && {
|
|
107
103
|
right: 24,
|
|
108
104
|
left: 'auto'
|
|
109
|
-
})
|
|
110
|
-
right: 24,
|
|
111
|
-
left: 'auto'
|
|
112
|
-
}, ownerState.isRtl && {
|
|
113
|
-
left: 24,
|
|
114
|
-
right: 'auto'
|
|
115
|
-
}))
|
|
105
|
+
})
|
|
116
106
|
});
|
|
117
107
|
});
|
|
118
108
|
const Snackbar = /*#__PURE__*/React.forwardRef(function Snackbar(inProps, ref) {
|
|
@@ -157,13 +147,11 @@ const Snackbar = /*#__PURE__*/React.forwardRef(function Snackbar(inProps, ref) {
|
|
|
157
147
|
} = props,
|
|
158
148
|
TransitionProps = (0, _objectWithoutPropertiesLoose2.default)(props.TransitionProps, _excluded),
|
|
159
149
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded2);
|
|
160
|
-
const isRtl = theme.direction === 'rtl';
|
|
161
150
|
const ownerState = (0, _extends2.default)({}, props, {
|
|
162
151
|
anchorOrigin: {
|
|
163
152
|
vertical,
|
|
164
153
|
horizontal
|
|
165
|
-
}
|
|
166
|
-
isRtl
|
|
154
|
+
}
|
|
167
155
|
});
|
|
168
156
|
const classes = useUtilityClasses(ownerState);
|
|
169
157
|
const timerAutoHide = React.useRef();
|
package/node/Stack/Stack.js
CHANGED
|
@@ -80,7 +80,7 @@ const style = ({
|
|
|
80
80
|
if (ownerState.spacing) {
|
|
81
81
|
const transformer = (0, _system.createUnarySpacing)(theme);
|
|
82
82
|
const base = Object.keys(theme.breakpoints.values).reduce((acc, breakpoint) => {
|
|
83
|
-
if (ownerState.spacing[breakpoint] != null || ownerState.direction[breakpoint] != null) {
|
|
83
|
+
if (typeof ownerState.spacing === 'object' && ownerState.spacing[breakpoint] != null || typeof ownerState.direction === 'object' && ownerState.direction[breakpoint] != null) {
|
|
84
84
|
acc[breakpoint] = true;
|
|
85
85
|
}
|
|
86
86
|
|
|
@@ -141,8 +141,9 @@ const StepIcon = /*#__PURE__*/React.forwardRef(function StepIcon(inProps, ref) {
|
|
|
141
141
|
})), /*#__PURE__*/(0, _jsxRuntime.jsx)(StepIconText, {
|
|
142
142
|
className: classes.text,
|
|
143
143
|
x: "12",
|
|
144
|
-
y: "
|
|
144
|
+
y: "12",
|
|
145
145
|
textAnchor: "middle",
|
|
146
|
+
dominantBaseline: "central",
|
|
146
147
|
ownerState: ownerState,
|
|
147
148
|
children: icon
|
|
148
149
|
})]
|
package/node/Tabs/Tabs.js
CHANGED
|
@@ -446,10 +446,26 @@ const Tabs = /*#__PURE__*/React.forwardRef(function Tabs(inProps, ref) {
|
|
|
446
446
|
scroll(scrollValue);
|
|
447
447
|
};
|
|
448
448
|
|
|
449
|
+
const getFirstVisibleTab = tabs => {
|
|
450
|
+
const containerSize = tabsRef.current[clientSize];
|
|
451
|
+
const containerStartBound = Math.round(tabsRef.current[scrollStart]);
|
|
452
|
+
const containerEndBound = Math.round(containerStartBound + containerSize);
|
|
453
|
+
const offset = vertical ? 'offsetTop' : 'offsetLeft';
|
|
454
|
+
return tabs.find(tab => {
|
|
455
|
+
const centerPoint = tab[offset] + tab[clientSize] / 2;
|
|
456
|
+
return centerPoint >= containerStartBound && centerPoint <= containerEndBound;
|
|
457
|
+
});
|
|
458
|
+
};
|
|
459
|
+
|
|
449
460
|
const getScrollSize = () => {
|
|
450
461
|
const containerSize = tabsRef.current[clientSize];
|
|
451
462
|
let totalSize = 0;
|
|
452
463
|
const children = Array.from(tabListRef.current.children);
|
|
464
|
+
const firstVisibleTab = getFirstVisibleTab(children);
|
|
465
|
+
|
|
466
|
+
if (firstVisibleTab && firstVisibleTab[clientSize] > containerSize) {
|
|
467
|
+
return firstVisibleTab[clientSize];
|
|
468
|
+
}
|
|
453
469
|
|
|
454
470
|
for (let i = 0; i < children.length; i += 1) {
|
|
455
471
|
const tab = children[i];
|
package/node/index.js
CHANGED
|
@@ -23,6 +23,9 @@ const {
|
|
|
23
23
|
getInitColorSchemeScript
|
|
24
24
|
} = (0, _system.unstable_createCssVarsProvider)({
|
|
25
25
|
theme: defaultTheme,
|
|
26
|
+
attribute: 'data-mui-color-scheme',
|
|
27
|
+
modeStorageKey: 'mui-mode',
|
|
28
|
+
colorSchemeStorageKey: 'mui-color-scheme',
|
|
26
29
|
defaultColorScheme: {
|
|
27
30
|
light: 'light',
|
|
28
31
|
dark: 'dark'
|