@mui/material-nextjs 7.0.0-alpha.0 → 7.0.0-alpha.2

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.
Files changed (73) hide show
  1. package/CHANGELOG.md +92 -0
  2. package/esm/package.json +1 -0
  3. package/esm/v13-appRouter/appRouterV13.d.ts +27 -0
  4. package/{node → esm}/v13-appRouter/appRouterV13.js +13 -20
  5. package/esm/v13-appRouter/index.d.ts +2 -0
  6. package/esm/v13-appRouter/index.js +2 -0
  7. package/esm/v13-pagesRouter/createCache.d.ts +1 -0
  8. package/{node → esm}/v13-pagesRouter/createCache.js +3 -10
  9. package/esm/v13-pagesRouter/index.d.ts +2 -0
  10. package/esm/v13-pagesRouter/index.js +2 -0
  11. package/esm/v13-pagesRouter/nextDocument.cjs +1 -0
  12. package/esm/v13-pagesRouter/nextDocument.d.cts +2 -0
  13. package/esm/v13-pagesRouter/pagesRouterV13App.d.ts +9 -0
  14. package/esm/v13-pagesRouter/pagesRouterV13App.js +14 -0
  15. package/esm/v13-pagesRouter/pagesRouterV13Document.d.ts +23 -0
  16. package/{node → esm}/v13-pagesRouter/pagesRouterV13Document.js +16 -25
  17. package/esm/v14-appRouter/index.d.ts +1 -0
  18. package/esm/v14-appRouter/index.js +1 -0
  19. package/esm/v14-pagesRouter/index.d.ts +1 -0
  20. package/esm/v14-pagesRouter/index.js +1 -0
  21. package/esm/v15-appRouter/index.d.ts +1 -0
  22. package/esm/v15-appRouter/index.js +1 -0
  23. package/esm/v15-pagesRouter/index.d.ts +1 -0
  24. package/esm/v15-pagesRouter/index.js +1 -0
  25. package/modern/package.json +1 -0
  26. package/modern/v13-appRouter/appRouterV13.d.ts +27 -0
  27. package/modern/v13-appRouter/index.d.ts +2 -0
  28. package/modern/v13-pagesRouter/createCache.d.ts +1 -0
  29. package/modern/v13-pagesRouter/index.d.ts +2 -0
  30. package/modern/v13-pagesRouter/nextDocument.cjs +1 -0
  31. package/modern/v13-pagesRouter/pagesRouterV13App.d.ts +9 -0
  32. package/modern/v13-pagesRouter/pagesRouterV13Document.d.ts +23 -0
  33. package/modern/v13-pagesRouter/pagesRouterV13Document.js +2 -1
  34. package/modern/v14-appRouter/index.d.ts +1 -0
  35. package/modern/v14-pagesRouter/index.d.ts +1 -0
  36. package/modern/v15-appRouter/index.d.ts +1 -0
  37. package/modern/v15-pagesRouter/index.d.ts +1 -0
  38. package/package.json +33 -2
  39. package/tsconfig.build.tsbuildinfo +1 -0
  40. package/v13-appRouter/appRouterV13.d.ts +16 -16
  41. package/v13-appRouter/appRouterV13.js +20 -13
  42. package/v13-appRouter/index.d.ts +2 -2
  43. package/v13-appRouter/index.js +27 -2
  44. package/v13-pagesRouter/createCache.d.ts +1 -1
  45. package/v13-pagesRouter/createCache.js +10 -3
  46. package/v13-pagesRouter/index.d.ts +2 -2
  47. package/v13-pagesRouter/index.js +27 -2
  48. package/v13-pagesRouter/nextDocument.cjs +1 -0
  49. package/v13-pagesRouter/pagesRouterV13App.d.ts +5 -2
  50. package/v13-pagesRouter/pagesRouterV13App.js +15 -7
  51. package/v13-pagesRouter/pagesRouterV13Document.d.ts +8 -8
  52. package/v13-pagesRouter/pagesRouterV13Document.js +25 -14
  53. package/v14-appRouter/index.d.ts +1 -1
  54. package/v14-appRouter/index.js +16 -1
  55. package/v14-pagesRouter/index.d.ts +1 -1
  56. package/v14-pagesRouter/index.js +16 -1
  57. package/v15-appRouter/index.d.ts +1 -1
  58. package/v15-appRouter/index.js +16 -1
  59. package/v15-pagesRouter/index.d.ts +1 -1
  60. package/v15-pagesRouter/index.js +16 -1
  61. package/node/v13-appRouter/index.js +0 -27
  62. package/node/v13-pagesRouter/index.js +0 -27
  63. package/node/v13-pagesRouter/pagesRouterV13App.js +0 -22
  64. package/node/v14-appRouter/index.js +0 -16
  65. package/node/v14-pagesRouter/index.js +0 -16
  66. package/node/v15-appRouter/index.js +0 -16
  67. package/node/v15-pagesRouter/index.js +0 -16
  68. package/v13-appRouter/package.json +0 -6
  69. package/v13-pagesRouter/package.json +0 -6
  70. package/v14-appRouter/package.json +0 -6
  71. package/v14-pagesRouter/package.json +0 -6
  72. package/v15-appRouter/package.json +0 -6
  73. package/v15-pagesRouter/package.json +0 -6
