// @flow strict import * as React from 'react'; 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 const ICON_TYPE = Object.freeze({ regular: 'regular', solid: 'solid', duotone: 'duotone', brands: 'brands', }); export const ICON_SIZE = Object.freeze({ small: 'small', medium: 'medium', large: 'large', }); export type IconSize = $Keys; export type IconType = $Keys; export type IconProps = { type?: IconType, name: string, size?: IconSize, color?: ColorTypes, className?: string, onClick?: ?(SyntheticEvent) => mixed, ariaLabel?: string, swapOpacity?: boolean, style?: {[string]: string}, }; export const Icon: React$AbstractComponent = React.forwardRef( ( { type = 'regular', name = '', size = 'medium', color = TEXT_COLORS.primary, className, style, onClick, swapOpacity, }: IconProps, forwardRef, ) => ( <> {!!name && (
)} ), );