@mui/docs 9.0.0-alpha.3 → 9.0.0-beta.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.
Files changed (99) hide show
  1. package/ApiPage/ApiWarningAlert.d.ts +10 -0
  2. package/ApiPage/ApiWarningAlert.js +22 -0
  3. package/ApiPage/definitions/classes.d.ts +18 -0
  4. package/ApiPage/definitions/classes.js +54 -0
  5. package/ApiPage/definitions/index.d.ts +4 -0
  6. package/ApiPage/definitions/index.js +4 -0
  7. package/ApiPage/definitions/properties.d.ts +58 -0
  8. package/ApiPage/definitions/properties.js +110 -0
  9. package/ApiPage/definitions/slots.d.ts +16 -0
  10. package/ApiPage/definitions/slots.js +39 -0
  11. package/ApiPage/definitions/types.d.ts +53 -0
  12. package/ApiPage/definitions/types.js +1 -0
  13. package/ApiPage/index.d.ts +2 -0
  14. package/ApiPage/index.js +2 -0
  15. package/ApiPage/list/ClassesList.d.ts +11 -0
  16. package/ApiPage/list/ClassesList.js +103 -0
  17. package/ApiPage/list/ExpandableApiItem.d.ts +18 -0
  18. package/ApiPage/list/ExpandableApiItem.js +241 -0
  19. package/ApiPage/list/PropertiesList.d.ts +7 -0
  20. package/ApiPage/list/PropertiesList.js +263 -0
  21. package/ApiPage/list/SlotsList.d.ts +7 -0
  22. package/ApiPage/list/SlotsList.js +93 -0
  23. package/ApiPage/list/index.d.ts +1 -0
  24. package/ApiPage/list/index.js +1 -0
  25. package/ApiPage/private.d.ts +3 -0
  26. package/ApiPage/private.js +3 -0
  27. package/ApiPage/sections/ClassesSection.d.ts +34 -0
  28. package/ApiPage/sections/ClassesSection.js +76 -0
  29. package/ApiPage/sections/PropertiesSection.d.ts +45 -0
  30. package/ApiPage/sections/PropertiesSection.js +59 -0
  31. package/ApiPage/sections/SlotsSection.d.ts +24 -0
  32. package/ApiPage/sections/SlotsSection.js +61 -0
  33. package/ApiPage/sections/ToggleDisplayOption.d.ts +17 -0
  34. package/ApiPage/sections/ToggleDisplayOption.js +158 -0
  35. package/ApiPage/sections/index.d.ts +4 -0
  36. package/ApiPage/sections/index.js +4 -0
  37. package/ApiPage/table/ClassesTable.d.ts +7 -0
  38. package/ApiPage/table/ClassesTable.js +116 -0
  39. package/ApiPage/table/PropertiesTable.d.ts +6 -0
  40. package/ApiPage/table/PropertiesTable.js +286 -0
  41. package/ApiPage/table/SlotsTable.d.ts +6 -0
  42. package/ApiPage/table/SlotsTable.js +126 -0
  43. package/ApiPage/table/StyledTableContainer.d.ts +1 -0
  44. package/ApiPage/table/StyledTableContainer.js +42 -0
  45. package/ApiPage/types.d.ts +11 -0
  46. package/ApiPage/types.js +1 -0
  47. package/CHANGELOG.md +224 -3
  48. package/DemoContext/DemoContext.d.ts +1 -1
  49. package/{AnalyticsProvider → DocsApp}/AnalyticsProvider.js +10 -6
  50. package/DocsApp/DocsApp.d.ts +79 -0
  51. package/DocsApp/DocsApp.js +105 -0
  52. package/{GoogleAnalytics → DocsApp}/GoogleAnalytics.js +4 -4
  53. package/DocsApp/StyledEngineProvider.d.ts +8 -0
  54. package/{StyledEngineProvider → DocsApp}/StyledEngineProvider.js +2 -8
  55. package/DocsApp/consoleBanner.d.ts +1 -0
  56. package/DocsApp/consoleBanner.js +18 -0
  57. package/DocsApp/createGetInitialProps.d.ts +30 -0
  58. package/DocsApp/createGetInitialProps.js +29 -0
  59. package/DocsApp/index.d.ts +5 -0
  60. package/DocsApp/index.js +4 -0
  61. package/DocsApp/loadDependencies.d.ts +1 -0
  62. package/DocsApp/loadDependencies.js +9 -0
  63. package/DocsApp/reportWebVitals.d.ts +13 -0
  64. package/DocsApp/reportWebVitals.js +22 -0
  65. package/DocsApp/serviceWorker.d.ts +1 -0
  66. package/DocsApp/serviceWorker.js +59 -0
  67. package/Document/Document.js +2 -2
  68. package/Document/getInitialProps.js +3 -5
  69. package/InfoCard/InfoCard.js +9 -5
  70. package/Link/SkipLink.js +1 -3
  71. package/NextNProgressBar/NextNProgressBar.js +0 -2
  72. package/PageContext/PageContext.d.ts +6 -5
  73. package/branding/BrandingCssVarsProvider.d.ts +9 -5
  74. package/branding/BrandingCssVarsProvider.js +1 -1
  75. package/branding/brandingTheme.js +82 -75
  76. package/codeStyling/codeStyling.d.ts +7 -10
  77. package/codeStyling/codeStyling.js +0 -4
  78. package/codeVariant/codeVariant.d.ts +7 -10
  79. package/codeVariant/codeVariant.js +0 -4
  80. package/constants/constants.d.ts +10 -10
  81. package/constants/index.d.ts +1 -1
  82. package/constants/index.js +1 -1
  83. package/package.json +35 -44
  84. package/utils/index.js +0 -1
  85. package/webpack/index.d.ts +17 -0
  86. package/webpack/index.js +1 -0
  87. package/AnalyticsProvider/index.d.ts +0 -1
  88. package/AnalyticsProvider/index.js +0 -1
  89. package/GoogleAnalytics/index.d.ts +0 -1
  90. package/GoogleAnalytics/index.js +0 -1
  91. package/StyledEngineProvider/StyledEngineProvider.d.ts +0 -9
  92. package/StyledEngineProvider/index.d.ts +0 -1
  93. package/StyledEngineProvider/index.js +0 -1
  94. package/createEmotionCache/index.d.ts +0 -1
  95. package/createEmotionCache/index.js +0 -1
  96. /package/{AnalyticsProvider → DocsApp}/AnalyticsProvider.d.ts +0 -0
  97. /package/{GoogleAnalytics → DocsApp}/GoogleAnalytics.d.ts +0 -0
  98. /package/{createEmotionCache → DocsApp}/createEmotionCache.d.ts +0 -0
  99. /package/{createEmotionCache → DocsApp}/createEmotionCache.js +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,216 @@
