@lets-events/react 3.0.0 → 5.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.
@@ -8,6 +8,7 @@ export const ButtonItemStyled = styled(Button, {
8
8
  border: 0,
9
9
  transition: 'all 300ms ease-out',
10
10
  cursor: 'pointer',
11
+ boxSizing: 'border-box',
11
12
  variants: {
12
13
  active: {
13
14
  true: {
@@ -21,44 +22,66 @@ export const ButtonGroupStyled = styled(Flex, {
21
22
  borderRadius: '$md',
22
23
  overflow: 'hidden',
23
24
  variants: {
25
+ color: {
26
+ brand: {},
27
+ neutral: {},
28
+ purple: {},
29
+ green: {},
30
+ blue: {},
31
+ red: {},
32
+ },
24
33
  variant: {
25
- primary: {
34
+ text: {
26
35
  [`& ${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' },
36
+ backgroundColor: 'transparent',
37
+ boxShadow: 'none',
38
+ padding: 0,
39
+ border: 0,
39
40
  },
40
-
41
41
  },
42
- simple: {
42
+ contained: {
43
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
- },
44
+ borderWidth: '$1',
45
+ borderStyle: 'solid',
46
+ '&:disabled': {
47
+ boxShadow: 'none',
48
+ }
49
+ }
50
+ },
51
+ outlined: {
52
+ [`& ${ButtonItemStyled}`]: {
53
+ borderWidth: '$1',
54
+ borderStyle: 'solid',
55
+ '&:disabled': {
56
+ color: '$neutral400',
57
+ }
58
+ }
54
59
  },
55
60
  },
56
61
  size: {
62
+ xs: {
63
+ [`& ${ButtonItemStyled}`]: {
64
+ padding: '$6 $12',
65
+ fontSize: '$12',
66
+ lineHeight: '$base',
67
+ '&:not(:first-child)': {
68
+ borderLeft: 'none',
69
+ },
70
+ '&:first-child': {
71
+ borderTopLeftRadius: '$xs',
72
+ borderBottomLeftRadius: '$xs',
73
+ },
74
+ '&:last-child': {
75
+ borderTopRightRadius: '$xs',
76
+ borderBottomRightRadius: '$xs',
77
+ },
78
+ }
79
+ },
57
80
  sm: {
58
81
  [`& ${ButtonItemStyled}`]: {
59
82
  padding: '$8 $14',
60
83
  fontSize: '$13',
61
-
84
+ lineHeight: '$smaller',
62
85
  '&:not(:first-child)': {
63
86
  borderLeft: 'none',
64
87
  },
@@ -76,6 +99,7 @@ export const ButtonGroupStyled = styled(Flex, {
76
99
  [`& ${ButtonItemStyled}`]: {
77
100
  padding: '$12 $16',
78
101
  fontSize: '$14',
102
+ lineHeight: '$smaller',
79
103
  '&:not(:first-child)': {
80
104
  borderLeft: 'none',
81
105
  },
@@ -93,6 +117,7 @@ export const ButtonGroupStyled = styled(Flex, {
93
117
  [`& ${ButtonItemStyled}`]: {
94
118
  padding: '$13 $20',
95
119
  fontSize: '$18',
120
+ lineHeight: '$smaller',
96
121
  '&:not(:first-child)': {
97
122
  borderLeft: 'none',
98
123
  },
@@ -107,11 +132,336 @@ export const ButtonGroupStyled = styled(Flex, {
107
132
  }
108
133
  },
109
134
  },
110
-
111
135
  },
136
+
137
+ compoundVariants: [
138
+ // text
139
+ {
140
+ variant: 'text',
141
+ color: 'brand',
142
+ css: {
143
+ [`& ${ButtonItemStyled}`]: {
144
+ color: '$brand500',
145
+ '&:hover': { color: '$brand600' },
146
+ '&:focus': { color: '$brand700' },
147
+ '&:active': { color: '$brand500' },
148
+ '&:disabled': { color: '$dark400' },
149
+ },
150
+ [`& ${ButtonItemStyled}.active`]: {
151
+ color: '$brand700',
152
+ '&:hover': { color: '$brand700' },
153
+ '&:focus': { color: '$brand700' },
154
+ '&:active': { color: '$brand700' },
155
+ },
156
+ }
157
+ },
158
+ {
159
+ variant: 'text',
160
+ color: 'neutral',
161
+ css: {
162
+ [`& ${ButtonItemStyled}`]: {
163
+ color: '$neutral600',
164
+ '&:hover': { color: '$neutral700' },
165
+ '&:focus': { color: '$neutral800' },
166
+ '&:active': { color: '$neutral500' },
167
+ '&:disabled': { color: '$dark400' },
168
+ },
169
+ [`& ${ButtonItemStyled}.active`]: {
170
+ color: '$neutral800',
171
+ '&:hover': { color: '$neutral800' },
172
+ '&:focus': { color: '$neutral800' },
173
+ '&:active': { color: '$neutral800' },
174
+ },
175
+ }
176
+ },
177
+ {
178
+ variant: 'text',
179
+ color: 'purple',
180
+ css: {
181
+ [`& ${ButtonItemStyled}`]: {
182
+ color: '$purple500',
183
+ '&:hover': { color: '$purple600' },
184
+ '&:focus': { color: '$purple700' },
185
+ '&:active': { color: '$purple500' },
186
+ '&:disabled': { color: '$dark400' },
187
+ },
188
+ [`& ${ButtonItemStyled}.active`]: {
189
+ color: '$purple700',
190
+ '&:hover': { color: '$purple700' },
191
+ '&:focus': { color: '$purple700' },
192
+ '&:active': { color: '$purple700' },
193
+ },
194
+ }
195
+ },
196
+ {
197
+ variant: 'text',
198
+ color: 'green',
199
+ css: {
200
+ [`& ${ButtonItemStyled}`]: {
201
+ color: '$green500',
202
+ '&:hover': { color: '$green600' },
203
+ '&:focus': { color: '$green700' },
204
+ '&:active': { color: '$green500' },
205
+ '&:disabled': { color: '$dark400' },
206
+ },
207
+ [`& ${ButtonItemStyled}.active`]: {
208
+ color: '$green700',
209
+ '&:hover': { color: '$green700' },
210
+ '&:focus': { color: '$green700' },
211
+ '&:active': { color: '$green700' },
212
+ },
213
+ }
214
+ },
215
+ {
216
+ variant: 'text',
217
+ color: 'blue',
218
+ css: {
219
+ [`& ${ButtonItemStyled}`]: {
220
+ color: '$blue500',
221
+ '&:hover': { color: '$blue600' },
222
+ '&:focus': { color: '$blue700' },
223
+ '&:active': { color: '$blue500' },
224
+ '&:disabled': { color: '$dark400' },
225
+ },
226
+ [`& ${ButtonItemStyled}.active`]: {
227
+ color: '$blue700',
228
+ '&:hover': { color: '$blue700' },
229
+ '&:focus': { color: '$blue700' },
230
+ '&:active': { color: '$blue700' },
231
+ },
232
+ }
233
+ },
234
+ {
235
+ variant: 'text',
236
+ color: 'red',
237
+ css: {
238
+ [`& ${ButtonItemStyled}`]: {
239
+ color: '$red500',
240
+ '&:hover': { color: '$red600' },
241
+ '&:focus': { color: '$red700' },
242
+ '&:active': { color: '$red500' },
243
+ '&:disabled': { color: '$dark400' },
244
+ },
245
+ [`& ${ButtonItemStyled}.active`]: {
246
+ color: '$red700',
247
+ '&:hover': { color: '$red700' },
248
+ '&:focus': { color: '$red700' },
249
+ '&:active': { color: '$red700' },
250
+ },
251
+ }
252
+ },
253
+
254
+ // contained
255
+ {
256
+ variant: 'contained',
257
+ color: 'brand',
258
+ css: {
259
+ [`& ${ButtonItemStyled}`]: {
260
+ color: '$grey50',
261
+ backgroundColor: '$brand500',
262
+ borderColor: '$brand500',
263
+ '&:hover': {
264
+ backgroundColor: '$blue600',
265
+ },
266
+ '&:focus': {
267
+ backgroundColor: '$blue700',
268
+ },
269
+ '&:active': {
270
+ backgroundColor: '$blue500',
271
+ },
272
+ '&:disabled': {
273
+ backgroundColor: '$brand50',
274
+ color: '$neutral400',
275
+ }
276
+ },
277
+ [`& ${ButtonItemStyled}.active`]: {
278
+ backgroundColor: '$brand700',
279
+ '&:hover': { backgroundColor: '$brand700' },
280
+ '&:focus': { backgroundColor: '$brand700' },
281
+ '&:active': { backgroundColor: '$brand700' },
282
+ },
283
+ }
284
+ },
285
+ {
286
+ variant: 'contained',
287
+ color: 'neutral',
288
+ css: {
289
+ [`& ${ButtonItemStyled}`]: {
290
+ backgroundColor: '$neutral600',
291
+ color: '$grey50',
292
+ '&:hover': {
293
+ backgroundColor: '$neutral700',
294
+ borderColor: '$neutral800',
295
+ },
296
+ '&:focus': {
297
+ backgroundColor: '$neutral800',
298
+ },
299
+ '&:active': {
300
+ backgroundColor: '$neutral500',
301
+ borderColor: '$neutral400',
302
+ },
303
+ '&:disabled': {
304
+ backgroundColor: '$neutral50',
305
+ borderColor: '$neutral200',
306
+ color: '$neutral400',
307
+ }
308
+ },
309
+ [`& ${ButtonItemStyled}.active`]: {
310
+ backgroundColor: '$neutral800',
311
+ '&:hover': { backgroundColor: '$neutral800' },
312
+ '&:focus': { backgroundColor: '$neutral800' },
313
+ '&:active': { backgroundColor: '$neutral800' },
314
+ },
315
+ }
316
+ },
317
+ {
318
+ variant: 'contained',
319
+ color: 'purple',
320
+ css: {
321
+ [`& ${ButtonItemStyled}`]: {
322
+ backgroundColor: '$purple500',
323
+ color: '$grey50',
324
+ '&:hover': {
325
+ backgroundColor: '$purple600',
326
+ borderColor: '$purple700',
327
+ },
328
+ '&:focus': {
329
+ backgroundColor: '$purple700',
330
+ },
331
+ '&:active': {
332
+ borderColor: '$purple300',
333
+ backgroundColor: '$purple500',
334
+ },
335
+ '&:disabled': {
336
+ borderColor: '$purple200',
337
+ backgroundColor: '$purple200',
338
+ color: '$neutral400',
339
+ }
340
+ },
341
+ [`& ${ButtonItemStyled}.active`]: {
342
+ backgroundColor: '$purple700',
343
+ '&:hover': { backgroundColor: '$purple700' },
344
+ '&:focus': { backgroundColor: '$purple700' },
345
+ '&:active': { backgroundColor: '$purple700' },
346
+ },
347
+ }
348
+ },
349
+ // outlined
350
+ {
351
+ variant: 'outlined',
352
+ color: 'brand',
353
+ css: {
354
+ [`& ${ButtonItemStyled}`]: {
355
+ color: '$brand500',
356
+ borderColor: '$brand300',
357
+ backgroundColor: '$grey50',
358
+ '&:hover': {
359
+ borderColor: '$brand400',
360
+ backgroundColor: '$brand50',
361
+ },
362
+ '&:focus': {
363
+ borderColor: '$brand400',
364
+ backgroundColor: '$brand50',
365
+ },
366
+ '&:active': {
367
+ borderColor: '$brand300',
368
+ backgroundColor: '$grey50',
369
+ },
370
+ '&:disabled': {
371
+ borderColor: '$brand200',
372
+ backgroundColor: '$neutral200',
373
+ color: '$neutral400',
374
+ }
375
+ },
376
+ [`& ${ButtonItemStyled}.active`]: {
377
+ color: '$brand700',
378
+ borderColor: '$brand600',
379
+ backgroundColor: '$brand50',
380
+ '&:hover': { backgroundColor: '$brand50', borderColor: '$brand600' },
381
+ '&:focus': { backgroundColor: '$brand50', borderColor: '$brand600' },
382
+ '&:active': { backgroundColor: '$brand50', borderColor: '$brand600' },
383
+ },
384
+ }
385
+ },
386
+ {
387
+ variant: 'outlined',
388
+ color: 'neutral',
389
+ css: {
390
+ [`& ${ButtonItemStyled}`]: {
391
+ color: '$neutral600',
392
+ borderColor: '$neutral300',
393
+ backgroundColor: '$grey50',
394
+ '&:hover': {
395
+ borderColor: '$neutral400',
396
+ backgroundColor: '$grey100',
397
+ },
398
+ '&:focus': {
399
+ borderColor: '$neutral400',
400
+ backgroundColor: '$grey100',
401
+ },
402
+ '&:active': {
403
+ borderColor: '$neutral300',
404
+ backgroundColor: '$grey50',
405
+ },
406
+ '&:disabled': {
407
+ borderColor: '$neutral200',
408
+ backgroundColor: '$neutral200',
409
+ color: '$neutral400',
410
+ }
411
+ },
412
+ [`& ${ButtonItemStyled}.active`]: {
413
+ color: '$neutral800',
414
+ borderColor: '$neutral600',
415
+ backgroundColor: '$grey100',
416
+ '&:hover': { backgroundColor: '$grey100', borderColor: '$neutral600' },
417
+ '&:focus': { backgroundColor: '$grey100', borderColor: '$neutral600' },
418
+ '&:active': { backgroundColor: '$grey100', borderColor: '$neutral600' },
419
+ },
420
+ }
421
+ },
422
+ {
423
+ variant: 'outlined',
424
+ color: 'purple',
425
+ css: {
426
+ [`& ${ButtonItemStyled}`]: {
427
+ color: '$purple500',
428
+ borderColor: '$purple300',
429
+ backgroundColor: '$grey50',
430
+ '&:hover': {
431
+ borderColor: '$purple400',
432
+ backgroundColor: '$purple50',
433
+ },
434
+ '&:focus': {
435
+ borderColor: '$purple400',
436
+ backgroundColor: '$purple50',
437
+ },
438
+ '&:active': {
439
+ borderColor: '$purple300',
440
+ backgroundColor: '$grey50',
441
+ },
442
+ '&:disabled': {
443
+ borderColor: '$purple200',
444
+ backgroundColor: '$neutral200',
445
+ color: '$neutral400',
446
+ }
447
+ },
448
+ [`& ${ButtonItemStyled}.active`]: {
449
+ color: '$purple700',
450
+ borderColor: '$purple600',
451
+ backgroundColor: '$purple50',
452
+ '&:hover': { backgroundColor: '$purple50', borderColor: '$purple600' },
453
+ '&:focus': { backgroundColor: '$purple50', borderColor: '$purple600' },
454
+ '&:active': { backgroundColor: '$purple50', borderColor: '$purple600' },
455
+ },
456
+ }
457
+ },
458
+
459
+ ],
460
+
112
461
  defaultVariants: {
113
- variant: 'primary',
462
+ variant: 'contained',
114
463
  size: 'md',
464
+ color: 'brand',
115
465
  }
116
466
  });
117
467
 
@@ -51,8 +51,8 @@ export const CheckboxGroupStyled = styled(CheckboxGroupRadix.Root, {
51
51
  },
52
52
 
53
53
  variants: {
54
- isValid: {
55
- true: {
54
+ color: {
55
+ success: {
56
56
  'label': {
57
57
  '&:focus button, &:hover button': {
58
58
  boxShadow: '0px 0px 0px 4px rgba(38, 167, 67, 0.50)',
@@ -66,7 +66,8 @@ export const CheckboxGroupStyled = styled(CheckboxGroupRadix.Root, {
66
66
  backgroundColor: '$green500',
67
67
  },
68
68
  },
69
- false: {
69
+ blue: {},
70
+ error: {
70
71
  'label': {
71
72
  '&:focus button, &:hover button': {
72
73
  boxShadow: '0px 0px 0px 4px rgba(225, 86, 98, 0.50)'
@@ -101,7 +102,7 @@ export const CheckboxGroupStyled = styled(CheckboxGroupRadix.Root, {
101
102
  compoundVariants: [
102
103
 
103
104
  {
104
- isValid: undefined,
105
+ color: 'blue',
105
106
  disabled: false,
106
107
  css: {
107
108
  'label': {
@@ -119,7 +120,7 @@ export const CheckboxGroupStyled = styled(CheckboxGroupRadix.Root, {
119
120
  },
120
121
 
121
122
  {
122
- isValid: undefined,
123
+ color: 'blue',
123
124
  disabled: true,
124
125
  css: {
125
126
  'label button': {
@@ -133,7 +134,7 @@ export const CheckboxGroupStyled = styled(CheckboxGroupRadix.Root, {
133
134
  },
134
135
 
135
136
  {
136
- isValid: true,
137
+ color: 'success',
137
138
  disabled: true,
138
139
  css: {
139
140
  'label button': {
@@ -147,7 +148,7 @@ export const CheckboxGroupStyled = styled(CheckboxGroupRadix.Root, {
147
148
  },
148
149
 
149
150
  {
150
- isValid: false,
151
+ color: 'error',
151
152
  disabled: true,
152
153
  css: {
153
154
  'label button': {
@@ -159,13 +160,17 @@ export const CheckboxGroupStyled = styled(CheckboxGroupRadix.Root, {
159
160
  }
160
161
  }
161
162
  }
162
- ]
163
+ ],
164
+ defaultVariants: {
165
+ color: 'blue',
166
+ disabled: false
167
+ }
163
168
  })
164
169
 
165
170
  export type CheckboxGroupProps = ComponentProps<typeof CheckboxGroupStyled> & {
166
171
  placeholder?: string
167
172
  children?: React.ReactNode
168
- isValid?: boolean
173
+ color?: string
169
174
  disabled?: boolean
170
175
  }
171
176
 
@@ -0,0 +1,40 @@
1
+ import { ComponentProps, ElementType } from 'react';
2
+ import { styled } from '../styles';
3
+ import { Container as ContainerRadix } from '@radix-ui/themes';
4
+
5
+ export const ContainerStyled = styled(ContainerRadix, {
6
+ variants: {
7
+ size: {
8
+ xs: { maxWidth: '576px' },
9
+ sm: { minWidth: '577px', maxWidth: '767px' },
10
+ md: { mixWidth: '768px', maxWidth: '991px' },
11
+ lg: { mixWidth: '992px', maxWidth: '1199px' },
12
+ xl: { mixWidth: '1200px', maxWidth: '1399px' },
13
+ xxl: { mixWidth: '1400px' },
14
+ responsive: { width: '100%', maxWidth: '100%', minWidth: '100%' }
15
+ },
16
+ display: {
17
+ none: { display: 'none' },
18
+ initial: { display: 'initial' },
19
+ },
20
+ align: {
21
+ left: { marginLeft: 0, marginRight: 'auto' },
22
+ center: { marginLeft: 'auto', marginRight: 'auto' },
23
+ right: { marginLeft: 'auto', marginRight: 0 },
24
+ },
25
+ },
26
+ defaultVariants: {
27
+ size: 'md',
28
+ align: 'left',
29
+ display: 'initial'
30
+ },
31
+ });
32
+
33
+ export type ContainerProps = ComponentProps<typeof ContainerStyled> & {
34
+ as?: ElementType;
35
+ children: React.ReactNode;
36
+ };
37
+
38
+ export function Container({ children, ...props }: ContainerProps) {
39
+ return <ContainerStyled {...props}>{children}</ContainerStyled>;
40
+ }
@@ -1,9 +1,27 @@
1
1
  import { ComponentProps, ElementType } from 'react';
2
2
  import { styled } from '../styles'
3
3
  import { Flex as FlexRadix } from "@radix-ui/themes";
4
- export const Flex = styled(FlexRadix, {
5
- display: 'flex',
4
+ export const FlexStyled = styled(FlexRadix, {
6
5
  variants: {
6
+ display: {
7
+ 'flex': { display: 'flex' },
8
+ 'inline-flex': { display: 'inline-flex' }
9
+ },
10
+ align: {
11
+ start: { alignItems: 'flex-start' },
12
+ center: { alignItems: 'center' },
13
+ end: { alignItems: 'flex-end' },
14
+ stretch: { alignItems: 'stretch' },
15
+ baseline: { alignItems: 'baseline' },
16
+ },
17
+ justify: {
18
+ start: { justifyContent: 'flex-start' },
19
+ center: { justifyContent: 'center' },
20
+ end: { justifyContent: 'flex-end' },
21
+ between: { justifyContent: 'space-between' },
22
+ around: { justifyContent: 'space-around' },
23
+ evenly: { justifyContent: 'space-evenly' },
24
+ },
7
25
  direction: {
8
26
  row: { flexDirection: 'row' },
9
27
  column: { flexDirection: 'column' },
@@ -31,17 +49,70 @@ export const Flex = styled(FlexRadix, {
31
49
  72: { gap: '$72' },
32
50
  80: { gap: '$80' },
33
51
  full: { gap: '$full' },
52
+ },
53
+ gapY: {
54
+ 2: { gap: '$2' },
55
+ 4: { gap: '$4' },
56
+ 6: { gap: '$6' },
57
+ 8: { gap: '$8' },
58
+ 10: { gap: '$10' },
59
+ 12: { gap: '$12' },
60
+ 14: { gap: '$14' },
61
+ 16: { gap: '$16' },
62
+ 20: { gap: '$20' },
63
+ 22: { gap: '$22' },
64
+ 24: { gap: '$24' },
65
+ 32: { gap: '$32' },
66
+ 36: { gap: '$36' },
67
+ 40: { gap: '$40' },
68
+ 48: { gap: '$48' },
69
+ 56: { gap: '$56' },
70
+ 64: { gap: '$64' },
71
+ 72: { gap: '$72' },
72
+ 80: { gap: '$80' },
73
+ full: { gap: '$full' },
74
+ },
75
+ gapX: {
76
+ 2: { gap: '$2' },
77
+ 4: { gap: '$4' },
78
+ 6: { gap: '$6' },
79
+ 8: { gap: '$8' },
80
+ 10: { gap: '$10' },
81
+ 12: { gap: '$12' },
82
+ 14: { gap: '$14' },
83
+ 16: { gap: '$16' },
84
+ 20: { gap: '$20' },
85
+ 22: { gap: '$22' },
86
+ 24: { gap: '$24' },
87
+ 32: { gap: '$32' },
88
+ 36: { gap: '$36' },
89
+ 40: { gap: '$40' },
90
+ 48: { gap: '$48' },
91
+ 56: { gap: '$56' },
92
+ 64: { gap: '$64' },
93
+ 72: { gap: '$72' },
94
+ 80: { gap: '$80' },
95
+ full: { gap: '$full' },
34
96
  }
35
97
  },
36
98
  defaultVariants: {
99
+ display: 'flex',
37
100
  direction: 'row',
38
101
  gap: 10,
39
102
  }
40
103
 
41
104
  })
42
105
 
43
- export type FlexProps = ComponentProps<typeof Flex> & {
44
- as?: ElementType
106
+ export type FlexProps = ComponentProps<typeof FlexStyled> & {
107
+ as?: ElementType,
108
+ children: React.ReactNode
45
109
  }
46
110
 
47
111
 
112
+ export function Flex({ children, ...props }: FlexProps) {
113
+ return (
114
+ <FlexStyled {...props}>
115
+ {children}
116
+ </FlexStyled>
117
+ )
118
+ }