- Refactored select component to align with shadcn design principles. - Updated server status indicator component for consistency with shadcn style. - Modified spinner component to follow shadcn design guidelines. - Enhanced stat card component with shadcn-inspired styles. - Adjusted tab panel component to reflect shadcn design updates. - Revamped table row and table data cell components to match shadcn aesthetics. - Updated table header cell component for improved styling consistency. - Refined table component to align with shadcn design principles. - Enhanced tabs component with shadcn-inspired styles. - Updated toggle component to follow shadcn design guidelines. - Refactored tooltip component to align with shadcn design principles. - Updated server card component to reflect shadcn-inspired design.
117 lines
4.3 KiB
PHP
117 lines
4.3 KiB
PHP
{{--
|
|
Confirm Dialog Component - shadcn-style
|
|
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-danger/10',
|
|
'iconColor' => 'text-danger',
|
|
'buttonClass' => 'bg-danger text-danger-foreground hover:bg-danger/90',
|
|
],
|
|
'warning' => [
|
|
'icon' => 'ri-alert-line',
|
|
'iconBg' => 'bg-warning/10',
|
|
'iconColor' => 'text-warning',
|
|
'buttonClass' => 'bg-warning text-warning-foreground hover:bg-warning/90',
|
|
],
|
|
'primary' => [
|
|
'icon' => 'ri-question-line',
|
|
'iconBg' => 'bg-primary/10',
|
|
'iconColor' => 'text-primary',
|
|
'buttonClass' => 'bg-primary text-primary-foreground hover:bg-primary/90',
|
|
],
|
|
];
|
|
|
|
$config = $variants[$variant] ?? $variants['danger'];
|
|
@endphp
|
|
|
|
<div
|
|
x-data="{ open: @js($open) }"
|
|
x-show="open"
|
|
x-cloak
|
|
@keydown.escape.window="open = false"
|
|
class="fixed inset-0 z-50 overflow-y-auto"
|
|
{{ $attributes->whereDoesntStartWith('wire:click') }}
|
|
>
|
|
<div class="flex items-center justify-center min-h-screen p-4">
|
|
<!-- Backdrop -->
|
|
<div
|
|
x-show="open"
|
|
x-transition:enter="ease-out duration-150"
|
|
x-transition:enter-start="opacity-0"
|
|
x-transition:enter-end="opacity-100"
|
|
x-transition:leave="ease-in duration-100"
|
|
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"
|
|
></div>
|
|
|
|
<!-- Dialog -->
|
|
<div
|
|
x-show="open"
|
|
x-transition:enter="ease-out duration-150"
|
|
x-transition:enter-start="opacity-0 scale-95"
|
|
x-transition:enter-end="opacity-100 scale-100"
|
|
x-transition:leave="ease-in duration-100"
|
|
x-transition:leave-start="opacity-100 scale-100"
|
|
x-transition:leave-end="opacity-0 scale-95"
|
|
class="relative rounded-lg border bg-background shadow-lg w-full max-w-md p-6"
|
|
>
|
|
<div class="flex flex-col items-center text-center">
|
|
<!-- Icon -->
|
|
<div class="p-3 rounded-full {{ $config['iconBg'] }} mb-4">
|
|
<x-dynamic-component :component="$config['icon']" class="size-6 {{ $config['iconColor'] }}" />
|
|
</div>
|
|
|
|
<!-- Title -->
|
|
<h3 class="text-lg font-semibold leading-none tracking-tight mb-2">{{ $title }}</h3>
|
|
|
|
<!-- Message -->
|
|
<p class="text-sm text-muted-foreground mb-6">{{ $message }}</p>
|
|
|
|
<!-- Actions -->
|
|
<div class="flex gap-2 w-full">
|
|
<button
|
|
type="button"
|
|
@click="open = false"
|
|
class="flex-1 inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors duration-150 h-9 px-4 py-2 border bg-background hover:bg-accent hover:text-accent-foreground"
|
|
>
|
|
{{ $cancelLabel }}
|
|
</button>
|
|
<button
|
|
type="button"
|
|
@click="open = false"
|
|
{{ $attributes->whereStartsWith('wire:click') }}
|
|
class="flex-1 inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors duration-150 h-9 px-4 py-2 {{ $config['buttonClass'] }}"
|
|
>
|
|
{{ $confirmLabel }}
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|