UNPKG

1.71 kBTypeScriptView Raw
1import * as React from 'react';
2import { TooltipPosition } from '../Tooltip';
3import { OUIAProps } from '../../helpers';
4export interface ChipProps extends React.HTMLProps<HTMLDivElement>, OUIAProps {
5 /** Content rendered inside the chip text */
6 children?: React.ReactNode;
7 /** Aria Label for close button */
8 closeBtnAriaLabel?: string;
9 /** Additional classes added to the chip item */
10 className?: string;
11 /** Flag indicating if the chip is an overflow chip */
12 isOverflowChip?: boolean;
13 /** Flag indicating if chip is read only */
14 isReadOnly?: boolean;
15 /** Function that is called when clicking on the chip close button */
16 onClick?: (event: React.MouseEvent) => void;
17 /** Component that will be used for chip. It is recommended that <button> or <li> are used when the chip is an overflow chip. */
18 component?: React.ReactNode;
19 /** Position of the tooltip which is displayed if text is longer */
20 tooltipPosition?: TooltipPosition | 'auto' | 'top' | 'bottom' | 'left' | 'right' | 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end' | 'left-start' | 'left-end' | 'right-start' | 'right-end';
21}
22interface ChipState {
23 isTooltipVisible: boolean;
24 ouiaStateId: string;
25}
26export declare class Chip extends React.Component<ChipProps, ChipState> {
27 static displayName: string;
28 constructor(props: ChipProps);
29 span: React.RefObject<HTMLSpanElement>;
30 static defaultProps: ChipProps;
31 componentDidMount(): void;
32 renderOverflowChip: () => JSX.Element;
33 renderInnerChip(id: string): JSX.Element;
34 renderChip: (randomId: string) => JSX.Element;
35 render(): JSX.Element;
36}
37export {};
38//# sourceMappingURL=Chip.d.ts.map
\No newline at end of file