refactor: update Proxmox UI components to use TailAdmin styling

- Changed component styles and classes to align with TailAdmin design patterns.
- Updated color schemes, typography, and layout for consistency across components.
- Refactored Info Row, Network Address Card, Notice Banner, Progress Bar, Resource Gauge, Section Header, Server Status, Spinner, Stat Card, and Tab Panel components.
- Enhanced responsiveness and accessibility features in various components.
This commit is contained in:
2025-12-17 12:33:10 -05:00
parent 7a089f53e2
commit b4e2923a2c
23 changed files with 364 additions and 350 deletions

View File

@@ -1,5 +1,5 @@
{{--
Editable Field Component - shadcn-inspired
Editable Field Component - TailAdmin style
A field with display value and edit button that opens a modal
Usage:
@@ -32,14 +32,14 @@
])
<div class="space-y-2" x-data="{ showEditModal: @entangle($attributes->wire('model')->value() ? 'isEditing' . ucfirst($label) : 'editing') }">
<label class="text-sm font-medium">{{ $label }}</label>
<div class="flex items-center gap-2 rounded-lg border bg-muted/50 px-3 py-2 text-sm">
<span class="truncate flex-1">{{ $value ?? 'Not set' }}</span>
<label class="text-theme-sm font-medium text-gray-700 dark:text-gray-300">{{ $label }}</label>
<div class="flex items-center gap-2.5 rounded-lg border border-gray-200 bg-gray-50 px-4 py-2.5 text-theme-sm dark:border-gray-700 dark:bg-gray-800">
<span class="flex-1 truncate text-gray-700 dark:text-gray-300">{{ $value ?? 'Not set' }}</span>
@if($editClick)
<button
wire:click="{{ $editClick }}"
type="button"
class="text-muted-foreground hover:text-foreground transition-colors duration-150"
class="text-gray-400 transition-colors duration-150 hover:text-gray-600 dark:text-gray-500 dark:hover:text-gray-300"
aria-label="Edit {{ $label }}"
>
<x-ri-edit-line class="size-4" />
@@ -52,15 +52,15 @@
<div
x-cloak
x-show="showEditModal"
x-transition:enter="transition ease-out duration-150"
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-100"
x-transition:leave="transition ease-in duration-150"
x-transition:leave-start="opacity-100"
x-transition:leave-end="opacity-0"
@click="showEditModal = false; @if($cancelClick) $wire.{{ $cancelClick }}() @endif"
@keydown.escape.window="showEditModal = false; @if($cancelClick) $wire.{{ $cancelClick }}() @endif"
class="fixed inset-0 z-50 bg-black/50"
class="fixed inset-0 z-99999 bg-gray-900/50 backdrop-blur-sm dark:bg-gray-900/80"
style="display: none;"
></div>
@@ -68,55 +68,55 @@
<div
x-cloak
x-show="showEditModal"
x-transition:enter="transition ease-out duration-150"
x-transition:enter="transition ease-out duration-200"
x-transition:enter-start="opacity-0 scale-95"
x-transition:enter-end="opacity-100 scale-100"
x-transition:leave="transition ease-in duration-100"
x-transition:leave="transition ease-in duration-150"
x-transition:leave-start="opacity-100 scale-100"
x-transition:leave-end="opacity-0 scale-95"
@click.away="showEditModal = false; @if($cancelClick) $wire.{{ $cancelClick }}() @endif"
class="fixed inset-0 z-50 flex items-center justify-center p-4"
class="fixed inset-0 z-99999 flex items-center justify-center p-4"
style="display: none;"
>
<div class="relative rounded-xl border bg-card shadow-lg w-full max-w-xl p-6 space-y-4">
<div class="relative w-full max-w-xl space-y-5 rounded-2xl border border-gray-200 bg-white p-6 shadow-theme-lg dark:border-gray-800 dark:bg-gray-900">
<div class="flex items-center justify-between">
<h4 class="text-base font-semibold">Edit {{ $label }}</h4>
<h4 class="text-lg font-semibold text-gray-800 dark:text-white/90">Edit {{ $label }}</h4>
<button
type="button"
class="p-1.5 rounded-lg hover:bg-muted transition-colors duration-150"
class="flex size-9 items-center justify-center rounded-lg text-gray-500 transition-colors duration-150 hover:bg-gray-100 hover:text-gray-700 dark:text-gray-400 dark:hover:bg-gray-800 dark:hover:text-gray-300"
@click="showEditModal = false; @if($cancelClick) $wire.{{ $cancelClick }}() @endif"
aria-label="Close"
>
<x-ri-close-line class="size-4 text-muted-foreground" />
<x-ri-close-line class="size-5" />
</button>
</div>
<div class="space-y-3">
<div class="space-y-4">
<div>
<label class="text-sm font-medium text-muted-foreground">{{ $label }}</label>
<label class="text-theme-sm font-medium text-gray-500 dark:text-gray-400">{{ $label }}</label>
<input
type="text"
{{ $attributes->whereStartsWith('wire:model') }}
class="w-full mt-1.5 px-3 py-2 rounded-lg border bg-background text-sm placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring"
class="mt-2 h-11 w-full rounded-lg border border-gray-300 bg-transparent px-4 text-theme-sm shadow-theme-xs placeholder:text-gray-400 focus:border-brand-300 focus:outline-none focus:ring-3 focus:ring-brand-500/10 dark:border-gray-700 dark:bg-gray-900 dark:text-white/90 dark:placeholder:text-gray-500 dark:focus:border-brand-600"
placeholder="{{ $placeholder ?? 'Enter ' . strtolower($label) }}"
/>
</div>
@if($error)
<div class="text-sm text-danger">{{ $error }}</div>
<div class="text-theme-sm text-error-500">{{ $error }}</div>
@endif
@if(isset($hint))
<div class="text-xs text-muted-foreground">{{ $hint }}</div>
<div class="text-theme-xs text-gray-500 dark:text-gray-400">{{ $hint }}</div>
@endif
</div>
<div class="flex justify-end gap-2 pt-2">
<div class="flex justify-end gap-3 border-t border-gray-200 pt-4 dark:border-gray-800">
@if($cancelClick)
<button
type="button"
@click="showEditModal = false; $wire.{{ $cancelClick }}()"
class="px-4 py-2 text-sm font-medium rounded-lg border bg-background hover:bg-muted transition-colors duration-150"
class="rounded-lg bg-white px-4 py-2.5 text-theme-sm font-medium text-gray-700 shadow-theme-xs ring-1 ring-gray-300 transition-colors duration-150 hover:bg-gray-50 dark:bg-gray-800 dark:text-gray-300 dark:ring-gray-700 dark:hover:bg-gray-700"
>
Cancel
</button>
@@ -125,7 +125,7 @@
<button
type="button"
wire:click="{{ $saveClick }}"
class="px-4 py-2 text-sm font-medium text-primary-foreground bg-primary hover:bg-primary/90 rounded-lg transition-colors duration-150"
class="rounded-lg bg-brand-500 px-4 py-2.5 text-theme-sm font-medium text-white shadow-theme-xs transition-colors duration-150 hover:bg-brand-600"
>
Save
</button>
@@ -134,7 +134,7 @@
<button
type="button"
wire:click="{{ $applyClick }}"
class="px-4 py-2 text-sm font-medium text-primary-foreground bg-primary hover:bg-primary/90 rounded-lg transition-colors duration-150"
class="rounded-lg bg-brand-500 px-4 py-2.5 text-theme-sm font-medium text-white shadow-theme-xs transition-colors duration-150 hover:bg-brand-600"
>
{{ $applyLabel }}
</button>