@mui/utils 5.1.0 → 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 +257 -10
- package/HTMLElementType.d.ts +3 -3
- package/chainPropTypes.d.ts +2 -2
- package/createChainedFunction.d.ts +7 -7
- package/deepmerge.d.ts +5 -5
- package/deepmerge.js +1 -3
- package/elementAcceptingRef.d.ts +3 -3
- package/elementTypeAcceptingRef.d.ts +3 -3
- package/esm/deepmerge.js +1 -3
- package/esm/useId.js +5 -2
- package/esm/useIsFocusVisible.js +1 -1
- package/exactProp.d.ts +2 -2
- package/formatMuiErrorMessage.d.ts +6 -6
- package/getDisplayName.d.ts +8 -8
- package/getScrollbarSize.d.ts +1 -1
- package/index.d.ts +32 -32
- package/index.js +1 -1
- package/integerPropType.d.ts +7 -7
- package/isMuiElement.d.ts +1 -1
- package/legacy/deepmerge.js +1 -3
- package/legacy/index.js +1 -1
- package/legacy/useId.js +5 -2
- package/legacy/useIsFocusVisible.js +4 -3
- package/modern/deepmerge.js +1 -3
- package/modern/index.js +1 -1
- package/modern/useId.js +5 -2
- package/modern/useIsFocusVisible.js +1 -1
- package/ownerDocument.d.ts +1 -1
- package/ownerWindow.d.ts +1 -1
- package/package.json +2 -2
- package/ponyfillGlobal.d.ts +2 -2
- package/refType.d.ts +3 -3
- package/setRef.d.ts +15 -15
- package/useEventCallback.d.ts +4 -4
- package/useEventCallback.spec.d.ts +1 -1
- package/useForkRef.d.ts +2 -2
- package/useId.d.ts +1 -1
- package/useId.js +6 -2
- package/useIsFocusVisible.d.ts +8 -7
- package/useIsFocusVisible.js +1 -1
- package/usePreviousProps.d.ts +2 -2
- package/visuallyHidden.d.ts +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,252 @@
|
|
|
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
|
+
|
|
67
|
+
## 5.2.1
|
|
68
|
+
|
|
69
|
+
<!-- generated comparing v5.2.0..master -->
|
|
70
|
+
|
|
71
|
+
_Nov 25, 2021_
|
|
72
|
+
|
|
73
|
+
A big thanks to the 7 contributors who made this release possible. Here are some highlights ✨:
|
|
74
|
+
|
|
75
|
+
This is an early release to fix `export 'useId' (imported as 'React') was not found in 'react'` when bundling code depending on MUI Core.
|
|
76
|
+
|
|
77
|
+
- ​<!-- 10 -->[AppBar][docs] Add a fully responsive demo to docs (#29829) @karakib2k18
|
|
78
|
+
- ​<!-- 9 -->[core] Fix PR run detection in test_bundle_size_monitor (#29879) @eps1lon
|
|
79
|
+
- ​<!-- 8 -->[core] Move bundle size monitoring to CircleCI (#29876) @eps1lon
|
|
80
|
+
- ​<!-- 7 -->[docs] Add keys to Responsive AppBar demo (#29884) @mbrookes
|
|
81
|
+
- ​<!-- 6 -->[docs] MUI's 2021 Developer survey (#29765) @newguy-123
|
|
82
|
+
- ​<!-- 5 -->[docs] Smoother image loading UX (#29858) @oliviertassinari
|
|
83
|
+
- ​<!-- 4 -->[Select] Fix select display value with React Nodes (#29836) @kegi
|
|
84
|
+
- ​<!-- 3 -->[system] Add `experimental_sx` utility (#29833) @mnajdova
|
|
85
|
+
- ​<!-- 2 -->[test] Ignore "detected multiple renderers" warning for now (#29854) @eps1lon
|
|
86
|
+
- ​<!-- 1 -->[useMediaQuery][utils] Remove usage of React 18 APIs (#29870) @eps1lon
|
|
87
|
+
|
|
88
|
+
All contributors of this release in alphabetical order: @eps1lon, @karakib2k18, @kegi, @mbrookes, @mnajdova, @newguy-123, @oliviertassinari
|
|
89
|
+
|
|
90
|
+
## 5.2.0
|
|
91
|
+
|
|
92
|
+
<!-- generated comparing v5.1.1..master -->
|
|
93
|
+
|
|
94
|
+
_Nov 23, 2021_
|
|
95
|
+
|
|
96
|
+
A big thanks to the 18 contributors who made this release possible. Here are some highlights ✨:
|
|
97
|
+
|
|
98
|
+
- 🧪 Created another unstyled component: [TabsUnstyled](https://mui.com/components/tabs/#unstyled) (#29597) @mnajdova.
|
|
99
|
+
- 🎉 Updated the Material Icons set with the latest changes from Google (#29328) @michaldudak / (#29818) @chao813.
|
|
100
|
+
This update adds 200 new icons and tweaks the appearance of many more.
|
|
101
|
+
With it, we're getting close to having 2000 icons in our set.
|
|
102
|
+
- 🐛 Fixed bugs and improved the infrastructure and documentation 📚.
|
|
103
|
+
|
|
104
|
+
### `@mui/material@5.2.0`
|
|
105
|
+
|
|
106
|
+
- [IconButton] Remove on hover effect when `disableRipple` is set (#29298) @adamfitzgibbon
|
|
107
|
+
- [i18n] Add the amharic language (#29153) @NatiG100
|
|
108
|
+
- [material] Fix types for `variants.style` to accept callbacks (#29610) @mnajdova
|
|
109
|
+
- [Popper] Simplify prop types (#29680) @michaldudak
|
|
110
|
+
- [Select] Include aria-selected=false when option not selected (#29695) @michaldudak
|
|
111
|
+
- [useMediaQuery] Fix crash in Safari < 14 and IE 11 (#29776) @eps1lon
|
|
112
|
+
- [useMediaQuery] Ensure no tearing in React 18 (#28491) @eps1lon
|
|
113
|
+
|
|
114
|
+
### `@mui/codemod@5.2.0`
|
|
115
|
+
|
|
116
|
+
- [codemod] Fix `jss-to-styled` to support multiple withStyles (#29824) @siriwatknp
|
|
117
|
+
|
|
118
|
+
### `@mui/icons-material@5.2.0`
|
|
119
|
+
|
|
120
|
+
- [icons] Sync new Google Material Icons (#29818) @chao813
|
|
121
|
+
- [icons] Sync recent Material Icons from Google (#29328) @michaldudak
|
|
122
|
+
|
|
123
|
+
### `@mui/system@5.2.0`
|
|
124
|
+
|
|
125
|
+
- [Box] Fix `sx` prop runtime issue when used as function (#29830) @mnajdova
|
|
126
|
+
- [system] Fix `sx` throw error when value is `null` or `undefined` (#29756) @siriwatknp
|
|
127
|
+
- [system] Fix minor CssVars issues (#29747) @siriwatknp
|
|
128
|
+
|
|
129
|
+
### `@mui/styled-engine@5.2.0`
|
|
130
|
+
|
|
131
|
+
- [styled-engine] Fix props inference in styled-engine (#29739) @Janpot
|
|
132
|
+
|
|
133
|
+
### `@mui/base@5.0.0-alpha.56`
|
|
134
|
+
|
|
135
|
+
- [FormControlUnstyled] `focused` is always false unless explicitly set to `true` @mwilkins91
|
|
136
|
+
- [TabsUnstyled] Introduce new component (#29597) @mnajdova
|
|
137
|
+
|
|
138
|
+
### `@mui/lab@5.0.0-alpha.56`
|
|
139
|
+
|
|
140
|
+
- [DatePicker][timepicker] Add missing component declarations (#29517) @longzheng
|
|
141
|
+
- [Masonry] exports from root package (#29754) @abhinav-22-tech
|
|
142
|
+
- [pickers] Widen accepted `luxon` version range (#29761) @eps1lon
|
|
143
|
+
|
|
144
|
+
### Docs
|
|
145
|
+
|
|
146
|
+
- [blog] MUI X v5 blog post (#29590) @DanailH
|
|
147
|
+
- [blog] Polish the Benny Joo joins MUI post (#29697) @oliviertassinari
|
|
148
|
+
- [CHANGELOG] Explain why we do breaking changes @oliviertassinari
|
|
149
|
+
- [core] Update latest issue template for codesandbox CI (#29783) @eps1lon
|
|
150
|
+
- [core] Ensure `@mui/core` is an alias for `@mui/base` (#29762) @eps1lon
|
|
151
|
+
- [docs] Fix broken Next and Previous links (#29711) @scallaway
|
|
152
|
+
- [docs] Add a note that ToggleButton exclusive does not enforce selection (#29812) @mmacu
|
|
153
|
+
- [docs] Update the list of supported locales (#29831) @michaldudak
|
|
154
|
+
- [docs] Update tooltip doc to better define touch action (#29717) @gnowland
|
|
155
|
+
- [website] Standardize the background color from the MUI team photos (#29738) @danilo-leal
|
|
156
|
+
- [website] Add Bharat to the About Us Page (#29714) @bharatkashyap
|
|
157
|
+
- [website] Add about page entry for jan (#29701) @Janpot
|
|
158
|
+
- [website] Adding Prakhar to the about page (#29737) @danilo-leal
|
|
159
|
+
|
|
160
|
+
### Core
|
|
161
|
+
|
|
162
|
+
- [test] Allow debugging with Chrome and VSCode inspector (#29777) @eps1lon
|
|
163
|
+
- [test] Use renderer clock instead of custom useFakeTimers call (#29778) @eps1lon
|
|
164
|
+
- [test] Only mock Date in regression tests (#29763) @eps1lon
|
|
165
|
+
- [test] Disable nightly integration tests on `next` branch (#29748) @eps1lon
|
|
166
|
+
- [test] Allow configuring clock directly from `createRenderer` (#29684) @eps1lon
|
|
167
|
+
- [test] Accept backslashes as path separators in test CLI (#29694) @michaldudak
|
|
168
|
+
- [utils] Use built-in hook when available for useId (#26489) @eps1lon
|
|
169
|
+
|
|
170
|
+
All contributors of this release in alphabetical order: @abhinav-22-tech, @adamfitzgibbon, @bharatkashyap, @chao813, @DanailH, @danilo-leal, @eps1lon, @gnowland, @Janpot, @longzheng, @michaldudak, @mmacu, @mnajdova, @mwilkins91, @NatiG100, @oliviertassinari, @scallaway, @siriwatknp
|
|
171
|
+
|
|
172
|
+
## 5.1.1
|
|
173
|
+
|
|
174
|
+
<!-- generated comparing v5.1.0..master -->
|
|
175
|
+
|
|
176
|
+
_Nov 16, 2021_
|
|
177
|
+
|
|
178
|
+
A big thanks to the 15 contributors who made this release possible. Here are some highlights ✨:
|
|
179
|
+
|
|
180
|
+
- 🛠 Renamed `@mui/core` to `@mui/base` (#29585) @michaldudak.
|
|
181
|
+
- And many more 🐛 bug fixes and 📚 improvements.
|
|
182
|
+
|
|
183
|
+
### `@mui/material@5.1.1`
|
|
184
|
+
|
|
185
|
+
- ​<!-- 34 -->[Breadcrumbs][divider] Replace decimal spacing values with integers and css calc (#29526) @anikcreative
|
|
186
|
+
- ​<!-- 10 -->[Select][nativeselect] Add `multiple` class (#29566) @aaronholla
|
|
187
|
+
- ​<!-- 09 -->[Popper] Split into PopperUnstyled and Popper (#29488) @michaldudak
|
|
188
|
+
- ​<!-- 08 -->[Select] Make it clear that `Select` is not a root component (#29593) @hbjORbj
|
|
189
|
+
- ​<!-- 13 -->[l10n] Improved Dutch (nl-NL) locale (#29592) @flipvrijn
|
|
190
|
+
- ​<!-- 10 -->[Table] Improve pagination range, use "en dash" over "hyphen" (#29579) @narekmal
|
|
191
|
+
|
|
192
|
+
### `@mui/base@5.0.0-alpha.55`
|
|
193
|
+
|
|
194
|
+
#### Breaking changes
|
|
195
|
+
|
|
196
|
+
- ​<!-- 27 -->[core] Rename mui/core to mui/base (#29585) @michaldudak
|
|
197
|
+
|
|
198
|
+
Based on the results of the [poll](https://twitter.com/michaldudak/status/1452630484706635779) and our internal discussions, we decided to rename the `@mui/core` package to `@mui/base`. The main rationale for this is the fact that we use the term "Core" to refer to the core components product family, the one that includes Material Design components, unstyled components, System utilities, etc. Therefore, @mui/core was effectively a subset of MUI Core. This was confusing.
|
|
199
|
+
|
|
200
|
+
The new name better reflects the purpose of the package: it contains unstyled components, hooks, and utilities that serve as a **base** to build on.
|
|
201
|
+
|
|
202
|
+
```diff
|
|
203
|
+
-import { useSwitch } from '@mui/core/SwitchUnstyled';
|
|
204
|
+
+import { useSwitch } from '@mui/base/SwitchUnstyled';
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
### `@mui/lab@5.0.0-alpha.55`
|
|
208
|
+
|
|
209
|
+
- ​<!-- 12 -->[LoadingButton] Text variant spacing fixed for both start and end (#29194) @joshua-lawrence
|
|
210
|
+
- ​<!-- 11 -->[Masonry] Check if container or child exists to prevent error (#29452) @hbjORbj
|
|
211
|
+
|
|
212
|
+
### Docs
|
|
213
|
+
|
|
214
|
+
- ​<!-- 25 -->[docs] Correct bundler configuration for using legacy MUI build (#29146) @petermikitsh
|
|
215
|
+
- ​<!-- 24 -->[docs] Fix typo on autocomplete.md (#29570) @netizer
|
|
216
|
+
- ​<!-- 23 -->[docs] Fix dark mode on branding pages (#29611) @alexfauquette
|
|
217
|
+
- ​<!-- 22 -->[docs] Do not render CSS section in API docs navbar if there are no CSS classes (#29622) @ZeeshanTamboli
|
|
218
|
+
- ​<!-- 21 -->[docs] Fix link locale handling (#29624) @oliviertassinari
|
|
219
|
+
- ​<!-- 20 -->[docs] Fix Search navigation (#29623) @oliviertassinari
|
|
220
|
+
- ​<!-- 19 -->[docs] Fix broken link & update MUI packages explanation (#29583) @siriwatknp
|
|
221
|
+
- ​<!-- 18 -->[docs] Do not repeat language snippet in url in Algolia search (#29483) @hbjORbj
|
|
222
|
+
- ​<!-- 17 -->[docs] Update `ThemeProvider` API link (#29573) @siriwatknp
|
|
223
|
+
- ​<!-- 16 -->[docs] Remove svg logos from the Support page (#29431) @oliviertassinari
|
|
224
|
+
- ​<!-- 15 -->[docs] Link UXPin integration (#29422) @oliviertassinari
|
|
225
|
+
- ​<!-- 14 -->[docs] Link to the new public roadmap for the design kits (#29433) @oliviertassinari
|
|
226
|
+
- ​<!-- 28 -->[docs] correct bundler configuration for using legacy MUI build (#29146) @petermikitsh
|
|
227
|
+
- ​<!-- 01 -->[website] Fix premium plan release date (#29430) @oliviertassinari
|
|
228
|
+
- ​<!-- 02 -->[website] Add GitHub icon button to the navbar (#29640) @danilo-leal
|
|
229
|
+
- ​<!-- 39 -->[blog] Support many authors in markdown pages (#29633) @m4theushw
|
|
230
|
+
|
|
231
|
+
### Core
|
|
232
|
+
|
|
233
|
+
- ​<!-- 33 -->[core] Add `experiments` index page (#29582) @siriwatknp
|
|
234
|
+
- ​<!-- 32 -->[core] Move s3 bucket ownership to mui-org (#29609) @eps1lon
|
|
235
|
+
- ​<!-- 31 -->[core] Improve support request message (#29614) @mnajdova
|
|
236
|
+
- ​<!-- 30 -->[core] Use support request Github Action (#29594) @mnajdova
|
|
237
|
+
- ​<!-- 29 -->[core] Remove unused `getJsxPreview` util (#29586) @ZeeshanTamboli
|
|
238
|
+
- ​<!-- 28 -->[core] Use GitHub issue forms (#28038) @oliviertassinari
|
|
239
|
+
- ​<!-- 26 -->[core] Add playground (#29423) @oliviertassinari
|
|
240
|
+
- ​<!-- 07 -->[test] Correctly identify what the `raf` helper is for (#29683) @eps1lon
|
|
241
|
+
- ​<!-- 06 -->[test] Verify a quilted ImageList is created as test title suggests (#29565) @daniel-sachs
|
|
242
|
+
- ​<!-- 05 -->[test] Replace `createServerRender` with `createRenderer` (#29503) @eps1lon
|
|
243
|
+
- ​<!-- 04 -->[test] Always ignore "useLayoutEffect has no effect on the server"-warning (#29502) @eps1lon
|
|
244
|
+
- ​<!-- 03 -->[test] Restore StrictMode by default (#29589) @eps1lon
|
|
245
|
+
- ​<!-- 02 -->[test] createPickerRender -> createPickerRenderer (#29575) @eps1lon
|
|
246
|
+
- ​<!-- 09 -->[test] Allow experimental CLI to run exact test (#29685) @eps1lon
|
|
247
|
+
|
|
248
|
+
All contributors of this release in alphabetical order: @aaronholla, @alexfauquette, @anikcreative, @daniel-sachs, @eps1lon, @flipvrijn, @hbjORbj, @joshua-lawrence, @michaldudak, @mnajdova, @netizer, @oliviertassinari, @petermikitsh, @siriwatknp, @ZeeshanTamboli
|
|
249
|
+
|
|
3
250
|
## 5.1.0
|
|
4
251
|
|
|
5
252
|
<!-- generated comparing v5.0.6..master -->
|
|
@@ -142,16 +389,16 @@ _Oct 26, 2021_
|
|
|
142
389
|
A big thanks to the 19 contributors who made this release possible. Here are some highlights ✨:
|
|
143
390
|
|
|
144
391
|
- 🔧 Implement `Masonry` using Flexbox by @hbjORbj.
|
|
145
|
-
- 🧪 Add three components to `@mui/
|
|
392
|
+
- 🧪 Add three components to `@mui/base` by @rebeccahongsf and @hbjORbj.
|
|
146
393
|
|
|
147
394
|
### `@mui/codemod@5.0.5`
|
|
148
395
|
|
|
149
396
|
- ​<!-- 38 -->[codemod] Support new package name in `link-underline-hover` transformer (#29214) @siriwatknp
|
|
150
397
|
|
|
151
|
-
### `@mui/
|
|
398
|
+
### `@mui/base@5.0.0-alpha.52`
|
|
152
399
|
|
|
153
400
|
- ​<!-- 39 -->[ClickAwayListener] Move to the core package (#29186) @hbjORbj
|
|
154
|
-
- ​<!-- 13 -->[Popper] Move from mui-material to mui-
|
|
401
|
+
- ​<!-- 13 -->[Popper] Move from mui-material to mui-base (#28923) @rebeccahongsf
|
|
155
402
|
- ​<!-- 04 -->[TextareaAutosize] Move to the core package (#29148) @hbjORbj
|
|
156
403
|
|
|
157
404
|
### `@mui/lab@5.0.0-alpha.52`
|
|
@@ -220,7 +467,7 @@ _Oct 14, 2021_
|
|
|
220
467
|
|
|
221
468
|
A big thanks to the 17 contributors who made this release possible. Here are some highlights ✨:
|
|
222
469
|
|
|
223
|
-
- 🧪 Added `UnstyledInput` and `useInput` hook in the the first component in @mui/
|
|
470
|
+
- 🧪 Added `UnstyledInput` and `useInput` hook in the the first component in @mui/base package @michaldudak (#28053)
|
|
224
471
|
- 🐛 Fixed many bugs and improved the documentation 📚.
|
|
225
472
|
|
|
226
473
|
### `@mui/material@5.0.4`
|
|
@@ -235,7 +482,7 @@ A big thanks to the 17 contributors who made this release possible. Here are som
|
|
|
235
482
|
|
|
236
483
|
- ​<!-- 05 -->[system] Update typing for `style` function (#28744) @hbjORbj
|
|
237
484
|
|
|
238
|
-
### `@mui/
|
|
485
|
+
### `@mui/base@5.0.0-alpha.51`
|
|
239
486
|
|
|
240
487
|
- ​<!-- 07 -->[InputUnstyled] Create unstyled input and useInput hook (#28053) @michaldudak
|
|
241
488
|
|
|
@@ -304,7 +551,7 @@ A big thanks to the 19 contributors who made this release possible. Here are som
|
|
|
304
551
|
|
|
305
552
|
- ​<!-- 42 -->Don't allow styled-components APIs on mui styled function (#28807) @hbjORbj
|
|
306
553
|
|
|
307
|
-
### `@mui/
|
|
554
|
+
### `@mui/base@5.0.0-alpha.50`
|
|
308
555
|
|
|
309
556
|
- ​<!-- 38 -->[ButtonUnstyled] Don't set redundant role=button (#28488) @michaldudak
|
|
310
557
|
- ​<!-- 43 -->[SliderUnstyled] Prevent unknown-prop error when using marks prop (#28868) @hbjORbj
|
|
@@ -683,10 +930,10 @@ A big thanks to the 18 contributors who made this release possible. Here are som
|
|
|
683
930
|
```
|
|
684
931
|
@material-ui/core => @mui/material // represents Material Design components.
|
|
685
932
|
@material-ui/icons => @mui/icons-material // represents Material Design icons.
|
|
686
|
-
@material-ui/unstyled => @mui/
|
|
933
|
+
@material-ui/unstyled => @mui/base // fully functional components with minimum styles.
|
|
687
934
|
```
|
|
688
935
|
|
|
689
|
-
> **Note**: `@mui/
|
|
936
|
+
> **Note**: `@mui/base` (previously `@material-ui/unstyled`) is not the same as `@material-ui/core`.
|
|
690
937
|
|
|
691
938
|
We encourage you to use the [codemod](https://github.com/mui-org/material-ui/blob/next/packages/mui-codemod/README.md#mui-replace) for smooth migration.
|
|
692
939
|
|
|
@@ -701,7 +948,7 @@ A big thanks to the 18 contributors who made this release possible. Here are som
|
|
|
701
948
|
- ​<!-- 05 -->[ToggleButtonGroup] Add "disabled" prop (#27998) @chetas411
|
|
702
949
|
- ​<!-- 34 -->[core] Export types for module augmentation (#28078) @m4theushw
|
|
703
950
|
|
|
704
|
-
### `@mui/
|
|
951
|
+
### `@mui/base@5.0.0-alpha.45`
|
|
705
952
|
|
|
706
953
|
- ​<!-- 38 -->[Button] Create ButtonUnstyled and useButton (#27600) @michaldudak
|
|
707
954
|
|
|
@@ -1821,7 +2068,7 @@ _May 31, 2021_
|
|
|
1821
2068
|
A big thanks to the 14 contributors who made this release possible. Here are some highlights ✨:
|
|
1822
2069
|
|
|
1823
2070
|
- 👩🎤 We have completed the migration to emotion of all the components (`@material-ui/core` and `@material-ui/lab`) @siriwatknp, @mnajdova.
|
|
1824
|
-
- 📦 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.
|
|
1825
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.
|
|
1826
2073
|
- And many more 🐛 bug fixes and 📚 improvements.
|
|
1827
2074
|
|
package/HTMLElementType.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export default function HTMLElementType(props: {
|
|
2
|
-
[key: string]: unknown;
|
|
3
|
-
}, propName: string, componentName: string, location: string, propFullName: string): Error | null;
|
|
1
|
+
export default function HTMLElementType(props: {
|
|
2
|
+
[key: string]: unknown;
|
|
3
|
+
}, propName: string, componentName: string, location: string, propFullName: string): Error | null;
|
package/chainPropTypes.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import PropTypes from 'prop-types';
|
|
2
|
-
export default function chainPropTypes<A, B>(propType1: PropTypes.Validator<A>, propType2: PropTypes.Validator<B>): PropTypes.Validator<A & B>;
|
|
1
|
+
import PropTypes from 'prop-types';
|
|
2
|
+
export default function chainPropTypes<A, B>(propType1: PropTypes.Validator<A>, propType2: PropTypes.Validator<B>): PropTypes.Validator<A & B>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Safe chained function.
|
|
3
|
-
*
|
|
4
|
-
* Will only create a new function if needed,
|
|
5
|
-
* otherwise will pass back existing functions or null.
|
|
6
|
-
*/
|
|
7
|
-
export default function createChainedFunction<Args extends any[], This>(...funcs: Array<(this: This, ...args: Args) => any>): (this: This, ...args: Args) => void;
|
|
1
|
+
/**
|
|
2
|
+
* Safe chained function.
|
|
3
|
+
*
|
|
4
|
+
* Will only create a new function if needed,
|
|
5
|
+
* otherwise will pass back existing functions or null.
|
|
6
|
+
*/
|
|
7
|
+
export default function createChainedFunction<Args extends any[], This>(...funcs: Array<(this: This, ...args: Args) => any>): (this: This, ...args: Args) => void;
|
package/deepmerge.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export declare function isPlainObject(item: unknown): item is Record<keyof any, unknown>;
|
|
2
|
-
export interface DeepmergeOptions {
|
|
3
|
-
clone?: boolean;
|
|
4
|
-
}
|
|
5
|
-
export default function deepmerge<T>(target: T, source: unknown, options?: DeepmergeOptions): T;
|
|
1
|
+
export declare function isPlainObject(item: unknown): item is Record<keyof any, unknown>;
|
|
2
|
+
export interface DeepmergeOptions {
|
|
3
|
+
clone?: boolean;
|
|
4
|
+
}
|
|
5
|
+
export default function deepmerge<T>(target: T, source: unknown, options?: DeepmergeOptions): T;
|
package/deepmerge.js
CHANGED
|
@@ -11,9 +11,7 @@ exports.isPlainObject = isPlainObject;
|
|
|
11
11
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
12
12
|
|
|
13
13
|
function isPlainObject(item) {
|
|
14
|
-
return item !== null && typeof item === 'object' &&
|
|
15
|
-
// @ts-expect-error
|
|
16
|
-
item.constructor === Object;
|
|
14
|
+
return item !== null && typeof item === 'object' && item.constructor === Object;
|
|
17
15
|
}
|
|
18
16
|
|
|
19
17
|
function deepmerge(target, source, options = {
|
package/elementAcceptingRef.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import PropTypes from 'prop-types';
|
|
2
|
-
declare const elementAcceptingRef: PropTypes.Requireable<unknown>;
|
|
3
|
-
export default elementAcceptingRef;
|
|
1
|
+
import PropTypes from 'prop-types';
|
|
2
|
+
declare const elementAcceptingRef: PropTypes.Requireable<unknown>;
|
|
3
|
+
export default elementAcceptingRef;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import PropTypes from 'prop-types';
|
|
2
|
-
declare const _default: PropTypes.Validator<PropTypes.ReactComponentLike | null | undefined>;
|
|
3
|
-
export default _default;
|
|
1
|
+
import PropTypes from 'prop-types';
|
|
2
|
+
declare const _default: PropTypes.Validator<PropTypes.ReactComponentLike | null | undefined>;
|
|
3
|
+
export default _default;
|
package/esm/deepmerge.js
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
export function isPlainObject(item) {
|
|
3
|
-
return item !== null && typeof item === 'object' &&
|
|
4
|
-
// @ts-expect-error
|
|
5
|
-
item.constructor === Object;
|
|
3
|
+
return item !== null && typeof item === 'object' && item.constructor === Object;
|
|
6
4
|
}
|
|
7
5
|
export default function deepmerge(target, source, options = {
|
|
8
6
|
clone: true
|
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/exactProp.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ValidationMap } from 'prop-types';
|
|
2
|
-
export default function exactProp<T>(propTypes: ValidationMap<T>): ValidationMap<T>;
|
|
1
|
+
import { ValidationMap } from 'prop-types';
|
|
2
|
+
export default function exactProp<T>(propTypes: ValidationMap<T>): ValidationMap<T>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WARNING: Don't import this directly.
|
|
3
|
-
* Use `MuiError` from `@mui/utils/macros/MuiError.macro` instead.
|
|
4
|
-
* @param {number} code
|
|
5
|
-
*/
|
|
6
|
-
export default function formatMuiErrorMessage(code: number): string;
|
|
1
|
+
/**
|
|
2
|
+
* WARNING: Don't import this directly.
|
|
3
|
+
* Use `MuiError` from `@mui/utils/macros/MuiError.macro` instead.
|
|
4
|
+
* @param {number} code
|
|
5
|
+
*/
|
|
6
|
+
export default function formatMuiErrorMessage(code: number): string;
|
package/getDisplayName.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
export declare function getFunctionName(fn: Function): string;
|
|
3
|
-
/**
|
|
4
|
-
* cherry-pick from
|
|
5
|
-
* https://github.com/facebook/react/blob/769b1f270e1251d9dbdce0fcbd9e92e502d059b8/packages/shared/getComponentName.js
|
|
6
|
-
* originally forked from recompose/getDisplayName with added IE11 support
|
|
7
|
-
*/
|
|
8
|
-
export default function getDisplayName(Component: React.ElementType): string | undefined;
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export declare function getFunctionName(fn: Function): string;
|
|
3
|
+
/**
|
|
4
|
+
* cherry-pick from
|
|
5
|
+
* https://github.com/facebook/react/blob/769b1f270e1251d9dbdce0fcbd9e92e502d059b8/packages/shared/getComponentName.js
|
|
6
|
+
* originally forked from recompose/getDisplayName with added IE11 support
|
|
7
|
+
*/
|
|
8
|
+
export default function getDisplayName(Component: React.ElementType): string | undefined;
|
package/getScrollbarSize.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export default function getScrollbarSize(doc: Document): number;
|
|
1
|
+
export default function getScrollbarSize(doc: Document): number;
|
package/index.d.ts
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
export { default as chainPropTypes } from './chainPropTypes';
|
|
2
|
-
export { default as deepmerge } from './deepmerge';
|
|
3
|
-
export { isPlainObject } from './deepmerge';
|
|
4
|
-
export { default as elementAcceptingRef } from './elementAcceptingRef';
|
|
5
|
-
export { default as elementTypeAcceptingRef } from './elementTypeAcceptingRef';
|
|
6
|
-
export { default as exactProp } from './exactProp';
|
|
7
|
-
export { default as formatMuiErrorMessage } from './formatMuiErrorMessage';
|
|
8
|
-
export { default as getDisplayName } from './getDisplayName';
|
|
9
|
-
export { default as HTMLElementType } from './HTMLElementType';
|
|
10
|
-
export { default as ponyfillGlobal } from './ponyfillGlobal';
|
|
11
|
-
export { default as refType } from './refType';
|
|
12
|
-
export { default as unstable_capitalize } from './capitalize';
|
|
13
|
-
export { default as unstable_createChainedFunction } from './createChainedFunction';
|
|
14
|
-
export { default as unstable_debounce } from './debounce';
|
|
15
|
-
export { default as unstable_deprecatedPropType } from './deprecatedPropType';
|
|
16
|
-
export { default as unstable_isMuiElement } from './isMuiElement';
|
|
17
|
-
export { default as unstable_ownerDocument } from './ownerDocument';
|
|
18
|
-
export { default as unstable_ownerWindow } from './ownerWindow';
|
|
19
|
-
export { default as unstable_requirePropFactory } from './requirePropFactory';
|
|
20
|
-
export { default as unstable_setRef } from './setRef';
|
|
21
|
-
export { default as unstable_useEnhancedEffect } from './useEnhancedEffect';
|
|
22
|
-
export { default as unstable_useId } from './useId';
|
|
23
|
-
export { default as unstable_unsupportedProp } from './unsupportedProp';
|
|
24
|
-
export { default as unstable_useControlled } from './useControlled';
|
|
25
|
-
export { default as unstable_useEventCallback } from './useEventCallback';
|
|
26
|
-
export { default as unstable_useForkRef } from './useForkRef';
|
|
27
|
-
export { default as unstable_useIsFocusVisible } from './useIsFocusVisible';
|
|
28
|
-
export { default as unstable_getScrollbarSize } from './getScrollbarSize';
|
|
29
|
-
export { detectScrollType as unstable_detectScrollType, getNormalizedScrollLeft as unstable_getNormalizedScrollLeft, } from './scrollLeft';
|
|
30
|
-
export { default as usePreviousProps } from './usePreviousProps';
|
|
31
|
-
export { default as visuallyHidden } from './visuallyHidden';
|
|
32
|
-
export { default as integerPropType } from './integerPropType';
|
|
1
|
+
export { default as chainPropTypes } from './chainPropTypes';
|
|
2
|
+
export { default as deepmerge } from './deepmerge';
|
|
3
|
+
export { isPlainObject } from './deepmerge';
|
|
4
|
+
export { default as elementAcceptingRef } from './elementAcceptingRef';
|
|
5
|
+
export { default as elementTypeAcceptingRef } from './elementTypeAcceptingRef';
|
|
6
|
+
export { default as exactProp } from './exactProp';
|
|
7
|
+
export { default as formatMuiErrorMessage } from './formatMuiErrorMessage';
|
|
8
|
+
export { default as getDisplayName } from './getDisplayName';
|
|
9
|
+
export { default as HTMLElementType } from './HTMLElementType';
|
|
10
|
+
export { default as ponyfillGlobal } from './ponyfillGlobal';
|
|
11
|
+
export { default as refType } from './refType';
|
|
12
|
+
export { default as unstable_capitalize } from './capitalize';
|
|
13
|
+
export { default as unstable_createChainedFunction } from './createChainedFunction';
|
|
14
|
+
export { default as unstable_debounce } from './debounce';
|
|
15
|
+
export { default as unstable_deprecatedPropType } from './deprecatedPropType';
|
|
16
|
+
export { default as unstable_isMuiElement } from './isMuiElement';
|
|
17
|
+
export { default as unstable_ownerDocument } from './ownerDocument';
|
|
18
|
+
export { default as unstable_ownerWindow } from './ownerWindow';
|
|
19
|
+
export { default as unstable_requirePropFactory } from './requirePropFactory';
|
|
20
|
+
export { default as unstable_setRef } from './setRef';
|
|
21
|
+
export { default as unstable_useEnhancedEffect } from './useEnhancedEffect';
|
|
22
|
+
export { default as unstable_useId } from './useId';
|
|
23
|
+
export { default as unstable_unsupportedProp } from './unsupportedProp';
|
|
24
|
+
export { default as unstable_useControlled } from './useControlled';
|
|
25
|
+
export { default as unstable_useEventCallback } from './useEventCallback';
|
|
26
|
+
export { default as unstable_useForkRef } from './useForkRef';
|
|
27
|
+
export { default as unstable_useIsFocusVisible } from './useIsFocusVisible';
|
|
28
|
+
export { default as unstable_getScrollbarSize } from './getScrollbarSize';
|
|
29
|
+
export { detectScrollType as unstable_detectScrollType, getNormalizedScrollLeft as unstable_getNormalizedScrollLeft, } from './scrollLeft';
|
|
30
|
+
export { default as usePreviousProps } from './usePreviousProps';
|
|
31
|
+
export { default as visuallyHidden } from './visuallyHidden';
|
|
32
|
+
export { default as integerPropType } from './integerPropType';
|
package/index.js
CHANGED
package/integerPropType.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export function getTypeByValue(value: any): any;
|
|
2
|
-
declare function _default(props: any, propName: any, ...other: any[]): RangeError | null;
|
|
3
|
-
declare namespace _default {
|
|
4
|
-
export { requiredInteger as isRequired };
|
|
5
|
-
}
|
|
6
|
-
export default _default;
|
|
7
|
-
declare function requiredInteger(props: any, propName: any, componentName: any, location: any): RangeError | null;
|
|
1
|
+
export function getTypeByValue(value: any): any;
|
|
2
|
+
declare function _default(props: any, propName: any, ...other: any[]): RangeError | null;
|
|
3
|
+
declare namespace _default {
|
|
4
|
+
export { requiredInteger as isRequired };
|
|
5
|
+
}
|
|
6
|
+
export default _default;
|
|
7
|
+
declare function requiredInteger(props: any, propName: any, componentName: any, location: any): RangeError | null;
|
package/isMuiElement.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export default function isMuiElement(element: any, muiNames: readonly string[]): boolean;
|
|
1
|
+
export default function isMuiElement(element: any, muiNames: readonly string[]): boolean;
|
package/legacy/deepmerge.js
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _typeof from "@babel/runtime/helpers/esm/typeof";
|
|
3
3
|
export function isPlainObject(item) {
|
|
4
|
-
return item !== null && _typeof(item) === 'object' &&
|
|
5
|
-
// @ts-expect-error
|
|
6
|
-
item.constructor === Object;
|
|
4
|
+
return item !== null && _typeof(item) === 'object' && item.constructor === Object;
|
|
7
5
|
}
|
|
8
6
|
export default function deepmerge(target, source) {
|
|
9
7
|
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {
|
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/deepmerge.js
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
export function isPlainObject(item) {
|
|
3
|
-
return item !== null && typeof item === 'object' &&
|
|
4
|
-
// @ts-expect-error
|
|
5
|
-
item.constructor === Object;
|
|
3
|
+
return item !== null && typeof item === 'object' && item.constructor === Object;
|
|
6
4
|
}
|
|
7
5
|
export default function deepmerge(target, source, options = {
|
|
8
6
|
clone: 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/ownerDocument.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export default function ownerDocument(node: Node | null | undefined): Document;
|
|
1
|
+
export default function ownerDocument(node: Node | null | undefined): Document;
|
package/ownerWindow.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export default function ownerWindow(node: Node | undefined): Window;
|
|
1
|
+
export default function ownerWindow(node: Node | undefined): Window;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/utils",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.2.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"author": "MUI Team",
|
|
6
6
|
"description": "Utility functions for React components.",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"react": "^17.0.2"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@babel/runtime": "^7.16.
|
|
28
|
+
"@babel/runtime": "^7.16.3",
|
|
29
29
|
"@types/prop-types": "^15.7.4",
|
|
30
30
|
"@types/react-is": "^16.7.1 || ^17.0.0",
|
|
31
31
|
"prop-types": "^15.7.2",
|
package/ponyfillGlobal.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: any;
|
|
2
|
-
export default _default;
|
|
1
|
+
declare const _default: any;
|
|
2
|
+
export default _default;
|
package/refType.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import PropTypes from 'prop-types';
|
|
2
|
-
declare const refType: PropTypes.Requireable<object>;
|
|
3
|
-
export default refType;
|
|
1
|
+
import PropTypes from 'prop-types';
|
|
2
|
+
declare const refType: PropTypes.Requireable<object>;
|
|
3
|
+
export default refType;
|
package/setRef.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
/**
|
|
3
|
-
* TODO v5: consider making it private
|
|
4
|
-
*
|
|
5
|
-
* passes {value} to {ref}
|
|
6
|
-
*
|
|
7
|
-
* WARNING: Be sure to only call this inside a callback that is passed as a ref.
|
|
8
|
-
* Otherwise, make sure to cleanup the previous {ref} if it changes. See
|
|
9
|
-
* https://github.com/mui-org/material-ui/issues/13539
|
|
10
|
-
*
|
|
11
|
-
* Useful if you want to expose the ref of an inner component to the public API
|
|
12
|
-
* while still using it inside the component.
|
|
13
|
-
* @param ref A ref callback or ref object. If anything falsy, this is a no-op.
|
|
14
|
-
*/
|
|
15
|
-
export default function setRef<T>(ref: React.MutableRefObject<T | null> | ((instance: T | null) => void) | null | undefined, value: T | null): void;
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* TODO v5: consider making it private
|
|
4
|
+
*
|
|
5
|
+
* passes {value} to {ref}
|
|
6
|
+
*
|
|
7
|
+
* WARNING: Be sure to only call this inside a callback that is passed as a ref.
|
|
8
|
+
* Otherwise, make sure to cleanup the previous {ref} if it changes. See
|
|
9
|
+
* https://github.com/mui-org/material-ui/issues/13539
|
|
10
|
+
*
|
|
11
|
+
* Useful if you want to expose the ref of an inner component to the public API
|
|
12
|
+
* while still using it inside the component.
|
|
13
|
+
* @param ref A ref callback or ref object. If anything falsy, this is a no-op.
|
|
14
|
+
*/
|
|
15
|
+
export default function setRef<T>(ref: React.MutableRefObject<T | null> | ((instance: T | null) => void) | null | undefined, value: T | null): void;
|
package/useEventCallback.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* https://github.com/facebook/react/issues/14099#issuecomment-440013892
|
|
3
|
-
*/
|
|
4
|
-
export default function useEventCallback<Args extends unknown[], Return>(fn: (...args: Args) => Return): (...args: Args) => Return;
|
|
1
|
+
/**
|
|
2
|
+
* https://github.com/facebook/react/issues/14099#issuecomment-440013892
|
|
3
|
+
*/
|
|
4
|
+
export default function useEventCallback<Args extends unknown[], Return>(fn: (...args: Args) => Return): (...args: Args) => Return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
package/useForkRef.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
export default function useForkRef<Instance>(refA: React.Ref<Instance> | null | undefined, refB: React.Ref<Instance> | null | undefined): React.Ref<Instance> | null;
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export default function useForkRef<Instance>(refA: React.Ref<Instance> | null | undefined, refB: React.Ref<Instance> | null | undefined): React.Ref<Instance> | null;
|
package/useId.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export default function useId(idOverride?: string): string | undefined;
|
|
1
|
+
export default function useId(idOverride?: string): string | undefined;
|
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,
|
package/usePreviousProps.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const usePreviousProps: (value: object) => object;
|
|
2
|
-
export default usePreviousProps;
|
|
1
|
+
declare const usePreviousProps: (value: object) => object;
|
|
2
|
+
export default usePreviousProps;
|
package/visuallyHidden.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const visuallyHidden: import('react').CSSProperties;
|
|
2
|
-
export default visuallyHidden;
|
|
1
|
+
declare const visuallyHidden: import('react').CSSProperties;
|
|
2
|
+
export default visuallyHidden;
|