forked from canada-ca/tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathButton.js
More file actions
113 lines (111 loc) · 2.15 KB
/
Button.js
File metadata and controls
113 lines (111 loc) · 2.15 KB
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
110
111
112
113
const commonProps = {
display: 'inline-flex',
alignItems: 'center',
justifyContent: 'center',
fontWeight: 'semibold',
rounded: 'md',
transition: 'all 0.2s cubic-bezier(.08,.52,.52,1)',
overflow: 'hidden',
px: '4',
py: '2',
_active: {
boxShadow: 'outline',
},
_focus: {
boxShadow: 'outline',
},
_disabled: { opacity: '0.4', cursor: 'not-allowed', boxShadow: 'none' },
}
const Button = {
// Styles for the base style
baseStyle: {},
// Styles for the size variations
sizes: {},
// Styles for the visual style variations
variants: {
primary: {
...commonProps,
color: 'gray.50',
bg: 'primary',
_hover: {
bg: 'primary2',
},
},
primaryOutline: {
...commonProps,
color: 'primary',
bg: 'transparent',
borderColor: 'primary',
borderWidth: '1px',
},
primaryHover: {
...commonProps,
color: 'gray.50',
bg: 'primary',
borderColor: 'gray.50',
borderWidth: '1px',
_hover: {
color: 'accent',
bg: 'primary',
borderColor: 'accent',
},
},
primaryWhite: {
...commonProps,
color: 'primary',
bg: 'gray.50',
borderColor: 'gray.50',
borderWidth: '1px',
_hover: {
color: 'primary',
bg: 'accent',
borderColor: 'accent',
},
},
outline: {
...commonProps,
color: 'primary2',
bg: 'transparent',
borderColor: 'primary2',
borderWidth: '1px',
_hover: {
bg: 'blue.50',
},
},
danger: {
...commonProps,
color: 'gray.50',
bg: 'red.700',
_hover: {
bg: 'red.600',
},
},
strong: {
...commonProps,
color: 'white',
bg: 'strong',
_hover: {
bg: 'green.400',
},
},
info: {
...commonProps,
color: 'white',
bg: 'info',
_hover: {
bg: 'blue.300',
},
},
weak: {
...commonProps,
color: 'white',
bg: 'weak',
_hover: {
bg: 'red.400',
},
},
},
// The default `size` or `variant` values
defaultProps: {},
}
export default Button