This repository has been archived by the owner on Aug 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
button-1b316d2b.d.ts
80 lines (77 loc) · 2.05 KB
/
button-1b316d2b.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
import { ElementType, ComponentPropsWithRef, JSXElementConstructor, ComponentPropsWithoutRef, ReactNode, ReactElement } from 'react';
import { S as SizeType, T as ThemeType, V as VariantType } from './index-2e22dac1.js';
declare type ExtendedProps<BaseProps = {}, OverrideProps = {}> = OverrideProps & Omit<BaseProps, keyof OverrideProps>;
declare type PropsOf<C extends keyof JSX.IntrinsicElements | JSXElementConstructor<any>> = JSX.LibraryManagedAttributes<C, ComponentPropsWithoutRef<C>>;
declare type InheritedProps<C extends ElementType, Props = {}> = ExtendedProps<PropsOf<C>, Props>;
declare type PolymorphicRef<C extends ElementType> = ComponentPropsWithRef<C>['ref'];
declare type PolymorphicComponentProps<C extends ElementType, Props = {}> = InheritedProps<C, Props & {
as?: C;
}> & {
ref?: PolymorphicRef<C>;
};
interface SharedButtonProps {
/**
* Children
*/
children?: ReactNode;
/**
* Label
*/
text?: string;
/**
* Type
*/
type?: 'button' | 'reset' | 'submit';
/**
* Icon
*/
icon?: ReactElement | ReactElement[];
/**
* Icon placement.
*/
placement?: 'left' | 'right';
/**
* Round
*/
round?: boolean;
/**
* Size
*/
size?: Exclude<SizeType, 'xs' | 'xl'>;
/**
* Synthetic behaviour to prevent `:active` and `:focus` styles.
*/
synthetic?: boolean;
/**
* Theme
*/
theme?: Exclude<ThemeType, 'notice'>;
/**
* Toggle
*/
toggle?: boolean;
/**
* Variant
*/
variant?: VariantType;
/**
* State: Active
*/
active?: boolean;
/**
* State: Busy
*/
busy?: boolean;
/**
* State: Disabled
*/
disabled?: boolean;
}
declare type ButtonProps<C extends ElementType> = PolymorphicComponentProps<C, SharedButtonProps>;
declare type ButtonComponent = <C extends ElementType = 'button'>(props: ButtonProps<C>) => ReactElement;
/**
* Button
* @deprecated
*/
declare const Button: ButtonComponent;
export { Button as B, ButtonProps as a };