package/CHANGELOG.md CHANGED
@@ -1,5 +1,97 @@
1
1
  # [Versions](https://mui.com/versions/)
2
2
 
3
+ ## 7.0.0-alpha.2
4
+
5
+ <!-- generated comparing v7.0.0-alpha.1..master -->
6
+
7
+ _Feb 18, 2025_
8
+
9
+ A big thanks to the 9 contributors who made this release possible.
10
+
11
+ ### `@mui/material@7.0.0-alpha.2`
12
+
13
+ - [Autocomplete] Remove legacy `aria-owns` attribute for combobox (#45302) @ZeeshanTamboli
14
+ - [Button] Apply id only if loading indicator is present (#45296) @aarongarciah
15
+ - [Hidden] Remove deprecated Hidden component (#45283) @DiegoAndai
16
+ - [InputBase] Deprecate composed classes (#45234) @sai6855
17
+ - [InputLabel] Changed size prop value from `normal` to `medium` (#45235) @perkrlsn
18
+ - Fix `slotProps.transition` types (#45214) @siriwatknp
19
+
20
+ ### Docs
21
+
22
+ - Fix broken links to MUI X docs (#45145) @mapache-salvaje
23
+ - Add migration guide for package layout changes (#45222) @Janpot
24
+ - [icons] Fix typo in material-icons.md (#45334) @a-s-russo
25
+
26
+ ### Core
27
+
28
+ - Disallow access to esm/modern barrel files (#45332) @Janpot
29
+ - [code-infra] Update `elliptic` (#45311) @Janpot
30
+ - Update release guide to specify package bumping rules (#45294) @DiegoAndai
31
+
32
+ All contributors of this release in alphabetical order: @a-s-russo, @aarongarciah, @DiegoAndai, @Janpot, @mapache-salvaje, @perkrlsn, @sai6855, @siriwatknp, @ZeeshanTamboli
33
+
34
+ ## 7.0.0-alpha.1
35
+
36
+ <!-- generated comparing v7.0.0-alpha.0..master -->
37
+
38
+ _Feb 11, 2025_
39
+
40
+ A big thanks to the 11 contributors who made this release possible.
41
+
42
+ ### `@mui/material@7.0.0-alpha.1`
43
+
44
+ - [Checkbox] Add slots and slotProps (#44974) @sai6855
45
+ - [LinearProgress][CircularProgress] Add variant overrides for module augumentation (#45163) @kingflamez
46
+ - [Drawer] Deprecate \*Props and complete `slots`, `slotProps` (#44960) @siriwatknp
47
+ - Fix wrong `slotProps` of `DetailsHTMLAttributes` types (#45215) @siriwatknp
48
+ - [MobileStepper] deprecate `LinearProgressProps` and complete `slots`, `slotProps` (#45033) @siriwatknp
49
+ - [Radio] Add slots and slotProps (#44972) @sai6855
50
+ - [Radio] Remove empty line (#45184) @sai6855
51
+ - [Slider] Deprecate composed classes (#45201) @sai6855
52
+ - [Snackbar] Fix generated proptypes (#45156) @siriwatknp
53
+ - [SpeedDialAction] Add slots and slotProps (#45065) @sai6855
54
+ - [SwitchBase] Fix spreading of `handlers` in getSlotProps (#45197) @sai6855
55
+ - [Tabs] Deprecate \*Props and complete `slots`, `slotProps` (#45012) @siriwatknp
56
+ - [TextField] Remove deprecated props from documentation (#45199) @sai6855
57
+
58
+ ### `@mui/icons-material@7.0.0-alpha.1`
59
+
60
+ - Change icon source URL and add overrides (#45020) @siriwatknp
61
+
62
+ ### `@mui/lab@7.0.0-beta.1`
63
+
64
+ - Remove components which were moved from lab to material (#45232) @DiegoAndai
65
+
66
+ ### Docs
67
+
68
+ - [Autocomplete] Improve Google Maps search example (#44708) @oliviertassinari
69
+ - [Dialog] Removes deprecated PaperProps from docs (#45195) @sai6855
70
+ - [Menu] Add Grouped Menu demo (#45241) @noobDev31
71
+ - [material] Add disableInteractive on colorTool grid Tooltips (#37800) @Janpot
72
+ - [blog] Consistent Base UI terminology (#45264) @oliviertassinari
73
+ - A quick first step to update docs for Tailwind v4 (#45147) @oliviertassinari
74
+ - Fix `element.ref` accessing warning on docs (#45155) @DiegoAndai
75
+ - Mention Toolpad as experimental (#45273) @prakhargupta1
76
+ - [joy-ui] Update "Set up providers" section of integration with Material UI (#45183) @mateuseap
77
+
78
+ ### Core
79
+
80
+ - Update branch switch tags (#45198) @DiegoAndai
81
+ - Fix double redirection to Base UI (#45146) @oliviertassinari
82
+ - Fix corepack and pnpm installation in CircleCI (#45185) @mj12albert
83
+ - Fix typo on Netlify script (#45278) @maximevtush
84
+ - [code-infra] Fix testing library resolution with custom react (#44061) @Janpot
85
+ - [code-infra] Update package layout for better ESM support (#43264) @Janpot
86
+ - Update `@typescript-eslint/*` packages and remove deprecated `eslint-config-airbnb-typescript` package (#45245) @ZeeshanTamboli
87
+ - [docs] Restore utility component docs from MUI Base to Material UI (#45213) @mapache-salvaje
88
+ - [docs] Sync active sponsors (#45204) @oliviertassinari
89
+ - [docs] Fix links in CONTRIBUTING.md (#45202) @bernardobelchior
90
+ - [docs-infra] Point to MUI X next docs (#45207) @cherniavskii
91
+ - [test] Fix React 18 tests (#45161) @DiegoAndai
92
+
93
+ All contributors of this release in alphabetical order: @bernardobelchior, @cherniavskii, @DiegoAndai, @Janpot, @kingflamez, @mapache-salvaje, @mateuseap, @maximevtush, @mj12albert, @noobDev31, @oliviertassinari, @prakhargupta1, @sai6855, @siriwatknp, @ZeeshanTamboli
94
+
3
95
  ## 7.0.0-alpha.0
4
96
 
5
97
  <!-- generated comparing v6.4.1..master -->
@@ -0,0 +1 @@
1
+ {"type":"module","sideEffects":false}
@@ -0,0 +1,27 @@
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,30 +1,23 @@
1
- "use strict";
2
1
  'use client';
3
2
 
4
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
5
- var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
6
- Object.defineProperty(exports, "__esModule", {
7
- value: true
8
- });
9
- exports.default = AppRouterCacheProvider;
10
- var React = _interopRequireWildcard(require("react"));
11
- var _cache = _interopRequireDefault(require("@emotion/cache"));
12
- var _react2 = require("@emotion/react");
13
- var _navigation = require("next/navigation");
14
- var _jsxRuntime = require("react/jsx-runtime");
3
+ import * as React from 'react';
4
+ import createCache from '@emotion/cache';
5
+ import { CacheProvider as DefaultCacheProvider } from '@emotion/react';
6
+ import { useServerInsertedHTML } from 'next/navigation';
7
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
15
8
  /**
16
9
  * Emotion works OK without this provider but it's recommended to use this provider to improve performance.
17
10
  * Without it, Emotion will generate a new <style> tag during SSR for every component.
18
11
  * See https://github.com/mui/material-ui/issues/26561#issuecomment-855286153 for why it's a problem.
19
12
  */
20
- function AppRouterCacheProvider(props) {
13
+ export default function AppRouterCacheProvider(props) {
21
14
  const {
22
15
  options,
23
- CacheProvider = _react2.CacheProvider,
16
+ CacheProvider = DefaultCacheProvider,
24
17
  children
25
18
  } = props;
26
19
  const [registry] = React.useState(() => {
27
- const cache = (0, _cache.default)({
20
+ const cache = createCache({
28
21
  ...options,
29
22
  key: options?.key ?? 'mui'
30
23
  });
@@ -55,7 +48,7 @@ function AppRouterCacheProvider(props) {
55
48
  flush
56
49
  };
57
50
  });
58
- (0, _navigation.useServerInsertedHTML)(() => {
51
+ useServerInsertedHTML(() => {
59
52
  const inserted = registry.flush();
60
53
  if (inserted.length === 0) {
61
54
  return null;
@@ -80,11 +73,11 @@ function AppRouterCacheProvider(props) {
80
73
  }
81
74
  }
82
75
  });
83
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(React.Fragment, {
76
+ return /*#__PURE__*/_jsxs(React.Fragment, {
84
77
  children: [globals.map(({
85
78
  name,
86
79
  style
87
- }) => /*#__PURE__*/(0, _jsxRuntime.jsx)("style", {
80
+ }) => /*#__PURE__*/_jsx("style", {
88
81
  nonce: options?.nonce,
89
82
  "data-emotion": `${registry.cache.key}-global ${name}`
90
83
  // eslint-disable-next-line react/no-danger
@@ -92,7 +85,7 @@ function AppRouterCacheProvider(props) {
92
85
  dangerouslySetInnerHTML: {
93
86
  __html: style
94
87
  }
95
- }, name)), styles && /*#__PURE__*/(0, _jsxRuntime.jsx)("style", {
88
+ }, name)), styles && /*#__PURE__*/_jsx("style", {
96
89
  nonce: options?.nonce,
97
90
  "data-emotion": dataEmotionAttribute
98
91
  // eslint-disable-next-line react/no-danger
@@ -103,7 +96,7 @@ function AppRouterCacheProvider(props) {
103
96
  })]
104
97
  });
105
98
  });
106
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(CacheProvider, {
99
+ return /*#__PURE__*/_jsx(CacheProvider, {
107
100
  value: registry.cache,
108
101
  children: children
109
102
  });
@@ -0,0 +1,2 @@
1
+ export { default as AppRouterCacheProvider } from "./appRouterV13.js";
2
+ export * from "./appRouterV13.js";
@@ -0,0 +1,2 @@
1
+ export { default as AppRouterCacheProvider } from "./appRouterV13.js";
2
+ export * from "./appRouterV13.js";
@@ -0,0 +1 @@
1
+ export default function createEmotionCache(): import("@emotion/cache").EmotionCache;
@@ -1,23 +1,16 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.default = createEmotionCache;
8
- var _cache = _interopRequireDefault(require("@emotion/cache"));
1
+ import createCache from '@emotion/cache';
9
2
  const isBrowser = typeof document !== 'undefined';
10
3
 
11
4
  // On the client side, Create a meta tag at the top of the <head> and set it as insertionPoint.
12
5
  // This assures that MUI styles are loaded first.
13
6
  // It allows developers to easily override MUI styles with other styling solutions, like CSS modules.
14
- function createEmotionCache() {
7
+ export default function createEmotionCache() {
15
8
  let insertionPoint;
16
9
  if (isBrowser) {
17
10
  const emotionInsertionPoint = document.querySelector('meta[name="emotion-insertion-point"]');
18
11
  insertionPoint = emotionInsertionPoint ?? undefined;
19
12
  }
20
- return (0, _cache.default)({
13
+ return createCache({
21
14
  key: 'mui',
22
15
  insertionPoint
23
16
  });
@@ -0,0 +1,2 @@
1
+ export * from "./pagesRouterV13Document.js";
2
+ export * from "./pagesRouterV13App.js";
@@ -0,0 +1,2 @@
1
+ export * from "./pagesRouterV13Document.js";
2
+ export * from "./pagesRouterV13App.js";
@@ -0,0 +1 @@
1
+ module.exports = require('next/document');
@@ -0,0 +1,2 @@
1
+ declare const _exports: typeof import("next/document");
2
+ export = _exports;
@@ -0,0 +1,9 @@
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;
@@ -0,0 +1,14 @@
1
+ import * as React from 'react';
2
+ import { CacheProvider } from '@emotion/react';
3
+ import createEmotionCache from "./createCache.js";
4
+ import { jsx as _jsx } from "react/jsx-runtime";
5
+ const defaultEmotionCache = createEmotionCache();
6
+ export function AppCacheProvider({
7
+ emotionCache = defaultEmotionCache,
8
+ children
9
+ }) {
10
+ return /*#__PURE__*/_jsx(CacheProvider, {
11
+ value: emotionCache,
12
+ children: children
13
+ });
14
+ }
@@ -0,0 +1,23 @@
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,36 +1,27 @@
1
- "use strict";
2
-
3
- var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
4
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.DocumentHeadTags = DocumentHeadTags;
9
- exports.createGetInitialProps = createGetInitialProps;
10
- exports.documentGetInitialProps = documentGetInitialProps;
11
- var React = _interopRequireWildcard(require("react"));
12
- var _createInstance = _interopRequireDefault(require("@emotion/server/create-instance"));
13
- var _document = _interopRequireDefault(require("next/document"));
14
- var _createCache = _interopRequireDefault(require("./createCache"));
15
- var _jsxRuntime = require("react/jsx-runtime");
16
1
  var _meta;
2
+ import * as React from 'react';
3
+ import createEmotionServer from '@emotion/server/create-instance';
4
+ import nextDocument from "./nextDocument.cjs";
5
+ import createEmotionCache from "./createCache.js";
6
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
7
+ const Document = nextDocument.default || nextDocument;
17
8
  /**
18
9
  * A utility to compose multiple `getInitialProps` functions.
19
10
  */
20
- function createGetInitialProps(plugins) {
11
+ export function createGetInitialProps(plugins) {
21
12
  return async function getInitialProps(ctx) {
22
13
  const originalRenderPage = ctx.renderPage;
23
14
  ctx.renderPage = () => originalRenderPage({
24
15
  enhanceApp: App => plugins.reduce((result, plugin) => plugin.enhanceApp(result), App)
25
16
  });
26
- const initialProps = await _document.default.getInitialProps(ctx);
17
+ const initialProps = await Document.getInitialProps(ctx);
27
18
  const finalProps = await plugins.reduce(async (result, plugin) => plugin.resolveProps(await result), Promise.resolve(initialProps));
28
19
  return finalProps;
29
20
  };
30
21
  }
31
- function DocumentHeadTags(props) {
32
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(React.Fragment, {
33
- children: [_meta || (_meta = /*#__PURE__*/(0, _jsxRuntime.jsx)("meta", {
22
+ export function DocumentHeadTags(props) {
23
+ return /*#__PURE__*/_jsxs(React.Fragment, {
24
+ children: [_meta || (_meta = /*#__PURE__*/_jsx("meta", {
34
25
  name: "emotion-insertion-point",
35
26
  content: ""
36
27
  })), props.emotionStyleTags]
@@ -39,7 +30,7 @@ function DocumentHeadTags(props) {
39
30
 
40
31
  // `getInitialProps` belongs to `_document` (instead of `_app`),
41
32
  // it's compatible with static-site generation (SSG).
42
- async function documentGetInitialProps(ctx, options) {
33
+ export async function documentGetInitialProps(ctx, options) {
43
34
  // Resolution order
44
35
  //
45
36
  // On the server:
@@ -64,15 +55,15 @@ async function documentGetInitialProps(ctx, options) {
64
55
 
65
56
  // You can consider sharing the same Emotion cache between all the SSR requests to speed up performance.
66
57
  // However, be aware that it can have global side effects.
67
- const cache = options?.emotionCache ?? (0, _createCache.default)();
58
+ const cache = options?.emotionCache ?? createEmotionCache();
68
59
  // The createEmotionServer has to be called directly after the cache creation due to the side effect of cache.compat = true,
69
60
  // otherwise the <style> tag will not come with the HTML string from the server.
70
61
  const {
71
62
  extractCriticalToChunks
72
- } = (0, _createInstance.default)(cache);
63
+ } = createEmotionServer(cache);
73
64
  return createGetInitialProps([{
74
65
  enhanceApp: App => function EnhanceApp(props) {
75
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(App, {
66
+ return /*#__PURE__*/_jsx(App, {
76
67
  emotionCache: cache,
77
68
  ...props
78
69
  });
@@ -83,7 +74,7 @@ async function documentGetInitialProps(ctx, options) {
83
74
  } = extractCriticalToChunks(initialProps.html);
84
75
  return {
85
76
  ...initialProps,
86
- emotionStyleTags: styles.map(style => /*#__PURE__*/(0, _jsxRuntime.jsx)("style", {
77
+ emotionStyleTags: styles.map(style => /*#__PURE__*/_jsx("style", {
87
78
  "data-emotion": `${style.key} ${style.ids.join(' ')}`,
88
79
  // eslint-disable-next-line react/no-danger
89
80
  dangerouslySetInnerHTML: {
@@ -0,0 +1 @@
1
+ export * from "../v13-appRouter/index.js";
@@ -0,0 +1 @@
1
+ export * from "../v13-appRouter/index.js";
@@ -0,0 +1 @@
1
+ export * from "../v13-pagesRouter/index.js";
@@ -0,0 +1 @@
1
+ export * from "../v13-pagesRouter/index.js";
@@ -0,0 +1 @@
1
+ export * from "../v13-appRouter/index.js";
@@ -0,0 +1 @@
1
+ export * from "../v13-appRouter/index.js";
@@ -0,0 +1 @@
1
+ export * from "../v13-pagesRouter/index.js";
@@ -0,0 +1 @@
1
+ export * from "../v13-pagesRouter/index.js";
@@ -0,0 +1 @@
1
+ {"type":"module","sideEffects":false}
@@ -0,0 +1,27 @@
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;
@@ -0,0 +1,2 @@
1
+ export { default as AppRouterCacheProvider } from "./appRouterV13.js";
2
+ export * from "./appRouterV13.js";
@@ -0,0 +1 @@
1
+ export default function createEmotionCache(): import("@emotion/cache").EmotionCache;
@@ -0,0 +1,2 @@
1
+ export * from "./pagesRouterV13Document.js";
2
+ export * from "./pagesRouterV13App.js";
@@ -0,0 +1 @@
1
+ module.exports = require('next/document');
@@ -0,0 +1,9 @@
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;
@@ -0,0 +1,23 @@
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,9 +1,10 @@
1
1
  var _meta;
2
2
  import * as React from 'react';
3
3
  import createEmotionServer from '@emotion/server/create-instance';
4
- import Document from 'next/document';
4
+ import nextDocument from "./nextDocument.cjs";
5
5
  import createEmotionCache from "./createCache.js";
6
6
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
7
+ const Document = nextDocument.default || nextDocument;
7
8
  /**
8
9
  * A utility to compose multiple `getInitialProps` functions.
9
10
  */
@@ -0,0 +1 @@
1
+ export * from "../v13-appRouter/index.js";
@@ -0,0 +1 @@
1
+ export * from "../v13-pagesRouter/index.js";
@@ -0,0 +1 @@
1
+ export * from "../v13-appRouter/index.js";
@@ -0,0 +1 @@
1
+ export * from "../v13-pagesRouter/index.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/material-nextjs",
3
- "version": "7.0.0-alpha.0",
3
+ "version": "7.0.0-alpha.2",
4
4
  "private": false,
5
5
  "author": "MUI Team",
6
6
  "description": "Collection of utilities for integration between Material UI and Next.js.",
@@ -24,7 +24,7 @@
24
24
  "url": "https://opencollective.com/mui-org"
25
25
  },
26
26
  "dependencies": {
27
- "@babel/runtime": "^7.26.7"
27
+ "@babel/runtime": "^7.26.9"
28
28
  },
29
29
  "peerDependencies": {
30
30
  "@emotion/cache": "^11.11.0",
@@ -52,5 +52,36 @@
52
52
  },
53
53
  "engines": {
54
54
  "node": ">=14.0.0"
55
+ },
56
+ "exports": {
57
+ ".": null,
58
+ "./*": {
59
+ "require": {
60
+ "types": "./*/index.d.ts",
61
+ "default": "./*/index.js"
62
+ },
63
+ "import": {
64
+ "types": "./esm/*/index.d.ts",
65
+ "default": "./esm/*/index.js"
66
+ },
67
+ "mui-modern": {
68
+ "types": "./modern/*/index.d.ts",
69
+ "default": "./modern/*/index.js"
70
+ }
71
+ },
72
+ "./v13-pagesRouter": {
73
+ "require": {
74
+ "types": "./v13-pagesRouter/index.d.ts",
75
+ "default": "./v13-pagesRouter/index.js"
76
+ },
77
+ "import": {
78
+ "types": "./esm/v13-pagesRouter/index.d.ts",
79
+ "default": "./esm/v13-pagesRouter/index.js"
80
+ },
81
+ "mui-modern": {
82
+ "types": "./modern/v13-pagesRouter/index.d.ts",
83
+ "default": "./modern/v13-pagesRouter/index.js"
84
+ }
85
+ }
55
86
  }
56
87
  }