@mui/material 5.5.3 → 5.6.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 (190) hide show
  1. package/Accordion/accordionClasses.d.ts +18 -18
  2. package/AccordionActions/accordionActionsClasses.d.ts +10 -10
  3. package/AccordionDetails/accordionDetailsClasses.d.ts +8 -8
  4. package/AccordionSummary/accordionSummaryClasses.d.ts +22 -22
  5. package/Alert/alertClasses.d.ts +44 -44
  6. package/AlertTitle/alertTitleClasses.d.ts +8 -8
  7. package/AppBar/appBarClasses.d.ts +28 -28
  8. package/Autocomplete/autocompleteClasses.d.ts +54 -54
  9. package/Avatar/avatarClasses.d.ts +20 -20
  10. package/AvatarGroup/avatarGroupClasses.d.ts +10 -10
  11. package/Backdrop/backdropClasses.d.ts +10 -10
  12. package/Badge/Badge.d.ts +20 -7
  13. package/Badge/Badge.js +43 -21
  14. package/Badge/badgeClasses.d.ts +24 -0
  15. package/Badge/badgeClasses.js +8 -0
  16. package/Badge/index.d.ts +3 -0
  17. package/Badge/index.js +2 -1
  18. package/BottomNavigation/BottomNavigation.js +0 -0
  19. package/BottomNavigation/bottomNavigationClasses.d.ts +8 -8
  20. package/BottomNavigationAction/bottomNavigationActionClasses.d.ts +14 -14
  21. package/Breadcrumbs/breadcrumbsClasses.d.ts +14 -14
  22. package/Button/Button.js +101 -96
  23. package/Button/buttonClasses.d.ts +76 -76
  24. package/ButtonBase/buttonBaseClasses.d.ts +12 -12
  25. package/ButtonBase/touchRippleClasses.d.ts +20 -20
  26. package/ButtonGroup/ButtonGroupContext.d.ts +18 -18
  27. package/ButtonGroup/buttonGroupClasses.d.ts +58 -58
  28. package/CHANGELOG.md +74 -0
  29. package/Card/cardClasses.d.ts +8 -8
  30. package/CardActionArea/cardActionAreaClasses.d.ts +12 -12
  31. package/CardActions/cardActionsClasses.d.ts +10 -10
  32. package/CardContent/cardContentClasses.d.ts +8 -8
  33. package/CardHeader/cardHeaderClasses.d.ts +18 -18
  34. package/CardMedia/cardMediaClasses.d.ts +12 -12
  35. package/Checkbox/checkboxClasses.d.ts +18 -18
  36. package/Chip/chipClasses.d.ts +80 -80
  37. package/CircularProgress/circularProgressClasses.d.ts +26 -26
  38. package/ClickAwayListener/index.d.ts +2 -2
  39. package/Collapse/collapseClasses.d.ts +18 -18
  40. package/Container/containerClasses.d.ts +22 -22
  41. package/Dialog/DialogContext.d.ts +6 -6
  42. package/Dialog/dialogClasses.d.ts +36 -36
  43. package/DialogActions/dialogActionsClasses.d.ts +10 -10
  44. package/DialogContent/dialogContentClasses.d.ts +10 -10
  45. package/DialogContentText/dialogContentTextClasses.d.ts +8 -8
  46. package/DialogTitle/dialogTitleClasses.d.ts +8 -8
  47. package/Divider/dividerClasses.d.ts +34 -34
  48. package/Drawer/drawerClasses.d.ts +30 -30
  49. package/Fab/fabClasses.d.ts +26 -26
  50. package/FilledInput/filledInputClasses.d.ts +40 -40
  51. package/FormControl/formControlClasses.d.ts +14 -14
  52. package/FormControlLabel/formControlLabelClasses.d.ts +20 -20
  53. package/FormGroup/formGroupClasses.d.ts +12 -12
  54. package/FormHelperText/formHelperTextClasses.d.ts +22 -22
  55. package/FormLabel/formLabelClasses.d.ts +22 -22
  56. package/Grid/gridClasses.d.ts +48 -48
  57. package/Icon/iconClasses.d.ts +24 -24
  58. package/IconButton/iconButtonClasses.d.ts +26 -26
  59. package/ImageList/imageListClasses.d.ts +16 -16
  60. package/ImageListItem/imageListItemClasses.d.ts +18 -18
  61. package/ImageListItemBar/imageListItemBarClasses.d.ts +30 -30
  62. package/Input/inputClasses.d.ts +34 -34
  63. package/InputAdornment/inputAdornmentClasses.d.ts +24 -24
  64. package/InputBase/inputBaseClasses.d.ts +44 -44
  65. package/InputLabel/inputLabelClasses.d.ts +32 -32
  66. package/LinearProgress/linearProgressClasses.d.ts +42 -42
  67. package/Link/Link.js +12 -5
  68. package/Link/linkClasses.d.ts +18 -18
  69. package/List/listClasses.d.ts +14 -14
  70. package/ListItem/listItemClasses.d.ts +30 -30
  71. package/ListItemAvatar/listItemAvatarClasses.d.ts +10 -10
  72. package/ListItemButton/ListItemButton.js +1 -0
  73. package/ListItemButton/listItemButtonClasses.d.ts +22 -22
  74. package/ListItemIcon/listItemIconClasses.d.ts +10 -10
  75. package/ListItemSecondaryAction/listItemSecondaryActionClasses.d.ts +10 -10
  76. package/ListItemText/listItemTextClasses.d.ts +18 -18
  77. package/ListSubheader/listSubheaderClasses.d.ts +18 -18
  78. package/Menu/menuClasses.d.ts +12 -12
  79. package/MenuItem/menuItemClasses.d.ts +20 -20
  80. package/MobileStepper/mobileStepperClasses.d.ts +22 -22
  81. package/NativeSelect/nativeSelectClasses.d.ts +32 -32
  82. package/OutlinedInput/outlinedInputClasses.d.ts +36 -36
  83. package/Pagination/paginationClasses.d.ts +14 -14
  84. package/PaginationItem/paginationItemClasses.d.ts +42 -42
  85. package/Paper/paperClasses.d.ts +39 -39
  86. package/Popover/popoverClasses.d.ts +10 -10
  87. package/Popper/Popper.d.ts +29 -29
  88. package/Radio/radioClasses.d.ts +16 -16
  89. package/RadioGroup/RadioGroupContext.d.ts +11 -11
  90. package/RadioGroup/useRadioGroup.d.ts +4 -4
  91. package/Rating/ratingClasses.d.ts +40 -40
  92. package/ScopedCssBaseline/scopedCssBaselineClasses.d.ts +8 -8
  93. package/Select/selectClasses.d.ts +30 -30
  94. package/Skeleton/skeletonClasses.d.ts +24 -24
  95. package/Snackbar/snackbarClasses.d.ts +20 -20
  96. package/SnackbarContent/snackbarContentClasses.d.ts +12 -12
  97. package/SpeedDial/speedDialClasses.d.ts +22 -22
  98. package/SpeedDialAction/speedDialActionClasses.d.ts +20 -20
  99. package/SpeedDialIcon/speedDialIconClasses.d.ts +18 -18
  100. package/Step/StepContext.d.ts +20 -20
  101. package/Step/stepClasses.d.ts +16 -16
  102. package/StepButton/stepButtonClasses.d.ts +14 -14
  103. package/StepConnector/stepConnectorClasses.d.ts +26 -26
  104. package/StepContent/stepContentClasses.d.ts +12 -12
  105. package/StepIcon/stepIconClasses.d.ts +16 -16
  106. package/StepLabel/stepLabelClasses.d.ts +28 -28
  107. package/Stepper/stepperClasses.d.ts +14 -14
  108. package/SvgIcon/svgIconClasses.d.ts +24 -24
  109. package/Switch/switchClasses.d.ts +32 -32
  110. package/Tab/tabClasses.d.ts +26 -26
  111. package/TabScrollButton/tabScrollButtonClasses.d.ts +12 -12
  112. package/Table/tableClasses.d.ts +10 -10
  113. package/TableBody/tableBodyClasses.d.ts +8 -8
  114. package/TableCell/tableCellClasses.d.ts +32 -32
  115. package/TableContainer/tableContainerClasses.d.ts +8 -8
  116. package/TableFooter/tableFooterClasses.d.ts +8 -8
  117. package/TableHead/tableHeadClasses.d.ts +8 -8
  118. package/TablePagination/tablePaginationClasses.d.ts +28 -28
  119. package/TableRow/tableRowClasses.d.ts +16 -16
  120. package/TableSortLabel/tableSortLabelClasses.d.ts +16 -16
  121. package/Tabs/tabsClasses.d.ts +32 -32
  122. package/TextField/TextField.d.ts +0 -1
  123. package/TextField/textFieldClasses.d.ts +8 -8
  124. package/ToggleButton/toggleButtonClasses.d.ts +24 -24
  125. package/ToggleButtonGroup/toggleButtonGroupClasses.d.ts +18 -18
  126. package/Toolbar/toolbarClasses.d.ts +14 -14
  127. package/Tooltip/tooltipClasses.d.ts +30 -30
  128. package/Typography/typographyClasses.d.ts +50 -50
  129. package/className/index.d.ts +8 -8
  130. package/darkScrollbar/index.d.ts +28 -28
  131. package/index.js +1 -1
  132. package/internal/switchBaseClasses.d.ts +12 -12
  133. package/legacy/Badge/Badge.js +44 -21
  134. package/legacy/Badge/badgeClasses.js +8 -0
  135. package/legacy/Badge/index.js +2 -1
  136. package/legacy/BottomNavigation/BottomNavigation.js +0 -0
  137. package/legacy/Button/Button.js +30 -29
  138. package/legacy/Link/Link.js +12 -4
  139. package/legacy/ListItemButton/ListItemButton.js +1 -0
  140. package/legacy/index.js +1 -1
  141. package/legacy/locale/index.js +115 -111
  142. package/legacy/styles/CssVarsProvider.js +31 -0
  143. package/legacy/styles/experimental_extendTheme.js +96 -0
  144. package/legacy/styles/index.js +3 -1
  145. package/locale/index.d.ts +71 -71
  146. package/locale/index.js +6 -3
  147. package/modern/Badge/Badge.js +40 -18
  148. package/modern/Badge/badgeClasses.js +8 -0
  149. package/modern/Badge/index.js +2 -1
  150. package/modern/BottomNavigation/BottomNavigation.js +0 -0
  151. package/modern/Button/Button.js +29 -28
  152. package/modern/Link/Link.js +12 -5
  153. package/modern/ListItemButton/ListItemButton.js +1 -0
  154. package/modern/index.js +1 -1
  155. package/modern/locale/index.js +6 -3
  156. package/modern/styles/CssVarsProvider.js +28 -0
  157. package/modern/styles/experimental_extendTheme.js +89 -0
  158. package/modern/styles/index.js +3 -1
  159. package/node/Badge/Badge.js +53 -32
  160. package/node/Badge/badgeClasses.js +22 -0
  161. package/node/Badge/index.js +17 -5
  162. package/node/BottomNavigation/BottomNavigation.js +0 -0
  163. package/node/Button/Button.js +101 -96
  164. package/node/Link/Link.js +13 -5
  165. package/node/ListItemButton/ListItemButton.js +1 -0
  166. package/node/index.js +1 -1
  167. package/node/locale/index.js +6 -3
  168. package/node/styles/CssVarsProvider.js +41 -0
  169. package/node/styles/experimental_extendTheme.js +105 -0
  170. package/node/styles/index.js +58 -0
  171. package/package.json +7 -7
  172. package/styles/CssVarsProvider.d.ts +28 -0
  173. package/styles/CssVarsProvider.js +28 -0
  174. package/styles/createPalette.d.ts +26 -0
  175. package/styles/experimental_extendTheme.d.ts +90 -0
  176. package/styles/experimental_extendTheme.js +91 -0
  177. package/styles/index.d.ts +5 -0
  178. package/styles/index.js +3 -1
  179. package/transitions/index.d.ts +1 -1
  180. package/transitions/transition.d.ts +13 -13
  181. package/transitions/utils.d.ts +23 -23
  182. package/umd/material-ui.development.js +1075 -258
  183. package/umd/material-ui.production.min.js +21 -21
  184. package/useMediaQuery/useMediaQuery.d.ts +31 -31
  185. package/useTouchRipple/index.d.ts +1 -1
  186. package/useTouchRipple/useTouchRipple.d.ts +28 -28
  187. package/utils/getScrollbarSize.d.ts +2 -2
  188. package/utils/ownerDocument.d.ts +2 -2
  189. package/utils/ownerWindow.d.ts +2 -2
  190. package/utils/setRef.d.ts +2 -2
