UNPKG

2.25 kBTypeScriptView Raw
1import * as React from 'react';
2import { TooltipPosition } from '../Tooltip';
3import { OUIAProps } from '../../helpers';
4export interface ChipGroupProps extends React.HTMLProps<HTMLUListElement>, OUIAProps {
5 /** Content rendered inside the chip group. Should be <Chip> elements. */
6 children?: React.ReactNode;
7 /** Additional classes added to the chip item */
8 className?: string;
9 /** Flag for having the chip group default to expanded */
10 defaultIsOpen?: boolean;
11 /** Customizable "Show Less" text string */
12 expandedText?: string;
13 /** Customizeable template string. Use variable "${remaining}" for the overflow chip count. */
14 collapsedText?: string;
15 /** Category name text for the chip group category. If this prop is supplied the chip group with have a label and category styling applied */
16 categoryName?: string;
17 /** Aria label for chip group that does not have a category name */
18 'aria-label'?: string;
19 /** Set number of chips to show before overflow */
20 numChips?: number;
21 /** Flag if chip group can be closed*/
22 isClosable?: boolean;
23 /** Aria label for close button */
24 closeBtnAriaLabel?: string;
25 /** Function that is called when clicking on the chip group close button */
26 onClick?: (event: React.MouseEvent) => void;
27 /** Function that is called when clicking on the overflow (expand/collapse) chip button */
28 onOverflowChipClick?: (event: React.MouseEvent) => void;
29 /** Position of the tooltip which is displayed if the category name text is longer */
30 tooltipPosition?: TooltipPosition | 'auto' | 'top' | 'bottom' | 'left' | 'right' | 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end' | 'left-start' | 'left-end' | 'right-start' | 'right-end';
31}
32interface ChipGroupState {
33 isOpen: boolean;
34 isTooltipVisible: boolean;
35}
36export declare class ChipGroup extends React.Component<ChipGroupProps, ChipGroupState> {
37 static displayName: string;
38 constructor(props: ChipGroupProps);
39 private headingRef;
40 static defaultProps: ChipGroupProps;
41 componentDidMount(): void;
42 toggleCollapse: () => void;
43 renderLabel(id: string): JSX.Element;
44 render(): JSX.Element;
45}
46export {};
47//# sourceMappingURL=ChipGroup.d.ts.map
\No newline at end of file