"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)
            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 });
/* eslint-disable no-shadow */
const react_1 = __importDefault(require("react"));
const styled_system_1 = require("styled-system");
const Box_1 = require("../../components/Box");
const styles_1 = require("../../styles");
const IconComponent = (_a) => {
    var { Asset, color, width, height, scale, rotate, bg, // Filter out prop coming from IconCircled component
    className, ariaLabel } = _a, props = __rest(_a, ["Asset", "color", "width", "height", "scale", "rotate", "bg", "className", "ariaLabel"]);
    return (react_1.default.createElement(Box_1.Box, Object.assign({ as: "span", className: className }, props),
        react_1.default.createElement(Asset, { role: "img", "aria-label": ariaLabel })));
};
exports.Icon = styles_1.styled(IconComponent)(styled_system_1.color, styled_system_1.width, styled_system_1.height, ({ scale, rotate }) => ({
    display: 'inline-block',
    verticalAlign: 'middle',
    svg: Object.assign({ display: 'block', width: '100%', height: '100%' }, (scale && { padding: `${(1 - scale) * 100}%` }), (rotate && { transform: `rotateZ(${rotate})` }))
}));
exports.Icon.defaultProps = {
    width: '1em',
    height: '1em'
};
//# sourceMappingURL=Icon.js.map