@mui/styled-engine-sc 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.
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 -->
@@ -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
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 v7.0.0-alpha.0
2
+ * @mui/styled-engine-sc v7.0.0-alpha.2
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 v7.0.0-alpha.0
2
+ * @mui/styled-engine-sc v7.0.0-alpha.2
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 v7.0.0-alpha.0
2
+ * @mui/styled-engine-sc v7.0.0-alpha.2
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": "7.0.0-alpha.0",
3
+ "version": "7.0.0-alpha.2",
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.7",
29
+ "@babel/runtime": "^7.26.9",
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,37 @@
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
+ "./esm": null,
77
+ "./modern": null
78
+ }
48
79
  }
@@ -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
- }
package/index.d.ts DELETED
@@ -1,408 +0,0 @@
1
- import * as React from 'react';
2
- import * as CSS from 'csstype';
3
- import * as hoistNonReactStatics from 'hoist-non-react-statics';
4
-
5
- type WithOptionalTheme<P extends { theme?: T | undefined }, T> = OmitU<P, 'theme'> & {
6
- theme?: T | undefined;
7
- };
8
-
9
- // Helper type operators
10
- // Pick that distributes over union types
11
- export type PickU<T, K extends keyof T> = T extends any ? { [P in K]: T[P] } : never;
12
- export type OmitU<T, K extends keyof T> = T extends any ? PickU<T, Exclude<keyof T, K>> : never;
13
-
14
- // Any prop that has a default prop becomes optional, but its type is unchanged
15
- // Undeclared default props are augmented into the resulting allowable attributes
16
- // If declared props have indexed properties, ignore default props entirely as keyof gets widened
17
- // Wrap in an outer-level conditional type to allow distribution over props that are unions
18
- type Defaultize<P, D> = P extends any
19
- ? string extends keyof P
20
- ? P
21
- : PickU<P, Exclude<keyof P, keyof D>> &
22
- Partial<PickU<P, Extract<keyof P, keyof D>>> &
23
- Partial<PickU<D, Exclude<keyof D, keyof P>>>
24
- : never;
25
-
26
- export type IntrinsicElementsKeys = keyof React.JSX.IntrinsicElements;
27
- type ReactDefaultizedProps<C, P> = C extends { defaultProps: infer D } ? Defaultize<P, D> : P;
28
-
29
- type MakeAttrsOptional<
30
- C extends string | React.ComponentType<any>,
31
- O extends object,
32
- A extends keyof P,
33
- P = React.ComponentPropsWithRef<
34
- C extends IntrinsicElementsKeys | React.ComponentType<any> ? C : never
35
- >,
36
- > =
37
- // Distribute unions early to avoid quadratic expansion
38
- P extends any ? OmitU<ReactDefaultizedProps<C, P> & O, A> & Partial<PickU<P & O, A>> : never;
39
-
40
- export type StyledComponentProps<
41
- // The Component from whose props are derived
42
- C extends string | React.ComponentType<any>,
43
- // The Theme from the current context
44
- T extends object,
45
- // The other props added by the template
46
- O extends object,
47
- // The props that are made optional by .attrs
48
- A extends keyof any,
49
- // The Component passed with "forwardedAs" prop
50
- FAsC extends string | React.ComponentType<any> = C,
51
- > =
52
- // Distribute O if O is a union type
53
- O extends object
54
- ? WithOptionalTheme<MakeAttrsOptional<C, O, A> & MakeAttrsOptional<FAsC, O, A>, T>
55
- : never;
56
-
57
- export interface ThemeProps<T> {
58
- theme: T;
59
- }
60
-
61
- export type ThemedStyledProps<P, T> = P & ThemeProps<T>;
62
-
63
- export interface Keyframes {
64
- getName(): string;
65
- }
66
-
67
- export * from 'styled-components';
68
- export { default } from 'styled-components';
69
-
70
- export { default as StyledEngineProvider } from './StyledEngineProvider';
71
-
72
- export { default as GlobalStyles } from './GlobalStyles';
73
- export * from './GlobalStyles';
74
-
75
- /**
76
- * For internal usage in `@mui/system` package
77
- */
78
- // eslint-disable-next-line @typescript-eslint/naming-convention
79
- export function internal_mutateStyles(
80
- tag: React.ElementType,
81
- processor: (styles: any) => any,
82
- ): void;
83
-
84
- // Not needed anymore, but fixes https://github.com/mui/material-ui/issues/44112
85
- // TODO: Remove it in v7
86
- // eslint-disable-next-line @typescript-eslint/naming-convention
87
- export function internal_processStyles(
88
- tag: React.ElementType,
89
- processor: (styles: any) => any,
90
- ): void;
91
-
92
- // eslint-disable-next-line @typescript-eslint/naming-convention
93
- export function internal_serializeStyles<P>(styles: Interpolation<P>): object;
94
-
95
- // These are the same as the ones in @mui/styled-engine
96
- // CSS.PropertiesFallback are necessary so that we support spreading of the mixins. For example:
97
- // '@font-face'?: Fontface | Fontface[]
98
- export type CSSProperties = CSS.PropertiesFallback<number | string>;
99
- export type CSSPropertiesWithMultiValues = {
100
- [K in keyof CSSProperties]: CSSProperties[K] | Array<Extract<CSSProperties[K], string>>;
101
- };
102
- export type CSSPseudos = { [K in CSS.Pseudos]?: unknown | CSSObject };
103
-
104
- export interface CSSOthersObject {
105
- [propertiesName: string]: unknown | CSSInterpolation;
106
- }
107
- export type CSSPseudosForCSSObject = { [K in CSS.Pseudos]?: CSSObject };
108
-
109
- export interface ArrayCSSInterpolation extends Array<CSSInterpolation> {}
110
-
111
- export interface CSSOthersObjectForCSSObject {
112
- [propertiesName: string]: CSSInterpolation;
113
- }
114
-
115
- // Omit variants as a key, because we have a special handling for it
116
- export interface CSSObject
117
- extends CSSPropertiesWithMultiValues,
118
- CSSPseudos,
119
- Omit<CSSOthersObject, 'variants'> {}
120
-
121
- interface CSSObjectWithVariants<Props> extends Omit<CSSObject, 'variants'> {
122
- variants: Array<{
123
- props: Props | ((props: Props) => boolean);
124
- style:
125
- | CSSObject
126
- | ((args: Props extends { theme: any } ? { theme: Props['theme'] } : any) => CSSObject);
127
- }>;
128
- }
129
-
130
- export type FalseyValue = undefined | null | false;
131
- export type Interpolation<P> =
132
- | InterpolationValue
133
- | CSSObjectWithVariants<P>
134
- | InterpolationFunction<P>
135
- | FlattenInterpolation<P>;
136
- // cannot be made a self-referential interface, breaks WithPropNested
137
- // see https://github.com/microsoft/TypeScript/issues/34796
138
- export type FlattenInterpolation<P> = ReadonlyArray<Interpolation<P>>;
139
- export type InterpolationValue =
140
- | string
141
- | number
142
- | FalseyValue
143
- | Keyframes
144
- | StyledComponentInterpolation
145
- | CSSObject;
146
- export type SimpleInterpolation = InterpolationValue | FlattenSimpleInterpolation;
147
- // adapter for compatibility with @mui/styled-engine
148
- export type CSSInterpolation = SimpleInterpolation;
149
- export type FlattenSimpleInterpolation = ReadonlyArray<SimpleInterpolation>;
150
-
151
- export type InterpolationFunction<P> = (props: P) => Interpolation<P>;
152
-
153
- // abuse Pick to strip the call signature from ForwardRefExoticComponent
154
- type ForwardRefExoticBase<P> = PickU<
155
- React.ForwardRefExoticComponent<P>,
156
- keyof React.ForwardRefExoticComponent<any>
157
- >;
158
-
159
- type StyledComponentPropsWithAs<
160
- C extends string | React.ComponentType<any>,
161
- T extends object,
162
- O extends object,
163
- A extends keyof any,
164
- AsC extends string | React.ComponentType<any> = C,
165
- FAsC extends string | React.ComponentType<any> = C,
166
- > = StyledComponentProps<C, T, O, A, FAsC> & {
167
- as?: AsC | undefined;
168
- forwardedAs?: FAsC | undefined;
169
- };
170
-
171
- export type StyledComponent<
172
- C extends keyof React.JSX.IntrinsicElements | React.ComponentType<any>,
173
- T extends object = {},
174
- O extends object = {},
175
- A extends keyof any = never,
176
- > = // the "string" allows this to be used as an object key
177
- // I really want to avoid this if possible but it's the only way to use nesting with object styles...
178
- string &
179
- StyledComponentBase<C, T, O, A> &
180
- hoistNonReactStatics.NonReactStatics<C extends React.ComponentType<any> ? C : never>;
181
-
182
- // any doesn't count as assignable to never in the extends clause, and we default A to never
183
- export type AnyStyledComponent =
184
- | StyledComponent<any, any, any, any>
185
- | StyledComponent<any, any, any>
186
- | React.FunctionComponent<any>
187
- | React.ComponentType<any>;
188
-
189
- export type StyledComponentInnerComponent<C extends AnyStyledComponent> =
190
- C extends StyledComponent<infer I, any, any, any>
191
- ? I
192
- : C extends StyledComponent<infer I, any, any>
193
- ? I
194
- : C;
195
-
196
- export type StyledComponentInnerOtherProps<C extends AnyStyledComponent> =
197
- C extends StyledComponent<any, any, infer O, any>
198
- ? O
199
- : C extends StyledComponent<any, any, infer O>
200
- ? O
201
- : never;
202
- export type StyledComponentInnerAttrs<C extends AnyStyledComponent> =
203
- C extends StyledComponent<any, any, any, infer A> ? A : never;
204
-
205
- export interface StyledComponentBase<
206
- C extends string | React.ComponentType<any>,
207
- T extends object,
208
- O extends object = {},
209
- A extends keyof any = never,
210
- > extends ForwardRefExoticBase<StyledComponentProps<C, T, O, A>> {
211
- // add our own fake call signature to implement the polymorphic 'as' prop
212
- (
213
- props: StyledComponentProps<C, T, O, A> & {
214
- as?: never | undefined;
215
- forwardedAs?: never | undefined;
216
- },
217
- ): React.ReactElement<StyledComponentProps<C, T, O, A>>;
218
- <
219
- AsC extends string | React.ComponentType<any> = C,
220
- FAsC extends string | React.ComponentType<any> = AsC,
221
- >(
222
- props: StyledComponentPropsWithAs<AsC, T, O, A, AsC, FAsC>,
223
- ): React.ReactElement<StyledComponentPropsWithAs<AsC, T, O, A, AsC, FAsC>>;
224
-
225
- withComponent<WithC extends AnyStyledComponent>(
226
- component: WithC,
227
- ): StyledComponent<
228
- StyledComponentInnerComponent<WithC>,
229
- T,
230
- O & StyledComponentInnerOtherProps<WithC>,
231
- A | StyledComponentInnerAttrs<WithC>
232
- >;
233
- withComponent<WithC extends keyof React.JSX.IntrinsicElements | React.ComponentType<any>>(
234
- component: WithC,
235
- ): StyledComponent<WithC, T, O, A>;
236
- }
237
-
238
- // remove the call signature from StyledComponent so Interpolation can still infer InterpolationFunction
239
- type StyledComponentInterpolation =
240
- | Pick<StyledComponentBase<any, any, any, any>, keyof StyledComponentBase<any, any>>
241
- | Pick<StyledComponentBase<any, any, any>, keyof StyledComponentBase<any, any>>;
242
-
243
- // These are typings coming from styled-components
244
- // They are adjusted to accept the extended options coming from mui
245
- type AnyIfEmpty<T extends object> = keyof T extends never ? any : T;
246
-
247
- type ThemedStyledComponentFactories<T extends object> = {
248
- [TTag in keyof React.JSX.IntrinsicElements]: ThemedStyledFunctionBase<TTag, T>;
249
- };
250
-
251
- export type StyledComponentPropsWithRef<
252
- C extends keyof React.JSX.IntrinsicElements | React.ComponentType<any>,
253
- > = C extends AnyStyledComponent
254
- ? React.ComponentPropsWithRef<StyledComponentInnerComponent<C>>
255
- : React.ComponentPropsWithRef<C>;
256
-
257
- // Same as in styled-components, but copied here so that it would use the Interpolation & CSS typings from above
258
- export interface ThemedStyledFunctionBase<
259
- C extends keyof React.JSX.IntrinsicElements | React.ComponentType<any>,
260
- T extends object,
261
- O extends object = {},
262
- A extends keyof any = never,
263
- > {
264
- (first: TemplateStringsArray): StyledComponent<C, T, O, A>;
265
- (
266
- first:
267
- | TemplateStringsArray
268
- | CSSObject
269
- | InterpolationFunction<ThemedStyledProps<StyledComponentPropsWithRef<C> & O, T>>,
270
- ...other: Array<Interpolation<ThemedStyledProps<StyledComponentPropsWithRef<C> & O, T>>>
271
- ): StyledComponent<C, T, O, A>;
272
- <U extends object>(
273
- first:
274
- | TemplateStringsArray
275
- | CSSObject
276
- | InterpolationFunction<ThemedStyledProps<StyledComponentPropsWithRef<C> & O & U, T>>,
277
- ...other: Array<Interpolation<ThemedStyledProps<StyledComponentPropsWithRef<C> & O & U, T>>>
278
- ): StyledComponent<C, T, O & U, A>;
279
- }
280
-
281
- // same as ThemedStyledFunction in styled-components, but without attrs, and withConfig
282
- export interface ThemedStyledFunction<
283
- C extends keyof React.JSX.IntrinsicElements | React.ComponentType<any>,
284
- T extends object,
285
- O extends object = {},
286
- A extends keyof any = never,
287
- > extends ThemedStyledFunctionBase<C, T, O, A> {}
288
-
289
- export type CreateStyledComponent<
290
- ComponentProps extends {},
291
- SpecificComponentProps extends {} = {},
292
- JSXProps extends {} = {},
293
- T extends object = {},
294
- > = ThemedStyledFunction<React.ComponentType<ComponentProps>, T, SpecificComponentProps & JSXProps>;
295
-
296
- // Config to be used with withConfig
297
- export interface StyledConfig<O extends object = {}> {
298
- // TODO: Add all types from the original StyledComponentWrapperProperties
299
- componentId?: string;
300
- displayName?: string;
301
- label?: string;
302
- target?: string;
303
- shouldForwardProp?:
304
- | ((prop: keyof O, defaultValidatorFn: (prop: keyof O) => boolean) => boolean)
305
- | undefined;
306
- }
307
-
308
- /** Same as StyledConfig but shouldForwardProp must be a type guard */
309
- export interface FilteringStyledOptions<Props, ForwardedProps extends keyof Props = keyof Props> {
310
- componentId?: string;
311
- displayName?: string;
312
- label?: string;
313
- shouldForwardProp?(propName: PropertyKey): propName is ForwardedProps;
314
- target?: string;
315
- }
316
-
317
- // same as ThemedBaseStyledInterface in styled-components, but with added options & common props for MUI components
318
- export interface ThemedBaseStyledInterface<
319
- MUIStyledCommonProps extends object,
320
- MuiStyledOptions extends object,
321
- Theme extends object,
322
- > extends ThemedStyledComponentFactories<Theme> {
323
- <
324
- C extends React.ComponentClass<React.ComponentProps<C>>,
325
- ForwardedProps extends keyof React.ComponentProps<C> = keyof React.ComponentProps<C>,
326
- >(
327
- component: C,
328
- options: FilteringStyledOptions<React.ComponentProps<C>, ForwardedProps> & MuiStyledOptions,
329
- ): CreateStyledComponent<
330
- Pick<PropsOf<C>, ForwardedProps> & MUIStyledCommonProps,
331
- {},
332
- {
333
- ref?: React.Ref<InstanceType<C>>;
334
- },
335
- Theme
336
- >;
337
-
338
- <C extends React.ComponentClass<React.ComponentProps<C>>>(
339
- component: C,
340
- options?: StyledConfig<PropsOf<C> & MUIStyledCommonProps> & MuiStyledOptions,
341
- ): CreateStyledComponent<
342
- PropsOf<C> & MUIStyledCommonProps,
343
- {},
344
- {
345
- ref?: React.Ref<InstanceType<C>>;
346
- },
347
- Theme
348
- >;
349
-
350
- <
351
- C extends React.JSXElementConstructor<React.ComponentProps<C>>,
352
- ForwardedProps extends keyof React.ComponentProps<C> = keyof React.ComponentProps<C>,
353
- >(
354
- component: C,
355
- options: FilteringStyledOptions<React.ComponentProps<C>, ForwardedProps> & MuiStyledOptions,
356
- ): CreateStyledComponent<Pick<PropsOf<C>, ForwardedProps> & MUIStyledCommonProps, {}, {}, Theme>;
357
-
358
- <C extends React.JSXElementConstructor<React.ComponentProps<C>>>(
359
- component: C,
360
- options?: StyledConfig<PropsOf<C> & MUIStyledCommonProps> & MuiStyledOptions,
361
- ): CreateStyledComponent<PropsOf<C> & MUIStyledCommonProps, {}, {}, Theme>;
362
-
363
- <
364
- Tag extends keyof React.JSX.IntrinsicElements,
365
- ForwardedProps extends
366
- keyof React.JSX.IntrinsicElements[Tag] = keyof React.JSX.IntrinsicElements[Tag],
367
- >(
368
- tag: Tag,
369
- options: FilteringStyledOptions<React.JSX.IntrinsicElements[Tag], ForwardedProps> &
370
- MuiStyledOptions,
371
- ): CreateStyledComponent<
372
- MUIStyledCommonProps,
373
- Pick<React.JSX.IntrinsicElements[Tag], ForwardedProps>,
374
- {},
375
- Theme
376
- >;
377
-
378
- <Tag extends keyof React.JSX.IntrinsicElements>(
379
- tag: Tag,
380
- options?: StyledConfig<MUIStyledCommonProps> & MuiStyledOptions,
381
- ): CreateStyledComponent<MUIStyledCommonProps, React.JSX.IntrinsicElements[Tag], {}, Theme>;
382
- }
383
-
384
- export type CreateMUIStyled<
385
- MUIStyledCommonProps extends object = {},
386
- MuiStyledOptions extends object = {},
387
- T extends object = {},
388
- > = ThemedBaseStyledInterface<MUIStyledCommonProps, MuiStyledOptions, AnyIfEmpty<T>>;
389
-
390
- export type PropsOf<
391
- C extends keyof React.JSX.IntrinsicElements | React.JSXElementConstructor<any>,
392
- > = React.JSX.LibraryManagedAttributes<C, React.ComponentProps<C>>;
393
-
394
- export interface MUIStyledComponent<
395
- ComponentProps extends {},
396
- SpecificComponentProps extends {} = {},
397
- JSXProps extends {} = {},
398
- > extends React.FC<ComponentProps & SpecificComponentProps & JSXProps> {
399
- withComponent<C extends React.ComponentClass<React.ComponentProps<C>>>(
400
- component: C,
401
- ): MUIStyledComponent<ComponentProps & PropsOf<C>, {}, { ref?: React.Ref<InstanceType<C>> }>;
402
- withComponent<C extends React.ComponentType<React.ComponentProps<C>>>(
403
- component: C,
404
- ): MUIStyledComponent<ComponentProps & PropsOf<C>>;
405
- withComponent<Tag extends keyof React.JSX.IntrinsicElements>(
406
- tag: Tag,
407
- ): MUIStyledComponent<ComponentProps, React.JSX.IntrinsicElements[Tag]>;
408
- }
@@ -1,27 +0,0 @@
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");
10
- function isEmpty(obj) {
11
- return obj === undefined || obj === null || Object.keys(obj).length === 0;
12
- }
13
- const GlobalStyles = (0, _styledComponents.createGlobalStyle)(props => {
14
- const {
15
- styles,
16
- defaultTheme = {}
17
- } = props;
18
- if (typeof styles === 'function') {
19
- return styles(isEmpty(props.theme) ? defaultTheme : props.theme);
20
- }
21
- return styles;
22
- });
23
- var _default = exports.default = GlobalStyles;
24
- GlobalStyles.propTypes = {
25
- defaultTheme: _propTypes.default.object,
26
- styles: _propTypes.default.oneOfType([_propTypes.default.array, _propTypes.default.string, _propTypes.default.object, _propTypes.default.func])
27
- };
@@ -1,13 +0,0 @@
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"));
@@ -1,13 +0,0 @@
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"));