@mui/docs 6.0.0-beta.3 → 6.0.0-beta.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.
@@ -0,0 +1,89 @@
1
+ import { alpha } from '@mui/material/styles';
2
+ export const adBodyImageStyles = theme => ({
3
+ root: {
4
+ display: 'block',
5
+ overflow: 'hidden',
6
+ border: '1px dashed',
7
+ borderColor: theme.palette.divider,
8
+ borderRadius: theme.shape.borderRadius,
9
+ padding: '8px 8px 8px calc(8px + 130px)',
10
+ [theme.breakpoints.up('sm')]: {
11
+ padding: '12px 12px 12px calc(12px + 130px)'
12
+ }
13
+ },
14
+ imgWrapper: {
15
+ float: 'left',
16
+ marginLeft: -130,
17
+ width: 130,
18
+ height: 100
19
+ },
20
+ img: {
21
+ verticalAlign: 'middle'
22
+ },
23
+ a: {
24
+ color: theme.palette.text.primary,
25
+ textDecoration: 'none'
26
+ },
27
+ description: {
28
+ ...theme.typography.body2,
29
+ [theme.breakpoints.up('sm')]: {
30
+ ...theme.typography.body1
31
+ },
32
+ display: 'block',
33
+ marginLeft: theme.spacing(1.5)
34
+ },
35
+ poweredby: {
36
+ ...theme.typography.caption,
37
+ marginLeft: theme.spacing(1.5),
38
+ color: theme.palette.text.secondary,
39
+ display: 'block',
40
+ marginTop: theme.spacing(0.5),
41
+ fontWeight: theme.typography.fontWeightRegular
42
+ }
43
+ });
44
+ export const adBodyInlineStyles = theme => {
45
+ const baseline = adBodyImageStyles(theme);
46
+ return {
47
+ ...baseline,
48
+ root: {
49
+ display: 'block',
50
+ paddingTop: 8
51
+ },
52
+ imgWrapper: {
53
+ display: 'none'
54
+ },
55
+ description: {
56
+ ...baseline.description,
57
+ marginLeft: 0,
58
+ '&::before': {
59
+ border: '1px solid #3e8e41',
60
+ color: '#3e8e41',
61
+ marginRight: 6,
62
+ padding: '1px 5px',
63
+ borderRadius: 3,
64
+ content: '"Ad"',
65
+ fontSize: theme.typography.pxToRem(14)
66
+ },
67
+ '&::after': {
68
+ // Link
69
+ marginLeft: 4,
70
+ content: '"Get started"',
71
+ // Style taken from the Link component & MarkdownElement.
72
+ color: theme.palette.primary[600],
73
+ textDecoration: 'underline',
74
+ textDecorationColor: alpha(theme.palette.primary.main, 0.4),
75
+ ...theme.applyStyles('dark', {
76
+ color: theme.palette.primary[300]
77
+ })
78
+ }
79
+ },
80
+ poweredby: {
81
+ ...baseline.poweredby,
82
+ marginTop: 2,
83
+ marginLeft: 0
84
+ },
85
+ link: {
86
+ display: 'none'
87
+ }
88
+ };
89
+ };
package/Ad/index.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ export * from './Ad';
2
+ export * from './AdManager';
3
+ export * from './AdProvider';
4
+ export * from './AdGuest';
5
+ export { AdCarbonInline } from './AdCarbon';
package/Ad/index.js ADDED
@@ -0,0 +1,7 @@
1
+ /// <reference types="gtag.js" />
2
+
3
+ export * from './Ad';
4
+ export * from './AdManager';
5
+ export * from './AdProvider';
6
+ export * from './AdGuest';
7
+ export { AdCarbonInline } from './AdCarbon';
@@ -0,0 +1,6 @@
1
+ {
2
+ "sideEffects": false,
3
+ "module": "./index.js",
4
+ "main": "../node/Ad/index.js",
5
+ "types": "./index.d.ts"
6
+ }
package/CHANGELOG.md CHANGED
@@ -1,5 +1,46 @@
1
1
  # [Versions](https://mui.com/versions/)
2
2
 
