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 @@
|
||||
{{--
|
||||
Alert Component - TailServer Theme (shadcn-inspired)
|
||||
Alert Component - TailAdmin Theme
|
||||
|
||||
Usage:
|
||||
<x-proxmox::ui.alert>Default alert</x-proxmox::ui.alert>
|
||||
@@ -19,23 +19,28 @@
|
||||
@php
|
||||
$variantConfig = [
|
||||
'default' => [
|
||||
'class' => 'bg-card text-card-foreground',
|
||||
'class' => 'border-gray-200 bg-white dark:border-gray-800 dark:bg-white/[0.03] text-gray-800 dark:text-white/90',
|
||||
'iconClass' => 'fill-gray-500 dark:fill-gray-400',
|
||||
'icon' => $icon ?? 'ri-information-line',
|
||||
],
|
||||
'info' => [
|
||||
'class' => 'border-info/20 bg-info/5 text-info [&>svg]:text-info',
|
||||
'class' => 'border-blue-light-200 bg-blue-light-50 dark:border-blue-light-500/20 dark:bg-blue-light-500/10 text-blue-light-600 dark:text-blue-light-400',
|
||||
'iconClass' => 'fill-blue-light-500',
|
||||
'icon' => $icon ?? 'ri-information-line',
|
||||
],
|
||||
'success' => [
|
||||
'class' => 'border-success/20 bg-success/5 text-success [&>svg]:text-success',
|
||||
'class' => 'border-success-200 bg-success-50 dark:border-success-500/20 dark:bg-success-500/10 text-success-600 dark:text-success-400',
|
||||
'iconClass' => 'fill-success-500',
|
||||
'icon' => $icon ?? 'ri-checkbox-circle-line',
|
||||
],
|
||||
'warning' => [
|
||||
'class' => 'border-warning/20 bg-warning/5 text-warning [&>svg]:text-warning',
|
||||
'class' => 'border-warning-200 bg-warning-50 dark:border-warning-500/20 dark:bg-warning-500/10 text-warning-600 dark:text-orange-400',
|
||||
'iconClass' => 'fill-warning-500',
|
||||
'icon' => $icon ?? 'ri-error-warning-line',
|
||||
],
|
||||
'danger' => [
|
||||
'class' => 'border-danger/20 bg-danger/5 text-danger [&>svg]:text-danger',
|
||||
'class' => 'border-error-200 bg-error-50 dark:border-error-500/20 dark:bg-error-500/10 text-error-600 dark:text-error-400',
|
||||
'iconClass' => 'fill-error-500',
|
||||
'icon' => $icon ?? 'ri-error-warning-fill',
|
||||
],
|
||||
];
|
||||
@@ -46,7 +51,7 @@
|
||||
<div
|
||||
role="alert"
|
||||
{{ $attributes->class([
|
||||
'relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5',
|
||||
'relative w-full rounded-xl border p-4 flex gap-3 items-start',
|
||||
$config['class'],
|
||||
]) }}
|
||||
@if($dismissible || $collapsible)
|
||||
@@ -55,24 +60,24 @@
|
||||
@if($collapsible) collapsed: {{ $collapsed ? 'true' : 'false' }} @endif
|
||||
}"
|
||||
x-show="show"
|
||||
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"
|
||||
@endif
|
||||
>
|
||||
<x-dynamic-component :component="$config['icon']" class="size-4" />
|
||||
<x-dynamic-component :component="$config['icon']" class="size-5 mt-0.5 shrink-0 {{ $config['iconClass'] }}" />
|
||||
<div class="flex-1 min-w-0">
|
||||
@if($title)
|
||||
<h5 class="mb-1 font-medium leading-none tracking-tight">{{ $title }}</h5>
|
||||
<h5 class="mb-1 text-sm font-semibold">{{ $title }}</h5>
|
||||
@endif
|
||||
<div
|
||||
class="text-sm [&_p]:leading-relaxed opacity-90"
|
||||
class="text-theme-sm"
|
||||
@if($collapsible)
|
||||
x-show="!collapsed"
|
||||
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"
|
||||
@endif
|
||||
@@ -81,15 +86,15 @@
|
||||
</div>
|
||||
</div>
|
||||
@if($dismissible || $collapsible)
|
||||
<div class="absolute top-3 right-3 flex items-center gap-1">
|
||||
<div class="flex items-center gap-1 shrink-0">
|
||||
@if($collapsible)
|
||||
<button
|
||||
type="button"
|
||||
@click="collapsed = !collapsed"
|
||||
class="p-1 rounded hover:bg-black/5 transition-colors"
|
||||
class="p-1.5 rounded-lg hover:bg-black/5 dark:hover:bg-white/5 transition-colors"
|
||||
>
|
||||
<x-ri-arrow-down-s-line
|
||||
class="size-4 transition-transform duration-150"
|
||||
class="size-4 transition-transform duration-200"
|
||||
x-bind:class="collapsed ? 'rotate-180' : ''"
|
||||
/>
|
||||
</button>
|
||||
@@ -98,7 +103,7 @@
|
||||
<button
|
||||
type="button"
|
||||
@click="show = false"
|
||||
class="p-1 rounded hover:bg-black/5 transition-colors"
|
||||
class="p-1.5 rounded-lg hover:bg-black/5 dark:hover:bg-white/5 transition-colors"
|
||||
>
|
||||
<x-ri-close-line class="size-4" />
|
||||
</button>
|
||||
|
||||
Reference in New Issue
Block a user