@mui/docs 6.0.0-alpha.1 → 6.0.0-alpha.11

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.
Files changed (99) hide show
  1. package/CHANGELOG.md +538 -4
  2. package/CodeCopy/CodeCopy.d.ts +20 -0
  3. package/CodeCopy/CodeCopy.js +172 -0
  4. package/CodeCopy/CodeCopyButton.d.ts +5 -0
  5. package/CodeCopy/CodeCopyButton.js +41 -0
  6. package/CodeCopy/index.d.ts +3 -0
  7. package/CodeCopy/index.js +3 -0
  8. package/CodeCopy/package.json +6 -0
  9. package/CodeCopy/useClipboardCopy.d.ts +4 -0
  10. package/CodeCopy/useClipboardCopy.js +21 -0
  11. package/ComponentLinkHeader/ComponentLinkHeader.d.ts +9 -0
  12. package/ComponentLinkHeader/ComponentLinkHeader.js +179 -0
  13. package/ComponentLinkHeader/index.d.ts +2 -0
  14. package/ComponentLinkHeader/index.js +2 -0
  15. package/ComponentLinkHeader/package.json +6 -0
  16. package/HighlightedCode/HighlightedCode.d.ts +14 -0
  17. package/HighlightedCode/HighlightedCode.js +68 -0
  18. package/HighlightedCode/index.d.ts +1 -0
  19. package/HighlightedCode/index.js +1 -0
  20. package/HighlightedCode/package.json +6 -0
  21. package/InfoCard/InfoCard.d.ts +0 -1
  22. package/InfoCard/InfoCard.js +45 -44
  23. package/Link/Link.js +40 -38
  24. package/MarkdownElement/MarkdownElement.d.ts +6 -0
  25. package/MarkdownElement/MarkdownElement.js +847 -0
  26. package/MarkdownElement/index.d.ts +1 -0
  27. package/MarkdownElement/index.js +1 -0
  28. package/MarkdownElement/package.json +6 -0
  29. package/NProgressBar/NProgressBar.js +6 -7
  30. package/SectionTitle/SectionTitle.d.ts +7 -0
  31. package/SectionTitle/SectionTitle.js +30 -0
  32. package/SectionTitle/index.d.ts +1 -0
  33. package/SectionTitle/index.js +1 -0
  34. package/SectionTitle/package.json +6 -0
  35. package/branding/brandingTheme.js +569 -369
  36. package/node/CodeCopy/CodeCopy.js +188 -0
  37. package/node/CodeCopy/CodeCopyButton.js +50 -0
  38. package/node/CodeCopy/index.js +40 -0
  39. package/node/CodeCopy/useClipboardCopy.js +30 -0
  40. package/node/ComponentLinkHeader/ComponentLinkHeader.js +189 -0
  41. package/node/ComponentLinkHeader/index.js +24 -0
  42. package/node/HighlightedCode/HighlightedCode.js +77 -0
  43. package/node/HighlightedCode/index.js +16 -0
  44. package/node/InfoCard/InfoCard.js +45 -44
  45. package/node/Link/Link.js +43 -40
  46. package/node/MarkdownElement/MarkdownElement.js +859 -0
  47. package/node/MarkdownElement/index.js +16 -0
  48. package/node/NProgressBar/NProgressBar.js +6 -7
  49. package/node/SectionTitle/SectionTitle.js +38 -0
  50. package/node/SectionTitle/index.js +16 -0
  51. package/node/branding/brandingTheme.js +569 -369
  52. package/node/svgIcons/AdobeXDIcon.js +22 -0
  53. package/node/svgIcons/BundleSizeIcon.js +22 -0
  54. package/node/svgIcons/FigmaIcon.js +31 -0
  55. package/node/svgIcons/FileDownload.js +3 -3
  56. package/node/svgIcons/JavaScript.js +3 -3
  57. package/node/svgIcons/MaterialDesignIcon.js +27 -0
  58. package/node/svgIcons/SketchIcon.js +36 -0
  59. package/node/svgIcons/TypeScript.js +3 -3
  60. package/node/svgIcons/W3CIcon.js +24 -0
  61. package/node/translations/translations.json +4 -2
  62. package/package.json +6 -4
  63. package/svgIcons/AdobeXDIcon.d.ts +4 -0
  64. package/svgIcons/AdobeXDIcon.js +14 -0
  65. package/svgIcons/BundleSizeIcon.d.ts +4 -0
  66. package/svgIcons/BundleSizeIcon.js +14 -0
  67. package/svgIcons/FigmaIcon.d.ts +4 -0
  68. package/svgIcons/FigmaIcon.js +23 -0
  69. package/svgIcons/FileDownload.d.ts +7 -0
  70. package/svgIcons/FileDownload.js +3 -3
  71. package/svgIcons/JavaScript.d.ts +7 -0
  72. package/svgIcons/JavaScript.js +3 -3
  73. package/svgIcons/MaterialDesignIcon.d.ts +4 -0
  74. package/svgIcons/MaterialDesignIcon.js +19 -0
  75. package/svgIcons/SketchIcon.d.ts +4 -0
  76. package/svgIcons/SketchIcon.js +28 -0
  77. package/svgIcons/TypeScript.d.ts +7 -0
  78. package/svgIcons/TypeScript.js +3 -3
  79. package/svgIcons/W3CIcon.d.ts +4 -0
  80. package/svgIcons/W3CIcon.js +16 -0
  81. package/translations/translations.json +4 -2
  82. package/tsconfig.build.tsbuildinfo +1 -1
  83. package/legacy/DocsProvider/DocsProvider.js +0 -25
  84. package/legacy/DocsProvider/index.js +0 -1
  85. package/legacy/InfoCard/InfoCard.js +0 -86
  86. package/legacy/InfoCard/index.js +0 -1
  87. package/legacy/Link/Link.js +0 -101
  88. package/legacy/Link/index.js +0 -1
  89. package/legacy/NProgressBar/NProgressBar.js +0 -80
  90. package/legacy/NProgressBar/index.js +0 -1
  91. package/legacy/branding/BrandingProvider.js +0 -17
  92. package/legacy/branding/brandingTheme.js +0 -1168
  93. package/legacy/branding/index.js +0 -2
  94. package/legacy/i18n/i18n.js +0 -105
  95. package/legacy/i18n/index.js +0 -1
  96. package/legacy/svgIcons/FileDownload.js +0 -14
  97. package/legacy/svgIcons/JavaScript.js +0 -14
  98. package/legacy/svgIcons/TypeScript.js +0 -14
  99. package/legacy/translations/index.js +0 -4
