@mui/system 5.8.3 → 5.8.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,215 @@
1
1
  # [Versions](https://mui.com/versions/)
2
2
 
3
+ ## 5.8.6
4
+
5
+ <!-- generated comparing v5.8.5..master -->
6
+
7
+ _Jun 27, 2022_
8
+
9
+ A big thanks to the 13 contributors who made this release possible. Here are some highlights ✨:
10
+
11
+ - ⚒️ Fixed React 18 issues in few components
12
+ - 🚀 Improved the TypeScript augmentation when using CSS variables with `@mui/material`
13
+ - many other 🐛 bug fixes and 📚 documentation improvements
14
+
15
+ ### `@mui/material@5.8.6`
16
+
17
+ - &#8203;<!-- 27 -->[Alert] Add support for CSS vars (#32624) @haneenmahd
18
+ - &#8203;<!-- 26 -->[Alert] Use `getContrastText` for filled variant font color (#29813) @SamoraMabuya
19
+
20
+ Note: The color of the text in the warning contained `Alert` in dark mode was changed to black in order to improve the color contrast ratio
21
+
22
+ - &#8203;<!-- 11 -->[OutlinedInput] Fix `ownerState` undefined in theme style overrides (#33241) @siriwatknp
23
+ - &#8203;<!-- 08 -->[Tabs] Fix crash when used with React 18 & Suspense (#33277) @mnajdova
24
+ - &#8203;<!-- 05 -->[TypeScript] Add CSS vars type augmentation for Material UI (#33211) @siriwatknp
25
+
26
+ ### `@mui/system@5.8.6`
27
+
28
+ - &#8203;<!-- 09 -->[system] Add enableColorScheme option to getInitColorSchemeScript (#33261) @siriwatknp
29
+
30
+ ### `@mui/utils@5.8.6`
31
+
32
+ - &#8203;<!-- 04 -->[utils] Allow state prefix to be configurable (#32972) @siriwatknp
33
+
34
+ ### `@mui/base@5.0.0-alpha.87`
35
+
36
+ - &#8203;<!-- 25 -->[base] Improve the return type of useSlotProps (#33279) @michaldudak
37
+ - &#8203;<!-- 24 -->[base] Improve some types (#33270) @mnajdova
38
+ - &#8203;<!-- 13 -->[MenuUnstyled] Fix keyboard accessibility of menu items (#33145) @michaldudak
39
+ - &#8203;<!-- 12 -->[ModalManager] Lock body scroll when container is inside shadow DOM (#33168) @jacobweberbowery
40
+ - &#8203;<!-- 10 -->[SliderUnstyled] Use useSlotProps (#33132) @michaldudak
41
+ - &#8203;<!-- 07 -->[TextareaAutosize] Fix crash when used with React 18 & Suspense (#33238) @howlettt
42
+ - &#8203;<!-- 06 -->[TextareaAutosize] Fix warnings for too many renders in React 18 (#33253) @mnajdova
43
+
44
+ ### `@mui/joy@5.0.0-alpha.34`
45
+
46
+ - &#8203;<!-- 14 -->[Joy] Add `Sheet` doc (#32820) @hbjORbj
47
+
48
+ ### Docs
49
+
50
+ - &#8203;<!-- 23 -->[blog] Polish Why you should migrate to Material UI v5 today (#33244) @oliviertassinari
51
+ - &#8203;<!-- 21 -->[docs] Add note in docs about `componentsProps.root` taking precedence (#33097) @ZeeshanTamboli
52
+ - &#8203;<!-- 20 -->[docs] Remove a note about Base components being reexported from Material UI (#33265) @michaldudak
53
+ - &#8203;<!-- 19 -->[docs] Update code snippet in docs for custom color palette (#32946) @ZeeshanTamboli
54
+ - &#8203;<!-- 18 -->[docs] Fix the docs for production class generation (#31933) @Fafruch
55
+ - &#8203;<!-- 17 -->[docs] Fix internal link in Box page (#33149) @davidgarciab
56
+ - &#8203;<!-- 16 -->[docs] Badge component link in Base docs should be under Data Display section (#33249) @ZeeshanTamboli
57
+ - &#8203;<!-- 15 -->[examples] Fix comment typo (#33256) @WinmezzZ
58
+
59
+ ### Core
60
+
61
+ - &#8203;<!-- 22 -->[core] Remove dead code (#33243) @oliviertassinari
62
+ - &#8203;<!-- 03 -->[website] Fix the scroll-top for all the website (#33215) @oliviertassinari
63
+ - &#8203;<!-- 02 -->[website] List new core role @oliviertassinari
64
+ - &#8203;<!-- 01 -->[website] Fix navigation menu close behavior (#33203) @oliviertassinari
65
+
66
+ All contributors of this release in alphabetical order: @davidgarciab, @Fafruch, @haneenmahd, @hbjORbj, @howlettt, @jacobweberbowery, @michaldudak, @mnajdova, @oliviertassinari, @SamoraMabuya, @siriwatknp, @WinmezzZ, @ZeeshanTamboli
67
+
68
+ ## 5.8.5
69
+
70
+ <!-- generated comparing v5.8.4..master -->
71
+
72
+ _Jun 20, 2022_
73
+
74
+ A big thanks to the 14 contributors who made this release possible. Here are some highlights ✨:
75
+
76
+ - 🚀 Added support for CSS variables in the `Avatar` component and the `SpeedDialAction` component respectively by @vicasas and @gin1314
77
+ - many other 🐛 bug fixes and 📚 documentation improvements
78
+
79
+ ### `@mui/material@5.8.5`
80
+
81
+ - &#8203;<!-- 30 -->[Avatar] Add support for CSS variables (#32499) @vicasas
82
+ - &#8203;<!-- 19 -->[Dialog] Fix broken styles if `maxWidth` is set to `false` (#32987) @kmurgic
83
+ - &#8203;<!-- 04 -->[SpeedDialAction] Add support for CSS variables (#32608) @gin1314
84
+ - &#8203;<!-- 02 -->[Tabs] Increment scroll of the minimum amount possible (#33103) @oliviertassinari
85
+
86
+ ### `@mui/codemod@5.8.5`
87
+
88
+ - &#8203;<!-- 24 -->[codemod] Preserve comments within jss-to-tss-react (#33170) @ryancogswell
89
+
90
+ ### `@mui/lab@5.0.0-alpha.87`
91
+
92
+ - &#8203;<!-- 06 -->[Masonry] Fix flickering when used with React 18 (#33163) @mnajdova
93
+
94
+ ### `@mui/base@5.0.0-alpha.86`
95
+
96
+ - &#8203;<!-- 29 -->[BadgeUnstyled] Accept callbacks in componentsProps (#33176) @michaldudak
97
+ - &#8203;<!-- 25 -->[ButtonUnstyled] Use useSlotProps (#33096) @michaldudak
98
+ - &#8203;<!-- 11 -->[FormControlUnstyled] Accept callbacks in componentsProps (#33180) @michaldudak
99
+ - &#8203;<!-- 10 -->[InputUnstyled] Use useSlotProps (#33094) @michaldudak
100
+ - &#8203;<!-- 05 -->[ModalUnstyled] Define ownerState and slot props' types (#32901) @michaldudak
101
+ - &#8203;<!-- 03 -->[SwitchUnstyled] Use useSlotProps (#33174) @michaldudak
102
+
103
+ ### `@mui/joy@5.0.0-alpha.33`
104
+
105
+ - &#8203;<!-- 09 -->[Joy] Add Checkbox documentation (#33171) @siriwatknp
106
+ - &#8203;<!-- 08 -->[Joy] Add List documentation (#33120) @siriwatknp
107
+ - &#8203;<!-- 07 -->[Joy] Make slider displays Joy classname (#33051) @siriwatknp
108
+
109
+ ### Docs
110
+
111
+ - &#8203;<!-- 28 -->[blog] Update Blogpost to clear confusion on "no impact" disclaimer. (#33131) @joserodolfofreitas
112
+ - &#8203;<!-- 27 -->[blog] Add post about v5 Migration guide update (#33063) @samuelsycamore
113
+ - &#8203;<!-- 26 -->[blog] Fix display on Safari (#33102) @oliviertassinari
114
+ - &#8203;<!-- 18 -->[docs] Add guide on how to use MUI Base with Tailwind CSS (#33100) @mnajdova
115
+ - &#8203;<!-- 17 -->[docs] Improve Joy template UX (#33159) @siriwatknp
116
+ - &#8203;<!-- 16 -->[docs] Update Shadow DOM guide (#33160) @cherniavskii
117
+ - &#8203;<!-- 15 -->[docs] Fix SEO regressions (#33106) @oliviertassinari
118
+ - &#8203;<!-- 14 -->[docs] Add job ad in table of content (#33143) @mnajdova
119
+ - &#8203;<!-- 13 -->[docs] Add customization as a value proposition (#33014) @oliviertassinari
120
+ - &#8203;<!-- 12 -->[examples] Add example using nextjs & @mui/styles as a starter for the migration to v5 (#33005) @mnajdova
121
+ - &#8203;<!-- 01 -->[website] Replace Airtable with Ashby links for applying to a opened position (#33193) @DanailH
122
+
123
+ ### Core
124
+
125
+ - &#8203;<!-- 31 -->[core] Add CSS variables support for Material UI components (#32835) @siriwatknp
126
+ - &#8203;<!-- 23 -->[core] Add name to workspace root package.json (#33226) @Janpot
127
+ - &#8203;<!-- 22 -->[core] Update bug template with generic instruction (#33153) @joserodolfofreitas
128
+ - &#8203;<!-- 21 -->[core] Remove dead and redundant code (#33125) @oliviertassinari
129
+ - &#8203;<!-- 20 -->[core] Improve inline code rendering within the details tag (#33086) @Harmouch101
130
+
131
+ All contributors of this release in alphabetical order: @cherniavskii, @DanailH, @gin1314, @Harmouch101, @Janpot, @joserodolfofreitas, @kmurgic, @michaldudak, @mnajdova, @oliviertassinari, @ryancogswell, @samuelsycamore, @siriwatknp, @vicasas
132
+
133
+ ## 5.8.4
134
+
135
+ <!-- generated comparing v5.8.3..master -->
136
+
137
+ _Jun 14, 2022_
138
+
139
+ A big thanks to the 24 contributors who made this release possible. Here are some highlights ✨:
140
+
141
+ - 🚀 Added support for custom breakpoints in the `Grid` component by @boutahlilsoufiane
142
+ - 📚 Added guide on how to use Material UI with Shadow DOM by @cherniavskii
143
+ - many other 🐛 bug fixes and 📚 documentation improvements
144
+
145
+ ### `@mui/material@5.8.4`
146
+
147
+ - &#8203;<!-- 36 -->[Button] Add missing classes in `ButtonClasses` type (#33040) @ZeeshanTamboli
148
+ - &#8203;<!-- 20 -->[Grid] Fix prop-type key regression (#33123) @oliviertassinari
149
+ - &#8203;<!-- 19 -->[Grid] Support custom breakpoints (#31998) @boutahlilsoufiane
150
+ - &#8203;<!-- 18 -->[Grow] Limit CSS transition bug workaround to Safari 15.4 only (#32996) @igordanchenko
151
+ - &#8203;<!-- 17 -->[Hidden] Remove dependency on hoist-non-react-statics (#33015) @oliviertassinari
152
+ - &#8203;<!-- 12 -->[Link] Add support for CSS variables (#33036) @winderica
153
+ - &#8203;<!-- 07 -->[Popover] Export `getOffsetTop` & `getOffsetLeft` from Popover's index and add typings (#32959) @rart
154
+ - &#8203;<!-- 06 -->[Slider] Fix SliderValueLabelProps type (#32895) @oliviertassinari
155
+ - &#8203;<!-- 05 -->[Snackbar] Remove `RTL` direction specific logic (#32808) @aaarichter
156
+ - &#8203;<!-- 04 -->[StepIcon] Fix text centering when changing browser font size (#32706) @alansouzati
157
+ - &#8203;<!-- 02 -->[Tabs] Scroll by width of the first visible tab if only one tab is partially visible (#32778) @frankkluijtmans
158
+
159
+ ### `@mui/system@5.8.4`
160
+
161
+ - &#8203;<!-- 38 -->[Stack, system] Apply correct responsive styles if any custom breakpoints are provided (#32913) @ZeeshanTamboli
162
+ - &#8203;<!-- 03 -->[system] Fix missing typings for ColorFormat (#32417) @l-zoy
163
+
164
+ ### `@mui/codemod@5.8.4`
165
+
166
+ - &#8203;<!-- 35 -->[codemod] Add support for `@mui/styles/makeStyles` imports (#32962) @joshkel
167
+
168
+ ### `@mui/lab@5.0.0-alpha.86`
169
+
170
+ - &#8203;<!-- 08 -->[pickers] Fix broken ref forwarding (#33107) @oliviertassinari
171
+ - &#8203;<!-- 13 -->[lab] Fix React's `forwardRef` warning when importing from the index (#33134) @mnajdova
172
+
173
+ ### `@mui/base@5.0.0-alpha.85`
174
+
175
+ - &#8203;<!-- 11 -->[MenuUnstyled] Accept callbacks in componentsProps (#32997) @michaldudak
176
+ - &#8203;<!-- 10 -->[ModalUnstyled] Fix errors from the W3C validator about incorrect aria-hidden attribute on some elements (#30920) @mkrtchian
177
+ - &#8203;<!-- 09 -->[ModalUnstyled] Fix behavior of not respecting props ariaHidden value (#32055) @tech-meppem
178
+
179
+ ### `@mui/joy@5.0.0-alpha.32`
180
+
181
+ - &#8203;<!-- 16 -->[Joy] Miscellaneous card fixes (#33129) @siriwatknp
182
+ - &#8203;<!-- 15 -->[Joy] Miscellaneous fixes (#33073) @siriwatknp
183
+ - &#8203;<!-- 14 -->[Joy] Add typography and link docs (#33047) @siriwatknp
184
+
185
+ ### Docs
186
+
187
+ - &#8203;<!-- 40 -->[Contributing.md] Local install instructions (#32975) @Moizsohail
188
+ - &#8203;<!-- 32 -->[docs] Add responsive AppBar with drawer (#32769) @dvlprAlamin
189
+ - &#8203;<!-- 31 -->[docs] Move codesandbox to MUI org (#33122) @oliviertassinari
190
+ - &#8203;<!-- 30 -->[docs] Add Shadow DOM guide (#33007) @cherniavskii
191
+ - &#8203;<!-- 29 -->[docs] Fix typo in Material UI overview page (#33087) @oliviertassinari
192
+ - &#8203;<!-- 28 -->[docs] Miscellaneous fixes in `MUI Base` docs (#33091) @ZeeshanTamboli
193
+ - &#8203;<!-- 27 -->[docs] Fix GitHub capitalization (#33071) @oliviertassinari
194
+ - &#8203;<!-- 26 -->[docs] Fix a typo in `InputUnstyled` docs (#33077) @ZeeshanTamboli
195
+ - &#8203;<!-- 25 -->[docs] Add notification for Joy blog post (#33059) @siriwatknp
196
+ - &#8203;<!-- 24 -->[docs] Improve aspect ratio docs and integration (#33065) @siriwatknp
197
+ - &#8203;<!-- 34 -->[docs] Update code block copy label (#33128) @siriwatknp
198
+ - &#8203;<!-- 23 -->[docs] Fix typo in Autocomplete CSS API (#32838) @KeaghanKennedy
199
+ - &#8203;<!-- 22 -->[docs] Improvements for Radio Group Rating Docs (#32843) @Kai-W
200
+ - &#8203;<!-- 21 -->[docs] Enable Joy pages (#33064) @siriwatknp
201
+ - &#8203;<!-- 02 -->[website] Add Joy UI to the pricing page (#33099) @danilo-leal
202
+ - &#8203;<!-- 01 -->[website] Clarify the pricing a bit (#33069) @oliviertassinari
203
+
204
+ ### Core
205
+
206
+ - &#8203;<!-- 39 -->yarn proptypes @oliviertassinari
207
+ - &#8203;<!-- 34 -->[core] Update dependencies to fix security vulnerabilities (#33095) @michaldudak
208
+ - &#8203;<!-- 33 -->[core] Import new line convention (#33068) @oliviertassinari
209
+ - &#8203;<!-- 37 -->[core] Make repository configurable in changelog script (#33130) @Janpot
210
+
211
+ All contributors of this release in alphabetical order: @aaarichter, @alansouzati, @boutahlilsoufiane, @cherniavskii, @danilo-leal, @dvlprAlamin, @frankkluijtmans, @igordanchenko, @Janpot, @joshkel, @Kai-W, @KeaghanKennedy, @l-zoy, @michaldudak, @mkrtchian, @mnajdova, @Moizsohail, @oliviertassinari, @pushys, @rart, @siriwatknp, @tech-meppem, @winderica, @ZeeshanTamboli
212
+
3
213
  ## 5.8.3
