'use client' import type { ButtonProps } from '@/app/components/base/button' import { AlertDialog as BaseAlertDialog } from '@base-ui/react/alert-dialog' import * as React from 'react' import Button from '@/app/components/base/button' import { cn } from '@/utils/classnames' // z-index strategy (relies on root `isolation: isolate` in layout.tsx): // All overlay primitives (Tooltip / Popover / Dropdown / Select / Dialog / AlertDialog) — z-50 // Overlays share the same z-index; DOM order handles stacking when multiple are open. // This ensures overlays inside an AlertDialog (e.g. a Tooltip on a dialog button) render // above the dialog backdrop instead of being clipped by it. // Toast — z-[99], always on top (defined in toast component) export const AlertDialog = BaseAlertDialog.Root export const AlertDialogTrigger = BaseAlertDialog.Trigger export const AlertDialogTitle = BaseAlertDialog.Title export const AlertDialogDescription = BaseAlertDialog.Description export const AlertDialogClose = BaseAlertDialog.Close type AlertDialogContentProps = { children: React.ReactNode className?: string overlayClassName?: string popupProps?: Omit, 'children' | 'className'> backdropProps?: Omit, 'className'> } export function AlertDialogContent({ children, className, overlayClassName, popupProps, backdropProps, }: AlertDialogContentProps) { return ( {children} ) } type AlertDialogActionsProps = React.ComponentPropsWithoutRef<'div'> export function AlertDialogActions({ className, ...props }: AlertDialogActionsProps) { return (
) } type AlertDialogCancelButtonProps = Omit & { children: React.ReactNode closeProps?: Omit, 'children' | 'render'> } export function AlertDialogCancelButton({ children, closeProps, ...buttonProps }: AlertDialogCancelButtonProps) { return ( } > {children} ) } type AlertDialogConfirmButtonProps = ButtonProps export function AlertDialogConfirmButton({ variant = 'primary', destructive = true, ...props }: AlertDialogConfirmButtonProps) { return (