@@ -0,0 +1,847 @@
1
+ import * as React from 'react';
2
+ import clsx from 'clsx';
3
+ import { alpha, darken, styled } from '@mui/material/styles';
4
+ import useForkRef from '@mui/utils/useForkRef';
5
+ import { brandingDarkTheme as darkTheme, brandingLightTheme as lightTheme } from '../branding';
6
+ import { jsx as _jsx } from "react/jsx-runtime";
7
+ const Root = styled('div')(({
8
+ theme
9
+ }) => ({
10
+ ...lightTheme.typography.body1,
11
+ lineHeight: 1.6,
12
+ // Increased compared to the 1.5 default to make the docs easier to read.
13
+ color: `var(--muidocs-palette-text-primary, ${lightTheme.palette.text.primary})`,
14
+ '& :focus-visible': {
15
+ outline: `3px solid ${alpha(lightTheme.palette.primary[500], 0.5)}`,
16
+ outlineOffset: 2
17
+ },
18
+ '& strong': {
19
+ color: `var(--muidocs-palette-text-primary, ${lightTheme.palette.text.primary})`
20
+ },
21
+ wordBreak: 'break-word',
22
+ '& pre': {
23
+ lineHeight: 1.5,
24
+ // Developers like when the code is dense.
25
+ margin: theme.spacing(2, 'auto'),
26
+ padding: theme.spacing(2),
27
+ backgroundColor: 'hsl(210, 35%, 9%)',
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.
29
+ color: 'hsl(60, 30%, 96%)',
30
+ colorScheme: 'dark',
31
+ borderRadius: `var(--muidocs-shape-borderRadius, ${theme.shape?.borderRadius ?? lightTheme.shape.borderRadius}px)`,
32
+ border: '1px solid',
33
+ borderColor: `var(--muidocs-palette-primaryDark-700, ${lightTheme.palette.primaryDark[700]})`,
34
+ overflow: 'auto',
35
+ WebkitOverflowScrolling: 'touch',
36
+ fontSize: lightTheme.typography.pxToRem(13),
37
+ maxWidth: 'calc(100vw - 32px)',
38
+ maxHeight: '400px',
39
+ [lightTheme.breakpoints.up('md')]: {
40
+ maxWidth: 'calc(100vw - 32px - 16px)'
41
+ }
42
+ },
43
+ '& code': {
44
+ ...lightTheme.typography.body2,
45
+ fontFamily: lightTheme.typography.fontFamilyCode,
46
+ fontWeight: 400,
47
+ WebkitFontSmoothing: 'subpixel-antialiased'
48
+ },
49
+ '& pre > code': {
50
+ // Reset for Safari
51
+ // https://github.com/necolas/normalize.css/blob/master/normalize.css#L102
52
+ fontSize: 'inherit'
53
+ },
54
+ // inline code block
55
+ '& :not(pre) > code': {
56
+ padding: '2px 4px',
57
+ color: `var(--muidocs-palette-text-primary, ${lightTheme.palette.text.primary})`,
58
+ backgroundColor: `var(--muidocs-palette-grey-50, ${lightTheme.palette.grey[50]})`,
59
+ border: '1px solid',
60
+ borderColor: `var(--muidocs-palette-grey-200, ${lightTheme.palette.grey[200]})`,
61
+ borderRadius: 6,
62
+ fontSize: lightTheme.typography.pxToRem(13),
63
+ direction: 'ltr /*! @noflip */',
64
+ boxDecorationBreak: 'clone'
65
+ },
66
+ '& h1': {
67
+ ...lightTheme.typography.h3,
68
+ fontSize: lightTheme.typography.pxToRem(36),
69
+ fontFamily: `"General Sans", ${lightTheme.typography.fontFamilySystem}`,
70
+ margin: '10px 0',
71
+ color: `var(--muidocs-palette-primaryDark-900, ${lightTheme.palette.primaryDark[900]})`,
72
+ fontWeight: 600,
73
+ letterSpacing: -0.2
74
+ },
75
+ '& .description': {
76
+ ...lightTheme.typography.subtitle1,
77
+ fontWeight: 400,
78
+ margin: '0 0 24px'
79
+ },
80
+ '& .component-tabs': {
81
+ margin: '0 0 40px'
82
+ },
83
+ '& h2': {
84
+ ...lightTheme.typography.h5,
85
+ fontFamily: `"General Sans", ${lightTheme.typography.fontFamilySystem}`,
86
+ fontSize: theme.typography.pxToRem(26),
87
+ fontWeight: lightTheme.typography.fontWeightSemiBold,
88
+ color: `var(--muidocs-palette-grey-900, ${lightTheme.palette.grey[900]})`,
89
+ margin: '40px 0 4px'
90
+ },
91
+ '& h3': {
92
+ ...lightTheme.typography.h6,
93
+ fontFamily: `"General Sans", ${lightTheme.typography.fontFamilySystem}`,
94
+ fontSize: theme.typography.pxToRem(20),
95
+ fontWeight: lightTheme.typography.fontWeightSemiBold,
96
+ color: `var(--muidocs-palette-grey-900, ${lightTheme.palette.grey[900]})`,
97
+ margin: '24px 0 4px'
98
+ },
99
+ '& h4': {
100
+ ...lightTheme.typography.subtitle1,
101
+ fontFamily: `"General Sans", ${lightTheme.typography.fontFamilySystem}`,
102
+ fontWeight: lightTheme.typography.fontWeightSemiBold,
103
+ color: `var(--muidocs-palette-grey-900, ${lightTheme.palette.grey[900]})`,
104
+ margin: '20px 0 6px'
105
+ },
106
+ '& h5': {
107
+ ...lightTheme.typography.subtitle2,
108
+ fontFamily: `"General Sans", ${lightTheme.typography.fontFamilySystem}`,
109
+ fontWeight: lightTheme.typography.fontWeightSemiBold,
110
+ color: `var(--muidocs-palette-grey-900, ${lightTheme.palette.grey[900]})`,
111
+ margin: '20px 0 8px'
112
+ },
113
+ '& p': {
114
+ marginTop: 0,
115
+ marginBottom: 16,
116
+ color: `var(--muidocs-palette-grey-900, ${lightTheme.palette.grey[900]})`
117
+ },
118
+ '& ul, & ol': {
119
+ paddingLeft: 30,
120
+ marginTop: 0,
121
+ marginBottom: 16,
122
+ '& ul, & ol': {
123
+ marginBottom: 6
124
+ }
125
+ },
126
+ '& h1, & h2, & h3, & h4': {
127
+ display: 'flex',
128
+ alignItems: 'center',
129
+ gap: 6,
130
+ '& code': {
131
+ fontSize: 'inherit',
132
+ lineHeight: 'inherit',
133
+ // Remove scroll on small screens.
134
+ wordBreak: 'break-all'
135
+ },
136
+ '& .title-link-to-anchor': {
137
+ color: 'inherit',
138
+ textDecoration: 'none',
139
+ position: 'relative',
140
+ display: 'flex',
141
+ alignItems: 'center',
142
+ userSelect: 'text'
143
+ },
144
+ '& .anchor-icon': {
145
+ // To prevent the link to get the focus.
146
+ display: 'inline-flex',
147
+ alignItems: 'center',
148
+ visibility: 'hidden'
149
+ },
150
+ '& a:not(.title-link-to-anchor):hover': {
151
+ color: 'currentColor',
152
+ border: 'none',
153
+ boxShadow: '0 1px 0 0 currentColor',
154
+ textDecoration: 'none'
155
+ },
156
+ '& .anchor-icon, & .comment-link': {
157
+ padding: 0,
158
+ cursor: 'pointer',
159
+ alignItems: 'center',
160
+ justifyContent: 'center',
161
+ flexShrink: 0,
162
+ textAlign: 'center',
163
+ marginLeft: 8,
164
+ height: 26,
165
+ width: 26,
166
+ backgroundColor: `var(--muidocs-palette-primary-50, ${lightTheme.palette.grey[50]})`,
167
+ color: `var(--muidocs-palette-grey-600, ${lightTheme.palette.grey[600]})`,
168
+ border: '1px solid',
169
+ borderColor: `var(--muidocs-palette-divider, ${lightTheme.palette.divider})`,
170
+ borderRadius: 8,
171
+ '&:hover': {
172
+ backgroundColor: alpha(lightTheme.palette.primary[100], 0.4),
173
+ borderColor: `var(--muidocs-palette-primary-100, ${lightTheme.palette.primary[100]})`,
174
+ color: `var(--muidocs-palette-primary-main, ${lightTheme.palette.primary.main})`
175
+ },
176
+ '& svg': {
177
+ height: 14,
178
+ width: 14,
179
+ fill: 'currentColor',
180
+ pointerEvents: 'none',
181
+ verticalAlign: 'middle'
182
+ }
183
+ },
184
+ '&:hover .anchor-icon': {
185
+ visibility: 'visible'
186
+ },
187
+ '& .comment-link': {
188
+ display: 'none',
189
+ // So we can have the comment button opt-in.
190
+ marginLeft: 'auto',
191
+ transition: theme.transitions.create('opacity', {
192
+ duration: theme.transitions.duration.shortest
193
+ }),
194
+ '& svg': {
195
+ fill: 'currentColor',
196
+ marginRight: 1.5
197
+ }
198
+ }
199
+ },
200
+ '& h1 code, & h2 code, & h3 code': {
201
+ color: `var(--muidocs-palette-grey-900, ${lightTheme.palette.grey[900]})`
202
+ },
203
+ '& h1 code': {
204
+ fontWeight: lightTheme.typography.fontWeightSemiBold
205
+ },
206
+ '& h2 code': {
207
+ fontSize: lightTheme.typography.pxToRem(24),
208
+ fontWeight: lightTheme.typography.fontWeightSemiBold
209
+ },
210
+ '& h3 code': {
211
+ fontSize: lightTheme.typography.pxToRem(18)
212
+ },
213
+ '& table': {
214
+ // Trade display table for scroll overflow
215
+ display: 'block',
216
+ wordBreak: 'normal',
217
+ overflowX: 'auto',
218
+ WebkitOverflowScrolling: 'touch',
219
+ borderCollapse: 'collapse',
220
+ marginBottom: '20px',
221
+ borderSpacing: 0,
222
+ '& .prop-name, & .prop-type, & .prop-default, & .slot-name, & .slot-defaultClass, & .slot-default': {
223
+ fontWeight: 400,
224
+ fontFamily: lightTheme.typography.fontFamilyCode,
225
+ WebkitFontSmoothing: 'subpixel-antialiased',
226
+ fontSize: lightTheme.typography.pxToRem(13)
227
+ },
228
+ '& .required': {
229
+ color: '#006500'
230
+ },
231
+ '& .optional': {
232
+ color: '#45529f'
233
+ },
234
+ '& .prop-type, & .slot-defaultClass': {
235
+ color: '#932981'
236
+ },
237
+ '& .prop-default, & .slot-default': {
238
+ borderBottom: `1px dotted var(--muidocs-palette-divider, ${lightTheme.palette.divider})`
239
+ }
240
+ },
241
+ '& td': {
242
+ ...theme.typography.body2,
243
+ borderBottom: `1px solid var(--muidocs-palette-divider, ${lightTheme.palette.divider})`,
244
+ paddingRight: 20,
245
+ paddingTop: 16,
246
+ paddingBottom: 16,
247
+ color: `var(--muidocs-palette-text-secondary, ${lightTheme.palette.text.secondary})`
248
+ },
249
+ '& td code': {
250
+ lineHeight: 1.6
251
+ },
252
+ '& th': {
253
+ fontSize: theme.typography.pxToRem(14),
254
+ lineHeight: theme.typography.pxToRem(24),
255
+ fontWeight: 500,
256
+ color: `var(--muidocs-palette-text-primary, ${lightTheme.palette.text.primary})`,
257
+ whiteSpace: 'pre',
258
+ borderBottom: `1px solid var(--muidocs-palette-divider, ${lightTheme.palette.divider})`,
259
+ paddingRight: 20,
260
+ paddingTop: 12,
261
+ paddingBottom: 12
262
+ },
263
+ '& blockquote': {
264
+ position: 'relative',
265
+ padding: '0 16px',
266
+ margin: 0,
267
+ borderLeft: '1.5px solid',
268
+ borderColor: `var(--muidocs-palette-grey-200, ${lightTheme.palette.grey[200]})`,
269
+ '& p': {
270
+ fontSize: theme.typography.pxToRem(12.5),
271
+ fontFamily: lightTheme.typography.fontFamilyCode,
272
+ fontWeight: lightTheme.typography.fontWeightMedium,
273
+ lineHeight: theme.typography.pxToRem(24),
274
+ textIndent: 20
275
+ },
276
+ '&::before': {
277
+ position: 'absolute',
278
+ // eslint-disable-next-line material-ui/straight-quotes
279
+ content: '"“"',
280
+ color: `var(--muidocs-palette-grey-300, ${lightTheme.palette.grey[300]})`,
281
+ fontSize: '2.5rem',
282
+ top: 8,
283
+ marginLeft: -6,
284
+ lineHeight: 0.5
285
+ }
286
+ },
287
+ '& .MuiCallout-root': {
288
+ display: 'flex',
289
+ gap: 12,
290
+ padding: '16px',
291
+ margin: '16px 0',
292
+ border: '1px solid',
293
+ color: `var(--muidocs-palette-text-secondary, ${lightTheme.palette.text.secondary})`,
294
+ borderColor: `var(--muidocs-palette-grey-100, ${lightTheme.palette.grey[100]})`,
295
+ borderRadius: `var(--muidocs-shape-borderRadius, ${theme.shape?.borderRadius ?? lightTheme.shape.borderRadius}px)`,
296
+ '& > code': {
297
+ height: 'fit-content',
298
+ backgroundColor: `var(--muidocs-palette-grey-100, ${lightTheme.palette.grey[100]})`,
299
+ borderColor: `var(--muidocs-palette-grey-300, ${lightTheme.palette.grey[300]})`
300
+ },
301
+ '& .MuiCallout-content': {
302
+ minWidth: 0,
303
+ // Allows content to shrink. Useful when callout contains code block
304
+ flexGrow: 1,
305
+ '& > p:last-child, & > ul:last-child': {
306
+ // Avoid margin on last child
307
+ marginBottom: 0
308
+ },
309
+ '& .MuiCode-root': {
310
+ '& > pre': {
311
+ margin: 0,
312
+ marginTop: 4
313
+ }
314
+ },
315
+ '& > ul': {
316
+ // Because of the gap left by the icon, we visually need less padding
317
+ paddingLeft: 22
318
+ }
319
+ },
320
+ '& > svg': {
321
+ marginTop: 2,
322
+ width: 20,
323
+ height: 20,
324
+ flexShrink: 0
325
+ },
326
+ '& > ul, & > p': {
327
+ '&:last-child': {
328
+ margin: 0
329
+ }
330
+ },
331
+ '& ul, li, p': {
332
+ color: 'inherit'
333
+ },
334
+ '&.MuiCallout-error': {
335
+ color: `var(--muidocs-palette-error-900, ${lightTheme.palette.error[900]})`,
336
+ backgroundColor: `var(--muidocs-palette-error-50, ${lightTheme.palette.error[50]})`,
337
+ borderColor: `var(--muidocs-palette-error-100, ${lightTheme.palette.error[100]})`,
338
+ '& strong': {
339
+ color: `var(--muidocs-palette-error-800, ${lightTheme.palette.error[800]})`
340
+ },
341
+ '& > svg': {
342
+ fill: `var(--muidocs-palette-error-500, ${lightTheme.palette.error[600]})`
343
+ },
344
+ '& a': {
345
+ color: `var(--muidocs-palette-error-800, ${lightTheme.palette.error[800]})`,
346
+ textDecorationColor: alpha(lightTheme.palette.error.main, 0.4),
347
+ '&:hover': {
348
+ textDecorationColor: 'inherit'
349
+ }
350
+ }
351
+ },
352
+ '&.MuiCallout-info': {
353
+ color: `var(--muidocs-palette-grey-900, ${lightTheme.palette.grey[900]})`,
354
+ backgroundColor: `var(--muidocs-palette-grey-50, ${lightTheme.palette.grey[50]})`,
355
+ borderColor: `var(--muidocs-palette-grey-100, ${lightTheme.palette.grey[100]})`,
356
+ '& strong': {
357
+ color: `var(--muidocs-palette-primary-800, ${lightTheme.palette.primary[800]})`
358
+ },
359
+ '& > svg': {
360
+ fill: `var(--muidocs-palette-grey-600, ${lightTheme.palette.grey[600]})`
361
+ }
362
+ },
363
+ '&.MuiCallout-success': {
364
+ color: `var(--muidocs-palette-success-900, ${lightTheme.palette.success[900]})`,
365
+ backgroundColor: `var(--muidocs-palette-success-50, ${lightTheme.palette.success[50]})`,
366
+ borderColor: `var(--muidocs-palette-success-100, ${lightTheme.palette.success[100]})`,
367
+ '& strong': {
368
+ color: `var(--muidocs-palette-success-900, ${lightTheme.palette.success[900]})`
369
+ },
370
+ '& > svg': {
371
+ fill: `var(--muidocs-palette-success-600, ${lightTheme.palette.success[600]})`
372
+ },
373
+ '& a': {
374
+ color: `var(--muidocs-palette-success-900, ${lightTheme.palette.success[900]})`,
375
+ textDecorationColor: alpha(lightTheme.palette.success.main, 0.4),
376
+ '&:hover': {
377
+ textDecorationColor: 'inherit'
378
+ }
379
+ }
380
+ },
381
+ '&.MuiCallout-warning': {
382
+ color: `var(--muidocs-palette-grey-900, ${lightTheme.palette.grey[900]})`,
383
+ backgroundColor: alpha(lightTheme.palette.warning[50], 0.5),
384
+ borderColor: alpha(lightTheme.palette.warning[700], 0.15),
385
+ '& strong': {
386
+ color: `var(--muidocs-palette-warning-800, ${lightTheme.palette.warning[800]})`
387
+ },
388
+ '& > svg': {
389
+ fill: `var(--muidocs-palette-warning-600, ${lightTheme.palette.warning[600]})`
390
+ },
391
+ '& a': {
392
+ color: `var(--muidocs-palette-warning-800, ${lightTheme.palette.warning[800]})`,
393
+ textDecorationColor: alpha(lightTheme.palette.warning.main, 0.4),
394
+ '&:hover': {
395
+ textDecorationColor: 'inherit'
396
+ }
397
+ }
398
+ }
399
+ },
400
+ '& a[target="_blank"]::after': {
401
+ content: '""',
402
+ 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")`,
403
+ display: 'inline-flex',
404
+ width: '1em',
405
+ height: '1em',
406
+ color: 'inherit',
407
+ backgroundColor: 'currentColor',
408
+ transform: 'translate(0, 2px)',
409
+ transition: 'transform 0.3s cubic-bezier(0.1, 0.8, 0.3, 1)',
410
+ // bounce effect
411
+ opacity: 0.8
412
+ },
413
+ '& a[target="_blank"]:hover::after': {
414
+ opacity: 1,
415
+ transform: 'translate(1px, 0)'
416
+ },
417
+ '& a.remove-link-arrow::after': {
418
+ // Allows to remove link arrows for images
419
+ display: 'none'
420
+ },
421
+ '& .Ad-root a::after': {
422
+ // Remove link arrow for ads
423
+ display: 'none'
424
+ },
425
+ '& a:not(.title-link-to-anchor), & a:not(.title-link-to-anchor) code': {
426
+ // Style taken from the Link component
427
+ color: `var(--muidocs-palette-primary-600, ${lightTheme.palette.primary[600]})`,
428
+ fontWeight: theme.typography.fontWeightMedium,
429
+ textDecoration: 'underline',
430
+ textDecorationColor: alpha(lightTheme.palette.primary.main, 0.4),
431
+ '&:hover': {
432
+ textDecorationColor: 'inherit'
433
+ }
434
+ },
435
+ '& a code': {
436
+ color: darken(lightTheme.palette.primary.main, 0.04)
437
+ },
438
+ '& a:not(.title-link-to-anchor) code': {
439
+ color: darken(lightTheme.palette.primary.main, 0.2)
440
+ },
441
+ '& img, & video': {
442
+ // Use !important so that inline style on <img> or <video> can't win.
443
+ // This avoid horizontal overflows on mobile.
444
+ maxWidth: '100% !important',
445
+ // Avoid the image to be fixed height, so it can respect the aspect ratio.
446
+ height: 'auto'
447
+ },
448
+ '& img': {
449
+ // Avoid layout jump
450
+ display: 'inline-block',
451
+ // Avoid very sharp edges
452
+ borderRadius: 2
453
+ },
454
+ '& hr': {
455
+ height: 1,
456
+ margin: theme.spacing(5, 0),
457
+ border: 0,
458
+ flexShrink: 0,
459
+ backgroundColor: `var(--muidocs-palette-divider, ${lightTheme.palette.divider})`
460
+ },
461
+ '& kbd.key': {
462
+ padding: 6,
463
+ display: 'inline-block',
464
+ whiteSpace: 'nowrap',
465
+ margin: '0 1px',
466
+ fontFamily: lightTheme.typography.fontFamilyCode,
467
+ fontSize: lightTheme.typography.pxToRem(11),
468
+ color: `var(--muidocs-palette-text-primary, ${lightTheme.palette.text.primary})`,
469
+ lineHeight: '10px',
470
+ verticalAlign: 'middle',
471
+ borderRadius: 6,
472
+ border: `1px solid var(--muidocs-palette-grey-300, ${lightTheme.palette.grey[300]})`,
473
+ backgroundColor: `var(--muidocs-palette-grey-50, ${lightTheme.palette.grey[50]})`,
474
+ boxShadow: `inset 0 -2px 0 var(--muidocs-palette-grey-200, ${lightTheme.palette.grey[200]})`
475
+ },
476
+ '& details': {
477
+ width: '100%',
478
+ padding: theme.spacing(1),
479
+ marginBottom: theme.spacing(1.5),
480
+ border: '1px solid',
481
+ borderColor: `var(--muidocs-palette-divider, ${lightTheme.palette.divider})`,
482
+ borderRadius: `var(--muidocs-shape-borderRadius, ${theme.shape?.borderRadius ?? lightTheme.shape.borderRadius}px)`,
483
+ '& pre': {
484
+ marginTop: theme.spacing(1)
485
+ }
486
+ },
487
+ '& summary': {
488
+ cursor: 'pointer',
489
+ padding: theme.spacing(1),
490
+ borderRadius: 6,
491
+ listStyleType: 'none',
492
+ display: 'flex',
493
+ alignItems: 'center',
494
+ justifyContent: 'space-between',
495
+ transition: theme.transitions.create(['background'], {
496
+ duration: theme.transitions.duration.shortest
497
+ }),
498
+ ':after': {
499
+ content: '""',
500
+ maskImage: `url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 6L8 10L12 6' stroke='black' stroke-width='1.66667' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E%0A")`,
501
+ display: 'inline-flex',
502
+ width: '1em',
503
+ height: '1em',
504
+ color: 'inherit',
505
+ backgroundColor: 'currentColor'
506
+ },
507
+ '&:hover': {
508
+ backgroundColor: `var(--muidocs-palette-grey-100, ${lightTheme.palette.grey[50]})`
509
+ }
510
+ },
511
+ '& details[open] > summary::after': {
512
+ content: '""',
513
+ maskImage: `url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 10L8 6L4 10' stroke='black' stroke-width='1.66667' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E%0A")`
514
+ },
515
+ '& .MuiCode-root': {
516
+ direction: 'ltr /*! @noflip */',
517
+ position: 'relative',
518
+ // Font size reset to fix a bug with Safari 16.0 when letterSpacing is set
519
+ fontSize: 10,
520
+ '&:has(.MuiCode-title)': {
521
+ margin: theme.spacing(2, 'auto'),
522
+ border: `1px solid var(--muidocs-palette-primaryDark-700, ${lightTheme.palette.primaryDark[700]})`,
523
+ borderRadius: theme.shape.borderRadius,
524
+ overflow: 'clip',
525
+ '& .MuiCode-copy': {
526
+ top: '56px'
527
+ }
528
+ }
529
+ },
530
+ '& .MuiCode-copy-container': {
531
+ // This container is only used in demo and highlight code
532
+ position: 'sticky',
533
+ zIndex: 1,
534
+ top: 0
535
+ },
536
+ '& .MuiCode-copy': {
537
+ cursor: 'pointer',
538
+ position: 'absolute',
539
+ top: 12,
540
+ right: 12,
541
+ display: 'inline-flex',
542
+ flexDirection: 'row-reverse',
543
+ alignItems: 'center',
544
+ height: 24,
545
+ padding: theme.spacing(0.5),
546
+ paddingBottom: '5px',
547
+ // optical alignment
548
+ fontFamily: lightTheme.typography.fontFamily,
549
+ fontWeight: lightTheme.typography.fontWeightMedium,
550
+ fontSize: lightTheme.typography.pxToRem(12),
551
+ borderRadius: 6,
552
+ border: '1px solid',
553
+ borderColor: alpha(lightTheme.palette.primaryDark[600], 0.5),
554
+ backgroundColor: alpha(lightTheme.palette.primaryDark[800], 0.5),
555
+ color: `var(--muidocs-palette-grey-300, ${lightTheme.palette.grey[300]})`,
556
+ transition: theme.transitions.create(['background', 'borderColor', 'display'], {
557
+ duration: theme.transitions.duration.shortest
558
+ }),
559
+ '& .MuiCode-copied-label': {
560
+ display: 'none'
561
+ },
562
+ '&:hover, &:focus': {
563
+ borderColor: `var(--muidocs-palette-primaryDark-400, ${lightTheme.palette.primaryDark[400]})`,
564
+ backgroundColor: `var(--muidocs-palette-primaryDark-700, ${lightTheme.palette.primaryDark[700]})`,
565
+ color: '#FFF',
566
+ '& .MuiCode-copyKeypress': {
567
+ display: 'block',
568
+ // Approximate no hover capabilities with no keyboard
569
+ // https://github.com/w3c/csswg-drafts/issues/3871
570
+ '@media (any-hover: none)': {
571
+ display: 'none'
572
+ }
573
+ }
574
+ },
575
+ '& .MuiCode-copyKeypress': {
576
+ display: 'none',
577
+ position: 'absolute',
578
+ right: 34
579
+ },
580
+ '&[data-copied]': {
581
+ borderColor: `var(--muidocs-palette-primaryDark-400, ${lightTheme.palette.primaryDark[400]})`,
582
+ backgroundColor: `var(--muidocs-palette-primaryDark-700, ${lightTheme.palette.primaryDark[700]})`,
583
+ color: '#fff',
584
+ '& .MuiCode-copyKeypress': {
585
+ opacity: 0
586
+ },
587
+ '& .MuiCode-copy-label': {
588
+ display: 'none'
589
+ },
590
+ '& .MuiCode-copied-label': {
591
+ display: 'block'
592
+ }
593
+ }
594
+ },
595
+ '& .MuiCode-copyKeypress': {
596
+ pointerEvents: 'none',
597
+ userSelect: 'none',
598
+ marginRight: theme.spacing(1.2),
599
+ marginBottom: theme.spacing(0.2),
600
+ whiteSpace: 'nowrap',
601
+ opacity: 0.6
602
+ },
603
+ '& li': {
604
+ // tight lists https://spec.commonmark.org/0.30/#tight
605
+ marginBottom: 4,
606
+ '& pre': {
607
+ marginTop: theme.spacing(1)
608
+ },
609
+ // loose lists https://spec.commonmark.org/0.30/#loose
610
+ '& > p': {
611
+ marginBottom: theme.spacing(1)
612
+ }
613
+ },
614
+ '& .feature-list': {
615
+ padding: 0,
616
+ listStyle: 'none',
617
+ '& li': {
618
+ marginBottom: 6,
619
+ display: 'flex',
620
+ alignItems: 'center',
621
+ gap: 12,
622
+ '::before': {
623
+ content: `url('/static/branding/pricing/yes-light.svg')`,
624
+ width: '18px',
625
+ height: '18px'
626
+ }
627
+ }
628
+ },
629
+ '& .MuiCode-title': {
630
+ padding: theme.spacing(1.5),
631
+ display: 'flex',
632
+ alignItems: 'center',
633
+ gap: theme.spacing(1.5),
634
+ borderBottom: `1px solid var(--muidocs-palette-primaryDark-700, ${lightTheme.palette.primaryDark[700]})`,
635
+ backgroundColor: `var(--muidocs-palette-primaryDark-900, ${lightTheme.palette.primaryDark[900]})`,
636
+ fontFamily: theme.typography.fontFamilyCode,
637
+ fontSize: theme.typography.pxToRem(12),
638
+ fontWeight: theme.typography.fontWeightBold,
639
+ color: `var(--muidocs-palette-grey-200, ${lightTheme.palette.grey[200]})`,
640
+ '::before': {
641
+ content: `url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M13.3333 3.99996H8L7.06 3.05996C6.80667 2.80663 6.46667 2.66663 6.11334 2.66663H2.66667C1.93334 2.66663 1.34 3.26663 1.34 3.99996L1.33334 12C1.33334 12.7333 1.93334 13.3333 2.66667 13.3333H13.3333C14.0667 13.3333 14.6667 12.7333 14.6667 12V5.33329C14.6667 4.59996 14.0667 3.99996 13.3333 3.99996ZM12.6667 12H3.33334C2.96667 12 2.66667 11.7 2.66667 11.3333V5.99996C2.66667 5.63329 2.96667 5.33329 3.33334 5.33329H12.6667C13.0333 5.33329 13.3333 5.63329 13.3333 5.99996V11.3333C13.3333 11.7 13.0333 12 12.6667 12Z' fill='%2399CCF3'/%3E%3C/svg%3E%0A");`,
642
+ width: '16px',
643
+ height: '16px'
644
+ },
645
+ '& + pre': {
646
+ margin: 0,
647
+ border: 'none',
648
+ borderRadius: 0
649
+ }
650
+ }
651
+ }), ({
652
+ theme
653
+ }) => ({
654
+ [`:where(${theme.vars ? '[data-mui-color-scheme="dark"]' : '.mode-dark'}) &`]: {
655
+ color: 'rgb(255, 255, 255)',
656
+ '& :not(pre) > code': {
657
+ // inline code block
658
+ color: `var(--muidocs-palette-text-primary, ${darkTheme.palette.text.primary})`,
659
+ borderColor: alpha(darkTheme.palette.primaryDark[600], 0.6),
660
+ backgroundColor: `var(--muidocs-palette-grey-900, ${darkTheme.palette.grey[900]})`
661
+ },
662
+ '& strong': {
663
+ color: `var(--muidocs-palette-grey-200, ${darkTheme.palette.grey[200]})`
664
+ },
665
+ '& hr': {
666
+ backgroundColor: `var(--muidocs-palette-divider, ${darkTheme.palette.divider})`
667
+ },
668
+ '& h1, & h2, & h3, & h4, & h5': {
669
+ color: `var(--muidocs-palette-grey-50, ${darkTheme.palette.grey[50]})`
670
+ },
671
+ '& p, & ul, & ol': {
672
+ color: `var(--muidocs-palette-grey-400, ${darkTheme.palette.grey[400]})`
673
+ },
674
+ '& h1, & h2, & h3, & h4': {
675
+ '&:hover .anchor-icon, & .comment-link': {
676
+ color: `var(--muidocs-palette-primary-300, ${darkTheme.palette.primaryDark[300]})`,
677
+ borderColor: `var(--muidocs-palette-divider, ${darkTheme.palette.divider})`,
678
+ backgroundColor: alpha(darkTheme.palette.primaryDark[700], 0.5),
679
+ '&:hover': {
680
+ 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]})`
683
+ }
684
+ }
685
+ },
686
+ '& h1 code, & h2 code, & h3 code': {
687
+ color: `var(--muidocs-palette-grey-100, ${darkTheme.palette.grey[100]})`
688
+ },
689
+ '& table': {
690
+ '& .required': {
691
+ color: '#a5ffa5'
692
+ },
693
+ '& .optional': {
694
+ color: '#a5b3ff'
695
+ },
696
+ '& .prop-type, & .slot-defaultClass': {
697
+ color: '#ffb6ec'
698
+ },
699
+ '& .prop-default, & .slot-default': {
700
+ borderColor: `var(--muidocs-palette-divider, ${darkTheme.palette.divider})`
701
+ }
702
+ },
703
+ '& td': {
704
+ color: `var(--muidocs-palette-text-secondary, ${darkTheme.palette.text.secondary})`,
705
+ borderColor: `var(--muidocs-palette-divider, ${darkTheme.palette.divider})`
706
+ },
707
+ '& th': {
708
+ color: `var(--muidocs-palette-text-primary, ${darkTheme.palette.text.primary})`,
709
+ borderColor: `var(--muidocs-palette-divider, ${darkTheme.palette.divider})`
710
+ },
711
+ '& blockquote': {
712
+ borderColor: `var(--muidocs-palette-primaryDark-700, ${darkTheme.palette.primaryDark[700]})`,
713
+ '&::before': {
714
+ color: `var(--muidocs-palette-primaryDark-500, ${darkTheme.palette.primaryDark[500]})`
715
+ }
716
+ },
717
+ '& .MuiCallout-root': {
718
+ borderColor: `var(--muidocs-palette-primaryDark-700, ${darkTheme.palette.primaryDark[700]})`,
719
+ '& > code': {
720
+ height: 'fit-content',
721
+ backgroundColor: `var(--muidocs-palette-primaryDark-600, ${darkTheme.palette.primaryDark[600]})`,
722
+ borderColor: `var(--muidocs-palette-primaryDark-500, ${darkTheme.palette.primaryDark[500]})`
723
+ },
724
+ '&.MuiCallout-error': {
725
+ color: `var(--muidocs-palette-error-50, ${darkTheme.palette.error[50]})`,
726
+ backgroundColor: alpha(darkTheme.palette.error[700], 0.15),
727
+ borderColor: alpha(darkTheme.palette.error[400], 0.1),
728
+ '& strong': {
729
+ color: `var(--muidocs-palette-error-300, ${darkTheme.palette.error[300]})`
730
+ },
731
+ '& > svg': {
732
+ fill: `var(--muidocs-palette-error-500, ${darkTheme.palette.error[500]})`
733
+ },
734
+ '& a': {
735
+ color: `var(--muidocs-palette-error-200, ${darkTheme.palette.error[200]})`
736
+ }
737
+ },
738
+ '&.MuiCallout-info': {
739
+ color: `var(--muidocs-palette-grey-50, ${darkTheme.palette.grey[50]})`,
740
+ backgroundColor: alpha(darkTheme.palette.grey[700], 0.15),
741
+ borderColor: alpha(darkTheme.palette.grey[800], 0.5),
742
+ '& strong': {
743
+ color: `var(--muidocs-palette-primary-200, ${darkTheme.palette.primary[200]})`
744
+ },
745
+ '& > svg': {
746
+ fill: `var(--muidocs-palette-grey-400, ${darkTheme.palette.grey[400]})`
747
+ }
748
+ },
749
+ '&.MuiCallout-success': {
750
+ color: `var(--muidocs-palette-success-50, ${darkTheme.palette.success[50]})`,
751
+ backgroundColor: alpha(darkTheme.palette.success[700], 0.12),
752
+ borderColor: alpha(lightTheme.palette.success[400], 0.1),
753
+ '& strong': {
754
+ color: `var(--muidocs-palette-success-200, ${darkTheme.palette.success[200]})`
755
+ },
756
+ '& > svg': {
757
+ fill: `var(--muidocs-palette-success-500, ${darkTheme.palette.success[500]})`
758
+ },
759
+ '& a': {
760
+ color: `var(--muidocs-palette-success-100, ${darkTheme.palette.success[100]})`
761
+ }
762
+ },
763
+ '&.MuiCallout-warning': {
764
+ color: `var(--muidocs-palette-warning-50, ${darkTheme.palette.warning[50]})`,
765
+ backgroundColor: alpha(darkTheme.palette.warning[700], 0.12),
766
+ borderColor: alpha(darkTheme.palette.warning[400], 0.1),
767
+ '& strong': {
768
+ color: `var(--muidocs-palette-warning-200, ${darkTheme.palette.warning[200]})`
769
+ },
770
+ '& > svg': {
771
+ fill: `var(--muidocs-palette-warning-400, ${darkTheme.palette.warning[400]})`
772
+ },
773
+ '& a': {
774
+ color: `var(--muidocs-palette-warning-100, ${darkTheme.palette.warning[100]})`
775
+ }
776
+ }
777
+ },
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
+ '& kbd.key': {
785
+ color: `var(--muidocs-palette-text-primary, ${darkTheme.palette.text.primary})`,
786
+ backgroundColor: `var(--muidocs-palette-primaryDark-800, ${darkTheme.palette.primaryDark[800]})`,
787
+ border: `1px solid var(--muidocs-palette-primaryDark-600, ${darkTheme.palette.primaryDark[600]})`,
788
+ boxShadow: `inset 0 -2px 0 var(--muidocs-palette-primaryDark-700, ${darkTheme.palette.primaryDark[700]})`
789
+ },
790
+ '& details': {
791
+ borderColor: `var(--muidocs-palette-divider, ${darkTheme.palette.divider})`
792
+ },
793
+ '& summary': {
794
+ '&:hover': {
795
+ backgroundColor: `var(--muidocs-palette-primaryDark-800, ${darkTheme.palette.primaryDark[800]})`
796
+ }
797
+ },
798
+ '& .feature-list': {
799
+ '& li': {
800
+ '::before': {
801
+ content: `url('/static/branding/pricing/yes-dark.svg')`
802
+ }
803
+ }
804
+ }
805
+ }
806
+ }));
807
+ function handleHeaderClick(event) {
808
+ const selection = document.getSelection();
809
+ if (selection === null) {
810
+ return;
811
+ }
812
+ if (selection.type === 'Range') {
813
+ // Disable the <a> behavior to be able to select text.
814
+ event.preventDefault();
815
+ }
816
+ }
817
+ export const MarkdownElement = /*#__PURE__*/React.forwardRef(function MarkdownElement(props, ref) {
818
+ const {
819
+ className,
820
+ renderedMarkdown,
821
+ ...other
822
+ } = props;
823
+ const rootRef = React.useRef(null);
824
+ const handleRef = useForkRef(rootRef, ref);
825
+ React.useEffect(() => {
826
+ const elements = rootRef.current.getElementsByClassName('title-link-to-anchor');
827
+ for (let i = 0; i < elements.length; i += 1) {
828
+ // More reliable than `-webkit-user-drag` (https://caniuse.com/webkit-user-drag)
829
+ elements[i].setAttribute('draggable', 'false');
830
+ elements[i].addEventListener('click', handleHeaderClick);
831
+ }
832
+ }, []);
833
+ const more = {};
834
+ if (typeof renderedMarkdown === 'string') {
835
+ // workaround for https://github.com/facebook/react/issues/17170
836
+ // otherwise we could just set `dangerouslySetInnerHTML={undefined}`
837
+ more.dangerouslySetInnerHTML = {
838
+ __html: renderedMarkdown
839
+ };
840
+ }
841
+ return /*#__PURE__*/_jsx(Root, {
842
+ className: clsx('markdown-body', className),
843
+ ...more,
844
+ ...other,
845
+ ref: handleRef
846
+ });
847
+ });