@mui/material 5.8.7 → 5.9.0

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 (56) hide show
  1. package/Autocomplete/Autocomplete.js +2 -2
  2. package/CHANGELOG.md +74 -0
  3. package/Modal/Modal.js +6 -6
  4. package/Popper/Popper.d.ts +1 -6
  5. package/README.md +60 -23
  6. package/ScopedCssBaseline/ScopedCssBaseline.d.ts +6 -0
  7. package/ScopedCssBaseline/ScopedCssBaseline.js +6 -1
  8. package/Tooltip/Tooltip.js +6 -5
  9. package/Unstable_Grid2/Grid2.d.ts +4 -0
  10. package/Unstable_Grid2/Grid2.js +34 -0
  11. package/Unstable_Grid2/Grid2Props.d.ts +15 -0
  12. package/Unstable_Grid2/Grid2Props.js +1 -0
  13. package/Unstable_Grid2/grid2Classes.d.ts +5 -0
  14. package/Unstable_Grid2/grid2Classes.js +14 -0
  15. package/Unstable_Grid2/index.d.ts +4 -0
  16. package/Unstable_Grid2/index.js +4 -0
  17. package/Unstable_Grid2/package.json +6 -0
  18. package/index.d.ts +3 -0
  19. package/index.js +3 -1
  20. package/legacy/Autocomplete/Autocomplete.js +2 -2
  21. package/legacy/Modal/Modal.js +13 -9
  22. package/legacy/ScopedCssBaseline/ScopedCssBaseline.js +6 -1
  23. package/legacy/Tooltip/Tooltip.js +6 -5
  24. package/legacy/Unstable_Grid2/Grid2.js +38 -0
  25. package/legacy/Unstable_Grid2/Grid2Props.js +1 -0
  26. package/legacy/Unstable_Grid2/grid2Classes.js +27 -0
  27. package/legacy/Unstable_Grid2/index.js +4 -0
  28. package/legacy/index.js +3 -1
  29. package/modern/Autocomplete/Autocomplete.js +2 -2
  30. package/modern/Modal/Modal.js +6 -6
  31. package/modern/ScopedCssBaseline/ScopedCssBaseline.js +6 -1
  32. package/modern/Tooltip/Tooltip.js +6 -5
  33. package/modern/Unstable_Grid2/Grid2.js +34 -0
  34. package/modern/Unstable_Grid2/Grid2Props.js +1 -0
  35. package/modern/Unstable_Grid2/grid2Classes.js +14 -0
  36. package/modern/Unstable_Grid2/index.js +4 -0
  37. package/modern/index.js +3 -1
  38. package/node/Autocomplete/Autocomplete.js +2 -2
  39. package/node/Modal/Modal.js +9 -9
  40. package/node/ScopedCssBaseline/ScopedCssBaseline.js +6 -1
  41. package/node/Tooltip/Tooltip.js +6 -5
  42. package/node/Unstable_Grid2/Grid2.js +47 -0
  43. package/node/Unstable_Grid2/Grid2Props.js +5 -0
  44. package/node/Unstable_Grid2/grid2Classes.js +25 -0
  45. package/node/Unstable_Grid2/index.js +56 -0
  46. package/node/index.js +22 -1
  47. package/package.json +6 -6
  48. package/styles/components.d.ts +5 -0
  49. package/styles/createTheme.d.ts +1 -1
  50. package/styles/experimental_extendTheme.d.ts +84 -7
  51. package/styles/index.d.ts +11 -0
  52. package/styles/overrides.d.ts +3 -1
  53. package/styles/props.d.ts +2 -0
  54. package/themeCssVarsAugmentation/index.d.ts +4 -8
  55. package/umd/material-ui.development.js +749 -272
  56. package/umd/material-ui.production.min.js +20 -25
@@ -231,6 +231,7 @@ export interface CssVarsPalette {
231
231
  error: PaletteColorChannel;
232
232
  info: PaletteColorChannel;
233
233
  success: PaletteColorChannel;
234
+ warning: PaletteColorChannel;
234
235
  text: PaletteTextChannel;
235
236
  dividerChannel: string;
236
237
  action: PaletteActionChannel;
@@ -274,7 +275,7 @@ export interface CssVarsThemeOptions extends Omit<ThemeOptions, 'palette' | 'com
274
275
  }
275
276
 
276
277
  // should not include keys defined in `shouldSkipGeneratingVar` and have value typeof function
