diff --git a/package-lock.json b/package-lock.json index 9901f5a81..2bc6d94d0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,8 +11,8 @@ "@emotion/react": "^11.14.0", "@emotion/styled": "^11.14.0", "@layer5/meshery-design-embed": "^0.4.0", - "@mui/material": "^6.4.8", - "@sistent/mui-datatables": "^5.1.4", + "@mui/material": "^7.3.7", + "@sistent/mui-datatables": "^6.0.1", "@types/mui-datatables": "*", "billboard.js": "^3.15.0", "js-yaml": "^4.1.0", @@ -30,7 +30,7 @@ "@eslint/eslintrc": "^3.3.1", "@eslint/js": "^9.39.2", "@meshery/schemas": "^0.8.124", - "@mui/icons-material": "^6.4.8", + "@mui/icons-material": "^7.3.7", "@reduxjs/toolkit": "^2.2.5", "@testing-library/react": "^16.2.0", "@types/jest": "^29.5.14", @@ -2848,9 +2848,9 @@ } }, "node_modules/@mui/core-downloads-tracker": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@mui/core-downloads-tracker/-/core-downloads-tracker-6.5.0.tgz", - "integrity": "sha512-LGb8t8i6M2ZtS3Drn3GbTI1DVhDY6FJ9crEey2lZ0aN2EMZo8IZBZj9wRf4vqbZHaWjsYgtbOnJw5V8UWbmK2Q==", + "version": "7.3.8", + "resolved": "https://registry.npmjs.org/@mui/core-downloads-tracker/-/core-downloads-tracker-7.3.8.tgz", + "integrity": "sha512-s9UHZo7QJVly7gNArEZkbbsimHqJZhElgBpXIJdehZ4OWXt+CCr0SBDgUCDJnQrqpd1dWK2dLq5rmO4mCBmI3w==", "license": "MIT", "funding": { "type": "opencollective", @@ -2858,12 +2858,12 @@ } }, "node_modules/@mui/icons-material": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@mui/icons-material/-/icons-material-6.5.0.tgz", - "integrity": "sha512-VPuPqXqbBPlcVSA0BmnoE4knW4/xG6Thazo8vCLWkOKusko6DtwFV6B665MMWJ9j0KFohTIf3yx2zYtYacvG1g==", + "version": "7.3.8", + "resolved": "https://registry.npmjs.org/@mui/icons-material/-/icons-material-7.3.8.tgz", + "integrity": "sha512-88sWg/UJc1X82OMO+ISR4E3P58I3BjFVg0qkmDu7OWlN8VijneZD3ylFA+ImxuPjMHW3SHosfSJYy1fztoz0fw==", "license": "MIT", "dependencies": { - "@babel/runtime": "^7.26.0" + "@babel/runtime": "^7.28.6" }, "engines": { "node": ">=14.0.0" @@ -2873,7 +2873,7 @@ "url": "https://opencollective.com/mui-org" }, "peerDependencies": { - "@mui/material": "^6.5.0", + "@mui/material": "^7.3.8", "@types/react": "^17.0.0 || ^18.0.0 || ^19.0.0", "react": "^17.0.0 || ^18.0.0 || ^19.0.0" }, @@ -2884,22 +2884,22 @@ } }, "node_modules/@mui/material": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@mui/material/-/material-6.5.0.tgz", - "integrity": "sha512-yjvtXoFcrPLGtgKRxFaH6OQPtcLPhkloC0BML6rBG5UeldR0nPULR/2E2BfXdo5JNV7j7lOzrrLX2Qf/iSidow==", + "version": "7.3.8", + "resolved": "https://registry.npmjs.org/@mui/material/-/material-7.3.8.tgz", + "integrity": "sha512-QKd1RhDXE1hf2sQDNayA9ic9jGkEgvZOf0tTkJxlBPG8ns8aS4rS8WwYURw2x5y3739p0HauUXX9WbH7UufFLw==", "license": "MIT", "dependencies": { - "@babel/runtime": "^7.26.0", - "@mui/core-downloads-tracker": "^6.5.0", - "@mui/system": "^6.5.0", - "@mui/types": "~7.2.24", - "@mui/utils": "^6.4.9", + "@babel/runtime": "^7.28.6", + "@mui/core-downloads-tracker": "^7.3.8", + "@mui/system": "^7.3.8", + "@mui/types": "^7.4.11", + "@mui/utils": "^7.3.8", "@popperjs/core": "^2.11.8", "@types/react-transition-group": "^4.4.12", "clsx": "^2.1.1", - "csstype": "^3.1.3", + "csstype": "^3.2.3", "prop-types": "^15.8.1", - "react-is": "^19.0.0", + "react-is": "^19.2.3", "react-transition-group": "^4.4.5" }, "engines": { @@ -2912,7 +2912,7 @@ "peerDependencies": { "@emotion/react": "^11.5.0", "@emotion/styled": "^11.3.0", - "@mui/material-pigment-css": "^6.5.0", + "@mui/material-pigment-css": "^7.3.8", "@types/react": "^17.0.0 || ^18.0.0 || ^19.0.0", "react": "^17.0.0 || ^18.0.0 || ^19.0.0", "react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0" @@ -2933,13 +2933,13 @@ } }, "node_modules/@mui/private-theming": { - "version": "6.4.9", - "resolved": "https://registry.npmjs.org/@mui/private-theming/-/private-theming-6.4.9.tgz", - "integrity": "sha512-LktcVmI5X17/Q5SkwjCcdOLBzt1hXuc14jYa7NPShog0GBDCDvKtcnP0V7a2s6EiVRlv7BzbWEJzH6+l/zaCxw==", + "version": "7.3.8", + "resolved": "https://registry.npmjs.org/@mui/private-theming/-/private-theming-7.3.8.tgz", + "integrity": "sha512-du5dlPZ9XL3xW2apHoGDXBI+QLtyVJGrXNCfcNYfP/ojkz1RQ0rRV6VG9Rkm1DqEFRG8mjjTL7zmE1Bvn1eR4A==", "license": "MIT", "dependencies": { - "@babel/runtime": "^7.26.0", - "@mui/utils": "^6.4.9", + "@babel/runtime": "^7.28.6", + "@mui/utils": "^7.3.8", "prop-types": "^15.8.1" }, "engines": { @@ -2960,16 +2960,16 @@ } }, "node_modules/@mui/styled-engine": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@mui/styled-engine/-/styled-engine-6.5.0.tgz", - "integrity": "sha512-8woC2zAqF4qUDSPIBZ8v3sakj+WgweolpyM/FXf8jAx6FMls+IE4Y8VDZc+zS805J7PRz31vz73n2SovKGaYgw==", + "version": "7.3.8", + "resolved": "https://registry.npmjs.org/@mui/styled-engine/-/styled-engine-7.3.8.tgz", + "integrity": "sha512-JHAeXQzS0tJ+Fq3C6J4TVDsW+yKhO4uuxuiLaopNStJeQYBIUCXpKYyUCcgXym4AmhbznQnv9RlHywSH6b0FOg==", "license": "MIT", "dependencies": { - "@babel/runtime": "^7.26.0", - "@emotion/cache": "^11.13.5", + "@babel/runtime": "^7.28.6", + "@emotion/cache": "^11.14.0", "@emotion/serialize": "^1.3.3", "@emotion/sheet": "^1.4.0", - "csstype": "^3.1.3", + "csstype": "^3.2.3", "prop-types": "^15.8.1" }, "engines": { @@ -2994,18 +2994,18 @@ } }, "node_modules/@mui/system": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@mui/system/-/system-6.5.0.tgz", - "integrity": "sha512-XcbBYxDS+h/lgsoGe78ExXFZXtuIlSBpn/KsZq8PtZcIkUNJInkuDqcLd2rVBQrDC1u+rvVovdaWPf2FHKJf3w==", + "version": "7.3.8", + "resolved": "https://registry.npmjs.org/@mui/system/-/system-7.3.8.tgz", + "integrity": "sha512-hoFRj4Zw2Km8DPWZp/nKG+ao5Jw5LSk2m/e4EGc6M3RRwXKEkMSG4TgtfVJg7dS2homRwtdXSMW+iRO0ZJ4+IA==", "license": "MIT", "dependencies": { - "@babel/runtime": "^7.26.0", - "@mui/private-theming": "^6.4.9", - "@mui/styled-engine": "^6.5.0", - "@mui/types": "~7.2.24", - "@mui/utils": "^6.4.9", + "@babel/runtime": "^7.28.6", + "@mui/private-theming": "^7.3.8", + "@mui/styled-engine": "^7.3.8", + "@mui/types": "^7.4.11", + "@mui/utils": "^7.3.8", "clsx": "^2.1.1", - "csstype": "^3.1.3", + "csstype": "^3.2.3", "prop-types": "^15.8.1" }, "engines": { @@ -3034,10 +3034,13 @@ } }, "node_modules/@mui/types": { - "version": "7.2.24", - "resolved": "https://registry.npmjs.org/@mui/types/-/types-7.2.24.tgz", - "integrity": "sha512-3c8tRt/CbWZ+pEg7QpSwbdxOk36EfmhbKf6AGZsD1EcLDLTSZoxxJ86FVtcjxvjuhdyBiWKSTGZFaXCnidO2kw==", + "version": "7.4.11", + "resolved": "https://registry.npmjs.org/@mui/types/-/types-7.4.11.tgz", + "integrity": "sha512-fZ2xO9D08IKOxO2oUBi1nnVKH6oJUD+64cnv4YAaFoC0E5+i1+S5AHbNqqvZlYYsbPEQ6qEVwuBqY3jl5W4G+Q==", "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.28.6" + }, "peerDependencies": { "@types/react": "^17.0.0 || ^18.0.0 || ^19.0.0" }, @@ -3048,17 +3051,17 @@ } }, "node_modules/@mui/utils": { - "version": "6.4.9", - "resolved": "https://registry.npmjs.org/@mui/utils/-/utils-6.4.9.tgz", - "integrity": "sha512-Y12Q9hbK9g+ZY0T3Rxrx9m2m10gaphDuUMgWxyV5kNJevVxXYCLclYUCC9vXaIk1/NdNDTcW2Yfr2OGvNFNmHg==", + "version": "7.3.8", + "resolved": "https://registry.npmjs.org/@mui/utils/-/utils-7.3.8.tgz", + "integrity": "sha512-kZRcE2620CBGr+XI8YMmwPj6WIPwSF7uMJjvSfqd8zXVvlz0MCJbzRRUGNf8NgflCLthdji2DdS643TeyJ3+nA==", "license": "MIT", "dependencies": { - "@babel/runtime": "^7.26.0", - "@mui/types": "~7.2.24", - "@types/prop-types": "^15.7.14", + "@babel/runtime": "^7.28.6", + "@mui/types": "^7.4.11", + "@types/prop-types": "^15.7.15", "clsx": "^2.1.1", "prop-types": "^15.8.1", - "react-is": "^19.0.0" + "react-is": "^19.2.3" }, "engines": { "node": ">=14.0.0" @@ -3517,9 +3520,9 @@ } }, "node_modules/@sistent/mui-datatables": { - "version": "5.1.4", - "resolved": "https://registry.npmjs.org/@sistent/mui-datatables/-/mui-datatables-5.1.4.tgz", - "integrity": "sha512-rVeClQ2/ERQOZE97WWB4fByMbOfA8xlNOApjutfxfEUfwlFdGWnatYR1Ea5Wq87jovZXrLsmakAcMK2BWcjlYg==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/@sistent/mui-datatables/-/mui-datatables-6.0.1.tgz", + "integrity": "sha512-6kaRU1f1OXONMbuscSz6wjsFqtYvO2tRd0G2JUcPQr/mhfSU5HhqB35jqd8fbb4KwT+u2DRVIXhdFT+48Pmzng==", "license": "MIT", "dependencies": { "@babel/runtime-corejs3": "^7.12.1", @@ -3545,8 +3548,8 @@ "@emotion/react": "^11.14.0", "@mui/icons-material": "^7.3.7", "@mui/material": "^7.3.7", - "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", - "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" + "react": "^17.0.0 || ^18.0.0 || ^19.0.0", + "react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0" } }, "node_modules/@sistent/mui-datatables/node_modules/clsx": { @@ -3985,9 +3988,9 @@ "license": "MIT" }, "node_modules/@types/react": { - "version": "18.3.27", - "resolved": "https://registry.npmjs.org/@types/react/-/react-18.3.27.tgz", - "integrity": "sha512-cisd7gxkzjBKU2GgdYrTdtQx1SORymWyaAFhaxQPK9bYO9ot3Y5OikQRvY0VYQtvwjeQnizCINJAenh/V7MK2w==", + "version": "18.3.28", + "resolved": "https://registry.npmjs.org/@types/react/-/react-18.3.28.tgz", + "integrity": "sha512-z9VXpC7MWrhfWipitjNdgCauoMLRdIILQsAEV+ZesIzBq/oUlxk0m3ApZuMFCXdnS4U7KrI+l3WRUEGQ8K1QKw==", "license": "MIT", "dependencies": { "@types/prop-types": "*", @@ -14121,9 +14124,9 @@ } }, "node_modules/react-is": { - "version": "19.2.3", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-19.2.3.tgz", - "integrity": "sha512-qJNJfu81ByyabuG7hPFEbXqNcWSU3+eVus+KJs+0ncpGfMyYdvSmxiJxbWR65lYi1I+/0HBcliO029gc4F+PnA==", + "version": "19.2.4", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-19.2.4.tgz", + "integrity": "sha512-W+EWGn2v0ApPKgKKCy/7s7WHXkboGcsrXE+2joLyVxkbyVQfO3MUEaUQDHoSmb8TFFrSKYa9mw64WZHNHSDzYA==", "license": "MIT" }, "node_modules/react-lifecycles-compat": { diff --git a/package.json b/package.json index 05229d7c9..a849df15a 100644 --- a/package.json +++ b/package.json @@ -7,8 +7,17 @@ "url": "git+ssh://git@github.com/layer5io/sistent.git" }, "main": "./dist/index.js", - "module": "./dist/index.js", + "module": "./dist/index.mjs", "types": "./dist/index.d.ts", + "exports": { + ".": { + "types": "./dist/index.d.ts", + "node": "./dist/index.js", + "import": "./dist/index.mjs", + "require": "./dist/index.js", + "default": "./dist/index.js" + } + }, "files": [ "dist" ], @@ -47,7 +56,7 @@ "@eslint/eslintrc": "^3.3.1", "@eslint/js": "^9.39.2", "@meshery/schemas": "^0.8.124", - "@mui/icons-material": "^6.4.8", + "@mui/icons-material": "^7.3.7", "@reduxjs/toolkit": "^2.2.5", "@testing-library/react": "^16.2.0", "@types/jest": "^29.5.14", @@ -93,8 +102,8 @@ "xstate": "^5.25.0" }, "overrides": { - "@mui/icons-material": "^6.4.8", - "@mui/material": "^6.4.8", + "@mui/icons-material": "^7.3.7", + "@mui/material": "^7.3.7", "@meshery/schemas": { "react": "$react", "react-dom": "$react-dom" @@ -115,8 +124,8 @@ "@emotion/react": "^11.14.0", "@emotion/styled": "^11.14.0", "@layer5/meshery-design-embed": "^0.4.0", - "@mui/material": "^6.4.8", - "@sistent/mui-datatables": "^5.1.4", + "@mui/material": "^7.3.7", + "@sistent/mui-datatables": "^6.0.1", "@types/mui-datatables": "*", "billboard.js": "^3.15.0", "js-yaml": "^4.1.0", diff --git a/src/base/Grid2/Grid2.tsx b/src/base/Grid2/Grid2.tsx index 245c62e74..8dd618ca8 100644 --- a/src/base/Grid2/Grid2.tsx +++ b/src/base/Grid2/Grid2.tsx @@ -1,5 +1,6 @@ -import MuiGrid, { Grid2Props as MuiGridProps } from '@mui/material/Grid2'; import React from 'react'; +import MuiGrid from '@mui/material/Grid'; +import type { GridProps as MuiGridProps } from '@mui/material/Grid'; const Grid2 = React.forwardRef((props, ref) => { return ; diff --git a/src/base/Hidden/Hidden.tsx b/src/base/Hidden/Hidden.tsx index cb6da8aae..3d3e5a731 100644 --- a/src/base/Hidden/Hidden.tsx +++ b/src/base/Hidden/Hidden.tsx @@ -1,7 +1,104 @@ -import { Hidden as MuiHidden, HiddenProps as MuiHiddenProps } from '@mui/material'; +import { useMediaQuery, useTheme } from '@mui/material'; +import React from 'react'; -export const Hidden = (props: MuiHiddenProps) => { - return ; +type Breakpoint = 'xs' | 'sm' | 'md' | 'lg' | 'xl'; + +export interface HiddenProps { + children?: React.ReactNode; + only?: Breakpoint | Breakpoint[]; + xsUp?: boolean; + smUp?: boolean; + mdUp?: boolean; + lgUp?: boolean; + xlUp?: boolean; + xsDown?: boolean; + smDown?: boolean; + mdDown?: boolean; + lgDown?: boolean; + xlDown?: boolean; + +} + +export const Hidden = ({ + children, + only, + xsUp = false, + smUp = false, + mdUp = false, + lgUp = false, + xlUp = false, + xsDown = false, + smDown = false, + mdDown = false, + lgDown = false, + xlDown = false +}: HiddenProps) => { + const theme = useTheme(); + const onlyValues = Array.isArray(only) ? only : only ? [only] : []; + + const conditions: string[] = []; + + const extractCondition = (mediaQuery: string) => + mediaQuery.replace(/^@media\s*/i, ''); + + if (onlyValues.includes('xs')) { + conditions.push(extractCondition(theme.breakpoints.only('xs'))); + } + if (onlyValues.includes('sm')) { + conditions.push(extractCondition(theme.breakpoints.only('sm'))); + } + if (onlyValues.includes('md')) { + conditions.push(extractCondition(theme.breakpoints.only('md'))); + } + if (onlyValues.includes('lg')) { + conditions.push(extractCondition(theme.breakpoints.only('lg'))); + } + if (onlyValues.includes('xl')) { + conditions.push(extractCondition(theme.breakpoints.only('xl'))); + } + + if (xsUp) { + conditions.push(extractCondition(theme.breakpoints.up('xs'))); + } + if (smUp) { + conditions.push(extractCondition(theme.breakpoints.up('sm'))); + } + if (mdUp) { + conditions.push(extractCondition(theme.breakpoints.up('md'))); + } + if (lgUp) { + conditions.push(extractCondition(theme.breakpoints.up('lg'))); + } + if (xlUp) { + conditions.push(extractCondition(theme.breakpoints.up('xl'))); + } + + if (xsDown) { + conditions.push(extractCondition(theme.breakpoints.down('xs'))); + } + if (smDown) { + conditions.push(extractCondition(theme.breakpoints.down('sm'))); + } + if (mdDown) { + conditions.push(extractCondition(theme.breakpoints.down('md'))); + } + if (lgDown) { + conditions.push(extractCondition(theme.breakpoints.down('lg'))); + } + if (xlDown) { + conditions.push(extractCondition(theme.breakpoints.down('xl'))); + } + + const mediaQuery = + conditions.length > 0 ? `@media ${conditions.join(', ')}` : '@media not all'; + + const matches = useMediaQuery(mediaQuery); + + if (matches) { + return null; + } + + return <>{children}; }; export default Hidden; diff --git a/src/custom/DashboardWidgets/GettingStartedWidget/GetStartedModal.tsx b/src/custom/DashboardWidgets/GettingStartedWidget/GetStartedModal.tsx index eead2cef1..579e4b509 100644 --- a/src/custom/DashboardWidgets/GettingStartedWidget/GetStartedModal.tsx +++ b/src/custom/DashboardWidgets/GettingStartedWidget/GetStartedModal.tsx @@ -1,5 +1,4 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ -import Grid2 from '@mui/material/Grid2'; import { SwipeableDrawer } from '@mui/material'; import { useState } from 'react'; import { @@ -7,6 +6,7 @@ import { CircularProgress, DialogContent, DialogTitle, + Grid2, ListItem, Typography } from '../../../base'; diff --git a/src/custom/InputSearchField/InputSearchField.tsx b/src/custom/InputSearchField/InputSearchField.tsx index 1a63ae3a3..be8413c05 100644 --- a/src/custom/InputSearchField/InputSearchField.tsx +++ b/src/custom/InputSearchField/InputSearchField.tsx @@ -1,7 +1,6 @@ -import Grid2 from '@mui/material/Grid2'; import { Autocomplete } from '@mui/material'; import React, { useCallback, useEffect, useState } from 'react'; -import { Box, Chip, CircularProgress, TextField, Tooltip, Typography } from '../../base'; +import { Box, Chip, CircularProgress, Grid2, TextField, Tooltip, Typography } from '../../base'; import { iconLarge, iconSmall } from '../../constants/iconsSizes'; import { CloseIcon, OrgIcon } from '../../icons'; diff --git a/src/custom/ResourceDetailFormatters/styles.ts b/src/custom/ResourceDetailFormatters/styles.ts index 97ae04f36..cc7b0b7b0 100644 --- a/src/custom/ResourceDetailFormatters/styles.ts +++ b/src/custom/ResourceDetailFormatters/styles.ts @@ -1,6 +1,5 @@ -import Grid2 from '@mui/material/Grid2'; import { alpha } from '@mui/material'; -import { Box, Chip, IconButton, Typography } from '../../base'; +import { Box, Chip, Grid2, IconButton, Typography } from '../../base'; import { charcoal, KEPPEL, styled } from '../../theme'; diff --git a/src/custom/Stepper/index.tsx b/src/custom/Stepper/index.tsx index b5255800f..931fb83de 100644 --- a/src/custom/Stepper/index.tsx +++ b/src/custom/Stepper/index.tsx @@ -1,7 +1,7 @@ import { Box, Stack, Step, StepConnector, StepLabel, Stepper } from '@mui/material'; import { stepConnectorClasses } from '@mui/material/StepConnector'; import { StepIconProps } from '@mui/material/StepIcon'; -import { styled } from '@mui/system'; +import { styled } from '@mui/material/styles'; import React, { useMemo, useState } from 'react'; import { IconProps } from '../../icons/types'; import { useTheme } from '../../theme'; diff --git a/src/custom/TeamTable/TeamTable.tsx b/src/custom/TeamTable/TeamTable.tsx index 915b54e6d..1fd93bf1e 100644 --- a/src/custom/TeamTable/TeamTable.tsx +++ b/src/custom/TeamTable/TeamTable.tsx @@ -1,7 +1,7 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ -import Grid2 from '@mui/material/Grid2'; import { TableCell } from '@mui/material'; import { MUIDataTableColumn } from '@sistent/mui-datatables'; +import { Grid2 } from '../../base'; import { styled, useTheme } from '../../theme'; import { ErrorBoundary } from '../ErrorBoundary/ErrorBoundary.js'; import { ColView } from '../Helpers/ResponsiveColumns/responsive-coulmns.tsx/index.js'; diff --git a/src/custom/TransferModal/TransferList/style.tsx b/src/custom/TransferModal/TransferList/style.tsx index 40135265a..8613bc427 100644 --- a/src/custom/TransferModal/TransferList/style.tsx +++ b/src/custom/TransferModal/TransferList/style.tsx @@ -1,6 +1,5 @@ -import Grid2 from '@mui/material/Grid2'; import { styled } from '@mui/material'; -import { Button, Chip, Paper, Typography } from '../../../base'; +import { Button, Chip, Grid2, Paper, Typography } from '../../../base'; export const StyledChip = styled(Chip)(({ theme }) => ({ padding: '5px 6px !important', diff --git a/src/custom/Workspaces/WorkspaceCard.tsx b/src/custom/Workspaces/WorkspaceCard.tsx index 1ebc37d63..9e9664a45 100644 --- a/src/custom/Workspaces/WorkspaceCard.tsx +++ b/src/custom/Workspaces/WorkspaceCard.tsx @@ -1,6 +1,5 @@ -import Grid2 from '@mui/material/Grid2'; import { useTheme } from '@mui/material'; -import { Backdrop, CircularProgress } from '../../base'; +import { Backdrop, CircularProgress, Grid2 } from '../../base'; import { getRelativeTime } from '../../utils'; import { FlipCard } from '../FlipCard'; diff --git a/src/theme/typography.ts b/src/theme/typography.ts index 75cf301e1..707f8e851 100644 --- a/src/theme/typography.ts +++ b/src/theme/typography.ts @@ -1,5 +1,5 @@ import { PaletteMode, createTheme } from '@mui/material'; -import { TypographyOptions } from '@mui/material/styles/createTypography'; +import { TypographyVariantsOptions } from '@mui/material/styles'; import { common } from './colors'; declare module '@mui/material/styles' { @@ -48,7 +48,7 @@ declare module '@mui/material/Typography' { const theme = createTheme(); -export const typography = (mode: PaletteMode): TypographyOptions => { +export const typography = (mode: PaletteMode): TypographyVariantsOptions => { return { fontFamily: ['Qanelas Soft Regular', 'Roboto', 'Helvectica', 'Arial', 'sans-serif'].join(','), textH1Bold: { diff --git a/tsup.config.ts b/tsup.config.ts index 5e2722520..ad1b32926 100644 --- a/tsup.config.ts +++ b/tsup.config.ts @@ -1,8 +1,21 @@ import path from 'path'; import { defineConfig } from 'tsup'; +import pkg from './package.json'; const env = process.env.NODE_ENV; +// All deps and peerDeps must stay external — re-bundling packages like +// MUI / emotion breaks CJS ↔ ESM default-export interop at runtime. +const external: (string | RegExp)[] = [ + ...Object.keys(pkg.dependencies ?? {}), + ...Object.keys(pkg.peerDependencies ?? {}), + // Safety-net: catch transitive @mui/* and @emotion/* sub-packages that + // aren't explicitly listed in dependencies (e.g. @mui/system, + // @mui/styled-engine, @mui/utils) so they never get re-bundled. + /^@mui\//, + /^@emotion\// +]; + export default defineConfig({ outDir: 'dist', entry: ['src/index.tsx'], @@ -10,7 +23,7 @@ export default defineConfig({ clean: true, dts: true, format: ['cjs', 'esm'], - external: ['react', 'xstate', '@xstate/react', 'react-dom', 'mui-datatables'], + external, minify: env === 'production', watch: env === 'development', sourcemap: env === 'development',