@mui/docs 9.0.0-alpha.0 → 9.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 (181) hide show
  1. package/{esm/Ad/Ad.js → Ad/Ad.mjs} +5 -5
  2. package/{esm/Ad/AdCarbon.js → Ad/AdCarbon.mjs} +3 -3
  3. package/{esm/Ad/AdDisplay.js → Ad/AdDisplay.mjs} +4 -4
  4. package/{esm/Ad/AdGuest.js → Ad/AdGuest.mjs} +1 -1
  5. package/{esm/Ad/AdInHouse.d.ts → Ad/AdInHouse.d.mts} +1 -1
  6. package/{esm/Ad/AdInHouse.js → Ad/AdInHouse.mjs} +1 -1
  7. package/{esm/Ad/ad.styles.d.ts → Ad/ad.styles.d.mts} +4 -4
  8. package/Ad/ad.styles.d.ts +4 -4
  9. package/Ad/index.d.mts +5 -0
  10. package/Ad/index.mjs +7 -0
  11. package/CHANGELOG.md +74 -0
  12. package/{esm/CodeCopy/CodeCopyButton.js → CodeCopy/CodeCopyButton.mjs} +1 -1
  13. package/CodeCopy/index.d.mts +3 -0
  14. package/CodeCopy/index.mjs +3 -0
  15. package/{esm/ComponentLinkHeader/ComponentLinkHeader.js → ComponentLinkHeader/ComponentLinkHeader.mjs} +7 -7
  16. package/{esm/ComponentLinkHeader/index.d.ts → ComponentLinkHeader/index.d.mts} +2 -2
  17. package/{esm/ComponentLinkHeader/index.js → ComponentLinkHeader/index.mjs} +2 -2
  18. package/{esm/DocsProvider/DocsProvider.d.ts → DocsProvider/DocsProvider.d.mts} +2 -2
  19. package/{esm/DocsProvider/DocsProvider.js → DocsProvider/DocsProvider.mjs} +2 -2
  20. package/DocsProvider/index.d.mts +1 -0
  21. package/DocsProvider/index.mjs +1 -0
  22. package/{esm/HighlightedCode/HighlightedCode.js → HighlightedCode/HighlightedCode.mjs} +2 -2
  23. package/HighlightedCode/index.d.mts +1 -0
  24. package/HighlightedCode/index.mjs +1 -0
  25. package/{esm/HighlightedCodeWithTabs/HighlightedCodeWithTabs.js → HighlightedCodeWithTabs/HighlightedCodeWithTabs.mjs} +1 -1
  26. package/HighlightedCodeWithTabs/index.d.mts +2 -0
  27. package/HighlightedCodeWithTabs/index.mjs +2 -0
  28. package/IconImage/IconImage.d.mts +11 -0
  29. package/IconImage/IconImage.d.ts +11 -0
  30. package/IconImage/IconImage.js +91 -0
  31. package/IconImage/IconImage.mjs +83 -0
  32. package/IconImage/index.d.mts +1 -0
  33. package/IconImage/index.d.ts +1 -0
  34. package/IconImage/index.js +13 -0
  35. package/IconImage/index.mjs +1 -0
  36. package/{esm/InfoCard/InfoCard.d.ts → InfoCard/InfoCard.d.mts} +1 -1
  37. package/{esm/InfoCard/InfoCard.js → InfoCard/InfoCard.mjs} +1 -1
  38. package/InfoCard/index.d.mts +1 -0
  39. package/InfoCard/index.mjs +1 -0
  40. package/{esm/Link/Link.js → Link/Link.mjs} +2 -2
  41. package/Link/index.d.mts +1 -0
  42. package/Link/index.mjs +1 -0
  43. package/{esm/MarkdownElement/MarkdownElement.js → MarkdownElement/MarkdownElement.mjs} +1 -1
  44. package/MarkdownElement/index.d.mts +1 -0
  45. package/MarkdownElement/index.mjs +1 -0
  46. package/NProgressBar/index.d.mts +2 -0
  47. package/NProgressBar/index.mjs +1 -0
  48. package/SectionHeadline/SectionHeadline.d.mts +13 -0
  49. package/SectionHeadline/SectionHeadline.d.ts +13 -0
  50. package/SectionHeadline/SectionHeadline.js +89 -0
  51. package/SectionHeadline/SectionHeadline.mjs +81 -0
  52. package/SectionHeadline/index.d.mts +2 -0
  53. package/SectionHeadline/index.d.ts +2 -0
  54. package/SectionHeadline/index.js +25 -0
  55. package/SectionHeadline/index.mjs +2 -0
  56. package/SectionTitle/index.d.mts +1 -0
  57. package/SectionTitle/index.mjs +1 -0
  58. package/ThemeContext/ThemeContext.d.mts +92 -0
  59. package/ThemeContext/ThemeContext.d.ts +92 -0
  60. package/ThemeContext/ThemeContext.js +212 -0
  61. package/ThemeContext/ThemeContext.mjs +200 -0
  62. package/ThemeContext/index.d.mts +1 -0
  63. package/ThemeContext/index.d.ts +1 -0
  64. package/ThemeContext/index.js +42 -0
  65. package/ThemeContext/index.mjs +1 -0
  66. package/{esm/branding/BrandingProvider.js → branding/BrandingProvider.mjs} +1 -1
  67. package/branding/index.d.mts +2 -0
  68. package/branding/index.mjs +2 -0
  69. package/i18n/i18n.js +3 -1
  70. package/{esm/i18n/i18n.js → i18n/i18n.mjs} +4 -2
  71. package/i18n/index.d.mts +1 -0
  72. package/i18n/index.mjs +1 -0
  73. package/package.json +265 -8
  74. package/translations/index.d.mts +3 -0
  75. package/useLazyCSS/index.d.mts +1 -0
  76. package/useLazyCSS/index.d.ts +1 -0
  77. package/useLazyCSS/index.js +13 -0
  78. package/useLazyCSS/index.mjs +1 -0
  79. package/useLazyCSS/useLazyCSS.d.mts +11 -0
  80. package/useLazyCSS/useLazyCSS.d.ts +11 -0
  81. package/useLazyCSS/useLazyCSS.js +76 -0
  82. package/useLazyCSS/useLazyCSS.mjs +70 -0
  83. package/esm/Ad/index.d.ts +0 -5
  84. package/esm/Ad/index.js +0 -7
  85. package/esm/CodeCopy/index.d.ts +0 -3
  86. package/esm/CodeCopy/index.js +0 -3
  87. package/esm/DocsProvider/index.d.ts +0 -1
  88. package/esm/DocsProvider/index.js +0 -1
  89. package/esm/HighlightedCode/index.d.ts +0 -1
  90. package/esm/HighlightedCode/index.js +0 -1
  91. package/esm/HighlightedCodeWithTabs/index.d.ts +0 -2
  92. package/esm/HighlightedCodeWithTabs/index.js +0 -2
  93. package/esm/InfoCard/index.d.ts +0 -1
  94. package/esm/InfoCard/index.js +0 -1
  95. package/esm/Link/index.d.ts +0 -1
  96. package/esm/Link/index.js +0 -1
  97. package/esm/MarkdownElement/index.d.ts +0 -1
  98. package/esm/MarkdownElement/index.js +0 -1
  99. package/esm/NProgressBar/index.d.ts +0 -2
  100. package/esm/NProgressBar/index.js +0 -1
  101. package/esm/SectionTitle/index.d.ts +0 -1
  102. package/esm/SectionTitle/index.js +0 -1
  103. package/esm/branding/index.d.ts +0 -2
  104. package/esm/branding/index.js +0 -2
  105. package/esm/i18n/index.d.ts +0 -1
  106. package/esm/i18n/index.js +0 -1
  107. package/esm/nextFonts/fonts/GeneralSans-Bold.ttf +0 -0
  108. package/esm/nextFonts/fonts/GeneralSans-Bold.woff2 +0 -0
  109. package/esm/nextFonts/fonts/GeneralSans-Medium.ttf +0 -0
  110. package/esm/nextFonts/fonts/GeneralSans-Medium.woff2 +0 -0
  111. package/esm/nextFonts/fonts/GeneralSans-Regular.ttf +0 -0
  112. package/esm/nextFonts/fonts/GeneralSans-Regular.woff2 +0 -0
  113. package/esm/nextFonts/fonts/GeneralSans-Semibold-subset.woff2 +0 -0
  114. package/esm/nextFonts/fonts/GeneralSans-Semibold.ttf +0 -0
  115. package/esm/nextFonts/fonts/GeneralSans-Semibold.woff2 +0 -0
  116. package/esm/nextFonts/fonts/IBMPlexSans-Bold.ttf +0 -0
  117. package/esm/nextFonts/fonts/IBMPlexSans-Bold.woff +0 -0
  118. package/esm/nextFonts/fonts/IBMPlexSans-Bold.woff2 +0 -0
  119. package/esm/nextFonts/fonts/IBMPlexSans-Medium.ttf +0 -0
  120. package/esm/nextFonts/fonts/IBMPlexSans-Medium.woff +0 -0
  121. package/esm/nextFonts/fonts/IBMPlexSans-Medium.woff2 +0 -0
  122. package/esm/nextFonts/fonts/IBMPlexSans-Regular-subset.woff2 +0 -0
  123. package/esm/nextFonts/fonts/IBMPlexSans-Regular.ttf +0 -0
  124. package/esm/nextFonts/fonts/IBMPlexSans-Regular.woff +0 -0
  125. package/esm/nextFonts/fonts/IBMPlexSans-Regular.woff2 +0 -0
  126. package/esm/nextFonts/fonts/IBMPlexSans-SemiBold.ttf +0 -0
  127. package/esm/nextFonts/fonts/IBMPlexSans-SemiBold.woff +0 -0
  128. package/esm/nextFonts/fonts/IBMPlexSans-SemiBold.woff2 +0 -0
  129. package/esm/package.json +0 -1
  130. package/esm/translations/index.d.ts +0 -3
  131. package/esm/translations/translations.json +0 -223
  132. /package/{esm/Ad/Ad.d.ts → Ad/Ad.d.mts} +0 -0
  133. /package/{esm/Ad/AdCarbon.d.ts → Ad/AdCarbon.d.mts} +0 -0
  134. /package/{esm/Ad/AdDisplay.d.ts → Ad/AdDisplay.d.mts} +0 -0
  135. /package/{esm/Ad/AdGuest.d.ts → Ad/AdGuest.d.mts} +0 -0
  136. /package/{esm/Ad/AdManager.d.ts → Ad/AdManager.d.mts} +0 -0
  137. /package/{esm/Ad/AdManager.js → Ad/AdManager.mjs} +0 -0
  138. /package/{esm/Ad/AdProvider.d.ts → Ad/AdProvider.d.mts} +0 -0
  139. /package/{esm/Ad/AdProvider.js → Ad/AdProvider.mjs} +0 -0
  140. /package/{esm/Ad/ad.styles.js → Ad/ad.styles.mjs} +0 -0
  141. /package/{esm/CodeCopy/CodeCopy.d.ts → CodeCopy/CodeCopy.d.mts} +0 -0
  142. /package/{esm/CodeCopy/CodeCopy.js → CodeCopy/CodeCopy.mjs} +0 -0
  143. /package/{esm/CodeCopy/CodeCopyButton.d.ts → CodeCopy/CodeCopyButton.d.mts} +0 -0
  144. /package/{esm/CodeCopy/useClipboardCopy.d.ts → CodeCopy/useClipboardCopy.d.mts} +0 -0
  145. /package/{esm/CodeCopy/useClipboardCopy.js → CodeCopy/useClipboardCopy.mjs} +0 -0
  146. /package/{esm/ComponentLinkHeader/ComponentLinkHeader.d.ts → ComponentLinkHeader/ComponentLinkHeader.d.mts} +0 -0
  147. /package/{esm/HighlightedCode/HighlightedCode.d.ts → HighlightedCode/HighlightedCode.d.mts} +0 -0
  148. /package/{esm/HighlightedCodeWithTabs/HighlightedCodeWithTabs.d.ts → HighlightedCodeWithTabs/HighlightedCodeWithTabs.d.mts} +0 -0
  149. /package/{esm/Link/Link.d.ts → Link/Link.d.mts} +0 -0
  150. /package/{esm/MarkdownElement/MarkdownElement.d.ts → MarkdownElement/MarkdownElement.d.mts} +0 -0
  151. /package/{esm/NProgressBar/NProgressBar.d.ts → NProgressBar/NProgressBar.d.mts} +0 -0
  152. /package/{esm/NProgressBar/NProgressBar.js → NProgressBar/NProgressBar.mjs} +0 -0
  153. /package/{esm/SectionTitle/SectionTitle.d.ts → SectionTitle/SectionTitle.d.mts} +0 -0
  154. /package/{esm/SectionTitle/SectionTitle.js → SectionTitle/SectionTitle.mjs} +0 -0
  155. /package/{esm/branding/BrandingProvider.d.ts → branding/BrandingProvider.d.mts} +0 -0
  156. /package/{esm/branding/brandingTheme.d.ts → branding/brandingTheme.d.mts} +0 -0
  157. /package/{esm/branding/brandingTheme.js → branding/brandingTheme.mjs} +0 -0
  158. /package/{esm/i18n/i18n.d.ts → i18n/i18n.d.mts} +0 -0
  159. /package/{esm/nextFonts/index.d.ts → nextFonts/index.d.mts} +0 -0
  160. /package/{esm/nextFonts/index.js → nextFonts/index.mjs} +0 -0
  161. /package/{esm/svgIcons/BundleSizeIcon.d.ts → svgIcons/BundleSizeIcon.d.mts} +0 -0
  162. /package/{esm/svgIcons/BundleSizeIcon.js → svgIcons/BundleSizeIcon.mjs} +0 -0
  163. /package/{esm/svgIcons/FigmaIcon.d.ts → svgIcons/FigmaIcon.d.mts} +0 -0
  164. /package/{esm/svgIcons/FigmaIcon.js → svgIcons/FigmaIcon.mjs} +0 -0
  165. /package/{esm/svgIcons/FileDownload.d.ts → svgIcons/FileDownload.d.mts} +0 -0
  166. /package/{esm/svgIcons/FileDownload.js → svgIcons/FileDownload.mjs} +0 -0
  167. /package/{esm/svgIcons/JavaScript.d.ts → svgIcons/JavaScript.d.mts} +0 -0
  168. /package/{esm/svgIcons/JavaScript.js → svgIcons/JavaScript.mjs} +0 -0
  169. /package/{esm/svgIcons/MarkdownIcon.d.ts → svgIcons/MarkdownIcon.d.mts} +0 -0
  170. /package/{esm/svgIcons/MarkdownIcon.js → svgIcons/MarkdownIcon.mjs} +0 -0
  171. /package/{esm/svgIcons/MaterialDesignIcon.d.ts → svgIcons/MaterialDesignIcon.d.mts} +0 -0
  172. /package/{esm/svgIcons/MaterialDesignIcon.js → svgIcons/MaterialDesignIcon.mjs} +0 -0
  173. /package/{esm/svgIcons/SketchIcon.d.ts → svgIcons/SketchIcon.d.mts} +0 -0
  174. /package/{esm/svgIcons/SketchIcon.js → svgIcons/SketchIcon.mjs} +0 -0
  175. /package/{esm/svgIcons/TypeScript.d.ts → svgIcons/TypeScript.d.mts} +0 -0
  176. /package/{esm/svgIcons/TypeScript.js → svgIcons/TypeScript.mjs} +0 -0
  177. /package/{esm/svgIcons/W3CIcon.d.ts → svgIcons/W3CIcon.d.mts} +0 -0
  178. /package/{esm/svgIcons/W3CIcon.js → svgIcons/W3CIcon.mjs} +0 -0
  179. /package/{esm/translations/index.js → translations/index.mjs} +0 -0
  180. /package/{esm/utils/loadScript.d.ts → utils/loadScript.d.mts} +0 -0
  181. /package/{esm/utils/loadScript.js → utils/loadScript.mjs} +0 -0
