@mui/material 5.8.3 → 5.8.4

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 (64) hide show
  1. package/Autocomplete/autocompleteClasses.d.ts +1 -1
  2. package/Button/buttonClasses.d.ts +24 -0
  3. package/Button/buttonClasses.js +1 -1
  4. package/CHANGELOG.md +90 -10
  5. package/Grid/Grid.d.ts +73 -52
  6. package/Grid/Grid.js +94 -40
  7. package/Grow/Grow.js +1 -2
  8. package/Hidden/withWidth.js +0 -2
  9. package/Link/Link.js +10 -17
  10. package/Link/getTextDecoration.d.ts +15 -0
  11. package/Link/getTextDecoration.js +29 -0
  12. package/Popover/Popover.d.ts +7 -0
  13. package/Popover/index.js +1 -0
  14. package/README.md +6 -9
  15. package/Slider/Slider.d.ts +3 -1
  16. package/Slider/Slider.js +3 -1
  17. package/Snackbar/Snackbar.js +6 -20
  18. package/Stack/Stack.js +1 -1
  19. package/StepIcon/StepIcon.js +2 -1
  20. package/Tab/Tab.d.ts +0 -1
  21. package/Tabs/Tabs.js +16 -0
  22. package/index.js +1 -1
  23. package/legacy/Button/buttonClasses.js +1 -1
  24. package/legacy/Grid/Grid.js +97 -48
  25. package/legacy/Grow/Grow.js +1 -2
  26. package/legacy/Hidden/withWidth.js +0 -2
  27. package/legacy/Link/Link.js +10 -17
  28. package/legacy/Link/getTextDecoration.js +28 -0
  29. package/legacy/Popover/index.js +1 -0
  30. package/legacy/Slider/Slider.js +3 -1
  31. package/legacy/Snackbar/Snackbar.js +6 -21
  32. package/legacy/Stack/Stack.js +2 -1
  33. package/legacy/StepIcon/StepIcon.js +2 -1
  34. package/legacy/Tabs/Tabs.js +16 -0
  35. package/legacy/index.js +1 -1
  36. package/modern/Button/buttonClasses.js +1 -1
  37. package/modern/Grid/Grid.js +94 -40
  38. package/modern/Grow/Grow.js +1 -2
  39. package/modern/Hidden/withWidth.js +0 -2
  40. package/modern/Link/Link.js +10 -17
  41. package/modern/Link/getTextDecoration.js +29 -0
  42. package/modern/Popover/index.js +1 -0
  43. package/modern/Slider/Slider.js +3 -1
  44. package/modern/Snackbar/Snackbar.js +6 -20
  45. package/modern/Stack/Stack.js +1 -1
  46. package/modern/StepIcon/StepIcon.js +2 -1
  47. package/modern/Tabs/Tabs.js +16 -0
  48. package/modern/index.js +1 -1
  49. package/node/Button/buttonClasses.js +1 -1
  50. package/node/Grid/Grid.js +95 -40
  51. package/node/Grow/Grow.js +1 -2
  52. package/node/Hidden/withWidth.js +0 -3
  53. package/node/Link/Link.js +12 -20
  54. package/node/Link/getTextDecoration.js +39 -0
  55. package/node/Popover/index.js +13 -3
  56. package/node/Slider/Slider.js +3 -1
  57. package/node/Snackbar/Snackbar.js +6 -18
  58. package/node/Stack/Stack.js +1 -1
  59. package/node/StepIcon/StepIcon.js +2 -1
  60. package/node/Tabs/Tabs.js +16 -0
  61. package/node/index.js +1 -1
  62. package/package.json +5 -6
  63. package/umd/material-ui.development.js +190 -173
  64. package/umd/material-ui.production.min.js +21 -21
