From 61243c68e2a78eae58c4d43f55108c174209b63f Mon Sep 17 00:00:00 2001 From: Daniel Riera Date: Thu, 8 May 2025 15:12:13 -0400 Subject: [PATCH] PM-21057 (#14631) --- .../content/components/cipher/cipher-info.ts | 4 +++- .../notification/confirmation/body.ts | 4 ++-- .../notification/confirmation/container.ts | 16 ++++--------- .../notification/confirmation/message.ts | 24 ++++++++++++++++--- .../content/components/notification/header.ts | 4 ++-- .../content/components/rows/button-row.ts | 2 +- 6 files changed, 34 insertions(+), 20 deletions(-) diff --git a/apps/browser/src/autofill/content/components/cipher/cipher-info.ts b/apps/browser/src/autofill/content/components/cipher/cipher-info.ts index 49a629de7a3..877cddfdbf8 100644 --- a/apps/browser/src/autofill/content/components/cipher/cipher-info.ts +++ b/apps/browser/src/autofill/content/components/cipher/cipher-info.ts @@ -29,7 +29,9 @@ export function CipherInfo({ cipher, theme }: CipherInfoProps) { ${login?.username - ? html`${login.username}` + ? html`${login.username}` : null} `; diff --git a/apps/browser/src/autofill/content/components/notification/confirmation/body.ts b/apps/browser/src/autofill/content/components/notification/confirmation/body.ts index 1c744be66ac..caea38718fd 100644 --- a/apps/browser/src/autofill/content/components/notification/confirmation/body.ts +++ b/apps/browser/src/autofill/content/components/notification/confirmation/body.ts @@ -3,7 +3,7 @@ import { html, nothing } from "lit"; import { Theme } from "@bitwarden/common/platform/enums"; -import { themes } from "../../constants/styles"; +import { spacing, themes } from "../../constants/styles"; import { Celebrate, Keyhole, Warning } from "../../illustrations"; import { NotificationConfirmationMessage } from "./message"; @@ -66,7 +66,7 @@ const iconContainerStyles = (error?: string) => css` } `; const notificationConfirmationBodyStyles = ({ theme }: { theme: Theme }) => css` - gap: 16px; + gap: ${spacing[4]}; display: flex; align-items: center; justify-content: flex-start; diff --git a/apps/browser/src/autofill/content/components/notification/confirmation/container.ts b/apps/browser/src/autofill/content/components/notification/confirmation/container.ts index 3b5b77e07a1..7ad6b4542ec 100644 --- a/apps/browser/src/autofill/content/components/notification/confirmation/container.ts +++ b/apps/browser/src/autofill/content/components/notification/confirmation/container.ts @@ -43,7 +43,7 @@ export function NotificationConfirmationContainer({ type, }: NotificationConfirmationContainerProps) { const headerMessage = getHeaderMessage(i18n, type, error); - const confirmationMessage = getConfirmationMessage(i18n, itemName, type, error); + const confirmationMessage = getConfirmationMessage(i18n, type, error); const buttonText = error ? i18n.newItem : i18n.view; const buttonAria = chrome.i18n.getMessage("notificationViewAria", [itemName]); @@ -109,19 +109,13 @@ const notificationContainerStyles = (theme: Theme) => css` } `; -function getConfirmationMessage( - i18n: I18n, - itemName: string, - type?: NotificationType, - error?: string, -) { - const loginSaveConfirmation = chrome.i18n.getMessage("loginSaveConfirmation", [itemName]); - const loginUpdatedConfirmation = chrome.i18n.getMessage("loginUpdatedConfirmation", [itemName]); - +function getConfirmationMessage(i18n: I18n, type?: NotificationType, error?: string) { if (error) { return i18n.saveFailureDetails; } - return type === NotificationTypes.Add ? loginSaveConfirmation : loginUpdatedConfirmation; + return type === NotificationTypes.Add + ? i18n.loginSaveConfirmation + : i18n.loginUpdatedConfirmation; } function getHeaderMessage(i18n: I18n, type?: NotificationType, error?: string) { diff --git a/apps/browser/src/autofill/content/components/notification/confirmation/message.ts b/apps/browser/src/autofill/content/components/notification/confirmation/message.ts index 8f6e817ba77..521fdf45291 100644 --- a/apps/browser/src/autofill/content/components/notification/confirmation/message.ts +++ b/apps/browser/src/autofill/content/components/notification/confirmation/message.ts @@ -3,7 +3,7 @@ import { html, nothing } from "lit"; import { Theme } from "@bitwarden/common/platform/enums"; -import { themes, typography } from "../../constants/styles"; +import { spacing, themes, typography } from "../../constants/styles"; export type NotificationConfirmationMessageProps = { buttonAria?: string; @@ -18,15 +18,17 @@ export type NotificationConfirmationMessageProps = { export function NotificationConfirmationMessage({ buttonAria, buttonText, + itemName, message, messageDetails, handleClick, theme, }: NotificationConfirmationMessageProps) { return html` -
+
${message || buttonText ? html` + ${itemName} css` font-weight: 400; `; +const itemNameStyles = (theme: Theme) => css` + ${baseTextStyles} + + color: ${themes[theme].text.main}; + font-weight: 400; + white-space: nowrap; + max-width: 300px; +`; + const notificationConfirmationButtonTextStyles = (theme: Theme) => css` ${baseTextStyles} diff --git a/apps/browser/src/autofill/content/components/notification/header.ts b/apps/browser/src/autofill/content/components/notification/header.ts index 18b1f25bd74..05ac5693e78 100644 --- a/apps/browser/src/autofill/content/components/notification/header.ts +++ b/apps/browser/src/autofill/content/components/notification/header.ts @@ -4,7 +4,7 @@ import { html } from "lit"; import { Theme, ThemeTypes } from "@bitwarden/common/platform/enums"; import { CloseButton } from "../buttons/close-button"; -import { themes } from "../constants/styles"; +import { spacing, themes } from "../constants/styles"; import { BrandIconContainer } from "../icons/brand-icon-container"; import { NotificationHeaderMessage } from "./header-message"; @@ -47,7 +47,7 @@ const notificationHeaderStyles = ({ standalone: boolean; theme: Theme; }) => css` - gap: 8px; + gap: ${spacing[2]}; display: flex; align-items: center; justify-content: flex-start; diff --git a/apps/browser/src/autofill/content/components/rows/button-row.ts b/apps/browser/src/autofill/content/components/rows/button-row.ts index f6674da6b6e..3527d050b81 100644 --- a/apps/browser/src/autofill/content/components/rows/button-row.ts +++ b/apps/browser/src/autofill/content/components/rows/button-row.ts @@ -51,7 +51,7 @@ export function ButtonRow({ theme, primaryButton, selectButtons }: ButtonRowProp } const buttonRowStyles = css` - gap: 16px; + gap: ${spacing[4]}; display: flex; align-items: center; justify-content: space-between;