@lets-events/react 4.0.0 → 6.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.
Files changed (40) hide show
  1. package/.eslintrc.json +2 -2
  2. package/.turbo/turbo-build.log +20 -18
  3. package/CHANGELOG.md +13 -0
  4. package/dist/index.d.mts +2855 -164
  5. package/dist/index.d.ts +2855 -164
  6. package/dist/index.js +1428 -403
  7. package/dist/index.mjs +1374 -369
  8. package/package.json +1 -1
  9. package/src/components/Alert.tsx +256 -0
  10. package/src/components/Avatar.tsx +55 -55
  11. package/src/components/Badge.tsx +129 -121
  12. package/src/components/Box.tsx +3 -3
  13. package/src/components/Button.tsx +328 -348
  14. package/src/components/ButtonGroup.tsx +484 -477
  15. package/src/components/CheckboxGroup.tsx +214 -208
  16. package/src/components/Container.tsx +40 -0
  17. package/src/components/Dropdown.tsx +167 -109
  18. package/src/components/Filter.tsx +164 -95
  19. package/src/components/Flex.tsx +118 -47
  20. package/src/components/Grid.tsx +138 -0
  21. package/src/components/Icon.tsx +47 -47
  22. package/src/components/Modal.tsx +109 -0
  23. package/src/components/RadioGroup.tsx +210 -203
  24. package/src/components/Section.tsx +34 -0
  25. package/src/components/Step.tsx +148 -0
  26. package/src/components/Switch.tsx +109 -0
  27. package/src/components/Text.tsx +32 -26
  28. package/src/components/TextField.tsx +241 -193
  29. package/src/index.tsx +27 -23
  30. package/src/styles/index.ts +38 -38
  31. package/src/types/typographyValues.ts +179 -0
  32. package/tsconfig.json +3 -3
  33. package/src/components/BadgeText.tsx +0 -29
  34. package/src/components/BodyText.tsx +0 -24
  35. package/src/components/CaptionText.tsx +0 -16
  36. package/src/components/DisplayText.tsx +0 -26
  37. package/src/components/Headline.tsx +0 -29
  38. package/src/components/Label.tsx +0 -28
  39. package/src/components/Subtitle.tsx +0 -26
  40. package/src/components/TooltipText.tsx +0 -15
