import { ComponentPropsWithoutRef, KeyboardEvent, MouseEvent, ReactNode } from 'react'; import { AvatarProps } from '../../Avatar/internal/Avatar'; import { LayoutUtilProps, Size } from '../../../types'; /** * Props for the Chip component * @extends ComponentPropsWithoutRef<"span"> * @extends Omit */ export type ChipBaseProps = Omit, "prefix"> & Omit & { /** * The text that displays in the chip. */ label: string; /** * Color of the Chip */ color?: string; /** * Wraps text when it overflows */ textWrap?: boolean; /** * Content displayed in the chip, before the text. */ prefix?: ReactNode; /** * Image URL to display in an avatar before the chip text. */ avatar?: AvatarProps["image"]; /** * Content displayed in the chip, after the text. */ suffix?: ReactNode; }; type ChipClickHandler = (e?: MouseEvent | KeyboardEvent) => void; type ChipCloseHandler = (e: MouseEvent | KeyboardEvent) => void; type SmallChipHandlers = { /** * Callback for when the Chip is clicked * * @remarks * Adding this will make Chip focusable */ onClick?: ChipClickHandler; /** * Called when the component is closed. If supplied, a close button will be rendered. * @returns void */ onClose?: never; } | { /** * Called when the component is closed. If supplied, a close button will be rendered. * @returns void */ onClose?: ChipCloseHandler; /** * Callback for when the Chip is clicked * * @remarks * Adding this will make Chip focusable */ onClick?: never; }; type SmallChipProps = ChipBaseProps & { /** * The size of the chip * @default medium */ size: Extract; } & SmallChipHandlers; type MediumChipProps = ChipBaseProps & { /** * The size of the chip * @default medium */ size?: Extract; /** * Callback for when the Chip is clicked * * @remarks * Adding this will make Chip focusable */ onClick?: ChipClickHandler; /** * Called when the component is closed. If supplied, a close button will be rendered. * @returns void */ onClose?: ChipCloseHandler; }; export type ChipProps = SmallChipProps | MediumChipProps; /** * Chip component for displaying compact information or tags. * * Features: * - Configurable sizes (small, medium) * - Custom color support with automatic contrast calculation * - Optional click handler for interactive chips * - Optional close button for removable chips * - Text wrapping support for long labels * - Full accessibility support with ARIA attributes * - Keyboard navigation (Enter/Space to click, Delete/Backspace to close) * - Screen reader instructions for removal actions * - Theme-aware color adaptation * - Layout utility props for positioning and spacing * * @example * console.log('Chip removed')} * onClick={(e) => console.log('Chip clicked')} * /> */ export declare const Chip: import('react').ForwardRefExoticComponent>; export {};