- 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.
124 lines
3.8 KiB
PHP
124 lines
3.8 KiB
PHP
@props([
|
|
'variant' => 'neutral',
|
|
'size' => 'md',
|
|
'rounded' => 'full',
|
|
'dot' => false,
|
|
'pulse' => false,
|
|
'icon' => null,
|
|
'iconPosition' => 'left',
|
|
'removable' => false,
|
|
'outline' => false,
|
|
])
|
|
|
|
@php
|
|
// LucentUI badge base classes
|
|
$baseClasses = 'inline-flex items-center gap-1.5 font-semibold transition-all duration-200';
|
|
|
|
// Size classes
|
|
$sizeClasses = match($size) {
|
|
'xs' => 'px-1.5 py-0.5 text-[10px]',
|
|
'sm' => 'px-2 py-0.5 text-xs',
|
|
'md' => 'px-2.5 py-1 text-xs',
|
|
'lg' => 'px-3 py-1.5 text-sm',
|
|
default => 'px-2.5 py-1 text-xs',
|
|
};
|
|
|
|
// Icon size classes
|
|
$iconSizeClasses = match($size) {
|
|
'xs' => 'size-2.5',
|
|
'sm' => 'size-3',
|
|
'md' => 'size-3.5',
|
|
'lg' => 'size-4',
|
|
default => 'size-3.5',
|
|
};
|
|
|
|
// Dot size classes
|
|
$dotSizeClasses = match($size) {
|
|
'xs' => 'size-1.5',
|
|
'sm' => 'size-1.5',
|
|
'md' => 'size-2',
|
|
'lg' => 'size-2',
|
|
default => 'size-2',
|
|
};
|
|
|
|
// Variant classes - LucentUI Tailwind
|
|
$variantClasses = match($variant) {
|
|
'success' => $outline
|
|
? 'border border-success text-success bg-transparent'
|
|
: 'bg-success/20 text-success',
|
|
'danger' => $outline
|
|
? 'border border-error text-error bg-transparent'
|
|
: 'bg-error/20 text-error',
|
|
'warning' => $outline
|
|
? 'border border-warning text-warning bg-transparent'
|
|
: 'bg-warning/20 text-warning',
|
|
'info' => $outline
|
|
? 'border border-info text-info bg-transparent'
|
|
: 'bg-info/20 text-info',
|
|
'primary' => $outline
|
|
? 'border border-primary text-primary bg-transparent'
|
|
: 'bg-primary/20 text-primary',
|
|
'secondary' => $outline
|
|
? 'border border-neutral text-base/70 bg-transparent'
|
|
: 'bg-neutral/20 text-base/70',
|
|
'neutral' => $outline
|
|
? 'border border-neutral/50 text-base/60 bg-transparent'
|
|
: 'bg-neutral/10 text-base/60',
|
|
default => $outline
|
|
? 'border border-neutral text-base/70 bg-transparent'
|
|
: 'bg-neutral/20 text-base/70',
|
|
};
|
|
|
|
// Dot color classes
|
|
$dotColorClasses = match($variant) {
|
|
'success' => 'bg-success',
|
|
'danger' => 'bg-error',
|
|
'warning' => 'bg-warning',
|
|
'info' => 'bg-info',
|
|
'primary' => 'bg-primary',
|
|
'secondary' => 'bg-neutral',
|
|
'neutral' => 'bg-neutral/50',
|
|
default => 'bg-neutral',
|
|
};
|
|
|
|
// Border radius
|
|
$roundedClasses = match($rounded) {
|
|
'none' => 'rounded-none',
|
|
'sm' => 'rounded-sm',
|
|
'md' => 'rounded-md',
|
|
'lg' => 'rounded-lg',
|
|
'full' => 'rounded-full',
|
|
default => 'rounded-full',
|
|
};
|
|
|
|
// Combined classes
|
|
$classes = "$baseClasses $sizeClasses $variantClasses $roundedClasses";
|
|
@endphp
|
|
|
|
<span {{ $attributes->merge(['class' => $classes]) }}>
|
|
{{-- Dot indicator --}}
|
|
@if($dot)
|
|
<span class="{{ $dotSizeClasses }} {{ $dotColorClasses }} rounded-full {{ $pulse ? 'animate-pulse' : '' }}"></span>
|
|
@endif
|
|
|
|
{{-- Left icon --}}
|
|
@if($icon && $iconPosition === 'left')
|
|
<x-dynamic-component :component="$icon" class="{{ $iconSizeClasses }}" />
|
|
@endif
|
|
|
|
{{-- Content --}}
|
|
{{ $slot }}
|
|
|
|
{{-- Right icon --}}
|
|
@if($icon && $iconPosition === 'right')
|
|
<x-dynamic-component :component="$icon" class="{{ $iconSizeClasses }}" />
|
|
@endif
|
|
|
|
{{-- Remove button --}}
|
|
@if($removable)
|
|
<button type="button" class="ml-1 -mr-1 hover:opacity-70 transition-opacity">
|
|
<x-ri-close-line class="{{ $iconSizeClasses }}" />
|
|
</button>
|
|
@endif
|
|
</span>
|