- Introduced AdminLTE CSS variables for color palette, body colors, card styles, and button styles. - Implemented card components with variants for primary, success, warning, danger, and info. - Added button styles including sizes and outline variants. - Created form controls, select inputs, and input groups with consistent styling. - Included utility classes for text and background colors, gradients, and shadows. - Developed components for badges, alerts, callouts, progress bars, tables, small boxes, and info boxes. - Integrated modal, dropdown, spinner, tooltip, and direct chat styles. - Established timeline and close button styles, with dark mode support for specific components.
70 lines
2.0 KiB
PHP
70 lines
2.0 KiB
PHP
{{--
|
|
Badge Component - AdminLTE Theme
|
|
Based on AdminLTE v4 Badge styling patterns
|
|
|
|
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' => 'lte-badge-primary',
|
|
'primary' => 'lte-badge-primary',
|
|
'secondary' => 'lte-badge-secondary',
|
|
'success' => 'lte-badge-success',
|
|
'warning' => 'lte-badge-warning',
|
|
'danger' => 'lte-badge-danger',
|
|
'info' => 'lte-badge-info',
|
|
'light' => 'lte-badge-light',
|
|
'dark' => 'lte-badge-dark',
|
|
'muted' => 'lte-badge-secondary',
|
|
];
|
|
|
|
$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'];
|
|
@endphp
|
|
|
|
<span {{ $attributes->class([
|
|
'lte-badge',
|
|
$variantClasses[$variant] ?? $variantClasses['default'],
|
|
'gap-1' => $icon || $dot,
|
|
]) }} style="{{ $size === 'lg' ? 'font-size: 0.9em; padding: 0.5em 0.8em;' : '' }}">
|
|
@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>
|