@mui/system 5.2.6 → 5.2.8

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,4 +1,83 @@
1
- ### [Versions](https://mui.com/versions/)
1
+ # [Versions](https://mui.com/versions/)
2
+
3
+ ## 5.2.8
4
+
5
+ <!-- generated comparing v5.2.7..master -->
6
+
7
+ _Jan 10, 2022_
8
+
9
+ A big thanks to the 10 contributors who made this release possible. Here are some highlights ✨:
10
+
11
+ - A meaningful number of 🐛 bug fixes and 📚 documentation improvements.
12
+
13
+ ### `@mui/material@5.2.8`
14
+
15
+ - &#8203;<!-- 05 -->[TextField][inputlabel] Remove `pointer-events: none` property (#30493) @hbjORbj
16
+ - &#8203;<!-- 02 -->[Slider] Add `input` slot to components and componentsProps (#30362) @alexandre-lelain
17
+
18
+ ### `@mui/joy@5.0.0-alpha.10`
19
+
20
+ - &#8203;<!-- 04 -->[Joy] Add `Typography` component (#30489) @siriwatknp
21
+ - &#8203;<!-- 03 -->[Joy] Add functional `Switch` component (#30487) @siriwatknp
22
+
23
+ ### Docs
24
+
25
+ - &#8203;<!-- 18 -->[docs] Update markdown parser to remove backticks from description (#30495) @aefox
26
+ - &#8203;<!-- 17 -->[docs] Fix the crash when applying custom colors (#30563) @siriwatknp
27
+ - &#8203;<!-- 16 -->[docs] Location change of Sebastian (#30528) @eps1lon
28
+ - &#8203;<!-- 15 -->[docs] Lint markdown in the CI (#30395) @oliviertassinari
29
+ - &#8203;<!-- 14 -->[docs] Fix `componentsProps` API docs and PropTypes (#30502) @ZeeshanTamboli
30
+ - &#8203;<!-- 13 -->[docs] Codemod doc for overriding styles using tss (#30499) @garronej
31
+ - &#8203;<!-- 12 -->[docs] fix edge case when replacing data-grid url for migration (#30505) @siriwatknp
32
+ - &#8203;<!-- 11 -->[docs] fix replace url for migration (#30503) @siriwatknp
33
+ - &#8203;<!-- 10 -->[docs] Prepare scripts for migrating to new structure (#30386) @siriwatknp
34
+ - &#8203;<!-- 09 -->[docs] Adjust RTL Guide demos to fully support RTL (#30387) @noam-honig
35
+ - &#8203;<!-- 08 -->[docs] Move @eps1lon to community (#30473) @oliviertassinari
36
+ - &#8203;<!-- 07 -->[docs] Fix typo and spelling in the-sx-prop.md (#30482) @aefox
37
+ - &#8203;<!-- 06 -->[docs] More general docs polishing (#30371) @danilo-leal
38
+ - &#8203;<!-- 01 -->[website] Add José on the /about page (#30492) @danilo-leal
39
+
40
+ All contributors of this release in alphabetical order: @aefox, @alexandre-lelain, @danilo-leal, @eps1lon, @garronej, @hbjORbj, @noam-honig, @oliviertassinari, @siriwatknp, @ZeeshanTamboli
41
+
42
+ ## 5.2.7
43
+
44
+ <!-- generated comparing v5.2.6..master -->
45
+
46
+ _Jan 3, 2022_
47
+
48
+ A big thanks to the 14 contributors who made this release possible. Here are some highlights ✨:
49
+
50
+ - 📓 Improvements on the Vietnamese (vi-VN) and Finnish (fi-FI) locales (#30426, #30442) @hckhanh @Certificate
51
+ - And more 🐛 bug fixes and 📚 documentation improvements.
52
+
53
+ ### `@mui/material@5.2.7`
54
+
55
+ - &#8203;<!-- 14 -->[Autocomplete] Fix calling onChange for duplicate values (#30374) @alisasanib
56
+ - &#8203;<!-- 13 -->[Avatar] Fix TypeScript error on imgProps (#30255) @ahmad-reza619
57
+ - &#8203;<!-- 12 -->[Badge] Fix `classes` prop TypeScript type (#30427) @ZeeshanTamboli
58
+ - &#8203;<!-- 03 -->[SvgIcon] Allow viewBox to inherit from Component through inheritViewBox prop (#29954) @alex-dikusar
59
+ - &#8203;<!-- 04 -->[SvgIcon] Correct API docs and code style (#30470) @michaldudak
60
+
61
+ ### Docs
62
+
63
+ - &#8203;<!-- 11 -->[blog] 2021 (#30425) @oliviertassinari
64
+ - &#8203;<!-- 15 -->[docs] Fix typo on the Grid docs page (#30446) @abhi45
65
+ - &#8203;<!-- 07 -->[docs] Fix `useMediaQuery` SSR example to v5 theme API (#30454) @ValentinH
66
+ - &#8203;<!-- 11 -->[docs] Improve the migration guide and add examples for transforming to `tss-react` (#30388) @mnajdova
67
+ - &#8203;<!-- 09 -->[docs] Make the reference to the select clearer (#30460) @boazrymland
68
+ - &#8203;<!-- 08 -->[docs] Sync translations with Crowdin (#30385) @l10nbot
69
+ - &#8203;<!-- 06 -->[example] Avoid double rendering in the Remix example (#30366) @mnajdova
70
+ - &#8203;<!-- 05 -->[i18n] improve viVN locale (#30426) @hckhanh
71
+ - &#8203;<!-- 04 -->[l10n] Improve fiFI locale (#30442) @Certificate
72
+ - &#8203;<!-- 02 -->[website] Add new batch of open roles (#30282) @oliviertassinari
73
+ - &#8203;<!-- 01 -->[website] Refactor page context with next router (#30020) @siriwatknp
74
+
75
+ ### Core
76
+
77
+ - &#8203;<!-- 13 -->[core] Automatically close issues that are incomplete and inactive (#30459) @oliviertassinari
78
+ - &#8203;<!-- 10 -->[core] Remove contrib tweet (#30455) @oliviertassinari
79
+
80
+ All contributors of this release in alphabetical order: @abhi45, @ahmad-reza619, @alex-dikusar, @alisasanib, @boazrymland, @Certificate, @hckhanh, @l10nbot, @michaldudak, @mnajdova, @oliviertassinari, @siriwatknp, @ValentinH, @ZeeshanTamboli
2
81
 
3
82
  ## 5.2.6
4
83
 
@@ -1185,7 +1264,7 @@ A big thanks to the 18 contributors who made this release possible. Here are som
1185
1264
 
1186
1265
  replace `@material-ui/*` prefix with `@mui/*`:
1187
1266
 
1188
- ```
1267
+ ```sh
1189
1268
  @material-ui/system -> @mui/system
1190
1269
  @material-ui/styles -> @mui/styles
1191
1270
  @material-ui/lab -> @mui/lab
@@ -1198,7 +1277,7 @@ A big thanks to the 18 contributors who made this release possible. Here are som
1198
1277
 
1199
1278
  except these 3 packages that are renamed.
1200
1279
 
1201
- ```
1280
+ ```sh
1202
1281
  @material-ui/core => @mui/material // represents Material Design components.
1203
1282
  @material-ui/icons => @mui/icons-material // represents Material Design icons.
1204
1283
  @material-ui/unstyled => @mui/base // fully functional components with minimum styles.
@@ -2571,6 +2650,7 @@ A big thanks to the 16 contributors who made this release possible. Here are som
2571
2650
  ```
2572
2651
 
2573
2652
  - &#8203;<!-- 63 -->[Autocomplete] Rename getOptionSelected to isOptionEqualToValue (#26173) @m4theushw
2653
+
2574
2654
  ```diff
2575
2655
  <Autocomplete
2576
2656
  - getOptionSelected={(option, value) => option.title === value.title}
@@ -4144,7 +4224,7 @@ All contributors of this release in alphabetical order: @artola, @CyanoFresh, @d
4144
4224
 
4145
4225
  ## 5.0.0-alpha.23
4146
4226
 
4147
- ###### _Jan 14, 2021_
4227
+ _Jan 14, 2021_
4148
4228
 
4149
4229
  A big thanks to the 15 contributors who made this release possible. Here are some highlights ✨:
4150
4230
 
@@ -4259,7 +4339,7 @@ A big thanks to the 15 contributors who made this release possible. Here are som
4259
4339
 
4260
4340
  ## 5.0.0-alpha.22
4261
4341
 
4262
- ###### _Jan 4, 2021_
4342
+ _Jan 4, 2021_
4263
4343
 
4264
4344
  A big thanks to the 14 contributors who made this release possible. Here are some highlights ✨:
4265
4345
 
@@ -4311,7 +4391,7 @@ A big thanks to the 14 contributors who made this release possible. Here are som
4311
4391
 
4312
4392
  ## 5.0.0-alpha.21
4313
4393
 
4314
- ###### _Dec 30, 2020_
4394
+ _Dec 30, 2020_
4315
4395
 
4316
4396
  A big thanks to the 14 contributors who made this release possible. Here are some highlights ✨:
4317
4397
 
@@ -4384,7 +4464,7 @@ A big thanks to the 14 contributors who made this release possible. Here are som
4384
4464
 
4385
4465
  ## 5.0.0-alpha.20
4386
4466
 
4387
- ###### _Dec 21, 2020_
4467
+ _Dec 21, 2020_
4388
4468
 
4389
4469
  A big thanks to the 13 contributors who made this release possible. Here are some highlights ✨:
4390
4470
 
@@ -4462,7 +4542,7 @@ A big thanks to the 13 contributors who made this release possible. Here are som
4462
4542
 
4463
4543
  ## 5.0.0-alpha.19
4464
4544
 
4465
- ###### _Dec 13, 2020_
4545
+ _Dec 13, 2020_
4466
4546
 
4467
4547
  A big thanks to the 24 contributors who made this release possible. Here are some highlights ✨:
4468
4548
 
@@ -4590,7 +4670,7 @@ A big thanks to the 24 contributors who made this release possible. Here are som
4590
4670
 
4591
4671
  ## 5.0.0-alpha.18
4592
4672
 
4593
- ###### _Dec 3, 2020_
4673
+ _Dec 3, 2020_
4594
4674
 
4595
4675
  A big thanks to the 17 contributors who made this release possible. Here are some highlights ✨:
4596
4676
 
@@ -4682,7 +4762,7 @@ A big thanks to the 17 contributors who made this release possible. Here are som
4682
4762
 
4683
4763
  ## 5.0.0-alpha.17
4684
4764
 
4685
- ###### _Nov 23, 2020_
4765
+ _Nov 23, 2020_
4686
4766
 
4687
4767
  A big thanks to the 18 contributors who made this release possible. Here are some highlights ✨:
4688
4768
 
@@ -4849,7 +4929,7 @@ A big thanks to the 18 contributors who made this release possible. Here are som
4849
4929
 
4850
4930
  ## 5.0.0-alpha.16
4851
4931
 
4852
- ###### _Nov 14, 2020_
4932
+ _Nov 14, 2020_
4853
4933
 
4854
4934
  A big thanks to the 34 contributors who made this release possible. Here are some highlights ✨:
4855
4935
 
@@ -4953,7 +5033,7 @@ A big thanks to the 34 contributors who made this release possible. Here are som
4953
5033
 
4954
5034
  ## 5.0.0-alpha.15
4955
5035
 
4956
- ###### _Nov 4, 2020_
5036
+ _Nov 4, 2020_
4957
5037
 
4958
5038
  A big thanks to the 20 contributors who made this release possible. Here are some highlights ✨:
4959
5039
 
@@ -5065,7 +5145,7 @@ A big thanks to the 20 contributors who made this release possible. Here are som
5065
5145
 
5066
5146
  ## 5.0.0-alpha.14
5067
5147
 
5068
- ###### _Oct 23, 2020_
5148
+ _Oct 23, 2020_
5069
5149
 
5070
5150
  A big thanks to the 23 contributors who made this release possible.
5071
5151
  Here are some highlights ✨:
@@ -5116,12 +5196,14 @@ Here are some highlights ✨:
5116
5196
  You can read [their migration guide](https://popper.js.org/docs/v2/migration-guide/) or the following summary:
5117
5197
 
5118
5198
  - The CSS prefixes have changed:
5199
+
5119
5200
  ```diff
5120
5201
  popper: {
5121
5202
  zIndex: 1,
5122
5203
  - '&[x-placement*="bottom"] $arrow': {
5123
5204
  + '&[data-popper-placement*="bottom"] $arrow': {
5124
5205
  ```
5206
+
5125
5207
  - Method names have changed.
5126
5208
 
5127
5209
  ```diff
@@ -5236,7 +5318,7 @@ Here are some highlights ✨:
5236
5318
 
5237
5319
  ## 5.0.0-alpha.13
5238
5320
 
5239
- ###### _Oct 17, 2020_
5321
+ _Oct 17, 2020_
5240
5322
 
5241
5323
  A big thanks to the 25 contributors who made this release possible.
5242
5324
  Here are some highlights ✨:
@@ -5362,7 +5444,7 @@ Here are some highlights ✨:
5362
5444
 
5363
5445
  ## 5.0.0-alpha.12
5364
5446
 
5365
- ###### _Oct 11, 2020_
5447
+ _Oct 11, 2020_
5366
5448
 
5367
5449
  A big thanks to the 45 contributors who made this release possible.
5368
5450
  Here are some highlights ✨:
@@ -5586,7 +5668,7 @@ Here are some highlights ✨:
5586
5668
 
5587
5669
  ## 5.0.0-alpha.11
5588
5670
 
5589
- ###### _Sep 26, 2020_
5671
+ _Sep 26, 2020_
5590
5672
 
5591
5673
  A big thanks to the 29 contributors who made this release possible.
5592
5674
  Here are some highlights ✨:
@@ -5820,7 +5902,7 @@ More documentation are coming.
5820
5902
 
5821
5903
  ## 5.0.0-alpha.10
5822
5904
 
5823
- ###### _Sep 15, 2020_
5905
+ _Sep 15, 2020_
5824
5906
 
5825
5907
  A big thanks to the 16 contributors who made this release possible.
5826
5908
  Here are some highlights ✨:
@@ -5885,13 +5967,13 @@ Here are some highlights ✨:
5885
5967
 
5886
5968
  Before:
5887
5969
 
5888
- ```
5970
+ ```sh
5889
5971
  theme.spacing(2) => 16
5890
5972
  ```
5891
5973
 
5892
5974
  After:
5893
5975
 
5894
- ```
5976
+ ```sh
5895
5977
  theme.spacing(2) => '16px'
5896
5978
  ```
5897
5979
 
@@ -5950,7 +6032,7 @@ Here are some highlights ✨:
5950
6032
 
5951
6033
  ## 5.0.0-alpha.9
5952
6034
 
5953
- ###### _Sep 6, 2020_
6035
+ _Sep 6, 2020_
5954
6036
 
5955
6037
  A big thanks to the 14 contributors who made this release possible.
5956
6038
  Here are some highlights ✨:
@@ -6003,7 +6085,7 @@ Here are some highlights ✨:
6003
6085
 
6004
6086
  ## 5.0.0-alpha.8
6005
6087
 
6006
- ###### _Aug 31, 2020_
6088
+ _Aug 31, 2020_
6007
6089
 
6008
6090
  A big thanks to the 19 contributors who made this release possible.
6009
6091
  Here are some highlights ✨:
@@ -6179,7 +6261,7 @@ const theme = createMuiTheme({
6179
6261
 
6180
6262
  ## 5.0.0-alpha.7
6181
6263
 
6182
- ###### _Aug 22, 2020_
6264
+ _Aug 22, 2020_
6183
6265
 
6184
6266
  A big thanks to the 22 contributors who made this release possible.
6185
6267
  Here are some highlights ✨:
@@ -6309,7 +6391,7 @@ Here are some highlights ✨:
6309
6391
 
6310
6392
  ## 5.0.0-alpha.6
6311
6393
 
6312
- ###### _Aug 13, 2020_
6394
+ _Aug 13, 2020_
6313
6395
 
6314
6396
  A big thanks to the 26 contributors who made this release possible.
6315
6397
  Here are some highlights ✨:
@@ -6352,7 +6434,7 @@ Here are some highlights ✨:
6352
6434
 
6353
6435
  ### `@material-ui/core@v5.0.0-alpha.6`
6354
6436
 
6355
- ### Breaking changes
6437
+ #### Breaking changes
6356
6438
 
6357
6439
  - [Avatar] Rename variant circle -> circular for consistency (#22015) @kodai3
6358
6440
  Rename `circle` to `circular` for consistency. The possible values should be adjectives, not nouns:
@@ -6511,7 +6593,7 @@ Here are some highlights ✨:
6511
6593
  +},
6512
6594
  ```
6513
6595
 
6514
- ### Changes
6596
+ #### Changes
6515
6597
 
6516
6598
  - [Avatar] Custom variant (#22139) @mnajdova
6517
6599
  - [Badge] Add missing class key (#22095) @kodai3
@@ -6531,7 +6613,7 @@ Here are some highlights ✨:
6531
6613
 
6532
6614
  ### `@material-ui/lab@v5.0.0-alpha.6`
6533
6615
 
6534
- ### Breaking changes
6616
+ #### Breaking changes
6535
6617
 
6536
6618
  - [Skeleton] Rename variant circle -> circular and rect -> rectangular for consistency (#22053) @kodai3
6537
6619
  Rename `circle` to `circular` and `rect` to `rectangular` for consistency. The possible values should be adjectives, not nouns:
@@ -6543,7 +6625,7 @@ Here are some highlights ✨:
6543
6625
  +<Skeleton variant="rectangular">
6544
6626
  ```
6545
6627
 
6546
- ### Changes
6628
+ #### Changes
6547
6629
 
6548
6630
  - [Autocomplete] Add support for "{label: string}" data type as a default for "options" (#21992) @DanailH
6549
6631
  - [TreeView] Add disabled prop (#20133) @netochaves
@@ -6595,7 +6677,7 @@ Here are some highlights ✨:
6595
6677
 
6596
6678
  ## 5.0.0-alpha.5
6597
6679
 
6598
- ###### _July 28, 2020_
6680
+ _July 28, 2020_
6599
6681
 
6600
6682
  A big thanks to the 18 contributors who made this release possible.
6601
6683
 
@@ -6666,7 +6748,7 @@ A big thanks to the 18 contributors who made this release possible.
6666
6748
 
6667
6749
  ## 5.0.0-alpha.4
6668
6750
 
6669
- ###### _July 19, 2020_
6751
+ _July 19, 2020_
6670
6752
 
6671
6753
  A big thanks to the 11 contributors who made this release possible.
6672
6754
 
@@ -6708,7 +6790,7 @@ A big thanks to the 11 contributors who made this release possible.
6708
6790
 
6709
6791
  ## 5.0.0-alpha.3
6710
6792
 
6711
- ###### _July 12, 2020_
6793
+ _July 12, 2020_
6712
6794
 
6713
6795
  A big thanks to the 14 contributors who made this release possible.
6714
6796
 
@@ -6757,7 +6839,7 @@ A big thanks to the 14 contributors who made this release possible.
6757
6839
 
6758
6840
  ## 5.0.0-alpha.2
6759
6841
 
6760
- ###### _July 4, 2020_
6842
+ _July 4, 2020_
6761
6843
 
6762
6844
  A big thanks to the 16 contributors who made this release possible.
6763
6845
 
@@ -6819,7 +6901,7 @@ A big thanks to the 16 contributors who made this release possible.
6819
6901
 
6820
6902
  ## 5.0.0-alpha.1
6821
6903
 
6822
- ###### _June 27, 2020_
6904
+ _June 27, 2020_
6823
6905
 
6824
6906
  A big thanks to the 33 contributors who made this release possible. Here are some highlights ✨:
6825
6907
 
@@ -6935,6 +7017,7 @@ A big thanks to the 33 contributors who made this release possible. Here are som
6935
7017
  ```
6936
7018
 
6937
7019
  - [Accordion] typescript: The `event` in `onChange` is no longer typed as a `React.ChangeEvent` but `React.SyntheticEvent`.
7020
+
6938
7021
  ```diff
6939
7022
  -<Accordion onChange={(event: React.ChangeEvent<{}>, expanded: boolean) => {}} />
6940
7023
  +<Accordion onChange={(event: React.SyntheticEvent, expanded: boolean) => {}} />
@@ -32,7 +32,7 @@ var _getInitColorSchemeScript = _interopRequireWildcard(require("./getInitColorS
32
32
 
33
33
  var _useCurrentColorScheme = _interopRequireDefault(require("./useCurrentColorScheme"));
34
34
 
35
- var _createGetThemeVar = _interopRequireDefault(require("./createGetThemeVar"));
35
+ var _createGetCssVar = _interopRequireDefault(require("./createGetCssVar"));
36
36
 
37
37
  var _jsxRuntime = require("react/jsx-runtime");
38
38
 
@@ -154,7 +154,7 @@ function createCssVarsProvider(options) {
154
154
  vars: rootVars,
155
155
  spacing: themeProp.spacing ? (0, _createSpacing.default)(themeProp.spacing) : systemSpacing,
156
156
  breakpoints: themeProp.breakpoints ? (0, _createBreakpoints.default)(themeProp.breakpoints) : systemBreakpoints,
157
- getThemeVar: (0, _createGetThemeVar.default)(prefix)
157
+ getCssVar: (0, _createGetCssVar.default)(prefix)
158
158
  });
159
159
  const styleSheet = {};
160
160
  Object.entries(colorSchemes).forEach(([key, scheme]) => {
@@ -0,0 +1,5 @@
1
+ /**
2
+ * The benefit of this function is to help developers get CSS var from theme without specifying the whole variable
3
+ * and they does not need to remember the prefix (defined once).
4
+ */
5
+ export default function createGetCssVar<T extends string = string>(prefix?: string): <AdditionalVars extends string = never>(field: T | AdditionalVars, ...vars: (T | AdditionalVars)[]) => string;
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = createGetCssVar;
7
+
8
+ /**
9
+ * The benefit of this function is to help developers get CSS var from theme without specifying the whole variable
10
+ * and they does not need to remember the prefix (defined once).
11
+ */
12
+ function createGetCssVar(prefix = '') {
13
+ function appendVar(...vars) {
14
+ if (!vars.length) {
15
+ return '';
16
+ }
17
+
18
+ return `, var(--${prefix ? `${prefix}-` : ''}${vars[0]}${appendVar(...vars.slice(1))})`;
19
+ } // AdditionalVars makes `getCssVar` less strict, so it can be use like this `getCssVar('non-mui-variable')` without type error.
20
+
21
+
22
+ const getCssVar = (field, ...vars) => {
23
+ return `var(--${prefix ? `${prefix}-` : ''}${field}${appendVar(...vars)})`;
24
+ };
25
+
26
+ return getCssVar;
27
+ }
@@ -14,7 +14,7 @@ import cssVarsParser from './cssVarsParser';
14
14
  import ThemeProvider from '../ThemeProvider';
15
15
  import getInitColorSchemeScript, { DEFAULT_ATTRIBUTE, DEFAULT_MODE_STORAGE_KEY } from './getInitColorSchemeScript';
16
16
  import useCurrentColorScheme from './useCurrentColorScheme';
17
- import createGetThemeVar from './createGetThemeVar';
17
+ import createGetCssVar from './createGetCssVar';
18
18
  import { jsx as _jsx } from "react/jsx-runtime";
19
19
  import { jsxs as _jsxs } from "react/jsx-runtime";
20
20
  export const DISABLE_CSS_TRANSITION = '*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}';
@@ -128,7 +128,7 @@ export default function createCssVarsProvider(options) {
128
128
  vars: rootVars,
129
129
  spacing: themeProp.spacing ? createSpacing(themeProp.spacing) : systemSpacing,
130
130
  breakpoints: themeProp.breakpoints ? createBreakpoints(themeProp.breakpoints) : systemBreakpoints,
131
- getThemeVar: createGetThemeVar(prefix)
131
+ getCssVar: createGetCssVar(prefix)
132
132
  });
133
133
  const styleSheet = {};
134
134
  Object.entries(colorSchemes).forEach(([key, scheme]) => {
@@ -0,0 +1,20 @@
1
+ /**
2
+ * The benefit of this function is to help developers get CSS var from theme without specifying the whole variable
3
+ * and they does not need to remember the prefix (defined once).
4
+ */
5
+ export default function createGetCssVar(prefix = '') {
6
+ function appendVar(...vars) {
7
+ if (!vars.length) {
8
+ return '';
9
+ }
10
+
11
+ return `, var(--${prefix ? `${prefix}-` : ''}${vars[0]}${appendVar(...vars.slice(1))})`;
12
+ } // AdditionalVars makes `getCssVar` less strict, so it can be use like this `getCssVar('non-mui-variable')` without type error.
13
+
14
+
15
+ const getCssVar = (field, ...vars) => {
16
+ return `var(--${prefix ? `${prefix}-` : ''}${field}${appendVar(...vars)})`;
17
+ };
18
+
19
+ return getCssVar;
20
+ }
package/esm/index.js CHANGED
@@ -39,4 +39,4 @@ export { default as useThemeWithoutDefault } from './useThemeWithoutDefault';
39
39
  export * from './colorManipulator';
40
40
  export { default as ThemeProvider } from './ThemeProvider';
41
41
  export { default as unstable_createCssVarsProvider } from './cssVars/createCssVarsProvider';
42
- export { default as unstable_createGetThemeVar } from './cssVars/createGetThemeVar';
42
+ export { default as unstable_createGetCssVar } from './cssVars/createGetCssVar';
package/index.d.ts CHANGED
@@ -161,5 +161,5 @@ export { default as ThemeProvider } from './ThemeProvider';
161
161
  export * from './ThemeProvider';
162
162
 
163
163
  export { default as unstable_createCssVarsProvider } from './cssVars';
164
- export { default as unstable_createGetThemeVar } from './cssVars/createGetThemeVar';
164
+ export { default as unstable_createGetCssVar } from './cssVars/createGetCssVar';
165
165
  export * from './cssVars';
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license MUI v5.2.6
1
+ /** @license MUI v5.2.8
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.
@@ -50,7 +50,7 @@ var _exportNames = {
50
50
  useThemeWithoutDefault: true,
51
51
  ThemeProvider: true,
52
52
  unstable_createCssVarsProvider: true,
53
- unstable_createGetThemeVar: true
53
+ unstable_createGetCssVar: true
54
54
  };
55
55
  Object.defineProperty(exports, "Box", {
56
56
  enumerable: true,
@@ -244,10 +244,10 @@ Object.defineProperty(exports, "unstable_createCssVarsProvider", {
244
244
  return _createCssVarsProvider.default;
245
245
  }
246
246
  });
247
- Object.defineProperty(exports, "unstable_createGetThemeVar", {
247
+ Object.defineProperty(exports, "unstable_createGetCssVar", {
248
248
  enumerable: true,
249
249
  get: function () {
250
- return _createGetThemeVar.default;
250
+ return _createGetCssVar.default;
251
251
  }
252
252
  });
253
253
  Object.defineProperty(exports, "unstable_extendSxProp", {
@@ -475,7 +475,7 @@ var _ThemeProvider = _interopRequireDefault(require("./ThemeProvider"));
475
475
 
476
476
  var _createCssVarsProvider = _interopRequireDefault(require("./cssVars/createCssVarsProvider"));
477
477
 
478
- var _createGetThemeVar = _interopRequireDefault(require("./cssVars/createGetThemeVar"));
478
+ var _createGetCssVar = _interopRequireDefault(require("./cssVars/createGetCssVar"));
479
479
 
480
480
  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); }
481
481
 
@@ -13,7 +13,7 @@ import cssVarsParser from './cssVarsParser';
13
13
  import ThemeProvider from '../ThemeProvider';
14
14
  import getInitColorSchemeScript, { DEFAULT_ATTRIBUTE, DEFAULT_MODE_STORAGE_KEY } from './getInitColorSchemeScript';
15
15
  import useCurrentColorScheme from './useCurrentColorScheme';
16
- import createGetThemeVar from './createGetThemeVar';
16
+ import createGetCssVar from './createGetCssVar';
17
17
  import { jsx as _jsx } from "react/jsx-runtime";
18
18
  import { jsxs as _jsxs } from "react/jsx-runtime";
19
19
  export var DISABLE_CSS_TRANSITION = '*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}';
@@ -134,7 +134,7 @@ export default function createCssVarsProvider(options) {
134
134
  vars: rootVars,
135
135
  spacing: themeProp.spacing ? createSpacing(themeProp.spacing) : systemSpacing,
136
136
  breakpoints: themeProp.breakpoints ? createBreakpoints(themeProp.breakpoints) : systemBreakpoints,
137
- getThemeVar: createGetThemeVar(prefix)
137
+ getCssVar: createGetCssVar(prefix)
138
138
  });
139
139
  var styleSheet = {};
140
140
  Object.entries(colorSchemes).forEach(function (_ref2) {
@@ -1,5 +1,10 @@
1
1
  import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
2
- export default function createGetThemeVar() {
2
+
3
+ /**
4
+ * The benefit of this function is to help developers get CSS var from theme without specifying the whole variable
5
+ * and they does not need to remember the prefix (defined once).
6
+ */
7
+ export default function createGetCssVar() {
3
8
  var prefix = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
4
9
 
5
10
  function appendVar() {
@@ -12,9 +17,10 @@ export default function createGetThemeVar() {
12
17
  }
13
18
 
14
19
  return ", var(--".concat(prefix ? "".concat(prefix, "-") : '').concat(vars[0]).concat(appendVar.apply(void 0, _toConsumableArray(vars.slice(1))), ")");
15
- }
20
+ } // AdditionalVars makes `getCssVar` less strict, so it can be use like this `getCssVar('non-mui-variable')` without type error.
21
+
16
22
 
17
- var getThemeVar = function getThemeVar(field) {
23
+ var getCssVar = function getCssVar(field) {
18
24
  for (var _len2 = arguments.length, vars = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
19
25
  vars[_key2 - 1] = arguments[_key2];
20
26
  }
@@ -22,5 +28,5 @@ export default function createGetThemeVar() {
22
28
  return "var(--".concat(prefix ? "".concat(prefix, "-") : '').concat(field).concat(appendVar.apply(void 0, vars), ")");
23
29
  };
24
30
 
25
- return getThemeVar;
31
+ return getCssVar;
26
32
  }
package/legacy/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license MUI v5.2.6
1
+ /** @license MUI v5.2.8
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.
@@ -44,4 +44,4 @@ export { default as useThemeWithoutDefault } from './useThemeWithoutDefault';
44
44
  export * from './colorManipulator';
45
45
  export { default as ThemeProvider } from './ThemeProvider';
46
46
  export { default as unstable_createCssVarsProvider } from './cssVars/createCssVarsProvider';
47
- export { default as unstable_createGetThemeVar } from './cssVars/createGetThemeVar';
47
+ export { default as unstable_createGetCssVar } from './cssVars/createGetCssVar';
@@ -14,7 +14,7 @@ import cssVarsParser from './cssVarsParser';
14
14
  import ThemeProvider from '../ThemeProvider';
15
15
  import getInitColorSchemeScript, { DEFAULT_ATTRIBUTE, DEFAULT_MODE_STORAGE_KEY } from './getInitColorSchemeScript';
16
16
  import useCurrentColorScheme from './useCurrentColorScheme';
17
- import createGetThemeVar from './createGetThemeVar';
17
+ import createGetCssVar from './createGetCssVar';
18
18
  import { jsx as _jsx } from "react/jsx-runtime";
19
19
  import { jsxs as _jsxs } from "react/jsx-runtime";
20
20
  export const DISABLE_CSS_TRANSITION = '*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}';
@@ -126,7 +126,7 @@ export default function createCssVarsProvider(options) {
126
126
  vars: rootVars,
127
127
  spacing: themeProp.spacing ? createSpacing(themeProp.spacing) : systemSpacing,
128
128
  breakpoints: themeProp.breakpoints ? createBreakpoints(themeProp.breakpoints) : systemBreakpoints,
129
- getThemeVar: createGetThemeVar(prefix)
129
+ getCssVar: createGetCssVar(prefix)
130
130
  });
131
131
  const styleSheet = {};
132
132
  Object.entries(colorSchemes).forEach(([key, scheme]) => {
@@ -0,0 +1,20 @@
1
+ /**
2
+ * The benefit of this function is to help developers get CSS var from theme without specifying the whole variable
3
+ * and they does not need to remember the prefix (defined once).
4
+ */
5
+ export default function createGetCssVar(prefix = '') {
6
+ function appendVar(...vars) {
7
+ if (!vars.length) {
8
+ return '';
9
+ }
10
+
11
+ return `, var(--${prefix ? `${prefix}-` : ''}${vars[0]}${appendVar(...vars.slice(1))})`;
12
+ } // AdditionalVars makes `getCssVar` less strict, so it can be use like this `getCssVar('non-mui-variable')` without type error.
13
+
14
+
15
+ const getCssVar = (field, ...vars) => {
16
+ return `var(--${prefix ? `${prefix}-` : ''}${field}${appendVar(...vars)})`;
17
+ };
18
+
19
+ return getCssVar;
20
+ }
package/modern/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license MUI v5.2.6
1
+ /** @license MUI v5.2.8
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.
@@ -44,4 +44,4 @@ export { default as useThemeWithoutDefault } from './useThemeWithoutDefault';
44
44
  export * from './colorManipulator';
45
45
  export { default as ThemeProvider } from './ThemeProvider';
46
46
  export { default as unstable_createCssVarsProvider } from './cssVars/createCssVarsProvider';
47
- export { default as unstable_createGetThemeVar } from './cssVars/createGetThemeVar';
47
+ export { default as unstable_createGetCssVar } from './cssVars/createGetCssVar';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/system",
3
- "version": "5.2.6",
3
+ "version": "5.2.8",
4
4
  "private": false,
5
5
  "author": "MUI Team",
6
6
  "description": "CSS utilities for rapidly laying out custom designs.",
@@ -49,6 +49,7 @@ export type SystemStyleObject<Theme extends object = {}> =
49
49
  | SystemCssProperties<Theme>
50
50
  | CSSPseudoSelectorProps<Theme>
51
51
  | CSSSelectorObject<Theme>
52
+ | { [cssVariable: string]: string | number }
52
53
  | null;
53
54
 
54
55
  /**
@@ -1 +0,0 @@
1
- export default function createGetThemeVar<T extends string = string>(prefix?: string): (field: T, ...vars: T[]) => string;
@@ -1,22 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = createGetThemeVar;
7
-
8
- function createGetThemeVar(prefix = '') {
9
- function appendVar(...vars) {
10
- if (!vars.length) {
11
- return '';
12
- }
13
-
14
- return `, var(--${prefix ? `${prefix}-` : ''}${vars[0]}${appendVar(...vars.slice(1))})`;
15
- }
16
-
17
- const getThemeVar = (field, ...vars) => {
18
- return `var(--${prefix ? `${prefix}-` : ''}${field}${appendVar(...vars)})`;
19
- };
20
-
21
- return getThemeVar;
22
- }
@@ -1,15 +0,0 @@
1
- export default function createGetThemeVar(prefix = '') {
2
- function appendVar(...vars) {
3
- if (!vars.length) {
4
- return '';
5
- }
6
-
7
- return `, var(--${prefix ? `${prefix}-` : ''}${vars[0]}${appendVar(...vars.slice(1))})`;
8
- }
9
-
10
- const getThemeVar = (field, ...vars) => {
11
- return `var(--${prefix ? `${prefix}-` : ''}${field}${appendVar(...vars)})`;
12
- };
13
-
14
- return getThemeVar;
15
- }
@@ -1,15 +0,0 @@
1
- export default function createGetThemeVar(prefix = '') {
2
- function appendVar(...vars) {
3
- if (!vars.length) {
4
- return '';
5
- }
6
-
7
- return `, var(--${prefix ? `${prefix}-` : ''}${vars[0]}${appendVar(...vars.slice(1))})`;
8
- }
9
-
10
- const getThemeVar = (field, ...vars) => {
11
- return `var(--${prefix ? `${prefix}-` : ''}${field}${appendVar(...vars)})`;
12
- };
13
-
14
- return getThemeVar;
15
- }