// @flow strict import * as React from 'react'; import type {ColorTypes} from '../../types/typography'; import classify from '../../utils/classify'; import {UnstyledButton} from '../Button'; import {TEXT_COLORS} from '../Text'; import type {IconProps, IconSize, IconType} from './'; import {Icon} from './'; import css from './ClickableIcon.module.css'; export const ClickableIcon: React$AbstractComponent< IconProps, HTMLButtonElement, > = React.forwardRef( ( {size = 'medium', className, ariaLabel, onClick, ...props}: IconProps, ref, ) => { const onKeyDownHandler = (e) => { if (e.key === 'Enter') { e.preventDefault(); onClick && onClick(e); } }; return ( ); }, ); export type CloseIconProps = { size?: IconSize, type?: IconType, color?: ColorTypes, onClick?: ?(SyntheticEvent) => mixed, className?: string, ariaLabel?: string, }; export const CloseIcon: React$AbstractComponent< CloseIconProps, HTMLButtonElement, > = React.forwardRef( ( { size = 'medium', type = 'regular', color = TEXT_COLORS.primary, ...props }: CloseIconProps, ref, ) => ( ), );