@mui/material 5.14.7 → 5.14.9

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 (143) hide show
  1. package/Accordion/Accordion.d.ts +2 -2
  2. package/AccordionSummary/AccordionSummary.d.ts +22 -20
  3. package/AlertTitle/AlertTitle.d.ts +1 -0
  4. package/AppBar/AppBar.d.ts +33 -31
  5. package/Avatar/Avatar.d.ts +49 -50
  6. package/Backdrop/Backdrop.d.ts +87 -85
  7. package/Badge/Badge.d.ts +2 -2
  8. package/BottomNavigation/BottomNavigation.d.ts +35 -33
  9. package/BottomNavigationAction/BottomNavigationAction.d.ts +39 -37
  10. package/Breadcrumbs/Breadcrumbs.d.ts +70 -67
  11. package/Button/Button.d.ts +72 -73
  12. package/Button/Button.js +4 -1
  13. package/ButtonBase/ButtonBase.d.ts +83 -81
  14. package/ButtonGroup/ButtonGroup.d.ts +72 -70
  15. package/ButtonGroup/ButtonGroup.js +86 -54
  16. package/ButtonGroup/ButtonGroupButtonContext.d.ts +6 -0
  17. package/ButtonGroup/ButtonGroupButtonContext.js +9 -0
  18. package/ButtonGroup/buttonGroupClasses.d.ts +6 -0
  19. package/ButtonGroup/buttonGroupClasses.js +1 -1
  20. package/CHANGELOG.md +235 -38
  21. package/Card/Card.d.ts +19 -18
  22. package/CardActionArea/CardActionArea.d.ts +15 -13
  23. package/CardContent/CardContent.d.ts +18 -16
  24. package/CardHeader/CardHeader.d.ts +77 -67
  25. package/CardMedia/CardMedia.d.ts +30 -28
  26. package/Chip/Chip.d.ts +84 -82
  27. package/CircularProgress/CircularProgress.d.ts +1 -1
  28. package/CircularProgress/CircularProgress.js +1 -1
  29. package/Container/Container.d.ts +35 -33
  30. package/DialogContentText/DialogContentText.d.ts +14 -12
  31. package/DialogTitle/DialogTitle.d.ts +19 -16
  32. package/Divider/Divider.d.ts +49 -50
  33. package/Fab/Fab.d.ts +59 -56
  34. package/FormControl/FormControl.d.ts +74 -72
  35. package/FormHelperText/FormHelperText.d.ts +52 -50
  36. package/FormLabel/FormLabel.d.ts +7 -4
  37. package/Grid/Grid.d.ts +69 -68
  38. package/Hidden/Hidden.d.ts +10 -10
  39. package/Icon/Icon.d.ts +50 -48
  40. package/IconButton/IconButton.d.ts +52 -50
  41. package/ImageList/ImageList.d.ts +41 -39
  42. package/ImageListItem/ImageListItem.d.ts +28 -26
  43. package/ImageListItem/ImageListItem.js +2 -1
  44. package/InputAdornment/InputAdornment.d.ts +39 -37
  45. package/InputBase/InputBase.js +1 -1
  46. package/InputLabel/InputLabel.d.ts +58 -56
  47. package/InputLabel/InputLabel.js +2 -1
  48. package/Link/Link.d.ts +37 -39
  49. package/List/List.d.ts +34 -35
  50. package/ListItem/ListItem.d.ts +53 -49
  51. package/ListItemButton/ListItemButton.d.ts +9 -3
  52. package/ListSubheader/ListSubheader.d.ts +38 -36
  53. package/MenuItem/MenuItem.d.ts +47 -44
  54. package/MenuList/MenuList.d.ts +37 -35
  55. package/Modal/Modal.d.ts +172 -178
  56. package/Modal/Modal.js +1 -1
  57. package/PaginationItem/PaginationItem.d.ts +85 -83
  58. package/Paper/Paper.d.ts +2 -2
  59. package/README.md +9 -198
  60. package/Radio/Radio.js +3 -2
  61. package/Radio/radioClasses.d.ts +2 -0
  62. package/Radio/radioClasses.js +1 -1
  63. package/ScopedCssBaseline/ScopedCssBaseline.d.ts +25 -23
  64. package/Select/SelectInput.js +9 -5
  65. package/Skeleton/Skeleton.d.ts +42 -40
  66. package/Slider/Slider.d.ts +249 -247
  67. package/Slider/Slider.js +9 -86
  68. package/Stack/Stack.d.ts +39 -38
  69. package/Step/Step.d.ts +46 -44
  70. package/StepButton/StepButton.d.ts +27 -25
  71. package/Stepper/Stepper.d.ts +45 -44
  72. package/SvgIcon/SvgIcon.d.ts +77 -75
  73. package/SwipeableDrawer/SwipeableDrawer.js +4 -4
  74. package/Tab/Tab.d.ts +52 -50
  75. package/TabScrollButton/TabScrollButton.d.ts +3 -2
  76. package/Table/Table.d.ts +35 -33
  77. package/TableBody/TableBody.d.ts +18 -16
  78. package/TableContainer/TableContainer.d.ts +18 -16
  79. package/TableFooter/TableFooter.d.ts +18 -16
  80. package/TableHead/TableHead.d.ts +18 -16
  81. package/TablePagination/TablePagination.d.ts +113 -112
  82. package/TableRow/TableRow.d.ts +28 -26
  83. package/TableSortLabel/TableSortLabel.d.ts +40 -36
  84. package/Tabs/Tabs.d.ts +153 -150
  85. package/Tabs/Tabs.js +1 -4
  86. package/ToggleButton/ToggleButton.d.ts +72 -70
  87. package/Toolbar/Toolbar.d.ts +29 -27
  88. package/Typography/Typography.d.ts +2 -2
  89. package/index.js +1 -1
  90. package/legacy/Button/Button.js +4 -1
  91. package/legacy/ButtonGroup/ButtonGroup.js +81 -56
  92. package/legacy/ButtonGroup/ButtonGroupButtonContext.js +9 -0
  93. package/legacy/ButtonGroup/buttonGroupClasses.js +1 -1
  94. package/legacy/CircularProgress/CircularProgress.js +1 -1
  95. package/legacy/ImageListItem/ImageListItem.js +2 -1
  96. package/legacy/InputBase/InputBase.js +1 -1
  97. package/legacy/InputLabel/InputLabel.js +2 -1
  98. package/legacy/Modal/Modal.js +3 -1
  99. package/legacy/Radio/Radio.js +3 -2
  100. package/legacy/Radio/radioClasses.js +1 -1
  101. package/legacy/Select/SelectInput.js +9 -5
  102. package/legacy/Slider/Slider.js +9 -86
  103. package/legacy/SwipeableDrawer/SwipeableDrawer.js +4 -4
  104. package/legacy/Tabs/Tabs.js +1 -4
  105. package/legacy/index.js +1 -1
  106. package/legacy/useTouchRipple/useTouchRipple.js +4 -4
  107. package/modern/Button/Button.js +4 -1
  108. package/modern/ButtonGroup/ButtonGroup.js +86 -54
  109. package/modern/ButtonGroup/ButtonGroupButtonContext.js +9 -0
  110. package/modern/ButtonGroup/buttonGroupClasses.js +1 -1
  111. package/modern/CircularProgress/CircularProgress.js +1 -1
  112. package/modern/ImageListItem/ImageListItem.js +2 -1
  113. package/modern/InputBase/InputBase.js +1 -1
  114. package/modern/InputLabel/InputLabel.js +2 -1
  115. package/modern/Modal/Modal.js +1 -1
  116. package/modern/Radio/Radio.js +3 -2
  117. package/modern/Radio/radioClasses.js +1 -1
  118. package/modern/Select/SelectInput.js +8 -5
  119. package/modern/Slider/Slider.js +9 -86
  120. package/modern/SwipeableDrawer/SwipeableDrawer.js +4 -4
  121. package/modern/Tabs/Tabs.js +1 -4
  122. package/modern/index.js +1 -1
  123. package/node/Button/Button.js +4 -1
  124. package/node/ButtonGroup/ButtonGroup.js +86 -54
  125. package/node/ButtonGroup/ButtonGroupButtonContext.js +18 -0
  126. package/node/ButtonGroup/buttonGroupClasses.js +1 -1
  127. package/node/CircularProgress/CircularProgress.js +1 -1
  128. package/node/ImageListItem/ImageListItem.js +2 -1
  129. package/node/InputBase/InputBase.js +1 -1
  130. package/node/InputLabel/InputLabel.js +2 -1
  131. package/node/Modal/Modal.js +1 -1
  132. package/node/Radio/Radio.js +3 -2
  133. package/node/Radio/radioClasses.js +1 -1
  134. package/node/Select/SelectInput.js +9 -5
  135. package/node/Slider/Slider.js +3 -73
  136. package/node/SwipeableDrawer/SwipeableDrawer.js +4 -4
  137. package/node/Tabs/Tabs.js +1 -4
  138. package/node/index.js +1 -1
  139. package/node/useTouchRipple/useTouchRipple.js +4 -4
  140. package/package.json +16 -16
  141. package/umd/material-ui.development.js +258 -254
  142. package/umd/material-ui.production.min.js +18 -18
  143. package/useTouchRipple/useTouchRipple.js +4 -4
