diff --git a/apps/browser/src/vault/popup/components/at-risk-callout/at-risk-password-callout.component.html b/apps/browser/src/vault/popup/components/at-risk-callout/at-risk-password-callout.component.html index 16d9b6a322a..6c2bc3f77a0 100644 --- a/apps/browser/src/vault/popup/components/at-risk-callout/at-risk-password-callout.component.html +++ b/apps/browser/src/vault/popup/components/at-risk-callout/at-risk-password-callout.component.html @@ -1,5 +1,4 @@ - {{ (taskCount === 1 ? "reviewAndChangeAtRiskPassword" : "reviewAndChangeAtRiskPasswordsPlural") diff --git a/libs/components/src/callout/callout.component.html b/libs/components/src/callout/callout.component.html index b98679766d5..e0fe0a182ea 100644 --- a/libs/components/src/callout/callout.component.html +++ b/libs/components/src/callout/callout.component.html @@ -1,24 +1,26 @@ diff --git a/libs/components/src/callout/callout.component.spec.ts b/libs/components/src/callout/callout.component.spec.ts index b7dfe29a643..e052395067d 100644 --- a/libs/components/src/callout/callout.component.spec.ts +++ b/libs/components/src/callout/callout.component.spec.ts @@ -56,5 +56,12 @@ describe("Callout", () => { expect(component.titleComputed()).toBe("Error"); expect(component.iconComputed()).toBe("bwi-error"); }); + + it("default", () => { + fixture.componentRef.setInput("type", "default"); + fixture.detectChanges(); + expect(component.titleComputed()).toBeUndefined(); + expect(component.iconComputed()).toBe("bwi-star"); + }); }); }); diff --git a/libs/components/src/callout/callout.component.ts b/libs/components/src/callout/callout.component.ts index 99a6c2aa123..62321a34d91 100644 --- a/libs/components/src/callout/callout.component.ts +++ b/libs/components/src/callout/callout.component.ts @@ -5,13 +5,14 @@ import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.servic import { SharedModule } from "../shared"; import { TypographyModule } from "../typography"; -export type CalloutTypes = "success" | "info" | "warning" | "danger"; +export type CalloutTypes = "success" | "info" | "warning" | "danger" | "default"; const defaultIcon: Record = { success: "bwi-check-circle", info: "bwi-info-circle", warning: "bwi-exclamation-triangle", danger: "bwi-error", + default: "bwi-star", }; const defaultI18n: Partial> = { @@ -55,13 +56,15 @@ export class CalloutComponent { protected readonly calloutClass = computed(() => { switch (this.type()) { case "danger": - return "tw-bg-danger-100"; + return "tw-bg-danger-100 tw-border-danger-700 tw-text-danger-700"; case "info": - return "tw-bg-info-100"; + return "tw-bg-info-100 tw-bg-info-100 tw-border-info-700 tw-text-info-700"; case "success": - return "tw-bg-success-100"; + return "tw-bg-success-100 tw-bg-success-100 tw-border-success-700 tw-text-success-700"; case "warning": - return "tw-bg-warning-100"; + return "tw-bg-warning-100 tw-bg-warning-100 tw-border-warning-700 tw-text-warning-700"; + case "default": + return "tw-bg-background-alt tw-border-secondary-700 tw-text-secondary-700"; } }); } diff --git a/libs/components/src/callout/callout.mdx b/libs/components/src/callout/callout.mdx index a1254b3f691..297a2ffd0a3 100644 --- a/libs/components/src/callout/callout.mdx +++ b/libs/components/src/callout/callout.mdx @@ -41,6 +41,12 @@ automatically be checked. +### Default + +Use for similar cases as the info callout but when content does not need to be as prominent. + + + ### Warning Use a warning callout if the user is about to perform an action that may have unintended or @@ -67,4 +73,8 @@ Use the `role=”alert”` only if the callout is appearing on a page after the the content is static, do not use the alert role. This will cause a screen reader to announce the callout content on page load. -Ensure the title's color contrast remains WCAG compliant with the callout's background. +Ensure color contrast remains WCAG compliant with the callout's background. This is especially +important when adding `bit-link` or `bit-button` to the content area since the callout background is +colored. Currently only the `info` and `default` callouts are WCAG compliant for the `primary` +styling of these elements. The `secondary` `bit-link` styling may be used with the remaining +variants. diff --git a/libs/components/src/callout/callout.stories.ts b/libs/components/src/callout/callout.stories.ts index 4ac4191ce7e..c2185203034 100644 --- a/libs/components/src/callout/callout.stories.ts +++ b/libs/components/src/callout/callout.stories.ts @@ -1,6 +1,7 @@ import { Meta, StoryObj, moduleMetadata } from "@storybook/angular"; import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service"; +import { LinkModule, IconModule } from "@bitwarden/components"; import { formatArgsForCodeSnippet } from "../../../../.storybook/format-args-for-code-snippet"; import { I18nMockService } from "../utils/i18n-mock.service"; @@ -12,6 +13,7 @@ export default { component: CalloutComponent, decorators: [ moduleMetadata({ + imports: [LinkModule, IconModule], providers: [ { provide: I18nService, @@ -69,6 +71,14 @@ export const Danger: Story = { }, }; +export const Default: Story = { + ...Info, + args: { + ...Info.args, + type: "default", + }, +}; + export const CustomIcon: Story = { ...Info, args: { @@ -80,6 +90,35 @@ export const CustomIcon: Story = { export const NoTitle: Story = { ...Info, args: { - icon: "bwi-star", + icon: "", + }, +}; + +export const NoTitleWithIcon: Story = { + render: (args) => ({ + props: args, + template: ` + (args)}>The content of the callout + `, + }), + args: { + type: "default", + icon: "bwi-globe", + }, +}; + +export const WithTextButton: Story = { + render: (args) => ({ + props: args, + template: ` + (args)}> +

The content of the callout

+
Visit the help center +
+ `, + }), + args: { + type: "default", + icon: "", }, }; diff --git a/libs/vault/src/cipher-view/cipher-view.component.html b/libs/vault/src/cipher-view/cipher-view.component.html index 62425bba7b3..b523c11c7e3 100644 --- a/libs/vault/src/cipher-view/cipher-view.component.html +++ b/libs/vault/src/cipher-view/cipher-view.component.html @@ -12,7 +12,6 @@ - {{ "changeAtRiskPassword" | i18n }}