UNPKG

1.51 kBTypeScriptView Raw
1import * as React from 'react';
2import { PropTypes } from '..';
3import { OverridableComponent, OverrideProps } from '../OverridableComponent';
4
5export interface ChipTypeMap<P = {}, D extends React.ElementType = 'div'> {
6 props: P & {
7 avatar?: React.ReactElement;
8 clickable?: boolean;
9 color?: PropTypes.Color;
10 deleteIcon?: React.ReactElement;
11 disabled?: boolean;
12 icon?: React.ReactElement;
13 label?: React.ReactNode;
14 onDelete?: React.EventHandler<any>;
15 size?: 'small' | 'medium';
16 variant?: 'default' | 'outlined';
17 };
18 defaultComponent: D;
19 classKey: ChipClassKey;
20}
21
22declare const Chip: OverridableComponent<ChipTypeMap>;
23
24export type ChipClassKey =
25 | 'root'
26 | 'sizeSmall'
27 | 'colorPrimary'
28 | 'colorSecondary'
29 | 'disabled'
30 | 'clickable'
31 | 'clickableColorPrimary'
32 | 'clickableColorSecondary'
33 | 'deletable'
34 | 'deletableColorPrimary'
35 | 'deletableColorSecondary'
36 | 'outlined'
37 | 'outlinedPrimary'
38 | 'outlinedSecondary'
39 | 'avatar'
40 | 'avatarSmall'
41 | 'avatarColorPrimary'
42 | 'avatarColorSecondary'
43 | 'icon'
44 | 'iconSmall'
45 | 'iconColorPrimary'
46 | 'iconColorSecondary'
47 | 'label'
48 | 'labelSmall'
49 | 'deleteIcon'
50 | 'deleteIconSmall'
51 | 'deleteIconColorPrimary'
52 | 'deleteIconColorSecondary'
53 | 'deleteIconOutlinedColorPrimary'
54 | 'deleteIconOutlinedColorSecondary';
55
56export type ChipProps<
57 D extends React.ElementType = ChipTypeMap['defaultComponent'],
58 P = {}
59> = OverrideProps<ChipTypeMap<P, D>, D>;
60
61export default Chip;