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:
@@ -1,5 +1,5 @@
|
||||
{{--
|
||||
Input Component - shadcn-style
|
||||
Input Component - TailAdmin Theme
|
||||
|
||||
Usage:
|
||||
<x-proxmox::ui.input name="email" label="Email" />
|
||||
@@ -24,43 +24,43 @@
|
||||
|
||||
@php
|
||||
$sizeClasses = [
|
||||
'sm' => 'h-8 text-sm',
|
||||
'md' => 'h-9 text-sm',
|
||||
'lg' => 'h-10 text-base',
|
||||
'sm' => 'h-9 text-sm',
|
||||
'md' => 'h-11 text-sm',
|
||||
'lg' => 'h-12 text-base',
|
||||
];
|
||||
$sizeClass = $sizeClasses[$size] ?? $sizeClasses['md'];
|
||||
|
||||
$inputClasses = 'flex w-full rounded-md border bg-transparent px-3 py-1 text-sm transition-colors duration-150 file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50';
|
||||
$inputClasses = 'flex w-full rounded-lg border border-gray-300 bg-transparent px-4 py-2.5 text-sm text-gray-800 shadow-theme-xs transition-colors duration-200 placeholder:text-gray-400 focus:border-brand-300 focus:outline-hidden focus:ring-3 focus:ring-brand-500/10 disabled:cursor-not-allowed disabled:opacity-50 dark:border-gray-700 dark:bg-gray-900 dark:text-white/90 dark:placeholder:text-white/30 dark:focus:border-brand-800';
|
||||
|
||||
if ($error) {
|
||||
$inputClasses .= ' border-danger focus-visible:ring-danger';
|
||||
} else {
|
||||
$inputClasses .= ' border-input';
|
||||
$inputClasses = str_replace('border-gray-300', 'border-error-300', $inputClasses);
|
||||
$inputClasses = str_replace('focus:border-brand-300', 'focus:border-error-500', $inputClasses);
|
||||
$inputClasses = str_replace('focus:ring-brand-500/10', 'focus:ring-error-500/10', $inputClasses);
|
||||
}
|
||||
|
||||
if ($icon) {
|
||||
$inputClasses .= ' ps-9';
|
||||
$inputClasses .= ' pl-11';
|
||||
}
|
||||
|
||||
if ($iconRight) {
|
||||
$inputClasses .= ' pe-9';
|
||||
$inputClasses .= ' pr-11';
|
||||
}
|
||||
@endphp
|
||||
|
||||
<div {{ $attributes->only('class')->class(['space-y-2']) }}>
|
||||
<div {{ $attributes->only('class')->class(['space-y-1.5']) }}>
|
||||
@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="mb-1.5 block text-sm font-medium text-gray-700 dark:text-gray-400">
|
||||
{{ $label }}
|
||||
@if($required)
|
||||
<span class="text-danger">*</span>
|
||||
<span class="text-error-500">*</span>
|
||||
@endif
|
||||
</label>
|
||||
@endif
|
||||
|
||||
<div class="relative">
|
||||
@if($icon)
|
||||
<div class="pointer-events-none absolute inset-y-0 start-0 flex items-center ps-3 text-muted-foreground">
|
||||
<x-dynamic-component :component="$icon" class="size-4" />
|
||||
<div class="pointer-events-none absolute inset-y-0 left-0 flex h-11 w-[46px] items-center justify-center border-r border-gray-200 dark:border-gray-800">
|
||||
<x-dynamic-component :component="$icon" class="fill-gray-500 dark:fill-gray-400 size-5" />
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@@ -75,15 +75,15 @@
|
||||
/>
|
||||
|
||||
@if($iconRight)
|
||||
<div class="pointer-events-none absolute inset-y-0 end-0 flex items-center pe-3 text-muted-foreground">
|
||||
<x-dynamic-component :component="$iconRight" class="size-4" />
|
||||
<div class="pointer-events-none absolute inset-y-0 right-0 flex h-11 w-[46px] items-center justify-center border-l border-gray-200 dark:border-gray-800">
|
||||
<x-dynamic-component :component="$iconRight" class="fill-gray-500 dark:fill-gray-400 size-5" />
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
@if($error)
|
||||
<p class="text-[0.8rem] font-medium text-danger">{{ $error }}</p>
|
||||
<p class="text-sm text-error-500">{{ $error }}</p>
|
||||
@elseif($hint)
|
||||
<p class="text-[0.8rem] text-muted-foreground">{{ $hint }}</p>
|
||||
<p class="text-sm text-gray-500 dark:text-gray-400">{{ $hint }}</p>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user