alert-dialog
Advanced security audit confirmation
Advanced security audit confirmation
Загрузка превью…
src/alert-dialog/c-alert-dialog-14.vue
<!--
Иконки/список внутри AlertDialogContent не монтируются в закрытом
состоянии; пути lucide "shield-alert", "lock", "fingerprint", "key-square".
-->
<script setup lang="ts">
import { Badge } from "@/components/reui/badge"
import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogMedia, AlertDialogTitle, AlertDialogTrigger } from "@/components/ui/alert-dialog"
import { Button } from "@/components/ui/button"
const SECURITY_ITEMS: { icon: "lock" | "fingerprint" | "key-square"; title: string; description: string; status: "Pending" | "Done" }[] = [
{ icon: "lock", title: "Password Policy", description: "Verify strength and rotation", status: "Pending" },
{ icon: "fingerprint", title: "Biometric Status", description: "Check hardware encryption", status: "Done" },
{ icon: "key-square", title: "Active Sessions", description: "Review connected devices", status: "Pending" },
]
</script>
<template>
<AlertDialog>
<AlertDialogTrigger as-child>
<Button variant="outline">Advanced Security Check</Button>
</AlertDialogTrigger>
<AlertDialogContent class="max-w-sm! gap-0 overflow-hidden p-0">
<div class="flex flex-col items-center justify-center gap-1.5 px-4 pt-6 pb-5 text-center">
<AlertDialogMedia class="size-12 rounded-full bg-green-50 text-green-500 dark:bg-green-950 dark:text-green-400">
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
class="size-6"
><path d="M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z" /><path d="M12 8v4" /><path d="M12 16h.01" /></svg>
</AlertDialogMedia>
<AlertDialogTitle class="text-base font-semibold">Advanced Security Audit</AlertDialogTitle>
<AlertDialogDescription class="p-0 text-sm">
Summary of your account status and security settings.
</AlertDialogDescription>
</div>
<div class="space-y-3 p-4">
<div
v-for="item in SECURITY_ITEMS"
:key="item.title"
class="border-border flex items-center justify-between rounded-md border border-dashed px-3 py-2.5"
>
<div class="flex items-center gap-2.5">
<div class="bg-background border-border/80 flex size-8 items-center justify-center rounded-md border shadow-xs">
<svg
v-if="item.icon === 'lock'"
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
class="text-muted-foreground size-4"
><rect width="18" height="11" x="3" y="11" rx="2" ry="2" /><path d="M7 11V7a5 5 0 0 1 10 0v4" /></svg>
<svg
v-else-if="item.icon === 'fingerprint'"
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
class="text-muted-foreground size-4"
><path d="M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4" /><path d="M14 13.12c0 2.38 0 6.38-1 8.88" /><path d="M17.29 21.02c.12-.6.43-2.3.5-3.02" /><path d="M2 12a10 10 0 0 1 18-6" /><path d="M2 16h.01" /><path d="M21.8 16c.2-2 .131-5.354 0-6" /><path d="M5 19.5C5.5 18 6 15 6 12a6 6 0 0 1 .34-2" /><path d="M8.65 22c.21-.66.45-1.32.57-2" /><path d="M9 6.8a6 6 0 0 1 9 5.2v2" /></svg>
<svg
v-else
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
class="text-muted-foreground size-4"
><path d="M12.4 2.7a2.5 2.5 0 0 1 3.4 0l5.5 5.5a2.5 2.5 0 0 1 0 3.4l-3.7 3.7a2.5 2.5 0 0 1-3.4 0L8.7 9.8a2.5 2.5 0 0 1 0-3.4z" /><path d="m14 7 3 3" /><path d="m9.4 10.6-6.814 6.814A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814" /></svg>
</div>
<div class="flex flex-col gap-0.25">
<span class="text-sm font-medium">{{ item.title }}</span>
<span class="text-muted-foreground text-xs">{{ item.description }}</span>
</div>
</div>
<Badge :variant="item.status === 'Pending' ? 'warning-light' : 'success-light'">{{ item.status }}</Badge>
</div>
</div>
<AlertDialogFooter class="mx-0 mb-0 grid grid-cols-1 gap-2 p-4">
<AlertDialogAction variant="default" class="flex-1">Start Deep Audit</AlertDialogAction>
<AlertDialogCancel variant="ghost" class="flex-1">Skip for now</AlertDialogCancel>
</AlertDialogFooter>
</AlertDialogContent>
</AlertDialog>
</template>
Установка
npx shadcn-vue@latest add https://revueui.rootapi.dev/r/c-alert-dialog-14.jsonЗависимости реестра
Источник: порт из ReUI (Keenthemes, MIT)