@mui/utils 5.2.1 → 5.2.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 +65 -1
- package/esm/useId.js +5 -2
- package/esm/useIsFocusVisible.js +1 -1
- package/index.js +1 -1
- package/legacy/index.js +1 -1
- package/legacy/useId.js +5 -2
- package/legacy/useIsFocusVisible.js +4 -3
- package/modern/index.js +1 -1
- package/modern/useId.js +5 -2
- package/modern/useIsFocusVisible.js +1 -1
- package/package.json +1 -1
- package/useId.js +6 -2
- package/useIsFocusVisible.d.ts +8 -7
- package/useIsFocusVisible.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,69 @@
|
|
|
1
1
|
### [Versions](https://mui.com/versions/)
|
|
2
2
|
|
|
3
|
+
## 5.2.2
|
|
4
|
+
|
|
5
|
+
<!-- generated comparing v5.2.1..master -->
|
|
6
|
+
|
|
7
|
+
_Nov 29, 2021_
|
|
8
|
+
|
|
9
|
+
A big thanks to the 9 contributors who made this release possible. Here are some highlights ✨:
|
|
10
|
+
|
|
11
|
+
- ♿️ Improved accessibility of `Snackbar` and `TextField` in `@mui/material` (#29782) (#29850) (#29852) @eps1lon.
|
|
12
|
+
- 🎉 Added support for `sx` syntax inside `styled()` utility (#29833) @mnajdova.
|
|
13
|
+
- 🎉 Added support for more options for `createCssVarsProvider` in `@mui/system` (#29845) (#29857) @hbjORbj.
|
|
14
|
+
- And many more 🐛 bug fixes and 📚 improvements.
|
|
15
|
+
|
|
16
|
+
### `@mui/material@5.2.2`
|
|
17
|
+
|
|
18
|
+
- ​<!-- 14 -->[MenuList] Add component prop (#29882) @Harshikerfuffle
|
|
19
|
+
- ​<!-- 13 -->[Snackbar] Interrupt auto-hide on keyboard interaction (#29852) @eps1lon
|
|
20
|
+
- ​<!-- 12 -->[Snackbar] Dismiss on Escape press (#29850) @eps1lon
|
|
21
|
+
- ​<!-- 06 -->[TextField] Associate accessible name and description by default (#29782) @eps1lon
|
|
22
|
+
|
|
23
|
+
### `@mui/joy@5.0.0-alpha.4`
|
|
24
|
+
|
|
25
|
+
- ​<!-- 15 -->[Joy] Add `Button` - 1st iteration (#29464) @siriwatknp
|
|
26
|
+
|
|
27
|
+
### `@mui/codemod@5.2.1`
|
|
28
|
+
|
|
29
|
+
- ​<!-- 28 -->[codemod] Fix alias import for box-sx-prop (#29902) @siriwatknp
|
|
30
|
+
|
|
31
|
+
### `@mui/system@5.2.2`
|
|
32
|
+
|
|
33
|
+
- ​<!-- 11 -->[system] CSSVarsProvider cleans up `html[style]` when unmounting (#29946) @eps1lon
|
|
34
|
+
- ​<!-- 10 -->[system] Add support for `disableTransitionOnChange` in `createCssVarsProvider` (#29857) @hbjORbj
|
|
35
|
+
- ​<!-- 09 -->[system] Add support for `enableColorScheme` in `createCssVarsProvider` (#29845) @hbjORbj
|
|
36
|
+
|
|
37
|
+
### `@mui/utils@5.2.2`
|
|
38
|
+
|
|
39
|
+
- ​<!-- 05 -->[useId] Trade random collisions for collisions on overflow (#29781) @eps1lon
|
|
40
|
+
- ​<!-- 04 -->[useIsFocusVisible] Convert to TypeScript (#29779) @eps1lon
|
|
41
|
+
|
|
42
|
+
### Docs
|
|
43
|
+
|
|
44
|
+
- ​<!-- 24 -->[docs] Fix v5-beta confusing example description (#29932) @oliviertassinari
|
|
45
|
+
- ​<!-- 23 -->[docs] Apply the z-index on the right DOM element (#29934) @oliviertassinari
|
|
46
|
+
- ​<!-- 22 -->[docs] Improve git diff format (#29935) @oliviertassinari
|
|
47
|
+
- ​<!-- 21 -->[docs] Fix typo (#29866) @sinclairity
|
|
48
|
+
- ​<!-- 20 -->[docs] Fix key display (#29933) @oliviertassinari
|
|
49
|
+
- ​<!-- 19 -->[docs] Fix outdated link to next/link docs (#29937) @radlinskii
|
|
50
|
+
- ​<!-- 18 -->[docs] Add how to pass `sx` prop (#29905) @siriwatknp
|
|
51
|
+
- ​<!-- 17 -->[docs] Fix typo in notifications @mbrookes
|
|
52
|
+
- ​<!-- 16 -->[docs] Black Friday sale notification @mbrookes
|
|
53
|
+
- ​<!-- 03 -->[website] Fix canonical links (#29938) @oliviertassinari
|
|
54
|
+
- ​<!-- 02 -->[website] Fix SEO issues (#29939) @oliviertassinari
|
|
55
|
+
- ​<!-- 01 -->[website] Improvements to the /x product page (#28964) @danilo-leal
|
|
56
|
+
|
|
57
|
+
### Core
|
|
58
|
+
|
|
59
|
+
- ​<!-- 27 -->[core] Remove dead code (#29940) @oliviertassinari
|
|
60
|
+
- ​<!-- 26 -->[core] Move benchmark CI job from AZP to CircleCI (#29894) @eps1lon
|
|
61
|
+
- ​<!-- 25 -->[core] Fix PR detection pattern in test_bundle_size_monitor (#29895) @eps1lon
|
|
62
|
+
- ​<!-- 08 -->[test] Fix browser tests (#29929) @eps1lon
|
|
63
|
+
- ​<!-- 07 -->[test] Reject shorthand properties in style matchers (#29893) @eps1lon
|
|
64
|
+
|
|
65
|
+
All contributors of this release in alphabetical order: @danilo-leal, @eps1lon, @Harshikerfuffle, @hbjORbj, @mbrookes, @oliviertassinari, @radlinskii, @sinclairity, @siriwatknp
|
|
66
|
+
|
|
3
67
|
## 5.2.1
|
|
4
68
|
|
|
5
69
|
<!-- generated comparing v5.2.0..master -->
|
|
@@ -2004,7 +2068,7 @@ _May 31, 2021_
|
|
|
2004
2068
|
A big thanks to the 14 contributors who made this release possible. Here are some highlights ✨:
|
|
2005
2069
|
|
|
2006
2070
|
- 👩🎤 We have completed the migration to emotion of all the components (`@material-ui/core` and `@material-ui/lab`) @siriwatknp, @mnajdova.
|
|
2007
|
-
- 📦 Save [10 kB gzipped](https://bundlephobia.com/
|
|
2071
|
+
- 📦 Save [10 kB gzipped](https://bundlephobia.com/package/@material-ui/core@5.0.0-alpha.34) by removing the dependency on `@material-ui/styles` (JSS) from the core and the lab (#26377, #26382, #26376) @mnajdova.
|
|
2008
2072
|
- ⚒️ Add many new [codemods](https://github.com/mui-org/material-ui/blob/HEAD/packages/mui-codemod/README.md) to automate the migration from v4 to v5 (#24867) @mbrookes.
|
|
2009
2073
|
- And many more 🐛 bug fixes and 📚 improvements.
|
|
2010
2074
|
|
package/esm/useId.js
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
let globalId = 0;
|
|
2
3
|
export default function useId(idOverride) {
|
|
3
4
|
const [defaultId, setDefaultId] = React.useState(idOverride);
|
|
4
5
|
const id = idOverride || defaultId;
|
|
5
6
|
React.useEffect(() => {
|
|
6
7
|
if (defaultId == null) {
|
|
7
8
|
// Fallback to this default id when possible.
|
|
8
|
-
// Use the
|
|
9
|
+
// Use the incrementing value for client-side rendering only.
|
|
9
10
|
// We can't use it server-side.
|
|
10
|
-
|
|
11
|
+
// If you want to use random values please consider the Birthday Problem: https://en.wikipedia.org/wiki/Birthday_problem
|
|
12
|
+
globalId += 1;
|
|
13
|
+
setDefaultId(`mui-${globalId}`);
|
|
11
14
|
}
|
|
12
15
|
}, [defaultId]);
|
|
13
16
|
return id;
|
package/esm/useIsFocusVisible.js
CHANGED
package/index.js
CHANGED
package/legacy/index.js
CHANGED
package/legacy/useId.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
var globalId = 0;
|
|
2
3
|
export default function useId(idOverride) {
|
|
3
4
|
var _React$useState = React.useState(idOverride),
|
|
4
5
|
defaultId = _React$useState[0],
|
|
@@ -8,9 +9,11 @@ export default function useId(idOverride) {
|
|
|
8
9
|
React.useEffect(function () {
|
|
9
10
|
if (defaultId == null) {
|
|
10
11
|
// Fallback to this default id when possible.
|
|
11
|
-
// Use the
|
|
12
|
+
// Use the incrementing value for client-side rendering only.
|
|
12
13
|
// We can't use it server-side.
|
|
13
|
-
|
|
14
|
+
// If you want to use random values please consider the Birthday Problem: https://en.wikipedia.org/wiki/Birthday_problem
|
|
15
|
+
globalId += 1;
|
|
16
|
+
setDefaultId("mui-".concat(globalId));
|
|
14
17
|
}
|
|
15
18
|
}, [defaultId]);
|
|
16
19
|
return id;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
var hadKeyboardEvent = true;
|
|
4
4
|
var hadFocusVisibleRecently = false;
|
|
5
|
-
var hadFocusVisibleRecentlyTimeout
|
|
5
|
+
var hadFocusVisibleRecentlyTimeout;
|
|
6
6
|
var inputTypesWhitelist = {
|
|
7
7
|
text: true,
|
|
8
8
|
search: true,
|
|
@@ -27,8 +27,9 @@ var inputTypesWhitelist = {
|
|
|
27
27
|
*/
|
|
28
28
|
|
|
29
29
|
function focusTriggersKeyboardModality(node) {
|
|
30
|
-
var
|
|
31
|
-
|
|
30
|
+
var _ref = node,
|
|
31
|
+
type = _ref.type,
|
|
32
|
+
tagName = _ref.tagName;
|
|
32
33
|
|
|
33
34
|
if (tagName === 'INPUT' && inputTypesWhitelist[type] && !node.readOnly) {
|
|
34
35
|
return true;
|
package/modern/index.js
CHANGED
package/modern/useId.js
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
let globalId = 0;
|
|
2
3
|
export default function useId(idOverride) {
|
|
3
4
|
const [defaultId, setDefaultId] = React.useState(idOverride);
|
|
4
5
|
const id = idOverride || defaultId;
|
|
5
6
|
React.useEffect(() => {
|
|
6
7
|
if (defaultId == null) {
|
|
7
8
|
// Fallback to this default id when possible.
|
|
8
|
-
// Use the
|
|
9
|
+
// Use the incrementing value for client-side rendering only.
|
|
9
10
|
// We can't use it server-side.
|
|
10
|
-
|
|
11
|
+
// If you want to use random values please consider the Birthday Problem: https://en.wikipedia.org/wiki/Birthday_problem
|
|
12
|
+
globalId += 1;
|
|
13
|
+
setDefaultId(`mui-${globalId}`);
|
|
11
14
|
}
|
|
12
15
|
}, [defaultId]);
|
|
13
16
|
return id;
|
package/package.json
CHANGED
package/useId.js
CHANGED
|
@@ -11,15 +11,19 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
11
11
|
|
|
12
12
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
13
13
|
|
|
14
|
+
let globalId = 0;
|
|
15
|
+
|
|
14
16
|
function useId(idOverride) {
|
|
15
17
|
const [defaultId, setDefaultId] = React.useState(idOverride);
|
|
16
18
|
const id = idOverride || defaultId;
|
|
17
19
|
React.useEffect(() => {
|
|
18
20
|
if (defaultId == null) {
|
|
19
21
|
// Fallback to this default id when possible.
|
|
20
|
-
// Use the
|
|
22
|
+
// Use the incrementing value for client-side rendering only.
|
|
21
23
|
// We can't use it server-side.
|
|
22
|
-
|
|
24
|
+
// If you want to use random values please consider the Birthday Problem: https://en.wikipedia.org/wiki/Birthday_problem
|
|
25
|
+
globalId += 1;
|
|
26
|
+
setDefaultId(`mui-${globalId}`);
|
|
23
27
|
}
|
|
24
28
|
}, [defaultId]);
|
|
25
29
|
return id;
|
package/useIsFocusVisible.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
2
|
+
export declare function teardown(doc: Document): void;
|
|
3
|
+
export interface UseIsFocusVisibleResult {
|
|
4
|
+
isFocusVisibleRef: React.MutableRefObject<boolean>;
|
|
5
|
+
onBlur: (event: React.FocusEvent<any>) => void;
|
|
6
|
+
onFocus: (event: React.FocusEvent<any>) => void;
|
|
7
|
+
ref: React.Ref<unknown>;
|
|
8
|
+
}
|
|
9
|
+
export default function useIsFocusVisible(): UseIsFocusVisibleResult;
|
package/useIsFocusVisible.js
CHANGED
|
@@ -15,7 +15,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
15
15
|
// based on https://github.com/WICG/focus-visible/blob/v4.1.5/src/focus-visible.js
|
|
16
16
|
let hadKeyboardEvent = true;
|
|
17
17
|
let hadFocusVisibleRecently = false;
|
|
18
|
-
let hadFocusVisibleRecentlyTimeout
|
|
18
|
+
let hadFocusVisibleRecentlyTimeout;
|
|
19
19
|
const inputTypesWhitelist = {
|
|
20
20
|
text: true,
|
|
21
21
|
search: true,
|