@@ -1,349 +1,329 @@
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} />
1
+ import { ComponentProps } from 'react'
2
+ import { styled } from '../styles'
3
+ import { Button as ButtonRadix } from '@radix-ui/themes'
4
+ import { typographyButtonValues } from '../types/typographyValues'
5
+
6
+ export const ButtonStyled = styled(ButtonRadix, {
7
+ fontFamily: '$default',
8
+ letterSpacing: 0,
9
+ border: 0,
10
+ transition: 'all 300ms ease-out',
11
+ cursor: 'pointer',
12
+ borderRadius: '$xs',
13
+ boxShadow: '0px 4px 4px 0px rgba(35, 53, 67, 0.08), 0px 2px 4px 0px rgba(35, 53, 67, 0.16)',
14
+ display: 'flex',
15
+ alignItems: 'center',
16
+ justifyContent: 'center',
17
+ gap: '$10',
18
+ '&:disabled': {
19
+ cursor: 'not-allowed',
20
+ transition: 'none',
21
+ },
22
+ variants: {
23
+ color: {
24
+ brand: {},
25
+ neutral: {},
26
+ purple: {},
27
+ },
28
+ variant: {
29
+ text: {
30
+ backgroundColor: 'transparent',
31
+ boxShadow: 'none',
32
+ padding: 0,
33
+ border: 0,
34
+ },
35
+ contained: {
36
+ '&:hover': {
37
+ borderWidth: '$2',
38
+ borderStyle: 'solid',
39
+ },
40
+ '&:focus': {
41
+ border: 0,
42
+ },
43
+ '&:active': {
44
+ borderWidth: '$4',
45
+ borderStyle: 'solid',
46
+ },
47
+ '&:disabled': {
48
+ borderWidth: '$1',
49
+ borderStyle: 'solid',
50
+ boxShadow: 'none',
51
+ }
52
+ },
53
+ outlined: {
54
+ borderWidth: '$1',
55
+ borderStyle: 'solid',
56
+ '&:hover': {
57
+ borderWidth: '$2',
58
+ borderStyle: 'solid',
59
+ },
60
+ '&:focus': {
61
+ borderWidth: '$2',
62
+ borderStyle: 'solid',
63
+ },
64
+ '&:active': {
65
+ borderWidth: '$2',
66
+ borderStyle: 'solid',
67
+ },
68
+ '&:disabled': {
69
+ borderWidth: '$1',
70
+ borderStyle: 'solid',
71
+ color: '$neutral400',
72
+ }
73
+ }
74
+ },
75
+ typography: typographyButtonValues,
76
+ fontWeight: {
77
+ regular: { fontWeight: '$regular' },
78
+ medium: { fontWeight: '$medium' },
79
+ semibold: { fontWeight: '$semibold' },
80
+ bold: { fontWeight: '$bold' },
81
+ },
82
+ radii: {
83
+ 'full': {
84
+ borderRadius: '$full',
85
+ }
86
+ },
87
+ },
88
+
89
+ defaultVariants: {
90
+ variant: 'contained',
91
+ typography: 'buttonMedium',
92
+ color: 'brand',
93
+ },
94
+
95
+ compoundVariants: [
96
+ {
97
+ variant: 'text',
98
+ color: 'brand',
99
+ css: {
100
+ color: '$brand500',
101
+ '&:hover': { color: '$brand600' },
102
+ '&:focus': { color: '$brand700' },
103
+ '&:active': { color: '$brand500' },
104
+ '&:disabled': { color: '$dark400' },
105
+ }
106
+ },
107
+ {
108
+ variant: 'text',
109
+ color: 'neutral',
110
+ css: {
111
+ color: '$neutral600',
112
+ '&:hover': { color: '$neutral700' },
113
+ '&:focus': { color: '$neutral800' },
114
+ '&:active': { color: '$neutral500' },
115
+ '&:disabled': { color: '$dark400' },
116
+ }
117
+ },
118
+ {
119
+ variant: 'text',
120
+ color: 'purple',
121
+ css: {
122
+ color: '$purple500',
123
+ '&:hover': { color: '$purple600' },
124
+ '&:focus': { color: '$purple700' },
125
+ '&:active': { color: '$purple500' },
126
+ '&:disabled': { color: '$dark400' },
127
+ }
128
+ },
129
+ {
130
+ variant: 'text',
131
+ color: 'green',
132
+ css: {
133
+ color: '$green500',
134
+ '&:hover': { color: '$green600' },
135
+ '&:focus': { color: '$green700' },
136
+ '&:active': { color: '$green500' },
137
+ '&:disabled': { color: '$dark400' },
138
+ }
139
+ },
140
+ {
141
+ variant: 'text',
142
+ color: 'blue',
143
+ css: {
144
+ color: '$blue500',
145
+ '&:hover': { color: '$blue600' },
146
+ '&:focus': { color: '$blue700' },
147
+ '&:active': { color: '$blue500' },
148
+ '&:disabled': { color: '$dark400' },
149
+ }
150
+ },
151
+ {
152
+ variant: 'text',
153
+ color: 'red',
154
+ css: {
155
+ color: '$red500',
156
+ '&:hover': { color: '$red600' },
157
+ '&:focus': { color: '$red700' },
158
+ '&:active': { color: '$red500' },
159
+ '&:disabled': { color: '$dark400' },
160
+ }
161
+ },
162
+
163
+ // contained
164
+ {
165
+ variant: 'contained',
166
+ color: 'brand',
167
+ css: {
168
+ color: '$grey50',
169
+ backgroundColor: '$brand500',
170
+ borderWidth: '$2',
171
+ borderStyle: 'solid',
172
+ borderColor: 'transparent',
173
+ '&:hover': {
174
+ borderColor: '$brand700',
175
+ backgroundColor: '$blue600',
176
+ },
177
+ '&:focus': {
178
+ backgroundColor: '$blue700',
179
+ },
180
+ '&:active': {
181
+ borderColor: '$brand300',
182
+ backgroundColor: '$blue500',
183
+ },
184
+ '&:disabled': {
185
+ borderColor: '$brand50',
186
+ backgroundColor: '$brand50',
187
+ color: '$neutral400',
188
+ }
189
+ }
190
+ },
191
+ {
192
+ variant: 'contained',
193
+ color: 'neutral',
194
+ css: {
195
+ backgroundColor: '$neutral600',
196
+ color: '$grey50',
197
+ '&:hover': {
198
+ backgroundColor: '$neutral700',
199
+ borderColor: '$neutral800',
200
+ },
201
+ '&:focus': {
202
+ backgroundColor: '$neutral800',
203
+ },
204
+ '&:active': {
205
+ backgroundColor: '$neutral500',
206
+ borderColor: '$neutral400',
207
+ },
208
+ '&:disabled': {
209
+ backgroundColor: '$neutral50',
210
+ borderColor: '$neutral200',
211
+ color: '$neutral400',
212
+ }
213
+ }
214
+ },
215
+ {
216
+ variant: 'contained',
217
+ color: 'purple',
218
+ css: {
219
+ backgroundColor: '$purple500',
220
+ color: '$grey50',
221
+ '&:hover': {
222
+ backgroundColor: '$purple600',
223
+ borderColor: '$purple700',
224
+ },
225
+ '&:focus': {
226
+ backgroundColor: '$purple700',
227
+ },
228
+ '&:active': {
229
+ borderColor: '$purple300',
230
+ backgroundColor: '$purple500',
231
+ },
232
+ '&:disabled': {
233
+ borderColor: '$purple200',
234
+ backgroundColor: '$purple200',
235
+ color: '$neutral400',
236
+ }
237
+ }
238
+ },
239
+
240
+
241
+
242
+ // outlined
243
+ {
244
+ variant: 'outlined',
245
+ color: 'brand',
246
+ css: {
247
+ color: '$brand500',
248
+ borderColor: '$brand300',
249
+ backgroundColor: '$grey50',
250
+ '&:hover': {
251
+ borderColor: '$brand400',
252
+ backgroundColor: '$brand50',
253
+ },
254
+ '&:focus': {
255
+ borderColor: '$brand400',
256
+ backgroundColor: '$brand50',
257
+ },
258
+ '&:active': {
259
+ borderColor: '$brand300',
260
+ backgroundColor: '$grey50',
261
+ },
262
+ '&:disabled': {
263
+ borderColor: '$brand200',
264
+ backgroundColor: '$neutral200',
265
+ }
266
+ }
267
+ },
268
+ {
269
+ variant: 'outlined',
270
+ color: 'neutral',
271
+ css: {
272
+ color: '$neutral600',
273
+ borderColor: '$neutral300',
274
+ backgroundColor: '$grey50',
275
+ '&:hover': {
276
+ borderColor: '$neutral400',
277
+ backgroundColor: '$grey100',
278
+ },
279
+ '&:focus': {
280
+ borderColor: '$neutral400',
281
+ backgroundColor: '$grey100',
282
+ },
283
+ '&:active': {
284
+ borderColor: '$neutral300',
285
+ backgroundColor: '$grey50',
286
+ },
287
+ '&:disabled': {
288
+ borderColor: '$neutral200',
289
+ backgroundColor: '$neutral200',
290
+ }
291
+ }
292
+ },
293
+ {
294
+ variant: 'outlined',
295
+ color: 'purple',
296
+ css: {
297
+ color: '$purple500',
298
+ borderColor: '$purple300',
299
+ backgroundColor: '$grey50',
300
+ '&:hover': {
301
+ borderColor: '$purple400',
302
+ backgroundColor: '$purple50',
303
+ },
304
+ '&:focus': {
305
+ borderColor: '$purple400',
306
+ backgroundColor: '$purple50',
307
+ },
308
+ '&:active': {
309
+ borderColor: '$purple300',
310
+ backgroundColor: '$grey50',
311
+ },
312
+ '&:disabled': {
313
+ borderColor: '$purple200',
314
+ backgroundColor: '$neutral200',
315
+ }
316
+ }
317
+ },
318
+
319
+ ]
320
+ })
321
+
322
+ export interface ButtonProps extends ComponentProps<typeof ButtonStyled> {
323
+ asChild?: boolean,
324
+ }
325
+
326
+ export function Button({ asChild, ...props }: ButtonProps) {
327
+ const Component = asChild ? ButtonRadix : 'button'
328
+ return <ButtonStyled as={Component} {...props} />
349
329
  }