From d41626259af98a2e6fa29535644ccb7379c437b7 Mon Sep 17 00:00:00 2001 From: Marija Najdova Date: Mon, 31 Oct 2022 10:29:44 +0100 Subject: [PATCH 1/9] [release] v5.10.12 --- CHANGELOG.md | 67 +++++++++++++++++++ benchmark/package.json | 4 +- docs/package.json | 12 ++-- package.json | 2 +- packages/mui-base/package.json | 2 +- packages/mui-codemod/package.json | 2 +- .../mui-core-downloads-tracker/package.json | 2 +- packages/mui-envinfo/package.json | 2 +- packages/mui-joy/package.json | 8 +-- packages/mui-lab/package.json | 6 +- packages/mui-material-next/package.json | 8 +-- packages/mui-material/package.json | 8 +-- packages/mui-system/package.json | 2 +- 13 files changed, 96 insertions(+), 29 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c2605377ae28c3..f1501ae63c55da 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,72 @@ # [Versions](https://mui.com/versions/) +## v5.10.12 + + + +_Oct 31, 2022_ + +A big thanks to the 16 contributors who made this release possible. This release is mostly about 🐛 bug fixes, 📚 documentation, and ⚙️ infrastructure improvements. + +TODO INSERT HIGHLIGHTS + +### `@mui/material@5.10.12` + +- ​[Chip] Don't override icon color (#34247) @emlai +- ​[Radio] Skip default hover style when disableRipple is set (#34902) @VinceCYLiao +- ​[SwipeableDrawer] Fix React 18 issues (#34505) @mnajdova +- ​[Tooltip] Save a few bytes (#34853) @oliviertassinari + +### `@mui/base@5.0.0-alpha.104` + +- ​[ButtonUnstyled] Update to render as link when href or to is provided (#34337) @EduardoSCosta + +### `@mui/joy@5.0.0-alpha.52` + +- ​[Joy][circularprogress] Prevent new styles from being generated when `value` changes (#34897) @hbjORbj +- ​[Joy] Add color inversion feature (#32511) @siriwatknp +- ​[Joy] Add `LinearProgress` component (#34514) @hbjORbj + +### Docs + +- ​[blog] Add blog post for high-level overview of all MUI products (#34325) @samuelsycamore +- ​[blog] Fix hydration mistmatch (#34857) @oliviertassinari +- ​[docs] Revise the Joy UI "Aspect Ratio" page (#34858) @samuelsycamore +- ​[docs] Fix Safari code font size (#34859) @oliviertassinari +- ​[docs] Fix spelling mistake (#34955) @punithnayak +- ​[docs] Fix 404 link of supported Material UI components @oliviertassinari +- ​[docs] Fix Safari button misalignment (#34861) @oliviertassinari +- ​[docs] Fix typo in docs title (#34926) @PunitSoniME +- ​[docs] Standardize all MUI Core "Usage" pages (#34183) @samuelsycamore +- ​[docs] Update templates' readme files to include required dependencies (#34757) @michaldudak +- ​[docs] Fix inconsistent theme colors when applying custom colors in playground (#34866) @cherniavskii +- ​[docs] Fix typo in bottom-navigation.md (#34884) @RoodyCode +- ​[website] Update MUI X open and future roles + about page (#34894) @DanailH +- ​[website] Remove one DOM node (#34960) @oliviertassinari +- ​[website] Use `span` for icon image (#34914) @siriwatknp +- ​[website] Fix subscribe input with Safari (#34869) @oliviertassinari + +### Core + +- ​[core] Ignore compiled icons in CodeQL @oliviertassinari +- ​[core] Add OSSF Scorecard action (#34854) @oliviertassinari +- ​[core] Fix duplicate id @oliviertassinari +- ​[core] A couple of simply fixes from #34870 (#34953) @oliviertassinari +- ​[core] Migrate outdated pattern to convention @oliviertassinari +- ​[core] Pin GitHub Actions dependencies (#34929) @renovate[bot] +- ​[core] Make the reproduction more important in the bug template (#34875) @oliviertassinari +- ​[core] Fix docs GitHub API rate limit (#34856) @oliviertassinari +- ​[core] Pin GitHub Action to digests (#34855) @oliviertassinari +- ​[core] Fix permissions in workflow @oliviertassinari +- ​[core] memoize context values for react/jsx-no-constructed-context-values (#34849) @Janpot +- ​[core] Fix @typescript-eslint/default-param-last issues (#34846) @Janpot +- ​[core] Fix HTML validation error (#34860) @oliviertassinari +- ​[core] Fix duplicate CodeQL build @oliviertassinari +- ​[test] Move Firefox tests to CircleCI (#34764) @oliviertassinari +- ​[test] Use screen when possible for simplicity (#34890) @oliviertassinari + +All contributors of this release in alphabetical order: @cherniavskii, @DanailH, @EduardoSCosta, @emlai, @hbjORbj, @Janpot, @michaldudak, @mnajdova, @oliviertassinari, @punithnayak, @PunitSoniME, @renovate[bot], @RoodyCode, @samuelsycamore, @siriwatknp, @VinceCYLiao + ## v5.10.11 diff --git a/benchmark/package.json b/benchmark/package.json index 16a6a753d81405..cb871a175cbb35 100644 --- a/benchmark/package.json +++ b/benchmark/package.json @@ -15,9 +15,9 @@ "@emotion/react": "^11.10.4", "@emotion/styled": "^11.10.4", "@mdx-js/react": "^2.1.5", - "@mui/material": "^5.10.11", + "@mui/material": "^5.10.12", "@mui/styles": "^5.10.10", - "@mui/system": "^5.10.10", + "@mui/system": "^5.10.12", "@styled-system/css": "^5.1.5", "benchmark": "^2.1.4", "playwright": "^1.27.1", diff --git a/docs/package.json b/docs/package.json index e79409043edadb..9417a49c6dafe5 100644 --- a/docs/package.json +++ b/docs/package.json @@ -33,17 +33,17 @@ "@fortawesome/fontawesome-svg-core": "^6.2.0", "@fortawesome/free-solid-svg-icons": "^6.2.0", "@fortawesome/react-fontawesome": "^0.2.0", - "@mui/base": "5.0.0-alpha.103", + "@mui/base": "5.0.0-alpha.104", "@mui/docs": "^5.10.9", "@mui/icons-material": "^5.10.9", - "@mui/joy": "5.0.0-alpha.51", - "@mui/lab": "5.0.0-alpha.105", - "@mui/material": "^5.10.11", - "@mui/material-next": "6.0.0-alpha.59", + "@mui/joy": "5.0.0-alpha.52", + "@mui/lab": "5.0.0-alpha.106", + "@mui/material": "^5.10.12", + "@mui/material-next": "6.0.0-alpha.60", "@mui/styled-engine": "^5.10.8", "@mui/styled-engine-sc": "^5.10.6", "@mui/styles": "^5.10.10", - "@mui/system": "^5.10.10", + "@mui/system": "^5.10.12", "@mui/types": "^7.2.0", "@mui/x-data-grid": "^5.17.9", "@mui/x-data-grid-generator": "^5.17.9", diff --git a/package.json b/package.json index e8b07d28bf62ee..abc4369f867686 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@mui/monorepo", - "version": "5.10.11", + "version": "5.10.12", "private": true, "scripts": { "proptypes": "cross-env BABEL_ENV=development babel-node --extensions \".tsx,.ts,.js\" ./scripts/generateProptypes.ts", diff --git a/packages/mui-base/package.json b/packages/mui-base/package.json index 5149d325e9f009..de986027c279a8 100644 --- a/packages/mui-base/package.json +++ b/packages/mui-base/package.json @@ -1,6 +1,6 @@ { "name": "@mui/base", - "version": "5.0.0-alpha.103", + "version": "5.0.0-alpha.104", "private": false, "author": "MUI Team", "description": "A library of headless ('unstyled') React UI components and low-level hooks.", diff --git a/packages/mui-codemod/package.json b/packages/mui-codemod/package.json index f041e0f37d8fe4..9557d6c39c5d1e 100644 --- a/packages/mui-codemod/package.json +++ b/packages/mui-codemod/package.json @@ -1,6 +1,6 @@ { "name": "@mui/codemod", - "version": "5.10.11", + "version": "5.10.12", "bin": "./codemod.js", "private": false, "author": "MUI Team", diff --git a/packages/mui-core-downloads-tracker/package.json b/packages/mui-core-downloads-tracker/package.json index ef5a94d631c30f..ec95d0dba27dcf 100644 --- a/packages/mui-core-downloads-tracker/package.json +++ b/packages/mui-core-downloads-tracker/package.json @@ -1,6 +1,6 @@ { "name": "@mui/core-downloads-tracker", - "version": "5.10.11", + "version": "5.10.12", "private": false, "author": "MUI Team", "description": "Internal package to track number of downloads of our design system libraries", diff --git a/packages/mui-envinfo/package.json b/packages/mui-envinfo/package.json index 8b63b5f4ca100c..07e1e1da1f1bf6 100644 --- a/packages/mui-envinfo/package.json +++ b/packages/mui-envinfo/package.json @@ -6,7 +6,7 @@ }, "license": "MIT", "description": "Logs infos about the environment relevant to @mui/*", - "version": "2.0.6", + "version": "2.0.7", "bin": "./envinfo.js", "dependencies": { "envinfo": "^7.8.1" diff --git a/packages/mui-joy/package.json b/packages/mui-joy/package.json index d13f1b21f0a6bb..8daecbb49b223d 100644 --- a/packages/mui-joy/package.json +++ b/packages/mui-joy/package.json @@ -1,6 +1,6 @@ { "name": "@mui/joy", - "version": "5.0.0-alpha.51", + "version": "5.0.0-alpha.52", "private": false, "author": "MUI Team", "description": "A library of beautifully designed React UI components.", @@ -57,9 +57,9 @@ }, "dependencies": { "@babel/runtime": "^7.19.0", - "@mui/base": "5.0.0-alpha.103", - "@mui/core-downloads-tracker": "^5.10.11", - "@mui/system": "^5.10.10", + "@mui/base": "5.0.0-alpha.104", + "@mui/core-downloads-tracker": "^5.10.12", + "@mui/system": "^5.10.12", "@mui/types": "^7.2.0", "@mui/utils": "^5.10.9", "clsx": "^1.2.1", diff --git a/packages/mui-lab/package.json b/packages/mui-lab/package.json index f9c16b33db5a6c..4ae9bb53dba5bb 100644 --- a/packages/mui-lab/package.json +++ b/packages/mui-lab/package.json @@ -1,6 +1,6 @@ { "name": "@mui/lab", - "version": "5.0.0-alpha.105", + "version": "5.0.0-alpha.106", "private": false, "author": "MUI Team", "description": "Laboratory for new MUI modules.", @@ -61,8 +61,8 @@ }, "dependencies": { "@babel/runtime": "^7.19.0", - "@mui/base": "5.0.0-alpha.103", - "@mui/system": "^5.10.10", + "@mui/base": "5.0.0-alpha.104", + "@mui/system": "^5.10.12", "@mui/types": "^7.2.0", "@mui/utils": "^5.10.9", "clsx": "^1.2.1", diff --git a/packages/mui-material-next/package.json b/packages/mui-material-next/package.json index f85453fdfb71b5..87a63bfd4b4c67 100644 --- a/packages/mui-material-next/package.json +++ b/packages/mui-material-next/package.json @@ -1,6 +1,6 @@ { "name": "@mui/material-next", - "version": "6.0.0-alpha.59", + "version": "6.0.0-alpha.60", "private": false, "author": "MUI Team", "description": "v6-alpha: React components that implement Google's Material Design", @@ -59,9 +59,9 @@ }, "dependencies": { "@babel/runtime": "^7.19.0", - "@mui/base": "5.0.0-alpha.103", - "@mui/material": "^5.10.11", - "@mui/system": "^5.10.10", + "@mui/base": "5.0.0-alpha.104", + "@mui/material": "^5.10.12", + "@mui/system": "^5.10.12", "@mui/types": "^7.2.0", "@mui/utils": "^5.10.9", "@popperjs/core": "^2.11.6", diff --git a/packages/mui-material/package.json b/packages/mui-material/package.json index 22f47e264a2a37..5bbfa8bf3141bc 100644 --- a/packages/mui-material/package.json +++ b/packages/mui-material/package.json @@ -1,6 +1,6 @@ { "name": "@mui/material", - "version": "5.10.11", + "version": "5.10.12", "private": false, "author": "MUI Team", "description": "React components that implement Google's Material Design.", @@ -61,9 +61,9 @@ }, "dependencies": { "@babel/runtime": "^7.19.0", - "@mui/base": "5.0.0-alpha.103", - "@mui/core-downloads-tracker": "^5.10.11", - "@mui/system": "^5.10.10", + "@mui/base": "5.0.0-alpha.104", + "@mui/core-downloads-tracker": "^5.10.12", + "@mui/system": "^5.10.12", "@mui/types": "^7.2.0", "@mui/utils": "^5.10.9", "@types/react-transition-group": "^4.4.5", diff --git a/packages/mui-system/package.json b/packages/mui-system/package.json index bba16d3506151e..46b424ace29ac3 100644 --- a/packages/mui-system/package.json +++ b/packages/mui-system/package.json @@ -1,6 +1,6 @@ { "name": "@mui/system", - "version": "5.10.10", + "version": "5.10.12", "private": false, "author": "MUI Team", "description": "CSS utilities for rapidly laying out custom designs.", From a4ac85fb1ebc4a3e7c4310a834de221db2785b63 Mon Sep 17 00:00:00 2001 From: Marija Najdova Date: Mon, 31 Oct 2022 14:35:10 +0100 Subject: [PATCH 2/9] Remove autogenerated text --- CHANGELOG.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f1501ae63c55da..9f580ac75d58df 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,8 +8,6 @@ _Oct 31, 2022_ A big thanks to the 16 contributors who made this release possible. This release is mostly about 🐛 bug fixes, 📚 documentation, and ⚙️ infrastructure improvements. -TODO INSERT HIGHLIGHTS - ### `@mui/material@5.10.12` - ​[Chip] Don't override icon color (#34247) @emlai From 7e1815a63f02e9f6863b075ca5bf915a8d639470 Mon Sep 17 00:00:00 2001 From: Marija Najdova Date: Mon, 31 Oct 2022 14:42:09 +0100 Subject: [PATCH 3/9] Updated changelog --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9f580ac75d58df..82b7c8d0f3feef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,10 +35,15 @@ A big thanks to the 16 contributors who made this release possible. This release - ​[docs] Fix 404 link of supported Material UI components @oliviertassinari - ​[docs] Fix Safari button misalignment (#34861) @oliviertassinari - ​[docs] Fix typo in docs title (#34926) @PunitSoniME +- ​[docs] Fix missing emotion prefixes (#34958) @oliviertassinari +- ​[docs] Improve UI display for copy code (#34950) @oliviertassinari - ​[docs] Standardize all MUI Core "Usage" pages (#34183) @samuelsycamore - ​[docs] Update templates' readme files to include required dependencies (#34757) @michaldudak - ​[docs] Fix inconsistent theme colors when applying custom colors in playground (#34866) @cherniavskii - ​[docs] Fix typo in bottom-navigation.md (#34884) @RoodyCode +- ​[website] Migrate about-us page to use CSS theme variables (#34919) @brianlu2610 +- ​[website] Migrate Product-Templates page to use CSS theme variables (#34913) @EduardoSCosta +- ​[website] Migrate career page to use CSS theme variables (#34908) @the-mgi - ​[website] Update MUI X open and future roles + about page (#34894) @DanailH - ​[website] Remove one DOM node (#34960) @oliviertassinari - ​[website] Use `span` for icon image (#34914) @siriwatknp @@ -48,7 +53,9 @@ A big thanks to the 16 contributors who made this release possible. This release - ​[core] Ignore compiled icons in CodeQL @oliviertassinari - ​[core] Add OSSF Scorecard action (#34854) @oliviertassinari +- ​[core] Fix extra GitHub Action permission (#34496) @sashashura - ​[core] Fix duplicate id @oliviertassinari +- ​[core] Enforce import \* as React (#34878) @da0x - ​[core] A couple of simply fixes from #34870 (#34953) @oliviertassinari - ​[core] Migrate outdated pattern to convention @oliviertassinari - ​[core] Pin GitHub Actions dependencies (#34929) @renovate[bot] From 1e556dc0379993afaa8f82879e5ab147615cebcd Mon Sep 17 00:00:00 2001 From: Marija Najdova Date: Mon, 31 Oct 2022 16:18:20 +0100 Subject: [PATCH 4/9] Updated changelog --- CHANGELOG.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 82b7c8d0f3feef..24270e3f8f00ae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,10 @@ _Oct 31, 2022_ -A big thanks to the 16 contributors who made this release possible. This release is mostly about 🐛 bug fixes, 📚 documentation, and ⚙️ infrastructure improvements. +A big thanks to the 16 contributors who made this release possible. Here are some highlights ✨: + +- 🚀 The LinearProgress component has been added to Joy UI by @hbjORbj (#34514). +- Many other 🐛 bug fixes, 📚 documentation, and ⚙️ infrastructure improvements. ### `@mui/material@5.10.12` @@ -61,6 +64,7 @@ A big thanks to the 16 contributors who made this release possible. This release - ​[core] Pin GitHub Actions dependencies (#34929) @renovate[bot] - ​[core] Make the reproduction more important in the bug template (#34875) @oliviertassinari - ​[core] Fix docs GitHub API rate limit (#34856) @oliviertassinari +- ​[core] Fix eslint issues (#34964) @mnajdova - ​[core] Pin GitHub Action to digests (#34855) @oliviertassinari - ​[core] Fix permissions in workflow @oliviertassinari - ​[core] memoize context values for react/jsx-no-constructed-context-values (#34849) @Janpot From a6c3ed1595551991c971be6a9c8891240e297406 Mon Sep 17 00:00:00 2001 From: Marija Najdova Date: Fri, 4 Nov 2022 10:56:16 +0100 Subject: [PATCH 5/9] [docs] Upgrade to next.js 13 --- docs/package.json | 2 +- docs/src/modules/components/Link.tsx | 6 +- yarn.lock | 165 ++++++++++++++------------- 3 files changed, 91 insertions(+), 82 deletions(-) diff --git a/docs/package.json b/docs/package.json index 88ce9f45ef1cd5..b1c0ef552a15ba 100644 --- a/docs/package.json +++ b/docs/package.json @@ -91,7 +91,7 @@ "lz-string": "^1.4.4", "markdown-to-jsx": "^7.1.7", "material-ui-popup-state": "^2.0.1", - "next": "12.3.1", + "next": "13.0.2", "notistack": "2.0.8", "nprogress": "^0.2.0", "postcss": "^8.4.18", diff --git a/docs/src/modules/components/Link.tsx b/docs/src/modules/components/Link.tsx index c7267fb27bfcfe..1baacab2359d86 100644 --- a/docs/src/modules/components/Link.tsx +++ b/docs/src/modules/components/Link.tsx @@ -27,7 +27,7 @@ interface NextLinkComposedProps const NextLinkComposed = React.forwardRef( function NextLinkComposed(props, ref) { - const { to, linkAs, replace, scroll, shallow, prefetch, locale, ...other } = props; + const { to, linkAs, replace, scroll, shallow, prefetch, legacyBehavior = true, locale, ...other } = props; return ( @@ -63,6 +64,7 @@ const Link = React.forwardRef(function Link(props, as, className: classNameProps, href, + legacyBehavior, linkAs: linkAsProp, locale, noLinkStyle, @@ -103,7 +105,7 @@ const Link = React.forwardRef(function Link(props, linkAs = `/${userLanguage}${linkAs}`; } - const nextjsProps = { to: href, linkAs, replace, scroll, shallow, prefetch, locale }; + const nextjsProps = { to: href, linkAs, replace, scroll, shallow, legacyBehavior, prefetch, locale }; if (noLinkStyle) { return ; diff --git a/yarn.lock b/yarn.lock index 5c80790dae2e84..2c4810bba377f7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2564,75 +2564,75 @@ "@babel/runtime" "^7.18.9" "@mui/utils" "^5.9.3" -"@next/env@12.3.1": - version "12.3.1" - resolved "https://registry.yarnpkg.com/@next/env/-/env-12.3.1.tgz#18266bd92de3b4aa4037b1927aa59e6f11879260" - integrity sha512-9P9THmRFVKGKt9DYqeC2aKIxm8rlvkK38V1P1sRE7qyoPBIs8l9oo79QoSdPtOWfzkbDAVUqvbQGgTMsb8BtJg== +"@next/env@13.0.2": + version "13.0.2" + resolved "https://registry.yarnpkg.com/@next/env/-/env-13.0.2.tgz#5fbd7b4146175ae406edfb4a38b62de8c880c09d" + integrity sha512-Qb6WPuRriGIQ19qd6NBxpcrFOfj8ziN7l9eZUfwff5gl4zLXluqtuZPddYZM/oWjN53ZYcuRXzL+oowKyJeYtA== -"@next/swc-android-arm-eabi@12.3.1": - version "12.3.1" - resolved "https://registry.yarnpkg.com/@next/swc-android-arm-eabi/-/swc-android-arm-eabi-12.3.1.tgz#b15ce8ad376102a3b8c0f3c017dde050a22bb1a3" - integrity sha512-i+BvKA8tB//srVPPQxIQN5lvfROcfv4OB23/L1nXznP+N/TyKL8lql3l7oo2LNhnH66zWhfoemg3Q4VJZSruzQ== +"@next/swc-android-arm-eabi@13.0.2": + version "13.0.2" + resolved "https://registry.yarnpkg.com/@next/swc-android-arm-eabi/-/swc-android-arm-eabi-13.0.2.tgz#66669b8aab5062f554b8e9905d855679aabf0342" + integrity sha512-X54UQCTFyOGnJP//Z71dPPlp4BCYcQL2ncikKXQcPzVpqPs4C3m+tKC8ivBNH6edAXkppwsLRz1/yQwgSZ9Swg== -"@next/swc-android-arm64@12.3.1": - version "12.3.1" - resolved "https://registry.yarnpkg.com/@next/swc-android-arm64/-/swc-android-arm64-12.3.1.tgz#85d205f568a790a137cb3c3f720d961a2436ac9c" - integrity sha512-CmgU2ZNyBP0rkugOOqLnjl3+eRpXBzB/I2sjwcGZ7/Z6RcUJXK5Evz+N0ucOxqE4cZ3gkTeXtSzRrMK2mGYV8Q== +"@next/swc-android-arm64@13.0.2": + version "13.0.2" + resolved "https://registry.yarnpkg.com/@next/swc-android-arm64/-/swc-android-arm64-13.0.2.tgz#c0641d30525e0fb22bf1e2baf6c461d2d9e52f1a" + integrity sha512-1P00Kv8uKaLubqo7JzPrTqgFAzSOmfb8iwqJrOb9in5IvTRtNGlkR4hU0sXzqbQNM/+SaYxze6Z5ry1IDyb/cQ== -"@next/swc-darwin-arm64@12.3.1": - version "12.3.1" - resolved "https://registry.yarnpkg.com/@next/swc-darwin-arm64/-/swc-darwin-arm64-12.3.1.tgz#b105457d6760a7916b27e46c97cb1a40547114ae" - integrity sha512-hT/EBGNcu0ITiuWDYU9ur57Oa4LybD5DOQp4f22T6zLfpoBMfBibPtR8XktXmOyFHrL/6FC2p9ojdLZhWhvBHg== +"@next/swc-darwin-arm64@13.0.2": + version "13.0.2" + resolved "https://registry.yarnpkg.com/@next/swc-darwin-arm64/-/swc-darwin-arm64-13.0.2.tgz#d7e01a33393e83456dbfdc41446bb8a923968ff7" + integrity sha512-1zGIOkInkOLRv0QQGZ+3wffYsyKI4vIy62LYTvDWUn7TAYqnmXwougp9NSLqDeagLwgsv2URrykyAFixA/YqxA== -"@next/swc-darwin-x64@12.3.1": - version "12.3.1" - resolved "https://registry.yarnpkg.com/@next/swc-darwin-x64/-/swc-darwin-x64-12.3.1.tgz#6947b39082271378896b095b6696a7791c6e32b1" - integrity sha512-9S6EVueCVCyGf2vuiLiGEHZCJcPAxglyckTZcEwLdJwozLqN0gtS0Eq0bQlGS3dH49Py/rQYpZ3KVWZ9BUf/WA== +"@next/swc-darwin-x64@13.0.2": + version "13.0.2" + resolved "https://registry.yarnpkg.com/@next/swc-darwin-x64/-/swc-darwin-x64-13.0.2.tgz#d4a3fbe51edf871a675d89a7afdc78174d1e5841" + integrity sha512-ECDAjoMP1Y90cARaelS6X+k6BQx+MikAYJ8f/eaJrLur44NIOYc9HA/dgcTp5jenguY4yT8V+HCquLjAVle6fA== -"@next/swc-freebsd-x64@12.3.1": - version "12.3.1" - resolved "https://registry.yarnpkg.com/@next/swc-freebsd-x64/-/swc-freebsd-x64-12.3.1.tgz#2b6c36a4d84aae8b0ea0e0da9bafc696ae27085a" - integrity sha512-qcuUQkaBZWqzM0F1N4AkAh88lLzzpfE6ImOcI1P6YeyJSsBmpBIV8o70zV+Wxpc26yV9vpzb+e5gCyxNjKJg5Q== +"@next/swc-freebsd-x64@13.0.2": + version "13.0.2" + resolved "https://registry.yarnpkg.com/@next/swc-freebsd-x64/-/swc-freebsd-x64-13.0.2.tgz#1b54c3f38d3b36f86663a8dfcc81ea05e01f5172" + integrity sha512-2DcL/ofQdBnQX3IoI9sjlIAyLCD1oZoUBuhrhWbejvBQjutWrI0JTEv9uG69WcxWhVMm3BCsjv8GK2/68OKp7A== -"@next/swc-linux-arm-gnueabihf@12.3.1": - version "12.3.1" - resolved "https://registry.yarnpkg.com/@next/swc-linux-arm-gnueabihf/-/swc-linux-arm-gnueabihf-12.3.1.tgz#6e421c44285cfedac1f4631d5de330dd60b86298" - integrity sha512-diL9MSYrEI5nY2wc/h/DBewEDUzr/DqBjIgHJ3RUNtETAOB3spMNHvJk2XKUDjnQuluLmFMloet9tpEqU2TT9w== +"@next/swc-linux-arm-gnueabihf@13.0.2": + version "13.0.2" + resolved "https://registry.yarnpkg.com/@next/swc-linux-arm-gnueabihf/-/swc-linux-arm-gnueabihf-13.0.2.tgz#18495cff32c0b2182cfbf677614219d7072214da" + integrity sha512-Y3OQF1CSBSWW2vGkmvOIuOUNqOq8qX7f1ZpcKUVWP3/Uq++DZmVi9d18lgnSe1I3QFqc+nXWyun9ljsN83j0sw== -"@next/swc-linux-arm64-gnu@12.3.1": - version "12.3.1" - resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-12.3.1.tgz#8863f08a81f422f910af126159d2cbb9552ef717" - integrity sha512-o/xB2nztoaC7jnXU3Q36vGgOolJpsGG8ETNjxM1VAPxRwM7FyGCPHOMk1XavG88QZSQf+1r+POBW0tLxQOJ9DQ== +"@next/swc-linux-arm64-gnu@13.0.2": + version "13.0.2" + resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-13.0.2.tgz#5fb2563651166c3c6f32bf9e2f9cc6a16a9ef783" + integrity sha512-mNyzwsFF6kwZYEjnGicx9ksDZYEZvyzEc1BtCu8vdZi/v8UeixQwCiAT6FyYX9uxMPEkzk8qiU0t0u9gvltsKw== -"@next/swc-linux-arm64-musl@12.3.1": - version "12.3.1" - resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-12.3.1.tgz#0038f07cf0b259d70ae0c80890d826dfc775d9f3" - integrity sha512-2WEasRxJzgAmP43glFNhADpe8zB7kJofhEAVNbDJZANp+H4+wq+/cW1CdDi8DqjkShPEA6/ejJw+xnEyDID2jg== +"@next/swc-linux-arm64-musl@13.0.2": + version "13.0.2" + resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-13.0.2.tgz#b9f33c5e17cfe04aa5769b717284cf80865761e6" + integrity sha512-M6SdYjWgRrY3tJBxz0663zCRPTu5BRONmxlftKWWHv9LjAJ59neTLaGj4rp0A08DkJglZIoCkLOzLrzST6TGag== -"@next/swc-linux-x64-gnu@12.3.1": - version "12.3.1" - resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-12.3.1.tgz#c66468f5e8181ffb096c537f0dbfb589baa6a9c1" - integrity sha512-JWEaMyvNrXuM3dyy9Pp5cFPuSSvG82+yABqsWugjWlvfmnlnx9HOQZY23bFq3cNghy5V/t0iPb6cffzRWylgsA== +"@next/swc-linux-x64-gnu@13.0.2": + version "13.0.2" + resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-13.0.2.tgz#29efcc2fd0122689d7e06c5b6b0883fe495db2bf" + integrity sha512-pi63RoxvG4ES1KS06Zpm0MATVIXTs/TIbLbdckeLoM40u1d3mQl/+hSSrLRSxzc2OtyL8fh92sM4gkJrQXAMAw== -"@next/swc-linux-x64-musl@12.3.1": - version "12.3.1" - resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-12.3.1.tgz#c6269f3e96ac0395bc722ad97ce410ea5101d305" - integrity sha512-xoEWQQ71waWc4BZcOjmatuvPUXKTv6MbIFzpm4LFeCHsg2iwai0ILmNXf81rJR+L1Wb9ifEke2sQpZSPNz1Iyg== +"@next/swc-linux-x64-musl@13.0.2": + version "13.0.2" + resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-13.0.2.tgz#d68fdf6eefc57813fa91559c7089b49d6131ecab" + integrity sha512-9Pv91gfYnDONgjtRm78n64b/c54+azeHtlnqBLTnIFWSMBDRl1/WDkhKWIj3fBGPLimtK7Tko3ULR3og9RRUPw== -"@next/swc-win32-arm64-msvc@12.3.1": - version "12.3.1" - resolved "https://registry.yarnpkg.com/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-12.3.1.tgz#83c639ee969cee36ce247c3abd1d9df97b5ecade" - integrity sha512-hswVFYQYIeGHE2JYaBVtvqmBQ1CppplQbZJS/JgrVI3x2CurNhEkmds/yqvDONfwfbttTtH4+q9Dzf/WVl3Opw== +"@next/swc-win32-arm64-msvc@13.0.2": + version "13.0.2" + resolved "https://registry.yarnpkg.com/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-13.0.2.tgz#acdcb3023045f60cca510f659a2349895e6405bd" + integrity sha512-Nvewe6YZaizAkGHHprbMkYqQulBjZCHKBGKeFPwoPtOA+a2Qi4pZzc/qXFyC5/2A6Z0mr2U1zg9rd04WBYMwBw== -"@next/swc-win32-ia32-msvc@12.3.1": - version "12.3.1" - resolved "https://registry.yarnpkg.com/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-12.3.1.tgz#52995748b92aa8ad053440301bc2c0d9fbcf27c2" - integrity sha512-Kny5JBehkTbKPmqulr5i+iKntO5YMP+bVM8Hf8UAmjSMVo3wehyLVc9IZkNmcbxi+vwETnQvJaT5ynYBkJ9dWA== +"@next/swc-win32-ia32-msvc@13.0.2": + version "13.0.2" + resolved "https://registry.yarnpkg.com/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-13.0.2.tgz#a78ee9211471768febac9df915c2a8dbbcd05e41" + integrity sha512-ZUBYGZw5G3QrqDpRq1EWi3aHmvPZM8ijK5TFL6UbH16cYQ0JpANmuG2P66KB93Qe/lWWzbeAZk/tj1XqwoCuPA== -"@next/swc-win32-x64-msvc@12.3.1": - version "12.3.1" - resolved "https://registry.yarnpkg.com/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-12.3.1.tgz#27d71a95247a9eaee03d47adee7e3bd594514136" - integrity sha512-W1ijvzzg+kPEX6LAc+50EYYSEo0FVu7dmTE+t+DM4iOLqgGHoW9uYSz9wCVdkXOEEMP9xhXfGpcSxsfDucyPkA== +"@next/swc-win32-x64-msvc@13.0.2": + version "13.0.2" + resolved "https://registry.yarnpkg.com/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-13.0.2.tgz#e86c2de910cd68a17974db5556d4588737412c68" + integrity sha512-fA9uW1dm7C0mEYGcKlbmLcVm2sKcye+1kPxh2cM4jVR+kQQMtHWsjIzeSpe2grQLSDan06z4n6hbr8b1c3hA8w== "@nicolo-ribaudo/chokidar-2@2.1.8-no-fsevents.3": version "2.1.8-no-fsevents.3" @@ -5692,6 +5692,11 @@ cli-width@^3.0.0: resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-3.0.0.tgz#a2f48437a2caa9a22436e794bf071ec9e61cedf6" integrity sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw== +client-only@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/client-only/-/client-only-0.0.1.tgz#38bba5d403c41ab150bff64a95c85013cf73bca1" + integrity sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA== + clipboard-copy@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/clipboard-copy/-/clipboard-copy-4.0.1.tgz#326ef9726d4ffe72d9a82a7bbe19379de692017d" @@ -11511,31 +11516,31 @@ nested-error-stacks@^2.0.0, nested-error-stacks@^2.1.0: resolved "https://registry.yarnpkg.com/nested-error-stacks/-/nested-error-stacks-2.1.1.tgz#26c8a3cee6cc05fbcf1e333cd2fc3e003326c0b5" integrity sha512-9iN1ka/9zmX1ZvLV9ewJYEk9h7RyRRtqdK0woXcqohu8EWIerfPUjYJPg0ULy0UqP7cslmdGc8xKDJcojlKiaw== -next@12.3.1: - version "12.3.1" - resolved "https://registry.yarnpkg.com/next/-/next-12.3.1.tgz#127b825ad2207faf869b33393ec8c75fe61e50f1" - integrity sha512-l7bvmSeIwX5lp07WtIiP9u2ytZMv7jIeB8iacR28PuUEFG5j0HGAPnMqyG5kbZNBG2H7tRsrQ4HCjuMOPnANZw== +next@13.0.2: + version "13.0.2" + resolved "https://registry.yarnpkg.com/next/-/next-13.0.2.tgz#b8c8642c70f736ed91105645391d335fc51c8f62" + integrity sha512-uQ5z5e4D9mOe8+upy6bQdYYjo/kk1v3jMW87kTy2TgAyAsEO+CkwRnMgyZ4JoHEnhPZLHwh7dk0XymRNLe1gFw== dependencies: - "@next/env" "12.3.1" + "@next/env" "13.0.2" "@swc/helpers" "0.4.11" caniuse-lite "^1.0.30001406" postcss "8.4.14" - styled-jsx "5.0.7" + styled-jsx "5.1.0" use-sync-external-store "1.2.0" optionalDependencies: - "@next/swc-android-arm-eabi" "12.3.1" - "@next/swc-android-arm64" "12.3.1" - "@next/swc-darwin-arm64" "12.3.1" - "@next/swc-darwin-x64" "12.3.1" - "@next/swc-freebsd-x64" "12.3.1" - "@next/swc-linux-arm-gnueabihf" "12.3.1" - "@next/swc-linux-arm64-gnu" "12.3.1" - "@next/swc-linux-arm64-musl" "12.3.1" - "@next/swc-linux-x64-gnu" "12.3.1" - "@next/swc-linux-x64-musl" "12.3.1" - "@next/swc-win32-arm64-msvc" "12.3.1" - "@next/swc-win32-ia32-msvc" "12.3.1" - "@next/swc-win32-x64-msvc" "12.3.1" + "@next/swc-android-arm-eabi" "13.0.2" + "@next/swc-android-arm64" "13.0.2" + "@next/swc-darwin-arm64" "13.0.2" + "@next/swc-darwin-x64" "13.0.2" + "@next/swc-freebsd-x64" "13.0.2" + "@next/swc-linux-arm-gnueabihf" "13.0.2" + "@next/swc-linux-arm64-gnu" "13.0.2" + "@next/swc-linux-arm64-musl" "13.0.2" + "@next/swc-linux-x64-gnu" "13.0.2" + "@next/swc-linux-x64-musl" "13.0.2" + "@next/swc-win32-arm64-msvc" "13.0.2" + "@next/swc-win32-ia32-msvc" "13.0.2" + "@next/swc-win32-x64-msvc" "13.0.2" nice-napi@^1.0.2: version "1.0.2" @@ -14881,10 +14886,12 @@ styled-components@^5.3.6: shallowequal "^1.1.0" supports-color "^5.5.0" -styled-jsx@5.0.7: - version "5.0.7" - resolved "https://registry.yarnpkg.com/styled-jsx/-/styled-jsx-5.0.7.tgz#be44afc53771b983769ac654d355ca8d019dff48" - integrity sha512-b3sUzamS086YLRuvnaDigdAewz1/EFYlHpYBP5mZovKEdQQOIIYq8lApylub3HHZ6xFjV051kkGU7cudJmrXEA== +styled-jsx@5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/styled-jsx/-/styled-jsx-5.1.0.tgz#4a5622ab9714bd3fcfaeec292aa555871f057563" + integrity sha512-/iHaRJt9U7T+5tp6TRelLnqBqiaIT0HsO0+vgyj8hK2KUk7aejFqRrumqPUlAqDwAj8IbS/1hk3IhBAAK/FCUQ== + dependencies: + client-only "0.0.1" styled-system@^5.1.5: version "5.1.5" From 07c5477bfe688260da62ff851bdb1879e593ac37 Mon Sep 17 00:00:00 2001 From: Marija Najdova Date: Fri, 4 Nov 2022 12:25:42 +0100 Subject: [PATCH 6/9] prettier --- docs/src/modules/components/Link.tsx | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/docs/src/modules/components/Link.tsx b/docs/src/modules/components/Link.tsx index 1baacab2359d86..7640678f400254 100644 --- a/docs/src/modules/components/Link.tsx +++ b/docs/src/modules/components/Link.tsx @@ -27,7 +27,17 @@ interface NextLinkComposedProps const NextLinkComposed = React.forwardRef( function NextLinkComposed(props, ref) { - const { to, linkAs, replace, scroll, shallow, prefetch, legacyBehavior = true, locale, ...other } = props; + const { + to, + linkAs, + replace, + scroll, + shallow, + prefetch, + legacyBehavior = true, + locale, + ...other + } = props; return ( (function Link(props, linkAs = `/${userLanguage}${linkAs}`; } - const nextjsProps = { to: href, linkAs, replace, scroll, shallow, legacyBehavior, prefetch, locale }; + const nextjsProps = { + to: href, + linkAs, + replace, + scroll, + shallow, + legacyBehavior, + prefetch, + locale, + }; if (noLinkStyle) { return ; From 3eacbc5a6601e4995d62860fadc26595e825b664 Mon Sep 17 00:00:00 2001 From: Marija Najdova Date: Wed, 9 Nov 2022 09:44:51 +0100 Subject: [PATCH 7/9] Move blog to app --- docs/.vscode/settings.json | 4 + docs/app/blog/AppFooter.tsx | 8 + docs/app/blog/AppHeader.tsx | 8 + docs/app/blog/BrandingProvider.tsx | 8 + docs/app/blog/Head.tsx | 61 +++++++ docs/app/blog/HeroEnd.tsx | 8 + docs/app/blog/Link.tsx | 145 ++++++++++++++++ docs/app/blog/PostPreview.tsx | 159 ++++++++++++++++++ docs/app/blog/layout.tsx | 16 ++ docs/app/blog/page.tsx | 106 ++++++++++++ docs/app/layout.tsx | 8 + docs/nextConfigDocsInfra.js | 1 + docs/pages/{blog.tsx => blog-old.tsx} | 0 docs/src/modules/components/AppFrame.js | 12 +- docs/src/modules/components/Head.tsx | 24 +-- docs/src/modules/components/Link.tsx | 12 +- docs/src/modules/components/TopLayoutBlog.js | 2 + docs/tsconfig.json | 9 +- .../src/TextareaAutosize/TextareaAutosize.js | 2 + .../mui-docs/src/NProgressBar/NProgressBar.js | 16 +- .../mui-material/src/Typography/Typography.js | 2 + 21 files changed, 571 insertions(+), 40 deletions(-) create mode 100644 docs/.vscode/settings.json create mode 100644 docs/app/blog/AppFooter.tsx create mode 100644 docs/app/blog/AppHeader.tsx create mode 100644 docs/app/blog/BrandingProvider.tsx create mode 100644 docs/app/blog/Head.tsx create mode 100644 docs/app/blog/HeroEnd.tsx create mode 100644 docs/app/blog/Link.tsx create mode 100644 docs/app/blog/PostPreview.tsx create mode 100644 docs/app/blog/layout.tsx create mode 100644 docs/app/blog/page.tsx create mode 100644 docs/app/layout.tsx rename docs/pages/{blog.tsx => blog-old.tsx} (100%) diff --git a/docs/.vscode/settings.json b/docs/.vscode/settings.json new file mode 100644 index 00000000000000..ce508cddaca898 --- /dev/null +++ b/docs/.vscode/settings.json @@ -0,0 +1,4 @@ +{ + "typescript.tsdk": "./node_modules/typescript/lib", + "typescript.enablePromptUseWorkspaceTsdk": true +} diff --git a/docs/app/blog/AppFooter.tsx b/docs/app/blog/AppFooter.tsx new file mode 100644 index 00000000000000..1965b4adf42848 --- /dev/null +++ b/docs/app/blog/AppFooter.tsx @@ -0,0 +1,8 @@ +'use client'; + +import * as React from 'react'; +import DocsAppFooter from 'docs/src/layouts/AppFooter'; + +export default function AppFooter(props) { + return ; +} diff --git a/docs/app/blog/AppHeader.tsx b/docs/app/blog/AppHeader.tsx new file mode 100644 index 00000000000000..e58d444052055e --- /dev/null +++ b/docs/app/blog/AppHeader.tsx @@ -0,0 +1,8 @@ +'use client'; + +import * as React from 'react'; +import DocsAppHeader from 'docs/src/layouts/AppHeader'; + +export default function AppHeader(props) { + return ; +} diff --git a/docs/app/blog/BrandingProvider.tsx b/docs/app/blog/BrandingProvider.tsx new file mode 100644 index 00000000000000..96f6dd2c76600b --- /dev/null +++ b/docs/app/blog/BrandingProvider.tsx @@ -0,0 +1,8 @@ +'use client'; + +import * as React from 'react'; +import DocsBrandingProvider from 'docs/src/BrandingProvider'; + +export default function BrandingProvider(props) { + return ; +} diff --git a/docs/app/blog/Head.tsx b/docs/app/blog/Head.tsx new file mode 100644 index 00000000000000..3533e5c9f49bea --- /dev/null +++ b/docs/app/blog/Head.tsx @@ -0,0 +1,61 @@ +'use client'; + +import * as React from 'react'; +import NextHead from 'next/head'; +import { useUserLanguage, useTranslate } from 'docs/src/modules/utils/i18n'; + +// #major-version-switch +const HOST = 'https://mui.com'; + +interface HeadProps { + card?: string; + children?: React.ReactNode; + description: string; + disableAlternateLocale?: boolean; + largeCard?: boolean; + title: string; + type?: string; +} + +export default function Head(props: HeadProps) { + const t = useTranslate(); + const { + card = '/static/social-previews/default-preview.jpg', + children, + description = t('strapline'), + disableAlternateLocale = false, + largeCard = true, + title = t('headTitle'), + type = 'website', + } = props; + const userLanguage = useUserLanguage(); + const preview = card.startsWith('http') ? card : `${HOST}${card}`; + + return ( + + {title} + + {/* Twitter */} + + {/* https://twitter.com/MUI_hq */} + + {/* #major-version-switch */} + + + + {/* Facebook */} + + + {/* #major-version-switch */} + + + + + {/* Algolia */} + + {/* #major-version-switch */} + + {children} + + ); +} diff --git a/docs/app/blog/HeroEnd.tsx b/docs/app/blog/HeroEnd.tsx new file mode 100644 index 00000000000000..c68792ca48874c --- /dev/null +++ b/docs/app/blog/HeroEnd.tsx @@ -0,0 +1,8 @@ +'use client'; + +import * as React from 'react'; +import DocsHeroEnd from 'docs/src/components/home/HeroEnd'; + +export default function HeroEnd(props) { + return ; +} diff --git a/docs/app/blog/Link.tsx b/docs/app/blog/Link.tsx new file mode 100644 index 00000000000000..ccc65166df959f --- /dev/null +++ b/docs/app/blog/Link.tsx @@ -0,0 +1,145 @@ +import * as React from 'react'; +import clsx from 'clsx'; +import NextLink, { LinkProps as NextLinkProps } from 'next/link'; +import { usePathname } from 'next/navigation'; +import MuiLink, { LinkProps as MuiLinkProps } from '@mui/material/Link'; +import { styled } from '@mui/material/styles'; +import { useUserLanguage } from 'docs/src/modules/utils/i18n'; +import { LANGUAGES_IGNORE_PAGES } from 'docs/src/modules/constants'; + +/** + * File to keep in sync with: + * + * - /docs/src/modules/components/Link.tsx + * - /examples/nextjs/src/Link.js + * - /examples/nextjs-with-typescript/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 Link component: +// https://nextjs.org/docs/api-reference/next/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 nextPathname = usePathname(); + + const pathname = typeof href === 'string' ? href : href.pathname; + const className = clsx(classNameProps, { + [activeClassName]: nextPathname && nextPathname === pathname && 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; diff --git a/docs/app/blog/PostPreview.tsx b/docs/app/blog/PostPreview.tsx new file mode 100644 index 00000000000000..1937908da6ddb1 --- /dev/null +++ b/docs/app/blog/PostPreview.tsx @@ -0,0 +1,159 @@ +import * as React from 'react'; +import { BlogPost } from 'docs/lib/sourcing'; +import { alpha } from '@mui/material/styles'; +import Avatar from '@mui/material/Avatar'; +import AvatarGroup from '@mui/material/AvatarGroup'; +import Box from '@mui/material/Box'; +import Typography from '@mui/material/Typography'; +import Button from '@mui/material/Button'; +import KeyboardArrowRightRoundedIcon from '@mui/icons-material/KeyboardArrowRightRounded'; +import Chip from '@mui/material/Chip'; +import { authors as AUTHORS } from 'docs/src/modules/components/TopLayoutBlog'; +import Link from './Link'; + +export default function PostPreview(props: BlogPost) { + return ( + + + {props.tags.map((tag) => ( + + theme.palette.mode === 'dark' ? theme.palette.grey[50] : theme.palette.grey[700], + background: (theme) => + theme.palette.mode === 'dark' + ? alpha(theme.palette.grey[700], 0.5) + : theme.palette.grey[100], + '&:hover': { + background: (theme) => + theme.palette.mode === 'dark' + ? alpha(theme.palette.grey[700], 0.5) + : theme.palette.grey[100], + }, + }} + /> + ))} + + + + {props.title} + + + + {props.description} + + {props.authors && ( + + theme.palette.mode === 'dark' + ? theme.palette.primaryDark[800] + : theme.palette.grey[100], + backgroundColor: (theme) => + theme.palette.mode === 'dark' + ? theme.palette.primaryDark[700] + : theme.palette.grey[100], + color: (theme) => + theme.palette.mode === 'dark' + ? theme.palette.primaryDark[100] + : theme.palette.grey[800], + fontSize: (theme) => theme.typography.pxToRem(13), + fontWeight: 500, + }, + }} + > + {(props.authors as Array).map((author) => ( + + ))} + + )} + + + {props.authors && ( + + {props.authors + .slice(0, 3) + .map((userId) => { + const name = AUTHORS[userId as keyof typeof AUTHORS]?.name; + if (name) { + if (props.authors && props.authors.length > 1) { + // display only firstName + return name.split(' ')[0]; + } + return name; + } + return userId; + }) + .join(', ')} + {props.authors.length > 2 && ', and more.'} + + )} + {props.date && ( + + {new Date(props.date).toDateString()} + + )} + + + + + ); +} diff --git a/docs/app/blog/layout.tsx b/docs/app/blog/layout.tsx new file mode 100644 index 00000000000000..4f3d948710b384 --- /dev/null +++ b/docs/app/blog/layout.tsx @@ -0,0 +1,16 @@ +import * as React from 'react'; +import BrandingProvider from './BrandingProvider'; +import Head from './Head'; + +export default function BlogLayout({ children }: { children: React.ReactNode }) { + return ( + + + {children} + + ); +} diff --git a/docs/app/blog/page.tsx b/docs/app/blog/page.tsx new file mode 100644 index 00000000000000..b5bdb7db9ea24d --- /dev/null +++ b/docs/app/blog/page.tsx @@ -0,0 +1,106 @@ +import * as React from 'react'; +import { getAllBlogPosts } from 'docs/lib/sourcing'; +import Box from '@mui/material/Box'; +import Section from 'docs/src/layouts/Section'; +import Divider from '@mui/material/Divider'; +import Typography from '@mui/material/Typography'; +import Paper from '@mui/material/Paper'; +import GradientText from 'docs/src/components/typography/GradientText'; +import HeroEnd from 'docs/src/components/home/HeroEnd'; +import AppFooter from './AppFooter'; +import AppHeader from './AppHeader'; +import PostPreview from './PostPreview'; + +export default function Blog() { + const data = getAllBlogPosts(); + + const { allBlogPosts, tagInfo: rawTagInfo } = data; + const [firstPost, secondPost, ...otherPosts] = allBlogPosts; + + const tagInfo = { ...rawTagInfo }; + [firstPost, secondPost].forEach((post) => { + post.tags.forEach((tag) => { + if (tagInfo[tag]) { + tagInfo[tag]! -= 1; + } + }); + }); + + Object.entries(tagInfo).forEach(([tagName, tagCount]) => { + if (tagCount === 0) { + delete tagInfo[tagName]; + } + }); + + return ( + + {/* */} +
+
+ + Blog + + + The latest about MUI + + + {[firstPost, secondPost].map((post) => ( + ({ + p: 2, + display: 'flex', + flexDirection: 'column', + position: 'relative', + transition: 'all ease 120ms', + '&:hover, &:focus-within': { + borderColor: theme.palette.mode === 'dark' ? 'primary.600' : 'grey.300', + boxShadow: `0px 4px 20px ${ + theme.palette.mode === 'dark' + ? 'rgba(0, 0, 0, 0.5)' + : 'rgba(170, 180, 190, 0.3)' + }`, + }, + '&:focus-within': { + '& a': { + outline: 'none', + }, + }, + })} + > + {post.image && ( + + )} + + + ))} + +
+
+ {/* + + */} +
+ ); +} diff --git a/docs/app/layout.tsx b/docs/app/layout.tsx new file mode 100644 index 00000000000000..e9ae807bff591b --- /dev/null +++ b/docs/app/layout.tsx @@ -0,0 +1,8 @@ +export default function RootLayout({ children }: { children: React.ReactNode }) { + return ( + + + {children} + + ); +} diff --git a/docs/nextConfigDocsInfra.js b/docs/nextConfigDocsInfra.js index 6b8271940508ff..9e8713e1695670 100644 --- a/docs/nextConfigDocsInfra.js +++ b/docs/nextConfigDocsInfra.js @@ -45,6 +45,7 @@ function withDocsInfra(nextConfig) { }, experimental: { scrollRestoration: true, + appDir: true, ...nextConfig.experimental, }, eslint: { diff --git a/docs/pages/blog.tsx b/docs/pages/blog-old.tsx similarity index 100% rename from docs/pages/blog.tsx rename to docs/pages/blog-old.tsx diff --git a/docs/src/modules/components/AppFrame.js b/docs/src/modules/components/AppFrame.js index f3f09431e96e40..a6361ead1f4e38 100644 --- a/docs/src/modules/components/AppFrame.js +++ b/docs/src/modules/components/AppFrame.js @@ -51,13 +51,13 @@ export function NextNProgressBar() { } }; - router.events.on('routeChangeStart', handleRouteChangeStart); - router.events.on('routeChangeComplete', handleRouteChangeDone); - router.events.on('routeChangeError', handleRouteChangeDone); + router?.events.on('routeChangeStart', handleRouteChangeStart); + router?.events.on('routeChangeComplete', handleRouteChangeDone); + router?.events.on('routeChangeError', handleRouteChangeDone); return () => { - router.events.off('routeChangeStart', handleRouteChangeStart); - router.events.off('routeChangeComplete', handleRouteChangeDone); - router.events.off('routeChangeError', handleRouteChangeDone); + router?.events.off('routeChangeStart', handleRouteChangeStart); + router?.events.off('routeChangeComplete', handleRouteChangeDone); + router?.events.off('routeChangeError', handleRouteChangeDone); }; }, [router]); diff --git a/docs/src/modules/components/Head.tsx b/docs/src/modules/components/Head.tsx index fc9e8ef9b88c5e..cce7bb5ac1950f 100644 --- a/docs/src/modules/components/Head.tsx +++ b/docs/src/modules/components/Head.tsx @@ -1,9 +1,9 @@ import * as React from 'react'; import NextHead from 'next/head'; -import { useRouter } from 'next/router'; -import { LANGUAGES_SSR } from 'docs/src/modules/constants'; +// import { useRouter } from 'next/router'; +// import { LANGUAGES_SSR } from 'docs/src/modules/constants'; import { useUserLanguage, useTranslate } from 'docs/src/modules/utils/i18n'; -import { pathnameToLanguage } from 'docs/src/modules/utils/helpers'; +// import { pathnameToLanguage } from 'docs/src/modules/utils/helpers'; // #major-version-switch const HOST = 'https://mui.com'; @@ -12,7 +12,6 @@ interface HeadProps { card?: string; children?: React.ReactNode; description: string; - disableAlternateLocale?: boolean; largeCard?: boolean; title: string; type?: string; @@ -24,14 +23,11 @@ export default function Head(props: HeadProps) { card = '/static/social-previews/default-preview.jpg', children, description = t('strapline'), - disableAlternateLocale = false, largeCard = true, title = t('headTitle'), type = 'website', } = props; const userLanguage = useUserLanguage(); - const router = useRouter(); - const { canonicalAs } = pathnameToLanguage(router.asPath); const preview = card.startsWith('http') ? card : `${HOST}${card}`; return ( @@ -50,7 +46,7 @@ export default function Head(props: HeadProps) { {/* #major-version-switch */} - + @@ -58,18 +54,6 @@ export default function Head(props: HeadProps) { {/* #major-version-switch */} - {disableAlternateLocale - ? null - : LANGUAGES_SSR.map((userLanguage2) => ( - - ))} {children} ); diff --git a/docs/src/modules/components/Link.tsx b/docs/src/modules/components/Link.tsx index 7640678f400254..57fb431dbb8994 100644 --- a/docs/src/modules/components/Link.tsx +++ b/docs/src/modules/components/Link.tsx @@ -1,6 +1,9 @@ +'use client'; + import * as React from 'react'; import clsx from 'clsx'; import { useRouter } from 'next/router'; +import { usePathname } from 'next/navigation'; import NextLink, { LinkProps as NextLinkProps } from 'next/link'; import MuiLink, { LinkProps as MuiLinkProps } from '@mui/material/Link'; import { styled } from '@mui/material/styles'; @@ -87,10 +90,11 @@ const Link = React.forwardRef(function Link(props, } = props; const router = useRouter(); - const pathname = typeof href === 'string' ? href : href?.pathname; - const className = clsx(classNameProps, { - [activeClassName]: router.pathname === pathname && activeClassName, - }); + // Next.js 13 pathname + const next13Pathname = usePathname(); + + const pathname = typeof href === 'string' ? href : href.pathname; + const className = clsx(classNameProps); const isExternal = typeof href === 'string' && (href.indexOf('http') === 0 || href.indexOf('mailto:') === 0); diff --git a/docs/src/modules/components/TopLayoutBlog.js b/docs/src/modules/components/TopLayoutBlog.js index b22ac51628c605..52950c18398e19 100644 --- a/docs/src/modules/components/TopLayoutBlog.js +++ b/docs/src/modules/components/TopLayoutBlog.js @@ -1,3 +1,5 @@ +'use client'; + import * as React from 'react'; import PropTypes from 'prop-types'; import { styled, alpha } from '@mui/material/styles'; diff --git a/docs/tsconfig.json b/docs/tsconfig.json index b3282c841557ef..f372b7e8aadbb3 100644 --- a/docs/tsconfig.json +++ b/docs/tsconfig.json @@ -1,6 +1,6 @@ { "extends": "../tsconfig.json", - "include": ["next-env.d.ts", "types", "src", "pages", "data"], + "include": ["next-env.d.ts", "types", "src", "pages", "data", ".next/types/**/*.ts"], "compilerOptions": { "allowJs": true, "isolatedModules": true, @@ -11,7 +11,12 @@ "skipLibCheck": true, "esModuleInterop": true, "types": ["react"], - "incremental": true + "incremental": true, + "plugins": [ + { + "name": "next" + } + ] }, "exclude": ["node_modules"] } diff --git a/packages/mui-base/src/TextareaAutosize/TextareaAutosize.js b/packages/mui-base/src/TextareaAutosize/TextareaAutosize.js index e47acd62bcf0d5..4aca1d8b1d870d 100644 --- a/packages/mui-base/src/TextareaAutosize/TextareaAutosize.js +++ b/packages/mui-base/src/TextareaAutosize/TextareaAutosize.js @@ -1,3 +1,5 @@ +'use client'; + import * as React from 'react'; import PropTypes from 'prop-types'; import { flushSync } from 'react-dom'; diff --git a/packages/mui-docs/src/NProgressBar/NProgressBar.js b/packages/mui-docs/src/NProgressBar/NProgressBar.js index c952e253d4de2e..82f99175463a9c 100644 --- a/packages/mui-docs/src/NProgressBar/NProgressBar.js +++ b/packages/mui-docs/src/NProgressBar/NProgressBar.js @@ -17,12 +17,12 @@ NProgress.configure({ }); const styles = (theme) => { - if (!theme.nprogress.color) { - throw new Error( - 'MUI: You need to provide a `theme.nprogress.color` property' + - ' for using the `NProgressBar` component.', - ); - } + // if (!theme.nprogress?.color) { + // throw new Error( + // 'MUI: You need to provide a `theme.nprogress.color` property' + + // ' for using the `NProgressBar` component.', + // ); + // } return { '@global': { @@ -39,7 +39,7 @@ const styles = (theme) => { theme.palette.mode === 'dark' ? theme.palette.primary[700] : theme.palette.primary[200], '& .nprogress-bar': { position: 'fixed', - backgroundColor: theme.nprogress.color, + backgroundColor: theme.nprogress?.color, top: 0, left: 0, right: 0, @@ -49,7 +49,7 @@ const styles = (theme) => { position: 'absolute', top: 0, height: 2, - boxShadow: `${theme.nprogress.color} 1px 0 6px 1px`, + boxShadow: `${theme.nprogress?.color} 1px 0 6px 1px`, borderRadius: '100%', animation: 'mui-nprogress-pulse 2s ease-out 0s infinite', }, diff --git a/packages/mui-material/src/Typography/Typography.js b/packages/mui-material/src/Typography/Typography.js index 37d1d450cfe65f..e8235de6fc5603 100644 --- a/packages/mui-material/src/Typography/Typography.js +++ b/packages/mui-material/src/Typography/Typography.js @@ -1,3 +1,5 @@ +'use client'; + import * as React from 'react'; import PropTypes from 'prop-types'; import clsx from 'clsx'; From d2f062d9defc9fd240becac2b269905f971b5fc2 Mon Sep 17 00:00:00 2001 From: Marija Najdova Date: Thu, 24 Nov 2022 13:03:28 +0100 Subject: [PATCH 8/9] more updates - fixed emotion context error --- docs/app/Box.tsx | 8 + docs/app/{blog => }/BrandingProvider.tsx | 0 docs/app/Divider.tsx | 8 + docs/app/EmotionRootStyleRegistry.tsx | 61 +++++++ docs/app/GradientText.tsx | 8 + docs/app/Paper.tsx | 8 + docs/app/Section.tsx | 8 + docs/app/blog/ClientComponent.tsx | 12 ++ docs/app/blog/PostPreview.tsx | 4 + docs/app/blog/ServerComponent.tsx | 6 + docs/app/blog/layout.tsx | 5 +- docs/app/blog/page.tsx | 34 ++-- docs/app/layout.tsx | 9 +- docs/package.json | 2 +- docs/src/modules/components/AppFrame.js | 2 +- docs/src/modules/components/AppNavDrawer.js | 2 +- docs/src/modules/components/AppSearch.js | 8 +- yarn.lock | 174 ++++++++++---------- 18 files changed, 244 insertions(+), 115 deletions(-) create mode 100644 docs/app/Box.tsx rename docs/app/{blog => }/BrandingProvider.tsx (100%) create mode 100644 docs/app/Divider.tsx create mode 100644 docs/app/EmotionRootStyleRegistry.tsx create mode 100644 docs/app/GradientText.tsx create mode 100644 docs/app/Paper.tsx create mode 100644 docs/app/Section.tsx create mode 100644 docs/app/blog/ClientComponent.tsx create mode 100644 docs/app/blog/ServerComponent.tsx diff --git a/docs/app/Box.tsx b/docs/app/Box.tsx new file mode 100644 index 00000000000000..f59361fe022bf5 --- /dev/null +++ b/docs/app/Box.tsx @@ -0,0 +1,8 @@ +'use client'; + +import * as React from 'react'; +import MuiBox from '@mui/material/Box'; + +export default function Box(props) { + return ; +} diff --git a/docs/app/blog/BrandingProvider.tsx b/docs/app/BrandingProvider.tsx similarity index 100% rename from docs/app/blog/BrandingProvider.tsx rename to docs/app/BrandingProvider.tsx diff --git a/docs/app/Divider.tsx b/docs/app/Divider.tsx new file mode 100644 index 00000000000000..13563ca08d01d2 --- /dev/null +++ b/docs/app/Divider.tsx @@ -0,0 +1,8 @@ +'use client'; + +import * as React from 'react'; +import MuiDivider from '@mui/material/Divider'; + +export default function Divider(props) { + return ; +} diff --git a/docs/app/EmotionRootStyleRegistry.tsx b/docs/app/EmotionRootStyleRegistry.tsx new file mode 100644 index 00000000000000..81e7ce9ccaa57d --- /dev/null +++ b/docs/app/EmotionRootStyleRegistry.tsx @@ -0,0 +1,61 @@ +'use client'; +import * as React from 'react'; +import { CacheProvider } from '@emotion/react'; +import createCache from '@emotion/cache'; +import { useServerInsertedHTML } from 'next/navigation'; +import { useState } from 'react'; +import BrandingProvider from './BrandingProvider'; +// import { ThemeProvider, createTheme } from '@mui/material/styles'; +// import { green, deepPurple } from '@mui/material/colors'; + +// const theme = createTheme({ +// palette: { +// primary: green, +// secondary: deepPurple +// } +// }); + +export default function RootStyleRegistry({ children }: { children: JSX.Element }) { + const [{ cache, flush }] = useState(() => { + const cache = createCache({ key: 'my' }); + cache.compat = true; + const prevInsert = cache.insert; + let inserted: string[] = []; + cache.insert = (...args) => { + const serialized = args[1]; + if (cache.inserted[serialized.name] === undefined) { + inserted.push(serialized.name); + } + return prevInsert(...args); + }; + const flush = () => { + const prevInserted = inserted; + inserted = []; + return prevInserted; + }; + return { cache, flush }; + }); + + useServerInsertedHTML(() => { + const names = flush(); + if (names.length === 0) return null; + let styles = ''; + for (const name of names) { + styles += cache.inserted[name]; + } + return ( +