Skip to content

chore(site): remove paperLight background value #10857

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Nov 27, 2023
4 changes: 0 additions & 4 deletions site/src/@types/mui.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ declare module "@mui/material/styles" {
experimental: NewTheme;
}

interface TypeBackground {
paperLight: string;
}

interface Palette {
neutral: PaletteColor;
}
Expand Down
2 changes: 1 addition & 1 deletion site/src/components/Dashboard/Navbar/NavbarView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,8 @@ export const NavbarView: FC<NavbarViewProps> = ({
<nav
css={(theme) => ({
height: navHeight,
background: theme.palette.background.paper,
borderBottom: `1px solid ${theme.palette.divider}`,
backgroundColor: theme.palette.background.paper,
})}
>
<div css={styles.wrapper}>
Expand Down
3 changes: 1 addition & 2 deletions site/src/components/DeploySettingsLayout/Fieldset.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ export const Fieldset: FC<FieldsetProps> = (props) => {
css={{
borderRadius: 8,
border: `1px solid ${theme.palette.divider}`,
background: theme.palette.background.paper,
marginTop: 32,
}}
onSubmit={onSubmit}
Expand Down Expand Up @@ -63,7 +62,7 @@ export const Fieldset: FC<FieldsetProps> = (props) => {
css={[
theme.typography.body2 as CSSObject,
{
background: theme.palette.background.paperLight,
background: theme.palette.background.paper,
padding: "16px 24px",
display: "flex",
alignItems: "center",
Expand Down
8 changes: 2 additions & 6 deletions site/src/components/DeploySettingsLayout/Option.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,7 @@ interface OptionConfigProps extends BoxProps {
export const OptionConfig = (props: OptionConfigProps) => {
const { source, sx, ...attrs } = props;
const theme = useTheme();
const borderColor = source
? theme.palette.primary.main
: theme.palette.divider;
const borderColor = source ? undefined : theme.palette.divider;

return (
<Box
Expand All @@ -139,9 +137,7 @@ export const OptionConfig = (props: OptionConfigProps) => {
fontFamily: MONOSPACE_FONT_FAMILY,
fontWeight: 600,
backgroundColor: (theme) =>
source
? theme.palette.primary.dark
: theme.palette.background.paperLight,
source ? theme.palette.primary.dark : theme.palette.background.paper,
display: "inline-flex",
alignItems: "center",
borderRadius: 0.25,
Expand Down
3 changes: 1 addition & 2 deletions site/src/components/ErrorBoundary/RuntimeErrorState.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,6 @@ const styles = {
}),

stack: (theme) => ({
backgroundColor: theme.palette.background.paper,
border: `1px solid ${theme.palette.divider}`,
borderRadius: 4,
marginTop: 64,
Expand All @@ -174,7 +173,7 @@ const styles = {
fontWeight: 600,
letterSpacing: 1,
padding: "8px 8px 8px 16px",
backgroundColor: theme.palette.background.paperLight,
backgroundColor: theme.palette.background.paper,
borderBottom: `1px solid ${theme.palette.divider}`,
color: theme.palette.text.secondary,
display: "flex",
Expand Down
2 changes: 1 addition & 1 deletion site/src/components/Filter/filter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ const BaseSkeleton = (props: SkeletonProps) => {
height={36}
{...props}
sx={{
bgcolor: (theme) => theme.palette.background.paperLight,
bgcolor: (theme) => theme.palette.background.paper,
borderRadius: "6px",
...props.sx,
}}
Expand Down
2 changes: 1 addition & 1 deletion site/src/components/Markdown/Markdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ const markdownStyles: Interpolation<Theme> = (theme: Theme) => ({
},

"& .prismjs": {
background: theme.palette.background.paperLight,
background: theme.palette.background.paper,
borderRadius: 8,
padding: "16px 24px",
overflowX: "auto",
Expand Down
2 changes: 1 addition & 1 deletion site/src/components/PageHeader/FullWidthPageHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const FullWidthPageHeader: FC<
{
...(theme.typography.body2 as CSSObject),
padding: 24,
background: theme.palette.background.paper,
background: theme.palette.background.default,
borderBottom: `1px solid ${theme.palette.divider}`,
display: "flex",
alignItems: "center",
Expand Down
52 changes: 23 additions & 29 deletions site/src/components/Resources/AgentButton.tsx
Original file line number Diff line number Diff line change
@@ -1,34 +1,28 @@
import Button, { ButtonProps } from "@mui/material/Button";
import { FC, forwardRef } from "react";

export const PrimaryAgentButton: FC<ButtonProps> = ({
className,
...props
}) => {
return (
<Button
color="neutral"
{...props}
sx={{
backgroundColor: (theme) => theme.palette.background.default,
"&:hover": {
backgroundColor: (theme) => theme.palette.background.paper,
},
// Making them smaller since those icons don't have a padding around them
"& .MuiButton-startIcon": {
width: 12,
height: 12,
"& svg": { width: "100%", height: "100%" },
},
...props.sx,
}}
/>
);
};
import { forwardRef } from "react";

// eslint-disable-next-line react/display-name -- Name is inferred from variable name
export const SecondaryAgentButton = forwardRef<HTMLButtonElement, ButtonProps>(
({ className, ...props }, ref) => {
return <Button ref={ref} className={className} {...props} />;
export const AgentButton = forwardRef<HTMLButtonElement, ButtonProps>(
(props, ref) => {
return (
<Button
color="neutral"
{...props}
ref={ref}
sx={{
backgroundColor: (theme) => theme.palette.background.default,
"&:hover": {
backgroundColor: (theme) => theme.palette.background.paper,
},
// Making them smaller since those icons don't have a padding around them
"& .MuiButton-startIcon": {
width: 12,
height: 12,
"& svg": { width: "100%", height: "100%" },
},
...props.sx,
}}
/>
);
},
);
1 change: 0 additions & 1 deletion site/src/components/Resources/AgentMetadata.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,6 @@ const styles = {
root: (theme) => ({
padding: "20px 32px",
borderTop: `1px solid ${theme.palette.divider}`,
background: theme.palette.background.paper,
overflowX: "auto",
scrollPadding: "0 32px",
}),
Expand Down
2 changes: 1 addition & 1 deletion site/src/components/Resources/AgentRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,6 @@ const useAgentLogs = (

const styles = {
agentRow: (theme) => ({
backgroundColor: theme.palette.background.paperLight,
fontSize: 16,
borderLeft: `2px solid ${theme.palette.text.secondary}`,

Expand Down Expand Up @@ -578,6 +577,7 @@ const styles = {
alignItems: "center",
gap: 48,
flexWrap: "wrap",
backgroundColor: theme.palette.background.paper,

[theme.breakpoints.down("md")]: {
gap: 16,
Expand Down
2 changes: 1 addition & 1 deletion site/src/components/Resources/AgentRowPreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export const AgentRowPreview: FC<AgentRowPreviewProps> = ({
const styles = {
agentRow: (theme) => ({
padding: "16px 32px",
backgroundColor: theme.palette.background.paperLight,
backgroundColor: theme.palette.background.paper,
fontSize: 16,
position: "relative",

Expand Down
6 changes: 3 additions & 3 deletions site/src/components/Resources/AppLink/AppLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { useTheme } from "@emotion/react";
import { getApiKey } from "api/api";
import type * as TypesGen from "api/typesGenerated";
import { useProxy } from "contexts/ProxyContext";
import { PrimaryAgentButton } from "components/Resources/AgentButton";
import { AgentButton } from "components/Resources/AgentButton";
import { createAppLinkHref } from "utils/apps";
import { generateRandomString } from "utils/random";
import { BaseIcon } from "./BaseIcon";
Expand Down Expand Up @@ -86,7 +86,7 @@ export const AppLink: FC<AppLinkProps> = ({ app, workspace, agent }) => {
const isPrivateApp = app.sharing_level === "owner";

const button = (
<PrimaryAgentButton
<AgentButton
startIcon={icon}
endIcon={isPrivateApp ? undefined : <ShareIcon app={app} />}
disabled={!canClick}
Expand All @@ -100,7 +100,7 @@ export const AppLink: FC<AppLinkProps> = ({ app, workspace, agent }) => {
>
{appDisplayName}
</span>
</PrimaryAgentButton>
</AgentButton>
);

return (
Expand Down
6 changes: 3 additions & 3 deletions site/src/components/Resources/PortForwardButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {
HelpTooltipText,
HelpTooltipTitle,
} from "components/HelpTooltip/HelpTooltip";
import { SecondaryAgentButton } from "components/Resources/AgentButton";
import { AgentButton } from "components/Resources/AgentButton";
import {
Popover,
PopoverContent,
Expand Down Expand Up @@ -49,14 +49,14 @@ export const PortForwardButton: FC<PortForwardButtonProps> = (props) => {
return (
<Popover>
<PopoverTrigger>
<SecondaryAgentButton disabled={!portsQuery.data}>
<AgentButton disabled={!portsQuery.data}>
Ports
{portsQuery.data ? (
<div css={styles.portCount}>{portsQuery.data.ports.length}</div>
) : (
<CircularProgress size={10} css={{ marginLeft: 8 }} />
)}
</SecondaryAgentButton>
</AgentButton>
</PopoverTrigger>
<PopoverContent horizontal="right" classes={{ paper }}>
<PortForwardPopoverView {...props} ports={portsQuery.data?.ports} />
Expand Down
1 change: 0 additions & 1 deletion site/src/components/Resources/ResourceCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import { SensitiveValue } from "./SensitiveValue";

const styles = {
resourceCard: (theme) => ({
background: theme.palette.background.paper,
borderRadius: 8,
border: `1px solid ${theme.palette.divider}`,

Expand Down
4 changes: 2 additions & 2 deletions site/src/components/Resources/SSHButton/SSHButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
PopoverTrigger,
} from "components/Popover/Popover";
import { Stack } from "components/Stack/Stack";
import { SecondaryAgentButton } from "../AgentButton";
import { AgentButton } from "../AgentButton";

export interface SSHButtonProps {
workspaceName: string;
Expand All @@ -34,7 +34,7 @@ export const SSHButton: FC<PropsWithChildren<SSHButtonProps>> = ({
return (
<Popover isDefaultOpen={isDefaultOpen}>
<PopoverTrigger>
<SecondaryAgentButton>SSH</SecondaryAgentButton>
<AgentButton>SSH</AgentButton>
</PopoverTrigger>

<PopoverContent horizontal="right" classes={{ paper }}>
Expand Down
4 changes: 2 additions & 2 deletions site/src/components/Resources/TerminalLink/TerminalLink.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Link from "@mui/material/Link";
import { SecondaryAgentButton } from "components/Resources/AgentButton";
import { AgentButton } from "components/Resources/AgentButton";
import { FC } from "react";
import * as TypesGen from "api/typesGenerated";
import { generateRandomString } from "utils/random";
Expand Down Expand Up @@ -46,7 +46,7 @@ export const TerminalLink: FC<React.PropsWithChildren<TerminalLinkProps>> = ({
}}
data-testid="terminal"
>
<SecondaryAgentButton>{Language.linkText}</SecondaryAgentButton>
<AgentButton>{Language.linkText}</AgentButton>
</Link>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { FC, PropsWithChildren, useState, useRef } from "react";
import { getApiKey } from "api/api";
import { VSCodeIcon } from "components/Icons/VSCodeIcon";
import { VSCodeInsidersIcon } from "components/Icons/VSCodeInsidersIcon";
import { PrimaryAgentButton } from "components/Resources/AgentButton";
import { AgentButton } from "components/Resources/AgentButton";
import KeyboardArrowDownIcon from "@mui/icons-material/KeyboardArrowDown";
import ButtonGroup from "@mui/material/ButtonGroup";
import { useLocalStorage } from "hooks";
Expand Down Expand Up @@ -63,7 +63,7 @@ export const VSCodeDesktopButton: FC<
<VSCodeInsidersButton {...props} />
)}

<PrimaryAgentButton
<AgentButton
aria-controls={
isVariantMenuOpen ? "vscode-variant-button-menu" : undefined
}
Expand All @@ -77,7 +77,7 @@ export const VSCodeDesktopButton: FC<
sx={{ px: 0 }}
>
<KeyboardArrowDownIcon sx={{ fontSize: 16 }} />
</PrimaryAgentButton>
</AgentButton>
</ButtonGroup>

<Menu
Expand Down Expand Up @@ -126,7 +126,7 @@ const VSCodeButton = ({
const [loading, setLoading] = useState(false);

return (
<PrimaryAgentButton
<AgentButton
startIcon={<VSCodeIcon />}
disabled={loading}
onClick={() => {
Expand Down Expand Up @@ -157,7 +157,7 @@ const VSCodeButton = ({
}}
>
VS Code Desktop
</PrimaryAgentButton>
</AgentButton>
);
};

Expand All @@ -170,7 +170,7 @@ const VSCodeInsidersButton = ({
const [loading, setLoading] = useState(false);

return (
<PrimaryAgentButton
<AgentButton
startIcon={<VSCodeInsidersIcon />}
disabled={loading}
onClick={() => {
Expand Down Expand Up @@ -201,6 +201,6 @@ const VSCodeInsidersButton = ({
}}
>
VS Code Insiders
</PrimaryAgentButton>
</AgentButton>
);
};
4 changes: 2 additions & 2 deletions site/src/components/SyntaxHighlighter/coderTheme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,9 +207,9 @@ export const coderTheme = (theme: Theme): editor.IStandaloneThemeData => ({
],
colors: {
"editor.foreground": theme.palette.text.primary,
"editor.background": theme.palette.background.paper,
"editor.background": theme.palette.background.default,
"editor.selectionBackground": theme.palette.action.hover,
"editor.lineHighlightBackground": theme.palette.background.paperLight,
"editor.lineHighlightBackground": theme.palette.background.paper,

"editorCursor.foreground": "#f8f8f0",
"editorWhitespace.foreground": "#3B3A32",
Expand Down
2 changes: 1 addition & 1 deletion site/src/components/TemplateFiles/TemplateFiles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ const styles = {
}),

codeWrapper: (theme) => ({
background: theme.palette.background.paperLight,
background: theme.palette.background.paper,
}),

files: (theme) => ({
Expand Down
4 changes: 1 addition & 3 deletions site/src/components/Timeline/TimelineDateRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ export const TimelineDateRow: FC<TimelineDateRow> = ({ date }) => {
return (
<TableRow
css={css`
background: ${theme.palette.background.paper};

&:not(:first-of-type) td {
border-top: 1px solid ${theme.palette.divider};
}
Expand All @@ -24,7 +22,7 @@ export const TimelineDateRow: FC<TimelineDateRow> = ({ date }) => {
<TableCell
css={{
padding: `8px 32px !important`,
background: `${theme.palette.background.paperLight} !important`,
background: `${theme.palette.background.paper} !important`,
fontSize: 12,
position: "relative",
color: theme.palette.text.secondary,
Expand Down
2 changes: 1 addition & 1 deletion site/src/components/WorkspaceBuildLogs/Logs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ const styles = {
},

"&.debug": {
backgroundColor: theme.palette.background.paperLight,
backgroundColor: theme.palette.background.paper,
},

"&.warn": {
Expand Down
Loading