@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/locale/index.d.ts CHANGED
@@ -1,71 +1,71 @@
1
- import { ComponentsPropsList } from '../styles/props';
2
- export interface Localization {
3
- components?: {
4
- MuiAlert?: {
5
- defaultProps: Pick<ComponentsPropsList['MuiAlert'], 'closeText'>;
6
- };
7
- MuiBreadcrumbs?: {
8
- defaultProps: Pick<ComponentsPropsList['MuiBreadcrumbs'], 'expandText'>;
9
- };
10
- MuiTablePagination?: {
11
- defaultProps: Pick<ComponentsPropsList['MuiTablePagination'], 'labelRowsPerPage' | 'labelDisplayedRows' | 'getItemAriaLabel'>;
12
- };
13
- MuiRating?: {
14
- defaultProps: Pick<ComponentsPropsList['MuiRating'], 'emptyLabelText' | 'getLabelText'>;
15
- };
16
- MuiAutocomplete?: {
17
- defaultProps: Pick<ComponentsPropsList['MuiAutocomplete'], 'clearText' | 'closeText' | 'loadingText' | 'noOptionsText' | 'openText'>;
18
- };
19
- MuiPagination?: {
20
- defaultProps: Pick<ComponentsPropsList['MuiPagination'], 'aria-label' | 'getItemAriaLabel'>;
21
- };
22
- };
23
- }
24
- export declare const amET: Localization;
25
- export declare const arEG: Localization;
26
- export declare const arSD: Localization;
27
- export declare const azAZ: Localization;
28
- export declare const bnBD: Localization;
29
- export declare const bgBG: Localization;
30
- export declare const caES: Localization;
31
- export declare const csCZ: Localization;
32
- export declare const daDK: Localization;
33
- export declare const deDE: Localization;
34
- export declare const elGR: Localization;
35
- export declare const enUS: Localization;
36
- export declare const esES: Localization;
37
- export declare const etEE: Localization;
38
- export declare const faIR: Localization;
39
- export declare const fiFI: Localization;
40
- export declare const frFR: Localization;
41
- export declare const heIL: Localization;
42
- export declare const hiIN: Localization;
43
- export declare const hrHR: Localization;
44
- export declare const huHU: Localization;
45
- export declare const hyAM: Localization;
46
- export declare const idID: Localization;
47
- export declare const isIS: Localization;
48
- export declare const itIT: Localization;
49
- export declare const jaJP: Localization;
50
- export declare const khKH: Localization;
51
- export declare const koKR: Localization;
52
- export declare const kzKZ: Localization;
53
- export declare const mkMK: Localization;
54
- export declare const nbNO: Localization;
55
- export declare const nlNL: Localization;
56
- export declare const plPL: Localization;
57
- export declare const ptBR: Localization;
58
- export declare const ptPT: Localization;
59
- export declare const roRO: Localization;
60
- export declare const srRS: Localization;
61
- export declare const ruRU: Localization;
62
- export declare const siLK: Localization;
63
- export declare const skSK: Localization;
64
- export declare const svSE: Localization;
65
- export declare const thTH: Localization;
66
- export declare const trTR: Localization;
67
- export declare const ukUA: Localization;
68
- export declare const viVN: Localization;
69
- export declare const zhCN: Localization;
70
- export declare const zhHK: Localization;
71
- export declare const zhTW: Localization;
1
+ import { ComponentsPropsList } from '../styles/props';
2
+ export interface Localization {
3
+ components?: {
4
+ MuiAlert?: {
5
+ defaultProps: Pick<ComponentsPropsList['MuiAlert'], 'closeText'>;
6
+ };
7
+ MuiBreadcrumbs?: {
8
+ defaultProps: Pick<ComponentsPropsList['MuiBreadcrumbs'], 'expandText'>;
9
+ };
10
+ MuiTablePagination?: {
11
+ defaultProps: Pick<ComponentsPropsList['MuiTablePagination'], 'labelRowsPerPage' | 'labelDisplayedRows' | 'getItemAriaLabel'>;
12
+ };
13
+ MuiRating?: {
14
+ defaultProps: Pick<ComponentsPropsList['MuiRating'], 'emptyLabelText' | 'getLabelText'>;
15
+ };
16
+ MuiAutocomplete?: {
17
+ defaultProps: Pick<ComponentsPropsList['MuiAutocomplete'], 'clearText' | 'closeText' | 'loadingText' | 'noOptionsText' | 'openText'>;
18
+ };
19
+ MuiPagination?: {
20
+ defaultProps: Pick<ComponentsPropsList['MuiPagination'], 'aria-label' | 'getItemAriaLabel'>;
21
+ };
22
+ };
23
+ }
24
+ export declare const amET: Localization;
25
+ export declare const arEG: Localization;
26
+ export declare const arSD: Localization;
27
+ export declare const azAZ: Localization;
28
+ export declare const bnBD: Localization;
29
+ export declare const bgBG: Localization;
30
+ export declare const caES: Localization;
31
+ export declare const csCZ: Localization;
32
+ export declare const daDK: Localization;
33
+ export declare const deDE: Localization;
34
+ export declare const elGR: Localization;
35
+ export declare const enUS: Localization;
36
+ export declare const esES: Localization;
37
+ export declare const etEE: Localization;
38
+ export declare const faIR: Localization;
39
+ export declare const fiFI: Localization;
40
+ export declare const frFR: Localization;
41
+ export declare const heIL: Localization;
42
+ export declare const hiIN: Localization;
43
+ export declare const hrHR: Localization;
44
+ export declare const huHU: Localization;
45
+ export declare const hyAM: Localization;
46
+ export declare const idID: Localization;
47
+ export declare const isIS: Localization;
48
+ export declare const itIT: Localization;
49
+ export declare const jaJP: Localization;
50
+ export declare const khKH: Localization;
51
+ export declare const koKR: Localization;
52
+ export declare const kzKZ: Localization;
53
+ export declare const mkMK: Localization;
54
+ export declare const nbNO: Localization;
55
+ export declare const nlNL: Localization;
56
+ export declare const plPL: Localization;
57
+ export declare const ptBR: Localization;
58
+ export declare const ptPT: Localization;
59
+ export declare const roRO: Localization;
60
+ export declare const srRS: Localization;
61
+ export declare const ruRU: Localization;
62
+ export declare const siLK: Localization;
63
+ export declare const skSK: Localization;
64
+ export declare const svSE: Localization;
65
+ export declare const thTH: Localization;
66
+ export declare const trTR: Localization;
67
+ export declare const ukUA: Localization;
68
+ export declare const viVN: Localization;
69
+ export declare const zhCN: Localization;
70
+ export declare const zhHK: Localization;
71
+ export declare const zhTW: Localization;
package/locale/index.js CHANGED
@@ -1047,9 +1047,12 @@ export const etEE = {
1047
1047
 
1048
1048
  return 'Vali eelmine lehekülg';
1049
1049
  },