@@ -25,22 +25,22 @@ export interface HiddenProps {
25
25
  */
26
26
  initialWidth?: Breakpoint;
27
27
  /**
28
- * If `true`, screens this size and down are hidden.
28
+ * If `true`, component is hidden on screens below (but not including) this size.
29
29
  * @default false
30
30
  */
31
31
  lgDown?: boolean;
32
32
  /**
33
- * If `true`, screens this size and up are hidden.
33
+ * If `true`, component is hidden on screens this size and above.
34
34
  * @default false
35
35
  */
36
36
  lgUp?: boolean;
37
37
  /**
38
- * If `true`, screens this size and down are hidden.
38
+ * If `true`, component is hidden on screens below (but not including) this size.
39
39
  * @default false
40
40
  */
41
41
  mdDown?: boolean;
42
42
  /**
43
- * If `true`, screens this size and up are hidden.
43
+ * If `true`, component is hidden on screens this size and above.
44
44
  * @default false
45
45
  */
46
46
  mdUp?: boolean;
@@ -49,32 +49,32 @@ export interface HiddenProps {
49
49
  */
50
50
  only?: Breakpoint | Breakpoint[];
51
51
  /**
52
- * If `true`, screens this size and down are hidden.
52
+ * If `true`, component is hidden on screens below (but not including) this size.
53
53
  * @default false
54
54
  */
55
55
  smDown?: boolean;
56
56
  /**
57
- * If `true`, screens this size and up are hidden.
57
+ * If `true`, component is hidden on screens this size and above.
58
58
  * @default false
59
59
  */
60
60
  smUp?: boolean;
61
61
  /**
62
- * If `true`, screens this size and down are hidden.
62
+ * If `true`, component is hidden on screens below (but not including) this size.
63
63
  * @default false
64
64
  */
65
65
  xlDown?: boolean;
66
66
  /**
67
- * If `true`, screens this size and up are hidden.
67
+ * If `true`, component is hidden on screens this size and above.
68
68
  * @default false
69
69
  */
70
70
  xlUp?: boolean;
71
71
  /**
72
- * If `true`, screens this size and down are hidden.
72
+ * If `true`, component is hidden on screens below (but not including) this size.
73
73
  * @default false
74
74
  */
75
75
  xsDown?: boolean;
76
76
  /**
77
- * If `true`, screens this size and up are hidden.
77
+ * If `true`, component is hidden on screens this size and above.
78
78
  * @default false
79
79
  */
80
80
  xsUp?: boolean;
package/Icon/Icon.d.ts CHANGED
@@ -9,57 +9,59 @@ export interface IconPropsSizeOverrides {}
9
9
 
10
10
  export interface IconPropsColorOverrides {}
11
11
 
12
+ export interface IconOwnProps {
13
+ /**
14
+ * The base class applied to the icon. Defaults to 'material-icons', but can be changed to any
15
+ * other base class that suits the icon font you're using (e.g. material-icons-rounded, fas, etc).
16
+ * @default 'material-icons'
17
+ */
18
+ baseClassName?: string;
19
+ /**
20
+ * The name of the icon font ligature.
21
+ */
22
+ children?: React.ReactNode;
23
+ /**
24
+ * Override or extend the styles applied to the component.
25
+ */
26
+ classes?: Partial<IconClasses>;
27
+ /**
28
+ * The color of the component.
29
+ * It supports both default and custom theme colors, which can be added as shown in the
30
+ * [palette customization guide](https://mui.com/material-ui/customization/palette/#adding-new-colors).
31
+ * @default 'inherit'
32
+ */
33
+ color?: OverridableStringUnion<
34
+ | 'inherit'
35
+ | 'action'
36
+ | 'disabled'
37
+ | 'primary'
38
+ | 'secondary'
39
+ | 'error'
40
+ | 'info'
41
+ | 'success'
42
+ | 'warning',
43
+ IconPropsColorOverrides
44
+ >;
45
+ /**
46
+ * The fontSize applied to the icon. Defaults to 24px, but can be configure to inherit font size.
47
+ * @default 'medium'
48
+ */
49
+ fontSize?: OverridableStringUnion<
50
+ 'inherit' | 'large' | 'medium' | 'small',
51
+ IconPropsSizeOverrides
52
+ >;
53
+ /**
54
+ * The system prop that allows defining system overrides as well as additional CSS styles.
55
+ */
56
+ sx?: SxProps<Theme>;
57
+ }
58
+
12
59
  export interface IconTypeMap<
13
60
  AdditionalProps = {},
14
- DefaultComponent extends React.ElementType = 'span',
61
+ RootComponent extends React.ElementType = 'span',
15
62
  > {
16
- props: AdditionalProps & {
17
- /**
18
- * The base class applied to the icon. Defaults to 'material-icons', but can be changed to any
19
- * other base class that suits the icon font you're using (e.g. material-icons-rounded, fas, etc).
20
- * @default 'material-icons'
21
- */
22
- baseClassName?: string;
23
- /**
24
- * The name of the icon font ligature.
25
- */
26
- children?: React.ReactNode;
27
- /**
28
- * Override or extend the styles applied to the component.
29
- */
30
- classes?: Partial<IconClasses>;
31
- /**
32
- * The color of the component.
33
- * It supports both default and custom theme colors, which can be added as shown in the
34
- * [palette customization guide](https://mui.com/material-ui/customization/palette/#adding-new-colors).
35
- * @default 'inherit'
36
- */
37
- color?: OverridableStringUnion<
38
- | 'inherit'
39
- | 'action'
40
- | 'disabled'
41
- | 'primary'
42
- | 'secondary'
43
- | 'error'
44
- | 'info'
45
- | 'success'
46
- | 'warning',
47
- IconPropsColorOverrides
48
- >;
49
- /**
50
- * The fontSize applied to the icon. Defaults to 24px, but can be configure to inherit font size.
51
- * @default 'medium'
52
- */
53
- fontSize?: OverridableStringUnion<
54
- 'inherit' | 'large' | 'medium' | 'small',
55
- IconPropsSizeOverrides
56
- >;
57
- /**
58
- * The system prop that allows defining system overrides as well as additional CSS styles.
59
- */
60
- sx?: SxProps<Theme>;
61
- };
62
- defaultComponent: DefaultComponent;
63
+ props: AdditionalProps & IconOwnProps;
64
+ defaultComponent: RootComponent;
63
65
  }
64
66
  /**
65
67
  *
@@ -10,59 +10,61 @@ export interface IconButtonPropsColorOverrides {}
10
10
 
11
11
  export interface IconButtonPropsSizeOverrides {}
12
12
 
13
+ export interface IconButtonOwnProps {
14
+ /**
15
+ * The icon to display.
16
+ */
17
+ children?: React.ReactNode;
18
+ /**
19
+ * Override or extend the styles applied to the component.
20
+ */
21
+ classes?: Partial<IconButtonClasses>;
22
+ /**
23
+ * The color of the component.
24
+ * It supports both default and custom theme colors, which can be added as shown in the
25
+ * [palette customization guide](https://mui.com/material-ui/customization/palette/#adding-new-colors).
26
+ * @default 'default'
27
+ */
28
+ color?: OverridableStringUnion<
29
+ 'inherit' | 'default' | 'primary' | 'secondary' | 'error' | 'info' | 'success' | 'warning',
30
+ IconButtonPropsColorOverrides
31
+ >;
32
+ /**
33
+ * If `true`, the component is disabled.
34
+ * @default false
35
+ */
36
+ disabled?: boolean;
37
+ /**
38
+ * If `true`, the keyboard focus ripple is disabled.
39
+ * @default false
40
+ */
41
+ disableFocusRipple?: boolean;
42
+ /**
43
+ * If given, uses a negative margin to counteract the padding on one
44
+ * side (this is often helpful for aligning the left or right
45
+ * side of the icon with content above or below, without ruining the border
46
+ * size and shape).
47
+ * @default false
48
+ */
49
+ edge?: 'start' | 'end' | false;
50
+ /**
51
+ * The size of the component.
52
+ * `small` is equivalent to the dense button styling.
53
+ * @default 'medium'
54
+ */
55
+ size?: OverridableStringUnion<'small' | 'medium' | 'large', IconButtonPropsSizeOverrides>;
56
+ /**
57
+ * The system prop that allows defining system overrides as well as additional CSS styles.
58
+ */
59
+ sx?: SxProps<Theme>;
60
+ }
61
+
13
62
  export type IconButtonTypeMap<
14
63
  AdditionalProps = {},
15
- DefaultComponent extends React.ElementType = 'button',
64
+ RootComponent extends React.ElementType = 'button',
16
65
  > = ExtendButtonBaseTypeMap<{
17
- props: AdditionalProps & {
18
- /**
19
- * The icon to display.
20
- */
21
- children?: React.ReactNode;
22
- /**
23
- * Override or extend the styles applied to the component.
24
- */
25
- classes?: Partial<IconButtonClasses>;
26
- /**
27
- * The color of the component.
28
- * It supports both default and custom theme colors, which can be added as shown in the
29
- * [palette customization guide](https://mui.com/material-ui/customization/palette/#adding-new-colors).
30
- * @default 'default'
31
- */
32
- color?: OverridableStringUnion<
33
- 'inherit' | 'default' | 'primary' | 'secondary' | 'error' | 'info' | 'success' | 'warning',
34
- IconButtonPropsColorOverrides
35
- >;
36
- /**
37
- * If `true`, the component is disabled.
38
- * @default false
39
- */
40
- disabled?: boolean;
41
- /**
42
- * If `true`, the keyboard focus ripple is disabled.
43
- * @default false
44
- */
45
- disableFocusRipple?: boolean;
46
- /**
47
- * If given, uses a negative margin to counteract the padding on one
48
- * side (this is often helpful for aligning the left or right
49
- * side of the icon with content above or below, without ruining the border
50
- * size and shape).
51
- * @default false
52
- */
53
- edge?: 'start' | 'end' | false;
54
- /**
55
- * The size of the component.
56
- * `small` is equivalent to the dense button styling.
57
- * @default 'medium'
58
- */
59
- size?: OverridableStringUnion<'small' | 'medium' | 'large', IconButtonPropsSizeOverrides>;
60
- /**
61
- * The system prop that allows defining system overrides as well as additional CSS styles.
62
- */
63
- sx?: SxProps<Theme>;
64
- };
65
- defaultComponent: DefaultComponent;
66
+ props: AdditionalProps & IconButtonOwnProps;
67
+ defaultComponent: RootComponent;
66
68
  }>;
67
69
 
68
70
  /**
@@ -7,48 +7,50 @@ import { ImageListClasses } from './imageListClasses';
7
7
 
8
8
  export interface ImageListPropsVariantOverrides {}
9
9
 
10
+ export interface ImageListOwnProps {
11
+ /**
12
+ * The content of the component, normally `ImageListItem`s.
13
+ */
14
+ children: NonNullable<React.ReactNode>;
15
+ /**
16
+ * Override or extend the styles applied to the component.
17
+ */
18
+ classes?: Partial<ImageListClasses>;
19
+ /**
20
+ * Number of columns.
21
+ * @default 2
22
+ */
23
+ cols?: number;
24
+ /**
25
+ * The gap between items in px.
26
+ * @default 4
27
+ */
28
+ gap?: number;
29
+ /**
30
+ * The height of one row in px.
31
+ * @default 'auto'
32
+ */
33
+ rowHeight?: number | 'auto';
34
+ /**
35
+ * The system prop that allows defining system overrides as well as additional CSS styles.
36
+ */
37
+ sx?: SxProps<Theme>;
38
+ /**
39
+ * The variant to use.
40
+ * @default 'standard'
41
+ */
42
+ variant?: OverridableStringUnion<
43
+ 'masonry' | 'quilted' | 'standard' | 'woven',
44
+ ImageListPropsVariantOverrides
45
+ >;
46
+ }
47
+
10
48
  export interface ImageListTypeMap<
