From ffa50cb489d9c29daf00e6f56dc1a0d19c6bd0b7 Mon Sep 17 00:00:00 2001 From: MUI bot <2109932+Janpot@users.noreply.github.com> Date: Tue, 30 Jan 2024 13:38:00 +0100 Subject: [PATCH 01/21] Move i18n to @mui/docs --- .../components/material-icons/SearchIcons.js | 2 +- .../default-theme/DefaultTheme.js | 2 +- .../customization/density/DensityTool.js | 2 +- docs/pages/_app.js | 2 +- docs/pages/components.tsx | 2 +- docs/src/layouts/AppHeader.tsx | 2 +- docs/src/modules/components/Ad.js | 2 +- docs/src/modules/components/ApiPage.js | 2 +- .../components/ApiPage/list/ClassesList.tsx | 2 +- .../ApiPage/list/PropertiesList.tsx | 2 +- .../components/ApiPage/list/SlotsList.tsx | 2 +- .../ApiPage/sections/ClassesSection.tsx | 2 +- .../ApiPage/sections/PropertiesSection.js | 2 +- .../ApiPage/sections/SlotsSection.tsx | 2 +- .../components/ApiPage/table/ClassesTable.tsx | 2 +- .../ApiPage/table/PropertiesTable.tsx | 2 +- .../components/ApiPage/table/SlotsTable.tsx | 2 +- docs/src/modules/components/AppFrame.js | 2 +- .../modules/components/AppLayoutDocsFooter.js | 2 +- docs/src/modules/components/AppNavDrawer.js | 2 +- docs/src/modules/components/AppSearch.js | 2 +- .../modules/components/AppSettingsDrawer.js | 2 +- .../modules/components/AppTableOfContents.js | 2 +- docs/src/modules/components/BackToTop.tsx | 2 +- .../modules/components/ComponentLinkHeader.js | 2 +- .../modules/components/ComponentPageTabs.js | 2 +- .../components/ComponentsApiContent.js | 2 +- docs/src/modules/components/Demo.js | 2 +- docs/src/modules/components/DemoEditor.tsx | 2 +- docs/src/modules/components/DemoSandbox.js | 2 +- docs/src/modules/components/DemoToolbar.js | 2 +- .../src/modules/components/DiamondSponsors.js | 2 +- docs/src/modules/components/EditPage.js | 2 +- .../src/modules/components/GoogleAnalytics.js | 2 +- docs/src/modules/components/Head.tsx | 2 +- .../src/modules/components/HooksApiContent.js | 2 +- docs/src/modules/components/Link.tsx | 2 +- docs/src/modules/components/MarkdownDocs.js | 2 +- docs/src/modules/components/MarkdownDocsV2.js | 2 +- .../MaterialFreeTemplatesCollection.js | 2 +- .../modules/components/MaterialShowcase.js | 2 +- docs/src/modules/components/Notifications.js | 2 +- .../modules/components/RichMarkdownElement.js | 2 +- docs/src/modules/components/SkipLink.tsx | 2 +- docs/src/modules/components/ThemeContext.js | 2 +- docs/src/modules/utils/i18n.js | 96 +------------------ packages/mui-docs/src/i18n/index.js | 93 ++++++++++++++++++ 47 files changed, 141 insertions(+), 138 deletions(-) create mode 100644 packages/mui-docs/src/i18n/index.js diff --git a/docs/data/material/components/material-icons/SearchIcons.js b/docs/data/material/components/material-icons/SearchIcons.js index 30863dcf8a4d69..56c962b122a8e3 100644 --- a/docs/data/material/components/material-icons/SearchIcons.js +++ b/docs/data/material/components/material-icons/SearchIcons.js @@ -22,7 +22,7 @@ import Radio from '@mui/material/Radio'; import SvgIcon from '@mui/material/SvgIcon'; import * as mui from '@mui/icons-material'; import Link from 'docs/src/modules/components/Link'; -import { useTranslate } from 'docs/src/modules/utils/i18n'; +import { useTranslate } from '@mui/docs/i18n'; import useQueryParameterState from 'docs/src/modules/utils/useQueryParameterState'; // For Debugging // import Menu from '@mui/icons-material/Menu'; diff --git a/docs/data/material/customization/default-theme/DefaultTheme.js b/docs/data/material/customization/default-theme/DefaultTheme.js index 86df7d9295d62b..07024ca8c68148 100644 --- a/docs/data/material/customization/default-theme/DefaultTheme.js +++ b/docs/data/material/customization/default-theme/DefaultTheme.js @@ -4,7 +4,7 @@ import Divider from '@mui/material/Divider'; import { createTheme, styled } from '@mui/material/styles'; import FormControlLabel from '@mui/material/FormControlLabel'; import Switch from '@mui/material/Switch'; -import { useTranslate } from 'docs/src/modules/utils/i18n'; +import { useTranslate } from '@mui/docs/i18n'; import ThemeViewer, { useNodeIdsLazy, } from 'docs/src/modules/components/ThemeViewer'; diff --git a/docs/data/material/customization/density/DensityTool.js b/docs/data/material/customization/density/DensityTool.js index 99060eda788a1c..02f57e1eec9537 100644 --- a/docs/data/material/customization/density/DensityTool.js +++ b/docs/data/material/customization/density/DensityTool.js @@ -10,7 +10,7 @@ import Switch from '@mui/material/Switch'; import IncreaseIcon from '@mui/icons-material/AddCircleOutline'; import DecreaseIcon from '@mui/icons-material/RemoveCircleOutline'; import { DispatchContext } from 'docs/src/modules/components/ThemeContext'; -import { useTranslate } from 'docs/src/modules/utils/i18n'; +import { useTranslate } from '@mui/docs/i18n'; const minSpacing = 0; const maxSpacing = 20; diff --git a/docs/pages/_app.js b/docs/pages/_app.js index f86f4c50e731b5..359ed3951d6f95 100644 --- a/docs/pages/_app.js +++ b/docs/pages/_app.js @@ -22,7 +22,7 @@ import { CodeCopyProvider } from 'docs/src/modules/utils/CodeCopy'; import { ThemeProvider } from 'docs/src/modules/components/ThemeContext'; import { CodeVariantProvider } from 'docs/src/modules/utils/codeVariant'; import { CodeStylingProvider } from 'docs/src/modules/utils/codeStylingSolution'; -import { UserLanguageProvider } from 'docs/src/modules/utils/i18n'; +import { UserLanguageProvider } from '@mui/docs/i18n'; import DocsStyledEngineProvider from 'docs/src/modules/utils/StyledEngineProvider'; import createEmotionCache from 'docs/src/createEmotionCache'; import findActivePage from 'docs/src/modules/utils/findActivePage'; diff --git a/docs/pages/components.tsx b/docs/pages/components.tsx index 7d3194d4fa761c..a621cec4f812e4 100644 --- a/docs/pages/components.tsx +++ b/docs/pages/components.tsx @@ -12,7 +12,7 @@ import AppFooter from 'docs/src/layouts/AppFooter'; import BrandingCssVarsProvider from 'docs/src/BrandingCssVarsProvider'; import Section from 'docs/src/layouts/Section'; import { pageToTitleI18n } from 'docs/src/modules/utils/helpers'; -import { useTranslate } from 'docs/src/modules/utils/i18n'; +import { useTranslate } from '@mui/docs/i18n'; import Link from 'docs/src/modules/components/Link'; import type { MuiPage } from 'docs/src/MuiPage'; import materialPages from 'docs/data/material/pages'; diff --git a/docs/src/layouts/AppHeader.tsx b/docs/src/layouts/AppHeader.tsx index 8aba9bb331058d..3f4f5567a5c844 100644 --- a/docs/src/layouts/AppHeader.tsx +++ b/docs/src/layouts/AppHeader.tsx @@ -13,7 +13,7 @@ import HeaderNavDropdown from 'docs/src/components/header/HeaderNavDropdown'; import ThemeModeToggle from 'docs/src/components/header/ThemeModeToggle'; import Link from 'docs/src/modules/components/Link'; import { DeferredAppSearch } from 'docs/src/modules/components/AppFrame'; -import { useTranslate } from 'docs/src/modules/utils/i18n'; +import { useTranslate } from '@mui/docs/i18n'; const Header = styled('header')(({ theme }) => [ { diff --git a/docs/src/modules/components/Ad.js b/docs/src/modules/components/Ad.js index 1247850638aa61..eddd42bb79bfcf 100644 --- a/docs/src/modules/components/Ad.js +++ b/docs/src/modules/components/Ad.js @@ -6,7 +6,7 @@ import Paper from '@mui/material/Paper'; import AdCarbon from 'docs/src/modules/components/AdCarbon'; import AdInHouse from 'docs/src/modules/components/AdInHouse'; import { AdContext, adShape } from 'docs/src/modules/components/AdManager'; -import { useTranslate } from 'docs/src/modules/utils/i18n'; +import { useTranslate } from '@mui/docs/i18n'; function PleaseDisableAdblock(props) { const t = useTranslate(); diff --git a/docs/src/modules/components/ApiPage.js b/docs/src/modules/components/ApiPage.js index 568496a14bf8ce..47fc737c2f44a5 100644 --- a/docs/src/modules/components/ApiPage.js +++ b/docs/src/modules/components/ApiPage.js @@ -8,7 +8,7 @@ import AdGuest from 'docs/src/modules/components/AdGuest'; import Alert from '@mui/material/Alert'; import VerifiedRoundedIcon from '@mui/icons-material/VerifiedRounded'; import { alpha } from '@mui/material/styles'; -import { useTranslate, useUserLanguage } from 'docs/src/modules/utils/i18n'; +import { useTranslate, useUserLanguage } from '@mui/docs/i18n'; import HighlightedCode from 'docs/src/modules/components/HighlightedCode'; import MarkdownElement from 'docs/src/modules/components/MarkdownElement'; import AppLayoutDocs from 'docs/src/modules/components/AppLayoutDocs'; diff --git a/docs/src/modules/components/ApiPage/list/ClassesList.tsx b/docs/src/modules/components/ApiPage/list/ClassesList.tsx index ed4fc21b901be7..0b4982049abea4 100644 --- a/docs/src/modules/components/ApiPage/list/ClassesList.tsx +++ b/docs/src/modules/components/ApiPage/list/ClassesList.tsx @@ -3,7 +3,7 @@ import * as React from 'react'; import { styled } from '@mui/material/styles'; import kebabCase from 'lodash/kebabCase'; import { ComponentClassDefinition } from '@mui-internal/docs-utilities'; -import { useTranslate } from 'docs/src/modules/utils/i18n'; +import { useTranslate } from '@mui/docs/i18n'; import ExpandableApiItem, { ApiItemContaier, } from 'docs/src/modules/components/ApiPage/list/ExpandableApiItem'; diff --git a/docs/src/modules/components/ApiPage/list/PropertiesList.tsx b/docs/src/modules/components/ApiPage/list/PropertiesList.tsx index 46bf826b14ce57..af3d018b340418 100644 --- a/docs/src/modules/components/ApiPage/list/PropertiesList.tsx +++ b/docs/src/modules/components/ApiPage/list/PropertiesList.tsx @@ -2,7 +2,7 @@ import * as React from 'react'; import { styled } from '@mui/material/styles'; import kebabCase from 'lodash/kebabCase'; -import { useTranslate } from 'docs/src/modules/utils/i18n'; +import { useTranslate } from '@mui/docs/i18n'; import { brandingDarkTheme as darkTheme, brandingLightTheme as lightTheme, diff --git a/docs/src/modules/components/ApiPage/list/SlotsList.tsx b/docs/src/modules/components/ApiPage/list/SlotsList.tsx index 03db0f5396e06f..f205d62009f5fd 100644 --- a/docs/src/modules/components/ApiPage/list/SlotsList.tsx +++ b/docs/src/modules/components/ApiPage/list/SlotsList.tsx @@ -5,7 +5,7 @@ import { brandingLightTheme as lightTheme, brandingDarkTheme as darkTheme, } from 'docs/src/modules/brandingTheme'; -import { useTranslate } from 'docs/src/modules/utils/i18n'; +import { useTranslate } from '@mui/docs/i18n'; import ExpandableApiItem, { ApiItemContaier, } from 'docs/src/modules/components/ApiPage/list/ExpandableApiItem'; diff --git a/docs/src/modules/components/ApiPage/sections/ClassesSection.tsx b/docs/src/modules/components/ApiPage/sections/ClassesSection.tsx index 318c159fc6e78d..d2789d7f5fab96 100644 --- a/docs/src/modules/components/ApiPage/sections/ClassesSection.tsx +++ b/docs/src/modules/components/ApiPage/sections/ClassesSection.tsx @@ -1,6 +1,6 @@ /* eslint-disable react/no-danger */ import * as React from 'react'; -import { useTranslate } from 'docs/src/modules/utils/i18n'; +import { useTranslate } from '@mui/docs/i18n'; import { ComponentClassDefinition } from '@mui-internal/docs-utilities'; import Box from '@mui/material/Box'; import ToggleDisplayOption, { diff --git a/docs/src/modules/components/ApiPage/sections/PropertiesSection.js b/docs/src/modules/components/ApiPage/sections/PropertiesSection.js index a19e6ebe8c1eca..1cccc5bf25cf46 100644 --- a/docs/src/modules/components/ApiPage/sections/PropertiesSection.js +++ b/docs/src/modules/components/ApiPage/sections/PropertiesSection.js @@ -2,7 +2,7 @@ import * as React from 'react'; import PropTypes from 'prop-types'; import Box from '@mui/material/Box'; -import { useTranslate } from 'docs/src/modules/utils/i18n'; +import { useTranslate } from '@mui/docs/i18n'; import ToggleDisplayOption, { API_LAYOUT_STORAGE_KEYS, useApiPageOption, diff --git a/docs/src/modules/components/ApiPage/sections/SlotsSection.tsx b/docs/src/modules/components/ApiPage/sections/SlotsSection.tsx index 966f578855f484..be58775e338419 100644 --- a/docs/src/modules/components/ApiPage/sections/SlotsSection.tsx +++ b/docs/src/modules/components/ApiPage/sections/SlotsSection.tsx @@ -1,7 +1,7 @@ /* eslint-disable react/no-danger */ import * as React from 'react'; import Box from '@mui/material/Box'; -import { useTranslate } from 'docs/src/modules/utils/i18n'; +import { useTranslate } from '@mui/docs/i18n'; import ToggleDisplayOption, { API_LAYOUT_STORAGE_KEYS, useApiPageOption, diff --git a/docs/src/modules/components/ApiPage/table/ClassesTable.tsx b/docs/src/modules/components/ApiPage/table/ClassesTable.tsx index 881be9202db048..52846fa9a1d746 100644 --- a/docs/src/modules/components/ApiPage/table/ClassesTable.tsx +++ b/docs/src/modules/components/ApiPage/table/ClassesTable.tsx @@ -8,7 +8,7 @@ import { } from 'docs/src/modules/brandingTheme'; import { getHash } from 'docs/src/modules/components/ApiPage/list/ClassesList'; import StyledTableContainer from 'docs/src/modules/components/ApiPage/table/StyledTableContainer'; -import { useTranslate } from 'docs/src/modules/utils/i18n'; +import { useTranslate } from '@mui/docs/i18n'; import ApiWarning from 'docs/src/modules/components/ApiPage/ApiWarning'; const StyledTable = styled('table')( diff --git a/docs/src/modules/components/ApiPage/table/PropertiesTable.tsx b/docs/src/modules/components/ApiPage/table/PropertiesTable.tsx index c6f474c06d8cb2..8a6295f38dbab5 100644 --- a/docs/src/modules/components/ApiPage/table/PropertiesTable.tsx +++ b/docs/src/modules/components/ApiPage/table/PropertiesTable.tsx @@ -1,7 +1,7 @@ /* eslint-disable react/no-danger */ import * as React from 'react'; import { styled, alpha } from '@mui/material/styles'; -import { useTranslate } from 'docs/src/modules/utils/i18n'; +import { useTranslate } from '@mui/docs/i18n'; import { brandingDarkTheme as darkTheme, brandingLightTheme as lightTheme, diff --git a/docs/src/modules/components/ApiPage/table/SlotsTable.tsx b/docs/src/modules/components/ApiPage/table/SlotsTable.tsx index 8b2bf8e7176166..d08c3e68aa3133 100644 --- a/docs/src/modules/components/ApiPage/table/SlotsTable.tsx +++ b/docs/src/modules/components/ApiPage/table/SlotsTable.tsx @@ -1,6 +1,6 @@ /* eslint-disable react/no-danger */ import * as React from 'react'; -import { useTranslate } from 'docs/src/modules/utils/i18n'; +import { useTranslate } from '@mui/docs/i18n'; import { styled, alpha } from '@mui/material/styles'; import { brandingDarkTheme as darkTheme, diff --git a/docs/src/modules/components/AppFrame.js b/docs/src/modules/components/AppFrame.js index 34ff270ec019a5..9a21790f926c6b 100644 --- a/docs/src/modules/components/AppFrame.js +++ b/docs/src/modules/components/AppFrame.js @@ -23,7 +23,7 @@ import Notifications from 'docs/src/modules/components/Notifications'; import MarkdownLinks from 'docs/src/modules/components/MarkdownLinks'; import SkipLink from 'docs/src/modules/components/SkipLink'; import PageContext from 'docs/src/modules/components/PageContext'; -import { useTranslate } from 'docs/src/modules/utils/i18n'; +import { useTranslate } from '@mui/docs/i18n'; import SvgMuiLogomark from 'docs/src/icons/SvgMuiLogomark'; import AppFrameBanner from 'docs/src/components/banner/AppFrameBanner'; diff --git a/docs/src/modules/components/AppLayoutDocsFooter.js b/docs/src/modules/components/AppLayoutDocsFooter.js index 7857133a8a4277..8137c5d55f4448 100644 --- a/docs/src/modules/components/AppLayoutDocsFooter.js +++ b/docs/src/modules/components/AppLayoutDocsFooter.js @@ -31,7 +31,7 @@ import Link from 'docs/src/modules/components/Link'; import PageContext from 'docs/src/modules/components/PageContext'; import EditPage from 'docs/src/modules/components/EditPage'; import SvgMuiLogotype from 'docs/src/icons/SvgMuiLogotype'; -import { useUserLanguage, useTranslate } from 'docs/src/modules/utils/i18n'; +import { useUserLanguage, useTranslate } from '@mui/docs/i18n'; import { getCookie, pageToTitleI18n } from 'docs/src/modules/utils/helpers'; const FooterLink = styled(Typography)(({ theme }) => { diff --git a/docs/src/modules/components/AppNavDrawer.js b/docs/src/modules/components/AppNavDrawer.js index 2bb699b2827bc4..32ad7954cee8ff 100644 --- a/docs/src/modules/components/AppNavDrawer.js +++ b/docs/src/modules/components/AppNavDrawer.js @@ -19,7 +19,7 @@ import SvgMuiLogomark from 'docs/src/icons/SvgMuiLogomark'; import AppNavDrawerItem from 'docs/src/modules/components/AppNavDrawerItem'; import { pageToTitleI18n } from 'docs/src/modules/utils/helpers'; import PageContext from 'docs/src/modules/components/PageContext'; -import { useTranslate } from 'docs/src/modules/utils/i18n'; +import { useTranslate } from '@mui/docs/i18n'; import MuiProductSelector from 'docs/src/modules/components/MuiProductSelector'; // TODO: Collapse should expose an API to customize the duration based on the height. diff --git a/docs/src/modules/components/AppSearch.js b/docs/src/modules/components/AppSearch.js index 99bb48a68a9130..f6da0f050af680 100644 --- a/docs/src/modules/components/AppSearch.js +++ b/docs/src/modules/components/AppSearch.js @@ -24,7 +24,7 @@ import { alpha, styled } from '@mui/material/styles'; import { pathnameToLanguage } from 'docs/src/modules/utils/helpers'; import { LANGUAGES_SSR } from 'docs/config'; import Link from 'docs/src/modules/components/Link'; -import { useTranslate, useUserLanguage } from 'docs/src/modules/utils/i18n'; +import { useTranslate, useUserLanguage } from '@mui/docs/i18n'; import useLazyCSS from 'docs/src/modules/utils/useLazyCSS'; import PageContext from 'docs/src/modules/components/PageContext'; diff --git a/docs/src/modules/components/AppSettingsDrawer.js b/docs/src/modules/components/AppSettingsDrawer.js index 93548164573c46..3ddad7cb06a71b 100644 --- a/docs/src/modules/components/AppSettingsDrawer.js +++ b/docs/src/modules/components/AppSettingsDrawer.js @@ -17,7 +17,7 @@ import SettingsBrightnessIcon from '@mui/icons-material/SettingsBrightness'; import FormatTextdirectionLToRIcon from '@mui/icons-material/FormatTextdirectionLToR'; import FormatTextdirectionRToLIcon from '@mui/icons-material/FormatTextdirectionRToL'; import { useChangeTheme } from 'docs/src/modules/components/ThemeContext'; -import { useTranslate } from 'docs/src/modules/utils/i18n'; +import { useTranslate } from '@mui/docs/i18n'; const Heading = styled(Typography)(({ theme }) => ({ margin: '20px 0 10px', diff --git a/docs/src/modules/components/AppTableOfContents.js b/docs/src/modules/components/AppTableOfContents.js index 529b07b1ddbcc3..13fd1b4001a7ca 100644 --- a/docs/src/modules/components/AppTableOfContents.js +++ b/docs/src/modules/components/AppTableOfContents.js @@ -6,7 +6,7 @@ import { styled, alpha } from '@mui/material/styles'; import Typography from '@mui/material/Typography'; import NoSsr from '@mui/material/NoSsr'; import Link from 'docs/src/modules/components/Link'; -import { useTranslate } from 'docs/src/modules/utils/i18n'; +import { useTranslate } from '@mui/docs/i18n'; import { samePageLinkNavigation } from 'docs/src/modules/components/MarkdownLinks'; import TableOfContentsBanner from 'docs/src/components/banner/TableOfContentsBanner'; import featureToggle from 'docs/src/featureToggle'; diff --git a/docs/src/modules/components/BackToTop.tsx b/docs/src/modules/components/BackToTop.tsx index 4f4dc538e28e9e..a3366f7f626fb4 100644 --- a/docs/src/modules/components/BackToTop.tsx +++ b/docs/src/modules/components/BackToTop.tsx @@ -6,7 +6,7 @@ import Tooltip from '@mui/material/Tooltip'; import KeyboardArrowUpRoundedIcon from '@mui/icons-material/KeyboardArrowUpRounded'; import Fade from '@mui/material/Fade'; import { Theme } from '@mui/material/styles'; -import { useTranslate } from 'docs/src/modules/utils/i18n'; +import { useTranslate } from '@mui/docs/i18n'; export default function BackToTop() { const t = useTranslate(); diff --git a/docs/src/modules/components/ComponentLinkHeader.js b/docs/src/modules/components/ComponentLinkHeader.js index 1be2351a21016b..ebc8e4cef3e9be 100644 --- a/docs/src/modules/components/ComponentLinkHeader.js +++ b/docs/src/modules/components/ComponentLinkHeader.js @@ -10,7 +10,7 @@ import AdobeXDIcon from 'docs/src/modules/components/AdobeXDIcon'; import BundleSizeIcon from 'docs/src/modules/components/BundleSizeIcon'; import W3CIcon from 'docs/src/modules/components/W3CIcon'; import MaterialDesignIcon from 'docs/src/modules/components/MaterialDesignIcon'; -import { useTranslate } from 'docs/src/modules/utils/i18n'; +import { useTranslate } from '@mui/docs/i18n'; const Root = styled('ul')({ margin: 0, diff --git a/docs/src/modules/components/ComponentPageTabs.js b/docs/src/modules/components/ComponentPageTabs.js index 1d61b09b846ae9..d8cabe15325da6 100644 --- a/docs/src/modules/components/ComponentPageTabs.js +++ b/docs/src/modules/components/ComponentPageTabs.js @@ -5,7 +5,7 @@ import { styled } from '@mui/material/styles'; import Box from '@mui/material/Box'; import Tabs, { tabsClasses } from '@mui/material/Tabs'; import Tab, { tabClasses } from '@mui/material/Tab'; -import { useTranslate } from 'docs/src/modules/utils/i18n'; +import { useTranslate } from '@mui/docs/i18n'; import Link from 'docs/src/modules/components/Link'; export const HEIGHT = 50; diff --git a/docs/src/modules/components/ComponentsApiContent.js b/docs/src/modules/components/ComponentsApiContent.js index d76390a243fd48..36b59c429a9dd0 100644 --- a/docs/src/modules/components/ComponentsApiContent.js +++ b/docs/src/modules/components/ComponentsApiContent.js @@ -4,7 +4,7 @@ import PropTypes from 'prop-types'; import kebabCase from 'lodash/kebabCase'; import { useRouter } from 'next/router'; import { exactProp } from '@mui/utils'; -import { useTranslate, useUserLanguage } from 'docs/src/modules/utils/i18n'; +import { useTranslate, useUserLanguage } from '@mui/docs/i18n'; import HighlightedCode from 'docs/src/modules/components/HighlightedCode'; import MarkdownElement from 'docs/src/modules/components/MarkdownElement'; import PropertiesSection from 'docs/src/modules/components/ApiPage/sections/PropertiesSection'; diff --git a/docs/src/modules/components/Demo.js b/docs/src/modules/components/Demo.js index 15250e4312f19a..12cdd5d9c5e1d2 100644 --- a/docs/src/modules/components/Demo.js +++ b/docs/src/modules/components/Demo.js @@ -19,7 +19,7 @@ import { pathnameToLanguage } from 'docs/src/modules/utils/helpers'; import { useCodeVariant } from 'docs/src/modules/utils/codeVariant'; import { useCodeStyling } from 'docs/src/modules/utils/codeStylingSolution'; import { CODE_VARIANTS, CODE_STYLING } from 'docs/src/modules/constants'; -import { useUserLanguage, useTranslate } from 'docs/src/modules/utils/i18n'; +import { useUserLanguage, useTranslate } from '@mui/docs/i18n'; import stylingSolutionMapping from 'docs/src/modules/utils/stylingSolutionMapping'; import BrandingProvider from 'docs/src/BrandingProvider'; import DemoToolbarRoot from 'docs/src/modules/components/DemoToolbarRoot'; diff --git a/docs/src/modules/components/DemoEditor.tsx b/docs/src/modules/components/DemoEditor.tsx index 09635d291597eb..0172043e473a87 100644 --- a/docs/src/modules/components/DemoEditor.tsx +++ b/docs/src/modules/components/DemoEditor.tsx @@ -6,7 +6,7 @@ import { styled, useTheme } from '@mui/material/styles'; import prism from '@mui/markdown/prism'; import MarkdownElement from 'docs/src/modules/components/MarkdownElement'; import CodeCopyButton from 'docs/src/modules/components/CodeCopyButton'; -import { useTranslate } from 'docs/src/modules/utils/i18n'; +import { useTranslate } from '@mui/docs/i18n'; import { useCodeCopy } from 'docs/src/modules/utils/CodeCopy'; import { blueDark } from 'docs/src/modules/brandingTheme'; diff --git a/docs/src/modules/components/DemoSandbox.js b/docs/src/modules/components/DemoSandbox.js index 78aff5ce50a01e..57ebf0ace75a40 100644 --- a/docs/src/modules/components/DemoSandbox.js +++ b/docs/src/modules/components/DemoSandbox.js @@ -12,7 +12,7 @@ import { CssVarsProvider, extendTheme } from '@mui/joy/styles'; import { useTheme, styled, createTheme, ThemeProvider } from '@mui/material/styles'; import rtl from 'jss-rtl'; import DemoErrorBoundary from 'docs/src/modules/components/DemoErrorBoundary'; -import { useTranslate } from 'docs/src/modules/utils/i18n'; +import { useTranslate } from '@mui/docs/i18n'; import { getDesignTokens } from 'docs/src/modules/brandingTheme'; import { highDensity } from 'docs/src/modules/components/ThemeContext'; diff --git a/docs/src/modules/components/DemoToolbar.js b/docs/src/modules/components/DemoToolbar.js index 37314192980a39..f5b5ee35fa093e 100644 --- a/docs/src/modules/components/DemoToolbar.js +++ b/docs/src/modules/components/DemoToolbar.js @@ -24,7 +24,7 @@ import { useRouter } from 'next/router'; import { CODE_VARIANTS, CODE_STYLING } from 'docs/src/modules/constants'; import { useSetCodeVariant } from 'docs/src/modules/utils/codeVariant'; import { useSetCodeStyling, useCodeStyling } from 'docs/src/modules/utils/codeStylingSolution'; -import { useTranslate } from 'docs/src/modules/utils/i18n'; +import { useTranslate } from '@mui/docs/i18n'; import stylingSolutionMapping from 'docs/src/modules/utils/stylingSolutionMapping'; import codeSandbox from '../sandbox/CodeSandbox'; import stackBlitz from '../sandbox/StackBlitz'; diff --git a/docs/src/modules/components/DiamondSponsors.js b/docs/src/modules/components/DiamondSponsors.js index 6e97f9e5ca3e60..5cf92097661ef3 100644 --- a/docs/src/modules/components/DiamondSponsors.js +++ b/docs/src/modules/components/DiamondSponsors.js @@ -5,7 +5,7 @@ import Stack from '@mui/material/Stack'; import Button from '@mui/material/Button'; import Typography from '@mui/material/Typography'; import DiamondOutlinedIcon from '@mui/icons-material/DiamondOutlined'; -import { useTranslate } from 'docs/src/modules/utils/i18n'; +import { useTranslate } from '@mui/docs/i18n'; import Link from 'docs/src/modules/components/Link'; const StyledAnchor = styled('a')(({ theme }) => ({ diff --git a/docs/src/modules/components/EditPage.js b/docs/src/modules/components/EditPage.js index 76cb9ef8a16669..d8b16b3067ee3b 100644 --- a/docs/src/modules/components/EditPage.js +++ b/docs/src/modules/components/EditPage.js @@ -2,7 +2,7 @@ import * as React from 'react'; import PropTypes from 'prop-types'; import Button from '@mui/material/Button'; import GitHubIcon from '@mui/icons-material/GitHub'; -import { useUserLanguage, useTranslate } from 'docs/src/modules/utils/i18n'; +import { useUserLanguage, useTranslate } from '@mui/docs/i18n'; const LOCALES = { zh: 'zh-CN', pt: 'pt-BR', es: 'es-ES' }; diff --git a/docs/src/modules/components/GoogleAnalytics.js b/docs/src/modules/components/GoogleAnalytics.js index 0931581890bab3..e9771d3989c85d 100644 --- a/docs/src/modules/components/GoogleAnalytics.js +++ b/docs/src/modules/components/GoogleAnalytics.js @@ -4,7 +4,7 @@ import useMediaQuery from '@mui/material/useMediaQuery'; import { useRouter } from 'next/router'; import { useNoSsrCodeVariant } from 'docs/src/modules/utils/codeVariant'; import { useNoSsrCodeStyling } from 'docs/src/modules/utils/codeStylingSolution'; -import { useUserLanguage } from 'docs/src/modules/utils/i18n'; +import { useUserLanguage } from '@mui/docs/i18n'; import { pathnameToLanguage } from 'docs/src/modules/utils/helpers'; import { getApiPageLayout } from 'docs/src/modules/components/ApiPage/sections/ToggleDisplayOption'; diff --git a/docs/src/modules/components/Head.tsx b/docs/src/modules/components/Head.tsx index c203562c298e73..7366a2ce2fd8ff 100644 --- a/docs/src/modules/components/Head.tsx +++ b/docs/src/modules/components/Head.tsx @@ -2,7 +2,7 @@ import * as React from 'react'; import NextHead from 'next/head'; import { useRouter } from 'next/router'; import { LANGUAGES_SSR } from 'docs/config'; -import { useUserLanguage, useTranslate } from 'docs/src/modules/utils/i18n'; +import { useUserLanguage, useTranslate } from '@mui/docs/i18n'; import { pathnameToLanguage } from 'docs/src/modules/utils/helpers'; // #major-version-switch diff --git a/docs/src/modules/components/HooksApiContent.js b/docs/src/modules/components/HooksApiContent.js index 105364787953ee..804572f9fcf079 100644 --- a/docs/src/modules/components/HooksApiContent.js +++ b/docs/src/modules/components/HooksApiContent.js @@ -3,7 +3,7 @@ import * as React from 'react'; import PropTypes from 'prop-types'; import kebabCase from 'lodash/kebabCase'; import { exactProp } from '@mui/utils'; -import { useTranslate, useUserLanguage } from 'docs/src/modules/utils/i18n'; +import { useTranslate, useUserLanguage } from '@mui/docs/i18n'; import PropertiesSection from 'docs/src/modules/components/ApiPage/sections/PropertiesSection'; import HighlightedCode from 'docs/src/modules/components/HighlightedCode'; import MarkdownElement from 'docs/src/modules/components/MarkdownElement'; diff --git a/docs/src/modules/components/Link.tsx b/docs/src/modules/components/Link.tsx index e2784218dbe619..f708ab91ea4da3 100644 --- a/docs/src/modules/components/Link.tsx +++ b/docs/src/modules/components/Link.tsx @@ -4,7 +4,7 @@ import { useRouter } from 'next/router'; import NextLink, { LinkProps as NextLinkProps } from 'next/link'; import MuiLink, { LinkProps as MuiLinkProps } from '@mui/material/Link'; import { styled } from '@mui/material/styles'; -import { useUserLanguage } from 'docs/src/modules/utils/i18n'; +import { useUserLanguage } from '@mui/docs/i18n'; import { LANGUAGES_IGNORE_PAGES } from 'docs/config'; /** diff --git a/docs/src/modules/components/MarkdownDocs.js b/docs/src/modules/components/MarkdownDocs.js index 285f5634485137..68fce71531bd04 100644 --- a/docs/src/modules/components/MarkdownDocs.js +++ b/docs/src/modules/components/MarkdownDocs.js @@ -7,7 +7,7 @@ import { CssVarsProvider as JoyCssVarsProvider, useColorScheme } from '@mui/joy/ import RichMarkdownElement from 'docs/src/modules/components/RichMarkdownElement'; import { pathnameToLanguage } from 'docs/src/modules/utils/helpers'; import AppLayoutDocs from 'docs/src/modules/components/AppLayoutDocs'; -import { useUserLanguage } from 'docs/src/modules/utils/i18n'; +import { useUserLanguage } from '@mui/docs/i18n'; import BrandingProvider from 'docs/src/BrandingProvider'; import Ad from 'docs/src/modules/components/Ad'; import AdGuest from 'docs/src/modules/components/AdGuest'; diff --git a/docs/src/modules/components/MarkdownDocsV2.js b/docs/src/modules/components/MarkdownDocsV2.js index 87a62168ed41db..59be4f176c2d91 100644 --- a/docs/src/modules/components/MarkdownDocsV2.js +++ b/docs/src/modules/components/MarkdownDocsV2.js @@ -11,7 +11,7 @@ import { getTranslatedHeader as getComponentTranslatedHeader } from 'docs/src/mo import RichMarkdownElement from 'docs/src/modules/components/RichMarkdownElement'; import { pathnameToLanguage } from 'docs/src/modules/utils/helpers'; import AppLayoutDocs from 'docs/src/modules/components/AppLayoutDocs'; -import { useTranslate, useUserLanguage } from 'docs/src/modules/utils/i18n'; +import { useTranslate, useUserLanguage } from '@mui/docs/i18n'; import BrandingProvider from 'docs/src/BrandingProvider'; import Ad from 'docs/src/modules/components/Ad'; import { HEIGHT as AppFrameHeight } from 'docs/src/modules/components/AppFrame'; diff --git a/docs/src/modules/components/MaterialFreeTemplatesCollection.js b/docs/src/modules/components/MaterialFreeTemplatesCollection.js index 05c068fc5a63c0..4c86420825e2d9 100644 --- a/docs/src/modules/components/MaterialFreeTemplatesCollection.js +++ b/docs/src/modules/components/MaterialFreeTemplatesCollection.js @@ -11,7 +11,7 @@ import Typography from '@mui/material/Typography'; import Link from '@mui/material/Link'; import Visibility from '@mui/icons-material/Visibility'; import CodeRoundedIcon from '@mui/icons-material/CodeRounded'; -import { useTranslate } from 'docs/src/modules/utils/i18n'; +import { useTranslate } from '@mui/docs/i18n'; const sourcePrefix = `${process.env.SOURCE_CODE_REPO}/tree/v${process.env.LIB_VERSION}`; diff --git a/docs/src/modules/components/MaterialShowcase.js b/docs/src/modules/components/MaterialShowcase.js index 254c9e0935aa32..8f0e6ceadbb372 100644 --- a/docs/src/modules/components/MaterialShowcase.js +++ b/docs/src/modules/components/MaterialShowcase.js @@ -10,7 +10,7 @@ import IconButton from '@mui/material/IconButton'; import GitHubIcon from '@mui/icons-material/GitHub'; import { alpha } from '@mui/material/styles'; import Link from 'docs/src/modules/components/Link'; -import { useTranslate } from 'docs/src/modules/utils/i18n'; +import { useTranslate } from '@mui/docs/i18n'; /** * The app structure: diff --git a/docs/src/modules/components/Notifications.js b/docs/src/modules/components/Notifications.js index 2ffa1a3e7cb79a..6fc4cb9857a4eb 100644 --- a/docs/src/modules/components/Notifications.js +++ b/docs/src/modules/components/Notifications.js @@ -14,7 +14,7 @@ import MuiList from '@mui/material/List'; import MuiListItem from '@mui/material/ListItem'; import MuiDivider from '@mui/material/Divider'; import { getCookie } from 'docs/src/modules/utils/helpers'; -import { useUserLanguage, useTranslate } from 'docs/src/modules/utils/i18n'; +import { useUserLanguage, useTranslate } from '@mui/docs/i18n'; async function fetchNotifications() { if (process.env.NODE_ENV === 'development') { diff --git a/docs/src/modules/components/RichMarkdownElement.js b/docs/src/modules/components/RichMarkdownElement.js index d13a19e384e943..449b1df5adb6a9 100644 --- a/docs/src/modules/components/RichMarkdownElement.js +++ b/docs/src/modules/components/RichMarkdownElement.js @@ -1,6 +1,6 @@ import * as React from 'react'; import PropTypes from 'prop-types'; -import { useTranslate, useUserLanguage } from 'docs/src/modules/utils/i18n'; +import { useTranslate, useUserLanguage } from '@mui/docs/i18n'; import MarkdownElement from 'docs/src/modules/components/MarkdownElement'; import HighlightedCodeWithTabs from 'docs/src/modules/components/HighlightedCodeWithTabs'; import Demo from 'docs/src/modules/components/Demo'; diff --git a/docs/src/modules/components/SkipLink.tsx b/docs/src/modules/components/SkipLink.tsx index cafdd56f84409d..9e9f8536758b5d 100644 --- a/docs/src/modules/components/SkipLink.tsx +++ b/docs/src/modules/components/SkipLink.tsx @@ -1,7 +1,7 @@ import * as React from 'react'; import MuiLink from '@mui/material/Link'; import { styled } from '@mui/material/styles'; -import { useTranslate } from 'docs/src/modules/utils/i18n'; +import { useTranslate } from '@mui/docs/i18n'; const StyledLink = styled(MuiLink)(({ theme }) => ({ position: 'fixed', diff --git a/docs/src/modules/components/ThemeContext.js b/docs/src/modules/components/ThemeContext.js index a30fdcc08d7702..50fe41c5a7adf5 100644 --- a/docs/src/modules/components/ThemeContext.js +++ b/docs/src/modules/components/ThemeContext.js @@ -10,7 +10,7 @@ import { enUS, zhCN, ptBR } from '@mui/material/locale'; import { unstable_useEnhancedEffect as useEnhancedEffect } from '@mui/material/utils'; import { getCookie } from 'docs/src/modules/utils/helpers'; import useLazyCSS from 'docs/src/modules/utils/useLazyCSS'; -import { useUserLanguage } from 'docs/src/modules/utils/i18n'; +import { useUserLanguage } from '@mui/docs/i18n'; import { getDesignTokens, getThemedComponents, diff --git a/docs/src/modules/utils/i18n.js b/docs/src/modules/utils/i18n.js index 7f26e577b36c60..999d05d9db143e 100644 --- a/docs/src/modules/utils/i18n.js +++ b/docs/src/modules/utils/i18n.js @@ -1,93 +1,3 @@ -import * as React from 'react'; -import PropTypes from 'prop-types'; - -function mapTranslations(req) { - const translations = {}; - req.keys().forEach((filename) => { - const match = filename.match(/-([a-z]{2}).json$/); - - if (match) { - translations[match[1]] = req(filename); - } else { - translations.en = req(filename); - } - }); - return translations; -} - -const req = require.context('docs/translations', false, /translations.*\.json$/); -const translations = mapTranslations(req); - -function getPath(obj, path) { - if (!path || typeof path !== 'string') { - return null; - } - - return path.split('.').reduce((acc, item) => (acc && acc[item] ? acc[item] : null), obj); -} - -const UserLanguageContext = React.createContext({ userLanguage: '', setUserLanguage: () => {} }); -if (process.env.NODE_ENV !== 'production') { - UserLanguageContext.displayName = 'UserLanguage'; -} - -export function UserLanguageProvider(props) { - const { children, defaultUserLanguage } = props; - - const [userLanguage, setUserLanguage] = React.useState(defaultUserLanguage); - - const contextValue = React.useMemo(() => { - return { userLanguage, setUserLanguage }; - }, [userLanguage]); - - return ( - {children} - ); -} - -UserLanguageProvider.propTypes = { - children: PropTypes.node.isRequired, - defaultUserLanguage: PropTypes.string, -}; - -export function useUserLanguage() { - return React.useContext(UserLanguageContext).userLanguage; -} - -export function useSetUserLanguage() { - return React.useContext(UserLanguageContext).setUserLanguage; -} - -const warnedOnce = {}; - -export function useTranslate() { - const userLanguage = useUserLanguage(); - - return React.useMemo( - () => - function translate(key, options = {}) { - const { ignoreWarning = false } = options; - const wordings = translations[userLanguage]; - - if (!wordings) { - console.error(`Missing language: ${userLanguage}.`); - return '…'; - } - - const translation = getPath(wordings, key); - - if (!translation) { - const fullKey = `${userLanguage}:${key}`; - // No warnings in CI env - if (!ignoreWarning && !warnedOnce[fullKey] && typeof window !== 'undefined') { - console.error(`Missing translation for ${fullKey}`); - warnedOnce[fullKey] = true; - } - return getPath(translations.en, key); - } - - return translation; - }, - [userLanguage], - ); -} +// Backwards compatibility for Toolpad X. +// TODO: remove when X/Toolpad migrated to `@mui/docs/i18n` +export * from '@mui/docs'; diff --git a/packages/mui-docs/src/i18n/index.js b/packages/mui-docs/src/i18n/index.js new file mode 100644 index 00000000000000..7f26e577b36c60 --- /dev/null +++ b/packages/mui-docs/src/i18n/index.js @@ -0,0 +1,93 @@ +import * as React from 'react'; +import PropTypes from 'prop-types'; + +function mapTranslations(req) { + const translations = {}; + req.keys().forEach((filename) => { + const match = filename.match(/-([a-z]{2}).json$/); + + if (match) { + translations[match[1]] = req(filename); + } else { + translations.en = req(filename); + } + }); + return translations; +} + +const req = require.context('docs/translations', false, /translations.*\.json$/); +const translations = mapTranslations(req); + +function getPath(obj, path) { + if (!path || typeof path !== 'string') { + return null; + } + + return path.split('.').reduce((acc, item) => (acc && acc[item] ? acc[item] : null), obj); +} + +const UserLanguageContext = React.createContext({ userLanguage: '', setUserLanguage: () => {} }); +if (process.env.NODE_ENV !== 'production') { + UserLanguageContext.displayName = 'UserLanguage'; +} + +export function UserLanguageProvider(props) { + const { children, defaultUserLanguage } = props; + + const [userLanguage, setUserLanguage] = React.useState(defaultUserLanguage); + + const contextValue = React.useMemo(() => { + return { userLanguage, setUserLanguage }; + }, [userLanguage]); + + return ( + {children} + ); +} + +UserLanguageProvider.propTypes = { + children: PropTypes.node.isRequired, + defaultUserLanguage: PropTypes.string, +}; + +export function useUserLanguage() { + return React.useContext(UserLanguageContext).userLanguage; +} + +export function useSetUserLanguage() { + return React.useContext(UserLanguageContext).setUserLanguage; +} + +const warnedOnce = {}; + +export function useTranslate() { + const userLanguage = useUserLanguage(); + + return React.useMemo( + () => + function translate(key, options = {}) { + const { ignoreWarning = false } = options; + const wordings = translations[userLanguage]; + + if (!wordings) { + console.error(`Missing language: ${userLanguage}.`); + return '…'; + } + + const translation = getPath(wordings, key); + + if (!translation) { + const fullKey = `${userLanguage}:${key}`; + // No warnings in CI env + if (!ignoreWarning && !warnedOnce[fullKey] && typeof window !== 'undefined') { + console.error(`Missing translation for ${fullKey}`); + warnedOnce[fullKey] = true; + } + return getPath(translations.en, key); + } + + return translation; + }, + [userLanguage], + ); +} From 6d5d934552cbf0e250659eab2a4ece077a1f62b1 Mon Sep 17 00:00:00 2001 From: MUI bot <2109932+Janpot@users.noreply.github.com> Date: Tue, 30 Jan 2024 17:41:56 +0100 Subject: [PATCH 02/21] i18n --- packages/mui-docs/package.json | 4 +- .../mui-docs/src/i18n/{index.js => index.tsx} | 42 +++++++++++++++---- packages/mui-docs/tsconfig.build.json | 16 +++++++ packages/mui-docs/tsconfig.json | 4 ++ pnpm-lock.yaml | 3 ++ 5 files changed, 60 insertions(+), 9 deletions(-) rename packages/mui-docs/src/i18n/{index.js => index.tsx} (68%) create mode 100644 packages/mui-docs/tsconfig.build.json create mode 100644 packages/mui-docs/tsconfig.json diff --git a/packages/mui-docs/package.json b/packages/mui-docs/package.json index db0678f55ee6f5..3bb6140aee4225 100644 --- a/packages/mui-docs/package.json +++ b/packages/mui-docs/package.json @@ -23,11 +23,12 @@ }, "homepage": "https://github.com/mui/material-ui/tree/master/packages/mui-docs", "scripts": { - "build": "pnpm build:legacy && pnpm build:modern && pnpm build:node && pnpm build:stable && pnpm build:copy-files", + "build": "pnpm build:legacy && pnpm build:modern && pnpm build:node && pnpm build:stable && pnpm build:types && pnpm build:copy-files", "build:legacy": "node ../../scripts/build.mjs legacy", "build:modern": "echo 'Skip modern build'", "build:node": "node ../../scripts/build.mjs node", "build:stable": "node ../../scripts/build.mjs stable", + "build:types": "node ../../scripts/buildTypes.mjs", "build:copy-files": "node ../../scripts/copyFiles.mjs", "prebuild": "rimraf build", "release": "pnpm build && pnpm publish", @@ -41,6 +42,7 @@ "prop-types": "^15.8.1" }, "devDependencies": { + "@types/prop-types": "^15.7.11", "@types/react": "^18.2.48", "react": "^18.2.0" }, diff --git a/packages/mui-docs/src/i18n/index.js b/packages/mui-docs/src/i18n/index.tsx similarity index 68% rename from packages/mui-docs/src/i18n/index.js rename to packages/mui-docs/src/i18n/index.tsx index 7f26e577b36c60..2d75806f478230 100644 --- a/packages/mui-docs/src/i18n/index.js +++ b/packages/mui-docs/src/i18n/index.tsx @@ -1,8 +1,13 @@ import * as React from 'react'; import PropTypes from 'prop-types'; -function mapTranslations(req) { - const translations = {}; +interface RequireContext { + (req: string): string; + keys: () => string[]; +} + +function mapTranslations(req: RequireContext) { + const translations: Record = {}; req.keys().forEach((filename) => { const match = filename.match(/-([a-z]{2}).json$/); @@ -15,10 +20,14 @@ function mapTranslations(req) { return translations; } -const req = require.context('docs/translations', false, /translations.*\.json$/); +const req: RequireContext = (require as any).context( + 'docs/translations', + false, + /translations.*\.json$/, +); const translations = mapTranslations(req); -function getPath(obj, path) { +function getPath(obj: any, path: string): any { if (!path || typeof path !== 'string') { return null; } @@ -26,12 +35,25 @@ function getPath(obj, path) { return path.split('.').reduce((acc, item) => (acc && acc[item] ? acc[item] : null), obj); } -const UserLanguageContext = React.createContext({ userLanguage: '', setUserLanguage: () => {} }); +interface UserLanguageContextValue { + userLanguage: string; + setUserLanguage: React.Dispatch>; +} + +const UserLanguageContext = React.createContext({ + userLanguage: '', + setUserLanguage: () => {}, +}); if (process.env.NODE_ENV !== 'production') { UserLanguageContext.displayName = 'UserLanguage'; } -export function UserLanguageProvider(props) { +export interface UserLanguageProviderProps { + children: React.ReactNode; + defaultUserLanguage: string; +} + +export function UserLanguageProvider(props: UserLanguageProviderProps) { const { children, defaultUserLanguage } = props; const [userLanguage, setUserLanguage] = React.useState(defaultUserLanguage); @@ -58,14 +80,18 @@ export function useSetUserLanguage() { return React.useContext(UserLanguageContext).setUserLanguage; } -const warnedOnce = {}; +const warnedOnce: Record = {}; + +export interface TranslateOptions { + ignoreWarning?: boolean; +} export function useTranslate() { const userLanguage = useUserLanguage(); return React.useMemo( () => - function translate(key, options = {}) { + function translate(key: string, options: TranslateOptions = {}) { const { ignoreWarning = false } = options; const wordings = translations[userLanguage]; diff --git a/packages/mui-docs/tsconfig.build.json b/packages/mui-docs/tsconfig.build.json new file mode 100644 index 00000000000000..7696cbeba02fc7 --- /dev/null +++ b/packages/mui-docs/tsconfig.build.json @@ -0,0 +1,16 @@ +{ + // This config is for emitting declarations (.d.ts) only + // Actual .ts source files are transpiled via babel + "extends": "./tsconfig.json", + "compilerOptions": { + "composite": true, + "declaration": true, + "noEmit": false, + "emitDeclarationOnly": true, + "outDir": "build", + "rootDir": "./src" + }, + "include": ["src/**/*.ts*"], + "exclude": ["src/**/*.spec.ts*", "src/**/*.test.ts*"], + "references": [{ "path": "../mui-utils/tsconfig.build.json" }] +} diff --git a/packages/mui-docs/tsconfig.json b/packages/mui-docs/tsconfig.json new file mode 100644 index 00000000000000..ee756997748e1c --- /dev/null +++ b/packages/mui-docs/tsconfig.json @@ -0,0 +1,4 @@ +{ + "extends": "../../tsconfig.json", + "include": ["src/**/*", "test/**/*"] +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index aa78bcd5868b9b..95a72ddd38c885 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1249,6 +1249,9 @@ importers: specifier: ^15.8.1 version: 15.8.1 devDependencies: + '@types/prop-types': + specifier: ^15.7.11 + version: 15.7.11 '@types/react': specifier: ^18.2.48 version: 18.2.48 From 392f49fbf4510c5d32c17923cdaf1f2ed4c1896b Mon Sep 17 00:00:00 2001 From: MUI bot <2109932+Janpot@users.noreply.github.com> Date: Tue, 30 Jan 2024 18:26:17 +0100 Subject: [PATCH 03/21] retret --- packages/mui-docs/package.json | 1 + packages/mui-docs/src/i18n/index.tsx | 12 +++++++----- packages/mui-docs/src/index.d.ts | 0 packages/mui-docs/src/index.js | 4 ---- packages/mui-docs/tsconfig.build.json | 3 +-- packages/mui-docs/tsconfig.json | 3 +++ pnpm-lock.yaml | 3 +++ 7 files changed, 15 insertions(+), 11 deletions(-) delete mode 100644 packages/mui-docs/src/index.d.ts delete mode 100644 packages/mui-docs/src/index.js diff --git a/packages/mui-docs/package.json b/packages/mui-docs/package.json index 3bb6140aee4225..622b9641b3d8df 100644 --- a/packages/mui-docs/package.json +++ b/packages/mui-docs/package.json @@ -42,6 +42,7 @@ "prop-types": "^15.8.1" }, "devDependencies": { + "@types/node": "^18.19.10", "@types/prop-types": "^15.7.11", "@types/react": "^18.2.48", "react": "^18.2.0" diff --git a/packages/mui-docs/src/i18n/index.tsx b/packages/mui-docs/src/i18n/index.tsx index 2d75806f478230..037680d8e3ed01 100644 --- a/packages/mui-docs/src/i18n/index.tsx +++ b/packages/mui-docs/src/i18n/index.tsx @@ -1,6 +1,12 @@ import * as React from 'react'; import PropTypes from 'prop-types'; +declare global { + interface NodeRequire { + context: (path: string, useSubdirectories: boolean, regex: RegExp) => RequireContext; + } +} + interface RequireContext { (req: string): string; keys: () => string[]; @@ -20,11 +26,7 @@ function mapTranslations(req: RequireContext) { return translations; } -const req: RequireContext = (require as any).context( - 'docs/translations', - false, - /translations.*\.json$/, -); +const req: RequireContext = require.context('docs/translations', false, /translations.*\.json$/); const translations = mapTranslations(req); function getPath(obj: any, path: string): any { diff --git a/packages/mui-docs/src/index.d.ts b/packages/mui-docs/src/index.d.ts deleted file mode 100644 index e69de29bb2d1d6..00000000000000 diff --git a/packages/mui-docs/src/index.js b/packages/mui-docs/src/index.js deleted file mode 100644 index 8ae6d57e29c695..00000000000000 --- a/packages/mui-docs/src/index.js +++ /dev/null @@ -1,4 +0,0 @@ -export { default as FileDownload } from './svgIcons/FileDownload'; -export { default as JavaScript } from './svgIcons/JavaScript'; -export { default as NProgressBar } from './NProgressBar'; -export { default as TypeScript } from './svgIcons/TypeScript'; diff --git a/packages/mui-docs/tsconfig.build.json b/packages/mui-docs/tsconfig.build.json index 7696cbeba02fc7..bc9de8db7f41fd 100644 --- a/packages/mui-docs/tsconfig.build.json +++ b/packages/mui-docs/tsconfig.build.json @@ -11,6 +11,5 @@ "rootDir": "./src" }, "include": ["src/**/*.ts*"], - "exclude": ["src/**/*.spec.ts*", "src/**/*.test.ts*"], - "references": [{ "path": "../mui-utils/tsconfig.build.json" }] + "exclude": ["src/**/*.spec.ts*", "src/**/*.test.ts*"] } diff --git a/packages/mui-docs/tsconfig.json b/packages/mui-docs/tsconfig.json index ee756997748e1c..3f6f21cc2bf678 100644 --- a/packages/mui-docs/tsconfig.json +++ b/packages/mui-docs/tsconfig.json @@ -1,4 +1,7 @@ { "extends": "../../tsconfig.json", + "compilerOptions": { + "types": ["react", "node"] + }, "include": ["src/**/*", "test/**/*"] } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 95a72ddd38c885..74f330de56f3eb 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1249,6 +1249,9 @@ importers: specifier: ^15.8.1 version: 15.8.1 devDependencies: + '@types/node': + specifier: ^18.19.10 + version: 18.19.10 '@types/prop-types': specifier: ^15.7.11 version: 15.7.11 From 6169bc8b773c691600e2b3c6800a5ccabc79daa1 Mon Sep 17 00:00:00 2001 From: MUI bot <2109932+Janpot@users.noreply.github.com> Date: Tue, 30 Jan 2024 18:34:35 +0100 Subject: [PATCH 04/21] Update JoyThemeBuilder.tsx --- docs/src/modules/components/JoyThemeBuilder.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/src/modules/components/JoyThemeBuilder.tsx b/docs/src/modules/components/JoyThemeBuilder.tsx index 51da85ac1ac359..e668edbed5979e 100644 --- a/docs/src/modules/components/JoyThemeBuilder.tsx +++ b/docs/src/modules/components/JoyThemeBuilder.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; -// @ts-ignore -import { TypeScript as TypeScriptIcon } from '@mui/docs'; +import TypeScriptIcon from '@mui/docs/svgIcons/TypeScript'; import startCase from 'lodash/startCase'; import { deepmerge } from '@mui/utils'; import { decomposeColor } from '@mui/system'; From c4103ed033aea01787b6b1fd371a88dab7a65d39 Mon Sep 17 00:00:00 2001 From: MUI bot <2109932+Janpot@users.noreply.github.com> Date: Tue, 30 Jan 2024 18:43:17 +0100 Subject: [PATCH 05/21] Update i18n.js --- docs/src/modules/utils/i18n.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/modules/utils/i18n.js b/docs/src/modules/utils/i18n.js index 999d05d9db143e..9dc5f483b70371 100644 --- a/docs/src/modules/utils/i18n.js +++ b/docs/src/modules/utils/i18n.js @@ -1,3 +1,3 @@ // Backwards compatibility for Toolpad X. // TODO: remove when X/Toolpad migrated to `@mui/docs/i18n` -export * from '@mui/docs'; +export * from '@mui/docs/i18n'; From e5833b01d10f666653e927398010a99347947df6 Mon Sep 17 00:00:00 2001 From: MUI bot <2109932+Janpot@users.noreply.github.com> Date: Thu, 1 Feb 2024 14:47:06 +0100 Subject: [PATCH 06/21] Docs config --- docs/config.d.ts | 8 +---- docs/config.js | 30 +------------------ docs/src/modules/components/AppSearch.js | 2 +- docs/src/modules/components/Head.tsx | 2 +- docs/src/modules/utils/helpers.ts | 2 +- .../baseUi/projectSettings.ts | 2 +- .../joyUi/projectSettings.ts | 2 +- .../materialUi/projectSettings.ts | 2 +- .../muiSystem/projectSettings.ts | 2 +- packages/api-docs-builder-core/package.json | 1 + packages/mui-docs/src/config/index.d.ts | 7 +++++ packages/mui-docs/src/config/index.js | 29 ++++++++++++++++++ pnpm-lock.yaml | 3 ++ 13 files changed, 49 insertions(+), 43 deletions(-) create mode 100644 packages/mui-docs/src/config/index.d.ts create mode 100644 packages/mui-docs/src/config/index.js diff --git a/docs/config.d.ts b/docs/config.d.ts index 605606f1179e10..84c6e6a0ccb163 100644 --- a/docs/config.d.ts +++ b/docs/config.d.ts @@ -1,7 +1 @@ -export const LANGUAGES: string[]; - -export const LANGUAGES_SSR: string[]; - -export const LANGUAGES_IN_PROGRESS: string[]; - -export const LANGUAGES_IGNORE_PAGES: (pathname: string) => boolean; +export * from '@mui/docs/config'; diff --git a/docs/config.js b/docs/config.js index 3dfdb2d1a01e72..4c56bb4807cfa0 100644 --- a/docs/config.js +++ b/docs/config.js @@ -1,29 +1 @@ -// Valid languages to server-side render in production -const LANGUAGES = ['en']; - -// Server side rendered languages -const LANGUAGES_SSR = ['en']; - -// Work in progress -const LANGUAGES_IN_PROGRESS = LANGUAGES.slice(); - -const LANGUAGES_IGNORE_PAGES = (pathname) => { - // We don't have the bandwidth like Qt to translate our blog posts - // https://www.qt.io/zh-cn/blog - if (pathname === '/blog' || pathname.startsWith('/blog/')) { - return true; - } - - if (pathname === '/size-snapshot/') { - return true; - } - - return false; -}; - -module.exports = { - LANGUAGES, - LANGUAGES_IN_PROGRESS, - LANGUAGES_SSR, - LANGUAGES_IGNORE_PAGES, -}; +module.exports = require('@mui/docs/config'); diff --git a/docs/src/modules/components/AppSearch.js b/docs/src/modules/components/AppSearch.js index f6da0f050af680..0bd93acc59e02c 100644 --- a/docs/src/modules/components/AppSearch.js +++ b/docs/src/modules/components/AppSearch.js @@ -22,7 +22,7 @@ import NewspaperRoundedIcon from '@mui/icons-material/NewspaperRounded'; import GlobalStyles from '@mui/material/GlobalStyles'; import { alpha, styled } from '@mui/material/styles'; import { pathnameToLanguage } from 'docs/src/modules/utils/helpers'; -import { LANGUAGES_SSR } from 'docs/config'; +import { LANGUAGES_SSR } from '@mui/docs/config'; import Link from 'docs/src/modules/components/Link'; import { useTranslate, useUserLanguage } from '@mui/docs/i18n'; import useLazyCSS from 'docs/src/modules/utils/useLazyCSS'; diff --git a/docs/src/modules/components/Head.tsx b/docs/src/modules/components/Head.tsx index 7366a2ce2fd8ff..914b692039feae 100644 --- a/docs/src/modules/components/Head.tsx +++ b/docs/src/modules/components/Head.tsx @@ -1,7 +1,7 @@ import * as React from 'react'; import NextHead from 'next/head'; import { useRouter } from 'next/router'; -import { LANGUAGES_SSR } from 'docs/config'; +import { LANGUAGES_SSR } from '@mui/docs/config'; import { useUserLanguage, useTranslate } from '@mui/docs/i18n'; import { pathnameToLanguage } from 'docs/src/modules/utils/helpers'; diff --git a/docs/src/modules/utils/helpers.ts b/docs/src/modules/utils/helpers.ts index d15cd5695a0c5c..3e6f1fd7950275 100644 --- a/docs/src/modules/utils/helpers.ts +++ b/docs/src/modules/utils/helpers.ts @@ -1,6 +1,6 @@ import upperFirst from 'lodash/upperFirst'; import camelCase from 'lodash/camelCase'; -import { LANGUAGES } from 'docs/config'; +import { LANGUAGES } from '@mui/docs/config'; function pascalCase(str: string) { return upperFirst(camelCase(str)); diff --git a/packages/api-docs-builder-core/baseUi/projectSettings.ts b/packages/api-docs-builder-core/baseUi/projectSettings.ts index b9b64d42adc3c4..84c78f81928806 100644 --- a/packages/api-docs-builder-core/baseUi/projectSettings.ts +++ b/packages/api-docs-builder-core/baseUi/projectSettings.ts @@ -1,5 +1,5 @@ import path from 'path'; -import { LANGUAGES } from 'docs/config'; +import { LANGUAGES } from '@mui/docs/config'; import { ProjectSettings } from '@mui-internal/api-docs-builder'; import findApiPages from '@mui-internal/api-docs-builder/utils/findApiPages'; import { diff --git a/packages/api-docs-builder-core/joyUi/projectSettings.ts b/packages/api-docs-builder-core/joyUi/projectSettings.ts index 5162b1879cabb5..8415ca5f343176 100644 --- a/packages/api-docs-builder-core/joyUi/projectSettings.ts +++ b/packages/api-docs-builder-core/joyUi/projectSettings.ts @@ -1,5 +1,5 @@ import path from 'path'; -import { LANGUAGES } from 'docs/config'; +import { LANGUAGES } from '@mui/docs/config'; import { ProjectSettings } from '@mui-internal/api-docs-builder'; import findApiPages from '@mui-internal/api-docs-builder/utils/findApiPages'; import { diff --git a/packages/api-docs-builder-core/materialUi/projectSettings.ts b/packages/api-docs-builder-core/materialUi/projectSettings.ts index c3d87f07b44ee7..a7793343bf8e9d 100644 --- a/packages/api-docs-builder-core/materialUi/projectSettings.ts +++ b/packages/api-docs-builder-core/materialUi/projectSettings.ts @@ -1,5 +1,5 @@ import path from 'path'; -import { LANGUAGES } from 'docs/config'; +import { LANGUAGES } from '@mui/docs/config'; import { ProjectSettings } from '@mui-internal/api-docs-builder'; import findApiPages from '@mui-internal/api-docs-builder/utils/findApiPages'; import { diff --git a/packages/api-docs-builder-core/muiSystem/projectSettings.ts b/packages/api-docs-builder-core/muiSystem/projectSettings.ts index e9d8a4d7fa8c18..9cfc8b60627d9d 100644 --- a/packages/api-docs-builder-core/muiSystem/projectSettings.ts +++ b/packages/api-docs-builder-core/muiSystem/projectSettings.ts @@ -1,5 +1,5 @@ import path from 'path'; -import { LANGUAGES } from 'docs/config'; +import { LANGUAGES } from '@mui/docs/config'; import { ProjectSettings } from '@mui-internal/api-docs-builder'; import findApiPages from '@mui-internal/api-docs-builder/utils/findApiPages'; import { diff --git a/packages/api-docs-builder-core/package.json b/packages/api-docs-builder-core/package.json index 10e52caf15cd44..90203508065035 100644 --- a/packages/api-docs-builder-core/package.json +++ b/packages/api-docs-builder-core/package.json @@ -9,6 +9,7 @@ "typescript": "tsc -p tsconfig.json" }, "dependencies": { + "@mui/docs": "workspace:^", "@mui-internal/api-docs-builder": "workspace:^", "@mui/markdown": "workspace:^", "docs": "workspace:^", diff --git a/packages/mui-docs/src/config/index.d.ts b/packages/mui-docs/src/config/index.d.ts new file mode 100644 index 00000000000000..605606f1179e10 --- /dev/null +++ b/packages/mui-docs/src/config/index.d.ts @@ -0,0 +1,7 @@ +export const LANGUAGES: string[]; + +export const LANGUAGES_SSR: string[]; + +export const LANGUAGES_IN_PROGRESS: string[]; + +export const LANGUAGES_IGNORE_PAGES: (pathname: string) => boolean; diff --git a/packages/mui-docs/src/config/index.js b/packages/mui-docs/src/config/index.js new file mode 100644 index 00000000000000..3dfdb2d1a01e72 --- /dev/null +++ b/packages/mui-docs/src/config/index.js @@ -0,0 +1,29 @@ +// Valid languages to server-side render in production +const LANGUAGES = ['en']; + +// Server side rendered languages +const LANGUAGES_SSR = ['en']; + +// Work in progress +const LANGUAGES_IN_PROGRESS = LANGUAGES.slice(); + +const LANGUAGES_IGNORE_PAGES = (pathname) => { + // We don't have the bandwidth like Qt to translate our blog posts + // https://www.qt.io/zh-cn/blog + if (pathname === '/blog' || pathname.startsWith('/blog/')) { + return true; + } + + if (pathname === '/size-snapshot/') { + return true; + } + + return false; +}; + +module.exports = { + LANGUAGES, + LANGUAGES_IN_PROGRESS, + LANGUAGES_SSR, + LANGUAGES_IGNORE_PAGES, +}; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 74f330de56f3eb..949ad73bc1f96f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -993,6 +993,9 @@ importers: '@mui-internal/api-docs-builder': specifier: workspace:^ version: link:../api-docs-builder + '@mui/docs': + specifier: workspace:^ + version: link:../mui-docs/build '@mui/markdown': specifier: workspace:^ version: link:../markdown From 85c87ad5d9af1a082c7b6b6e9c75a1ec9bd52407 Mon Sep 17 00:00:00 2001 From: MUI bot <2109932+Janpot@users.noreply.github.com> Date: Thu, 1 Feb 2024 15:04:20 +0100 Subject: [PATCH 07/21] Revert "Docs config" This reverts commit e5833b01d10f666653e927398010a99347947df6. --- docs/config.d.ts | 8 ++++- docs/config.js | 30 ++++++++++++++++++- docs/src/modules/components/AppSearch.js | 2 +- docs/src/modules/components/Head.tsx | 2 +- docs/src/modules/utils/helpers.ts | 2 +- .../baseUi/projectSettings.ts | 2 +- .../joyUi/projectSettings.ts | 2 +- .../materialUi/projectSettings.ts | 2 +- .../muiSystem/projectSettings.ts | 2 +- packages/api-docs-builder-core/package.json | 1 - packages/mui-docs/src/config/index.d.ts | 7 ----- packages/mui-docs/src/config/index.js | 29 ------------------ pnpm-lock.yaml | 3 -- 13 files changed, 43 insertions(+), 49 deletions(-) delete mode 100644 packages/mui-docs/src/config/index.d.ts delete mode 100644 packages/mui-docs/src/config/index.js diff --git a/docs/config.d.ts b/docs/config.d.ts index 84c6e6a0ccb163..605606f1179e10 100644 --- a/docs/config.d.ts +++ b/docs/config.d.ts @@ -1 +1,7 @@ -export * from '@mui/docs/config'; +export const LANGUAGES: string[]; + +export const LANGUAGES_SSR: string[]; + +export const LANGUAGES_IN_PROGRESS: string[]; + +export const LANGUAGES_IGNORE_PAGES: (pathname: string) => boolean; diff --git a/docs/config.js b/docs/config.js index 4c56bb4807cfa0..3dfdb2d1a01e72 100644 --- a/docs/config.js +++ b/docs/config.js @@ -1 +1,29 @@ -module.exports = require('@mui/docs/config'); +// Valid languages to server-side render in production +const LANGUAGES = ['en']; + +// Server side rendered languages +const LANGUAGES_SSR = ['en']; + +// Work in progress +const LANGUAGES_IN_PROGRESS = LANGUAGES.slice(); + +const LANGUAGES_IGNORE_PAGES = (pathname) => { + // We don't have the bandwidth like Qt to translate our blog posts + // https://www.qt.io/zh-cn/blog + if (pathname === '/blog' || pathname.startsWith('/blog/')) { + return true; + } + + if (pathname === '/size-snapshot/') { + return true; + } + + return false; +}; + +module.exports = { + LANGUAGES, + LANGUAGES_IN_PROGRESS, + LANGUAGES_SSR, + LANGUAGES_IGNORE_PAGES, +}; diff --git a/docs/src/modules/components/AppSearch.js b/docs/src/modules/components/AppSearch.js index 0bd93acc59e02c..f6da0f050af680 100644 --- a/docs/src/modules/components/AppSearch.js +++ b/docs/src/modules/components/AppSearch.js @@ -22,7 +22,7 @@ import NewspaperRoundedIcon from '@mui/icons-material/NewspaperRounded'; import GlobalStyles from '@mui/material/GlobalStyles'; import { alpha, styled } from '@mui/material/styles'; import { pathnameToLanguage } from 'docs/src/modules/utils/helpers'; -import { LANGUAGES_SSR } from '@mui/docs/config'; +import { LANGUAGES_SSR } from 'docs/config'; import Link from 'docs/src/modules/components/Link'; import { useTranslate, useUserLanguage } from '@mui/docs/i18n'; import useLazyCSS from 'docs/src/modules/utils/useLazyCSS'; diff --git a/docs/src/modules/components/Head.tsx b/docs/src/modules/components/Head.tsx index 914b692039feae..7366a2ce2fd8ff 100644 --- a/docs/src/modules/components/Head.tsx +++ b/docs/src/modules/components/Head.tsx @@ -1,7 +1,7 @@ import * as React from 'react'; import NextHead from 'next/head'; import { useRouter } from 'next/router'; -import { LANGUAGES_SSR } from '@mui/docs/config'; +import { LANGUAGES_SSR } from 'docs/config'; import { useUserLanguage, useTranslate } from '@mui/docs/i18n'; import { pathnameToLanguage } from 'docs/src/modules/utils/helpers'; diff --git a/docs/src/modules/utils/helpers.ts b/docs/src/modules/utils/helpers.ts index 3e6f1fd7950275..d15cd5695a0c5c 100644 --- a/docs/src/modules/utils/helpers.ts +++ b/docs/src/modules/utils/helpers.ts @@ -1,6 +1,6 @@ import upperFirst from 'lodash/upperFirst'; import camelCase from 'lodash/camelCase'; -import { LANGUAGES } from '@mui/docs/config'; +import { LANGUAGES } from 'docs/config'; function pascalCase(str: string) { return upperFirst(camelCase(str)); diff --git a/packages/api-docs-builder-core/baseUi/projectSettings.ts b/packages/api-docs-builder-core/baseUi/projectSettings.ts index 84c78f81928806..b9b64d42adc3c4 100644 --- a/packages/api-docs-builder-core/baseUi/projectSettings.ts +++ b/packages/api-docs-builder-core/baseUi/projectSettings.ts @@ -1,5 +1,5 @@ import path from 'path'; -import { LANGUAGES } from '@mui/docs/config'; +import { LANGUAGES } from 'docs/config'; import { ProjectSettings } from '@mui-internal/api-docs-builder'; import findApiPages from '@mui-internal/api-docs-builder/utils/findApiPages'; import { diff --git a/packages/api-docs-builder-core/joyUi/projectSettings.ts b/packages/api-docs-builder-core/joyUi/projectSettings.ts index 8415ca5f343176..5162b1879cabb5 100644 --- a/packages/api-docs-builder-core/joyUi/projectSettings.ts +++ b/packages/api-docs-builder-core/joyUi/projectSettings.ts @@ -1,5 +1,5 @@ import path from 'path'; -import { LANGUAGES } from '@mui/docs/config'; +import { LANGUAGES } from 'docs/config'; import { ProjectSettings } from '@mui-internal/api-docs-builder'; import findApiPages from '@mui-internal/api-docs-builder/utils/findApiPages'; import { diff --git a/packages/api-docs-builder-core/materialUi/projectSettings.ts b/packages/api-docs-builder-core/materialUi/projectSettings.ts index a7793343bf8e9d..c3d87f07b44ee7 100644 --- a/packages/api-docs-builder-core/materialUi/projectSettings.ts +++ b/packages/api-docs-builder-core/materialUi/projectSettings.ts @@ -1,5 +1,5 @@ import path from 'path'; -import { LANGUAGES } from '@mui/docs/config'; +import { LANGUAGES } from 'docs/config'; import { ProjectSettings } from '@mui-internal/api-docs-builder'; import findApiPages from '@mui-internal/api-docs-builder/utils/findApiPages'; import { diff --git a/packages/api-docs-builder-core/muiSystem/projectSettings.ts b/packages/api-docs-builder-core/muiSystem/projectSettings.ts index 9cfc8b60627d9d..e9d8a4d7fa8c18 100644 --- a/packages/api-docs-builder-core/muiSystem/projectSettings.ts +++ b/packages/api-docs-builder-core/muiSystem/projectSettings.ts @@ -1,5 +1,5 @@ import path from 'path'; -import { LANGUAGES } from '@mui/docs/config'; +import { LANGUAGES } from 'docs/config'; import { ProjectSettings } from '@mui-internal/api-docs-builder'; import findApiPages from '@mui-internal/api-docs-builder/utils/findApiPages'; import { diff --git a/packages/api-docs-builder-core/package.json b/packages/api-docs-builder-core/package.json index 90203508065035..10e52caf15cd44 100644 --- a/packages/api-docs-builder-core/package.json +++ b/packages/api-docs-builder-core/package.json @@ -9,7 +9,6 @@ "typescript": "tsc -p tsconfig.json" }, "dependencies": { - "@mui/docs": "workspace:^", "@mui-internal/api-docs-builder": "workspace:^", "@mui/markdown": "workspace:^", "docs": "workspace:^", diff --git a/packages/mui-docs/src/config/index.d.ts b/packages/mui-docs/src/config/index.d.ts deleted file mode 100644 index 605606f1179e10..00000000000000 --- a/packages/mui-docs/src/config/index.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -export const LANGUAGES: string[]; - -export const LANGUAGES_SSR: string[]; - -export const LANGUAGES_IN_PROGRESS: string[]; - -export const LANGUAGES_IGNORE_PAGES: (pathname: string) => boolean; diff --git a/packages/mui-docs/src/config/index.js b/packages/mui-docs/src/config/index.js deleted file mode 100644 index 3dfdb2d1a01e72..00000000000000 --- a/packages/mui-docs/src/config/index.js +++ /dev/null @@ -1,29 +0,0 @@ -// Valid languages to server-side render in production -const LANGUAGES = ['en']; - -// Server side rendered languages -const LANGUAGES_SSR = ['en']; - -// Work in progress -const LANGUAGES_IN_PROGRESS = LANGUAGES.slice(); - -const LANGUAGES_IGNORE_PAGES = (pathname) => { - // We don't have the bandwidth like Qt to translate our blog posts - // https://www.qt.io/zh-cn/blog - if (pathname === '/blog' || pathname.startsWith('/blog/')) { - return true; - } - - if (pathname === '/size-snapshot/') { - return true; - } - - return false; -}; - -module.exports = { - LANGUAGES, - LANGUAGES_IN_PROGRESS, - LANGUAGES_SSR, - LANGUAGES_IGNORE_PAGES, -}; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 949ad73bc1f96f..74f330de56f3eb 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -993,9 +993,6 @@ importers: '@mui-internal/api-docs-builder': specifier: workspace:^ version: link:../api-docs-builder - '@mui/docs': - specifier: workspace:^ - version: link:../mui-docs/build '@mui/markdown': specifier: workspace:^ version: link:../markdown From 5cb43d2ba6704cf4004666e76f8508309d94fb00 Mon Sep 17 00:00:00 2001 From: MUI bot <2109932+Janpot@users.noreply.github.com> Date: Thu, 1 Feb 2024 15:28:14 +0100 Subject: [PATCH 08/21] Move Link to docs --- .../components/material-icons/SearchIcons.js | 2 +- .../MaterialUIComponents.js | 2 +- docs/pages/_app.js | 36 +++-- docs/pages/blog.tsx | 2 +- docs/pages/careers.tsx | 2 +- docs/pages/components.tsx | 2 +- docs/pages/experiments/index.js | 2 +- docs/src/components/about/AboutEnd.tsx | 2 +- docs/src/components/about/HowToSupport.tsx | 2 +- docs/src/components/about/OurValues.tsx | 2 +- docs/src/components/about/Team.tsx | 2 +- .../action/ComponentShowcaseCard.tsx | 2 +- docs/src/components/action/InfoCard.tsx | 2 +- docs/src/components/action/StylingInfo.tsx | 2 +- docs/src/components/banner/AppFrameBanner.tsx | 2 +- .../src/components/banner/AppHeaderBanner.tsx | 2 +- .../banner/TableOfContentsBanner.tsx | 2 +- docs/src/components/header/HeaderNavBar.tsx | 2 +- .../components/header/HeaderNavDropdown.tsx | 2 +- docs/src/components/home/DiamondSponsors.tsx | 2 +- .../src/components/home/GetStartedButtons.tsx | 2 +- docs/src/components/home/GoldSponsors.tsx | 2 +- .../home/MaterialDesignComponents.tsx | 2 +- docs/src/components/home/ProductsSwitcher.tsx | 2 +- docs/src/components/home/SponsorCard.tsx | 2 +- docs/src/components/pricing/EarlyBird.tsx | 2 +- docs/src/components/pricing/PricingList.tsx | 2 +- docs/src/components/pricing/PricingTable.tsx | 2 +- .../pricing/PricingWhatToExpect.tsx | 2 +- .../components/productBaseUI/BaseUIHero.tsx | 2 +- .../productBaseUI/BaseUITestimonial.tsx | 2 +- .../productBaseUI/BaseUIThemesDemo.tsx | 2 +- .../productDesignKit/DesignKitDemo.tsx | 2 +- .../productDesignKit/DesignKitFAQ.tsx | 2 +- .../productDesignKit/DesignKitHero.tsx | 2 +- .../productMaterial/MaterialDesignKits.tsx | 2 +- .../productMaterial/MaterialEnd.tsx | 2 +- .../productMaterial/MaterialHero.tsx | 2 +- .../productMaterial/MaterialTemplates.tsx | 2 +- .../productTemplate/TemplateDemo.tsx | 2 +- .../productTemplate/TemplateHero.tsx | 2 +- .../productX/XComponentsSwitcher.tsx | 2 +- docs/src/components/productX/XDataGrid.tsx | 2 +- docs/src/components/productX/XRoadmap.tsx | 2 +- docs/src/layouts/AppFooter.tsx | 2 +- docs/src/layouts/AppHeader.tsx | 2 +- .../modules/components/AppLayoutDocsFooter.js | 2 +- .../modules/components/AppNavDrawerItem.js | 2 +- docs/src/modules/components/AppSearch.js | 2 +- .../modules/components/AppTableOfContents.js | 2 +- .../modules/components/BaseUIComponents.js | 2 +- .../modules/components/ComponentPageTabs.js | 2 +- .../src/modules/components/DiamondSponsors.js | 2 +- docs/src/modules/components/Link.d.ts | 4 - docs/src/modules/components/Link.tsx | 151 +----------------- .../modules/components/MaterialShowcase.js | 2 +- .../modules/components/MuiProductSelector.tsx | 2 +- docs/src/modules/components/TopLayoutBlog.js | 2 +- .../modules/components/TopLayoutCareers.js | 2 +- docs/src/modules/utils/i18n.js | 5 +- docs/src/pages/versions/LatestVersions.js | 2 +- docs/src/pages/versions/ReleasedVersions.js | 2 +- packages/mui-docs/package.json | 5 + .../src/DocsProvider/DocsProvider.tsx | 29 ++++ packages/mui-docs/src/DocsProvider/index.tsx | 1 + packages/mui-docs/src/Link/Link.tsx | 150 +++++++++++++++++ packages/mui-docs/src/Link/index.ts | 2 + pnpm-lock.yaml | 16 ++ 68 files changed, 288 insertions(+), 227 deletions(-) delete mode 100644 docs/src/modules/components/Link.d.ts create mode 100644 packages/mui-docs/src/DocsProvider/DocsProvider.tsx create mode 100644 packages/mui-docs/src/DocsProvider/index.tsx create mode 100644 packages/mui-docs/src/Link/Link.tsx create mode 100644 packages/mui-docs/src/Link/index.ts diff --git a/docs/data/material/components/material-icons/SearchIcons.js b/docs/data/material/components/material-icons/SearchIcons.js index 56c962b122a8e3..61b7bd6f26dfac 100644 --- a/docs/data/material/components/material-icons/SearchIcons.js +++ b/docs/data/material/components/material-icons/SearchIcons.js @@ -21,7 +21,7 @@ import RadioGroup from '@mui/material/RadioGroup'; import Radio from '@mui/material/Radio'; import SvgIcon from '@mui/material/SvgIcon'; import * as mui from '@mui/icons-material'; -import Link from 'docs/src/modules/components/Link'; +import Link from '@mui/docs/Link'; import { useTranslate } from '@mui/docs/i18n'; import useQueryParameterState from 'docs/src/modules/utils/useQueryParameterState'; // For Debugging diff --git a/docs/data/material/getting-started/supported-components/MaterialUIComponents.js b/docs/data/material/getting-started/supported-components/MaterialUIComponents.js index 3c9465a407ecea..9584c933112cdb 100644 --- a/docs/data/material/getting-started/supported-components/MaterialUIComponents.js +++ b/docs/data/material/getting-started/supported-components/MaterialUIComponents.js @@ -6,7 +6,7 @@ import TableCell from '@mui/material/TableCell'; import TableRow from '@mui/material/TableRow'; import Paper from '@mui/material/Paper'; import Typography from '@mui/material/Typography'; -import Link from 'docs/src/modules/components/Link'; +import Link from '@mui/docs/Link'; const components = [ { diff --git a/docs/pages/_app.js b/docs/pages/_app.js index 359ed3951d6f95..bb917bff28212d 100644 --- a/docs/pages/_app.js +++ b/docs/pages/_app.js @@ -28,8 +28,10 @@ import createEmotionCache from 'docs/src/createEmotionCache'; import findActivePage from 'docs/src/modules/utils/findActivePage'; import { pathnameToLanguage } from 'docs/src/modules/utils/helpers'; import getProductInfoFromUrl from 'docs/src/modules/utils/getProductInfoFromUrl'; +import { DocsProvider } from '@mui/docs/DocsProvider'; import './global.css'; import '../public/static/components-gallery/base-theme.css'; +import config from '../config'; // Remove the license warning from demonstration purposes LicenseInfo.setLicenseKey(process.env.NEXT_PUBLIC_MUI_LICENSE); @@ -294,22 +296,24 @@ function AppWrapper(props) { - - - - - - - - {children} - - - - - - - - + + + + + + + + + {children} + + + + + + + + + ); } diff --git a/docs/pages/blog.tsx b/docs/pages/blog.tsx index 65f3bd3718eb3c..b005334cba059f 100644 --- a/docs/pages/blog.tsx +++ b/docs/pages/blog.tsx @@ -25,7 +25,7 @@ import GradientText from 'docs/src/components/typography/GradientText'; import BrandingCssVarsProvider from 'docs/src/BrandingCssVarsProvider'; import { authors as AUTHORS } from 'docs/src/modules/components/TopLayoutBlog'; import HeroEnd from 'docs/src/components/home/HeroEnd'; -import Link from 'docs/src/modules/components/Link'; +import Link from '@mui/docs/Link'; import generateRssFeed from 'docs/scripts/generateRSSFeed'; import Section from 'docs/src/layouts/Section'; import { getAllBlogPosts, BlogPost } from 'docs/lib/sourcing'; diff --git a/docs/pages/careers.tsx b/docs/pages/careers.tsx index 12f9bc4c124b50..ad7009a1d3ad3a 100644 --- a/docs/pages/careers.tsx +++ b/docs/pages/careers.tsx @@ -14,7 +14,7 @@ import MuiAccordion from '@mui/material/Accordion'; import MuiAccordionSummary from '@mui/material/AccordionSummary'; import MuiAccordionDetail from '@mui/material/AccordionDetails'; import OurValues from 'docs/src/components/about/OurValues'; -import Link from 'docs/src/modules/components/Link'; +import Link from '@mui/docs/Link'; import AppHeader from 'docs/src/layouts/AppHeader'; import AppFooter from 'docs/src/layouts/AppFooter'; import GradientText from 'docs/src/components/typography/GradientText'; diff --git a/docs/pages/components.tsx b/docs/pages/components.tsx index a621cec4f812e4..ee558ff2266302 100644 --- a/docs/pages/components.tsx +++ b/docs/pages/components.tsx @@ -13,7 +13,7 @@ import BrandingCssVarsProvider from 'docs/src/BrandingCssVarsProvider'; import Section from 'docs/src/layouts/Section'; import { pageToTitleI18n } from 'docs/src/modules/utils/helpers'; import { useTranslate } from '@mui/docs/i18n'; -import Link from 'docs/src/modules/components/Link'; +import Link from '@mui/docs/Link'; import type { MuiPage } from 'docs/src/MuiPage'; import materialPages from 'docs/data/material/pages'; diff --git a/docs/pages/experiments/index.js b/docs/pages/experiments/index.js index 26c01c3bb60516..b56f6459e107b1 100644 --- a/docs/pages/experiments/index.js +++ b/docs/pages/experiments/index.js @@ -9,7 +9,7 @@ import Container from '@mui/material/Container'; import Typography from '@mui/material/Typography'; import KeyboardArrowRightRounded from '@mui/icons-material/KeyboardArrowRightRounded'; import GradientText from 'docs/src/components/typography/GradientText'; -import Link from 'docs/src/modules/components/Link'; +import Link from '@mui/docs/Link'; export default function Experiments({ experiments }) { const categories = {}; diff --git a/docs/src/components/about/AboutEnd.tsx b/docs/src/components/about/AboutEnd.tsx index c52ccb6d4a1b0c..e240841cb09376 100644 --- a/docs/src/components/about/AboutEnd.tsx +++ b/docs/src/components/about/AboutEnd.tsx @@ -3,7 +3,7 @@ import Box from '@mui/material/Box'; import Button from '@mui/material/Button'; import Typography from '@mui/material/Typography'; import KeyboardArrowRightRounded from '@mui/icons-material/KeyboardArrowRightRounded'; -import Link from 'docs/src/modules/components/Link'; +import Link from '@mui/docs/Link'; import GradientText from 'docs/src/components/typography/GradientText'; import ROUTES from 'docs/src/route'; import Section from 'docs/src/layouts/Section'; diff --git a/docs/src/components/about/HowToSupport.tsx b/docs/src/components/about/HowToSupport.tsx index cc31544506ec9c..c6df81f7513a8f 100644 --- a/docs/src/components/about/HowToSupport.tsx +++ b/docs/src/components/about/HowToSupport.tsx @@ -9,7 +9,7 @@ import ForumRoundedIcon from '@mui/icons-material/ForumRounded'; import PeopleRoundedIcon from '@mui/icons-material/PeopleRounded'; import LocalAtmRoundedIcon from '@mui/icons-material/LocalAtmRounded'; import GradientText from 'docs/src/components/typography/GradientText'; -import Link from 'docs/src/modules/components/Link'; +import Link from '@mui/docs/Link'; import Section from 'docs/src/layouts/Section'; import SectionHeadline from 'docs/src/components/typography/SectionHeadline'; import { GlowingIconContainer } from 'docs/src/components/action/InfoCard'; diff --git a/docs/src/components/about/OurValues.tsx b/docs/src/components/about/OurValues.tsx index a7615796a3b485..7540b9bdcb6eef 100644 --- a/docs/src/components/about/OurValues.tsx +++ b/docs/src/components/about/OurValues.tsx @@ -5,7 +5,7 @@ import Grid from '@mui/material/Grid'; import Paper from '@mui/material/Paper'; import Typography from '@mui/material/Typography'; import KeyboardArrowRightRounded from '@mui/icons-material/KeyboardArrowRightRounded'; -import Link from 'docs/src/modules/components/Link'; +import Link from '@mui/docs/Link'; import GradientText from 'docs/src/components/typography/GradientText'; import ROUTES from 'docs/src/route'; import Section from 'docs/src/layouts/Section'; diff --git a/docs/src/components/about/Team.tsx b/docs/src/components/about/Team.tsx index 85df0b8643dde7..f0240a2a85d730 100644 --- a/docs/src/components/about/Team.tsx +++ b/docs/src/components/about/Team.tsx @@ -13,7 +13,7 @@ import KeyboardArrowRightRounded from '@mui/icons-material/KeyboardArrowRightRou import XIcon from '@mui/icons-material/X'; import GitHubIcon from '@mui/icons-material/GitHub'; import LinkedInIcon from '@mui/icons-material/LinkedIn'; -import Link from 'docs/src/modules/components/Link'; +import Link from '@mui/docs/Link'; import ROUTES from 'docs/src/route'; import Section from 'docs/src/layouts/Section'; import SectionHeadline from 'docs/src/components/typography/SectionHeadline'; diff --git a/docs/src/components/action/ComponentShowcaseCard.tsx b/docs/src/components/action/ComponentShowcaseCard.tsx index 9c3620011fe1fb..fabf593f785ea5 100644 --- a/docs/src/components/action/ComponentShowcaseCard.tsx +++ b/docs/src/components/action/ComponentShowcaseCard.tsx @@ -5,7 +5,7 @@ import Card from '@mui/material/Card'; import CardMedia from '@mui/material/CardMedia'; import Typography from '@mui/material/Typography'; import Chip from '@mui/material/Chip'; -import Link from 'docs/src/modules/components/Link'; +import Link from '@mui/docs/Link'; interface ComponentShowcaseCardProps { imgLoading?: 'eager'; diff --git a/docs/src/components/action/InfoCard.tsx b/docs/src/components/action/InfoCard.tsx index d40e24a6e71bee..98d0bcaf38fe2e 100644 --- a/docs/src/components/action/InfoCard.tsx +++ b/docs/src/components/action/InfoCard.tsx @@ -3,7 +3,7 @@ import { alpha } from '@mui/material/styles'; import Box from '@mui/material/Box'; import Paper from '@mui/material/Paper'; import Typography from '@mui/material/Typography'; -import Link, { LinkProps } from 'docs/src/modules/components/Link'; +import Link, { LinkProps } from '@mui/docs/Link'; interface GlowingIconContainerProps { icon: React.ReactNode; diff --git a/docs/src/components/action/StylingInfo.tsx b/docs/src/components/action/StylingInfo.tsx index dddc6211e39589..fd0bcd4f316422 100644 --- a/docs/src/components/action/StylingInfo.tsx +++ b/docs/src/components/action/StylingInfo.tsx @@ -5,7 +5,7 @@ import IconButton from '@mui/material/IconButton'; import Typography from '@mui/material/Typography'; import KeyboardArrowUpRounded from '@mui/icons-material/KeyboardArrowUpRounded'; import KeyboardArrowDownRounded from '@mui/icons-material/KeyboardArrowDownRounded'; -import Link from 'docs/src/modules/components/Link'; +import Link from '@mui/docs/Link'; import ROUTES from 'docs/src/route'; export default function StylingInfo({ diff --git a/docs/src/components/banner/AppFrameBanner.tsx b/docs/src/components/banner/AppFrameBanner.tsx index 783b2ef8582bc7..0b4dc53a5c4385 100644 --- a/docs/src/components/banner/AppFrameBanner.tsx +++ b/docs/src/components/banner/AppFrameBanner.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; import { alpha } from '@mui/material/styles'; -import Link from 'docs/src/modules/components/Link'; +import Link from '@mui/docs/Link'; import FEATURE_TOGGLE from 'docs/src/featureToggle'; import PageContext from 'docs/src/modules/components/PageContext'; import { convertProductIdToName } from 'docs/src/modules/components/AppSearch'; diff --git a/docs/src/components/banner/AppHeaderBanner.tsx b/docs/src/components/banner/AppHeaderBanner.tsx index badeab3e283194..9f66432b697671 100644 --- a/docs/src/components/banner/AppHeaderBanner.tsx +++ b/docs/src/components/banner/AppHeaderBanner.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; import Typography from '@mui/material/Typography'; -import Link from 'docs/src/modules/components/Link'; +import Link from '@mui/docs/Link'; import ROUTES from 'docs/src/route'; import FEATURE_TOGGLE from 'docs/src/featureToggle'; diff --git a/docs/src/components/banner/TableOfContentsBanner.tsx b/docs/src/components/banner/TableOfContentsBanner.tsx index f68238559dce87..f9934c093a7ac1 100644 --- a/docs/src/components/banner/TableOfContentsBanner.tsx +++ b/docs/src/components/banner/TableOfContentsBanner.tsx @@ -2,7 +2,7 @@ import * as React from 'react'; import Box from '@mui/material/Box'; import Typography from '@mui/material/Typography'; import { alpha } from '@mui/material/styles'; -import Link from 'docs/src/modules/components/Link'; +import Link from '@mui/docs/Link'; import FEATURE_TOGGLE from 'docs/src/featureToggle'; export default function TableOfContentsBanner() { diff --git a/docs/src/components/header/HeaderNavBar.tsx b/docs/src/components/header/HeaderNavBar.tsx index 8711e66a16f856..053d786994e3b9 100644 --- a/docs/src/components/header/HeaderNavBar.tsx +++ b/docs/src/components/header/HeaderNavBar.tsx @@ -11,7 +11,7 @@ import Fade from '@mui/material/Fade'; import Typography from '@mui/material/Typography'; import IconImage from 'docs/src/components/icon/IconImage'; import ROUTES from 'docs/src/route'; -import Link from 'docs/src/modules/components/Link'; +import Link from '@mui/docs/Link'; import MuiProductSelector from 'docs/src/modules/components/MuiProductSelector'; const Navigation = styled('nav')(({ theme }) => [ diff --git a/docs/src/components/header/HeaderNavDropdown.tsx b/docs/src/components/header/HeaderNavDropdown.tsx index 8474a58c071c95..5003fe41925ddc 100644 --- a/docs/src/components/header/HeaderNavDropdown.tsx +++ b/docs/src/components/header/HeaderNavDropdown.tsx @@ -8,7 +8,7 @@ import IconButton from '@mui/material/IconButton'; import Typography from '@mui/material/Typography'; import KeyboardArrowDownRounded from '@mui/icons-material/KeyboardArrowDownRounded'; import SvgHamburgerMenu from 'docs/src/icons/SvgHamburgerMenu'; -import Link from 'docs/src/modules/components/Link'; +import Link from '@mui/docs/Link'; import ROUTES from 'docs/src/route'; const Anchor = styled('a')<{ component?: React.ElementType; noLinkStyle?: boolean }>( diff --git a/docs/src/components/home/DiamondSponsors.tsx b/docs/src/components/home/DiamondSponsors.tsx index ce2f09299c2cab..479f9fbc5413d2 100644 --- a/docs/src/components/home/DiamondSponsors.tsx +++ b/docs/src/components/home/DiamondSponsors.tsx @@ -5,7 +5,7 @@ import Paper from '@mui/material/Paper'; import IconButton from '@mui/material/IconButton'; import Typography from '@mui/material/Typography'; import AddRounded from '@mui/icons-material/AddRounded'; -import Link from 'docs/src/modules/components/Link'; +import Link from '@mui/docs/Link'; import SponsorCard from 'docs/src/components/home/SponsorCard'; const DIAMONDs = [ diff --git a/docs/src/components/home/GetStartedButtons.tsx b/docs/src/components/home/GetStartedButtons.tsx index e9079cd3dfd550..ae2a37c714cd7a 100644 --- a/docs/src/components/home/GetStartedButtons.tsx +++ b/docs/src/components/home/GetStartedButtons.tsx @@ -5,7 +5,7 @@ import Button from '@mui/material/Button'; import KeyboardArrowRightRounded from '@mui/icons-material/KeyboardArrowRightRounded'; import ContentCopyRounded from '@mui/icons-material/ContentCopyRounded'; import CheckRounded from '@mui/icons-material/CheckRounded'; -import Link from 'docs/src/modules/components/Link'; +import Link from '@mui/docs/Link'; import NpmCopyButton from 'docs/src/components/action/NpmCopyButton'; interface GetStartedButtonsProps extends BoxProps { diff --git a/docs/src/components/home/GoldSponsors.tsx b/docs/src/components/home/GoldSponsors.tsx index 3bd5d52dbb84e2..cdb51c7641fa2a 100644 --- a/docs/src/components/home/GoldSponsors.tsx +++ b/docs/src/components/home/GoldSponsors.tsx @@ -6,7 +6,7 @@ import Typography from '@mui/material/Typography'; import AddRounded from '@mui/icons-material/AddRounded'; import Grid from '@mui/material/Grid'; import SponsorCard from 'docs/src/components/home/SponsorCard'; -import Link from 'docs/src/modules/components/Link'; +import Link from '@mui/docs/Link'; import ROUTES from 'docs/src/route'; const GOLDs = [ diff --git a/docs/src/components/home/MaterialDesignComponents.tsx b/docs/src/components/home/MaterialDesignComponents.tsx index ae4c7310621ab5..f042526bb60ce1 100644 --- a/docs/src/components/home/MaterialDesignComponents.tsx +++ b/docs/src/components/home/MaterialDesignComponents.tsx @@ -33,7 +33,7 @@ import MailRounded from '@mui/icons-material/MailRounded'; import VerifiedUserRounded from '@mui/icons-material/VerifiedUserRounded'; import HelpCenterRounded from '@mui/icons-material/HelpCenterRounded'; import ROUTES from 'docs/src/route'; -import Link from 'docs/src/modules/components/Link'; +import Link from '@mui/docs/Link'; import { getDesignTokens, getThemedComponents } from 'docs/src/modules/brandingTheme'; const Grid = styled('div')(({ theme }) => [ diff --git a/docs/src/components/home/ProductsSwitcher.tsx b/docs/src/components/home/ProductsSwitcher.tsx index a92fcbba30beac..e5a5cac3a86a66 100644 --- a/docs/src/components/home/ProductsSwitcher.tsx +++ b/docs/src/components/home/ProductsSwitcher.tsx @@ -9,7 +9,7 @@ import Stack from '@mui/material/Stack'; import KeyboardArrowRightRounded from '@mui/icons-material/KeyboardArrowRightRounded'; import IconImage from 'docs/src/components/icon/IconImage'; import Highlighter from 'docs/src/components/action/Highlighter'; -import Link from 'docs/src/modules/components/Link'; +import Link from '@mui/docs/Link'; import ROUTES from 'docs/src/route'; const SwipeableViews = dynamic(() => import('react-swipeable-views'), { ssr: false }); diff --git a/docs/src/components/home/SponsorCard.tsx b/docs/src/components/home/SponsorCard.tsx index a3c43dbe5ab9a3..f9edc75007c0d4 100644 --- a/docs/src/components/home/SponsorCard.tsx +++ b/docs/src/components/home/SponsorCard.tsx @@ -4,7 +4,7 @@ import Box from '@mui/material/Box'; import Typography from '@mui/material/Typography'; import Paper from '@mui/material/Paper'; import LaunchRounded from '@mui/icons-material/LaunchRounded'; -import Link from 'docs/src/modules/components/Link'; +import Link from '@mui/docs/Link'; export default function SponsorCard({ item, diff --git a/docs/src/components/pricing/EarlyBird.tsx b/docs/src/components/pricing/EarlyBird.tsx index db70c5fc5e9381..87231c0f3a633a 100644 --- a/docs/src/components/pricing/EarlyBird.tsx +++ b/docs/src/components/pricing/EarlyBird.tsx @@ -5,7 +5,7 @@ import Stack from '@mui/material/Stack'; import Button from '@mui/material/Button'; import KeyboardArrowRightRounded from '@mui/icons-material/KeyboardArrowRightRounded'; import { alpha } from '@mui/material/styles'; -import Link from 'docs/src/modules/components/Link'; +import Link from '@mui/docs/Link'; export default function EarlyBird() { return ( diff --git a/docs/src/components/pricing/PricingList.tsx b/docs/src/components/pricing/PricingList.tsx index 70f6499a5e9a4d..727c825e6a13ef 100644 --- a/docs/src/components/pricing/PricingList.tsx +++ b/docs/src/components/pricing/PricingList.tsx @@ -8,7 +8,7 @@ import Typography from '@mui/material/Typography'; import Tabs from '@mui/material/Tabs'; import Tab from '@mui/material/Tab'; import KeyboardArrowRightRounded from '@mui/icons-material/KeyboardArrowRightRounded'; -import Link from 'docs/src/modules/components/Link'; +import Link from '@mui/docs/Link'; import PricingTable, { PlanName, PlanPrice } from 'docs/src/components/pricing/PricingTable'; import { useLicensingModel } from 'docs/src/components/pricing/LicensingModelContext'; diff --git a/docs/src/components/pricing/PricingTable.tsx b/docs/src/components/pricing/PricingTable.tsx index 780819dc446009..ec0bb6ab0dcce9 100644 --- a/docs/src/components/pricing/PricingTable.tsx +++ b/docs/src/components/pricing/PricingTable.tsx @@ -12,7 +12,7 @@ import { useRouter } from 'next/router'; import KeyboardArrowRightRounded from '@mui/icons-material/KeyboardArrowRightRounded'; import LaunchRounded from '@mui/icons-material/LaunchRounded'; import UnfoldMoreRounded from '@mui/icons-material/UnfoldMoreRounded'; -import Link from 'docs/src/modules/components/Link'; +import Link from '@mui/docs/Link'; import IconImage from 'docs/src/components/icon/IconImage'; import LicensingModelSwitch from 'docs/src/components/pricing/LicensingModelSwitch'; import { useLicensingModel } from 'docs/src/components/pricing/LicensingModelContext'; diff --git a/docs/src/components/pricing/PricingWhatToExpect.tsx b/docs/src/components/pricing/PricingWhatToExpect.tsx index b28441cfa6dc1b..711fd306054548 100644 --- a/docs/src/components/pricing/PricingWhatToExpect.tsx +++ b/docs/src/components/pricing/PricingWhatToExpect.tsx @@ -9,7 +9,7 @@ import ReplayRoundedIcon from '@mui/icons-material/ReplayRounded'; import AcUnitIcon from '@mui/icons-material/AcUnit'; import HelpOutlineOutlinedIcon from '@mui/icons-material/HelpOutlineOutlined'; import Section from 'docs/src/layouts/Section'; -import Link from 'docs/src/modules/components/Link'; +import Link from '@mui/docs/Link'; import GradientText from 'docs/src/components/typography/GradientText'; import SectionHeadline from 'docs/src/components/typography/SectionHeadline'; diff --git a/docs/src/components/productBaseUI/BaseUIHero.tsx b/docs/src/components/productBaseUI/BaseUIHero.tsx index d3764a834cdcb5..acccab0797ba08 100644 --- a/docs/src/components/productBaseUI/BaseUIHero.tsx +++ b/docs/src/components/productBaseUI/BaseUIHero.tsx @@ -7,7 +7,7 @@ import IconImage from 'docs/src/components/icon/IconImage'; import GradientText from 'docs/src/components/typography/GradientText'; import ROUTES from 'docs/src/route'; import GetStartedButtons from 'docs/src/components/home/GetStartedButtons'; -import Link from 'docs/src/modules/components/Link'; +import Link from '@mui/docs/Link'; const BaseUIThemesDemo = dynamic(() => import('./BaseUIThemesDemo'), { ssr: false, diff --git a/docs/src/components/productBaseUI/BaseUITestimonial.tsx b/docs/src/components/productBaseUI/BaseUITestimonial.tsx index 53f24fca570721..ed6b94275354f7 100644 --- a/docs/src/components/productBaseUI/BaseUITestimonial.tsx +++ b/docs/src/components/productBaseUI/BaseUITestimonial.tsx @@ -7,7 +7,7 @@ import Grid from '@mui/material/Unstable_Grid2'; import Divider from '@mui/material/Divider'; import Typography from '@mui/material/Typography'; import ChevronRightRoundedIcon from '@mui/icons-material/ChevronRightRounded'; -import Link from 'docs/src/modules/components/Link'; +import Link from '@mui/docs/Link'; import Section from 'docs/src/layouts/Section'; export default function BaseUITestimonial() { diff --git a/docs/src/components/productBaseUI/BaseUIThemesDemo.tsx b/docs/src/components/productBaseUI/BaseUIThemesDemo.tsx index 1f77a7257171ee..30ba13cf1640e6 100644 --- a/docs/src/components/productBaseUI/BaseUIThemesDemo.tsx +++ b/docs/src/components/productBaseUI/BaseUIThemesDemo.tsx @@ -42,7 +42,7 @@ import InterestsRoundedIcon from '@mui/icons-material/InterestsRounded'; import RadioRoundedIcon from '@mui/icons-material/RadioRounded'; import ROUTES from 'docs/src/route'; -import Link from 'docs/src/modules/components/Link'; +import Link from '@mui/docs/Link'; import heroVariables from 'docs/src/components/productBaseUI/heroVariables'; const Panel = styled('div')({ diff --git a/docs/src/components/productDesignKit/DesignKitDemo.tsx b/docs/src/components/productDesignKit/DesignKitDemo.tsx index 10c95bae3e7f6a..de880a1100e308 100644 --- a/docs/src/components/productDesignKit/DesignKitDemo.tsx +++ b/docs/src/components/productDesignKit/DesignKitDemo.tsx @@ -16,7 +16,7 @@ import Item, { Group } from 'docs/src/components/action/Item'; import Highlighter from 'docs/src/components/action/Highlighter'; import More from 'docs/src/components/action/More'; import Frame from 'docs/src/components/action/Frame'; -import Link from 'docs/src/modules/components/Link'; +import Link from '@mui/docs/Link'; const DEMOS = ['Components', 'Branding', 'Iconography']; diff --git a/docs/src/components/productDesignKit/DesignKitFAQ.tsx b/docs/src/components/productDesignKit/DesignKitFAQ.tsx index 4bc93c18981a1c..a48cdc37538007 100644 --- a/docs/src/components/productDesignKit/DesignKitFAQ.tsx +++ b/docs/src/components/productDesignKit/DesignKitFAQ.tsx @@ -10,7 +10,7 @@ import MuiAccordion from '@mui/material/Accordion'; import MuiAccordionSummary from '@mui/material/AccordionSummary'; import MuiAccordionDetail from '@mui/material/AccordionDetails'; import KeyboardArrowDownRounded from '@mui/icons-material/KeyboardArrowDownRounded'; -import InternalLink from 'docs/src/modules/components/Link'; +import InternalLink from '@mui/docs/Link'; import Section from 'docs/src/layouts/Section'; const faqData = [ diff --git a/docs/src/components/productDesignKit/DesignKitHero.tsx b/docs/src/components/productDesignKit/DesignKitHero.tsx index 64fc7c52db6cf7..1b630e49bb0615 100644 --- a/docs/src/components/productDesignKit/DesignKitHero.tsx +++ b/docs/src/components/productDesignKit/DesignKitHero.tsx @@ -7,7 +7,7 @@ import KeyboardArrowRightRounded from '@mui/icons-material/KeyboardArrowRightRou import GradientText from 'docs/src/components/typography/GradientText'; import HeroContainer from 'docs/src/layouts/HeroContainer'; import IconImage from 'docs/src/components/icon/IconImage'; -import Link from 'docs/src/modules/components/Link'; +import Link from '@mui/docs/Link'; import { DesignKitImagesSet1, DesignKitImagesSet2, diff --git a/docs/src/components/productMaterial/MaterialDesignKits.tsx b/docs/src/components/productMaterial/MaterialDesignKits.tsx index c2a97d4f03fdc2..1248fea677f599 100644 --- a/docs/src/components/productMaterial/MaterialDesignKits.tsx +++ b/docs/src/components/productMaterial/MaterialDesignKits.tsx @@ -16,7 +16,7 @@ import Item, { Group } from 'docs/src/components/action/Item'; import Highlighter from 'docs/src/components/action/Highlighter'; import More from 'docs/src/components/action/More'; import Frame from 'docs/src/components/action/Frame'; -import Link from 'docs/src/modules/components/Link'; +import Link from '@mui/docs/Link'; const DEMOS = ['Components', 'Branding', 'Iconography']; diff --git a/docs/src/components/productMaterial/MaterialEnd.tsx b/docs/src/components/productMaterial/MaterialEnd.tsx index 22c69b1242ba58..163f8a128ac056 100644 --- a/docs/src/components/productMaterial/MaterialEnd.tsx +++ b/docs/src/components/productMaterial/MaterialEnd.tsx @@ -11,7 +11,7 @@ import GetStartedButtons from 'docs/src/components/home/GetStartedButtons'; import Section from 'docs/src/layouts/Section'; import SectionHeadline from 'docs/src/components/typography/SectionHeadline'; import GradientText from 'docs/src/components/typography/GradientText'; -import Link from 'docs/src/modules/components/Link'; +import Link from '@mui/docs/Link'; import ROUTES from 'docs/src/route'; export default function MaterialEnd() { diff --git a/docs/src/components/productMaterial/MaterialHero.tsx b/docs/src/components/productMaterial/MaterialHero.tsx index 3a4ae3427b5780..93cca97b20a8f0 100644 --- a/docs/src/components/productMaterial/MaterialHero.tsx +++ b/docs/src/components/productMaterial/MaterialHero.tsx @@ -60,7 +60,7 @@ import HeroContainer from 'docs/src/layouts/HeroContainer'; import GetStartedButtons from 'docs/src/components/home/GetStartedButtons'; import GradientText from 'docs/src/components/typography/GradientText'; import { getDesignTokens } from 'docs/src/modules/brandingTheme'; -import Link from 'docs/src/modules/components/Link'; +import Link from '@mui/docs/Link'; import ROUTES from 'docs/src/route'; function Checkboxes() { diff --git a/docs/src/components/productMaterial/MaterialTemplates.tsx b/docs/src/components/productMaterial/MaterialTemplates.tsx index e53b1e2144d26a..3a2ff31f949bfb 100644 --- a/docs/src/components/productMaterial/MaterialTemplates.tsx +++ b/docs/src/components/productMaterial/MaterialTemplates.tsx @@ -16,7 +16,7 @@ import GradientText from 'docs/src/components/typography/GradientText'; import Item, { Group } from 'docs/src/components/action/Item'; import Highlighter from 'docs/src/components/action/Highlighter'; import Frame from 'docs/src/components/action/Frame'; -import Link from 'docs/src/modules/components/Link'; +import Link from '@mui/docs/Link'; import More from 'docs/src/components/action/More'; export const DEMOS = ['Dashboard', 'Landing Pages', 'E-commerce']; diff --git a/docs/src/components/productTemplate/TemplateDemo.tsx b/docs/src/components/productTemplate/TemplateDemo.tsx index b53eaa55637913..412c26c48a21a0 100644 --- a/docs/src/components/productTemplate/TemplateDemo.tsx +++ b/docs/src/components/productTemplate/TemplateDemo.tsx @@ -14,7 +14,7 @@ import GradientText from 'docs/src/components/typography/GradientText'; import Item, { Group } from 'docs/src/components/action/Item'; import Highlighter from 'docs/src/components/action/Highlighter'; import Frame from 'docs/src/components/action/Frame'; -import Link from 'docs/src/modules/components/Link'; +import Link from '@mui/docs/Link'; import More from 'docs/src/components/action/More'; import { DEMOS, icons, TEMPLATES } from 'docs/src/components/productMaterial/MaterialTemplates'; diff --git a/docs/src/components/productTemplate/TemplateHero.tsx b/docs/src/components/productTemplate/TemplateHero.tsx index 19f097d6d47f3d..11f04af60ca01c 100644 --- a/docs/src/components/productTemplate/TemplateHero.tsx +++ b/docs/src/components/productTemplate/TemplateHero.tsx @@ -6,7 +6,7 @@ import KeyboardArrowRightRounded from '@mui/icons-material/KeyboardArrowRightRou import GradientText from 'docs/src/components/typography/GradientText'; import HeroContainer from 'docs/src/layouts/HeroContainer'; import IconImage from 'docs/src/components/icon/IconImage'; -import Link from 'docs/src/modules/components/Link'; +import Link from '@mui/docs/Link'; import { StoreTemplatesSet1, StoreTemplatesSet2, diff --git a/docs/src/components/productX/XComponentsSwitcher.tsx b/docs/src/components/productX/XComponentsSwitcher.tsx index 0aed766b99698d..0fe25afc566f21 100644 --- a/docs/src/components/productX/XComponentsSwitcher.tsx +++ b/docs/src/components/productX/XComponentsSwitcher.tsx @@ -10,7 +10,7 @@ import AccountTreeRounded from '@mui/icons-material/AccountTreeRounded'; import BarChartRoundedIcon from '@mui/icons-material/BarChartRounded'; import { visuallyHidden } from '@mui/utils'; import Highlighter from 'docs/src/components/action/Highlighter'; -import Link from 'docs/src/modules/components/Link'; +import Link from '@mui/docs/Link'; import ROUTES from 'docs/src/route'; const SwipeableViews = dynamic(() => import('react-swipeable-views'), { ssr: false }); diff --git a/docs/src/components/productX/XDataGrid.tsx b/docs/src/components/productX/XDataGrid.tsx index bd61c9272e0be2..59ad0ca1586b65 100644 --- a/docs/src/components/productX/XDataGrid.tsx +++ b/docs/src/components/productX/XDataGrid.tsx @@ -22,7 +22,7 @@ import MarkdownElement from 'docs/src/components/markdown/MarkdownElement'; import FlashCode from 'docs/src/components/animation/FlashCode'; import XGridGlobalStyles from 'docs/src/components/home/XGridGlobalStyles'; import StylingInfo from 'docs/src/components/action/StylingInfo'; -import Link from 'docs/src/modules/components/Link'; +import Link from '@mui/docs/Link'; import ROUTES from 'docs/src/route'; const DEMOS = ['Editing', 'Selection', 'Sorting', 'Pagination', 'Filtering'] as const; diff --git a/docs/src/components/productX/XRoadmap.tsx b/docs/src/components/productX/XRoadmap.tsx index ea78c531eb51c9..3c0170596d6694 100644 --- a/docs/src/components/productX/XRoadmap.tsx +++ b/docs/src/components/productX/XRoadmap.tsx @@ -16,7 +16,7 @@ import AutoGraphRoundedIcon from '@mui/icons-material/AutoGraphRounded'; import SpeedRounded from '@mui/icons-material/SpeedRounded'; import { alpha } from '@mui/material/styles'; import ROUTES from 'docs/src/route'; -import Link from 'docs/src/modules/components/Link'; +import Link from '@mui/docs/Link'; import SectionHeadline from 'docs/src/components/typography/SectionHeadline'; import Section from 'docs/src/layouts/Section'; import GradientText from 'docs/src/components/typography/GradientText'; diff --git a/docs/src/layouts/AppFooter.tsx b/docs/src/layouts/AppFooter.tsx index 80bf6bd2c9a5a1..023ca14f14efc6 100644 --- a/docs/src/layouts/AppFooter.tsx +++ b/docs/src/layouts/AppFooter.tsx @@ -15,7 +15,7 @@ import SvgMuiLogotype from 'docs/src/icons/SvgMuiLogotype'; import EmailSubscribe from 'docs/src/components/footer/EmailSubscribe'; import ROUTES from 'docs/src/route'; import DiscordIcon from 'docs/src/icons/DiscordIcon'; -import Link from 'docs/src/modules/components/Link'; +import Link from '@mui/docs/Link'; import SvgStackOverflow from 'docs/src/icons/SvgStackOverflow'; interface AppFooterProps { diff --git a/docs/src/layouts/AppHeader.tsx b/docs/src/layouts/AppHeader.tsx index 3f4f5567a5c844..ea5a09688c311c 100644 --- a/docs/src/layouts/AppHeader.tsx +++ b/docs/src/layouts/AppHeader.tsx @@ -11,7 +11,7 @@ import SvgMuiLogomark from 'docs/src/icons/SvgMuiLogomark'; import HeaderNavBar from 'docs/src/components/header/HeaderNavBar'; import HeaderNavDropdown from 'docs/src/components/header/HeaderNavDropdown'; import ThemeModeToggle from 'docs/src/components/header/ThemeModeToggle'; -import Link from 'docs/src/modules/components/Link'; +import Link from '@mui/docs/Link'; import { DeferredAppSearch } from 'docs/src/modules/components/AppFrame'; import { useTranslate } from '@mui/docs/i18n'; diff --git a/docs/src/modules/components/AppLayoutDocsFooter.js b/docs/src/modules/components/AppLayoutDocsFooter.js index 8137c5d55f4448..a13a5642c637e2 100644 --- a/docs/src/modules/components/AppLayoutDocsFooter.js +++ b/docs/src/modules/components/AppLayoutDocsFooter.js @@ -27,7 +27,7 @@ import RssFeedIcon from '@mui/icons-material/RssFeed'; import ArrowOutwardRoundedIcon from '@mui/icons-material/ArrowOutwardRounded'; import DiscordIcon from 'docs/src/icons/DiscordIcon'; // Other imports -import Link from 'docs/src/modules/components/Link'; +import Link from '@mui/docs/Link'; import PageContext from 'docs/src/modules/components/PageContext'; import EditPage from 'docs/src/modules/components/EditPage'; import SvgMuiLogotype from 'docs/src/icons/SvgMuiLogotype'; diff --git a/docs/src/modules/components/AppNavDrawerItem.js b/docs/src/modules/components/AppNavDrawerItem.js index 85b75564982e48..3c36cbf919b25b 100644 --- a/docs/src/modules/components/AppNavDrawerItem.js +++ b/docs/src/modules/components/AppNavDrawerItem.js @@ -6,7 +6,7 @@ import Collapse from '@mui/material/Collapse'; import Box from '@mui/material/Box'; import Chip from '@mui/material/Chip'; import { samePageLinkNavigation } from 'docs/src/modules/components/MarkdownLinks'; -import Link from 'docs/src/modules/components/Link'; +import Link from '@mui/docs/Link'; import standardNavIcons from './AppNavIcons'; const Item = styled( diff --git a/docs/src/modules/components/AppSearch.js b/docs/src/modules/components/AppSearch.js index f6da0f050af680..2a0e850835d983 100644 --- a/docs/src/modules/components/AppSearch.js +++ b/docs/src/modules/components/AppSearch.js @@ -23,7 +23,7 @@ import GlobalStyles from '@mui/material/GlobalStyles'; import { alpha, styled } from '@mui/material/styles'; import { pathnameToLanguage } from 'docs/src/modules/utils/helpers'; import { LANGUAGES_SSR } from 'docs/config'; -import Link from 'docs/src/modules/components/Link'; +import Link from '@mui/docs/Link'; import { useTranslate, useUserLanguage } from '@mui/docs/i18n'; import useLazyCSS from 'docs/src/modules/utils/useLazyCSS'; import PageContext from 'docs/src/modules/components/PageContext'; diff --git a/docs/src/modules/components/AppTableOfContents.js b/docs/src/modules/components/AppTableOfContents.js index 13fd1b4001a7ca..74ebc7932c8400 100644 --- a/docs/src/modules/components/AppTableOfContents.js +++ b/docs/src/modules/components/AppTableOfContents.js @@ -5,7 +5,7 @@ import throttle from 'lodash/throttle'; import { styled, alpha } from '@mui/material/styles'; import Typography from '@mui/material/Typography'; import NoSsr from '@mui/material/NoSsr'; -import Link from 'docs/src/modules/components/Link'; +import Link from '@mui/docs/Link'; import { useTranslate } from '@mui/docs/i18n'; import { samePageLinkNavigation } from 'docs/src/modules/components/MarkdownLinks'; import TableOfContentsBanner from 'docs/src/components/banner/TableOfContentsBanner'; diff --git a/docs/src/modules/components/BaseUIComponents.js b/docs/src/modules/components/BaseUIComponents.js index 3eacefae94ff24..0b81ef840d87fc 100644 --- a/docs/src/modules/components/BaseUIComponents.js +++ b/docs/src/modules/components/BaseUIComponents.js @@ -4,7 +4,7 @@ import CardMedia from '@mui/material/CardMedia'; import Grid from '@mui/material/Grid'; import Typography from '@mui/material/Typography'; import { alpha } from '@mui/material/styles'; -import Link from 'docs/src/modules/components/Link'; +import Link from '@mui/docs/Link'; function components() { return [ diff --git a/docs/src/modules/components/ComponentPageTabs.js b/docs/src/modules/components/ComponentPageTabs.js index d8cabe15325da6..8327ae3d90f2ce 100644 --- a/docs/src/modules/components/ComponentPageTabs.js +++ b/docs/src/modules/components/ComponentPageTabs.js @@ -6,7 +6,7 @@ import Box from '@mui/material/Box'; import Tabs, { tabsClasses } from '@mui/material/Tabs'; import Tab, { tabClasses } from '@mui/material/Tab'; import { useTranslate } from '@mui/docs/i18n'; -import Link from 'docs/src/modules/components/Link'; +import Link from '@mui/docs/Link'; export const HEIGHT = 50; diff --git a/docs/src/modules/components/DiamondSponsors.js b/docs/src/modules/components/DiamondSponsors.js index 5cf92097661ef3..f7a92a6b8c9cbf 100644 --- a/docs/src/modules/components/DiamondSponsors.js +++ b/docs/src/modules/components/DiamondSponsors.js @@ -6,7 +6,7 @@ import Button from '@mui/material/Button'; import Typography from '@mui/material/Typography'; import DiamondOutlinedIcon from '@mui/icons-material/DiamondOutlined'; import { useTranslate } from '@mui/docs/i18n'; -import Link from 'docs/src/modules/components/Link'; +import Link from '@mui/docs/Link'; const StyledAnchor = styled('a')(({ theme }) => ({ boxSizing: 'border-box', // TODO have CssBaseline in the Next.js layout diff --git a/docs/src/modules/components/Link.d.ts b/docs/src/modules/components/Link.d.ts deleted file mode 100644 index afebd27ce1be05..00000000000000 --- a/docs/src/modules/components/Link.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { LinkProps as MuiLinkProps } from '@mui/material/Link'; -import { LinkProps } from 'next/link'; - -export default function Link(props: LinkProps & MuiLinkProps): JSX.Element; diff --git a/docs/src/modules/components/Link.tsx b/docs/src/modules/components/Link.tsx index f708ab91ea4da3..e7167d22064aef 100644 --- a/docs/src/modules/components/Link.tsx +++ b/docs/src/modules/components/Link.tsx @@ -1,148 +1,5 @@ -import * as React from 'react'; -import clsx from 'clsx'; -import { useRouter } from 'next/router'; -import NextLink, { LinkProps as NextLinkProps } from 'next/link'; -import MuiLink, { LinkProps as MuiLinkProps } from '@mui/material/Link'; -import { styled } from '@mui/material/styles'; -import { useUserLanguage } from '@mui/docs/i18n'; -import { LANGUAGES_IGNORE_PAGES } from 'docs/config'; +// Backwards compatibility for Toolpad and X. +// TODO: remove when Toolpad and X migrated to `@mui/docs/i18n` -/** - * File to keep in sync with: - * - * - /docs/src/modules/components/Link.tsx - * - /examples/material-ui-nextjs-pages-router/src/Link.js - * - /examples/material-ui-nextjs-pages-router-ts/src/Link.tsx - */ - -// Add support for the sx prop for consistency with the other branches. -const Anchor = styled('a')({}); - -interface NextLinkComposedProps - extends Omit, 'href'>, - Omit { - to: NextLinkProps['href']; - linkAs?: NextLinkProps['as']; -} - -const NextLinkComposed = React.forwardRef( - function NextLinkComposed(props, ref) { - const { - to, - linkAs, - replace, - scroll, - shallow, - prefetch, - legacyBehavior = true, - locale, - ...other - } = props; - - return ( - - - - ); - }, -); - -export type LinkProps = { - activeClassName?: string; - as?: NextLinkProps['as']; - href: NextLinkProps['href']; - linkAs?: NextLinkProps['as']; // Useful when the as prop is shallow by styled(). - noLinkStyle?: boolean; -} & Omit & - Omit; - -// A styled version of the Next.js Pages Router Link component: -// https://nextjs.org/docs/pages/api-reference/components/link -const Link = React.forwardRef(function Link(props, ref) { - const { - activeClassName = 'active', - as, - className: classNameProps, - href, - legacyBehavior, - linkAs: linkAsProp, - locale, - noLinkStyle, - prefetch, - replace, - role, // Link don't have roles. - scroll, - shallow, - ...other - } = props; - - const router = useRouter(); - const pathname = typeof href === 'string' ? href : href?.pathname; - const routerPathname = router.pathname.replace('/[docsTab]', ''); - - const shouldBeActive = routerPathname === pathname; - - const className = clsx(classNameProps, { - [activeClassName]: shouldBeActive && activeClassName, - }); - - const isExternal = - typeof href === 'string' && (href.indexOf('http') === 0 || href.indexOf('mailto:') === 0); - const userLanguage = useUserLanguage(); - - if (isExternal) { - if (noLinkStyle) { - return ; - } - - return ; - } - - let linkAs = linkAsProp || as || (href as string); - if ( - userLanguage !== 'en' && - pathname && - pathname.indexOf('/') === 0 && - !LANGUAGES_IGNORE_PAGES(pathname) && - !pathname.startsWith(`/${userLanguage}/`) - ) { - linkAs = `/${userLanguage}${linkAs}`; - } - - const nextjsProps = { - to: href, - linkAs, - replace, - scroll, - shallow, - legacyBehavior, - prefetch, - locale, - }; - - if (noLinkStyle) { - return ; - } - - return ( - - ); -}); - -export default Link; +export * from '@mui/docs/Link'; +export { default } from '@mui/docs/Link'; diff --git a/docs/src/modules/components/MaterialShowcase.js b/docs/src/modules/components/MaterialShowcase.js index 8f0e6ceadbb372..48084415c35be6 100644 --- a/docs/src/modules/components/MaterialShowcase.js +++ b/docs/src/modules/components/MaterialShowcase.js @@ -9,7 +9,7 @@ import Typography from '@mui/material/Typography'; import IconButton from '@mui/material/IconButton'; import GitHubIcon from '@mui/icons-material/GitHub'; import { alpha } from '@mui/material/styles'; -import Link from 'docs/src/modules/components/Link'; +import Link from '@mui/docs/Link'; import { useTranslate } from '@mui/docs/i18n'; /** diff --git a/docs/src/modules/components/MuiProductSelector.tsx b/docs/src/modules/components/MuiProductSelector.tsx index a5686733531906..83cf5d2d9aa1b4 100644 --- a/docs/src/modules/components/MuiProductSelector.tsx +++ b/docs/src/modules/components/MuiProductSelector.tsx @@ -6,7 +6,7 @@ import Typography from '@mui/material/Typography'; import Chip from '@mui/material/Chip'; import IconImage from 'docs/src/components/icon/IconImage'; import ROUTES from 'docs/src/route'; -import Link from 'docs/src/modules/components/Link'; +import Link from '@mui/docs/Link'; import PageContext from 'docs/src/modules/components/PageContext'; interface ProductSubMenuProp extends BoxProps { diff --git a/docs/src/modules/components/TopLayoutBlog.js b/docs/src/modules/components/TopLayoutBlog.js index 14d7628bb5e335..efaa11031cba2f 100644 --- a/docs/src/modules/components/TopLayoutBlog.js +++ b/docs/src/modules/components/TopLayoutBlog.js @@ -16,7 +16,7 @@ import HeroEnd from 'docs/src/components/home/HeroEnd'; import MarkdownElement from 'docs/src/modules/components/MarkdownElement'; import { pathnameToLanguage } from 'docs/src/modules/utils/helpers'; import ROUTES from 'docs/src/route'; -import Link from 'docs/src/modules/components/Link'; +import Link from '@mui/docs/Link'; export const authors = { oliviertassinari: { diff --git a/docs/src/modules/components/TopLayoutCareers.js b/docs/src/modules/components/TopLayoutCareers.js index 76aa72775ade88..ba4fda7482cd82 100644 --- a/docs/src/modules/components/TopLayoutCareers.js +++ b/docs/src/modules/components/TopLayoutCareers.js @@ -8,7 +8,7 @@ import AppFooter from 'docs/src/layouts/AppFooter'; import AppHeader from 'docs/src/layouts/AppHeader'; import BrandingCssVarsProvider from 'docs/src/BrandingCssVarsProvider'; import MarkdownElement from 'docs/src/modules/components/MarkdownElement'; -import Link from 'docs/src/modules/components/Link'; +import Link from '@mui/docs/Link'; const StyledDiv = styled('div')({ flex: '1 0 100%', diff --git a/docs/src/modules/utils/i18n.js b/docs/src/modules/utils/i18n.js index 9dc5f483b70371..5c77a699a0063e 100644 --- a/docs/src/modules/utils/i18n.js +++ b/docs/src/modules/utils/i18n.js @@ -1,3 +1,4 @@ -// Backwards compatibility for Toolpad X. -// TODO: remove when X/Toolpad migrated to `@mui/docs/i18n` +// Backwards compatibility for Toolpad and X. +// TODO: remove when Toolpad and X migrated to `@mui/docs/i18n` + export * from '@mui/docs/i18n'; diff --git a/docs/src/pages/versions/LatestVersions.js b/docs/src/pages/versions/LatestVersions.js index b68d733319ed7f..031f4750d4285c 100644 --- a/docs/src/pages/versions/LatestVersions.js +++ b/docs/src/pages/versions/LatestVersions.js @@ -5,7 +5,7 @@ import TableBody from '@mui/material/TableBody'; import TableCell from '@mui/material/TableCell'; import TableRow from '@mui/material/TableRow'; import Typography from '@mui/material/Typography'; -import Link from 'docs/src/modules/components/Link'; +import Link from '@mui/docs/Link'; function LatestVersions() { return ( diff --git a/docs/src/pages/versions/ReleasedVersions.js b/docs/src/pages/versions/ReleasedVersions.js index 3a921ddf291dce..9aa1524a4354ff 100644 --- a/docs/src/pages/versions/ReleasedVersions.js +++ b/docs/src/pages/versions/ReleasedVersions.js @@ -5,7 +5,7 @@ import TableBody from '@mui/material/TableBody'; import TableCell from '@mui/material/TableCell'; import TableRow from '@mui/material/TableRow'; import Typography from '@mui/material/Typography'; -import Link from 'docs/src/modules/components/Link'; +import Link from '@mui/docs/Link'; import VersionsContext from 'docs/src/pages/versions/VersionsContext'; const GITHUB_RELEASE_BASE_URL = 'https://github.com/mui/material-ui/releases/tag/'; diff --git a/packages/mui-docs/package.json b/packages/mui-docs/package.json index 622b9641b3d8df..3d1e48751d2d69 100644 --- a/packages/mui-docs/package.json +++ b/packages/mui-docs/package.json @@ -38,18 +38,23 @@ "@babel/runtime": "^7.23.9", "@mui/base": "workspace:*", "@mui/utils": "workspace:^", + "clsx": "^2.1.0", + "invariant": "^2.2.4", "nprogress": "^0.2.0", "prop-types": "^15.8.1" }, "devDependencies": { + "@types/invariant": "^2.2.37", "@types/node": "^18.19.10", "@types/prop-types": "^15.7.11", "@types/react": "^18.2.48", + "next": "^14.1.0", "react": "^18.2.0" }, "peerDependencies": { "@mui/material": "workspace:^", "@types/react": "^17.0.0 || ^18.0.0", + "next": "13.4.19", "react": "^17.0.0 || ^18.0.0" }, "peerDependenciesMeta": { diff --git a/packages/mui-docs/src/DocsProvider/DocsProvider.tsx b/packages/mui-docs/src/DocsProvider/DocsProvider.tsx new file mode 100644 index 00000000000000..ec3a91e2d74449 --- /dev/null +++ b/packages/mui-docs/src/DocsProvider/DocsProvider.tsx @@ -0,0 +1,29 @@ +import * as React from 'react'; +import invariant from 'invariant'; + +export interface DocsConfig { + LANGUAGES: string[]; + LANGUAGES_SSR: string[]; + LANGUAGES_IN_PROGRESS: string[]; + LANGUAGES_IGNORE_PAGES: (pathname: string) => boolean; +} + +const DocsConfigContext = React.createContext(null); + +export interface DocsProviderProps { + config: DocsConfig; + children?: React.ReactNode; +} + +export function DocsProvider({ config, children }: DocsProviderProps) { + return {children}; +} + +export function useDocsConfig() { + const config = React.useContext(DocsConfigContext); + invariant( + config, + 'Could not find docs config context value; please ensure the component is wrapped in a ', + ); + return config; +} diff --git a/packages/mui-docs/src/DocsProvider/index.tsx b/packages/mui-docs/src/DocsProvider/index.tsx new file mode 100644 index 00000000000000..07bc1c724391f2 --- /dev/null +++ b/packages/mui-docs/src/DocsProvider/index.tsx @@ -0,0 +1 @@ +export * from './DocsProvider'; diff --git a/packages/mui-docs/src/Link/Link.tsx b/packages/mui-docs/src/Link/Link.tsx new file mode 100644 index 00000000000000..666342a1c44e82 --- /dev/null +++ b/packages/mui-docs/src/Link/Link.tsx @@ -0,0 +1,150 @@ +import * as React from 'react'; +import clsx from 'clsx'; +import { useRouter } from 'next/router'; +import NextLink, { LinkProps as NextLinkProps } from 'next/link'; +import MuiLink, { LinkProps as MuiLinkProps } from '@mui/material/Link'; +import { styled } from '@mui/material/styles'; +import { useUserLanguage } from '../i18n'; +import { useDocsConfig } from '../DocsProvider'; + +/** + * File to keep in sync with: + * + * - /docs/src/modules/components/Link.tsx + * - /examples/material-ui-nextjs-pages-router/src/Link.js + * - /examples/material-ui-nextjs-pages-router-ts/src/Link.tsx + */ + +// Add support for the sx prop for consistency with the other branches. +const Anchor = styled('a')({}); + +interface NextLinkComposedProps + extends Omit, 'href'>, + Omit { + to: NextLinkProps['href']; + linkAs?: NextLinkProps['as']; +} + +const NextLinkComposed = React.forwardRef( + function NextLinkComposed(props, ref) { + const { + to, + linkAs, + replace, + scroll, + shallow, + prefetch, + legacyBehavior = true, + locale, + ...other + } = props; + + return ( + + + + ); + }, +); + +export type LinkProps = { + activeClassName?: string; + as?: NextLinkProps['as']; + href: NextLinkProps['href']; + linkAs?: NextLinkProps['as']; // Useful when the as prop is shallow by styled(). + noLinkStyle?: boolean; +} & Omit & + Omit; + +// A styled version of the Next.js Pages Router Link component: +// https://nextjs.org/docs/pages/api-reference/components/link +const Link = React.forwardRef(function Link(props, ref) { + const { + activeClassName = 'active', + as, + className: classNameProps, + href, + legacyBehavior, + linkAs: linkAsProp, + locale, + noLinkStyle, + prefetch, + replace, + role, // Link don't have roles. + scroll, + shallow, + ...other + } = props; + + const router = useRouter(); + const pathname = typeof href === 'string' ? href : href?.pathname; + const routerPathname = router.pathname.replace('/[docsTab]', ''); + + const shouldBeActive = routerPathname === pathname; + + const className = clsx(classNameProps, { + [activeClassName]: shouldBeActive && activeClassName, + }); + + const isExternal = + typeof href === 'string' && (href.indexOf('http') === 0 || href.indexOf('mailto:') === 0); + const userLanguage = useUserLanguage(); + + const { LANGUAGES_IGNORE_PAGES } = useDocsConfig(); + + if (isExternal) { + if (noLinkStyle) { + return ; + } + + return ; + } + + let linkAs = linkAsProp || as || (href as string); + if ( + userLanguage !== 'en' && + pathname && + pathname.indexOf('/') === 0 && + !LANGUAGES_IGNORE_PAGES(pathname) && + !pathname.startsWith(`/${userLanguage}/`) + ) { + linkAs = `/${userLanguage}${linkAs}`; + } + + const nextjsProps = { + to: href, + linkAs, + replace, + scroll, + shallow, + legacyBehavior, + prefetch, + locale, + }; + + if (noLinkStyle) { + return ; + } + + return ( + + ); +}); + +export default Link; diff --git a/packages/mui-docs/src/Link/index.ts b/packages/mui-docs/src/Link/index.ts new file mode 100644 index 00000000000000..edd9808dfd5ee4 --- /dev/null +++ b/packages/mui-docs/src/Link/index.ts @@ -0,0 +1,2 @@ +export * from './Link'; +export { default } from './Link'; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 74f330de56f3eb..e3d060b4baab45 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1242,6 +1242,12 @@ importers: '@mui/utils': specifier: workspace:^ version: link:../mui-utils/build + clsx: + specifier: ^2.1.0 + version: 2.1.0 + invariant: + specifier: ^2.2.4 + version: 2.2.4 nprogress: specifier: ^0.2.0 version: 0.2.0 @@ -1249,6 +1255,9 @@ importers: specifier: ^15.8.1 version: 15.8.1 devDependencies: + '@types/invariant': + specifier: ^2.2.37 + version: 2.2.37 '@types/node': specifier: ^18.19.10 version: 18.19.10 @@ -1258,6 +1267,9 @@ importers: '@types/react': specifier: ^18.2.48 version: 18.2.48 + next: + specifier: ^14.1.0 + version: 14.1.0(@babel/core@7.23.9)(babel-plugin-macros@3.1.0)(react-dom@18.2.0)(react@18.2.0) react: specifier: ^18.2.0 version: 18.2.0 @@ -7785,6 +7797,10 @@ packages: resolution: {integrity: sha512-/K3ds8TRAfBvi5vfjuz8y6+GiAYBZ0x4tXv1Av6CWBWn0IlADc+ZX9pMq7oU0fNQPnBwIZl3rmeLp6SBApbxSQ==} dev: false + /@types/invariant@2.2.37: + resolution: {integrity: sha512-IwpIMieE55oGWiXkQPSBY1nw1nFs6bsKXTFskNY8sdS17K24vyEBRQZEwlRS7ZmXCWnJcQtbxWzly+cODWGs2A==} + dev: true + /@types/is-stream@1.1.0: resolution: {integrity: sha512-jkZatu4QVbR60mpIzjINmtS1ZF4a/FqdTUTBeQDVOQ2PYyidtwFKr0B5G6ERukKwliq+7mIXvxyppwzG5EgRYg==} dependencies: From a2936e548fe4dfa0e571dd663e25a1fc13c13219 Mon Sep 17 00:00:00 2001 From: MUI bot <2109932+Janpot@users.noreply.github.com> Date: Fri, 2 Feb 2024 09:49:53 +0100 Subject: [PATCH 09/21] fix --- package.json | 3 +- packages/mui-docs/tsconfig.build.json | 3 +- packages/mui-docs/tsconfig.json | 1 + pnpm-lock.yaml | 62 +++++++++++++++++++++++++++ scripts/buildTypes.mjs | 7 ++- 5 files changed, 70 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 44f3bd2ad69baa..0cd98c12e3fcb2 100644 --- a/package.json +++ b/package.json @@ -81,6 +81,7 @@ "dependencies": { "@googleapis/sheets": "^5.0.5", "@slack/bolt": "^3.17.1", + "execa": "^8.0.1", "google-auth-library": "^9.5.0" }, "devDependencies": { @@ -177,8 +178,8 @@ "stylelint-config-standard": "^34.0.0", "stylelint-processor-styled-components": "^1.10.0", "terser-webpack-plugin": "^5.3.10", - "tsx": "^4.7.0", "tsup": "^8.0.1", + "tsx": "^4.7.0", "typescript": "^5.3.3", "typescript-to-proptypes": "workspace:^", "webpack": "^5.90.0", diff --git a/packages/mui-docs/tsconfig.build.json b/packages/mui-docs/tsconfig.build.json index bc9de8db7f41fd..ba7a787fa189f4 100644 --- a/packages/mui-docs/tsconfig.build.json +++ b/packages/mui-docs/tsconfig.build.json @@ -11,5 +11,6 @@ "rootDir": "./src" }, "include": ["src/**/*.ts*"], - "exclude": ["src/**/*.spec.ts*", "src/**/*.test.ts*"] + "exclude": ["src/**/*.spec.ts*", "src/**/*.test.ts*"], + "references": [{ "path": "../mui-material/tsconfig.build.json" }] } diff --git a/packages/mui-docs/tsconfig.json b/packages/mui-docs/tsconfig.json index 3f6f21cc2bf678..1227ceb7c1f109 100644 --- a/packages/mui-docs/tsconfig.json +++ b/packages/mui-docs/tsconfig.json @@ -1,6 +1,7 @@ { "extends": "../../tsconfig.json", "compilerOptions": { + "skipLibCheck": true, "types": ["react", "node"] }, "include": ["src/**/*", "test/**/*"] diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e3d060b4baab45..e5d493714bc032 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -37,6 +37,9 @@ importers: '@slack/bolt': specifier: ^3.17.1 version: 3.17.1 + execa: + specifier: ^8.0.1 + version: 8.0.1 google-auth-library: specifier: ^9.5.0 version: 9.5.0 @@ -12138,6 +12141,21 @@ packages: signal-exit: 3.0.7 strip-final-newline: 2.0.0 + /execa@8.0.1: + resolution: {integrity: sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==} + engines: {node: '>=16.17'} + dependencies: + cross-spawn: 7.0.3 + get-stream: 8.0.1 + human-signals: 5.0.0 + is-stream: 3.0.0 + merge-stream: 2.0.0 + npm-run-path: 5.2.0 + onetime: 6.0.0 + signal-exit: 4.1.0 + strip-final-newline: 3.0.0 + dev: false + /expand-brackets@2.1.4: resolution: {integrity: sha512-w/ozOKR9Obk3qoWeY/WDi6MFta9AoMR+zud60mdnbniMcBxRuFJyDt2LdX/14A1UABeqk+Uk+LDfUpvoGKppZA==} engines: {node: '>=0.10.0'} @@ -12790,6 +12808,11 @@ packages: resolution: {integrity: sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==} engines: {node: '>=10'} + /get-stream@8.0.1: + resolution: {integrity: sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==} + engines: {node: '>=16'} + dev: false + /get-symbol-description@1.0.0: resolution: {integrity: sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw==} engines: {node: '>= 0.4'} @@ -13502,6 +13525,11 @@ packages: resolution: {integrity: sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==} engines: {node: '>=10.17.0'} + /human-signals@5.0.0: + resolution: {integrity: sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==} + engines: {node: '>=16.17.0'} + dev: false + /humanize-ms@1.2.1: resolution: {integrity: sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ==} dependencies: @@ -14047,6 +14075,11 @@ packages: resolution: {integrity: sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==} engines: {node: '>=8'} + /is-stream@3.0.0: + resolution: {integrity: sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + dev: false + /is-string@1.0.7: resolution: {integrity: sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==} engines: {node: '>= 0.4'} @@ -16052,6 +16085,11 @@ packages: resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==} engines: {node: '>=6'} + /mimic-fn@4.0.0: + resolution: {integrity: sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==} + engines: {node: '>=12'} + dev: false + /mimic-response@1.0.1: resolution: {integrity: sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==} engines: {node: '>=4'} @@ -16788,6 +16826,13 @@ packages: dependencies: path-key: 3.1.1 + /npm-run-path@5.2.0: + resolution: {integrity: sha512-W4/tgAXFqFA0iL7fk0+uQ3g7wkL8xJmx3XdK0VGb4cHW//eZTtKGvFBBoRKVTpY7n6ze4NL9ly7rgXcHufqXKg==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + dependencies: + path-key: 4.0.0 + dev: false + /npmlog@6.0.2: resolution: {integrity: sha512-/vBvz5Jfr9dT/aFWd0FIRf+T/Q2WBsLENygUaFUqstqsycmZAP/t5BvFJTK0viFmSUxiUKTUplWy5vt+rvKIxg==} engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} @@ -17068,6 +17113,13 @@ packages: dependencies: mimic-fn: 2.1.0 + /onetime@6.0.0: + resolution: {integrity: sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==} + engines: {node: '>=12'} + dependencies: + mimic-fn: 4.0.0 + dev: false + /open@6.4.0: resolution: {integrity: sha512-IFenVPgF70fSm1keSd2iDBIDIBZkroLeuffXq+wKTzTJlBpesFWojV9lb8mzOfaAzM1sr7HQHuO0vtV0zYekGg==} engines: {node: '>=8'} @@ -17484,6 +17536,11 @@ packages: resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} engines: {node: '>=8'} + /path-key@4.0.0: + resolution: {integrity: sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==} + engines: {node: '>=12'} + dev: false + /path-parse@1.0.7: resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} @@ -20054,6 +20111,11 @@ packages: resolution: {integrity: sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==} engines: {node: '>=6'} + /strip-final-newline@3.0.0: + resolution: {integrity: sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==} + engines: {node: '>=12'} + dev: false + /strip-indent@3.0.0: resolution: {integrity: sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==} engines: {node: '>=8'} diff --git a/scripts/buildTypes.mjs b/scripts/buildTypes.mjs index e8430b6279f65d..f2a4e0d9e4f5fc 100644 --- a/scripts/buildTypes.mjs +++ b/scripts/buildTypes.mjs @@ -1,12 +1,11 @@ import chalk from 'chalk'; -import childProcess from 'child_process'; import glob from 'fast-glob'; import fse from 'fs-extra'; import path from 'path'; -import { promisify } from 'util'; import yargs from 'yargs'; +import { $ } from 'execa'; -const exec = promisify(childProcess.exec); +const $$ = $({ stdio: 'inherit' }); /** * Fixes a wrong import path caused by https://github.com/microsoft/TypeScript/issues/39117 @@ -111,7 +110,7 @@ async function main() { ); } - await exec(['pnpm', 'tsc', '-b', tsconfigPath].join(' ')); + await $$`pnpm tsc -b ${tsconfigPath}`; const publishDir = path.join(packageRoot, 'build'); const declarationFiles = await glob('**/*.d.ts', { absolute: true, cwd: publishDir }); From 9408d4951f7aae48cf18225fc95610344b689a7a Mon Sep 17 00:00:00 2001 From: MUI bot <2109932+Janpot@users.noreply.github.com> Date: Fri, 2 Feb 2024 09:54:54 +0100 Subject: [PATCH 10/21] Create .npmignore --- packages/mui-docs/.npmignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 packages/mui-docs/.npmignore diff --git a/packages/mui-docs/.npmignore b/packages/mui-docs/.npmignore new file mode 100644 index 00000000000000..81f0fda795522a --- /dev/null +++ b/packages/mui-docs/.npmignore @@ -0,0 +1 @@ +.tsbuildinfo From cd706f3b19039796971465574d0a8c1c87edea8d Mon Sep 17 00:00:00 2001 From: MUI bot <2109932+Janpot@users.noreply.github.com> Date: Fri, 2 Feb 2024 10:16:08 +0100 Subject: [PATCH 11/21] dw --- packages/mui-docs/package.json | 2 -- packages/mui-docs/src/DocsProvider/DocsProvider.tsx | 10 +++++----- pnpm-lock.yaml | 10 ---------- 3 files changed, 5 insertions(+), 17 deletions(-) diff --git a/packages/mui-docs/package.json b/packages/mui-docs/package.json index 3d1e48751d2d69..7404ed8257de57 100644 --- a/packages/mui-docs/package.json +++ b/packages/mui-docs/package.json @@ -39,12 +39,10 @@ "@mui/base": "workspace:*", "@mui/utils": "workspace:^", "clsx": "^2.1.0", - "invariant": "^2.2.4", "nprogress": "^0.2.0", "prop-types": "^15.8.1" }, "devDependencies": { - "@types/invariant": "^2.2.37", "@types/node": "^18.19.10", "@types/prop-types": "^15.7.11", "@types/react": "^18.2.48", diff --git a/packages/mui-docs/src/DocsProvider/DocsProvider.tsx b/packages/mui-docs/src/DocsProvider/DocsProvider.tsx index ec3a91e2d74449..e8e8ec4c74d7ad 100644 --- a/packages/mui-docs/src/DocsProvider/DocsProvider.tsx +++ b/packages/mui-docs/src/DocsProvider/DocsProvider.tsx @@ -1,5 +1,4 @@ import * as React from 'react'; -import invariant from 'invariant'; export interface DocsConfig { LANGUAGES: string[]; @@ -21,9 +20,10 @@ export function DocsProvider({ config, children }: DocsProviderProps) { export function useDocsConfig() { const config = React.useContext(DocsConfigContext); - invariant( - config, - 'Could not find docs config context value; please ensure the component is wrapped in a ', - ); + if (!config) { + throw new Error( + 'Could not find docs config context value; please ensure the component is wrapped in a ', + ); + } return config; } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e5d493714bc032..5d9638911e301d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1248,9 +1248,6 @@ importers: clsx: specifier: ^2.1.0 version: 2.1.0 - invariant: - specifier: ^2.2.4 - version: 2.2.4 nprogress: specifier: ^0.2.0 version: 0.2.0 @@ -1258,9 +1255,6 @@ importers: specifier: ^15.8.1 version: 15.8.1 devDependencies: - '@types/invariant': - specifier: ^2.2.37 - version: 2.2.37 '@types/node': specifier: ^18.19.10 version: 18.19.10 @@ -7800,10 +7794,6 @@ packages: resolution: {integrity: sha512-/K3ds8TRAfBvi5vfjuz8y6+GiAYBZ0x4tXv1Av6CWBWn0IlADc+ZX9pMq7oU0fNQPnBwIZl3rmeLp6SBApbxSQ==} dev: false - /@types/invariant@2.2.37: - resolution: {integrity: sha512-IwpIMieE55oGWiXkQPSBY1nw1nFs6bsKXTFskNY8sdS17K24vyEBRQZEwlRS7ZmXCWnJcQtbxWzly+cODWGs2A==} - dev: true - /@types/is-stream@1.1.0: resolution: {integrity: sha512-jkZatu4QVbR60mpIzjINmtS1ZF4a/FqdTUTBeQDVOQ2PYyidtwFKr0B5G6ERukKwliq+7mIXvxyppwzG5EgRYg==} dependencies: From 92cd84b9c587fa17feec7c0209d52e3c0221c331 Mon Sep 17 00:00:00 2001 From: MUI bot <2109932+Janpot@users.noreply.github.com> Date: Fri, 2 Feb 2024 11:25:29 +0100 Subject: [PATCH 12/21] add more in provider --- docs/pages/_app.js | 33 +++++++++---------- .../src/DocsProvider/DocsProvider.tsx | 12 +++++-- 2 files changed, 25 insertions(+), 20 deletions(-) diff --git a/docs/pages/_app.js b/docs/pages/_app.js index bb917bff28212d..04a93862de43fd 100644 --- a/docs/pages/_app.js +++ b/docs/pages/_app.js @@ -22,7 +22,6 @@ import { CodeCopyProvider } from 'docs/src/modules/utils/CodeCopy'; import { ThemeProvider } from 'docs/src/modules/components/ThemeContext'; import { CodeVariantProvider } from 'docs/src/modules/utils/codeVariant'; import { CodeStylingProvider } from 'docs/src/modules/utils/codeStylingSolution'; -import { UserLanguageProvider } from '@mui/docs/i18n'; import DocsStyledEngineProvider from 'docs/src/modules/utils/StyledEngineProvider'; import createEmotionCache from 'docs/src/createEmotionCache'; import findActivePage from 'docs/src/modules/utils/findActivePage'; @@ -296,23 +295,21 @@ function AppWrapper(props) { - - - - - - - - - {children} - - - - - - - - + + + + + + + + {children} + + + + + + + ); diff --git a/packages/mui-docs/src/DocsProvider/DocsProvider.tsx b/packages/mui-docs/src/DocsProvider/DocsProvider.tsx index e8e8ec4c74d7ad..4ca2b78ef342ff 100644 --- a/packages/mui-docs/src/DocsProvider/DocsProvider.tsx +++ b/packages/mui-docs/src/DocsProvider/DocsProvider.tsx @@ -1,4 +1,5 @@ import * as React from 'react'; +import { UserLanguageProvider } from '../i18n'; export interface DocsConfig { LANGUAGES: string[]; @@ -11,11 +12,18 @@ const DocsConfigContext = React.createContext(null); export interface DocsProviderProps { config: DocsConfig; + defaultUserLanguage: string; children?: React.ReactNode; } -export function DocsProvider({ config, children }: DocsProviderProps) { - return {children}; +export function DocsProvider({ config, defaultUserLanguage, children }: DocsProviderProps) { + return ( + + + {children} + + + ); } export function useDocsConfig() { From a94503eaf59693648eac5d76db47e3b6e4ef8415 Mon Sep 17 00:00:00 2001 From: MUI bot <2109932+Janpot@users.noreply.github.com> Date: Tue, 13 Feb 2024 13:47:38 +0100 Subject: [PATCH 13/21] dewfew --- packages/mui-docs/src/Link/Link.tsx | 9 -- pnpm-lock.yaml | 198 ++++++++++++++++++++++++++++ 2 files changed, 198 insertions(+), 9 deletions(-) diff --git a/packages/mui-docs/src/Link/Link.tsx b/packages/mui-docs/src/Link/Link.tsx index 666342a1c44e82..e01198ea3ce51a 100644 --- a/packages/mui-docs/src/Link/Link.tsx +++ b/packages/mui-docs/src/Link/Link.tsx @@ -96,19 +96,10 @@ const Link = React.forwardRef(function Link(props, [activeClassName]: shouldBeActive && activeClassName, }); - const isExternal = - typeof href === 'string' && (href.indexOf('http') === 0 || href.indexOf('mailto:') === 0); const userLanguage = useUserLanguage(); const { LANGUAGES_IGNORE_PAGES } = useDocsConfig(); - if (isExternal) { - if (noLinkStyle) { - return ; - } - - return ; - } let linkAs = linkAsProp || as || (href as string); if ( diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 5951e39d9c169f..1c87e5a5adee77 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -37,6 +37,9 @@ importers: '@slack/bolt': specifier: ^3.17.1 version: 3.17.1 + execa: + specifier: ^8.0.1 + version: 8.0.1 google-auth-library: specifier: ^9.5.0 version: 9.5.0 @@ -1249,6 +1252,9 @@ importers: '@mui/utils': specifier: workspace:^ version: link:../mui-utils/build + clsx: + specifier: ^2.1.0 + version: 2.1.0 nprogress: specifier: ^0.2.0 version: 0.2.0 @@ -1256,9 +1262,18 @@ importers: specifier: ^15.8.1 version: 15.8.1 devDependencies: + '@types/node': + specifier: ^18.19.15 + version: 18.19.15 + '@types/prop-types': + specifier: ^15.7.11 + version: 15.7.11 '@types/react': specifier: ^18.2.55 version: 18.2.55 + next: + specifier: ^14.1.0 + version: 14.1.0(@babel/core@7.23.9)(babel-plugin-macros@3.1.0)(react-dom@18.2.0)(react@18.2.0) react: specifier: ^18.2.0 version: 18.2.0 @@ -5678,6 +5693,10 @@ packages: /@next/env@13.5.1: resolution: {integrity: sha512-CIMWiOTyflFn/GFx33iYXkgLSQsMQZV4jB91qaj/TfxGaGOXxn8C1j72TaUSPIyN7ziS/AYG46kGmnvuk1oOpg==} + /@next/env@14.1.0: + resolution: {integrity: sha512-Py8zIo+02ht82brwwhTg36iogzFqGLPXlRGKQw5s+qP/kMNc4MAyDeEwBKDijk6zTIbegEgu8Qy7C1LboslQAw==} + dev: true + /@next/eslint-plugin-next@14.1.0: resolution: {integrity: sha512-x4FavbNEeXx/baD/zC/SdrvkjSby8nBn8KcCREqk6UuwvwoAPZmaV8TFCAuo/cpovBRTIY67mHhe86MQQm/68Q==} dependencies: @@ -5692,6 +5711,15 @@ packages: requiresBuild: true optional: true + /@next/swc-darwin-arm64@14.1.0: + resolution: {integrity: sha512-nUDn7TOGcIeyQni6lZHfzNoo9S0euXnu0jhsbMOmMJUBfgsnESdjN97kM7cBqQxZa8L/bM9om/S5/1dzCrW6wQ==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + /@next/swc-darwin-x64@13.5.1: resolution: {integrity: sha512-uvTZrZa4D0bdWa1jJ7X1tBGIxzpqSnw/ATxWvoRO9CVBvXSx87JyuISY+BWsfLFF59IRodESdeZwkWM2l6+Kjg==} engines: {node: '>= 10'} @@ -5700,6 +5728,15 @@ packages: requiresBuild: true optional: true + /@next/swc-darwin-x64@14.1.0: + resolution: {integrity: sha512-1jgudN5haWxiAl3O1ljUS2GfupPmcftu2RYJqZiMJmmbBT5M1XDffjUtRUzP4W3cBHsrvkfOFdQ71hAreNQP6g==} + engines: {node: '>= 10'} + cpu: [x64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + /@next/swc-linux-arm64-gnu@13.5.1: resolution: {integrity: sha512-/52ThlqdORPQt3+AlMoO+omicdYyUEDeRDGPAj86ULpV4dg+/GCFCKAmFWT0Q4zChFwsAoZUECLcKbRdcc0SNg==} engines: {node: '>= 10'} @@ -5708,6 +5745,15 @@ packages: requiresBuild: true optional: true + /@next/swc-linux-arm64-gnu@14.1.0: + resolution: {integrity: sha512-RHo7Tcj+jllXUbK7xk2NyIDod3YcCPDZxj1WLIYxd709BQ7WuRYl3OWUNG+WUfqeQBds6kvZYlc42NJJTNi4tQ==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: true + optional: true + /@next/swc-linux-arm64-musl@13.5.1: resolution: {integrity: sha512-L4qNXSOHeu1hEAeeNsBgIYVnvm0gg9fj2O2Yx/qawgQEGuFBfcKqlmIE/Vp8z6gwlppxz5d7v6pmHs1NB6R37w==} engines: {node: '>= 10'} @@ -5716,6 +5762,15 @@ packages: requiresBuild: true optional: true + /@next/swc-linux-arm64-musl@14.1.0: + resolution: {integrity: sha512-v6kP8sHYxjO8RwHmWMJSq7VZP2nYCkRVQ0qolh2l6xroe9QjbgV8siTbduED4u0hlk0+tjS6/Tuy4n5XCp+l6g==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: true + optional: true + /@next/swc-linux-x64-gnu@13.5.1: resolution: {integrity: sha512-QVvMrlrFFYvLtABk092kcZ5Mzlmsk2+SV3xYuAu8sbTuIoh0U2+HGNhVklmuYCuM3DAAxdiMQTNlRQmNH11udw==} engines: {node: '>= 10'} @@ -5724,6 +5779,15 @@ packages: requiresBuild: true optional: true + /@next/swc-linux-x64-gnu@14.1.0: + resolution: {integrity: sha512-zJ2pnoFYB1F4vmEVlb/eSe+VH679zT1VdXlZKX+pE66grOgjmKJHKacf82g/sWE4MQ4Rk2FMBCRnX+l6/TVYzQ==} + engines: {node: '>= 10'} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: true + optional: true + /@next/swc-linux-x64-musl@13.5.1: resolution: {integrity: sha512-bBnr+XuWc28r9e8gQ35XBtyi5KLHLhTbEvrSgcWna8atI48sNggjIK8IyiEBO3KIrcUVXYkldAzGXPEYMnKt1g==} engines: {node: '>= 10'} @@ -5732,6 +5796,15 @@ packages: requiresBuild: true optional: true + /@next/swc-linux-x64-musl@14.1.0: + resolution: {integrity: sha512-rbaIYFt2X9YZBSbH/CwGAjbBG2/MrACCVu2X0+kSykHzHnYH5FjHxwXLkcoJ10cX0aWCEynpu+rP76x0914atg==} + engines: {node: '>= 10'} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: true + optional: true + /@next/swc-win32-arm64-msvc@13.5.1: resolution: {integrity: sha512-EQGeE4S5c9v06jje9gr4UlxqUEA+zrsgPi6kg9VwR+dQHirzbnVJISF69UfKVkmLntknZJJI9XpWPB6q0Z7mTg==} engines: {node: '>= 10'} @@ -5740,6 +5813,15 @@ packages: requiresBuild: true optional: true + /@next/swc-win32-arm64-msvc@14.1.0: + resolution: {integrity: sha512-o1N5TsYc8f/HpGt39OUQpQ9AKIGApd3QLueu7hXk//2xq5Z9OxmV6sQfNp8C7qYmiOlHYODOGqNNa0e9jvchGQ==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [win32] + requiresBuild: true + dev: true + optional: true + /@next/swc-win32-ia32-msvc@13.5.1: resolution: {integrity: sha512-1y31Q6awzofVjmbTLtRl92OX3s+W0ZfO8AP8fTnITcIo9a6ATDc/eqa08fd6tSpFu6IFpxOBbdevOjwYTGx/AQ==} engines: {node: '>= 10'} @@ -5748,6 +5830,15 @@ packages: requiresBuild: true optional: true + /@next/swc-win32-ia32-msvc@14.1.0: + resolution: {integrity: sha512-XXIuB1DBRCFwNO6EEzCTMHT5pauwaSj4SWs7CYnME57eaReAKBXCnkUE80p/pAZcewm7hs+vGvNqDPacEXHVkw==} + engines: {node: '>= 10'} + cpu: [ia32] + os: [win32] + requiresBuild: true + dev: true + optional: true + /@next/swc-win32-x64-msvc@13.5.1: resolution: {integrity: sha512-+9XBQizy7X/GuwNegq+5QkkxAPV7SBsIwapVRQd9WSvvU20YO23B3bZUpevdabi4fsd25y9RJDDncljy/V54ww==} engines: {node: '>= 10'} @@ -5756,6 +5847,15 @@ packages: requiresBuild: true optional: true + /@next/swc-win32-x64-msvc@14.1.0: + resolution: {integrity: sha512-9WEbVRRAqJ3YFVqEZIxUqkiO8l1nool1LmNxygr5HWF8AcSYsEpneUDhmjUVJEzO2A04+oPtZdombzzPPkTtgg==} + engines: {node: '>= 10'} + cpu: [x64] + os: [win32] + requiresBuild: true + dev: true + optional: true + /@nicolo-ribaudo/chokidar-2@2.1.8-no-fsevents.3: resolution: {integrity: sha512-s88O1aVtXftvp5bCPB7WnmXc5IwOZZ7YPuwNPt+GtOOXpPvad1LfbmjYv+qII7zP6RU2QGnqve27dnLycEnyEQ==} requiresBuild: true @@ -11947,6 +12047,21 @@ packages: signal-exit: 3.0.7 strip-final-newline: 2.0.0 + /execa@8.0.1: + resolution: {integrity: sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==} + engines: {node: '>=16.17'} + dependencies: + cross-spawn: 7.0.3 + get-stream: 8.0.1 + human-signals: 5.0.0 + is-stream: 3.0.0 + merge-stream: 2.0.0 + npm-run-path: 5.2.0 + onetime: 6.0.0 + signal-exit: 4.1.0 + strip-final-newline: 3.0.0 + dev: false + /expand-brackets@2.1.4: resolution: {integrity: sha512-w/ozOKR9Obk3qoWeY/WDi6MFta9AoMR+zud60mdnbniMcBxRuFJyDt2LdX/14A1UABeqk+Uk+LDfUpvoGKppZA==} engines: {node: '>=0.10.0'} @@ -12599,6 +12714,11 @@ packages: resolution: {integrity: sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==} engines: {node: '>=10'} + /get-stream@8.0.1: + resolution: {integrity: sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==} + engines: {node: '>=16'} + dev: false + /get-symbol-description@1.0.0: resolution: {integrity: sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw==} engines: {node: '>= 0.4'} @@ -13306,6 +13426,11 @@ packages: resolution: {integrity: sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==} engines: {node: '>=10.17.0'} + /human-signals@5.0.0: + resolution: {integrity: sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==} + engines: {node: '>=16.17.0'} + dev: false + /humanize-ms@1.2.1: resolution: {integrity: sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ==} dependencies: @@ -13851,6 +13976,11 @@ packages: resolution: {integrity: sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==} engines: {node: '>=8'} + /is-stream@3.0.0: + resolution: {integrity: sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + dev: false + /is-string@1.0.7: resolution: {integrity: sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==} engines: {node: '>= 0.4'} @@ -15853,6 +15983,11 @@ packages: resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==} engines: {node: '>=6'} + /mimic-fn@4.0.0: + resolution: {integrity: sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==} + engines: {node: '>=12'} + dev: false + /mimic-response@1.0.1: resolution: {integrity: sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==} engines: {node: '>=4'} @@ -16211,6 +16346,45 @@ packages: - '@babel/core' - babel-plugin-macros + /next@14.1.0(@babel/core@7.23.9)(babel-plugin-macros@3.1.0)(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-wlzrsbfeSU48YQBjZhDzOwhWhGsy+uQycR8bHAOt1LY1bn3zZEcDyHQOEoN3aWzQ8LHCAJ1nqrWCc9XF2+O45Q==} + engines: {node: '>=18.17.0'} + hasBin: true + peerDependencies: + '@opentelemetry/api': ^1.1.0 + react: ^18.2.0 + react-dom: ^18.2.0 + sass: ^1.3.0 + peerDependenciesMeta: + '@opentelemetry/api': + optional: true + sass: + optional: true + dependencies: + '@next/env': 14.1.0 + '@swc/helpers': 0.5.2 + busboy: 1.6.0 + caniuse-lite: 1.0.30001579 + graceful-fs: 4.2.11 + postcss: 8.4.31 + react: 18.2.0 + react-dom: 18.2.0(react@18.2.0) + styled-jsx: 5.1.1(@babel/core@7.23.9)(babel-plugin-macros@3.1.0)(react@18.2.0) + optionalDependencies: + '@next/swc-darwin-arm64': 14.1.0 + '@next/swc-darwin-x64': 14.1.0 + '@next/swc-linux-arm64-gnu': 14.1.0 + '@next/swc-linux-arm64-musl': 14.1.0 + '@next/swc-linux-x64-gnu': 14.1.0 + '@next/swc-linux-x64-musl': 14.1.0 + '@next/swc-win32-arm64-msvc': 14.1.0 + '@next/swc-win32-ia32-msvc': 14.1.0 + '@next/swc-win32-x64-msvc': 14.1.0 + transitivePeerDependencies: + - '@babel/core' + - babel-plugin-macros + dev: true + /nice-napi@1.0.2: resolution: {integrity: sha512-px/KnJAJZf5RuBGcfD+Sp2pAKq0ytz8j+1NehvgIGFkvtvFrDM3T8E4x/JJODXK9WZow8RRGrbA9QQ3hs+pDhA==} os: ['!win32'] @@ -16551,6 +16725,13 @@ packages: dependencies: path-key: 3.1.1 + /npm-run-path@5.2.0: + resolution: {integrity: sha512-W4/tgAXFqFA0iL7fk0+uQ3g7wkL8xJmx3XdK0VGb4cHW//eZTtKGvFBBoRKVTpY7n6ze4NL9ly7rgXcHufqXKg==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + dependencies: + path-key: 4.0.0 + dev: false + /npmlog@6.0.2: resolution: {integrity: sha512-/vBvz5Jfr9dT/aFWd0FIRf+T/Q2WBsLENygUaFUqstqsycmZAP/t5BvFJTK0viFmSUxiUKTUplWy5vt+rvKIxg==} engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} @@ -16831,6 +17012,13 @@ packages: dependencies: mimic-fn: 2.1.0 + /onetime@6.0.0: + resolution: {integrity: sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==} + engines: {node: '>=12'} + dependencies: + mimic-fn: 4.0.0 + dev: false + /open@6.4.0: resolution: {integrity: sha512-IFenVPgF70fSm1keSd2iDBIDIBZkroLeuffXq+wKTzTJlBpesFWojV9lb8mzOfaAzM1sr7HQHuO0vtV0zYekGg==} engines: {node: '>=8'} @@ -17247,6 +17435,11 @@ packages: resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} engines: {node: '>=8'} + /path-key@4.0.0: + resolution: {integrity: sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==} + engines: {node: '>=12'} + dev: false + /path-parse@1.0.7: resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} @@ -19823,6 +20016,11 @@ packages: resolution: {integrity: sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==} engines: {node: '>=6'} + /strip-final-newline@3.0.0: + resolution: {integrity: sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==} + engines: {node: '>=12'} + dev: false + /strip-indent@3.0.0: resolution: {integrity: sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==} engines: {node: '>=8'} From f28f39ae2392816e641e33274cb454c8eefe5565 Mon Sep 17 00:00:00 2001 From: MUI bot <2109932+Janpot@users.noreply.github.com> Date: Tue, 13 Feb 2024 13:59:48 +0100 Subject: [PATCH 14/21] i18n --- packages/mui-docs/src/i18n/{index.tsx => i18n.tsx} | 0 packages/mui-docs/src/i18n/index.ts | 1 + 2 files changed, 1 insertion(+) rename packages/mui-docs/src/i18n/{index.tsx => i18n.tsx} (100%) create mode 100644 packages/mui-docs/src/i18n/index.ts diff --git a/packages/mui-docs/src/i18n/index.tsx b/packages/mui-docs/src/i18n/i18n.tsx similarity index 100% rename from packages/mui-docs/src/i18n/index.tsx rename to packages/mui-docs/src/i18n/i18n.tsx diff --git a/packages/mui-docs/src/i18n/index.ts b/packages/mui-docs/src/i18n/index.ts new file mode 100644 index 00000000000000..8f7cbe2c7026fc --- /dev/null +++ b/packages/mui-docs/src/i18n/index.ts @@ -0,0 +1 @@ +export * from './i18n' From 43a35f3e7b4274a24ae38a268becbc571218a73f Mon Sep 17 00:00:00 2001 From: MUI bot <2109932+Janpot@users.noreply.github.com> Date: Tue, 13 Feb 2024 14:56:31 +0100 Subject: [PATCH 15/21] prettier --- packages/mui-docs/src/Link/Link.tsx | 1 - packages/mui-docs/src/i18n/index.ts | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/mui-docs/src/Link/Link.tsx b/packages/mui-docs/src/Link/Link.tsx index e01198ea3ce51a..003c8e376d302a 100644 --- a/packages/mui-docs/src/Link/Link.tsx +++ b/packages/mui-docs/src/Link/Link.tsx @@ -100,7 +100,6 @@ const Link = React.forwardRef(function Link(props, const { LANGUAGES_IGNORE_PAGES } = useDocsConfig(); - let linkAs = linkAsProp || as || (href as string); if ( userLanguage !== 'en' && diff --git a/packages/mui-docs/src/i18n/index.ts b/packages/mui-docs/src/i18n/index.ts index 8f7cbe2c7026fc..e82230f1bf136f 100644 --- a/packages/mui-docs/src/i18n/index.ts +++ b/packages/mui-docs/src/i18n/index.ts @@ -1 +1 @@ -export * from './i18n' +export * from './i18n'; From 4e8bf859bf8860bb05bd1d9db25135534e96bba1 Mon Sep 17 00:00:00 2001 From: MUI bot <2109932+Janpot@users.noreply.github.com> Date: Tue, 13 Feb 2024 14:59:26 +0100 Subject: [PATCH 16/21] next.js version --- packages/mui-docs/package.json | 2 +- pnpm-lock.yaml | 128 +-------------------------------- 2 files changed, 3 insertions(+), 127 deletions(-) diff --git a/packages/mui-docs/package.json b/packages/mui-docs/package.json index f4d4c82904a96f..7ee14989031bb0 100644 --- a/packages/mui-docs/package.json +++ b/packages/mui-docs/package.json @@ -46,7 +46,7 @@ "@types/node": "^18.19.10", "@types/prop-types": "^15.7.11", "@types/react": "^18.2.55", - "next": "^14.1.0", + "next": "^13.5.1", "react": "^18.2.0" }, "peerDependencies": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1c87e5a5adee77..7928d75a59c164 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1272,8 +1272,8 @@ importers: specifier: ^18.2.55 version: 18.2.55 next: - specifier: ^14.1.0 - version: 14.1.0(@babel/core@7.23.9)(babel-plugin-macros@3.1.0)(react-dom@18.2.0)(react@18.2.0) + specifier: ^13.5.1 + version: 13.5.1(@babel/core@7.23.9)(babel-plugin-macros@3.1.0)(react-dom@18.2.0)(react@18.2.0) react: specifier: ^18.2.0 version: 18.2.0 @@ -5693,10 +5693,6 @@ packages: /@next/env@13.5.1: resolution: {integrity: sha512-CIMWiOTyflFn/GFx33iYXkgLSQsMQZV4jB91qaj/TfxGaGOXxn8C1j72TaUSPIyN7ziS/AYG46kGmnvuk1oOpg==} - /@next/env@14.1.0: - resolution: {integrity: sha512-Py8zIo+02ht82brwwhTg36iogzFqGLPXlRGKQw5s+qP/kMNc4MAyDeEwBKDijk6zTIbegEgu8Qy7C1LboslQAw==} - dev: true - /@next/eslint-plugin-next@14.1.0: resolution: {integrity: sha512-x4FavbNEeXx/baD/zC/SdrvkjSby8nBn8KcCREqk6UuwvwoAPZmaV8TFCAuo/cpovBRTIY67mHhe86MQQm/68Q==} dependencies: @@ -5711,15 +5707,6 @@ packages: requiresBuild: true optional: true - /@next/swc-darwin-arm64@14.1.0: - resolution: {integrity: sha512-nUDn7TOGcIeyQni6lZHfzNoo9S0euXnu0jhsbMOmMJUBfgsnESdjN97kM7cBqQxZa8L/bM9om/S5/1dzCrW6wQ==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - requiresBuild: true - dev: true - optional: true - /@next/swc-darwin-x64@13.5.1: resolution: {integrity: sha512-uvTZrZa4D0bdWa1jJ7X1tBGIxzpqSnw/ATxWvoRO9CVBvXSx87JyuISY+BWsfLFF59IRodESdeZwkWM2l6+Kjg==} engines: {node: '>= 10'} @@ -5728,15 +5715,6 @@ packages: requiresBuild: true optional: true - /@next/swc-darwin-x64@14.1.0: - resolution: {integrity: sha512-1jgudN5haWxiAl3O1ljUS2GfupPmcftu2RYJqZiMJmmbBT5M1XDffjUtRUzP4W3cBHsrvkfOFdQ71hAreNQP6g==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - requiresBuild: true - dev: true - optional: true - /@next/swc-linux-arm64-gnu@13.5.1: resolution: {integrity: sha512-/52ThlqdORPQt3+AlMoO+omicdYyUEDeRDGPAj86ULpV4dg+/GCFCKAmFWT0Q4zChFwsAoZUECLcKbRdcc0SNg==} engines: {node: '>= 10'} @@ -5745,15 +5723,6 @@ packages: requiresBuild: true optional: true - /@next/swc-linux-arm64-gnu@14.1.0: - resolution: {integrity: sha512-RHo7Tcj+jllXUbK7xk2NyIDod3YcCPDZxj1WLIYxd709BQ7WuRYl3OWUNG+WUfqeQBds6kvZYlc42NJJTNi4tQ==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - requiresBuild: true - dev: true - optional: true - /@next/swc-linux-arm64-musl@13.5.1: resolution: {integrity: sha512-L4qNXSOHeu1hEAeeNsBgIYVnvm0gg9fj2O2Yx/qawgQEGuFBfcKqlmIE/Vp8z6gwlppxz5d7v6pmHs1NB6R37w==} engines: {node: '>= 10'} @@ -5762,15 +5731,6 @@ packages: requiresBuild: true optional: true - /@next/swc-linux-arm64-musl@14.1.0: - resolution: {integrity: sha512-v6kP8sHYxjO8RwHmWMJSq7VZP2nYCkRVQ0qolh2l6xroe9QjbgV8siTbduED4u0hlk0+tjS6/Tuy4n5XCp+l6g==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - requiresBuild: true - dev: true - optional: true - /@next/swc-linux-x64-gnu@13.5.1: resolution: {integrity: sha512-QVvMrlrFFYvLtABk092kcZ5Mzlmsk2+SV3xYuAu8sbTuIoh0U2+HGNhVklmuYCuM3DAAxdiMQTNlRQmNH11udw==} engines: {node: '>= 10'} @@ -5779,15 +5739,6 @@ packages: requiresBuild: true optional: true - /@next/swc-linux-x64-gnu@14.1.0: - resolution: {integrity: sha512-zJ2pnoFYB1F4vmEVlb/eSe+VH679zT1VdXlZKX+pE66grOgjmKJHKacf82g/sWE4MQ4Rk2FMBCRnX+l6/TVYzQ==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - requiresBuild: true - dev: true - optional: true - /@next/swc-linux-x64-musl@13.5.1: resolution: {integrity: sha512-bBnr+XuWc28r9e8gQ35XBtyi5KLHLhTbEvrSgcWna8atI48sNggjIK8IyiEBO3KIrcUVXYkldAzGXPEYMnKt1g==} engines: {node: '>= 10'} @@ -5796,15 +5747,6 @@ packages: requiresBuild: true optional: true - /@next/swc-linux-x64-musl@14.1.0: - resolution: {integrity: sha512-rbaIYFt2X9YZBSbH/CwGAjbBG2/MrACCVu2X0+kSykHzHnYH5FjHxwXLkcoJ10cX0aWCEynpu+rP76x0914atg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - requiresBuild: true - dev: true - optional: true - /@next/swc-win32-arm64-msvc@13.5.1: resolution: {integrity: sha512-EQGeE4S5c9v06jje9gr4UlxqUEA+zrsgPi6kg9VwR+dQHirzbnVJISF69UfKVkmLntknZJJI9XpWPB6q0Z7mTg==} engines: {node: '>= 10'} @@ -5813,15 +5755,6 @@ packages: requiresBuild: true optional: true - /@next/swc-win32-arm64-msvc@14.1.0: - resolution: {integrity: sha512-o1N5TsYc8f/HpGt39OUQpQ9AKIGApd3QLueu7hXk//2xq5Z9OxmV6sQfNp8C7qYmiOlHYODOGqNNa0e9jvchGQ==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - requiresBuild: true - dev: true - optional: true - /@next/swc-win32-ia32-msvc@13.5.1: resolution: {integrity: sha512-1y31Q6awzofVjmbTLtRl92OX3s+W0ZfO8AP8fTnITcIo9a6ATDc/eqa08fd6tSpFu6IFpxOBbdevOjwYTGx/AQ==} engines: {node: '>= 10'} @@ -5830,15 +5763,6 @@ packages: requiresBuild: true optional: true - /@next/swc-win32-ia32-msvc@14.1.0: - resolution: {integrity: sha512-XXIuB1DBRCFwNO6EEzCTMHT5pauwaSj4SWs7CYnME57eaReAKBXCnkUE80p/pAZcewm7hs+vGvNqDPacEXHVkw==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - requiresBuild: true - dev: true - optional: true - /@next/swc-win32-x64-msvc@13.5.1: resolution: {integrity: sha512-+9XBQizy7X/GuwNegq+5QkkxAPV7SBsIwapVRQd9WSvvU20YO23B3bZUpevdabi4fsd25y9RJDDncljy/V54ww==} engines: {node: '>= 10'} @@ -5847,15 +5771,6 @@ packages: requiresBuild: true optional: true - /@next/swc-win32-x64-msvc@14.1.0: - resolution: {integrity: sha512-9WEbVRRAqJ3YFVqEZIxUqkiO8l1nool1LmNxygr5HWF8AcSYsEpneUDhmjUVJEzO2A04+oPtZdombzzPPkTtgg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - requiresBuild: true - dev: true - optional: true - /@nicolo-ribaudo/chokidar-2@2.1.8-no-fsevents.3: resolution: {integrity: sha512-s88O1aVtXftvp5bCPB7WnmXc5IwOZZ7YPuwNPt+GtOOXpPvad1LfbmjYv+qII7zP6RU2QGnqve27dnLycEnyEQ==} requiresBuild: true @@ -16346,45 +16261,6 @@ packages: - '@babel/core' - babel-plugin-macros - /next@14.1.0(@babel/core@7.23.9)(babel-plugin-macros@3.1.0)(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-wlzrsbfeSU48YQBjZhDzOwhWhGsy+uQycR8bHAOt1LY1bn3zZEcDyHQOEoN3aWzQ8LHCAJ1nqrWCc9XF2+O45Q==} - engines: {node: '>=18.17.0'} - hasBin: true - peerDependencies: - '@opentelemetry/api': ^1.1.0 - react: ^18.2.0 - react-dom: ^18.2.0 - sass: ^1.3.0 - peerDependenciesMeta: - '@opentelemetry/api': - optional: true - sass: - optional: true - dependencies: - '@next/env': 14.1.0 - '@swc/helpers': 0.5.2 - busboy: 1.6.0 - caniuse-lite: 1.0.30001579 - graceful-fs: 4.2.11 - postcss: 8.4.31 - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - styled-jsx: 5.1.1(@babel/core@7.23.9)(babel-plugin-macros@3.1.0)(react@18.2.0) - optionalDependencies: - '@next/swc-darwin-arm64': 14.1.0 - '@next/swc-darwin-x64': 14.1.0 - '@next/swc-linux-arm64-gnu': 14.1.0 - '@next/swc-linux-arm64-musl': 14.1.0 - '@next/swc-linux-x64-gnu': 14.1.0 - '@next/swc-linux-x64-musl': 14.1.0 - '@next/swc-win32-arm64-msvc': 14.1.0 - '@next/swc-win32-ia32-msvc': 14.1.0 - '@next/swc-win32-x64-msvc': 14.1.0 - transitivePeerDependencies: - - '@babel/core' - - babel-plugin-macros - dev: true - /nice-napi@1.0.2: resolution: {integrity: sha512-px/KnJAJZf5RuBGcfD+Sp2pAKq0ytz8j+1NehvgIGFkvtvFrDM3T8E4x/JJODXK9WZow8RRGrbA9QQ3hs+pDhA==} os: ['!win32'] From 6f51d9d24dbb43929c32bede12bc5d7ad38be295 Mon Sep 17 00:00:00 2001 From: MUI bot <2109932+Janpot@users.noreply.github.com> Date: Tue, 13 Feb 2024 15:02:22 +0100 Subject: [PATCH 17/21] Update package.json --- packages/mui-docs/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/mui-docs/package.json b/packages/mui-docs/package.json index 7ee14989031bb0..f90cfbd3d19c12 100644 --- a/packages/mui-docs/package.json +++ b/packages/mui-docs/package.json @@ -52,7 +52,7 @@ "peerDependencies": { "@mui/material": "workspace:^", "@types/react": "^17.0.0 || ^18.0.0", - "next": "13.4.19", + "next": "^13.5.1", "react": "^17.0.0 || ^18.0.0" }, "peerDependenciesMeta": { From a2bc301e804ec3bec9685a61383758e692680c82 Mon Sep 17 00:00:00 2001 From: MUI bot <2109932+Janpot@users.noreply.github.com> Date: Tue, 13 Feb 2024 17:20:13 +0100 Subject: [PATCH 18/21] allocate more mem --- .circleci/config.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 83ecb0ec835077..6a93b0944e60b6 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -260,6 +260,8 @@ jobs: - run: name: Tests TypeScript definitions command: pnpm typescript:ci + environment: + NODE_OPTIONS: --max-old-space-size=3072 - run: name: Test module augmentation command: | From 84ac596dcff021dfeab21c36a90ba99e7af0d918 Mon Sep 17 00:00:00 2001 From: MUI bot <2109932+Janpot@users.noreply.github.com> Date: Thu, 15 Feb 2024 13:47:26 +0100 Subject: [PATCH 19/21] Update package.json --- docs/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/package.json b/docs/package.json index 9fdeea3aa9d4aa..e455c69ab4efaa 100644 --- a/docs/package.json +++ b/docs/package.json @@ -5,7 +5,7 @@ "author": "MUI Team", "license": "MIT", "scripts": { - "build": "rimraf docs/export && cross-env NODE_ENV=production NODE_OPTIONS=--max_old_space_size=4096 next build --profile && pnpm build-sw", + "build": "rimraf docs/export && cross-env NODE_ENV=production NODE_OPTIONS=--max_old_space_size=6144 next build --profile && pnpm build-sw", "build:clean": "rimraf .next && pnpm build", "build-sw": "node ./scripts/buildServiceWorker.js", "dev": "next dev", From c8b469eff1415de2345c6539e304ae2977a1f1af Mon Sep 17 00:00:00 2001 From: MUI bot <2109932+Janpot@users.noreply.github.com> Date: Thu, 15 Feb 2024 14:44:41 +0100 Subject: [PATCH 20/21] remove default export for Link --- docs/data/material/components/material-icons/SearchIcons.js | 2 +- .../supported-components/MaterialUIComponents.js | 2 +- docs/pages/blog.tsx | 2 +- docs/pages/careers.tsx | 2 +- docs/pages/components.tsx | 2 +- docs/pages/experiments/index.js | 2 +- docs/src/components/about/AboutEnd.tsx | 2 +- docs/src/components/about/HowToSupport.tsx | 2 +- docs/src/components/about/OurValues.tsx | 2 +- docs/src/components/about/Team.tsx | 2 +- docs/src/components/action/ComponentShowcaseCard.tsx | 2 +- docs/src/components/action/StylingInfo.tsx | 2 +- docs/src/components/banner/AppFrameBanner.tsx | 2 +- docs/src/components/banner/AppHeaderBanner.tsx | 2 +- docs/src/components/banner/TableOfContentsBanner.tsx | 2 +- docs/src/components/header/HeaderNavBar.tsx | 2 +- docs/src/components/header/HeaderNavDropdown.tsx | 2 +- docs/src/components/home/DiamondSponsors.tsx | 2 +- docs/src/components/home/GetStartedButtons.tsx | 2 +- docs/src/components/home/GoldSponsors.tsx | 2 +- docs/src/components/home/MaterialDesignComponents.tsx | 2 +- docs/src/components/home/ProductsSwitcher.tsx | 2 +- docs/src/components/home/SponsorCard.tsx | 2 +- docs/src/components/pricing/EarlyBird.tsx | 2 +- docs/src/components/pricing/PricingList.tsx | 2 +- docs/src/components/pricing/PricingTable.tsx | 2 +- docs/src/components/pricing/PricingWhatToExpect.tsx | 2 +- docs/src/components/productBaseUI/BaseUIHero.tsx | 2 +- docs/src/components/productBaseUI/BaseUITestimonial.tsx | 2 +- docs/src/components/productBaseUI/BaseUIThemesDemo.tsx | 2 +- docs/src/components/productDesignKit/DesignKitDemo.tsx | 2 +- docs/src/components/productDesignKit/DesignKitHero.tsx | 2 +- docs/src/components/productMaterial/MaterialDesignKits.tsx | 2 +- docs/src/components/productMaterial/MaterialEnd.tsx | 2 +- docs/src/components/productMaterial/MaterialHero.tsx | 2 +- docs/src/components/productMaterial/MaterialTemplates.tsx | 2 +- docs/src/components/productTemplate/TemplateDemo.tsx | 2 +- docs/src/components/productTemplate/TemplateHero.tsx | 2 +- docs/src/components/productX/XComponentsSwitcher.tsx | 2 +- docs/src/components/productX/XDataGrid.tsx | 2 +- docs/src/components/productX/XRoadmap.tsx | 2 +- docs/src/layouts/AppFooter.tsx | 2 +- docs/src/layouts/AppHeader.tsx | 2 +- docs/src/modules/components/AppLayoutDocsFooter.js | 2 +- docs/src/modules/components/AppNavDrawerItem.js | 2 +- docs/src/modules/components/AppSearch.js | 2 +- docs/src/modules/components/AppTableOfContents.js | 2 +- docs/src/modules/components/BaseUIComponents.js | 2 +- docs/src/modules/components/ComponentPageTabs.js | 2 +- docs/src/modules/components/DiamondSponsors.js | 2 +- docs/src/modules/components/Link.tsx | 2 +- docs/src/modules/components/MaterialShowcase.js | 2 +- docs/src/modules/components/MuiProductSelector.tsx | 2 +- docs/src/modules/components/TopLayoutBlog.js | 2 +- docs/src/modules/components/TopLayoutCareers.js | 2 +- docs/src/pages/versions/LatestVersions.js | 2 +- docs/src/pages/versions/ReleasedVersions.js | 2 +- packages/mui-docs/src/Link/Link.tsx | 4 +--- packages/mui-docs/src/Link/index.ts | 1 - 59 files changed, 58 insertions(+), 61 deletions(-) diff --git a/docs/data/material/components/material-icons/SearchIcons.js b/docs/data/material/components/material-icons/SearchIcons.js index 6121f6881e83e3..fc2d1f34e158a5 100644 --- a/docs/data/material/components/material-icons/SearchIcons.js +++ b/docs/data/material/components/material-icons/SearchIcons.js @@ -21,7 +21,7 @@ import RadioGroup from '@mui/material/RadioGroup'; import Radio from '@mui/material/Radio'; import SvgIcon from '@mui/material/SvgIcon'; import * as mui from '@mui/icons-material'; -import Link from '@mui/docs/Link'; +import { Link } from '@mui/docs/Link'; import { useTranslate } from '@mui/docs/i18n'; import useQueryParameterState from 'docs/src/modules/utils/useQueryParameterState'; // For Debugging diff --git a/docs/data/material/getting-started/supported-components/MaterialUIComponents.js b/docs/data/material/getting-started/supported-components/MaterialUIComponents.js index 9584c933112cdb..d9d8fab9e425e4 100644 --- a/docs/data/material/getting-started/supported-components/MaterialUIComponents.js +++ b/docs/data/material/getting-started/supported-components/MaterialUIComponents.js @@ -6,7 +6,7 @@ import TableCell from '@mui/material/TableCell'; import TableRow from '@mui/material/TableRow'; import Paper from '@mui/material/Paper'; import Typography from '@mui/material/Typography'; -import Link from '@mui/docs/Link'; +import { Link } from '@mui/docs/Link'; const components = [ { diff --git a/docs/pages/blog.tsx b/docs/pages/blog.tsx index 3682a4f90a6aa9..43cb1ccd3ca02d 100644 --- a/docs/pages/blog.tsx +++ b/docs/pages/blog.tsx @@ -25,7 +25,7 @@ import GradientText from 'docs/src/components/typography/GradientText'; import BrandingCssVarsProvider from 'docs/src/BrandingCssVarsProvider'; import { authors as AUTHORS } from 'docs/src/modules/components/TopLayoutBlog'; import HeroEnd from 'docs/src/components/home/HeroEnd'; -import Link from '@mui/docs/Link'; +import { Link } from '@mui/docs/Link'; import generateRssFeed from 'docs/scripts/generateRSSFeed'; import Section from 'docs/src/layouts/Section'; import { getAllBlogPosts, BlogPost } from 'docs/lib/sourcing'; diff --git a/docs/pages/careers.tsx b/docs/pages/careers.tsx index 8792e720994d4c..0f1e1d90e3210c 100644 --- a/docs/pages/careers.tsx +++ b/docs/pages/careers.tsx @@ -14,7 +14,7 @@ import MuiAccordion from '@mui/material/Accordion'; import MuiAccordionSummary from '@mui/material/AccordionSummary'; import MuiAccordionDetail from '@mui/material/AccordionDetails'; import OurValues from 'docs/src/components/about/OurValues'; -import Link from '@mui/docs/Link'; +import { Link } from '@mui/docs/Link'; import AppHeader from 'docs/src/layouts/AppHeader'; import AppFooter from 'docs/src/layouts/AppFooter'; import GradientText from 'docs/src/components/typography/GradientText'; diff --git a/docs/pages/components.tsx b/docs/pages/components.tsx index ee558ff2266302..bedd316cde428e 100644 --- a/docs/pages/components.tsx +++ b/docs/pages/components.tsx @@ -13,7 +13,7 @@ import BrandingCssVarsProvider from 'docs/src/BrandingCssVarsProvider'; import Section from 'docs/src/layouts/Section'; import { pageToTitleI18n } from 'docs/src/modules/utils/helpers'; import { useTranslate } from '@mui/docs/i18n'; -import Link from '@mui/docs/Link'; +import { Link } from '@mui/docs/Link'; import type { MuiPage } from 'docs/src/MuiPage'; import materialPages from 'docs/data/material/pages'; diff --git a/docs/pages/experiments/index.js b/docs/pages/experiments/index.js index b56f6459e107b1..5ec6b4629925a1 100644 --- a/docs/pages/experiments/index.js +++ b/docs/pages/experiments/index.js @@ -9,7 +9,7 @@ import Container from '@mui/material/Container'; import Typography from '@mui/material/Typography'; import KeyboardArrowRightRounded from '@mui/icons-material/KeyboardArrowRightRounded'; import GradientText from 'docs/src/components/typography/GradientText'; -import Link from '@mui/docs/Link'; +import { Link } from '@mui/docs/Link'; export default function Experiments({ experiments }) { const categories = {}; diff --git a/docs/src/components/about/AboutEnd.tsx b/docs/src/components/about/AboutEnd.tsx index e240841cb09376..02562b245b617a 100644 --- a/docs/src/components/about/AboutEnd.tsx +++ b/docs/src/components/about/AboutEnd.tsx @@ -3,7 +3,7 @@ import Box from '@mui/material/Box'; import Button from '@mui/material/Button'; import Typography from '@mui/material/Typography'; import KeyboardArrowRightRounded from '@mui/icons-material/KeyboardArrowRightRounded'; -import Link from '@mui/docs/Link'; +import { Link } from '@mui/docs/Link'; import GradientText from 'docs/src/components/typography/GradientText'; import ROUTES from 'docs/src/route'; import Section from 'docs/src/layouts/Section'; diff --git a/docs/src/components/about/HowToSupport.tsx b/docs/src/components/about/HowToSupport.tsx index c6df81f7513a8f..9dd95dab85874d 100644 --- a/docs/src/components/about/HowToSupport.tsx +++ b/docs/src/components/about/HowToSupport.tsx @@ -9,7 +9,7 @@ import ForumRoundedIcon from '@mui/icons-material/ForumRounded'; import PeopleRoundedIcon from '@mui/icons-material/PeopleRounded'; import LocalAtmRoundedIcon from '@mui/icons-material/LocalAtmRounded'; import GradientText from 'docs/src/components/typography/GradientText'; -import Link from '@mui/docs/Link'; +import { Link } from '@mui/docs/Link'; import Section from 'docs/src/layouts/Section'; import SectionHeadline from 'docs/src/components/typography/SectionHeadline'; import { GlowingIconContainer } from 'docs/src/components/action/InfoCard'; diff --git a/docs/src/components/about/OurValues.tsx b/docs/src/components/about/OurValues.tsx index 7540b9bdcb6eef..ad9db9243c4c73 100644 --- a/docs/src/components/about/OurValues.tsx +++ b/docs/src/components/about/OurValues.tsx @@ -5,7 +5,7 @@ import Grid from '@mui/material/Grid'; import Paper from '@mui/material/Paper'; import Typography from '@mui/material/Typography'; import KeyboardArrowRightRounded from '@mui/icons-material/KeyboardArrowRightRounded'; -import Link from '@mui/docs/Link'; +import { Link } from '@mui/docs/Link'; import GradientText from 'docs/src/components/typography/GradientText'; import ROUTES from 'docs/src/route'; import Section from 'docs/src/layouts/Section'; diff --git a/docs/src/components/about/Team.tsx b/docs/src/components/about/Team.tsx index f0240a2a85d730..05464dd093739e 100644 --- a/docs/src/components/about/Team.tsx +++ b/docs/src/components/about/Team.tsx @@ -13,7 +13,7 @@ import KeyboardArrowRightRounded from '@mui/icons-material/KeyboardArrowRightRou import XIcon from '@mui/icons-material/X'; import GitHubIcon from '@mui/icons-material/GitHub'; import LinkedInIcon from '@mui/icons-material/LinkedIn'; -import Link from '@mui/docs/Link'; +import { Link } from '@mui/docs/Link'; import ROUTES from 'docs/src/route'; import Section from 'docs/src/layouts/Section'; import SectionHeadline from 'docs/src/components/typography/SectionHeadline'; diff --git a/docs/src/components/action/ComponentShowcaseCard.tsx b/docs/src/components/action/ComponentShowcaseCard.tsx index fabf593f785ea5..ce4be602553222 100644 --- a/docs/src/components/action/ComponentShowcaseCard.tsx +++ b/docs/src/components/action/ComponentShowcaseCard.tsx @@ -5,7 +5,7 @@ import Card from '@mui/material/Card'; import CardMedia from '@mui/material/CardMedia'; import Typography from '@mui/material/Typography'; import Chip from '@mui/material/Chip'; -import Link from '@mui/docs/Link'; +import { Link } from '@mui/docs/Link'; interface ComponentShowcaseCardProps { imgLoading?: 'eager'; diff --git a/docs/src/components/action/StylingInfo.tsx b/docs/src/components/action/StylingInfo.tsx index f50de7defcf718..d5149590ad38d4 100644 --- a/docs/src/components/action/StylingInfo.tsx +++ b/docs/src/components/action/StylingInfo.tsx @@ -5,7 +5,7 @@ import IconButton from '@mui/material/IconButton'; import Typography from '@mui/material/Typography'; import KeyboardArrowUpRounded from '@mui/icons-material/KeyboardArrowUpRounded'; import KeyboardArrowDownRounded from '@mui/icons-material/KeyboardArrowDownRounded'; -import Link from '@mui/docs/Link'; +import { Link } from '@mui/docs/Link'; import ROUTES from 'docs/src/route'; export default function StylingInfo({ diff --git a/docs/src/components/banner/AppFrameBanner.tsx b/docs/src/components/banner/AppFrameBanner.tsx index 0b4dc53a5c4385..139c369d36773b 100644 --- a/docs/src/components/banner/AppFrameBanner.tsx +++ b/docs/src/components/banner/AppFrameBanner.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; import { alpha } from '@mui/material/styles'; -import Link from '@mui/docs/Link'; +import { Link } from '@mui/docs/Link'; import FEATURE_TOGGLE from 'docs/src/featureToggle'; import PageContext from 'docs/src/modules/components/PageContext'; import { convertProductIdToName } from 'docs/src/modules/components/AppSearch'; diff --git a/docs/src/components/banner/AppHeaderBanner.tsx b/docs/src/components/banner/AppHeaderBanner.tsx index 9f66432b697671..ae83ac840550aa 100644 --- a/docs/src/components/banner/AppHeaderBanner.tsx +++ b/docs/src/components/banner/AppHeaderBanner.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; import Typography from '@mui/material/Typography'; -import Link from '@mui/docs/Link'; +import { Link } from '@mui/docs/Link'; import ROUTES from 'docs/src/route'; import FEATURE_TOGGLE from 'docs/src/featureToggle'; diff --git a/docs/src/components/banner/TableOfContentsBanner.tsx b/docs/src/components/banner/TableOfContentsBanner.tsx index f9934c093a7ac1..66f492e4b3ca8b 100644 --- a/docs/src/components/banner/TableOfContentsBanner.tsx +++ b/docs/src/components/banner/TableOfContentsBanner.tsx @@ -2,7 +2,7 @@ import * as React from 'react'; import Box from '@mui/material/Box'; import Typography from '@mui/material/Typography'; import { alpha } from '@mui/material/styles'; -import Link from '@mui/docs/Link'; +import { Link } from '@mui/docs/Link'; import FEATURE_TOGGLE from 'docs/src/featureToggle'; export default function TableOfContentsBanner() { diff --git a/docs/src/components/header/HeaderNavBar.tsx b/docs/src/components/header/HeaderNavBar.tsx index 053d786994e3b9..a5577aa05ab62a 100644 --- a/docs/src/components/header/HeaderNavBar.tsx +++ b/docs/src/components/header/HeaderNavBar.tsx @@ -11,7 +11,7 @@ import Fade from '@mui/material/Fade'; import Typography from '@mui/material/Typography'; import IconImage from 'docs/src/components/icon/IconImage'; import ROUTES from 'docs/src/route'; -import Link from '@mui/docs/Link'; +import { Link } from '@mui/docs/Link'; import MuiProductSelector from 'docs/src/modules/components/MuiProductSelector'; const Navigation = styled('nav')(({ theme }) => [ diff --git a/docs/src/components/header/HeaderNavDropdown.tsx b/docs/src/components/header/HeaderNavDropdown.tsx index 5003fe41925ddc..95fbe4c39c0c70 100644 --- a/docs/src/components/header/HeaderNavDropdown.tsx +++ b/docs/src/components/header/HeaderNavDropdown.tsx @@ -8,7 +8,7 @@ import IconButton from '@mui/material/IconButton'; import Typography from '@mui/material/Typography'; import KeyboardArrowDownRounded from '@mui/icons-material/KeyboardArrowDownRounded'; import SvgHamburgerMenu from 'docs/src/icons/SvgHamburgerMenu'; -import Link from '@mui/docs/Link'; +import { Link } from '@mui/docs/Link'; import ROUTES from 'docs/src/route'; const Anchor = styled('a')<{ component?: React.ElementType; noLinkStyle?: boolean }>( diff --git a/docs/src/components/home/DiamondSponsors.tsx b/docs/src/components/home/DiamondSponsors.tsx index 479f9fbc5413d2..33fe6afb5a059a 100644 --- a/docs/src/components/home/DiamondSponsors.tsx +++ b/docs/src/components/home/DiamondSponsors.tsx @@ -5,7 +5,7 @@ import Paper from '@mui/material/Paper'; import IconButton from '@mui/material/IconButton'; import Typography from '@mui/material/Typography'; import AddRounded from '@mui/icons-material/AddRounded'; -import Link from '@mui/docs/Link'; +import { Link } from '@mui/docs/Link'; import SponsorCard from 'docs/src/components/home/SponsorCard'; const DIAMONDs = [ diff --git a/docs/src/components/home/GetStartedButtons.tsx b/docs/src/components/home/GetStartedButtons.tsx index ae2a37c714cd7a..0639b8ce5f889f 100644 --- a/docs/src/components/home/GetStartedButtons.tsx +++ b/docs/src/components/home/GetStartedButtons.tsx @@ -5,7 +5,7 @@ import Button from '@mui/material/Button'; import KeyboardArrowRightRounded from '@mui/icons-material/KeyboardArrowRightRounded'; import ContentCopyRounded from '@mui/icons-material/ContentCopyRounded'; import CheckRounded from '@mui/icons-material/CheckRounded'; -import Link from '@mui/docs/Link'; +import { Link } from '@mui/docs/Link'; import NpmCopyButton from 'docs/src/components/action/NpmCopyButton'; interface GetStartedButtonsProps extends BoxProps { diff --git a/docs/src/components/home/GoldSponsors.tsx b/docs/src/components/home/GoldSponsors.tsx index cdb51c7641fa2a..0e2297f968fbb9 100644 --- a/docs/src/components/home/GoldSponsors.tsx +++ b/docs/src/components/home/GoldSponsors.tsx @@ -6,7 +6,7 @@ import Typography from '@mui/material/Typography'; import AddRounded from '@mui/icons-material/AddRounded'; import Grid from '@mui/material/Grid'; import SponsorCard from 'docs/src/components/home/SponsorCard'; -import Link from '@mui/docs/Link'; +import { Link } from '@mui/docs/Link'; import ROUTES from 'docs/src/route'; const GOLDs = [ diff --git a/docs/src/components/home/MaterialDesignComponents.tsx b/docs/src/components/home/MaterialDesignComponents.tsx index a0a099664926e9..595bf042b8e948 100644 --- a/docs/src/components/home/MaterialDesignComponents.tsx +++ b/docs/src/components/home/MaterialDesignComponents.tsx @@ -33,7 +33,7 @@ import MailRounded from '@mui/icons-material/MailRounded'; import VerifiedUserRounded from '@mui/icons-material/VerifiedUserRounded'; import HelpCenterRounded from '@mui/icons-material/HelpCenterRounded'; import ROUTES from 'docs/src/route'; -import Link from '@mui/docs/Link'; +import { Link } from '@mui/docs/Link'; import { getDesignTokens, getThemedComponents } from 'docs/src/modules/brandingTheme'; const Grid = styled('div')(({ theme }) => [ diff --git a/docs/src/components/home/ProductsSwitcher.tsx b/docs/src/components/home/ProductsSwitcher.tsx index e5a5cac3a86a66..d4860ba18ace4a 100644 --- a/docs/src/components/home/ProductsSwitcher.tsx +++ b/docs/src/components/home/ProductsSwitcher.tsx @@ -9,7 +9,7 @@ import Stack from '@mui/material/Stack'; import KeyboardArrowRightRounded from '@mui/icons-material/KeyboardArrowRightRounded'; import IconImage from 'docs/src/components/icon/IconImage'; import Highlighter from 'docs/src/components/action/Highlighter'; -import Link from '@mui/docs/Link'; +import { Link } from '@mui/docs/Link'; import ROUTES from 'docs/src/route'; const SwipeableViews = dynamic(() => import('react-swipeable-views'), { ssr: false }); diff --git a/docs/src/components/home/SponsorCard.tsx b/docs/src/components/home/SponsorCard.tsx index f9edc75007c0d4..dece8579490986 100644 --- a/docs/src/components/home/SponsorCard.tsx +++ b/docs/src/components/home/SponsorCard.tsx @@ -4,7 +4,7 @@ import Box from '@mui/material/Box'; import Typography from '@mui/material/Typography'; import Paper from '@mui/material/Paper'; import LaunchRounded from '@mui/icons-material/LaunchRounded'; -import Link from '@mui/docs/Link'; +import { Link } from '@mui/docs/Link'; export default function SponsorCard({ item, diff --git a/docs/src/components/pricing/EarlyBird.tsx b/docs/src/components/pricing/EarlyBird.tsx index 87231c0f3a633a..f375f56579de15 100644 --- a/docs/src/components/pricing/EarlyBird.tsx +++ b/docs/src/components/pricing/EarlyBird.tsx @@ -5,7 +5,7 @@ import Stack from '@mui/material/Stack'; import Button from '@mui/material/Button'; import KeyboardArrowRightRounded from '@mui/icons-material/KeyboardArrowRightRounded'; import { alpha } from '@mui/material/styles'; -import Link from '@mui/docs/Link'; +import { Link } from '@mui/docs/Link'; export default function EarlyBird() { return ( diff --git a/docs/src/components/pricing/PricingList.tsx b/docs/src/components/pricing/PricingList.tsx index 727c825e6a13ef..46eceaabc760a6 100644 --- a/docs/src/components/pricing/PricingList.tsx +++ b/docs/src/components/pricing/PricingList.tsx @@ -8,7 +8,7 @@ import Typography from '@mui/material/Typography'; import Tabs from '@mui/material/Tabs'; import Tab from '@mui/material/Tab'; import KeyboardArrowRightRounded from '@mui/icons-material/KeyboardArrowRightRounded'; -import Link from '@mui/docs/Link'; +import { Link } from '@mui/docs/Link'; import PricingTable, { PlanName, PlanPrice } from 'docs/src/components/pricing/PricingTable'; import { useLicensingModel } from 'docs/src/components/pricing/LicensingModelContext'; diff --git a/docs/src/components/pricing/PricingTable.tsx b/docs/src/components/pricing/PricingTable.tsx index ec0bb6ab0dcce9..bfbf7f8ad100dc 100644 --- a/docs/src/components/pricing/PricingTable.tsx +++ b/docs/src/components/pricing/PricingTable.tsx @@ -12,7 +12,7 @@ import { useRouter } from 'next/router'; import KeyboardArrowRightRounded from '@mui/icons-material/KeyboardArrowRightRounded'; import LaunchRounded from '@mui/icons-material/LaunchRounded'; import UnfoldMoreRounded from '@mui/icons-material/UnfoldMoreRounded'; -import Link from '@mui/docs/Link'; +import { Link } from '@mui/docs/Link'; import IconImage from 'docs/src/components/icon/IconImage'; import LicensingModelSwitch from 'docs/src/components/pricing/LicensingModelSwitch'; import { useLicensingModel } from 'docs/src/components/pricing/LicensingModelContext'; diff --git a/docs/src/components/pricing/PricingWhatToExpect.tsx b/docs/src/components/pricing/PricingWhatToExpect.tsx index 711fd306054548..ffeaea5868b4e6 100644 --- a/docs/src/components/pricing/PricingWhatToExpect.tsx +++ b/docs/src/components/pricing/PricingWhatToExpect.tsx @@ -9,7 +9,7 @@ import ReplayRoundedIcon from '@mui/icons-material/ReplayRounded'; import AcUnitIcon from '@mui/icons-material/AcUnit'; import HelpOutlineOutlinedIcon from '@mui/icons-material/HelpOutlineOutlined'; import Section from 'docs/src/layouts/Section'; -import Link from '@mui/docs/Link'; +import { Link } from '@mui/docs/Link'; import GradientText from 'docs/src/components/typography/GradientText'; import SectionHeadline from 'docs/src/components/typography/SectionHeadline'; diff --git a/docs/src/components/productBaseUI/BaseUIHero.tsx b/docs/src/components/productBaseUI/BaseUIHero.tsx index acccab0797ba08..910d59d96c29c0 100644 --- a/docs/src/components/productBaseUI/BaseUIHero.tsx +++ b/docs/src/components/productBaseUI/BaseUIHero.tsx @@ -7,7 +7,7 @@ import IconImage from 'docs/src/components/icon/IconImage'; import GradientText from 'docs/src/components/typography/GradientText'; import ROUTES from 'docs/src/route'; import GetStartedButtons from 'docs/src/components/home/GetStartedButtons'; -import Link from '@mui/docs/Link'; +import { Link } from '@mui/docs/Link'; const BaseUIThemesDemo = dynamic(() => import('./BaseUIThemesDemo'), { ssr: false, diff --git a/docs/src/components/productBaseUI/BaseUITestimonial.tsx b/docs/src/components/productBaseUI/BaseUITestimonial.tsx index ed6b94275354f7..c876ad1627cd3a 100644 --- a/docs/src/components/productBaseUI/BaseUITestimonial.tsx +++ b/docs/src/components/productBaseUI/BaseUITestimonial.tsx @@ -7,7 +7,7 @@ import Grid from '@mui/material/Unstable_Grid2'; import Divider from '@mui/material/Divider'; import Typography from '@mui/material/Typography'; import ChevronRightRoundedIcon from '@mui/icons-material/ChevronRightRounded'; -import Link from '@mui/docs/Link'; +import { Link } from '@mui/docs/Link'; import Section from 'docs/src/layouts/Section'; export default function BaseUITestimonial() { diff --git a/docs/src/components/productBaseUI/BaseUIThemesDemo.tsx b/docs/src/components/productBaseUI/BaseUIThemesDemo.tsx index 30ba13cf1640e6..b8d24d54b97e9d 100644 --- a/docs/src/components/productBaseUI/BaseUIThemesDemo.tsx +++ b/docs/src/components/productBaseUI/BaseUIThemesDemo.tsx @@ -42,7 +42,7 @@ import InterestsRoundedIcon from '@mui/icons-material/InterestsRounded'; import RadioRoundedIcon from '@mui/icons-material/RadioRounded'; import ROUTES from 'docs/src/route'; -import Link from '@mui/docs/Link'; +import { Link } from '@mui/docs/Link'; import heroVariables from 'docs/src/components/productBaseUI/heroVariables'; const Panel = styled('div')({ diff --git a/docs/src/components/productDesignKit/DesignKitDemo.tsx b/docs/src/components/productDesignKit/DesignKitDemo.tsx index de880a1100e308..841164afd2a071 100644 --- a/docs/src/components/productDesignKit/DesignKitDemo.tsx +++ b/docs/src/components/productDesignKit/DesignKitDemo.tsx @@ -16,7 +16,7 @@ import Item, { Group } from 'docs/src/components/action/Item'; import Highlighter from 'docs/src/components/action/Highlighter'; import More from 'docs/src/components/action/More'; import Frame from 'docs/src/components/action/Frame'; -import Link from '@mui/docs/Link'; +import { Link } from '@mui/docs/Link'; const DEMOS = ['Components', 'Branding', 'Iconography']; diff --git a/docs/src/components/productDesignKit/DesignKitHero.tsx b/docs/src/components/productDesignKit/DesignKitHero.tsx index 1b630e49bb0615..b7a9e61583898c 100644 --- a/docs/src/components/productDesignKit/DesignKitHero.tsx +++ b/docs/src/components/productDesignKit/DesignKitHero.tsx @@ -7,7 +7,7 @@ import KeyboardArrowRightRounded from '@mui/icons-material/KeyboardArrowRightRou import GradientText from 'docs/src/components/typography/GradientText'; import HeroContainer from 'docs/src/layouts/HeroContainer'; import IconImage from 'docs/src/components/icon/IconImage'; -import Link from '@mui/docs/Link'; +import { Link } from '@mui/docs/Link'; import { DesignKitImagesSet1, DesignKitImagesSet2, diff --git a/docs/src/components/productMaterial/MaterialDesignKits.tsx b/docs/src/components/productMaterial/MaterialDesignKits.tsx index 1248fea677f599..ef65d052dee64a 100644 --- a/docs/src/components/productMaterial/MaterialDesignKits.tsx +++ b/docs/src/components/productMaterial/MaterialDesignKits.tsx @@ -16,7 +16,7 @@ import Item, { Group } from 'docs/src/components/action/Item'; import Highlighter from 'docs/src/components/action/Highlighter'; import More from 'docs/src/components/action/More'; import Frame from 'docs/src/components/action/Frame'; -import Link from '@mui/docs/Link'; +import { Link } from '@mui/docs/Link'; const DEMOS = ['Components', 'Branding', 'Iconography']; diff --git a/docs/src/components/productMaterial/MaterialEnd.tsx b/docs/src/components/productMaterial/MaterialEnd.tsx index 4ddcc4a03646c2..99d91ad0c83dd6 100644 --- a/docs/src/components/productMaterial/MaterialEnd.tsx +++ b/docs/src/components/productMaterial/MaterialEnd.tsx @@ -11,7 +11,7 @@ import GetStartedButtons from 'docs/src/components/home/GetStartedButtons'; import Section from 'docs/src/layouts/Section'; import SectionHeadline from 'docs/src/components/typography/SectionHeadline'; import GradientText from 'docs/src/components/typography/GradientText'; -import Link from '@mui/docs/Link'; +import { Link } from '@mui/docs/Link'; import ROUTES from 'docs/src/route'; export default function MaterialEnd() { diff --git a/docs/src/components/productMaterial/MaterialHero.tsx b/docs/src/components/productMaterial/MaterialHero.tsx index 93cca97b20a8f0..47fb4b4e95058c 100644 --- a/docs/src/components/productMaterial/MaterialHero.tsx +++ b/docs/src/components/productMaterial/MaterialHero.tsx @@ -60,7 +60,7 @@ import HeroContainer from 'docs/src/layouts/HeroContainer'; import GetStartedButtons from 'docs/src/components/home/GetStartedButtons'; import GradientText from 'docs/src/components/typography/GradientText'; import { getDesignTokens } from 'docs/src/modules/brandingTheme'; -import Link from '@mui/docs/Link'; +import { Link } from '@mui/docs/Link'; import ROUTES from 'docs/src/route'; function Checkboxes() { diff --git a/docs/src/components/productMaterial/MaterialTemplates.tsx b/docs/src/components/productMaterial/MaterialTemplates.tsx index 3a2ff31f949bfb..105a73fa7a1444 100644 --- a/docs/src/components/productMaterial/MaterialTemplates.tsx +++ b/docs/src/components/productMaterial/MaterialTemplates.tsx @@ -16,7 +16,7 @@ import GradientText from 'docs/src/components/typography/GradientText'; import Item, { Group } from 'docs/src/components/action/Item'; import Highlighter from 'docs/src/components/action/Highlighter'; import Frame from 'docs/src/components/action/Frame'; -import Link from '@mui/docs/Link'; +import { Link } from '@mui/docs/Link'; import More from 'docs/src/components/action/More'; export const DEMOS = ['Dashboard', 'Landing Pages', 'E-commerce']; diff --git a/docs/src/components/productTemplate/TemplateDemo.tsx b/docs/src/components/productTemplate/TemplateDemo.tsx index 412c26c48a21a0..6ad9ce04e8491a 100644 --- a/docs/src/components/productTemplate/TemplateDemo.tsx +++ b/docs/src/components/productTemplate/TemplateDemo.tsx @@ -14,7 +14,7 @@ import GradientText from 'docs/src/components/typography/GradientText'; import Item, { Group } from 'docs/src/components/action/Item'; import Highlighter from 'docs/src/components/action/Highlighter'; import Frame from 'docs/src/components/action/Frame'; -import Link from '@mui/docs/Link'; +import { Link } from '@mui/docs/Link'; import More from 'docs/src/components/action/More'; import { DEMOS, icons, TEMPLATES } from 'docs/src/components/productMaterial/MaterialTemplates'; diff --git a/docs/src/components/productTemplate/TemplateHero.tsx b/docs/src/components/productTemplate/TemplateHero.tsx index 11f04af60ca01c..aff549228dac2f 100644 --- a/docs/src/components/productTemplate/TemplateHero.tsx +++ b/docs/src/components/productTemplate/TemplateHero.tsx @@ -6,7 +6,7 @@ import KeyboardArrowRightRounded from '@mui/icons-material/KeyboardArrowRightRou import GradientText from 'docs/src/components/typography/GradientText'; import HeroContainer from 'docs/src/layouts/HeroContainer'; import IconImage from 'docs/src/components/icon/IconImage'; -import Link from '@mui/docs/Link'; +import { Link } from '@mui/docs/Link'; import { StoreTemplatesSet1, StoreTemplatesSet2, diff --git a/docs/src/components/productX/XComponentsSwitcher.tsx b/docs/src/components/productX/XComponentsSwitcher.tsx index 0fe25afc566f21..761ea0261fd39e 100644 --- a/docs/src/components/productX/XComponentsSwitcher.tsx +++ b/docs/src/components/productX/XComponentsSwitcher.tsx @@ -10,7 +10,7 @@ import AccountTreeRounded from '@mui/icons-material/AccountTreeRounded'; import BarChartRoundedIcon from '@mui/icons-material/BarChartRounded'; import { visuallyHidden } from '@mui/utils'; import Highlighter from 'docs/src/components/action/Highlighter'; -import Link from '@mui/docs/Link'; +import { Link } from '@mui/docs/Link'; import ROUTES from 'docs/src/route'; const SwipeableViews = dynamic(() => import('react-swipeable-views'), { ssr: false }); diff --git a/docs/src/components/productX/XDataGrid.tsx b/docs/src/components/productX/XDataGrid.tsx index 59ad0ca1586b65..f0b43ee5f86fad 100644 --- a/docs/src/components/productX/XDataGrid.tsx +++ b/docs/src/components/productX/XDataGrid.tsx @@ -22,7 +22,7 @@ import MarkdownElement from 'docs/src/components/markdown/MarkdownElement'; import FlashCode from 'docs/src/components/animation/FlashCode'; import XGridGlobalStyles from 'docs/src/components/home/XGridGlobalStyles'; import StylingInfo from 'docs/src/components/action/StylingInfo'; -import Link from '@mui/docs/Link'; +import { Link } from '@mui/docs/Link'; import ROUTES from 'docs/src/route'; const DEMOS = ['Editing', 'Selection', 'Sorting', 'Pagination', 'Filtering'] as const; diff --git a/docs/src/components/productX/XRoadmap.tsx b/docs/src/components/productX/XRoadmap.tsx index d67f2be00bdfa2..e9148796d8d5f0 100644 --- a/docs/src/components/productX/XRoadmap.tsx +++ b/docs/src/components/productX/XRoadmap.tsx @@ -16,7 +16,7 @@ import AutoGraphRoundedIcon from '@mui/icons-material/AutoGraphRounded'; import SpeedRounded from '@mui/icons-material/SpeedRounded'; import { alpha } from '@mui/material/styles'; import ROUTES from 'docs/src/route'; -import Link from '@mui/docs/Link'; +import { Link } from '@mui/docs/Link'; import SectionHeadline from 'docs/src/components/typography/SectionHeadline'; import Section from 'docs/src/layouts/Section'; import GradientText from 'docs/src/components/typography/GradientText'; diff --git a/docs/src/layouts/AppFooter.tsx b/docs/src/layouts/AppFooter.tsx index 246c083ebb4cea..7f7393871a6ab3 100644 --- a/docs/src/layouts/AppFooter.tsx +++ b/docs/src/layouts/AppFooter.tsx @@ -15,7 +15,7 @@ import SvgMuiLogotype from 'docs/src/icons/SvgMuiLogotype'; import EmailSubscribe from 'docs/src/components/footer/EmailSubscribe'; import ROUTES from 'docs/src/route'; import DiscordIcon from 'docs/src/icons/DiscordIcon'; -import Link from '@mui/docs/Link'; +import { Link } from '@mui/docs/Link'; import SvgStackOverflow from 'docs/src/icons/SvgStackOverflow'; interface AppFooterProps { diff --git a/docs/src/layouts/AppHeader.tsx b/docs/src/layouts/AppHeader.tsx index ea5a09688c311c..6e467d01819e7d 100644 --- a/docs/src/layouts/AppHeader.tsx +++ b/docs/src/layouts/AppHeader.tsx @@ -11,7 +11,7 @@ import SvgMuiLogomark from 'docs/src/icons/SvgMuiLogomark'; import HeaderNavBar from 'docs/src/components/header/HeaderNavBar'; import HeaderNavDropdown from 'docs/src/components/header/HeaderNavDropdown'; import ThemeModeToggle from 'docs/src/components/header/ThemeModeToggle'; -import Link from '@mui/docs/Link'; +import { Link } from '@mui/docs/Link'; import { DeferredAppSearch } from 'docs/src/modules/components/AppFrame'; import { useTranslate } from '@mui/docs/i18n'; diff --git a/docs/src/modules/components/AppLayoutDocsFooter.js b/docs/src/modules/components/AppLayoutDocsFooter.js index a13a5642c637e2..91d36fd6a11039 100644 --- a/docs/src/modules/components/AppLayoutDocsFooter.js +++ b/docs/src/modules/components/AppLayoutDocsFooter.js @@ -27,7 +27,7 @@ import RssFeedIcon from '@mui/icons-material/RssFeed'; import ArrowOutwardRoundedIcon from '@mui/icons-material/ArrowOutwardRounded'; import DiscordIcon from 'docs/src/icons/DiscordIcon'; // Other imports -import Link from '@mui/docs/Link'; +import { Link } from '@mui/docs/Link'; import PageContext from 'docs/src/modules/components/PageContext'; import EditPage from 'docs/src/modules/components/EditPage'; import SvgMuiLogotype from 'docs/src/icons/SvgMuiLogotype'; diff --git a/docs/src/modules/components/AppNavDrawerItem.js b/docs/src/modules/components/AppNavDrawerItem.js index 963c2f067beb14..82b436a56e5b14 100644 --- a/docs/src/modules/components/AppNavDrawerItem.js +++ b/docs/src/modules/components/AppNavDrawerItem.js @@ -6,7 +6,7 @@ import Collapse from '@mui/material/Collapse'; import Box from '@mui/material/Box'; import Chip from '@mui/material/Chip'; import { samePageLinkNavigation } from 'docs/src/modules/components/MarkdownLinks'; -import Link from '@mui/docs/Link'; +import { Link } from '@mui/docs/Link'; import standardNavIcons from './AppNavIcons'; const Item = styled( diff --git a/docs/src/modules/components/AppSearch.js b/docs/src/modules/components/AppSearch.js index 81d2c840c98ce1..60c83279ec945c 100644 --- a/docs/src/modules/components/AppSearch.js +++ b/docs/src/modules/components/AppSearch.js @@ -23,7 +23,7 @@ import GlobalStyles from '@mui/material/GlobalStyles'; import { alpha, styled } from '@mui/material/styles'; import { pathnameToLanguage } from 'docs/src/modules/utils/helpers'; import { LANGUAGES_SSR } from 'docs/config'; -import Link from '@mui/docs/Link'; +import { Link } from '@mui/docs/Link'; import { useTranslate, useUserLanguage } from '@mui/docs/i18n'; import useLazyCSS from 'docs/src/modules/utils/useLazyCSS'; import PageContext from 'docs/src/modules/components/PageContext'; diff --git a/docs/src/modules/components/AppTableOfContents.js b/docs/src/modules/components/AppTableOfContents.js index 3f78caeeb8a3ec..2a6639c82f0958 100644 --- a/docs/src/modules/components/AppTableOfContents.js +++ b/docs/src/modules/components/AppTableOfContents.js @@ -5,7 +5,7 @@ import throttle from 'lodash/throttle'; import { styled, alpha } from '@mui/material/styles'; import Typography from '@mui/material/Typography'; import NoSsr from '@mui/material/NoSsr'; -import Link from '@mui/docs/Link'; +import { Link } from '@mui/docs/Link'; import { useTranslate } from '@mui/docs/i18n'; import { samePageLinkNavigation } from 'docs/src/modules/components/MarkdownLinks'; import TableOfContentsBanner from 'docs/src/components/banner/TableOfContentsBanner'; diff --git a/docs/src/modules/components/BaseUIComponents.js b/docs/src/modules/components/BaseUIComponents.js index 0b81ef840d87fc..d361c29d0aeb55 100644 --- a/docs/src/modules/components/BaseUIComponents.js +++ b/docs/src/modules/components/BaseUIComponents.js @@ -4,7 +4,7 @@ import CardMedia from '@mui/material/CardMedia'; import Grid from '@mui/material/Grid'; import Typography from '@mui/material/Typography'; import { alpha } from '@mui/material/styles'; -import Link from '@mui/docs/Link'; +import { Link } from '@mui/docs/Link'; function components() { return [ diff --git a/docs/src/modules/components/ComponentPageTabs.js b/docs/src/modules/components/ComponentPageTabs.js index 8327ae3d90f2ce..5e43b1a96a8ef6 100644 --- a/docs/src/modules/components/ComponentPageTabs.js +++ b/docs/src/modules/components/ComponentPageTabs.js @@ -6,7 +6,7 @@ import Box from '@mui/material/Box'; import Tabs, { tabsClasses } from '@mui/material/Tabs'; import Tab, { tabClasses } from '@mui/material/Tab'; import { useTranslate } from '@mui/docs/i18n'; -import Link from '@mui/docs/Link'; +import { Link } from '@mui/docs/Link'; export const HEIGHT = 50; diff --git a/docs/src/modules/components/DiamondSponsors.js b/docs/src/modules/components/DiamondSponsors.js index f7a92a6b8c9cbf..541e7f30bda067 100644 --- a/docs/src/modules/components/DiamondSponsors.js +++ b/docs/src/modules/components/DiamondSponsors.js @@ -6,7 +6,7 @@ import Button from '@mui/material/Button'; import Typography from '@mui/material/Typography'; import DiamondOutlinedIcon from '@mui/icons-material/DiamondOutlined'; import { useTranslate } from '@mui/docs/i18n'; -import Link from '@mui/docs/Link'; +import { Link } from '@mui/docs/Link'; const StyledAnchor = styled('a')(({ theme }) => ({ boxSizing: 'border-box', // TODO have CssBaseline in the Next.js layout diff --git a/docs/src/modules/components/Link.tsx b/docs/src/modules/components/Link.tsx index e7167d22064aef..6a3fba0c136afe 100644 --- a/docs/src/modules/components/Link.tsx +++ b/docs/src/modules/components/Link.tsx @@ -2,4 +2,4 @@ // TODO: remove when Toolpad and X migrated to `@mui/docs/i18n` export * from '@mui/docs/Link'; -export { default } from '@mui/docs/Link'; +export { Link as default } from '@mui/docs/Link'; diff --git a/docs/src/modules/components/MaterialShowcase.js b/docs/src/modules/components/MaterialShowcase.js index 072137104f95d5..fe4db5bf344f9b 100644 --- a/docs/src/modules/components/MaterialShowcase.js +++ b/docs/src/modules/components/MaterialShowcase.js @@ -10,7 +10,7 @@ import IconButton from '@mui/material/IconButton'; import GitHubIcon from '@mui/icons-material/GitHub'; import CalendarMonthRoundedIcon from '@mui/icons-material/CalendarMonthRounded'; import { alpha } from '@mui/material/styles'; -import Link from '@mui/docs/Link'; +import { Link } from '@mui/docs/Link'; import { useTranslate } from '@mui/docs/i18n'; /** diff --git a/docs/src/modules/components/MuiProductSelector.tsx b/docs/src/modules/components/MuiProductSelector.tsx index 83cf5d2d9aa1b4..abd7ae14f094bb 100644 --- a/docs/src/modules/components/MuiProductSelector.tsx +++ b/docs/src/modules/components/MuiProductSelector.tsx @@ -6,7 +6,7 @@ import Typography from '@mui/material/Typography'; import Chip from '@mui/material/Chip'; import IconImage from 'docs/src/components/icon/IconImage'; import ROUTES from 'docs/src/route'; -import Link from '@mui/docs/Link'; +import { Link } from '@mui/docs/Link'; import PageContext from 'docs/src/modules/components/PageContext'; interface ProductSubMenuProp extends BoxProps { diff --git a/docs/src/modules/components/TopLayoutBlog.js b/docs/src/modules/components/TopLayoutBlog.js index 060db66fbd5c26..df796c63a6ef08 100644 --- a/docs/src/modules/components/TopLayoutBlog.js +++ b/docs/src/modules/components/TopLayoutBlog.js @@ -18,7 +18,7 @@ import MarkdownElement from 'docs/src/modules/components/MarkdownElement'; import RichMarkdownElement from 'docs/src/modules/components/RichMarkdownElement'; import { pathnameToLanguage } from 'docs/src/modules/utils/helpers'; import ROUTES from 'docs/src/route'; -import Link from '@mui/docs/Link'; +import { Link } from '@mui/docs/Link'; export const authors = { oliviertassinari: { diff --git a/docs/src/modules/components/TopLayoutCareers.js b/docs/src/modules/components/TopLayoutCareers.js index ba4fda7482cd82..95daa634e83f0f 100644 --- a/docs/src/modules/components/TopLayoutCareers.js +++ b/docs/src/modules/components/TopLayoutCareers.js @@ -8,7 +8,7 @@ import AppFooter from 'docs/src/layouts/AppFooter'; import AppHeader from 'docs/src/layouts/AppHeader'; import BrandingCssVarsProvider from 'docs/src/BrandingCssVarsProvider'; import MarkdownElement from 'docs/src/modules/components/MarkdownElement'; -import Link from '@mui/docs/Link'; +import { Link } from '@mui/docs/Link'; const StyledDiv = styled('div')({ flex: '1 0 100%', diff --git a/docs/src/pages/versions/LatestVersions.js b/docs/src/pages/versions/LatestVersions.js index 031f4750d4285c..be989b02c57398 100644 --- a/docs/src/pages/versions/LatestVersions.js +++ b/docs/src/pages/versions/LatestVersions.js @@ -5,7 +5,7 @@ import TableBody from '@mui/material/TableBody'; import TableCell from '@mui/material/TableCell'; import TableRow from '@mui/material/TableRow'; import Typography from '@mui/material/Typography'; -import Link from '@mui/docs/Link'; +import { Link } from '@mui/docs/Link'; function LatestVersions() { return ( diff --git a/docs/src/pages/versions/ReleasedVersions.js b/docs/src/pages/versions/ReleasedVersions.js index 9aa1524a4354ff..0ff71cd1716dd6 100644 --- a/docs/src/pages/versions/ReleasedVersions.js +++ b/docs/src/pages/versions/ReleasedVersions.js @@ -5,7 +5,7 @@ import TableBody from '@mui/material/TableBody'; import TableCell from '@mui/material/TableCell'; import TableRow from '@mui/material/TableRow'; import Typography from '@mui/material/Typography'; -import Link from '@mui/docs/Link'; +import { Link } from '@mui/docs/Link'; import VersionsContext from 'docs/src/pages/versions/VersionsContext'; const GITHUB_RELEASE_BASE_URL = 'https://github.com/mui/material-ui/releases/tag/'; diff --git a/packages/mui-docs/src/Link/Link.tsx b/packages/mui-docs/src/Link/Link.tsx index 003c8e376d302a..9de3d6d1c97287 100644 --- a/packages/mui-docs/src/Link/Link.tsx +++ b/packages/mui-docs/src/Link/Link.tsx @@ -68,7 +68,7 @@ export type LinkProps = { // A styled version of the Next.js Pages Router Link component: // https://nextjs.org/docs/pages/api-reference/components/link -const Link = React.forwardRef(function Link(props, ref) { +export const Link = React.forwardRef(function Link(props, ref) { const { activeClassName = 'active', as, @@ -136,5 +136,3 @@ const Link = React.forwardRef(function Link(props, /> ); }); - -export default Link; diff --git a/packages/mui-docs/src/Link/index.ts b/packages/mui-docs/src/Link/index.ts index edd9808dfd5ee4..3db78f51f070a0 100644 --- a/packages/mui-docs/src/Link/index.ts +++ b/packages/mui-docs/src/Link/index.ts @@ -1,2 +1 @@ export * from './Link'; -export { default } from './Link'; From b41c6330b6677536625832a4d89d2b179f39bc91 Mon Sep 17 00:00:00 2001 From: MUI bot <2109932+Janpot@users.noreply.github.com> Date: Thu, 15 Feb 2024 14:55:52 +0100 Subject: [PATCH 21/21] dwef --- docs/src/components/action/InfoCard.tsx | 2 +- docs/src/components/productDesignKit/DesignKitFAQ.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/src/components/action/InfoCard.tsx b/docs/src/components/action/InfoCard.tsx index d49314a5c4dea3..45ba7e23cbfdb6 100644 --- a/docs/src/components/action/InfoCard.tsx +++ b/docs/src/components/action/InfoCard.tsx @@ -3,7 +3,7 @@ import { alpha } from '@mui/material/styles'; import Box from '@mui/material/Box'; import Paper from '@mui/material/Paper'; import Typography, { TypographyProps } from '@mui/material/Typography'; -import Link, { LinkProps } from '@mui/docs/Link'; +import { Link, LinkProps } from '@mui/docs/Link'; interface GlowingIconContainerProps { icon: React.ReactNode; diff --git a/docs/src/components/productDesignKit/DesignKitFAQ.tsx b/docs/src/components/productDesignKit/DesignKitFAQ.tsx index a48cdc37538007..5e4f052cc9a4c3 100644 --- a/docs/src/components/productDesignKit/DesignKitFAQ.tsx +++ b/docs/src/components/productDesignKit/DesignKitFAQ.tsx @@ -10,7 +10,7 @@ import MuiAccordion from '@mui/material/Accordion'; import MuiAccordionSummary from '@mui/material/AccordionSummary'; import MuiAccordionDetail from '@mui/material/AccordionDetails'; import KeyboardArrowDownRounded from '@mui/icons-material/KeyboardArrowDownRounded'; -import InternalLink from '@mui/docs/Link'; +import { Link as InternalLink } from '@mui/docs/Link'; import Section from 'docs/src/layouts/Section'; const faqData = [