@mui/system 5.0.2 → 5.0.6

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.
Files changed (64) hide show
  1. package/Box/Box.spec.d.ts +1 -1
  2. package/CHANGELOG.md +251 -0
  3. package/LICENSE +21 -21
  4. package/borders.js +1 -1
  5. package/breakpoints.js +4 -3
  6. package/colorManipulator.js +8 -8
  7. package/createStyled.d.ts +16 -215
  8. package/createStyled.js +6 -2
  9. package/createTheme/createBreakpoints.d.ts +53 -6
  10. package/createTheme/createBreakpoints.js +1 -1
  11. package/createTheme/createSpacing.d.ts +10 -10
  12. package/cssVars/createCssVarsProvider.d.ts +81 -0
  13. package/cssVars/createCssVarsProvider.js +206 -0
  14. package/cssVars/createCssVarsProvider.spec.d.ts +1 -0
  15. package/cssVars/cssVarsParser.d.ts +57 -0
  16. package/cssVars/cssVarsParser.js +126 -0
  17. package/cssVars/getInitColorSchemeScript.d.ts +7 -0
  18. package/cssVars/getInitColorSchemeScript.js +38 -0
  19. package/cssVars/index.d.ts +2 -0
  20. package/cssVars/index.js +15 -0
  21. package/cssVars/package.json +6 -0
  22. package/display.js +1 -1
  23. package/esm/createStyled.js +5 -1
  24. package/esm/cssVars/createCssVarsProvider.js +188 -0
  25. package/esm/cssVars/cssVarsParser.js +112 -0
  26. package/esm/cssVars/getInitColorSchemeScript.js +21 -0
  27. package/esm/cssVars/index.js +1 -0
  28. package/esm/index.js +2 -1
  29. package/esm/spacing.js +2 -2
  30. package/esm/styleFunctionSx/styleFunctionSx.js +6 -6
  31. package/flexbox.js +1 -1
  32. package/getThemeValue.js +1 -1
  33. package/grid.js +1 -1
  34. package/index.d.ts +6 -0
  35. package/index.js +77 -68
  36. package/index.spec.d.ts +1 -1
  37. package/legacy/createStyled.js +5 -1
  38. package/legacy/cssVars/createCssVarsProvider.js +202 -0
  39. package/legacy/cssVars/cssVarsParser.js +125 -0
  40. package/legacy/cssVars/getInitColorSchemeScript.js +18 -0
  41. package/legacy/cssVars/index.js +1 -0
  42. package/legacy/index.js +3 -2
  43. package/legacy/spacing.js +2 -2
  44. package/legacy/styleFunctionSx/styleFunctionSx.js +6 -6
  45. package/modern/createStyled.js +5 -1
  46. package/modern/cssVars/createCssVarsProvider.js +188 -0
  47. package/modern/cssVars/cssVarsParser.js +112 -0
  48. package/modern/cssVars/getInitColorSchemeScript.js +21 -0
  49. package/modern/cssVars/index.js +1 -0
  50. package/modern/index.js +3 -2
  51. package/modern/spacing.js +2 -2
  52. package/modern/styleFunctionSx/styleFunctionSx.js +6 -6
  53. package/package.json +3 -3
  54. package/palette.js +1 -1
  55. package/positions.js +1 -1
  56. package/sizing.js +1 -1
  57. package/spacing.d.ts +12 -0
  58. package/spacing.js +5 -5
  59. package/style.d.ts +2 -2
  60. package/style.js +1 -1
  61. package/styleFunctionSx/styleFunctionSx.d.ts +6 -1
  62. package/styleFunctionSx/styleFunctionSx.js +6 -6
  63. package/typography.js +1 -1
  64. package/useTheme.js +1 -1
package/Box/Box.spec.d.ts CHANGED
@@ -1 +1 @@
1
- export {};
1
+ export {};
package/CHANGELOG.md CHANGED
@@ -1,5 +1,256 @@
1
1
  ### [Versions](https://mui.com/versions/)
2
2
 
