UNPKG

1.73 kBTypeScriptView Raw
1import * as React from 'react';
2import {StyletronComponent} from 'styletron-react';
3import {Override} from '../overrides';
4
5export interface KIND {
6 custom: 'custom';
7 neutral: 'neutral';
8 primary: 'primary';
9 accent: 'accent';
10 positive: 'positive';
11 warning: 'warning';
12 negative: 'negative';
13 white: 'white';
14 black: 'black';
15 blue: 'blue';
16 red: 'red';
17 orange: 'orange';
18 yellow: 'yellow';
19 green: 'green';
20 purple: 'purple';
21 brown: 'brown';
22}
23
24export interface VARIANT {
25 solid: 'solid';
26 light: 'light';
27 outlined: 'outlined';
28}
29
30export interface SIZE {
31 small: 'small';
32 medium: 'medium';
33 large: 'large';
34}
35
36export interface TagOverrides {
37 Root?: Override<any>;
38 Action?: Override<any>;
39 ActionIcon?: Override<any>;
40 Text?: Override<any>;
41}
42
43export interface TagProps {
44 overrides?: TagOverrides;
45 closeable?: boolean;
46 disabled?: boolean;
47 isFocused?: boolean;
48 isHovered?: boolean;
49 kind?: KIND[keyof KIND];
50 variant?: VARIANT[keyof VARIANT];
51 children?: React.ReactNode;
52 title?: string;
53 color?: string;
54 size?: SIZE[keyof SIZE];
55 onActionClick?: (e: Event, children?: React.ReactNode) => any;
56 onActionKeyDown?: (e: Event, children?: React.ReactNode) => any;
57 onClick?: (event: Event) => any;
58 onKeyDown?: (event: Event) => any;
59}
60
61export class Tag extends React.Component<TagProps> {
62 handleKeyDown(event: KeyboardEvent): void;
63 handleActionKeyDown(event: KeyboardEvent): void;
64}
65
66export const StyledRoot: StyletronComponent<any>;
67export const StyledAction: StyletronComponent<any>;
68export const StyledActionIcon: StyletronComponent<any>;
69export const StyledText: StyletronComponent<any>;
70
71export const KIND: KIND;
72export const VARIANT: VARIANT;
73export const SIZE: SIZE;