@mui/docs 9.0.0-alpha.1 → 9.0.0-alpha.3

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