@mui/material 6.3.0 → 6.4.0
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.d.ts +69 -0
- package/Alert/Alert.js +53 -21
- package/AppBar/AppBar.d.ts +1 -1
- package/AppBar/AppBar.js +1 -1
- package/Autocomplete/Autocomplete.d.ts +1 -1
- package/Autocomplete/Autocomplete.js +35 -48
- package/Button/Button.d.ts +18 -0
- package/Button/Button.js +233 -15
- package/Button/buttonClasses.d.ts +14 -0
- package/Button/buttonClasses.js +1 -1
- package/CHANGELOG.md +85 -0
- package/CardHeader/CardHeader.d.ts +114 -1
- package/CardHeader/CardHeader.js +99 -32
- package/CircularProgress/CircularProgress.js +2 -2
- package/IconButton/IconButton.d.ts +12 -0
- package/IconButton/IconButton.js +69 -7
- package/IconButton/iconButtonClasses.d.ts +4 -0
- package/IconButton/iconButtonClasses.js +1 -1
- package/LinearProgress/LinearProgress.js +4 -4
- package/LinearProgress/linearProgressClasses.d.ts +31 -9
- package/LinearProgress/linearProgressClasses.js +1 -1
- package/Link/getTextDecoration.js +3 -2
- package/Select/Select.js +10 -1
- package/Select/SelectInput.js +1 -1
- package/Select/selectClasses.d.ts +9 -3
- package/Slider/useSlider.js +5 -2
- package/StepLabel/StepLabel.d.ts +1 -1
- package/TableSortLabel/TableSortLabel.d.ts +43 -1
- package/TableSortLabel/TableSortLabel.js +40 -7
- package/Tooltip/Tooltip.d.ts +1 -1
- package/Tooltip/Tooltip.js +1 -1
- package/index.js +1 -1
- package/modern/Alert/Alert.js +53 -21
- package/modern/AppBar/AppBar.js +1 -1
- package/modern/Autocomplete/Autocomplete.js +35 -48
- package/modern/Button/Button.js +233 -15
- package/modern/Button/buttonClasses.js +1 -1
- package/modern/CardHeader/CardHeader.js +99 -32
- package/modern/CircularProgress/CircularProgress.js +2 -2
- package/modern/IconButton/IconButton.js +69 -7
- package/modern/IconButton/iconButtonClasses.js +1 -1
- package/modern/LinearProgress/LinearProgress.js +4 -4
- package/modern/LinearProgress/linearProgressClasses.js +1 -1
- package/modern/Link/getTextDecoration.js +3 -2
- package/modern/Select/Select.js +10 -1
- package/modern/Select/SelectInput.js +1 -1
- package/modern/Slider/useSlider.js +5 -2
- package/modern/TableSortLabel/TableSortLabel.js +40 -7
- package/modern/Tooltip/Tooltip.js +1 -1
- package/modern/index.js +1 -1
- package/modern/utils/index.js +1 -0
- package/modern/utils/mergeSlotProps.js +43 -0
- package/modern/utils/useSlot.js +5 -1
- package/modern/version/index.js +2 -2
- package/node/Alert/Alert.js +53 -21
- package/node/AppBar/AppBar.js +1 -1
- package/node/Autocomplete/Autocomplete.js +35 -48
- package/node/Button/Button.js +233 -15
- package/node/Button/buttonClasses.js +1 -1
- package/node/CardHeader/CardHeader.js +99 -32
- package/node/CircularProgress/CircularProgress.js +2 -2
- package/node/IconButton/IconButton.js +68 -6
- package/node/IconButton/iconButtonClasses.js +1 -1
- package/node/LinearProgress/LinearProgress.js +4 -4
- package/node/LinearProgress/linearProgressClasses.js +1 -1
- package/node/Link/getTextDecoration.js +3 -2
- package/node/Select/Select.js +10 -1
- package/node/Select/SelectInput.js +1 -1
- package/node/Slider/useSlider.js +5 -2
- package/node/TableSortLabel/TableSortLabel.js +40 -7
- package/node/Tooltip/Tooltip.js +1 -1
- package/node/index.js +1 -1
- package/node/utils/index.js +7 -0
- package/node/utils/mergeSlotProps.js +50 -0
- package/node/utils/useSlot.js +5 -1
- package/node/version/index.js +2 -2
- package/package.json +6 -6
- package/utils/index.d.ts +1 -0
- package/utils/index.js +1 -0
- package/utils/mergeSlotProps.d.ts +2 -0
- package/utils/mergeSlotProps.js +43 -0
- package/utils/useSlot.d.ts +8 -0
- package/utils/useSlot.js +5 -1
- package/version/index.js +2 -2
package/Button/Button.js
CHANGED
|
@@ -6,11 +6,13 @@ import clsx from 'clsx';
|
|
|
6
6
|
import resolveProps from '@mui/utils/resolveProps';
|
|
7
7
|
import composeClasses from '@mui/utils/composeClasses';
|
|
8
8
|
import { alpha } from '@mui/system/colorManipulator';
|
|
9
|
+
import { unstable_useId as useId } from '@mui/material/utils';
|
|
9
10
|
import rootShouldForwardProp from "../styles/rootShouldForwardProp.js";
|
|
10
11
|
import { styled } from "../zero-styled/index.js";
|
|
11
12
|
import memoTheme from "../utils/memoTheme.js";
|
|
12
13
|
import { useDefaultProps } from "../DefaultPropsProvider/index.js";
|
|
13
14
|
import ButtonBase from "../ButtonBase/index.js";
|
|
15
|
+
import CircularProgress from "../CircularProgress/index.js";
|
|
14
16
|
import capitalize from "../utils/capitalize.js";
|
|
15
17
|
import createSimplePaletteValueFilter from "../utils/createSimplePaletteValueFilter.js";
|
|
16
18
|
import buttonClasses, { getButtonUtilityClass } from "./buttonClasses.js";
|
|
@@ -24,13 +26,16 @@ const useUtilityClasses = ownerState => {
|
|
|
24
26
|
fullWidth,
|
|
25
27
|
size,
|
|
26
28
|
variant,
|
|
29
|
+
loading,
|
|
30
|
+
loadingPosition,
|
|
27
31
|
classes
|
|
28
32
|
} = ownerState;
|
|
29
33
|
const slots = {
|
|
30
|
-
root: ['root', variant, `${variant}${capitalize(color)}`, `size${capitalize(size)}`, `${variant}Size${capitalize(size)}`, `color${capitalize(color)}`, disableElevation && 'disableElevation', fullWidth && 'fullWidth'],
|
|
31
|
-
label: ['label'],
|
|
34
|
+
root: ['root', loading && 'loading', variant, `${variant}${capitalize(color)}`, `size${capitalize(size)}`, `${variant}Size${capitalize(size)}`, `color${capitalize(color)}`, disableElevation && 'disableElevation', fullWidth && 'fullWidth', loading && `loadingPosition${capitalize(loadingPosition)}`],
|
|
32
35
|
startIcon: ['icon', 'startIcon', `iconSize${capitalize(size)}`],
|
|
33
|
-
endIcon: ['icon', 'endIcon', `iconSize${capitalize(size)}`]
|
|
36
|
+
endIcon: ['icon', 'endIcon', `iconSize${capitalize(size)}`],
|
|
37
|
+
loadingIndicator: ['loadingIndicator'],
|
|
38
|
+
loadingWrapper: ['loadingWrapper']
|
|
34
39
|
};
|
|
35
40
|
const composedClasses = composeClasses(slots, getButtonUtilityClass, classes);
|
|
36
41
|
return {
|
|
@@ -75,7 +80,7 @@ const ButtonRoot = styled(ButtonBase, {
|
|
|
75
80
|
const {
|
|
76
81
|
ownerState
|
|
77
82
|
} = props;
|
|
78
|
-
return [styles.root, styles[ownerState.variant], styles[`${ownerState.variant}${capitalize(ownerState.color)}`], styles[`size${capitalize(ownerState.size)}`], styles[`${ownerState.variant}Size${capitalize(ownerState.size)}`], ownerState.color === 'inherit' && styles.colorInherit, ownerState.disableElevation && styles.disableElevation, ownerState.fullWidth && styles.fullWidth];
|
|
83
|
+
return [styles.root, styles[ownerState.variant], styles[`${ownerState.variant}${capitalize(ownerState.color)}`], styles[`size${capitalize(ownerState.size)}`], styles[`${ownerState.variant}Size${capitalize(ownerState.size)}`], ownerState.color === 'inherit' && styles.colorInherit, ownerState.disableElevation && styles.disableElevation, ownerState.fullWidth && styles.fullWidth, ownerState.loading && styles.loading];
|
|
79
84
|
}
|
|
80
85
|
})(memoTheme(({
|
|
81
86
|
theme
|
|
@@ -262,6 +267,18 @@ const ButtonRoot = styled(ButtonBase, {
|
|
|
262
267
|
style: {
|
|
263
268
|
width: '100%'
|
|
264
269
|
}
|
|
270
|
+
}, {
|
|
271
|
+
props: {
|
|
272
|
+
loadingPosition: 'center'
|
|
273
|
+
},
|
|
274
|
+
style: {
|
|
275
|
+
transition: theme.transitions.create(['background-color', 'box-shadow', 'border-color'], {
|
|
276
|
+
duration: theme.transitions.duration.short
|
|
277
|
+
}),
|
|
278
|
+
[`&.${buttonClasses.loading}`]: {
|
|
279
|
+
color: 'transparent'
|
|
280
|
+
}
|
|
281
|
+
}
|
|
265
282
|
}]
|
|
266
283
|
};
|
|
267
284
|
}));
|
|
@@ -272,9 +289,11 @@ const ButtonStartIcon = styled('span', {
|
|
|
272
289
|
const {
|
|
273
290
|
ownerState
|
|
274
291
|
} = props;
|
|
275
|
-
return [styles.startIcon, styles[`iconSize${capitalize(ownerState.size)}`]];
|
|
292
|
+
return [styles.startIcon, ownerState.loading && styles.startIconLoadingStart, styles[`iconSize${capitalize(ownerState.size)}`]];
|
|
276
293
|
}
|
|
277
|
-
})({
|
|
294
|
+
})(({
|
|
295
|
+
theme
|
|
296
|
+
}) => ({
|
|
278
297
|
display: 'inherit',
|
|
279
298
|
marginRight: 8,
|
|
280
299
|
marginLeft: -4,
|
|
@@ -285,8 +304,28 @@ const ButtonStartIcon = styled('span', {
|
|
|
285
304
|
style: {
|
|
286
305
|
marginLeft: -2
|
|
287
306
|
}
|
|
307
|
+
}, {
|
|
308
|
+
props: {
|
|
309
|
+
loadingPosition: 'start',
|
|
310
|
+
loading: true
|
|
311
|
+
},
|
|
312
|
+
style: {
|
|
313
|
+
transition: theme.transitions.create(['opacity'], {
|
|
314
|
+
duration: theme.transitions.duration.short
|
|
315
|
+
}),
|
|
316
|
+
opacity: 0
|
|
317
|
+
}
|
|
318
|
+
}, {
|
|
319
|
+
props: {
|
|
320
|
+
loadingPosition: 'start',
|
|
321
|
+
loading: true,
|
|
322
|
+
fullWidth: true
|
|
323
|
+
},
|
|
324
|
+
style: {
|
|
325
|
+
marginRight: -8
|
|
326
|
+
}
|
|
288
327
|
}, ...commonIconStyles]
|
|
289
|
-
});
|
|
328
|
+
}));
|
|
290
329
|
const ButtonEndIcon = styled('span', {
|
|
291
330
|
name: 'MuiButton',
|
|
292
331
|
slot: 'EndIcon',
|
|
@@ -294,9 +333,11 @@ const ButtonEndIcon = styled('span', {
|
|
|
294
333
|
const {
|
|
295
334
|
ownerState
|
|
296
335
|
} = props;
|
|
297
|
-
return [styles.endIcon, styles[`iconSize${capitalize(ownerState.size)}`]];
|
|
336
|
+
return [styles.endIcon, ownerState.loading && styles.endIconLoadingEnd, styles[`iconSize${capitalize(ownerState.size)}`]];
|
|
298
337
|
}
|
|
299
|
-
})({
|
|
338
|
+
})(({
|
|
339
|
+
theme
|
|
340
|
+
}) => ({
|
|
300
341
|
display: 'inherit',
|
|
301
342
|
marginRight: -4,
|
|
302
343
|
marginLeft: 8,
|
|
@@ -307,7 +348,128 @@ const ButtonEndIcon = styled('span', {
|
|
|
307
348
|
style: {
|
|
308
349
|
marginRight: -2
|
|
309
350
|
}
|
|
351
|
+
}, {
|
|
352
|
+
props: {
|
|
353
|
+
loadingPosition: 'end',
|
|
354
|
+
loading: true
|
|
355
|
+
},
|
|
356
|
+
style: {
|
|
357
|
+
transition: theme.transitions.create(['opacity'], {
|
|
358
|
+
duration: theme.transitions.duration.short
|
|
359
|
+
}),
|
|
360
|
+
opacity: 0
|
|
361
|
+
}
|
|
362
|
+
}, {
|
|
363
|
+
props: {
|
|
364
|
+
loadingPosition: 'end',
|
|
365
|
+
loading: true,
|
|
366
|
+
fullWidth: true
|
|
367
|
+
},
|
|
368
|
+
style: {
|
|
369
|
+
marginLeft: -8
|
|
370
|
+
}
|
|
310
371
|
}, ...commonIconStyles]
|
|
372
|
+
}));
|
|
373
|
+
const ButtonLoadingIndicator = styled('span', {
|
|
374
|
+
name: 'MuiButton',
|
|
375
|
+
slot: 'LoadingIndicator',
|
|
376
|
+
overridesResolver: (props, styles) => styles.loadingIndicator
|
|
377
|
+
})(({
|
|
378
|
+
theme
|
|
379
|
+
}) => ({
|
|
380
|
+
display: 'none',
|
|
381
|
+
position: 'absolute',
|
|
382
|
+
visibility: 'visible',
|
|
383
|
+
variants: [{
|
|
384
|
+
props: {
|
|
385
|
+
loading: true
|
|
386
|
+
},
|
|
387
|
+
style: {
|
|
388
|
+
display: 'flex'
|
|
389
|
+
}
|
|
390
|
+
}, {
|
|
391
|
+
props: {
|
|
392
|
+
loadingPosition: 'start'
|
|
393
|
+
},
|
|
394
|
+
style: {
|
|
395
|
+
left: 14
|
|
396
|
+
}
|
|
397
|
+
}, {
|
|
398
|
+
props: {
|
|
399
|
+
loadingPosition: 'start',
|
|
400
|
+
size: 'small'
|
|
401
|
+
},
|
|
402
|
+
style: {
|
|
403
|
+
left: 10
|
|
404
|
+
}
|
|
405
|
+
}, {
|
|
406
|
+
props: {
|
|
407
|
+
variant: 'text',
|
|
408
|
+
loadingPosition: 'start'
|
|
409
|
+
},
|
|
410
|
+
style: {
|
|
411
|
+
left: 6
|
|
412
|
+
}
|
|
413
|
+
}, {
|
|
414
|
+
props: {
|
|
415
|
+
loadingPosition: 'center'
|
|
416
|
+
},
|
|
417
|
+
style: {
|
|
418
|
+
left: '50%',
|
|
419
|
+
transform: 'translate(-50%)',
|
|
420
|
+
color: (theme.vars || theme).palette.action.disabled
|
|
421
|
+
}
|
|
422
|
+
}, {
|
|
423
|
+
props: {
|
|
424
|
+
loadingPosition: 'end'
|
|
425
|
+
},
|
|
426
|
+
style: {
|
|
427
|
+
right: 14
|
|
428
|
+
}
|
|
429
|
+
}, {
|
|
430
|
+
props: {
|
|
431
|
+
loadingPosition: 'end',
|
|
432
|
+
size: 'small'
|
|
433
|
+
},
|
|
434
|
+
style: {
|
|
435
|
+
right: 10
|
|
436
|
+
}
|
|
437
|
+
}, {
|
|
438
|
+
props: {
|
|
439
|
+
variant: 'text',
|
|
440
|
+
loadingPosition: 'end'
|
|
441
|
+
},
|
|
442
|
+
style: {
|
|
443
|
+
right: 6
|
|
444
|
+
}
|
|
445
|
+
}, {
|
|
446
|
+
props: {
|
|
447
|
+
loadingPosition: 'start',
|
|
448
|
+
fullWidth: true
|
|
449
|
+
},
|
|
450
|
+
style: {
|
|
451
|
+
position: 'relative',
|
|
452
|
+
left: -10
|
|
453
|
+
}
|
|
454
|
+
}, {
|
|
455
|
+
props: {
|
|
456
|
+
loadingPosition: 'end',
|
|
457
|
+
fullWidth: true
|
|
458
|
+
},
|
|
459
|
+
style: {
|
|
460
|
+
position: 'relative',
|
|
461
|
+
right: -10
|
|
462
|
+
}
|
|
463
|
+
}]
|
|
464
|
+
}));
|
|
465
|
+
const ButtonLoadingIconPlaceholder = styled('span', {
|
|
466
|
+
name: 'MuiButton',
|
|
467
|
+
slot: 'LoadingIconPlaceholder',
|
|
468
|
+
overridesResolver: (props, styles) => styles.loadingIconPlaceholder
|
|
469
|
+
})({
|
|
470
|
+
display: 'inline-block',
|
|
471
|
+
width: '1em',
|
|
472
|
+
height: '1em'
|
|
311
473
|
});
|
|
312
474
|
const Button = /*#__PURE__*/React.forwardRef(function Button(inProps, ref) {
|
|
313
475
|
// props priority: `inProps` > `contextProps` > `themeDefaultProps`
|
|
@@ -329,12 +491,22 @@ const Button = /*#__PURE__*/React.forwardRef(function Button(inProps, ref) {
|
|
|
329
491
|
endIcon: endIconProp,
|
|
330
492
|
focusVisibleClassName,
|
|
331
493
|
fullWidth = false,
|
|
494
|
+
id: idProp,
|
|
495
|
+
loading = null,
|
|
496
|
+
loadingIndicator: loadingIndicatorProp,
|
|
497
|
+
loadingPosition = 'center',
|
|
332
498
|
size = 'medium',
|
|
333
499
|
startIcon: startIconProp,
|
|
334
500
|
type,
|
|
335
501
|
variant = 'text',
|
|
336
502
|
...other
|
|
337
503
|
} = props;
|
|
504
|
+
const id = useId(idProp);
|
|
505
|
+
const loadingIndicator = loadingIndicatorProp ?? /*#__PURE__*/_jsx(CircularProgress, {
|
|
506
|
+
"aria-labelledby": id,
|
|
507
|
+
color: "inherit",
|
|
508
|
+
size: 16
|
|
509
|
+
});
|
|
338
510
|
const ownerState = {
|
|
339
511
|
...props,
|
|
340
512
|
color,
|
|
@@ -343,34 +515,58 @@ const Button = /*#__PURE__*/React.forwardRef(function Button(inProps, ref) {
|
|
|
343
515
|
disableElevation,
|
|
344
516
|
disableFocusRipple,
|
|
345
517
|
fullWidth,
|
|
518
|
+
loading,
|
|
519
|
+
loadingIndicator,
|
|
520
|
+
loadingPosition,
|
|
346
521
|
size,
|
|
347
522
|
type,
|
|
348
523
|
variant
|
|
349
524
|
};
|
|
350
525
|
const classes = useUtilityClasses(ownerState);
|
|
351
|
-
const startIcon = startIconProp && /*#__PURE__*/_jsx(ButtonStartIcon, {
|
|
526
|
+
const startIcon = (startIconProp || loading && loadingPosition === 'start') && /*#__PURE__*/_jsx(ButtonStartIcon, {
|
|
352
527
|
className: classes.startIcon,
|
|
353
528
|
ownerState: ownerState,
|
|
354
|
-
children: startIconProp
|
|
529
|
+
children: startIconProp || /*#__PURE__*/_jsx(ButtonLoadingIconPlaceholder, {
|
|
530
|
+
className: classes.loadingIconPlaceholder,
|
|
531
|
+
ownerState: ownerState
|
|
532
|
+
})
|
|
355
533
|
});
|
|
356
|
-
const endIcon = endIconProp && /*#__PURE__*/_jsx(ButtonEndIcon, {
|
|
534
|
+
const endIcon = (endIconProp || loading && loadingPosition === 'end') && /*#__PURE__*/_jsx(ButtonEndIcon, {
|
|
357
535
|
className: classes.endIcon,
|
|
358
536
|
ownerState: ownerState,
|
|
359
|
-
children: endIconProp
|
|
537
|
+
children: endIconProp || /*#__PURE__*/_jsx(ButtonLoadingIconPlaceholder, {
|
|
538
|
+
className: classes.loadingIconPlaceholder,
|
|
539
|
+
ownerState: ownerState
|
|
540
|
+
})
|
|
360
541
|
});
|
|
361
542
|
const positionClassName = buttonGroupButtonContextPositionClassName || '';
|
|
543
|
+
const loader = typeof loading === 'boolean' ?
|
|
544
|
+
/*#__PURE__*/
|
|
545
|
+
// use plain HTML span to minimize the runtime overhead
|
|
546
|
+
_jsx("span", {
|
|
547
|
+
className: classes.loadingWrapper,
|
|
548
|
+
style: {
|
|
549
|
+
display: 'contents'
|
|
550
|
+
},
|
|
551
|
+
children: loading && /*#__PURE__*/_jsx(ButtonLoadingIndicator, {
|
|
552
|
+
className: classes.loadingIndicator,
|
|
553
|
+
ownerState: ownerState,
|
|
554
|
+
children: loadingIndicator
|
|
555
|
+
})
|
|
556
|
+
}) : null;
|
|
362
557
|
return /*#__PURE__*/_jsxs(ButtonRoot, {
|
|
363
558
|
ownerState: ownerState,
|
|
364
559
|
className: clsx(contextProps.className, classes.root, className, positionClassName),
|
|
365
560
|
component: component,
|
|
366
|
-
disabled: disabled,
|
|
561
|
+
disabled: disabled || loading,
|
|
367
562
|
focusRipple: !disableFocusRipple,
|
|
368
563
|
focusVisibleClassName: clsx(classes.focusVisible, focusVisibleClassName),
|
|
369
564
|
ref: ref,
|
|
370
565
|
type: type,
|
|
566
|
+
id: id,
|
|
371
567
|
...other,
|
|
372
568
|
classes: classes,
|
|
373
|
-
children: [startIcon, children, endIcon]
|
|
569
|
+
children: [startIcon, loadingPosition !== 'end' && loader, children, loadingPosition === 'end' && loader, endIcon]
|
|
374
570
|
});
|
|
375
571
|
});
|
|
376
572
|
process.env.NODE_ENV !== "production" ? Button.propTypes /* remove-proptypes */ = {
|
|
@@ -443,6 +639,28 @@ process.env.NODE_ENV !== "production" ? Button.propTypes /* remove-proptypes */
|
|
|
443
639
|
* If defined, an `a` element will be used as the root node.
|
|
444
640
|
*/
|
|
445
641
|
href: PropTypes.string,
|
|
642
|
+
/**
|
|
643
|
+
* @ignore
|
|
644
|
+
*/
|
|
645
|
+
id: PropTypes.string,
|
|
646
|
+
/**
|
|
647
|
+
* If `true`, the loading indicator is visible and the button is disabled.
|
|
648
|
+
* If `true | false`, the loading wrapper is always rendered before the children to prevent [Google Translation Crash](https://github.com/mui/material-ui/issues/27853).
|
|
649
|
+
* @default null
|
|
650
|
+
*/
|
|
651
|
+
loading: PropTypes.bool,
|
|
652
|
+
/**
|
|
653
|
+
* Element placed before the children if the button is in loading state.
|
|
654
|
+
* The node should contain an element with `role="progressbar"` with an accessible name.
|
|
655
|
+
* By default, it renders a `CircularProgress` that is labeled by the button itself.
|
|
656
|
+
* @default <CircularProgress color="inherit" size={16} />
|
|
657
|
+
*/
|
|
658
|
+
loadingIndicator: PropTypes.node,
|
|
659
|
+
/**
|
|
660
|
+
* The loading indicator can be positioned on the start, end, or the center of the button.
|
|
661
|
+
* @default 'center'
|
|
662
|
+
*/
|
|
663
|
+
loadingPosition: PropTypes.oneOf(['center', 'end', 'start']),
|
|
446
664
|
/**
|
|
447
665
|
* The size of the component.
|
|
448
666
|
* `small` is equivalent to the dense button styling.
|
|
@@ -173,6 +173,20 @@ export interface ButtonClasses {
|
|
|
173
173
|
colorInfo: string;
|
|
174
174
|
/** Styles applied to the root element if `color="warning"`. */
|
|
175
175
|
colorWarning: string;
|
|
176
|
+
/** Styles applied to the root element if `loading={true}`. */
|
|
177
|
+
loading: string;
|
|
178
|
+
/** Styles applied to the loadingWrapper element. */
|
|
179
|
+
loadingWrapper: string;
|
|
180
|
+
/** Styles applied to the loadingIconPlaceholder element. */
|
|
181
|
+
loadingIconPlaceholder: string;
|
|
182
|
+
/** Styles applied to the loadingIndicator element. */
|
|
183
|
+
loadingIndicator: string;
|
|
184
|
+
/** Styles applied to the root element if `loadingPosition="center"`. */
|
|
185
|
+
loadingPositionCenter: string;
|
|
186
|
+
/** Styles applied to the root element if `loadingPosition="start"`. */
|
|
187
|
+
loadingPositionStart: string;
|
|
188
|
+
/** Styles applied to the root element if `loadingPosition="end"`. */
|
|
189
|
+
loadingPositionEnd: string;
|
|
176
190
|
}
|
|
177
191
|
export type ButtonClassKey = keyof ButtonClasses;
|
|
178
192
|
export declare function getButtonUtilityClass(slot: string): string;
|
package/Button/buttonClasses.js
CHANGED
|
@@ -3,5 +3,5 @@ import generateUtilityClass from '@mui/utils/generateUtilityClass';
|
|
|
3
3
|
export function getButtonUtilityClass(slot) {
|
|
4
4
|
return generateUtilityClass('MuiButton', slot);
|
|
5
5
|
}
|
|
6
|
-
const buttonClasses = 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', 'colorPrimary', 'colorSecondary', 'colorSuccess', 'colorError', 'colorInfo', 'colorWarning', 'textSizeSmall', 'textSizeMedium', 'textSizeLarge', 'outlinedSizeSmall', 'outlinedSizeMedium', 'outlinedSizeLarge', 'containedSizeSmall', 'containedSizeMedium', 'containedSizeLarge', 'sizeMedium', 'sizeSmall', 'sizeLarge', 'fullWidth', 'startIcon', 'endIcon', 'icon', 'iconSizeSmall', 'iconSizeMedium', 'iconSizeLarge']);
|
|
6
|
+
const buttonClasses = 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', 'colorPrimary', 'colorSecondary', 'colorSuccess', 'colorError', 'colorInfo', 'colorWarning', 'textSizeSmall', 'textSizeMedium', 'textSizeLarge', 'outlinedSizeSmall', 'outlinedSizeMedium', 'outlinedSizeLarge', 'containedSizeSmall', 'containedSizeMedium', 'containedSizeLarge', 'sizeMedium', 'sizeSmall', 'sizeLarge', 'fullWidth', 'startIcon', 'endIcon', 'icon', 'iconSizeSmall', 'iconSizeMedium', 'iconSizeLarge', 'loading', 'loadingWrapper', 'loadingIconPlaceholder', 'loadingIndicator', 'loadingPositionCenter', 'loadingPositionStart', 'loadingPositionEnd']);
|
|
7
7
|
export default buttonClasses;
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,90 @@
|
|
|
1
1
|
# [Versions](https://mui.com/versions/)
|
|
2
2
|
|
|
3
|
+
## 6.4.0
|
|
4
|
+
|
|
5
|
+
<!-- generated comparing v6.3.1..master -->
|
|
6
|
+
|
|
7
|
+
_Jan 13, 2025_
|
|
8
|
+
|
|
9
|
+
A big thanks to the 16 contributors who made this release possible. Here are some highlights ✨:
|
|
10
|
+
|
|
11
|
+
- Added [`loading` prop](https://mui.com/material-ui/react-button/#loading-2) to the `Button` and `IconButton` components (#44637) @siriwatknp
|
|
12
|
+
|
|
13
|
+
### `@mui/material@6.4.0`
|
|
14
|
+
|
|
15
|
+
- [Alert] complete `slots` and `slotProps` (#44971) @siriwatknp
|
|
16
|
+
- [Autocomplete] Sync runtime and TS types for key in grouped options (#44862) @aarongarciah
|
|
17
|
+
- [Button] Add `loading` prop (#44637) @siriwatknp
|
|
18
|
+
- [CardHeader] Deprecate `*TypographyProps` and complete `slots`, `slotProps` (#44729) @siriwatknp
|
|
19
|
+
- [CircularProgress] Improve indeterminate animation to be symmetric and smooth (#44934) @yashdev16
|
|
20
|
+
- [LinearProgress] Deprecate composed classes (#44933) @headironc
|
|
21
|
+
- [Link] Fix error for using custom palette with underline (#44927) @siriwatknp
|
|
22
|
+
- [Select] Do not set `aria-controls` when closed (#44919) @siddhantantil39
|
|
23
|
+
- [Select] Add missing root class (#44928) @sai6855
|
|
24
|
+
- [Slider] Set onChangeCommitted to receive the last argument passed to onChange (#44795) @good-jinu
|
|
25
|
+
- Add `mergeSlotProps` for extending components (#44809) @siriwatknp
|
|
26
|
+
- Update `mergeSlotProps` to merge `style` (#44959) @siriwatknp
|
|
27
|
+
- Fix slots typing for Tooltip and StepLabel (#44985) @siriwatknp
|
|
28
|
+
- Remove unnecessary blank lines (#44980) @sai6855
|
|
29
|
+
|
|
30
|
+
### Docs
|
|
31
|
+
|
|
32
|
+
- [docs] Fix Dashboard sidenav sroll (#44876) @oliviertassinari
|
|
33
|
+
- [docs] Fix broken anchor link to w3.org (c51af8e) @oliviertassinari
|
|
34
|
+
- [docs] Add details on complementary Menu components (#44957) @samuelsycamore
|
|
35
|
+
- [docs] Remove misleading messaging on MD3 support (#44953) @mnajdova
|
|
36
|
+
- [docs] Fix code copy button obscuring on small screen sizes (#44861) @ZeeshanTamboli
|
|
37
|
+
- [docs] Remove more instances of Adobe XD (#44956) @samuelsycamore
|
|
38
|
+
- [docs] Remove Adobe XD chips, links, and mentions (#44909) @samuelsycamore
|
|
39
|
+
- [docs] Fix incorrect rendering in Typography docs (#44937) @iaziz11
|
|
40
|
+
|
|
41
|
+
### Core
|
|
42
|
+
|
|
43
|
+
- [core] Remove redundant screenshots (#44877) @oliviertassinari
|
|
44
|
+
- [core] Remove Suspense and clock mocking from regressions and e2e tests (#44935) @DiegoAndai
|
|
45
|
+
- [code-infra] Allow react@18 on `@mui/internal-test-utils` (#45023) @LukasTy
|
|
46
|
+
- [code-infra] Stabilize flaky pigment progressbar tests (#44969) @Janpot
|
|
47
|
+
- [example] Update the CDN example to adapt React 19. (#44979) @IceOfSummer
|
|
48
|
+
- [figma] Clarify that Material UI Sync plugin is experimental (#44975) @oliviertassinari
|
|
49
|
+
|
|
50
|
+
All contributors of this release in alphabetical order: @aarongarciah, @DiegoAndai, @good-jinu, @headironc, @iaziz11, @IceOfSummer, @Janpot, @LukasTy, @mnajdova, @oliviertassinari, @sai6855, @samuelsycamore, @siddhantantil39, @siriwatknp, @yashdev16, @ZeeshanTamboli
|
|
51
|
+
|
|
52
|
+
## 6.3.1
|
|
53
|
+
|
|
54
|
+
<!-- generated comparing v6.3.0..master -->
|
|
55
|
+
|
|
56
|
+
_Jan 3, 2025_
|
|
57
|
+
|
|
58
|
+
A big thanks to the 8 contributors who made this release possible.
|
|
59
|
+
|
|
60
|
+
### `@mui/material@6.3.1`
|
|
61
|
+
|
|
62
|
+
- [Autocomplete] Revert: Fix options list rendering in freeSolo mode (#44858) @ZeeshanTamboli
|
|
63
|
+
- [Tooltip] Warn instead of error when trigger is disabled (#44846) @yash49
|
|
64
|
+
- [TableSortLabel] Add slots and slotProps (#44728) @sai6855
|
|
65
|
+
- [Select] Deprecate composed classes (#44925) @sai6855
|
|
66
|
+
|
|
67
|
+
### Docs
|
|
68
|
+
|
|
69
|
+
- [material-ui][Accordion] Update `Anatomy` section in Accordion docs (#44849) @ZeeshanTamboli
|
|
70
|
+
- [material-ui][CardActionArea] Added demo in docs of cards for adding props to CardActionArea (#44789) @siddhantantil39
|
|
71
|
+
- [material-ui][Grid2] Add interactive demo for Grid v2 (#44820) @yash49
|
|
72
|
+
- [material-ui][Select] Update docs to reflect the omission of placeholder prop (#44856) @adityaparab
|
|
73
|
+
- [joy-ui] Fix Color mode button on Theme builder (#44864) @komkanit
|
|
74
|
+
- Fix 301 redirections @oliviertassinari
|
|
75
|
+
|
|
76
|
+
### Core
|
|
77
|
+
|
|
78
|
+
- [examples] Update Next.js examples Next.js and React versions (#44852) @DiegoAndai
|
|
79
|
+
- [code-infra] Prevent wrong nested imports in Base UI (#44426) @oliviertassinari
|
|
80
|
+
- [docs-infra] Add vale coverage for App Router and Page Router (060c55c) @oliviertassinari
|
|
81
|
+
- Sync with other repos (1b9300f) @oliviertassinari
|
|
82
|
+
- Fix docs:build to work in docs folder too (6b923a4) @oliviertassinari
|
|
83
|
+
- Setup React 18 CI tests (#44868) @DiegoAndai
|
|
84
|
+
- Update test to use public API (#44875) @oliviertassinari
|
|
85
|
+
|
|
86
|
+
All contributors of this release in alphabetical order: @adityaparab, @DiegoAndai, @komkanit, @oliviertassinari, @sai6855, @siddhantantil39, @yash49, @ZeeshanTamboli
|
|
87
|
+
|
|
3
88
|
## 6.3.0
|
|
4
89
|
|
|
5
90
|
<!-- generated comparing v6.2.1..master -->
|
|
@@ -3,8 +3,116 @@ import { SxProps } from '@mui/system';
|
|
|
3
3
|
import { TypographyProps } from '../Typography';
|
|
4
4
|
import { OverridableComponent, OverrideProps } from '../OverridableComponent';
|
|
5
5
|
import { Theme } from '..';
|
|
6
|
+
import { CreateSlotsAndSlotProps, SlotProps } from '../utils/types';
|
|
6
7
|
import { CardHeaderClasses } from './cardHeaderClasses';
|
|
7
8
|
|
|
9
|
+
export interface CardHeaderRootSlotPropsOverrides {}
|
|
10
|
+
|
|
11
|
+
export interface CardHeaderAvatarSlotPropsOverrides {}
|
|
12
|
+
|
|
13
|
+
export interface CardHeaderActionSlotPropsOverrides {}
|
|
14
|
+
|
|
15
|
+
export interface CardHeaderContentSlotPropsOverrides {}
|
|
16
|
+
|
|
17
|
+
export interface CardHeaderTitleSlotPropsOverrides {}
|
|
18
|
+
|
|
19
|
+
export interface CardHeaderSubheaderSlotPropsOverrides {}
|
|
20
|
+
|
|
21
|
+
export interface CardHeaderSlots {
|
|
22
|
+
/**
|
|
23
|
+
* The component that renders the root slot.
|
|
24
|
+
* @default 'div'
|
|
25
|
+
*/
|
|
26
|
+
root: React.ElementType;
|
|
27
|
+
/**
|
|
28
|
+
* The component that renders the avatar slot.
|
|
29
|
+
* @default 'div'
|
|
30
|
+
*/
|
|
31
|
+
avatar: React.ElementType;
|
|
32
|
+
/**
|
|
33
|
+
* The component that renders the action slot.
|
|
34
|
+
* @default 'div'
|
|
35
|
+
*/
|
|
36
|
+
action: React.ElementType;
|
|
37
|
+
/**
|
|
38
|
+
* The component that renders the content slot.
|
|
39
|
+
* @default 'div'
|
|
40
|
+
*/
|
|
41
|
+
content: React.ElementType;
|
|
42
|
+
/**
|
|
43
|
+
* The component that renders the title slot (as long as disableTypography is not `true`).
|
|
44
|
+
* [Follow this guide](https://mui.com/material-ui/api/typography/#props) to learn more about the requirements for this component.
|
|
45
|
+
* @default Typography
|
|
46
|
+
*/
|
|
47
|
+
title: React.ElementType;
|
|
48
|
+
/**
|
|
49
|
+
* The component that renders the subheader slot (as long as disableTypography is not `true`).
|
|
50
|
+
* [Follow this guide](https://mui.com/material-ui/api/typography/#props) to learn more about the requirements for this component.
|
|
51
|
+
* @default Typography
|
|
52
|
+
*/
|
|
53
|
+
subheader: React.ElementType;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export type CardHeaderSlotsAndSlotProps = CreateSlotsAndSlotProps<
|
|
57
|
+
CardHeaderSlots,
|
|
58
|
+
{
|
|
59
|
+
/**
|
|
60
|
+
* Props forwarded to the root slot.
|
|
61
|
+
* By default, the avaible props are based on the div element.
|
|
62
|
+
*/
|
|
63
|
+
root: SlotProps<
|
|
64
|
+
React.ElementType<React.DetailsHTMLAttributes<HTMLDivElement>>,
|
|
65
|
+
CardHeaderRootSlotPropsOverrides,
|
|
66
|
+
CardHeaderOwnerState
|
|
67
|
+
>;
|
|
68
|
+
/**
|
|
69
|
+
* Props forwarded to the avatar slot.
|
|
70
|
+
* By default, the avaible props are based on the div element.
|
|
71
|
+
*/
|
|
72
|
+
avatar: SlotProps<
|
|
73
|
+
React.ElementType<React.DetailsHTMLAttributes<HTMLDivElement>>,
|
|
74
|
+
CardHeaderAvatarSlotPropsOverrides,
|
|
75
|
+
CardHeaderOwnerState
|
|
76
|
+
>;
|
|
77
|
+
/**
|
|
78
|
+
* Props forwarded to the action slot.
|
|
79
|
+
* By default, the avaible props are based on the div element.
|
|
80
|
+
*/
|
|
81
|
+
action: SlotProps<
|
|
82
|
+
React.ElementType<React.DetailsHTMLAttributes<HTMLDivElement>>,
|
|
83
|
+
CardHeaderActionSlotPropsOverrides,
|
|
84
|
+
CardHeaderOwnerState
|
|
85
|
+
>;
|
|
86
|
+
/**
|
|
87
|
+
* Props forwarded to the content slot.
|
|
88
|
+
* By default, the avaible props are based on the div element.
|
|
89
|
+
*/
|
|
90
|
+
content: SlotProps<
|
|
91
|
+
React.ElementType<React.DetailsHTMLAttributes<HTMLDivElement>>,
|
|
92
|
+
CardHeaderContentSlotPropsOverrides,
|
|
93
|
+
CardHeaderOwnerState
|
|
94
|
+
>;
|
|
95
|
+
/**
|
|
96
|
+
* Props forwarded to the title slot (as long as disableTypography is not `true`).
|
|
97
|
+
* By default, the avaible props are based on the [Typography](https://mui.com/material-ui/api/typography/#props) component.
|
|
98
|
+
*/
|
|
99
|
+
title: SlotProps<
|
|
100
|
+
React.ElementType<TypographyProps>,
|
|
101
|
+
CardHeaderTitleSlotPropsOverrides,
|
|
102
|
+
CardHeaderOwnerState
|
|
103
|
+
>;
|
|
104
|
+
/**
|
|
105
|
+
* Props forwarded to the subheader slot (as long as disableTypography is not `true`).
|
|
106
|
+
* By default, the avaible props are based on the [Typography](https://mui.com/material-ui/api/typography/#props) component.
|
|
107
|
+
*/
|
|
108
|
+
subheader: SlotProps<
|
|
109
|
+
React.ElementType<TypographyProps>,
|
|
110
|
+
CardHeaderSubheaderSlotPropsOverrides,
|
|
111
|
+
CardHeaderOwnerState
|
|
112
|
+
>;
|
|
113
|
+
}
|
|
114
|
+
>;
|
|
115
|
+
|
|
8
116
|
export interface CardHeaderOwnProps<
|
|
9
117
|
TitleTypographyComponent extends React.ElementType = 'span',
|
|
10
118
|
SubheaderTypographyComponent extends React.ElementType = 'span',
|
|
@@ -36,6 +144,7 @@ export interface CardHeaderOwnProps<
|
|
|
36
144
|
/**
|
|
37
145
|
* These props will be forwarded to the subheader
|
|
38
146
|
* (as long as disableTypography is not `true`).
|
|
147
|
+
* @deprecated Use `slotProps.subheader` instead. This prop will be removed in v7. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
39
148
|
*/
|
|
40
149
|
subheaderTypographyProps?: TypographyProps<
|
|
41
150
|
SubheaderTypographyComponent,
|
|
@@ -54,6 +163,7 @@ export interface CardHeaderOwnProps<
|
|
|
54
163
|
/**
|
|
55
164
|
* These props will be forwarded to the title
|
|
56
165
|
* (as long as disableTypography is not `true`).
|
|
166
|
+
* @deprecated Use `slotProps.title` instead. This prop will be removed in v7. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
57
167
|
*/
|
|
58
168
|
titleTypographyProps?: TypographyProps<
|
|
59
169
|
TitleTypographyComponent,
|
|
@@ -63,6 +173,8 @@ export interface CardHeaderOwnProps<
|
|
|
63
173
|
>;
|
|
64
174
|
}
|
|
65
175
|
|
|
176
|
+
export interface CardHeaderOwnerState extends CardHeaderOwnProps {}
|
|
177
|
+
|
|
66
178
|
export interface CardHeaderTypeMap<
|
|
67
179
|
AdditionalProps = {},
|
|
68
180
|
RootComponent extends React.ElementType = 'div',
|
|
@@ -70,7 +182,8 @@ export interface CardHeaderTypeMap<
|
|
|
70
182
|
SubheaderTypographyComponent extends React.ElementType = 'span',
|
|
71
183
|
> {
|
|
72
184
|
props: AdditionalProps &
|
|
73
|
-
CardHeaderOwnProps<TitleTypographyComponent, SubheaderTypographyComponent
|
|
185
|
+
CardHeaderOwnProps<TitleTypographyComponent, SubheaderTypographyComponent> &
|
|
186
|
+
CardHeaderSlotsAndSlotProps;
|
|
74
187
|
defaultComponent: RootComponent;
|
|
75
188
|
}
|
|
76
189
|
/**
|