diff --git a/site/.eslintrc.yaml b/site/.eslintrc.yaml index 018bf9043d72e..0991916c76064 100644 --- a/site/.eslintrc.yaml +++ b/site/.eslintrc.yaml @@ -139,6 +139,9 @@ rules: message: "You should use the Popover component provided on components/Popover/Popover" + - name: "@mui/material/Typography" + message: + "You should use the native HTML elements as span, p, h1, h2, h3..." no-unused-vars: "off" "object-curly-spacing": "off" react-hooks/exhaustive-deps: warn diff --git a/site/src/components/Dashboard/Navbar/NavbarView.tsx b/site/src/components/Dashboard/Navbar/NavbarView.tsx index 7db339d966051..0f1eed8522b0f 100644 --- a/site/src/components/Dashboard/Navbar/NavbarView.tsx +++ b/site/src/components/Dashboard/Navbar/NavbarView.tsx @@ -8,7 +8,6 @@ import Button from "@mui/material/Button"; import MenuItem from "@mui/material/MenuItem"; import KeyboardArrowDownOutlined from "@mui/icons-material/KeyboardArrowDownOutlined"; import MenuIcon from "@mui/icons-material/Menu"; -import Typography from "@mui/material/Typography"; import { css, type Interpolation, type Theme, useTheme } from "@emotion/react"; import { type FC, type ReactNode, useRef, useState } from "react"; import { NavLink, useLocation, useNavigate } from "react-router-dom"; @@ -360,31 +359,30 @@ const ProxyMenu: FC<{ proxyContextValue: ProxyContextValue }> = ({ lineHeight: "140%", }} > - Select a region nearest to you - - +

({ fontSize: 13, - color: (theme) => theme.palette.text.secondary, + color: theme.palette.text.secondary, lineHeight: "inherit", marginTop: 0.5, - }} + })} > Workspace proxies improve terminal and web app connections to workspaces. This does not apply to CLI connections. A region must be manually selected, otherwise the default primary region will be used. - +

