// @flow strict import * as React from 'react'; // get our fontawesome imports import './FontAwesomeLibrary'; import type {ColorTypes} from '../../types/typography'; import {TEXT_COLORS} from '../../types/typography'; import classify from '../../utils/classify'; import typographyStyle from '../../styles/typography.module.css'; export type IconType = 'regular' | 'solid' | 'duotone' | 'brands'; export const ICON_SIZE = Object.freeze({ small: 'small', medium: 'medium', }); export type IconSize = $Keys; export type IconProps = { type?: IconType, name: string, size?: IconSize, color?: ColorTypes, className?: string, onClick?: ?(SyntheticEvent) => mixed, ariaLabel?: string, swapOpacity?: boolean, }; export const Icon: React$AbstractComponent = React.forwardRef( ( { type = 'regular', name = '', size = 'medium', color = TEXT_COLORS.primary, className, onClick, swapOpacity, }: IconProps, forwardRef, ) => ( <> {!!name && (
)} ), );