UNPKG

1.28 kBTypeScriptView Raw
1import React from 'react';
2import type { SizeType } from '../config-provider/SizeContext';
3import Group from './button-group';
4import type { ButtonHTMLType, ButtonShape, ButtonType } from './buttonHelpers';
5export type LegacyButtonType = ButtonType | 'danger';
6export interface BaseButtonProps {
7 type?: ButtonType;
8 icon?: React.ReactNode;
9 shape?: ButtonShape;
10 size?: SizeType;
11 disabled?: boolean;
12 loading?: boolean | {
13 delay?: number;
14 };
15 prefixCls?: string;
16 className?: string;
17 rootClassName?: string;
18 ghost?: boolean;
19 danger?: boolean;
20 block?: boolean;
21 children?: React.ReactNode;
22 [key: `data-${string}`]: string;
23 classNames?: {
24 icon: string;
25 };
26 styles?: {
27 icon: React.CSSProperties;
28 };
29}
30type MergedHTMLAttributes = Omit<React.HTMLAttributes<HTMLElement> & React.ButtonHTMLAttributes<HTMLElement> & React.AnchorHTMLAttributes<HTMLElement>, 'type'>;
31export interface ButtonProps extends BaseButtonProps, MergedHTMLAttributes {
32 href?: string;
33 htmlType?: ButtonHTMLType;
34}
35type CompoundedComponent = React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLElement>> & {
36 Group: typeof Group;
37};
38declare const Button: CompoundedComponent;
39export default Button;