quantumai-design-system
Version:
퀀텀에이아이의 디자인 시스템
50 lines (49 loc) • 2.7 kB
JavaScript
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
return cooked;
};
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
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;
};
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
import { forwardRef } from 'react';
import { ICONS_PATH } from './IconsPath';
import styled from '@emotion/styled';
import { mixinMargin } from '../../../utils/styleSet';
import HugeIcons from './HugeIcons';
var Icons = forwardRef(function (_a, ref) {
var _b, _c;
var name = _a.name, fill = _a.fill, size = _a.size, width = _a.width, height = _a.height, props = __rest(_a, ["name", "fill", "size", "width", "height"]);
if (!Object.keys(ICONS_PATH).includes(name)) {
console.error("".concat(name, "\uC544\uC774\uCF58\uC774 \uC874\uC7AC\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4."));
return;
}
return (_jsx(SvgContainer, __assign({ width: (_b = size !== null && size !== void 0 ? size : width) !== null && _b !== void 0 ? _b : ICONS_PATH[name].width, height: (_c = size !== null && size !== void 0 ? size : height) !== null && _c !== void 0 ? _c : ICONS_PATH[name].height, viewBox: ['0', '0', ICONS_PATH[name].width, ICONS_PATH[name].height].join(' '), fill: fill !== null && fill !== void 0 ? fill : 'current', ref: ref }, props, { children: ICONS_PATH[name].icon })));
});
export default Object.assign(Icons, {
Huge: HugeIcons,
});
var SvgContainer = styled.svg(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n transform: ", ";\n ", "\n"], ["\n transform: ", ";\n ", "\n"])), function (_a) {
var rotate = _a.rotate;
return "rotate(".concat(rotate !== null && rotate !== void 0 ? rotate : 0, "deg)");
}, function (props) { return mixinMargin(props); });
var templateObject_1;