diff --git a/apps/browser/src/auth/popup/account-switching/current-account.component.html b/apps/browser/src/auth/popup/account-switching/current-account.component.html index f59a2b08fdd..09342c58756 100644 --- a/apps/browser/src/auth/popup/account-switching/current-account.component.html +++ b/apps/browser/src/auth/popup/account-switching/current-account.component.html @@ -1,4 +1,4 @@ -
+
`, @@ -654,7 +654,7 @@ export const WithVirtualScrollChild: Story = { @defer (on immediate) { - + diff --git a/apps/web/src/app/vault/components/vault-items/vault-items.component.ts b/apps/web/src/app/vault/components/vault-items/vault-items.component.ts index e63b353be9c..96d274727dd 100644 --- a/apps/web/src/app/vault/components/vault-items/vault-items.component.ts +++ b/apps/web/src/app/vault/components/vault-items/vault-items.component.ts @@ -28,8 +28,8 @@ import { VaultItem } from "./vault-item"; import { VaultItemEvent } from "./vault-item-event"; // Fixed manual row height required due to how cdk-virtual-scroll works -export const RowHeight = 75.5; -export const RowHeightClass = `tw-h-[75.5px]`; +export const RowHeight = 75; +export const RowHeightClass = `tw-h-[75px]`; const MaxSelectionCount = 500; diff --git a/bitwarden_license/bit-web/src/app/admin-console/providers/manage/members.component.ts b/bitwarden_license/bit-web/src/app/admin-console/providers/manage/members.component.ts index 9cbe8115008..69d02214717 100644 --- a/bitwarden_license/bit-web/src/app/admin-console/providers/manage/members.component.ts +++ b/bitwarden_license/bit-web/src/app/admin-console/providers/manage/members.component.ts @@ -52,8 +52,8 @@ export class MembersComponent extends BaseMembersComponent { dataSource = new MembersTableDataSource(); loading = true; providerId: string; - rowHeight = 69; - rowHeightClass = `tw-h-[69px]`; + rowHeight = 70; + rowHeightClass = `tw-h-[70px]`; status: ProviderUserStatusType = null; userStatusType = ProviderUserStatusType; diff --git a/libs/angular/src/vault/components/spotlight/spotlight.component.html b/libs/angular/src/vault/components/spotlight/spotlight.component.html index 29d13d2056c..e445640cff9 100644 --- a/libs/angular/src/vault/components/spotlight/spotlight.component.html +++ b/libs/angular/src/vault/components/spotlight/spotlight.component.html @@ -1,5 +1,5 @@
@@ -20,6 +20,7 @@ (click)="handleDismiss()" [attr.title]="'close' | i18n" [attr.aria-label]="'close' | i18n" + class="-tw-me-2" >
diff --git a/libs/components/src/async-actions/in-forms.stories.ts b/libs/components/src/async-actions/in-forms.stories.ts index 7f51a8bdad2..dd901cd2477 100644 --- a/libs/components/src/async-actions/in-forms.stories.ts +++ b/libs/components/src/async-actions/in-forms.stories.ts @@ -35,7 +35,7 @@ const template = ` - + `; @Component({ diff --git a/libs/components/src/banner/banner.component.html b/libs/components/src/banner/banner.component.html index 63b1126104c..581a56d86cb 100644 --- a/libs/components/src/banner/banner.component.html +++ b/libs/components/src/banner/banner.component.html @@ -1,5 +1,5 @@
@if (showClose()) { - + `, }), @@ -369,9 +367,8 @@ export const DisabledButtonInputGroup: Story = { - + + `, }), @@ -387,9 +384,7 @@ export const PartiallyDisabledButtonInputGroup: Story = { - + `, }), diff --git a/libs/components/src/icon-button/icon-button.component.html b/libs/components/src/icon-button/icon-button.component.html index ad8e32dec75..e775a868871 100644 --- a/libs/components/src/icon-button/icon-button.component.html +++ b/libs/components/src/icon-button/icon-button.component.html @@ -1,5 +1,5 @@ - - + + = { contrast: [ - "tw-bg-transparent", "!tw-text-contrast", "tw-border-transparent", - "hover:tw-bg-transparent-hover", - "hover:tw-border-text-contrast", + "hover:!tw-bg-hover-contrast", "focus-visible:before:tw-ring-text-contrast", ...focusRing, ], - main: [ - "tw-bg-transparent", - "!tw-text-main", - "tw-border-transparent", - "hover:tw-bg-transparent-hover", - "hover:tw-border-primary-600", - "focus-visible:before:tw-ring-primary-600", - ...focusRing, - ], + main: ["!tw-text-main", "focus-visible:before:tw-ring-primary-600", ...focusRing], muted: [ - "tw-bg-transparent", "!tw-text-muted", "tw-border-transparent", "aria-expanded:tw-bg-text-muted", "aria-expanded:!tw-text-contrast", - "hover:tw-bg-transparent-hover", - "hover:tw-border-primary-600", "focus-visible:before:tw-ring-primary-600", "aria-expanded:hover:tw-bg-secondary-700", "aria-expanded:hover:tw-border-secondary-700", ...focusRing, ], - primary: [ - "tw-bg-primary-600", - "!tw-text-contrast", - "tw-border-primary-600", - "hover:tw-bg-primary-600", - "hover:tw-border-primary-600", - "focus-visible:before:tw-ring-primary-600", - ...focusRing, - ], - secondary: [ - "tw-bg-transparent", - "!tw-text-muted", - "tw-border-text-muted", - "hover:!tw-text-contrast", - "hover:tw-bg-text-muted", - "focus-visible:before:tw-ring-primary-600", - ...focusRing, - ], - danger: [ - "tw-bg-transparent", - "!tw-text-danger-600", - "tw-border-transparent", - "hover:!tw-text-danger-600", - "hover:tw-bg-transparent", - "hover:tw-border-primary-600", - "focus-visible:before:tw-ring-primary-600", - ...focusRing, - ], - light: [ - "tw-bg-transparent", + primary: ["!tw-text-primary-600", "focus-visible:before:tw-ring-primary-600", ...focusRing], + danger: ["!tw-text-danger-600", "focus-visible:before:tw-ring-primary-600", ...focusRing], + "nav-contrast": [ "!tw-text-alt2", - "tw-border-transparent", - "hover:tw-bg-transparent-hover", - "hover:tw-border-text-alt2", + "hover:!tw-bg-hover-contrast", "focus-visible:before:tw-ring-text-alt2", ...focusRing, ], - unstyled: [], -}; - -const disabledStyles: Record = { - contrast: [ - "disabled:tw-opacity-60", - "disabled:hover:tw-border-transparent", - "disabled:hover:tw-bg-transparent", - ], - main: [ - "disabled:!tw-text-secondary-300", - "disabled:hover:tw-border-transparent", - "disabled:hover:tw-bg-transparent", - ], - muted: [ - "disabled:!tw-text-secondary-300", - "disabled:hover:tw-border-transparent", - "disabled:hover:tw-bg-transparent", - ], - primary: [ - "disabled:tw-opacity-60", - "disabled:hover:tw-border-primary-600", - "disabled:hover:tw-bg-primary-600", - ], - secondary: [ - "disabled:tw-opacity-60", - "disabled:hover:tw-border-text-muted", - "disabled:hover:tw-bg-transparent", - "disabled:hover:!tw-text-muted", - ], - danger: [ - "disabled:!tw-text-secondary-300", - "disabled:hover:tw-border-transparent", - "disabled:hover:tw-bg-transparent", - "disabled:hover:!tw-text-secondary-300", - ], - light: [ - "disabled:tw-opacity-60", - "disabled:hover:tw-border-transparent", - "disabled:hover:tw-bg-transparent", - ], - unstyled: [], }; export type IconButtonSize = "default" | "small"; const sizes: Record = { - default: ["tw-px-2.5", "tw-py-1.5"], - small: ["tw-leading-none", "tw-text-base", "tw-p-1"], + default: ["tw-text-xl", "tw-p-2.5", "tw-rounded-md"], + small: ["tw-text-base", "tw-p-2", "tw-rounded"], }; /** * Icon buttons are used when no text accompanies the button. It consists of an icon that may be updated to any icon in the `bwi-font`, a `title` attribute, and an `aria-label`. @@ -164,6 +80,13 @@ const sizes: Record = { imports: [NgClass], host: { "[attr.disabled]": "disabledAttr()", + /** + * When the `bitIconButton` input is dynamic from a consumer, Angular doesn't put the + * `bitIconButton` attribute into the DOM. We use the attribute as a css selector in + * a number of components, so this manual attr binding makes sure that the css selector + * works when the input is dynamic. + */ + "[attr.bitIconButton]": "icon()", }, }) export class BitIconButtonComponent implements ButtonLikeAbstraction, FocusableElement { @@ -176,17 +99,20 @@ export class BitIconButtonComponent implements ButtonLikeAbstraction, FocusableE @HostBinding("class") get classList() { return [ "tw-font-semibold", - "tw-border", - "tw-border-solid", - "tw-rounded-lg", + "tw-leading-[0px]", + "tw-border-none", "tw-transition", + "tw-bg-transparent", "hover:tw-no-underline", + "hover:tw-bg-hover-default", "focus:tw-outline-none", ] .concat(styles[this.buttonType()]) .concat(sizes[this.size()]) .concat( - this.showDisabledStyles() || this.disabled() ? disabledStyles[this.buttonType()] : [], + this.showDisabledStyles() || this.disabled() + ? ["disabled:tw-opacity-60", "disabled:hover:!tw-bg-transparent"] + : [], ); } diff --git a/libs/components/src/icon-button/icon-button.mdx b/libs/components/src/icon-button/icon-button.mdx index 637a9d7daa0..3fcd4a23583 100644 --- a/libs/components/src/icon-button/icon-button.mdx +++ b/libs/components/src/icon-button/icon-button.mdx @@ -23,9 +23,6 @@ Icon buttons can be found in other components such as: the ## Styles -There are 4 common styles for button main, muted, contrast, and danger. The other styles follow the -button component styles. - ### Main Used for general icon buttons appearing on the theme’s main `background` @@ -59,22 +56,11 @@ square. -### Secondary +### Nav Contrast -Used in place of the main button component if no text is used. This allows the button to display -square. +Used on the side nav background that is dark in both light theme and dark theme. - - -### Light - -Used on a background that is dark in both light theme and dark theme. Example: end user navigation -styles. - - - -**Note:** Main and contrast styles appear on backgrounds where using `primary-700` as a focus -indicator does not meet WCAG graphic contrast guidelines. + ## Sizes diff --git a/libs/components/src/icon-button/icon-button.stories.ts b/libs/components/src/icon-button/icon-button.stories.ts index f63c494f7db..fdcda07f021 100644 --- a/libs/components/src/icon-button/icon-button.stories.ts +++ b/libs/components/src/icon-button/icon-button.stories.ts @@ -49,13 +49,6 @@ export const Primary: Story = { }, }; -export const Secondary: Story = { - ...Default, - args: { - buttonType: "secondary", - }, -}; - export const Danger: Story = { ...Default, args: { @@ -77,18 +70,18 @@ export const Muted: Story = { }, }; -export const Light: Story = { +export const NavContrast: Story = { render: (args) => ({ props: args, template: /*html*/ ` -
+
`, }), args: { - buttonType: "light", + buttonType: "nav-contrast", }, }; diff --git a/libs/components/src/item/item-action.component.ts b/libs/components/src/item/item-action.component.ts index c47ee8eea69..acbc805cf90 100644 --- a/libs/components/src/item/item-action.component.ts +++ b/libs/components/src/item/item-action.component.ts @@ -10,7 +10,7 @@ import { Component } from "@angular/core"; * `top` and `bottom` units should be kept in sync with `item-content.component.ts`'s y-axis padding. * we want this `:after` element to be the same height as the `item-content` */ - "[&>button]:tw-relative [&>button:not([bit-item-content])]:after:tw-content-[''] [&>button]:after:tw-absolute [&>button]:after:tw-block bit-compact:[&>button]:after:tw-top-[-0.7rem] bit-compact:[&>button]:after:tw-bottom-[-0.7rem] [&>button]:after:tw-top-[-0.8rem] [&>button]:after:tw-bottom-[-0.80rem] [&>button]:after:tw-right-[-0.25rem] [&>button]:after:tw-left-[-0.25rem]", + "[&>button]:tw-relative [&>button:not([bit-item-content])]:after:tw-content-[''] [&>button]:after:tw-absolute [&>button]:after:tw-block bit-compact:[&>button]:after:tw-top-[-0.7rem] bit-compact:[&>button]:after:tw-bottom-[-0.7rem] [&>button]:after:tw-top-[-0.8rem] [&>button]:after:tw-bottom-[-0.80rem] [&>button]:after:tw-right-0 [&>button]:after:tw-left-0", }, }) export class ItemActionComponent {} diff --git a/libs/components/src/item/item.component.html b/libs/components/src/item/item.component.html index 2863bb2891b..bdb8ee45d0a 100644 --- a/libs/components/src/item/item.component.html +++ b/libs/components/src/item/item.component.html @@ -4,7 +4,7 @@
diff --git a/libs/components/src/item/item.stories.ts b/libs/components/src/item/item.stories.ts index d23caa63370..6187266c40c 100644 --- a/libs/components/src/item/item.stories.ts +++ b/libs/components/src/item/item.stories.ts @@ -397,7 +397,7 @@ export const VirtualScrolling: Story = { data: Array.from(Array(100000).keys()), }, template: /*html*/ ` - + @@ -100,7 +100,7 @@ export const WithChildButtons: Story = { slot="end" class="tw-ms-auto" [bitIconButton]="'bwi-check'" - [buttonType]="'light'" + [buttonType]="'nav-contrast'" size="small" aria-label="option 3" > diff --git a/libs/components/src/navigation/side-nav.component.html b/libs/components/src/navigation/side-nav.component.html index 46ccc13bc8a..a5866b5e42e 100644 --- a/libs/components/src/navigation/side-nav.component.html +++ b/libs/components/src/navigation/side-nav.component.html @@ -34,7 +34,7 @@ type="button" class="tw-mx-auto tw-block tw-max-w-fit" [bitIconButton]="data.open ? 'bwi-angle-left' : 'bwi-angle-right'" - buttonType="light" + buttonType="nav-contrast" size="small" (click)="sideNavService.toggle()" [attr.aria-label]="'toggleSideNavigation' | i18n" diff --git a/libs/components/src/popover/popover.component.html b/libs/components/src/popover/popover.component.html index dfcf3ff5d01..03b6eaf77e3 100644 --- a/libs/components/src/popover/popover.component.html +++ b/libs/components/src/popover/popover.component.html @@ -4,8 +4,8 @@
-
-

+
+

{{ title() }}

diff --git a/libs/components/src/popover/popover.stories.ts b/libs/components/src/popover/popover.stories.ts index 100990decca..d1446f917f2 100644 --- a/libs/components/src/popover/popover.stories.ts +++ b/libs/components/src/popover/popover.stories.ts @@ -68,7 +68,7 @@ const popoverContent = /*html*/ `
  • Esse labore veniam tempora
  • Adipisicing elit ipsum iustolaborum
  • - + `; diff --git a/libs/components/src/search/search.component.html b/libs/components/src/search/search.component.html index b1b92fb151a..a20b077e71d 100644 --- a/libs/components/src/search/search.component.html +++ b/libs/components/src/search/search.component.html @@ -2,7 +2,7 @@ role="search" (mouseenter)="isFormHovered.set(true)" (mouseleave)="isFormHovered.set(false)" - class="tw-relative tw-flex tw-items-center tw-w-full" + class="tw-relative tw-flex tw-items-center tw-w-full tw-h-10" >