@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,67 +0,0 @@
1
- import * as React from 'react';
2
- import prism from '@mui/internal-markdown/prism';
3
- import { NoSsr } from '@mui/base/NoSsr';
4
- import { styled } from '@mui/material/styles';
5
- import { useCodeCopy, CodeCopyButton } from "../CodeCopy/index.mjs";
6
- import { MarkdownElement } from "../MarkdownElement/index.mjs";
7
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
8
- const Pre = styled('pre')(({
9
- theme
10
- }) => ({
11
- margin: 0,
12
- color: 'hsl(60deg 30% 96.08%)',
13
- // fallback color until Prism's theme is loaded
14
- WebkitOverflowScrolling: 'touch',
15
- // iOS momentum scrolling.
16
- '& code': {
17
- // Avoid layout jump after hydration (style injected by Prism)
18
- ...theme.typography.caption,
19
- fontFamily: theme.typography.fontFamilyCode,
20
- fontWeight: 400,
21
- WebkitFontSmoothing: 'subpixel-antialiased'
22
- // Reset for Safari
23
- // https://github.com/necolas/normalize.css/blob/master/normalize.css#L102
24
- }
25
- }));
26
- export function HighlightedCode(props) {
27
- const {
28
- code,
29
- copyButtonHidden = false,
30
- copyButtonProps,
31
- language,
32
- plainStyle,
33
- parentComponent: Component = plainStyle ? React.Fragment : MarkdownElement,
34
- preComponent: PreComponent = plainStyle ? Pre : 'pre',
35
- ...other
36
- } = props;
37
- const renderedCode = React.useMemo(() => {
38
- return prism(code.trim(), language);
39
- }, [code, language]);
40
- const handlers = useCodeCopy();
41
- const componentProps = !plainStyle ? other : undefined;
42
- return /*#__PURE__*/_jsx(Component, {
43
- ...componentProps,
44
- children: /*#__PURE__*/_jsxs("div", {
45
- className: "MuiCode-root",
46
- ...handlers,
47
- style: {
48
- height: '100%'
49
- },
50
- children: [copyButtonHidden ? null : /*#__PURE__*/_jsx(NoSsr, {
51
- children: /*#__PURE__*/_jsx(CodeCopyButton, {
52
- code: code,
53
- ...copyButtonProps
54
- })
55
- }), /*#__PURE__*/_jsx(PreComponent, {
56
- children: /*#__PURE__*/_jsx("code", {
57
- className: `language-${language}`
58
- // eslint-disable-next-line react/no-danger
59
- ,
60
- dangerouslySetInnerHTML: {
61
- __html: renderedCode
62
- }
63
- })
64
- })]
65
- })
66
- });
67
- }
@@ -1 +0,0 @@
1
- export * from "./HighlightedCode.mjs";
@@ -1 +0,0 @@
1
- export * from "./HighlightedCode.mjs";
@@ -1,28 +0,0 @@
1
- export declare const CodeTabList: import("@emotion/styled").StyledComponent<import("@mui/base/TabsList").TabsListOwnProps & Omit<any, keyof import("@mui/base/TabsList").TabsListOwnProps> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & {
2
- ownerState: {
3
- mounted: boolean;
4
- contained?: boolean;
5
- };
6
- }, {}, {}>;
7
- export declare const CodeTabPanel: import("@emotion/styled").StyledComponent<import("@mui/base/TabPanel").TabPanelOwnProps & Omit<any, keyof import("@mui/base/TabPanel").TabPanelOwnProps> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & {
8
- ownerState: {
9
- mounted: boolean;
10
- contained?: boolean;
11
- };
12
- }, {}, {}>;
13
- export declare const CodeTab: import("@emotion/styled").StyledComponent<import("@mui/base/Tab").TabOwnProps & Omit<any, keyof import("@mui/base/Tab").TabOwnProps> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & {
14
- ownerState: {
15
- mounted: boolean;
16
- contained?: boolean;
17
- };
18
- }, {}, {}>;
19
- type TabsConfig = {
20
- code: string | ((tab: string) => string);
21
- language: string;
22
- tab: string;
23
- };
24
- export declare function HighlightedCodeWithTabs(props: {
25
- tabs: Array<TabsConfig>;
26
- storageKey?: string;
27
- } & Record<string, any>): import("react/jsx-runtime").JSX.Element;
28
- export {};
@@ -1,362 +0,0 @@
1
- import * as React from 'react';
2
- import { styled, alpha } from '@mui/material/styles';
3
- import { Tabs } from '@mui/base/Tabs';
4
- import { TabsList as TabsListBase } from '@mui/base/TabsList';
5
- import { TabPanel as TabPanelBase } from '@mui/base/TabPanel';
6
- import { Tab as TabBase } from '@mui/base/Tab';
7
- import useLocalStorageState from '@mui/utils/useLocalStorageState';
8
- import { HighlightedCode } from "../HighlightedCode/index.mjs";
9
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
10
- const PACKAGE_MANAGER_ORDER = new Map(['npm', 'pnpm', 'yarn'].map((manager, index) => [manager, index]));
11
- export const CodeTabList = styled(TabsListBase)(({
12
- theme
13
- }) => ({
14
- display: 'flex',
15
- gap: theme.spacing(0.5),
16
- borderLeft: '1px solid',
17
- borderRight: '1px solid',
18
- overflowX: 'auto',
19
- ...theme.applyDarkStyles({
20
- backgroundColor: alpha(theme.palette.primaryDark[800], 0.2)
21
- }),
22
- variants: [{
23
- props: ({
24
- ownerState
25
- }) => ownerState?.contained,
26
- style: {
27
- padding: theme.spacing(1.5, 1)
28
- }
29
- }, {
30
- props: ({
31
- ownerState
32
- }) => !ownerState?.contained,
33
- style: {
34
- padding: theme.spacing(1)
35
- }
36
- }, {
37
- props: ({
38
- ownerState
39
- }) => ownerState?.contained,
40
- style: {
41
- borderTop: 'none'
42
- }
43
- }, {
44
- props: ({
45
- ownerState
46
- }) => !ownerState?.contained,
47
- style: {
48
- borderTop: '1px solid'
49
- }
50
- }, {
51
- props: ({
52
- ownerState
53
- }) => ownerState?.contained,
54
- style: {
55
- borderBottom: 'none'
56
- }
57
- }, {
58
- props: ({
59
- ownerState
60
- }) => !ownerState?.contained,
61
- style: {
62
- borderBottom: '1px solid'
63
- }
64
- }, {
65
- props: ({
66
- ownerState
67
- }) => ownerState?.contained,
68
- style: {
69
- borderTopLeftRadius: 0
70
- }
71
- }, {
72
- props: ({
73
- ownerState
74
- }) => !ownerState?.contained,
75
- style: {
76
- borderTopLeftRadius: (theme.vars || theme).shape.borderRadius
77
- }
78
- }, {
79
- props: ({
80
- ownerState
81
- }) => ownerState?.contained,
82
- style: {
83
- borderTopRightRadius: 0
84
- }
85
- }, {
86
- props: ({
87
- ownerState
88
- }) => !ownerState?.contained,
89
- style: {
90
- borderTopRightRadius: (theme.vars || theme).shape.borderRadius
91
- }
92
- }, {
93
- props: ({
94
- ownerState
95
- }) => ownerState?.contained,
96
- style: {
97
- borderColor: (theme.vars || theme).palette.divider
98
- }
99
- }, {
100
- props: ({
101
- ownerState
102
- }) => !ownerState?.contained,
103
- style: {
104
- borderColor: (theme.vars || theme).palette.primaryDark[700]
105
- }
106
- }, {
107
- props: ({
108
- ownerState
109
- }) => ownerState?.contained,
110
- style: {
111
- backgroundColor: alpha(theme.palette.grey[50], 0.2)
112
- }
113
- }, {
114
- props: ({
115
- ownerState
116
- }) => !ownerState?.contained,
117
- style: {
118
- backgroundColor: (theme.vars || theme).palette.primaryDark[900]
119
- }
120
- }]
121
- }));
122
- export const CodeTabPanel = styled(TabPanelBase)({
123
- '& pre': {
124
- borderTopLeftRadius: 0,
125
- borderTopRightRadius: 0,
126
- '& code': {}
127
- },
128
- variants: [{
129
- props: ({
130
- ownerState
131
- }) => ownerState?.contained,
132
- style: {
133
- marginTop: -1
134
- }
135
- }, {
136
- props: ({
137
- ownerState
138
- }) => !ownerState?.contained,
139
- style: {
140
- marginTop: 0
141
- }
142
- }, {
143
- props: ({
144
- ownerState
145
- }) => ownerState?.contained,
146
- style: {
147
- '& pre': {
148
- marginTop: 0
149
- }
150
- }
151
- }, {
152
- props: ({
153
- ownerState
154
- }) => !ownerState?.contained,
155
- style: {
156
- '& pre': {
157
- marginTop: -1
158
- }
159
- }
160
- }, {
161
- props: ({
162
- ownerState
163
- }) => ownerState.mounted,
164
- style: {
165
- '& pre': {
166
- '& code': {
167
- opacity: 1
168
- }
169
- }
170
- }
171
- }, {
172
- props: ({
173
- ownerState
174
- }) => !ownerState.mounted,
175
- style: {
176
- '& pre': {
177
- '& code': {
178
- opacity: 0
179
- }
180
- }
181
- }
182
- }]
183
- });
184
- export const CodeTab = styled(TabBase)(({
185
- theme
186
- }) => ({
187
- variants: [{
188
- props: ({
189
- ownerState
190
- }) => ownerState?.contained,
191
- style: {
192
- border: '1px solid transparent',
193
- fontSize: theme.typography.pxToRem(13)
194
- }
195
- }, {
196
- props: ({
197
- ownerState
198
- }) => !ownerState?.contained,
199
- style: {
200
- border: 'none',
201
- fontSize: theme.typography.pxToRem(12)
202
- }
203
- }, {
204
- props: ({
205
- ownerState
206
- }) => ownerState?.contained,
207
- style: {
208
- color: (theme.vars || theme).palette.text.tertiary
209
- }
210
- }, {
211
- props: ({
212
- ownerState
213
- }) => !ownerState?.contained,
214
- style: {
215
- color: (theme.vars || theme).palette.grey[500]
216
- }
217
- }, {
218
- props: ({
219
- ownerState
220
- }) => ownerState?.contained,
221
- style: {
222
- fontFamily: theme.typography.fontFamily
223
- }
224
- }, {
225
- props: ({
226
- ownerState
227
- }) => !ownerState?.contained,
228
- style: {
229
- fontFamily: theme.typography.fontFamilyCode
230
- }
231
- }, {
232
- props: ({
233
- ownerState
234
- }) => ownerState?.contained,
235
- style: {
236
- fontWeight: theme.typography.fontWeightMedium
237
- }
238
- }, {
239
- props: ({
240
- ownerState
241
- }) => !ownerState?.contained,
242
- style: {
243
- fontWeight: theme.typography.fontWeightBold
244
- }
245
- }, {
246
- props: ({
247
- ownerState
248
- }) => ownerState?.contained,
249
- style: {
250
- transition: 'background, color, 100ms ease'
251
- }
252
- }, {
253
- props: ({
254
- ownerState
255
- }) => !ownerState?.contained,
256
- style: {
257
- transition: 'unset'
258
- }
259
- }, {
260
- props: ({
261
- ownerState
262
- }) => !ownerState?.contained,
263
- style: {
264
- '&:hover': {
265
- backgroundColor: alpha(theme.palette.primaryDark[500], 0.5),
266
- color: (theme.vars || theme).palette.grey[400]
267
- }
268
- }
269
- }, {
270
- props: ({
271
- ownerState
272
- }) => !ownerState?.contained && ownerState.mounted,
273
- style: {
274
- '&.base--selected': {
275
- color: '#FFF',
276
- '&::after': {
277
- content: "''",
278
- position: 'absolute',
279
- left: 0,
280
- bottom: '-8px',
281
- height: 2,
282
- width: '100%',
283
- bgcolor: (theme.vars || theme).palette.primary.light
284
- }
285
- }
286
- }
287
- }],
288
- ...theme.unstable_sx({
289
- flex: '0 0 auto',
290
- height: 26,
291
- p: '2px 8px',
292
- bgcolor: 'transparent',
293
- lineHeight: 1.2,
294
- outline: 'none',
295
- minWidth: 45,
296
- cursor: 'pointer',
297
- borderRadius: 99,
298
- position: 'relative',
299
- '&:hover': {
300
- backgroundColor: (theme.vars || theme).palette.divider
301
- },
302
- '&:focus-visible': {
303
- outline: '3px solid',
304
- outlineOffset: '1px',
305
- outlineColor: (theme.vars || theme).palette.primary.light
306
- }
307
- })
308
- }));
309
- export function HighlightedCodeWithTabs(props) {
310
- const {
311
- tabs,
312
- storageKey
313
- } = props;
314
- const availableTabs = React.useMemo(() => {
315
- const result = tabs.map(({
316
- tab
317
- }) => tab);
318
- if (storageKey === 'package-manager') {
319
- result.sort((a, b) => (PACKAGE_MANAGER_ORDER.get(a) ?? Infinity) - (PACKAGE_MANAGER_ORDER.get(b) ?? Infinity));
320
- }
321
- return result;
322
- }, [storageKey, tabs]);
323
- const [activeTab, setActiveTab] = useLocalStorageState(storageKey ?? null, availableTabs[0]);
324
- // During hydration, activeTab is null, default to first value.
325
- const defaultizedActiveTab = activeTab ?? availableTabs[0];
326
- const [mounted, setMounted] = React.useState(false);
327
- React.useEffect(() => {
328
- setMounted(true);
329
- }, []);
330
- const handleChange = (event, newValue) => {
331
- setActiveTab(newValue);
332
- };
333
- const ownerState = {
334
- mounted
335
- };
336
- return /*#__PURE__*/_jsxs(Tabs, {
337
- selectionFollowsFocus: true,
338
- value: defaultizedActiveTab,
339
- onChange: handleChange,
340
- children: [/*#__PURE__*/_jsx(CodeTabList, {
341
- ownerState: ownerState,
342
- children: tabs.map(({
343
- tab
344
- }) => /*#__PURE__*/_jsx(CodeTab, {
345
- ownerState: ownerState,
346
- value: tab,
347
- children: tab
348
- }, tab))
349
- }), tabs.map(({
350
- tab,
351
- language,
352
- code
353
- }) => /*#__PURE__*/_jsx(CodeTabPanel, {
354
- ownerState: ownerState,
355
- value: tab,
356
- children: /*#__PURE__*/_jsx(HighlightedCode, {
357
- language: language || 'bash',
358
- code: typeof code === 'function' ? code(tab) : code
359
- })
360
- }, tab))]
361
- });
362
- }
@@ -1,2 +0,0 @@
1
- export * from "./HighlightedCodeWithTabs.mjs";
2
- export { HighlightedCodeWithTabs as default } from "./HighlightedCodeWithTabs.mjs";
@@ -1,2 +0,0 @@
1
- export * from "./HighlightedCodeWithTabs.mjs";
2
- export { HighlightedCodeWithTabs as default } from "./HighlightedCodeWithTabs.mjs";
@@ -1,22 +0,0 @@
1
- import * as React from 'react';
2
- import { TypographyProps } from '@mui/material/Typography';
3
- import { LinkProps } from "../Link/index.mjs";
4
- interface GlowingIconContainerProps {
5
- icon: React.ReactNode;
6
- }
7
- export declare function GlowingIconContainer({
8
- icon
9
- }: GlowingIconContainerProps): import("react/jsx-runtime").JSX.Element;
10
- interface InfoCardProps {
11
- classNameDescription?: string;
12
- classNameTitle?: string;
13
- description?: string;
14
- icon?: React.ReactNode;
15
- link?: string;
16
- prefetch?: LinkProps['prefetch'];
17
- svg?: React.ReactNode;
18
- title: string;
19
- titleProps?: TypographyProps;
20
- }
21
- export declare function InfoCard(props: InfoCardProps): import("react/jsx-runtime").JSX.Element;
22
- export {};
@@ -1,87 +0,0 @@
1
- import * as React from 'react';
2
- import { alpha } from '@mui/material/styles';
3
- import Box from '@mui/material/Box';
4
- import Paper from '@mui/material/Paper';
5
- import Typography from '@mui/material/Typography';
6
- import { Link } from "../Link/index.mjs";
7
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
8
- export function GlowingIconContainer({
9
- icon
10
- }) {
11
- return /*#__PURE__*/_jsx(Box, {
12
- sx: theme => ({
13
- width: 36,
14
- height: 36,
15
- display: 'flex',
16
- justifyContent: 'center',
17
- alignItems: 'center',
18
- flexShrink: 0,
19
- borderRadius: 1,
20
- border: '1px solid',
21
- borderColor: 'primary.200',
22
- bgcolor: 'primary.50',
23
- boxShadow: `0px 0 0 2px ${alpha(theme.palette.primary[500], 0.1)}, 0px 2px 12px 0px rgba(234, 237, 241, 0.3) inset`,
24
- '& .MuiSvgIcon-root': {
25
- fontSize: theme.typography.pxToRem(18)
26
- },
27
- ...theme.applyDarkStyles({
28
- borderColor: alpha(theme.palette.primary[400], 0.25),
29
- bgcolor: alpha(theme.palette.primary[900], 0.2),
30
- boxShadow: `0 0 0 2px ${alpha(theme.palette.primary[600], 0.1)}, 0px 2px 12px 0px rgba(0, 0, 0, 0.25) inset`
31
- })
32
- }),
33
- children: icon
34
- });
35
- }
36
- export function InfoCard(props) {
37
- const {
38
- classNameDescription,
39
- classNameTitle,
40
- description,
41
- icon,
42
- link,
43
- svg,
44
- title,
45
- titleProps,
46
- ...other
47
- } = props;
48
- return /*#__PURE__*/_jsxs(Paper, {
49
- variant: "outlined",
50
- component: link ? Link : 'div',
51
- href: link,
52
- ...(link ? {
53
- noLinkStyle: true,
54
- // Fix overloading with prefetch={false}, only prefetch on hover.
55
- prefetch: false
56
- } : {}),
57
- sx: theme => ({
58
- p: 2.5,
59
- height: '100%',
60
- background: `${(theme.vars || theme).palette.gradients.linearSubtle}`,
61
- ...theme.applyDarkStyles({
62
- bgcolor: alpha(theme.palette.primaryDark[800], 0.25),
63
- background: `${(theme.vars || theme).palette.gradients.linearSubtle}`,
64
- borderColor: 'primaryDark.700'
65
- })
66
- }),
67
- ...other,
68
- children: [svg && svg, icon && /*#__PURE__*/_jsx(GlowingIconContainer, {
69
- icon: icon
70
- }), /*#__PURE__*/_jsx(Typography, {
71
- fontWeight: "semiBold",
72
- component: "h3",
73
- color: "text.primary",
74
- variant: "body2",
75
- mt: icon ? 2 : 0,
76
- mb: description ? 0.5 : 0,
77
- className: classNameTitle,
78
- ...titleProps,
79
- children: title
80
- }), /*#__PURE__*/_jsx(Typography, {
81
- variant: "body2",
82
- color: "text.secondary",
83
- className: classNameDescription,
84
- children: description
85
- })]
86
- });
87
- }
@@ -1 +0,0 @@
1
- export * from "./InfoCard.mjs";
@@ -1 +0,0 @@
1
- export * from "./InfoCard.mjs";
package/Link/Link.d.mts DELETED
@@ -1,25 +0,0 @@
1
- import * as React from 'react';
2
- import { LinkProps as NextLinkProps } from 'next/link';
3
- import { LinkProps as MuiLinkProps } from '@mui/material/Link';
4
- /**
5
- * File to keep in sync with:
6
- *
7
- * - /packages/mui-docs/src/Link/Link.tsx
8
- * - /examples/material-ui-nextjs-pages-router/src/Link.js
9
- * - /examples/material-ui-nextjs-pages-router-ts/src/Link.tsx
10
- * - /examples/material-ui-nextjs-ts-v4-v5-migration/src/Link.tsx
11
- */
12
- interface NextLinkComposedProps extends Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'href'>, Omit<NextLinkProps, 'href' | 'as' | 'passHref' | 'onMouseEnter' | 'onClick' | 'onTouchStart'> {
13
- to: NextLinkProps['href'];
14
- linkAs?: NextLinkProps['as'];
15
- }
16
- export declare const NextLinkComposed: React.ForwardRefExoticComponent<NextLinkComposedProps & React.RefAttributes<HTMLAnchorElement>>;
17
- export type LinkProps = {
18
- activeClassName?: string;
19
- as?: NextLinkProps['as'];
20
- href: NextLinkProps['href'];
21
- linkAs?: NextLinkProps['as'];
22
- noLinkStyle?: boolean;
23
- } & Omit<NextLinkComposedProps, 'to' | 'linkAs' | 'href'> & Omit<MuiLinkProps, 'href'>;
24
- export declare const Link: React.ForwardRefExoticComponent<Omit<LinkProps, "ref"> & React.RefAttributes<HTMLAnchorElement>>;
25
- export {};
package/Link/Link.mjs DELETED
@@ -1,75 +0,0 @@
1
- import * as React from 'react';
2
- import clsx from 'clsx';
3
- import { useRouter } from 'next/router';
4
- import NextLink from 'next/link';
5
- import MuiLink from '@mui/material/Link';
6
- import { useUserLanguage } from "../i18n/index.mjs";
7
- import { useDocsConfig } from "../DocsProvider/index.mjs";
8
-
9
- /**
10
- * File to keep in sync with:
11
- *
12
- * - /packages/mui-docs/src/Link/Link.tsx
13
- * - /examples/material-ui-nextjs-pages-router/src/Link.js
14
- * - /examples/material-ui-nextjs-pages-router-ts/src/Link.tsx
15
- * - /examples/material-ui-nextjs-ts-v4-v5-migration/src/Link.tsx
16
- */
17
- import { jsx as _jsx } from "react/jsx-runtime";
18
- export const NextLinkComposed = /*#__PURE__*/React.forwardRef(function NextLinkComposed(props, ref) {
19
- const {
20
- to,
21
- linkAs,
22
- ...other
23
- } = props;
24
- return /*#__PURE__*/_jsx(NextLink, {
25
- href: to,
26
- as: linkAs,
27
- "data-no-markdown-link": "true",
28
- ref: ref,
29
- ...other
30
- });
31
- });
32
- // A styled version of the Next.js Link component:
33
- // https://nextjs.org/docs/pages/api-reference/components/link
34
- export const Link = /*#__PURE__*/React.forwardRef(function Link(props, ref) {
35
- const {
36
- activeClassName = 'active',
37
- as,
38
- className: classNameProps,
39
- href,
40
- linkAs: linkAsProp,
41
- noLinkStyle,
42
- ...other
43
- } = props;
44
- const router = useRouter();
45
- const pathname = typeof href === 'string' ? href : href?.pathname;
46
- const routerPathname = router.pathname.replace('/[docsTab]', '');
47
- const className = clsx(classNameProps, routerPathname === pathname && activeClassName);
48
- const userLanguage = useUserLanguage();
49
- const {
50
- LANGUAGES_IGNORE_PAGES
51
- } = useDocsConfig();
52
- let linkAs = linkAsProp || as || href;
53
- if (userLanguage !== 'en' && pathname && pathname.startsWith('/') && !LANGUAGES_IGNORE_PAGES(pathname) && !pathname.startsWith(`/${userLanguage}/`)) {
54
- linkAs = `/${userLanguage}${linkAs}`;
55
- }
56
- const nextjsProps = {
57
- to: href,
58
- linkAs
59
- };
60
- if (noLinkStyle) {
61
- return /*#__PURE__*/_jsx(NextLinkComposed, {
62
- className: className,
63
- ref: ref,
64
- ...nextjsProps,
65
- ...other
66
- });
67
- }
68
- return /*#__PURE__*/_jsx(MuiLink, {
69
- component: NextLinkComposed,
70
- className: className,
71
- ref: ref,
72
- ...nextjsProps,
73
- ...other
74
- });
75
- });
package/Link/index.d.mts DELETED
@@ -1 +0,0 @@
1
- export * from "./Link.mjs";
package/Link/index.mjs DELETED
@@ -1 +0,0 @@
1
- export * from "./Link.mjs";