@lets-events/react 2.0.0 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +8 -8
- package/CHANGELOG.md +12 -0
- package/dist/index.d.mts +7288 -7
- package/dist/index.d.ts +7288 -7
- package/dist/index.js +3030 -21
- package/dist/index.mjs +3004 -20
- package/package.json +8 -1
- package/src/components/Avatar.tsx +56 -0
- package/src/components/Badge.tsx +121 -0
- package/src/components/BadgeText.tsx +29 -0
- package/src/components/BodyText.tsx +24 -0
- package/src/components/Box.tsx +3 -0
- package/src/components/Button.tsx +349 -0
- package/src/components/ButtonGroup.tsx +478 -0
- package/src/components/CaptionText.tsx +16 -0
- package/src/components/CheckboxGroup.tsx +208 -0
- package/src/components/DisplayText.tsx +26 -0
- package/src/components/Dropdown.tsx +109 -0
- package/src/components/Filter.tsx +96 -0
- package/src/components/Flex.tsx +47 -0
- package/src/components/Headline.tsx +29 -0
- package/src/components/Icon.tsx +48 -0
- package/src/components/Label.tsx +28 -0
- package/src/components/RadioGroup.tsx +204 -0
- package/src/components/Subtitle.tsx +26 -0
- package/src/components/Text.tsx +8 -11
- package/src/components/TextField.tsx +193 -0
- package/src/components/TooltipText.tsx +15 -0
- package/src/index.tsx +22 -0
- package/src/styles/index.ts +2 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lets-events/react",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -25,6 +25,13 @@
|
|
|
25
25
|
"typescript": "^5.8.2"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
+
"@fortawesome/fontawesome-free": "^5.14.0",
|
|
29
|
+
"@fortawesome/fontawesome-svg-core": "^6.7.2",
|
|
30
|
+
"@fortawesome/free-brands-svg-icons": "^6.7.2",
|
|
31
|
+
"@fortawesome/free-regular-svg-icons": "^6.7.2",
|
|
32
|
+
"@fortawesome/free-solid-svg-icons": "^6.7.2",
|
|
33
|
+
"@fortawesome/react-fontawesome": "^0.2.2",
|
|
34
|
+
"@radix-ui/themes": "^3.2.1",
|
|
28
35
|
"@stitches/react": "^1.2.8"
|
|
29
36
|
}
|
|
30
37
|
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { ComponentProps, ElementType } from 'react'
|
|
2
|
+
import { styled } from '../styles'
|
|
3
|
+
import { Avatar as AvatarRadix } from "@radix-ui/themes";
|
|
4
|
+
export const AvatarStyled = styled(AvatarRadix, {
|
|
5
|
+
fontFamily: '$default',
|
|
6
|
+
color: '$gray100',
|
|
7
|
+
letterSpacing: '0px',
|
|
8
|
+
variants: {
|
|
9
|
+
size: {
|
|
10
|
+
'xs': { width: '$24', height: '$24', display: 'flex', alignItems: 'center', justifyContent: 'center', fontSize: '$10', },
|
|
11
|
+
'sm': { width: '$32', height: '$32', display: 'flex', alignItems: 'center', justifyContent: 'center', fontSize: '$14', },
|
|
12
|
+
'md': { width: '$40', height: '$40', display: 'flex', alignItems: 'center', justifyContent: 'center', fontSize: '$16', },
|
|
13
|
+
'lg': { width: '$48', height: '$48', display: 'flex', alignItems: 'center', justifyContent: 'center', fontSize: '$18', },
|
|
14
|
+
'xl': { width: '$64', height: '$64', display: 'flex', alignItems: 'center', justifyContent: 'center', fontSize: '$24', },
|
|
15
|
+
},
|
|
16
|
+
radii: {
|
|
17
|
+
full: { borderRadius: '$full' },
|
|
18
|
+
},
|
|
19
|
+
variant: {
|
|
20
|
+
'without-image': {
|
|
21
|
+
border: '1px solid $brand500',
|
|
22
|
+
backgroundColor: '$dark50',
|
|
23
|
+
color: '$dark700',
|
|
24
|
+
fontStyle: 'normal',
|
|
25
|
+
fontWeight: 500,
|
|
26
|
+
lineHeight: 'normal',
|
|
27
|
+
textTransform: 'uppercase',
|
|
28
|
+
|
|
29
|
+
},
|
|
30
|
+
'with-image': {
|
|
31
|
+
border: 0,
|
|
32
|
+
'img': {
|
|
33
|
+
width: '100%',
|
|
34
|
+
height: '100%',
|
|
35
|
+
objectFit: 'cover',
|
|
36
|
+
borderRadius: '$full',
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
|
|
42
|
+
defaultVariants: {
|
|
43
|
+
size: 'md',
|
|
44
|
+
radii: 'full',
|
|
45
|
+
variant: 'without-image'
|
|
46
|
+
},
|
|
47
|
+
})
|
|
48
|
+
|
|
49
|
+
export type AvatarProps = ComponentProps<typeof AvatarStyled> & {
|
|
50
|
+
as?: ElementType
|
|
51
|
+
fallback?: string
|
|
52
|
+
src?: string
|
|
53
|
+
}
|
|
54
|
+
export function Avatar({ asChild, ...props }: AvatarProps) {
|
|
55
|
+
return <AvatarStyled as={AvatarRadix} {...props} />
|
|
56
|
+
}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { ComponentProps, ElementType } from 'react'
|
|
3
|
+
import { styled } from '../styles'
|
|
4
|
+
import { Badge as BadgeRadix } from '@radix-ui/themes'
|
|
5
|
+
export const BadgeStyled = styled(BadgeRadix, {
|
|
6
|
+
fontFamily: '$default',
|
|
7
|
+
borderRadius: '$sm',
|
|
8
|
+
verticalAlign: 'middle',
|
|
9
|
+
'svg': {
|
|
10
|
+
marginRight: '10px',
|
|
11
|
+
},
|
|
12
|
+
variants: {
|
|
13
|
+
color: {
|
|
14
|
+
primary: {
|
|
15
|
+
backgroundColor: '$brand100',
|
|
16
|
+
color: '$dark700',
|
|
17
|
+
},
|
|
18
|
+
dark: {
|
|
19
|
+
backgroundColor: '$dark700',
|
|
20
|
+
color: '$grey50',
|
|
21
|
+
},
|
|
22
|
+
light: {
|
|
23
|
+
backgroundColor: '$neutral200',
|
|
24
|
+
color: '$dark700',
|
|
25
|
+
},
|
|
26
|
+
red: {
|
|
27
|
+
backgroundColor: '$red100',
|
|
28
|
+
color: '$dark700',
|
|
29
|
+
},
|
|
30
|
+
green: {
|
|
31
|
+
backgroundColor: '$green100',
|
|
32
|
+
color: '$dark700',
|
|
33
|
+
},
|
|
34
|
+
yellow: {
|
|
35
|
+
backgroundColor: '$yellow100',
|
|
36
|
+
color: '$dark700',
|
|
37
|
+
},
|
|
38
|
+
orange: {
|
|
39
|
+
backgroundColor: '$orange100',
|
|
40
|
+
color: '$dark700',
|
|
41
|
+
},
|
|
42
|
+
blue: {
|
|
43
|
+
backgroundColor: '$blue100',
|
|
44
|
+
color: '$dark700',
|
|
45
|
+
},
|
|
46
|
+
pink: {
|
|
47
|
+
backgroundColor: '$pink100',
|
|
48
|
+
color: '$dark700',
|
|
49
|
+
},
|
|
50
|
+
purple: {
|
|
51
|
+
backgroundColor: '$purple100',
|
|
52
|
+
color: '$dark700',
|
|
53
|
+
},
|
|
54
|
+
grey: {
|
|
55
|
+
backgroundColor: '$grey200',
|
|
56
|
+
color: '$dark700',
|
|
57
|
+
},
|
|
58
|
+
disable: {
|
|
59
|
+
backgroundColor: '$neutral200',
|
|
60
|
+
color: '$grey500',
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
},
|
|
65
|
+
size: {
|
|
66
|
+
xs: {
|
|
67
|
+
padding: '$4 $6',
|
|
68
|
+
fontSize: '$10',
|
|
69
|
+
borderRadius: '$2xs',
|
|
70
|
+
lineHeight: '$smaller',
|
|
71
|
+
},
|
|
72
|
+
sm: {
|
|
73
|
+
padding: '$4 $8',
|
|
74
|
+
fontSize: '$12',
|
|
75
|
+
borderRadius: '$xs',
|
|
76
|
+
lineHeight: '$smaller',
|
|
77
|
+
},
|
|
78
|
+
md: {
|
|
79
|
+
padding: '$8 $10',
|
|
80
|
+
fontSize: '$14',
|
|
81
|
+
borderRadius: '$sm',
|
|
82
|
+
lineHeight: '$smaller',
|
|
83
|
+
},
|
|
84
|
+
xl: {
|
|
85
|
+
padding: '$12 $12',
|
|
86
|
+
fontSize: '$16',
|
|
87
|
+
borderRadius: '$sm',
|
|
88
|
+
lineHeight: '$smaller',
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
radii: {
|
|
92
|
+
'full': {
|
|
93
|
+
borderRadius: '$full',
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
|
|
98
|
+
defaultVariants: {
|
|
99
|
+
size: 'md',
|
|
100
|
+
color: 'primary',
|
|
101
|
+
},
|
|
102
|
+
})
|
|
103
|
+
|
|
104
|
+
export type BadgeProps = ComponentProps<typeof BadgeStyled> & {
|
|
105
|
+
as?: ElementType
|
|
106
|
+
icon?: boolean
|
|
107
|
+
size: 'md',
|
|
108
|
+
children: React.ReactNode
|
|
109
|
+
}
|
|
110
|
+
export function Badge({ asChild, children, ...props }: BadgeProps) {
|
|
111
|
+
return (
|
|
112
|
+
<BadgeStyled {...props}>
|
|
113
|
+
{React.Children.map(children, (child) => {
|
|
114
|
+
if (React.isValidElement(child)) {
|
|
115
|
+
return React.cloneElement(child, { size: props.size } as any)
|
|
116
|
+
}
|
|
117
|
+
return child
|
|
118
|
+
})}
|
|
119
|
+
</BadgeStyled>
|
|
120
|
+
)
|
|
121
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ComponentProps, ElementType } from 'react'
|
|
2
|
+
import { styled } from '../styles'
|
|
3
|
+
import { Text } from "@radix-ui/themes";
|
|
4
|
+
export const BadgeText = styled(Text, {
|
|
5
|
+
fontFamily: '$default',
|
|
6
|
+
color: '$gray100',
|
|
7
|
+
letterSpacing: '0px',
|
|
8
|
+
variants: {
|
|
9
|
+
size: {
|
|
10
|
+
1: { fontSize: '$16', lineHeight: '$16', fontWeight: '$regular' },
|
|
11
|
+
2: { fontSize: '$14', lineHeight: '$14', fontWeight: '$regular' },
|
|
12
|
+
3: { fontSize: '$12', lineHeight: '$12', fontWeight: '$regular' },
|
|
13
|
+
4: { fontSize: '$10', lineHeight: '$10', fontWeight: '$regular' },
|
|
14
|
+
'xs': { fontSize: '$10', lineHeight: '$10', fontWeight: '$regular' },
|
|
15
|
+
'sm': { fontSize: '$12', lineHeight: '$12', fontWeight: '$regular' },
|
|
16
|
+
'md': { fontSize: '$14', lineHeight: '$14', fontWeight: '$regular' },
|
|
17
|
+
'xl': { fontSize: '$16', lineHeight: '$16', fontWeight: '$regular' },
|
|
18
|
+
},
|
|
19
|
+
|
|
20
|
+
},
|
|
21
|
+
|
|
22
|
+
defaultVariants: {
|
|
23
|
+
size: '1',
|
|
24
|
+
},
|
|
25
|
+
})
|
|
26
|
+
|
|
27
|
+
export type BadgeTextProps = ComponentProps<typeof BadgeText> & {
|
|
28
|
+
as?: ElementType
|
|
29
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ComponentProps, ElementType } from 'react'
|
|
2
|
+
import { styled } from '../styles'
|
|
3
|
+
import { Text } from "@radix-ui/themes";
|
|
4
|
+
export const BodyText = styled(Text, {
|
|
5
|
+
fontFamily: '$default',
|
|
6
|
+
color: '$gray100',
|
|
7
|
+
fontWeight: '$regular',
|
|
8
|
+
variants: {
|
|
9
|
+
size: {
|
|
10
|
+
1: { fontSize: '$16', lineHeight: '$24' },
|
|
11
|
+
2: { fontSize: '$14', lineHeight: '$24' },
|
|
12
|
+
3: { fontSize: '$13', lineHeight: '$24' },
|
|
13
|
+
4: { fontSize: '$12', lineHeight: '$16' },
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
|
|
17
|
+
defaultVariants: {
|
|
18
|
+
size: '1',
|
|
19
|
+
},
|
|
20
|
+
})
|
|
21
|
+
|
|
22
|
+
export type BodyTextProps = ComponentProps<typeof BodyText> & {
|
|
23
|
+
as?: ElementType
|
|
24
|
+
}
|
|
@@ -0,0 +1,349 @@
|
|
|
1
|
+
import { ComponentProps } from 'react'
|
|
2
|
+
import { styled } from '../styles'
|
|
3
|
+
import { Button as ButtonRadix } from '@radix-ui/themes'
|
|
4
|
+
|
|
5
|
+
export const ButtonStyled = styled(ButtonRadix, {
|
|
6
|
+
fontFamily: '$default',
|
|
7
|
+
letterSpacing: 0,
|
|
8
|
+
border: 0,
|
|
9
|
+
transition: 'all 300ms ease-out',
|
|
10
|
+
cursor: 'pointer',
|
|
11
|
+
borderRadius: '$xs',
|
|
12
|
+
boxShadow: '0px 4px 4px 0px rgba(35, 53, 67, 0.08), 0px 2px 4px 0px rgba(35, 53, 67, 0.16)',
|
|
13
|
+
display: 'flex',
|
|
14
|
+
alignItems: 'center',
|
|
15
|
+
justifyContent: 'center',
|
|
16
|
+
gap: '$10',
|
|
17
|
+
'&:hover': {
|
|
18
|
+
transform: 'scale(1.05)',
|
|
19
|
+
},
|
|
20
|
+
'&:active': {
|
|
21
|
+
transform: 'scale(0.95)',
|
|
22
|
+
},
|
|
23
|
+
'&:disabled': {
|
|
24
|
+
cursor: 'not-allowed',
|
|
25
|
+
transition: 'none',
|
|
26
|
+
},
|
|
27
|
+
'&:hover:disabled': {
|
|
28
|
+
transform: 'none',
|
|
29
|
+
},
|
|
30
|
+
variants: {
|
|
31
|
+
color: {
|
|
32
|
+
brand: {},
|
|
33
|
+
neutral: {},
|
|
34
|
+
purple: {},
|
|
35
|
+
},
|
|
36
|
+
variant: {
|
|
37
|
+
text: {
|
|
38
|
+
backgroundColor: 'transparent',
|
|
39
|
+
boxShadow: 'none',
|
|
40
|
+
padding: 0,
|
|
41
|
+
border: 0,
|
|
42
|
+
},
|
|
43
|
+
contained: {
|
|
44
|
+
'&:hover': {
|
|
45
|
+
borderWidth: '$2',
|
|
46
|
+
borderStyle: 'solid',
|
|
47
|
+
},
|
|
48
|
+
'&:focus': {
|
|
49
|
+
border: 0,
|
|
50
|
+
},
|
|
51
|
+
'&:active': {
|
|
52
|
+
borderWidth: '$4',
|
|
53
|
+
borderStyle: 'solid',
|
|
54
|
+
},
|
|
55
|
+
'&:disabled': {
|
|
56
|
+
borderWidth: '$1',
|
|
57
|
+
borderStyle: 'solid',
|
|
58
|
+
boxShadow: 'none',
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
outlined: {
|
|
62
|
+
borderWidth: '$1',
|
|
63
|
+
borderStyle: 'solid',
|
|
64
|
+
'&:hover': {
|
|
65
|
+
borderWidth: '$2',
|
|
66
|
+
borderStyle: 'solid',
|
|
67
|
+
},
|
|
68
|
+
'&:focus': {
|
|
69
|
+
borderWidth: '$2',
|
|
70
|
+
borderStyle: 'solid',
|
|
71
|
+
},
|
|
72
|
+
'&:active': {
|
|
73
|
+
borderWidth: '$2',
|
|
74
|
+
borderStyle: 'solid',
|
|
75
|
+
},
|
|
76
|
+
'&:disabled': {
|
|
77
|
+
borderWidth: '$1',
|
|
78
|
+
borderStyle: 'solid',
|
|
79
|
+
color: '$neutral400',
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
size: {
|
|
84
|
+
xs: {
|
|
85
|
+
padding: '$6 $12',
|
|
86
|
+
fontSize: '$12',
|
|
87
|
+
lineHeight: '$base',
|
|
88
|
+
},
|
|
89
|
+
sm: {
|
|
90
|
+
padding: '$8 $14',
|
|
91
|
+
fontSize: '$13',
|
|
92
|
+
lineHeight: '$smaller',
|
|
93
|
+
},
|
|
94
|
+
md: {
|
|
95
|
+
padding: '$12 $16',
|
|
96
|
+
fontSize: '$14',
|
|
97
|
+
lineHeight: '$smaller',
|
|
98
|
+
},
|
|
99
|
+
lg: {
|
|
100
|
+
padding: '$13 $20',
|
|
101
|
+
fontSize: '$18',
|
|
102
|
+
lineHeight: '$smaller',
|
|
103
|
+
},
|
|
104
|
+
},
|
|
105
|
+
radii: {
|
|
106
|
+
'full': {
|
|
107
|
+
borderRadius: '$full',
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
},
|
|
111
|
+
|
|
112
|
+
defaultVariants: {
|
|
113
|
+
variant: 'contained',
|
|
114
|
+
size: 'md',
|
|
115
|
+
color: 'brand',
|
|
116
|
+
},
|
|
117
|
+
|
|
118
|
+
compoundVariants: [
|
|
119
|
+
{
|
|
120
|
+
variant: 'text',
|
|
121
|
+
color: 'brand',
|
|
122
|
+
css: {
|
|
123
|
+
color: '$brand500',
|
|
124
|
+
'&:hover': { color: '$brand600' },
|
|
125
|
+
'&:focus': { color: '$brand700' },
|
|
126
|
+
'&:active': { color: '$brand500' },
|
|
127
|
+
'&:disabled': { color: '$dark400' },
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
variant: 'text',
|
|
132
|
+
color: 'neutral',
|
|
133
|
+
css: {
|
|
134
|
+
color: '$neutral600',
|
|
135
|
+
'&:hover': { color: '$neutral700' },
|
|
136
|
+
'&:focus': { color: '$neutral800' },
|
|
137
|
+
'&:active': { color: '$neutral500' },
|
|
138
|
+
'&:disabled': { color: '$dark400' },
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
variant: 'text',
|
|
143
|
+
color: 'purple',
|
|
144
|
+
css: {
|
|
145
|
+
color: '$purple500',
|
|
146
|
+
'&:hover': { color: '$purple600' },
|
|
147
|
+
'&:focus': { color: '$purple700' },
|
|
148
|
+
'&:active': { color: '$purple500' },
|
|
149
|
+
'&:disabled': { color: '$dark400' },
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
variant: 'text',
|
|
154
|
+
color: 'green',
|
|
155
|
+
css: {
|
|
156
|
+
color: '$green500',
|
|
157
|
+
'&:hover': { color: '$green600' },
|
|
158
|
+
'&:focus': { color: '$green700' },
|
|
159
|
+
'&:active': { color: '$green500' },
|
|
160
|
+
'&:disabled': { color: '$dark400' },
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
variant: 'text',
|
|
165
|
+
color: 'blue',
|
|
166
|
+
css: {
|
|
167
|
+
color: '$blue500',
|
|
168
|
+
'&:hover': { color: '$blue600' },
|
|
169
|
+
'&:focus': { color: '$blue700' },
|
|
170
|
+
'&:active': { color: '$blue500' },
|
|
171
|
+
'&:disabled': { color: '$dark400' },
|
|
172
|
+
}
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
variant: 'text',
|
|
176
|
+
color: 'red',
|
|
177
|
+
css: {
|
|
178
|
+
color: '$red500',
|
|
179
|
+
'&:hover': { color: '$red600' },
|
|
180
|
+
'&:focus': { color: '$red700' },
|
|
181
|
+
'&:active': { color: '$red500' },
|
|
182
|
+
'&:disabled': { color: '$dark400' },
|
|
183
|
+
}
|
|
184
|
+
},
|
|
185
|
+
|
|
186
|
+
// contained
|
|
187
|
+
{
|
|
188
|
+
variant: 'contained',
|
|
189
|
+
color: 'brand',
|
|
190
|
+
css: {
|
|
191
|
+
color: '$grey50',
|
|
192
|
+
backgroundColor: '$brand500',
|
|
193
|
+
'&:hover': {
|
|
194
|
+
borderColor: '$brand700',
|
|
195
|
+
backgroundColor: '$blue600',
|
|
196
|
+
},
|
|
197
|
+
'&:focus': {
|
|
198
|
+
backgroundColor: '$blue700',
|
|
199
|
+
},
|
|
200
|
+
'&:active': {
|
|
201
|
+
borderColor: '$brand300',
|
|
202
|
+
backgroundColor: '$blue500',
|
|
203
|
+
},
|
|
204
|
+
'&:disabled': {
|
|
205
|
+
borderColor: '$brand50',
|
|
206
|
+
backgroundColor: '$brand50',
|
|
207
|
+
color: '$neutral400',
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
variant: 'contained',
|
|
213
|
+
color: 'neutral',
|
|
214
|
+
css: {
|
|
215
|
+
backgroundColor: '$neutral600',
|
|
216
|
+
color: '$grey50',
|
|
217
|
+
'&:hover': {
|
|
218
|
+
backgroundColor: '$neutral700',
|
|
219
|
+
borderColor: '$neutral800',
|
|
220
|
+
},
|
|
221
|
+
'&:focus': {
|
|
222
|
+
backgroundColor: '$neutral800',
|
|
223
|
+
},
|
|
224
|
+
'&:active': {
|
|
225
|
+
backgroundColor: '$neutral500',
|
|
226
|
+
borderColor: '$neutral400',
|
|
227
|
+
},
|
|
228
|
+
'&:disabled': {
|
|
229
|
+
backgroundColor: '$neutral50',
|
|
230
|
+
borderColor: '$neutral200',
|
|
231
|
+
color: '$neutral400',
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
variant: 'contained',
|
|
237
|
+
color: 'purple',
|
|
238
|
+
css: {
|
|
239
|
+
backgroundColor: '$purple500',
|
|
240
|
+
color: '$grey50',
|
|
241
|
+
'&:hover': {
|
|
242
|
+
backgroundColor: '$purple600',
|
|
243
|
+
borderColor: '$purple700',
|
|
244
|
+
},
|
|
245
|
+
'&:focus': {
|
|
246
|
+
backgroundColor: '$purple700',
|
|
247
|
+
},
|
|
248
|
+
'&:active': {
|
|
249
|
+
borderColor: '$purple300',
|
|
250
|
+
backgroundColor: '$purple500',
|
|
251
|
+
},
|
|
252
|
+
'&:disabled': {
|
|
253
|
+
borderColor: '$purple200',
|
|
254
|
+
backgroundColor: '$purple200',
|
|
255
|
+
color: '$neutral400',
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
},
|
|
259
|
+
|
|
260
|
+
|
|
261
|
+
|
|
262
|
+
// outlined
|
|
263
|
+
{
|
|
264
|
+
variant: 'outlined',
|
|
265
|
+
color: 'brand',
|
|
266
|
+
css: {
|
|
267
|
+
color: '$brand500',
|
|
268
|
+
borderColor: '$brand300',
|
|
269
|
+
backgroundColor: '$grey50',
|
|
270
|
+
'&:hover': {
|
|
271
|
+
borderColor: '$brand400',
|
|
272
|
+
backgroundColor: '$brand50',
|
|
273
|
+
},
|
|
274
|
+
'&:focus': {
|
|
275
|
+
borderColor: '$brand400',
|
|
276
|
+
backgroundColor: '$brand50',
|
|
277
|
+
},
|
|
278
|
+
'&:active': {
|
|
279
|
+
borderColor: '$brand300',
|
|
280
|
+
backgroundColor: '$grey50',
|
|
281
|
+
},
|
|
282
|
+
'&:disabled': {
|
|
283
|
+
borderColor: '$brand200',
|
|
284
|
+
backgroundColor: '$neutral200',
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
},
|
|
288
|
+
{
|
|
289
|
+
variant: 'outlined',
|
|
290
|
+
color: 'neutral',
|
|
291
|
+
css: {
|
|
292
|
+
color: '$neutral600',
|
|
293
|
+
borderColor: '$neutral300',
|
|
294
|
+
backgroundColor: '$grey50',
|
|
295
|
+
'&:hover': {
|
|
296
|
+
borderColor: '$neutral400',
|
|
297
|
+
backgroundColor: '$grey100',
|
|
298
|
+
},
|
|
299
|
+
'&:focus': {
|
|
300
|
+
borderColor: '$neutral400',
|
|
301
|
+
backgroundColor: '$grey100',
|
|
302
|
+
},
|
|
303
|
+
'&:active': {
|
|
304
|
+
borderColor: '$neutral300',
|
|
305
|
+
backgroundColor: '$grey50',
|
|
306
|
+
},
|
|
307
|
+
'&:disabled': {
|
|
308
|
+
borderColor: '$neutral200',
|
|
309
|
+
backgroundColor: '$neutral200',
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
},
|
|
313
|
+
{
|
|
314
|
+
variant: 'outlined',
|
|
315
|
+
color: 'purple',
|
|
316
|
+
css: {
|
|
317
|
+
color: '$purple500',
|
|
318
|
+
borderColor: '$purple300',
|
|
319
|
+
backgroundColor: '$grey50',
|
|
320
|
+
'&:hover': {
|
|
321
|
+
borderColor: '$purple400',
|
|
322
|
+
backgroundColor: '$purple50',
|
|
323
|
+
},
|
|
324
|
+
'&:focus': {
|
|
325
|
+
borderColor: '$purple400',
|
|
326
|
+
backgroundColor: '$purple50',
|
|
327
|
+
},
|
|
328
|
+
'&:active': {
|
|
329
|
+
borderColor: '$purple300',
|
|
330
|
+
backgroundColor: '$grey50',
|
|
331
|
+
},
|
|
332
|
+
'&:disabled': {
|
|
333
|
+
borderColor: '$purple200',
|
|
334
|
+
backgroundColor: '$neutral200',
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
},
|
|
338
|
+
|
|
339
|
+
]
|
|
340
|
+
})
|
|
341
|
+
|
|
342
|
+
export interface ButtonProps extends ComponentProps<typeof ButtonStyled> {
|
|
343
|
+
asChild?: boolean,
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
export function Button({ asChild, ...props }: ButtonProps) {
|
|
347
|
+
const Component = asChild ? ButtonRadix : 'button'
|
|
348
|
+
return <ButtonStyled as={Component} {...props} />
|
|
349
|
+
}
|