@appolabs/ui 0.1.6 → 0.1.8

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.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
- declare const DialogContent: React$1.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogContentProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
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
- declare const DialogContent: React$1.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogContentProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
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
@@ -3,7 +3,7 @@ import { twMerge } from 'tailwind-merge';
3
3
  import * as React39 from 'react';
4
4
  import React39__default from 'react';
5
5
  import * as AccordionPrimitive from '@radix-ui/react-accordion';
6
- import { ChevronDown, ArrowLeft, ArrowRight, Check, X, Search, ChevronRight, Circle, Dot, ChevronUp, PanelLeft, MoreHorizontal, ChevronLeft, GripVertical } from 'lucide-react';
6
+ import { ChevronDown, ArrowLeft, ArrowRight, Check, Search, ChevronRight, Circle, Dot, ChevronUp, PanelLeft, X, MoreHorizontal, ChevronLeft, GripVertical } from 'lucide-react';
7
7
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
8
8
  import { cva } from 'class-variance-authority';
9
9
  import * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';
@@ -1186,33 +1186,33 @@ 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) => /* @__PURE__ */ jsxs(DialogPortal, { children: [
1190
- /* @__PURE__ */ jsx(DialogOverlay, {}),
1191
- /* @__PURE__ */ jsxs(
1192
- DialogPrimitive.Content,
1193
- {
1194
- ref,
1195
- className: cn(
1196
- "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",
1197
- className
1198
- ),
1199
- ...props,
1200
- children: [
1201
- children,
1202
- /* @__PURE__ */ jsxs(
1203
- DialogPrimitive.Close,
1204
- {
1205
- 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",
1206
- children: [
1207
- /* @__PURE__ */ jsx(X, { className: "h-4 w-4" }),
1208
- /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
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__ */ jsx(
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
+ }
1213
+ )
1214
+ ] });
1215
+ });
1216
1216
  DialogContent.displayName = DialogPrimitive.Content.displayName;
1217
1217
  var DialogHeader = ({
1218
1218
  className,
@@ -2815,25 +2815,13 @@ var sheetVariants = cva(
2815
2815
  );
2816
2816
  var SheetContent = React39.forwardRef(({ side = "right", className, children, ...props }, ref) => /* @__PURE__ */ jsxs(SheetPortal, { children: [
2817
2817
  /* @__PURE__ */ jsx(SheetOverlay, {}),
2818
- /* @__PURE__ */ jsxs(
2818
+ /* @__PURE__ */ jsx(
2819
2819
  DialogPrimitive.Content,
2820
2820
  {
2821
2821
  ref,
2822
2822
  className: cn(sheetVariants({ side }), className),
2823
2823
  ...props,
2824
- children: [
2825
- children,
2826
- /* @__PURE__ */ jsxs(
2827
- DialogPrimitive.Close,
2828
- {
2829
- 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-secondary",
2830
- children: [
2831
- /* @__PURE__ */ jsx(X, { className: "h-4 w-4" }),
2832
- /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
2833
- ]
2834
- }
2835
- )
2836
- ]
2824
+ children
2837
2825
  }
2838
2826
  )
2839
2827
  ] }));