From 755e8be5adc0092e594bb633187ee41ce9d46b06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kayla=20=E3=81=AF=E3=81=AA?= Date: Tue, 31 Mar 2026 12:07:33 -0400 Subject: [PATCH] chore: migrate some emotion styles to tailwind (#23817) --- site/src/components/Avatar/AvatarCard.tsx | 2 +- site/src/components/Badges/Badges.tsx | 7 +-- site/src/components/CustomLogo/CustomLogo.tsx | 10 ++-- .../Dialogs/DeleteDialog/DeleteDialog.tsx | 2 +- .../DurationField/DurationField.tsx | 7 +-- site/src/components/Filter/Filter.tsx | 2 +- site/src/components/IconField/IconField.tsx | 13 +---- site/src/components/Icons/JetBrainsIcon.tsx | 2 +- site/src/components/Logs/Logs.tsx | 2 +- site/src/components/Margins/Margins.tsx | 8 +-- .../OverflowY/OverflowY.stories.tsx | 9 +--- site/src/components/OverflowY/OverflowY.tsx | 6 +-- .../PageHeader/FullWidthPageHeader.tsx | 13 +---- .../RichParameterInput/RichParameterInput.tsx | 6 +-- site/src/components/Sidebar/Sidebar.tsx | 8 +-- site/src/modules/apps/AppStatusStateIcon.tsx | 5 +- .../src/modules/dashboard/DashboardLayout.tsx | 13 +---- .../modules/dashboard/Navbar/ProxyMenu.tsx | 2 +- .../management/DeploymentSettingsLayout.tsx | 2 +- site/src/modules/provisioners/Provisioner.tsx | 41 +++------------ .../modules/provisioners/ProvisionerTag.tsx | 2 +- .../resources/AgentLogs/AgentLogLine.tsx | 2 +- .../modules/resources/PortForwardButton.tsx | 22 ++------ site/src/modules/resources/ResourceCard.tsx | 7 +-- .../VSCodeDesktopButton.tsx | 8 +-- .../VSCodeDevContainerButton.tsx | 8 +-- .../TemplateExampleCard.tsx | 8 ++- .../WorkspaceBuildData/WorkspaceBuildData.tsx | 14 ++--- .../DownloadLogsDialog.tsx | 2 +- .../UpdateBuildParametersDialog.tsx | 2 +- .../WorkspaceDeleteDialog.tsx | 14 ++--- .../WorkspaceOutdatedTooltip.tsx | 4 +- .../WorkspaceTiming/StagesChart.tsx | 8 +-- .../WorkspaceTimings.stories.tsx | 2 +- .../CliInstallPage/CliInstallPageView.tsx | 6 +-- .../CreateTemplateGalleryPageView.tsx | 24 ++------- .../StarterTemplates.tsx | 11 +--- .../CreateTemplatePage/CreateTemplateForm.tsx | 2 +- .../DuplicateTemplateView.tsx | 2 +- .../pages/CreateTokenPage/CreateTokenPage.tsx | 7 +-- .../AnnouncementBannerDialog.tsx | 2 +- .../ExternalAuthSettingsPageView.tsx | 9 +--- .../AddNewLicensePageView.tsx | 2 +- .../NotificationsPage/NotificationEvents.tsx | 6 +-- .../EditOAuth2AppPageView.tsx | 9 +--- .../OAuth2AppsSettingsPageView.tsx | 4 +- .../pages/DeploymentSettingsPage/Option.tsx | 11 ++-- .../ExternalAuthPage/ExternalAuthPage.tsx | 2 +- .../src/pages/GroupsPage/GroupMembersPage.tsx | 2 +- site/src/pages/GroupsPage/GroupsPageView.tsx | 2 +- site/src/pages/HealthPage/Content.tsx | 52 ++++--------------- .../pages/HealthPage/DismissWarningButton.tsx | 2 +- .../pages/HealthPage/WorkspaceProxyPage.tsx | 41 ++++----------- site/src/pages/IconsPage/IconsPage.tsx | 11 +--- site/src/pages/LoginPage/OAuthSignInForm.tsx | 2 +- .../CreateOrganizationPageView.tsx | 2 +- .../OrganizationSettingsPageView.tsx | 4 +- site/src/pages/SetupPage/SetupPageView.tsx | 31 +++-------- .../StarterTemplatePageView.tsx | 22 +------- .../TemplateDocsPage/TemplateDocsPage.tsx | 8 +-- .../TemplateEmbedPage/TemplateEmbedPage.tsx | 16 +----- .../TemplateVersionsPage/VersionsTable.tsx | 2 +- .../TemplateSettingsForm.tsx | 2 +- .../TemplateSettingsPageView.tsx | 2 +- .../TemplateSchedulePage/ScheduleDialog.tsx | 4 +- .../TemplateSchedulePageView.tsx | 2 +- .../TemplateSettingsLayout.tsx | 2 +- .../TemplateVariablesPageView.tsx | 4 +- .../pages/TemplatesPage/EmptyTemplates.tsx | 2 +- .../pages/TemplatesPage/TemplatesPageView.tsx | 2 +- site/src/pages/TerminalPage/TerminalPage.tsx | 5 +- .../ExternalAuthPage/ExternalAuthPageView.tsx | 2 +- .../OAuth2ProviderPageView.tsx | 2 +- .../SSHKeysPage/SSHKeysPageView.tsx | 2 +- site/src/pages/UserSettingsPage/Section.tsx | 17 ++---- .../TokensPage/TokensPage.tsx | 2 +- .../pages/UsersPage/ResetPasswordDialog.tsx | 7 +-- .../UsersPage/UsersTable/UserGroupsCell.tsx | 36 +++---------- .../UsersPage/UsersTable/UsersTableBody.tsx | 8 +-- .../pages/WorkspacePage/HistorySidebar.tsx | 2 +- .../pages/WorkspacePage/ResourcesSidebar.tsx | 25 ++------- .../WorkspaceActions/WorkspaceActions.tsx | 5 +- .../WorkspaceBuildLogsSection.tsx | 12 +---- .../WorkspaceNotifications/Notifications.tsx | 2 +- .../WorkspaceNotifications.tsx | 2 +- .../src/pages/WorkspacePage/WorkspacePage.tsx | 2 +- .../WorkspaceScheduleControls.tsx | 7 +-- .../pages/WorkspacePage/WorkspaceTopbar.tsx | 19 +++---- .../WorkspaceParametersPage.tsx | 2 +- .../WorkspaceSchedulePage.tsx | 2 +- .../WorkspaceSettingsLayout.tsx | 2 +- .../WorkspaceSettingsPageView.tsx | 6 +-- .../pages/WorkspacesPage/WorkspacesButton.tsx | 20 ++----- .../WorkspacesPage/WorkspacesPageView.tsx | 2 +- 94 files changed, 199 insertions(+), 569 deletions(-) diff --git a/site/src/components/Avatar/AvatarCard.tsx b/site/src/components/Avatar/AvatarCard.tsx index e008e5fd79..e9b86e94c0 100644 --- a/site/src/components/Avatar/AvatarCard.tsx +++ b/site/src/components/Avatar/AvatarCard.tsx @@ -37,7 +37,7 @@ export const AvatarCard: FC = ({ * * @see {@link https://css-tricks.com/flexbox-truncated-text/} */} -
+

{ export const Badges: React.FC = ({ children }) => { return ( - + {children} ); diff --git a/site/src/components/CustomLogo/CustomLogo.tsx b/site/src/components/CustomLogo/CustomLogo.tsx index af01b30ba8..c0629f10fd 100644 --- a/site/src/components/CustomLogo/CustomLogo.tsx +++ b/site/src/components/CustomLogo/CustomLogo.tsx @@ -1,19 +1,18 @@ -import type { Interpolation, Theme } from "@emotion/react"; import type { FC } from "react"; import { CoderIcon } from "#/components/Icons/CoderIcon"; import { getApplicationName, getLogoURL } from "#/utils/appearance"; +import { cn } from "#/utils/cn"; /** * Enterprise customers can set a custom logo for their Coder application. Use * the custom logo wherever the Coder logo is used, if a custom one is provided. */ -export const CustomLogo: FC<{ css?: Interpolation }> = (props) => { +export const CustomLogo: FC<{ className?: string }> = ({ className }) => { const applicationName = getApplicationName(); const logoURL = getLogoURL(); return logoURL ? ( {applicationName} }> = (props) => { onLoad={(e) => { e.currentTarget.style.display = "inline"; }} - css={{ maxWidth: 200 }} - className="application-logo" + className={cn("max-w-[200px] application-logo", className)} /> ) : ( - + ); }; diff --git a/site/src/components/Dialogs/DeleteDialog/DeleteDialog.tsx b/site/src/components/Dialogs/DeleteDialog/DeleteDialog.tsx index 9bee94fe24..851dd5534c 100644 --- a/site/src/components/Dialogs/DeleteDialog/DeleteDialog.tsx +++ b/site/src/components/Dialogs/DeleteDialog/DeleteDialog.tsx @@ -78,7 +78,7 @@ export const DeleteDialog: FC = ({ = (props) => { return (
-
+
= ({ children, ...skeletonProps }) => { }; export const MenuSkeleton: FC = () => { - return ; + return ; }; type FilterProps = { diff --git a/site/src/components/IconField/IconField.tsx b/site/src/components/IconField/IconField.tsx index 01d74b7464..b38431d8d0 100644 --- a/site/src/components/IconField/IconField.tsx +++ b/site/src/components/IconField/IconField.tsx @@ -43,18 +43,7 @@ export const IconField: FC = ({ endAdornment: hasIcon ? ( ( 25.59l85.73-58.84a7.35 7.35 0 0 0 3.17-6.05z" fill="#fff" /> - + = ({ }) => { return (
-
+
{lines.map((line) => ( {!hideTimestamps && ( diff --git a/site/src/components/Margins/Margins.tsx b/site/src/components/Margins/Margins.tsx index d97ad7cdcd..ea42d45af2 100644 --- a/site/src/components/Margins/Margins.tsx +++ b/site/src/components/Margins/Margins.tsx @@ -4,6 +4,7 @@ import { containerWidthMedium, sidePadding, } from "#/theme/constants"; +import { cn } from "#/utils/cn"; type Size = "regular" | "medium" | "small"; @@ -20,20 +21,19 @@ type MarginsProps = JSX.IntrinsicElements["div"] & { export const Margins: FC = ({ size = "regular", children, + className, ...divProps }) => { const maxWidth = widthBySize[size]; return (
{children}
diff --git a/site/src/components/OverflowY/OverflowY.stories.tsx b/site/src/components/OverflowY/OverflowY.stories.tsx index 65a76755ef..266e7b2b36 100644 --- a/site/src/components/OverflowY/OverflowY.stories.tsx +++ b/site/src/components/OverflowY/OverflowY.stories.tsx @@ -14,13 +14,8 @@ const meta: Meta = { children: numbers.map((num, i) => (

Element {num}

diff --git a/site/src/components/OverflowY/OverflowY.tsx b/site/src/components/OverflowY/OverflowY.tsx index 46c553f8a3..cce9ad68ce 100644 --- a/site/src/components/OverflowY/OverflowY.tsx +++ b/site/src/components/OverflowY/OverflowY.tsx @@ -27,12 +27,10 @@ export const OverflowY: FC = ({ return (
diff --git a/site/src/components/PageHeader/FullWidthPageHeader.tsx b/site/src/components/PageHeader/FullWidthPageHeader.tsx index f369c88fb6..ac1ccfcaa4 100644 --- a/site/src/components/PageHeader/FullWidthPageHeader.tsx +++ b/site/src/components/PageHeader/FullWidthPageHeader.tsx @@ -63,18 +63,7 @@ const _PageHeaderActions: FC = ({ children }) => { }; export const PageHeaderTitle: FC = ({ children }) => { - return ( -

- {children} -

- ); + return

{children}

; }; export const PageHeaderSubtitle: FC = ({ children }) => { diff --git a/site/src/components/RichParameterInput/RichParameterInput.tsx b/site/src/components/RichParameterInput/RichParameterInput.tsx index f39f881ecb..9654422c89 100644 --- a/site/src/components/RichParameterInput/RichParameterInput.tsx +++ b/site/src/components/RichParameterInput/RichParameterInput.tsx @@ -242,7 +242,7 @@ export const RichParameterInput: FC = ({ data-testid={`parameter-field-${parameter.name}`} > -
+
= ({ )} {autofillSource && autofillDescription[autofillSource] && ( -
+
🪄 Autofilled {autofillDescription[autofillSource]}
)} @@ -345,7 +345,7 @@ const RichParameterField: FC = ({ spacing={small ? 1 : 0} alignItems={small ? "center" : undefined} direction={small ? "row" : "column"} - css={{ padding: small ? undefined : "4px 0" }} + className={small ? undefined : "py-1"} > {small ? ( diff --git a/site/src/components/Sidebar/Sidebar.tsx b/site/src/components/Sidebar/Sidebar.tsx index 1026791275..0a21f8dec6 100644 --- a/site/src/components/Sidebar/Sidebar.tsx +++ b/site/src/components/Sidebar/Sidebar.tsx @@ -33,13 +33,7 @@ export const SidebarHeader: FC = ({ return ( {avatar} -
+
{linkTo ? ( {title} diff --git a/site/src/modules/apps/AppStatusStateIcon.tsx b/site/src/modules/apps/AppStatusStateIcon.tsx index c54a80b704..0ed06f67d7 100644 --- a/site/src/modules/apps/AppStatusStateIcon.tsx +++ b/site/src/modules/apps/AppStatusStateIcon.tsx @@ -36,11 +36,10 @@ export const AppStatusStateIcon: FC = ({ // remove the stroke so it is not overly thick. return ( ); diff --git a/site/src/modules/dashboard/DashboardLayout.tsx b/site/src/modules/dashboard/DashboardLayout.tsx index 323b39dd5b..42d8824a59 100644 --- a/site/src/modules/dashboard/DashboardLayout.tsx +++ b/site/src/modules/dashboard/DashboardLayout.tsx @@ -79,7 +79,7 @@ export const DashboardLayout: FC = () => { }), }} message={ -
+
({ @@ -114,16 +114,7 @@ export const DashboardFullPage: FC> = ({ ...attrs }) => { return ( -
+
{children}
); diff --git a/site/src/modules/dashboard/Navbar/ProxyMenu.tsx b/site/src/modules/dashboard/Navbar/ProxyMenu.tsx index 2ce5301cbd..eb0e6bda20 100644 --- a/site/src/modules/dashboard/Navbar/ProxyMenu.tsx +++ b/site/src/modules/dashboard/Navbar/ProxyMenu.tsx @@ -64,7 +64,7 @@ export const ProxyMenu: FC = ({ proxyContextValue }) => { ); } diff --git a/site/src/modules/management/DeploymentSettingsLayout.tsx b/site/src/modules/management/DeploymentSettingsLayout.tsx index 29cd2f93d1..f63518eade 100644 --- a/site/src/modules/management/DeploymentSettingsLayout.tsx +++ b/site/src/modules/management/DeploymentSettingsLayout.tsx @@ -54,7 +54,7 @@ const DeploymentSettingsLayout: FC = () => {
-
+
}> diff --git a/site/src/modules/provisioners/Provisioner.tsx b/site/src/modules/provisioners/Provisioner.tsx index 403c508ea4..5da261fbbf 100644 --- a/site/src/modules/provisioners/Provisioner.tsx +++ b/site/src/modules/provisioners/Provisioner.tsx @@ -45,47 +45,20 @@ export const Provisioner: FC = ({ isWarning && { borderColor: theme.palette.warning.light }, ]} > -
-
-
-

{provisioner.name}

+
+
+
+

{provisioner.name}

{provisioner.version}
-
+
- + {daemonScope} @@ -110,7 +83,7 @@ export const Provisioner: FC = ({ }} > {warnings && warnings.length > 0 ? ( -
+
{warnings.map((warning) => ( {warning.message} ))} diff --git a/site/src/modules/provisioners/ProvisionerTag.tsx b/site/src/modules/provisioners/ProvisionerTag.tsx index 40338e9328..44e4d4c1fd 100644 --- a/site/src/modules/provisioners/ProvisionerTag.tsx +++ b/site/src/modules/provisioners/ProvisionerTag.tsx @@ -35,7 +35,7 @@ export const ProvisionerTag: FC = ({ const { valid, value: boolValue } = parseBool(tagValue); const kv = ( <> - {tagName} {tagValue} + {tagName} {tagValue} ); const content = onDelete ? ( diff --git a/site/src/modules/resources/AgentLogs/AgentLogLine.tsx b/site/src/modules/resources/AgentLogs/AgentLogLine.tsx index c01ee757e6..91f1b18523 100644 --- a/site/src/modules/resources/AgentLogs/AgentLogLine.tsx +++ b/site/src/modules/resources/AgentLogs/AgentLogLine.tsx @@ -27,7 +27,7 @@ export const AgentLogLine: FC = ({ }, [line.output]); return ( - + {sourceIcon} = ({ return ( <> -
- +
+ = ({ The listening ports are exclusively accessible to you. Selecting HTTP/S will change the protocol for all listening ports. - +