Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions biome.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
"@mui/material/Popover": "Use components/Popover/Popover instead.",
"@mui/material/Typography": "Use native HTML elements instead. Eg: <span>, <p>, <h1>, etc.",
"@mui/material/Box": "Use a <div> instead.",
"@mui/material/Button": "Use a components/Button/Button instead.",
"@mui/material/styles": "Import from @emotion/react instead.",
"lodash": "Use lodash/<name> instead."
}
Expand Down
10 changes: 0 additions & 10 deletions site/src/@types/mui.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,6 @@ declare module "@mui/material/styles" {
}
}

declare module "@mui/material/Button" {
interface ButtonPropsColorOverrides {
neutral: true;
}

interface ButtonPropsSizeOverrides {
xlarge: true;
}
}

declare module "@mui/material/Checkbox" {
interface CheckboxPropsSizeOverrides {
xsmall: true;
Expand Down
6 changes: 4 additions & 2 deletions site/src/components/InputGroup/InputGroup.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Button from "@mui/material/Button";
import TextField from "@mui/material/TextField";
import type { Meta, StoryObj } from "@storybook/react-vite";
import { Button } from "components/Button/Button";
import { InputGroup } from "./InputGroup";

const meta: Meta<typeof InputGroup> = {
Expand All @@ -15,7 +15,9 @@ export const Default: Story = {
args: {
children: (
<>
<Button>Menu</Button>
<Button variant="outline" className="h-9">
Menu
</Button>
<TextField size="small" placeholder="Search..." />
</>
),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { css, type Interpolation, type Theme, useTheme } from "@emotion/react";
import Button from "@mui/material/Button";
import Link from "@mui/material/Link";
import Tooltip from "@mui/material/Tooltip";
import type {
DeploymentStats,
HealthcheckReport,
WorkspaceStatus,
} from "api/typesGenerated";
import { Button } from "components/Button/Button";
import { HelpTooltipTitle } from "components/HelpTooltip/HelpTooltip";
import { JetBrainsIcon } from "components/Icons/JetBrainsIcon";
import { RocketIcon } from "components/Icons/RocketIcon";
Expand Down Expand Up @@ -323,9 +323,9 @@ export const DeploymentBannerView: FC<DeploymentBannerViewProps> = ({
fetchStats();
}
}}
variant="text"
variant="subtle"
>
<RotateCwIcon className="size-icon-xs" />
<RotateCwIcon />
{timeUntilRefresh}s
</Button>
</Tooltip>
Expand Down
5 changes: 3 additions & 2 deletions site/src/modules/resources/Resources.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Button from "@mui/material/Button";
import type { WorkspaceAgent, WorkspaceResource } from "api/typesGenerated";
import { Button } from "components/Button/Button";
import { DropdownArrow } from "components/DropdownArrow/DropdownArrow";
import { Stack } from "components/Stack/Stack";
import { type FC, type JSX, useState } from "react";
Expand Down Expand Up @@ -37,8 +37,9 @@ export const Resources: FC<ResourcesProps> = ({ resources, agentRow }) => {
{hasHideResources && (
<div className="flex items-center justify-center mt-4">
<Button
variant="outline"
className="rounded-full w-full max-w-[260px]"
size="small"
size="sm"
onClick={() => setShouldDisplayHideResources((v) => !v)}
>
{shouldDisplayHideResources ? "Hide" : "Show hidden"} resources
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { css } from "@emotion/css";
import type { Interpolation, Theme } from "@emotion/react";
import Button from "@mui/material/Button";
import Dialog from "@mui/material/Dialog";
import DialogActions from "@mui/material/DialogActions";
import DialogContent from "@mui/material/DialogContent";
Expand All @@ -10,6 +9,7 @@ import type {
TemplateVersionParameter,
WorkspaceBuildParameter,
} from "api/typesGenerated";
import { Button } from "components/Button/Button";
import type { DialogProps } from "components/Dialogs/Dialog";
import { FormFields, VerticalForm } from "components/Form/Form";
import { RichParameterInput } from "components/RichParameterInput/RichParameterInput";
Expand Down Expand Up @@ -97,10 +97,15 @@ export const UpdateBuildParametersDialog: FC<
</VerticalForm>
</DialogContent>
<DialogActions disableSpacing css={styles.dialogActions}>
<Button fullWidth type="button" onClick={dialogProps.onClose}>
<Button
variant="outline"
className="w-full"
type="button"
onClick={dialogProps.onClose}
>
Cancel
</Button>
<Button color="primary" fullWidth type="submit" form="updateParameters">
<Button className="w-full" type="submit" form="updateParameters">
Update parameters
</Button>
</DialogActions>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import type { Interpolation, Theme } from "@emotion/react";
import Button from "@mui/material/Button";
import Collapse from "@mui/material/Collapse";
import Skeleton from "@mui/material/Skeleton";
import type {
AgentConnectionTiming,
AgentScriptTiming,
ProvisionerTiming,
} from "api/typesGenerated";
import { Button } from "components/Button/Button";
import sortBy from "lodash/sortBy";
import uniqBy from "lodash/uniqBy";
import { ChevronDownIcon, ChevronUpIcon } from "lucide-react";
Expand Down Expand Up @@ -96,7 +96,7 @@ export const WorkspaceTimings: FC<WorkspaceTimingsProps> = ({
<div css={styles.collapse}>
<Button
disabled={isLoading}
variant="text"
variant="subtle"
css={styles.collapseTrigger}
onClick={() => setIsOpen((o) => !o)}
>
Expand Down
6 changes: 3 additions & 3 deletions site/src/pages/CreateTemplatePage/BuildLogsDrawer.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import type { Interpolation, Theme } from "@emotion/react";
import Button from "@mui/material/Button";
import Drawer from "@mui/material/Drawer";
import IconButton from "@mui/material/IconButton";
import { visuallyHidden } from "@mui/utils";
import { JobError } from "api/queries/templates";
import type { TemplateVersion } from "api/typesGenerated";
import { Button } from "components/Button/Button";
import { Loader } from "components/Loader/Loader";
import { TriangleAlertIcon, XIcon } from "lucide-react";
import { AlertVariant } from "modules/provisioners/ProvisionerAlert";
Expand Down Expand Up @@ -103,8 +103,8 @@ const MissingVariablesBanner: FC<MissingVariablesBannerProps> = ({
</p>
<Button
css={bannerStyles.button}
size="small"
variant="outlined"
size="sm"
variant="outline"
onClick={onFillVariables}
>
Fill variables
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { CSSObject, Interpolation, Theme } from "@emotion/react";
import Button from "@mui/material/Button";
import Paper from "@mui/material/Paper";
import type { GetLicensesResponse } from "api/api";
import { Button } from "components/Button/Button";
import { ConfirmDialog } from "components/Dialogs/ConfirmDialog/ConfirmDialog";
import { Pill } from "components/Pill/Pill";
import { Stack } from "components/Stack/Stack";
Expand Down Expand Up @@ -106,9 +106,8 @@ export const LicenseCard: FC<LicenseCardProps> = ({
</Stack>
<Stack spacing={2}>
<Button
css={styles.removeButton}
variant="contained"
size="small"
variant="destructive"
size="sm"
onClick={() => setLicenseIDMarkedForRemoval(license.id)}
className="remove-button"
>
Expand Down Expand Up @@ -150,10 +149,4 @@ const styles = {
secondaryMaincolor: (theme) => ({
color: theme.palette.text.secondary,
}),
removeButton: (theme) => ({
color: theme.palette.error.main,
"&:hover": {
backgroundColor: "transparent",
},
}),
} satisfies Record<string, Interpolation<Theme>>;
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { type Interpolation, type Theme, useTheme } from "@emotion/react";
import MuiButton from "@mui/material/Button";
import MuiLink from "@mui/material/Link";
import Skeleton from "@mui/material/Skeleton";
import Tooltip from "@mui/material/Tooltip";
Expand Down Expand Up @@ -75,13 +74,12 @@ const LicensesSettingsPageView: FC<Props> = ({
</SettingsHeader>

<Stack direction="row" spacing={2}>
<MuiButton
component={Link}
to="/deployment/licenses/add"
startIcon={<PlusIcon className="size-icon-sm" />}
>
Add a license
</MuiButton>
<Button variant="outline" asChild>
<Link to="/deployment/licenses/add">
<PlusIcon />
Add a license
</Link>
</Button>
<Tooltip title="Refresh license entitlements. This is done automatically every 10 minutes.">
<Button
disabled={isRefreshing}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import type { Interpolation, Theme } from "@emotion/react";
import Button from "@mui/material/Button";
import Card from "@mui/material/Card";
import Divider from "@mui/material/Divider";
import List from "@mui/material/List";
Expand All @@ -15,6 +14,7 @@ import {
} from "api/queries/notifications";
import type { DeploymentValues } from "api/typesGenerated";
import { Alert } from "components/Alert/Alert";
import { Button } from "components/Button/Button";
import { displayError, displaySuccess } from "components/GlobalSnackbar/utils";
import { Stack } from "components/Stack/Stack";
import {
Expand Down Expand Up @@ -66,15 +66,14 @@ export const NotificationEvents: FC<NotificationEventsProps> = ({
<Alert
severity="warning"
actions={
<Button
variant="text"
size="small"
component="a"
target="_blank"
rel="noreferrer"
href={docs("/admin/monitoring/notifications#webhook")}
>
Read the docs
<Button variant="subtle" size="sm" asChild>
<a
target="_blank"
rel="noreferrer"
href={docs("/admin/monitoring/notifications#webhook")}
>
Read the docs
</a>
</Button>
}
>
Expand All @@ -86,15 +85,14 @@ export const NotificationEvents: FC<NotificationEventsProps> = ({
<Alert
severity="warning"
actions={
<Button
variant="text"
size="small"
component="a"
target="_blank"
rel="noreferrer"
href={docs("/admin/monitoring/notifications#smtp-email")}
>
Read the docs
<Button variant="subtle" size="sm" asChild>
<a
target="_blank"
rel="noreferrer"
href={docs("/admin/monitoring/notifications#smtp-email")}
>
Read the docs
</a>
</Button>
}
>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { useTheme } from "@emotion/react";
import Button from "@mui/material/Button";
import Table from "@mui/material/Table";
import TableBody from "@mui/material/TableBody";
import TableCell from "@mui/material/TableCell";
Expand All @@ -9,6 +8,7 @@ import TableRow from "@mui/material/TableRow";
import type * as TypesGen from "api/typesGenerated";
import { ErrorAlert } from "components/Alert/ErrorAlert";
import { Avatar } from "components/Avatar/Avatar";
import { Button } from "components/Button/Button";
import {
SettingsHeader,
SettingsHeaderDescription,
Expand Down Expand Up @@ -48,12 +48,11 @@ const OAuth2AppsSettingsPageView: FC<OAuth2AppsSettingsProps> = ({
</SettingsHeader>
</div>

<Button
component={Link}
to="/deployment/oauth2-provider/apps/add"
startIcon={<PlusIcon className="size-icon-sm" />}
>
Add application
<Button variant="outline" asChild>
<Link to="/deployment/oauth2-provider/apps/add">
<PlusIcon />
Add application
</Link>
</Button>
</Stack>

Expand Down
3 changes: 2 additions & 1 deletion site/src/pages/ExternalAuthPage/ExternalAuthPage.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import Button from "@mui/material/Button";
import type { ApiErrorResponse } from "api/errors";
import {
exchangeExternalAuthDevice,
externalAuthDevice,
externalAuthProvider,
} from "api/queries/externalAuth";
import { isAxiosError } from "axios";
import { Button } from "components/Button/Button";
import {
isExchangeErrorRetryable,
newRetryDelay,
Expand Down Expand Up @@ -91,6 +91,7 @@ const ExternalAuthPage: FC = () => {
</p>
<br />
<Button
variant="outline"
onClick={() => {
// Redirect to the auth flow again. *crosses fingers*
window.location.href = `/external-auth/${provider}/callback`;
Expand Down
28 changes: 10 additions & 18 deletions site/src/pages/GroupsPage/GroupPage.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import type { Interpolation, Theme } from "@emotion/react";
import MuiButton from "@mui/material/Button";
import { getErrorMessage } from "api/errors";
import {
addMember,
Expand Down Expand Up @@ -120,23 +119,22 @@ const GroupPage: FC = () => {

{canUpdateGroup && (
<Stack direction="row" spacing={2}>
<MuiButton
component={RouterLink}
startIcon={<SettingsIcon className="size-icon-sm" />}
to="settings"
>
Settings
</MuiButton>
<MuiButton
<Button variant="outline" asChild>
<RouterLink to="settings">
<SettingsIcon />
Settings
</RouterLink>
</Button>
<Button
variant="destructive"
disabled={groupData?.id === groupData?.organization_id}
onClick={() => {
setIsDeletingGroup(true);
}}
startIcon={<TrashIcon className="size-icon-xs" />}
css={styles.removeButton}
>
<TrashIcon />
Delete&hellip;
</MuiButton>
</Button>
</Stack>
)}
</Stack>
Expand Down Expand Up @@ -353,12 +351,6 @@ const styles = {
autoComplete: {
width: 300,
},
removeButton: (theme) => ({
color: theme.palette.error.main,
"&:hover": {
backgroundColor: "transparent",
},
}),
status: {
textTransform: "capitalize",
},
Expand Down
Loading
Loading