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 @@
{{--
Icon Picker Component - shadcn-inspired
Icon Picker Component - TailAdmin styled
Modal-based icon picker with search and categories
Usage:
@@ -40,15 +40,15 @@
<button
type="button"
@click="open = true"
class="flex items-center gap-2 px-3 py-2 rounded-lg border bg-background hover:bg-muted transition-colors duration-150"
class="flex items-center gap-2 px-3 py-2.5 rounded-lg border border-gray-300 bg-white hover:bg-gray-50 shadow-theme-xs dark:border-gray-700 dark:bg-gray-900 dark:hover:bg-gray-800 transition-colors duration-150"
>
<template x-if="selected">
<x-dynamic-component x-bind:component="selected" class="size-5 text-primary" />
<x-dynamic-component x-bind:component="selected" class="size-5 text-brand-500" />
</template>
<template x-if="!selected">
<x-ri-image-add-line class="size-5 text-muted-foreground" />
<x-ri-image-add-line class="size-5 text-gray-400 dark:text-gray-500" />
</template>
<span class="text-sm">Select Icon</span>
<span class="text-theme-sm text-gray-700 dark:text-gray-300">Select Icon</span>
</button>
<!-- Modal -->
@@ -69,7 +69,7 @@
x-transition:leave-start="opacity-100"
x-transition:leave-end="opacity-0"
@click="open = false"
class="fixed inset-0 bg-black/50"
class="fixed inset-0 bg-gray-900/50 dark:bg-gray-950/70"
></div>
<!-- Modal Content -->
@@ -81,44 +81,44 @@
x-transition:leave="ease-in duration-100"
x-transition:leave-start="opacity-100 scale-100"
x-transition:leave-end="opacity-0 scale-95"
class="relative rounded-xl border bg-card shadow-lg w-full max-w-2xl max-h-[80vh] overflow-hidden"
class="relative rounded-2xl border border-gray-200 bg-white shadow-theme-lg dark:border-gray-800 dark:bg-gray-900 w-full max-w-2xl max-h-[80vh] overflow-hidden"
>
<!-- Header -->
<div class="p-4 border-b">
<div class="p-4 border-b border-gray-200 dark:border-gray-800">
<div class="flex items-center justify-between mb-3">
<h3 class="text-lg font-semibold">Select Icon</h3>
<button @click="open = false" class="p-1.5 rounded-lg hover:bg-muted text-muted-foreground hover:text-foreground transition-colors duration-150">
<h3 class="text-lg font-semibold text-gray-800 dark:text-white/90">Select Icon</h3>
<button @click="open = false" class="p-1.5 rounded-lg text-gray-400 hover:text-gray-600 hover:bg-gray-100 dark:text-gray-500 dark:hover:text-gray-300 dark:hover:bg-gray-800 transition-colors duration-150">
<x-ri-close-line class="size-5" />
</button>
</div>
<!-- Search -->
<div class="relative">
<x-ri-search-line class="absolute left-3 top-1/2 -translate-y-1/2 size-4 text-muted-foreground" />
<x-ri-search-line class="absolute left-3 top-1/2 -translate-y-1/2 size-4 text-gray-400 dark:text-gray-500" />
<input
type="text"
x-model="search"
placeholder="Search icons..."
class="w-full pl-10 pr-4 py-2 rounded-lg border bg-background text-sm placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring"
class="w-full pl-10 pr-4 py-2.5 rounded-lg border border-gray-300 bg-white text-theme-sm text-gray-800 placeholder:text-gray-400 shadow-theme-xs focus:outline-none focus:border-brand-300 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"
/>
</div>
</div>
<!-- Categories -->
@if(count($categories) > 0)
<div class="flex gap-2 p-4 border-b overflow-x-auto">
<div class="flex gap-2 p-4 border-b border-gray-200 dark:border-gray-800 overflow-x-auto">
<button
@click="activeCategory = 'all'"
:class="activeCategory === 'all' ? 'bg-primary text-primary-foreground' : 'bg-muted hover:bg-muted/80'"
class="px-3 py-1 rounded-full text-xs font-medium transition-colors duration-150 whitespace-nowrap"
:class="activeCategory === 'all' ? 'bg-brand-500 text-white' : 'bg-gray-100 text-gray-700 hover:bg-gray-200 dark:bg-gray-800 dark:text-gray-300 dark:hover:bg-gray-700'"
class="px-3 py-1.5 rounded-full text-theme-xs font-medium transition-colors duration-150 whitespace-nowrap"
>
All
</button>
@foreach($categories as $category)
<button
@click="activeCategory = '{{ $category['id'] }}'"
:class="activeCategory === '{{ $category['id'] }}' ? 'bg-primary text-primary-foreground' : 'bg-muted hover:bg-muted/80'"
class="px-3 py-1 rounded-full text-xs font-medium transition-colors duration-150 whitespace-nowrap"
:class="activeCategory === '{{ $category['id'] }}' ? 'bg-brand-500 text-white' : 'bg-gray-100 text-gray-700 hover:bg-gray-200 dark:bg-gray-800 dark:text-gray-300 dark:hover:bg-gray-700'"
class="px-3 py-1.5 rounded-full text-theme-xs font-medium transition-colors duration-150 whitespace-nowrap"
>
{{ $category['name'] }}
</button>
@@ -132,7 +132,7 @@
<template x-for="icon in filteredIcons" :key="icon.name">
<button
@click="selected = icon.component; open = false;"
:class="selected === icon.component ? 'ring-2 ring-primary bg-primary/10' : 'hover:bg-muted'"
:class="selected === icon.component ? 'ring-2 ring-brand-500 bg-brand-500/10 dark:bg-brand-500/20' : 'hover:bg-gray-100 dark:hover:bg-gray-800'"
class="flex items-center justify-center p-3 rounded-lg transition-colors duration-150"
:title="icon.name"
>
@@ -143,22 +143,22 @@
<!-- Empty State -->
<div x-show="filteredIcons.length === 0" class="py-8 text-center">
<x-ri-search-line class="size-12 mx-auto text-muted-foreground/30 mb-3" />
<p class="text-sm text-muted-foreground">No icons found matching your search.</p>
<x-ri-search-line class="size-12 mx-auto text-gray-300 dark:text-gray-700 mb-3" />
<p class="text-theme-sm text-gray-500 dark:text-gray-400">No icons found matching your search.</p>
</div>
</div>
<!-- Footer -->
<div class="p-4 border-t flex items-center justify-between">
<div class="p-4 border-t border-gray-200 dark:border-gray-800 flex items-center justify-between">
<button
@click="selected = null"
class="px-3 py-1.5 text-sm text-muted-foreground hover:text-foreground transition-colors duration-150"
class="px-3 py-1.5 text-theme-sm text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200 transition-colors duration-150"
>
Clear Selection
</button>
<button
@click="open = false"
class="px-4 py-2 bg-primary text-primary-foreground rounded-lg text-sm font-medium hover:bg-primary/90 transition-colors duration-150"
class="px-4 py-2.5 bg-brand-500 text-white rounded-lg text-theme-sm font-medium shadow-theme-xs hover:bg-brand-600 transition-colors duration-150"
>
Done
</button>