import React from "react"; import classNames from "classnames"; import { BoxProps } from "../Box"; import { bem } from "../../utilities/bem"; import { ICON_TYPE, Icon } from "../Icon"; import { TagGroup } from "./TagGroup"; const cn = "Tag"; export enum TAG_VARIANT { PRIMARY = "primary", SECONDARY = "secondary", } export interface TagProps extends BoxProps { /** * Sets the style of the tag */ variant?: TAG_VARIANT; /** * Inverses the variant colors */ filled?: boolean; /** * Enables hover and focused styles if the tag is rendered as a clickable element */ clickable?: boolean; /** * Applies the correct styles if a tag is used to show an "on/off" or "selected/deselected" state */ toggleable?: boolean; /** * Icon to show next to the tag content */ icon?: ICON_TYPE; } export const Tag = ({ variant = TAG_VARIANT.SECONDARY, clickable = false, filled = false, toggleable = false, icon, as: Component = "span", className, children, ...rest }: TagProps) => { return ( {icon && ( )} {children} ); }; Tag.Group = TagGroup;