@mui/private-theming 9.0.0 → 9.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- The MIT License (MIT)
1
+ MIT License
2
2
 
3
3
  Copyright (c) 2014 Call-Em-All
4
4
 
@@ -1,6 +1,13 @@
1
- import { DefaultTheme } from "../defaultTheme/index.mjs";
1
+ import * as React from 'react';
2
+ import type { DefaultTheme } from "../defaultTheme/index.mjs";
2
3
  export interface ThemeProviderProps<Theme = DefaultTheme> {
3
4
  children?: React.ReactNode;
4
5
  theme: Partial<Theme> | ((outerTheme: Theme) => Theme);
5
6
  }
6
- export default function ThemeProvider<T = DefaultTheme>(props: ThemeProviderProps<T>): React.ReactElement<ThemeProviderProps<T>>;
7
+ /**
8
+ * This component takes a `theme` prop.
9
+ * It makes the `theme` available down the React tree thanks to React context.
10
+ * This component should preferably be used at **the root of your component tree**.
11
+ */
12
+ declare function ThemeProvider<T = DefaultTheme>(props: ThemeProviderProps<T>): React.ReactElement<ThemeProviderProps<T>>;
13
+ export default ThemeProvider;
@@ -1,6 +1,13 @@
1
- import { DefaultTheme } from "../defaultTheme/index.js";
1
+ import * as React from 'react';
2
+ import type { DefaultTheme } from "../defaultTheme/index.js";
2
3
  export interface ThemeProviderProps<Theme = DefaultTheme> {
3
4
  children?: React.ReactNode;
4
5
  theme: Partial<Theme> | ((outerTheme: Theme) => Theme);
5
6
  }
6
- export default function ThemeProvider<T = DefaultTheme>(props: ThemeProviderProps<T>): React.ReactElement<ThemeProviderProps<T>>;
7
+ /**
8
+ * This component takes a `theme` prop.
9
+ * It makes the `theme` available down the React tree thanks to React context.
10
+ * This component should preferably be used at **the root of your component tree**.
11
+ */
12
+ declare function ThemeProvider<T = DefaultTheme>(props: ThemeProviderProps<T>): React.ReactElement<ThemeProviderProps<T>>;
13
+ export default ThemeProvider;
@@ -60,7 +60,7 @@ function ThemeProvider(props) {
60
60
  children: children
61
61
  });
62
62
  }
63
- process.env.NODE_ENV !== "production" ? ThemeProvider.propTypes = {
63
+ process.env.NODE_ENV !== "production" ? ThemeProvider.propTypes /* remove-proptypes */ = {
64
64
  /**
65
65
  * Your component tree.
66
66
  */
@@ -71,6 +71,6 @@ process.env.NODE_ENV !== "production" ? ThemeProvider.propTypes = {
71
71
  theme: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.func]).isRequired
72
72
  } : void 0;
73
73
  if (process.env.NODE_ENV !== 'production') {
74
- process.env.NODE_ENV !== "production" ? ThemeProvider.propTypes = (0, _exactProp.default)(ThemeProvider.propTypes) : void 0;
74
+ ThemeProvider.propTypes = (0, _exactProp.default)(ThemeProvider.propTypes);
75
75
  }
76
76
  var _default = exports.default = ThemeProvider;
@@ -4,9 +4,8 @@ import exactProp from '@mui/utils/exactProp';
4
4
  import ThemeContext from "../useTheme/ThemeContext.mjs";
5
5
  import useTheme from "../useTheme/index.mjs";
6
6
  import nested from "./nested.mjs";
7
-
8
- // To support composition of theme.
9
7
  import { jsx as _jsx } from "react/jsx-runtime";
8
+ // To support composition of theme.
10
9
  function mergeOuterLocalTheme(outerTheme, localTheme) {
11
10
  if (typeof localTheme === 'function') {
12
11
  const mergedTheme = localTheme(outerTheme);
@@ -53,7 +52,7 @@ function ThemeProvider(props) {
53
52
  children: children
54
53
  });
55
54
  }
