@mui/material 5.8.3 → 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/Autocomplete/autocompleteClasses.d.ts +1 -1
- package/Button/buttonClasses.d.ts +24 -0
- package/Button/buttonClasses.js +1 -1
- package/CHANGELOG.md +90 -10
- package/Grid/Grid.d.ts +73 -52
- package/Grid/Grid.js +94 -40
- package/Grow/Grow.js +1 -2
- package/Hidden/withWidth.js +0 -2
- 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 +6 -9
- package/Slider/Slider.d.ts +3 -1
- package/Slider/Slider.js +3 -1
- 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/Button/buttonClasses.js +1 -1
- package/legacy/Grid/Grid.js +97 -48
- package/legacy/Grow/Grow.js +1 -2
- package/legacy/Hidden/withWidth.js +0 -2
- 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 +3 -1
- 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/modern/Button/buttonClasses.js +1 -1
- package/modern/Grid/Grid.js +94 -40
- package/modern/Grow/Grow.js +1 -2
- package/modern/Hidden/withWidth.js +0 -2
- 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 +3 -1
- 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/node/Button/buttonClasses.js +1 -1
- package/node/Grid/Grid.js +95 -40
- package/node/Grow/Grow.js +1 -2
- package/node/Hidden/withWidth.js +0 -3
- 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 +3 -1
- 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/package.json +5 -6
- package/umd/material-ui.development.js +190 -173
- package/umd/material-ui.production.min.js +21 -21
|
@@ -41,16 +41,11 @@ const SnackbarRoot = styled('div', {
|
|
|
41
41
|
theme,
|
|
42
42
|
ownerState
|
|
43
43
|
}) => {
|
|
44
|
-
const center =
|
|
44
|
+
const center = {
|
|
45
45
|
left: '50%',
|
|
46
46
|
right: 'auto',
|
|
47
47
|
transform: 'translateX(-50%)'
|
|
48
|
-
}
|
|
49
|
-
right: '50%',
|
|
50
|
-
left: 'auto',
|
|
51
|
-
transform: 'translateX(50%)'
|
|
52
|
-
});
|
|
53
|
-
|
|
48
|
+
};
|
|
54
49
|
return _extends({
|
|
55
50
|
zIndex: (theme.vars || theme).zIndex.snackbar,
|
|
56
51
|
position: 'fixed',
|
|
@@ -72,19 +67,13 @@ const SnackbarRoot = styled('div', {
|
|
|
72
67
|
top: 24
|
|
73
68
|
} : {
|
|
74
69
|
bottom: 24
|
|
75
|
-
}, ownerState.anchorOrigin.horizontal === 'center' && center, ownerState.anchorOrigin.horizontal === 'left' &&
|
|
70
|
+
}, ownerState.anchorOrigin.horizontal === 'center' && center, ownerState.anchorOrigin.horizontal === 'left' && {
|
|
76
71
|
left: 24,
|
|
77
72
|
right: 'auto'
|
|
78
|
-
}, ownerState.
|
|
73
|
+
}, ownerState.anchorOrigin.horizontal === 'right' && {
|
|
79
74
|
right: 24,
|
|
80
75
|
left: 'auto'
|
|
81
|
-
})
|
|
82
|
-
right: 24,
|
|
83
|
-
left: 'auto'
|
|
84
|
-
}, ownerState.isRtl && {
|
|
85
|
-
left: 24,
|
|
86
|
-
right: 'auto'
|
|
87
|
-
}))
|
|
76
|
+
})
|
|
88
77
|
});
|
|
89
78
|
});
|
|
90
79
|
const Snackbar = /*#__PURE__*/React.forwardRef(function Snackbar(inProps, ref) {
|
|
@@ -131,14 +120,11 @@ const Snackbar = /*#__PURE__*/React.forwardRef(function Snackbar(inProps, ref) {
|
|
|
131
120
|
TransitionProps = _objectWithoutPropertiesLoose(props.TransitionProps, _excluded),
|
|
132
121
|
other = _objectWithoutPropertiesLoose(props, _excluded2);
|
|
133
122
|
|
|
134
|
-
const isRtl = theme.direction === 'rtl';
|
|
135
|
-
|
|
136
123
|
const ownerState = _extends({}, props, {
|
|
137
124
|
anchorOrigin: {
|
|
138
125
|
vertical,
|
|
139
126
|
horizontal
|
|
140
|
-
}
|
|
141
|
-
isRtl
|
|
127
|
+
}
|
|
142
128
|
});
|
|
143
129
|
|
|
144
130
|
const classes = useUtilityClasses(ownerState);
|
package/modern/Stack/Stack.js
CHANGED
|
@@ -59,7 +59,7 @@ export const style = ({
|
|
|
59
59
|
if (ownerState.spacing) {
|
|
60
60
|
const transformer = createUnarySpacing(theme);
|
|
61
61
|
const base = Object.keys(theme.breakpoints.values).reduce((acc, breakpoint) => {
|
|
62
|
-
if (ownerState.spacing[breakpoint] != null || ownerState.direction[breakpoint] != null) {
|
|
62
|
+
if (typeof ownerState.spacing === 'object' && ownerState.spacing[breakpoint] != null || typeof ownerState.direction === 'object' && ownerState.direction[breakpoint] != null) {
|
|
63
63
|
acc[breakpoint] = true;
|
|
64
64
|
}
|
|
65
65
|
|
|
@@ -120,8 +120,9 @@ const StepIcon = /*#__PURE__*/React.forwardRef(function StepIcon(inProps, ref) {
|
|
|
120
120
|
})), /*#__PURE__*/_jsx(StepIconText, {
|
|
121
121
|
className: classes.text,
|
|
122
122
|
x: "12",
|
|
123
|
-
y: "
|
|
123
|
+
y: "12",
|
|
124
124
|
textAnchor: "middle",
|
|
125
|
+
dominantBaseline: "central",
|
|
125
126
|
ownerState: ownerState,
|
|
126
127
|
children: icon
|
|
127
128
|
})]
|
package/modern/Tabs/Tabs.js
CHANGED
|
@@ -417,10 +417,26 @@ const Tabs = /*#__PURE__*/React.forwardRef(function Tabs(inProps, ref) {
|
|
|
417
417
|
scroll(scrollValue);
|
|
418
418
|
};
|
|
419
419
|
|
|
420
|
+
const getFirstVisibleTab = tabs => {
|
|
421
|
+
const containerSize = tabsRef.current[clientSize];
|
|
422
|
+
const containerStartBound = Math.round(tabsRef.current[scrollStart]);
|
|
423
|
+
const containerEndBound = Math.round(containerStartBound + containerSize);
|
|
424
|
+
const offset = vertical ? 'offsetTop' : 'offsetLeft';
|
|
425
|
+
return tabs.find(tab => {
|
|
426
|
+
const centerPoint = tab[offset] + tab[clientSize] / 2;
|
|
427
|
+
return centerPoint >= containerStartBound && centerPoint <= containerEndBound;
|
|
428
|
+
});
|
|
429
|
+
};
|
|
430
|
+
|
|
420
431
|
const getScrollSize = () => {
|
|
421
432
|
const containerSize = tabsRef.current[clientSize];
|
|
422
433
|
let totalSize = 0;
|
|
423
434
|
const children = Array.from(tabListRef.current.children);
|
|
435
|
+
const firstVisibleTab = getFirstVisibleTab(children);
|
|
436
|
+
|
|
437
|
+
if (firstVisibleTab && firstVisibleTab[clientSize] > containerSize) {
|
|
438
|
+
return firstVisibleTab[clientSize];
|
|
439
|
+
}
|
|
424
440
|
|
|
425
441
|
for (let i = 0; i < children.length; i += 1) {
|
|
426
442
|
const tab = children[i];
|
package/modern/index.js
CHANGED
|
@@ -12,6 +12,6 @@ function getButtonUtilityClass(slot) {
|
|
|
12
12
|
return (0, _base.generateUtilityClass)('MuiButton', slot);
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
const buttonClasses = (0, _base.generateUtilityClasses)('MuiButton', ['root', 'text', 'textInherit', 'textPrimary', 'textSecondary', 'outlined', 'outlinedInherit', 'outlinedPrimary', 'outlinedSecondary', 'contained', 'containedInherit', 'containedPrimary', 'containedSecondary', 'disableElevation', 'focusVisible', 'disabled', 'colorInherit', 'textSizeSmall', 'textSizeMedium', 'textSizeLarge', 'outlinedSizeSmall', 'outlinedSizeMedium', 'outlinedSizeLarge', 'containedSizeSmall', 'containedSizeMedium', 'containedSizeLarge', 'sizeMedium', 'sizeSmall', 'sizeLarge', 'fullWidth', 'startIcon', 'endIcon', 'iconSizeSmall', 'iconSizeMedium', 'iconSizeLarge']);
|
|
15
|
+
const buttonClasses = (0, _base.generateUtilityClasses)('MuiButton', ['root', 'text', 'textInherit', 'textPrimary', 'textSecondary', 'textSuccess', 'textError', 'textInfo', 'textWarning', 'outlined', 'outlinedInherit', 'outlinedPrimary', 'outlinedSecondary', 'outlinedSuccess', 'outlinedError', 'outlinedInfo', 'outlinedWarning', 'contained', 'containedInherit', 'containedPrimary', 'containedSecondary', 'containedSuccess', 'containedError', 'containedInfo', 'containedWarning', 'disableElevation', 'focusVisible', 'disabled', 'colorInherit', 'textSizeSmall', 'textSizeMedium', 'textSizeLarge', 'outlinedSizeSmall', 'outlinedSizeMedium', 'outlinedSizeLarge', 'containedSizeSmall', 'containedSizeMedium', 'containedSizeLarge', 'sizeMedium', 'sizeSmall', 'sizeLarge', 'fullWidth', 'startIcon', 'endIcon', 'iconSizeSmall', 'iconSizeMedium', 'iconSizeLarge']);
|
|
16
16
|
var _default = buttonClasses;
|
|
17
17
|
exports.default = _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
|
@@ -50,10 +50,9 @@ const styles = {
|
|
|
50
50
|
/*
|
|
51
51
|
TODO v6: remove
|
|
52
52
|
Conditionally apply a workaround for the CSS transition bug in Safari 15.4 / WebKit browsers.
|
|
53
|
-
Remove this workaround once the WebKit bug fix is released.
|
|
54
53
|
*/
|
|
55
54
|
|
|
56
|
-
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);
|
|
57
56
|
/**
|
|
58
57
|
* The Grow transition is used by the [Tooltip](/material-ui/react-tooltip/) and
|
|
59
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
|
|
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
|
@@ -614,12 +614,14 @@ process.env.NODE_ENV !== "production" ? Slider.propTypes
|
|
|
614
614
|
thumb: _propTypes.default.object,
|
|
615
615
|
track: _propTypes.default.object,
|
|
616
616
|
valueLabel: _propTypes.default.shape({
|
|
617
|
+
children: _propTypes.default.element,
|
|
617
618
|
className: _propTypes.default.string,
|
|
618
619
|
components: _propTypes.default.shape({
|
|
619
620
|
Root: _propTypes.default.elementType
|
|
620
621
|
}),
|
|
622
|
+
open: _propTypes.default.bool,
|
|
621
623
|
style: _propTypes.default.object,
|
|
622
|
-
value: _propTypes.default.
|
|
624
|
+
value: _propTypes.default.number,
|
|
623
625
|
valueLabelDisplay: _propTypes.default.oneOf(['auto', 'off', 'on'])
|
|
624
626
|
})
|
|
625
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];
|