theme.palette.divider }} /> {proxyContextValue.proxies diff --git a/site/src/components/EmptyState/EmptyState.tsx b/site/src/components/EmptyState/EmptyState.tsx index d1d702b35e51e..228b7c06e9260 100644 --- a/site/src/components/EmptyState/EmptyState.tsx +++ b/site/src/components/EmptyState/EmptyState.tsx @@ -1,5 +1,4 @@ import Box from "@mui/material/Box"; -import Typography from "@mui/material/Typography"; import type { FC, ReactNode } from "react"; export interface EmptyStateProps { @@ -40,24 +39,21 @@ export const EmptyState: FC> = ( }} {...boxProps} > - - {message} - +
{message}
{description && ( - ({ + marginTop: 16, fontSize: 16, lineHeight: "140%", maxWidth: 480, - }} + color: theme.palette.text.secondary, + })} > {description} - +

)} - {cta &&
{cta}
} + {cta &&
{cta}
} {image} ); diff --git a/site/src/components/GlobalSnackbar/EnterpriseSnackbar.tsx b/site/src/components/GlobalSnackbar/EnterpriseSnackbar.tsx index 8580b705d33e7..634c963423c20 100644 --- a/site/src/components/GlobalSnackbar/EnterpriseSnackbar.tsx +++ b/site/src/components/GlobalSnackbar/EnterpriseSnackbar.tsx @@ -53,7 +53,7 @@ export const EnterpriseSnackbar: FC< action={
{action} - +
diff --git a/site/src/components/GlobalSnackbar/GlobalSnackbar.tsx b/site/src/components/GlobalSnackbar/GlobalSnackbar.tsx index f214aa16b06d5..9b97c9be021e5 100644 --- a/site/src/components/GlobalSnackbar/GlobalSnackbar.tsx +++ b/site/src/components/GlobalSnackbar/GlobalSnackbar.tsx @@ -2,7 +2,6 @@ import { type FC, useState } from "react"; import { useCustomEvent } from "hooks/events"; import { EnterpriseSnackbar } from "./EnterpriseSnackbar"; import { ErrorIcon } from "../Icons/ErrorIcon"; -import { Typography } from "../Typography/Typography"; import { type AdditionalMessage, isNotificationList, @@ -52,9 +51,7 @@ export const GlobalSnackbar: FC = () => { )}
- - {notification.msg} - + {notification.msg} {notification.additionalMsgs && notification.additionalMsgs.map((msg, index) => ( @@ -92,18 +89,14 @@ const styles = { function AdditionalMessageDisplay({ message }: { message: AdditionalMessage }) { if (isNotificationText(message)) { - return ( - - {message} - - ); + return {message}; } if (isNotificationTextPrefixed(message)) { return ( - + {message.prefix}: {message.text} - + ); } @@ -112,9 +105,7 @@ function AdditionalMessageDisplay({ message }: { message: AdditionalMessage }) {
    {message.map((item, idx) => (
  • - - {item} - + {item}
  • ))}
diff --git a/site/src/components/Paywall/Paywall.tsx b/site/src/components/Paywall/Paywall.tsx index 15a0a13f35a71..2f9d9ba860b88 100644 --- a/site/src/components/Paywall/Paywall.tsx +++ b/site/src/components/Paywall/Paywall.tsx @@ -1,5 +1,4 @@ import Box from "@mui/material/Box"; -import Typography from "@mui/material/Typography"; import { type FC, type ReactNode } from "react"; import { type Interpolation, type Theme } from "@emotion/react"; import { EnterpriseBadge } from "components/Badges/Badges"; @@ -18,21 +17,11 @@ export const Paywall: FC> = (props) => {
- - {message} - +
{message}
- {description && ( - - {description} - - )} + {description &&

{description}

}
{cta}
@@ -58,13 +47,17 @@ const styles = { title: { fontWeight: 600, fontFamily: "inherit", + fontSize: 24, + margin: 0, }, - description: { - marginTop: 8, + description: (theme) => ({ + marginTop: 16, fontFamily: "inherit", maxWidth: 420, lineHeight: "160%", - }, + color: theme.palette.text.secondary, + fontSize: 14, + }), enterpriseChip: (theme) => ({ background: theme.palette.success.dark, color: theme.palette.success.contrastText, diff --git a/site/src/components/SettingsLayout/Section.tsx b/site/src/components/SettingsLayout/Section.tsx index 1373fb3dae3db..25e3ea6e271d1 100644 --- a/site/src/components/SettingsLayout/Section.tsx +++ b/site/src/components/SettingsLayout/Section.tsx @@ -1,6 +1,4 @@ -import Typography from "@mui/material/Typography"; import { type FC, type ReactNode, type PropsWithChildren } from "react"; -import { SectionAction } from "./SectionAction"; import { type Interpolation, type Theme } from "@emotion/react"; type SectionLayout = "fixed" | "fluid"; @@ -17,9 +15,7 @@ export interface SectionProps { children?: ReactNode; } -type SectionFC = FC> & { - Action: typeof SectionAction; -}; +type SectionFC = FC>; export const Section: SectionFC = ({ id, @@ -38,12 +34,19 @@ export const Section: SectionFC = ({
{title && ( - +

{title} - +

)} {description && typeof description === "string" && ( - {description} +

{description}

)} {description && typeof description !== "string" && (
{description}
@@ -59,9 +62,6 @@ export const Section: SectionFC = ({ ); }; -// Sub-components -Section.Action = SectionAction; - const styles = { header: { marginBottom: 24, diff --git a/site/src/components/SettingsLayout/SectionAction.tsx b/site/src/components/SettingsLayout/SectionAction.tsx deleted file mode 100644 index 2fa570c08dd23..0000000000000 --- a/site/src/components/SettingsLayout/SectionAction.tsx +++ /dev/null @@ -1,11 +0,0 @@ -import { type FC } from "react"; - -/** - * SectionAction is a content box that call to actions should be placed - * within - */ -export const SectionAction: FC> = ({ - children, -}) => { - return
{children}
; -}; diff --git a/site/src/components/Typography/Typography.stories.tsx b/site/src/components/Typography/Typography.stories.tsx deleted file mode 100644 index b5c979f1c975a..0000000000000 --- a/site/src/components/Typography/Typography.stories.tsx +++ /dev/null @@ -1,25 +0,0 @@ -import { Typography } from "./Typography"; -import type { Meta, StoryObj } from "@storybook/react"; - -const meta: Meta = { - title: "components/Typography", - component: Typography, - args: { - children: "Colorless green ideas sleep furiously", - }, -}; - -export default meta; -type Story = StoryObj; - -export const Short: Story = { - args: { - short: true, - }, -}; - -export const Tall: Story = { - args: { - short: false, - }, -}; diff --git a/site/src/components/Typography/Typography.tsx b/site/src/components/Typography/Typography.tsx deleted file mode 100644 index ce210a067eebf..0000000000000 --- a/site/src/components/Typography/Typography.tsx +++ /dev/null @@ -1,38 +0,0 @@ -/** - * @fileoverview (TODO: Grey) This file is in a temporary state and is a - * verbatim port from `@coder/ui`. - */ - -import MuiTypography, { - TypographyProps as MuiTypographyProps, -} from "@mui/material/Typography"; -import * as React from "react"; - -export interface TypographyProps extends MuiTypographyProps { - short?: boolean; -} - -/** - * Wrapper around Material UI's Typography component to allow for future - * custom typography types. - * - * See original component's Material UI documentation here: https://material-ui.com/components/typography/ - */ -export const Typography: React.FC = ({ short, ...attrs }) => { - return ( - - ); -}; diff --git a/site/src/components/Welcome/Welcome.tsx b/site/src/components/Welcome/Welcome.tsx index 708a68c008cee..9036717866efd 100644 --- a/site/src/components/Welcome/Welcome.tsx +++ b/site/src/components/Welcome/Welcome.tsx @@ -1,6 +1,5 @@ -import Typography from "@mui/material/Typography"; import { type FC, type PropsWithChildren } from "react"; -import { css, useTheme } from "@emotion/react"; +import { useTheme } from "@emotion/react"; import { CoderIcon } from "../Icons/CoderIcon"; const Language = { @@ -31,22 +30,23 @@ export const Welcome: FC< }} />
- {message} - +
); }; diff --git a/site/src/pages/404Page/404Page.tsx b/site/src/pages/404Page/404Page.tsx index 5b11ac4b6e9c3..3d9fdcdf5020b 100644 --- a/site/src/pages/404Page/404Page.tsx +++ b/site/src/pages/404Page/404Page.tsx @@ -1,4 +1,3 @@ -import Typography from "@mui/material/Typography"; import { type FC } from "react"; export const NotFoundPage: FC = () => { @@ -20,9 +19,9 @@ export const NotFoundPage: FC = () => { borderRight: theme.palette.divider, })} > - 404 +

404

- This page could not be found. +

This page could not be found.

); }; diff --git a/site/src/pages/TemplateVersionEditorPage/FileDialog.tsx b/site/src/pages/TemplateVersionEditorPage/FileDialog.tsx index 4c3f9ce234751..5e1d8e257ee9c 100644 --- a/site/src/pages/TemplateVersionEditorPage/FileDialog.tsx +++ b/site/src/pages/TemplateVersionEditorPage/FileDialog.tsx @@ -2,7 +2,6 @@ import TextField from "@mui/material/TextField"; import { ConfirmDialog } from "components/Dialogs/ConfirmDialog/ConfirmDialog"; import { Stack } from "components/Stack/Stack"; import { ChangeEvent, FC, useState } from "react"; -import Typography from "@mui/material/Typography"; import { allowedExtensions, isAllowedFile } from "utils/templateVersion"; import { FileTree, isFolder, validatePath } from "utils/filetree"; @@ -59,11 +58,11 @@ export const CreateFileDialog: FC<{ confirmText="Create" title="Create File" description={ - - + +

Specify the path to a file to be created. This path can contain slashes too. - +

{ diff --git a/site/src/pages/UserSettingsPage/SecurityPage/SingleSignOnSection.tsx b/site/src/pages/UserSettingsPage/SecurityPage/SingleSignOnSection.tsx index 15d619b7679bb..3aff1d7881c58 100644 --- a/site/src/pages/UserSettingsPage/SecurityPage/SingleSignOnSection.tsx +++ b/site/src/pages/UserSettingsPage/SecurityPage/SingleSignOnSection.tsx @@ -5,7 +5,6 @@ import Box from "@mui/material/Box"; import GitHubIcon from "@mui/icons-material/GitHub"; import KeyIcon from "@mui/icons-material/VpnKey"; import Button from "@mui/material/Button"; -import Typography from "@mui/material/Typography"; import { convertToOAUTH } from "api/api"; import type { AuthMethods, @@ -278,11 +277,11 @@ const ConfirmLoginTypeChangeModal = ({ title="Change login type" confirmLoading={loading} description={ - - + +

After changing your login type, you will not be able to change it again. Are you sure you want to proceed and change your login type? - +

{