import { Dialog as DialogPrimitive } from "@base-ui/react/dialog";
import { Button } from "@/components/ui/pxl/button";
import { cn } from "@/lib/utils";
function Dialog({ ...props }: DialogPrimitive.Root.Props) {
return <DialogPrimitive.Root data-slot="dialog" {...props} />;
function DialogTrigger({ ...props }: DialogPrimitive.Trigger.Props) {
return <DialogPrimitive.Trigger data-slot="dialog-trigger" {...props} />;
function DialogPortal({ ...props }: DialogPrimitive.Portal.Props) {
return <DialogPrimitive.Portal data-slot="dialog-portal" {...props} />;
function DialogClose({ ...props }: DialogPrimitive.Close.Props) {
return <DialogPrimitive.Close data-slot="dialog-close" {...props} />;
}: DialogPrimitive.Backdrop.Props) {
<DialogPrimitive.Backdrop
data-slot="dialog-overlay"
"fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",
}: DialogPrimitive.Popup.Props & {
showCloseButton?: boolean;
data-slot="dialog-content"
"fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-6 pixel-rounded pixel-border pixel-size-[5px] pixel-color-border bg-popover p-6 text-sm text-popover-foreground duration-100 outline-none sm:max-w-md data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
className="absolute top-4 right-4"
xmlns="http://www.w3.org/2000/svg"
<path d="M7 19H5v-2h2v2Zm12 0h-2v-2h2v2ZM9 15v2H7v-2h2Zm8 2h-2v-2h2v2Zm-6-2H9v-2h2v2Zm4 0h-2v-2h2v2Zm-2-2h-2v-2h2v2Zm-2-2H9V9h2v2Zm4 0h-2V9h2v2ZM9 9H7V7h2v2Zm8 0h-2V7h2v2ZM7 7H5V5h2v2Zm12 0h-2V5h2v2Z" />
<span className="sr-only">Close</span>
function DialogHeader({ className, ...props }: React.ComponentProps<"div">) {
data-slot="dialog-header"
className={cn("flex flex-col gap-2", className)}
}: React.ComponentProps<"div"> & {
showCloseButton?: boolean;
data-slot="dialog-footer"
"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",
<DialogPrimitive.Close render={<Button variant="outline" />}>
function DialogTitle({ className, ...props }: DialogPrimitive.Title.Props) {
className={cn("font-heading leading-none [&_svg:not([class*='size-'])]:size-4 [&>svg]:inline-block [&>svg]:mr-1", className)}
function DialogDescription({
}: DialogPrimitive.Description.Props) {
<DialogPrimitive.Description
data-slot="dialog-description"
"text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",