1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-11 22:03:36 +00:00

[PM-10141] Fix name input styling (#10317)

* import FormFieldModule

* use bit-* form field elements so styling is consistent

* replace `readonly` with `disabled` so the field can not be interacted with

* standardize spacing around orgs/folders

* revert disable/readonly swap

* remove duplicate import
This commit is contained in:
Nick Krantz
2024-07-29 15:38:06 -05:00
committed by GitHub
parent 6b8f60792e
commit 2103cb4591
2 changed files with 21 additions and 24 deletions

View File

@@ -3,11 +3,10 @@
<h2 bitTypography="h6">{{ "itemDetails" | i18n }}</h2> <h2 bitTypography="h6">{{ "itemDetails" | i18n }}</h2>
</bit-section-header> </bit-section-header>
<bit-card> <bit-card>
<div>
<label class="tw-block tw-w-full tw-mb-1 tw-text-xs tw-text-muted tw-select-none">
{{ "itemName" | i18n }}
</label>
<bit-form-field> <bit-form-field>
<bit-label>
{{ "itemName" | i18n }}
</bit-label>
<input <input
readonly readonly
bitInput bitInput
@@ -17,7 +16,6 @@
data-testid="item-name" data-testid="item-name"
/> />
</bit-form-field> </bit-form-field>
</div>
<ul <ul
[attr.aria-label]="'itemLocation' | i18n" [attr.aria-label]="'itemLocation' | i18n"
@@ -25,20 +23,19 @@
> >
<li <li
*ngIf="cipher.organizationId && organization" *ngIf="cipher.organizationId && organization"
class="tw-flex tw-list-none" class="tw-flex tw-items-center tw-list-none"
[ngClass]="{ 'tw-mb-3': cipher.collectionIds }" [ngClass]="{ 'tw-mb-3': cipher.collectionIds }"
bitTypography="body2" bitTypography="body2"
[attr.aria-label]="('owner' | i18n) + organization.name" [attr.aria-label]="('owner' | i18n) + organization.name"
data-testid="owner" data-testid="owner"
> >
<i <i
class="tw-pt-1"
appOrgIcon appOrgIcon
[tierType]="organization.productTierType" [tierType]="organization.productTierType"
[size]="'large'" [size]="'large'"
[title]="'owner' | i18n" [title]="'owner' | i18n"
></i> ></i>
<span aria-hidden="true" class="tw-pl-1 tw-mb-1"> <span aria-hidden="true" class="tw-pl-1.5">
{{ organization.name }} {{ organization.name }}
</span> </span>
</li> </li>
@@ -50,17 +47,17 @@
<ul data-testid="collections"> <ul data-testid="collections">
<li <li
*ngFor="let collection of collections; let last = last" *ngFor="let collection of collections; let last = last"
class="tw-flex tw-list-none" class="tw-flex tw-items-center tw-list-none"
bitTypography="body2" bitTypography="body2"
[ngClass]="{ 'tw-mb-3': last }" [ngClass]="{ 'tw-mb-3': last }"
[attr.aria-label]="collection.name" [attr.aria-label]="collection.name"
> >
<i <i
class="bwi bwi-collection bwi-lg tw-pt-1" class="bwi bwi-collection bwi-lg"
aria-hidden="true" aria-hidden="true"
[title]="'collection' | i18n" [title]="'collection' | i18n"
></i> ></i>
<span aria-hidden="true" class="tw-pl-1 tw-mb-1"> <span aria-hidden="true" class="tw-pl-1.5">
{{ collection.name }} {{ collection.name }}
</span> </span>
</li> </li>
@@ -69,12 +66,12 @@
<li <li
*ngIf="cipher.folderId && folder" *ngIf="cipher.folderId && folder"
bitTypography="body2" bitTypography="body2"
class="tw-flex tw-list-none" class="tw-flex tw-items-center tw-list-none"
[attr.aria-label]="('folder' | i18n) + folder.name" [attr.aria-label]="('folder' | i18n) + folder.name"
data-testid="folder" data-testid="folder"
> >
<i class="bwi bwi-folder bwi-lg tw-pt-1" aria-hidden="true" [title]="'folder' | i18n"></i> <i class="bwi bwi-folder bwi-lg" aria-hidden="true" [title]="'folder' | i18n"></i>
<span aria-hidden="true" class="tw-pl-1 tw-mb-1">{{ folder.name }} </span> <span aria-hidden="true" class="tw-pl-1.5">{{ folder.name }} </span>
</li> </li>
</ul> </ul>
</bit-card> </bit-card>

View File

@@ -8,10 +8,10 @@ import { CollectionView } from "@bitwarden/common/vault/models/view/collection.v
import { FolderView } from "@bitwarden/common/vault/models/view/folder.view"; import { FolderView } from "@bitwarden/common/vault/models/view/folder.view";
import { import {
CardComponent, CardComponent,
FormFieldModule,
SectionComponent, SectionComponent,
SectionHeaderComponent, SectionHeaderComponent,
TypographyModule, TypographyModule,
FormFieldModule,
} from "@bitwarden/components"; } from "@bitwarden/components";
import { OrgIconDirective } from "../../components/org-icon.directive"; import { OrgIconDirective } from "../../components/org-icon.directive";