25 lines
1021 B
PHP
25 lines
1021 B
PHP
@props(['variant' => 'primary', 'href' => null, 'size' => 'md'])
|
|
|
|
@php
|
|
$classes = match ($variant) {
|
|
'secondary' => 'border border-line bg-white text-ink hover:bg-stone',
|
|
'accent' => 'bg-accent text-white hover:brightness-95',
|
|
'ghost' => 'text-ink hover:bg-stone',
|
|
default => 'bg-ink text-white shadow-lg shadow-ink/10 hover:bg-black',
|
|
};
|
|
$sizeClasses = match ($size) {
|
|
'sm' => 'h-10 px-4 text-[10px]',
|
|
default => 'h-12 px-6 text-xs',
|
|
};
|
|
@endphp
|
|
|
|
@if ($href)
|
|
<a href="{{ $href }}" {{ $attributes->except('size')->merge(['class' => "inline-flex items-center justify-center gap-2 rounded-md font-bold uppercase tracking-widest transition-all {$sizeClasses} {$classes}"]) }}>
|
|
{{ $slot }}
|
|
</a>
|
|
@else
|
|
<button {{ $attributes->except('size')->merge(['class' => "inline-flex items-center justify-center gap-2 rounded-md font-bold uppercase tracking-widest transition-all {$sizeClasses} {$classes}"]) }}>
|
|
{{ $slot }}
|
|
</button>
|
|
@endif
|