@mui/material 5.1.1 → 5.2.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 (160) 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/BottomNavigation/BottomNavigation.js +0 -0
  12. package/BottomNavigation/bottomNavigationClasses.d.ts +8 -8
  13. package/BottomNavigationAction/bottomNavigationActionClasses.d.ts +14 -14
  14. package/Breadcrumbs/breadcrumbsClasses.d.ts +14 -14
  15. package/Button/buttonClasses.d.ts +76 -76
  16. package/ButtonBase/buttonBaseClasses.d.ts +12 -12
  17. package/ButtonBase/touchRippleClasses.d.ts +20 -20
  18. package/ButtonGroup/ButtonGroupContext.d.ts +18 -18
  19. package/ButtonGroup/buttonGroupClasses.d.ts +58 -58
  20. package/CHANGELOG.md +93 -2
  21. package/Card/cardClasses.d.ts +8 -8
  22. package/CardActionArea/cardActionAreaClasses.d.ts +12 -12
  23. package/CardActions/cardActionsClasses.d.ts +10 -10
  24. package/CardContent/cardContentClasses.d.ts +8 -8
  25. package/CardHeader/cardHeaderClasses.d.ts +18 -18
  26. package/CardMedia/cardMediaClasses.d.ts +12 -12
  27. package/Checkbox/checkboxClasses.d.ts +18 -18
  28. package/Chip/chipClasses.d.ts +80 -80
  29. package/CircularProgress/circularProgressClasses.d.ts +26 -26
  30. package/ClickAwayListener/index.d.ts +2 -2
  31. package/Collapse/collapseClasses.d.ts +18 -18
  32. package/Container/containerClasses.d.ts +22 -22
  33. package/Dialog/DialogContext.d.ts +6 -6
  34. package/Dialog/dialogClasses.d.ts +36 -36
  35. package/DialogActions/dialogActionsClasses.d.ts +10 -10
  36. package/DialogContent/dialogContentClasses.d.ts +10 -10
  37. package/DialogContentText/dialogContentTextClasses.d.ts +8 -8
  38. package/DialogTitle/dialogTitleClasses.d.ts +8 -8
  39. package/Divider/dividerClasses.d.ts +34 -34
  40. package/Drawer/drawerClasses.d.ts +30 -30
  41. package/Fab/fabClasses.d.ts +26 -26
  42. package/FilledInput/filledInputClasses.d.ts +40 -40
  43. package/FormControl/formControlClasses.d.ts +14 -14
  44. package/FormControlLabel/formControlLabelClasses.d.ts +18 -18
  45. package/FormGroup/formGroupClasses.d.ts +10 -10
  46. package/FormHelperText/formHelperTextClasses.d.ts +22 -22
  47. package/FormLabel/formLabelClasses.d.ts +22 -22
  48. package/Grid/gridClasses.d.ts +48 -48
  49. package/Icon/iconClasses.d.ts +24 -24
  50. package/IconButton/IconButton.js +6 -4
  51. package/IconButton/iconButtonClasses.d.ts +26 -26
  52. package/ImageList/imageListClasses.d.ts +16 -16
  53. package/ImageListItem/imageListItemClasses.d.ts +18 -18
  54. package/ImageListItemBar/imageListItemBarClasses.d.ts +30 -30
  55. package/Input/inputClasses.d.ts +34 -34
  56. package/InputAdornment/inputAdornmentClasses.d.ts +24 -24
  57. package/InputBase/inputBaseClasses.d.ts +44 -44
  58. package/InputLabel/inputLabelClasses.d.ts +32 -32
  59. package/LinearProgress/linearProgressClasses.d.ts +42 -42
  60. package/Link/linkClasses.d.ts +18 -18
  61. package/List/listClasses.d.ts +14 -14
  62. package/ListItem/listItemClasses.d.ts +30 -30
  63. package/ListItemAvatar/listItemAvatarClasses.d.ts +10 -10
  64. package/ListItemButton/listItemButtonClasses.d.ts +22 -22
  65. package/ListItemIcon/listItemIconClasses.d.ts +10 -10
  66. package/ListItemSecondaryAction/listItemSecondaryActionClasses.d.ts +10 -10
  67. package/ListItemText/listItemTextClasses.d.ts +18 -18
  68. package/ListSubheader/listSubheaderClasses.d.ts +18 -18
  69. package/Menu/menuClasses.d.ts +12 -12
  70. package/MenuItem/menuItemClasses.d.ts +20 -20
  71. package/MobileStepper/mobileStepperClasses.d.ts +22 -22
  72. package/NativeSelect/nativeSelectClasses.d.ts +32 -32
  73. package/OutlinedInput/outlinedInputClasses.d.ts +36 -36
  74. package/Pagination/paginationClasses.d.ts +14 -14
  75. package/PaginationItem/paginationItemClasses.d.ts +42 -42
  76. package/Paper/paperClasses.d.ts +39 -39
  77. package/Popover/popoverClasses.d.ts +10 -10
  78. package/Popper/Popper.d.ts +17 -17
  79. package/Popper/Popper.js +4 -23
  80. package/Radio/radioClasses.d.ts +16 -16
  81. package/RadioGroup/RadioGroupContext.d.ts +11 -11
  82. package/RadioGroup/useRadioGroup.d.ts +4 -4
  83. package/Rating/ratingClasses.d.ts +40 -40
  84. package/ScopedCssBaseline/scopedCssBaselineClasses.d.ts +8 -8
  85. package/Select/SelectInput.js +1 -1
  86. package/Select/selectClasses.d.ts +30 -30
  87. package/Skeleton/skeletonClasses.d.ts +24 -24
  88. package/Snackbar/snackbarClasses.d.ts +20 -20
  89. package/SnackbarContent/snackbarContentClasses.d.ts +12 -12
  90. package/SpeedDial/speedDialClasses.d.ts +22 -22
  91. package/SpeedDialAction/speedDialActionClasses.d.ts +20 -20
  92. package/SpeedDialIcon/speedDialIconClasses.d.ts +18 -18
  93. package/Step/stepClasses.d.ts +16 -16
  94. package/StepButton/stepButtonClasses.d.ts +14 -14
  95. package/StepConnector/stepConnectorClasses.d.ts +26 -26
  96. package/StepContent/stepContentClasses.d.ts +12 -12
  97. package/StepIcon/stepIconClasses.d.ts +16 -16
  98. package/StepLabel/stepLabelClasses.d.ts +28 -28
  99. package/Stepper/stepperClasses.d.ts +14 -14
  100. package/SvgIcon/svgIconClasses.d.ts +24 -24
  101. package/Switch/switchClasses.d.ts +32 -32
  102. package/Tab/tabClasses.d.ts +26 -26
  103. package/TabScrollButton/tabScrollButtonClasses.d.ts +12 -12
  104. package/Table/tableClasses.d.ts +10 -10
  105. package/TableBody/tableBodyClasses.d.ts +8 -8
  106. package/TableCell/tableCellClasses.d.ts +32 -32
  107. package/TableContainer/tableContainerClasses.d.ts +8 -8
  108. package/TableFooter/tableFooterClasses.d.ts +8 -8
  109. package/TableHead/tableHeadClasses.d.ts +8 -8
  110. package/TablePagination/tablePaginationClasses.d.ts +28 -28
  111. package/TableRow/tableRowClasses.d.ts +16 -16
  112. package/TableSortLabel/tableSortLabelClasses.d.ts +16 -16
  113. package/Tabs/tabsClasses.d.ts +32 -32
  114. package/TextField/textFieldClasses.d.ts +8 -8
  115. package/ToggleButton/toggleButtonClasses.d.ts +24 -24
  116. package/ToggleButtonGroup/toggleButtonGroupClasses.d.ts +18 -18
  117. package/Toolbar/toolbarClasses.d.ts +14 -14
  118. package/Tooltip/tooltipClasses.d.ts +30 -30
  119. package/Typography/typographyClasses.d.ts +50 -50
  120. package/darkScrollbar/index.d.ts +28 -28
  121. package/index.js +1 -1
  122. package/internal/switchBaseClasses.d.ts +12 -12
  123. package/legacy/BottomNavigation/BottomNavigation.js +0 -0
  124. package/legacy/IconButton/IconButton.js +6 -4
  125. package/legacy/Popper/Popper.js +4 -23
  126. package/legacy/Select/SelectInput.js +1 -1
  127. package/legacy/index.js +1 -1
  128. package/legacy/locale/index.js +191 -108
  129. package/legacy/useMediaQuery/useMediaQuery.js +83 -31
  130. package/locale/index.d.ts +66 -65
  131. package/locale/index.js +80 -0
  132. package/modern/BottomNavigation/BottomNavigation.js +0 -0
  133. package/modern/IconButton/IconButton.js +6 -4
  134. package/modern/Popper/Popper.js +4 -23
  135. package/modern/Select/SelectInput.js +1 -1
  136. package/modern/index.js +1 -1
  137. package/modern/locale/index.js +80 -0
  138. package/modern/useMediaQuery/useMediaQuery.js +65 -26
  139. package/node/BottomNavigation/BottomNavigation.js +0 -0
  140. package/node/IconButton/IconButton.js +6 -4
  141. package/node/Popper/Popper.js +3 -22
  142. package/node/Select/SelectInput.js +1 -1
  143. package/node/index.js +1 -1
  144. package/node/locale/index.js +82 -1
  145. package/node/useMediaQuery/useMediaQuery.js +65 -26
  146. package/package.json +5 -5
  147. package/styles/variants.d.ts +3 -2
  148. package/transitions/index.d.ts +1 -1
  149. package/transitions/transition.d.ts +14 -14
  150. package/transitions/utils.d.ts +23 -23
  151. package/umd/material-ui.development.js +1086 -137
  152. package/umd/material-ui.production.min.js +21 -21
  153. package/useMediaQuery/useMediaQuery.d.ts +31 -27
  154. package/useMediaQuery/useMediaQuery.js +65 -26
  155. package/useTouchRipple/index.d.ts +1 -1
  156. package/useTouchRipple/useTouchRipple.d.ts +28 -28
  157. package/utils/getScrollbarSize.d.ts +2 -2
  158. package/utils/ownerDocument.d.ts +2 -2
  159. package/utils/ownerWindow.d.ts +2 -2
  160. package/utils/setRef.d.ts +2 -2
