@mui/docs 9.0.0-alpha.2 → 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.
- package/Ad/Ad.js +33 -42
- package/Ad/AdCarbon.js +18 -27
- package/Ad/AdDisplay.js +22 -29
- package/Ad/AdGuest.js +8 -15
- package/Ad/AdInHouse.js +4 -11
- package/Ad/AdManager.js +8 -17
- package/Ad/AdProvider.js +5 -13
- package/Ad/ad.styles.js +5 -13
- package/Ad/index.js +6 -62
- package/AnalyticsProvider/AnalyticsProvider.d.ts +17 -0
- package/AnalyticsProvider/AnalyticsProvider.js +225 -0
- package/AnalyticsProvider/index.d.ts +1 -0
- package/AnalyticsProvider/index.js +1 -0
- package/CHANGELOG.md +37 -0
- package/CodeCopy/CodeCopy.js +10 -19
- package/CodeCopy/CodeCopyButton.js +9 -16
- package/CodeCopy/index.js +3 -40
- package/CodeCopy/useClipboardCopy.js +4 -12
- package/ComponentLinkHeader/ComponentLinkHeader.js +46 -54
- package/ComponentLinkHeader/index.js +2 -24
- package/DemoContext/DemoContext.d.ts +86 -0
- package/DemoContext/DemoContext.js +13 -0
- package/DemoContext/index.d.ts +2 -0
- package/DemoContext/index.js +1 -0
- package/DocsProvider/DocsProvider.js +9 -17
- package/DocsProvider/index.js +1 -16
- package/Document/Document.d.ts +16 -0
- package/Document/Document.js +147 -0
- package/Document/getInitialProps.d.ts +18 -0
- package/Document/getInitialProps.js +62 -0
- package/Document/index.d.ts +2 -0
- package/Document/index.js +2 -0
- package/GoogleAnalytics/GoogleAnalytics.d.ts +9 -0
- package/GoogleAnalytics/GoogleAnalytics.js +129 -0
- package/GoogleAnalytics/index.d.ts +1 -0
- package/GoogleAnalytics/index.js +1 -0
- package/HighlightedCode/HighlightedCode.js +18 -26
- package/HighlightedCode/index.js +1 -16
- package/HighlightedCodeWithTabs/HighlightedCodeWithTabs.js +22 -31
- package/HighlightedCodeWithTabs/index.js +2 -24
- package/IconImage/IconImage.js +13 -21
- package/IconImage/index.js +1 -13
- package/InfoCard/InfoCard.js +20 -29
- package/InfoCard/index.js +1 -16
- package/Link/Link.js +17 -25
- package/Link/MarkdownLinks.d.ts +2 -0
- package/Link/MarkdownLinks.js +84 -0
- package/Link/SkipLink.d.ts +1 -0
- package/Link/SkipLink.js +66 -0
- package/Link/index.d.ts +3 -1
- package/Link/index.js +3 -16
- package/MarkdownElement/MarkdownElement.js +178 -186
- package/MarkdownElement/index.js +1 -16
- package/MuiPage/MuiPage.d.ts +67 -0
- package/MuiPage/MuiPage.js +1 -0
- package/MuiPage/index.d.ts +1 -0
- package/MuiPage/index.js +1 -0
- package/NextNProgressBar/NextNProgressBar.d.ts +1 -0
- package/NextNProgressBar/NextNProgressBar.js +44 -0
- package/NextNProgressBar/index.d.ts +1 -0
- package/NextNProgressBar/index.js +1 -0
- package/PageContext/PageContext.d.ts +31 -0
- package/PageContext/PageContext.js +6 -0
- package/PageContext/index.d.ts +2 -0
- package/PageContext/index.js +1 -0
- package/SectionHeadline/SectionHeadline.js +9 -17
- package/SectionHeadline/index.js +2 -25
- package/SectionTitle/SectionTitle.js +7 -13
- package/SectionTitle/index.js +1 -16
- package/StyledEngineProvider/StyledEngineProvider.d.ts +9 -0
- package/StyledEngineProvider/StyledEngineProvider.js +44 -0
- package/StyledEngineProvider/index.d.ts +1 -0
- package/StyledEngineProvider/index.js +1 -0
- package/ThemeContext/ThemeContext.js +26 -38
- package/ThemeContext/index.js +1 -42
- package/branding/BrandingCssVarsProvider.d.ts +23 -0
- package/branding/BrandingCssVarsProvider.js +170 -0
- package/branding/BrandingProvider.js +8 -15
- package/branding/brandingTheme.js +115 -126
- package/branding/index.d.ts +2 -1
- package/branding/index.js +3 -27
- package/codeStyling/codeStyling.d.ts +10 -0
- package/codeStyling/codeStyling.js +84 -0
- package/codeStyling/index.d.ts +1 -0
- package/codeStyling/index.js +1 -0
- package/codeVariant/codeVariant.d.ts +10 -0
- package/codeVariant/codeVariant.js +73 -0
- package/codeVariant/index.d.ts +1 -0
- package/codeVariant/index.js +1 -0
- package/constants/constants.d.ts +13 -0
- package/constants/constants.js +15 -0
- package/constants/index.d.ts +1 -0
- package/constants/index.js +1 -0
- package/createEmotionCache/createEmotionCache.d.ts +1 -0
- package/createEmotionCache/createEmotionCache.js +12 -0
- package/createEmotionCache/index.d.ts +1 -0
- package/createEmotionCache/index.js +1 -0
- package/findActivePage/findActivePage.d.ts +5 -0
- package/findActivePage/findActivePage.js +35 -0
- package/findActivePage/index.d.ts +1 -0
- package/findActivePage/index.js +1 -0
- package/getProductInfoFromUrl/getProductInfoFromUrl.d.ts +8 -0
- package/getProductInfoFromUrl/getProductInfoFromUrl.js +50 -0
- package/getProductInfoFromUrl/index.d.ts +2 -0
- package/getProductInfoFromUrl/index.js +1 -0
- package/globalSelector/globalSelector.d.ts +2 -0
- package/globalSelector/globalSelector.js +17 -0
- package/globalSelector/index.d.ts +1 -0
- package/globalSelector/index.js +1 -0
- package/helpers/helpers.d.ts +31 -0
- package/helpers/helpers.js +87 -0
- package/helpers/index.d.ts +2 -0
- package/helpers/index.js +1 -0
- package/i18n/i18n.js +17 -29
- package/i18n/index.js +1 -16
- package/mapApiPageTranslations/index.d.ts +1 -0
- package/mapApiPageTranslations/index.js +1 -0
- package/mapApiPageTranslations/mapApiPageTranslations.d.ts +11 -0
- package/mapApiPageTranslations/mapApiPageTranslations.js +46 -0
- package/nextFonts/index.js +8 -15
- package/package.json +231 -126
- package/svgIcons/BundleSizeIcon.js +5 -11
- package/svgIcons/FigmaIcon.js +8 -14
- package/svgIcons/FileDownload.js +5 -12
- package/svgIcons/JavaScript.js +5 -12
- package/svgIcons/MarkdownIcon.js +7 -14
- package/svgIcons/MaterialDesignIcon.js +6 -12
- package/svgIcons/SketchIcon.js +10 -16
- package/svgIcons/TypeScript.js +5 -12
- package/svgIcons/W3CIcon.js +6 -12
- package/translations/index.js +3 -10
- package/translations/translations.json +0 -1
- package/useLazyCSS/index.js +1 -13
- package/useLazyCSS/useLazyCSS.js +5 -11
- package/utils/index.d.ts +1 -0
- package/utils/index.js +2 -0
- package/utils/loadScript.js +1 -7
- package/Ad/Ad.d.mts +0 -5
- package/Ad/Ad.mjs +0 -226
- package/Ad/AdCarbon.d.mts +0 -2
- package/Ad/AdCarbon.mjs +0 -125
- package/Ad/AdDisplay.d.mts +0 -16
- package/Ad/AdDisplay.mjs +0 -86
- package/Ad/AdGuest.d.mts +0 -10
- package/Ad/AdGuest.mjs +0 -29
- package/Ad/AdInHouse.d.mts +0 -4
- package/Ad/AdInHouse.mjs +0 -14
- package/Ad/AdManager.d.mts +0 -19
- package/Ad/AdManager.mjs +0 -36
- package/Ad/AdProvider.d.mts +0 -15
- package/Ad/AdProvider.mjs +0 -24
- package/Ad/ad.styles.d.mts +0 -4512
- package/Ad/ad.styles.mjs +0 -91
- package/Ad/index.d.mts +0 -5
- package/Ad/index.mjs +0 -7
- package/CodeCopy/CodeCopy.d.mts +0 -22
- package/CodeCopy/CodeCopy.mjs +0 -172
- package/CodeCopy/CodeCopyButton.d.mts +0 -4
- package/CodeCopy/CodeCopyButton.mjs +0 -40
- package/CodeCopy/index.d.mts +0 -3
- package/CodeCopy/index.mjs +0 -3
- package/CodeCopy/useClipboardCopy.d.mts +0 -4
- package/CodeCopy/useClipboardCopy.mjs +0 -21
- package/ComponentLinkHeader/ComponentLinkHeader.d.mts +0 -8
- package/ComponentLinkHeader/ComponentLinkHeader.mjs +0 -197
- package/ComponentLinkHeader/index.d.mts +0 -2
- package/ComponentLinkHeader/index.mjs +0 -2
- package/DocsProvider/DocsProvider.d.mts +0 -24
- package/DocsProvider/DocsProvider.mjs +0 -31
- package/DocsProvider/index.d.mts +0 -1
- package/DocsProvider/index.mjs +0 -1
- package/HighlightedCode/HighlightedCode.d.mts +0 -14
- package/HighlightedCode/HighlightedCode.mjs +0 -67
- package/HighlightedCode/index.d.mts +0 -1
- package/HighlightedCode/index.mjs +0 -1
- package/HighlightedCodeWithTabs/HighlightedCodeWithTabs.d.mts +0 -28
- package/HighlightedCodeWithTabs/HighlightedCodeWithTabs.mjs +0 -362
- package/HighlightedCodeWithTabs/index.d.mts +0 -2
- package/HighlightedCodeWithTabs/index.mjs +0 -2
- package/IconImage/IconImage.d.mts +0 -11
- package/IconImage/IconImage.mjs +0 -83
- package/IconImage/index.d.mts +0 -1
- package/IconImage/index.mjs +0 -1
- package/InfoCard/InfoCard.d.mts +0 -22
- package/InfoCard/InfoCard.mjs +0 -87
- package/InfoCard/index.d.mts +0 -1
- package/InfoCard/index.mjs +0 -1
- package/Link/Link.d.mts +0 -25
- package/Link/Link.mjs +0 -75
- package/Link/index.d.mts +0 -1
- package/Link/index.mjs +0 -1
- package/MarkdownElement/MarkdownElement.d.mts +0 -7
- package/MarkdownElement/MarkdownElement.mjs +0 -847
- package/MarkdownElement/index.d.mts +0 -1
- package/MarkdownElement/index.mjs +0 -1
- package/NProgressBar/NProgressBar.d.mts +0 -6
- package/NProgressBar/NProgressBar.js +0 -98
- package/NProgressBar/index.d.mts +0 -2
- package/NProgressBar/index.d.ts +0 -2
- package/NProgressBar/index.js +0 -13
- package/NProgressBar/index.mjs +0 -1
- package/SectionHeadline/SectionHeadline.d.mts +0 -13
- package/SectionHeadline/SectionHeadline.mjs +0 -81
- package/SectionHeadline/index.d.mts +0 -2
- package/SectionHeadline/index.mjs +0 -2
- package/SectionTitle/SectionTitle.d.mts +0 -6
- package/SectionTitle/SectionTitle.mjs +0 -29
- package/SectionTitle/index.d.mts +0 -1
- package/SectionTitle/index.mjs +0 -1
- package/ThemeContext/ThemeContext.d.mts +0 -92
- package/ThemeContext/ThemeContext.mjs +0 -200
- package/ThemeContext/index.d.mts +0 -1
- package/ThemeContext/index.mjs +0 -1
- package/branding/BrandingProvider.d.mts +0 -9
- package/branding/BrandingProvider.mjs +0 -17
- package/branding/brandingTheme.d.mts +0 -147
- package/branding/brandingTheme.mjs +0 -1527
- package/branding/index.d.mts +0 -2
- package/branding/index.mjs +0 -2
- package/i18n/i18n.d.mts +0 -27
- package/i18n/i18n.mjs +0 -111
- package/i18n/index.d.mts +0 -1
- package/i18n/index.mjs +0 -1
- package/nextFonts/index.d.mts +0 -6
- package/nextFonts/index.mjs +0 -59
- package/svgIcons/BundleSizeIcon.d.mts +0 -4
- package/svgIcons/BundleSizeIcon.mjs +0 -13
- package/svgIcons/FigmaIcon.d.mts +0 -4
- package/svgIcons/FigmaIcon.mjs +0 -22
- package/svgIcons/FileDownload.d.mts +0 -6
- package/svgIcons/FileDownload.mjs +0 -13
- package/svgIcons/JavaScript.d.mts +0 -6
- package/svgIcons/JavaScript.mjs +0 -13
- package/svgIcons/MarkdownIcon.d.mts +0 -2
- package/svgIcons/MarkdownIcon.mjs +0 -22
- package/svgIcons/MaterialDesignIcon.d.mts +0 -4
- package/svgIcons/MaterialDesignIcon.mjs +0 -18
- package/svgIcons/SketchIcon.d.mts +0 -4
- package/svgIcons/SketchIcon.mjs +0 -27
- package/svgIcons/TypeScript.d.mts +0 -6
- package/svgIcons/TypeScript.mjs +0 -13
- package/svgIcons/W3CIcon.d.mts +0 -4
- package/svgIcons/W3CIcon.mjs +0 -15
- package/translations/index.d.mts +0 -3
- package/translations/index.mjs +0 -4
- package/useLazyCSS/index.d.mts +0 -1
- package/useLazyCSS/index.mjs +0 -1
- package/useLazyCSS/useLazyCSS.d.mts +0 -11
- package/useLazyCSS/useLazyCSS.mjs +0 -70
- package/utils/loadScript.d.mts +0 -1
- package/utils/loadScript.mjs +0 -7
- /package/{NProgressBar → NextNProgressBar}/NProgressBar.d.ts +0 -0
- /package/{NProgressBar/NProgressBar.mjs → NextNProgressBar/NProgressBar.js} +0 -0
package/MarkdownElement/index.js
CHANGED
|
@@ -1,16 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
var _MarkdownElement = require("./MarkdownElement");
|
|
7
|
-
Object.keys(_MarkdownElement).forEach(function (key) {
|
|
8
|
-
if (key === "default" || key === "__esModule") return;
|
|
9
|
-
if (key in exports && exports[key] === _MarkdownElement[key]) return;
|
|
10
|
-
Object.defineProperty(exports, key, {
|
|
11
|
-
enumerable: true,
|
|
12
|
-
get: function () {
|
|
13
|
-
return _MarkdownElement[key];
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
});
|
|
1
|
+
export * from "./MarkdownElement.js";
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export type MuiPageIcon = 'ReaderIcon' | 'BookIcon' | 'DescriptionIcon' | 'VisibilityIcon' | 'WebIcon' | React.ComponentType;
|
|
3
|
+
export interface MuiPage {
|
|
4
|
+
pathname: string;
|
|
5
|
+
query?: object;
|
|
6
|
+
children?: MuiPage[];
|
|
7
|
+
disableDrawer?: boolean;
|
|
8
|
+
icon?: MuiPageIcon;
|
|
9
|
+
/**
|
|
10
|
+
* Indicates if the pages are regarding some legacy API.
|
|
11
|
+
*/
|
|
12
|
+
legacy?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Indicates if the pages are only available in some plan.
|
|
15
|
+
* @default 'community'
|
|
16
|
+
*/
|
|
17
|
+
plan?: 'community' | 'pro' | 'premium';
|
|
18
|
+
/**
|
|
19
|
+
* In case the children have pathnames out of pathname value, use this field to scope other pathnames.
|
|
20
|
+
* Pathname can be partial, for example '/components/' will cover '/components/button/' and '/components/link/'.
|
|
21
|
+
* @deprecated Dead code, to remove.
|
|
22
|
+
*/
|
|
23
|
+
scopePathnames?: string[];
|
|
24
|
+
/**
|
|
25
|
+
* Pages are considered to be ordered depth-first.
|
|
26
|
+
* If a page should be excluded from this order, set `order: false`.
|
|
27
|
+
* You want to set `inSideNav: false` if you don't want the page to appear in an ordered list e.g. for previous/next page navigation.
|
|
28
|
+
*/
|
|
29
|
+
inSideNav?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Props spread to the Link component.
|
|
32
|
+
*/
|
|
33
|
+
linkProps?: Record<string, unknown>;
|
|
34
|
+
/**
|
|
35
|
+
* Subheader to display before navigation links.
|
|
36
|
+
*/
|
|
37
|
+
subheader?: string;
|
|
38
|
+
/**
|
|
39
|
+
* Overrides the default page title.
|
|
40
|
+
*/
|
|
41
|
+
title?: string;
|
|
42
|
+
/**
|
|
43
|
+
* Indicates if the feature has been recently released.
|
|
44
|
+
* @default false
|
|
45
|
+
*/
|
|
46
|
+
newFeature?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Indicates if the feature is planned for development.
|
|
49
|
+
* @default false
|
|
50
|
+
*/
|
|
51
|
+
planned?: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Indicates if the component/hook is not stable yet.
|
|
54
|
+
*/
|
|
55
|
+
unstable?: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Indicates the item is in beta release.
|
|
58
|
+
*/
|
|
59
|
+
beta?: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Indicates if the pages are regarding some deprecated API.
|
|
62
|
+
*/
|
|
63
|
+
deprecated?: boolean;
|
|
64
|
+
}
|
|
65
|
+
export interface OrderedMuiPage extends MuiPage {
|
|
66
|
+
ordered?: true;
|
|
67
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { MuiPage, MuiPageIcon, OrderedMuiPage } from "./MuiPage.js";
|
package/MuiPage/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function NextNProgressBar(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
var _NProgressBar;
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { debounce } from '@mui/material/utils';
|
|
4
|
+
import { useRouter } from 'next/router';
|
|
5
|
+
import NProgress from 'nprogress';
|
|
6
|
+
import NProgressBar from "./NProgressBar.js";
|
|
7
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
+
const nProgressStart = debounce(() => {
|
|
9
|
+
NProgress.start();
|
|
10
|
+
}, 200);
|
|
11
|
+
function nProgressDone() {
|
|
12
|
+
nProgressStart.clear();
|
|
13
|
+
NProgress.done();
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
// eslint-disable-next-line import/prefer-default-export
|
|
17
|
+
export function NextNProgressBar() {
|
|
18
|
+
const router = useRouter();
|
|
19
|
+
React.useEffect(() => {
|
|
20
|
+
const handleRouteChangeStart = (_url, {
|
|
21
|
+
shallow
|
|
22
|
+
}) => {
|
|
23
|
+
if (!shallow) {
|
|
24
|
+
nProgressStart();
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
const handleRouteChangeDone = (_url, {
|
|
28
|
+
shallow
|
|
29
|
+
}) => {
|
|
30
|
+
if (!shallow) {
|
|
31
|
+
nProgressDone();
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
router.events.on('routeChangeStart', handleRouteChangeStart);
|
|
35
|
+
router.events.on('routeChangeComplete', handleRouteChangeDone);
|
|
36
|
+
router.events.on('routeChangeError', handleRouteChangeDone);
|
|
37
|
+
return () => {
|
|
38
|
+
router.events.off('routeChangeStart', handleRouteChangeStart);
|
|
39
|
+
router.events.off('routeChangeComplete', handleRouteChangeDone);
|
|
40
|
+
router.events.off('routeChangeError', handleRouteChangeDone);
|
|
41
|
+
};
|
|
42
|
+
}, [router]);
|
|
43
|
+
return _NProgressBar || (_NProgressBar = /*#__PURE__*/_jsx(NProgressBar, {}));
|
|
44
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./NextNProgressBar.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./NextNProgressBar.js";
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { Theme } from '@mui/material/styles';
|
|
3
|
+
import type { SxProps } from '@mui/system';
|
|
4
|
+
import type { MuiPage } from "../MuiPage/index.js";
|
|
5
|
+
import type { MuiProductId } from "../getProductInfoFromUrl/index.js";
|
|
6
|
+
export type RootSvgProps<P = unknown> = Omit<React.SVGProps<SVGSVGElement>, 'ref'> & {
|
|
7
|
+
sx?: SxProps<Theme>;
|
|
8
|
+
ref?: React.Ref<SVGSVGElement>;
|
|
9
|
+
} & P;
|
|
10
|
+
export interface ProductVersion {
|
|
11
|
+
text: string;
|
|
12
|
+
current: boolean;
|
|
13
|
+
href?: undefined;
|
|
14
|
+
}
|
|
15
|
+
export interface ProductInfo {
|
|
16
|
+
metadata: string;
|
|
17
|
+
name: string;
|
|
18
|
+
logo: (props: RootSvgProps) => React.JSX.Element;
|
|
19
|
+
logoSvg: string;
|
|
20
|
+
wordmarkSvg: string;
|
|
21
|
+
versions: ProductVersion[];
|
|
22
|
+
}
|
|
23
|
+
export interface MuiPageContext {
|
|
24
|
+
activePage: MuiPage | null;
|
|
25
|
+
pages: MuiPage[];
|
|
26
|
+
productId: MuiProductId;
|
|
27
|
+
productIdentifier: ProductInfo;
|
|
28
|
+
activePageParents: MuiPage[];
|
|
29
|
+
}
|
|
30
|
+
declare const PageContext: React.Context<MuiPageContext>;
|
|
31
|
+
export default PageContext;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./PageContext.js";
|
|
@@ -1,16 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.default = SectionHeadline;
|
|
9
|
-
var React = _interopRequireWildcard(require("react"));
|
|
10
|
-
var _Box = _interopRequireDefault(require("@mui/material/Box"));
|
|
11
|
-
var _Typography = _interopRequireDefault(require("@mui/material/Typography"));
|
|
12
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
-
function SectionHeadline(props) {
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import Box from '@mui/material/Box';
|
|
3
|
+
import Typography from '@mui/material/Typography';
|
|
4
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
5
|
+
export default function SectionHeadline(props) {
|
|
14
6
|
const {
|
|
15
7
|
alwaysCenter = false,
|
|
16
8
|
description,
|
|
@@ -19,11 +11,11 @@ function SectionHeadline(props) {
|
|
|
19
11
|
overline,
|
|
20
12
|
title
|
|
21
13
|
} = props;
|
|
22
|
-
return /*#__PURE__*/(
|
|
14
|
+
return /*#__PURE__*/_jsxs(Box, {
|
|
23
15
|
sx: {
|
|
24
16
|
m: alwaysCenter ? 'auto' : null
|
|
25
17
|
},
|
|
26
|
-
children: [overline && /*#__PURE__*/(
|
|
18
|
+
children: [overline && /*#__PURE__*/_jsx(Typography, {
|
|
27
19
|
id: id,
|
|
28
20
|
component: "h2",
|
|
29
21
|
variant: "body2",
|
|
@@ -36,7 +28,7 @@ function SectionHeadline(props) {
|
|
|
36
28
|
})
|
|
37
29
|
},
|
|
38
30
|
children: overline
|
|
39
|
-
}), typeof title === 'string' ? /*#__PURE__*/(
|
|
31
|
+
}), typeof title === 'string' ? /*#__PURE__*/_jsx(Typography, {
|
|
40
32
|
variant: "h2",
|
|
41
33
|
sx: theme => ({
|
|
42
34
|
maxWidth: 500,
|
|
@@ -65,7 +57,7 @@ function SectionHeadline(props) {
|
|
|
65
57
|
color: '#fff'
|
|
66
58
|
})
|
|
67
59
|
}
|
|
68
|
-
})), description && /*#__PURE__*/(
|
|
60
|
+
})), description && /*#__PURE__*/_jsx(Typography, {
|
|
69
61
|
sx: theme => ({
|
|
70
62
|
mt: 1,
|
|
71
63
|
mb: 3,
|
package/SectionHeadline/index.js
CHANGED
|
@@ -1,25 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
var _exportNames = {};
|
|
8
|
-
Object.defineProperty(exports, "default", {
|
|
9
|
-
enumerable: true,
|
|
10
|
-
get: function () {
|
|
11
|
-
return _SectionHeadline.default;
|
|
12
|
-
}
|
|
13
|
-
});
|
|
14
|
-
var _SectionHeadline = _interopRequireWildcard(require("./SectionHeadline"));
|
|
15
|
-
Object.keys(_SectionHeadline).forEach(function (key) {
|
|
16
|
-
if (key === "default" || key === "__esModule") return;
|
|
17
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
18
|
-
if (key in exports && exports[key] === _SectionHeadline[key]) return;
|
|
19
|
-
Object.defineProperty(exports, key, {
|
|
20
|
-
enumerable: true,
|
|
21
|
-
get: function () {
|
|
22
|
-
return _SectionHeadline[key];
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
});
|
|
1
|
+
export * from "./SectionHeadline.js";
|
|
2
|
+
export { default } from "./SectionHeadline.js";
|
|
@@ -1,31 +1,25 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.SectionTitle = SectionTitle;
|
|
7
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
8
1
|
var _span;
|
|
9
|
-
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
export function SectionTitle(props) {
|
|
10
4
|
const {
|
|
11
5
|
title,
|
|
12
6
|
hash,
|
|
13
7
|
level: Level = 'h2'
|
|
14
8
|
} = props;
|
|
15
|
-
return /*#__PURE__*/(
|
|
9
|
+
return /*#__PURE__*/_jsx(Level, {
|
|
16
10
|
id: hash,
|
|
17
11
|
style: {
|
|
18
12
|
flexGrow: 1
|
|
19
13
|
},
|
|
20
|
-
children: /*#__PURE__*/(
|
|
14
|
+
children: /*#__PURE__*/_jsxs("a", {
|
|
21
15
|
"aria-labelledby": hash,
|
|
22
16
|
className: "title-link-to-anchor",
|
|
23
17
|
href: `#${hash}`,
|
|
24
18
|
tabIndex: -1,
|
|
25
|
-
children: [title, _span || (_span = /*#__PURE__*/(
|
|
19
|
+
children: [title, _span || (_span = /*#__PURE__*/_jsx("span", {
|
|
26
20
|
className: "anchor-icon",
|
|
27
|
-
children: /*#__PURE__*/(
|
|
28
|
-
children: /*#__PURE__*/(
|
|
21
|
+
children: /*#__PURE__*/_jsx("svg", {
|
|
22
|
+
children: /*#__PURE__*/_jsx("use", {
|
|
29
23
|
xlinkHref: "#anchor-link-icon"
|
|
30
24
|
})
|
|
31
25
|
})
|
package/SectionTitle/index.js
CHANGED
|
@@ -1,16 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
var _SectionTitle = require("./SectionTitle");
|
|
7
|
-
Object.keys(_SectionTitle).forEach(function (key) {
|
|
8
|
-
if (key === "default" || key === "__esModule") return;
|
|
9
|
-
if (key in exports && exports[key] === _SectionTitle[key]) return;
|
|
10
|
-
Object.defineProperty(exports, key, {
|
|
11
|
-
enumerable: true,
|
|
12
|
-
get: function () {
|
|
13
|
-
return _SectionTitle[key];
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
});
|
|
1
|
+
export * from "./SectionTitle.js";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
declare function StyledEngineProvider(props: any): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
declare namespace StyledEngineProvider {
|
|
3
|
+
namespace propTypes {
|
|
4
|
+
let cacheLtr: PropTypes.Validator<object>;
|
|
5
|
+
let children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
export default StyledEngineProvider;
|
|
9
|
+
import PropTypes from 'prop-types';
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
var _GlobalStyles;
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
4
|
+
import { StyleSheetManager } from 'styled-components';
|
|
5
|
+
import { CacheProvider } from '@emotion/react';
|
|
6
|
+
import { createEmotionCache as createCache } from '@mui/material-nextjs/v15-pagesRouter';
|
|
7
|
+
import { prefixer } from 'stylis';
|
|
8
|
+
import rtlPlugin from '@mui/stylis-plugin-rtl';
|
|
9
|
+
import GlobalStyles from '@mui/material/GlobalStyles';
|
|
10
|
+
import { ThemeOptionsContext } from "../ThemeContext/index.js";
|
|
11
|
+
import globalSelector from "../globalSelector/index.js";
|
|
12
|
+
|
|
13
|
+
// Cache for the rtl version of the styles
|
|
14
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
15
|
+
const cacheRtl = createCache({
|
|
16
|
+
key: 'rtl',
|
|
17
|
+
prepend: true,
|
|
18
|
+
enableCssLayer: true,
|
|
19
|
+
stylisPlugins: [prefixer, rtlPlugin, globalSelector]
|
|
20
|
+
});
|
|
21
|
+
export default function StyledEngineProvider(props) {
|
|
22
|
+
const {
|
|
23
|
+
children,
|
|
24
|
+
cacheLtr
|
|
25
|
+
} = props;
|
|
26
|
+
const {
|
|
27
|
+
direction
|
|
28
|
+
} = React.useContext(ThemeOptionsContext);
|
|
29
|
+
const rtl = direction === 'rtl';
|
|
30
|
+
const emotionCache = direction === 'rtl' ? cacheRtl : cacheLtr;
|
|
31
|
+
return /*#__PURE__*/_jsx(StyleSheetManager, {
|
|
32
|
+
stylisPlugins: rtl ? [rtlPlugin] : [],
|
|
33
|
+
children: /*#__PURE__*/_jsxs(CacheProvider, {
|
|
34
|
+
value: emotionCache,
|
|
35
|
+
children: [_GlobalStyles || (_GlobalStyles = /*#__PURE__*/_jsx(GlobalStyles, {
|
|
36
|
+
styles: "@layer theme, docsearch, mui, utilities;"
|
|
37
|
+
})), children]
|
|
38
|
+
})
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
process.env.NODE_ENV !== "production" ? StyledEngineProvider.propTypes = {
|
|
42
|
+
cacheLtr: PropTypes.object.isRequired,
|
|
43
|
+
children: PropTypes.node
|
|
44
|
+
} : void 0;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./StyledEngineProvider.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./StyledEngineProvider.js";
|
|
@@ -1,30 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
exports.highDensity = void 0;
|
|
11
|
-
exports.useChangeTheme = useChangeTheme;
|
|
12
|
-
exports.useColorSchemeShim = useColorSchemeShim;
|
|
13
|
-
var React = _interopRequireWildcard(require("react"));
|
|
14
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
15
|
-
var _styles = require("@mui/material/styles");
|
|
16
|
-
var _utils = require("@mui/material/utils");
|
|
17
|
-
var _useMediaQuery = _interopRequireDefault(require("@mui/material/useMediaQuery"));
|
|
18
|
-
var _useLocalStorageState = _interopRequireDefault(require("@mui/utils/useLocalStorageState"));
|
|
19
|
-
var _useLazyCSS = _interopRequireDefault(require("../useLazyCSS"));
|
|
20
|
-
var _branding = require("../branding");
|
|
21
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { createTheme as createMdTheme } from '@mui/material/styles';
|
|
4
|
+
import { unstable_useEnhancedEffect as useEnhancedEffect } from '@mui/material/utils';
|
|
5
|
+
import useMediaQuery from '@mui/material/useMediaQuery';
|
|
6
|
+
import useLocalStorageState from '@mui/utils/useLocalStorageState';
|
|
7
|
+
import useLazyCSS from "../useLazyCSS/index.js";
|
|
8
|
+
import { getMetaThemeColor } from "../branding/index.js";
|
|
9
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
22
10
|
const themeInitialOptions = {
|
|
23
11
|
dense: false,
|
|
24
12
|
direction: 'ltr',
|
|
25
13
|
paletteMode: 'light'
|
|
26
14
|
};
|
|
27
|
-
const highDensity =
|
|
15
|
+
export const highDensity = {
|
|
28
16
|
components: {
|
|
29
17
|
MuiButton: {
|
|
30
18
|
defaultProps: {
|
|
@@ -93,17 +81,17 @@ const highDensity = exports.highDensity = {
|
|
|
93
81
|
}
|
|
94
82
|
}
|
|
95
83
|
};
|
|
96
|
-
const DispatchContext =
|
|
84
|
+
export const DispatchContext = /*#__PURE__*/React.createContext(() => {
|
|
97
85
|
throw new Error('Forgot to wrap component in `ThemeProvider`');
|
|
98
86
|
});
|
|
99
87
|
if (process.env.NODE_ENV !== 'production') {
|
|
100
88
|
DispatchContext.displayName = 'ThemeDispatchContext';
|
|
101
89
|
}
|
|
102
|
-
const ThemeOptionsContext =
|
|
90
|
+
export const ThemeOptionsContext = /*#__PURE__*/React.createContext(themeInitialOptions);
|
|
103
91
|
if (process.env.NODE_ENV !== 'production') {
|
|
104
92
|
ThemeOptionsContext.displayName = 'ThemeOptionsContext';
|
|
105
93
|
}
|
|
106
|
-
function ThemeProvider(props) {
|
|
94
|
+
export function ThemeProvider(props) {
|
|
107
95
|
const {
|
|
108
96
|
children
|
|
109
97
|
} = props;
|
|
@@ -137,7 +125,7 @@ function ThemeProvider(props) {
|
|
|
137
125
|
direction,
|
|
138
126
|
paletteMode
|
|
139
127
|
} = themeOptions;
|
|
140
|
-
(
|
|
128
|
+
useLazyCSS('/static/styles/prism-okaidia.css', '#prismjs');
|
|
141
129
|
|
|
142
130
|
// TODO replace with useColorScheme once all pages support css vars
|
|
143
131
|
const {
|
|
@@ -145,7 +133,7 @@ function ThemeProvider(props) {
|
|
|
145
133
|
systemMode
|
|
146
134
|
} = useColorSchemeShim();
|
|
147
135
|
const calculatedMode = mode === 'system' ? systemMode : mode;
|
|
148
|
-
(
|
|
136
|
+
useEnhancedEffect(() => {
|
|
149
137
|
dispatch({
|
|
150
138
|
type: 'CHANGE',
|
|
151
139
|
payload: {
|
|
@@ -153,10 +141,10 @@ function ThemeProvider(props) {
|
|
|
153
141
|
}
|
|
154
142
|
});
|
|
155
143
|
}, [calculatedMode]);
|
|
156
|
-
(
|
|
144
|
+
useEnhancedEffect(() => {
|
|
157
145
|
document.body.setAttribute('dir', direction);
|
|
158
146
|
}, [direction]);
|
|
159
|
-
(
|
|
147
|
+
useEnhancedEffect(() => {
|
|
160
148
|
// To support light and dark mode images in the docs
|
|
161
149
|
if (paletteMode === 'dark') {
|
|
162
150
|
document.body.classList.remove('mode-light');
|
|
@@ -167,29 +155,29 @@ function ThemeProvider(props) {
|
|
|
167
155
|
}
|
|
168
156
|
const metas = document.querySelectorAll('meta[name="theme-color"]');
|
|
169
157
|
metas.forEach(meta => {
|
|
170
|
-
meta.setAttribute('content',
|
|
158
|
+
meta.setAttribute('content', getMetaThemeColor(paletteMode));
|
|
171
159
|
});
|
|
172
160
|
}, [paletteMode]);
|
|
173
161
|
React.useEffect(() => {
|
|
174
162
|
// Expose the theme as a global variable so people can play with it.
|
|
175
|
-
window.createTheme =
|
|
163
|
+
window.createTheme = createMdTheme;
|
|
176
164
|
}, []);
|
|
177
|
-
return /*#__PURE__*/(
|
|
165
|
+
return /*#__PURE__*/_jsx(ThemeOptionsContext.Provider, {
|
|
178
166
|
value: themeOptions,
|
|
179
|
-
children: /*#__PURE__*/(
|
|
167
|
+
children: /*#__PURE__*/_jsx(DispatchContext.Provider, {
|
|
180
168
|
value: dispatch,
|
|
181
169
|
children: children
|
|
182
170
|
})
|
|
183
171
|
});
|
|
184
172
|
}
|
|
185
173
|
process.env.NODE_ENV !== "production" ? ThemeProvider.propTypes = {
|
|
186
|
-
children:
|
|
174
|
+
children: PropTypes.node
|
|
187
175
|
} : void 0;
|
|
188
176
|
|
|
189
177
|
/**
|
|
190
178
|
* @returns {(nextOptions: Partial<typeof themeInitialOptions>) => void}
|
|
191
179
|
*/
|
|
192
|
-
function useChangeTheme() {
|
|
180
|
+
export function useChangeTheme() {
|
|
193
181
|
const dispatch = React.useContext(DispatchContext);
|
|
194
182
|
return React.useCallback(options => dispatch({
|
|
195
183
|
type: 'CHANGE',
|
|
@@ -198,9 +186,9 @@ function useChangeTheme() {
|
|
|
198
186
|
}
|
|
199
187
|
|
|
200
188
|
// TODO: remove once all pages support css vars and replace call sites with useColorScheme()
|
|
201
|
-
function useColorSchemeShim() {
|
|
202
|
-
const [mode, setMode] = (
|
|
203
|
-
const prefersDarkMode = (
|
|
189
|
+
export function useColorSchemeShim() {
|
|
190
|
+
const [mode, setMode] = useLocalStorageState('mui-mode', 'system');
|
|
191
|
+
const prefersDarkMode = useMediaQuery('(prefers-color-scheme: dark)', {
|
|
204
192
|
noSsr: true
|
|
205
193
|
});
|
|
206
194
|
const systemMode = prefersDarkMode ? 'dark' : 'light';
|
package/ThemeContext/index.js
CHANGED
|
@@ -1,42 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "DispatchContext", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function () {
|
|
9
|
-
return _ThemeContext.DispatchContext;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
Object.defineProperty(exports, "ThemeOptionsContext", {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function () {
|
|
15
|
-
return _ThemeContext.ThemeOptionsContext;
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
Object.defineProperty(exports, "ThemeProvider", {
|
|
19
|
-
enumerable: true,
|
|
20
|
-
get: function () {
|
|
21
|
-
return _ThemeContext.ThemeProvider;
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
Object.defineProperty(exports, "highDensity", {
|
|
25
|
-
enumerable: true,
|
|
26
|
-
get: function () {
|
|
27
|
-
return _ThemeContext.highDensity;
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
Object.defineProperty(exports, "useChangeTheme", {
|
|
31
|
-
enumerable: true,
|
|
32
|
-
get: function () {
|
|
33
|
-
return _ThemeContext.useChangeTheme;
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
Object.defineProperty(exports, "useColorSchemeShim", {
|
|
37
|
-
enumerable: true,
|
|
38
|
-
get: function () {
|
|
39
|
-
return _ThemeContext.useColorSchemeShim;
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
var _ThemeContext = require("./ThemeContext");
|
|
1
|
+
export { ThemeProvider, ThemeOptionsContext, DispatchContext, highDensity, useChangeTheme, useColorSchemeShim } from "./ThemeContext.js";
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { PaletteColorOptions } from '@mui/material/styles';
|
|
3
|
+
declare module '@mui/material/styles' {
|
|
4
|
+
interface PaletteOptions {
|
|
5
|
+
primaryDark?: PaletteColorOptions;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
export declare function setDocsColors(primary: Record<string, string>, secondary: Record<string, string>): void;
|
|
9
|
+
export declare function resetDocsColor(): void;
|
|
10
|
+
export declare function setDocsSpacing(value: number): void;
|
|
11
|
+
export declare function resetDocsSpacing(): void;
|
|
12
|
+
export declare function BrandingCssThemeProvider({
|
|
13
|
+
children,
|
|
14
|
+
direction,
|
|
15
|
+
forceThemeRerender
|
|
16
|
+
}: React.PropsWithChildren<{
|
|
17
|
+
direction?: 'ltr' | 'rtl';
|
|
18
|
+
forceThemeRerender?: boolean;
|
|
19
|
+
}>): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export declare function BrandingCssVarsProvider(props: {
|
|
21
|
+
children: React.ReactNode;
|
|
22
|
+
direction?: 'ltr' | 'rtl';
|
|
23
|
+
}): import("react/jsx-runtime").JSX.Element;
|