mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
fix: remove all deprecated @mui/ alert classes (#22233)
This pull-request removes all the magic of `@mui/material/Alert` 🥳 We're
officially free of any alerts that are being handled by Material UI so
this is dead code.
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import AlertTitle from "@mui/material/AlertTitle";
|
||||
import type { WorkspaceResource } from "api/typesGenerated";
|
||||
import { Alert, AlertDetail } from "components/Alert/Alert";
|
||||
import { Alert, AlertDetail, AlertTitle } from "components/Alert/Alert";
|
||||
import { Link } from "components/Link/Link";
|
||||
import { useProxy } from "contexts/ProxyContext";
|
||||
import { useAuthenticated } from "hooks/useAuthenticated";
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
* This file provides MUI theme overrides for legacy compatibility only.
|
||||
*/
|
||||
|
||||
/** @deprecated MUI Alert classes are deprecated. Use shadcn/ui Alert component instead. */
|
||||
import { alertClasses } from "@mui/material/Alert";
|
||||
/** @deprecated MUI ThemeOptions is deprecated. Migrate to Tailwind CSS theme system. */
|
||||
import type { ThemeOptions } from "@mui/material/styles";
|
||||
import {
|
||||
@@ -284,47 +282,4 @@ export const components = {
|
||||
}),
|
||||
},
|
||||
},
|
||||
MuiAlert: {
|
||||
defaultProps: {
|
||||
variant: "outlined",
|
||||
},
|
||||
styleOverrides: {
|
||||
root: ({ theme }) => ({
|
||||
background: theme.palette.background.paper,
|
||||
}),
|
||||
action: {
|
||||
paddingTop: 2, // Idk why it is not aligned as expected
|
||||
},
|
||||
icon: {
|
||||
fontSize: 16,
|
||||
marginTop: "4px", // The size of text is 24 so (24 - 16)/2 = 4
|
||||
},
|
||||
message: ({ theme }) => ({
|
||||
color: theme.palette.text.primary,
|
||||
}),
|
||||
outlinedWarning: ({ theme }) => ({
|
||||
[`& .${alertClasses.icon}`]: {
|
||||
color: theme.palette.warning.light,
|
||||
},
|
||||
}),
|
||||
outlinedInfo: ({ theme }) => ({
|
||||
[`& .${alertClasses.icon}`]: {
|
||||
color: theme.palette.primary.light,
|
||||
},
|
||||
}),
|
||||
outlinedError: ({ theme }) => ({
|
||||
[`& .${alertClasses.icon}`]: {
|
||||
color: theme.palette.error.light,
|
||||
},
|
||||
}),
|
||||
},
|
||||
},
|
||||
MuiAlertTitle: {
|
||||
styleOverrides: {
|
||||
root: {
|
||||
fontSize: "inherit",
|
||||
marginBottom: 0,
|
||||
},
|
||||
},
|
||||
},
|
||||
} satisfies ThemeOptions["components"];
|
||||
|
||||
@@ -130,8 +130,6 @@ export default defineConfig({
|
||||
"@emotion/react",
|
||||
"@emotion/react/jsx-runtime",
|
||||
"@emotion/styled",
|
||||
"@mui/material/Alert",
|
||||
"@mui/material/AlertTitle",
|
||||
"@mui/material/Autocomplete",
|
||||
"@mui/material/Card",
|
||||
"@mui/material/CardActionArea",
|
||||
|
||||
Reference in New Issue
Block a user