3
+ ## 5.0.6
4
+
5
+ <!-- generated comparing v5.0.5..master -->
6
+
7
+ _Oct 27, 2021_
8
+
9
+ A big thanks to the 4 contributors who made this release possible. Here are some highlights ✨:
10
+
11
+ - 🔧 Fix reported TypeScript issues on the `@mui/system` package because some packages were not released
12
+
13
+ ### `@mui/material@5.0.6`
14
+
15
+ - &#8203;<!-- 4 -->[Autocomplete] Fix `clearOnBlur` prop (#29208) @hbjORbj
16
+ - &#8203;<!-- 2 -->[Rating] Remove z-index from decimal stars (#29295) @williamhaley
17
+
18
+ ### `@mui/system@5.0.6`
19
+
20
+ - &#8203;<!-- 5 -->[system] Fix various issues reported by using @mui/styled-engine-sc (#29035) @mnajdova
21
+ - &#8203;<!-- 1 -->[system] Fix executing server-side Emotion component as function interpolation (#29290) @Andarist
22
+
23
+ ### Docs
24
+
25
+ - &#8203;<!-- 3 -->[blog] Q3 2021 Update (#28970) @oliviertassinari
26
+
27
+ All contributors of this release in alphabetical order: @Andarist, @hbjORbj, @oliviertassinari, @williamhaley
28
+
29
+ ## 5.0.5
30
+
31
+ <!-- generated comparing v5.0.4..master -->
32
+
33
+ _Oct 26, 2021_
34
+
35
+ A big thanks to the 19 contributors who made this release possible. Here are some highlights ✨:
36
+
37
+ - 🔧 Implement `Masonry` using Flexbox by @hbjORbj.
38
+ - 🧪 Add three components to `@mui/core` by @rebeccahongsf and @hbjORbj.
39
+
40
+ ### `@mui/codemod@5.0.5`
41
+
42
+ - &#8203;<!-- 38 -->[codemod] Support new package name in `link-underline-hover` transformer (#29214) @siriwatknp
43
+
44
+ ### `@mui/core@5.0.0-alpha.52`
45
+
46
+ - &#8203;<!-- 39 -->[ClickAwayListener] Move to the core package (#29186) @hbjORbj
47
+ - &#8203;<!-- 13 -->[Popper] Move from mui-material to mui-core (#28923) @rebeccahongsf
48
+ - &#8203;<!-- 04 -->[TextareaAutosize] Move to the core package (#29148) @hbjORbj
49
+
50
+ ### `@mui/lab@5.0.0-alpha.52`
51
+
52
+ - &#8203;<!-- 16 -->[Masonry] Improve demo styles (#29218) @hbjORbj
53
+ - &#8203;<!-- 15 -->[Masonry] Implement Masonry using Flexbox (#28059) @hbjORbj
54
+
55
+ ### `@mui/icons@5.0.5`
56
+
57
+ - &#8203;<!-- 19 -->[icons] Add TipsAndUpdates icon (#29004) @hbjORbj
58
+
59
+ ### `@mui/material@5.0.5`
60
+
61
+ - &#8203;<!-- 40 -->[CardMedia] Apply specified `img` role instead of custom `image` role (#29172) @eps1lon
62
+ - &#8203;<!-- 32 -->[CSSBaseline] Remove incorrect @deprecated annotation (#29069) @adamfitzgibbon
63
+ - &#8203;<!-- 20 -->[Grid] Support custom columns with nested grid (#28743) @Devesh21700Kumar
64
+ - &#8203;<!-- 18 -->[InputBase] Remove wrong theme overriding with MUI's default theme (#29157) @hbjORbj
65
+ - &#8203;<!-- 17 -->[LoadingButton] Fix `fullWidth` styling (#28652) @nikitabobers
66
+ - &#8203;<!-- 16 -->[Popper] make Popper display:none whenever it's closed (#29233) @adamfitzgibbon
67
+ - &#8203;<!-- 14 -->[Menu] Reduce min-height & padding in menu-item with dense property (#29180) @jatinsandilya
68
+ - &#8203;<!-- 07 -->[Tab] `iconPosition` prop added in Tab (#28764) @deepanshu2506
69
+ - &#8203;<!-- 03 -->[Tooltip] Correct inconsistent prop precedence (#29132) @michaldudak
70
+
71
+ ### `@mui/system@5.0.5`
72
+
73
+ - &#8203;<!-- 11 -->[system] Allow function type for `sx` prop (#29198) @hbjORbj
74
+ - &#8203;<!-- 10 -->[system] Fix various issues reported by using @mui/styled-engine-sc (#29035) @mnajdova
75
+ - &#8203;<!-- 09 -->[system] Fix `colorScheme` conflict between application (#29139) @siriwatknp
76
+ - &#8203;<!-- 08 -->[system] Add `unstable_createCssVarsProvider` api (#28965) @siriwatknp
77
+
78
+ ### Documentation
79
+
80
+ - &#8203;<!-- 31 -->[docs] Fix path to `DataGrid` CSV export options page (#29220) @DanailH
81
+ - &#8203;<!-- 30 -->[docs] Give anonymous components a name (#29189) @eps1lon
82
+ - &#8203;<!-- 29 -->[docs] Add deploy context variables (#29195) @siriwatknp
83
+ - &#8203;<!-- 28 -->[docs] Add MUI packages explanation (#29073) @siriwatknp
84
+ - &#8203;<!-- 27 -->[docs] Fix typo in CSP policy (#29187) @JuliaNeumann
85
+ - &#8203;<!-- 26 -->[docs] Dark mode conditional content rendering (#28665) @michal-perlakowski
86
+ - &#8203;<!-- 25 -->[docs] Fix ClassNameGenerator introduced version #29177 @siriwatknp
87
+ - &#8203;<!-- 24 -->[docs] Add missing `justifyContent` values and update box styling (#29117) @omarmosid
88
+ - &#8203;<!-- 23 -->[docs] Make landing page hero section scrollable (#29141) @waxidiotic
89
+ - &#8203;<!-- 22 -->[docs] Discourage importing different bundles directly (#29133) @eps1lon
90
+ - &#8203;<!-- 21 -->[docs] Update module augmentation reference url (#29064) @gnowland
91
+ - &#8203;<!-- 12 -->[pricing] Add tooltip to pricing icon (#28959) @siriwatknp
92
+ - &#8203;<!-- 07 -->[Team] Add Alexandre in the about page (#29289)
93
+ - &#8203;<!-- 02 -->[website] Fix status label overflow in AdvancedShowcase (#29143) @LorenzHenk
94
+ - &#8203;<!-- 01 -->[website] Update legacy logos (#28908) @michaldudak
95
+
96
+ ### Core
97
+
98
+ - &#8203;<!-- 37 -->[core] Order repro methods by preference (#29156) @eps1lon
99
+ - &#8203;<!-- 36 -->[core] Remove unnecessary usages of `useEventCallback` (#28910) @NMinhNguyen
100
+ - &#8203;<!-- 35 -->[core] add `unstable_ClassNameGenerator` API (#29051) @siriwatknp
101
+ - &#8203;<!-- 34 -->[core] Fix issues when using styled-components (#29048) @mnajdova
102
+ - &#8203;<!-- 33 -->[core] replace hard-coded classname with classes (#29070) @siriwatknp
103
+ - &#8203;<!-- 06 -->[test] Add documentation for visual regression tests (#29154) @eps1lon
104
+ - &#8203;<!-- 05 -->[test] Enable "missing act" warnings using new proposal (#29167) @eps1lon
105
+
106
+ All contributors of this release in alphabetical order: @adamfitzgibbon, @DanailH, @deepanshu2506, @Devesh21700Kumar, @eps1lon, @gnowland, @hbjORbj, @jatinsandilya, @JuliaNeumann, @LorenzHenk, @michal-perlakowski, @michaldudak, @mnajdova, @nikitabobers, @NMinhNguyen, @omarmosid, @rebeccahongsf, @siriwatknp, @waxidiotic
107
+
108
+ ## 5.0.4
109
+
110
+ <!-- generated comparing v5.0.3..master -->
111
+
112
+ _Oct 14, 2021_
113
+
114
+ A big thanks to the 17 contributors who made this release possible. Here are some highlights ✨:
115
+
116
+ - 🧪 Added `UnstyledInput` and `useInput` hook in the the first component in @mui/core package @michaldudak (#28053)
117
+ - 🐛 Fixed many bugs and improved the documentation 📚.
118
+
119
+ ### `@mui/material@5.0.4`
120
+
121
+ - &#8203;<!-- 31 -->[Chip] disable ripple only if onDelete is present. (#29034) @mottox2
122
+ - &#8203;<!-- 06 -->[Pagination] Fix clicking on `...` triggering `onChange` with page value `null` (#28884) @ZeeshanTamboli
123
+ - &#8203;<!-- 04 -->[Tabs] Alternative way to disable ":first-child is unsafe" error (#28982) @hbjORbj
124
+ - &#8203;<!-- 03 -->[Tabs] Fix ":first-child is potentially unsafe" error (#28890) @hbjORbj
125
+ - &#8203;<!-- 01 -->[transitions] Mark `children` as required where nullish `children` would crash at runtime (#29028) @eps1lon
126
+
127
+ ### `@mui/system@5.0.4`
128
+
129
+ - &#8203;<!-- 05 -->[system] Update typing for `style` function (#28744) @hbjORbj
130
+
131
+ ### `@mui/core@5.0.0-alpha.51`
132
+
133
+ - &#8203;<!-- 07 -->[InputUnstyled] Create unstyled input and useInput hook (#28053) @michaldudak
134
+
135
+ ### `@mui/lab@5.0.0-alpha.51`
136
+
137
+ - &#8203;<!-- 25 -->[DesktopDatePicker] add Paper props to pass down to Paper component (#28865) @amen-souissi
138
+
139
+ ### Docs
140
+
141
+ - &#8203;<!-- 24 -->[docs] Add JSDoc to `theme.breakpoints` (#29039) @eps1lon
142
+ - &#8203;<!-- 23 -->[docs] Rename broken package names in docs pointing to `@mui/material` (#29006) @visualfanatic
143
+ - &#8203;<!-- 22 -->[docs] Add troubleshooting guide for unexpected styles (#28907) @mnajdova
144
+ - &#8203;<!-- 21 -->[docs] Fix issues reported by ahref (#28986) @mnajdova
145
+ - &#8203;<!-- 20 -->[docs] Remove json translations for dropped locales (#28987) @mnajdova
146
+ - &#8203;<!-- 19 -->[docs] Fix type signature of renderGroup in Autocomplete (#28876) @tanyabouman
147
+ - &#8203;<!-- 18 -->[docs] Minor typo in v4-v5 migration docs (#28995) @kgregory
148
+ - &#8203;<!-- 17 -->[docs] Add `mui-image` related project (#28621) @benmneb
149
+ - &#8203;<!-- 16 -->[docs] Update Getting Started Templates' Source URIs (#28929) @epodol
150
+ - &#8203;<!-- 15 -->[docs] Improve search experience (#28801) @siriwatknp
151
+ - &#8203;<!-- 14 -->[docs] Fix demo of the responsive drawer (#28226) @goncalovf
152
+ - &#8203;<!-- 13 -->[docs] Fix global theme link demo (#28974) @ZeeshanTamboli
153
+ - &#8203;<!-- 12 -->[docs] Update box example to use 'backgroundColor' rather than 'bgColor' (#28958) @Jareechang
154
+ - &#8203;<!-- 11 -->[docs] corrected `Box` import for `sx-prop` example (#28873) @phudekar
155
+ - &#8203;<!-- 10 -->[docs] Fix footnote ID links in CONTRIBUTING.md (#28849) @officialpiyush
156
+ - &#8203;<!-- 09 -->[docs] Fix color & density playground (#28803) @siriwatknp
157
+ - &#8203;<!-- 08 -->[docs] Improve visibility of styled engine configuration section in installation guide (#28903) @Jareechang
158
+
159
+ ### Core
160
+
161
+ - &#8203;<!-- 30 -->[core] Prevent yarn cache growing infinitely (#29040) @eps1lon
162
+ - &#8203;<!-- 29 -->[core] Update browserslist (#29025) @eps1lon
163
+ - &#8203;<!-- 28 -->[core] Update `peerDependencies` to require `latest` instead of `next` (#29007) @eps1lon
164
+ - &#8203;<!-- 27 -->[core] Increase memory limit for size:snapshot (#29005) @eps1lon
165
+ - &#8203;<!-- 26 -->[core] Init `private` Joy package (#28957) @siriwatknp
166
+ - &#8203;<!-- 02 -->[test] Remove a11y snapshot tests (#28887) @eps1lon
167
+
168
+ All contributors of this release in alphabetical order: @amen-souissi, @benmneb, @epodol, @eps1lon, @goncalovf, @hbjORbj, @Jareechang, @kgregory, @michaldudak, @mnajdova, @mottox2, @officialpiyush, @phudekar, @siriwatknp, @tanyabouman, @visualfanatic, @ZeeshanTamboli
169
+
170
+ ## 5.0.3
171
+
172
+ <!-- generated comparing v5.0.2..master -->
173
+
174
+ _Oct 7, 2021_
175
+
176
+ A big thanks to the 19 contributors who made this release possible. Here are some highlights ✨:
177
+
178
+ - 🧪 Created the first component in @mui/material-next - our v6 prototype package.
179
+ - 🐛 Fixed many bugs and improved the documentation 📚.
180
+
181
+ ### `@mui/material@5.0.3`
182
+
183
+ - &#8203;<!-- 10 -->[Stack] Add props & variants types in the theme (#28843) @mnajdova
184
+ - &#8203;<!-- 12 -->[InputLabel] Fix condition for applying formControl overrides (#28707) @yevheniiminin
185
+ - &#8203;<!-- 05 -->[Tooltip] Allow overriding internal components and their props (#28692) @michaldudak
186
+ - &#8203;<!-- 04 -->[transitions] Fix `addEndListener` not being called with the DOM node (#28715) @eps1lon
187
+
188
+ ### `@mui/codemod@5.0.3`
189
+
190
+ - &#8203;<!-- 37 -->[codemod] Fix `optimal-imports` to support v4 and v5-alpha, beta (#28812) @siriwatknp
191
+
192
+ ### `@mui/system@5.0.3`
193
+
194
+ - &#8203;<!-- 09 -->[system] Add padding/margin-block/inline to spacing (#28813) @smmoosavi
195
+
196
+ ### `@mui/styled-engine-sc@5.0.3`
197
+
198
+ - &#8203;<!-- 42 -->Don't allow styled-components APIs on mui styled function (#28807) @hbjORbj
199
+
200
+ ### `@mui/core@5.0.0-alpha.50`
201
+
202
+ - &#8203;<!-- 38 -->[ButtonUnstyled] Don't set redundant role=button (#28488) @michaldudak
203
+ - &#8203;<!-- 43 -->[SliderUnstyled] Prevent unknown-prop error when using marks prop (#28868) @hbjORbj
204
+
205
+ ### `@mui/lab@5.0.0-alpha.50`
206
+
207
+ - &#8203;<!-- 11 -->[pickers] Change view even if `onViewChange` is set (#28765) @eps1lon
208
+
209
+ ### `@mui/material-next@6.0.0-alpha.4`
210
+
211
+ - &#8203;<!-- 39 -->[Button-next] Create Button in material-next (#28313) @michaldudak
212
+
213
+ ### Docs
214
+
215
+ - &#8203;<!-- 34 -->[docs] Add alike v4 default button color in migration (#28881) @siriwatknp
216
+ - &#8203;<!-- 34 -->[docs] Use PNG instead of SVG for color preview (#28699) @eps1lon
217
+ - &#8203;<!-- 33 -->[docs] Use client-side navigation when activating docsearch results (#28750) @eps1lon
218
+ - &#8203;<!-- 32 -->[docs] Fluid icon size in icons search (#28747) @eps1lon
219
+ - &#8203;<!-- 31 -->[docs] Fix the wrong import in docs grid page (#28863) @taghi-khavari
220
+ - &#8203;<!-- 30 -->[docs] Fix typo in Pagination docs (#28864) @ZeeshanTamboli
221
+ - &#8203;<!-- 29 -->[docs] Fix 404 links (#28710) @mnajdova
222
+ - &#8203;<!-- 28 -->[docs] Fix typo in Mui CSS classname (#28725) @cacpgomes
223
+ - &#8203;<!-- 27 -->[docs] Match example to codesandbox demo and update ID link (#28762) @AnilSeervi
224
+ - &#8203;<!-- 26 -->[docs] Fix typo in system/box documentation (#28822) @iamsergo
225
+ - &#8203;<!-- 25 -->[docs] Use HTML standards for autocomplete attributes (#28827) @epodol
226
+ - &#8203;<!-- 24 -->[docs] Improve styled-components integration (#28713) @mnajdova
227
+ - &#8203;<!-- 23 -->[docs] Correct Select's menu placement description (#28748) @michaldudak
228
+ - &#8203;<!-- 22 -->[docs] AdapterDayJS -> AdapterDayjs (#28770) @veerreshr
229
+ - &#8203;<!-- 21 -->[docs] Theme documentation, typo fix (#28805) @saeedseyfi
230
+ - &#8203;<!-- 20 -->[docs] Add the last diamond sponsor (#28737) @hbjORbj
231
+ - &#8203;<!-- 19 -->[docs] Fix various links in CONTRIBUTING (#28751) @AnilSeervi
232
+ - &#8203;<!-- 18 -->[docs] Only add JSS to demos (#28698) @eps1lon
233
+ - &#8203;<!-- 17 -->[docs] Update v5 status in release schedule (#28700) @owais635
234
+ - &#8203;<!-- 16 -->[docs] Fix typo in /guides/styled-engine (#28720) @Sharry0
235
+ - &#8203;<!-- 15 -->[docs] Fix typo in chip documentation (#28641) @avranju94
236
+ - &#8203;<!-- 14 -->[docs] Fix versions page (#28682) @mnajdova
237
+ - &#8203;<!-- 13 -->[docs] Remove legacy team page (#28646) @mnajdova
238
+ - &#8203;<!-- 41 -->[website] add "React" to the hero description (#28830) @danilo-leal
239
+ - &#8203;<!-- 03 -->[website] Fix constantly reloading when Russian language is set (#28869) @mnajdova
240
+ - &#8203;<!-- 02 -->[website] Compress one avatar image on about us page (#28823) @hbjORbj
241
+ - &#8203;<!-- 01 -->[website] Hide 'become a diamond sponsor' box on landing page (#28814) @hbjORbj
242
+ - &#8203;<!-- 40 -->[website] Update Benny's profile on about us page (#28816) @hbjORbj
243
+
244
+ ### Core
245
+
246
+ - &#8203;<!-- 36 -->[core] Remove `--exact` from `release:version` (#28840) @siriwatknp
247
+ - &#8203;<!-- 35 -->[core] Neglect framer from release flow (#28680) @siriwatknp
248
+ - &#8203;<!-- 08 -->[test] Add a test for not allowing styled-components' APIs on mui `styled` function (#28862) @hbjORbj
249
+ - &#8203;<!-- 07 -->[test] Fix instances where type tests were only passing due to object being part of ReactNode (#28804) @eps1lon
250
+ - &#8203;<!-- 06 -->[test] Move ByMuiTest to test/utils (#28509) @eps1lon
251
+
252
+ All contributors of this release in alphabetical order: @AnilSeervi, @avranju94, @cacpgomes, @danilo-leal, @epodol, @eps1lon, @hbjORbj, @iamsergo, @michaldudak, @mnajdova, @owais635, @saeedseyfi, @Sharry0, @siriwatknp, @smmoosavi, @taghi-khavari, @veerreshr, @yevheniiminin, @ZeeshanTamboli
253
+
3
254
  ## 5.0.2
4
255
 
5
256
  <!-- generated comparing v5.0.1..master -->
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2014 Call-Em-All
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2014 Call-Em-All
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/borders.js CHANGED
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.default = exports.borderRadius = exports.borderLeftColor = exports.borderBottomColor = exports.borderRightColor = exports.borderTopColor = exports.borderColor = exports.borderLeft = exports.borderBottom = exports.borderRight = exports.borderTop = exports.border = void 0;
8
+ exports.default = exports.borderTopColor = exports.borderTop = exports.borderRightColor = exports.borderRight = exports.borderRadius = exports.borderLeftColor = exports.borderLeft = exports.borderColor = exports.borderBottomColor = exports.borderBottom = exports.border = void 0;
9
9
 
10
10
  var _responsivePropType = _interopRequireDefault(require("./responsivePropType"));
11
11
 
package/breakpoints.js CHANGED
@@ -5,12 +5,13 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.handleBreakpoints = handleBreakpoints;
9
8
  exports.createEmptyBreakpointObject = createEmptyBreakpointObject;
10
- exports.removeUnusedBreakpoints = removeUnusedBreakpoints;
9
+ exports.default = void 0;
10
+ exports.handleBreakpoints = handleBreakpoints;
11
11
  exports.mergeBreakpointsInOrder = mergeBreakpointsInOrder;
12
+ exports.removeUnusedBreakpoints = removeUnusedBreakpoints;
12
13
  exports.resolveBreakpointValues = resolveBreakpointValues;
13
- exports.default = exports.values = void 0;
14
+ exports.values = void 0;
14
15
 
15
16
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
16
17
 
@@ -3,17 +3,17 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.hexToRgb = hexToRgb;
7
- exports.decomposeColor = decomposeColor;
8
- exports.recomposeColor = recomposeColor;
9
- exports.rgbToHex = rgbToHex;
10
- exports.hslToRgb = hslToRgb;
11
- exports.getLuminance = getLuminance;
12
- exports.getContrastRatio = getContrastRatio;
13
6
  exports.alpha = alpha;
14
7
  exports.darken = darken;
15
- exports.lighten = lighten;
8
+ exports.decomposeColor = decomposeColor;
16
9
  exports.emphasize = emphasize;
10
+ exports.getContrastRatio = getContrastRatio;
11
+ exports.getLuminance = getLuminance;
12
+ exports.hexToRgb = hexToRgb;
13
+ exports.hslToRgb = hslToRgb;
14
+ exports.lighten = lighten;
15
+ exports.recomposeColor = recomposeColor;
16
+ exports.rgbToHex = rgbToHex;
17
17
 
18
18
  var _utils = require("@mui/utils");
19
19
 
package/createStyled.d.ts CHANGED
@@ -1,233 +1,34 @@
1
1
  import * as React from 'react';
2
- import * as CSS from 'csstype';
2
+ import {
3
+ CreateMUIStyled as CreateMUIStyledStyledEngine,
4
+ CSSInterpolation,
5
+ } from '@mui/styled-engine';
3
6
  import { SxProps } from './styleFunctionSx';
4
7
  import { Theme as DefaultTheme } from './createTheme';
5
8
 
6
- export interface SerializedStyles {
7
- name: string;
8
- styles: string;
9
- map?: string;
10
- next?: SerializedStyles;
11
- }
12
-
13
- export type CSSProperties = CSS.PropertiesFallback<number | string>;
14
- export type CSSPropertiesWithMultiValues = {
15
- [K in keyof CSSProperties]: CSSProperties[K] | Array<Extract<CSSProperties[K], string>>;
16
- };
17
- export type CSSPseudos = { [K in CSS.Pseudos]?: unknown | CSSObject };
18
-
19
- export interface CSSOthersObject {
20
- [propertiesName: string]: unknown | CSSInterpolation;
21
- }
22
- export type CSSPseudosForCSSObject = { [K in CSS.Pseudos]?: CSSObject };
23
-
24
- export interface ArrayCSSInterpolation extends Array<CSSInterpolation> {}
25
-
26
- export interface CSSOthersObjectForCSSObject {
27
- [propertiesName: string]: CSSInterpolation;
28
- }
29
-
30
- export interface CSSObject extends CSSPropertiesWithMultiValues, CSSPseudos, CSSOthersObject {}
31
-
32
- export interface ComponentSelector {
33
- __emotion_styles: any;
34
- }
35
-
36
- export type Keyframes = {
37
- name: string;
38
- styles: string;
39
- anim: number;
40
- toString: () => string;
41
- } & string;
42
-
43
- export type Equal<A, B, T, F> = A extends B ? (B extends A ? T : F) : F;
44
-
45
- export type InterpolationPrimitive =
46
- | null
47
- | undefined
48
- | boolean
49
- | number
50
- | string
51
- | ComponentSelector
52
- | Keyframes
53
- | SerializedStyles
54
- | CSSObject;
55
-
56
- export type CSSInterpolation = InterpolationPrimitive | ArrayCSSInterpolation;
57
-
58
- export interface FunctionInterpolation<Props> {
59
- (props: Props): Interpolation<Props>;
60
- }
61
-
62
- export interface ArrayInterpolation<Props> extends Array<Interpolation<Props>> {}
63
-
64
- export type Interpolation<Props> =
65
- | InterpolationPrimitive
66
- | ArrayInterpolation<Props>
67
- | FunctionInterpolation<Props>;
68
-
69
- /**
70
- * @desc Utility type for getting props type of React component.
71
- * It takes `defaultProps` into an account - making props with defaults optional.
72
- */
73
- export type PropsOf<C extends keyof JSX.IntrinsicElements | React.JSXElementConstructor<any>> =
74
- JSX.LibraryManagedAttributes<C, React.ComponentProps<C>>;
75
-
76
- export type Overwrapped<T, U> = Pick<T, Extract<keyof T, keyof U>>;
77
-
78
- export interface StyledComponent<InnerProps, OwnerState, Theme extends object>
79
- extends React.FunctionComponent<InnerProps & OwnerState & { theme?: Theme }>,
80
- ComponentSelector {}
9
+ export function shouldForwardProp(propName: PropertyKey): boolean;
81
10
 
82
- export interface StyledOptions {
83
- label?: string;
84
- shouldForwardProp?(propName: PropertyKey): boolean;
85
- target?: string;
11
+ export interface MUIStyledCommonProps<Theme extends object = DefaultTheme> {
12
+ theme?: Theme;
13
+ as?: React.ElementType;
14
+ sx?: SxProps<Theme>;
86
15
  }
87
16
 
88
17
  export interface MuiStyledOptions {
89
18
  name?: string;
90
19
  slot?: string;
20
+ // The difference between Interpolation and CSSInterpolation is that the former supports functions based on props
21
+ // If we want to support props in the overrides, we will need to change the CSSInterpolation to Interpolation<Props>
91
22
  overridesResolver?: (props: any, styles: Record<string, CSSInterpolation>) => CSSInterpolation;
92
23
  skipVariantsResolver?: boolean;
93
24
  skipSx?: boolean;
94
25
  }
95
26
 
96
- /** Same as StyledOptions but shouldForwardProp must be a type guard */
97
- export interface FilteringStyledOptions<Props, ForwardedProps extends keyof Props = keyof Props> {
98
- label?: string;
99
- shouldForwardProp?(propName: PropertyKey): propName is ForwardedProps;
100
- target?: string;
101
- }
102
-
103
- /**
104
- * @typeparam ComponentProps Props which will be included when withComponent is called
105
- * @typeparam SpecificComponentProps Props which will *not* be included when withComponent is called
106
- */
107
- export interface CreateStyledComponent<
108
- ComponentProps extends {},
109
- SpecificComponentProps extends {} = {},
110
- JSXProps extends {} = {},
111
- > {
112
- /**
113
- * @typeparam AdditionalProps Additional props to add to your styled component
114
- */
115
- <AdditionalProps extends {} = {}>(
116
- ...styles: Array<
117
- Interpolation<
118
- ComponentProps & SpecificComponentProps & AdditionalProps & { theme: DefaultTheme }
119
- >
120
- >
121
- ): StyledComponent<ComponentProps & AdditionalProps, SpecificComponentProps, JSXProps>;
122
-
123
- (
124
- template: TemplateStringsArray,
125
- ...styles: Array<
126
- Interpolation<ComponentProps & SpecificComponentProps & { theme: DefaultTheme }>
127
- >
128
- ): StyledComponent<ComponentProps, SpecificComponentProps, JSXProps>;
129
-
130
- /**
131
- * @typeparam AdditionalProps Additional props to add to your styled component
132
- */
133
- <AdditionalProps extends {}>(
134
- template: TemplateStringsArray,
135
- ...styles: Array<
136
- Interpolation<
137
- ComponentProps & SpecificComponentProps & AdditionalProps & { theme: DefaultTheme }
138
- >
139
- >
140
- ): StyledComponent<ComponentProps & AdditionalProps, SpecificComponentProps, JSXProps>;
141
- }
142
-
143
- export interface CreateMUIStyled<Theme extends object = DefaultTheme> {
144
- <
145
- C extends React.ComponentClass<React.ComponentProps<C>>,
146
- ForwardedProps extends keyof React.ComponentProps<C> = keyof React.ComponentProps<C>,
147
- >(
148
- component: C,
149
- options: FilteringStyledOptions<React.ComponentProps<C>, ForwardedProps> & MuiStyledOptions,
150
- ): CreateStyledComponent<
151
- Pick<PropsOf<C>, ForwardedProps> & {
152
- theme?: Theme;
153
- as?: React.ElementType;
154
- sx?: SxProps<Theme>;
155
- },
156
- {},
157
- {
158
- ref?: React.Ref<InstanceType<C>>;
159
- }
160
- >;
161
-
162
- <C extends React.ComponentClass<React.ComponentProps<C>>>(
163
- component: C,
164
- options?: StyledOptions & MuiStyledOptions,
165
- ): CreateStyledComponent<
166
- PropsOf<C> & {
167
- theme?: Theme;
168
- as?: React.ElementType;
169
- sx?: SxProps<Theme>;
170
- },
171
- {},
172
- {
173
- ref?: React.Ref<InstanceType<C>>;
174
- }
175
- >;
176
-
177
- <
178
- C extends React.JSXElementConstructor<React.ComponentProps<C>>,
179
- ForwardedProps extends keyof React.ComponentProps<C> = keyof React.ComponentProps<C>,
180
- >(
181
- component: C,
182
- options: FilteringStyledOptions<React.ComponentProps<C>, ForwardedProps> & MuiStyledOptions,
183
- ): CreateStyledComponent<
184
- Pick<PropsOf<C>, ForwardedProps> & {
185
- theme?: Theme;
186
- as?: React.ElementType;
187
- sx?: SxProps<Theme>;
188
- }
189
- >;
190
-
191
- <C extends React.JSXElementConstructor<React.ComponentProps<C>>>(
192
- component: C,
193
- options?: StyledOptions & MuiStyledOptions,
194
- ): CreateStyledComponent<
195
- PropsOf<C> & {
196
- theme?: Theme;
197
- as?: React.ElementType;
198
- sx?: SxProps<Theme>;
199
- }
200
- >;
201
-
202
- <
203
- Tag extends keyof JSX.IntrinsicElements,
204
- ForwardedProps extends keyof JSX.IntrinsicElements[Tag] = keyof JSX.IntrinsicElements[Tag],
205
- >(
206
- tag: Tag,
207
- options: FilteringStyledOptions<JSX.IntrinsicElements[Tag], ForwardedProps> & MuiStyledOptions,
208
- ): CreateStyledComponent<
209
- {
210
- theme?: Theme;
211
- as?: React.ElementType;
212
- sx?: SxProps<Theme>;
213
- },
214
- Pick<JSX.IntrinsicElements[Tag], ForwardedProps>
215
- >;
216
-
217
- <Tag extends keyof JSX.IntrinsicElements>(
218
- tag: Tag,
219
- options?: StyledOptions & MuiStyledOptions,
220
- ): CreateStyledComponent<
221
- {
222
- theme?: Theme;
223
- as?: React.ElementType;
224
- sx?: SxProps<Theme>;
225
- },
226
- JSX.IntrinsicElements[Tag]
227
- >;
228
- }
229
-
230
- export function shouldForwardProp(propName: PropertyKey): boolean;
27
+ export type CreateMUIStyled<T extends object = DefaultTheme> = CreateMUIStyledStyledEngine<
28
+ MUIStyledCommonProps<T>,
29
+ MuiStyledOptions,
30
+ T
31
+ >;
231
32
 
232
33
  export default function createStyled<T extends object = DefaultTheme>(options?: {
233
34
  defaultTheme?: T;
package/createStyled.js CHANGED
@@ -5,8 +5,8 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.shouldForwardProp = shouldForwardProp;
9
8
  exports.default = createStyled;
9
+ exports.shouldForwardProp = shouldForwardProp;
10
10
  exports.systemDefaultTheme = void 0;
11
11
 
12
12
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
@@ -134,7 +134,11 @@ function createStyled(input = {}) {
134
134
 
135
135
  const muiStyledResolver = (styleArg, ...expressions) => {
136
136
  const expressionsWithDefaultTheme = expressions ? expressions.map(stylesArg => {
137
- return typeof stylesArg === 'function' ? _ref => {
137
+ // On the server emotion doesn't use React.forwardRef for creating components, so the created
138
+ // component stays as a function. This condition makes sure that we do not interpolate functions
139
+ // which are basically components used as a selectors.
140
+ // eslint-disable-next-line no-underscore-dangle
141
+ return typeof stylesArg === 'function' && stylesArg.__emotion_real !== stylesArg ? _ref => {
138
142
  let {
139
143
  theme: themeInput
140
144
  } = _ref,