import { jsx as _jsx } from "react/jsx-runtime";
import { Icon } from '@gravity-ui/uikit';
import { cnIconRefuge } from "./IconRefuge.classname.js";
import "./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
 */
export const IconRefuge = ({ refugeSize, containerClassName, containerStyle, widthOnly, inlineIcon, title, 'aria-label': ariaLabel, ...props }) => {
    if (props.size === refugeSize && !title && !ariaLabel && !containerStyle) {
        return _jsx(Icon, { ...props });
    }
    return (_jsx("div", { className: cnIconRefuge({ inline: inlineIcon }, containerClassName), title: title, "aria-label": ariaLabel, style: {
            minWidth: refugeSize,
            minHeight: widthOnly ? undefined : refugeSize,
            ...containerStyle,
        }, children: _jsx(Icon, { size: refugeSize, ...props }) }));
};
IconRefuge.displayName = 'Icon';
//# sourceMappingURL=IconRefuge.js.map