@@ -0,0 +1,200 @@
1
+ import * as React from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import { createTheme as createMdTheme } from '@mui/material/styles';
4
+ import { unstable_useEnhancedEffect as useEnhancedEffect } from '@mui/material/utils';
5
+ import useMediaQuery from '@mui/material/useMediaQuery';
6
+ import useLocalStorageState from '@mui/utils/useLocalStorageState';
7
+ import useLazyCSS from "../useLazyCSS/index.mjs";
8
+ import { getMetaThemeColor } from "../branding/index.mjs";
9
+ import { jsx as _jsx } from "react/jsx-runtime";
10
+ const themeInitialOptions = {
11
+ dense: false,
12
+ direction: 'ltr',
13
+ paletteMode: 'light'
14
+ };
15
+ export const highDensity = {
16
+ components: {
17
+ MuiButton: {
18
+ defaultProps: {
19
+ size: 'small'
20
+ }
21
+ },
22
+ MuiFilledInput: {
23
+ defaultProps: {
24
+ margin: 'dense'
25
+ }
26
+ },
27
+ MuiFormControl: {
28
+ defaultProps: {
29
+ margin: 'dense'
30
+ }
31
+ },
32
+ MuiFormHelperText: {
33
+ defaultProps: {
34
+ margin: 'dense'
35
+ }
36
+ },
37
+ MuiIconButton: {
38
+ defaultProps: {
39
+ size: 'small'
40
+ }
41
+ },
42
+ MuiInputBase: {
43
+ defaultProps: {
44
+ margin: 'dense'
45
+ }
46
+ },
47
+ MuiInputLabel: {
48
+ defaultProps: {
49
+ margin: 'dense'
50
+ }
51
+ },
52
+ MuiListItem: {
53
+ defaultProps: {
54
+ dense: true
55
+ }
56
+ },
57
+ MuiOutlinedInput: {
58
+ defaultProps: {
59
+ margin: 'dense'
60
+ }
61
+ },
62
+ MuiFab: {
63
+ defaultProps: {
64
+ size: 'small'
65
+ }
66
+ },
67
+ MuiTable: {
68
+ defaultProps: {
69
+ size: 'small'
70
+ }
71
+ },
72
+ MuiTextField: {
73
+ defaultProps: {
74
+ margin: 'dense'
75
+ }
76
+ },
77
+ MuiToolbar: {
78
+ defaultProps: {
79
+ variant: 'dense'
80
+ }
81
+ }
82
+ }
83
+ };
84
+ export const DispatchContext = /*#__PURE__*/React.createContext(() => {
85
+ throw new Error('Forgot to wrap component in `ThemeProvider`');
86
+ });
87
+ if (process.env.NODE_ENV !== 'production') {
88
+ DispatchContext.displayName = 'ThemeDispatchContext';
89
+ }
90
+ export const ThemeOptionsContext = /*#__PURE__*/React.createContext(themeInitialOptions);
91
+ if (process.env.NODE_ENV !== 'production') {
92
+ ThemeOptionsContext.displayName = 'ThemeOptionsContext';
93
+ }
94
+ export function ThemeProvider(props) {
95
+ const {
96
+ children
97
+ } = props;
98
+ const [themeOptions, dispatch] = React.useReducer((state, action) => {
99
+ switch (action.type) {
100
+ case 'SET_DENSE':
101
+ return {
102
+ ...state,
103
+ dense: action.payload
104
+ };
105
+ case 'RESET_DENSITY':
106
+ return {
107
+ ...state,
108
+ dense: themeInitialOptions.dense
109
+ };
110
+ case 'CHANGE':
111
+ // No value changed
112
+ if ((!action.payload.paletteMode || action.payload.paletteMode === state.paletteMode) && (!action.payload.direction || action.payload.direction === state.direction)) {
113
+ return state;
114
+ }
115
+ return {
116
+ ...state,
117
+ paletteMode: action.payload.paletteMode || state.paletteMode,
118
+ direction: action.payload.direction || state.direction
119
+ };
120
+ default:
121
+ throw new Error(`Unrecognized type ${action.type}`);
122
+ }
123
+ }, themeInitialOptions);
124
+ const {
125
+ direction,
126
+ paletteMode
127
+ } = themeOptions;
128
+ useLazyCSS('/static/styles/prism-okaidia.css', '#prismjs');
129
+
130
+ // TODO replace with useColorScheme once all pages support css vars
131
+ const {
132
+ mode,
133
+ systemMode
134
+ } = useColorSchemeShim();
135
+ const calculatedMode = mode === 'system' ? systemMode : mode;
136
+ useEnhancedEffect(() => {
137
+ dispatch({
138
+ type: 'CHANGE',
139
+ payload: {
140
+ paletteMode: calculatedMode
141
+ }
142
+ });
143
+ }, [calculatedMode]);
144
+ useEnhancedEffect(() => {
145
+ document.body.setAttribute('dir', direction);
146
+ }, [direction]);
147
+ useEnhancedEffect(() => {
148
+ // To support light and dark mode images in the docs
149
+ if (paletteMode === 'dark') {
150
+ document.body.classList.remove('mode-light');
151
+ document.body.classList.add('mode-dark');
152
+ } else {
153
+ document.body.classList.remove('mode-dark');
154
+ document.body.classList.add('mode-light');
155
+ }
156
+ const metas = document.querySelectorAll('meta[name="theme-color"]');
157
+ metas.forEach(meta => {
158
+ meta.setAttribute('content', getMetaThemeColor(paletteMode));
159
+ });
160
+ }, [paletteMode]);
161
+ React.useEffect(() => {
162
+ // Expose the theme as a global variable so people can play with it.
163
+ window.createTheme = createMdTheme;
164
+ }, []);
165
+ return /*#__PURE__*/_jsx(ThemeOptionsContext.Provider, {
166
+ value: themeOptions,
167
+ children: /*#__PURE__*/_jsx(DispatchContext.Provider, {
168
+ value: dispatch,
169
+ children: children
170
+ })
171
+ });
172
+ }
173
+ process.env.NODE_ENV !== "production" ? ThemeProvider.propTypes = {
174
+ children: PropTypes.node
175
+ } : void 0;
176
+
177
+ /**
178
+ * @returns {(nextOptions: Partial<typeof themeInitialOptions>) => void}
179
+ */
180
+ export function useChangeTheme() {
181
+ const dispatch = React.useContext(DispatchContext);
182
+ return React.useCallback(options => dispatch({
183
+ type: 'CHANGE',
184
+ payload: options
185
+ }), [dispatch]);
186
+ }
187
+
188
+ // TODO: remove once all pages support css vars and replace call sites with useColorScheme()
189
+ export function useColorSchemeShim() {
190
+ const [mode, setMode] = useLocalStorageState('mui-mode', 'system');
191
+ const prefersDarkMode = useMediaQuery('(prefers-color-scheme: dark)', {
192
+ noSsr: true
193
+ });
194
+ const systemMode = prefersDarkMode ? 'dark' : 'light';
195
+ return {
196
+ mode,
197
+ systemMode,
198
+ setMode
199
+ };
200
+ }
@@ -0,0 +1 @@
1
+ export { ThemeProvider, ThemeOptionsContext, DispatchContext, highDensity, useChangeTheme, useColorSchemeShim } from "./ThemeContext.mjs";
@@ -0,0 +1 @@
1
+ export { ThemeProvider, ThemeOptionsContext, DispatchContext, highDensity, useChangeTheme, useColorSchemeShim } from "./ThemeContext.js";
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "DispatchContext", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _ThemeContext.DispatchContext;
10
+ }
11
+ });
12
+ Object.defineProperty(exports, "ThemeOptionsContext", {
13
+ enumerable: true,
14
+ get: function () {
15
+ return _ThemeContext.ThemeOptionsContext;
16
+ }
17
+ });
18
+ Object.defineProperty(exports, "ThemeProvider", {
19
+ enumerable: true,
20
+ get: function () {
21
+ return _ThemeContext.ThemeProvider;
22
+ }
23
+ });
24
+ Object.defineProperty(exports, "highDensity", {
25
+ enumerable: true,
26
+ get: function () {
27
+ return _ThemeContext.highDensity;
28
+ }
29
+ });
30
+ Object.defineProperty(exports, "useChangeTheme", {
31
+ enumerable: true,
32
+ get: function () {
33
+ return _ThemeContext.useChangeTheme;
34
+ }
35
+ });
36
+ Object.defineProperty(exports, "useColorSchemeShim", {
37
+ enumerable: true,
38
+ get: function () {
39
+ return _ThemeContext.useColorSchemeShim;
40
+ }
41
+ });
42
+ var _ThemeContext = require("./ThemeContext");
@@ -0,0 +1 @@
1
+ export { ThemeProvider, ThemeOptionsContext, DispatchContext, highDensity, useChangeTheme, useColorSchemeShim } from "./ThemeContext.mjs";
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { ThemeProvider, useTheme } from '@mui/material/styles';
3
- import { brandingDarkTheme, brandingLightTheme } from "./brandingTheme.js";
3
+ import { brandingDarkTheme, brandingLightTheme } from "./brandingTheme.mjs";
4
4
  import { jsx as _jsx } from "react/jsx-runtime";
