/*
 * Copyright 2026 Palantir Technologies, Inc. All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

import { Error as ErrorIcon, InfoSign, Tick, WarningSign } from "@blueprintjs/icons";
import classNames from "classnames";
import * as React from "react";
import styles from "./Callout.module.css.js";
const DEFAULT_ICONS = {
  error: ErrorIcon,
  warning: WarningSign,
  success: Tick,
  info: InfoSign
};
const INTENT_STYLES = {
  error: styles.error,
  warning: styles.warning,
  success: styles.success,
  info: styles.info
};

/**
 * A styled alert banner supporting four intent levels with an icon,
 * title, message body, and action slot.
 */
export const Callout = /*#__PURE__*/React.memo(function ({
  intent,
  title,
  children,
  actions,
  icon,
  className
}) {
  const IconComponent = icon ?? DEFAULT_ICONS[intent];
  return /*#__PURE__*/React.createElement("div", {
    "aria-live": "polite",
    className: classNames(styles.callout, INTENT_STYLES[intent], className),
    role: "alert"
  }, IconComponent != null && /*#__PURE__*/React.createElement("span", {
    className: styles.icon
  }, /*#__PURE__*/React.createElement(IconComponent, {
    size: 16
  })), /*#__PURE__*/React.createElement("div", {
    className: styles.body
  }, title != null && /*#__PURE__*/React.createElement("div", {
    className: styles.title
  }, title), children != null && /*#__PURE__*/React.createElement("div", {
    className: styles.message
  }, children)), actions != null && /*#__PURE__*/React.createElement("div", {
    className: styles.actions
  }, actions));
});
//# sourceMappingURL=Callout.js.map