refactor(ui): migrate controls to lucide (#1840)
This commit is contained in:
@@ -10,6 +10,7 @@ import { Combobox, ComboboxInput, ComboboxPopupContainer } from '@angular/aria/c
|
||||
import { Listbox, Option } from '@angular/aria/listbox';
|
||||
import { OverlayModule } from '@angular/cdk/overlay';
|
||||
import { TranslocoPipe, translateSignal } from '@jsverse/transloco';
|
||||
import { LucideCheck, LucideChevronDown, LucideLoaderCircle, LucideSearch, LucideX } from '@lucide/angular';
|
||||
|
||||
import { cn } from '../cn';
|
||||
import { AppSelectBaseDirective } from './app-select-base.directive';
|
||||
@@ -27,6 +28,11 @@ import { type SelectOption } from './app-select.options';
|
||||
Listbox,
|
||||
Option,
|
||||
TranslocoPipe,
|
||||
LucideCheck,
|
||||
LucideChevronDown,
|
||||
LucideLoaderCircle,
|
||||
LucideSearch,
|
||||
LucideX,
|
||||
],
|
||||
host: { class: 'block w-full' },
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
@@ -70,7 +76,7 @@ import { type SelectOption } from './app-select.options';
|
||||
[class.w-9]="variant() !== 'bare'"
|
||||
[class.w-7]="variant() === 'bare'"
|
||||
(click)="clear($event)">
|
||||
<i class="pi pi-times text-xs" aria-hidden="true"></i>
|
||||
<svg lucideX class="size-4" aria-hidden="true"></svg>
|
||||
</button>
|
||||
}
|
||||
|
||||
@@ -79,9 +85,9 @@ import { type SelectOption } from './app-select.options';
|
||||
[class.w-9]="variant() !== 'bare'"
|
||||
[class.w-7]="variant() === 'bare'">
|
||||
@if (pending()) {
|
||||
<i class="pi pi-spinner pi-spin text-xs" aria-hidden="true"></i>
|
||||
<svg lucideLoaderCircle class="size-4 animate-spin" aria-hidden="true"></svg>
|
||||
} @else {
|
||||
<i class="pi pi-chevron-down text-xs transition-transform" [class.rotate-180]="cb.expanded()" aria-hidden="true"></i>
|
||||
<svg lucideChevronDown class="size-4 transition-transform" [class.rotate-180]="cb.expanded()" aria-hidden="true"></svg>
|
||||
}
|
||||
</span>
|
||||
</div>
|
||||
@@ -111,7 +117,7 @@ import { type SelectOption } from './app-select.options';
|
||||
[placeholder]="filterPlaceholder() || ('shared.ui.select.search' | transloco)"
|
||||
[readonly]="readonly()"
|
||||
class="h-full min-w-0 flex-1 border-0 bg-transparent px-0 pr-2 text-sm text-text-strong outline-hidden placeholder:text-text-muted focus:outline-hidden" />
|
||||
<i class="pi pi-search shrink-0 text-xs" aria-hidden="true"></i>
|
||||
<svg lucideSearch class="size-4 shrink-0" aria-hidden="true"></svg>
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -142,7 +148,7 @@ import { type SelectOption } from './app-select.options';
|
||||
[disabled]="option.disabled === true"
|
||||
[class]="optionClass">
|
||||
<span [class]="checkboxClass(isSelected(option))">
|
||||
@if (isSelected(option)) { <i class="pi pi-check text-[0.625rem] text-white" aria-hidden="true"></i> }
|
||||
@if (isSelected(option)) { <svg lucideCheck class="size-3 text-white" aria-hidden="true"></svg> }
|
||||
</span>
|
||||
@if (optionTemplate(); as tpl) {
|
||||
<ng-container [ngTemplateOutlet]="tpl.template" [ngTemplateOutletContext]="{ $implicit: option }" />
|
||||
|
||||
Reference in New Issue
Block a user