4
214
 
5
215
  <!-- generated comparing v5.8.2..master -->
@@ -9,25 +219,25 @@ _Jun 7, 2022_
9
219
  A big thanks to the 15 contributors who made this release possible.
10
220
  This release is mostly about 🐛 bug fixes and 📚 documentation improvements.
11
221
 
12
- ## `@mui/material@5.8.3`
222
+ ### `@mui/material@5.8.3`
13
223
 
14
224
  - [Alert] Constrain message width and allow overflow (#32747) @Janpot
15
225
  - [Checkbox] Add support for CSS variables (#32579) @haneenmahd
16
226
  - [Slider] Fix positioning of tooltips on vertical slider (#32919) @abhinav-22-tech
17
227
 
18
- ## `@mui/system@5.8.3`
228
+ ### `@mui/system@5.8.3`
19
229
 
20
230
  - [system] Configurable attributes for libraries (#32971) @siriwatknp
21
231
 
22
- ## `@mui/codemod@5.8.3
232
+ ### `@mui/codemod@5.8.3`
23
233
 
24
234
  - [codemod] Fix infinite loop in jss-to-tss-react and add TODO (#33048) @ryancogswell
25
235
 
26
- ## `@mui/lab@5.0.0-alpha.85`
236
+ ### `@mui/lab@5.0.0-alpha.85`
27
237
 
28
238
  - [pickers] Add deprecations when importing pickers from the lab (#32950) @flaviendelangle
29
239
 
30
- ## `@mui/joy@5.0.0-alpha.31`
240
+ ### `@mui/joy@5.0.0-alpha.31`
31
241
 
32
242
  - [Joy] Add `Slider` component and demos (#32694) @hbjORbj
33
243
  - [Joy] Add articles about customization approaches (#32887) @siriwatknp
@@ -35,7 +245,7 @@ This release is mostly about 🐛 bug fixes and 📚 documentation improvements.
35
245
  - [Joy] Add docs about dark mode (#33002) @siriwatknp
36
246
  - [Joy] Add template UIs & first look blog post (#32791) @danilo-leal
37
247
 
38
- ## `@mui/base@5.0.0-alpha.84`
248
+ ### `@mui/base@5.0.0-alpha.84`
39
249
 
40
250
  - [base] Remove @mui/system in tests (#32945) @kevinji
41
251
  - [ButtonUnstyled] Accept callbacks in componentsProps (#32991) @michaldudak
@@ -44,7 +254,7 @@ This release is mostly about 🐛 bug fixes and 📚 documentation improvements.
44
254
  - [TabPanelUnstyled] Define ownerState and slot props' types (#32928) @michaldudak
45
255
  - [TabsListUnstyled] Define ownerState and slot props' types (#32925) @michaldudak
46
256
 
47
- ## Docs
257
+ ### Docs
48
258
 
49
259
  - [blog] Fix anchor link scroll (#32994) @oliviertassinari
50
260
  - [docs] Add "Migration" section to sidebar and revise v4-v5 content (#32740) @samuelsycamore
@@ -62,7 +272,7 @@ This release is mostly about 🐛 bug fixes and 📚 documentation improvements.
62
272
  - [website] Polish the pricing page (#32811) @oliviertassinari
63
273
  - [website] Remove unnecessary `address` dependency (#32957) @michaldudak
64
274
 
65
- ## Core
275
+ ### Core
66
276
 
67
277
  - [core] Improve icon synonyms (#32742) @oliviertassinari
68
278
  - [core] Prepare Next.js config for React 18 (#32963) @michaldudak
@@ -1021,7 +1231,7 @@ A big thanks to the 17 contributors who made this release possible. Here are som
1021
1231
  - &#8203;<!-- 25 -->[core] Update playwright docker to match the specified version (#31236) @siriwatknp
1022
1232
  - &#8203;<!-- 24 -->[core] Remove parallel on buildTypes (#31189) @siriwatknp
1023
1233
  - &#8203;<!-- 23 -->[core] Fix propTypes generation for optional any props (#31141) @m4theushw
1024
- - &#8203;<!-- 04 -->[Typescript] Remove variants deprecation (#31239) @siriwatknp
1234
+ - &#8203;<!-- 04 -->[typescript] Remove variants deprecation (#31239) @siriwatknp
1025
1235
 
1026
1236
  All contributors of this release in alphabetical order: @adriancampos, @Andarist, @bonellia, @davwheat, @greengiraffe, @hbjORbj, @iclaude3, @m4theushw, @michaldudak, @mnajdova, @oliviertassinari, @PunitSoniME, @RedHeadphone, @robertwt7, @samuelsycamore, @siriwatknp, @sviande
1027
1237
 
@@ -1086,7 +1296,7 @@ A big thanks to the 16 contributors who made this release possible. Here are som
1086
1296
  - [Select] Allow customizing Select based on its variant (#30788) @michaldudak
1087
1297
  - [Portal] Re-export 'Portal' in material (#31003) @liradb2000
1088
1298
  - [ToggleButton] Add prop types for `onClick` and `onChange` (#30883) @sydneyjodon-wk
1089
- - [Typescript] Added TypeText declaration to the exports file (#30890) @agauravdev
1299
+ - [typescript] Added TypeText declaration to the exports file (#30890) @agauravdev
1090
1300
 
1091
1301
  ### `@mui/system@5.4.2`
1092
1302
 
@@ -2000,7 +2210,7 @@ A big thanks to the 15 contributors who made this release possible. Here are som
2000
2210
  - &#8203;<!-- 33 -->[core] Add `experiments` index page (#29582) @siriwatknp
2001
2211
  - &#8203;<!-- 32 -->[core] Move s3 bucket ownership to mui-org (#29609) @eps1lon
2002
2212
  - &#8203;<!-- 31 -->[core] Improve support request message (#29614) @mnajdova
2003
- - &#8203;<!-- 30 -->[core] Use support request Github Action (#29594) @mnajdova
2213
+ - &#8203;<!-- 30 -->[core] Use support request GitHub Action (#29594) @mnajdova
2004
2214
  - &#8203;<!-- 29 -->[core] Remove unused `getJsxPreview` util (#29586) @ZeeshanTamboli
2005
2215
  - &#8203;<!-- 28 -->[core] Use GitHub issue forms (#28038) @oliviertassinari
2006
2216
  - &#8203;<!-- 26 -->[core] Add playground (#29423) @oliviertassinari
@@ -4524,8 +4734,8 @@ A big thanks to the 15 contributors who made this release possible. Here are som
4524
4734
  - &#8203;<!-- 29 -->[Button] Rename `pending` prop to `loading` in LoadingButton (#25874) @m4theushw
4525
4735
 
4526
4736
  ```diff
4527
- -<LoadingButton pending pendingIndicator="Pending..." pendingPosition="end" />
4528
- +<LoadingButton loading loadingIndicator="Pending..." loadingPosition="end" />
4737
+ -<LoadingButton pending pendingIndicator="Pending" pendingPosition="end" />
4738
+ +<LoadingButton loading loadingIndicator="Pending" loadingPosition="end" />
4529
4739
  ```
4530
4740
 
4531
4741
  - &#8203;<!-- 25 -->[ButtonBase] Remove buttonRef prop (#25896) @m4theushw
@@ -6055,7 +6265,7 @@ A big thanks to the 24 contributors who made this release possible. Here are som
6055
6265
  - [docs] Fix duplicated styles generated from emotion (#23809) @mnajdova
6056
6266
  - [docs] Fix icon alignment in /components/breadcrumbs (#23818) @eps1lon
6057
6267
  - [docs] Fix production deploy (#23963) @eps1lon
6058
- - [docs] Fix source on Github links (#23821) @praveenkumar-kalidass
6268
+ - [docs] Fix source on GitHub links (#23821) @praveenkumar-kalidass
6059
6269
  - [docs] Fix StickyHeaderTable round borders (#23882) @antoniopacheco
6060
6270
  - [docs] Fix typo in date picker dayjs adapter name (#23935) @andresmrm
6061
6271
  - [docs] Improve system properties page (#23961) @mnajdova
package/breakpoints.js CHANGED
@@ -180,9 +180,11 @@ function resolveBreakpointValues({
180
180
  if (Array.isArray(breakpointValues)) {
181
181
  acc[breakpoint] = breakpointValues[i] != null ? breakpointValues[i] : breakpointValues[previous];
182
182
  previous = i;
183
- } else {
184
- acc[breakpoint] = breakpointValues[breakpoint] != null ? breakpointValues[breakpoint] : breakpointValues[previous] || breakpointValues;
183
+ } else if (typeof breakpointValues === 'object') {
184
+ acc[breakpoint] = breakpointValues[breakpoint] != null ? breakpointValues[breakpoint] : breakpointValues[previous];
185
185
  previous = breakpoint;
186
+ } else {
187
+ acc[breakpoint] = breakpointValues;
186
188
  }
187
189
 
188
190
  return acc;
@@ -1,4 +1,4 @@
1
- export type ColorFormat = 'rgb' | 'rgba' | 'hsl' | 'hsla';
1
+ export type ColorFormat = 'rgb' | 'rgba' | 'hsl' | 'hsla' | 'color';
2
2
  export interface ColorObject {
3
3
  type: ColorFormat;
4
4
  values: [number, number, number] | [number, number, number, number];
@@ -63,7 +63,7 @@ function intToHex(int) {
63
63
  * Returns an object with the type and values of a color.
64
64
  *
65
65
  * Note: Does not support rgb % values.
66
- * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla()
66
+ * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()
67
67
  * @returns {object} - A MUI color object: {type: string, values: number[]}
68
68
  */
69
69
 
@@ -115,7 +115,7 @@ The following color spaces are supported: srgb, display-p3, a98-rgb, prophoto-rg
115
115
  /**
116
116
  * Returns a channel created from the input color.
117
117
  *
118
- * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla()
118
+ * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()
119
119
  * @returns {string} - The channel for the color, that can be used in rgba or hsla colors
120
120
  */
121
121
 
@@ -127,7 +127,7 @@ const colorChannel = color => {
127
127
  /**
128
128
  * Converts a color object with type and values to a string.
129
129
  * @param {object} color - Decomposed color
130
- * @param {string} color.type - One of: 'rgb', 'rgba', 'hsl', 'hsla'
130
+ * @param {string} color.type - One of: 'rgb', 'rgba', 'hsl', 'hsla', 'color'
131
131
  * @param {array} color.values - [n,n,n] or [n,n,n,n]
132
132
  * @returns {string} A CSS color string
133
133
  */
package/createStyled.js CHANGED
@@ -136,7 +136,7 @@ function createStyled(input = {}) {
136
136
 
137
137
  const muiStyledResolver = (styleArg, ...expressions) => {
138
138
  const expressionsWithDefaultTheme = expressions ? expressions.map(stylesArg => {
139
- // On the server emotion doesn't use React.forwardRef for creating components, so the created
139
+ // On the server Emotion doesn't use React.forwardRef for creating components, so the created
140
140
  // component stays as a function. This condition makes sure that we do not interpolate functions
141
141
  // which are basically components used as a selectors.
142
142
  // eslint-disable-next-line no-underscore-dangle
@@ -194,7 +194,7 @@ function createStyled(input = {}) {
194
194
 
195
195
  transformedStyleArg = [...styleArg, ...placeholders];
196
196
  transformedStyleArg.raw = [...styleArg.raw, ...placeholders];
197
- } else if (typeof styleArg === 'function' && // On the server emotion doesn't use React.forwardRef for creating components, so the created
197
+ } else if (typeof styleArg === 'function' && // On the server Emotion doesn't use React.forwardRef for creating components, so the created
198
198
  // component stays as a function. This condition makes sure that we do not interpolate functions
199
199
  // which are basically components used as a selectors.
200
200
  // eslint-disable-next-line no-underscore-dangle
@@ -339,7 +339,8 @@ function createCssVarsProvider(options) {
339
339
  const getInitColorSchemeScript = params => (0, _getInitColorSchemeScript.default)((0, _extends2.default)({
340
340
  attribute: defaultAttribute,
341
341
  colorSchemeStorageKey: defaultColorSchemeStorageKey,
342
- modeStorageKey: defaultModeStorageKey
342
+ modeStorageKey: defaultModeStorageKey,
343
+ enableColorScheme: designSystemEnableColorScheme
343
344
  }, params));
344
345
 
345
346
  return {
@@ -3,6 +3,11 @@ export declare const DEFAULT_MODE_STORAGE_KEY = "mode";
3
3
  export declare const DEFAULT_COLOR_SCHEME_STORAGE_KEY = "color-scheme";
4
4
  export declare const DEFAULT_ATTRIBUTE = "data-color-scheme";
5
5
  export interface GetInitColorSchemeScriptOptions {
6
+ /**
7
+ * Indicate to the browser which color scheme is used (light or dark) for rendering built-in UI
8
+ * @default true
9
+ */
10
+ enableColorScheme?: boolean;
6
11
  /**
7
12
  * If `true`, the initial color scheme is set to the user's prefers-color-scheme mode
8
13
  * @default false
@@ -23,6 +23,7 @@ exports.DEFAULT_ATTRIBUTE = DEFAULT_ATTRIBUTE;
23
23
 
24
24
  function getInitColorSchemeScript(options) {
25
25
  const {
26
+ enableColorScheme = true,
26
27
  enableSystem = false,
27
28
  defaultLightColorScheme = 'light',
28
29
  defaultDarkColorScheme = 'dark',
@@ -36,13 +37,16 @@ function getInitColorSchemeScript(options) {
36
37
  dangerouslySetInnerHTML: {
37
38
  __html: `(function() { try {
38
39
  var mode = localStorage.getItem('${modeStorageKey}');
40
+ var cssColorScheme = mode;
39
41
  var colorScheme = '';
40
42
  if (mode === 'system' || (!mode && !!${enableSystem})) {
41
43
  // handle system mode
42
44
  var mql = window.matchMedia('(prefers-color-scheme: dark)');
43
45
  if (mql.matches) {
46
+ cssColorScheme = 'dark';
44
47
  colorScheme = localStorage.getItem('${colorSchemeStorageKey}-dark') || '${defaultDarkColorScheme}';
45
48
  } else {
49
+ cssColorScheme = 'light';
46
50
  colorScheme = localStorage.getItem('${colorSchemeStorageKey}-light') || '${defaultLightColorScheme}';
47
51
  }
48
52
  }
@@ -55,6 +59,9 @@ function getInitColorSchemeScript(options) {
55
59
  if (colorScheme) {
56
60
  ${colorSchemeNode}.setAttribute('${attribute}', colorScheme);
57
61
  }
62
+ if (${enableColorScheme} && !!cssColorScheme) {
63
+ ${colorSchemeNode}.style.setProperty('color-scheme', cssColorScheme);
64
+ }
58
65
  } catch (e) {} })();`
59
66
  }
60
67
  });
@@ -154,9 +154,11 @@ export function resolveBreakpointValues({
154
154
  if (Array.isArray(breakpointValues)) {
155
155
  acc[breakpoint] = breakpointValues[i] != null ? breakpointValues[i] : breakpointValues[previous];
156
156
  previous = i;
157
- } else {
158
- acc[breakpoint] = breakpointValues[breakpoint] != null ? breakpointValues[breakpoint] : breakpointValues[previous] || breakpointValues;
157
+ } else if (typeof breakpointValues === 'object') {
158
+ acc[breakpoint] = breakpointValues[breakpoint] != null ? breakpointValues[breakpoint] : breakpointValues[previous];
159
159
  previous = breakpoint;
160
+ } else {
161
+ acc[breakpoint] = breakpointValues;
160
162
  }
161
163
 
162
164
  return acc;
@@ -45,7 +45,7 @@ function intToHex(int) {
45
45
  * Returns an object with the type and values of a color.
46
46
  *
47
47
  * Note: Does not support rgb % values.
48
- * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla()
48
+ * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()
49
49
  * @returns {object} - A MUI color object: {type: string, values: number[]}
50
50
  */
51
51
 
@@ -97,7 +97,7 @@ The following color spaces are supported: srgb, display-p3, a98-rgb, prophoto-rg
97
97
  /**
98
98
  * Returns a channel created from the input color.
99
99
  *
100
- * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla()
100
+ * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()
101
101
  * @returns {string} - The channel for the color, that can be used in rgba or hsla colors
102
102
  */
103
103
 
@@ -108,7 +108,7 @@ export const colorChannel = color => {
108
108
  /**
109
109
  * Converts a color object with type and values to a string.
110
110
  * @param {object} color - Decomposed color
111
- * @param {string} color.type - One of: 'rgb', 'rgba', 'hsl', 'hsla'
111
+ * @param {string} color.type - One of: 'rgb', 'rgba', 'hsl', 'hsla', 'color'
112
112
  * @param {array} color.values - [n,n,n] or [n,n,n,n]
113
113
  * @returns {string} A CSS color string
114
114
  */
@@ -117,7 +117,7 @@ export default function createStyled(input = {}) {
117
117
 
118
118
  const muiStyledResolver = (styleArg, ...expressions) => {
119
119
  const expressionsWithDefaultTheme = expressions ? expressions.map(stylesArg => {
120
- // On the server emotion doesn't use React.forwardRef for creating components, so the created
120
+ // On the server Emotion doesn't use React.forwardRef for creating components, so the created
121
121
  // component stays as a function. This condition makes sure that we do not interpolate functions
122
122
  // which are basically components used as a selectors.
123
123
  // eslint-disable-next-line no-underscore-dangle
@@ -176,7 +176,7 @@ export default function createStyled(input = {}) {
176
176
 
177
177
  transformedStyleArg = [...styleArg, ...placeholders];
178
178
  transformedStyleArg.raw = [...styleArg.raw, ...placeholders];
179
- } else if (typeof styleArg === 'function' && // On the server emotion doesn't use React.forwardRef for creating components, so the created
179
+ } else if (typeof styleArg === 'function' && // On the server Emotion doesn't use React.forwardRef for creating components, so the created
180
180
  // component stays as a function. This condition makes sure that we do not interpolate functions
181
181
  // which are basically components used as a selectors.
182
182
  // eslint-disable-next-line no-underscore-dangle
@@ -314,7 +314,8 @@ export default function createCssVarsProvider(options) {
314
314
  const getInitColorSchemeScript = params => systemGetInitColorSchemeScript(_extends({
315
315
  attribute: defaultAttribute,
316
316
  colorSchemeStorageKey: defaultColorSchemeStorageKey,
317
- modeStorageKey: defaultModeStorageKey
317
+ modeStorageKey: defaultModeStorageKey,
318
+ enableColorScheme: designSystemEnableColorScheme
318
319
  }, params));
319
320
 
320
321
  return {
@@ -5,6 +5,7 @@ export const DEFAULT_COLOR_SCHEME_STORAGE_KEY = 'color-scheme';
5
5
  export const DEFAULT_ATTRIBUTE = 'data-color-scheme';
6
6
  export default function getInitColorSchemeScript(options) {
7
7
  const {
8
+ enableColorScheme = true,
8
9
  enableSystem = false,
9
10
  defaultLightColorScheme = 'light',
10
11
  defaultDarkColorScheme = 'dark',
@@ -18,13 +19,16 @@ export default function getInitColorSchemeScript(options) {
18
19
  dangerouslySetInnerHTML: {
19
20
  __html: `(function() { try {
20
21
  var mode = localStorage.getItem('${modeStorageKey}');
22
+ var cssColorScheme = mode;
21
23
  var colorScheme = '';
22
24
  if (mode === 'system' || (!mode && !!${enableSystem})) {
23
25
  // handle system mode
24
26
  var mql = window.matchMedia('(prefers-color-scheme: dark)');
25
27
  if (mql.matches) {
28
+ cssColorScheme = 'dark';
26
29
  colorScheme = localStorage.getItem('${colorSchemeStorageKey}-dark') || '${defaultDarkColorScheme}';
27
30
  } else {
31
+ cssColorScheme = 'light';
28
32
  colorScheme = localStorage.getItem('${colorSchemeStorageKey}-light') || '${defaultLightColorScheme}';
29
33
  }
30
34
  }
@@ -37,6 +41,9 @@ export default function getInitColorSchemeScript(options) {
37
41
  if (colorScheme) {
38
42
  ${colorSchemeNode}.setAttribute('${attribute}', colorScheme);
39
43
  }
44
+ if (${enableColorScheme} && !!cssColorScheme) {
45
+ ${colorSchemeNode}.style.setProperty('color-scheme', cssColorScheme);
46
+ }
40
47
  } catch (e) {} })();`
41
48
  }
42
49
  });
@@ -39,7 +39,7 @@ export function unstable_createStyleFunctionSx(styleFunctionMapping = defaultSty
39
39
  } = props || {};
40
40
 
41
41
  if (!sx) {
42
- return null; // emotion & styled-components will neglect null
42
+ return null; // Emotion & styled-components will neglect null
43
43
  }
44
44
  /*
45
45
  * Receive `sxInput` as object or callback
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license MUI v5.8.3
1
+ /** @license MUI v5.8.6
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.
@@ -167,9 +167,11 @@ export function resolveBreakpointValues(_ref) {
167
167
  if (Array.isArray(breakpointValues)) {
168
168
  acc[breakpoint] = breakpointValues[i] != null ? breakpointValues[i] : breakpointValues[previous];
169
169
  previous = i;
170
- } else {
171
- acc[breakpoint] = breakpointValues[breakpoint] != null ? breakpointValues[breakpoint] : breakpointValues[previous] || breakpointValues;
170
+ } else if (_typeof(breakpointValues) === 'object') {
171
+ acc[breakpoint] = breakpointValues[breakpoint] != null ? breakpointValues[breakpoint] : breakpointValues[previous];
172
172
  previous = breakpoint;
173
+ } else {
174
+ acc[breakpoint] = breakpointValues;
173
175
  }
174
176
 
175
177
  return acc;
@@ -50,7 +50,7 @@ function intToHex(int) {
50
50
  * Returns an object with the type and values of a color.
51
51
  *
52
52
  * Note: Does not support rgb % values.
53
- * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla()
53
+ * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()
54
54
  * @returns {object} - A MUI color object: {type: string, values: number[]}
55
55
  */
56
56
 
@@ -102,7 +102,7 @@ export function decomposeColor(color) {
102
102
  /**
103
103
  * Returns a channel created from the input color.
104
104
  *
105
- * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla()
105
+ * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()
106
106
  * @returns {string} - The channel for the color, that can be used in rgba or hsla colors
107
107
  */
108
108
 
@@ -115,7 +115,7 @@ export var colorChannel = function colorChannel(color) {
115
115
  /**
116
116
  * Converts a color object with type and values to a string.
117
117
  * @param {object} color - Decomposed color
118
- * @param {string} color.type - One of: 'rgb', 'rgba', 'hsl', 'hsla'
118
+ * @param {string} color.type - One of: 'rgb', 'rgba', 'hsl', 'hsla', 'color'
119
119
  * @param {array} color.values - [n,n,n] or [n,n,n,n]
120
120
  * @returns {string} A CSS color string
121
121
  */
@@ -122,7 +122,7 @@ export default function createStyled() {
122
122
  }
123
123
 
124
124
  var expressionsWithDefaultTheme = expressions ? expressions.map(function (stylesArg) {
125
- // On the server emotion doesn't use React.forwardRef for creating components, so the created
125
+ // On the server Emotion doesn't use React.forwardRef for creating components, so the created
126
126
  // component stays as a function. This condition makes sure that we do not interpolate functions
127
127
  // which are basically components used as a selectors.
128
128
  // eslint-disable-next-line no-underscore-dangle
@@ -183,7 +183,7 @@ export default function createStyled() {
183
183
 
184
184
  transformedStyleArg = [].concat(_toConsumableArray(styleArg), _toConsumableArray(placeholders));
185
185
  transformedStyleArg.raw = [].concat(_toConsumableArray(styleArg.raw), _toConsumableArray(placeholders));
186
- } else if (typeof styleArg === 'function' && // On the server emotion doesn't use React.forwardRef for creating components, so the created
186
+ } else if (typeof styleArg === 'function' && // On the server Emotion doesn't use React.forwardRef for creating components, so the created
187
187
  // component stays as a function. This condition makes sure that we do not interpolate functions
188
188
  // which are basically components used as a selectors.
189
189
  // eslint-disable-next-line no-underscore-dangle
@@ -342,7 +342,8 @@ export default function createCssVarsProvider(options) {
342
342
  return systemGetInitColorSchemeScript(_extends({
343
343
  attribute: defaultAttribute,
344
344
  colorSchemeStorageKey: defaultColorSchemeStorageKey,
345
- modeStorageKey: defaultModeStorageKey
345
+ modeStorageKey: defaultModeStorageKey,
346
+ enableColorScheme: designSystemEnableColorScheme
346
347
  }, params));
347
348
  };
348
349
 
@@ -5,6 +5,8 @@ export var DEFAULT_COLOR_SCHEME_STORAGE_KEY = 'color-scheme';
5
5
  export var DEFAULT_ATTRIBUTE = 'data-color-scheme';
6
6
  export default function getInitColorSchemeScript(options) {
7
7
  var _ref = options || {},
8
+ _ref$enableColorSchem = _ref.enableColorScheme,
9
+ enableColorScheme = _ref$enableColorSchem === void 0 ? true : _ref$enableColorSchem,
8
10
  _ref$enableSystem = _ref.enableSystem,
9
11
  enableSystem = _ref$enableSystem === void 0 ? false : _ref$enableSystem,
10
12
  _ref$defaultLightColo = _ref.defaultLightColorScheme,
@@ -23,7 +25,7 @@ export default function getInitColorSchemeScript(options) {
23
25
  return /*#__PURE__*/_jsx("script", {
24
26
  // eslint-disable-next-line react/no-danger
25
27
  dangerouslySetInnerHTML: {
26
- __html: "(function() { try {\n var mode = localStorage.getItem('".concat(modeStorageKey, "');\n var colorScheme = '';\n if (mode === 'system' || (!mode && !!").concat(enableSystem, ")) {\n // handle system mode\n var mql = window.matchMedia('(prefers-color-scheme: dark)');\n if (mql.matches) {\n colorScheme = localStorage.getItem('").concat(colorSchemeStorageKey, "-dark') || '").concat(defaultDarkColorScheme, "';\n } else {\n colorScheme = localStorage.getItem('").concat(colorSchemeStorageKey, "-light') || '").concat(defaultLightColorScheme, "';\n }\n }\n if (mode === 'light') {\n colorScheme = localStorage.getItem('").concat(colorSchemeStorageKey, "-light') || '").concat(defaultLightColorScheme, "';\n }\n if (mode === 'dark') {\n colorScheme = localStorage.getItem('").concat(colorSchemeStorageKey, "-dark') || '").concat(defaultDarkColorScheme, "';\n }\n if (colorScheme) {\n ").concat(colorSchemeNode, ".setAttribute('").concat(attribute, "', colorScheme);\n }\n } catch (e) {} })();")
28
+ __html: "(function() { try {\n var mode = localStorage.getItem('".concat(modeStorageKey, "');\n var cssColorScheme = mode;\n var colorScheme = '';\n if (mode === 'system' || (!mode && !!").concat(enableSystem, ")) {\n // handle system mode\n var mql = window.matchMedia('(prefers-color-scheme: dark)');\n if (mql.matches) {\n cssColorScheme = 'dark';\n colorScheme = localStorage.getItem('").concat(colorSchemeStorageKey, "-dark') || '").concat(defaultDarkColorScheme, "';\n } else {\n cssColorScheme = 'light';\n colorScheme = localStorage.getItem('").concat(colorSchemeStorageKey, "-light') || '").concat(defaultLightColorScheme, "';\n }\n }\n if (mode === 'light') {\n colorScheme = localStorage.getItem('").concat(colorSchemeStorageKey, "-light') || '").concat(defaultLightColorScheme, "';\n }\n if (mode === 'dark') {\n colorScheme = localStorage.getItem('").concat(colorSchemeStorageKey, "-dark') || '").concat(defaultDarkColorScheme, "';\n }\n if (colorScheme) {\n ").concat(colorSchemeNode, ".setAttribute('").concat(attribute, "', colorScheme);\n }\n if (").concat(enableColorScheme, " && !!cssColorScheme) {\n ").concat(colorSchemeNode, ".style.setProperty('color-scheme', cssColorScheme);\n }\n } catch (e) {} })();")
27
29
  }
28
30
  });
29
31
  }
package/legacy/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license MUI v5.8.3
1
+ /** @license MUI v5.8.6
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.
@@ -47,7 +47,7 @@ export function unstable_createStyleFunctionSx() {
47
47
  theme = _ref2$theme === void 0 ? {} : _ref2$theme;
48
48
 
49
49
  if (!sx) {
50
- return null; // emotion & styled-components will neglect null
50
+ return null; // Emotion & styled-components will neglect null
51
51
  }
52
52
  /*
53
53
  * Receive `sxInput` as object or callback
@@ -152,9 +152,11 @@ export function resolveBreakpointValues({
152
152
  if (Array.isArray(breakpointValues)) {
153
153
  acc[breakpoint] = breakpointValues[i] != null ? breakpointValues[i] : breakpointValues[previous];
154
154
  previous = i;
155
- } else {
156
- acc[breakpoint] = breakpointValues[breakpoint] != null ? breakpointValues[breakpoint] : breakpointValues[previous] || breakpointValues;
155
+ } else if (typeof breakpointValues === 'object') {
156
+ acc[breakpoint] = breakpointValues[breakpoint] != null ? breakpointValues[breakpoint] : breakpointValues[previous];
157
157
  previous = breakpoint;
158
+ } else {
159
+ acc[breakpoint] = breakpointValues;
158
160
  }
159
161
 
160
162
  return acc;
@@ -45,7 +45,7 @@ function intToHex(int) {
45
45
  * Returns an object with the type and values of a color.
46
46
  *
47
47
  * Note: Does not support rgb % values.
48
- * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla()
48
+ * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()
49
49
  * @returns {object} - A MUI color object: {type: string, values: number[]}
50
50
  */
51
51
 
@@ -97,7 +97,7 @@ The following color spaces are supported: srgb, display-p3, a98-rgb, prophoto-rg
97
97
  /**
98
98
  * Returns a channel created from the input color.
99
99
  *
100
- * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla()
100
+ * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()
101
101
  * @returns {string} - The channel for the color, that can be used in rgba or hsla colors
102
102
  */
103
103
 
@@ -108,7 +108,7 @@ export const colorChannel = color => {
108
108
  /**
109
109
  * Converts a color object with type and values to a string.
110
110
  * @param {object} color - Decomposed color
111
- * @param {string} color.type - One of: 'rgb', 'rgba', 'hsl', 'hsla'
111
+ * @param {string} color.type - One of: 'rgb', 'rgba', 'hsl', 'hsla', 'color'
112
112
  * @param {array} color.values - [n,n,n] or [n,n,n,n]
113
113
  * @returns {string} A CSS color string
114
114
  */
@@ -115,7 +115,7 @@ export default function createStyled(input = {}) {
115
115
 
116
116
  const muiStyledResolver = (styleArg, ...expressions) => {
117
117
  const expressionsWithDefaultTheme = expressions ? expressions.map(stylesArg => {
118
- // On the server emotion doesn't use React.forwardRef for creating components, so the created
118
+ // On the server Emotion doesn't use React.forwardRef for creating components, so the created
119
119
  // component stays as a function. This condition makes sure that we do not interpolate functions
120
120
  // which are basically components used as a selectors.
121
121
  // eslint-disable-next-line no-underscore-dangle
@@ -174,7 +174,7 @@ export default function createStyled(input = {}) {
174
174
 
175
175
  transformedStyleArg = [...styleArg, ...placeholders];
176
176
  transformedStyleArg.raw = [...styleArg.raw, ...placeholders];
177
- } else if (typeof styleArg === 'function' && // On the server emotion doesn't use React.forwardRef for creating components, so the created
177
+ } else if (typeof styleArg === 'function' && // On the server Emotion doesn't use React.forwardRef for creating components, so the created
178
178
  // component stays as a function. This condition makes sure that we do not interpolate functions
179
179
  // which are basically components used as a selectors.
180
180
  // eslint-disable-next-line no-underscore-dangle
@@ -314,7 +314,8 @@ export default function createCssVarsProvider(options) {
314
314
  const getInitColorSchemeScript = params => systemGetInitColorSchemeScript(_extends({
315
315
  attribute: defaultAttribute,
316
316
  colorSchemeStorageKey: defaultColorSchemeStorageKey,
317
- modeStorageKey: defaultModeStorageKey
317
+ modeStorageKey: defaultModeStorageKey,
318
+ enableColorScheme: designSystemEnableColorScheme
318
319
  }, params));
319
320
 
320
321
  return {
@@ -5,6 +5,7 @@ export const DEFAULT_COLOR_SCHEME_STORAGE_KEY = 'color-scheme';
5
5
  export const DEFAULT_ATTRIBUTE = 'data-color-scheme';
6
6
  export default function getInitColorSchemeScript(options) {
7
7
  const {
8
+ enableColorScheme = true,
8
9
  enableSystem = false,
9
10
  defaultLightColorScheme = 'light',
10
11
  defaultDarkColorScheme = 'dark',
@@ -18,13 +19,16 @@ export default function getInitColorSchemeScript(options) {
18
19
  dangerouslySetInnerHTML: {
19
20
  __html: `(function() { try {
20
21
  var mode = localStorage.getItem('${modeStorageKey}');
22
+ var cssColorScheme = mode;
21
23
  var colorScheme = '';
22
24
  if (mode === 'system' || (!mode && !!${enableSystem})) {
23
25
  // handle system mode
24
26
  var mql = window.matchMedia('(prefers-color-scheme: dark)');
25
27
  if (mql.matches) {
28
+ cssColorScheme = 'dark';
26
29
  colorScheme = localStorage.getItem('${colorSchemeStorageKey}-dark') || '${defaultDarkColorScheme}';
27
30
  } else {
31
+ cssColorScheme = 'light';
28
32
  colorScheme = localStorage.getItem('${colorSchemeStorageKey}-light') || '${defaultLightColorScheme}';
29
33
  }
30
34
  }
@@ -37,6 +41,9 @@ export default function getInitColorSchemeScript(options) {
37
41
  if (colorScheme) {
38
42
  ${colorSchemeNode}.setAttribute('${attribute}', colorScheme);
39
43
  }
44
+ if (${enableColorScheme} && !!cssColorScheme) {
45
+ ${colorSchemeNode}.style.setProperty('color-scheme', cssColorScheme);
46
+ }
40
47
  } catch (e) {} })();`
41
48
  }
42
49
  });
package/modern/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license MUI v5.8.3
1
+ /** @license MUI v5.8.6
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.
@@ -39,7 +39,7 @@ export function unstable_createStyleFunctionSx(styleFunctionMapping = defaultSty
39
39
  } = props || {};
40
40
 
41
41
  if (!sx) {
42
- return null; // emotion & styled-components will neglect null
42
+ return null; // Emotion & styled-components will neglect null
43
43
  }
44
44
  /*
45
45
  * Receive `sxInput` as object or callback
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/system",
3
- "version": "5.8.3",
3
+ "version": "5.8.6",
4
4
  "private": false,
5
5
  "author": "MUI Team",
6
6
  "description": "CSS utilities for rapidly laying out custom designs.",
@@ -44,10 +44,10 @@
44
44
  },
45
45
  "dependencies": {
46
46
  "@babel/runtime": "^7.17.2",
47
- "@mui/private-theming": "^5.8.0",
47
+ "@mui/private-theming": "^5.8.6",
48
48
  "@mui/styled-engine": "^5.8.0",
49
- "@mui/types": "^7.1.3",
50
- "@mui/utils": "^5.8.0",
49
+ "@mui/types": "^7.1.4",
50
+ "@mui/utils": "^5.8.6",
51
51
  "clsx": "^1.1.1",
52
52
  "csstype": "^3.1.0",
53
53
  "prop-types": "^15.8.1"
package/style.d.ts CHANGED
@@ -13,3 +13,4 @@ export interface StyleOptions<PropKey> {
13
13
  export function style<PropKey extends string, Theme extends object>(
14
14
  options: StyleOptions<PropKey>,
15
15
  ): StyleFunction<{ [K in PropKey]?: unknown } & { theme?: Theme }> & { filterProps: string[] };
16
+ export function getPath<T>(obj: T, path: string | undefined, checkVars?: boolean): null | unknown;
@@ -51,7 +51,7 @@ function unstable_createStyleFunctionSx(styleFunctionMapping = _getThemeValue.st
51
51
  } = props || {};
52
52
 
53
53
  if (!sx) {
54
- return null; // emotion & styled-components will neglect null
54
+ return null; // Emotion & styled-components will neglect null
55
55
  }
56
56
  /*
57
57
  * Receive `sxInput` as object or callback