@mui/system 5.8.4 → 5.8.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/Box/Box.spec.d.ts +1 -1
  2. package/CHANGELOG.md +185 -4
  3. package/Container/Container.d.ts +13 -13
  4. package/Container/ContainerProps.d.ts +40 -40
  5. package/Container/containerClasses.d.ts +22 -22
  6. package/Container/createContainer.d.ts +18 -18
  7. package/createBox.spec.d.ts +1 -1
  8. package/createTheme/createSpacing.d.ts +10 -10
  9. package/cssVars/createCssVarsProvider.d.ts +13 -18
  10. package/cssVars/createCssVarsProvider.js +13 -17
  11. package/cssVars/createCssVarsProvider.spec.d.ts +1 -1
  12. package/cssVars/createGetCssVar.d.ts +5 -5
  13. package/cssVars/createGetCssVar.js +2 -2
  14. package/cssVars/cssVarsParser.d.ts +65 -70
  15. package/cssVars/cssVarsParser.js +4 -19
  16. package/cssVars/getInitColorSchemeScript.d.ts +45 -40
  17. package/cssVars/getInitColorSchemeScript.js +7 -0
  18. package/cssVars/index.d.ts +3 -2
  19. package/cssVars/index.js +9 -1
  20. package/cssVars/useCurrentColorScheme.d.ts +53 -53
  21. package/esm/cssVars/createCssVarsProvider.js +13 -16
  22. package/esm/cssVars/createGetCssVar.js +2 -2
  23. package/esm/cssVars/cssVarsParser.js +4 -19
  24. package/esm/cssVars/getInitColorSchemeScript.js +7 -0
  25. package/esm/cssVars/index.js +2 -1
  26. package/index.js +1 -1
  27. package/index.spec.d.ts +1 -1
  28. package/legacy/cssVars/createCssVarsProvider.js +13 -17
  29. package/legacy/cssVars/createGetCssVar.js +3 -3
  30. package/legacy/cssVars/cssVarsParser.js +4 -20
  31. package/legacy/cssVars/getInitColorSchemeScript.js +3 -1
  32. package/legacy/cssVars/index.js +2 -1
  33. package/legacy/index.js +1 -1
  34. package/modern/cssVars/createCssVarsProvider.js +13 -16
  35. package/modern/cssVars/createGetCssVar.js +2 -2
  36. package/modern/cssVars/cssVarsParser.js +4 -19
  37. package/modern/cssVars/getInitColorSchemeScript.js +7 -0
  38. package/modern/cssVars/index.js +2 -1
  39. package/modern/index.js +1 -1
  40. package/package.json +5 -5
  41. 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,186 @@
1
1
  # [Versions](https://mui.com/versions/)
2
2
 
