import { Component, Input } from '@angular/core'; export type ButtonVariant = 'primary' | 'ghost' | 'subtle' | 'outline' | 'danger'; @Component({ selector: 'vsp-button', template: ``, }) export class VspButton { @Input() variant: ButtonVariant = 'ghost'; @Input() size: 'sm' | 'md' | 'lg' = 'md'; @Input() loading = false; @Input() loadingText?: string; @Input() fullWidth = false; @Input() disabled = false; get cls(): string { return [ 'btn', `btn-${this.variant}`, this.size === 'sm' ? 'btn-sm' : '', this.size === 'lg' ? 'btn-lg' : '', this.fullWidth ? 'btn-block' : '', ] .filter(Boolean) .join(' '); } }