@@ -19,7 +19,7 @@ export interface AutocompleteClasses {
19
19
  inputRoot: string;
20
20
  /** Styles applied to the input element. */
21
21
  input: string;
22
- /** Styles applied to the input element if tag focused. */
22
+ /** Styles applied to the input element if the input is focused. */
23
23
  inputFocused: string;
24
24
  /** Styles applied to the endAdornment element. */
25
25
  endAdornment: string;
@@ -9,6 +9,14 @@ export interface ButtonClasses {
9
9
  textPrimary: string;
10
10
  /** Styles applied to the root element if `variant="text"` and `color="secondary"`. */
11
11
  textSecondary: string;
12
+ /** Styles applied to the root element if `variant="text"` and `color="success"`. */
13
+ textSuccess: string;
14
+ /** Styles applied to the root element if `variant="text"` and `color="error"`. */
15
+ textError: string;
16
+ /** Styles applied to the root element if `variant="text"` and `color="info"`. */
17
+ textInfo: string;
18
+ /** Styles applied to the root element if `variant="text"` and `color="warning"`. */
19
+ textWarning: string;
12
20
  /** Styles applied to the root element if `variant="outlined"`. */
13
21
  outlined: string;
14
22
  /** Styles applied to the root element if `variant="outlined"` and `color="inherit"`. */
@@ -17,6 +25,14 @@ export interface ButtonClasses {
17
25
  outlinedPrimary: string;
18
26
  /** Styles applied to the root element if `variant="outlined"` and `color="secondary"`. */
19
27
  outlinedSecondary: string;
28
+ /** Styles applied to the root element if `variant="outlined"` and `color="success"`. */
29
+ outlinedSuccess: string;
30
+ /** Styles applied to the root element if `variant="outlined"` and `color="error"`. */
31
+ outlinedError: string;
32
+ /** Styles applied to the root element if `variant="outlined"` and `color="info"`. */
33
+ outlinedInfo: string;
34
+ /** Styles applied to the root element if `variant="outlined"` and `color="warning"`. */
35
+ outlinedWarning: string;
20
36
  /** Styles applied to the root element if `variant="contained"`. */
21
37
  contained: string;
22
38
  /** Styles applied to the root element if `variant="contained"` and `color="inherit"`. */
@@ -25,6 +41,14 @@ export interface ButtonClasses {
25
41
  containedPrimary: string;
26
42
  /** Styles applied to the root element if `variant="contained"` and `color="secondary"`. */
27
43
  containedSecondary: string;
44
+ /** Styles applied to the root element if `variant="contained"` and `color="success"`. */
45
+ containedSuccess: string;
46
+ /** Styles applied to the root element if `variant="contained"` and `color="info"`. */
47
+ containedInfo: string;
48
+ /** Styles applied to the root element if `variant="contained"` and `color="error"`. */
49
+ containedError: string;
50
+ /** Styles applied to the root element if `variant="contained"` and `color="warning"`. */
51
+ containedWarning: string;
28
52
  /** Styles applied to the root element if `disableElevation={true}`. */
29
53
  disableElevation: string;
30
54
  /** State class applied to the ButtonBase root element if the button is keyboard focused. */
@@ -2,5 +2,5 @@ import { generateUtilityClass, generateUtilityClasses } from '@mui/base';
2
2
  export function getButtonUtilityClass(slot) {
3
3
  return generateUtilityClass('MuiButton', slot);
4
4
  }
5
- const buttonClasses = generateUtilityClasses('MuiButton', ['root', 'text', 'textInherit', 'textPrimary', 'textSecondary', 'outlined', 'outlinedInherit', 'outlinedPrimary', 'outlinedSecondary', 'contained', 'containedInherit', 'containedPrimary', 'containedSecondary', 'disableElevation', 'focusVisible', 'disabled', 'colorInherit', 'textSizeSmall', 'textSizeMedium', 'textSizeLarge', 'outlinedSizeSmall', 'outlinedSizeMedium', 'outlinedSizeLarge', 'containedSizeSmall', 'containedSizeMedium', 'containedSizeLarge', 'sizeMedium', 'sizeSmall', 'sizeLarge', 'fullWidth', 'startIcon', 'endIcon', 'iconSizeSmall', 'iconSizeMedium', 'iconSizeLarge']);
5
+ const buttonClasses = generateUtilityClasses('MuiButton', ['root', 'text', 'textInherit', 'textPrimary', 'textSecondary', 'textSuccess', 'textError', 'textInfo', 'textWarning', 'outlined', 'outlinedInherit', 'outlinedPrimary', 'outlinedSecondary', 'outlinedSuccess', 'outlinedError', 'outlinedInfo', 'outlinedWarning', 'contained', 'containedInherit', 'containedPrimary', 'containedSecondary', 'containedSuccess', 'containedError', 'containedInfo', 'containedWarning', 'disableElevation', 'focusVisible', 'disabled', 'colorInherit', 'textSizeSmall', 'textSizeMedium', 'textSizeLarge', 'outlinedSizeSmall', 'outlinedSizeMedium', 'outlinedSizeLarge', 'containedSizeSmall', 'containedSizeMedium', 'containedSizeLarge', 'sizeMedium', 'sizeSmall', 'sizeLarge', 'fullWidth', 'startIcon', 'endIcon', 'iconSizeSmall', 'iconSizeMedium', 'iconSizeLarge']);
6
6
  export default buttonClasses;
package/CHANGELOG.md CHANGED
@@ -1,5 +1,85 @@
1
1
  # [Versions](https://mui.com/versions/)
2
2
 
3
+ ## 5.8.4
4
+
5
+ <!-- generated comparing v5.8.3..master -->
6
+
7
+ _Jun 14, 2022_
8
+
9
+ A big thanks to the 24 contributors who made this release possible. Here are some highlights ✨:
10
+
11
+ - 🚀 Added support for custom breakpoints in the `Grid` component by @boutahlilsoufiane
12
+ - 📚 Added guide on how to use Material UI with Shadow DOM by @cherniavskii
13
+ - many other 🐛 bug fixes and 📚 documentation improvements
14
+
15
+ ### `@mui/material@5.8.4`
16
+
17
+ - &#8203;<!-- 36 -->[Button] Add missing classes in `ButtonClasses` type (#33040) @ZeeshanTamboli
18
+ - &#8203;<!-- 20 -->[Grid] Fix prop-type key regression (#33123) @oliviertassinari
19
+ - &#8203;<!-- 19 -->[Grid] Support custom breakpoints (#31998) @boutahlilsoufiane
20
+ - &#8203;<!-- 18 -->[Grow] Limit CSS transition bug workaround to Safari 15.4 only (#32996) @igordanchenko
21
+ - &#8203;<!-- 17 -->[Hidden] Remove dependency on hoist-non-react-statics (#33015) @oliviertassinari
22
+ - &#8203;<!-- 12 -->[Link] Add support for CSS variables (#33036) @winderica
23
+ - &#8203;<!-- 07 -->[Popover] Export `getOffsetTop` & `getOffsetLeft` from Popover's index and add typings (#32959) @rart
24
+ - &#8203;<!-- 06 -->[Slider] Fix SliderValueLabelProps type (#32895) @oliviertassinari
25
+ - &#8203;<!-- 05 -->[Snackbar] Remove `RTL` direction specific logic (#32808) @aaarichter
26
+ - &#8203;<!-- 04 -->[StepIcon] Fix text centering when changing browser font size (#32706) @alansouzati
27
+ - &#8203;<!-- 02 -->[Tabs] Scroll by width of the first visible tab if only one tab is partially visible (#32778) @frankkluijtmans
28
+
29
+ ### `@mui/system@5.8.4`
30
+
31
+ - &#8203;<!-- 38 -->[Stack, system] Apply correct responsive styles if any custom breakpoints are provided (#32913) @ZeeshanTamboli
32
+ - &#8203;<!-- 03 -->[system] Fix missing typings for ColorFormat (#32417) @l-zoy
33
+
34
+ ### `@mui/codemod@5.8.4`
35
+
36
+ - &#8203;<!-- 35 -->[codemod] Add support for `@mui/styles/makeStyles` imports (#32962) @joshkel
37
+
38
+ ### `@mui/lab@5.0.0-alpha.86`
39
+
40
+ - &#8203;<!-- 08 -->[pickers] Fix broken ref forwarding (#33107) @oliviertassinari
41
+ - &#8203;<!-- 13 -->[lab] Fix React's `forwardRef` warning when importing from the index (#33134) @mnajdova
42
+
43
+ ### `@mui/base@5.0.0-alpha.85`
44
+
45
+ - &#8203;<!-- 11 -->[MenuUnstyled] Accept callbacks in componentsProps (#32997) @michaldudak
46
+ - &#8203;<!-- 10 -->[ModalUnstyled] Fix errors from the W3C validator about incorrect aria-hidden attribute on some elements (#30920) @mkrtchian
47
+ - &#8203;<!-- 09 -->[ModalUnstyled] Fix behavior of not respecting props ariaHidden value (#32055) @tech-meppem
48
+
49
+ ### `@mui/joy@5.0.0-alpha.32`
50
+
51
+ - &#8203;<!-- 16 -->[Joy] Miscellaneous card fixes (#33129) @siriwatknp
52
+ - &#8203;<!-- 15 -->[Joy] Miscellaneous fixes (#33073) @siriwatknp
53
+ - &#8203;<!-- 14 -->[Joy] Add typography and link docs (#33047) @siriwatknp
54
+
55
+ ### Docs
56
+
57
+ - &#8203;<!-- 40 -->[Contributing.md] Local install instructions (#32975) @Moizsohail
58
+ - &#8203;<!-- 32 -->[docs] Add responsive AppBar with drawer (#32769) @dvlprAlamin
59
+ - &#8203;<!-- 31 -->[docs] Move codesandbox to MUI org (#33122) @oliviertassinari
60
+ - &#8203;<!-- 30 -->[docs] Add Shadow DOM guide (#33007) @cherniavskii
61
+ - &#8203;<!-- 29 -->[docs] Fix typo in Material UI overview page (#33087) @oliviertassinari
62
+ - &#8203;<!-- 28 -->[docs] Miscellaneous fixes in `MUI Base` docs (#33091) @ZeeshanTamboli
63
+ - &#8203;<!-- 27 -->[docs] Fix GitHub capitalization (#33071) @oliviertassinari
64
+ - &#8203;<!-- 26 -->[docs] Fix a typo in `InputUnstyled` docs (#33077) @ZeeshanTamboli
65
+ - &#8203;<!-- 25 -->[docs] Add notification for Joy blog post (#33059) @siriwatknp
66
+ - &#8203;<!-- 24 -->[docs] Improve aspect ratio docs and integration (#33065) @siriwatknp
67
+ - &#8203;<!-- 34 -->[docs] Update code block copy label (#33128) @siriwatknp
68
+ - &#8203;<!-- 23 -->[docs] Fix typo in Autocomplete CSS API (#32838) @KeaghanKennedy
69
+ - &#8203;<!-- 22 -->[docs] Improvements for Radio Group Rating Docs (#32843) @Kai-W
70
+ - &#8203;<!-- 21 -->[docs] Enable Joy pages (#33064) @siriwatknp
71
+ - &#8203;<!-- 02 -->[website] Add Joy UI to the pricing page (#33099) @danilo-leal
72
+ - &#8203;<!-- 01 -->[website] Clarify the pricing a bit (#33069) @oliviertassinari
73
+
74
+ ### Core
75
+
76
+ - &#8203;<!-- 39 -->yarn proptypes @oliviertassinari
77
+ - &#8203;<!-- 34 -->[core] Update dependencies to fix security vulnerabilities (#33095) @michaldudak
78
+ - &#8203;<!-- 33 -->[core] Import new line convention (#33068) @oliviertassinari
79
+ - &#8203;<!-- 37 -->[core] Make repository configurable in changelog script (#33130) @Janpot
80
+
81
+ All contributors of this release in alphabetical order: @aaarichter, @alansouzati, @boutahlilsoufiane, @cherniavskii, @danilo-leal, @dvlprAlamin, @frankkluijtmans, @igordanchenko, @Janpot, @joshkel, @Kai-W, @KeaghanKennedy, @l-zoy, @michaldudak, @mkrtchian, @mnajdova, @Moizsohail, @oliviertassinari, @pushys, @rart, @siriwatknp, @tech-meppem, @winderica, @ZeeshanTamboli
82
+
3
83
  ## 5.8.3
4
84
 
5
85
  <!-- generated comparing v5.8.2..master -->
@@ -9,25 +89,25 @@ _Jun 7, 2022_
9
89
  A big thanks to the 15 contributors who made this release possible.
10
90
  This release is mostly about 🐛 bug fixes and 📚 documentation improvements.
11
91
 
12
- ## `@mui/material@5.8.3`
92
+ ### `@mui/material@5.8.3`
13
93
 
14
94
  - [Alert] Constrain message width and allow overflow (#32747) @Janpot
15
95
  - [Checkbox] Add support for CSS variables (#32579) @haneenmahd
16
96
  - [Slider] Fix positioning of tooltips on vertical slider (#32919) @abhinav-22-tech
17
97
 
18
- ## `@mui/system@5.8.3`
98
+ ### `@mui/system@5.8.3`
19
99
 
20
100
  - [system] Configurable attributes for libraries (#32971) @siriwatknp
21
101
 
22
- ## `@mui/codemod@5.8.3
102
+ ### `@mui/codemod@5.8.3`
23
103
 
24
104
  - [codemod] Fix infinite loop in jss-to-tss-react and add TODO (#33048) @ryancogswell
25
105
 
26
- ## `@mui/lab@5.0.0-alpha.85`
106
+ ### `@mui/lab@5.0.0-alpha.85`
27
107
 
28
108
  - [pickers] Add deprecations when importing pickers from the lab (#32950) @flaviendelangle
29
109
 
30
- ## `@mui/joy@5.0.0-alpha.31`
110
+ ### `@mui/joy@5.0.0-alpha.31`
31
111
 
32
112
  - [Joy] Add `Slider` component and demos (#32694) @hbjORbj
33
113
  - [Joy] Add articles about customization approaches (#32887) @siriwatknp
@@ -35,7 +115,7 @@ This release is mostly about 🐛 bug fixes and 📚 documentation improvements.
35
115
  - [Joy] Add docs about dark mode (#33002) @siriwatknp
36
116
  - [Joy] Add template UIs & first look blog post (#32791) @danilo-leal
37
117
 
38
- ## `@mui/base@5.0.0-alpha.84`
118
+ ### `@mui/base@5.0.0-alpha.84`
39
119
 
40
120
  - [base] Remove @mui/system in tests (#32945) @kevinji
41
121
  - [ButtonUnstyled] Accept callbacks in componentsProps (#32991) @michaldudak
@@ -44,7 +124,7 @@ This release is mostly about 🐛 bug fixes and 📚 documentation improvements.
44
124
  - [TabPanelUnstyled] Define ownerState and slot props' types (#32928) @michaldudak
45
125
  - [TabsListUnstyled] Define ownerState and slot props' types (#32925) @michaldudak
46
126
 
47
- ## Docs
127
+ ### Docs
48
128
 
49
129
  - [blog] Fix anchor link scroll (#32994) @oliviertassinari
50
130
  - [docs] Add "Migration" section to sidebar and revise v4-v5 content (#32740) @samuelsycamore
@@ -62,7 +142,7 @@ This release is mostly about 🐛 bug fixes and 📚 documentation improvements.
62
142
  - [website] Polish the pricing page (#32811) @oliviertassinari
63
143
  - [website] Remove unnecessary `address` dependency (#32957) @michaldudak
64
144
 
65
- ## Core
145
+ ### Core
66
146
 
67
147
  - [core] Improve icon synonyms (#32742) @oliviertassinari
68
148
  - [core] Prepare Next.js config for React 18 (#32963) @michaldudak
@@ -2000,7 +2080,7 @@ A big thanks to the 15 contributors who made this release possible. Here are som
2000
2080
  - &#8203;<!-- 33 -->[core] Add `experiments` index page (#29582) @siriwatknp
2001
2081
  - &#8203;<!-- 32 -->[core] Move s3 bucket ownership to mui-org (#29609) @eps1lon
2002
2082
  - &#8203;<!-- 31 -->[core] Improve support request message (#29614) @mnajdova
2003
- - &#8203;<!-- 30 -->[core] Use support request Github Action (#29594) @mnajdova
2083
+ - &#8203;<!-- 30 -->[core] Use support request GitHub Action (#29594) @mnajdova
2004
2084
  - &#8203;<!-- 29 -->[core] Remove unused `getJsxPreview` util (#29586) @ZeeshanTamboli
2005
2085
  - &#8203;<!-- 28 -->[core] Use GitHub issue forms (#28038) @oliviertassinari
2006
2086
  - &#8203;<!-- 26 -->[core] Add playground (#29423) @oliviertassinari
@@ -6055,7 +6135,7 @@ A big thanks to the 24 contributors who made this release possible. Here are som
6055
6135
  - [docs] Fix duplicated styles generated from emotion (#23809) @mnajdova
6056
6136
  - [docs] Fix icon alignment in /components/breadcrumbs (#23818) @eps1lon
6057
6137
  - [docs] Fix production deploy (#23963) @eps1lon
6058
- - [docs] Fix source on Github links (#23821) @praveenkumar-kalidass
6138
+ - [docs] Fix source on GitHub links (#23821) @praveenkumar-kalidass
6059
6139
  - [docs] Fix StickyHeaderTable round borders (#23882) @antoniopacheco
6060
6140
  - [docs] Fix typo in date picker dayjs adapter name (#23935) @andresmrm
6061
6141
  - [docs] Improve system properties page (#23961) @mnajdova
package/Grid/Grid.d.ts CHANGED
@@ -1,5 +1,12 @@
1
1
  import * as React from 'react';
2
- import { ResponsiveStyleValue, SxProps, SystemProps } from '@mui/system';
2
+ import {
3
+ ResponsiveStyleValue,
4
+ SxProps,
5
+ SystemProps,
6
+ Breakpoint,
7
+ BreakpointOverrides,
8
+ } from '@mui/system';
9
+ import { IfEquals } from '@mui/types';
3
10
  import { Theme } from '../styles';
4
11
  import { OverridableComponent, OverrideProps } from '../OverridableComponent';
5
12
  import { GridClasses } from './gridClasses';
@@ -12,6 +19,70 @@ export type GridWrap = 'nowrap' | 'wrap' | 'wrap-reverse';
12
19
 
13
20
  export type GridSize = 'auto' | number;
14
21
 
22
+ interface RegularBreakpoints {
23
+ /**
24
+ * If a number, it sets the number of columns the grid item uses.
25
+ * It can't be greater than the total number of columns of the container (12 by default).
26
+ * If 'auto', the grid item's width matches its content.
27
+ * If false, the prop is ignored.
28
+ * If true, the grid item's width grows to use the space available in the grid container.
29
+ * The value is applied for the `lg` breakpoint and wider screens if not overridden.
30
+ * @default false
31
+ */
32
+ lg?: boolean | GridSize;
33
+ /**
34
+ * If a number, it sets the number of columns the grid item uses.
35
+ * It can't be greater than the total number of columns of the container (12 by default).
36
+ * If 'auto', the grid item's width matches its content.
37
+ * If false, the prop is ignored.
38
+ * If true, the grid item's width grows to use the space available in the grid container.
39
+ * The value is applied for the `md` breakpoint and wider screens if not overridden.
40
+ * @default false
41
+ */
42
+ md?: boolean | GridSize;
43
+ /**
44
+ * If a number, it sets the number of columns the grid item uses.
45
+ * It can't be greater than the total number of columns of the container (12 by default).
46
+ * If 'auto', the grid item's width matches its content.
47
+ * If false, the prop is ignored.
48
+ * If true, the grid item's width grows to use the space available in the grid container.
49
+ * The value is applied for the `sm` breakpoint and wider screens if not overridden.
50
+ * @default false
51
+ */
52
+ sm?: boolean | GridSize;
53
+ /**
54
+ * If a number, it sets the number of columns the grid item uses.
55
+ * It can't be greater than the total number of columns of the container (12 by default).
56
+ * If 'auto', the grid item's width matches its content.
57
+ * If false, the prop is ignored.
58
+ * If true, the grid item's width grows to use the space available in the grid container.
59
+ * The value is applied for the `xl` breakpoint and wider screens if not overridden.
60
+ * @default false
61
+ */
62
+ xl?: boolean | GridSize;
63
+ /**
64
+ * If a number, it sets the number of columns the grid item uses.
65
+ * It can't be greater than the total number of columns of the container (12 by default).
66
+ * If 'auto', the grid item's width matches its content.
67
+ * If false, the prop is ignored.
68
+ * If true, the grid item's width grows to use the space available in the grid container.
69
+ * The value is applied for all the screen sizes with the lowest priority.
70
+ * @default false
71
+ */
72
+ xs?: boolean | GridSize;
73
+ }
74
+
75
+ type CustomBreakpoints = Partial<Record<Breakpoint, boolean | GridSize>>;
76
+
77
+ interface BreakpointOverridesEmpty {}
78
+
79
+ type Breakpoints = IfEquals<
80
+ BreakpointOverrides,
81
+ BreakpointOverridesEmpty,
82
+ RegularBreakpoints,
83
+ CustomBreakpoints
84
+ >;
85
+
15
86
  export interface GridTypeMap<P = {}, D extends React.ElementType = 'div'> {
16
87
  props: P &
17
88
  SystemProps<Theme> & {
@@ -51,41 +122,11 @@ export interface GridTypeMap<P = {}, D extends React.ElementType = 'div'> {
51
122
  * @default false
52
123
  */
53
124
  item?: boolean;
54
- /**
55
- * If a number, it sets the number of columns the grid item uses.
56
- * It can't be greater than the total number of columns of the container (12 by default).
57
- * If 'auto', the grid item's width matches its content.
58
- * If false, the prop is ignored.
59
- * If true, the grid item's width grows to use the space available in the grid container.
60
- * The value is applied for the `lg` breakpoint and wider screens if not overridden.
61
- * @default false
62
- */
63
- lg?: boolean | GridSize;
64
- /**
65
- * If a number, it sets the number of columns the grid item uses.
66
- * It can't be greater than the total number of columns of the container (12 by default).
67
- * If 'auto', the grid item's width matches its content.
68
- * If false, the prop is ignored.
69
- * If true, the grid item's width grows to use the space available in the grid container.
70
- * The value is applied for the `md` breakpoint and wider screens if not overridden.
71
- * @default false
72
- */
73
- md?: boolean | GridSize;
74
125
  /**
75
126
  * Defines the vertical space between the type `item` components.
76
127
  * It overrides the value of the `spacing` prop.
77
128
  */
78
129
  rowSpacing?: ResponsiveStyleValue<GridSpacing>;
79
- /**
80
- * If a number, it sets the number of columns the grid item uses.
81
- * It can't be greater than the total number of columns of the container (12 by default).
82
- * If 'auto', the grid item's width matches its content.
83
- * If false, the prop is ignored.
84
- * If true, the grid item's width grows to use the space available in the grid container.
85
- * The value is applied for the `sm` breakpoint and wider screens if not overridden.
86
- * @default false
87
- */
88
- sm?: boolean | GridSize;
89
130
  /**
90
131
  * Defines the space between the type `item` components.
91
132
  * It can only be used on a type `container` component.
@@ -102,33 +143,13 @@ export interface GridTypeMap<P = {}, D extends React.ElementType = 'div'> {
102
143
  * @default 'wrap'
103
144
  */
104
145
  wrap?: GridWrap;
105
- /**
106
- * If a number, it sets the number of columns the grid item uses.
107
- * It can't be greater than the total number of columns of the container (12 by default).
108
- * If 'auto', the grid item's width matches its content.
109
- * If false, the prop is ignored.
110
- * If true, the grid item's width grows to use the space available in the grid container.
111
- * The value is applied for the `xl` breakpoint and wider screens if not overridden.
112
- * @default false
113
- */
114
- xl?: boolean | GridSize;
115
- /**
116
- * If a number, it sets the number of columns the grid item uses.
117
- * It can't be greater than the total number of columns of the container (12 by default).
118
- * If 'auto', the grid item's width matches its content.
119
- * If false, the prop is ignored.
120
- * If true, the grid item's width grows to use the space available in the grid container.
121
- * The value is applied for all the screen sizes with the lowest priority.
122
- * @default false
123
- */
124
- xs?: boolean | GridSize;
125
146
  /**
126
147
  * If `true`, it sets `min-width: 0` on the item.
127
148
  * Refer to the limitations section of the documentation to better understand the use case.
128
149
  * @default false
129
150
  */
130
151
  zeroMinWidth?: boolean;
131
- };
152
+ } & Breakpoints;
132
153
  defaultComponent: D;
133
154
  }
134
155
 
package/Grid/Grid.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
2
2
  import _extends from "@babel/runtime/helpers/esm/extends";
3
- const _excluded = ["className", "columns", "columnSpacing", "component", "container", "direction", "item", "lg", "md", "rowSpacing", "sm", "spacing", "wrap", "xl", "xs", "zeroMinWidth"];
3
+ const _excluded = ["className", "columns", "columnSpacing", "component", "container", "direction", "item", "rowSpacing", "spacing", "wrap", "zeroMinWidth"];
4
4
  // A grid component using the following libs as inspiration.
5
5
  //
6
6
  // For the implementation:
@@ -19,6 +19,7 @@ import { unstable_composeClasses as composeClasses } from '@mui/base';
19
19
  import requirePropFactory from '../utils/requirePropFactory';
20
20
  import styled from '../styles/styled';
21
21
  import useThemeProps from '../styles/useThemeProps';
22
+ import useTheme from '../styles/useTheme';
22
23
  import GridContext from './GridContext';
23
24
  import gridClasses, { getGridUtilityClass } from './gridClasses';
24
25
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -201,26 +202,27 @@ export function generateColumnGap({
201
202
 
202
203
  return styles;
203
204
  }
204
- export function resolveSpacingClasses(spacing, container, styles = {}) {
205
- // in case of grid item or undefined/null or `spacing` <= 0
206
- if (!container || !spacing || spacing <= 0) {
205
+ export function resolveSpacingStyles(spacing, breakpoints, styles = {}) {
206
+ // undefined/null or `spacing` <= 0
207
+ if (!spacing || spacing <= 0) {
207
208
  return [];
208
209
  } // in case of string/number `spacing`
209
210
 
210
211
 
211
212
  if (typeof spacing === 'string' && !Number.isNaN(Number(spacing)) || typeof spacing === 'number') {
212
- return [styles[`spacing-xs-${String(spacing)}`] || `spacing-xs-${String(spacing)}`];
213
+ return [styles[`spacing-xs-${String(spacing)}`]];
213
214
  } // in case of object `spacing`
214
215
 
215
216
 
216
- const {
217
- xs,
218
- sm,
219
- md,
220
- lg,
221
- xl
222
- } = spacing;
223
- return [Number(xs) > 0 && (styles[`spacing-xs-${String(xs)}`] || `spacing-xs-${String(xs)}`), Number(sm) > 0 && (styles[`spacing-sm-${String(sm)}`] || `spacing-sm-${String(sm)}`), Number(md) > 0 && (styles[`spacing-md-${String(md)}`] || `spacing-md-${String(md)}`), Number(lg) > 0 && (styles[`spacing-lg-${String(lg)}`] || `spacing-lg-${String(lg)}`), Number(xl) > 0 && (styles[`spacing-xl-${String(xl)}`] || `spacing-xl-${String(xl)}`)];
217
+ const spacingStyles = [];
218
+ breakpoints.forEach(breakpoint => {
219
+ const value = spacing[breakpoint];
220
+
221
+ if (Number(value) > 0) {
222
+ spacingStyles.push(styles[`spacing-${breakpoint}-${String(value)}`]);
223
+ }
224
+ });
225
+ return spacingStyles;
224
226
  } // Default CSS values
225
227
  // flex: '0 1 auto',
226
228
  // flexDirection: 'row',
@@ -232,20 +234,33 @@ const GridRoot = styled('div', {
232
234
  name: 'MuiGrid',
233
235
  slot: 'Root',
234
236
  overridesResolver: (props, styles) => {
237
+ const {
238
+ ownerState
239
+ } = props;
235
240
  const {
236
241
  container,
237
242
  direction,
238
243
  item,
239
- lg,
240
- md,
241
- sm,
242
244
  spacing,
243
245
  wrap,
244
- xl,
245
- xs,
246
- zeroMinWidth
247
- } = props.ownerState;
248
- return [styles.root, container && styles.container, item && styles.item, zeroMinWidth && styles.zeroMinWidth, ...resolveSpacingClasses(spacing, container, styles), direction !== 'row' && styles[`direction-xs-${String(direction)}`], wrap !== 'wrap' && styles[`wrap-xs-${String(wrap)}`], xs !== false && styles[`grid-xs-${String(xs)}`], sm !== false && styles[`grid-sm-${String(sm)}`], md !== false && styles[`grid-md-${String(md)}`], lg !== false && styles[`grid-lg-${String(lg)}`], xl !== false && styles[`grid-xl-${String(xl)}`]];
246
+ zeroMinWidth,
247
+ breakpoints
248
+ } = ownerState;
249
+ let spacingStyles = []; // in case of grid item
250
+
251
+ if (container) {
252
+ spacingStyles = resolveSpacingStyles(spacing, breakpoints, styles);
253
+ }
254
+
255
+ const breakpointsStyles = [];
256
+ breakpoints.forEach(breakpoint => {
257
+ const value = ownerState[breakpoint];
258
+
259
+ if (value) {
260
+ breakpointsStyles.push(styles[`grid-${breakpoint}-${String(value)}`]);
261
+ }
262
+ });
263
+ return [styles.root, container && styles.container, item && styles.item, zeroMinWidth && styles.zeroMinWidth, ...spacingStyles, direction !== 'row' && styles[`direction-xs-${String(direction)}`], wrap !== 'wrap' && styles[`wrap-xs-${String(wrap)}`], ...breakpointsStyles];
249
264
  }
250
265
  })(({
251
266
  ownerState
@@ -263,6 +278,29 @@ const GridRoot = styled('div', {
263
278
  }, ownerState.wrap !== 'wrap' && {
264
279
  flexWrap: ownerState.wrap
265
280
  }), generateDirection, generateRowGap, generateColumnGap, generateGrid);
281
+ export function resolveSpacingClasses(spacing, breakpoints) {
282
+ // undefined/null or `spacing` <= 0
283
+ if (!spacing || spacing <= 0) {
284
+ return [];
285
+ } // in case of string/number `spacing`
286
+
287
+
288
+ if (typeof spacing === 'string' && !Number.isNaN(Number(spacing)) || typeof spacing === 'number') {
289
+ return [`spacing-xs-${String(spacing)}`];
290
+ } // in case of object `spacing`
291
+
292
+
293
+ const classes = [];
294
+ breakpoints.forEach(breakpoint => {
295
+ const value = spacing[breakpoint];
296
+
297
+ if (Number(value) > 0) {
298
+ const className = `spacing-${breakpoint}-${String(value)}`;
299
+ classes.push(className);
300
+ }
301
+ });
302
+ return classes;
303
+ }
266
304
 
267
305
  const useUtilityClasses = ownerState => {
268
306
  const {
@@ -270,17 +308,27 @@ const useUtilityClasses = ownerState => {
270
308
  container,
271
309
  direction,
272
310
  item,
273
- lg,
274
- md,
275
- sm,
276
311
  spacing,
277
312
  wrap,
278
- xl,
279
- xs,
280
- zeroMinWidth
313
+ zeroMinWidth,
314
+ breakpoints
281
315
  } = ownerState;
316
+ let spacingClasses = []; // in case of grid item
317
+
318
+ if (container) {
319
+ spacingClasses = resolveSpacingClasses(spacing, breakpoints);
320
+ }
321
+
322
+ const breakpointsClasses = [];
323
+ breakpoints.forEach(breakpoint => {
324
+ const value = ownerState[breakpoint];
325
+
326
+ if (value) {
327
+ breakpointsClasses.push(`grid-${breakpoint}-${String(value)}`);
328
+ }
329
+ });
282
330
  const slots = {
283
- root: ['root', container && 'container', item && 'item', zeroMinWidth && 'zeroMinWidth', ...resolveSpacingClasses(spacing, container), direction !== 'row' && `direction-xs-${String(direction)}`, wrap !== 'wrap' && `wrap-xs-${String(wrap)}`, xs !== false && `grid-xs-${String(xs)}`, sm !== false && `grid-sm-${String(sm)}`, md !== false && `grid-md-${String(md)}`, lg !== false && `grid-lg-${String(lg)}`, xl !== false && `grid-xl-${String(xl)}`]
331
+ root: ['root', container && 'container', item && 'item', zeroMinWidth && 'zeroMinWidth', ...spacingClasses, direction !== 'row' && `direction-xs-${String(direction)}`, wrap !== 'wrap' && `wrap-xs-${String(wrap)}`, ...breakpointsClasses]
284
332
  };
285
333
  return composeClasses(slots, getGridUtilityClass, classes);
286
334
  };
@@ -290,6 +338,9 @@ const Grid = /*#__PURE__*/React.forwardRef(function Grid(inProps, ref) {
290
338
  props: inProps,
291
339
  name: 'MuiGrid'
292
340
  });
341
+ const {
342
+ breakpoints
343
+ } = useTheme();
293
344
  const props = extendSxProp(themeProps);
294
345
 
295
346
  const {
@@ -300,14 +351,9 @@ const Grid = /*#__PURE__*/React.forwardRef(function Grid(inProps, ref) {
300
351
  container = false,
301
352
  direction = 'row',
302
353
  item = false,
303
- lg = false,
304
- md = false,
305
354
  rowSpacing: rowSpacingProp,
306
- sm = false,
307
355
  spacing = 0,
308
356
  wrap = 'wrap',
309
- xl = false,
310
- xs = false,
311
357
  zeroMinWidth = false
312
358
  } = props,
313
359
  other = _objectWithoutPropertiesLoose(props, _excluded);
@@ -317,21 +363,29 @@ const Grid = /*#__PURE__*/React.forwardRef(function Grid(inProps, ref) {
317
363
  const columnsContext = React.useContext(GridContext); // columns set with default breakpoint unit of 12
318
364
 
319
365
  const columns = container ? columnsProp || 12 : columnsContext;
366
+ const breakpointsValues = {};
367
+
368
+ const otherFiltered = _extends({}, other);
369
+
370
+ breakpoints.keys.forEach(breakpoint => {
371
+ if (other[breakpoint] != null) {
372
+ breakpointsValues[breakpoint] = other[breakpoint];
373
+ delete otherFiltered[breakpoint];
374
+ }
375
+ });
320
376
 
321
377
  const ownerState = _extends({}, props, {
322
378
  columns,
323
379
  container,
324
380
  direction,
325
381
  item,
326
- lg,
327
- md,
328
- sm,
329
382
  rowSpacing,
330
383
  columnSpacing,
331
384
  wrap,
332
- xl,
333
- xs,
334
- zeroMinWidth
385
+ zeroMinWidth,
386
+ spacing
387
+ }, breakpointsValues, {
388
+ breakpoints: breakpoints.keys
335
389
  });
336
390
 
337
391
  const classes = useUtilityClasses(ownerState);
@@ -342,7 +396,7 @@ const Grid = /*#__PURE__*/React.forwardRef(function Grid(inProps, ref) {
342
396
  className: clsx(classes.root, className),
343
397
  as: component,
344
398
  ref: ref
345
- }, other))
399
+ }, otherFiltered))
346
400
  });
347
401
  });
348
402
  process.env.NODE_ENV !== "production" ? Grid.propTypes
package/Grow/Grow.js CHANGED
@@ -27,10 +27,9 @@ const styles = {
27
27
  /*
28
28
  TODO v6: remove
29
29
  Conditionally apply a workaround for the CSS transition bug in Safari 15.4 / WebKit browsers.
30
- Remove this workaround once the WebKit bug fix is released.
31
30
  */
32
31
 
33
- const isWebKit154 = typeof navigator !== 'undefined' && /^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent) && /(os |version\/)15(.|_)[4-9]/i.test(navigator.userAgent);
32
+ const isWebKit154 = typeof navigator !== 'undefined' && /^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent) && /(os |version\/)15(.|_)4/i.test(navigator.userAgent);
34
33
  /**
35
34
  * The Grow transition is used by the [Tooltip](/material-ui/react-tooltip/) and
36
35
  * [Popover](/material-ui/react-popover/) components.
@@ -5,7 +5,6 @@ import * as React from 'react';
5
5
  import PropTypes from 'prop-types';
6
6
  import { getDisplayName } from '@mui/utils';
7
7
  import { getThemeProps } from '@mui/system';
8
- import hoistNonReactStatics from 'hoist-non-react-statics';
9
8
  import useTheme from '../styles/useTheme';
10
9
  import useEnhancedEffect from '../utils/useEnhancedEffect';
11
10
  import useMediaQuery from '../useMediaQuery';
@@ -113,7 +112,6 @@ const withWidth = (options = {}) => Component => {
113
112
  WithWidth.displayName = `WithWidth(${getDisplayName(Component)})`;
114
113
  }
115
114
 
116
- hoistNonReactStatics(WithWidth, Component);
117
115
  return WithWidth;
118
116
  };
119
117