mirror of
https://github.com/cinnyapp/cinny.git
synced 2025-11-15 11:40:29 +03:00
parent
20443f8a4d
commit
c9ec161ccc
10 changed files with 348 additions and 7 deletions
|
|
@ -9,7 +9,7 @@ import Text from '../text/Text';
|
|||
|
||||
const IconButton = React.forwardRef(({
|
||||
variant, size, type,
|
||||
tooltip, tooltipPlacement, src, onClick,
|
||||
tooltip, tooltipPlacement, src, onClick, tabIndex,
|
||||
}, ref) => {
|
||||
const btn = (
|
||||
<button
|
||||
|
|
@ -19,6 +19,7 @@ const IconButton = React.forwardRef(({
|
|||
onClick={onClick}
|
||||
// eslint-disable-next-line react/button-has-type
|
||||
type={type}
|
||||
tabIndex={tabIndex}
|
||||
>
|
||||
<RawIcon size={size} src={src} />
|
||||
</button>
|
||||
|
|
@ -41,6 +42,7 @@ IconButton.defaultProps = {
|
|||
tooltip: null,
|
||||
tooltipPlacement: 'top',
|
||||
onClick: null,
|
||||
tabIndex: 0,
|
||||
};
|
||||
|
||||
IconButton.propTypes = {
|
||||
|
|
@ -51,6 +53,7 @@ IconButton.propTypes = {
|
|||
tooltipPlacement: PropTypes.oneOf(['top', 'right', 'bottom', 'left']),
|
||||
src: PropTypes.string.isRequired,
|
||||
onClick: PropTypes.func,
|
||||
tabIndex: PropTypes.number,
|
||||
};
|
||||
|
||||
export default IconButton;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue