-
Notifications
You must be signed in to change notification settings - Fork 21
/
Button.types.ts
executable file
·109 lines (105 loc) · 2.39 KB
/
Button.types.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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
import { ReactNode } from 'react';
import { IrisProps } from '../../utils';
import { Statuses } from '../../themes';
import {
formats,
variants,
sizes,
iconPositions,
} from './Button.config';
export type DOMElement =
| HTMLButtonElement
| HTMLAnchorElement
| HTMLSpanElement;
export type ButtonTypes = 'button' | 'reset' | 'submit';
type ButtonElements = 'button' | 'span' | 'a';
type Targets = '_blank' | '_self' | '_parent' | '_top';
type Fluid = true | false | { min?: number; max?: number };
export type Props = IrisProps<
{
/**
* @deprecated
*
* Use `pill` prop instead.
*/
circular?: boolean;
/**
* Provide a color string or object of color strings for custom coloring.
* Use this only as a last resort! It is not fully supported!
*
*/
color?:
| string
| {
color: string;
hover?: string;
active?: string;
textColor?: string;
};
element?: ButtonElements;
floating?: boolean;
/**
* Whether the button will fill the width of its container,
* can also specify the min, max widths in px of when the button will be fluid
*
* Example: {{ min: 250, max: 750 }}
*
* [default = false]
*/
fluid?: Fluid;
/**
* [default = 'primary']
*/
format?: (typeof formats)[number];
href?: string;
icon?: ReactNode;
/**
* [default = 'left']
*/
iconPosition?: (typeof iconPositions)[number];
loading?: boolean;
/**
* @deprecated
*
* Text overflow will always truncate.
*/
overflow?: boolean;
/**
* The focus radius around border of button
*
* [default = 6]
*/
pill?: boolean;
/**
* [default = 'md']
*/
size?: (typeof sizes)[number];
status?: Statuses;
target?: Targets;
/**
* When enabled, if the button is a minimal variant, the padding
* opposite the side of `iconPosition` will be 0 until the
* button is hovered or focused.
*
*/
textShift?: boolean;
theme?: any;
/**
* HTML Button type property
*/
type?: ButtonTypes;
/**
* [default = 'solid']
*/
variant?: (typeof variants)[number];
/**
* Should the button have checked state
*/
checked?: boolean;
/**
* Should the button have active state
*/
active?: boolean;
},
DOMElement
>;