@mui/material 5.8.2 → 5.8.5
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/AppBar/AppBar.js +22 -5
- package/Autocomplete/autocompleteClasses.d.ts +1 -1
- package/Avatar/Avatar.js +7 -4
- package/Badge/Badge.js +2 -2
- package/Button/buttonClasses.d.ts +24 -0
- package/Button/buttonClasses.js +1 -1
- package/CHANGELOG.md +225 -8
- package/Checkbox/Checkbox.js +4 -4
- package/Chip/Chip.js +31 -30
- package/Dialog/Dialog.js +11 -6
- package/FilledInput/FilledInput.js +28 -13
- 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/InputBase/InputBase.js +2 -2
- package/LinearProgress/LinearProgress.js +6 -2
- package/Link/Link.js +10 -17
- package/Link/getTextDecoration.d.ts +15 -0
- package/Link/getTextDecoration.js +29 -0
- package/Modal/Modal.d.ts +2 -0
- package/Modal/Modal.js +25 -8
- package/OutlinedInput/OutlinedInput.js +25 -10
- package/Popover/Popover.d.ts +7 -0
- package/Popover/index.js +1 -0
- package/README.md +13 -12
- package/Skeleton/Skeleton.js +8 -3
- package/Slider/Slider.d.ts +3 -1
- package/Slider/Slider.js +35 -20
- package/Snackbar/Snackbar.js +6 -20
- package/SnackbarContent/SnackbarContent.js +3 -3
- package/SpeedDialAction/SpeedDialAction.js +7 -7
- package/Stack/Stack.js +1 -1
- package/StepConnector/StepConnector.js +14 -11
- package/StepContent/StepContent.js +1 -1
- package/StepIcon/StepIcon.js +2 -1
- package/Switch/Switch.js +11 -11
- package/Tab/Tab.d.ts +0 -1
- package/TableCell/TableCell.js +5 -5
- package/Tabs/Tabs.js +6 -0
- package/Tooltip/Tooltip.js +1 -1
- package/index.js +1 -1
- package/legacy/Alert/Alert.js +3 -1
- package/legacy/AppBar/AppBar.js +23 -4
- package/legacy/Avatar/Avatar.js +7 -4
- package/legacy/Badge/Badge.js +2 -2
- package/legacy/Button/buttonClasses.js +1 -1
- package/legacy/Checkbox/Checkbox.js +4 -4
- package/legacy/Chip/Chip.js +31 -30
- package/legacy/Dialog/Dialog.js +11 -6
- package/legacy/FilledInput/FilledInput.js +28 -14
- package/legacy/Grid/Grid.js +97 -48
- package/legacy/Grow/Grow.js +1 -2
- package/legacy/Hidden/withWidth.js +0 -2
- package/legacy/InputBase/InputBase.js +2 -2
- package/legacy/LinearProgress/LinearProgress.js +6 -2
- package/legacy/Link/Link.js +10 -17
- package/legacy/Link/getTextDecoration.js +28 -0
- package/legacy/Modal/Modal.js +23 -7
- package/legacy/OutlinedInput/OutlinedInput.js +21 -9
- package/legacy/Popover/index.js +1 -0
- package/legacy/Skeleton/Skeleton.js +2 -2
- package/legacy/Slider/Slider.js +35 -20
- package/legacy/Snackbar/Snackbar.js +6 -21
- package/legacy/SnackbarContent/SnackbarContent.js +3 -3
- package/legacy/SpeedDialAction/SpeedDialAction.js +7 -7
- package/legacy/Stack/Stack.js +2 -1
- package/legacy/StepConnector/StepConnector.js +2 -1
- package/legacy/StepContent/StepContent.js +1 -1
- package/legacy/StepIcon/StepIcon.js +2 -1
- package/legacy/Switch/Switch.js +11 -11
- package/legacy/TableCell/TableCell.js +5 -5
- package/legacy/Tabs/Tabs.js +6 -0
- package/legacy/Tooltip/Tooltip.js +1 -1
- package/legacy/index.js +1 -1
- package/legacy/styles/CssVarsProvider.js +4 -1
- package/legacy/styles/experimental_extendTheme.js +113 -18
- package/modern/Alert/Alert.js +3 -1
- package/modern/AppBar/AppBar.js +22 -5
- package/modern/Avatar/Avatar.js +7 -4
- package/modern/Badge/Badge.js +2 -2
- package/modern/Button/buttonClasses.js +1 -1
- package/modern/Checkbox/Checkbox.js +4 -4
- package/modern/Chip/Chip.js +31 -30
- package/modern/Dialog/Dialog.js +11 -6
- package/modern/FilledInput/FilledInput.js +27 -12
- package/modern/Grid/Grid.js +94 -40
- package/modern/Grow/Grow.js +1 -2
- package/modern/Hidden/withWidth.js +0 -2
- package/modern/InputBase/InputBase.js +2 -2
- package/modern/LinearProgress/LinearProgress.js +6 -2
- package/modern/Link/Link.js +10 -17
- package/modern/Link/getTextDecoration.js +29 -0
- package/modern/Modal/Modal.js +24 -7
- package/modern/OutlinedInput/OutlinedInput.js +25 -10
- package/modern/Popover/index.js +1 -0
- package/modern/Skeleton/Skeleton.js +7 -2
- package/modern/Slider/Slider.js +35 -20
- package/modern/Snackbar/Snackbar.js +6 -20
- package/modern/SnackbarContent/SnackbarContent.js +3 -3
- package/modern/SpeedDialAction/SpeedDialAction.js +7 -7
- package/modern/Stack/Stack.js +1 -1
- package/modern/StepConnector/StepConnector.js +14 -11
- package/modern/StepContent/StepContent.js +1 -1
- package/modern/StepIcon/StepIcon.js +2 -1
- package/modern/Switch/Switch.js +11 -11
- package/modern/TableCell/TableCell.js +5 -5
- package/modern/Tabs/Tabs.js +6 -0
- package/modern/Tooltip/Tooltip.js +1 -1
- package/modern/index.js +1 -1
- package/modern/styles/CssVarsProvider.js +4 -1
- package/modern/styles/experimental_extendTheme.js +114 -18
- package/node/Alert/Alert.js +3 -1
- package/node/AppBar/AppBar.js +22 -5
- package/node/Avatar/Avatar.js +7 -4
- package/node/Badge/Badge.js +2 -2
- package/node/Button/buttonClasses.js +1 -1
- package/node/Checkbox/Checkbox.js +4 -4
- package/node/Chip/Chip.js +31 -30
- package/node/Dialog/Dialog.js +11 -6
- package/node/FilledInput/FilledInput.js +28 -13
- package/node/Grid/Grid.js +95 -40
- package/node/Grow/Grow.js +1 -2
- package/node/Hidden/withWidth.js +0 -3
- package/node/InputBase/InputBase.js +2 -2
- package/node/LinearProgress/LinearProgress.js +6 -2
- package/node/Link/Link.js +12 -20
- package/node/Link/getTextDecoration.js +39 -0
- package/node/Modal/Modal.js +25 -8
- package/node/OutlinedInput/OutlinedInput.js +25 -10
- package/node/Popover/index.js +13 -3
- package/node/Skeleton/Skeleton.js +7 -2
- package/node/Slider/Slider.js +35 -20
- package/node/Snackbar/Snackbar.js +6 -18
- package/node/SnackbarContent/SnackbarContent.js +3 -3
- package/node/SpeedDialAction/SpeedDialAction.js +7 -7
- package/node/Stack/Stack.js +1 -1
- package/node/StepConnector/StepConnector.js +14 -11
- package/node/StepContent/StepContent.js +1 -1
- package/node/StepIcon/StepIcon.js +2 -1
- package/node/Switch/Switch.js +11 -11
- package/node/TableCell/TableCell.js +5 -5
- package/node/Tabs/Tabs.js +6 -0
- package/node/Tooltip/Tooltip.js +1 -1
- package/node/index.js +1 -1
- package/node/styles/CssVarsProvider.js +4 -1
- package/node/styles/experimental_extendTheme.js +112 -17
- package/package.json +6 -7
- package/styles/CssVarsProvider.js +4 -1
- package/styles/createPalette.d.ts +65 -2
- package/styles/experimental_extendTheme.js +114 -18
- package/umd/material-ui.development.js +767 -414
- package/umd/material-ui.production.min.js +27 -22
package/legacy/Grid/Grid.js
CHANGED
|
@@ -21,6 +21,7 @@ import { unstable_composeClasses as composeClasses } from '@mui/base';
|
|
|
21
21
|
import requirePropFactory from '../utils/requirePropFactory';
|
|
22
22
|
import styled from '../styles/styled';
|
|
23
23
|
import useThemeProps from '../styles/useThemeProps';
|
|
24
|
+
import useTheme from '../styles/useTheme';
|
|
24
25
|
import GridContext from './GridContext';
|
|
25
26
|
import gridClasses, { getGridUtilityClass } from './gridClasses';
|
|
26
27
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -193,26 +194,29 @@ export function generateColumnGap(_ref5) {
|
|
|
193
194
|
|
|
194
195
|
return styles;
|
|
195
196
|
}
|
|
196
|
-
export function
|
|
197
|
+
export function resolveSpacingStyles(spacing, breakpoints) {
|
|
197
198
|
var styles = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
198
199
|
|
|
199
|
-
//
|
|
200
|
-
if (!
|
|
200
|
+
// undefined/null or `spacing` <= 0
|
|
201
|
+
if (!spacing || spacing <= 0) {
|
|
201
202
|
return [];
|
|
202
203
|
} // in case of string/number `spacing`
|
|
203
204
|
|
|
204
205
|
|
|
205
206
|
if (typeof spacing === 'string' && !Number.isNaN(Number(spacing)) || typeof spacing === 'number') {
|
|
206
|
-
return [styles["spacing-xs-".concat(String(spacing))]
|
|
207
|
+
return [styles["spacing-xs-".concat(String(spacing))]];
|
|
207
208
|
} // in case of object `spacing`
|
|
208
209
|
|
|
209
210
|
|
|
210
|
-
var
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
211
|
+
var spacingStyles = [];
|
|
212
|
+
breakpoints.forEach(function (breakpoint) {
|
|
213
|
+
var value = spacing[breakpoint];
|
|
214
|
+
|
|
215
|
+
if (Number(value) > 0) {
|
|
216
|
+
spacingStyles.push(styles["spacing-".concat(breakpoint, "-").concat(String(value))]);
|
|
217
|
+
}
|
|
218
|
+
});
|
|
219
|
+
return spacingStyles;
|
|
216
220
|
} // Default CSS values
|
|
217
221
|
// flex: '0 1 auto',
|
|
218
222
|
// flexDirection: 'row',
|
|
@@ -224,19 +228,29 @@ var GridRoot = styled('div', {
|
|
|
224
228
|
name: 'MuiGrid',
|
|
225
229
|
slot: 'Root',
|
|
226
230
|
overridesResolver: function overridesResolver(props, styles) {
|
|
227
|
-
var
|
|
228
|
-
|
|
229
|
-
direction =
|
|
230
|
-
item =
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
231
|
+
var ownerState = props.ownerState;
|
|
232
|
+
var container = ownerState.container,
|
|
233
|
+
direction = ownerState.direction,
|
|
234
|
+
item = ownerState.item,
|
|
235
|
+
spacing = ownerState.spacing,
|
|
236
|
+
wrap = ownerState.wrap,
|
|
237
|
+
zeroMinWidth = ownerState.zeroMinWidth,
|
|
238
|
+
breakpoints = ownerState.breakpoints;
|
|
239
|
+
var spacingStyles = []; // in case of grid item
|
|
240
|
+
|
|
241
|
+
if (container) {
|
|
242
|
+
spacingStyles = resolveSpacingStyles(spacing, breakpoints, styles);
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
var breakpointsStyles = [];
|
|
246
|
+
breakpoints.forEach(function (breakpoint) {
|
|
247
|
+
var value = ownerState[breakpoint];
|
|
248
|
+
|
|
249
|
+
if (value) {
|
|
250
|
+
breakpointsStyles.push(styles["grid-".concat(breakpoint, "-").concat(String(value))]);
|
|
251
|
+
}
|
|
252
|
+
});
|
|
253
|
+
return [styles.root, container && styles.container, item && styles.item, zeroMinWidth && styles.zeroMinWidth].concat(_toConsumableArray(spacingStyles), [direction !== 'row' && styles["direction-xs-".concat(String(direction))], wrap !== 'wrap' && styles["wrap-xs-".concat(String(wrap))]], breakpointsStyles);
|
|
240
254
|
}
|
|
241
255
|
})(function (_ref7) {
|
|
242
256
|
var ownerState = _ref7.ownerState;
|
|
@@ -255,22 +269,55 @@ var GridRoot = styled('div', {
|
|
|
255
269
|
flexWrap: ownerState.wrap
|
|
256
270
|
});
|
|
257
271
|
}, generateDirection, generateRowGap, generateColumnGap, generateGrid);
|
|
272
|
+
export function resolveSpacingClasses(spacing, breakpoints) {
|
|
273
|
+
// undefined/null or `spacing` <= 0
|
|
274
|
+
if (!spacing || spacing <= 0) {
|
|
275
|
+
return [];
|
|
276
|
+
} // in case of string/number `spacing`
|
|
277
|
+
|
|
278
|
+
|
|
279
|
+
if (typeof spacing === 'string' && !Number.isNaN(Number(spacing)) || typeof spacing === 'number') {
|
|
280
|
+
return ["spacing-xs-".concat(String(spacing))];
|
|
281
|
+
} // in case of object `spacing`
|
|
282
|
+
|
|
283
|
+
|
|
284
|
+
var classes = [];
|
|
285
|
+
breakpoints.forEach(function (breakpoint) {
|
|
286
|
+
var value = spacing[breakpoint];
|
|
287
|
+
|
|
288
|
+
if (Number(value) > 0) {
|
|
289
|
+
var className = "spacing-".concat(breakpoint, "-").concat(String(value));
|
|
290
|
+
classes.push(className);
|
|
291
|
+
}
|
|
292
|
+
});
|
|
293
|
+
return classes;
|
|
294
|
+
}
|
|
258
295
|
|
|
259
296
|
var useUtilityClasses = function useUtilityClasses(ownerState) {
|
|
260
297
|
var classes = ownerState.classes,
|
|
261
298
|
container = ownerState.container,
|
|
262
299
|
direction = ownerState.direction,
|
|
263
300
|
item = ownerState.item,
|
|
264
|
-
lg = ownerState.lg,
|
|
265
|
-
md = ownerState.md,
|
|
266
|
-
sm = ownerState.sm,
|
|
267
301
|
spacing = ownerState.spacing,
|
|
268
302
|
wrap = ownerState.wrap,
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
303
|
+
zeroMinWidth = ownerState.zeroMinWidth,
|
|
304
|
+
breakpoints = ownerState.breakpoints;
|
|
305
|
+
var spacingClasses = []; // in case of grid item
|
|
306
|
+
|
|
307
|
+
if (container) {
|
|
308
|
+
spacingClasses = resolveSpacingClasses(spacing, breakpoints);
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
var breakpointsClasses = [];
|
|
312
|
+
breakpoints.forEach(function (breakpoint) {
|
|
313
|
+
var value = ownerState[breakpoint];
|
|
314
|
+
|
|
315
|
+
if (value) {
|
|
316
|
+
breakpointsClasses.push("grid-".concat(breakpoint, "-").concat(String(value)));
|
|
317
|
+
}
|
|
318
|
+
});
|
|
272
319
|
var slots = {
|
|
273
|
-
root: ['root', container && 'container', item && 'item', zeroMinWidth && 'zeroMinWidth'].concat(_toConsumableArray(
|
|
320
|
+
root: ['root', container && 'container', item && 'item', zeroMinWidth && 'zeroMinWidth'].concat(_toConsumableArray(spacingClasses), [direction !== 'row' && "direction-xs-".concat(String(direction)), wrap !== 'wrap' && "wrap-xs-".concat(String(wrap))], breakpointsClasses)
|
|
274
321
|
};
|
|
275
322
|
return composeClasses(slots, getGridUtilityClass, classes);
|
|
276
323
|
};
|
|
@@ -280,6 +327,10 @@ var Grid = /*#__PURE__*/React.forwardRef(function Grid(inProps, ref) {
|
|
|
280
327
|
props: inProps,
|
|
281
328
|
name: 'MuiGrid'
|
|
282
329
|
});
|
|
330
|
+
|
|
331
|
+
var _useTheme = useTheme(),
|
|
332
|
+
breakpoints = _useTheme.breakpoints;
|
|
333
|
+
|
|
283
334
|
var props = extendSxProp(themeProps);
|
|
284
335
|
|
|
285
336
|
var className = props.className,
|
|
@@ -293,45 +344,43 @@ var Grid = /*#__PURE__*/React.forwardRef(function Grid(inProps, ref) {
|
|
|
293
344
|
direction = _props$direction === void 0 ? 'row' : _props$direction,
|
|
294
345
|
_props$item = props.item,
|
|
295
346
|
item = _props$item === void 0 ? false : _props$item,
|
|
296
|
-
_props$lg = props.lg,
|
|
297
|
-
lg = _props$lg === void 0 ? false : _props$lg,
|
|
298
|
-
_props$md = props.md,
|
|
299
|
-
md = _props$md === void 0 ? false : _props$md,
|
|
300
347
|
rowSpacingProp = props.rowSpacing,
|
|
301
|
-
_props$sm = props.sm,
|
|
302
|
-
sm = _props$sm === void 0 ? false : _props$sm,
|
|
303
348
|
_props$spacing = props.spacing,
|
|
304
349
|
spacing = _props$spacing === void 0 ? 0 : _props$spacing,
|
|
305
350
|
_props$wrap = props.wrap,
|
|
306
351
|
wrap = _props$wrap === void 0 ? 'wrap' : _props$wrap,
|
|
307
|
-
_props$xl = props.xl,
|
|
308
|
-
xl = _props$xl === void 0 ? false : _props$xl,
|
|
309
|
-
_props$xs = props.xs,
|
|
310
|
-
xs = _props$xs === void 0 ? false : _props$xs,
|
|
311
352
|
_props$zeroMinWidth = props.zeroMinWidth,
|
|
312
353
|
zeroMinWidth = _props$zeroMinWidth === void 0 ? false : _props$zeroMinWidth,
|
|
313
|
-
other = _objectWithoutProperties(props, ["className", "columns", "columnSpacing", "component", "container", "direction", "item", "
|
|
354
|
+
other = _objectWithoutProperties(props, ["className", "columns", "columnSpacing", "component", "container", "direction", "item", "rowSpacing", "spacing", "wrap", "zeroMinWidth"]);
|
|
314
355
|
|
|
315
356
|
var rowSpacing = rowSpacingProp || spacing;
|
|
316
357
|
var columnSpacing = columnSpacingProp || spacing;
|
|
317
358
|
var columnsContext = React.useContext(GridContext); // columns set with default breakpoint unit of 12
|
|
318
359
|
|
|
319
360
|
var columns = container ? columnsProp || 12 : columnsContext;
|
|
361
|
+
var breakpointsValues = {};
|
|
362
|
+
|
|
363
|
+
var otherFiltered = _extends({}, other);
|
|
364
|
+
|
|
365
|
+
breakpoints.keys.forEach(function (breakpoint) {
|
|
366
|
+
if (other[breakpoint] != null) {
|
|
367
|
+
breakpointsValues[breakpoint] = other[breakpoint];
|
|
368
|
+
delete otherFiltered[breakpoint];
|
|
369
|
+
}
|
|
370
|
+
});
|
|
320
371
|
|
|
321
372
|
var ownerState = _extends({}, props, {
|
|
322
373
|
columns: columns,
|
|
323
374
|
container: container,
|
|
324
375
|
direction: direction,
|
|
325
376
|
item: item,
|
|
326
|
-
lg: lg,
|
|
327
|
-
md: md,
|
|
328
|
-
sm: sm,
|
|
329
377
|
rowSpacing: rowSpacing,
|
|
330
378
|
columnSpacing: columnSpacing,
|
|
331
379
|
wrap: wrap,
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
380
|
+
zeroMinWidth: zeroMinWidth,
|
|
381
|
+
spacing: spacing
|
|
382
|
+
}, breakpointsValues, {
|
|
383
|
+
breakpoints: breakpoints.keys
|
|
335
384
|
});
|
|
336
385
|
|
|
337
386
|
var classes = useUtilityClasses(ownerState);
|
|
@@ -342,7 +391,7 @@ var Grid = /*#__PURE__*/React.forwardRef(function Grid(inProps, ref) {
|
|
|
342
391
|
className: clsx(classes.root, className),
|
|
343
392
|
as: component,
|
|
344
393
|
ref: ref
|
|
345
|
-
},
|
|
394
|
+
}, otherFiltered))
|
|
346
395
|
});
|
|
347
396
|
});
|
|
348
397
|
process.env.NODE_ENV !== "production" ? Grid.propTypes
|
package/legacy/Grow/Grow.js
CHANGED
|
@@ -26,10 +26,9 @@ var styles = {
|
|
|
26
26
|
/*
|
|
27
27
|
TODO v6: remove
|
|
28
28
|
Conditionally apply a workaround for the CSS transition bug in Safari 15.4 / WebKit browsers.
|
|
29
|
-
Remove this workaround once the WebKit bug fix is released.
|
|
30
29
|
*/
|
|
31
30
|
|
|
32
|
-
var isWebKit154 = typeof navigator !== 'undefined' && /^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent) && /(os |version\/)15(.|_)
|
|
31
|
+
var isWebKit154 = typeof navigator !== 'undefined' && /^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent) && /(os |version\/)15(.|_)4/i.test(navigator.userAgent);
|
|
33
32
|
/**
|
|
34
33
|
* The Grow transition is used by the [Tooltip](/material-ui/react-tooltip/) and
|
|
35
34
|
* [Popover](/material-ui/react-popover/) components.
|
|
@@ -4,7 +4,6 @@ import * as React from 'react';
|
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import { getDisplayName } from '@mui/utils';
|
|
6
6
|
import { getThemeProps } from '@mui/system';
|
|
7
|
-
import hoistNonReactStatics from 'hoist-non-react-statics';
|
|
8
7
|
import useTheme from '../styles/useTheme';
|
|
9
8
|
import useEnhancedEffect from '../utils/useEnhancedEffect';
|
|
10
9
|
import useMediaQuery from '../useMediaQuery';
|
|
@@ -119,7 +118,6 @@ var withWidth = function withWidth() {
|
|
|
119
118
|
WithWidth.displayName = "WithWidth(".concat(getDisplayName(Component), ")");
|
|
120
119
|
}
|
|
121
120
|
|
|
122
|
-
hoistNonReactStatics(WithWidth, Component);
|
|
123
121
|
return WithWidth;
|
|
124
122
|
};
|
|
125
123
|
};
|
|
@@ -92,7 +92,7 @@ export var InputBaseComponent = styled('input', {
|
|
|
92
92
|
var placeholder = _extends({
|
|
93
93
|
color: 'currentColor'
|
|
94
94
|
}, theme.vars ? {
|
|
95
|
-
opacity: theme.vars.opacity.
|
|
95
|
+
opacity: theme.vars.opacity.inputPlaceholder
|
|
96
96
|
} : {
|
|
97
97
|
opacity: light ? 0.42 : 0.5
|
|
98
98
|
}, {
|
|
@@ -105,7 +105,7 @@ export var InputBaseComponent = styled('input', {
|
|
|
105
105
|
opacity: '0 !important'
|
|
106
106
|
};
|
|
107
107
|
var placeholderVisible = theme.vars ? {
|
|
108
|
-
opacity: theme.vars.opacity.
|
|
108
|
+
opacity: theme.vars.opacity.inputPlaceholder
|
|
109
109
|
} : {
|
|
110
110
|
opacity: light ? 0.42 : 0.5
|
|
111
111
|
};
|
|
@@ -40,6 +40,10 @@ var getColorShade = function getColorShade(theme, color) {
|
|
|
40
40
|
return 'currentColor';
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
+
if (theme.vars) {
|
|
44
|
+
return theme.vars.palette.LinearProgress["".concat(color, "Bg")];
|
|
45
|
+
}
|
|
46
|
+
|
|
43
47
|
return theme.palette.mode === 'light' ? lighten(theme.palette[color].main, 0.62) : darken(theme.palette[color].main, 0.5);
|
|
44
48
|
};
|
|
45
49
|
|
|
@@ -124,7 +128,7 @@ var LinearProgressBar1 = styled('span', {
|
|
|
124
128
|
top: 0,
|
|
125
129
|
transition: 'transform 0.2s linear',
|
|
126
130
|
transformOrigin: 'left',
|
|
127
|
-
backgroundColor: ownerState.color === 'inherit' ? 'currentColor' : theme.palette[ownerState.color].main
|
|
131
|
+
backgroundColor: ownerState.color === 'inherit' ? 'currentColor' : (theme.vars || theme).palette[ownerState.color].main
|
|
128
132
|
}, ownerState.variant === 'determinate' && {
|
|
129
133
|
transition: "transform .".concat(TRANSITION_DURATION, "s linear")
|
|
130
134
|
}, ownerState.variant === 'buffer' && {
|
|
@@ -154,7 +158,7 @@ var LinearProgressBar2 = styled('span', {
|
|
|
154
158
|
transition: 'transform 0.2s linear',
|
|
155
159
|
transformOrigin: 'left'
|
|
156
160
|
}, ownerState.variant !== 'buffer' && {
|
|
157
|
-
backgroundColor: ownerState.color === 'inherit' ? 'currentColor' : theme.palette[ownerState.color].main
|
|
161
|
+
backgroundColor: ownerState.color === 'inherit' ? 'currentColor' : (theme.vars || theme).palette[ownerState.color].main
|
|
158
162
|
}, ownerState.color === 'inherit' && {
|
|
159
163
|
opacity: 0.3
|
|
160
164
|
}, ownerState.variant === 'buffer' && {
|
package/legacy/Link/Link.js
CHANGED
|
@@ -7,7 +7,6 @@ import PropTypes from 'prop-types';
|
|
|
7
7
|
import clsx from 'clsx';
|
|
8
8
|
import { elementTypeAcceptingRef } from '@mui/utils';
|
|
9
9
|
import { unstable_composeClasses as composeClasses } from '@mui/base';
|
|
10
|
-
import { alpha, getPath } from '@mui/system';
|
|
11
10
|
import capitalize from '../utils/capitalize';
|
|
12
11
|
import styled from '../styles/styled';
|
|
13
12
|
import useThemeProps from '../styles/useThemeProps';
|
|
@@ -15,18 +14,8 @@ import useIsFocusVisible from '../utils/useIsFocusVisible';
|
|
|
15
14
|
import useForkRef from '../utils/useForkRef';
|
|
16
15
|
import Typography from '../Typography';
|
|
17
16
|
import linkClasses, { getLinkUtilityClass } from './linkClasses';
|
|
17
|
+
import getTextDecoration, { colorTransformations } from './getTextDecoration';
|
|
18
18
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
19
|
-
var colorTransformations = {
|
|
20
|
-
primary: 'primary.main',
|
|
21
|
-
textPrimary: 'text.primary',
|
|
22
|
-
secondary: 'secondary.main',
|
|
23
|
-
textSecondary: 'text.secondary',
|
|
24
|
-
error: 'error.main'
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
var transformDeprecatedColors = function transformDeprecatedColors(color) {
|
|
28
|
-
return colorTransformations[color] || color;
|
|
29
|
-
};
|
|
30
19
|
|
|
31
20
|
var useUtilityClasses = function useUtilityClasses(ownerState) {
|
|
32
21
|
var classes = ownerState.classes,
|
|
@@ -49,7 +38,6 @@ var LinkRoot = styled(Typography, {
|
|
|
49
38
|
})(function (_ref) {
|
|
50
39
|
var theme = _ref.theme,
|
|
51
40
|
ownerState = _ref.ownerState;
|
|
52
|
-
var color = getPath(theme, "palette.".concat(transformDeprecatedColors(ownerState.color))) || ownerState.color;
|
|
53
41
|
return _extends({}, ownerState.underline === 'none' && {
|
|
54
42
|
textDecoration: 'none'
|
|
55
43
|
}, ownerState.underline === 'hover' && {
|
|
@@ -57,13 +45,18 @@ var LinkRoot = styled(Typography, {
|
|
|
57
45
|
'&:hover': {
|
|
58
46
|
textDecoration: 'underline'
|
|
59
47
|
}
|
|
60
|
-
}, ownerState.underline === 'always' && {
|
|
61
|
-
textDecoration: 'underline'
|
|
62
|
-
|
|
48
|
+
}, ownerState.underline === 'always' && _extends({
|
|
49
|
+
textDecoration: 'underline'
|
|
50
|
+
}, ownerState.color !== 'inherit' && {
|
|
51
|
+
textDecorationColor: getTextDecoration({
|
|
52
|
+
theme: theme,
|
|
53
|
+
ownerState: ownerState
|
|
54
|
+
})
|
|
55
|
+
}, {
|
|
63
56
|
'&:hover': {
|
|
64
57
|
textDecorationColor: 'inherit'
|
|
65
58
|
}
|
|
66
|
-
}, ownerState.component === 'button' && _defineProperty({
|
|
59
|
+
}), ownerState.component === 'button' && _defineProperty({
|
|
67
60
|
position: 'relative',
|
|
68
61
|
WebkitTapHighlightColor: 'transparent',
|
|
69
62
|
backgroundColor: 'transparent',
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { alpha, getPath } from '@mui/system';
|
|
2
|
+
export var colorTransformations = {
|
|
3
|
+
primary: 'primary.main',
|
|
4
|
+
textPrimary: 'text.primary',
|
|
5
|
+
secondary: 'secondary.main',
|
|
6
|
+
textSecondary: 'text.secondary',
|
|
7
|
+
error: 'error.main'
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
var transformDeprecatedColors = function transformDeprecatedColors(color) {
|
|
11
|
+
return colorTransformations[color] || color;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
var getTextDecoration = function getTextDecoration(_ref) {
|
|
15
|
+
var theme = _ref.theme,
|
|
16
|
+
ownerState = _ref.ownerState;
|
|
17
|
+
var transformedColor = transformDeprecatedColors(ownerState.color);
|
|
18
|
+
var color = getPath(theme, "palette.".concat(transformedColor), false) || ownerState.color;
|
|
19
|
+
var channelColor = getPath(theme, "palette.".concat(transformedColor, "Channel"));
|
|
20
|
+
|
|
21
|
+
if ('vars' in theme && channelColor) {
|
|
22
|
+
return "rgba(".concat(channelColor, " / 0.4)");
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return alpha(color, 0.4);
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export default getTextDecoration;
|
package/legacy/Modal/Modal.js
CHANGED
|
@@ -60,7 +60,7 @@ var ModalBackdrop = styled(Backdrop, {
|
|
|
60
60
|
*/
|
|
61
61
|
|
|
62
62
|
var Modal = /*#__PURE__*/React.forwardRef(function Modal(inProps, ref) {
|
|
63
|
-
var
|
|
63
|
+
var _ref2, _components$Root;
|
|
64
64
|
|
|
65
65
|
var props = useThemeProps({
|
|
66
66
|
name: 'MuiModal',
|
|
@@ -69,9 +69,11 @@ var Modal = /*#__PURE__*/React.forwardRef(function Modal(inProps, ref) {
|
|
|
69
69
|
|
|
70
70
|
var _props$BackdropCompon = props.BackdropComponent,
|
|
71
71
|
BackdropComponent = _props$BackdropCompon === void 0 ? ModalBackdrop : _props$BackdropCompon,
|
|
72
|
+
BackdropProps = props.BackdropProps,
|
|
72
73
|
_props$closeAfterTran = props.closeAfterTransition,
|
|
73
74
|
closeAfterTransition = _props$closeAfterTran === void 0 ? false : _props$closeAfterTran,
|
|
74
75
|
children = props.children,
|
|
76
|
+
component = props.component,
|
|
75
77
|
_props$components = props.components,
|
|
76
78
|
components = _props$components === void 0 ? {} : _props$components,
|
|
77
79
|
_props$componentsProp = props.componentsProps,
|
|
@@ -92,7 +94,8 @@ var Modal = /*#__PURE__*/React.forwardRef(function Modal(inProps, ref) {
|
|
|
92
94
|
hideBackdrop = _props$hideBackdrop === void 0 ? false : _props$hideBackdrop,
|
|
93
95
|
_props$keepMounted = props.keepMounted,
|
|
94
96
|
keepMounted = _props$keepMounted === void 0 ? false : _props$keepMounted,
|
|
95
|
-
|
|
97
|
+
theme = props.theme,
|
|
98
|
+
other = _objectWithoutProperties(props, ["BackdropComponent", "BackdropProps", "closeAfterTransition", "children", "component", "components", "componentsProps", "disableAutoFocus", "disableEnforceFocus", "disableEscapeKeyDown", "disablePortal", "disableRestoreFocus", "disableScrollLock", "hideBackdrop", "keepMounted", "theme"]);
|
|
96
99
|
|
|
97
100
|
var _React$useState = React.useState(true),
|
|
98
101
|
exited = _React$useState[0],
|
|
@@ -115,16 +118,19 @@ var Modal = /*#__PURE__*/React.forwardRef(function Modal(inProps, ref) {
|
|
|
115
118
|
});
|
|
116
119
|
|
|
117
120
|
var classes = extendUtilityClasses(ownerState);
|
|
121
|
+
var Root = (_ref2 = (_components$Root = components.Root) != null ? _components$Root : component) != null ? _ref2 : ModalRoot;
|
|
118
122
|
return /*#__PURE__*/_jsx(ModalUnstyled, _extends({
|
|
119
123
|
components: _extends({
|
|
120
|
-
Root:
|
|
124
|
+
Root: Root,
|
|
125
|
+
Backdrop: BackdropComponent
|
|
121
126
|
}, components),
|
|
122
127
|
componentsProps: {
|
|
123
|
-
root: _extends({}, componentsProps.root,
|
|
124
|
-
|
|
125
|
-
|
|
128
|
+
root: _extends({}, componentsProps.root, !isHostComponent(Root) && {
|
|
129
|
+
as: component,
|
|
130
|
+
theme: theme
|
|
131
|
+
}),
|
|
132
|
+
backdrop: _extends({}, BackdropProps, componentsProps.backdrop)
|
|
126
133
|
},
|
|
127
|
-
BackdropComponent: BackdropComponent,
|
|
128
134
|
onTransitionEnter: function onTransitionEnter() {
|
|
129
135
|
return setExited(false);
|
|
130
136
|
},
|
|
@@ -148,6 +154,7 @@ process.env.NODE_ENV !== "production" ? Modal.propTypes
|
|
|
148
154
|
|
|
149
155
|
/**
|
|
150
156
|
* A backdrop component. This prop enables custom backdrop rendering.
|
|
157
|
+
* @deprecated Use `components.Backdrop` instead.
|
|
151
158
|
* @default styled(Backdrop, {
|
|
152
159
|
* name: 'MuiModal',
|
|
153
160
|
* slot: 'Backdrop',
|
|
@@ -162,6 +169,7 @@ process.env.NODE_ENV !== "production" ? Modal.propTypes
|
|
|
162
169
|
|
|
163
170
|
/**
|
|
164
171
|
* Props applied to the [`Backdrop`](/material-ui/api/backdrop/) element.
|
|
172
|
+
* @deprecated Use `componentsProps.backdrop` instead.
|
|
165
173
|
*/
|
|
166
174
|
BackdropProps: PropTypes.object,
|
|
167
175
|
|
|
@@ -181,12 +189,19 @@ process.env.NODE_ENV !== "production" ? Modal.propTypes
|
|
|
181
189
|
*/
|
|
182
190
|
closeAfterTransition: PropTypes.bool,
|
|
183
191
|
|
|
192
|
+
/**
|
|
193
|
+
* The component used for the root node.
|
|
194
|
+
* Either a string to use a HTML element or a component.
|
|
195
|
+
*/
|
|
196
|
+
component: PropTypes.elementType,
|
|
197
|
+
|
|
184
198
|
/**
|
|
185
199
|
* The components used for each slot inside the Modal.
|
|
186
200
|
* Either a string to use a HTML element or a component.
|
|
187
201
|
* @default {}
|
|
188
202
|
*/
|
|
189
203
|
components: PropTypes.shape({
|
|
204
|
+
Backdrop: PropTypes.elementType,
|
|
190
205
|
Root: PropTypes.elementType
|
|
191
206
|
}),
|
|
192
207
|
|
|
@@ -195,6 +210,7 @@ process.env.NODE_ENV !== "production" ? Modal.propTypes
|
|
|
195
210
|
* @default {}
|
|
196
211
|
*/
|
|
197
212
|
componentsProps: PropTypes.shape({
|
|
213
|
+
backdrop: PropTypes.object,
|
|
198
214
|
root: PropTypes.object
|
|
199
215
|
}),
|
|
200
216
|
|
|
@@ -41,18 +41,18 @@ var OutlinedInputRoot = styled(InputBaseRoot, {
|
|
|
41
41
|
var borderColor = theme.palette.mode === 'light' ? 'rgba(0, 0, 0, 0.23)' : 'rgba(255, 255, 255, 0.23)';
|
|
42
42
|
return _extends((_extends2 = {
|
|
43
43
|
position: 'relative',
|
|
44
|
-
borderRadius: theme.shape.borderRadius
|
|
44
|
+
borderRadius: (theme.vars || theme).shape.borderRadius
|
|
45
45
|
}, _defineProperty(_extends2, "&:hover .".concat(outlinedInputClasses.notchedOutline), {
|
|
46
|
-
borderColor: theme.palette.text.primary
|
|
46
|
+
borderColor: (theme.vars || theme).palette.text.primary
|
|
47
47
|
}), _defineProperty(_extends2, '@media (hover: none)', _defineProperty({}, "&:hover .".concat(outlinedInputClasses.notchedOutline), {
|
|
48
|
-
borderColor: borderColor
|
|
48
|
+
borderColor: theme.vars ? "rgba(".concat(theme.vars.palette.common.onBackgroundChannel, " / 0.23)") : borderColor
|
|
49
49
|
})), _defineProperty(_extends2, "&.".concat(outlinedInputClasses.focused, " .").concat(outlinedInputClasses.notchedOutline), {
|
|
50
|
-
borderColor: theme.palette[ownerState.color].main,
|
|
50
|
+
borderColor: (theme.vars || theme).palette[ownerState.color].main,
|
|
51
51
|
borderWidth: 2
|
|
52
52
|
}), _defineProperty(_extends2, "&.".concat(outlinedInputClasses.error, " .").concat(outlinedInputClasses.notchedOutline), {
|
|
53
|
-
borderColor: theme.palette.error.main
|
|
53
|
+
borderColor: (theme.vars || theme).palette.error.main
|
|
54
54
|
}), _defineProperty(_extends2, "&.".concat(outlinedInputClasses.disabled, " .").concat(outlinedInputClasses.notchedOutline), {
|
|
55
|
-
borderColor: theme.palette.action.disabled
|
|
55
|
+
borderColor: (theme.vars || theme).palette.action.disabled
|
|
56
56
|
}), _extends2), ownerState.startAdornment && {
|
|
57
57
|
paddingLeft: 14
|
|
58
58
|
}, ownerState.endAdornment && {
|
|
@@ -71,8 +71,9 @@ var NotchedOutlineRoot = styled(NotchedOutline, {
|
|
|
71
71
|
}
|
|
72
72
|
})(function (_ref2) {
|
|
73
73
|
var theme = _ref2.theme;
|
|
74
|
+
var borderColor = theme.palette.mode === 'light' ? 'rgba(0, 0, 0, 0.23)' : 'rgba(255, 255, 255, 0.23)';
|
|
74
75
|
return {
|
|
75
|
-
borderColor: theme.
|
|
76
|
+
borderColor: theme.vars ? "rgba(".concat(theme.vars.palette.common.onBackgroundChannel, " / 0.23)") : borderColor
|
|
76
77
|
};
|
|
77
78
|
});
|
|
78
79
|
var OutlinedInputInput = styled(InputBaseInput, {
|
|
@@ -83,14 +84,25 @@ var OutlinedInputInput = styled(InputBaseInput, {
|
|
|
83
84
|
var theme = _ref3.theme,
|
|
84
85
|
ownerState = _ref3.ownerState;
|
|
85
86
|
return _extends({
|
|
86
|
-
padding: '16.5px 14px'
|
|
87
|
+
padding: '16.5px 14px'
|
|
88
|
+
}, !theme.vars && {
|
|
87
89
|
'&:-webkit-autofill': {
|
|
88
90
|
WebkitBoxShadow: theme.palette.mode === 'light' ? null : '0 0 0 100px #266798 inset',
|
|
89
91
|
WebkitTextFillColor: theme.palette.mode === 'light' ? null : '#fff',
|
|
90
92
|
caretColor: theme.palette.mode === 'light' ? null : '#fff',
|
|
91
93
|
borderRadius: 'inherit'
|
|
92
94
|
}
|
|
93
|
-
},
|
|
95
|
+
}, theme.vars && _defineProperty({
|
|
96
|
+
'&:-webkit-autofill': {
|
|
97
|
+
borderRadius: 'inherit'
|
|
98
|
+
}
|
|
99
|
+
}, theme.getColorSchemeSelector('dark'), {
|
|
100
|
+
'&:-webkit-autofill': {
|
|
101
|
+
WebkitBoxShadow: '0 0 0 100px #266798 inset',
|
|
102
|
+
WebkitTextFillColor: '#fff',
|
|
103
|
+
caretColor: '#fff'
|
|
104
|
+
}
|
|
105
|
+
}), ownerState.size === 'small' && {
|
|
94
106
|
padding: '8.5px 14px'
|
|
95
107
|
}, ownerState.multiline && {
|
|
96
108
|
padding: 0
|
package/legacy/Popover/index.js
CHANGED
|
@@ -45,7 +45,7 @@ var SkeletonRoot = styled('span', {
|
|
|
45
45
|
return _extends({
|
|
46
46
|
display: 'block',
|
|
47
47
|
// Create a "on paper" color with sufficient contrast retaining the color
|
|
48
|
-
backgroundColor: alpha(theme.palette.text.primary, theme.palette.mode === 'light' ? 0.11 : 0.13),
|
|
48
|
+
backgroundColor: theme.vars ? theme.vars.palette.Skeleton.bg : alpha(theme.palette.text.primary, theme.palette.mode === 'light' ? 0.11 : 0.13),
|
|
49
49
|
height: '1.2em'
|
|
50
50
|
}, ownerState.variant === 'text' && {
|
|
51
51
|
marginTop: 0,
|
|
@@ -74,7 +74,7 @@ var SkeletonRoot = styled('span', {
|
|
|
74
74
|
}, function (_ref3) {
|
|
75
75
|
var ownerState = _ref3.ownerState,
|
|
76
76
|
theme = _ref3.theme;
|
|
77
|
-
return ownerState.animation === 'wave' && css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n position: relative;\n overflow: hidden;\n\n /* Fix bug in Safari https://bugs.webkit.org/show_bug.cgi?id=68196 */\n -webkit-mask-image: -webkit-radial-gradient(white, black);\n\n &::after {\n animation: ", " 1.6s linear 0.5s infinite;\n background: linear-gradient(90deg
|
|
77
|
+
return ownerState.animation === 'wave' && css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n position: relative;\n overflow: hidden;\n\n /* Fix bug in Safari https://bugs.webkit.org/show_bug.cgi?id=68196 */\n -webkit-mask-image: -webkit-radial-gradient(white, black);\n\n &::after {\n animation: ", " 1.6s linear 0.5s infinite;\n background: linear-gradient(\n 90deg,\n transparent,\n ", ",\n transparent\n );\n content: '';\n position: absolute;\n transform: translateX(-100%); /* Avoid flash during server-side hydration */\n bottom: 0;\n left: 0;\n right: 0;\n top: 0;\n }\n "])), waveKeyframe, (theme.vars || theme).palette.action.hover);
|
|
78
78
|
});
|
|
79
79
|
var Skeleton = /*#__PURE__*/React.forwardRef(function Skeleton(inProps, ref) {
|
|
80
80
|
var props = useThemeProps({
|