@@ -5,11 +5,14 @@ import { reactiveOmit } from '@vueuse/core';
55import { DialogClose , DialogContent , DialogPortal , useForwardPropsEmits } from ' reka-ui' ;
66import { cn } from ' @/utils' ;
77import DialogOverlay from ' ./DialogOverlay.vue' ;
8+ import Button from ' @/components/ui/Button.vue' ;
89
9- const props = defineProps <DialogContentProps & { class? : HTMLAttributes [' class' ] }>();
10+ const props = defineProps <
11+ DialogContentProps & { class ?: HTMLAttributes [' class' ]; headerClass ?: HTMLAttributes [' class' ] }
12+ > ();
1013const emits = defineEmits <DialogContentEmits >();
1114
12- const delegatedProps = reactiveOmit (props , ' class' );
15+ const delegatedProps = reactiveOmit (props , ' class' , ' headerClass ' );
1316
1417const forwarded = useForwardPropsEmits (delegatedProps , emits );
1518 </script >
@@ -22,19 +25,29 @@ const forwarded = useForwardPropsEmits(delegatedProps, emits);
2225 v-bind =" forwarded "
2326 :class ="
2427 cn (
25- ' bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w -full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg ' ,
28+ ' bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 flex h -full w-full translate-x-[-50%] translate-y-[-50%] flex-col border shadow-lg duration-200 sm:h-160 sm: max-w-xl sm:rounded-2xl ' ,
2629 props .class ,
2730 )
2831 "
2932 >
30- <slot />
33+ <div class =" relative flex flex-row items-center justify-start gap-2 p-2" >
34+ <DialogClose as-child>
35+ <Button variant="ghost-default" size="icon-xs" class="absolute inset-2">
36+ <Icon name="lucide:x " class="size-5" />
37+ <span class =" sr-only" >{{ $t('ui.close') }}</span >
38+ </Button >
39+ </DialogClose >
40+ <div
41+ v-if =" $slots.header"
42+ :class =" cn('flex h-8 w-full items-center ps-10 text-lg font-medium', props.headerClass)"
43+ >
44+ <slot name =" header" />
45+ </div >
46+ </div >
3147
32- <DialogClose
33- class="ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute start-4 top-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not ([class*='size-'])]:size-4 "
34- >
35- <Icon name="lucide:x " class="size-4" />
36- <span class =" sr-only" >{{ $t('ui.close') }}</span >
37- </DialogClose >
48+ <div class =" flex h-full w-full flex-col gap-4 px-6 pb-6" >
49+ <slot />
50+ </div >
3851 </DialogContent >
3952 </DialogPortal >
4053</template >
0 commit comments