3
+ ## 6.0.0-beta.4
4
+
5
+ <!-- generated comparing v6.0.0-beta.3..next -->
6
+
7
+ _Jul 30, 2024_
8
+
9
+ A big thanks to the 12 contributors who made this release possible.
10
+
11
+ ### `@mui/material@6.0.0-beta.4`
12
+
13
+ - [Accordion] Render a heading wrapping `AccordionSummary` button per W3C Accordion Pattern standards (#42914) @ZeeshanTamboli
14
+ - [Divider] Enable borderStyle enhancement in divider with children (#42715) @anuujj
15
+ - [ImageListItemBar] Deprecate composed classes (#42905) @sai6855
16
+ - Attach selector for default color scheme (#43035) @siriwatknp
17
+ - Stabilize Grid v2 and deprecate Grid v1 (#43054) @DiegoAndai
18
+
19
+ ### `@mui/system@6.0.0-beta.4`
20
+
21
+ - Make `createBreakpoints` independent for stringify theme (#43048) @siriwatknp
22
+
23
+ ### `@mui/utils@6.0.0-beta.4`
24
+
25
+ - Fix issues reported by the React Compiler (#43051) @markliu2013
26
+
27
+ ### Docs
28
+
29
+ - [material-ui] Replace deprecated `<ListItem button/>` with `ListItemButton` component in routing libraries list example (#43110) @aliharis99
30
+ - [material-ui][Card] Update CardMedia description (#43067) @shahzaibdev1
31
+ - [material-ui] Polish out data table demo (#43072) @zanivan
32
+ - [material-ui][Snackbar] Improve reason type in demos (#43077) @sai6855
33
+ - [pigment-css] Fix syntax in migrating-to-pigment-css guide (#43107) @KevinVandy
34
+ - Fix page description line break @oliviertassinari
35
+
36
+ ### Core
37
+
38
+ - Fix event naming convention @oliviertassinari
39
+ - [docs-infra] Move ads to the `@mui/docs` package (#42944) @alexfauquette
40
+ - [website] Fine-tune button styles on the branding theme (#43082) @zanivan
41
+
42
+ All contributors of this release in alphabetical order: @alexfauquette, @aliharis99, @anuujj, @DiegoAndai, @KevinVandy, @markliu2013, @oliviertassinari, @sai6855, @shahzaibdev1, @siriwatknp, @zanivan, @ZeeshanTamboli
43
+
3
44
  ## 6.0.0-beta.3
4
45
 
5
46
  <!-- generated comparing v6.0.0-beta.2..next -->
@@ -1,5 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { Translations } from '../i18n';
3
+ import { AdConfig } from '../Ad';
3
4
  export interface DocsConfig {
4
5
  LANGUAGES: string[];
5
6
  LANGUAGES_SSR: string[];
@@ -8,9 +9,10 @@ export interface DocsConfig {
8
9
  }
9
10
  export interface DocsProviderProps {
10
11
  config: DocsConfig;
12
+ adConfig?: Partial<AdConfig>;
11
13
  defaultUserLanguage: string;
12
14
  children?: React.ReactNode;
13
15
  translations?: Translations;
14
16
  }
15
- export declare function DocsProvider({ config, defaultUserLanguage, translations, children, }: DocsProviderProps): React.JSX.Element;
17
+ export declare function DocsProvider({ config, adConfig, defaultUserLanguage, translations, children, }: DocsProviderProps): React.JSX.Element;
16
18
  export declare function useDocsConfig(): DocsConfig;
@@ -1,19 +1,24 @@
1
1
  import * as React from 'react';
2
2
  import { UserLanguageProvider } from '../i18n';
3
+ import { AdProvider } from '../Ad';
3
4
  import { jsx as _jsx } from "react/jsx-runtime";
4
5
  const DocsConfigContext = /*#__PURE__*/React.createContext(null);
5
6
  export function DocsProvider({
6
7
  config,
8
+ adConfig,
7
9
  defaultUserLanguage,
8
10
  translations,
9
11
  children
10
12
  }) {
11
13
  return /*#__PURE__*/_jsx(DocsConfigContext.Provider, {
12
14
  value: config,
13
- children: /*#__PURE__*/_jsx(UserLanguageProvider, {
14
- defaultUserLanguage: defaultUserLanguage,
15
- translations: translations,
16
- children: children
15
+ children: /*#__PURE__*/_jsx(AdProvider, {
16
+ config: adConfig,
17
+ children: /*#__PURE__*/_jsx(UserLanguageProvider, {
18
+ defaultUserLanguage: defaultUserLanguage,
19
+ translations: translations,
20
+ children: children
21
+ })
17
22
  })
18
23
  });
19
24
  }
@@ -438,9 +438,9 @@ export function getThemedComponents() {
438
438
  transition: 'all 120ms ease-in',
439
439
  ...(ownerState.size === 'large' && {
440
440
  ...theme.typography.body1,
441
- lineHeight: 21 / 16,
442
- padding: theme.spacing('8px', '10px', '10px', '12px'),
441
+ lineHeight: 1.5,
443
442
  fontWeight: theme.typography.fontWeightMedium,
443
+ padding: theme.spacing('8px', '12px', '8px', '14px'),
444
444
  borderRadius: 10,
445
445
  '& > span': {
446
446
  transition: '0.2s',
@@ -452,9 +452,10 @@ export function getThemedComponents() {
452
452
  }),
453
453
  ...(ownerState.size === 'medium' && {
454
454
  fontSize: defaultTheme.typography.pxToRem(15),
455
- padding: theme.spacing('8px', '12px', '8px', '14px'),
456
455
  fontWeight: theme.typography.fontWeightMedium,
457
- borderRadius: 8,
456
+ lineHeight: 1.25,
457
+ padding: theme.spacing('8px', '10px', '10px', '12px'),
458
+ borderRadius: 10,
458
459
  '& > span': {
459
460
  transition: '0.2s',
460
461
  marginLeft: 4
@@ -464,11 +465,11 @@ export function getThemedComponents() {
464
465
  }
465
466
  }),
466
467
  ...(ownerState.size === 'small' && {
467
- padding: '6px 8px',
468
+ padding: '6px 10px',
468
469
  fontFamily: theme.typography.fontFamily,
469
470
  fontSize: defaultTheme.typography.pxToRem(13),
470
471
  fontWeight: theme.typography.fontWeightMedium,
471
- borderRadius: 8,
472
+ borderRadius: 10,
472
473
  '& .MuiButton-startIcon': {
473
474
  transition: '0.15s',
474
475
  marginRight: 4,
@@ -491,18 +492,24 @@ export function getThemedComponents() {
491
492
  color: (theme.vars || theme).palette.text.primary,
492
493
  backgroundColor: alpha(theme.palette.primaryDark[50], 0.1),
493
494
  borderColor: (theme.vars || theme).palette.primaryDark[100],
494
- boxShadow: `#FFF 0 1px 0 inset, ${alpha(theme.palette.grey[200], 0.4)} 0 -1px 0 inset, ${alpha(theme.palette.grey[200], 0.5)} 0 1px 2px 0`,
495
+ boxShadow: `#FFF 0 1px 0 1px inset, ${alpha(theme.palette.grey[200], 0.4)} 0 -1px 0 1px inset, ${alpha(theme.palette.grey[200], 0.5)} 0 1px 2px 0`,
495
496
  '&:hover': {
496
497
  backgroundColor: (theme.vars || theme).palette.grey[50]
497
498
  },
499
+ '&:active': {
500
+ backgroundColor: (theme.vars || theme).palette.grey[100]
501
+ },
498
502
  ...theme.applyDarkStyles({
499
503
  color: (theme.vars || theme).palette.primaryDark[100],
500
504
  borderColor: alpha(theme.palette.primaryDark[600], 0.5),
501
505
  backgroundColor: alpha(theme.palette.primaryDark[700], 0.2),
502
- boxShadow: `${alpha(theme.palette.primaryDark[600], 0.3)} 0 1px 0 inset, ${(theme.vars || theme).palette.common.black} 0 -1px 0 inset, ${(theme.vars || theme).palette.common.black} 0 1px 2px 0`,
506
+ boxShadow: `${alpha(theme.palette.primaryDark[700], 0.3)} 0 1px 0 1px inset, ${(theme.vars || theme).palette.common.black} 0 -1px 0 1px inset, ${(theme.vars || theme).palette.common.black} 0 1px 2px 0`,
503
507
  '&:hover': {
504
508
  backgroundColor: (theme.vars || theme).palette.primaryDark[700],
505
509
  borderColor: (theme.vars || theme).palette.primaryDark[600]
510
+ },
511
+ '&:active': {
512
+ backgroundColor: (theme.vars || theme).palette.primaryDark[800]
506
513
  }
507
514
  })
508
515
  }),
@@ -510,19 +517,25 @@ export function getThemedComponents() {
510
517
  color: (theme.vars || theme).palette.primary[600],
511
518
  backgroundColor: alpha(theme.palette.primary[50], 0.2),
512
519
  borderColor: (theme.vars || theme).palette.primary[100],
513
- boxShadow: `${alpha(theme.palette.primary[50], 0.8)} 0 2px 0 inset, ${alpha(theme.palette.primary[100], 0.4)} 0 -2px 0 inset, ${alpha(theme.palette.primary[100], 0.5)} 0 1px 2px 0`,
520
+ boxShadow: `${alpha(theme.palette.primary[100], 0.4)} 0 -1px 0 1px inset, ${alpha(theme.palette.primary[100], 0.5)} 0 1px 2px 0`,
514
521
  '&:hover': {
515
522
  backgroundColor: (theme.vars || theme).palette.primary[50],
516
523
  borderColor: (theme.vars || theme).palette.primary[200]
517
524
  },
525
+ '&:active': {
526
+ backgroundColor: alpha(theme.palette.primary[100], 0.7)
527
+ },
518
528
  ...theme.applyDarkStyles({
519
529
  color: (theme.vars || theme).palette.primary[200],
520
530
  borderColor: alpha(theme.palette.primary[900], 0.7),
521
531
  backgroundColor: alpha(theme.palette.primary[900], 0.2),
522
- boxShadow: `${alpha(theme.palette.primary[900], 0.2)} 0 2px 0 inset, ${(theme.vars || theme).palette.common.black} 0 -2px 0 inset, ${(theme.vars || theme).palette.common.black} 0 1px 2px 0`,
532
+ boxShadow: `${alpha(theme.palette.primary[900], 0.2)} 0 1px 0 1px inset, ${(theme.vars || theme).palette.common.black} 0 -1px 0 1px inset, ${(theme.vars || theme).palette.common.black} 0 1px 2px 0`,
523
533
  '&:hover': {
524
- backgroundColor: (theme.vars || theme).palette.primary[900],
525
- borderColor: (theme.vars || theme).palette.primary[700]
534
+ backgroundColor: alpha(theme.palette.primary[900], 0.5),
535
+ borderColor: (theme.vars || theme).palette.primary[900]
536
+ },
537
+ '&:active': {
538
+ backgroundColor: alpha(theme.palette.primary[900], 0.3)
526
539
  }
527
540
  })
528
541
  }),
@@ -530,13 +543,36 @@ export function getThemedComponents() {
530
543
  color: '#fff',
531
544
  textShadow: `0 1px 1px ${alpha(theme.palette.common.black, 0.6)}`,
532
545
  backgroundColor: (theme.vars || theme).palette.primary[500],
533
- backgroundImage: `linear-gradient(180deg, ${alpha(theme.palette.primary[500], 0.6)} 0%, ${theme.palette.primary[600]} 100%)`,
534
- boxShadow: `${theme.palette.primary[400]} 0 2px 0 inset, ${theme.palette.primary[700]} 0 -2px 0 inset, ${alpha(theme.palette.common.black, 0.1)} 0 2px 4px 0`,
546
+ backgroundImage: 'transparent',
547
+ border: '1px solid ',
548
+ borderColor: (theme.vars || theme).palette.primary[600],
549
+ boxShadow: `${alpha(theme.palette.primary[400], 0.5)} 0 1px 0 inset, ${alpha(theme.palette.primary[800], 0.4)} 0 -1px 0 1px inset, ${alpha(theme.palette.common.black, 0.1)} 0 2px 4px 0`,
535
550
  '&:hover': {
536
- backgroundColor: (theme.vars || theme).palette.primary[700]
551
+ backgroundColor: (theme.vars || theme).palette.primary[700],
552
+ borderColor: (theme.vars || theme).palette.primary[800]
537
553
  },
538
554
  '&:active': {
539
- backgroundColor: (theme.vars || theme).palette.primaryDark[700]
555
+ backgroundColor: (theme.vars || theme).palette.primary[800],
556
+ borderColor: (theme.vars || theme).palette.primary[600],
557
+ boxShadow: `${alpha(theme.palette.primary[900], 0.7)} 0 1px 0 1px inset`
558
+ }
559
+ }),
560
+ ...(ownerState.variant === 'contained' && ownerState.color === 'secondary' && {
561
+ color: '#fff',
562
+ textShadow: `0 1px 1px ${alpha(theme.palette.common.black, 0.6)}`,
563
+ backgroundColor: (theme.vars || theme).palette.primaryDark[500],
564
+ backgroundImage: 'transparent',
565
+ border: '1px solid ',
566
+ borderColor: (theme.vars || theme).palette.primaryDark[600],
567
+ boxShadow: `${alpha(theme.palette.primaryDark[400], 0.5)} 0 1px 0 1px inset, ${alpha(theme.palette.primaryDark[800], 0.7)} 0 -1px 0 1px inset, ${alpha(theme.palette.common.black, 0.1)} 0 2px 4px 0`,
568
+ '&:hover': {
569
+ backgroundColor: (theme.vars || theme).palette.primaryDark[600],
570
+ borderColor: (theme.vars || theme).palette.primaryDark[700]
571
+ },
572
+ '&:active': {
573
+ backgroundColor: (theme.vars || theme).palette.primaryDark[700],
574
+ borderColor: (theme.vars || theme).palette.primaryDark[600],
575
+ boxShadow: `${alpha(theme.palette.primaryDark[900], 0.7)} 0 1px 0 1px inset`
540
576
  }
541
577
  }),
542
578
  ...(ownerState.variant === 'text' && ownerState.color === 'secondary' && {
@@ -558,8 +594,20 @@ export function getThemedComponents() {
558
594
  }),
559
595
  ...(ownerState.variant === 'text' && ownerState.color === 'primary' && {
560
596
  color: (theme.vars || theme).palette.primary[600],
597
+ '&:hover': {
598
+ backgroundColor: alpha(theme.palette.primary[100], 0.3)
599
+ },
600
+ '&:active': {
601
+ backgroundColor: alpha(theme.palette.primary[100], 0.5)
602
+ },
561
603
  ...theme.applyDarkStyles({
562
- color: (theme.vars || theme).palette.primary[300]
604
+ color: (theme.vars || theme).palette.primary[300],
605
+ '&:hover': {
606
+ backgroundColor: alpha(theme.palette.primary[900], 0.3)
607
+ },
608
+ '&:active': {
609
+ backgroundColor: alpha(theme.palette.primary[900], 0.1)
610
+ }
563
611
  })
564
612
  })
565
613
  })
@@ -713,6 +761,12 @@ export function getThemedComponents() {
713
761
  background: alpha(theme.palette.primaryDark[700], 0.8)
714
762
  })
715
763
  },
764
+ '&:active': {
765
+ background: (theme.vars || theme).palette.grey[100],
766
+ ...theme.applyDarkStyles({
767
+ background: theme.palette.primaryDark[800]
768
+ })
769
+ },
716
770
  ...(ownerState.size === 'small' && {
717
771
  height: 32,
718
772
  width: 32,
@@ -735,7 +789,11 @@ export function getThemedComponents() {
735
789
  boxShadow: `#FFF 0 1px 0 inset, ${alpha(theme.palette.grey[200], 0.4)} 0 -1px 0 inset, ${alpha(theme.palette.grey[200], 0.5)} 0 1px 2px 0`,
736
790
  '&:hover': {
737
791
  borderColor: (theme.vars || theme).palette.grey[300],
738
- background: (theme.vars || theme).palette.grey[50]
792
+ background: (theme.vars || theme).palette.grey[50],
793
+ boxShadow: `${alpha(theme.palette.grey[200], 0.5)} 0 1px 2px 0`
794
+ },
795
+ '&:active': {
796
+ background: (theme.vars || theme).palette.grey[100]
739
797
  }
740
798
  }, theme.applyDarkStyles({
741
799
  color: (theme.vars || theme).palette.primary[300],
@@ -744,7 +802,11 @@ export function getThemedComponents() {
744
802
  boxShadow: `${alpha(theme.palette.primaryDark[600], 0.3)} 0 1px 0 inset, ${(theme.vars || theme).palette.common.black} 0 -1px 0 inset, ${(theme.vars || theme).palette.common.black} 0 1px 2px 0`,
745
803
  '&:hover': {
746
804
  borderColor: (theme.vars || theme).palette.primaryDark[600],
747
- background: alpha(theme.palette.primaryDark[700], 0.8)
805
+ background: alpha(theme.palette.primaryDark[700], 0.8),
806
+ boxShadow: `${(theme.vars || theme).palette.common.black} 0 1px 2px 0`
807
+ },
808
+ '&:active': {
809
+ background: theme.palette.primaryDark[800]
748
810
  }
749
811
  })]
750
812
  }, {
@@ -761,7 +823,11 @@ export function getThemedComponents() {
761
823
  '&:hover': {
762
824
  color: (theme.vars || theme).palette.text.primary,
763
825
  borderColor: (theme.vars || theme).palette.grey[300],
764
- background: (theme.vars || theme).palette.grey[50]
826
+ background: (theme.vars || theme).palette.grey[50],
827
+ boxShadow: `${alpha(theme.palette.grey[200], 0.5)} 0 1px 2px 0`
828
+ },
829
+ '&:active': {
830
+ background: (theme.vars || theme).palette.grey[100]
765
831
  }
766
832
  }, theme.applyDarkStyles({
767
833
  borderColor: alpha(theme.palette.primaryDark[600], 0.5),
@@ -769,7 +835,11 @@ export function getThemedComponents() {
769
835
  boxShadow: `${alpha(theme.palette.primaryDark[600], 0.3)} 0 1px 0 inset, ${(theme.vars || theme).palette.common.black} 0 -1px 0 inset, ${(theme.vars || theme).palette.common.black} 0 1px 2px 0`,
770
836
  '&:hover': {
771
837
  borderColor: (theme.vars || theme).palette.primaryDark[600],
772
- background: alpha(theme.palette.primaryDark[700], 0.8)
838
+ background: alpha(theme.palette.primaryDark[700], 0.8),
839
+ boxShadow: `${(theme.vars || theme).palette.common.black} 0 1px 2px 0`
840
+ },
841
+ '&:active': {
842
+ background: theme.palette.primaryDark[800]
773
843
  }
774
844
  })]
775
845
  }]
@@ -1332,6 +1402,24 @@ export function getThemedComponents() {
1332
1402
  // scrollbarGutter: 'stable',
1333
1403
  }
1334
1404
  }
1405
+ },
1406
+ MuiCard: {
1407
+ styleOverrides: {
1408
+ root: ({
1409
+ theme,
1410
+ ownerState
1411
+ }) => ({
1412
+ ...(ownerState.variant === 'elevation' && {
1413
+ border: '1px solid',
1414
+ borderColor: (theme.vars || theme).palette.grey[100],
1415
+ boxShadow: `${alpha(theme.palette.grey[200], 0.4)} 0 -1px 0 inset, ${alpha(theme.palette.grey[300], 0.5)} 0 1px 8px 0`,
1416
+ ...theme.applyDarkStyles({
1417
+ borderColor: (theme.vars || theme).palette.primaryDark[700],
1418
+ boxShadow: `${(theme.vars || theme).palette.common.black} 0 -1px 0 inset, ${(theme.vars || theme).palette.common.black} 0 1px 8px 0`
1419
+ })
1420
+ })
1421
+ })
1422
+ }
1335
1423
  }
1336
1424
  }
1337
1425
  };