"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.IconRefuge = void 0;
const jsx_runtime_1 = require("react/jsx-runtime");
const uikit_1 = require("@gravity-ui/uikit");
const IconRefuge_classname_1 = require("./IconRefuge.classname.js");
require("./IconRefuge.css");
/**
 * Creates a div wrapper above the icon, which sets the min-width and min-height
 * equal to its refugeSize prop, puts the original icon in the middle and
 * proxies the rest of the propses to it.
 *
 * The component is made in order to add margins to icons that have
 * margins are indented, but their svg exactly wrap around the edges of the image
 *
 * It seems that all icons will be square, if not, then you can simply add
 * refugeWidth and refugeHeight
 */
const IconRefuge = ({ refugeSize, containerClassName, containerStyle, widthOnly, inlineIcon, title, 'aria-label': ariaLabel, ...props }) => {
    if (props.size === refugeSize && !title && !ariaLabel && !containerStyle) {
        return (0, jsx_runtime_1.jsx)(uikit_1.Icon, { ...props });
    }
    return ((0, jsx_runtime_1.jsx)("div", { className: (0, IconRefuge_classname_1.cnIconRefuge)({ inline: inlineIcon }, containerClassName), title: title, "aria-label": ariaLabel, style: {
            minWidth: refugeSize,
            minHeight: widthOnly ? undefined : refugeSize,
            ...containerStyle,
        }, children: (0, jsx_runtime_1.jsx)(uikit_1.Icon, { size: refugeSize, ...props }) }));
};
exports.IconRefuge = IconRefuge;
exports.IconRefuge.displayName = 'Icon';
//# sourceMappingURL=IconRefuge.js.map
