import type { ReactNode, ButtonHTMLAttributes, AnchorHTMLAttributes } from "react" import type { BaseComponentProps, CommonSize, ButtonColor, ButtonVariant } from "@type/base.component" type NativeButtonProps = ButtonHTMLAttributes type AnchorButtonProps = AnchorHTMLAttributes export interface BaseButtonProps extends BaseComponentProps { /** * 设置 Button 的禁用 * @default false */ disabled?: boolean /** * 组件大小,可选值为 small medium large * * @default "medium" * */ size?: CommonSize /** * 设置 Button 主题色 * @default "gray" */ color?: ButtonColor /** 若传入的此参数符合http链接格式,则可以定向到指定链接 */ href?: string /** 与父级容器宽度相等 */ fullWidth?: boolean /** * 设置Button展现形式,默认为文本形式 * @default "text" */ variant?: ButtonVariant /** * 是否处于加载中多状态 * * @default false * */ loading?: boolean /** * 文案前的icon */ startIcon?: ReactNode /** * 文案后的icon * */ endIcon?: ReactNode } export type ButtonProps = Partial