11
49
  AdditionalProps = {},
12
- DefaultComponent extends React.ElementType = 'ul',
50
+ RootComponent extends React.ElementType = 'ul',
13
51
  > {
14
- props: AdditionalProps & {
15
- /**
16
- * The content of the component, normally `ImageListItem`s.
17
- */
18
- children: NonNullable<React.ReactNode>;
19
- /**
20
- * Override or extend the styles applied to the component.
21
- */
22
- classes?: Partial<ImageListClasses>;
23
- /**
24
- * Number of columns.
25
- * @default 2
26
- */
27
- cols?: number;
28
- /**
29
- * The gap between items in px.
30
- * @default 4
31
- */
32
- gap?: number;
33
- /**
34
- * The height of one row in px.
35
- * @default 'auto'
36
- */
37
- rowHeight?: number | 'auto';
38
- /**
39
- * The system prop that allows defining system overrides as well as additional CSS styles.
40
- */
41
- sx?: SxProps<Theme>;
42
- /**
43
- * The variant to use.
44
- * @default 'standard'
45
- */
46
- variant?: OverridableStringUnion<
47
- 'masonry' | 'quilted' | 'standard' | 'woven',
48
- ImageListPropsVariantOverrides
49
- >;
50
- };
51
- defaultComponent: DefaultComponent;
52
+ props: AdditionalProps & ImageListOwnProps;
53
+ defaultComponent: RootComponent;
52
54
  }
