@mui/utils 5.1.1 → 5.2.3
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 +265 -3
- 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/index.js +2 -1
- package/esm/resolveProps.js +18 -0
- 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 +33 -32
- package/index.js +9 -1
- package/integerPropType.d.ts +7 -7
- package/isMuiElement.d.ts +1 -1
- package/legacy/deepmerge.js +1 -3
- package/legacy/index.js +3 -2
- package/legacy/resolveProps.js +18 -0
- package/legacy/useId.js +5 -2
- package/legacy/useIsFocusVisible.js +4 -3
- package/modern/deepmerge.js +1 -3
- package/modern/index.js +3 -2
- package/modern/resolveProps.js +18 -0
- 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 +5 -1
- package/ponyfillGlobal.d.ts +2 -2
- package/refType.d.ts +3 -3
- package/resolveProps.d.ts +9 -0
- package/resolveProps.js +26 -0
- 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 +9 -8
- package/useIsFocusVisible.js +1 -1
- package/usePreviousProps.d.ts +2 -2
- package/visuallyHidden.d.ts +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,258 @@
|
|
|
1
1
|
### [Versions](https://mui.com/versions/)
|
|
2
2
|
|
|
3
|
+
## 5.2.3
|
|
4
|
+
|
|
5
|
+
<!-- generated comparing v5.2.2..master -->
|
|
6
|
+
|
|
7
|
+
_Dec 6, 2021_
|
|
8
|
+
|
|
9
|
+
A big thanks to the 25 contributors who made this release possible. Here are some highlights ✨:
|
|
10
|
+
|
|
11
|
+
- ✨ We have introduced a new unstyled component in `@mui/base`: `TablePagination` (#29759) @mnajdova
|
|
12
|
+
|
|
13
|
+
<a href="https://mui.com/components/tables/#unstyled-table"><img width="800" alt="unstyled table" src="https://user-images.githubusercontent.com/4512430/144862194-584356ef-7d9d-462c-a631-186a7e716193.png"></a>
|
|
14
|
+
|
|
15
|
+
You can follow our progress with unstyled components at https://github.com/mui-org/material-ui/issues/27170.
|
|
16
|
+
|
|
17
|
+
- 🎉 We have added an example of how to use MUI with [Remix](https://remix.run/) (#29952) @mnajdova
|
|
18
|
+
|
|
19
|
+
- And many more 🐛 bug fixes and 📚 improvements.
|
|
20
|
+
|
|
21
|
+
### `@mui/material@5.2.3`
|
|
22
|
+
|
|
23
|
+
- ​<!-- 33 -->[Accordion] Add a test for handling `square` prop (#29972) @daniel-sachs
|
|
24
|
+
- ​<!-- 32 -->[Alert] Fix `square` Paper prop (#30027) @ZeeshanTamboli
|
|
25
|
+
- ​<!-- 31 -->[AvatarGroup] Allow specifying total number of avatars (#29898) @eduardomcv
|
|
26
|
+
- ​<!-- 29 -->[Button] Fix regression from context API (#29982) @siriwatknp
|
|
27
|
+
- ​<!-- 13 -->[Grid] Fix generated classes for `spacing` prop when the value is object (#29880) @jayeclark
|
|
28
|
+
- ​<!-- 10 -->[Select] Should not crash when an empty array is passed with `multiple` enabled (#29957) @Domino987
|
|
29
|
+
|
|
30
|
+
### `@mui/system@5.2.3`
|
|
31
|
+
|
|
32
|
+
- ​<!-- 06 -->[system] Fix return type of `createBox` (#29989) @mnajdova
|
|
33
|
+
- ​<!-- 05 -->[system] Support boolean values in typescript for the `sx` prop when used as array (#29911) @tasugi
|
|
34
|
+
|
|
35
|
+
### `@mui/utils@5.2.3`
|
|
36
|
+
|
|
37
|
+
- ​<!-- 03 -->[utils] Add typings for `@mui-material/styles/cssUtils` (#29621) @Semigradsky
|
|
38
|
+
|
|
39
|
+
### `@mui/icons-material@5.2.1`
|
|
40
|
+
|
|
41
|
+
- ​<!-- 12 -->[icons] Consolidate ignored icons into one list (#29843) @chao813
|
|
42
|
+
|
|
43
|
+
### `@mui/base@5.0.0-alpha.59`
|
|
44
|
+
|
|
45
|
+
- ​<!-- 30 -->[base] Fix missing ClickAwayListener barrel index export (#30000) @oliviertassinari
|
|
46
|
+
- ​<!-- 04 -->[TablePaginationUnstyled] Introduce new component (#29759) @mnajdova
|
|
47
|
+
|
|
48
|
+
### `@mui/lab@5.0.0-alpha.59`
|
|
49
|
+
|
|
50
|
+
- ​<!-- 27 -->[DateRangePicker] Fix `DateRangePickerDayProps` interface (#29067) @jonathanrtuck
|
|
51
|
+
- ​<!-- 10 -->[Pickers] Remove propagation of custom props to the `MonthPicker` component's DOM element (#30021) @ZeeshanTamboli
|
|
52
|
+
- ​<!-- 08 -->[StaticDatePicker] Add className and slot to PickerStaticWrapper (#29619) @kkorach
|
|
53
|
+
|
|
54
|
+
### `@mui/joy@5.0.0-alpha.5`
|
|
55
|
+
|
|
56
|
+
- ​<!-- 11 -->[Joy] Theme setup (#29846) @siriwatknp
|
|
57
|
+
|
|
58
|
+
### Docs
|
|
59
|
+
|
|
60
|
+
- ​<!-- 34 -->[docs] Fix link in TypeScript doc page (#30044) @genzyy
|
|
61
|
+
- ​<!-- 26 -->[docs] Remove the 'WIP' icon from the 'Group & Pivot' page title (#30077) @flaviendelangle
|
|
62
|
+
- ​<!-- 25 -->[docs] Add warning that `@mui/styled-engine-sc` does not work in SSR (#30026) @mnajdova
|
|
63
|
+
- ​<!-- 24 -->[docs] Add section for CSS specificity in the migration guide (#30008) @hbjORbj
|
|
64
|
+
- ​<!-- 28 -->[docs] Clarify comment in migration doc (#30076) @hbjORbj
|
|
65
|
+
- ​<!-- 23 -->[docs] Sync translations with Crowdin (#30041) @l10nbot
|
|
66
|
+
- ​<!-- 22 -->[docs] Explain how Paper changes shade in dark mode (#30003) @michaldudak
|
|
67
|
+
- ​<!-- 21 -->[docs] Update nextjs-typescript-example (#29974) @huydhoang
|
|
68
|
+
- ​<!-- 20 -->[docs] Add missing global state classes to API docs generator (#29945) @michaldudak
|
|
69
|
+
- ​<!-- 19 -->[docs] Fix benchmarks folder link (#29981) @fourjr
|
|
70
|
+
- ​<!-- 18 -->[docs] Improve wording in StackOverflow section of support page (#29956) @ronwarner
|
|
71
|
+
- ​<!-- 17 -->[docs] Remove Black Friday sale notification (#29936) @mbrookes
|
|
72
|
+
- ​<!-- 16 -->[examples] Fix typos in the Remix example (#30071) @MichaelDeBoey
|
|
73
|
+
- ​<!-- 15 -->[examples] Add Remix example (#29952) @mnajdova
|
|
74
|
+
- ​<!-- 14 -->[examples] Fix lint issue for displayName missing in the Next.js examples (#29985) @ZeeshanTamboli
|
|
75
|
+
- ​<!-- 09 -->[Stack] Document system props in Stack API (#30069) @ThewBear
|
|
76
|
+
- ​<!-- 07 -->[survey] Add a banner and card for promoting the 2021 survey (#29950) @danilo-leal
|
|
77
|
+
- ​<!-- 02 -->[website] Correct the Careers page description (#30073) @michaldudak
|
|
78
|
+
- ​<!-- 01 -->[website] Fix 301 links (#30040) @oliviertassinari
|
|
79
|
+
|
|
80
|
+
### Core
|
|
81
|
+
|
|
82
|
+
- ​<!-- 31 -->[core] Batch small changes (#30042) @oliviertassinari
|
|
83
|
+
- ​<!-- 28 -->[core] Transition to a new StackOverflow tag (#29967) @oliviertassinari
|
|
84
|
+
|
|
85
|
+
All contributors of this release in alphabetical order: @chao813, @daniel-sachs, @danilo-leal, @Domino987, @eduardomcv, @flaviendelangle, @fourjr, @genzyy, @hbjORbj, @huydhoang, @jayeclark, @jonathanrtuck, @kkorach, @l10nbot, @mbrookes, @MichaelDeBoey, @michaldudak, @mnajdova, @oliviertassinari, @ronwarner, @Semigradsky, @siriwatknp, @tasugi, @ThewBear, @ZeeshanTamboli
|
|
86
|
+
|
|
87
|
+
## 5.2.2
|
|
88
|
+
|
|
89
|
+
<!-- generated comparing v5.2.1..master -->
|
|
90
|
+
|
|
91
|
+
_Nov 29, 2021_
|
|
92
|
+
|
|
93
|
+
A big thanks to the 9 contributors who made this release possible. Here are some highlights ✨:
|
|
94
|
+
|
|
95
|
+
- ♿️ Improved accessibility of `Snackbar` and `TextField` in `@mui/material` (#29782) (#29850) (#29852) @eps1lon.
|
|
96
|
+
- 🎉 Added support for `sx` syntax inside `styled()` utility (#29833) @mnajdova.
|
|
97
|
+
- 🎉 Added support for more options for `createCssVarsProvider` in `@mui/system` (#29845) (#29857) @hbjORbj.
|
|
98
|
+
- And many more 🐛 bug fixes and 📚 improvements.
|
|
99
|
+
|
|
100
|
+
### `@mui/material@5.2.2`
|
|
101
|
+
|
|
102
|
+
- ​<!-- 14 -->[MenuList] Add component prop (#29882) @Harshikerfuffle
|
|
103
|
+
- ​<!-- 13 -->[Snackbar] Interrupt auto-hide on keyboard interaction (#29852) @eps1lon
|
|
104
|
+
- ​<!-- 12 -->[Snackbar] Dismiss on Escape press (#29850) @eps1lon
|
|
105
|
+
- ​<!-- 06 -->[TextField] Associate accessible name and description by default (#29782) @eps1lon
|
|
106
|
+
|
|
107
|
+
### `@mui/joy@5.0.0-alpha.4`
|
|
108
|
+
|
|
109
|
+
- ​<!-- 15 -->[Joy] Add `Button` - 1st iteration (#29464) @siriwatknp
|
|
110
|
+
|
|
111
|
+
### `@mui/codemod@5.2.1`
|
|
112
|
+
|
|
113
|
+
- ​<!-- 28 -->[codemod] Fix alias import for box-sx-prop (#29902) @siriwatknp
|
|
114
|
+
|
|
115
|
+
### `@mui/system@5.2.2`
|
|
116
|
+
|
|
117
|
+
- ​<!-- 11 -->[system] CSSVarsProvider cleans up `html[style]` when unmounting (#29946) @eps1lon
|
|
118
|
+
- ​<!-- 10 -->[system] Add support for `disableTransitionOnChange` in `createCssVarsProvider` (#29857) @hbjORbj
|
|
119
|
+
- ​<!-- 09 -->[system] Add support for `enableColorScheme` in `createCssVarsProvider` (#29845) @hbjORbj
|
|
120
|
+
|
|
121
|
+
### `@mui/utils@5.2.2`
|
|
122
|
+
|
|
123
|
+
- ​<!-- 05 -->[useId] Trade random collisions for collisions on overflow (#29781) @eps1lon
|
|
124
|
+
- ​<!-- 04 -->[useIsFocusVisible] Convert to TypeScript (#29779) @eps1lon
|
|
125
|
+
|
|
126
|
+
### Docs
|
|
127
|
+
|
|
128
|
+
- ​<!-- 24 -->[docs] Fix v5-beta confusing example description (#29932) @oliviertassinari
|
|
129
|
+
- ​<!-- 23 -->[docs] Apply the z-index on the right DOM element (#29934) @oliviertassinari
|
|
130
|
+
- ​<!-- 22 -->[docs] Improve git diff format (#29935) @oliviertassinari
|
|
131
|
+
- ​<!-- 21 -->[docs] Fix typo (#29866) @sinclairity
|
|
132
|
+
- ​<!-- 20 -->[docs] Fix key display (#29933) @oliviertassinari
|
|
133
|
+
- ​<!-- 19 -->[docs] Fix outdated link to next/link docs (#29937) @radlinskii
|
|
134
|
+
- ​<!-- 18 -->[docs] Add how to pass `sx` prop (#29905) @siriwatknp
|
|
135
|
+
- ​<!-- 17 -->[docs] Fix typo in notifications @mbrookes
|
|
136
|
+
- ​<!-- 16 -->[docs] Black Friday sale notification @mbrookes
|
|
137
|
+
- ​<!-- 03 -->[website] Fix canonical links (#29938) @oliviertassinari
|
|
138
|
+
- ​<!-- 02 -->[website] Fix SEO issues (#29939) @oliviertassinari
|
|
139
|
+
- ​<!-- 01 -->[website] Improvements to the /x product page (#28964) @danilo-leal
|
|
140
|
+
|
|
141
|
+
### Core
|
|
142
|
+
|
|
143
|
+
- ​<!-- 27 -->[core] Remove dead code (#29940) @oliviertassinari
|
|
144
|
+
- ​<!-- 26 -->[core] Move benchmark CI job from AZP to CircleCI (#29894) @eps1lon
|
|
145
|
+
- ​<!-- 25 -->[core] Fix PR detection pattern in test_bundle_size_monitor (#29895) @eps1lon
|
|
146
|
+
- ​<!-- 08 -->[test] Fix browser tests (#29929) @eps1lon
|
|
147
|
+
- ​<!-- 07 -->[test] Reject shorthand properties in style matchers (#29893) @eps1lon
|
|
148
|
+
|
|
149
|
+
All contributors of this release in alphabetical order: @danilo-leal, @eps1lon, @Harshikerfuffle, @hbjORbj, @mbrookes, @oliviertassinari, @radlinskii, @sinclairity, @siriwatknp
|
|
150
|
+
|
|
151
|
+
## 5.2.1
|
|
152
|
+
|
|
153
|
+
<!-- generated comparing v5.2.0..master -->
|
|
154
|
+
|
|
155
|
+
_Nov 25, 2021_
|
|
156
|
+
|
|
157
|
+
A big thanks to the 7 contributors who made this release possible. Here are some highlights ✨:
|
|
158
|
+
|
|
159
|
+
This is an early release to fix `export 'useId' (imported as 'React') was not found in 'react'` when bundling code depending on MUI Core.
|
|
160
|
+
|
|
161
|
+
- ​<!-- 10 -->[AppBar][docs] Add a fully responsive demo to docs (#29829) @karakib2k18
|
|
162
|
+
- ​<!-- 9 -->[core] Fix PR run detection in test_bundle_size_monitor (#29879) @eps1lon
|
|
163
|
+
- ​<!-- 8 -->[core] Move bundle size monitoring to CircleCI (#29876) @eps1lon
|
|
164
|
+
- ​<!-- 7 -->[docs] Add keys to Responsive AppBar demo (#29884) @mbrookes
|
|
165
|
+
- ​<!-- 6 -->[docs] MUI's 2021 Developer survey (#29765) @newguy-123
|
|
166
|
+
- ​<!-- 5 -->[docs] Smoother image loading UX (#29858) @oliviertassinari
|
|
167
|
+
- ​<!-- 4 -->[Select] Fix select display value with React Nodes (#29836) @kegi
|
|
168
|
+
- ​<!-- 3 -->[system] Add `experimental_sx` utility (#29833) @mnajdova
|
|
169
|
+
- ​<!-- 2 -->[test] Ignore "detected multiple renderers" warning for now (#29854) @eps1lon
|
|
170
|
+
- ​<!-- 1 -->[useMediaQuery][utils] Remove usage of React 18 APIs (#29870) @eps1lon
|
|
171
|
+
|
|
172
|
+
All contributors of this release in alphabetical order: @eps1lon, @karakib2k18, @kegi, @mbrookes, @mnajdova, @newguy-123, @oliviertassinari
|
|
173
|
+
|
|
174
|
+
## 5.2.0
|
|
175
|
+
|
|
176
|
+
<!-- generated comparing v5.1.1..master -->
|
|
177
|
+
|
|
178
|
+
_Nov 23, 2021_
|
|
179
|
+
|
|
180
|
+
A big thanks to the 18 contributors who made this release possible. Here are some highlights ✨:
|
|
181
|
+
|
|
182
|
+
- 🧪 Created another unstyled component: [TabsUnstyled](https://mui.com/components/tabs/#unstyled) (#29597) @mnajdova.
|
|
183
|
+
- 🎉 Updated the Material Icons set with the latest changes from Google (#29328) @michaldudak / (#29818) @chao813.
|
|
184
|
+
This update adds 200 new icons and tweaks the appearance of many more.
|
|
185
|
+
With it, we're getting close to having 2000 icons in our set.
|
|
186
|
+
- 🐛 Fixed bugs and improved the infrastructure and documentation 📚.
|
|
187
|
+
|
|
188
|
+
### `@mui/material@5.2.0`
|
|
189
|
+
|
|
190
|
+
- [IconButton] Remove on hover effect when `disableRipple` is set (#29298) @adamfitzgibbon
|
|
191
|
+
- [i18n] Add the amharic language (#29153) @NatiG100
|
|
192
|
+
- [material] Fix types for `variants.style` to accept callbacks (#29610) @mnajdova
|
|
193
|
+
- [Popper] Simplify prop types (#29680) @michaldudak
|
|
194
|
+
- [Select] Include aria-selected=false when option not selected (#29695) @michaldudak
|
|
195
|
+
- [useMediaQuery] Fix crash in Safari < 14 and IE 11 (#29776) @eps1lon
|
|
196
|
+
- [useMediaQuery] Ensure no tearing in React 18 (#28491) @eps1lon
|
|
197
|
+
|
|
198
|
+
### `@mui/codemod@5.2.0`
|
|
199
|
+
|
|
200
|
+
- [codemod] Fix `jss-to-styled` to support multiple withStyles (#29824) @siriwatknp
|
|
201
|
+
|
|
202
|
+
### `@mui/icons-material@5.2.0`
|
|
203
|
+
|
|
204
|
+
- [icons] Sync new Google Material Icons (#29818) @chao813
|
|
205
|
+
- [icons] Sync recent Material Icons from Google (#29328) @michaldudak
|
|
206
|
+
|
|
207
|
+
### `@mui/system@5.2.0`
|
|
208
|
+
|
|
209
|
+
- [Box] Fix `sx` prop runtime issue when used as function (#29830) @mnajdova
|
|
210
|
+
- [system] Fix `sx` throw error when value is `null` or `undefined` (#29756) @siriwatknp
|
|
211
|
+
- [system] Fix minor CssVars issues (#29747) @siriwatknp
|
|
212
|
+
|
|
213
|
+
### `@mui/styled-engine@5.2.0`
|
|
214
|
+
|
|
215
|
+
- [styled-engine] Fix props inference in styled-engine (#29739) @Janpot
|
|
216
|
+
|
|
217
|
+
### `@mui/base@5.0.0-alpha.56`
|
|
218
|
+
|
|
219
|
+
- [FormControlUnstyled] `focused` is always false unless explicitly set to `true` @mwilkins91
|
|
220
|
+
- [TabsUnstyled] Introduce new component (#29597) @mnajdova
|
|
221
|
+
|
|
222
|
+
### `@mui/lab@5.0.0-alpha.56`
|
|
223
|
+
|
|
224
|
+
- [DatePicker][timepicker] Add missing component declarations (#29517) @longzheng
|
|
225
|
+
- [Masonry] exports from root package (#29754) @abhinav-22-tech
|
|
226
|
+
- [pickers] Widen accepted `luxon` version range (#29761) @eps1lon
|
|
227
|
+
|
|
228
|
+
### Docs
|
|
229
|
+
|
|
230
|
+
- [blog] MUI X v5 blog post (#29590) @DanailH
|
|
231
|
+
- [blog] Polish the Benny Joo joins MUI post (#29697) @oliviertassinari
|
|
232
|
+
- [CHANGELOG] Explain why we do breaking changes @oliviertassinari
|
|
233
|
+
- [core] Update latest issue template for codesandbox CI (#29783) @eps1lon
|
|
234
|
+
- [core] Ensure `@mui/core` is an alias for `@mui/base` (#29762) @eps1lon
|
|
235
|
+
- [docs] Fix broken Next and Previous links (#29711) @scallaway
|
|
236
|
+
- [docs] Add a note that ToggleButton exclusive does not enforce selection (#29812) @mmacu
|
|
237
|
+
- [docs] Update the list of supported locales (#29831) @michaldudak
|
|
238
|
+
- [docs] Update tooltip doc to better define touch action (#29717) @gnowland
|
|
239
|
+
- [website] Standardize the background color from the MUI team photos (#29738) @danilo-leal
|
|
240
|
+
- [website] Add Bharat to the About Us Page (#29714) @bharatkashyap
|
|
241
|
+
- [website] Add about page entry for jan (#29701) @Janpot
|
|
242
|
+
- [website] Adding Prakhar to the about page (#29737) @danilo-leal
|
|
243
|
+
|
|
244
|
+
### Core
|
|
245
|
+
|
|
246
|
+
- [test] Allow debugging with Chrome and VSCode inspector (#29777) @eps1lon
|
|
247
|
+
- [test] Use renderer clock instead of custom useFakeTimers call (#29778) @eps1lon
|
|
248
|
+
- [test] Only mock Date in regression tests (#29763) @eps1lon
|
|
249
|
+
- [test] Disable nightly integration tests on `next` branch (#29748) @eps1lon
|
|
250
|
+
- [test] Allow configuring clock directly from `createRenderer` (#29684) @eps1lon
|
|
251
|
+
- [test] Accept backslashes as path separators in test CLI (#29694) @michaldudak
|
|
252
|
+
- [utils] Use built-in hook when available for useId (#26489) @eps1lon
|
|
253
|
+
|
|
254
|
+
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
|
|
255
|
+
|
|
3
256
|
## 5.1.1
|
|
4
257
|
|
|
5
258
|
<!-- generated comparing v5.1.0..master -->
|
|
@@ -8,7 +261,7 @@ _Nov 16, 2021_
|
|
|
8
261
|
|
|
9
262
|
A big thanks to the 15 contributors who made this release possible. Here are some highlights ✨:
|
|
10
263
|
|
|
11
|
-
- 🛠
|
|
264
|
+
- 🛠 Renamed `@mui/core` to `@mui/base` (#29585) @michaldudak.
|
|
12
265
|
- And many more 🐛 bug fixes and 📚 improvements.
|
|
13
266
|
|
|
14
267
|
### `@mui/material@5.1.1`
|
|
@@ -22,10 +275,19 @@ A big thanks to the 15 contributors who made this release possible. Here are som
|
|
|
22
275
|
|
|
23
276
|
### `@mui/base@5.0.0-alpha.55`
|
|
24
277
|
|
|
25
|
-
####
|
|
278
|
+
#### Breaking changes
|
|
26
279
|
|
|
27
280
|
- ​<!-- 27 -->[core] Rename mui/core to mui/base (#29585) @michaldudak
|
|
28
281
|
|
|
282
|
+
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.
|
|
283
|
+
|
|
284
|
+
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.
|
|
285
|
+
|
|
286
|
+
```diff
|
|
287
|
+
-import { useSwitch } from '@mui/core/SwitchUnstyled';
|
|
288
|
+
+import { useSwitch } from '@mui/base/SwitchUnstyled';
|
|
289
|
+
```
|
|
290
|
+
|
|
29
291
|
### `@mui/lab@5.0.0-alpha.55`
|
|
30
292
|
|
|
31
293
|
- ​<!-- 12 -->[LoadingButton] Text variant spacing fixed for both start and end (#29194) @joshua-lawrence
|
|
@@ -1890,7 +2152,7 @@ _May 31, 2021_
|
|
|
1890
2152
|
A big thanks to the 14 contributors who made this release possible. Here are some highlights ✨:
|
|
1891
2153
|
|
|
1892
2154
|
- 👩🎤 We have completed the migration to emotion of all the components (`@material-ui/core` and `@material-ui/lab`) @siriwatknp, @mnajdova.
|
|
1893
|
-
- 📦 Save [10 kB gzipped](https://bundlephobia.com/
|
|
2155
|
+
- 📦 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.
|
|
1894
2156
|
- ⚒️ 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.
|
|
1895
2157
|
- And many more 🐛 bug fixes and 📚 improvements.
|
|
1896
2158
|
|
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/index.js
CHANGED
|
@@ -29,4 +29,5 @@ export { default as unstable_getScrollbarSize } from './getScrollbarSize';
|
|
|
29
29
|
export { detectScrollType as unstable_detectScrollType, getNormalizedScrollLeft as unstable_getNormalizedScrollLeft } from './scrollLeft';
|
|
30
30
|
export { default as usePreviousProps } from './usePreviousProps';
|
|
31
31
|
export { default as visuallyHidden } from './visuallyHidden';
|
|
32
|
-
export { default as integerPropType } from './integerPropType';
|
|
32
|
+
export { default as integerPropType } from './integerPropType';
|
|
33
|
+
export { default as internal_resolveProps } from './resolveProps';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Add keys, values of `defaultProps` that does not exist in `props`
|
|
5
|
+
* @param {object} defaultProps
|
|
6
|
+
* @param {object} props
|
|
7
|
+
* @returns {object} resolved props
|
|
8
|
+
*/
|
|
9
|
+
export default function resolveProps(defaultProps, props) {
|
|
10
|
+
const output = _extends({}, props);
|
|
11
|
+
|
|
12
|
+
Object.keys(defaultProps).forEach(propName => {
|
|
13
|
+
if (output[propName] === undefined) {
|
|
14
|
+
output[propName] = defaultProps[propName];
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
return output;
|
|
18
|
+
}
|
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,33 @@
|
|
|
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';
|
|
33
|
+
export { default as internal_resolveProps } from './resolveProps';
|
package/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MUI v5.
|
|
1
|
+
/** @license MUI v5.2.3
|
|
2
2
|
*
|
|
3
3
|
* This source code is licensed under the MIT license found in the
|
|
4
4
|
* LICENSE file in the root directory of this source tree.
|
|
@@ -64,6 +64,12 @@ Object.defineProperty(exports, "integerPropType", {
|
|
|
64
64
|
return _integerPropType.default;
|
|
65
65
|
}
|
|
66
66
|
});
|
|
67
|
+
Object.defineProperty(exports, "internal_resolveProps", {
|
|
68
|
+
enumerable: true,
|
|
69
|
+
get: function () {
|
|
70
|
+
return _resolveProps.default;
|
|
71
|
+
}
|
|
72
|
+
});
|
|
67
73
|
Object.defineProperty(exports, "isPlainObject", {
|
|
68
74
|
enumerable: true,
|
|
69
75
|
get: function () {
|
|
@@ -271,6 +277,8 @@ var _visuallyHidden = _interopRequireDefault(require("./visuallyHidden"));
|
|
|
271
277
|
|
|
272
278
|
var _integerPropType = _interopRequireDefault(require("./integerPropType"));
|
|
273
279
|
|
|
280
|
+
var _resolveProps = _interopRequireDefault(require("./resolveProps"));
|
|
281
|
+
|
|
274
282
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
275
283
|
|
|
276
284
|
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; }
|
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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MUI v5.
|
|
1
|
+
/** @license MUI v5.2.3
|
|
2
2
|
*
|
|
3
3
|
* This source code is licensed under the MIT license found in the
|
|
4
4
|
* LICENSE file in the root directory of this source tree.
|
|
@@ -34,4 +34,5 @@ export { default as unstable_getScrollbarSize } from './getScrollbarSize';
|
|
|
34
34
|
export { detectScrollType as unstable_detectScrollType, getNormalizedScrollLeft as unstable_getNormalizedScrollLeft } from './scrollLeft';
|
|
35
35
|
export { default as usePreviousProps } from './usePreviousProps';
|
|
36
36
|
export { default as visuallyHidden } from './visuallyHidden';
|
|
37
|
-
export { default as integerPropType } from './integerPropType';
|
|
37
|
+
export { default as integerPropType } from './integerPropType';
|
|
38
|
+
export { default as internal_resolveProps } from './resolveProps';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Add keys, values of `defaultProps` that does not exist in `props`
|
|
5
|
+
* @param {object} defaultProps
|
|
6
|
+
* @param {object} props
|
|
7
|
+
* @returns {object} resolved props
|
|
8
|
+
*/
|
|
9
|
+
export default function resolveProps(defaultProps, props) {
|
|
10
|
+
var output = _extends({}, props);
|
|
11
|
+
|
|
12
|
+
Object.keys(defaultProps).forEach(function (propName) {
|
|
13
|
+
if (output[propName] === undefined) {
|
|
14
|
+
output[propName] = defaultProps[propName];
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
return output;
|
|
18
|
+
}
|
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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MUI v5.
|
|
1
|
+
/** @license MUI v5.2.3
|
|
2
2
|
*
|
|
3
3
|
* This source code is licensed under the MIT license found in the
|
|
4
4
|
* LICENSE file in the root directory of this source tree.
|
|
@@ -34,4 +34,5 @@ export { default as unstable_getScrollbarSize } from './getScrollbarSize';
|
|
|
34
34
|
export { detectScrollType as unstable_detectScrollType, getNormalizedScrollLeft as unstable_getNormalizedScrollLeft } from './scrollLeft';
|
|
35
35
|
export { default as usePreviousProps } from './usePreviousProps';
|
|
36
36
|
export { default as visuallyHidden } from './visuallyHidden';
|
|
37
|
-
export { default as integerPropType } from './integerPropType';
|
|
37
|
+
export { default as integerPropType } from './integerPropType';
|
|
38
|
+
export { default as internal_resolveProps } from './resolveProps';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Add keys, values of `defaultProps` that does not exist in `props`
|
|
5
|
+
* @param {object} defaultProps
|
|
6
|
+
* @param {object} props
|
|
7
|
+
* @returns {object} resolved props
|
|
8
|
+
*/
|
|
9
|
+
export default function resolveProps(defaultProps, props) {
|
|
10
|
+
const output = _extends({}, props);
|
|
11
|
+
|
|
12
|
+
Object.keys(defaultProps).forEach(propName => {
|
|
13
|
+
if (output[propName] === undefined) {
|
|
14
|
+
output[propName] = defaultProps[propName];
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
return output;
|
|
18
|
+
}
|
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.3",
|
|
4
4
|
"private": false,
|
|
5
5
|
"author": "MUI Team",
|
|
6
6
|
"description": "Utility functions for React components.",
|
|
@@ -21,6 +21,10 @@
|
|
|
21
21
|
"url": "https://github.com/mui-org/material-ui/issues"
|
|
22
22
|
},
|
|
23
23
|
"homepage": "https://github.com/mui-org/material-ui/tree/master/packages/mui-utils",
|
|
24
|
+
"funding": {
|
|
25
|
+
"type": "opencollective",
|
|
26
|
+
"url": "https://opencollective.com/mui"
|
|
27
|
+
},
|
|
24
28
|
"peerDependencies": {
|
|
25
29
|
"react": "^17.0.2"
|
|
26
30
|
},
|
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;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Add keys, values of `defaultProps` that does not exist in `props`
|
|
3
|
+
* @param {object} defaultProps
|
|
4
|
+
* @param {object} props
|
|
5
|
+
* @returns {object} resolved props
|
|
6
|
+
*/
|
|
7
|
+
export default function resolveProps<T extends {
|
|
8
|
+
className?: string;
|
|
9
|
+
} & Record<string, unknown>>(defaultProps: T, props: T): T;
|
package/resolveProps.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = resolveProps;
|
|
9
|
+
|
|
10
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Add keys, values of `defaultProps` that does not exist in `props`
|
|
14
|
+
* @param {object} defaultProps
|
|
15
|
+
* @param {object} props
|
|
16
|
+
* @returns {object} resolved props
|
|
17
|
+
*/
|
|
18
|
+
function resolveProps(defaultProps, props) {
|
|
19
|
+
const output = (0, _extends2.default)({}, props);
|
|
20
|
+
Object.keys(defaultProps).forEach(propName => {
|
|
21
|
+
if (output[propName] === undefined) {
|
|
22
|
+
output[propName] = defaultProps[propName];
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
return output;
|
|
26
|
+
}
|
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
|
-
import * as React from 'react';
|
|
2
|
-
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
1
|
+
import * as React from 'react';
|
|
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;
|