@mui/docs 6.4.4 → 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 +27 -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 +71 -2258
- 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 +4 -4
- 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 +18 -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/{node → esm}/utils/loadScript.js +1 -7
- 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 +34 -4
- 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 +7 -1
- 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/translations/package.json +0 -6
|
@@ -1,11 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
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.HighlightedCode = void 0;
|
|
9
|
+
var React = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _prism = _interopRequireDefault(require("@mui/internal-markdown/prism"));
|
|
11
|
+
var _NoSsr = require("@mui/base/NoSsr");
|
|
12
|
+
var _styles = require("@mui/material/styles");
|
|
13
|
+
var _CodeCopy = require("../CodeCopy");
|
|
14
|
+
var _MarkdownElement = require("../MarkdownElement");
|
|
15
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
|
+
const Pre = (0, _styles.styled)('pre')(({
|
|
9
17
|
theme
|
|
10
18
|
}) => ({
|
|
11
19
|
margin: 0,
|
|
@@ -23,37 +31,37 @@ const Pre = styled('pre')(({
|
|
|
23
31
|
// https://github.com/necolas/normalize.css/blob/master/normalize.css#L102
|
|
24
32
|
}
|
|
25
33
|
}));
|
|
26
|
-
|
|
34
|
+
const HighlightedCode = exports.HighlightedCode = /*#__PURE__*/React.forwardRef(function HighlightedCode(props, ref) {
|
|
27
35
|
const {
|
|
28
36
|
code,
|
|
29
37
|
copyButtonHidden = false,
|
|
30
38
|
copyButtonProps,
|
|
31
39
|
language,
|
|
32
40
|
plainStyle,
|
|
33
|
-
parentComponent: Component = plainStyle ? React.Fragment : MarkdownElement,
|
|
41
|
+
parentComponent: Component = plainStyle ? React.Fragment : _MarkdownElement.MarkdownElement,
|
|
34
42
|
preComponent: PreComponent = plainStyle ? Pre : 'pre',
|
|
35
43
|
...other
|
|
36
44
|
} = props;
|
|
37
45
|
const renderedCode = React.useMemo(() => {
|
|
38
|
-
return
|
|
46
|
+
return (0, _prism.default)(code.trim(), language);
|
|
39
47
|
}, [code, language]);
|
|
40
|
-
const handlers = useCodeCopy();
|
|
41
|
-
return /*#__PURE__*/
|
|
48
|
+
const handlers = (0, _CodeCopy.useCodeCopy)();
|
|
49
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Component, {
|
|
42
50
|
ref: ref,
|
|
43
51
|
...other,
|
|
44
|
-
children: /*#__PURE__*/
|
|
52
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
45
53
|
className: "MuiCode-root",
|
|
46
54
|
...handlers,
|
|
47
55
|
style: {
|
|
48
56
|
height: '100%'
|
|
49
57
|
},
|
|
50
|
-
children: [copyButtonHidden ? null : /*#__PURE__*/
|
|
51
|
-
children: /*#__PURE__*/
|
|
58
|
+
children: [copyButtonHidden ? null : /*#__PURE__*/(0, _jsxRuntime.jsx)(_NoSsr.NoSsr, {
|
|
59
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CodeCopy.CodeCopyButton, {
|
|
52
60
|
code: code,
|
|
53
61
|
...copyButtonProps
|
|
54
62
|
})
|
|
55
|
-
}), /*#__PURE__*/
|
|
56
|
-
children: /*#__PURE__*/
|
|
63
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(PreComponent, {
|
|
64
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("code", {
|
|
57
65
|
className: `language-${language}`
|
|
58
66
|
// eslint-disable-next-line react/no-danger
|
|
59
67
|
,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from
|
|
1
|
+
export * from "./HighlightedCode.js";
|
package/HighlightedCode/index.js
CHANGED
|
@@ -1 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _HighlightedCode = require("./HighlightedCode");
|
|
7
|
+
Object.keys(_HighlightedCode).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _HighlightedCode[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return _HighlightedCode[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
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").Theme> & {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
ownerState: {
|
|
4
|
+
mounted: boolean;
|
|
5
|
+
contained?: boolean;
|
|
6
|
+
};
|
|
7
7
|
}, {}, {}>;
|
|
8
8
|
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").Theme> & {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
ownerState: {
|
|
10
|
+
mounted: boolean;
|
|
11
|
+
contained?: boolean;
|
|
12
|
+
};
|
|
13
13
|
}, {}, {}>;
|
|
14
14
|
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").Theme> & {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
ownerState: {
|
|
16
|
+
mounted: boolean;
|
|
17
|
+
contained?: boolean;
|
|
18
|
+
};
|
|
19
19
|
}, {}, {}>;
|
|
20
20
|
type TabsConfig = {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
code: string | ((tab: string) => string);
|
|
22
|
+
language: string;
|
|
23
|
+
tab: string;
|
|
24
24
|
};
|
|
25
25
|
export declare function HighlightedCodeWithTabs(props: {
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
tabs: Array<TabsConfig>;
|
|
27
|
+
storageKey?: string;
|
|
28
28
|
} & Record<string, any>): React.JSX.Element;
|
|
29
|
-
export {};
|
|
29
|
+
export {};
|
|
@@ -1,13 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
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.CodeTabPanel = exports.CodeTabList = exports.CodeTab = void 0;
|
|
9
|
+
exports.HighlightedCodeWithTabs = HighlightedCodeWithTabs;
|
|
10
|
+
var React = _interopRequireWildcard(require("react"));
|
|
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)(({
|
|
11
20
|
theme
|
|
12
21
|
}) => ({
|
|
13
22
|
display: 'flex',
|
|
@@ -16,7 +25,7 @@ export const CodeTabList = styled(TabsListBase)(({
|
|
|
16
25
|
borderRight: '1px solid',
|
|
17
26
|
overflowX: 'auto',
|
|
18
27
|
...theme.applyDarkStyles({
|
|
19
|
-
backgroundColor: alpha(theme.palette.primaryDark[800], 0.2)
|
|
28
|
+
backgroundColor: (0, _styles.alpha)(theme.palette.primaryDark[800], 0.2)
|
|
20
29
|
}),
|
|
21
30
|
variants: [{
|
|
22
31
|
props: ({
|
|
@@ -107,7 +116,7 @@ export const CodeTabList = styled(TabsListBase)(({
|
|
|
107
116
|
ownerState
|
|
108
117
|
}) => ownerState?.contained,
|
|
109
118
|
style: {
|
|
110
|
-
backgroundColor: alpha(theme.palette.grey[50], 0.2)
|
|
119
|
+
backgroundColor: (0, _styles.alpha)(theme.palette.grey[50], 0.2)
|
|
111
120
|
}
|
|
112
121
|
}, {
|
|
113
122
|
props: ({
|
|
@@ -118,7 +127,7 @@ export const CodeTabList = styled(TabsListBase)(({
|
|
|
118
127
|
}
|
|
119
128
|
}]
|
|
120
129
|
}));
|
|
121
|
-
|
|
130
|
+
const CodeTabPanel = exports.CodeTabPanel = (0, _styles.styled)(_TabPanel.TabPanel)({
|
|
122
131
|
'& pre': {
|
|
123
132
|
borderTopLeftRadius: 0,
|
|
124
133
|
borderTopRightRadius: 0,
|
|
@@ -180,7 +189,7 @@ export const CodeTabPanel = styled(TabPanelBase)({
|
|
|
180
189
|
}
|
|
181
190
|
}]
|
|
182
191
|
});
|
|
183
|
-
|
|
192
|
+
const CodeTab = exports.CodeTab = (0, _styles.styled)(_Tab.Tab)(({
|
|
184
193
|
theme
|
|
185
194
|
}) => ({
|
|
186
195
|
variants: [{
|
|
@@ -261,7 +270,7 @@ export const CodeTab = styled(TabBase)(({
|
|
|
261
270
|
}) => !ownerState?.contained,
|
|
262
271
|
style: {
|
|
263
272
|
'&:hover': {
|
|
264
|
-
backgroundColor: alpha(theme.palette.primaryDark[500], 0.5),
|
|
273
|
+
backgroundColor: (0, _styles.alpha)(theme.palette.primaryDark[500], 0.5),
|
|
265
274
|
color: (theme.vars || theme).palette.grey[400]
|
|
266
275
|
}
|
|
267
276
|
}
|
|
@@ -305,7 +314,7 @@ export const CodeTab = styled(TabBase)(({
|
|
|
305
314
|
}
|
|
306
315
|
})
|
|
307
316
|
}));
|
|
308
|
-
|
|
317
|
+
function HighlightedCodeWithTabs(props) {
|
|
309
318
|
const {
|
|
310
319
|
tabs,
|
|
311
320
|
storageKey
|
|
@@ -313,7 +322,7 @@ export function HighlightedCodeWithTabs(props) {
|
|
|
313
322
|
const availableTabs = React.useMemo(() => tabs.map(({
|
|
314
323
|
tab
|
|
315
324
|
}) => tab), [tabs]);
|
|
316
|
-
const [activeTab, setActiveTab] =
|
|
325
|
+
const [activeTab, setActiveTab] = (0, _useLocalStorageState.default)(storageKey ?? null, availableTabs[0]);
|
|
317
326
|
// During hydration, activeTab is null, default to first value.
|
|
318
327
|
const defaultizedActiveTab = activeTab ?? availableTabs[0];
|
|
319
328
|
const [mounted, setMounted] = React.useState(false);
|
|
@@ -326,15 +335,15 @@ export function HighlightedCodeWithTabs(props) {
|
|
|
326
335
|
const ownerState = {
|
|
327
336
|
mounted
|
|
328
337
|
};
|
|
329
|
-
return /*#__PURE__*/
|
|
338
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Tabs.Tabs, {
|
|
330
339
|
selectionFollowsFocus: true,
|
|
331
340
|
value: defaultizedActiveTab,
|
|
332
341
|
onChange: handleChange,
|
|
333
|
-
children: [/*#__PURE__*/
|
|
342
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(CodeTabList, {
|
|
334
343
|
ownerState: ownerState,
|
|
335
344
|
children: tabs.map(({
|
|
336
345
|
tab
|
|
337
|
-
}) => /*#__PURE__*/
|
|
346
|
+
}) => /*#__PURE__*/(0, _jsxRuntime.jsx)(CodeTab, {
|
|
338
347
|
ownerState: ownerState,
|
|
339
348
|
value: tab,
|
|
340
349
|
children: tab
|
|
@@ -343,10 +352,10 @@ export function HighlightedCodeWithTabs(props) {
|
|
|
343
352
|
tab,
|
|
344
353
|
language,
|
|
345
354
|
code
|
|
346
|
-
}) => /*#__PURE__*/
|
|
355
|
+
}) => /*#__PURE__*/(0, _jsxRuntime.jsx)(CodeTabPanel, {
|
|
347
356
|
ownerState: ownerState,
|
|
348
357
|
value: tab,
|
|
349
|
-
children: /*#__PURE__*/
|
|
358
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_HighlightedCode.HighlightedCode, {
|
|
350
359
|
language: language || 'bash',
|
|
351
360
|
code: typeof code === 'function' ? code(tab) : code
|
|
352
361
|
})
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export { HighlightedCodeWithTabs as default } from
|
|
1
|
+
export * from "./HighlightedCodeWithTabs.js";
|
|
2
|
+
export { HighlightedCodeWithTabs as default } from "./HighlightedCodeWithTabs.js";
|
|
@@ -1,2 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _exportNames = {};
|
|
7
|
+
Object.defineProperty(exports, "default", {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function () {
|
|
10
|
+
return _HighlightedCodeWithTabs.HighlightedCodeWithTabs;
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
var _HighlightedCodeWithTabs = require("./HighlightedCodeWithTabs");
|
|
14
|
+
Object.keys(_HighlightedCodeWithTabs).forEach(function (key) {
|
|
15
|
+
if (key === "default" || key === "__esModule") return;
|
|
16
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
17
|
+
if (key in exports && exports[key] === _HighlightedCodeWithTabs[key]) return;
|
|
18
|
+
Object.defineProperty(exports, key, {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return _HighlightedCodeWithTabs[key];
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
});
|
package/InfoCard/InfoCard.d.ts
CHANGED
|
@@ -1,20 +1,22 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { TypographyProps } from '@mui/material/Typography';
|
|
3
|
-
import { LinkProps } from
|
|
3
|
+
import { LinkProps } from "../Link/index.js";
|
|
4
4
|
interface GlowingIconContainerProps {
|
|
5
|
-
|
|
5
|
+
icon: React.ReactNode;
|
|
6
6
|
}
|
|
7
|
-
export declare function GlowingIconContainer({
|
|
7
|
+
export declare function GlowingIconContainer({
|
|
8
|
+
icon
|
|
9
|
+
}: GlowingIconContainerProps): React.JSX.Element;
|
|
8
10
|
interface InfoCardProps {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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;
|
|
18
20
|
}
|
|
19
21
|
export declare function InfoCard(props: InfoCardProps): React.JSX.Element;
|
|
20
|
-
export {};
|
|
22
|
+
export {};
|
package/InfoCard/InfoCard.js
CHANGED
|
@@ -1,14 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
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.GlowingIconContainer = GlowingIconContainer;
|
|
9
|
+
exports.InfoCard = InfoCard;
|
|
10
|
+
var React = _interopRequireWildcard(require("react"));
|
|
11
|
+
var _styles = require("@mui/material/styles");
|
|
12
|
+
var _Box = _interopRequireDefault(require("@mui/material/Box"));
|
|
13
|
+
var _Paper = _interopRequireDefault(require("@mui/material/Paper"));
|
|
14
|
+
var _Typography = _interopRequireDefault(require("@mui/material/Typography"));
|
|
15
|
+
var _Link = require("../Link");
|
|
16
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
|
+
function GlowingIconContainer({
|
|
9
18
|
icon
|
|
10
19
|
}) {
|
|
11
|
-
return /*#__PURE__*/
|
|
20
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
12
21
|
sx: theme => ({
|
|
13
22
|
width: 36,
|
|
14
23
|
height: 36,
|
|
@@ -20,20 +29,20 @@ export function GlowingIconContainer({
|
|
|
20
29
|
border: '1px solid',
|
|
21
30
|
borderColor: 'primary.200',
|
|
22
31
|
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`,
|
|
32
|
+
boxShadow: `0px 0 0 2px ${(0, _styles.alpha)(theme.palette.primary[500], 0.1)}, 0px 2px 12px 0px rgba(234, 237, 241, 0.3) inset`,
|
|
24
33
|
'& .MuiSvgIcon-root': {
|
|
25
34
|
fontSize: theme.typography.pxToRem(18)
|
|
26
35
|
},
|
|
27
36
|
...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`
|
|
37
|
+
borderColor: (0, _styles.alpha)(theme.palette.primary[400], 0.25),
|
|
38
|
+
bgcolor: (0, _styles.alpha)(theme.palette.primary[900], 0.2),
|
|
39
|
+
boxShadow: `0 0 0 2px ${(0, _styles.alpha)(theme.palette.primary[600], 0.1)}, 0px 2px 12px 0px rgba(0, 0, 0, 0.25) inset`
|
|
31
40
|
})
|
|
32
41
|
}),
|
|
33
42
|
children: icon
|
|
34
43
|
});
|
|
35
44
|
}
|
|
36
|
-
|
|
45
|
+
function InfoCard(props) {
|
|
37
46
|
const {
|
|
38
47
|
classNameDescription,
|
|
39
48
|
classNameTitle,
|
|
@@ -45,9 +54,9 @@ export function InfoCard(props) {
|
|
|
45
54
|
titleProps,
|
|
46
55
|
...other
|
|
47
56
|
} = props;
|
|
48
|
-
return /*#__PURE__*/
|
|
57
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Paper.default, {
|
|
49
58
|
variant: "outlined",
|
|
50
|
-
component: link ? Link : 'div',
|
|
59
|
+
component: link ? _Link.Link : 'div',
|
|
51
60
|
href: link,
|
|
52
61
|
...(link ? {
|
|
53
62
|
noLinkStyle: true,
|
|
@@ -59,15 +68,15 @@ export function InfoCard(props) {
|
|
|
59
68
|
height: '100%',
|
|
60
69
|
background: `${(theme.vars || theme).palette.gradients.linearSubtle}`,
|
|
61
70
|
...theme.applyDarkStyles({
|
|
62
|
-
bgcolor: alpha(theme.palette.primaryDark[800], 0.25),
|
|
71
|
+
bgcolor: (0, _styles.alpha)(theme.palette.primaryDark[800], 0.25),
|
|
63
72
|
background: `${(theme.vars || theme).palette.gradients.linearSubtle}`,
|
|
64
73
|
borderColor: 'primaryDark.700'
|
|
65
74
|
})
|
|
66
75
|
}),
|
|
67
76
|
...other,
|
|
68
|
-
children: [svg && svg, icon && /*#__PURE__*/
|
|
77
|
+
children: [svg && svg, icon && /*#__PURE__*/(0, _jsxRuntime.jsx)(GlowingIconContainer, {
|
|
69
78
|
icon: icon
|
|
70
|
-
}), /*#__PURE__*/
|
|
79
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
|
|
71
80
|
fontWeight: "semiBold",
|
|
72
81
|
component: "h3",
|
|
73
82
|
color: "text.primary",
|
|
@@ -77,7 +86,7 @@ export function InfoCard(props) {
|
|
|
77
86
|
className: classNameTitle,
|
|
78
87
|
...titleProps,
|
|
79
88
|
children: title
|
|
80
|
-
}), /*#__PURE__*/
|
|
89
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
|
|
81
90
|
variant: "body2",
|
|
82
91
|
color: "text.secondary",
|
|
83
92
|
className: classNameDescription,
|
package/InfoCard/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from
|
|
1
|
+
export * from "./InfoCard.js";
|
package/InfoCard/index.js
CHANGED
|
@@ -1 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _InfoCard = require("./InfoCard");
|
|
7
|
+
Object.keys(_InfoCard).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _InfoCard[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return _InfoCard[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
package/Link/Link.d.ts
CHANGED
|
@@ -1,16 +1,22 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { LinkProps as NextLinkProps } from 'next/link';
|
|
3
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
|
+
*/
|
|
4
10
|
interface NextLinkComposedProps extends Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'href'>, Omit<NextLinkProps, 'href' | 'as' | 'passHref' | 'onMouseEnter' | 'onClick' | 'onTouchStart'> {
|
|
5
|
-
|
|
6
|
-
|
|
11
|
+
to: NextLinkProps['href'];
|
|
12
|
+
linkAs?: NextLinkProps['as'];
|
|
7
13
|
}
|
|
8
14
|
export type LinkProps = {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
15
|
+
activeClassName?: string;
|
|
16
|
+
as?: NextLinkProps['as'];
|
|
17
|
+
href: NextLinkProps['href'];
|
|
18
|
+
linkAs?: NextLinkProps['as'];
|
|
19
|
+
noLinkStyle?: boolean;
|
|
14
20
|
} & Omit<NextLinkComposedProps, 'to' | 'linkAs' | 'href'> & Omit<MuiLinkProps, 'href'>;
|
|
15
21
|
export declare const Link: React.ForwardRefExoticComponent<Omit<LinkProps, "ref"> & React.RefAttributes<HTMLAnchorElement>>;
|
|
16
|
-
export {};
|
|
22
|
+
export {};
|
package/Link/Link.js
CHANGED
|
@@ -1,23 +1,26 @@
|
|
|
1
|
-
|
|
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 { styled } from '@mui/material/styles';
|
|
7
|
-
import { useUserLanguage } from "../i18n/index.js";
|
|
8
|
-
import { useDocsConfig } from "../DocsProvider/index.js";
|
|
1
|
+
"use strict";
|
|
9
2
|
|
|
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 _i18n = require("../i18n");
|
|
15
|
+
var _DocsProvider = require("../DocsProvider");
|
|
16
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
17
|
/**
|
|
11
18
|
* File to keep in sync with:
|
|
12
19
|
*
|
|
13
|
-
* - /docs/src/modules/components/Link.tsx
|
|
14
20
|
* - /examples/material-ui-nextjs-pages-router/src/Link.js
|
|
15
21
|
* - /examples/material-ui-nextjs-pages-router-ts/src/Link.tsx
|
|
16
22
|
*/
|
|
17
23
|
|
|
18
|
-
// Add support for the sx prop for consistency with the other branches.
|
|
19
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
20
|
-
const Anchor = styled('a')({});
|
|
21
24
|
const NextLinkComposed = /*#__PURE__*/React.forwardRef(function NextLinkComposed(props, ref) {
|
|
22
25
|
const {
|
|
23
26
|
to,
|
|
@@ -26,11 +29,10 @@ const NextLinkComposed = /*#__PURE__*/React.forwardRef(function NextLinkComposed
|
|
|
26
29
|
scroll,
|
|
27
30
|
shallow,
|
|
28
31
|
prefetch,
|
|
29
|
-
legacyBehavior = true,
|
|
30
32
|
locale,
|
|
31
33
|
...other
|
|
32
34
|
} = props;
|
|
33
|
-
return /*#__PURE__*/
|
|
35
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_link.default, {
|
|
34
36
|
href: to,
|
|
35
37
|
prefetch: prefetch,
|
|
36
38
|
as: linkAs,
|
|
@@ -39,23 +41,19 @@ const NextLinkComposed = /*#__PURE__*/React.forwardRef(function NextLinkComposed
|
|
|
39
41
|
shallow: shallow,
|
|
40
42
|
passHref: true,
|
|
41
43
|
locale: locale,
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
ref: ref,
|
|
46
|
-
...other
|
|
47
|
-
})
|
|
44
|
+
"data-no-markdown-link": "true",
|
|
45
|
+
ref: ref,
|
|
46
|
+
...other
|
|
48
47
|
});
|
|
49
48
|
});
|
|
50
49
|
// A styled version of the Next.js Pages Router Link component:
|
|
51
50
|
// https://nextjs.org/docs/pages/api-reference/components/link
|
|
52
|
-
|
|
51
|
+
const Link = exports.Link = /*#__PURE__*/React.forwardRef(function Link(props, ref) {
|
|
53
52
|
const {
|
|
54
53
|
activeClassName = 'active',
|
|
55
54
|
as,
|
|
56
55
|
className: classNameProps,
|
|
57
56
|
href,
|
|
58
|
-
legacyBehavior,
|
|
59
57
|
linkAs: linkAsProp,
|
|
60
58
|
locale,
|
|
61
59
|
noLinkStyle,
|
|
@@ -65,15 +63,15 @@ export const Link = /*#__PURE__*/React.forwardRef(function Link(props, ref) {
|
|
|
65
63
|
shallow,
|
|
66
64
|
...other
|
|
67
65
|
} = props;
|
|
68
|
-
const router = useRouter();
|
|
66
|
+
const router = (0, _router.useRouter)();
|
|
69
67
|
const pathname = typeof href === 'string' ? href : href?.pathname;
|
|
70
68
|
const routerPathname = router.pathname.replace('/[docsTab]', '');
|
|
71
69
|
const shouldBeActive = routerPathname === pathname;
|
|
72
|
-
const className =
|
|
73
|
-
const userLanguage = useUserLanguage();
|
|
70
|
+
const className = (0, _clsx.default)(classNameProps, shouldBeActive && activeClassName);
|
|
71
|
+
const userLanguage = (0, _i18n.useUserLanguage)();
|
|
74
72
|
const {
|
|
75
73
|
LANGUAGES_IGNORE_PAGES
|
|
76
|
-
} = useDocsConfig();
|
|
74
|
+
} = (0, _DocsProvider.useDocsConfig)();
|
|
77
75
|
let linkAs = linkAsProp || as || href;
|
|
78
76
|
if (userLanguage !== 'en' && pathname && pathname.startsWith('/') && !LANGUAGES_IGNORE_PAGES(pathname) && !pathname.startsWith(`/${userLanguage}/`)) {
|
|
79
77
|
linkAs = `/${userLanguage}${linkAs}`;
|
|
@@ -84,19 +82,18 @@ export const Link = /*#__PURE__*/React.forwardRef(function Link(props, ref) {
|
|
|
84
82
|
replace,
|
|
85
83
|
scroll,
|
|
86
84
|
shallow,
|
|
87
|
-
legacyBehavior,
|
|
88
85
|
prefetch,
|
|
89
86
|
locale
|
|
90
87
|
};
|
|
91
88
|
if (noLinkStyle) {
|
|
92
|
-
return /*#__PURE__*/
|
|
89
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(NextLinkComposed, {
|
|
93
90
|
className: className,
|
|
94
91
|
ref: ref,
|
|
95
92
|
...nextjsProps,
|
|
96
93
|
...other
|
|
97
94
|
});
|
|
98
95
|
}
|
|
99
|
-
return /*#__PURE__*/
|
|
96
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Link.default, {
|
|
100
97
|
component: NextLinkComposed,
|
|
101
98
|
className: className,
|
|
102
99
|
ref: ref,
|
package/Link/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from
|
|
1
|
+
export * from "./Link.js";
|
package/Link/index.js
CHANGED
|
@@ -1 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _Link = require("./Link");
|
|
7
|
+
Object.keys(_Link).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _Link[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return _Link[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
export interface MarkdownElementProps {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
className?: string;
|
|
4
|
+
renderedMarkdown?: string;
|
|
5
|
+
children?: React.ReactNode;
|
|
6
6
|
}
|
|
7
|
-
export declare const MarkdownElement: React.ForwardRefExoticComponent<MarkdownElementProps & React.RefAttributes<HTMLDivElement>>;
|
|
7
|
+
export declare const MarkdownElement: React.ForwardRefExoticComponent<MarkdownElementProps & React.RefAttributes<HTMLDivElement>>;
|