@greatapps/common 1.1.20 → 1.1.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -43,10 +43,11 @@ function DialogContent({
|
|
|
43
43
|
className,
|
|
44
44
|
children,
|
|
45
45
|
showCloseButton = true,
|
|
46
|
+
overlayClassName,
|
|
46
47
|
...props
|
|
47
48
|
}) {
|
|
48
49
|
return /* @__PURE__ */ jsxs(DialogPortal, { "data-slot": "dialog-portal", children: [
|
|
49
|
-
/* @__PURE__ */ jsx(DialogOverlay, {}),
|
|
50
|
+
/* @__PURE__ */ jsx(DialogOverlay, { className: overlayClassName }),
|
|
50
51
|
/* @__PURE__ */ jsxs(
|
|
51
52
|
DialogPrimitive.Content,
|
|
52
53
|
{
|
|
@@ -79,7 +80,10 @@ function DialogHeader({ className, ...props }) {
|
|
|
79
80
|
"div",
|
|
80
81
|
{
|
|
81
82
|
"data-slot": "dialog-header",
|
|
82
|
-
className: cn(
|
|
83
|
+
className: cn(
|
|
84
|
+
"p-5 flex flex-col gap-2 text-center sm:text-left",
|
|
85
|
+
className
|
|
86
|
+
),
|
|
83
87
|
...props
|
|
84
88
|
}
|
|
85
89
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/ui/overlay/Dialog.tsx"],"sourcesContent":["\"use client\"
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/ui/overlay/Dialog.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport * as DialogPrimitive from \"@radix-ui/react-dialog\";\nimport { XIcon } from \"lucide-react\";\nimport { cn } from \"../../../infra/utils/clsx\";\n\nfunction Dialog({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Root>) {\n return <DialogPrimitive.Root data-slot=\"dialog\" {...props} />;\n}\n\nfunction DialogTrigger({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Trigger>) {\n return <DialogPrimitive.Trigger data-slot=\"dialog-trigger\" {...props} />;\n}\n\nfunction DialogPortal({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Portal>) {\n return <DialogPrimitive.Portal data-slot=\"dialog-portal\" {...props} />;\n}\n\nfunction DialogClose({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Close>) {\n return <DialogPrimitive.Close data-slot=\"dialog-close\" {...props} />;\n}\n\nfunction DialogOverlay({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Overlay>) {\n return (\n <DialogPrimitive.Overlay\n data-slot=\"dialog-overlay\"\n className={cn(\n \"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-[1000] bg-black/50\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction DialogContent({\n className,\n children,\n showCloseButton = true,\n overlayClassName,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Content> & {\n showCloseButton?: boolean;\n overlayClassName?: string;\n}) {\n return (\n <DialogPortal data-slot=\"dialog-portal\">\n <DialogOverlay className={overlayClassName} />\n <DialogPrimitive.Content\n data-slot=\"dialog-content\"\n className={cn(\n \"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-[1000] 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\",\n className,\n )}\n {...props}\n >\n {children}\n {showCloseButton && (\n <div className=\"absolute top-0.5 right-0\">\n <div className=\"p-4\">\n <DialogPrimitive.Close\n data-slot=\"dialog-close\"\n className=\"hover:cursor-pointer flex size-8 items-center justify-center rounded-lg p-2 text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-950 focus:outline-none\"\n >\n <XIcon className=\"size-[18px]\" />\n <span className=\"sr-only\">Close</span>\n </DialogPrimitive.Close>\n </div>\n </div>\n )}\n </DialogPrimitive.Content>\n </DialogPortal>\n );\n}\n\nfunction DialogHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"dialog-header\"\n className={cn(\n \"p-5 flex flex-col gap-2 text-center sm:text-left\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction DialogFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"dialog-footer\"\n className={cn(\n \"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction DialogTitle({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Title>) {\n return (\n <DialogPrimitive.Title\n data-slot=\"dialog-title\"\n className={cn(\"text-lg leading-none font-semibold\", className)}\n {...props}\n />\n );\n}\n\nfunction DialogDescription({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Description>) {\n return (\n <DialogPrimitive.Description\n data-slot=\"dialog-description\"\n className={cn(\"text-muted-foreground text-sm\", className)}\n {...props}\n />\n );\n}\n\nexport {\n Dialog,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogOverlay,\n DialogPortal,\n DialogTitle,\n DialogTrigger,\n};\n"],"mappings":";AAUS,cA8DK,YA9DL;AAPT,YAAY,qBAAqB;AACjC,SAAS,aAAa;AACtB,SAAS,UAAU;AAEnB,SAAS,OAAO;AAAA,EACd,GAAG;AACL,GAAsD;AACpD,SAAO,oBAAC,gBAAgB,MAAhB,EAAqB,aAAU,UAAU,GAAG,OAAO;AAC7D;AAEA,SAAS,cAAc;AAAA,EACrB,GAAG;AACL,GAAyD;AACvD,SAAO,oBAAC,gBAAgB,SAAhB,EAAwB,aAAU,kBAAkB,GAAG,OAAO;AACxE;AAEA,SAAS,aAAa;AAAA,EACpB,GAAG;AACL,GAAwD;AACtD,SAAO,oBAAC,gBAAgB,QAAhB,EAAuB,aAAU,iBAAiB,GAAG,OAAO;AACtE;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AAU;AAAA,MACV,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA;AAAA,EACN;AAEJ;AAEA,SAAS,YAAY;AAAA,EACnB;AAAA,EACA,GAAG;AACL,GAAuD;AACrD,SACE;AAAA,IAAC,gBAAgB;AAAA,IAAhB;AAAA,MACC,aAAU;AAAA,MACV,WAAW,GAAG,sCAAsC,SAAS;AAAA,MAC5D,GAAG;AAAA;AAAA,EACN;AAEJ;AAEA,SAAS,kBAAkB;AAAA,EACzB;AAAA,EACA,GAAG;AACL,GAA6D;AAC3D,SACE;AAAA,IAAC,gBAAgB;AAAA,IAAhB;AAAA,MACC,aAAU;AAAA,MACV,WAAW,GAAG,iCAAiC,SAAS;AAAA,MACvD,GAAG;AAAA;AAAA,EACN;AAEJ;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
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 { XIcon } from "lucide-react"
|
|
6
|
-
import { cn } from "../../../infra/utils/clsx"
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
5
|
+
import { XIcon } from "lucide-react";
|
|
6
|
+
import { cn } from "../../../infra/utils/clsx";
|
|
7
7
|
|
|
8
8
|
function Dialog({
|
|
9
9
|
...props
|
|
10
10
|
}: React.ComponentProps<typeof DialogPrimitive.Root>) {
|
|
11
|
-
return <DialogPrimitive.Root data-slot="dialog" {...props}
|
|
11
|
+
return <DialogPrimitive.Root data-slot="dialog" {...props} />;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
function DialogTrigger({
|
|
15
15
|
...props
|
|
16
16
|
}: React.ComponentProps<typeof DialogPrimitive.Trigger>) {
|
|
17
|
-
return <DialogPrimitive.Trigger data-slot="dialog-trigger" {...props}
|
|
17
|
+
return <DialogPrimitive.Trigger data-slot="dialog-trigger" {...props} />;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
function DialogPortal({
|
|
21
21
|
...props
|
|
22
22
|
}: React.ComponentProps<typeof DialogPrimitive.Portal>) {
|
|
23
|
-
return <DialogPrimitive.Portal data-slot="dialog-portal" {...props}
|
|
23
|
+
return <DialogPrimitive.Portal data-slot="dialog-portal" {...props} />;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
function DialogClose({
|
|
27
27
|
...props
|
|
28
28
|
}: React.ComponentProps<typeof DialogPrimitive.Close>) {
|
|
29
|
-
return <DialogPrimitive.Close data-slot="dialog-close" {...props}
|
|
29
|
+
return <DialogPrimitive.Close data-slot="dialog-close" {...props} />;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
function DialogOverlay({
|
|
@@ -38,29 +38,31 @@ function DialogOverlay({
|
|
|
38
38
|
data-slot="dialog-overlay"
|
|
39
39
|
className={cn(
|
|
40
40
|
"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-[1000] bg-black/50",
|
|
41
|
-
className
|
|
41
|
+
className,
|
|
42
42
|
)}
|
|
43
43
|
{...props}
|
|
44
44
|
/>
|
|
45
|
-
)
|
|
45
|
+
);
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
function DialogContent({
|
|
49
49
|
className,
|
|
50
50
|
children,
|
|
51
51
|
showCloseButton = true,
|
|
52
|
+
overlayClassName,
|
|
52
53
|
...props
|
|
53
54
|
}: React.ComponentProps<typeof DialogPrimitive.Content> & {
|
|
54
|
-
showCloseButton?: boolean
|
|
55
|
+
showCloseButton?: boolean;
|
|
56
|
+
overlayClassName?: string;
|
|
55
57
|
}) {
|
|
56
58
|
return (
|
|
57
59
|
<DialogPortal data-slot="dialog-portal">
|
|
58
|
-
<DialogOverlay />
|
|
60
|
+
<DialogOverlay className={overlayClassName} />
|
|
59
61
|
<DialogPrimitive.Content
|
|
60
62
|
data-slot="dialog-content"
|
|
61
63
|
className={cn(
|
|
62
64
|
"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-[1000] 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",
|
|
63
|
-
className
|
|
65
|
+
className,
|
|
64
66
|
)}
|
|
65
67
|
{...props}
|
|
66
68
|
>
|
|
@@ -80,17 +82,20 @@ function DialogContent({
|
|
|
80
82
|
)}
|
|
81
83
|
</DialogPrimitive.Content>
|
|
82
84
|
</DialogPortal>
|
|
83
|
-
)
|
|
85
|
+
);
|
|
84
86
|
}
|
|
85
87
|
|
|
86
88
|
function DialogHeader({ className, ...props }: React.ComponentProps<"div">) {
|
|
87
89
|
return (
|
|
88
90
|
<div
|
|
89
91
|
data-slot="dialog-header"
|
|
90
|
-
className={cn(
|
|
92
|
+
className={cn(
|
|
93
|
+
"p-5 flex flex-col gap-2 text-center sm:text-left",
|
|
94
|
+
className,
|
|
95
|
+
)}
|
|
91
96
|
{...props}
|
|
92
97
|
/>
|
|
93
|
-
)
|
|
98
|
+
);
|
|
94
99
|
}
|
|
95
100
|
|
|
96
101
|
function DialogFooter({ className, ...props }: React.ComponentProps<"div">) {
|
|
@@ -99,11 +104,11 @@ function DialogFooter({ className, ...props }: React.ComponentProps<"div">) {
|
|
|
99
104
|
data-slot="dialog-footer"
|
|
100
105
|
className={cn(
|
|
101
106
|
"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",
|
|
102
|
-
className
|
|
107
|
+
className,
|
|
103
108
|
)}
|
|
104
109
|
{...props}
|
|
105
110
|
/>
|
|
106
|
-
)
|
|
111
|
+
);
|
|
107
112
|
}
|
|
108
113
|
|
|
109
114
|
function DialogTitle({
|
|
@@ -116,7 +121,7 @@ function DialogTitle({
|
|
|
116
121
|
className={cn("text-lg leading-none font-semibold", className)}
|
|
117
122
|
{...props}
|
|
118
123
|
/>
|
|
119
|
-
)
|
|
124
|
+
);
|
|
120
125
|
}
|
|
121
126
|
|
|
122
127
|
function DialogDescription({
|
|
@@ -129,7 +134,7 @@ function DialogDescription({
|
|
|
129
134
|
className={cn("text-muted-foreground text-sm", className)}
|
|
130
135
|
{...props}
|
|
131
136
|
/>
|
|
132
|
-
)
|
|
137
|
+
);
|
|
133
138
|
}
|
|
134
139
|
|
|
135
140
|
export {
|
|
@@ -143,4 +148,4 @@ export {
|
|
|
143
148
|
DialogPortal,
|
|
144
149
|
DialogTitle,
|
|
145
150
|
DialogTrigger,
|
|
146
|
-
}
|
|
151
|
+
};
|