add destructive variant to alert dialogs for destructive actions

This commit is contained in:
pa
2026-03-13 23:10:29 +09:00
parent 9b6ca42d9d
commit 1f5acd546d
17 changed files with 77 additions and 40 deletions

View File

@@ -7,14 +7,15 @@
const props = defineProps({
asChild: { type: Boolean, required: false },
as: { type: null, required: false },
variant: { type: String, required: false },
class: { type: null, required: false }
});
const delegatedProps = reactiveOmit(props, 'class');
const delegatedProps = reactiveOmit(props, 'class', 'variant');
</script>
<template>
<AlertDialogAction v-bind="delegatedProps" :class="cn(buttonVariants(), props.class)">
<AlertDialogAction v-bind="delegatedProps" :class="cn(buttonVariants({ variant: props.variant }), props.class)">
<slot />
</AlertDialogAction>
</template>