1 | import * as React from "react";
|
2 | import { AbstractPureComponent2, IElementRefProps, IntentProps, Props, MaybeElement } from "../../common";
|
3 | import { IconName } from "../icon/icon";
|
4 | export declare type TagProps = ITagProps;
|
5 | /** @deprecated use TagProps */
|
6 | export interface ITagProps extends Props, IntentProps, IElementRefProps<HTMLSpanElement>, React.HTMLAttributes<HTMLSpanElement> {
|
7 | /**
|
8 | * Whether the tag should appear in an active state.
|
9 | *
|
10 | * @default false
|
11 | */
|
12 | active?: boolean;
|
13 | /**
|
14 | * Whether the tag should take up the full width of its container.
|
15 | *
|
16 | * @default false
|
17 | */
|
18 | fill?: boolean;
|
19 | /** Name of a Blueprint UI icon (or an icon element) to render before the children. */
|
20 | icon?: IconName | MaybeElement;
|
21 | /**
|
22 | * Whether the tag should visually respond to user interactions. If set
|
23 | * to `true`, hovering over the tag will change its color and mouse cursor.
|
24 | *
|
25 | * Recommended when `onClick` is also defined.
|
26 | *
|
27 | * @default false
|
28 | */
|
29 | interactive?: boolean;
|
30 | /**
|
31 | * Whether this tag should use large styles.
|
32 | *
|
33 | * @default false
|
34 | */
|
35 | large?: boolean;
|
36 | /**
|
37 | * Whether this tag should use minimal styles.
|
38 | *
|
39 | * @default false
|
40 | */
|
41 | minimal?: boolean;
|
42 | /**
|
43 | * Whether tag content should be allowed to occupy multiple lines.
|
44 | * If false, a single line of text will be truncated with an ellipsis if
|
45 | * it overflows. Note that icons will be vertically centered relative to
|
46 | * multiline text.
|
47 | *
|
48 | * @default false
|
49 | */
|
50 | multiline?: boolean;
|
51 | /**
|
52 | * Callback invoked when the tag is clicked.
|
53 | * Recommended when `interactive` is `true`.
|
54 | */
|
55 | onClick?: (e: React.MouseEvent<HTMLDivElement>) => void;
|
56 | /**
|
57 | * Click handler for remove button.
|
58 | * The remove button will only be rendered if this prop is defined.
|
59 | */
|
60 | onRemove?: (e: React.MouseEvent<HTMLButtonElement>, tagProps: TagProps) => void;
|
61 | /** Name of a Blueprint UI icon (or an icon element) to render after the children. */
|
62 | rightIcon?: IconName | MaybeElement;
|
63 | /**
|
64 | * Whether this tag should have rounded ends.
|
65 | *
|
66 | * @default false
|
67 | */
|
68 | round?: boolean;
|
69 | /**
|
70 | * HTML title to be passed to the <Text> component
|
71 | */
|
72 | htmlTitle?: string;
|
73 | }
|
74 | export declare class Tag extends AbstractPureComponent2<TagProps> {
|
75 | static displayName: string;
|
76 | render(): JSX.Element;
|
77 | private onRemoveClick;
|
78 | }
|