Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

chore: replace remaining MUI buttons#20200

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
BrunoQuaresma wants to merge5 commits intomain
base:main
Choose a base branch
Loading
frombq/migrate-mui-buttons
Open
Show file tree
Hide file tree
Changes fromall 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 deletionsbiome.jsonc
View file
Open in desktop
Original file line numberDiff line numberDiff 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 deletionssite/src/@types/mui.d.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -13,16 +13,6 @@ declare module "@mui/material/styles" {
}
}

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

interfaceButtonPropsSizeOverrides{
xlarge:true;
}
}

declare module"@mui/material/Checkbox"{
interfaceCheckboxPropsSizeOverrides{
xsmall:true;
Expand Down
6 changes: 4 additions & 2 deletionssite/src/components/InputGroup/InputGroup.stories.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff 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
View file
Open in desktop
Original file line numberDiff line numberDiff 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 DownExpand Up@@ -323,9 +323,9 @@ export const DeploymentBannerView: FC<DeploymentBannerViewProps> = ({
fetchStats();
}
}}
variant="text"
variant="subtle"
>
<RotateCwIconclassName="size-icon-xs"/>
<RotateCwIcon />
{timeUntilRefresh}s
</Button>
</Tooltip>
Expand Down
5 changes: 3 additions & 2 deletionssite/src/modules/resources/Resources.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff 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 DownExpand 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
View file
Open in desktop
Original file line numberDiff line numberDiff 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 DownExpand 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>
<Buttoncolor="primary" fullWidth type="submit" form="updateParameters">
<ButtonclassName="w-full" type="submit" form="updateParameters">
Update parameters
</Button>
</DialogActions>
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
importtype{Interpolation,Theme}from"@emotion/react";
importButtonfrom"@mui/material/Button";
importCollapsefrom"@mui/material/Collapse";
importSkeletonfrom"@mui/material/Skeleton";
importtype{
AgentConnectionTiming,
AgentScriptTiming,
ProvisionerTiming,
}from"api/typesGenerated";
import{Button}from"components/Button/Button";
importsortByfrom"lodash/sortBy";
importuniqByfrom"lodash/uniqBy";
import{ChevronDownIcon,ChevronUpIcon}from"lucide-react";
Expand DownExpand Up@@ -96,7 +96,7 @@ export const WorkspaceTimings: FC<WorkspaceTimingsProps> = ({
<divcss={styles.collapse}>
<Button
disabled={isLoading}
variant="text"
variant="subtle"
css={styles.collapseTrigger}
onClick={()=>setIsOpen((o)=>!o)}
>
Expand Down
6 changes: 3 additions & 3 deletionssite/src/pages/CreateTemplatePage/BuildLogsDrawer.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff 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 DownExpand 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
View file
Open in desktop
Original file line numberDiff line numberDiff 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 DownExpand 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 DownExpand 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>>;
View file
Open in desktop
Original file line numberDiff line numberDiff 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 DownExpand 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
View file
Open in desktop
Original file line numberDiff line numberDiff 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 DownExpand 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 numberDiff line numberDiff 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 DownExpand 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 deletionsite/src/pages/ExternalAuthPage/ExternalAuthPage.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff 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 DownExpand 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 deletionssite/src/pages/GroupsPage/GroupPage.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff 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 DownExpand Up@@ -120,23 +119,22 @@ const GroupPage: FC = () => {

{canUpdateGroup && (
<Stack direction="row" spacing={2}>
<MuiButton
component={RouterLink}
startIcon={<SettingsIconclassName="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 DownExpand 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

[8]ページ先頭

©2009-2025 Movatter.jp