1
1
  # [Versions](https://mui.com/versions/)
2
2
 
3
+ ## 9.0.0-beta.0
4
+
5
+ <!-- generated comparing v9.0.0-alpha.4..master -->
6
+
7
+ _Mar 25, 2026_
8
+
9
+ A big thanks to the 8 contributors who made this release possible.
10
+
11
+ ### `@mui/material@9.0.0-beta.0`
12
+
13
+ #### Breaking Changes
14
+
15
+ - [linear-progress] Remove deprecated CSS classes (#48068) @mj12albert
16
+ - [list-item, list-item-text] Remove deprecated props (#48042) @siriwatknp
17
+ - [button-group] Remove deprecated classes (#48043) @siriwatknp
18
+ - [card] Remove deprecated CardHeader props (#47995) @silviuaavram
19
+ - [checkbox][radio][switch] Remove deprecated inputProps and inputRef (#48059) @siriwatknp
20
+ - [chip] Remove deprecated classes (#48046) @silviuaavram
21
+ - [dialog][modal][drawer][swipeabledrawer] Remove deprecated props and classes (#48039) @silviuaavram
22
+ - [divider] Remove deprecated CSS classes (#48075) @siriwatknp
23
+ - [drawer] Remove deprecated CSS classes (#48077) @siriwatknp
24
+ - [image-list-item-bar] Remove deprecated CSS classes (#48064) @siriwatknp
25
+ - [inputs] Remove deprecated props & classes (#48071) @mj12albert
26
+ - [material-ui] Remove unnecessary overridesResolvers from styled components (#48082) @ZeeshanTamboli
27
+ - [material-ui][system] Remove deprecated system props from Box, Stack, Typography (#48072) @siriwatknp
28
+ - [pagination-item] Remove deprecated CSS classes (#48076) @siriwatknp
29
+ - [pagination-item] Remove deprecated props (#48038) @siriwatknp
30
+ - [rating] Remove deprecated IconContainerComponent (#48019) @siriwatknp
31
+ - [select] Remove deprecated CSS classes (#48065) @mj12albert
32
+ - [slider] Remove deprecated CSS classes (#48074) @siriwatknp
33
+ - [step-connector][step-content][step-label] Remove deprecated props and classes (#48058) @siriwatknp
34
+ - [tabs][tab] Remove deprecated CSS classes (#48078) @siriwatknp
35
+ - [table-pagination][table-sort-label] Remove deprecated props and classes (#48060) @siriwatknp
36
+ - [toggle-button-group] Remove deprecated classes (#48061) @siriwatknp
37
+
38
+ #### Changes
39
+
40
+ - [system] Improve performance when using sx prop (#44254) @romgrk
41
+
42
+ ### `@mui/codemod@9.0.0-beta.0`
43
+
44
+ - [codemod] Add missing codemod links in upgrade guide (#48069) @silviuaavram
45
+
46
+ ### Docs
47
+
48
+ - Mention all breaking changes in changelog (#48091) @silviuaavram
49
+ - Fix link to upgrade-to-v9 docs in release CHANGELOG (#48081) @ZeeshanTamboli
50
+
51
+ ### Core
52
+
53
+ - Update browserslistrc (#48085) @silviuaavram
54
+ - [code-infra] Prevent major version updates of bundler/framework packages in bundling fixtures (#48062) @Copilot
55
+ - [code-infra][icons-material] Avoid material utils barrel in createSvgIcon (#48029) @anchmelev
56
+ - [docs-infra] Migrate more leaf components to mui-docs (#48018) @brijeshb42
57
+
58
+ All contributors of this release in alphabetical order: @anchmelev, @brijeshb42, @Copilot, @mj12albert, @romgrk, @silviuaavram, @siriwatknp, @ZeeshanTamboli
59
+
60
+ ## 9.0.0-alpha.4
61
+
62
+ <!-- generated comparing v9.0.0-alpha.3..master -->
63
+
64
+ _Mar 20, 2026_
65
+
66
+ A big thanks to the 11 contributors who made this release possible.
67
+
68
+ ### `@mui/material@9.0.0-alpha.4`
69
+
70
+ #### Breaking Changes
71
+
72
+ - [accordion] Remove deprecated props (#47963) @silviuaavram
73
+ - `TransitionComponent`
74
+ - `TransitionProps`
75
+ - [accordionsummary] Remove deprecated CSS class (#48006) @silviuaavram
76
+ - `contentGutters`
77
+ - [alert] Remove deprecated CSS classes (#48011) @silviuaavram
78
+ - `standardSuccess`
79
+ - `standardInfo`
80
+ - `standardWarning`
81
+ - `standardError`
82
+ - `outlinedSuccess`
83
+ - `outlinedInfo`
84
+ - `outlinedWarning`
85
+ - `outlinedError`
86
+ - `filledSuccess`
87
+ - `filledInfo`
88
+ - `filledWarning`
89
+ - `filledError`
90
+ - [alert] Remove deprecated props (#47965) @silviuaavram
91
+ - `components`
92
+ - `componentsProps`
93
+ - [autocomplete] Remove deprecated props (#47864) @ZeeshanTamboli
94
+ - `ChipProps`
95
+ - `componentsProps`
96
+ - `ListboxComponent`
97
+ - `ListboxProps`
98
+ - `PaperComponent`
99
+ - `PopperComponent`
100
+ - `renderTags`
101
+ - [avatar] Remove deprecated props (#47966) @silviuaavram
102
+ - `imgProps`
103
+ - [avatargroup] Remove deprecated props (#47968) @silviuaavram
104
+ - `componentsProps`
105
+ - [backdrop] Remove deprecated props (#47991) @silviuaavram
106
+ - `components`
107
+ - `componentsProps`
108
+ - `TransitionComponent`
109
+ - [badge] Remove deprecated props (#47993) @silviuaavram
110
+ - `components`
111
+ - `componentsProps`
112
+ - [button] Remove deprecated CSS classes (#48012) @silviuaavram
113
+ - Color variant classes: `textInherit`, `outlinedPrimary`, `containedSecondary`, etc.
114
+ - Size classes: `textSizeSmall`, `iconSizeMedium`, etc.
115
+ - [circularprogress] Remove deprecated CSS classes (#48014) @silviuaavram
116
+ - `circleDeterminate`
117
+ - `circleIndeterminate`
118
+ - [divider] Remove deprecated prop (#48013) @atharva3333
119
+ - `light`
120
+ - [formcontrollabel] Remove deprecated props (#48032) @atharva3333
121
+ - `componentsProps`
122
+ - [menu] Remove deprecated props (#48021) @siriwatknp
123
+ - `MenuListProps`
124
+ - `PaperProps`
125
+ - `TransitionProps`
126
+ - [mobilestepper] Remove deprecated props (#48041) @siriwatknp
127
+ - `LinearProgressProps`
128
+ - [popover] Remove deprecated props (#48021) @siriwatknp
129
+ - `BackdropComponent`
130
+ - `BackdropProps`
131
+ - `PaperProps`
132
+ - `TransitionComponent`
133
+ - `TransitionProps`
134
+ - [popper] Remove deprecated props (#48020) @siriwatknp
135
+ - `components`
136
+ - `componentsProps`
137
+ - [select] Remove deprecated props passed via `MenuProps` (#48021) @siriwatknp
138
+ - `MenuListProps`
139
+ - `PaperProps`
140
+ - `TransitionProps`
141
+ - [slider] Remove deprecated props (#47996) @siriwatknp
142
+ - `components`
143
+ - `componentsProps`
144
+ - [speeddial] Remove deprecated props (#47998) @siriwatknp
145
+ - `TransitionComponent`
146
+ - `TransitionProps`
147
+ - [speeddialaction] Remove deprecated props (#47998) @siriwatknp
148
+ - `FabProps`
149
+ - `tooltipTitle`
150
+ - `tooltipPlacement`
151
+ - `tooltipOpen`
152
+ - `TooltipClasses`
153
+ - [tabs] Remove deprecated props (#48017) @siriwatknp
154
+ - `ScrollButtonComponent`
155
+ - `TabIndicatorProps`
156
+ - `TabScrollButtonProps`
157
+ - `slots.StartScrollButtonIcon`
158
+ - `slots.EndScrollButtonIcon`
159
+ - [textfield] Remove deprecated props (#47878) @ZeeshanTamboli
160
+ - `InputProps`
161
+ - `inputProps`
162
+ - `SelectProps`
163
+ - `InputLabelProps`
164
+ - `FormHelperTextProps`
165
+ - [tooltip] Remove deprecated props (#47988) @siriwatknp
166
+ - `components`
167
+ - `componentsProps`
168
+ - `PopperComponent`
169
+ - `PopperProps`
170
+ - `TransitionComponent`
171
+ - `TransitionProps`
172
+ - [typography] Remove deprecated prop (#47986) @siriwatknp
173
+ - `paragraph`
174
+ - [buttonbase] Key handlers should not run on a disabled non-native button (#48003) @mj12albert
175
+ - [tablepagination] Format pagination numbers according to locale (#47803) @siriwatknp
176
+ - [textfield] Use non-native label for `<TextField select/>` (#47958) @mj12albert
177
+
178
+ Check out the [v9 upgrade guide](https://next.mui.com/material-ui/migration/upgrade-to-v9/).
179
+
180
+ #### Changes
181
+
182
+ - [autocomplete] Optimize selected option lookup (#47953) @anchmelev
183
+ - [buttonbase] Fix native button detection (#47985) @mj12albert
184
+ - [inputbase] Fix test using removed InputProps on TextField (#48000) @siriwatknp
185
+ - [popper] Add missing classes export (#48031) @mj12albert
186
+ - [select] Fix focus visible always set on menu item (#47912) @silviuaavram
187
+ - [slider] Fix focus visible styles incorrectly applied by pointer (#47894) @mj12albert
188
+ - [slider] Accept readonly array for the value prop (#47936) @pcorpet
189
+
190
+ ### `@mui/codemod@9.0.0-alpha.4`
191
+
192
+ - [codemod] Add slot key rename to `tabs-props` codemod and add to README (#48035) @siriwatknp
193
+ - [codemod] Add card-header-props migration guide (#48005) @siriwatknp
194
+
195
+ ### Docs
196
+
197
+ - [blog] Lowercase 2026-MUI-X-price-changes blog post URL (#47871) @Janpot
198
+ - [docs] Wide docs layout (#47950) @noraleonte
199
+ - [docs] Mention the list of props removed in upgrade guide (#48010) @silviuaavram
200
+ - [docs] Update Autocomplete deprecated props removal migration guide docs (#47990) @ZeeshanTamboli
201
+ - [docs-infra] Extract shared App component from \_app into @mui/docs (#47933) @brijeshb42
202
+ - [docs-infra] Expose global theme object (#47964) @Janpot
203
+ - [docs][system] Update `styled` API docs for easier understanding (#47957) @olivier-lxo
204
+
205
+ ### Core
206
+
207
+ - [code-infra] Add pkg-pr-new as dev dependency (#47992) @Janpot
208
+ - [code-infra] Remove CI coverage collection and upload to Codecov (#47930) @Janpot
209
+ - [core] Migrate to ESLint 10 (#47872) @brijeshb42
210
+ - [core] Remove GridLegacy component (#47956) @siriwatknp
211
+
212
+ All contributors of this release in alphabetical order: @anchmelev, @atharva3333, @brijeshb42, @Janpot, @mj12albert, @noraleonte, @olivier-lxo, @pcorpet, @silviuaavram, @siriwatknp, @ZeeshanTamboli
213
+
3
214
  ## 9.0.0-alpha.3
4
215
 
5
216
  <!-- generated comparing v9.0.0-alpha.2..master -->
@@ -13,11 +224,16 @@ A big thanks to the 10 contributors who made this release possible. Here are som
13
224
 
14
225
  ### `@mui/material@9.0.0-alpha.3`
15
226
 
227
+ #### Breaking Changes
228
+
229
+ - [stepper][menulist][tabs] Improve accessibility (#47687) @silviuaavram
230
+
231
+ #### Changes
232
+
16
233
  - [autocomplete] Add `root` slot (#47852) @GerardasB
17
234
  - [autocomplete] Fix popup reopening on window focus regain with openOnFocus (#47790) @aman44444
18
235
  - [autocomplete] Support full slots for clearIndicator and popupIndicator (#47891) @silviuaavram
19
236
  - [material-ui] Partially revert "[material-ui] Clean up duplicated CSS rules (#47838)" (#47927) @sai6855
20
- - [stepper][menulist][tabs] Improve accessibility (#47687) @silviuaavram
21
237
 
22
238
  ### Docs
23
239
 
@@ -75,16 +291,21 @@ A big thanks to the 13 contributors who made this release possible. Here are som
75
291
 
76
292
  ### @mui/material@9.0.0-alpha.1
77
293
 
294
+ #### Breaking Changes
295
+
78
296
  - [Autocomplete] Prevents Autocomplete menu from opening on right click (#47797) @silviuaavram
79
297
  - [Backdrop] Remove aria-hidden by default (#47798) @silviuaavram
80
298
  - [ButtonBase] Ensure that onClick propagates when non-native button is clicked (#47800) @silviuaavram
81
299
  - [Dialog][Modal] Remove `disableEscapeKeyDown` prop (#47695) @silviuaavram
82
300
  - [Grid] Remove system props support (#47846) @siriwatknp
83
- - [TableCell][theme] Apply `alpha` before color mixing to border bottom color when nativeColor + cssVariables is used (#47762) @ZeeshanTamboli
84
301
  - [theme] Remove MuiTouchRipple from theme component types (#47849) @siriwatknp
85
- - [Tooltip] Fix error is thrown when wrapping an input which is disabled while focused (#47684) @ZeeshanTamboli
86
302
  - [useAutocomplete] Improve isOptionEqualToValue value argument type (#47801) @silviuaavram
87
303
 
304
+ #### Changes
305
+
306
+ - [TableCell][theme] Apply `alpha` before color mixing to border bottom color when nativeColor + cssVariables is used (#47762) @ZeeshanTamboli
307
+ - [Tooltip] Fix error is thrown when wrapping an input which is disabled while focused (#47684) @ZeeshanTamboli
308
+
88
309
  ### Docs
89
310
 
90
311
  - [docs] Add updated community theme resource (#47847) @PeterTYLiu
@@ -19,7 +19,7 @@ export interface SandboxConfig {
19
19
  * Generates the root index.js/tsx content for CodeSandbox/StackBlitz.
20
20
  * Receives codeVariant ('TS' | 'JS') for type assertion.
21
21
  */
22
- getRootIndex: (codeVariant: CodeVariant) => string;
22
+ getRootIndex?: (codeVariant: CodeVariant) => string;
23
23
  /**
24
24
  * Primary npm package for this product, used in sandbox generation.
25
25
  * e.g., "@mui/material", "@mui/joy", "@mui/x-data-grid"
@@ -131,17 +131,21 @@ export function CookieConsentDialog() {
131
131
  children: [/*#__PURE__*/_jsx(Typography, {
132
132
  variant: "subtitle2",
133
133
  id: "cookie-consent-dialog-title",
134
- textAlign: {
135
- xs: 'center',
136
- sm: 'start'
134
+ sx: {
135
+ textAlign: {
136
+ xs: 'center',
137
+ sm: 'start'
138
+ }
137
139
  },
138
140
  children: "Cookie Preferences"
139
141
  }), /*#__PURE__*/_jsx(Typography, {
140
142
  id: "cookie-consent-dialog-description",
141
143
  variant: "body2",
142
- textAlign: {
143
- xs: 'center',
144
- sm: 'start'
144
+ sx: {
145
+ textAlign: {
146
+ xs: 'center',
147
+ sm: 'start'
148
+ }
145
149
  },
146
150
  children: "We use cookies to understand site usage and improve our content. This includes third-party analytics."
147
151
  })]
@@ -0,0 +1,79 @@
1
+ import * as React from 'react';
2
+ import type { AdConfig } from "../Ad/index.js";
3
+ import type { DemoContextValue } from "../DemoContext/index.js";
4
+ import type { DocsConfig } from "../DocsProvider/index.js";
5
+ import type { MuiPageContext } from "../PageContext/index.js";
6
+ import type { Translations } from "../i18n/index.js";
7
+ import createEmotionCache from "./createEmotionCache.js";
8
+ export interface DocsAppProps {
9
+ /**
10
+ * The Next.js page component.
11
+ */
12
+ Component: React.ComponentType<any> & {
13
+ getLayout?: (page: React.ReactElement) => React.ReactNode;
14
+ };
15
+ /**
16
+ * The Emotion cache for CSS-in-JS. Falls back to a client-side cache.
17
+ */
18
+ emotionCache?: ReturnType<typeof createEmotionCache>;
19
+ /**
20
+ * Page props from Next.js, including userLanguage and translations.
21
+ */
22
+ pageProps: {
23
+ userLanguage: string;
24
+ translations: Translations;
25
+ [key: string]: unknown;
26
+ };
27
+ /**
28
+ * Docs configuration object (from docs/config.ts)
29
+ */
30
+ docsConfig: DocsConfig;
31
+ /**
32
+ * Path to the service worker file, e.g. '/sw.js'
33
+ */
34
+ serviceWorkerPath: string;
35
+ /**
36
+ * The currently active page object
37
+ */
38
+ activePage: MuiPageContext['activePage'];
39
+ /**
40
+ * The parent pages of the active page
41
+ */
42
+ activePageParents: MuiPageContext['activePageParents'];
43
+ /**
44
+ * List of all pages for the product
45
+ */
46
+ pageList: MuiPageContext['pages'];
47
+ /**
48
+ * Product metadata and branding info
49
+ */
50
+ productIdentifier: MuiPageContext['productIdentifier'];
51
+ /**
52
+ * Product identifier string (e.g. 'material-ui')
53
+ */
54
+ productId: MuiPageContext['productId'];
55
+ /**
56
+ * Product category identifier string (e.g. 'core')
57
+ */
58
+ productCategoryId: MuiPageContext['productCategoryId'];
59
+ /**
60
+ * Display name for the product (e.g. 'Material UI')
61
+ */
62
+ demoDisplayName: DemoContextValue['productDisplayName'];
63
+ /**
64
+ * CodeSandbox configuration for demos
65
+ */
66
+ csbConfig: DemoContextValue['csb'];
67
+ /**
68
+ * Optional ad configuration
69
+ */
70
+ adConfig?: Partial<AdConfig>;
71
+ /**
72
+ * Optional wrapper component for theming
73
+ */
74
+ ThemeWrapper?: React.ComponentType<{
75
+ children: React.ReactNode;
76
+ }>;
77
+ }
78
+ declare function DocsApp(props: DocsAppProps): import("react/jsx-runtime").JSX.Element;
79
+ export { DocsApp };
@@ -0,0 +1,105 @@
1
+ var _meta, _GoogleAnalytics;
2
+ import NextHead from 'next/head';
3
+ import * as React from 'react';
4
+ import { CodeCopyProvider } from "../CodeCopy/index.js";
5
+ import DemoContext from "../DemoContext/index.js";
6
+ import { DocsProvider } from "../DocsProvider/index.js";
7
+ import PageContext from "../PageContext/index.js";
8
+ import { ThemeProvider } from "../ThemeContext/index.js";
9
+ import { CodeStylingProvider } from "../codeStyling/index.js";
10
+ import { CodeVariantProvider } from "../codeVariant/index.js";
11
+ import { AnalyticsProvider } from "./AnalyticsProvider.js";
12
+ import GoogleAnalytics from "./GoogleAnalytics.js";
13
+ import DocsStyledEngineProvider from "./StyledEngineProvider.js";
14
+ import createEmotionCache from "./createEmotionCache.js";
15
+ import { loadDependencies } from "./loadDependencies.js";
16
+ import { registerServiceWorker } from "./serviceWorker.js";
17
+
18
+ // Client-side cache, shared for the whole session of the user in the browser.
19
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
20
+ const clientSideEmotionCache = createEmotionCache();
21
+ function DocsApp(props) {
22
+ const {
23
+ Component,
24
+ emotionCache = clientSideEmotionCache,
25
+ pageProps,
26
+ docsConfig,
27
+ serviceWorkerPath,
28
+ activePage,
29
+ activePageParents,
30
+ pageList,
31
+ productIdentifier,
32
+ productId,
33
+ productCategoryId,
34
+ demoDisplayName,
35
+ csbConfig,
36
+ adConfig,
37
+ ThemeWrapper = ThemeProvider
38
+ } = props;
39
+ const pageContextValue = React.useMemo(() => ({
40
+ activePage,
41
+ activePageParents,
42
+ pages: pageList,
43
+ productIdentifier,
44
+ productId,
45
+ productCategoryId
46
+ }), [activePage, activePageParents, pageList, productIdentifier, productId, productCategoryId]);
47
+ const demoContextValue = React.useMemo(() => ({
48
+ productDisplayName: demoDisplayName,
49
+ csb: csbConfig
50
+ }), [demoDisplayName, csbConfig]);
51
+ const getLayout = Component.getLayout ?? (page => page);
52
+ React.useEffect(() => {
53
+ loadDependencies();
54
+ registerServiceWorker(serviceWorkerPath);
55
+
56
+ // Remove the server-side injected CSS.
57
+ const jssStyles = document.querySelector('#jss-server-side');
58
+ if (jssStyles) {
59
+ jssStyles.parentElement.removeChild(jssStyles);
60
+ }
61
+ }, []); // eslint-disable-line react-hooks/exhaustive-deps
62
+
63
+ return /*#__PURE__*/_jsxs(React.Fragment, {
64
+ children: [/*#__PURE__*/_jsxs(NextHead, {
65
+ children: [_meta || (_meta = /*#__PURE__*/_jsx("meta", {
66
+ name: "viewport",
67
+ content: "initial-scale=1, width=device-width"
68
+ })), /*#__PURE__*/_jsx("meta", {
69
+ name: "mui:productId",
70
+ content: productId
71
+ }), /*#__PURE__*/_jsx("meta", {
72
+ name: "mui:productCategoryId",
73
+ content: productCategoryId
74
+ })]
75
+ }), /*#__PURE__*/_jsx(DocsProvider, {
76
+ config: docsConfig,
77
+ adConfig: adConfig,
78
+ defaultUserLanguage: pageProps.userLanguage,
79
+ translations: pageProps.translations,
80
+ children: /*#__PURE__*/_jsx(CodeCopyProvider, {
81
+ children: /*#__PURE__*/_jsx(CodeStylingProvider, {
82
+ children: /*#__PURE__*/_jsx(CodeVariantProvider, {
83
+ children: /*#__PURE__*/_jsx(PageContext.Provider, {
84
+ value: pageContextValue,
85
+ children: /*#__PURE__*/_jsx(DemoContext.Provider, {
86
+ value: demoContextValue,
87
+ children: /*#__PURE__*/_jsx(ThemeWrapper, {
88
+ children: /*#__PURE__*/_jsx(DocsStyledEngineProvider, {
89
+ cacheLtr: emotionCache,
90
+ children: /*#__PURE__*/_jsxs(AnalyticsProvider, {
91
+ children: [getLayout(/*#__PURE__*/_jsx(Component, {
92
+ ...pageProps
93
+ })), _GoogleAnalytics || (_GoogleAnalytics = /*#__PURE__*/_jsx(GoogleAnalytics, {}))]
94
+ })
95
+ })
96
+ })
97
+ })
98
+ })
99
+ })
100
+ })
101
+ })
102
+ })]
103
+ });
104
+ }
105
+ export { DocsApp };
@@ -1,10 +1,10 @@
1
1
  import * as React from 'react';
2
2
  import useMediaQuery from '@mui/material/useMediaQuery';
3
3
  import { useRouter } from 'next/router';
4
- import { useNoSsrCodeVariant } from '@mui/docs/codeVariant';
5
- import { useUserLanguage } from '@mui/docs/i18n';
6
- import { pathnameToLanguage } from '@mui/docs/helpers';
7
- import { ThemeOptionsContext } from '@mui/docs/ThemeContext';
4
+ import { useNoSsrCodeVariant } from "../codeVariant/index.js";
5
+ import { useUserLanguage } from "../i18n/index.js";
6
+ import { pathnameToLanguage } from "../helpers/index.js";
7
+ import { ThemeOptionsContext } from "../ThemeContext/index.js";
8
8
 
9
9
  // So we can write code like:
10
10
  //
@@ -0,0 +1,8 @@
1
+ import * as React from 'react';
2
+ import { createEmotionCache as createCache } from '@mui/material-nextjs/v15-pagesRouter';
3
+ type StyledEngineProviderProps = {
4
+ cacheLtr: ReturnType<typeof createCache>;
5
+ children: React.ReactNode;
6
+ };
7
+ export default function StyledEngineProvider(props: StyledEngineProviderProps): import("react/jsx-runtime").JSX.Element;
8
+ export {};
@@ -1,6 +1,5 @@
1
1
  var _GlobalStyles;
2
2
  import * as React from 'react';
3
- import PropTypes from 'prop-types';
4
3
  import { StyleSheetManager } from 'styled-components';
5
4
  import { CacheProvider } from '@emotion/react';
6
5
  import { createEmotionCache as createCache } from '@mui/material-nextjs/v15-pagesRouter';
@@ -9,9 +8,8 @@ import rtlPlugin from '@mui/stylis-plugin-rtl';
9
8
  import GlobalStyles from '@mui/material/GlobalStyles';
10
9
  import { ThemeOptionsContext } from "../ThemeContext/index.js";
11
10
  import globalSelector from "../globalSelector/index.js";
12
-
13
- // Cache for the rtl version of the styles
14
11
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
12
+ // Cache for the rtl version of the styles
15
13
  const cacheRtl = createCache({
16
14
  key: 'rtl',
17
15
  prepend: true,
@@ -37,8 +35,4 @@ export default function StyledEngineProvider(props) {
37
35
  })), children]
38
36
  })
39
37
  });
40
- }
41
- process.env.NODE_ENV !== "production" ? StyledEngineProvider.propTypes = {
42
- cacheLtr: PropTypes.object.isRequired,
43
- children: PropTypes.node
44
- } : void 0;
38
+ }
@@ -0,0 +1 @@
1
+ export declare function printConsoleBanner(): void;
@@ -0,0 +1,18 @@
1
+ import { getTheme } from "../branding/index.js";
2
+ export function printConsoleBanner() {
3
+ if (typeof window !== 'undefined' && process.env.NODE_ENV === 'production') {
4
+ window.theme = getTheme('ltr');
5
+ // eslint-disable-next-line no-console
6
+ console.log(`%c
7
+
8
+ ███╗ ███╗ ██╗ ██╗ ██████╗
9
+ ████╗ ████║ ██║ ██║ ██╔═╝
10
+ ██╔████╔██║ ██║ ██║ ██║
11
+ ██║╚██╔╝██║ ██║ ██║ ██║
12
+ ██║ ╚═╝ ██║ ╚██████╔╝ ██████╗
13
+ ╚═╝ ╚═╝ ╚═════╝ ╚═════╝
14
+
15
+ Tip: you can access the documentation \`theme\` object directly in the console.
16
+ `, 'font-family:monospace;color:#1976d2;font-size:12px;');
17
+ }
18
+ }
@@ -0,0 +1,30 @@
1
+ import type { RequireContext } from "../i18n/index.js";
2
+ interface AppContext {
3
+ ctx: {
4
+ query: {
5
+ userLanguage?: string;
6
+ };
7
+ };
8
+ Component: {
9
+ getInitialProps?: (ctx: AppContext['ctx']) => Promise<Record<string, unknown>>;
10
+ };
11
+ }
12
+ /**
13
+ * Factory to create MyApp.getInitialProps.
14
+ * Follows the same pattern as `@mui/docs/Document`'s `createGetInitialProps`.
15
+ *
16
+ * @param options.translationsContext - A webpack require.context pointing at translation JSON files.
17
+ * e.g. `require.context('docs/translations', false, /\.\/translations.*\.json$/)`
18
+ */
19
+ export declare function createGetInitialProps(options: {
20
+ translationsContext: RequireContext;
21
+ }): ({
22
+ ctx,
23
+ Component
24
+ }: AppContext) => Promise<{
25
+ pageProps: {
26
+ userLanguage: string;
27
+ translations: import("../i18n/index.js").Translations;
28
+ };
29
+ }>;
30
+ export {};
@@ -0,0 +1,29 @@
1
+ import { mapTranslations } from "../i18n/index.js";
2
+ /**
3
+ * Factory to create MyApp.getInitialProps.
4
+ * Follows the same pattern as `@mui/docs/Document`'s `createGetInitialProps`.
5
+ *
6
+ * @param options.translationsContext - A webpack require.context pointing at translation JSON files.
7
+ * e.g. `require.context('docs/translations', false, /\.\/translations.*\.json$/)`
8
+ */
9
+
10
+ export function createGetInitialProps(options) {
11
+ async function getInitialPropsApp({
12
+ ctx,
13
+ Component
14
+ }) {
15
+ let pageProps = {};
16
+ const translations = mapTranslations(options.translationsContext);
17
+ if (Component.getInitialProps) {
18
+ pageProps = await Component.getInitialProps(ctx);
19
+ }
20
+ return {
21
+ pageProps: {
22
+ userLanguage: ctx.query.userLanguage || 'en',
23
+ translations,
24
+ ...pageProps
25
+ }
26
+ };
27
+ }
28
+ return getInitialPropsApp;
29
+ }
@@ -0,0 +1,5 @@
1
+ export { DocsApp } from "./DocsApp.js";
2
+ export type { DocsAppProps } from "./DocsApp.js";
3
+ export { createGetInitialProps } from "./createGetInitialProps.js";
4
+ export { printConsoleBanner } from "./consoleBanner.js";
5
+ export { reportWebVitals } from "./reportWebVitals.js";
@@ -0,0 +1,4 @@
1
+ export { DocsApp } from "./DocsApp.js";
2
+ export { createGetInitialProps } from "./createGetInitialProps.js";
3
+ export { printConsoleBanner } from "./consoleBanner.js";
4
+ export { reportWebVitals } from "./reportWebVitals.js";
@@ -0,0 +1 @@
1
+ export declare function loadDependencies(): void;
@@ -0,0 +1,9 @@
1
+ import { loadCSS } from 'fg-loadcss';
2
+ let dependenciesLoaded = false;
3
+ export function loadDependencies() {
4
+ if (dependenciesLoaded) {
5
+ return;
6
+ }
7
+ dependenciesLoaded = true;
8
+ loadCSS('https://fonts.googleapis.com/icon?family=Material+Icons|Material+Icons+Two+Tone', document.querySelector('#material-icon-font') ?? undefined);
9
+ }
@@ -0,0 +1,13 @@
1
+ export declare function reportWebVitals({
2
+ id,
3
+ name,
4
+ label,
5
+ delta,
6
+ value
7
+ }: {
8
+ id: string;
9
+ name: string;
10
+ label: string;
11
+ delta: number;
12
+ value: number;
13
+ }): void;