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.
This commit is contained in:
2025-12-17 12:07:54 -05:00
parent 5004408751
commit 7a089f53e2
15 changed files with 184 additions and 180 deletions

View File

@@ -1,5 +1,5 @@
{{--
Select Component - shadcn-style
Select Component - TailAdmin style
Usage:
<x-proxmox::ui.select name="country" label="Country">
@@ -20,27 +20,27 @@
@php
$sizeClasses = [
'sm' => 'h-8 text-sm',
'md' => 'h-9 text-sm',
'lg' => 'h-10 text-base',
'sm' => 'h-9 text-theme-xs py-2',
'md' => 'h-11 text-theme-sm py-2.5',
'lg' => 'h-12 text-base py-3',
];
$sizeClass = $sizeClasses[$size] ?? $sizeClasses['md'];
$selectClasses = 'flex w-full items-center justify-between whitespace-nowrap rounded-md border bg-transparent px-3 py-2 text-sm ring-offset-background transition-colors duration-150 placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 appearance-none cursor-pointer';
$selectClasses = 'block w-full appearance-none rounded-lg border bg-transparent px-4 pr-10 shadow-theme-xs transition-colors duration-150 placeholder:text-gray-400 focus:outline-none focus:ring-3 disabled:cursor-not-allowed disabled:bg-gray-50 dark:bg-gray-900 dark:text-white/90 dark:placeholder:text-gray-500 dark:disabled:bg-gray-800';
if ($error) {
$selectClasses .= ' border-danger focus:ring-danger';
$selectClasses .= ' border-error-300 focus:border-error-300 focus:ring-error-500/10 dark:border-error-700';
} else {
$selectClasses .= ' border-input';
$selectClasses .= ' border-gray-300 focus:border-brand-300 focus:ring-brand-500/10 dark:border-gray-700 dark:focus:border-brand-600';
}
@endphp
<div {{ $attributes->only('class')->class(['space-y-2']) }}>
@if($label)
<label @if($name) for="{{ $name }}" @endif class="text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70">
<label @if($name) for="{{ $name }}" @endif class="text-theme-sm font-medium text-gray-700 dark:text-gray-300">
{{ $label }}
@if($required)
<span class="text-danger">*</span>
<span class="text-error-500">*</span>
@endif
</label>
@endif
@@ -54,14 +54,14 @@
>
{{ $slot }}
</select>
<div class="pointer-events-none absolute inset-y-0 end-0 flex items-center pe-3 text-muted-foreground">
<x-ri-arrow-down-s-line class="size-4 opacity-50" />
<div class="pointer-events-none absolute inset-y-0 end-0 flex items-center pe-4 text-gray-500 dark:text-gray-400">
<x-ri-arrow-down-s-line class="size-5" />
</div>
</div>
@if($error)
<p class="text-[0.8rem] font-medium text-danger">{{ $error }}</p>
<p class="text-theme-xs font-medium text-error-500">{{ $error }}</p>
@elseif($hint)
<p class="text-[0.8rem] text-muted-foreground">{{ $hint }}</p>
<p class="text-theme-xs text-gray-500 dark:text-gray-400">{{ $hint }}</p>
@endif
</div>