53
55
  /**
54
56
  *
@@ -4,35 +4,37 @@ import { Theme } from '..';
4
4
  import { OverridableComponent, OverrideProps } from '../OverridableComponent';
5
5
  import { ImageListItemClasses } from './imageListItemClasses';
6
6
 
7
+ export interface ImageListItemOwnProps {
8
+ /**
9
+ * The content of the component, normally an `<img>`.
10
+ */
11
+ children?: React.ReactNode;
12
+ /**
13
+ * Override or extend the styles applied to the component.
14
+ */
15
+ classes?: Partial<ImageListItemClasses>;
16
+ /**
17
+ * Width of the item in number of grid columns.
18
+ * @default 1
19
+ */
20
+ cols?: number;
21
+ /**
22
+ * Height of the item in number of grid rows.
23
+ * @default 1
24
+ */
25
+ rows?: number;
26
+ /**
27
+ * The system prop that allows defining system overrides as well as additional CSS styles.
28
+ */
29
+ sx?: SxProps<Theme>;
30
+ }
31
+
7
32
  export interface ImageListItemTypeMap<
8
33
  AdditionalProps = {},
9
- DefaultComponent extends React.ElementType = 'li',
34
+ RootComponent extends React.ElementType = 'li',
10
35
  > {
11
- props: AdditionalProps & {
12
- /**
13
- * The content of the component, normally an `<img>`.
14
- */
15
- children?: React.ReactNode;
16
- /**
17
- * Override or extend the styles applied to the component.
18
- */
19
- classes?: Partial<ImageListItemClasses>;
20
- /**
21
- * Width of the item in number of grid columns.
22
- * @default 1
23
- */
24
- cols?: number;
25
- /**
26
- * Height of the item in number of grid rows.
27
- * @default 1
28
- */
29
- rows?: number;
30
- /**
31
- * The system prop that allows defining system overrides as well as additional CSS styles.
32
- */
33
- sx?: SxProps<Theme>;
34
- };
35
- defaultComponent: DefaultComponent;
36
+ props: AdditionalProps & ImageListItemOwnProps;
37
+ defaultComponent: RootComponent;
36
38
  }
