Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
import { AlertDialog as BaseAlertDialog } from "@base-ui/react/alert-dialog";
import type { ComponentProps } from "react";
import { cn } from "@/lib/utils";
import {
getLayerRoot,
LAYER_BACKDROP_CLASS,
LAYER_SURFACE_CLASS,
usePreserveHigherLayerAccess,
} from "./layer";
const AlertDialog = BaseAlertDialog.Root;
const AlertDialogTrigger = BaseAlertDialog.Trigger;
function AlertDialogOverlay({
className,
ref,
...props
}: ComponentProps<typeof BaseAlertDialog.Backdrop>) {
return (
<BaseAlertDialog.Backdrop
ref={ref}
className={cn(
`fixed inset-0 ${LAYER_BACKDROP_CLASS} bg-overlay/50`,
className
)}
{...props}
/>
);
}
function AlertDialogContent({
className,
children,
ref,
...props
}: ComponentProps<typeof BaseAlertDialog.Popup>) {
usePreserveHigherLayerAccess("overlay");
return (
<BaseAlertDialog.Portal container={getLayerRoot("overlay")}>
<AlertDialogOverlay />
<BaseAlertDialog.Popup
ref={ref}
className={cn(
`fixed left-1/2 top-1/2 ${LAYER_SURFACE_CLASS} -translate-x-1/2 -translate-y-1/2`,
"w-full max-w-md",
"rounded-sm bg-background p-6 shadow-lg",
className
)}
{...props}
>
{children}
</BaseAlertDialog.Popup>
</BaseAlertDialog.Portal>
);
}
function AlertDialogTitle({
className,
ref,
...props
}: ComponentProps<typeof BaseAlertDialog.Title>) {
return (
<BaseAlertDialog.Title
ref={ref}
className={cn("text-lg font-semibold", className)}
{...props}
/>
);
}
function AlertDialogDescription({
className,
ref,
...props
}: ComponentProps<typeof BaseAlertDialog.Description>) {
return (
<BaseAlertDialog.Description
ref={ref}
className={cn("mt-2 text-sm text-control-light", className)}
{...props}
/>
);
}
function AlertDialogFooter({ className, ...props }: ComponentProps<"div">) {
return (
<div
className={cn("mt-4 flex justify-end gap-x-2", className)}
{...props}
/>
);
}
const AlertDialogClose = BaseAlertDialog.Close;
export {
AlertDialog,
AlertDialogClose,
AlertDialogContent,
AlertDialogDescription,
AlertDialogFooter,
AlertDialogOverlay,
AlertDialogTitle,
AlertDialogTrigger,
};