- 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.
70 lines
2.3 KiB
PHP
70 lines
2.3 KiB
PHP
{{--
|
|
Action Toolbar Button Component - LucentUI Theme
|
|
Migrated from AdminLTE to Tailwind
|
|
Individual button for VM control actions
|
|
|
|
Usage:
|
|
<x-proxmox::ui.action-button
|
|
action="start"
|
|
wire:click="startServer"
|
|
icon="ri-play-fill"
|
|
label="Start"
|
|
/>
|
|
--}}
|
|
|
|
@props([
|
|
'action' => null,
|
|
'icon' => null,
|
|
'label',
|
|
'variant' => 'default', // default, danger, warning, success, primary
|
|
'disabled' => false,
|
|
'loading' => false,
|
|
'confirm' => null,
|
|
'size' => 'md', // sm, md, lg
|
|
])
|
|
|
|
@php
|
|
$sizeClasses = [
|
|
'sm' => 'h-9 px-3 text-xs',
|
|
'md' => 'h-10 px-4 text-sm',
|
|
'lg' => 'h-11 px-5 text-sm',
|
|
];
|
|
|
|
$iconSizes = [
|
|
'sm' => 'size-3.5',
|
|
'md' => 'size-4',
|
|
'lg' => 'size-4.5',
|
|
];
|
|
|
|
$variantClasses = [
|
|
'default' => 'bg-background border border-neutral text-base/80 shadow-sm hover:bg-background-secondary hover:border-neutral/80',
|
|
'primary' => 'bg-primary/10 border border-primary/20 text-primary hover:bg-primary/15 hover:border-primary/30',
|
|
'success' => 'bg-success/10 border border-success/20 text-success hover:bg-success/15 hover:border-success/30',
|
|
'warning' => 'bg-warning/15 border border-warning/30 text-warning hover:bg-warning/25 hover:border-warning/40',
|
|
'danger' => 'bg-error/10 border border-error/20 text-error hover:bg-error/15 hover:border-error/30',
|
|
];
|
|
@endphp
|
|
|
|
<button
|
|
type="button"
|
|
@if($confirm)
|
|
x-data=""
|
|
@click="if(confirm('{{ $confirm }}')) { $wire.call('{{ $action }}') }"
|
|
@endif
|
|
{{ $attributes->merge([
|
|
'disabled' => $disabled || $loading,
|
|
])->class([
|
|
'inline-flex items-center justify-center gap-2 whitespace-nowrap font-medium rounded-lg transition-all duration-200 cursor-pointer focus:outline-none focus:ring-2 focus:ring-primary/50 disabled:opacity-50 disabled:pointer-events-none',
|
|
$sizeClasses[$size] ?? $sizeClasses['md'],
|
|
$variantClasses[$variant] ?? $variantClasses['default'],
|
|
'cursor-wait' => $loading,
|
|
]) }}
|
|
>
|
|
@if($loading)
|
|
<x-ri-loader-5-fill class="{{ $iconSizes[$size] ?? $iconSizes['md'] }} animate-spin" />
|
|
@elseif($icon)
|
|
<x-dynamic-component :component="$icon" class="{{ $iconSizes[$size] ?? $iconSizes['md'] }}" />
|
|
@endif
|
|
<span>{{ $label }}</span>
|
|
</button>
|