package/Badge/Badge.js CHANGED
@@ -1,19 +1,17 @@
1
1
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
2
2
  import _extends from "@babel/runtime/helpers/esm/extends";
3
- const _excluded = ["anchorOrigin", "component", "components", "componentsProps", "overlap", "color", "invisible", "badgeContent", "showZero", "variant"];
3
+ const _excluded = ["anchorOrigin", "className", "component", "components", "componentsProps", "overlap", "color", "invisible", "max", "badgeContent", "showZero", "variant"];
4
4
  import * as React from 'react';
5
5
  import PropTypes from 'prop-types';
6
6
  import clsx from 'clsx';
7
7
  import { usePreviousProps } from '@mui/utils';
8
- import { generateUtilityClasses } from '@mui/base';
9
- import BadgeUnstyled, { badgeUnstyledClasses, getBadgeUtilityClass } from '@mui/base/BadgeUnstyled';
8
+ import BadgeUnstyled from '@mui/base/BadgeUnstyled';
10
9
  import styled from '../styles/styled';
11
10
  import useThemeProps from '../styles/useThemeProps';
12
11
  import shouldSpreadAdditionalProps from '../utils/shouldSpreadAdditionalProps';
13
12
  import capitalize from '../utils/capitalize';
13
+ import badgeClasses, { getBadgeUtilityClass } from './badgeClasses';
14
14
  import { jsx as _jsx } from "react/jsx-runtime";
