refactor(ui): migrate controls to lucide (#1840)
This commit is contained in:
@@ -31,16 +31,16 @@ import { buttonVariants, type ButtonSize, type ButtonTone, type ButtonVariant }
|
||||
(click)="clicked.emit($event)">
|
||||
@if (loading()) {
|
||||
<span [class]="loadingRingClass" aria-hidden="true"></span>
|
||||
} @else if (icon() && iconPos() === 'left') {
|
||||
<i [class]="iconClass()" aria-hidden="true"></i>
|
||||
}
|
||||
<span
|
||||
class="inline-flex shrink-0 empty:hidden [&>svg]:size-[1em] [&>svg]:shrink-0"
|
||||
[class.hidden]="loading()"
|
||||
[class.order-last]="iconPos() === 'right'">
|
||||
<ng-content />
|
||||
</span>
|
||||
@if (label()) {
|
||||
<span class="leading-none">{{ label() }}</span>
|
||||
}
|
||||
<ng-content />
|
||||
@if (!loading() && icon() && iconPos() === 'right') {
|
||||
<i [class]="iconClass()" aria-hidden="true"></i>
|
||||
}
|
||||
</button>
|
||||
`,
|
||||
})
|
||||
@@ -64,7 +64,6 @@ export class AppButtonComponent {
|
||||
readonly ariaExpanded = input<boolean | string | null>(null);
|
||||
readonly ariaHasPopup = input<boolean | 'false' | 'true' | 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog' | null>(null);
|
||||
readonly ariaPressed = input<boolean | 'false' | 'true' | 'mixed' | null>(null);
|
||||
readonly icon = input('');
|
||||
readonly iconPos = input<'left' | 'right'>('left');
|
||||
readonly loading = input(false, { transform: booleanAttribute });
|
||||
readonly disabled = input(false, { transform: booleanAttribute });
|
||||
@@ -85,6 +84,5 @@ export class AppButtonComponent {
|
||||
this.styleClass(),
|
||||
),
|
||||
);
|
||||
protected readonly iconClass = computed(() => cn(this.icon(), 'shrink-0 m-0 leading-none'));
|
||||
protected readonly loadingRingClass = cn(SPINNER_RING, 'size-[1em] border-2 shrink-0');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user