Migrate UI components from AdminLTE to LucentUI Theme using Tailwind CSS
- Updated tab-panel component to use Tailwind for styling and transitions. - Refactored table-row component to implement Tailwind classes for hover effects and borders. - Converted table-td component to utilize Tailwind for alignment and text styles. - Changed table-th component to apply Tailwind for header styling and sorting indicators. - Revised table component to adopt Tailwind for layout, borders, and responsive design. - Enhanced tabs component with Tailwind for navigation styles and transitions. - Updated toggle component to use Tailwind for switch styles and accessibility. - Refactored tooltip component to implement Tailwind for positioning and styling. - Added visual enhancements to app.css for improved UI interactions and animations.
This commit is contained in:
@@ -14,17 +14,17 @@
|
||||
])
|
||||
|
||||
@php
|
||||
// AdminLTE button base class
|
||||
$baseClasses = 'lte-btn';
|
||||
// LucentUI button base classes
|
||||
$baseClasses = 'inline-flex items-center justify-center gap-2 font-semibold transition-all duration-200 cursor-pointer disabled:cursor-not-allowed disabled:opacity-50 active:scale-95';
|
||||
|
||||
// Size classes - AdminLTE style
|
||||
// Size classes
|
||||
$sizeClasses = match($size) {
|
||||
'xs' => 'lte-btn-sm',
|
||||
'sm' => 'lte-btn-sm',
|
||||
'md' => '',
|
||||
'lg' => 'lte-btn-lg',
|
||||
'xl' => 'lte-btn-lg',
|
||||
default => '',
|
||||
'xs' => 'px-2 py-1 text-xs',
|
||||
'sm' => 'px-3 py-1.5 text-sm',
|
||||
'md' => 'px-4 py-2 text-sm',
|
||||
'lg' => 'px-5 py-2.5 text-base',
|
||||
'xl' => 'px-6 py-3 text-base',
|
||||
default => 'px-4 py-2 text-sm',
|
||||
};
|
||||
|
||||
// Icon size classes
|
||||
@@ -37,43 +37,66 @@
|
||||
default => 'size-4',
|
||||
};
|
||||
|
||||
// Variant classes - AdminLTE style
|
||||
// Variant classes - LucentUI Tailwind
|
||||
$variantClasses = match($variant) {
|
||||
'primary' => $outline ? 'lte-btn-outline-primary' : 'lte-btn-primary',
|
||||
'secondary' => $outline ? 'lte-btn-outline-secondary' : 'lte-btn-secondary',
|
||||
'success' => $outline ? 'lte-btn-outline-success' : 'lte-btn-success',
|
||||
'danger' => $outline ? 'lte-btn-outline-danger' : 'lte-btn-danger',
|
||||
'warning' => 'lte-btn-warning',
|
||||
'info' => 'lte-btn-info',
|
||||
'ghost' => 'lte-btn-outline-secondary',
|
||||
'link' => 'lte-text-primary',
|
||||
'neutral' => $outline ? 'lte-btn-outline-secondary' : 'lte-btn-secondary',
|
||||
default => $outline ? 'lte-btn-outline-primary' : 'lte-btn-primary',
|
||||
'primary' => $outline
|
||||
? 'border border-primary text-primary bg-transparent hover:bg-primary/10 focus:ring-2 focus:ring-primary/50'
|
||||
: 'bg-primary text-white hover:bg-primary/80 focus:ring-2 focus:ring-primary/50',
|
||||
'secondary' => $outline
|
||||
? 'border border-neutral text-base/80 bg-transparent hover:bg-neutral/10 focus:ring-2 focus:ring-neutral/50'
|
||||
: 'bg-background-secondary text-base/80 border border-neutral hover:bg-background-secondary/80 focus:ring-2 focus:ring-neutral/50',
|
||||
'success' => $outline
|
||||
? 'border border-success text-success bg-transparent hover:bg-success/10 focus:ring-2 focus:ring-success/50'
|
||||
: 'bg-success text-white hover:bg-success/80 focus:ring-2 focus:ring-success/50',
|
||||
'danger' => $outline
|
||||
? 'border border-error text-error bg-transparent hover:bg-error/10 focus:ring-2 focus:ring-error/50'
|
||||
: 'bg-error text-white hover:bg-error/80 focus:ring-2 focus:ring-error/50',
|
||||
'warning' => $outline
|
||||
? 'border border-warning text-warning bg-transparent hover:bg-warning/10 focus:ring-2 focus:ring-warning/50'
|
||||
: 'bg-warning text-white hover:bg-warning/80 focus:ring-2 focus:ring-warning/50',
|
||||
'info' => $outline
|
||||
? 'border border-info text-info bg-transparent hover:bg-info/10 focus:ring-2 focus:ring-info/50'
|
||||
: 'bg-info text-white hover:bg-info/80 focus:ring-2 focus:ring-info/50',
|
||||
'ghost' => 'text-base/80 bg-transparent hover:bg-neutral/10 focus:ring-2 focus:ring-neutral/50',
|
||||
'link' => 'text-primary bg-transparent hover:underline p-0',
|
||||
'neutral' => $outline
|
||||
? 'border border-neutral text-base/70 bg-transparent hover:bg-neutral/10 focus:ring-2 focus:ring-neutral/50'
|
||||
: 'bg-neutral/20 text-base/80 hover:bg-neutral/30 focus:ring-2 focus:ring-neutral/50',
|
||||
default => $outline
|
||||
? 'border border-primary text-primary bg-transparent hover:bg-primary/10 focus:ring-2 focus:ring-primary/50'
|
||||
: 'bg-primary text-white hover:bg-primary/80 focus:ring-2 focus:ring-primary/50',
|
||||
};
|
||||
|
||||
// Full width
|
||||
$widthClasses = $fullWidth ? 'w-full' : '';
|
||||
|
||||
// Combined classes
|
||||
$classes = trim("$baseClasses $sizeClasses $variantClasses $widthClasses");
|
||||
// Border radius
|
||||
$roundedClasses = match($rounded) {
|
||||
'none' => 'rounded-none',
|
||||
'sm' => 'rounded-sm',
|
||||
'md' => 'rounded-md',
|
||||
'lg' => 'rounded-lg',
|
||||
'xl' => 'rounded-xl',
|
||||
'full' => 'rounded-full',
|
||||
default => 'rounded-lg',
|
||||
};
|
||||
|
||||
// Determine tag
|
||||
$tag = $href ? 'a' : 'button';
|
||||
// Combined classes
|
||||
$classes = trim("$baseClasses $sizeClasses $variantClasses $widthClasses $roundedClasses");
|
||||
@endphp
|
||||
|
||||
@if($href)
|
||||
<a href="{{ $href }}" {{ $attributes->merge(['class' => $classes]) }} style="border-radius: 0.375rem;">
|
||||
<a href="{{ $href }}" {{ $attributes->merge(['class' => $classes]) }}>
|
||||
@else
|
||||
<button
|
||||
type="{{ $type }}"
|
||||
{{ $disabled || $loading ? 'disabled' : '' }}
|
||||
{{ $attributes->merge(['class' => $classes]) }}
|
||||
style="border-radius: 0.375rem;"
|
||||
>
|
||||
@endif
|
||||
|
||||
@if($loading)
|
||||
<span class="lte-spinner lte-spinner-sm" style="margin-right: 0.5rem;"></span>
|
||||
<x-ri-loader-5-fill class="{{ $iconSizeClasses }} animate-spin" />
|
||||
@elseif($icon && $iconPosition === 'left')
|
||||
<x-dynamic-component :component="$icon" class="{{ $iconSizeClasses }}" />
|
||||
@endif
|
||||
|
||||
Reference in New Issue
Block a user