"use strict";
var __rest = (this && this.__rest) || function (s, e) {
    var t = {};
    for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
        t[p] = s[p];
    if (s != null && typeof Object.getOwnPropertySymbols === "function")
        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
            if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
                t[p[i]] = s[p[i]];
        }
    return t;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.Icon = void 0;
const jsx_runtime_1 = require("react/jsx-runtime");
const styled_components_1 = __importDefault(require("styled-components"));
const utils_1 = require("../../theme/utils");
const Component = styled_components_1.default.span(({ variant, margin, size, bg, scale, rotate, color, theme }) => (Object.assign(Object.assign(Object.assign(Object.assign({}, (theme.ICON[variant] || {})), { display: 'inline-block', margin: (0, utils_1.getMargin)({ theme, margin }), padding: 0, width: size, height: size }), (bg && theme.COLOR[bg] ? { backgroundColor: theme.COLOR[bg] } : {})), { svg: Object.assign(Object.assign({ display: 'block', width: '100%', height: '100%' }, (scale ? { padding: `${(1 - scale) * 100}%` } : {})), (rotate ? { transform: `rotateZ(${rotate})` } : {})), 'svg > *': Object.assign(Object.assign({}, theme.ICON[variant]['svg > *']), (color || theme.ICON[variant].fill
        ? {
            fill: color ? theme.COLOR[color] : theme.ICON[variant].fill,
        }
        : {})) })));
const Icon = (_a) => {
    var { variant, icon: SvgIcon, scale = variant === 'circle' ? 0.75 : undefined } = _a, props = __rest(_a, ["variant", "icon", "scale"]);
    return ((0, jsx_runtime_1.jsx)(Component, Object.assign({ variant: variant, scale: scale }, props, { children: (0, jsx_runtime_1.jsx)(SvgIcon, {}, void 0) }), void 0));
};
exports.Icon = Icon;
//# sourceMappingURL=Icon.js.map