@mui/material-nextjs 7.0.2 → 7.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +97 -0
- package/esm/v13-appRouter/appRouterV13.js +1 -1
- package/esm/v13-pagesRouter/createCache.d.ts +4 -2
- package/esm/v13-pagesRouter/createCache.js +17 -2
- package/esm/v13-pagesRouter/pagesRouterV13Document.js +16 -8
- package/package.json +4 -4
- package/v13-appRouter/appRouterV13.js +1 -1
- package/v13-pagesRouter/createCache.d.ts +4 -2
- package/v13-pagesRouter/createCache.js +17 -2
- package/v13-pagesRouter/pagesRouterV13Document.js +16 -8
- package/modern/v13-appRouter/appRouterV13.d.ts +0 -27
- package/modern/v13-appRouter/index.d.ts +0 -2
- package/modern/v13-pagesRouter/createCache.d.ts +0 -2
- package/modern/v13-pagesRouter/index.d.ts +0 -3
- package/modern/v13-pagesRouter/pagesRouterV13App.d.ts +0 -9
- package/modern/v13-pagesRouter/pagesRouterV13Document.d.ts +0 -23
- package/modern/v14-appRouter/index.d.ts +0 -1
- package/modern/v14-pagesRouter/index.d.ts +0 -1
- package/modern/v15-appRouter/index.d.ts +0 -1
- package/modern/v15-pagesRouter/index.d.ts +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,102 @@
|
|
|
1
1
|
# [Versions](https://mui.com/versions/)
|
|
2
2
|
|
|
3
|
+
## 7.1.0
|
|
4
|
+
|
|
5
|
+
<!-- generated comparing v7.0.2..master -->
|
|
6
|
+
|
|
7
|
+
_May 6, 2025_
|
|
8
|
+
|
|
9
|
+
A big thanks to the 21 contributors who made this release possible. Here are some highlights ✨:
|
|
10
|
+
|
|
11
|
+
- 🎉 Material UI now works with **Tailwind CSS v4**! Check out the [setup guide](https://mui.com/material-ui/integrations/tailwindcss/tailwindcss-v4/).
|
|
12
|
+
|
|
13
|
+
### `@mui/material@7.1.0`
|
|
14
|
+
|
|
15
|
+
- [InputBase] Text cursor jumps several lines up when inserting text fragment with new line at the end (#45246) @yermartee
|
|
16
|
+
- [OutlinedInput] Add missing `notchedOutline` slot (#45917) @siriwatknp
|
|
17
|
+
- [Snackbar] Skip default `onClickAway` behavior when `defaultMuiPrevented` is provided (#45629) @sai6855
|
|
18
|
+
- [Avatar] Fix img slot types and add missing slots (#45483) @siriwatknp
|
|
19
|
+
- [Badge] Replace useSlotProps with useSlot hook (#45871) @sai6855
|
|
20
|
+
- [BottomNavigationAction] Add slots and slotProps (#45776) @sai6855
|
|
21
|
+
- [CardActionArea] Add slots and slotProps (#45866) @sai6855
|
|
22
|
+
- [useMediaQuery] Add warning and docs for using `useMediaQuery('print')` (#44790) @good-jinu
|
|
23
|
+
- Remove unnecessary clsx usages (#46084) @sai6855
|
|
24
|
+
- Corrected generic type definition in `SelectChangeEvent` (#45941) @SuyashShukla0007
|
|
25
|
+
- Fix theme object changes between renders (#45863) @siriwatknp
|
|
26
|
+
|
|
27
|
+
### `@mui/material-nextjs@7.1.0`
|
|
28
|
+
|
|
29
|
+
- Add option to enable CSS layers for pages router (#45596) @siriwatknp
|
|
30
|
+
- Do not wrap `@layer` order rules in App Router (#45864) @Nayeem-XTREME
|
|
31
|
+
|
|
32
|
+
### `@mui/system@7.1.0`
|
|
33
|
+
|
|
34
|
+
- Fix `@mui/system` types organization (#45860) @Janpot
|
|
35
|
+
|
|
36
|
+
### `@mui/styled-engine@7.1.0`
|
|
37
|
+
|
|
38
|
+
- Infer `ownerState` from props in `styled` (#46083) @siriwatknp
|
|
39
|
+
- Fix style overrides variants type (#45478) @siriwatknp
|
|
40
|
+
|
|
41
|
+
### Docs
|
|
42
|
+
|
|
43
|
+
- [Avatar] Add avatar upload demo (#45986) @Demianeen
|
|
44
|
+
- [Dialog] Remove deprecated props usage in demos (#45923) @sai6855
|
|
45
|
+
- [Menu] Update `paper` slot JSDoc default from `Paper` to `PopoverPaper` (#45722) @andreachiera
|
|
46
|
+
- [examples] Remove create-react-app usages (#45426) @CodeLeom
|
|
47
|
+
- Add `AccordionSummary` to the v5 breaking change migration (#45947) @siriwatknp
|
|
48
|
+
- Update CSS variable usage in migration guide for Pigment CSS (#46033) @sai6855
|
|
49
|
+
- Fix docs API dark mode color (#46086) @alexfauquette
|
|
50
|
+
- Add a guide for extending Material UI classes in Tailwind CSS (#46039) @siriwatknp
|
|
51
|
+
- Add `InitColorSchemeScript` docs and API (#45927) @siriwatknp
|
|
52
|
+
- Add Tailwind CSS v4 integration guide (#45906) @siriwatknp
|
|
53
|
+
- Fix 301 links to the system v6 (#45931) @oliviertassinari
|
|
54
|
+
- Add notification for MUI X v8 announcement (#45942) @joserodolfofreitas
|
|
55
|
+
- Fix som 301 redirections (ae84b35) @oliviertassinari
|
|
56
|
+
- Fix some 301 redirections (057384e) @oliviertassinari
|
|
57
|
+
- Fix logo is not centered on small screens (#45920) @crabsim
|
|
58
|
+
- Fix line break typo (a2a62d5) @oliviertassinari
|
|
59
|
+
- Fix markdown typo in templates.md (#45914) @scyzoryck
|
|
60
|
+
- Add Next.js App Router guide for custom classnames (#45852) @siriwatknp
|
|
61
|
+
|
|
62
|
+
### Core
|
|
63
|
+
|
|
64
|
+
- [code-infra] Give a stable name to dev tool app (3889ded) @oliviertassinari
|
|
65
|
+
- [code-infra] Normalize author package in org (8135638) @oliviertassinari
|
|
66
|
+
- [code-infra] Correct some manually curated .d.ts files (#46054) @Janpot
|
|
67
|
+
- [code-infra] Align deps versions (#46048) @Janpot
|
|
68
|
+
- [code-infra] Fix dynamic import in imports resolver (#46046) @Janpot
|
|
69
|
+
- [code-infra] Eliminate `@mui/utils` deep imports (#46004) @Janpot
|
|
70
|
+
- [code-infra] Expand renovate.json for react types (#45935) @Janpot
|
|
71
|
+
- [code-infra] Make Argos upload script reusable (#45883) @Janpot
|
|
72
|
+
- [code-infra] Disallow redundant window prefixes for globals (#45880) @Janpot
|
|
73
|
+
- [code-infra] Remove type generation of modern build (#45912) @Janpot
|
|
74
|
+
- [code-infra] Clean up bundle size checker (#45622) @Janpot
|
|
75
|
+
- [code-infra] Fix `StrictMode` effects not being called twice in React 19 tests (#45812) @bernardobelchior
|
|
76
|
+
- [code-infra] Convert `@mui/utils` to typescript (#45671) @Janpot
|
|
77
|
+
- [docs-infra] Improve export into sandbox package.json (#46044) @oliviertassinari
|
|
78
|
+
- [docs-infra] Update feedback Node.js to v22 (#46064) @oliviertassinari
|
|
79
|
+
- [docs-infra] Normalize netlify.toml in org (b101d5c) @oliviertassinari
|
|
80
|
+
- [docs-infra] Uniformize Vale between repositories (0f79796) @oliviertassinari
|
|
81
|
+
- [docs-infra] Fix Vale no longer working (#46029) @oliviertassinari
|
|
82
|
+
- [docs-infra] Remove demo styling switch (#45926) @Janpot
|
|
83
|
+
- [docs-infra] StackBlitz WebContainer demos (#45924) @Janpot
|
|
84
|
+
- [docs-infra] Fix feedback management (#45872) @alexfauquette
|
|
85
|
+
- [test] Replace `playwright` with `@playwright/test` (#45998) @ZeeshanTamboli
|
|
86
|
+
- Fix internal version duplication (#46051) @oliviertassinari
|
|
87
|
+
- Avoid the need for `@mui/material/themeCssVarsAugmentation` (#46053) @Janpot
|
|
88
|
+
- Add security label to dependabot PRs (0a5c027) @oliviertassinari
|
|
89
|
+
- Remove unecessary versions (#46034) @oliviertassinari
|
|
90
|
+
- Remove redundant overrides resolver (#45970) @romgrk
|
|
91
|
+
- Fix duplicate branch reference (#45915) @oliviertassinari
|
|
92
|
+
- Fix outdated <link rel="shortcut icon" (#45916) @oliviertassinari
|
|
93
|
+
- Fix redirection chains (#45930) @oliviertassinari
|
|
94
|
+
- Run pnpm docs:sync-team (beee09f) @oliviertassinari
|
|
95
|
+
- Add `pkg.pr.new` publishing (#42984) @Aslemammad
|
|
96
|
+
- Remove @mui/base from the master branch (#45857) @mnajdova
|
|
97
|
+
|
|
98
|
+
All contributors of this release in alphabetical order: @alexfauquette, @andreachiera, @Aslemammad, @bernardobelchior, @CodeLeom, @crabsim, @Demianeen, @good-jinu, @Janpot, @joserodolfofreitas, @mnajdova, @Nayeem-XTREME, @oliviertassinari, @renovate[bot], @romgrk, @sai6855, @scyzoryck, @siriwatknp, @SuyashShukla0007, @yermartee, @ZeeshanTamboli
|
|
99
|
+
|
|
3
100
|
## 7.0.2
|
|
4
101
|
|
|
5
102
|
_Apr 9, 2025_
|
|
@@ -34,7 +34,7 @@ export default function AppRouterCacheProvider(props) {
|
|
|
34
34
|
let inserted = [];
|
|
35
35
|
// Override the insert method to support streaming SSR with flush().
|
|
36
36
|
cache.insert = (...args) => {
|
|
37
|
-
if (options?.enableCssLayer) {
|
|
37
|
+
if (options?.enableCssLayer && !args[1].styles.startsWith('@layer')) {
|
|
38
38
|
args[1].styles = `@layer mui {${args[1].styles}}`;
|
|
39
39
|
}
|
|
40
40
|
const [selector, serialized] = args;
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
export default function createEmotionCache(options?:
|
|
1
|
+
import createCache from '@emotion/cache';
|
|
2
|
+
export default function createEmotionCache(options?: {
|
|
3
|
+
enableCssLayer?: boolean;
|
|
4
|
+
} & Parameters<typeof createCache>[0]): import("@emotion/cache").EmotionCache;
|
|
@@ -10,9 +10,24 @@ export default function createEmotionCache(options) {
|
|
|
10
10
|
const emotionInsertionPoint = document.querySelector('meta[name="emotion-insertion-point"]');
|
|
11
11
|
insertionPoint = emotionInsertionPoint ?? undefined;
|
|
12
12
|
}
|
|
13
|
-
|
|
13
|
+
const {
|
|
14
|
+
enableCssLayer,
|
|
15
|
+
...rest
|
|
16
|
+
} = options ?? {};
|
|
17
|
+
const emotionCache = createCache({
|
|
14
18
|
key: 'mui',
|
|
15
19
|
insertionPoint,
|
|
16
|
-
...
|
|
20
|
+
...rest
|
|
17
21
|
});
|
|
22
|
+
if (enableCssLayer) {
|
|
23
|
+
const prevInsert = emotionCache.insert;
|
|
24
|
+
emotionCache.insert = (...args) => {
|
|
25
|
+
if (!args[1].styles.startsWith('@layer')) {
|
|
26
|
+
// avoid nested @layer
|
|
27
|
+
args[1].styles = `@layer mui {${args[1].styles}}`;
|
|
28
|
+
}
|
|
29
|
+
return prevInsert(...args);
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
return emotionCache;
|
|
18
33
|
}
|
|
@@ -74,14 +74,22 @@ export async function documentGetInitialProps(ctx, options) {
|
|
|
74
74
|
} = extractCriticalToChunks(initialProps.html);
|
|
75
75
|
return {
|
|
76
76
|
...initialProps,
|
|
77
|
-
emotionStyleTags: styles.map(style =>
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
77
|
+
emotionStyleTags: styles.map(style => {
|
|
78
|
+
if (!style.css.trim()) {
|
|
79
|
+
return null;
|
|
80
|
+
}
|
|
81
|
+
const isLayerOrderRule = style.css.startsWith('@layer') && !style.css.match(/\{.*\}/);
|
|
82
|
+
return /*#__PURE__*/_jsx("style", {
|
|
83
|
+
// If the style is a layer order rule, prefix with the cache key to let Emotion hydrate this node.
|
|
84
|
+
// Otherwise, Emotion will hydrate only the non-global styles and they will override the layer order rule.
|
|
85
|
+
"data-emotion": `${isLayerOrderRule ? `${cache.key} ` : ''}${style.key} ${style.ids.join(' ')}`,
|
|
86
|
+
// eslint-disable-next-line react/no-danger
|
|
87
|
+
dangerouslySetInnerHTML: {
|
|
88
|
+
__html: style.css
|
|
89
|
+
},
|
|
90
|
+
nonce: cache.nonce
|
|
91
|
+
}, style.key);
|
|
92
|
+
})
|
|
85
93
|
};
|
|
86
94
|
}
|
|
87
95
|
}, ...(options?.plugins ?? [])])(ctx);
|
package/package.json
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/material-nextjs",
|
|
3
|
-
"version": "7.0
|
|
4
|
-
"private": false,
|
|
3
|
+
"version": "7.1.0",
|
|
5
4
|
"author": "MUI Team",
|
|
6
5
|
"description": "Collection of utilities for integration between Material UI and Next.js.",
|
|
7
6
|
"keywords": [
|
|
@@ -24,7 +23,7 @@
|
|
|
24
23
|
"url": "https://opencollective.com/mui-org"
|
|
25
24
|
},
|
|
26
25
|
"dependencies": {
|
|
27
|
-
"@babel/runtime": "^7.27.
|
|
26
|
+
"@babel/runtime": "^7.27.1"
|
|
28
27
|
},
|
|
29
28
|
"peerDependencies": {
|
|
30
29
|
"@emotion/cache": "^11.11.0",
|
|
@@ -76,5 +75,6 @@
|
|
|
76
75
|
"default": "./esm/v13-pagesRouter/index.js"
|
|
77
76
|
}
|
|
78
77
|
}
|
|
79
|
-
}
|
|
78
|
+
},
|
|
79
|
+
"private": false
|
|
80
80
|
}
|
|
@@ -41,7 +41,7 @@ function AppRouterCacheProvider(props) {
|
|
|
41
41
|
let inserted = [];
|
|
42
42
|
// Override the insert method to support streaming SSR with flush().
|
|
43
43
|
cache.insert = (...args) => {
|
|
44
|
-
if (options?.enableCssLayer) {
|
|
44
|
+
if (options?.enableCssLayer && !args[1].styles.startsWith('@layer')) {
|
|
45
45
|
args[1].styles = `@layer mui {${args[1].styles}}`;
|
|
46
46
|
}
|
|
47
47
|
const [selector, serialized] = args;
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
export default function createEmotionCache(options?:
|
|
1
|
+
import createCache from '@emotion/cache';
|
|
2
|
+
export default function createEmotionCache(options?: {
|
|
3
|
+
enableCssLayer?: boolean;
|
|
4
|
+
} & Parameters<typeof createCache>[0]): import("@emotion/cache").EmotionCache;
|
|
@@ -17,9 +17,24 @@ function createEmotionCache(options) {
|
|
|
17
17
|
const emotionInsertionPoint = document.querySelector('meta[name="emotion-insertion-point"]');
|
|
18
18
|
insertionPoint = emotionInsertionPoint ?? undefined;
|
|
19
19
|
}
|
|
20
|
-
|
|
20
|
+
const {
|
|
21
|
+
enableCssLayer,
|
|
22
|
+
...rest
|
|
23
|
+
} = options ?? {};
|
|
24
|
+
const emotionCache = (0, _cache.default)({
|
|
21
25
|
key: 'mui',
|
|
22
26
|
insertionPoint,
|
|
23
|
-
...
|
|
27
|
+
...rest
|
|
24
28
|
});
|
|
29
|
+
if (enableCssLayer) {
|
|
30
|
+
const prevInsert = emotionCache.insert;
|
|
31
|
+
emotionCache.insert = (...args) => {
|
|
32
|
+
if (!args[1].styles.startsWith('@layer')) {
|
|
33
|
+
// avoid nested @layer
|
|
34
|
+
args[1].styles = `@layer mui {${args[1].styles}}`;
|
|
35
|
+
}
|
|
36
|
+
return prevInsert(...args);
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
return emotionCache;
|
|
25
40
|
}
|
|
@@ -84,14 +84,22 @@ async function documentGetInitialProps(ctx, options) {
|
|
|
84
84
|
} = extractCriticalToChunks(initialProps.html);
|
|
85
85
|
return {
|
|
86
86
|
...initialProps,
|
|
87
|
-
emotionStyleTags: styles.map(style =>
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
87
|
+
emotionStyleTags: styles.map(style => {
|
|
88
|
+
if (!style.css.trim()) {
|
|
89
|
+
return null;
|
|
90
|
+
}
|
|
91
|
+
const isLayerOrderRule = style.css.startsWith('@layer') && !style.css.match(/\{.*\}/);
|
|
92
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("style", {
|
|
93
|
+
// If the style is a layer order rule, prefix with the cache key to let Emotion hydrate this node.
|
|
94
|
+
// Otherwise, Emotion will hydrate only the non-global styles and they will override the layer order rule.
|
|
95
|
+
"data-emotion": `${isLayerOrderRule ? `${cache.key} ` : ''}${style.key} ${style.ids.join(' ')}`,
|
|
96
|
+
// eslint-disable-next-line react/no-danger
|
|
97
|
+
dangerouslySetInnerHTML: {
|
|
98
|
+
__html: style.css
|
|
99
|
+
},
|
|
100
|
+
nonce: cache.nonce
|
|
101
|
+
}, style.key);
|
|
102
|
+
})
|
|
95
103
|
};
|
|
96
104
|
}
|
|
97
105
|
}, ...(options?.plugins ?? [])])(ctx);
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { EmotionCache, Options as OptionsOfCreateCache } from '@emotion/cache';
|
|
3
|
-
export type AppRouterCacheProviderProps = {
|
|
4
|
-
/**
|
|
5
|
-
* These are the options passed to createCache() from 'import createCache from "@emotion/cache"'.
|
|
6
|
-
*/
|
|
7
|
-
options?: Partial<OptionsOfCreateCache> & {
|
|
8
|
-
/**
|
|
9
|
-
* If `true`, the generated styles are wrapped within `@layer mui`.
|
|
10
|
-
* This is useful if you want to override the Material UI's generated styles with different styling solution, like Tailwind CSS, plain CSS etc.
|
|
11
|
-
*/
|
|
12
|
-
enableCssLayer?: boolean;
|
|
13
|
-
};
|
|
14
|
-
/**
|
|
15
|
-
* By default <CacheProvider /> from 'import { CacheProvider } from "@emotion/react"'.
|
|
16
|
-
*/
|
|
17
|
-
CacheProvider?: React.ElementType<{
|
|
18
|
-
value: EmotionCache;
|
|
19
|
-
}>;
|
|
20
|
-
children: React.ReactNode;
|
|
21
|
-
};
|
|
22
|
-
/**
|
|
23
|
-
* Emotion works OK without this provider but it's recommended to use this provider to improve performance.
|
|
24
|
-
* Without it, Emotion will generate a new <style> tag during SSR for every component.
|
|
25
|
-
* See https://github.com/mui/material-ui/issues/26561#issuecomment-855286153 for why it's a problem.
|
|
26
|
-
*/
|
|
27
|
-
export default function AppRouterCacheProvider(props: AppRouterCacheProviderProps): React.JSX.Element;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { EmotionCache } from '@emotion/react';
|
|
3
|
-
export interface EmotionCacheProviderProps {
|
|
4
|
-
emotionCache?: EmotionCache;
|
|
5
|
-
}
|
|
6
|
-
export declare function AppCacheProvider({
|
|
7
|
-
emotionCache,
|
|
8
|
-
children
|
|
9
|
-
}: React.PropsWithChildren<EmotionCacheProviderProps>): React.JSX.Element;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { AppType } from 'next/app';
|
|
3
|
-
import { EmotionCache } from '@emotion/react';
|
|
4
|
-
import type { DocumentContext, DocumentInitialProps } from 'next/document';
|
|
5
|
-
interface Plugin {
|
|
6
|
-
enhanceApp: (App: React.ComponentType<React.ComponentProps<AppType>>) => (props: any) => React.JSX.Element;
|
|
7
|
-
resolveProps: (initialProps: DocumentInitialProps) => Promise<DocumentInitialProps>;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* A utility to compose multiple `getInitialProps` functions.
|
|
11
|
-
*/
|
|
12
|
-
export declare function createGetInitialProps(plugins: Plugin[]): (ctx: DocumentContext) => Promise<DocumentInitialProps>;
|
|
13
|
-
export interface DocumentHeadTagsProps {
|
|
14
|
-
emotionStyleTags: React.ReactElement<unknown>[];
|
|
15
|
-
}
|
|
16
|
-
export declare function DocumentHeadTags(props: DocumentHeadTagsProps): React.JSX.Element;
|
|
17
|
-
export declare function documentGetInitialProps(ctx: DocumentContext, options?: {
|
|
18
|
-
emotionCache?: EmotionCache;
|
|
19
|
-
plugins?: Plugin[];
|
|
20
|
-
}): Promise<import("next/dist/shared/lib/utils").RenderPageResult & {
|
|
21
|
-
styles?: React.ReactElement[] | Iterable<React.ReactNode> | React.JSX.Element;
|
|
22
|
-
} & DocumentHeadTagsProps>;
|
|
23
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "../v13-appRouter/index.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "../v13-pagesRouter/index.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "../v13-appRouter/index.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "../v13-pagesRouter/index.js";
|