Skip to content

Rallly is an open-source scheduling and collaboration tool designed to make organizing events and meetings easier.

💄 Update dialog style (#1951)

Luke Vella7b8d9e0aef86
diff --git a/packages/ui/src/dialog.tsx b/packages/ui/src/dialog.tsx
index 29136d6c6..7dd2b0426 100644
--- a/packages/ui/src/dialog.tsx
+++ b/packages/ui/src/dialog.tsx
@@ -20,7 +20,7 @@ const DialogClose = DialogPrimitive.Close;
const DialogPortal = DialogPrimitive.Portal;
const DialogOverlay = React.forwardRef<
- React.ElementRef<typeof DialogPrimitive.Overlay>,
+ React.ComponentRef<typeof DialogPrimitive.Overlay>,
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>
>(({ className, ...props }, ref) => (
<DialogPrimitive.Overlay
@@ -39,7 +39,7 @@ const dialogContentVariants = cva(
//style
"gap-4 rounded-xl bg-background p-4 shadow-lg",
// position
- "-translate-x-1/2 -translate-y-1/2 fixed top-1/2 left-1/2 z-50 grid w-full",
+ "-translate-x-1/2 sm:-translate-y-1/2 fixed top-4 left-1/2 z-50 grid w-full sm:top-1/2",
// animation
"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=open]:slide-in-from-left-1/2 data-[state=closed]:slide-out-to-left-1/2 duration-200 data-[state=closed]:animate-out data-[state=open]:animate-in",
),
@@ -70,7 +70,7 @@ const dialogContentVariants = cva(
);
const DialogContent = React.forwardRef<
- React.ElementRef<typeof DialogPrimitive.Content>,
+ React.ComponentRef<typeof DialogPrimitive.Content>,
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content> & {
hideCloseButton?: boolean;
} & VariantProps<typeof dialogContentVariants>
@@ -83,7 +83,11 @@ const DialogContent = React.forwardRef<
<DialogOverlay />
<DialogPrimitive.Content
ref={ref}
- className={cn("", dialogContentVariants({ position, size }), className)}
+ className={cn(
+ "max-w-[calc(100%-2rem)]",
+ dialogContentVariants({ position, size }),
+ className,
+ )}
{...props}
>
{children}
@@ -137,7 +141,7 @@ const DialogFooter = ({
DialogFooter.displayName = "DialogFooter";
const DialogTitle = React.forwardRef<
- React.ElementRef<typeof DialogPrimitive.Title>,
+ React.ComponentRef<typeof DialogPrimitive.Title>,
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>
>(({ className, ...props }, ref) => (
<DialogPrimitive.Title
@@ -152,7 +156,7 @@ const DialogTitle = React.forwardRef<
DialogTitle.displayName = DialogPrimitive.Title.displayName;
const DialogDescription = React.forwardRef<
- React.ElementRef<typeof DialogPrimitive.Description>,
+ React.ComponentRef<typeof DialogPrimitive.Description>,
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>
>(({ className, ...props }, ref) => (
<DialogPrimitive.Description