UNPKG

@nature-ui/icon

Version:

A base React component for icons

31 lines (28 loc) 717 B
import { Icon, __DEV__ } from "./chunk-GEET4KVI.mjs"; // src/create-icon.tsx import React from "react"; import { jsx } from "react/jsx-runtime"; var createIcon = (options) => { const { viewBox = "0 0 24 24", d: pathDefinition, displayName, defaultProps = {} } = options; const path = React.Children.toArray(options.path); const Comp = React.forwardRef( (props, ref) => { return /* @__PURE__ */ jsx(Icon, { as: "svg", ref, ...defaultProps, viewBox, ...props, children: path.length ? path : /* @__PURE__ */ jsx("path", { d: pathDefinition, fill: "currentColor" }) }); } ); if (__DEV__) { Comp.displayName = displayName; } return Comp; }; export { createIcon };