"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const jsxRuntime = require("react/jsx-runtime");
const React = require("react");
const clsx = require("clsx");
const CloseButton = require("../CloseButton/CloseButton.cjs");
const ModalBase_context = require("./ModalBase.context.cjs");
const ModalBase_module_css = require("./ModalBase.module.css.cjs");
const ModalBaseCloseButton = React.forwardRef(
  ({ className, onClick, ...others }, ref) => {
    const ctx = ModalBase_context.useModalBaseContext();
    return /* @__PURE__ */ jsxRuntime.jsx(
      CloseButton.CloseButton,
      {
        ref,
        ...others,
        onClick: (event) => {
          ctx.onClose();
          onClick == null ? void 0 : onClick(event);
        },
        className: clsx({ [ModalBase_module_css.default.close]: !ctx.unstyled }, className),
        unstyled: ctx.unstyled
      }
    );
  }
);
ModalBaseCloseButton.displayName = "@mantine/core/ModalBaseCloseButton";
exports.ModalBaseCloseButton = ModalBaseCloseButton;
