@intility/bifrost-react
Version:
React library for Intility's design system, Bifrost.
25 lines (24 loc) • 980 B
JavaScript
import { jsx as _jsx } from "react/jsx-runtime";
import { forwardRef } from "react";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import classNames from "classnames";
import IconSpinner from "./Icon.Spinner";
import IconStep from "./Icon.Step";
/**
* Font awesome icon wrapper
*/ const Icon = /*#__PURE__*/ forwardRef(({ marginLeft, marginRight, className, ...props }, ref)=>/*#__PURE__*/ _jsx(FontAwesomeIcon, {
ref: ref,
...props,
className: classNames(className, {
"bf-icon-margin-left": marginLeft,
"bf-icon-margin-right": marginRight
})
}));
Icon.displayName = "Icon";
// attach sub-components to the exported object. this needs to be done in same
// file as FontAwesomeIconProps import or tsc will output two copies of prop
// types, and jsdoc comments will be stripped in dist/components/Icon/index.d.ts
export default Object.assign(Icon, {
Spinner: IconSpinner,
Step: IconStep
});