import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { useIntl } from "react-intl";
import { commonDialogMessages } from "../../locales.js";
import { bem } from "../@utils/bem.js";
import { UiButton } from "../UiButton/UiButton.js";
import { UiDialogBody } from "../UiModalDialog/UiDialogBody.js";
import { UiDialogFooter } from "../UiModalDialog/UiDialogFooter.js";
import { UiDialogHeader } from "../UiModalDialog/UiDialogHeader.js";
const { b } = bem("gd-ui-kit-confirm-dialog");
/**
 * Confirm dialog composition — header, description body, footer with Cancel
 * and Confirm buttons. Designed to be rendered inside `UiModalDialog`, which
 * provides the modal chrome (portal, backdrop, card surface, focus trap,
 * dismiss). `UiConfirmDialog` wraps this composition in `UiModalDialog`
 * with the right width and exposes the combined surface to callers.
 *
 * @internal
 */
export function UiConfirmDialogCard({ title, description, confirmLabel, confirmVariant = "primary", onClose, onCancel, onConfirm, dataTestId, }) {
    const intl = useIntl();
    return (_jsxs("div", { className: b(), "data-testid": dataTestId, children: [
            _jsx(UiDialogHeader, { title: title, onClose: onClose }), _jsx(UiDialogBody, { children: description }), _jsxs(UiDialogFooter, { children: [
                    _jsx(UiButton, { label: intl.formatMessage(commonDialogMessages.cancel), variant: "secondary", size: "medium", onClick: onCancel, autoFocus: true }), _jsx(UiButton, { label: confirmLabel, variant: confirmVariant, size: "medium", onClick: onConfirm })
                ] })
        ] }));
}
