// @flow strict import * as React from 'react'; import { colorDangerLightest, colorGrayLightest, colorInformationLightest, colorNeutralLightest, colorSuccessLightest, colorWarningLightest, } from '../../styles/variables/_color'; import classify from '../../utils/classify'; import {ButtonTextSmall} from '../Text/Text'; import css from './Badge.module.css'; type ClassNames = $ReadOnly<{wrapper?: string}>; export const BADGE_COLOR = Object.freeze({ gray: colorGrayLightest, red: colorDangerLightest, orange: colorWarningLightest, green: colorSuccessLightest, blue: colorInformationLightest, indigo: colorNeutralLightest, }); export type BadgeColorType = $Keys; export type BadgeProps = { classNames?: ClassNames, text: string, fill?: BadgeColorType, }; export const Badge: React$AbstractComponent = React.forwardRef( ({classNames, text, fill = 'gray'}: BadgeProps, ref): React.Node => (
{text}
), );