@mui/styled-engine-sc 6.4.3 → 7.0.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,9 +1,16 @@
1
- import PropTypes from 'prop-types';
2
- import { createGlobalStyle } from 'styled-components';
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 = void 0;
8
+ var _propTypes = _interopRequireDefault(require("prop-types"));
9
+ var _styledComponents = require("styled-components");
3
10
  function isEmpty(obj) {
4
11
  return obj === undefined || obj === null || Object.keys(obj).length === 0;
5
12
  }
6
- const GlobalStyles = createGlobalStyle(props => {
13
+ const GlobalStyles = (0, _styledComponents.createGlobalStyle)(props => {
7
14
  const {
8
15
  styles,
9
16
  defaultTheme = {}
@@ -13,8 +20,8 @@ const GlobalStyles = createGlobalStyle(props => {
13
20
  }
14
21
  return styles;
15
22
  });
16
- export default GlobalStyles;
23
+ var _default = exports.default = GlobalStyles;
17
24
  GlobalStyles.propTypes = {
18
- defaultTheme: PropTypes.object,
19
- styles: PropTypes.oneOfType([PropTypes.array, PropTypes.string, PropTypes.object, PropTypes.func])
25
+ defaultTheme: _propTypes.default.object,
26
+ styles: _propTypes.default.oneOfType([_propTypes.default.array, _propTypes.default.string, _propTypes.default.object, _propTypes.default.func])
20
27
  };
@@ -1 +1,13 @@
1
- export { default } from "./GlobalStyles.js";
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 _GlobalStyles.default;
11
+ }
12
+ });
13
+ var _GlobalStyles = _interopRequireDefault(require("./GlobalStyles"));
package/README.md CHANGED
@@ -5,6 +5,6 @@ It's designed for developers who would like to use `styled-components` as the ma
5
5
 
6
6
  ## Documentation
7
7
 
8
- <!-- #default-branch-switch -->
8
+ <!-- #host-reference -->
9
9
 
10
- Visit [https://mui.com/material-ui/integrations/styled-components/](https://mui.com/material-ui/integrations/styled-components/) to view the full documentation.
10
+ Visit [https://next.mui.com/material-ui/integrations/styled-components/](https://next.mui.com/material-ui/integrations/styled-components/) to view the full documentation.
@@ -1,5 +1,12 @@
1
- import PropTypes from 'prop-types';
2
- export default function StyledEngineProvider(props) {
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 = StyledEngineProvider;
8
+ var _propTypes = _interopRequireDefault(require("prop-types"));
9
+ function StyledEngineProvider(props) {
3
10
  const {
4
11
  injectFirst,
5
12
  children
@@ -18,11 +25,11 @@ StyledEngineProvider.propTypes = {
18
25
  /**
19
26
  * Your component tree.
20
27
  */
21
- children: PropTypes.node,
28
+ children: _propTypes.default.node,
22
29
  /**
23
30
  * By default, the styles are injected last in the <head> element of the page.
24
31
  * As a result, they gain more specificity than any other style sheet.
25
32
  * If you want to override MUI's styles, set this prop.
26
33
  */
27
- injectFirst: PropTypes.bool
34
+ injectFirst: _propTypes.default.bool
28
35
  };
@@ -1 +1,13 @@
1
- export { default } from "./StyledEngineProvider.js";
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 _StyledEngineProvider.default;
11
+ }
12
+ });
13
+ var _StyledEngineProvider = _interopRequireDefault(require("./StyledEngineProvider"));
@@ -0,0 +1,20 @@
1
+ import PropTypes from 'prop-types';
2
+ import { createGlobalStyle } from 'styled-components';
3
+ function isEmpty(obj) {
4
+ return obj === undefined || obj === null || Object.keys(obj).length === 0;
5
+ }
6
+ const GlobalStyles = createGlobalStyle(props => {
7
+ const {
8
+ styles,
9
+ defaultTheme = {}
10
+ } = props;
11
+ if (typeof styles === 'function') {
12
+ return styles(isEmpty(props.theme) ? defaultTheme : props.theme);
13
+ }
14
+ return styles;
15
+ });
16
+ export default GlobalStyles;
17
+ GlobalStyles.propTypes = {
18
+ defaultTheme: PropTypes.object,
19
+ styles: PropTypes.oneOfType([PropTypes.array, PropTypes.string, PropTypes.object, PropTypes.func])
20
+ };
@@ -0,0 +1 @@
1
+ export { default } from "./GlobalStyles.js";
@@ -1,12 +1,5 @@
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 = StyledEngineProvider;
8
- var _propTypes = _interopRequireDefault(require("prop-types"));
9
- function StyledEngineProvider(props) {
1
+ import PropTypes from 'prop-types';
2
+ export default function StyledEngineProvider(props) {
10
3
  const {
11
4
  injectFirst,
12
5
  children
@@ -25,11 +18,11 @@ StyledEngineProvider.propTypes = {
25
18
  /**
26
19
  * Your component tree.
27
20
  */
28
- children: _propTypes.default.node,
21
+ children: PropTypes.node,
29
22
  /**
30
23
  * By default, the styles are injected last in the <head> element of the page.
31
24
  * As a result, they gain more specificity than any other style sheet.
32
25
  * If you want to override MUI's styles, set this prop.
33
26
  */
34
- injectFirst: _propTypes.default.bool
27
+ injectFirst: PropTypes.bool
35
28
  };
@@ -0,0 +1 @@
1
+ export { default } from "./StyledEngineProvider.js";
@@ -1,63 +1,20 @@
1
1
  /**
2
- * @mui/styled-engine-sc v6.4.3
2
+ * @mui/styled-engine-sc v7.0.0-alpha.1
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
6
6
  * LICENSE file in the root directory of this source tree.
7
7
  */
8
- "use strict";
9
-
10
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
11
- var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
12
- Object.defineProperty(exports, "__esModule", {
13
- value: true
14
- });
15
- Object.defineProperty(exports, "GlobalStyles", {
16
- enumerable: true,
17
- get: function () {
18
- return _GlobalStyles.default;
19
- }
20
- });
21
- Object.defineProperty(exports, "StyledEngineProvider", {
22
- enumerable: true,
23
- get: function () {
24
- return _StyledEngineProvider.default;
25
- }
26
- });
27
- Object.defineProperty(exports, "ThemeContext", {
28
- enumerable: true,
29
- get: function () {
30
- return _styledComponents.ThemeContext;
31
- }
32
- });
33
- Object.defineProperty(exports, "css", {
34
- enumerable: true,
35
- get: function () {
36
- return _styledComponents.css;
37
- }
38
- });
39
- exports.default = styled;
40
- exports.internal_mutateStyles = internal_mutateStyles;
41
- exports.internal_processStyles = internal_processStyles;
42
- exports.internal_serializeStyles = internal_serializeStyles;
43
- Object.defineProperty(exports, "keyframes", {
44
- enumerable: true,
45
- get: function () {
46
- return _styledComponents.keyframes;
47
- }
48
- });
49
- var _styledComponents = _interopRequireWildcard(require("styled-components"));
50
- var _StyledEngineProvider = _interopRequireDefault(require("./StyledEngineProvider"));
51
- var _GlobalStyles = _interopRequireDefault(require("./GlobalStyles"));
52
- function styled(tag, options) {
8
+ import scStyled from 'styled-components';
9
+ export default function styled(tag, options) {
53
10
  let stylesFactory;
54
11
  if (options) {
55
- stylesFactory = (0, _styledComponents.default)(tag).withConfig({
12
+ stylesFactory = scStyled(tag).withConfig({
56
13
  displayName: options.label,
57
14
  shouldForwardProp: options.shouldForwardProp
58
15
  });
59
16
  } else {
60
- stylesFactory = (0, _styledComponents.default)(tag);
17
+ stylesFactory = scStyled(tag);
61
18
  }
62
19
  if (process.env.NODE_ENV !== 'production') {
63
20
  const fn = (...styles) => {
@@ -76,7 +33,7 @@ function styled(tag, options) {
76
33
  }
77
34
 
78
35
  // eslint-disable-next-line @typescript-eslint/naming-convention
79
- function internal_mutateStyles(tag, processor) {
36
+ export function internal_mutateStyles(tag, processor) {
80
37
  // Styled-components attaches an instance to `componentStyle`.
81
38
  // https://github.com/styled-components/styled-components/blob/da8151762dcf72735ffba358173d4c097f6d5888/packages/styled-components/src/models/StyledComponent.ts#L257
82
39
  //
@@ -90,11 +47,14 @@ function internal_mutateStyles(tag, processor) {
90
47
  // Not needed anymore, but fixes https://github.com/mui/material-ui/issues/44112
91
48
  // TODO: Remove it in v7
92
49
  // eslint-disable-next-line @typescript-eslint/naming-convention
93
- function internal_processStyles(tag, processor) {
50
+ export function internal_processStyles(tag, processor) {
94
51
  return internal_mutateStyles(tag, processor);
95
52
  }
96
53
 
97
54
  // eslint-disable-next-line @typescript-eslint/naming-convention
98
- function internal_serializeStyles(styles) {
55
+ export function internal_serializeStyles(styles) {
99
56
  return styles;
100
- }
57
+ }
58
+ export { ThemeContext, keyframes, css } from 'styled-components';
59
+ export { default as StyledEngineProvider } from "./StyledEngineProvider/index.js";
60
+ export { default as GlobalStyles } from "./GlobalStyles/index.js";
@@ -0,0 +1 @@
1
+ {"type":"module","sideEffects":false}
package/index.js CHANGED
@@ -1,20 +1,63 @@
1
1
  /**
2
- * @mui/styled-engine-sc v6.4.3
2
+ * @mui/styled-engine-sc v7.0.0-alpha.1
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
6
6
  * LICENSE file in the root directory of this source tree.
7
7
  */
8
- import scStyled from 'styled-components';
9
- export default function styled(tag, options) {
8
+ "use strict";
9
+
10
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
11
+ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
12
+ Object.defineProperty(exports, "__esModule", {
13
+ value: true
14
+ });
15
+ Object.defineProperty(exports, "GlobalStyles", {
16
+ enumerable: true,
17
+ get: function () {
18
+ return _GlobalStyles.default;
19
+ }
20
+ });
21
+ Object.defineProperty(exports, "StyledEngineProvider", {
22
+ enumerable: true,
23
+ get: function () {
24
+ return _StyledEngineProvider.default;
25
+ }
26
+ });
27
+ Object.defineProperty(exports, "ThemeContext", {
28
+ enumerable: true,
29
+ get: function () {
30
+ return _styledComponents.ThemeContext;
31
+ }
32
+ });
33
+ Object.defineProperty(exports, "css", {
34
+ enumerable: true,
35
+ get: function () {
36
+ return _styledComponents.css;
37
+ }
38
+ });
39
+ exports.default = styled;
40
+ exports.internal_mutateStyles = internal_mutateStyles;
41
+ exports.internal_processStyles = internal_processStyles;
42
+ exports.internal_serializeStyles = internal_serializeStyles;
43
+ Object.defineProperty(exports, "keyframes", {
44
+ enumerable: true,
45
+ get: function () {
46
+ return _styledComponents.keyframes;
47
+ }
48
+ });
49
+ var _styledComponents = _interopRequireWildcard(require("styled-components"));
50
+ var _StyledEngineProvider = _interopRequireDefault(require("./StyledEngineProvider"));
51
+ var _GlobalStyles = _interopRequireDefault(require("./GlobalStyles"));
52
+ function styled(tag, options) {
10
53
  let stylesFactory;
11
54
  if (options) {
12
- stylesFactory = scStyled(tag).withConfig({
55
+ stylesFactory = (0, _styledComponents.default)(tag).withConfig({
13
56
  displayName: options.label,
14
57
  shouldForwardProp: options.shouldForwardProp
15
58
  });
16
59
  } else {
17
- stylesFactory = scStyled(tag);
60
+ stylesFactory = (0, _styledComponents.default)(tag);
18
61
  }
19
62
  if (process.env.NODE_ENV !== 'production') {
20
63
  const fn = (...styles) => {
@@ -33,7 +76,7 @@ export default function styled(tag, options) {
33
76
  }
34
77
 
35
78
  // eslint-disable-next-line @typescript-eslint/naming-convention
36
- export function internal_mutateStyles(tag, processor) {
79
+ function internal_mutateStyles(tag, processor) {
37
80
  // Styled-components attaches an instance to `componentStyle`.
38
81
  // https://github.com/styled-components/styled-components/blob/da8151762dcf72735ffba358173d4c097f6d5888/packages/styled-components/src/models/StyledComponent.ts#L257
39
82
  //
@@ -47,14 +90,11 @@ export function internal_mutateStyles(tag, processor) {
47
90
  // Not needed anymore, but fixes https://github.com/mui/material-ui/issues/44112
48
91
  // TODO: Remove it in v7
49
92
  // eslint-disable-next-line @typescript-eslint/naming-convention
50
- export function internal_processStyles(tag, processor) {
93
+ function internal_processStyles(tag, processor) {
51
94
  return internal_mutateStyles(tag, processor);
52
95
  }
53
96
 
54
97
  // eslint-disable-next-line @typescript-eslint/naming-convention
55
- export function internal_serializeStyles(styles) {
98
+ function internal_serializeStyles(styles) {
56
99
  return styles;
57
- }
58
- export { ThemeContext, keyframes, css } from 'styled-components';
59
- export { default as StyledEngineProvider } from "./StyledEngineProvider/index.js";
60
- export { default as GlobalStyles } from "./GlobalStyles/index.js";
100
+ }
package/modern/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/styled-engine-sc v6.4.3
2
+ * @mui/styled-engine-sc v7.0.0-alpha.1
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -0,0 +1 @@
1
+ {"type":"module","sideEffects":false}
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@mui/styled-engine-sc",
3
- "version": "6.4.3",
3
+ "version": "7.0.0-alpha.1",
4
4
  "private": false,
5
5
  "author": "MUI Team",
6
6
  "description": "styled() API wrapper package for styled-components.",
7
- "main": "./node/index.js",
7
+ "main": "./index.js",
8
8
  "keywords": [
9
9
  "react",
10
10
  "react-component",
@@ -26,7 +26,7 @@
26
26
  "url": "https://opencollective.com/mui-org"
27
27
  },
28
28
  "dependencies": {
29
- "@babel/runtime": "^7.26.0",
29
+ "@babel/runtime": "^7.26.7",
30
30
  "@types/hoist-non-react-statics": "^3.3.6",
31
31
  "csstype": "^3.1.3",
32
32
  "hoist-non-react-statics": "^3.3.2",
@@ -43,6 +43,35 @@
43
43
  "engines": {
44
44
  "node": ">=14.0.0"
45
45
  },
46
- "module": "./index.js",
47
- "types": "./index.d.ts"
46
+ "module": "./esm/index.js",
47
+ "exports": {
48
+ ".": {
49
+ "require": {
50
+ "types": "./index.d.ts",
51
+ "default": "./index.js"
52
+ },
53
+ "import": {
54
+ "types": "./esm/index.d.ts",
55
+ "default": "./esm/index.js"
56
+ },
57
+ "mui-modern": {
58
+ "types": "./modern/index.d.ts",
59
+ "default": "./modern/index.js"
60
+ }
61
+ },
62
+ "./*": {
63
+ "require": {
64
+ "types": "./*/index.d.ts",
65
+ "default": "./*/index.js"
66
+ },
67
+ "import": {
68
+ "types": "./esm/*/index.d.ts",
69
+ "default": "./esm/*/index.js"
70
+ },
71
+ "mui-modern": {
72
+ "types": "./modern/*/index.d.ts",
73
+ "default": "./modern/*/index.js"
74
+ }
75
+ }
76
+ }
48
77
  }
@@ -1,11 +0,0 @@
1
- import * as React from 'react';
2
- import { CSSObject, StyleFunction } from 'styled-components';
3
-
4
- export interface GlobalStylesProps<Theme extends object = {}> {
5
- defaultTheme?: object;
6
- styles: string | CSSObject | StyleFunction<Theme>;
7
- }
8
-
9
- export default function Global<Theme extends object = {}>(
10
- props: GlobalStylesProps<Theme>,
11
- ): React.JSX.Element;
@@ -1,2 +0,0 @@
1
- export { default } from './GlobalStyles';
2
- export * from './GlobalStyles';
@@ -1,6 +0,0 @@
1
- {
2
- "sideEffects": false,
3
- "module": "./index.js",
4
- "main": "../node/GlobalStyles/index.js",
5
- "types": "./index.d.ts"
6
- }
@@ -1,8 +0,0 @@
1
- import * as React from 'react';
2
-
3
- export interface StyledEngineProviderProps {
4
- children?: React.ReactNode;
5
- injectFirst?: boolean;
6
- }
7
-
8
- export default function StyledEngineProvider(props: StyledEngineProviderProps): React.JSX.Element;
@@ -1,2 +0,0 @@
1
- export { default } from './StyledEngineProvider';
2
- export * from './StyledEngineProvider';
@@ -1,6 +0,0 @@
1
- {
2
- "sideEffects": false,
3
- "module": "./index.js",
4
- "main": "../node/StyledEngineProvider/index.js",
5
- "types": "./index.d.ts"
6
- }