- Refactored select component to align with shadcn design principles. - Updated server status indicator component for consistency with shadcn style. - Modified spinner component to follow shadcn design guidelines. - Enhanced stat card component with shadcn-inspired styles. - Adjusted tab panel component to reflect shadcn design updates. - Revamped table row and table data cell components to match shadcn aesthetics. - Updated table header cell component for improved styling consistency. - Refined table component to align with shadcn design principles. - Enhanced tabs component with shadcn-inspired styles. - Updated toggle component to follow shadcn design guidelines. - Refactored tooltip component to align with shadcn design principles. - Updated server card component to reflect shadcn-inspired design.
98 lines
3.4 KiB
PHP
98 lines
3.4 KiB
PHP
{{--
|
|
Card Component - TailServer Theme (shadcn-inspired)
|
|
|
|
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,
|
|
])
|
|
|
|
<div
|
|
{{ $attributes->class([
|
|
'flex flex-col gap-6 rounded-xl border border-neutral/15 bg-card text-card-foreground shadow-sm',
|
|
'hover:shadow-md hover:border-neutral/25 transition-shadow duration-150' => $hover || $clickable,
|
|
'cursor-pointer' => $clickable,
|
|
]) }}
|
|
@if($collapsible)
|
|
x-data="{ isCollapsed: {{ $collapsed ? 'true' : 'false' }} }"
|
|
@endif
|
|
>
|
|
@if($title || $actions)
|
|
<div class="@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6">
|
|
<div class="flex items-center gap-3">
|
|
@if($icon)
|
|
<div class="flex items-center justify-center size-9 rounded-lg bg-primary/10">
|
|
<x-dynamic-component :component="$icon" class="size-4 {{ $iconColor }}" />
|
|
</div>
|
|
@endif
|
|
<div class="space-y-1">
|
|
@if($title)
|
|
<h3 class="leading-none font-semibold">{{ $title }}</h3>
|
|
@endif
|
|
@if($subtitle)
|
|
<p class="text-sm text-muted-foreground">{{ $subtitle }}</p>
|
|
@endif
|
|
</div>
|
|
</div>
|
|
@if($actions || $collapsible)
|
|
<div class="col-start-2 row-span-2 row-start-1 self-start justify-self-end flex items-center gap-2">
|
|
@if($actions)
|
|
{{ $actions }}
|
|
@endif
|
|
@if($collapsible)
|
|
<button
|
|
type="button"
|
|
@click="isCollapsed = !isCollapsed"
|
|
class="p-1.5 rounded-md hover:bg-neutral/10 transition-colors"
|
|
>
|
|
<x-ri-arrow-down-s-line
|
|
class="size-4 text-muted-foreground transition-transform duration-150"
|
|
x-bind:class="isCollapsed ? 'rotate-180' : ''"
|
|
/>
|
|
</button>
|
|
@endif
|
|
</div>
|
|
@endif
|
|
</div>
|
|
@endif
|
|
|
|
<div
|
|
@class([
|
|
'px-6',
|
|
'py-6' => $padding && !$title,
|
|
])
|
|
@if($collapsible)
|
|
x-show="!isCollapsed"
|
|
x-transition:enter="transition ease-out duration-150"
|
|
x-transition:enter-start="opacity-0"
|
|
x-transition:enter-end="opacity-100"
|
|
x-transition:leave="transition ease-in duration-100"
|
|
x-transition:leave-start="opacity-100"
|
|
x-transition:leave-end="opacity-0"
|
|
@endif
|
|
>
|
|
{{ $slot }}
|
|
</div>
|
|
|
|
@if($footer)
|
|
<div class="flex items-center px-6 [.border-t]:pt-6 {{ $footerClass }}">
|
|
{{ $footer }}
|
|
</div>
|
|
@endif
|
|
</div>
|