@lets-events/react 2.0.0 → 3.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 +6 -0
- package/dist/index.d.mts +6900 -6
- package/dist/index.d.ts +6900 -6
- package/dist/index.js +2342 -21
- package/dist/index.mjs +2318 -20
- package/package.json +8 -1
- package/src/components/Avatar.tsx +56 -0
- package/src/components/BadgeText.tsx +24 -0
- package/src/components/BodyText.tsx +24 -0
- package/src/components/Box.tsx +3 -0
- package/src/components/Button.tsx +172 -0
- package/src/components/ButtonGroup.tsx +128 -0
- package/src/components/CaptionText.tsx +16 -0
- package/src/components/CheckboxGroup.tsx +203 -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 +37 -0
- package/src/components/Label.tsx +28 -0
- package/src/components/RadioGroup.tsx +202 -0
- package/src/components/Subtitle.tsx +26 -0
- package/src/components/Text.tsx +8 -11
- package/src/components/TextField.tsx +162 -0
- package/src/components/TooltipText.tsx +15 -0
- package/src/index.tsx +21 -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": "3.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,24 @@
|
|
|
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
|
+
},
|
|
15
|
+
},
|
|
16
|
+
|
|
17
|
+
defaultVariants: {
|
|
18
|
+
size: '1',
|
|
19
|
+
},
|
|
20
|
+
})
|
|
21
|
+
|
|
22
|
+
export type BadgeTextProps = ComponentProps<typeof BadgeText> & {
|
|
23
|
+
as?: ElementType
|
|
24
|
+
}
|
|
@@ -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,172 @@
|
|
|
1
|
+
import { ComponentProps, ElementType } from 'react'
|
|
2
|
+
import { styled } from '../styles'
|
|
3
|
+
import { Button as ButtonRadix } from '@radix-ui/themes'
|
|
4
|
+
export const ButtonStyled = styled(ButtonRadix, {
|
|
5
|
+
fontFamily: '$default',
|
|
6
|
+
letterSpacing: 0,
|
|
7
|
+
border: 0,
|
|
8
|
+
transition: 'all 300ms ease-out',
|
|
9
|
+
cursor: 'pointer',
|
|
10
|
+
borderRadius: '$xs',
|
|
11
|
+
boxShadow: '0px 4px 4px 0px rgba(35, 53, 67, 0.08), 0px 2px 4px 0px rgba(35, 53, 67, 0.16)',
|
|
12
|
+
display: 'flex',
|
|
13
|
+
alignItems: 'center',
|
|
14
|
+
justifyContent: 'center',
|
|
15
|
+
gap: '$10',
|
|
16
|
+
variants: {
|
|
17
|
+
variant: {
|
|
18
|
+
simple: {
|
|
19
|
+
backgroundColor: 'transparent',
|
|
20
|
+
padding: 0,
|
|
21
|
+
color: '$neutral600',
|
|
22
|
+
border: 0,
|
|
23
|
+
boxShadow: 'none',
|
|
24
|
+
'&:hover': {
|
|
25
|
+
transform: 'scale(1.05)',
|
|
26
|
+
color: '$brand600'
|
|
27
|
+
},
|
|
28
|
+
'&:focus': {
|
|
29
|
+
border: '2px solid $gray500',
|
|
30
|
+
color: '$brand700'
|
|
31
|
+
},
|
|
32
|
+
'&:active': {
|
|
33
|
+
transform: 'scale(0.95)',
|
|
34
|
+
color: '$brand500'
|
|
35
|
+
},
|
|
36
|
+
'&:hover:disabled': {
|
|
37
|
+
transform: 'none',
|
|
38
|
+
},
|
|
39
|
+
'&:disabled': {
|
|
40
|
+
cursor: 'not-allowed',
|
|
41
|
+
color: '$dark400',
|
|
42
|
+
transition: 'none',
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
primary: {
|
|
46
|
+
backgroundColor: '$brand500',
|
|
47
|
+
color: '$grey50',
|
|
48
|
+
'&:hover': {
|
|
49
|
+
border: '$2 solid $brand700',
|
|
50
|
+
transform: 'scale(1.05)',
|
|
51
|
+
backgroundColor: '$blue600',
|
|
52
|
+
},
|
|
53
|
+
'&:focus': {
|
|
54
|
+
border: 0,
|
|
55
|
+
backgroundColor: '$blue700',
|
|
56
|
+
},
|
|
57
|
+
'&:active': {
|
|
58
|
+
transform: 'scale(0.95)',
|
|
59
|
+
border: '$4 solid $brand300',
|
|
60
|
+
backgroundColor: '$blue500',
|
|
61
|
+
},
|
|
62
|
+
'&:hover:disabled': {
|
|
63
|
+
transform: 'none',
|
|
64
|
+
},
|
|
65
|
+
'&:disabled': {
|
|
66
|
+
border: '$1 solid $brand50',
|
|
67
|
+
backgroundColor: '$brand50',
|
|
68
|
+
boxShadow: 'none',
|
|
69
|
+
color: '$neutral400',
|
|
70
|
+
transition: 'none',
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
purple: {
|
|
74
|
+
backgroundColor: '$purple500',
|
|
75
|
+
color: '$grey50',
|
|
76
|
+
'&:hover': {
|
|
77
|
+
transform: 'scale(1.05)',
|
|
78
|
+
backgroundColor: '$purple600',
|
|
79
|
+
border: '$2 solid $purple700',
|
|
80
|
+
},
|
|
81
|
+
'&:focus': {
|
|
82
|
+
border: '$2 solid $purple700',
|
|
83
|
+
backgroundColor: '$purple600',
|
|
84
|
+
},
|
|
85
|
+
'&:active': {
|
|
86
|
+
transform: 'scale(0.95)',
|
|
87
|
+
border: '$2 solid $purple300',
|
|
88
|
+
backgroundColor: '$purple500',
|
|
89
|
+
},
|
|
90
|
+
'&:hover:disabled': {
|
|
91
|
+
transform: 'none',
|
|
92
|
+
},
|
|
93
|
+
'&:disabled': {
|
|
94
|
+
border: '$1 solid $purple200',
|
|
95
|
+
backgroundColor: '$purple200',
|
|
96
|
+
transition: 'none',
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
secondary: {
|
|
100
|
+
backgroundColor: '$neutral500',
|
|
101
|
+
border: '$1 solid $neutral300',
|
|
102
|
+
color: '$neutral600',
|
|
103
|
+
'&:hover': {
|
|
104
|
+
transform: 'scale(1.05)',
|
|
105
|
+
backgroundColor: '$neutral100',
|
|
106
|
+
border: '$1 solid $neutral400',
|
|
107
|
+
},
|
|
108
|
+
'&:focus': {
|
|
109
|
+
backgroundColor: '$neutral200',
|
|
110
|
+
border: 0,
|
|
111
|
+
},
|
|
112
|
+
'&:active': {
|
|
113
|
+
transform: 'scale(0.95)',
|
|
114
|
+
backgroundColor: '$neutral50',
|
|
115
|
+
border: '$1 solid $neutral300',
|
|
116
|
+
},
|
|
117
|
+
'&:hover:disabled': {
|
|
118
|
+
transform: 'none',
|
|
119
|
+
},
|
|
120
|
+
'&:disabled': {
|
|
121
|
+
backgroundColor: '$neutral50',
|
|
122
|
+
border: '$1 solid $neutral200',
|
|
123
|
+
color: '$neutral400',
|
|
124
|
+
transition: 'none',
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
},
|
|
128
|
+
size: {
|
|
129
|
+
xs: {
|
|
130
|
+
padding: '$6 $12',
|
|
131
|
+
fontSize: '$12',
|
|
132
|
+
lineHeight: '$base',
|
|
133
|
+
},
|
|
134
|
+
sm: {
|
|
135
|
+
padding: '$8 $14',
|
|
136
|
+
fontSize: '$13',
|
|
137
|
+
lineHeight: '$smaller',
|
|
138
|
+
},
|
|
139
|
+
md: {
|
|
140
|
+
padding: '$12 $16',
|
|
141
|
+
fontSize: '$14',
|
|
142
|
+
lineHeight: '$smaller',
|
|
143
|
+
},
|
|
144
|
+
lg: {
|
|
145
|
+
padding: '$13 $20',
|
|
146
|
+
fontSize: '$18',
|
|
147
|
+
lineHeight: '$smaller',
|
|
148
|
+
},
|
|
149
|
+
},
|
|
150
|
+
radii: {
|
|
151
|
+
'full': {
|
|
152
|
+
borderRadius: '$full',
|
|
153
|
+
}
|
|
154
|
+
},
|
|
155
|
+
|
|
156
|
+
},
|
|
157
|
+
|
|
158
|
+
defaultVariants: {
|
|
159
|
+
variant: 'simple',
|
|
160
|
+
size: 'md',
|
|
161
|
+
},
|
|
162
|
+
})
|
|
163
|
+
|
|
164
|
+
export interface ButtonProps extends ComponentProps<typeof ButtonStyled> {
|
|
165
|
+
asChild?: boolean,
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
export function Button({ asChild, ...props }: ButtonProps) {
|
|
170
|
+
const Component = asChild ? ButtonRadix : 'button'
|
|
171
|
+
return <ButtonStyled as={Component} {...props} />
|
|
172
|
+
}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { ComponentProps } from "react";
|
|
2
|
+
import { styled } from "../styles";
|
|
3
|
+
import { Button, Flex } from "@radix-ui/themes";
|
|
4
|
+
|
|
5
|
+
export const ButtonItemStyled = styled(Button, {
|
|
6
|
+
fontFamily: '$default',
|
|
7
|
+
letterSpacing: 0,
|
|
8
|
+
border: 0,
|
|
9
|
+
transition: 'all 300ms ease-out',
|
|
10
|
+
cursor: 'pointer',
|
|
11
|
+
variants: {
|
|
12
|
+
active: {
|
|
13
|
+
true: {
|
|
14
|
+
},
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
export const ButtonGroupStyled = styled(Flex, {
|
|
20
|
+
display: 'flex',
|
|
21
|
+
borderRadius: '$md',
|
|
22
|
+
overflow: 'hidden',
|
|
23
|
+
variants: {
|
|
24
|
+
variant: {
|
|
25
|
+
primary: {
|
|
26
|
+
[`& ${ButtonItemStyled}`]: {
|
|
27
|
+
backgroundColor: '$brand500',
|
|
28
|
+
color: '$grey50',
|
|
29
|
+
'&:hover': { backgroundColor: '$blue600' },
|
|
30
|
+
'&:focus': { backgroundColor: '$blue700' },
|
|
31
|
+
'&:active': { backgroundColor: '$blue400' },
|
|
32
|
+
|
|
33
|
+
},
|
|
34
|
+
[`& ${ButtonItemStyled}.active`]: {
|
|
35
|
+
backgroundColor: '$brand700',
|
|
36
|
+
'&:hover': { backgroundColor: '$brand700' },
|
|
37
|
+
'&:focus': { backgroundColor: '$brand700' },
|
|
38
|
+
'&:active': { backgroundColor: '$brand700' },
|
|
39
|
+
},
|
|
40
|
+
|
|
41
|
+
},
|
|
42
|
+
simple: {
|
|
43
|
+
[`& ${ButtonItemStyled}`]: {
|
|
44
|
+
backgroundColor: 'transparent',
|
|
45
|
+
border: '1px solid $dark300',
|
|
46
|
+
color: '$dark600',
|
|
47
|
+
'&:hover': { backgroundColor: '$neutral' },
|
|
48
|
+
},
|
|
49
|
+
[`& ${ButtonItemStyled}.active`]: {
|
|
50
|
+
backgroundColor: '$dark200',
|
|
51
|
+
color: '$dark600',
|
|
52
|
+
'&:hover': { backgroundColor: '$dark200', color: '$dark600', },
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
size: {
|
|
57
|
+
sm: {
|
|
58
|
+
[`& ${ButtonItemStyled}`]: {
|
|
59
|
+
padding: '$8 $14',
|
|
60
|
+
fontSize: '$13',
|
|
61
|
+
|
|
62
|
+
'&:not(:first-child)': {
|
|
63
|
+
borderLeft: 'none',
|
|
64
|
+
},
|
|
65
|
+
'&:first-child': {
|
|
66
|
+
borderTopLeftRadius: '$sm',
|
|
67
|
+
borderBottomLeftRadius: '$sm',
|
|
68
|
+
},
|
|
69
|
+
'&:last-child': {
|
|
70
|
+
borderTopRightRadius: '$sm',
|
|
71
|
+
borderBottomRightRadius: '$sm',
|
|
72
|
+
},
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
md: {
|
|
76
|
+
[`& ${ButtonItemStyled}`]: {
|
|
77
|
+
padding: '$12 $16',
|
|
78
|
+
fontSize: '$14',
|
|
79
|
+
'&:not(:first-child)': {
|
|
80
|
+
borderLeft: 'none',
|
|
81
|
+
},
|
|
82
|
+
'&:first-child': {
|
|
83
|
+
borderTopLeftRadius: '$md',
|
|
84
|
+
borderBottomLeftRadius: '$md',
|
|
85
|
+
},
|
|
86
|
+
'&:last-child': {
|
|
87
|
+
borderTopRightRadius: '$md',
|
|
88
|
+
borderBottomRightRadius: '$md',
|
|
89
|
+
},
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
lg: {
|
|
93
|
+
[`& ${ButtonItemStyled}`]: {
|
|
94
|
+
padding: '$13 $20',
|
|
95
|
+
fontSize: '$18',
|
|
96
|
+
'&:not(:first-child)': {
|
|
97
|
+
borderLeft: 'none',
|
|
98
|
+
},
|
|
99
|
+
'&:first-child': {
|
|
100
|
+
borderTopLeftRadius: '$lg',
|
|
101
|
+
borderBottomLeftRadius: '$lg',
|
|
102
|
+
},
|
|
103
|
+
'&:last-child': {
|
|
104
|
+
borderTopRightRadius: '$lg',
|
|
105
|
+
borderBottomRightRadius: '$lg',
|
|
106
|
+
},
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
|
|
111
|
+
},
|
|
112
|
+
defaultVariants: {
|
|
113
|
+
variant: 'primary',
|
|
114
|
+
size: 'md',
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
export interface ButtonItemProps extends ComponentProps<typeof ButtonItemStyled> { }
|
|
119
|
+
|
|
120
|
+
export type ButtonGroupProps = ComponentProps<typeof ButtonGroupStyled>
|
|
121
|
+
|
|
122
|
+
export function ButtonItem({ children, active, ...props }: ButtonItemProps) {
|
|
123
|
+
return <ButtonItemStyled className={active ? 'active' : ''} {...props}>{children}</ButtonItemStyled>;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export function ButtonGroup({ children, ...props }: ButtonGroupProps) {
|
|
127
|
+
return <ButtonGroupStyled {...props}>{children}</ButtonGroupStyled>;
|
|
128
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ComponentProps, ElementType } from 'react'
|
|
2
|
+
import { styled } from '../styles'
|
|
3
|
+
import { Text } from '@radix-ui/themes'
|
|
4
|
+
|
|
5
|
+
export const CaptionText = styled(Text, {
|
|
6
|
+
fontFamily: '$default',
|
|
7
|
+
color: '$gray100',
|
|
8
|
+
letterSpacing: '0px',
|
|
9
|
+
fontSize: '$14',
|
|
10
|
+
lineHeight: '$16',
|
|
11
|
+
fontWeight: '$regular',
|
|
12
|
+
})
|
|
13
|
+
|
|
14
|
+
export type CaptionTextProps = ComponentProps<typeof CaptionText> & {
|
|
15
|
+
as?: ElementType
|
|
16
|
+
}
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
import { ComponentProps } from 'react'
|
|
2
|
+
import { styled } from '../styles'
|
|
3
|
+
import { CheckboxGroup as CheckboxGroupRadix } from "@radix-ui/themes";
|
|
4
|
+
|
|
5
|
+
export const CheckboxGroupStyled = styled(CheckboxGroupRadix.Root, {
|
|
6
|
+
fontFamily: '$default',
|
|
7
|
+
letterSpacing: '0px',
|
|
8
|
+
fontSize: '$13',
|
|
9
|
+
'svg': {
|
|
10
|
+
display: 'none'
|
|
11
|
+
},
|
|
12
|
+
'label': {
|
|
13
|
+
display: 'flex',
|
|
14
|
+
alignItems: 'center',
|
|
15
|
+
gap: '$8',
|
|
16
|
+
cursor: 'pointer',
|
|
17
|
+
'&:focus button, &:hover button': {
|
|
18
|
+
transition: 'all 300ms ease-out',
|
|
19
|
+
boxShadow: '0px 0px 0px 4px rgba(56, 129, 255, 0.50)'
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
'label button': {
|
|
23
|
+
backgroundColor: '$white',
|
|
24
|
+
borderRadius: '2px',
|
|
25
|
+
height: '$16',
|
|
26
|
+
width: '$16',
|
|
27
|
+
position: 'relative',
|
|
28
|
+
border: '2px solid $dark300',
|
|
29
|
+
cursor: 'pointer',
|
|
30
|
+
},
|
|
31
|
+
'label button[data-state=checked]:before': {
|
|
32
|
+
backgroundColor: '$dark50',
|
|
33
|
+
content: '',
|
|
34
|
+
width: '8px',
|
|
35
|
+
height: '8px',
|
|
36
|
+
position: 'absolute',
|
|
37
|
+
top: '2px',
|
|
38
|
+
right: '2px',
|
|
39
|
+
zIndex: 2,
|
|
40
|
+
},
|
|
41
|
+
'label button[data-state=checked]:after': {
|
|
42
|
+
backgroundColor: '$brand500',
|
|
43
|
+
content: '',
|
|
44
|
+
height: '$16',
|
|
45
|
+
width: '$16',
|
|
46
|
+
position: 'absolute',
|
|
47
|
+
top: '-2px',
|
|
48
|
+
right: '-2px',
|
|
49
|
+
borderRadius: '2px',
|
|
50
|
+
zIndex: 1,
|
|
51
|
+
},
|
|
52
|
+
|
|
53
|
+
variants: {
|
|
54
|
+
isValid: {
|
|
55
|
+
true: {
|
|
56
|
+
'label': {
|
|
57
|
+
'&:focus button, &:hover button': {
|
|
58
|
+
boxShadow: '0px 0px 0px 4px rgba(38, 167, 67, 0.50)',
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
'label button': {
|
|
62
|
+
borderColor: '$green500',
|
|
63
|
+
backgroundColor: '$dark50',
|
|
64
|
+
},
|
|
65
|
+
'label button[data-state=checked]:after': {
|
|
66
|
+
backgroundColor: '$green500',
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
false: {
|
|
70
|
+
'label': {
|
|
71
|
+
'&:focus button, &:hover button': {
|
|
72
|
+
boxShadow: '0px 0px 0px 4px rgba(225, 86, 98, 0.50)'
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
'label button': {
|
|
76
|
+
borderColor: '$error400',
|
|
77
|
+
backgroundColor: '$dark50',
|
|
78
|
+
},
|
|
79
|
+
'label button[data-state=checked]:after': {
|
|
80
|
+
backgroundColor: '$error600',
|
|
81
|
+
},
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
disabled: {
|
|
85
|
+
true: {
|
|
86
|
+
'label': {
|
|
87
|
+
cursor: 'not-allowed',
|
|
88
|
+
opacity: 0.5,
|
|
89
|
+
'&:focus button, &:hover button': {
|
|
90
|
+
boxShadow: 'none',
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
'label button': {
|
|
94
|
+
cursor: 'not-allowed',
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
false: {}
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
|
|
101
|
+
compoundVariants: [
|
|
102
|
+
|
|
103
|
+
{
|
|
104
|
+
isValid: undefined,
|
|
105
|
+
disabled: false,
|
|
106
|
+
css: {
|
|
107
|
+
'label': {
|
|
108
|
+
'&:focus button, &:hover button': {
|
|
109
|
+
boxShadow: '0px 0px 0px 4px rgba(56, 129, 255, 0.50)'
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
'label button': {
|
|
113
|
+
borderColor: '$dark300',
|
|
114
|
+
},
|
|
115
|
+
'label button[data-state=checked]:after': {
|
|
116
|
+
backgroundColor: '$brand500',
|
|
117
|
+
},
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
|
|
121
|
+
{
|
|
122
|
+
isValid: undefined,
|
|
123
|
+
disabled: true,
|
|
124
|
+
css: {
|
|
125
|
+
'label button': {
|
|
126
|
+
borderColor: '$brand100',
|
|
127
|
+
backgroundColor: '$dark50',
|
|
128
|
+
},
|
|
129
|
+
'label button[data-state=checked]:after': {
|
|
130
|
+
backgroundColor: '$brand100',
|
|
131
|
+
},
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
|
|
135
|
+
{
|
|
136
|
+
isValid: true,
|
|
137
|
+
disabled: true,
|
|
138
|
+
css: {
|
|
139
|
+
'label button': {
|
|
140
|
+
borderColor: '$success100',
|
|
141
|
+
backgroundColor: '$dark50',
|
|
142
|
+
},
|
|
143
|
+
'label button[data-state=checked]:after': {
|
|
144
|
+
backgroundColor: '$success100',
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
|
|
149
|
+
{
|
|
150
|
+
isValid: false,
|
|
151
|
+
disabled: true,
|
|
152
|
+
css: {
|
|
153
|
+
'label button': {
|
|
154
|
+
borderColor: '$error100',
|
|
155
|
+
backgroundColor: '$dark50',
|
|
156
|
+
},
|
|
157
|
+
'label button[data-state=checked]:after': {
|
|
158
|
+
backgroundColor: '$error100',
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
]
|
|
163
|
+
})
|
|
164
|
+
|
|
165
|
+
export type CheckboxGroupProps = ComponentProps<typeof CheckboxGroupStyled> & {
|
|
166
|
+
placeholder?: string
|
|
167
|
+
children?: React.ReactNode
|
|
168
|
+
isValid?: boolean
|
|
169
|
+
disabled?: boolean
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
export type CheckboxItemProps = {
|
|
173
|
+
children?: React.ReactNode
|
|
174
|
+
value: string,
|
|
175
|
+
style?: React.CSSProperties
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
export function CheckboxGroup({
|
|
179
|
+
children,
|
|
180
|
+
|
|
181
|
+
...props
|
|
182
|
+
}: CheckboxGroupProps) {
|
|
183
|
+
return (
|
|
184
|
+
<CheckboxGroupStyled {...props}>
|
|
185
|
+
{children}
|
|
186
|
+
</CheckboxGroupStyled>
|
|
187
|
+
)
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
export function CheckboxItem({
|
|
192
|
+
children,
|
|
193
|
+
|
|
194
|
+
...props
|
|
195
|
+
}: CheckboxItemProps) {
|
|
196
|
+
return (
|
|
197
|
+
<CheckboxGroupRadix.Item {...props}>
|
|
198
|
+
{children}
|
|
199
|
+
</CheckboxGroupRadix.Item>
|
|
200
|
+
)
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ComponentProps, ElementType } from 'react'
|
|
2
|
+
import { styled } from '../styles'
|
|
3
|
+
import { Text } from '@radix-ui/themes'
|
|
4
|
+
|
|
5
|
+
export const DisplayText = styled('p', {
|
|
6
|
+
fontFamily: '$default',
|
|
7
|
+
lineHeight: '$base',
|
|
8
|
+
color: '$gray100',
|
|
9
|
+
letterSpacing: '$2',
|
|
10
|
+
fontWeight: '$semibold',
|
|
11
|
+
variants: {
|
|
12
|
+
size: {
|
|
13
|
+
lg: { fontSize: '$56' },
|
|
14
|
+
md: { fontSize: '$48' },
|
|
15
|
+
sm: { fontSize: '$36' },
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
|
|
19
|
+
defaultVariants: {
|
|
20
|
+
size: 'md',
|
|
21
|
+
},
|
|
22
|
+
})
|
|
23
|
+
|
|
24
|
+
export type DisplayTextProps = ComponentProps<typeof DisplayText> & {
|
|
25
|
+
as?: ElementType
|
|
26
|
+
}
|