- Updated tab-panel component to use Tailwind for styling and transitions. - Refactored table-row component to implement Tailwind classes for hover effects and borders. - Converted table-td component to utilize Tailwind for alignment and text styles. - Changed table-th component to apply Tailwind for header styling and sorting indicators. - Revised table component to adopt Tailwind for layout, borders, and responsive design. - Enhanced tabs component with Tailwind for navigation styles and transitions. - Updated toggle component to use Tailwind for switch styles and accessibility. - Refactored tooltip component to implement Tailwind for positioning and styling. - Added visual enhancements to app.css for improved UI interactions and animations.
109 lines
4.2 KiB
PHP
109 lines
4.2 KiB
PHP
{{--
|
|
Card Component - LucentUI Theme
|
|
Migrated from AdminLTE to Tailwind
|
|
|
|
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>
|
|
<x-proxmox::ui.card variant="primary">Content with top accent</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,
|
|
'variant' => null, // primary, success, warning, danger, info
|
|
'outline' => false,
|
|
])
|
|
|
|
@php
|
|
$variantClasses = match($variant) {
|
|
'primary' => $outline ? 'border-primary' : 'border-primary bg-primary/5',
|
|
'success' => $outline ? 'border-success' : 'border-success bg-success/5',
|
|
'warning' => $outline ? 'border-warning' : 'border-warning bg-warning/5',
|
|
'danger' => $outline ? 'border-error' : 'border-error bg-error/5',
|
|
'info' => $outline ? 'border-info' : 'border-info bg-info/5',
|
|
default => 'border-neutral',
|
|
};
|
|
@endphp
|
|
|
|
<div
|
|
{{ $attributes->class([
|
|
'bg-background border rounded-lg shadow-sm transition-all duration-300 ease-out hover:shadow-md',
|
|
$variantClasses,
|
|
'cursor-pointer hover:-translate-y-0.5 hover:scale-[1.002]' => $clickable,
|
|
'hover:border-neutral/80' => $hover,
|
|
]) }}
|
|
@if($collapsible)
|
|
x-data="{ isCollapsed: {{ $collapsed ? 'true' : 'false' }} }"
|
|
@endif
|
|
>
|
|
@if($title || $actions)
|
|
<div class="flex items-center justify-between px-4 py-3 border-b border-neutral transition-colors duration-200 hover:bg-background-secondary/30">
|
|
<h3 class="flex items-center gap-3 text-base font-semibold text-base">
|
|
@if($icon)
|
|
<span class="flex items-center justify-center size-9 bg-background-secondary rounded transition-transform duration-200 hover:scale-110">
|
|
<x-dynamic-component :component="$icon" class="size-5 {{ $iconColor }}" />
|
|
</span>
|
|
@endif
|
|
<span>
|
|
{{ $title }}
|
|
@if($subtitle)
|
|
<small class="block text-xs font-normal text-base/60 transition-opacity duration-200">{{ $subtitle }}</small>
|
|
@endif
|
|
</span>
|
|
</h3>
|
|
@if($actions || $collapsible)
|
|
<div class="flex items-center gap-2">
|
|
@if($actions)
|
|
{{ $actions }}
|
|
@endif
|
|
@if($collapsible)
|
|
<button
|
|
type="button"
|
|
@click="isCollapsed = !isCollapsed"
|
|
class="inline-flex items-center justify-center px-2 py-1 text-sm border border-neutral rounded bg-transparent text-base/80 hover:bg-neutral/10 hover:scale-105 transition-all duration-200"
|
|
>
|
|
<x-ri-arrow-down-s-line
|
|
class="size-4 transition-transform duration-300 ease-out"
|
|
x-bind:class="isCollapsed ? 'rotate-180' : ''"
|
|
/>
|
|
</button>
|
|
@endif
|
|
</div>
|
|
@endif
|
|
</div>
|
|
@endif
|
|
|
|
<div
|
|
class="p-4"
|
|
@if($collapsible)
|
|
x-show="!isCollapsed"
|
|
x-transition:enter="transition ease-out duration-300"
|
|
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-200"
|
|
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="px-4 py-3 border-t border-neutral bg-background-secondary/50 rounded-b-lg {{ $footerClass }}">
|
|
{{ $footer }}
|
|
</div>
|
|
@endif
|
|
</div>
|