Files
Virtnet.bond/extensions/Servers/Proxmox/views/components/ui/card.blade.php
Joseph.Rawlings 7a089f53e2 refactor: Update UI components to TailAdmin theme
- Changed badge, button, card, dropdown, input, modal, select, table, tabs, toggle, and tooltip components to align with the TailAdmin design system.
- Updated class names and styles for consistency across components.
- Enhanced accessibility and responsiveness in various components.
- Improved hover and focus states for better user experience.
2025-12-17 12:07:54 -05:00

98 lines
3.4 KiB
PHP

{{--
Card Component - TailAdmin 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-brand-500',
'actions' => null,
'footer' => null,
'footerClass' => '',
'padding' => true,
'hover' => false,
'clickable' => false,
'collapsible' => false,
'collapsed' => false,
])
<div
{{ $attributes->class([
'rounded-2xl border border-gray-200 bg-white dark:border-gray-800 dark:bg-white/[0.03]',
'hover:shadow-theme-md transition-shadow duration-200' => $hover || $clickable,
'cursor-pointer' => $clickable,
]) }}
@if($collapsible)
x-data="{ isCollapsed: {{ $collapsed ? 'true' : 'false' }} }"
@endif
>
@if($title || $actions)
<div class="flex items-center justify-between gap-4 px-6 py-5">
<div class="flex items-center gap-3">
@if($icon)
<div class="flex items-center justify-center size-10 rounded-xl bg-brand-50 dark:bg-brand-500/10">
<x-dynamic-component :component="$icon" class="size-5 {{ $iconColor }}" />
</div>
@endif
<div class="space-y-0.5">
@if($title)
<h3 class="text-base font-medium text-gray-800 dark:text-white/90">{{ $title }}</h3>
@endif
@if($subtitle)
<p class="text-theme-sm text-gray-500 dark:text-gray-400">{{ $subtitle }}</p>
@endif
</div>
</div>
@if($actions || $collapsible)
<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-gray-100 dark:hover:bg-white/5 transition-colors duration-200"
>
<x-ri-arrow-down-s-line
class="size-5 text-gray-500 dark:text-gray-400 transition-transform duration-200"
x-bind:class="isCollapsed ? 'rotate-180' : ''"
/>
</button>
@endif
</div>
@endif
</div>
@endif
<div
@class([
'border-t border-gray-100 dark:border-gray-800' => $title,
'p-5 sm:p-6',
])
@if($collapsible)
x-show="!isCollapsed"
x-transition:enter="transition ease-out duration-200"
x-transition:enter-start="opacity-0"
x-transition:enter-end="opacity-100"
x-transition:leave="transition ease-in duration-150"
x-transition:leave-start="opacity-100"
x-transition:leave-end="opacity-0"
@endif
>
{{ $slot }}
</div>
@if($footer)
<div class="flex items-center border-t border-gray-100 dark:border-gray-800 px-6 py-4 {{ $footerClass }}">
{{ $footer }}
</div>
@endif
</div>