Skip to content

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

GDGT-3290: Migrate hand-rolled modal footers and headers to the Modal API (#83758)

Will Fry6597ce2a90af
diff --git a/enterprise/frontend/src/metabase-enterprise/collections/components/FormCollectionAuthorityLevel.tsx b/enterprise/frontend/src/metabase-enterprise/collections/components/FormCollectionAuthorityLevel.tsx
index 16176b042c7..da53ead5300 100644
--- a/enterprise/frontend/src/metabase-enterprise/collections/components/FormCollectionAuthorityLevel.tsx
+++ b/enterprise/frontend/src/metabase-enterprise/collections/components/FormCollectionAuthorityLevel.tsx
@@ -2,8 +2,8 @@ import { useField } from "formik";
import type { HTMLAttributes } from "react";
import { t } from "ttag";
-import { FormField } from "metabase/common/components/FormField";
import { useUniqueId } from "metabase/common/hooks/use-unique-id";
+import { FormField } from "metabase/forms";
import { SegmentedControl } from "metabase/ui";
import { OFFICIAL_COLLECTION, REGULAR_COLLECTION } from "../constants";
@@ -49,6 +49,7 @@ export function FormCollectionAuthorityLevel({
error={touched ? error : undefined}
>
<SegmentedControl
+ w="fit-content"
value={String(value)}
onChange={handleChange}
data={getOptions().map((option) => ({
diff --git a/enterprise/frontend/src/metabase-enterprise/data-studio/library/components/CreateLibraryModal/CreateLibraryModal.tsx b/enterprise/frontend/src/metabase-enterprise/data-studio/library/components/CreateLibraryModal/CreateLibraryModal.tsx
index 87d97e710a5..709f0b0ce65 100644
--- a/enterprise/frontend/src/metabase-enterprise/data-studio/library/components/CreateLibraryModal/CreateLibraryModal.tsx
+++ b/enterprise/frontend/src/metabase-enterprise/data-studio/library/components/CreateLibraryModal/CreateLibraryModal.tsx
@@ -10,7 +10,6 @@ import {
} from "metabase/forms";
import type { CreateLibraryModalProps } from "metabase/plugins";
import {
- Box,
Button,
Center,
FixedSizeIcon,
@@ -114,10 +113,8 @@ function ModalBody({ explanatorySentence, onCreate, onClose }: ModalBodyProps) {
/>
</List>
</Stack>
- <Group mt="xxl" gap="sm">
- <Box flex={1}>
- <FormErrorMessage />
- </Box>
+ <Modal.Footer>
+ <FormErrorMessage flex={1} />
<Button
variant="subtle"
color="neutral"
@@ -127,7 +124,7 @@ function ModalBody({ explanatorySentence, onCreate, onClose }: ModalBodyProps) {
label={t`Create my semantic layer`}
variant="filled"
/>
- </Group>
+ </Modal.Footer>
</Form>
</FormProvider>
);
diff --git a/enterprise/frontend/src/metabase-enterprise/data-studio/library/components/PublishTablesModal/PublishTablesModal.tsx b/enterprise/frontend/src/metabase-enterprise/data-studio/library/components/PublishTablesModal/PublishTablesModal.tsx
index 3522a29cfb9..beaa746df38 100644
--- a/enterprise/frontend/src/metabase-enterprise/data-studio/library/components/PublishTablesModal/PublishTablesModal.tsx
+++ b/enterprise/frontend/src/metabase-enterprise/data-studio/library/components/PublishTablesModal/PublishTablesModal.tsx
@@ -13,16 +13,7 @@ import {
} from "metabase/forms";
import { PLUGIN_LIBRARY, type PublishTablesModalProps } from "metabase/plugins";
import { useNavigate } from "metabase/router";
-import {
- Box,
- Button,
- FocusTrap,
- Group,
- List,
- Modal,
- Stack,
- Text,
-} from "metabase/ui";
+import { Button, FocusTrap, List, Modal, Stack, Text } from "metabase/ui";
import * as Urls from "metabase/urls";
import { usePublishTablesMutation } from "metabase-enterprise/api";
import type {
@@ -186,10 +177,8 @@ function ModalBody({
}}
/>
</Stack>
- <Group mt="xxl" gap="sm" wrap="nowrap">
- <Box flex={1}>
- <FormErrorMessage />
- </Box>
+ <Modal.Footer>
+ <FormErrorMessage flex={1} />
<Button
variant="subtle"
color="neutral"
@@ -202,7 +191,7 @@ function ModalBody({
)}
variant="filled"
/>
- </Group>
+ </Modal.Footer>
</Form>
</FormProvider>
);
diff --git a/enterprise/frontend/src/metabase-enterprise/data-studio/library/components/UnpublishTablesModal/UnpublishTablesModal.tsx b/enterprise/frontend/src/metabase-enterprise/data-studio/library/components/UnpublishTablesModal/UnpublishTablesModal.tsx
index a01cff258d5..0650da07093 100644
--- a/enterprise/frontend/src/metabase-enterprise/data-studio/library/components/UnpublishTablesModal/UnpublishTablesModal.tsx
+++ b/enterprise/frontend/src/metabase-enterprise/data-studio/library/components/UnpublishTablesModal/UnpublishTablesModal.tsx
@@ -6,15 +6,7 @@ import { DelayedLoadingAndErrorWrapper } from "metabase/common/components/Loadin
import { trackDataStudioTableUnpublished } from "metabase/common/data-studio/analytics";
import { useMetadataToasts } from "metabase/common/hooks";
import type { UnpublishTablesModalProps } from "metabase/plugins";
-import {
- Button,
- FocusTrap,
- Group,
- List,
- Modal,
- Stack,
- Text,
-} from "metabase/ui";
+import { Button, FocusTrap, List, Modal, Stack, Text } from "metabase/ui";
import { useUnpublishTablesMutation } from "metabase-enterprise/api";
import type {
BulkTableInfo,
@@ -121,7 +113,7 @@ function ModalBody({
return (
<>
- <Stack gap="sm" mt="sm">
+ <Stack gap="sm">
<Text>
{getInfoMessage(selected_table, published_downstream_tables)}
</Text>
@@ -138,7 +130,7 @@ function ModalBody({
</>
)}
</Stack>
- <Group mt="xxl" gap="sm" wrap="nowrap" justify="flex-end">
+ <Modal.Footer>
<Button
variant="subtle"
color="neutral"
@@ -147,7 +139,7 @@ function ModalBody({
<Button onClick={handleSubmit} variant="filled" color="negative">
{getSubmitButtonLabel(selected_table, published_downstream_tables)}
</Button>
- </Group>
+ </Modal.Footer>
</>
);
}
diff --git a/enterprise/frontend/src/metabase-enterprise/database_routing/RemoveDestinationDatabaseModal.tsx b/enterprise/frontend/src/metabase-enterprise/database_routing/RemoveDestinationDatabaseModal.tsx
index 11f6a0854c1..11beb2e7c13 100644
--- a/enterprise/frontend/src/metabase-enterprise/database_routing/RemoveDestinationDatabaseModal.tsx
+++ b/enterprise/frontend/src/metabase-enterprise/database_routing/RemoveDestinationDatabaseModal.tsx
@@ -30,7 +30,7 @@ export const RemoveDestinationDatabaseModal = () => {
if (isLoading || error || !db) {
return (
- <Modal opened onClose={handleCloseModal} padding="xxl">
+ <Modal opened onClose={handleCloseModal}>
<LoadingAndErrorWrapper loading={isLoading} error={error} />
</Modal>
);
diff --git a/enterprise/frontend/src/metabase-enterprise/multi_factor_auth/components/AccountSecurityPanel/ConfirmCodeForm/ConfirmCodeForm.tsx b/enterprise/frontend/src/metabase-enterprise/multi_factor_auth/components/AccountSecurityPanel/ConfirmCodeForm/ConfirmCodeForm.tsx
index e02b38ad4ae..451dfe9b8de 100644
--- a/enterprise/frontend/src/metabase-enterprise/multi_factor_auth/components/AccountSecurityPanel/ConfirmCodeForm/ConfirmCodeForm.tsx
+++ b/enterprise/frontend/src/metabase-enterprise/multi_factor_auth/components/AccountSecurityPanel/ConfirmCodeForm/ConfirmCodeForm.tsx
@@ -8,7 +8,7 @@ import {
FormSubmitButton,
FormTextInput,
} from "metabase/forms";
-import { Button, type ButtonProps, Group, Stack, Text } from "metabase/ui";
+import { Button, type ButtonProps, Modal, Stack, Text } from "metabase/ui";
import * as Errors from "metabase/utils/errors";
const CONFIRM_CODE_SCHEMA = Yup.object({
@@ -59,16 +59,16 @@ export function ConfirmCodeForm({
spellCheck={false}
data-autofocus
/>
- <FormErrorMessage />
- <Group justify="flex-end">
- <Button onClick={onCancel}>{t`Cancel`}</Button>
- <FormSubmitButton
- label={submitLabel}
- variant="filled"
- color={submitColor}
- />
- </Group>
</Stack>
+ <Modal.Footer>
+ <FormErrorMessage flex={1} />
+ <Button onClick={onCancel}>{t`Cancel`}</Button>
+ <FormSubmitButton
+ label={submitLabel}
+ variant="filled"
+ color={submitColor}
+ />
+ </Modal.Footer>
</Form>
</FormProvider>
);
diff --git a/enterprise/frontend/src/metabase-enterprise/multi_factor_auth/components/AccountSecurityPanel/SetupModal/SetupModal.tsx b/enterprise/frontend/src/metabase-enterprise/multi_factor_auth/components/AccountSecurityPanel/SetupModal/SetupModal.tsx
index bc4fcea7758..db14a38fc3b 100644
--- a/enterprise/frontend/src/metabase-enterprise/multi_factor_auth/components/AccountSecurityPanel/SetupModal/SetupModal.tsx
+++ b/enterprise/frontend/src/metabase-enterprise/multi_factor_auth/components/AccountSecurityPanel/SetupModal/SetupModal.tsx
@@ -9,7 +9,7 @@ import {
FormSubmitButton,
FormTextInput,
} from "metabase/forms";
-import { Box, Button, Group, Modal, Stack, Text } from "metabase/ui";
+import { Box, Button, Modal, Stack, Text } from "metabase/ui";
import * as Errors from "metabase/utils/errors";
import {
useConfirmMfaEnrollmentMutation,
@@ -120,12 +120,12 @@ function ConfirmPasswordForm({ onEnroll, onCancel }: ConfirmPasswordFormProps) {
label={t`Confirm your password to begin`}
data-autofocus
/>
- <FormErrorMessage />
- <Group justify="flex-end">
- <Button onClick={onCancel}>{t`Cancel`}</Button>
- <FormSubmitButton label={t`Continue`} variant="filled" />
- </Group>
</Stack>
+ <Modal.Footer>
+ <FormErrorMessage flex={1} />
+ <Button onClick={onCancel}>{t`Cancel`}</Button>
+ <FormSubmitButton label={t`Continue`} variant="filled" />
+ </Modal.Footer>
</Form>
</FormProvider>
);
@@ -179,15 +179,12 @@ function EnrollForm({ enrollment, onSuccess, onCancel }: EnrollFormProps) {
inputMode="numeric"
autoFocus
/>
- <FormErrorMessage />
- <Group justify="flex-end">
- <Button onClick={onCancel}>{t`Cancel`}</Button>
- <FormSubmitButton
- label={t`Set up authentication`}
- variant="filled"
- />
- </Group>
</Stack>
+ <Modal.Footer>
+ <FormErrorMessage flex={1} />
+ <Button onClick={onCancel}>{t`Cancel`}</Button>
+ <FormSubmitButton label={t`Set up authentication`} variant="filled" />
+ </Modal.Footer>
</Form>
</FormProvider>
);
diff --git a/enterprise/frontend/src/metabase-enterprise/remote_sync/components/GitSettingsModal/GitSettingsModal.tsx b/enterprise/frontend/src/metabase-enterprise/remote_sync/components/GitSettingsModal/GitSettingsModal.tsx
index b57936080bf..3f9beeb1600 100644
--- a/enterprise/frontend/src/metabase-enterprise/remote_sync/components/GitSettingsModal/GitSettingsModal.tsx
+++ b/enterprise/frontend/src/metabase-enterprise/remote_sync/components/GitSettingsModal/GitSettingsModal.tsx
@@ -15,16 +15,12 @@ export const GitSettingsModal = ({
}: GitSettingsModalProps) => {
return (
<Modal
+ density="relaxed"
opened={isOpen}
onClose={onClose}
withCloseButton={false}
- title={
- <Text fw={700} size="1.5rem">
- {t`Set up remote sync for your Library`}
- </Text>
- }
+ title={t`Set up remote sync for your Library`}
size="xl"
- padding="xxl"
>
<Text c="text-secondary" size="md" fw={400} lh="1.25rem" mb="xl">
{t`Keep your Library and transforms safely backed up in Git.`}
diff --git a/enterprise/frontend/src/metabase-enterprise/remote_sync/components/GitSyncControls/GitSyncControls.tsx b/enterprise/frontend/src/metabase-enterprise/remote_sync/components/GitSyncControls/GitSyncControls.tsx
index bc24ad6a1a4..a1bf60533e1 100644
--- a/enterprise/frontend/src/metabase-enterprise/remote_sync/components/GitSyncControls/GitSyncControls.tsx
+++ b/enterprise/frontend/src/metabase-enterprise/remote_sync/components/GitSyncControls/GitSyncControls.tsx
@@ -8,7 +8,6 @@ import { useDispatch, useSelector } from "metabase/redux";
import {
Button,
Combobox,
- Group,
Icon,
Loader,
Modal,
@@ -313,13 +312,12 @@ export const GitSyncControls = () => {
{branchMismatch && (
<Modal
opened
- padding="xxl"
title={t`This view is out of date`}
withCloseButton={false}
onClose={() => setBranchMismatch(null)}
>
- <Text mt="lg">{branchMismatch.message}</Text>
- <Group gap="sm" justify="end" mt="xxl">
+ <Text>{branchMismatch.message}</Text>
+ <Modal.Footer>
<Button
variant="subtle"
color="neutral"
@@ -330,7 +328,7 @@ export const GitSyncControls = () => {
<Button variant="filled" onClick={() => window.location.reload()}>
{t`Refresh`}
</Button>
- </Group>
+ </Modal.Footer>
</Modal>
)}
</>
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 3aa866886e7..f23696709cf 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
@@ -1,16 +1,7 @@
import { useCallback, useEffect, useMemo, useState } from "react";
import { t } from "ttag";
-import {
- Alert,
- Box,
- Button,
- Divider,
- Group,
- Icon,
- Modal,
- Stack,
-} from "metabase/ui";
+import { Alert, Button, Icon, Modal, Stack } from "metabase/ui";
import { useExportChangesMutation } from "metabase-enterprise/api";
import { trackPushChanges } from "../../analytics";
@@ -69,54 +60,42 @@ export const PushChangesModal = ({
}, [commitMessage, exportChanges, currentBranch]);
return (
- <Modal
- opened
- title={t`Push to Git`}
- onClose={onClose}
- size="lg"
- padding="xxl"
- >
- <Box pt="lg">
- {errorMessage && (
- <Alert
- size="compact"
- mb="lg"
- color="error"
- icon={<Icon name="warning" />}
- >
- {errorMessage}
- </Alert>
- )}
-
- <Stack gap="xl">
- <ChangesLists title={t`Changes to push`} />
-
- <CommitMessageSection
- value={commitMessage}
- onChange={setCommitMessage}
- />
- </Stack>
- </Box>
-
- <Divider my="xl" />
-
- <Box>
- <Group gap="sm" justify="end">
- <Button variant="subtle" color="neutral" onClick={onClose}>
- {t`Cancel`}
- </Button>
- <Button
- color="brand"
- disabled={isPushing}
- leftSection={<Icon name="upload" />}
- loading={isPushing}
- onClick={handlePush}
- variant="filled"
- >
- {t`Push changes`}
- </Button>
- </Group>
- </Box>
+ <Modal opened title={t`Push to Git`} onClose={onClose} size="lg">
+ {errorMessage && (
+ <Alert
+ size="compact"
+ mb="lg"
+ color="error"
+ icon={<Icon name="warning" />}
+ >
+ {errorMessage}
+ </Alert>
+ )}
+
+ <Stack gap="xl">
+ <ChangesLists title={t`Changes to push`} />
+
+ <CommitMessageSection
+ value={commitMessage}
+ onChange={setCommitMessage}
+ />
+ </Stack>
+
+ <Modal.Footer>
+ <Button variant="subtle" color="neutral" onClick={onClose}>
+ {t`Cancel`}
+ </Button>
+ <Button
+ color="brand"
+ disabled={isPushing}
+ leftSection={<Icon name="upload" />}
+ loading={isPushing}
+ onClick={handlePush}
+ variant="filled"
+ >
+ {t`Push changes`}
+ </Button>
+ </Modal.Footer>
</Modal>
);
};
diff --git a/enterprise/frontend/src/metabase-enterprise/remote_sync/components/RemoteSyncAdminSettings/BranchSwitcher.tsx b/enterprise/frontend/src/metabase-enterprise/remote_sync/components/RemoteSyncAdminSettings/BranchSwitcher.tsx
index 28dd5dedc43..6d0ff0673c5 100644
--- a/enterprise/frontend/src/metabase-enterprise/remote_sync/components/RemoteSyncAdminSettings/BranchSwitcher.tsx
+++ b/enterprise/frontend/src/metabase-enterprise/remote_sync/components/RemoteSyncAdminSettings/BranchSwitcher.tsx
@@ -197,13 +197,12 @@ export const BranchSwitcher = ({
{branchMismatch && (
<Modal
opened
- padding="xxl"
title={t`This view is out of date`}
withCloseButton={false}
onClose={() => setBranchMismatch(null)}
>
- <Text mt="lg">{branchMismatch}</Text>
- <Group gap="sm" justify="end" mt="xxl">
+ <Text>{branchMismatch}</Text>
+ <Modal.Footer>
<Button
variant="subtle"
color="neutral"
@@ -214,7 +213,7 @@ export const BranchSwitcher = ({
<Button variant="filled" onClick={() => window.location.reload()}>
{t`Refresh`}
</Button>
- </Group>
+ </Modal.Footer>
</Modal>
)}
</>
diff --git a/enterprise/frontend/src/metabase-enterprise/remote_sync/components/RemoteSyncAdminSettings/RemoteSyncDependencyModal.tsx b/enterprise/frontend/src/metabase-enterprise/remote_sync/components/RemoteSyncAdminSettings/RemoteSyncDependencyModal.tsx
index e36e3489bb4..50402d0e2d8 100644
--- a/enterprise/frontend/src/metabase-enterprise/remote_sync/components/RemoteSyncAdminSettings/RemoteSyncDependencyModal.tsx
+++ b/enterprise/frontend/src/metabase-enterprise/remote_sync/components/RemoteSyncAdminSettings/RemoteSyncDependencyModal.tsx
@@ -64,11 +64,10 @@ export const RemoteSyncDependencyModal = ({
<Modal
opened
onClose={handleDismiss}
- padding="xxl"
title={t`Couldn’t sync selected collection`}
withCloseButton={false}
>
- <Stack gap="xl" pt="lg">
+ <Stack gap="xl">
<Text>{getBlockedMessage(required)}</Text>
{listedRequiredSyncs.length > 0 && (
@@ -94,20 +93,15 @@ export const RemoteSyncDependencyModal = ({
))}
</Accordion>
)}
-
- <Group justify="end" gap="sm">
- <Button onClick={handleDismiss}>{t`Back`}</Button>
- {canSave && (
- <Button
- variant="filled"
- loading={isSubmitting}
- onClick={submitForm}
- >
- {t`Save changes`}
- </Button>
- )}
- </Group>
</Stack>
+ <Modal.Footer>
+ <Button onClick={handleDismiss}>{t`Back`}</Button>
+ {canSave && (
+ <Button variant="filled" loading={isSubmitting} onClick={submitForm}>
+ {t`Save changes`}
+ </Button>
+ )}
+ </Modal.Footer>
</Modal>
);
};
diff --git a/enterprise/frontend/src/metabase-enterprise/remote_sync/components/SyncConflictModal/SyncConflictModal.tsx b/enterprise/frontend/src/metabase-enterprise/remote_sync/components/SyncConflictModal/SyncConflictModal.tsx
index 4af61b943a5..bb15bdb28ef 100644
--- a/enterprise/frontend/src/metabase-enterprise/remote_sync/components/SyncConflictModal/SyncConflictModal.tsx
+++ b/enterprise/frontend/src/metabase-enterprise/remote_sync/components/SyncConflictModal/SyncConflictModal.tsx
@@ -4,7 +4,7 @@ import { t } from "ttag";
import { useMetadataToasts } from "metabase/common/hooks";
import { useSelector } from "metabase/redux";
import { useGetSettingsQuery, useSetting } from "metabase/settings";
-import { Box, Button, Group, Icon, Modal } from "metabase/ui";
+import { Box, Button, Icon, Modal } from "metabase/ui";
import {
useGetBranchesQuery,
useUpdateRemoteSyncSettingsMutation,
@@ -189,80 +189,77 @@ export const SyncConflictModal = (props: UnsyncedWarningModalProps) => {
return (
<Modal
+ density="relaxed"
onClose={onClose}
opened
- padding="xxl"
- styles={{ title: { lineHeight: "2rem" } }}
title={getModalTitle(variant, canMerge)}
withCloseButton={false}
>
- <Box pt="lg">
- {variant === "setup" ? (
- <SetupConflictInfo />
- ) : conflicts && conflicts.length > 0 ? (
- <ConflictingChangesList conflicts={conflicts} />
- ) : (
- <ChangesLists />
- )}
+ {variant === "setup" ? (
+ <SetupConflictInfo />
+ ) : conflicts && conflicts.length > 0 ? (
+ <ConflictingChangesList conflicts={conflicts} />
+ ) : (
+ <ChangesLists />
+ )}
- <OutOfSyncOptions
- currentBranch={currentBranch}
- handleOptionChange={setOptionValue}
- isRemoteSyncReadOnly={isRemoteSyncReadOnly}
- optionValue={optionValue}
- variant={variant}
- canMerge={canMerge}
+ <OutOfSyncOptions
+ currentBranch={currentBranch}
+ handleOptionChange={setOptionValue}
+ isRemoteSyncReadOnly={isRemoteSyncReadOnly}
+ optionValue={optionValue}
+ variant={variant}
+ canMerge={canMerge}
+ />
+
+ {optionValue === "force-push" && forcePushCasualties && (
+ <ForcePushWarning
+ casualties={forcePushCasualties}
+ branch={currentBranch}
+ historyRewritten={historyRewritten}
/>
+ )}
- {optionValue === "force-push" && forcePushCasualties && (
- <ForcePushWarning
- casualties={forcePushCasualties}
- branch={currentBranch}
- historyRewritten={historyRewritten}
- />
- )}
+ {optionValue === "new-branch" && (
+ <BranchNameInput
+ existingBranches={existingBranches}
+ setValue={setNewBranchName}
+ value={newBranchName}
+ />
+ )}
- {optionValue === "new-branch" && (
- <BranchNameInput
- existingBranches={existingBranches}
- setValue={setNewBranchName}
- value={newBranchName}
+ {/* Pushing (merge / force / new branch) needs a commit message; pull/switch/setup don't. */}
+ {variant === "push" && optionValue && optionValue !== "discard" && (
+ <Box mt="xl">
+ <CommitMessageSection
+ value={commitMessage}
+ onChange={setCommitMessage}
/>
- )}
-
- {/* Pushing (merge / force / new branch) needs a commit message; pull/switch/setup don't. */}
- {variant === "push" && optionValue && optionValue !== "discard" && (
- <Box mt="xl">
- <CommitMessageSection
- value={commitMessage}
- onChange={setCommitMessage}
- />
- </Box>
- )}
+ </Box>
+ )}
- <Group gap="sm" justify="end" mt="xl">
- <Button onClick={onClose} variant="subtle" color="neutral">
- {t`Cancel`}
- </Button>
- <Button
- color={optionValue === "discard" ? "negative" : "brand"}
- disabled={isButtonDisabled}
- leftSection={
- optionValue === "force-push" ? <Icon name="warning" /> : undefined
- }
- loading={isProcessing}
- onClick={handleContinueButtonClick}
- variant="filled"
- title={
- optionValue === "force-push"
- ? t`Force push will replace the remote version with your changes`
- : undefined
- }
- >
- {getContinueButtonText(optionValue)}
- </Button>
- </Group>
- </Box>
+ <Modal.Footer>
+ <Button onClick={onClose} variant="subtle" color="neutral">
+ {t`Cancel`}
+ </Button>
+ <Button
+ color={optionValue === "discard" ? "negative" : "brand"}
+ disabled={isButtonDisabled}
+ leftSection={
+ optionValue === "force-push" ? <Icon name="warning" /> : undefined
+ }
+ loading={isProcessing}
+ onClick={handleContinueButtonClick}
+ variant="filled"
+ title={
+ optionValue === "force-push"
+ ? t`Force push will replace the remote version with your changes`
+ : undefined
+ }
+ >
+ {getContinueButtonText(optionValue)}
+ </Button>
+ </Modal.Footer>
</Modal>
);
};
diff --git a/enterprise/frontend/src/metabase-enterprise/remote_sync/components/SyncProgressModal.tsx b/enterprise/frontend/src/metabase-enterprise/remote_sync/components/SyncProgressModal.tsx
index 7b7b728cfcf..d8b6c7d1c19 100644
--- a/enterprise/frontend/src/metabase-enterprise/remote_sync/components/SyncProgressModal.tsx
+++ b/enterprise/frontend/src/metabase-enterprise/remote_sync/components/SyncProgressModal.tsx
@@ -5,7 +5,7 @@ import { useToast } from "metabase/common/hooks";
import { getUserIsAdmin } from "metabase/current-user";
import { dayjs } from "metabase/dayjs";
import { useSelector } from "metabase/redux";
-import { Button, Group, Modal, Progress, Stack, Text } from "metabase/ui";
+import { Button, Modal, Progress, Stack, Text } from "metabase/ui";
import { getUserName } from "metabase/utils/user";
import { useCancelRemoteSyncCurrentTaskMutation } from "metabase-enterprise/api";
import type {
@@ -83,20 +83,20 @@ export function SyncProgressModal({
if (isError) {
return (
<Modal onClose={onDismiss} opened size="md" title={t`Sync failed`}>
- <Stack mt="lg" gap="lg">
+ <Stack gap="lg">
<Text>{t`An error occurred during sync.`}</Text>
{errorMessage && (
<Text style={{ whiteSpace: "pre-line" }}>{errorMessage}</Text>
)}
{startedBy}
- <Group justify="flex-end">
- <Button
- data-testid="sync-error-close-button"
- onClick={onDismiss}
- variant="filled"
- >{t`Close`}</Button>
- </Group>
</Stack>
+ <Modal.Footer>
+ <Button
+ data-testid="sync-error-close-button"
+ onClick={onDismiss}
+ variant="filled"
+ >{t`Close`}</Button>
+ </Modal.Footer>
</Modal>
);
}
@@ -106,16 +106,14 @@ export function SyncProgressModal({
return (
<Modal onClose={onDismiss} opened size="md" title={successTitle}>
- <Stack mt="lg" gap="lg">
- <Text>{getSuccessMessage(outcome, taskType)}</Text>
- <Group justify="flex-end">
- <Button
- data-testid="sync-success-close-button"
- onClick={onDismiss}
- variant="filled"
- >{t`Close`}</Button>
- </Group>
- </Stack>
+ <Text>{getSuccessMessage(outcome, taskType)}</Text>
+ <Modal.Footer>
+ <Button
+ data-testid="sync-success-close-button"
+ onClick={onDismiss}
+ variant="filled"
+ >{t`Close`}</Button>
+ </Modal.Footer>
</Modal>
);
}
@@ -123,18 +121,18 @@ export function SyncProgressModal({
if (isCancelled) {
return (
<Modal onClose={onDismiss} opened size="md" title={t`Sync stopped`}>
- <Stack mt="lg" gap="lg">
+ <Stack gap="lg">
<Text>{errorMessage || t`The sync was cancelled.`}</Text>
<StoppedAtLine progress={progress} taskType={taskType} />
{startedBy}
- <Group justify="flex-end">
- <Button
- data-testid="sync-cancelled-close-button"
- onClick={onDismiss}
- variant="filled"
- >{t`Close`}</Button>
- </Group>
</Stack>
+ <Modal.Footer>
+ <Button
+ data-testid="sync-cancelled-close-button"
+ onClick={onDismiss}
+ variant="filled"
+ >{t`Close`}</Button>
+ </Modal.Footer>
</Modal>
);
}
@@ -149,7 +147,7 @@ export function SyncProgressModal({
title={title}
withCloseButton={false}
>
- <Stack mt="lg" gap="lg">
+ <Stack gap="lg">
<Text ta="center">{progressLabel}</Text>
<Progress value={progress * 100} transitionDuration={300} animated />
{isQuiet && (
@@ -159,17 +157,17 @@ export function SyncProgressModal({
<Text size="sm">
{t`Please wait until this finishes before editing content.`}
</Text>
- {isAdmin && (
- <Group justify="flex-end">
- <ActionButton
- actionFn={onCancel}
- normalText={t`Cancel`}
- activeText={t`Cancelling…`}
- failedText={t`Cancel`}
- />
- </Group>
- )}
</Stack>
+ {isAdmin && (
+ <Modal.Footer>
+ <ActionButton
+ actionFn={onCancel}
+ normalText={t`Cancel`}
+ activeText={t`Cancelling…`}
+ failedText={t`Cancel`}
+ />
+ </Modal.Footer>
+ )}
</Modal>
);
}
diff --git a/enterprise/frontend/src/metabase-enterprise/replacement/pages/MigrateModelsPage/ReplaceWithTransformModal/ReplaceWithTransformModal.tsx b/enterprise/frontend/src/metabase-enterprise/replacement/pages/MigrateModelsPage/ReplaceWithTransformModal/ReplaceWithTransformModal.tsx
index 78e981744fd..8f6d2c78739 100644
--- a/enterprise/frontend/src/metabase-enterprise/replacement/pages/MigrateModelsPage/ReplaceWithTransformModal/ReplaceWithTransformModal.tsx
+++ b/enterprise/frontend/src/metabase-enterprise/replacement/pages/MigrateModelsPage/ReplaceWithTransformModal/ReplaceWithTransformModal.tsx
@@ -19,16 +19,7 @@ import {
import { SchemaFormSelect } from "metabase/transforms/components/SchemaFormSelect";
import { TagsMultiFormSelect } from "metabase/transforms/components/TagsMultiFormSelect";
import { TargetNameInput } from "metabase/transforms/components/TargetNameInput";
-import {
- Box,
- Button,
- FocusTrap,
- Group,
- Input,
- Modal,
- Stack,
- Text,
-} from "metabase/ui";
+import { Button, FocusTrap, Input, Modal, Stack, Text } from "metabase/ui";
import * as Errors from "metabase/utils/errors";
import { slugify } from "metabase/utils/formatting";
import { useReplaceModelWithTransformMutation } from "metabase-enterprise/api";
@@ -57,9 +48,9 @@ export function ReplaceWithTransformModal({
}: ReplaceWithTransformModalProps) {
return (
<Modal
+ density="relaxed"
title={t`Convert this model to a transform?`}
opened={opened}
- padding="xxl"
onClose={onClose}
>
<FocusTrap.InitialFocus />
@@ -158,7 +149,7 @@ function ReplaceWithTransformForm({
onSubmit={handleSubmit}
>
<Form>
- <Stack gap="xl" mt="sm">
+ <Stack gap="xl">
<Text>
{t`We'll create a transform based on the model and replace usages of the model with the transform's output table. Then we'll convert the model to a saved question.`}
</Text>
@@ -166,7 +157,6 @@ function ReplaceWithTransformForm({
name="collectionId"
title={t`Folder to save this transform in`}
collectionPickerModalProps={{ namespaces: ["transforms"] }}
- style={{ marginBottom: 0 }}
/>
<Input.Wrapper label={t`Database this model belongs to`}>
<Text>{database.name}</Text>
@@ -184,21 +174,19 @@ function ReplaceWithTransformForm({
label={t`Scheduling tags`}
description={t`Transforms are run by jobs. Jobs run every transform with matching tags.`}
/>
- <Group gap="xxs">
- <Box flex={1}>
- <FormErrorMessage />
- </Box>
- <Button
- variant="subtle"
- color="neutral"
- onClick={onClose}
- >{t`Cancel`}</Button>
- <FormSubmitButton
- label={t`Convert to a transform`}
- variant="filled"
- />
- </Group>
</Stack>
+ <Modal.Footer>
+ <FormErrorMessage flex={1} />
+ <Button
+ variant="subtle"
+ color="neutral"
+ onClick={onClose}
+ >{t`Cancel`}</Button>
+ <FormSubmitButton
+ label={t`Convert to a transform`}
+ variant="filled"
+ />
+ </Modal.Footer>
</Form>
</FormProvider>
);
diff --git a/enterprise/frontend/src/metabase-enterprise/sandboxes/components/LoginAttributesWidget/LoginAttributesWidget.tsx b/enterprise/frontend/src/metabase-enterprise/sandboxes/components/LoginAttributesWidget/LoginAttributesWidget.tsx
index ee7ee14b27b..c0328752f32 100644
--- a/enterprise/frontend/src/metabase-enterprise/sandboxes/components/LoginAttributesWidget/LoginAttributesWidget.tsx
+++ b/enterprise/frontend/src/metabase-enterprise/sandboxes/components/LoginAttributesWidget/LoginAttributesWidget.tsx
@@ -3,7 +3,7 @@ import { type HTMLAttributes, useMemo } from "react";
import { t } from "ttag";
import { skipToken, useGetUserQuery } from "metabase/api";
-import { FormField } from "metabase/common/components/FormField";
+import { FormField } from "metabase/forms";
import { Accordion, Box, Loader, Text } from "metabase/ui";
import { useGetTenantQuery } from "metabase-enterprise/api";
import { getExtraAttributes } from "metabase-enterprise/sandboxes/utils";
@@ -79,7 +79,7 @@ export const LoginAttributesWidget = ({
return (
<FormField className={className} style={style}>
- <Accordion mt="xxl">
+ <Accordion>
<Accordion.Item value="login-attributes">
<Accordion.Control>
<Text fz="md">{title}</Text>
diff --git a/enterprise/frontend/src/metabase-enterprise/security_center/components/NotificationChannelConfigModal/NotificationChannelConfigModal.tsx b/enterprise/frontend/src/metabase-enterprise/security_center/components/NotificationChannelConfigModal/NotificationChannelConfigModal.tsx
index dcd93bdd950..0e9460fd0e3 100644
--- a/enterprise/frontend/src/metabase-enterprise/security_center/components/NotificationChannelConfigModal/NotificationChannelConfigModal.tsx
+++ b/enterprise/frontend/src/metabase-enterprise/security_center/components/NotificationChannelConfigModal/NotificationChannelConfigModal.tsx
@@ -4,7 +4,7 @@ import { t } from "ttag";
import { useToast } from "metabase/common/hooks";
import { useIsSmallScreen } from "metabase/common/hooks/use-is-small-screen";
import { useSetting } from "metabase/settings";
-import { Button, Flex, Group, Icon, Modal, Stack } from "metabase/ui";
+import { Button, Icon, Modal, Stack } from "metabase/ui";
import { useSendTestNotificationMutation } from "../../api";
import {
@@ -77,6 +77,7 @@ export function NotificationChannelConfigModal({
return (
<Modal
+ density="relaxed"
opened={opened}
onClose={() => {
resetConfig();
@@ -86,40 +87,39 @@ export function NotificationChannelConfigModal({
size="lg"
fullScreen={isSmallScreen}
>
- <Stack gap="lg" mt="lg">
+ <Stack gap="xl">
<EmailChannelCard isConfigured={isEmailConfigured} />
<SlackChannelCard isConfigured={isSlackConfigured} />
- <Flex justify="space-between" gap="lg" mt="lg">
- <Button
- variant="subtle"
- leftSection={<Icon name="mail" />}
- onClick={handleSendTest}
- loading={isSendingTest}
- >
- {t`Send test notification`}
- </Button>
- <Group gap="lg">
- <Button
- variant="subtle"
- color="neutral"
- onClick={() => {
- resetConfig();
- onClose();
- }}
- >
- {t`Cancel`}
- </Button>
- <Button
- variant="filled"
- onClick={handleSave}
- loading={isSaving}
- disabled={!canSave}
- >
- {t`Save`}
- </Button>
- </Group>
- </Flex>
</Stack>
+ <Modal.Footer>
+ <Button
+ variant="subtle"
+ leftSection={<Icon name="mail" />}
+ onClick={handleSendTest}
+ loading={isSendingTest}
+ mr="auto"
+ >
+ {t`Send test notification`}
+ </Button>
+ <Button
+ variant="subtle"
+ color="neutral"
+ onClick={() => {
+ resetConfig();
+ onClose();
+ }}
+ >
+ {t`Cancel`}
+ </Button>
+ <Button
+ variant="filled"
+ onClick={handleSave}
+ loading={isSaving}
+ disabled={!canSave}
+ >
+ {t`Save`}
+ </Button>
+ </Modal.Footer>
</Modal>
);
}
diff --git a/enterprise/frontend/src/metabase-enterprise/storage/StoragePurchaseModal.tsx b/enterprise/frontend/src/metabase-enterprise/storage/StoragePurchaseModal.tsx
index eeea3bf6516..2ff11184704 100644
--- a/enterprise/frontend/src/metabase-enterprise/storage/StoragePurchaseModal.tsx
+++ b/enterprise/frontend/src/metabase-enterprise/storage/StoragePurchaseModal.tsx
@@ -1,13 +1,6 @@
import { c, t } from "ttag";
-import {
- Button,
- Group,
- Modal,
- type ModalProps,
- Stack,
- Text,
-} from "metabase/ui";
+import { Button, Modal, type ModalProps, Stack, Text } from "metabase/ui";
import { formatNumber } from "metabase/utils/formatting";
import type { ICloudAddOnProduct } from "metabase-types/api";
@@ -52,11 +45,10 @@ export const StoragePurchaseModal = ({
opened={opened}
onClose={onClose}
size="35rem"
- padding="2.5rem"
// eslint-disable-next-line metabase/no-literal-metabase-strings -- Upsell for Metabase Storage, only visible to admins
title={t`Add Metabase Storage`}
>
- <Stack gap="lg" mt="lg">
+ <Stack gap="lg">
<Text>
{t`Get secure, fully managed data storage where you can upload your CSVs and sync data from Google Sheets.`}
</Text>
@@ -69,17 +61,16 @@ export const StoragePurchaseModal = ({
// eslint-disable-next-line metabase/no-literal-metabase-strings -- Upsell for Metabase Storage, only visible to admins
.t`By clicking "Add Metabase Storage," you agree to be charged in accordance with our terms of service. You will not be charged until you reach ${includedRows} stored rows, after which it's ${pricePerBlock}/mo. for each additional ${additionalRows} rows.`}
</Text>
-
- <Group justify="flex-end" mt="sm">
- <Button variant="subtle" color="neutral" onClick={onClose}>
- {t`Cancel`}
- </Button>
- <Button variant="filled" onClick={handleConfirm}>
- {/* eslint-disable-next-line metabase/no-literal-metabase-strings -- Upsell for Metabase Storage, only visible to admins */}
- {t`Add Metabase Storage`}
- </Button>
- </Group>
</Stack>
+ <Modal.Footer>
+ <Button variant="subtle" color="neutral" onClick={onClose}>
+ {t`Cancel`}
+ </Button>
+ <Button variant="filled" onClick={handleConfirm}>
+ {/* eslint-disable-next-line metabase/no-literal-metabase-strings -- Upsell for Metabase Storage, only visible to admins */}
+ {t`Add Metabase Storage`}
+ </Button>
+ </Modal.Footer>
</Modal>
);
};
diff --git a/enterprise/frontend/src/metabase-enterprise/support/components/SupportSettingsSection/GrantAccessModal.tsx b/enterprise/frontend/src/metabase-enterprise/support/components/SupportSettingsSection/GrantAccessModal.tsx
index 91b55fe2d6f..e41c21b3a6c 100644
--- a/enterprise/frontend/src/metabase-enterprise/support/components/SupportSettingsSection/GrantAccessModal.tsx
+++ b/enterprise/frontend/src/metabase-enterprise/support/components/SupportSettingsSection/GrantAccessModal.tsx
@@ -12,7 +12,7 @@ import {
FormTextarea,
} from "metabase/forms";
import { PLUGIN_SUPPORT } from "metabase/plugins";
-import { Box, Flex, Modal, Stack, Text } from "metabase/ui";
+import { Box, Modal, Stack, Text } from "metabase/ui";
import { useCreateSupportAccessGrantMutation } from "metabase-enterprise/api";
interface GrantAccessModalProps {
@@ -57,62 +57,60 @@ export const GrantAccessModal = ({ onClose }: GrantAccessModalProps) => {
return (
<Modal
+ density="relaxed"
data-testid="grant-access-modal"
onClose={onClose}
opened
title={t`Grant Access?`}
- padding="xxl"
>
- <Stack>
- <Box mt="sm">
- <Text display="inline">
- {/* eslint-disable-next-line metabase/no-literal-metabase-strings -- This string only shows for admins. */}
- {t`You are about to allow a Metabase team member to access your instance.`}{" "}
- </Text>
- <Text fw="bold" display="inline">
- {t`The Success Engineer will have full admin access until the grant expires or is revoked.`}
- </Text>
- </Box>
- <FormProvider initialValues={initialValues} onSubmit={handleSubmit}>
- {({ values }) => (
- <Form>
- <Stack mt="lg">
- <FormSelect
- name="grant_duration_minutes"
- label={t`Access duration`}
- data={[
- { value: String(24 * 60), label: t`24 hours` },
- { value: String(48 * 60), label: t`48 hours` },
- { value: String(96 * 60), label: t`96 hours` },
- ]}
- placeholder={t`Choose...`}
- required
- />
- <FormTextInput
- label={t`Ticket`}
- name="ticket_number"
- placeholder={t`TICKET-1234`}
- />
- <FormTextarea
- label={t`Notes`}
- minRows={3}
- name="notes"
- placeholder={t`Add any important information we should know to help you better.`}
- />
- <Flex justify="end" mt="lg" gap="lg">
- <FormErrorMessage />
- <FormSubmitButton
- disabled={!values.grant_duration_minutes}
- label={t`Grant access`}
- style={{ flexShrink: 0 }}
- variant="filled"
- />
- </Flex>
- </Stack>
- </Form>
- )}
- </FormProvider>
- </Stack>
+ <FormProvider initialValues={initialValues} onSubmit={handleSubmit}>
+ {({ values }) => (
+ <Form>
+ <Stack gap="xl">
+ <Box>
+ <Text display="inline">
+ {/* eslint-disable-next-line metabase/no-literal-metabase-strings -- This string only shows for admins. */}
+ {t`You are about to allow a Metabase team member to access your instance.`}{" "}
+ </Text>
+ <Text fw="bold" display="inline">
+ {t`The Success Engineer will have full admin access until the grant expires or is revoked.`}
+ </Text>
+ </Box>
+ <FormSelect
+ name="grant_duration_minutes"
+ label={t`Access duration`}
+ data={[
+ { value: String(24 * 60), label: t`24 hours` },
+ { value: String(48 * 60), label: t`48 hours` },
+ { value: String(96 * 60), label: t`96 hours` },
+ ]}
+ placeholder={t`Choose...`}
+ required
+ />
+ <FormTextInput
+ label={t`Ticket`}
+ name="ticket_number"
+ placeholder={t`TICKET-1234`}
+ />
+ <FormTextarea
+ label={t`Notes`}
+ minRows={3}
+ name="notes"
+ placeholder={t`Add any important information we should know to help you better.`}
+ />
+ </Stack>
+ <Modal.Footer>
+ <FormErrorMessage flex={1} />
+ <FormSubmitButton
+ disabled={!values.grant_duration_minutes}
+ label={t`Grant access`}
+ style={{ flexShrink: 0 }}
+ variant="filled"
+ />
+ </Modal.Footer>
+ </Form>
+ )}
+ </FormProvider>
</Modal>
);
};
diff --git a/enterprise/frontend/src/metabase-enterprise/table-editing/table-edit/modals/DeleteBulkRowConfirmationModal.tsx b/enterprise/frontend/src/metabase-enterprise/table-editing/table-edit/modals/DeleteBulkRowConfirmationModal.tsx
index 92b13107a0c..a264285c635 100644
--- a/enterprise/frontend/src/metabase-enterprise/table-editing/table-edit/modals/DeleteBulkRowConfirmationModal.tsx
+++ b/enterprise/frontend/src/metabase-enterprise/table-editing/table-edit/modals/DeleteBulkRowConfirmationModal.tsx
@@ -1,6 +1,6 @@
import { msgid, ngettext, t } from "ttag";
-import { Button, Group, Modal } from "metabase/ui";
+import { Button, Modal } from "metabase/ui";
type DeleteBulkRowConfirmationModalProps = {
opened: boolean;
@@ -27,7 +27,7 @@ export function DeleteBulkRowConfirmationModal({
opened={opened}
onClose={onClose}
>
- <Group justify="flex-end" mt="xxl">
+ <Modal.Footer>
<Button variant="subtle" color="neutral" onClick={onClose}>
{t`Cancel`}
</Button>
@@ -43,7 +43,7 @@ export function DeleteBulkRowConfirmationModal({
rowCount,
)}
</Button>
- </Group>
+ </Modal.Footer>
</Modal>
);
}
diff --git a/enterprise/frontend/src/metabase-enterprise/tenants/EditUserStrategyModal/EditUserStrategyModal.tsx b/enterprise/frontend/src/metabase-enterprise/tenants/EditUserStrategyModal/EditUserStrategyModal.tsx
index 7b982e3f41e..de02d86af40 100644
--- a/enterprise/frontend/src/metabase-enterprise/tenants/EditUserStrategyModal/EditUserStrategyModal.tsx
+++ b/enterprise/frontend/src/metabase-enterprise/tenants/EditUserStrategyModal/EditUserStrategyModal.tsx
@@ -8,7 +8,7 @@ import { useConfirmation } from "metabase/common/hooks/use-confirmation";
import { useDispatch } from "metabase/redux";
import { useNavigate } from "metabase/router";
import { useAdminSetting } from "metabase/settings";
-import { Button, Flex, Modal, Radio, Stack } from "metabase/ui";
+import { Button, Modal, Radio, Stack } from "metabase/ui";
import * as EnterpriseUrls from "metabase-enterprise/urls";
interface EditUserStrategyModalProps {
@@ -119,39 +119,33 @@ export const EditUserStrategyModal = ({
<Modal
opened={!confirmationModal && !isApplyingAfterConfirm}
title={t`Pick a user strategy`}
- padding="xxl"
size="md"
onClose={onClose}
>
<LoadingAndErrorWrapper loading={isLoading} error={error}>
- <Stack gap="lg" mt="sm">
- <Radio.Group
- value={selectedStrategy}
- onChange={setSelectedStrategy}
- >
- <Stack gap="lg">
- {strategyOptions.map((option) => (
- <Radio.Card
- key={option.value}
- value={option.value}
- label={option.label}
- description={option.description}
- withIndicator={false}
- />
- ))}
- </Stack>
- </Radio.Group>
-
- <Flex justify="flex-end" gap="lg" mt="lg">
- <Button onClick={handleCancel}>{t`Cancel`}</Button>
-
- <Button
- onClick={handleApply}
- disabled={initialStrategy === selectedStrategy}
- variant="filled"
- >{t`Apply`}</Button>
- </Flex>
- </Stack>
+ <Radio.Group value={selectedStrategy} onChange={setSelectedStrategy}>
+ <Stack gap="lg">
+ {strategyOptions.map((option) => (
+ <Radio.Card
+ key={option.value}
+ value={option.value}
+ label={option.label}
+ description={option.description}
+ withIndicator={false}
+ />
+ ))}
+ </Stack>
+ </Radio.Group>
+
+ <Modal.Footer>
+ <Button onClick={handleCancel}>{t`Cancel`}</Button>
+
+ <Button
+ onClick={handleApply}
+ disabled={initialStrategy === selectedStrategy}
+ variant="filled"
+ >{t`Apply`}</Button>
+ </Modal.Footer>
</LoadingAndErrorWrapper>
</Modal>
{confirmationModal}
diff --git a/enterprise/frontend/src/metabase-enterprise/tenants/components/MainNavSharedCollections/MainNavSharedCollections.tsx b/enterprise/frontend/src/metabase-enterprise/tenants/components/MainNavSharedCollections/MainNavSharedCollections.tsx
index 8f0ed4010a0..132a4fcd56b 100644
--- a/enterprise/frontend/src/metabase-enterprise/tenants/components/MainNavSharedCollections/MainNavSharedCollections.tsx
+++ b/enterprise/frontend/src/metabase-enterprise/tenants/components/MainNavSharedCollections/MainNavSharedCollections.tsx
@@ -162,6 +162,7 @@ export const MainNavSharedCollections = ({
</SidebarSection>
)}
<Modal
+ density="relaxed"
opened={modalOpen}
title={t`New shared collection`}
onClose={() => setModalOpen(false)}
diff --git a/enterprise/frontend/src/metabase-enterprise/tenants/components/TenantForm/TenantForm.tsx b/enterprise/frontend/src/metabase-enterprise/tenants/components/TenantForm/TenantForm.tsx
index 22a1bc4ca62..e9c85b53595 100644
--- a/enterprise/frontend/src/metabase-enterprise/tenants/components/TenantForm/TenantForm.tsx
+++ b/enterprise/frontend/src/metabase-enterprise/tenants/components/TenantForm/TenantForm.tsx
@@ -1,7 +1,6 @@
import { t } from "ttag";
import * as Yup from "yup";
-import { FormFooter } from "metabase/common/components/FormFooter";
import {
Form,
FormErrorMessage,
@@ -9,7 +8,7 @@ import {
FormSubmitButton,
FormTextInput,
} from "metabase/forms";
-import { Button } from "metabase/ui";
+import { Button, Modal, Stack } from "metabase/ui";
import * as Errors from "metabase/utils/errors";
import { LoginAttributesWidget } from "metabase-enterprise/sandboxes/components/LoginAttributesWidget/LoginAttributesWidget";
import type { Tenant } from "metabase-types/api";
@@ -61,49 +60,50 @@ export const TenantForm = ({
onSubmit={onSubmit}
>
{({ values, setFieldValue, dirty }) => (
- <Form disabled={!dirty} mt="sm">
- <FormTextInput
- name="name"
- title={t`Give this tenant a name`}
- label={t`Give this tenant a name`}
- description={t`This will be visible to users assigned to this tenant.`}
- mb="lg"
- placeholder="A wonderful tenant"
- onChange={(e) => {
- const value = e.target.value;
- setFieldValue("name", value);
+ <Form disabled={!dirty}>
+ <Stack gap="xl">
+ <FormTextInput
+ name="name"
+ title={t`Give this tenant a name`}
+ label={t`Give this tenant a name`}
+ description={t`This will be visible to users assigned to this tenant.`}
+ placeholder="A wonderful tenant"
+ onChange={(e) => {
+ const value = e.target.value;
+ setFieldValue("name", value);
- const isSlugModified =
- slugify(values.name ?? "") !== (values.slug ?? "");
- const shouldAutoSetSlug = !initialValues.slug && !isSlugModified;
- if (shouldAutoSetSlug) {
- setFieldValue("slug", slugify(value));
- }
- }}
- />
- <FormTextInput
- name="slug"
- title={t`Slug for this tenant`}
- label={t`Slug for this tenant`}
- description={t`This can’t be changed later, so choose wisely.`}
- placeholder="permanent-tenant-identifier"
- disabled={!!initialValues.slug}
- mb="xxl"
- />
- <LoginAttributesWidget
- name="attributes"
- title={t`Default attributes`}
- description={t`Attributes to be applied to all users in this tenant.`}
- />
- <FormFooter>
- <FormErrorMessage inline />
+ const isSlugModified =
+ slugify(values.name ?? "") !== (values.slug ?? "");
+ const shouldAutoSetSlug =
+ !initialValues.slug && !isSlugModified;
+ if (shouldAutoSetSlug) {
+ setFieldValue("slug", slugify(value));
+ }
+ }}
+ />
+ <FormTextInput
+ name="slug"
+ title={t`Slug for this tenant`}
+ label={t`Slug for this tenant`}
+ description={t`This can’t be changed later, so choose wisely.`}
+ placeholder="permanent-tenant-identifier"
+ disabled={!!initialValues.slug}
+ />
+ <LoginAttributesWidget
+ name="attributes"
+ title={t`Default attributes`}
+ description={t`Attributes to be applied to all users in this tenant.`}
+ />
+ </Stack>
+ <Modal.Footer>
+ <FormErrorMessage flex={1} />
<Button type="button" onClick={onCancel}>{t`Cancel`}</Button>
<FormSubmitButton
label={submitText}
disabled={!dirty}
variant="filled"
/>
- </FormFooter>
+ </Modal.Footer>
</Form>
)}
</FormProvider>
diff --git a/enterprise/frontend/src/metabase-enterprise/tenants/containers/EditTenantModal/EditTenantModal.tsx b/enterprise/frontend/src/metabase-enterprise/tenants/containers/EditTenantModal/EditTenantModal.tsx
index b0a71e6c615..52df5909387 100644
--- a/enterprise/frontend/src/metabase-enterprise/tenants/containers/EditTenantModal/EditTenantModal.tsx
+++ b/enterprise/frontend/src/metabase-enterprise/tenants/containers/EditTenantModal/EditTenantModal.tsx
@@ -48,7 +48,7 @@ export const EditTenantModal = ({ params, onClose }: EditUserModalProps) => {
};
return (
- <Modal opened title={t`Edit tenant`} padding="xxl" onClose={onClose}>
+ <Modal density="relaxed" opened title={t`Edit tenant`} onClose={onClose}>
<LoadingAndErrorWrapper loading={isLoading} error={error}>
<TenantForm
initialValues={initialValues}
diff --git a/enterprise/frontend/src/metabase-enterprise/tenants/containers/NewTenantModal/NewTenantModal.tsx b/enterprise/frontend/src/metabase-enterprise/tenants/containers/NewTenantModal/NewTenantModal.tsx
index da615acbe87..000193b2b07 100644
--- a/enterprise/frontend/src/metabase-enterprise/tenants/containers/NewTenantModal/NewTenantModal.tsx
+++ b/enterprise/frontend/src/metabase-enterprise/tenants/containers/NewTenantModal/NewTenantModal.tsx
@@ -39,9 +39,9 @@ export const NewTenantModal = ({ onClose, location }: NewUserModalProps) => {
return (
<Modal
+ density="relaxed"
opened
title={isOnboarding ? t`Set up your first tenant` : t`New tenant`}
- padding="xxl"
onClose={onClose}
>
<TenantForm
diff --git a/enterprise/frontend/src/metabase-enterprise/user_provisioning/components/UserProvisioningModals.tsx b/enterprise/frontend/src/metabase-enterprise/user_provisioning/components/UserProvisioningModals.tsx
index 68319350007..191191a5835 100644
--- a/enterprise/frontend/src/metabase-enterprise/user_provisioning/components/UserProvisioningModals.tsx
+++ b/enterprise/frontend/src/metabase-enterprise/user_provisioning/components/UserProvisioningModals.tsx
@@ -3,7 +3,7 @@ import { t } from "ttag";
import { ConfirmModal } from "metabase/common/components/ConfirmModal";
import { LoadingAndErrorWrapper } from "metabase/common/components/LoadingAndErrorWrapper";
-import { Button, Flex, Modal, type ModalProps, Stack, Text } from "metabase/ui";
+import { Button, Modal, type ModalProps, Stack, Text } from "metabase/ui";
import type { useRegenerateScimTokenMutation } from "metabase-enterprise/api";
import { CopyScimInput } from "./ScimInputs";
@@ -26,7 +26,6 @@ export const UserProvisioningFirstEnabledModal = ({
}: UserProvisioningFirstEnabledModalProps) => {
return (
<Modal
- padding="2rem"
size="35rem"
opened={opened}
onClose={onClose}
@@ -48,13 +47,12 @@ export const UserProvisioningFirstEnabledModal = ({
<ScimTextWarning>
{t`Please copy the token and save it somewhere safe. For security reasons, we can't show the token to you again.`}
</ScimTextWarning>
-
- <Flex justify="end">
- <Button variant="filled" onClick={onClose}>
- {t`Done`}
- </Button>
- </Flex>
</Stack>
+ <Modal.Footer>
+ <Button variant="filled" onClick={onClose}>
+ {t`Done`}
+ </Button>
+ </Modal.Footer>
</Modal>
);
};
@@ -110,35 +108,32 @@ export const UserProvisioningRegenerateTokenModal = ({
return (
<Modal
size="35rem"
- padding="2rem"
opened={opened}
onClose={onClose}
title={t`Copy and save the SCIM token`}
>
- <Stack gap="xl" mt="0.5rem">
- <LoadingAndErrorWrapper
- error={regenerateTokenReq.error}
- loading={regenerateTokenReq.isLoading}
- >
- <CopyScimInput
- label={t`SCIM token`}
- value={scimTokenInputText}
- disabled={false}
- />
- <ScimTextWarning>
- {t`Please copy the token and save it somewhere safe. For security reasons, we can't show the token to you again.`}
- </ScimTextWarning>
- </LoadingAndErrorWrapper>
- <Flex justify="end">
- {!regenerateTokenReq.error ? (
- <Button variant="filled" onClick={onClose}>
- {t`Done`}
- </Button>
- ) : (
- <Button onClick={onClose}>{t`Cancel`}</Button>
- )}
- </Flex>
- </Stack>
+ <LoadingAndErrorWrapper
+ error={regenerateTokenReq.error}
+ loading={regenerateTokenReq.isLoading}
+ >
+ <CopyScimInput
+ label={t`SCIM token`}
+ value={scimTokenInputText}
+ disabled={false}
+ />
+ <ScimTextWarning>
+ {t`Please copy the token and save it somewhere safe. For security reasons, we can't show the token to you again.`}
+ </ScimTextWarning>
+ </LoadingAndErrorWrapper>
+ <Modal.Footer>
+ {!regenerateTokenReq.error ? (
+ <Button variant="filled" onClick={onClose}>
+ {t`Done`}
+ </Button>
+ ) : (
+ <Button onClick={onClose}>{t`Cancel`}</Button>
+ )}
+ </Modal.Footer>
</Modal>
);
};
diff --git a/frontend/src/metabase/actions/components/ActionFormFieldWidget/FormInputWidget.tsx b/frontend/src/metabase/actions/components/ActionFormFieldWidget/FormInputWidget.tsx
index 40c01a74463..5262451e402 100644
--- a/frontend/src/metabase/actions/components/ActionFormFieldWidget/FormInputWidget.tsx
+++ b/frontend/src/metabase/actions/components/ActionFormFieldWidget/FormInputWidget.tsx
@@ -30,6 +30,7 @@ export const FormInputWidget = forwardRef(function FormInputWidget(
return (
<FormField
+ mb="lg"
title={title}
description={description}
actions={actions}
diff --git a/frontend/src/metabase/actions/components/ActionFormFieldWidget/FormNumberInputWidget.tsx b/frontend/src/metabase/actions/components/ActionFormFieldWidget/FormNumberInputWidget.tsx
index 8af764f9bb3..03f98e57a96 100644
--- a/frontend/src/metabase/actions/components/ActionFormFieldWidget/FormNumberInputWidget.tsx
+++ b/frontend/src/metabase/actions/components/ActionFormFieldWidget/FormNumberInputWidget.tsx
@@ -28,6 +28,7 @@ export const FormNumberInputWidget = forwardRef(function FormNumberInputWidget(
return (
<FormField
+ mb="lg"
title={title}
actions={actions}
description={description}
diff --git a/frontend/src/metabase/actions/components/ActionFormFieldWidget/FormTextareaWidget.tsx b/frontend/src/metabase/actions/components/ActionFormFieldWidget/FormTextareaWidget.tsx
index 60cba48b3c4..e301295855d 100644
--- a/frontend/src/metabase/actions/components/ActionFormFieldWidget/FormTextareaWidget.tsx
+++ b/frontend/src/metabase/actions/components/ActionFormFieldWidget/FormTextareaWidget.tsx
@@ -30,6 +30,7 @@ export const FormTextareaWidget = forwardRef(function FormTextareaWidget(
return (
<FormField
+ mb="lg"
title={title}
actions={actions}
description={description}
diff --git a/frontend/src/metabase/actions/containers/ActionCreator/ActionCreator.tsx b/frontend/src/metabase/actions/containers/ActionCreator/ActionCreator.tsx
index 27e16094b2d..b2431d48d0d 100644
--- a/frontend/src/metabase/actions/containers/ActionCreator/ActionCreator.tsx
+++ b/frontend/src/metabase/actions/containers/ActionCreator/ActionCreator.tsx
@@ -149,6 +149,7 @@ export function ActionCreator({
{renderEditorBody({ isEditable })}
</ActionCreatorView>
<Modal
+ density="relaxed"
opened={isSaveModalShown}
title={t`New Action`}
onClose={handleCloseNewActionModal}
diff --git a/frontend/src/metabase/actions/containers/ActionCreator/CreateActionForm/CreateActionForm.tsx b/frontend/src/metabase/actions/containers/ActionCreator/CreateActionForm/CreateActionForm.tsx
index 64af64433de..5d82ce07d85 100644
--- a/frontend/src/metabase/actions/containers/ActionCreator/CreateActionForm/CreateActionForm.tsx
+++ b/frontend/src/metabase/actions/containers/ActionCreator/CreateActionForm/CreateActionForm.tsx
@@ -4,7 +4,6 @@ import * as Yup from "yup";
import { FormModelPicker } from "metabase/actions/containers/ActionCreator/FormModelPicker";
import type { CreateQueryActionParams } from "metabase/actions/types";
-import { FormFooter } from "metabase/common/components/FormFooter";
import {
Form,
FormErrorMessage,
@@ -13,7 +12,7 @@ import {
FormTextInput,
FormTextarea,
} from "metabase/forms";
-import { Button } from "metabase/ui";
+import { Button, Modal, Stack } from "metabase/ui";
import * as Errors from "metabase/utils/errors";
const ACTION_SCHEMA = Yup.object({
@@ -60,24 +59,24 @@ function CreateActionForm({
>
{({ isValid }) => (
<Form disabled={!isValid} data-testid="create-action-form">
- <FormTextInput
- name="name"
- label={t`Name`}
- placeholder={t`My new fantastic action`}
- data-autofocus
- mb="lg"
- />
- <FormTextarea
- name="description"
- label={t`Description`}
- placeholder={t`It's optional but oh, so helpful`}
- minRows={5}
- mb="lg"
- nullable
- />
- <FormModelPicker name="model_id" title={t`Model it's saved in`} />
- <FormFooter>
- <FormErrorMessage />
+ <Stack gap="xl">
+ <FormTextInput
+ name="name"
+ label={t`Name`}
+ placeholder={t`My new fantastic action`}
+ data-autofocus
+ />
+ <FormTextarea
+ name="description"
+ label={t`Description`}
+ placeholder={t`It's optional but oh, so helpful`}
+ minRows={5}
+ nullable
+ />
+ <FormModelPicker name="model_id" title={t`Model it's saved in`} />
+ </Stack>
+ <Modal.Footer>
+ <FormErrorMessage flex={1} />
{!!onCancel && (
<Button type="button" onClick={onCancel}>{t`Cancel`}</Button>
)}
@@ -86,7 +85,7 @@ function CreateActionForm({
disabled={!isValid}
variant="filled"
/>
- </FormFooter>
+ </Modal.Footer>
</Form>
)}
</FormProvider>
diff --git a/frontend/src/metabase/actions/containers/ActionCreator/FormModelPicker/FormModelPicker.tsx b/frontend/src/metabase/actions/containers/ActionCreator/FormModelPicker/FormModelPicker.tsx
index 7bfb3ef01f6..c19b4dfa2b9 100644
--- a/frontend/src/metabase/actions/containers/ActionCreator/FormModelPicker/FormModelPicker.tsx
+++ b/frontend/src/metabase/actions/containers/ActionCreator/FormModelPicker/FormModelPicker.tsx
@@ -4,12 +4,12 @@ import { useRef, useState } from "react";
import { t } from "ttag";
import { skipToken, useGetCardQuery } from "metabase/api";
-import { FormField } from "metabase/common/components/FormField";
import {
QuestionPickerModal,
getQuestionPickerValue,
} from "metabase/common/components/Pickers/QuestionPicker";
import { useUniqueId } from "metabase/common/hooks/use-unique-id";
+import { FormField } from "metabase/forms";
import { Button, Icon } from "metabase/ui";
export interface FormModelPickerProps extends HTMLAttributes<HTMLDivElement> {
diff --git a/frontend/src/metabase/admin/databases/components/DatabaseDangerZoneSection/DatabaseDangerZoneSection.tsx b/frontend/src/metabase/admin/databases/components/DatabaseDangerZoneSection/DatabaseDangerZoneSection.tsx
index c574e13887f..c91313b0ceb 100644
--- a/frontend/src/metabase/admin/databases/components/DatabaseDangerZoneSection/DatabaseDangerZoneSection.tsx
+++ b/frontend/src/metabase/admin/databases/components/DatabaseDangerZoneSection/DatabaseDangerZoneSection.tsx
@@ -61,7 +61,6 @@ export const DatabaseDangerZoneSection = ({
title={t`Discard saved field values`}
onClose={saveFieldsModal.close}
onConfirm={handleDiscardFieldValues}
- padding="xxl"
data-testid="discard-field-values-confirm-modal"
/>
</>
diff --git a/frontend/src/metabase/admin/databases/components/DeleteDatabaseModel/DeleteDatabaseModal.tsx b/frontend/src/metabase/admin/databases/components/DeleteDatabaseModel/DeleteDatabaseModal.tsx
index ac5eb833f65..1b3c98e23d2 100644
--- a/frontend/src/metabase/admin/databases/components/DeleteDatabaseModel/DeleteDatabaseModal.tsx
+++ b/frontend/src/metabase/admin/databases/components/DeleteDatabaseModel/DeleteDatabaseModal.tsx
@@ -10,11 +10,11 @@ import {
Box,
type BoxProps,
Button,
- Flex,
Icon,
Input,
Modal,
Stack,
+ Text,
UnstyledButton,
} from "metabase/ui";
import * as Urls from "metabase/urls";
@@ -114,79 +114,80 @@ export const DeleteDatabaseModal = ({
return (
<Modal
+ density="relaxed"
opened={opened}
title={title || t`Delete the ${database.name} database?`}
onClose={onClose}
- padding="xxl"
{...props}
>
<LoadingAndErrorWrapper loading={loading}>
- <Stack
- component="form"
- mt="lg"
- gap="lg"
- onSubmit={canDelete ? handleSubmit : undefined}
- >
- {hasContent && (
- <DeleteDatabaseModalSection isHidden={isContentRemovalConfirmed}>
- <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>
- )}`}
+ <form onSubmit={canDelete ? handleSubmit : undefined}>
+ <Stack gap="xl">
+ {hasContent && (
+ <DeleteDatabaseModalSection isHidden={isContentRemovalConfirmed}>
+ <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>
+ )}
+ {hasContent && (
+ <>
+ <DeleteDatabaseModalSection>
+ {hasMoreThanOneEntityType
+ ? t`Deleting this database will also delete everything based on it. If you’re really trying to do this, please check each of these boxes:`
+ : t`Deleting this database will also delete everything based on it. If you’re really trying to do this, please check the box below:`}
+ </DeleteDatabaseModalSection>
+
+ <DeleteDatabaseModalSection>
+ <ContentRemovalConfirmation
+ usageInfo={usageInfo}
+ onChange={setIsContentRemovalConfirmed}
+ />
+ </DeleteDatabaseModalSection>
+ </>
+ )}
+ <DeleteDatabaseModalSection
+ isHidden={!isContentRemovalConfirmed && hasContent}
+ >
+ <Alert
+ size="compact"
+ icon={<Icon name="warning" />}
+ color="error"
+ >
+ {defaultDatabaseRemovalMessage}
</Alert>
</DeleteDatabaseModalSection>
- )}
- {hasContent && (
- <>
- <DeleteDatabaseModalSection>
- {hasMoreThanOneEntityType
- ? t`Deleting this database will also delete everything based on it. If you’re really trying to do this, please check each of these boxes:`
- : t`Deleting this database will also delete everything based on it. If you’re really trying to do this, please check the box below:`}
- </DeleteDatabaseModalSection>
-
- <DeleteDatabaseModalSection>
- <ContentRemovalConfirmation
- usageInfo={usageInfo}
- onChange={setIsContentRemovalConfirmed}
- />
- </DeleteDatabaseModalSection>
- </>
- )}
- <DeleteDatabaseModalSection
- isHidden={!isContentRemovalConfirmed && hasContent}
- >
- <Alert size="compact" icon={<Icon name="warning" />} color="error">
- {defaultDatabaseRemovalMessage}
- </Alert>
- </DeleteDatabaseModalSection>
- <DeleteDatabaseModalSection
- isHidden={!isContentRemovalConfirmed && hasContent}
- >
- <p>
- {jt`If you’re sure, please type ${(
- <strong key="name">{database.name}</strong>
- )} in this box:`}
- </p>
- <Input
- w="20rem"
- data-testid="database-name-confirmation-input"
- data-autofocus="true"
- placeholder={t`Are you completely sure?`}
- value={databaseNameConfirmation}
- ref={databaseNameConfirmationRef}
- onChange={(e) => setDatabaseNameConfirmation(e.target.value)}
- />
- </DeleteDatabaseModalSection>
- <Flex gap="sm" justify="flex-end" align="center">
+ <DeleteDatabaseModalSection
+ isHidden={!isContentRemovalConfirmed && hasContent}
+ >
+ <p>
+ {jt`If you’re sure, please type ${(
+ <strong key="name">{database.name}</strong>
+ )} in this box:`}
+ </p>
+ <Input
+ w="20rem"
+ data-testid="database-name-confirmation-input"
+ data-autofocus="true"
+ placeholder={t`Are you completely sure?`}
+ value={databaseNameConfirmation}
+ ref={databaseNameConfirmationRef}
+ onChange={(e) => setDatabaseNameConfirmation(e.target.value)}
+ />
+ </DeleteDatabaseModalSection>
+ </Stack>
+ <Modal.Footer>
{errorMessage && (
- <Box c="feedback-negative" px="lg">
+ <Text c="feedback-negative" flex={1}>
{errorMessage}
- </Box>
+ </Text>
)}
<Button type="button" onClick={onClose}>{t`Cancel`}</Button>
<Button
@@ -197,8 +198,8 @@ export const DeleteDatabaseModal = ({
>
{deleteButtonLabel}
</Button>
- </Flex>
- </Stack>
+ </Modal.Footer>
+ </form>
</LoadingAndErrorWrapper>
</Modal>
);
diff --git a/frontend/src/metabase/admin/datamodel/components/SegmentRetireModal.tsx b/frontend/src/metabase/admin/datamodel/components/SegmentRetireModal.tsx
index 83616617056..6e94510d535 100644
--- a/frontend/src/metabase/admin/datamodel/components/SegmentRetireModal.tsx
+++ b/frontend/src/metabase/admin/datamodel/components/SegmentRetireModal.tsx
@@ -1,6 +1,6 @@
import { t } from "ttag";
-import { Button, Flex, Modal, Text } from "metabase/ui";
+import { Button, Modal, Text } from "metabase/ui";
interface SegmentRetireModalProps {
opened: boolean;
@@ -25,17 +25,15 @@ export function SegmentRetireModal({
title={t`Retire this segment?`}
size="lg"
>
- <Flex direction="column">
- <Text>
- {t`Saved questions and other things that depend on this segment will continue to work, but it will no longer be selectable from the query builder.`}
- </Text>
- <Flex justify="flex-end" gap="sm">
- <Button onClick={onClose}>{t`Cancel`}</Button>
- <Button color="negative" variant="filled" onClick={handleRetire}>
- {t`Retire`}
- </Button>
- </Flex>
- </Flex>
+ <Text>
+ {t`Saved questions and other things that depend on this segment will continue to work, but it will no longer be selectable from the query builder.`}
+ </Text>
+ <Modal.Footer>
+ <Button onClick={onClose}>{t`Cancel`}</Button>
+ <Button color="negative" variant="filled" onClick={handleRetire}>
+ {t`Retire`}
+ </Button>
+ </Modal.Footer>
</Modal>
);
}
diff --git a/frontend/src/metabase/admin/people/components/Alert.tsx b/frontend/src/metabase/admin/people/components/Alert.tsx
index be49cfd496c..44a8de4beef 100644
--- a/frontend/src/metabase/admin/people/components/Alert.tsx
+++ b/frontend/src/metabase/admin/people/components/Alert.tsx
@@ -1,6 +1,6 @@
import { t } from "ttag";
-import { Button, Modal, Stack, Text } from "metabase/ui";
+import { Button, Modal, Text } from "metabase/ui";
interface AlertProps {
message?: string | null;
@@ -15,9 +15,9 @@ export const Alert = ({ message, onClose }: AlertProps) => (
withCloseButton={false}
data-testid="alert-modal"
>
- <Stack gap="xl">
- <Text>{message}</Text>
- <Button variant="filled" ml="auto" onClick={onClose}>{t`Ok`}</Button>
- </Stack>
+ <Text>{message}</Text>
+ <Modal.Footer>
+ <Button variant="filled" onClick={onClose}>{t`Ok`}</Button>
+ </Modal.Footer>
</Modal>
);
diff --git a/frontend/src/metabase/admin/people/containers/EditUserModal/EditUserModal.tsx b/frontend/src/metabase/admin/people/containers/EditUserModal/EditUserModal.tsx
index f6b115dffb2..e5fe3ea9448 100644
--- a/frontend/src/metabase/admin/people/containers/EditUserModal/EditUserModal.tsx
+++ b/frontend/src/metabase/admin/people/containers/EditUserModal/EditUserModal.tsx
@@ -60,7 +60,7 @@ export const EditUserModal = ({
};
return (
- <Modal opened title={t`Edit user`} padding="xxl" onClose={onClose}>
+ <Modal density="relaxed" opened title={t`Edit user`} onClose={onClose}>
<LoadingAndErrorWrapper loading={isLoading} error={error}>
<UserForm
onCancel={onClose}
diff --git a/frontend/src/metabase/admin/people/containers/NewUserModal.tsx b/frontend/src/metabase/admin/people/containers/NewUserModal.tsx
index 97f8c4af358..e061c7e382f 100644
--- a/frontend/src/metabase/admin/people/containers/NewUserModal.tsx
+++ b/frontend/src/metabase/admin/people/containers/NewUserModal.tsx
@@ -79,7 +79,7 @@ export const NewUserModal = ({
const title = PLUGIN_TENANTS.getNewUserModalTitle(external) ?? t`Create user`;
return (
- <Modal opened title={title} padding="xxl" onClose={onClose}>
+ <Modal density="relaxed" opened title={title} onClose={onClose}>
<UserForm
external={external}
groups={groups}
diff --git a/frontend/src/metabase/admin/people/containers/UserPasswordResetModal.tsx b/frontend/src/metabase/admin/people/containers/UserPasswordResetModal.tsx
index aca820d1512..b4410509e00 100644
--- a/frontend/src/metabase/admin/people/containers/UserPasswordResetModal.tsx
+++ b/frontend/src/metabase/admin/people/containers/UserPasswordResetModal.tsx
@@ -14,7 +14,7 @@ import { LoadingAndErrorWrapper } from "metabase/common/components/LoadingAndErr
import { PasswordReveal } from "metabase/common/components/PasswordReveal";
import { useToast } from "metabase/common/hooks/use-toast";
import { useDispatch, useSelector } from "metabase/redux";
-import { Button, Flex, Modal, Text, TextInput } from "metabase/ui";
+import { Button, Modal, Text, TextInput } from "metabase/ui";
import { generatePassword } from "metabase/utils/password";
import MetabaseSettings from "metabase/utils/settings";
import type { User } from "metabase-types/api";
@@ -124,22 +124,20 @@ const UserPasswordResetModalInner = ({
onClose={onClose}
size="lg"
>
- <Flex direction="column" gap="xl" mt="lg">
- <Text>{t`Are you sure you want to do this?`}</Text>
- <Flex align="center" justify="flex-end" gap="lg">
- <Button onClick={onClose}>{t`Cancel`}</Button>
- <Button
- variant="filled"
- color="brand"
- onClick={handleGetResetLink}
- >{t`Get reset link`}</Button>
- <Button
- color="negative"
- variant="filled"
- onClick={handleResetConfirm}
- >{t`Reset password`}</Button>
- </Flex>
- </Flex>
+ <Text>{t`Are you sure you want to do this?`}</Text>
+ <Modal.Footer>
+ <Button onClick={onClose}>{t`Cancel`}</Button>
+ <Button
+ variant="filled"
+ color="brand"
+ onClick={handleGetResetLink}
+ >{t`Get reset link`}</Button>
+ <Button
+ color="negative"
+ variant="filled"
+ onClick={handleResetConfirm}
+ >{t`Reset password`}</Button>
+ </Modal.Footer>
</Modal>
);
};
diff --git a/frontend/src/metabase/admin/people/containers/UserSuccessModal.tsx b/frontend/src/metabase/admin/people/containers/UserSuccessModal.tsx
index 63d314789b6..6cf3e095979 100644
--- a/frontend/src/metabase/admin/people/containers/UserSuccessModal.tsx
+++ b/frontend/src/metabase/admin/people/containers/UserSuccessModal.tsx
@@ -67,7 +67,6 @@ export function UserSuccessModal({ params }: UserSuccessModalProps) {
<ConfirmModal
opened
title={t`${user.common_name} has been added`}
- padding="xxl"
onClose={handleClose}
onConfirm={handleClose}
closeButtonText={null}
diff --git a/frontend/src/metabase/admin/permissions/components/LegacyPermissionsModal/LegacyPermissionsModal.tsx b/frontend/src/metabase/admin/permissions/components/LegacyPermissionsModal/LegacyPermissionsModal.tsx
index 2e809246f40..4f86af06bf7 100644
--- a/frontend/src/metabase/admin/permissions/components/LegacyPermissionsModal/LegacyPermissionsModal.tsx
+++ b/frontend/src/metabase/admin/permissions/components/LegacyPermissionsModal/LegacyPermissionsModal.tsx
@@ -4,7 +4,7 @@ import { Link } from "metabase/common/components/Link";
import { useModalOpen } from "metabase/common/hooks/use-modal-open";
import { useSelector } from "metabase/redux";
import { getDocsUrl } from "metabase/selectors/settings";
-import { Button, Flex, Modal, Text } from "metabase/ui";
+import { Button, Group, Modal, Text } from "metabase/ui";
export const LegacyPermissionsModal = ({
isOpen,
@@ -26,13 +26,7 @@ export const LegacyPermissionsModal = ({
onClose={onClose}
size="35rem"
closeOnClickOutside={false}
- padding="2.5rem"
withCloseButton={false}
- styles={{
- body: {
- paddingTop: "2.5rem",
- },
- }}
>
<Text mb="1rem">
{jt`In Metabase 50, we split our data permissions into two new settings: ${(
@@ -51,23 +45,25 @@ export const LegacyPermissionsModal = ({
>{t`Create queries`}</Text>
)}. Having separate settings for what people can view and what they can query makes data permissions more expressive and easier to reason about.`}
</Text>
- <Text mb="1.5rem">
+ <Text>
{t`Your permissions have been automatically converted to the new settings, with no change in data access for your groups.`}
</Text>
- <Flex justify="space-between" align="center">
- <Button
- variant="transparent"
- size="compact-md"
- component={Link}
- to={docsUrl}
- target="_blank"
- >
- {t`Learn more`}
- </Button>
- <Button onClick={onClose} variant="filled">
- {t`Got it`}
- </Button>
- </Flex>
+ <Modal.Footer>
+ <Group justify="space-between" flex={1}>
+ <Button
+ variant="transparent"
+ size="compact-md"
+ component={Link}
+ to={docsUrl}
+ target="_blank"
+ >
+ {t`Learn more`}
+ </Button>
+ <Button onClick={onClose} variant="filled">
+ {t`Got it`}
+ </Button>
+ </Group>
+ </Modal.Footer>
</Modal>
);
};
diff --git a/frontend/src/metabase/admin/permissions/components/PermissionsPageLayout/PermissionsPageLayout.tsx b/frontend/src/metabase/admin/permissions/components/PermissionsPageLayout/PermissionsPageLayout.tsx
index e7ca5ff1eae..5a99c3d66ba 100644
--- a/frontend/src/metabase/admin/permissions/components/PermissionsPageLayout/PermissionsPageLayout.tsx
+++ b/frontend/src/metabase/admin/permissions/components/PermissionsPageLayout/PermissionsPageLayout.tsx
@@ -20,12 +20,7 @@ import { getPermissionsBasePath } from "metabase/common/components/PermissionsBa
import { useDispatch, useSelector } from "metabase/redux";
import { useNavigate } from "metabase/router";
import { useUserSetting } from "metabase/settings";
-import {
- Group,
- Button as NewButton,
- Modal as NewModal,
- Text,
-} from "metabase/ui";
+import { Button as NewButton, Modal as NewModal, Text } from "metabase/ui";
import type { IconName } from "metabase-types/api";
import {
@@ -169,18 +164,17 @@ export function PermissionsPageLayout({
title="Someone just changed permissions"
opened={showRefreshModal}
size="lg"
- padding="2.5rem"
withCloseButton={false}
onClose={() => true}
>
- <Text mb="1rem">
+ <Text>
{t`To edit permissions, you need to start from the latest version. Please refresh the page.`}
</Text>
- <Group justify="flex-end">
+ <NewModal.Footer>
<NewButton onClick={() => location.reload()} variant="filled">
{t`Refresh the page`}
</NewButton>
- </Group>
+ </NewModal.Footer>
</NewModal>
<LegacyPermissionsModal
isOpen={showSplitPermsModal}
diff --git a/frontend/src/metabase/admin/settings/auth/components/GroupMappings/DeleteGroupMappingModal/DeleteGroupMappingModal.tsx b/frontend/src/metabase/admin/settings/auth/components/GroupMappings/DeleteGroupMappingModal/DeleteGroupMappingModal.tsx
index 9af879b64b3..6be294607b6 100644
--- a/frontend/src/metabase/admin/settings/auth/components/GroupMappings/DeleteGroupMappingModal/DeleteGroupMappingModal.tsx
+++ b/frontend/src/metabase/admin/settings/auth/components/GroupMappings/DeleteGroupMappingModal/DeleteGroupMappingModal.tsx
@@ -3,7 +3,7 @@ import { t } from "ttag";
import { useSelector } from "metabase/redux";
import { getApplicationName } from "metabase/selectors/whitelabel";
-import { Box, Button, Group, Modal, Radio, Stack, Text } from "metabase/ui";
+import { Box, Button, Modal, Radio, Stack, Text } from "metabase/ui";
import S from "../GroupMappings.module.css";
import type { DeleteMappingModalValueType } from "../types";
@@ -78,7 +78,7 @@ export const DeleteGroupMappingModal = ({
return (
<Modal opened onClose={onHide} title={t`Remove this group mapping?`}>
- <Stack gap="xl" mt="sm">
+ <Stack gap="xl">
<Box>
<Text fw="bold" className={S.wrappableText}>
{mappingName}
@@ -152,14 +152,13 @@ export const DeleteGroupMappingModal = ({
</Radio.Group>
</Box>
)}
-
- <Group justify="flex-end">
- <Button onClick={onHide}>{t`Cancel`}</Button>
- <Button variant="filled" color="negative" onClick={handleConfirm}>
- {submitButtonLabels[value]}
- </Button>
- </Group>
</Stack>
+ <Modal.Footer>
+ <Button onClick={onHide}>{t`Cancel`}</Button>
+ <Button variant="filled" color="negative" onClick={handleConfirm}>
+ {submitButtonLabels[value]}
+ </Button>
+ </Modal.Footer>
</Modal>
);
};
diff --git a/frontend/src/metabase/admin/settings/components/ApiKeys/CreateApiKeyModal.tsx b/frontend/src/metabase/admin/settings/components/ApiKeys/CreateApiKeyModal.tsx
index dc7f2e3f707..798d54ad383 100644
--- a/frontend/src/metabase/admin/settings/components/ApiKeys/CreateApiKeyModal.tsx
+++ b/frontend/src/metabase/admin/settings/components/ApiKeys/CreateApiKeyModal.tsx
@@ -9,7 +9,7 @@ import {
FormSubmitButton,
FormTextInput,
} from "metabase/forms";
-import { Button, Group, Modal, Paper, Stack, Text } from "metabase/ui";
+import { Button, Modal, Paper, Stack, Text } from "metabase/ui";
import type { CreateApiKeyRequest } from "metabase-types/api";
import { useCreateApiKeyMutation } from "../../api/api-key";
@@ -39,8 +39,8 @@ export const CreateApiKeyModal = ({ onClose }: { onClose: () => void }) => {
if (response.isUninitialized || response.isLoading || response.isError) {
return (
<Modal
+ density="relaxed"
size="40rem"
- padding="xxl"
opened
onClose={onClose}
title={t`Create a new API key`}
@@ -51,7 +51,7 @@ export const CreateApiKeyModal = ({ onClose }: { onClose: () => void }) => {
onSubmit={handleSubmit}
>
<Form data-testid="create-api-key-modal">
- <Stack gap="xxl">
+ <Stack gap="xl">
<FormTextInput
name="name"
label={t`Key name`}
@@ -76,12 +76,12 @@ export const CreateApiKeyModal = ({ onClose }: { onClose: () => void }) => {
>
<Text c="text-secondary">{t`We don't version the Metabase API. We rarely change API endpoints, and almost never remove them, but if you write code that relies on the API, there's a chance you might have to update your code in the future.`}</Text>
</Paper>
- <FormErrorMessage />
- <Group justify="flex-end">
- <Button onClick={onClose}>{t`Cancel`}</Button>
- <FormSubmitButton variant="filled" label={t`Create`} />
- </Group>
</Stack>
+ <Modal.Footer>
+ <FormErrorMessage flex={1} />
+ <Button onClick={onClose}>{t`Cancel`}</Button>
+ <FormSubmitButton variant="filled" label={t`Create`} />
+ </Modal.Footer>
</Form>
</FormProvider>
</Modal>
diff --git a/frontend/src/metabase/admin/settings/components/ApiKeys/DeleteApiKeyModal.tsx b/frontend/src/metabase/admin/settings/components/ApiKeys/DeleteApiKeyModal.tsx
index e17bec3c088..1ddaa021f57 100644
--- a/frontend/src/metabase/admin/settings/components/ApiKeys/DeleteApiKeyModal.tsx
+++ b/frontend/src/metabase/admin/settings/components/ApiKeys/DeleteApiKeyModal.tsx
@@ -7,7 +7,7 @@ import {
FormProvider,
FormSubmitButton,
} from "metabase/forms";
-import { Button, Group, Modal, Stack, Text } from "metabase/ui";
+import { Button, Modal, Text } from "metabase/ui";
import type { ApiKey } from "metabase-types/api";
import { useDeleteApiKeyMutation } from "../../api/api-key";
@@ -30,18 +30,16 @@ export const DeleteApiKeyModal = ({
<Modal size="30rem" opened onClose={onClose} title={t`Delete API key`}>
<FormProvider initialValues={{}} onSubmit={handleDelete}>
<Form>
- <Stack gap="xl">
- <Text>{t`You won't be able to recover a deleted API key. You'll have to create a new key.`}</Text>
- <FormErrorMessage />
- <Group justify="flex-end">
- <Button onClick={onClose}>{t`No, don't delete`}</Button>
- <FormSubmitButton
- label={t`Delete API key`}
- variant="filled"
- color="negative"
- />
- </Group>
- </Stack>
+ <Text>{t`You won't be able to recover a deleted API key. You'll have to create a new key.`}</Text>
+ <Modal.Footer>
+ <FormErrorMessage flex={1} />
+ <Button onClick={onClose}>{t`No, don't delete`}</Button>
+ <FormSubmitButton
+ label={t`Delete API key`}
+ variant="filled"
+ color="negative"
+ />
+ </Modal.Footer>
</Form>
</FormProvider>
</Modal>
diff --git a/frontend/src/metabase/admin/settings/components/ApiKeys/EditApiKeyModal.tsx b/frontend/src/metabase/admin/settings/components/ApiKeys/EditApiKeyModal.tsx
index 52f082eecbc..99f1e12d915 100644
--- a/frontend/src/metabase/admin/settings/components/ApiKeys/EditApiKeyModal.tsx
+++ b/frontend/src/metabase/admin/settings/components/ApiKeys/EditApiKeyModal.tsx
@@ -42,7 +42,6 @@ const RegenerateKeyModal = ({
return (
<Modal
size="40rem"
- padding="xxl"
opened
onClose={() => setModal("edit")}
title={t`Regenerate API key`}
@@ -76,14 +75,14 @@ const RegenerateKeyModal = ({
>
<Text c="text-secondary">{t`Metabase will replace the existing API key with a new key. You won't be able to recover the old key.`}</Text>
</Paper>
- <FormErrorMessage />
- <Group justify="flex-end">
- <Button
- onClick={() => setModal("edit")}
- >{t`No, don't regenerate`}</Button>
- <FormSubmitButton variant="filled" label={t`Regenerate`} />
- </Group>
</Stack>
+ <Modal.Footer>
+ <FormErrorMessage flex={1} />
+ <Button
+ onClick={() => setModal("edit")}
+ >{t`No, don't regenerate`}</Button>
+ <FormSubmitButton variant="filled" label={t`Regenerate`} />
+ </Modal.Footer>
</Form>
</FormProvider>
</Modal>
@@ -131,7 +130,7 @@ export const EditApiKeyModal = ({
return (
<Modal
size="40rem"
- padding="xxl"
+ density="relaxed"
opened
onClose={onClose}
title={t`Edit API key`}
@@ -143,7 +142,7 @@ export const EditApiKeyModal = ({
>
{({ dirty }) => (
<Form>
- <Stack gap="xxl">
+ <Stack gap="xl">
<FormTextInput name="name" label={t`Key name`} required />
<FormGroupWidget
name="group_id"
@@ -163,12 +162,14 @@ export const EditApiKeyModal = ({
}}
disabled
/>
- <FormErrorMessage />
- <Group justify="space-between">
+ </Stack>
+ <Modal.Footer>
+ <Group justify="space-between" flex={1}>
<Button
onClick={() => setModal("regenerate")}
>{t`Regenerate API key`}</Button>
- <Group justify="flex-end">
+ <Group>
+ <FormErrorMessage />
<Button onClick={onClose}>{t`Cancel`}</Button>
<FormSubmitButton
disabled={!dirty}
@@ -177,7 +178,7 @@ export const EditApiKeyModal = ({
/>
</Group>
</Group>
- </Stack>
+ </Modal.Footer>
</Form>
)}
</FormProvider>
diff --git a/frontend/src/metabase/admin/settings/components/ApiKeys/SecretKeyModal.tsx b/frontend/src/metabase/admin/settings/components/ApiKeys/SecretKeyModal.tsx
index c1548630666..eb78d90ef88 100644
--- a/frontend/src/metabase/admin/settings/components/ApiKeys/SecretKeyModal.tsx
+++ b/frontend/src/metabase/admin/settings/components/ApiKeys/SecretKeyModal.tsx
@@ -4,7 +4,6 @@ import {
ActionIcon,
Button,
CopyButton,
- Group,
Icon,
Modal,
Stack,
@@ -53,9 +52,9 @@ export const SecretKeyModal = ({
</CopyButton>
}
/>
- <Group justify="flex-end">
- <Button onClick={onClose} variant="filled">{t`Done`}</Button>
- </Group>
</Stack>
+ <Modal.Footer>
+ <Button onClick={onClose} variant="filled">{t`Done`}</Button>
+ </Modal.Footer>
</Modal>
);
diff --git a/frontend/src/metabase/admin/settings/components/CloudPanel/MigrationInProgress.tsx b/frontend/src/metabase/admin/settings/components/CloudPanel/MigrationInProgress.tsx
index c7bbc3661a6..f196f4ce405 100644
--- a/frontend/src/metabase/admin/settings/components/CloudPanel/MigrationInProgress.tsx
+++ b/frontend/src/metabase/admin/settings/components/CloudPanel/MigrationInProgress.tsx
@@ -118,16 +118,15 @@ export const MigrationInProgress = ({
size="lg"
data-testid="cancel-cloud-migration-confirmation"
title={t`Cancel migration?`}
- padding="2rem"
>
- <Text mt="lg">{t`We will cancel the migration process. After that, this instance will no longer be read-only.`}</Text>
- <Flex justify="end" mt="3.5rem">
+ <Text>{t`We will cancel the migration process. After that, this instance will no longer be read-only.`}</Text>
+ <Modal.Footer>
<Button
variant="filled"
color="negative"
onClick={handleCancelMigration}
>{t`Cancel migration`}</Button>
- </Flex>
+ </Modal.Footer>
</Modal>
</>
);
diff --git a/frontend/src/metabase/admin/settings/components/Email/BaseSMTPConnectionForm.tsx b/frontend/src/metabase/admin/settings/components/Email/BaseSMTPConnectionForm.tsx
index dd026f4c629..6b287b3ed6f 100644
--- a/frontend/src/metabase/admin/settings/components/Email/BaseSMTPConnectionForm.tsx
+++ b/frontend/src/metabase/admin/settings/components/Email/BaseSMTPConnectionForm.tsx
@@ -18,7 +18,7 @@ import {
useGetSettingsQuery,
} from "metabase/settings";
import { SetByEnvVarWrapper } from "metabase/settings-components";
-import { Box, Button, Chip, Flex, Modal, Stack } from "metabase/ui";
+import { Box, Button, Chip, Modal, Stack } from "metabase/ui";
import * as Errors from "metabase/utils/errors";
import type { SettingDefinitionMap, SettingKey } from "metabase-types/api";
@@ -189,13 +189,13 @@ export const BaseSMTPConnectionForm = ({
return (
<Modal
+ density="relaxed"
title={t`SMTP Configuration`}
opened
onClose={onClose}
- padding="xxl"
data-testid={dataTestId}
>
- <Box data-testid="settings-updates" pt="xl">
+ <Box data-testid="settings-updates">
<FormProvider
initialValues={initialValues}
validationSchema={getFormValueSchema(
@@ -231,7 +231,6 @@ export const BaseSMTPConnectionForm = ({
<FormChipGroup
name={getFullFormKey("port")}
label={t`SMTP Port`}
- groupProps={{ mt: "0.5rem" }}
>
<Chip value={"465"} variant="filled">
465
@@ -259,7 +258,6 @@ export const BaseSMTPConnectionForm = ({
<FormChipGroup
name={getFullFormKey("security")}
label={t`SMTP Security`}
- groupProps={{ mt: "0.5rem" }}
>
{securityOptions.map(({ value, label }) => (
<Chip key={value} value={value} variant="filled">
@@ -291,22 +289,21 @@ export const BaseSMTPConnectionForm = ({
placeholder={"Shhh..."}
/>
</SetByEnvVarWrapper>
-
- <Flex mt="1rem" gap="lg" justify="end">
- <Button
- onClick={handleClearEmailSettings}
- disabled={allSetByEnvVars || isSubmitting}
- >
- {t`Clear`}
- </Button>
- <FormSubmitButton
- label={t`Save changes`}
- disabled={!dirty || !isValid || isSubmitting}
- loading={isSubmitting}
- variant="filled"
- />
- </Flex>
</Stack>
+ <Modal.Footer>
+ <Button
+ onClick={handleClearEmailSettings}
+ disabled={allSetByEnvVars || isSubmitting}
+ >
+ {t`Clear`}
+ </Button>
+ <FormSubmitButton
+ label={t`Save changes`}
+ disabled={!dirty || !isValid || isSubmitting}
+ loading={isSubmitting}
+ variant="filled"
+ />
+ </Modal.Footer>
</Form>
)}
</FormProvider>
diff --git a/frontend/src/metabase/admin/settings/components/widgets/Notifications/CreateWebhookModal.tsx b/frontend/src/metabase/admin/settings/components/widgets/Notifications/CreateWebhookModal.tsx
index 48d7dafc94e..177acb1caee 100644
--- a/frontend/src/metabase/admin/settings/components/widgets/Notifications/CreateWebhookModal.tsx
+++ b/frontend/src/metabase/admin/settings/components/widgets/Notifications/CreateWebhookModal.tsx
@@ -52,10 +52,10 @@ export const CreateWebhookModal = ({
return (
<Modal
+ density="relaxed"
opened={isOpen}
onClose={onClose}
size="36rem"
- padding="2.5rem"
title={t`New webhook destination`}
>
<WebhookForm
diff --git a/frontend/src/metabase/admin/settings/components/widgets/Notifications/EditWebhookModal.tsx b/frontend/src/metabase/admin/settings/components/widgets/Notifications/EditWebhookModal.tsx
index 8a214675540..33180ca2e67 100644
--- a/frontend/src/metabase/admin/settings/components/widgets/Notifications/EditWebhookModal.tsx
+++ b/frontend/src/metabase/admin/settings/components/widgets/Notifications/EditWebhookModal.tsx
@@ -71,10 +71,10 @@ export const EditWebhookModal = ({
return (
<Modal
+ density="relaxed"
opened={isOpen}
onClose={onClose}
size="36rem"
- padding="2.5rem"
title={t`Edit this webhook`}
>
<WebhookForm
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 b41e5e06fb6..b4af1c5c828 100644
--- a/frontend/src/metabase/admin/settings/components/widgets/Notifications/WebhookForm.tsx
+++ b/frontend/src/metabase/admin/settings/components/widgets/Notifications/WebhookForm.tsx
@@ -21,9 +21,10 @@ import {
Button,
Chip,
Flex,
- Group,
Icon,
+ Modal,
ScrollArea,
+ Stack,
Title,
} from "metabase/ui";
import { getResponseErrorMessage } from "metabase/utils/errors";
@@ -123,7 +124,6 @@ const renderAuthSection = (type: string) => {
label={t`Username`}
placeholder="[email protected]"
{...styles}
- mb="1.5rem"
/>
<FormTextInput
name="auth-password"
@@ -140,17 +140,12 @@ const renderAuthSection = (type: string) => {
label={t`Bearer token`}
placeholder={t`Secret Token`}
{...styles}
- mb="1.5rem"
/>
);
case "api-key":
return (
- <Flex direction="column">
- <FormChipGroup
- name="auth-method"
- label={t`Add to`}
- groupProps={{ mb: "1.5rem", mt: "0.5rem" }}
- >
+ <Stack gap="xl">
+ <FormChipGroup name="auth-method" label={t`Add to`}>
<Chip value="header" variant="filled">
{t`Header`}
</Chip>
@@ -164,7 +159,6 @@ const renderAuthSection = (type: string) => {
label={t`Key`}
placeholder={t`X-API-KEY`}
{...styles}
- mb="1.5rem"
/>
<FormTextInput
name="auth-info-value"
@@ -173,7 +167,7 @@ const renderAuthSection = (type: string) => {
{...styles}
/>
</Flex>
- </Flex>
+ </Stack>
);
default:
return null;
@@ -243,125 +237,118 @@ export const WebhookForm = ({
>
{({ dirty, values, setFieldError, setFieldValue }) => (
<Form>
- <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>
- )}`}
- </Alert>
- <Box mb="1.5rem">
- <Flex align="end" gap="1rem">
- <FormTextInput
- name="url"
- label={t`Webhook URL`}
- placeholder="http://hooks.example.com/hooks/catch/"
- style={{ flexGrow: 1 }}
- {...styles}
- maw="21rem"
- />
- <Button
- size="lg"
- onClick={() => handleTest(values, setFieldError)}
- >
- {testButtonLabel}
- </Button>
- </Flex>
- {!!errorData && (
- <ScrollArea.Autosize mah={200} mt="0.75rem">
- <Title order={6} mb="0.75rem" lh="1rem">
- {c("The response returned by an API Request")
- .t`Test response`}
- </Title>
- <Box
- py="0.5rem"
- px="1.5rem"
- bg="background_page-secondary"
- style={{ borderRadius: "0.5rem" }}
- data-testid="notification-test-response"
+ <Stack gap="xl">
+ <Alert size="compact" variant="light">
+ {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>
+ )}`}
+ </Alert>
+ <Box>
+ <Flex align="end" gap="1rem">
+ <FormTextInput
+ name="url"
+ label={t`Webhook URL`}
+ placeholder="http://hooks.example.com/hooks/catch/"
+ style={{ flexGrow: 1 }}
+ {...styles}
+ maw="21rem"
+ />
+ <Button
+ size="lg"
+ onClick={() => handleTest(values, setFieldError)}
>
- <pre
- style={{
- margin: 0,
- fontSize: "0.75rem",
- lineHeight: "1rem",
- whiteSpace: "pre-wrap",
- }}
+ {testButtonLabel}
+ </Button>
+ </Flex>
+ {!!errorData && (
+ <ScrollArea.Autosize mah={200} mt="0.75rem">
+ <Title order={6} mb="0.75rem" lh="1rem">
+ {c("The response returned by an API Request")
+ .t`Test response`}
+ </Title>
+ <Box
+ py="0.5rem"
+ px="1.5rem"
+ bg="background_page-secondary"
+ style={{ borderRadius: "0.5rem" }}
+ data-testid="notification-test-response"
>
- {JSON.stringify(errorData, null, 2)}
- </pre>
- </Box>
- </ScrollArea.Autosize>
- )}
- </Box>
+ <pre
+ style={{
+ margin: 0,
+ fontSize: "0.75rem",
+ lineHeight: "1rem",
+ whiteSpace: "pre-wrap",
+ }}
+ >
+ {JSON.stringify(errorData, null, 2)}
+ </pre>
+ </Box>
+ </ScrollArea.Autosize>
+ )}
+ </Box>
- <FormTextInput
- name="name"
- label={t`Give it a name`}
- placeholder={t`Something descriptive`}
- {...styles}
- mb="1.5rem"
- maw="14.5rem"
- />
- <FormTextInput
- name="description"
- label={t`Description`}
- placeholder={t`Where is this going and what does it send?`}
- {...styles}
- mb="1.5rem"
- maw="21rem"
- />
- <FormChipGroup
- name="fe-form-type"
- label={t`Authentication method`}
- groupProps={{ mb: "1.5rem", mt: "0.5rem" }}
- onChange={(val) => {
- if (val === "none") {
- setFieldValue("auth-method", "none");
- } else {
- setFieldValue("auth-method", "header");
- }
- }}
- >
- <Chip value="none" variant="filled">
- {t`None`}
- </Chip>
- <Chip value="basic" variant="filled">
- {t`Basic`}
- </Chip>
- <Chip value="bearer" variant="filled">
- {t`Bearer`}
- </Chip>
- <Chip value="api-key" variant="filled">
- {t`API Key`}
- </Chip>
- </FormChipGroup>
+ <FormTextInput
+ name="name"
+ label={t`Give it a name`}
+ placeholder={t`Something descriptive`}
+ {...styles}
+ maw="14.5rem"
+ />
+ <FormTextInput
+ name="description"
+ label={t`Description`}
+ placeholder={t`Where is this going and what does it send?`}
+ {...styles}
+ maw="21rem"
+ />
+ <FormChipGroup
+ name="fe-form-type"
+ label={t`Authentication method`}
+ onChange={(val) => {
+ if (val === "none") {
+ setFieldValue("auth-method", "none");
+ } else {
+ setFieldValue("auth-method", "header");
+ }
+ }}
+ >
+ <Chip value="none" variant="filled">
+ {t`None`}
+ </Chip>
+ <Chip value="basic" variant="filled">
+ {t`Basic`}
+ </Chip>
+ <Chip value="bearer" variant="filled">
+ {t`Bearer`}
+ </Chip>
+ <Chip value="api-key" variant="filled">
+ {t`API Key`}
+ </Chip>
+ </FormChipGroup>
- {renderAuthSection(values["fe-form-type"])}
+ {renderAuthSection(values["fe-form-type"])}
+ </Stack>
- <Flex
- mt="1.5rem"
- justify={onDelete ? "space-between" : "end"}
- align="center"
- gap="0.75rem"
- >
+ <Modal.Footer>
{onDelete && (
<Button
variant="transparent"
size="compact-md"
leftSection={<Icon name="trash" />}
onClick={onDelete}
+ mr="auto"
>{t`Delete this destination`}</Button>
)}
- <Group>
- <Button onClick={onCancel}>{t`Cancel`}</Button>
- <FormSubmitButton
- disabled={!dirty}
- label={submitLabel}
- variant="filled"
- />
- </Group>
- </Flex>
+ <Button onClick={onCancel}>{t`Cancel`}</Button>
+ <FormSubmitButton
+ disabled={!dirty}
+ label={submitLabel}
+ variant="filled"
+ />
+ </Modal.Footer>
</Form>
)}
</FormProvider>
diff --git a/frontend/src/metabase/collections/components/ModelUploadModal.tsx b/frontend/src/metabase/collections/components/ModelUploadModal.tsx
index 99839b91208..b7a7de86789 100644
--- a/frontend/src/metabase/collections/components/ModelUploadModal.tsx
+++ b/frontend/src/metabase/collections/components/ModelUploadModal.tsx
@@ -4,16 +4,7 @@ import { t } from "ttag";
import { useListCollectionItemsQuery } from "metabase/api";
import type { OnFileUpload } from "metabase/common/collections/types";
import { UploadMode } from "metabase/redux/store/upload";
-import {
- Button,
- Flex,
- Icon,
- Modal,
- Radio,
- Select,
- Stack,
- Text,
-} from "metabase/ui";
+import { Button, Icon, Modal, Radio, Select, Stack, Text } from "metabase/ui";
import type { CollectionId, TableId } from "metabase-types/api";
import { findLastEditedCollectionItem } from "./utils";
@@ -101,11 +92,12 @@ export function ModelUploadModal({
return (
<Modal
+ density="relaxed"
opened={opened}
title={t`Select upload destination`}
onClose={onClose}
>
- <Stack mb="xl">
+ <Stack gap="xl">
<Text>
{t`If your CSV has the same columns as a model from a previously uploaded file, you can append data to that model. Otherwise, you can create a new model.`}
</Text>
@@ -144,12 +136,12 @@ export function ModelUploadModal({
)}
</Stack>
- <Flex justify="flex-end" gap="sm">
+ <Modal.Footer>
<Button onClick={onClose}>{t`Cancel`}</Button>
<Button onClick={handleUpload} variant="filled" disabled={!isFormValid}>
{buttonText}
</Button>
- </Flex>
+ </Modal.Footer>
</Modal>
);
}
diff --git a/frontend/src/metabase/common/CreateDashboard/CreateDashboardForm.tsx b/frontend/src/metabase/common/CreateDashboard/CreateDashboardForm.tsx
index 09b71716f7f..ff13c3bc0ec 100644
--- a/frontend/src/metabase/common/CreateDashboard/CreateDashboardForm.tsx
+++ b/frontend/src/metabase/common/CreateDashboard/CreateDashboardForm.tsx
@@ -5,7 +5,6 @@ import * as Yup from "yup";
import { useCreateDashboardMutation } from "metabase/api";
import FormCollectionPicker from "metabase/common/collections/containers/FormCollectionPicker/FormCollectionPicker";
import { useInitialCollectionId } from "metabase/common/collections/hooks";
-import { FormFooter } from "metabase/common/components/FormFooter";
import {
DASHBOARD_DESCRIPTION_MAX_LENGTH,
DASHBOARD_NAME_MAX_LENGTH,
@@ -18,7 +17,7 @@ import {
FormTextInput,
FormTextarea,
} from "metabase/forms";
-import { Button, Stack } from "metabase/ui";
+import { Button, Modal, Stack } from "metabase/ui";
import * as Errors from "metabase/utils/errors";
import type { CollectionId, Dashboard } from "metabase-types/api";
@@ -96,40 +95,40 @@ export function CreateDashboardForm({
onSubmit={handleCreate}
>
{() => (
- <Form as={Stack} gap={0}>
- <FormTextInput
- labelProps={{ mb: "xxs" }}
- name="name"
- label={t`Name`}
- placeholder={t`What is the name of your dashboard?`}
- data-autofocus
- mt="lg"
- />
- <FormTextarea
- labelProps={{ mb: "xxs" }}
- name="description"
- label={t`Description`}
- placeholder={t`It's optional but oh, so helpful`}
- nullable
- autosize={false}
- minRows={5}
- maxRows={5}
- my="lg"
- />
- {!hasTargetCollection && (
- <FormCollectionPicker
- name="collection_id"
- title={t`Which collection should this go in?`}
- entityType="dashboard"
+ <Form>
+ <Stack gap="xl">
+ <FormTextInput
+ labelProps={{ mb: "xxs" }}
+ name="name"
+ label={t`Name`}
+ placeholder={t`What is the name of your dashboard?`}
+ data-autofocus
/>
- )}
- <FormFooter mt="lg">
- <FormErrorMessage inline />
+ <FormTextarea
+ labelProps={{ mb: "xxs" }}
+ name="description"
+ label={t`Description`}
+ placeholder={t`It's optional but oh, so helpful`}
+ nullable
+ autosize={false}
+ minRows={5}
+ maxRows={5}
+ />
+ {!hasTargetCollection && (
+ <FormCollectionPicker
+ name="collection_id"
+ title={t`Which collection should this go in?`}
+ entityType="dashboard"
+ />
+ )}
+ </Stack>
+ <Modal.Footer>
+ <FormErrorMessage flex={1} />
{!!onCancel && (
<Button type="button" onClick={onCancel}>{t`Cancel`}</Button>
)}
<FormSubmitButton label={t`Create`} variant="filled" />
- </FormFooter>
+ </Modal.Footer>
</Form>
)}
</FormProvider>
diff --git a/frontend/src/metabase/common/CreateDashboard/CreateDashboardModal.tsx b/frontend/src/metabase/common/CreateDashboard/CreateDashboardModal.tsx
index 42b7d0edf4a..2f55bcffbe2 100644
--- a/frontend/src/metabase/common/CreateDashboard/CreateDashboardModal.tsx
+++ b/frontend/src/metabase/common/CreateDashboard/CreateDashboardModal.tsx
@@ -38,6 +38,7 @@ export const CreateDashboardModal = ({
return (
<Modal
+ density="relaxed"
title={t`New dashboard`}
onClose={() => onClose?.()}
data-testid="new-dashboard-modal"
diff --git a/frontend/src/metabase/common/collections/components/CollectionRowModal/EditCollectionModal/EditCollectionModal.tsx b/frontend/src/metabase/common/collections/components/CollectionRowModal/EditCollectionModal/EditCollectionModal.tsx
index 9f3334e3814..87a13cadd69 100644
--- a/frontend/src/metabase/common/collections/components/CollectionRowModal/EditCollectionModal/EditCollectionModal.tsx
+++ b/frontend/src/metabase/common/collections/components/CollectionRowModal/EditCollectionModal/EditCollectionModal.tsx
@@ -21,7 +21,7 @@ import {
FormTextInput,
FormTextarea,
} from "metabase/forms";
-import { Button, Group, Modal, Stack } from "metabase/ui";
+import { Button, Modal, Stack } from "metabase/ui";
import type { Collection, CollectionItem } from "metabase-types/api";
type EditCollectionModalProps = {
@@ -75,10 +75,10 @@ export function EditCollectionModal(props: EditCollectionModalProps) {
return (
<Modal
+ density="relaxed"
title={t`Editing ${collection.name}`}
opened
onClose={onClose}
- padding="xxl"
onKeyDown={stopPropagation}
>
<FormProvider
@@ -89,7 +89,7 @@ export function EditCollectionModal(props: EditCollectionModalProps) {
>
{({ dirty }) => (
<Form>
- <Stack gap="xl" mt="sm">
+ <Stack gap="xl">
<FormTextInput
name="name"
label={t`Name`}
@@ -115,16 +115,16 @@ export function EditCollectionModal(props: EditCollectionModalProps) {
disableRecentLogging: true,
}}
/>
- <Group justify="flex-end">
- <FormErrorMessage />
- <Button onClick={onClose}>{t`Cancel`}</Button>
- <FormSubmitButton
- label={t`Save`}
- variant="filled"
- disabled={!dirty}
- />
- </Group>
</Stack>
+ <Modal.Footer>
+ <FormErrorMessage flex={1} />
+ <Button onClick={onClose}>{t`Cancel`}</Button>
+ <FormSubmitButton
+ label={t`Save`}
+ variant="filled"
+ disabled={!dirty}
+ />
+ </Modal.Footer>
</Form>
)}
</FormProvider>
diff --git a/frontend/src/metabase/common/collections/components/CreateCollectionForm/CreateCollectionForm.tsx b/frontend/src/metabase/common/collections/components/CreateCollectionForm/CreateCollectionForm.tsx
index dc82e805ed7..a08837d2916 100644
--- a/frontend/src/metabase/common/collections/components/CreateCollectionForm/CreateCollectionForm.tsx
+++ b/frontend/src/metabase/common/collections/components/CreateCollectionForm/CreateCollectionForm.tsx
@@ -5,7 +5,6 @@ import * as Yup from "yup";
import { skipToken, useGetCollectionQuery } from "metabase/api";
import FormCollectionPicker from "metabase/common/collections/containers/FormCollectionPicker";
import { useInitialCollectionId } from "metabase/common/collections/hooks";
-import { FormFooter } from "metabase/common/components/FormFooter";
import type {
EntityPickerOptions,
FilterItemsInPersonalCollection,
@@ -21,11 +20,11 @@ import {
} from "metabase/forms";
import { PLUGIN_TENANTS } from "metabase/plugins";
import { useLocation, useParams } from "metabase/router";
-import { Button, Flex } from "metabase/ui";
+import { Button, Modal, Stack } from "metabase/ui";
import * as Errors from "metabase/utils/errors";
import type { Collection, CollectionNamespace } from "metabase-types/api";
-import { FormAuthorityLevelField } from "../../containers/FormAuthorityLevelFieldContainer";
+import { FormAuthorityLevelField } from "../../containers/FormAuthorityLevelField";
const COLLECTION_SCHEMA = Yup.object({
name: Yup.string()
@@ -132,51 +131,48 @@ function CreateCollectionForm({
return (
<Form>
- <FormTextInput
- name="name"
- label={t`Name`}
- placeholder={t`My new fantastic collection`}
- data-autofocus
- mb="lg"
- />
- <FormTextarea
- name="description"
- label={t`Description`}
- placeholder={t`It's optional but oh, so helpful`}
- minRows={5}
- mb="lg"
- nullable
- />
- {showCollectionPicker && (
- <FormCollectionPicker
- collectionPickerModalProps={{
- options: pickerOptions,
- namespaces,
- }}
- entityType="collection"
- filterPersonalCollections={filterPersonalCollections}
- mb="1rem"
- name="parent_id"
- onCollectionSelect={setSelectedParentCollection}
- title={t`Collection it's saved in`}
+ <Stack gap="xl">
+ <FormTextInput
+ name="name"
+ label={t`Name`}
+ placeholder={t`My new fantastic collection`}
+ data-autofocus
/>
- )}
- {showAuthorityLevelPicker && !isParentTenantCollection && (
- <FormAuthorityLevelField />
- )}
- <FormFooter mt="xl">
- <FormErrorMessage />
- <Flex style={{ flexShrink: 1 }} justify="flex-end" gap="sm">
- {!!onCancel && (
- <Button type="button" onClick={onCancel}>{t`Cancel`}</Button>
- )}
- <FormSubmitButton
- label={t`Create`}
- disabled={!dirty}
- variant="filled"
+ <FormTextarea
+ name="description"
+ label={t`Description`}
+ placeholder={t`It's optional but oh, so helpful`}
+ minRows={5}
+ nullable
+ />
+ {showCollectionPicker && (
+ <FormCollectionPicker
+ collectionPickerModalProps={{
+ options: pickerOptions,
+ namespaces,
+ }}
+ entityType="collection"
+ filterPersonalCollections={filterPersonalCollections}
+ name="parent_id"
+ onCollectionSelect={setSelectedParentCollection}
+ title={t`Collection it's saved in`}
/>
- </Flex>
- </FormFooter>
+ )}
+ {showAuthorityLevelPicker && !isParentTenantCollection && (
+ <FormAuthorityLevelField />
+ )}
+ </Stack>
+ <Modal.Footer>
+ <FormErrorMessage flex={1} />
+ {!!onCancel && (
+ <Button type="button" onClick={onCancel}>{t`Cancel`}</Button>
+ )}
+ <FormSubmitButton
+ label={t`Create`}
+ disabled={!dirty}
+ variant="filled"
+ />
+ </Modal.Footer>
</Form>
);
}}
diff --git a/frontend/src/metabase/common/collections/components/QuestionMoveConfirmModal.tsx b/frontend/src/metabase/common/collections/components/QuestionMoveConfirmModal.tsx
index 7ca67df47fc..752d917b690 100644
--- a/frontend/src/metabase/common/collections/components/QuestionMoveConfirmModal.tsx
+++ b/frontend/src/metabase/common/collections/components/QuestionMoveConfirmModal.tsx
@@ -4,7 +4,16 @@ import { jt, msgid, ngettext, t } from "ttag";
import { first } from "underscore";
import { useGetMultipleCardsDashboardsQuery } from "metabase/api";
-import { Button, Flex, List, Loader, Modal, Text, Title } from "metabase/ui";
+import {
+ Button,
+ Flex,
+ List,
+ Loader,
+ Modal,
+ Stack,
+ Text,
+ Title,
+} from "metabase/ui";
import type {
CardId,
Collection,
@@ -125,54 +134,58 @@ export const QuestionMoveConfirmModal = ({
return (
<>
<Text>{t`This question currently appears in a dashboard that you don't have permission to edit.`}</Text>
- <Flex justify="end" gap="1rem" mt="1rem">
+ <Modal.Footer>
<Button onClick={onClose}>{t`Okay`}</Button>
- </Flex>
+ </Modal.Footer>
</>
);
} else {
return (
<>
- <Text my="0.5rem">{t`Moving a question into a dashboard removes it from all other dashboards it appears in`}</Text>
- <List>
- {cardsThatAppearInOtherDashboards.map((cd) => {
- const card = selectedItems.find(
- (item) => item.id === cd.card_id && item.model === "card",
- );
-
- const dashboardNames = cd.dashboards
- .filter((d) => d.id !== destination.id)
- .map((d) => d.name);
-
- return (
- <List.Item key={`card-${cd.card_id}`}>
- <Text>{jt`${(
- <Text key="name" component="span" fw={700}>
- {card?.name}
- </Text>
- )} will be removed from ${(
- <DashboardNames key="names" names={dashboardNames} />
- )}`}</Text>
- </List.Item>
- );
- })}
- </List>
-
- <Flex justify="space-between" mt="1rem">
- <Text c="feedback-negative">{errorMessage}</Text>
- <Flex justify="end" gap="1rem">
- <Button variant="subtle" color="neutral" onClick={onClose}>
- {t`Cancel`}
- </Button>
- <Button variant="filled" onClick={onConfirm}>
- {ngettext(
- msgid`Move it`,
- `Move them`,
- cardsThatAppearInOtherDashboards.length,
- )}
- </Button>
- </Flex>
- </Flex>
+ <Stack gap="sm">
+ <Text>{t`Moving a question into a dashboard removes it from all other dashboards it appears in`}</Text>
+ <List>
+ {cardsThatAppearInOtherDashboards.map((cd) => {
+ const card = selectedItems.find(
+ (item) => item.id === cd.card_id && item.model === "card",
+ );
+
+ const dashboardNames = cd.dashboards
+ .filter((d) => d.id !== destination.id)
+ .map((d) => d.name);
+
+ return (
+ <List.Item key={`card-${cd.card_id}`}>
+ <Text>{jt`${(
+ <Text key="name" component="span" fw={700}>
+ {card?.name}
+ </Text>
+ )} will be removed from ${(
+ <DashboardNames key="names" names={dashboardNames} />
+ )}`}</Text>
+ </List.Item>
+ );
+ })}
+ </List>
+ </Stack>
+
+ <Modal.Footer>
+ {errorMessage && (
+ <Text c="feedback-negative" flex={1}>
+ {errorMessage}
+ </Text>
+ )}
+ <Button variant="subtle" color="neutral" onClick={onClose}>
+ {t`Cancel`}
+ </Button>
+ <Button variant="filled" onClick={onConfirm}>
+ {ngettext(
+ msgid`Move it`,
+ `Move them`,
+ cardsThatAppearInOtherDashboards.length,
+ )}
+ </Button>
+ </Modal.Footer>
</>
);
}
diff --git a/frontend/src/metabase/common/collections/containers/CreateCollectionModal.tsx b/frontend/src/metabase/common/collections/containers/CreateCollectionModal.tsx
index f92da1d1307..03ffb760045 100644
--- a/frontend/src/metabase/common/collections/containers/CreateCollectionModal.tsx
+++ b/frontend/src/metabase/common/collections/containers/CreateCollectionModal.tsx
@@ -53,11 +53,11 @@ function CreateCollectionModal({
return (
<Modal
+ density="relaxed"
opened
onClose={onClose}
size="lg"
data-testid="new-collection-modal"
- padding="40px"
title={t`New collection`}
>
<CreateCollectionForm
diff --git a/frontend/src/metabase/common/collections/containers/FormAuthorityLevelFieldContainer.tsx b/frontend/src/metabase/common/collections/containers/FormAuthorityLevelField.tsx
similarity index 100%
rename from frontend/src/metabase/common/collections/containers/FormAuthorityLevelFieldContainer.tsx
rename to frontend/src/metabase/common/collections/containers/FormAuthorityLevelField.tsx
diff --git a/frontend/src/metabase/common/collections/containers/FormCollectionAndDashboardPicker/FormCollectionAndDashboardPicker.tsx b/frontend/src/metabase/common/collections/containers/FormCollectionAndDashboardPicker/FormCollectionAndDashboardPicker.tsx
index 2b59b2fb9f8..05338a7efad 100644
--- a/frontend/src/metabase/common/collections/containers/FormCollectionAndDashboardPicker/FormCollectionAndDashboardPicker.tsx
+++ b/frontend/src/metabase/common/collections/containers/FormCollectionAndDashboardPicker/FormCollectionAndDashboardPicker.tsx
@@ -18,7 +18,6 @@ import {
} from "metabase/common/collections/utils";
import { CollectionName } from "metabase/common/components/CollectionName";
import { DashboardName } from "metabase/common/components/DashboardName";
-import { FormField } from "metabase/common/components/FormField";
import type {
EntityPickerOptions,
EntityPickerProps,
@@ -32,6 +31,7 @@ import {
} from "metabase/common/components/Pickers";
import { SnippetCollectionName } from "metabase/common/components/SnippetCollectionName";
import { useUniqueId } from "metabase/common/hooks/use-unique-id";
+import { FormField } from "metabase/forms";
import { Button, Flex, Icon } from "metabase/ui";
import type { CollectionId, DashboardId } from "metabase-types/api";
diff --git a/frontend/src/metabase/common/components/ArchiveModal/ArchiveModal.tsx b/frontend/src/metabase/common/components/ArchiveModal/ArchiveModal.tsx
index 98bc6c607fc..4a8955d5a75 100644
--- a/frontend/src/metabase/common/components/ArchiveModal/ArchiveModal.tsx
+++ b/frontend/src/metabase/common/components/ArchiveModal/ArchiveModal.tsx
@@ -8,7 +8,7 @@ import {
FormProvider,
FormSubmitButton,
} from "metabase/forms";
-import { Box, Button, Group, Modal, Stack, Text } from "metabase/ui";
+import { Button, Modal, Text } from "metabase/ui";
interface ArchiveModalProps {
title?: string;
@@ -46,25 +46,21 @@ export const ArchiveModal = ({
<Modal opened title={title || t`Trash this?`} onClose={onClose}>
<FormProvider initialValues={{}} onSubmit={archive}>
<Form>
- <Stack>
- <Text>{message}</Text>
- <Group gap="sm">
- <Box flex={1}>
- <FormErrorMessage />
- </Box>
- <Button onClick={onClose}>{t`Cancel`}</Button>
- <FormSubmitButton
- color="negative"
- variant="filled"
- label={archiveButtonLabel}
- activeLabel={archiveButtonLabel}
- successLabel={archiveButtonLabel}
- failedLabel={archiveButtonLabel}
- disabled={isLoading}
- data-autofocus
- />
- </Group>
- </Stack>
+ <Text>{message}</Text>
+ <Modal.Footer>
+ <FormErrorMessage flex={1} />
+ <Button onClick={onClose}>{t`Cancel`}</Button>
+ <FormSubmitButton
+ color="negative"
+ variant="filled"
+ label={archiveButtonLabel}
+ activeLabel={archiveButtonLabel}
+ successLabel={archiveButtonLabel}
+ failedLabel={archiveButtonLabel}
+ disabled={isLoading}
+ data-autofocus
+ />
+ </Modal.Footer>
</Form>
</FormProvider>
</Modal>
diff --git a/frontend/src/metabase/common/components/CopyCardForm/CopyCardForm.tsx b/frontend/src/metabase/common/components/CopyCardForm/CopyCardForm.tsx
index e5ceaed637b..5f2d9a8040b 100644
--- a/frontend/src/metabase/common/components/CopyCardForm/CopyCardForm.tsx
+++ b/frontend/src/metabase/common/components/CopyCardForm/CopyCardForm.tsx
@@ -6,7 +6,6 @@ import * as Yup from "yup";
import { FormCollectionAndDashboardPicker } from "metabase/common/collections/containers/FormCollectionAndDashboardPicker";
import { getEntityTypeFromCardType } from "metabase/common/collections/utils";
import { FormDashboardTabSelect } from "metabase/common/components/FormDashboardTabSelect";
-import { FormFooter } from "metabase/common/components/FormFooter";
import type { OmniPickerItem } from "metabase/common/components/Pickers";
import { QUESTION_NAME_MAX_LENGTH } from "metabase/common/utils/card";
import {
@@ -17,7 +16,7 @@ import {
FormTextInput,
FormTextarea,
} from "metabase/forms";
-import { Button, Stack } from "metabase/ui";
+import { Button, Modal, Stack } from "metabase/ui";
import * as Errors from "metabase/utils/errors";
import type {
Card,
@@ -110,7 +109,7 @@ export const CopyCardForm = ({
>
{({ values }) => (
<Form>
- <Stack gap="lg" mb="lg">
+ <Stack gap="xl">
<FormTextInput
name="name"
label={t`Name`}
@@ -124,26 +123,22 @@ export const CopyCardForm = ({
nullable
minRows={4}
/>
- <div>
- <FormCollectionAndDashboardPicker
- collectionIdFieldName="collection_id"
- dashboardIdFieldName="dashboard_id"
- dashboardTabIdFieldName="dashboard_tab_id"
- title={t`Where do you want to save this?`}
- entityType={
- model ? getEntityTypeFromCardType(model) : undefined
- }
- collectionPickerModalProps={{ models }}
- />
- <FormDashboardTabSelect
- name="dashboard_tab_id"
- label="Which tab should this go on?"
- dashboardId={values.dashboard_id}
- />
- </div>
+ <FormCollectionAndDashboardPicker
+ collectionIdFieldName="collection_id"
+ dashboardIdFieldName="dashboard_id"
+ dashboardTabIdFieldName="dashboard_tab_id"
+ title={t`Where do you want to save this?`}
+ entityType={model ? getEntityTypeFromCardType(model) : undefined}
+ collectionPickerModalProps={{ models }}
+ />
+ <FormDashboardTabSelect
+ name="dashboard_tab_id"
+ label="Which tab should this go on?"
+ dashboardId={values.dashboard_id}
+ />
</Stack>
- <FormFooter>
- <FormErrorMessage inline />
+ <Modal.Footer>
+ <FormErrorMessage flex={1} />
{!!onCancel && (
<Button type="button" onClick={onCancel}>{t`Cancel`}</Button>
)}
@@ -151,7 +146,7 @@ export const CopyCardForm = ({
label={c(`A verb, not a noun`).t`Duplicate`}
variant="filled"
/>
- </FormFooter>
+ </Modal.Footer>
</Form>
)}
</FormProvider>
diff --git a/frontend/src/metabase/common/components/CopyDashboardForm/CopyDashboardForm.tsx b/frontend/src/metabase/common/components/CopyDashboardForm/CopyDashboardForm.tsx
index 00460ca61fd..6abc25398e3 100644
--- a/frontend/src/metabase/common/components/CopyDashboardForm/CopyDashboardForm.tsx
+++ b/frontend/src/metabase/common/components/CopyDashboardForm/CopyDashboardForm.tsx
@@ -4,7 +4,6 @@ import * as Yup from "yup";
import { useGetDashboardQuery } from "metabase/api";
import FormCollectionPicker from "metabase/common/collections/containers/FormCollectionPicker/FormCollectionPicker";
-import { FormFooter } from "metabase/common/components/FormFooter";
import type { FilterItemsInPersonalCollection } from "metabase/common/components/Pickers";
import {
DASHBOARD_DESCRIPTION_MAX_LENGTH,
@@ -20,7 +19,7 @@ import {
FormTextInput,
FormTextarea,
} from "metabase/forms";
-import { Button, Group, Icon, Tooltip } from "metabase/ui";
+import { Button, Group, Icon, Modal, Stack, 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";
@@ -109,53 +108,51 @@ function CopyDashboardForm({
>
<Form>
<FormObserver onChange={handleChange} />
- <FormTextInput
- name="name"
- label={t`Name`}
- placeholder={t`What is the name of your dashboard?`}
- autoFocus
- mb="1.5rem"
- />
- <FormTextarea
- name="description"
- label={t`Description`}
- placeholder={t`It's optional but oh, so helpful`}
- nullable
- mb="1.5rem"
- minRows={6}
- />
- <FormCollectionPicker
- name="collection_id"
- title={t`Which collection should this go in?`}
- filterPersonalCollections={filterPersonalCollections}
- entityType="dashboard"
- />
-
- {!hideShallowCopy && (
- <FormCheckbox
- mt="1rem"
- name="is_shallow_copy"
- label={
- <Group align="center" gap="xxs">
- {t`Only duplicate the dashboard`}
-
- <Tooltip
- label={t`If you check this, the cards in the duplicated dashboard will reference the original questions.`}
- >
- <Icon name="info" size={18} />
- </Tooltip>
- </Group>
- }
+ <Stack gap="xl">
+ <FormTextInput
+ name="name"
+ label={t`Name`}
+ placeholder={t`What is the name of your dashboard?`}
+ autoFocus
+ />
+ <FormTextarea
+ name="description"
+ label={t`Description`}
+ placeholder={t`It's optional but oh, so helpful`}
+ nullable
+ minRows={6}
/>
- )}
+ <FormCollectionPicker
+ name="collection_id"
+ title={t`Which collection should this go in?`}
+ filterPersonalCollections={filterPersonalCollections}
+ entityType="dashboard"
+ />
+ {!hideShallowCopy && (
+ <FormCheckbox
+ name="is_shallow_copy"
+ label={
+ <Group align="center" gap="xxs">
+ {t`Only duplicate the dashboard`}
+
+ <Tooltip
+ label={t`If you check this, the cards in the duplicated dashboard will reference the original questions.`}
+ >
+ <Icon name="info" size={18} />
+ </Tooltip>
+ </Group>
+ }
+ />
+ )}
+ </Stack>
- <FormFooter mt="1.5rem">
- <FormErrorMessage inline />
+ <Modal.Footer>
+ <FormErrorMessage flex={1} />
{!!onClose && (
<Button type="button" onClick={onClose}>{t`Cancel`}</Button>
)}
<FormSubmitButton label={c(`A verb, not a noun`).t`Duplicate`} />
- </FormFooter>
+ </Modal.Footer>
</Form>
</FormProvider>
);
diff --git a/frontend/src/metabase/common/components/CopyModal/CopyModal.tsx b/frontend/src/metabase/common/components/CopyModal/CopyModal.tsx
index 6f355a09244..017408fbcee 100644
--- a/frontend/src/metabase/common/components/CopyModal/CopyModal.tsx
+++ b/frontend/src/metabase/common/components/CopyModal/CopyModal.tsx
@@ -39,6 +39,7 @@ export function CopyModal(props: CopyModalProps) {
return (
<Modal
+ density="relaxed"
title={
title || t`Duplicate "${resolvedObjectWithDefaultCollection.name}"`
}
diff --git a/frontend/src/metabase/common/components/DocumentCopyForm/DocumentCopyForm.tsx b/frontend/src/metabase/common/components/DocumentCopyForm/DocumentCopyForm.tsx
index 502d1b7ef86..2c6c20363f6 100644
--- a/frontend/src/metabase/common/components/DocumentCopyForm/DocumentCopyForm.tsx
+++ b/frontend/src/metabase/common/components/DocumentCopyForm/DocumentCopyForm.tsx
@@ -2,14 +2,13 @@ import { c, t } from "ttag";
import * as Yup from "yup";
import FormCollectionPicker from "metabase/common/collections/containers/FormCollectionPicker";
-import { FormFooter } from "metabase/common/components/FormFooter";
import {
Form,
FormProvider,
FormSubmitButton,
FormTextInput,
} from "metabase/forms";
-import { Button, Stack } from "metabase/ui";
+import { Button, Modal, Stack } from "metabase/ui";
import type { CollectionId } from "metabase-types/api";
import type { Document } from "metabase-types/api/document";
@@ -53,7 +52,7 @@ export const DocumentCopyForm = ({
>
{() => (
<Form>
- <Stack gap="lg" mb="lg">
+ <Stack gap="xl">
<FormTextInput
name="name"
label={t`Name`}
@@ -68,7 +67,7 @@ export const DocumentCopyForm = ({
/>
</div>
</Stack>
- <FormFooter>
+ <Modal.Footer>
{!!onCancel && (
<Button type="button" onClick={onCancel}>{t`Cancel`}</Button>
)}
@@ -76,7 +75,7 @@ export const DocumentCopyForm = ({
label={c(`A verb, not a noun`).t`Duplicate`}
variant="filled"
/>
- </FormFooter>
+ </Modal.Footer>
</Form>
)}
</FormProvider>
diff --git a/frontend/src/metabase/common/components/ErrorPages/ErrorDiagnosticModal.tsx b/frontend/src/metabase/common/components/ErrorPages/ErrorDiagnosticModal.tsx
index fc108332429..e72087365c8 100644
--- a/frontend/src/metabase/common/components/ErrorPages/ErrorDiagnosticModal.tsx
+++ b/frontend/src/metabase/common/components/ErrorPages/ErrorDiagnosticModal.tsx
@@ -12,7 +12,7 @@ import { addUndo } from "metabase/redux/undo";
import { getIsErrorDiagnosticModalOpen } from "metabase/selectors/app";
import { getApplicationName } from "metabase/selectors/whitelabel";
import { useSetting } from "metabase/settings";
-import { Button, Flex, Icon, Loader, Modal, Stack, Text } from "metabase/ui";
+import { Button, Icon, Loader, Modal, Stack, Text } from "metabase/ui";
import { downloadObjectAsJson } from "metabase/utils/download";
import { isWithinIframe } from "metabase/utils/iframe";
@@ -267,17 +267,19 @@ export const ErrorExplanationModal = ({
opened={isModalOpen}
onClose={onClose}
>
- <Text my="lg">
- {t`We’ve run into an error, try to refresh the page or go back.`}
- </Text>
- <Text my="lg">
- {t`If the error persists, you can download diagnostic information`}
- </Text>
- <Flex justify="flex-end">
+ <Stack gap="lg">
+ <Text>
+ {t`We’ve run into an error, try to refresh the page or go back.`}
+ </Text>
+ <Text>
+ {t`If the error persists, you can download diagnostic information`}
+ </Text>
+ </Stack>
+ <Modal.Footer>
<Button variant="filled" onClick={openDiagnosticModal}>
{t`Download diagnostic info`}
</Button>
- </Flex>
+ </Modal.Footer>
</Modal>
);
};
diff --git a/frontend/src/metabase/common/components/MoveQuestionsIntoDashboardsModal/MoveQuestionsIntoDashboardsInfoModal.tsx b/frontend/src/metabase/common/components/MoveQuestionsIntoDashboardsModal/MoveQuestionsIntoDashboardsInfoModal.tsx
index c9734bd0e68..098cbd1480e 100644
--- a/frontend/src/metabase/common/components/MoveQuestionsIntoDashboardsModal/MoveQuestionsIntoDashboardsInfoModal.tsx
+++ b/frontend/src/metabase/common/components/MoveQuestionsIntoDashboardsModal/MoveQuestionsIntoDashboardsInfoModal.tsx
@@ -1,6 +1,6 @@
import { t } from "ttag";
-import { Button, Flex, Icon, List, Modal } from "metabase/ui";
+import { Button, Icon, List, Modal } from "metabase/ui";
interface MoveQuestionsIntoDashboardsInfoModalProps {
onConfirm: () => void;
@@ -19,7 +19,7 @@ export const MoveQuestionsIntoDashboardsInfoModal = ({
withCloseButton={false}
data-testid="move-questions-into-dashboard-info-modal"
>
- <List spacing="lg" mt="1.25rem">
+ <List spacing="lg">
<List.Item
icon={<Icon name="collection" c="core-brand" mb="-2px" />}
lh="1.5rem"
@@ -34,7 +34,7 @@ export const MoveQuestionsIntoDashboardsInfoModal = ({
</List.Item>
</List>
- <Flex justify="flex-end" gap="lg" pt="1rem">
+ <Modal.Footer>
<Button
variant="subtle"
color="neutral"
@@ -43,6 +43,6 @@ export const MoveQuestionsIntoDashboardsInfoModal = ({
<Button variant="filled" onClick={onConfirm}>
{t`Preview the changes`}
</Button>
- </Flex>
+ </Modal.Footer>
</Modal>
);
diff --git a/frontend/src/metabase/common/components/Pickers/EntityPicker/components/NewCollectionDialog/NewCollectionDialog.tsx b/frontend/src/metabase/common/components/Pickers/EntityPicker/components/NewCollectionDialog/NewCollectionDialog.tsx
index 387e26edd40..71c7c277504 100644
--- a/frontend/src/metabase/common/components/Pickers/EntityPicker/components/NewCollectionDialog/NewCollectionDialog.tsx
+++ b/frontend/src/metabase/common/components/Pickers/EntityPicker/components/NewCollectionDialog/NewCollectionDialog.tsx
@@ -4,7 +4,6 @@ import * as Yup from "yup";
import { useCreateCollectionMutation } from "metabase/api";
import { canPlaceEntityInCollection } from "metabase/common/collections/utils";
-import { FormFooter } from "metabase/common/components/FormFooter";
import {
Form,
FormErrorMessage,
@@ -13,7 +12,7 @@ import {
FormTextInput,
} from "metabase/forms";
import { PLUGIN_TENANTS } from "metabase/plugins";
-import { Button, Flex, Modal } from "metabase/ui";
+import { Button, Modal } from "metabase/ui";
import * as Errors from "metabase/utils/errors";
import { useOmniPickerContext } from "../../context";
@@ -131,22 +130,19 @@ export const NewCollectionDialog = () => {
name="name"
label={t`Give it a name`}
placeholder={t`My new collection`}
- mb="1rem"
labelProps={{ my: "0.5rem" }}
data-autofocus
/>
- <FormFooter>
- <FormErrorMessage inline />
- <Flex style={{ flexShrink: 1 }} justify="flex-end" gap="sm">
- <Button type="button" onClick={close}>{t`Cancel`}</Button>
- <FormSubmitButton
- type="submit"
- label={t`Create`}
- disabled={!dirty}
- variant="filled"
- />
- </Flex>
- </FormFooter>
+ <Modal.Footer>
+ <FormErrorMessage flex={1} />
+ <Button type="button" onClick={close}>{t`Cancel`}</Button>
+ <FormSubmitButton
+ type="submit"
+ label={t`Create`}
+ disabled={!dirty}
+ variant="filled"
+ />
+ </Modal.Footer>
</Form>
)}
</FormProvider>
diff --git a/frontend/src/metabase/common/components/Pickers/EntityPicker/components/NewDashboardDialog/NewDashboardDialog.tsx b/frontend/src/metabase/common/components/Pickers/EntityPicker/components/NewDashboardDialog/NewDashboardDialog.tsx
index 44aa2a2ca3e..bab6ce965c6 100644
--- a/frontend/src/metabase/common/components/Pickers/EntityPicker/components/NewDashboardDialog/NewDashboardDialog.tsx
+++ b/frontend/src/metabase/common/components/Pickers/EntityPicker/components/NewDashboardDialog/NewDashboardDialog.tsx
@@ -2,7 +2,6 @@ import { useMemo } from "react";
import { t } from "ttag";
import { useCreateDashboardMutation } from "metabase/api";
-import { FormFooter } from "metabase/common/components/FormFooter";
import { canPlaceEntityInCollection } from "metabase/common/data-studio/collection-utils";
import {
Form,
@@ -12,7 +11,7 @@ import {
FormTextInput,
} from "metabase/forms";
import { PLUGIN_TENANTS } from "metabase/plugins";
-import { Button, Flex, Modal } from "metabase/ui";
+import { Button, Modal } from "metabase/ui";
import { useOmniPickerContext } from "../../context";
import type { OmniPickerCollectionItem } from "../../types";
@@ -98,11 +97,6 @@ export const NewDashboardDialog = () => {
data-testid="create-dashboard-on-the-go"
trapFocus={true}
withCloseButton={false}
- styles={{
- content: {
- padding: "1rem",
- },
- }}
>
<FormProvider
initialValues={{ name: "" }}
@@ -114,22 +108,19 @@ export const NewDashboardDialog = () => {
name="name"
label={t`Give it a name`}
placeholder={t`My new dashboard`}
- mb="1rem"
labelProps={{ my: "0.5rem" }}
data-autofocus
/>
- <FormFooter>
- <FormErrorMessage inline />
- <Flex style={{ flexShrink: 1 }} justify="flex-end" gap="sm">
- <Button type="button" onClick={close}>{t`Cancel`}</Button>
- <FormSubmitButton
- type="submit"
- label={t`Create`}
- disabled={!dirty || isSubmitting}
- variant="filled"
- />
- </Flex>
- </FormFooter>
+ <Modal.Footer>
+ <FormErrorMessage flex={1} />
+ <Button type="button" onClick={close}>{t`Cancel`}</Button>
+ <FormSubmitButton
+ type="submit"
+ label={t`Create`}
+ disabled={!dirty || isSubmitting}
+ variant="filled"
+ />
+ </Modal.Footer>
</Form>
)}
</FormProvider>
diff --git a/frontend/src/metabase/common/components/SaveQuestionForm/SaveQuestionForm.tsx b/frontend/src/metabase/common/components/SaveQuestionForm/SaveQuestionForm.tsx
index 012808b97cd..8e940c797b8 100644
--- a/frontend/src/metabase/common/components/SaveQuestionForm/SaveQuestionForm.tsx
+++ b/frontend/src/metabase/common/components/SaveQuestionForm/SaveQuestionForm.tsx
@@ -14,20 +14,13 @@ import {
FormTextInput,
FormTextarea,
} from "metabase/forms";
-import { Button, Radio, Stack, rem } from "metabase/ui";
+import { Box, Button, Radio, Stack } from "metabase/ui";
import type { OmniPickerItem } from "../Pickers";
import S from "./SaveQuestionForm.module.css";
import { useSaveQuestionContext } from "./context";
-const labelStyles = {
- fontWeight: 900,
- fontSize: "0.77rem",
- color: "var(--mb-color-text-secondary)",
- marginBottom: rem("7px"),
-};
-
export const SaveQuestionForm = ({
onCancel,
onSaveSuccess,
@@ -65,18 +58,7 @@ export const SaveQuestionForm = ({
return (
<Form>
{showSaveType && (
- <FormRadioGroup
- name="saveType"
- label={title}
- styles={{
- label: {
- fontWeight: 900,
- fontSize: "0.77rem",
- color: "var(--mb-color-text-secondary)",
- marginBottom: rem("7px"),
- },
- }}
- >
+ <FormRadioGroup name="saveType" label={title}>
<Stack gap="sm" mb="lg">
<Radio
name={overwriteOptionName}
@@ -108,7 +90,6 @@ export const SaveQuestionForm = ({
name="name"
label={t`Name`}
placeholder={nameInputPlaceholder}
- styles={{ label: labelStyles }}
/>
<FormTextarea
@@ -116,20 +97,21 @@ export const SaveQuestionForm = ({
label={t`Description`}
minRows={4}
placeholder={t`It's optional but oh, so helpful`}
- styles={{ label: labelStyles }}
/>
<div>
{showPickerInput && (
- <FormCollectionAndDashboardPicker
- collectionIdFieldName="collection_id"
- dashboardIdFieldName="dashboard_id"
- title={t`Where do you want to save this?`}
- entityType={getEntityTypeFromCardType(question.type())}
- collectionPickerModalProps={{
- models,
- }}
- />
+ <Box mb="lg">
+ <FormCollectionAndDashboardPicker
+ collectionIdFieldName="collection_id"
+ dashboardIdFieldName="dashboard_id"
+ title={t`Where do you want to save this?`}
+ entityType={getEntityTypeFromCardType(question.type())}
+ collectionPickerModalProps={{
+ models,
+ }}
+ />
+ </Box>
)}
<FormDashboardTabSelect
@@ -137,12 +119,6 @@ export const SaveQuestionForm = ({
label={c("'this' refers to the question that's being saved")
.t`Which tab should this go on?`}
dashboardId={values.dashboard_id}
- styles={{
- label: {
- ...labelStyles,
- marginBottom: rem("3px"),
- },
- }}
/>
</div>
</Stack>
diff --git a/frontend/src/metabase/common/components/UserForm.module.css b/frontend/src/metabase/common/components/UserForm.module.css
new file mode 100644
index 00000000000..8d8ce0972bb
--- /dev/null
+++ b/frontend/src/metabase/common/components/UserForm.module.css
@@ -0,0 +1,4 @@
+.loginAttributes {
+ margin-top: var(--mantine-spacing-xxl);
+ margin-bottom: var(--mantine-spacing-lg);
+}
diff --git a/frontend/src/metabase/common/components/UserForm.tsx b/frontend/src/metabase/common/components/UserForm.tsx
index 3e1a0808516..7a1c3ab5dd9 100644
--- a/frontend/src/metabase/common/components/UserForm.tsx
+++ b/frontend/src/metabase/common/components/UserForm.tsx
@@ -22,6 +22,8 @@ import { Alert, Button } from "metabase/ui";
import * as Errors from "metabase/utils/errors";
import type { GroupId, GroupInfo, User, UserId } from "metabase-types/api";
+import S from "./UserForm.module.css";
+
const localUserSchema = Yup.object({
first_name: Yup.string().nullable().max(100, Errors.maxLength).default(null),
last_name: Yup.string().nullable().max(100, Errors.maxLength).default(null),
@@ -220,6 +222,7 @@ export const UserForm = ({
{!hideAttributes && (
<PLUGIN_ADMIN_USER_FORM_FIELDS.FormLoginAttributes
userId={userId}
+ className={S.loginAttributes}
/>
)}
<FormFooter>
diff --git a/frontend/src/metabase/common/components/upsells/components/UpgradeModal/UpgradeModal.tsx b/frontend/src/metabase/common/components/upsells/components/UpgradeModal/UpgradeModal.tsx
index bb4a02369fa..330ca5b2007 100644
--- a/frontend/src/metabase/common/components/upsells/components/UpgradeModal/UpgradeModal.tsx
+++ b/frontend/src/metabase/common/components/upsells/components/UpgradeModal/UpgradeModal.tsx
@@ -126,7 +126,7 @@ export function UpgradeModal({ opened, onClose }: UpgradeModalProps) {
(showPlanPricing && isPlanLoading);
return (
- <Modal opened={opened} onClose={handleClose} size="md" padding="xl">
+ <Modal opened={opened} onClose={handleClose} size="md">
{step === "initial" && isDataLoading && !hasQueryError && (
<Center h={200}>
<Loader />
diff --git a/frontend/src/metabase/common/components/upsells/components/UpgradeModal/UpgradeModalInitial.tsx b/frontend/src/metabase/common/components/upsells/components/UpgradeModal/UpgradeModalInitial.tsx
index 356b8be6bd1..95296e201cb 100644
--- a/frontend/src/metabase/common/components/upsells/components/UpgradeModal/UpgradeModalInitial.tsx
+++ b/frontend/src/metabase/common/components/upsells/components/UpgradeModal/UpgradeModalInitial.tsx
@@ -9,6 +9,7 @@ import {
Flex,
Icon,
List,
+ Modal,
Stack,
Text,
Title,
@@ -60,82 +61,83 @@ export function UpgradeModalInitial({
];
return (
- <Stack gap="xl">
- <Flex align="center" gap="sm">
- <UpsellGem size={24} />
- <Title order={2}>{title}</Title>
- </Flex>
+ <>
+ <Stack gap="xl">
+ <Flex align="center" gap="sm">
+ <UpsellGem size={24} />
+ <Title order={2}>{title}</Title>
+ </Flex>
- <Box
- bg="background_page-secondary"
- p="xl"
- style={{ borderRadius: "var(--mantine-radius-sm)" }}
- >
- <Stack gap="lg">
- <Flex justify="space-between" align="center">
- {/* eslint-disable-next-line metabase/no-literal-metabase-strings -- Upsell for Metabase Pro, only visible to admins */}
- <Title order={4}>{t`Metabase Pro`}</Title>
- <ExternalLink href="https://www.metabase.com/pricing">
- <Anchor component="span">{t`See all features`}</Anchor>
- </ExternalLink>
- </Flex>
+ <Box
+ bg="background_page-secondary"
+ p="xl"
+ style={{ borderRadius: "var(--mantine-radius-sm)" }}
+ >
+ <Stack gap="lg">
+ <Flex justify="space-between" align="center">
+ {/* eslint-disable-next-line metabase/no-literal-metabase-strings -- Upsell for Metabase Pro, only visible to admins */}
+ <Title order={4}>{t`Metabase Pro`}</Title>
+ <ExternalLink href="https://www.metabase.com/pricing">
+ <Anchor component="span">{t`See all features`}</Anchor>
+ </ExternalLink>
+ </Flex>
- <List
- spacing="xxs"
- icon={<Icon name="check" c="text-primary" size={16} />}
- pl={0}
- >
- {proFeatures.map((feature) => (
- <List.Item key={feature}>
- <Text c="text-secondary">{feature}</Text>
- </List.Item>
- ))}
- </List>
+ <List
+ spacing="xxs"
+ icon={<Icon name="check" c="text-primary" size={16} />}
+ pl={0}
+ >
+ {proFeatures.map((feature) => (
+ <List.Item key={feature}>
+ <Text c="text-secondary">{feature}</Text>
+ </List.Item>
+ ))}
+ </List>
- <Divider />
+ <Divider />
- <Stack gap="xxs">
- <Flex justify="space-between" align="center">
- <Text c="text-secondary">{t`Due today:`}</Text>
- <Text fw="bold" size="lg">
- {dueToday}
- </Text>
- </Flex>
- {showPlanPricing && planPricing && (
- <Flex justify="space-between" align="flex-start">
- <Text c="text-secondary">{t`After your trial ends:`}</Text>
- <Stack gap={0} align="flex-end">
- <Text fw="bold" size="md">
- {planPricing.billingPeriodMonths === 12
- ? t`${formatPriceNoCents(planPricing.price)}/year + tax`
- : t`${formatPriceNoCents(planPricing.price)}/mo + tax`}
- </Text>
- <Text c="text-secondary" size="sm">
- {planPricing.billingPeriodMonths === 12
- ? t`Incl. ${planPricing.includedUsers} users, then ${formatPriceNoCents(planPricing.pricePerAdditionalUser)}/user/year`
- : t`Incl. ${planPricing.includedUsers} users, then ${formatPriceNoCents(planPricing.pricePerAdditionalUser)}/user/mo`}
- </Text>
- </Stack>
+ <Stack gap="xxs">
+ <Flex justify="space-between" align="center">
+ <Text c="text-secondary">{t`Due today:`}</Text>
+ <Text fw="bold" size="lg">
+ {dueToday}
+ </Text>
</Flex>
- )}
+ {showPlanPricing && planPricing && (
+ <Flex justify="space-between" align="flex-start">
+ <Text c="text-secondary">{t`After your trial ends:`}</Text>
+ <Stack gap={0} align="flex-end">
+ <Text fw="bold" size="md">
+ {planPricing.billingPeriodMonths === 12
+ ? t`${formatPriceNoCents(planPricing.price)}/year + tax`
+ : t`${formatPriceNoCents(planPricing.price)}/mo + tax`}
+ </Text>
+ <Text c="text-secondary" size="sm">
+ {planPricing.billingPeriodMonths === 12
+ ? t`Incl. ${planPricing.includedUsers} users, then ${formatPriceNoCents(planPricing.pricePerAdditionalUser)}/user/year`
+ : t`Incl. ${planPricing.includedUsers} users, then ${formatPriceNoCents(planPricing.pricePerAdditionalUser)}/user/mo`}
+ </Text>
+ </Stack>
+ </Flex>
+ )}
+ </Stack>
</Stack>
- </Stack>
- </Box>
-
- {isTrial && (
- <Text c="text-secondary">
- {t`After your free trial ends, we won't charge you automatically – you decide if you'd like to keep the Pro plan.`}
- </Text>
- )}
+ </Box>
- <Flex justify="flex-end" gap="lg">
+ {isTrial && (
+ <Text c="text-secondary">
+ {t`After your free trial ends, we won't charge you automatically – you decide if you'd like to keep the Pro plan.`}
+ </Text>
+ )}
+ </Stack>
+ <Modal.Footer>
<Button variant="subtle" color="neutral" onClick={onCancel}>
{t`Cancel`}
</Button>
<Button variant="filled" color="brand" onClick={onConfirm}>
{buttonText}
</Button>
- </Flex>
- </Stack>
+ </Modal.Footer>
+ </>
);
}
diff --git a/frontend/src/metabase/dashboard/components/ClickBehaviorSidebar/LinkOptions/CustomURLPicker.tsx b/frontend/src/metabase/dashboard/components/ClickBehaviorSidebar/LinkOptions/CustomURLPicker.tsx
index ec9816c1129..e2ad8038411 100644
--- a/frontend/src/metabase/dashboard/components/ClickBehaviorSidebar/LinkOptions/CustomURLPicker.tsx
+++ b/frontend/src/metabase/dashboard/components/ClickBehaviorSidebar/LinkOptions/CustomURLPicker.tsx
@@ -7,9 +7,9 @@ import CS from "metabase/css/core/index.css";
import { hasColumnLevelClickBehavior } from "metabase/dashboard/utils";
import {
Button,
- Flex,
Icon,
Modal,
+ Stack,
Text,
TextInputBlurChange,
} from "metabase/ui";
@@ -94,12 +94,13 @@ export function CustomURLPicker({
/>
</Button.Group>
<Modal
+ density="relaxed"
opened={modalOpened}
onClose={closeModal}
title={t`Enter a URL to link to`}
size="lg"
>
- <Flex direction="column" gap="lg" mt="sm">
+ <Stack gap="xl">
<Text>
{t`You can insert the value of a column or dashboard filter using its name, like this: {{some_column}}`}
</Text>
@@ -117,9 +118,9 @@ export function CustomURLPicker({
/>
)}
<ValuesYouCanReference dashcard={dashcard} parameters={parameters} />
+ </Stack>
+ <Modal.Footer>
<Button
- ml="auto"
- mt="xxl"
variant="filled"
type="button"
onClick={() => {
@@ -128,7 +129,7 @@ export function CustomURLPicker({
}}
disabled={!canSelect}
>{t`Done`}</Button>
- </Flex>
+ </Modal.Footer>
</Modal>
</>
);
diff --git a/frontend/src/metabase/dashboard/components/DashboardLeaveConfirmationModal/DashboardLeaveConfirmationModal.tsx b/frontend/src/metabase/dashboard/components/DashboardLeaveConfirmationModal/DashboardLeaveConfirmationModal.tsx
index bcfc1c42114..d3d7d9d4f86 100644
--- a/frontend/src/metabase/dashboard/components/DashboardLeaveConfirmationModal/DashboardLeaveConfirmationModal.tsx
+++ b/frontend/src/metabase/dashboard/components/DashboardLeaveConfirmationModal/DashboardLeaveConfirmationModal.tsx
@@ -6,7 +6,7 @@ import { getIsDirty, getIsEditing } from "metabase/dashboard/selectors";
import { useDispatch, useSelector } from "metabase/redux";
import { dismissAllUndo } from "metabase/redux/undo";
import { useLocation } from "metabase/router";
-import { Box, Button, Flex, Modal, Text } from "metabase/ui";
+import { Button, Modal, Text } from "metabase/ui";
import { isNavigatingToCreateADashboardQuestion } from "./utils";
@@ -44,38 +44,25 @@ export const DashboardLeaveConfirmationModal = () => {
opened={opened}
onClose={close}
size="28.5rem"
- padding="2.5rem"
title={content.title}
data-testid="leave-confirmation"
withCloseButton={false}
- styles={{
- title: {
- fontSize: "1rem",
- },
- header: {
- marginBottom: "0.5rem",
- },
- }}
>
- <Box>
- <Text lh="1.5rem" mb={"xl"}>
- {content.message}
- </Text>
- <Flex justify="flex-end" gap="lg">
- <Button onClick={close}>{t`Cancel`}</Button>
- <Button
- color={content.actionBtn.color}
- variant="filled"
- onClick={async () => {
- dispatch(dismissAllUndo());
- await content.onConfirm?.();
- confirm?.();
- }}
- >
- {content.actionBtn.message}
- </Button>
- </Flex>
- </Box>
+ <Text lh="1.5rem">{content.message}</Text>
+ <Modal.Footer>
+ <Button onClick={close}>{t`Cancel`}</Button>
+ <Button
+ color={content.actionBtn.color}
+ variant="filled"
+ onClick={async () => {
+ dispatch(dismissAllUndo());
+ await content.onConfirm?.();
+ confirm?.();
+ }}
+ >
+ {content.actionBtn.message}
+ </Button>
+ </Modal.Footer>
</Modal>
);
};
diff --git a/frontend/src/metabase/dashboard/components/DashboardSubscriptionsSidebar/AddEditSidebar/DeleteSubscriptionAction.tsx b/frontend/src/metabase/dashboard/components/DashboardSubscriptionsSidebar/AddEditSidebar/DeleteSubscriptionAction.tsx
index 95964536716..269a500e614 100644
--- a/frontend/src/metabase/dashboard/components/DashboardSubscriptionsSidebar/AddEditSidebar/DeleteSubscriptionAction.tsx
+++ b/frontend/src/metabase/dashboard/components/DashboardSubscriptionsSidebar/AddEditSidebar/DeleteSubscriptionAction.tsx
@@ -91,44 +91,42 @@ export function DeleteSubscriptionAction({
size="lg"
data-testid="delete-confirmation-modal-pulse"
>
- <Flex direction="column" gap="lg" mt="lg">
- <ul>
- {confirmItems.map((item, index) => (
- <li
- key={index}
- className={cx(
- CS.pb2,
- CS.mb2,
- CS.borderRowDivider,
- CS.flex,
- CS.alignCenter,
- )}
- >
- <Checkbox
- label={item}
- checked={checked[index]}
- onChange={(e) =>
- setChecked({
- ...checked,
- [index]: e.currentTarget.checked,
- })
- }
- />
- </li>
- ))}
- </ul>
- <Flex justify="flex-end" gap="sm">
- <Button onClick={closeModal}>{t`Cancel`}</Button>
- <Button
- color={confirmed ? "negative" : undefined}
- variant="filled"
- onClick={handleDelete}
- disabled={!confirmed}
+ <ul>
+ {confirmItems.map((item, index) => (
+ <li
+ key={index}
+ className={cx(
+ CS.pb2,
+ CS.mb2,
+ CS.borderRowDivider,
+ CS.flex,
+ CS.alignCenter,
+ )}
>
- {t`Delete`}
- </Button>
- </Flex>
- </Flex>
+ <Checkbox
+ label={item}
+ checked={checked[index]}
+ onChange={(e) =>
+ setChecked({
+ ...checked,
+ [index]: e.currentTarget.checked,
+ })
+ }
+ />
+ </li>
+ ))}
+ </ul>
+ <Modal.Footer>
+ <Button onClick={closeModal}>{t`Cancel`}</Button>
+ <Button
+ color={confirmed ? "negative" : undefined}
+ variant="filled"
+ onClick={handleDelete}
+ disabled={!confirmed}
+ >
+ {t`Delete`}
+ </Button>
+ </Modal.Footer>
</Modal>
</>
);
diff --git a/frontend/src/metabase/data-studio/data-model/pages/DataModel/TableSection/TableAttributesEditBulk/SyncOptionsModal/SyncOptionsModal.tsx b/frontend/src/metabase/data-studio/data-model/pages/DataModel/TableSection/TableAttributesEditBulk/SyncOptionsModal/SyncOptionsModal.tsx
index 9ab90d015f9..83bee12d21e 100644
--- a/frontend/src/metabase/data-studio/data-model/pages/DataModel/TableSection/TableAttributesEditBulk/SyncOptionsModal/SyncOptionsModal.tsx
+++ b/frontend/src/metabase/data-studio/data-model/pages/DataModel/TableSection/TableAttributesEditBulk/SyncOptionsModal/SyncOptionsModal.tsx
@@ -30,13 +30,13 @@ export const SyncOptionsModal = ({
return (
<Modal
+ density="relaxed"
opened={isOpen}
- padding="xxl"
size={rem(512)}
title={t`Syncing and scanning`}
onClose={onClose}
>
- <Stack gap="xxl" pt="xl">
+ <Stack gap="xl">
<Stack gap="lg">
<Stack gap="xxs">
<Text fw="bold">
diff --git a/frontend/src/metabase/data-studio/snippets/components/SnippetHeader/SnippetMoreMenu/SnippetModal/ArchiveSnippetModal.tsx b/frontend/src/metabase/data-studio/snippets/components/SnippetHeader/SnippetMoreMenu/SnippetModal/ArchiveSnippetModal.tsx
index 207f0d9b252..456b61c4dfb 100644
--- a/frontend/src/metabase/data-studio/snippets/components/SnippetHeader/SnippetMoreMenu/SnippetModal/ArchiveSnippetModal.tsx
+++ b/frontend/src/metabase/data-studio/snippets/components/SnippetHeader/SnippetMoreMenu/SnippetModal/ArchiveSnippetModal.tsx
@@ -5,7 +5,7 @@ import { getErrorMessage } from "metabase/api/utils";
import { Link } from "metabase/common/components/Link";
import { useToast } from "metabase/common/hooks";
import { useNavigate } from "metabase/router";
-import { Button, Group, Modal, Stack, Text } from "metabase/ui";
+import { Button, Modal, Text } from "metabase/ui";
import * as Urls from "metabase/urls";
import type { NativeQuerySnippet } from "metabase-types/api";
@@ -55,20 +55,18 @@ export function ArchiveSnippetModal(props: ArchiveSnippetModalProps) {
return (
<Modal opened onClose={onClose} title={t`Archive snippet?`}>
- <Stack>
- <Text>{t`Are you sure you want to archive "${snippet.name}"?`}</Text>
- <Group gap="sm" justify="flex-end">
- <Button onClick={onClose}>{t`Cancel`}</Button>
- <Button
- color="negative"
- loading={isLoading}
- onClick={handleArchive}
- variant="filled"
- >
- {t`Archive`}
- </Button>
- </Group>
- </Stack>
+ <Text>{t`Are you sure you want to archive "${snippet.name}"?`}</Text>
+ <Modal.Footer>
+ <Button onClick={onClose}>{t`Cancel`}</Button>
+ <Button
+ color="negative"
+ loading={isLoading}
+ onClick={handleArchive}
+ variant="filled"
+ >
+ {t`Archive`}
+ </Button>
+ </Modal.Footer>
</Modal>
);
}
diff --git a/frontend/src/metabase/data-studio/snippets/components/SnippetHeader/SnippetMoreMenu/SnippetModal/UnarchiveSnippetModal.tsx b/frontend/src/metabase/data-studio/snippets/components/SnippetHeader/SnippetMoreMenu/SnippetModal/UnarchiveSnippetModal.tsx
index 7233cdcee4d..551094f7115 100644
--- a/frontend/src/metabase/data-studio/snippets/components/SnippetHeader/SnippetMoreMenu/SnippetModal/UnarchiveSnippetModal.tsx
+++ b/frontend/src/metabase/data-studio/snippets/components/SnippetHeader/SnippetMoreMenu/SnippetModal/UnarchiveSnippetModal.tsx
@@ -3,7 +3,7 @@ import { t } from "ttag";
import { useUpdateSnippetMutation } from "metabase/api";
import { getErrorMessage } from "metabase/api/utils";
import { useToast } from "metabase/common/hooks";
-import { Button, Group, Modal, Stack, Text } from "metabase/ui";
+import { Button, Modal, Text } from "metabase/ui";
import type { NativeQuerySnippet } from "metabase-types/api";
type ArchiveSnippetModalProps = {
@@ -38,19 +38,13 @@ export function UnarchiveSnippetModal(props: ArchiveSnippetModalProps) {
return (
<Modal opened onClose={onClose} title={t`Unarchive snippet?`}>
- <Stack>
- <Text>{t`Are you sure you want to unarchive "${snippet.name}"?`}</Text>
- <Group gap="sm" justify="flex-end">
- <Button onClick={onClose}>{t`Cancel`}</Button>
- <Button
- variant="filled"
- onClick={handleUnarchive}
- loading={isLoading}
- >
- {t`Unarchive`}
- </Button>
- </Group>
- </Stack>
+ <Text>{t`Are you sure you want to unarchive "${snippet.name}"?`}</Text>
+ <Modal.Footer>
+ <Button onClick={onClose}>{t`Cancel`}</Button>
+ <Button variant="filled" onClick={handleUnarchive} loading={isLoading}>
+ {t`Unarchive`}
+ </Button>
+ </Modal.Footer>
</Modal>
);
}
diff --git a/frontend/src/metabase/databases/components/DatabaseAuthProviderSectionField/DatabaseAuthProviderSectionField.tsx b/frontend/src/metabase/databases/components/DatabaseAuthProviderSectionField/DatabaseAuthProviderSectionField.tsx
index 36feda92e1f..39b9fa7c021 100644
--- a/frontend/src/metabase/databases/components/DatabaseAuthProviderSectionField/DatabaseAuthProviderSectionField.tsx
+++ b/frontend/src/metabase/databases/components/DatabaseAuthProviderSectionField/DatabaseAuthProviderSectionField.tsx
@@ -19,7 +19,7 @@ const DatabaseAuthProviderSectionField = ({
}, [value, setValue]);
return (
- <FormField>
+ <FormField mb="lg">
<Button
w="fit-content"
variant="transparent"
diff --git a/frontend/src/metabase/databases/components/DatabaseCacheScheduleField/DatabaseCacheScheduleField.tsx b/frontend/src/metabase/databases/components/DatabaseCacheScheduleField/DatabaseCacheScheduleField.tsx
index 2efc01ed4f1..7f41778f876 100644
--- a/frontend/src/metabase/databases/components/DatabaseCacheScheduleField/DatabaseCacheScheduleField.tsx
+++ b/frontend/src/metabase/databases/components/DatabaseCacheScheduleField/DatabaseCacheScheduleField.tsx
@@ -82,7 +82,7 @@ export const DatabaseCacheScheduleField = ({
};
return (
- <FormField title={title} description={description}>
+ <FormField mb="lg" title={title} description={description}>
<ScheduleModePicker
value={scheduleMode}
onChange={handleScheduleModeChange}
diff --git a/frontend/src/metabase/databases/components/DatabaseConnectionSectionField/DatabaseConnectionSectionField.tsx b/frontend/src/metabase/databases/components/DatabaseConnectionSectionField/DatabaseConnectionSectionField.tsx
index bd813729a45..d9f023535ba 100644
--- a/frontend/src/metabase/databases/components/DatabaseConnectionSectionField/DatabaseConnectionSectionField.tsx
+++ b/frontend/src/metabase/databases/components/DatabaseConnectionSectionField/DatabaseConnectionSectionField.tsx
@@ -21,7 +21,7 @@ export const DatabaseConnectionSectionField = ({
}, [value, setValue]);
return (
- <FormField>
+ <FormField mb="lg">
<Box
bg="background_page-tertiary"
p="xl"
diff --git a/frontend/src/metabase/databases/components/DatabaseHostnameSectionField/DatabaseHostameSectionField.tsx b/frontend/src/metabase/databases/components/DatabaseHostnameSectionField/DatabaseHostameSectionField.tsx
index 51b9220098c..f2dde339c4f 100644
--- a/frontend/src/metabase/databases/components/DatabaseHostnameSectionField/DatabaseHostameSectionField.tsx
+++ b/frontend/src/metabase/databases/components/DatabaseHostnameSectionField/DatabaseHostameSectionField.tsx
@@ -19,7 +19,7 @@ const DatabaseHostnameSectionField = ({
}, [value, setValue]);
return (
- <FormField>
+ <FormField mb="lg">
<Button
w="fit-content"
variant="transparent"
diff --git a/frontend/src/metabase/databases/components/DatabaseSyncScheduleField/DatabaseSyncScheduleField.tsx b/frontend/src/metabase/databases/components/DatabaseSyncScheduleField/DatabaseSyncScheduleField.tsx
index 1c1cb6bc28b..08907517c5b 100644
--- a/frontend/src/metabase/databases/components/DatabaseSyncScheduleField/DatabaseSyncScheduleField.tsx
+++ b/frontend/src/metabase/databases/components/DatabaseSyncScheduleField/DatabaseSyncScheduleField.tsx
@@ -36,7 +36,7 @@ const DatabaseSyncScheduleField = ({
);
return (
- <FormField title={title} description={description}>
+ <FormField mb="lg" title={title} description={description}>
<Schedule
mt="lg"
value={value ?? DEFAULT_SCHEDULE}
diff --git a/frontend/src/metabase/documents/components/editor-extensions/CardEmbed/modals/CreateStructuredQuestionModal.tsx b/frontend/src/metabase/documents/components/editor-extensions/CardEmbed/modals/CreateStructuredQuestionModal.tsx
index 824e4dc1103..272e6b332b5 100644
--- a/frontend/src/metabase/documents/components/editor-extensions/CardEmbed/modals/CreateStructuredQuestionModal.tsx
+++ b/frontend/src/metabase/documents/components/editor-extensions/CardEmbed/modals/CreateStructuredQuestionModal.tsx
@@ -7,7 +7,7 @@ import { Notebook } from "metabase/querying/notebook/components/Notebook";
import { useDispatch, useSelector, useStore } from "metabase/redux";
import { useEditorHost } from "metabase/rich_text_editing/tiptap/EditorHost";
import { getSetting } from "metabase/settings";
-import { Box, Button, Flex, Modal } from "metabase/ui";
+import { Box, Button, Modal } from "metabase/ui";
import * as Lib from "metabase-lib";
import Question from "metabase-lib/v1/Question";
@@ -107,11 +107,11 @@ export const CreateStructuredQuestionModal = ({
return (
<Modal
+ density="relaxed"
opened
onClose={onClose}
size="80%"
title={t`Create new question`}
- padding="xl"
classNames={{ content: S.modalContent, body: S.modalBody }}
>
<Box h="70vh" className={S.notebookContainer}>
@@ -125,7 +125,7 @@ export const CreateStructuredQuestionModal = ({
updateQuestion={handleUpdateQuestion}
/>
</Box>
- <Flex mt="xl" justify="flex-end" gap="0.5rem">
+ <Modal.Footer>
<Button variant="subtle" color="neutral" onClick={onClose}>
{t`Cancel`}
</Button>
@@ -136,7 +136,7 @@ export const CreateStructuredQuestionModal = ({
>
{t`Save and use`}
</Button>
- </Flex>
+ </Modal.Footer>
</Modal>
);
};
diff --git a/frontend/src/metabase/documents/components/editor-extensions/CardEmbed/modals/ModifyQuestionModal.tsx b/frontend/src/metabase/documents/components/editor-extensions/CardEmbed/modals/ModifyQuestionModal.tsx
index 7f1a1979a65..41d064e5d1d 100644
--- a/frontend/src/metabase/documents/components/editor-extensions/CardEmbed/modals/ModifyQuestionModal.tsx
+++ b/frontend/src/metabase/documents/components/editor-extensions/CardEmbed/modals/ModifyQuestionModal.tsx
@@ -120,11 +120,11 @@ export const ModifyQuestionModal = ({
return (
<Modal
+ density="relaxed"
opened={isOpen}
onClose={onClose}
size="80%"
title={t`Modify question`}
- padding="xl"
>
{question && modifiedQuestion ? (
<>
@@ -139,14 +139,14 @@ export const ModifyQuestionModal = ({
updateQuestion={handleUpdateQuestion}
/>
</Box>
- <Flex mt="xl" justify="flex-end" gap="0.5rem">
+ <Modal.Footer>
<Button variant="subtle" color="neutral" onClick={onClose}>
{t`Cancel`}
</Button>
<Button variant="filled" onClick={handleSave}>
{t`Save and use`}
</Button>
- </Flex>
+ </Modal.Footer>
</>
) : (
<Flex h="70vh" align="center" justify="center">
diff --git a/frontend/src/metabase/embedding/components/ReturnToSetupGuideModal/ReturnToSetupGuideModal.tsx b/frontend/src/metabase/embedding/components/ReturnToSetupGuideModal/ReturnToSetupGuideModal.tsx
index 410400d3012..c2c2d167864 100644
--- a/frontend/src/metabase/embedding/components/ReturnToSetupGuideModal/ReturnToSetupGuideModal.tsx
+++ b/frontend/src/metabase/embedding/components/ReturnToSetupGuideModal/ReturnToSetupGuideModal.tsx
@@ -1,7 +1,7 @@
import { t } from "ttag";
import { useNavigate } from "metabase/router";
-import { Button, Group, Modal, Stack, Text } from "metabase/ui";
+import { Button, Modal, Text } from "metabase/ui";
// Fallback for callers that did not say where they came from. Inlined here
// rather than imported so this modal can live at the shared tier and be invoked
@@ -32,17 +32,15 @@ export const ReturnToSetupGuideModal = ({
return (
<Modal opened={opened} onClose={onClose} title={title} size="md">
- <Stack>
- <Text>{message}</Text>
- <Group justify="flex-end">
- <Button variant="subtle" onClick={onClose}>
- {t`Stay here`}
- </Button>
- <Button variant="filled" onClick={() => navigate(returnTo)}>
- {t`Return to the setup guide`}
- </Button>
- </Group>
- </Stack>
+ <Text>{message}</Text>
+ <Modal.Footer>
+ <Button variant="subtle" onClick={onClose}>
+ {t`Stay here`}
+ </Button>
+ <Button variant="filled" onClick={() => navigate(returnTo)}>
+ {t`Return to the setup guide`}
+ </Button>
+ </Modal.Footer>
</Modal>
);
};
diff --git a/frontend/src/metabase/embedding/components/SharingMenu/InviteToViewModal.tsx b/frontend/src/metabase/embedding/components/SharingMenu/InviteToViewModal.tsx
index d835a5618b4..32c21d7374d 100644
--- a/frontend/src/metabase/embedding/components/SharingMenu/InviteToViewModal.tsx
+++ b/frontend/src/metabase/embedding/components/SharingMenu/InviteToViewModal.tsx
@@ -20,16 +20,7 @@ import { useToast } from "metabase/common/hooks";
import { useSelector } from "metabase/redux";
import { isSsoEnabled } from "metabase/selectors/settings";
import { getSetting, useSetting } from "metabase/settings";
-import {
- Button,
- Center,
- Group,
- Icon,
- Loader,
- Modal,
- Stack,
- Text,
-} from "metabase/ui";
+import { Button, Center, Icon, Loader, Modal, Stack, Text } from "metabase/ui";
import { generatePassword } from "metabase/utils/password";
import type { InviteTarget, User } from "metabase-types/api";
@@ -206,7 +197,7 @@ export const InviteToViewModal = ({
}
return (
- <Modal opened title={title} padding="xxl" onClose={onClose}>
+ <Modal opened title={title} onClose={onClose}>
{body}
</Modal>
);
@@ -219,10 +210,12 @@ const EmailSetupPrompt = ({
shareUrl: string;
onClose: () => void;
}) => (
- <Stack gap="xl">
- <Text>{t`To invite people by email, set up email first. Or share this link, they'll land on it after signing in:`}</Text>
- <CopyTextInput label={t`Link to share`} value={shareUrl} />
- <Group justify="flex-end">
+ <>
+ <Stack gap="xl">
+ <Text>{t`To invite people by email, set up email first. Or share this link, they'll land on it after signing in:`}</Text>
+ <CopyTextInput label={t`Link to share`} value={shareUrl} />
+ </Stack>
+ <Modal.Footer>
<Button onClick={onClose}>{t`Cancel`}</Button>
<Button
component={Link}
@@ -232,8 +225,8 @@ const EmailSetupPrompt = ({
>
{t`Set up email`}
</Button>
- </Group>
- </Stack>
+ </Modal.Footer>
+ </>
);
const TemporaryPasswordSuccess = ({
@@ -247,16 +240,18 @@ const TemporaryPasswordSuccess = ({
shareUrl: string;
onClose: () => void;
}) => (
- <Stack gap="xl">
- <Text>
- {jt`We couldn't send an email invitation. Share this temporary password with ${(
- <strong key="email">{email}</strong>
- )} so they can sign in.`}
- </Text>
- <PasswordReveal password={password} />
- <CopyTextInput label={t`Link to share`} value={shareUrl} />
- <Group justify="flex-end">
+ <>
+ <Stack gap="xl">
+ <Text>
+ {jt`We couldn't send an email invitation. Share this temporary password with ${(
+ <strong key="email">{email}</strong>
+ )} so they can sign in.`}
+ </Text>
+ <PasswordReveal password={password} />
+ <CopyTextInput label={t`Link to share`} value={shareUrl} />
+ </Stack>
+ <Modal.Footer>
<Button variant="filled" onClick={onClose}>{t`Done`}</Button>
- </Group>
- </Stack>
+ </Modal.Footer>
+ </>
);
diff --git a/frontend/src/metabase/embedding/settings/EmbeddingLegaleseModal/EmbeddingLegaleseModal.tsx b/frontend/src/metabase/embedding/settings/EmbeddingLegaleseModal/EmbeddingLegaleseModal.tsx
index b90ab46f54e..678736c595e 100644
--- a/frontend/src/metabase/embedding/settings/EmbeddingLegaleseModal/EmbeddingLegaleseModal.tsx
+++ b/frontend/src/metabase/embedding/settings/EmbeddingLegaleseModal/EmbeddingLegaleseModal.tsx
@@ -2,7 +2,7 @@ import { useState } from "react";
import { t } from "ttag";
import { useUpdateSettingsMutation } from "metabase/settings";
-import { Button, Group, Modal, type ModalProps, Text } from "metabase/ui";
+import { Button, Modal, type ModalProps, Text } from "metabase/ui";
type EmbeddingLegaleseModalProps = ModalProps & {
settingKey: "enable-embedding-modular" | "enable-embedding-sdk";
@@ -34,12 +34,11 @@ export const EmbeddingLegaleseModal = ({
onClose={onClose}
opened={opened}
size={670}
- padding="xxl"
withCloseButton={false}
closeOnClickOutside={false}
>
- <Text mt="xxs">{t`When you embed Metabase, each person who uses your app needs their own Metabase account. That's because sharing a single account between users is a security risk. Filtering data on the client side doesn't solve it, since anyone with that account's token can reach anything the account can see. Additionally, we consider shared accounts to be unfair usage.`}</Text>
- <Group justify="right" mt="xl">
+ <Text>{t`When you embed Metabase, each person who uses your app needs their own Metabase account. That's because sharing a single account between users is a security risk. Filtering data on the client side doesn't solve it, since anyone with that account's token can reach anything the account can see. Additionally, we consider shared accounts to be unfair usage.`}</Text>
+ <Modal.Footer>
<Button
onClick={onClose}
variant="default"
@@ -51,7 +50,7 @@ export const EmbeddingLegaleseModal = ({
data-is-loading={loading}
loading={loading}
>{t`Agree`}</Button>
- </Group>
+ </Modal.Footer>
</Modal>
);
};
diff --git a/frontend/src/metabase/embedding/themes/components/ThemeListing/DeleteThemeModal.tsx b/frontend/src/metabase/embedding/themes/components/ThemeListing/DeleteThemeModal.tsx
index ed58de76d13..2d20300452b 100644
--- a/frontend/src/metabase/embedding/themes/components/ThemeListing/DeleteThemeModal.tsx
+++ b/frontend/src/metabase/embedding/themes/components/ThemeListing/DeleteThemeModal.tsx
@@ -1,6 +1,6 @@
import { t } from "ttag";
-import { Button, Flex, Modal, Stack, Text } from "metabase/ui";
+import { Button, Modal, Text } from "metabase/ui";
interface DeleteThemeModalProps {
isOpen: boolean;
@@ -15,19 +15,16 @@ export function DeleteThemeModal({
}: DeleteThemeModalProps) {
return (
<Modal opened={isOpen} onClose={onCancel} title={t`Delete theme`}>
- <Stack>
- <Text>{t`Are you sure you want to delete this theme? This action cannot be undone.`}</Text>
+ <Text>{t`Are you sure you want to delete this theme? This action cannot be undone.`}</Text>
+ <Modal.Footer>
+ <Button variant="subtle" color="neutral" onClick={onCancel}>
+ {t`Cancel`}
+ </Button>
- <Flex justify="flex-end" gap="lg">
- <Button variant="subtle" color="neutral" onClick={onCancel}>
- {t`Cancel`}
- </Button>
-
- <Button variant="filled" color="negative" onClick={onDelete}>
- {t`Delete`}
- </Button>
- </Flex>
- </Stack>
+ <Button variant="filled" color="negative" onClick={onDelete}>
+ {t`Delete`}
+ </Button>
+ </Modal.Footer>
</Modal>
);
}
diff --git a/frontend/src/metabase/explorations/components/NewExplorationData/modals/AddEntitiesModal.tsx b/frontend/src/metabase/explorations/components/NewExplorationData/modals/AddEntitiesModal.tsx
index 47a18c5b505..85cb10793cb 100644
--- a/frontend/src/metabase/explorations/components/NewExplorationData/modals/AddEntitiesModal.tsx
+++ b/frontend/src/metabase/explorations/components/NewExplorationData/modals/AddEntitiesModal.tsx
@@ -15,7 +15,6 @@ import {
Box,
Button,
Checkbox,
- Group,
Icon,
Modal,
Stack,
@@ -131,13 +130,7 @@ export function AddEntitiesModal({
});
return (
- <Modal
- opened={opened}
- onClose={onClose}
- title={title}
- size="lg"
- padding="xxl"
- >
+ <Modal opened={opened} onClose={onClose} title={title} size="lg">
<Stack gap="lg">
<TextInput
value={search}
@@ -231,16 +224,16 @@ export function AddEntitiesModal({
)}
</LoadingAndErrorWrapper>
</Box>
- <Group justify="flex-end">
- {!emptyState && (
- <Button
- variant="filled"
- onClick={handleAdd}
- disabled={checked.size === 0}
- >{t`Add`}</Button>
- )}
- </Group>
</Stack>
+ {!emptyState && (
+ <Modal.Footer>
+ <Button
+ variant="filled"
+ onClick={handleAdd}
+ disabled={checked.size === 0}
+ >{t`Add`}</Button>
+ </Modal.Footer>
+ )}
</Modal>
);
}
diff --git a/frontend/src/metabase/forms/components/FormChipGroup/FormChipGroup.tsx b/frontend/src/metabase/forms/components/FormChipGroup/FormChipGroup.tsx
index 48d53fe3a11..971e1a2248d 100644
--- a/frontend/src/metabase/forms/components/FormChipGroup/FormChipGroup.tsx
+++ b/frontend/src/metabase/forms/components/FormChipGroup/FormChipGroup.tsx
@@ -3,7 +3,7 @@ import type { Ref } from "react";
import { forwardRef, useCallback } from "react";
import type { ChipGroupProps, GroupProps, TextProps } from "metabase/ui";
-import { Chip, Group, Text } from "metabase/ui";
+import { Chip, Group, Stack, Text } from "metabase/ui";
export interface FormChipGroupProps extends Omit<
ChipGroupProps,
@@ -38,14 +38,16 @@ export const FormChipGroup = forwardRef(function FormChipGroup(
return (
<Chip.Group {...props} value={value ?? undefined} onChange={handleChange}>
- {label && (
- <Text component="label" fw="bold" {...labelProps}>
- {label}
- </Text>
- )}
- <Group ref={ref} {...groupProps}>
- {children}
- </Group>
+ <Stack gap="md">
+ {label && (
+ <Text component="label" fw="bold" {...labelProps}>
+ {label}
+ </Text>
+ )}
+ <Group ref={ref} {...groupProps}>
+ {children}
+ </Group>
+ </Stack>
</Chip.Group>
);
});
diff --git a/frontend/src/metabase/forms/components/FormField/FormField.tsx b/frontend/src/metabase/forms/components/FormField/FormField.tsx
index 4c231006d77..332852a1d77 100644
--- a/frontend/src/metabase/forms/components/FormField/FormField.tsx
+++ b/frontend/src/metabase/forms/components/FormField/FormField.tsx
@@ -35,7 +35,7 @@ export const FormField = forwardRef(function FormField(
const hasError = Boolean(error);
return (
- <Flex {...props} ref={ref} direction="column" mb="lg">
+ <Flex {...props} ref={ref} direction="column">
{(hasTitle || hasDescription) && (
<Box>
<Flex align="center" mb={hasDescription ? "xxs" : undefined}>
diff --git a/frontend/src/metabase/forms/components/FormSecretKey/SetupKeyModal.tsx b/frontend/src/metabase/forms/components/FormSecretKey/SetupKeyModal.tsx
index 61be9411f37..6f0e1e2d156 100644
--- a/frontend/src/metabase/forms/components/FormSecretKey/SetupKeyModal.tsx
+++ b/frontend/src/metabase/forms/components/FormSecretKey/SetupKeyModal.tsx
@@ -8,15 +8,7 @@ import { t } from "ttag";
import { useLazyGenerateRandomTokenQuery } from "metabase/api/util";
import { getCopyTextFieldProps } from "metabase/common/components/CopyTextField/copy-text-field-props";
import { useMetadataToasts } from "metabase/common/hooks";
-import {
- Button,
- Group,
- Loader,
- Modal,
- Stack,
- Text,
- TextInput,
-} from "metabase/ui";
+import { Button, Loader, Modal, Stack, Text, TextInput } from "metabase/ui";
import S from "./FormSecretKey.module.css";
@@ -72,7 +64,7 @@ export const SecretKeyModal = ({
closeOnClickOutside={false}
closeOnEscape={false}
>
- <Stack gap="xl" mt="lg">
+ <Stack gap="xl">
<Text>
{t`Store this key somewhere safe. For security reasons, we can't show it to you again.`}
</Text>
@@ -86,19 +78,18 @@ export const SecretKeyModal = ({
!secretKey ? <Loader size="xs" /> : copyFieldProps.rightSection
}
/>
-
- <Group justify="flex-end" gap="sm">
- {withCancelButton && <Button onClick={onClose}>{t`Cancel`}</Button>}
- <Button
- data-autofocus
- disabled={!secretKey}
- onClick={() => onConfirm(secretKey)}
- variant="filled"
- >
- {confirmLabel}
- </Button>
- </Group>
</Stack>
+ <Modal.Footer>
+ {withCancelButton && <Button onClick={onClose}>{t`Cancel`}</Button>}
+ <Button
+ data-autofocus
+ disabled={!secretKey}
+ onClick={() => onConfirm(secretKey)}
+ variant="filled"
+ >
+ {confirmLabel}
+ </Button>
+ </Modal.Footer>
</Modal>
);
};
diff --git a/frontend/src/metabase/home/components/CustomHomePageModal/CustomHomePageModal.tsx b/frontend/src/metabase/home/components/CustomHomePageModal/CustomHomePageModal.tsx
index 060a9160c91..d84cd9ac883 100644
--- a/frontend/src/metabase/home/components/CustomHomePageModal/CustomHomePageModal.tsx
+++ b/frontend/src/metabase/home/components/CustomHomePageModal/CustomHomePageModal.tsx
@@ -8,7 +8,7 @@ import CS from "metabase/css/core/index.css";
import { useDispatch } from "metabase/redux";
import { addUndo, dismissUndo } from "metabase/redux/undo";
import { useUpdateSettingsMutation } from "metabase/settings";
-import { Box, Button, Flex, Modal, Text } from "metabase/ui";
+import { Box, Button, Modal, Text } from "metabase/ui";
import type { DashboardId } from "metabase-types/api";
const CUSTOM_HOMEPAGE_SETTING_KEY = "custom-homepage";
@@ -85,28 +85,26 @@ export const CustomHomePageModal = ({
onClose={handleClose}
size="544px"
>
- <Box mt="sm">
- <Text>
- {t`If anyone lacks permission to see the dashboard you pick, they'll be redirected to the default homepage.`}
- </Text>
- <Text mt="sm">{jt`You can always change the homepage in ${<Link key="link" className={CS.link} to="/admin/settings/general" style={{ textDecoration: "underline" }}>{t`admin settings`}</Link>} under General.`}</Text>
- <Box mt="xl">
- <DashboardSelector
- value={dashboardId}
- fullWidth={false}
- onChange={handleChange}
- />
- </Box>
+ <Text>
+ {t`If anyone lacks permission to see the dashboard you pick, they'll be redirected to the default homepage.`}
+ </Text>
+ <Text mt="sm">{jt`You can always change the homepage in ${<Link key="link" className={CS.link} to="/admin/settings/general" style={{ textDecoration: "underline" }}>{t`admin settings`}</Link>} under General.`}</Text>
+ <Box mt="xl">
+ <DashboardSelector
+ value={dashboardId}
+ fullWidth={false}
+ onChange={handleChange}
+ />
</Box>
- <Flex mt="xl" justify="flex-end" gap="0.5rem">
+ <Modal.Footer>
<Button variant="subtle" color="neutral" onClick={handleClose}>
{t`Cancel`}
</Button>
<Button variant="filled" disabled={!dashboardId} onClick={handleSave}>
{t`Done`}
</Button>
- </Flex>
+ </Modal.Footer>
</Modal>
);
};
diff --git a/frontend/src/metabase/metabot/components/AIProviderConfigurationForm/ProviderConnectionModal.tsx b/frontend/src/metabase/metabot/components/AIProviderConfigurationForm/ProviderConnectionModal.tsx
index ec066f7b5f7..55caee56a82 100644
--- a/frontend/src/metabase/metabot/components/AIProviderConfigurationForm/ProviderConnectionModal.tsx
+++ b/frontend/src/metabase/metabot/components/AIProviderConfigurationForm/ProviderConnectionModal.tsx
@@ -19,10 +19,10 @@ export function ProviderConnectionModal({
}) {
return (
<Modal
+ density="relaxed"
opened
onClose={() => onClose()}
title={connection ? t`Edit provider` : t`Add a provider`}
- padding="xxl"
size="lg"
>
<ProviderConnectionForm
diff --git a/frontend/src/metabase/metabot/components/MetabotChat/MetabotAgentDataSourcePills.tsx b/frontend/src/metabase/metabot/components/MetabotChat/MetabotAgentDataSourcePills.tsx
index bdeec90d69c..162781d033a 100644
--- a/frontend/src/metabase/metabot/components/MetabotChat/MetabotAgentDataSourcePills.tsx
+++ b/frontend/src/metabase/metabot/components/MetabotChat/MetabotAgentDataSourcePills.tsx
@@ -328,25 +328,23 @@ const SourceFeedbackModal = ({
title={t`Give feedback`}
data-testid="metabot-source-feedback-modal"
>
- <Stack gap="lg">
- <Stack
- gap={0}
- bdrs="sm"
- bd="1px solid var(--mb-color-border-neutral)"
- className={S.feedbackList}
- >
- {sources.map((source) => (
- <SourceFeedbackRow
- key={`${source.model}-${source.id}`}
- messageId={messageId}
- source={source}
- />
- ))}
- </Stack>
- <Group justify="flex-end">
- <Button variant="filled" onClick={onClose}>{t`Done`}</Button>
- </Group>
+ <Stack
+ gap={0}
+ bdrs="sm"
+ bd="1px solid var(--mb-color-border-neutral)"
+ className={S.feedbackList}
+ >
+ {sources.map((source) => (
+ <SourceFeedbackRow
+ key={`${source.model}-${source.id}`}
+ messageId={messageId}
+ source={source}
+ />
+ ))}
</Stack>
+ <Modal.Footer>
+ <Button variant="filled" onClick={onClose}>{t`Done`}</Button>
+ </Modal.Footer>
</Modal>
);
diff --git a/frontend/src/metabase/metabot/components/MetabotChat/MetabotFeedbackModal.tsx b/frontend/src/metabase/metabot/components/MetabotChat/MetabotFeedbackModal.tsx
index b49f88a7668..cf04fe353cf 100644
--- a/frontend/src/metabase/metabot/components/MetabotChat/MetabotFeedbackModal.tsx
+++ b/frontend/src/metabase/metabot/components/MetabotChat/MetabotFeedbackModal.tsx
@@ -8,7 +8,7 @@ import { FormTextarea } from "metabase/forms/components/FormTextarea";
import { useSelector } from "metabase/redux";
import { getApplicationName } from "metabase/selectors/whitelabel";
import { useSetting } from "metabase/settings";
-import { Button, Group, Modal, Stack, Text } from "metabase/ui";
+import { Button, Modal, Stack, Text } from "metabase/ui";
import * as Errors from "metabase/utils/errors";
import type { MetabotFeedback, MetabotIssueType } from "metabase-types/api";
@@ -86,6 +86,7 @@ export const MetabotFeedbackModal = ({
return (
<Modal
+ density="relaxed"
opened
onClose={onClose}
size="md"
@@ -101,7 +102,7 @@ export const MetabotFeedbackModal = ({
onSubmit={handleSubmit}
>
<Form>
- <Stack gap="lg">
+ <Stack gap="xl">
{!positive && (
<Stack gap="xxs">
<Text>{t`What kind of issue are you reporting? (optional)`}</Text>
@@ -133,16 +134,15 @@ export const MetabotFeedbackModal = ({
{c("{0} is the name of the application, usually 'Metabase'")
.t`Please submit this report to ${applicationName}. Note that it may contain sensitive data from your conversation.`}
</Text>
-
- <Group justify="flex-end" gap="lg" mt="lg">
- <Button variant="subtle" color="neutral" onClick={onClose}>
- {t`Cancel`}
- </Button>
- <Button variant="filled" type="submit">{c(
- "This is a verb, not a noun",
- ).t`Submit`}</Button>
- </Group>
</Stack>
+ <Modal.Footer>
+ <Button variant="subtle" color="neutral" onClick={onClose}>
+ {t`Cancel`}
+ </Button>
+ <Button variant="filled" type="submit">{c(
+ "This is a verb, not a noun",
+ ).t`Submit`}</Button>
+ </Modal.Footer>
</Form>
</FormProvider>
</Modal>
diff --git a/frontend/src/metabase/metadata/components/FieldValuesModal/FieldValuesModal.tsx b/frontend/src/metabase/metadata/components/FieldValuesModal/FieldValuesModal.tsx
index ea894a3045a..df53d1ee1f6 100644
--- a/frontend/src/metabase/metadata/components/FieldValuesModal/FieldValuesModal.tsx
+++ b/frontend/src/metabase/metadata/components/FieldValuesModal/FieldValuesModal.tsx
@@ -24,12 +24,11 @@ export const FieldValuesModal = ({
return (
<Modal
opened={isOpen}
- padding="xxl"
size={rem(512)}
title={t`Field values`}
onClose={onClose}
>
- <Stack gap="lg" pt="sm">
+ <Stack gap="lg">
<Text c="text-secondary" size="sm">
{t`${applicationName} can scan the values in this table to enable checkbox filters in dashboards and questions.`}
</Text>
diff --git a/frontend/src/metabase/metadata/components/SyncOptionsModal/SyncOptionsModal.tsx b/frontend/src/metabase/metadata/components/SyncOptionsModal/SyncOptionsModal.tsx
index 67bf97b502e..6dcb3fc3377 100644
--- a/frontend/src/metabase/metadata/components/SyncOptionsModal/SyncOptionsModal.tsx
+++ b/frontend/src/metabase/metadata/components/SyncOptionsModal/SyncOptionsModal.tsx
@@ -20,13 +20,13 @@ export const SyncOptionsModal = ({
}: SyncOptionsModalProps) => {
return (
<Modal
+ density="relaxed"
opened={isOpen}
- padding="xxl"
size={rem(512)}
title={t`Syncing and scanning`}
onClose={onClose}
>
- <Stack gap="xxl" pt="xl">
+ <Stack gap="xl">
<Stack gap="lg">
<Stack gap="xxs">
<Text fw="bold">{t`Re-sync schema`}</Text>
diff --git a/frontend/src/metabase/metrics/pages/NewMetricPage/CreateMetricModal/CreateMetricModal.tsx b/frontend/src/metabase/metrics/pages/NewMetricPage/CreateMetricModal/CreateMetricModal.tsx
index 9781c2a23d3..ed61eaf03c3 100644
--- a/frontend/src/metabase/metrics/pages/NewMetricPage/CreateMetricModal/CreateMetricModal.tsx
+++ b/frontend/src/metabase/metrics/pages/NewMetricPage/CreateMetricModal/CreateMetricModal.tsx
@@ -13,7 +13,7 @@ import {
FormTextInput,
FormTextarea,
} from "metabase/forms";
-import { Box, Button, Group, Modal, Stack } from "metabase/ui";
+import { Button, Modal, Stack } from "metabase/ui";
import * as Errors from "metabase/utils/errors";
import * as Lib from "metabase-lib";
import type { Card, CreateCardRequest } from "metabase-types/api";
@@ -42,7 +42,12 @@ export function CreateMetricModal({
onClose,
}: CreateMetricModalProps) {
return (
- <Modal title={t`Save your metric`} opened padding="xxl" onClose={onClose}>
+ <Modal
+ density="relaxed"
+ title={t`Save your metric`}
+ opened
+ onClose={onClose}
+ >
<CreateMetricForm
query={query}
defaultValues={defaultValues}
@@ -106,14 +111,12 @@ function CreateMetricForm({
title={t`Where do you want to save this?`}
entityType="metric"
/>
- <Group>
- <Box flex={1}>
- <FormErrorMessage />
- </Box>
- <Button variant="subtle" onClick={onClose}>{t`Back`}</Button>
- <FormSubmitButton label={t`Save`} variant="filled" />
- </Group>
</Stack>
+ <Modal.Footer>
+ <FormErrorMessage flex={1} />
+ <Button variant="subtle" onClick={onClose}>{t`Back`}</Button>
+ <FormSubmitButton label={t`Save`} variant="filled" />
+ </Modal.Footer>
</Form>
</FormProvider>
);
diff --git a/frontend/src/metabase/monitor/tools/notifications/ChangeOwnerModal/ChangeOwnerModal.tsx b/frontend/src/metabase/monitor/tools/notifications/ChangeOwnerModal/ChangeOwnerModal.tsx
index f731da6b01e..551eabf0d79 100644
--- a/frontend/src/metabase/monitor/tools/notifications/ChangeOwnerModal/ChangeOwnerModal.tsx
+++ b/frontend/src/metabase/monitor/tools/notifications/ChangeOwnerModal/ChangeOwnerModal.tsx
@@ -5,7 +5,7 @@ import {
type UserOption,
UserPicker,
} from "metabase/common/components/UserPicker";
-import { Button, Flex, Modal } from "metabase/ui";
+import { Button, Modal } from "metabase/ui";
import type { AdminNotification, UserId } from "metabase-types/api";
type Props = {
@@ -48,21 +48,18 @@ export const ChangeOwnerModal = ({
return (
<Modal opened={opened} onClose={onClose} title={title} size="md">
- <Flex direction="column" gap="lg">
- <UserPicker value={selectedCreator} onChange={setSelectedCreator} />
-
- <Flex justify="flex-end" gap="sm">
- <Button onClick={onClose}>{t`Cancel`}</Button>
- <Button
- variant="filled"
- disabled={selectedCreator === null || isSubmitting}
- loading={isSubmitting}
- onClick={handleSubmit}
- >
- {t`Change owner`}
- </Button>
- </Flex>
- </Flex>
+ <UserPicker value={selectedCreator} onChange={setSelectedCreator} />
+ <Modal.Footer>
+ <Button onClick={onClose}>{t`Cancel`}</Button>
+ <Button
+ variant="filled"
+ disabled={selectedCreator === null || isSubmitting}
+ loading={isSubmitting}
+ onClick={handleSubmit}
+ >
+ {t`Change owner`}
+ </Button>
+ </Modal.Footer>
</Modal>
);
};
diff --git a/frontend/src/metabase/notifications/modals/DeleteAlertConfirmModal.tsx b/frontend/src/metabase/notifications/modals/DeleteAlertConfirmModal.tsx
index 75943a91c5f..0f158dbbdba 100644
--- a/frontend/src/metabase/notifications/modals/DeleteAlertConfirmModal.tsx
+++ b/frontend/src/metabase/notifications/modals/DeleteAlertConfirmModal.tsx
@@ -1,6 +1,6 @@
import { t } from "ttag";
-import { Button, Flex, Modal, Text } from "metabase/ui";
+import { Button, Modal, Text } from "metabase/ui";
type DeleteAlertConfirmModalProps = {
title?: string;
@@ -20,14 +20,14 @@ export const DeleteAlertConfirmModal = ({
size="lg"
onClose={onClose}
>
- <Text py="1rem">{t`This can't be undone.`}</Text>
- <Flex justify="flex-end" gap="0.75rem">
+ <Text>{t`This can't be undone.`}</Text>
+ <Modal.Footer>
<Button onClick={onClose}>{t`Cancel`}</Button>
<Button
variant="filled"
color="negative"
onClick={onConfirm}
>{t`Delete it`}</Button>
- </Flex>
+ </Modal.Footer>
</Modal>
);
diff --git a/frontend/src/metabase/notifications/modals/UnsubscribeConfirmModal.tsx b/frontend/src/metabase/notifications/modals/UnsubscribeConfirmModal.tsx
index 3b36eda195e..c080e0786ee 100644
--- a/frontend/src/metabase/notifications/modals/UnsubscribeConfirmModal.tsx
+++ b/frontend/src/metabase/notifications/modals/UnsubscribeConfirmModal.tsx
@@ -1,6 +1,6 @@
import { t } from "ttag";
-import { Button, Flex, Modal, Text } from "metabase/ui";
+import { Button, Modal, Text } from "metabase/ui";
type UnsubscribeConfirmModalProps = {
onConfirm: () => void;
@@ -18,14 +18,14 @@ export const UnsubscribeConfirmModal = ({
size="lg"
onClose={onClose}
>
- <Text py="1rem">{t`You’ll stop receiving this alert from now on. Depending on your organization’s permissions you might need to ask a moderator to be re-added in the future.`}</Text>
- <Flex justify="flex-end" gap="0.75rem">
+ <Text>{t`You’ll stop receiving this alert from now on. Depending on your organization’s permissions you might need to ask a moderator to be re-added in the future.`}</Text>
+ <Modal.Footer>
<Button onClick={onClose}>{t`Cancel`}</Button>
<Button
variant="filled"
color="negative"
onClick={onConfirm}
>{t`Unsubscribe`}</Button>
- </Flex>
+ </Modal.Footer>
</Modal>
);
diff --git a/frontend/src/metabase/plugins/oss/auth.ts b/frontend/src/metabase/plugins/oss/auth.ts
index 70cc172d6d3..b9f6006bfaa 100644
--- a/frontend/src/metabase/plugins/oss/auth.ts
+++ b/frontend/src/metabase/plugins/oss/auth.ts
@@ -54,7 +54,10 @@ export const PLUGIN_IS_PASSWORD_USER = definePluginSlot(
);
const getDefaultPluginAdminUserFormFields = (): {
- FormLoginAttributes: ComponentType<{ userId?: UserId | null }>;
+ FormLoginAttributes: ComponentType<{
+ userId?: UserId | null;
+ className?: string;
+ }>;
} => ({
FormLoginAttributes: PluginPlaceholder,
});
diff --git a/frontend/src/metabase/reference/components/RevisionMessageModal.tsx b/frontend/src/metabase/reference/components/RevisionMessageModal.tsx
index ec17c7ea9b2..f148caf685f 100644
--- a/frontend/src/metabase/reference/components/RevisionMessageModal.tsx
+++ b/frontend/src/metabase/reference/components/RevisionMessageModal.tsx
@@ -1,6 +1,6 @@
import { t } from "ttag";
-import { Button, Flex, Modal, Textarea } from "metabase/ui";
+import { Button, Modal, Textarea } from "metabase/ui";
interface RevisionMessageModalProps {
opened: boolean;
@@ -42,26 +42,24 @@ export function RevisionMessageModal({
title={t`Reason for changes`}
size="lg"
>
- <Flex direction="column" gap="lg">
- <Textarea
- placeholder={t`Leave a note to explain what changes you made and why they were required`}
- value={field.value}
- onChange={field.onChange}
- name={field.name}
- autosize
- minRows={4}
- />
- <Flex justify="flex-end" gap="sm">
- <Button onClick={onClose}>{t`Cancel`}</Button>
- <Button
- variant="filled"
- onClick={handleAction}
- disabled={submitting || !!field.error}
- >
- {t`Save changes`}
- </Button>
- </Flex>
- </Flex>
+ <Textarea
+ placeholder={t`Leave a note to explain what changes you made and why they were required`}
+ value={field.value}
+ onChange={field.onChange}
+ name={field.name}
+ autosize
+ minRows={4}
+ />
+ <Modal.Footer>
+ <Button onClick={onClose}>{t`Cancel`}</Button>
+ <Button
+ variant="filled"
+ onClick={handleAction}
+ disabled={submitting || !!field.error}
+ >
+ {t`Save changes`}
+ </Button>
+ </Modal.Footer>
</Modal>
);
}
diff --git a/frontend/src/metabase/timelines/common/components/TimelineForm/IconField.tsx b/frontend/src/metabase/timelines/common/components/TimelineForm/IconField.tsx
index 41f3b25cda8..7c048e668c0 100644
--- a/frontend/src/metabase/timelines/common/components/TimelineForm/IconField.tsx
+++ b/frontend/src/metabase/timelines/common/components/TimelineForm/IconField.tsx
@@ -17,7 +17,12 @@ export function IconField({
const [{ value, onBlur }, { error, touched }, { setValue }] = useField(name);
return (
- <FormField title={title} htmlFor={id} error={touched ? error : undefined}>
+ <FormField
+ mb="lg"
+ title={title}
+ htmlFor={id}
+ error={touched ? error : undefined}
+ >
<Select
id={id}
name={name}
diff --git a/frontend/src/metabase/transforms/components/CreateTransformCollectionModal/CreateTransformCollectionModal.tsx b/frontend/src/metabase/transforms/components/CreateTransformCollectionModal/CreateTransformCollectionModal.tsx
index 237c24d4b66..27c16ec3d0e 100644
--- a/frontend/src/metabase/transforms/components/CreateTransformCollectionModal/CreateTransformCollectionModal.tsx
+++ b/frontend/src/metabase/transforms/components/CreateTransformCollectionModal/CreateTransformCollectionModal.tsx
@@ -17,7 +17,7 @@ import {
FormTextInput,
FormTextarea,
} from "metabase/forms";
-import { Button, Group, Modal, Stack } from "metabase/ui";
+import { Button, Modal, Stack } from "metabase/ui";
import type { Collection } from "metabase-types/api";
type CreateTransformCollectionModalProps = {
@@ -65,10 +65,10 @@ export function CreateTransformCollectionModal({
return (
<Modal
+ density="relaxed"
title={t`Transform folder`}
opened
onClose={onClose}
- padding="xxl"
onKeyDown={stopPropagation}
>
<FormProvider
@@ -77,7 +77,7 @@ export function CreateTransformCollectionModal({
onSubmit={handleSubmit}
>
<Form>
- <Stack gap="xl" mt="sm">
+ <Stack gap="xl">
<FormTextInput
name="name"
label={t`Name`}
@@ -95,14 +95,14 @@ export function CreateTransformCollectionModal({
title={t`Parent collection`}
collectionPickerModalProps={{ namespaces: ["transforms"] }}
/>
- <Group justify="flex-end">
- <FormErrorMessage />
- <Button variant="subtle" color="neutral" onClick={onClose}>
- {t`Cancel`}
- </Button>
- <FormSubmitButton label={t`Create`} variant="filled" />
- </Group>
</Stack>
+ <Modal.Footer>
+ <FormErrorMessage flex={1} />
+ <Button variant="subtle" color="neutral" onClick={onClose}>
+ {t`Cancel`}
+ </Button>
+ <FormSubmitButton label={t`Create`} variant="filled" />
+ </Modal.Footer>
</Form>
</FormProvider>
</Modal>
diff --git a/frontend/src/metabase/transforms/components/JobListMoreMenu/DisableAllJobsModal/DisableAllJobsModal.tsx b/frontend/src/metabase/transforms/components/JobListMoreMenu/DisableAllJobsModal/DisableAllJobsModal.tsx
index 7605def90d9..68f138874ea 100644
--- a/frontend/src/metabase/transforms/components/JobListMoreMenu/DisableAllJobsModal/DisableAllJobsModal.tsx
+++ b/frontend/src/metabase/transforms/components/JobListMoreMenu/DisableAllJobsModal/DisableAllJobsModal.tsx
@@ -7,7 +7,7 @@ import {
FormProvider,
FormSubmitButton,
} from "metabase/forms";
-import { Box, Button, FocusTrap, Group, Modal, Stack, Text } from "metabase/ui";
+import { Button, FocusTrap, Modal, Text } from "metabase/ui";
type DisableAllJobsModalProps = {
onConfirm: () => void;
@@ -22,7 +22,6 @@ export function DisableAllJobsModal({
<Modal
title={t`Disable all jobs?`}
opened
- padding="xxl"
onClose={onClose}
onClick={(event) => event.stopPropagation()}
>
@@ -46,18 +45,14 @@ function DisableAllJobsForm({ onConfirm, onClose }: DisableAllJobsModalProps) {
return (
<FormProvider initialValues={{}} onSubmit={handleSubmit}>
<Form>
- <Stack gap="xl">
- <Text>
- {t`Any jobs that are currently running will finish and no new job runs will start.`}
- </Text>
- <Group>
- <Box flex={1}>
- <FormErrorMessage />
- </Box>
- <Button onClick={onClose}>{t`Cancel`}</Button>
- <FormSubmitButton label={t`Disable all`} variant="filled" />
- </Group>
- </Stack>
+ <Text>
+ {t`Any jobs that are currently running will finish and no new job runs will start.`}
+ </Text>
+ <Modal.Footer>
+ <FormErrorMessage flex={1} />
+ <Button onClick={onClose}>{t`Cancel`}</Button>
+ <FormSubmitButton label={t`Disable all`} variant="filled" />
+ </Modal.Footer>
</Form>
</FormProvider>
);
diff --git a/frontend/src/metabase/transforms/components/JobMoreMenu/DeleteJobModal/DeleteJobModal.tsx b/frontend/src/metabase/transforms/components/JobMoreMenu/DeleteJobModal/DeleteJobModal.tsx
index cb1106df7f9..4bdeac1557d 100644
--- a/frontend/src/metabase/transforms/components/JobMoreMenu/DeleteJobModal/DeleteJobModal.tsx
+++ b/frontend/src/metabase/transforms/components/JobMoreMenu/DeleteJobModal/DeleteJobModal.tsx
@@ -7,7 +7,7 @@ import {
FormProvider,
FormSubmitButton,
} from "metabase/forms";
-import { Box, Button, FocusTrap, Group, Modal, Stack, Text } from "metabase/ui";
+import { Button, FocusTrap, Modal, Text } from "metabase/ui";
import type { TransformJob } from "metabase-types/api";
type DeleteJobModalProps = {
@@ -22,7 +22,7 @@ export function DeleteJobModal({
onClose,
}: DeleteJobModalProps) {
return (
- <Modal title={t`Delete this job?`} opened padding="xxl" onClose={onClose}>
+ <Modal title={t`Delete this job?`} opened onClose={onClose}>
<FocusTrap.InitialFocus />
<DeleteJobForm job={job} onDelete={onDelete} onClose={onClose} />
</Modal>
@@ -46,20 +46,16 @@ function DeleteJobForm({ job, onDelete, onClose }: DeleteJobFormProps) {
return (
<FormProvider initialValues={{}} onSubmit={handleSubmit}>
<Form>
- <Stack gap="xl">
- <Text>{t`Deleting this job won’t delete any transforms.`}</Text>
- <Group>
- <Box flex={1}>
- <FormErrorMessage />
- </Box>
- <Button onClick={onClose}>{t`Cancel`}</Button>
- <FormSubmitButton
- label={t`Delete job`}
- variant="filled"
- color="negative"
- />
- </Group>
- </Stack>
+ <Text>{t`Deleting this job won’t delete any transforms.`}</Text>
+ <Modal.Footer>
+ <FormErrorMessage flex={1} />
+ <Button onClick={onClose}>{t`Cancel`}</Button>
+ <FormSubmitButton
+ label={t`Delete job`}
+ variant="filled"
+ color="negative"
+ />
+ </Modal.Footer>
</Form>
</FormProvider>
);
diff --git a/frontend/src/metabase/transforms/components/RunInfo/RunInfo.tsx b/frontend/src/metabase/transforms/components/RunInfo/RunInfo.tsx
index 278e825a94c..471d2244e06 100644
--- a/frontend/src/metabase/transforms/components/RunInfo/RunInfo.tsx
+++ b/frontend/src/metabase/transforms/components/RunInfo/RunInfo.tsx
@@ -10,10 +10,8 @@ import {
Box,
Button,
FocusTrap,
- Group,
Icon,
Modal,
- Stack,
Tooltip,
} from "metabase/ui";
import type { TransformRunStatus } from "metabase-types/api";
@@ -55,7 +53,6 @@ export function RunInfo({ status, message, endTime }: RunInfoProps) {
<Modal
title={getTitle(status, endTime)}
size="xl"
- padding="xxl"
opened
onClick={handleModalClick}
onClose={close}
@@ -98,16 +95,16 @@ type RunErrorModalContentProps = {
function RunInfoModalContent({ message, onClose }: RunErrorModalContentProps) {
return (
- <Stack pt="lg" gap="xl">
+ <>
<Box className={S.codeContainer} pos="relative" pr="xl">
<CodeEditor value={message} readOnly />
<Box p="sm" pos="absolute" right={0} top={0}>
<CopyButton value={message} />
</Box>
</Box>
- <Group justify="end">
+ <Modal.Footer>
<Button onClick={onClose}>{t`Close`}</Button>
- </Group>
- </Stack>
+ </Modal.Footer>
+ </>
);
}
diff --git a/frontend/src/metabase/transforms/components/TagMultiSelect/DeleteTagModal/DeleteTagModal.tsx b/frontend/src/metabase/transforms/components/TagMultiSelect/DeleteTagModal/DeleteTagModal.tsx
index e4ecb7ee05c..f674ee69bc4 100644
--- a/frontend/src/metabase/transforms/components/TagMultiSelect/DeleteTagModal/DeleteTagModal.tsx
+++ b/frontend/src/metabase/transforms/components/TagMultiSelect/DeleteTagModal/DeleteTagModal.tsx
@@ -7,7 +7,7 @@ import {
FormProvider,
FormSubmitButton,
} from "metabase/forms";
-import { Box, Button, FocusTrap, Group, Modal, Stack, Text } from "metabase/ui";
+import { Button, FocusTrap, Modal, Text } from "metabase/ui";
import type { TransformTag } from "metabase-types/api";
type DeleteTagModalProps = {
@@ -22,12 +22,7 @@ export function DeleteTagModal({
onClose,
}: DeleteTagModalProps) {
return (
- <Modal
- title={t`Delete the ${tag.name} tag?`}
- opened
- padding="xxl"
- onClose={onClose}
- >
+ <Modal title={t`Delete the ${tag.name} tag?`} opened onClose={onClose}>
<FocusTrap.InitialFocus />
<DeleteTagForm tag={tag} onDelete={onDelete} onClose={onClose} />
</Modal>
@@ -51,20 +46,16 @@ function DeleteTagForm({ tag, onDelete, onClose }: DeleteTagFormProps) {
return (
<FormProvider initialValues={{}} onSubmit={handleSubmit}>
<Form>
- <Stack gap="xl">
- <Text>{t`The tag will be deleted from transforms and jobs that use it.`}</Text>
- <Group>
- <Box flex={1}>
- <FormErrorMessage />
- </Box>
- <Button onClick={onClose}>{t`Cancel`}</Button>
- <FormSubmitButton
- label={t`Delete tag`}
- variant="filled"
- color="negative"
- />
- </Group>
- </Stack>
+ <Text>{t`The tag will be deleted from transforms and jobs that use it.`}</Text>
+ <Modal.Footer>
+ <FormErrorMessage flex={1} />
+ <Button onClick={onClose}>{t`Cancel`}</Button>
+ <FormSubmitButton
+ label={t`Delete tag`}
+ variant="filled"
+ color="negative"
+ />
+ </Modal.Footer>
</Form>
</FormProvider>
);
diff --git a/frontend/src/metabase/transforms/components/TagMultiSelect/UpdateTagModal/UpdateTagModal.tsx b/frontend/src/metabase/transforms/components/TagMultiSelect/UpdateTagModal/UpdateTagModal.tsx
index f8000b8e695..fe7cad58fc5 100644
--- a/frontend/src/metabase/transforms/components/TagMultiSelect/UpdateTagModal/UpdateTagModal.tsx
+++ b/frontend/src/metabase/transforms/components/TagMultiSelect/UpdateTagModal/UpdateTagModal.tsx
@@ -10,7 +10,7 @@ import {
FormSubmitButton,
FormTextInput,
} from "metabase/forms";
-import { Box, Button, FocusTrap, Group, Modal, Stack } from "metabase/ui";
+import { Button, FocusTrap, Modal } from "metabase/ui";
import * as Errors from "metabase/utils/errors";
import type { TransformTag } from "metabase-types/api";
@@ -26,12 +26,7 @@ export function UpdateTagModal({
onClose,
}: UpdateTagModalProps) {
return (
- <Modal
- title={t`Rename the ${tag.name} tag`}
- opened
- padding="xxl"
- onClose={onClose}
- >
+ <Modal title={t`Rename the ${tag.name} tag`} opened onClose={onClose}>
<FocusTrap.InitialFocus />
<UpdateTagForm tag={tag} onUpdate={onUpdate} onClose={onClose} />
</Modal>
@@ -73,24 +68,16 @@ function UpdateTagForm({ tag, onUpdate, onClose }: UpdateTagFormProps) {
>
{({ dirty }) => (
<Form>
- <Stack gap="xl">
- <FormTextInput
- name="name"
- label={t`Name`}
- placeholder={t`My tag`}
+ <FormTextInput name="name" label={t`Name`} placeholder={t`My tag`} />
+ <Modal.Footer>
+ <FormErrorMessage flex={1} />
+ <Button onClick={onClose}>{t`Cancel`}</Button>
+ <FormSubmitButton
+ label={t`Save`}
+ variant="filled"
+ disabled={!dirty}
/>
- <Group>
- <Box flex={1}>
- <FormErrorMessage />
- </Box>
- <Button onClick={onClose}>{t`Cancel`}</Button>
- <FormSubmitButton
- label={t`Save`}
- variant="filled"
- disabled={!dirty}
- />
- </Group>
- </Stack>
+ </Modal.Footer>
</Form>
)}
</FormProvider>
diff --git a/frontend/src/metabase/transforms/components/TransformHeader/TransformMoreMenu/DeleteTransformModal/TransformDeleteModal.tsx b/frontend/src/metabase/transforms/components/TransformHeader/TransformMoreMenu/DeleteTransformModal/TransformDeleteModal.tsx
index 4e457c85a31..62f7e523af6 100644
--- a/frontend/src/metabase/transforms/components/TransformHeader/TransformMoreMenu/DeleteTransformModal/TransformDeleteModal.tsx
+++ b/frontend/src/metabase/transforms/components/TransformHeader/TransformMoreMenu/DeleteTransformModal/TransformDeleteModal.tsx
@@ -14,16 +14,7 @@ import {
FormSubmitButton,
} from "metabase/forms";
import { deleteTransformAndTrack } from "metabase/transforms/analytics";
-import {
- Box,
- Button,
- FocusTrap,
- Group,
- Modal,
- Radio,
- Stack,
- Text,
-} from "metabase/ui";
+import { Button, FocusTrap, Modal, Radio, Stack, Text } from "metabase/ui";
import type { Transform } from "metabase-types/api";
type DeleteTransformModalProps = {
@@ -44,12 +35,7 @@ export function DeleteTransformModal({
} = useGetTransformQuery(transform.id);
return (
- <Modal
- title={getModalTitle(transform)}
- opened
- padding="xxl"
- onClose={onClose}
- >
+ <Modal title={getModalTitle(transform)} opened onClose={onClose}>
<FocusTrap.InitialFocus />
{isLoading || error != null || transformWithTable == null ? (
<LoadingAndErrorWrapper loading={isLoading} error={error} />
@@ -115,18 +101,16 @@ function DeleteTransformForm({
</Stack>
</Radio.Group>
)}
- <Group>
- <Box flex={1}>
- <FormErrorMessage />
- </Box>
- <Button onClick={onClose}>{t`Cancel`}</Button>
- <FormSubmitButton
- label={getSubmitButtonLabel(transform, shouldDeleteTarget)}
- variant="filled"
- color="negative"
- />
- </Group>
</Stack>
+ <Modal.Footer>
+ <FormErrorMessage flex={1} />
+ <Button onClick={onClose}>{t`Cancel`}</Button>
+ <FormSubmitButton
+ label={getSubmitButtonLabel(transform, shouldDeleteTarget)}
+ variant="filled"
+ color="negative"
+ />
+ </Modal.Footer>
</Form>
</FormProvider>
);
diff --git a/frontend/src/metabase/transforms/pages/NewTransformPage/CreateTransformModal/CreateTransformModal.tsx b/frontend/src/metabase/transforms/pages/NewTransformPage/CreateTransformModal/CreateTransformModal.tsx
index d6922499b96..8f3a421c210 100644
--- a/frontend/src/metabase/transforms/pages/NewTransformPage/CreateTransformModal/CreateTransformModal.tsx
+++ b/frontend/src/metabase/transforms/pages/NewTransformPage/CreateTransformModal/CreateTransformModal.tsx
@@ -20,7 +20,7 @@ import {
FormTextInput,
} from "metabase/forms";
import { IncrementalTransformSettings } from "metabase/transforms/components/IncrementalTransform/IncrementalTransformSettings";
-import { Box, Button, Group, Modal, Stack } from "metabase/ui";
+import { Button, Modal, Stack } from "metabase/ui";
import type {
SchemaName,
Transform,
@@ -120,9 +120,9 @@ export function CreateTransformModal({
return (
<Modal
+ density="relaxed"
title={t`Save your transform`}
opened
- padding="xxl"
closeOnEscape={closeOnEscape}
onClose={onClose}
>
@@ -171,7 +171,7 @@ function CreateTransformForm({
return (
<Form>
- <Stack gap="xl" mt="sm">
+ <Stack gap="xl">
<FormTextInput
name="name"
label={t`Name`}
@@ -190,7 +190,6 @@ function CreateTransformForm({
name="collection_id"
title={t`Collection`}
collectionPickerModalProps={{ namespaces: ["transforms"] }}
- style={{ marginBottom: 0 }}
/>
{showIncrementalSettings && (
<IncrementalTransformSettings
@@ -199,14 +198,12 @@ function CreateTransformForm({
onIncrementalChange={handleIncrementalChange}
/>
)}
- <Group>
- <Box flex={1}>
- <FormErrorMessage />
- </Box>
- <Button onClick={onClose}>{t`Back`}</Button>
- <FormSubmitButton label={t`Save`} variant="filled" />
- </Group>
</Stack>
+ <Modal.Footer>
+ <FormErrorMessage flex={1} />
+ <Button onClick={onClose}>{t`Back`}</Button>
+ <FormSubmitButton label={t`Save`} variant="filled" />
+ </Modal.Footer>
</Form>
);
}
diff --git a/frontend/src/metabase/transforms/pages/TransformIndexesPage/IndexEditorModal/IndexEditorForm.tsx b/frontend/src/metabase/transforms/pages/TransformIndexesPage/IndexEditorModal/IndexEditorForm.tsx
index e4402764c8e..4afcac19ca0 100644
--- a/frontend/src/metabase/transforms/pages/TransformIndexesPage/IndexEditorModal/IndexEditorForm.tsx
+++ b/frontend/src/metabase/transforms/pages/TransformIndexesPage/IndexEditorModal/IndexEditorForm.tsx
@@ -5,7 +5,7 @@ import { Form, FormSubmitButton } from "metabase/forms";
import {
Button,
type ComboboxItem,
- Group,
+ Modal,
Select,
SelectItemWithDescription,
Stack,
@@ -44,7 +44,7 @@ export function IndexEditorForm({
return (
<Form>
- <Stack gap="xl" mt="sm">
+ <Stack gap="xl">
{firstField && (
<IndexFieldInput
key={firstField.name}
@@ -86,16 +86,15 @@ export function IndexEditorForm({
disabled={isEditing && field.name === "name"}
/>
))}
-
- <Group justify="flex-end">
- <Button
- variant="subtle"
- color="neutral"
- onClick={onClose}
- >{t`Cancel`}</Button>
- <FormSubmitButton label={submitLabel} variant="filled" />
- </Group>
</Stack>
+ <Modal.Footer>
+ <Button
+ variant="subtle"
+ color="neutral"
+ onClick={onClose}
+ >{t`Cancel`}</Button>
+ <FormSubmitButton label={submitLabel} variant="filled" />
+ </Modal.Footer>
</Form>
);
}
diff --git a/frontend/src/metabase/transforms/pages/TransformIndexesPage/IndexEditorModal/IndexEditorModal.tsx b/frontend/src/metabase/transforms/pages/TransformIndexesPage/IndexEditorModal/IndexEditorModal.tsx
index 19a91856eef..7c459d3aa1a 100644
--- a/frontend/src/metabase/transforms/pages/TransformIndexesPage/IndexEditorModal/IndexEditorModal.tsx
+++ b/frontend/src/metabase/transforms/pages/TransformIndexesPage/IndexEditorModal/IndexEditorModal.tsx
@@ -131,9 +131,9 @@ export function IndexEditorModal({
return (
<Modal
+ density="relaxed"
opened
title={isEditing ? t`Edit index` : t`Create an index`}
- padding="xxl"
onClose={onClose}
>
{isLoading || error !== undefined ? (
diff --git a/frontend/src/metabase/transforms/pages/TransformRunPage/RunSection/RunDagConfirmModal.tsx b/frontend/src/metabase/transforms/pages/TransformRunPage/RunSection/RunDagConfirmModal.tsx
index 499df3458f3..de5726d67fe 100644
--- a/frontend/src/metabase/transforms/pages/TransformRunPage/RunSection/RunDagConfirmModal.tsx
+++ b/frontend/src/metabase/transforms/pages/TransformRunPage/RunSection/RunDagConfirmModal.tsx
@@ -4,7 +4,6 @@ import { skipToken, useListDagTransformsQuery } from "metabase/api";
import {
Button,
Center,
- Group,
List,
Loader,
Modal,
@@ -39,12 +38,7 @@ export function RunDagConfirmModal({
: t`Run this and all downstream transforms?`;
return (
- <Modal
- opened={direction != null}
- title={title}
- padding="xxl"
- onClose={onClose}
- >
+ <Modal opened={direction != null} title={title} onClose={onClose}>
<Stack gap="xl">
<Text>{t`These transforms will be run:`}</Text>
{isFetching ? (
@@ -60,17 +54,17 @@ export function RunDagConfirmModal({
</List>
</ScrollArea.Autosize>
)}
- <Group justify="flex-end">
- <Button onClick={onClose}>{t`Cancel`}</Button>
- <Button
- variant="filled"
- disabled={isFetching || isConfirming}
- onClick={onConfirm}
- >
- {t`Run all`}
- </Button>
- </Group>
</Stack>
+ <Modal.Footer>
+ <Button onClick={onClose}>{t`Cancel`}</Button>
+ <Button
+ variant="filled"
+ disabled={isFetching || isConfirming}
+ onClick={onConfirm}
+ >
+ {t`Run all`}
+ </Button>
+ </Modal.Footer>
</Modal>
);
}
diff --git a/frontend/src/metabase/transforms/pages/TransformSettingsPage/TransformSettingsSection/UpdateTargetModal/UpdateTargetModal.tsx b/frontend/src/metabase/transforms/pages/TransformSettingsPage/TransformSettingsSection/UpdateTargetModal/UpdateTargetModal.tsx
index fd4bb8cdea5..dd257fd48ab 100644
--- a/frontend/src/metabase/transforms/pages/TransformSettingsPage/TransformSettingsSection/UpdateTargetModal/UpdateTargetModal.tsx
+++ b/frontend/src/metabase/transforms/pages/TransformSettingsPage/TransformSettingsSection/UpdateTargetModal/UpdateTargetModal.tsx
@@ -20,15 +20,7 @@ import {
} from "metabase/forms";
import { SchemaFormSelect } from "metabase/transforms/components/SchemaFormSelect";
import { sourceDatabaseId } from "metabase/transforms/utils";
-import {
- Box,
- Button,
- FocusTrap,
- Group,
- Modal,
- Radio,
- Stack,
-} from "metabase/ui";
+import { Button, FocusTrap, Modal, Radio, Stack } from "metabase/ui";
import * as Errors from "metabase/utils/errors";
import type { Transform, UpdateTransformRequest } from "metabase-types/api";
@@ -45,9 +37,9 @@ export function UpdateTargetModal({
}: UpdateTargetModalProps) {
return (
<Modal
+ density="relaxed"
title={t`Change the target for this transform`}
opened
- padding="xxl"
onClose={onClose}
>
<FocusTrap.InitialFocus />
@@ -175,19 +167,17 @@ function UpdateTargetForm({
</Stack>
</Radio.Group>
)}
- <Group>
- <Box flex={1}>
- <FormErrorMessage />
- </Box>
- <Button onClick={onClose}>{t`Cancel`}</Button>
- <FormSubmitButton
- label={getSubmitButtonLabel(shouldDeleteTarget)}
- color={getSubmitButtonColor(shouldDeleteTarget)}
- variant="filled"
- disabled={!dirty}
- />
- </Group>
</Stack>
+ <Modal.Footer>
+ <FormErrorMessage flex={1} />
+ <Button onClick={onClose}>{t`Cancel`}</Button>
+ <FormSubmitButton
+ label={getSubmitButtonLabel(shouldDeleteTarget)}
+ color={getSubmitButtonColor(shouldDeleteTarget)}
+ variant="filled"
+ disabled={!dirty}
+ />
+ </Modal.Footer>
</Form>
)}
</FormProvider>
diff --git a/frontend/src/metabase/ui/components/overlays/Modal/Modal.mdx b/frontend/src/metabase/ui/components/overlays/Modal/Modal.mdx
index 70269ac3f86..ad32e62d004 100644
--- a/frontend/src/metabase/ui/components/overlays/Modal/Modal.mdx
+++ b/frontend/src/metabase/ui/components/overlays/Modal/Modal.mdx
@@ -37,6 +37,13 @@ Don't confuse `layout` with Mantine's `centered` prop, which sets the modal's ve
<Canvas of={ModalStories.Overview} />
+### Density
+
+- `density="default"` leaves 16px below the title and above the buttons. Use it for confirmations, messages and single-input dialogs.
+- `density="relaxed"` leaves 24px instead. Use it when the body is a form with several fields or is split into sections. Space the fields 24px apart (`Stack gap="xl"`) to match.
+
+<Canvas of={ModalStories.WithForm} />
+
### Custom layouts
`Modal.Root`, `Modal.Overlay`, `Modal.Content`, `Modal.Header`, `Modal.Title`, `Modal.CloseButton` and `Modal.Body` are an escape hatch for modals that don't fit the standard structure, such as side sheets. Prefer the props above where you can.
diff --git a/frontend/src/metabase/ui/components/overlays/Modal/Modal.module.css b/frontend/src/metabase/ui/components/overlays/Modal/Modal.module.css
index 76b22034386..ee09ca6ae15 100644
--- a/frontend/src/metabase/ui/components/overlays/Modal/Modal.module.css
+++ b/frontend/src/metabase/ui/components/overlays/Modal/Modal.module.css
@@ -53,6 +53,7 @@
.footer {
display: flex;
+ flex-wrap: wrap;
justify-content: flex-end;
align-items: center;
gap: var(--mantine-spacing-md);
@@ -67,6 +68,16 @@
margin-bottom: var(--mantine-spacing-xxs);
}
+.root[data-density="relaxed"] {
+ .header {
+ padding-bottom: var(--mantine-spacing-xl);
+ }
+
+ .footer {
+ margin-top: var(--mantine-spacing-xl);
+ }
+}
+
.root[data-layout="centered"] {
.header {
justify-content: flex-end;
diff --git a/frontend/src/metabase/ui/components/overlays/Modal/Modal.stories.tsx b/frontend/src/metabase/ui/components/overlays/Modal/Modal.stories.tsx
index b5bb9ce44c5..8c51755d16a 100644
--- a/frontend/src/metabase/ui/components/overlays/Modal/Modal.stories.tsx
+++ b/frontend/src/metabase/ui/components/overlays/Modal/Modal.stories.tsx
@@ -6,8 +6,10 @@ import {
Button,
Checkbox,
Flex,
+ MODAL_DENSITIES,
MODAL_LAYOUTS,
Modal,
+ type ModalDensity,
type ModalLayout,
type ModalProps,
Select,
@@ -30,6 +32,7 @@ const args = {
centered: true,
fullScreen: false,
layout: "default",
+ density: "default",
size: "md",
withCloseButton: true,
};
@@ -45,6 +48,10 @@ const argTypes = {
options: MODAL_LAYOUTS,
control: { type: "inline-radio" },
},
+ density: {
+ options: MODAL_DENSITIES,
+ control: { type: "inline-radio" },
+ },
title: {
control: { type: "text" },
},
@@ -66,7 +73,7 @@ const IllustrationPlaceholder = () => (
const InviteTeammateForm = ({ onCancel }: { onCancel?: () => void }) => (
<form onSubmit={(event) => event.preventDefault()}>
- <Stack gap="md">
+ <Stack gap="xl">
<Text>{"They'll get an email with a link to set up their account."}</Text>
<SimpleGrid cols={2} spacing="md">
<TextInput label="First name" placeholder="Ada" />
@@ -273,6 +280,7 @@ interface OverviewRow {
footer?: ReactNode;
/** Replaces the body and footer, e.g. a form that wraps both */
content?: ReactNode;
+ density?: ModalDensity;
/** Layouts to show the row in. Defaults to all of them */
layouts?: readonly ModalLayout[];
height?: number;
@@ -348,9 +356,10 @@ const OVERVIEW_ROWS: readonly OverviewRow[] = [
id: "form",
label: "Form",
title: "Invite a teammate",
+ density: "relaxed",
content: <InviteTeammateForm />,
layouts: ["default"],
- height: 680,
+ height: 760,
},
];
@@ -388,6 +397,7 @@ const OverviewCell = ({
yOffset={0}
size={432}
layout={layout}
+ density={row.density}
title={row.title}
withCloseButton={row.withCloseButton ?? true}
illustration={
@@ -466,6 +476,7 @@ export const Confirmation = {
export const WithForm = {
render: WithFormTemplate,
name: "With form",
+ args: { density: "relaxed" },
};
export const Centered = {
diff --git a/frontend/src/metabase/ui/components/overlays/Modal/index.tsx b/frontend/src/metabase/ui/components/overlays/Modal/index.tsx
index 65071d5091c..289bfaf2841 100644
--- a/frontend/src/metabase/ui/components/overlays/Modal/index.tsx
+++ b/frontend/src/metabase/ui/components/overlays/Modal/index.tsx
@@ -24,6 +24,31 @@ export const MODAL_LAYOUTS = ["default", "centered"] as const;
export type ModalLayout = (typeof MODAL_LAYOUTS)[number];
+export const MODAL_DENSITIES = ["default", "relaxed"] as const;
+
+export type ModalDensity = (typeof MODAL_DENSITIES)[number];
+
+// Spacing comes from `layout` and `density`, so call sites can't override it.
+type ForbiddenMantineModalProps =
+ | "m"
+ | "mx"
+ | "my"
+ | "mt"
+ | "mb"
+ | "ml"
+ | "mr"
+ | "ms"
+ | "me"
+ | "p"
+ | "px"
+ | "py"
+ | "pt"
+ | "pb"
+ | "pl"
+ | "pr"
+ | "ps"
+ | "pe";
+
interface ModalLayoutProps {
/**
* How the modal's contents are arranged. `default` left-aligns the title
@@ -32,18 +57,29 @@ interface ModalLayoutProps {
* `illustration`) at the top of the body.
*/
layout?: ModalLayout;
+ /**
+ * Space between the header, body and footer. `default` is 16px. `relaxed`
+ * is 24px, for bodies with several fields or sections, such as forms.
+ */
+ density?: ModalDensity;
}
-export interface ModalProps extends MantineModalProps, ModalLayoutProps {
+export interface ModalProps
+ extends
+ Omit<MantineModalProps, ForbiddenMantineModalProps>,
+ ModalLayoutProps {
/** Rendered above the title. Only used by the `centered` layout. */
illustration?: ReactNode;
}
export interface ModalRootProps
- extends MantineModalRootProps, ModalLayoutProps {}
+ extends
+ Omit<MantineModalRootProps, ForbiddenMantineModalProps>,
+ ModalLayoutProps {}
export function Modal({
layout = "default",
+ density = "default",
illustration,
title,
children,
@@ -62,6 +98,7 @@ export function Modal({
<MantineModal
{...props}
data-layout={layout}
+ data-density={density}
title={isCentered ? undefined : title}
closeOnClickOutside={closeProps.closeOnClickOutside}
closeOnEscape={closeProps.closeOnEscape}
@@ -78,7 +115,11 @@ export function Modal({
);
}
-function ModalRoot({ layout = "default", ...props }: ModalRootProps) {
+function ModalRoot({
+ layout = "default",
+ density = "default",
+ ...props
+}: ModalRootProps) {
const closeProps = useGatedCloseProps(props);
useDisableCommandPalette({
@@ -89,6 +130,7 @@ function ModalRoot({ layout = "default", ...props }: ModalRootProps) {
<MantineModal.Root
{...props}
data-layout={layout}
+ data-density={density}
closeOnClickOutside={closeProps.closeOnClickOutside}
closeOnEscape={closeProps.closeOnEscape}
/>