- Updated server card component to use new UI elements and improved layout. - Enhanced status display with badges and better status indicators. - Refined quick info row for server details with consistent styling. - Reorganized server configuration statistics into stat cards for clarity. - Improved help modals for statistics and storage management sections. - Streamlined alerts and warnings for better user experience. - Updated storage management view to utilize new UI components and improve readability.
93 lines
4.3 KiB
PHP
93 lines
4.3 KiB
PHP
{{--
|
|
Button Component - TailServer Theme
|
|
|
|
Usage:
|
|
<x-proxmox::ui.button>Click me</x-proxmox::ui.button>
|
|
<x-proxmox::ui.button variant="primary" icon="ri-add-line">Add Server</x-proxmox::ui.button>
|
|
<x-proxmox::ui.button variant="danger" size="sm">Delete</x-proxmox::ui.button>
|
|
<x-proxmox::ui.button :loading="true">Processing</x-proxmox::ui.button>
|
|
--}}
|
|
|
|
@props([
|
|
'variant' => 'secondary',
|
|
'size' => 'md',
|
|
'icon' => null,
|
|
'iconRight' => null,
|
|
'loading' => false,
|
|
'loadingText' => null,
|
|
'disabled' => false,
|
|
'href' => null,
|
|
'type' => 'button',
|
|
'full' => false,
|
|
])
|
|
|
|
@php
|
|
$tag = $href ? 'a' : 'button';
|
|
|
|
$baseClasses = 'group relative inline-flex items-center justify-center gap-2 rounded-lg font-semibold transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-background disabled:opacity-50 disabled:cursor-not-allowed overflow-hidden';
|
|
|
|
$variantClasses = [
|
|
'primary' => 'bg-primary text-white border border-primary hover:bg-primary/90 hover:shadow-md hover:shadow-primary/20 active:scale-[0.98] focus:ring-primary/50',
|
|
'secondary' => 'bg-background-secondary text-base border border-neutral/30 hover:bg-background-secondary/80 hover:border-neutral/50 active:scale-[0.98] focus:ring-neutral/30',
|
|
'outline' => 'bg-transparent text-base border border-neutral/30 hover:bg-neutral/10 hover:border-neutral/50 focus:ring-neutral/30',
|
|
'ghost' => 'bg-transparent text-base hover:bg-neutral/10 focus:ring-neutral/20',
|
|
'danger' => 'bg-danger text-white border border-danger hover:bg-danger/90 hover:shadow-md hover:shadow-danger/20 active:scale-[0.98] focus:ring-danger/50',
|
|
'success' => 'bg-success text-white border border-success hover:bg-success/90 hover:shadow-md hover:shadow-success/20 active:scale-[0.98] focus:ring-success/50',
|
|
'warning' => 'bg-warning text-white border border-warning hover:bg-warning/90 hover:shadow-md hover:shadow-warning/20 active:scale-[0.98] focus:ring-warning/50',
|
|
'info' => 'bg-info text-white border border-info hover:bg-info/90 hover:shadow-md hover:shadow-info/20 active:scale-[0.98] focus:ring-info/50',
|
|
];
|
|
|
|
$sizeClasses = [
|
|
'xs' => 'px-2 py-1 text-xs',
|
|
'sm' => 'px-2.5 py-1.5 text-sm',
|
|
'md' => 'px-3.5 py-2 text-sm',
|
|
'lg' => 'px-4 py-2.5 text-base',
|
|
'xl' => 'px-5 py-3 text-lg',
|
|
];
|
|
|
|
$iconSizes = [
|
|
'xs' => 'size-3',
|
|
'sm' => 'size-3.5',
|
|
'md' => 'size-4',
|
|
'lg' => 'size-5',
|
|
'xl' => 'size-6',
|
|
];
|
|
|
|
$classes = collect([
|
|
$baseClasses,
|
|
$variantClasses[$variant] ?? $variantClasses['secondary'],
|
|
$sizeClasses[$size] ?? $sizeClasses['md'],
|
|
$full ? 'w-full' : '',
|
|
])->filter()->join(' ');
|
|
|
|
$iconSize = $iconSizes[$size] ?? $iconSizes['md'];
|
|
@endphp
|
|
|
|
<{{ $tag }}
|
|
@if($href) href="{{ $href }}" @endif
|
|
@if($tag === 'button') type="{{ $type }}" @endif
|
|
@if($disabled || $loading) disabled @endif
|
|
{{ $attributes->class([$classes]) }}
|
|
>
|
|
{{-- Subtle shine effect on hover --}}
|
|
<span class="absolute inset-0 -translate-x-full group-hover:translate-x-full transition-transform duration-700 bg-gradient-to-r from-transparent via-white/10 to-transparent pointer-events-none"></span>
|
|
|
|
<span class="relative inline-flex items-center gap-2">
|
|
@if($loading)
|
|
<svg class="animate-spin {{ $iconSize }}" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24">
|
|
<circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle>
|
|
<path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path>
|
|
</svg>
|
|
<span>{{ $loadingText ?? $slot }}</span>
|
|
@else
|
|
@if($icon)
|
|
<x-dynamic-component :component="$icon" class="{{ $iconSize }} opacity-80 group-hover:opacity-100 transition-opacity" />
|
|
@endif
|
|
{{ $slot }}
|
|
@if($iconRight)
|
|
<x-dynamic-component :component="$iconRight" class="{{ $iconSize }} opacity-80 group-hover:opacity-100 transition-opacity" />
|
|
@endif
|
|
@endif
|
|
</span>
|
|
</{{ $tag }}>
|