15
- export const badgeClasses = _extends({}, badgeUnstyledClasses, generateUtilityClasses('MuiBadge', ['colorError', 'colorInfo', 'colorPrimary', 'colorSecondary', 'colorSuccess', 'colorWarning', 'overlapRectangular', 'overlapCircular', // TODO: v6 remove the overlap value from these class keys
16
- 'anchorOriginTopLeftCircular', 'anchorOriginTopLeftRectangular', 'anchorOriginTopRightCircular', 'anchorOriginTopRightRectangular', 'anchorOriginBottomLeftCircular', 'anchorOriginBottomLeftRectangular', 'anchorOriginBottomRightCircular', 'anchorOriginBottomRightRectangular']));
17
15
  const RADIUS_STANDARD = 10;
18
16
  const RADIUS_DOT = 4;
19
17
 
@@ -21,12 +19,15 @@ const extendUtilityClasses = ownerState => {
21
19
  const {
22
20
  color,
23
21
  anchorOrigin,
22
+ invisible,
24
23
  overlap,
24
+ variant,
25
25
  classes = {}
26
26
  } = ownerState;
27
- return _extends({}, classes, {
28
- badge: clsx(classes.badge, getBadgeUtilityClass(`anchorOrigin${capitalize(anchorOrigin.vertical)}${capitalize(anchorOrigin.horizontal)}${capitalize(overlap)}`), getBadgeUtilityClass(`overlap${capitalize(overlap)}`), color !== 'default' && [getBadgeUtilityClass(`color${capitalize(color)}`), classes[`color${capitalize(color)}`]])
29
- });
27
+ return {
28
+ root: clsx(classes.root, 'root'),
29
+ badge: clsx(classes.badge, getBadgeUtilityClass('badge'), getBadgeUtilityClass(variant), `anchorOrigin${capitalize(anchorOrigin.vertical)}${capitalize(anchorOrigin.horizontal)}`, getBadgeUtilityClass(`anchorOrigin${capitalize(anchorOrigin.vertical)}${capitalize(anchorOrigin.horizontal)}${capitalize(overlap)}`), getBadgeUtilityClass(`overlap${capitalize(overlap)}`), color !== 'default' && [getBadgeUtilityClass(`color${capitalize(color)}`), classes[`color${capitalize(color)}`]], invisible && getBadgeUtilityClass('invisible'))
30
+ };
30
31
  };