3
+ ## 5.8.7
4
+
5
+ <!-- generated comparing v5.8.6..master -->
6
+
7
+ _Jul 4, 2022_
8
+
9
+ A big thanks to the 13 contributors who made this release possible. Here are some highlights ✨:
10
+
11
+ - 🐛 Fixed an issue causing Typescript errors when building a project with Material UI v5.8.6 (@michaldudak)
12
+ - 🐛 Fixed a few bugs in Material UI components. Thanks @henriqueholtz, @jake-collibra, @MattiasMartens and @TimoWilhelm!
13
+ - many other 🐛 bug fixes and 📚 documentation improvements
14
+
15
+ ### `@mui/material@5.8.7`
16
+
17
+ - [Autocomplete] Add some missing props in `useAutocomplete` (#33269) @henriqueholtz
18
+ - [Autocomplete] Extend `componentsProps` to include `popper` and `popupIndicator` slots (#33283) @jake-collibra
19
+ - [Select] Annotate empty string as valid value prop (#33088) @MattiasMartens
20
+ - [SnackbarContent] Fix message text color with css var provider (#33285) @TimoWilhelm
21
+
22
+ ### `@mui/styled-engine@5.8.7`
23
+
24
+ - [styled-engine] Add missing type dependency on csstype (#33310) @Methuselah96
25
+
26
+ ### `@mui/system@5.8.7`
27
+
28
+ - [system] Simplify theme input types for `CssVarsProvider` (#33381) @siriwatknp
29
+ - [system] Export required types (#33324) @michaldudak
30
+
31
+ ### `@mui/joy@5.0.0-alpha.35`
32
+
33
+ - [Joy] Add radio button documentation (#33254) @siriwatknp
34
+ - [Joy] Add switch documentation (#33302) @siriwatknp
35
+ - [Joy] Batch a couple of documentation refinements (#33158)
36
+ - [Joy] Enable Joy and Material UI compatibility (#33379) @siriwatknp
37
+
38
+ ### `@mui/base@5.0.0-alpha.88`
39
+
40
+ - [base] Remove a type incompatible with Typescript 3.5 (#33361) @michaldudak
41
+ - [BadgeUnstyled] Export BadgeUnstyledOwnProps interface to fix typescript compiler error (#33314) @aaronlademann-wf
42
+ - [TablePaginationUnstyled] Accept callbacks in componentsProps (#33309) @michaldudak
43
+
44
+ ### Docs
45
+
46
+ - [docs] Fix Link typings in the react-router example (#32308) @aaarichter
47
+ - [docs] Add caveat about class components with Tooltip (#33325) @joshkel
48
+ - [docs] Fix SEO issues (#33288) @oliviertassinari
49
+ - [docs] Fix Slider's "player" demo (#33267) @xlianghang
50
+ - [website] Link MUI Toolpad in mui.com (#33287) @oliviertassinari
51
+
52
+ All contributors of this release in alphabetical order: @aaarichter, @aaronlademann-wf, @danilo-leal, @henriqueholtz, @jake-collibra, @joshkel, @MattiasMartens, @Methuselah96, @michaldudak, @oliviertassinari, @siriwatknp, @TimoWilhelm, @xlianghang
53
+
54
+ ## 5.8.6
55
+
56
+ <!-- generated comparing v5.8.5..master -->
57
+
58
+ _Jun 27, 2022_
59
+
60
+ A big thanks to the 13 contributors who made this release possible. Here are some highlights ✨:
61
+
62
+ - ⚒️ Fixed React 18 issues in few components
63
+ - 🚀 Improved the TypeScript augmentation when using CSS variables with `@mui/material`
64
+ - many other 🐛 bug fixes and 📚 documentation improvements
65
+
66
+ ### `@mui/material@5.8.6`
67
+
68
+ - &#8203;<!-- 27 -->[Alert] Add support for CSS vars (#32624) @haneenmahd
69
+ - &#8203;<!-- 26 -->[Alert] Use `getContrastText` for filled variant font color (#29813) @SamoraMabuya
70
+
71
+ 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
72
+
73
+ - &#8203;<!-- 11 -->[OutlinedInput] Fix `ownerState` undefined in theme style overrides (#33241) @siriwatknp
74
+ - &#8203;<!-- 08 -->[Tabs] Fix crash when used with React 18 & Suspense (#33277) @mnajdova
75
+ - &#8203;<!-- 05 -->[TypeScript] Add CSS vars type augmentation for Material UI (#33211) @siriwatknp
76
+
77
+ ### `@mui/system@5.8.6`
78
+
79
+ - &#8203;<!-- 09 -->[system] Add enableColorScheme option to getInitColorSchemeScript (#33261) @siriwatknp
80
+
81
+ ### `@mui/utils@5.8.6`
82
+
83
+ - &#8203;<!-- 04 -->[utils] Allow state prefix to be configurable (#32972) @siriwatknp
84
+
85
+ ### `@mui/base@5.0.0-alpha.87`
86
+
87
+ - &#8203;<!-- 25 -->[base] Improve the return type of useSlotProps (#33279) @michaldudak
88
+ - &#8203;<!-- 24 -->[base] Improve some types (#33270) @mnajdova
89
+ - &#8203;<!-- 13 -->[MenuUnstyled] Fix keyboard accessibility of menu items (#33145) @michaldudak
90
+ - &#8203;<!-- 12 -->[ModalManager] Lock body scroll when container is inside shadow DOM (#33168) @jacobweberbowery
91
+ - &#8203;<!-- 10 -->[SliderUnstyled] Use useSlotProps (#33132) @michaldudak
92
+ - &#8203;<!-- 07 -->[TextareaAutosize] Fix crash when used with React 18 & Suspense (#33238) @howlettt
93
+ - &#8203;<!-- 06 -->[TextareaAutosize] Fix warnings for too many renders in React 18 (#33253) @mnajdova
94
+
95
+ ### `@mui/joy@5.0.0-alpha.34`
96
+
97
+ - &#8203;<!-- 14 -->[Joy] Add `Sheet` doc (#32820) @hbjORbj
98
+
99
+ ### Docs
100
+
101
+ - &#8203;<!-- 23 -->[blog] Polish Why you should migrate to Material UI v5 today (#33244) @oliviertassinari
102
+ - &#8203;<!-- 21 -->[docs] Add note in docs about `componentsProps.root` taking precedence (#33097) @ZeeshanTamboli
103
+ - &#8203;<!-- 20 -->[docs] Remove a note about Base components being reexported from Material UI (#33265) @michaldudak
104
+ - &#8203;<!-- 19 -->[docs] Update code snippet in docs for custom color palette (#32946) @ZeeshanTamboli
105
+ - &#8203;<!-- 18 -->[docs] Fix the docs for production class generation (#31933) @Fafruch
106
+ - &#8203;<!-- 17 -->[docs] Fix internal link in Box page (#33149) @davidgarciab
107
+ - &#8203;<!-- 16 -->[docs] Badge component link in Base docs should be under Data Display section (#33249) @ZeeshanTamboli
108
+ - &#8203;<!-- 15 -->[examples] Fix comment typo (#33256) @WinmezzZ
109
+
110
+ ### Core
111
+
112
+ - &#8203;<!-- 22 -->[core] Remove dead code (#33243) @oliviertassinari
113
+ - &#8203;<!-- 03 -->[website] Fix the scroll-top for all the website (#33215) @oliviertassinari
114
+ - &#8203;<!-- 02 -->[website] List new core role @oliviertassinari
115
+ - &#8203;<!-- 01 -->[website] Fix navigation menu close behavior (#33203) @oliviertassinari
116
+
117
+ All contributors of this release in alphabetical order: @davidgarciab, @Fafruch, @haneenmahd, @hbjORbj, @howlettt, @jacobweberbowery, @michaldudak, @mnajdova, @oliviertassinari, @SamoraMabuya, @siriwatknp, @WinmezzZ, @ZeeshanTamboli
118
+
119
+ ## 5.8.5
120
+
121
+ <!-- generated comparing v5.8.4..master -->
122
+
123
+ _Jun 20, 2022_
124
+
125
+ A big thanks to the 14 contributors who made this release possible. Here are some highlights ✨:
126
+
127
+ - 🚀 Added support for CSS variables in the `Avatar` component and the `SpeedDialAction` component respectively by @vicasas and @gin1314
128
+ - many other 🐛 bug fixes and 📚 documentation improvements
129
+
130
+ ### `@mui/material@5.8.5`
131
+
132
+ - &#8203;<!-- 30 -->[Avatar] Add support for CSS variables (#32499) @vicasas
133
+ - &#8203;<!-- 19 -->[Dialog] Fix broken styles if `maxWidth` is set to `false` (#32987) @kmurgic
134
+ - &#8203;<!-- 04 -->[SpeedDialAction] Add support for CSS variables (#32608) @gin1314
135
+ - &#8203;<!-- 02 -->[Tabs] Increment scroll of the minimum amount possible (#33103) @oliviertassinari
136
+
137
+ ### `@mui/codemod@5.8.5`
138
+
139
+ - &#8203;<!-- 24 -->[codemod] Preserve comments within jss-to-tss-react (#33170) @ryancogswell
140
+
141
+ ### `@mui/lab@5.0.0-alpha.87`
142
+
143
+ - &#8203;<!-- 06 -->[Masonry] Fix flickering when used with React 18 (#33163) @mnajdova
144
+
145
+ ### `@mui/base@5.0.0-alpha.86`
146
+
147
+ - &#8203;<!-- 29 -->[BadgeUnstyled] Accept callbacks in componentsProps (#33176) @michaldudak
148
+ - &#8203;<!-- 25 -->[ButtonUnstyled] Use useSlotProps (#33096) @michaldudak
149
+ - &#8203;<!-- 11 -->[FormControlUnstyled] Accept callbacks in componentsProps (#33180) @michaldudak
150
+ - &#8203;<!-- 10 -->[InputUnstyled] Use useSlotProps (#33094) @michaldudak
151
+ - &#8203;<!-- 05 -->[ModalUnstyled] Define ownerState and slot props' types (#32901) @michaldudak
152
+ - &#8203;<!-- 03 -->[SwitchUnstyled] Use useSlotProps (#33174) @michaldudak
153
+
154
+ ### `@mui/joy@5.0.0-alpha.33`
155
+
156
+ - &#8203;<!-- 09 -->[Joy] Add Checkbox documentation (#33171) @siriwatknp
157
+ - &#8203;<!-- 08 -->[Joy] Add List documentation (#33120) @siriwatknp
158
+ - &#8203;<!-- 07 -->[Joy] Make slider displays Joy classname (#33051) @siriwatknp
159
+
160
+ ### Docs
161
+
162
+ - &#8203;<!-- 28 -->[blog] Update Blogpost to clear confusion on "no impact" disclaimer. (#33131) @joserodolfofreitas
163
+ - &#8203;<!-- 27 -->[blog] Add post about v5 Migration guide update (#33063) @samuelsycamore
164
+ - &#8203;<!-- 26 -->[blog] Fix display on Safari (#33102) @oliviertassinari
165
+ - &#8203;<!-- 18 -->[docs] Add guide on how to use MUI Base with Tailwind CSS (#33100) @mnajdova
166
+ - &#8203;<!-- 17 -->[docs] Improve Joy template UX (#33159) @siriwatknp
167
+ - &#8203;<!-- 16 -->[docs] Update Shadow DOM guide (#33160) @cherniavskii
168
+ - &#8203;<!-- 15 -->[docs] Fix SEO regressions (#33106) @oliviertassinari
169
+ - &#8203;<!-- 14 -->[docs] Add job ad in table of content (#33143) @mnajdova
170
+ - &#8203;<!-- 13 -->[docs] Add customization as a value proposition (#33014) @oliviertassinari
171
+ - &#8203;<!-- 12 -->[examples] Add example using nextjs & @mui/styles as a starter for the migration to v5 (#33005) @mnajdova
172
+ - &#8203;<!-- 01 -->[website] Replace Airtable with Ashby links for applying to a opened position (#33193) @DanailH
173
+
174
+ ### Core
175
+
176
+ - &#8203;<!-- 31 -->[core] Add CSS variables support for Material UI components (#32835) @siriwatknp
177
+ - &#8203;<!-- 23 -->[core] Add name to workspace root package.json (#33226) @Janpot
178
+ - &#8203;<!-- 22 -->[core] Update bug template with generic instruction (#33153) @joserodolfofreitas
179
+ - &#8203;<!-- 21 -->[core] Remove dead and redundant code (#33125) @oliviertassinari
180
+ - &#8203;<!-- 20 -->[core] Improve inline code rendering within the details tag (#33086) @Harmouch101
181
+
182
+ All contributors of this release in alphabetical order: @cherniavskii, @DanailH, @gin1314, @Harmouch101, @Janpot, @joserodolfofreitas, @kmurgic, @michaldudak, @mnajdova, @oliviertassinari, @ryancogswell, @samuelsycamore, @siriwatknp, @vicasas
183
+
3
184
  ## 5.8.4
4
185
 
5
186
  <!-- generated comparing v5.8.3..master -->
@@ -1101,7 +1282,7 @@ A big thanks to the 17 contributors who made this release possible. Here are som
1101
1282
  - &#8203;<!-- 25 -->[core] Update playwright docker to match the specified version (#31236) @siriwatknp
1102
1283
  - &#8203;<!-- 24 -->[core] Remove parallel on buildTypes (#31189) @siriwatknp
1103
1284
  - &#8203;<!-- 23 -->[core] Fix propTypes generation for optional any props (#31141) @m4theushw
1104
- - &#8203;<!-- 04 -->[Typescript] Remove variants deprecation (#31239) @siriwatknp
1285
+ - &#8203;<!-- 04 -->[typescript] Remove variants deprecation (#31239) @siriwatknp
1105
1286
 
1106
1287
  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
1107
1288
 
@@ -1166,7 +1347,7 @@ A big thanks to the 16 contributors who made this release possible. Here are som
1166
1347
  - [Select] Allow customizing Select based on its variant (#30788) @michaldudak
1167
1348
  - [Portal] Re-export 'Portal' in material (#31003) @liradb2000
1168
1349
  - [ToggleButton] Add prop types for `onClick` and `onChange` (#30883) @sydneyjodon-wk
1169
- - [Typescript] Added TypeText declaration to the exports file (#30890) @agauravdev
1350
+ - [typescript] Added TypeText declaration to the exports file (#30890) @agauravdev
1170
1351
 
1171
1352
  ### `@mui/system@5.4.2`
1172
1353
 
@@ -4604,8 +4785,8 @@ A big thanks to the 15 contributors who made this release possible. Here are som
4604
4785
  - &#8203;<!-- 29 -->[Button] Rename `pending` prop to `loading` in LoadingButton (#25874) @m4theushw
4605
4786
 
4606
4787
  ```diff
4607
- -<LoadingButton pending pendingIndicator="Pending..." pendingPosition="end" />
4608
- +<LoadingButton loading loadingIndicator="Pending..." loadingPosition="end" />
4788
+ -<LoadingButton pending pendingIndicator="Pending" pendingPosition="end" />
4789
+ +<LoadingButton loading loadingIndicator="Pending" loadingPosition="end" />
4609
4790
  ```
4610
4791
 
4611
4792
  - &#8203;<!-- 25 -->[ButtonBase] Remove buttonRef prop (#25896) @m4theushw
@@ -1,13 +1,13 @@
1
- /**
2
- *
3
- * Demos:
4
- *
5
- * - [Container (Material UI)](https://mui.com/material-ui/react-container/)
6
- * - [Container (MUI System)](https://mui.com/system/react-container/)
7
- *
8
- * API:
9
- *
10
- * - [Container API](https://mui.com/system/api/container/)
11
- */
12
- declare const Container: import("@mui/types").OverridableComponent<import("./ContainerProps").ContainerTypeMap<{}, "div">>;
13
- export default Container;
1
+ /**
2
+ *
3
+ * Demos:
4
+ *
5
+ * - [Container (Material UI)](https://mui.com/material-ui/react-container/)
6
+ * - [Container (MUI System)](https://mui.com/system/react-container/)
7
+ *
8
+ * API:
9
+ *
10
+ * - [Container API](https://mui.com/system/api/container/)
11
+ */
12
+ declare const Container: import("@mui/types").OverridableComponent<import("./ContainerProps").ContainerTypeMap<{}, "div">>;
13
+ export default Container;
@@ -1,40 +1,40 @@
1
- import * as React from 'react';
2
- import { OverrideProps } from '@mui/types';
3
- import { SxProps } from '../styleFunctionSx';
4
- import { Theme, Breakpoint } from '../createTheme';
5
- import { ContainerClasses } from './containerClasses';
6
- export interface ContainerTypeMap<P = {}, D extends React.ElementType = 'div'> {
7
- props: P & {
8
- children?: React.ReactNode;
9
- /**
10
- * Override or extend the styles applied to the component.
11
- */
12
- classes?: Partial<ContainerClasses>;
13
- /**
14
- * If `true`, the left and right padding is removed.
15
- * @default false
16
- */
17
- disableGutters?: boolean;
18
- /**
19
- * Set the max-width to match the min-width of the current breakpoint.
20
- * This is useful if you'd prefer to design for a fixed set of sizes
21
- * instead of trying to accommodate a fully fluid viewport.
22
- * It's fluid by default.
23
- * @default false
24
- */
25
- fixed?: boolean;
26
- /**
27
- * Determine the max-width of the container.
28
- * The container width grows with the size of the screen.
29
- * Set to `false` to disable `maxWidth`.
30
- * @default 'lg'
31
- */
32
- maxWidth?: Breakpoint | false;
33
- /**
34
- * The system prop that allows defining system overrides as well as additional CSS styles.
35
- */
36
- sx?: SxProps<Theme>;
37
- };
38
- defaultComponent: D;
39
- }
40
- export declare type ContainerProps<D extends React.ElementType = ContainerTypeMap['defaultComponent'], P = {}> = OverrideProps<ContainerTypeMap<P, D>, D>;
1
+ import * as React from 'react';
2
+ import { OverrideProps } from '@mui/types';
3
+ import { SxProps } from '../styleFunctionSx';
4
+ import { Theme, Breakpoint } from '../createTheme';
5
+ import { ContainerClasses } from './containerClasses';
6
+ export interface ContainerTypeMap<P = {}, D extends React.ElementType = 'div'> {
7
+ props: P & {
8
+ children?: React.ReactNode;
9
+ /**
10
+ * Override or extend the styles applied to the component.
11
+ */
12
+ classes?: Partial<ContainerClasses>;
13
+ /**
14
+ * If `true`, the left and right padding is removed.
15
+ * @default false
16
+ */
17
+ disableGutters?: boolean;
18
+ /**
19
+ * Set the max-width to match the min-width of the current breakpoint.
20
+ * This is useful if you'd prefer to design for a fixed set of sizes
21
+ * instead of trying to accommodate a fully fluid viewport.
22
+ * It's fluid by default.
23
+ * @default false
24
+ */
25
+ fixed?: boolean;
26
+ /**
27
+ * Determine the max-width of the container.
28
+ * The container width grows with the size of the screen.
29
+ * Set to `false` to disable `maxWidth`.
30
+ * @default 'lg'
31
+ */
32
+ maxWidth?: Breakpoint | false;
33
+ /**
34
+ * The system prop that allows defining system overrides as well as additional CSS styles.
35
+ */
36
+ sx?: SxProps<Theme>;
37
+ };
38
+ defaultComponent: D;
39
+ }
40
+ export declare type ContainerProps<D extends React.ElementType = ContainerTypeMap['defaultComponent'], P = {}> = OverrideProps<ContainerTypeMap<P, D>, D>;
@@ -1,22 +1,22 @@
1
- export interface ContainerClasses {
2
- /** Styles applied to the root element. */
3
- root: string;
4
- /** Styles applied to the root element if `disableGutters={true}`. */
5
- disableGutters: string;
6
- /** Styles applied to the root element if `fixed={true}`. */
7
- fixed: string;
8
- /** Styles applied to the root element if `maxWidth="xs"`. */
9
- maxWidthXs: string;
10
- /** Styles applied to the root element if `maxWidth="sm"`. */
11
- maxWidthSm: string;
12
- /** Styles applied to the root element if `maxWidth="md"`. */
13
- maxWidthMd: string;
14
- /** Styles applied to the root element if `maxWidth="lg"`. */
15
- maxWidthLg: string;
16
- /** Styles applied to the root element if `maxWidth="xl"`. */
17
- maxWidthXl: string;
18
- }
19
- export declare type ContainerClassKey = keyof ContainerClasses;
20
- export declare function getContainerUtilityClass(slot: string): string;
21
- declare const containerClasses: ContainerClasses;
22
- export default containerClasses;
1
+ export interface ContainerClasses {
2
+ /** Styles applied to the root element. */
3
+ root: string;
4
+ /** Styles applied to the root element if `disableGutters={true}`. */
5
+ disableGutters: string;
6
+ /** Styles applied to the root element if `fixed={true}`. */
7
+ fixed: string;
8
+ /** Styles applied to the root element if `maxWidth="xs"`. */
9
+ maxWidthXs: string;
10
+ /** Styles applied to the root element if `maxWidth="sm"`. */
11
+ maxWidthSm: string;
12
+ /** Styles applied to the root element if `maxWidth="md"`. */
13
+ maxWidthMd: string;
14
+ /** Styles applied to the root element if `maxWidth="lg"`. */
15
+ maxWidthLg: string;
16
+ /** Styles applied to the root element if `maxWidth="xl"`. */
17
+ maxWidthXl: string;
18
+ }
19
+ export declare type ContainerClassKey = keyof ContainerClasses;
20
+ export declare function getContainerUtilityClass(slot: string): string;
21
+ declare const containerClasses: ContainerClasses;
22
+ export default containerClasses;
@@ -1,18 +1,18 @@
1
- import * as React from 'react';
2
- import { Interpolation, StyledComponent } from '@mui/styled-engine';
3
- import { OverridableComponent } from '@mui/types';
4
- import { ContainerProps, ContainerTypeMap } from './ContainerProps';
5
- import { Theme as DefaultTheme } from '../createTheme';
6
- interface StyleFnProps<Theme> extends ContainerProps {
7
- theme: Theme;
8
- ownerState: ContainerProps;
9
- }
10
- declare type RequiredThemeStructure = Pick<DefaultTheme, 'breakpoints' | 'spacing'>;
11
- export default function createContainer<Theme extends RequiredThemeStructure = DefaultTheme>(options?: {
12
- createStyledComponent?: (...styles: Array<Interpolation<StyleFnProps<Theme>>>) => StyledComponent<ContainerProps>;
13
- useThemeProps?: (inProps: ContainerProps) => ContainerProps & {
14
- component?: React.ElementType;
15
- };
16
- componentName?: string;
17
- }): OverridableComponent<ContainerTypeMap<{}, "div">>;
18
- export {};
1
+ import * as React from 'react';
2
+ import { Interpolation, StyledComponent } from '@mui/styled-engine';
3
+ import { OverridableComponent } from '@mui/types';
4
+ import { ContainerProps, ContainerTypeMap } from './ContainerProps';
5
+ import { Theme as DefaultTheme } from '../createTheme';
6
+ interface StyleFnProps<Theme> extends ContainerProps {
7
+ theme: Theme;
8
+ ownerState: ContainerProps;
9
+ }
10
+ declare type RequiredThemeStructure = Pick<DefaultTheme, 'breakpoints' | 'spacing'>;
11
+ export default function createContainer<Theme extends RequiredThemeStructure = DefaultTheme>(options?: {
12
+ createStyledComponent?: (...styles: Array<Interpolation<StyleFnProps<Theme>>>) => StyledComponent<ContainerProps>;
13
+ useThemeProps?: (inProps: ContainerProps) => ContainerProps & {
14
+ component?: React.ElementType;
15
+ };
16
+ componentName?: string;
17
+ }): OverridableComponent<ContainerTypeMap<{}, "div">>;
18
+ export {};
@@ -1 +1 @@
1
- export {};
1
+ export {};
@@ -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;
@@ -45,17 +45,23 @@ export interface CssVarsProviderConfig<ColorScheme extends string> {
45
45
  */
46
46
  enableColorScheme?: boolean;
47
47
  /**
48
- * CSS variable prefix
49
- * @default ''
48
+ * A function to determine if the key, value should be attached as CSS Variable
49
+ * `keys` is an array that represents the object path keys.
50
+ * Ex, if the theme is { foo: { bar: 'var(--test)' } }
51
+ * then, keys = ['foo', 'bar']
52
+ * value = 'var(--test)'
50
53
  */
51
- prefix?: string;
54
+ shouldSkipGeneratingVar?: (keys: string[], value: string | number) => boolean;
52
55
  }
53
56
 
54
- export interface CreateCssVarsProviderResult<ColorScheme extends string, ThemeInput> {
57
+ export interface CreateCssVarsProviderResult<ColorScheme extends string> {
55
58
  CssVarsProvider: (
56
59
  props: React.PropsWithChildren<
57
60
  Partial<CssVarsProviderConfig<ColorScheme>> & {
58
- theme?: ThemeInput;
61
+ theme?: {
62
+ cssVarPrefix?: string;
63
+ colorSchemes: Record<ColorScheme, Record<string, any>>;
64
+ };
59
65
  /**
60
66
  * The document used to perform `disableTransitionOnChange` feature
61
67
  * @default document
@@ -83,10 +89,7 @@ export interface CreateCssVarsProviderResult<ColorScheme extends string, ThemeIn
83
89
  getInitColorSchemeScript: typeof getInitColorSchemeScript;
84
90
  }
85
91
 
86
- export default function createCssVarsProvider<
87
- ColorScheme extends string,
88
- ThemeInput extends { colorSchemes?: Partial<Record<ColorScheme, any>> },
89
- >(
92
+ export default function createCssVarsProvider<ColorScheme extends string>(
90
93
  options: CssVarsProviderConfig<ColorScheme> & {
91
94
  /**
92
95
  * Design system default theme
@@ -114,14 +117,6 @@ export default function createCssVarsProvider<
114
117
  * }
115
118
  */
116
119
  theme: any;
117
- /**
118
- * A function to determine if the key, value should be attached as CSS Variable
119
- * `keys` is an array that represents the object path keys.
120
- * Ex, if the theme is { foo: { bar: 'var(--test)' } }
121
- * then, keys = ['foo', 'bar']
122
- * value = 'var(--test)'
123
- */
124
- shouldSkipGeneratingVar?: (keys: string[], value: string | number) => boolean;
125
120
  /**
126
121
  * A function to be called after the CSS variables are attached. The result of this function will be the final theme pass to ThemeProvider.
127
122
  *
@@ -130,7 +125,7 @@ export default function createCssVarsProvider<
130
125
  */
131
126
  resolveTheme?: (theme: any) => any; // the type is any because it depends on the design system.
132
127
  },
133
- ): CreateCssVarsProviderResult<ColorScheme, ThemeInput>;
128
+ ): CreateCssVarsProviderResult<ColorScheme>;
134
129
 
135
130
  // disable automatic export
136
131
  export {};
@@ -28,11 +28,9 @@ var _getInitColorSchemeScript = _interopRequireWildcard(require("./getInitColorS
28
28
 
29
29
  var _useCurrentColorScheme = _interopRequireDefault(require("./useCurrentColorScheme"));
30
30
 
31
- var _createGetCssVar = _interopRequireDefault(require("./createGetCssVar"));
32
-
33
31
  var _jsxRuntime = require("react/jsx-runtime");
34
32
 
35
- const _excluded = ["colorSchemes", "components"];
33
+ const _excluded = ["colorSchemes", "components", "cssVarPrefix"];
36
34
 
37
35
  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); }
38
36
 
@@ -51,8 +49,7 @@ function createCssVarsProvider(options) {
51
49
  defaultColorScheme: designSystemColorScheme,
52
50
  disableTransitionOnChange: designSystemTransitionOnChange = false,
53
51
  enableColorScheme: designSystemEnableColorScheme = true,
54
- prefix: designSystemPrefix = '',
55
- shouldSkipGeneratingVar,
52
+ shouldSkipGeneratingVar: designSystemShouldSkipGeneratingVar,
56
53
  resolveTheme
57
54
  } = options;
58
55
 
@@ -75,7 +72,6 @@ function createCssVarsProvider(options) {
75
72
  function CssVarsProvider({
76
73
  children,
77
74
  theme: themeProp = defaultTheme,
78
- prefix = designSystemPrefix,
79
75
  modeStorageKey = defaultModeStorageKey,
80
76
  colorSchemeStorageKey = defaultColorSchemeStorageKey,
81
77
  attribute = defaultAttribute,
@@ -86,12 +82,14 @@ function createCssVarsProvider(options) {
86
82
  storageWindow = typeof window === 'undefined' ? undefined : window,
87
83
  documentNode = typeof document === 'undefined' ? undefined : document,
88
84
  colorSchemeNode = typeof document === 'undefined' ? undefined : document.documentElement,
89
- colorSchemeSelector = ':root'
85
+ colorSchemeSelector = ':root',
86
+ shouldSkipGeneratingVar = designSystemShouldSkipGeneratingVar
90
87
  }) {
91
88
  const hasMounted = React.useRef(false);
92
89
  const {
93
90
  colorSchemes = {},
94
- components = {}
91
+ components = {},
92
+ cssVarPrefix
95
93
  } = themeProp,
96
94
  restThemeProp = (0, _objectWithoutPropertiesLoose2.default)(themeProp, _excluded);
97
95
  const allColorSchemes = Object.keys(colorSchemes);
@@ -135,16 +133,14 @@ function createCssVarsProvider(options) {
135
133
  vars: rootVars,
136
134
  parsedTheme
137
135
  } = (0, _cssVarsParser.default)(theme, {
138
- prefix,
139
- basePrefix: designSystemPrefix,
136
+ prefix: cssVarPrefix,
140
137
  shouldSkipGeneratingVar
141
138
  });
142
139
  theme = (0, _extends2.default)({}, parsedTheme, {
143
140
  components,
144
141
  colorSchemes,
145
- prefix,
142
+ cssVarPrefix,
146
143
  vars: rootVars,
147
- getCssVar: (0, _createGetCssVar.default)(prefix),
148
144
  getColorSchemeSelector: targetColorScheme => `[${attribute}="${targetColorScheme}"] &`
149
145
  });
150
146
  const defaultColorSchemeStyleSheet = {};
@@ -155,8 +151,7 @@ function createCssVarsProvider(options) {
155
151
  vars,
156
152
  parsedTheme: parsedScheme
157
153
  } = (0, _cssVarsParser.default)(scheme, {
158
- prefix,
159
- basePrefix: designSystemPrefix,
154
+ prefix: cssVarPrefix,
160
155
  shouldSkipGeneratingVar
161
156
  });
162
157
  theme.vars = (0, _utils.deepmerge)(theme.vars, vars);
@@ -320,9 +315,9 @@ function createCssVarsProvider(options) {
320
315
  modeStorageKey: _propTypes.default.string,
321
316
 
322
317
  /**
323
- * CSS variable prefix.
318
+ * A function to determine if the key, value should be attached as CSS Variable
324
319
  */
325
- prefix: _propTypes.default.string,
320
+ shouldSkipGeneratingVar: _propTypes.default.func,
326
321
 
327
322
  /**
328
323
  * The window that attaches the 'storage' event listener
@@ -339,7 +334,8 @@ function createCssVarsProvider(options) {
339
334
  const getInitColorSchemeScript = params => (0, _getInitColorSchemeScript.default)((0, _extends2.default)({
340
335
  attribute: defaultAttribute,
341
336
  colorSchemeStorageKey: defaultColorSchemeStorageKey,
342
- modeStorageKey: defaultModeStorageKey
337
+ modeStorageKey: defaultModeStorageKey,
338
+ enableColorScheme: designSystemEnableColorScheme
343
339
  }, params));
344
340
 
345
341
  return {
@@ -1 +1 @@
1
- export {};
1
+ export {};
@@ -1,5 +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;
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, ...fallbacks: (T | AdditionalVars)[]) => string;
@@ -25,8 +25,8 @@ function createGetCssVar(prefix = '') {
25
25
  } // AdditionalVars makes `getCssVar` less strict, so it can be use like this `getCssVar('non-mui-variable')` without type error.
26
26
 
27
27
 
28
- const getCssVar = (field, ...vars) => {
29
- return `var(--${prefix ? `${prefix}-` : ''}${field}${appendVar(...vars)})`;
28
+ const getCssVar = (field, ...fallbacks) => {
29
+ return `var(--${prefix ? `${prefix}-` : ''}${field}${appendVar(...fallbacks)})`;
30
30
  };
31
31
 
32
32
  return getCssVar;