|
|
@@ -1,7 +1,7 @@
|
|
|
import * as React from 'react'
|
|
|
import * as DialogPrimitive from '@radix-ui/react-dialog'
|
|
|
import { X } from 'lucide-react'
|
|
|
-import { cn } from '../../lib/utils'
|
|
|
+import { cn } from '@/lib/utils'
|
|
|
|
|
|
const Dialog = DialogPrimitive.Root
|
|
|
|
|
|
@@ -19,7 +19,7 @@ const DialogOverlay = React.forwardRef<
|
|
|
ref={ref}
|
|
|
className={cn(
|
|
|
'ui__dialog-overlay',
|
|
|
- 'fixed inset-0 z-50 bg-background/90 data-[state=open]:animate-in ' +
|
|
|
+ 'fixed inset-0 z-50 bg-background/90 data-[state=open]:animate-in flex justify-center items-center ' +
|
|
|
'data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0',
|
|
|
className
|
|
|
)}
|
|
|
@@ -30,20 +30,17 @@ DialogOverlay.displayName = DialogPrimitive.Overlay.displayName
|
|
|
|
|
|
const DialogContent = React.forwardRef<
|
|
|
React.ElementRef<typeof DialogPrimitive.Content>,
|
|
|
- React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>
|
|
|
->(({ className, children, ...props }, ref) => (
|
|
|
+ React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content & any>
|
|
|
+>(({ className, children, overlayProps, ...props }, ref) => (
|
|
|
<DialogPortal>
|
|
|
- <DialogOverlay>
|
|
|
+ <DialogOverlay {...overlayProps}>
|
|
|
<DialogPrimitive.Content
|
|
|
ref={ref}
|
|
|
className={cn(
|
|
|
'ui__dialog-content',
|
|
|
- 'fixed left-[50%] top-[50%] z-50 grid w-full max-w-2xl lg:max-w-3xl translate-x-[-50%] translate-y-[-50%] gap-4 border ' +
|
|
|
- 'bg-background p-6 shadow-lg duration-200 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 data-[state=closed]:slide-out-to-left-1/2 ' +
|
|
|
- 'data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] ' +
|
|
|
- 'sm:rounded-lg',
|
|
|
+ 'relative grid w-full max-w-2xl lg:max-w-3xl gap-4 border sm:rounded-lg ' +
|
|
|
+ 'bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in ' +
|
|
|
+ 'data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 ',
|
|
|
className
|
|
|
)}
|
|
|
{...props}
|