Skip to content

The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:

chore: replace more deprecated buttons with mantine buttons (#75903)

Uladzimir Havenchyka57898c7c347
diff --git a/frontend/src/metabase/actions/containers/ActionPicker/ActionPicker.styled.tsx b/frontend/src/metabase/actions/containers/ActionPicker/ActionPicker.styled.tsx
index e662b64c6c5..224b7074a50 100644
--- a/frontend/src/metabase/actions/containers/ActionPicker/ActionPicker.styled.tsx
+++ b/frontend/src/metabase/actions/containers/ActionPicker/ActionPicker.styled.tsx
@@ -3,7 +3,6 @@ import { css } from "@emotion/react";
// eslint-disable-next-line no-restricted-imports
import styled from "@emotion/styled";
-import { Button } from "metabase/common/components/Button";
import { CollapseSection } from "metabase/common/components/CollapseSection";
import { EmptyState as UnstyledEmptyState } from "metabase/common/components/EmptyState";
@@ -46,12 +45,3 @@ export const EmptyModelStateContainer = styled.div`
color: var(--mb-color-text-secondary);
text-align: center;
`;
-
-export const EditButton = styled(Button)`
- color: var(--mb-color-text-tertiary);
- padding: 0 0.5rem;
-`;
-
-export const NewActionButton = styled(Button)`
- margin: 0.25rem 0.75rem;
-`;
diff --git a/frontend/src/metabase/actions/containers/ActionPicker/ActionPicker.tsx b/frontend/src/metabase/actions/containers/ActionPicker/ActionPicker.tsx
index 84b6f4e1fc7..838d1094bb2 100644
--- a/frontend/src/metabase/actions/containers/ActionPicker/ActionPicker.tsx
+++ b/frontend/src/metabase/actions/containers/ActionPicker/ActionPicker.tsx
@@ -8,16 +8,15 @@ import { LoadingAndErrorWrapper } from "metabase/common/components/LoadingAndErr
import { Modal } from "metabase/common/components/Modal";
import { useToggle } from "metabase/common/hooks/use-toggle";
import CS from "metabase/css/core/index.css";
+import { ActionIcon, Button, Icon } from "metabase/ui";
import type { Card, WritebackAction } from "metabase-types/api";
import {
ActionItem,
ActionsList,
- EditButton,
EmptyModelStateContainer,
EmptyState,
ModelCollapseSection,
- NewActionButton,
} from "./ActionPicker.styled";
import { sortAndGroupActions } from "./utils";
@@ -95,6 +94,16 @@ function ModelActionPicker({
onClick(updatedAction);
};
+ const newActionButton = (
+ <Button
+ variant="subtle"
+ m="0.25rem 0.75rem"
+ onClick={toggleIsActionCreatorVisible}
+ >
+ {t`Create new action`}
+ </Button>
+ );
+
return (
<>
<ModelCollapseSection
@@ -113,9 +122,7 @@ function ModelActionPicker({
data-testid={`action-item-${action.name}`}
>
<span>{action.name}</span>
- <EditButton
- icon="pencil"
- onlyIcon
+ <ActionIcon
onClick={(event: MouseEvent<HTMLButtonElement>) => {
// we have a click listener on the parent
event.stopPropagation();
@@ -123,19 +130,17 @@ function ModelActionPicker({
setEditingActionId(action.id);
toggleIsActionCreatorVisible();
}}
- />
+ >
+ <Icon name="pencil" />
+ </ActionIcon>
</ActionItem>
))}
- <NewActionButton onlyText onClick={toggleIsActionCreatorVisible}>
- {t`Create new action`}
- </NewActionButton>
+ {newActionButton}
</ActionsList>
) : (
<EmptyModelStateContainer>
<div>{t`There are no actions for this model`}</div>
- <NewActionButton onlyText onClick={toggleIsActionCreatorVisible}>
- {t`Create new action`}
- </NewActionButton>
+ {newActionButton}
</EmptyModelStateContainer>
)}
</ModelCollapseSection>
diff --git a/frontend/src/metabase/collections/components/CollectionHeader/CollectionExportAnalytics.tsx b/frontend/src/metabase/collections/components/CollectionHeader/CollectionExportAnalytics.tsx
index 4b3b6a8cabe..3d59ad009e0 100644
--- a/frontend/src/metabase/collections/components/CollectionHeader/CollectionExportAnalytics.tsx
+++ b/frontend/src/metabase/collections/components/CollectionHeader/CollectionExportAnalytics.tsx
@@ -3,9 +3,7 @@ import { t } from "ttag";
import { useExportAnalyticsMutation } from "metabase/api";
import { useSelector } from "metabase/redux";
import { hasActiveExport } from "metabase/redux/analytics-export";
-import { Box, Text, Tooltip } from "metabase/ui";
-
-import { CollectionHeaderButton } from "./CollectionHeader.styled";
+import { ActionIcon, Box, Icon, Text, Tooltip } from "metabase/ui";
export function CollectionExportAnalytics() {
const [exportAnalytics] = useExportAnalyticsMutation();
@@ -30,13 +28,15 @@ export function CollectionExportAnalytics() {
position="bottom"
>
<span>
- <CollectionHeaderButton
+ <ActionIcon
+ variant="viewHeader"
+ size="2rem"
aria-label={t`Export analytics`}
- icon="download"
- iconSize={20}
onClick={handleExport}
disabled={isExporting}
- />
+ >
+ <Icon name="download" />
+ </ActionIcon>
</span>
</Tooltip>
);
diff --git a/frontend/src/metabase/collections/components/CollectionHeader/CollectionHeader.styled.tsx b/frontend/src/metabase/collections/components/CollectionHeader/CollectionHeader.styled.tsx
index 1c0a6074ce5..3e25479bc5f 100644
--- a/frontend/src/metabase/collections/components/CollectionHeader/CollectionHeader.styled.tsx
+++ b/frontend/src/metabase/collections/components/CollectionHeader/CollectionHeader.styled.tsx
@@ -1,7 +1,6 @@
// eslint-disable-next-line no-restricted-imports
import styled from "@emotion/styled";
-import { Button, type ButtonProps } from "metabase/common/components/Button";
import { breakpointMinSmall } from "metabase/styled-components/theme";
export const HeaderRoot = styled.div`
@@ -24,30 +23,3 @@ export const HeaderActions = styled.div`
align-self: start;
gap: 0.5rem;
`;
-
-interface CollectionHeaderButtonProps extends ButtonProps {
- to?: string;
-}
-
-export const CollectionHeaderButton = styled(
- (props: CollectionHeaderButtonProps) => (
- <Button
- {...props}
- onlyIcon={props.onlyIcon ?? true}
- iconSize={props.iconSize ?? 20}
- />
- ),
-)<CollectionHeaderButtonProps>`
- padding: 0.25rem 0.5rem;
- height: 2rem;
- width: 2rem;
-
- &:hover {
- color: var(--mb-color-core-brand);
- background-color: var(--mb-color-background-tertiary);
- }
-
- ${Button.Content} {
- height: 100%;
- }
-`;
diff --git a/frontend/src/metabase/collections/components/CollectionHeader/CollectionTimeline.tsx b/frontend/src/metabase/collections/components/CollectionHeader/CollectionTimeline.tsx
index 777ef28bac1..68bd448ede6 100644
--- a/frontend/src/metabase/collections/components/CollectionHeader/CollectionTimeline.tsx
+++ b/frontend/src/metabase/collections/components/CollectionHeader/CollectionTimeline.tsx
@@ -1,12 +1,10 @@
import { t } from "ttag";
import { Link } from "metabase/common/components/Link/Link";
-import { Tooltip } from "metabase/ui";
+import { ActionIcon, Icon, Tooltip } from "metabase/ui";
import * as Urls from "metabase/urls";
import type { Collection } from "metabase-types/api";
-import { CollectionHeaderButton } from "./CollectionHeader.styled";
-
interface CollectionTimelineProps {
collection: Collection;
}
@@ -19,7 +17,9 @@ const CollectionTimeline = ({
return (
<Tooltip label={t`Events`} position="bottom">
<div>
- <CollectionHeaderButton as={Link} to={url} icon="calendar" />
+ <ActionIcon variant="viewHeader" size="2rem" component={Link} to={url}>
+ <Icon name="calendar" />
+ </ActionIcon>
</div>
</Tooltip>
);
diff --git a/frontend/src/metabase/collections/components/CollectionHeader/CollectionUpload.tsx b/frontend/src/metabase/collections/components/CollectionHeader/CollectionUpload.tsx
index 16004d6e2fa..c2717af61f9 100644
--- a/frontend/src/metabase/collections/components/CollectionHeader/CollectionUpload.tsx
+++ b/frontend/src/metabase/collections/components/CollectionHeader/CollectionUpload.tsx
@@ -7,9 +7,9 @@ import {
UploadLabel,
UploadTooltip,
} from "metabase/common/components/upload";
+import { ActionIcon, Icon } from "metabase/ui";
import type { Collection } from "metabase-types/api";
-import { CollectionHeaderButton } from "./CollectionHeader.styled";
import { UploadInfoModal } from "./CollectionUploadInfoModal";
import { trackCSVFileUploadClicked } from "./analytics";
@@ -31,12 +31,14 @@ export function CollectionUpload({
return (
<>
<UploadTooltip collection={collection}>
- <CollectionHeaderButton
+ <ActionIcon
+ variant="viewHeader"
+ size="2rem"
aria-label={t`Upload data`}
- icon="upload"
- iconSize={20}
onClick={() => setShowInfoModal(true)}
- />
+ >
+ <Icon name="upload" />
+ </ActionIcon>
</UploadTooltip>
{showInfoModal && (
@@ -65,13 +67,14 @@ export function CollectionUpload({
return (
<UploadTooltip collection={collection}>
<UploadLabel>
- <CollectionHeaderButton
- as="span"
- to=""
- icon="upload"
- iconSize={20}
+ <ActionIcon
+ variant="viewHeader"
+ size="2rem"
+ component="span"
aria-label={t`Upload data`}
- />
+ >
+ <Icon name="upload" />
+ </ActionIcon>
</UploadLabel>
<UploadInput ref={uploadInputRef} onChange={handleFileUpload} />
</UploadTooltip>
diff --git a/frontend/src/metabase/common/components/EditBar/EditBar.styled.tsx b/frontend/src/metabase/common/components/EditBar/EditBar.styled.tsx
index 9073fc44627..ef6a3e2b6df 100644
--- a/frontend/src/metabase/common/components/EditBar/EditBar.styled.tsx
+++ b/frontend/src/metabase/common/components/EditBar/EditBar.styled.tsx
@@ -30,7 +30,9 @@ export const Title = styled.span`
`;
/* restyles metabase/ui buttons for the colored bar: filled = primary, subtle = secondary */
-export const ButtonsContainer = styled.div<{ admin: boolean }>`
+export const ButtonsContainer = styled("div", {
+ shouldForwardProp: isPropValid,
+})<{ admin: boolean }>`
display: flex;
button[data-variant] {
diff --git a/frontend/src/metabase/common/components/TabButton/TabButton.module.css b/frontend/src/metabase/common/components/TabButton/TabButton.module.css
new file mode 100644
index 00000000000..18fe4679336
--- /dev/null
+++ b/frontend/src/metabase/common/components/TabButton/TabButton.module.css
@@ -0,0 +1,14 @@
+.menuButton {
+ &[data-variant="subtle"] {
+ align-self: center;
+ color: inherit;
+ transition: background-color 0s;
+
+ &:hover,
+ &:focus,
+ &.menuButtonOpen {
+ color: var(--mb-color-core-brand);
+ background-color: var(--mb-color-background-tertiary);
+ }
+ }
+}
diff --git a/frontend/src/metabase/common/components/TabButton/TabButton.styled.tsx b/frontend/src/metabase/common/components/TabButton/TabButton.styled.tsx
index 069f147e7f5..a15cfc68227 100644
--- a/frontend/src/metabase/common/components/TabButton/TabButton.styled.tsx
+++ b/frontend/src/metabase/common/components/TabButton/TabButton.styled.tsx
@@ -3,8 +3,6 @@ import { css } from "@emotion/react";
// eslint-disable-next-line no-restricted-imports
import styled from "@emotion/styled";
-import { Button } from "metabase/common/components/Button";
-
interface TabButtonProps {
isSelected?: boolean;
disabled?: boolean;
@@ -89,33 +87,6 @@ export const TabButtonRoot = styled.div<TabButtonProps>`
`}
`;
-export const MenuButton = styled(Button)<TabButtonProps & { isOpen: boolean }>`
- transition: background-color 0s;
- align-self: center;
- padding: 0.25rem;
- color: inherit;
- border: none;
-
- ${(props) =>
- props.isOpen &&
- !props.disabled &&
- css`
- color: var(--mb-color-core-brand);
- background-color: var(--mb-color-background-tertiary);
- `}
- &:hover,:focus {
- ${(props) =>
- props.disabled
- ? css`
- color: var(--mb-color-text-primary);
- `
- : css`
- color: var(--mb-color-core-brand);
- background-color: var(--mb-color-background-tertiary);
- `}
- }
-`;
-
export const MenuContent = styled.ul`
padding: 0.5rem;
`;
diff --git a/frontend/src/metabase/common/components/TabButton/TabButton.tsx b/frontend/src/metabase/common/components/TabButton/TabButton.tsx
index 84455e0daa8..449a7e1c0ba 100644
--- a/frontend/src/metabase/common/components/TabButton/TabButton.tsx
+++ b/frontend/src/metabase/common/components/TabButton/TabButton.tsx
@@ -3,6 +3,7 @@ import type { UniqueIdentifier } from "@dnd-kit/core";
import { css } from "@emotion/react";
// eslint-disable-next-line no-restricted-imports
import styled from "@emotion/styled";
+import cx from "classnames";
import type {
ChangeEventHandler,
HTMLAttributes,
@@ -22,7 +23,7 @@ import {
import { t } from "ttag";
import { useTranslateContent } from "metabase/i18n/hooks";
-import { Popover } from "metabase/ui";
+import { ActionIcon, Icon, Popover } from "metabase/ui";
import type { TabContextType } from "../Tab";
import {
@@ -32,8 +33,8 @@ import {
getTabPanelId,
} from "../Tab";
+import S from "./TabButton.module.css";
import {
- MenuButton,
TabButtonInput,
TabButtonInputResizer,
TabButtonInputWrapper,
@@ -163,15 +164,18 @@ const _TabButton = forwardRef(function TabButton(
trapFocus
>
<Popover.Target>
- <MenuButton
- icon="chevrondown"
- iconSize={10}
- isSelected={isSelected}
- isOpen={isMenuOpen}
+ <ActionIcon
+ variant="subtle"
+ size="xs"
+ className={cx(S.menuButton, {
+ [S.menuButtonOpen]: isMenuOpen && !disabled,
+ })}
onClick={() => setIsMenuOpen(true)}
ref={menuButtonRef}
disabled={disabled}
- />
+ >
+ <Icon name="chevrondown" size={10} />
+ </ActionIcon>
</Popover.Target>
<Popover.Dropdown
// TODO: remove when the legacy Modal / RENDERED_POPOVERS stack is no longer used (GDGT-2575)
diff --git a/frontend/src/metabase/dashboard/components/ActionViz/ActionButton.module.css b/frontend/src/metabase/dashboard/components/ActionViz/ActionButton.module.css
new file mode 100644
index 00000000000..2be596ad2ff
--- /dev/null
+++ b/frontend/src/metabase/dashboard/components/ActionViz/ActionButton.module.css
@@ -0,0 +1,8 @@
+.actionButton {
+ &[data-variant]:disabled,
+ &[data-variant][data-disabled="true"] {
+ opacity: 0.5;
+ color: var(--button-color);
+ background-color: var(--button-bg);
+ }
+}
diff --git a/frontend/src/metabase/dashboard/components/ActionViz/ActionButton.styled.tsx b/frontend/src/metabase/dashboard/components/ActionViz/ActionButton.styled.tsx
index b8fab00abfe..bb8c06bc114 100644
--- a/frontend/src/metabase/dashboard/components/ActionViz/ActionButton.styled.tsx
+++ b/frontend/src/metabase/dashboard/components/ActionViz/ActionButton.styled.tsx
@@ -1,27 +1,6 @@
// eslint-disable-next-line no-restricted-imports
-import { css } from "@emotion/react";
-// eslint-disable-next-line no-restricted-imports
import styled from "@emotion/styled";
-import { Button, type ButtonProps } from "metabase/common/components/Button";
-
-interface StyledButtonProps extends ButtonProps {
- isFullHeight?: boolean;
- focus?: boolean;
-}
-
-export const StyledButton = styled(Button)<StyledButtonProps>`
- padding: 0;
- height: ${({ isFullHeight = true }) => (isFullHeight ? "100%" : "auto")};
-
- ${({ focus }) =>
- focus
- ? css`
- border: 2px solid var(--mb-color-focus);
- `
- : ""}
-`;
-
export const FullContainer = styled.div`
width: 100%;
height: 100%;
diff --git a/frontend/src/metabase/dashboard/components/ActionViz/ActionButtonView.tsx b/frontend/src/metabase/dashboard/components/ActionViz/ActionButtonView.tsx
index ca2dac246a6..f0704aba0f1 100644
--- a/frontend/src/metabase/dashboard/components/ActionViz/ActionButtonView.tsx
+++ b/frontend/src/metabase/dashboard/components/ActionViz/ActionButtonView.tsx
@@ -1,10 +1,23 @@
import { t } from "ttag";
-import { Ellipsified, Icon } from "metabase/ui";
+import { Button, Ellipsified, Icon } from "metabase/ui";
+import type { ColorName } from "metabase/ui/colors/types";
import type { VisualizationProps } from "metabase/visualizations/types";
import type { IconName } from "metabase-types/api";
-import { StyledButton, StyledButtonContent } from "./ActionButton.styled";
+import S from "./ActionButton.module.css";
+import { StyledButtonContent } from "./ActionButton.styled";
+
+const BUTTON_VARIANT_PROPS: Record<
+ string,
+ { variant: string; color?: ColorName }
+> = {
+ default: { variant: "default" },
+ primary: { variant: "filled" },
+ danger: { variant: "filled", color: "error" },
+ success: { variant: "filled", color: "success" },
+ borderless: { variant: "subtle" },
+};
interface ActionButtonViewProps extends Pick<VisualizationProps, "settings"> {
disabled?: boolean;
@@ -20,33 +33,33 @@ function ActionButtonView({
disabled,
icon,
tooltip,
- isFullHeight,
+ isFullHeight = false,
onClick,
focus,
}: ActionButtonViewProps) {
const label = settings["button.label"];
const variant = settings["button.variant"] ?? "primary";
-
- const variantProps: any = {};
- if (variant !== "default") {
- variantProps[variant] = true;
- }
+ const { variant: buttonVariant, color } =
+ BUTTON_VARIANT_PROPS[variant] ?? BUTTON_VARIANT_PROPS.primary;
return (
- <StyledButton
+ <Button
+ className={S.actionButton}
+ p={0}
+ h={isFullHeight ? "100%" : undefined}
+ bd={focus ? "2px solid var(--mb-color-focus)" : undefined}
+ variant={buttonVariant}
+ color={color}
disabled={!!disabled}
onClick={onClick}
fullWidth
- isFullHeight={isFullHeight}
- focus={focus}
aria-label={tooltip}
- {...variantProps}
>
<StyledButtonContent>
{icon && <Icon name={icon} />}
<Ellipsified>{label ?? t`Click me`}</Ellipsified>
</StyledButtonContent>
- </StyledButton>
+ </Button>
);
}
diff --git a/frontend/src/metabase/data-studio/data-model/pages/DataModel/DataModel.unit.spec.tsx b/frontend/src/metabase/data-studio/data-model/pages/DataModel/DataModel.unit.spec.tsx
index 216642b858c..916a7367951 100644
--- a/frontend/src/metabase/data-studio/data-model/pages/DataModel/DataModel.unit.spec.tsx
+++ b/frontend/src/metabase/data-studio/data-model/pages/DataModel/DataModel.unit.spec.tsx
@@ -1092,17 +1092,21 @@ async function findTablePickerItem(
) {
let items: HTMLElement[] = [];
- await waitFor(() => {
- const allItems = screen.queryAllByTestId("tree-item");
- items = allItems.filter(
- (el) =>
- el.getAttribute("data-type") === type && el.textContent?.includes(name),
- );
+ await waitFor(
+ () => {
+ const allItems = screen.queryAllByTestId("tree-item");
+ items = allItems.filter(
+ (el) =>
+ el.getAttribute("data-type") === type &&
+ el.textContent?.includes(name),
+ );
- if (items.length !== 1) {
- throw new Error(`Cannot find ${type} in table picker`); // trigger retry
- }
- });
+ if (items.length !== 1) {
+ throw new Error(`Cannot find ${type} in table picker`); // trigger retry
+ }
+ },
+ { timeout: 5000 },
+ );
return items[0];
}
diff --git a/frontend/src/metabase/models/components/ModelActions/ModelActionDetails/ModelActionListItem.styled.tsx b/frontend/src/metabase/models/components/ModelActions/ModelActionDetails/ModelActionListItem.styled.tsx
index 2239fe25e4c..9cd4d2ac0e6 100644
--- a/frontend/src/metabase/models/components/ModelActions/ModelActionDetails/ModelActionListItem.styled.tsx
+++ b/frontend/src/metabase/models/components/ModelActions/ModelActionDetails/ModelActionListItem.styled.tsx
@@ -3,7 +3,6 @@ import { css } from "@emotion/react";
// eslint-disable-next-line no-restricted-imports
import styled from "@emotion/styled";
-import { Button } from "metabase/common/components/Button";
import { Link } from "metabase/common/components/Link";
import { Icon } from "metabase/ui";
import { color } from "metabase/ui/utils/colors";
@@ -78,11 +77,6 @@ export const ActionRunButtonContainer = styled.div`
right: 0.5rem;
`;
-export const ActionRunButton = styled(Button)`
- background-color: var(--mb-color-background-primary);
- color: var(--mb-color-text-primary);
-`;
-
export const ImplicitActionCardContentRoot = styled.div`
${baseActionCardStyles};
diff --git a/frontend/src/metabase/models/components/ModelActions/ModelActionDetails/ModelActionListItem.tsx b/frontend/src/metabase/models/components/ModelActions/ModelActionDetails/ModelActionListItem.tsx
index 8ff1a132e74..cfa6f3adf25 100644
--- a/frontend/src/metabase/models/components/ModelActions/ModelActionDetails/ModelActionListItem.tsx
+++ b/frontend/src/metabase/models/components/ModelActions/ModelActionDetails/ModelActionListItem.tsx
@@ -4,9 +4,8 @@ import { Link as RouterLink } from "react-router";
import { t } from "ttag";
import { ActionExecuteModal } from "metabase/actions/containers/ActionExecuteModal";
-import { Link } from "metabase/common/components/Link";
import { useConfirmation } from "metabase/common/hooks/use-confirmation";
-import { ActionIcon, Icon, Menu } from "metabase/ui";
+import { ActionIcon, Icon, Menu, Tooltip } from "metabase/ui";
import * as Lib from "metabase-lib";
import Question from "metabase-lib/v1/Question";
import type { WritebackAction, WritebackQueryAction } from "metabase-types/api";
@@ -14,7 +13,6 @@ import type { WritebackAction, WritebackQueryAction } from "metabase-types/api";
import {
ActionCardContainer,
ActionHeader,
- ActionRunButton,
ActionRunButtonContainer,
ActionSubtitle,
ActionSubtitlePart,
@@ -135,14 +133,17 @@ function ModelActionListItem({
{canRun && (
<>
<ActionRunButtonContainer>
- <ActionRunButton
- as={Link}
- icon="play"
- onlyIcon
- tooltip={t`Run`}
- aria-label={t`Run`}
- onClick={openExecuteModal}
- />
+ <Tooltip label={t`Run`}>
+ <ActionIcon
+ variant="subtle"
+ bg="background-primary"
+ c="text-primary"
+ aria-label={t`Run`}
+ onClick={openExecuteModal}
+ >
+ <Icon name="play" />
+ </ActionIcon>
+ </Tooltip>
</ActionRunButtonContainer>
<ActionExecuteModal
opened={executeModalOpened}
diff --git a/frontend/src/metabase/setup/components/SetupSection/SetupSection.styled.tsx b/frontend/src/metabase/setup/components/SetupSection/SetupSection.styled.tsx
index 854b256b884..a1cdb804cc7 100644
--- a/frontend/src/metabase/setup/components/SetupSection/SetupSection.styled.tsx
+++ b/frontend/src/metabase/setup/components/SetupSection/SetupSection.styled.tsx
@@ -1,8 +1,6 @@
// eslint-disable-next-line no-restricted-imports
import styled from "@emotion/styled";
-import { Button } from "metabase/common/components/Button";
-
export const SectionRoot = styled.div`
margin-top: 1.5rem;
padding-top: 1.5rem;
@@ -29,9 +27,3 @@ export const SectionDescription = styled.div`
color: var(--mb-color-text-secondary);
margin-top: 0.5rem;
`;
-
-export const SectionButton = styled(Button)`
- color: var(--mb-color-core-brand);
- width: 2.5rem;
- height: 2.5rem;
-`;
diff --git a/frontend/src/metabase/setup/components/SetupSection/SetupSection.tsx b/frontend/src/metabase/setup/components/SetupSection/SetupSection.tsx
index 6a1eb749b67..71842e06dd7 100644
--- a/frontend/src/metabase/setup/components/SetupSection/SetupSection.tsx
+++ b/frontend/src/metabase/setup/components/SetupSection/SetupSection.tsx
@@ -2,8 +2,9 @@ import type { ReactNode } from "react";
import { useState } from "react";
import { t } from "ttag";
+import { ActionIcon, Icon } from "metabase/ui";
+
import {
- SectionButton,
SectionContainer,
SectionDescription,
SectionHeader,
@@ -31,13 +32,19 @@ export const SetupSection = ({
<SectionTitle>{title}</SectionTitle>
<SectionDescription>{description}</SectionDescription>
</SectionContainer>
- <SectionButton
- round
- icon={isExpanded ? "chevronup" : "chevrondown"}
+ <ActionIcon
+ variant="default"
+ radius="xl"
+ size="2.5rem"
aria-label={t`Setup section`}
aria-expanded={isExpanded}
onClick={() => setIsExpanded(!isExpanded)}
- />
+ >
+ <Icon
+ name={isExpanded ? "chevronup" : "chevrondown"}
+ c="core-brand"
+ />
+ </ActionIcon>
</SectionHeader>
{isExpanded && children}
</SectionRoot>
diff --git a/frontend/src/metabase/setup/components/WelcomePage/WelcomePage.styled.tsx b/frontend/src/metabase/setup/components/WelcomePage/WelcomePage.styled.tsx
index 854bc73641e..2ed33dfd6ed 100644
--- a/frontend/src/metabase/setup/components/WelcomePage/WelcomePage.styled.tsx
+++ b/frontend/src/metabase/setup/components/WelcomePage/WelcomePage.styled.tsx
@@ -1,8 +1,6 @@
// eslint-disable-next-line no-restricted-imports
import styled from "@emotion/styled";
-import { Button } from "metabase/common/components/Button";
-
export const PageRoot = styled.div`
display: flex;
flex-direction: column;
@@ -33,7 +31,3 @@ export const PageBody = styled.div`
margin: 1rem 0;
text-align: center;
`;
-
-export const PageButton = styled(Button)`
- margin-top: 2rem;
-`;
diff --git a/frontend/src/metabase/setup/components/WelcomePage/WelcomePage.tsx b/frontend/src/metabase/setup/components/WelcomePage/WelcomePage.tsx
index 3cf3b416962..9b7740a60f9 100644
--- a/frontend/src/metabase/setup/components/WelcomePage/WelcomePage.tsx
+++ b/frontend/src/metabase/setup/components/WelcomePage/WelcomePage.tsx
@@ -4,19 +4,14 @@ import { t } from "ttag";
import { DefaultLogoIcon } from "metabase/common/components/LogoIcon";
import { useDispatch, useSelector } from "metabase/redux";
+import { Button } from "metabase/ui";
import { goToNextStep, loadDefaults } from "../../actions";
import { LOCALE_TIMEOUT } from "../../constants";
import { getIsLocaleLoaded } from "../../selectors";
import { SetupHelp } from "../SetupHelp";
-import {
- PageBody,
- PageButton,
- PageMain,
- PageRoot,
- PageTitle,
-} from "./WelcomePage.styled";
+import { PageBody, PageMain, PageRoot, PageTitle } from "./WelcomePage.styled";
export const WelcomePage = (): JSX.Element | null => {
const [isElapsed] = useTimeout(LOCALE_TIMEOUT);
@@ -44,9 +39,9 @@ export const WelcomePage = (): JSX.Element | null => {
{t`Looks like everything is working.`}{" "}
{t`Now let’s get to know you, connect to your data, and start finding you some answers!`}
</PageBody>
- <PageButton primary autoFocus onClick={handleStepSubmit}>
+ <Button variant="filled" mt="xl" autoFocus onClick={handleStepSubmit}>
{t`Let's get started`}
- </PageButton>
+ </Button>
</PageMain>
<SetupHelp />
</PageRoot>
diff --git a/frontend/src/metabase/visualizations/components/settings/ChartSettingIconRadio.module.css b/frontend/src/metabase/visualizations/components/settings/ChartSettingIconRadio.module.css
new file mode 100644
index 00000000000..cd119fd9759
--- /dev/null
+++ b/frontend/src/metabase/visualizations/components/settings/ChartSettingIconRadio.module.css
@@ -0,0 +1,11 @@
+.iconButton {
+ &[data-variant="default"] {
+ border: 1px solid var(--mb-color-border);
+ color: var(--mb-color-text-primary);
+ background-color: var(--mb-color-background-primary);
+
+ &:hover {
+ background-color: var(--mb-color-background-hover);
+ }
+ }
+}
diff --git a/frontend/src/metabase/visualizations/components/settings/ChartSettingIconRadio.styled.tsx b/frontend/src/metabase/visualizations/components/settings/ChartSettingIconRadio.styled.tsx
deleted file mode 100644
index 35e02e10cf9..00000000000
--- a/frontend/src/metabase/visualizations/components/settings/ChartSettingIconRadio.styled.tsx
+++ /dev/null
@@ -1,8 +0,0 @@
-// eslint-disable-next-line no-restricted-imports
-import styled from "@emotion/styled";
-
-import { Button } from "metabase/common/components/Button";
-
-export const IconButton = styled(Button)`
- margin-left: 0.5rem;
-`;
diff --git a/frontend/src/metabase/visualizations/components/settings/ChartSettingIconRadio.tsx b/frontend/src/metabase/visualizations/components/settings/ChartSettingIconRadio.tsx
index f75836aa5e6..22064121918 100644
--- a/frontend/src/metabase/visualizations/components/settings/ChartSettingIconRadio.tsx
+++ b/frontend/src/metabase/visualizations/components/settings/ChartSettingIconRadio.tsx
@@ -1,9 +1,12 @@
-import { IconButton } from "./ChartSettingIconRadio.styled";
+import { ActionIcon, Icon } from "metabase/ui";
+import type { IconName } from "metabase-types/api";
+
+import S from "./ChartSettingIconRadio.module.css";
interface ChartSettingIconRadioProps {
value: string;
onChange: (val: string | null) => void;
- options: { iconName: string; value: string }[];
+ options: { iconName: IconName; value: string }[];
}
export const ChartSettingIconRadio = ({
@@ -22,12 +25,16 @@ export const ChartSettingIconRadio = ({
return (
<div>
{options.map((option) => (
- <IconButton
- icon={option.iconName}
- onClick={() => handleClick(option.value)}
- primary={option.value === value}
+ <ActionIcon
key={`radio-icon-${option.iconName}`}
- />
+ className={S.iconButton}
+ variant={option.value === value ? "filled" : "default"}
+ size="2rem"
+ ml="sm"
+ onClick={() => handleClick(option.value)}
+ >
+ <Icon name={option.iconName} />
+ </ActionIcon>
))}
</div>
);