5
5
  export function BrandingProvider(props) {
6
6
  const {
@@ -0,0 +1,2 @@
1
+ export * from "./brandingTheme.mjs";
2
+ export * from "./BrandingProvider.mjs";
@@ -0,0 +1,2 @@
1
+ export * from "./brandingTheme.mjs";
2
+ export * from "./BrandingProvider.mjs";
package/i18n/i18n.js CHANGED
@@ -100,7 +100,9 @@ function useTranslate() {
100
100
  }
101
101
  const translation = getPath(wordings, key);
102
102
  if (!translation) {
103
- warn(userLanguage, key, ignoreWarning);
103
+ if (process.env.NODE_ENV !== 'production') {
104
+ warn(userLanguage, key, ignoreWarning);
105
+ }
104
106
  const enTranslation = getPath(translations.en, key);
105
107
  return enTranslation ?? null;
106
108
  }
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import deepmerge from '@mui/utils/deepmerge';
4
- import defaultTranslations from "../translations/index.js";
4
+ import defaultTranslations from "../translations/index.mjs";
5
5
  import { jsx as _jsx } from "react/jsx-runtime";
6
6
  const TranslationsContext = /*#__PURE__*/React.createContext(defaultTranslations);
7
7
  function TranslationsProvider({
@@ -88,7 +88,9 @@ export function useTranslate() {
88
88
  }
89
89
  const translation = getPath(wordings, key);
90
90
  if (!translation) {
91
- warn(userLanguage, key, ignoreWarning);
91
+ if (process.env.NODE_ENV !== 'production') {
92
+ warn(userLanguage, key, ignoreWarning);
93
+ }
92
94
  const enTranslation = getPath(translations.en, key);
93
95
  return enTranslation ?? null;
94
96
  }
@@ -0,0 +1 @@
1
+ export * from "./i18n.mjs";
package/i18n/index.mjs ADDED
@@ -0,0 +1 @@
1
+ export * from "./i18n.mjs";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/docs",
3
- "version": "9.0.0-alpha.0",
3
+ "version": "9.0.0-alpha.2",
4
4
  "author": "MUI Team",
5
5
  "description": "MUI Docs - Documentation building blocks.",
6
6
  "keywords": [
@@ -24,15 +24,17 @@
24
24
  "@babel/runtime": "^7.28.6",
25
25
  "clipboard-copy": "^4.0.1",
26
26
  "clsx": "^2.1.1",
27
+ "fg-loadcss": "^3.1.0",
27
28
  "nprogress": "^0.2.0",
28
29
  "prop-types": "^15.8.1",
29
- "@mui/internal-markdown": "^3.0.1"
30
+ "@mui/internal-markdown": "^3.0.2"
30
31
  },
31
32
  "peerDependencies": {
32
33
  "@mui/base": "^5.0.0 || ^5.0.0-beta || ^7.0.0 || ^7.0.0-beta",
33
34
  "@mui/icons-material": "^5.0.0 || ^6.0.0 || ^7.0.0 || ^7.0.0-beta",
34
35
  "@mui/material": "^5.0.0 || ^6.0.0 || ^7.0.0 || ^7.0.0-beta",
35
36
  "@mui/system": "^5.0.0 || ^6.0.0 || ^7.0.0 || ^7.0.0-beta",
37
+ "@mui/utils": "^5.0.0 || ^6.0.0 || ^7.0.0 || ^7.0.0-beta",
36
38
  "@types/react": "^17.0.0 || ^18.0.0 || ^19.0.0",
37
39
  "chai": "^6.0.1",
38
40
  "csstype": "^3.1.3",
@@ -53,16 +55,271 @@
53
55
  "type": "commonjs",
54
56
  "exports": {
55
57
  "./package.json": "./package.json",
56
- "./*": {
58
+ "./NProgressBar": {
59
+ "import": {
60
+ "types": "./NProgressBar/index.d.mts",
61
+ "default": "./NProgressBar/index.mjs"
62
+ },
63
+ "require": {
64
+ "types": "./NProgressBar/index.d.ts",
65
+ "default": "./NProgressBar/index.js"
66
+ },
67
+ "default": {
68
+ "types": "./NProgressBar/index.d.mts",
69
+ "default": "./NProgressBar/index.mjs"
70
+ }
71
+ },
72
+ "./SectionTitle": {
73
+ "import": {
74
+ "types": "./SectionTitle/index.d.mts",
75
+ "default": "./SectionTitle/index.mjs"
76
+ },
77
+ "require": {
78
+ "types": "./SectionTitle/index.d.ts",
79
+ "default": "./SectionTitle/index.js"
80
+ },
81
+ "default": {
82
+ "types": "./SectionTitle/index.d.mts",
83
+ "default": "./SectionTitle/index.mjs"
84
+ }
85
+ },
86
+ "./Ad": {
87
+ "import": {
88
+ "types": "./Ad/index.d.mts",
89
+ "default": "./Ad/index.mjs"
90
+ },
91
+ "require": {
92
+ "types": "./Ad/index.d.ts",
93
+ "default": "./Ad/index.js"
94
+ },
95
+ "default": {
96
+ "types": "./Ad/index.d.mts",
97
+ "default": "./Ad/index.mjs"
98
+ }
99
+ },
100
+ "./CodeCopy": {
101
+ "import": {
102
+ "types": "./CodeCopy/index.d.mts",
103
+ "default": "./CodeCopy/index.mjs"
104
+ },
105
+ "require": {
106
+ "types": "./CodeCopy/index.d.ts",
107
+ "default": "./CodeCopy/index.js"
108
+ },
109
+ "default": {
110
+ "types": "./CodeCopy/index.d.mts",
111
+ "default": "./CodeCopy/index.mjs"
112
+ }
113
+ },
114
+ "./ComponentLinkHeader": {
115
+ "import": {
116
+ "types": "./ComponentLinkHeader/index.d.mts",
117
+ "default": "./ComponentLinkHeader/index.mjs"
118
+ },
119
+ "require": {
120
+ "types": "./ComponentLinkHeader/index.d.ts",
121
+ "default": "./ComponentLinkHeader/index.js"
122
+ },
123
+ "default": {
124
+ "types": "./ComponentLinkHeader/index.d.mts",
125
+ "default": "./ComponentLinkHeader/index.mjs"
126
+ }
127
+ },
128
+ "./DocsProvider": {
129
+ "import": {
130
+ "types": "./DocsProvider/index.d.mts",
131
+ "default": "./DocsProvider/index.mjs"
132
+ },
133
+ "require": {
134
+ "types": "./DocsProvider/index.d.ts",
135
+ "default": "./DocsProvider/index.js"
136
+ },
137
+ "default": {
138
+ "types": "./DocsProvider/index.d.mts",
139
+ "default": "./DocsProvider/index.mjs"
140
+ }
141
+ },
142
+ "./HighlightedCode": {
143
+ "import": {
144
+ "types": "./HighlightedCode/index.d.mts",
145
+ "default": "./HighlightedCode/index.mjs"
146
+ },
147
+ "require": {
148
+ "types": "./HighlightedCode/index.d.ts",
149
+ "default": "./HighlightedCode/index.js"
150
+ },
151
+ "default": {
152
+ "types": "./HighlightedCode/index.d.mts",
153
+ "default": "./HighlightedCode/index.mjs"
154
+ }
155
+ },
156
+ "./HighlightedCodeWithTabs": {
157
+ "import": {
158
+ "types": "./HighlightedCodeWithTabs/index.d.mts",
159
+ "default": "./HighlightedCodeWithTabs/index.mjs"
160
+ },
161
+ "require": {
162
+ "types": "./HighlightedCodeWithTabs/index.d.ts",
163
+ "default": "./HighlightedCodeWithTabs/index.js"
164
+ },
165
+ "default": {
166
+ "types": "./HighlightedCodeWithTabs/index.d.mts",
167
+ "default": "./HighlightedCodeWithTabs/index.mjs"
168
+ }
169
+ },
170
+ "./IconImage": {
171
+ "import": {
172
+ "types": "./IconImage/index.d.mts",
173
+ "default": "./IconImage/index.mjs"
174
+ },
175
+ "require": {
176
+ "types": "./IconImage/index.d.ts",
177
+ "default": "./IconImage/index.js"
178
+ },
179
+ "default": {
180
+ "types": "./IconImage/index.d.mts",
181
+ "default": "./IconImage/index.mjs"
182
+ }
183
+ },
184
+ "./InfoCard": {
185
+ "import": {
186
+ "types": "./InfoCard/index.d.mts",
187
+ "default": "./InfoCard/index.mjs"
188
+ },
57
189
  "require": {
58
- "types": "./*/index.d.ts",
59
- "default": "./*/index.js"
190
+ "types": "./InfoCard/index.d.ts",
191
+ "default": "./InfoCard/index.js"
60
192
  },
61
193
  "default": {
62
- "types": "./esm/*/index.d.ts",
63
- "default": "./esm/*/index.js"
194
+ "types": "./InfoCard/index.d.mts",
195
+ "default": "./InfoCard/index.mjs"
64
196
  }
65
197
  },
66
- "./esm": null
198
+ "./Link": {
199
+ "import": {
200
+ "types": "./Link/index.d.mts",
201
+ "default": "./Link/index.mjs"
202
+ },
203
+ "require": {
204
+ "types": "./Link/index.d.ts",
205
+ "default": "./Link/index.js"
206
+ },
207
+ "default": {
208
+ "types": "./Link/index.d.mts",
209
+ "default": "./Link/index.mjs"
210
+ }
211
+ },
212
+ "./MarkdownElement": {
213
+ "import": {
214
+ "types": "./MarkdownElement/index.d.mts",
215
+ "default": "./MarkdownElement/index.mjs"
216
+ },
217
+ "require": {
218
+ "types": "./MarkdownElement/index.d.ts",
219
+ "default": "./MarkdownElement/index.js"
220
+ },
221
+ "default": {
222
+ "types": "./MarkdownElement/index.d.mts",
223
+ "default": "./MarkdownElement/index.mjs"
224
+ }
225
+ },
226
+ "./SectionHeadline": {
227
+ "import": {
228
+ "types": "./SectionHeadline/index.d.mts",
229
+ "default": "./SectionHeadline/index.mjs"
230
+ },
231
+ "require": {
232
+ "types": "./SectionHeadline/index.d.ts",
233
+ "default": "./SectionHeadline/index.js"
234
+ },
235
+ "default": {
236
+ "types": "./SectionHeadline/index.d.mts",
237
+ "default": "./SectionHeadline/index.mjs"
238
+ }
239
+ },
240
+ "./ThemeContext": {
241
+ "import": {
242
+ "types": "./ThemeContext/index.d.mts",
243
+ "default": "./ThemeContext/index.mjs"
244
+ },
245
+ "require": {
246
+ "types": "./ThemeContext/index.d.ts",
247
+ "default": "./ThemeContext/index.js"
248
+ },
249
+ "default": {
250
+ "types": "./ThemeContext/index.d.mts",
251
+ "default": "./ThemeContext/index.mjs"
252
+ }
253
+ },
254
+ "./branding": {
255
+ "import": {
256
+ "types": "./branding/index.d.mts",
257
+ "default": "./branding/index.mjs"
258
+ },
259
+ "require": {
260
+ "types": "./branding/index.d.ts",
261
+ "default": "./branding/index.js"
262
+ },
263
+ "default": {
264
+ "types": "./branding/index.d.mts",
265
+ "default": "./branding/index.mjs"
266
+ }
267
+ },
268
+ "./i18n": {
269
+ "import": {
270
+ "types": "./i18n/index.d.mts",
271
+ "default": "./i18n/index.mjs"
272
+ },
273
+ "require": {
274
+ "types": "./i18n/index.d.ts",
275
+ "default": "./i18n/index.js"
276
+ },
277
+ "default": {
278
+ "types": "./i18n/index.d.mts",
279
+ "default": "./i18n/index.mjs"
280
+ }
281
+ },
282
+ "./nextFonts": {
283
+ "import": {
284
+ "types": "./nextFonts/index.d.mts",
285
+ "default": "./nextFonts/index.mjs"
286
+ },
287
+ "require": {
288
+ "types": "./nextFonts/index.d.ts",
289
+ "default": "./nextFonts/index.js"
290
+ },
291
+ "default": {
292
+ "types": "./nextFonts/index.d.mts",
293
+ "default": "./nextFonts/index.mjs"
294
+ }
295
+ },
296
+ "./translations": {
297
+ "import": {
298
+ "types": "./translations/index.d.mts",
299
+ "default": "./translations/index.mjs"
300
+ },
301
+ "require": {
302
+ "types": "./translations/index.d.ts",
303
+ "default": "./translations/index.js"
304
+ },
305
+ "default": {
306
+ "types": "./translations/index.d.mts",
307
+ "default": "./translations/index.mjs"
308
+ }
309
+ },
310
+ "./useLazyCSS": {
311
+ "import": {
312
+ "types": "./useLazyCSS/index.d.mts",
313
+ "default": "./useLazyCSS/index.mjs"
314
+ },
315
+ "require": {
316
+ "types": "./useLazyCSS/index.d.ts",
317
+ "default": "./useLazyCSS/index.js"
318
+ },
319
+ "default": {
320
+ "types": "./useLazyCSS/index.d.mts",
321
+ "default": "./useLazyCSS/index.mjs"
322
+ }
323
+ }
67
324
  }
68
325
  }
@@ -0,0 +1,3 @@
1
+ import type { Translations } from "../i18n/index.mjs";
2
+ declare const _default: Record<string, Translations>;
3
+ export default _default;
@@ -0,0 +1 @@
1
+ export { default } from "./useLazyCSS.mjs";
@@ -0,0 +1 @@
1
+ export { default } from "./useLazyCSS.js";
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ Object.defineProperty(exports, "default", {
8
+ enumerable: true,
9
+ get: function () {
10
+ return _useLazyCSS.default;
11
+ }
12
+ });
13
+ var _useLazyCSS = _interopRequireDefault(require("./useLazyCSS"));
@@ -0,0 +1 @@
1
+ export { default } from "./useLazyCSS.mjs";
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Enhanced lazy CSS loader that wraps CSS in a layer using fetch to avoid CORS issues
3
+ * @param {string} href - URL of the CSS file to load
4
+ * @param {string} before - CSS selector to insert before
5
+ * @param {object} options - Additional options
6
+ * @param {string} options.layer - Optional CSS layer name to wrap the CSS in
7
+ * @returns {() => void} cleanup function
8
+ */
9
+ export default function useLazyCSS(href: string, before: string, options?: {
10
+ layer?: string;
11
+ }): void;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Enhanced lazy CSS loader that wraps CSS in a layer using fetch to avoid CORS issues
3
+ * @param {string} href - URL of the CSS file to load
4
+ * @param {string} before - CSS selector to insert before
5
+ * @param {object} options - Additional options
6
+ * @param {string} options.layer - Optional CSS layer name to wrap the CSS in
7
+ * @returns {() => void} cleanup function
8
+ */
9
+ export default function useLazyCSS(href: string, before: string, options?: {
10
+ layer?: string;
11
+ }): void;