Skip to content

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

replace deprecated buttons with buttons from ui kit (#75023)

Uladzimir Havenchykd36a73b0683d
diff --git a/frontend/src/metabase/account/notifications/components/ArchiveModal/ArchiveModal.tsx b/frontend/src/metabase/account/notifications/components/ArchiveModal/ArchiveModal.tsx
index e7c0c35557e..d920982f800 100644
--- a/frontend/src/metabase/account/notifications/components/ArchiveModal/ArchiveModal.tsx
+++ b/frontend/src/metabase/account/notifications/components/ArchiveModal/ArchiveModal.tsx
@@ -1,11 +1,10 @@
import { useCallback, useState } from "react";
import { t } from "ttag";
-import { Button } from "metabase/common/components/Button";
import { ModalContent } from "metabase/common/components/ModalContent";
import { FormMessage } from "metabase/forms";
import { formatChannelRecipients } from "metabase/pulse";
-import { Box, Stack } from "metabase/ui";
+import { Box, Button, Stack } from "metabase/ui";
import Settings from "metabase/utils/settings";
import { formatDateTimeWithUnit } from "metabase/visualizations/lib/formatting";
import type { Alert, DashboardSubscription, User } from "metabase-types/api";
@@ -51,7 +50,12 @@ function ArchiveNotificationModal({
<Button key="cancel" onClick={onClose}>
{getCancelMessage(hasUnsubscribed)}
</Button>,
- <Button key="submit" warning onClick={handleArchiveClick}>
+ <Button
+ key="submit"
+ variant="filled"
+ color="error"
+ onClick={handleArchiveClick}
+ >
{getSubmitMessage(type, hasUnsubscribed)}
</Button>,
]}
diff --git a/frontend/src/metabase/account/notifications/components/HelpModal/HelpModal.tsx b/frontend/src/metabase/account/notifications/components/HelpModal/HelpModal.tsx
index 496df49b05c..3bdb96a5871 100644
--- a/frontend/src/metabase/account/notifications/components/HelpModal/HelpModal.tsx
+++ b/frontend/src/metabase/account/notifications/components/HelpModal/HelpModal.tsx
@@ -1,11 +1,10 @@
import { jt, t } from "ttag";
-import { Button } from "metabase/common/components/Button";
import { ExternalLink } from "metabase/common/components/ExternalLink";
import { ModalContent } from "metabase/common/components/ModalContent";
import { useSelector } from "metabase/redux";
import { getApplicationName } from "metabase/selectors/whitelabel";
-import { Box, Stack } from "metabase/ui";
+import { Box, Button, Stack } from "metabase/ui";
import Settings from "metabase/utils/settings";
type HelpModalProps = {
diff --git a/frontend/src/metabase/account/notifications/components/UnsubscribeModal/UnsubscribeModal.tsx b/frontend/src/metabase/account/notifications/components/UnsubscribeModal/UnsubscribeModal.tsx
index 0cf13e6b715..bfbe34b4802 100644
--- a/frontend/src/metabase/account/notifications/components/UnsubscribeModal/UnsubscribeModal.tsx
+++ b/frontend/src/metabase/account/notifications/components/UnsubscribeModal/UnsubscribeModal.tsx
@@ -1,9 +1,9 @@
import { useCallback, useState } from "react";
import { t } from "ttag";
-import { Button } from "metabase/common/components/Button";
import { ModalContent } from "metabase/common/components/ModalContent";
import { FormMessage } from "metabase/forms";
+import { Button } from "metabase/ui";
import type { Alert, DashboardSubscription, User } from "metabase-types/api";
import type { NotificationType } from "../../types";
@@ -53,7 +53,12 @@ function UnsubscribeModal({
<Button key="cancel" onClick={onClose}>
{t`I changed my mind`}
</Button>,
- <Button key="submit" warning onClick={handleUnsubscribeClick}>
+ <Button
+ key="submit"
+ variant="filled"
+ color="error"
+ onClick={handleUnsubscribeClick}
+ >
{t`Unsubscribe`}
</Button>,
]}
diff --git a/frontend/src/metabase/actions/components/ActionForm/ActionForm.tsx b/frontend/src/metabase/actions/components/ActionForm/ActionForm.tsx
index 5c900c5320a..41e7bc1ebee 100644
--- a/frontend/src/metabase/actions/components/ActionForm/ActionForm.tsx
+++ b/frontend/src/metabase/actions/components/ActionForm/ActionForm.tsx
@@ -7,11 +7,10 @@ import {
getSubmitButtonColor,
getSubmitButtonLabel,
} from "metabase/actions/utils";
-import { Button } from "metabase/common/components/Button";
import { FormErrorMessage } from "metabase/common/components/FormErrorMessage";
import { FormSubmitButton } from "metabase/common/components/FormSubmitButton";
import { Form, FormProvider } from "metabase/forms";
-import { Flex } from "metabase/ui";
+import { Button, Flex } from "metabase/ui";
import type {
ActionFormInitialValues,
ParameterId,
diff --git a/frontend/src/metabase/actions/containers/ActionCreator/ActionCreatorView.tsx b/frontend/src/metabase/actions/containers/ActionCreator/ActionCreatorView.tsx
index c16f9756f64..30a80398da1 100644
--- a/frontend/src/metabase/actions/containers/ActionCreator/ActionCreatorView.tsx
+++ b/frontend/src/metabase/actions/containers/ActionCreator/ActionCreatorView.tsx
@@ -15,7 +15,7 @@ import {
DataReferenceInline,
DataReferenceTriggerButton,
} from "metabase/actions/containers/ActionCreator/InlineDataReference";
-import { Button } from "metabase/common/components/Button";
+import { Button } from "metabase/ui";
import { isNotNull } from "metabase/utils/types";
import type { ActionFormSettings, WritebackAction } from "metabase-types/api";
@@ -107,11 +107,15 @@ export default function ActionCreatorView({
/>
<EditorContainer>{children}</EditorContainer>
<ModalActions>
- <Button onClick={onCloseModal} borderless>
+ <Button onClick={onCloseModal} variant="subtle">
{t`Cancel`}
</Button>
{isEditable && (
- <Button primary disabled={!canSave} onClick={onClickSave}>
+ <Button
+ variant="filled"
+ disabled={!canSave}
+ onClick={onClickSave}
+ >
{isNew ? t`Save` : t`Update`}
</Button>
)}
diff --git a/frontend/src/metabase/actions/containers/ActionCreator/CreateActionForm/CreateActionForm.tsx b/frontend/src/metabase/actions/containers/ActionCreator/CreateActionForm/CreateActionForm.tsx
index afc957d853c..9df3f3c22cb 100644
--- a/frontend/src/metabase/actions/containers/ActionCreator/CreateActionForm/CreateActionForm.tsx
+++ b/frontend/src/metabase/actions/containers/ActionCreator/CreateActionForm/CreateActionForm.tsx
@@ -3,7 +3,6 @@ import { t } from "ttag";
import * as Yup from "yup";
import type { CreateQueryActionParams } from "metabase/actions/types";
-import { Button } from "metabase/common/components/Button";
import { FormErrorMessage } from "metabase/common/components/FormErrorMessage";
import { FormFooter } from "metabase/common/components/FormFooter";
import { FormInput } from "metabase/common/components/FormInput";
@@ -11,6 +10,7 @@ import { FormSubmitButton } from "metabase/common/components/FormSubmitButton";
import { FormTextArea } from "metabase/common/components/FormTextArea";
import { Form, FormProvider } from "metabase/forms";
import { FormModelPicker } from "metabase/models/containers/FormModelPicker";
+import { Button } from "metabase/ui";
import * as Errors from "metabase/utils/errors";
const ACTION_SCHEMA = Yup.object({
diff --git a/frontend/src/metabase/admin/datamodel/containers/SegmentListApp.tsx b/frontend/src/metabase/admin/datamodel/containers/SegmentListApp.tsx
index f3188a90adf..45dc42e2806 100644
--- a/frontend/src/metabase/admin/datamodel/containers/SegmentListApp.tsx
+++ b/frontend/src/metabase/admin/datamodel/containers/SegmentListApp.tsx
@@ -7,7 +7,6 @@ import { SegmentItem } from "metabase/admin/datamodel/components/SegmentItem";
import { FilteredToUrlTable } from "metabase/admin/datamodel/hoc/FilteredToUrlTable";
import { useListSegmentsQuery } from "metabase/api";
import { useSetArchive } from "metabase/archive/hooks";
-import { Button } from "metabase/common/components/Button";
import { Link } from "metabase/common/components/Link";
import { LoadingAndErrorWrapper } from "metabase/common/components/LoadingAndErrorWrapper";
import AdminS from "metabase/css/admin.module.css";
@@ -17,6 +16,7 @@ import { PLUGIN_REMOTE_SYNC } from "metabase/plugins";
import { useSelector } from "metabase/redux";
import { getShallowTables } from "metabase/selectors/metadata";
import { getUserIsAdmin } from "metabase/selectors/user";
+import { Button } from "metabase/ui";
import * as Urls from "metabase/urls";
import type { Segment } from "metabase-types/api";
@@ -50,7 +50,7 @@ function SegmentListAppInner({ segments, tableSelector }: Props) {
onClickCapture={trackSegmentCreateClick}
to={Urls.newDataModelSegment()}
>
- <Button primary>{t`New segment`}</Button>
+ <Button variant="filled">{t`New segment`}</Button>
</Link>
)}
</div>
diff --git a/frontend/src/metabase/admin/permissions/components/CollectionPermissionsModal/CollectionPermissionsModal.tsx b/frontend/src/metabase/admin/permissions/components/CollectionPermissionsModal/CollectionPermissionsModal.tsx
index d3be805e793..763aa904569 100644
--- a/frontend/src/metabase/admin/permissions/components/CollectionPermissionsModal/CollectionPermissionsModal.tsx
+++ b/frontend/src/metabase/admin/permissions/components/CollectionPermissionsModal/CollectionPermissionsModal.tsx
@@ -4,12 +4,12 @@ import _ from "underscore";
import { useListCollectionsTreeQuery } from "metabase/api";
import { isPersonalCollectionChild } from "metabase/collections/utils";
-import { Button } from "metabase/common/components/Button";
import { Link } from "metabase/common/components/Link";
import { ModalContent } from "metabase/common/components/ModalContent";
import CS from "metabase/css/core/index.css";
import { connect, useSelector } from "metabase/redux";
import type { State } from "metabase/redux/store";
+import { Button } from "metabase/ui";
import * as Urls from "metabase/urls";
import type { Collection, CollectionNamespace } from "metabase-types/api";
@@ -160,7 +160,12 @@ const CollectionPermissionsModal = ({
</Link>,
]),
<Button key="cancel" onClick={onClose}>{t`Cancel`}</Button>,
- <Button key="save" primary disabled={!isDirty} onClick={handleSave}>
+ <Button
+ key="save"
+ variant="filled"
+ disabled={!isDirty}
+ onClick={handleSave}
+ >
{t`Save`}
</Button>,
]}
diff --git a/frontend/src/metabase/admin/settings/components/widgets/GroupMappingsWidget/AddMappingRow/AddMappingRow.tsx b/frontend/src/metabase/admin/settings/components/widgets/GroupMappingsWidget/AddMappingRow/AddMappingRow.tsx
index c9f23c03783..533d9864450 100644
--- a/frontend/src/metabase/admin/settings/components/widgets/GroupMappingsWidget/AddMappingRow/AddMappingRow.tsx
+++ b/frontend/src/metabase/admin/settings/components/widgets/GroupMappingsWidget/AddMappingRow/AddMappingRow.tsx
@@ -3,8 +3,8 @@ import { useState } from "react";
import { t } from "ttag";
import type { MappingsType } from "metabase/admin/types";
-import { Button } from "metabase/common/components/Button";
import CS from "metabase/css/core/index.css";
+import { Button } from "metabase/ui";
type AddMappingRowProps = {
mappings: MappingsType;
@@ -68,11 +68,14 @@ function AddMappingRow({
onKeyDown={handleKeyDown}
/>
<div>
- <Button borderless onClick={handleCancelClick}>{t`Cancel`}</Button>
+ <Button
+ variant="subtle"
+ onClick={handleCancelClick}
+ >{t`Cancel`}</Button>
<Button
className={CS.ml2}
type="submit"
- primary={!!isMappingNameUnique}
+ variant={isMappingNameUnique ? "filled" : "default"}
disabled={!isMappingNameUnique}
onClick={() => (isMappingNameUnique ? handleSubmit() : undefined)}
>{t`Add`}</Button>
diff --git a/frontend/src/metabase/admin/settings/components/widgets/GroupMappingsWidget/DeleteGroupMappingModal/DeleteGroupMappingModal.tsx b/frontend/src/metabase/admin/settings/components/widgets/GroupMappingsWidget/DeleteGroupMappingModal/DeleteGroupMappingModal.tsx
index 412df43fd02..c5d515345b8 100644
--- a/frontend/src/metabase/admin/settings/components/widgets/GroupMappingsWidget/DeleteGroupMappingModal/DeleteGroupMappingModal.tsx
+++ b/frontend/src/metabase/admin/settings/components/widgets/GroupMappingsWidget/DeleteGroupMappingModal/DeleteGroupMappingModal.tsx
@@ -5,11 +5,11 @@ import type {
DeleteMappingModalValueType,
GroupIds,
} from "metabase/admin/types";
-import { Button } from "metabase/common/components/Button";
import { Modal } from "metabase/common/components/Modal";
import { ModalFooter } from "metabase/common/components/ModalContent";
import { Radio } from "metabase/common/components/Radio";
import CS from "metabase/css/core/index.css";
+import { Button } from "metabase/ui";
import {
ModalHeader,
@@ -98,7 +98,7 @@ const DeleteGroupMappingModal = ({
</ModalRadioRoot>
<ModalFooter fullPageModal={false} formModal={true}>
<Button onClick={onHide}>{t`Cancel`}</Button>
- <Button danger onClick={handleConfirm}>
+ <Button variant="filled" color="error" onClick={handleConfirm}>
{submitButtonLabels[value as DeleteMappingModalValueType]}
</Button>
</ModalFooter>
diff --git a/frontend/src/metabase/admin/tools/components/ModelCacheRefreshJobs/ModelCacheRefreshJobModal.tsx b/frontend/src/metabase/admin/tools/components/ModelCacheRefreshJobs/ModelCacheRefreshJobModal.tsx
index 914766223e1..9a877255575 100644
--- a/frontend/src/metabase/admin/tools/components/ModelCacheRefreshJobs/ModelCacheRefreshJobModal.tsx
+++ b/frontend/src/metabase/admin/tools/components/ModelCacheRefreshJobs/ModelCacheRefreshJobModal.tsx
@@ -7,11 +7,11 @@ import {
useGetPersistedInfoQuery,
useRefreshModelCacheMutation,
} from "metabase/api";
-import { Button } from "metabase/common/components/Button";
import { Link } from "metabase/common/components/Link";
import { ModalContent } from "metabase/common/components/ModalContent";
import ButtonsS from "metabase/css/components/buttons.module.css";
import type { ModalComponentProps } from "metabase/hoc/ModalRoute";
+import { Button } from "metabase/ui";
import { parseNumberParam } from "metabase/urls";
import { ErrorBox } from "./ModelCacheRefreshJobs.styled";
@@ -48,7 +48,7 @@ export function ModelCacheRefreshJobModal({
return [
<Button
key="retry"
- primary
+ variant="filled"
onClick={onRefreshClick}
>{t`Retry now`}</Button>,
<Link
diff --git a/frontend/src/metabase/auth/components/ForgotPassword/ForgotPassword.tsx b/frontend/src/metabase/auth/components/ForgotPassword/ForgotPassword.tsx
index 72db5e9ff6f..f2fad4da1c0 100644
--- a/frontend/src/metabase/auth/components/ForgotPassword/ForgotPassword.tsx
+++ b/frontend/src/metabase/auth/components/ForgotPassword/ForgotPassword.tsx
@@ -2,8 +2,8 @@ import type { Location } from "history";
import { useCallback, useState } from "react";
import { t } from "ttag";
-import { Button } from "metabase/common/components/Button";
import { useDispatch, useSelector } from "metabase/redux";
+import { Button } from "metabase/ui";
import { forgotPassword } from "../../actions";
import { getIsEmailConfigured, getIsLdapEnabled } from "../../selectors";
@@ -72,7 +72,11 @@ const ForgotPasswordSuccess = (): JSX.Element => {
<InfoMessage>
{t` If the email exists, we'll send instructions on how to reset your password.`}
</InfoMessage>
- <Button primary as="a" href="/auth/login">{t`Back to sign in`}</Button>
+ <Button
+ variant="filled"
+ component="a"
+ href="/auth/login"
+ >{t`Back to sign in`}</Button>
</InfoBody>
);
};
diff --git a/frontend/src/metabase/auth/components/ResetPassword/ResetPassword.tsx b/frontend/src/metabase/auth/components/ResetPassword/ResetPassword.tsx
index 0025df04341..0c49999d4b4 100644
--- a/frontend/src/metabase/auth/components/ResetPassword/ResetPassword.tsx
+++ b/frontend/src/metabase/auth/components/ResetPassword/ResetPassword.tsx
@@ -4,11 +4,11 @@ import { replace } from "react-router-redux";
import { t } from "ttag";
import { useGetPasswordResetTokenStatusQuery } from "metabase/api";
-import { Button } from "metabase/common/components/Button";
import { Link } from "metabase/common/components/Link";
import { useValidatePassword } from "metabase/common/hooks";
import { useToast } from "metabase/common/hooks/use-toast";
import { useDispatch } from "metabase/redux";
+import { Button } from "metabase/ui";
import { resetPassword } from "../../actions";
import type { ResetPasswordData } from "../../types";
@@ -84,7 +84,7 @@ const ResetPasswordExpired = ({
<InfoMessage>
{t`For security reasons, password reset links expire after a little while. If you still need to reset your password, you can request a new reset email.`}
</InfoMessage>
- <Button as={Link} primary to={forgotPasswordUrl}>
+ <Button component={Link} variant="filled" to={forgotPasswordUrl}>
{t`Request a new reset email`}
</Button>
</InfoBody>
diff --git a/frontend/src/metabase/collections/components/CollectionHeader/CollectionUploadInfoModal.tsx b/frontend/src/metabase/collections/components/CollectionHeader/CollectionUploadInfoModal.tsx
index 7bc721069d7..faa2061e7c8 100644
--- a/frontend/src/metabase/collections/components/CollectionHeader/CollectionUploadInfoModal.tsx
+++ b/frontend/src/metabase/collections/components/CollectionHeader/CollectionUploadInfoModal.tsx
@@ -1,10 +1,9 @@
import { t } from "ttag";
-import { Button } from "metabase/common/components/Button";
import { Link } from "metabase/common/components/Link";
import { useSelector } from "metabase/redux";
import { getApplicationName } from "metabase/selectors/whitelabel";
-import { Modal } from "metabase/ui";
+import { Button, Modal } from "metabase/ui";
import {
InfoModalBody,
@@ -42,7 +41,12 @@ export const UploadInfoModal = ({
{t`You'll be able to pick the default database where the data should be stored when enabling the feature.`}
</p>
</InfoModalBody>
- <Button as={Link} to="/admin/settings/uploads" primary role="link">
+ <Button
+ component={Link}
+ to="/admin/settings/uploads"
+ variant="filled"
+ role="link"
+ >
{t`Go to setup`}
</Button>
</>
diff --git a/frontend/src/metabase/collections/components/CreateCollectionForm/CreateCollectionForm.tsx b/frontend/src/metabase/collections/components/CreateCollectionForm/CreateCollectionForm.tsx
index ddc47ddbab4..b525f83c7bc 100644
--- a/frontend/src/metabase/collections/components/CreateCollectionForm/CreateCollectionForm.tsx
+++ b/frontend/src/metabase/collections/components/CreateCollectionForm/CreateCollectionForm.tsx
@@ -7,7 +7,6 @@ import * as Yup from "yup";
import { skipToken, useGetCollectionQuery } from "metabase/api";
import FormCollectionPicker from "metabase/collections/containers/FormCollectionPicker";
import { useInitialCollectionId } from "metabase/collections/hooks";
-import { Button } from "metabase/common/components/Button";
import { FormErrorMessage } from "metabase/common/components/FormErrorMessage";
import { FormFooter } from "metabase/common/components/FormFooter";
import { FormInput } from "metabase/common/components/FormInput";
@@ -20,7 +19,7 @@ import type {
} from "metabase/common/components/Pickers";
import { Form, FormProvider } from "metabase/forms";
import { PLUGIN_TENANTS } from "metabase/plugins";
-import { Flex } from "metabase/ui";
+import { Button, Flex } from "metabase/ui";
import * as Errors from "metabase/utils/errors";
import type { Collection, CollectionNamespace } from "metabase-types/api";
diff --git a/frontend/src/metabase/common/components/CopyDashboardForm/CopyDashboardForm.tsx b/frontend/src/metabase/common/components/CopyDashboardForm/CopyDashboardForm.tsx
index ecd840ba1fe..1c1e8fccb1c 100644
--- a/frontend/src/metabase/common/components/CopyDashboardForm/CopyDashboardForm.tsx
+++ b/frontend/src/metabase/common/components/CopyDashboardForm/CopyDashboardForm.tsx
@@ -5,7 +5,6 @@ import * as Yup from "yup";
import { useGetDashboardQuery } from "metabase/api";
import FormCollectionPicker from "metabase/collections/containers/FormCollectionPicker/FormCollectionPicker";
-import { Button } from "metabase/common/components/Button";
import { FormFooter } from "metabase/common/components/FormFooter";
import type { FilterItemsInPersonalCollection } from "metabase/common/components/Pickers";
import {
@@ -22,7 +21,7 @@ import {
FormTextInput,
FormTextarea,
} from "metabase/forms";
-import { Group, Icon, Tooltip } from "metabase/ui";
+import { Button, Group, Icon, Tooltip } from "metabase/ui";
import { isVirtualDashCard } from "metabase/utils/dashboard";
import * as Errors from "metabase/utils/errors";
import type { CollectionId, Dashboard, DashboardId } from "metabase-types/api";
diff --git a/frontend/src/metabase/common/components/EmptyState/EmptyState.tsx b/frontend/src/metabase/common/components/EmptyState/EmptyState.tsx
index 98e21f22508..6de6a1fa892 100644
--- a/frontend/src/metabase/common/components/EmptyState/EmptyState.tsx
+++ b/frontend/src/metabase/common/components/EmptyState/EmptyState.tsx
@@ -1,7 +1,6 @@
-import { Button } from "metabase/common/components/Button";
import { Link } from "metabase/common/components/Link";
import CS from "metabase/css/core/index.css";
-import { Flex, Icon, Text, isValidIconName } from "metabase/ui";
+import { Button, Flex, Icon, Text, isValidIconName } from "metabase/ui";
import type { IconName } from "metabase-types/api";
import S from "./EmptyState.module.css";
@@ -97,11 +96,11 @@ export const EmptyState = ({
<EmptyStateActions className={S.EmptyStateFooter}>
{action && link && (
<Link to={link} target={link.startsWith("http") ? "_blank" : ""}>
- <Button primary>{action}</Button>
+ <Button variant="filled">{action}</Button>
</Link>
)}
{action && onActionClick && (
- <Button onClick={onActionClick} primary>
+ <Button onClick={onActionClick} variant="filled">
{action}
</Button>
)}
diff --git a/frontend/src/metabase/common/components/Unsubscribe.tsx b/frontend/src/metabase/common/components/Unsubscribe.tsx
index abf21edf7ce..0dac3d3969e 100644
--- a/frontend/src/metabase/common/components/Unsubscribe.tsx
+++ b/frontend/src/metabase/common/components/Unsubscribe.tsx
@@ -3,7 +3,6 @@ import { useMemo, useState } from "react";
import { useAsync } from "react-use";
import { jt, t } from "ttag";
-import { Button } from "metabase/common/components/Button";
import { NotFound } from "metabase/common/components/ErrorPages";
import { ExternalLink } from "metabase/common/components/ExternalLink";
import { LighthouseIllustration } from "metabase/common/components/LighthouseIllustration";
@@ -15,7 +14,7 @@ import {
NotificationUnsubscribeApi,
PulseUnsubscribeApi,
} from "metabase/services";
-import { Center, Stack, Text } from "metabase/ui";
+import { Button, Center, Stack, Text } from "metabase/ui";
import {
CheckmarkIcon,
@@ -143,7 +142,7 @@ function SuccessfulRequestWrapper({
<Text fw={700} c="text-secondary" mb="0.75rem" ta="center">
{text}
</Text>
- <Button primary onClick={action}>
+ <Button variant="filled" onClick={action}>
{buttonText}
</Button>
</Stack>
diff --git a/frontend/src/metabase/dashboard/components/ActionViz/ActionDashcardSettings.tsx b/frontend/src/metabase/dashboard/components/ActionViz/ActionDashcardSettings.tsx
index 4efe38296cd..c915bf67702 100644
--- a/frontend/src/metabase/dashboard/components/ActionViz/ActionDashcardSettings.tsx
+++ b/frontend/src/metabase/dashboard/components/ActionViz/ActionDashcardSettings.tsx
@@ -2,11 +2,11 @@ import { useMemo } from "react";
import { t } from "ttag";
import { ConnectedActionPicker } from "metabase/actions/containers/ActionPicker";
-import { Button } from "metabase/common/components/Button";
import { EmptyState } from "metabase/common/components/EmptyState";
import CS from "metabase/css/core/index.css";
import { setActionForDashcard } from "metabase/dashboard/actions";
import { useDispatch } from "metabase/redux";
+import { Button } from "metabase/ui";
import type {
ActionDashboardCard,
Dashboard,
@@ -107,7 +107,7 @@ export function ActionDashcardSettings({
</ParameterMapperContainer>
)}
<ModalActions>
- <Button primary onClick={onClose} disabled={isFormInvalid}>
+ <Button variant="filled" onClick={onClose} disabled={isFormInvalid}>
{t`Done`}
</Button>
</ModalActions>
diff --git a/frontend/src/metabase/dashboard/components/DashboardHeader/buttons/CopyAnalyticsDashboardButton.tsx b/frontend/src/metabase/dashboard/components/DashboardHeader/buttons/CopyAnalyticsDashboardButton.tsx
index 7ae50de9820..220647e718b 100644
--- a/frontend/src/metabase/dashboard/components/DashboardHeader/buttons/CopyAnalyticsDashboardButton.tsx
+++ b/frontend/src/metabase/dashboard/components/DashboardHeader/buttons/CopyAnalyticsDashboardButton.tsx
@@ -1,15 +1,15 @@
import { type WithRouterProps, withRouter } from "react-router";
import { t } from "ttag";
-import { Button } from "metabase/common/components/Button";
import { Link } from "metabase/common/components/Link";
+import { Button, Icon } from "metabase/ui";
export const CopyAnalyticsDashboardButton = withRouter(
({ location }: WithRouterProps) => (
<Button
- icon="clone"
+ leftSection={<Icon name="clone" />}
to={`${location.pathname}/copy`}
- as={Link}
+ component={Link}
>{t`Make a copy`}</Button>
),
);
diff --git a/frontend/src/metabase/dashboard/containers/AutomaticDashboardApp/AutomaticDashboardApp.tsx b/frontend/src/metabase/dashboard/containers/AutomaticDashboardApp/AutomaticDashboardApp.tsx
index 6a79fbd8877..60a538f9b31 100644
--- a/frontend/src/metabase/dashboard/containers/AutomaticDashboardApp/AutomaticDashboardApp.tsx
+++ b/frontend/src/metabase/dashboard/containers/AutomaticDashboardApp/AutomaticDashboardApp.tsx
@@ -7,7 +7,6 @@ import { t } from "ttag";
import { dashboardApi } from "metabase/api";
import { invalidateTags } from "metabase/api/tags";
import { ActionButton } from "metabase/common/components/ActionButton";
-import { Button } from "metabase/common/components/Button";
import { Link } from "metabase/common/components/Link";
import CS from "metabase/css/core/index.css";
import { navigateToNewCardFromDashboard } from "metabase/dashboard/actions";
@@ -21,7 +20,7 @@ import { useDashboardUrlQuery } from "metabase/dashboard/hooks";
import { usePageTitle } from "metabase/hooks/use-page-title";
import { useDispatch } from "metabase/redux";
import { addUndo } from "metabase/redux/undo";
-import { Box, Flex, Group } from "metabase/ui";
+import { Box, Button, Flex, Group, Icon } from "metabase/ui";
import * as Urls from "metabase/urls";
import type { Dashboard as IDashboard } from "metabase-types/api";
@@ -190,7 +189,9 @@ const AutomaticDashboardAppInner = () => {
{more && (
<div className={cx(CS.flex, CS.justifyEnd, CS.px4, CS.pb4)}>
<Link to={more} className={CS.ml2}>
- <Button iconRight="chevronright">{t`Show more about this`}</Button>
+ <Button
+ rightSection={<Icon name="chevronright" />}
+ >{t`Show more about this`}</Button>
</Link>
</div>
)}
diff --git a/frontend/src/metabase/models/components/ModelActions/ModelActionDetails/ModelActionDetails.tsx b/frontend/src/metabase/models/components/ModelActions/ModelActionDetails/ModelActionDetails.tsx
index 424994830e4..d1cfdb2bf40 100644
--- a/frontend/src/metabase/models/components/ModelActions/ModelActionDetails/ModelActionDetails.tsx
+++ b/frontend/src/metabase/models/components/ModelActions/ModelActionDetails/ModelActionDetails.tsx
@@ -8,11 +8,11 @@ import {
useListDatabasesQuery,
} from "metabase/api";
import { useSetArchive } from "metabase/archive/hooks";
-import { Button } from "metabase/common/components/Button";
import { Link } from "metabase/common/components/Link";
import { useConfirmation } from "metabase/common/hooks/use-confirmation";
import { useSelector } from "metabase/redux";
import { getMetadata } from "metabase/selectors/metadata";
+import { Button, Icon } from "metabase/ui";
import * as Urls from "metabase/urls";
import { parseTimestamp } from "metabase/utils/time-dayjs";
import type Question from "metabase-lib/v1/Question";
@@ -147,7 +147,7 @@ function ModelActionDetails({ model }: Props) {
<Root data-testid="model-action-details">
{canWrite && (
<ActionsHeader data-testid="model-actions-header">
- <Button as={Link} to={newActionUrl}>{t`New action`}</Button>
+ <Button component={Link} to={newActionUrl}>{t`New action`}</Button>
{menuItems.length > 0 && (
<ActionMenu
triggerIcon="ellipsis"
@@ -191,7 +191,7 @@ function NoActionsState({
{hasCreateButton && (
<EmptyStateActionContainer>
<Button
- icon="bolt"
+ leftSection={<Icon name="bolt" />}
onClick={onCreateClick}
>{t`Create basic actions`}</Button>
</EmptyStateActionContainer>
diff --git a/frontend/src/metabase/parameters/components/ValuesSourceModal/ValuesSourceTypeModal.tsx b/frontend/src/metabase/parameters/components/ValuesSourceModal/ValuesSourceTypeModal.tsx
index f5f959ca94e..3cf9c0d98e9 100644
--- a/frontend/src/metabase/parameters/components/ValuesSourceModal/ValuesSourceTypeModal.tsx
+++ b/frontend/src/metabase/parameters/components/ValuesSourceModal/ValuesSourceTypeModal.tsx
@@ -8,7 +8,6 @@ import {
useGetCardQuery,
useGetTableQueryMetadataQuery,
} from "metabase/api";
-import { Button } from "metabase/common/components/Button";
import { ExternalLink } from "metabase/common/components/ExternalLink";
import { ModalContent } from "metabase/common/components/ModalContent";
import type { RadioOption } from "metabase/common/components/Radio";
@@ -20,7 +19,7 @@ import { connect, useSelector } from "metabase/redux";
import { getMetadata } from "metabase/selectors/metadata";
import { getLearnUrl } from "metabase/selectors/settings";
import { getShowMetabaseLinks } from "metabase/selectors/whitelabel";
-import { Box, Flex, Icon } from "metabase/ui";
+import { Box, Button, Flex, Icon } from "metabase/ui";
import * as Lib from "metabase-lib";
import type Question from "metabase-lib/v1/Question";
import { getQuestionVirtualTableId } from "metabase-lib/v1/metadata/utils/saved-questions";
@@ -103,7 +102,7 @@ const ValuesSourceTypeModal = ({
footer={[
<Button
key="submit"
- primary
+ variant="filled"
disabled={!isValidSourceConfig(sourceType, sourceConfig)}
onClick={onSubmit}
>{t`Done`}</Button>,
diff --git a/frontend/src/metabase/query_builder/components/ImpossibleToCreateModelModal/ImpossibleToCreateModelModal.tsx b/frontend/src/metabase/query_builder/components/ImpossibleToCreateModelModal/ImpossibleToCreateModelModal.tsx
index df60c742eb5..8e65d421205 100644
--- a/frontend/src/metabase/query_builder/components/ImpossibleToCreateModelModal/ImpossibleToCreateModelModal.tsx
+++ b/frontend/src/metabase/query_builder/components/ImpossibleToCreateModelModal/ImpossibleToCreateModelModal.tsx
@@ -1,13 +1,13 @@
import cx from "classnames";
import { jt, t } from "ttag";
-import { Button } from "metabase/common/components/Button";
import { ExternalLink } from "metabase/common/components/ExternalLink";
import { ModalContent } from "metabase/common/components/ModalContent";
import CS from "metabase/css/core/index.css";
import { useSelector } from "metabase/redux";
import { getDocsUrl } from "metabase/selectors/settings";
import { getShowMetabaseLinks } from "metabase/selectors/whitelabel";
+import { Button } from "metabase/ui";
type Props = {
onClose: () => void;
@@ -52,7 +52,7 @@ export function ImpossibleToCreateModelModal({ onClose }: Props) {
: t`To solve this, just remove the variables in this question and try again. (It's okay to use SQL snippets or reference the results of another saved question in your query.)`}
</p>
<div className={cx(CS.flex, CS.justifyCenter, CS.py1)}>
- <Button primary onClick={onClose}>{t`Okay`}</Button>
+ <Button variant="filled" onClick={onClose}>{t`Okay`}</Button>
</div>
</ModalContent>
);
diff --git a/frontend/src/metabase/query_builder/components/template_tags/SnippetForm/SnippetForm.tsx b/frontend/src/metabase/query_builder/components/template_tags/SnippetForm/SnippetForm.tsx
index 92baa7b8c69..26b81913499 100644
--- a/frontend/src/metabase/query_builder/components/template_tags/SnippetForm/SnippetForm.tsx
+++ b/frontend/src/metabase/query_builder/components/template_tags/SnippetForm/SnippetForm.tsx
@@ -4,14 +4,13 @@ import * as Yup from "yup";
import { useListCollectionsQuery } from "metabase/api";
import FormCollectionPicker from "metabase/collections/containers/FormCollectionPicker";
-import { Button } from "metabase/common/components/Button";
import { FormErrorMessage } from "metabase/common/components/FormErrorMessage";
import { FormInput } from "metabase/common/components/FormInput";
import { FormSubmitButton } from "metabase/common/components/FormSubmitButton";
import { FormTextArea } from "metabase/common/components/FormTextArea";
import { LoadingAndErrorWrapper } from "metabase/common/components/LoadingAndErrorWrapper";
import { Form, FormProvider } from "metabase/forms";
-import { Flex } from "metabase/ui";
+import { Button, Flex, Icon } from "metabase/ui";
import * as Errors from "metabase/utils/errors";
import type { Collection, NativeQuerySnippet } from "metabase-types/api";
@@ -110,8 +109,8 @@ function SnippetFormInner({
{isEditing && (
<Button
type="button"
- icon="archive"
- borderless
+ leftSection={<Icon name="archive" />}
+ variant="subtle"
onClick={onArchive}
>
{t`Archive`}
diff --git a/frontend/src/metabase/reference/components/EditableReferenceHeader.tsx b/frontend/src/metabase/reference/components/EditableReferenceHeader.tsx
index 27ff0344195..f94f8d483a8 100644
--- a/frontend/src/metabase/reference/components/EditableReferenceHeader.tsx
+++ b/frontend/src/metabase/reference/components/EditableReferenceHeader.tsx
@@ -3,10 +3,9 @@ import { memo } from "react";
import { Link } from "react-router";
import { t } from "ttag";
-import { Button } from "metabase/common/components/Button";
import L from "metabase/common/components/List/List.module.css";
import CS from "metabase/css/core/index.css";
-import { Ellipsified, Icon, TextInputBlurChange } from "metabase/ui";
+import { Button, Ellipsified, Icon, TextInputBlurChange } from "metabase/ui";
import type { IconName } from "metabase-types/api";
import S from "./ReferenceHeader.module.css";
@@ -103,7 +102,7 @@ const EditableReferenceHeader = ({
headerLink && (
<Button
key="2"
- primary
+ variant="filled"
className={cx(CS.flex, CS.flexAlignRight, CS.mr2)}
style={{ fontSize: 14 }}
>
@@ -114,7 +113,7 @@ const EditableReferenceHeader = ({
)}
{user && user.is_superuser && !isEditing && (
<Button
- icon="pencil"
+ leftSection={<Icon name="pencil" />}
style={{ fontSize: 14 }}
type="button"
onClick={startEditing}
diff --git a/frontend/src/metabase/setup/components/LanguageStep/LanguageStep.tsx b/frontend/src/metabase/setup/components/LanguageStep/LanguageStep.tsx
index f59ba69ad1a..76c2e527815 100644
--- a/frontend/src/metabase/setup/components/LanguageStep/LanguageStep.tsx
+++ b/frontend/src/metabase/setup/components/LanguageStep/LanguageStep.tsx
@@ -2,11 +2,10 @@ import { useCallback, useMemo, useState } from "react";
import { t } from "ttag";
import _ from "underscore";
-import { Button } from "metabase/common/components/Button";
import { CommunityLocalizationNotice } from "metabase/common/components/CommunityLocalizationNotice";
import { useDispatch, useSelector } from "metabase/redux";
import type { Locale } from "metabase/redux/store";
-import { Stack } from "metabase/ui";
+import { Button, Stack } from "metabase/ui";
import { useStep } from "../..//useStep";
import { goToNextStep, updateLocale } from "../../actions";
@@ -77,7 +76,7 @@ export const LanguageStep = ({ stepLabel }: NumberedStepProps): JSX.Element => {
))}
</LocaleGroup>
<Button
- primary={selectedLocale != null}
+ variant={selectedLocale != null ? "filled" : "default"}
disabled={selectedLocale == null}
onClick={handleStepSubmit}
>
diff --git a/frontend/src/metabase/setup/components/UsageQuestionStep/UsageQuestionStep.tsx b/frontend/src/metabase/setup/components/UsageQuestionStep/UsageQuestionStep.tsx
index a711382e966..70d6f033717 100644
--- a/frontend/src/metabase/setup/components/UsageQuestionStep/UsageQuestionStep.tsx
+++ b/frontend/src/metabase/setup/components/UsageQuestionStep/UsageQuestionStep.tsx
@@ -1,9 +1,8 @@
import { useState } from "react";
import { t } from "ttag";
-import { Button } from "metabase/common/components/Button";
import { useDispatch } from "metabase/redux";
-import { Divider, Radio, Stack, Text } from "metabase/ui";
+import { Button, Divider, Radio, Stack, Text } from "metabase/ui";
import type { UsageReason } from "metabase-types/api";
import { submitUsageReason } from "../../actions";
@@ -84,7 +83,7 @@ export const UsageQuestionStep = ({ stepLabel }: NumberedStepProps) => {
</Stack>
</Radio.Group>
<Divider my="xl" />
- <Button primary onClick={handleSubmit}>
+ <Button variant="filled" onClick={handleSubmit}>
{t`Next`}
</Button>
</ActiveStep>
diff --git a/frontend/src/metabase/timelines/common/components/DeleteEventModal/DeleteEventModal.tsx b/frontend/src/metabase/timelines/common/components/DeleteEventModal/DeleteEventModal.tsx
index cd7809a784f..6256ce58460 100644
--- a/frontend/src/metabase/timelines/common/components/DeleteEventModal/DeleteEventModal.tsx
+++ b/frontend/src/metabase/timelines/common/components/DeleteEventModal/DeleteEventModal.tsx
@@ -1,7 +1,7 @@
import { useCallback } from "react";
import { t } from "ttag";
-import { Button } from "metabase/common/components/Button";
+import { Button } from "metabase/ui";
import type { Timeline, TimelineEvent } from "metabase-types/api";
import ModalFooter from "../ModalFooter";
@@ -32,7 +32,11 @@ const DeleteEventModal = ({
<ModalHeader title={t`Delete ${event?.name}?`} onClose={onClose} />
<ModalFooter hasPadding>
<Button onClick={onClose}>{t`Cancel`}</Button>
- <Button danger onClick={handleSubmit}>{t`Delete`}</Button>
+ <Button
+ variant="filled"
+ color="error"
+ onClick={handleSubmit}
+ >{t`Delete`}</Button>
</ModalFooter>
</div>
);
diff --git a/frontend/src/metabase/timelines/common/components/TimelineForm/TimelineForm.tsx b/frontend/src/metabase/timelines/common/components/TimelineForm/TimelineForm.tsx
index d5faa87769a..395f47948de 100644
--- a/frontend/src/metabase/timelines/common/components/TimelineForm/TimelineForm.tsx
+++ b/frontend/src/metabase/timelines/common/components/TimelineForm/TimelineForm.tsx
@@ -2,13 +2,13 @@ import { useMemo } from "react";
import { t } from "ttag";
import * as Yup from "yup";
-import { Button } from "metabase/common/components/Button";
import { FormErrorMessage } from "metabase/common/components/FormErrorMessage";
import { FormInput } from "metabase/common/components/FormInput";
import { FormSubmitButton } from "metabase/common/components/FormSubmitButton";
import { FormTextArea } from "metabase/common/components/FormTextArea";
import { getTimelineIcons } from "metabase/common/utils/timelines";
import { Form, FormProvider } from "metabase/forms";
+import { Button } from "metabase/ui";
import * as Errors from "metabase/utils/errors";
import type { TimelineData } from "metabase-types/api";
diff --git a/frontend/src/metabase/timelines/questions/components/TimelinePanel/TimelinePanel.tsx b/frontend/src/metabase/timelines/questions/components/TimelinePanel/TimelinePanel.tsx
index c3127486f77..4f4411ef216 100644
--- a/frontend/src/metabase/timelines/questions/components/TimelinePanel/TimelinePanel.tsx
+++ b/frontend/src/metabase/timelines/questions/components/TimelinePanel/TimelinePanel.tsx
@@ -1,7 +1,6 @@
import { t } from "ttag";
-import { Button } from "metabase/common/components/Button";
-import { Box } from "metabase/ui";
+import { Box, Button } from "metabase/ui";
import type { Collection, Timeline, TimelineEvent } from "metabase-types/api";
import TimelineEmptyState from "../TimelineEmptyState";
diff --git a/frontend/src/metabase/visualizations/components/ObjectDetail/DeleteObjectModal.tsx b/frontend/src/metabase/visualizations/components/ObjectDetail/DeleteObjectModal.tsx
index 79333170aaa..fcb6dfc291a 100644
--- a/frontend/src/metabase/visualizations/components/ObjectDetail/DeleteObjectModal.tsx
+++ b/frontend/src/metabase/visualizations/components/ObjectDetail/DeleteObjectModal.tsx
@@ -2,10 +2,10 @@ import type { FunctionComponent } from "react";
import { t } from "ttag";
import { getActionErrorMessage } from "metabase/actions/utils";
-import { Button } from "metabase/common/components/Button";
import { ModalContent } from "metabase/common/components/ModalContent";
import { useToast } from "metabase/common/hooks/use-toast";
import { ActionsApi } from "metabase/services";
+import { Button } from "metabase/ui";
import type { WritebackActionId } from "metabase-types/api";
import type { ObjectId } from "./types";
@@ -52,7 +52,8 @@ export const DeleteObjectModal: FunctionComponent<Props> = ({
<Button key="cancel" onClick={onClose}>{t`Cancel`}</Button>,
<Button
key="delete"
- danger
+ variant="filled"
+ color="error"
disabled={
typeof actionId === "undefined" ||
typeof objectId === "undefined" ||