1
- " use client"
1
+ ' use client' ;
2
2
3
- import * as React from " react"
4
- import * as DialogPrimitive from " @radix-ui/react-dialog"
5
- import { X } from " lucide-react"
3
+ import * as React from ' react' ;
4
+ import * as DialogPrimitive from ' @radix-ui/react-dialog' ;
5
+ import { X } from ' lucide-react' ;
6
6
7
- import { cn } from " @ui/lib/utils"
7
+ import { cn } from ' @ui/lib/utils' ;
8
8
9
- const Dialog = DialogPrimitive . Root
9
+ const Dialog = DialogPrimitive . Root ;
10
10
11
- const DialogTrigger = DialogPrimitive . Trigger
11
+ const DialogTrigger = DialogPrimitive . Trigger ;
12
12
13
- const DialogPortal = DialogPrimitive . Portal
13
+ const DialogPortal = DialogPrimitive . Portal ;
14
14
15
15
const DialogOverlay = React . forwardRef <
16
16
React . ElementRef < typeof DialogPrimitive . Overlay > ,
@@ -19,13 +19,13 @@ const DialogOverlay = React.forwardRef<
19
19
< DialogPrimitive . Overlay
20
20
ref = { ref }
21
21
className = { cn (
22
- "fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0" ,
23
- className
22
+ ' bg-background/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 backdrop-blur-sm' ,
23
+ className ,
24
24
) }
25
25
{ ...props }
26
26
/>
27
- ) )
28
- DialogOverlay . displayName = DialogPrimitive . Overlay . displayName
27
+ ) ) ;
28
+ DialogOverlay . displayName = DialogPrimitive . Overlay . displayName ;
29
29
30
30
const DialogContent = React . forwardRef <
31
31
React . ElementRef < typeof DialogPrimitive . Content > ,
@@ -36,48 +36,48 @@ const DialogContent = React.forwardRef<
36
36
< DialogPrimitive . Content
37
37
ref = { ref }
38
38
className = { cn (
39
- "fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg 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 md:w-full" ,
40
- className
39
+ ' 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 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%] fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border p-6 shadow-lg duration-200 sm:rounded-lg md:w-full' ,
40
+ className ,
41
41
) }
42
42
{ ...props }
43
43
>
44
44
{ children }
45
- < DialogPrimitive . Close className = "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring- offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground " >
45
+ < DialogPrimitive . Close className = "ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute right-4 top-4 rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:pointer-events-none" >
46
46
< X className = "h-4 w-4" />
47
47
< span className = "sr-only" > Close</ span >
48
48
</ DialogPrimitive . Close >
49
49
</ DialogPrimitive . Content >
50
50
</ DialogPortal >
51
- ) )
52
- DialogContent . displayName = DialogPrimitive . Content . displayName
51
+ ) ) ;
52
+ DialogContent . displayName = DialogPrimitive . Content . displayName ;
53
53
54
54
const DialogHeader = ( {
55
55
className,
56
56
...props
57
57
} : React . HTMLAttributes < HTMLDivElement > ) => (
58
58
< div
59
59
className = { cn (
60
- " flex flex-col space-y-1.5 text-center sm:text-left" ,
61
- className
60
+ ' flex flex-col space-y-1.5 text-center sm:text-left' ,
61
+ className ,
62
62
) }
63
63
{ ...props }
64
64
/>
65
- )
66
- DialogHeader . displayName = " DialogHeader"
65
+ ) ;
66
+ DialogHeader . displayName = ' DialogHeader' ;
67
67
68
68
const DialogFooter = ( {
69
69
className,
70
70
...props
71
71
} : React . HTMLAttributes < HTMLDivElement > ) => (
72
72
< div
73
73
className = { cn (
74
- " flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2" ,
75
- className
74
+ ' flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2' ,
75
+ className ,
76
76
) }
77
77
{ ...props }
78
78
/>
79
- )
80
- DialogFooter . displayName = " DialogFooter"
79
+ ) ;
80
+ DialogFooter . displayName = ' DialogFooter' ;
81
81
82
82
const DialogTitle = React . forwardRef <
83
83
React . ElementRef < typeof DialogPrimitive . Title > ,
@@ -86,25 +86,25 @@ const DialogTitle = React.forwardRef<
86
86
< DialogPrimitive . Title
87
87
ref = { ref }
88
88
className = { cn (
89
- " text-lg font-semibold leading-none tracking-tight" ,
90
- className
89
+ ' text-lg font-semibold leading-none tracking-tight' ,
90
+ className ,
91
91
) }
92
92
{ ...props }
93
93
/>
94
- ) )
95
- DialogTitle . displayName = DialogPrimitive . Title . displayName
94
+ ) ) ;
95
+ DialogTitle . displayName = DialogPrimitive . Title . displayName ;
96
96
97
97
const DialogDescription = React . forwardRef <
98
98
React . ElementRef < typeof DialogPrimitive . Description > ,
99
99
React . ComponentPropsWithoutRef < typeof DialogPrimitive . Description >
100
100
> ( ( { className, ...props } , ref ) => (
101
101
< DialogPrimitive . Description
102
102
ref = { ref }
103
- className = { cn ( " text-sm text- muted-foreground" , className ) }
103
+ className = { cn ( ' text-muted-foreground text-sm' , className ) }
104
104
{ ...props }
105
105
/>
106
- ) )
107
- DialogDescription . displayName = DialogPrimitive . Description . displayName
106
+ ) ) ;
107
+ DialogDescription . displayName = DialogPrimitive . Description . displayName ;
108
108
109
109
export {
110
110
Dialog ,
@@ -116,4 +116,4 @@ export {
116
116
DialogFooter ,
117
117
DialogTitle ,
118
118
DialogDescription ,
119
- }
119
+ } ;
0 commit comments