@@ -1,3 +1,4 @@
1
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
1
2
  import * as React from 'react';
2
3
  import { getThemeProps, useThemeWithoutDefault as useTheme } from '@mui/system';
3
4
  import useEnhancedEffect from '../utils/useEnhancedEffect';
@@ -5,38 +6,9 @@ import useEnhancedEffect from '../utils/useEnhancedEffect';
5
6
  * @deprecated Not used internally. Use `MediaQueryListEvent` from lib.dom.d.ts instead.
6
7
  */
7
8
 
8
- export default function useMediaQuery(queryInput) {
9
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
10
- var theme = useTheme(); // Wait for jsdom to support the match media feature.
11
- // All the browsers MUI support have this built-in.
12
- // This defensive check is here for simplicity.
13
- // Most of the time, the match media logic isn't central to people tests.
14
-
9
+ function useMediaQueryOld(query, defaultMatches, matchMedia, ssrMatchMedia, noSsr) {
15
10
  var supportMatchMedia = typeof window !== 'undefined' && typeof window.matchMedia !== 'undefined';
16
11
 
17
- var _getThemeProps = getThemeProps({
18
- name: 'MuiUseMediaQuery',
19
- props: options,
20
- theme: theme
21
- }),
22
- _getThemeProps$defaul = _getThemeProps.defaultMatches,
23
- defaultMatches = _getThemeProps$defaul === void 0 ? false : _getThemeProps$defaul,
24
- _getThemeProps$matchM = _getThemeProps.matchMedia,
25
- matchMedia = _getThemeProps$matchM === void 0 ? supportMatchMedia ? window.matchMedia : null : _getThemeProps$matchM,
26
- _getThemeProps$noSsr = _getThemeProps.noSsr,
27
- noSsr = _getThemeProps$noSsr === void 0 ? false : _getThemeProps$noSsr,
28
- _getThemeProps$ssrMat = _getThemeProps.ssrMatchMedia,
29
- ssrMatchMedia = _getThemeProps$ssrMat === void 0 ? null : _getThemeProps$ssrMat;
30
-
31
- if (process.env.NODE_ENV !== 'production') {
32
- if (typeof queryInput === 'function' && theme === null) {
33
- console.error(['MUI: The `query` argument provided is invalid.', 'You are providing a function without a theme in the context.', 'One of the parent elements needs to use a ThemeProvider.'].join('\n'));
34
- }
35
- }
36
-
37
- var query = typeof queryInput === 'function' ? queryInput(theme) : queryInput;
38
- query = query.replace(/^@media( ?)/m, '');
39
-
40
12
  var _React$useState = React.useState(function () {
41
13
  if (noSsr && supportMatchMedia) {
42
14
  return matchMedia(query).matches;
@@ -73,13 +45,93 @@ export default function useMediaQuery(queryInput) {
73
45
  }
74
46
  };
75
47
 
76
- updateMatch();
48
+ updateMatch(); // TODO: Use `addEventListener` once support for Safari < 14 is dropped
49
+
77
50
  queryList.addListener(updateMatch);
78
51
  return function () {
79
52
  active = false;
80
53
  queryList.removeListener(updateMatch);
81
54
  };
82
55
  }, [query, matchMedia, supportMatchMedia]);
56
+ return match;
57
+ }
58
+
59
+ function useMediaQueryNew(query, defaultMatches, matchMedia, ssrMatchMedia) {
60
+ var getDefaultSnapshot = React.useCallback(function () {
61
+ return defaultMatches;
62
+ }, [defaultMatches]);
63
+ var getServerSnapshot = React.useMemo(function () {
64
+ if (ssrMatchMedia !== null) {
65
+ var _ssrMatchMedia = ssrMatchMedia(query),
66
+ matches = _ssrMatchMedia.matches;
67
+
68
+ return function () {
69
+ return matches;
70
+ };
71
+ }
72
+
73
+ return getDefaultSnapshot;
74
+ }, [getDefaultSnapshot, query, ssrMatchMedia]);
75
+
76
+ var _React$useMemo = React.useMemo(function () {
77
+ if (matchMedia === null) {
78
+ return [getDefaultSnapshot, function () {
79
+ return function () {};
80
+ }];
81
+ }
82
+
83
+ var mediaQueryList = matchMedia(query);
84
+ return [function () {
85
+ return mediaQueryList.matches;
86
+ }, function (notify) {
87
+ // TODO: Use `addEventListener` once support for Safari < 14 is dropped
88
+ mediaQueryList.addListener(notify);
89
+ return function () {
90
+ mediaQueryList.removeListener(notify);
91
+ };
92
+ }];
93
+ }, [getDefaultSnapshot, matchMedia, query]),
94
+ _React$useMemo2 = _slicedToArray(_React$useMemo, 2),
95
+ getSnapshot = _React$useMemo2[0],
96
+ subscribe = _React$useMemo2[1];
97
+
98
+ var match = React.useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
99
+ return match;
100
+ }
101
+
102
+ export default function useMediaQuery(queryInput) {
103
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
104
+ var theme = useTheme(); // Wait for jsdom to support the match media feature.
105
+ // All the browsers MUI support have this built-in.
106
+ // This defensive check is here for simplicity.
107
+ // Most of the time, the match media logic isn't central to people tests.
108
+
109
+ var supportMatchMedia = typeof window !== 'undefined' && typeof window.matchMedia !== 'undefined';
110
+
111
+ var _getThemeProps = getThemeProps({
112
+ name: 'MuiUseMediaQuery',
113
+ props: options,
114
+ theme: theme
115
+ }),
116
+ _getThemeProps$defaul = _getThemeProps.defaultMatches,
117
+ defaultMatches = _getThemeProps$defaul === void 0 ? false : _getThemeProps$defaul,
118
+ _getThemeProps$matchM = _getThemeProps.matchMedia,
119
+ matchMedia = _getThemeProps$matchM === void 0 ? supportMatchMedia ? window.matchMedia : null : _getThemeProps$matchM,
120
+ _getThemeProps$ssrMat = _getThemeProps.ssrMatchMedia,
121
+ ssrMatchMedia = _getThemeProps$ssrMat === void 0 ? null : _getThemeProps$ssrMat,
122
+ noSsr = _getThemeProps.noSsr;
123
+
124
+ if (process.env.NODE_ENV !== 'production') {
125
+ if (typeof queryInput === 'function' && theme === null) {
126
+ console.error(['MUI: The `query` argument provided is invalid.', 'You are providing a function without a theme in the context.', 'One of the parent elements needs to use a ThemeProvider.'].join('\n'));
127
+ }
128
+ }
129
+
130
+ var query = typeof queryInput === 'function' ? queryInput(theme) : queryInput;
131
+ query = query.replace(/^@media( ?)/m, ''); // TODO: Drop `useMediaQueryOld` and use `use-sync-external-store` shim in `useMediaQueryNew` once the package is stable
132
+
133
+ var useMediaQueryImplementation = React.useSyncExternalStore !== undefined ? useMediaQueryNew : useMediaQueryOld;
134
+ var match = useMediaQueryImplementation(query, defaultMatches, matchMedia, ssrMatchMedia, noSsr);
83
135
 
84
136
  if (process.env.NODE_ENV !== 'production') {
85
137
  // eslint-disable-next-line react-hooks/rules-of-hooks
package/locale/index.d.ts CHANGED
@@ -1,65 +1,66 @@
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 arEG: Localization;
25
- export declare const arSD: Localization;
26
- export declare const azAZ: Localization;
27
- export declare const bnBD: Localization;
28
- export declare const bgBG: Localization;
29
- export declare const caES: Localization;
30
- export declare const csCZ: Localization;
31
- export declare const deDE: Localization;
32
- export declare const elGR: Localization;
33
- export declare const enUS: Localization;
34
- export declare const esES: Localization;
35
- export declare const etEE: Localization;
36
- export declare const faIR: Localization;
37
- export declare const fiFI: Localization;
38
- export declare const frFR: Localization;
39
- export declare const heIL: Localization;
40
- export declare const hiIN: Localization;
41
- export declare const huHU: Localization;
42
- export declare const hyAM: Localization;
43
- export declare const idID: Localization;
44
- export declare const isIS: Localization;
45
- export declare const itIT: Localization;
46
- export declare const jaJP: Localization;
47
- export declare const khKH: Localization;
48
- export declare const koKR: Localization;
49
- export declare const kzKZ: Localization;
50
- export declare const nlNL: Localization;
51
- export declare const plPL: Localization;
52
- export declare const ptBR: Localization;
53
- export declare const ptPT: Localization;
54
- export declare const roRO: Localization;
55
- export declare const ruRU: Localization;
56
- export declare const siLK: Localization;
57
- export declare const skSK: Localization;
58
- export declare const svSE: Localization;
59
- export declare const thTH: Localization;
60
- export declare const trTR: Localization;
61
- export declare const ukUA: Localization;
62
- export declare const viVN: Localization;
63
- export declare const zhCN: Localization;
64
- export declare const zhHK: Localization;
65
- 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 deDE: Localization;
33
+ export declare const elGR: Localization;
34
+ export declare const enUS: Localization;
35
+ export declare const esES: Localization;
36
+ export declare const etEE: Localization;
37
+ export declare const faIR: Localization;
38
+ export declare const fiFI: Localization;
39
+ export declare const frFR: Localization;
40
+ export declare const heIL: Localization;
41
+ export declare const hiIN: Localization;
42
+ export declare const huHU: Localization;
43
+ export declare const hyAM: Localization;
44
+ export declare const idID: Localization;
45
+ export declare const isIS: Localization;
46
+ export declare const itIT: Localization;
47
+ export declare const jaJP: Localization;
48
+ export declare const khKH: Localization;
49
+ export declare const koKR: Localization;
50
+ export declare const kzKZ: Localization;
51
+ export declare const nlNL: Localization;
52
+ export declare const plPL: Localization;
53
+ export declare const ptBR: Localization;
54
+ export declare const ptPT: Localization;
55
+ export declare const roRO: Localization;
56
+ export declare const ruRU: Localization;
57
+ export declare const siLK: Localization;
58
+ export declare const skSK: Localization;
59
+ export declare const svSE: Localization;
60
+ export declare const thTH: Localization;
61
+ export declare const trTR: Localization;
62
+ export declare const ukUA: Localization;
63
+ export declare const viVN: Localization;
64
+ export declare const zhCN: Localization;
65
+ export declare const zhHK: Localization;
66
+ export declare const zhTW: Localization;
package/locale/index.js CHANGED
@@ -1,3 +1,83 @@
1
+ export const amET = {
2
+ components: {
3
+ MuiBreadcrumbs: {
4
+ defaultProps: {
5
+ expandText: 'መንገድ አሳይ'
6
+ }
7
+ },
8
+ MuiTablePagination: {
9
+ defaultProps: {
10
+ getItemAriaLabel: type => {
11
+ if (type === 'first') {
12
+ return 'ወደ መጀመሪያው ገጽ ይሂዱ';
13
+ }
14
+
15
+ if (type === 'last') {
16
+ return 'ወደ መጨረሻው ገጽ ይሂዱ';
17
+ }
18
+
19
+ if (type === 'next') {
20
+ return 'ወደ ቀጣዩ ገጽ ይሂዱ';
21
+ } // if (type === 'previous') {
22
+
23
+
24
+ return 'ወደ ቀዳሚው ገጽ ይሂዱ';
25
+ },
26
+ labelRowsPerPage: 'ረድፎች በአንድ ገጽ:',
27
+ labelDisplayedRows: ({
28
+ from,
29
+ to,
30
+ count
31
+ }) => `${from}-${to} ከ ${count !== -1 ? count : `${to} በላይ`}`
32
+ }
33
+ },
34
+ MuiRating: {
35
+ defaultProps: {
36
+ getLabelText: value => `${value} ኮከ${value !== 1 ? 'ቦች' : 'ብ'}`,
37
+ emptyLabelText: 'ባዶ'
38
+ }
39
+ },
40
+ MuiAutocomplete: {
41
+ defaultProps: {
42
+ clearText: 'አጽዳ',
43
+ closeText: 'ዝጋ',
44
+ loadingText: 'በመጫን ላይ…',
45
+ noOptionsText: 'አማራጮች የሉም',
46
+ openText: 'ክፈት'
47
+ }
48
+ },
49
+ MuiAlert: {
50
+ defaultProps: {
51
+ closeText: 'ዝጋ'
52
+ }
53
+ },
54
+ MuiPagination: {
55
+ defaultProps: {
56
+ 'aria-label': 'የገጽ አሰሳ',
57
+ getItemAriaLabel: (type, page, selected) => {
58
+ if (type === 'page') {
59
+ return `${selected ? '' : 'ወደ '}ገጽ ${page}${selected ? '' : ' ሂድ'}`;
60
+ }
61
+
62
+ if (type === 'first') {
63
+ return 'ወደ መጀመሪያው ገጽ ይሂዱ';
64
+ }
65
+
66
+ if (type === 'last') {
67
+ return 'ወደ መጨረሻው ገጽ ይሂዱ';
68
+ }
69
+
70
+ if (type === 'next') {
71
+ return 'ወደ ቀጣዩ ገጽ ይሂዱ';
72
+ } // if (type === 'previous') {
73
+
74
+
75
+ return 'ወደ ቀዳሚው ገጽ ይሂዱ';
76
+ }
77
+ }
78
+ }
79
+ }
80
+ };
1
81
  export const arEG = {
2
82
  components: {
3
83
  MuiBreadcrumbs: {
File without changes
@@ -51,7 +51,8 @@ const IconButtonRoot = styled(ButtonBase, {
51
51
  color: theme.palette.action.active,
52
52
  transition: theme.transitions.create('background-color', {
53
53
  duration: theme.transitions.duration.shortest
54
- }),
54
+ })
55
+ }, !ownerState.disableRipple && {
55
56
  '&:hover': {
56
57
  backgroundColor: alpha(theme.palette.action.active, theme.palette.action.hoverOpacity),
57
58
  // Reset on touch devices, it doesn't add specificity
@@ -68,8 +69,9 @@ const IconButtonRoot = styled(ButtonBase, {
68
69
  ownerState
69
70
  }) => _extends({}, ownerState.color === 'inherit' && {
70
71
  color: 'inherit'
71
- }, ownerState.color !== 'inherit' && ownerState.color !== 'default' && {
72
- color: theme.palette[ownerState.color].main,
72
+ }, ownerState.color !== 'inherit' && ownerState.color !== 'default' && _extends({
73
+ color: theme.palette[ownerState.color].main
74
+ }, !ownerState.disableRipple && {
73
75
  '&:hover': {
74
76
  backgroundColor: alpha(theme.palette[ownerState.color].main, theme.palette.action.hoverOpacity),
75
77
  // Reset on touch devices, it doesn't add specificity
@@ -77,7 +79,7 @@ const IconButtonRoot = styled(ButtonBase, {
77
79
  backgroundColor: 'transparent'
78
80
  }
79
81
  }
80
- }, ownerState.size === 'small' && {
82
+ }), ownerState.size === 'small' && {
81
83
  padding: 5,
82
84
  fontSize: theme.typography.pxToRem(18)
83
85
  }, ownerState.size === 'large' && {
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import * as React from 'react';
3
3
  import PropTypes from 'prop-types';
4
4
  import PopperUnstyled from '@mui/base/PopperUnstyled';
5
- import { chainPropTypes, HTMLElementType, refType } from '@mui/utils';
5
+ import { HTMLElementType, refType } from '@mui/utils';
6
6
  import { useThemeWithoutDefault as useTheme } from '@mui/system';
7
7
  import { jsx as _jsx } from "react/jsx-runtime";
8
8
 
@@ -26,11 +26,6 @@ const Popper = /*#__PURE__*/React.forwardRef(function Popper(props, ref) {
26
26
  ref: ref
27
27
  }));
28
28
  });
29
-
30
- function resolveAnchorEl(anchorEl) {
31
- return typeof anchorEl === 'function' ? anchorEl() : anchorEl;
32
- }
33
-
34
29
  process.env.NODE_ENV !== "production" ? Popper.propTypes
35
30
  /* remove-proptypes */
36
31
  = {
@@ -45,23 +40,9 @@ process.env.NODE_ENV !== "production" ? Popper.propTypes
45
40
  * It's used to set the position of the popper.
46
41
  * The return value will passed as the reference object of the Popper instance.
47
42
  */
48
- anchorEl: chainPropTypes(PropTypes.oneOfType([HTMLElementType, PropTypes.object, PropTypes.func]), props => {
49
- if (props.open) {
50
- const resolvedAnchorEl = resolveAnchorEl(props.anchorEl);
51
-
52
- if (resolvedAnchorEl && resolvedAnchorEl.nodeType === 1) {
53
- const box = resolvedAnchorEl.getBoundingClientRect();
54
-
55
- if (process.env.NODE_ENV !== 'test' && box.top === 0 && box.left === 0 && box.right === 0 && box.bottom === 0) {
56
- return new Error(['MUI: The `anchorEl` prop provided to the component is invalid.', 'The anchor element should be part of the document layout.', "Make sure the element is present in the document or that it's not display none."].join('\n'));
57
- }
58
- } else if (!resolvedAnchorEl || typeof resolvedAnchorEl.getBoundingClientRect !== 'function' || resolvedAnchorEl.contextElement != null && resolvedAnchorEl.contextElement.nodeType !== 1) {
59
- return new Error(['MUI: The `anchorEl` prop provided to the component is invalid.', 'It should be an HTML element instance or a virtualElement ', '(https://popper.js.org/docs/v2/virtual-elements/).'].join('\n'));
60
- }
61
- }
62
-
63
- return null;
64
- }),
43
+ anchorEl: PropTypes
44
+ /* @typescript-to-proptypes-ignore */
45
+ .oneOfType([HTMLElementType, PropTypes.object, PropTypes.func]),
65
46
 
66
47
  /**
67
48
  * Popper render function or node.
@@ -370,7 +370,7 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
370
370
  }
371
371
 
372
372
  return /*#__PURE__*/React.cloneElement(child, {
373
- 'aria-selected': selected ? 'true' : undefined,
373
+ 'aria-selected': selected ? 'true' : 'false',
374
374
  onClick: handleItemClick(child),
375
375
  onKeyUp: event => {
376
376
  if (event.key === ' ') {
package/modern/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license MUI v5.1.1
1
+ /** @license MUI v5.2.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.
@@ -1,3 +1,83 @@
1
+ export const amET = {
2
+ components: {
3
+ MuiBreadcrumbs: {
4
+ defaultProps: {
5
+ expandText: 'መንገድ አሳይ'
6
+ }
7
+ },
8
+ MuiTablePagination: {
9
+ defaultProps: {
10
+ getItemAriaLabel: type => {
11
+ if (type === 'first') {
12
+ return 'ወደ መጀመሪያው ገጽ ይሂዱ';
13
+ }
14
+
15
+ if (type === 'last') {
16
+ return 'ወደ መጨረሻው ገጽ ይሂዱ';
17
+ }
18
+
19
+ if (type === 'next') {
20
+ return 'ወደ ቀጣዩ ገጽ ይሂዱ';
21
+ } // if (type === 'previous') {
22
+
23
+
24
+ return 'ወደ ቀዳሚው ገጽ ይሂዱ';
25
+ },
26
+ labelRowsPerPage: 'ረድፎች በአንድ ገጽ:',
27
+ labelDisplayedRows: ({
28
+ from,
29
+ to,
30
+ count
31
+ }) => `${from}-${to} ከ ${count !== -1 ? count : `${to} በላይ`}`
32
+ }
33
+ },
34
+ MuiRating: {
35
+ defaultProps: {
36
+ getLabelText: value => `${value} ኮከ${value !== 1 ? 'ቦች' : 'ብ'}`,
37
+ emptyLabelText: 'ባዶ'
38
+ }
39
+ },
40
+ MuiAutocomplete: {
41
+ defaultProps: {
42
+ clearText: 'አጽዳ',
43
+ closeText: 'ዝጋ',
44
+ loadingText: 'በመጫን ላይ…',
45
+ noOptionsText: 'አማራጮች የሉም',
46
+ openText: 'ክፈት'
47
+ }
48
+ },
49
+ MuiAlert: {
50
+ defaultProps: {
51
+ closeText: 'ዝጋ'
52
+ }
53
+ },
54
+ MuiPagination: {
55
+ defaultProps: {
56
+ 'aria-label': 'የገጽ አሰሳ',
57
+ getItemAriaLabel: (type, page, selected) => {
58
+ if (type === 'page') {
59
+ return `${selected ? '' : 'ወደ '}ገጽ ${page}${selected ? '' : ' ሂድ'}`;
60
+ }
61
+
62
+ if (type === 'first') {
63
+ return 'ወደ መጀመሪያው ገጽ ይሂዱ';
64
+ }
65
+
66
+ if (type === 'last') {
67
+ return 'ወደ መጨረሻው ገጽ ይሂዱ';
68
+ }
69
+
70
+ if (type === 'next') {
71
+ return 'ወደ ቀጣዩ ገጽ ይሂዱ';
72
+ } // if (type === 'previous') {
73
+
74
+
75
+ return 'ወደ ቀዳሚው ገጽ ይሂዱ';
76
+ }
77
+ }
78
+ }
79
+ }
80
+ };
1
81
  export const arEG = {
2
82
  components: {
3
83
  MuiBreadcrumbs: {
@@ -5,32 +5,8 @@ import useEnhancedEffect from '../utils/useEnhancedEffect';
5
5
  * @deprecated Not used internally. Use `MediaQueryListEvent` from lib.dom.d.ts instead.
6
6
  */
7
7
 
8
- export default function useMediaQuery(queryInput, options = {}) {
9
- const theme = useTheme(); // Wait for jsdom to support the match media feature.
10
- // All the browsers MUI support have this built-in.
11
- // This defensive check is here for simplicity.
12
- // Most of the time, the match media logic isn't central to people tests.
13
-
8
+ function useMediaQueryOld(query, defaultMatches, matchMedia, ssrMatchMedia, noSsr) {
14
9
  const supportMatchMedia = typeof window !== 'undefined' && typeof window.matchMedia !== 'undefined';
15
- const {
16
- defaultMatches = false,
17
- matchMedia = supportMatchMedia ? window.matchMedia : null,
18
- noSsr = false,
19
- ssrMatchMedia = null
20
- } = getThemeProps({
21
- name: 'MuiUseMediaQuery',
22
- props: options,
23
- theme
24
- });
25
-
26
- if (process.env.NODE_ENV !== 'production') {
27
- if (typeof queryInput === 'function' && theme === null) {
28
- console.error(['MUI: The `query` argument provided is invalid.', 'You are providing a function without a theme in the context.', 'One of the parent elements needs to use a ThemeProvider.'].join('\n'));
29
- }
30
- }
31
-
32
- let query = typeof queryInput === 'function' ? queryInput(theme) : queryInput;
33
- query = query.replace(/^@media( ?)/m, '');
34
10
  const [match, setMatch] = React.useState(() => {
35
11
  if (noSsr && supportMatchMedia) {
36
12
  return matchMedia(query).matches;
@@ -62,13 +38,76 @@ export default function useMediaQuery(queryInput, options = {}) {
62
38
  }
63
39
  };
64
40
 
65
- updateMatch();
41
+ updateMatch(); // TODO: Use `addEventListener` once support for Safari < 14 is dropped
42
+
66
43
  queryList.addListener(updateMatch);
67
44
  return () => {
68
45
  active = false;
69
46
  queryList.removeListener(updateMatch);
70
47
  };
71
48
  }, [query, matchMedia, supportMatchMedia]);
49
+ return match;
50
+ }
51
+
52
+ function useMediaQueryNew(query, defaultMatches, matchMedia, ssrMatchMedia) {
53
+ const getDefaultSnapshot = React.useCallback(() => defaultMatches, [defaultMatches]);
54
+ const getServerSnapshot = React.useMemo(() => {
55
+ if (ssrMatchMedia !== null) {
56
+ const {
57
+ matches
58
+ } = ssrMatchMedia(query);
59
+ return () => matches;
60
+ }
61
+
62
+ return getDefaultSnapshot;
63
+ }, [getDefaultSnapshot, query, ssrMatchMedia]);
64
+ const [getSnapshot, subscribe] = React.useMemo(() => {
65
+ if (matchMedia === null) {
66
+ return [getDefaultSnapshot, () => () => {}];
67
+ }
68
+
69
+ const mediaQueryList = matchMedia(query);
70
+ return [() => mediaQueryList.matches, notify => {
71
+ // TODO: Use `addEventListener` once support for Safari < 14 is dropped
72
+ mediaQueryList.addListener(notify);
73
+ return () => {
74
+ mediaQueryList.removeListener(notify);
75
+ };
76
+ }];
77
+ }, [getDefaultSnapshot, matchMedia, query]);
78
+ const match = React.useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
79
+ return match;
80
+ }
81
+
82
+ export default function useMediaQuery(queryInput, options = {}) {
83
+ const theme = useTheme(); // Wait for jsdom to support the match media feature.
84
+ // All the browsers MUI support have this built-in.
85
+ // This defensive check is here for simplicity.
86
+ // Most of the time, the match media logic isn't central to people tests.
87
+
88
+ const supportMatchMedia = typeof window !== 'undefined' && typeof window.matchMedia !== 'undefined';
89
+ const {
90
+ defaultMatches = false,
91
+ matchMedia = supportMatchMedia ? window.matchMedia : null,
92
+ ssrMatchMedia = null,
93
+ noSsr
94
+ } = getThemeProps({
95
+ name: 'MuiUseMediaQuery',
96
+ props: options,
97
+ theme
98
+ });
99
+
100
+ if (process.env.NODE_ENV !== 'production') {
101
+ if (typeof queryInput === 'function' && theme === null) {
102
+ console.error(['MUI: The `query` argument provided is invalid.', 'You are providing a function without a theme in the context.', 'One of the parent elements needs to use a ThemeProvider.'].join('\n'));
103
+ }
104
+ }
105
+
106
+ let query = typeof queryInput === 'function' ? queryInput(theme) : queryInput;
107
+ query = query.replace(/^@media( ?)/m, ''); // TODO: Drop `useMediaQueryOld` and use `use-sync-external-store` shim in `useMediaQueryNew` once the package is stable
108
+
109
+ const useMediaQueryImplementation = React.useSyncExternalStore !== undefined ? useMediaQueryNew : useMediaQueryOld;
110
+ const match = useMediaQueryImplementation(query, defaultMatches, matchMedia, ssrMatchMedia, noSsr);
72
111
 
73
112
  if (process.env.NODE_ENV !== 'production') {
74
113
  // eslint-disable-next-line react-hooks/rules-of-hooks
File without changes