@mui/internal-core-docs 0.0.1 → 9.0.0-canary.0
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 +5 -0
- package/Ad/Ad.js +226 -0
- package/Ad/AdCarbon.d.ts +2 -0
- package/Ad/AdCarbon.js +125 -0
- package/Ad/AdDisplay.d.ts +16 -0
- package/Ad/AdDisplay.js +86 -0
- package/Ad/AdGuest.d.ts +10 -0
- package/Ad/AdGuest.js +29 -0
- package/Ad/AdInHouse.d.ts +4 -0
- package/Ad/AdInHouse.js +14 -0
- package/Ad/AdManager.d.ts +19 -0
- package/Ad/AdManager.js +36 -0
- package/Ad/AdProvider.d.ts +15 -0
- package/Ad/AdProvider.js +24 -0
- package/Ad/ad.styles.d.ts +4 -0
- package/Ad/ad.styles.js +91 -0
- package/Ad/index.d.ts +5 -0
- package/Ad/index.js +7 -0
- package/ApiPage/ApiWarningAlert.d.ts +10 -0
- package/ApiPage/ApiWarningAlert.js +22 -0
- package/ApiPage/definitions/classes.d.ts +18 -0
- package/ApiPage/definitions/classes.js +54 -0
- package/ApiPage/definitions/index.d.ts +4 -0
- package/ApiPage/definitions/index.js +4 -0
- package/ApiPage/definitions/properties.d.ts +58 -0
- package/ApiPage/definitions/properties.js +110 -0
- package/ApiPage/definitions/slots.d.ts +16 -0
- package/ApiPage/definitions/slots.js +39 -0
- package/ApiPage/definitions/types.d.ts +53 -0
- package/ApiPage/definitions/types.js +1 -0
- package/ApiPage/index.d.ts +2 -0
- package/ApiPage/index.js +2 -0
- package/ApiPage/list/ClassesList.d.ts +11 -0
- package/ApiPage/list/ClassesList.js +103 -0
- package/ApiPage/list/ExpandableApiItem.d.ts +18 -0
- package/ApiPage/list/ExpandableApiItem.js +241 -0
- package/ApiPage/list/PropertiesList.d.ts +7 -0
- package/ApiPage/list/PropertiesList.js +263 -0
- package/ApiPage/list/SlotsList.d.ts +7 -0
- package/ApiPage/list/SlotsList.js +93 -0
- package/ApiPage/list/index.d.ts +1 -0
- package/ApiPage/list/index.js +1 -0
- package/ApiPage/private.d.ts +3 -0
- package/ApiPage/private.js +3 -0
- package/ApiPage/sections/ClassesSection.d.ts +34 -0
- package/ApiPage/sections/ClassesSection.js +76 -0
- package/ApiPage/sections/PropertiesSection.d.ts +45 -0
- package/ApiPage/sections/PropertiesSection.js +59 -0
- package/ApiPage/sections/SlotsSection.d.ts +24 -0
- package/ApiPage/sections/SlotsSection.js +61 -0
- package/ApiPage/sections/ToggleDisplayOption.d.ts +17 -0
- package/ApiPage/sections/ToggleDisplayOption.js +161 -0
- package/ApiPage/sections/index.d.ts +4 -0
- package/ApiPage/sections/index.js +4 -0
- package/ApiPage/table/ClassesTable.d.ts +7 -0
- package/ApiPage/table/ClassesTable.js +116 -0
- package/ApiPage/table/PropertiesTable.d.ts +6 -0
- package/ApiPage/table/PropertiesTable.js +286 -0
- package/ApiPage/table/SlotsTable.d.ts +6 -0
- package/ApiPage/table/SlotsTable.js +126 -0
- package/ApiPage/table/StyledTableContainer.d.ts +1 -0
- package/ApiPage/table/StyledTableContainer.js +42 -0
- package/ApiPage/types.d.ts +11 -0
- package/ApiPage/types.js +1 -0
- package/CHANGELOG.md +1651 -0
- package/CodeCopy/CodeCopy.d.ts +22 -0
- package/CodeCopy/CodeCopy.js +172 -0
- package/CodeCopy/CodeCopyButton.d.ts +4 -0
- package/CodeCopy/CodeCopyButton.js +40 -0
- package/CodeCopy/index.d.ts +3 -0
- package/CodeCopy/index.js +3 -0
- package/CodeCopy/useClipboardCopy.d.ts +4 -0
- package/CodeCopy/useClipboardCopy.js +21 -0
- package/ComponentLinkHeader/ComponentLinkHeader.d.ts +8 -0
- package/ComponentLinkHeader/ComponentLinkHeader.js +197 -0
- package/ComponentLinkHeader/index.d.ts +2 -0
- package/ComponentLinkHeader/index.js +2 -0
- 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/DocsApp/AnalyticsProvider.d.ts +17 -0
- package/DocsApp/AnalyticsProvider.js +229 -0
- package/DocsApp/DocsApp.d.ts +79 -0
- package/DocsApp/DocsApp.js +105 -0
- package/DocsApp/GoogleAnalytics.d.ts +9 -0
- package/DocsApp/GoogleAnalytics.js +129 -0
- package/DocsApp/StyledEngineProvider.d.ts +8 -0
- package/DocsApp/StyledEngineProvider.js +38 -0
- package/DocsApp/consoleBanner.d.ts +1 -0
- package/DocsApp/consoleBanner.js +18 -0
- package/DocsApp/createEmotionCache.d.ts +1 -0
- package/DocsApp/createEmotionCache.js +12 -0
- package/DocsApp/createGetInitialProps.d.ts +30 -0
- package/DocsApp/createGetInitialProps.js +29 -0
- package/DocsApp/index.d.ts +5 -0
- package/DocsApp/index.js +4 -0
- package/DocsApp/loadDependencies.d.ts +1 -0
- package/DocsApp/loadDependencies.js +9 -0
- package/DocsApp/reportWebVitals.d.ts +13 -0
- package/DocsApp/reportWebVitals.js +22 -0
- package/DocsApp/serviceWorker.d.ts +1 -0
- package/DocsApp/serviceWorker.js +59 -0
- package/DocsProvider/DocsProvider.d.ts +24 -0
- package/DocsProvider/DocsProvider.js +31 -0
- package/DocsProvider/index.d.ts +1 -0
- package/DocsProvider/index.js +1 -0
- package/Document/Document.d.ts +16 -0
- package/Document/Document.js +147 -0
- package/Document/getInitialProps.d.ts +18 -0
- package/Document/getInitialProps.js +60 -0
- package/Document/index.d.ts +2 -0
- package/Document/index.js +2 -0
- package/HighlightedCode/HighlightedCode.d.ts +14 -0
- package/HighlightedCode/HighlightedCode.js +67 -0
- package/HighlightedCode/index.d.ts +1 -0
- package/HighlightedCode/index.js +1 -0
- package/HighlightedCodeWithTabs/HighlightedCodeWithTabs.d.ts +28 -0
- package/HighlightedCodeWithTabs/HighlightedCodeWithTabs.js +362 -0
- package/HighlightedCodeWithTabs/index.d.ts +2 -0
- package/HighlightedCodeWithTabs/index.js +2 -0
- package/IconImage/IconImage.d.ts +11 -0
- package/IconImage/IconImage.js +83 -0
- package/IconImage/index.d.ts +1 -0
- package/IconImage/index.js +1 -0
- package/InfoCard/InfoCard.d.ts +22 -0
- package/InfoCard/InfoCard.js +91 -0
- package/InfoCard/index.d.ts +1 -0
- package/InfoCard/index.js +1 -0
- package/LICENSE +21 -0
- package/Link/Link.d.ts +25 -0
- package/Link/Link.js +75 -0
- package/Link/MarkdownLinks.d.ts +2 -0
- package/Link/MarkdownLinks.js +84 -0
- package/Link/SkipLink.d.ts +1 -0
- package/Link/SkipLink.js +64 -0
- package/Link/index.d.ts +3 -0
- package/Link/index.js +3 -0
- package/MarkdownElement/MarkdownElement.d.ts +7 -0
- package/MarkdownElement/MarkdownElement.js +847 -0
- package/MarkdownElement/index.d.ts +1 -0
- package/MarkdownElement/index.js +1 -0
- 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/NProgressBar.d.ts +6 -0
- package/NextNProgressBar/NProgressBar.js +91 -0
- package/NextNProgressBar/NextNProgressBar.d.ts +1 -0
- package/NextNProgressBar/NextNProgressBar.js +42 -0
- package/NextNProgressBar/index.d.ts +1 -0
- package/NextNProgressBar/index.js +1 -0
- package/PageContext/PageContext.d.ts +32 -0
- package/PageContext/PageContext.js +6 -0
- package/PageContext/index.d.ts +2 -0
- package/PageContext/index.js +1 -0
- package/README.md +26 -0
- package/SectionHeadline/SectionHeadline.d.ts +13 -0
- package/SectionHeadline/SectionHeadline.js +81 -0
- package/SectionHeadline/index.d.ts +2 -0
- package/SectionHeadline/index.js +2 -0
- package/SectionTitle/SectionTitle.d.ts +6 -0
- package/SectionTitle/SectionTitle.js +29 -0
- package/SectionTitle/index.d.ts +1 -0
- package/SectionTitle/index.js +1 -0
- package/ThemeContext/ThemeContext.d.ts +92 -0
- package/ThemeContext/ThemeContext.js +200 -0
- package/ThemeContext/index.d.ts +1 -0
- package/ThemeContext/index.js +1 -0
- package/branding/BrandingCssVarsProvider.d.ts +27 -0
- package/branding/BrandingCssVarsProvider.js +170 -0
- package/branding/BrandingProvider.d.ts +9 -0
- package/branding/BrandingProvider.js +17 -0
- package/branding/brandingTheme.d.ts +147 -0
- package/branding/brandingTheme.js +1534 -0
- package/branding/index.d.ts +3 -0
- package/branding/index.js +3 -0
- package/codeStyling/codeStyling.d.ts +7 -0
- package/codeStyling/codeStyling.js +80 -0
- package/codeStyling/index.d.ts +1 -0
- package/codeStyling/index.js +1 -0
- package/codeVariant/codeVariant.d.ts +7 -0
- package/codeVariant/codeVariant.js +69 -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/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.d.ts +27 -0
- package/i18n/i18n.js +111 -0
- package/i18n/index.d.ts +1 -0
- package/i18n/index.js +1 -0
- 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/fonts/GeneralSans-Bold.ttf +0 -0
- package/nextFonts/fonts/GeneralSans-Bold.woff2 +0 -0
- package/nextFonts/fonts/GeneralSans-Medium.ttf +0 -0
- package/nextFonts/fonts/GeneralSans-Medium.woff2 +0 -0
- package/nextFonts/fonts/GeneralSans-Regular.ttf +0 -0
- package/nextFonts/fonts/GeneralSans-Regular.woff2 +0 -0
- package/nextFonts/fonts/GeneralSans-Semibold-subset.woff2 +0 -0
- package/nextFonts/fonts/GeneralSans-Semibold.ttf +0 -0
- package/nextFonts/fonts/GeneralSans-Semibold.woff2 +0 -0
- package/nextFonts/fonts/IBMPlexSans-Bold.ttf +0 -0
- package/nextFonts/fonts/IBMPlexSans-Bold.woff +0 -0
- package/nextFonts/fonts/IBMPlexSans-Bold.woff2 +0 -0
- package/nextFonts/fonts/IBMPlexSans-Medium.ttf +0 -0
- package/nextFonts/fonts/IBMPlexSans-Medium.woff +0 -0
- package/nextFonts/fonts/IBMPlexSans-Medium.woff2 +0 -0
- package/nextFonts/fonts/IBMPlexSans-Regular-subset.woff2 +0 -0
- package/nextFonts/fonts/IBMPlexSans-Regular.ttf +0 -0
- package/nextFonts/fonts/IBMPlexSans-Regular.woff +0 -0
- package/nextFonts/fonts/IBMPlexSans-Regular.woff2 +0 -0
- package/nextFonts/fonts/IBMPlexSans-SemiBold.ttf +0 -0
- package/nextFonts/fonts/IBMPlexSans-SemiBold.woff +0 -0
- package/nextFonts/fonts/IBMPlexSans-SemiBold.woff2 +0 -0
- package/nextFonts/index.d.ts +6 -0
- package/nextFonts/index.js +59 -0
- package/package.json +426 -3
- package/svgIcons/BundleSizeIcon.d.ts +4 -0
- package/svgIcons/BundleSizeIcon.js +13 -0
- package/svgIcons/FigmaIcon.d.ts +4 -0
- package/svgIcons/FigmaIcon.js +22 -0
- package/svgIcons/FileDownload.d.ts +6 -0
- package/svgIcons/FileDownload.js +13 -0
- package/svgIcons/JavaScript.d.ts +6 -0
- package/svgIcons/JavaScript.js +13 -0
- package/svgIcons/MarkdownIcon.d.ts +2 -0
- package/svgIcons/MarkdownIcon.js +22 -0
- package/svgIcons/MaterialDesignIcon.d.ts +4 -0
- package/svgIcons/MaterialDesignIcon.js +18 -0
- package/svgIcons/SketchIcon.d.ts +4 -0
- package/svgIcons/SketchIcon.js +27 -0
- package/svgIcons/TypeScript.d.ts +6 -0
- package/svgIcons/TypeScript.js +13 -0
- package/svgIcons/W3CIcon.d.ts +4 -0
- package/svgIcons/W3CIcon.js +15 -0
- package/translations/index.d.ts +3 -0
- package/translations/index.js +4 -0
- package/translations/translations.json +222 -0
- package/useLazyCSS/index.d.ts +1 -0
- package/useLazyCSS/index.js +1 -0
- package/useLazyCSS/useLazyCSS.d.ts +11 -0
- package/useLazyCSS/useLazyCSS.js +70 -0
- package/utils/index.d.ts +1 -0
- package/utils/index.js +1 -0
- package/utils/loadScript.d.ts +1 -0
- package/utils/loadScript.js +7 -0
- package/webpack/index.d.ts +17 -0
- package/webpack/index.js +1 -0
package/Link/Link.js
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
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";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* File to keep in sync with:
|
|
11
|
+
*
|
|
12
|
+
* - /packages/mui-docs/src/Link/Link.tsx
|
|
13
|
+
* - /examples/material-ui-nextjs-pages-router/src/Link.js
|
|
14
|
+
* - /examples/material-ui-nextjs-pages-router-ts/src/Link.tsx
|
|
15
|
+
* - /examples/material-ui-nextjs-ts-v4-v5-migration/src/Link.tsx
|
|
16
|
+
*/
|
|
17
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
18
|
+
export const NextLinkComposed = /*#__PURE__*/React.forwardRef(function NextLinkComposed(props, ref) {
|
|
19
|
+
const {
|
|
20
|
+
to,
|
|
21
|
+
linkAs,
|
|
22
|
+
...other
|
|
23
|
+
} = props;
|
|
24
|
+
return /*#__PURE__*/_jsx(NextLink, {
|
|
25
|
+
href: to,
|
|
26
|
+
as: linkAs,
|
|
27
|
+
"data-no-markdown-link": "true",
|
|
28
|
+
ref: ref,
|
|
29
|
+
...other
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
// A styled version of the Next.js Link component:
|
|
33
|
+
// https://nextjs.org/docs/pages/api-reference/components/link
|
|
34
|
+
export const Link = /*#__PURE__*/React.forwardRef(function Link(props, ref) {
|
|
35
|
+
const {
|
|
36
|
+
activeClassName = 'active',
|
|
37
|
+
as,
|
|
38
|
+
className: classNameProps,
|
|
39
|
+
href,
|
|
40
|
+
linkAs: linkAsProp,
|
|
41
|
+
noLinkStyle,
|
|
42
|
+
...other
|
|
43
|
+
} = props;
|
|
44
|
+
const router = useRouter();
|
|
45
|
+
const pathname = typeof href === 'string' ? href : href?.pathname;
|
|
46
|
+
const routerPathname = router.pathname.replace('/[docsTab]', '');
|
|
47
|
+
const className = clsx(classNameProps, routerPathname === pathname && activeClassName);
|
|
48
|
+
const userLanguage = useUserLanguage();
|
|
49
|
+
const {
|
|
50
|
+
LANGUAGES_IGNORE_PAGES
|
|
51
|
+
} = useDocsConfig();
|
|
52
|
+
let linkAs = linkAsProp || as || href;
|
|
53
|
+
if (userLanguage !== 'en' && pathname && pathname.startsWith('/') && !LANGUAGES_IGNORE_PAGES(pathname) && !pathname.startsWith(`/${userLanguage}/`)) {
|
|
54
|
+
linkAs = `/${userLanguage}${linkAs}`;
|
|
55
|
+
}
|
|
56
|
+
const nextjsProps = {
|
|
57
|
+
to: href,
|
|
58
|
+
linkAs
|
|
59
|
+
};
|
|
60
|
+
if (noLinkStyle) {
|
|
61
|
+
return /*#__PURE__*/_jsx(NextLinkComposed, {
|
|
62
|
+
className: className,
|
|
63
|
+
ref: ref,
|
|
64
|
+
...nextjsProps,
|
|
65
|
+
...other
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
return /*#__PURE__*/_jsx(MuiLink, {
|
|
69
|
+
component: NextLinkComposed,
|
|
70
|
+
className: className,
|
|
71
|
+
ref: ref,
|
|
72
|
+
...nextjsProps,
|
|
73
|
+
...other
|
|
74
|
+
});
|
|
75
|
+
});
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import Router from 'next/router';
|
|
3
|
+
import { pathnameToLanguage } from "../helpers/helpers.js";
|
|
4
|
+
export function samePageLinkNavigation(event) {
|
|
5
|
+
if (event.defaultPrevented || event.button !== 0 ||
|
|
6
|
+
// ignore everything but left-click
|
|
7
|
+
event.metaKey || event.ctrlKey || event.altKey || event.shiftKey) {
|
|
8
|
+
return true;
|
|
9
|
+
}
|
|
10
|
+
return false;
|
|
11
|
+
}
|
|
12
|
+
function isLink(event) {
|
|
13
|
+
let activeElement = event.target;
|
|
14
|
+
while (activeElement?.nodeType === Node.ELEMENT_NODE && activeElement.nodeName !== 'A') {
|
|
15
|
+
activeElement = activeElement.parentElement;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
// Ignore non internal link clicks.
|
|
19
|
+
// Absolute URLs can be internal, we delegate this to Next.js's router
|
|
20
|
+
if (activeElement === null || activeElement.nodeName !== 'A' || activeElement.getAttribute('target') === '_blank' || activeElement.getAttribute('data-no-markdown-link') === 'true') {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
return activeElement;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* @param {MouseEvent} event
|
|
28
|
+
*/
|
|
29
|
+
function handleClick(event) {
|
|
30
|
+
// Ignore click events meant for native link handling, for example open in new tab
|
|
31
|
+
if (samePageLinkNavigation(event)) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
const activeElement = isLink(event);
|
|
35
|
+
if (activeElement === null) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
event.preventDefault();
|
|
39
|
+
const as = activeElement.getAttribute('href');
|
|
40
|
+
if (as === null) {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
const canonicalPathname = pathnameToLanguage(as).canonicalPathname;
|
|
44
|
+
Router.push(canonicalPathname, as);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Source copied from https://github.com/vercel/next.js/blob/ebc4eaaa2564b4283711646079d68e430496c88b/packages/next/src/client/link.tsx
|
|
49
|
+
*/
|
|
50
|
+
function handleMouseOver(event) {
|
|
51
|
+
const activeElement = isLink(event);
|
|
52
|
+
if (activeElement === null) {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
const as = activeElement.getAttribute('href');
|
|
56
|
+
if (as === null) {
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
const canonicalPathname = pathnameToLanguage(as).canonicalPathname;
|
|
60
|
+
const prefetchPromise = Router.prefetch(canonicalPathname, as, {
|
|
61
|
+
priority: true
|
|
62
|
+
});
|
|
63
|
+
// Prefetch the JSON page if asked (only in the client)
|
|
64
|
+
// We need to handle a prefetch error here since we may be
|
|
65
|
+
// loading with priority which can reject but we don't
|
|
66
|
+
// want to force navigation since this is only a prefetch
|
|
67
|
+
Promise.resolve(prefetchPromise).catch(err => {
|
|
68
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
69
|
+
// rethrow to show invalid URL errors
|
|
70
|
+
throw err;
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
export function MarkdownLinks() {
|
|
75
|
+
React.useEffect(() => {
|
|
76
|
+
document.addEventListener('click', handleClick);
|
|
77
|
+
document.addEventListener('mouseover', handleMouseOver);
|
|
78
|
+
return () => {
|
|
79
|
+
document.removeEventListener('click', handleClick);
|
|
80
|
+
document.removeEventListener('mouseover', handleMouseOver);
|
|
81
|
+
};
|
|
82
|
+
}, []);
|
|
83
|
+
return null;
|
|
84
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function SkipLink(): import("react/jsx-runtime").JSX.Element;
|
package/Link/SkipLink.js
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import MuiLink from '@mui/material/Link';
|
|
2
|
+
import { styled } from '@mui/material/styles';
|
|
3
|
+
import { useTranslate } from "../i18n/index.js";
|
|
4
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
|
+
const StyledLink = styled(MuiLink)(({
|
|
6
|
+
theme
|
|
7
|
+
}) => ({
|
|
8
|
+
position: 'fixed',
|
|
9
|
+
padding: theme.spacing(1, 2),
|
|
10
|
+
backgroundColor: (theme.vars || theme).palette.primary[50],
|
|
11
|
+
border: '1px solid',
|
|
12
|
+
borderColor: (theme.vars || theme).palette.primary[100],
|
|
13
|
+
color: (theme.vars || theme).palette.primary[600],
|
|
14
|
+
outlineOffset: 5,
|
|
15
|
+
outlineColor: (theme.vars || theme).palette.primary[300],
|
|
16
|
+
borderRadius: theme.shape.borderRadius,
|
|
17
|
+
left: theme.spacing(2),
|
|
18
|
+
zIndex: theme.zIndex.tooltip + 1,
|
|
19
|
+
top: theme.spacing(-10),
|
|
20
|
+
transition: theme.transitions.create('top', {
|
|
21
|
+
easing: theme.transitions.easing.easeIn,
|
|
22
|
+
duration: theme.transitions.duration.leavingScreen
|
|
23
|
+
}),
|
|
24
|
+
'&:hover': {
|
|
25
|
+
backgroundColor: (theme.vars || theme).palette.primary[100],
|
|
26
|
+
color: (theme.vars || theme).palette.primary[700]
|
|
27
|
+
},
|
|
28
|
+
'&:focus': {
|
|
29
|
+
top: theme.spacing(2),
|
|
30
|
+
transition: theme.transitions.create('top', {
|
|
31
|
+
easing: theme.transitions.easing.easeOut,
|
|
32
|
+
duration: theme.transitions.duration.enteringScreen
|
|
33
|
+
})
|
|
34
|
+
},
|
|
35
|
+
'@media (prefers-reduced-motion: reduce)': {
|
|
36
|
+
transition: theme.transitions.create('opacity'),
|
|
37
|
+
opacity: 0,
|
|
38
|
+
'&:focus': {
|
|
39
|
+
top: theme.spacing(2),
|
|
40
|
+
opacity: 1,
|
|
41
|
+
transition: theme.transitions.create('opacity')
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
'@media print': {
|
|
45
|
+
display: 'none'
|
|
46
|
+
},
|
|
47
|
+
...theme.applyDarkStyles({
|
|
48
|
+
backgroundColor: (theme.vars || theme).palette.primaryDark[600],
|
|
49
|
+
borderColor: (theme.vars || theme).palette.primaryDark[400],
|
|
50
|
+
color: (theme.vars || theme).palette.grey[100],
|
|
51
|
+
outlineColor: (theme.vars || theme).palette.primary[500],
|
|
52
|
+
'&:hover': {
|
|
53
|
+
backgroundColor: (theme.vars || theme).palette.primaryDark[500],
|
|
54
|
+
color: (theme.vars || theme).palette.grey[50]
|
|
55
|
+
}
|
|
56
|
+
})
|
|
57
|
+
}));
|
|
58
|
+
export function SkipLink() {
|
|
59
|
+
const t = useTranslate();
|
|
60
|
+
return /*#__PURE__*/_jsx(StyledLink, {
|
|
61
|
+
href: "#main-content",
|
|
62
|
+
children: t('appFrame.skipToContent')
|
|
63
|
+
});
|
|
64
|
+
}
|
package/Link/index.d.ts
ADDED
package/Link/index.js
ADDED
|
@@ -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>>;
|