277
- interface ThemeVars {
278
+ export interface ThemeVars {
278
279
  palette: Omit<
279
280
  ColorSystem['palette'],
280
281
  | 'colorScheme'
@@ -287,13 +288,92 @@ interface ThemeVars {
287
288
  opacity: Opacity;
288
289
  overlays: Overlays;
289
290
  shadows: Shadows;
290
- zIndex: ZIndex;
291
291
  shape: Theme['shape'];
292
+ zIndex: ZIndex;
292
293
  }
293
294
 
294
- // shut off automatic exporting for the `ThemeVars` above
295
+ type Split<T, K extends keyof T = keyof T> = K extends string | number
296
+ ? { [k in K]: Exclude<T[K], undefined> }
297
+ : never;
298
+
299
+ type ConcatDeep<T> = T extends Record<string | number, infer V>
300
+ ? keyof T extends string | number
301
+ ? V extends string | number
302
+ ? keyof T
303
+ : keyof V extends string | number
304
+ ? `${keyof T}-${ConcatDeep<Split<V>>}`
305
+ : never
306
+ : never
307
+ : never;
308
+
309
+ /**
310
+ * Does not work for these cases:
311
+ * - { borderRadius: string | number } // the value can't be a union
312
+ * - { shadows: [string, string, ..., string] } // the value can't be an array
313
+ */
314
+ type NormalizeVars<T> = ConcatDeep<Split<T>>;
315
+
316
+ // shut off automatic exporting for the Generics above
295
317
  export {};
296
318
 
319
+ export interface ThemeCssVarOverrides {}
320
+
321
+ export type ThemeCssVar = OverridableStringUnion<
322
+ | NormalizeVars<Omit<ThemeVars, 'overlays' | 'shadows' | 'shape'>>
323
+ | 'shape-borderRadius'
324
+ | 'shadows-0'
325
+ | 'shadows-1'
326
+ | 'shadows-2'
327
+ | 'shadows-3'
328
+ | 'shadows-4'
329
+ | 'shadows-5'
330
+ | 'shadows-6'
331
+ | 'shadows-7'
332
+ | 'shadows-8'
333
+ | 'shadows-9'
334
+ | 'shadows-10'
335
+ | 'shadows-11'
336
+ | 'shadows-12'
337
+ | 'shadows-13'
338
+ | 'shadows-14'
339
+ | 'shadows-15'
340
+ | 'shadows-16'
341
+ | 'shadows-17'
342
+ | 'shadows-18'
343
+ | 'shadows-19'
344
+ | 'shadows-20'
345
+ | 'shadows-21'
346
+ | 'shadows-22'
347
+ | 'shadows-23'
348
+ | 'shadows-24'
349
+ | 'overlays-0'
350
+ | 'overlays-1'
351
+ | 'overlays-2'
352
+ | 'overlays-3'
353
+ | 'overlays-4'
354
+ | 'overlays-5'
355
+ | 'overlays-6'
356
+ | 'overlays-7'
357
+ | 'overlays-8'
358
+ | 'overlays-9'
359
+ | 'overlays-10'
360
+ | 'overlays-11'
361
+ | 'overlays-12'
362
+ | 'overlays-13'
363
+ | 'overlays-14'
364
+ | 'overlays-15'
365
+ | 'overlays-16'
366
+ | 'overlays-17'
367
+ | 'overlays-18'
368
+ | 'overlays-19'
369
+ | 'overlays-20'
370
+ | 'overlays-21'
371
+ | 'overlays-22'
372
+ | 'overlays-23'
373
+ | 'overlays-24',
374
+ ThemeCssVarOverrides
375
+ >;
376
+
297
377
  /**
298
378
  * Theme properties generated by extendTheme and CssVarsProvider
299
379
  */
@@ -301,10 +381,7 @@ export interface CssVarsTheme extends ColorSystem {
301
381
  colorSchemes: Record<SupportedColorScheme, ColorSystem>;
302
382
  cssVarPrefix: string;
303
383
  vars: ThemeVars;
304
- getCssVar: <CustomVar extends string = never>(
305
- field: string | CustomVar,
306
- ...vars: Array<string | CustomVar>
307
- ) => string;
384
+ getCssVar: (field: ThemeCssVar, ...vars: ThemeCssVar[]) => string;
308
385
  getColorSchemeSelector: (colorScheme: SupportedColorScheme) => string;
309
386
  }
310
387
 
package/styles/index.d.ts CHANGED
@@ -6,7 +6,10 @@ export {
6
6
  Theme,
7
7
  } from './createTheme';
8
8
  export { default as adaptV4Theme, DeprecatedThemeOptions } from './adaptV4Theme';
9
+ export { Shadows } from './shadows';
10
+ export { ZIndex } from './zIndex';
9
11
  export {
12
+ CommonColors,
10
13
  Palette,
11
14
  PaletteColor,
12
15
  PaletteColorOptions,
@@ -97,8 +100,11 @@ export { default as experimental_extendTheme } from './experimental_extendTheme'
97
100
  export type {
98
101
  ColorSchemeOverrides,
99
102
  SupportedColorScheme,
103
+ ColorSystem,
104
+ CssVarsPalette,
100
105
  Opacity,
101
106
  Overlays,
107
+ PaletteAlert,
102
108
  PaletteActionChannel,
103
109
  PaletteAppBar,
104
110
  PaletteAvatar,
@@ -107,8 +113,10 @@ export type {
107
113
  PaletteCommonChannel,
108
114
  PaletteFilledInput,
109
115
  PaletteLinearProgress,
116
+ PaletteSkeleton,
110
117
  PaletteSlider,
111
118
  PaletteSnackbarContent,
119
+ PaletteSpeedDialAction,
112
120
  PaletteStepConnector,
113
121
  PaletteStepContent,
114
122
  PaletteSwitch,
@@ -117,4 +125,7 @@ export type {
117
125
  PaletteTooltip,
118
126
  CssVarsThemeOptions,
119
127
  CssVarsTheme,
128
+ ThemeVars,
129
+ ThemeCssVar,
130
+ ThemeCssVarOverrides,
120
131
  } from './experimental_extendTheme';
@@ -44,6 +44,7 @@ import { FormGroupClassKey } from '../FormGroup';
44
44
  import { FormHelperTextClassKey } from '../FormHelperText';
45
45
  import { FormLabelClassKey } from '../FormLabel';
46
46
  import { GridClassKey } from '../Grid';
47
+ import { Grid2Slot } from '../Unstable_Grid2';
47
48
  import { IconButtonClassKey } from '../IconButton';
48
49
  import { IconClassKey } from '../Icon';
49
50
  import { ImageListClassKey } from '../ImageList';
@@ -133,7 +134,7 @@ export type ComponentsOverrides<Theme = unknown> = {
133
134
  OverridesStyleRules<ComponentNameToClassKey[Name], Name, Theme>
134
135
  >;
135
136
  } & {
136
- MuiCssBaseline?: CSSObject | string;
137
+ MuiCssBaseline?: CSSObject | string | ((theme: Theme) => CSSInterpolation);
137
138
  };
138
139
 
139
140
  export interface ComponentNameToClassKey {
@@ -181,6 +182,7 @@ export interface ComponentNameToClassKey {
181
182
  MuiFormHelperText: FormHelperTextClassKey;
182
183
  MuiFormLabel: FormLabelClassKey;
183
184
  MuiGrid: GridClassKey;
185
+ MuiGrid2: Grid2Slot;
184
186
  MuiIcon: IconClassKey;
185
187
  MuiIconButton: IconButtonClassKey;
186
188
  MuiImageList: ImageListClassKey;
package/styles/props.d.ts CHANGED
@@ -43,6 +43,7 @@ import { FormGroupProps } from '../FormGroup';
43
43
  import { FormHelperTextProps } from '../FormHelperText';
44
44
  import { FormLabelProps } from '../FormLabel';
45
45
  import { GridProps } from '../Grid';
46
+ import { Grid2Props } from '../Unstable_Grid2';
46
47
  import { IconButtonProps } from '../IconButton';
47
48
  import { IconProps } from '../Icon';
48
49
  import { ImageListProps } from '../ImageList';
@@ -167,6 +168,7 @@ export interface ComponentsPropsList {
167
168
  MuiFormHelperText: FormHelperTextProps;
168
169
  MuiFormLabel: FormLabelProps;
169
170
  MuiGrid: GridProps;
171
+ MuiGrid2: Grid2Props;
170
172
  MuiImageList: ImageListProps;
171
173
  MuiImageListItem: ImageListItemProps;
172
174
  MuiImageListItemBar: ImageListItemBarProps;
@@ -15,16 +15,12 @@ declare module '@mui/material/styles' {
15
15
  // The palette must be extended in each node.
16
16
  interface Theme extends Omit<CssVarsTheme, 'palette'> {}
17
17
 
18
- // The extended Palette should be in sync with `extendTheme`
19
- interface Palette extends CssVarsPalette {}
20
- }
21
-
22
- declare module '@mui/material/styles/createPalette' {
18
+ // Extend the type that will be used in palette
23
19
  interface CommonColors extends PaletteCommonChannel {}
24
-
25
20
  interface PaletteColor extends PaletteColorChannel {}
26
-
27
21
  interface TypeText extends PaletteTextChannel {}
28
-
29
22
  interface TypeAction extends PaletteActionChannel {}
23
+
24
+ // The extended Palette should be in sync with `extendTheme`
25
+ interface Palette extends CssVarsPalette {}
30
26
  }