@mui/utils 6.1.0 → 6.1.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,68 @@
1
1
  # [Versions](https://mui.com/versions/)
2
2
 
3
+ ## v6.1.1
4
+
5
+ <!-- generated comparing v6.1.0..master -->
6
+
7
+ _Sep 19, 2024_
8
+
9
+ A big thanks to the 18 contributors who made this release possible.
10
+
11
+ ### `@mui/material@6.1.1`
12
+
13
+ - [Grid] Bring back `GridProps` and `GridTypeMap` (#43717) @DiegoAndai
14
+ - [Paper] Fix wrong background-image on Paper when elevation is 0 (#43723) @ZeeshanTamboli
15
+ - [Skeleton] Fix wave animation for styled-components (#43740) @siriwatknp
16
+ - [Modal] Fix event handlers overriding behavior (#43757) @sai6855
17
+
18
+ ### `@mui/system@6.1.1`
19
+
20
+ - Pass the stylesheet directly to `GlobalStyles` (#43739) @siriwatknp
21
+
22
+ ### `@mui/utils@6.1.1`
23
+
24
+ - Fix "useId" & "useSyncExternalStore" imports to not be statically analyzable (#43360) @yash49
25
+
26
+ ### Docs
27
+
28
+ - [material-ui][Breadcrumbs] Document CondensedWithMenu option for Breadcrumbs (#42973) @Sergio16T
29
+ - [material-ui][CircularProgress] Add Circular size demo (#43734) @sai6855
30
+ - [material-ui][slider] Fix slider in color customization playground twitches when sliding (#43671) @Nashyn
31
+ - [material-ui][slider] Polish Music player demo (#43748) @oliviertassinari
32
+ - [material-ui] Document Typography color prop breaking change (#43735) @aarongarciah
33
+ - [material-ui] Add docs for complementary Table components (#43756) @Juneezee
34
+ - [material-ui] Improve minimizing bundle docs (#43781) @ZeeshanTamboli
35
+ - [pigment-css] Call out Pigment being in alpha (#43725) @aarongarciah
36
+ - [pigment-css] Fix typo globalCSS -> globalCss (#43754) @hiro0218
37
+ - [test] Improve demos for better regression screenshots (#43742) @aarongarciah
38
+ - Fix minor typo (#42899) @xconverge
39
+ - Revert icon search virtualization (#43569) @Janpot
40
+ - Fix MUI Treasury Layout broken links (#43752) @oliviertassinari
41
+ - Fix 301 link to design asset @oliviertassinari
42
+ - Update release schedule table after v6 stable (#43726) @sahil-ag
43
+ - Fix bundle size link regression @oliviertassinari
44
+
45
+ ### Core
46
+
47
+ - [code-infra] Allow overriding all `options` of `useFakeTimers` function (#43729) @LukasTy
48
+ - [core] Fix 301 link to Next.js and git diff @oliviertassinari
49
+ - [core] Fix package.json repository rule @oliviertassinari
50
+ - [core] Remove redundant window @oliviertassinari
51
+ - [core] Fix some issues reported by eslint-plugin-react-compiler (#43117) @binsmyth
52
+ - [core] Replace more `indexOf` with `includes` (#43694) @Juneezee
53
+ - [core] Remove /.yarn (#43712) @oliviertassinari
54
+ - [docs-infra] Enable synthetic default imports in TypeScript config (#43747) @morozow
55
+ - [docs-infra] Fix Vale config for TypeScript references (#43751) @oliviertassinari
56
+ - [docs-infra] Fix toolbar arrow order (#43627) @oliviertassinari
57
+ - [docs-infra] Fix missing dependencies in multi-tab demos (#43713) @cherniavskii
58
+ - [docs-infra] Fix API search link regression (#43662) @oliviertassinari
59
+ - [test] Update font-awesome CSS file in regression tests fixture (#43745) @Janpot
60
+ - [test] Remove position:relative from regression container (#43743) @aarongarciah
61
+ - [test] Remove top-level inline-block from the regression tests (#43656) @Janpot
62
+ - [website] Match pricing page with linked page h1 @oliviertassinari
63
+
64
+ All contributors of this release in alphabetical order: @aarongarciah, @binsmyth, @cherniavskii, @DiegoAndai, @Janpot, @Juneezee, @LukasTy, @mnajdova, @morozow, @Nashyn, @oliviertassinari, @sahil-ag, @sai6855, @Sergio16T, @siriwatknp, @xconverge, @yash49, @ZeeshanTamboli
65
+
3
66
  ## v6.1.0
4
67
 
5
68
  <!-- generated comparing v6.0.2..master -->
@@ -2,6 +2,8 @@
2
2
 
3
3
  import * as React from 'react';
4
4
  let globalId = 0;
5
+
6
+ // TODO React 17: Remove `useGlobalId` once React 17 support is removed
5
7
  function useGlobalId(idOverride) {
6
8
  const [defaultId, setDefaultId] = React.useState(idOverride);
7
9
  const id = idOverride || defaultId;
@@ -18,8 +20,12 @@ function useGlobalId(idOverride) {
18
20
  return id;
19
21
  }
20
22
 
21
- // downstream bundlers may remove unnecessary concatenation, but won't remove toString call -- Workaround for https://github.com/webpack/webpack/issues/14814
22
- const maybeReactUseId = React['useId'.toString()];
23
+ // See https://github.com/mui/material-ui/issues/41190#issuecomment-2040873379 for why
24
+ const safeReact = {
25
+ ...React
26
+ };
27
+ const maybeReactUseId = safeReact.useId;
28
+
23
29
  /**
24
30
  *
25
31
  * @example <div id={useId()} />
@@ -27,10 +33,12 @@ const maybeReactUseId = React['useId'.toString()];
27
33
  * @returns {string}
28
34
  */
29
35
  export default function useId(idOverride) {
36
+ // React.useId() is only available from React 17.0.0.
30
37
  if (maybeReactUseId !== undefined) {
31
38
  const reactId = maybeReactUseId();
32
39
  return idOverride ?? reactId;
33
40
  }
41
+
34
42
  // TODO: uncomment once we enable eslint-plugin-react-compiler // eslint-disable-next-line react-compiler/react-compiler
35
43
  // eslint-disable-next-line react-hooks/rules-of-hooks -- `React.useId` is invariant at runtime.
36
44
  return useGlobalId(idOverride);
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/utils v6.1.0
2
+ * @mui/utils v6.1.1
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
package/modern/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/utils v6.1.0
2
+ * @mui/utils v6.1.1
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -2,6 +2,8 @@
2
2
 
3
3
  import * as React from 'react';
4
4
  let globalId = 0;
5
+
6
+ // TODO React 17: Remove `useGlobalId` once React 17 support is removed
5
7
  function useGlobalId(idOverride) {
6
8
  const [defaultId, setDefaultId] = React.useState(idOverride);
7
9
  const id = idOverride || defaultId;
@@ -18,8 +20,12 @@ function useGlobalId(idOverride) {
18
20
  return id;
19
21
  }
20
22
 
21
- // downstream bundlers may remove unnecessary concatenation, but won't remove toString call -- Workaround for https://github.com/webpack/webpack/issues/14814
22
- const maybeReactUseId = React['useId'.toString()];
23
+ // See https://github.com/mui/material-ui/issues/41190#issuecomment-2040873379 for why
24
+ const safeReact = {
25
+ ...React
26
+ };
27
+ const maybeReactUseId = safeReact.useId;
28
+
23
29
  /**
24
30
  *
25
31
  * @example <div id={useId()} />
@@ -27,10 +33,12 @@ const maybeReactUseId = React['useId'.toString()];
27
33
  * @returns {string}
28
34
  */
29
35
  export default function useId(idOverride) {
36
+ // React.useId() is only available from React 17.0.0.
30
37
  if (maybeReactUseId !== undefined) {
31
38
  const reactId = maybeReactUseId();
32
39
  return idOverride ?? reactId;
33
40
  }
41
+
34
42
  // TODO: uncomment once we enable eslint-plugin-react-compiler // eslint-disable-next-line react-compiler/react-compiler
35
43
  // eslint-disable-next-line react-hooks/rules-of-hooks -- `React.useId` is invariant at runtime.
36
44
  return useGlobalId(idOverride);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/utils",
3
- "version": "6.1.0",
3
+ "version": "6.1.1",
4
4
  "private": false,
5
5
  "author": "MUI Team",
6
6
  "description": "Utility functions for React components.",
@@ -13,7 +13,7 @@
13
13
  ],
14
14
  "repository": {
15
15
  "type": "git",
16
- "url": "https://github.com/mui/material-ui.git",
16
+ "url": "git+https://github.com/mui/material-ui.git",
17
17
  "directory": "packages/mui-utils"
18
18
  },
19
19
  "license": "MIT",
@@ -31,7 +31,7 @@
31
31
  "clsx": "^2.1.1",
32
32
  "prop-types": "^15.8.1",
33
33
  "react-is": "^18.3.1",
34
- "@mui/types": "^7.2.16"
34
+ "@mui/types": "^7.2.17"
35
35
  },
36
36
  "peerDependencies": {
37
37
  "@types/react": "^17.0.0 || ^18.0.0 || ^19.0.0",
package/useId/useId.js CHANGED
@@ -8,6 +8,8 @@ Object.defineProperty(exports, "__esModule", {
8
8
  exports.default = useId;
9
9
  var React = _interopRequireWildcard(require("react"));
10
10
  let globalId = 0;
11
+
12
+ // TODO React 17: Remove `useGlobalId` once React 17 support is removed
11
13
  function useGlobalId(idOverride) {
12
14
  const [defaultId, setDefaultId] = React.useState(idOverride);
13
15
  const id = idOverride || defaultId;
@@ -24,8 +26,12 @@ function useGlobalId(idOverride) {
24
26
  return id;
25
27
  }
26
28
 
27
- // downstream bundlers may remove unnecessary concatenation, but won't remove toString call -- Workaround for https://github.com/webpack/webpack/issues/14814
28
- const maybeReactUseId = React['useId'.toString()];
29
+ // See https://github.com/mui/material-ui/issues/41190#issuecomment-2040873379 for why
30
+ const safeReact = {
31
+ ...React
32
+ };
33
+ const maybeReactUseId = safeReact.useId;
34
+
29
35
  /**
30
36
  *
31
37
  * @example <div id={useId()} />
@@ -33,10 +39,12 @@ const maybeReactUseId = React['useId'.toString()];
33
39
  * @returns {string}
34
40
  */
35
41
  function useId(idOverride) {
42
+ // React.useId() is only available from React 17.0.0.
36
43
  if (maybeReactUseId !== undefined) {
37
44
  const reactId = maybeReactUseId();
38
45
  return idOverride ?? reactId;
39
46
  }
47
+
40
48
  // TODO: uncomment once we enable eslint-plugin-react-compiler // eslint-disable-next-line react-compiler/react-compiler
41
49
  // eslint-disable-next-line react-hooks/rules-of-hooks -- `React.useId` is invariant at runtime.
42
50
  return useGlobalId(idOverride);