@mui/docs 7.0.0-alpha.0 → 7.0.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Ad/Ad.d.ts +1 -1
- package/Ad/Ad.js +42 -33
- package/Ad/AdCarbon.d.ts +1 -1
- package/Ad/AdCarbon.js +31 -18
- package/Ad/AdDisplay.d.ts +10 -10
- package/Ad/AdDisplay.js +28 -21
- package/Ad/AdGuest.d.ts +6 -6
- package/Ad/AdGuest.js +15 -8
- package/Ad/AdInHouse.d.ts +3 -3
- package/Ad/AdInHouse.js +13 -5
- package/Ad/AdManager.d.ts +12 -9
- package/Ad/AdManager.js +17 -8
- package/Ad/AdProvider.d.ts +9 -9
- package/Ad/AdProvider.js +13 -5
- package/Ad/ad.styles.d.ts +4322 -4322
- package/Ad/ad.styles.js +13 -5
- package/Ad/index.d.ts +5 -5
- package/Ad/index.js +62 -6
- package/CHANGELOG.md +61 -0
- package/CodeCopy/CodeCopy.d.ts +5 -3
- package/CodeCopy/CodeCopy.js +19 -10
- package/CodeCopy/CodeCopyButton.d.ts +2 -2
- package/CodeCopy/CodeCopyButton.js +18 -10
- package/CodeCopy/index.d.ts +3 -3
- package/CodeCopy/index.js +40 -3
- package/CodeCopy/useClipboardCopy.d.ts +3 -3
- package/CodeCopy/useClipboardCopy.js +12 -4
- package/ComponentLinkHeader/ComponentLinkHeader.d.ts +5 -5
- package/ComponentLinkHeader/ComponentLinkHeader.js +48 -40
- package/ComponentLinkHeader/index.d.ts +2 -2
- package/ComponentLinkHeader/index.js +24 -2
- package/DocsProvider/DocsProvider.d.ts +19 -13
- package/DocsProvider/DocsProvider.js +17 -9
- package/DocsProvider/index.d.ts +1 -1
- package/DocsProvider/index.js +16 -1
- package/HighlightedCode/HighlightedCode.d.ts +9 -9
- package/HighlightedCode/HighlightedCode.js +26 -18
- package/HighlightedCode/index.d.ts +1 -1
- package/HighlightedCode/index.js +16 -1
- package/HighlightedCodeWithTabs/HighlightedCodeWithTabs.d.ts +18 -18
- package/HighlightedCodeWithTabs/HighlightedCodeWithTabs.js +31 -22
- package/HighlightedCodeWithTabs/index.d.ts +2 -2
- package/HighlightedCodeWithTabs/index.js +24 -2
- package/InfoCard/InfoCard.d.ts +15 -13
- package/InfoCard/InfoCard.js +29 -20
- package/InfoCard/index.d.ts +1 -1
- package/InfoCard/index.js +16 -1
- package/Link/Link.d.ts +14 -8
- package/Link/Link.js +26 -29
- package/Link/index.d.ts +1 -1
- package/Link/index.js +16 -1
- package/MarkdownElement/MarkdownElement.d.ts +4 -4
- package/MarkdownElement/MarkdownElement.js +186 -178
- package/MarkdownElement/index.d.ts +1 -1
- package/MarkdownElement/index.js +16 -1
- package/NProgressBar/NProgressBar.d.ts +1 -3
- package/NProgressBar/NProgressBar.js +23 -15
- package/NProgressBar/index.d.ts +2 -2
- package/NProgressBar/index.js +13 -1
- package/README.md +2 -2
- package/SectionTitle/SectionTitle.d.ts +4 -4
- package/SectionTitle/SectionTitle.js +15 -8
- package/SectionTitle/index.d.ts +1 -1
- package/SectionTitle/index.js +16 -1
- package/branding/BrandingProvider.d.ts +6 -6
- package/branding/BrandingProvider.js +15 -8
- package/branding/brandingTheme.d.ts +118 -119
- package/branding/brandingTheme.js +126 -115
- package/branding/index.d.ts +2 -2
- package/branding/index.js +27 -2
- package/esm/Ad/Ad.d.ts +6 -0
- package/{node → esm}/Ad/Ad.js +33 -42
- package/esm/Ad/AdCarbon.d.ts +3 -0
- package/{node → esm}/Ad/AdCarbon.js +22 -27
- package/esm/Ad/AdDisplay.d.ts +16 -0
- package/{node → esm}/Ad/AdDisplay.js +21 -28
- package/esm/Ad/AdGuest.d.ts +10 -0
- package/esm/Ad/AdGuest.js +29 -0
- package/esm/Ad/AdInHouse.d.ts +5 -0
- package/esm/Ad/AdInHouse.js +15 -0
- package/esm/Ad/AdManager.d.ts +19 -0
- package/esm/Ad/AdManager.js +36 -0
- package/esm/Ad/AdProvider.d.ts +15 -0
- package/esm/Ad/AdProvider.js +24 -0
- package/esm/Ad/ad.styles.d.ts +4329 -0
- package/{node → esm}/Ad/ad.styles.js +5 -13
- package/esm/Ad/index.d.ts +5 -0
- package/esm/Ad/index.js +7 -0
- package/esm/CodeCopy/CodeCopy.d.ts +22 -0
- package/{node → esm}/CodeCopy/CodeCopy.js +10 -19
- package/esm/CodeCopy/CodeCopyButton.d.ts +5 -0
- package/esm/CodeCopy/CodeCopyButton.js +41 -0
- package/esm/CodeCopy/index.d.ts +3 -0
- package/esm/CodeCopy/index.js +3 -0
- package/esm/CodeCopy/useClipboardCopy.d.ts +4 -0
- package/esm/CodeCopy/useClipboardCopy.js +21 -0
- package/esm/ComponentLinkHeader/ComponentLinkHeader.d.ts +9 -0
- package/{node → esm}/ComponentLinkHeader/ComponentLinkHeader.js +40 -48
- package/esm/ComponentLinkHeader/index.d.ts +2 -0
- package/esm/ComponentLinkHeader/index.js +2 -0
- package/esm/DocsProvider/DocsProvider.d.ts +24 -0
- package/esm/DocsProvider/DocsProvider.js +31 -0
- package/esm/DocsProvider/index.d.ts +1 -0
- package/esm/DocsProvider/index.js +1 -0
- package/esm/HighlightedCode/HighlightedCode.d.ts +14 -0
- package/esm/HighlightedCode/HighlightedCode.js +67 -0
- package/esm/HighlightedCode/index.d.ts +1 -0
- package/esm/HighlightedCode/index.js +1 -0
- package/esm/HighlightedCodeWithTabs/HighlightedCodeWithTabs.d.ts +29 -0
- package/{node → esm}/HighlightedCodeWithTabs/HighlightedCodeWithTabs.js +22 -31
- package/esm/HighlightedCodeWithTabs/index.d.ts +2 -0
- package/esm/HighlightedCodeWithTabs/index.js +2 -0
- package/esm/InfoCard/InfoCard.d.ts +22 -0
- package/esm/InfoCard/InfoCard.js +87 -0
- package/esm/InfoCard/index.d.ts +1 -0
- package/esm/InfoCard/index.js +1 -0
- package/esm/Link/Link.d.ts +22 -0
- package/{node → esm}/Link/Link.js +19 -37
- package/esm/Link/index.d.ts +1 -0
- package/esm/Link/index.js +1 -0
- package/esm/MarkdownElement/MarkdownElement.d.ts +7 -0
- package/{node → esm}/MarkdownElement/MarkdownElement.js +178 -186
- package/esm/MarkdownElement/index.d.ts +1 -0
- package/esm/MarkdownElement/index.js +1 -0
- package/esm/NProgressBar/NProgressBar.d.ts +6 -0
- package/{node → esm}/NProgressBar/NProgressBar.js +15 -23
- package/esm/NProgressBar/index.d.ts +2 -0
- package/esm/NProgressBar/index.js +1 -0
- package/esm/SectionTitle/SectionTitle.d.ts +7 -0
- package/esm/SectionTitle/SectionTitle.js +30 -0
- package/esm/SectionTitle/index.d.ts +1 -0
- package/esm/SectionTitle/index.js +1 -0
- package/esm/branding/BrandingProvider.d.ts +9 -0
- package/esm/branding/BrandingProvider.js +17 -0
- package/esm/branding/brandingTheme.d.ts +151 -0
- package/{node → esm}/branding/brandingTheme.js +115 -126
- package/esm/branding/index.d.ts +2 -0
- package/esm/branding/index.js +2 -0
- package/esm/i18n/i18n.d.ts +27 -0
- package/{node → esm}/i18n/i18n.js +17 -29
- package/esm/i18n/index.d.ts +1 -0
- package/esm/i18n/index.js +1 -0
- package/esm/package.json +1 -0
- package/esm/svgIcons/BundleSizeIcon.d.ts +4 -0
- package/esm/svgIcons/BundleSizeIcon.js +14 -0
- package/esm/svgIcons/FigmaIcon.d.ts +4 -0
- package/esm/svgIcons/FigmaIcon.js +23 -0
- package/esm/svgIcons/FileDownload.d.ts +7 -0
- package/esm/svgIcons/FileDownload.js +14 -0
- package/esm/svgIcons/JavaScript.d.ts +7 -0
- package/{node → esm}/svgIcons/JavaScript.js +6 -14
- package/esm/svgIcons/MaterialDesignIcon.d.ts +4 -0
- package/esm/svgIcons/MaterialDesignIcon.js +19 -0
- package/esm/svgIcons/SketchIcon.d.ts +4 -0
- package/esm/svgIcons/SketchIcon.js +28 -0
- package/esm/svgIcons/TypeScript.d.ts +7 -0
- package/esm/svgIcons/TypeScript.js +14 -0
- package/esm/svgIcons/W3CIcon.d.ts +4 -0
- package/{node → esm}/svgIcons/W3CIcon.js +7 -14
- package/esm/translations/index.d.ts +3 -0
- package/esm/translations/index.js +4 -0
- package/esm/utils/loadScript.d.ts +1 -0
- package/esm/utils/loadScript.js +7 -0
- package/i18n/i18n.d.ts +12 -14
- package/i18n/i18n.js +29 -17
- package/i18n/index.d.ts +1 -1
- package/i18n/index.js +16 -1
- package/modern/Ad/Ad.d.ts +6 -0
- package/modern/Ad/AdCarbon.d.ts +3 -0
- package/modern/Ad/AdDisplay.d.ts +16 -0
- package/modern/Ad/AdGuest.d.ts +10 -0
- package/modern/Ad/AdInHouse.d.ts +5 -0
- package/modern/Ad/AdManager.d.ts +19 -0
- package/modern/Ad/AdProvider.d.ts +15 -0
- package/modern/Ad/ad.styles.d.ts +4329 -0
- package/modern/Ad/index.d.ts +5 -0
- package/modern/CodeCopy/CodeCopy.d.ts +22 -0
- package/modern/CodeCopy/CodeCopyButton.d.ts +5 -0
- package/modern/CodeCopy/index.d.ts +3 -0
- package/modern/CodeCopy/useClipboardCopy.d.ts +4 -0
- package/modern/ComponentLinkHeader/ComponentLinkHeader.d.ts +9 -0
- package/modern/ComponentLinkHeader/index.d.ts +2 -0
- package/modern/DocsProvider/DocsProvider.d.ts +24 -0
- package/modern/DocsProvider/index.d.ts +1 -0
- package/modern/HighlightedCode/HighlightedCode.d.ts +14 -0
- package/modern/HighlightedCode/index.d.ts +1 -0
- package/modern/HighlightedCodeWithTabs/HighlightedCodeWithTabs.d.ts +29 -0
- package/modern/HighlightedCodeWithTabs/index.d.ts +2 -0
- package/modern/InfoCard/InfoCard.d.ts +22 -0
- package/modern/InfoCard/index.d.ts +1 -0
- package/modern/Link/Link.d.ts +22 -0
- package/modern/Link/index.d.ts +1 -0
- package/modern/MarkdownElement/MarkdownElement.d.ts +7 -0
- package/modern/MarkdownElement/index.d.ts +1 -0
- package/modern/NProgressBar/NProgressBar.d.ts +6 -0
- package/modern/NProgressBar/index.d.ts +2 -0
- package/modern/SectionTitle/SectionTitle.d.ts +7 -0
- package/modern/SectionTitle/index.d.ts +1 -0
- package/modern/branding/BrandingProvider.d.ts +9 -0
- package/modern/branding/brandingTheme.d.ts +151 -0
- package/modern/branding/index.d.ts +2 -0
- package/modern/i18n/i18n.d.ts +27 -0
- package/modern/i18n/index.d.ts +1 -0
- package/modern/svgIcons/BundleSizeIcon.d.ts +4 -0
- package/modern/svgIcons/FigmaIcon.d.ts +4 -0
- package/modern/svgIcons/FileDownload.d.ts +7 -0
- package/modern/svgIcons/JavaScript.d.ts +7 -0
- package/modern/svgIcons/MaterialDesignIcon.d.ts +4 -0
- package/modern/svgIcons/SketchIcon.d.ts +4 -0
- package/modern/svgIcons/TypeScript.d.ts +7 -0
- package/modern/svgIcons/W3CIcon.d.ts +4 -0
- package/modern/translations/index.d.ts +3 -0
- package/modern/utils/loadScript.d.ts +1 -0
- package/package.json +32 -2
- package/svgIcons/BundleSizeIcon.d.ts +2 -2
- package/svgIcons/BundleSizeIcon.js +13 -6
- package/svgIcons/FigmaIcon.d.ts +2 -2
- package/svgIcons/FigmaIcon.js +16 -9
- package/svgIcons/FileDownload.d.ts +2 -2
- package/svgIcons/FileDownload.js +14 -6
- package/svgIcons/JavaScript.d.ts +2 -2
- package/svgIcons/JavaScript.js +14 -6
- package/svgIcons/MaterialDesignIcon.d.ts +2 -2
- package/svgIcons/MaterialDesignIcon.js +14 -7
- package/svgIcons/SketchIcon.d.ts +2 -2
- package/svgIcons/SketchIcon.js +18 -11
- package/svgIcons/TypeScript.d.ts +2 -2
- package/svgIcons/TypeScript.js +14 -6
- package/svgIcons/W3CIcon.d.ts +2 -2
- package/svgIcons/W3CIcon.js +14 -7
- package/translations/index.d.ts +2 -2
- package/translations/index.js +10 -3
- package/tsconfig.build.tsbuildinfo +1 -1
- package/utils/loadScript.d.ts +1 -1
- package/utils/loadScript.js +8 -4
- package/Ad/package.json +0 -6
- package/CodeCopy/package.json +0 -6
- package/ComponentLinkHeader/package.json +0 -6
- package/DocsProvider/package.json +0 -6
- package/HighlightedCode/package.json +0 -6
- package/HighlightedCodeWithTabs/package.json +0 -6
- package/InfoCard/package.json +0 -6
- package/Link/package.json +0 -6
- package/MarkdownElement/package.json +0 -6
- package/NProgressBar/package.json +0 -6
- package/SectionTitle/package.json +0 -6
- package/branding/package.json +0 -6
- package/i18n/package.json +0 -6
- package/node/Ad/AdGuest.js +0 -36
- package/node/Ad/AdInHouse.js +0 -23
- package/node/Ad/AdManager.js +0 -45
- package/node/Ad/AdProvider.js +0 -32
- package/node/Ad/index.js +0 -63
- package/node/CodeCopy/CodeCopyButton.js +0 -49
- package/node/CodeCopy/index.js +0 -40
- package/node/CodeCopy/useClipboardCopy.js +0 -29
- package/node/ComponentLinkHeader/index.js +0 -24
- package/node/DocsProvider/DocsProvider.js +0 -39
- package/node/DocsProvider/index.js +0 -16
- package/node/HighlightedCode/HighlightedCode.js +0 -75
- package/node/HighlightedCode/index.js +0 -16
- package/node/HighlightedCodeWithTabs/index.js +0 -24
- package/node/InfoCard/InfoCard.js +0 -96
- package/node/InfoCard/index.js +0 -16
- package/node/Link/index.js +0 -16
- package/node/MarkdownElement/index.js +0 -16
- package/node/NProgressBar/index.js +0 -13
- package/node/SectionTitle/SectionTitle.js +0 -37
- package/node/SectionTitle/index.js +0 -16
- package/node/branding/BrandingProvider.js +0 -24
- package/node/branding/index.js +0 -27
- package/node/i18n/index.js +0 -16
- package/node/svgIcons/BundleSizeIcon.js +0 -21
- package/node/svgIcons/FigmaIcon.js +0 -30
- package/node/svgIcons/FileDownload.js +0 -22
- package/node/svgIcons/MaterialDesignIcon.js +0 -26
- package/node/svgIcons/SketchIcon.js +0 -35
- package/node/svgIcons/TypeScript.js +0 -22
- package/node/translations/index.js +0 -11
- package/node/utils/loadScript.js +0 -15
- package/translations/package.json +0 -6
|
@@ -1,22 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
var _styles = require("@mui/material/styles");
|
|
12
|
-
var _Tabs = require("@mui/base/Tabs");
|
|
13
|
-
var _TabsList = require("@mui/base/TabsList");
|
|
14
|
-
var _TabPanel = require("@mui/base/TabPanel");
|
|
15
|
-
var _Tab = require("@mui/base/Tab");
|
|
16
|
-
var _useLocalStorageState = _interopRequireDefault(require("@mui/utils/useLocalStorageState"));
|
|
17
|
-
var _HighlightedCode = require("../HighlightedCode");
|
|
18
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
|
-
const CodeTabList = exports.CodeTabList = (0, _styles.styled)(_TabsList.TabsList)(({
|
|
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.js";
|
|
9
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
|
+
export const CodeTabList = styled(TabsListBase)(({
|
|
20
11
|
theme
|
|
21
12
|
}) => ({
|
|
22
13
|
display: 'flex',
|
|
@@ -25,7 +16,7 @@ const CodeTabList = exports.CodeTabList = (0, _styles.styled)(_TabsList.TabsList
|
|
|
25
16
|
borderRight: '1px solid',
|
|
26
17
|
overflowX: 'auto',
|
|
27
18
|
...theme.applyDarkStyles({
|
|
28
|
-
backgroundColor:
|
|
19
|
+
backgroundColor: alpha(theme.palette.primaryDark[800], 0.2)
|
|
29
20
|
}),
|
|
30
21
|
variants: [{
|
|
31
22
|
props: ({
|
|
@@ -116,7 +107,7 @@ const CodeTabList = exports.CodeTabList = (0, _styles.styled)(_TabsList.TabsList
|
|
|
116
107
|
ownerState
|
|
117
108
|
}) => ownerState?.contained,
|
|
118
109
|
style: {
|
|
119
|
-
backgroundColor:
|
|
110
|
+
backgroundColor: alpha(theme.palette.grey[50], 0.2)
|
|
120
111
|
}
|
|
121
112
|
}, {
|
|
122
113
|
props: ({
|
|
@@ -127,7 +118,7 @@ const CodeTabList = exports.CodeTabList = (0, _styles.styled)(_TabsList.TabsList
|
|
|
127
118
|
}
|
|
128
119
|
}]
|
|
129
120
|
}));
|
|
130
|
-
const CodeTabPanel =
|
|
121
|
+
export const CodeTabPanel = styled(TabPanelBase)({
|
|
131
122
|
'& pre': {
|
|
132
123
|
borderTopLeftRadius: 0,
|
|
133
124
|
borderTopRightRadius: 0,
|
|
@@ -189,7 +180,7 @@ const CodeTabPanel = exports.CodeTabPanel = (0, _styles.styled)(_TabPanel.TabPan
|
|
|
189
180
|
}
|
|
190
181
|
}]
|
|
191
182
|
});
|
|
192
|
-
const CodeTab =
|
|
183
|
+
export const CodeTab = styled(TabBase)(({
|
|
193
184
|
theme
|
|
194
185
|
}) => ({
|
|
195
186
|
variants: [{
|
|
@@ -270,7 +261,7 @@ const CodeTab = exports.CodeTab = (0, _styles.styled)(_Tab.Tab)(({
|
|
|
270
261
|
}) => !ownerState?.contained,
|
|
271
262
|
style: {
|
|
272
263
|
'&:hover': {
|
|
273
|
-
backgroundColor:
|
|
264
|
+
backgroundColor: alpha(theme.palette.primaryDark[500], 0.5),
|
|
274
265
|
color: (theme.vars || theme).palette.grey[400]
|
|
275
266
|
}
|
|
276
267
|
}
|
|
@@ -314,7 +305,7 @@ const CodeTab = exports.CodeTab = (0, _styles.styled)(_Tab.Tab)(({
|
|
|
314
305
|
}
|
|
315
306
|
})
|
|
316
307
|
}));
|
|
317
|
-
function HighlightedCodeWithTabs(props) {
|
|
308
|
+
export function HighlightedCodeWithTabs(props) {
|
|
318
309
|
const {
|
|
319
310
|
tabs,
|
|
320
311
|
storageKey
|
|
@@ -322,7 +313,7 @@ function HighlightedCodeWithTabs(props) {
|
|
|
322
313
|
const availableTabs = React.useMemo(() => tabs.map(({
|
|
323
314
|
tab
|
|
324
315
|
}) => tab), [tabs]);
|
|
325
|
-
const [activeTab, setActiveTab] = (
|
|
316
|
+
const [activeTab, setActiveTab] = useLocalStorageState(storageKey ?? null, availableTabs[0]);
|
|
326
317
|
// During hydration, activeTab is null, default to first value.
|
|
327
318
|
const defaultizedActiveTab = activeTab ?? availableTabs[0];
|
|
328
319
|
const [mounted, setMounted] = React.useState(false);
|
|
@@ -335,15 +326,15 @@ function HighlightedCodeWithTabs(props) {
|
|
|
335
326
|
const ownerState = {
|
|
336
327
|
mounted
|
|
337
328
|
};
|
|
338
|
-
return /*#__PURE__*/(
|
|
329
|
+
return /*#__PURE__*/_jsxs(Tabs, {
|
|
339
330
|
selectionFollowsFocus: true,
|
|
340
331
|
value: defaultizedActiveTab,
|
|
341
332
|
onChange: handleChange,
|
|
342
|
-
children: [/*#__PURE__*/(
|
|
333
|
+
children: [/*#__PURE__*/_jsx(CodeTabList, {
|
|
343
334
|
ownerState: ownerState,
|
|
344
335
|
children: tabs.map(({
|
|
345
336
|
tab
|
|
346
|
-
}) => /*#__PURE__*/(
|
|
337
|
+
}) => /*#__PURE__*/_jsx(CodeTab, {
|
|
347
338
|
ownerState: ownerState,
|
|
348
339
|
value: tab,
|
|
349
340
|
children: tab
|
|
@@ -352,10 +343,10 @@ function HighlightedCodeWithTabs(props) {
|
|
|
352
343
|
tab,
|
|
353
344
|
language,
|
|
354
345
|
code
|
|
355
|
-
}) => /*#__PURE__*/(
|
|
346
|
+
}) => /*#__PURE__*/_jsx(CodeTabPanel, {
|
|
356
347
|
ownerState: ownerState,
|
|
357
348
|
value: tab,
|
|
358
|
-
children: /*#__PURE__*/(
|
|
349
|
+
children: /*#__PURE__*/_jsx(HighlightedCode, {
|
|
359
350
|
language: language || 'bash',
|
|
360
351
|
code: typeof code === 'function' ? code(tab) : code
|
|
361
352
|
})
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { TypographyProps } from '@mui/material/Typography';
|
|
3
|
+
import { LinkProps } from "../Link/index.js";
|
|
4
|
+
interface GlowingIconContainerProps {
|
|
5
|
+
icon: React.ReactNode;
|
|
6
|
+
}
|
|
7
|
+
export declare function GlowingIconContainer({
|
|
8
|
+
icon
|
|
9
|
+
}: GlowingIconContainerProps): React.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): React.JSX.Element;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,87 @@
|
|
|
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.js";
|
|
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
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./InfoCard.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./InfoCard.js";
|
|
@@ -0,0 +1,22 @@
|
|
|
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
|
+
* - /examples/material-ui-nextjs-pages-router/src/Link.js
|
|
8
|
+
* - /examples/material-ui-nextjs-pages-router-ts/src/Link.tsx
|
|
9
|
+
*/
|
|
10
|
+
interface NextLinkComposedProps extends Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'href'>, Omit<NextLinkProps, 'href' | 'as' | 'passHref' | 'onMouseEnter' | 'onClick' | 'onTouchStart'> {
|
|
11
|
+
to: NextLinkProps['href'];
|
|
12
|
+
linkAs?: NextLinkProps['as'];
|
|
13
|
+
}
|
|
14
|
+
export type LinkProps = {
|
|
15
|
+
activeClassName?: string;
|
|
16
|
+
as?: NextLinkProps['as'];
|
|
17
|
+
href: NextLinkProps['href'];
|
|
18
|
+
linkAs?: NextLinkProps['as'];
|
|
19
|
+
noLinkStyle?: boolean;
|
|
20
|
+
} & Omit<NextLinkComposedProps, 'to' | 'linkAs' | 'href'> & Omit<MuiLinkProps, 'href'>;
|
|
21
|
+
export declare const Link: React.ForwardRefExoticComponent<Omit<LinkProps, "ref"> & React.RefAttributes<HTMLAnchorElement>>;
|
|
22
|
+
export {};
|
|
@@ -1,30 +1,18 @@
|
|
|
1
|
-
|
|
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.js";
|
|
7
|
+
import { useDocsConfig } from "../DocsProvider/index.js";
|
|
2
8
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.Link = void 0;
|
|
9
|
-
var React = _interopRequireWildcard(require("react"));
|
|
10
|
-
var _clsx = _interopRequireDefault(require("clsx"));
|
|
11
|
-
var _router = require("next/router");
|
|
12
|
-
var _link = _interopRequireDefault(require("next/link"));
|
|
13
|
-
var _Link = _interopRequireDefault(require("@mui/material/Link"));
|
|
14
|
-
var _styles = require("@mui/material/styles");
|
|
15
|
-
var _i18n = require("../i18n");
|
|
16
|
-
var _DocsProvider = require("../DocsProvider");
|
|
17
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
18
9
|
/**
|
|
19
10
|
* File to keep in sync with:
|
|
20
11
|
*
|
|
21
|
-
* - /docs/src/modules/components/Link.tsx
|
|
22
12
|
* - /examples/material-ui-nextjs-pages-router/src/Link.js
|
|
23
13
|
* - /examples/material-ui-nextjs-pages-router-ts/src/Link.tsx
|
|
24
14
|
*/
|
|
25
|
-
|
|
26
|
-
// Add support for the sx prop for consistency with the other branches.
|
|
27
|
-
const Anchor = (0, _styles.styled)('a')({});
|
|
15
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
28
16
|
const NextLinkComposed = /*#__PURE__*/React.forwardRef(function NextLinkComposed(props, ref) {
|
|
29
17
|
const {
|
|
30
18
|
to,
|
|
@@ -33,11 +21,10 @@ const NextLinkComposed = /*#__PURE__*/React.forwardRef(function NextLinkComposed
|
|
|
33
21
|
scroll,
|
|
34
22
|
shallow,
|
|
35
23
|
prefetch,
|
|
36
|
-
legacyBehavior = true,
|
|
37
24
|
locale,
|
|
38
25
|
...other
|
|
39
26
|
} = props;
|
|
40
|
-
return /*#__PURE__*/(
|
|
27
|
+
return /*#__PURE__*/_jsx(NextLink, {
|
|
41
28
|
href: to,
|
|
42
29
|
prefetch: prefetch,
|
|
43
30
|
as: linkAs,
|
|
@@ -46,23 +33,19 @@ const NextLinkComposed = /*#__PURE__*/React.forwardRef(function NextLinkComposed
|
|
|
46
33
|
shallow: shallow,
|
|
47
34
|
passHref: true,
|
|
48
35
|
locale: locale,
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
ref: ref,
|
|
53
|
-
...other
|
|
54
|
-
})
|
|
36
|
+
"data-no-markdown-link": "true",
|
|
37
|
+
ref: ref,
|
|
38
|
+
...other
|
|
55
39
|
});
|
|
56
40
|
});
|
|
57
41
|
// A styled version of the Next.js Pages Router Link component:
|
|
58
42
|
// https://nextjs.org/docs/pages/api-reference/components/link
|
|
59
|
-
const Link =
|
|
43
|
+
export const Link = /*#__PURE__*/React.forwardRef(function Link(props, ref) {
|
|
60
44
|
const {
|
|
61
45
|
activeClassName = 'active',
|
|
62
46
|
as,
|
|
63
47
|
className: classNameProps,
|
|
64
48
|
href,
|
|
65
|
-
legacyBehavior,
|
|
66
49
|
linkAs: linkAsProp,
|
|
67
50
|
locale,
|
|
68
51
|
noLinkStyle,
|
|
@@ -72,15 +55,15 @@ const Link = exports.Link = /*#__PURE__*/React.forwardRef(function Link(props, r
|
|
|
72
55
|
shallow,
|
|
73
56
|
...other
|
|
74
57
|
} = props;
|
|
75
|
-
const router =
|
|
58
|
+
const router = useRouter();
|
|
76
59
|
const pathname = typeof href === 'string' ? href : href?.pathname;
|
|
77
60
|
const routerPathname = router.pathname.replace('/[docsTab]', '');
|
|
78
61
|
const shouldBeActive = routerPathname === pathname;
|
|
79
|
-
const className = (
|
|
80
|
-
const userLanguage =
|
|
62
|
+
const className = clsx(classNameProps, shouldBeActive && activeClassName);
|
|
63
|
+
const userLanguage = useUserLanguage();
|
|
81
64
|
const {
|
|
82
65
|
LANGUAGES_IGNORE_PAGES
|
|
83
|
-
} =
|
|
66
|
+
} = useDocsConfig();
|
|
84
67
|
let linkAs = linkAsProp || as || href;
|
|
85
68
|
if (userLanguage !== 'en' && pathname && pathname.startsWith('/') && !LANGUAGES_IGNORE_PAGES(pathname) && !pathname.startsWith(`/${userLanguage}/`)) {
|
|
86
69
|
linkAs = `/${userLanguage}${linkAs}`;
|
|
@@ -91,19 +74,18 @@ const Link = exports.Link = /*#__PURE__*/React.forwardRef(function Link(props, r
|
|
|
91
74
|
replace,
|
|
92
75
|
scroll,
|
|
93
76
|
shallow,
|
|
94
|
-
legacyBehavior,
|
|
95
77
|
prefetch,
|
|
96
78
|
locale
|
|
97
79
|
};
|
|
98
80
|
if (noLinkStyle) {
|
|
99
|
-
return /*#__PURE__*/(
|
|
81
|
+
return /*#__PURE__*/_jsx(NextLinkComposed, {
|
|
100
82
|
className: className,
|
|
101
83
|
ref: ref,
|
|
102
84
|
...nextjsProps,
|
|
103
85
|
...other
|
|
104
86
|
});
|
|
105
87
|
}
|
|
106
|
-
return /*#__PURE__*/(
|
|
88
|
+
return /*#__PURE__*/_jsx(MuiLink, {
|
|
107
89
|
component: NextLinkComposed,
|
|
108
90
|
className: className,
|
|
109
91
|
ref: ref,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Link.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Link.js";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export interface MarkdownElementProps {
|
|
3
|
+
className?: string;
|
|
4
|
+
renderedMarkdown?: string;
|
|
5
|
+
children?: React.ReactNode;
|
|
6
|
+
}
|
|
7
|
+
export declare const MarkdownElement: React.ForwardRefExoticComponent<MarkdownElementProps & React.RefAttributes<HTMLDivElement>>;
|