@appolabs/ui 0.1.6 → 0.1.7
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.
- package/dist/index.cjs +33 -27
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.js +33 -27
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -368,7 +368,10 @@ declare const DialogTrigger: React$1.ForwardRefExoticComponent<DialogPrimitive.D
|
|
|
368
368
|
declare const DialogPortal: React$1.FC<DialogPrimitive.DialogPortalProps>;
|
|
369
369
|
declare const DialogClose: React$1.ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
370
370
|
declare const DialogOverlay: React$1.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogOverlayProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
371
|
-
|
|
371
|
+
interface DialogContentProps extends React$1.ComponentPropsWithoutRef<typeof DialogPrimitive.Content> {
|
|
372
|
+
onCloseComplete?: () => void;
|
|
373
|
+
}
|
|
374
|
+
declare const DialogContent: React$1.ForwardRefExoticComponent<DialogContentProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
372
375
|
declare const DialogHeader: {
|
|
373
376
|
({ className, ...props }: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
|
|
374
377
|
displayName: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -368,7 +368,10 @@ declare const DialogTrigger: React$1.ForwardRefExoticComponent<DialogPrimitive.D
|
|
|
368
368
|
declare const DialogPortal: React$1.FC<DialogPrimitive.DialogPortalProps>;
|
|
369
369
|
declare const DialogClose: React$1.ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
370
370
|
declare const DialogOverlay: React$1.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogOverlayProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
371
|
-
|
|
371
|
+
interface DialogContentProps extends React$1.ComponentPropsWithoutRef<typeof DialogPrimitive.Content> {
|
|
372
|
+
onCloseComplete?: () => void;
|
|
373
|
+
}
|
|
374
|
+
declare const DialogContent: React$1.ForwardRefExoticComponent<DialogContentProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
372
375
|
declare const DialogHeader: {
|
|
373
376
|
({ className, ...props }: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
|
|
374
377
|
displayName: string;
|
package/dist/index.js
CHANGED
|
@@ -1186,33 +1186,39 @@ var DialogOverlay = React39.forwardRef(({ className, ...props }, ref) => /* @__P
|
|
|
1186
1186
|
}
|
|
1187
1187
|
));
|
|
1188
1188
|
DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
|
|
1189
|
-
var DialogContent = React39.forwardRef(({ className, children, ...props }, ref) =>
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1189
|
+
var DialogContent = React39.forwardRef(({ className, children, onCloseComplete, onAnimationEnd, ...props }, ref) => {
|
|
1190
|
+
const handleAnimationEnd = React39.useCallback(
|
|
1191
|
+
(e) => {
|
|
1192
|
+
onAnimationEnd?.(e);
|
|
1193
|
+
if (e.currentTarget.getAttribute("data-state") === "closed") {
|
|
1194
|
+
onCloseComplete?.();
|
|
1195
|
+
}
|
|
1196
|
+
},
|
|
1197
|
+
[onAnimationEnd, onCloseComplete]
|
|
1198
|
+
);
|
|
1199
|
+
return /* @__PURE__ */ jsxs(DialogPortal, { children: [
|
|
1200
|
+
/* @__PURE__ */ jsx(DialogOverlay, {}),
|
|
1201
|
+
/* @__PURE__ */ jsxs(
|
|
1202
|
+
DialogPrimitive.Content,
|
|
1203
|
+
{
|
|
1204
|
+
ref,
|
|
1205
|
+
className: cn(
|
|
1206
|
+
"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",
|
|
1207
|
+
className
|
|
1208
|
+
),
|
|
1209
|
+
onAnimationEnd: handleAnimationEnd,
|
|
1210
|
+
...props,
|
|
1211
|
+
children: [
|
|
1212
|
+
children,
|
|
1213
|
+
/* @__PURE__ */ jsxs(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", children: [
|
|
1214
|
+
/* @__PURE__ */ jsx(X, { className: "h-4 w-4" }),
|
|
1215
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
|
|
1216
|
+
] })
|
|
1217
|
+
]
|
|
1218
|
+
}
|
|
1219
|
+
)
|
|
1220
|
+
] });
|
|
1221
|
+
});
|
|
1216
1222
|
DialogContent.displayName = DialogPrimitive.Content.displayName;
|
|
1217
1223
|
var DialogHeader = ({
|
|
1218
1224
|
className,
|