@mui/system 5.1.0 โ 5.1.1
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/Box/Box.spec.d.ts +1 -1
- package/CHANGELOG.md +78 -9
- package/createTheme/createSpacing.d.ts +10 -10
- package/cssVars/createCssVarsProvider.spec.d.ts +1 -1
- package/cssVars/cssVarsParser.d.ts +68 -68
- package/cssVars/getInitColorSchemeScript.d.ts +12 -12
- package/cssVars/index.d.ts +2 -2
- package/cssVars/useCurrentColorScheme.d.ts +50 -50
- package/index.js +1 -1
- package/index.spec.d.ts +1 -1
- package/legacy/index.js +1 -1
- package/modern/index.js +1 -1
- package/package.json +5 -5
- package/styleFunctionSx/styleFunctionSx.spec.d.ts +1 -1
package/Box/Box.spec.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,74 @@
|
|
|
1
1
|
### [Versions](https://mui.com/versions/)
|
|
2
2
|
|
|
3
|
+
## 5.1.1
|
|
4
|
+
|
|
5
|
+
<!-- generated comparing v5.1.0..master -->
|
|
6
|
+
|
|
7
|
+
_Nov 16, 2021_
|
|
8
|
+
|
|
9
|
+
A big thanks to the 15 contributors who made this release possible. Here are some highlights โจ:
|
|
10
|
+
|
|
11
|
+
- ๐ Rename `@mui/core` to `@mui/base`. (#29585) @michaldudak
|
|
12
|
+
- And many more ๐ bug fixes and ๐ improvements.
|
|
13
|
+
|
|
14
|
+
### `@mui/material@5.1.1`
|
|
15
|
+
|
|
16
|
+
- ​<!-- 34 -->[Breadcrumbs][divider] Replace decimal spacing values with integers and css calc (#29526) @anikcreative
|
|
17
|
+
- ​<!-- 10 -->[Select][nativeselect] Add `multiple` class (#29566) @aaronholla
|
|
18
|
+
- ​<!-- 09 -->[Popper] Split into PopperUnstyled and Popper (#29488) @michaldudak
|
|
19
|
+
- ​<!-- 08 -->[Select] Make it clear that `Select` is not a root component (#29593) @hbjORbj
|
|
20
|
+
- ​<!-- 13 -->[l10n] Improved Dutch (nl-NL) locale (#29592) @flipvrijn
|
|
21
|
+
- ​<!-- 10 -->[Table] Improve pagination range, use "en dash" over "hyphen" (#29579) @narekmal
|
|
22
|
+
|
|
23
|
+
### `@mui/base@5.0.0-alpha.55`
|
|
24
|
+
|
|
25
|
+
#### BREAKING CHANGE
|
|
26
|
+
|
|
27
|
+
- ​<!-- 27 -->[core] Rename mui/core to mui/base (#29585) @michaldudak
|
|
28
|
+
|
|
29
|
+
### `@mui/lab@5.0.0-alpha.55`
|
|
30
|
+
|
|
31
|
+
- ​<!-- 12 -->[LoadingButton] Text variant spacing fixed for both start and end (#29194) @joshua-lawrence
|
|
32
|
+
- ​<!-- 11 -->[Masonry] Check if container or child exists to prevent error (#29452) @hbjORbj
|
|
33
|
+
|
|
34
|
+
### Docs
|
|
35
|
+
|
|
36
|
+
- ​<!-- 25 -->[docs] Correct bundler configuration for using legacy MUI build (#29146) @petermikitsh
|
|
37
|
+
- ​<!-- 24 -->[docs] Fix typo on autocomplete.md (#29570) @netizer
|
|
38
|
+
- ​<!-- 23 -->[docs] Fix dark mode on branding pages (#29611) @alexfauquette
|
|
39
|
+
- ​<!-- 22 -->[docs] Do not render CSS section in API docs navbar if there are no CSS classes (#29622) @ZeeshanTamboli
|
|
40
|
+
- ​<!-- 21 -->[docs] Fix link locale handling (#29624) @oliviertassinari
|
|
41
|
+
- ​<!-- 20 -->[docs] Fix Search navigation (#29623) @oliviertassinari
|
|
42
|
+
- ​<!-- 19 -->[docs] Fix broken link & update MUI packages explanation (#29583) @siriwatknp
|
|
43
|
+
- ​<!-- 18 -->[docs] Do not repeat language snippet in url in Algolia search (#29483) @hbjORbj
|
|
44
|
+
- ​<!-- 17 -->[docs] Update `ThemeProvider` API link (#29573) @siriwatknp
|
|
45
|
+
- ​<!-- 16 -->[docs] Remove svg logos from the Support page (#29431) @oliviertassinari
|
|
46
|
+
- ​<!-- 15 -->[docs] Link UXPin integration (#29422) @oliviertassinari
|
|
47
|
+
- ​<!-- 14 -->[docs] Link to the new public roadmap for the design kits (#29433) @oliviertassinari
|
|
48
|
+
- ​<!-- 28 -->[docs] correct bundler configuration for using legacy MUI build (#29146) @petermikitsh
|
|
49
|
+
- ​<!-- 01 -->[website] Fix premium plan release date (#29430) @oliviertassinari
|
|
50
|
+
- ​<!-- 02 -->[website] Add GitHub icon button to the navbar (#29640) @danilo-leal
|
|
51
|
+
- ​<!-- 39 -->[blog] Support many authors in markdown pages (#29633) @m4theushw
|
|
52
|
+
|
|
53
|
+
### Core
|
|
54
|
+
|
|
55
|
+
- ​<!-- 33 -->[core] Add `experiments` index page (#29582) @siriwatknp
|
|
56
|
+
- ​<!-- 32 -->[core] Move s3 bucket ownership to mui-org (#29609) @eps1lon
|
|
57
|
+
- ​<!-- 31 -->[core] Improve support request message (#29614) @mnajdova
|
|
58
|
+
- ​<!-- 30 -->[core] Use support request Github Action (#29594) @mnajdova
|
|
59
|
+
- ​<!-- 29 -->[core] Remove unused `getJsxPreview` util (#29586) @ZeeshanTamboli
|
|
60
|
+
- ​<!-- 28 -->[core] Use GitHub issue forms (#28038) @oliviertassinari
|
|
61
|
+
- ​<!-- 26 -->[core] Add playground (#29423) @oliviertassinari
|
|
62
|
+
- ​<!-- 07 -->[test] Correctly identify what the `raf` helper is for (#29683) @eps1lon
|
|
63
|
+
- ​<!-- 06 -->[test] Verify a quilted ImageList is created as test title suggests (#29565) @daniel-sachs
|
|
64
|
+
- ​<!-- 05 -->[test] Replace `createServerRender` with `createRenderer` (#29503) @eps1lon
|
|
65
|
+
- ​<!-- 04 -->[test] Always ignore "useLayoutEffect has no effect on the server"-warning (#29502) @eps1lon
|
|
66
|
+
- ​<!-- 03 -->[test] Restore StrictMode by default (#29589) @eps1lon
|
|
67
|
+
- ​<!-- 02 -->[test] createPickerRender -> createPickerRenderer (#29575) @eps1lon
|
|
68
|
+
- ​<!-- 09 -->[test] Allow experimental CLI to run exact test (#29685) @eps1lon
|
|
69
|
+
|
|
70
|
+
All contributors of this release in alphabetical order: @aaronholla, @alexfauquette, @anikcreative, @daniel-sachs, @eps1lon, @flipvrijn, @hbjORbj, @joshua-lawrence, @michaldudak, @mnajdova, @netizer, @oliviertassinari, @petermikitsh, @siriwatknp, @ZeeshanTamboli
|
|
71
|
+
|
|
3
72
|
## 5.1.0
|
|
4
73
|
|
|
5
74
|
<!-- generated comparing v5.0.6..master -->
|
|
@@ -142,16 +211,16 @@ _Oct 26, 2021_
|
|
|
142
211
|
A big thanks to the 19 contributors who made this release possible. Here are some highlights โจ:
|
|
143
212
|
|
|
144
213
|
- ๐ง Implement `Masonry` using Flexbox by @hbjORbj.
|
|
145
|
-
- ๐งช Add three components to `@mui/
|
|
214
|
+
- ๐งช Add three components to `@mui/base` by @rebeccahongsf and @hbjORbj.
|
|
146
215
|
|
|
147
216
|
### `@mui/codemod@5.0.5`
|
|
148
217
|
|
|
149
218
|
- ​<!-- 38 -->[codemod] Support new package name in `link-underline-hover` transformer (#29214) @siriwatknp
|
|
150
219
|
|
|
151
|
-
### `@mui/
|
|
220
|
+
### `@mui/base@5.0.0-alpha.52`
|
|
152
221
|
|
|
153
222
|
- ​<!-- 39 -->[ClickAwayListener] Move to the core package (#29186) @hbjORbj
|
|
154
|
-
- ​<!-- 13 -->[Popper] Move from mui-material to mui-
|
|
223
|
+
- ​<!-- 13 -->[Popper] Move from mui-material to mui-base (#28923) @rebeccahongsf
|
|
155
224
|
- ​<!-- 04 -->[TextareaAutosize] Move to the core package (#29148) @hbjORbj
|
|
156
225
|
|
|
157
226
|
### `@mui/lab@5.0.0-alpha.52`
|
|
@@ -220,7 +289,7 @@ _Oct 14, 2021_
|
|
|
220
289
|
|
|
221
290
|
A big thanks to the 17 contributors who made this release possible. Here are some highlights โจ:
|
|
222
291
|
|
|
223
|
-
- ๐งช Added `UnstyledInput` and `useInput` hook in the the first component in @mui/
|
|
292
|
+
- ๐งช Added `UnstyledInput` and `useInput` hook in the the first component in @mui/base package @michaldudak (#28053)
|
|
224
293
|
- ๐ Fixed many bugs and improved the documentation ๐.
|
|
225
294
|
|
|
226
295
|
### `@mui/material@5.0.4`
|
|
@@ -235,7 +304,7 @@ A big thanks to the 17 contributors who made this release possible. Here are som
|
|
|
235
304
|
|
|
236
305
|
- ​<!-- 05 -->[system] Update typing for `style` function (#28744) @hbjORbj
|
|
237
306
|
|
|
238
|
-
### `@mui/
|
|
307
|
+
### `@mui/base@5.0.0-alpha.51`
|
|
239
308
|
|
|
240
309
|
- ​<!-- 07 -->[InputUnstyled] Create unstyled input and useInput hook (#28053) @michaldudak
|
|
241
310
|
|
|
@@ -304,7 +373,7 @@ A big thanks to the 19 contributors who made this release possible. Here are som
|
|
|
304
373
|
|
|
305
374
|
- ​<!-- 42 -->Don't allow styled-components APIs on mui styled function (#28807) @hbjORbj
|
|
306
375
|
|
|
307
|
-
### `@mui/
|
|
376
|
+
### `@mui/base@5.0.0-alpha.50`
|
|
308
377
|
|
|
309
378
|
- ​<!-- 38 -->[ButtonUnstyled] Don't set redundant role=button (#28488) @michaldudak
|
|
310
379
|
- ​<!-- 43 -->[SliderUnstyled] Prevent unknown-prop error when using marks prop (#28868) @hbjORbj
|
|
@@ -683,10 +752,10 @@ A big thanks to the 18 contributors who made this release possible. Here are som
|
|
|
683
752
|
```
|
|
684
753
|
@material-ui/core => @mui/material // represents Material Design components.
|
|
685
754
|
@material-ui/icons => @mui/icons-material // represents Material Design icons.
|
|
686
|
-
@material-ui/unstyled => @mui/
|
|
755
|
+
@material-ui/unstyled => @mui/base // fully functional components with minimum styles.
|
|
687
756
|
```
|
|
688
757
|
|
|
689
|
-
> **Note**: `@mui/
|
|
758
|
+
> **Note**: `@mui/base` (previously `@material-ui/unstyled`) is not the same as `@material-ui/core`.
|
|
690
759
|
|
|
691
760
|
We encourage you to use the [codemod](https://github.com/mui-org/material-ui/blob/next/packages/mui-codemod/README.md#mui-replace) for smooth migration.
|
|
692
761
|
|
|
@@ -701,7 +770,7 @@ A big thanks to the 18 contributors who made this release possible. Here are som
|
|
|
701
770
|
- ​<!-- 05 -->[ToggleButtonGroup] Add "disabled" prop (#27998) @chetas411
|
|
702
771
|
- ​<!-- 34 -->[core] Export types for module augmentation (#28078) @m4theushw
|
|
703
772
|
|
|
704
|
-
### `@mui/
|
|
773
|
+
### `@mui/base@5.0.0-alpha.45`
|
|
705
774
|
|
|
706
775
|
- ​<!-- 38 -->[Button] Create ButtonUnstyled and useButton (#27600) @michaldudak
|
|
707
776
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export declare type SpacingOptions = number | Spacing | ((abs: number) => number | string) | ((abs: number | string) => number | string) | ReadonlyArray<string | number>;
|
|
2
|
-
export declare type SpacingArgument = number | string;
|
|
3
|
-
export interface Spacing {
|
|
4
|
-
(): string;
|
|
5
|
-
(value: number): string;
|
|
6
|
-
(topBottom: SpacingArgument, rightLeft: SpacingArgument): string;
|
|
7
|
-
(top: SpacingArgument, rightLeft: SpacingArgument, bottom: SpacingArgument): string;
|
|
8
|
-
(top: SpacingArgument, right: SpacingArgument, bottom: SpacingArgument, left: SpacingArgument): string;
|
|
9
|
-
}
|
|
10
|
-
export default function createSpacing(spacingInput?: SpacingOptions): Spacing;
|
|
1
|
+
export declare type SpacingOptions = number | Spacing | ((abs: number) => number | string) | ((abs: number | string) => number | string) | ReadonlyArray<string | number>;
|
|
2
|
+
export declare type SpacingArgument = number | string;
|
|
3
|
+
export interface Spacing {
|
|
4
|
+
(): string;
|
|
5
|
+
(value: number): string;
|
|
6
|
+
(topBottom: SpacingArgument, rightLeft: SpacingArgument): string;
|
|
7
|
+
(top: SpacingArgument, rightLeft: SpacingArgument, bottom: SpacingArgument): string;
|
|
8
|
+
(top: SpacingArgument, right: SpacingArgument, bottom: SpacingArgument, left: SpacingArgument): string;
|
|
9
|
+
}
|
|
10
|
+
export default function createSpacing(spacingInput?: SpacingOptions): Spacing;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
|
@@ -1,68 +1,68 @@
|
|
|
1
|
-
declare type NestedRecord<V = any> = {
|
|
2
|
-
[k: string | number]: NestedRecord<V> | V;
|
|
3
|
-
};
|
|
4
|
-
/**
|
|
5
|
-
* This function create an object from keys, value and then assign to target
|
|
6
|
-
*
|
|
7
|
-
* @param {Object} obj : the target object to be assigned
|
|
8
|
-
* @param {string[]} keys
|
|
9
|
-
* @param {string | number} value
|
|
10
|
-
*
|
|
11
|
-
* @example
|
|
12
|
-
* const source = {}
|
|
13
|
-
* assignNestedKeys(source, ['palette', 'primary'], 'var(--palette-primary)')
|
|
14
|
-
* console.log(source) // { palette: { primary: 'var(--palette-primary)' } }
|
|
15
|
-
*
|
|
16
|
-
* @example
|
|
17
|
-
* const source = { palette: { primary: 'var(--palette-primary)' } }
|
|
18
|
-
* assignNestedKeys(source, ['palette', 'secondary'], 'var(--palette-secondary)')
|
|
19
|
-
* console.log(source) // { palette: { primary: 'var(--palette-primary)', secondary: 'var(--palette-secondary)' } }
|
|
20
|
-
*/
|
|
21
|
-
export declare const assignNestedKeys: <Object_1 = NestedRecord<any>, Value = any>(obj: Object_1, keys: Array<string>, value: Value) => void;
|
|
22
|
-
/**
|
|
23
|
-
*
|
|
24
|
-
* @param {Object} obj : source object
|
|
25
|
-
* @param {Function} callback : a function that will be called when
|
|
26
|
-
* - the deepest key in source object is reached
|
|
27
|
-
* - the value of the deepest key is NOT `undefined` | `null`
|
|
28
|
-
*
|
|
29
|
-
* @example
|
|
30
|
-
* walkObjectDeep({ palette: { primary: { main: '#000000' } } }, console.log)
|
|
31
|
-
* // ['palette', 'primary', 'main'] '#000000'
|
|
32
|
-
*/
|
|
33
|
-
export declare const walkObjectDeep: <Value, T = Record<string, any>>(obj: T, callback: (keys: Array<string>, value: Value, scope: Record<string, string | number>) => void) => void;
|
|
34
|
-
/**
|
|
35
|
-
* a function that parse theme and return { css, vars }
|
|
36
|
-
*
|
|
37
|
-
* @param {Object} theme
|
|
38
|
-
* @param {{
|
|
39
|
-
* prefix?: string,
|
|
40
|
-
* basePrefix?: string,
|
|
41
|
-
* shouldSkipGeneratingVar?: (objectPathKeys: Array<string>, value: string | number) => boolean
|
|
42
|
-
* }} options.
|
|
43
|
-
* `basePrefix`: defined by design system.
|
|
44
|
-
* `prefix`: defined by application
|
|
45
|
-
*
|
|
46
|
-
* This function also mutate the string value of theme input by replacing `basePrefix` (if existed) with `prefix`
|
|
47
|
-
*
|
|
48
|
-
* @returns {{ css: Object, vars: Object }} `css` is the stylesheet, `vars` is an object to get css variable (same structure as theme)
|
|
49
|
-
*
|
|
50
|
-
* @example
|
|
51
|
-
* const { css, vars } = parser({
|
|
52
|
-
* fontSize: 12,
|
|
53
|
-
* lineHeight: 1.2,
|
|
54
|
-
* palette: { primary: { 500: '#000000' } }
|
|
55
|
-
* })
|
|
56
|
-
*
|
|
57
|
-
* console.log(css) // { '--fontSize': '12px', '--lineHeight': 1.2, '--palette-primary-500': '#000000' }
|
|
58
|
-
* console.log(vars) // { fontSize: '--fontSize', lineHeight: '--lineHeight', palette: { primary: { 500: 'var(--palette-primary-500)' } } }
|
|
59
|
-
*/
|
|
60
|
-
export default function cssVarsParser(theme: Record<string, any>, options?: {
|
|
61
|
-
prefix?: string;
|
|
62
|
-
basePrefix?: string;
|
|
63
|
-
shouldSkipGeneratingVar?: (objectPathKeys: Array<string>, value: string | number) => boolean;
|
|
64
|
-
}): {
|
|
65
|
-
css: NestedRecord<string>;
|
|
66
|
-
vars: NestedRecord<string>;
|
|
67
|
-
};
|
|
68
|
-
export {};
|
|
1
|
+
declare type NestedRecord<V = any> = {
|
|
2
|
+
[k: string | number]: NestedRecord<V> | V;
|
|
3
|
+
};
|
|
4
|
+
/**
|
|
5
|
+
* This function create an object from keys, value and then assign to target
|
|
6
|
+
*
|
|
7
|
+
* @param {Object} obj : the target object to be assigned
|
|
8
|
+
* @param {string[]} keys
|
|
9
|
+
* @param {string | number} value
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* const source = {}
|
|
13
|
+
* assignNestedKeys(source, ['palette', 'primary'], 'var(--palette-primary)')
|
|
14
|
+
* console.log(source) // { palette: { primary: 'var(--palette-primary)' } }
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* const source = { palette: { primary: 'var(--palette-primary)' } }
|
|
18
|
+
* assignNestedKeys(source, ['palette', 'secondary'], 'var(--palette-secondary)')
|
|
19
|
+
* console.log(source) // { palette: { primary: 'var(--palette-primary)', secondary: 'var(--palette-secondary)' } }
|
|
20
|
+
*/
|
|
21
|
+
export declare const assignNestedKeys: <Object_1 = NestedRecord<any>, Value = any>(obj: Object_1, keys: Array<string>, value: Value) => void;
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
* @param {Object} obj : source object
|
|
25
|
+
* @param {Function} callback : a function that will be called when
|
|
26
|
+
* - the deepest key in source object is reached
|
|
27
|
+
* - the value of the deepest key is NOT `undefined` | `null`
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* walkObjectDeep({ palette: { primary: { main: '#000000' } } }, console.log)
|
|
31
|
+
* // ['palette', 'primary', 'main'] '#000000'
|
|
32
|
+
*/
|
|
33
|
+
export declare const walkObjectDeep: <Value, T = Record<string, any>>(obj: T, callback: (keys: Array<string>, value: Value, scope: Record<string, string | number>) => void) => void;
|
|
34
|
+
/**
|
|
35
|
+
* a function that parse theme and return { css, vars }
|
|
36
|
+
*
|
|
37
|
+
* @param {Object} theme
|
|
38
|
+
* @param {{
|
|
39
|
+
* prefix?: string,
|
|
40
|
+
* basePrefix?: string,
|
|
41
|
+
* shouldSkipGeneratingVar?: (objectPathKeys: Array<string>, value: string | number) => boolean
|
|
42
|
+
* }} options.
|
|
43
|
+
* `basePrefix`: defined by design system.
|
|
44
|
+
* `prefix`: defined by application
|
|
45
|
+
*
|
|
46
|
+
* This function also mutate the string value of theme input by replacing `basePrefix` (if existed) with `prefix`
|
|
47
|
+
*
|
|
48
|
+
* @returns {{ css: Object, vars: Object }} `css` is the stylesheet, `vars` is an object to get css variable (same structure as theme)
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* const { css, vars } = parser({
|
|
52
|
+
* fontSize: 12,
|
|
53
|
+
* lineHeight: 1.2,
|
|
54
|
+
* palette: { primary: { 500: '#000000' } }
|
|
55
|
+
* })
|
|
56
|
+
*
|
|
57
|
+
* console.log(css) // { '--fontSize': '12px', '--lineHeight': 1.2, '--palette-primary-500': '#000000' }
|
|
58
|
+
* console.log(vars) // { fontSize: '--fontSize', lineHeight: '--lineHeight', palette: { primary: { 500: 'var(--palette-primary-500)' } } }
|
|
59
|
+
*/
|
|
60
|
+
export default function cssVarsParser(theme: Record<string, any>, options?: {
|
|
61
|
+
prefix?: string;
|
|
62
|
+
basePrefix?: string;
|
|
63
|
+
shouldSkipGeneratingVar?: (objectPathKeys: Array<string>, value: string | number) => boolean;
|
|
64
|
+
}): {
|
|
65
|
+
css: NestedRecord<string>;
|
|
66
|
+
vars: NestedRecord<string>;
|
|
67
|
+
};
|
|
68
|
+
export {};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
export declare const DEFAULT_MODE_STORAGE_KEY = "mui-mode";
|
|
3
|
-
export declare const DEFAULT_COLOR_SCHEME_STORAGE_KEY = "mui-color-scheme";
|
|
4
|
-
export declare const DEFAULT_ATTRIBUTE = "data-mui-color-scheme";
|
|
5
|
-
export default function getInitColorSchemeScript(options?: {
|
|
6
|
-
defaultMode?: 'light' | 'dark' | 'system';
|
|
7
|
-
defaultLightColorScheme?: string;
|
|
8
|
-
defaultDarkColorScheme?: string;
|
|
9
|
-
modeStorageKey?: string;
|
|
10
|
-
colorSchemeStorageKey?: string;
|
|
11
|
-
attribute?: string;
|
|
12
|
-
}): JSX.Element;
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const DEFAULT_MODE_STORAGE_KEY = "mui-mode";
|
|
3
|
+
export declare const DEFAULT_COLOR_SCHEME_STORAGE_KEY = "mui-color-scheme";
|
|
4
|
+
export declare const DEFAULT_ATTRIBUTE = "data-mui-color-scheme";
|
|
5
|
+
export default function getInitColorSchemeScript(options?: {
|
|
6
|
+
defaultMode?: 'light' | 'dark' | 'system';
|
|
7
|
+
defaultLightColorScheme?: string;
|
|
8
|
+
defaultDarkColorScheme?: string;
|
|
9
|
+
modeStorageKey?: string;
|
|
10
|
+
colorSchemeStorageKey?: string;
|
|
11
|
+
attribute?: string;
|
|
12
|
+
}): JSX.Element;
|
package/cssVars/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default } from './createCssVarsProvider';
|
|
2
|
-
export type { BuildCssVarsTheme } from './createCssVarsProvider';
|
|
1
|
+
export { default } from './createCssVarsProvider';
|
|
2
|
+
export type { BuildCssVarsTheme } from './createCssVarsProvider';
|
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
export declare type Mode = 'light' | 'dark' | 'system';
|
|
2
|
-
export declare type SystemMode = Exclude<Mode, 'system'>;
|
|
3
|
-
export interface State<SupportedColorScheme extends string> {
|
|
4
|
-
/**
|
|
5
|
-
* User selected mode.
|
|
6
|
-
* Note: on the server, mode is always undefined
|
|
7
|
-
*/
|
|
8
|
-
mode: Mode | undefined;
|
|
9
|
-
/**
|
|
10
|
-
* Only valid if `mode: 'system'`, either 'light' | 'dark'.
|
|
11
|
-
*/
|
|
12
|
-
systemMode: SystemMode | undefined;
|
|
13
|
-
/**
|
|
14
|
-
* The color scheme for the light mode.
|
|
15
|
-
*/
|
|
16
|
-
lightColorScheme: SupportedColorScheme;
|
|
17
|
-
/**
|
|
18
|
-
* The color scheme for the dark mode.
|
|
19
|
-
*/
|
|
20
|
-
darkColorScheme: SupportedColorScheme;
|
|
21
|
-
}
|
|
22
|
-
export declare type Result<SupportedColorScheme extends string> = State<SupportedColorScheme> & {
|
|
23
|
-
/**
|
|
24
|
-
* The current application color scheme. It is always `undefined` on the server.
|
|
25
|
-
*/
|
|
26
|
-
colorScheme: SupportedColorScheme | undefined;
|
|
27
|
-
/**
|
|
28
|
-
* `mode` is saved to internal state and localStorage
|
|
29
|
-
* If `mode` is null, it will be reset to the defaultMode
|
|
30
|
-
*/
|
|
31
|
-
setMode: (mode: Mode | null) => void;
|
|
32
|
-
/**
|
|
33
|
-
* `colorScheme` is saved to internal state and localStorage
|
|
34
|
-
* If `colorScheme` is null, it will be reset to the defaultColorScheme (light | dark)
|
|
35
|
-
*/
|
|
36
|
-
setColorScheme: (colorScheme: SupportedColorScheme | Partial<{
|
|
37
|
-
light: SupportedColorScheme | null;
|
|
38
|
-
dark: SupportedColorScheme | null;
|
|
39
|
-
}> | null) => void;
|
|
40
|
-
};
|
|
41
|
-
export declare function getSystemMode(mode: undefined | string): SystemMode | undefined;
|
|
42
|
-
export declare function getColorScheme<SupportedColorScheme extends string>(state: State<SupportedColorScheme>): SupportedColorScheme | undefined;
|
|
43
|
-
export default function useCurrentColorScheme<SupportedColorScheme extends string>(options: {
|
|
44
|
-
defaultLightColorScheme: SupportedColorScheme;
|
|
45
|
-
defaultDarkColorScheme: SupportedColorScheme;
|
|
46
|
-
supportedColorSchemes: Array<SupportedColorScheme>;
|
|
47
|
-
defaultMode?: Mode;
|
|
48
|
-
modeStorageKey?: string;
|
|
49
|
-
colorSchemeStorageKey?: string;
|
|
50
|
-
}): Result<SupportedColorScheme>;
|
|
1
|
+
export declare type Mode = 'light' | 'dark' | 'system';
|
|
2
|
+
export declare type SystemMode = Exclude<Mode, 'system'>;
|
|
3
|
+
export interface State<SupportedColorScheme extends string> {
|
|
4
|
+
/**
|
|
5
|
+
* User selected mode.
|
|
6
|
+
* Note: on the server, mode is always undefined
|
|
7
|
+
*/
|
|
8
|
+
mode: Mode | undefined;
|
|
9
|
+
/**
|
|
10
|
+
* Only valid if `mode: 'system'`, either 'light' | 'dark'.
|
|
11
|
+
*/
|
|
12
|
+
systemMode: SystemMode | undefined;
|
|
13
|
+
/**
|
|
14
|
+
* The color scheme for the light mode.
|
|
15
|
+
*/
|
|
16
|
+
lightColorScheme: SupportedColorScheme;
|
|
17
|
+
/**
|
|
18
|
+
* The color scheme for the dark mode.
|
|
19
|
+
*/
|
|
20
|
+
darkColorScheme: SupportedColorScheme;
|
|
21
|
+
}
|
|
22
|
+
export declare type Result<SupportedColorScheme extends string> = State<SupportedColorScheme> & {
|
|
23
|
+
/**
|
|
24
|
+
* The current application color scheme. It is always `undefined` on the server.
|
|
25
|
+
*/
|
|
26
|
+
colorScheme: SupportedColorScheme | undefined;
|
|
27
|
+
/**
|
|
28
|
+
* `mode` is saved to internal state and localStorage
|
|
29
|
+
* If `mode` is null, it will be reset to the defaultMode
|
|
30
|
+
*/
|
|
31
|
+
setMode: (mode: Mode | null) => void;
|
|
32
|
+
/**
|
|
33
|
+
* `colorScheme` is saved to internal state and localStorage
|
|
34
|
+
* If `colorScheme` is null, it will be reset to the defaultColorScheme (light | dark)
|
|
35
|
+
*/
|
|
36
|
+
setColorScheme: (colorScheme: SupportedColorScheme | Partial<{
|
|
37
|
+
light: SupportedColorScheme | null;
|
|
38
|
+
dark: SupportedColorScheme | null;
|
|
39
|
+
}> | null) => void;
|
|
40
|
+
};
|
|
41
|
+
export declare function getSystemMode(mode: undefined | string): SystemMode | undefined;
|
|
42
|
+
export declare function getColorScheme<SupportedColorScheme extends string>(state: State<SupportedColorScheme>): SupportedColorScheme | undefined;
|
|
43
|
+
export default function useCurrentColorScheme<SupportedColorScheme extends string>(options: {
|
|
44
|
+
defaultLightColorScheme: SupportedColorScheme;
|
|
45
|
+
defaultDarkColorScheme: SupportedColorScheme;
|
|
46
|
+
supportedColorSchemes: Array<SupportedColorScheme>;
|
|
47
|
+
defaultMode?: Mode;
|
|
48
|
+
modeStorageKey?: string;
|
|
49
|
+
colorSchemeStorageKey?: string;
|
|
50
|
+
}): Result<SupportedColorScheme>;
|
package/index.js
CHANGED
package/index.spec.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
package/legacy/index.js
CHANGED
package/modern/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/system",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"author": "MUI Team",
|
|
6
6
|
"description": "CSS utilities for rapidly laying out custom designs.",
|
|
@@ -43,11 +43,11 @@
|
|
|
43
43
|
}
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@babel/runtime": "^7.16.
|
|
47
|
-
"@mui/private-theming": "^5.1.
|
|
48
|
-
"@mui/styled-engine": "^5.1.
|
|
46
|
+
"@babel/runtime": "^7.16.3",
|
|
47
|
+
"@mui/private-theming": "^5.1.1",
|
|
48
|
+
"@mui/styled-engine": "^5.1.1",
|
|
49
49
|
"@mui/types": "^7.1.0",
|
|
50
|
-
"@mui/utils": "^5.1.
|
|
50
|
+
"@mui/utils": "^5.1.1",
|
|
51
51
|
"clsx": "^1.1.1",
|
|
52
52
|
"csstype": "^3.0.9",
|
|
53
53
|
"prop-types": "^15.7.2"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|