@@ -3,6 +3,7 @@ import { computed, defineComponent, useAttrs } from 'vue'
3
3
import type { PropType , WritableComputedRef } from ' vue'
4
4
import { Dialog as HDialog , DialogPanel as HDialogPanel , TransitionChild , TransitionRoot } from ' @headlessui/vue'
5
5
import { twMerge } from ' tailwind-merge'
6
+ import classNames from ' classnames'
6
7
import type { VariantJSWithClassesListProps } from ' @/utils/getVariantProps'
7
8
import { getVariantPropsWithClassesList } from ' @/utils/getVariantProps'
8
9
import type { USlideover } from ' @/Types/componentsTypes/components'
@@ -21,7 +22,7 @@ const props = defineProps({
21
22
},
22
23
side: {
23
24
type: String ,
24
- default: ' right ' ,
25
+ default: ' left ' ,
25
26
validator : (value : string ) => [' left' , ' right' ].includes (value ),
26
27
},
27
28
overlay: {
@@ -95,6 +96,15 @@ function close(value: boolean) {
95
96
isOpen .value = value
96
97
emit (' close' )
97
98
}
99
+
100
+ const dialogWrapperClass = computed (() => {
101
+ return classNames (
102
+ wrapperClass .value ,
103
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
104
+ // @ts-expect-error
105
+ { [variant .value ?.justifyEnd ]: props .side === ' right' },
106
+ )
107
+ })
98
108
</script >
99
109
100
110
<script lang="ts">
@@ -106,7 +116,11 @@ export default defineComponent({
106
116
107
117
<template >
108
118
<TransitionRoot as =" template" :appear =" appear" :show =" isOpen" >
109
- <HDialog :class =" [wrapperClass, { 'justify-end': side === 'right' }]" v-bind =" attrs" @close =" (e) => !preventClose && close(e)" >
119
+ <HDialog
120
+ :class =" [
121
+ dialogWrapperClass,
122
+ ]" v-bind =" attrs" @close =" (e) => !preventClose && close(e)"
123
+ >
110
124
<TransitionChild v-if =" overlay" as =" template" :appear =" appear" v-bind =" overlayTransitions" >
111
125
<div :class =" [variant.overlayBase, variant.overlayBackground]" />
112
126
</TransitionChild >
0 commit comments