1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-10 13:40:06 +00:00

[CL-736] migrate chip select to use signals (#17136)

* migrate chip select to use signals

* Have Claude address feedback and create spec file

* remove eslint disable comment

* fix failing tests

* remove unnecessary tests

* improved documentation

* remove unnecessary test logic

* consolidate tests and remove fragile selectors
This commit is contained in:
Bryan Cunningham
2025-11-13 15:53:05 -05:00
committed by GitHub
parent 9586057a32
commit ccf7bb1753
3 changed files with 545 additions and 56 deletions

View File

@@ -3,11 +3,11 @@
class="tw-inline-flex tw-items-center tw-rounded-full tw-w-full tw-border-solid tw-border tw-gap-1.5 tw-group/chip-select"
[ngClass]="{
'tw-bg-text-muted hover:tw-bg-secondary-700 tw-text-contrast hover:!tw-border-secondary-700':
selectedOption && !disabled,
selectedOption && !disabled(),
'tw-bg-transparent hover:tw-border-secondary-700 !tw-text-muted hover:tw-bg-secondary-100':
!selectedOption && !disabled,
'tw-bg-secondary-300 tw-text-muted tw-border-transparent': disabled,
'tw-border-text-muted': !disabled,
!selectedOption && !disabled(),
'tw-bg-secondary-300 tw-text-muted tw-border-transparent': disabled(),
'tw-border-text-muted': !disabled(),
'tw-ring-2 tw-ring-primary-600 tw-ring-offset-1': focusVisibleWithin(),
}"
>
@@ -17,11 +17,11 @@
class="tw-inline-flex tw-gap-1.5 tw-items-center tw-justify-between tw-bg-transparent hover:tw-bg-transparent tw-border-none tw-outline-none tw-w-full tw-py-1 tw-ps-3 last:tw-pe-3 [&:not(:last-child)]:tw-pe-0 tw-truncate tw-text-[color:inherit] tw-text-[length:inherit]"
data-fvw-target
[ngClass]="{
'tw-cursor-not-allowed': disabled,
'group-hover/chip-select:tw-text-secondary-700': !selectedOption && !disabled,
'tw-cursor-not-allowed': disabled(),
'group-hover/chip-select:tw-text-secondary-700': !selectedOption && !disabled(),
}"
[bitMenuTriggerFor]="menu"
[disabled]="disabled"
[disabled]="disabled()"
[title]="label"
#menuTrigger="menuTrigger"
(click)="setMenuWidth()"
@@ -45,10 +45,10 @@
<button
type="button"
[attr.aria-label]="'removeItem' | i18n: label"
[disabled]="disabled"
[disabled]="disabled()"
class="tw-bg-transparent hover:tw-bg-hover-contrast tw-outline-none tw-rounded-full tw-py-0.5 tw-px-1 tw-me-1 tw-text-[color:inherit] tw-text-[length:inherit] tw-border-solid tw-border tw-border-transparent tw-flex tw-items-center tw-justify-center focus-visible:tw-ring-2 tw-ring-text-contrast hover:disabled:tw-bg-transparent"
[ngClass]="{
'tw-cursor-not-allowed': disabled,
'tw-cursor-not-allowed': disabled(),
}"
(click)="clear()"
>