37
39
  /**
38
40
  *
@@ -107,7 +107,8 @@ const ImageListItem = /*#__PURE__*/React.forwardRef(function ImageListItem(inPro
107
107
  height,
108
108
  gridColumnEnd: variant !== 'masonry' ? `span ${cols}` : undefined,
109
109
  gridRowEnd: variant !== 'masonry' ? `span ${rows}` : undefined,
110
- marginBottom: variant === 'masonry' ? gap : undefined
110
+ marginBottom: variant === 'masonry' ? gap : undefined,
111
+ breakInside: variant === 'masonry' ? 'avoid' : undefined
111
112
  }, style),
112
113
  ownerState: ownerState
113
114
  }, other, {
@@ -4,46 +4,48 @@ import { OverridableComponent, OverrideProps } from '../OverridableComponent';
4
4
  import { Theme } from '..';
5
5
  import { InputAdornmentClasses } from './inputAdornmentClasses';
6
6
 
7
+ export interface InputAdornmentOwnProps {
8
+ /**
9
+ * Override or extend the styles applied to the component.
10
+ */
11
+ classes?: Partial<InputAdornmentClasses>;
12
+ /**
13
+ * The content of the component, normally an `IconButton` or string.
14
+ */
15
+ children?: React.ReactNode;
16
+ /**
17
+ * Disable pointer events on the root.
18
+ * This allows for the content of the adornment to focus the `input` on click.
19
+ * @default false
20
+ */
21
+ disablePointerEvents?: boolean;
22
+ /**
23
+ * If children is a string then disable wrapping in a Typography component.
24
+ * @default false
25
+ */
26
+ disableTypography?: boolean;
27
+ /**
28
+ * The position this adornment should appear relative to the `Input`.
29
+ */
30
+ position: 'start' | 'end';
31
+ /**
32
+ * The system prop that allows defining system overrides as well as additional CSS styles.
33
+ */
34
+ sx?: SxProps<Theme>;
35
+ /**
36
+ * The variant to use.
37
+ * Note: If you are using the `TextField` component or the `FormControl` component
38
+ * you do not have to set this manually.
39
+ */
40
+ variant?: 'standard' | 'outlined' | 'filled';
41
+ }
42
+
7
43
  export interface InputAdornmentTypeMap<
8
44
  AdditionalProps = {},
9
- DefaultComponent extends React.ElementType = 'div',
45
+ RootComponent extends React.ElementType = 'div',
10
46
  > {
11
- props: AdditionalProps & {
12
- /**
13
- * Override or extend the styles applied to the component.
14
- */
15
- classes?: Partial<InputAdornmentClasses>;
16
- /**
17
- * The content of the component, normally an `IconButton` or string.
18
- */
19
- children?: React.ReactNode;
20
- /**
21
- * Disable pointer events on the root.
22
- * This allows for the content of the adornment to focus the `input` on click.
23
- * @default false
24
- */
25
- disablePointerEvents?: boolean;
26
- /**
27
- * If children is a string then disable wrapping in a Typography component.
28
- * @default false
29
- */
30
- disableTypography?: boolean;
31
- /**
32
- * The position this adornment should appear relative to the `Input`.
33
- */
34
- position: 'start' | 'end';
35
- /**
36
- * The system prop that allows defining system overrides as well as additional CSS styles.
37
- */
38
- sx?: SxProps<Theme>;
39
- /**
40
- * The variant to use.
41
- * Note: If you are using the `TextField` component or the `FormControl` component
42
- * you do not have to set this manually.
43
- */
44
- variant?: 'standard' | 'outlined' | 'filled';
45
- };
46
- defaultComponent: DefaultComponent;
47
+ props: AdditionalProps & InputAdornmentOwnProps;
48
+ defaultComponent: RootComponent;
47
49
  }
48
50
  /**
49
51
  *
@@ -52,7 +52,7 @@ const useUtilityClasses = ownerState => {
52
52
  type
53
53
  } = ownerState;
54
54
  const slots = {
55
- root: ['root', `color${capitalize(color)}`, disabled && 'disabled', error && 'error', fullWidth && 'fullWidth', focused && 'focused', formControl && 'formControl', size === 'small' && 'sizeSmall', multiline && 'multiline', startAdornment && 'adornedStart', endAdornment && 'adornedEnd', hiddenLabel && 'hiddenLabel', readOnly && 'readOnly'],
55
+ root: ['root', `color${capitalize(color)}`, disabled && 'disabled', error && 'error', fullWidth && 'fullWidth', focused && 'focused', formControl && 'formControl', size && size !== 'medium' && `size${capitalize(size)}`, multiline && 'multiline', startAdornment && 'adornedStart', endAdornment && 'adornedEnd', hiddenLabel && 'hiddenLabel', readOnly && 'readOnly'],
56
56
  input: ['input', disabled && 'disabled', type === 'search' && 'inputTypeSearch', multiline && 'inputMultiline', size === 'small' && 'inputSizeSmall', hiddenLabel && 'inputHiddenLabel', startAdornment && 'inputAdornedStart', endAdornment && 'inputAdornedEnd', readOnly && 'readOnly']
57
57
  };
58
58
  return composeClasses(slots, getInputBaseUtilityClass, classes);
@@ -8,65 +8,67 @@ import { OverridableComponent, OverrideProps } from '../OverridableComponent';
8
8
 
9
9
  export interface InputLabelPropsSizeOverrides {}
10
10
 
11
+ export interface InputLabelOwnProps {
12
+ /**
13
+ * The content of the component.
14
+ */
15
+ children?: React.ReactNode;
16
+ /**
17
+ * Override or extend the styles applied to the component.
18
+ */
19
+ classes?: Partial<InputLabelClasses>;
20
+ color?: FormLabelProps['color'];
21
+ /**
22
+ * If `true`, the transition animation is disabled.
23
+ * @default false
24
+ */
25
+ disableAnimation?: boolean;
26
+ /**
27
+ * If `true`, the component is disabled.
28
+ */
29
+ disabled?: boolean;
30
+ /**
31
+ * If `true`, the label is displayed in an error state.
32
+ */
33
+ error?: boolean;
34
+ /**
35
+ * If `true`, the `input` of this label is focused.
36
+ */
37
+ focused?: boolean;
38
+ /**
39
+ * If `dense`, will adjust vertical spacing. This is normally obtained via context from
40
+ * FormControl.
41
+ */
42
+ margin?: 'dense';
43
+ /**
44
+ * if `true`, the label will indicate that the `input` is required.
45
+ */
46
+ required?: boolean;
47
+ /**
48
+ * If `true`, the label is shrunk.
49
+ */
50
+ shrink?: boolean;
51
+ /**
52
+ * The size of the component.
53
+ * @default 'normal'
54
+ */
55
+ size?: OverridableStringUnion<'small' | 'normal', InputLabelPropsSizeOverrides>;
56
+ /**
57
+ * The system prop that allows defining system overrides as well as additional CSS styles.
58
+ */
59
+ sx?: SxProps<Theme>;
60
+ /**
61
+ * The variant to use.
62
+ */
63
+ variant?: 'standard' | 'outlined' | 'filled';
64
+ }
65
+
11
66
  export type InputLabelTypeMap<
