2016-09-02 10:18:33 +03:00
|
|
|
import * as React from "react";
|
|
|
|
import ReactToolbox from "../index";
|
2016-07-24 14:17:16 +03:00
|
|
|
|
|
|
|
export interface ChipTheme {
|
|
|
|
/**
|
|
|
|
* Added to the root element when the component includes an avatar.
|
|
|
|
*/
|
|
|
|
avatar?: string;
|
|
|
|
/**
|
|
|
|
* Used for the root element.
|
|
|
|
*/
|
|
|
|
chip?: string;
|
|
|
|
/**
|
|
|
|
* Added to the root element when the component is deletable.
|
|
|
|
*/
|
|
|
|
deletable?: string;
|
|
|
|
/**
|
|
|
|
* Used for the delete element wrapper.
|
|
|
|
*/
|
|
|
|
delete?: string;
|
|
|
|
/**
|
|
|
|
* Used for the delete icon.
|
|
|
|
*/
|
|
|
|
deleteIcon?: string;
|
|
|
|
/**
|
|
|
|
* Used for the delete svg inner layer.
|
|
|
|
*/
|
|
|
|
deleteX?: string;
|
|
|
|
}
|
|
|
|
|
2016-12-19 22:13:36 +03:00
|
|
|
export interface ChipProps extends ReactToolbox.Props {
|
2016-07-24 14:17:16 +03:00
|
|
|
/**
|
|
|
|
* Children to pass through the component.
|
|
|
|
*/
|
2016-09-02 10:18:33 +03:00
|
|
|
children?: React.ReactNode;
|
2016-07-24 14:17:16 +03:00
|
|
|
/**
|
|
|
|
* If true, the chip will be rendered with a delete icon.
|
|
|
|
* @default false
|
|
|
|
*/
|
|
|
|
deletable?: boolean;
|
|
|
|
/**
|
|
|
|
* Callback to be invoked when the delete icon is clicked.
|
|
|
|
*/
|
2016-08-10 10:35:51 +03:00
|
|
|
onDeleteClick?: Function;
|
2016-07-24 14:17:16 +03:00
|
|
|
/**
|
|
|
|
* Classnames object defining the component style.
|
|
|
|
*/
|
|
|
|
theme?: ChipTheme;
|
|
|
|
}
|
|
|
|
|
2016-09-02 10:18:33 +03:00
|
|
|
export class Chip extends React.Component<ChipProps, {}> { }
|
2016-07-24 14:17:16 +03:00
|
|
|
|
|
|
|
export default Chip;
|