Files
Virtnet.bond/extensions/Servers/Proxmox/views/components/ui/confirm-dialog.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

117 lines
4.3 KiB
PHP

{{--
Confirm Dialog Component - LucentUI Theme
Migrated from AdminLTE to Tailwind
For dangerous actions like delete, stop, etc.
Usage:
<x-proxmox::ui.confirm-dialog
title="Stop Server?"
message="This will immediately stop the server."
confirm-label="Stop"
cancel-label="Cancel"
variant="danger"
wire:click="stopServer"
/>
--}}
@props([
'title' => 'Confirm Action',
'message' => 'Are you sure you want to proceed?',
'confirmLabel' => 'Confirm',
'cancelLabel' => 'Cancel',
'variant' => 'danger', // danger, warning, primary
'open' => false,
])
@php
$variants = [
'danger' => [
'icon' => 'ri-error-warning-line',
'iconBg' => 'bg-error/10',
'iconColor' => 'text-error',
'buttonClass' => 'bg-error text-white hover:bg-error/80',
],
'warning' => [
'icon' => 'ri-alert-line',
'iconBg' => 'bg-warning/15',
'iconColor' => 'text-warning',
'buttonClass' => 'bg-warning text-black hover:bg-warning/80',
],
'primary' => [
'icon' => 'ri-question-line',
'iconBg' => 'bg-primary/10',
'iconColor' => 'text-primary',
'buttonClass' => 'bg-primary text-white hover:bg-primary/80',
],
];
$config = $variants[$variant] ?? $variants['danger'];
@endphp
<div
x-data="{ open: @js($open) }"
x-show="open"
x-cloak
@keydown.escape.window="open = false"
{{ $attributes->whereDoesntStartWith('wire:click') }}
>
<!-- Backdrop -->
<div
x-show="open"
x-transition:enter="transition ease-out duration-200"
x-transition:enter-start="opacity-0"
x-transition:enter-end="opacity-100"
x-transition:leave="transition ease-in duration-150"
x-transition:leave-start="opacity-100"
x-transition:leave-end="opacity-0"
@click="open = false"
class="fixed inset-0 bg-black/50 backdrop-blur-sm z-[99998]"
></div>
<!-- Dialog Container -->
<div class="fixed inset-0 z-[99999] flex items-center justify-center p-4">
<div
x-show="open"
x-transition:enter="transition ease-out duration-200"
x-transition:enter-start="opacity-0 scale-95"
x-transition:enter-end="opacity-100 scale-100"
x-transition:leave="transition ease-in duration-150"
x-transition:leave-start="opacity-100 scale-100"
x-transition:leave-end="opacity-0 scale-95"
class="relative w-full max-w-md bg-background border border-neutral rounded-lg p-6 shadow-xl"
>
<div class="flex flex-col items-center text-center">
<!-- Icon -->
<div class="flex items-center justify-center size-14 rounded-full mb-5 {{ $config['iconBg'] }}">
<x-dynamic-component :component="$config['icon']" class="size-7 {{ $config['iconColor'] }}" />
</div>
<!-- Title -->
<h3 class="text-lg font-semibold text-base mb-2">{{ $title }}</h3>
<!-- Message -->
<p class="text-sm text-base/60 mb-6">{{ $message }}</p>
<!-- Actions -->
<div class="flex w-full gap-3">
<button
type="button"
@click="open = false"
class="flex-1 inline-flex items-center justify-center px-4 py-2.5 text-sm font-medium rounded-lg border border-neutral bg-background-secondary text-base/80 hover:bg-neutral/20 transition-all duration-200 shadow-sm"
>
{{ $cancelLabel }}
</button>
<button
type="button"
@click="open = false"
{{ $attributes->whereStartsWith('wire:click') }}
class="flex-1 inline-flex items-center justify-center px-4 py-2.5 text-sm font-medium rounded-lg transition-all duration-200 shadow-sm {{ $config['buttonClass'] }}"
>
{{ $confirmLabel }}
</button>
</div>
</div>
</div>
</div>
</div>