56
- process.env.NODE_ENV !== "production" ? ThemeProvider.propTypes = {
55
+ process.env.NODE_ENV !== "production" ? ThemeProvider.propTypes /* remove-proptypes */ = {
57
56
  /**
58
57
  * Your component tree.
59
58
  */
@@ -64,6 +63,6 @@ process.env.NODE_ENV !== "production" ? ThemeProvider.propTypes = {
64
63
  theme: PropTypes.oneOfType([PropTypes.object, PropTypes.func]).isRequired
65
64
  } : void 0;
66
65
  if (process.env.NODE_ENV !== 'production') {
67
- process.env.NODE_ENV !== "production" ? ThemeProvider.propTypes = exactProp(ThemeProvider.propTypes) : void 0;
66
+ ThemeProvider.propTypes = exactProp(ThemeProvider.propTypes);
68
67
  }
69
68
  export default ThemeProvider;
@@ -1,2 +1,2 @@
1
1
  export { default } from "./ThemeProvider.mjs";
2
- export * from "./ThemeProvider.mjs";
2
+ export type * from "./ThemeProvider.mjs";
@@ -1,2 +1,2 @@
1
1
  export { default } from "./ThemeProvider.js";
2
- export * from "./ThemeProvider.js";
2
+ export type * from "./ThemeProvider.js";
@@ -1,2 +1,3 @@
1
1
  export { default } from "./ThemeProvider.mjs";
2
+ /** @internal Runtime-only re-export, intentionally absent from the public types. */
2
3
  export { default as unstable_nested } from "./nested.mjs";
@@ -0,0 +1,2 @@
1
+ declare const _default: symbol | "__THEME_NESTED__";
2
+ export default _default;
@@ -0,0 +1,2 @@
1
+ declare const _default: symbol | "__THEME_NESTED__";
2
+ export default _default;
package/index.d.mts CHANGED
@@ -1,5 +1,4 @@
1
1
  export { default as ThemeProvider } from "./ThemeProvider/index.mjs";
2
2
  export * from "./ThemeProvider/index.mjs";
3
3
  export { default as useTheme } from "./useTheme/index.mjs";
4
- export * from "./useTheme/index.mjs";
5
- export * from "./defaultTheme/index.mjs";
4
+ export type * from "./defaultTheme/index.mjs";
package/index.d.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  export { default as ThemeProvider } from "./ThemeProvider/index.js";
2
2
  export * from "./ThemeProvider/index.js";
3
3
  export { default as useTheme } from "./useTheme/index.js";
4
- export * from "./useTheme/index.js";
5
- export * from "./defaultTheme/index.js";
4
+ export type * from "./defaultTheme/index.js";
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/private-theming v9.0.0
2
+ * @mui/private-theming v9.1.0
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
package/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/private-theming v9.0.0
2
+ * @mui/private-theming v9.1.0
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/private-theming",
3
- "version": "9.0.0",
3
+ "version": "9.1.0",
4
4
  "author": "MUI Team",
5
5
  "description": "Private - The React theme context to be shared between `@mui/styles` and `@mui/material`.",
6
6
  "license": "MIT",
@@ -26,7 +26,7 @@
26
26
  "dependencies": {
27
27
  "@babel/runtime": "^7.29.2",
28
28
  "prop-types": "^15.8.1",
29
- "@mui/utils": "^9.0.0"
29
+ "@mui/utils": "^9.1.0"
30
30
  },
31
31
  "peerDependencies": {
32
32
  "@types/react": "^17.0.0 || ^18.0.0 || ^19.0.0",
@@ -0,0 +1,3 @@
1
+ import * as React from 'react';
2
+ declare const ThemeContext: React.Context<any>;
3
+ export default ThemeContext;
@@ -0,0 +1,3 @@
1
+ import * as React from 'react';
2
+ declare const ThemeContext: React.Context<any>;
3
+ export default ThemeContext;
@@ -1,2 +1 @@
1
- export { default } from "./useTheme.mjs";
2
- export * from "./useTheme.mjs";
1
+ export { default } from "./useTheme.mjs";
@@ -1,2 +1 @@
1
- export { default } from "./useTheme.js";
2
- export * from "./useTheme.js";
1
+ export { default } from "./useTheme.js";
@@ -1,2 +1,2 @@
1
- import { DefaultTheme } from "../defaultTheme/index.mjs";
1
+ import type { DefaultTheme } from "../defaultTheme/index.mjs";
2
2
  export default function useTheme<T = DefaultTheme>(): T;
@@ -1,2 +1,2 @@
1
- import { DefaultTheme } from "../defaultTheme/index.js";
1
+ import type { DefaultTheme } from "../defaultTheme/index.js";
2
2
  export default function useTheme<T = DefaultTheme>(): T;