update
This commit is contained in:
@@ -20,7 +20,7 @@
|
||||
$tag = 'a';
|
||||
}
|
||||
|
||||
$baseClasses = 'd-inline-flex gap-2 align-items-center justify-content-center text-white px-3 py-2 rounded-3 transition-all';
|
||||
$baseClasses = 'd-inline-flex gap-2 align-items-center justify-content-center text-white px-3 py-2 rounded-3 transition-all border-0';
|
||||
|
||||
$variants = [
|
||||
'primary' => 'bg-primary',
|
||||
@@ -35,17 +35,6 @@
|
||||
'info' => 'bg-info'
|
||||
];
|
||||
|
||||
// Darker border colors for the "3D" effect
|
||||
$borderColors = [
|
||||
'primary' => '#D9561C',
|
||||
'secondary' => '#565e64',
|
||||
'success' => '#146c43',
|
||||
'danger' => '#b02a37',
|
||||
'warning' => '#997404',
|
||||
'info' => '#004C73',
|
||||
'destructive' => '#b02a37',
|
||||
];
|
||||
|
||||
$sizes = [
|
||||
'default' => 'h-10',
|
||||
'sm' => 'h-6',
|
||||
@@ -55,30 +44,22 @@
|
||||
|
||||
$variantClass = $variants[$variant ?? 'primary'] ?? $variants['primary'];
|
||||
$sizeClass = $sizes[$size ?? 'md'] ?? $sizes['default'];
|
||||
$borderColor = $borderColors[$variant ?? 'primary'] ?? 'transparent';
|
||||
|
||||
// Check if variant is outline/ghost/link to avoid weird borders
|
||||
if (in_array($variant, ['outline', 'ghost', 'link'])) {
|
||||
$borderStyle = '';
|
||||
} else {
|
||||
$borderStyle = "border-bottom: 3px solid {$borderColor};";
|
||||
}
|
||||
|
||||
$classes = "{$baseClasses} {$variantClass} {$sizeClass}";
|
||||
@endphp
|
||||
|
||||
@if($tag === 'a')
|
||||
<a href="{{ $href }}" {{ $attributes->merge(['class' => $classes, 'style' => $borderStyle]) }}>
|
||||
<a href="{{ $href }}" {{ $attributes->merge(['class' => $classes]) }}>
|
||||
@if($icon)
|
||||
<i data-lucide="{{ $icon }}" class="mr-2" style="height: 15px; width: 15px"></i>
|
||||
@endif
|
||||
{{ $slot }}
|
||||
</a>
|
||||
@else
|
||||
<button type="{{ $buttonType }}" {{ $attributes->merge(['class' => $classes, 'style' => $borderStyle]) }}>
|
||||
@if($icon)
|
||||
<i data-lucide="{{ $icon }}" class="mr-2" style="height: 15px; width: 15px"></i>
|
||||
@endif
|
||||
{{ $slot }}
|
||||
</button>
|
||||
<button type="{{ $buttonType }}" {{ $attributes->merge(['class' => $classes]) }}>
|
||||
@if($icon)
|
||||
<i data-lucide="{{ $icon }}" class="mr-2" style="height: 15px; width: 15px"></i>
|
||||
@endif
|
||||
{{ $slot }}
|
||||
</button>
|
||||
@endif
|
||||
Reference in New Issue
Block a user