{{-- Loading / Async Button (Alpine.js powered) --}} @props(['variant' => 'primary', 'type' => 'submit', 'size' => 'md']) @php $base = 'inline-flex cursor-pointer select-none items-center justify-center gap-2 font-medium transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:ring-offset-background disabled:pointer-events-none disabled:opacity-60'; $sizeClass = match ($size) { 'sm' => 'rounded-md px-3 py-1.5 text-xs', 'lg' => 'rounded-xl px-6 py-3 text-base', default => 'rounded-lg px-4 py-2 text-sm', }; $tone = match ($variant) { 'secondary' => 'border border-border bg-card text-card-foreground shadow-sm hover:bg-muted', 'danger' => 'bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90', default => 'bg-brand text-brand-foreground shadow-sm hover:bg-brand/90 active:bg-brand/80', }; $classes = trim("$base $sizeClass $tone"); @endphp