1050
- labelRowsPerPage: 'Ridu leheküljel:' // labelDisplayedRows: ({ from, to, count }) =>
1051
- // `${from}–${to} / ${count !== -1 ? count : `more than ${to}`}`,
1052
-
1050
+ labelRowsPerPage: 'Ridu leheküljel:',
1051
+ labelDisplayedRows: ({
1052
+ from,
1053
+ to,
1054
+ count
1055
+ }) => `${from}–${to} / ${count !== -1 ? count : `rohkem kui ${to}`}`
1053
1056
  }
1054
1057
  },
1055
1058
  MuiRating: {
@@ -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', {
@@ -164,12 +165,14 @@ const Badge = /*#__PURE__*/React.forwardRef(function Badge(inProps, ref) {
164
165
  vertical: 'top',
165
166
  horizontal: 'right'
166
167
  },
168
+ className,
167
169
  component = 'span',
168
170
  components = {},
169
171
  componentsProps = {},
170
172
  overlap: overlapProp = 'rectangular',
171
173
  color: colorProp = 'default',
172
174
  invisible: invisibleProp = false,
175
+ max,
173
176
  badgeContent: badgeContentProp,
174
177
  showZero = false,
175
178
  variant: variantProp = 'standard'
@@ -179,7 +182,8 @@ const Badge = /*#__PURE__*/React.forwardRef(function Badge(inProps, ref) {
179
182
  const prevProps = usePreviousProps({
180
183
  anchorOrigin: anchorOriginProp,
181
184
  color: colorProp,
182
- overlap: overlapProp
185
+ overlap: overlapProp,
186
+ variant: variantProp
183
187
  });
184
188
  let invisible = invisibleProp;
185
189
 
@@ -190,44 +194,57 @@ const Badge = /*#__PURE__*/React.forwardRef(function Badge(inProps, ref) {
190
194
  const {
191
195
  color = colorProp,
192
196
  overlap = overlapProp,
193
- anchorOrigin = anchorOriginProp
197
+ anchorOrigin = anchorOriginProp,
198
+ variant = variantProp
194
199
  } = invisible ? prevProps : props;
195
200
 
196
201
  const ownerState = _extends({}, props, {
197
202
  anchorOrigin,
198
203
  invisible,
199
204
  color,
200
- overlap
205
+ overlap,
206
+ variant
201
207
  });
202
208
 
203
209
  const classes = extendUtilityClasses(ownerState);
210
+ let displayValue;
211
+
212
+ if (variant !== 'dot') {
213
+ displayValue = badgeContentProp && Number(badgeContentProp) > max ? `${max}+` : badgeContentProp;
214
+ }
215
+
204
216
  return /*#__PURE__*/_jsx(BadgeUnstyled, _extends({
205
- anchorOrigin: anchorOrigin,
206
217
  invisible: invisibleProp,
207
- badgeContent: badgeContentProp,
218
+ badgeContent: displayValue,
208
219
  showZero: showZero,
209
- variant: variantProp
220
+ max: max
210
221
  }, other, {
211
222
  components: _extends({
212
223
  Root: BadgeRoot,
213
224
  Badge: BadgeBadge
214
225
  }, components),
226
+ className: clsx(className, classes.root, componentsProps.root?.className),
215
227
  componentsProps: {
216
228
  root: _extends({}, componentsProps.root, shouldSpreadAdditionalProps(components.Root) && {
217
229
  as: component,
218
230
  ownerState: _extends({}, componentsProps.root?.ownerState, {
231
+ anchorOrigin,
219
232
  color,
220
- overlap
233
+ overlap,
234
+ variant
221
235
  })
222
236
  }),
223
- badge: _extends({}, componentsProps.badge, shouldSpreadAdditionalProps(components.Badge) && {
237
+ badge: _extends({}, componentsProps.badge, {
238
+ className: clsx(classes.badge, componentsProps.badge?.className)
239
+ }, shouldSpreadAdditionalProps(components.Badge) && {
224
240
  ownerState: _extends({}, componentsProps.badge?.ownerState, {
241
+ anchorOrigin,
225
242
  color,
226
- overlap
243
+ overlap,
244
+ variant
227
245
  })
228
246
  })
229
247
  },
230
- classes: classes,
231
248
  ref: ref
232
249
  }));
233
250
  });
@@ -266,6 +283,11 @@ process.env.NODE_ENV !== "production" ? Badge.propTypes
266
283
  */
267
284
  classes: PropTypes.object,
268
285
 
286
+ /**
287
+ * @ignore
288
+ */
289
+ className: PropTypes.string,
290
+
269
291
  /**
270
292
  * The color of the component.
271
293
  * It supports both default and custom theme colors, which can be added as shown in the
@@ -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;
@@ -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
@@ -65,79 +65,80 @@ const ButtonRoot = styled(ButtonBase, {
65
65
  }) => _extends({}, theme.typography.button, {
66
66
  minWidth: 64,
67
67
  padding: '6px 16px',
68
- borderRadius: theme.shape.borderRadius,
68
+ borderRadius: (theme.vars || theme).shape.borderRadius,
69
69
  transition: theme.transitions.create(['background-color', 'box-shadow', 'border-color', 'color'], {
70
70
  duration: theme.transitions.duration.short
71
71
  }),
72
72
  '&:hover': _extends({
73
73
  textDecoration: 'none',
74
- backgroundColor: alpha(theme.palette.text.primary, theme.palette.action.hoverOpacity),
74
+ backgroundColor: theme.vars ? `rgba(${theme.vars.palette.text.primaryChannel} / ${theme.vars.palette.action.hoverOpacity})` : alpha(theme.palette.text.primary, theme.palette.action.hoverOpacity),
75
75
  // Reset on touch devices, it doesn't add specificity
76
76
  '@media (hover: none)': {
77
77
  backgroundColor: 'transparent'
78
78
  }
79
79
  }, ownerState.variant === 'text' && ownerState.color !== 'inherit' && {
80
- backgroundColor: alpha(theme.palette[ownerState.color].main, theme.palette.action.hoverOpacity),
80
+ 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),
81
81
  // Reset on touch devices, it doesn't add specificity
82
82
  '@media (hover: none)': {
83
83
  backgroundColor: 'transparent'
84
84
  }
85
85
  }, 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),
86
+ border: `1px solid ${(theme.vars || theme).palette[ownerState.color].main}`,
87
+ 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),
88
88
  // Reset on touch devices, it doesn't add specificity
89
89
  '@media (hover: none)': {
90
90
  backgroundColor: 'transparent'
91
91
  }
92
92
  }, ownerState.variant === 'contained' && {
93
- backgroundColor: theme.palette.grey.A100,
94
- boxShadow: theme.shadows[4],
93
+ backgroundColor: (theme.vars || theme).palette.grey.A100,
94
+ boxShadow: (theme.vars || theme).shadows[4],
95
95
  // Reset on touch devices, it doesn't add specificity
96
96
  '@media (hover: none)': {
97
- boxShadow: theme.shadows[2],
98
- backgroundColor: theme.palette.grey[300]
97
+ boxShadow: (theme.vars || theme).shadows[2],
98
+ backgroundColor: (theme.vars || theme).palette.grey[300]
99
99
  }
100
100
  }, ownerState.variant === 'contained' && ownerState.color !== 'inherit' && {
101
- backgroundColor: theme.palette[ownerState.color].dark,
101
+ backgroundColor: (theme.vars || theme).palette[ownerState.color].dark,
102
102
  // Reset on touch devices, it doesn't add specificity
103
103
  '@media (hover: none)': {
104
- backgroundColor: theme.palette[ownerState.color].main
104
+ backgroundColor: (theme.vars || theme).palette[ownerState.color].main
105
105
  }
106
106
  }),
107
107
  '&:active': _extends({}, ownerState.variant === 'contained' && {
108
- boxShadow: theme.shadows[8]
108
+ boxShadow: (theme.vars || theme).shadows[8]
109
109
  }),
110
110
  [`&.${buttonClasses.focusVisible}`]: _extends({}, ownerState.variant === 'contained' && {
111
- boxShadow: theme.shadows[6]
111
+ boxShadow: (theme.vars || theme).shadows[6]
112
112
  }),
113
113
  [`&.${buttonClasses.disabled}`]: _extends({
114
- color: theme.palette.action.disabled
114
+ color: (theme.vars || theme).palette.action.disabled
115
115
  }, ownerState.variant === 'outlined' && {
116
- border: `1px solid ${theme.palette.action.disabledBackground}`
116
+ border: `1px solid ${(theme.vars || theme).palette.action.disabledBackground}`
117
117
  }, ownerState.variant === 'outlined' && ownerState.color === 'secondary' && {
118
- border: `1px solid ${theme.palette.action.disabled}`
118
+ border: `1px solid ${(theme.vars || theme).palette.action.disabled}`
119
119
  }, ownerState.variant === 'contained' && {
120
- color: theme.palette.action.disabled,
121
- boxShadow: theme.shadows[0],
122
- backgroundColor: theme.palette.action.disabledBackground
120
+ color: (theme.vars || theme).palette.action.disabled,
121
+ boxShadow: (theme.vars || theme).shadows[0],
122
+ backgroundColor: (theme.vars || theme).palette.action.disabledBackground
123
123
  })
124
124
  }, ownerState.variant === 'text' && {
125
125
  padding: '6px 8px'
126
126
  }, ownerState.variant === 'text' && ownerState.color !== 'inherit' && {
127
- color: theme.palette[ownerState.color].main
127
+ color: (theme.vars || theme).palette[ownerState.color].main
128
128
  }, ownerState.variant === 'outlined' && {
129
129
  padding: '5px 15px',
130
- border: `1px solid ${theme.palette.mode === 'light' ? 'rgba(0, 0, 0, 0.23)' : 'rgba(255, 255, 255, 0.23)'}`
130
+ border: '1px solid currentColor'
131
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)}`
132
+ color: (theme.vars || theme).palette[ownerState.color].main,
133
+ border: theme.vars ? `1px solid rgba(${theme.vars.palette[ownerState.color].mainChannel} / 0.5)` : `1px solid ${alpha(theme.palette[ownerState.color].main, 0.5)}`
134
134
  }, ownerState.variant === 'contained' && {
135
- color: theme.palette.getContrastText(theme.palette.grey[300]),
136
- backgroundColor: theme.palette.grey[300],
137
- boxShadow: theme.shadows[2]
135
+ color: theme.vars ? // this is safe because grey does not change between default light/dark mode
136
+ theme.vars.palette.text.primary : theme.palette.getContrastText?.(theme.palette.grey[300]),
137
+ backgroundColor: (theme.vars || theme).palette.grey[300],
138
+ boxShadow: (theme.vars || theme).shadows[2]
138
139
  }, ownerState.variant === 'contained' && ownerState.color !== 'inherit' && {
139
- color: theme.palette[ownerState.color].contrastText,
140
- backgroundColor: theme.palette[ownerState.color].main
140
+ color: (theme.vars || theme).palette[ownerState.color].contrastText,
141
+ backgroundColor: (theme.vars || theme).palette[ownerState.color].main
141
142
  }, ownerState.color === 'inherit' && {
142
143
  color: 'inherit',
143
144
  borderColor: 'currentColor'
@@ -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", "color", "component", "onBlur", "onFocus", "TypographyClasses", "underline", "variant"];
3
+ const _excluded = ["className", "color", "component", "onBlur", "onFocus", "TypographyClasses", "underline", "variant", "sx"];
4
4
  import * as React from 'react';
5
5
  import PropTypes from 'prop-types';
6
6
  import clsx from 'clsx';
@@ -9,6 +9,7 @@ import { unstable_composeClasses as composeClasses } from '@mui/base';
9
9
  import { alpha, getPath } from '@mui/system';
10
10
  import capitalize from '../utils/capitalize';
11
11
  import styled from '../styles/styled';
12
+ import useTheme from '../styles/useTheme';
12
13
  import useThemeProps from '../styles/useThemeProps';
13
14
  import useIsFocusVisible from '../utils/useIsFocusVisible';
14
15
  import useForkRef from '../utils/useForkRef';
@@ -97,6 +98,7 @@ const LinkRoot = styled(Typography, {
97
98
  });
98
99
  });
99
100
  const Link = /*#__PURE__*/React.forwardRef(function Link(inProps, ref) {
101
+ const theme = useTheme();
100
102
  const props = useThemeProps({
101
103
  props: inProps,
102
104
  name: 'MuiLink'
@@ -110,7 +112,8 @@ const Link = /*#__PURE__*/React.forwardRef(function Link(inProps, ref) {
110
112
  onFocus,
111
113
  TypographyClasses,
112
114
  underline = 'always',
113
- variant = 'inherit'
115
+ variant = 'inherit',
116
+ sx
114
117
  } = props,
115
118
  other = _objectWithoutPropertiesLoose(props, _excluded);
116
119
 
@@ -148,7 +151,9 @@ const Link = /*#__PURE__*/React.forwardRef(function Link(inProps, ref) {
148
151
  };
149
152
 
150
153
  const ownerState = _extends({}, props, {
151
- color,
154
+ // It is too complex to support any types of `sx`.
155
+ // Need to find a better way to get rid of the color manipulation for `textDecorationColor`.
156
+ color: (typeof sx === 'function' ? sx(theme).color : sx?.color) || color,
152
157
  component,
153
158
  focusVisible,
154
159
  underline,
@@ -159,13 +164,15 @@ const Link = /*#__PURE__*/React.forwardRef(function Link(inProps, ref) {
159
164
  return /*#__PURE__*/_jsx(LinkRoot, _extends({
160
165
  className: clsx(classes.root, className),
161
166
  classes: TypographyClasses,
162
- color: color,
163
167
  component: component,
164
168
  onBlur: handleBlur,
165
169
  onFocus: handleFocus,
166
170
  ref: handlerRef,
167
171
  ownerState: ownerState,
168
- variant: variant
172
+ variant: variant,
173
+ sx: [{
174
+ color: colorTransformations[color] || color
175
+ }, ...(Array.isArray(sx) ? sx : [sx])]
169
176
  }, other));
170
177
  });
171
178
  process.env.NODE_ENV !== "production" ? Link.propTypes
@@ -53,6 +53,7 @@ const ListItemButtonRoot = styled(ButtonBase, {
53
53
  alignItems: 'center',
54
54
  position: 'relative',
55
55
  textDecoration: 'none',
56
+ minWidth: 0,
56
57
  boxSizing: 'border-box',
57
58
  textAlign: 'left',
58
59
  paddingTop: 8,
package/modern/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license MUI v5.5.3
1
+ /** @license MUI v5.6.0
2
2
  *
3
3
  * This source code is licensed under the MIT license found in the
4
4
  * LICENSE file in the root directory of this source tree.
@@ -1047,9 +1047,12 @@ export const etEE = {
1047
1047
 
1048
1048
  return 'Vali eelmine lehekülg';
1049
1049
  },
1050
- labelRowsPerPage: 'Ridu leheküljel:' // labelDisplayedRows: ({ from, to, count }) =>
1051
- // `${from}–${to} / ${count !== -1 ? count : `more than ${to}`}`,
1052
-
1050
+ labelRowsPerPage: 'Ridu leheküljel:',
1051
+ labelDisplayedRows: ({
1052
+ from,
1053
+ to,
1054
+ count
1055
+ }) => `${from}–${to} / ${count !== -1 ? count : `rohkem kui ${to}`}`
1053
1056
  }
1054
1057
  },
1055
1058
  MuiRating: {
@@ -0,0 +1,28 @@
1
+ import _extends from "@babel/runtime/helpers/esm/extends";
2
+
3
+ /* eslint-disable @typescript-eslint/naming-convention */
4
+ import { unstable_createCssVarsProvider as createCssVarsProvider } from '@mui/system';
5
+ import experimental_extendTheme from './experimental_extendTheme';
6
+ import createTypography from './createTypography';
7
+ const defaultTheme = experimental_extendTheme();
8
+ const {
9
+ CssVarsProvider: Experimental_CssVarsProvider,
10
+ useColorScheme,
11
+ getInitColorSchemeScript
12
+ } = createCssVarsProvider({
13
+ theme: defaultTheme,
14
+ defaultColorScheme: {
15
+ light: 'light',
16
+ dark: 'dark'
17
+ },
18
+ prefix: 'md',
19
+ resolveTheme: theme => {
20
+ const newTheme = _extends({}, theme, {
21
+ typography: createTypography(theme.palette, theme.typography)
22
+ });
23
+
24
+ return newTheme;
25
+ },
26
+ shouldSkipGeneratingVar: keys => !!keys[0].match(/(typography|mixins|breakpoints|direction|transitions)/)
27
+ });
28
+ export { useColorScheme, getInitColorSchemeScript, Experimental_CssVarsProvider };
@@ -0,0 +1,89 @@
1
+ import _extends from "@babel/runtime/helpers/esm/extends";
2
+ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
+ const _excluded = ["colorSchemes", "opacity"],
4
+ _excluded2 = ["palette"];
5
+ import { deepmerge } from '@mui/utils';
6
+ import { colorChannel } from '@mui/system';
7
+ import createThemeWithoutVars from './createTheme';
8
+ import createPalette from './createPalette';
9
+ export const defaultOpacity = {
10
+ active: 0.54,
11
+ hover: 0.04,
12
+ selected: 0.08,
13
+ disabled: 0.26,
14
+ focus: 0.12
15
+ };
16
+
17
+ function createTheme(options = {}, ...args) {
18
+ const {
19
+ colorSchemes: colorSchemesInput = {},
20
+ opacity: opacityInput = {}
21
+ } = options,
22
+ input = _objectWithoutPropertiesLoose(options, _excluded); // eslint-disable-next-line prefer-const
23
+
24
+
25
+ let _createThemeWithoutVa = createThemeWithoutVars(_extends({}, input, colorSchemesInput.light && {
26
+ palette: colorSchemesInput.light?.palette
27
+ })),
28
+ {
29
+ palette: lightPalette
30
+ } = _createThemeWithoutVa,
31
+ muiTheme = _objectWithoutPropertiesLoose(_createThemeWithoutVa, _excluded2);
32
+
33
+ const {
34
+ palette: darkPalette
35
+ } = createThemeWithoutVars({
36
+ palette: _extends({
37
+ mode: 'dark'
38
+ }, colorSchemesInput.dark?.palette)
39
+ });
40
+ colorSchemesInput.light = {
41
+ palette: lightPalette
42
+ };
43
+ colorSchemesInput.dark = {
44
+ palette: darkPalette
45
+ };
46
+ const colorSchemes = {};
47
+ Object.keys(colorSchemesInput).forEach(key => {
48
+ const palette = createPalette(colorSchemesInput[key].palette);
49
+ Object.keys(palette).forEach(color => {
50
+ const colors = palette[color];
51
+
52
+ if (colors.main) {
53
+ palette[color].mainChannel = colorChannel(colors.main);
54
+ }
55
+
56
+ if (colors.light) {
57
+ palette[color].lightChannel = colorChannel(colors.light);
58
+ }
59
+
60
+ if (colors.dark) {
61
+ palette[color].darkChannel = colorChannel(colors.dark);
62
+ }
63
+
64
+ if (colors.primary) {
65
+ palette[color].primaryChannel = colorChannel(colors.primary);
66
+ }
67
+
68
+ if (colors.secondary) {
69
+ palette[color].secondaryChannel = colorChannel(colors.secondary);
70
+ }
71
+
72
+ if (colors.disabled) {
73
+ palette[color].disabledChannel = colorChannel(colors.disabled);
74
+ }
75
+ });
76
+ colorSchemes[key] = {
77
+ palette
78
+ };
79
+ });
80
+
81
+ const opacity = _extends({}, defaultOpacity, opacityInput);
82
+
83
+ muiTheme.colorSchemes = colorSchemes;
84
+ muiTheme.opacity = opacity;
85
+ muiTheme = args.reduce((acc, argument) => deepmerge(acc, argument), muiTheme);
86
+ return muiTheme;
87
+ }
88
+
89
+ export default createTheme;
@@ -16,4 +16,6 @@ export { StyledEngineProvider } from '@mui/system'; // The legacy utilities from
16
16
 
17
17
  export { default as makeStyles } from './makeStyles';
18
18
  export { default as withStyles } from './withStyles';
19
- export { default as withTheme } from './withTheme';
19
+ export { default as withTheme } from './withTheme';
20
+ export * from './CssVarsProvider';
21
+ export { default as experimental_extendTheme } from './experimental_extendTheme';