import { ElementType } from "react"; import type { BoxProps } from "@chakra-ui/react"; import type { DataAttributes } from "../Common/dataAttributes"; import type { Tone } from "../../Theme/tokens/builders/tone"; /** Category colour, not status — for a status chip use `tone`, which wins when both are set. */ export type TagColorScheme = "primary" | "secondary" | "tertiary" | "gray" | "red" | "orange" | "yellow" | "green" | "teal" | "blue" | "cyan" | "purple" | "pink"; /** Tag size; also scales any icon via ICON_SIZE. Defaults to "sm". */ export type TagSize = "xs" | "sm" | "md" | "lg"; /** "solid" for emphasis, "outline" on dense/colored surfaces, "subtle" (default) for everyday chips. */ export type TagVariant = "solid" | "outline" | "subtle"; /** "chip" is the filled/outlined pill; "dot" is a tone dot beside plain text. */ export type TagDisplay = "chip" | "dot"; /** Props for the pill-shaped status/filter Tag chip — see Tag.tsx for interactive/icon behavior. */ export interface TagProps extends DataAttributes { /** Chip text; truncates with an ellipsis when `maxW` is set. */ label: string; /** No effect without icon — turns it into a remove button and stops the click from bubbling to onTagClick. */ onIconClick?: () => void; /** Accessible name of the remove button: a string as is, or a function of the label. Defaults to `Remove ${label}`. */ removeLabel?: string | ((label: string) => string); /** Makes the label a real button and turns on hover/cursor/focus styles; keyboard (Enter/Space) works natively. */ onTagClick?: () => void; /** Decorative (aria-hidden) unless onIconClick is also passed — icon alone adds no interactivity. */ icon?: ElementType; /** A decorative icon before the label; always aria-hidden and never clickable. */ leadingIcon?: ElementType; /** Category colour, defaults to "primary"; ignored when `tone` is set. */ colorScheme?: TagColorScheme; /** Status tone (neutral/info/success/warning/error); overrides colorScheme for state, not category. */ tone?: Tone; /** Caps the width; the label truncates with an ellipsis and shows the full text as a title. */ maxW?: BoxProps["maxW"]; /** Defaults to "sm"; also scales the icons. */ size?: TagSize; /** Defaults to "subtle"; ignored when `display` is "dot". */ variant?: TagVariant; /** "dot" renders an 8px tone dot plus plain label for quiet rows; variant and icons are ignored. Default "chip". */ display?: TagDisplay; /** Dims the tag and disables its button(s) (native disabled); no effect on a purely static tag. */ isDisabled?: boolean; /** Test hook on the root; the remove button gets `${"$"}{testId}-remove`. */ "data-testid"?: string; }