@mui/docs 6.0.0-alpha.6 → 6.0.0-alpha.8
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/CHANGELOG.md +84 -2
- package/CodeCopy/CodeCopyButton.js +10 -19
- package/HighlightedCode/HighlightedCode.js +25 -25
- package/InfoCard/InfoCard.js +38 -39
- package/Link/Link.js +40 -38
- package/MarkdownElement/MarkdownElement.js +60 -61
- package/NProgressBar/NProgressBar.js +6 -7
- package/SectionTitle/SectionTitle.d.ts +7 -0
- package/SectionTitle/SectionTitle.js +30 -0
- package/SectionTitle/index.d.ts +1 -0
- package/SectionTitle/index.js +1 -0
- package/SectionTitle/package.json +6 -0
- package/branding/brandingTheme.js +392 -324
- package/node/CodeCopy/CodeCopyButton.js +10 -19
- package/node/HighlightedCode/HighlightedCode.js +25 -25
- package/node/InfoCard/InfoCard.js +38 -39
- package/node/Link/Link.js +43 -40
- package/node/MarkdownElement/MarkdownElement.js +61 -62
- package/node/NProgressBar/NProgressBar.js +6 -7
- package/node/SectionTitle/SectionTitle.js +38 -0
- package/node/SectionTitle/index.js +16 -0
- package/node/branding/brandingTheme.js +392 -324
- package/node/svgIcons/FileDownload.js +3 -3
- package/node/svgIcons/JavaScript.js +3 -3
- package/node/svgIcons/TypeScript.js +3 -3
- package/package.json +3 -3
- package/svgIcons/FileDownload.js +3 -3
- package/svgIcons/JavaScript.js +3 -3
- package/svgIcons/TypeScript.js +3 -3
- package/tsconfig.build.tsbuildinfo +1 -1
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
-
const _excluded = ["className", "renderedMarkdown"];
|
|
4
1
|
import * as React from 'react';
|
|
5
2
|
import clsx from 'clsx';
|
|
6
3
|
import { alpha, darken, styled } from '@mui/material/styles';
|
|
@@ -8,7 +5,8 @@ import { brandingDarkTheme as darkTheme, brandingLightTheme as lightTheme } from
|
|
|
8
5
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
6
|
const Root = styled('div')(({
|
|
10
7
|
theme
|
|
11
|
-
}) =>
|
|
8
|
+
}) => ({
|
|
9
|
+
...lightTheme.typography.body1,
|
|
12
10
|
lineHeight: 1.6,
|
|
13
11
|
// Increased compared to the 1.5 default to make the docs easier to read.
|
|
14
12
|
color: `var(--muidocs-palette-text-primary, ${lightTheme.palette.text.primary})`,
|
|
@@ -41,11 +39,12 @@ const Root = styled('div')(({
|
|
|
41
39
|
maxWidth: 'calc(100vw - 32px - 16px)'
|
|
42
40
|
}
|
|
43
41
|
},
|
|
44
|
-
'& code':
|
|
42
|
+
'& code': {
|
|
43
|
+
...lightTheme.typography.body2,
|
|
45
44
|
fontFamily: lightTheme.typography.fontFamilyCode,
|
|
46
45
|
fontWeight: 400,
|
|
47
46
|
WebkitFontSmoothing: 'subpixel-antialiased'
|
|
48
|
-
}
|
|
47
|
+
},
|
|
49
48
|
'& pre > code': {
|
|
50
49
|
// Reset for Safari
|
|
51
50
|
// https://github.com/necolas/normalize.css/blob/master/normalize.css#L102
|
|
@@ -63,47 +62,53 @@ const Root = styled('div')(({
|
|
|
63
62
|
direction: 'ltr /*! @noflip */',
|
|
64
63
|
boxDecorationBreak: 'clone'
|
|
65
64
|
},
|
|
66
|
-
'& h1':
|
|
65
|
+
'& h1': {
|
|
66
|
+
...lightTheme.typography.h3,
|
|
67
67
|
fontSize: lightTheme.typography.pxToRem(36),
|
|
68
68
|
fontFamily: `"General Sans", ${lightTheme.typography.fontFamilySystem}`,
|
|
69
69
|
margin: '10px 0',
|
|
70
70
|
color: `var(--muidocs-palette-primaryDark-900, ${lightTheme.palette.primaryDark[900]})`,
|
|
71
71
|
fontWeight: 600,
|
|
72
72
|
letterSpacing: -0.2
|
|
73
|
-
}
|
|
74
|
-
'& .description':
|
|
73
|
+
},
|
|
74
|
+
'& .description': {
|
|
75
|
+
...lightTheme.typography.subtitle1,
|
|
75
76
|
fontWeight: 400,
|
|
76
77
|
margin: '0 0 24px'
|
|
77
|
-
}
|
|
78
|
+
},
|
|
78
79
|
'& .component-tabs': {
|
|
79
80
|
margin: '0 0 40px'
|
|
80
81
|
},
|
|
81
|
-
'& h2':
|
|
82
|
+
'& h2': {
|
|
83
|
+
...lightTheme.typography.h5,
|
|
82
84
|
fontFamily: `"General Sans", ${lightTheme.typography.fontFamilySystem}`,
|
|
83
85
|
fontSize: theme.typography.pxToRem(26),
|
|
84
86
|
fontWeight: lightTheme.typography.fontWeightSemiBold,
|
|
85
87
|
color: `var(--muidocs-palette-grey-900, ${lightTheme.palette.grey[900]})`,
|
|
86
88
|
margin: '40px 0 4px'
|
|
87
|
-
}
|
|
88
|
-
'& h3':
|
|
89
|
+
},
|
|
90
|
+
'& h3': {
|
|
91
|
+
...lightTheme.typography.h6,
|
|
89
92
|
fontFamily: `"General Sans", ${lightTheme.typography.fontFamilySystem}`,
|
|
90
93
|
fontSize: theme.typography.pxToRem(20),
|
|
91
94
|
fontWeight: lightTheme.typography.fontWeightSemiBold,
|
|
92
95
|
color: `var(--muidocs-palette-grey-900, ${lightTheme.palette.grey[900]})`,
|
|
93
96
|
margin: '24px 0 4px'
|
|
94
|
-
}
|
|
95
|
-
'& h4':
|
|
97
|
+
},
|
|
98
|
+
'& h4': {
|
|
99
|
+
...lightTheme.typography.subtitle1,
|
|
96
100
|
fontFamily: `"General Sans", ${lightTheme.typography.fontFamilySystem}`,
|
|
97
101
|
fontWeight: lightTheme.typography.fontWeightSemiBold,
|
|
98
102
|
color: `var(--muidocs-palette-grey-900, ${lightTheme.palette.grey[900]})`,
|
|
99
103
|
margin: '20px 0 6px'
|
|
100
|
-
}
|
|
101
|
-
'& h5':
|
|
104
|
+
},
|
|
105
|
+
'& h5': {
|
|
106
|
+
...lightTheme.typography.subtitle2,
|
|
102
107
|
fontFamily: `"General Sans", ${lightTheme.typography.fontFamilySystem}`,
|
|
103
108
|
fontWeight: lightTheme.typography.fontWeightSemiBold,
|
|
104
109
|
color: `var(--muidocs-palette-grey-900, ${lightTheme.palette.grey[900]})`,
|
|
105
110
|
margin: '20px 0 8px'
|
|
106
|
-
}
|
|
111
|
+
},
|
|
107
112
|
'& p': {
|
|
108
113
|
marginTop: 0,
|
|
109
114
|
marginBottom: 16,
|
|
@@ -231,13 +236,14 @@ const Root = styled('div')(({
|
|
|
231
236
|
borderBottom: `1px dotted var(--muidocs-palette-divider, ${lightTheme.palette.divider})`
|
|
232
237
|
}
|
|
233
238
|
},
|
|
234
|
-
'& td':
|
|
239
|
+
'& td': {
|
|
240
|
+
...theme.typography.body2,
|
|
235
241
|
borderBottom: `1px solid var(--muidocs-palette-divider, ${lightTheme.palette.divider})`,
|
|
236
242
|
paddingRight: 20,
|
|
237
243
|
paddingTop: 16,
|
|
238
244
|
paddingBottom: 16,
|
|
239
245
|
color: `var(--muidocs-palette-text-secondary, ${lightTheme.palette.text.secondary})`
|
|
240
|
-
}
|
|
246
|
+
},
|
|
241
247
|
'& td code': {
|
|
242
248
|
lineHeight: 1.6
|
|
243
249
|
},
|
|
@@ -526,45 +532,35 @@ const Root = styled('div')(({
|
|
|
526
532
|
top: 0
|
|
527
533
|
},
|
|
528
534
|
'& .MuiCode-copy': {
|
|
529
|
-
display: 'inline-flex',
|
|
530
|
-
flexDirection: 'row-reverse',
|
|
531
|
-
alignItems: 'center',
|
|
532
|
-
width: 26,
|
|
533
|
-
height: 26,
|
|
534
535
|
cursor: 'pointer',
|
|
535
536
|
position: 'absolute',
|
|
536
537
|
top: 12,
|
|
537
538
|
right: 12,
|
|
539
|
+
display: 'inline-flex',
|
|
540
|
+
flexDirection: 'row-reverse',
|
|
541
|
+
alignItems: 'center',
|
|
542
|
+
height: 24,
|
|
538
543
|
padding: theme.spacing(0.5),
|
|
539
|
-
|
|
540
|
-
|
|
544
|
+
paddingBottom: '5px',
|
|
545
|
+
// optical alignment
|
|
546
|
+
fontFamily: lightTheme.typography.fontFamily,
|
|
547
|
+
fontWeight: lightTheme.typography.fontWeightMedium,
|
|
548
|
+
fontSize: lightTheme.typography.pxToRem(12),
|
|
541
549
|
borderRadius: 6,
|
|
542
|
-
border: '
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
color:
|
|
550
|
+
border: '1px solid',
|
|
551
|
+
borderColor: alpha(lightTheme.palette.primaryDark[600], 0.5),
|
|
552
|
+
backgroundColor: alpha(lightTheme.palette.primaryDark[800], 0.5),
|
|
553
|
+
color: `var(--muidocs-palette-grey-200, ${lightTheme.palette.grey[200]})`,
|
|
546
554
|
transition: theme.transitions.create(['background', 'borderColor', 'display'], {
|
|
547
555
|
duration: theme.transitions.duration.shortest
|
|
548
556
|
}),
|
|
549
|
-
'&
|
|
550
|
-
userSelect: 'none',
|
|
551
|
-
width: theme.typography.pxToRem(16),
|
|
552
|
-
height: theme.typography.pxToRem(16),
|
|
553
|
-
display: 'inline-block',
|
|
554
|
-
fill: 'currentcolor',
|
|
555
|
-
flexShrink: 0,
|
|
556
|
-
fontSize: '18px',
|
|
557
|
-
margin: 'auto',
|
|
558
|
-
opacity: 0.5
|
|
559
|
-
},
|
|
560
|
-
'& .MuiCode-copied-icon': {
|
|
557
|
+
'& .MuiCode-copied-label': {
|
|
561
558
|
display: 'none'
|
|
562
559
|
},
|
|
563
560
|
'&:hover, &:focus': {
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
},
|
|
561
|
+
borderColor: `var(--muidocs-palette-primaryDark-400, ${lightTheme.palette.primaryDark[400]})`,
|
|
562
|
+
backgroundColor: `var(--muidocs-palette-primaryDark-700, ${lightTheme.palette.primaryDark[700]})`,
|
|
563
|
+
color: '#FFF',
|
|
568
564
|
'& .MuiCode-copyKeypress': {
|
|
569
565
|
display: 'block',
|
|
570
566
|
// Approximate no hover capabilities with no keyboard
|
|
@@ -577,17 +573,19 @@ const Root = styled('div')(({
|
|
|
577
573
|
'& .MuiCode-copyKeypress': {
|
|
578
574
|
display: 'none',
|
|
579
575
|
position: 'absolute',
|
|
580
|
-
right:
|
|
576
|
+
right: 34
|
|
581
577
|
},
|
|
582
578
|
'&[data-copied]': {
|
|
583
|
-
|
|
584
|
-
|
|
579
|
+
borderColor: `var(--muidocs-palette-primaryDark-400, ${lightTheme.palette.primaryDark[400]})`,
|
|
580
|
+
backgroundColor: `var(--muidocs-palette-primaryDark-700, ${lightTheme.palette.primaryDark[700]})`,
|
|
585
581
|
color: '#fff',
|
|
586
|
-
|
|
587
|
-
|
|
582
|
+
'& .MuiCode-copyKeypress': {
|
|
583
|
+
opacity: 0
|
|
584
|
+
},
|
|
585
|
+
'& .MuiCode-copy-label': {
|
|
588
586
|
display: 'none'
|
|
589
587
|
},
|
|
590
|
-
'& .MuiCode-copied-
|
|
588
|
+
'& .MuiCode-copied-label': {
|
|
591
589
|
display: 'block'
|
|
592
590
|
}
|
|
593
591
|
}
|
|
@@ -806,10 +804,10 @@ const Root = styled('div')(({
|
|
|
806
804
|
}));
|
|
807
805
|
export const MarkdownElement = /*#__PURE__*/React.forwardRef(function MarkdownElement(props, ref) {
|
|
808
806
|
const {
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
807
|
+
className,
|
|
808
|
+
renderedMarkdown,
|
|
809
|
+
...other
|
|
810
|
+
} = props;
|
|
813
811
|
const more = {};
|
|
814
812
|
if (typeof renderedMarkdown === 'string') {
|
|
815
813
|
// workaround for https://github.com/facebook/react/issues/17170
|
|
@@ -818,9 +816,10 @@ export const MarkdownElement = /*#__PURE__*/React.forwardRef(function MarkdownEl
|
|
|
818
816
|
__html: renderedMarkdown
|
|
819
817
|
};
|
|
820
818
|
}
|
|
821
|
-
return /*#__PURE__*/_jsx(Root,
|
|
822
|
-
className: clsx('markdown-body', className)
|
|
823
|
-
|
|
819
|
+
return /*#__PURE__*/_jsx(Root, {
|
|
820
|
+
className: clsx('markdown-body', className),
|
|
821
|
+
...more,
|
|
822
|
+
...other,
|
|
824
823
|
ref: ref
|
|
825
|
-
})
|
|
824
|
+
});
|
|
826
825
|
});
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
1
|
import * as React from 'react';
|
|
3
2
|
import PropTypes from 'prop-types';
|
|
4
3
|
import NProgress from 'nprogress';
|
|
@@ -38,7 +37,7 @@ function NProgressBar(props) {
|
|
|
38
37
|
return /*#__PURE__*/_jsxs(NoSsr, {
|
|
39
38
|
children: [props.children, /*#__PURE__*/_jsx(GlobalStyles, {
|
|
40
39
|
styles: theme => ({
|
|
41
|
-
'#nprogress':
|
|
40
|
+
'#nprogress': {
|
|
42
41
|
direction: 'ltr',
|
|
43
42
|
pointerEvents: 'none',
|
|
44
43
|
position: 'fixed',
|
|
@@ -47,10 +46,10 @@ function NProgressBar(props) {
|
|
|
47
46
|
right: 0,
|
|
48
47
|
height: 2,
|
|
49
48
|
zIndex: (theme.vars || theme).zIndex.tooltip,
|
|
50
|
-
backgroundColor: (theme.vars || theme).palette.primary[200]
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
49
|
+
backgroundColor: (theme.vars || theme).palette.primary[200],
|
|
50
|
+
...theme.applyDarkStyles({
|
|
51
|
+
backgroundColor: (theme.vars || theme).palette.primary[700]
|
|
52
|
+
}),
|
|
54
53
|
'& .nprogress-bar': {
|
|
55
54
|
position: 'fixed',
|
|
56
55
|
backgroundColor: (theme.vars || theme).palette.primary.main,
|
|
@@ -79,7 +78,7 @@ function NProgressBar(props) {
|
|
|
79
78
|
right: -80,
|
|
80
79
|
clip: 'rect(-6px,90px,14px,-6px)'
|
|
81
80
|
}
|
|
82
|
-
}
|
|
81
|
+
}
|
|
83
82
|
})
|
|
84
83
|
})]
|
|
85
84
|
});
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
var _span;
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
4
|
+
export function SectionTitle(props) {
|
|
5
|
+
const {
|
|
6
|
+
title,
|
|
7
|
+
hash,
|
|
8
|
+
level: Level = 'h2'
|
|
9
|
+
} = props;
|
|
10
|
+
return /*#__PURE__*/_jsx(Level, {
|
|
11
|
+
id: hash,
|
|
12
|
+
style: {
|
|
13
|
+
flexGrow: 1
|
|
14
|
+
},
|
|
15
|
+
children: /*#__PURE__*/_jsxs("a", {
|
|
16
|
+
"aria-labelledby": hash,
|
|
17
|
+
className: "title-link-to-anchor",
|
|
18
|
+
href: `#${hash}`,
|
|
19
|
+
tabIndex: -1,
|
|
20
|
+
children: [title, _span || (_span = /*#__PURE__*/_jsx("span", {
|
|
21
|
+
className: "anchor-icon",
|
|
22
|
+
children: /*#__PURE__*/_jsx("svg", {
|
|
23
|
+
children: /*#__PURE__*/_jsx("use", {
|
|
24
|
+
xlinkHref: "#anchor-link-icon"
|
|
25
|
+
})
|
|
26
|
+
})
|
|
27
|
+
}))]
|
|
28
|
+
})
|
|
29
|
+
});
|
|
30
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './SectionTitle';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './SectionTitle';
|