31
32
 
32
33
  const BadgeRoot = styled('span', {
@@ -154,7 +155,7 @@ const BadgeBadge = styled('span', {
154
155
  })
155
156
  }));
156
157
  const Badge = /*#__PURE__*/React.forwardRef(function Badge(inProps, ref) {
157
- var _componentsProps$root, _componentsProps$badg;
158
+ var _componentsProps$root, _componentsProps$root2, _componentsProps$badg, _componentsProps$badg2;
158
159
 
159
160
  const props = useThemeProps({
160
161
  props: inProps,
@@ -166,12 +167,14 @@ const Badge = /*#__PURE__*/React.forwardRef(function Badge(inProps, ref) {
166
167
  vertical: 'top',
167
168
  horizontal: 'right'
168
169
  },
170
+ className,
169
171
  component = 'span',
170
172
  components = {},
171
173
  componentsProps = {},
172
174
  overlap: overlapProp = 'rectangular',
173
175
  color: colorProp = 'default',
174
176
  invisible: invisibleProp = false,
177
+ max,
175
178
  badgeContent: badgeContentProp,
176
179
  showZero = false,
177
180
  variant: variantProp = 'standard'
@@ -181,7 +184,8 @@ const Badge = /*#__PURE__*/React.forwardRef(function Badge(inProps, ref) {
181
184
  const prevProps = usePreviousProps({
182
185
  anchorOrigin: anchorOriginProp,
183
186
  color: colorProp,
184
- overlap: overlapProp
187
+ overlap: overlapProp,
188
+ variant: variantProp
185
189
  });
186
190
  let invisible = invisibleProp;
187
191
 
@@ -192,44 +196,57 @@ const Badge = /*#__PURE__*/React.forwardRef(function Badge(inProps, ref) {
192
196
  const {
193
197
  color = colorProp,
194
198
  overlap = overlapProp,
195
- anchorOrigin = anchorOriginProp
199
+ anchorOrigin = anchorOriginProp,
200
+ variant = variantProp
196
201
  } = invisible ? prevProps : props;
197
202
 
198
203
  const ownerState = _extends({}, props, {
199
204
  anchorOrigin,
200
205
  invisible,
201
206
  color,
202
- overlap
207
+ overlap,
208
+ variant
203
209
  });
204
210
 
205
211
  const classes = extendUtilityClasses(ownerState);
212
+ let displayValue;
213
+
214
+ if (variant !== 'dot') {
215
+ displayValue = badgeContentProp && Number(badgeContentProp) > max ? `${max}+` : badgeContentProp;
216
+ }
217
+
206
218
  return /*#__PURE__*/_jsx(BadgeUnstyled, _extends({
207
- anchorOrigin: anchorOrigin,
208
219
  invisible: invisibleProp,
209
- badgeContent: badgeContentProp,
220
+ badgeContent: displayValue,
210
221
  showZero: showZero,
211
- variant: variantProp
222
+ max: max
212
223
  }, other, {
213
224
  components: _extends({
214
225
  Root: BadgeRoot,
215
226
  Badge: BadgeBadge
216
227
  }, components),
228
+ className: clsx(className, classes.root, (_componentsProps$root = componentsProps.root) == null ? void 0 : _componentsProps$root.className),
217
229
  componentsProps: {
218
230
  root: _extends({}, componentsProps.root, shouldSpreadAdditionalProps(components.Root) && {
219
231
  as: component,
220
- ownerState: _extends({}, (_componentsProps$root = componentsProps.root) == null ? void 0 : _componentsProps$root.ownerState, {
232
+ ownerState: _extends({}, (_componentsProps$root2 = componentsProps.root) == null ? void 0 : _componentsProps$root2.ownerState, {
233
+ anchorOrigin,
221
234
  color,
222
- overlap
235
+ overlap,
236
+ variant
223
237
  })
224
238
  }),
225
- badge: _extends({}, componentsProps.badge, shouldSpreadAdditionalProps(components.Badge) && {
226
- ownerState: _extends({}, (_componentsProps$badg = componentsProps.badge) == null ? void 0 : _componentsProps$badg.ownerState, {
239
+ badge: _extends({}, componentsProps.badge, {
240
+ className: clsx(classes.badge, (_componentsProps$badg = componentsProps.badge) == null ? void 0 : _componentsProps$badg.className)
241
+ }, shouldSpreadAdditionalProps(components.Badge) && {
242
+ ownerState: _extends({}, (_componentsProps$badg2 = componentsProps.badge) == null ? void 0 : _componentsProps$badg2.ownerState, {
243
+ anchorOrigin,
227
244
  color,
228
- overlap
245
+ overlap,
246
+ variant
229
247
  })
230
248
  })
231
249
  },
232
- classes: classes,
233
250
  ref: ref
234
251
  }));
235
252
  });
@@ -268,6 +285,11 @@ process.env.NODE_ENV !== "production" ? Badge.propTypes
268
285
  */
269
286
  classes: PropTypes.object,
270
287
 
288
+ /**
289
+ * @ignore
290
+ */
291
+ className: PropTypes.string,
292
+
271
293
  /**
272
294
  * The color of the component.
273
295
  * It supports both default and custom theme colors, which can be added as shown in the
@@ -0,0 +1,24 @@
1
+ export interface BadgeClasses {
2
+ /** Class name applied to the root element. */
3
+ root: string;
4
+ /** Class name applied to the badge `span` element. */
5
+ badge: string;
6
+ /** Class name applied to the badge `span` element if `variant="dot"`. */
7
+ dot: string;
8
+ /** Class name applied to the badge `span` element if `variant="standard"`. */
9
+ standard: string;
10
+ /** Class name applied to the badge `span` element if `anchorOrigin={{ 'top', 'right' }}`. */
11
+ anchorOriginTopRight: string;
12
+ /** Class name applied to the badge `span` element if `anchorOrigin={{ 'bottom', 'right' }}`. */
13
+ anchorOriginBottomRight: string;
14
+ /** Class name applied to the badge `span` element if `anchorOrigin={{ 'top', 'left' }}`. */
15
+ anchorOriginTopLeft: string;
16
+ /** Class name applied to the badge `span` element if `anchorOrigin={{ 'bottom', 'left' }}`. */
17
+ anchorOriginBottomLeft: string;
18
+ /** State class applied to the badge `span` element if `invisible={true}`. */
19
+ invisible: string;
20
+ }
21
+ export declare type BadgeClassKey = keyof BadgeClasses;
22
+ export declare function getBadgeUtilityClass(slot: string): string;
23
+ declare const badgeClasses: BadgeClasses;
24
+ export default badgeClasses;
@@ -0,0 +1,8 @@
1
+ import generateUtilityClasses from '@mui/base/generateUtilityClasses';
2
+ import generateUtilityClass from '@mui/base/generateUtilityClass';
3
+ export function getBadgeUtilityClass(slot) {
4
+ return generateUtilityClass('MuiBadge', slot);
5
+ }
6
+ const badgeClasses = generateUtilityClasses('MuiBadge', ['root', 'badge', 'dot', 'standard', 'anchorOriginTopRight', 'anchorOriginBottomRight', 'anchorOriginTopLeft', 'anchorOriginBottomLeft', 'invisible', 'colorError', 'colorInfo', 'colorPrimary', 'colorSecondary', 'colorSuccess', 'colorWarning', 'overlapRectangular', 'overlapCircular', // TODO: v6 remove the overlap value from these class keys
7
+ 'anchorOriginTopLeftCircular', 'anchorOriginTopLeftRectangular', 'anchorOriginTopRightCircular', 'anchorOriginTopRightRectangular', 'anchorOriginBottomLeftCircular', 'anchorOriginBottomLeftRectangular', 'anchorOriginBottomRightCircular', 'anchorOriginBottomRightRectangular']);
8
+ export default badgeClasses;
package/Badge/index.d.ts CHANGED
@@ -1,2 +1,5 @@
1
1
  export { default } from './Badge';
2
2
  export * from './Badge';
3
+
4
+ export { default as badgeClasses } from './badgeClasses';
5
+ export * from './badgeClasses';
package/Badge/index.js CHANGED
@@ -1,2 +1,3 @@
1
1
  export { default } from './Badge';
2
- export * from './Badge';
2
+ export { default as badgeClasses } from './badgeClasses';
3
+ export * from './badgeClasses';
File without changes
@@ -1,8 +1,8 @@
1
- export interface BottomNavigationClasses {
2
- /** Styles applied to the root element. */
3
- root: string;
4
- }
5
- export declare type BottomNavigationClassKey = keyof BottomNavigationClasses;
6
- export declare function getBottomNavigationUtilityClass(slot: string): string;
7
- declare const bottomNavigationClasses: BottomNavigationClasses;
8
- export default bottomNavigationClasses;
1
+ export interface BottomNavigationClasses {
2
+ /** Styles applied to the root element. */
3
+ root: string;
4
+ }
5
+ export declare type BottomNavigationClassKey = keyof BottomNavigationClasses;
6
+ export declare function getBottomNavigationUtilityClass(slot: string): string;
7
+ declare const bottomNavigationClasses: BottomNavigationClasses;
8
+ export default bottomNavigationClasses;
@@ -1,14 +1,14 @@
1
- export interface BottomNavigationActionClasses {
2
- /** Styles applied to the root element. */
3
- root: string;
4
- /** State class applied to the root element if selected. */
5
- selected: string;
6
- /** State class applied to the root element if `showLabel={false}` and not selected. */
7
- iconOnly: string;
8
- /** Styles applied to the label's span element. */
9
- label: string;
10
- }
11
- export declare type BottomNavigationActionClassKey = keyof BottomNavigationActionClasses;
12
- export declare function getBottomNavigationActionUtilityClass(slot: string): string;
13
- declare const bottomNavigationActionClasses: BottomNavigationActionClasses;
14
- export default bottomNavigationActionClasses;
1
+ export interface BottomNavigationActionClasses {
2
+ /** Styles applied to the root element. */
3
+ root: string;
4
+ /** State class applied to the root element if selected. */
5
+ selected: string;
6
+ /** State class applied to the root element if `showLabel={false}` and not selected. */
7
+ iconOnly: string;
8
+ /** Styles applied to the label's span element. */
9
+ label: string;
10
+ }
11
+ export declare type BottomNavigationActionClassKey = keyof BottomNavigationActionClasses;
12
+ export declare function getBottomNavigationActionUtilityClass(slot: string): string;
13
+ declare const bottomNavigationActionClasses: BottomNavigationActionClasses;
14
+ export default bottomNavigationActionClasses;
@@ -1,14 +1,14 @@
1
- export interface BreadcrumbsClasses {
2
- /** Styles applied to the root element. */
3
- root: string;
4
- /** Styles applied to the ol element. */
5
- ol: string;
6
- /** Styles applied to the li element. */
7
- li: string;
8
- /** Styles applied to the separator element. */
9
- separator: string;
10
- }
11
- export declare type BreadcrumbsClassKey = keyof BreadcrumbsClasses;
12
- export declare function getBreadcrumbsUtilityClass(slot: string): string;
13
- declare const breadcrumbsClasses: BreadcrumbsClasses;
14
- export default breadcrumbsClasses;
1
+ export interface BreadcrumbsClasses {
2
+ /** Styles applied to the root element. */
3
+ root: string;
4
+ /** Styles applied to the ol element. */
5
+ ol: string;
6
+ /** Styles applied to the li element. */
7
+ li: string;
8
+ /** Styles applied to the separator element. */
9
+ separator: string;
10
+ }
11
+ export declare type BreadcrumbsClassKey = keyof BreadcrumbsClasses;
12
+ export declare function getBreadcrumbsUtilityClass(slot: string): string;
13
+ declare const breadcrumbsClasses: BreadcrumbsClasses;
14
+ export default breadcrumbsClasses;
package/Button/Button.js CHANGED
@@ -62,106 +62,111 @@ const ButtonRoot = styled(ButtonBase, {
62
62
  })(({
63
63
  theme,
64
64
  ownerState
65
- }) => _extends({}, theme.typography.button, {
66
- minWidth: 64,
67
- padding: '6px 16px',
68
- borderRadius: theme.shape.borderRadius,
69
- transition: theme.transitions.create(['background-color', 'box-shadow', 'border-color', 'color'], {
70
- duration: theme.transitions.duration.short
71
- }),
72
- '&:hover': _extends({
73
- textDecoration: 'none',
74
- backgroundColor: alpha(theme.palette.text.primary, theme.palette.action.hoverOpacity),
75
- // Reset on touch devices, it doesn't add specificity
76
- '@media (hover: none)': {
77
- backgroundColor: 'transparent'
78
- }
65
+ }) => {
66
+ var _theme$palette$getCon, _theme$palette;
67
+
68
+ return _extends({}, theme.typography.button, {
69
+ minWidth: 64,
70
+ padding: '6px 16px',
71
+ borderRadius: (theme.vars || theme).shape.borderRadius,
72
+ transition: theme.transitions.create(['background-color', 'box-shadow', 'border-color', 'color'], {
73
+ duration: theme.transitions.duration.short
74
+ }),
75
+ '&:hover': _extends({
76
+ textDecoration: 'none',
77
+ backgroundColor: theme.vars ? `rgba(${theme.vars.palette.text.primaryChannel} / ${theme.vars.palette.action.hoverOpacity})` : alpha(theme.palette.text.primary, theme.palette.action.hoverOpacity),
78
+ // Reset on touch devices, it doesn't add specificity
79
+ '@media (hover: none)': {
80
+ backgroundColor: 'transparent'
81
+ }
82
+ }, ownerState.variant === 'text' && ownerState.color !== 'inherit' && {
83
+ backgroundColor: theme.vars ? `rgba(${theme.vars.palette[ownerState.color].mainChannel} / ${theme.vars.palette.action.hoverOpacity})` : alpha(theme.palette[ownerState.color].main, theme.palette.action.hoverOpacity),
84
+ // Reset on touch devices, it doesn't add specificity
85
+ '@media (hover: none)': {
86
+ backgroundColor: 'transparent'
87
+ }
88
+ }, ownerState.variant === 'outlined' && ownerState.color !== 'inherit' && {
89
+ border: `1px solid ${(theme.vars || theme).palette[ownerState.color].main}`,
90
+ backgroundColor: theme.vars ? `rgba(${theme.vars.palette[ownerState.color].mainChannel} / ${theme.vars.palette.action.hoverOpacity})` : alpha(theme.palette[ownerState.color].main, theme.palette.action.hoverOpacity),
91
+ // Reset on touch devices, it doesn't add specificity
92
+ '@media (hover: none)': {
93
+ backgroundColor: 'transparent'
94
+ }
95
+ }, ownerState.variant === 'contained' && {
96
+ backgroundColor: (theme.vars || theme).palette.grey.A100,
97
+ boxShadow: (theme.vars || theme).shadows[4],
98
+ // Reset on touch devices, it doesn't add specificity
99
+ '@media (hover: none)': {
100
+ boxShadow: (theme.vars || theme).shadows[2],
101
+ backgroundColor: (theme.vars || theme).palette.grey[300]
102
+ }
103
+ }, ownerState.variant === 'contained' && ownerState.color !== 'inherit' && {
104
+ backgroundColor: (theme.vars || theme).palette[ownerState.color].dark,
105
+ // Reset on touch devices, it doesn't add specificity
106
+ '@media (hover: none)': {
107
+ backgroundColor: (theme.vars || theme).palette[ownerState.color].main
108
+ }
109
+ }),
110
+ '&:active': _extends({}, ownerState.variant === 'contained' && {
111
+ boxShadow: (theme.vars || theme).shadows[8]
112
+ }),
113
+ [`&.${buttonClasses.focusVisible}`]: _extends({}, ownerState.variant === 'contained' && {
114
+ boxShadow: (theme.vars || theme).shadows[6]
115
+ }),
116
+ [`&.${buttonClasses.disabled}`]: _extends({
117
+ color: (theme.vars || theme).palette.action.disabled
118
+ }, ownerState.variant === 'outlined' && {
119
+ border: `1px solid ${(theme.vars || theme).palette.action.disabledBackground}`
120
+ }, ownerState.variant === 'outlined' && ownerState.color === 'secondary' && {
121
+ border: `1px solid ${(theme.vars || theme).palette.action.disabled}`
122
+ }, ownerState.variant === 'contained' && {
123
+ color: (theme.vars || theme).palette.action.disabled,
124
+ boxShadow: (theme.vars || theme).shadows[0],
125
+ backgroundColor: (theme.vars || theme).palette.action.disabledBackground
126
+ })
127
+ }, ownerState.variant === 'text' && {
128
+ padding: '6px 8px'
79
129
  }, ownerState.variant === 'text' && ownerState.color !== 'inherit' && {
80
- backgroundColor: alpha(theme.palette[ownerState.color].main, theme.palette.action.hoverOpacity),
81
- // Reset on touch devices, it doesn't add specificity
82
- '@media (hover: none)': {
83
- backgroundColor: 'transparent'
84
- }
130
+ color: (theme.vars || theme).palette[ownerState.color].main
131
+ }, ownerState.variant === 'outlined' && {
132
+ padding: '5px 15px',
133
+ border: '1px solid currentColor'
85
134
  }, ownerState.variant === 'outlined' && ownerState.color !== 'inherit' && {
86
- border: `1px solid ${theme.palette[ownerState.color].main}`,
87
- backgroundColor: alpha(theme.palette[ownerState.color].main, theme.palette.action.hoverOpacity),
88
- // Reset on touch devices, it doesn't add specificity
89
- '@media (hover: none)': {
90
- backgroundColor: 'transparent'
91
- }
135
+ color: (theme.vars || theme).palette[ownerState.color].main,
136
+ border: theme.vars ? `1px solid rgba(${theme.vars.palette[ownerState.color].mainChannel} / 0.5)` : `1px solid ${alpha(theme.palette[ownerState.color].main, 0.5)}`
92
137
  }, ownerState.variant === 'contained' && {
93
- backgroundColor: theme.palette.grey.A100,
94
- boxShadow: theme.shadows[4],
95
- // Reset on touch devices, it doesn't add specificity
96
- '@media (hover: none)': {
97
- boxShadow: theme.shadows[2],
98
- backgroundColor: theme.palette.grey[300]
99
- }
138
+ color: theme.vars ? // this is safe because grey does not change between default light/dark mode
139
+ theme.vars.palette.text.primary : (_theme$palette$getCon = (_theme$palette = theme.palette).getContrastText) == null ? void 0 : _theme$palette$getCon.call(_theme$palette, theme.palette.grey[300]),
140
+ backgroundColor: (theme.vars || theme).palette.grey[300],
141
+ boxShadow: (theme.vars || theme).shadows[2]
100
142
  }, ownerState.variant === 'contained' && ownerState.color !== 'inherit' && {
101
- backgroundColor: theme.palette[ownerState.color].dark,
102
- // Reset on touch devices, it doesn't add specificity
103
- '@media (hover: none)': {
104
- backgroundColor: theme.palette[ownerState.color].main
105
- }
106
- }),
107
- '&:active': _extends({}, ownerState.variant === 'contained' && {
108
- boxShadow: theme.shadows[8]
109
- }),
110
- [`&.${buttonClasses.focusVisible}`]: _extends({}, ownerState.variant === 'contained' && {
111
- boxShadow: theme.shadows[6]
112
- }),
113
- [`&.${buttonClasses.disabled}`]: _extends({
114
- color: theme.palette.action.disabled
115
- }, ownerState.variant === 'outlined' && {
116
- border: `1px solid ${theme.palette.action.disabledBackground}`
117
- }, ownerState.variant === 'outlined' && ownerState.color === 'secondary' && {
118
- border: `1px solid ${theme.palette.action.disabled}`
119
- }, ownerState.variant === 'contained' && {
120
- color: theme.palette.action.disabled,
121
- boxShadow: theme.shadows[0],
122
- backgroundColor: theme.palette.action.disabledBackground
123
- })
124
- }, ownerState.variant === 'text' && {
125
- padding: '6px 8px'
126
- }, ownerState.variant === 'text' && ownerState.color !== 'inherit' && {
127
- color: theme.palette[ownerState.color].main
128
- }, ownerState.variant === 'outlined' && {
129
- padding: '5px 15px',
130
- border: `1px solid ${theme.palette.mode === 'light' ? 'rgba(0, 0, 0, 0.23)' : 'rgba(255, 255, 255, 0.23)'}`
131
- }, ownerState.variant === 'outlined' && ownerState.color !== 'inherit' && {
132
- color: theme.palette[ownerState.color].main,
133
- border: `1px solid ${alpha(theme.palette[ownerState.color].main, 0.5)}`
134
- }, ownerState.variant === 'contained' && {
135
- color: theme.palette.getContrastText(theme.palette.grey[300]),
136
- backgroundColor: theme.palette.grey[300],
137
- boxShadow: theme.shadows[2]
138
- }, ownerState.variant === 'contained' && ownerState.color !== 'inherit' && {
139
- color: theme.palette[ownerState.color].contrastText,
140
- backgroundColor: theme.palette[ownerState.color].main
141
- }, ownerState.color === 'inherit' && {
142
- color: 'inherit',
143
- borderColor: 'currentColor'
144
- }, ownerState.size === 'small' && ownerState.variant === 'text' && {
145
- padding: '4px 5px',
146
- fontSize: theme.typography.pxToRem(13)
147
- }, ownerState.size === 'large' && ownerState.variant === 'text' && {
148
- padding: '8px 11px',
149
- fontSize: theme.typography.pxToRem(15)
150
- }, ownerState.size === 'small' && ownerState.variant === 'outlined' && {
151
- padding: '3px 9px',
152
- fontSize: theme.typography.pxToRem(13)
153
- }, ownerState.size === 'large' && ownerState.variant === 'outlined' && {
154
- padding: '7px 21px',
155
- fontSize: theme.typography.pxToRem(15)
156
- }, ownerState.size === 'small' && ownerState.variant === 'contained' && {
157
- padding: '4px 10px',
158
- fontSize: theme.typography.pxToRem(13)
159
- }, ownerState.size === 'large' && ownerState.variant === 'contained' && {
160
- padding: '8px 22px',
161
- fontSize: theme.typography.pxToRem(15)
162
- }, ownerState.fullWidth && {
163
- width: '100%'
164
- }), ({
143
+ color: (theme.vars || theme).palette[ownerState.color].contrastText,
144
+ backgroundColor: (theme.vars || theme).palette[ownerState.color].main
145
+ }, ownerState.color === 'inherit' && {
146
+ color: 'inherit',
147
+ borderColor: 'currentColor'
148
+ }, ownerState.size === 'small' && ownerState.variant === 'text' && {
149
+ padding: '4px 5px',
150
+ fontSize: theme.typography.pxToRem(13)
151
+ }, ownerState.size === 'large' && ownerState.variant === 'text' && {
152
+ padding: '8px 11px',
153
+ fontSize: theme.typography.pxToRem(15)
154
+ }, ownerState.size === 'small' && ownerState.variant === 'outlined' && {
155
+ padding: '3px 9px',
156
+ fontSize: theme.typography.pxToRem(13)
157
+ }, ownerState.size === 'large' && ownerState.variant === 'outlined' && {
158
+ padding: '7px 21px',
159
+ fontSize: theme.typography.pxToRem(15)
160
+ }, ownerState.size === 'small' && ownerState.variant === 'contained' && {
161
+ padding: '4px 10px',
162
+ fontSize: theme.typography.pxToRem(13)
163
+ }, ownerState.size === 'large' && ownerState.variant === 'contained' && {
164
+ padding: '8px 22px',
165
+ fontSize: theme.typography.pxToRem(15)
166
+ }, ownerState.fullWidth && {
167
+ width: '100%'
168
+ });
169
+ }, ({
165
170
  ownerState
166
171
  }) => ownerState.disableElevation && {
167
172
  boxShadow: 'none',