Files
Virtnet.bond/extensions/Servers/Proxmox/views/components/ui/card.blade.php
Joseph.Rawlings e7b33a2f6c Refactor Proxmox server views for improved UI consistency and usability
- 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.
2025-12-17 11:24:17 -05:00

104 lines
3.6 KiB
PHP

{{--
Card Component - TailServer Theme
Usage:
<x-proxmox::ui.card>Content</x-proxmox::ui.card>
<x-proxmox::ui.card title="Title" subtitle="Subtitle" icon="ri-server-line">Content</x-proxmox::ui.card>
<x-proxmox::ui.card :collapsible="true" :collapsed="false">Content</x-proxmox::ui.card>
--}}
@props([
'title' => null,
'subtitle' => null,
'icon' => null,
'iconColor' => 'text-primary',
'actions' => null,
'footer' => null,
'footerClass' => '',
'padding' => true,
'hover' => false,
'clickable' => false,
'collapsible' => false,
'collapsed' => false,
])
@php
$cardClasses = 'relative flex flex-col rounded-xl border border-neutral/20 bg-background-secondary shadow-sm';
if ($hover) {
$cardClasses .= ' hover:bg-background-secondary/90 hover:border-neutral/30 hover:shadow-md transition-all duration-200';
}
if ($clickable) {
$cardClasses .= ' cursor-pointer';
}
@endphp
<div
{{ $attributes->class([$cardClasses]) }}
@if($collapsible)
x-data="{ isCollapsed: {{ $collapsed ? 'true' : 'false' }} }"
@endif
>
{{-- Subtle gradient overlay for depth --}}
<div class="absolute inset-0 rounded-xl bg-gradient-to-b from-white/[0.02] to-transparent pointer-events-none"></div>
@if($title || $actions)
<div class="flex flex-col items-start justify-between gap-4 border-b border-neutral/20 p-5 sm:flex-row sm:items-center">
<div class="flex items-center gap-3">
@if($icon)
<div class="flex items-center justify-center w-10 h-10 rounded-lg bg-primary/10">
<x-dynamic-component :component="$icon" class="size-5 {{ $iconColor }}" />
</div>
@endif
<div>
@if($title)
<h3 class="text-lg font-semibold text-base">{{ $title }}</h3>
@endif
@if($subtitle)
<p class="text-sm text-base/60 mt-0.5">{{ $subtitle }}</p>
@endif
</div>
</div>
<div class="flex items-center gap-2">
@if($actions)
{{ $actions }}
@endif
@if($collapsible)
<button
type="button"
@click="isCollapsed = !isCollapsed"
class="p-2 rounded-lg hover:bg-neutral/10 transition-colors"
>
<x-ri-arrow-down-s-line
class="size-5 text-base/50 transition-transform duration-200"
x-bind:class="isCollapsed ? 'rotate-180' : ''"
/>
</button>
@endif
</div>
</div>
@endif
<div
@class([
'flex-1',
'p-5' => $padding,
])
@if($collapsible)
x-show="!isCollapsed"
x-transition:enter="transition ease-out duration-200"
x-transition:enter-start="opacity-0 -translate-y-2"
x-transition:enter-end="opacity-100 translate-y-0"
x-transition:leave="transition ease-in duration-150"
x-transition:leave-start="opacity-100 translate-y-0"
x-transition:leave-end="opacity-0 -translate-y-2"
@endif
>
{{ $slot }}
</div>
@if($footer)
<div class="border-t border-neutral/20 px-5 py-3 {{ $footerClass }}">
{{ $footer }}
</div>
@endif
</div>