@penaprieto/design-system
Version:
Multi-brand React design system with design tokens from Figma
18 lines (17 loc) • 689 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Icon = void 0;
const jsx_runtime_1 = require("react/jsx-runtime");
/**
* Icon component that uses SVG sprite.
*
* @example
* ```tsx
* <Icon name="alarm" size={24} />
* <Icon name="alert" color="red" />
* ```
*/
const Icon = ({ name, size = 24, color = 'currentColor', className = '', style, ...props }) => {
return ((0, jsx_runtime_1.jsx)("svg", { width: size, height: size, className: className, style: { color, ...style }, "aria-hidden": "true", focusable: "false", ...props, children: (0, jsx_runtime_1.jsx)("use", { href: `#${name}`, xlinkHref: `#${name}` }) }));
};
exports.Icon = Icon;