Files
Virtnet.bond/extensions/Servers/Proxmox/views/components/ui/badge.blade.php
Joseph.Rawlings abff5a381f 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.
2026-02-01 14:16:57 -05:00

79 lines
2.4 KiB
PHP

{{--
Badge Component - LucentUI Theme
Migrated from AdminLTE to Tailwind
Usage:
<x-proxmox::ui.badge>Default</x-proxmox::ui.badge>
<x-proxmox::ui.badge variant="success">Running</x-proxmox::ui.badge>
<x-proxmox::ui.badge variant="danger" icon="ri-error-warning-line">Error</x-proxmox::ui.badge>
<x-proxmox::ui.badge variant="info" dot pulse>Active</x-proxmox::ui.badge>
--}}
@props([
'variant' => 'default',
'size' => 'md',
'icon' => null,
'dot' => false,
'pulse' => false,
])
@php
$variantClasses = [
'default' => 'bg-primary/20 text-primary',
'primary' => 'bg-primary/20 text-primary',
'secondary' => 'bg-neutral/20 text-base/70',
'success' => 'bg-success/20 text-success',
'warning' => 'bg-warning/20 text-warning',
'danger' => 'bg-error/20 text-error',
'info' => 'bg-info/20 text-info',
'light' => 'bg-neutral/10 text-base/60',
'dark' => 'bg-neutral/80 text-white',
'muted' => 'bg-neutral/20 text-base/50',
];
$sizeClasses = [
'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',
];
$iconSizes = [
'xs' => 'size-2.5',
'sm' => 'size-3',
'md' => 'size-3.5',
'lg' => 'size-4',
];
$dotSizes = [
'xs' => 'size-1',
'sm' => 'size-1.5',
'md' => 'size-1.5',
'lg' => 'size-2',
];
$iconSize = $iconSizes[$size] ?? $iconSizes['md'];
$dotSize = $dotSizes[$size] ?? $dotSizes['md'];
$badgeSize = $sizeClasses[$size] ?? $sizeClasses['md'];
@endphp
<span {{ $attributes->class([
'inline-flex items-center font-semibold rounded-full transition-all duration-200',
$badgeSize,
$variantClasses[$variant] ?? $variantClasses['default'],
'gap-1.5' => $icon || $dot,
]) }}>
@if($dot)
<span class="relative flex {{ $dotSize }}">
@if($pulse)
<span class="absolute inline-flex h-full w-full rounded-full bg-current opacity-40 animate-ping"></span>
@endif
<span class="relative inline-flex rounded-full {{ $dotSize }} bg-current"></span>
</span>
@endif
@if($icon)
<x-dynamic-component :component="$icon" class="fill-current {{ $iconSize }}" />
@endif
{{ $slot }}
</span>