Skip to content

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

style(sdk-bundle): Alert component redesign (#78260)

Egor Grushina9731f6e65e3
diff --git a/.loki/reference/chrome_laptop_Components_Feedback_Alert_Dark.png b/.loki/reference/chrome_laptop_Components_Feedback_Alert_Dark.png
deleted file mode 100644
index 5e528476a98..00000000000
Binary files a/.loki/reference/chrome_laptop_Components_Feedback_Alert_Dark.png and /dev/null differ
diff --git a/.loki/reference/chrome_laptop_Components_Feedback_Alert_Default.png b/.loki/reference/chrome_laptop_Components_Feedback_Alert_Default.png
index 7ec7e26dd82..9ccf116d3b7 100644
Binary files a/.loki/reference/chrome_laptop_Components_Feedback_Alert_Default.png and b/.loki/reference/chrome_laptop_Components_Feedback_Alert_Default.png differ
diff --git a/.loki/reference/chrome_laptop_Components_Feedback_Alert_Feedback.png b/.loki/reference/chrome_laptop_Components_Feedback_Alert_Feedback.png
new file mode 100644
index 00000000000..c3e303a9aa9
Binary files /dev/null and b/.loki/reference/chrome_laptop_Components_Feedback_Alert_Feedback.png differ
diff --git a/.loki/reference/chrome_laptop_Components_Feedback_Alert_Light.png b/.loki/reference/chrome_laptop_Components_Feedback_Alert_Light.png
deleted file mode 100644
index c1958b53d55..00000000000
Binary files a/.loki/reference/chrome_laptop_Components_Feedback_Alert_Light.png and /dev/null differ
diff --git a/.loki/reference/chrome_laptop_Components_Feedback_Alert_Overview_Story.png b/.loki/reference/chrome_laptop_Components_Feedback_Alert_Overview_Story.png
new file mode 100644
index 00000000000..89f5eb17384
Binary files /dev/null and b/.loki/reference/chrome_laptop_Components_Feedback_Alert_Overview_Story.png differ
diff --git a/.loki/reference/chrome_laptop_Components_Feedback_Alert_Warning.png b/.loki/reference/chrome_laptop_Components_Feedback_Alert_Warning.png
deleted file mode 100644
index c8784729393..00000000000
Binary files a/.loki/reference/chrome_laptop_Components_Feedback_Alert_Warning.png and /dev/null differ
diff --git a/enterprise/frontend/src/embedding-sdk-package/components/private/Error/Error.tsx b/enterprise/frontend/src/embedding-sdk-package/components/private/Error/Error.tsx
index 5cb2d824177..81b80768d25 100644
--- a/enterprise/frontend/src/embedding-sdk-package/components/private/Error/Error.tsx
+++ b/enterprise/frontend/src/embedding-sdk-package/components/private/Error/Error.tsx
@@ -8,7 +8,7 @@ type Props = {
theme: MetabaseTheme | undefined;
};
-// Mimics the frontend/src/metabase/common/components/Alert/Alert.styled.tsx
+// Mimics the error alert styling from metabase/ui
const DefaultErrorMessage = ({ message, theme }: Props) => {
return (
<div
diff --git a/enterprise/frontend/src/metabase-enterprise/advanced_permissions/components/ImpersonationModal/ImpersonationModalView.tsx b/enterprise/frontend/src/metabase-enterprise/advanced_permissions/components/ImpersonationModal/ImpersonationModalView.tsx
index 8e0bb84b6e4..c964cd78636 100644
--- a/enterprise/frontend/src/metabase-enterprise/advanced_permissions/components/ImpersonationModal/ImpersonationModalView.tsx
+++ b/enterprise/frontend/src/metabase-enterprise/advanced_permissions/components/ImpersonationModal/ImpersonationModalView.tsx
@@ -2,7 +2,6 @@ import { useMemo } from "react";
import { t } from "ttag";
import * as Yup from "yup";
-import { Alert } from "metabase/common/components/Alert";
import { ExternalLink } from "metabase/common/components/ExternalLink/ExternalLink";
import { FormFooter } from "metabase/common/components/FormFooter";
import { Link } from "metabase/common/components/Link/Link";
@@ -15,7 +14,7 @@ import {
FormSelect,
FormSubmitButton,
} from "metabase/forms";
-import { Button, Stack, Text } from "metabase/ui";
+import { Alert, Button, Icon, Stack, Text } from "metabase/ui";
import * as Errors from "metabase/utils/errors";
import { renderUserAttributesForSelect } from "metabase-enterprise/sandboxes/utils";
import type Database from "metabase-lib/v1/metadata/Database";
@@ -98,7 +97,7 @@ export const ImpersonationModalView = ({
</Text>
{roleRequired ? (
<>
- <Alert icon="warning" variant="warning">
+ <Alert size="compact" icon={<Icon name="warning" />} color="warning">
{t`Connection impersonation requires specifying a user role on the database connection.`}{" "}
<Link
variant="brand"
@@ -144,7 +143,7 @@ export const ImpersonationModalView = ({
</FormProvider>
) : (
<>
- <Alert icon="warning" variant="warning">
+ <Alert size="compact" icon={<Icon name="warning" />} color="warning">
{t`To associate a user with a database role, you'll need to give that user at least one user attribute.`}{" "}
<Link
variant="brand"
diff --git a/enterprise/frontend/src/metabase-enterprise/advanced_permissions/components/ImpersonationWarning/ImpersonationWarning.tsx b/enterprise/frontend/src/metabase-enterprise/advanced_permissions/components/ImpersonationWarning/ImpersonationWarning.tsx
index afbcf79a44c..576e8588f0c 100644
--- a/enterprise/frontend/src/metabase-enterprise/advanced_permissions/components/ImpersonationWarning/ImpersonationWarning.tsx
+++ b/enterprise/frontend/src/metabase-enterprise/advanced_permissions/components/ImpersonationWarning/ImpersonationWarning.tsx
@@ -1,9 +1,8 @@
import { jt, t } from "ttag";
-import { Alert } from "metabase/common/components/Alert";
import { Link } from "metabase/common/components/Link";
import CS from "metabase/css/core/index.css";
-import { Box, Code } from "metabase/ui";
+import { Alert, Box, Code, Icon } from "metabase/ui";
import * as Urls from "metabase/urls";
import { isEmpty } from "metabase/utils/validate";
import type Database from "metabase-lib/v1/metadata/Database";
@@ -59,7 +58,7 @@ export const ImpersonationWarning = ({
return (
<Box mb="md">
- <Alert icon="warning" variant="warning">
+ <Alert size="compact" icon={<Icon name="warning" />} color="warning">
{isEmpty(databaseUser) ? emptyText : warningText}{" "}
<Link
className={CS.link}
diff --git a/enterprise/frontend/src/metabase-enterprise/ai-controls/pages/MetabotUsageLimitsPage/GroupLimitsSettingsSection/TenantLimitsTab/TenantLimitsTab.tsx b/enterprise/frontend/src/metabase-enterprise/ai-controls/pages/MetabotUsageLimitsPage/GroupLimitsSettingsSection/TenantLimitsTab/TenantLimitsTab.tsx
index 791d3bbf43f..1c2d3e8ab6e 100644
--- a/enterprise/frontend/src/metabase-enterprise/ai-controls/pages/MetabotUsageLimitsPage/GroupLimitsSettingsSection/TenantLimitsTab/TenantLimitsTab.tsx
+++ b/enterprise/frontend/src/metabase-enterprise/ai-controls/pages/MetabotUsageLimitsPage/GroupLimitsSettingsSection/TenantLimitsTab/TenantLimitsTab.tsx
@@ -126,7 +126,12 @@ export function TenantLimitsTab(props: SpecificTenantsTabProps) {
error={hasTenantsError ? t`Error loading tenants` : null}
>
{noTenantsToShow ? (
- <Alert mb="md" variant="error" icon={<Icon name="warning" />}>
+ <Alert
+ size="compact"
+ mb="md"
+ color="error"
+ icon={<Icon name="warning" />}
+ >
{t`No tenants to show`}
</Alert>
) : (
diff --git a/enterprise/frontend/src/metabase-enterprise/audit_app/metabot-analytics/components/ConversationStatsPage/DataComplexityCards.tsx b/enterprise/frontend/src/metabase-enterprise/audit_app/metabot-analytics/components/ConversationStatsPage/DataComplexityCards.tsx
index 0231bf84f81..dad34b95c44 100644
--- a/enterprise/frontend/src/metabase-enterprise/audit_app/metabot-analytics/components/ConversationStatsPage/DataComplexityCards.tsx
+++ b/enterprise/frontend/src/metabase-enterprise/audit_app/metabot-analytics/components/ConversationStatsPage/DataComplexityCards.tsx
@@ -161,7 +161,7 @@ function DataComplexityBreakdown({
return (
<Stack gap="lg" mt="md">
{hasError && (
- <Alert color="warning" icon={<Icon name="warning" />}>
+ <Alert size="compact" color="warning" icon={<Icon name="warning" />}>
{t`Some component scores could not be computed.`}
</Alert>
)}
diff --git a/enterprise/frontend/src/metabase-enterprise/data-studio/library/snippets/pages/EditSnippetPage/EditSnippetPage.tsx b/enterprise/frontend/src/metabase-enterprise/data-studio/library/snippets/pages/EditSnippetPage/EditSnippetPage.tsx
index 207f88a08f2..3eed69a31d6 100644
--- a/enterprise/frontend/src/metabase-enterprise/data-studio/library/snippets/pages/EditSnippetPage/EditSnippetPage.tsx
+++ b/enterprise/frontend/src/metabase-enterprise/data-studio/library/snippets/pages/EditSnippetPage/EditSnippetPage.tsx
@@ -126,15 +126,14 @@ export function EditSnippetPage({ params, route }: EditSnippetPageProps) {
/>
{isReadOnly && (
<Alert
+ size="compact"
className={S.flexStart}
color="warning"
- p="0.75rem"
title={
snippet?.archived
? t`This snippet is archived and cannot be edited. Unarchive it to edit.`
: t`This snippet is not editable because Remote Sync is in read-only mode.`
}
- variant="outline"
w="auto"
/>
)}
diff --git a/enterprise/frontend/src/metabase-enterprise/database_routing/DatabaseRoutingSection/DatabaseRoutingSection.tsx b/enterprise/frontend/src/metabase-enterprise/database_routing/DatabaseRoutingSection/DatabaseRoutingSection.tsx
index a360a96c994..7733a7465b6 100644
--- a/enterprise/frontend/src/metabase-enterprise/database_routing/DatabaseRoutingSection/DatabaseRoutingSection.tsx
+++ b/enterprise/frontend/src/metabase-enterprise/database_routing/DatabaseRoutingSection/DatabaseRoutingSection.tsx
@@ -167,8 +167,8 @@ export const DatabaseRoutingSection = ({
<>
<DatabaseInfoSectionDivider />
<Alert
+ size="compact"
variant="light"
- color="info"
icon={<Icon name="info" />}
mb="md"
>
@@ -183,8 +183,8 @@ export const DatabaseRoutingSection = ({
{hasDbRoutingEnabled(database) && (
<Alert
+ size="compact"
variant="light"
- color="info"
icon={<Icon name="info" />}
mb="md"
>
diff --git a/enterprise/frontend/src/metabase-enterprise/google_drive/GdriveAddDataPanel.tsx b/enterprise/frontend/src/metabase-enterprise/google_drive/GdriveAddDataPanel.tsx
index 64224379266..c1e2d8197a7 100644
--- a/enterprise/frontend/src/metabase-enterprise/google_drive/GdriveAddDataPanel.tsx
+++ b/enterprise/frontend/src/metabase-enterprise/google_drive/GdriveAddDataPanel.tsx
@@ -294,27 +294,13 @@ const ErrorAlert = ({
return (
<Alert
+ size="compact"
+ variant="light"
icon={<Icon name="warning" c="feedback-negative" />}
- variant="outline"
title={t`Couldn't sync Google Sheets`}
w="100%"
- styles={{
- root: {
- backgroundColor: "transparent",
- border: "1px solid var(--mb-color-border-neutral)",
- },
- wrapper: {
- alignItems: "flex-start",
- },
- label: {
- fontSize: "var(--mantine-font-size-md)",
- color: "var(--mb-color-text-primary)",
- },
- }}
>
- <Text fz="sm" lh="lg">
- {error}
- </Text>
+ {error}
{children}
</Alert>
);
diff --git a/enterprise/frontend/src/metabase-enterprise/license/components/BillingInfo/BillingInfo.tsx b/enterprise/frontend/src/metabase-enterprise/license/components/BillingInfo/BillingInfo.tsx
index 83173cf5c16..d7096292904 100644
--- a/enterprise/frontend/src/metabase-enterprise/license/components/BillingInfo/BillingInfo.tsx
+++ b/enterprise/frontend/src/metabase-enterprise/license/components/BillingInfo/BillingInfo.tsx
@@ -1,10 +1,9 @@
import { t } from "ttag";
import { SettingHeader } from "metabase/admin/settings/components/SettingHeader";
-import { Alert } from "metabase/common/components/Alert";
import { ButtonLink } from "metabase/common/components/ExternalLink";
import { useStoreUrl } from "metabase/common/hooks";
-import { Anchor, Box, Icon, Text } from "metabase/ui";
+import { Alert, Anchor, Box, Icon } from "metabase/ui";
import type { BillingInfo as IBillingInfo } from "metabase-types/api";
import { BillingInfoTable } from "./BillingInfoTable";
@@ -47,19 +46,16 @@ const BillingInfoError = () => {
<>
<SettingHeader id="billing" title={t`Billing`} />
<Box mt="1rem" data-testid="billing-info-error">
- <Alert variant="error" icon="warning">
- <Text c="text-secondary">
- {t`An error occurred while fetching information about your billing.`}
- <br />
- <strong>{t`Need help?`}</strong>{" "}
- {t`You can ask for billing help at `}
- <strong>
- {/* eslint-disable-next-line i18next/no-literal-string */}
- <Anchor href="mailto:[email protected]">
- </Anchor>
- </strong>
- </Text>
+ <Alert color="error" icon={<Icon name="warning" />}>
+ {t`An error occurred while fetching information about your billing.`}
+ <br />
+ <strong>{t`Need help?`}</strong> {t`You can ask for billing help at `}
+ <strong>
+ {/* eslint-disable-next-line i18next/no-literal-string */}
+ <Anchor href="mailto:[email protected]">
+ </Anchor>
+ </strong>
</Alert>
</Box>
</>
diff --git a/enterprise/frontend/src/metabase-enterprise/multi_factor_auth/components/AdminAuthCard/AdminAuthCard.tsx b/enterprise/frontend/src/metabase-enterprise/multi_factor_auth/components/AdminAuthCard/AdminAuthCard.tsx
index 5c8f1fd753f..999703a0fad 100644
--- a/enterprise/frontend/src/metabase-enterprise/multi_factor_auth/components/AdminAuthCard/AdminAuthCard.tsx
+++ b/enterprise/frontend/src/metabase-enterprise/multi_factor_auth/components/AdminAuthCard/AdminAuthCard.tsx
@@ -47,7 +47,7 @@ export function AdminAuthCard() {
size="sm"
/>
{enabled && overview && !overview.encryption_key_set && (
- <Alert color="warning">
+ <Alert size="compact" color="warning">
{t`Make sure to set the MB_ENCRYPTION_SECRET_KEY environment variable to encrypt authenticator secrets.`}
</Alert>
)}
diff --git a/enterprise/frontend/src/metabase-enterprise/remote_sync/components/PushChangesModal/PushChangesModal.tsx b/enterprise/frontend/src/metabase-enterprise/remote_sync/components/PushChangesModal/PushChangesModal.tsx
index 55132d9a5de..a0e3137eb89 100644
--- a/enterprise/frontend/src/metabase-enterprise/remote_sync/components/PushChangesModal/PushChangesModal.tsx
+++ b/enterprise/frontend/src/metabase-enterprise/remote_sync/components/PushChangesModal/PushChangesModal.tsx
@@ -78,7 +78,12 @@ export const PushChangesModal = ({
>
<Box pt="md">
{errorMessage && (
- <Alert mb="md" variant="error" icon={<Icon name="warning" />}>
+ <Alert
+ size="compact"
+ mb="md"
+ color="error"
+ icon={<Icon name="warning" />}
+ >
{errorMessage}
</Alert>
)}
diff --git a/enterprise/frontend/src/metabase-enterprise/remote_sync/components/RemoteSyncAdminSettings/DevInstanceUpsell.tsx b/enterprise/frontend/src/metabase-enterprise/remote_sync/components/RemoteSyncAdminSettings/DevInstanceUpsell.tsx
index 0155dabd036..fe7a79eb9bc 100644
--- a/enterprise/frontend/src/metabase-enterprise/remote_sync/components/RemoteSyncAdminSettings/DevInstanceUpsell.tsx
+++ b/enterprise/frontend/src/metabase-enterprise/remote_sync/components/RemoteSyncAdminSettings/DevInstanceUpsell.tsx
@@ -5,7 +5,7 @@ import { UpsellWrapperDismissible } from "metabase/common/components/upsells/com
import { UpsellGem } from "metabase/common/components/upsells/components/UpsellGem";
import { useDocsUrl } from "metabase/common/hooks/use-docs-url/use-docs-url";
import CS from "metabase/css/core/index.css";
-import { Alert, Box, Flex, Text } from "metabase/ui";
+import { Alert } from "metabase/ui";
export const DevInstanceUpsell = UpsellWrapperDismissible(
function DevInstanceUpsell({ onDismiss }: { onDismiss?: () => void }) {
@@ -15,25 +15,20 @@ export const DevInstanceUpsell = UpsellWrapperDismissible(
);
return (
<Alert
+ size="compact"
color="core-brand"
+ title={t`Need a dedicated development environment?`}
+ icon={<UpsellGem.New />}
withCloseButton
onClose={onDismiss}
classNames={{ closeButton: CS.alignSelfStart }}
>
- <Flex>
- <UpsellGem.New mt="0.125rem" />
- <Box ml="sm">
- <Text fw="bold">{t`Need a dedicated development environment?`}</Text>
- <Text lh="1.25rem">
- {jt`With ${(
- <ExternalLink
- key="link"
- href={devInstanceDocsUrl}
- >{t`Development instances`}</ExternalLink>
- )}, you can build and test your changes in a safe, isolated environment before syncing to production.`}
- </Text>
- </Box>
- </Flex>
+ {jt`With ${(
+ <ExternalLink
+ key="link"
+ href={devInstanceDocsUrl}
+ >{t`Development instances`}</ExternalLink>
+ )}, you can build and test your changes in a safe, isolated environment before syncing to production.`}
</Alert>
);
},
diff --git a/enterprise/frontend/src/metabase-enterprise/table-editing/admin/AdminDatabaseTableEditingSection.tsx b/enterprise/frontend/src/metabase-enterprise/table-editing/admin/AdminDatabaseTableEditingSection.tsx
index 5e08506ad62..0268afc0ac3 100644
--- a/enterprise/frontend/src/metabase-enterprise/table-editing/admin/AdminDatabaseTableEditingSection.tsx
+++ b/enterprise/frontend/src/metabase-enterprise/table-editing/admin/AdminDatabaseTableEditingSection.tsx
@@ -120,7 +120,12 @@ export function AdminDatabaseTableEditingSection({
</Box>
{databaseHasRouting && (
- <Alert variant="light" color="info" icon={<Icon name="info" />} mb="md">
+ <Alert
+ size="compact"
+ variant="light"
+ icon={<Icon name="info" />}
+ mb="md"
+ >
{t`Table editing can't be enabled when database routing is enabled.`}
</Alert>
)}
diff --git a/enterprise/frontend/src/metabase-enterprise/transforms-inspector/pages/TransformInspectPage/TransformInspectPage.tsx b/enterprise/frontend/src/metabase-enterprise/transforms-inspector/pages/TransformInspectPage/TransformInspectPage.tsx
index 99f5cbf5a57..5ac0790df23 100644
--- a/enterprise/frontend/src/metabase-enterprise/transforms-inspector/pages/TransformInspectPage/TransformInspectPage.tsx
+++ b/enterprise/frontend/src/metabase-enterprise/transforms-inspector/pages/TransformInspectPage/TransformInspectPage.tsx
@@ -10,7 +10,7 @@ import { useTransformPermissions } from "metabase/transforms/hooks/use-transform
import { useTransformWithPolling } from "metabase/transforms/hooks/use-transform-with-polling";
import { RunSection } from "metabase/transforms/pages/TransformRunPage/RunSection";
import { isMissingSourceDatabase } from "metabase/transforms/utils";
-import { Alert, Center, Icon, Text } from "metabase/ui";
+import { Alert, Center, Icon } from "metabase/ui";
import * as Urls from "metabase/urls";
import { InspectorContent } from "./components/InspectorContent";
@@ -51,8 +51,12 @@ export const TransformInspectPage = () => {
))
.with({ hasSucceeded: false }, () => (
<>
- <Alert color="core-brand" icon={<Icon name="info" />}>
- <Text>{t`To inspect the transform you need to run it first.`}</Text>
+ <Alert
+ size="compact"
+ color="core-brand"
+ icon={<Icon name="info" />}
+ >
+ {t`To inspect the transform you need to run it first.`}
</Alert>
<RunSection
transform={transform}
diff --git a/enterprise/frontend/src/metabase-enterprise/transforms-inspector/pages/TransformInspectPage/components/CardAlerts.tsx b/enterprise/frontend/src/metabase-enterprise/transforms-inspector/pages/TransformInspectPage/components/CardAlerts.tsx
index 62f023ba101..fdb04921a10 100644
--- a/enterprise/frontend/src/metabase-enterprise/transforms-inspector/pages/TransformInspectPage/components/CardAlerts.tsx
+++ b/enterprise/frontend/src/metabase-enterprise/transforms-inspector/pages/TransformInspectPage/components/CardAlerts.tsx
@@ -17,6 +17,7 @@ export const CardAlerts = ({ alerts, fullWidth }: CardAlertsProps) => {
<Stack gap="xs" w={fullWidth ? "100%" : undefined}>
{alerts.map((alert) => (
<Alert
+ size="compact"
key={alert.id}
icon={
<Icon
diff --git a/enterprise/frontend/src/metabase-enterprise/transforms-inspector/pages/TransformInspectPage/components/LensSections/GenericSummarySections/components/FieldInfoSection/FieldInfoSection.tsx b/enterprise/frontend/src/metabase-enterprise/transforms-inspector/pages/TransformInspectPage/components/LensSections/GenericSummarySections/components/FieldInfoSection/FieldInfoSection.tsx
index b32610a7e9c..dc2a450e3ea 100644
--- a/enterprise/frontend/src/metabase-enterprise/transforms-inspector/pages/TransformInspectPage/components/LensSections/GenericSummarySections/components/FieldInfoSection/FieldInfoSection.tsx
+++ b/enterprise/frontend/src/metabase-enterprise/transforms-inspector/pages/TransformInspectPage/components/LensSections/GenericSummarySections/components/FieldInfoSection/FieldInfoSection.tsx
@@ -70,6 +70,7 @@ export const FieldInfoSection = ({
</Card>
) : (
<Alert
+ size="compact"
color="warning"
icon={<Icon name="warning" />}
>{t`Missing input data`}</Alert>
@@ -88,6 +89,7 @@ export const FieldInfoSection = ({
</Card>
) : (
<Alert
+ size="compact"
color="warning"
icon={<Icon name="warning" />}
>{t`No output table`}</Alert>
diff --git a/enterprise/frontend/src/metabase-enterprise/transforms-python/pages/PythonLibraryEditorPage/PythonLibraryEditorPage.tsx b/enterprise/frontend/src/metabase-enterprise/transforms-python/pages/PythonLibraryEditorPage/PythonLibraryEditorPage.tsx
index 951ff4eac3c..f11d02298cf 100644
--- a/enterprise/frontend/src/metabase-enterprise/transforms-python/pages/PythonLibraryEditorPage/PythonLibraryEditorPage.tsx
+++ b/enterprise/frontend/src/metabase-enterprise/transforms-python/pages/PythonLibraryEditorPage/PythonLibraryEditorPage.tsx
@@ -106,11 +106,10 @@ function PythonLibraryEditor({ path }: PythonLibraryEditorProps) {
{isRemoteSyncReadOnly && (
<Alert
+ size="compact"
className={S.flexStart}
color="warning"
- p="0.75rem"
title={t`The Python library is not editable because Remote Sync is in read-only mode.`}
- variant="outline"
w="auto"
/>
)}
diff --git a/enterprise/frontend/src/metabase-enterprise/user_provisioning/components/UserProvisioning.tsx b/enterprise/frontend/src/metabase-enterprise/user_provisioning/components/UserProvisioning.tsx
index a13e07d0352..b342e229b58 100644
--- a/enterprise/frontend/src/metabase-enterprise/user_provisioning/components/UserProvisioning.tsx
+++ b/enterprise/frontend/src/metabase-enterprise/user_provisioning/components/UserProvisioning.tsx
@@ -179,6 +179,7 @@ export const UserProvisioning = () => {
)}
{isScimEnabledWithoutToken && !hasTokenGenerationError && (
<Alert
+ size="compact"
color="warning"
icon={<Icon name="warning" />}
>{t`Generate a SCIM token below to complete the setup.`}</Alert>
diff --git a/enterprise/frontend/src/metabase-enterprise/workspaces/components/WorkspaceDatabaseSection/WorkspaceDatabaseSection.tsx b/enterprise/frontend/src/metabase-enterprise/workspaces/components/WorkspaceDatabaseSection/WorkspaceDatabaseSection.tsx
index 06b53210c82..ca1713f837f 100644
--- a/enterprise/frontend/src/metabase-enterprise/workspaces/components/WorkspaceDatabaseSection/WorkspaceDatabaseSection.tsx
+++ b/enterprise/frontend/src/metabase-enterprise/workspaces/components/WorkspaceDatabaseSection/WorkspaceDatabaseSection.tsx
@@ -100,8 +100,8 @@ export function WorkspaceDatabaseSection({
<>
<DatabaseInfoSectionDivider />
<Alert
+ size="compact"
variant="light"
- color="info"
icon={<FixedSizeIcon name="info" />}
mb="md"
>
diff --git a/enterprise/frontend/src/metabase-enterprise/writable_connection/components/WritableConnectionInfoSection/WritableConnectionInfoSection.tsx b/enterprise/frontend/src/metabase-enterprise/writable_connection/components/WritableConnectionInfoSection/WritableConnectionInfoSection.tsx
index cfa78931770..a5ef64dde85 100644
--- a/enterprise/frontend/src/metabase-enterprise/writable_connection/components/WritableConnectionInfoSection/WritableConnectionInfoSection.tsx
+++ b/enterprise/frontend/src/metabase-enterprise/writable_connection/components/WritableConnectionInfoSection/WritableConnectionInfoSection.tsx
@@ -70,8 +70,8 @@ export function WritableConnectionInfoSection({
<>
<DatabaseInfoSectionDivider />
<Alert
+ size="compact"
variant="light"
- color="info"
icon={<Icon name="info" />}
mb="md"
>
diff --git a/frontend/src/embedding-sdk-bundle/components/private/PublicComponentWrapper/SdkError.tsx b/frontend/src/embedding-sdk-bundle/components/private/PublicComponentWrapper/SdkError.tsx
index 4eb35509498..80e3ffac55b 100644
--- a/frontend/src/embedding-sdk-bundle/components/private/PublicComponentWrapper/SdkError.tsx
+++ b/frontend/src/embedding-sdk-bundle/components/private/PublicComponentWrapper/SdkError.tsx
@@ -7,9 +7,17 @@ import { getErrorComponent } from "embedding-sdk-bundle/store/selectors";
import type { SdkErrorComponentProps } from "embedding-sdk-bundle/types";
import { ERROR_DOC_LINKS } from "embedding-sdk-shared/errors";
import type { MetabaseErrorCode } from "embedding-sdk-shared/errors/error-code";
-import { Alert } from "metabase/common/components/Alert";
import { EMBEDDING_SDK_PORTAL_ROOT_ELEMENT_ID } from "metabase/embedding-sdk/config";
-import { Anchor, Box, Center, Code, Flex, Portal } from "metabase/ui";
+import {
+ Alert,
+ Anchor,
+ Box,
+ Center,
+ Code,
+ Flex,
+ Icon,
+ Portal,
+} from "metabase/ui";
export const SdkError = ({
message,
@@ -95,7 +103,12 @@ export function SdkPortalErrorWrapper({ children }: PropsWithChildren) {
const DefaultErrorMessage = ({ message, onClose }: SdkErrorComponentProps) => (
<Box p="sm" maw={600}>
- <Alert variant="error" icon="warning" onClose={onClose}>
+ <Alert
+ color="error"
+ icon={<Icon name="warning" />}
+ withCloseButton={Boolean(onClose)}
+ onClose={onClose}
+ >
<Box
style={{
WebkitLineClamp: 2,
diff --git a/frontend/src/metabase/admin/ai/MetabotSlackSetupAlerts.tsx b/frontend/src/metabase/admin/ai/MetabotSlackSetupAlerts.tsx
index f388dea26d8..bda5b63a6d7 100644
--- a/frontend/src/metabase/admin/ai/MetabotSlackSetupAlerts.tsx
+++ b/frontend/src/metabase/admin/ai/MetabotSlackSetupAlerts.tsx
@@ -6,7 +6,7 @@ import {
ExternalLink,
} from "metabase/common/components/ExternalLink";
import { Link } from "metabase/common/components/Link";
-import { Alert, Group, Icon, Stack, Text } from "metabase/ui";
+import { Alert, Group, Icon, Stack } from "metabase/ui";
import S from "./MetabotSlackSetup.module.css";
@@ -25,15 +25,9 @@ export function MissingScopesAlert({
: "https://api.slack.com/apps";
return (
- <Alert
- color="core-brand"
- title={t`Metabot needs more Slack permissions`}
- styles={{ label: { fontSize: "var(--mantine-font-size-md)" } }}
- >
+ <Alert color="core-brand" title={t`Metabot needs more Slack permissions`}>
<Stack gap="md" mt="sm">
- <Text>
- {t`Your Slack app is missing OAuth scopes required for Metabot. Copy the updated manifest and paste it in your Slack app settings. You will need to re-install your application to your workspace after.`}
- </Text>
+ {t`Your Slack app is missing OAuth scopes required for Metabot. Copy the updated manifest and paste it in your Slack app settings. You will need to re-install your application to your workspace after.`}
<Group gap="md">
<CopyButton
value={JSON.stringify(manifest, null, 2)}
@@ -57,16 +51,14 @@ export function MissingScopesAlert({
export function MetabotSetupRequiredAlert() {
return (
<Alert
+ size="compact"
color="core-brand"
title={t`This feature requires an AI model`}
- styles={{ label: { fontSize: "var(--mantine-font-size-md)" } }}
>
- <Text mt="sm">
- <Link
- to="/admin/metabot#setup"
- variant="brand"
- >{t`Connect to a provider`}</Link>
- </Text>
+ <Link
+ to="/admin/metabot#setup"
+ variant="brand"
+ >{t`Connect to a provider`}</Link>
</Alert>
);
}
@@ -80,15 +72,13 @@ export function EncryptionRequiredAlert({
}: EncryptionRequiredAlertProps) {
return (
<Alert
+ size="compact"
color="core-brand"
title={t`You must enable encryption for your instance in order to use this feature`}
- styles={{ label: { fontSize: "var(--mantine-font-size-md)" } }}
>
- <Text mt="sm">
- <ExternalLink
- href={docsUrl}
- >{t`Learn how to enable encryption`}</ExternalLink>
- </Text>
+ <ExternalLink
+ href={docsUrl}
+ >{t`Learn how to enable encryption`}</ExternalLink>
</Alert>
);
}
diff --git a/frontend/src/metabase/admin/databases/components/DatabaseHelpSidePanel/EmbeddedEngineDocContent/EmbeddedEngineDocContent.tsx b/frontend/src/metabase/admin/databases/components/DatabaseHelpSidePanel/EmbeddedEngineDocContent/EmbeddedEngineDocContent.tsx
index cff72e83a6a..94f4a2cbabb 100644
--- a/frontend/src/metabase/admin/databases/components/DatabaseHelpSidePanel/EmbeddedEngineDocContent/EmbeddedEngineDocContent.tsx
+++ b/frontend/src/metabase/admin/databases/components/DatabaseHelpSidePanel/EmbeddedEngineDocContent/EmbeddedEngineDocContent.tsx
@@ -2,7 +2,7 @@ import { useRef } from "react";
import { useMount } from "react-use";
import { Markdown } from "metabase/common/components/Markdown";
-import { Alert, Box, Loader, Text } from "metabase/ui";
+import { Alert, Box, Loader } from "metabase/ui";
import type { EngineKey } from "metabase-types/api";
import S from "./EmbeddedEngineDocContent.module.css";
@@ -43,8 +43,8 @@ export const EmbeddedEngineDocContent = ({ engineKey }: Props) => {
return (
<Box ref={markdownRef} w="100%">
{loadingError && (
- <Alert color="info" variant="outline" mt="xl">
- <Text>{loadingError}</Text>
+ <Alert size="compact" variant="light" mt="xl">
+ {loadingError}
</Alert>
)}
{isLoading ? (
diff --git a/frontend/src/metabase/admin/databases/components/DatabaseModelFeaturesSection/ModelActionsSection/ModelActionsSection.tsx b/frontend/src/metabase/admin/databases/components/DatabaseModelFeaturesSection/ModelActionsSection/ModelActionsSection.tsx
index e208e50175d..89fa41c328e 100644
--- a/frontend/src/metabase/admin/databases/components/DatabaseModelFeaturesSection/ModelActionsSection/ModelActionsSection.tsx
+++ b/frontend/src/metabase/admin/databases/components/DatabaseModelFeaturesSection/ModelActionsSection/ModelActionsSection.tsx
@@ -54,8 +54,8 @@ export function ModelActionsSection({
{disabled && (
<Box>
<Alert
+ size="compact"
variant="light"
- color="info"
icon={<Icon name="info" />}
mb="md"
>
diff --git a/frontend/src/metabase/admin/databases/components/DatabaseModelFeaturesSection/ModelCachingControl/ModelCachingControl.tsx b/frontend/src/metabase/admin/databases/components/DatabaseModelFeaturesSection/ModelCachingControl/ModelCachingControl.tsx
index 3e5b5d54d2f..8204c66ca5d 100644
--- a/frontend/src/metabase/admin/databases/components/DatabaseModelFeaturesSection/ModelCachingControl/ModelCachingControl.tsx
+++ b/frontend/src/metabase/admin/databases/components/DatabaseModelFeaturesSection/ModelCachingControl/ModelCachingControl.tsx
@@ -92,8 +92,8 @@ export function ModelCachingControl({ database, disabled }: Props) {
{disabled && (
<Box>
<Alert
+ size="compact"
variant="light"
- color="info"
icon={<Icon name="info" />}
mb="md"
>
diff --git a/frontend/src/metabase/admin/databases/components/DeleteDatabaseModel/DeleteDatabaseModal.tsx b/frontend/src/metabase/admin/databases/components/DeleteDatabaseModel/DeleteDatabaseModal.tsx
index f35c4bca6d3..d97d37b3c26 100644
--- a/frontend/src/metabase/admin/databases/components/DeleteDatabaseModel/DeleteDatabaseModal.tsx
+++ b/frontend/src/metabase/admin/databases/components/DeleteDatabaseModel/DeleteDatabaseModal.tsx
@@ -16,7 +16,6 @@ import {
Input,
Modal,
Stack,
- Text,
UnstyledButton,
} from "metabase/ui";
import * as Urls from "metabase/urls";
@@ -131,17 +130,15 @@ export const DeleteDatabaseModal = ({
>
{hasContent && (
<DeleteDatabaseModalSection isHidden={isContentRemovalConfirmed}>
- <Alert color="info" icon={<Icon name="info" />}>
- <Text>
- {jt`If you’re trying to migrate from a development DB to a production one, you don’t need to do this. You can just ${(
- <UnstyledButton
- key="button"
- onClick={handleEditConnectionDetailsClick}
- c="core-brand"
- fw="bold"
- >{t`edit your connection details.`}</UnstyledButton>
- )}`}
- </Text>
+ <Alert icon={<Icon name="info" />}>
+ {jt`If you’re trying to migrate from a development DB to a production one, you don’t need to do this. You can just ${(
+ <UnstyledButton
+ key="button"
+ onClick={handleEditConnectionDetailsClick}
+ c="core-brand"
+ fw="bold"
+ >{t`edit your connection details.`}</UnstyledButton>
+ )}`}
</Alert>
</DeleteDatabaseModalSection>
)}
@@ -164,8 +161,8 @@ export const DeleteDatabaseModal = ({
<DeleteDatabaseModalSection
isHidden={!isContentRemovalConfirmed && hasContent}
>
- <Alert icon={<Icon name="warning" />} color="error">
- <Text>{defaultDatabaseRemovalMessage}</Text>
+ <Alert size="compact" icon={<Icon name="warning" />} color="error">
+ {defaultDatabaseRemovalMessage}
</Alert>
</DeleteDatabaseModalSection>
<DeleteDatabaseModalSection
diff --git a/frontend/src/metabase/admin/datamodel/components/SegmentForm/SegmentForm.tsx b/frontend/src/metabase/admin/datamodel/components/SegmentForm/SegmentForm.tsx
index ae69b84a891..9770ec78234 100644
--- a/frontend/src/metabase/admin/datamodel/components/SegmentForm/SegmentForm.tsx
+++ b/frontend/src/metabase/admin/datamodel/components/SegmentForm/SegmentForm.tsx
@@ -67,12 +67,11 @@ export const SegmentForm = ({
<FormBody>
{isReadOnly && (
<Alert
+ size="compact"
color="warning"
display="inline-flex"
mb="md"
- p="0.75rem"
title={t`This segment can't be edited because this table is published and Remote Sync is in read-only mode.`}
- variant="outline"
w="auto"
/>
)}
diff --git a/frontend/src/metabase/admin/permissions/components/PermissionsEditor/PermissionsEditorLegacyWarning.tsx b/frontend/src/metabase/admin/permissions/components/PermissionsEditor/PermissionsEditorLegacyWarning.tsx
index 40d74780e39..32f3819b605 100644
--- a/frontend/src/metabase/admin/permissions/components/PermissionsEditor/PermissionsEditorLegacyWarning.tsx
+++ b/frontend/src/metabase/admin/permissions/components/PermissionsEditor/PermissionsEditorLegacyWarning.tsx
@@ -8,8 +8,8 @@ export const PermissionsEditorLegacyNoSelfServiceWarning = () => {
return (
<Box mt="md" mb="sm" style={{ marginInlineEnd: "2.5rem" }}>
- <Alert icon={<Icon name="warning" size={16} />} color="info">
- <Text fw="bold">
+ <Alert size="compact" variant="light" icon={<Icon name="warning" />}>
+ <Text fw="bold" c="text-secondary">
{t`The “No self-service” access level for View data is going away.`}
{!isExpanded && (
<>
diff --git a/frontend/src/metabase/admin/permissions/components/PermissionsEditor/PermissionsEditorSplitPermsMessage.tsx b/frontend/src/metabase/admin/permissions/components/PermissionsEditor/PermissionsEditorSplitPermsMessage.tsx
index d43b2f5412a..d68cf7fa51d 100644
--- a/frontend/src/metabase/admin/permissions/components/PermissionsEditor/PermissionsEditorSplitPermsMessage.tsx
+++ b/frontend/src/metabase/admin/permissions/components/PermissionsEditor/PermissionsEditorSplitPermsMessage.tsx
@@ -3,7 +3,7 @@ import { t } from "ttag";
import { useDispatch, useSelector } from "metabase/redux";
import { updateUserSetting } from "metabase/redux/settings";
import { getDocsUrl } from "metabase/selectors/settings";
-import { Alert, Anchor, Box, Icon, Text } from "metabase/ui";
+import { Alert, Anchor, Box, Icon } from "metabase/ui";
export const PermissionsEditorSplitPermsMessage = () => {
const dispatch = useDispatch();
@@ -30,20 +30,19 @@ export const PermissionsEditorSplitPermsMessage = () => {
}}
>
<Alert
- icon={<Icon name="info" size={16} />}
+ size="compact"
+ icon={<Icon name="info" />}
color="core-brand"
withCloseButton
onClose={handleDismiss}
>
- <Text>
- {t`Your data permissions may look different, but the access hasn’t changed.`}
- <Anchor
- ml="0.5rem"
- fw="bold"
- target="_blank"
- href={docsUrl}
- >{t`Learn more`}</Anchor>
- </Text>
+ {t`Your data permissions may look different, but the access hasn’t changed.`}
+ <Anchor
+ ml="0.5rem"
+ fw="bold"
+ target="_blank"
+ href={docsUrl}
+ >{t`Learn more`}</Anchor>
</Alert>
</Box>
);
diff --git a/frontend/src/metabase/admin/permissions/selectors/confirmations.tsx b/frontend/src/metabase/admin/permissions/selectors/confirmations.tsx
index 587475b9a10..1a6f815f00a 100644
--- a/frontend/src/metabase/admin/permissions/selectors/confirmations.tsx
+++ b/frontend/src/metabase/admin/permissions/selectors/confirmations.tsx
@@ -10,9 +10,8 @@ import {
getSchemasPermission,
hasPermissionValueInSubgraph,
} from "metabase/admin/permissions/utils/graph";
-import { Alert } from "metabase/common/components/Alert";
import { PLUGIN_ADVANCED_PERMISSIONS } from "metabase/plugins";
-import { Flex, Text } from "metabase/ui";
+import { Alert, Flex, Icon, Text } from "metabase/ui";
import type Database from "metabase-lib/v1/metadata/Database";
import type {
ConcreteTableId,
@@ -255,7 +254,7 @@ export function getViewDataPermissionsTooRestrictiveWarningModal(
message: (
<Flex direction="column" gap="lg">
<Text>{coreMessage}</Text>
- <Alert variant="warning" icon="warning">
+ <Alert size="compact" color="warning" icon={<Icon name="warning" />}>
{resetGranularSettingsWarnging}
</Alert>
</Flex>
diff --git a/frontend/src/metabase/admin/settings/components/EmbeddingSettings/EmbeddingSecuritySettings/EmbeddingAppSameSiteCookieDescription.tsx b/frontend/src/metabase/admin/settings/components/EmbeddingSettings/EmbeddingSecuritySettings/EmbeddingAppSameSiteCookieDescription.tsx
index 6278c735b84..6eef93baf14 100644
--- a/frontend/src/metabase/admin/settings/components/EmbeddingSettings/EmbeddingSecuritySettings/EmbeddingAppSameSiteCookieDescription.tsx
+++ b/frontend/src/metabase/admin/settings/components/EmbeddingSettings/EmbeddingSecuritySettings/EmbeddingAppSameSiteCookieDescription.tsx
@@ -1,11 +1,10 @@
import { jt, t } from "ttag";
-import { Alert } from "metabase/common/components/Alert";
import { ExternalLink } from "metabase/common/components/ExternalLink";
import { useSetting } from "metabase/common/hooks";
import { useSelector } from "metabase/redux";
import { getDocsUrl } from "metabase/selectors/settings";
-import { Box, Center, Stack, Text } from "metabase/ui";
+import { Alert, Box, Center, Stack, Text } from "metabase/ui";
import { isSameOrigin } from "metabase/utils/dom";
import S from "./EmbeddingAppSameSiteCookieDescription.module.css";
@@ -41,13 +40,15 @@ export const EmbeddingAppSameSiteCookieDescription = () => {
function AuthorizedOriginsNote() {
return (
<Box data-testid="authorized-origins-note" w="22rem">
- <Alert className={S.SameSiteAlert} variant="warning" hasBorder>
+ <Alert size="compact" className={S.SameSiteAlert} color="warning">
<Center>
- <Text>{jt`You should probably change this setting to ${(
- <Text key="inner" component="span" fw="bold">
- {t`None`}
- </Text>
- )}.`}</Text>
+ <Text component="span" ta="center">
+ {jt`You should probably change this setting to ${(
+ <Text key="inner" component="span" fw="bold" c="text-secondary">
+ {t`None`}
+ </Text>
+ )}.`}
+ </Text>
</Center>
</Alert>
</Box>
diff --git a/frontend/src/metabase/admin/settings/components/EmbeddingSettings/EmbeddingSettingsCard.tsx b/frontend/src/metabase/admin/settings/components/EmbeddingSettings/EmbeddingSettingsCard.tsx
index def2ebfe00d..9e45c9cf717 100644
--- a/frontend/src/metabase/admin/settings/components/EmbeddingSettings/EmbeddingSettingsCard.tsx
+++ b/frontend/src/metabase/admin/settings/components/EmbeddingSettings/EmbeddingSettingsCard.tsx
@@ -1,7 +1,7 @@
import type { PropsWithChildren } from "react";
import { ExternalLink } from "metabase/common/components/ExternalLink";
-import { Alert, Box, Flex, Group, Icon, Stack, Text } from "metabase/ui";
+import { Alert, Flex, Group, Icon, Stack, Text } from "metabase/ui";
import type { IconName } from "metabase-types/api";
import S from "./EmbeddingSettings.module.css";
@@ -59,20 +59,13 @@ export function EmbeddingSettingsCard({
{alertInfoText && (
<Alert
+ size="compact"
+ variant="light"
data-testid="sdk-settings-alert-info"
mt="md"
- bg="background_page-secondary"
- bd="1px solid var(--mb-color-border-neutral)"
+ icon={<Icon name="info" />}
>
- <Flex gap="sm">
- <Box>
- <Icon c="text-secondary" name="info" mt="2px" />
- </Box>
-
- <Text c="text-primary" lh="lg">
- {alertInfoText}
- </Text>
- </Flex>
+ {alertInfoText}
</Alert>
)}
</Stack>
diff --git a/frontend/src/metabase/admin/settings/components/GeneralSettings/DevInstanceBanner.tsx b/frontend/src/metabase/admin/settings/components/GeneralSettings/DevInstanceBanner.tsx
index f1fdbafeb52..dc420d15ae2 100644
--- a/frontend/src/metabase/admin/settings/components/GeneralSettings/DevInstanceBanner.tsx
+++ b/frontend/src/metabase/admin/settings/components/GeneralSettings/DevInstanceBanner.tsx
@@ -1,7 +1,7 @@
import { t } from "ttag";
import { useSetting, useStoreUrl } from "metabase/common/hooks";
-import { Alert, Anchor, Icon, Text } from "metabase/ui";
+import { Alert, Anchor, Icon } from "metabase/ui";
export function DevInstanceBanner() {
const isDevMode = useSetting("development-mode?");
@@ -38,11 +38,11 @@ function BannerBody({
}) {
const storeUrl = useStoreUrl();
return (
- <Text lh="1.25rem">
+ <>
{copyText}{" "}
<Anchor fw="bold" href={storeUrl} target="_blank">
{linkText}
</Anchor>
- </Text>
+ </>
);
}
diff --git a/frontend/src/metabase/admin/settings/components/SettingsPages/CustomVisualizationsSettingsPage.tsx b/frontend/src/metabase/admin/settings/components/SettingsPages/CustomVisualizationsSettingsPage.tsx
index 700fcae0197..82beb347274 100644
--- a/frontend/src/metabase/admin/settings/components/SettingsPages/CustomVisualizationsSettingsPage.tsx
+++ b/frontend/src/metabase/admin/settings/components/SettingsPages/CustomVisualizationsSettingsPage.tsx
@@ -114,7 +114,11 @@ function CustomVizEmptyState() {
<Text c="text-secondary" lh="1.25rem">
{t`Show your data the way you need to with custom visualizations. Use the custom viz SDK to build visualization plugins and upload them here as packaged bundles (.tgz).`}
</Text>
- <Alert title={t`Security risk`} icon={<Icon name="warning" />}>
+ <Alert
+ size="compact"
+ title={t`Security risk`}
+ icon={<Icon name="warning" />}
+ >
{t`Be aware that custom visualizations can execute arbitrary code, and should only be added from trusted sources.`}
</Alert>
diff --git a/frontend/src/metabase/admin/settings/components/UploadSettings/UploadSettingsForm.tsx b/frontend/src/metabase/admin/settings/components/UploadSettings/UploadSettingsForm.tsx
index 9e68da6675f..954357a669b 100644
--- a/frontend/src/metabase/admin/settings/components/UploadSettings/UploadSettingsForm.tsx
+++ b/frontend/src/metabase/admin/settings/components/UploadSettings/UploadSettingsForm.tsx
@@ -285,11 +285,9 @@ export function UploadSettingsFormView({
}
const H2PersistenceWarning = ({ isHosted }: { isHosted: boolean }) => (
- <Stack my="md" maw={620}>
- <Alert icon={<Icon name="warning" />} color="warning">
- <Text>
- {t`Warning: uploads to the Sample Database are for testing only and may disappear. If you want your data to stick around, you should upload to a PostgreSQL, MySQL, Redshift or Clickhouse database.`}
- </Text>
+ <Alert my="md" maw={620} icon={<Icon name="warning" />} color="warning">
+ <Stack gap="sm">
+ {t`Warning: uploads to the Sample Database are for testing only and may disappear. If you want your data to stick around, you should upload to a PostgreSQL, MySQL, Redshift or Clickhouse database.`}
{isHosted && (
<Tooltip
label={
@@ -313,8 +311,8 @@ const H2PersistenceWarning = ({ isHosted }: { isHosted: boolean }) => (
>{t`Additional terms apply.`}</Text>
</Tooltip>
)}
- </Alert>
- </Stack>
+ </Stack>
+ </Alert>
);
const NoValidDatabasesMessage = () => (
diff --git a/frontend/src/metabase/admin/settings/components/widgets/Notifications/WebhookForm.tsx b/frontend/src/metabase/admin/settings/components/widgets/Notifications/WebhookForm.tsx
index 41de28da936..d41294c83af 100644
--- a/frontend/src/metabase/admin/settings/components/widgets/Notifications/WebhookForm.tsx
+++ b/frontend/src/metabase/admin/settings/components/widgets/Notifications/WebhookForm.tsx
@@ -24,7 +24,6 @@ import {
Group,
Icon,
ScrollArea,
- Text,
Title,
} from "metabase/ui";
import { getResponseErrorMessage } from "metabase/utils/errors";
@@ -224,21 +223,12 @@ export const WebhookForm = ({
>
{({ dirty, values, setFieldError, setFieldValue }) => (
<Form>
- <Alert
- variant="light"
- mb="1.5rem"
- style={{
- backgroundColor: "var(--mb-color-background_page-secondary)",
- }}
- px="1.5rem"
- py="1rem"
- radius="0.5rem"
- >
- <Text>{jt`You can send the payload of any Alert to this destination whenever the Alert is triggered. ${(
+ <Alert size="compact" variant="light" mb="1.5rem">
+ {jt`You can send the payload of any Alert to this destination whenever the Alert is triggered. ${(
<ExternalLink key="link" href={docsUrl}>
{t`Learn about Alerts`}
</ExternalLink>
- )}`}</Text>
+ )}`}
</Alert>
<Box mb="1.5rem">
<Flex align="end" gap="1rem">
diff --git a/frontend/src/metabase/common/components/Alert/Alert.stories.tsx b/frontend/src/metabase/common/components/Alert/Alert.stories.tsx
deleted file mode 100644
index a35b93ec75f..00000000000
--- a/frontend/src/metabase/common/components/Alert/Alert.stories.tsx
+++ /dev/null
@@ -1,51 +0,0 @@
-import type { StoryFn } from "@storybook/react";
-
-import { Alert, type AlertProps } from "./Alert";
-
-export default {
- title: "Components/Ask Before Using/Alert",
- component: Alert,
-};
-
-const Template: StoryFn<AlertProps> = (args) => {
- return <Alert {...args} />;
-};
-
-export const Default = {
- render: Template,
-
- args: {
- children: "Info alert",
- icon: "info",
- },
-};
-
-export const Warning = {
- render: Template,
-
- args: {
- children: "Warning alert",
- variant: "warning",
- icon: "warning",
- },
-};
-
-export const Error = {
- render: Template,
-
- args: {
- children: "Error alert",
- variant: "error",
- icon: "warning",
- },
-};
-
-export const WithCloseButton = {
- render: Template,
-
- args: {
- children: "Alert with close button",
- icon: "info",
- onClose: () => alert("Alert closed"),
- },
-};
diff --git a/frontend/src/metabase/common/components/Alert/Alert.styled.tsx b/frontend/src/metabase/common/components/Alert/Alert.styled.tsx
deleted file mode 100644
index 4011ff1e11a..00000000000
--- a/frontend/src/metabase/common/components/Alert/Alert.styled.tsx
+++ /dev/null
@@ -1,69 +0,0 @@
-// 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 { Icon } from "metabase/ui";
-import { color } from "metabase/ui/utils/colors";
-
-import type { AlertVariant } from "./Alert";
-
-interface AlertRootProps {
- hasBorder?: boolean;
- variant: AlertVariant;
-}
-
-const colorsByVariant = {
- border: {
- info: "var(--mb-color-background_page-tertiary)",
- error: color("feedback-negative"),
- warning: color("feedback-warning"),
- },
- background: {
- info: "var(--mb-color-background_page-secondary)",
- error: color("background_surface-error"),
- warning: color("background_surface-warning"),
- },
- icon: {
- info: color("text-primary"),
- error: color("feedback-negative"),
- warning: color("feedback-warning"),
- },
-};
-
-export const AlertRoot = styled.div<AlertRootProps>`
- display: flex;
- align-items: center;
- padding: 1.25rem 1rem;
- line-height: 1.4rem;
- color: var(--mb-color-text-primary);
- ${(props) =>
- props.hasBorder
- ? css`
- border: 1px solid ${colorsByVariant.border[props.variant]};
- `
- : null};
- border-radius: 0.5rem;
- background-color: ${(props) => colorsByVariant.background[props.variant]};
-`;
-
-interface BaseIconProps {
- variant: AlertVariant;
-}
-
-const BaseIcon = styled(Icon)<BaseIconProps>`
- box-sizing: content-box;
- flex-shrink: 0;
- padding: 0.5rem;
- color: ${(props) => colorsByVariant.icon[props.variant]};
-`;
-
-export const AlertIcon = styled(BaseIcon)<BaseIconProps>`
- padding: 0.5rem 1rem 0.5rem 0.5rem;
-`;
-
-export const CloseIcon = styled(BaseIcon)<BaseIconProps>`
- margin-left: auto;
- padding: 0.5rem 0.5rem 0.5rem 1rem;
- cursor: pointer;
-`;
diff --git a/frontend/src/metabase/common/components/Alert/Alert.tsx b/frontend/src/metabase/common/components/Alert/Alert.tsx
deleted file mode 100644
index cf81a400ee8..00000000000
--- a/frontend/src/metabase/common/components/Alert/Alert.tsx
+++ /dev/null
@@ -1,48 +0,0 @@
-import type { ReactNode } from "react";
-
-import type { IconName } from "metabase-types/api";
-
-import { AlertIcon, AlertRoot, CloseIcon } from "./Alert.styled";
-
-export type AlertVariant = "info" | "warning" | "error";
-
-export interface AlertProps {
- children: ReactNode;
- icon?: IconName;
- hasBorder?: boolean;
- className?: string;
- variant?: AlertVariant;
- onClose?: () => void;
-}
-/** @deprecated - use metabase/ui alert instead **/
-export const Alert = ({
- children,
- hasBorder = true,
- icon,
- variant = "info",
- onClose,
- className,
-}: AlertProps) => {
- return (
- <AlertRoot
- hasBorder={hasBorder}
- className={className}
- variant={variant}
- role="alert"
- >
- {icon && <AlertIcon variant={variant} name={icon} size={24} />}
-
- <div>{children}</div>
-
- {onClose && (
- <CloseIcon
- variant="info"
- name="close"
- size={24}
- onClick={onClose}
- data-testid="alert-close-button"
- />
- )}
- </AlertRoot>
- );
-};
diff --git a/frontend/src/metabase/common/components/Alert/Alert.unit.spec.tsx b/frontend/src/metabase/common/components/Alert/Alert.unit.spec.tsx
deleted file mode 100644
index d55bbf4263a..00000000000
--- a/frontend/src/metabase/common/components/Alert/Alert.unit.spec.tsx
+++ /dev/null
@@ -1,17 +0,0 @@
-import { render, screen } from "__support__/ui";
-
-import { Alert } from "./Alert";
-
-const ALERT_TEXT = "alert text";
-
-describe("Alert", () => {
- it("renders content", () => {
- render(<Alert>{ALERT_TEXT}</Alert>);
- expect(screen.getByText(ALERT_TEXT)).toBeInTheDocument();
- });
-
- it("renders icon", () => {
- render(<Alert icon="info">{ALERT_TEXT}</Alert>);
- expect(screen.getByLabelText("info icon")).toBeInTheDocument();
- });
-});
diff --git a/frontend/src/metabase/common/components/Alert/index.ts b/frontend/src/metabase/common/components/Alert/index.ts
deleted file mode 100644
index 1ae3a8ab19c..00000000000
--- a/frontend/src/metabase/common/components/Alert/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export { Alert } from "./Alert";
diff --git a/frontend/src/metabase/databases/components/DatabaseEngineWarning/DatabaseEngineWarning.tsx b/frontend/src/metabase/databases/components/DatabaseEngineWarning/DatabaseEngineWarning.tsx
index b2bbea77f51..0043b3db811 100644
--- a/frontend/src/metabase/databases/components/DatabaseEngineWarning/DatabaseEngineWarning.tsx
+++ b/frontend/src/metabase/databases/components/DatabaseEngineWarning/DatabaseEngineWarning.tsx
@@ -1,8 +1,7 @@
import { jt, t } from "ttag";
import _ from "underscore";
-import { Alert } from "metabase/common/components/Alert";
-import { Anchor, Box } from "metabase/ui";
+import { Alert, Anchor, Box, Icon } from "metabase/ui";
import type { Engine } from "metabase-types/api";
export interface DatabaseEngineWarningProps {
@@ -70,7 +69,7 @@ interface NewEngineWarningProps {
const NewEngineWarning = ({ engineName, onChange }: NewEngineWarningProps) => (
<Box mb="xl">
- <Alert>
+ <Alert size="compact" variant="light">
{t`This driver will be removed in a future release.`}{" "}
{jt`We recommend you upgrade to the ${(
<Anchor
@@ -94,7 +93,7 @@ interface OldEngineWarningProps {
const OldEngineWarning = ({ engineName, onChange }: OldEngineWarningProps) => (
<Box mb="xl">
- <Alert>
+ <Alert variant="light">
{t`This is our new ${engineName} driver.`}{" "}
{t`The old driver has been deprecated and will be removed in a future release.`}{" "}
{jt`If you really need to use it, you can ${(
@@ -114,7 +113,7 @@ const OldEngineWarning = ({ engineName, onChange }: OldEngineWarningProps) => (
const CommunityEngineWarning = () => (
<Box mb="xl">
- <Alert icon="info">
+ <Alert variant="light" icon={<Icon name="info" />}>
{/* eslint-disable-next-line metabase/no-literal-metabase-strings -- Metabase settings */}
{t`This is a community-developed driver and not supported by Metabase. `}
</Alert>
diff --git a/frontend/src/metabase/databases/components/DatabaseFormError/DatabaseFormError.tsx b/frontend/src/metabase/databases/components/DatabaseFormError/DatabaseFormError.tsx
index 3cc971ef635..1fbd3598f58 100644
--- a/frontend/src/metabase/databases/components/DatabaseFormError/DatabaseFormError.tsx
+++ b/frontend/src/metabase/databases/components/DatabaseFormError/DatabaseFormError.tsx
@@ -3,7 +3,7 @@ import { Fragment, useRef } from "react";
import { useMount } from "react-use";
import { t } from "ttag";
-import { Alert, Box, Button, Divider, Icon, Paper, Text } from "metabase/ui";
+import { Alert, Box, Button, Divider, Icon, Paper } from "metabase/ui";
import { AdditionalHelpButtonGroup } from "./AdditionalHelpButtonGroup";
import { CheckHostAndPortButton } from "./CheckHostAndPortButton";
@@ -34,8 +34,13 @@ export const DatabaseFormError = () => {
return (
<Paper className={S.paper} ref={ref}>
<Box p="md" pb={0}>
- <Alert color="warning" icon={<Icon name="warning" />} title={title}>
- <Text>{errorMessage}</Text>
+ <Alert
+ size="compact"
+ color="warning"
+ icon={<Icon name="warning" />}
+ title={title}
+ >
+ {errorMessage}
</Alert>
{troubleshootingTips.map((tipProps, index) => (
<Fragment key={tipProps.key}>
diff --git a/frontend/src/metabase/embedding/embedding-hub/components/StepperWithCards/StepperWithCards.module.css b/frontend/src/metabase/embedding/embedding-hub/components/StepperWithCards/StepperWithCards.module.css
index 7348b561c14..ea2736017d1 100644
--- a/frontend/src/metabase/embedding/embedding-hub/components/StepperWithCards/StepperWithCards.module.css
+++ b/frontend/src/metabase/embedding/embedding-hub/components/StepperWithCards/StepperWithCards.module.css
@@ -41,7 +41,8 @@
}
.stepDescription {
- padding: 0.625rem 0 1.25rem 0;
+ /* padding so the card shadow isn't clipped */
+ padding: 0.625rem 0.25rem 1.25rem 0;
}
.stepCard {
@@ -74,15 +75,6 @@
border: 1px solid var(--mb-color-core-metabase_brand) !important;
}
-.infoAlertWrapper {
- align-items: flex-start;
-}
-
-.infoAlertIcon {
- margin-right: var(--mantine-spacing-xs);
-}
-
.infoAlertMessage {
white-space: pre;
- color: var(--mb-color-text-primary);
}
diff --git a/frontend/src/metabase/embedding/embedding-hub/components/StepperWithCards/StepperWithCards.tsx b/frontend/src/metabase/embedding/embedding-hub/components/StepperWithCards/StepperWithCards.tsx
index b878139533e..0501c9d48a9 100644
--- a/frontend/src/metabase/embedding/embedding-hub/components/StepperWithCards/StepperWithCards.tsx
+++ b/frontend/src/metabase/embedding/embedding-hub/components/StepperWithCards/StepperWithCards.tsx
@@ -237,15 +237,11 @@ const StepAlert = ({
message: string;
}) => (
<Alert
- icon={<Icon size={14} name={type === "success" ? "check" : "info"} />}
+ size="compact"
+ icon={<Icon name={type === "success" ? "check" : "info"} />}
mt="xl"
color={type === "info" ? "core-brand" : type}
- lh="lg"
- classNames={{
- wrapper: S.infoAlertWrapper,
- icon: S.infoAlertIcon,
- message: S.infoAlertMessage,
- }}
+ classNames={{ message: S.infoAlertMessage }}
>
{message}
</Alert>
diff --git a/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/components/Common/SetupSsoAlert.tsx b/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/components/Common/SetupSsoAlert.tsx
index 75e98337371..895eaa724be 100644
--- a/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/components/Common/SetupSsoAlert.tsx
+++ b/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/components/Common/SetupSsoAlert.tsx
@@ -1,7 +1,7 @@
import { jt, t } from "ttag";
import { useDocsUrl } from "metabase/common/hooks";
-import { Alert, Anchor, Icon, Text } from "metabase/ui";
+import { Alert, Anchor, Icon } from "metabase/ui";
import { SETUP_SSO_CAMPAIGN, UTM_LOCATION } from "../../analytics";
@@ -20,24 +20,21 @@ export const SetupSsoAlert = () => {
return (
<Alert
- icon={
- <Icon name="warning_triangle_filled" c="text-secondary" size={16} />
- }
+ size="compact"
+ icon={<Icon name="warning_triangle_filled" />}
color="warning"
>
- <Text size="md" lh="lg">
- {jt`This embed will only work for local testing. To get production ready code, configure ${(
- <Anchor
- key="configure-sso"
- href={setupSsoUrl}
- target="_blank"
- size="md"
- lh="lg"
- >
- {t`JWT SSO or SAML`}
- </Anchor>
- )}.`}
- </Text>
+ {jt`This embed will only work for local testing. To get production ready code, configure ${(
+ <Anchor
+ key="configure-sso"
+ href={setupSsoUrl}
+ target="_blank"
+ size="md"
+ lh="lg"
+ >
+ {t`JWT SSO or SAML`}
+ </Anchor>
+ )}.`}
</Alert>
);
};
diff --git a/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/components/DatabaseRoutingWarning.tsx b/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/components/DatabaseRoutingWarning.tsx
index c3b3dffb5d1..5c41285362c 100644
--- a/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/components/DatabaseRoutingWarning.tsx
+++ b/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/components/DatabaseRoutingWarning.tsx
@@ -50,6 +50,7 @@ export const DatabaseRoutingWarning = ({
return (
<Alert
+ size="compact"
variant="light"
color="warning"
icon={<Icon name="warning" />}
diff --git a/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/components/LegacyStaticEmbeddingAlert.tsx b/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/components/LegacyStaticEmbeddingAlert.tsx
index 63d30982466..bec7dc303e9 100644
--- a/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/components/LegacyStaticEmbeddingAlert.tsx
+++ b/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/components/LegacyStaticEmbeddingAlert.tsx
@@ -5,7 +5,7 @@ import { useSdkIframeEmbedSetupContext } from "metabase/embedding/embedding-ifra
import { getResourceTypeFromExperience } from "metabase/embedding/embedding-iframe-sdk-setup/utils/get-resource-type-from-experience";
import { useDispatch } from "metabase/redux";
import { setOpenModalWithProps } from "metabase/redux/ui";
-import { Alert, Anchor, Box, Flex, Icon, Stack, Text } from "metabase/ui";
+import { Alert, Anchor, Icon } from "metabase/ui";
export const LegacyStaticEmbeddingAlert = () => {
const { isGuestEmbedsEnabled, settings, resource, experience, onClose } =
@@ -38,48 +38,36 @@ export const LegacyStaticEmbeddingAlert = () => {
}
return (
- <Alert color="info" variant="outline">
- <Flex gap="sm">
- <Box>
- <Icon color="text-secondary" name="info" mt="2px" />
- </Box>
+ <Alert size="compact" variant="light" icon={<Icon name="info" />}>
+ {t`This embed was originally published with static embedding. We recommend using this new, modular embedding code snippet. Your embed won't change; you'll just have better theming options.`}
+ <Anchor
+ key="anchor"
+ fw="bold"
+ data-testid="legacy-static-embedding-button"
+ onClick={() => {
+ onClose();
- <Stack>
- <Text c="text-primary" lh="lg">
- {t`This embed was originally published with static embedding. We recommend using this new, modular embedding code snippet. Your embed won't change; you'll just have better theming options.`}
- </Text>
-
- <Anchor
- key="anchor"
- fw="bold"
- lh="lg"
- data-testid="legacy-static-embedding-button"
- onClick={() => {
- onClose();
-
- dispatch(
- setOpenModalWithProps({
- id: STATIC_LEGACY_EMBEDDING_TYPE,
- props: {
- experience,
- dashboardId: settings.dashboardId,
- questionId: settings.questionId,
- parentInitialState: {
- resourceId: resource.id,
- resourceType,
- isGuest: isGuestEmbed,
- useExistingUserSession,
- },
- },
- }),
- );
- }}
- >
- {c("A link that toggles the static embedding wizard.")
- .t`Use static embedding instead`}
- </Anchor>
- </Stack>
- </Flex>
+ dispatch(
+ setOpenModalWithProps({
+ id: STATIC_LEGACY_EMBEDDING_TYPE,
+ props: {
+ experience,
+ dashboardId: settings.dashboardId,
+ questionId: settings.questionId,
+ parentInitialState: {
+ resourceId: resource.id,
+ resourceType,
+ isGuest: isGuestEmbed,
+ useExistingUserSession,
+ },
+ },
+ }),
+ );
+ }}
+ >
+ {c("A link that toggles the static embedding wizard.")
+ .t`Use static embedding instead`}
+ </Anchor>
</Alert>
);
};
diff --git a/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/components/steps/GetCodeStep/MetabaseAccountCard.tsx b/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/components/steps/GetCodeStep/MetabaseAccountCard.tsx
index a545454fc53..af0085df66f 100644
--- a/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/components/steps/GetCodeStep/MetabaseAccountCard.tsx
+++ b/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/components/steps/GetCodeStep/MetabaseAccountCard.tsx
@@ -64,28 +64,21 @@ export const MetabaseAccountCard = () => {
{!isSsoEnabledAndConfigured && !!settings.useExistingUserSession && (
<Alert
- icon={
- <Icon
- name="warning_triangle_filled"
- c="text-secondary"
- size={16}
- />
- }
+ size="compact"
+ icon={<Icon name="warning_triangle_filled" />}
color="warning"
>
- <Text size="md" lh="lg">
- {jt`The code below will only work for local testing. To get production ready code, configure ${(
- <Anchor
- key="configure-sso"
- href={setupSsoUrl}
- target="_blank"
- size="md"
- lh="lg"
- >
- {t`JWT SSO or SAML`}
- </Anchor>
- )}.`}
- </Text>
+ {jt`The code below will only work for local testing. To get production ready code, configure ${(
+ <Anchor
+ key="configure-sso"
+ href={setupSsoUrl}
+ target="_blank"
+ size="md"
+ lh="lg"
+ >
+ {t`JWT SSO or SAML`}
+ </Anchor>
+ )}.`}
</Alert>
)}
</Stack>
diff --git a/frontend/src/metabase/forms/components/FormSecretKey/SetupKeyModal.tsx b/frontend/src/metabase/forms/components/FormSecretKey/SetupKeyModal.tsx
index ebfc95a1005..c413b4fff0d 100644
--- a/frontend/src/metabase/forms/components/FormSecretKey/SetupKeyModal.tsx
+++ b/frontend/src/metabase/forms/components/FormSecretKey/SetupKeyModal.tsx
@@ -91,17 +91,16 @@ export const SetupKeyModal = (props: SetupKeyDialogProps) => {
</Button>
</Flex>
<Stack gap="sm">
- <Alert color="warning">
- <Text component="span">
- {t`Make sure you copy this key now and save it in a safe place.`}{" "}
- </Text>
- <Text fw="bold" component="strong" display="block">
+ <Alert size="compact" color="warning">
+ {t`Make sure you copy this key now and save it in a safe place.`}
+ <br />
+ <Text fw="bold" component="strong">
{t`You won't be able to see it again.`}
</Text>
</Alert>
{!!currentValue && (
- <Alert color="warning">
- <Text mt="md" component="strong" fw="bold">
+ <Alert size="compact" color="warning" mt="md">
+ <Text component="strong" fw="bold">
{t`This will cause existing tokens to stop working until the identity provider is updated with the new key.`}
</Text>
</Alert>
diff --git a/frontend/src/metabase/metadata/components/FieldSection/BehaviorSection/RemappingPicker/NamingTip/NamingTip.tsx b/frontend/src/metabase/metadata/components/FieldSection/BehaviorSection/RemappingPicker/NamingTip/NamingTip.tsx
index 5965085b521..4fa8271ccf2 100644
--- a/frontend/src/metabase/metadata/components/FieldSection/BehaviorSection/RemappingPicker/NamingTip/NamingTip.tsx
+++ b/frontend/src/metabase/metadata/components/FieldSection/BehaviorSection/RemappingPicker/NamingTip/NamingTip.tsx
@@ -5,7 +5,7 @@ import { Alert, type AlertProps } from "metabase/ui";
type Props = Omit<AlertProps, "title" | "children">;
export const NamingTip = (props: Props) => (
- <Alert title={t`Tip`} {...props}>
+ <Alert size="compact" variant="light" title={t`Tip`} {...props}>
{t`You might want to update the field name to make sure it still makes sense based on your remapping choices.`}
</Alert>
);
diff --git a/frontend/src/metabase/metadata/components/FieldSection/BehaviorSection/RemappingPicker/RemappingPicker.tsx b/frontend/src/metabase/metadata/components/FieldSection/BehaviorSection/RemappingPicker/RemappingPicker.tsx
index 923d083f33e..5064f743100 100644
--- a/frontend/src/metabase/metadata/components/FieldSection/BehaviorSection/RemappingPicker/RemappingPicker.tsx
+++ b/frontend/src/metabase/metadata/components/FieldSection/BehaviorSection/RemappingPicker/RemappingPicker.tsx
@@ -319,7 +319,7 @@ export const RemappingPicker = ({
{value === "custom" && (
<>
{isFieldsAccessRestricted && (
- <Alert mt="md">
+ <Alert size="compact" variant="light" mt="md">
{t`You need unrestricted data access on this table to map custom display values.`}
</Alert>
)}
diff --git a/frontend/src/metabase/models/components/ModelActions/ModelActionDetails/ModelActionDetails.styled.tsx b/frontend/src/metabase/models/components/ModelActions/ModelActionDetails/ModelActionDetails.styled.tsx
index fad775bf424..59ffb6879e1 100644
--- a/frontend/src/metabase/models/components/ModelActions/ModelActionDetails/ModelActionDetails.styled.tsx
+++ b/frontend/src/metabase/models/components/ModelActions/ModelActionDetails/ModelActionDetails.styled.tsx
@@ -1,7 +1,6 @@
// eslint-disable-next-line no-restricted-imports
import styled from "@emotion/styled";
-import { Alert } from "metabase/common/components/Alert";
import { breakpointMaxMedium } from "metabase/styled-components/theme";
export const Root = styled.div`
@@ -27,7 +26,3 @@ export const ActionList = styled.ul`
width: 100%;
}
`;
-
-export const ActionAlert = styled(Alert)`
- width: 70%;
-`;
diff --git a/frontend/src/metabase/models/components/ModelActions/ModelActionDetails/ModelActionDetails.tsx b/frontend/src/metabase/models/components/ModelActions/ModelActionDetails/ModelActionDetails.tsx
index f9fc5cfa8b5..d97279e1037 100644
--- a/frontend/src/metabase/models/components/ModelActions/ModelActionDetails/ModelActionDetails.tsx
+++ b/frontend/src/metabase/models/components/ModelActions/ModelActionDetails/ModelActionDetails.tsx
@@ -12,7 +12,7 @@ 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 { ActionIcon, Button, Icon, Menu } from "metabase/ui";
+import { ActionIcon, Alert, Button, Icon, Menu } from "metabase/ui";
import * as Urls from "metabase/urls";
import { parseTimestamp } from "metabase/utils/time-dayjs";
import type Question from "metabase-lib/v1/Question";
@@ -30,12 +30,7 @@ import {
EmptyStateTitle,
} from "../EmptyState.styled";
-import {
- ActionAlert,
- ActionList,
- ActionsHeader,
- Root,
-} from "./ModelActionDetails.styled";
+import { ActionList, ActionsHeader, Root } from "./ModelActionDetails.styled";
import ModelActionListItem from "./ModelActionListItem";
import { useEnableImplicitActionsForModel } from "./useEnableImplicitActionsForModel";
@@ -153,9 +148,14 @@ function ModelActionDetails({ model }: Props) {
</ActionsHeader>
)}
{database && !hasActionsEnabled && (
- <ActionAlert icon="warning" variant="error">
+ <Alert
+ size="compact"
+ w="70%"
+ icon={<Icon name="warning" />}
+ color="error"
+ >
{t`Running Actions is not enabled for database ${database.displayName()}`}
- </ActionAlert>
+ </Alert>
)}
{actions.length > 0 ? (
<ActionList aria-label={t`Action list`}>
diff --git a/frontend/src/metabase/nav/containers/MainNavbar/MainNavbarContainer/AddDataModal/Panels/AddDataModalEmptyStates.tsx b/frontend/src/metabase/nav/containers/MainNavbar/MainNavbarContainer/AddDataModal/Panels/AddDataModalEmptyStates.tsx
index 432bb6fdee2..cf9b8a507e1 100644
--- a/frontend/src/metabase/nav/containers/MainNavbar/MainNavbarContainer/AddDataModal/Panels/AddDataModalEmptyStates.tsx
+++ b/frontend/src/metabase/nav/containers/MainNavbar/MainNavbarContainer/AddDataModal/Panels/AddDataModalEmptyStates.tsx
@@ -90,10 +90,13 @@ export const ContactAdminAlert = ({ reason }: { reason: ContactReason }) => {
.exhaustive();
return (
- <Alert icon={<Icon name="info" />} maw={CONTENT_MAX_WIDTH}>
- <Text fz="md" lh="lg">
- {getAlertCopy}
- </Text>
+ <Alert
+ size="compact"
+ variant="light"
+ icon={<Icon name="info" />}
+ maw={CONTENT_MAX_WIDTH}
+ >
+ {getAlertCopy}
</Alert>
);
};
diff --git a/frontend/src/metabase/transforms/components/IncrementalTransform/KeysetColumnSelect/NativeQueryTableTagFieldSelect.tsx b/frontend/src/metabase/transforms/components/IncrementalTransform/KeysetColumnSelect/NativeQueryTableTagFieldSelect.tsx
index 46260aeda46..ec51c74de3f 100644
--- a/frontend/src/metabase/transforms/components/IncrementalTransform/KeysetColumnSelect/NativeQueryTableTagFieldSelect.tsx
+++ b/frontend/src/metabase/transforms/components/IncrementalTransform/KeysetColumnSelect/NativeQueryTableTagFieldSelect.tsx
@@ -54,7 +54,7 @@ export function NativeQueryTableTagFieldSelect({
if (noQueryMessage) {
return (
- <Alert icon={<Icon name="warning" />} color="warning">
+ <Alert size="compact" icon={<Icon name="warning" />} color="warning">
{noQueryMessage}
</Alert>
);
diff --git a/frontend/src/metabase/transforms/components/TransformDisconnectedDatabaseBanner.tsx b/frontend/src/metabase/transforms/components/TransformDisconnectedDatabaseBanner.tsx
index 20d5853e302..b6cc8768bac 100644
--- a/frontend/src/metabase/transforms/components/TransformDisconnectedDatabaseBanner.tsx
+++ b/frontend/src/metabase/transforms/components/TransformDisconnectedDatabaseBanner.tsx
@@ -1,6 +1,6 @@
import { t } from "ttag";
-import { Alert, Icon, Text } from "metabase/ui";
+import { Alert, Icon } from "metabase/ui";
import type { Transform } from "metabase-types/api";
import { isMissingSourceDatabase } from "../utils";
@@ -16,11 +16,12 @@ export const TransformDisconnectedDatabaseBanner = ({
return (
<Alert
+ size="compact"
color="error"
icon={<Icon name="warning" />}
data-testid="disconnected-database-banner"
>
- <Text>{t`The database this transform depends on has been disconnected. The transform can't be edited or run.`}</Text>
+ {t`The database this transform depends on has been disconnected. The transform can't be edited or run.`}
</Alert>
);
};
diff --git a/frontend/src/metabase/transforms/pages/EnableTransformsPage/EnableTransformsCard.tsx b/frontend/src/metabase/transforms/pages/EnableTransformsPage/EnableTransformsCard.tsx
index ceb26c4e256..ae1b0e5ee69 100644
--- a/frontend/src/metabase/transforms/pages/EnableTransformsPage/EnableTransformsCard.tsx
+++ b/frontend/src/metabase/transforms/pages/EnableTransformsPage/EnableTransformsCard.tsx
@@ -73,9 +73,10 @@ export function EnableTransformsCard({
)}
{!hasDbThatSupportsTransforms && (
<Alert
+ size="compact"
color="warning"
variant="light"
- icon={<Icon name="warning" size={16} />}
+ icon={<Icon name="warning" />}
title={t`No compatible database connection`}
>
{jt`None of your connected databases can be used with transforms. ${(
diff --git a/frontend/src/metabase/ui/components/feedback/Alert/Alert.config.tsx b/frontend/src/metabase/ui/components/feedback/Alert/Alert.config.tsx
index c53ba881a6e..3e847b1acbb 100644
--- a/frontend/src/metabase/ui/components/feedback/Alert/Alert.config.tsx
+++ b/frontend/src/metabase/ui/components/feedback/Alert/Alert.config.tsx
@@ -1,54 +1,102 @@
import { Alert, type MantineThemeOverride } from "@mantine/core";
import type { ColorName } from "metabase/ui/colors/types";
-import { color, isColorName } from "metabase/ui/utils/colors";
+import { color } from "metabase/ui/utils/colors";
import AlertStyles from "./Alert.module.css";
-const ALERT_BACKGROUND_COLORS: Record<string, ColorName> = {
- "core-brand": "background_surface-brand-subtle",
- warning: "background_surface-warning",
- error: "background_surface-error",
- info: "background_page-tertiary",
- success: "background_surface-success",
+export type AlertColor =
+ | "core-brand"
+ | "warning"
+ | "error"
+ | "success"
+ | "default";
+export type AlertVariant = "default" | "light";
+
+type AlertColorConfig = {
+ icon: ColorName;
+ background: ColorName;
+ border: ColorName;
+ title: ColorName;
+};
+
+const COLOR_SETS: Record<AlertColor, AlertColorConfig> = {
+ default: {
+ icon: "icon-brand",
+ background: "background_surface-primary",
+ border: "border",
+ title: "text-primary",
+ },
+ "core-brand": {
+ icon: "text-brand-strong",
+ background: "background_surface-brand-subtle",
+ border: "core-brand",
+ title: "text-brand-strong",
+ },
+ warning: {
+ icon: "feedback-warning-strong",
+ background: "background_surface-warning",
+ border: "feedback-warning-strong",
+ title: "feedback-warning-strong",
+ },
+ error: {
+ icon: "feedback-negative-strong",
+ background: "background_surface-error-subtle",
+ border: "feedback-negative-strong",
+ title: "feedback-negative-strong",
+ },
+ success: {
+ icon: "feedback-positive-strong",
+ background: "background_surface-success",
+ border: "feedback-positive-strong",
+ title: "feedback-positive-strong",
+ },
};
-const ALERT_TEXT_COLORS: Record<string, ColorName> = {
- "core-brand": "core-brand",
- warning: "feedback-warning",
- error: "feedback-negative",
- info: "core-info",
- success: "feedback-positive",
+const ALERT_COLORS_BY_VARIANT: Record<AlertVariant, typeof COLOR_SETS> = {
+ default: COLOR_SETS,
+ light: {
+ ...COLOR_SETS,
+ default: {
+ ...COLOR_SETS.default,
+ background: "background_surface-secondary",
+ },
+ },
};
+const isAlertColor = (value?: string): value is AlertColor =>
+ value !== undefined && value in COLOR_SETS;
+
+const isAlertVariant = (value?: string): value is AlertVariant =>
+ value !== undefined && value in ALERT_COLORS_BY_VARIANT;
+
export const alertOverrides: MantineThemeOverride["components"] = {
Alert: Alert.extend({
defaultProps: {
- variant: "outline",
+ variant: "default",
},
classNames: {
+ root: AlertStyles.root,
wrapper: AlertStyles.wrapper,
+ icon: AlertStyles.icon,
+ body: AlertStyles.body,
title: AlertStyles.title,
+ message: AlertStyles.message,
+ closeButton: AlertStyles.closeButton,
},
vars: (_theme, props) => {
- const textColor = props.color
- ? ALERT_TEXT_COLORS[props.color]
- : undefined;
- const bgColor = props.color
- ? ALERT_BACKGROUND_COLORS[props.color]
- : undefined;
- if (isColorName(textColor) && isColorName(bgColor)) {
- return {
- root: {
- "--alert-color": color(textColor),
- "--alert-bg": color(bgColor),
- },
- };
- } else {
- return {
- root: {},
- };
- }
+ const variant = isAlertVariant(props.variant) ? props.variant : "default";
+ const variantColors = ALERT_COLORS_BY_VARIANT[variant];
+ const colorName = isAlertColor(props.color) ? props.color : "default";
+ const colors = variantColors[colorName];
+ return {
+ root: {
+ "--alert-color": color(colors.icon),
+ "--alert-bg": color(colors.background),
+ "--alert-border-color": color(colors.border),
+ "--alert-title-color": color(colors.title),
+ },
+ };
},
}),
};
diff --git a/frontend/src/metabase/ui/components/feedback/Alert/Alert.mdx b/frontend/src/metabase/ui/components/feedback/Alert/Alert.mdx
index e55e9ce38e9..7d9ad973436 100644
--- a/frontend/src/metabase/ui/components/feedback/Alert/Alert.mdx
+++ b/frontend/src/metabase/ui/components/feedback/Alert/Alert.mdx
@@ -13,4 +13,6 @@ Show helpful alerts when things go sideways (or maybe it's a happy alert. It hap
<Canvas of={AlertStories.Default} />
-<Canvas of={AlertStories.Warning} />
+<Canvas of={AlertStories.OverviewStory} />
+
+<Canvas of={AlertStories.Feedback} />
diff --git a/frontend/src/metabase/ui/components/feedback/Alert/Alert.module.css b/frontend/src/metabase/ui/components/feedback/Alert/Alert.module.css
index 5848e2b15a1..7c570d925b9 100644
--- a/frontend/src/metabase/ui/components/feedback/Alert/Alert.module.css
+++ b/frontend/src/metabase/ui/components/feedback/Alert/Alert.module.css
@@ -1,8 +1,85 @@
+.root {
+ --alert-control-size: 24px;
+
+ padding: var(--mantine-spacing-lg) var(--mantine-spacing-md)
+ var(--mantine-spacing-lg) var(--mantine-spacing-lg);
+ border-radius: 12px;
+ overflow: hidden;
+}
+
.wrapper {
+ display: grid;
+ grid-template-columns: auto minmax(0, 1fr) var(--alert-control-size);
+ grid-template-areas: "icon body close";
+ align-items: start;
+}
+
+.icon {
+ grid-area: icon;
+ width: auto;
+ height: var(--alert-control-size);
+ margin: 0;
+ margin-inline-end: 12px;
align-items: center;
+ color: var(--alert-color);
+}
+
+.body {
+ grid-area: body;
+ gap: var(--mantine-spacing-sm);
+ margin-inline-end: var(--mantine-spacing-md);
}
.title {
+ padding: 1px 0; /* with lh 22px keeps the 24px title height */
+ font-size: 1rem;
+ line-height: 22px;
+ font-weight: 600;
+ color: var(--alert-title-color);
+}
+
+.message {
+ font-size: var(--mantine-font-size-md);
+ line-height: 20px;
+ color: var(--mb-color-text-secondary);
+}
+
+.closeButton {
+ --cb-icon-size: 12px !important; /* Alert hardcodes inline iconSize=16; only !important overrides it */
+
+ grid-area: close;
+ width: var(--alert-control-size);
+ height: var(--alert-control-size);
+ border-radius: var(--mantine-radius-xs);
color: var(--mb-color-text-primary);
- line-height: 1rem;
+}
+
+.root[data-size="compact"] {
+ padding: var(--mantine-spacing-md) 12px var(--mantine-spacing-md)
+ var(--mantine-spacing-md);
+
+ & .body {
+ gap: var(--mantine-spacing-xs);
+ }
+
+ & .title {
+ padding: 3px 0; /* with lh 18px keeps the 24px title height */
+ font-size: var(--mantine-font-size-md);
+ line-height: 18px;
+ }
+
+ & .message {
+ font-size: var(--mantine-font-size-sm);
+ line-height: 16px;
+ }
+}
+
+.root[data-variant="default"][data-color="default"] {
+ box-shadow: var(--mantine-shadow-xs);
+}
+
+.root[data-variant="default"],
+.root[data-variant="light"]:not([data-color="default"]),
+[data-mantine-color-scheme="dark"] .root {
+ border: 0.5px solid var(--alert-border-color);
}
diff --git a/frontend/src/metabase/ui/components/feedback/Alert/Alert.stories.tsx b/frontend/src/metabase/ui/components/feedback/Alert/Alert.stories.tsx
index f4098c9f346..70c95a98aed 100644
--- a/frontend/src/metabase/ui/components/feedback/Alert/Alert.stories.tsx
+++ b/frontend/src/metabase/ui/components/feedback/Alert/Alert.stories.tsx
@@ -1,124 +1,315 @@
-import { Alert, type AlertProps, Icon, Stack, Text } from "metabase/ui";
+import type { StoryFn } from "@storybook/react";
+import type { ReactNode } from "react";
-const args = {
- icon: <Icon name="warning" />,
- title: "Bummer!",
- withCloseButton: false,
-};
+import { Alert, type AlertProps, Box, Icon, Stack, Text } from "metabase/ui";
+import { deriveFullMetabaseTheme } from "metabase/ui/colors";
+import { StoryJsx, StoryShowcase } from "metabase/ui/stories/showcase";
+
+const MESSAGE =
+ "Let your team and customers chat with your data, query in natural language, and explore with AI-backed tools. Connect to your database in minutes for analytics without bottlenecks.";
const argTypes = {
+ variant: {
+ options: ["default", "light"],
+ control: { type: "inline-radio" },
+ },
+ size: {
+ options: ["default", "compact"],
+ control: { type: "inline-radio" },
+ },
color: {
- control: { type: "text" },
+ options: ["default", "core-brand", "warning", "error", "success"],
+ control: { type: "select" },
+ },
+ withTitle: {
+ control: { type: "boolean" },
+ table: { category: "title" },
},
title: {
control: { type: "text" },
+ table: { category: "title" },
+ },
+ children: {
+ control: { type: "text" },
},
withCloseButton: {
- control: { type: "toggle" },
+ control: { type: "boolean" },
+ },
+ withIcon: {
+ control: { type: "boolean" },
},
};
-const DefaultTemplate = (args: AlertProps) => {
- return (
- <Alert {...args}>
- <Text>The No self-service access level for View data is going away.</Text>
- <Text>
- In a future release, if a group’s View data access for a database (or
- any of its schemas or tables) is still set to No self-service
- (deprecated), Metabase will automatically change that group’s View data
- access for the entire database to Blocked. We’ll be defaulting to
- Blocked, the least permissive View data access, to prevent any
- unattended access to data. Need help? See our docs.
- </Text>
- </Alert>
- );
-};
-
-const WarningColorTemplate = (args: AlertProps) => {
- return (
- <Alert {...args} color="warning">
- <Text>
- In a future release, if a group’s View data access for a database (or
- any of its schemas or tables) is still set to No self-service
- (deprecated), Metabase will automatically change that group’s View data
- access for the entire database to Blocked.
- </Text>
- </Alert>
- );
-};
-
-const multiColor = (args: AlertProps) => {
- return (
- <Stack>
- <Alert {...args} color="info">
- <Text>
- In a future release, if a group’s View data access for a database (or
- any of its schemas or tables) is still set to No self-service
- (deprecated), Metabase will automatically change that group’s View
- data access for the entire database to Blocked.
- </Text>
- </Alert>
- <Alert {...args} color="warning">
- <Text>
- In a future release, if a group’s View data access for a database (or
- any of its schemas or tables) is still set to No self-service
- (deprecated), Metabase will automatically change that group’s View
- data access for the entire database to Blocked.
- </Text>
- </Alert>
- <Alert {...args} color="error">
- <Text>
- In a future release, if a group’s View data access for a database (or
- any of its schemas or tables) is still set to No self-service
- (deprecated), Metabase will automatically change that group’s View
- data access for the entire database to Blocked.
- </Text>
- </Alert>
- <Alert {...args} color="core-brand">
- <Text>
- In a future release, if a group’s View data access for a database (or
- any of its schemas or tables) is still set to No self-service
- (deprecated), Metabase will automatically change that group’s View
- data access for the entire database to Blocked.
- </Text>
- </Alert>
- <Alert {...args} color="success">
- <Text>
- In a future release, if a group’s View data access for a database (or
- any of its schemas or tables) is still set to No self-service
- (deprecated), Metabase will automatically change that group’s View
- data access for the entire database to Blocked.
- </Text>
- </Alert>
- </Stack>
- );
-};
+type StoryArgs = AlertProps & { withTitle?: boolean; withIcon?: boolean };
export default {
title: "Components/Feedback/Alert",
component: Alert,
- args,
+ args: {
+ variant: "default",
+ size: "default",
+ color: "default",
+ title: "Open source analytics that answers back",
+ children: MESSAGE,
+ withCloseButton: false,
+ withTitle: true,
+ withIcon: true,
+ },
argTypes,
};
+const DefaultTemplate: StoryFn<StoryArgs> = ({
+ withTitle,
+ withIcon,
+ title,
+ ...args
+}) => (
+ <Box w="480px">
+ <Alert
+ icon={withIcon ? <Icon name="model" /> : undefined}
+ title={withTitle ? title : undefined}
+ {...args}
+ />
+ </Box>
+);
+
export const Default = {
render: DefaultTemplate,
};
-export const Warning = {
- render: WarningColorTemplate,
-};
+const OVERVIEW_CELLS = [
+ {
+ variant: "light",
+ size: "default",
+ withCloseButton: false,
+ jsx: '<Alert variant="light" />',
+ },
+ {
+ variant: "light",
+ size: "default",
+ withCloseButton: true,
+ jsx: '<Alert variant="light" withCloseButton />',
+ },
+ {
+ variant: "default",
+ size: "default",
+ withCloseButton: false,
+ jsx: '<Alert variant="default" />',
+ },
+ {
+ variant: "default",
+ size: "default",
+ withCloseButton: true,
+ jsx: '<Alert variant="default" withCloseButton />',
+ },
+ {
+ variant: "light",
+ size: "compact",
+ withCloseButton: false,
+ jsx: '<Alert size="compact" variant="light" />',
+ },
+ {
+ variant: "light",
+ size: "compact",
+ withCloseButton: true,
+ jsx: '<Alert size="compact" variant="light" withCloseButton />',
+ },
+ {
+ variant: "default",
+ size: "compact",
+ withCloseButton: false,
+ jsx: '<Alert size="compact" variant="default" />',
+ },
+ {
+ variant: "default",
+ size: "compact",
+ withCloseButton: true,
+ jsx: '<Alert size="compact" variant="default" withCloseButton />',
+ },
+] as const;
-export const Light = {
- render: multiColor,
- args: {
- theme: "light",
+const Overview: StoryFn<StoryArgs> = ({
+ withTitle,
+ withIcon,
+ title,
+ children,
+}) => (
+ <StoryShowcase title="Alert">
+ <Box
+ style={{
+ display: "grid",
+ gridTemplateColumns: "repeat(2, 480px)",
+ gap: "48px",
+ alignItems: "start",
+ }}
+ >
+ {OVERVIEW_CELLS.map(({ variant, size, withCloseButton, jsx }) => (
+ <Stack key={jsx} gap="sm">
+ <StoryJsx>{jsx}</StoryJsx>
+ <Alert
+ variant={variant}
+ size={size}
+ withCloseButton={withCloseButton}
+ icon={withIcon ? <Icon name="model" /> : undefined}
+ title={withTitle ? title : undefined}
+ >
+ {children}
+ </Alert>
+ </Stack>
+ ))}
+ </Box>
+ </StoryShowcase>
+);
+
+export const OverviewStory = {
+ render: Overview,
+ parameters: {
+ controls: {
+ include: ["theme", "withTitle", "withIcon", "title", "children"],
+ },
},
};
-export const Dark = {
- render: multiColor,
+const FEEDBACK_COLORS = [
+ { color: undefined, variant: "light", title: "Default alert" },
+ { color: "error", variant: "default", title: "Error alert" },
+ { color: "warning", variant: "default", title: "Warning alert" },
+ { color: "success", variant: "default", title: "Positive alert" },
+ { color: "core-brand", variant: "default", title: "Brand alert" },
+] as const;
+
+const FEEDBACK_SIZES = ["default", "compact"] as const;
+
+const buildAlertJsx = ({
+ variant,
+ size,
+ color,
+}: {
+ variant: AlertProps["variant"];
+ size: AlertProps["size"];
+ color?: AlertProps["color"];
+}) =>
+ `<Alert ${[
+ `variant="${variant}"`,
+ `size="${size}"`,
+ color !== undefined && `color="${color}"`,
+ "withCloseButton",
+ ]
+ .filter(Boolean)
+ .join(" ")} />`;
+
+const THEMES = ["light", "dark"] as const;
+
+const getThemeVars = (
+ colorScheme: (typeof THEMES)[number],
+): Record<`--${string}`, string> => {
+ const { colors } = deriveFullMetabaseTheme({ colorScheme });
+ return Object.fromEntries(
+ Object.entries(colors).map(([name, value]) => [
+ `--mb-color-${name}`,
+ value,
+ ]),
+ );
+};
+
+const FeedbackColumn = ({
+ colorScheme,
+ withTitle,
+ withIcon,
+ titleOverride,
+ message,
+}: {
+ colorScheme: (typeof THEMES)[number];
+ withTitle?: boolean;
+ withIcon?: boolean;
+ titleOverride?: ReactNode;
+ message?: ReactNode;
+}) => (
+ <Stack
+ gap="48px"
+ data-mantine-color-scheme={colorScheme}
+ style={{
+ ...getThemeVars(colorScheme),
+ padding: "48px 96px 96px",
+ backgroundColor: "var(--mb-color-background-primary)",
+ }}
+ >
+ {FEEDBACK_COLORS.flatMap(({ color, variant, title }) =>
+ FEEDBACK_SIZES.map((size) => (
+ <Stack key={`${color ?? "default"}-${size}`} gap="sm" w="480px">
+ <StoryJsx>{buildAlertJsx({ variant, size, color })}</StoryJsx>
+ <Alert
+ variant={variant}
+ size={size}
+ color={color}
+ withCloseButton
+ icon={withIcon ? <Icon name="model" /> : undefined}
+ title={withTitle ? titleOverride || title : undefined}
+ >
+ {message ?? MESSAGE}
+ </Alert>
+ </Stack>
+ )),
+ )}
+ </Stack>
+);
+
+const FeedbackTemplate: StoryFn<StoryArgs> = ({
+ withTitle,
+ withIcon,
+ title,
+ children,
+}) => (
+ <Box
+ style={{
+ display: "grid",
+ gridTemplateColumns: "1fr 1fr",
+ gridTemplateRows: "auto 1fr",
+ minHeight: "100vh",
+ }}
+ >
+ <Box
+ style={{
+ ...getThemeVars("light"),
+ padding: "96px 96px 0",
+ backgroundColor: "var(--mb-color-background-primary)",
+ }}
+ >
+ <Text fz="1.5rem" fw="bold" c="text-primary">
+ Feedback
+ </Text>
+ </Box>
+ <Box
+ style={{
+ ...getThemeVars("dark"),
+ backgroundColor: "var(--mb-color-background-primary)",
+ }}
+ />
+ {THEMES.map((colorScheme) => (
+ <FeedbackColumn
+ key={colorScheme}
+ colorScheme={colorScheme}
+ withTitle={withTitle}
+ withIcon={withIcon}
+ titleOverride={title}
+ message={children}
+ />
+ ))}
+ </Box>
+);
+
+export const Feedback = {
+ render: FeedbackTemplate,
args: {
- theme: "dark",
+ title: "",
+ },
+ parameters: {
+ controls: {
+ include: ["withTitle", "withIcon", "title", "children"],
+ },
+ backgrounds: { disable: true },
+ viewport: { disable: true },
+ measure: { disable: true },
+ outline: { disable: true },
},
};
diff --git a/frontend/src/metabase/ui/components/feedback/Alert/index.tsx b/frontend/src/metabase/ui/components/feedback/Alert/index.tsx
index bdcb6e64c78..461e0114f5e 100644
--- a/frontend/src/metabase/ui/components/feedback/Alert/index.tsx
+++ b/frontend/src/metabase/ui/components/feedback/Alert/index.tsx
@@ -2,10 +2,20 @@ import {
Alert as MantineAlert,
type AlertProps as MantineAlertProps,
} from "@mantine/core";
+
+import type { AlertColor } from "./Alert.config";
+
export { alertOverrides } from "./Alert.config";
export type AlertProps = MantineAlertProps & {
- color?: "core-brand" | "warning" | "error" | "info" | "success";
+ color?: AlertColor;
+ size?: "default" | "compact";
};
-export const Alert = (props: AlertProps) => <MantineAlert {...props} />;
+export const Alert = ({ size = "default", ...props }: AlertProps) => (
+ <MantineAlert
+ data-size={size}
+ data-color={props.color ?? "default"}
+ {...props}
+ />
+);