12
67
  AdditionalProps = {},
13
- DefaultComponent extends React.ElementType = 'label',
68
+ RootComponent extends React.ElementType = 'label',
14
69
  > = ExtendFormLabelTypeMap<{
15
- props: AdditionalProps & {
16
- /**
17
- * The content of the component.
18
- */
19
- children?: React.ReactNode;
20
- /**
21
- * Override or extend the styles applied to the component.
22
- */
23
- classes?: Partial<InputLabelClasses>;
24
- color?: FormLabelProps['color'];
25
- /**
26
- * If `true`, the transition animation is disabled.
27
- * @default false
28
- */
29
- disableAnimation?: boolean;
30
- /**
31
- * If `true`, the component is disabled.
32
- */
33
- disabled?: boolean;
34
- /**
35
- * If `true`, the label is displayed in an error state.
36
- */
37
- error?: boolean;
38
- /**
39
- * If `true`, the `input` of this label is focused.
40
- */
41
- focused?: boolean;
42
- /**
43
- * If `dense`, will adjust vertical spacing. This is normally obtained via context from
44
- * FormControl.
45
- */
46
- margin?: 'dense';
47
- /**
48
- * if `true`, the label will indicate that the `input` is required.
49
- */
50
- required?: boolean;
51
- /**
52
- * If `true`, the label is shrunk.
53
- */
54
- shrink?: boolean;
55
- /**
56
- * The size of the component.
57
- * @default 'normal'
58
- */
59
- size?: OverridableStringUnion<'small' | 'normal', InputLabelPropsSizeOverrides>;
60
- /**
61
- * The system prop that allows defining system overrides as well as additional CSS styles.
62
- */
63
- sx?: SxProps<Theme>;
64
- /**
65
- * The variant to use.
66
- */
67
- variant?: 'standard' | 'outlined' | 'filled';
68
- };
69
- defaultComponent: DefaultComponent;
70
+ props: AdditionalProps & InputLabelOwnProps;
71
+ defaultComponent: RootComponent;
70
72
  }>;
71
73
 
72
74
  /**
@@ -11,6 +11,7 @@ import formControlState from '../FormControl/formControlState';
11
11
  import useFormControl from '../FormControl/useFormControl';
12
12
  import FormLabel, { formLabelClasses } from '../FormLabel';
13
13
  import useThemeProps from '../styles/useThemeProps';
14
+ import capitalize from '../utils/capitalize';
14
15
  import styled, { rootShouldForwardProp } from '../styles/styled';
15
16
  import { getInputLabelUtilityClasses } from './inputLabelClasses';
16
17
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -25,7 +26,7 @@ const useUtilityClasses = ownerState => {
25
26
  required
26
27
  } = ownerState;
27
28
  const slots = {
28
- root: ['root', formControl && 'formControl', !disableAnimation && 'animated', shrink && 'shrink', size === 'small' && 'sizeSmall', variant],
29
+ root: ['root', formControl && 'formControl', !disableAnimation && 'animated', shrink && 'shrink', size && size !== 'normal' && `size${capitalize(size)}`, variant],
29
30
  asterisk: [required && 'asterisk']
30
31
  };
31
32
  const composedClasses = composeClasses(slots, getInputLabelUtilityClasses, classes);