@mui/material-nextjs 7.0.2 → 7.1.1

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 CHANGED
@@ -1,5 +1,174 @@
1
1
  # [Versions](https://mui.com/versions/)
2
2
 
3
+ ## 7.1.1
4
+
5
+ <!-- generated comparing v7.1.0..master -->
6
+
7
+ _May 30, 2025_
8
+
9
+ A big thanks to the 15 contributors who made this release possible.
10
+
11
+ ### `@mui/material@7.1.1`
12
+
13
+ - [Autocomplete] Fix label shrink issue when `renderValue` is used with empty array in multiple mode (#46047) @ZeeshanTamboli
14
+ - [Autocomplete] Prevent `renderValue` from being skipped when value is 0 (#46145) @LakshitAgarwal
15
+ - [Autocomplete] Add note in JSDoc for non-TextField components in `renderInput` (#46141) @khllbnomrn
16
+ - [Chip] Add slots and slotProps (#46098) @sai6855
17
+ - [Menu] Remove depreacted `MenuListProps` from demos (#46144) @sai6855
18
+ - [TablePaginationActions] Export TablePaginationActions as new component (#46149) @sai6855
19
+ - [SnackbarContent] Fix `square` prop not working (#46196) @0210shivam
20
+ - [SnackbarContent] Fix error when theme value is CSS variable (#46198) @0210shivam
21
+
22
+ ### `@mui/codemod@7.1.1`
23
+
24
+ - Add package name option (#45977) @siriwatknp
25
+
26
+ ### `@mui/system@7.1.1`
27
+
28
+ - Skip styled component from being transformed (#46129) @siriwatknp
29
+ - Update the type for borderRadius (#46154) @codiini
30
+
31
+ ### `@mui/styled-engine@7.1.1`
32
+
33
+ - Fix variant props callback type to spread `ownerState` (#46187) @siriwatknp
34
+
35
+ ### `@mui/stylis-plugin-rtl@7.1.1`
36
+
37
+ - Fix RTL does not work with CSS layer with a new package (#46230) @siriwatknp
38
+
39
+ ### Docs
40
+
41
+ - [Dialog] Remove deprecated TransitionComponent from demo (#46185) @sai6855
42
+ - [Grid] Remove direction `column` and `column-reverse` from the demo (#46127) @0210shivam
43
+ - [Grid] Update grid migration guide (#46057) @sai6855
44
+ - [templates] Fix rendering of logos in dark mode (#46221) @sai6855
45
+ - [ToggleButtonGroup] Add spacing demo (#46058) @sai6855
46
+ - Fix typo in dark mode docs (#46229) @ZeeshanTamboli
47
+ - Clarify Next.js + Tailwind CSS v3 integration requirements (#46176) @chaitanyasharma1011
48
+ - Fix GridLegacy docs order (#46135) @oliviertassinari
49
+ - Update upgrade guide for resolution of `react-is` (#46002) @siriwatknp
50
+ - Remove oudated scaffoldhub ad (#46090) @oliviertassinari
51
+ - Show how to target global state classes with CSS Modules (#45992) @RubemMazzetto
52
+
53
+ ### Core
54
+
55
+ - [code-infra] Add plugin to check for index file access (#46178) @Janpot
56
+ - [code-infra] Bump eslint to v9 (#46222) @brijeshb42
57
+ - [code-infra] Move packages to mui/mui-public (#46155) @Janpot
58
+ - [code-infra] Move `chai` to peerDep (#46227) @JCQuintas
59
+ - [code-infra] Avoid loading barrel file during type checking (#46177) @Janpot
60
+ - [code-infra] Remove unnecessary ref from `HighlightedCode` component (#46151) @ZeeshanTamboli
61
+ - [code-infra] Import mocha type instead of global (#46108) @JCQuintas
62
+ - [code-infra] Dependabot also create branches (795a481) @oliviertassinari
63
+ - [code-infra] Avoid running continuous release on forks (#46103) @Janpot
64
+ - [code-infra] Remove checkout job altogether (#46100) @Janpot
65
+ - [code-infra] Remove required checkout workflows in circleci (#46099) @Janpot
66
+ - Run pnpm docs:sync-team (c8f1da5) @oliviertassinari
67
+ - Upgrade MUI X packages to v8 (#45990) @KenanYusuf
68
+ - Minor detail to reduce confusion (4c64b72) @oliviertassinari
69
+ - Update security.md (#45839) @DiegoAndai
70
+ - Apply yml convention, blank line only at top level (f273220) @oliviertassinari
71
+ - Add comment that lab should be in alpha (#45999) @oliviertassinari
72
+
73
+ All contributors of this release in alphabetical order: @0210shivam, @brijeshb42, @chaitanyasharma1011, @codiini, @DiegoAndai, @Janpot, @JCQuintas, @KenanYusuf, @khllbnomrn, @LakshitAgarwal, @oliviertassinari, @RubemMazzetto, @sai6855, @siriwatknp, @ZeeshanTamboli
74
+
75
+ ## 7.1.0
76
+
77
+ <!-- generated comparing v7.0.2..master -->
78
+
79
+ _May 6, 2025_
80
+
81
+ A big thanks to the 21 contributors who made this release possible. Here are some highlights ✨:
82
+
83
+ - 🎉 Material UI now works with **Tailwind CSS v4**! Check out the [setup guide](https://mui.com/material-ui/integrations/tailwindcss/tailwindcss-v4/).
84
+
85
+ ### `@mui/material@7.1.0`
86
+
87
+ - [InputBase] Text cursor jumps several lines up when inserting text fragment with new line at the end (#45246) @yermartee
88
+ - [OutlinedInput] Add missing `notchedOutline` slot (#45917) @siriwatknp
89
+ - [Snackbar] Skip default `onClickAway` behavior when `defaultMuiPrevented` is provided (#45629) @sai6855
90
+ - [Avatar] Fix img slot types and add missing slots (#45483) @siriwatknp
91
+ - [Badge] Replace useSlotProps with useSlot hook (#45871) @sai6855
92
+ - [BottomNavigationAction] Add slots and slotProps (#45776) @sai6855
93
+ - [CardActionArea] Add slots and slotProps (#45866) @sai6855
94
+ - [useMediaQuery] Add warning and docs for using `useMediaQuery('print')` (#44790) @good-jinu
95
+ - Remove unnecessary clsx usages (#46084) @sai6855
96
+ - Corrected generic type definition in `SelectChangeEvent` (#45941) @SuyashShukla0007
97
+ - Fix theme object changes between renders (#45863) @siriwatknp
98
+
99
+ ### `@mui/material-nextjs@7.1.0`
100
+
101
+ - Add option to enable CSS layers for pages router (#45596) @siriwatknp
102
+ - Do not wrap `@layer` order rules in App Router (#45864) @Nayeem-XTREME
103
+
104
+ ### `@mui/system@7.1.0`
105
+
106
+ - Fix `@mui/system` types organization (#45860) @Janpot
107
+
108
+ ### `@mui/styled-engine@7.1.0`
109
+
110
+ - Infer `ownerState` from props in `styled` (#46083) @siriwatknp
111
+ - Fix style overrides variants type (#45478) @siriwatknp
112
+
113
+ ### Docs
114
+
115
+ - [Avatar] Add avatar upload demo (#45986) @Demianeen
116
+ - [Dialog] Remove deprecated props usage in demos (#45923) @sai6855
117
+ - [Menu] Update `paper` slot JSDoc default from `Paper` to `PopoverPaper` (#45722) @andreachiera
118
+ - [examples] Remove create-react-app usages (#45426) @CodeLeom
119
+ - Add `AccordionSummary` to the v5 breaking change migration (#45947) @siriwatknp
120
+ - Update CSS variable usage in migration guide for Pigment CSS (#46033) @sai6855
121
+ - Fix docs API dark mode color (#46086) @alexfauquette
122
+ - Add a guide for extending Material UI classes in Tailwind CSS (#46039) @siriwatknp
123
+ - Add `InitColorSchemeScript` docs and API (#45927) @siriwatknp
124
+ - Add Tailwind CSS v4 integration guide (#45906) @siriwatknp
125
+ - Fix 301 links to the system v6 (#45931) @oliviertassinari
126
+ - Add notification for MUI X v8 announcement (#45942) @joserodolfofreitas
127
+ - Fix som 301 redirections (ae84b35) @oliviertassinari
128
+ - Fix some 301 redirections (057384e) @oliviertassinari
129
+ - Fix logo is not centered on small screens (#45920) @crabsim
130
+ - Fix line break typo (a2a62d5) @oliviertassinari
131
+ - Fix markdown typo in templates.md (#45914) @scyzoryck
132
+ - Add Next.js App Router guide for custom classnames (#45852) @siriwatknp
133
+
134
+ ### Core
135
+
136
+ - [code-infra] Give a stable name to dev tool app (3889ded) @oliviertassinari
137
+ - [code-infra] Normalize author package in org (8135638) @oliviertassinari
138
+ - [code-infra] Correct some manually curated .d.ts files (#46054) @Janpot
139
+ - [code-infra] Align deps versions (#46048) @Janpot
140
+ - [code-infra] Fix dynamic import in imports resolver (#46046) @Janpot
141
+ - [code-infra] Eliminate `@mui/utils` deep imports (#46004) @Janpot
142
+ - [code-infra] Expand renovate.json for react types (#45935) @Janpot
143
+ - [code-infra] Make Argos upload script reusable (#45883) @Janpot
144
+ - [code-infra] Disallow redundant window prefixes for globals (#45880) @Janpot
145
+ - [code-infra] Remove type generation of modern build (#45912) @Janpot
146
+ - [code-infra] Clean up bundle size checker (#45622) @Janpot
147
+ - [code-infra] Fix `StrictMode` effects not being called twice in React 19 tests (#45812) @bernardobelchior
148
+ - [code-infra] Convert `@mui/utils` to typescript (#45671) @Janpot
149
+ - [docs-infra] Improve export into sandbox package.json (#46044) @oliviertassinari
150
+ - [docs-infra] Update feedback Node.js to v22 (#46064) @oliviertassinari
151
+ - [docs-infra] Normalize netlify.toml in org (b101d5c) @oliviertassinari
152
+ - [docs-infra] Uniformize Vale between repositories (0f79796) @oliviertassinari
153
+ - [docs-infra] Fix Vale no longer working (#46029) @oliviertassinari
154
+ - [docs-infra] Remove demo styling switch (#45926) @Janpot
155
+ - [docs-infra] StackBlitz WebContainer demos (#45924) @Janpot
156
+ - [docs-infra] Fix feedback management (#45872) @alexfauquette
157
+ - [test] Replace `playwright` with `@playwright/test` (#45998) @ZeeshanTamboli
158
+ - Fix internal version duplication (#46051) @oliviertassinari
159
+ - Avoid the need for `@mui/material/themeCssVarsAugmentation` (#46053) @Janpot
160
+ - Add security label to dependabot PRs (0a5c027) @oliviertassinari
161
+ - Remove unecessary versions (#46034) @oliviertassinari
162
+ - Remove redundant overrides resolver (#45970) @romgrk
163
+ - Fix duplicate branch reference (#45915) @oliviertassinari
164
+ - Fix outdated <link rel="shortcut icon" (#45916) @oliviertassinari
165
+ - Fix redirection chains (#45930) @oliviertassinari
166
+ - Run pnpm docs:sync-team (beee09f) @oliviertassinari
167
+ - Add `pkg.pr.new` publishing (#42984) @Aslemammad
168
+ - Remove @mui/base from the master branch (#45857) @mnajdova
169
+
170
+ 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
171
+
3
172
  ## 7.0.2
4
173
 
5
174
  _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 { Options } from '@emotion/cache';
2
- export default function createEmotionCache(options?: Partial<Options>): import("@emotion/cache").EmotionCache;
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
- return createCache({
13
+ const {
14
+ enableCssLayer,
15
+ ...rest
16
+ } = options ?? {};
17
+ const emotionCache = createCache({
14
18
  key: 'mui',
15
19
  insertionPoint,
16
- ...options
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 => style.css.trim() ? /*#__PURE__*/_jsx("style", {
78
- "data-emotion": `${style.key} ${style.ids.join(' ')}`,
79
- // eslint-disable-next-line react/no-danger
80
- dangerouslySetInnerHTML: {
81
- __html: style.css
82
- },
83
- nonce: cache.nonce
84
- }, style.key) : null)
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.2",
4
- "private": false,
3
+ "version": "7.1.1",
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.0"
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 { Options } from '@emotion/cache';
2
- export default function createEmotionCache(options?: Partial<Options>): import("@emotion/cache").EmotionCache;
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
- return (0, _cache.default)({
20
+ const {
21
+ enableCssLayer,
22
+ ...rest
23
+ } = options ?? {};
24
+ const emotionCache = (0, _cache.default)({
21
25
  key: 'mui',
22
26
  insertionPoint,
23
- ...options
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 => style.css.trim() ? /*#__PURE__*/(0, _jsxRuntime.jsx)("style", {
88
- "data-emotion": `${style.key} ${style.ids.join(' ')}`,
89
- // eslint-disable-next-line react/no-danger
90
- dangerouslySetInnerHTML: {
91
- __html: style.css
92
- },
93
- nonce: cache.nonce
94
- }, style.key) : null)
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,2 +0,0 @@
1
- export { default as AppRouterCacheProvider } from "./appRouterV13.js";
2
- export * from "./appRouterV13.js";
@@ -1,2 +0,0 @@
1
- import { Options } from '@emotion/cache';
2
- export default function createEmotionCache(options?: Partial<Options>): import("@emotion/cache").EmotionCache;
@@ -1,3 +0,0 @@
1
- export * from "./pagesRouterV13Document.js";
2
- export * from "./pagesRouterV13App.js";
3
- export { default as createEmotionCache } from "./createCache.js";
@@ -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";