UNPKG

2.59 kBTypeScriptView Raw
1import * as React from 'react';
2import { TooltipPosition } from '../Tooltip';
3export interface LabelGroupProps extends React.HTMLProps<HTMLUListElement> {
4 /** Content rendered inside the label group. Should be <Label> elements. */
5 children?: React.ReactNode;
6 /** Additional classes added to the label item */
7 className?: string;
8 /** Flag for having the label group default to expanded */
9 defaultIsOpen?: boolean;
10 /** Customizable "Show Less" text string */
11 expandedText?: string;
12 /** Customizeable template string. Use variable "${remaining}" for the overflow label count. */
13 collapsedText?: string;
14 /** Category name text for the label group category. If this prop is supplied the label group with have a label and category styling applied */
15 categoryName?: string;
16 /** Aria label for label group that does not have a category name */
17 'aria-label'?: string;
18 /** Set number of labels to show before overflow */
19 numLabels?: number;
20 /** Flag if label group can be closed */
21 isClosable?: boolean;
22 /** Flag indicating the labels in the group are compact */
23 isCompact?: boolean;
24 /** Aria label for close button */
25 closeBtnAriaLabel?: string;
26 /** Function that is called when clicking on the label group close button */
27 onClick?: (event: React.MouseEvent) => void;
28 /** Position of the tooltip which is displayed if the category name text is longer */
29 tooltipPosition?: TooltipPosition | 'auto' | 'top' | 'bottom' | 'left' | 'right' | 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end' | 'left-start' | 'left-end' | 'right-start' | 'right-end';
30 /** Flag to implement a vertical layout */
31 isVertical?: boolean;
32 /** @beta Flag indicating contained labels are editable. Allows spacing for a text input after the labels. */
33 isEditable?: boolean;
34 /** @beta Flag indicating the editable label group should be appended with a textarea. */
35 hasEditableTextArea?: boolean;
36 /** @beta Additional props passed to the editable textarea. */
37 editableTextAreaProps?: any;
38}
39interface LabelGroupState {
40 isOpen: boolean;
41 isTooltipVisible: boolean;
42}
43export declare class LabelGroup extends React.Component<LabelGroupProps, LabelGroupState> {
44 static displayName: string;
45 constructor(props: LabelGroupProps);
46 private headingRef;
47 static defaultProps: LabelGroupProps;
48 componentDidMount(): void;
49 toggleCollapse: () => void;
50 renderLabel(id: string): JSX.Element;
51 render(): JSX.Element;
52}
53export {};
54//# sourceMappingURL=LabelGroup.d.ts.map
\No newline at end of file