@pixpilot/shadcn 1.0.0 → 1.1.0
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.
|
@@ -23,9 +23,14 @@ declare function DialogContent({
|
|
|
23
23
|
className,
|
|
24
24
|
children,
|
|
25
25
|
showCloseButton,
|
|
26
|
+
disableOutsideClick,
|
|
27
|
+
container,
|
|
28
|
+
onPointerDownOutside,
|
|
26
29
|
...props
|
|
27
30
|
}: React.ComponentProps<typeof DialogPrimitive.Content> & {
|
|
28
31
|
showCloseButton?: boolean;
|
|
32
|
+
disableOutsideClick?: boolean;
|
|
33
|
+
container?: HTMLElement | null;
|
|
29
34
|
}): react_jsx_runtime60.JSX.Element;
|
|
30
35
|
declare function DialogHeader({
|
|
31
36
|
className,
|
|
@@ -36,12 +36,21 @@ function DialogOverlay({ className,...props }) {
|
|
|
36
36
|
...props
|
|
37
37
|
});
|
|
38
38
|
}
|
|
39
|
-
function DialogContent({ className, children, showCloseButton = true,...props }) {
|
|
39
|
+
function DialogContent({ className, children, showCloseButton = true, disableOutsideClick = false, container, onPointerDownOutside,...props }) {
|
|
40
40
|
return /* @__PURE__ */ jsxs(DialogPortal, {
|
|
41
|
+
container: container ?? void 0,
|
|
41
42
|
"data-slot": "dialog-portal",
|
|
42
|
-
children: [/* @__PURE__ */ jsx(DialogOverlay, {}), /* @__PURE__ */ jsxs(DialogPrimitive.Content, {
|
|
43
|
+
children: [/* @__PURE__ */ jsx(DialogOverlay, { className: container ? "absolute" : void 0 }), /* @__PURE__ */ jsxs(DialogPrimitive.Content, {
|
|
43
44
|
"data-slot": "dialog-content",
|
|
44
|
-
|
|
45
|
+
onPointerDownOutside: (event) => {
|
|
46
|
+
onPointerDownOutside?.(event);
|
|
47
|
+
if (disableOutsideClick) {
|
|
48
|
+
event.preventDefault();
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
if (container && !container.contains(event.target)) event.preventDefault();
|
|
52
|
+
},
|
|
53
|
+
className: cn("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", container && "absolute", className),
|
|
45
54
|
...props,
|
|
46
55
|
children: [children, showCloseButton && /* @__PURE__ */ jsxs(DialogPrimitive.Close, {
|
|
47
56
|
"data-slot": "dialog-close",
|
package/package.json
CHANGED