@mui/docs 6.0.0-dev.240424162023-9968b4889d → 6.0.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/Ad/Ad.d.ts +6 -0
- package/Ad/Ad.js +228 -0
- package/Ad/AdCarbon.d.ts +3 -0
- package/Ad/AdCarbon.js +120 -0
- package/Ad/AdDisplay.d.ts +16 -0
- package/Ad/AdDisplay.js +89 -0
- package/Ad/AdGuest.d.ts +10 -0
- package/Ad/AdGuest.js +29 -0
- package/Ad/AdInHouse.d.ts +5 -0
- package/Ad/AdInHouse.js +15 -0
- package/Ad/AdManager.d.ts +16 -0
- package/Ad/AdManager.js +36 -0
- package/Ad/AdProvider.d.ts +15 -0
- package/Ad/AdProvider.js +24 -0
- package/Ad/ad.styles.d.ts +4327 -0
- package/Ad/ad.styles.js +89 -0
- package/Ad/index.d.ts +5 -0
- package/Ad/index.js +7 -0
- package/Ad/package.json +6 -0
- package/CHANGELOG.md +1367 -22
- package/CodeCopy/CodeCopy.js +1 -1
- package/CodeCopy/CodeCopyButton.js +11 -20
- package/CodeCopy/index.js +3 -3
- package/CodeCopy/useClipboardCopy.js +1 -1
- package/ComponentLinkHeader/ComponentLinkHeader.d.ts +9 -0
- package/ComponentLinkHeader/ComponentLinkHeader.js +197 -0
- package/ComponentLinkHeader/index.d.ts +2 -0
- package/ComponentLinkHeader/index.js +2 -0
- package/ComponentLinkHeader/package.json +6 -0
- package/DocsProvider/DocsProvider.d.ts +3 -1
- package/DocsProvider/DocsProvider.js +10 -5
- package/DocsProvider/index.js +1 -1
- package/HighlightedCode/HighlightedCode.d.ts +3 -1
- package/HighlightedCode/HighlightedCode.js +50 -24
- package/HighlightedCode/index.js +1 -1
- package/HighlightedCodeWithTabs/HighlightedCodeWithTabs.d.ts +29 -0
- package/HighlightedCodeWithTabs/HighlightedCodeWithTabs.js +355 -0
- package/HighlightedCodeWithTabs/index.d.ts +2 -0
- package/HighlightedCodeWithTabs/index.js +2 -0
- package/HighlightedCodeWithTabs/package.json +6 -0
- package/InfoCard/InfoCard.d.ts +0 -1
- package/InfoCard/InfoCard.js +46 -45
- package/InfoCard/index.js +1 -1
- package/Link/Link.js +41 -41
- package/Link/index.js +1 -1
- package/MarkdownElement/MarkdownElement.d.ts +1 -0
- package/MarkdownElement/MarkdownElement.js +187 -165
- package/MarkdownElement/index.js +1 -1
- package/NProgressBar/NProgressBar.js +6 -7
- package/NProgressBar/index.js +1 -1
- package/README.md +2 -2
- 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/BrandingProvider.d.ts +1 -1
- package/branding/BrandingProvider.js +1 -1
- package/branding/brandingTheme.d.ts +2 -2
- package/branding/brandingTheme.js +657 -369
- package/branding/index.js +2 -2
- package/i18n/i18n.d.ts +2 -1
- package/i18n/i18n.js +19 -9
- package/i18n/index.js +1 -1
- package/node/Ad/Ad.js +238 -0
- package/node/Ad/AdCarbon.js +130 -0
- package/node/Ad/AdDisplay.js +97 -0
- package/node/Ad/AdGuest.js +37 -0
- package/node/Ad/AdInHouse.js +24 -0
- package/node/Ad/AdManager.js +46 -0
- package/node/Ad/AdProvider.js +33 -0
- package/node/Ad/ad.styles.js +97 -0
- package/node/Ad/index.js +63 -0
- package/node/CodeCopy/CodeCopy.js +10 -16
- package/node/CodeCopy/CodeCopyButton.js +10 -19
- package/node/CodeCopy/useClipboardCopy.js +1 -1
- package/node/ComponentLinkHeader/ComponentLinkHeader.js +206 -0
- package/node/ComponentLinkHeader/index.js +24 -0
- package/node/DocsProvider/DocsProvider.js +9 -4
- package/node/HighlightedCode/HighlightedCode.js +48 -22
- package/node/HighlightedCodeWithTabs/HighlightedCodeWithTabs.js +365 -0
- package/node/HighlightedCodeWithTabs/index.js +24 -0
- package/node/InfoCard/InfoCard.js +45 -44
- package/node/Link/Link.js +43 -42
- package/node/MarkdownElement/MarkdownElement.js +642 -623
- 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 +657 -369
- package/node/i18n/i18n.js +18 -8
- package/node/svgIcons/AdobeXDIcon.js +22 -0
- package/node/svgIcons/BundleSizeIcon.js +22 -0
- package/node/svgIcons/FigmaIcon.js +31 -0
- package/node/svgIcons/FileDownload.js +3 -3
- package/node/svgIcons/JavaScript.js +3 -3
- package/node/svgIcons/MaterialDesignIcon.js +27 -0
- package/node/svgIcons/SketchIcon.js +36 -0
- package/node/svgIcons/TypeScript.js +3 -3
- package/node/svgIcons/W3CIcon.js +24 -0
- package/node/translations/translations.json +9 -4
- package/node/utils/loadScript.js +15 -0
- package/package.json +12 -10
- package/svgIcons/AdobeXDIcon.d.ts +4 -0
- package/svgIcons/AdobeXDIcon.js +14 -0
- package/svgIcons/BundleSizeIcon.d.ts +4 -0
- package/svgIcons/BundleSizeIcon.js +14 -0
- package/svgIcons/FigmaIcon.d.ts +4 -0
- package/svgIcons/FigmaIcon.js +23 -0
- package/svgIcons/FileDownload.d.ts +7 -0
- package/svgIcons/FileDownload.js +3 -3
- package/svgIcons/JavaScript.d.ts +7 -0
- package/svgIcons/JavaScript.js +3 -3
- package/svgIcons/MaterialDesignIcon.d.ts +4 -0
- package/svgIcons/MaterialDesignIcon.js +19 -0
- package/svgIcons/SketchIcon.d.ts +4 -0
- package/svgIcons/SketchIcon.js +28 -0
- package/svgIcons/TypeScript.d.ts +7 -0
- package/svgIcons/TypeScript.js +3 -3
- package/svgIcons/W3CIcon.d.ts +4 -0
- package/svgIcons/W3CIcon.js +16 -0
- package/translations/index.js +1 -1
- package/translations/translations.json +9 -4
- package/tsconfig.build.tsbuildinfo +1 -1
- package/utils/loadScript.d.ts +1 -0
- package/utils/loadScript.js +9 -0
|
@@ -1,16 +1,15 @@
|
|
|
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';
|
|
7
|
-
import
|
|
4
|
+
import useForkRef from '@mui/utils/useForkRef';
|
|
5
|
+
import { brandingDarkTheme as darkTheme, brandingLightTheme as lightTheme } from "../branding/index.js";
|
|
8
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
7
|
const Root = styled('div')(({
|
|
10
8
|
theme
|
|
11
|
-
}) =>
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
}) => ({
|
|
10
|
+
...lightTheme.typography.body1,
|
|
11
|
+
lineHeight: 1.625,
|
|
12
|
+
// Rounds up to 26px-increased compared to the 1.5 default to make the docs easier to read.
|
|
14
13
|
color: `var(--muidocs-palette-text-primary, ${lightTheme.palette.text.primary})`,
|
|
15
14
|
'& :focus-visible': {
|
|
16
15
|
outline: `3px solid ${alpha(lightTheme.palette.primary[500], 0.5)}`,
|
|
@@ -25,7 +24,7 @@ const Root = styled('div')(({
|
|
|
25
24
|
// Developers like when the code is dense.
|
|
26
25
|
margin: theme.spacing(2, 'auto'),
|
|
27
26
|
padding: theme.spacing(2),
|
|
28
|
-
backgroundColor: 'hsl(210,
|
|
27
|
+
backgroundColor: 'hsl(210, 25%, 9%)',
|
|
29
28
|
// a special, one-off, color tailored for the code blocks using MUI's branding theme blue palette as the starting point. It has a less saturaded color but still maintaining a bit of the blue tint.
|
|
30
29
|
color: 'hsl(60, 30%, 96%)',
|
|
31
30
|
colorScheme: 'dark',
|
|
@@ -41,11 +40,12 @@ const Root = styled('div')(({
|
|
|
41
40
|
maxWidth: 'calc(100vw - 32px - 16px)'
|
|
42
41
|
}
|
|
43
42
|
},
|
|
44
|
-
'& code':
|
|
43
|
+
'& code': {
|
|
44
|
+
...lightTheme.typography.body2,
|
|
45
45
|
fontFamily: lightTheme.typography.fontFamilyCode,
|
|
46
46
|
fontWeight: 400,
|
|
47
47
|
WebkitFontSmoothing: 'subpixel-antialiased'
|
|
48
|
-
}
|
|
48
|
+
},
|
|
49
49
|
'& pre > code': {
|
|
50
50
|
// Reset for Safari
|
|
51
51
|
// https://github.com/necolas/normalize.css/blob/master/normalize.css#L102
|
|
@@ -63,47 +63,53 @@ const Root = styled('div')(({
|
|
|
63
63
|
direction: 'ltr /*! @noflip */',
|
|
64
64
|
boxDecorationBreak: 'clone'
|
|
65
65
|
},
|
|
66
|
-
'& h1':
|
|
66
|
+
'& h1': {
|
|
67
|
+
...lightTheme.typography.h3,
|
|
67
68
|
fontSize: lightTheme.typography.pxToRem(36),
|
|
68
69
|
fontFamily: `"General Sans", ${lightTheme.typography.fontFamilySystem}`,
|
|
69
70
|
margin: '10px 0',
|
|
70
71
|
color: `var(--muidocs-palette-primaryDark-900, ${lightTheme.palette.primaryDark[900]})`,
|
|
71
72
|
fontWeight: 600,
|
|
72
73
|
letterSpacing: -0.2
|
|
73
|
-
}
|
|
74
|
-
'& .description':
|
|
74
|
+
},
|
|
75
|
+
'& .description': {
|
|
76
|
+
...lightTheme.typography.subtitle1,
|
|
75
77
|
fontWeight: 400,
|
|
76
78
|
margin: '0 0 24px'
|
|
77
|
-
}
|
|
79
|
+
},
|
|
78
80
|
'& .component-tabs': {
|
|
79
81
|
margin: '0 0 40px'
|
|
80
82
|
},
|
|
81
|
-
'& h2':
|
|
83
|
+
'& h2': {
|
|
84
|
+
...lightTheme.typography.h5,
|
|
82
85
|
fontFamily: `"General Sans", ${lightTheme.typography.fontFamilySystem}`,
|
|
83
86
|
fontSize: theme.typography.pxToRem(26),
|
|
84
87
|
fontWeight: lightTheme.typography.fontWeightSemiBold,
|
|
85
88
|
color: `var(--muidocs-palette-grey-900, ${lightTheme.palette.grey[900]})`,
|
|
86
89
|
margin: '40px 0 4px'
|
|
87
|
-
}
|
|
88
|
-
'& h3':
|
|
90
|
+
},
|
|
91
|
+
'& h3': {
|
|
92
|
+
...lightTheme.typography.h6,
|
|
89
93
|
fontFamily: `"General Sans", ${lightTheme.typography.fontFamilySystem}`,
|
|
90
94
|
fontSize: theme.typography.pxToRem(20),
|
|
91
95
|
fontWeight: lightTheme.typography.fontWeightSemiBold,
|
|
92
96
|
color: `var(--muidocs-palette-grey-900, ${lightTheme.palette.grey[900]})`,
|
|
93
97
|
margin: '24px 0 4px'
|
|
94
|
-
}
|
|
95
|
-
'& h4':
|
|
98
|
+
},
|
|
99
|
+
'& h4': {
|
|
100
|
+
...lightTheme.typography.subtitle1,
|
|
96
101
|
fontFamily: `"General Sans", ${lightTheme.typography.fontFamilySystem}`,
|
|
97
102
|
fontWeight: lightTheme.typography.fontWeightSemiBold,
|
|
98
103
|
color: `var(--muidocs-palette-grey-900, ${lightTheme.palette.grey[900]})`,
|
|
99
104
|
margin: '20px 0 6px'
|
|
100
|
-
}
|
|
101
|
-
'& h5':
|
|
105
|
+
},
|
|
106
|
+
'& h5': {
|
|
107
|
+
...lightTheme.typography.subtitle2,
|
|
102
108
|
fontFamily: `"General Sans", ${lightTheme.typography.fontFamilySystem}`,
|
|
103
109
|
fontWeight: lightTheme.typography.fontWeightSemiBold,
|
|
104
110
|
color: `var(--muidocs-palette-grey-900, ${lightTheme.palette.grey[900]})`,
|
|
105
111
|
margin: '20px 0 8px'
|
|
106
|
-
}
|
|
112
|
+
},
|
|
107
113
|
'& p': {
|
|
108
114
|
marginTop: 0,
|
|
109
115
|
marginBottom: 16,
|
|
@@ -117,6 +123,44 @@ const Root = styled('div')(({
|
|
|
117
123
|
marginBottom: 6
|
|
118
124
|
}
|
|
119
125
|
},
|
|
126
|
+
'& a[target="_blank"]::after': {
|
|
127
|
+
content: '""',
|
|
128
|
+
maskImage: `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' focusable='false' aria-hidden='true' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M6 6v2h8.59L5 17.59 6.41 19 16 9.41V18h2V6z'%3E%3C/path%3E%3C/svg%3E")`,
|
|
129
|
+
display: 'inline-flex',
|
|
130
|
+
width: '1em',
|
|
131
|
+
height: '1em',
|
|
132
|
+
color: 'inherit',
|
|
133
|
+
backgroundColor: 'currentColor',
|
|
134
|
+
transform: 'translate(0, 2px)',
|
|
135
|
+
transition: 'transform 0.3s cubic-bezier(0.1, 0.8, 0.3, 1)',
|
|
136
|
+
// bounce effect
|
|
137
|
+
opacity: 0.8
|
|
138
|
+
},
|
|
139
|
+
'& a[target="_blank"]:hover::after': {
|
|
140
|
+
opacity: 1,
|
|
141
|
+
transform: 'translate(1px, 0)'
|
|
142
|
+
},
|
|
143
|
+
'& a.remove-link-arrow::after': {
|
|
144
|
+
// Allows to remove link arrows for images
|
|
145
|
+
display: 'none'
|
|
146
|
+
},
|
|
147
|
+
'& .Ad-root a::after': {
|
|
148
|
+
// Remove link arrow for ads
|
|
149
|
+
display: 'none'
|
|
150
|
+
},
|
|
151
|
+
'& a': {
|
|
152
|
+
// Style taken from the Link component
|
|
153
|
+
color: `var(--muidocs-palette-primary-600, ${lightTheme.palette.primary[600]})`,
|
|
154
|
+
fontWeight: theme.typography.fontWeightMedium,
|
|
155
|
+
textDecoration: 'underline',
|
|
156
|
+
textDecorationColor: alpha(lightTheme.palette.primary.main, 0.4),
|
|
157
|
+
'&:hover': {
|
|
158
|
+
textDecorationColor: 'inherit'
|
|
159
|
+
}
|
|
160
|
+
},
|
|
161
|
+
'& a code': {
|
|
162
|
+
color: darken(lightTheme.palette.primary.main, 0.2)
|
|
163
|
+
},
|
|
120
164
|
'& h1, & h2, & h3, & h4': {
|
|
121
165
|
display: 'flex',
|
|
122
166
|
alignItems: 'center',
|
|
@@ -130,9 +174,10 @@ const Root = styled('div')(({
|
|
|
130
174
|
'& .title-link-to-anchor': {
|
|
131
175
|
color: 'inherit',
|
|
132
176
|
textDecoration: 'none',
|
|
177
|
+
boxShadow: 'none',
|
|
178
|
+
fontWeight: 'inherit',
|
|
133
179
|
position: 'relative',
|
|
134
|
-
|
|
135
|
-
alignItems: 'center'
|
|
180
|
+
userSelect: 'text'
|
|
136
181
|
},
|
|
137
182
|
'& .anchor-icon': {
|
|
138
183
|
// To prevent the link to get the focus.
|
|
@@ -140,12 +185,6 @@ const Root = styled('div')(({
|
|
|
140
185
|
alignItems: 'center',
|
|
141
186
|
visibility: 'hidden'
|
|
142
187
|
},
|
|
143
|
-
'& a:not(.title-link-to-anchor):hover': {
|
|
144
|
-
color: 'currentColor',
|
|
145
|
-
border: 'none',
|
|
146
|
-
boxShadow: '0 1px 0 0 currentColor',
|
|
147
|
-
textDecoration: 'none'
|
|
148
|
-
},
|
|
149
188
|
'& .anchor-icon, & .comment-link': {
|
|
150
189
|
padding: 0,
|
|
151
190
|
cursor: 'pointer',
|
|
@@ -156,11 +195,13 @@ const Root = styled('div')(({
|
|
|
156
195
|
marginLeft: 8,
|
|
157
196
|
height: 26,
|
|
158
197
|
width: 26,
|
|
159
|
-
backgroundColor: `var(--muidocs-palette-primary-50, ${lightTheme.palette.grey[50]})`,
|
|
160
198
|
color: `var(--muidocs-palette-grey-600, ${lightTheme.palette.grey[600]})`,
|
|
161
|
-
|
|
162
|
-
|
|
199
|
+
backgroundColor: 'transparent',
|
|
200
|
+
border: '1px solid transparent',
|
|
163
201
|
borderRadius: 8,
|
|
202
|
+
transition: theme.transitions.create(['visibility', 'background-color', 'color', 'border-color'], {
|
|
203
|
+
duration: theme.transitions.duration.shortest
|
|
204
|
+
}),
|
|
164
205
|
'&:hover': {
|
|
165
206
|
backgroundColor: alpha(lightTheme.palette.primary[100], 0.4),
|
|
166
207
|
borderColor: `var(--muidocs-palette-primary-100, ${lightTheme.palette.primary[100]})`,
|
|
@@ -181,7 +222,7 @@ const Root = styled('div')(({
|
|
|
181
222
|
display: 'none',
|
|
182
223
|
// So we can have the comment button opt-in.
|
|
183
224
|
marginLeft: 'auto',
|
|
184
|
-
transition: theme.transitions.create('
|
|
225
|
+
transition: theme.transitions.create(['background-color', 'color', 'border-color'], {
|
|
185
226
|
duration: theme.transitions.duration.shortest
|
|
186
227
|
}),
|
|
187
228
|
'& svg': {
|
|
@@ -231,13 +272,14 @@ const Root = styled('div')(({
|
|
|
231
272
|
borderBottom: `1px dotted var(--muidocs-palette-divider, ${lightTheme.palette.divider})`
|
|
232
273
|
}
|
|
233
274
|
},
|
|
234
|
-
'& td':
|
|
275
|
+
'& td': {
|
|
276
|
+
...theme.typography.body2,
|
|
235
277
|
borderBottom: `1px solid var(--muidocs-palette-divider, ${lightTheme.palette.divider})`,
|
|
236
278
|
paddingRight: 20,
|
|
237
279
|
paddingTop: 16,
|
|
238
280
|
paddingBottom: 16,
|
|
239
281
|
color: `var(--muidocs-palette-text-secondary, ${lightTheme.palette.text.secondary})`
|
|
240
|
-
}
|
|
282
|
+
},
|
|
241
283
|
'& td code': {
|
|
242
284
|
lineHeight: 1.6
|
|
243
285
|
},
|
|
@@ -278,44 +320,58 @@ const Root = styled('div')(({
|
|
|
278
320
|
},
|
|
279
321
|
'& .MuiCallout-root': {
|
|
280
322
|
display: 'flex',
|
|
281
|
-
gap:
|
|
282
|
-
padding: '
|
|
323
|
+
gap: '8px',
|
|
324
|
+
padding: '12px',
|
|
283
325
|
margin: '16px 0',
|
|
284
326
|
border: '1px solid',
|
|
285
327
|
color: `var(--muidocs-palette-text-secondary, ${lightTheme.palette.text.secondary})`,
|
|
286
328
|
borderColor: `var(--muidocs-palette-grey-100, ${lightTheme.palette.grey[100]})`,
|
|
287
329
|
borderRadius: `var(--muidocs-shape-borderRadius, ${theme.shape?.borderRadius ?? lightTheme.shape.borderRadius}px)`,
|
|
288
|
-
'&
|
|
330
|
+
'& .MuiCallout-content': {
|
|
331
|
+
minWidth: 0,
|
|
332
|
+
// Allows content to shrink. Useful when callout contains code block
|
|
333
|
+
flexGrow: 1
|
|
334
|
+
},
|
|
335
|
+
'& code': {
|
|
289
336
|
height: 'fit-content',
|
|
290
337
|
backgroundColor: `var(--muidocs-palette-grey-100, ${lightTheme.palette.grey[100]})`,
|
|
291
338
|
borderColor: `var(--muidocs-palette-grey-300, ${lightTheme.palette.grey[300]})`
|
|
292
339
|
},
|
|
293
|
-
'&
|
|
294
|
-
|
|
295
|
-
// Allows content to shrink. Useful when callout contains code block
|
|
296
|
-
flexGrow: 1,
|
|
340
|
+
'& p': {
|
|
341
|
+
marginBottom: '8px',
|
|
297
342
|
'& > p:last-child, & > ul:last-child': {
|
|
298
343
|
// Avoid margin on last child
|
|
299
344
|
marginBottom: 0
|
|
300
345
|
},
|
|
301
|
-
'& .MuiCode-root': {
|
|
302
|
-
'& > pre': {
|
|
303
|
-
margin: 0,
|
|
304
|
-
marginTop: 4
|
|
305
|
-
}
|
|
306
|
-
},
|
|
307
346
|
'& > ul': {
|
|
308
347
|
// Because of the gap left by the icon, we visually need less padding
|
|
309
348
|
paddingLeft: 22
|
|
310
349
|
}
|
|
311
350
|
},
|
|
312
|
-
'&
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
351
|
+
'& .MuiCode-root': {
|
|
352
|
+
'& pre': {
|
|
353
|
+
margin: '4px 0 0 0',
|
|
354
|
+
borderRadius: '12px 12px 6px 12px',
|
|
355
|
+
borderColor: alpha(lightTheme.palette.primaryDark[600], 0.6),
|
|
356
|
+
'& code': {
|
|
357
|
+
backgroundColor: 'transparent'
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
},
|
|
361
|
+
'& .MuiCallout-icon-container': {
|
|
362
|
+
width: 26,
|
|
363
|
+
// to match text's line-height
|
|
364
|
+
height: 26,
|
|
365
|
+
display: 'flex',
|
|
366
|
+
alignItems: 'center',
|
|
367
|
+
justifyContent: 'center',
|
|
368
|
+
flexShrink: 0,
|
|
369
|
+
'& svg': {
|
|
370
|
+
width: 18,
|
|
371
|
+
height: 18
|
|
372
|
+
}
|
|
317
373
|
},
|
|
318
|
-
'&
|
|
374
|
+
'& ul, & p': {
|
|
319
375
|
'&:last-child': {
|
|
320
376
|
margin: 0
|
|
321
377
|
}
|
|
@@ -330,7 +386,7 @@ const Root = styled('div')(({
|
|
|
330
386
|
'& strong': {
|
|
331
387
|
color: `var(--muidocs-palette-error-800, ${lightTheme.palette.error[800]})`
|
|
332
388
|
},
|
|
333
|
-
'&
|
|
389
|
+
'& svg': {
|
|
334
390
|
fill: `var(--muidocs-palette-error-500, ${lightTheme.palette.error[600]})`
|
|
335
391
|
},
|
|
336
392
|
'& a': {
|
|
@@ -348,7 +404,7 @@ const Root = styled('div')(({
|
|
|
348
404
|
'& strong': {
|
|
349
405
|
color: `var(--muidocs-palette-primary-800, ${lightTheme.palette.primary[800]})`
|
|
350
406
|
},
|
|
351
|
-
'&
|
|
407
|
+
'& svg': {
|
|
352
408
|
fill: `var(--muidocs-palette-grey-600, ${lightTheme.palette.grey[600]})`
|
|
353
409
|
}
|
|
354
410
|
},
|
|
@@ -359,7 +415,7 @@ const Root = styled('div')(({
|
|
|
359
415
|
'& strong': {
|
|
360
416
|
color: `var(--muidocs-palette-success-900, ${lightTheme.palette.success[900]})`
|
|
361
417
|
},
|
|
362
|
-
'&
|
|
418
|
+
'& svg': {
|
|
363
419
|
fill: `var(--muidocs-palette-success-600, ${lightTheme.palette.success[600]})`
|
|
364
420
|
},
|
|
365
421
|
'& a': {
|
|
@@ -377,7 +433,7 @@ const Root = styled('div')(({
|
|
|
377
433
|
'& strong': {
|
|
378
434
|
color: `var(--muidocs-palette-warning-800, ${lightTheme.palette.warning[800]})`
|
|
379
435
|
},
|
|
380
|
-
'&
|
|
436
|
+
'& svg': {
|
|
381
437
|
fill: `var(--muidocs-palette-warning-600, ${lightTheme.palette.warning[600]})`
|
|
382
438
|
},
|
|
383
439
|
'& a': {
|
|
@@ -389,47 +445,6 @@ const Root = styled('div')(({
|
|
|
389
445
|
}
|
|
390
446
|
}
|
|
391
447
|
},
|
|
392
|
-
'& a[target="_blank"]::after': {
|
|
393
|
-
content: '""',
|
|
394
|
-
maskImage: `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' focusable='false' aria-hidden='true' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M6 6v2h8.59L5 17.59 6.41 19 16 9.41V18h2V6z'%3E%3C/path%3E%3C/svg%3E")`,
|
|
395
|
-
display: 'inline-flex',
|
|
396
|
-
width: '1em',
|
|
397
|
-
height: '1em',
|
|
398
|
-
color: 'inherit',
|
|
399
|
-
backgroundColor: 'currentColor',
|
|
400
|
-
transform: 'translate(0, 2px)',
|
|
401
|
-
transition: 'transform 0.3s cubic-bezier(0.1, 0.8, 0.3, 1)',
|
|
402
|
-
// bounce effect
|
|
403
|
-
opacity: 0.8
|
|
404
|
-
},
|
|
405
|
-
'& a[target="_blank"]:hover::after': {
|
|
406
|
-
opacity: 1,
|
|
407
|
-
transform: 'translate(1px, 0)'
|
|
408
|
-
},
|
|
409
|
-
'& a.remove-link-arrow::after': {
|
|
410
|
-
// Allows to remove link arrows for images
|
|
411
|
-
display: 'none'
|
|
412
|
-
},
|
|
413
|
-
'& .Ad-root a::after': {
|
|
414
|
-
// Remove link arrow for ads
|
|
415
|
-
display: 'none'
|
|
416
|
-
},
|
|
417
|
-
'& a:not(.title-link-to-anchor), & a:not(.title-link-to-anchor) code': {
|
|
418
|
-
// Style taken from the Link component
|
|
419
|
-
color: `var(--muidocs-palette-primary-600, ${lightTheme.palette.primary[600]})`,
|
|
420
|
-
fontWeight: theme.typography.fontWeightMedium,
|
|
421
|
-
textDecoration: 'underline',
|
|
422
|
-
textDecorationColor: alpha(lightTheme.palette.primary.main, 0.4),
|
|
423
|
-
'&:hover': {
|
|
424
|
-
textDecorationColor: 'inherit'
|
|
425
|
-
}
|
|
426
|
-
},
|
|
427
|
-
'& a code': {
|
|
428
|
-
color: darken(lightTheme.palette.primary.main, 0.04)
|
|
429
|
-
},
|
|
430
|
-
'& a:not(.title-link-to-anchor) code': {
|
|
431
|
-
color: darken(lightTheme.palette.primary.main, 0.2)
|
|
432
|
-
},
|
|
433
448
|
'& img, & video': {
|
|
434
449
|
// Use !important so that inline style on <img> or <video> can't win.
|
|
435
450
|
// This avoid horizontal overflows on mobile.
|
|
@@ -526,45 +541,34 @@ const Root = styled('div')(({
|
|
|
526
541
|
top: 0
|
|
527
542
|
},
|
|
528
543
|
'& .MuiCode-copy': {
|
|
529
|
-
display: 'inline-flex',
|
|
530
|
-
flexDirection: 'row-reverse',
|
|
531
|
-
alignItems: 'center',
|
|
532
|
-
width: 26,
|
|
533
|
-
height: 26,
|
|
534
544
|
cursor: 'pointer',
|
|
535
545
|
position: 'absolute',
|
|
536
546
|
top: 12,
|
|
537
547
|
right: 12,
|
|
548
|
+
display: 'inline-flex',
|
|
549
|
+
flexDirection: 'row-reverse',
|
|
550
|
+
alignItems: 'center',
|
|
538
551
|
padding: theme.spacing(0.5),
|
|
539
|
-
|
|
540
|
-
|
|
552
|
+
paddingBottom: '5px',
|
|
553
|
+
// optical alignment
|
|
554
|
+
fontFamily: lightTheme.typography.fontFamily,
|
|
555
|
+
fontWeight: lightTheme.typography.fontWeightMedium,
|
|
556
|
+
fontSize: lightTheme.typography.pxToRem(12),
|
|
541
557
|
borderRadius: 6,
|
|
542
|
-
border: '
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
color:
|
|
558
|
+
border: '1px solid',
|
|
559
|
+
borderColor: alpha(lightTheme.palette.primaryDark[600], 0.5),
|
|
560
|
+
backgroundColor: alpha(lightTheme.palette.primaryDark[800], 0.5),
|
|
561
|
+
color: `var(--muidocs-palette-grey-300, ${lightTheme.palette.grey[300]})`,
|
|
546
562
|
transition: theme.transitions.create(['background', 'borderColor', 'display'], {
|
|
547
563
|
duration: theme.transitions.duration.shortest
|
|
548
564
|
}),
|
|
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': {
|
|
565
|
+
'& .MuiCode-copied-label': {
|
|
561
566
|
display: 'none'
|
|
562
567
|
},
|
|
563
568
|
'&:hover, &:focus': {
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
},
|
|
569
|
+
borderColor: `var(--muidocs-palette-primaryDark-400, ${lightTheme.palette.primaryDark[400]})`,
|
|
570
|
+
backgroundColor: `var(--muidocs-palette-primaryDark-700, ${lightTheme.palette.primaryDark[700]})`,
|
|
571
|
+
color: '#FFF',
|
|
568
572
|
'& .MuiCode-copyKeypress': {
|
|
569
573
|
display: 'block',
|
|
570
574
|
// Approximate no hover capabilities with no keyboard
|
|
@@ -577,17 +581,19 @@ const Root = styled('div')(({
|
|
|
577
581
|
'& .MuiCode-copyKeypress': {
|
|
578
582
|
display: 'none',
|
|
579
583
|
position: 'absolute',
|
|
580
|
-
right:
|
|
584
|
+
right: 34
|
|
581
585
|
},
|
|
582
586
|
'&[data-copied]': {
|
|
583
|
-
|
|
584
|
-
|
|
587
|
+
borderColor: `var(--muidocs-palette-primaryDark-400, ${lightTheme.palette.primaryDark[400]})`,
|
|
588
|
+
backgroundColor: `var(--muidocs-palette-primaryDark-700, ${lightTheme.palette.primaryDark[700]})`,
|
|
585
589
|
color: '#fff',
|
|
586
|
-
|
|
587
|
-
|
|
590
|
+
'& .MuiCode-copyKeypress': {
|
|
591
|
+
opacity: 0
|
|
592
|
+
},
|
|
593
|
+
'& .MuiCode-copy-label': {
|
|
588
594
|
display: 'none'
|
|
589
595
|
},
|
|
590
|
-
'& .MuiCode-copied-
|
|
596
|
+
'& .MuiCode-copied-label': {
|
|
591
597
|
display: 'block'
|
|
592
598
|
}
|
|
593
599
|
}
|
|
@@ -665,24 +671,26 @@ const Root = styled('div')(({
|
|
|
665
671
|
'& hr': {
|
|
666
672
|
backgroundColor: `var(--muidocs-palette-divider, ${darkTheme.palette.divider})`
|
|
667
673
|
},
|
|
668
|
-
'&
|
|
669
|
-
color: `var(--muidocs-palette-
|
|
674
|
+
'& a': {
|
|
675
|
+
color: `var(--muidocs-palette-primary-300, ${darkTheme.palette.primary[300]})`
|
|
670
676
|
},
|
|
671
|
-
'&
|
|
672
|
-
color: `var(--muidocs-palette-
|
|
677
|
+
'& a code': {
|
|
678
|
+
color: `var(--muidocs-palette-primary-light, ${darkTheme.palette.primary.light})`
|
|
673
679
|
},
|
|
674
|
-
'& h1, & h2, & h3, & h4': {
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
backgroundColor: alpha(darkTheme.palette.primaryDark[700], 0.5),
|
|
680
|
+
'& h1, & h2, & h3, & h4, & h5': {
|
|
681
|
+
color: `var(--muidocs-palette-grey-50, ${darkTheme.palette.grey[50]})`,
|
|
682
|
+
'& .anchor-icon, & .comment-link': {
|
|
683
|
+
color: `var(--muidocs-palette-primary-300, ${darkTheme.palette.primaryDark[400]})`,
|
|
679
684
|
'&:hover': {
|
|
685
|
+
color: `var(--muidocs-palette-primary-100, ${darkTheme.palette.primary[100]})`,
|
|
680
686
|
borderColor: `var(--muidocs-palette-primary-900, ${darkTheme.palette.primary[900]})`,
|
|
681
|
-
backgroundColor: alpha(darkTheme.palette.primary[900], 0.6)
|
|
682
|
-
color: `var(--muidocs-palette-primary-100, ${darkTheme.palette.primary[100]})`
|
|
687
|
+
backgroundColor: alpha(darkTheme.palette.primary[900], 0.6)
|
|
683
688
|
}
|
|
684
689
|
}
|
|
685
690
|
},
|
|
691
|
+
'& p, & ul, & ol': {
|
|
692
|
+
color: `var(--muidocs-palette-grey-400, ${darkTheme.palette.grey[400]})`
|
|
693
|
+
},
|
|
686
694
|
'& h1 code, & h2 code, & h3 code': {
|
|
687
695
|
color: `var(--muidocs-palette-grey-100, ${darkTheme.palette.grey[100]})`
|
|
688
696
|
},
|
|
@@ -716,8 +724,7 @@ const Root = styled('div')(({
|
|
|
716
724
|
},
|
|
717
725
|
'& .MuiCallout-root': {
|
|
718
726
|
borderColor: `var(--muidocs-palette-primaryDark-700, ${darkTheme.palette.primaryDark[700]})`,
|
|
719
|
-
'&
|
|
720
|
-
height: 'fit-content',
|
|
727
|
+
'& code': {
|
|
721
728
|
backgroundColor: `var(--muidocs-palette-primaryDark-600, ${darkTheme.palette.primaryDark[600]})`,
|
|
722
729
|
borderColor: `var(--muidocs-palette-primaryDark-500, ${darkTheme.palette.primaryDark[500]})`
|
|
723
730
|
},
|
|
@@ -728,7 +735,7 @@ const Root = styled('div')(({
|
|
|
728
735
|
'& strong': {
|
|
729
736
|
color: `var(--muidocs-palette-error-300, ${darkTheme.palette.error[300]})`
|
|
730
737
|
},
|
|
731
|
-
'&
|
|
738
|
+
'& svg': {
|
|
732
739
|
fill: `var(--muidocs-palette-error-500, ${darkTheme.palette.error[500]})`
|
|
733
740
|
},
|
|
734
741
|
'& a': {
|
|
@@ -742,7 +749,7 @@ const Root = styled('div')(({
|
|
|
742
749
|
'& strong': {
|
|
743
750
|
color: `var(--muidocs-palette-primary-200, ${darkTheme.palette.primary[200]})`
|
|
744
751
|
},
|
|
745
|
-
'&
|
|
752
|
+
'& svg': {
|
|
746
753
|
fill: `var(--muidocs-palette-grey-400, ${darkTheme.palette.grey[400]})`
|
|
747
754
|
}
|
|
748
755
|
},
|
|
@@ -753,7 +760,7 @@ const Root = styled('div')(({
|
|
|
753
760
|
'& strong': {
|
|
754
761
|
color: `var(--muidocs-palette-success-200, ${darkTheme.palette.success[200]})`
|
|
755
762
|
},
|
|
756
|
-
'&
|
|
763
|
+
'& svg': {
|
|
757
764
|
fill: `var(--muidocs-palette-success-500, ${darkTheme.palette.success[500]})`
|
|
758
765
|
},
|
|
759
766
|
'& a': {
|
|
@@ -767,7 +774,7 @@ const Root = styled('div')(({
|
|
|
767
774
|
'& strong': {
|
|
768
775
|
color: `var(--muidocs-palette-warning-200, ${darkTheme.palette.warning[200]})`
|
|
769
776
|
},
|
|
770
|
-
'&
|
|
777
|
+
'& svg': {
|
|
771
778
|
fill: `var(--muidocs-palette-warning-400, ${darkTheme.palette.warning[400]})`
|
|
772
779
|
},
|
|
773
780
|
'& a': {
|
|
@@ -775,12 +782,6 @@ const Root = styled('div')(({
|
|
|
775
782
|
}
|
|
776
783
|
}
|
|
777
784
|
},
|
|
778
|
-
'& a:not(.title-link-to-anchor), & a:not(.title-link-to-anchor) code': {
|
|
779
|
-
color: `var(--muidocs-palette-primary-300, ${darkTheme.palette.primary[300]})`
|
|
780
|
-
},
|
|
781
|
-
'& a:not(.title-link-to-anchor) code': {
|
|
782
|
-
color: `var(--muidocs-palette-primary-light, ${darkTheme.palette.primary.light})`
|
|
783
|
-
},
|
|
784
785
|
'& kbd.key': {
|
|
785
786
|
color: `var(--muidocs-palette-text-primary, ${darkTheme.palette.text.primary})`,
|
|
786
787
|
backgroundColor: `var(--muidocs-palette-primaryDark-800, ${darkTheme.palette.primaryDark[800]})`,
|
|
@@ -804,12 +805,32 @@ const Root = styled('div')(({
|
|
|
804
805
|
}
|
|
805
806
|
}
|
|
806
807
|
}));
|
|
808
|
+
function handleHeaderClick(event) {
|
|
809
|
+
const selection = document.getSelection();
|
|
810
|
+
if (selection === null) {
|
|
811
|
+
return;
|
|
812
|
+
}
|
|
813
|
+
if (selection.type === 'Range') {
|
|
814
|
+
// Disable the <a> behavior to be able to select text.
|
|
815
|
+
event.preventDefault();
|
|
816
|
+
}
|
|
817
|
+
}
|
|
807
818
|
export const MarkdownElement = /*#__PURE__*/React.forwardRef(function MarkdownElement(props, ref) {
|
|
808
819
|
const {
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
820
|
+
className,
|
|
821
|
+
renderedMarkdown,
|
|
822
|
+
...other
|
|
823
|
+
} = props;
|
|
824
|
+
const rootRef = React.useRef(null);
|
|
825
|
+
const handleRef = useForkRef(rootRef, ref);
|
|
826
|
+
React.useEffect(() => {
|
|
827
|
+
const elements = rootRef.current.getElementsByClassName('title-link-to-anchor');
|
|
828
|
+
for (let i = 0; i < elements.length; i += 1) {
|
|
829
|
+
// More reliable than `-webkit-user-drag` (https://caniuse.com/webkit-user-drag)
|
|
830
|
+
elements[i].setAttribute('draggable', 'false');
|
|
831
|
+
elements[i].addEventListener('click', handleHeaderClick);
|
|
832
|
+
}
|
|
833
|
+
}, []);
|
|
813
834
|
const more = {};
|
|
814
835
|
if (typeof renderedMarkdown === 'string') {
|
|
815
836
|
// workaround for https://github.com/facebook/react/issues/17170
|
|
@@ -818,9 +839,10 @@ export const MarkdownElement = /*#__PURE__*/React.forwardRef(function MarkdownEl
|
|
|
818
839
|
__html: renderedMarkdown
|
|
819
840
|
};
|
|
820
841
|
}
|
|
821
|
-
return /*#__PURE__*/_jsx(Root,
|
|
822
|
-
className: clsx('markdown-body', className)
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
842
|
+
return /*#__PURE__*/_jsx(Root, {
|
|
843
|
+
className: clsx('markdown-body', className),
|
|
844
|
+
...more,
|
|
845
|
+
...other,
|
|
846
|
+
ref: handleRef
|
|
847
|
+
});
|
|
826
848
|
});
|
package/MarkdownElement/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from
|
|
1
|
+
export * from "./MarkdownElement.js";
|
|
@@ -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
|
});
|
package/NProgressBar/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default } from
|
|
1
|
+
export { default } from "./NProgressBar.js";
|
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@ Install the package in your project directory with:
|
|
|
9
9
|
<!-- #default-branch-switch -->
|
|
10
10
|
|
|
11
11
|
```bash
|
|
12
|
-
npm install @mui/docs
|
|
12
|
+
npm install @mui/docs
|
|
13
13
|
```
|
|
14
14
|
|
|
15
15
|
The docs has a peer dependency on the core components.
|
|
@@ -18,7 +18,7 @@ If you are not already using Material UI in your project, you can add it with:
|
|
|
18
18
|
<!-- #default-branch-switch -->
|
|
19
19
|
|
|
20
20
|
```bash
|
|
21
|
-
npm install @mui/material
|
|
21
|
+
npm install @mui/material
|
|
22
22
|
```
|
|
23
23
|
|
|
24
24
|
## Documentation
|