import classNames from 'classnames'; import { JsxChildren, VNode } from 'dom-renderer'; import { FC, WebCellProps } from 'web-cell'; import { uniqueID } from 'web-utility'; import { FormCheckProps, FormControlProps } from './Form'; import { Icon, IconProps } from '../Reminder'; import { TextColor } from '../type'; export interface ButtonProps extends WebCellProps, Omit, 'type'>, Pick, 'size'> { variant?: TextColor | `outline-${TextColor}` | 'link'; active?: boolean; } export const Button: FC = ({ className, href, variant, size, active, children, ...props }) => { const { disabled, tabIndex } = props, Class = classNames( 'btn', variant && `btn-${variant}`, size && `btn-${size}`, className ); return href ? ( {children} ) : ( ); }; export function isButton(node: JsxChildren): node is VNode { const { selector, props } = node as VNode; return /^(a|input|button)/.test(selector) && props?.className?.btn; } export type IconButtonProps = IconProps & Omit; export const IconButton: FC = ({ className, name, color, size, ...button }) => ( ); export const CloseButton: FC> = ({ className = '', ...props }) => (