Skip to content

Commit 82169b5

Browse files
Merge branch 'master' into feat/add-missing-mui-icons
2 parents 2352349 + 8ca4849 commit 82169b5

File tree

13 files changed

+1282
-892
lines changed

13 files changed

+1282
-892
lines changed

examples/next-12/package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 1154 additions & 865 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,12 @@
4343
"devDependencies": {
4444
"@commitlint/cli": "^20.3.1",
4545
"@commitlint/config-conventional": "^20.0.0",
46-
"@eslint/compat": "^1.3.2",
46+
"@emotion/cache": "^11.14.0",
47+
"@eslint/compat": "^2.0.2",
4748
"@eslint/eslintrc": "^3.3.1",
4849
"@eslint/js": "^9.39.2",
4950
"@meshery/schemas": "^0.8.124",
50-
"@mui/icons-material": "^6.4.8",
51+
"@mui/icons-material": "^7.3.7",
5152
"@reduxjs/toolkit": "^2.2.5",
5253
"@testing-library/react": "^16.2.0",
5354
"@types/jest": "^29.5.14",
@@ -68,7 +69,7 @@
6869
"globals": "^17.0.0",
6970
"husky": "^9.1.7",
7071
"jest": "^29.7.0",
71-
"jest-environment-jsdom": "^29.7.0",
72+
"jest-environment-jsdom": "^30.2.0",
7273
"lint-staged": "^15.5.0",
7374
"notistack": "^3.0.2",
7475
"prettier": "^3.5.3",
@@ -93,8 +94,8 @@
9394
"xstate": "^5.25.0"
9495
},
9596
"overrides": {
96-
"@mui/icons-material": "^6.4.8",
97-
"@mui/material": "^6.4.8",
97+
"@mui/icons-material": "^7.3.7",
98+
"@mui/material": "^7.3.7",
9899
"@meshery/schemas": {
99100
"react": "$react",
100101
"react-dom": "$react-dom"
@@ -115,8 +116,8 @@
115116
"@emotion/react": "^11.14.0",
116117
"@emotion/styled": "^11.14.0",
117118
"@layer5/meshery-design-embed": "^0.4.0",
118-
"@mui/material": "^6.4.8",
119-
"@sistent/mui-datatables": "^5.1.4",
119+
"@mui/material": "^7.3.7",
120+
"@sistent/mui-datatables": "^6.0.1",
120121
"@types/mui-datatables": "*",
121122
"billboard.js": "^3.15.0",
122123
"js-yaml": "^4.1.0",

src/base/Grid2/Grid2.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
import { Grid2 as MuiGrid, Grid2Props as MuiGridProps } from '@mui/material';
21
import React from 'react';
2+
import MuiGrid from '@mui/material/Grid';
3+
import type { GridProps as MuiGridProps } from '@mui/material/Grid';
34

45
const Grid2 = React.forwardRef<HTMLDivElement, MuiGridProps>((props, ref) => {
56
return <MuiGrid {...props} ref={ref} />;

src/base/Hidden/Hidden.tsx

Lines changed: 100 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,104 @@
1-
import { Hidden as MuiHidden, HiddenProps as MuiHiddenProps } from '@mui/material';
1+
import { useMediaQuery, useTheme } from '@mui/material';
2+
import React from 'react';
23

3-
export const Hidden = (props: MuiHiddenProps) => {
4-
return <MuiHidden {...props} />;
4+
type Breakpoint = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
5+
6+
export interface HiddenProps {
7+
children?: React.ReactNode;
8+
only?: Breakpoint | Breakpoint[];
9+
xsUp?: boolean;
10+
smUp?: boolean;
11+
mdUp?: boolean;
12+
lgUp?: boolean;
13+
xlUp?: boolean;
14+
xsDown?: boolean;
15+
smDown?: boolean;
16+
mdDown?: boolean;
17+
lgDown?: boolean;
18+
xlDown?: boolean;
19+
20+
}
21+
22+
export const Hidden = ({
23+
children,
24+
only,
25+
xsUp = false,
26+
smUp = false,
27+
mdUp = false,
28+
lgUp = false,
29+
xlUp = false,
30+
xsDown = false,
31+
smDown = false,
32+
mdDown = false,
33+
lgDown = false,
34+
xlDown = false
35+
}: HiddenProps) => {
36+
const theme = useTheme();
37+
const onlyValues = Array.isArray(only) ? only : only ? [only] : [];
38+
39+
const conditions: string[] = [];
40+
41+
const extractCondition = (mediaQuery: string) =>
42+
mediaQuery.replace(/^@media\s*/i, '');
43+
44+
if (onlyValues.includes('xs')) {
45+
conditions.push(extractCondition(theme.breakpoints.only('xs')));
46+
}
47+
if (onlyValues.includes('sm')) {
48+
conditions.push(extractCondition(theme.breakpoints.only('sm')));
49+
}
50+
if (onlyValues.includes('md')) {
51+
conditions.push(extractCondition(theme.breakpoints.only('md')));
52+
}
53+
if (onlyValues.includes('lg')) {
54+
conditions.push(extractCondition(theme.breakpoints.only('lg')));
55+
}
56+
if (onlyValues.includes('xl')) {
57+
conditions.push(extractCondition(theme.breakpoints.only('xl')));
58+
}
59+
60+
if (xsUp) {
61+
conditions.push(extractCondition(theme.breakpoints.up('xs')));
62+
}
63+
if (smUp) {
64+
conditions.push(extractCondition(theme.breakpoints.up('sm')));
65+
}
66+
if (mdUp) {
67+
conditions.push(extractCondition(theme.breakpoints.up('md')));
68+
}
69+
if (lgUp) {
70+
conditions.push(extractCondition(theme.breakpoints.up('lg')));
71+
}
72+
if (xlUp) {
73+
conditions.push(extractCondition(theme.breakpoints.up('xl')));
74+
}
75+
76+
if (xsDown) {
77+
conditions.push(extractCondition(theme.breakpoints.down('xs')));
78+
}
79+
if (smDown) {
80+
conditions.push(extractCondition(theme.breakpoints.down('sm')));
81+
}
82+
if (mdDown) {
83+
conditions.push(extractCondition(theme.breakpoints.down('md')));
84+
}
85+
if (lgDown) {
86+
conditions.push(extractCondition(theme.breakpoints.down('lg')));
87+
}
88+
if (xlDown) {
89+
conditions.push(extractCondition(theme.breakpoints.down('xl')));
90+
}
91+
92+
const mediaQuery =
93+
conditions.length > 0 ? `@media ${conditions.join(', ')}` : '@media not all';
94+
95+
const matches = useMediaQuery(mediaQuery);
96+
97+
if (matches) {
98+
return null;
99+
}
100+
101+
return <>{children}</>;
5102
};
6103

7104
export default Hidden;

src/custom/DashboardWidgets/GettingStartedWidget/GetStartedModal.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
/* eslint-disable @typescript-eslint/no-explicit-any */
2-
import { Grid2, SwipeableDrawer } from '@mui/material';
2+
import { SwipeableDrawer } from '@mui/material';
33
import { useState } from 'react';
44
import {
55
Backdrop,
66
CircularProgress,
77
DialogContent,
88
DialogTitle,
9+
Grid2,
910
ListItem,
1011
Typography
1112
} from '../../../base';

src/custom/InputSearchField/InputSearchField.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { Autocomplete, Grid2 } from '@mui/material';
1+
import { Autocomplete } from '@mui/material';
22
import React, { useCallback, useEffect, useState } from 'react';
3-
import { Box, Chip, CircularProgress, TextField, Tooltip, Typography } from '../../base';
3+
import { Box, Chip, CircularProgress, Grid2, TextField, Tooltip, Typography } from '../../base';
44

55
import { iconLarge, iconSmall } from '../../constants/iconsSizes';
66
import { CloseIcon, OrgIcon } from '../../icons';

src/custom/ResourceDetailFormatters/styles.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { alpha, Grid2 } from '@mui/material';
2-
import { Box, Chip, IconButton, Typography } from '../../base';
1+
import { alpha } from '@mui/material';
2+
import { Box, Chip, Grid2, IconButton, Typography } from '../../base';
33

44
import { charcoal, KEPPEL, styled } from '../../theme';
55

src/custom/Stepper/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Box, Stack, Step, StepConnector, StepLabel, Stepper } from '@mui/material';
22
import { stepConnectorClasses } from '@mui/material/StepConnector';
33
import { StepIconProps } from '@mui/material/StepIcon';
4-
import { styled } from '@mui/system';
4+
import { styled } from '@mui/material/styles';
55
import React, { useMemo, useState } from 'react';
66
import { IconProps } from '../../icons/types';
77
import { useTheme } from '../../theme';

src/custom/TeamTable/TeamTable.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/* eslint-disable @typescript-eslint/no-explicit-any */
2-
import { Grid2, TableCell } from '@mui/material';
2+
import { TableCell } from '@mui/material';
33
import { MUIDataTableColumn } from '@sistent/mui-datatables';
4+
import { Grid2 } from '../../base';
45
import { styled, useTheme } from '../../theme';
56
import { ErrorBoundary } from '../ErrorBoundary/ErrorBoundary.js';
67
import { ColView } from '../Helpers/ResponsiveColumns/responsive-coulmns.tsx/index.js';

0 commit comments

Comments
 (0)